@statistikzh/leu 0.14.1 → 0.14.3
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/.github/workflows/ci.yml +3 -0
- package/CHANGELOG.md +16 -0
- package/dist/Accordion.d.ts +1 -1
- package/dist/Accordion.js +1 -1
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +2 -2
- package/dist/ButtonGroup.d.ts +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/Checkbox.d.ts +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/CheckboxGroup.d.ts +1 -1
- package/dist/CheckboxGroup.js +1 -1
- package/dist/Chip.d.ts +1 -1
- package/dist/Chip.js +1 -1
- package/dist/ChipGroup.d.ts +1 -1
- package/dist/ChipGroup.js +1 -1
- 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.js +2 -2
- package/dist/Dropdown.d.ts +1 -1
- package/dist/Dropdown.js +2 -2
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +1 -1
- package/dist/{LeuElement-DH0PPSMq.d.ts → LeuElement-Dd6zm9XF.d.ts} +1 -1
- package/dist/LeuElement-Dd6zm9XF.d.ts.map +1 -0
- package/dist/{LeuElement-DH0PPSMq.js → LeuElement-Dd6zm9XF.js} +1 -1
- package/dist/Menu.d.ts +1 -1
- package/dist/Menu.js +2 -2
- package/dist/MenuItem.d.ts +1 -1
- package/dist/MenuItem.js +1 -1
- package/dist/Pagination.d.ts +1 -1
- package/dist/Pagination.js +2 -2
- package/dist/Popup.d.ts +1 -1
- package/dist/Popup.js +1 -1
- package/dist/Radio.d.ts +1 -1
- package/dist/Radio.js +1 -1
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/Range.d.ts +1 -1
- package/dist/Range.js +1 -1
- package/dist/ScrollTop.d.ts +1 -1
- package/dist/ScrollTop.js +2 -2
- package/dist/Select.d.ts +8 -1
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +20 -5
- package/dist/Spinner.d.ts +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Table.d.ts +1 -1
- package/dist/Table.js +2 -2
- package/dist/VisuallyHidden.d.ts +1 -1
- package/dist/VisuallyHidden.js +1 -1
- package/dist/{hasSlotController-CYd5tWew.d.ts → hasSlotController-dQsSUUpb.d.ts} +1 -1
- package/dist/{hasSlotController-CYd5tWew.d.ts.map → hasSlotController-dQsSUUpb.d.ts.map} +1 -1
- package/dist/{hasSlotController-CYd5tWew.js → hasSlotController-dQsSUUpb.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- 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 -2
- 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 +4 -4
- package/dist/web-types.json +1 -1
- package/package.json +3 -3
- package/src/components/menu/Menu.js +2 -1
- package/src/components/select/Select.js +18 -3
- package/src/components/select/test/select.test.js +92 -0
- package/src/styles/custom-properties.css +4 -4
- package/dist/LeuElement-DH0PPSMq.d.ts.map +0 -1
package/.github/workflows/ci.yml
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.14.3](https://github.com/statistikZH/leu/compare/v0.14.2...v0.14.3) (2025-04-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **menu:** only call focus when an item exists ([60d71e8](https://github.com/statistikZH/leu/commit/60d71e8847a4dd6cd152a4cfc4770af98e029f8b))
|
|
9
|
+
* **select:** avoid clearing selection when clearable is not set ([3a21cf1](https://github.com/statistikZH/leu/commit/3a21cf1363826064d73a4da7eeaf078a3b0a6455))
|
|
10
|
+
* **select:** only render 'no results' message when a filter is set ([60d71e8](https://github.com/statistikZH/leu/commit/60d71e8847a4dd6cd152a4cfc4770af98e029f8b))
|
|
11
|
+
|
|
12
|
+
## [0.14.2](https://github.com/statistikZH/leu/compare/v0.14.1...v0.14.2) (2025-04-15)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **theme:** add quotes to font family names ([9e51bd0](https://github.com/statistikZH/leu/commit/9e51bd09b408c9e4d56126b7e65e68ecd368e876))
|
|
18
|
+
|
|
3
19
|
## [0.14.1](https://github.com/statistikZH/leu/compare/v0.14.0...v0.14.1) (2025-04-02)
|
|
4
20
|
|
|
5
21
|
|
package/dist/Accordion.d.ts
CHANGED
|
@@ -28,5 +28,5 @@ export class LeuAccordion extends LeuElement {
|
|
|
28
28
|
_handleToggleClick(): void;
|
|
29
29
|
render(): import("lit-html").TemplateResult;
|
|
30
30
|
}
|
|
31
|
-
import { L as LeuElement } from './LeuElement-
|
|
31
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
32
32
|
//# sourceMappingURL=Accordion.d.ts.map
|
package/dist/Accordion.js
CHANGED
package/dist/Button.d.ts
CHANGED
|
@@ -41,6 +41,6 @@ export class LeuButton extends LeuElement {
|
|
|
41
41
|
hasTextContent(): boolean;
|
|
42
42
|
render(): import("lit-html").TemplateResult<1>;
|
|
43
43
|
}
|
|
44
|
-
import { L as LeuElement } from './LeuElement-
|
|
44
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
45
45
|
import { nothing } from 'lit';
|
|
46
46
|
//# sourceMappingURL=Button.d.ts.map
|
package/dist/Button.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, html, nothing } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
5
|
import { LeuIcon } from './Icon.js';
|
|
6
|
-
import { H as HasSlotController } from './hasSlotController-
|
|
6
|
+
import { H as HasSlotController } from './hasSlotController-dQsSUUpb.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* All roles that are associated with a aria-checked attribute
|
package/dist/ButtonGroup.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ export class LeuButtonGroup extends LeuElement {
|
|
|
20
20
|
_handleButtonClick(button: any): void;
|
|
21
21
|
render(): import("lit-html").TemplateResult<1>;
|
|
22
22
|
}
|
|
23
|
-
import { L as LeuElement } from './LeuElement-
|
|
23
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
24
24
|
//# sourceMappingURL=ButtonGroup.d.ts.map
|
package/dist/ButtonGroup.js
CHANGED
package/dist/Checkbox.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export class LeuCheckbox extends LeuElement {
|
|
|
10
10
|
handleInput(event: any): void;
|
|
11
11
|
render(): import("lit-html").TemplateResult<1>;
|
|
12
12
|
}
|
|
13
|
-
import { L as LeuElement } from './LeuElement-
|
|
13
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
14
14
|
//# sourceMappingURL=Checkbox.d.ts.map
|
package/dist/Checkbox.js
CHANGED
package/dist/CheckboxGroup.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export class LeuCheckboxGroup extends LeuElement {
|
|
|
10
10
|
handleItems(): void;
|
|
11
11
|
render(): import("lit-html").TemplateResult<1>;
|
|
12
12
|
}
|
|
13
|
-
import { L as LeuElement } from './LeuElement-
|
|
13
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
14
14
|
//# sourceMappingURL=CheckboxGroup.d.ts.map
|
package/dist/CheckboxGroup.js
CHANGED
package/dist/Chip.d.ts
CHANGED
package/dist/Chip.js
CHANGED
package/dist/ChipGroup.d.ts
CHANGED
package/dist/ChipGroup.js
CHANGED
package/dist/ChipLink.js
CHANGED
package/dist/ChipRemovable.js
CHANGED
package/dist/ChipSelectable.js
CHANGED
package/dist/Dialog.d.ts
CHANGED
|
@@ -13,5 +13,5 @@ export class LeuDialog extends LeuElement {
|
|
|
13
13
|
close(): void;
|
|
14
14
|
render(): import("lit-html").TemplateResult<1>;
|
|
15
15
|
}
|
|
16
|
-
import { L as LeuElement } from './LeuElement-
|
|
16
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
17
17
|
//# sourceMappingURL=Dialog.d.ts.map
|
package/dist/Dialog.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, nothing, html } from 'lit';
|
|
3
3
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
-
import { H as HasSlotController } from './hasSlotController-
|
|
5
|
+
import { H as HasSlotController } from './hasSlotController-dQsSUUpb.js';
|
|
6
6
|
import { LeuIcon } from './Icon.js';
|
|
7
7
|
|
|
8
8
|
var css_248z = css`/* figma https://www.figma.com/design/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?node-id=21161-186812&t=8VgDy9avMRG5aL7s-0 */
|
package/dist/Dropdown.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ export class LeuDropdown extends LeuElement {
|
|
|
15
15
|
_getMenu(): any;
|
|
16
16
|
render(): import("lit-html").TemplateResult<1>;
|
|
17
17
|
}
|
|
18
|
-
import { L as LeuElement } from './LeuElement-
|
|
18
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
19
19
|
//# sourceMappingURL=Dropdown.d.ts.map
|
package/dist/Dropdown.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, nothing, html } from 'lit';
|
|
3
3
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
4
|
-
import { H as HasSlotController } from './hasSlotController-
|
|
4
|
+
import { H as HasSlotController } from './hasSlotController-dQsSUUpb.js';
|
|
5
5
|
import { LeuButton } from './Button.js';
|
|
6
6
|
import { LeuMenu } from './Menu.js';
|
|
7
7
|
import { LeuMenuItem } from './MenuItem.js';
|
package/dist/Icon.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ export class LeuIcon extends LeuElement {
|
|
|
16
16
|
name: any | "";
|
|
17
17
|
render(): import("lit-html").TemplateResult<1>;
|
|
18
18
|
}
|
|
19
|
-
import { L as LeuElement } from './LeuElement-
|
|
19
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
20
20
|
//# sourceMappingURL=Icon.d.ts.map
|
package/dist/Icon.js
CHANGED
package/dist/Input.d.ts
CHANGED
|
@@ -150,6 +150,6 @@ export const SIZES: Readonly<{
|
|
|
150
150
|
SMALL: "small";
|
|
151
151
|
REGULAR: "regular";
|
|
152
152
|
}>;
|
|
153
|
-
import { L as LeuElement } from './LeuElement-
|
|
153
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
154
154
|
import { nothing } from 'lit';
|
|
155
155
|
//# sourceMappingURL=Input.d.ts.map
|
package/dist/Input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, nothing, html } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -4,4 +4,4 @@ declare class LeuElement extends LitElement {
|
|
|
4
4
|
declare function _defineProperty(obj: any, key: any, value: any): any;
|
|
5
5
|
import { LitElement } from 'lit';
|
|
6
6
|
export { LeuElement as L, _defineProperty as _ };
|
|
7
|
-
//# sourceMappingURL=LeuElement-
|
|
7
|
+
//# sourceMappingURL=LeuElement-Dd6zm9XF.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeuElement-Dd6zm9XF.d.ts","sourceRoot":"","sources":["LeuElement-Dd6zm9XF.js"],"names":[],"mappings":"AAgDA;IACE,8EAcC;CACF;AA9DD,sEAaC;2BAf+B,KAAK"}
|
|
@@ -63,7 +63,7 @@ class LeuElement extends LitElement {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
_defineProperty(LeuElement, "version", "0.14.
|
|
66
|
+
_defineProperty(LeuElement, "version", "0.14.3");
|
|
67
67
|
_defineProperty(LeuElement, "dependencies", {});
|
|
68
68
|
_defineProperty(LeuElement, "styles", css_248z);
|
|
69
69
|
|
package/dist/Menu.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export class LeuMenu extends LeuElement {
|
|
|
25
25
|
updated(changedProperties: any): void;
|
|
26
26
|
render(): import("lit-html").TemplateResult<1>;
|
|
27
27
|
}
|
|
28
|
-
import { L as LeuElement } from './LeuElement-
|
|
28
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
29
29
|
import { LeuMenuItem } from './MenuItem.js';
|
|
30
30
|
//# sourceMappingURL=Menu.d.ts.map
|
package/dist/Menu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { LeuMenuItem } from './MenuItem.js';
|
|
4
4
|
import 'lit/directives/if-defined.js';
|
|
@@ -120,7 +120,7 @@ class LeuMenu extends LeuElement {
|
|
|
120
120
|
}
|
|
121
121
|
focusItem(index) {
|
|
122
122
|
const currentItem = this.setCurrentItem(index);
|
|
123
|
-
currentItem
|
|
123
|
+
currentItem?.focus();
|
|
124
124
|
}
|
|
125
125
|
firstUpdated() {
|
|
126
126
|
this.setCurrentItem(0);
|
package/dist/MenuItem.d.ts
CHANGED
|
@@ -37,6 +37,6 @@ export class LeuMenuItem extends LeuElement {
|
|
|
37
37
|
_renderBeforeSlotDefault(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
38
38
|
render(): import("lit-html").TemplateResult<1>;
|
|
39
39
|
}
|
|
40
|
-
import { L as LeuElement } from './LeuElement-
|
|
40
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
41
41
|
import { nothing } from 'lit';
|
|
42
42
|
//# sourceMappingURL=MenuItem.d.ts.map
|
package/dist/MenuItem.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, html, nothing } from 'lit';
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
4
|
import { LeuIcon } from './Icon.js';
|
package/dist/Pagination.d.ts
CHANGED
|
@@ -30,5 +30,5 @@ export class LeuPagination extends LeuElement {
|
|
|
30
30
|
_handleKeyDown(event: any): void;
|
|
31
31
|
render(): import("lit-html").TemplateResult<1>;
|
|
32
32
|
}
|
|
33
|
-
import { L as LeuElement } from './LeuElement-
|
|
33
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
34
34
|
//# sourceMappingURL=Pagination.d.ts.map
|
package/dist/Pagination.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { live } from 'lit/directives/live.js';
|
|
4
4
|
import { LeuButton } from './Button.js';
|
|
@@ -6,7 +6,7 @@ import { LeuVisuallyHidden } from './VisuallyHidden.js';
|
|
|
6
6
|
import { LeuIcon } from './Icon.js';
|
|
7
7
|
import 'lit/directives/class-map.js';
|
|
8
8
|
import 'lit/directives/if-defined.js';
|
|
9
|
-
import './hasSlotController-
|
|
9
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
10
10
|
|
|
11
11
|
var css_248z = css`:host {
|
|
12
12
|
margin-top: 16px;
|
package/dist/Popup.d.ts
CHANGED
|
@@ -32,5 +32,5 @@ export class LeuPopup extends LeuElement {
|
|
|
32
32
|
handleAnchorChange(): void;
|
|
33
33
|
render(): import("lit-html").TemplateResult<1>;
|
|
34
34
|
}
|
|
35
|
-
import { L as LeuElement } from './LeuElement-
|
|
35
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
36
36
|
//# sourceMappingURL=Popup.d.ts.map
|
package/dist/Popup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { autoUpdate, size, flip, shift, computePosition } from '@floating-ui/dom';
|
|
4
4
|
|
package/dist/Radio.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export class LeuRadio extends LeuElement {
|
|
|
10
10
|
handleInput(event: any): void;
|
|
11
11
|
render(): import("lit-html").TemplateResult<1>;
|
|
12
12
|
}
|
|
13
|
-
import { L as LeuElement } from './LeuElement-
|
|
13
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
14
14
|
//# sourceMappingURL=Radio.d.ts.map
|
package/dist/Radio.js
CHANGED
package/dist/RadioGroup.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ export class LeuRadioGroup extends LeuElement {
|
|
|
16
16
|
initializeIndex(): void;
|
|
17
17
|
render(): import("lit-html").TemplateResult<1>;
|
|
18
18
|
}
|
|
19
|
-
import { L as LeuElement } from './LeuElement-
|
|
19
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
20
20
|
//# sourceMappingURL=RadioGroup.d.ts.map
|
package/dist/RadioGroup.js
CHANGED
package/dist/Range.d.ts
CHANGED
|
@@ -56,5 +56,5 @@ export class LeuRange extends LeuElement {
|
|
|
56
56
|
}): void;
|
|
57
57
|
render(): import("lit-html").TemplateResult<1>;
|
|
58
58
|
}
|
|
59
|
-
import { L as LeuElement } from './LeuElement-
|
|
59
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
60
60
|
//# sourceMappingURL=Range.d.ts.map
|
package/dist/Range.js
CHANGED
package/dist/ScrollTop.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ export class LeuScrollTop extends LeuElement {
|
|
|
15
15
|
_scrollListener: Function;
|
|
16
16
|
render(): import("lit-html").TemplateResult<1>;
|
|
17
17
|
}
|
|
18
|
-
import { L as LeuElement } from './LeuElement-
|
|
18
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
19
19
|
//# sourceMappingURL=ScrollTop.d.ts.map
|
package/dist/ScrollTop.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { LeuButton } from './Button.js';
|
|
5
5
|
import { LeuIcon } from './Icon.js';
|
|
6
6
|
import 'lit/directives/if-defined.js';
|
|
7
|
-
import './hasSlotController-
|
|
7
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Return a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked.
|
package/dist/Select.d.ts
CHANGED
|
@@ -94,6 +94,13 @@ export class LeuSelect extends LeuElement {
|
|
|
94
94
|
* - Hide menu items that do not match the filter.
|
|
95
95
|
*/
|
|
96
96
|
_updateMenuItems(changed: any): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Update all the menu items when the slot changes
|
|
99
|
+
* to make sure that the menu items are in sync
|
|
100
|
+
* with the state of the component.
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
_handleItemSlotChange(): void;
|
|
97
104
|
/**
|
|
98
105
|
* @internal
|
|
99
106
|
* @param {KeyboardEvent} event
|
|
@@ -127,6 +134,6 @@ export class LeuSelect extends LeuElement {
|
|
|
127
134
|
_renderToggleButton(): import("lit-html").TemplateResult<1>;
|
|
128
135
|
render(): import("lit-html").TemplateResult<1>;
|
|
129
136
|
}
|
|
130
|
-
import { L as LeuElement } from './LeuElement-
|
|
137
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
131
138
|
import { nothing } from 'lit';
|
|
132
139
|
//# sourceMappingURL=Select.d.ts.map
|
package/dist/Select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["Select.js"],"names":[],"mappings":"AAuPA;;;;;;;;;;;;;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,sCAqBC;IAED;;;;OAIG;IACH,8CAgCC;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,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["Select.js"],"names":[],"mappings":"AAuPA;;;;;;;;;;;;;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,sCAqBC;IAED;;;;OAIG;IACH,8CAgCC;IAED;;;;;OAKG;IACH,8BAMC;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,uCAqBC;IACD,4EAaC;IACD,4EAeC;IACD,4DAmCC;IACD,+CAgDC;CACF;gCAjrBqD,0BAA0B;wBAC7C,KAAK"}
|
package/dist/Select.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, nothing, html } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
|
-
import { H as HasSlotController } from './hasSlotController-
|
|
6
|
+
import { H as HasSlotController } from './hasSlotController-dQsSUUpb.js';
|
|
7
7
|
import { LeuButton } from './Button.js';
|
|
8
8
|
import { LeuMenu } from './Menu.js';
|
|
9
9
|
import { LeuMenuItem } from './MenuItem.js';
|
|
@@ -450,6 +450,20 @@ class LeuSelect extends LeuElement {
|
|
|
450
450
|
menu.setCurrentItem(0);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Update all the menu items when the slot changes
|
|
456
|
+
* to make sure that the menu items are in sync
|
|
457
|
+
* with the state of the component.
|
|
458
|
+
* @internal
|
|
459
|
+
*/
|
|
460
|
+
_handleItemSlotChange() {
|
|
461
|
+
this._updateMenuItems({
|
|
462
|
+
value: true,
|
|
463
|
+
optionFilter: true,
|
|
464
|
+
multiple: true
|
|
465
|
+
});
|
|
466
|
+
}
|
|
453
467
|
/**
|
|
454
468
|
* @internal
|
|
455
469
|
* @param {KeyboardEvent} event
|
|
@@ -548,7 +562,8 @@ class LeuSelect extends LeuElement {
|
|
|
548
562
|
if (this.multiple) {
|
|
549
563
|
this.value = isSelected ? this.value.filter(v => v !== value) : this.value.concat(value);
|
|
550
564
|
this._deferedChangeEvent = true;
|
|
551
|
-
} else {
|
|
565
|
+
} else if (this.clearable || !isSelected) {
|
|
566
|
+
// Only clear if clearable is true or if the value is not selected.
|
|
552
567
|
this.value = isSelected ? [] : [value];
|
|
553
568
|
this._displayValue = isSelected ? "" : menuItem.textContent;
|
|
554
569
|
}
|
|
@@ -659,9 +674,9 @@ class LeuSelect extends LeuElement {
|
|
|
659
674
|
@click=${this._handleMenuItemClick}
|
|
660
675
|
aria-labelledby="select-label"
|
|
661
676
|
>
|
|
662
|
-
<slot
|
|
677
|
+
<slot @slotchange=${this._handleItemSlotChange}> </slot>
|
|
663
678
|
</leu-menu>
|
|
664
|
-
${this._hasFilterResults ? nothing : html` <p class="filter-message-empty" aria-live="polite">
|
|
679
|
+
${this._hasFilterResults || this._optionFilter === "" ? nothing : html` <p class="filter-message-empty" aria-live="polite">
|
|
665
680
|
Keine Resultate
|
|
666
681
|
</p>`}
|
|
667
682
|
${this._renderApplyButton()}
|
package/dist/Spinner.d.ts
CHANGED
package/dist/Spinner.js
CHANGED
package/dist/Table.d.ts
CHANGED
|
@@ -38,5 +38,5 @@ export class LeuTable extends LeuElement {
|
|
|
38
38
|
get _data(): any[];
|
|
39
39
|
render(): import("lit-html").TemplateResult<1>;
|
|
40
40
|
}
|
|
41
|
-
import { L as LeuElement } from './LeuElement-
|
|
41
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
42
42
|
//# sourceMappingURL=Table.d.ts.map
|
package/dist/Table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
2
|
import { css, html, nothing } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
@@ -8,7 +8,7 @@ import { LeuPagination } from './Pagination.js';
|
|
|
8
8
|
import 'lit/directives/live.js';
|
|
9
9
|
import './Button.js';
|
|
10
10
|
import 'lit/directives/if-defined.js';
|
|
11
|
-
import './hasSlotController-
|
|
11
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
12
12
|
import './VisuallyHidden.js';
|
|
13
13
|
|
|
14
14
|
var css_248z = css`:host {
|
package/dist/VisuallyHidden.d.ts
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
export class LeuVisuallyHidden extends LeuElement {
|
|
5
5
|
render(): import("lit-html").TemplateResult<1>;
|
|
6
6
|
}
|
|
7
|
-
import { L as LeuElement } from './LeuElement-
|
|
7
|
+
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
8
8
|
//# sourceMappingURL=VisuallyHidden.d.ts.map
|
package/dist/VisuallyHidden.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasSlotController-
|
|
1
|
+
{"version":3,"file":"hasSlotController-dQsSUUpb.d.ts","sourceRoot":"","sources":["hasSlotController-dQsSUUpb.js"],"names":[],"mappings":";;;;iCASa,OAAO,KAAK,EAAE,kBAAkB;AAP7C;;;GAGG;AAEH;;;;GAIG;AACH,2CAFgB,kBAAkB;IAGhC,uCAcC;IAHC,UAAgB;IAEhB,eAA0B;IAG5B;;;OAGG;IACH,uBAeC;IAED;;;;OAIG;IACH,qBAEC;IAED;;;OAGG;IACH,gCAEC;IACD,sBAEC;IACD,yBAEC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { LeuRadio } from "./Radio.js";
|
|
|
15
15
|
export { LeuRadioGroup } from "./RadioGroup.js";
|
|
16
16
|
export { LeuSelect } from "./Select.js";
|
|
17
17
|
export { LeuTable } from "./Table.js";
|
|
18
|
-
export { L as LeuElement } from "./LeuElement-
|
|
18
|
+
export { L as LeuElement } from "./LeuElement-Dd6zm9XF.js";
|
|
19
19
|
export { BUTTON_EXPANDED_OPTIONS, BUTTON_SIZES, BUTTON_TYPES, BUTTON_VARIANTS, LeuButton } from "./Button.js";
|
|
20
20
|
export { LeuInput, SIZES } from "./Input.js";
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -17,13 +17,13 @@ export { LeuRadio } from './Radio.js';
|
|
|
17
17
|
export { LeuRadioGroup } from './RadioGroup.js';
|
|
18
18
|
export { LeuSelect } from './Select.js';
|
|
19
19
|
export { LeuTable } from './Table.js';
|
|
20
|
-
export { L as LeuElement } from './LeuElement-
|
|
20
|
+
export { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
21
21
|
import 'lit';
|
|
22
22
|
import 'lit/static-html.js';
|
|
23
23
|
import 'lit/directives/class-map.js';
|
|
24
24
|
import 'lit/directives/if-defined.js';
|
|
25
25
|
import './Icon.js';
|
|
26
|
-
import './hasSlotController-
|
|
26
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
27
27
|
import './Chip.js';
|
|
28
28
|
import 'lit/directives/ref.js';
|
|
29
29
|
import 'lit/directives/live.js';
|
package/dist/leu-accordion.js
CHANGED
package/dist/leu-button-group.js
CHANGED
package/dist/leu-button.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LeuButton } from './Button.js';
|
|
2
|
-
import './LeuElement-
|
|
2
|
+
import './LeuElement-Dd6zm9XF.js';
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit/directives/class-map.js';
|
|
5
5
|
import 'lit/directives/if-defined.js';
|
|
6
6
|
import './Icon.js';
|
|
7
|
-
import './hasSlotController-
|
|
7
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
8
8
|
|
|
9
9
|
LeuButton.define("leu-button");
|
|
10
10
|
|
package/dist/leu-checkbox.js
CHANGED
package/dist/leu-chip-group.js
CHANGED
package/dist/leu-chip-link.js
CHANGED
package/dist/leu-dialog.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LeuDialog } from './Dialog.js';
|
|
2
|
-
import './LeuElement-
|
|
2
|
+
import './LeuElement-Dd6zm9XF.js';
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit/directives/ref.js';
|
|
5
5
|
import 'lit/directives/class-map.js';
|
|
6
|
-
import './hasSlotController-
|
|
6
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
7
7
|
import './Icon.js';
|
|
8
8
|
|
|
9
9
|
LeuDialog.define("leu-dialog");
|
package/dist/leu-dropdown.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LeuDropdown } from './Dropdown.js';
|
|
2
|
-
import './LeuElement-
|
|
2
|
+
import './LeuElement-Dd6zm9XF.js';
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit/directives/ref.js';
|
|
5
|
-
import './hasSlotController-
|
|
5
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
6
6
|
import './Button.js';
|
|
7
7
|
import 'lit/directives/class-map.js';
|
|
8
8
|
import 'lit/directives/if-defined.js';
|
package/dist/leu-icon.js
CHANGED
package/dist/leu-input.js
CHANGED
package/dist/leu-menu-item.js
CHANGED
package/dist/leu-menu.js
CHANGED
package/dist/leu-pagination.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { LeuPagination } from './Pagination.js';
|
|
2
|
-
import './LeuElement-
|
|
2
|
+
import './LeuElement-Dd6zm9XF.js';
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit/directives/live.js';
|
|
5
5
|
import './Button.js';
|
|
6
6
|
import 'lit/directives/class-map.js';
|
|
7
7
|
import 'lit/directives/if-defined.js';
|
|
8
8
|
import './Icon.js';
|
|
9
|
-
import './hasSlotController-
|
|
9
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
10
10
|
import './VisuallyHidden.js';
|
|
11
11
|
|
|
12
12
|
LeuPagination.define("leu-pagination");
|
package/dist/leu-popup.js
CHANGED
package/dist/leu-radio-group.js
CHANGED
package/dist/leu-radio.js
CHANGED
package/dist/leu-range.js
CHANGED
package/dist/leu-scroll-top.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LeuScrollTop } from './ScrollTop.js';
|
|
2
|
-
import './LeuElement-
|
|
2
|
+
import './LeuElement-Dd6zm9XF.js';
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit/directives/class-map.js';
|
|
5
5
|
import './Button.js';
|
|
6
6
|
import 'lit/directives/if-defined.js';
|
|
7
7
|
import './Icon.js';
|
|
8
|
-
import './hasSlotController-
|
|
8
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
9
9
|
|
|
10
10
|
LeuScrollTop.define("leu-scroll-top");
|
|
11
11
|
|
package/dist/leu-select.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LeuSelect } from './Select.js';
|
|
2
|
-
import './LeuElement-
|
|
2
|
+
import './LeuElement-Dd6zm9XF.js';
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit/directives/class-map.js';
|
|
5
5
|
import 'lit/directives/ref.js';
|
|
6
6
|
import 'lit/directives/if-defined.js';
|
|
7
|
-
import './hasSlotController-
|
|
7
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
8
8
|
import './Button.js';
|
|
9
9
|
import './Icon.js';
|
|
10
10
|
import './Menu.js';
|
package/dist/leu-spinner.js
CHANGED
package/dist/leu-table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LeuTable } from './Table.js';
|
|
2
|
-
import './LeuElement-
|
|
2
|
+
import './LeuElement-Dd6zm9XF.js';
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit/directives/class-map.js';
|
|
5
5
|
import 'lit/directives/style-map.js';
|
|
@@ -9,7 +9,7 @@ import './Pagination.js';
|
|
|
9
9
|
import 'lit/directives/live.js';
|
|
10
10
|
import './Button.js';
|
|
11
11
|
import 'lit/directives/if-defined.js';
|
|
12
|
-
import './hasSlotController-
|
|
12
|
+
import './hasSlotController-dQsSUUpb.js';
|
|
13
13
|
import './VisuallyHidden.js';
|
|
14
14
|
|
|
15
15
|
LeuTable.define("leu-table");
|
package/dist/theme.css
CHANGED
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
--leu-color-func-green: #1a7f1f;
|
|
45
45
|
|
|
46
46
|
/* stylelint-disable value-keyword-case */
|
|
47
|
-
--leu-font-family-regular:
|
|
48
|
-
sans-serif;
|
|
49
|
-
--leu-font-family-black:
|
|
50
|
-
sans-serif;
|
|
47
|
+
--leu-font-family-regular:
|
|
48
|
+
"InterRegular", "HelveticaNowRegular", "Helvetica", sans-serif;
|
|
49
|
+
--leu-font-family-black:
|
|
50
|
+
"InterBlack", "HelveticaNowBlack", "Arial Black", "Helvetica", sans-serif;
|
|
51
51
|
/* stylelint-enable value-keyword-case */
|
|
52
52
|
|
|
53
53
|
--leu-box-shadow-short: 0px 0px 2px var(--leu-color-black-transp-40);
|
package/dist/web-types.json
CHANGED
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.14.
|
|
6
|
+
"version": "0.14.3",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -46,8 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@floating-ui/dom": "^1.6.13",
|
|
49
|
-
"lit": "^3.1.4"
|
|
50
|
-
"stylelint-config-recommended": "^15.0.0"
|
|
49
|
+
"lit": "^3.1.4"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
52
|
"@babel/preset-env": "^7.26.9",
|
|
@@ -102,6 +101,7 @@
|
|
|
102
101
|
"sinon": "^19.0.2",
|
|
103
102
|
"storybook": "^8.5.8",
|
|
104
103
|
"stylelint": "^16.14.1",
|
|
104
|
+
"stylelint-config-recommended": "^15.0.0",
|
|
105
105
|
"stylelint-config-standard": "^37.0.0",
|
|
106
106
|
"typescript": "^5.7.3"
|
|
107
107
|
},
|
|
@@ -207,6 +207,20 @@ export class LeuSelect extends LeuElement {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Update all the menu items when the slot changes
|
|
212
|
+
* to make sure that the menu items are in sync
|
|
213
|
+
* with the state of the component.
|
|
214
|
+
* @internal
|
|
215
|
+
*/
|
|
216
|
+
_handleItemSlotChange() {
|
|
217
|
+
this._updateMenuItems({
|
|
218
|
+
value: true,
|
|
219
|
+
optionFilter: true,
|
|
220
|
+
multiple: true,
|
|
221
|
+
})
|
|
222
|
+
}
|
|
223
|
+
|
|
210
224
|
/**
|
|
211
225
|
* Handles clicks outside of the component to close the dropdown.
|
|
212
226
|
* @internal
|
|
@@ -344,7 +358,8 @@ export class LeuSelect extends LeuElement {
|
|
|
344
358
|
: this.value.concat(value)
|
|
345
359
|
|
|
346
360
|
this._deferedChangeEvent = true
|
|
347
|
-
} else {
|
|
361
|
+
} else if (this.clearable || !isSelected) {
|
|
362
|
+
// Only clear if clearable is true or if the value is not selected.
|
|
348
363
|
this.value = isSelected ? [] : [value]
|
|
349
364
|
this._displayValue = isSelected ? "" : menuItem.textContent
|
|
350
365
|
}
|
|
@@ -468,9 +483,9 @@ export class LeuSelect extends LeuElement {
|
|
|
468
483
|
@click=${this._handleMenuItemClick}
|
|
469
484
|
aria-labelledby="select-label"
|
|
470
485
|
>
|
|
471
|
-
<slot
|
|
486
|
+
<slot @slotchange=${this._handleItemSlotChange}> </slot>
|
|
472
487
|
</leu-menu>
|
|
473
|
-
${this._hasFilterResults
|
|
488
|
+
${this._hasFilterResults || this._optionFilter === ""
|
|
474
489
|
? nothing
|
|
475
490
|
: html` <p class="filter-message-empty" aria-live="polite">
|
|
476
491
|
Keine Resultate
|
|
@@ -258,6 +258,63 @@ describe("LeuSelect", () => {
|
|
|
258
258
|
const emptyMessage = el.shadowRoot.querySelector(".filter-message-empty")
|
|
259
259
|
expect(emptyMessage).to.exist
|
|
260
260
|
expect(emptyMessage).to.have.attribute("aria-live", "polite")
|
|
261
|
+
expect(emptyMessage).to.have.trimmed.text("Keine Resultate")
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
it("doesn't render a message when no options are available and no filter is set", async () => {
|
|
265
|
+
const el = await defaultFixture({
|
|
266
|
+
options: [],
|
|
267
|
+
label: "Gemeinde",
|
|
268
|
+
filterable: true,
|
|
269
|
+
})
|
|
270
|
+
|
|
271
|
+
const toggleButton = el.shadowRoot.querySelector(".select-toggle")
|
|
272
|
+
toggleButton.click()
|
|
273
|
+
|
|
274
|
+
const emptyMessage = el.shadowRoot.querySelector(".filter-message-empty")
|
|
275
|
+
expect(emptyMessage).not.to.exist
|
|
276
|
+
})
|
|
277
|
+
|
|
278
|
+
it("syncs the state to the menu items when they're updated lazily", async () => {
|
|
279
|
+
const el = await defaultFixture({
|
|
280
|
+
options: [],
|
|
281
|
+
label: "Gemeinde",
|
|
282
|
+
value: ["Affoltern am Albis"],
|
|
283
|
+
filterable: true,
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
const toggleButton = el.shadowRoot.querySelector(".select-toggle")
|
|
287
|
+
toggleButton.click()
|
|
288
|
+
|
|
289
|
+
const filterInput = el.shadowRoot.querySelector(".select-search")
|
|
290
|
+
filterInput.focus()
|
|
291
|
+
|
|
292
|
+
await sendKeys({ type: "am albis" })
|
|
293
|
+
await elementUpdated(el)
|
|
294
|
+
|
|
295
|
+
let emptyMessage = el.shadowRoot.querySelector(".filter-message-empty")
|
|
296
|
+
expect(emptyMessage).to.exist
|
|
297
|
+
|
|
298
|
+
const fragment = document.createDocumentFragment()
|
|
299
|
+
MUNICIPALITIES.forEach((option) => {
|
|
300
|
+
const menuItem = document.createElement("leu-menu-item")
|
|
301
|
+
menuItem.textContent = option
|
|
302
|
+
fragment.appendChild(menuItem)
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
el.appendChild(fragment)
|
|
306
|
+
|
|
307
|
+
// Two calls to elementUpdated are needed because the _hasFilterResults
|
|
308
|
+
// property is set during the updated lifecycle
|
|
309
|
+
await elementUpdated(el)
|
|
310
|
+
await elementUpdated(el)
|
|
311
|
+
emptyMessage = el.shadowRoot.querySelector(".filter-message-empty")
|
|
312
|
+
expect(emptyMessage).to.be.null
|
|
313
|
+
|
|
314
|
+
const menuItem = Array.from(el.querySelectorAll("leu-menu-item")).find(
|
|
315
|
+
(item) => item.textContent === "Affoltern am Albis",
|
|
316
|
+
)
|
|
317
|
+
expect(menuItem).to.have.attribute("active")
|
|
261
318
|
})
|
|
262
319
|
|
|
263
320
|
it("renders a apply button when multiple selection is allowed", async () => {
|
|
@@ -305,6 +362,41 @@ describe("LeuSelect", () => {
|
|
|
305
362
|
expect(el.value).to.deep.equal(["Maur"])
|
|
306
363
|
})
|
|
307
364
|
|
|
365
|
+
it("doesn't allow unselecting the value", async () => {
|
|
366
|
+
const el = await defaultFixture({
|
|
367
|
+
options: MUNICIPALITIES,
|
|
368
|
+
label: "Gemeinde",
|
|
369
|
+
value: ["Maur"],
|
|
370
|
+
})
|
|
371
|
+
const toggleButton = el.shadowRoot.querySelector(".select-toggle")
|
|
372
|
+
toggleButton.click()
|
|
373
|
+
|
|
374
|
+
const menuItem = Array.from(el.querySelectorAll("leu-menu-item")).find(
|
|
375
|
+
(item) => item.textContent === "Maur",
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
menuItem.click()
|
|
379
|
+
expect(el.value).to.deep.equal(["Maur"])
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
it("allows unselecting the value when clearable is set", async () => {
|
|
383
|
+
const el = await defaultFixture({
|
|
384
|
+
options: MUNICIPALITIES,
|
|
385
|
+
label: "Gemeinde",
|
|
386
|
+
value: ["Maur"],
|
|
387
|
+
clearable: true,
|
|
388
|
+
})
|
|
389
|
+
const toggleButton = el.shadowRoot.querySelector(".select-toggle")
|
|
390
|
+
toggleButton.click()
|
|
391
|
+
|
|
392
|
+
const menuItem = Array.from(el.querySelectorAll("leu-menu-item")).find(
|
|
393
|
+
(item) => item.textContent === "Maur",
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
menuItem.click()
|
|
397
|
+
expect(el.value).to.deep.equal([])
|
|
398
|
+
})
|
|
399
|
+
|
|
308
400
|
it("allows a value with multiple values", async () => {
|
|
309
401
|
const el = await defaultFixture({
|
|
310
402
|
options: MUNICIPALITIES,
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
--leu-color-func-green: #1a7f1f;
|
|
47
47
|
|
|
48
48
|
/* stylelint-disable value-keyword-case */
|
|
49
|
-
--leu-font-family-regular:
|
|
50
|
-
sans-serif;
|
|
51
|
-
--leu-font-family-black:
|
|
52
|
-
sans-serif;
|
|
49
|
+
--leu-font-family-regular:
|
|
50
|
+
"InterRegular", "HelveticaNowRegular", "Helvetica", sans-serif;
|
|
51
|
+
--leu-font-family-black:
|
|
52
|
+
"InterBlack", "HelveticaNowBlack", "Arial Black", "Helvetica", sans-serif;
|
|
53
53
|
/* stylelint-enable value-keyword-case */
|
|
54
54
|
|
|
55
55
|
--leu-box-shadow-short: 0px 0px 2px var(--leu-color-black-transp-40);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LeuElement-DH0PPSMq.d.ts","sourceRoot":"","sources":["LeuElement-DH0PPSMq.js"],"names":[],"mappings":"AAgDA;IACE,8EAcC;CACF;AA9DD,sEAaC;2BAf+B,KAAK"}
|