@baloise/ds-core 0.0.6-snapshot.31-c372201 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +1 -1
  2. package/components/bal-app.js +85 -1
  3. package/components/index.js +282 -5
  4. package/components/tokens.esm.js +1 -1
  5. package/dist/cjs/{global-e99d827b.js → app-globals-96247350.js} +4 -2
  6. package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
  7. package/dist/cjs/bal-datepicker.cjs.entry.js +3 -3
  8. package/dist/cjs/bal-hint_3.cjs.entry.js +3 -3
  9. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  10. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  11. package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
  12. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  13. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  14. package/dist/cjs/bal-popover_2.cjs.entry.js +3 -3
  15. package/dist/cjs/bal-progress-bar.cjs.entry.js +3 -3
  16. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  17. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  18. package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
  19. package/dist/cjs/{breakpoints.decorator-9d7d71a0.js → breakpoints.decorator-7a48a535.js} +1 -1
  20. package/dist/cjs/{breakpoints.subject-844ff738.js → breakpoints.subject-af1d8c72.js} +1 -1
  21. package/dist/cjs/design-system-components.cjs.js +2 -3
  22. package/dist/cjs/index.cjs.js +2 -2
  23. package/dist/cjs/initialize-9c752efa.js +1 -1
  24. package/dist/cjs/loader.cjs.js +2 -3
  25. package/dist/cjs/{tokens.esm-f053783e.js → tokens.esm-76598eb1.js} +1 -1
  26. package/dist/collection/collection-manifest.json +1 -2
  27. package/dist/collection/utils/constants/version.constant.js +1 -1
  28. package/dist/design-system-components/design-system-components.esm.js +1 -1
  29. package/dist/design-system-components/design-system-components.js +1 -1
  30. package/dist/design-system-components/index.esm.js +1 -1
  31. package/dist/design-system-components/{p-80abbd0778.entry.js → p-010ec812c4.entry.js} +1 -1
  32. package/dist/design-system-components/{p-f91940fa22.entry.js → p-0816ed3b1e.entry.js} +1 -1
  33. package/dist/design-system-components/{p-017a718cde.system.entry.js → p-088c1901f3.system.entry.js} +1 -1
  34. package/dist/design-system-components/{p-ed947f6b13.system.entry.js → p-10749b8aa1.system.entry.js} +1 -1
  35. package/dist/design-system-components/{p-051f8a1a.system.js → p-14bd447f.system.js} +1 -1
  36. package/dist/design-system-components/{p-567f90d72b.system.entry.js → p-1f9623a390.system.entry.js} +1 -1
  37. package/dist/design-system-components/{p-79a1a40d2e.entry.js → p-22a57e0b19.entry.js} +1 -1
  38. package/dist/design-system-components/p-238f1f34.js +1 -0
  39. package/dist/design-system-components/{p-5571e98fa0.system.entry.js → p-2752fcda73.system.entry.js} +1 -1
  40. package/dist/design-system-components/{p-4491887a3e.entry.js → p-349fbc2945.entry.js} +1 -1
  41. package/dist/design-system-components/{p-d7eaa0028d.system.entry.js → p-454e0dd682.system.entry.js} +1 -1
  42. package/dist/design-system-components/{p-c1fd22b574.system.entry.js → p-47da3396ab.system.entry.js} +1 -1
  43. package/dist/design-system-components/{p-3c9848646e.system.entry.js → p-4c4c7c9b0e.system.entry.js} +1 -1
  44. package/dist/design-system-components/p-50f12cb1.system.js +1 -1
  45. package/dist/design-system-components/{p-31f6ede7f1.entry.js → p-513d70f3d2.entry.js} +1 -1
  46. package/dist/design-system-components/p-66904dc1.js +1 -1
  47. package/dist/design-system-components/{p-b4fa2a9a02.system.entry.js → p-88f413ae40.system.entry.js} +1 -1
  48. package/dist/design-system-components/{p-06057510f1.entry.js → p-9107533b4c.entry.js} +1 -1
  49. package/dist/design-system-components/{p-dfc19799.system.js → p-949a7983.system.js} +1 -1
  50. package/dist/design-system-components/{p-223a4c9909.entry.js → p-969c839e39.entry.js} +1 -1
  51. package/dist/design-system-components/{p-e35e2871.system.js → p-9eb5c1e3.system.js} +1 -1
  52. package/dist/design-system-components/{p-fc4c387550.system.entry.js → p-9f468e4f44.system.entry.js} +1 -1
  53. package/dist/design-system-components/p-9f5e39e1.system.js +1 -0
  54. package/dist/design-system-components/{p-23f781d6ca.entry.js → p-a8044d5572.entry.js} +1 -1
  55. package/dist/design-system-components/{p-48b61eba2c.entry.js → p-ac640448e9.entry.js} +1 -1
  56. package/dist/design-system-components/{p-7a23801d02.entry.js → p-acbf7c8ccb.entry.js} +1 -1
  57. package/dist/design-system-components/{p-d3500331.system.js → p-b4fede2d.system.js} +1 -1
  58. package/dist/design-system-components/{p-15937ccfd1.entry.js → p-b6412e1b6c.entry.js} +1 -1
  59. package/dist/design-system-components/p-c299979f2d.entry.js +1 -0
  60. package/dist/design-system-components/{p-3d6fcae8e4.entry.js → p-cb1b686764.entry.js} +1 -1
  61. package/dist/design-system-components/{p-8fc6e4b198.system.entry.js → p-dd13f5cf06.system.entry.js} +1 -1
  62. package/dist/design-system-components/{p-9c5ee5e901.system.entry.js → p-dd1c6925d4.system.entry.js} +1 -1
  63. package/dist/design-system-components/{p-a1b9ea94.js → p-e3141def.js} +1 -1
  64. package/dist/design-system-components/{p-9cc8540f2f.system.entry.js → p-ef2af06bb9.system.entry.js} +1 -1
  65. package/dist/design-system-components/{p-8332986d81.system.entry.js → p-f584a70da4.system.entry.js} +1 -1
  66. package/dist/design-system-components/p-f894ab25.js +1 -0
  67. package/dist/esm/{global-648bb593.js → app-globals-04db8eba.js} +4 -2
  68. package/dist/esm/bal-carousel_2.entry.js +3 -3
  69. package/dist/esm/bal-datepicker.entry.js +3 -3
  70. package/dist/esm/bal-hint_3.entry.js +3 -3
  71. package/dist/esm/bal-list_8.entry.js +3 -3
  72. package/dist/esm/bal-logo.entry.js +3 -3
  73. package/dist/esm/bal-nav_8.entry.js +3 -3
  74. package/dist/esm/bal-navbar_5.entry.js +3 -3
  75. package/dist/esm/bal-pagination.entry.js +3 -3
  76. package/dist/esm/bal-popover_2.entry.js +3 -3
  77. package/dist/esm/bal-progress-bar.entry.js +3 -3
  78. package/dist/esm/bal-shape.entry.js +1 -1
  79. package/dist/esm/bal-steps.entry.js +3 -3
  80. package/dist/esm/bal-tab-item_2.entry.js +3 -3
  81. package/dist/esm/{breakpoints.decorator-6ca427f3.js → breakpoints.decorator-8481b9e7.js} +1 -1
  82. package/dist/esm/{breakpoints.subject-b774dd0d.js → breakpoints.subject-833d3942.js} +1 -1
  83. package/dist/esm/design-system-components.js +2 -3
  84. package/dist/esm/index.js +3 -3
  85. package/dist/esm/initialize-ff8054a2.js +1 -1
  86. package/dist/esm/loader.js +2 -3
  87. package/dist/esm/{tokens.esm-34ed37fb.js → tokens.esm-6caa2d1c.js} +1 -1
  88. package/dist/esm-es5/app-globals-04db8eba.js +1 -0
  89. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  90. package/dist/esm-es5/bal-datepicker.entry.js +1 -1
  91. package/dist/esm-es5/bal-hint_3.entry.js +1 -1
  92. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  93. package/dist/esm-es5/bal-logo.entry.js +1 -1
  94. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  95. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  96. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  97. package/dist/esm-es5/bal-popover_2.entry.js +1 -1
  98. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  99. package/dist/esm-es5/bal-shape.entry.js +1 -1
  100. package/dist/esm-es5/bal-steps.entry.js +1 -1
  101. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  102. package/dist/esm-es5/{breakpoints.decorator-6ca427f3.js → breakpoints.decorator-8481b9e7.js} +1 -1
  103. package/dist/esm-es5/{breakpoints.subject-b774dd0d.js → breakpoints.subject-833d3942.js} +1 -1
  104. package/dist/esm-es5/design-system-components.js +1 -1
  105. package/dist/esm-es5/index.js +1 -1
  106. package/dist/esm-es5/initialize-ff8054a2.js +1 -1
  107. package/dist/esm-es5/loader.js +1 -1
  108. package/dist/types/components.d.ts +0 -37
  109. package/package.json +7 -7
  110. package/components/bal-app2.js +0 -87
  111. package/components/bal-doc-app.d.ts +0 -11
  112. package/components/bal-doc-app.js +0 -260
  113. package/components/initialize.js +0 -281
  114. package/dist/cjs/app-globals-96827f05.js +0 -7
  115. package/dist/cjs/bal-doc-app.cjs.entry.js +0 -231
  116. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +0 -1
  117. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +0 -229
  118. package/dist/design-system-components/p-01ebb73de9.entry.js +0 -1
  119. package/dist/design-system-components/p-4be23942.js +0 -1
  120. package/dist/design-system-components/p-787f9258.system.js +0 -1
  121. package/dist/design-system-components/p-a103798ffa.entry.js +0 -1
  122. package/dist/design-system-components/p-adff9a327e.system.entry.js +0 -1
  123. package/dist/design-system-components/p-bafa7b4e.js +0 -1
  124. package/dist/design-system-components/p-bfbc64f2.js +0 -1
  125. package/dist/design-system-components/p-fc586c6a.system.js +0 -1
  126. package/dist/esm/app-globals-46c15307.js +0 -5
  127. package/dist/esm/bal-doc-app.entry.js +0 -227
  128. package/dist/esm-es5/app-globals-46c15307.js +0 -1
  129. package/dist/esm-es5/bal-doc-app.entry.js +0 -1
  130. package/dist/esm-es5/global-648bb593.js +0 -1
  131. package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +0 -21
  132. package/dist/types/home/runner/work/ds-playground/ds-playground/packages/core/.stencil/packages/icons/src/index.d.ts +0 -81
  133. /package/dist/design-system-components/{p-2cdb82af.system.js → p-3632b713.system.js} +0 -0
  134. /package/dist/design-system-components/{p-0e5f99ee.js → p-37c1d2f2.js} +0 -0
  135. /package/dist/esm-es5/{tokens.esm-34ed37fb.js → tokens.esm-6caa2d1c.js} +0 -0
@@ -1,281 +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
- attach(observer) {
70
- const isExist = this._observers.includes(observer);
71
- if (isExist) {
72
- return console.log('Subject: Observer has been attached already.');
73
- }
74
- this._observers.push(observer);
75
- observer.configChanged(this._config);
76
- }
77
- detach(observer) {
78
- const observerIndex = this._observers.indexOf(observer);
79
- if (observerIndex === -1) {
80
- return console.log('Subject: Nonexistent observer.');
81
- }
82
- this._observers.splice(observerIndex, 1);
83
- }
84
- attachComponent(observer) {
85
- const isExist = this._componentObservers.includes(observer);
86
- if (isExist) {
87
- return console.log('Subject: Observer has been attached already.');
88
- }
89
- this._componentObservers.push(observer);
90
- observer.configChanged(this._config);
91
- }
92
- detachComponent(observer) {
93
- const observerIndex = this._componentObservers.indexOf(observer);
94
- if (observerIndex === -1) {
95
- return console.log('Subject: Nonexistent observer.');
96
- }
97
- this._componentObservers.splice(observerIndex, 1);
98
- }
99
- toString() {
100
- return JSON.stringify(this._config);
101
- }
102
- reset(config) {
103
- this._config = Object.assign(Object.assign(Object.assign({}, this._config), config), { icons: Object.assign(Object.assign({}, this._config.icons), config.icons) });
104
- this._notify(false);
105
- }
106
- _notify(all = true) {
107
- for (const observer of this._componentObservers) {
108
- observer.configChanged(this._config);
109
- }
110
- if (all) {
111
- for (const observer of this._observers) {
112
- observer.configChanged(this._config);
113
- }
114
- }
115
- if (balBrowser.hasWindow) {
116
- saveConfig(window, this._config);
117
- }
118
- }
119
- }
120
- const config = /*@__PURE__*/ new Config();
121
- const configFromSession = (win) => {
122
- try {
123
- const configStr = win.sessionStorage.getItem(BALOISE_SESSION_KEY);
124
- return configStr !== null ? JSON.parse(configStr) : {};
125
- }
126
- catch (e) {
127
- return {};
128
- }
129
- };
130
- const saveConfig = (win, c) => {
131
- try {
132
- win.sessionStorage.setItem(BALOISE_SESSION_KEY, JSON.stringify(c));
133
- }
134
- catch (e) {
135
- return;
136
- }
137
- };
138
-
139
- const setupConfig = (userConfig = {}, win = {}) => {
140
- if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
141
- win = window;
142
- }
143
- win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
144
- config.reset(Object.assign(Object.assign(Object.assign({}, configFromSession(win)), userConfig), { icons: Object.assign(Object.assign({}, configFromSession(win).icons), userConfig.icons) }));
145
- win.BaloiseDesignSystem.config = config;
146
- };
147
-
148
- class BalNoticeController {
149
- constructor(options) {
150
- this.options = options;
151
- this.container = null;
152
- this.queue = [];
153
- this.preQueue = [];
154
- this.queueLimit = 5;
155
- }
156
- create(options) {
157
- if (balBrowser.hasDocument) {
158
- this.setupContainer();
159
- const clone = this.findClone(options);
160
- if (clone === undefined) {
161
- const el = document.createElement(this.options.tag);
162
- Object.assign(el, options);
163
- el.addEventListener('balClose', ev => {
164
- this.removeFromQueue(ev.detail);
165
- });
166
- this.preQueue.push(el);
167
- this.updateQueue();
168
- return el;
169
- }
170
- return clone;
171
- }
172
- }
173
- setQueue(queueLimit) {
174
- this.queueLimit = queueLimit;
175
- }
176
- async dismissAll() {
177
- var _a;
178
- const elements = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.options.tag);
179
- if (elements) {
180
- const closingQueue = [];
181
- for (let index = 0; index < elements.length; index++) {
182
- const el = elements[index];
183
- if (el.close) {
184
- closingQueue.push(el.close());
185
- }
186
- }
187
- await Promise.all(closingQueue);
188
- }
189
- }
190
- /**
191
- * @deprecated use dismissAll instead
192
- */
193
- async clearAll() {
194
- console.warn('[DEPRECATED] - use dismissAll() instead');
195
- return this.dismissAll();
196
- }
197
- findClone(options) {
198
- for (let index = 0; index < this.queue.length; index++) {
199
- const el = this.queue[index];
200
- if (el.message === options.message && el.color === options.color) {
201
- return el;
202
- }
203
- }
204
- return undefined;
205
- }
206
- setupContainer() {
207
- if (balBrowser.hasDocument) {
208
- const containerId = `${this.options.tag}-container`;
209
- this.container = document.getElementById(containerId);
210
- if (this.container)
211
- return;
212
- if (!this.container) {
213
- this.container = document.createElement('bal-notices');
214
- this.container.setAttribute('interface', this.options.tag.replace('bal-', ''));
215
- this.container.id = containerId;
216
- }
217
- document.body.appendChild(this.container);
218
- }
219
- }
220
- updateQueue() {
221
- var _a;
222
- if (this.queue.length < this.queueLimit) {
223
- const el = this.preQueue.shift();
224
- if (el && this.container) {
225
- this.queue.push(el);
226
- this.container.insertAdjacentElement('beforeend', el);
227
- }
228
- }
229
- if (this.queue.length === 0) {
230
- (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
231
- }
232
- }
233
- removeFromQueue(toastId) {
234
- this.queue = this.queue.filter(el => el.id !== toastId);
235
- setTimeout(() => this.updateQueue(), 0);
236
- }
237
- }
238
-
239
- class BalToastController extends BalNoticeController {
240
- constructor() {
241
- super({
242
- tag: 'bal-toast',
243
- });
244
- }
245
- create(options) {
246
- return super.create(options);
247
- }
248
- }
249
- const balToastController = new BalToastController();
250
-
251
- class BalSnackbarController extends BalNoticeController {
252
- constructor() {
253
- super({
254
- tag: 'bal-snackbar',
255
- });
256
- }
257
- create(options) {
258
- return super.create(options);
259
- }
260
- }
261
- const balSnackbarController = new BalSnackbarController();
262
-
263
- // generated by .build/version.js
264
- const VERSION = 'BAL_DEV_VERSION';
265
-
266
- const initializeBaloiseDesignSystem = (userConfig = {}, platformConfig = undefined, win = {}) => {
267
- if (Object.keys(win).length === 0 && balBrowser.hasWindow) {
268
- win = window;
269
- }
270
- win.BaloiseDesignSystem = win.BaloiseDesignSystem || {};
271
- if (platformConfig) {
272
- setPlatformHelpers(platformConfig);
273
- }
274
- setupConfig(Object.assign(Object.assign({}, userConfig), platformConfig), win);
275
- win.BaloiseDesignSystem.toastController = balToastController;
276
- win.BaloiseDesignSystem.snackbarController = balSnackbarController;
277
- win.BaloiseDesignSystem.initialize = () => setupConfig(win.BaloiseDesignSystem.config, win);
278
- win.BaloiseDesignSystem.version = VERSION;
279
- };
280
-
281
- export { BalToastController as B, BalSnackbarController as a, balToastController as b, balSnackbarController as c, initializeBaloiseDesignSystem as i, setupConfig as s };
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- const globalImport = require('./global-e99d827b.js');
4
-
5
- const globalScripts = globalImport.globalScript;
6
-
7
- exports.globalScripts = globalScripts;