@baloise/ds-core 16.0.1 → 16.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/tokens.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
- package/dist/baloise-design-system/index.esm.js +1 -1
- package/dist/baloise-design-system/{p-31d1ce65.system.js → p-04bd9be8.system.js} +1 -1
- package/dist/baloise-design-system/{p-3752d2b02f.entry.js → p-077f77b758.entry.js} +1 -1
- package/dist/baloise-design-system/{p-ba0c0041c8.entry.js → p-0a9b41c8dc.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1698bb2cba.system.entry.js → p-1521c512e4.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e957044623.system.entry.js → p-1d2086008c.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-52bf30115d.entry.js → p-1e69692eb4.entry.js} +1 -1
- package/dist/baloise-design-system/{p-77cc8106.system.js → p-1f3fc31a.system.js} +1 -1
- package/dist/baloise-design-system/{p-026db62d95.system.entry.js → p-20a149e171.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-ac2429c3fe.system.entry.js → p-2c9dcfa044.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9283fd46.js → p-32b04c32.js} +1 -1
- package/dist/baloise-design-system/p-34d1472a.system.js +1 -1
- package/dist/baloise-design-system/p-3bbf43bb.system.js +1 -1
- package/dist/baloise-design-system/{p-8f10d0f51d.entry.js → p-3f7f81de5f.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a411b2da7b.system.entry.js → p-4ef27ea80e.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c5d7474f.js → p-4f7f21d9.js} +1 -1
- package/dist/baloise-design-system/{p-57c08f3a.system.js → p-5bcca382.system.js} +1 -1
- package/dist/baloise-design-system/{p-8d00db2875.entry.js → p-60b81d90cb.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b815645e4d.system.entry.js → p-61b074323f.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-8a58ab894a.system.entry.js → p-6e9fcfda30.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0ab0ba13f7.system.entry.js → p-8a825bdf50.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-76a2126536.entry.js → p-96c453829c.entry.js} +1 -1
- package/dist/baloise-design-system/p-9e4fcb76.js +1 -1
- package/dist/baloise-design-system/{p-8160360a71.system.entry.js → p-a6bdb63428.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-85d4214c2f.system.entry.js → p-b13482115a.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-967962336b.entry.js → p-b20bab5f6c.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0b0dab2dd2.entry.js → p-beff106dec.entry.js} +1 -1
- package/dist/baloise-design-system/{p-84d3017d62.entry.js → p-c6a6656d68.entry.js} +1 -1
- package/dist/baloise-design-system/{p-114f9c0d16.entry.js → p-d394b42275.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d49b5d7e57.system.entry.js → p-e043c27ff9.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9f1df6ded1.system.entry.js → p-e09fa14522.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-2903b1abe2.entry.js → p-e88015c785.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6800dcbb73.system.entry.js → p-ea6a80e6d6.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d7d6400d5b.entry.js → p-eaf55a0d0e.entry.js} +1 -1
- package/dist/baloise-design-system/{p-aa2b973ba8.entry.js → p-f1a3559751.entry.js} +1 -1
- package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-datepicker.cjs.entry.js +3 -3
- package/dist/cjs/bal-hint_3.cjs.entry.js +3 -3
- package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
- package/dist/cjs/bal-logo.cjs.entry.js +3 -3
- package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
- package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
- package/dist/cjs/bal-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/bal-shape.cjs.entry.js +1 -1
- package/dist/cjs/bal-steps.cjs.entry.js +3 -3
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
- package/dist/cjs/{breakpoints.decorator-c48800ec.js → breakpoints.decorator-ebdaca35.js} +1 -1
- package/dist/cjs/{breakpoints.subject-73f751a8.js → breakpoints.subject-e790c7e3.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/initialize-e38e7028.js +1 -1
- package/dist/cjs/{tokens.esm-5c87582a.js → tokens.esm-b8f01abd.js} +1 -1
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/esm/bal-carousel_2.entry.js +3 -3
- package/dist/esm/bal-datepicker.entry.js +3 -3
- package/dist/esm/bal-hint_3.entry.js +3 -3
- package/dist/esm/bal-list_8.entry.js +3 -3
- package/dist/esm/bal-logo.entry.js +3 -3
- package/dist/esm/bal-nav_8.entry.js +3 -3
- package/dist/esm/bal-navbar_5.entry.js +3 -3
- package/dist/esm/bal-pagination.entry.js +3 -3
- package/dist/esm/bal-popover_2.entry.js +3 -3
- package/dist/esm/bal-progress-bar.entry.js +3 -3
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-steps.entry.js +3 -3
- package/dist/esm/bal-tab-item_2.entry.js +3 -3
- package/dist/esm/{breakpoints.decorator-a2e64b02.js → breakpoints.decorator-03a96702.js} +1 -1
- package/dist/esm/{breakpoints.subject-b288661b.js → breakpoints.subject-290977a3.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/initialize-66615dde.js +1 -1
- package/dist/esm/{tokens.esm-38864070.js → tokens.esm-ca010903.js} +1 -1
- package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
- package/dist/esm-es5/bal-datepicker.entry.js +1 -1
- package/dist/esm-es5/bal-hint_3.entry.js +1 -1
- package/dist/esm-es5/bal-list_8.entry.js +1 -1
- package/dist/esm-es5/bal-logo.entry.js +1 -1
- package/dist/esm-es5/bal-nav_8.entry.js +1 -1
- package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
- package/dist/esm-es5/bal-pagination.entry.js +1 -1
- package/dist/esm-es5/bal-popover_2.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
- package/dist/esm-es5/bal-shape.entry.js +1 -1
- package/dist/esm-es5/bal-steps.entry.js +1 -1
- package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
- package/dist/esm-es5/{breakpoints.decorator-a2e64b02.js → breakpoints.decorator-03a96702.js} +1 -1
- package/dist/esm-es5/{breakpoints.subject-b288661b.js → breakpoints.subject-290977a3.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/initialize-66615dde.js +1 -1
- package/package.json +7 -7
- /package/dist/baloise-design-system/{p-8eb2c245.js → p-8d102058.js} +0 -0
- /package/dist/baloise-design-system/{p-945076f8.system.js → p-ac42a59e.system.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-38864070.js → tokens.esm-ca010903.js} +0 -0
package/dist/esm-es5/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter,__extends,__generator}from"tslib";export{F as FileUploadRejectionReason}from"./bal-file-upload.type-2a70f4ec.js";export{B as BalDate,i as i18nBalDate}from"./date-db6afc26.js";export{i as i18nBalClose}from"./bal-close.i18n-f2daa707.js";export{i as i18nBalDatepicker}from"./bal-datepicker.i18n-63a3cb67.js";export{i as i18nBalTimeInput}from"./bal-time-input.i18n-157c7092.js";export{i as i18nBalInputStepper}from"./bal-input-stepper.i18n-aaa4a009.js";export{i as i18nBalLabel}from"./bal-label.i18n-4212be56.js";export{a as BalSnackbarController,B as BalToastController,c as balSnackbarController,b as balToastController,i as initialize,i as initializeBaloiseDesignSystem,s as setupConfig}from"./initialize-66615dde.js";export{n as newBalStepOption}from"./bal-step.util-3905ad56.js";export{n as newBalTabOption}from"./bal-tab.util-933315fe.js";import{g as getAppRoot,c as componentOnReady}from"./helpers-c201154e.js";export{c as componentOnReady,e as deepReady,g as getAppRoot,i as isDescendant,s as shallowReady,f as wait,b as waitAfterFramePaint,d as waitAfterIdleCallback,w as waitForComponent,a as waitForDesignSystem}from"./helpers-c201154e.js";export{s as scrollToFirstInvalidField}from"./form-fb8dd9f5.js";export{B as BalScrollHandler}from"./scroll-972c7ce5.js";import{b as balBrowser}from"./browser-a8073d92.js";export{b as balBrowser}from"./browser-a8073d92.js";import{b as balDevice}from"./device-8c6d2881.js";export{B as BalDevice,b as balDevice}from"./device-8c6d2881.js";import{g as getOverlays,a as getOverlay}from"./overlays-9d49a4a5.js";import{B as BalWindowResizeListener,b as balBreakpoints}from"./breakpoints.subject-
|
|
1
|
+
import{__awaiter,__extends,__generator}from"tslib";export{F as FileUploadRejectionReason}from"./bal-file-upload.type-2a70f4ec.js";export{B as BalDate,i as i18nBalDate}from"./date-db6afc26.js";export{i as i18nBalClose}from"./bal-close.i18n-f2daa707.js";export{i as i18nBalDatepicker}from"./bal-datepicker.i18n-63a3cb67.js";export{i as i18nBalTimeInput}from"./bal-time-input.i18n-157c7092.js";export{i as i18nBalInputStepper}from"./bal-input-stepper.i18n-aaa4a009.js";export{i as i18nBalLabel}from"./bal-label.i18n-4212be56.js";export{a as BalSnackbarController,B as BalToastController,c as balSnackbarController,b as balToastController,i as initialize,i as initializeBaloiseDesignSystem,s as setupConfig}from"./initialize-66615dde.js";export{n as newBalStepOption}from"./bal-step.util-3905ad56.js";export{n as newBalTabOption}from"./bal-tab.util-933315fe.js";import{g as getAppRoot,c as componentOnReady}from"./helpers-c201154e.js";export{c as componentOnReady,e as deepReady,g as getAppRoot,i as isDescendant,s as shallowReady,f as wait,b as waitAfterFramePaint,d as waitAfterIdleCallback,w as waitForComponent,a as waitForDesignSystem}from"./helpers-c201154e.js";export{s as scrollToFirstInvalidField}from"./form-fb8dd9f5.js";export{B as BalScrollHandler}from"./scroll-972c7ce5.js";import{b as balBrowser}from"./browser-a8073d92.js";export{b as balBrowser}from"./browser-a8073d92.js";import{b as balDevice}from"./device-8c6d2881.js";export{B as BalDevice,b as balDevice}from"./device-8c6d2881.js";import{g as getOverlays,a as getOverlay}from"./overlays-9d49a4a5.js";import{B as BalWindowResizeListener,b as balBreakpoints}from"./breakpoints.subject-290977a3.js";export{c as BalBreakpointSubject,d as BalBreakpointsUtil,a as balBreakpointSubject,b as balBreakpoints}from"./breakpoints.subject-290977a3.js";export{a as attachToConfig,d as detachFromConfig,o as onBalConfigChange,u as updateBalAllowedLanguages,b as updateBalAnimated,c as updateBalIcons,e as updateBalLanguage,f as updateBalRegion,g as useBalConfig}from"./config.utils-6ac6c9bd.js";export{d as defaultConfig}from"./config.default-79f94bf7.js";import{S as Subject}from"./listener-04842ae9.js";export{B as BalSwipeSubject}from"./swipe.subject-f1d64e8d.js";import"./index.esm-ec4cba26.js";import"./index-82aff103.js";import"./_commonjsHelpers-1c8beb5f.js";import"./index-b6003bc7.js";import"./icons.constant-a7885631.js";import"./tokens.esm-ca010903.js";import"./log-dfd1c19f.js";var i18nBalFieldLabel={de:{optional:" (optional)"},en:{optional:" (optional)"},fr:{optional:" (optionnel)"},it:{optional:" (opzionale)"},nl:{optional:" (optioneel)"},es:{optional:" (opcional)"},pl:{optional:" (opcjonalnie)"},pt:{optional:" (opcional)"},sv:{optional:" (frivillig)"},fi:{optional:" (valinnainen)"}};var newBalCheckboxOption=function(e){return Object.assign(Object.assign({interface:"checkbox",labelHidden:false,flat:false,disabled:false,readonly:false,required:false,nonSubmit:false,invalid:false,checked:false},e),{label:"",html:e.label})};var newBalRadioOption=function(e){return Object.assign(Object.assign({interface:"radio",labelHidden:false,flat:false,disabled:false,readonly:false,required:false,nonSubmit:false,invisible:false,invalid:false},e),{label:"",html:e.label})};var newBalOptionValue=function(e,a,t,o){if(t===void 0){t=false}return{value:e,label:a,disabled:t,data:o}};var newBalSingleOptionValue=function(e,a,t){if(a===void 0){a=false}return newBalOptionValue(e,e,a,t)};var BalOrientationSubject=function(e){__extends(a,e);function a(){var a=e.call(this,(function(e){return e.orientationListener(a.state)}))||this;a.listener=new BalWindowResizeListener;a.state=balDevice.orientation.toObject();a.listener.connect();a.listener.add((function(){var e=balDevice.orientation.toObject();if(!a.isEqual(e)){a.state=e;a.notify(undefined)}}));return a}a.prototype.attach=function(a){e.prototype.attach.call(this,a);a.orientationListener(this.state)};a.prototype.isEqual=function(e){return e.landscape===this.state.landscape&&e.portrait===this.state.portrait};return a}(Subject);var balOrientationSubject=new BalOrientationSubject;var BalModalController=function(){function e(){this.tag="bal-modal"}e.prototype.create=function(e){var a=this;if(typeof customElements!=="undefined"&&balBrowser.hasDocument){return customElements.whenDefined(this.tag).then((function(){var t=document.createElement(a.tag);Object.assign(t,e);getAppRoot(document).appendChild(t);return new Promise((function(e){return componentOnReady(t,e)}))}))}return Promise.resolve()};e.prototype.dismissAll=function(e,a){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(o){switch(o.label){case 0:if(!balBrowser.hasDocument)return[3,2];t=getOverlays(document,this.tag);return[4,Promise.all(t.map((function(t){return t.dismiss(e,a)})))];case 1:o.sent();o.label=2;case 2:return[2]}}))}))};e.prototype.dismiss=function(e,a,t){if(balBrowser.hasDocument){var o=getOverlay(document,this.tag,t);if(!o){return Promise.reject("overlay does not exist")}return o.dismiss(e,a)}return Promise.resolve(false)};e.prototype.getTop=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(balBrowser.hasDocument){return[2,getOverlay(document,this.tag)]}return[2]}))}))};return e}();var balModalController=new BalModalController;var hasTouchSupport=function(){return balDevice.hasTouchScreen};var isBrowser=function(e){if(e==="Safari"){return balBrowser.isSafari}return false};var getPlatforms=function(e){return balBreakpoints.detect()};var isPlatform=function(e,a){if(typeof e==="string"){a=e}if(a){return balBreakpoints.detect().includes(a)}return false};var NewBalOptionValue=newBalOptionValue;var NewBalSingleOptionValue=newBalSingleOptionValue;export{BalModalController,BalOrientationSubject,NewBalOptionValue,NewBalSingleOptionValue,balModalController,balOrientationSubject,getPlatforms,hasTouchSupport,i18nBalFieldLabel,isBrowser,isPlatform,newBalCheckboxOption,newBalOptionValue,newBalRadioOption,newBalSingleOptionValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter,__extends,__generator}from"tslib";import{a as setPlatformHelpers}from"./index-b6003bc7.js";import{b as balBrowser}from"./browser-a8073d92.js";import{d as defaultConfig}from"./config.default-79f94bf7.js";var BalNoticeController=function(){function t(t){this.options=t;this.container=null;this.queue=[];this.preQueue=[];this.queueLimit=5}t.prototype.create=function(t){var i=this;if(balBrowser.hasDocument){this.setupContainer();var e=this.findClone(t);if(e===undefined){var n=document.createElement(this.options.tag);Object.assign(n,t);n.addEventListener("balClose",(function(t){i.removeFromQueue(t.detail)}));this.preQueue.push(n);this.updateQueue();return n}return e}};t.prototype.setQueue=function(t){this.queueLimit=t};t.prototype.dismissAll=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,n,r;return __generator(this,(function(s){switch(s.label){case 0:i=(t=this.container)===null||t===void 0?void 0:t.querySelectorAll(this.options.tag);if(!i)return[3,2];e=[];for(n=0;n<i.length;n++){r=i[n];if(r.close){e.push(r.close())}}return[4,Promise.all(e)];case 1:s.sent();s.label=2;case 2:return[2]}}))}))};t.prototype.clearAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){console.warn("[DEPRECATED] - use dismissAll() instead");return[2,this.dismissAll()]}))}))};t.prototype.findClone=function(t){for(var i=0;i<this.queue.length;i++){var e=this.queue[i];if(e.message===t.message&&e.color===t.color){return e}}return undefined};t.prototype.setupContainer=function(){if(balBrowser.hasDocument){var t="".concat(this.options.tag,"-container");this.container=document.getElementById(t);if(this.container)return;if(!this.container){this.container=document.createElement("bal-notices");this.container.setAttribute("interface",this.options.tag.replace("bal-",""));this.container.id=t}document.body.appendChild(this.container)}};t.prototype.updateQueue=function(){var t;if(this.queue.length<this.queueLimit){var i=this.preQueue.shift();if(i&&this.container){this.queue.push(i);this.container.insertAdjacentElement("beforeend",i)}}if(this.queue.length===0){(t=this.container)===null||t===void 0?void 0:t.remove()}};t.prototype.removeFromQueue=function(t){var i=this;this.queue=this.queue.filter((function(i){return i.id!==t}));setTimeout((function(){return i.updateQueue()}),0)};return t}();var BalToastController=function(t){__extends(i,t);function i(){return t.call(this,{tag:"bal-toast"})||this}i.prototype.create=function(i){return t.prototype.create.call(this,i)};return i}(BalNoticeController);var balToastController=new BalToastController;var BalSnackbarController=function(t){__extends(i,t);function i(){return t.call(this,{tag:"bal-snackbar"})||this}i.prototype.create=function(i){return t.prototype.create.call(this,i)};return i}(BalNoticeController);var balSnackbarController=new BalSnackbarController;var BALOISE_SESSION_KEY="baloise-persist-config";var Config=function(){function t(){this._componentObservers=[];this._observers=[];this._config=defaultConfig}Object.defineProperty(t.prototype,"locale",{get:function(){return"".concat(this._config.language,"-").concat(this._config.region)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"region",{get:function(){return this._config.region},set:function(t){if(t!==this._config.region){this._config.region=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"language",{get:function(){return this._config.language},set:function(t){if(t!==this._config.language){if(this._config.allowedLanguages.includes(t)){this._config.language=t}else{this._config.language=this._config.fallbackLanguage}this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allowedLanguages",{get:function(){return this._config.allowedLanguages},set:function(t){if(t!==this._config.allowedLanguages){this._config.allowedLanguages=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"icons",{get:function(){return this._config.icons},set:function(t){this._config.icons=Object.assign(Object.assign({},this._config.icons),t);this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"logger",{get:function(){return this._config.logger},set:function(t){this._config.logger=Object.assign({},t);this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"animated",{get:function(){return this._config.animated},set:function(t){this._config.animated=t;this._notify()},enumerable:false,configurable:true});t.prototype.attach=function(t){var i=this._observers.includes(t);if(i){return console.log("Subject: Observer has been attached already.")}this._observers.push(t);t.configChanged(this._config)};t.prototype.detach=function(t){var i=this._observers.indexOf(t);if(i===-1){return console.log("Subject: Nonexistent observer.")}this._observers.splice(i,1)};t.prototype.attachComponent=function(t){var i=this._componentObservers.includes(t);if(i){return console.log("Subject: Observer has been attached already.")}this._componentObservers.push(t);t.configChanged(this._config)};t.prototype.detachComponent=function(t){var i=this._componentObservers.indexOf(t);if(i===-1){return console.log("Subject: Nonexistent observer.")}this._componentObservers.splice(i,1)};t.prototype.toString=function(){return JSON.stringify(this._config)};t.prototype.reset=function(t){this._config=Object.assign(Object.assign(Object.assign({},this._config),t),{icons:Object.assign(Object.assign({},this._config.icons),t.icons)});this._notify(false)};t.prototype._notify=function(t){if(t===void 0){t=true}for(var i=0,e=this._componentObservers;i<e.length;i++){var n=e[i];n.configChanged(this._config)}if(t){for(var r=0,s=this._observers;r<s.length;r++){var n=s[r];n.configChanged(this._config)}}if(balBrowser.hasWindow){saveConfig(window,this._config)}};return t}();var config=new Config;var configFromSession=function(t){try{var i=t.sessionStorage.getItem(BALOISE_SESSION_KEY);return i!==null?JSON.parse(i):{}}catch(t){return{}}};var saveConfig=function(t,i){try{t.sessionStorage.setItem(BALOISE_SESSION_KEY,JSON.stringify(i))}catch(t){return}};var setupConfig=function(t,i){if(t===void 0){t={}}if(i===void 0){i={}}if(Object.keys(i).length===0&&balBrowser.hasWindow){i=window}i.BaloiseDesignSystem=i.BaloiseDesignSystem||{};config.reset(Object.assign(Object.assign(Object.assign({},configFromSession(i)),t),{icons:Object.assign(Object.assign({},configFromSession(i).icons),t.icons)}));i.BaloiseDesignSystem.config=config};var VERSION="16.0.
|
|
1
|
+
import{__awaiter,__extends,__generator}from"tslib";import{a as setPlatformHelpers}from"./index-b6003bc7.js";import{b as balBrowser}from"./browser-a8073d92.js";import{d as defaultConfig}from"./config.default-79f94bf7.js";var BalNoticeController=function(){function t(t){this.options=t;this.container=null;this.queue=[];this.preQueue=[];this.queueLimit=5}t.prototype.create=function(t){var i=this;if(balBrowser.hasDocument){this.setupContainer();var e=this.findClone(t);if(e===undefined){var n=document.createElement(this.options.tag);Object.assign(n,t);n.addEventListener("balClose",(function(t){i.removeFromQueue(t.detail)}));this.preQueue.push(n);this.updateQueue();return n}return e}};t.prototype.setQueue=function(t){this.queueLimit=t};t.prototype.dismissAll=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,n,r;return __generator(this,(function(s){switch(s.label){case 0:i=(t=this.container)===null||t===void 0?void 0:t.querySelectorAll(this.options.tag);if(!i)return[3,2];e=[];for(n=0;n<i.length;n++){r=i[n];if(r.close){e.push(r.close())}}return[4,Promise.all(e)];case 1:s.sent();s.label=2;case 2:return[2]}}))}))};t.prototype.clearAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){console.warn("[DEPRECATED] - use dismissAll() instead");return[2,this.dismissAll()]}))}))};t.prototype.findClone=function(t){for(var i=0;i<this.queue.length;i++){var e=this.queue[i];if(e.message===t.message&&e.color===t.color){return e}}return undefined};t.prototype.setupContainer=function(){if(balBrowser.hasDocument){var t="".concat(this.options.tag,"-container");this.container=document.getElementById(t);if(this.container)return;if(!this.container){this.container=document.createElement("bal-notices");this.container.setAttribute("interface",this.options.tag.replace("bal-",""));this.container.id=t}document.body.appendChild(this.container)}};t.prototype.updateQueue=function(){var t;if(this.queue.length<this.queueLimit){var i=this.preQueue.shift();if(i&&this.container){this.queue.push(i);this.container.insertAdjacentElement("beforeend",i)}}if(this.queue.length===0){(t=this.container)===null||t===void 0?void 0:t.remove()}};t.prototype.removeFromQueue=function(t){var i=this;this.queue=this.queue.filter((function(i){return i.id!==t}));setTimeout((function(){return i.updateQueue()}),0)};return t}();var BalToastController=function(t){__extends(i,t);function i(){return t.call(this,{tag:"bal-toast"})||this}i.prototype.create=function(i){return t.prototype.create.call(this,i)};return i}(BalNoticeController);var balToastController=new BalToastController;var BalSnackbarController=function(t){__extends(i,t);function i(){return t.call(this,{tag:"bal-snackbar"})||this}i.prototype.create=function(i){return t.prototype.create.call(this,i)};return i}(BalNoticeController);var balSnackbarController=new BalSnackbarController;var BALOISE_SESSION_KEY="baloise-persist-config";var Config=function(){function t(){this._componentObservers=[];this._observers=[];this._config=defaultConfig}Object.defineProperty(t.prototype,"locale",{get:function(){return"".concat(this._config.language,"-").concat(this._config.region)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"region",{get:function(){return this._config.region},set:function(t){if(t!==this._config.region){this._config.region=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"language",{get:function(){return this._config.language},set:function(t){if(t!==this._config.language){if(this._config.allowedLanguages.includes(t)){this._config.language=t}else{this._config.language=this._config.fallbackLanguage}this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allowedLanguages",{get:function(){return this._config.allowedLanguages},set:function(t){if(t!==this._config.allowedLanguages){this._config.allowedLanguages=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"icons",{get:function(){return this._config.icons},set:function(t){this._config.icons=Object.assign(Object.assign({},this._config.icons),t);this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"logger",{get:function(){return this._config.logger},set:function(t){this._config.logger=Object.assign({},t);this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"animated",{get:function(){return this._config.animated},set:function(t){this._config.animated=t;this._notify()},enumerable:false,configurable:true});t.prototype.attach=function(t){var i=this._observers.includes(t);if(i){return console.log("Subject: Observer has been attached already.")}this._observers.push(t);t.configChanged(this._config)};t.prototype.detach=function(t){var i=this._observers.indexOf(t);if(i===-1){return console.log("Subject: Nonexistent observer.")}this._observers.splice(i,1)};t.prototype.attachComponent=function(t){var i=this._componentObservers.includes(t);if(i){return console.log("Subject: Observer has been attached already.")}this._componentObservers.push(t);t.configChanged(this._config)};t.prototype.detachComponent=function(t){var i=this._componentObservers.indexOf(t);if(i===-1){return console.log("Subject: Nonexistent observer.")}this._componentObservers.splice(i,1)};t.prototype.toString=function(){return JSON.stringify(this._config)};t.prototype.reset=function(t){this._config=Object.assign(Object.assign(Object.assign({},this._config),t),{icons:Object.assign(Object.assign({},this._config.icons),t.icons)});this._notify(false)};t.prototype._notify=function(t){if(t===void 0){t=true}for(var i=0,e=this._componentObservers;i<e.length;i++){var n=e[i];n.configChanged(this._config)}if(t){for(var r=0,s=this._observers;r<s.length;r++){var n=s[r];n.configChanged(this._config)}}if(balBrowser.hasWindow){saveConfig(window,this._config)}};return t}();var config=new Config;var configFromSession=function(t){try{var i=t.sessionStorage.getItem(BALOISE_SESSION_KEY);return i!==null?JSON.parse(i):{}}catch(t){return{}}};var saveConfig=function(t,i){try{t.sessionStorage.setItem(BALOISE_SESSION_KEY,JSON.stringify(i))}catch(t){return}};var setupConfig=function(t,i){if(t===void 0){t={}}if(i===void 0){i={}}if(Object.keys(i).length===0&&balBrowser.hasWindow){i=window}i.BaloiseDesignSystem=i.BaloiseDesignSystem||{};config.reset(Object.assign(Object.assign(Object.assign({},configFromSession(i)),t),{icons:Object.assign(Object.assign({},configFromSession(i).icons),t.icons)}));i.BaloiseDesignSystem.config=config};var VERSION="16.0.2";var initializeBaloiseDesignSystem=function(t,i,e){if(t===void 0){t={}}if(i===void 0){i=undefined}if(e===void 0){e={}}if(Object.keys(e).length===0&&balBrowser.hasWindow){e=window}e.BaloiseDesignSystem=e.BaloiseDesignSystem||{};if(i){setPlatformHelpers(i)}setupConfig(Object.assign(Object.assign({},t),i),e);e.BaloiseDesignSystem.toastController=balToastController;e.BaloiseDesignSystem.snackbarController=balSnackbarController;e.BaloiseDesignSystem.initialize=function(){return setupConfig(e.BaloiseDesignSystem.config,e)};e.BaloiseDesignSystem.version=VERSION};export{BalToastController as B,BalSnackbarController as a,balToastController as b,balSnackbarController as c,initializeBaloiseDesignSystem as i,setupConfig as s};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baloise/ds-core",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.2",
|
|
4
4
|
"description": "The Baloise Design-System is an open source project for styling awesome web applications that follow the Baloise corporate styling guidelines.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"bubu": "vitest --ui"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@baloise/ds-styles": "16.0.
|
|
32
|
-
"@baloise/ds-icons": "16.0.
|
|
31
|
+
"@baloise/ds-styles": "16.0.2",
|
|
32
|
+
"@baloise/ds-icons": "16.0.2",
|
|
33
33
|
"@baloise/web-app-utils": "3.11.2",
|
|
34
34
|
"@floating-ui/dom": "~1.6.3",
|
|
35
35
|
"@popperjs/core": "~2.11.4",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"@baloise/output-target-angular": "0.0.0",
|
|
54
54
|
"@baloise/output-target-react": "0.0.0",
|
|
55
55
|
"@baloise/output-target-vue": "0.0.0",
|
|
56
|
-
"@baloise/ds-css": "16.0.
|
|
57
|
-
"@baloise/ds-maps": "16.0.
|
|
58
|
-
"@baloise/ds-brand-icons": "16.0.
|
|
59
|
-
"@baloise/ds-favicons": "16.0.
|
|
56
|
+
"@baloise/ds-css": "16.0.2",
|
|
57
|
+
"@baloise/ds-maps": "16.0.2",
|
|
58
|
+
"@baloise/ds-brand-icons": "16.0.2",
|
|
59
|
+
"@baloise/ds-favicons": "16.0.2"
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false
|
|
62
62
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|