@baloise/ds-core 16.6.0-nightly.20241022 → 16.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/all.d.ts +0 -2
- package/components/all.js +0 -3
- package/components/bal-app.js +85 -1
- package/components/bal-segment-item.js +6 -0
- package/components/bal-segment.js +6 -3
- package/components/index.js +289 -5
- package/components/tokens.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.js +1 -1
- package/dist/baloise-design-system/index.esm.js +1 -1
- package/dist/baloise-design-system/{p-f959646a.system.js → p-013b4c72.system.js} +1 -1
- package/dist/baloise-design-system/{p-ebc32407d6.system.entry.js → p-05e4a53c65.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1852f9f103.entry.js → p-13e4cb7883.entry.js} +1 -1
- package/dist/baloise-design-system/p-1509eaa7.system.js +1 -1
- package/dist/baloise-design-system/{p-ff6badd1e9.system.entry.js → p-1dab90ea92.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-07c423f22b.entry.js → p-1e76ea305f.entry.js} +1 -1
- package/dist/baloise-design-system/{p-66d132a1c4.system.entry.js → p-26945cccaf.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-444871e4.system.js → p-2df0c70a.system.js} +1 -1
- package/dist/baloise-design-system/{p-d02a88e445.system.entry.js → p-36a339b316.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9f4bdc3515.entry.js → p-37303e3032.entry.js} +1 -1
- package/dist/baloise-design-system/{p-2cb1790e97.entry.js → p-37a5a1a22c.entry.js} +1 -1
- package/dist/baloise-design-system/{p-5ed446bdff.system.entry.js → p-41ffaa3ffc.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-be500bb773.entry.js → p-482c44ab09.entry.js} +1 -1
- package/dist/baloise-design-system/p-54f81c32.js +1 -1
- package/dist/baloise-design-system/p-553751ab25.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-4c21485680.entry.js → p-5e3f3b1087.entry.js} +1 -1
- package/dist/baloise-design-system/{p-506d5151ef.entry.js → p-628615ef50.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d9236c9a02.system.entry.js → p-650f9ba0b9.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9b48ba55c9.entry.js → p-65badcc3ef.entry.js} +1 -1
- package/dist/baloise-design-system/{p-37f45077.js → p-6bd085d5.js} +1 -1
- package/dist/baloise-design-system/{p-f09a9d28ad.entry.js → p-6d582b5344.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e4e6442065.system.entry.js → p-6e9cc6f775.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-5a516842.system.js → p-6ff915ca.system.js} +1 -1
- package/dist/baloise-design-system/{p-9073ed7b4c.system.entry.js → p-75f8958153.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c8adf86086.system.entry.js → p-7bd3277bbb.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c083d372.system.js → p-8d2a7b98.system.js} +1 -1
- package/dist/baloise-design-system/{p-4e59756b4a.system.entry.js → p-a0322563d7.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-bcca1ed3.system.js +1 -0
- package/dist/baloise-design-system/{p-69f61736.js → p-c643ad95.js} +1 -1
- package/dist/baloise-design-system/{p-151fd228.system.js → p-d2cd4498.system.js} +1 -1
- package/dist/baloise-design-system/p-d4deea6ff0.entry.js +1 -0
- package/dist/baloise-design-system/{p-a275c2fa.js → p-d8224577.js} +1 -1
- package/dist/baloise-design-system/p-e1aecdb9f3.entry.js +1 -0
- package/dist/baloise-design-system/{p-bc82aeebe7.entry.js → p-e2f54cc42a.entry.js} +1 -1
- package/dist/baloise-design-system/p-e78a6409.js +1 -0
- package/dist/baloise-design-system/{p-bd174cf0d3.system.entry.js → p-ee94c7f354.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-42e8dcb886.entry.js → p-ee998baab0.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c12f4ea54d.system.entry.js → p-ff07a24a13.system.entry.js} +1 -1
- package/dist/cjs/{global-2562a984.js → app-globals-ae3a8623.js} +4 -2
- package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-datepicker.cjs.entry.js +3 -3
- package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
- package/dist/cjs/bal-logo.cjs.entry.js +3 -3
- package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
- package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
- package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
- package/dist/cjs/bal-segment_2.cjs.entry.js +15 -6
- package/dist/cjs/bal-shape.cjs.entry.js +1 -1
- package/dist/cjs/bal-steps.cjs.entry.js +3 -3
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
- package/dist/cjs/baloise-design-system.cjs.js +2 -3
- package/dist/cjs/{breakpoints.decorator-b7164b21.js → breakpoints.decorator-15205966.js} +1 -1
- package/dist/cjs/{breakpoints.subject-308a3b19.js → breakpoints.subject-2aac9915.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/initialize-2a19d091.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -3
- package/dist/cjs/{tokens.esm-dc8b1d1f.js → tokens.esm-94853847.js} +1 -1
- package/dist/cjs/{window-resize.decorator-9194bd8e.js → window-resize.decorator-4a489114.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/bal-segment/bal-segment-item/bal-segment-item.js +6 -0
- package/dist/collection/components/bal-segment/bal-segment.js +6 -3
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/esm/{global-63f4bcec.js → app-globals-b0dd0fc4.js} +4 -2
- package/dist/esm/bal-carousel_2.entry.js +3 -3
- package/dist/esm/bal-datepicker.entry.js +3 -3
- package/dist/esm/bal-hint_5.entry.js +3 -3
- package/dist/esm/bal-list_8.entry.js +3 -3
- package/dist/esm/bal-logo.entry.js +3 -3
- package/dist/esm/bal-nav_8.entry.js +3 -3
- package/dist/esm/bal-navbar_5.entry.js +3 -3
- package/dist/esm/bal-pagination.entry.js +3 -3
- package/dist/esm/bal-progress-bar.entry.js +4 -4
- package/dist/esm/bal-segment_2.entry.js +16 -7
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-steps.entry.js +3 -3
- package/dist/esm/bal-tab-item_2.entry.js +3 -3
- package/dist/esm/baloise-design-system.js +2 -3
- package/dist/esm/{breakpoints.decorator-daea1bfc.js → breakpoints.decorator-dffbf034.js} +1 -1
- package/dist/esm/{breakpoints.subject-358d526c.js → breakpoints.subject-fd3dc49c.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/initialize-e216cfe4.js +1 -1
- package/dist/esm/loader.js +2 -3
- package/dist/esm/{tokens.esm-a89ffd82.js → tokens.esm-6cd758d9.js} +1 -1
- package/dist/esm/{window-resize.decorator-7bfef946.js → window-resize.decorator-55f8e354.js} +1 -1
- package/dist/esm-es5/app-globals-b0dd0fc4.js +1 -0
- package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
- package/dist/esm-es5/bal-datepicker.entry.js +1 -1
- package/dist/esm-es5/bal-hint_5.entry.js +1 -1
- package/dist/esm-es5/bal-list_8.entry.js +1 -1
- package/dist/esm-es5/bal-logo.entry.js +1 -1
- package/dist/esm-es5/bal-nav_8.entry.js +1 -1
- package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
- package/dist/esm-es5/bal-pagination.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
- package/dist/esm-es5/bal-segment_2.entry.js +1 -1
- package/dist/esm-es5/bal-shape.entry.js +1 -1
- package/dist/esm-es5/bal-steps.entry.js +1 -1
- package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
- package/dist/esm-es5/baloise-design-system.js +1 -1
- package/dist/esm-es5/{breakpoints.decorator-daea1bfc.js → breakpoints.decorator-dffbf034.js} +1 -1
- package/dist/esm-es5/{breakpoints.subject-358d526c.js → breakpoints.subject-fd3dc49c.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/initialize-e216cfe4.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{window-resize.decorator-7bfef946.js → window-resize.decorator-55f8e354.js} +1 -1
- package/dist/types/components/bal-segment/bal-segment-item/bal-segment-item.d.ts +1 -0
- package/dist/types/components.d.ts +0 -37
- package/package.json +7 -7
- package/components/bal-app2.js +0 -87
- package/components/bal-doc-app.d.ts +0 -11
- package/components/bal-doc-app.js +0 -260
- package/components/initialize.js +0 -288
- package/dist/baloise-design-system/p-2743992513.entry.js +0 -1
- package/dist/baloise-design-system/p-360068a4.system.js +0 -1
- package/dist/baloise-design-system/p-4ff656dd48.entry.js +0 -1
- package/dist/baloise-design-system/p-661ab334d8.system.entry.js +0 -1
- package/dist/baloise-design-system/p-6d1b6215.js +0 -1
- package/dist/baloise-design-system/p-7291766c.system.js +0 -1
- package/dist/baloise-design-system/p-7cc52e4a3b.system.entry.js +0 -1
- package/dist/baloise-design-system/p-ac855c8744.entry.js +0 -1
- package/dist/baloise-design-system/p-e8ffddeb.js +0 -1
- package/dist/cjs/app-globals-5fd73c0c.js +0 -7
- package/dist/cjs/bal-doc-app.cjs.entry.js +0 -231
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +0 -1
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +0 -229
- package/dist/esm/app-globals-970bab17.js +0 -5
- package/dist/esm/bal-doc-app.entry.js +0 -227
- package/dist/esm-es5/app-globals-970bab17.js +0 -1
- package/dist/esm-es5/bal-doc-app.entry.js +0 -1
- package/dist/esm-es5/global-63f4bcec.js +0 -1
- package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +0 -21
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +0 -81
- /package/dist/baloise-design-system/{p-d0a1fbde.js → p-a6536532.js} +0 -0
- /package/dist/baloise-design-system/{p-b663dd0f.system.js → p-fa210a21.system.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-a89ffd82.js → tokens.esm-6cd758d9.js} +0 -0
package/components/all.d.ts
CHANGED
|
@@ -28,7 +28,6 @@ import { BalDateCalendar, defineCustomElement as defineBalDateCalendar } from '.
|
|
|
28
28
|
import { BalDateCalendarCell, defineCustomElement as defineBalDateCalendarCell } from './bal-date-calendar-cell'
|
|
29
29
|
import { BalDatepicker, defineCustomElement as defineBalDatepicker } from './bal-datepicker'
|
|
30
30
|
import { BalDivider, defineCustomElement as defineBalDivider } from './bal-divider'
|
|
31
|
-
import { BalDocApp, defineCustomElement as defineBalDocApp } from './bal-doc-app'
|
|
32
31
|
import { BalDropdown, defineCustomElement as defineBalDropdown } from './bal-dropdown'
|
|
33
32
|
import { BalField, defineCustomElement as defineBalField } from './bal-field'
|
|
34
33
|
import { BalFieldControl, defineCustomElement as defineBalFieldControl } from './bal-field-control'
|
|
@@ -147,7 +146,6 @@ export { BalDateCalendar, defineBalDateCalendar }
|
|
|
147
146
|
export { BalDateCalendarCell, defineBalDateCalendarCell }
|
|
148
147
|
export { BalDatepicker, defineBalDatepicker }
|
|
149
148
|
export { BalDivider, defineBalDivider }
|
|
150
|
-
export { BalDocApp, defineBalDocApp }
|
|
151
149
|
export { BalDropdown, defineBalDropdown }
|
|
152
150
|
export { BalField, defineBalField }
|
|
153
151
|
export { BalFieldControl, defineBalFieldControl }
|
package/components/all.js
CHANGED
|
@@ -28,7 +28,6 @@ import { BalDateCalendar, defineCustomElement as defineBalDateCalendar } from '.
|
|
|
28
28
|
import { BalDateCalendarCell, defineCustomElement as defineBalDateCalendarCell } from './bal-date-calendar-cell'
|
|
29
29
|
import { BalDatepicker, defineCustomElement as defineBalDatepicker } from './bal-datepicker'
|
|
30
30
|
import { BalDivider, defineCustomElement as defineBalDivider } from './bal-divider'
|
|
31
|
-
import { BalDocApp, defineCustomElement as defineBalDocApp } from './bal-doc-app'
|
|
32
31
|
import { BalDropdown, defineCustomElement as defineBalDropdown } from './bal-dropdown'
|
|
33
32
|
import { BalField, defineCustomElement as defineBalField } from './bal-field'
|
|
34
33
|
import { BalFieldControl, defineCustomElement as defineBalFieldControl } from './bal-field-control'
|
|
@@ -147,7 +146,6 @@ export { BalDateCalendar, defineBalDateCalendar }
|
|
|
147
146
|
export { BalDateCalendarCell, defineBalDateCalendarCell }
|
|
148
147
|
export { BalDatepicker, defineBalDatepicker }
|
|
149
148
|
export { BalDivider, defineBalDivider }
|
|
150
|
-
export { BalDocApp, defineBalDocApp }
|
|
151
149
|
export { BalDropdown, defineBalDropdown }
|
|
152
150
|
export { BalField, defineBalField }
|
|
153
151
|
export { BalFieldControl, defineBalFieldControl }
|
|
@@ -267,7 +265,6 @@ export const defineAllComponents = () => {
|
|
|
267
265
|
defineBalDateCalendarCell()
|
|
268
266
|
defineBalDatepicker()
|
|
269
267
|
defineBalDivider()
|
|
270
|
-
defineBalDocApp()
|
|
271
268
|
defineBalDropdown()
|
|
272
269
|
defineBalField()
|
|
273
270
|
defineBalFieldControl()
|
package/components/bal-app.js
CHANGED
|
@@ -1,4 +1,88 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { _ as __decorate, a as __metadata } from './tslib.es6.js';
|
|
3
|
+
import { b as balBrowser } from './browser.js';
|
|
4
|
+
import { b as balDevice } from './device.js';
|
|
5
|
+
import { h as debounce, k as rIC } from './helpers.js';
|
|
6
|
+
import { L as Logger } from './log.js';
|
|
7
|
+
import { s as startFocusVisible } from './focus-visible.js';
|
|
8
|
+
import { b as updateBalAnimated } from './config.utils.js';
|
|
9
|
+
|
|
10
|
+
const balAppCss = ":root{--bal-app-height:100%}.bal-app{position:relative;display:block}";
|
|
11
|
+
const BalAppStyle0 = balAppCss;
|
|
12
|
+
|
|
13
|
+
const App = /*@__PURE__*/ proxyCustomElement(class App extends HTMLElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.__registerHost();
|
|
17
|
+
this.debouncedNotify = debounce(() => this.notifyResize(), 100);
|
|
18
|
+
this.notifyResize = async () => {
|
|
19
|
+
if (balBrowser.hasDocument && balBrowser.hasWindow) {
|
|
20
|
+
const doc = document.documentElement;
|
|
21
|
+
doc.style.setProperty('--bal-app-height', `${window.innerHeight}px`);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
this.animated = true;
|
|
25
|
+
this.ready = false;
|
|
26
|
+
}
|
|
27
|
+
createLogger(log) {
|
|
28
|
+
this.log = log;
|
|
29
|
+
}
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
updateBalAnimated(this.animated);
|
|
32
|
+
if (balBrowser.hasWindow) {
|
|
33
|
+
window.addEventListener('resize', this.debouncedNotify);
|
|
34
|
+
this.debouncedNotify();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
componentDidLoad() {
|
|
38
|
+
rIC(async () => {
|
|
39
|
+
this.ready = true;
|
|
40
|
+
startFocusVisible();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
disconnectedCallback() {
|
|
44
|
+
if (balBrowser.hasWindow) {
|
|
45
|
+
window.removeEventListener('resize', this.debouncedNotify);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async setFocus(elements) {
|
|
49
|
+
if (this.focusVisible) {
|
|
50
|
+
this.focusVisible.setFocus(elements);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
return (h(Host, { class: {
|
|
55
|
+
'bal-app': true,
|
|
56
|
+
'bal-app--safari': balBrowser.isSafari,
|
|
57
|
+
'bal-app--touch': balDevice.hasTouchScreen,
|
|
58
|
+
} }, h("slot", null)));
|
|
59
|
+
}
|
|
60
|
+
get el() { return this; }
|
|
61
|
+
static get style() { return BalAppStyle0; }
|
|
62
|
+
}, [4, "bal-app", {
|
|
63
|
+
"animated": [516],
|
|
64
|
+
"ready": [1540],
|
|
65
|
+
"setFocus": [64]
|
|
66
|
+
}]);
|
|
67
|
+
__decorate([
|
|
68
|
+
Logger('bal-app'),
|
|
69
|
+
__metadata("design:type", Function),
|
|
70
|
+
__metadata("design:paramtypes", [Function]),
|
|
71
|
+
__metadata("design:returntype", void 0)
|
|
72
|
+
], App.prototype, "createLogger", null);
|
|
73
|
+
function defineCustomElement$1() {
|
|
74
|
+
if (typeof customElements === "undefined") {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const components = ["bal-app"];
|
|
78
|
+
components.forEach(tagName => { switch (tagName) {
|
|
79
|
+
case "bal-app":
|
|
80
|
+
if (!customElements.get(tagName)) {
|
|
81
|
+
customElements.define(tagName, App);
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
} });
|
|
85
|
+
}
|
|
2
86
|
|
|
3
87
|
const BalApp = App;
|
|
4
88
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -75,6 +75,12 @@ const SegmentItem = /*@__PURE__*/ proxyCustomElement(class SegmentItem extends H
|
|
|
75
75
|
componentWillLoad() {
|
|
76
76
|
this.inheritedAttributes = Object.assign({}, inheritAttributes(this.el, ['aria-label']));
|
|
77
77
|
}
|
|
78
|
+
connectedCallback() {
|
|
79
|
+
const segmentEl = (this.segmentEl = this.el.closest('bal-segment'));
|
|
80
|
+
if (segmentEl && segmentEl.vertical) {
|
|
81
|
+
this.isVertical = segmentEl.vertical;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
78
84
|
componentDidLoad() {
|
|
79
85
|
const segmentEl = (this.segmentEl = this.el.closest('bal-segment'));
|
|
80
86
|
if (segmentEl) {
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, writeTask, h, Host } from
|
|
|
2
2
|
import { _ as __decorate, a as __metadata } from './tslib.es6.js';
|
|
3
3
|
import { B as BEM } from './bem.js';
|
|
4
4
|
import { L as Logger } from './log.js';
|
|
5
|
-
import { a as isSpaceKey, q as isArrowUpKey, A as isArrowLeftKey, o as isArrowDownKey, B as isArrowRightKey, C as isHomeKey, D as isEndKey } from './index.esm.js';
|
|
5
|
+
import { a as isSpaceKey, i as isEnterKey, q as isArrowUpKey, A as isArrowLeftKey, o as isArrowDownKey, B as isArrowRightKey, C as isHomeKey, D as isEndKey } from './index.esm.js';
|
|
6
6
|
import { s as stopEventBubbling } from './form-input.js';
|
|
7
7
|
import { F as FOCUS_KEYS } from './focus-visible.js';
|
|
8
8
|
import { l as raf } from './helpers.js';
|
|
@@ -124,6 +124,7 @@ const Segment = /*@__PURE__*/ proxyCustomElement(class Segment extends HTMLEleme
|
|
|
124
124
|
this.el.addEventListener('touchstart', this.onPointerDown);
|
|
125
125
|
this.el.addEventListener('mousedown', this.onPointerDown);
|
|
126
126
|
this.disabledChanged();
|
|
127
|
+
this.isVertical = this.vertical;
|
|
127
128
|
}
|
|
128
129
|
disconnectedCallback() {
|
|
129
130
|
this.el.removeEventListener('touchstart', this.onPointerDown);
|
|
@@ -165,10 +166,12 @@ const Segment = /*@__PURE__*/ proxyCustomElement(class Segment extends HTMLEleme
|
|
|
165
166
|
}
|
|
166
167
|
listenOnKeyDown(ev) {
|
|
167
168
|
this.keyboardMode = FOCUS_KEYS.includes(ev.key);
|
|
169
|
+
let forceChange = false;
|
|
168
170
|
let current;
|
|
169
|
-
if (isSpaceKey(ev)) {
|
|
171
|
+
if (isSpaceKey(ev) || isEnterKey(ev)) {
|
|
170
172
|
stopEventBubbling(ev);
|
|
171
173
|
current = this.getSegmentItem('current');
|
|
174
|
+
forceChange = this.value !== current.value;
|
|
172
175
|
this.value = current.value;
|
|
173
176
|
}
|
|
174
177
|
else if (isArrowUpKey(ev) || isArrowLeftKey(ev)) {
|
|
@@ -191,7 +194,7 @@ const Segment = /*@__PURE__*/ proxyCustomElement(class Segment extends HTMLEleme
|
|
|
191
194
|
return;
|
|
192
195
|
}
|
|
193
196
|
const previous = this.checked;
|
|
194
|
-
if (current !== previous) {
|
|
197
|
+
if (current !== previous || forceChange) {
|
|
195
198
|
this.checkButton(previous, current);
|
|
196
199
|
this.emitValueChange();
|
|
197
200
|
}
|
package/components/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setPlatformHelpers } from '@stencil/core/internal/client';
|
|
1
2
|
export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
3
|
export { F as FileUploadRejectionReason } from './bal-file-upload.type.js';
|
|
3
4
|
export { i as i18nBalDate } from './bal-date.i18n.js';
|
|
@@ -6,7 +7,10 @@ export { i as i18nBalDatepicker } from './bal-datepicker.i18n.js';
|
|
|
6
7
|
export { i as i18nBalTimeInput } from './bal-time-input.i18n.js';
|
|
7
8
|
export { i as i18nBalInputStepper } from './bal-input-stepper.i18n.js';
|
|
8
9
|
export { i as i18nBalLabel } from './bal-label.i18n.js';
|
|
9
|
-
|
|
10
|
+
import { b as balBrowser } from './browser.js';
|
|
11
|
+
export { b as balBrowser } from './browser.js';
|
|
12
|
+
import { d as defaultConfig } from './config.default.js';
|
|
13
|
+
export { d as defaultConfig } from './config.default.js';
|
|
10
14
|
export { n as newBalOption } from './option.js';
|
|
11
15
|
export { n as newBalStepOption } from './bal-step.util.js';
|
|
12
16
|
export { n as newBalTabOption } from './bal-tab.util.js';
|
|
@@ -14,8 +18,6 @@ import { g as getAppRoot, c as componentOnReady } from './helpers.js';
|
|
|
14
18
|
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';
|
|
15
19
|
export { s as scrollToFirstInvalidField } from './form.js';
|
|
16
20
|
export { B as BalScrollHandler } from './scroll.js';
|
|
17
|
-
import { b as balBrowser } from './browser.js';
|
|
18
|
-
export { b as balBrowser } from './browser.js';
|
|
19
21
|
import { b as balDevice } from './device.js';
|
|
20
22
|
export { B as BalDevice, b as balDevice } from './device.js';
|
|
21
23
|
export { I as INVALID_VALUE } from './mask-util.js';
|
|
@@ -23,11 +25,160 @@ import { g as getOverlays, a as getOverlay } from './overlays.js';
|
|
|
23
25
|
import { B as BalWindowResizeListener, b as balBreakpoints } from './breakpoints.subject.js';
|
|
24
26
|
export { c as BalBreakpointSubject, d as BalBreakpointsUtil, a as balBreakpointSubject, b as balBreakpoints } from './breakpoints.subject.js';
|
|
25
27
|
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';
|
|
26
|
-
export { d as defaultConfig } from './config.default.js';
|
|
27
28
|
import { S as Subject } from './listener.js';
|
|
28
29
|
export { B as BalSwipeSubject } from './swipe.subject.js';
|
|
29
30
|
export { B as BalDate } from './date.js';
|
|
30
31
|
|
|
32
|
+
const BALOISE_SESSION_KEY = 'baloise-persist-config';
|
|
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 saveConfig = (win, c) => {
|
|
165
|
+
try {
|
|
166
|
+
win.sessionStorage.setItem(BALOISE_SESSION_KEY, JSON.stringify(c));
|
|
167
|
+
}
|
|
168
|
+
catch (e) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const setupConfig = (userConfig = {}, win = {}) => {
|
|
174
|
+
if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
|
|
175
|
+
win = window;
|
|
176
|
+
}
|
|
177
|
+
win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
|
|
178
|
+
config.reset(Object.assign(Object.assign(Object.assign({}, configFromSession(win)), userConfig), { icons: Object.assign(Object.assign({}, configFromSession(win).icons), userConfig.icons) }));
|
|
179
|
+
win.BaloiseDesignSystem.config = config;
|
|
180
|
+
};
|
|
181
|
+
|
|
31
182
|
const i18nBalFieldLabel = {
|
|
32
183
|
de: {
|
|
33
184
|
optional: ' (optional)',
|
|
@@ -61,6 +212,139 @@ const i18nBalFieldLabel = {
|
|
|
61
212
|
},
|
|
62
213
|
};
|
|
63
214
|
|
|
215
|
+
class BalNoticeController {
|
|
216
|
+
constructor(options) {
|
|
217
|
+
this.options = options;
|
|
218
|
+
this.container = null;
|
|
219
|
+
this.queue = [];
|
|
220
|
+
this.preQueue = [];
|
|
221
|
+
this.queueLimit = 5;
|
|
222
|
+
}
|
|
223
|
+
create(options) {
|
|
224
|
+
if (balBrowser.hasDocument) {
|
|
225
|
+
this.setupContainer();
|
|
226
|
+
const clone = this.findClone(options);
|
|
227
|
+
if (clone === undefined) {
|
|
228
|
+
const el = document.createElement(this.options.tag);
|
|
229
|
+
Object.assign(el, options);
|
|
230
|
+
el.addEventListener('balClose', ev => {
|
|
231
|
+
this.removeFromQueue(ev.detail);
|
|
232
|
+
});
|
|
233
|
+
this.preQueue.push(el);
|
|
234
|
+
this.updateQueue();
|
|
235
|
+
return el;
|
|
236
|
+
}
|
|
237
|
+
return clone;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
setQueue(queueLimit) {
|
|
241
|
+
this.queueLimit = queueLimit;
|
|
242
|
+
}
|
|
243
|
+
async dismissAll() {
|
|
244
|
+
var _a;
|
|
245
|
+
const elements = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.options.tag);
|
|
246
|
+
if (elements) {
|
|
247
|
+
const closingQueue = [];
|
|
248
|
+
for (let index = 0; index < elements.length; index++) {
|
|
249
|
+
const el = elements[index];
|
|
250
|
+
if (el.close) {
|
|
251
|
+
closingQueue.push(el.close());
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
await Promise.all(closingQueue);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* @deprecated use dismissAll instead
|
|
259
|
+
*/
|
|
260
|
+
async clearAll() {
|
|
261
|
+
console.warn('[DEPRECATED] - use dismissAll() instead');
|
|
262
|
+
return this.dismissAll();
|
|
263
|
+
}
|
|
264
|
+
findClone(options) {
|
|
265
|
+
for (let index = 0; index < this.queue.length; index++) {
|
|
266
|
+
const el = this.queue[index];
|
|
267
|
+
if (el.message === options.message && el.color === options.color) {
|
|
268
|
+
return el;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return undefined;
|
|
272
|
+
}
|
|
273
|
+
setupContainer() {
|
|
274
|
+
if (balBrowser.hasDocument) {
|
|
275
|
+
const containerId = `${this.options.tag}-container`;
|
|
276
|
+
this.container = document.getElementById(containerId);
|
|
277
|
+
if (this.container)
|
|
278
|
+
return;
|
|
279
|
+
if (!this.container) {
|
|
280
|
+
this.container = document.createElement('bal-notices');
|
|
281
|
+
this.container.setAttribute('interface', this.options.tag.replace('bal-', ''));
|
|
282
|
+
this.container.id = containerId;
|
|
283
|
+
}
|
|
284
|
+
document.body.appendChild(this.container);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
updateQueue() {
|
|
288
|
+
var _a;
|
|
289
|
+
if (this.queue.length < this.queueLimit) {
|
|
290
|
+
const el = this.preQueue.shift();
|
|
291
|
+
if (el && this.container) {
|
|
292
|
+
this.queue.push(el);
|
|
293
|
+
this.container.insertAdjacentElement('beforeend', el);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (this.queue.length === 0) {
|
|
297
|
+
(_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
removeFromQueue(toastId) {
|
|
301
|
+
this.queue = this.queue.filter(el => el.id !== toastId);
|
|
302
|
+
setTimeout(() => this.updateQueue(), 0);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
class BalToastController extends BalNoticeController {
|
|
307
|
+
constructor() {
|
|
308
|
+
super({
|
|
309
|
+
tag: 'bal-toast',
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
create(options) {
|
|
313
|
+
return super.create(options);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const balToastController = new BalToastController();
|
|
317
|
+
|
|
318
|
+
class BalSnackbarController extends BalNoticeController {
|
|
319
|
+
constructor() {
|
|
320
|
+
super({
|
|
321
|
+
tag: 'bal-snackbar',
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
create(options) {
|
|
325
|
+
return super.create(options);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
const balSnackbarController = new BalSnackbarController();
|
|
329
|
+
|
|
330
|
+
// generated by .build/version.js
|
|
331
|
+
const VERSION = '16.7.0';
|
|
332
|
+
|
|
333
|
+
const initializeBaloiseDesignSystem = (userConfig = {}, platformConfig = undefined, win = {}) => {
|
|
334
|
+
if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
|
|
335
|
+
win = window;
|
|
336
|
+
}
|
|
337
|
+
win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
|
|
338
|
+
if (platformConfig) {
|
|
339
|
+
setPlatformHelpers(platformConfig);
|
|
340
|
+
}
|
|
341
|
+
setupConfig(Object.assign(Object.assign({}, userConfig), platformConfig), win);
|
|
342
|
+
win.BaloiseDesignSystem.toastController = balToastController;
|
|
343
|
+
win.BaloiseDesignSystem.snackbarController = balSnackbarController;
|
|
344
|
+
win.BaloiseDesignSystem.initialize = () => setupConfig(win.BaloiseDesignSystem.config, win);
|
|
345
|
+
win.BaloiseDesignSystem.version = VERSION;
|
|
346
|
+
};
|
|
347
|
+
|
|
64
348
|
const newBalCheckboxOption = (option) => {
|
|
65
349
|
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 });
|
|
66
350
|
};
|
|
@@ -178,4 +462,4 @@ const isPlatform = (winOrPlatform, platform) => {
|
|
|
178
462
|
const NewBalOptionValue = newBalOptionValue;
|
|
179
463
|
const NewBalSingleOptionValue = newBalSingleOptionValue;
|
|
180
464
|
|
|
181
|
-
export { BalModalController, BalOrientationSubject, NewBalOptionValue, NewBalSingleOptionValue, balModalController, balOrientationSubject, getPlatforms, hasTouchSupport, i18nBalFieldLabel, isBrowser, isPlatform, newBalCheckboxOption, newBalOptionValue, newBalRadioOption, newBalSingleOptionValue };
|
|
465
|
+
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 };
|