@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
4 lines • 5.56 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
;Object.defineProperty(exports,"__esModule",{value:!0});const ariaCurrentService=require("./ariaCurrentService-53afa476.js"),componentNames=require("./component-names-2c750b1b.js"),index=require("./index-38f5f0b2.js"),i18n=require("./i18n-737701e2.js"),dev_utils=require("./dev.utils-58fde089.js"),bund=require("./bund-4be96755.js"),prop_validators=require("./prop.validators-888c8338.js");var KeyEnum,TagEnum;!function(e){e[e.error=0]="error",e[e.warning=1]="warning",e[e.info=2]="info",e[e.success=3]="success",e[e.message=4]="message",e[e.close=5]="close",e[e["form-description"]=6]="form-description",e[e.of=7]="of",e[e.characters=8]="characters",e[e.new=9]="new",e[e["no-entries"]=10]="no-entries",e[e["change-order"]=11]="change-order",e[e["action-running"]=12]="action-running",e[e["action-done"]=13]="action-done",e[e["page-first"]=14]="page-first",e[e["page-back"]=15]="page-back",e[e["page-next"]=16]="page-next",e[e["page-last"]=17]="page-last",e[e["entries-per-site"]=18]="entries-per-site",e[e["page-current"]=19]="page-current",e[e["page-selected"]=20]="page-selected",e[e["page-per-site"]=21]="page-per-site",e[e["logo-description"]=22]="logo-description",e[e["open-link-in-tab"]=23]="open-link-in-tab",e[e["kolibri-logo"]=24]="kolibri-logo"}(KeyEnum||(KeyEnum={})),function(e){e[e.abbr=0]="abbr",e[e.accordion=1]="accordion",e[e["accordion-group"]=2]="accordion-group",e[e.alert=3]="alert",e[e.avatar=4]="avatar",e[e.badge=5]="badge",e[e.breadcrumb=6]="breadcrumb",e[e.button=7]="button",e[e["button-group"]=8]="button-group",e[e["button-link"]=9]="button-link",e[e.card=10]="card",e[e.combobox=11]="combobox",e[e.details=12]="details",e[e.drawer=13]="drawer",e[e.form=14]="form",e[e.heading=15]="heading",e[e.icon=16]="icon",e[e.image=17]="image",e[e["indented-text"]=18]="indented-text",e[e["input-checkbox"]=19]="input-checkbox",e[e["input-color"]=20]="input-color",e[e["input-date"]=21]="input-date",e[e["input-email"]=22]="input-email",e[e["input-file"]=23]="input-file",e[e["input-number"]=24]="input-number",e[e["input-password"]=25]="input-password",e[e["input-radio"]=26]="input-radio",e[e["input-range"]=27]="input-range",e[e["input-text"]=28]="input-text",e[e.kolibri=29]="kolibri",e[e.link=30]="link",e[e["link-button"]=31]="link-button",e[e["link-group"]=32]="link-group",e[e.logo=33]="logo",e[e.modal=34]="modal",e[e.nav=35]="nav",e[e.pagination=36]="pagination",e[e["popover-button"]=37]="popover-button",e[e.progress=38]="progress",e[e.select=39]="select",e[e.separator=40]="separator",e[e["single-select"]=41]="single-select",e[e["skip-nav"]=42]="skip-nav",e[e.spin=43]="spin",e[e["split-button"]=44]="split-button",e[e.symbol=45]="symbol",e[e.table=46]="table",e[e["table-stateful"]=47]="table-stateful",e[e["table-stateless"]=48]="table-stateless",e[e.tabs=49]="tabs",e[e.textarea=50]="textarea",e[e["toast-container"]=51]="toast-container",e[e.toolbar=52]="toolbar",e[e.tooltip=53]="tooltip",e[e.tree=54]="tree",e[e["tree-item"]=55]="tree-item"}(TagEnum||(TagEnum={}));const KoliBri=new index.re("kol",KeyEnum,TagEnum);let initialized=!1;const bootstrap=async(e,t,n)=>{var i,o;dev_utils.setDevMode("development"===(null==n?void 0:n.environment)),i18n.initializeI18n(null!==(o=null===(i=null==n?void 0:n.translation)||void 0===i?void 0:i.name)&&void 0!==o?o:"de",null==n?void 0:n.translations),(null==n?void 0:n.transformTagName)&&componentNames.setCustomTagNames(null==n?void 0:n.transformTagName);const r=await index.F(e,t,n);return initialized=!0,r},register=bootstrap,isInitialized=()=>initialized;class ToasterService{constructor(e,t){this.document=e,this.options=t,this.toastContainerElement=this.document.createElement(componentNames.KolToastContainerTag),this.document.body.prepend(this.toastContainerElement)}static getInstance(e,t){if(!isInitialized())throw new Error("Toaster: Call KoliBri bootstrap/register method first.");let n=this.instances.get(e);return n||(n=new ToasterService(e,t),this.instances.set(e,n)),n}dispose(){const e=this.toastContainerElement;e?(this.toastContainerElement=void 0,e.remove()):dev_utils.Log.warn("Toaster service is already disposed.",{forceLog:!0})}enqueue(e){var t,n,i,o;if(this.toastContainerElement&&"function"==typeof this.toastContainerElement.enqueue){const r=null!==(n=null===(t=this.options)||void 0===t?void 0:t.defaultVariant)&&void 0!==n?n:void 0,a=null!==(o=null===(i=this.options)||void 0===i?void 0:i.defaultAlertVariant)&&void 0!==o?o:void 0;return e.alertVariant||e.variant||!this.options||(e.variant=null!=a?a:r),this.toastContainerElement.enqueue(e)}}closeAll(e=!1){this.toastContainerElement&&"function"==typeof this.toastContainerElement.closeAll&&this.toastContainerElement.closeAll(e)}}ToasterService.instances=new Map,exports.setCurrentLocation=ariaCurrentService.setCurrentLocation,exports.BUNDESAEMTER=bund.BUNDESAEMTER,exports.BUNDESANSTALTEN=bund.BUNDESANSTALTEN,exports.BUNDESMINISTERIEN=bund.BUNDESMINISTERIEN,exports.BUND_LOGO_TEXT_MAP=bund.BUND_LOGO_TEXT_MAP,Object.defineProperty(exports,"Bundesamt",{enumerable:!0,get:function(){return bund.Bundesamt}}),Object.defineProperty(exports,"Bundesanstalt",{enumerable:!0,get:function(){return bund.Bundesanstalt}}),Object.defineProperty(exports,"Bundesministerium",{enumerable:!0,get:function(){return bund.Bundesministerium}}),exports.KoliBriDevHelper=prop_validators.KoliBriDevHelper,exports.KoliBri=KoliBri,exports.ToasterService=ToasterService,exports.bootstrap=bootstrap,exports.isInitialized=isInitialized,exports.register=register;