@freshworks/crayons
Version:
Crayons Web Components library
45 lines (40 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-a784dd6b.js');
const toastUtil = require('./toast-util-7cfdc6df.js');
require('./index-4c71e7e2.js');
let Toast = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
/**
* position of the toast notification in screen
*/
this.position = 'top-center';
/**
* Time duration of the toast visibility
*/
this.timeout = 4000;
/**
* Type of the toast - success,failure, warning, inprogress
*/
this.type = 'warning';
/**
* The Content of the action link
*/
this.actionLinkText = '';
/**
* won't close automatically
*/
this.sticky = false;
}
componentWillLoad() {
this.toastContainer = toastUtil.createToastStack(this);
}
async trigger(opts) {
toastUtil.createToastNotification(opts, this.toastContainer, this);
}
render() {
return (index.h(index.Host, null, index.h("slot", null)));
}
};
exports.fw_toast = Toast;