@statistikzh/leu 0.21.1 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release-please.yml +1 -2
- package/.nvmrc +1 -1
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +16 -0
- package/README.md +15 -10
- package/dist/Accordion.js +1 -1
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/ChartWrapper.js +1 -1
- package/dist/Checkbox.d.ts +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/CheckboxGroup.js +1 -1
- package/dist/Chip.d.ts +1 -7
- package/dist/Chip.js +7 -5
- package/dist/ChipGroup.d.ts +17 -36
- package/dist/ChipGroup.js +35 -33
- package/dist/ChipLink.d.ts +5 -21
- package/dist/ChipLink.js +14 -15
- package/dist/ChipRemovable.d.ts +4 -15
- package/dist/ChipRemovable.js +7 -9
- package/dist/ChipSelectable.d.ts +14 -37
- package/dist/ChipSelectable.js +24 -28
- package/dist/Dialog.d.ts +7 -18
- package/dist/Dialog.js +15 -18
- package/dist/Dropdown.d.ts +16 -24
- package/dist/Dropdown.js +23 -21
- package/dist/FileInput.d.ts +2 -1
- package/dist/FileInput.js +19 -5
- package/dist/Icon.d-itcQ94ym.d.ts +151 -0
- package/dist/Icon.d.ts +4 -156
- package/dist/Icon.js +1 -4
- package/dist/Input.d.ts +73 -141
- package/dist/Input.js +91 -88
- package/dist/{LeuElement-BLUQU9Eu.js → LeuElement-DfsEye-A.js} +1 -1
- package/dist/Menu.d.ts +2 -8
- package/dist/Menu.js +7 -9
- package/dist/MenuItem.d.ts +31 -59
- package/dist/MenuItem.js +30 -33
- package/dist/Message.d.ts +1 -1
- package/dist/Message.js +1 -1
- package/dist/Pagination.d.ts +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Placeholder.js +1 -1
- package/dist/Popup.js +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/Radio.js +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/Range.d.ts +22 -65
- package/dist/Range.js +36 -37
- package/dist/ScrollTop.d.ts +5 -7
- package/dist/ScrollTop.js +10 -15
- package/dist/Select.d.ts +2 -1
- package/dist/Select.js +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Table.d.ts +1 -1
- package/dist/Table.js +1 -1
- package/dist/Tag.js +1 -1
- package/dist/VisuallyHidden.js +1 -1
- package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts +5 -0
- package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts.map +1 -1
- package/dist/components/chip/Chip.d.ts +1 -7
- package/dist/components/chip/Chip.d.ts.map +1 -1
- package/dist/components/chip/ChipGroup.d.ts +15 -35
- package/dist/components/chip/ChipGroup.d.ts.map +1 -1
- package/dist/components/chip/ChipLink.d.ts +4 -20
- package/dist/components/chip/ChipLink.d.ts.map +1 -1
- package/dist/components/chip/ChipRemovable.d.ts +3 -14
- package/dist/components/chip/ChipRemovable.d.ts.map +1 -1
- package/dist/components/chip/ChipSelectable.d.ts +13 -36
- package/dist/components/chip/ChipSelectable.d.ts.map +1 -1
- package/dist/components/chip/stories/chip-group.stories.d.ts +1 -1
- package/dist/components/chip/stories/chip-group.stories.d.ts.map +1 -1
- package/dist/components/chip/stories/chip-link.stories.d.ts.map +1 -1
- package/dist/components/chip/stories/chip-selectable.stories.d.ts.map +1 -1
- package/dist/components/dialog/Dialog.d.ts +5 -17
- package/dist/components/dialog/Dialog.d.ts.map +1 -1
- package/dist/components/dropdown/Dropdown.d.ts +14 -23
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/stories/dropdown.stories.d.ts.map +1 -1
- package/dist/components/file-input/FileInput.d.ts +1 -0
- package/dist/components/file-input/FileInput.d.ts.map +1 -1
- package/dist/components/file-input/leu-file-input.d.ts +5 -0
- package/dist/components/file-input/leu-file-input.d.ts.map +1 -1
- package/dist/components/file-input/stories/file-input.stories.d.ts +4 -0
- package/dist/components/file-input/stories/file-input.stories.d.ts.map +1 -1
- package/dist/components/icon/Icon.d.ts +0 -6
- package/dist/components/icon/Icon.d.ts.map +1 -1
- package/dist/components/input/Input.d.ts +73 -140
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/menu/Menu.d.ts +1 -7
- package/dist/components/menu/Menu.d.ts.map +1 -1
- package/dist/components/menu/MenuItem.d.ts +30 -57
- package/dist/components/menu/MenuItem.d.ts.map +1 -1
- package/dist/components/message/leu-message.d.ts +5 -0
- package/dist/components/message/leu-message.d.ts.map +1 -1
- package/dist/components/placeholder/leu-placeholder.d.ts +5 -0
- package/dist/components/placeholder/leu-placeholder.d.ts.map +1 -1
- package/dist/components/progress-bar/leu-progress-bar.d.ts +5 -0
- package/dist/components/progress-bar/leu-progress-bar.d.ts.map +1 -1
- package/dist/components/range/Range.d.ts +22 -65
- package/dist/components/range/Range.d.ts.map +1 -1
- package/dist/components/scroll-top/ScrollTop.d.ts +4 -6
- package/dist/components/scroll-top/ScrollTop.d.ts.map +1 -1
- package/dist/components/tag/leu-tag.d.ts +5 -0
- package/dist/components/tag/leu-tag.d.ts.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -4
- package/dist/leu-accordion.js +1 -1
- package/dist/leu-button-group.js +1 -1
- package/dist/leu-button.d.ts +1 -1
- package/dist/leu-button.js +1 -1
- package/dist/leu-chart-wrapper.d.ts +10 -1
- package/dist/leu-chart-wrapper.js +1 -1
- package/dist/leu-checkbox-group.js +1 -1
- package/dist/leu-checkbox.d.ts +1 -1
- package/dist/leu-checkbox.js +1 -1
- package/dist/leu-chip-group.d.ts +2 -0
- package/dist/leu-chip-group.js +5 -1
- package/dist/leu-chip-link.js +3 -1
- package/dist/leu-chip-removable.d.ts +1 -1
- package/dist/leu-chip-removable.js +3 -3
- package/dist/leu-chip-selectable.js +3 -1
- package/dist/leu-dialog.d.ts +2 -1
- package/dist/leu-dialog.js +3 -3
- package/dist/leu-dropdown.d.ts +2 -1
- package/dist/leu-dropdown.js +3 -3
- package/dist/leu-file-input.d.ts +11 -2
- package/dist/leu-file-input.js +11 -4
- package/dist/leu-icon.d.ts +1 -1
- package/dist/leu-icon.js +1 -1
- package/dist/leu-input.d.ts +2 -1
- package/dist/leu-input.js +3 -3
- package/dist/leu-menu-item.d.ts +2 -2
- package/dist/leu-menu-item.js +3 -3
- package/dist/leu-menu.d.ts +1 -1
- package/dist/leu-menu.js +3 -3
- package/dist/leu-message.d.ts +11 -2
- package/dist/leu-message.js +1 -1
- package/dist/leu-pagination.d.ts +1 -1
- package/dist/leu-pagination.js +1 -1
- package/dist/leu-placeholder.d.ts +10 -1
- package/dist/leu-placeholder.js +1 -1
- package/dist/leu-popup.js +1 -1
- package/dist/leu-progress-bar.d.ts +10 -1
- package/dist/leu-progress-bar.js +1 -1
- package/dist/leu-radio-group.js +1 -1
- package/dist/leu-radio.js +1 -1
- package/dist/leu-range.js +3 -1
- package/dist/leu-scroll-top.d.ts +1 -1
- package/dist/leu-scroll-top.js +3 -3
- package/dist/leu-select.d.ts +2 -1
- package/dist/leu-select.js +1 -1
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.d.ts +1 -1
- package/dist/leu-table.js +1 -1
- package/dist/leu-tag.d.ts +10 -1
- package/dist/leu-tag.js +1 -1
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/vscode.html-custom-data.json +115 -111
- package/dist/vue/index.d.ts +116 -131
- package/dist/web-types.json +303 -303
- package/package.json +1 -1
- package/scripts/generate-component/templates/[namespace]-[name].ts +6 -0
- package/src/components/chart-wrapper/leu-chart-wrapper.ts +6 -0
- package/src/components/chip/Chip.ts +3 -9
- package/src/components/chip/ChipGroup.ts +26 -39
- package/src/components/chip/ChipLink.ts +7 -18
- package/src/components/chip/ChipRemovable.ts +4 -11
- package/src/components/chip/ChipSelectable.ts +21 -35
- package/src/components/chip/stories/chip-group.stories.ts +4 -7
- package/src/components/chip/stories/chip-link.stories.ts +2 -4
- package/src/components/chip/stories/chip-selectable.stories.ts +4 -6
- package/src/components/chip/test/chip-group.test.ts +34 -31
- package/src/components/dialog/Dialog.ts +9 -22
- package/src/components/dropdown/Dropdown.ts +20 -24
- package/src/components/dropdown/stories/dropdown.stories.ts +6 -2
- package/src/components/dropdown/test/dropdown.test.ts +14 -2
- package/src/components/file-input/FileInput.ts +12 -1
- package/src/components/file-input/leu-file-input.ts +6 -0
- package/src/components/file-input/stories/file-input.stories.ts +7 -0
- package/src/components/icon/Icon.ts +0 -4
- package/src/components/input/Input.ts +108 -105
- package/src/components/menu/Menu.ts +3 -12
- package/src/components/menu/MenuItem.ts +37 -41
- package/src/components/message/leu-message.ts +6 -0
- package/src/components/placeholder/leu-placeholder.ts +6 -0
- package/src/components/progress-bar/leu-progress-bar.ts +6 -0
- package/src/components/range/Range.ts +51 -59
- package/src/components/scroll-top/ScrollTop.ts +8 -15
- package/src/components/tag/leu-tag.ts +6 -0
- package/src/index.ts +11 -0
package/dist/ChipSelectable.d.ts
CHANGED
|
@@ -3,54 +3,31 @@ import { LeuChipBase } from './Chip.js';
|
|
|
3
3
|
import 'lit';
|
|
4
4
|
import './LeuElement.d-BevHqLUu.js';
|
|
5
5
|
|
|
6
|
-
declare const SIZES: {
|
|
7
|
-
small: string;
|
|
8
|
-
regular: string;
|
|
9
|
-
};
|
|
10
|
-
declare const VARIANTS: {
|
|
11
|
-
toggle: string;
|
|
12
|
-
radio: string;
|
|
13
|
-
};
|
|
14
6
|
/**
|
|
15
7
|
* A chip component that can be selected.
|
|
16
8
|
* @tagname leu-chip-selectable
|
|
17
9
|
* @slot - The content of the chip
|
|
18
|
-
* @prop {keyof typeof SIZES} size - The size of the chip. Not supported for radio variant.
|
|
19
|
-
* @prop {keyof typeof VARIANTS} variant - `toggle` or `radio`. Determines if only one or multiple chips can be selected.
|
|
20
|
-
* @prop {boolean} checked - Whether the chip is selected.
|
|
21
|
-
* @prop {string} value - The value of the chip.
|
|
22
10
|
*/
|
|
23
11
|
declare class LeuChipSelectable extends LeuChipBase {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
reflect: boolean;
|
|
36
|
-
};
|
|
37
|
-
value: {
|
|
38
|
-
type: StringConstructor;
|
|
39
|
-
reflect: boolean;
|
|
40
|
-
};
|
|
41
|
-
inverted: {
|
|
42
|
-
type: BooleanConstructor;
|
|
43
|
-
reflect: boolean;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
12
|
+
/** The size of the chip. Has no effect when variant is "radio" */
|
|
13
|
+
size: "small" | "regular";
|
|
14
|
+
/**
|
|
15
|
+
* The variant of the chip. Determines if only one or multiple chips can be selected.
|
|
16
|
+
* @default "toggle"
|
|
17
|
+
*/
|
|
18
|
+
variant: "toggle" | "radio";
|
|
19
|
+
/** Whether the chip is selected */
|
|
20
|
+
checked: boolean;
|
|
21
|
+
/** The value of the chip */
|
|
22
|
+
value: string;
|
|
46
23
|
constructor();
|
|
47
|
-
handleClick(): void;
|
|
24
|
+
protected handleClick(): void;
|
|
48
25
|
/**
|
|
49
26
|
* Returns the value of the chip. If `value` is not set, it will return the text content
|
|
50
27
|
* @returns {string}
|
|
51
28
|
*/
|
|
52
|
-
getValue():
|
|
29
|
+
getValue(): string;
|
|
53
30
|
render(): lit_html.TemplateResult<1>;
|
|
54
31
|
}
|
|
55
32
|
|
|
56
|
-
export { LeuChipSelectable
|
|
33
|
+
export { LeuChipSelectable };
|
package/dist/ChipSelectable.js
CHANGED
|
@@ -1,44 +1,35 @@
|
|
|
1
|
+
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
1
2
|
import { html } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
2
4
|
import { LeuChipBase } from './Chip.js';
|
|
3
|
-
import './LeuElement-
|
|
5
|
+
import './LeuElement-DfsEye-A.js';
|
|
4
6
|
|
|
5
|
-
const SIZES = {
|
|
6
|
-
small: "small",
|
|
7
|
-
regular: "regular",
|
|
8
|
-
};
|
|
9
|
-
const VARIANTS = {
|
|
10
|
-
toggle: "toggle",
|
|
11
|
-
radio: "radio",
|
|
12
|
-
};
|
|
13
7
|
/**
|
|
14
8
|
* A chip component that can be selected.
|
|
15
9
|
* @tagname leu-chip-selectable
|
|
16
10
|
* @slot - The content of the chip
|
|
17
|
-
* @prop {keyof typeof SIZES} size - The size of the chip. Not supported for radio variant.
|
|
18
|
-
* @prop {keyof typeof VARIANTS} variant - `toggle` or `radio`. Determines if only one or multiple chips can be selected.
|
|
19
|
-
* @prop {boolean} checked - Whether the chip is selected.
|
|
20
|
-
* @prop {string} value - The value of the chip.
|
|
21
11
|
*/
|
|
22
12
|
class LeuChipSelectable extends LeuChipBase {
|
|
23
13
|
constructor() {
|
|
24
14
|
super();
|
|
25
|
-
|
|
15
|
+
/** The size of the chip. Has no effect when variant is "radio" */
|
|
16
|
+
this.size = "regular";
|
|
26
17
|
/**
|
|
27
|
-
* The variant of the chip.
|
|
28
|
-
* - `toggle`: The chip behaves like a toggle button.
|
|
29
|
-
* - `radio`: The chip behaves like a radio button.
|
|
18
|
+
* The variant of the chip. Determines if only one or multiple chips can be selected.
|
|
30
19
|
* @default "toggle"
|
|
31
20
|
*/
|
|
32
|
-
this.variant =
|
|
21
|
+
this.variant = "toggle";
|
|
22
|
+
/** Whether the chip is selected */
|
|
33
23
|
this.checked = false;
|
|
24
|
+
/** The value of the chip */
|
|
34
25
|
this.value = "";
|
|
35
|
-
if (this.variant ===
|
|
26
|
+
if (this.variant === "radio" && this.size === "small") {
|
|
36
27
|
console.warn("Small size has no effect on radio variant");
|
|
37
28
|
}
|
|
38
29
|
}
|
|
39
30
|
handleClick() {
|
|
40
31
|
let nextcheckedState = this.checked;
|
|
41
|
-
if (this.variant ===
|
|
32
|
+
if (this.variant === "radio") {
|
|
42
33
|
nextcheckedState = true;
|
|
43
34
|
}
|
|
44
35
|
else {
|
|
@@ -73,12 +64,17 @@ class LeuChipSelectable extends LeuChipBase {
|
|
|
73
64
|
</button>`;
|
|
74
65
|
}
|
|
75
66
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
__decorate([
|
|
68
|
+
property({ type: String, reflect: true })
|
|
69
|
+
], LeuChipSelectable.prototype, "size", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
property({ type: String, reflect: true })
|
|
72
|
+
], LeuChipSelectable.prototype, "variant", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
property({ type: Boolean, reflect: true })
|
|
75
|
+
], LeuChipSelectable.prototype, "checked", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: String, reflect: true })
|
|
78
|
+
], LeuChipSelectable.prototype, "value", void 0);
|
|
83
79
|
|
|
84
|
-
export { LeuChipSelectable
|
|
80
|
+
export { LeuChipSelectable };
|
package/dist/Dialog.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
|
|
2
3
|
import * as lit from 'lit';
|
|
3
4
|
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
4
5
|
import { H as HasSlotController } from './hasSlotController.d-emXwVXWF.js';
|
|
5
|
-
import { LeuIcon } from './Icon.js';
|
|
6
|
+
import { L as LeuIcon } from './Icon.d-itcQ94ym.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @tagname leu-dialog
|
|
@@ -20,23 +21,11 @@ declare class LeuDialog extends LeuElement {
|
|
|
20
21
|
customElements?: CustomElementRegistry;
|
|
21
22
|
registry?: CustomElementRegistry;
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
label: {
|
|
29
|
-
type: StringConstructor;
|
|
30
|
-
};
|
|
31
|
-
sublabel: {
|
|
32
|
-
type: StringConstructor;
|
|
33
|
-
};
|
|
34
|
-
open: {
|
|
35
|
-
type: BooleanConstructor;
|
|
36
|
-
open: boolean;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
constructor();
|
|
24
|
+
label: string;
|
|
25
|
+
sublabel: string;
|
|
26
|
+
open: boolean;
|
|
27
|
+
protected _dialogRef: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
|
|
28
|
+
protected hasSlotController: HasSlotController;
|
|
40
29
|
show(): void;
|
|
41
30
|
close(): void;
|
|
42
31
|
render(): lit_html.TemplateResult<1>;
|
package/dist/Dialog.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
1
2
|
import { css, nothing, html } from 'lit';
|
|
2
3
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
3
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
-
import {
|
|
5
|
+
import { property } from 'lit/decorators.js';
|
|
6
|
+
import { L as LeuElement } from './LeuElement-DfsEye-A.js';
|
|
5
7
|
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
6
8
|
import { LeuIcon } from './Icon.js';
|
|
7
|
-
import './_tslib-CNEFicEt.js';
|
|
8
|
-
import 'lit/decorators.js';
|
|
9
9
|
|
|
10
10
|
var css_248z = css`/* figma https://www.figma.com/design/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?node-id=21161-186812&t=8VgDy9avMRG5aL7s-0 */
|
|
11
11
|
:host {
|
|
@@ -170,19 +170,12 @@ var css_248z = css`/* figma https://www.figma.com/design/d6Pv21UVUbnBs3AdcZijHmb
|
|
|
170
170
|
*/
|
|
171
171
|
class LeuDialog extends LeuElement {
|
|
172
172
|
constructor() {
|
|
173
|
-
super();
|
|
174
|
-
/**
|
|
175
|
-
* @internal
|
|
176
|
-
*/
|
|
177
|
-
this.hasSlotController = new HasSlotController(this, ["toolbar"]);
|
|
178
|
-
/** @type {import("lit/directives/ref").Ref<HTMLDialogElement>} */
|
|
179
|
-
this._dialogRef = createRef();
|
|
180
|
-
/** @type {string} */
|
|
173
|
+
super(...arguments);
|
|
181
174
|
this.label = "";
|
|
182
|
-
/** @type {string} */
|
|
183
175
|
this.sublabel = "";
|
|
184
|
-
/** @type {boolean} */
|
|
185
176
|
this.open = false;
|
|
177
|
+
this._dialogRef = createRef();
|
|
178
|
+
this.hasSlotController = new HasSlotController(this, ["toolbar"]);
|
|
186
179
|
}
|
|
187
180
|
show() {
|
|
188
181
|
this._dialogRef.value.showModal();
|
|
@@ -235,10 +228,14 @@ LeuDialog.shadowRootOptions = {
|
|
|
235
228
|
...LeuElement.shadowRootOptions,
|
|
236
229
|
delegatesFocus: true,
|
|
237
230
|
};
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
231
|
+
__decorate([
|
|
232
|
+
property({ type: String })
|
|
233
|
+
], LeuDialog.prototype, "label", void 0);
|
|
234
|
+
__decorate([
|
|
235
|
+
property({ type: String })
|
|
236
|
+
], LeuDialog.prototype, "sublabel", void 0);
|
|
237
|
+
__decorate([
|
|
238
|
+
property({ type: Boolean, reflect: true })
|
|
239
|
+
], LeuDialog.prototype, "open", void 0);
|
|
243
240
|
|
|
244
241
|
export { LeuDialog };
|
package/dist/Dropdown.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
|
|
2
3
|
import * as lit from 'lit';
|
|
3
4
|
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
4
5
|
import { H as HasSlotController } from './hasSlotController.d-emXwVXWF.js';
|
|
@@ -6,7 +7,7 @@ import { LeuButton } from './Button.js';
|
|
|
6
7
|
import { LeuMenu } from './Menu.js';
|
|
7
8
|
import { LeuMenuItem } from './MenuItem.js';
|
|
8
9
|
import { LeuPopup } from './Popup.js';
|
|
9
|
-
import './Icon.js';
|
|
10
|
+
import './Icon.d-itcQ94ym.js';
|
|
10
11
|
import '@floating-ui/dom';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -20,35 +21,26 @@ declare class LeuDropdown extends LeuElement {
|
|
|
20
21
|
"leu-popup": typeof LeuPopup;
|
|
21
22
|
};
|
|
22
23
|
static styles: lit.CSSResultGroup[];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
expanded: {
|
|
29
|
-
type: BooleanConstructor;
|
|
30
|
-
reflect: boolean;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
hasSlotController: HasSlotController;
|
|
34
|
-
constructor();
|
|
24
|
+
label: string;
|
|
25
|
+
expanded: boolean;
|
|
26
|
+
inverted: boolean;
|
|
27
|
+
protected hasSlotController: HasSlotController;
|
|
28
|
+
protected _toggleRef: lit_html_directives_ref_js.Ref<HTMLButtonElement>;
|
|
35
29
|
connectedCallback(): void;
|
|
36
30
|
disconnectedCallback(): void;
|
|
37
|
-
_documentClickHandler: (event:
|
|
38
|
-
_keyUpHandler(event:
|
|
39
|
-
_keyDownToggleHandler(event:
|
|
40
|
-
_menuItemClickHandler: (e:
|
|
31
|
+
protected _documentClickHandler: (event: MouseEvent) => void;
|
|
32
|
+
protected _keyUpHandler: (event: KeyboardEvent) => void;
|
|
33
|
+
protected _keyDownToggleHandler(event: KeyboardEvent): Promise<void>;
|
|
34
|
+
protected _menuItemClickHandler: (e: MouseEvent & {
|
|
35
|
+
target: HTMLElement;
|
|
36
|
+
}) => void;
|
|
41
37
|
/**
|
|
42
38
|
* Close the dropdown when the user presses the Escape or the Tab key.
|
|
43
39
|
* Navigating the menu with the arrow keys is handled by the menu itself.
|
|
44
|
-
* @param {KeyboardEvent} e
|
|
45
|
-
*/
|
|
46
|
-
_keyDownMenuHandler: (e: any) => void;
|
|
47
|
-
_handleToggleClick(): void;
|
|
48
|
-
/**
|
|
49
|
-
* @returns {import("../menu/Menu").LeuMenu}
|
|
50
40
|
*/
|
|
51
|
-
|
|
41
|
+
protected _keyDownMenuHandler: (e: KeyboardEvent) => void;
|
|
42
|
+
protected _handleToggleClick(): void;
|
|
43
|
+
protected _getMenu(): LeuMenu;
|
|
52
44
|
render(): lit_html.TemplateResult<1>;
|
|
53
45
|
}
|
|
54
46
|
|
package/dist/Dropdown.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
1
2
|
import { css, nothing, html } from 'lit';
|
|
2
3
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
3
|
-
import {
|
|
4
|
+
import { property } from 'lit/decorators.js';
|
|
5
|
+
import { L as LeuElement } from './LeuElement-DfsEye-A.js';
|
|
4
6
|
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
5
7
|
import { LeuButton } from './Button.js';
|
|
6
8
|
import { LeuMenu } from './Menu.js';
|
|
7
9
|
import { LeuMenuItem } from './MenuItem.js';
|
|
8
10
|
import { LeuPopup } from './Popup.js';
|
|
9
|
-
import './_tslib-CNEFicEt.js';
|
|
10
11
|
import 'lit/directives/class-map.js';
|
|
11
12
|
import 'lit/directives/if-defined.js';
|
|
12
|
-
import 'lit/decorators.js';
|
|
13
13
|
import './Icon.js';
|
|
14
14
|
import '@floating-ui/dom';
|
|
15
15
|
|
|
@@ -36,13 +36,22 @@ var css_248z = css`:host {
|
|
|
36
36
|
*/
|
|
37
37
|
class LeuDropdown extends LeuElement {
|
|
38
38
|
constructor() {
|
|
39
|
-
super();
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.label = "";
|
|
41
|
+
this.expanded = false;
|
|
42
|
+
this.inverted = false;
|
|
40
43
|
this.hasSlotController = new HasSlotController(this, ["icon"]);
|
|
44
|
+
this._toggleRef = createRef();
|
|
41
45
|
this._documentClickHandler = (event) => {
|
|
42
46
|
if (!event.composedPath().includes(this)) {
|
|
43
47
|
this.expanded = false;
|
|
44
48
|
}
|
|
45
49
|
};
|
|
50
|
+
this._keyUpHandler = (event) => {
|
|
51
|
+
if (event.key === "Escape") {
|
|
52
|
+
this.expanded = false;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
46
55
|
this._menuItemClickHandler = (e) => {
|
|
47
56
|
if (e.target.tagName.toLowerCase() === "leu-menu-item") {
|
|
48
57
|
this.expanded = false;
|
|
@@ -52,7 +61,6 @@ class LeuDropdown extends LeuElement {
|
|
|
52
61
|
/**
|
|
53
62
|
* Close the dropdown when the user presses the Escape or the Tab key.
|
|
54
63
|
* Navigating the menu with the arrow keys is handled by the menu itself.
|
|
55
|
-
* @param {KeyboardEvent} e
|
|
56
64
|
*/
|
|
57
65
|
this._keyDownMenuHandler = (e) => {
|
|
58
66
|
if (e.key === "Escape" || e.key === "Tab") {
|
|
@@ -61,10 +69,6 @@ class LeuDropdown extends LeuElement {
|
|
|
61
69
|
this._toggleRef.value.focus();
|
|
62
70
|
}
|
|
63
71
|
};
|
|
64
|
-
this.label = "";
|
|
65
|
-
this.expanded = false;
|
|
66
|
-
/** @type {import("lit/directives/ref").Ref<HTMLButtonElement>} */
|
|
67
|
-
this._toggleRef = createRef();
|
|
68
72
|
}
|
|
69
73
|
connectedCallback() {
|
|
70
74
|
super.connectedCallback();
|
|
@@ -82,11 +86,6 @@ class LeuDropdown extends LeuElement {
|
|
|
82
86
|
menu.removeEventListener("keydown", this._keyDownMenuHandler);
|
|
83
87
|
menu.removeEventListener("click", this._menuItemClickHandler);
|
|
84
88
|
}
|
|
85
|
-
_keyUpHandler(event) {
|
|
86
|
-
if (event.key === "Escape") {
|
|
87
|
-
this.expanded = false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
89
|
async _keyDownToggleHandler(event) {
|
|
91
90
|
if (["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key)) {
|
|
92
91
|
event.preventDefault();
|
|
@@ -104,9 +103,6 @@ class LeuDropdown extends LeuElement {
|
|
|
104
103
|
_handleToggleClick() {
|
|
105
104
|
this.expanded = !this.expanded;
|
|
106
105
|
}
|
|
107
|
-
/**
|
|
108
|
-
* @returns {import("../menu/Menu").LeuMenu}
|
|
109
|
-
*/
|
|
110
106
|
_getMenu() {
|
|
111
107
|
return this.querySelector("leu-menu");
|
|
112
108
|
}
|
|
@@ -128,6 +124,7 @@ class LeuDropdown extends LeuElement {
|
|
|
128
124
|
variant="ghost"
|
|
129
125
|
expanded=${this.expanded ? "true" : "false"}
|
|
130
126
|
?active=${this.expanded}
|
|
127
|
+
?inverted=${this.inverted}
|
|
131
128
|
@click=${this._handleToggleClick}
|
|
132
129
|
@keydown=${this._keyDownToggleHandler}
|
|
133
130
|
>
|
|
@@ -148,9 +145,14 @@ LeuDropdown.dependencies = {
|
|
|
148
145
|
"leu-popup": LeuPopup,
|
|
149
146
|
};
|
|
150
147
|
LeuDropdown.styles = [LeuElement.styles, css_248z];
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
__decorate([
|
|
149
|
+
property({ type: String, reflect: true })
|
|
150
|
+
], LeuDropdown.prototype, "label", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
property({ type: Boolean, reflect: true })
|
|
153
|
+
], LeuDropdown.prototype, "expanded", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
property({ type: Boolean, reflect: true })
|
|
156
|
+
], LeuDropdown.prototype, "inverted", void 0);
|
|
155
157
|
|
|
156
158
|
export { LeuDropdown };
|
package/dist/FileInput.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as lit from 'lit';
|
|
|
3
3
|
import { PropertyValues } from 'lit';
|
|
4
4
|
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
5
5
|
import { LeuButton } from './Button.js';
|
|
6
|
-
import { LeuIcon } from './Icon.js';
|
|
6
|
+
import { L as LeuIcon } from './Icon.d-itcQ94ym.js';
|
|
7
7
|
import { LeuVisuallyHidden } from './VisuallyHidden.js';
|
|
8
8
|
import './leu-icon.js';
|
|
9
9
|
|
|
@@ -54,6 +54,7 @@ declare class LeuFileInput extends LeuElement {
|
|
|
54
54
|
formResetCallback(): void;
|
|
55
55
|
protected updateFormValue(): void;
|
|
56
56
|
protected removeFile(fileToRemove: File): void;
|
|
57
|
+
protected dispatchChangeAndInputEvents(): void;
|
|
57
58
|
protected static formatFileSize(size: number): lit_html.TemplateResult<1>;
|
|
58
59
|
protected handleDragEnter: (event: DragEvent) => void;
|
|
59
60
|
protected handleDragOver: (event: DragEvent) => void;
|
package/dist/FileInput.js
CHANGED
|
@@ -3,7 +3,7 @@ import { css, html, nothing } from 'lit';
|
|
|
3
3
|
import { property, state, query } from 'lit/decorators.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
5
|
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
-
import { L as LeuElement } from './LeuElement-
|
|
6
|
+
import { L as LeuElement } from './LeuElement-DfsEye-A.js';
|
|
7
7
|
import './Accordion.js';
|
|
8
8
|
import { LeuButton } from './Button.js';
|
|
9
9
|
import './ButtonGroup.js';
|
|
@@ -14,22 +14,29 @@ import './ChipGroup.js';
|
|
|
14
14
|
import './ChipLink.js';
|
|
15
15
|
import './ChipRemovable.js';
|
|
16
16
|
import './ChipSelectable.js';
|
|
17
|
+
import './Dialog.js';
|
|
17
18
|
import './Dropdown.js';
|
|
19
|
+
import { LeuIcon } from './Icon.js';
|
|
18
20
|
import './Input.js';
|
|
19
21
|
import './Menu.js';
|
|
20
22
|
import './MenuItem.js';
|
|
23
|
+
import './Message.js';
|
|
21
24
|
import './Pagination.js';
|
|
25
|
+
import './Placeholder.js';
|
|
22
26
|
import './Popup.js';
|
|
27
|
+
import './ProgressBar.js';
|
|
23
28
|
import './Radio.js';
|
|
24
29
|
import './RadioGroup.js';
|
|
30
|
+
import './Range.js';
|
|
31
|
+
import './ScrollTop.js';
|
|
25
32
|
import './Select.js';
|
|
33
|
+
import './Spinner.js';
|
|
26
34
|
import './Table.js';
|
|
27
|
-
import './
|
|
35
|
+
import './Tag.js';
|
|
28
36
|
import { LeuVisuallyHidden } from './VisuallyHidden.js';
|
|
29
|
-
import
|
|
37
|
+
import './leu-icon.js';
|
|
30
38
|
import 'lit/static-html.js';
|
|
31
39
|
import './hasSlotController-Bm2tipvG.js';
|
|
32
|
-
import './Spinner.js';
|
|
33
40
|
import './Chip.js';
|
|
34
41
|
import 'lit/directives/ref.js';
|
|
35
42
|
import '@floating-ui/dom';
|
|
@@ -202,6 +209,7 @@ class LeuFileInput extends LeuElement {
|
|
|
202
209
|
this.isDragging = false;
|
|
203
210
|
};
|
|
204
211
|
this.handleDrop = (event) => {
|
|
212
|
+
this.isDragging = false;
|
|
205
213
|
if (this.disabled)
|
|
206
214
|
return;
|
|
207
215
|
event.preventDefault();
|
|
@@ -209,10 +217,13 @@ class LeuFileInput extends LeuElement {
|
|
|
209
217
|
const dt = event.dataTransfer;
|
|
210
218
|
const files = dt.files;
|
|
211
219
|
const acceptedFiles = [...files].filter((file) => this.isAcceptedFile(file));
|
|
220
|
+
if (acceptedFiles.length < 1) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
212
223
|
this.files = this.multiple
|
|
213
224
|
? this.files.concat(acceptedFiles)
|
|
214
225
|
: acceptedFiles.slice(0, 1);
|
|
215
|
-
this.
|
|
226
|
+
this.dispatchChangeAndInputEvents();
|
|
216
227
|
};
|
|
217
228
|
// Initialize the ElementInternals for form association
|
|
218
229
|
this.internals = this.attachInternals();
|
|
@@ -257,6 +268,9 @@ class LeuFileInput extends LeuElement {
|
|
|
257
268
|
}
|
|
258
269
|
removeFile(fileToRemove) {
|
|
259
270
|
this.files = this.files.filter((file) => file !== fileToRemove);
|
|
271
|
+
this.dispatchChangeAndInputEvents();
|
|
272
|
+
}
|
|
273
|
+
dispatchChangeAndInputEvents() {
|
|
260
274
|
this.dispatchEvent(new CustomEvent("input", {
|
|
261
275
|
composed: true,
|
|
262
276
|
bubbles: true,
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
4
|
+
|
|
5
|
+
type IconPathName = keyof typeof paths;
|
|
6
|
+
declare const paths: {
|
|
7
|
+
addNew: string;
|
|
8
|
+
alert: string;
|
|
9
|
+
angleDropDown: string;
|
|
10
|
+
angleDropUp: string;
|
|
11
|
+
angleLeft: string;
|
|
12
|
+
angleRight: string;
|
|
13
|
+
arrowDown: string;
|
|
14
|
+
arrowLeft: string;
|
|
15
|
+
arrowRight: string;
|
|
16
|
+
arrowUp: string;
|
|
17
|
+
backward: string;
|
|
18
|
+
block: string;
|
|
19
|
+
calendar: string;
|
|
20
|
+
camera: string;
|
|
21
|
+
caution: string;
|
|
22
|
+
cc: string;
|
|
23
|
+
chart: string;
|
|
24
|
+
chatMessage: string;
|
|
25
|
+
check: string;
|
|
26
|
+
clear: string;
|
|
27
|
+
close: string;
|
|
28
|
+
comment: string;
|
|
29
|
+
conference: string;
|
|
30
|
+
confirm: string;
|
|
31
|
+
confirmPlain: string;
|
|
32
|
+
conversation: string;
|
|
33
|
+
copy: string;
|
|
34
|
+
delete: string;
|
|
35
|
+
download: string;
|
|
36
|
+
earth: string;
|
|
37
|
+
edit: string;
|
|
38
|
+
email: string;
|
|
39
|
+
file: string;
|
|
40
|
+
fileCsv: string;
|
|
41
|
+
fileOutline: string;
|
|
42
|
+
filePdf: string;
|
|
43
|
+
fileXml: string;
|
|
44
|
+
files: string;
|
|
45
|
+
filter: string;
|
|
46
|
+
floppy: string;
|
|
47
|
+
folder: string;
|
|
48
|
+
forward: string;
|
|
49
|
+
getInformation: string;
|
|
50
|
+
hide: string;
|
|
51
|
+
home: string;
|
|
52
|
+
image: string;
|
|
53
|
+
income: string;
|
|
54
|
+
launch: string;
|
|
55
|
+
levelUp: string;
|
|
56
|
+
like: string;
|
|
57
|
+
link: string;
|
|
58
|
+
list: string;
|
|
59
|
+
location: string;
|
|
60
|
+
lock: string;
|
|
61
|
+
login: string;
|
|
62
|
+
logout: string;
|
|
63
|
+
love: string;
|
|
64
|
+
emailOpen: string;
|
|
65
|
+
map: string;
|
|
66
|
+
mapLocateMe: string;
|
|
67
|
+
mapNavigation: string;
|
|
68
|
+
mapPin: string;
|
|
69
|
+
menu: string;
|
|
70
|
+
menuOverflow: string;
|
|
71
|
+
minus: string;
|
|
72
|
+
money: string;
|
|
73
|
+
moneyIncome: string;
|
|
74
|
+
organisation: string;
|
|
75
|
+
overflow: string;
|
|
76
|
+
paperplane: string;
|
|
77
|
+
paragraph: string;
|
|
78
|
+
passport: string;
|
|
79
|
+
phoneCall: string;
|
|
80
|
+
piechart: string;
|
|
81
|
+
pill: string;
|
|
82
|
+
pin: string;
|
|
83
|
+
plus: string;
|
|
84
|
+
print: string;
|
|
85
|
+
refresh: string;
|
|
86
|
+
remove: string;
|
|
87
|
+
repost: string;
|
|
88
|
+
resizeText: string;
|
|
89
|
+
ruler: string;
|
|
90
|
+
search: string;
|
|
91
|
+
securities: string;
|
|
92
|
+
setting: string;
|
|
93
|
+
share: string;
|
|
94
|
+
show: string;
|
|
95
|
+
smileyDevastated: string;
|
|
96
|
+
smileyIndifferent: string;
|
|
97
|
+
smileySad: string;
|
|
98
|
+
smileySmile: string;
|
|
99
|
+
smileyThrilled: string;
|
|
100
|
+
swissId: string;
|
|
101
|
+
time: string;
|
|
102
|
+
upload: string;
|
|
103
|
+
user: string;
|
|
104
|
+
userMultiple: string;
|
|
105
|
+
vote: string;
|
|
106
|
+
zoom: string;
|
|
107
|
+
zoomOut: string;
|
|
108
|
+
fastForward: string;
|
|
109
|
+
fastRewind: string;
|
|
110
|
+
fullScreen: string;
|
|
111
|
+
next: string;
|
|
112
|
+
pause: string;
|
|
113
|
+
play: string;
|
|
114
|
+
playButton: string;
|
|
115
|
+
previous: string;
|
|
116
|
+
skipNext: string;
|
|
117
|
+
skipPrevious: string;
|
|
118
|
+
stop: string;
|
|
119
|
+
facebook: string;
|
|
120
|
+
google: string;
|
|
121
|
+
instagram: string;
|
|
122
|
+
kununu: string;
|
|
123
|
+
linkedin: string;
|
|
124
|
+
snapchat: string;
|
|
125
|
+
tiktok: string;
|
|
126
|
+
twitter: string;
|
|
127
|
+
xing: string;
|
|
128
|
+
youtube: string;
|
|
129
|
+
youtubeLogo: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* A component to render all defined zhWeb icons.
|
|
134
|
+
* The `fill` of the icon is set to `currentColor` and
|
|
135
|
+
* can be overriden by setting the css `color` property.
|
|
136
|
+
* If the icon name is not found, a placeholder will be displayed.
|
|
137
|
+
*
|
|
138
|
+
* @tagname leu-icon
|
|
139
|
+
* @cssprop --leu-icon-size - The size of the icon.
|
|
140
|
+
*/
|
|
141
|
+
declare class LeuIcon extends LeuElement {
|
|
142
|
+
static styles: lit.CSSResultGroup[];
|
|
143
|
+
/**
|
|
144
|
+
* The name of the icon to display.
|
|
145
|
+
*/
|
|
146
|
+
name: IconPathName | "";
|
|
147
|
+
render(): lit_html.TemplateResult<1>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export { LeuIcon as L };
|
|
151
|
+
export type { IconPathName as I };
|