@baloise/ds-core 0.0.5-snapshot.18- → 0.0.5

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.
Files changed (134) hide show
  1. package/components/bal-app.js +85 -1
  2. package/components/index.js +282 -5
  3. package/components/tokens.esm.js +1 -1
  4. package/dist/cjs/{global-e99d827b.js → app-globals-96247350.js} +4 -2
  5. package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
  6. package/dist/cjs/bal-datepicker.cjs.entry.js +3 -3
  7. package/dist/cjs/bal-hint_3.cjs.entry.js +3 -3
  8. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  9. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  10. package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
  11. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  12. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  13. package/dist/cjs/bal-popover_2.cjs.entry.js +3 -3
  14. package/dist/cjs/bal-progress-bar.cjs.entry.js +3 -3
  15. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  16. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  17. package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
  18. package/dist/cjs/{breakpoints.decorator-d23cb3cb.js → breakpoints.decorator-317b79eb.js} +1 -1
  19. package/dist/cjs/{breakpoints.subject-10b97f68.js → breakpoints.subject-d01efdb0.js} +1 -1
  20. package/dist/cjs/design-system-components.cjs.js +2 -3
  21. package/dist/cjs/index.cjs.js +2 -2
  22. package/dist/cjs/initialize-9c752efa.js +1 -1
  23. package/dist/cjs/loader.cjs.js +2 -3
  24. package/dist/cjs/{tokens.esm-50b082a1.js → tokens.esm-49773ac1.js} +1 -1
  25. package/dist/collection/collection-manifest.json +1 -2
  26. package/dist/collection/utils/constants/version.constant.js +1 -1
  27. package/dist/design-system-components/design-system-components.esm.js +1 -1
  28. package/dist/design-system-components/design-system-components.js +1 -1
  29. package/dist/design-system-components/index.esm.js +1 -1
  30. package/dist/design-system-components/{p-2f9422afeb.entry.js → p-0685d79c20.entry.js} +1 -1
  31. package/dist/design-system-components/{p-3af4aa5dd2.system.entry.js → p-1063c5cdc0.system.entry.js} +1 -1
  32. package/dist/design-system-components/{p-051f8a1a.system.js → p-14bd447f.system.js} +1 -1
  33. package/dist/design-system-components/{p-be273124.system.js → p-16910f58.system.js} +1 -1
  34. package/dist/design-system-components/{p-83bfae67.system.js → p-17391ff3.system.js} +1 -1
  35. package/dist/design-system-components/p-238f1f34.js +1 -0
  36. package/dist/design-system-components/{p-e8777baf.system.js → p-2b79fb51.system.js} +1 -1
  37. package/dist/design-system-components/{p-a34056a1.js → p-2cc957ce.js} +1 -1
  38. package/dist/design-system-components/{p-f8b769af7e.system.entry.js → p-356f5cfef3.system.entry.js} +1 -1
  39. package/dist/design-system-components/{p-dc7d48da1d.system.entry.js → p-3865f038de.system.entry.js} +1 -1
  40. package/dist/design-system-components/{p-0f2af7bbc3.entry.js → p-3c8c5b6dd2.entry.js} +1 -1
  41. package/dist/design-system-components/{p-8aa81eeb6e.entry.js → p-458253ab5b.entry.js} +1 -1
  42. package/dist/design-system-components/{p-5e870a5808.entry.js → p-464c925d97.entry.js} +1 -1
  43. package/dist/design-system-components/p-50f12cb1.system.js +1 -1
  44. package/dist/design-system-components/{p-40ca690a4d.entry.js → p-55a5a05ad3.entry.js} +1 -1
  45. package/dist/design-system-components/{p-091eab19.js → p-5650ce58.js} +1 -1
  46. package/dist/design-system-components/{p-db72f1b8ca.system.entry.js → p-5ee8262d62.system.entry.js} +1 -1
  47. package/dist/design-system-components/p-66904dc1.js +1 -1
  48. package/dist/design-system-components/p-75c02a9ff4.entry.js +1 -0
  49. package/dist/design-system-components/{p-e62988c618.system.entry.js → p-7653dae772.system.entry.js} +1 -1
  50. package/dist/design-system-components/{p-5514046282.entry.js → p-77c0fa3e01.entry.js} +1 -1
  51. package/dist/design-system-components/{p-9acf9fbb7a.system.entry.js → p-7b57f1bf7a.system.entry.js} +1 -1
  52. package/dist/design-system-components/{p-558e787f00.system.entry.js → p-7e2faa5297.system.entry.js} +1 -1
  53. package/dist/design-system-components/{p-0aca601913.system.entry.js → p-81a1bd545f.system.entry.js} +1 -1
  54. package/dist/design-system-components/{p-888d7ea6b2.entry.js → p-97b3918054.entry.js} +1 -1
  55. package/dist/design-system-components/{p-06e3c9ed5f.entry.js → p-97dbfd519a.entry.js} +1 -1
  56. package/dist/design-system-components/p-9f5e39e1.system.js +1 -0
  57. package/dist/design-system-components/{p-4bcddd59a7.system.entry.js → p-a2e1502c7f.system.entry.js} +1 -1
  58. package/dist/design-system-components/{p-eb819e6392.system.entry.js → p-adb6bc44ef.system.entry.js} +1 -1
  59. package/dist/design-system-components/{p-eaf0e36655.entry.js → p-b293bf1ba0.entry.js} +1 -1
  60. package/dist/design-system-components/{p-b910a8a15e.system.entry.js → p-b5ff90d62d.system.entry.js} +1 -1
  61. package/dist/design-system-components/{p-0d891840cf.system.entry.js → p-c835e3cce4.system.entry.js} +1 -1
  62. package/dist/design-system-components/{p-ee0bad20fe.entry.js → p-c994b45363.entry.js} +1 -1
  63. package/dist/design-system-components/{p-2aba64dc98.entry.js → p-d1ebb10fc2.entry.js} +1 -1
  64. package/dist/design-system-components/{p-297c5e29ef.system.entry.js → p-d3c37b705b.system.entry.js} +1 -1
  65. package/dist/design-system-components/{p-9536385c66.entry.js → p-ed0e733640.entry.js} +1 -1
  66. package/dist/esm/{global-648bb593.js → app-globals-04db8eba.js} +4 -2
  67. package/dist/esm/bal-carousel_2.entry.js +3 -3
  68. package/dist/esm/bal-datepicker.entry.js +3 -3
  69. package/dist/esm/bal-hint_3.entry.js +3 -3
  70. package/dist/esm/bal-list_8.entry.js +3 -3
  71. package/dist/esm/bal-logo.entry.js +3 -3
  72. package/dist/esm/bal-nav_8.entry.js +3 -3
  73. package/dist/esm/bal-navbar_5.entry.js +3 -3
  74. package/dist/esm/bal-pagination.entry.js +3 -3
  75. package/dist/esm/bal-popover_2.entry.js +3 -3
  76. package/dist/esm/bal-progress-bar.entry.js +3 -3
  77. package/dist/esm/bal-shape.entry.js +1 -1
  78. package/dist/esm/bal-steps.entry.js +3 -3
  79. package/dist/esm/bal-tab-item_2.entry.js +3 -3
  80. package/dist/esm/{breakpoints.decorator-52930576.js → breakpoints.decorator-4c9411f6.js} +1 -1
  81. package/dist/esm/{breakpoints.subject-599ebb15.js → breakpoints.subject-b9035870.js} +1 -1
  82. package/dist/esm/design-system-components.js +2 -3
  83. package/dist/esm/index.js +3 -3
  84. package/dist/esm/initialize-ff8054a2.js +1 -1
  85. package/dist/esm/loader.js +2 -3
  86. package/dist/esm/{tokens.esm-71e6a725.js → tokens.esm-09a5bc3a.js} +1 -1
  87. package/dist/esm-es5/app-globals-04db8eba.js +1 -0
  88. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  89. package/dist/esm-es5/bal-datepicker.entry.js +1 -1
  90. package/dist/esm-es5/bal-hint_3.entry.js +1 -1
  91. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  92. package/dist/esm-es5/bal-logo.entry.js +1 -1
  93. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  94. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  95. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  96. package/dist/esm-es5/bal-popover_2.entry.js +1 -1
  97. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  98. package/dist/esm-es5/bal-shape.entry.js +1 -1
  99. package/dist/esm-es5/bal-steps.entry.js +1 -1
  100. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  101. package/dist/esm-es5/breakpoints.decorator-4c9411f6.js +1 -0
  102. package/dist/esm-es5/{breakpoints.subject-599ebb15.js → breakpoints.subject-b9035870.js} +1 -1
  103. package/dist/esm-es5/design-system-components.js +1 -1
  104. package/dist/esm-es5/index.js +1 -1
  105. package/dist/esm-es5/initialize-ff8054a2.js +1 -1
  106. package/dist/esm-es5/loader.js +1 -1
  107. package/dist/types/components.d.ts +0 -37
  108. package/package.json +7 -7
  109. package/components/bal-app2.js +0 -87
  110. package/components/bal-doc-app.d.ts +0 -11
  111. package/components/bal-doc-app.js +0 -260
  112. package/components/initialize.js +0 -281
  113. package/dist/cjs/app-globals-96827f05.js +0 -7
  114. package/dist/cjs/bal-doc-app.cjs.entry.js +0 -231
  115. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +0 -1
  116. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +0 -229
  117. package/dist/design-system-components/p-01ebb73de9.entry.js +0 -1
  118. package/dist/design-system-components/p-2cf6aee410.entry.js +0 -1
  119. package/dist/design-system-components/p-787f9258.system.js +0 -1
  120. package/dist/design-system-components/p-adff9a327e.system.entry.js +0 -1
  121. package/dist/design-system-components/p-bafa7b4e.js +0 -1
  122. package/dist/design-system-components/p-bfbc64f2.js +0 -1
  123. package/dist/design-system-components/p-fc586c6a.system.js +0 -1
  124. package/dist/esm/app-globals-46c15307.js +0 -5
  125. package/dist/esm/bal-doc-app.entry.js +0 -227
  126. package/dist/esm-es5/app-globals-46c15307.js +0 -1
  127. package/dist/esm-es5/bal-doc-app.entry.js +0 -1
  128. package/dist/esm-es5/breakpoints.decorator-52930576.js +0 -1
  129. package/dist/esm-es5/global-648bb593.js +0 -1
  130. package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +0 -21
  131. package/dist/types/home/runner/work/ds-playground/ds-playground/packages/core/.stencil/packages/icons/src/index.d.ts +0 -81
  132. /package/dist/design-system-components/{p-0492b758.system.js → p-dab8ac06.system.js} +0 -0
  133. /package/dist/design-system-components/{p-117c1161.js → p-e33303db.js} +0 -0
  134. /package/dist/esm-es5/{tokens.esm-71e6a725.js → tokens.esm-09a5bc3a.js} +0 -0
@@ -1,4 +1,88 @@
1
- import { A as App, d as defineCustomElement$1 } from './bal-app2.js';
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { _ as __decorate, a as __metadata } from './tslib.es6.js';
3
+ import { b as balBrowser } from './browser.js';
4
+ import { b as balDevice } from './device.js';
5
+ import { h as debounce, k as rIC } from './helpers.js';
6
+ import { L as Logger } from './log.js';
7
+ import { s as startFocusVisible } from './focus-visible.js';
8
+ import { b as updateBalAnimated } from './config.utils.js';
9
+
10
+ const balAppCss = ":root{--bal-app-height:100%}.bal-app{position:relative;display:block}";
11
+ const BalAppStyle0 = balAppCss;
12
+
13
+ const App = /*@__PURE__*/ proxyCustomElement(class App extends HTMLElement {
14
+ constructor() {
15
+ super();
16
+ this.__registerHost();
17
+ this.debouncedNotify = debounce(() => this.notifyResize(), 100);
18
+ this.notifyResize = async () => {
19
+ if (balBrowser.hasDocument && balBrowser.hasWindow) {
20
+ const doc = document.documentElement;
21
+ doc.style.setProperty('--bal-app-height', `${window.innerHeight}px`);
22
+ }
23
+ };
24
+ this.animated = true;
25
+ this.ready = false;
26
+ }
27
+ createLogger(log) {
28
+ this.log = log;
29
+ }
30
+ connectedCallback() {
31
+ updateBalAnimated(this.animated);
32
+ if (balBrowser.hasWindow) {
33
+ window.addEventListener('resize', this.debouncedNotify);
34
+ this.debouncedNotify();
35
+ }
36
+ }
37
+ componentDidLoad() {
38
+ rIC(async () => {
39
+ this.ready = true;
40
+ startFocusVisible();
41
+ });
42
+ }
43
+ disconnectedCallback() {
44
+ if (balBrowser.hasWindow) {
45
+ window.removeEventListener('resize', this.debouncedNotify);
46
+ }
47
+ }
48
+ async setFocus(elements) {
49
+ if (this.focusVisible) {
50
+ this.focusVisible.setFocus(elements);
51
+ }
52
+ }
53
+ render() {
54
+ return (h(Host, { class: {
55
+ 'bal-app': true,
56
+ 'bal-app--safari': balBrowser.isSafari,
57
+ 'bal-app--touch': balDevice.hasTouchScreen,
58
+ } }, h("slot", null)));
59
+ }
60
+ get el() { return this; }
61
+ static get style() { return BalAppStyle0; }
62
+ }, [4, "bal-app", {
63
+ "animated": [516],
64
+ "ready": [1540],
65
+ "setFocus": [64]
66
+ }]);
67
+ __decorate([
68
+ Logger('bal-app'),
69
+ __metadata("design:type", Function),
70
+ __metadata("design:paramtypes", [Function]),
71
+ __metadata("design:returntype", void 0)
72
+ ], App.prototype, "createLogger", null);
73
+ function defineCustomElement$1() {
74
+ if (typeof customElements === "undefined") {
75
+ return;
76
+ }
77
+ const components = ["bal-app"];
78
+ components.forEach(tagName => { switch (tagName) {
79
+ case "bal-app":
80
+ if (!customElements.get(tagName)) {
81
+ customElements.define(tagName, App);
82
+ }
83
+ break;
84
+ } });
85
+ }
2
86
 
3
87
  const BalApp = App;
4
88
  const defineCustomElement = defineCustomElement$1;
@@ -1,3 +1,4 @@
1
+ import { setPlatformHelpers } from '@stencil/core/internal/client';
1
2
  export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
2
3
  export { F as FileUploadRejectionReason } from './bal-file-upload.type.js';
3
4
  export { i as i18nBalDate } from './bal-date.i18n.js';
@@ -6,26 +7,169 @@ export { i as i18nBalDatepicker } from './bal-datepicker.i18n.js';
6
7
  export { i as i18nBalTimeInput } from './bal-time-input.i18n.js';
7
8
  export { i as i18nBalInputStepper } from './bal-input-stepper.i18n.js';
8
9
  export { i as i18nBalLabel } from './bal-label.i18n.js';
9
- export { a as BalSnackbarController, B as BalToastController, c as balSnackbarController, b as balToastController, i as initialize, i as initializeBaloiseDesignSystem, s as setupConfig } from './initialize.js';
10
+ import { b as balBrowser } from './browser.js';
11
+ export { b as balBrowser } from './browser.js';
12
+ import { d as defaultConfig } from './config.default.js';
13
+ export { d as defaultConfig } from './config.default.js';
10
14
  export { n as newBalStepOption } from './bal-step.util.js';
11
15
  export { n as newBalTabOption } from './bal-tab.util.js';
12
16
  import { g as getAppRoot, c as componentOnReady } from './helpers.js';
13
17
  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.js';
14
18
  export { s as scrollToFirstInvalidField } from './form.js';
15
19
  export { B as BalScrollHandler } from './scroll.js';
16
- import { b as balBrowser } from './browser.js';
17
- export { b as balBrowser } from './browser.js';
18
20
  import { b as balDevice } from './device.js';
19
21
  export { B as BalDevice, b as balDevice } from './device.js';
20
22
  import { g as getOverlays, a as getOverlay } from './overlays.js';
21
23
  import { B as BalWindowResizeListener, b as balBreakpoints } from './breakpoints.subject.js';
22
24
  export { c as BalBreakpointSubject, d as BalBreakpointsUtil, a as balBreakpointSubject, b as balBreakpoints } from './breakpoints.subject.js';
23
25
  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.js';
24
- export { d as defaultConfig } from './config.default.js';
25
26
  import { S as Subject } from './listener.js';
26
27
  export { B as BalSwipeSubject } from './swipe.subject.js';
27
28
  export { B as BalDate } from './date.js';
28
29
 
30
+ const BALOISE_SESSION_KEY = 'baloise-persist-config';
31
+
32
+ class Config {
33
+ constructor() {
34
+ this._componentObservers = [];
35
+ this._observers = [];
36
+ this._config = defaultConfig;
37
+ }
38
+ get locale() {
39
+ return `${this._config.language}-${this._config.region}`;
40
+ }
41
+ get region() {
42
+ return this._config.region;
43
+ }
44
+ set region(region) {
45
+ if (region !== this._config.region) {
46
+ this._config.region = region;
47
+ this._notify();
48
+ }
49
+ }
50
+ get language() {
51
+ return this._config.language;
52
+ }
53
+ set language(language) {
54
+ if (language !== this._config.language) {
55
+ if (this._config.allowedLanguages.includes(language)) {
56
+ this._config.language = language;
57
+ }
58
+ else {
59
+ this._config.language = this._config.fallbackLanguage;
60
+ }
61
+ this._notify();
62
+ }
63
+ }
64
+ get allowedLanguages() {
65
+ return this._config.allowedLanguages;
66
+ }
67
+ set allowedLanguages(allowedLanguages) {
68
+ if (allowedLanguages !== this._config.allowedLanguages) {
69
+ this._config.allowedLanguages = allowedLanguages;
70
+ this._notify();
71
+ }
72
+ }
73
+ get icons() {
74
+ return this._config.icons;
75
+ }
76
+ set icons(icons) {
77
+ this._config.icons = Object.assign(Object.assign({}, this._config.icons), icons);
78
+ this._notify();
79
+ }
80
+ get logger() {
81
+ return this._config.logger;
82
+ }
83
+ set logger(logger) {
84
+ this._config.logger = Object.assign({}, logger);
85
+ this._notify();
86
+ }
87
+ get animated() {
88
+ return this._config.animated;
89
+ }
90
+ set animated(animated) {
91
+ this._config.animated = animated;
92
+ this._notify();
93
+ }
94
+ attach(observer) {
95
+ const isExist = this._observers.includes(observer);
96
+ if (isExist) {
97
+ return console.log('Subject: Observer has been attached already.');
98
+ }
99
+ this._observers.push(observer);
100
+ observer.configChanged(this._config);
101
+ }
102
+ detach(observer) {
103
+ const observerIndex = this._observers.indexOf(observer);
104
+ if (observerIndex === -1) {
105
+ return console.log('Subject: Nonexistent observer.');
106
+ }
107
+ this._observers.splice(observerIndex, 1);
108
+ }
109
+ attachComponent(observer) {
110
+ const isExist = this._componentObservers.includes(observer);
111
+ if (isExist) {
112
+ return console.log('Subject: Observer has been attached already.');
113
+ }
114
+ this._componentObservers.push(observer);
115
+ observer.configChanged(this._config);
116
+ }
117
+ detachComponent(observer) {
118
+ const observerIndex = this._componentObservers.indexOf(observer);
119
+ if (observerIndex === -1) {
120
+ return console.log('Subject: Nonexistent observer.');
121
+ }
122
+ this._componentObservers.splice(observerIndex, 1);
123
+ }
124
+ toString() {
125
+ return JSON.stringify(this._config);
126
+ }
127
+ reset(config) {
128
+ this._config = Object.assign(Object.assign(Object.assign({}, this._config), config), { icons: Object.assign(Object.assign({}, this._config.icons), config.icons) });
129
+ this._notify(false);
130
+ }
131
+ _notify(all = true) {
132
+ for (const observer of this._componentObservers) {
133
+ observer.configChanged(this._config);
134
+ }
135
+ if (all) {
136
+ for (const observer of this._observers) {
137
+ observer.configChanged(this._config);
138
+ }
139
+ }
140
+ if (balBrowser.hasWindow) {
141
+ saveConfig(window, this._config);
142
+ }
143
+ }
144
+ }
145
+ const config = /*@__PURE__*/ new Config();
146
+ const configFromSession = (win) => {
147
+ try {
148
+ const configStr = win.sessionStorage.getItem(BALOISE_SESSION_KEY);
149
+ return configStr !== null ? JSON.parse(configStr) : {};
150
+ }
151
+ catch (e) {
152
+ return {};
153
+ }
154
+ };
155
+ const saveConfig = (win, c) => {
156
+ try {
157
+ win.sessionStorage.setItem(BALOISE_SESSION_KEY, JSON.stringify(c));
158
+ }
159
+ catch (e) {
160
+ return;
161
+ }
162
+ };
163
+
164
+ const setupConfig = (userConfig = {}, win = {}) => {
165
+ if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
166
+ win = window;
167
+ }
168
+ win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
169
+ config.reset(Object.assign(Object.assign(Object.assign({}, configFromSession(win)), userConfig), { icons: Object.assign(Object.assign({}, configFromSession(win).icons), userConfig.icons) }));
170
+ win.BaloiseDesignSystem.config = config;
171
+ };
172
+
29
173
  const i18nBalFieldLabel = {
30
174
  de: {
31
175
  optional: ' (optional)',
@@ -59,6 +203,139 @@ const i18nBalFieldLabel = {
59
203
  },
60
204
  };
61
205
 
206
+ class BalNoticeController {
207
+ constructor(options) {
208
+ this.options = options;
209
+ this.container = null;
210
+ this.queue = [];
211
+ this.preQueue = [];
212
+ this.queueLimit = 5;
213
+ }
214
+ create(options) {
215
+ if (balBrowser.hasDocument) {
216
+ this.setupContainer();
217
+ const clone = this.findClone(options);
218
+ if (clone === undefined) {
219
+ const el = document.createElement(this.options.tag);
220
+ Object.assign(el, options);
221
+ el.addEventListener('balClose', ev => {
222
+ this.removeFromQueue(ev.detail);
223
+ });
224
+ this.preQueue.push(el);
225
+ this.updateQueue();
226
+ return el;
227
+ }
228
+ return clone;
229
+ }
230
+ }
231
+ setQueue(queueLimit) {
232
+ this.queueLimit = queueLimit;
233
+ }
234
+ async dismissAll() {
235
+ var _a;
236
+ const elements = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.options.tag);
237
+ if (elements) {
238
+ const closingQueue = [];
239
+ for (let index = 0; index < elements.length; index++) {
240
+ const el = elements[index];
241
+ if (el.close) {
242
+ closingQueue.push(el.close());
243
+ }
244
+ }
245
+ await Promise.all(closingQueue);
246
+ }
247
+ }
248
+ /**
249
+ * @deprecated use dismissAll instead
250
+ */
251
+ async clearAll() {
252
+ console.warn('[DEPRECATED] - use dismissAll() instead');
253
+ return this.dismissAll();
254
+ }
255
+ findClone(options) {
256
+ for (let index = 0; index < this.queue.length; index++) {
257
+ const el = this.queue[index];
258
+ if (el.message === options.message && el.color === options.color) {
259
+ return el;
260
+ }
261
+ }
262
+ return undefined;
263
+ }
264
+ setupContainer() {
265
+ if (balBrowser.hasDocument) {
266
+ const containerId = `${this.options.tag}-container`;
267
+ this.container = document.getElementById(containerId);
268
+ if (this.container)
269
+ return;
270
+ if (!this.container) {
271
+ this.container = document.createElement('bal-notices');
272
+ this.container.setAttribute('interface', this.options.tag.replace('bal-', ''));
273
+ this.container.id = containerId;
274
+ }
275
+ document.body.appendChild(this.container);
276
+ }
277
+ }
278
+ updateQueue() {
279
+ var _a;
280
+ if (this.queue.length < this.queueLimit) {
281
+ const el = this.preQueue.shift();
282
+ if (el && this.container) {
283
+ this.queue.push(el);
284
+ this.container.insertAdjacentElement('beforeend', el);
285
+ }
286
+ }
287
+ if (this.queue.length === 0) {
288
+ (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
289
+ }
290
+ }
291
+ removeFromQueue(toastId) {
292
+ this.queue = this.queue.filter(el => el.id !== toastId);
293
+ setTimeout(() => this.updateQueue(), 0);
294
+ }
295
+ }
296
+
297
+ class BalToastController extends BalNoticeController {
298
+ constructor() {
299
+ super({
300
+ tag: 'bal-toast',
301
+ });
302
+ }
303
+ create(options) {
304
+ return super.create(options);
305
+ }
306
+ }
307
+ const balToastController = new BalToastController();
308
+
309
+ class BalSnackbarController extends BalNoticeController {
310
+ constructor() {
311
+ super({
312
+ tag: 'bal-snackbar',
313
+ });
314
+ }
315
+ create(options) {
316
+ return super.create(options);
317
+ }
318
+ }
319
+ const balSnackbarController = new BalSnackbarController();
320
+
321
+ // generated by .build/version.js
322
+ const VERSION = 'BAL_DEV_VERSION';
323
+
324
+ const initializeBaloiseDesignSystem = (userConfig = {}, platformConfig = undefined, win = {}) => {
325
+ if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
326
+ win = window;
327
+ }
328
+ win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
329
+ if (platformConfig) {
330
+ setPlatformHelpers(platformConfig);
331
+ }
332
+ setupConfig(Object.assign(Object.assign({}, userConfig), platformConfig), win);
333
+ win.BaloiseDesignSystem.toastController = balToastController;
334
+ win.BaloiseDesignSystem.snackbarController = balSnackbarController;
335
+ win.BaloiseDesignSystem.initialize = () => setupConfig(win.BaloiseDesignSystem.config, win);
336
+ win.BaloiseDesignSystem.version = VERSION;
337
+ };
338
+
62
339
  const newBalCheckboxOption = (option) => {
63
340
  return Object.assign(Object.assign({ interface: 'checkbox', labelHidden: false, flat: false, disabled: false, readonly: false, required: false, nonSubmit: false, invalid: false, checked: false }, option), { label: '', html: option.label });
64
341
  };
@@ -176,4 +453,4 @@ const isPlatform = (winOrPlatform, platform) => {
176
453
  const NewBalOptionValue = newBalOptionValue;
177
454
  const NewBalSingleOptionValue = newBalSingleOptionValue;
178
455
 
179
- export { BalModalController, BalOrientationSubject, NewBalOptionValue, NewBalSingleOptionValue, balModalController, balOrientationSubject, getPlatforms, hasTouchSupport, i18nBalFieldLabel, isBrowser, isPlatform, newBalCheckboxOption, newBalOptionValue, newBalRadioOption, newBalSingleOptionValue };
456
+ export { BalModalController, BalOrientationSubject, BalSnackbarController, BalToastController, NewBalOptionValue, NewBalSingleOptionValue, balModalController, balOrientationSubject, balSnackbarController, balToastController, getPlatforms, hasTouchSupport, i18nBalFieldLabel, initializeBaloiseDesignSystem as initialize, initializeBaloiseDesignSystem, isBrowser, isPlatform, newBalCheckboxOption, newBalOptionValue, newBalRadioOption, newBalSingleOptionValue, setupConfig };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 28 Feb 2024 14:35:35 GMT
3
+ * Generated on Wed, 28 Feb 2024 13:27:31 GMT
4
4
  */
5
5
  const balColorGreen3 = "#94e3d4";
6
6
  const balColorGreen6 = "#1b5951";
@@ -2,8 +2,10 @@
2
2
 
3
3
  const initialize = require('./initialize-9c752efa.js');
4
4
 
5
- function globalScript () {
5
+ function appGlobalScript () {
6
6
  initialize.initializeBaloiseDesignSystem();
7
7
  }
8
8
 
9
- exports.globalScript = globalScript;
9
+ const globalScripts = appGlobalScript;
10
+
11
+ exports.globalScripts = globalScripts;
@@ -7,12 +7,12 @@ const tslib_es6 = require('./tslib.es6-a680968e.js');
7
7
  const helpers = require('./helpers-2a8c8333.js');
8
8
  const bem = require('./bem-81bc6a2d.js');
9
9
  const formInput = require('./form-input-134c5116.js');
10
- const breakpoints_decorator = require('./breakpoints.decorator-d23cb3cb.js');
10
+ const breakpoints_decorator = require('./breakpoints.decorator-317b79eb.js');
11
11
  const style = require('./style-799e9253.js');
12
12
  const mutation_decorator = require('./mutation.decorator-8877b940.js');
13
13
  const swipe_decorator = require('./swipe.decorator-5206d283.js');
14
14
  const resize_decorator = require('./resize.decorator-ae91ead2.js');
15
- const breakpoints_subject = require('./breakpoints.subject-10b97f68.js');
15
+ const breakpoints_subject = require('./breakpoints.subject-d01efdb0.js');
16
16
  const config_default = require('./config.default-32725178.js');
17
17
  const config_decorator = require('./config.decorator-b393a72f.js');
18
18
  const attributes = require('./attributes-9f366716.js');
@@ -22,7 +22,7 @@ require('./config.utils-e4cd49d6.js');
22
22
  require('./listener-52d2e5fd.js');
23
23
  require('./swipe.subject-4ec94271.js');
24
24
  require('./device-9f97a845.js');
25
- require('./tokens.esm-50b082a1.js');
25
+ require('./tokens.esm-49773ac1.js');
26
26
  require('./log-33398c2a.js');
27
27
 
28
28
  const TabControl = ({ value, items, onControlChange }) => {
@@ -16,16 +16,16 @@ const bem = require('./bem-81bc6a2d.js');
16
16
  const log = require('./log-33398c2a.js');
17
17
  const form = require('./form-2279fb2f.js');
18
18
  const config_default = require('./config.default-32725178.js');
19
- const breakpoints_subject = require('./breakpoints.subject-10b97f68.js');
19
+ const breakpoints_subject = require('./breakpoints.subject-d01efdb0.js');
20
20
  const config_utils = require('./config.utils-e4cd49d6.js');
21
- const breakpoints_decorator = require('./breakpoints.decorator-d23cb3cb.js');
21
+ const breakpoints_decorator = require('./breakpoints.decorator-317b79eb.js');
22
22
  const config_decorator = require('./config.decorator-b393a72f.js');
23
23
  require('./browser-1d542d0f.js');
24
24
  require('./icons.constant-7c82086a.js');
25
25
  require('./_commonjsHelpers-68cdf74f.js');
26
26
  require('./device-9f97a845.js');
27
27
  require('./listener-52d2e5fd.js');
28
- require('./tokens.esm-50b082a1.js');
28
+ require('./tokens.esm-49773ac1.js');
29
29
 
30
30
  /**
31
31
  * @name addDays
@@ -7,8 +7,8 @@ const tslib_es6 = require('./tslib.es6-a680968e.js');
7
7
  const bem = require('./bem-81bc6a2d.js');
8
8
  const utils = require('./utils-9ea175af.js');
9
9
  const scroll = require('./scroll-b839ffe1.js');
10
- const breakpoints_subject = require('./breakpoints.subject-10b97f68.js');
11
- const breakpoints_decorator = require('./breakpoints.decorator-d23cb3cb.js');
10
+ const breakpoints_subject = require('./breakpoints.subject-d01efdb0.js');
11
+ const breakpoints_decorator = require('./breakpoints.decorator-317b79eb.js');
12
12
  const config_decorator = require('./config.decorator-b393a72f.js');
13
13
  require('./index-e6a233be.js');
14
14
  require('./browser-1d542d0f.js');
@@ -17,7 +17,7 @@ require('./icons.constant-7c82086a.js');
17
17
  require('./config.utils-e4cd49d6.js');
18
18
  require('./device-9f97a845.js');
19
19
  require('./listener-52d2e5fd.js');
20
- require('./tokens.esm-50b082a1.js');
20
+ require('./tokens.esm-49773ac1.js');
21
21
 
22
22
  const balHintCss = ":root{--bal-hint-content-background:var(--bal-color-grey-2)}.bal-hint{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block}.bal-hint__icon{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}@media (hover: hover)and (pointer: fine){.bal-hint__icon:hover svg,.bal-hint__icon:hover g,.bal-hint__icon:hover path,.bal-hint__icon:hover circle,.bal-hint__icon:focus svg,.bal-hint__icon:focus g,.bal-hint__icon:focus path,.bal-hint__icon:focus circle{fill:var(--bal-color-light-blue-5)}}.bal-hint__content{background:var(--bal-hint-content-background);display:-ms-flexbox;display:flex;gap:1.5rem;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 768px){.bal-hint__content{padding:1.25rem;min-height:100%}.bal-hint__content>div{-ms-flex:1;flex:1}}.bal-hint__content__title{display:block;margin-bottom:1rem}.bal-hint__content__title__heading{font-family:var(--bal-title-font-family);font-weight:var(--bal-title-font-weight);font-size:var(--bal-text-size-x-large);line-height:var(--bal-line-height-x-large)}@media screen and (min-width: 769px),print{.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-tablet);line-height:var(--bal-line-height-tablet-x-large)}}@media screen and (min-width: 1024px){.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-desktop);line-height:var(--bal-line-height-desktop-x-large)}}@media screen and (min-width: 769px),print{.bal-hint__content__buttons--is-hidden-desktop{display:none !important}}.bal-hint__overlay__content{position:fixed;display:none;overflow:auto;top:0;left:0;right:0;bottom:0;z-index:var(--bal-z-index-popup)}.bal-hint__overlay__content--active{display:block}";
23
23
  const BalHintStyle0 = balHintCss;