@statistikzh/leu 0.23.0 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/.github/workflows/ci.yml +8 -8
  2. package/.github/workflows/deploy-github-pages.yaml +2 -2
  3. package/.github/workflows/publish.yml +37 -0
  4. package/.github/workflows/release-please.yml +1 -19
  5. package/.release-please-manifest.json +1 -1
  6. package/CHANGELOG.md +26 -0
  7. package/dist/Accordion.js +1 -1
  8. package/dist/Button.js +1 -1
  9. package/dist/ButtonGroup.js +1 -1
  10. package/dist/ChartWrapper.js +1 -1
  11. package/dist/Checkbox.js +1 -1
  12. package/dist/CheckboxGroup.js +1 -1
  13. package/dist/Chip.js +1 -1
  14. package/dist/ChipGroup.js +1 -1
  15. package/dist/ChipLink.js +1 -1
  16. package/dist/ChipRemovable.js +1 -1
  17. package/dist/ChipSelectable.js +1 -1
  18. package/dist/Dialog.js +1 -1
  19. package/dist/Dropdown.js +1 -1
  20. package/dist/FileInput.d.ts +0 -1
  21. package/dist/FileInput.js +1 -35
  22. package/dist/Icon.js +1 -1
  23. package/dist/Input.js +1 -1
  24. package/dist/{LeuElement-CWseJvWv.js → LeuElement-jrR2M5pZ.js} +1 -1
  25. package/dist/Menu.js +1 -1
  26. package/dist/MenuItem.js +1 -1
  27. package/dist/Message.js +1 -1
  28. package/dist/Pagination.js +1 -1
  29. package/dist/Placeholder.js +1 -1
  30. package/dist/Popup.js +1 -1
  31. package/dist/ProgressBar.js +1 -1
  32. package/dist/Radio.js +1 -1
  33. package/dist/RadioGroup.js +1 -1
  34. package/dist/Range.d.ts +83 -20
  35. package/dist/Range.js +276 -73
  36. package/dist/ScrollTop.js +2 -25
  37. package/dist/Select.js +1 -1
  38. package/dist/Spinner.js +1 -1
  39. package/dist/Table.js +1 -1
  40. package/dist/Tag.js +1 -1
  41. package/dist/VisuallyHidden.js +1 -1
  42. package/dist/components/file-input/FileInput.d.ts +2 -2
  43. package/dist/components/file-input/FileInput.d.ts.map +1 -1
  44. package/dist/components/range/Range.d.ts +84 -20
  45. package/dist/components/range/Range.d.ts.map +1 -1
  46. package/dist/components/range/stories/range.stories.d.ts +231 -0
  47. package/dist/components/range/stories/range.stories.d.ts.map +1 -0
  48. package/dist/components/range/test/range.test.d.ts.map +1 -1
  49. package/dist/index.js +2 -2
  50. package/dist/leu-accordion.js +1 -1
  51. package/dist/leu-button-group.js +1 -1
  52. package/dist/leu-button.js +1 -1
  53. package/dist/leu-chart-wrapper.js +1 -1
  54. package/dist/leu-checkbox-group.js +1 -1
  55. package/dist/leu-checkbox.js +1 -1
  56. package/dist/leu-chip-group.js +1 -1
  57. package/dist/leu-chip-link.js +1 -1
  58. package/dist/leu-chip-removable.js +1 -1
  59. package/dist/leu-chip-selectable.js +1 -1
  60. package/dist/leu-dialog.js +1 -1
  61. package/dist/leu-dropdown.js +1 -1
  62. package/dist/leu-file-input.d.ts +0 -1
  63. package/dist/leu-file-input.js +1 -35
  64. package/dist/leu-icon.js +1 -1
  65. package/dist/leu-input.js +1 -1
  66. package/dist/leu-menu-item.js +1 -1
  67. package/dist/leu-menu.js +1 -1
  68. package/dist/leu-message.js +1 -1
  69. package/dist/leu-pagination.js +1 -1
  70. package/dist/leu-placeholder.js +1 -1
  71. package/dist/leu-popup.js +1 -1
  72. package/dist/leu-progress-bar.js +1 -1
  73. package/dist/leu-radio-group.js +1 -1
  74. package/dist/leu-radio.js +1 -1
  75. package/dist/leu-range.js +3 -1
  76. package/dist/leu-scroll-top.js +2 -1
  77. package/dist/leu-select.js +1 -1
  78. package/dist/leu-spinner.js +1 -1
  79. package/dist/leu-table.js +1 -1
  80. package/dist/leu-tag.js +1 -1
  81. package/dist/leu-visually-hidden.js +1 -1
  82. package/dist/lib/utils.d.ts +10 -3
  83. package/dist/lib/utils.d.ts.map +1 -1
  84. package/dist/utils-DBGsNSJW.js +33 -0
  85. package/dist/vscode.html-custom-data.json +142 -89
  86. package/dist/vue/index.d.ts +132 -107
  87. package/dist/web-types.json +269 -169
  88. package/package.json +6 -2
  89. package/src/components/file-input/FileInput.ts +2 -2
  90. package/src/components/range/Range.ts +257 -85
  91. package/src/components/range/range.css +48 -1
  92. package/src/components/range/stories/range.stories.ts +185 -0
  93. package/src/components/range/test/range.test.ts +210 -6
  94. package/src/lib/utils.ts +13 -3
  95. package/dist/components/range/stories/range-slider.stories.d.ts +0 -26
  96. package/dist/components/range/stories/range-slider.stories.d.ts.map +0 -1
  97. package/src/components/range/stories/range-slider.stories.ts +0 -142
package/dist/Range.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
- import { css, html } from 'lit';
3
- import { property } from 'lit/decorators.js';
4
- import { L as LeuElement } from './LeuElement-CWseJvWv.js';
2
+ import { css, nothing, html } from 'lit';
3
+ import { property, query } from 'lit/decorators.js';
4
+ import { ifDefined } from 'lit/directives/if-defined.js';
5
+ import { L as LeuElement } from './LeuElement-jrR2M5pZ.js';
6
+ import { i as isNumber, c as clamp } from './utils-DBGsNSJW.js';
5
7
 
6
8
  var css_248z = css`:host {
7
9
  --range-color: var(--leu-color-black-40);
@@ -40,7 +42,9 @@ var css_248z = css`:host {
40
42
  --range-value-color: var(--range-value-color-disabled);
41
43
  }
42
44
 
43
- /*************************** */
45
+ .container {
46
+ position: relative;
47
+ }
44
48
 
45
49
  .label {
46
50
  display: inline-block;
@@ -49,6 +53,17 @@ var css_248z = css`:host {
49
53
  font: var(--leu-t-regular-regular-font);
50
54
  }
51
55
 
56
+ :host([hide-label]) .label {
57
+ clip: rect(0 0 0 0);
58
+ border: 0;
59
+ height: 1px;
60
+ margin: -1px !important;
61
+ overflow: hidden;
62
+ padding: 0 !important;
63
+ position: absolute;
64
+ width: 1px;
65
+ }
66
+
52
67
  .outputs {
53
68
  position: relative;
54
69
  height: 1.5rem;
@@ -75,6 +90,8 @@ var css_248z = css`:host {
75
90
 
76
91
  .inputs {
77
92
  position: relative;
93
+ z-index: 1;
94
+ height: var(--range-thumb-diameter);
78
95
  }
79
96
 
80
97
  .range {
@@ -188,6 +205,39 @@ var css_248z = css`:host {
188
205
  .range--ghost::-webkit-slider-runnable-track {
189
206
  background: transparent;
190
207
  }
208
+
209
+ /* Ticks */
210
+
211
+ .ticks {
212
+ position: absolute;
213
+ top: calc(
214
+ var(--range-thumb-diameter) / 2 + var(--range-track-height)
215
+ );
216
+ left: calc(var(--range-thumb-diameter) / 2);
217
+ right: calc(var(--range-thumb-diameter) / 2);
218
+ }
219
+
220
+ .tick {
221
+ z-index: -1;
222
+ position: absolute;
223
+ top: 50%;
224
+ width: 2px;
225
+ height: 0.5rem;
226
+ background-color: var(--range-track-background-color);
227
+ transform: translateY(-50%);
228
+ }
229
+
230
+ .tick-labels {
231
+ display: flex;
232
+ justify-content: space-between;
233
+ color: var(--leu-color-black-60);
234
+ font: var(--leu-t-tiny-regular-font);
235
+ margin-top: 0.25rem;
236
+ }
237
+
238
+ .tick-label--max {
239
+ text-align: right;
240
+ }
191
241
  `;
192
242
 
193
243
  const defaultValueConverter = {
@@ -205,98 +255,182 @@ const RANGE_LABELS = ["Von", "Bis"];
205
255
  class LeuRange extends LeuElement {
206
256
  constructor() {
207
257
  super(...arguments);
258
+ /**
259
+ * The default value of the range slider.
260
+ * String input is parsed as a comma-separated list of numbers.
261
+ */
208
262
  this.defaultValue = [50];
263
+ /**
264
+ * The minimum value of the range slider.
265
+ */
209
266
  this.min = 0;
267
+ /**
268
+ * The maximum value of the range slider.
269
+ */
210
270
  this.max = 100;
271
+ /**
272
+ * The step size of the range slider.
273
+ */
211
274
  this.step = 1;
212
275
  this.name = "";
276
+ /**
277
+ * The label of the range slider.
278
+ */
213
279
  this.label = "";
280
+ /**
281
+ * Whether to hide the label of the range slider.
282
+ * If true, the label will still be available for screen readers
283
+ * and is only visually hidden.
284
+ */
285
+ this.hideLabel = false;
286
+ /**
287
+ * Whether the range slider is disabled.
288
+ */
214
289
  this.disabled = false;
290
+ /**
291
+ * Whether to use a range with two handles.
292
+ */
215
293
  this.multiple = false;
216
- }
217
- updated() {
218
- this._updateStyles();
219
- }
220
- get _inputs() {
221
- return Array.from(this.shadowRoot.querySelectorAll("input"));
222
- }
223
- _updateStyles() {
224
- const normalizedRange = this._getNormalizedRange();
225
- this.style.setProperty("--low", normalizedRange[0].toString());
226
- this.style.setProperty("--high", normalizedRange[1].toString());
227
- const inputs = this.multiple
228
- ? [this._getBaseInput(), this._getGhostInput()]
229
- : [this._getBaseInput()];
230
- inputs.forEach((input) => {
231
- const output = this.shadowRoot.querySelector(`.output[for=${input.id}]`);
232
- const normalizedValue = this._getNormalizedValue(input.valueAsNumber);
233
- output.style.setProperty("--value", normalizedValue.toString());
234
- output.value = input.value;
235
- });
236
- }
237
- get value() {
238
- return this._inputs.map((input) => input.value).join(",");
294
+ /**
295
+ * Wheter to show tick marks below the range slider.
296
+ * One tick mark per step will be rendered.
297
+ */
298
+ this.showTicks = false;
299
+ /**
300
+ * Whether to show the min and max labels below the range slider.
301
+ */
302
+ this.showRangeLabels = false;
303
+ /**
304
+ * A prefix to display before the value in the output element(s).
305
+ * Is ignored if a custom valueFormatter is provided.
306
+ */
307
+ this.prefix = "";
308
+ /**
309
+ * A suffix to display after the value in the output element(s).
310
+ * Is ignored if a custom valueFormatter is provided.
311
+ */
312
+ this.suffix = "";
313
+ this._value = this.defaultValue.map((v) => this.clampAndRoundValue(v));
239
314
  }
240
315
  /**
241
- * Sets the value of the underlying input element(s).
242
- * The value has to be an array if "multiple" range is used.
243
- * Otherwise it has to be a string.
316
+ * The value of the range slider.
317
+ * String input is parsed as a comma-separated list of numbers.
318
+ * In multiple mode, if only a single value is provided, the second handle will be set to the minimum value.
319
+ * In single mode, only the first value will be used.
244
320
  */
245
321
  set value(value) {
246
- if (this.multiple && Array.isArray(value)) {
247
- const inputs = this._inputs;
248
- value.forEach((v, i) => {
249
- inputs[i].value = v;
250
- });
251
- this._updateStyles();
322
+ let nextValue = [];
323
+ if (typeof value === "string") {
324
+ nextValue = value
325
+ .split(",")
326
+ .map((v) => Number(v.trim()))
327
+ .filter(isNumber);
328
+ }
329
+ else if (isNumber(value)) {
330
+ nextValue = [value];
252
331
  }
253
- else if (!this.multiple) {
254
- this._getBaseInput().value = value;
255
- this._updateStyles();
332
+ else if (Array.isArray(value)) {
333
+ nextValue = value.map((v) => Number(v)).filter(isNumber);
256
334
  }
335
+ if (nextValue.length === 0) {
336
+ return;
337
+ }
338
+ // In multiple mode, we need to ensure that we always have two values.
339
+ // `min` is a fallback for the second value.
340
+ if (this.multiple && nextValue.length === 1) {
341
+ nextValue.unshift(this.min);
342
+ }
343
+ this._value = nextValue
344
+ .slice(0, this.multiple ? 2 : 1)
345
+ .map((v) => this.clampAndRoundValue(v));
346
+ }
347
+ get value() {
348
+ return this._value.join(",");
257
349
  }
258
350
  get valueAsArray() {
259
- return this._inputs.map((input) => input.valueAsNumber);
351
+ return this._value.slice();
260
352
  }
261
353
  get valueLow() {
262
- const inputs = this._inputs;
263
- if (this.multiple) {
264
- return inputs.map((input) => input.valueAsNumber).sort((a, b) => a - b)[0];
265
- }
266
- return inputs[0].value;
354
+ return Math.min(...this._value);
267
355
  }
268
356
  get valueHigh() {
269
- const inputs = this._inputs;
270
- if (this.multiple) {
271
- return inputs.map((input) => input.valueAsNumber).sort((a, b) => a - b)[1];
357
+ return Math.max(...this._value);
358
+ }
359
+ updated() {
360
+ this.updateStyles();
361
+ }
362
+ willUpdate(changedProperties) {
363
+ // Reflect defaultValue changes to the value property
364
+ // to ensure backwards compatibility with previous versions
365
+ if (changedProperties.has("defaultValue")) {
366
+ this.value = this.defaultValue.map((v) => this.clampAndRoundValue(v));
367
+ }
368
+ if (changedProperties.has("min") ||
369
+ changedProperties.has("max") ||
370
+ changedProperties.has("step")) {
371
+ this._value = this._value.map((v) => this.clampAndRoundValue(v));
372
+ }
373
+ if (changedProperties.has("multiple") && this.multiple) {
374
+ // When switching to multiple mode, ensure that we have two values
375
+ if (this._value.length === 1) {
376
+ this._value = [this.min, this._value[0]];
377
+ }
378
+ }
379
+ else if (changedProperties.has("multiple") && !this.multiple) {
380
+ // When switching to single mode, keep only the lower value
381
+ this._value = [this.valueLow];
272
382
  }
273
- return inputs[0].value;
274
383
  }
275
- _getBaseInput() {
276
- return this.shadowRoot.querySelector(".range--base");
384
+ updateStyles() {
385
+ const normalizedRange = this.getNormalizedRange();
386
+ this.container?.style.setProperty("--low", normalizedRange[0].toString());
387
+ this.container?.style.setProperty("--high", normalizedRange[1].toString());
388
+ const inputs = this.multiple
389
+ ? [this.inputBase, this.inputGhost]
390
+ : [this.inputBase];
391
+ inputs.forEach((input) => {
392
+ const output = input.id === "input-base" ? this.outputBase : this.outputGhost;
393
+ const normalizedValue = this.getNormalizedValue(input.valueAsNumber);
394
+ output.style.setProperty("--value", normalizedValue.toString());
395
+ output.value = this.formatValue(input.valueAsNumber);
396
+ });
277
397
  }
278
- _getGhostInput() {
279
- return this.shadowRoot.querySelector(".range--ghost");
398
+ clampAndRoundValue(value) {
399
+ const clampedValue = clamp(value, this.min, this.max);
400
+ const roundedValue = Math.round((clampedValue - this.min) / this.step) * this.step + this.min;
401
+ return roundedValue;
280
402
  }
281
- _handleInput(_index, _e) {
282
- this._updateStyles();
403
+ handleInput(e) {
404
+ e.stopPropagation();
405
+ if (this.multiple) {
406
+ this.value = [this.inputBase.valueAsNumber, this.inputGhost.valueAsNumber];
407
+ }
408
+ else {
409
+ this.value = [this.inputBase.valueAsNumber];
410
+ }
411
+ this.dispatchEvent(new CustomEvent("input", {
412
+ composed: true,
413
+ bubbles: true,
414
+ detail: { value: this.value, valueAsArray: this.valueAsArray },
415
+ }));
283
416
  }
284
- _getNormalizedValue(value) {
417
+ getNormalizedValue(value) {
285
418
  return (value - this.min) / (this.max - this.min);
286
419
  }
287
- _getNormalizedRange() {
420
+ getNormalizedRange() {
288
421
  if (this.multiple) {
289
422
  return this.valueAsArray
290
- .map((value) => this._getNormalizedValue(value))
423
+ .map((value) => this.getNormalizedValue(value))
291
424
  .sort((a, b) => a - b);
292
425
  }
293
- return [0, this._getNormalizedValue(this.valueAsArray[0])];
426
+ return [0, this.getNormalizedValue(this.valueAsArray[0])];
294
427
  }
295
428
  /**
296
- * Determine if the "click" (pointer event) is closer the
297
- * the value of the other input element. Swap the values if this is the case.
429
+ * This event handler is only applied to the "base" input element and only when in "multiple" mode.
430
+ * It handles pointer events on the *track* and the thumb.
431
+ * This method determines if the interaction was closer to the base or the ghost input.
298
432
  */
299
- _handlePointerDown(e) {
433
+ handlePointerDown(e) {
300
434
  const clickValue = this.min + ((this.max - this.min) * e.offsetX) / this.offsetWidth;
301
435
  const middleValue = (this.valueAsArray[0] + this.valueAsArray[1]) / 2;
302
436
  if ((e.target.valueAsNumber === this.valueLow) ===
@@ -305,17 +439,35 @@ class LeuRange extends LeuElement {
305
439
  * As the pointerdown event is fired before the input event, we first overwrite the value
306
440
  * of the input element that was not clicked on. The active input element will update itself.
307
441
  */
308
- // this._value = [e.target.valueAsNumber, e.target.valueAsNumber]
309
- this._getGhostInput().value = e.target.value;
442
+ this.inputGhost.value = e.target.value;
443
+ }
444
+ }
445
+ formatValue(value) {
446
+ if (this.valueFormatter) {
447
+ return this.valueFormatter(value);
448
+ }
449
+ return `${this.prefix}${value}${this.suffix}`;
450
+ }
451
+ renderTicks() {
452
+ if (!this.showTicks) {
453
+ return nothing;
310
454
  }
455
+ return html `<div class="ticks">
456
+ ${Array.from({ length: (this.max - this.min) / this.step + 1 }, (_, i) => this.min + i * this.step).map((tick) => html `<span
457
+ class="tick"
458
+ style="left: ${this.getNormalizedValue(tick) * 100}%"
459
+ ></span>`)}
460
+ </div>`;
311
461
  }
312
462
  render() {
313
463
  const inputs = this.multiple ? ["base", "ghost"] : ["base"];
314
- const { multiple, disabled, label, defaultValue } = this;
464
+ const { multiple, disabled, label, valueAsArray } = this;
315
465
  return html `
316
466
  <div
317
- role=${multiple ? "group" : undefined}
318
- aria-labelledby=${multiple ? "group-label" : undefined}
467
+ id="container"
468
+ class="container"
469
+ role=${ifDefined(multiple ? "group" : undefined)}
470
+ aria-labelledby=${ifDefined(multiple ? "group-label" : undefined)}
319
471
  >
320
472
  ${multiple
321
473
  ? html `<span id="group-label" class="label">${label}</span>`
@@ -324,15 +476,15 @@ class LeuRange extends LeuElement {
324
476
  ${inputs.map((type, index) => html `<output
325
477
  class="output"
326
478
  for="input-${type}"
327
- value=${defaultValue[index]}
479
+ value=${this.formatValue(valueAsArray[index])}
328
480
  ></output>`)}
329
481
  </div>
330
482
  <div class="inputs">
331
483
  ${inputs.map((type, index) => html `
332
484
  <input
333
- @input=${(e) => this._handleInput(index, e)}
485
+ @input=${this.handleInput}
334
486
  @pointerdown=${multiple && !disabled && index === 0
335
- ? this._handlePointerDown
487
+ ? this.handlePointerDown
336
488
  : undefined}
337
489
  type="range"
338
490
  class="range range--${type}"
@@ -341,13 +493,24 @@ class LeuRange extends LeuElement {
341
493
  min=${this.min}
342
494
  max=${this.max}
343
495
  step=${this.step}
344
- aria-label=${multiple ? RANGE_LABELS[index] : undefined}
496
+ aria-label=${ifDefined(multiple ? RANGE_LABELS[index] : undefined)}
345
497
  ?disabled=${disabled}
346
- .value=${defaultValue[index].toString()}
498
+ .value=${valueAsArray[index].toString()}
347
499
  />
348
500
  `)}
501
+ ${this.renderTicks()}
349
502
  </div>
350
503
  </div>
504
+ ${this.showRangeLabels
505
+ ? html `<div class="tick-labels">
506
+ <span class="tick-label tick-label--min"
507
+ >${this.formatValue(this.min)}</span
508
+ >
509
+ <span class="tick-label tick-label--max"
510
+ >${this.formatValue(this.max)}</span
511
+ >
512
+ </div>`
513
+ : nothing}
351
514
  `;
352
515
  }
353
516
  }
@@ -357,7 +520,11 @@ LeuRange.shadowRootOptions = {
357
520
  delegatesFocus: true,
358
521
  };
359
522
  __decorate([
360
- property({ converter: defaultValueConverter, attribute: "value" })
523
+ property({
524
+ converter: defaultValueConverter,
525
+ attribute: "value",
526
+ reflect: true,
527
+ })
361
528
  ], LeuRange.prototype, "defaultValue", void 0);
362
529
  __decorate([
363
530
  property({ type: Number, reflect: true })
@@ -374,11 +541,47 @@ __decorate([
374
541
  __decorate([
375
542
  property({ type: String, reflect: true })
376
543
  ], LeuRange.prototype, "label", void 0);
544
+ __decorate([
545
+ property({ type: Boolean, reflect: true, attribute: "hide-label" })
546
+ ], LeuRange.prototype, "hideLabel", void 0);
377
547
  __decorate([
378
548
  property({ type: Boolean, reflect: true })
379
549
  ], LeuRange.prototype, "disabled", void 0);
380
550
  __decorate([
381
551
  property({ type: Boolean, reflect: true })
382
552
  ], LeuRange.prototype, "multiple", void 0);
553
+ __decorate([
554
+ property({ type: Boolean, reflect: true, attribute: "show-ticks" })
555
+ ], LeuRange.prototype, "showTicks", void 0);
556
+ __decorate([
557
+ property({ type: Boolean, reflect: true, attribute: "show-range-labels" })
558
+ ], LeuRange.prototype, "showRangeLabels", void 0);
559
+ __decorate([
560
+ property({ type: String, reflect: true })
561
+ ], LeuRange.prototype, "prefix", void 0);
562
+ __decorate([
563
+ property({ type: String, reflect: true })
564
+ ], LeuRange.prototype, "suffix", void 0);
565
+ __decorate([
566
+ property({ attribute: false })
567
+ ], LeuRange.prototype, "valueFormatter", void 0);
568
+ __decorate([
569
+ property({ attribute: false })
570
+ ], LeuRange.prototype, "value", null);
571
+ __decorate([
572
+ query("#container")
573
+ ], LeuRange.prototype, "container", void 0);
574
+ __decorate([
575
+ query("#input-base")
576
+ ], LeuRange.prototype, "inputBase", void 0);
577
+ __decorate([
578
+ query("#input-ghost")
579
+ ], LeuRange.prototype, "inputGhost", void 0);
580
+ __decorate([
581
+ query("output[for=input-base]")
582
+ ], LeuRange.prototype, "outputBase", void 0);
583
+ __decorate([
584
+ query("output[for=input-ghost]")
585
+ ], LeuRange.prototype, "outputGhost", void 0);
383
586
 
384
587
  export { LeuRange };
package/dist/ScrollTop.js CHANGED
@@ -2,36 +2,13 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
2
  import { css, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
  import { state } from 'lit/decorators.js';
5
- import { L as LeuElement } from './LeuElement-CWseJvWv.js';
5
+ import { L as LeuElement } from './LeuElement-jrR2M5pZ.js';
6
6
  import { LeuButton } from './Button.js';
7
7
  import { LeuIcon } from './Icon.js';
8
+ import { t as throttle } from './utils-DBGsNSJW.js';
8
9
  import 'lit/directives/if-defined.js';
9
10
  import './hasSlotController-Bm2tipvG.js';
10
11
 
11
- /**
12
- * Return a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked.
13
- * @param {Function} func - Your function
14
- * @param {Number} timeout - Default is 500 ms
15
- * @returns {Function} - Your function wrapped in a timeout function
16
- */
17
- /**
18
- * Return a throttled function that only invokes func at most once per every wait milliseconds.
19
- * @param {Function} func - Your function
20
- * @param {Number} timeout - Default is 500 ms
21
- * @returns {Function} - Your function wrapped in a timeout function
22
- */
23
- const throttle = function throttle(func, timeout = 500) {
24
- let timer = null;
25
- return (...args) => {
26
- if (timer === null) {
27
- func(...args);
28
- timer = setTimeout(() => {
29
- timer = null;
30
- }, timeout);
31
- }
32
- };
33
- };
34
-
35
12
  var css_248z = css`.scroll-top {
36
13
  overflow: hidden;
37
14
  position: fixed;
package/dist/Select.js CHANGED
@@ -2,7 +2,7 @@ import { css, nothing, html } from 'lit';
2
2
  import { classMap } from 'lit/directives/class-map.js';
3
3
  import { createRef, ref } from 'lit/directives/ref.js';
4
4
  import { ifDefined } from 'lit/directives/if-defined.js';
5
- import { L as LeuElement } from './LeuElement-CWseJvWv.js';
5
+ import { L as LeuElement } from './LeuElement-jrR2M5pZ.js';
6
6
  import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
7
7
  import { LeuButton } from './Button.js';
8
8
  import { LeuMenu } from './Menu.js';
package/dist/Spinner.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { css, html } from 'lit';
2
- import { L as LeuElement } from './LeuElement-CWseJvWv.js';
2
+ import { L as LeuElement } from './LeuElement-jrR2M5pZ.js';
3
3
 
4
4
  var css_248z = css`@keyframes leu-spinner-rotate {
5
5
  from {
package/dist/Table.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { nothing, noChange, css, html } from 'lit';
2
2
  import { classMap } from 'lit/directives/class-map.js';
3
3
  import { createRef, ref } from 'lit/directives/ref.js';
4
- import { L as LeuElement } from './LeuElement-CWseJvWv.js';
4
+ import { L as LeuElement } from './LeuElement-jrR2M5pZ.js';
5
5
  import { directive, Directive, PartType } from 'lit/directive.js';
6
6
  import { LeuIcon } from './Icon.js';
7
7
  import { LeuPagination } from './Pagination.js';
package/dist/Tag.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
2
  import { css, html } from 'lit';
3
3
  import { property } from 'lit/decorators.js';
4
- import { L as LeuElement } from './LeuElement-CWseJvWv.js';
4
+ import { L as LeuElement } from './LeuElement-jrR2M5pZ.js';
5
5
 
6
6
  var css_248z = css`:host {
7
7
  /* --tag-font-regular: var(--leu-font-family-regular);
@@ -1,5 +1,5 @@
1
1
  import { css, html } from 'lit';
2
- import { L as LeuElement } from './LeuElement-CWseJvWv.js';
2
+ import { L as LeuElement } from './LeuElement-jrR2M5pZ.js';
3
3
 
4
4
  var css_248z = css`:host {
5
5
  clip: rect(0 0 0 0);
@@ -1,7 +1,7 @@
1
1
  import { PropertyValues } from "lit";
2
2
  import { LeuElement } from "../../lib/LeuElement.js";
3
- import { LeuButton } from "../../index.js";
4
- import { LeuIcon } from "../icon/leu-icon.js";
3
+ import { LeuButton } from "../button/Button.js";
4
+ import { LeuIcon } from "../icon/Icon.js";
5
5
  import { LeuVisuallyHidden } from "../visually-hidden/VisuallyHidden.js";
6
6
  /**
7
7
  * @todo Pluralize text when multiple files are allowed
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../../src/components/file-input/FileInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM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