@baloise/ds-core 16.2.0-snapshot.1407-e185e4922 → 16.2.1
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-number-input.js +5 -2
- 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-082f636952.entry.js → p-01999347b1.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d9feb5d7c0.entry.js → p-01d998678a.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b8a6341165.entry.js → p-03b8dbdc88.entry.js} +1 -1
- package/dist/baloise-design-system/p-1509eaa7.system.js +1 -1
- package/dist/baloise-design-system/{p-a8e8dfc0.js → p-192bade4.js} +1 -1
- package/dist/baloise-design-system/{p-ed637887c2.entry.js → p-23ef6e0656.entry.js} +1 -1
- package/dist/baloise-design-system/{p-8f14c708.system.js → p-296a638e.system.js} +1 -1
- package/dist/baloise-design-system/{p-943212f68f.system.entry.js → p-29bfdafb70.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0bea88a692.system.entry.js → p-2ae4288f42.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-ca96b0454b.entry.js → p-2bf04f4f7e.entry.js} +1 -1
- package/dist/baloise-design-system/{p-8219df391e.system.entry.js → p-2d115eb51b.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-cccd7d6ff2.system.entry.js → p-2d7a5a33fe.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-2095770c.system.js → p-2ddb356c.system.js} +1 -1
- package/dist/baloise-design-system/{p-7447b1660a.system.entry.js → p-488e6a1eee.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1eefda010b.entry.js → p-4a2d315dc4.entry.js} +1 -1
- package/dist/baloise-design-system/{p-83da5552.system.js → p-4c470f43.system.js} +1 -1
- package/dist/baloise-design-system/{p-f606b4dd6a.system.entry.js → p-504d51d0a1.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-882a34312c.system.entry.js → p-524ceea034.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-54f81c32.js +1 -1
- package/dist/baloise-design-system/{p-90cd321ce2.system.entry.js → p-5f8d927f95.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-be03662555.entry.js → p-6048a8f8af.entry.js} +1 -1
- package/dist/baloise-design-system/{p-dab27e15b7.entry.js → p-6b6006ffc1.entry.js} +1 -1
- package/dist/baloise-design-system/{p-422dea4e13.entry.js → p-6b863f9d71.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c85d50007d.system.entry.js → p-709bb627dd.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-ace2dda089.system.entry.js → p-8b931ae0b8.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-289b55ac40.system.entry.js → p-94ae00c712.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-a52564d27f.system.entry.js +1 -0
- package/dist/baloise-design-system/p-ad00d94e7f.entry.js +1 -0
- package/dist/baloise-design-system/{p-8917bdd58c.entry.js → p-b10a80a3b8.entry.js} +1 -1
- package/dist/baloise-design-system/p-bcca1ed3.system.js +1 -0
- package/dist/baloise-design-system/{p-907034b36c.system.entry.js → p-c19e28122b.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-bf51a6f527.system.entry.js → p-cd289f40c5.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f1f7c31189.entry.js → p-def2591edc.entry.js} +1 -1
- package/dist/baloise-design-system/p-e63febcbd8.entry.js +1 -0
- package/dist/baloise-design-system/p-e78a6409.js +1 -0
- package/dist/baloise-design-system/{p-39b19bf0d2.entry.js → p-fcc2312923.entry.js} +1 -1
- package/dist/baloise-design-system/{p-766e91ac.js → p-ffbe2886.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_3.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-number-input.cjs.entry.js +5 -2
- package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
- package/dist/cjs/bal-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-progress-bar.cjs.entry.js +3 -3
- 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-4919e7dd.js → breakpoints.decorator-603d97d9.js} +1 -1
- package/dist/cjs/{breakpoints.subject-df258386.js → breakpoints.subject-a0b2bc41.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-b9532f4d.js → tokens.esm-ae4d587c.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/bal-number-input/bal-number-input.utils.js +5 -2
- 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_3.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-number-input.entry.js +5 -2
- package/dist/esm/bal-pagination.entry.js +3 -3
- package/dist/esm/bal-popover_2.entry.js +3 -3
- package/dist/esm/bal-progress-bar.entry.js +3 -3
- 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-1fe0677c.js → breakpoints.decorator-f710f500.js} +1 -1
- package/dist/esm/{breakpoints.subject-4fe27230.js → breakpoints.subject-3ea6d2c3.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-d040ce3d.js → tokens.esm-27a803dc.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_3.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-number-input.entry.js +1 -1
- package/dist/esm-es5/bal-pagination.entry.js +1 -1
- package/dist/esm-es5/bal-popover_2.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.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-1fe0677c.js → breakpoints.decorator-f710f500.js} +1 -1
- package/dist/esm-es5/{breakpoints.subject-4fe27230.js → breakpoints.subject-3ea6d2c3.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/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-2f10a01b97.entry.js +0 -1
- package/dist/baloise-design-system/p-317cee9b56.system.entry.js +0 -1
- package/dist/baloise-design-system/p-360068a4.system.js +0 -1
- package/dist/baloise-design-system/p-6648acba05.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-77f5e777e6.entry.js +0 -1
- package/dist/baloise-design-system/p-9ecce014c2.system.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-c1432029.js → p-b1f86100.js} +0 -0
- /package/dist/baloise-design-system/{p-94811888.system.js → p-efb46317.system.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-d040ce3d.js → tokens.esm-27a803dc.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'
|
|
@@ -145,7 +144,6 @@ export { BalDateCalendar, defineBalDateCalendar }
|
|
|
145
144
|
export { BalDateCalendarCell, defineBalDateCalendarCell }
|
|
146
145
|
export { BalDatepicker, defineBalDatepicker }
|
|
147
146
|
export { BalDivider, defineBalDivider }
|
|
148
|
-
export { BalDocApp, defineBalDocApp }
|
|
149
147
|
export { BalDropdown, defineBalDropdown }
|
|
150
148
|
export { BalField, defineBalField }
|
|
151
149
|
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'
|
|
@@ -145,7 +144,6 @@ export { BalDateCalendar, defineBalDateCalendar }
|
|
|
145
144
|
export { BalDateCalendarCell, defineBalDateCalendarCell }
|
|
146
145
|
export { BalDatepicker, defineBalDatepicker }
|
|
147
146
|
export { BalDivider, defineBalDivider }
|
|
148
|
-
export { BalDocApp, defineBalDocApp }
|
|
149
147
|
export { BalDropdown, defineBalDropdown }
|
|
150
148
|
export { BalField, defineBalField }
|
|
151
149
|
export { BalFieldControl, defineBalFieldControl }
|
|
@@ -263,7 +261,6 @@ export const defineAllComponents = () => {
|
|
|
263
261
|
defineBalDateCalendarCell()
|
|
264
262
|
defineBalDatepicker()
|
|
265
263
|
defineBalDivider()
|
|
266
|
-
defineBalDocApp()
|
|
267
264
|
defineBalDropdown()
|
|
268
265
|
defineBalField()
|
|
269
266
|
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;
|
|
@@ -142,6 +142,9 @@ const getNegativeSymbol = () => {
|
|
|
142
142
|
return '-';
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
+
function checkIfValueIsStringAndDoesNotHaveGermanFormat(val) {
|
|
146
|
+
return typeof val === 'string' && getThousandSeparator() !== '.';
|
|
147
|
+
}
|
|
145
148
|
function isNumber(value) {
|
|
146
149
|
const num = parseFloat(value);
|
|
147
150
|
return typeof num === 'number' && !lodash_isnan(num);
|
|
@@ -160,7 +163,7 @@ function toNumber(value, decimalPoints = 0) {
|
|
|
160
163
|
!isNumber(val)) {
|
|
161
164
|
return undefined;
|
|
162
165
|
}
|
|
163
|
-
if (
|
|
166
|
+
if (checkIfValueIsStringAndDoesNotHaveGermanFormat(val)) {
|
|
164
167
|
val = val.split(getThousandSeparator()).join('').split('`').join('').split("'").join('');
|
|
165
168
|
}
|
|
166
169
|
return decimalPoints === 0 ? parseInt(val, 10) : parseFloat(val);
|
|
@@ -170,7 +173,7 @@ function toFixedNumber(value, decimalPoints = 0) {
|
|
|
170
173
|
if (lodash_isnil(val)) {
|
|
171
174
|
return '';
|
|
172
175
|
}
|
|
173
|
-
if (
|
|
176
|
+
if (checkIfValueIsStringAndDoesNotHaveGermanFormat(val)) {
|
|
174
177
|
val = val.split(getThousandSeparator()).join('').split('`').join('').split("'").join('');
|
|
175
178
|
}
|
|
176
179
|
if (val.charAt(0) === getDecimalSeparator()) {
|
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.2.1';
|
|
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 };
|