@statistikzh/leu 0.28.0 → 0.28.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 (114) hide show
  1. package/.github/workflows/publish.yml +1 -3
  2. package/.release-please-manifest.json +1 -1
  3. package/AGENTS.md +162 -0
  4. package/CHANGELOG.md +7 -0
  5. package/dist/{Accordion-D9kLsiBW.js → Accordion-CwkI7sfx.js} +1 -1
  6. package/dist/Accordion.js +2 -2
  7. package/dist/{Button-DyNVOHCd.js → Button-D1aYnunQ.js} +3 -3
  8. package/dist/Button.js +4 -4
  9. package/dist/{ButtonGroup-MEh4vb5a.js → ButtonGroup-CqThYjzX.js} +2 -2
  10. package/dist/ButtonGroup.js +5 -5
  11. package/dist/{ChartWrapper-DAl91BIN.js → ChartWrapper-BjVT4x-H.js} +2 -2
  12. package/dist/ChartWrapper.js +3 -3
  13. package/dist/{Checkbox-CGGyUW9U.js → Checkbox-HxYqp2w4.js} +2 -2
  14. package/dist/Checkbox.js +3 -3
  15. package/dist/{CheckboxGroup-DXt5iMdj.js → CheckboxGroup-DYws2rwt.js} +2 -2
  16. package/dist/CheckboxGroup.js +4 -4
  17. package/dist/{Chip-BGs71WGH.js → Chip-gKxD6IaZ.js} +1 -1
  18. package/dist/Chip.js +2 -2
  19. package/dist/{ChipGroup-BcGyusP-.js → ChipGroup-ZvBzX_wd.js} +1 -1
  20. package/dist/ChipGroup.js +3 -3
  21. package/dist/ChipLink.js +2 -2
  22. package/dist/ChipRemovable.js +3 -3
  23. package/dist/ChipSelectable.js +2 -2
  24. package/dist/{Dialog-BzuyL1U3.js → Dialog-BYpzTprV.js} +2 -2
  25. package/dist/Dialog.js +3 -3
  26. package/dist/{Dropdown-plyBTM15.js → Dropdown-C4CgE4E-.js} +5 -5
  27. package/dist/Dropdown.js +8 -8
  28. package/dist/{FileInput-BT3Fe-0J.js → FileInput-nsnSQCaU.js} +8 -6
  29. package/dist/FileInput.d.ts +1 -1
  30. package/dist/FileInput.js +6 -6
  31. package/dist/{Icon-D83qesg5.js → Icon-D8HTPEFH.js} +1 -1
  32. package/dist/Icon.js +2 -2
  33. package/dist/{Input-D7zS50oz.js → Input-OrILqlax.js} +2 -2
  34. package/dist/Input.js +3 -3
  35. package/dist/{LeuElement-DQI8cqZV.js → LeuElement-C_lcHzQI.js} +1 -1
  36. package/dist/{Menu-DRU1LiMM.js → Menu-CFLCnI34.js} +2 -2
  37. package/dist/Menu.js +4 -4
  38. package/dist/{MenuItem-DCttylRO.js → MenuItem-ICjLCGim.js} +2 -2
  39. package/dist/MenuItem.js +3 -3
  40. package/dist/{Message-0NxnKEqw.js → Message-Dw5D_0i1.js} +2 -2
  41. package/dist/Message.js +3 -3
  42. package/dist/{Pagination-CIy7YvWE.js → Pagination-D1tP5FrM.js} +4 -4
  43. package/dist/Pagination.js +6 -6
  44. package/dist/{Placeholder-Dol_X5Hp.js → Placeholder-CnGzCZ5-.js} +1 -1
  45. package/dist/Placeholder.js +2 -2
  46. package/dist/{Popup-nJrJHGSy.js → Popup-BiN_tZDN.js} +1 -1
  47. package/dist/Popup.js +2 -2
  48. package/dist/{ProgressBar-Dmq9veqU.js → ProgressBar-BfJo_KyU.js} +1 -1
  49. package/dist/ProgressBar.js +2 -2
  50. package/dist/{Radio-W5ck_IJI.js → Radio-CV7vuQUj.js} +1 -1
  51. package/dist/Radio.js +2 -2
  52. package/dist/{RadioGroup-De5x2YCO.js → RadioGroup-C3XWSScc.js} +2 -2
  53. package/dist/RadioGroup.js +3 -3
  54. package/dist/{Range-NCdfDkeD.js → Range-C8RVrIM9.js} +1 -1
  55. package/dist/Range.js +2 -2
  56. package/dist/{ScrollTop-DwcNIKmN.js → ScrollTop-B_TJ_k4m.js} +3 -3
  57. package/dist/ScrollTop.js +5 -5
  58. package/dist/{Select-Bpicra9q.js → Select-CbPTrL3G.js} +7 -7
  59. package/dist/Select.js +9 -9
  60. package/dist/{Spinner-BBiVZxFH.js → Spinner-ChKJQJTN.js} +1 -1
  61. package/dist/Spinner.js +2 -2
  62. package/dist/{Tab-Ce9nrDok.js → Tab-BJbzY1xd.js} +1 -1
  63. package/dist/Tab.js +2 -2
  64. package/dist/{TabGroup-C-cd4Wcx.js → TabGroup-BIaCHrKR.js} +3 -3
  65. package/dist/TabGroup.js +4 -4
  66. package/dist/{TabPanel-BW1ydVBT.js → TabPanel-CTyw410b.js} +1 -1
  67. package/dist/TabPanel.js +2 -2
  68. package/dist/{Table-DiYqIzBu.js → Table-D3QmePJd.js} +3 -3
  69. package/dist/Table.js +7 -7
  70. package/dist/{Tag-Ct8Hhv7W.js → Tag-nUnWtHYy.js} +1 -1
  71. package/dist/Tag.js +2 -2
  72. package/dist/{VisuallyHidden-CpYXyuC7.js → VisuallyHidden-DF2q9pTa.js} +1 -1
  73. package/dist/VisuallyHidden.js +2 -2
  74. package/dist/index.js +30 -30
  75. package/dist/leu-accordion.js +2 -2
  76. package/dist/leu-button-group.js +5 -5
  77. package/dist/leu-button.js +4 -4
  78. package/dist/leu-chart-wrapper.js +3 -3
  79. package/dist/leu-checkbox-group.js +4 -4
  80. package/dist/leu-checkbox.js +3 -3
  81. package/dist/leu-chip-group.js +3 -3
  82. package/dist/leu-chip-link.js +2 -2
  83. package/dist/leu-chip-removable.js +3 -3
  84. package/dist/leu-chip-selectable.js +2 -2
  85. package/dist/leu-dialog.js +3 -3
  86. package/dist/leu-dropdown.js +8 -8
  87. package/dist/leu-file-input.js +6 -6
  88. package/dist/leu-icon.js +2 -2
  89. package/dist/leu-input.js +3 -3
  90. package/dist/leu-menu-item.js +3 -3
  91. package/dist/leu-menu.js +4 -4
  92. package/dist/leu-message.js +3 -3
  93. package/dist/leu-pagination.js +6 -6
  94. package/dist/leu-placeholder.js +2 -2
  95. package/dist/leu-popup.js +2 -2
  96. package/dist/leu-progress-bar.js +2 -2
  97. package/dist/leu-radio-group.js +3 -3
  98. package/dist/leu-radio.js +2 -2
  99. package/dist/leu-range.js +2 -2
  100. package/dist/leu-scroll-top.js +5 -5
  101. package/dist/leu-select.js +9 -9
  102. package/dist/leu-spinner.js +2 -2
  103. package/dist/leu-tab-group.js +4 -4
  104. package/dist/leu-tab-panel.js +2 -2
  105. package/dist/leu-tab.js +2 -2
  106. package/dist/leu-table.js +7 -7
  107. package/dist/leu-tag.js +2 -2
  108. package/dist/leu-visually-hidden.js +2 -2
  109. package/dist/vscode.html-custom-data.json +11 -11
  110. package/dist/vue/index.d.ts +20 -20
  111. package/dist/web-types.json +28 -28
  112. package/package.json +6 -4
  113. package/src/components/file-input/FileInput.ts +4 -2
  114. package/src/components/file-input/test/file-input.test.ts +24 -0
@@ -1,10 +1,10 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import "./Icon-D83qesg5.js";
3
- import "./Spinner-BBiVZxFH.js";
4
- import "./Button-DyNVOHCd.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import "./Icon-D8HTPEFH.js";
3
+ import "./Spinner-ChKJQJTN.js";
4
+ import "./Button-D1aYnunQ.js";
5
5
  import "./FormAssociatedMixin-DLPvFtbT.js";
6
- import "./VisuallyHidden-CpYXyuC7.js";
7
- import { t as LeuPagination } from "./Pagination-CIy7YvWE.js";
6
+ import "./VisuallyHidden-DF2q9pTa.js";
7
+ import { t as LeuPagination } from "./Pagination-D1tP5FrM.js";
8
8
  //#region src/components/pagination/leu-pagination.ts
9
9
  LeuPagination.define("leu-pagination");
10
10
  //#endregion
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuPlaceholder } from "./Placeholder-Dol_X5Hp.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuPlaceholder } from "./Placeholder-CnGzCZ5-.js";
3
3
  //#region src/components/placeholder/leu-placeholder.ts
4
4
  LeuPlaceholder.define("leu-placeholder");
5
5
  //#endregion
package/dist/leu-popup.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuPopup } from "./Popup-nJrJHGSy.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuPopup } from "./Popup-BiN_tZDN.js";
3
3
  //#region src/components/popup/leu-popup.ts
4
4
  LeuPopup.define("leu-popup");
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuProgressBar } from "./ProgressBar-Dmq9veqU.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuProgressBar } from "./ProgressBar-BfJo_KyU.js";
3
3
  //#region src/components/progress-bar/leu-progress-bar.ts
4
4
  LeuProgressBar.define("leu-progress-bar");
5
5
  //#endregion
@@ -1,6 +1,6 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import "./Radio-W5ck_IJI.js";
3
- import { t as LeuRadioGroup } from "./RadioGroup-De5x2YCO.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import "./Radio-CV7vuQUj.js";
3
+ import { t as LeuRadioGroup } from "./RadioGroup-C3XWSScc.js";
4
4
  //#region src/components/radio/leu-radio-group.ts
5
5
  LeuRadioGroup.define("leu-radio-group");
6
6
  //#endregion
package/dist/leu-radio.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuRadio } from "./Radio-W5ck_IJI.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuRadio } from "./Radio-CV7vuQUj.js";
3
3
  //#region src/components/radio/leu-radio.ts
4
4
  LeuRadio.define("leu-radio");
5
5
  //#endregion
package/dist/leu-range.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuRange } from "./Range-NCdfDkeD.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuRange } from "./Range-C8RVrIM9.js";
3
3
  //#region src/components/range/leu-range.ts
4
4
  LeuRange.define("leu-range");
5
5
  //#endregion
@@ -1,9 +1,9 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import "./Icon-D83qesg5.js";
3
- import "./Spinner-BBiVZxFH.js";
4
- import "./Button-DyNVOHCd.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import "./Icon-D8HTPEFH.js";
3
+ import "./Spinner-ChKJQJTN.js";
4
+ import "./Button-D1aYnunQ.js";
5
5
  import "./FormAssociatedMixin-DLPvFtbT.js";
6
- import { t as LeuScrollTop } from "./ScrollTop-DwcNIKmN.js";
6
+ import { t as LeuScrollTop } from "./ScrollTop-B_TJ_k4m.js";
7
7
  //#region src/components/scroll-top/leu-scroll-top.ts
8
8
  LeuScrollTop.define("leu-scroll-top");
9
9
  //#endregion
@@ -1,13 +1,13 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import "./Icon-D83qesg5.js";
3
- import "./Spinner-BBiVZxFH.js";
4
- import "./Button-DyNVOHCd.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import "./Icon-D8HTPEFH.js";
3
+ import "./Spinner-ChKJQJTN.js";
4
+ import "./Button-D1aYnunQ.js";
5
5
  import "./FormAssociatedMixin-DLPvFtbT.js";
6
- import "./MenuItem-DCttylRO.js";
7
- import "./Menu-DRU1LiMM.js";
8
- import "./Popup-nJrJHGSy.js";
9
- import "./Input-D7zS50oz.js";
10
- import { t as LeuSelect } from "./Select-Bpicra9q.js";
6
+ import "./MenuItem-ICjLCGim.js";
7
+ import "./Menu-CFLCnI34.js";
8
+ import "./Popup-BiN_tZDN.js";
9
+ import "./Input-OrILqlax.js";
10
+ import { t as LeuSelect } from "./Select-CbPTrL3G.js";
11
11
  //#region src/components/select/leu-select.ts
12
12
  LeuSelect.define("leu-select");
13
13
  //#endregion
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuSpinner } from "./Spinner-BBiVZxFH.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuSpinner } from "./Spinner-ChKJQJTN.js";
3
3
  //#region src/components/spinner/leu-spinner.ts
4
4
  LeuSpinner.define("leu-spinner");
5
5
  //#endregion
@@ -1,7 +1,7 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import "./Tab-Ce9nrDok.js";
3
- import "./TabPanel-BW1ydVBT.js";
4
- import { t as LeuTabGroup } from "./TabGroup-C-cd4Wcx.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import "./Tab-BJbzY1xd.js";
3
+ import "./TabPanel-CTyw410b.js";
4
+ import { t as LeuTabGroup } from "./TabGroup-BIaCHrKR.js";
5
5
  //#region src/components/tab/leu-tab-group.ts
6
6
  LeuTabGroup.define("leu-tab-group");
7
7
  //#endregion
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuTabPanel } from "./TabPanel-BW1ydVBT.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuTabPanel } from "./TabPanel-CTyw410b.js";
3
3
  //#region src/components/tab/leu-tab-panel.ts
4
4
  LeuTabPanel.define("leu-tab-panel");
5
5
  //#endregion
package/dist/leu-tab.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuTab } from "./Tab-Ce9nrDok.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuTab } from "./Tab-BJbzY1xd.js";
3
3
  //#region src/components/tab/leu-tab.ts
4
4
  LeuTab.define("leu-tab");
5
5
  //#endregion
package/dist/leu-table.js CHANGED
@@ -1,11 +1,11 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import "./Icon-D83qesg5.js";
3
- import "./Spinner-BBiVZxFH.js";
4
- import "./Button-DyNVOHCd.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import "./Icon-D8HTPEFH.js";
3
+ import "./Spinner-ChKJQJTN.js";
4
+ import "./Button-D1aYnunQ.js";
5
5
  import "./FormAssociatedMixin-DLPvFtbT.js";
6
- import "./VisuallyHidden-CpYXyuC7.js";
7
- import "./Pagination-CIy7YvWE.js";
8
- import { t as LeuTable } from "./Table-DiYqIzBu.js";
6
+ import "./VisuallyHidden-DF2q9pTa.js";
7
+ import "./Pagination-D1tP5FrM.js";
8
+ import { t as LeuTable } from "./Table-D3QmePJd.js";
9
9
  //#region src/components/table/leu-table.ts
10
10
  LeuTable.define("leu-table");
11
11
  //#endregion
package/dist/leu-tag.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuTag } from "./Tag-Ct8Hhv7W.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuTag } from "./Tag-nUnWtHYy.js";
3
3
  //#region src/components/tag/leu-tag.ts
4
4
  LeuTag.define("leu-tag");
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
- import "./LeuElement-DQI8cqZV.js";
2
- import { t as LeuVisuallyHidden } from "./VisuallyHidden-CpYXyuC7.js";
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import { t as LeuVisuallyHidden } from "./VisuallyHidden-DF2q9pTa.js";
3
3
  //#region src/components/visually-hidden/leu-visually-hidden.ts
4
4
  LeuVisuallyHidden.define("leu-visually-hidden");
5
5
  //#endregion
@@ -34,6 +34,17 @@
34
34
  }
35
35
  ]
36
36
  },
37
+ {
38
+ "name": "leu-button-group",
39
+ "description": "A radio input-like button group component.\nIt allows only one button to be active at a time.\n---\n\n\n### **Events:**\n - **input** - When the value of the group changes by clicking a button\n\n### **Slots:**\n - _default_ - Slot for the buttons",
40
+ "attributes": [],
41
+ "references": [
42
+ {
43
+ "name": "Documentation",
44
+ "url": "https://statistikzh.github.io/leu/?path=/story/button-group"
45
+ }
46
+ ]
47
+ },
37
48
  {
38
49
  "name": "leu-button",
39
50
  "description": "\n---\n\n\n### **Slots:**\n - **before** - The icon to display before the label\n- **after** - The icon to display after the label\n- _default_ - The label of the button or the icon if no label is set",
@@ -124,17 +135,6 @@
124
135
  }
125
136
  ]
126
137
  },
127
- {
128
- "name": "leu-button-group",
129
- "description": "A radio input-like button group component.\nIt allows only one button to be active at a time.\n---\n\n\n### **Events:**\n - **input** - When the value of the group changes by clicking a button\n\n### **Slots:**\n - _default_ - Slot for the buttons",
130
- "attributes": [],
131
- "references": [
132
- {
133
- "name": "Documentation",
134
- "url": "https://statistikzh.github.io/leu/?path=/story/button-group"
135
- }
136
- ]
137
- },
138
138
  {
139
139
  "name": "leu-chart-wrapper",
140
140
  "description": "A wrapper element for charts.\n---\n\n\n### **Slots:**\n - **title** - The title of the chart. Use a heading tag (h2-4) depending on your context.\n- **description** - A description of the chart. Content is wrapped in a `<p>` tag by the component.\n- **chart** - The actual chart\n- **caption** - A caption for the chart, e.g. a source or explanation of the data.\n- **download** - A download button or dropdown to export the chart in different formats.",
@@ -1,8 +1,8 @@
1
1
  import type { DefineComponent } from "vue";
2
2
 
3
3
  import type { LeuAccordion } from "../Accordion.js";
4
- import type { LeuButton } from "../Button.js";
5
4
  import type { LeuButtonGroup } from "../ButtonGroup.js";
5
+ import type { LeuButton } from "../Button.js";
6
6
  import type { LeuChartWrapper } from "../ChartWrapper.js";
7
7
  import type { LeuCheckbox } from "../Checkbox.js";
8
8
  import type { LeuCheckboxGroup } from "../CheckboxGroup.js";
@@ -46,6 +46,13 @@ type LeuAccordionProps = {
46
46
  label?: LeuAccordion["label"];
47
47
  };
48
48
 
49
+ type LeuButtonGroupProps = {
50
+ /** The value of the currently selected (active) button */
51
+ value?: LeuButtonGroup["value"];
52
+ /** When the value of the group changes by clicking a button */
53
+ oninput?: (e: CustomEvent<never>) => void;
54
+ };
55
+
49
56
  type LeuButtonProps = {
50
57
  /** `aria-label` of the underlying button elements.
51
58
  Use it to provide a label when only an icon is visible. */
@@ -81,13 +88,6 @@ If it is set, the icon will either show an expanded or collapsed state. */
81
88
  loading?: LeuButton["loading"];
82
89
  };
83
90
 
84
- type LeuButtonGroupProps = {
85
- /** The value of the currently selected (active) button */
86
- value?: LeuButtonGroup["value"];
87
- /** When the value of the group changes by clicking a button */
88
- oninput?: (e: CustomEvent<never>) => void;
89
- };
90
-
91
91
  type LeuChartWrapperProps = {
92
92
  /** Whether the chart is currently loading or not.
93
93
  When set to `true`, a spinner will be shown in the chart container. */
@@ -533,18 +533,6 @@ export type CustomElements = {
533
533
  */
534
534
  "leu-accordion": DefineComponent<LeuAccordionProps>;
535
535
 
536
- /**
537
- *
538
- * ---
539
- *
540
- *
541
- * ### **Slots:**
542
- * - **before** - The icon to display before the label
543
- * - **after** - The icon to display after the label
544
- * - _default_ - The label of the button or the icon if no label is set
545
- */
546
- "leu-button": DefineComponent<LeuButtonProps>;
547
-
548
536
  /**
549
537
  * A radio input-like button group component.
550
538
  * It allows only one button to be active at a time.
@@ -559,6 +547,18 @@ export type CustomElements = {
559
547
  */
560
548
  "leu-button-group": DefineComponent<LeuButtonGroupProps>;
561
549
 
550
+ /**
551
+ *
552
+ * ---
553
+ *
554
+ *
555
+ * ### **Slots:**
556
+ * - **before** - The icon to display before the label
557
+ * - **after** - The icon to display after the label
558
+ * - _default_ - The label of the button or the icon if no label is set
559
+ */
560
+ "leu-button": DefineComponent<LeuButtonProps>;
561
+
562
562
  /**
563
563
  * A wrapper element for charts.
564
564
  * ---
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@statistikzh/leu",
4
- "version": "0.28.0",
4
+ "version": "0.28.1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -65,6 +65,33 @@
65
65
  "events": []
66
66
  }
67
67
  },
68
+ {
69
+ "name": "leu-button-group",
70
+ "description": "A radio input-like button group component.\nIt allows only one button to be active at a time.\n---\n\n\n### **Events:**\n - **input** - When the value of the group changes by clicking a button\n\n### **Slots:**\n - _default_ - Slot for the buttons",
71
+ "doc-url": "",
72
+ "attributes": [],
73
+ "slots": [{ "name": "", "description": "Slot for the buttons" }],
74
+ "events": [
75
+ {
76
+ "name": "input",
77
+ "description": "When the value of the group changes by clicking a button"
78
+ }
79
+ ],
80
+ "js": {
81
+ "properties": [
82
+ {
83
+ "name": "value",
84
+ "description": "The value of the currently selected (active) button"
85
+ }
86
+ ],
87
+ "events": [
88
+ {
89
+ "name": "input",
90
+ "description": "When the value of the group changes by clicking a button"
91
+ }
92
+ ]
93
+ }
94
+ },
68
95
  {
69
96
  "name": "leu-button",
70
97
  "description": "\n---\n\n\n### **Slots:**\n - **before** - The icon to display before the label\n- **after** - The icon to display after the label\n- _default_ - The label of the button or the icon if no label is set",
@@ -233,33 +260,6 @@
233
260
  "events": []
234
261
  }
235
262
  },
236
- {
237
- "name": "leu-button-group",
238
- "description": "A radio input-like button group component.\nIt allows only one button to be active at a time.\n---\n\n\n### **Events:**\n - **input** - When the value of the group changes by clicking a button\n\n### **Slots:**\n - _default_ - Slot for the buttons",
239
- "doc-url": "",
240
- "attributes": [],
241
- "slots": [{ "name": "", "description": "Slot for the buttons" }],
242
- "events": [
243
- {
244
- "name": "input",
245
- "description": "When the value of the group changes by clicking a button"
246
- }
247
- ],
248
- "js": {
249
- "properties": [
250
- {
251
- "name": "value",
252
- "description": "The value of the currently selected (active) button"
253
- }
254
- ],
255
- "events": [
256
- {
257
- "name": "input",
258
- "description": "When the value of the group changes by clicking a button"
259
- }
260
- ]
261
- }
262
- },
263
263
  {
264
264
  "name": "leu-chart-wrapper",
265
265
  "description": "A wrapper element for charts.\n---\n\n\n### **Slots:**\n - **title** - The title of the chart. Use a heading tag (h2-4) depending on your context.\n- **description** - A description of the chart. Content is wrapped in a `<p>` tag by the component.\n- **chart** - The actual chart\n- **caption** - A caption for the chart, e.g. a source or explanation of the data.\n- **download** - A download button or dropdown to export the chart in different formats.",
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI component library of the canton of zurich",
4
4
  "license": "MIT",
5
5
  "author": "statistikzh",
6
- "version": "0.28.0",
6
+ "version": "0.28.1",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -19,9 +19,9 @@
19
19
  },
20
20
  "repository": {
21
21
  "type": "git",
22
- "url": "git+https://github.com/statistikzh/leu.git"
22
+ "url": "git+https://github.com/statistikZH/leu.git"
23
23
  },
24
- "homepage": "https://github.com/statistikzh/leu/",
24
+ "homepage": "https://github.com/statistikZH/leu/",
25
25
  "scripts": {
26
26
  "analyze": "cem analyze --config custom-elements-manifest.config.js",
27
27
  "build": "npm run build:js && npm run build:css && npm run analyze",
@@ -36,6 +36,7 @@
36
36
  "format": "npm run format:eslint && npm run format:prettier",
37
37
  "format:eslint": "eslint . --fix",
38
38
  "format:prettier": "prettier \"**/*.{ts,js,mjs,md,mdx,html,json}\" --write",
39
+ "generate-component": "./scripts/generate-component/generate.js",
39
40
  "test": "web-test-runner --coverage",
40
41
  "test:watch": "web-test-runner --watch",
41
42
  "prepare": "husky",
@@ -112,6 +113,7 @@
112
113
  "bundle": false
113
114
  },
114
115
  "publishConfig": {
115
- "access": "public"
116
+ "access": "public",
117
+ "provenance": true
116
118
  }
117
119
  }
@@ -92,7 +92,8 @@ export class LeuFileInput extends FormAssociatedMixin(LeuElement) {
92
92
  }
93
93
  }
94
94
 
95
- private handleChange(event: Event & { target: HTMLInputElement }) {
95
+ private async handleChange(event: Event & { target: HTMLInputElement }) {
96
+ await this.updateComplete
96
97
  const customEvent = new CustomEvent(event.type, event)
97
98
  this.dispatchEvent(customEvent)
98
99
  }
@@ -130,7 +131,8 @@ export class LeuFileInput extends FormAssociatedMixin(LeuElement) {
130
131
  this.dispatchChangeAndInputEvents()
131
132
  }
132
133
 
133
- protected dispatchChangeAndInputEvents() {
134
+ protected async dispatchChangeAndInputEvents() {
135
+ await this.updateComplete
134
136
  this.dispatchEvent(
135
137
  new CustomEvent("input", {
136
138
  composed: true,
@@ -35,4 +35,28 @@ describe("LeuFileInput", () => {
35
35
  expect(fileInput.validity.valueMissing).to.be.true
36
36
  expect(form.checkValidity()).to.be.false
37
37
  })
38
+
39
+ it("dispatches change after validity is updated", async () => {
40
+ const el = await fixture<LeuFileInput>(html`
41
+ <leu-file-input
42
+ label="File upload"
43
+ required
44
+ accept="text/plain"
45
+ ></leu-file-input>
46
+ `)
47
+ const dropzone = el.shadowRoot?.querySelector<HTMLDivElement>(".dropzone")
48
+ const dataTransfer = new DataTransfer()
49
+ const file = new File(["content"], "test.txt", { type: "text/plain" })
50
+ dataTransfer.items.add(file)
51
+ let validityAtChangeEvent: boolean | undefined
52
+
53
+ el.addEventListener("change", () => {
54
+ validityAtChangeEvent = el.checkValidity()
55
+ })
56
+
57
+ dropzone?.dispatchEvent(new DragEvent("drop", { dataTransfer }))
58
+ await el.updateComplete
59
+
60
+ expect(validityAtChangeEvent).to.be.true
61
+ })
38
62
  })