@baloise/ds-core 17.4.0-snapshot.1609-d2bcc38d3 → 17.4.1
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/all.d.ts +0 -2
- package/components/all.js +0 -3
- package/components/bal-app.js +93 -1
- package/components/bal-checkbox2.js +1 -1
- package/components/bal-close2.js +1 -1
- package/components/bal-date-calendar2.js +1 -1
- package/components/bal-modal.js +1 -1
- package/components/bal-radio2.js +1 -1
- package/components/bal-segment-item.js +2 -1
- package/components/bal-steps.js +1 -1
- package/components/bal-tabs2.js +1 -1
- package/components/bal-time-input.js +1 -1
- package/components/floating-ui.dom.esm.js +77 -205
- package/components/index.js +314 -7
- package/components/tokens.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.js +1 -1
- package/dist/baloise-design-system/index.esm.js +1 -1
- package/dist/baloise-design-system/p-00b2c8e27d.entry.js +1 -0
- package/dist/baloise-design-system/{p-8869d8fe38.system.entry.js → p-03613e2aa3.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0a00140ece.system.entry.js → p-0831f02fb0.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6b14f26a4d.system.entry.js → p-106815172c.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-363254ce.system.js → p-126ae228.system.js} +1 -1
- package/dist/baloise-design-system/{p-fa246bef.system.js → p-195ee683.system.js} +1 -1
- package/dist/baloise-design-system/{p-2d98519440.system.entry.js → p-19f28f1fbf.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e4ff14c5bf.system.entry.js → p-1f2b83a3a2.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-273fb2c2.system.js +1 -1
- package/dist/baloise-design-system/p-2e8941a17f.entry.js +1 -0
- package/dist/baloise-design-system/p-31876153a5.entry.js +1 -0
- package/dist/baloise-design-system/{p-13d7688b.js → p-35baa468.js} +1 -1
- package/dist/baloise-design-system/p-36218e79.js +1 -0
- package/dist/baloise-design-system/p-367855fbaa.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-4dc30ed346.system.entry.js → p-385372ecd2.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6e4a8fa7.system.js → p-39351e2b.system.js} +1 -1
- package/dist/baloise-design-system/{p-3d5fac87cb.entry.js → p-3c1ea7b3e0.entry.js} +1 -1
- package/dist/baloise-design-system/{p-44539ccf68.entry.js → p-3d73a2d0e3.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d5cb701b.system.js → p-415625ee.system.js} +1 -1
- package/dist/baloise-design-system/p-420bc2ff6e.entry.js +1 -0
- package/dist/baloise-design-system/{p-2697b88cca.entry.js → p-42c7b13aa9.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f669df60fb.entry.js → p-464f369ad6.entry.js} +1 -1
- package/dist/baloise-design-system/{p-8f2ebeb2.js → p-46b13df1.js} +1 -1
- package/dist/baloise-design-system/p-51e22c0c.js +1 -0
- package/dist/baloise-design-system/{p-12af198b96.system.entry.js → p-5d2ab1c46d.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-540bfa19.system.js → p-649e542e.system.js} +1 -1
- package/dist/baloise-design-system/{p-0b6380a77a.entry.js → p-6c19302bf6.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4affef9b9b.entry.js → p-75ac477ebc.entry.js} +1 -1
- package/dist/baloise-design-system/{p-deaa160f21.system.entry.js → p-7615b673a0.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-db9f48c0d5.system.entry.js → p-762c8fa651.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-7bd7839936.entry.js → p-80bf87ba56.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9e489928.system.js → p-817371e5.system.js} +1 -1
- package/dist/baloise-design-system/{p-3cb3bf6ca0.system.entry.js → p-9018c7729a.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b721864305.entry.js → p-90c9681c84.entry.js} +1 -1
- package/dist/baloise-design-system/{p-cf570c9464.entry.js → p-993913b332.entry.js} +1 -1
- package/dist/baloise-design-system/{p-570a1d673a.entry.js → p-9aa95fbc37.entry.js} +1 -1
- package/dist/baloise-design-system/{p-71162da762.entry.js → p-9b73822c14.entry.js} +1 -1
- package/dist/baloise-design-system/p-9d2037e834.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-e0c8d647b3.system.entry.js → p-a272313cd0.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-bb308299af.entry.js → p-a857e31d7e.entry.js} +1 -1
- package/dist/baloise-design-system/{p-be02300bdd.entry.js → p-add71c43b9.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4440f31c6b.system.entry.js → p-afa8aa0eec.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-34a93475db.system.entry.js → p-b4c2e91618.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-525a4b8a95.entry.js → p-ba68f2ce70.entry.js} +1 -1
- package/dist/baloise-design-system/{p-341c9b6c63.entry.js → p-c3852df7a6.entry.js} +1 -1
- package/dist/baloise-design-system/p-c6f5e9453a.system.entry.js +1 -0
- package/dist/baloise-design-system/p-c991d944.js +1 -1
- package/dist/baloise-design-system/p-ca5ec430.js +1 -0
- package/dist/baloise-design-system/{p-94b7fba934.entry.js → p-ce0ca991f8.entry.js} +1 -1
- package/dist/baloise-design-system/p-ce3c6e67ba.system.entry.js +1 -0
- package/dist/baloise-design-system/p-d404537f.system.js +1 -0
- package/dist/baloise-design-system/{p-c08cbae3ec.system.entry.js → p-d95305658b.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-dc330e5e21.entry.js +1 -0
- package/dist/baloise-design-system/p-e2a70f10.system.js +1 -0
- package/dist/baloise-design-system/{p-e562e98c7e.system.entry.js → p-ec4e5d4ecc.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-73fdcff369.entry.js → p-f5a0884f92.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a8eef09399.system.entry.js → p-f7554b087f.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-5514228033.system.entry.js → p-f908b02917.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e63b388285.system.entry.js → p-f9950a0b55.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-070b692d.js → p-fe37f1b5.js} +1 -1
- package/dist/cjs/{global-872cca8d.js → app-globals-fa3c14cc.js} +4 -2
- package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-checkbox_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-close.cjs.entry.js +1 -1
- package/dist/cjs/bal-date-calendar_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-date.cjs.entry.js +1 -1
- package/dist/cjs/bal-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/bal-hint_5.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-modal_3.cjs.entry.js +1 -1
- 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-popup.cjs.entry.js +1 -1
- package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
- package/dist/cjs/bal-radio_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-segment_2.cjs.entry.js +6 -5
- package/dist/cjs/bal-shape.cjs.entry.js +1 -1
- package/dist/cjs/bal-steps.cjs.entry.js +4 -4
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +4 -4
- package/dist/cjs/bal-time-input.cjs.entry.js +1 -1
- package/dist/cjs/bal-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/baloise-design-system.cjs.js +2 -3
- package/dist/cjs/{breakpoints.decorator-f4800188.js → breakpoints.decorator-190fe424.js} +1 -1
- package/dist/cjs/{breakpoints.subject-3244205b.js → breakpoints.subject-8c31945a.js} +1 -1
- package/dist/cjs/{floating-ui-838f057c.js → floating-ui-3147d2ff.js} +1 -1
- package/dist/cjs/{floating-ui.dom.esm-13e3f667.js → floating-ui.dom.esm-2ece9686.js} +77 -205
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/initialize-3059001f.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -3
- package/dist/cjs/{tokens.esm-b1eb9ac4.js → tokens.esm-5b22da7e.js} +1 -1
- package/dist/cjs/{window-resize.decorator-6133d79a.js → window-resize.decorator-7df80757.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/bal-checkbox/radio-checkbox.css +1 -1
- package/dist/collection/components/bal-close/bal-close.css +1 -1
- package/dist/collection/components/bal-date/bal-date-calendar/bal-date-calendar.css +1 -1
- package/dist/collection/components/bal-modal/bal-modal.css +1 -1
- package/dist/collection/components/bal-segment/bal-segment-item/bal-segment-item.js +2 -1
- package/dist/collection/components/bal-steps/bal-steps.css +1 -1
- package/dist/collection/components/bal-tabs/bal-tabs.css +1 -1
- package/dist/collection/components/bal-time-input/bal-time-input.css +1 -1
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/esm/{global-181336dc.js → app-globals-5b18a75c.js} +4 -2
- package/dist/esm/bal-carousel_2.entry.js +3 -3
- package/dist/esm/bal-checkbox_2.entry.js +1 -1
- package/dist/esm/bal-close.entry.js +1 -1
- package/dist/esm/bal-date-calendar_2.entry.js +1 -1
- package/dist/esm/bal-date.entry.js +1 -1
- package/dist/esm/bal-dropdown.entry.js +1 -1
- package/dist/esm/bal-hint_5.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-modal_3.entry.js +1 -1
- 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-popup.entry.js +1 -1
- package/dist/esm/bal-progress-bar.entry.js +4 -4
- package/dist/esm/bal-radio_2.entry.js +1 -1
- package/dist/esm/bal-segment_2.entry.js +6 -5
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-steps.entry.js +4 -4
- package/dist/esm/bal-tab-item_2.entry.js +4 -4
- package/dist/esm/bal-time-input.entry.js +1 -1
- package/dist/esm/bal-tooltip.entry.js +1 -1
- package/dist/esm/baloise-design-system.js +2 -3
- package/dist/esm/{breakpoints.decorator-43a5539d.js → breakpoints.decorator-f76a33a3.js} +1 -1
- package/dist/esm/{breakpoints.subject-41117dc4.js → breakpoints.subject-5790fdca.js} +1 -1
- package/dist/esm/{floating-ui-d05a7ad6.js → floating-ui-90bc6e58.js} +1 -1
- package/dist/esm/{floating-ui.dom.esm-efb93616.js → floating-ui.dom.esm-8dcdb8d6.js} +77 -205
- package/dist/esm/index.js +3 -3
- package/dist/esm/initialize-66a526c0.js +1 -1
- package/dist/esm/loader.js +2 -3
- package/dist/esm/{tokens.esm-376de6fe.js → tokens.esm-a16bc6a3.js} +1 -1
- package/dist/esm/{window-resize.decorator-66d8fd79.js → window-resize.decorator-159d2aac.js} +1 -1
- package/dist/esm-es5/app-globals-5b18a75c.js +1 -0
- package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
- package/dist/esm-es5/bal-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/bal-close.entry.js +1 -1
- package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
- package/dist/esm-es5/bal-date.entry.js +1 -1
- package/dist/esm-es5/bal-dropdown.entry.js +1 -1
- package/dist/esm-es5/bal-hint_5.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-modal_3.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-popup.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
- package/dist/esm-es5/bal-radio_2.entry.js +1 -1
- package/dist/esm-es5/bal-segment_2.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/bal-time-input.entry.js +1 -1
- package/dist/esm-es5/bal-tooltip.entry.js +1 -1
- package/dist/esm-es5/baloise-design-system.js +1 -1
- package/dist/esm-es5/{breakpoints.decorator-43a5539d.js → breakpoints.decorator-f76a33a3.js} +1 -1
- package/dist/esm-es5/{breakpoints.subject-41117dc4.js → breakpoints.subject-5790fdca.js} +1 -1
- package/dist/esm-es5/{floating-ui-d05a7ad6.js → floating-ui-90bc6e58.js} +1 -1
- package/dist/esm-es5/floating-ui.dom.esm-8dcdb8d6.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/initialize-66a526c0.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{window-resize.decorator-66d8fd79.js → window-resize.decorator-159d2aac.js} +1 -1
- package/dist/types/components.d.ts +0 -37
- package/package.json +8 -6
- package/components/bal-app2.js +0 -95
- package/components/bal-doc-app.d.ts +0 -11
- package/components/bal-doc-app.js +0 -262
- package/components/initialize.js +0 -312
- package/dist/baloise-design-system/p-07bae1fdcc.system.entry.js +0 -1
- package/dist/baloise-design-system/p-0d5459caac.system.entry.js +0 -1
- package/dist/baloise-design-system/p-10ff0eaf.js +0 -1
- package/dist/baloise-design-system/p-1c8e64e58b.system.entry.js +0 -1
- package/dist/baloise-design-system/p-2724ad9065.entry.js +0 -1
- package/dist/baloise-design-system/p-50f3b012.js +0 -1
- package/dist/baloise-design-system/p-55fc8522eb.system.entry.js +0 -1
- package/dist/baloise-design-system/p-59d9918c.system.js +0 -1
- package/dist/baloise-design-system/p-9fbf3690.system.js +0 -1
- package/dist/baloise-design-system/p-b21f2874.system.js +0 -1
- package/dist/baloise-design-system/p-b2e3f97a3f.entry.js +0 -1
- package/dist/baloise-design-system/p-c017695c41.entry.js +0 -1
- package/dist/baloise-design-system/p-e48a46d6d7.entry.js +0 -1
- package/dist/baloise-design-system/p-e4b50159.js +0 -1
- package/dist/baloise-design-system/p-ec5776f5.js +0 -1
- package/dist/baloise-design-system/p-f1849ab83d.entry.js +0 -1
- package/dist/baloise-design-system/p-f55c127cb5.system.entry.js +0 -1
- package/dist/baloise-design-system/p-ffe0476dde.entry.js +0 -1
- package/dist/cjs/app-globals-44d3a5af.js +0 -7
- package/dist/cjs/bal-doc-app.cjs.entry.js +0 -233
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +0 -1
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +0 -247
- package/dist/esm/app-globals-c5ea8144.js +0 -5
- package/dist/esm/bal-doc-app.entry.js +0 -229
- package/dist/esm-es5/app-globals-c5ea8144.js +0 -1
- package/dist/esm-es5/bal-doc-app.entry.js +0 -1
- package/dist/esm-es5/floating-ui.dom.esm-efb93616.js +0 -1
- package/dist/esm-es5/global-181336dc.js +0 -1
- package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +0 -21
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +0 -82
- /package/dist/baloise-design-system/{p-b119ef19.system.js → p-8c67c79d.system.js} +0 -0
- /package/dist/baloise-design-system/{p-6e1e6cc5.js → p-ce5ab69a.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-376de6fe.js → tokens.esm-a16bc6a3.js} +0 -0
package/components/initialize.js
DELETED
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
import { setPlatformHelpers } from '@stencil/core/internal/client';
|
|
2
|
-
import { b as balBrowser } from './browser.js';
|
|
3
|
-
import { w as waitForComponent } from './helpers.js';
|
|
4
|
-
import { d as defaultConfig } from './config.default.js';
|
|
5
|
-
|
|
6
|
-
const BALOISE_SESSION_KEY = 'baloise-persist-config';
|
|
7
|
-
const BALOISE_ANIMATION_KEY = 'baloise-animated';
|
|
8
|
-
|
|
9
|
-
class Config {
|
|
10
|
-
constructor() {
|
|
11
|
-
this._componentObservers = [];
|
|
12
|
-
this._observers = [];
|
|
13
|
-
this._config = defaultConfig;
|
|
14
|
-
}
|
|
15
|
-
get locale() {
|
|
16
|
-
return `${this._config.language}-${this._config.region}`;
|
|
17
|
-
}
|
|
18
|
-
get region() {
|
|
19
|
-
return this._config.region;
|
|
20
|
-
}
|
|
21
|
-
set region(region) {
|
|
22
|
-
if (region !== this._config.region) {
|
|
23
|
-
this._config.region = region;
|
|
24
|
-
this._notify();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
get language() {
|
|
28
|
-
return this._config.language;
|
|
29
|
-
}
|
|
30
|
-
set language(language) {
|
|
31
|
-
if (language !== this._config.language) {
|
|
32
|
-
if (this._config.allowedLanguages.includes(language)) {
|
|
33
|
-
this._config.language = language;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this._config.language = this._config.fallbackLanguage;
|
|
37
|
-
}
|
|
38
|
-
this._notify();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
get allowedLanguages() {
|
|
42
|
-
return this._config.allowedLanguages;
|
|
43
|
-
}
|
|
44
|
-
set allowedLanguages(allowedLanguages) {
|
|
45
|
-
if (allowedLanguages !== this._config.allowedLanguages) {
|
|
46
|
-
this._config.allowedLanguages = allowedLanguages;
|
|
47
|
-
this._notify();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
get icons() {
|
|
51
|
-
return this._config.icons;
|
|
52
|
-
}
|
|
53
|
-
set icons(icons) {
|
|
54
|
-
this._config.icons = Object.assign(Object.assign({}, this._config.icons), icons);
|
|
55
|
-
this._notify();
|
|
56
|
-
}
|
|
57
|
-
get logger() {
|
|
58
|
-
return this._config.logger;
|
|
59
|
-
}
|
|
60
|
-
set logger(logger) {
|
|
61
|
-
this._config.logger = Object.assign({}, logger);
|
|
62
|
-
this._notify();
|
|
63
|
-
}
|
|
64
|
-
get animated() {
|
|
65
|
-
return this._config.animated;
|
|
66
|
-
}
|
|
67
|
-
set animated(animated) {
|
|
68
|
-
this._config.animated = animated;
|
|
69
|
-
this._notify();
|
|
70
|
-
}
|
|
71
|
-
get httpFormSubmit() {
|
|
72
|
-
return this._config.httpFormSubmit;
|
|
73
|
-
}
|
|
74
|
-
set httpFormSubmit(httpFormSubmit) {
|
|
75
|
-
this._config.httpFormSubmit = httpFormSubmit;
|
|
76
|
-
this._notify();
|
|
77
|
-
}
|
|
78
|
-
attach(observer) {
|
|
79
|
-
const isExist = this._observers.includes(observer);
|
|
80
|
-
if (isExist) {
|
|
81
|
-
return console.log('Subject: Observer has been attached already.');
|
|
82
|
-
}
|
|
83
|
-
this._observers.push(observer);
|
|
84
|
-
observer.configChanged(this._config);
|
|
85
|
-
}
|
|
86
|
-
detach(observer) {
|
|
87
|
-
const observerIndex = this._observers.indexOf(observer);
|
|
88
|
-
if (observerIndex === -1) {
|
|
89
|
-
return console.log('Subject: Nonexistent observer.');
|
|
90
|
-
}
|
|
91
|
-
this._observers.splice(observerIndex, 1);
|
|
92
|
-
}
|
|
93
|
-
attachComponent(observer) {
|
|
94
|
-
const isExist = this._componentObservers.includes(observer);
|
|
95
|
-
if (isExist) {
|
|
96
|
-
return console.log('Subject: Observer has been attached already.');
|
|
97
|
-
}
|
|
98
|
-
this._componentObservers.push(observer);
|
|
99
|
-
observer.configChanged(this._config);
|
|
100
|
-
}
|
|
101
|
-
detachComponent(observer) {
|
|
102
|
-
const observerIndex = this._componentObservers.indexOf(observer);
|
|
103
|
-
if (observerIndex === -1) {
|
|
104
|
-
return console.log('Subject: Nonexistent observer.');
|
|
105
|
-
}
|
|
106
|
-
this._componentObservers.splice(observerIndex, 1);
|
|
107
|
-
}
|
|
108
|
-
toString() {
|
|
109
|
-
return JSON.stringify(this._config);
|
|
110
|
-
}
|
|
111
|
-
reset(config) {
|
|
112
|
-
this._config = Object.assign(Object.assign(Object.assign({}, this._config), config), { icons: Object.assign(Object.assign({}, this._config.icons), config.icons) });
|
|
113
|
-
this._notify(false);
|
|
114
|
-
}
|
|
115
|
-
_notify(all = true) {
|
|
116
|
-
for (const observer of this._componentObservers) {
|
|
117
|
-
observer.configChanged(this._config);
|
|
118
|
-
}
|
|
119
|
-
if (all) {
|
|
120
|
-
for (const observer of this._observers) {
|
|
121
|
-
observer.configChanged(this._config);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (balBrowser.hasWindow) {
|
|
125
|
-
saveConfig(window, this._config);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
const config = /*@__PURE__*/ new Config();
|
|
130
|
-
const configFromSession = (win) => {
|
|
131
|
-
try {
|
|
132
|
-
const configStr = win.sessionStorage.getItem(BALOISE_SESSION_KEY);
|
|
133
|
-
return configStr !== null ? JSON.parse(configStr) : {};
|
|
134
|
-
}
|
|
135
|
-
catch (e) {
|
|
136
|
-
return {};
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
const configFromLocalStorage = (win) => {
|
|
140
|
-
try {
|
|
141
|
-
const animated = JSON.parse(win.localStorage.getItem(BALOISE_ANIMATION_KEY));
|
|
142
|
-
if (animated !== null) {
|
|
143
|
-
return {
|
|
144
|
-
animated,
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
return {};
|
|
148
|
-
}
|
|
149
|
-
catch (e) {
|
|
150
|
-
return {};
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
const saveConfig = (win, c) => {
|
|
154
|
-
try {
|
|
155
|
-
win.sessionStorage.setItem(BALOISE_SESSION_KEY, JSON.stringify(c));
|
|
156
|
-
}
|
|
157
|
-
catch (e) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
const setupConfig = (userConfig = {}, win = {}) => {
|
|
163
|
-
if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
|
|
164
|
-
win = window;
|
|
165
|
-
}
|
|
166
|
-
win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
|
|
167
|
-
config.reset(Object.assign(Object.assign(Object.assign(Object.assign({}, configFromSession(win)), configFromLocalStorage(win)), userConfig), { icons: Object.assign(Object.assign({}, configFromSession(win).icons), userConfig.icons) }));
|
|
168
|
-
win.BaloiseDesignSystem.config = config;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
class BalNoticeController {
|
|
172
|
-
constructor(options) {
|
|
173
|
-
this.options = options;
|
|
174
|
-
this.container = null;
|
|
175
|
-
this.queue = [];
|
|
176
|
-
this.preQueue = [];
|
|
177
|
-
this.queueLimit = 5;
|
|
178
|
-
}
|
|
179
|
-
create(options) {
|
|
180
|
-
if (balBrowser.hasDocument) {
|
|
181
|
-
this.setupContainer(options);
|
|
182
|
-
const clone = this.findClone(options);
|
|
183
|
-
if (clone === undefined) {
|
|
184
|
-
const el = document.createElement(this.options.tag);
|
|
185
|
-
Object.assign(el, options);
|
|
186
|
-
el.addEventListener('balClose', ev => {
|
|
187
|
-
this.removeFromQueue(ev.detail);
|
|
188
|
-
});
|
|
189
|
-
this.preQueue.push(el);
|
|
190
|
-
this.updateQueue();
|
|
191
|
-
return el;
|
|
192
|
-
}
|
|
193
|
-
return clone;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
setQueue(queueLimit) {
|
|
197
|
-
this.queueLimit = queueLimit;
|
|
198
|
-
}
|
|
199
|
-
async dismissAll() {
|
|
200
|
-
var _a;
|
|
201
|
-
const elements = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.options.tag);
|
|
202
|
-
if (elements) {
|
|
203
|
-
const closingQueue = [];
|
|
204
|
-
for (let index = 0; index < elements.length; index++) {
|
|
205
|
-
const el = elements[index];
|
|
206
|
-
if (el.close) {
|
|
207
|
-
closingQueue.push(el.close());
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
await Promise.all(closingQueue);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* @deprecated use dismissAll instead
|
|
215
|
-
*/
|
|
216
|
-
async clearAll() {
|
|
217
|
-
console.warn('[DEPRECATED] - use dismissAll() instead');
|
|
218
|
-
return this.dismissAll();
|
|
219
|
-
}
|
|
220
|
-
findClone(options) {
|
|
221
|
-
for (let index = 0; index < this.queue.length; index++) {
|
|
222
|
-
const el = this.queue[index];
|
|
223
|
-
if (el.message === options.message && el.color === options.color) {
|
|
224
|
-
return el;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return undefined;
|
|
228
|
-
}
|
|
229
|
-
setupContainer(options) {
|
|
230
|
-
if (balBrowser.hasDocument) {
|
|
231
|
-
const containerId = `${this.options.tag}-container`;
|
|
232
|
-
this.container = document.getElementById(containerId);
|
|
233
|
-
if (this.container)
|
|
234
|
-
return;
|
|
235
|
-
if (!this.container) {
|
|
236
|
-
this.container = document.createElement('bal-notices');
|
|
237
|
-
this.container.setAttribute('interface', this.options.tag.replace('bal-', ''));
|
|
238
|
-
this.container.setAttribute('animated', options.animated ? 'true' : 'false');
|
|
239
|
-
if (options.container !== undefined) {
|
|
240
|
-
this.container.setAttribute('container', options.container === true ? '' : options.container);
|
|
241
|
-
}
|
|
242
|
-
this.container.id = containerId;
|
|
243
|
-
}
|
|
244
|
-
document.body.appendChild(this.container);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
async updateQueue() {
|
|
248
|
-
var _a;
|
|
249
|
-
if (this.queue.length < this.queueLimit) {
|
|
250
|
-
const el = this.preQueue.shift();
|
|
251
|
-
if (el && this.container) {
|
|
252
|
-
await waitForComponent(this.container);
|
|
253
|
-
const innerEl = this.container.querySelector('.bal-notices__inner');
|
|
254
|
-
if (innerEl) {
|
|
255
|
-
this.queue.push(el);
|
|
256
|
-
innerEl.insertAdjacentElement('beforeend', el);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
if (this.queue.length === 0) {
|
|
261
|
-
(_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
removeFromQueue(toastId) {
|
|
265
|
-
this.queue = this.queue.filter(el => el.id !== toastId);
|
|
266
|
-
setTimeout(() => this.updateQueue(), 0);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
class BalToastController extends BalNoticeController {
|
|
271
|
-
constructor() {
|
|
272
|
-
super({
|
|
273
|
-
tag: 'bal-toast',
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
create(options) {
|
|
277
|
-
return super.create(options);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
const balToastController = new BalToastController();
|
|
281
|
-
|
|
282
|
-
class BalSnackbarController extends BalNoticeController {
|
|
283
|
-
constructor() {
|
|
284
|
-
super({
|
|
285
|
-
tag: 'bal-snackbar',
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
create(options) {
|
|
289
|
-
return super.create(options);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
const balSnackbarController = new BalSnackbarController();
|
|
293
|
-
|
|
294
|
-
// generated by .build/version.js
|
|
295
|
-
const VERSION = '17.4.0-snapshot.1609-d2bcc38d3';
|
|
296
|
-
|
|
297
|
-
const initializeBaloiseDesignSystem = (userConfig = {}, platformConfig = undefined, win = {}) => {
|
|
298
|
-
if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
|
|
299
|
-
win = window;
|
|
300
|
-
}
|
|
301
|
-
win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
|
|
302
|
-
if (platformConfig) {
|
|
303
|
-
setPlatformHelpers(platformConfig);
|
|
304
|
-
}
|
|
305
|
-
setupConfig(Object.assign(Object.assign({}, userConfig), platformConfig), win);
|
|
306
|
-
win.BaloiseDesignSystem.toastController = balToastController;
|
|
307
|
-
win.BaloiseDesignSystem.snackbarController = balSnackbarController;
|
|
308
|
-
win.BaloiseDesignSystem.initialize = () => setupConfig(win.BaloiseDesignSystem.config, win);
|
|
309
|
-
win.BaloiseDesignSystem.version = VERSION;
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
export { BalToastController as B, BalSnackbarController as a, balToastController as b, balSnackbarController as c, initializeBaloiseDesignSystem as i, setupConfig as s };
|