@arturdoruch/process-noticer v1.2.3
ProcessNoticer
Displays message notices of pending processes (e.g. while sending ajax request). Displays process pending loader.
Install
yarn add @arturdoruch/process-noticerUsage
import ProcessNoticer from '@arturdoruch/process-noticer';
import '@arturdoruch/process-noticer/styles/process-notice.css';
const processNoticer = new ProcessNoticer();
// Example of usage.
let notice = processNoticer.add('Sending ajax request', true);
processNoticer.display();
setTimeout(function () {
processNoticer.remove(notice);
}, 3000);Global options
Global options of process noticer HTML elements, used by every instance of the ProcessNoticer. Set by calling function setOptions().
import { setOptions as processNoticerSetOptions } from '@arturdoruch/process-noticer';
processNoticerSetOptions({
// Options
});elementsIdPrefixstring (default:ad-process-notice)Prefix of "id" attribute of the list and loader elements.
listTagstring (default:ul)Tag name for list element.
itemTagstring (default:li)Tag name for list item element.
centerListboolean (default:false)Whether to center displayed process notice list.
Instance options
Options of process noticer HTML elements applied for specific ProcessNoticer instance.
import ProcessNoticer from '@arturdoruch/process-noticer';
const processNoticer = new ProcessNoticer({
// options
});listClassstring (default:null)The class name of the noticer list element.
listItemClassstring (default:null)The class name of the noticer a list item element.
loaderClassstring (default:null)The class name of the noticer loader element.
centerListboolean (default:false)Whether to center displayed process notice list.