@baloise/ds-core 16.1.0-nightly.20240516 → 16.2.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.
Files changed (201) hide show
  1. package/components/all.d.ts +0 -2
  2. package/components/all.js +0 -3
  3. package/components/bal-app.js +85 -1
  4. package/components/bal-date.js +3 -1
  5. package/components/bal-footer.js +7 -2
  6. package/components/bal-input-date2.js +15 -3
  7. package/components/index.js +290 -5
  8. package/components/mask-util.js +3 -0
  9. package/components/scroll.js +1 -1
  10. package/components/tokens.esm.js +1 -1
  11. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  12. package/dist/baloise-design-system/baloise-design-system.js +1 -1
  13. package/dist/baloise-design-system/index.esm.js +1 -1
  14. package/dist/baloise-design-system/{p-f959646a.system.js → p-013b4c72.system.js} +1 -1
  15. package/dist/baloise-design-system/{p-12e6222708.entry.js → p-14c1efdb08.entry.js} +1 -1
  16. package/dist/baloise-design-system/p-1509eaa7.system.js +1 -1
  17. package/dist/baloise-design-system/p-1a158488.js +1 -0
  18. package/dist/baloise-design-system/{p-6655383a97.entry.js → p-1cae0f6215.entry.js} +1 -1
  19. package/dist/baloise-design-system/{p-f233fe25.system.js → p-1d351673.system.js} +1 -1
  20. package/dist/baloise-design-system/{p-d3b7f290c9.entry.js → p-2a0359206a.entry.js} +1 -1
  21. package/dist/baloise-design-system/{p-e9ae0323bf.entry.js → p-2e9f9838d0.entry.js} +1 -1
  22. package/dist/baloise-design-system/{p-c03fa59efc.entry.js → p-35697fd842.entry.js} +1 -1
  23. package/dist/baloise-design-system/{p-9dc5cb62e3.system.entry.js → p-3586f88589.system.entry.js} +1 -1
  24. package/dist/baloise-design-system/{p-13d0473d5c.entry.js → p-3e3240a165.entry.js} +1 -1
  25. package/dist/baloise-design-system/{p-84d97c84.system.js → p-4122160f.system.js} +1 -1
  26. package/dist/baloise-design-system/p-42bff14b.system.js +1 -0
  27. package/dist/baloise-design-system/p-45e0c0783b.entry.js +1 -0
  28. package/dist/baloise-design-system/{p-2624559a.system.js → p-46962c31.system.js} +1 -1
  29. package/dist/baloise-design-system/p-4afba8511a.system.entry.js +1 -0
  30. package/dist/baloise-design-system/{p-b30852e875.system.entry.js → p-4ba5509697.system.entry.js} +1 -1
  31. package/dist/baloise-design-system/p-51c0348938.entry.js +1 -0
  32. package/dist/baloise-design-system/{p-64a06bb628.entry.js → p-53b032957c.entry.js} +1 -1
  33. package/dist/baloise-design-system/{p-47a3898e82.system.entry.js → p-542d4ba42e.system.entry.js} +1 -1
  34. package/dist/baloise-design-system/p-54f81c32.js +1 -1
  35. package/dist/baloise-design-system/{p-2f5dca902b.entry.js → p-594ed43172.entry.js} +1 -1
  36. package/dist/baloise-design-system/{p-4232c923c3.system.entry.js → p-5b9789ea9b.system.entry.js} +1 -1
  37. package/dist/baloise-design-system/p-5f26e92f.system.js +1 -0
  38. package/dist/baloise-design-system/{p-195585f39c.entry.js → p-6b62dde878.entry.js} +1 -1
  39. package/dist/baloise-design-system/{p-53cee50940.system.entry.js → p-6cec985f79.system.entry.js} +1 -1
  40. package/dist/baloise-design-system/{p-58fc8247.js → p-6e0f125e.js} +1 -1
  41. package/dist/baloise-design-system/p-6f4a362824.system.entry.js +1 -0
  42. package/dist/baloise-design-system/{p-947b33f7.js → p-71109949.js} +1 -1
  43. package/dist/baloise-design-system/{p-d6aa526659.entry.js → p-7dc6846c06.entry.js} +1 -1
  44. package/dist/baloise-design-system/{p-e945d757c9.system.entry.js → p-7e909d3137.system.entry.js} +1 -1
  45. package/dist/baloise-design-system/{p-86eeae36fa.system.entry.js → p-90aa7db300.system.entry.js} +1 -1
  46. package/dist/baloise-design-system/{p-f4cd3ba2f0.entry.js → p-ae372094d2.entry.js} +1 -1
  47. package/dist/baloise-design-system/{p-4c799e91b1.system.entry.js → p-b1227cb400.system.entry.js} +1 -1
  48. package/dist/baloise-design-system/p-ba14aa7026.system.entry.js +1 -0
  49. package/dist/baloise-design-system/p-bcca1ed3.system.js +1 -0
  50. package/dist/baloise-design-system/{p-dc3bfd6ee9.system.entry.js → p-bff4f2e518.system.entry.js} +1 -1
  51. package/dist/baloise-design-system/{p-3d0159890b.system.entry.js → p-c907685cee.system.entry.js} +1 -1
  52. package/dist/baloise-design-system/p-cef24f8c62.entry.js +1 -0
  53. package/dist/baloise-design-system/{p-67eab4f8cb.system.entry.js → p-d458e5e328.system.entry.js} +1 -1
  54. package/dist/baloise-design-system/{p-1facd2a3f2.entry.js → p-dc45a57023.entry.js} +1 -1
  55. package/dist/baloise-design-system/{p-00553c7763.system.entry.js → p-e18c0e64a7.system.entry.js} +1 -1
  56. package/dist/baloise-design-system/{p-4703a74f25.system.entry.js → p-e3ef34506f.system.entry.js} +1 -1
  57. package/dist/baloise-design-system/p-e78a6409.js +1 -0
  58. package/dist/baloise-design-system/{p-c7cd363617.entry.js → p-e7bd7e7c5d.entry.js} +1 -1
  59. package/dist/baloise-design-system/{p-2334f35b62.entry.js → p-e7f7fee312.entry.js} +1 -1
  60. package/dist/baloise-design-system/{p-2d830440.js → p-eb10ad25.js} +1 -1
  61. package/dist/baloise-design-system/{p-e68999cd51.system.entry.js → p-f4e7710a45.system.entry.js} +1 -1
  62. package/dist/cjs/{global-2562a984.js → app-globals-ae3a8623.js} +4 -2
  63. package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
  64. package/dist/cjs/bal-date-calendar_2.cjs.entry.js +14 -3
  65. package/dist/cjs/bal-date.cjs.entry.js +2 -1
  66. package/dist/cjs/bal-datepicker.cjs.entry.js +3 -3
  67. package/dist/cjs/bal-footer.cjs.entry.js +7 -2
  68. package/dist/cjs/bal-hint_3.cjs.entry.js +4 -4
  69. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  70. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  71. package/dist/cjs/bal-modal_3.cjs.entry.js +1 -1
  72. package/dist/cjs/bal-nav_8.cjs.entry.js +4 -4
  73. package/dist/cjs/bal-navbar_5.cjs.entry.js +4 -4
  74. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  75. package/dist/cjs/bal-popover_2.cjs.entry.js +3 -3
  76. package/dist/cjs/bal-progress-bar.cjs.entry.js +3 -3
  77. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  78. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  79. package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
  80. package/dist/cjs/baloise-design-system.cjs.js +2 -3
  81. package/dist/cjs/{breakpoints.decorator-1af22a0b.js → breakpoints.decorator-555e2caf.js} +1 -1
  82. package/dist/cjs/{breakpoints.subject-92d5b596.js → breakpoints.subject-0d00c248.js} +1 -1
  83. package/dist/cjs/index.cjs.js +5 -3
  84. package/dist/cjs/initialize-2a19d091.js +1 -1
  85. package/dist/cjs/loader.cjs.js +2 -3
  86. package/dist/cjs/mask-util-19c28b4a.js +5 -0
  87. package/dist/cjs/{scroll-b839ffe1.js → scroll-5d6ac91d.js} +1 -1
  88. package/dist/cjs/{tokens.esm-c267b8b2.js → tokens.esm-93d7e2f7.js} +1 -1
  89. package/dist/collection/collection-manifest.json +1 -2
  90. package/dist/collection/components/bal-date/bal-date.js +21 -2
  91. package/dist/collection/components/bal-footer/bal-footer.css +1 -1
  92. package/dist/collection/components/bal-footer/bal-footer.js +6 -1
  93. package/dist/collection/components/bal-input/bal-input-date/bal-input-date.js +19 -0
  94. package/dist/collection/components/bal-select/bal-select.js +1 -1
  95. package/dist/collection/index.js +1 -0
  96. package/dist/collection/utils/constants/version.constant.js +1 -1
  97. package/dist/collection/utils/mask/__test__/mask-component.mock.js +1 -0
  98. package/dist/collection/utils/mask/context/mask-context.js +1 -0
  99. package/dist/collection/utils/mask/mask-util.js +1 -0
  100. package/dist/collection/utils/mask/mask.js +2 -2
  101. package/dist/collection/utils/mask/types/mask-date.js +10 -1
  102. package/dist/collection/utils/scroll.js +1 -1
  103. package/dist/esm/{global-63f4bcec.js → app-globals-b0dd0fc4.js} +4 -2
  104. package/dist/esm/bal-carousel_2.entry.js +3 -3
  105. package/dist/esm/bal-date-calendar_2.entry.js +14 -3
  106. package/dist/esm/bal-date.entry.js +2 -1
  107. package/dist/esm/bal-datepicker.entry.js +3 -3
  108. package/dist/esm/bal-footer.entry.js +7 -2
  109. package/dist/esm/bal-hint_3.entry.js +4 -4
  110. package/dist/esm/bal-list_8.entry.js +3 -3
  111. package/dist/esm/bal-logo.entry.js +3 -3
  112. package/dist/esm/bal-modal_3.entry.js +1 -1
  113. package/dist/esm/bal-nav_8.entry.js +4 -4
  114. package/dist/esm/bal-navbar_5.entry.js +4 -4
  115. package/dist/esm/bal-pagination.entry.js +3 -3
  116. package/dist/esm/bal-popover_2.entry.js +3 -3
  117. package/dist/esm/bal-progress-bar.entry.js +3 -3
  118. package/dist/esm/bal-shape.entry.js +1 -1
  119. package/dist/esm/bal-steps.entry.js +3 -3
  120. package/dist/esm/bal-tab-item_2.entry.js +3 -3
  121. package/dist/esm/baloise-design-system.js +2 -3
  122. package/dist/esm/{breakpoints.decorator-4adc321a.js → breakpoints.decorator-dad33c75.js} +1 -1
  123. package/dist/esm/{breakpoints.subject-a1204db2.js → breakpoints.subject-ba72fe99.js} +1 -1
  124. package/dist/esm/index.js +5 -4
  125. package/dist/esm/initialize-e216cfe4.js +1 -1
  126. package/dist/esm/loader.js +2 -3
  127. package/dist/esm/mask-util-71edc2b8.js +3 -0
  128. package/dist/esm/{scroll-972c7ce5.js → scroll-e341d95b.js} +1 -1
  129. package/dist/esm/{tokens.esm-1091fd9b.js → tokens.esm-366a5b1e.js} +1 -1
  130. package/dist/esm-es5/app-globals-b0dd0fc4.js +1 -0
  131. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  132. package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
  133. package/dist/esm-es5/bal-date.entry.js +1 -1
  134. package/dist/esm-es5/bal-datepicker.entry.js +1 -1
  135. package/dist/esm-es5/bal-footer.entry.js +1 -1
  136. package/dist/esm-es5/bal-hint_3.entry.js +1 -1
  137. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  138. package/dist/esm-es5/bal-logo.entry.js +1 -1
  139. package/dist/esm-es5/bal-modal_3.entry.js +1 -1
  140. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  141. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  142. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  143. package/dist/esm-es5/bal-popover_2.entry.js +1 -1
  144. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  145. package/dist/esm-es5/bal-shape.entry.js +1 -1
  146. package/dist/esm-es5/bal-steps.entry.js +1 -1
  147. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  148. package/dist/esm-es5/baloise-design-system.js +1 -1
  149. package/dist/esm-es5/breakpoints.decorator-dad33c75.js +1 -0
  150. package/dist/esm-es5/{breakpoints.subject-a1204db2.js → breakpoints.subject-ba72fe99.js} +1 -1
  151. package/dist/esm-es5/index.js +1 -1
  152. package/dist/esm-es5/initialize-e216cfe4.js +1 -1
  153. package/dist/esm-es5/loader.js +1 -1
  154. package/dist/esm-es5/mask-util-71edc2b8.js +1 -0
  155. package/dist/esm-es5/{scroll-972c7ce5.js → scroll-e341d95b.js} +1 -1
  156. package/dist/html.html-data.json +10 -2
  157. package/dist/types/components/bal-date/bal-date.d.ts +5 -1
  158. package/dist/types/components/bal-footer/bal-footer.d.ts +1 -0
  159. package/dist/types/components/bal-input/bal-input-date/bal-input-date.d.ts +4 -0
  160. package/dist/types/components/bal-select/bal-select.d.ts +1 -1
  161. package/dist/types/components.d.ts +20 -41
  162. package/dist/types/index.d.ts +1 -0
  163. package/dist/types/utils/mask/__test__/mask-component.mock.d.ts +1 -0
  164. package/dist/types/utils/mask/component/mask-component-interfaces.d.ts +1 -0
  165. package/dist/types/utils/mask/context/mask-context.d.ts +2 -0
  166. package/dist/types/utils/mask/mask-util.d.ts +1 -0
  167. package/dist/types/utils/mask/mask.d.ts +3 -1
  168. package/dist/types/utils/mask/types/mask-date.d.ts +3 -1
  169. package/package.json +7 -7
  170. package/components/bal-app2.js +0 -87
  171. package/components/bal-doc-app.d.ts +0 -11
  172. package/components/bal-doc-app.js +0 -260
  173. package/components/initialize.js +0 -288
  174. package/dist/baloise-design-system/p-06e9a468fc.system.entry.js +0 -1
  175. package/dist/baloise-design-system/p-18e2e391e0.system.entry.js +0 -1
  176. package/dist/baloise-design-system/p-317cee9b56.system.entry.js +0 -1
  177. package/dist/baloise-design-system/p-360068a4.system.js +0 -1
  178. package/dist/baloise-design-system/p-5b571a9fb1.entry.js +0 -1
  179. package/dist/baloise-design-system/p-6648acba05.entry.js +0 -1
  180. package/dist/baloise-design-system/p-6d1b6215.js +0 -1
  181. package/dist/baloise-design-system/p-7291766c.system.js +0 -1
  182. package/dist/baloise-design-system/p-7c42a363f3.entry.js +0 -1
  183. package/dist/baloise-design-system/p-b9f197815f.entry.js +0 -1
  184. package/dist/baloise-design-system/p-e4de708de1.system.entry.js +0 -1
  185. package/dist/baloise-design-system/p-e8ffddeb.js +0 -1
  186. package/dist/baloise-design-system/p-f961ac52.system.js +0 -1
  187. package/dist/cjs/app-globals-5fd73c0c.js +0 -7
  188. package/dist/cjs/bal-doc-app.cjs.entry.js +0 -231
  189. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +0 -1
  190. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +0 -229
  191. package/dist/esm/app-globals-970bab17.js +0 -5
  192. package/dist/esm/bal-doc-app.entry.js +0 -227
  193. package/dist/esm-es5/app-globals-970bab17.js +0 -1
  194. package/dist/esm-es5/bal-doc-app.entry.js +0 -1
  195. package/dist/esm-es5/breakpoints.decorator-4adc321a.js +0 -1
  196. package/dist/esm-es5/global-63f4bcec.js +0 -1
  197. package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +0 -21
  198. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +0 -81
  199. /package/dist/baloise-design-system/{p-4ae802f4.system.js → p-448185d8.system.js} +0 -0
  200. /package/dist/baloise-design-system/{p-cf875c54.js → p-5e1cb403.js} +0 -0
  201. /package/dist/esm-es5/{tokens.esm-1091fd9b.js → tokens.esm-366a5b1e.js} +0 -0
@@ -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.1.0-nightly.20240516';
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
- var __awaiter=this&&this.__awaiter||function(t,i,n,e){function r(t){return t instanceof n?t:new n((function(i){i(t)}))}return new(n||(n=Promise))((function(n,s){function a(t){try{o(e.next(t))}catch(t){s(t)}}function u(t){try{o(e["throw"](t))}catch(t){s(t)}}function o(t){t.done?n(t.value):r(t.value).then(a,u)}o((e=e.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,r,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(i){return o([t,i])}}function o(u){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(n=0)),n)try{if(e=1,r&&(s=u[0]&2?r["return"]:u[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,u[1])).done)return s;if(r=0,s)u=[u[0]&2,s.value];switch(u[0]){case 0:case 1:s=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;r=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1];s=u;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(u);break}if(s[2])n.ops.pop();n.trys.pop();continue}u=i.call(t,n)}catch(t){u=[6,t];r=0}finally{e=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-456fc561.system.js","./p-6dbef894.system.js","./p-8a87b9a8.system.js","./p-f8c5e9e7.system.js","./p-55faac1d.system.js","./p-db0895e2.system.js","./p-23bdd8dc.system.js","./p-8949aa8b.system.js","./p-d2ee9b0a.system.js","./p-8954495d.system.js","./p-6e5745c8.system.js","./p-bb6304d0.system.js","./p-0177e3a0.system.js","./p-6913b916.system.js","./p-2880433e.system.js","./p-145d5c4e.system.js","./p-a1f6e944.system.js","./p-b3f2c626.system.js"],(function(t){"use strict";var i,n,e,r,s,a,u,o,h,c,f,d,l,p,v,b,_,m,w,y,g,j;return{setters:[function(t){i=t.r;n=t.c;e=t.h;r=t.H;s=t.g},function(t){a=t._;u=t.a},function(t){o=t.e},function(t){h=t.a;c=t.c;f=t.o;d=t.f},function(t){l=t.B;p=t.i},function(t){v=t.B},function(t){b=t.L},function(t){_=t.i},function(t){m=t.s},function(t){w=t.m},function(t){y=t.d},function(t){g=t.d},function(t){j=t.L},function(){},function(){},function(){},function(){},function(){}],execute:function(){var x=":root{--bal-date-popup-z-index:var(--bal-z-index-tooltip);--bal-date-popup-shadow:var(--bal-shadow-normal);--bal-date-popup-radius:var(--bal-radius-normal)}:root{--bal-z-index-tooltip:1300}.bal-date{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-date__icon--clickable{cursor:pointer}.bal-date__popup{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;position:absolute;top:0;left:0;z-index:var(--bal-date-popup-z-index);-webkit-box-shadow:var(--bal-date-popup-shadow);box-shadow:var(--bal-date-popup-shadow);border-radius:var(--bal-date-popup-radius)}.bal-date__popup--visible{display:block}";var k=x;var O=t("bal_date",function(){function t(t){var e=this;i(this,t);this.balInput=n(this,"balInput",7);this.balChange=n(this,"balChange",7);this.balWillAnimate=n(this,"balWillAnimate",7);this.balDidAnimate=n(this,"balDidAnimate",7);this.balBlur=n(this,"balBlur",7);this.balFocus=n(this,"balFocus",7);this.balInputClick=n(this,"balInputClick",7);this.balIconClick=n(this,"balIconClick",7);this.balPopoverPrepare=n(this,"balPopoverPrepare",7);this.inputId="bal-da-".concat(C++);this.inheritedAttributes={};this.onIconClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.triggerIcon)return[3,2];return[4,this.toggle()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.onInputClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.triggerIcon)return[3,2];return[4,this.open()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.onCalendarChange=function(t){m(t);e.value=t.detail;e.balChange.emit(e.value);if(e.closeOnSelect){e.close()}};this.onInputInput=function(t){m(t);e.balInput.emit(t.detail);if(t.detail){var i=l.fromAnyFormat(t.detail);if(i.isValid){e.calendarValue=i.toISODate()}}};this.onInputChange=function(t){m(t);e.value=t.detail;e.balChange.emit(e.value)};this.onInputFocus=function(t){m(t);e.balFocus.emit(t.detail)};this.onInputBlur=function(t){m(t);e.balBlur.emit(t.detail)};this.onKeyPress=function(t){var i=t.detail;return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(o(i)&&!this.triggerIcon))return[3,4];if(!this.isExpanded)return[3,2];return[4,this.close()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.isExpanded=false;this.language=g.language;this.calendarValue=undefined;this.ariaForm=y;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.freeSolo=false;this.placeholder=undefined;this.triggerIcon=false;this.closeOnSelect=true;this.value=undefined;this.min=undefined;this.max=undefined;this.minYearProp=undefined;this.maxYearProp=undefined;this.defaultDate=undefined;this.allowedDates=undefined;this.debounce=0;this.autoInvalidOff=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(){this.calendarValue=this.value};t.prototype.debounceChanged=function(){this.balChange=w(this.balChange,this.debounce)};t.prototype.connectedCallback=function(){this.valueChanged()};t.prototype.componentWillLoad=function(){this.inheritedAttributes=_(this.el,["aria-label","tabindex","title"])};t.prototype.listenToKeydown=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(this.isExpanded&&(t.key==="Escape"||t.key==="Esc")))return[3,2];t.preventDefault();return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.listenOnKeyup=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(t.key==="Tab"&&!this.el.contains(document.activeElement)&&this.isExpanded))return[3,2];return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.listenOnclick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(this.isExpanded&&!this.el.contains(t.target)))return[3,2];return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.listenOnPopoverPrepare=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!(this.inputId!==t.detail))return[3,2];return[4,this.close()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.language=t.language;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.expand()]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.collapse()]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isExpanded){return[2,this.collapse()]}else{return[2,this.expand()]}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(n){i=l.fromISO(t);if(i.isValid){this.value=i.toISODate();this.calendarValue=this.value}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){(t=this.inputEl)===null||t===void 0?void 0:t.setFocus();return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){(t=this.inputEl)===null||t===void 0?void 0:t.setBlur();return[2]}))}))};t.prototype.getInputElement=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){return[2,(t=this.inputEl)===null||t===void 0?void 0:t.getInputElement()]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(n){this.ariaForm=Object.assign({},t);(i=this.inputEl)===null||i===void 0?void 0:i.setAriaForm(t);return[2]}))}))};t.prototype.expand=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){if(this.referenceEl&&this.floatingEl){this.balPopoverPrepare.emit(this.inputId);this.balWillAnimate.emit();this.isExpanded=true;this.popupCleanup=h(this.referenceEl,this.floatingEl,(function(){t.updatePosition(t.referenceEl,t.floatingEl)}))}return[2,this.isExpanded]}))}))};t.prototype.collapse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.floatingEl){this.balWillAnimate.emit();this.isExpanded=false;if(this.popupCleanup){this.popupCleanup()}this.balDidAnimate.emit()}return[2,this.isExpanded]}))}))};t.prototype.updatePosition=function(t,i){var n=this;c(t,i,{placement:"bottom-start",middleware:[f(4),d({crossAxis:false})]}).then((function(t){var e=t.x,r=t.y;Object.assign(i.style,{left:"".concat(e,"px"),top:"".concat(r,"px")});n.balDidAnimate.emit()}))};t.prototype.render=function(){var t=this;var i=v.block("date");var n=i.element("icon");var s=i.element("popup");return e(r,{id:this.inputId,class:Object.assign({},i.class())},e("bal-input-group",{invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,ref:function(i){return t.referenceEl=i}},e("bal-input-date",Object.assign({name:this.name,required:this.required,placeholder:this.placeholder,value:this.value,min:this.min,max:this.max,invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,onClick:this.onInputClick,onBalInput:this.onInputInput,onBalChange:this.onInputChange,onBalFocus:this.onInputFocus,onBalBlur:this.onInputBlur,onBalKeyPress:this.onKeyPress,ref:function(i){return t.inputEl=i}},this.inheritedAttributes)),!this.freeSolo?e("bal-icon",{name:"date",role:"button",tabindex:-1,class:Object.assign(Object.assign({},n.class()),n.modifier("clickable").class(!this.disabled&&!this.readonly)),"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",onClick:this.onIconClick,"aria-label":p[this.language].toggleDatepicker,"aria-haspopup":"true","aria-expanded":this.isExpanded?"true":"false"}):""),e("div",{role:"dialog",class:Object.assign(Object.assign({},s.class()),s.modifier("visible").class(this.isExpanded)),ref:function(i){return t.floatingEl=i},"aria-hidden":"".concat(this.isExpanded!==true),"aria-presented":"".concat(this.isExpanded===true)},e("bal-date-calendar",{value:this.calendarValue,min:this.min,max:this.max,minYearProp:this.minYearProp,maxYearProp:this.maxYearProp,defaultDate:this.defaultDate,allowedDates:this.allowedDates,onBalChange:this.onCalendarChange})))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],debounce:["debounceChanged"]}},enumerable:false,configurable:true});return t}());a([b("bal-date"),u("design:type",Function),u("design:paramtypes",[Function]),u("design:returntype",void 0)],O.prototype,"createLogger",null);a([j(),u("design:type",Function),u("design:paramtypes",[Object]),u("design:returntype",Promise)],O.prototype,"configChanged",null);var C=0;O.style=k}}}));
@@ -1 +0,0 @@
1
- var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))t[i]=e[i]};return t(e,i)};return function(e,i){if(typeof i!=="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(e,i);function n(){this.constructor=e}e.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,i,n){function a(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function s(t){try{o(n.next(t))}catch(t){r(t)}}function l(t){try{o(n["throw"](t))}catch(t){r(t)}}function o(t){t.done?i(t.value):a(t.value).then(s,l)}o((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(t){return function(e){return o([t,e])}}function o(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(i=0)),i)try{if(n=1,a&&(r=l[0]&2?a["return"]:l[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,l[1])).done)return r;if(a=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;a=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(l[0]===6&&i.label<r[1]){i.label=r[1];r=l;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(l);break}if(r[2])i.ops.pop();i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t];a=0}finally{n=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,i){if(i||arguments.length===2)for(var n=0,a=e.length,r;n<a;n++){if(r||!(n in e)){if(!r)r=Array.prototype.slice.call(e,0,n);r[n]=e[n]}}return t.concat(r||Array.prototype.slice.call(e))};System.register(["./p-456fc561.system.js","./p-6dbef894.system.js","./p-8a87b9a8.system.js","./p-6913b916.system.js","./p-55faac1d.system.js","./p-23bdd8dc.system.js","./p-8954495d.system.js","./p-db0895e2.system.js","./p-bb6304d0.system.js","./p-0177e3a0.system.js","./p-2e8b4edc.system.js","./p-8949aa8b.system.js","./p-d2ee9b0a.system.js","./p-6e5745c8.system.js","./p-ba579059.system.js","./p-2880433e.system.js","./p-145d5c4e.system.js","./p-a1f6e944.system.js","./p-b3f2c626.system.js","./p-333ef156.system.js","./p-ec9a7cf5.system.js","./p-eecefb0a.system.js"],(function(t){"use strict";var e,i,n,a,r,s,l,o,u,c,d,f,h,b,v,_,m,g,p,y,w,x,j,k;return{setters:[function(t){e=t.h;i=t.r;n=t.c;a=t.H;r=t.g},function(t){s=t._;l=t.a},function(t){o=t.z;u=t.d},function(t){c=t.l},function(t){d=t.B;f=t.i},function(t){h=t.L},function(t){b=t.b;v=t.n},function(t){_=t.B},function(t){m=t.d},function(t){g=t.L},function(t){p=t.L},function(t){y=t.i},function(t){w=t.c;x=t.d},function(t){j=t.d},function(t){k=t.N},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){function O(t,e){if(e<1||t<0){return undefined}return new Date(t,e,0).getDate()}function C(t,e,i){return"".concat(i,"-").concat(o("".concat(e),2,"0"),"-").concat(o("".concat(t),2,"0"))}function D(){var t=new Date;return"".concat(t.getFullYear(),"-").concat(o("".concat(t.getMonth()+1),2,"0"),"-").concat(o("".concat(t.getDate()),2,"0"))}function z(t,e,i,n,a){var r=[];var s=O(t,e);var l=V(t,e);if(s!==undefined&&l){var o=D();var u=d.fromISO(i);var f=d.fromISO(n);var h=function(t){if(c(a)){return false}return!a(t)};for(var b=1;b<=s;b++){var v=C(b,e,t);r.push({day:b,month:e,year:t,isoDate:v,fullDate:d.fromISO(v).toFormat(),today:o===v,disabled:u.isAfter(v)||f.isBefore(v)||h(v)})}}return r}function A(t,e){if(e<1||t<0){return 1}var i=new Date(t,e-1,1);var n=i.getDay();return n===0?7:n}function M(t){if(["en","de","fr","it","nl","es","pl","pt","sv","fi"].includes(t)){return t}return"de"}function P(t,e,i){var n=[];var a=new Date;var r=a.getFullYear();for(var s=e;s<=i;s++){n.push({value:s,label:"".concat(s),disabled:false,today:r===s,selected:t===s})}return n}function S(t,e,i,n,a){var r=M(t);var s=d.infoMonths({format:"long",locale:r});var l=d.fromISO(i);var o=new Date;var u=o.getFullYear();var c=o.getMonth()+1;var f=0;if(n&&e!==undefined){var h=d.fromISO(n);if(h.isValid){if(e>h.year){f=0}else{f=h.month||f}}}var b=12;if(a&&e!==undefined){var v=d.fromISO(a);if(v.isValid){if(e<v.year){b=12}else{b=v.month||b}}}return s.map((function(t,i){var n=i+1;return{label:t,value:n,today:n===c&&e===u,selected:n===l.month&&e===l.year,disabled:n<f||n>b}}))}function K(t){var e=M(t);var i=d.infoWeekdays({format:"short",locale:e});var n=d.infoWeekdays({format:"long",locale:e});return i.map((function(t,e){return{ariaLabel:n[e],textContent:t}}))}function V(t,e){if(e<1||e>12||t<0){return undefined}return new Date(t,e-1,1)}var F=function(t){var i=t.name,n=t.isVisible,a=t.girdHeight,r=t.list,s=t.onSelect,l=t.ref;var o=_.block("date-calendar");var u=o.element("body");var c=u.element("list");return e("ul",{class:Object.assign(Object.assign(Object.assign({},c.class()),c.modifier(i).class()),c.modifier("visible").class(n)),"aria-hidden":n?"false":"true",style:{height:"".concat(a-2-8-8,"px")},ref:function(t){return l?l(t):undefined}},r.map((function(t){return e("li",{key:t.value,id:"".concat(i,"-").concat(t.value)},e("button",{class:Object.assign(Object.assign(Object.assign(Object.assign({},c.element("item").class()),c.element("item").modifier("today").class(t.today)),c.element("item").modifier("selected").class(t.selected)),c.element("item").modifier("disabled").class(t.disabled)),disabled:t.disabled,tabIndex:-1,onClick:function(){if(!t.disabled){s(t)}}},t.label))})))};var L=function(t){var i=t.isVisible,n=t.ref,a=t.grid,r=t.weekdays,s=t.selectedDate,l=t.firstDayOfWeek,o=t.onSelectDay;var u=_.block("date-calendar");var c=u.element("body");var d=c.element("grid");return e("div",{role:"grid",class:Object.assign(Object.assign({},d.class()),d.modifier("visible").class(i)),"aria-hidden":i?"false":"true",ref:function(t){return n(t)}},e("div",{role:"row",class:Object.assign({},d.element("head").class())},r.map((function(t){return e("span",{key:t.textContent,role:"columnheader","aria-label":t.ariaLabel,title:t.ariaLabel},t.textContent)}))),e("div",{role:"row",class:Object.assign({},d.element("body").class()),style:{"--bal-date-first-week-day":"".concat(l)}},a.map((function(t){return e("bal-date-calendar-cell",Object.assign({key:t.isoDate},t,{selected:t.isoDate===s,onBalSelectDay:function(t){var e=t.detail;return o(e)}}))}))))};var T=function(t){var i=t.language,n=t.onClickSelectMonthAndYear,a=t.monthFullNames,r=t.month,s=t.year,l=t.isCalendarVisible,o=t.isListVisible,u=t.onClickPreviousMonth,c=t.onClickNextMonth;var d=_.block("date-calendar");var h=d.element("nav");var b=f[i].nextMonth;var v=f[i].previousMonth;var m=f[i].selectMonth;return e("div",{class:Object.assign({},h.class())},e("div",{class:Object.assign({},h.modifier("start").class())},e("button",{title:m,"aria-label":m,tabIndex:-1,"data-test":"change-year-month",onClick:n},e("span",null,a[r-1]," ",s),e("bal-icon",{name:"caret-up",color:"primary",size:"small",turn:l}))),e("div",{class:Object.assign({},h.modifier("end").class()),style:{display:o?"none":"flex"}},e("button",{title:v,"aria-label":v,onClick:u,tabIndex:-1,"data-test":"previous-month"},e("bal-icon",{name:"caret-left",color:"primary",size:"small"})),e("button",{title:b,"aria-label":b,onClick:c,tabIndex:-1,"data-test":"next-month"},e("bal-icon",{name:"caret-right",color:"primary",size:"small"}))))};var I=':host{--bal-date-first-week-day:0;--bal-date-calendar-background:var(--bal-color-red-3)}:host{--bal-date-first-week-day:0;--bal-date-calendar-background:var(--bal-color-red-3)}:host{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;background:var(--bal-color-white);border-radius:var(--bal-radius-normal)}.bal-date-calendar__nav{display:-ms-flexbox;display:flex;width:calc(100% - 1rem);-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;padding:.5rem;gap:.5rem}.bal-date-calendar__nav--start>button{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav--end{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-color-text-primary);border:none;background:rgba(0,0,0,0);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;min-height:2rem;min-width:2rem;padding:.25rem;border-radius:var(--bal-button-radius);font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{background:var(--bal-color-light-blue-1)}}.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{background:var(--bal-color-light-blue-2)}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled){color:var(--bal-color-light-blue-3);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{color:var(--bal-color-text-primary)}}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{color:var(--bal-color-text-primary)}.bal-date-calendar__nav button--selected{background:var(--bal-color-primary);color:var(--bal-color-text-white);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__nav button--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body{display:block}.bal-date-calendar__body__grid{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding:.5rem;height:0;padding-top:0;padding-bottom:0;visibility:hidden}.bal-date-calendar__body__grid--visible{height:auto;padding-top:.5rem;padding-bottom:.5rem;visibility:visible}.bal-date-calendar__body__grid__head{position:relative;display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.bal-date-calendar__body__grid__head::after{position:absolute;content:"";height:2px;width:calc(100% + 1rem);bottom:0;left:-0.5rem;right:-0.5rem;background:var(--bal-color-border)}.bal-date-calendar__body__grid__head span{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:2rem;width:2rem;font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold);font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;text-wrap:nowrap}.bal-date-calendar__body__grid__body{display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding-top:.5rem}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell{width:2rem;height:2rem;text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell:first-child{grid-column:var(--bal-date-first-week-day)}.bal-date-calendar__body__list{display:none;list-style:none;margin:0;padding:0;-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:calc(100% - 1rem);overflow-y:auto;max-height:18rem;position:relative;padding:.5rem;border-top:2px solid var(--bal-color-border)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-color-text-primary);border:none;background:rgba(0,0,0,0);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:100%}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{background:var(--bal-color-light-blue-1)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{background:var(--bal-color-light-blue-2)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled){color:var(--bal-color-light-blue-3);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{color:var(--bal-color-text-primary)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{color:var(--bal-color-text-primary)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected{background:var(--bal-color-primary);color:var(--bal-color-text-white);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body__list--visible{display:grid}.bal-date-calendar__body__list--year{grid-template-columns:repeat(4, 1fr)}.bal-date-calendar__body__list--month{grid-template-columns:repeat(2, 1fr)}.bal-date-calendar-cell{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-color-text-primary);border:none;background:rgba(0,0,0,0);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:2rem;height:2rem}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{background:var(--bal-color-light-blue-1)}}.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{background:var(--bal-color-light-blue-2)}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled){color:var(--bal-color-light-blue-3);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{color:var(--bal-color-text-primary)}}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{color:var(--bal-color-text-primary)}.bal-date-calendar-cell--selected{background:var(--bal-color-primary);color:var(--bal-color-text-white);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar-cell--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}';var E=I;var N=t("bal_date_calendar",function(){function t(t){var e=this;i(this,t);this.balChange=n(this,"balChange",7);this.oldMin="";this.oldMax="";this.onSelectDay=function(t){e.valueChanged(t,e.selectedDate);e.balChange.emit(e.selectedDate)};this.onClickNextMonth=function(){var t=e.year;var i=e.month+1;if(i>12){i=1;t=t+1}e.generateGridByMonthAndYear(i,t)};this.onClickPreviousMonth=function(){var t=e.year;var i=e.month-1;if(i<1){i=12;t=t-1}e.generateGridByMonthAndYear(i,t)};this.onClickSelectMonthAndYear=function(){return __awaiter(e,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:this.updateSelections();if(!(this.isCalendarVisible===true))return[3,2];this.isCalendarVisible=false;this.isYearListVisible=true;this.isMonthListVisible=false;return[4,b()];case 1:i.sent();if(this.yearListEl){t=this.yearListEl.querySelector("#year-".concat(this.year));if(t){e=26+8+4;this.yearListEl.scrollTop=t.offsetTop-e*2}else{this.yearListEl.scrollTop=0}}return[3,3];case 2:this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;i.label=3;case 3:return[2]}}))}))};this.onClickYear=function(t){e.isYearListVisible=false;e.isMonthListVisible=true;e.generateGridByMonthAndYear(e.month,t);e.months=S(e.language,t,e.selectedDate,e.min,e.max)};this.onClickMonth=function(t){e.isYearListVisible=false;e.isMonthListVisible=false;e.isCalendarVisible=true;e.generateGridByMonthAndYear(t,e.year)};this.selectedDate="";this.monthFullNames=[];this.weekdays=[];this.months=[];this.years=[];this.calendarGrid=[];this.firstDayOfWeek=0;this.month=0;this.year=0;this.language=m.language;this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;this.value=undefined;this.defaultDate=undefined;this.allowedDates=undefined;this.min=undefined;this.max=undefined;this.minYearProp=undefined;this.maxYearProp=undefined}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){if(t!==e){var i=d.fromISO(t);if(!i.isValid){this.generateGridByDefaultDate();this.selectedDate=""}else{this.generateGridByDate(i);this.selectedDate=i.toISODate()}this.updateSelections()}};t.prototype.rangePropChanged=function(){this.updateSelections();this.generateGrid()};t.prototype.yearRangePropChanged=function(){this.updateSelections()};t.prototype.connectedCallback=function(){this.generateGridByDefaultDate();this.valueChanged(this.value,undefined)};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;this.monthFullNames=d.infoMonths({format:"long",locale:this.language});this.weekdays=K(this.language);this.updateSelections();return[2]}))}))};t.prototype.swipeListener=function(t){var e=t.left,i=t.right;if(e){this.onClickNextMonth()}else if(i){this.onClickPreviousMonth()}};Object.defineProperty(t.prototype,"minYear",{get:function(){if(this.minYearProp===undefined){var t=new Date;var e=t.getFullYear();var i=e-100;if(this.min){var n=d.fromISO(this.min);return n.year||i}else{return i}}return this.minYearProp},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxYear",{get:function(){if(this.maxYearProp===undefined){var t=new Date;var e=t.getFullYear();var i=e+50;if(this.max){var n=d.fromISO(this.max);return n.year||i}else{return i}}return this.maxYearProp},enumerable:false,configurable:true});t.prototype.updateSelections=function(){this.years=P(this.year,this.minYear,this.maxYear);this.months=S(this.language,this.year,this.selectedDate,this.min,this.max)};t.prototype.generateGrid=function(){var t=d.fromISO(this.value);if(t.isValid){this.generateGridByDate(t)}else{this.generateGridByDefaultDate()}};t.prototype.generateGridByDate=function(t){if(t.year!==undefined&&t.month!==undefined){this.generateGridByMonthAndYear(t.month,t.year)}};t.prototype.generateGridByDefaultDate=function(){var t=d.fromISO(this.defaultDate);if(t.isValid){this.generateGridByDate(t)}else{var e=new Date;this.month=e.getMonth()+1;this.year=e.getFullYear();this.calendarGrid=z(this.year,this.month,this.min,this.max,this.allowedDates);this.firstDayOfWeek=A(this.year,this.month)}};t.prototype.generateGridByMonthAndYear=function(t,e){if(this.month!==t||this.year!==e||this.oldMin!==this.min||this.oldMax!==this.max){this.calendarGrid=z(e,t,this.min,this.max,this.allowedDates);this.firstDayOfWeek=A(e,t)}this.month=t;this.year=e;this.oldMin=this.min;this.oldMax=this.max};t.prototype.render=function(){var t=this;var i;var n=((i=this.gridEl)===null||i===void 0?void 0:i.clientHeight)||0;var r=_.block("date-calendar");var s=r.element("body");var l=r.element("foot");return e(a,{class:Object.assign({},r.class())},e(T,{language:this.language,monthFullNames:this.monthFullNames,month:this.month,year:this.year,isCalendarVisible:this.isCalendarVisible,isListVisible:this.isMonthListVisible||this.isYearListVisible,onClickSelectMonthAndYear:this.onClickSelectMonthAndYear,onClickPreviousMonth:this.onClickPreviousMonth,onClickNextMonth:this.onClickNextMonth}),e("div",{class:Object.assign({},s.class())},e(L,{isVisible:this.isCalendarVisible,grid:this.calendarGrid,weekdays:this.weekdays,firstDayOfWeek:this.firstDayOfWeek,selectedDate:this.selectedDate,ref:function(e){return t.gridEl=e},onSelectDay:function(e){return t.onSelectDay(e)}}),e(F,{name:"year",isVisible:this.isYearListVisible,girdHeight:n,list:this.years,ref:function(e){return t.yearListEl=e},onSelect:function(e){return t.onClickYear(e.value)}}),e(F,{name:"month",isVisible:this.isMonthListVisible,girdHeight:n,list:this.months,onSelect:function(e){return t.onClickMonth(e.value)}})),e("div",{class:Object.assign({},l.class())},e("slot",null)))};Object.defineProperty(t.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],min:["rangePropChanged"],max:["rangePropChanged"],minYearProp:["yearRangePropChanged"],maxYearProp:["yearRangePropChanged"]}},enumerable:false,configurable:true});return t}());s([h("bal-date-calendar"),l("design:type",Function),l("design:paramtypes",[Function]),l("design:returntype",void 0)],N.prototype,"createLogger",null);s([g(),l("design:type",Function),l("design:paramtypes",[Object]),l("design:returntype",Promise)],N.prototype,"configChanged",null);s([p({mobileOnly:true}),l("design:type",Function),l("design:paramtypes",[Object]),l("design:returntype",void 0)],N.prototype,"swipeListener",null);N.style=E;var R=function(){function t(t){this._options=t;this._position=0;this._positionEnd=0;this._isRangeSelection=false;if(t.component&&t.component.nativeInput){this._position=t.component.nativeInput.selectionStart||0;this._positionEnd=t.component.nativeInput.selectionEnd||0;this._isRangeSelection=this._position!==this._positionEnd}}Object.defineProperty(t.prototype,"isRangeSelection",{get:function(){return this._isRangeSelection},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){if(this._options.isBackspace&&this._position>0){return this._position-1}return this._position},set:function(t){var e=t<0?0:t>this._options.mask.maxLength?this._options.mask.maxLength:t;this._position=e},enumerable:false,configurable:true});t.prototype.toStart=function(){this.value=0};t.prototype.toEnd=function(){var t=this.getTarget();if(t){this.value=t.value.length}};t.prototype.next=function(t){if(t===void 0){t=1}var e=this._position+t;if(e<=this._options.mask.maxLength){this._position=e}return this._position};t.prototype.previous=function(t){if(t===void 0){t=1}var e=this._position-t;if(e>=0){this._position=e}else{this._position=0}return this._position};t.prototype.submit=function(){var t=this.getTarget();if(t&&t.selectionStart!==this._position&&t.selectionEnd!==this._position){t.selectionStart=this._position;t.selectionEnd=this._position}};t.prototype.getTarget=function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined};return t}();var Y=function(){function t(t){this._options=t;this._value="";if(this._options.component&&this._options.component.nativeInput){this._value=this._options.component.nativeInput.value}this.position=new R(this._options)}Object.defineProperty(t.prototype,"target",{get:function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focused",{get:function(){return this._options.component.focused},enumerable:false,configurable:true});t.prototype.isValueEmpty=function(){return this.value===""||this.value===undefined||this.value===null};t.prototype.preventDefault=function(){if(this._options.event.preventDefault){this._options.event.preventDefault()}};t.prototype.stopPropagation=function(){this.preventDefault();if(this._options.event.stopPropagation){this._options.event.stopPropagation()}};t.prototype.submit=function(t,e){if(t===void 0){t="input"}return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(n){if(this.target){this.target.value=this.value;if(t!=="blur"&&t!=="tab"){this.position.submit()}if(this._options.component){if(t==="input"||t==="tab"){this._options.component.balInput.emit(this.value)}if((t==="change"||t==="blur")&&e!==undefined){i=this._options.component.value!==e;if(i){this._options.component.value=e;this._options.component.balChange.emit(e)}}}}return[2]}))}))};return t}();var B=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"clipboardData",{get:function(){var t;return(t=this._options.event.clipboardData)===null||t===void 0?void 0:t.getData("text")},enumerable:false,configurable:true});return e}(Y);var H=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Y);var J=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"key",{get:function(){return this._options.event.key},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCtrlOrCommandKey",{get:function(){return this._options.event.metaKey||this._options.event.ctrlKey},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBackspaceKey",{get:function(){return this._options.event.key==="Backspace"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isTabKey",{get:function(){return this._options.event.key==="Tab"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isWhiteSpaceKey",{get:function(){return this._options.event.key===" "},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDeleteKey",{get:function(){return this._options.event.key==="Delete"||this._options.event.key==="Del"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNumberKey",{get:function(){return e.NUMBER_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNavigationKey",{get:function(){return e.NAVIGATION_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSelectAllCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="a"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCopyCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="c"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isPasteCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="v"},enumerable:false,configurable:true});e.prototype.getCharAt=function(t){if(t===void 0){t=this.position.value}return this.value.charAt(t)};e.prototype.getCharAtBackspacePosition=function(){return this.getCharAt(this.position.value-1)};e.prototype.setChar=function(t,e){if(t===void 0){t=this._options.event.key}if(e===void 0){e=this.position.value}this.value=this.value.substring(0,e)+t+this.value.substring(e+1)};return e}(Y);J.NUMBER_KEYS=["0","1","2","3","4","5","6","7","8","9"];J.NAVIGATION_KEYS=["Home","End","ArrowLeft","Left","ArrowRight","Right","Tab","Enter","Esc","Escape"];var G=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"locale",{get:function(){return this._options.event.locale},enumerable:false,configurable:true});return e}(Y);var W=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Y);var q=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"newValue",{get:function(){return this._options.event.newValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"oldValue",{get:function(){return this._options.event.oldValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"didValueChange",{get:function(){return this.newValue!==this.oldValue},enumerable:false,configurable:true});return e}(Y);var Q=function(){function t(t){this._isSeparator=false;this._allowedKeys=[];this._locale="de-CH";this._from=t.from||0;this._to=t.to||0;this._isSeparator=t.isSeparator===undefined?false:t.isSeparator;this._mask=t.mask||"_";this._allowedKeys=t.allowedKeys?t.allowedKeys:this.allowedKeys;this._format=t.format}t.prototype.format=function(t){if(this._format){return this._format(t.replace(this.mask,""),this._locale,this.mask)}return t};Object.defineProperty(t.prototype,"isSeparator",{get:function(){return this._isSeparator},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"to",{get:function(){return this._to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"from",{get:function(){return this._from},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"mask",{get:function(){if(typeof this._mask==="function"){return this._mask(this._locale)}return this._mask},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allowedKeys",{get:function(){return this._allowedKeys},enumerable:false,configurable:true});t.prototype.onI18nChange=function(t){this._locale=t};t.prototype.getValueOfTheBlock=function(t){return t.slice(this._from,this._to)};t.prototype.isTouched=function(t){var e=this;var i=this.getValueOfTheBlock(t);return!i.split("").every((function(t){return t===e.mask}))};t.prototype.verifyAllowedKeyHits=function(t){if(this.isSeparator&&t===this.mask){return true}else if(this.allowedKeys.indexOf(t)>=0){return true}else{return false}};return t}();var U=function(){function t(t){if(t===void 0){t=[]}this._list=t}Object.defineProperty(t.prototype,"lastPosition",{get:function(){return this._list[this._list.length-1].to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"list",{get:function(){return this._list},set:function(t){this._list=t},enumerable:false,configurable:true});t.prototype.clone=function(){return new t(__spreadArray([],this._list,true))};t.prototype.findByIndex=function(t,e){if(e===void 0){e=this.list}return e.find((function(e){return e.from<=t&&t<e.to}))};t.prototype.getPlaceholderMask=function(){var t=[];this.list.forEach((function(e){var i=e.to-e.from;for(var n=0;n<i;n++){t.push(e.mask)}}));return t.join("")};t.prototype.getRawValueWithoutMaskByContext=function(t){return this.getRawValueWithoutMask(t.value)};t.prototype.getRawValueWithoutMask=function(t){if(t){var e=[];var i=t.split("");for(var n=0;n<i.length;n++){var a=i[n];var r=this.findByIndex(n);if(r&&!r.isSeparator){e.push(a.replace(r.mask,""))}else{e.push(a)}}e=e.filter((function(t){return t}));var s=this.list.filter((function(t){return t.isSeparator})).length;if(s===e.length){return""}return e.join("")}return""};t.prototype.formatBlocks=function(t,e){var i="".concat(t);for(var n=0;n<this.list.length;n++){var a=this.list[n];if(e!==n&&!a.isSeparator&&a.isTouched(i)){var r=a.getValueOfTheBlock(i);var s=a.format(r);i=i.substring(0,a.from)+s+i.substring(a.to)}}return i};t.prototype.getBlockIndexFromPosition=function(t){var e=this.list.reduce((function(t,e){return t+e.to-e.from}),0);if(t===e){return this.list.length-1}var i=this.list.findIndex((function(e){return e.from<=t&&t<e.to}));return i<0?undefined:Math.min(e,i)};t.prototype.verifyCallOfNextSeparator=function(t,e){if(this.list.length-1>e){var i=this.list[e+1];if(i.isSeparator&&i.mask===t){return true}}return false};return t}();var X=function(){function t(t){if(t===void 0){t=[]}this.inputMode="text";this.locale="de-CH";this.blocks=new U(t)}t.prototype.onLocaleChange=function(t,e,i){if(t.target){var n=t.value;var a=n.split("");for(var r=0;r<a.length;r++){var s=a[r];var l=this.blocks.findByIndex(r);var o=i.findByIndex(r);if(l&&o){if(l.isSeparator){a[r]=l.mask}else if(s===o.mask){a[r]=l.mask}}}t.value=a.join("")}};t.prototype.onFocus=function(t){};t.prototype.onBlur=function(t){};t.prototype.onChange=function(t){t.submit("change",this.onParseValue(t.value))};t.prototype.onNavigationDown=function(t,e,i){};t.prototype.onSelectAll=function(t,e,i){};t.prototype.onPaste=function(t,e,i){var n=t.clipboardData||"";t.value=n;t.position.toEnd()};t.prototype.onBlockChange=function(t,e,i){t.setChar();t.position.next();var n=this.blocks.list[i+1];if(t.position.value===e.to&&n&&n.isSeparator){t.position.next()}};t.prototype.onBackspaceDown=function(t,e,i){t.position.previous();if(!e.isSeparator){t.setChar(e.mask);var n=this.blocks.list[i-1];if(t.position.value===e.from&&n&&n.isSeparator){t.position.previous()}}};t.prototype.onDeleteDown=function(t,e,i){t.setChar(e.mask);t.position.next();var n=this.blocks.list[i+1];if(t.position.value===e.to&&n&&n.isSeparator){t.position.next()}};t.prototype.onValueChanged=function(t){var e=this.onFormatValue(t.newValue);var i=t.focused&&e===""?this.blocks.getPlaceholderMask():e;t.value=i;t.position.toEnd()};t.prototype.onParseValue=function(t){if(t){return t.trim()}return t||""};t.prototype.onFormatValue=function(t){if(t){return t.trim()}return t||""};t.prototype.toParsedValue=function(t){return this.onParseValue(t)};t.prototype.toFormattedValue=function(t){return this.onFormatValue(t)};t.prototype.fireI18nChange=function(t){var e=this.blocks.clone();var i="".concat(t.locale);this.locale=t.locale;this.blocks.list.forEach((function(e){return e.onI18nChange(t.locale)}));this.onLocaleChange(t,i,e)};t.prototype.fireValueChanged=function(t){if(t.didValueChange){this.onValueChanged(t)}};t.prototype.firePaste=function(t){var e=this.blocks.getBlockIndexFromPosition(t.position.value);if(e!==undefined){var i=this.blocks.list[e];this.onPaste(t,i,e);this.onChange(t)}};t.prototype.fireClick=function(t){var e=this.blocks.getPlaceholderMask();if(e===t.value){t.position.toStart()}};t.prototype.fireFocus=function(t){if(t.target&&t.isValueEmpty()){this.resetInputValueWithMask(t)}this.onFocus(t)};t.prototype.fireBlur=function(t){if(t.target){if(this.isValueEmptyMask(t)){this.emptyInputValue(t)}else{this.onBlur(t);t.submit("blur",this.onParseValue(t.value))}}};t.prototype.fireKeyDown=function(t){var e=t.isBackspaceKey?Math.max(0,t.position.value-1):t.position.value;var i=this.blocks.getBlockIndexFromPosition(e);if(e>=this.blocks.lastPosition&&!t.isNavigationKey&&!t.isSelectAllCommand){t.preventDefault();t.stopPropagation();return}if(i!==undefined&&!t.position.isRangeSelection){var n=this.blocks.list[i];if(t.isNavigationKey){this.onNavigationDown(t,n,i)}else if(t.isSelectAllCommand){this.onSelectAll(t,n,i)}else if(t.isCopyCommand);else if(t.isPasteCommand);else if(t.isBackspaceKey){t.preventDefault();this.onBackspaceDown(t,n,i)}else if(t.isDeleteKey){t.preventDefault();this.onDeleteDown(t,n,i)}else if(t.isWhiteSpaceKey){t.preventDefault();var a=t.value[t.position.value];if(a==="."){t.stopPropagation();var r=t.value;t.value=r.substring(0,t.position.value)+"_"+r.substring(t.position.value+1)}}else if(n.verifyAllowedKeyHits(t.key)){t.preventDefault();this.onBlockChange(t,n,i)}else if(this.blocks.verifyCallOfNextSeparator(t.key,i)){t.preventDefault();var s=this.blocks.list[i];if(t.position.value>s.from){var l=this.blocks.list[i+1];var r=t.value;var o=n.getValueOfTheBlock(r);var u=n.format(o);t.value=r.substring(0,n.from)+u+r.substring(n.to);t.position.value=l.to}}var c=this.blocks.getBlockIndexFromPosition(t.position.value);if(c&&!t.isBackspaceKey){var d=this.blocks.formatBlocks(t.value,c);var f=t.position.value;t.value=d;t.position.value=f}}else{if(!t.isTabKey){t.preventDefault()}if(t.isBackspaceKey||t.isDeleteKey){this.resetInputValueWithMask(t)}else if(this.blocks.list[0].verifyAllowedKeyHits(t.key)){this.onBlockChange(t,this.blocks.list[0],0)}}};t.prototype.resetInputValueWithMask=function(t){t.value=this.blocks.getPlaceholderMask();t.position.toStart()};t.prototype.isValueEmptyMask=function(t){var e=this.blocks.getPlaceholderMask();return e===t.value};t.prototype.emptyInputValue=function(t){t.value="";t.submit("blur",t.value)};return t}();var Z=function(t){__extends(e,t);function e(){var e=t.call(this,[new Q({from:0,to:2,allowedKeys:__spreadArray([],k,true),format:function(t,e,i){if(Number.isNaN(parseInt(t,10))){return"".concat(i).concat(i)}return t.padStart(2,"0")},mask:function(t){return e.dayMask[t.split("-")[0]]||e.dayMask["de"]}}),new Q({from:2,to:3,mask:function(t){return u(t)},isSeparator:true}),new Q({from:3,to:5,allowedKeys:__spreadArray([],k,true),format:function(t,e,i){if(Number.isNaN(parseInt(t,10))){return"".concat(i).concat(i)}return t.padStart(2,"0")},mask:function(t){return e.monthMask[t.split("-")[0]]||e.monthMask["de"]}}),new Q({from:5,to:6,mask:function(t){return u(t)},isSeparator:true}),new Q({from:6,to:10,allowedKeys:__spreadArray([],k,true),mask:function(t){return e.yearMask[t.split("-")[0]]||e.yearMask["de"]}})])||this;e.maxLength=10;e.minLength=10;e.inputMode="decimal";e.dayMask={de:"T",en:"D",fr:"J",it:"G",nl:"D",es:"D",pl:"D",pt:"D",sv:"D",fi:"M"};e.monthMask={de:"M",en:"M",fr:"M",it:"M",nl:"M",es:"M",pl:"M",pt:"M",sv:"M",fi:"K"};e.yearMask={de:"J",en:"Y",fr:"A",it:"A",nl:"J",es:"A",pl:"R",pt:"A",sv:"Å",fi:"V"};return e}e.prototype.onParseValue=function(t){if(t){var e=d.fromAnyFormat(this.blocks.getRawValueWithoutMask(t));if(e.isValid){return e.toISODate()}}return""};e.prototype.onFormatValue=function(t){if(t){var e=d.fromISO(t);if(e.isValid){return e.toFormat()}}return""};e.prototype.onPaste=function(t,e,i){var n=t.clipboardData||"";var a=d.fromAnyFormat(n);if(a.isValid){t.value=a.toFormat();t.position.toEnd()}};e.prototype.onBlur=function(t){var e=this.blocks.getRawValueWithoutMaskByContext(t);var i=d.fromAnyFormat(e);if(i.isValid){var n=i.toFormat();if(n!==t.value){t.value=n}}};return e}(X);var $=function(){function t(t){this.mask=t}Object.defineProperty(t.prototype,"attributes",{get:function(){return{inputMode:this.mask.inputMode,maxLength:this.mask.maxLength,minLength:this.mask.minLength,type:"text",autoCapitalize:"off",autoCorrect:"off",spellcheck:false}},enumerable:false,configurable:true});t.prototype.bindComponent=function(t){this.component=t};t.prototype.bindComponentDidLoad=function(){if(this.component&&this.component.nativeInput){this.component.nativeInput.value=this.component.value||""}this.bindValueChanged(this.component.value,undefined)};t.prototype.bindConfigChanged=function(t){var e=this,i=e.component,n=e.mask;var a=new G({component:i,mask:n,event:{locale:"".concat(t.language,"-").concat(t.region)}});this.mask.fireI18nChange(a);a.submit()};t.prototype.bindValueChanged=function(t,e){var i=this,n=i.component,a=i.mask;var r=new q({component:n,mask:a,event:{newValue:t,oldValue:e}});this.mask.fireValueChanged(r);r.submit("blur")};t.prototype.bindKeyDown=function(t){if(this.isComponentAccessible){var e=this,i=e.component,n=e.mask;var a=new J({event:t,component:i,mask:n});this.mask.fireKeyDown(a);var r=t.key==="Tab";a.submit(r?"tab":"input");i.balKeyPress.emit(t)}};t.prototype.bindFocus=function(t){if(this.isComponentAccessible){var e=this,i=e.component,n=e.mask;i.focused=true;var a=new H({event:t,component:i,mask:n});this.mask.fireFocus(a);a.submit();i.balFocus.emit(t)}};t.prototype.bindBlur=function(t){if(this.isComponentAccessible){var e=this,i=e.component,n=e.mask;i.focused=false;var a=new H({event:t,component:i,mask:n});this.mask.fireBlur(a);a.submit("blur");i.balBlur.emit(t)}};t.prototype.bindPaste=function(t){if(this.isComponentAccessible){var e=this,i=e.component,n=e.mask;var a=new B({event:t,component:i,mask:n});this.mask.firePaste(a);a.submit()}};t.prototype.bindFormReset=function(t){var e=this;var i=t.target;if(i&&(i===this.component.el||i.contains(this.component.el))){this.component.value=this.component.initialValue;this.component.inputValue=this.component.initialValue;clearTimeout(this.resetHandlerTimer);this.resetHandlerTimer=setTimeout((function(){if(e.component.nativeInput){e.component.nativeInput.value=e.mask.toFormattedValue(e.component.value||"")}}))}};t.prototype.bindClick=function(t){if(this.isComponentAccessible){var e=this,i=e.component,n=e.mask;var a=new W({event:t,component:i,mask:n});this.mask.fireClick(a);a.submit()}};t.prototype.bindHostClick=function(t){if(!this.isComponentAccessible){t.preventDefault();t.stopPropagation()}};t.prototype.bindGlobalClick=function(t){if(!this.isComponentAccessible){if(t.target&&t.target===this.component.el){t.preventDefault();t.stopPropagation()}}};Object.defineProperty(t.prototype,"isComponentAccessible",{get:function(){return!this.component.disabled&&!this.component.readonly},enumerable:false,configurable:true});return t}();var tt=".bal-input-date{display:block;width:100%;-ms-flex:1;flex:1}.bal-input-date input:not(:-moz-placeholder-shown){letter-spacing:.4px}.bal-input-date input:not(:-ms-input-placeholder){letter-spacing:.4px}.bal-input-date input:not(:placeholder-shown){letter-spacing:.4px}.bal-input-date__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}";var et=tt;var it=t("bal_input_date",function(){function t(t){i(this,t);this.balKeyPress=n(this,"balKeyPress",7);this.balChange=n(this,"balChange",7);this.balInput=n(this,"balInput",7);this.balBlur=n(this,"balBlur",7);this.balFocus=n(this,"balFocus",7);this.inputId="bal-i-date-".concat(nt++);this.inheritedAttributes={};this.maskAdapter=new $(new Z);this.inputValue=this.value;this.initialValue=this.value||"";this.focused=false;this.isGrouped=false;this.ariaForm=j;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.placeholder=undefined;this.clickable=false;this.min=undefined;this.max=undefined;this.autocomplete="off";this.hasIconRight=false;this.value=undefined;this.autoInvalidOff=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){this.maskAdapter.bindValueChanged(t,e)};t.prototype.connectedCallback=function(){this.maskAdapter.bindComponent(this);this.isGrouped=v("bal-input-group",this.el)};t.prototype.componentDidLoad=function(){this.maskAdapter.bindComponentDidLoad()};t.prototype.componentWillRender=function(){this.inheritedAttributes=y(this.el,["aria-label","tabindex","title"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.maskAdapter.bindConfigChanged(t);return[2]}))}))};t.prototype.resetHandler=function(t){this.maskAdapter.bindFormReset(t)};t.prototype.listenOnClick=function(t){this.maskAdapter.bindGlobalClick(t)};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){w(this);return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){x(this);return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ariaForm=Object.assign({},t);return[2]}))}))};t.prototype.render=function(){var t=this;var i=_.block("input-date");var n=i.element("native");return e(a,{onClick:function(e){return t.maskAdapter.bindHostClick(e)},class:Object.assign({},i.class())},e("input",Object.assign({class:{input:true,"is-disabled":this.disabled||this.readonly,"is-danger":this.invalid,"is-clickable":this.clickable&&!(this.disabled||this.readonly),"bal-focusable":!this.disabled,"has-icon-right":this.hasIconRight},"data-testid":"bal-date-input",ref:function(e){return t.nativeInput=e},id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":this.invalid===true?"true":"false","aria-disabled":this.disabled?"true":null,required:this.required,disabled:this.disabled,readonly:this.readonly,autoComplete:this.autocomplete},this.maskAdapter.attributes,this.inheritedAttributes,{placeholder:this.placeholder,value:this.inputValue,onKeyDown:function(e){return t.maskAdapter.bindKeyDown(e)},onClick:function(e){return t.maskAdapter.bindClick(e)},onFocus:function(e){return t.maskAdapter.bindFocus(e)},onBlur:function(e){return t.maskAdapter.bindBlur(e)},onPaste:function(e){return t.maskAdapter.bindPaste(e)}})),e("input",{type:"date",class:Object.assign({},n.class()),name:this.name,min:this.min,max:this.max,value:this.value,tabindex:-1,"aria-hidden":"true"}))};Object.defineProperty(t.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}());s([h("bal-input-date"),l("design:type",Function),l("design:paramtypes",[Function]),l("design:returntype",void 0)],it.prototype,"createLogger",null);s([g(),l("design:type",Function),l("design:paramtypes",[Object]),l("design:returntype",Promise)],it.prototype,"configChanged",null);var nt=0;it.style=et}}}));