@statistikzh/leu 0.21.1 → 0.22.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 (193) hide show
  1. package/.github/workflows/release-please.yml +1 -2
  2. package/.nvmrc +1 -1
  3. package/.release-please-manifest.json +1 -1
  4. package/CHANGELOG.md +16 -0
  5. package/README.md +15 -10
  6. package/dist/Accordion.js +1 -1
  7. package/dist/Button.d.ts +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.d.ts +1 -1
  12. package/dist/Checkbox.js +1 -1
  13. package/dist/CheckboxGroup.js +1 -1
  14. package/dist/Chip.d.ts +1 -7
  15. package/dist/Chip.js +7 -5
  16. package/dist/ChipGroup.d.ts +17 -36
  17. package/dist/ChipGroup.js +35 -33
  18. package/dist/ChipLink.d.ts +5 -21
  19. package/dist/ChipLink.js +14 -15
  20. package/dist/ChipRemovable.d.ts +4 -15
  21. package/dist/ChipRemovable.js +7 -9
  22. package/dist/ChipSelectable.d.ts +14 -37
  23. package/dist/ChipSelectable.js +24 -28
  24. package/dist/Dialog.d.ts +7 -18
  25. package/dist/Dialog.js +15 -18
  26. package/dist/Dropdown.d.ts +16 -24
  27. package/dist/Dropdown.js +23 -21
  28. package/dist/FileInput.d.ts +2 -1
  29. package/dist/FileInput.js +19 -5
  30. package/dist/Icon.d-itcQ94ym.d.ts +151 -0
  31. package/dist/Icon.d.ts +4 -156
  32. package/dist/Icon.js +1 -4
  33. package/dist/Input.d.ts +73 -141
  34. package/dist/Input.js +91 -88
  35. package/dist/{LeuElement-BLUQU9Eu.js → LeuElement-DfsEye-A.js} +1 -1
  36. package/dist/Menu.d.ts +2 -8
  37. package/dist/Menu.js +7 -9
  38. package/dist/MenuItem.d.ts +31 -59
  39. package/dist/MenuItem.js +30 -33
  40. package/dist/Message.d.ts +1 -1
  41. package/dist/Message.js +1 -1
  42. package/dist/Pagination.d.ts +1 -1
  43. package/dist/Pagination.js +1 -1
  44. package/dist/Placeholder.js +1 -1
  45. package/dist/Popup.js +1 -1
  46. package/dist/ProgressBar.js +1 -1
  47. package/dist/Radio.js +1 -1
  48. package/dist/RadioGroup.js +1 -1
  49. package/dist/Range.d.ts +22 -65
  50. package/dist/Range.js +36 -37
  51. package/dist/ScrollTop.d.ts +5 -7
  52. package/dist/ScrollTop.js +10 -15
  53. package/dist/Select.d.ts +2 -1
  54. package/dist/Select.js +1 -1
  55. package/dist/Spinner.js +1 -1
  56. package/dist/Table.d.ts +1 -1
  57. package/dist/Table.js +1 -1
  58. package/dist/Tag.js +1 -1
  59. package/dist/VisuallyHidden.js +1 -1
  60. package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts +5 -0
  61. package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts.map +1 -1
  62. package/dist/components/chip/Chip.d.ts +1 -7
  63. package/dist/components/chip/Chip.d.ts.map +1 -1
  64. package/dist/components/chip/ChipGroup.d.ts +15 -35
  65. package/dist/components/chip/ChipGroup.d.ts.map +1 -1
  66. package/dist/components/chip/ChipLink.d.ts +4 -20
  67. package/dist/components/chip/ChipLink.d.ts.map +1 -1
  68. package/dist/components/chip/ChipRemovable.d.ts +3 -14
  69. package/dist/components/chip/ChipRemovable.d.ts.map +1 -1
  70. package/dist/components/chip/ChipSelectable.d.ts +13 -36
  71. package/dist/components/chip/ChipSelectable.d.ts.map +1 -1
  72. package/dist/components/chip/stories/chip-group.stories.d.ts +1 -1
  73. package/dist/components/chip/stories/chip-group.stories.d.ts.map +1 -1
  74. package/dist/components/chip/stories/chip-link.stories.d.ts.map +1 -1
  75. package/dist/components/chip/stories/chip-selectable.stories.d.ts.map +1 -1
  76. package/dist/components/dialog/Dialog.d.ts +5 -17
  77. package/dist/components/dialog/Dialog.d.ts.map +1 -1
  78. package/dist/components/dropdown/Dropdown.d.ts +14 -23
  79. package/dist/components/dropdown/Dropdown.d.ts.map +1 -1
  80. package/dist/components/dropdown/stories/dropdown.stories.d.ts.map +1 -1
  81. package/dist/components/file-input/FileInput.d.ts +1 -0
  82. package/dist/components/file-input/FileInput.d.ts.map +1 -1
  83. package/dist/components/file-input/leu-file-input.d.ts +5 -0
  84. package/dist/components/file-input/leu-file-input.d.ts.map +1 -1
  85. package/dist/components/file-input/stories/file-input.stories.d.ts +4 -0
  86. package/dist/components/file-input/stories/file-input.stories.d.ts.map +1 -1
  87. package/dist/components/icon/Icon.d.ts +0 -6
  88. package/dist/components/icon/Icon.d.ts.map +1 -1
  89. package/dist/components/input/Input.d.ts +73 -140
  90. package/dist/components/input/Input.d.ts.map +1 -1
  91. package/dist/components/menu/Menu.d.ts +1 -7
  92. package/dist/components/menu/Menu.d.ts.map +1 -1
  93. package/dist/components/menu/MenuItem.d.ts +30 -57
  94. package/dist/components/menu/MenuItem.d.ts.map +1 -1
  95. package/dist/components/message/leu-message.d.ts +5 -0
  96. package/dist/components/message/leu-message.d.ts.map +1 -1
  97. package/dist/components/placeholder/leu-placeholder.d.ts +5 -0
  98. package/dist/components/placeholder/leu-placeholder.d.ts.map +1 -1
  99. package/dist/components/progress-bar/leu-progress-bar.d.ts +5 -0
  100. package/dist/components/progress-bar/leu-progress-bar.d.ts.map +1 -1
  101. package/dist/components/range/Range.d.ts +22 -65
  102. package/dist/components/range/Range.d.ts.map +1 -1
  103. package/dist/components/scroll-top/ScrollTop.d.ts +4 -6
  104. package/dist/components/scroll-top/ScrollTop.d.ts.map +1 -1
  105. package/dist/components/tag/leu-tag.d.ts +5 -0
  106. package/dist/components/tag/leu-tag.d.ts.map +1 -1
  107. package/dist/index.d.ts +11 -0
  108. package/dist/index.d.ts.map +1 -1
  109. package/dist/index.js +13 -4
  110. package/dist/leu-accordion.js +1 -1
  111. package/dist/leu-button-group.js +1 -1
  112. package/dist/leu-button.d.ts +1 -1
  113. package/dist/leu-button.js +1 -1
  114. package/dist/leu-chart-wrapper.d.ts +10 -1
  115. package/dist/leu-chart-wrapper.js +1 -1
  116. package/dist/leu-checkbox-group.js +1 -1
  117. package/dist/leu-checkbox.d.ts +1 -1
  118. package/dist/leu-checkbox.js +1 -1
  119. package/dist/leu-chip-group.d.ts +2 -0
  120. package/dist/leu-chip-group.js +5 -1
  121. package/dist/leu-chip-link.js +3 -1
  122. package/dist/leu-chip-removable.d.ts +1 -1
  123. package/dist/leu-chip-removable.js +3 -3
  124. package/dist/leu-chip-selectable.js +3 -1
  125. package/dist/leu-dialog.d.ts +2 -1
  126. package/dist/leu-dialog.js +3 -3
  127. package/dist/leu-dropdown.d.ts +2 -1
  128. package/dist/leu-dropdown.js +3 -3
  129. package/dist/leu-file-input.d.ts +11 -2
  130. package/dist/leu-file-input.js +11 -4
  131. package/dist/leu-icon.d.ts +1 -1
  132. package/dist/leu-icon.js +1 -1
  133. package/dist/leu-input.d.ts +2 -1
  134. package/dist/leu-input.js +3 -3
  135. package/dist/leu-menu-item.d.ts +2 -2
  136. package/dist/leu-menu-item.js +3 -3
  137. package/dist/leu-menu.d.ts +1 -1
  138. package/dist/leu-menu.js +3 -3
  139. package/dist/leu-message.d.ts +11 -2
  140. package/dist/leu-message.js +1 -1
  141. package/dist/leu-pagination.d.ts +1 -1
  142. package/dist/leu-pagination.js +1 -1
  143. package/dist/leu-placeholder.d.ts +10 -1
  144. package/dist/leu-placeholder.js +1 -1
  145. package/dist/leu-popup.js +1 -1
  146. package/dist/leu-progress-bar.d.ts +10 -1
  147. package/dist/leu-progress-bar.js +1 -1
  148. package/dist/leu-radio-group.js +1 -1
  149. package/dist/leu-radio.js +1 -1
  150. package/dist/leu-range.js +3 -1
  151. package/dist/leu-scroll-top.d.ts +1 -1
  152. package/dist/leu-scroll-top.js +3 -3
  153. package/dist/leu-select.d.ts +2 -1
  154. package/dist/leu-select.js +1 -1
  155. package/dist/leu-spinner.js +1 -1
  156. package/dist/leu-table.d.ts +1 -1
  157. package/dist/leu-table.js +1 -1
  158. package/dist/leu-tag.d.ts +10 -1
  159. package/dist/leu-tag.js +1 -1
  160. package/dist/leu-visually-hidden.js +1 -1
  161. package/dist/vscode.html-custom-data.json +115 -111
  162. package/dist/vue/index.d.ts +116 -131
  163. package/dist/web-types.json +303 -303
  164. package/package.json +1 -1
  165. package/scripts/generate-component/templates/[namespace]-[name].ts +6 -0
  166. package/src/components/chart-wrapper/leu-chart-wrapper.ts +6 -0
  167. package/src/components/chip/Chip.ts +3 -9
  168. package/src/components/chip/ChipGroup.ts +26 -39
  169. package/src/components/chip/ChipLink.ts +7 -18
  170. package/src/components/chip/ChipRemovable.ts +4 -11
  171. package/src/components/chip/ChipSelectable.ts +21 -35
  172. package/src/components/chip/stories/chip-group.stories.ts +4 -7
  173. package/src/components/chip/stories/chip-link.stories.ts +2 -4
  174. package/src/components/chip/stories/chip-selectable.stories.ts +4 -6
  175. package/src/components/chip/test/chip-group.test.ts +34 -31
  176. package/src/components/dialog/Dialog.ts +9 -22
  177. package/src/components/dropdown/Dropdown.ts +20 -24
  178. package/src/components/dropdown/stories/dropdown.stories.ts +6 -2
  179. package/src/components/dropdown/test/dropdown.test.ts +14 -2
  180. package/src/components/file-input/FileInput.ts +12 -1
  181. package/src/components/file-input/leu-file-input.ts +6 -0
  182. package/src/components/file-input/stories/file-input.stories.ts +7 -0
  183. package/src/components/icon/Icon.ts +0 -4
  184. package/src/components/input/Input.ts +108 -105
  185. package/src/components/menu/Menu.ts +3 -12
  186. package/src/components/menu/MenuItem.ts +37 -41
  187. package/src/components/message/leu-message.ts +6 -0
  188. package/src/components/placeholder/leu-placeholder.ts +6 -0
  189. package/src/components/progress-bar/leu-progress-bar.ts +6 -0
  190. package/src/components/range/Range.ts +51 -59
  191. package/src/components/scroll-top/ScrollTop.ts +8 -15
  192. package/src/components/tag/leu-tag.ts +6 -0
  193. package/src/index.ts +11 -0
@@ -3,54 +3,31 @@ import { LeuChipBase } from './Chip.js';
3
3
  import 'lit';
4
4
  import './LeuElement.d-BevHqLUu.js';
5
5
 
6
- declare const SIZES: {
7
- small: string;
8
- regular: string;
9
- };
10
- declare const VARIANTS: {
11
- toggle: string;
12
- radio: string;
13
- };
14
6
  /**
15
7
  * A chip component that can be selected.
16
8
  * @tagname leu-chip-selectable
17
9
  * @slot - The content of the chip
18
- * @prop {keyof typeof SIZES} size - The size of the chip. Not supported for radio variant.
19
- * @prop {keyof typeof VARIANTS} variant - `toggle` or `radio`. Determines if only one or multiple chips can be selected.
20
- * @prop {boolean} checked - Whether the chip is selected.
21
- * @prop {string} value - The value of the chip.
22
10
  */
23
11
  declare class LeuChipSelectable extends LeuChipBase {
24
- static properties: {
25
- size: {
26
- type: StringConstructor;
27
- reflect: boolean;
28
- };
29
- variant: {
30
- type: StringConstructor;
31
- reflect: boolean;
32
- };
33
- checked: {
34
- type: BooleanConstructor;
35
- reflect: boolean;
36
- };
37
- value: {
38
- type: StringConstructor;
39
- reflect: boolean;
40
- };
41
- inverted: {
42
- type: BooleanConstructor;
43
- reflect: boolean;
44
- };
45
- };
12
+ /** The size of the chip. Has no effect when variant is "radio" */
13
+ size: "small" | "regular";
14
+ /**
15
+ * The variant of the chip. Determines if only one or multiple chips can be selected.
16
+ * @default "toggle"
17
+ */
18
+ variant: "toggle" | "radio";
19
+ /** Whether the chip is selected */
20
+ checked: boolean;
21
+ /** The value of the chip */
22
+ value: string;
46
23
  constructor();
47
- handleClick(): void;
24
+ protected handleClick(): void;
48
25
  /**
49
26
  * Returns the value of the chip. If `value` is not set, it will return the text content
50
27
  * @returns {string}
51
28
  */
52
- getValue(): any;
29
+ getValue(): string;
53
30
  render(): lit_html.TemplateResult<1>;
54
31
  }
55
32
 
56
- export { LeuChipSelectable, SIZES, VARIANTS };
33
+ export { LeuChipSelectable };
@@ -1,44 +1,35 @@
1
+ import { _ as __decorate } from './_tslib-CNEFicEt.js';
1
2
  import { html } from 'lit';
3
+ import { property } from 'lit/decorators.js';
2
4
  import { LeuChipBase } from './Chip.js';
3
- import './LeuElement-BLUQU9Eu.js';
5
+ import './LeuElement-DfsEye-A.js';
4
6
 
5
- const SIZES = {
6
- small: "small",
7
- regular: "regular",
8
- };
9
- const VARIANTS = {
10
- toggle: "toggle",
11
- radio: "radio",
12
- };
13
7
  /**
14
8
  * A chip component that can be selected.
15
9
  * @tagname leu-chip-selectable
16
10
  * @slot - The content of the chip
17
- * @prop {keyof typeof SIZES} size - The size of the chip. Not supported for radio variant.
18
- * @prop {keyof typeof VARIANTS} variant - `toggle` or `radio`. Determines if only one or multiple chips can be selected.
19
- * @prop {boolean} checked - Whether the chip is selected.
20
- * @prop {string} value - The value of the chip.
21
11
  */
22
12
  class LeuChipSelectable extends LeuChipBase {
23
13
  constructor() {
24
14
  super();
25
- this.size = SIZES.regular;
15
+ /** The size of the chip. Has no effect when variant is "radio" */
16
+ this.size = "regular";
26
17
  /**
27
- * The variant of the chip. Has an effect not only on the visual appearance but also on the behavior.
28
- * - `toggle`: The chip behaves like a toggle button.
29
- * - `radio`: The chip behaves like a radio button.
18
+ * The variant of the chip. Determines if only one or multiple chips can be selected.
30
19
  * @default "toggle"
31
20
  */
32
- this.variant = VARIANTS.toggle;
21
+ this.variant = "toggle";
22
+ /** Whether the chip is selected */
33
23
  this.checked = false;
24
+ /** The value of the chip */
34
25
  this.value = "";
35
- if (this.variant === VARIANTS.radio && this.size === SIZES.small) {
26
+ if (this.variant === "radio" && this.size === "small") {
36
27
  console.warn("Small size has no effect on radio variant");
37
28
  }
38
29
  }
39
30
  handleClick() {
40
31
  let nextcheckedState = this.checked;
41
- if (this.variant === VARIANTS.radio) {
32
+ if (this.variant === "radio") {
42
33
  nextcheckedState = true;
43
34
  }
44
35
  else {
@@ -73,12 +64,17 @@ class LeuChipSelectable extends LeuChipBase {
73
64
  </button>`;
74
65
  }
75
66
  }
76
- LeuChipSelectable.properties = {
77
- ...LeuChipBase.properties,
78
- size: { type: String, reflect: true },
79
- variant: { type: String, reflect: true },
80
- checked: { type: Boolean, reflect: true },
81
- value: { type: String, reflect: true },
82
- };
67
+ __decorate([
68
+ property({ type: String, reflect: true })
69
+ ], LeuChipSelectable.prototype, "size", void 0);
70
+ __decorate([
71
+ property({ type: String, reflect: true })
72
+ ], LeuChipSelectable.prototype, "variant", void 0);
73
+ __decorate([
74
+ property({ type: Boolean, reflect: true })
75
+ ], LeuChipSelectable.prototype, "checked", void 0);
76
+ __decorate([
77
+ property({ type: String, reflect: true })
78
+ ], LeuChipSelectable.prototype, "value", void 0);
83
79
 
84
- export { LeuChipSelectable, SIZES, VARIANTS };
80
+ export { LeuChipSelectable };
package/dist/Dialog.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as lit_html from 'lit-html';
2
+ import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
2
3
  import * as lit from 'lit';
3
4
  import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
4
5
  import { H as HasSlotController } from './hasSlotController.d-emXwVXWF.js';
5
- import { LeuIcon } from './Icon.js';
6
+ import { L as LeuIcon } from './Icon.d-itcQ94ym.js';
6
7
 
7
8
  /**
8
9
  * @tagname leu-dialog
@@ -20,23 +21,11 @@ declare class LeuDialog extends LeuElement {
20
21
  customElements?: CustomElementRegistry;
21
22
  registry?: CustomElementRegistry;
22
23
  };
23
- /**
24
- * @internal
25
- */
26
- hasSlotController: HasSlotController;
27
- static properties: {
28
- label: {
29
- type: StringConstructor;
30
- };
31
- sublabel: {
32
- type: StringConstructor;
33
- };
34
- open: {
35
- type: BooleanConstructor;
36
- open: boolean;
37
- };
38
- };
39
- constructor();
24
+ label: string;
25
+ sublabel: string;
26
+ open: boolean;
27
+ protected _dialogRef: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
28
+ protected hasSlotController: HasSlotController;
40
29
  show(): void;
41
30
  close(): void;
42
31
  render(): lit_html.TemplateResult<1>;
package/dist/Dialog.js CHANGED
@@ -1,11 +1,11 @@
1
+ import { _ as __decorate } from './_tslib-CNEFicEt.js';
1
2
  import { css, nothing, html } from 'lit';
2
3
  import { createRef, ref } from 'lit/directives/ref.js';
3
4
  import { classMap } from 'lit/directives/class-map.js';
4
- import { L as LeuElement } from './LeuElement-BLUQU9Eu.js';
5
+ import { property } from 'lit/decorators.js';
6
+ import { L as LeuElement } from './LeuElement-DfsEye-A.js';
5
7
  import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
6
8
  import { LeuIcon } from './Icon.js';
7
- import './_tslib-CNEFicEt.js';
8
- import 'lit/decorators.js';
9
9
 
10
10
  var css_248z = css`/* figma https://www.figma.com/design/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?node-id=21161-186812&t=8VgDy9avMRG5aL7s-0 */
11
11
  :host {
@@ -170,19 +170,12 @@ var css_248z = css`/* figma https://www.figma.com/design/d6Pv21UVUbnBs3AdcZijHmb
170
170
  */
171
171
  class LeuDialog extends LeuElement {
172
172
  constructor() {
173
- super();
174
- /**
175
- * @internal
176
- */
177
- this.hasSlotController = new HasSlotController(this, ["toolbar"]);
178
- /** @type {import("lit/directives/ref").Ref<HTMLDialogElement>} */
179
- this._dialogRef = createRef();
180
- /** @type {string} */
173
+ super(...arguments);
181
174
  this.label = "";
182
- /** @type {string} */
183
175
  this.sublabel = "";
184
- /** @type {boolean} */
185
176
  this.open = false;
177
+ this._dialogRef = createRef();
178
+ this.hasSlotController = new HasSlotController(this, ["toolbar"]);
186
179
  }
187
180
  show() {
188
181
  this._dialogRef.value.showModal();
@@ -235,10 +228,14 @@ LeuDialog.shadowRootOptions = {
235
228
  ...LeuElement.shadowRootOptions,
236
229
  delegatesFocus: true,
237
230
  };
238
- LeuDialog.properties = {
239
- label: { type: String },
240
- sublabel: { type: String },
241
- open: { type: Boolean, open: true },
242
- };
231
+ __decorate([
232
+ property({ type: String })
233
+ ], LeuDialog.prototype, "label", void 0);
234
+ __decorate([
235
+ property({ type: String })
236
+ ], LeuDialog.prototype, "sublabel", void 0);
237
+ __decorate([
238
+ property({ type: Boolean, reflect: true })
239
+ ], LeuDialog.prototype, "open", void 0);
243
240
 
244
241
  export { LeuDialog };
@@ -1,4 +1,5 @@
1
1
  import * as lit_html from 'lit-html';
2
+ import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
2
3
  import * as lit from 'lit';
3
4
  import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
4
5
  import { H as HasSlotController } from './hasSlotController.d-emXwVXWF.js';
@@ -6,7 +7,7 @@ import { LeuButton } from './Button.js';
6
7
  import { LeuMenu } from './Menu.js';
7
8
  import { LeuMenuItem } from './MenuItem.js';
8
9
  import { LeuPopup } from './Popup.js';
9
- import './Icon.js';
10
+ import './Icon.d-itcQ94ym.js';
10
11
  import '@floating-ui/dom';
11
12
 
12
13
  /**
@@ -20,35 +21,26 @@ declare class LeuDropdown extends LeuElement {
20
21
  "leu-popup": typeof LeuPopup;
21
22
  };
22
23
  static styles: lit.CSSResultGroup[];
23
- static properties: {
24
- label: {
25
- type: StringConstructor;
26
- reflect: boolean;
27
- };
28
- expanded: {
29
- type: BooleanConstructor;
30
- reflect: boolean;
31
- };
32
- };
33
- hasSlotController: HasSlotController;
34
- constructor();
24
+ label: string;
25
+ expanded: boolean;
26
+ inverted: boolean;
27
+ protected hasSlotController: HasSlotController;
28
+ protected _toggleRef: lit_html_directives_ref_js.Ref<HTMLButtonElement>;
35
29
  connectedCallback(): void;
36
30
  disconnectedCallback(): void;
37
- _documentClickHandler: (event: any) => void;
38
- _keyUpHandler(event: any): void;
39
- _keyDownToggleHandler(event: any): Promise<void>;
40
- _menuItemClickHandler: (e: any) => void;
31
+ protected _documentClickHandler: (event: MouseEvent) => void;
32
+ protected _keyUpHandler: (event: KeyboardEvent) => void;
33
+ protected _keyDownToggleHandler(event: KeyboardEvent): Promise<void>;
34
+ protected _menuItemClickHandler: (e: MouseEvent & {
35
+ target: HTMLElement;
36
+ }) => void;
41
37
  /**
42
38
  * Close the dropdown when the user presses the Escape or the Tab key.
43
39
  * Navigating the menu with the arrow keys is handled by the menu itself.
44
- * @param {KeyboardEvent} e
45
- */
46
- _keyDownMenuHandler: (e: any) => void;
47
- _handleToggleClick(): void;
48
- /**
49
- * @returns {import("../menu/Menu").LeuMenu}
50
40
  */
51
- _getMenu(): LeuMenu;
41
+ protected _keyDownMenuHandler: (e: KeyboardEvent) => void;
42
+ protected _handleToggleClick(): void;
43
+ protected _getMenu(): LeuMenu;
52
44
  render(): lit_html.TemplateResult<1>;
53
45
  }
54
46
 
package/dist/Dropdown.js CHANGED
@@ -1,15 +1,15 @@
1
+ import { _ as __decorate } from './_tslib-CNEFicEt.js';
1
2
  import { css, nothing, html } from 'lit';
2
3
  import { createRef, ref } from 'lit/directives/ref.js';
3
- import { L as LeuElement } from './LeuElement-BLUQU9Eu.js';
4
+ import { property } from 'lit/decorators.js';
5
+ import { L as LeuElement } from './LeuElement-DfsEye-A.js';
4
6
  import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
5
7
  import { LeuButton } from './Button.js';
6
8
  import { LeuMenu } from './Menu.js';
7
9
  import { LeuMenuItem } from './MenuItem.js';
8
10
  import { LeuPopup } from './Popup.js';
9
- import './_tslib-CNEFicEt.js';
10
11
  import 'lit/directives/class-map.js';
11
12
  import 'lit/directives/if-defined.js';
12
- import 'lit/decorators.js';
13
13
  import './Icon.js';
14
14
  import '@floating-ui/dom';
15
15
 
@@ -36,13 +36,22 @@ var css_248z = css`:host {
36
36
  */
37
37
  class LeuDropdown extends LeuElement {
38
38
  constructor() {
39
- super();
39
+ super(...arguments);
40
+ this.label = "";
41
+ this.expanded = false;
42
+ this.inverted = false;
40
43
  this.hasSlotController = new HasSlotController(this, ["icon"]);
44
+ this._toggleRef = createRef();
41
45
  this._documentClickHandler = (event) => {
42
46
  if (!event.composedPath().includes(this)) {
43
47
  this.expanded = false;
44
48
  }
45
49
  };
50
+ this._keyUpHandler = (event) => {
51
+ if (event.key === "Escape") {
52
+ this.expanded = false;
53
+ }
54
+ };
46
55
  this._menuItemClickHandler = (e) => {
47
56
  if (e.target.tagName.toLowerCase() === "leu-menu-item") {
48
57
  this.expanded = false;
@@ -52,7 +61,6 @@ class LeuDropdown extends LeuElement {
52
61
  /**
53
62
  * Close the dropdown when the user presses the Escape or the Tab key.
54
63
  * Navigating the menu with the arrow keys is handled by the menu itself.
55
- * @param {KeyboardEvent} e
56
64
  */
57
65
  this._keyDownMenuHandler = (e) => {
58
66
  if (e.key === "Escape" || e.key === "Tab") {
@@ -61,10 +69,6 @@ class LeuDropdown extends LeuElement {
61
69
  this._toggleRef.value.focus();
62
70
  }
63
71
  };
64
- this.label = "";
65
- this.expanded = false;
66
- /** @type {import("lit/directives/ref").Ref<HTMLButtonElement>} */
67
- this._toggleRef = createRef();
68
72
  }
69
73
  connectedCallback() {
70
74
  super.connectedCallback();
@@ -82,11 +86,6 @@ class LeuDropdown extends LeuElement {
82
86
  menu.removeEventListener("keydown", this._keyDownMenuHandler);
83
87
  menu.removeEventListener("click", this._menuItemClickHandler);
84
88
  }
85
- _keyUpHandler(event) {
86
- if (event.key === "Escape") {
87
- this.expanded = false;
88
- }
89
- }
90
89
  async _keyDownToggleHandler(event) {
91
90
  if (["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key)) {
92
91
  event.preventDefault();
@@ -104,9 +103,6 @@ class LeuDropdown extends LeuElement {
104
103
  _handleToggleClick() {
105
104
  this.expanded = !this.expanded;
106
105
  }
107
- /**
108
- * @returns {import("../menu/Menu").LeuMenu}
109
- */
110
106
  _getMenu() {
111
107
  return this.querySelector("leu-menu");
112
108
  }
@@ -128,6 +124,7 @@ class LeuDropdown extends LeuElement {
128
124
  variant="ghost"
129
125
  expanded=${this.expanded ? "true" : "false"}
130
126
  ?active=${this.expanded}
127
+ ?inverted=${this.inverted}
131
128
  @click=${this._handleToggleClick}
132
129
  @keydown=${this._keyDownToggleHandler}
133
130
  >
@@ -148,9 +145,14 @@ LeuDropdown.dependencies = {
148
145
  "leu-popup": LeuPopup,
149
146
  };
150
147
  LeuDropdown.styles = [LeuElement.styles, css_248z];
151
- LeuDropdown.properties = {
152
- label: { type: String, reflect: true },
153
- expanded: { type: Boolean, reflect: true },
154
- };
148
+ __decorate([
149
+ property({ type: String, reflect: true })
150
+ ], LeuDropdown.prototype, "label", void 0);
151
+ __decorate([
152
+ property({ type: Boolean, reflect: true })
153
+ ], LeuDropdown.prototype, "expanded", void 0);
154
+ __decorate([
155
+ property({ type: Boolean, reflect: true })
156
+ ], LeuDropdown.prototype, "inverted", void 0);
155
157
 
156
158
  export { LeuDropdown };
@@ -3,7 +3,7 @@ import * as lit from 'lit';
3
3
  import { PropertyValues } from 'lit';
4
4
  import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
5
5
  import { LeuButton } from './Button.js';
6
- import { LeuIcon } from './Icon.js';
6
+ import { L as LeuIcon } from './Icon.d-itcQ94ym.js';
7
7
  import { LeuVisuallyHidden } from './VisuallyHidden.js';
8
8
  import './leu-icon.js';
9
9
 
@@ -54,6 +54,7 @@ declare class LeuFileInput extends LeuElement {
54
54
  formResetCallback(): void;
55
55
  protected updateFormValue(): void;
56
56
  protected removeFile(fileToRemove: File): void;
57
+ protected dispatchChangeAndInputEvents(): void;
57
58
  protected static formatFileSize(size: number): lit_html.TemplateResult<1>;
58
59
  protected handleDragEnter: (event: DragEvent) => void;
59
60
  protected handleDragOver: (event: DragEvent) => void;
package/dist/FileInput.js CHANGED
@@ -3,7 +3,7 @@ import { css, html, nothing } from 'lit';
3
3
  import { property, state, query } from 'lit/decorators.js';
4
4
  import { ifDefined } from 'lit/directives/if-defined.js';
5
5
  import { classMap } from 'lit/directives/class-map.js';
6
- import { L as LeuElement } from './LeuElement-BLUQU9Eu.js';
6
+ import { L as LeuElement } from './LeuElement-DfsEye-A.js';
7
7
  import './Accordion.js';
8
8
  import { LeuButton } from './Button.js';
9
9
  import './ButtonGroup.js';
@@ -14,22 +14,29 @@ import './ChipGroup.js';
14
14
  import './ChipLink.js';
15
15
  import './ChipRemovable.js';
16
16
  import './ChipSelectable.js';
17
+ import './Dialog.js';
17
18
  import './Dropdown.js';
19
+ import { LeuIcon } from './Icon.js';
18
20
  import './Input.js';
19
21
  import './Menu.js';
20
22
  import './MenuItem.js';
23
+ import './Message.js';
21
24
  import './Pagination.js';
25
+ import './Placeholder.js';
22
26
  import './Popup.js';
27
+ import './ProgressBar.js';
23
28
  import './Radio.js';
24
29
  import './RadioGroup.js';
30
+ import './Range.js';
31
+ import './ScrollTop.js';
25
32
  import './Select.js';
33
+ import './Spinner.js';
26
34
  import './Table.js';
27
- import './leu-icon.js';
35
+ import './Tag.js';
28
36
  import { LeuVisuallyHidden } from './VisuallyHidden.js';
29
- import { LeuIcon } from './Icon.js';
37
+ import './leu-icon.js';
30
38
  import 'lit/static-html.js';
31
39
  import './hasSlotController-Bm2tipvG.js';
32
- import './Spinner.js';
33
40
  import './Chip.js';
34
41
  import 'lit/directives/ref.js';
35
42
  import '@floating-ui/dom';
@@ -202,6 +209,7 @@ class LeuFileInput extends LeuElement {
202
209
  this.isDragging = false;
203
210
  };
204
211
  this.handleDrop = (event) => {
212
+ this.isDragging = false;
205
213
  if (this.disabled)
206
214
  return;
207
215
  event.preventDefault();
@@ -209,10 +217,13 @@ class LeuFileInput extends LeuElement {
209
217
  const dt = event.dataTransfer;
210
218
  const files = dt.files;
211
219
  const acceptedFiles = [...files].filter((file) => this.isAcceptedFile(file));
220
+ if (acceptedFiles.length < 1) {
221
+ return;
222
+ }
212
223
  this.files = this.multiple
213
224
  ? this.files.concat(acceptedFiles)
214
225
  : acceptedFiles.slice(0, 1);
215
- this.isDragging = false;
226
+ this.dispatchChangeAndInputEvents();
216
227
  };
217
228
  // Initialize the ElementInternals for form association
218
229
  this.internals = this.attachInternals();
@@ -257,6 +268,9 @@ class LeuFileInput extends LeuElement {
257
268
  }
258
269
  removeFile(fileToRemove) {
259
270
  this.files = this.files.filter((file) => file !== fileToRemove);
271
+ this.dispatchChangeAndInputEvents();
272
+ }
273
+ dispatchChangeAndInputEvents() {
260
274
  this.dispatchEvent(new CustomEvent("input", {
261
275
  composed: true,
262
276
  bubbles: true,
@@ -0,0 +1,151 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
4
+
5
+ type IconPathName = keyof typeof paths;
6
+ declare const paths: {
7
+ addNew: string;
8
+ alert: string;
9
+ angleDropDown: string;
10
+ angleDropUp: string;
11
+ angleLeft: string;
12
+ angleRight: string;
13
+ arrowDown: string;
14
+ arrowLeft: string;
15
+ arrowRight: string;
16
+ arrowUp: string;
17
+ backward: string;
18
+ block: string;
19
+ calendar: string;
20
+ camera: string;
21
+ caution: string;
22
+ cc: string;
23
+ chart: string;
24
+ chatMessage: string;
25
+ check: string;
26
+ clear: string;
27
+ close: string;
28
+ comment: string;
29
+ conference: string;
30
+ confirm: string;
31
+ confirmPlain: string;
32
+ conversation: string;
33
+ copy: string;
34
+ delete: string;
35
+ download: string;
36
+ earth: string;
37
+ edit: string;
38
+ email: string;
39
+ file: string;
40
+ fileCsv: string;
41
+ fileOutline: string;
42
+ filePdf: string;
43
+ fileXml: string;
44
+ files: string;
45
+ filter: string;
46
+ floppy: string;
47
+ folder: string;
48
+ forward: string;
49
+ getInformation: string;
50
+ hide: string;
51
+ home: string;
52
+ image: string;
53
+ income: string;
54
+ launch: string;
55
+ levelUp: string;
56
+ like: string;
57
+ link: string;
58
+ list: string;
59
+ location: string;
60
+ lock: string;
61
+ login: string;
62
+ logout: string;
63
+ love: string;
64
+ emailOpen: string;
65
+ map: string;
66
+ mapLocateMe: string;
67
+ mapNavigation: string;
68
+ mapPin: string;
69
+ menu: string;
70
+ menuOverflow: string;
71
+ minus: string;
72
+ money: string;
73
+ moneyIncome: string;
74
+ organisation: string;
75
+ overflow: string;
76
+ paperplane: string;
77
+ paragraph: string;
78
+ passport: string;
79
+ phoneCall: string;
80
+ piechart: string;
81
+ pill: string;
82
+ pin: string;
83
+ plus: string;
84
+ print: string;
85
+ refresh: string;
86
+ remove: string;
87
+ repost: string;
88
+ resizeText: string;
89
+ ruler: string;
90
+ search: string;
91
+ securities: string;
92
+ setting: string;
93
+ share: string;
94
+ show: string;
95
+ smileyDevastated: string;
96
+ smileyIndifferent: string;
97
+ smileySad: string;
98
+ smileySmile: string;
99
+ smileyThrilled: string;
100
+ swissId: string;
101
+ time: string;
102
+ upload: string;
103
+ user: string;
104
+ userMultiple: string;
105
+ vote: string;
106
+ zoom: string;
107
+ zoomOut: string;
108
+ fastForward: string;
109
+ fastRewind: string;
110
+ fullScreen: string;
111
+ next: string;
112
+ pause: string;
113
+ play: string;
114
+ playButton: string;
115
+ previous: string;
116
+ skipNext: string;
117
+ skipPrevious: string;
118
+ stop: string;
119
+ facebook: string;
120
+ google: string;
121
+ instagram: string;
122
+ kununu: string;
123
+ linkedin: string;
124
+ snapchat: string;
125
+ tiktok: string;
126
+ twitter: string;
127
+ xing: string;
128
+ youtube: string;
129
+ youtubeLogo: string;
130
+ };
131
+
132
+ /**
133
+ * A component to render all defined zhWeb icons.
134
+ * The `fill` of the icon is set to `currentColor` and
135
+ * can be overriden by setting the css `color` property.
136
+ * If the icon name is not found, a placeholder will be displayed.
137
+ *
138
+ * @tagname leu-icon
139
+ * @cssprop --leu-icon-size - The size of the icon.
140
+ */
141
+ declare class LeuIcon extends LeuElement {
142
+ static styles: lit.CSSResultGroup[];
143
+ /**
144
+ * The name of the icon to display.
145
+ */
146
+ name: IconPathName | "";
147
+ render(): lit_html.TemplateResult<1>;
148
+ }
149
+
150
+ export { LeuIcon as L };
151
+ export type { IconPathName as I };