@baloise/ds-core 16.4.0-nightly.20240917 → 16.5.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-checkbox2.js +1 -1
- package/components/bal-radio2.js +1 -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-f959646a.system.js → p-013b4c72.system.js} +1 -1
- package/dist/baloise-design-system/{p-d1c43680a0.system.entry.js → p-0530e008e9.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d539c1cf.js → p-09ea5913.js} +1 -1
- package/dist/baloise-design-system/{p-6e88e337.system.js → p-0fb6cbda.system.js} +1 -1
- package/dist/baloise-design-system/p-1509eaa7.system.js +1 -1
- package/dist/baloise-design-system/{p-c240ee50bb.entry.js → p-190b5cd469.entry.js} +1 -1
- package/dist/baloise-design-system/{p-be0a0f5f7e.system.entry.js → p-23b7426d09.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-396898cf27.entry.js → p-2cd1f1dedb.entry.js} +1 -1
- package/dist/baloise-design-system/{p-8b998a54aa.entry.js → p-305cffd8aa.entry.js} +1 -1
- package/dist/baloise-design-system/{p-8a2f9c316c.system.entry.js → p-370575b8cb.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1e31a7e4d2.system.entry.js → p-372474e989.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9d051b6527.entry.js → p-3801afd625.entry.js} +1 -1
- package/dist/baloise-design-system/{p-cd66014bd1.entry.js → p-380aabd5bc.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6c038bb4ff.entry.js → p-39bf8adcde.entry.js} +1 -1
- package/dist/baloise-design-system/{p-dae1f687.system.js → p-3befc6f9.system.js} +1 -1
- package/dist/baloise-design-system/{p-8c2be8bc00.entry.js → p-3c25811c44.entry.js} +1 -1
- package/dist/baloise-design-system/p-3eb68d7e.js +1 -0
- package/dist/baloise-design-system/{p-17660ffea0.entry.js → p-407ffd9c55.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4cdec4da61.system.entry.js → p-445d2e1c70.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-261968b2.system.js → p-4809d5c4.system.js} +1 -1
- package/dist/baloise-design-system/{p-3558e7a64b.system.entry.js → p-487816db33.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4f1afa9be1.system.entry.js → p-4fe64c3ec6.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-54f81c32.js +1 -1
- package/dist/baloise-design-system/{p-4e8fff8409.entry.js → p-5fae3f5478.entry.js} +1 -1
- package/dist/baloise-design-system/{p-53c92c2d21.entry.js → p-77350b27fc.entry.js} +1 -1
- package/dist/baloise-design-system/{p-80c011874c.entry.js → p-7c586fb89f.entry.js} +1 -1
- package/dist/baloise-design-system/{p-509b566d.system.js → p-88eb14fd.system.js} +1 -1
- package/dist/baloise-design-system/{p-3bc2f95cf3.system.entry.js → p-9f54cac588.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a53f45fab6.entry.js → p-b0c22ff9d1.entry.js} +1 -1
- package/dist/baloise-design-system/p-bcca1ed3.system.js +1 -0
- package/dist/baloise-design-system/{p-d908780376.system.entry.js → p-c1c17f8edc.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-ac800c3208.entry.js → p-ced37553e2.entry.js} +1 -1
- package/dist/baloise-design-system/{p-06e93c033b.system.entry.js → p-d3fabdb142.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-18af339b1e.system.entry.js → p-d7d6937d59.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b0bb64b2b8.system.entry.js → p-df40272425.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-17f2b2e25a.entry.js → p-e0384bfc0c.entry.js} +1 -1
- package/dist/baloise-design-system/{p-2a700c21ae.system.entry.js → p-e1ccb7023c.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-e75ccb92.js +1 -0
- package/dist/baloise-design-system/p-e78a6409.js +1 -0
- package/dist/baloise-design-system/{p-19d582fb4a.entry.js → p-ef916aafa5.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f66ea0e663.system.entry.js → p-f03e63bd1e.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-40628589e1.system.entry.js → p-f62d0ccdd1.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e542aaeb27.entry.js → p-f819d47031.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b570b77884.system.entry.js → p-fb0af77320.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-checkbox_2.cjs.entry.js +1 -1
- 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-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 +4 -4
- package/dist/cjs/bal-radio_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-segment.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-77a3b464.js → breakpoints.decorator-a4a5bd7a.js} +1 -1
- package/dist/cjs/{breakpoints.subject-ae73ae55.js → breakpoints.subject-fbf85930.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-15025c39.js → tokens.esm-aa4bb7f7.js} +1 -1
- package/dist/cjs/{window-resize.decorator-5b9c08d1.js → window-resize.decorator-c7a521b0.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/bal-checkbox/radio-checkbox.css +1 -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-checkbox_2.entry.js +1 -1
- 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-pagination.entry.js +3 -3
- package/dist/esm/bal-popover_2.entry.js +3 -3
- package/dist/esm/bal-progress-bar.entry.js +4 -4
- package/dist/esm/bal-radio_2.entry.js +1 -1
- package/dist/esm/bal-segment.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-d55790da.js → breakpoints.decorator-f2ac9963.js} +1 -1
- package/dist/esm/{breakpoints.subject-ee89b4ec.js → breakpoints.subject-3605e395.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-769d0c71.js → tokens.esm-337782ae.js} +1 -1
- package/dist/esm/{window-resize.decorator-dec8dd72.js → window-resize.decorator-d5198831.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-checkbox_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-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-radio_2.entry.js +1 -1
- package/dist/esm-es5/bal-segment.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-d55790da.js → breakpoints.decorator-f2ac9963.js} +1 -1
- package/dist/esm-es5/{breakpoints.subject-ee89b4ec.js → breakpoints.subject-3605e395.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-dec8dd72.js → window-resize.decorator-d5198831.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-03c0e702.js +0 -1
- package/dist/baloise-design-system/p-120f1513.js +0 -1
- package/dist/baloise-design-system/p-360068a4.system.js +0 -1
- package/dist/baloise-design-system/p-381fe5557d.entry.js +0 -1
- package/dist/baloise-design-system/p-40b5ad07c5.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-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-1a742a5b.system.js → p-36074466.system.js} +0 -0
- /package/dist/baloise-design-system/{p-3f4bb3a8.js → p-e1994e2c.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-769d0c71.js → tokens.esm-337782ae.js} +0 -0
package/components/initialize.js
DELETED
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { setPlatformHelpers } from '@stencil/core/internal/client';
|
|
2
|
-
import { b as balBrowser } from './browser.js';
|
|
3
|
-
import { d as defaultConfig } from './config.default.js';
|
|
4
|
-
|
|
5
|
-
const BALOISE_SESSION_KEY = 'baloise-persist-config';
|
|
6
|
-
|
|
7
|
-
class Config {
|
|
8
|
-
constructor() {
|
|
9
|
-
this._componentObservers = [];
|
|
10
|
-
this._observers = [];
|
|
11
|
-
this._config = defaultConfig;
|
|
12
|
-
}
|
|
13
|
-
get locale() {
|
|
14
|
-
return `${this._config.language}-${this._config.region}`;
|
|
15
|
-
}
|
|
16
|
-
get region() {
|
|
17
|
-
return this._config.region;
|
|
18
|
-
}
|
|
19
|
-
set region(region) {
|
|
20
|
-
if (region !== this._config.region) {
|
|
21
|
-
this._config.region = region;
|
|
22
|
-
this._notify();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
get language() {
|
|
26
|
-
return this._config.language;
|
|
27
|
-
}
|
|
28
|
-
set language(language) {
|
|
29
|
-
if (language !== this._config.language) {
|
|
30
|
-
if (this._config.allowedLanguages.includes(language)) {
|
|
31
|
-
this._config.language = language;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this._config.language = this._config.fallbackLanguage;
|
|
35
|
-
}
|
|
36
|
-
this._notify();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
get allowedLanguages() {
|
|
40
|
-
return this._config.allowedLanguages;
|
|
41
|
-
}
|
|
42
|
-
set allowedLanguages(allowedLanguages) {
|
|
43
|
-
if (allowedLanguages !== this._config.allowedLanguages) {
|
|
44
|
-
this._config.allowedLanguages = allowedLanguages;
|
|
45
|
-
this._notify();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
get icons() {
|
|
49
|
-
return this._config.icons;
|
|
50
|
-
}
|
|
51
|
-
set icons(icons) {
|
|
52
|
-
this._config.icons = Object.assign(Object.assign({}, this._config.icons), icons);
|
|
53
|
-
this._notify();
|
|
54
|
-
}
|
|
55
|
-
get logger() {
|
|
56
|
-
return this._config.logger;
|
|
57
|
-
}
|
|
58
|
-
set logger(logger) {
|
|
59
|
-
this._config.logger = Object.assign({}, logger);
|
|
60
|
-
this._notify();
|
|
61
|
-
}
|
|
62
|
-
get animated() {
|
|
63
|
-
return this._config.animated;
|
|
64
|
-
}
|
|
65
|
-
set animated(animated) {
|
|
66
|
-
this._config.animated = animated;
|
|
67
|
-
this._notify();
|
|
68
|
-
}
|
|
69
|
-
get httpFormSubmit() {
|
|
70
|
-
return this._config.httpFormSubmit;
|
|
71
|
-
}
|
|
72
|
-
set httpFormSubmit(httpFormSubmit) {
|
|
73
|
-
this._config.httpFormSubmit = httpFormSubmit;
|
|
74
|
-
this._notify();
|
|
75
|
-
}
|
|
76
|
-
attach(observer) {
|
|
77
|
-
const isExist = this._observers.includes(observer);
|
|
78
|
-
if (isExist) {
|
|
79
|
-
return console.log('Subject: Observer has been attached already.');
|
|
80
|
-
}
|
|
81
|
-
this._observers.push(observer);
|
|
82
|
-
observer.configChanged(this._config);
|
|
83
|
-
}
|
|
84
|
-
detach(observer) {
|
|
85
|
-
const observerIndex = this._observers.indexOf(observer);
|
|
86
|
-
if (observerIndex === -1) {
|
|
87
|
-
return console.log('Subject: Nonexistent observer.');
|
|
88
|
-
}
|
|
89
|
-
this._observers.splice(observerIndex, 1);
|
|
90
|
-
}
|
|
91
|
-
attachComponent(observer) {
|
|
92
|
-
const isExist = this._componentObservers.includes(observer);
|
|
93
|
-
if (isExist) {
|
|
94
|
-
return console.log('Subject: Observer has been attached already.');
|
|
95
|
-
}
|
|
96
|
-
this._componentObservers.push(observer);
|
|
97
|
-
observer.configChanged(this._config);
|
|
98
|
-
}
|
|
99
|
-
detachComponent(observer) {
|
|
100
|
-
const observerIndex = this._componentObservers.indexOf(observer);
|
|
101
|
-
if (observerIndex === -1) {
|
|
102
|
-
return console.log('Subject: Nonexistent observer.');
|
|
103
|
-
}
|
|
104
|
-
this._componentObservers.splice(observerIndex, 1);
|
|
105
|
-
}
|
|
106
|
-
toString() {
|
|
107
|
-
return JSON.stringify(this._config);
|
|
108
|
-
}
|
|
109
|
-
reset(config) {
|
|
110
|
-
this._config = Object.assign(Object.assign(Object.assign({}, this._config), config), { icons: Object.assign(Object.assign({}, this._config.icons), config.icons) });
|
|
111
|
-
this._notify(false);
|
|
112
|
-
}
|
|
113
|
-
_notify(all = true) {
|
|
114
|
-
for (const observer of this._componentObservers) {
|
|
115
|
-
observer.configChanged(this._config);
|
|
116
|
-
}
|
|
117
|
-
if (all) {
|
|
118
|
-
for (const observer of this._observers) {
|
|
119
|
-
observer.configChanged(this._config);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (balBrowser.hasWindow) {
|
|
123
|
-
saveConfig(window, this._config);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
const config = /*@__PURE__*/ new Config();
|
|
128
|
-
const configFromSession = (win) => {
|
|
129
|
-
try {
|
|
130
|
-
const configStr = win.sessionStorage.getItem(BALOISE_SESSION_KEY);
|
|
131
|
-
return configStr !== null ? JSON.parse(configStr) : {};
|
|
132
|
-
}
|
|
133
|
-
catch (e) {
|
|
134
|
-
return {};
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const saveConfig = (win, c) => {
|
|
138
|
-
try {
|
|
139
|
-
win.sessionStorage.setItem(BALOISE_SESSION_KEY, JSON.stringify(c));
|
|
140
|
-
}
|
|
141
|
-
catch (e) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const setupConfig = (userConfig = {}, win = {}) => {
|
|
147
|
-
if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
|
|
148
|
-
win = window;
|
|
149
|
-
}
|
|
150
|
-
win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
|
|
151
|
-
config.reset(Object.assign(Object.assign(Object.assign({}, configFromSession(win)), userConfig), { icons: Object.assign(Object.assign({}, configFromSession(win).icons), userConfig.icons) }));
|
|
152
|
-
win.BaloiseDesignSystem.config = config;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
class BalNoticeController {
|
|
156
|
-
constructor(options) {
|
|
157
|
-
this.options = options;
|
|
158
|
-
this.container = null;
|
|
159
|
-
this.queue = [];
|
|
160
|
-
this.preQueue = [];
|
|
161
|
-
this.queueLimit = 5;
|
|
162
|
-
}
|
|
163
|
-
create(options) {
|
|
164
|
-
if (balBrowser.hasDocument) {
|
|
165
|
-
this.setupContainer();
|
|
166
|
-
const clone = this.findClone(options);
|
|
167
|
-
if (clone === undefined) {
|
|
168
|
-
const el = document.createElement(this.options.tag);
|
|
169
|
-
Object.assign(el, options);
|
|
170
|
-
el.addEventListener('balClose', ev => {
|
|
171
|
-
this.removeFromQueue(ev.detail);
|
|
172
|
-
});
|
|
173
|
-
this.preQueue.push(el);
|
|
174
|
-
this.updateQueue();
|
|
175
|
-
return el;
|
|
176
|
-
}
|
|
177
|
-
return clone;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
setQueue(queueLimit) {
|
|
181
|
-
this.queueLimit = queueLimit;
|
|
182
|
-
}
|
|
183
|
-
async dismissAll() {
|
|
184
|
-
var _a;
|
|
185
|
-
const elements = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.options.tag);
|
|
186
|
-
if (elements) {
|
|
187
|
-
const closingQueue = [];
|
|
188
|
-
for (let index = 0; index < elements.length; index++) {
|
|
189
|
-
const el = elements[index];
|
|
190
|
-
if (el.close) {
|
|
191
|
-
closingQueue.push(el.close());
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
await Promise.all(closingQueue);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* @deprecated use dismissAll instead
|
|
199
|
-
*/
|
|
200
|
-
async clearAll() {
|
|
201
|
-
console.warn('[DEPRECATED] - use dismissAll() instead');
|
|
202
|
-
return this.dismissAll();
|
|
203
|
-
}
|
|
204
|
-
findClone(options) {
|
|
205
|
-
for (let index = 0; index < this.queue.length; index++) {
|
|
206
|
-
const el = this.queue[index];
|
|
207
|
-
if (el.message === options.message && el.color === options.color) {
|
|
208
|
-
return el;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return undefined;
|
|
212
|
-
}
|
|
213
|
-
setupContainer() {
|
|
214
|
-
if (balBrowser.hasDocument) {
|
|
215
|
-
const containerId = `${this.options.tag}-container`;
|
|
216
|
-
this.container = document.getElementById(containerId);
|
|
217
|
-
if (this.container)
|
|
218
|
-
return;
|
|
219
|
-
if (!this.container) {
|
|
220
|
-
this.container = document.createElement('bal-notices');
|
|
221
|
-
this.container.setAttribute('interface', this.options.tag.replace('bal-', ''));
|
|
222
|
-
this.container.id = containerId;
|
|
223
|
-
}
|
|
224
|
-
document.body.appendChild(this.container);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
updateQueue() {
|
|
228
|
-
var _a;
|
|
229
|
-
if (this.queue.length < this.queueLimit) {
|
|
230
|
-
const el = this.preQueue.shift();
|
|
231
|
-
if (el && this.container) {
|
|
232
|
-
this.queue.push(el);
|
|
233
|
-
this.container.insertAdjacentElement('beforeend', el);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
if (this.queue.length === 0) {
|
|
237
|
-
(_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
removeFromQueue(toastId) {
|
|
241
|
-
this.queue = this.queue.filter(el => el.id !== toastId);
|
|
242
|
-
setTimeout(() => this.updateQueue(), 0);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
class BalToastController extends BalNoticeController {
|
|
247
|
-
constructor() {
|
|
248
|
-
super({
|
|
249
|
-
tag: 'bal-toast',
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
create(options) {
|
|
253
|
-
return super.create(options);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
const balToastController = new BalToastController();
|
|
257
|
-
|
|
258
|
-
class BalSnackbarController extends BalNoticeController {
|
|
259
|
-
constructor() {
|
|
260
|
-
super({
|
|
261
|
-
tag: 'bal-snackbar',
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
create(options) {
|
|
265
|
-
return super.create(options);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
const balSnackbarController = new BalSnackbarController();
|
|
269
|
-
|
|
270
|
-
// generated by .build/version.js
|
|
271
|
-
const VERSION = '16.4.0-nightly.20240917';
|
|
272
|
-
|
|
273
|
-
const initializeBaloiseDesignSystem = (userConfig = {}, platformConfig = undefined, win = {}) => {
|
|
274
|
-
if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
|
|
275
|
-
win = window;
|
|
276
|
-
}
|
|
277
|
-
win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
|
|
278
|
-
if (platformConfig) {
|
|
279
|
-
setPlatformHelpers(platformConfig);
|
|
280
|
-
}
|
|
281
|
-
setupConfig(Object.assign(Object.assign({}, userConfig), platformConfig), win);
|
|
282
|
-
win.BaloiseDesignSystem.toastController = balToastController;
|
|
283
|
-
win.BaloiseDesignSystem.snackbarController = balSnackbarController;
|
|
284
|
-
win.BaloiseDesignSystem.initialize = () => setupConfig(win.BaloiseDesignSystem.config, win);
|
|
285
|
-
win.BaloiseDesignSystem.version = VERSION;
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
export { BalToastController as B, BalSnackbarController as a, balToastController as b, balSnackbarController as c, initializeBaloiseDesignSystem as i, setupConfig as s };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./p-120f1513.js";function t(){return function(t){const{connectedCallback:c,disconnectedCallback:i}=t;t.connectedCallback=function(){return n.attach(this),c&&c.call(this)},t.disconnectedCallback=function(){return n.detach(this),i&&i.call(this)}}}export{t as L}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,j as s,r as i}from"./p-88f18fbc.js";import{b as e}from"./p-a65354df.js";import{b as h}from"./p-96216bd1.js";import{L as r,S as n}from"./p-acf222fd.js";import{b as o,a,c,d as u,e as l}from"./p-3f4bb3a8.js";class d{constructor(t={}){this.previousWidth=e.window.width,this.previousHeight=e.window.height,this.previousIsLandscape=this.isLandscape,this.options={onlyListenToWidthChanges:!1},this.options=Object.assign(Object.assign({},this.options),t)}async hasResized(){if(h.hasTouchScreen){if(!this.sameWidth||this.previousIsLandscape!==this.isLandscape)return this.resetPreviousValues(),!0}else if(this.options.onlyListenToWidthChanges){if(!this.sameWidth)return this.resetPreviousValues(),!0}else if(!this.sameWidth||!this.sameHeight)return this.resetPreviousValues(),!0;return!1}get isLandscape(){return e.window.width>e.window.height}get sameWidth(){return this.previousWidth===e.window.width}get sameHeight(){return this.previousHeight===e.window.height}resetPreviousValues(){this.previousWidth=e.window.width,this.previousHeight=e.window.height,this.previousIsLandscape=this.isLandscape}}class f extends r{constructor(){super(...arguments),this.resizeHandler=new d({onlyListenToWidthChanges:!0}),this.debouncedNotify=t((()=>this.notify()),100),this.notify=async()=>{await this.resizeHandler.hasResized()&&super.notify(void 0)}}connect(t){super.connect(t),this.el&&s(this.el,"resize",this.debouncedNotify,{passive:!0})}disconnect(){super.disconnect(),this.el&&i(this.el,"resize",this.debouncedNotify)}}const p=t=>parseInt(t.slice(0,-2),10),b=p(l),g=p(o),m=p(a),w=p(c),j=p(u),D=t=>t.innerWidth<b,k=t=>{const s=t.innerWidth;return s>=b&&s<g},v=t=>D(t)||k(t),O={mobile:D,tablet:k,touch:v,desktop:t=>!v(t),highDefinition:t=>{const s=t.innerWidth;return s>=m&&s<w},widescreen:t=>{const s=t.innerWidth;return s>=w&&s<j},fullhd:t=>t.innerWidth>=j};class y{constructor(){this.breakpoints=[],e.hasWindow&&(this.win=window,this.win.BaloiseDesignSystem=this.win.BaloiseDesignSystem||{},this.detect())}get isMobile(){return this.includes("mobile")}get isTablet(){return this.includes("tablet")}get isTouch(){return this.includes("touch")}get isDesktop(){return this.includes("desktop")}get isHighDefinition(){return this.includes("highDefinition")}get isWidescreen(){return this.includes("widescreen")}get isFullHD(){return this.includes("fullhd")}includes(t){var s;return this.detect(),!!(null===(s=this.breakpoints)||void 0===s?void 0:s.includes(t))}detect(){return this.win&&(this.breakpoints=Object.keys(O).filter((t=>O[t](this.win))),this.win.BaloiseDesignSystem.breakpoints=this.breakpoints,this.win.BaloiseDesignSystem.platforms=this.breakpoints),this.breakpoints}toObject(){return{mobile:this.breakpoints.includes("mobile"),tablet:this.breakpoints.includes("tablet"),touch:this.breakpoints.includes("touch"),desktop:this.breakpoints.includes("desktop"),highDefinition:this.breakpoints.includes("highDefinition"),widescreen:this.breakpoints.includes("widescreen"),fullhd:this.breakpoints.includes("fullhd")}}}const L=new y,T={mobile:!1,tablet:!1,touch:!1,desktop:!1,highDefinition:!1,widescreen:!1,fullhd:!1};class W extends n{constructor(){super((t=>t.breakpointListener(this.state))),this.state=T,this.listener=new f,this.debouncedNotify=t((()=>this.notify()),50),this.listener.connect(),this.listener.add((()=>{L.detect();const t=L.toObject();this.isEqual(t)||(this.state=t,this.debouncedNotify())}))}attach(t){super.attach(t),L.detect();const s=L.toObject();this.isEqual(s)||(this.state=s,this.debouncedNotify())}isEqual(t){return JSON.stringify(this.state)===JSON.stringify(t)}}const x=new W;export{f as B,x as a,L as b,W as c,y as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-f959646a.system.js"],(function(t){"use strict";var e;return{setters:[function(t){e=t.g}],execute:function(){var s=t("g",e)}}}));
|