@baloise/ds-core 18.0.1 → 18.1.0-nightly.20250321

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 (197) hide show
  1. package/components/all.d.ts +2 -0
  2. package/components/all.js +3 -0
  3. package/components/bal-app.js +1 -93
  4. package/components/bal-app2.js +95 -0
  5. package/components/bal-doc-app.d.ts +11 -0
  6. package/components/bal-doc-app.js +262 -0
  7. package/components/bal-dropdown.js +2 -2
  8. package/components/bal-hint2.js +2 -1
  9. package/components/bal-input-slider.js +1 -1
  10. package/components/bal-notices.js +1 -1
  11. package/components/bal-option.js +1 -1
  12. package/components/bal-segment-item.js +6 -3
  13. package/components/bal-segment.js +6 -1
  14. package/components/bal-select2.js +21 -18
  15. package/components/bal-tabs2.js +1 -1
  16. package/components/index.js +7 -314
  17. package/components/initialize.js +312 -0
  18. package/components/tokens.esm.js +1 -1
  19. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  20. package/dist/baloise-design-system/baloise-design-system.js +1 -1
  21. package/dist/baloise-design-system/index.esm.js +1 -1
  22. package/dist/baloise-design-system/{p-39b2f9098c.system.entry.js → p-00deb826c5.system.entry.js} +1 -1
  23. package/dist/baloise-design-system/{p-5e74181495.entry.js → p-08ba87f822.entry.js} +1 -1
  24. package/dist/baloise-design-system/p-1288c2ed8a.entry.js +1 -0
  25. package/dist/baloise-design-system/p-169a6438.js +1 -0
  26. package/dist/baloise-design-system/{p-23a35bb927.entry.js → p-1a645a4216.entry.js} +1 -1
  27. package/dist/baloise-design-system/{p-ed486891d7.entry.js → p-1d30aba2fa.entry.js} +1 -1
  28. package/dist/baloise-design-system/p-1e142b10.system.js +1 -0
  29. package/dist/baloise-design-system/{p-3fba50f8c3.entry.js → p-2397bc105e.entry.js} +1 -1
  30. package/dist/baloise-design-system/p-294f38c2.js +1 -0
  31. package/dist/baloise-design-system/{p-70dadc46c5.system.entry.js → p-2bec5483bc.system.entry.js} +1 -1
  32. package/dist/baloise-design-system/p-327cd52735.entry.js +1 -0
  33. package/dist/baloise-design-system/p-36d8ef03de.entry.js +1 -0
  34. package/dist/baloise-design-system/p-3913c6ae.js +1 -1
  35. package/dist/baloise-design-system/{p-34032227.system.js → p-3d9451bf.system.js} +1 -1
  36. package/dist/baloise-design-system/p-400bbebf71.entry.js +1 -0
  37. package/dist/baloise-design-system/{p-a03105c3.system.js → p-42821f89.system.js} +1 -1
  38. package/dist/baloise-design-system/p-42e66219.system.js +1 -0
  39. package/dist/baloise-design-system/p-4504bc9205.system.entry.js +1 -0
  40. package/dist/baloise-design-system/{p-22bf33e3.system.js → p-461633eb.system.js} +1 -1
  41. package/dist/baloise-design-system/p-47f0669a.js +1 -0
  42. package/dist/baloise-design-system/{p-fed12040.system.js → p-4a5527e6.system.js} +1 -1
  43. package/dist/baloise-design-system/p-607d361ba3.system.entry.js +1 -0
  44. package/dist/baloise-design-system/p-659ecadc.system.js +1 -1
  45. package/dist/baloise-design-system/p-66e61f6f9f.system.entry.js +1 -0
  46. package/dist/baloise-design-system/{p-877dedf909.entry.js → p-76b26105dc.entry.js} +1 -1
  47. package/dist/baloise-design-system/p-778ff1954d.system.entry.js +1 -0
  48. package/dist/baloise-design-system/{p-dc37efd978.entry.js → p-7813ab5b07.entry.js} +1 -1
  49. package/dist/baloise-design-system/{p-85606f4e13.system.entry.js → p-78e99bcb3e.system.entry.js} +1 -1
  50. package/dist/baloise-design-system/p-7ae2fea79d.system.entry.js +1 -0
  51. package/dist/baloise-design-system/{p-9acb9cc8.js → p-7db0efde.js} +1 -1
  52. package/dist/baloise-design-system/{p-db7629bccc.entry.js → p-7dc7716bb7.entry.js} +1 -1
  53. package/dist/baloise-design-system/{p-840a0efa.js → p-7f63c849.js} +1 -1
  54. package/dist/baloise-design-system/{p-456114b8.system.js → p-83512f21.system.js} +1 -1
  55. package/dist/baloise-design-system/{p-75652c1651.system.entry.js → p-894409314e.system.entry.js} +1 -1
  56. package/dist/baloise-design-system/{p-34ad523186.system.entry.js → p-8adf28e2a6.system.entry.js} +1 -1
  57. package/dist/baloise-design-system/{p-be6dd05fc0.system.entry.js → p-8c3b88672e.system.entry.js} +1 -1
  58. package/dist/baloise-design-system/p-8c53583cf5.entry.js +1 -0
  59. package/dist/baloise-design-system/{p-3f9a8e2dcc.system.entry.js → p-8e3c4c01ee.system.entry.js} +1 -1
  60. package/dist/baloise-design-system/{p-7f6c434d89.entry.js → p-a0d0cd2901.entry.js} +1 -1
  61. package/dist/baloise-design-system/{p-ac45b3909a.entry.js → p-a42a84d995.entry.js} +1 -1
  62. package/dist/baloise-design-system/{p-25abad2f11.system.entry.js → p-a6ac4ef488.system.entry.js} +1 -1
  63. package/dist/baloise-design-system/p-a70f415677.system.entry.js +1 -0
  64. package/dist/baloise-design-system/p-b46a35c33c.system.entry.js +1 -0
  65. package/dist/baloise-design-system/p-bc7a3aaabb.system.entry.js +1 -0
  66. package/dist/baloise-design-system/{p-5a63d73a88.entry.js → p-cc3b04c9cd.entry.js} +1 -1
  67. package/dist/baloise-design-system/{p-1512fec0e3.system.entry.js → p-cde2f1b92d.system.entry.js} +1 -1
  68. package/dist/baloise-design-system/p-d12d3c7b43.entry.js +1 -0
  69. package/dist/baloise-design-system/{p-c7f61011d3.entry.js → p-d5d723f76d.entry.js} +1 -1
  70. package/dist/baloise-design-system/{p-ee4234b3a7.system.entry.js → p-e15f5db45e.system.entry.js} +1 -1
  71. package/dist/baloise-design-system/{p-5c006211fd.entry.js → p-ee6f5a6163.entry.js} +1 -1
  72. package/dist/cjs/app-globals-f63c33e7.js +7 -0
  73. package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
  74. package/dist/cjs/bal-doc-app.cjs.entry.js +233 -0
  75. package/dist/cjs/bal-dropdown.cjs.entry.js +2 -2
  76. package/dist/cjs/bal-hint_5.cjs.entry.js +5 -4
  77. package/dist/cjs/bal-input-slider.cjs.entry.js +1 -1
  78. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  79. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  80. package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
  81. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  82. package/dist/cjs/bal-notices_3.cjs.entry.js +1 -1
  83. package/dist/cjs/bal-option_2.cjs.entry.js +1 -1
  84. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  85. package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
  86. package/dist/cjs/bal-segment_2.cjs.entry.js +13 -6
  87. package/dist/cjs/bal-select_2.cjs.entry.js +23 -20
  88. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  89. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  90. package/dist/cjs/bal-tab-item_2.cjs.entry.js +4 -4
  91. package/dist/cjs/baloise-design-system.cjs.js +3 -2
  92. package/dist/cjs/{breakpoints.decorator-bf98693c.js → breakpoints.decorator-6c992766.js} +1 -1
  93. package/dist/cjs/{breakpoints.subject-ca13c9b6.js → breakpoints.subject-7d5d94f0.js} +1 -1
  94. package/dist/cjs/{app-globals-0d8db19e.js → global-2a76769b.js} +2 -4
  95. package/dist/cjs/index.cjs.js +2 -2
  96. package/dist/cjs/initialize-2e8978a4.js +1 -1
  97. package/dist/cjs/loader.cjs.js +3 -2
  98. package/dist/cjs/{tokens.esm-f9da33d0.js → tokens.esm-92badd0d.js} +1 -1
  99. package/dist/cjs/{window-resize.decorator-8bf053a1.js → window-resize.decorator-2734c860.js} +1 -1
  100. package/dist/collection/collection-manifest.json +2 -1
  101. package/dist/collection/components/bal-dropdown/bal-dropdown.css +1 -1
  102. package/dist/collection/components/bal-hint/bal-hint.js +2 -1
  103. package/dist/collection/components/bal-input-slider/bal-input-slider.css +1 -1
  104. package/dist/collection/components/bal-notices/bal-notices.css +1 -1
  105. package/dist/collection/components/bal-option/bal-option.css +1 -1
  106. package/dist/collection/components/bal-segment/bal-segment-item/bal-segment-item.js +6 -3
  107. package/dist/collection/components/bal-segment/bal-segment.js +7 -1
  108. package/dist/collection/components/bal-select/bal-select.css +1 -1
  109. package/dist/collection/components/bal-select/bal-select.js +22 -19
  110. package/dist/collection/components/bal-tabs/bal-tabs.css +1 -1
  111. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +1 -0
  112. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +247 -0
  113. package/dist/collection/utils/constants/version.constant.js +1 -1
  114. package/dist/collection/utils/dropdown/icon.js +1 -1
  115. package/dist/esm/app-globals-1ecf000f.js +5 -0
  116. package/dist/esm/bal-carousel_2.entry.js +3 -3
  117. package/dist/esm/bal-doc-app.entry.js +229 -0
  118. package/dist/esm/bal-dropdown.entry.js +2 -2
  119. package/dist/esm/bal-hint_5.entry.js +5 -4
  120. package/dist/esm/bal-input-slider.entry.js +1 -1
  121. package/dist/esm/bal-list_8.entry.js +3 -3
  122. package/dist/esm/bal-logo.entry.js +3 -3
  123. package/dist/esm/bal-nav_8.entry.js +3 -3
  124. package/dist/esm/bal-navbar_5.entry.js +3 -3
  125. package/dist/esm/bal-notices_3.entry.js +1 -1
  126. package/dist/esm/bal-option_2.entry.js +1 -1
  127. package/dist/esm/bal-pagination.entry.js +3 -3
  128. package/dist/esm/bal-progress-bar.entry.js +4 -4
  129. package/dist/esm/bal-segment_2.entry.js +13 -6
  130. package/dist/esm/bal-select_2.entry.js +23 -20
  131. package/dist/esm/bal-shape.entry.js +1 -1
  132. package/dist/esm/bal-steps.entry.js +3 -3
  133. package/dist/esm/bal-tab-item_2.entry.js +4 -4
  134. package/dist/esm/baloise-design-system.js +3 -2
  135. package/dist/esm/{breakpoints.decorator-b4e100af.js → breakpoints.decorator-0e298589.js} +1 -1
  136. package/dist/esm/{breakpoints.subject-cdc6fe81.js → breakpoints.subject-76b51f0c.js} +1 -1
  137. package/dist/esm/{app-globals-5dd5fe6b.js → global-6e86728b.js} +2 -4
  138. package/dist/esm/index.js +3 -3
  139. package/dist/esm/initialize-be160cc4.js +1 -1
  140. package/dist/esm/loader.js +3 -2
  141. package/dist/esm/{tokens.esm-3507f732.js → tokens.esm-fc1b05f8.js} +1 -1
  142. package/dist/esm/{window-resize.decorator-b062fe49.js → window-resize.decorator-79f14237.js} +1 -1
  143. package/dist/esm-es5/app-globals-1ecf000f.js +1 -0
  144. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  145. package/dist/esm-es5/bal-doc-app.entry.js +1 -0
  146. package/dist/esm-es5/bal-dropdown.entry.js +1 -1
  147. package/dist/esm-es5/bal-hint_5.entry.js +1 -1
  148. package/dist/esm-es5/bal-input-slider.entry.js +1 -1
  149. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  150. package/dist/esm-es5/bal-logo.entry.js +1 -1
  151. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  152. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  153. package/dist/esm-es5/bal-notices_3.entry.js +1 -1
  154. package/dist/esm-es5/bal-option_2.entry.js +1 -1
  155. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  156. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  157. package/dist/esm-es5/bal-segment_2.entry.js +1 -1
  158. package/dist/esm-es5/bal-select_2.entry.js +1 -1
  159. package/dist/esm-es5/bal-shape.entry.js +1 -1
  160. package/dist/esm-es5/bal-steps.entry.js +1 -1
  161. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  162. package/dist/esm-es5/baloise-design-system.js +1 -1
  163. package/dist/esm-es5/breakpoints.decorator-0e298589.js +1 -0
  164. package/dist/esm-es5/{breakpoints.subject-cdc6fe81.js → breakpoints.subject-76b51f0c.js} +1 -1
  165. package/dist/esm-es5/global-6e86728b.js +1 -0
  166. package/dist/esm-es5/index.js +1 -1
  167. package/dist/esm-es5/initialize-be160cc4.js +1 -1
  168. package/dist/esm-es5/loader.js +1 -1
  169. package/dist/esm-es5/{window-resize.decorator-b062fe49.js → window-resize.decorator-79f14237.js} +1 -1
  170. package/dist/types/components/bal-segment/bal-segment-item/bal-segment-item.d.ts +1 -1
  171. package/dist/types/components/bal-segment/bal-segment.d.ts +1 -0
  172. package/dist/types/components/bal-select/bal-select.d.ts +3 -3
  173. package/dist/types/components/bal-toast/bal-toast.controller.d.ts +3 -1
  174. package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +21 -0
  175. package/dist/types/components.d.ts +37 -0
  176. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +82 -0
  177. package/package.json +6 -6
  178. package/dist/baloise-design-system/p-002d7bb9.js +0 -1
  179. package/dist/baloise-design-system/p-0decd55a89.system.entry.js +0 -1
  180. package/dist/baloise-design-system/p-21c3aa7b06.entry.js +0 -1
  181. package/dist/baloise-design-system/p-345aa92d.system.js +0 -1
  182. package/dist/baloise-design-system/p-43b05af8f6.system.entry.js +0 -1
  183. package/dist/baloise-design-system/p-482bab74a7.entry.js +0 -1
  184. package/dist/baloise-design-system/p-48809a4768.entry.js +0 -1
  185. package/dist/baloise-design-system/p-488d5977.js +0 -1
  186. package/dist/baloise-design-system/p-5402f1b097.system.entry.js +0 -1
  187. package/dist/baloise-design-system/p-6ee0ee61c1.system.entry.js +0 -1
  188. package/dist/baloise-design-system/p-7644800ac6.system.entry.js +0 -1
  189. package/dist/baloise-design-system/p-88ae92d281.entry.js +0 -1
  190. package/dist/baloise-design-system/p-9c383b422e.entry.js +0 -1
  191. package/dist/baloise-design-system/p-9d2cadcc98.system.entry.js +0 -1
  192. package/dist/baloise-design-system/p-f879e3d4c0.system.entry.js +0 -1
  193. package/dist/esm-es5/app-globals-5dd5fe6b.js +0 -1
  194. package/dist/esm-es5/breakpoints.decorator-b4e100af.js +0 -1
  195. /package/dist/baloise-design-system/{p-9f2f203c.system.js → p-52eae3c9.system.js} +0 -0
  196. /package/dist/baloise-design-system/{p-7a7a71d1.js → p-d1486c6c.js} +0 -0
  197. /package/dist/esm-es5/{tokens.esm-3507f732.js → tokens.esm-fc1b05f8.js} +0 -0
@@ -1,4 +1,3 @@
1
- import { setPlatformHelpers } from '@stencil/core/internal/client';
2
1
  export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
3
2
  export { F as FileUploadRejectionReason } from './bal-file-upload.type.js';
4
3
  export { i as i18nBalDate } from './bal-date.i18n.js';
@@ -6,17 +5,16 @@ export { i as i18nBalClose } from './bal-close.i18n.js';
6
5
  export { i as i18nBalTimeInput } from './bal-time-input.i18n.js';
7
6
  export { i as i18nBalInputStepper } from './bal-input-stepper.i18n.js';
8
7
  export { i as i18nBalLabel } from './bal-label.i18n.js';
9
- import { b as balBrowser } from './browser.js';
10
- export { b as balBrowser } from './browser.js';
11
- import { w as waitForComponent, g as getAppRoot, c as componentOnReady } from './helpers.js';
12
- export { c as componentOnReady, h as deepReady, g as getAppRoot, j as isDescendant, s as shallowReady, i as wait, b as waitAfterFramePaint, d as waitAfterIdleCallback, e as waitAfterLargestContentfulPaintCallback, w as waitForComponent, a as waitForDesignSystem, f as waitOnLoadEventCallback } from './helpers.js';
13
- import { d as defaultConfig } from './config.default.js';
14
- export { d as defaultConfig } from './config.default.js';
8
+ 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';
15
9
  export { n as newBalOption } from './option.js';
16
10
  export { n as newBalStepOption } from './bal-step.util.js';
17
11
  export { n as newBalTabOption } from './bal-tab.util.js';
12
+ import { g as getAppRoot, c as componentOnReady } from './helpers.js';
13
+ export { c as componentOnReady, h as deepReady, g as getAppRoot, j as isDescendant, s as shallowReady, i as wait, b as waitAfterFramePaint, d as waitAfterIdleCallback, e as waitAfterLargestContentfulPaintCallback, w as waitForComponent, a as waitForDesignSystem, f as waitOnLoadEventCallback } from './helpers.js';
18
14
  export { s as scrollToFirstInvalidField } from './form.js';
19
15
  export { B as BalScrollHandler } from './scroll.js';
16
+ import { b as balBrowser } from './browser.js';
17
+ export { b as balBrowser } from './browser.js';
20
18
  import { b as balDevice } from './device.js';
21
19
  export { B as BalDevice, b as balDevice } from './device.js';
22
20
  export { I as INVALID_VALUE } from './mask-util.js';
@@ -24,175 +22,11 @@ import { g as getOverlays, a as getOverlay } from './overlays.js';
24
22
  import { B as BalWindowResizeListener, b as balBreakpoints } from './breakpoints.subject.js';
25
23
  export { c as BalBreakpointSubject, d as BalBreakpointsUtil, a as balBreakpointSubject, b as balBreakpoints } from './breakpoints.subject.js';
26
24
  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';
25
+ export { d as defaultConfig } from './config.default.js';
27
26
  import { S as Subject } from './listener.js';
28
27
  export { B as BalSwipeSubject } from './swipe.subject.js';
29
28
  export { B as BalDate } from './date.js';
30
29
 
31
- const BALOISE_SESSION_KEY = 'baloise-persist-config';
32
- const BALOISE_ANIMATION_KEY = 'baloise-animated';
33
-
34
- class Config {
35
- constructor() {
36
- this._componentObservers = [];
37
- this._observers = [];
38
- this._config = defaultConfig;
39
- }
40
- get locale() {
41
- return `${this._config.language}-${this._config.region}`;
42
- }
43
- get region() {
44
- return this._config.region;
45
- }
46
- set region(region) {
47
- if (region !== this._config.region) {
48
- this._config.region = region;
49
- this._notify();
50
- }
51
- }
52
- get language() {
53
- return this._config.language;
54
- }
55
- set language(language) {
56
- if (language !== this._config.language) {
57
- if (this._config.allowedLanguages.includes(language)) {
58
- this._config.language = language;
59
- }
60
- else {
61
- this._config.language = this._config.fallbackLanguage;
62
- }
63
- this._notify();
64
- }
65
- }
66
- get allowedLanguages() {
67
- return this._config.allowedLanguages;
68
- }
69
- set allowedLanguages(allowedLanguages) {
70
- if (allowedLanguages !== this._config.allowedLanguages) {
71
- this._config.allowedLanguages = allowedLanguages;
72
- this._notify();
73
- }
74
- }
75
- get icons() {
76
- return this._config.icons;
77
- }
78
- set icons(icons) {
79
- this._config.icons = Object.assign(Object.assign({}, this._config.icons), icons);
80
- this._notify();
81
- }
82
- get logger() {
83
- return this._config.logger;
84
- }
85
- set logger(logger) {
86
- this._config.logger = Object.assign({}, logger);
87
- this._notify();
88
- }
89
- get animated() {
90
- return this._config.animated;
91
- }
92
- set animated(animated) {
93
- this._config.animated = animated;
94
- this._notify();
95
- }
96
- get httpFormSubmit() {
97
- return this._config.httpFormSubmit;
98
- }
99
- set httpFormSubmit(httpFormSubmit) {
100
- this._config.httpFormSubmit = httpFormSubmit;
101
- this._notify();
102
- }
103
- attach(observer) {
104
- const isExist = this._observers.includes(observer);
105
- if (isExist) {
106
- return console.log('Subject: Observer has been attached already.');
107
- }
108
- this._observers.push(observer);
109
- observer.configChanged(this._config);
110
- }
111
- detach(observer) {
112
- const observerIndex = this._observers.indexOf(observer);
113
- if (observerIndex === -1) {
114
- return console.log('Subject: Nonexistent observer.');
115
- }
116
- this._observers.splice(observerIndex, 1);
117
- }
118
- attachComponent(observer) {
119
- const isExist = this._componentObservers.includes(observer);
120
- if (isExist) {
121
- return console.log('Subject: Observer has been attached already.');
122
- }
123
- this._componentObservers.push(observer);
124
- observer.configChanged(this._config);
125
- }
126
- detachComponent(observer) {
127
- const observerIndex = this._componentObservers.indexOf(observer);
128
- if (observerIndex === -1) {
129
- return console.log('Subject: Nonexistent observer.');
130
- }
131
- this._componentObservers.splice(observerIndex, 1);
132
- }
133
- toString() {
134
- return JSON.stringify(this._config);
135
- }
136
- reset(config) {
137
- this._config = Object.assign(Object.assign(Object.assign({}, this._config), config), { icons: Object.assign(Object.assign({}, this._config.icons), config.icons) });
138
- this._notify(false);
139
- }
140
- _notify(all = true) {
141
- for (const observer of this._componentObservers) {
142
- observer.configChanged(this._config);
143
- }
144
- if (all) {
145
- for (const observer of this._observers) {
146
- observer.configChanged(this._config);
147
- }
148
- }
149
- if (balBrowser.hasWindow) {
150
- saveConfig(window, this._config);
151
- }
152
- }
153
- }
154
- const config = /*@__PURE__*/ new Config();
155
- const configFromSession = (win) => {
156
- try {
157
- const configStr = win.sessionStorage.getItem(BALOISE_SESSION_KEY);
158
- return configStr !== null ? JSON.parse(configStr) : {};
159
- }
160
- catch (e) {
161
- return {};
162
- }
163
- };
164
- const configFromLocalStorage = (win) => {
165
- try {
166
- const animated = JSON.parse(win.localStorage.getItem(BALOISE_ANIMATION_KEY));
167
- if (animated !== null) {
168
- return {
169
- animated,
170
- };
171
- }
172
- return {};
173
- }
174
- catch (e) {
175
- return {};
176
- }
177
- };
178
- const saveConfig = (win, c) => {
179
- try {
180
- win.sessionStorage.setItem(BALOISE_SESSION_KEY, JSON.stringify(c));
181
- }
182
- catch (e) {
183
- return;
184
- }
185
- };
186
-
187
- const setupConfig = (userConfig = {}, win = {}) => {
188
- if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
189
- win = window;
190
- }
191
- win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
192
- 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) }));
193
- win.BaloiseDesignSystem.config = config;
194
- };
195
-
196
30
  const i18nBalFieldLabel = {
197
31
  de: {
198
32
  optional: ' (optional)',
@@ -226,147 +60,6 @@ const i18nBalFieldLabel = {
226
60
  },
227
61
  };
228
62
 
229
- class BalNoticeController {
230
- constructor(options) {
231
- this.options = options;
232
- this.container = null;
233
- this.queue = [];
234
- this.preQueue = [];
235
- this.queueLimit = 5;
236
- }
237
- create(options) {
238
- if (balBrowser.hasDocument) {
239
- this.setupContainer(options);
240
- const clone = this.findClone(options);
241
- if (clone === undefined) {
242
- const el = document.createElement(this.options.tag);
243
- Object.assign(el, options);
244
- el.addEventListener('balClose', ev => {
245
- this.removeFromQueue(ev.detail);
246
- });
247
- this.preQueue.push(el);
248
- this.updateQueue();
249
- return el;
250
- }
251
- return clone;
252
- }
253
- }
254
- setQueue(queueLimit) {
255
- this.queueLimit = queueLimit;
256
- }
257
- async dismissAll() {
258
- var _a;
259
- const elements = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.options.tag);
260
- if (elements) {
261
- const closingQueue = [];
262
- for (let index = 0; index < elements.length; index++) {
263
- const el = elements[index];
264
- if (el.close) {
265
- closingQueue.push(el.close());
266
- }
267
- }
268
- await Promise.all(closingQueue);
269
- }
270
- }
271
- /**
272
- * @deprecated use dismissAll instead
273
- */
274
- async clearAll() {
275
- console.warn('[DEPRECATED] - use dismissAll() instead');
276
- return this.dismissAll();
277
- }
278
- findClone(options) {
279
- for (let index = 0; index < this.queue.length; index++) {
280
- const el = this.queue[index];
281
- if (el.message === options.message && el.color === options.color) {
282
- return el;
283
- }
284
- }
285
- return undefined;
286
- }
287
- setupContainer(options) {
288
- if (balBrowser.hasDocument) {
289
- const containerId = `${this.options.tag}-container`;
290
- this.container = document.getElementById(containerId);
291
- if (this.container)
292
- return;
293
- if (!this.container) {
294
- this.container = document.createElement('bal-notices');
295
- this.container.setAttribute('interface', this.options.tag.replace('bal-', ''));
296
- this.container.setAttribute('animated', options.animated ? 'true' : 'false');
297
- if (options.container !== undefined) {
298
- this.container.setAttribute('container', options.container === true ? '' : options.container);
299
- }
300
- this.container.id = containerId;
301
- }
302
- document.body.appendChild(this.container);
303
- }
304
- }
305
- async updateQueue() {
306
- var _a;
307
- if (this.queue.length < this.queueLimit) {
308
- const el = this.preQueue.shift();
309
- if (el && this.container) {
310
- await waitForComponent(this.container);
311
- const innerEl = this.container.querySelector('.bal-notices__inner');
312
- if (innerEl) {
313
- this.queue.push(el);
314
- innerEl.insertAdjacentElement('beforeend', el);
315
- }
316
- }
317
- }
318
- if (this.queue.length === 0) {
319
- (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
320
- }
321
- }
322
- removeFromQueue(toastId) {
323
- this.queue = this.queue.filter(el => el.id !== toastId);
324
- setTimeout(() => this.updateQueue(), 0);
325
- }
326
- }
327
-
328
- class BalToastController extends BalNoticeController {
329
- constructor() {
330
- super({
331
- tag: 'bal-toast',
332
- });
333
- }
334
- create(options) {
335
- return super.create(options);
336
- }
337
- }
338
- const balToastController = new BalToastController();
339
-
340
- class BalSnackbarController extends BalNoticeController {
341
- constructor() {
342
- super({
343
- tag: 'bal-snackbar',
344
- });
345
- }
346
- create(options) {
347
- return super.create(options);
348
- }
349
- }
350
- const balSnackbarController = new BalSnackbarController();
351
-
352
- // generated by .build/version.js
353
- const VERSION = '18.0.1';
354
-
355
- const initializeBaloiseDesignSystem = (userConfig = {}, platformConfig = undefined, win = {}) => {
356
- if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
357
- win = window;
358
- }
359
- win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
360
- if (platformConfig) {
361
- setPlatformHelpers(platformConfig);
362
- }
363
- setupConfig(Object.assign(Object.assign({}, userConfig), platformConfig), win);
364
- win.BaloiseDesignSystem.toastController = balToastController;
365
- win.BaloiseDesignSystem.snackbarController = balSnackbarController;
366
- win.BaloiseDesignSystem.initialize = () => setupConfig(win.BaloiseDesignSystem.config, win);
367
- win.BaloiseDesignSystem.version = VERSION;
368
- };
369
-
370
63
  const newBalCheckboxOption = (option) => {
371
64
  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 });
372
65
  };
@@ -484,4 +177,4 @@ const isPlatform = (winOrPlatform, platform) => {
484
177
  const NewBalOptionValue = newBalOptionValue;
485
178
  const NewBalSingleOptionValue = newBalSingleOptionValue;
486
179
 
487
- 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 };
180
+ export { BalModalController, BalOrientationSubject, NewBalOptionValue, NewBalSingleOptionValue, balModalController, balOrientationSubject, getPlatforms, hasTouchSupport, i18nBalFieldLabel, isBrowser, isPlatform, newBalCheckboxOption, newBalOptionValue, newBalRadioOption, newBalSingleOptionValue };
@@ -0,0 +1,312 @@
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 = '18.1.0-nightly.20250321';
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 };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 28 Feb 2025 07:31:33 GMT
3
+ * Generated on Fri, 21 Mar 2025 06:16:24 GMT
4
4
  */
5
5
  const balColorGreen3 = "#94e3d4";
6
6
  const balColorGreen6 = "#1b5951";