@baloise/ds-core 19.0.0 → 19.0.1-nightly.20250522

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 (145) 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-radio2.js +4 -9
  8. package/components/index.js +7 -314
  9. package/components/initialize.js +312 -0
  10. package/components/tokens.esm.js +1 -1
  11. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  12. package/dist/baloise-design-system/baloise-design-system.js +1 -1
  13. package/dist/baloise-design-system/index.esm.js +1 -1
  14. package/dist/baloise-design-system/{p-a0ceb5a8a2.entry.js → p-101f604927.entry.js} +1 -1
  15. package/dist/baloise-design-system/{p-4df06d49.js → p-1489d376.js} +1 -1
  16. package/dist/baloise-design-system/p-1e142b10.system.js +1 -0
  17. package/dist/baloise-design-system/p-294f38c2.js +1 -0
  18. package/dist/baloise-design-system/{p-cfaccfd8.system.js → p-2ac3db96.system.js} +1 -1
  19. package/dist/baloise-design-system/p-343cc097d4.entry.js +1 -0
  20. package/dist/baloise-design-system/p-3913c6ae.js +1 -1
  21. package/dist/baloise-design-system/{p-d437928a50.entry.js → p-3ff72aeca1.entry.js} +1 -1
  22. package/dist/baloise-design-system/p-42e66219.system.js +1 -0
  23. package/dist/baloise-design-system/{p-dd00693b70.system.entry.js → p-442095b4cc.system.entry.js} +1 -1
  24. package/dist/baloise-design-system/p-47f0669a.js +1 -0
  25. package/dist/baloise-design-system/{p-04c1fb80ff.entry.js → p-4ad0c944ea.entry.js} +1 -1
  26. package/dist/baloise-design-system/{p-90cf8c5923.system.entry.js → p-54874074a1.system.entry.js} +1 -1
  27. package/dist/baloise-design-system/{p-f01b9ff6e3.entry.js → p-557bc62756.entry.js} +1 -1
  28. package/dist/baloise-design-system/{p-aaf8e75923.system.entry.js → p-595daca6e1.system.entry.js} +1 -1
  29. package/dist/baloise-design-system/{p-bc995202b6.system.entry.js → p-5af11eb573.system.entry.js} +1 -1
  30. package/dist/baloise-design-system/{p-37bb1a7c35.entry.js → p-5b48976ad5.entry.js} +1 -1
  31. package/dist/baloise-design-system/{p-bd9e2680c9.system.entry.js → p-60e136aece.system.entry.js} +1 -1
  32. package/dist/baloise-design-system/p-659ecadc.system.js +1 -1
  33. package/dist/baloise-design-system/{p-549e75a581.entry.js → p-77acf251a0.entry.js} +1 -1
  34. package/dist/baloise-design-system/{p-3367374aa9.entry.js → p-7f49324406.entry.js} +1 -1
  35. package/dist/baloise-design-system/{p-456114b8.system.js → p-83512f21.system.js} +1 -1
  36. package/dist/baloise-design-system/{p-f3b225055a.entry.js → p-85893f1b62.entry.js} +1 -1
  37. package/dist/baloise-design-system/{p-8bec751e53.system.entry.js → p-859c0fae39.system.entry.js} +1 -1
  38. package/dist/baloise-design-system/{p-5f491e68.js → p-884bb202.js} +1 -1
  39. package/dist/baloise-design-system/{p-60f65048.system.js → p-947e8934.system.js} +1 -1
  40. package/dist/baloise-design-system/p-96301206d3.system.entry.js +1 -0
  41. package/dist/baloise-design-system/{p-4f624353cc.system.entry.js → p-96ad85aa92.system.entry.js} +1 -1
  42. package/dist/baloise-design-system/p-98b6f8ba43.entry.js +1 -0
  43. package/dist/baloise-design-system/{p-b33e238cc7.entry.js → p-9a85c3c641.entry.js} +1 -1
  44. package/dist/baloise-design-system/{p-9268ca5c36.system.entry.js → p-a0bd202d89.system.entry.js} +1 -1
  45. package/dist/baloise-design-system/{p-1311bf56.system.js → p-a217eac8.system.js} +1 -1
  46. package/dist/baloise-design-system/p-a313b21a.js +1 -0
  47. package/dist/baloise-design-system/{p-08a2787135.system.entry.js → p-a4c0bbcbee.system.entry.js} +1 -1
  48. package/dist/baloise-design-system/{p-a20202e006.entry.js → p-a58a8bb12e.entry.js} +1 -1
  49. package/dist/baloise-design-system/{p-cd952ba8.system.js → p-a69b182a.system.js} +1 -1
  50. package/dist/baloise-design-system/{p-a9d53341fa.entry.js → p-d1c51d5a4b.entry.js} +1 -1
  51. package/dist/baloise-design-system/p-d346ada012.entry.js +1 -0
  52. package/dist/baloise-design-system/{p-40602ad82c.system.entry.js → p-da11f3c004.system.entry.js} +1 -1
  53. package/dist/baloise-design-system/{p-0a2fcb50fc.system.entry.js → p-def1370e07.system.entry.js} +1 -1
  54. package/dist/baloise-design-system/{p-e0cdb8d89a.system.entry.js → p-e9a2815a3d.system.entry.js} +1 -1
  55. package/dist/baloise-design-system/{p-9497921a41.system.entry.js → p-f1fda56221.system.entry.js} +1 -1
  56. package/dist/cjs/app-globals-f63c33e7.js +7 -0
  57. package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
  58. package/dist/cjs/bal-doc-app.cjs.entry.js +233 -0
  59. package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
  60. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  61. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  62. package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
  63. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  64. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  65. package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
  66. package/dist/cjs/bal-radio_2.cjs.entry.js +4 -9
  67. package/dist/cjs/bal-segment_2.cjs.entry.js +4 -4
  68. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  69. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  70. package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
  71. package/dist/cjs/baloise-design-system.cjs.js +3 -2
  72. package/dist/cjs/{breakpoints.decorator-a0d98eb1.js → breakpoints.decorator-a540c98d.js} +1 -1
  73. package/dist/cjs/{breakpoints.subject-2e8183a1.js → breakpoints.subject-c33000fa.js} +1 -1
  74. package/dist/cjs/{app-globals-0d8db19e.js → global-2a76769b.js} +2 -4
  75. package/dist/cjs/index.cjs.js +2 -2
  76. package/dist/cjs/initialize-2e8978a4.js +1 -1
  77. package/dist/cjs/loader.cjs.js +3 -2
  78. package/dist/cjs/{tokens.esm-5a23f0d1.js → tokens.esm-73be97cc.js} +1 -1
  79. package/dist/cjs/{window-resize.decorator-775d0c7b.js → window-resize.decorator-f96785a0.js} +1 -1
  80. package/dist/collection/collection-manifest.json +2 -1
  81. package/dist/collection/components/bal-radio/bal-radio.js +4 -9
  82. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +1 -0
  83. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +247 -0
  84. package/dist/collection/utils/constants/version.constant.js +1 -1
  85. package/dist/esm/app-globals-1ecf000f.js +5 -0
  86. package/dist/esm/bal-carousel_2.entry.js +3 -3
  87. package/dist/esm/bal-doc-app.entry.js +229 -0
  88. package/dist/esm/bal-hint_5.entry.js +3 -3
  89. package/dist/esm/bal-list_8.entry.js +3 -3
  90. package/dist/esm/bal-logo.entry.js +3 -3
  91. package/dist/esm/bal-nav_8.entry.js +3 -3
  92. package/dist/esm/bal-navbar_5.entry.js +3 -3
  93. package/dist/esm/bal-pagination.entry.js +3 -3
  94. package/dist/esm/bal-progress-bar.entry.js +4 -4
  95. package/dist/esm/bal-radio_2.entry.js +4 -9
  96. package/dist/esm/bal-segment_2.entry.js +4 -4
  97. package/dist/esm/bal-shape.entry.js +1 -1
  98. package/dist/esm/bal-steps.entry.js +3 -3
  99. package/dist/esm/bal-tab-item_2.entry.js +3 -3
  100. package/dist/esm/baloise-design-system.js +3 -2
  101. package/dist/esm/{breakpoints.decorator-e856b7fc.js → breakpoints.decorator-4463fbd8.js} +1 -1
  102. package/dist/esm/{breakpoints.subject-041ea43a.js → breakpoints.subject-c600f054.js} +1 -1
  103. package/dist/esm/{app-globals-5dd5fe6b.js → global-6e86728b.js} +2 -4
  104. package/dist/esm/index.js +3 -3
  105. package/dist/esm/initialize-be160cc4.js +1 -1
  106. package/dist/esm/loader.js +3 -2
  107. package/dist/esm/{tokens.esm-98e219ab.js → tokens.esm-9c43cd0c.js} +1 -1
  108. package/dist/esm/{window-resize.decorator-6aadb2e7.js → window-resize.decorator-d4712090.js} +1 -1
  109. package/dist/esm-es5/app-globals-1ecf000f.js +1 -0
  110. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  111. package/dist/esm-es5/bal-doc-app.entry.js +1 -0
  112. package/dist/esm-es5/bal-hint_5.entry.js +1 -1
  113. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  114. package/dist/esm-es5/bal-logo.entry.js +1 -1
  115. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  116. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  117. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  118. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  119. package/dist/esm-es5/bal-radio_2.entry.js +1 -1
  120. package/dist/esm-es5/bal-segment_2.entry.js +1 -1
  121. package/dist/esm-es5/bal-shape.entry.js +1 -1
  122. package/dist/esm-es5/bal-steps.entry.js +1 -1
  123. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  124. package/dist/esm-es5/baloise-design-system.js +1 -1
  125. package/dist/esm-es5/breakpoints.decorator-4463fbd8.js +1 -0
  126. package/dist/esm-es5/{breakpoints.subject-041ea43a.js → breakpoints.subject-c600f054.js} +1 -1
  127. package/dist/esm-es5/global-6e86728b.js +1 -0
  128. package/dist/esm-es5/index.js +1 -1
  129. package/dist/esm-es5/initialize-be160cc4.js +1 -1
  130. package/dist/esm-es5/loader.js +1 -1
  131. package/dist/esm-es5/{window-resize.decorator-6aadb2e7.js → window-resize.decorator-d4712090.js} +1 -1
  132. package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +21 -0
  133. package/dist/types/components.d.ts +37 -0
  134. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +82 -0
  135. package/package.json +6 -6
  136. package/dist/baloise-design-system/p-002d7bb9.js +0 -1
  137. package/dist/baloise-design-system/p-01d1565bf3.entry.js +0 -1
  138. package/dist/baloise-design-system/p-27092a76.js +0 -1
  139. package/dist/baloise-design-system/p-345aa92d.system.js +0 -1
  140. package/dist/baloise-design-system/p-98b5f42b47.entry.js +0 -1
  141. package/dist/esm-es5/app-globals-5dd5fe6b.js +0 -1
  142. package/dist/esm-es5/breakpoints.decorator-e856b7fc.js +0 -1
  143. /package/dist/baloise-design-system/{p-7ab40a51.system.js → p-256ca93a.system.js} +0 -0
  144. /package/dist/baloise-design-system/{p-874385ab.js → p-2fc6c28c.js} +0 -0
  145. /package/dist/esm-es5/{tokens.esm-98e219ab.js → tokens.esm-9c43cd0c.js} +0 -0
@@ -40,7 +40,8 @@ const Radio = /*@__PURE__*/ proxyCustomElement(class Radio extends HTMLElement {
40
40
  this.toggleChecked = (ev) => {
41
41
  ev.preventDefault();
42
42
  this.setFocus();
43
- this.setChecked(!this.checked);
43
+ this.checked = true;
44
+ this.setChecked(this.checked);
44
45
  };
45
46
  this.onClick = (ev) => {
46
47
  if (this.disabled) {
@@ -219,12 +220,6 @@ const Radio = /*@__PURE__*/ proxyCustomElement(class Radio extends HTMLElement {
219
220
  this.checked = newChecked;
220
221
  }
221
222
  }
222
- // if (this.radioButton) {
223
- // this.buttonTabindex = -1
224
- // if (this.radioButton.setChecked) {
225
- // this.radioButton.setChecked(this.checked)
226
- // }
227
- // }
228
223
  }
229
224
  /**
230
225
  * @internal
@@ -294,11 +289,11 @@ const Radio = /*@__PURE__*/ proxyCustomElement(class Radio extends HTMLElement {
294
289
  if (this.labelHidden) {
295
290
  inputAttributes['aria-labelledby'] = labelId;
296
291
  }
297
- return (h(Host, { key: '9c108eed067c8d47d94180715714ed97d7c2df2d', "aria-checked": `${this.checked}`, "aria-disabled": ariaBooleanToString(this.disabled), "aria-invalid": this.invalid === true ? 'true' : 'false', "aria-hidden": this.disabled ? 'true' : null, "aria-focused": focused ? 'true' : null, "aria-labelledby": labelId, "aria-describedby": this.ariaForm.messageId, class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ 'bal-focused': focused }, block.class()), block.modifier('button').class(this.interface === 'button')), block.modifier('tile').class(this.interface === 'tile')), block.modifier(`tile-color-${this.color}`).class(this.interface === 'tile' && !!this.color)), block.modifier('invalid').class(this.invalid)), block.modifier('checked').class(this.checked)), block.modifier('flat').class(this.flat)), block.modifier('disabled').class(this.disabled || this.readonly)), block.modifier('hovered').class(this.hovered)), block.modifier('pressed').class(this.pressed)), block.modifier(`column-${this.colSize}`).class(this.interface === 'tile' && this.colSize > 1)), block
292
+ return (h(Host, { key: '0cb18e6ebb7c792fb484473ec6fa2efbc318f221', "aria-checked": `${this.checked}`, "aria-disabled": ariaBooleanToString(this.disabled), "aria-invalid": this.invalid === true ? 'true' : 'false', "aria-hidden": this.disabled ? 'true' : null, "aria-focused": focused ? 'true' : null, "aria-labelledby": labelId, "aria-describedby": this.ariaForm.messageId, class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ 'bal-focused': focused }, block.class()), block.modifier('button').class(this.interface === 'button')), block.modifier('tile').class(this.interface === 'tile')), block.modifier(`tile-color-${this.color}`).class(this.interface === 'tile' && !!this.color)), block.modifier('invalid').class(this.invalid)), block.modifier('checked').class(this.checked)), block.modifier('flat').class(this.flat)), block.modifier('disabled').class(this.disabled || this.readonly)), block.modifier('hovered').class(this.hovered)), block.modifier('pressed').class(this.pressed)), block.modifier(`column-${this.colSize}`).class(this.interface === 'tile' && this.colSize > 1)), block
298
293
  .modifier(`column-tablet-${this.colSizeTablet}`)
299
294
  .class(this.interface === 'tile' && this.colSizeTablet > 1)), block
300
295
  .modifier(`column-mobile-${this.colSizeMobile}`)
301
- .class(this.interface === 'tile' && this.colSizeMobile > 1)), onClick: this.onClick }, h(LabelTag, { key: '4b3d8626b04257821c3fe1ef713fe9ff9bf0a925', class: Object.assign({}, labelEl.class()), "data-testid": "bal-radio-label" }, hasFormControl ? (h("input", Object.assign({ id: id, type: "radio", "data-testid": "bal-radio-input", name: this.name, value: value, checked: this.checked, required: this.required, disabled: this.disabled || this.nonSubmit, readonly: this.readonly, class: Object.assign({}, inputEl.class()), "aria-hidden": ariaBooleanToString(this.nonSubmit), "aria-invalid": this.invalid === true ? 'true' : 'false', "aria-describedby": this.ariaForm.messageId, onChange: ev => this.toggleChecked(ev), onFocus: ev => this.onFocus(ev), onBlur: ev => this.onBlur(ev), ref: inputEl => (this.nativeInput = inputEl) }, inputAttributes))) : (''), this.interface !== 'tile' ? (h("div", { class: Object.assign({}, labelIconEl.class()) }, h("bal-radio-icon", { checked: this.checked, disabled: this.disabled || this.readonly, invalid: this.invalid, inverted: this.interface === 'button' && this.checked, hovered: this.mergedElementState.hovered, pressed: this.mergedElementState.pressed }))) : (''), h("div", { key: 'de3d15790b976a11a18435e5e7c816f9cc9918c3', class: Object.assign(Object.assign({}, labelTextEl.class()), labelTextEl.modifier('hidden').class(this.labelHidden)) }, h("slot", { key: '0a6ef4b1a0ebbdd01b1367c8965cfedf05b9acec' })))));
296
+ .class(this.interface === 'tile' && this.colSizeMobile > 1)), onClick: this.onClick }, h(LabelTag, { key: 'ef2616849a3b0f2fe95b92fc8ae81df21fd73c47', class: Object.assign({}, labelEl.class()), "data-testid": "bal-radio-label" }, hasFormControl ? (h("input", Object.assign({ id: id, type: "radio", "data-testid": "bal-radio-input", name: this.name, value: value, checked: this.checked, required: this.required, disabled: this.disabled || this.nonSubmit, readonly: this.readonly, class: Object.assign({}, inputEl.class()), "aria-hidden": ariaBooleanToString(this.nonSubmit), "aria-invalid": this.invalid === true ? 'true' : 'false', "aria-describedby": this.ariaForm.messageId, onChange: ev => this.toggleChecked(ev), onFocus: ev => this.onFocus(ev), onBlur: ev => this.onBlur(ev), ref: inputEl => (this.nativeInput = inputEl) }, inputAttributes))) : (''), this.interface !== 'tile' ? (h("div", { class: Object.assign({}, labelIconEl.class()) }, h("bal-radio-icon", { checked: this.checked, disabled: this.disabled || this.readonly, invalid: this.invalid, inverted: this.interface === 'button' && this.checked, hovered: this.mergedElementState.hovered, pressed: this.mergedElementState.pressed }))) : (''), h("div", { key: '609c44dc552fba3ba309166407730a28219616e6', class: Object.assign(Object.assign({}, labelTextEl.class()), labelTextEl.modifier('hidden').class(this.labelHidden)) }, h("slot", { key: '0f200df04d88e458de4400687dfd7b1a2a3e9ac1' })))));
302
297
  }
303
298
  get el() { return this; }
304
299
  static get watchers() { return {
@@ -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 = '19.0.0';
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 };