@limetech/lime-elements 38.21.3 → 38.21.4

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 (43) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/{checkbox.template-d2c0b7fc.js → checkbox.template-f624966b.js} +9 -5
  3. package/dist/cjs/checkbox.template-f624966b.js.map +1 -0
  4. package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js +2 -2
  5. package/dist/cjs/limel-checkbox.cjs.entry.js +24 -648
  6. package/dist/cjs/limel-checkbox.cjs.entry.js.map +1 -1
  7. package/dist/cjs/limel-slider.cjs.entry.js +1 -1
  8. package/dist/cjs/{util-b0f5741e.js → util-9af8948d.js} +1 -33
  9. package/dist/cjs/util-9af8948d.js.map +1 -0
  10. package/dist/collection/components/checkbox/checkbox.js +23 -19
  11. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  12. package/dist/collection/components/checkbox/checkbox.template.js +8 -5
  13. package/dist/collection/components/checkbox/checkbox.template.js.map +1 -1
  14. package/dist/esm/{checkbox.template-04a31caa.js → checkbox.template-890a59d7.js} +9 -5
  15. package/dist/esm/checkbox.template-890a59d7.js.map +1 -0
  16. package/dist/esm/limel-breadcrumbs_7.entry.js +2 -2
  17. package/dist/esm/limel-checkbox.entry.js +24 -648
  18. package/dist/esm/limel-checkbox.entry.js.map +1 -1
  19. package/dist/esm/limel-slider.entry.js +1 -1
  20. package/dist/esm/{util-f1bde91c.js → util-a389da1e.js} +2 -33
  21. package/dist/esm/util-a389da1e.js.map +1 -0
  22. package/dist/lime-elements/lime-elements.esm.js +1 -1
  23. package/dist/lime-elements/{p-9faad6eb.js → p-127358a6.js} +2 -2
  24. package/dist/lime-elements/p-127358a6.js.map +1 -0
  25. package/dist/lime-elements/p-2c69d13e.js +2 -0
  26. package/dist/lime-elements/p-2c69d13e.js.map +1 -0
  27. package/dist/lime-elements/{p-e80040b7.entry.js → p-5ca2fc45.entry.js} +2 -2
  28. package/dist/lime-elements/{p-0f113a9e.entry.js → p-a0fa40ee.entry.js} +2 -2
  29. package/dist/lime-elements/p-bd37337a.entry.js +2 -0
  30. package/dist/lime-elements/p-bd37337a.entry.js.map +1 -0
  31. package/dist/types/components/checkbox/checkbox.d.ts +0 -2
  32. package/package.json +1 -1
  33. package/dist/cjs/checkbox.template-d2c0b7fc.js.map +0 -1
  34. package/dist/cjs/util-b0f5741e.js.map +0 -1
  35. package/dist/esm/checkbox.template-04a31caa.js.map +0 -1
  36. package/dist/esm/util-f1bde91c.js.map +0 -1
  37. package/dist/lime-elements/p-9faad6eb.js.map +0 -1
  38. package/dist/lime-elements/p-cc6195a9.entry.js +0 -134
  39. package/dist/lime-elements/p-cc6195a9.entry.js.map +0 -1
  40. package/dist/lime-elements/p-d5b1f00e.js +0 -2
  41. package/dist/lime-elements/p-d5b1f00e.js.map +0 -1
  42. /package/dist/lime-elements/{p-e80040b7.entry.js.map → p-5ca2fc45.entry.js.map} +0 -0
  43. /package/dist/lime-elements/{p-0f113a9e.entry.js.map → p-a0fa40ee.entry.js.map} +0 -0
@@ -4,637 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-174a078a.js');
6
6
  const randomString = require('./random-string-27fb6c74.js');
7
- const checkbox_template = require('./checkbox.template-d2c0b7fc.js');
8
- const ponyfill = require('./ponyfill-63966294.js');
9
- const util = require('./util-b0f5741e.js');
10
- const component = require('./component-a8e11c4c.js');
11
-
12
- /**
13
- * @license
14
- * Copyright 2016 Google Inc.
15
- *
16
- * Permission is hereby granted, free of charge, to any person obtaining a copy
17
- * of this software and associated documentation files (the "Software"), to deal
18
- * in the Software without restriction, including without limitation the rights
19
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
- * copies of the Software, and to permit persons to whom the Software is
21
- * furnished to do so, subject to the following conditions:
22
- *
23
- * The above copyright notice and this permission notice shall be included in
24
- * all copies or substantial portions of the Software.
25
- *
26
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32
- * THE SOFTWARE.
33
- */
34
- var cssClasses$1 = {
35
- ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',
36
- ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',
37
- ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',
38
- ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked',
39
- ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',
40
- ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',
41
- BACKGROUND: 'mdc-checkbox__background',
42
- CHECKED: 'mdc-checkbox--checked',
43
- CHECKMARK: 'mdc-checkbox__checkmark',
44
- CHECKMARK_PATH: 'mdc-checkbox__checkmark-path',
45
- DISABLED: 'mdc-checkbox--disabled',
46
- INDETERMINATE: 'mdc-checkbox--indeterminate',
47
- MIXEDMARK: 'mdc-checkbox__mixedmark',
48
- NATIVE_CONTROL: 'mdc-checkbox__native-control',
49
- ROOT: 'mdc-checkbox',
50
- SELECTED: 'mdc-checkbox--selected',
51
- UPGRADED: 'mdc-checkbox--upgraded',
52
- };
53
- var strings$1 = {
54
- ARIA_CHECKED_ATTR: 'aria-checked',
55
- ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed',
56
- DATA_INDETERMINATE_ATTR: 'data-indeterminate',
57
- NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control',
58
- TRANSITION_STATE_CHECKED: 'checked',
59
- TRANSITION_STATE_INDETERMINATE: 'indeterminate',
60
- TRANSITION_STATE_INIT: 'init',
61
- TRANSITION_STATE_UNCHECKED: 'unchecked',
62
- };
63
- var numbers = {
64
- ANIM_END_LATCH_MS: 250,
65
- };
66
-
67
- /**
68
- * @license
69
- * Copyright 2016 Google Inc.
70
- *
71
- * Permission is hereby granted, free of charge, to any person obtaining a copy
72
- * of this software and associated documentation files (the "Software"), to deal
73
- * in the Software without restriction, including without limitation the rights
74
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
75
- * copies of the Software, and to permit persons to whom the Software is
76
- * furnished to do so, subject to the following conditions:
77
- *
78
- * The above copyright notice and this permission notice shall be included in
79
- * all copies or substantial portions of the Software.
80
- *
81
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
82
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
83
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
84
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
85
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
86
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
87
- * THE SOFTWARE.
88
- */
89
- var MDCCheckboxFoundation = /** @class */ (function (_super) {
90
- ponyfill.__extends(MDCCheckboxFoundation, _super);
91
- function MDCCheckboxFoundation(adapter) {
92
- var _this = _super.call(this, ponyfill.__assign(ponyfill.__assign({}, MDCCheckboxFoundation.defaultAdapter), adapter)) || this;
93
- _this.currentCheckState = strings$1.TRANSITION_STATE_INIT;
94
- _this.currentAnimationClass = '';
95
- _this.animEndLatchTimer = 0;
96
- _this.enableAnimationEndHandler = false;
97
- return _this;
98
- }
99
- Object.defineProperty(MDCCheckboxFoundation, "cssClasses", {
100
- get: function () {
101
- return cssClasses$1;
102
- },
103
- enumerable: false,
104
- configurable: true
105
- });
106
- Object.defineProperty(MDCCheckboxFoundation, "strings", {
107
- get: function () {
108
- return strings$1;
109
- },
110
- enumerable: false,
111
- configurable: true
112
- });
113
- Object.defineProperty(MDCCheckboxFoundation, "numbers", {
114
- get: function () {
115
- return numbers;
116
- },
117
- enumerable: false,
118
- configurable: true
119
- });
120
- Object.defineProperty(MDCCheckboxFoundation, "defaultAdapter", {
121
- get: function () {
122
- return {
123
- addClass: function () { return undefined; },
124
- forceLayout: function () { return undefined; },
125
- hasNativeControl: function () { return false; },
126
- isAttachedToDOM: function () { return false; },
127
- isChecked: function () { return false; },
128
- isIndeterminate: function () { return false; },
129
- removeClass: function () { return undefined; },
130
- removeNativeControlAttr: function () { return undefined; },
131
- setNativeControlAttr: function () { return undefined; },
132
- setNativeControlDisabled: function () { return undefined; },
133
- };
134
- },
135
- enumerable: false,
136
- configurable: true
137
- });
138
- MDCCheckboxFoundation.prototype.init = function () {
139
- this.currentCheckState = this.determineCheckState();
140
- this.updateAriaChecked();
141
- this.adapter.addClass(cssClasses$1.UPGRADED);
142
- };
143
- MDCCheckboxFoundation.prototype.destroy = function () {
144
- clearTimeout(this.animEndLatchTimer);
145
- };
146
- MDCCheckboxFoundation.prototype.setDisabled = function (disabled) {
147
- this.adapter.setNativeControlDisabled(disabled);
148
- if (disabled) {
149
- this.adapter.addClass(cssClasses$1.DISABLED);
150
- }
151
- else {
152
- this.adapter.removeClass(cssClasses$1.DISABLED);
153
- }
154
- };
155
- /**
156
- * Handles the animationend event for the checkbox
157
- */
158
- MDCCheckboxFoundation.prototype.handleAnimationEnd = function () {
159
- var _this = this;
160
- if (!this.enableAnimationEndHandler) {
161
- return;
162
- }
163
- clearTimeout(this.animEndLatchTimer);
164
- this.animEndLatchTimer = setTimeout(function () {
165
- _this.adapter.removeClass(_this.currentAnimationClass);
166
- _this.enableAnimationEndHandler = false;
167
- }, numbers.ANIM_END_LATCH_MS);
168
- };
169
- /**
170
- * Handles the change event for the checkbox
171
- */
172
- MDCCheckboxFoundation.prototype.handleChange = function () {
173
- this.transitionCheckState();
174
- };
175
- MDCCheckboxFoundation.prototype.transitionCheckState = function () {
176
- if (!this.adapter.hasNativeControl()) {
177
- return;
178
- }
179
- var oldState = this.currentCheckState;
180
- var newState = this.determineCheckState();
181
- if (oldState === newState) {
182
- return;
183
- }
184
- this.updateAriaChecked();
185
- var TRANSITION_STATE_UNCHECKED = strings$1.TRANSITION_STATE_UNCHECKED;
186
- var SELECTED = cssClasses$1.SELECTED;
187
- if (newState === TRANSITION_STATE_UNCHECKED) {
188
- this.adapter.removeClass(SELECTED);
189
- }
190
- else {
191
- this.adapter.addClass(SELECTED);
192
- }
193
- // Check to ensure that there isn't a previously existing animation class, in case for example
194
- // the user interacted with the checkbox before the animation was finished.
195
- if (this.currentAnimationClass.length > 0) {
196
- clearTimeout(this.animEndLatchTimer);
197
- this.adapter.forceLayout();
198
- this.adapter.removeClass(this.currentAnimationClass);
199
- }
200
- this.currentAnimationClass =
201
- this.getTransitionAnimationClass(oldState, newState);
202
- this.currentCheckState = newState;
203
- // Check for parentNode so that animations are only run when the element is attached
204
- // to the DOM.
205
- if (this.adapter.isAttachedToDOM() &&
206
- this.currentAnimationClass.length > 0) {
207
- this.adapter.addClass(this.currentAnimationClass);
208
- this.enableAnimationEndHandler = true;
209
- }
210
- };
211
- MDCCheckboxFoundation.prototype.determineCheckState = function () {
212
- var TRANSITION_STATE_INDETERMINATE = strings$1.TRANSITION_STATE_INDETERMINATE, TRANSITION_STATE_CHECKED = strings$1.TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = strings$1.TRANSITION_STATE_UNCHECKED;
213
- if (this.adapter.isIndeterminate()) {
214
- return TRANSITION_STATE_INDETERMINATE;
215
- }
216
- return this.adapter.isChecked() ? TRANSITION_STATE_CHECKED :
217
- TRANSITION_STATE_UNCHECKED;
218
- };
219
- MDCCheckboxFoundation.prototype.getTransitionAnimationClass = function (oldState, newState) {
220
- var TRANSITION_STATE_INIT = strings$1.TRANSITION_STATE_INIT, TRANSITION_STATE_CHECKED = strings$1.TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = strings$1.TRANSITION_STATE_UNCHECKED;
221
- var _a = MDCCheckboxFoundation.cssClasses, ANIM_UNCHECKED_CHECKED = _a.ANIM_UNCHECKED_CHECKED, ANIM_UNCHECKED_INDETERMINATE = _a.ANIM_UNCHECKED_INDETERMINATE, ANIM_CHECKED_UNCHECKED = _a.ANIM_CHECKED_UNCHECKED, ANIM_CHECKED_INDETERMINATE = _a.ANIM_CHECKED_INDETERMINATE, ANIM_INDETERMINATE_CHECKED = _a.ANIM_INDETERMINATE_CHECKED, ANIM_INDETERMINATE_UNCHECKED = _a.ANIM_INDETERMINATE_UNCHECKED;
222
- switch (oldState) {
223
- case TRANSITION_STATE_INIT:
224
- if (newState === TRANSITION_STATE_UNCHECKED) {
225
- return '';
226
- }
227
- return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
228
- case TRANSITION_STATE_UNCHECKED:
229
- return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;
230
- case TRANSITION_STATE_CHECKED:
231
- return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;
232
- default: // TRANSITION_STATE_INDETERMINATE
233
- return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
234
- }
235
- };
236
- MDCCheckboxFoundation.prototype.updateAriaChecked = function () {
237
- // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.
238
- if (this.adapter.isIndeterminate()) {
239
- this.adapter.setNativeControlAttr(strings$1.ARIA_CHECKED_ATTR, strings$1.ARIA_CHECKED_INDETERMINATE_VALUE);
240
- }
241
- else {
242
- // The on/off state does not need to keep track of aria-checked, since
243
- // the screenreader uses the checked property on the checkbox element.
244
- this.adapter.removeNativeControlAttr(strings$1.ARIA_CHECKED_ATTR);
245
- }
246
- };
247
- return MDCCheckboxFoundation;
248
- }(ponyfill.MDCFoundation));
249
-
250
- /**
251
- * @license
252
- * Copyright 2016 Google Inc.
253
- *
254
- * Permission is hereby granted, free of charge, to any person obtaining a copy
255
- * of this software and associated documentation files (the "Software"), to deal
256
- * in the Software without restriction, including without limitation the rights
257
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
258
- * copies of the Software, and to permit persons to whom the Software is
259
- * furnished to do so, subject to the following conditions:
260
- *
261
- * The above copyright notice and this permission notice shall be included in
262
- * all copies or substantial portions of the Software.
263
- *
264
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
265
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
266
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
267
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
268
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
269
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
270
- * THE SOFTWARE.
271
- */
272
- var CB_PROTO_PROPS = ['checked', 'indeterminate'];
273
- var MDCCheckbox = /** @class */ (function (_super) {
274
- ponyfill.__extends(MDCCheckbox, _super);
275
- function MDCCheckbox() {
276
- var _this = _super !== null && _super.apply(this, arguments) || this;
277
- _this.rippleSurface = _this.createRipple();
278
- return _this;
279
- }
280
- MDCCheckbox.attachTo = function (root) {
281
- return new MDCCheckbox(root);
282
- };
283
- Object.defineProperty(MDCCheckbox.prototype, "ripple", {
284
- get: function () {
285
- return this.rippleSurface;
286
- },
287
- enumerable: false,
288
- configurable: true
289
- });
290
- Object.defineProperty(MDCCheckbox.prototype, "checked", {
291
- get: function () {
292
- return this.getNativeControl().checked;
293
- },
294
- set: function (checked) {
295
- this.getNativeControl().checked = checked;
296
- },
297
- enumerable: false,
298
- configurable: true
299
- });
300
- Object.defineProperty(MDCCheckbox.prototype, "indeterminate", {
301
- get: function () {
302
- return this.getNativeControl().indeterminate;
303
- },
304
- set: function (indeterminate) {
305
- this.getNativeControl().indeterminate = indeterminate;
306
- },
307
- enumerable: false,
308
- configurable: true
309
- });
310
- Object.defineProperty(MDCCheckbox.prototype, "disabled", {
311
- get: function () {
312
- return this.getNativeControl().disabled;
313
- },
314
- set: function (disabled) {
315
- this.foundation.setDisabled(disabled);
316
- },
317
- enumerable: false,
318
- configurable: true
319
- });
320
- Object.defineProperty(MDCCheckbox.prototype, "value", {
321
- get: function () {
322
- return this.getNativeControl().value;
323
- },
324
- set: function (value) {
325
- this.getNativeControl().value = value;
326
- },
327
- enumerable: false,
328
- configurable: true
329
- });
330
- MDCCheckbox.prototype.initialize = function () {
331
- var DATA_INDETERMINATE_ATTR = strings$1.DATA_INDETERMINATE_ATTR;
332
- this.getNativeControl().indeterminate =
333
- this.getNativeControl().getAttribute(DATA_INDETERMINATE_ATTR) ===
334
- 'true';
335
- this.getNativeControl().removeAttribute(DATA_INDETERMINATE_ATTR);
336
- };
337
- MDCCheckbox.prototype.initialSyncWithDOM = function () {
338
- var _this = this;
339
- this.handleChange = function () {
340
- _this.foundation.handleChange();
341
- };
342
- this.handleAnimationEnd = function () {
343
- _this.foundation.handleAnimationEnd();
344
- };
345
- this.getNativeControl().addEventListener('change', this.handleChange);
346
- this.listen(util.getCorrectEventName(window, 'animationend'), this.handleAnimationEnd);
347
- this.installPropertyChangeHooks();
348
- };
349
- MDCCheckbox.prototype.destroy = function () {
350
- this.rippleSurface.destroy();
351
- this.getNativeControl().removeEventListener('change', this.handleChange);
352
- this.unlisten(util.getCorrectEventName(window, 'animationend'), this.handleAnimationEnd);
353
- this.uninstallPropertyChangeHooks();
354
- _super.prototype.destroy.call(this);
355
- };
356
- MDCCheckbox.prototype.getDefaultFoundation = function () {
357
- var _this = this;
358
- // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
359
- // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
360
- var adapter = {
361
- addClass: function (className) { return _this.root.classList.add(className); },
362
- forceLayout: function () { return _this.root.offsetWidth; },
363
- hasNativeControl: function () { return !!_this.getNativeControl(); },
364
- isAttachedToDOM: function () { return Boolean(_this.root.parentNode); },
365
- isChecked: function () { return _this.checked; },
366
- isIndeterminate: function () { return _this.indeterminate; },
367
- removeClass: function (className) {
368
- _this.root.classList.remove(className);
369
- },
370
- removeNativeControlAttr: function (attr) {
371
- _this.getNativeControl().removeAttribute(attr);
372
- },
373
- setNativeControlAttr: function (attr, value) {
374
- _this.getNativeControl().setAttribute(attr, value);
375
- },
376
- setNativeControlDisabled: function (disabled) {
377
- _this.getNativeControl().disabled = disabled;
378
- },
379
- };
380
- return new MDCCheckboxFoundation(adapter);
381
- };
382
- MDCCheckbox.prototype.createRipple = function () {
383
- var _this = this;
384
- // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
385
- // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
386
- var adapter = ponyfill.__assign(ponyfill.__assign({}, component.MDCRipple.createAdapter(this)), { deregisterInteractionHandler: function (evtType, handler) {
387
- _this.getNativeControl().removeEventListener(evtType, handler, component.applyPassive());
388
- }, isSurfaceActive: function () { return ponyfill.matches(_this.getNativeControl(), ':active'); }, isUnbounded: function () { return true; }, registerInteractionHandler: function (evtType, handler) {
389
- _this.getNativeControl().addEventListener(evtType, handler, component.applyPassive());
390
- } });
391
- return new component.MDCRipple(this.root, new component.MDCRippleFoundation(adapter));
392
- };
393
- MDCCheckbox.prototype.installPropertyChangeHooks = function () {
394
- var e_1, _a;
395
- var _this = this;
396
- var nativeCb = this.getNativeControl();
397
- var cbProto = Object.getPrototypeOf(nativeCb);
398
- var _loop_1 = function (controlState) {
399
- var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
400
- // We have to check for this descriptor, since some browsers (Safari) don't support its return.
401
- // See: https://bugs.webkit.org/show_bug.cgi?id=49739
402
- if (!validDescriptor(desc)) {
403
- return { value: void 0 };
404
- }
405
- // Type cast is needed for compatibility with Closure Compiler.
406
- var nativeGetter = desc.get;
407
- var nativeCbDesc = {
408
- configurable: desc.configurable,
409
- enumerable: desc.enumerable,
410
- get: nativeGetter,
411
- set: function (state) {
412
- desc.set.call(nativeCb, state);
413
- _this.foundation.handleChange();
414
- },
415
- };
416
- Object.defineProperty(nativeCb, controlState, nativeCbDesc);
417
- };
418
- try {
419
- for (var CB_PROTO_PROPS_1 = ponyfill.__values(CB_PROTO_PROPS), CB_PROTO_PROPS_1_1 = CB_PROTO_PROPS_1.next(); !CB_PROTO_PROPS_1_1.done; CB_PROTO_PROPS_1_1 = CB_PROTO_PROPS_1.next()) {
420
- var controlState = CB_PROTO_PROPS_1_1.value;
421
- var state_1 = _loop_1(controlState);
422
- if (typeof state_1 === "object")
423
- return state_1.value;
424
- }
425
- }
426
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
427
- finally {
428
- try {
429
- if (CB_PROTO_PROPS_1_1 && !CB_PROTO_PROPS_1_1.done && (_a = CB_PROTO_PROPS_1.return)) _a.call(CB_PROTO_PROPS_1);
430
- }
431
- finally { if (e_1) throw e_1.error; }
432
- }
433
- };
434
- MDCCheckbox.prototype.uninstallPropertyChangeHooks = function () {
435
- var e_2, _a;
436
- var nativeCb = this.getNativeControl();
437
- var cbProto = Object.getPrototypeOf(nativeCb);
438
- try {
439
- for (var CB_PROTO_PROPS_2 = ponyfill.__values(CB_PROTO_PROPS), CB_PROTO_PROPS_2_1 = CB_PROTO_PROPS_2.next(); !CB_PROTO_PROPS_2_1.done; CB_PROTO_PROPS_2_1 = CB_PROTO_PROPS_2.next()) {
440
- var controlState = CB_PROTO_PROPS_2_1.value;
441
- var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
442
- if (!validDescriptor(desc)) {
443
- return;
444
- }
445
- Object.defineProperty(nativeCb, controlState, desc);
446
- }
447
- }
448
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
449
- finally {
450
- try {
451
- if (CB_PROTO_PROPS_2_1 && !CB_PROTO_PROPS_2_1.done && (_a = CB_PROTO_PROPS_2.return)) _a.call(CB_PROTO_PROPS_2);
452
- }
453
- finally { if (e_2) throw e_2.error; }
454
- }
455
- };
456
- MDCCheckbox.prototype.getNativeControl = function () {
457
- var NATIVE_CONTROL_SELECTOR = strings$1.NATIVE_CONTROL_SELECTOR;
458
- var el = this.root.querySelector(NATIVE_CONTROL_SELECTOR);
459
- if (!el) {
460
- throw new Error("Checkbox component requires a " + NATIVE_CONTROL_SELECTOR + " element");
461
- }
462
- return el;
463
- };
464
- return MDCCheckbox;
465
- }(ponyfill.MDCComponent));
466
- function validDescriptor(inputPropDesc) {
467
- return !!inputPropDesc && typeof inputPropDesc.set === 'function';
468
- }
469
-
470
- /**
471
- * @license
472
- * Copyright 2017 Google Inc.
473
- *
474
- * Permission is hereby granted, free of charge, to any person obtaining a copy
475
- * of this software and associated documentation files (the "Software"), to deal
476
- * in the Software without restriction, including without limitation the rights
477
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
478
- * copies of the Software, and to permit persons to whom the Software is
479
- * furnished to do so, subject to the following conditions:
480
- *
481
- * The above copyright notice and this permission notice shall be included in
482
- * all copies or substantial portions of the Software.
483
- *
484
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
485
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
486
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
487
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
488
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
489
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
490
- * THE SOFTWARE.
491
- */
492
- var cssClasses = {
493
- ROOT: 'mdc-form-field',
494
- };
495
- var strings = {
496
- LABEL_SELECTOR: '.mdc-form-field > label',
497
- };
498
-
499
- /**
500
- * @license
501
- * Copyright 2017 Google Inc.
502
- *
503
- * Permission is hereby granted, free of charge, to any person obtaining a copy
504
- * of this software and associated documentation files (the "Software"), to deal
505
- * in the Software without restriction, including without limitation the rights
506
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
507
- * copies of the Software, and to permit persons to whom the Software is
508
- * furnished to do so, subject to the following conditions:
509
- *
510
- * The above copyright notice and this permission notice shall be included in
511
- * all copies or substantial portions of the Software.
512
- *
513
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
514
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
515
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
516
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
517
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
518
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
519
- * THE SOFTWARE.
520
- */
521
- var MDCFormFieldFoundation = /** @class */ (function (_super) {
522
- ponyfill.__extends(MDCFormFieldFoundation, _super);
523
- function MDCFormFieldFoundation(adapter) {
524
- var _this = _super.call(this, ponyfill.__assign(ponyfill.__assign({}, MDCFormFieldFoundation.defaultAdapter), adapter)) || this;
525
- _this.click = function () {
526
- _this.handleClick();
527
- };
528
- return _this;
529
- }
530
- Object.defineProperty(MDCFormFieldFoundation, "cssClasses", {
531
- get: function () {
532
- return cssClasses;
533
- },
534
- enumerable: false,
535
- configurable: true
536
- });
537
- Object.defineProperty(MDCFormFieldFoundation, "strings", {
538
- get: function () {
539
- return strings;
540
- },
541
- enumerable: false,
542
- configurable: true
543
- });
544
- Object.defineProperty(MDCFormFieldFoundation, "defaultAdapter", {
545
- get: function () {
546
- return {
547
- activateInputRipple: function () { return undefined; },
548
- deactivateInputRipple: function () { return undefined; },
549
- deregisterInteractionHandler: function () { return undefined; },
550
- registerInteractionHandler: function () { return undefined; },
551
- };
552
- },
553
- enumerable: false,
554
- configurable: true
555
- });
556
- MDCFormFieldFoundation.prototype.init = function () {
557
- this.adapter.registerInteractionHandler('click', this.click);
558
- };
559
- MDCFormFieldFoundation.prototype.destroy = function () {
560
- this.adapter.deregisterInteractionHandler('click', this.click);
561
- };
562
- MDCFormFieldFoundation.prototype.handleClick = function () {
563
- var _this = this;
564
- this.adapter.activateInputRipple();
565
- requestAnimationFrame(function () {
566
- _this.adapter.deactivateInputRipple();
567
- });
568
- };
569
- return MDCFormFieldFoundation;
570
- }(ponyfill.MDCFoundation));
571
-
572
- /**
573
- * @license
574
- * Copyright 2017 Google Inc.
575
- *
576
- * Permission is hereby granted, free of charge, to any person obtaining a copy
577
- * of this software and associated documentation files (the "Software"), to deal
578
- * in the Software without restriction, including without limitation the rights
579
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
580
- * copies of the Software, and to permit persons to whom the Software is
581
- * furnished to do so, subject to the following conditions:
582
- *
583
- * The above copyright notice and this permission notice shall be included in
584
- * all copies or substantial portions of the Software.
585
- *
586
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
587
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
588
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
589
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
590
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
591
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
592
- * THE SOFTWARE.
593
- */
594
- var MDCFormField = /** @class */ (function (_super) {
595
- ponyfill.__extends(MDCFormField, _super);
596
- function MDCFormField() {
597
- return _super !== null && _super.apply(this, arguments) || this;
598
- }
599
- MDCFormField.attachTo = function (root) {
600
- return new MDCFormField(root);
601
- };
602
- MDCFormField.prototype.labelEl = function () {
603
- var LABEL_SELECTOR = MDCFormFieldFoundation.strings.LABEL_SELECTOR;
604
- return this.root.querySelector(LABEL_SELECTOR);
605
- };
606
- MDCFormField.prototype.getDefaultFoundation = function () {
607
- var _this = this;
608
- // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
609
- // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
610
- var adapter = {
611
- activateInputRipple: function () {
612
- if (_this.input && _this.input.ripple) {
613
- _this.input.ripple.activate();
614
- }
615
- },
616
- deactivateInputRipple: function () {
617
- if (_this.input && _this.input.ripple) {
618
- _this.input.ripple.deactivate();
619
- }
620
- },
621
- deregisterInteractionHandler: function (evtType, handler) {
622
- var labelEl = _this.labelEl();
623
- if (labelEl) {
624
- labelEl.removeEventListener(evtType, handler);
625
- }
626
- },
627
- registerInteractionHandler: function (evtType, handler) {
628
- var labelEl = _this.labelEl();
629
- if (labelEl) {
630
- labelEl.addEventListener(evtType, handler);
631
- }
632
- },
633
- };
634
- return new MDCFormFieldFoundation(adapter);
635
- };
636
- return MDCFormField;
637
- }(ponyfill.MDCComponent));
7
+ const checkbox_template = require('./checkbox.template-f624966b.js');
638
8
 
639
9
  const checkboxCss = "@charset \"UTF-8\";*,*:before,*:after{box-sizing:border-box}.boolean-input{--limel-boolean-input-box-size:1.25rem;--limel-boolean-input-gap-size:0.5rem;position:relative;isolation:isolate;display:flex;align-items:center;min-height:var(--limel-checkbox-min-height, 2.5rem);width:100%}.boolean-input input[type=checkbox],.boolean-input input[type=radio]{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap;-webkit-appearance:none;-moz-appearance:none;appearance:none}label.boolean-input-label{min-width:var(--limel-boolean-input-box-size);min-height:var(--limel-boolean-input-box-size);padding-top:0.125rem;cursor:pointer;position:relative;width:100%;font-size:var(--limel-theme-default-small-font-size);color:var(--limel-theme-text-primary-on-background-color);padding-left:calc(var(--limel-boolean-input-box-size) + var(--limel-boolean-input-gap-size))}.disabled:not([readonly]):not([readonly=true]) label.boolean-input-label{cursor:not-allowed;color:var(--limel-theme-text-disabled-color)}.required label.boolean-input-label:after{margin-left:0.0625rem;content:\"*\"}.invalid:not(.readonly) label.boolean-input-label{color:var(--limel-theme-error-text-color)}:host(limel-checkbox.hide-label) label.boolean-input-label,.hide-label label.boolean-input-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;opacity:0;width:var(--limel-boolean-input-box-size)}.box{position:absolute;pointer-events:none;transition:border-color 0.4s ease 0.2s, background-color 0.2s ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease;display:inline-block;vertical-align:middle;width:var(--limel-boolean-input-box-size);height:var(--limel-boolean-input-box-size);margin-right:var(--limel-boolean-input-gap-size);border-radius:var(--limel-boolean-input-box-border-radius);border:0.125rem solid;border-color:var(--checkbox-unchecked-border-color, rgb(var(--contrast-900)));background-color:var(--limel-checkbox-background-color, rgb(var(--contrast-300)))}.checked .box,.boolean-input:has(input[type=checkbox]:checked) .box,.boolean-input:has(input[type=radio]:checked) .box{background-color:var(--lime-primary-color, var(--limel-theme-primary-color));border-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.disabled .box{opacity:0.4}.boolean-input:not(.disabled):has(label.boolean-input-label:hover) .box{will-change:box-shadow;box-shadow:var(--button-shadow-hovered)}.boolean-input:not(.disabled):has(label.boolean-input-label:active) .box{will-change:box-shadow;box-shadow:var(--button-shadow-pressed)}.box:before{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);content:\"\";position:absolute;inset:-0.1875rem;border-radius:inherit}.boolean-input:has(input[type=checkbox]:focus-visible) .box:before,.boolean-input:has(input[type=radio]:focus-visible) .box:before{will-change:box-shadow;box-shadow:var(--shadow-depth-8-focused)}.box:after{transition:opacity 0.2s ease, width 0.4s ease, box-shadow 0.6s cubic-bezier(0.68, -0.55, 0, 1.87), transform 0.6s cubic-bezier(0.68, -0.55, 0, 1.87);content:\"\";position:absolute;inset:0;margin:auto;border-radius:1rem;opacity:0;background-color:rgb(var(--color-white))}.boolean-input:not(.disabled):has(label.boolean-input-label:hover) .box:after{will-change:opacity, box-shadow, transform, width}:host(limel-checkbox){min-height:var(--limel-checkbox-min-height, 2.5rem)}.box:after{height:0.125rem;width:0.25rem}.indeterminate .box:after{opacity:1;width:calc(var(--limel-boolean-input-box-size) - 0.5rem)}.checkbox{--limel-boolean-input-box-border-radius:0.25rem}.checkbox svg.check-mark{position:absolute;z-index:1;inset:0;transform:translate3d(-0.125rem, -0.125rem, 0);width:var(--limel-boolean-input-box-size);height:var(--limel-boolean-input-box-size);padding:0.25rem;color:rgb(var(--color-white));opacity:0;stroke-width:0.1875rem;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}.checkbox svg.check-mark path{stroke-dashoffset:29.7833;stroke-dasharray:29.7833;transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1)}.checkbox:not(.indeterminate):has(input[type=checkbox]:checked) svg.check-mark{opacity:1}.checkbox:not(.indeterminate):has(input[type=checkbox]:checked) svg.check-mark path{stroke-dashoffset:0}limel-dynamic-label{margin-top:0.375rem;margin-left:-0.25rem}:host(limel-checkbox:focus),:host(limel-checkbox:focus-visible),:host(limel-checkbox:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-checkbox){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-checkbox:focus) limel-helper-line,:host(limel-checkbox:focus-visible) limel-helper-line,:host(limel-checkbox:focus-within) limel-helper-line,:host(limel-checkbox:hover) limel-helper-line{will-change:grid-template-rows}";
640
10
 
@@ -646,12 +16,10 @@ const Checkbox = class {
646
16
  this.id = randomString.createRandomString();
647
17
  this.helperTextId = randomString.createRandomString();
648
18
  this.destroyMDCInstances = () => {
649
- var _a, _b;
650
- (_a = this.mdcCheckbox) === null || _a === void 0 ? void 0 : _a.destroy();
651
- (_b = this.formField) === null || _b === void 0 ? void 0 : _b.destroy();
652
- const checkboxElement = this.getCheckboxElement();
653
- if (checkboxElement) {
654
- checkboxElement.classList.remove(cssClasses$1.ANIM_CHECKED_INDETERMINATE, cssClasses$1.ANIM_CHECKED_UNCHECKED, cssClasses$1.ANIM_INDETERMINATE_CHECKED, cssClasses$1.ANIM_INDETERMINATE_UNCHECKED, cssClasses$1.ANIM_UNCHECKED_CHECKED, cssClasses$1.ANIM_UNCHECKED_INDETERMINATE);
19
+ const input = this.getCheckboxElement();
20
+ if (input) {
21
+ delete input.dataset['indeterminate'];
22
+ input.indeterminate = false;
655
23
  }
656
24
  };
657
25
  this.isInvalid = () => {
@@ -663,20 +31,23 @@ const Checkbox = class {
663
31
  }
664
32
  };
665
33
  this.initialize = () => {
666
- const element = this.limelCheckbox.shadowRoot.querySelector('.mdc-form-field');
667
- if (!element) {
34
+ const input = this.getCheckboxElement();
35
+ if (!input) {
668
36
  return;
669
37
  }
670
- this.formField = new MDCFormField(element);
671
- this.mdcCheckbox = new MDCCheckbox(this.getCheckboxElement());
672
- this.formField.input = this.mdcCheckbox;
38
+ input.indeterminate = this.indeterminate;
39
+ input.checked = this.checked || this.indeterminate;
673
40
  };
674
41
  this.getCheckboxElement = () => {
675
- return this.limelCheckbox.shadowRoot.querySelector('.mdc-checkbox');
42
+ var _a, _b;
43
+ return (((_b = (_a = this.limelCheckbox) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input[type="checkbox"]')) || null);
676
44
  };
677
45
  this.onChange = (event) => {
46
+ var _a;
678
47
  event.stopPropagation();
679
- this.change.emit(this.mdcCheckbox.checked);
48
+ const input = event.currentTarget;
49
+ const isChecked = (_a = input === null || input === void 0 ? void 0 : input.checked) !== null && _a !== void 0 ? _a : this.checked;
50
+ this.change.emit(isChecked);
680
51
  this.modified = true;
681
52
  };
682
53
  this.disabled = false;
@@ -691,14 +62,19 @@ const Checkbox = class {
691
62
  this.modified = false;
692
63
  }
693
64
  handleCheckedChange(newValue) {
694
- if (!this.mdcCheckbox) {
65
+ const input = this.getCheckboxElement();
66
+ if (!input) {
695
67
  return;
696
68
  }
697
- this.mdcCheckbox.checked = newValue;
69
+ input.checked = newValue || this.indeterminate;
698
70
  }
699
71
  handleIndeterminateChange(newValue) {
700
- this.mdcCheckbox.checked = this.checked;
701
- this.mdcCheckbox.indeterminate = newValue;
72
+ const input = this.getCheckboxElement();
73
+ if (!input) {
74
+ return;
75
+ }
76
+ input.checked = this.checked || newValue;
77
+ input.indeterminate = newValue;
702
78
  }
703
79
  handleReadonlyChange() {
704
80
  this.destroyMDCInstances();