@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.
- package/.eslintrc.json +8 -0
- package/.github/workflows/ci.yml +78 -0
- package/.github/workflows/deploy-github-pages.yaml +2 -1
- package/.github/workflows/release-please.yml +2 -1
- package/.nvmrc +1 -0
- package/.prettierignore +1 -0
- package/.storybook/main.js +19 -3
- package/.storybook/static/fonts/Inter-Black.woff2 +0 -0
- package/.storybook/static/fonts/Inter-Regular.woff2 +0 -0
- package/.storybook/static/fonts.css +11 -0
- package/CHANGELOG.md +27 -0
- package/custom-elements-manifest.config.js +2 -2
- package/dist/Accordion.d.ts +1 -1
- package/dist/Accordion.d.ts.map +1 -1
- package/dist/Accordion.js +2 -4
- package/dist/Button.d.ts +2 -2
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +64 -34
- package/dist/ButtonGroup.d.ts +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/Checkbox.d.ts +1 -1
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +2 -3
- package/dist/CheckboxGroup.d.ts +1 -1
- package/dist/CheckboxGroup.d.ts.map +1 -1
- package/dist/CheckboxGroup.js +1 -3
- package/dist/Chip.d.ts +1 -1
- package/dist/Chip.d.ts.map +1 -1
- package/dist/Chip.js +5 -6
- package/dist/ChipGroup.d.ts +1 -1
- package/dist/ChipGroup.d.ts.map +1 -1
- package/dist/ChipGroup.js +2 -2
- package/dist/ChipLink.js +1 -1
- package/dist/ChipRemovable.js +1 -1
- package/dist/ChipSelectable.js +1 -1
- package/dist/Dialog.d.ts +1 -1
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +3 -5
- package/dist/Dropdown.d.ts +1 -1
- package/dist/Dropdown.d.ts.map +1 -1
- package/dist/Dropdown.js +4 -3
- package/dist/Icon.d.ts +2 -98
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +6 -2
- package/dist/Input.d.ts +7 -2
- package/dist/Input.d.ts.map +1 -1
- package/dist/Input.js +15 -8
- package/dist/{LeuElement-874a297c.d.ts → LeuElement-BjGpKQpe.d.ts} +1 -1
- package/dist/LeuElement-BjGpKQpe.d.ts.map +1 -0
- package/dist/{LeuElement-874a297c.js → LeuElement-BjGpKQpe.js} +12 -2
- package/dist/Menu.d.ts +2 -2
- package/dist/Menu.js +1 -1
- package/dist/MenuItem.d.ts +3 -3
- package/dist/MenuItem.js +1 -1
- package/dist/Pagination.d.ts +1 -1
- package/dist/Pagination.js +3 -3
- package/dist/Popup.d.ts +2 -2
- package/dist/Popup.d.ts.map +1 -1
- package/dist/Popup.js +2 -3
- package/dist/Radio.d.ts +1 -1
- package/dist/Radio.d.ts.map +1 -1
- package/dist/Radio.js +1 -3
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +1 -3
- package/dist/Range.d.ts +1 -1
- package/dist/Range.d.ts.map +1 -1
- package/dist/Range.js +17 -19
- package/dist/ScrollTop.d.ts +1 -1
- package/dist/ScrollTop.d.ts.map +1 -1
- package/dist/ScrollTop.js +27 -3
- package/dist/Select.d.ts +3 -3
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +7 -5
- package/dist/Spinner.d.ts +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Table.d.ts +1 -1
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +3 -4
- package/dist/VisuallyHidden.d.ts +1 -1
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +3 -5
- package/dist/{hasSlotController-dbcac394.d.ts → hasSlotController-DvFw2NdC.d.ts} +1 -1
- package/dist/hasSlotController-DvFw2NdC.d.ts.map +1 -0
- package/dist/{hasSlotController-dbcac394.js → hasSlotController-DvFw2NdC.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -7
- package/dist/leu-accordion.js +1 -1
- package/dist/leu-button-group.js +1 -1
- package/dist/leu-button.js +2 -2
- package/dist/leu-checkbox-group.js +1 -1
- package/dist/leu-checkbox.js +1 -1
- package/dist/leu-chip-group.js +1 -1
- package/dist/leu-chip-link.js +1 -1
- package/dist/leu-chip-removable.js +1 -1
- package/dist/leu-chip-selectable.js +1 -1
- package/dist/leu-dialog.js +2 -2
- package/dist/leu-dropdown.js +2 -2
- package/dist/leu-icon.js +1 -1
- package/dist/leu-input.js +1 -1
- package/dist/leu-menu-item.js +1 -1
- package/dist/leu-menu.js +1 -1
- package/dist/leu-pagination.js +2 -2
- package/dist/leu-popup.js +1 -1
- package/dist/leu-radio-group.js +1 -1
- package/dist/leu-radio.js +1 -1
- package/dist/leu-range.js +1 -1
- package/dist/leu-scroll-top.js +2 -3
- package/dist/leu-select.js +2 -2
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.js +2 -2
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/theme.css +143 -107
- package/dist/vscode.html-custom-data.json +3 -32
- package/dist/vue/index.d.ts +11 -77
- package/dist/web-types.json +246 -242
- package/index.js +1 -1
- package/package.json +55 -51
- package/rollup.config.js +3 -3
- package/scripts/generate-component/generate.js +5 -5
- package/src/components/accordion/test/accordion.test.js +24 -20
- package/src/components/button/Button.js +9 -4
- package/src/components/button/button.css +56 -22
- package/src/components/button/stories/button.stories.js +44 -45
- package/src/components/button/test/button.test.js +13 -13
- package/src/components/button-group/ButtonGroup.js +1 -1
- package/src/components/button-group/stories/button-group.stories.js +2 -2
- package/src/components/checkbox/checkbox.css +1 -0
- package/src/components/chip/ChipSelectable.js +1 -1
- package/src/components/chip/chip.css +4 -3
- package/src/components/chip/stories/chip-group.stories.js +4 -4
- package/src/components/chip/stories/chip-selectable.stories.js +1 -1
- package/src/components/chip/test/chip-group.test.js +25 -33
- package/src/components/chip/test/chip-link.test.js +5 -5
- package/src/components/chip/test/chip-removable.test.js +6 -8
- package/src/components/chip/test/chip-selectable.test.js +9 -11
- package/src/components/dialog/test/dialog.test.js +1 -1
- package/src/components/dropdown/dropdown.css +1 -0
- package/src/components/dropdown/test/dropdown.test.js +12 -13
- package/src/components/icon/icon.css +4 -0
- package/src/components/input/Input.js +25 -17
- package/src/components/input/stories/input.stories.js +0 -2
- package/src/components/input/test/input.test.js +26 -0
- package/src/components/menu/stories/menu-item.stories.js +2 -0
- package/src/components/menu/test/menu-item.test.js +3 -2
- package/src/components/menu/test/menu.test.js +24 -22
- package/src/components/pagination/Pagination.js +1 -1
- package/src/components/pagination/pagination.css +1 -1
- package/src/components/pagination/stories/pagination.stories.js +2 -1
- package/src/components/pagination/test/pagination.test.js +8 -6
- package/src/components/popup/Popup.js +4 -4
- package/src/components/popup/popup.css +1 -0
- package/src/components/popup/test/popup.test.js +6 -8
- package/src/components/radio/RadioGroup.js +2 -2
- package/src/components/range/Range.js +20 -21
- package/src/components/select/Select.js +6 -1
- package/src/components/select/select.css +1 -1
- package/src/components/select/stories/select.stories.js +1 -1
- package/src/components/select/test/select.test.js +19 -16
- package/src/components/table/Table.js +4 -4
- package/src/components/table/test/table.test.js +3 -2
- package/src/components/visually-hidden/test/visually-hidden.test.js +6 -8
- package/src/lib/LeuElement.js +2 -2
- package/src/lib/hasSlotController.js +1 -1
- package/src/styles/common-styles.css +9 -0
- package/src/styles/style.stories.js +3 -1
- package/tsconfig.build.json +4 -3
- package/web-dev-server.config.mjs +1 -0
- package/web-test-runner.config.mjs +2 -1
- package/.github/workflows/test.yml +0 -38
- package/.storybook/preview-head.html +0 -5
- package/dist/Breadcrumb.d.ts +0 -69
- package/dist/Breadcrumb.d.ts.map +0 -1
- package/dist/Breadcrumb.js +0 -391
- package/dist/LeuElement-874a297c.d.ts.map +0 -1
- package/dist/hasSlotController-dbcac394.d.ts.map +0 -1
- package/dist/leu-breadcrumb.d.ts +0 -3
- package/dist/leu-breadcrumb.d.ts.map +0 -1
- package/dist/leu-breadcrumb.js +0 -17
- package/dist/utils-65469421.d.ts +0 -16
- package/dist/utils-65469421.d.ts.map +0 -1
- package/dist/utils-65469421.js +0 -35
- package/src/components/breadcrumb/Breadcrumb.js +0 -324
- package/src/components/breadcrumb/breadcrumb.css +0 -98
- package/src/components/breadcrumb/leu-breadcrumb.js +0 -5
- package/src/components/breadcrumb/stories/breadcrumb.stories.js +0 -73
- 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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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>
|
|
@@ -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(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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(
|
|
21
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
})
|
package/src/lib/LeuElement.js
CHANGED
|
@@ -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
|
}
|
|
@@ -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
|
+
}
|
package/tsconfig.build.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"include": ["dist/**/*.js"],
|
|
3
|
-
"exclude": ["node_modules"
|
|
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 = ["
|
|
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/
|
package/dist/Breadcrumb.d.ts
DELETED
|
@@ -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
|
package/dist/Breadcrumb.d.ts.map
DELETED
|
@@ -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"}
|