@statistikzh/leu 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/.husky/commit-msg +0 -3
  2. package/.husky/pre-commit +0 -3
  3. package/CHANGELOG.md +48 -0
  4. package/dist/Accordion.d.ts +10 -9
  5. package/dist/Accordion.d.ts.map +1 -1
  6. package/dist/Accordion.js +12 -11
  7. package/dist/Breadcrumb.d.ts +4 -4
  8. package/dist/Breadcrumb.d.ts.map +1 -1
  9. package/dist/Breadcrumb.js +28 -26
  10. package/dist/{Button-da11d064.d.ts → Button-9692e403.d.ts} +10 -11
  11. package/dist/Button-9692e403.d.ts.map +1 -0
  12. package/dist/{Button-da11d064.js → Button-9692e403.js} +65 -62
  13. package/dist/Button.d.ts +1 -1
  14. package/dist/Button.js +3 -3
  15. package/dist/ButtonGroup.d.ts +2 -2
  16. package/dist/ButtonGroup.d.ts.map +1 -1
  17. package/dist/ButtonGroup.js +3 -3
  18. package/dist/Checkbox.d.ts +4 -3
  19. package/dist/Checkbox.d.ts.map +1 -1
  20. package/dist/Checkbox.js +14 -19
  21. package/dist/CheckboxGroup.d.ts +2 -2
  22. package/dist/CheckboxGroup.d.ts.map +1 -1
  23. package/dist/CheckboxGroup.js +4 -6
  24. package/dist/Chip.d.ts +2 -2
  25. package/dist/Chip.d.ts.map +1 -1
  26. package/dist/Chip.js +6 -13
  27. package/dist/ChipGroup.d.ts +9 -7
  28. package/dist/ChipGroup.d.ts.map +1 -1
  29. package/dist/ChipGroup.js +8 -5
  30. package/dist/ChipLink.d.ts +2 -1
  31. package/dist/ChipLink.d.ts.map +1 -1
  32. package/dist/ChipLink.js +4 -7
  33. package/dist/ChipRemovable.d.ts +0 -2
  34. package/dist/ChipRemovable.d.ts.map +1 -1
  35. package/dist/ChipRemovable.js +8 -11
  36. package/dist/ChipSelectable.d.ts +9 -1
  37. package/dist/ChipSelectable.d.ts.map +1 -1
  38. package/dist/ChipSelectable.js +12 -16
  39. package/dist/Dropdown.d.ts +9 -5
  40. package/dist/Dropdown.d.ts.map +1 -1
  41. package/dist/Dropdown.js +73 -32
  42. package/dist/Icon.d.ts +20 -0
  43. package/dist/Icon.d.ts.map +1 -0
  44. package/dist/{icon-03e86700.js → Icon.js} +61 -32
  45. package/dist/Input.d.ts +7 -16
  46. package/dist/Input.d.ts.map +1 -1
  47. package/dist/Input.js +24 -28
  48. package/dist/LeuElement-6de6f209.d.ts +7 -0
  49. package/dist/LeuElement-6de6f209.d.ts.map +1 -0
  50. package/dist/LeuElement-6de6f209.js +43 -0
  51. package/dist/Menu.d.ts +24 -2
  52. package/dist/Menu.d.ts.map +1 -1
  53. package/dist/Menu.js +120 -3
  54. package/dist/MenuItem.d.ts +28 -11
  55. package/dist/MenuItem.d.ts.map +1 -1
  56. package/dist/MenuItem.js +110 -63
  57. package/dist/Pagination.d.ts +10 -3
  58. package/dist/Pagination.d.ts.map +1 -1
  59. package/dist/Pagination.js +24 -21
  60. package/dist/Popup.d.ts +21 -3
  61. package/dist/Popup.d.ts.map +1 -1
  62. package/dist/Popup.js +44 -19
  63. package/dist/Radio.d.ts +4 -2
  64. package/dist/Radio.d.ts.map +1 -1
  65. package/dist/Radio.js +9 -16
  66. package/dist/RadioGroup.d.ts +2 -2
  67. package/dist/RadioGroup.d.ts.map +1 -1
  68. package/dist/RadioGroup.js +4 -6
  69. package/dist/ScrollTop.d.ts +2 -2
  70. package/dist/ScrollTop.d.ts.map +1 -1
  71. package/dist/ScrollTop.js +10 -8
  72. package/dist/Select.d.ts +75 -37
  73. package/dist/Select.d.ts.map +1 -1
  74. package/dist/Select.js +279 -183
  75. package/dist/Table.d.ts +2 -6
  76. package/dist/Table.d.ts.map +1 -1
  77. package/dist/Table.js +17 -18
  78. package/dist/VisuallyHidden.d.ts +2 -2
  79. package/dist/VisuallyHidden.d.ts.map +1 -1
  80. package/dist/VisuallyHidden.js +5 -7
  81. package/dist/{index.js.d.ts → index.d.ts} +3 -3
  82. package/dist/index.d.ts.map +1 -0
  83. package/dist/{index.js.js → index.js} +5 -14
  84. package/dist/leu-accordion.d.ts.map +1 -1
  85. package/dist/leu-accordion.js +2 -3
  86. package/dist/leu-breadcrumb.d.ts.map +1 -1
  87. package/dist/leu-breadcrumb.js +4 -10
  88. package/dist/leu-button-group.d.ts.map +1 -1
  89. package/dist/leu-button-group.js +2 -3
  90. package/dist/leu-button.d.ts +1 -1
  91. package/dist/leu-button.d.ts.map +1 -1
  92. package/dist/leu-button.js +4 -5
  93. package/dist/leu-checkbox-group.d.ts.map +1 -1
  94. package/dist/leu-checkbox-group.js +2 -3
  95. package/dist/leu-checkbox.d.ts.map +1 -1
  96. package/dist/leu-checkbox.js +3 -4
  97. package/dist/leu-chip-group.d.ts.map +1 -1
  98. package/dist/leu-chip-group.js +2 -3
  99. package/dist/leu-chip-link.d.ts.map +1 -1
  100. package/dist/leu-chip-link.js +2 -3
  101. package/dist/leu-chip-removable.d.ts.map +1 -1
  102. package/dist/leu-chip-removable.js +3 -4
  103. package/dist/leu-chip-selectable.d.ts.map +1 -1
  104. package/dist/leu-chip-selectable.js +2 -3
  105. package/dist/leu-dropdown.d.ts.map +1 -1
  106. package/dist/leu-dropdown.js +5 -10
  107. package/dist/leu-icon.d.ts +3 -0
  108. package/dist/leu-icon.d.ts.map +1 -0
  109. package/dist/leu-icon.js +7 -0
  110. package/dist/leu-input.d.ts.map +1 -1
  111. package/dist/leu-input.js +3 -4
  112. package/dist/leu-menu-item.d.ts.map +1 -1
  113. package/dist/leu-menu-item.js +3 -5
  114. package/dist/leu-menu.d.ts.map +1 -1
  115. package/dist/leu-menu.js +5 -3
  116. package/dist/leu-pagination.d.ts.map +1 -1
  117. package/dist/leu-pagination.js +4 -7
  118. package/dist/leu-popup.d.ts.map +1 -1
  119. package/dist/leu-popup.js +2 -3
  120. package/dist/leu-radio-group.d.ts.map +1 -1
  121. package/dist/leu-radio-group.js +2 -3
  122. package/dist/leu-radio.d.ts.map +1 -1
  123. package/dist/leu-radio.js +2 -3
  124. package/dist/leu-scroll-top.d.ts.map +1 -1
  125. package/dist/leu-scroll-top.js +4 -6
  126. package/dist/leu-select.d.ts.map +1 -1
  127. package/dist/leu-select.js +5 -13
  128. package/dist/leu-table.d.ts.map +1 -1
  129. package/dist/leu-table.js +4 -8
  130. package/dist/leu-visually-hidden.d.ts.map +1 -1
  131. package/dist/leu-visually-hidden.js +2 -3
  132. package/dist/theme.css +2 -0
  133. package/dist/vscode.html-custom-data.json +616 -0
  134. package/dist/vue/index.d.ts +682 -0
  135. package/dist/web-types.json +1211 -0
  136. package/package.json +10 -13
  137. package/rollup.config.js +1 -1
  138. package/scripts/generate-component/templates/[Name].js +6 -3
  139. package/scripts/generate-component/templates/test/[name].test.js +1 -1
  140. package/src/components/accordion/Accordion.js +13 -10
  141. package/src/components/accordion/leu-accordion.js +1 -2
  142. package/src/components/breadcrumb/Breadcrumb.js +31 -18
  143. package/src/components/breadcrumb/leu-breadcrumb.js +1 -2
  144. package/src/components/button/Button.js +45 -71
  145. package/src/components/button/button.css +19 -4
  146. package/src/components/button/leu-button.js +1 -2
  147. package/src/components/button/stories/button.stories.js +60 -19
  148. package/src/components/button/test/button.test.js +26 -63
  149. package/src/components/button-group/ButtonGroup.js +4 -2
  150. package/src/components/button-group/leu-button-group.js +1 -2
  151. package/src/components/checkbox/Checkbox.js +17 -11
  152. package/src/components/checkbox/CheckboxGroup.js +6 -3
  153. package/src/components/checkbox/leu-checkbox-group.js +1 -2
  154. package/src/components/checkbox/leu-checkbox.js +1 -2
  155. package/src/components/checkbox/stories/checkbox-group.stories.js +10 -26
  156. package/src/components/checkbox/stories/checkbox.stories.js +2 -7
  157. package/src/components/checkbox/test/checkbox-group.test.js +6 -21
  158. package/src/components/checkbox/test/checkbox.test.js +1 -12
  159. package/src/components/chip/Chip.js +5 -4
  160. package/src/components/chip/ChipGroup.js +10 -4
  161. package/src/components/chip/ChipLink.js +3 -7
  162. package/src/components/chip/ChipRemovable.js +8 -11
  163. package/src/components/chip/ChipSelectable.js +11 -17
  164. package/src/components/chip/chip.css +3 -4
  165. package/src/components/chip/leu-chip-group.js +1 -2
  166. package/src/components/chip/leu-chip-link.js +1 -2
  167. package/src/components/chip/leu-chip-removable.js +1 -2
  168. package/src/components/chip/leu-chip-selectable.js +1 -2
  169. package/src/components/chip/stories/chip-link.stories.js +3 -5
  170. package/src/components/chip/stories/chip-removable.stories.js +3 -4
  171. package/src/components/chip/stories/chip-selectable.stories.js +2 -2
  172. package/src/components/chip/test/chip-group.test.js +15 -30
  173. package/src/components/chip/test/chip-link.test.js +2 -6
  174. package/src/components/chip/test/chip-removable.test.js +4 -10
  175. package/src/components/chip/test/chip-selectable.test.js +3 -5
  176. package/src/components/dropdown/Dropdown.js +80 -26
  177. package/src/components/dropdown/dropdown.css +4 -0
  178. package/src/components/dropdown/leu-dropdown.js +1 -2
  179. package/src/components/dropdown/stories/dropdown.stories.js +30 -7
  180. package/src/components/dropdown/test/dropdown.test.js +5 -5
  181. package/src/components/icon/Icon.js +55 -0
  182. package/src/components/icon/icon.css +6 -0
  183. package/src/components/icon/leu-icon.js +5 -0
  184. package/src/components/icon/{icon.js → paths.js} +4 -37
  185. package/src/components/icon/stories/icon.stories.js +47 -0
  186. package/src/components/icon/test/icon.test.js +23 -40
  187. package/src/components/input/Input.js +21 -23
  188. package/src/components/input/input.css +4 -2
  189. package/src/components/input/leu-input.js +1 -2
  190. package/src/components/input/stories/input.stories.js +2 -2
  191. package/src/components/input/test/input.test.js +2 -0
  192. package/src/components/menu/Menu.js +143 -2
  193. package/src/components/menu/MenuItem.js +104 -52
  194. package/src/components/menu/leu-menu-item.js +1 -2
  195. package/src/components/menu/leu-menu.js +1 -2
  196. package/src/components/menu/menu-item.css +11 -4
  197. package/src/components/menu/stories/menu-item.stories.js +15 -4
  198. package/src/components/menu/stories/menu.stories.js +34 -7
  199. package/src/components/menu/test/menu-item.test.js +88 -82
  200. package/src/components/menu/test/menu.test.js +101 -8
  201. package/src/components/pagination/Pagination.js +27 -18
  202. package/src/components/pagination/leu-pagination.js +1 -2
  203. package/src/components/popup/Popup.js +39 -16
  204. package/src/components/popup/leu-popup.js +1 -2
  205. package/src/components/popup/popup.css +1 -0
  206. package/src/components/radio/Radio.js +12 -7
  207. package/src/components/radio/RadioGroup.js +6 -3
  208. package/src/components/radio/leu-radio-group.js +1 -2
  209. package/src/components/radio/leu-radio.js +1 -2
  210. package/src/components/radio/stories/radio-group.stories.js +5 -19
  211. package/src/components/radio/stories/radio.stories.js +2 -7
  212. package/src/components/radio/test/radio-group.test.js +6 -9
  213. package/src/components/radio/test/radio.test.js +3 -13
  214. package/src/components/scroll-top/ScrollTop.js +15 -5
  215. package/src/components/scroll-top/leu-scroll-top.js +1 -2
  216. package/src/components/select/Select.js +279 -175
  217. package/src/components/select/leu-select.js +1 -2
  218. package/src/components/select/select.css +20 -12
  219. package/src/components/select/stories/select.stories.js +16 -2
  220. package/src/components/select/test/select.test.js +191 -37
  221. package/src/components/table/Table.js +15 -9
  222. package/src/components/table/leu-table.js +1 -2
  223. package/src/components/table/table.css +3 -1
  224. package/src/components/visually-hidden/VisuallyHidden.js +6 -2
  225. package/src/components/visually-hidden/leu-visually-hidden.js +1 -2
  226. package/src/lib/LeuElement.js +23 -0
  227. package/src/lib/a11y.js +26 -0
  228. package/src/styles/custom-properties.css +2 -0
  229. package/web-test-runner.config.mjs +2 -0
  230. package/dist/Button-da11d064.d.ts.map +0 -1
  231. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts +0 -3
  232. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts.map +0 -1
  233. package/dist/_rollupPluginBabelHelpers-20f659f4.js +0 -30
  234. package/dist/defineElement-40372b4b.d.ts +0 -9
  235. package/dist/defineElement-40372b4b.d.ts.map +0 -1
  236. package/dist/defineElement-40372b4b.js +0 -15
  237. package/dist/icon-03e86700.d.ts +0 -11
  238. package/dist/icon-03e86700.d.ts.map +0 -1
  239. package/dist/index.js.d.ts.map +0 -1
  240. package/src/lib/defineElement.js +0 -13
package/dist/Popup.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, html } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
2
+ import { css, html } from 'lit';
3
3
  import { autoUpdate, size, flip, shift, computePosition } from '@floating-ui/dom';
4
4
 
5
5
  var css_248z = css`:host,
@@ -11,8 +11,6 @@ var css_248z = css`:host,
11
11
  --popup-font-regular: var(--leu-font-family-regular);
12
12
  --popup-font-black: var(--leu-font-family-black);
13
13
 
14
- font-family: var(--leu-font-family-regular);
15
-
16
14
  font-family: var(--popup-font-regular);
17
15
  }
18
16
 
@@ -28,6 +26,7 @@ var css_248z = css`:host,
28
26
  position: absolute;
29
27
  top: 0;
30
28
  left: 0;
29
+ z-index: var(--leu-z-index-popup);
31
30
  }
32
31
 
33
32
  /* TODO: Should visibility be a matter of the popup component? */
@@ -37,16 +36,35 @@ var css_248z = css`:host,
37
36
  }
38
37
  `;
39
38
 
39
+ /**
40
+ * @typedef {"top"|"top-start"|"top-end"|"bottom"|"bottom-start"|"bottom-end"|"left"|"left-start"|"left-end"|"right"|"right-start"|"right-end"} Placement
41
+ */
42
+
40
43
  /**
41
44
  * @tagname leu-popup
42
45
  */
43
- class LeuPopup extends LitElement {
46
+ class LeuPopup extends LeuElement {
44
47
  constructor() {
45
48
  super();
46
49
  this.anchorEl = null;
47
50
  this.cleanup = undefined;
48
51
  this.flip = false;
49
52
  this.shift = false;
53
+ this.active = false;
54
+
55
+ /** @type {Placement} */
56
+ this.placement = undefined;
57
+
58
+ /** @type {"width" | "height" | "both"} */
59
+ this.matchSize = undefined;
60
+
61
+ /** @type {"width" | "height" | "both"} */
62
+ this.autoSize = undefined;
63
+ this.shiftPadding = 0;
64
+ this.autoSizePadding = 0;
65
+
66
+ /** @type {string | HTMLElement} */
67
+ this.anchor = undefined;
50
68
  }
51
69
  disconnectedCallback() {
52
70
  super.disconnectedCallback();
@@ -67,6 +85,10 @@ class LeuPopup extends LitElement {
67
85
  this.reposition();
68
86
  }
69
87
  }
88
+
89
+ /**
90
+ * @returns {HTMLElement | null}
91
+ */
70
92
  get popupEl() {
71
93
  return this.renderRoot?.querySelector(".popup") ?? null;
72
94
  }
@@ -176,39 +198,42 @@ class LeuPopup extends LitElement {
176
198
  }
177
199
  _defineProperty(LeuPopup, "styles", css_248z);
178
200
  _defineProperty(LeuPopup, "shadowRootOptions", {
179
- ...LitElement.shadowRootOptions,
201
+ ...LeuElement.shadowRootOptions,
180
202
  delegatesFocus: true
181
203
  });
182
204
  _defineProperty(LeuPopup, "properties", {
183
205
  anchor: {},
184
206
  active: {
185
- type: Boolean
207
+ type: Boolean,
208
+ reflect: true
186
209
  },
187
- /**
188
- * @type {"top"|"top-start"|"top-end"|"bottom"|"bottom-start"|"bottom-end"|"left"|"left-start"|"left-end"|"right"|"right-start"|"right-end"}
189
- */
190
210
  placement: {
191
- type: String
211
+ type: String,
212
+ reflect: true
192
213
  },
193
214
  flip: {
194
- type: Boolean
215
+ type: Boolean,
216
+ reflect: true
195
217
  },
196
218
  shift: {
197
- type: Boolean
219
+ type: Boolean,
220
+ reflect: true
198
221
  },
199
222
  shiftPadding: {
200
- type: Number
223
+ type: Number,
224
+ reflect: true
201
225
  },
202
- /** @type {"width" | "height" | "both"} */
203
226
  matchSize: {
204
- type: String
227
+ type: String,
228
+ reflect: true
205
229
  },
206
- /** @type {"width" | "height" | "both"} */
207
230
  autoSize: {
208
- type: String
231
+ type: String,
232
+ reflect: true
209
233
  },
210
234
  autoSizePadding: {
211
- type: Number
235
+ type: Number,
236
+ reflect: true
212
237
  }
213
238
  });
214
239
 
package/dist/Radio.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  /**
2
2
  * @tagname leu-radio
3
3
  */
4
- export class LeuRadio extends LitElement {
4
+ export class LeuRadio extends LeuElement {
5
5
  checked: boolean;
6
6
  disabled: boolean;
7
+ name: string;
8
+ value: string;
7
9
  handleChange(event: any): void;
8
10
  handleInput(event: any): void;
9
11
  render(): import("lit-html").TemplateResult<1>;
10
12
  }
11
- import { LitElement } from 'lit';
13
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
12
14
  //# sourceMappingURL=Radio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["Radio.js"],"names":[],"mappings":"AAgGA;;GAEG;AACH;IAGI,iBAAoB;IACpB,kBAAqB;IAEvB,+BAIC;IACD,8BAEC;IACD,+CAeC;CACF;2BAhIqC,KAAK"}
1
+ {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["Radio.js"],"names":[],"mappings":"AA8FA;;GAEG;AACH;IAGI,iBAAoB;IACpB,kBAAqB;IACrB,aAAc;IACd,cAAe;IAEjB,+BAIC;IACD,8BAEC;IACD,+CAeC;CACF;gCAjIqD,0BAA0B"}
package/dist/Radio.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, html } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
2
+ import { css, html } from 'lit';
3
3
 
4
4
  var css_248z = css`:host {
5
5
  --radio-color: var(--leu-color-black-40);
@@ -15,8 +15,6 @@ var css_248z = css`:host {
15
15
  align-items: flex-start;
16
16
  gap: 0.5rem;
17
17
 
18
- font-family: var(--leu-font-family-regular);
19
-
20
18
  font-family: var(--radio-font-regular);
21
19
  }
22
20
 
@@ -97,11 +95,13 @@ var css_248z = css`:host {
97
95
  /**
98
96
  * @tagname leu-radio
99
97
  */
100
- class LeuRadio extends LitElement {
98
+ class LeuRadio extends LeuElement {
101
99
  constructor() {
102
100
  super();
103
101
  this.checked = false;
104
102
  this.disabled = false;
103
+ this.name = "";
104
+ this.value = "";
105
105
  }
106
106
  handleChange(event) {
107
107
  this.checked = event.target.checked;
@@ -114,7 +114,7 @@ class LeuRadio extends LitElement {
114
114
  render() {
115
115
  return html`
116
116
  <input
117
- id=${this.identifier}
117
+ id=${`radio-${this.name}`}
118
118
  class="radio"
119
119
  type="radio"
120
120
  name="${this.name}"
@@ -124,13 +124,14 @@ class LeuRadio extends LitElement {
124
124
  ?disabled=${this.disabled}
125
125
  .value=${this.value}
126
126
  />
127
- <label for=${this.identifier} class="label">${this.label}</label>
127
+ <label for=${`radio-${this.name}`} class="label"><slot></slot></label>
128
128
  `;
129
129
  }
130
130
  }
131
131
  _defineProperty(LeuRadio, "styles", css_248z);
132
+ /** @internal */
132
133
  _defineProperty(LeuRadio, "shadowRootOptions", {
133
- ...LitElement.shadowRootOptions,
134
+ ...LeuElement.shadowRootOptions,
134
135
  delegatesFocus: true
135
136
  });
136
137
  _defineProperty(LeuRadio, "properties", {
@@ -142,10 +143,6 @@ _defineProperty(LeuRadio, "properties", {
142
143
  type: Boolean,
143
144
  reflect: true
144
145
  },
145
- identifier: {
146
- type: String,
147
- reflect: true
148
- },
149
146
  value: {
150
147
  type: String,
151
148
  reflect: true
@@ -153,10 +150,6 @@ _defineProperty(LeuRadio, "properties", {
153
150
  name: {
154
151
  type: String,
155
152
  reflect: true
156
- },
157
- label: {
158
- type: String,
159
- reflect: true
160
153
  }
161
154
  });
162
155
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @tagname leu-radio-group
3
3
  */
4
- export class LeuRadioGroup extends LitElement {
4
+ export class LeuRadioGroup extends LeuElement {
5
5
  _currentIndex: number;
6
6
  orientation: string;
7
7
  items: any[];
@@ -16,5 +16,5 @@ export class LeuRadioGroup extends LitElement {
16
16
  initializeIndex(): void;
17
17
  render(): import("lit-html").TemplateResult<1>;
18
18
  }
19
- import { LitElement } from 'lit';
19
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
20
20
  //# sourceMappingURL=RadioGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["RadioGroup.js"],"names":[],"mappings":"AAqCA;;GAEG;AACH;IAIM,sBAAiD;IA6BnD,oBAA+B;IAE/B,aAAe;IAEjB,iBAGC;IAUD,0BAIC;IACD,6BAIC;IACD,yBAEC;IACD,qCAIC;IACD,yDAaC;IACD,oBAQC;IACD,oBAIC;IACD,wBAIC;IACD,+CAWC;CACF;2BAxJqC,KAAK"}
1
+ {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["RadioGroup.js"],"names":[],"mappings":"AAmCA;;GAEG;AACH;IAIM,sBAAiD;IA6BnD,oBAA+B;IAE/B,aAAe;IAEjB,iBAGC;IAUD,0BAIC;IACD,6BAIC;IACD,yBAEC;IACD,qCAIC;IACD,yDAaC;IACD,oBAQC;IACD,oBAIC;IACD,wBAIC;IACD,+CAWC;CACF;gCAvJqD,0BAA0B"}
@@ -1,13 +1,11 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, html } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
2
+ import { css, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
 
5
5
  var css_248z = css`:host {
6
6
  --group-font-regular: var(--leu-font-family-regular);
7
7
  --group-font-black: var(--leu-font-family-black);
8
8
 
9
- font-family: var(--leu-font-family-regular);
10
-
11
9
  font-family: var(--group-font-regular);
12
10
  }
13
11
 
@@ -38,7 +36,7 @@ var css_248z = css`:host {
38
36
  /**
39
37
  * @tagname leu-radio-group
40
38
  */
41
- class LeuRadioGroup extends LitElement {
39
+ class LeuRadioGroup extends LeuElement {
42
40
  constructor() {
43
41
  super();
44
42
  _defineProperty(this, "handleFocusIn", e => {
@@ -130,7 +128,7 @@ class LeuRadioGroup extends LitElement {
130
128
  });
131
129
  }
132
130
  handleItems() {
133
- this.items = [...this.querySelectorAll(":scope > *:not([slot])")];
131
+ this.items = Array.from(this.querySelectorAll(":scope > *:not([slot])"));
134
132
  this.initializeIndex();
135
133
  this.setTabIndex();
136
134
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @tagname leu-scroll-top
3
3
  */
4
- export class LeuScrollTop extends LitElement {
4
+ export class LeuScrollTop extends LeuElement {
5
5
  static scrollToTop(): void;
6
6
  _scrollDown: boolean;
7
7
  /**
@@ -15,5 +15,5 @@ export class LeuScrollTop extends LitElement {
15
15
  _scrollListener: Function;
16
16
  render(): import("lit-html").TemplateResult<1>;
17
17
  }
18
- import { LitElement } from 'lit';
18
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
19
19
  //# sourceMappingURL=ScrollTop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollTop.d.ts","sourceRoot":"","sources":["ScrollTop.js"],"names":[],"mappings":"AA8CA;;GAEG;AACH;IAwCE,2BAMC;IAtCO,qBAAwB;IAM5B;;;;OAIG;IACH,qBAA2E;IAC3E,kBAA+B;IAQjC,gBAAgB;IAChB,0BAAgC;IAkBlC,+CAgBC;CACF;2BAhHqC,KAAK"}
1
+ {"version":3,"file":"ScrollTop.d.ts","sourceRoot":"","sources":["ScrollTop.js"],"names":[],"mappings":"AA4CA;;GAEG;AACH;IAwCE,2BAMC;IAtCO,qBAAwB;IAM5B;;;;OAIG;IACH,qBAA2E;IAC3E,kBAA+B;IAQjC,gBAAgB;IAChB,0BAAgC;IAkBlC,+CAgBC;CACF;gCA/GqD,0BAA0B"}
package/dist/ScrollTop.js CHANGED
@@ -1,12 +1,10 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, html } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
2
+ import { css, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
- import './leu-button.js';
4
+ import { L as LeuButton } from './Button-9692e403.js';
5
+ import { LeuIcon } from './Icon.js';
5
6
  import { t as throttle } from './utils-65469421.js';
6
- import './defineElement-40372b4b.js';
7
- import './Button-da11d064.js';
8
7
  import 'lit/directives/if-defined.js';
9
- import './icon-03e86700.js';
10
8
 
11
9
  var css_248z = css`.scroll-top {
12
10
  overflow: hidden;
@@ -47,7 +45,7 @@ var css_248z = css`.scroll-top {
47
45
  /**
48
46
  * @tagname leu-scroll-top
49
47
  */
50
- class LeuScrollTop extends LitElement {
48
+ class LeuScrollTop extends LeuElement {
51
49
  constructor() {
52
50
  super();
53
51
  /** @internal */
@@ -102,16 +100,20 @@ class LeuScrollTop extends LitElement {
102
100
  return html`
103
101
  <div class=${classMap(cssClasses)}>
104
102
  <leu-button
105
- icon="arrowUp"
106
103
  label="Zum Seitenanfang"
107
104
  round
108
105
  @click="${() => LeuScrollTop.scrollToTop()}"
109
106
  >
107
+ <leu-icon name="arrowUp"></leu-icon>
110
108
  </leu-button>
111
109
  </div>
112
110
  `;
113
111
  }
114
112
  }
113
+ _defineProperty(LeuScrollTop, "dependencies", {
114
+ "leu-button": LeuButton,
115
+ "leu-icon": LeuIcon
116
+ });
115
117
  _defineProperty(LeuScrollTop, "styles", css_248z);
116
118
  _defineProperty(LeuScrollTop, "properties", {
117
119
  _showButton: {
package/dist/Select.d.ts CHANGED
@@ -2,9 +2,22 @@
2
2
  * @tagname leu-select
3
3
  * @slot before - Optional content the appears before the option list
4
4
  * @slot after - Optional content the appears after the option list
5
+ * @property {string} name - Reflects to the name attribute of the hidden input field that would be used in a form
6
+ * @property {boolean} open - The expanded state of the popup
7
+ * @property {string} label - The label of the select
8
+ * @property {array} value - List of selected values. If they're set from outside the component, the select element tries to find all the options with the given values and selects them.
9
+ * @property {boolean} clearable - Show a clearable button to reset the value
10
+ * @property {boolean} disabled - If the select should be disabled
11
+ * @property {boolean} filterable - Show an input field to filter the options inside the popup
12
+ * @property {boolean} multiple - Allow multiple selections
13
+ * @attribute {string} value - The selected values separated by commas.
5
14
  */
6
- export class LeuSelect extends LitElement {
15
+ export class LeuSelect extends LeuElement {
7
16
  static get properties(): {
17
+ name: {
18
+ type: StringConstructor;
19
+ reflect: boolean;
20
+ };
8
21
  open: {
9
22
  type: BooleanConstructor;
10
23
  reflect: boolean;
@@ -13,11 +26,11 @@ export class LeuSelect extends LitElement {
13
26
  type: StringConstructor;
14
27
  reflect: boolean;
15
28
  };
16
- options: {
17
- type: ArrayConstructor;
18
- };
19
29
  value: {
20
30
  type: ArrayConstructor;
31
+ converter: {
32
+ fromAttribute(value: any): any;
33
+ };
21
34
  };
22
35
  clearable: {
23
36
  type: BooleanConstructor;
@@ -35,7 +48,13 @@ export class LeuSelect extends LitElement {
35
48
  type: BooleanConstructor;
36
49
  reflect: boolean;
37
50
  };
38
- optionFilter: {
51
+ _optionFilter: {
52
+ state: boolean;
53
+ };
54
+ _hasFilterResults: {
55
+ state: boolean;
56
+ };
57
+ _displayValue: {
39
58
  state: boolean;
40
59
  };
41
60
  };
@@ -46,53 +65,72 @@ export class LeuSelect extends LitElement {
46
65
  clearable: boolean;
47
66
  filterable: boolean;
48
67
  value: any[];
49
- options: any[];
50
68
  label: string;
69
+ name: string;
51
70
  /** @internal */
52
- _arrowIcon: import("lit-html").TemplateResult<1>;
71
+ _optionFilter: string;
53
72
  /** @internal */
54
- _clearIcon: import("lit-html").TemplateResult<1>;
73
+ _hasFilterResults: boolean;
55
74
  /** @internal */
56
- optionFilter: string;
75
+ _deferedChangeEvent: boolean;
57
76
  /** @internal */
58
- deferedChangeEvent: boolean;
59
- /**
60
- * @type {import("lit/directives/ref").Ref<import("../menu/Menu").LeuMenu>}
61
- */
62
- menuRef: import("lit/directives/ref").Ref<any>;
77
+ _displayValue: string;
63
78
  /**
64
79
  * @type {import("lit/directives/ref").Ref<import("../input/Input").LeuInput>}
65
80
  */
66
- optionFilterRef: import("lit/directives/ref").Ref<any>;
81
+ _optionFilterRef: import("lit/directives/ref").Ref<any>;
67
82
  /**
68
83
  * @type {import("lit/directives/ref").Ref<HTMLButtonElement>}
69
84
  */
70
- toggleButtonRef: import("lit/directives/ref").Ref<HTMLButtonElement>;
85
+ _toggleButtonRef: import("lit/directives/ref").Ref<HTMLButtonElement>;
86
+ /**
87
+ * @type {import("lit/directives/ref").Ref<import("../menu/Menu").LeuMenu>}
88
+ */
89
+ _menuRef: import("lit/directives/ref").Ref<any>;
71
90
  updated(changedProperties: any): void;
72
- getDisplayValue(value: any): any;
73
- getFilteredOptions(): any[];
74
- emitUpdateEvents(): void;
75
- emitInputEvent(): void;
76
- emitChangeEvent(): void;
77
- clearValue(event: any): void;
78
- toggleDropdown(): void;
79
- openDropdown(): void;
80
- closeDropdown(): void;
81
91
  /**
82
- * Adds or replaces the given option in the options array.
83
- *
84
- * @param {*} option
92
+ * Apply the current state to the menu items.
93
+ * - Set the active property when the value property has changed.
94
+ * - Hide menu items that do not match the filter.
95
+ */
96
+ _updateMenuItems(changed: any): Promise<void>;
97
+ /**
98
+ * @internal
99
+ * @param {KeyboardEvent} event
100
+ */
101
+ _handleToggleKeyDown(event: KeyboardEvent): Promise<void>;
102
+ /**
103
+ * @internal
104
+ * @param {KeyboardEvent} event
105
+ */
106
+ _handleFilterInputKeyDown(event: KeyboardEvent): void;
107
+ /**
108
+ * Determines the value or label that should be displayed inside the toggle button.
109
+ * @returns {String | nothing}
110
+ */
111
+ _getDisplayValue(): string | typeof nothing;
112
+ _emitInputEvent(): void;
113
+ _emitChangeEvent(): void;
114
+ _clearValue(event: any): void;
115
+ _toggleDropdown(): void;
116
+ _closeDropdown(): void;
117
+ _handleFilterInput(event: any): void;
118
+ /**
119
+ * Checks if the given value is selected.
120
+ * @param {String} menuItemValue
121
+ * @returns {Boolean}
122
+ */
123
+ _isSelected(menuItemValue: string): boolean;
124
+ _handleMenuItemClick(event: any): void;
125
+ /**
126
+ * Close the dropdown if the focus moves outside the component.
85
127
  */
86
- selectOption(option: any): void;
87
- handleApplyClick(): void;
88
- handleFilterInput(event: any): void;
89
- isSelected(option: any): boolean;
90
- renderMenu(): import("lit-html").TemplateResult<1>;
91
- renderFilterInput(): import("lit-html").TemplateResult<1> | typeof nothing;
92
- renderApplyButton(): import("lit-html").TemplateResult<1> | typeof nothing;
93
- renderToggleButton(): import("lit-html").TemplateResult<1>;
128
+ _handlePopupFocusOut(event: any): void;
129
+ _renderFilterInput(): import("lit-html").TemplateResult<1> | typeof nothing;
130
+ _renderApplyButton(): import("lit-html").TemplateResult<1> | typeof nothing;
131
+ _renderToggleButton(): import("lit-html").TemplateResult<1>;
94
132
  render(): import("lit-html").TemplateResult<1>;
95
133
  }
96
- import { LitElement } from 'lit';
134
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
97
135
  import { nothing } from 'lit';
98
136
  //# sourceMappingURL=Select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["Select.js"],"names":[],"mappings":"AA6PA;;;;GAIG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoCC;IACD,wCAKC;IA4BC,cAAiB;IACjB,kBAAqB;IAErB,kBAAqB;IACrB,mBAAsB;IACtB,oBAAuB;IACvB,aAAe;IACf,eAAiB;IACjB,cAAe;IAEf,gBAAgB;IAChB,iDAAuC;IAEvC,gBAAgB;IAChB,iDAA+B;IAE/B,gBAAgB;IAChB,qBAAsB;IAEtB,gBAAgB;IAChB,4BAA+B;IAE/B;;OAEG;IACH,SAFU,OAAO,oBAAoB,EAAE,GAAG,KAAgC,CAEhD;IAC1B;;OAEG;IACH,iBAFU,OAAO,oBAAoB,EAAE,GAAG,KAAmC,CAE3C;IAClC;;OAEG;IACH,iBAFU,OAAO,oBAAoB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAE3B;IAUpC,sCAUC;IACD,iCAKC;IACD,4BAKC;IACD,yBAGC;IACD,uBAMC;IACD,wBAMC;IACD,6BAMC;IACD,uBAIC;IACD,qBAEC;IACD,sBAMC;IAED;;;;OAIG;IACH,gCAYC;IACD,yBAEC;IACD,oCAEC;IACD,iCAEC;IACD,mDAqCC;IACD,2EAYC;IACD,2EAaC;IACD,2DA+BC;IACD,+CAkCC;CACF;2BAllB8C,KAAK;wBAAL,KAAK"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["Select.js"],"names":[],"mappings":"AA2PA;;;;;;;;;;;;;GAaG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmDC;IACD,wCAKC;IA4BC,cAAiB;IACjB,kBAAqB;IAErB,kBAAqB;IACrB,mBAAsB;IACtB,oBAAuB;IACvB,aAAe;IACf,cAAe;IACf,aAAc;IAEd,gBAAgB;IAChB,sBAAuB;IAEvB,gBAAgB;IAChB,2BAA6B;IAE7B,gBAAgB;IAChB,6BAAgC;IAEhC,gBAAgB;IAChB,sBAAuB;IAEvB;;OAEG;IACH,kBAFU,OAAO,oBAAoB,EAAE,GAAG,CAAC,GAAiC,CAAC,CAE1C;IACnC;;OAEG;IACH,kBAFU,OAAO,oBAAoB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAE1B;IAEnC;;OAEG;IACH,UAFU,OAAO,oBAAoB,EAAE,GAAG,CAAC,GAA8B,CAAC,CAE/C;IAU7B,sCAoBC;IAED;;;;OAIG;IACH,8CA0BC;IACD;;;OAGG;IACH,4BAFW,aAAa,iBAcvB;IAED;;;OAGG;IACH,iCAFW,aAAa,QAQvB;IAED;;;OAGG;IACH,oBAFa,uBAAgB,CAO5B;IACD,wBAMC;IACD,yBAMC;IACD,8BAOC;IACD,wBAIC;IACD,uBAMC;IACD,qCAEC;IAED;;;;OAIG;IACH,4CAEC;IACD,uCAoBC;IAED;;OAEG;IACH,uCAIC;IACD,4EAaC;IACD,4EAeC;IACD,4DAmCC;IACD,+CAmDC;CACF;gCA3qBqD,0BAA0B;wBAC7C,KAAK"}