@baloise/ds-core 16.7.0-nightly.20241025 → 16.8.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-form.js +10 -1
- 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-483ee1ef46.system.entry.js → p-004e4a0f4d.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f959646a.system.js → p-013b4c72.system.js} +1 -1
- package/dist/baloise-design-system/{p-311a69b8fe.system.entry.js → p-0970cac46c.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-1509eaa7.system.js +1 -1
- package/dist/baloise-design-system/{p-2a1d352111.entry.js → p-2b1171b384.entry.js} +1 -1
- package/dist/baloise-design-system/{p-00d6c7d3.system.js → p-2ea21f9c.system.js} +1 -1
- package/dist/baloise-design-system/{p-1669b6c5.js → p-328e32e1.js} +1 -1
- package/dist/baloise-design-system/{p-4000a9dfde.entry.js → p-360937c857.entry.js} +1 -1
- package/dist/baloise-design-system/{p-2214511f1a.entry.js → p-38e8a5093f.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0e7dc6d601.system.entry.js → p-3b96381383.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1d2d6c1236.entry.js → p-414d9ac8db.entry.js} +1 -1
- package/dist/baloise-design-system/{p-ecb676d33d.entry.js → p-4b12d35824.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6f0c04b05d.entry.js → p-4e05616242.entry.js} +1 -1
- package/dist/baloise-design-system/p-54f81c32.js +1 -1
- package/dist/baloise-design-system/{p-fbc224c08b.system.entry.js → p-5ef256a316.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-94a3dc979b.entry.js → p-635bc3259a.entry.js} +1 -1
- package/dist/baloise-design-system/{p-704d9b7331.system.entry.js → p-6fb7d22ecb.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1e54984740.system.entry.js → p-73d0e3b2a7.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4c0e4b2c4c.system.entry.js → p-7662250151.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-7e54ecfcf8.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-30fffd98.js → p-81f848c6.js} +1 -1
- package/dist/baloise-design-system/{p-9eb9b84d6c.entry.js → p-82dea9a1e3.entry.js} +1 -1
- package/dist/baloise-design-system/p-863d57eb.js +1 -0
- package/dist/baloise-design-system/{p-5e837c9822.system.entry.js → p-9e9e42ca3a.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-95306803d7.system.entry.js → p-a7767b9500.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-877e2303.system.js → p-abd9c578.system.js} +1 -1
- package/dist/baloise-design-system/{p-06d63213.system.js → p-ac24ebaa.system.js} +1 -1
- package/dist/baloise-design-system/{p-08afbf2630.entry.js → p-b239069aea.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e96a215e1a.entry.js → p-b6624cd6f3.entry.js} +1 -1
- package/dist/baloise-design-system/p-bcca1ed3.system.js +1 -0
- package/dist/baloise-design-system/{p-5554bd945e.entry.js → p-c64f74a007.entry.js} +1 -1
- package/dist/baloise-design-system/p-cb29a218db.entry.js +1 -0
- package/dist/baloise-design-system/{p-e37220d2de.entry.js → p-cc0073c153.entry.js} +1 -1
- package/dist/baloise-design-system/{p-40b3a3ea.system.js → p-cd378385.system.js} +1 -1
- package/dist/baloise-design-system/{p-374600d796.system.entry.js → p-d14e28eb84.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4cc9a02ed7.entry.js → p-d5c02240d5.entry.js} +1 -1
- package/dist/baloise-design-system/{p-baaa28868e.system.entry.js → p-de69e6ded1.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-e78a6409.js +1 -0
- package/dist/baloise-design-system/{p-c770d82242.system.entry.js → p-ee9c988a19.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a45beea943.system.entry.js → p-f4e7616005.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-form.cjs.entry.js +12 -1
- 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 +4 -4
- 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-818749de.js → breakpoints.decorator-3e39d424.js} +1 -1
- package/dist/cjs/{breakpoints.subject-8f650e5c.js → breakpoints.subject-04e46eae.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-3a3e419c.js → tokens.esm-c5d8ed82.js} +1 -1
- package/dist/cjs/{window-resize.decorator-a47a46b8.js → window-resize.decorator-f34ad3f4.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/bal-form/bal-form.css +1 -0
- package/dist/collection/components/bal-form/bal-form.js +33 -1
- 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-form.entry.js +12 -1
- 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 +4 -4
- 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-b14b7224.js → breakpoints.decorator-f08ad280.js} +1 -1
- package/dist/esm/{breakpoints.subject-2e8fc1dd.js → breakpoints.subject-d2b4fd79.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-5ee11c6b.js → tokens.esm-cada8a2a.js} +1 -1
- package/dist/esm/{window-resize.decorator-fd793cbb.js → window-resize.decorator-6ef9be6a.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-form.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-f08ad280.js +1 -0
- package/dist/esm-es5/{breakpoints.subject-2e8fc1dd.js → breakpoints.subject-d2b4fd79.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-fd793cbb.js → window-resize.decorator-6ef9be6a.js} +1 -1
- package/dist/html.html-data.json +4 -0
- package/dist/types/components/bal-form/bal-form.d.ts +4 -0
- package/dist/types/components.d.ts +8 -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 -262
- package/components/initialize.js +0 -288
- package/dist/baloise-design-system/p-27f04c3000.entry.js +0 -1
- package/dist/baloise-design-system/p-360068a4.system.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-72dedd6a6d.system.entry.js +0 -1
- package/dist/baloise-design-system/p-c89c20ce.js +0 -1
- package/dist/baloise-design-system/p-df332c66fb.entry.js +0 -1
- package/dist/baloise-design-system/p-e8ffddeb.js +0 -1
- package/dist/baloise-design-system/p-f645089688.system.entry.js +0 -1
- package/dist/cjs/app-globals-5fd73c0c.js +0 -7
- package/dist/cjs/bal-doc-app.cjs.entry.js +0 -233
- 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 -229
- 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/breakpoints.decorator-b14b7224.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 -82
- /package/dist/baloise-design-system/{p-d71b5432.system.js → p-3486c48d.system.js} +0 -0
- /package/dist/baloise-design-system/{p-ce0f4e95.js → p-8088b32a.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-5ee11c6b.js → tokens.esm-cada8a2a.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;
|
package/components/bal-form.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { s as scrollToFirstInvalidField } from './form.js';
|
|
3
|
+
import { d as waitAfterIdleCallback, b as waitAfterFramePaint } from './helpers.js';
|
|
4
|
+
|
|
5
|
+
const balFormCss = ".bal-form{display:block;position:static}";
|
|
6
|
+
const BalFormStyle0 = balFormCss;
|
|
3
7
|
|
|
4
8
|
const Form = /*@__PURE__*/ proxyCustomElement(class Form extends HTMLElement {
|
|
5
9
|
constructor() {
|
|
@@ -7,11 +11,14 @@ const Form = /*@__PURE__*/ proxyCustomElement(class Form extends HTMLElement {
|
|
|
7
11
|
this.__registerHost();
|
|
8
12
|
this.native = false;
|
|
9
13
|
this.novalidate = false;
|
|
14
|
+
this.formClass = '';
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* Scrolls to the first invalid field inside this form component.
|
|
13
18
|
*/
|
|
14
19
|
async scrollToFirstInvalidField() {
|
|
20
|
+
await waitAfterIdleCallback();
|
|
21
|
+
await waitAfterFramePaint();
|
|
15
22
|
scrollToFirstInvalidField({ formEl: this.el });
|
|
16
23
|
}
|
|
17
24
|
render() {
|
|
@@ -22,12 +29,14 @@ const Form = /*@__PURE__*/ proxyCustomElement(class Form extends HTMLElement {
|
|
|
22
29
|
novalidate: this.novalidate,
|
|
23
30
|
};
|
|
24
31
|
}
|
|
25
|
-
return (h(Host, null, h(NativeEl, Object.assign({}, attrs), h("slot", null))));
|
|
32
|
+
return (h(Host, null, h(NativeEl, Object.assign({}, attrs, { class: this.formClass }), h("slot", null))));
|
|
26
33
|
}
|
|
27
34
|
get el() { return this; }
|
|
35
|
+
static get style() { return BalFormStyle0; }
|
|
28
36
|
}, [4, "bal-form", {
|
|
29
37
|
"native": [4],
|
|
30
38
|
"novalidate": [4],
|
|
39
|
+
"formClass": [1, "form-class"],
|
|
31
40
|
"scrollToFirstInvalidField": [64]
|
|
32
41
|
}]);
|
|
33
42
|
function defineCustomElement$1() {
|
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.8.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 };
|