@statistikzh/leu 0.13.0 → 0.14.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 (187) hide show
  1. package/.eslintrc.json +8 -0
  2. package/.github/workflows/ci.yml +78 -0
  3. package/.github/workflows/deploy-github-pages.yaml +2 -1
  4. package/.github/workflows/release-please.yml +2 -1
  5. package/.nvmrc +1 -0
  6. package/.prettierignore +1 -0
  7. package/.storybook/main.js +19 -3
  8. package/.storybook/static/fonts/Inter-Black.woff2 +0 -0
  9. package/.storybook/static/fonts/Inter-Regular.woff2 +0 -0
  10. package/.storybook/static/fonts.css +11 -0
  11. package/CHANGELOG.md +27 -0
  12. package/custom-elements-manifest.config.js +2 -2
  13. package/dist/Accordion.d.ts +1 -1
  14. package/dist/Accordion.d.ts.map +1 -1
  15. package/dist/Accordion.js +2 -4
  16. package/dist/Button.d.ts +2 -2
  17. package/dist/Button.d.ts.map +1 -1
  18. package/dist/Button.js +64 -34
  19. package/dist/ButtonGroup.d.ts +1 -1
  20. package/dist/ButtonGroup.js +1 -1
  21. package/dist/Checkbox.d.ts +1 -1
  22. package/dist/Checkbox.d.ts.map +1 -1
  23. package/dist/Checkbox.js +2 -3
  24. package/dist/CheckboxGroup.d.ts +1 -1
  25. package/dist/CheckboxGroup.d.ts.map +1 -1
  26. package/dist/CheckboxGroup.js +1 -3
  27. package/dist/Chip.d.ts +1 -1
  28. package/dist/Chip.d.ts.map +1 -1
  29. package/dist/Chip.js +5 -6
  30. package/dist/ChipGroup.d.ts +1 -1
  31. package/dist/ChipGroup.d.ts.map +1 -1
  32. package/dist/ChipGroup.js +2 -2
  33. package/dist/ChipLink.js +1 -1
  34. package/dist/ChipRemovable.js +1 -1
  35. package/dist/ChipSelectable.js +1 -1
  36. package/dist/Dialog.d.ts +1 -1
  37. package/dist/Dialog.d.ts.map +1 -1
  38. package/dist/Dialog.js +3 -5
  39. package/dist/Dropdown.d.ts +1 -1
  40. package/dist/Dropdown.d.ts.map +1 -1
  41. package/dist/Dropdown.js +4 -3
  42. package/dist/Icon.d.ts +2 -98
  43. package/dist/Icon.d.ts.map +1 -1
  44. package/dist/Icon.js +6 -2
  45. package/dist/Input.d.ts +7 -2
  46. package/dist/Input.d.ts.map +1 -1
  47. package/dist/Input.js +15 -8
  48. package/dist/{LeuElement-874a297c.d.ts → LeuElement-BjGpKQpe.d.ts} +1 -1
  49. package/dist/LeuElement-BjGpKQpe.d.ts.map +1 -0
  50. package/dist/{LeuElement-874a297c.js → LeuElement-BjGpKQpe.js} +12 -2
  51. package/dist/Menu.d.ts +2 -2
  52. package/dist/Menu.js +1 -1
  53. package/dist/MenuItem.d.ts +3 -3
  54. package/dist/MenuItem.js +1 -1
  55. package/dist/Pagination.d.ts +1 -1
  56. package/dist/Pagination.js +3 -3
  57. package/dist/Popup.d.ts +2 -2
  58. package/dist/Popup.d.ts.map +1 -1
  59. package/dist/Popup.js +2 -3
  60. package/dist/Radio.d.ts +1 -1
  61. package/dist/Radio.d.ts.map +1 -1
  62. package/dist/Radio.js +1 -3
  63. package/dist/RadioGroup.d.ts +1 -1
  64. package/dist/RadioGroup.d.ts.map +1 -1
  65. package/dist/RadioGroup.js +1 -3
  66. package/dist/Range.d.ts +1 -1
  67. package/dist/Range.d.ts.map +1 -1
  68. package/dist/Range.js +17 -19
  69. package/dist/ScrollTop.d.ts +1 -1
  70. package/dist/ScrollTop.d.ts.map +1 -1
  71. package/dist/ScrollTop.js +27 -3
  72. package/dist/Select.d.ts +3 -3
  73. package/dist/Select.d.ts.map +1 -1
  74. package/dist/Select.js +7 -5
  75. package/dist/Spinner.d.ts +1 -1
  76. package/dist/Spinner.js +1 -1
  77. package/dist/Table.d.ts +1 -1
  78. package/dist/Table.d.ts.map +1 -1
  79. package/dist/Table.js +3 -4
  80. package/dist/VisuallyHidden.d.ts +1 -1
  81. package/dist/VisuallyHidden.d.ts.map +1 -1
  82. package/dist/VisuallyHidden.js +3 -5
  83. package/dist/{hasSlotController-dbcac394.d.ts → hasSlotController-DvFw2NdC.d.ts} +1 -1
  84. package/dist/hasSlotController-DvFw2NdC.d.ts.map +1 -0
  85. package/dist/{hasSlotController-dbcac394.js → hasSlotController-DvFw2NdC.js} +1 -1
  86. package/dist/index.d.ts +1 -1
  87. package/dist/index.js +5 -7
  88. package/dist/leu-accordion.js +1 -1
  89. package/dist/leu-button-group.js +1 -1
  90. package/dist/leu-button.js +2 -2
  91. package/dist/leu-checkbox-group.js +1 -1
  92. package/dist/leu-checkbox.js +1 -1
  93. package/dist/leu-chip-group.js +1 -1
  94. package/dist/leu-chip-link.js +1 -1
  95. package/dist/leu-chip-removable.js +1 -1
  96. package/dist/leu-chip-selectable.js +1 -1
  97. package/dist/leu-dialog.js +2 -2
  98. package/dist/leu-dropdown.js +2 -2
  99. package/dist/leu-icon.js +1 -1
  100. package/dist/leu-input.js +1 -1
  101. package/dist/leu-menu-item.js +1 -1
  102. package/dist/leu-menu.js +1 -1
  103. package/dist/leu-pagination.js +2 -2
  104. package/dist/leu-popup.js +1 -1
  105. package/dist/leu-radio-group.js +1 -1
  106. package/dist/leu-radio.js +1 -1
  107. package/dist/leu-range.js +1 -1
  108. package/dist/leu-scroll-top.js +2 -3
  109. package/dist/leu-select.js +2 -2
  110. package/dist/leu-spinner.js +1 -1
  111. package/dist/leu-table.js +2 -2
  112. package/dist/leu-visually-hidden.js +1 -1
  113. package/dist/theme.css +143 -107
  114. package/dist/vscode.html-custom-data.json +3 -32
  115. package/dist/vue/index.d.ts +11 -77
  116. package/dist/web-types.json +246 -242
  117. package/index.js +1 -1
  118. package/package.json +55 -51
  119. package/rollup.config.js +3 -3
  120. package/scripts/generate-component/generate.js +5 -5
  121. package/src/components/accordion/test/accordion.test.js +24 -20
  122. package/src/components/button/Button.js +9 -4
  123. package/src/components/button/button.css +56 -22
  124. package/src/components/button/stories/button.stories.js +44 -45
  125. package/src/components/button/test/button.test.js +13 -13
  126. package/src/components/button-group/ButtonGroup.js +1 -1
  127. package/src/components/button-group/stories/button-group.stories.js +2 -2
  128. package/src/components/checkbox/checkbox.css +1 -0
  129. package/src/components/chip/ChipSelectable.js +1 -1
  130. package/src/components/chip/chip.css +4 -3
  131. package/src/components/chip/stories/chip-group.stories.js +4 -4
  132. package/src/components/chip/stories/chip-selectable.stories.js +1 -1
  133. package/src/components/chip/test/chip-group.test.js +25 -33
  134. package/src/components/chip/test/chip-link.test.js +5 -5
  135. package/src/components/chip/test/chip-removable.test.js +6 -8
  136. package/src/components/chip/test/chip-selectable.test.js +9 -11
  137. package/src/components/dialog/test/dialog.test.js +1 -1
  138. package/src/components/dropdown/dropdown.css +1 -0
  139. package/src/components/dropdown/test/dropdown.test.js +12 -13
  140. package/src/components/icon/icon.css +4 -0
  141. package/src/components/input/Input.js +25 -17
  142. package/src/components/input/stories/input.stories.js +0 -2
  143. package/src/components/input/test/input.test.js +26 -0
  144. package/src/components/menu/stories/menu-item.stories.js +2 -0
  145. package/src/components/menu/test/menu-item.test.js +3 -2
  146. package/src/components/menu/test/menu.test.js +24 -22
  147. package/src/components/pagination/Pagination.js +1 -1
  148. package/src/components/pagination/pagination.css +1 -1
  149. package/src/components/pagination/stories/pagination.stories.js +2 -1
  150. package/src/components/pagination/test/pagination.test.js +8 -6
  151. package/src/components/popup/Popup.js +4 -4
  152. package/src/components/popup/popup.css +1 -0
  153. package/src/components/popup/test/popup.test.js +6 -8
  154. package/src/components/radio/RadioGroup.js +2 -2
  155. package/src/components/range/Range.js +20 -21
  156. package/src/components/select/Select.js +6 -1
  157. package/src/components/select/select.css +1 -1
  158. package/src/components/select/stories/select.stories.js +1 -1
  159. package/src/components/select/test/select.test.js +19 -16
  160. package/src/components/table/Table.js +4 -4
  161. package/src/components/table/test/table.test.js +3 -2
  162. package/src/components/visually-hidden/test/visually-hidden.test.js +6 -8
  163. package/src/lib/LeuElement.js +2 -2
  164. package/src/lib/hasSlotController.js +1 -1
  165. package/src/styles/common-styles.css +9 -0
  166. package/src/styles/style.stories.js +3 -1
  167. package/tsconfig.build.json +4 -3
  168. package/web-dev-server.config.mjs +1 -0
  169. package/web-test-runner.config.mjs +2 -1
  170. package/.github/workflows/test.yml +0 -38
  171. package/.storybook/preview-head.html +0 -5
  172. package/dist/Breadcrumb.d.ts +0 -69
  173. package/dist/Breadcrumb.d.ts.map +0 -1
  174. package/dist/Breadcrumb.js +0 -391
  175. package/dist/LeuElement-874a297c.d.ts.map +0 -1
  176. package/dist/hasSlotController-dbcac394.d.ts.map +0 -1
  177. package/dist/leu-breadcrumb.d.ts +0 -3
  178. package/dist/leu-breadcrumb.d.ts.map +0 -1
  179. package/dist/leu-breadcrumb.js +0 -17
  180. package/dist/utils-65469421.d.ts +0 -16
  181. package/dist/utils-65469421.d.ts.map +0 -1
  182. package/dist/utils-65469421.js +0 -35
  183. package/src/components/breadcrumb/Breadcrumb.js +0 -324
  184. package/src/components/breadcrumb/breadcrumb.css +0 -98
  185. package/src/components/breadcrumb/leu-breadcrumb.js +0 -5
  186. package/src/components/breadcrumb/stories/breadcrumb.stories.js +0 -73
  187. package/src/components/breadcrumb/test/breadcrumb.test.js +0 -141
@@ -4,14 +4,12 @@ import { fixture, expect } from "@open-wc/testing"
4
4
  import "../leu-popup.js"
5
5
 
6
6
  async function defaultFixture() {
7
- return fixture(
8
- html`
9
- <leu-popup
10
- ><div slot="anchor"></div>
11
- <p>Popup content</p></leu-popup
12
- >
13
- `
14
- )
7
+ return fixture(html`
8
+ <leu-popup
9
+ ><div slot="anchor"></div>
10
+ <p>Popup content</p></leu-popup
11
+ >
12
+ `)
15
13
  }
16
14
 
17
15
  describe("LeuPopup", () => {
@@ -143,10 +143,10 @@ export class LeuRadioGroup extends LeuElement {
143
143
 
144
144
  initializeIndex() {
145
145
  const index = this.items.findIndex(
146
- (item) => item.hasAttribute("checked") && !item.hasAttribute("disabled")
146
+ (item) => item.hasAttribute("checked") && !item.hasAttribute("disabled"),
147
147
  )
148
148
  const nextEnabledIndex = this.items.findIndex(
149
- (item) => !item.hasAttribute("disabled")
149
+ (item) => !item.hasAttribute("disabled"),
150
150
  )
151
151
 
152
152
  this._currentIndex = index >= 0 ? index : nextEnabledIndex
@@ -96,7 +96,7 @@ export class LeuRange extends LeuElement {
96
96
 
97
97
  get valueAsArray() {
98
98
  return Array.from(this.shadowRoot.querySelectorAll("input")).map(
99
- (input) => input.valueAsNumber
99
+ (input) => input.valueAsNumber,
100
100
  )
101
101
  }
102
102
 
@@ -205,30 +205,29 @@ export class LeuRange extends LeuElement {
205
205
  class="output"
206
206
  for="input-${type}"
207
207
  value=${defaultValue[index]}
208
- ></output>`
208
+ ></output>`,
209
209
  )}
210
210
  </div>
211
211
  <div class="inputs">
212
212
  ${inputs.map(
213
- (type, index) =>
214
- html`
215
- <input
216
- @input=${(e) => this._handleInput(index, e)}
217
- @pointerdown=${multiple && !disabled && index === 0
218
- ? this._handlePointerDown
219
- : undefined}
220
- type="range"
221
- class="range range--${type}"
222
- id="input-${type}"
223
- name=${this.name}
224
- min=${this.min}
225
- max=${this.max}
226
- step=${this.step}
227
- aria-label=${multiple ? RANGE_LABELS[index] : undefined}
228
- ?disabled=${disabled}
229
- .value=${defaultValue[index].toString()}
230
- />
231
- `
213
+ (type, index) => html`
214
+ <input
215
+ @input=${(e) => this._handleInput(index, e)}
216
+ @pointerdown=${multiple && !disabled && index === 0
217
+ ? this._handlePointerDown
218
+ : undefined}
219
+ type="range"
220
+ class="range range--${type}"
221
+ id="input-${type}"
222
+ name=${this.name}
223
+ min=${this.min}
224
+ max=${this.max}
225
+ step=${this.step}
226
+ aria-label=${multiple ? RANGE_LABELS[index] : undefined}
227
+ ?disabled=${disabled}
228
+ .value=${defaultValue[index].toString()}
229
+ />
230
+ `,
232
231
  )}
233
232
  </div>
234
233
  </div>
@@ -171,6 +171,10 @@ export class LeuSelect extends LeuElement {
171
171
  const menuItems = menu.getMenuItems()
172
172
  let hasFilterResults = false
173
173
 
174
+ if (changed.value && this.value.length === 0) {
175
+ this._displayValue = ""
176
+ }
177
+
174
178
  /* eslint-disable no-param-reassign */
175
179
  menuItems.forEach((menuItem) => {
176
180
  if (changed.multiple) {
@@ -474,10 +478,11 @@ export class LeuSelect extends LeuElement {
474
478
  ref=${ref(this._menuRef)}
475
479
  role="listbox"
476
480
  aria-multiselectable=${ifDefined(
477
- this.multiple ? "true" : undefined
481
+ this.multiple ? "true" : undefined,
478
482
  )}
479
483
  class="menu"
480
484
  @click=${this._handleMenuItemClick}
485
+ aria-labelledby="select-label"
481
486
  >
482
487
  <slot></slot>
483
488
  </leu-menu>
@@ -58,7 +58,7 @@
58
58
  line-height: 1.5;
59
59
  padding: 1.375rem 3rem 1.375rem 1rem;
60
60
 
61
- background: none;
61
+ background: var(--leu-color-black-0);
62
62
  overflow: hidden;
63
63
  text-overflow: ellipsis;
64
64
  white-space: nowrap;
@@ -59,7 +59,7 @@ function Template({
59
59
  >
60
60
  ${LeuSelect.getOptionLabel(option)}
61
61
  </leu-menu-item>
62
- `
62
+ `,
63
63
  )}
64
64
  </leu-select>
65
65
  <div style="margin-top: 50vh"></div>
@@ -8,16 +8,18 @@ import "../../menu/leu-menu-item.js"
8
8
  import { MUNICIPALITIES } from "./fixtures.js"
9
9
 
10
10
  async function defaultFixture(args = {}) {
11
- return fixture(html`<leu-select
12
- label=${ifDefined(args.label)}
13
- .value=${args.value ?? []}
14
- ?clearable=${args.clearable}
15
- ?disabled=${args.disabled}
16
- ?filterable=${args.filterable}
17
- ?multiple=${args.multiple}
18
- >
19
- ${args.options.map((o) => html`<leu-menu-item>${o}</leu-menu-item>`)}
20
- </leu-select> `)
11
+ return fixture(
12
+ html`<leu-select
13
+ label=${ifDefined(args.label)}
14
+ .value=${args.value ?? []}
15
+ ?clearable=${args.clearable}
16
+ ?disabled=${args.disabled}
17
+ ?filterable=${args.filterable}
18
+ ?multiple=${args.multiple}
19
+ >
20
+ ${args.options.map((o) => html`<leu-menu-item>${o}</leu-menu-item>`)}
21
+ </leu-select> `,
22
+ )
21
23
  }
22
24
 
23
25
  describe("LeuSelect", () => {
@@ -114,7 +116,7 @@ describe("LeuSelect", () => {
114
116
  const menuItems = Array.from(el.querySelectorAll("leu-menu-item"))
115
117
 
116
118
  const menuItem = menuItems.find(
117
- (item) => item.textContent === "Affoltern am Albis"
119
+ (item) => item.textContent === "Affoltern am Albis",
118
120
  )
119
121
 
120
122
  expect(menuItem).to.have.attribute("active")
@@ -204,7 +206,7 @@ describe("LeuSelect", () => {
204
206
 
205
207
  const menuItems = el.querySelectorAll("leu-menu-item")
206
208
  const visibleMenuItems = Array.from(menuItems).filter(
207
- (menuItem) => !menuItem.hidden
209
+ (menuItem) => !menuItem.hidden,
208
210
  )
209
211
  expect(visibleMenuItems.length).to.equal(6)
210
212
  })
@@ -231,7 +233,7 @@ describe("LeuSelect", () => {
231
233
 
232
234
  const menuItems = el.querySelectorAll("leu-menu-item")
233
235
  const visibleMenuItems = Array.from(menuItems).filter(
234
- (menuItem) => !menuItem.hidden
236
+ (menuItem) => !menuItem.hidden,
235
237
  )
236
238
 
237
239
  expect(visibleMenuItems.length).to.equal(MUNICIPALITIES.length)
@@ -296,7 +298,7 @@ describe("LeuSelect", () => {
296
298
  toggleButton.click()
297
299
 
298
300
  const menuItem = Array.from(el.querySelectorAll("leu-menu-item")).find(
299
- (item) => item.textContent === "Maur"
301
+ (item) => item.textContent === "Maur",
300
302
  )
301
303
  menuItem.click()
302
304
 
@@ -331,7 +333,7 @@ describe("LeuSelect", () => {
331
333
  toggleButton.click()
332
334
 
333
335
  const menuItem = Array.from(el.querySelectorAll("leu-menu-item")).find(
334
- (item) => item.textContent === "Hedingen"
336
+ (item) => item.textContent === "Hedingen",
335
337
  )
336
338
  menuItem.click()
337
339
 
@@ -350,7 +352,7 @@ describe("LeuSelect", () => {
350
352
  toggleButton.click()
351
353
 
352
354
  const menuItem = Array.from(el.querySelectorAll("leu-menu-item")).find(
353
- (item) => item.textContent === "Hedingen"
355
+ (item) => item.textContent === "Hedingen",
354
356
  )
355
357
  menuItem.click()
356
358
 
@@ -419,6 +421,7 @@ describe("LeuSelect", () => {
419
421
  await elementUpdated(el)
420
422
 
421
423
  expect(menuItems.every((item) => !item.multipleSelection)).to.be.true
424
+ })
422
425
 
423
426
  it("closes the popup when the document is clicked outside the component", async () => {
424
427
  const el = await defaultFixture({
@@ -141,7 +141,7 @@ export class LeuTable extends LeuElement {
141
141
  return this.itemsPerPage && this.itemsPerPage > 0
142
142
  ? this._sortedData.slice(
143
143
  (this._page - 1) * this.itemsPerPage,
144
- this._page * this.itemsPerPage
144
+ this._page * this.itemsPerPage,
145
145
  )
146
146
  : this._sortedData
147
147
  }
@@ -214,7 +214,7 @@ export class LeuTable extends LeuElement {
214
214
  : nothing}
215
215
  </button>`
216
216
  : col.name}
217
- </th>`
217
+ </th>`,
218
218
  )}
219
219
  </tr>
220
220
  </thead>
@@ -226,9 +226,9 @@ export class LeuTable extends LeuElement {
226
226
  (col) =>
227
227
  html`<td style=${bodyStyle(col, row)}>
228
228
  ${col.value(row)}
229
- </td>`
229
+ </td>`,
230
230
  )}
231
- </tr>`
231
+ </tr>`,
232
232
  )}
233
233
  </tbody>
234
234
  </table>
@@ -17,8 +17,9 @@ const data = [
17
17
  ]
18
18
 
19
19
  async function defaultFixture() {
20
- return fixture(html`<leu-table .columns=${columns} .data=${data}>
21
- </leu-table>`)
20
+ return fixture(
21
+ html`<leu-table .columns=${columns} .data=${data}> </leu-table>`,
22
+ )
22
23
  }
23
24
 
24
25
  describe("LeuTable", () => {
@@ -4,13 +4,11 @@ import { fixture, expect } from "@open-wc/testing"
4
4
  import "../leu-visually-hidden.js"
5
5
 
6
6
  async function defaultFixture() {
7
- return fixture(
8
- html`
9
- <leu-visually-hidden>
10
- This is a text that shouldn't be visible but still accessible.
11
- </leu-visually-hidden>
12
- `
13
- )
7
+ return fixture(html`
8
+ <leu-visually-hidden>
9
+ This is a text that shouldn't be visible but still accessible.
10
+ </leu-visually-hidden>
11
+ `)
14
12
  }
15
13
 
16
14
  describe("LeuVisuallyHidden", () => {
@@ -30,7 +28,7 @@ describe("LeuVisuallyHidden", () => {
30
28
  const el = await defaultFixture()
31
29
 
32
30
  expect(el).dom.to.equal(
33
- "<leu-visually-hidden>This is a text that shouldn't be visible but still accessible.</leu-visually-hidden>"
31
+ "<leu-visually-hidden>This is a text that shouldn't be visible but still accessible.</leu-visually-hidden>",
34
32
  )
35
33
  })
36
34
  })
@@ -20,14 +20,14 @@ export class LeuElement extends LitElement {
20
20
 
21
21
  if (currentlyRegisteredConstructor !== constructor) {
22
22
  console.warn(
23
- `The custom element with the name <${name}> is already registered with a different constructor. This can happen when the same element has been loaded from different modules (e.g. multiple CDN requests or bundles).`
23
+ `The custom element with the name <${name}> is already registered with a different constructor. This can happen when the same element has been loaded from different modules (e.g. multiple CDN requests or bundles).`,
24
24
  )
25
25
  return
26
26
  }
27
27
 
28
28
  if (currentlyRegisteredConstructor.version !== constructor.version) {
29
29
  console.warn(
30
- `The custom element with the name <${name}> is already defined with the same constructor but a different version (${currentlyRegisteredConstructor.version}).`
30
+ `The custom element with the name <${name}> is already defined with the same constructor but a different version (${currentlyRegisteredConstructor.version}).`,
31
31
  )
32
32
  }
33
33
  }
@@ -65,7 +65,7 @@ export class HasSlotController {
65
65
  hostDisconnected() {
66
66
  this.host.shadowRoot.removeEventListener(
67
67
  "slotchange",
68
- this.handleSlotChange
68
+ this.handleSlotChange,
69
69
  )
70
70
  }
71
71
 
@@ -3,3 +3,12 @@
3
3
  box-sizing: border-box;
4
4
  font-feature-settings: var(--leu-t-font-feature-settings);
5
5
  }
6
+
7
+ /**
8
+ * If a custom element sets the display property to any value
9
+ * it will not be hidden by the [hidden] attribute.
10
+ * That's why we need to specify this rule.
11
+ */
12
+ :host([hidden]) {
13
+ display: none;
14
+ }
@@ -53,7 +53,9 @@ function Template() {
53
53
  .flat()
54
54
  .map(
55
55
  (columns) =>
56
- html`<div style="grid-column-end: span ${columns}">${columns}</div>`
56
+ html`<div style="grid-column-end: span ${columns}">
57
+ ${columns}
58
+ </div>`,
57
59
  )}
58
60
  </div>`
59
61
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "include": ["dist/**/*.js"],
3
- "exclude": ["node_modules", "dist/**/*.d.ts"],
2
+ "include": ["./dist/**/*.js"],
3
+ "exclude": ["./node_modules"],
4
4
  "compilerOptions": {
5
5
  // Tells TypeScript to read JS files, as
6
6
  // normally they are ignored as source files
@@ -16,6 +16,7 @@
16
16
  "outDir": "dist",
17
17
  // go to js file when using IDE functions like
18
18
  // "Go to Definition" in VSCode
19
- "declarationMap": true
19
+ "declarationMap": true,
20
+ "skipLibCheck": true
20
21
  }
21
22
  }
@@ -13,6 +13,7 @@ export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
13
13
  mimeTypes: {
14
14
  "**/custom-elements.json": "js",
15
15
  "src/components/**/*.css": "js",
16
+ ".storybook/static/*.css": "js",
16
17
  "src/styles/common-styles.css": "js",
17
18
  },
18
19
  plugins: [...plugins, json()],
@@ -1,7 +1,7 @@
1
1
  import { playwrightLauncher } from "@web/test-runner-playwright"
2
2
  import { plugins as wdsPlugins } from "./web-dev-server.config.mjs"
3
3
 
4
- const filteredLogs = ["Running in dev mode", "lit-html is in dev mode"]
4
+ const filteredLogs = ["Couldn't load preload assets", "Lit is in dev mode"]
5
5
 
6
6
  export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
7
7
  /** Test files to run */
@@ -9,6 +9,7 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
9
9
  plugins: wdsPlugins,
10
10
  mimeTypes: {
11
11
  "src/components/**/*.css": "js",
12
+ "src/styles/common-styles.css": "js",
12
13
  },
13
14
 
14
15
  /** Resolve bare module imports */
@@ -1,38 +0,0 @@
1
- name: Test
2
-
3
- on: workflow_dispatch
4
-
5
- jobs:
6
- test:
7
- runs-on: ubuntu-latest
8
-
9
- steps:
10
- - name: Checkout code
11
- uses: actions/checkout@v4
12
-
13
- - name: Use Node.js
14
- uses: actions/setup-node@v3
15
- with:
16
- node-version: "18.x"
17
-
18
- - name: Install dependencies
19
- run: npm ci
20
-
21
- - name: Install Playwright browsers
22
- run: npx playwright install
23
-
24
- - name: Cache Playwright binaries
25
- uses: actions/cache@v3
26
- with:
27
- path: ~/.cache/ms-playwright
28
- key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
29
- restore-keys: |
30
- ${{ runner.os }}-playwright-
31
-
32
- - name: Run tests
33
- run: npm test
34
-
35
- - uses: actions/upload-artifact@v3
36
- with:
37
- name: coverage
38
- path: coverage/
@@ -1,5 +0,0 @@
1
- <link rel="stylesheet" href="theme.css" />
2
- <link
3
- rel="stylesheet"
4
- href="https://www.web.statistik.zh.ch/leu/styles/fonts.css"
5
- />
@@ -1,69 +0,0 @@
1
- /**
2
- * A Breadcrumb Navigation.
3
- *
4
- * The breadcrumbs can be displayed in two different layouts.
5
- * Only the back link (the last item / parent of the current page)
6
- * is displayed when…
7
- * - … the width of the container is smaller
8
- * than the BACK_ONLY_BREAKPOINT.
9
- * - … less then two breadcrumb items could be displayed
10
- * without overflowing the container.
11
- *
12
- * Otherwise as many items as possible are displayed in an inline list
13
- * without overflowing the container. The remaining items are displayed
14
- * in a dropdown menu.
15
- *
16
- * In order to determine the exact numbers of items that have to be
17
- * hidden inside the dropdown, all of them have to be rendered first.
18
- * 1. Render all items
19
- * 2. Calculate (measure) the number of items that can be displayed
20
- * without overflowing the container.
21
- * 3. Updating the state (_hiddeItems) which will trigger a rerender
22
- * 4. Render the items again with the new state.
23
- *
24
- * This results in multiple updates scheduled one after another. Lit
25
- * will also print a waring in the console beacause of that.
26
- * It's no a nice behaviour but the only one that works without
27
- * having duplicate and hidden markup to derive the sizes from that.
28
- *
29
- *
30
- * @prop {Array} items - Object array with { label, href }
31
- * @prop {boolean} inverted - invert color on dark background
32
- *
33
- * @tagname leu-breadcrumb
34
- */
35
- export class LeuBreadcrumb extends LeuElement {
36
- _lastContainerWidth: any;
37
- _showBackOnly: boolean;
38
- _isRecalculating: boolean;
39
- _hiddenItems: number;
40
- _isDropdownOpen: boolean;
41
- items: any[];
42
- /** @type {boolean} - will be used on dark Background */
43
- inverted: boolean;
44
- /** @internal */
45
- _containerRef: import("lit-html/directives/ref.js").Ref<Element>;
46
- resizeObserver: ResizeObserver;
47
- firstUpdated(): void;
48
- updated(changedProperties: any): Promise<void>;
49
- /** @internal */
50
- get _listItems(): any;
51
- /** @internal */
52
- get _dropdownItems(): any[];
53
- /**
54
- * Calculate the number of items that can be displayed
55
- * without overflowing the container.
56
- * @internal
57
- * @returns {void}
58
- */
59
- _checkWidth(): void;
60
- /**
61
- * Render the dropdown menu
62
- * @returns
63
- */
64
- renderDropdown(): import("lit-html").TemplateResult<1> | typeof nothing;
65
- render(): import("lit-html").TemplateResult<1> | typeof nothing;
66
- }
67
- import { L as LeuElement } from './LeuElement-874a297c.js';
68
- import { nothing } from 'lit';
69
- //# sourceMappingURL=Breadcrumb.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["Breadcrumb.js"],"names":[],"mappings":"AAoHA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IAOM,yBAA+C;IAO7C,uBAAyB;IACzB,0BAA6B;IAY7B,qBAAqB;IASvB,yBAA4C;IAW9C,aAAe;IACf,wDAAwD;IACxD,UADW,OAAO,CACG;IAErB,gBAAgB;IAChB,iEAAgC;IAehC,+BAEQ;IAEV,qBAEC;IACD,+CAOC;IAOD,gBAAgB;IAChB,sBAEC;IAED,gBAAgB;IAChB,4BAEC;IACD;;;;;OAKG;IACH,eAFa,IAAI,CA4BhB;IACD;;;OAGG;IACH,wEAqCC;IACD,gEAmCC;CACF;gCAtWqD,0BAA0B;wBAC7C,KAAK"}