@baloise/ds-core 16.0.0 → 16.0.1-nightly.20240315

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 (188) hide show
  1. package/components/bal-app.js +1 -85
  2. package/components/bal-app2.js +87 -0
  3. package/components/bal-doc-app.d.ts +11 -0
  4. package/components/bal-doc-app.js +260 -0
  5. package/components/index.js +5 -282
  6. package/components/initialize.js +281 -0
  7. package/components/tokens.esm.js +1 -1
  8. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  9. package/dist/baloise-design-system/baloise-design-system.js +1 -1
  10. package/dist/baloise-design-system/index.esm.js +1 -1
  11. package/dist/baloise-design-system/{p-0124888521.system.entry.js → p-0379f01b6f.system.entry.js} +1 -1
  12. package/dist/baloise-design-system/{p-6a83be40a2.system.entry.js → p-1cf502d8fb.system.entry.js} +1 -1
  13. package/dist/baloise-design-system/{p-e6b910045a.system.entry.js → p-25de7bf9c9.system.entry.js} +1 -1
  14. package/dist/baloise-design-system/{p-abccc44c5d.entry.js → p-270a2bbcce.entry.js} +1 -1
  15. package/dist/baloise-design-system/{p-4a6667fb7d.entry.js → p-2ade2b411e.entry.js} +1 -1
  16. package/dist/baloise-design-system/{p-6072b2fb.js → p-31e2377e.js} +1 -1
  17. package/dist/baloise-design-system/{p-1b829e9df5.entry.js → p-3479dae1e0.entry.js} +1 -1
  18. package/dist/baloise-design-system/p-3bbf43bb.system.js +1 -1
  19. package/dist/baloise-design-system/{p-6d2ec8ebe2.entry.js → p-3cbedb7095.entry.js} +1 -1
  20. package/dist/baloise-design-system/{p-c4e72f03b6.entry.js → p-498c4c367f.entry.js} +1 -1
  21. package/dist/baloise-design-system/{p-bbbdcecbf1.entry.js → p-4d2a2835fb.entry.js} +1 -1
  22. package/dist/baloise-design-system/{p-e25cb222.system.js → p-570c55db.system.js} +1 -1
  23. package/dist/baloise-design-system/{p-7e9c4ea5.system.js → p-6739ff7b.system.js} +1 -1
  24. package/dist/baloise-design-system/{p-7e7914cef9.system.entry.js → p-692fc8a1a5.system.entry.js} +1 -1
  25. package/dist/baloise-design-system/{p-b15787483a.system.entry.js → p-6ab49f48e4.system.entry.js} +1 -1
  26. package/dist/baloise-design-system/{p-f7e8334c.js → p-713a79a0.js} +1 -1
  27. package/dist/baloise-design-system/{p-351222e9ab.entry.js → p-75e56c3ce2.entry.js} +1 -1
  28. package/dist/baloise-design-system/{p-12549dfd4a.system.entry.js → p-7ca1bb7be4.system.entry.js} +1 -1
  29. package/dist/baloise-design-system/{p-b84164cbb8.system.entry.js → p-81a898eea1.system.entry.js} +1 -1
  30. package/dist/baloise-design-system/{p-21bd46390f.system.entry.js → p-830fe61c9c.system.entry.js} +1 -1
  31. package/dist/baloise-design-system/p-87067c24.js +1 -0
  32. package/dist/baloise-design-system/{p-8e1e0e6e4c.entry.js → p-8c847628d9.entry.js} +1 -1
  33. package/dist/baloise-design-system/{p-872d971278.entry.js → p-8edb3e2c33.entry.js} +1 -1
  34. package/dist/baloise-design-system/{p-081fd71e3f.entry.js → p-92c5a140ef.entry.js} +1 -1
  35. package/dist/baloise-design-system/{p-6298a4ebf1.system.entry.js → p-9a302dc8b8.system.entry.js} +1 -1
  36. package/dist/baloise-design-system/p-9d114fae.js +1 -0
  37. package/dist/baloise-design-system/p-9e4fcb76.js +1 -1
  38. package/dist/baloise-design-system/{p-187705414a.system.entry.js → p-ac569b8047.system.entry.js} +1 -1
  39. package/dist/baloise-design-system/{p-6e89f9b120.system.entry.js → p-ae38c0ad39.system.entry.js} +1 -1
  40. package/dist/baloise-design-system/p-b0870e2498.system.entry.js +1 -0
  41. package/dist/baloise-design-system/{p-19bf439d.system.js → p-b6ce3268.system.js} +1 -1
  42. package/dist/baloise-design-system/{p-592e011b7f.entry.js → p-d69d43a6a5.entry.js} +1 -1
  43. package/dist/baloise-design-system/{p-17361f100a.entry.js → p-da6c2d0da2.entry.js} +1 -1
  44. package/dist/baloise-design-system/{p-813971fb7e.system.entry.js → p-e24159ca9c.system.entry.js} +1 -1
  45. package/dist/baloise-design-system/{p-97bc4e0838.system.entry.js → p-e7bf5f3a74.system.entry.js} +1 -1
  46. package/dist/baloise-design-system/p-e960037ef1.entry.js +1 -0
  47. package/dist/baloise-design-system/{p-34a9557f.system.js → p-f15be367.system.js} +1 -1
  48. package/dist/baloise-design-system/p-f65bed6d08.entry.js +1 -0
  49. package/dist/baloise-design-system/p-f8c2d916.system.js +1 -0
  50. package/dist/baloise-design-system/p-fa8f56c6.system.js +1 -0
  51. package/dist/cjs/app-globals-1a8f18e4.js +7 -0
  52. package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
  53. package/dist/cjs/bal-datepicker.cjs.entry.js +3 -3
  54. package/dist/cjs/bal-doc-app.cjs.entry.js +231 -0
  55. package/dist/cjs/bal-hint_3.cjs.entry.js +3 -3
  56. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  57. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  58. package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
  59. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  60. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  61. package/dist/cjs/bal-popover_2.cjs.entry.js +3 -3
  62. package/dist/cjs/bal-progress-bar.cjs.entry.js +3 -3
  63. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  64. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  65. package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
  66. package/dist/cjs/baloise-design-system.cjs.js +3 -2
  67. package/dist/cjs/{breakpoints.decorator-a517de69.js → breakpoints.decorator-34f12060.js} +1 -1
  68. package/dist/cjs/{breakpoints.subject-fcfd9910.js → breakpoints.subject-87d59d97.js} +1 -1
  69. package/dist/cjs/{app-globals-d6bc7866.js → global-6ea60588.js} +2 -4
  70. package/dist/cjs/index.cjs.js +2 -2
  71. package/dist/cjs/initialize-e38e7028.js +1 -1
  72. package/dist/cjs/loader.cjs.js +3 -2
  73. package/dist/cjs/{tokens.esm-89b80d73.js → tokens.esm-8b361811.js} +1 -1
  74. package/dist/collection/collection-manifest.json +2 -1
  75. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +1 -0
  76. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +229 -0
  77. package/dist/collection/utils/constants/version.constant.js +1 -1
  78. package/dist/esm/app-globals-e3e23c19.js +5 -0
  79. package/dist/esm/bal-carousel_2.entry.js +3 -3
  80. package/dist/esm/bal-datepicker.entry.js +3 -3
  81. package/dist/esm/bal-doc-app.entry.js +227 -0
  82. package/dist/esm/bal-hint_3.entry.js +3 -3
  83. package/dist/esm/bal-list_8.entry.js +3 -3
  84. package/dist/esm/bal-logo.entry.js +3 -3
  85. package/dist/esm/bal-nav_8.entry.js +3 -3
  86. package/dist/esm/bal-navbar_5.entry.js +3 -3
  87. package/dist/esm/bal-pagination.entry.js +3 -3
  88. package/dist/esm/bal-popover_2.entry.js +3 -3
  89. package/dist/esm/bal-progress-bar.entry.js +3 -3
  90. package/dist/esm/bal-shape.entry.js +1 -1
  91. package/dist/esm/bal-steps.entry.js +3 -3
  92. package/dist/esm/bal-tab-item_2.entry.js +3 -3
  93. package/dist/esm/baloise-design-system.js +3 -2
  94. package/dist/esm/{breakpoints.decorator-d8936dd5.js → breakpoints.decorator-f0e76fe2.js} +1 -1
  95. package/dist/esm/{breakpoints.subject-21e4b507.js → breakpoints.subject-69749ec7.js} +1 -1
  96. package/dist/esm/{app-globals-89691d80.js → global-d54e7c09.js} +2 -4
  97. package/dist/esm/index.js +3 -3
  98. package/dist/esm/initialize-66615dde.js +1 -1
  99. package/dist/esm/loader.js +3 -2
  100. package/dist/esm/{tokens.esm-1f222e3a.js → tokens.esm-cfb85b72.js} +1 -1
  101. package/dist/esm-es5/app-globals-e3e23c19.js +1 -0
  102. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  103. package/dist/esm-es5/bal-datepicker.entry.js +1 -1
  104. package/dist/esm-es5/bal-doc-app.entry.js +1 -0
  105. package/dist/esm-es5/bal-hint_3.entry.js +1 -1
  106. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  107. package/dist/esm-es5/bal-logo.entry.js +1 -1
  108. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  109. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  110. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  111. package/dist/esm-es5/bal-popover_2.entry.js +1 -1
  112. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  113. package/dist/esm-es5/bal-shape.entry.js +1 -1
  114. package/dist/esm-es5/bal-steps.entry.js +1 -1
  115. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  116. package/dist/esm-es5/baloise-design-system.js +1 -1
  117. package/dist/esm-es5/{breakpoints.decorator-d8936dd5.js → breakpoints.decorator-f0e76fe2.js} +1 -1
  118. package/dist/esm-es5/{breakpoints.subject-21e4b507.js → breakpoints.subject-69749ec7.js} +1 -1
  119. package/dist/esm-es5/global-d54e7c09.js +1 -0
  120. package/dist/esm-es5/index.js +1 -1
  121. package/dist/esm-es5/initialize-66615dde.js +1 -1
  122. package/dist/esm-es5/loader.js +1 -1
  123. package/dist/types/components/bal-accordion/bal-accordion.interfaces.d.ts +1 -1
  124. package/dist/types/components/bal-app/bal-app.interfaces.d.ts +1 -1
  125. package/dist/types/components/bal-badge/bal-badge.interfaces.d.ts +1 -1
  126. package/dist/types/components/bal-button/bal-button.interfaces.d.ts +1 -1
  127. package/dist/types/components/bal-card/bal-card.interfaces.d.ts +1 -1
  128. package/dist/types/components/bal-carousel/bal-carousel.interfaces.d.ts +1 -1
  129. package/dist/types/components/bal-checkbox/bal-checkbox.interfaces.d.ts +1 -1
  130. package/dist/types/components/bal-close/bal-close.interfaces.d.ts +1 -1
  131. package/dist/types/components/bal-content/bal-content.interfaces.d.ts +1 -1
  132. package/dist/types/components/bal-data/bal-data.interfaces.d.ts +1 -1
  133. package/dist/types/components/bal-date/bal-date-calendar/bal-date-calendar.interfaces.d.ts +1 -1
  134. package/dist/types/components/bal-date/bal-date.interfaces.d.ts +1 -1
  135. package/dist/types/components/bal-datepicker/bal-datepicker.interfaces.d.ts +1 -1
  136. package/dist/types/components/bal-divider/bal-divider.interfaces.d.ts +1 -1
  137. package/dist/types/components/bal-field/bal-field.interfaces.d.ts +1 -1
  138. package/dist/types/components/bal-file-upload/bal-file-upload.interfaces.d.ts +1 -1
  139. package/dist/types/components/bal-form-grid/bal-form-gird.interfaces.d.ts +1 -1
  140. package/dist/types/components/bal-heading/bal-heading.interfaces.d.ts +1 -1
  141. package/dist/types/components/bal-icon/bal-icon.interfaces.d.ts +1 -1
  142. package/dist/types/components/bal-input/bal-input.interfaces.d.ts +1 -1
  143. package/dist/types/components/bal-input-slider/bal-input-slider.interfaces.d.ts +1 -1
  144. package/dist/types/components/bal-input-stepper/bal-input-stepper.interfaces.d.ts +1 -1
  145. package/dist/types/components/bal-label/bal-label.interfaces.d.ts +1 -1
  146. package/dist/types/components/bal-list/bal-list.interfaces.d.ts +1 -1
  147. package/dist/types/components/bal-logo/bal-logo.interfaces.d.ts +1 -1
  148. package/dist/types/components/bal-modal/bal-modal.interfaces.d.ts +1 -1
  149. package/dist/types/components/bal-nav/bal-nav-link/bal-nav-link.interfaces.d.ts +1 -1
  150. package/dist/types/components/bal-nav/bal-nav-link-grid-col/bal-nav-link-grid-col.interfaces.d.ts +1 -1
  151. package/dist/types/components/bal-nav/bal-nav-link-group/bal-nav-link-group.interfaces.d.ts +1 -1
  152. package/dist/types/components/bal-nav/bal-nav-menu-bar/bal-nav-menu-bar.interfaces.d.ts +1 -1
  153. package/dist/types/components/bal-nav/bal-nav-menu-flyout/bal-nav-menu-flyout.interfaces.d.ts +1 -1
  154. package/dist/types/components/bal-nav/bal-nav-meta-bar/bal-nav-meta-bar.interfaces.d.ts +1 -1
  155. package/dist/types/components/bal-nav/bal-nav.interfaces.d.ts +1 -1
  156. package/dist/types/components/bal-navbar/bal-navbar.interfaces.d.ts +1 -1
  157. package/dist/types/components/bal-notification/bal-notification.interfaces.d.ts +1 -1
  158. package/dist/types/components/bal-number-input/bal-number-input.interfaces.d.ts +1 -1
  159. package/dist/types/components/bal-pagination/bal-pagination.interfaces.d.ts +1 -1
  160. package/dist/types/components/bal-popover/bal-popover.interfaces.d.ts +1 -1
  161. package/dist/types/components/bal-popup/bal-popup.interfaces.d.ts +1 -1
  162. package/dist/types/components/bal-progress-bar/bal-progress-bar.interfaces.d.ts +1 -1
  163. package/dist/types/components/bal-radio/bal-radio.interfaces.d.ts +1 -1
  164. package/dist/types/components/bal-select/bal-select.interfaces.d.ts +1 -1
  165. package/dist/types/components/bal-shape/bal-shape.interfaces.d.ts +1 -1
  166. package/dist/types/components/bal-sheet/bal-sheet.interfaces.d.ts +1 -1
  167. package/dist/types/components/bal-snackbar/bal-snackbar.interfaces.d.ts +1 -1
  168. package/dist/types/components/bal-stack/bal-stack.interfaces.d.ts +1 -1
  169. package/dist/types/components/bal-stage/bal-stage.interfaces.d.ts +1 -1
  170. package/dist/types/components/bal-steps/bal-steps.interfaces.d.ts +1 -1
  171. package/dist/types/components/bal-tabs/bal-tabs.interfaces.d.ts +1 -1
  172. package/dist/types/components/bal-tag/bal-tag.interfaces.d.ts +1 -1
  173. package/dist/types/components/bal-text/bal-text.interfaces.d.ts +1 -1
  174. package/dist/types/components/bal-textarea/bal-textarea.interfaces.d.ts +1 -1
  175. package/dist/types/components/bal-time-input/bal-time-input.interfaces.d.ts +1 -1
  176. package/dist/types/components/bal-toast/bal-toast.interfaces.d.ts +1 -1
  177. package/dist/types/components/bal-tooltip/bal-tooltip.interfaces.d.ts +1 -1
  178. package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +21 -0
  179. package/dist/types/components.d.ts +37 -0
  180. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +81 -0
  181. package/package.json +7 -7
  182. package/dist/baloise-design-system/p-34d1472a.system.js +0 -1
  183. package/dist/baloise-design-system/p-48a2de5d.js +0 -1
  184. package/dist/baloise-design-system/p-eb75a8ca4a.entry.js +0 -1
  185. package/dist/esm-es5/app-globals-89691d80.js +0 -1
  186. /package/dist/baloise-design-system/{p-14fe1d13.js → p-3e209839.js} +0 -0
  187. /package/dist/baloise-design-system/{p-b99e6c11.system.js → p-79084b4f.system.js} +0 -0
  188. /package/dist/esm-es5/{tokens.esm-1f222e3a.js → tokens.esm-cfb85b72.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';
@@ -7,169 +6,26 @@ export { i as i18nBalDatepicker } from './bal-datepicker.i18n.js';
7
6
  export { i as i18nBalTimeInput } from './bal-time-input.i18n.js';
8
7
  export { i as i18nBalInputStepper } from './bal-input-stepper.i18n.js';
9
8
  export { i as i18nBalLabel } from './bal-label.i18n.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';
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';
14
10
  export { n as newBalStepOption } from './bal-step.util.js';
15
11
  export { n as newBalTabOption } from './bal-tab.util.js';
16
12
  import { g as getAppRoot, c as componentOnReady } from './helpers.js';
17
13
  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';
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
  import { g as getOverlays, a as getOverlay } from './overlays.js';
23
21
  import { B as BalWindowResizeListener, b as balBreakpoints } from './breakpoints.subject.js';
24
22
  export { c as BalBreakpointSubject, d as BalBreakpointsUtil, a as balBreakpointSubject, b as balBreakpoints } from './breakpoints.subject.js';
25
23
  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';
26
25
  import { S as Subject } from './listener.js';
27
26
  export { B as BalSwipeSubject } from './swipe.subject.js';
28
27
  export { B as BalDate } from './date.js';
29
28
 
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
-
173
29
  const i18nBalFieldLabel = {
174
30
  de: {
175
31
  optional: ' (optional)',
@@ -203,139 +59,6 @@ const i18nBalFieldLabel = {
203
59
  },
204
60
  };
205
61
 
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
-
339
62
  const newBalCheckboxOption = (option) => {
340
63
  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 });
341
64
  };
@@ -453,4 +176,4 @@ const isPlatform = (winOrPlatform, platform) => {
453
176
  const NewBalOptionValue = newBalOptionValue;
454
177
  const NewBalSingleOptionValue = newBalSingleOptionValue;
455
178
 
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 };
179
+ export { BalModalController, BalOrientationSubject, NewBalOptionValue, NewBalSingleOptionValue, balModalController, balOrientationSubject, getPlatforms, hasTouchSupport, i18nBalFieldLabel, isBrowser, isPlatform, newBalCheckboxOption, newBalOptionValue, newBalRadioOption, newBalSingleOptionValue };
@@ -0,0 +1,281 @@
1
+ import { setPlatformHelpers } from '@stencil/core/internal/client';
2
+ import { b as balBrowser } from './browser.js';
3
+ import { d as defaultConfig } from './config.default.js';
4
+
5
+ const BALOISE_SESSION_KEY = 'baloise-persist-config';
6
+
7
+ class Config {
8
+ constructor() {
9
+ this._componentObservers = [];
10
+ this._observers = [];
11
+ this._config = defaultConfig;
12
+ }
13
+ get locale() {
14
+ return `${this._config.language}-${this._config.region}`;
15
+ }
16
+ get region() {
17
+ return this._config.region;
18
+ }
19
+ set region(region) {
20
+ if (region !== this._config.region) {
21
+ this._config.region = region;
22
+ this._notify();
23
+ }
24
+ }
25
+ get language() {
26
+ return this._config.language;
27
+ }
28
+ set language(language) {
29
+ if (language !== this._config.language) {
30
+ if (this._config.allowedLanguages.includes(language)) {
31
+ this._config.language = language;
32
+ }
33
+ else {
34
+ this._config.language = this._config.fallbackLanguage;
35
+ }
36
+ this._notify();
37
+ }
38
+ }
39
+ get allowedLanguages() {
40
+ return this._config.allowedLanguages;
41
+ }
42
+ set allowedLanguages(allowedLanguages) {
43
+ if (allowedLanguages !== this._config.allowedLanguages) {
44
+ this._config.allowedLanguages = allowedLanguages;
45
+ this._notify();
46
+ }
47
+ }
48
+ get icons() {
49
+ return this._config.icons;
50
+ }
51
+ set icons(icons) {
52
+ this._config.icons = Object.assign(Object.assign({}, this._config.icons), icons);
53
+ this._notify();
54
+ }
55
+ get logger() {
56
+ return this._config.logger;
57
+ }
58
+ set logger(logger) {
59
+ this._config.logger = Object.assign({}, logger);
60
+ this._notify();
61
+ }
62
+ get animated() {
63
+ return this._config.animated;
64
+ }
65
+ set animated(animated) {
66
+ this._config.animated = animated;
67
+ this._notify();
68
+ }
69
+ attach(observer) {
70
+ const isExist = this._observers.includes(observer);
71
+ if (isExist) {
72
+ return console.log('Subject: Observer has been attached already.');
73
+ }
74
+ this._observers.push(observer);
75
+ observer.configChanged(this._config);
76
+ }
77
+ detach(observer) {
78
+ const observerIndex = this._observers.indexOf(observer);
79
+ if (observerIndex === -1) {
80
+ return console.log('Subject: Nonexistent observer.');
81
+ }
82
+ this._observers.splice(observerIndex, 1);
83
+ }
84
+ attachComponent(observer) {
85
+ const isExist = this._componentObservers.includes(observer);
86
+ if (isExist) {
87
+ return console.log('Subject: Observer has been attached already.');
88
+ }
89
+ this._componentObservers.push(observer);
90
+ observer.configChanged(this._config);
91
+ }
92
+ detachComponent(observer) {
93
+ const observerIndex = this._componentObservers.indexOf(observer);
94
+ if (observerIndex === -1) {
95
+ return console.log('Subject: Nonexistent observer.');
96
+ }
97
+ this._componentObservers.splice(observerIndex, 1);
98
+ }
99
+ toString() {
100
+ return JSON.stringify(this._config);
101
+ }
102
+ reset(config) {
103
+ this._config = Object.assign(Object.assign(Object.assign({}, this._config), config), { icons: Object.assign(Object.assign({}, this._config.icons), config.icons) });
104
+ this._notify(false);
105
+ }
106
+ _notify(all = true) {
107
+ for (const observer of this._componentObservers) {
108
+ observer.configChanged(this._config);
109
+ }
110
+ if (all) {
111
+ for (const observer of this._observers) {
112
+ observer.configChanged(this._config);
113
+ }
114
+ }
115
+ if (balBrowser.hasWindow) {
116
+ saveConfig(window, this._config);
117
+ }
118
+ }
119
+ }
120
+ const config = /*@__PURE__*/ new Config();
121
+ const configFromSession = (win) => {
122
+ try {
123
+ const configStr = win.sessionStorage.getItem(BALOISE_SESSION_KEY);
124
+ return configStr !== null ? JSON.parse(configStr) : {};
125
+ }
126
+ catch (e) {
127
+ return {};
128
+ }
129
+ };
130
+ const saveConfig = (win, c) => {
131
+ try {
132
+ win.sessionStorage.setItem(BALOISE_SESSION_KEY, JSON.stringify(c));
133
+ }
134
+ catch (e) {
135
+ return;
136
+ }
137
+ };
138
+
139
+ const setupConfig = (userConfig = {}, win = {}) => {
140
+ if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
141
+ win = window;
142
+ }
143
+ win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
144
+ config.reset(Object.assign(Object.assign(Object.assign({}, configFromSession(win)), userConfig), { icons: Object.assign(Object.assign({}, configFromSession(win).icons), userConfig.icons) }));
145
+ win.BaloiseDesignSystem.config = config;
146
+ };
147
+
148
+ class BalNoticeController {
149
+ constructor(options) {
150
+ this.options = options;
151
+ this.container = null;
152
+ this.queue = [];
153
+ this.preQueue = [];
154
+ this.queueLimit = 5;
155
+ }
156
+ create(options) {
157
+ if (balBrowser.hasDocument) {
158
+ this.setupContainer();
159
+ const clone = this.findClone(options);
160
+ if (clone === undefined) {
161
+ const el = document.createElement(this.options.tag);
162
+ Object.assign(el, options);
163
+ el.addEventListener('balClose', ev => {
164
+ this.removeFromQueue(ev.detail);
165
+ });
166
+ this.preQueue.push(el);
167
+ this.updateQueue();
168
+ return el;
169
+ }
170
+ return clone;
171
+ }
172
+ }
173
+ setQueue(queueLimit) {
174
+ this.queueLimit = queueLimit;
175
+ }
176
+ async dismissAll() {
177
+ var _a;
178
+ const elements = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.options.tag);
179
+ if (elements) {
180
+ const closingQueue = [];
181
+ for (let index = 0; index < elements.length; index++) {
182
+ const el = elements[index];
183
+ if (el.close) {
184
+ closingQueue.push(el.close());
185
+ }
186
+ }
187
+ await Promise.all(closingQueue);
188
+ }
189
+ }
190
+ /**
191
+ * @deprecated use dismissAll instead
192
+ */
193
+ async clearAll() {
194
+ console.warn('[DEPRECATED] - use dismissAll() instead');
195
+ return this.dismissAll();
196
+ }
197
+ findClone(options) {
198
+ for (let index = 0; index < this.queue.length; index++) {
199
+ const el = this.queue[index];
200
+ if (el.message === options.message && el.color === options.color) {
201
+ return el;
202
+ }
203
+ }
204
+ return undefined;
205
+ }
206
+ setupContainer() {
207
+ if (balBrowser.hasDocument) {
208
+ const containerId = `${this.options.tag}-container`;
209
+ this.container = document.getElementById(containerId);
210
+ if (this.container)
211
+ return;
212
+ if (!this.container) {
213
+ this.container = document.createElement('bal-notices');
214
+ this.container.setAttribute('interface', this.options.tag.replace('bal-', ''));
215
+ this.container.id = containerId;
216
+ }
217
+ document.body.appendChild(this.container);
218
+ }
219
+ }
220
+ updateQueue() {
221
+ var _a;
222
+ if (this.queue.length < this.queueLimit) {
223
+ const el = this.preQueue.shift();
224
+ if (el && this.container) {
225
+ this.queue.push(el);
226
+ this.container.insertAdjacentElement('beforeend', el);
227
+ }
228
+ }
229
+ if (this.queue.length === 0) {
230
+ (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
231
+ }
232
+ }
233
+ removeFromQueue(toastId) {
234
+ this.queue = this.queue.filter(el => el.id !== toastId);
235
+ setTimeout(() => this.updateQueue(), 0);
236
+ }
237
+ }
238
+
239
+ class BalToastController extends BalNoticeController {
240
+ constructor() {
241
+ super({
242
+ tag: 'bal-toast',
243
+ });
244
+ }
245
+ create(options) {
246
+ return super.create(options);
247
+ }
248
+ }
249
+ const balToastController = new BalToastController();
250
+
251
+ class BalSnackbarController extends BalNoticeController {
252
+ constructor() {
253
+ super({
254
+ tag: 'bal-snackbar',
255
+ });
256
+ }
257
+ create(options) {
258
+ return super.create(options);
259
+ }
260
+ }
261
+ const balSnackbarController = new BalSnackbarController();
262
+
263
+ // generated by .build/version.js
264
+ const VERSION = 'BAL_DEV_VERSION';
265
+
266
+ const initializeBaloiseDesignSystem = (userConfig = {}, platformConfig = undefined, win = {}) => {
267
+ if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
268
+ win = window;
269
+ }
270
+ win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
271
+ if (platformConfig) {
272
+ setPlatformHelpers(platformConfig);
273
+ }
274
+ setupConfig(Object.assign(Object.assign({}, userConfig), platformConfig), win);
275
+ win.BaloiseDesignSystem.toastController = balToastController;
276
+ win.BaloiseDesignSystem.snackbarController = balSnackbarController;
277
+ win.BaloiseDesignSystem.initialize = () => setupConfig(win.BaloiseDesignSystem.config, win);
278
+ win.BaloiseDesignSystem.version = VERSION;
279
+ };
280
+
281
+ 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 Mon, 11 Mar 2024 15:36:17 GMT
3
+ * Generated on Fri, 15 Mar 2024 06:10:25 GMT
4
4
  */
5
5
  const balColorGreen3 = "#94e3d4";
6
6
  const balColorGreen6 = "#1b5951";