@statistikzh/leu 0.5.1 → 0.7.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/.husky/commit-msg +0 -3
- package/.husky/pre-commit +0 -3
- package/CHANGELOG.md +54 -0
- package/dist/Accordion.d.ts +10 -9
- package/dist/Accordion.d.ts.map +1 -1
- package/dist/Accordion.js +12 -11
- package/dist/Breadcrumb.d.ts +4 -4
- package/dist/Breadcrumb.d.ts.map +1 -1
- package/dist/Breadcrumb.js +28 -24
- package/dist/{Button-5326c982.d.ts → Button-7370f901.d.ts} +10 -11
- package/dist/Button-7370f901.d.ts.map +1 -0
- package/dist/{Button-5326c982.js → Button-7370f901.js} +57 -67
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +3 -3
- package/dist/ButtonGroup.d.ts +2 -2
- package/dist/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup.js +3 -3
- package/dist/Checkbox.d.ts +4 -3
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +14 -17
- package/dist/CheckboxGroup.d.ts +2 -2
- package/dist/CheckboxGroup.d.ts.map +1 -1
- package/dist/CheckboxGroup.js +4 -4
- package/dist/Chip.d.ts +2 -2
- package/dist/Chip.d.ts.map +1 -1
- package/dist/Chip.js +23 -28
- package/dist/ChipGroup.d.ts +16 -8
- package/dist/ChipGroup.d.ts.map +1 -1
- package/dist/ChipGroup.js +39 -9
- package/dist/ChipLink.d.ts +2 -1
- package/dist/ChipLink.d.ts.map +1 -1
- package/dist/ChipLink.js +4 -7
- package/dist/ChipRemovable.d.ts +0 -2
- package/dist/ChipRemovable.d.ts.map +1 -1
- package/dist/ChipRemovable.js +8 -11
- package/dist/ChipSelectable.d.ts +12 -2
- package/dist/ChipSelectable.d.ts.map +1 -1
- package/dist/ChipSelectable.js +24 -26
- package/dist/Dropdown.d.ts +9 -5
- package/dist/Dropdown.d.ts.map +1 -1
- package/dist/Dropdown.js +68 -32
- package/dist/Icon.d.ts +116 -0
- package/dist/Icon.d.ts.map +1 -0
- package/dist/{icon-03e86700.js → Icon.js} +61 -32
- package/dist/Input.d.ts +13 -17
- package/dist/Input.d.ts.map +1 -1
- package/dist/Input.js +33 -24
- package/dist/LeuElement-ba5ea33d.d.ts +7 -0
- package/dist/LeuElement-ba5ea33d.d.ts.map +1 -0
- package/dist/{_rollupPluginBabelHelpers-20f659f4.js → LeuElement-ba5ea33d.js} +20 -1
- package/dist/Menu.d.ts +24 -2
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +120 -3
- package/dist/MenuItem.d.ts +28 -11
- package/dist/MenuItem.d.ts.map +1 -1
- package/dist/MenuItem.js +110 -63
- package/dist/Pagination.d.ts +10 -3
- package/dist/Pagination.d.ts.map +1 -1
- package/dist/Pagination.js +24 -21
- package/dist/Popup.d.ts +21 -3
- package/dist/Popup.d.ts.map +1 -1
- package/dist/Popup.js +44 -17
- package/dist/Radio.d.ts +4 -2
- package/dist/Radio.d.ts.map +1 -1
- package/dist/Radio.js +9 -14
- package/dist/RadioGroup.d.ts +2 -2
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +20 -11
- package/dist/ScrollTop.d.ts +2 -2
- package/dist/ScrollTop.d.ts.map +1 -1
- package/dist/ScrollTop.js +10 -8
- package/dist/Select.d.ts +75 -37
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +279 -181
- package/dist/Table.d.ts +2 -6
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +16 -16
- package/dist/VisuallyHidden.d.ts +2 -2
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -14
- package/dist/leu-accordion.d.ts.map +1 -1
- package/dist/leu-accordion.js +2 -3
- package/dist/leu-breadcrumb.d.ts.map +1 -1
- package/dist/leu-breadcrumb.js +4 -10
- package/dist/leu-button-group.d.ts.map +1 -1
- package/dist/leu-button-group.js +2 -3
- package/dist/leu-button.d.ts +1 -1
- package/dist/leu-button.d.ts.map +1 -1
- package/dist/leu-button.js +4 -5
- package/dist/leu-checkbox-group.d.ts.map +1 -1
- package/dist/leu-checkbox-group.js +2 -3
- package/dist/leu-checkbox.d.ts.map +1 -1
- package/dist/leu-checkbox.js +3 -4
- package/dist/leu-chip-group.d.ts.map +1 -1
- package/dist/leu-chip-group.js +2 -3
- package/dist/leu-chip-link.d.ts.map +1 -1
- package/dist/leu-chip-link.js +2 -3
- package/dist/leu-chip-removable.d.ts.map +1 -1
- package/dist/leu-chip-removable.js +3 -4
- package/dist/leu-chip-selectable.d.ts.map +1 -1
- package/dist/leu-chip-selectable.js +2 -3
- package/dist/leu-dropdown.d.ts.map +1 -1
- package/dist/leu-dropdown.js +5 -10
- package/dist/leu-icon.d.ts +3 -0
- package/dist/leu-icon.d.ts.map +1 -0
- package/dist/leu-icon.js +7 -0
- package/dist/leu-input.d.ts.map +1 -1
- package/dist/leu-input.js +3 -4
- package/dist/leu-menu-item.d.ts.map +1 -1
- package/dist/leu-menu-item.js +3 -5
- package/dist/leu-menu.d.ts.map +1 -1
- package/dist/leu-menu.js +5 -3
- package/dist/leu-pagination.d.ts.map +1 -1
- package/dist/leu-pagination.js +4 -7
- package/dist/leu-popup.d.ts.map +1 -1
- package/dist/leu-popup.js +2 -3
- package/dist/leu-radio-group.d.ts.map +1 -1
- package/dist/leu-radio-group.js +2 -3
- package/dist/leu-radio.d.ts.map +1 -1
- package/dist/leu-radio.js +2 -3
- package/dist/leu-scroll-top.d.ts.map +1 -1
- package/dist/leu-scroll-top.js +4 -6
- package/dist/leu-select.d.ts.map +1 -1
- package/dist/leu-select.js +5 -13
- package/dist/leu-table.d.ts.map +1 -1
- package/dist/leu-table.js +4 -8
- package/dist/leu-visually-hidden.d.ts.map +1 -1
- package/dist/leu-visually-hidden.js +2 -3
- package/dist/theme.css +2 -0
- package/dist/vscode.html-custom-data.json +124 -74
- package/dist/vue/index.d.ts +83 -67
- package/dist/web-types.json +256 -142
- package/package.json +9 -12
- package/scripts/generate-component/templates/[Name].js +6 -3
- package/scripts/generate-component/templates/test/[name].test.js +1 -1
- package/src/components/accordion/Accordion.js +13 -10
- package/src/components/accordion/leu-accordion.js +1 -2
- package/src/components/breadcrumb/Breadcrumb.js +31 -18
- package/src/components/breadcrumb/leu-breadcrumb.js +1 -2
- package/src/components/button/Button.js +45 -71
- package/src/components/button/button.css +11 -9
- package/src/components/button/leu-button.js +1 -2
- package/src/components/button/stories/button.stories.js +60 -19
- package/src/components/button/test/button.test.js +26 -63
- package/src/components/button-group/ButtonGroup.js +4 -2
- package/src/components/button-group/leu-button-group.js +1 -2
- package/src/components/checkbox/Checkbox.js +17 -11
- package/src/components/checkbox/CheckboxGroup.js +6 -3
- package/src/components/checkbox/leu-checkbox-group.js +1 -2
- package/src/components/checkbox/leu-checkbox.js +1 -2
- package/src/components/checkbox/stories/checkbox-group.stories.js +10 -26
- package/src/components/checkbox/stories/checkbox.stories.js +2 -7
- package/src/components/checkbox/test/checkbox-group.test.js +6 -21
- package/src/components/checkbox/test/checkbox.test.js +1 -12
- package/src/components/chip/Chip.js +5 -4
- package/src/components/chip/ChipGroup.js +38 -8
- package/src/components/chip/ChipLink.js +3 -7
- package/src/components/chip/ChipRemovable.js +8 -11
- package/src/components/chip/ChipSelectable.js +23 -27
- package/src/components/chip/chip.css +19 -20
- package/src/components/chip/leu-chip-group.js +1 -2
- package/src/components/chip/leu-chip-link.js +1 -2
- package/src/components/chip/leu-chip-removable.js +1 -2
- package/src/components/chip/leu-chip-selectable.js +1 -2
- package/src/components/chip/stories/chip-group.stories.js +6 -9
- package/src/components/chip/stories/chip-link.stories.js +3 -5
- package/src/components/chip/stories/chip-removable.stories.js +3 -4
- package/src/components/chip/stories/chip-selectable.stories.js +3 -3
- package/src/components/chip/test/chip-group.test.js +82 -30
- package/src/components/chip/test/chip-link.test.js +2 -6
- package/src/components/chip/test/chip-removable.test.js +4 -10
- package/src/components/chip/test/chip-selectable.test.js +10 -12
- package/src/components/dropdown/Dropdown.js +79 -26
- package/src/components/dropdown/leu-dropdown.js +1 -2
- package/src/components/dropdown/stories/dropdown.stories.js +30 -7
- package/src/components/dropdown/test/dropdown.test.js +5 -5
- package/src/components/icon/Icon.js +55 -0
- package/src/components/icon/icon.css +6 -0
- package/src/components/icon/leu-icon.js +5 -0
- package/src/components/icon/{icon.js → paths.js} +4 -37
- package/src/components/icon/stories/icon.stories.js +47 -0
- package/src/components/icon/test/icon.test.js +23 -40
- package/src/components/input/Input.js +31 -20
- package/src/components/input/input.css +4 -2
- package/src/components/input/leu-input.js +1 -2
- package/src/components/input/stories/input.stories.js +5 -5
- package/src/components/input/test/input.test.js +22 -0
- package/src/components/menu/Menu.js +143 -2
- package/src/components/menu/MenuItem.js +104 -52
- package/src/components/menu/leu-menu-item.js +1 -2
- package/src/components/menu/leu-menu.js +1 -2
- package/src/components/menu/menu-item.css +11 -4
- package/src/components/menu/stories/menu-item.stories.js +15 -4
- package/src/components/menu/stories/menu.stories.js +34 -7
- package/src/components/menu/test/menu-item.test.js +88 -82
- package/src/components/menu/test/menu.test.js +101 -8
- package/src/components/pagination/Pagination.js +27 -18
- package/src/components/pagination/leu-pagination.js +1 -2
- package/src/components/popup/Popup.js +39 -16
- package/src/components/popup/leu-popup.js +1 -2
- package/src/components/popup/popup.css +1 -0
- package/src/components/radio/Radio.js +12 -7
- package/src/components/radio/RadioGroup.js +18 -12
- package/src/components/radio/leu-radio-group.js +1 -2
- package/src/components/radio/leu-radio.js +1 -2
- package/src/components/radio/stories/radio-group.stories.js +5 -19
- package/src/components/radio/stories/radio.stories.js +2 -7
- package/src/components/radio/test/radio-group.test.js +6 -9
- package/src/components/radio/test/radio.test.js +3 -13
- package/src/components/scroll-top/ScrollTop.js +15 -5
- package/src/components/scroll-top/leu-scroll-top.js +1 -2
- package/src/components/select/Select.js +279 -175
- package/src/components/select/leu-select.js +1 -2
- package/src/components/select/select.css +20 -12
- package/src/components/select/stories/select.stories.js +16 -2
- package/src/components/select/test/select.test.js +191 -37
- package/src/components/table/Table.js +15 -9
- package/src/components/table/leu-table.js +1 -2
- package/src/components/table/table.css +3 -1
- package/src/components/visually-hidden/VisuallyHidden.js +6 -2
- package/src/components/visually-hidden/leu-visually-hidden.js +1 -2
- package/src/lib/LeuElement.js +23 -0
- package/src/lib/a11y.js +26 -0
- package/src/styles/custom-properties.css +2 -0
- package/web-test-runner.config.mjs +2 -0
- package/dist/Button-5326c982.d.ts.map +0 -1
- package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts +0 -3
- package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts.map +0 -1
- package/dist/defineElement-40372b4b.d.ts +0 -9
- package/dist/defineElement-40372b4b.d.ts.map +0 -1
- package/dist/defineElement-40372b4b.js +0 -15
- package/dist/icon-03e86700.d.ts +0 -11
- package/dist/icon-03e86700.d.ts.map +0 -1
- package/src/lib/defineElement.js +0 -13
package/dist/ChipSelectable.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty } from './
|
|
1
|
+
import { _ as _defineProperty } from './LeuElement-ba5ea33d.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { LeuChipBase } from './Chip.js';
|
|
4
4
|
|
|
@@ -13,31 +13,42 @@ const VARIANTS = {
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* A chip component that can be selected.
|
|
16
|
-
* @slot - The content of the chip
|
|
17
16
|
* @tagname leu-chip-selectable
|
|
17
|
+
* @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.
|
|
18
22
|
*/
|
|
19
23
|
class LeuChipSelectable extends LeuChipBase {
|
|
20
24
|
constructor() {
|
|
21
25
|
super();
|
|
22
26
|
this.size = SIZES.regular;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The variant of the chip. Has an effect not only on the visual appearance but also on the behavior.
|
|
30
|
+
* - `toggle`: The chip behaves like a toggle button.
|
|
31
|
+
* - `radio`: The chip behaves like a radio button.
|
|
32
|
+
* @default "toggle"
|
|
33
|
+
*/
|
|
23
34
|
this.variant = VARIANTS.toggle;
|
|
24
|
-
this.
|
|
35
|
+
this.checked = false;
|
|
25
36
|
if (this.variant === VARIANTS.radio && this.size === SIZES.small) {
|
|
26
37
|
console.warn("Small size has no effect on radio variant");
|
|
27
38
|
}
|
|
28
39
|
}
|
|
29
40
|
handleClick() {
|
|
30
|
-
let
|
|
41
|
+
let nextcheckedState = this.checked;
|
|
31
42
|
if (this.variant === VARIANTS.radio) {
|
|
32
|
-
|
|
43
|
+
nextcheckedState = true;
|
|
33
44
|
} else {
|
|
34
|
-
|
|
45
|
+
nextcheckedState = !this.checked;
|
|
35
46
|
}
|
|
36
|
-
if (
|
|
37
|
-
this.
|
|
47
|
+
if (nextcheckedState !== this.checked) {
|
|
48
|
+
this.checked = nextcheckedState;
|
|
38
49
|
this.dispatchEvent(new CustomEvent("input", {
|
|
39
50
|
detail: {
|
|
40
|
-
|
|
51
|
+
checked: this.checked
|
|
41
52
|
},
|
|
42
53
|
bubbles: true,
|
|
43
54
|
composed: true
|
|
@@ -46,38 +57,25 @@ class LeuChipSelectable extends LeuChipBase {
|
|
|
46
57
|
}
|
|
47
58
|
render() {
|
|
48
59
|
return html`<button
|
|
49
|
-
@click=${
|
|
60
|
+
@click=${() => this.handleClick()}
|
|
50
61
|
class="button"
|
|
51
|
-
aria-pressed=${this.
|
|
62
|
+
aria-pressed=${this.checked ? "true" : "false"}
|
|
52
63
|
>
|
|
53
|
-
<span class="label"
|
|
64
|
+
<span class="label"><slot></slot></span>
|
|
54
65
|
</button>`;
|
|
55
66
|
}
|
|
56
67
|
}
|
|
57
68
|
_defineProperty(LeuChipSelectable, "properties", {
|
|
58
69
|
...LeuChipBase.properties,
|
|
59
|
-
/**
|
|
60
|
-
* The size of the chip. Not supported for radio variant.
|
|
61
|
-
* @type {keyof typeof SIZES}
|
|
62
|
-
* @default "regular"
|
|
63
|
-
*/
|
|
64
70
|
size: {
|
|
65
71
|
type: String,
|
|
66
72
|
reflect: true
|
|
67
73
|
},
|
|
68
|
-
/**
|
|
69
|
-
* The variant of the chip. Has an effect not only on the visual appearance but also on the behavior.
|
|
70
|
-
* - `toggle`: The chip behaves like a toggle button.
|
|
71
|
-
* - `radio`: The chip behaves like a radio button.
|
|
72
|
-
*
|
|
73
|
-
* @type {keyof typeof VARIANTS}
|
|
74
|
-
* @default "toggle"
|
|
75
|
-
*/
|
|
76
74
|
variant: {
|
|
77
75
|
type: String,
|
|
78
76
|
reflect: true
|
|
79
77
|
},
|
|
80
|
-
|
|
78
|
+
checked: {
|
|
81
79
|
type: Boolean,
|
|
82
80
|
reflect: true
|
|
83
81
|
},
|
package/dist/Dropdown.d.ts
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @tagname leu-dropdown
|
|
3
3
|
*/
|
|
4
|
-
export class LeuDropdown extends
|
|
4
|
+
export class LeuDropdown extends LeuElement {
|
|
5
5
|
expanded: boolean;
|
|
6
6
|
label: string;
|
|
7
|
-
|
|
7
|
+
/** @type {import("lit/directives/ref").Ref<HTMLButtonElement>} */
|
|
8
|
+
_toggleRef: import("lit/directives/ref").Ref<HTMLButtonElement>;
|
|
8
9
|
_keyUpHandler(event: any): void;
|
|
9
|
-
|
|
10
|
-
_removeMenuItemListeners(): void;
|
|
10
|
+
_keyDownToggleHandler(event: any): Promise<void>;
|
|
11
11
|
_handleToggleClick(): void;
|
|
12
|
+
/**
|
|
13
|
+
* @returns {import("../menu/Menu").LeuMenu}
|
|
14
|
+
*/
|
|
15
|
+
_getMenu(): any;
|
|
12
16
|
render(): import("lit-html").TemplateResult<1>;
|
|
13
17
|
}
|
|
14
|
-
import {
|
|
18
|
+
import { L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
15
19
|
//# sourceMappingURL=Dropdown.d.ts.map
|
package/dist/Dropdown.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["Dropdown.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["Dropdown.js"],"names":[],"mappings":"AAkCA;;GAEG;AACH;IAMQ,kBAAqB;IAqBzB,cAAe;IAGf,kEAAkE;IAClE,YADW,OAAO,oBAAoB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CACjC;IAkB/B,gCAIC;IACD,iDAYC;IACD,2BAEC;IAED;;OAEG;IACH,gBAEC;IACD,+CA6BC;CACF;gCAhJqD,0BAA0B"}
|
package/dist/Dropdown.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { _ as _defineProperty } from './
|
|
2
|
-
import { css,
|
|
3
|
-
import '
|
|
4
|
-
import './
|
|
5
|
-
import './
|
|
6
|
-
import './
|
|
7
|
-
import './
|
|
8
|
-
import './Button-5326c982.js';
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
2
|
+
import { css, html, nothing } from 'lit';
|
|
3
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
4
|
+
import { H as HasSlotController, L as LeuButton } from './Button-7370f901.js';
|
|
5
|
+
import { LeuMenu } from './Menu.js';
|
|
6
|
+
import { LeuMenuItem } from './MenuItem.js';
|
|
7
|
+
import { LeuPopup } from './Popup.js';
|
|
9
8
|
import 'lit/directives/class-map.js';
|
|
10
9
|
import 'lit/directives/if-defined.js';
|
|
11
|
-
import './
|
|
12
|
-
import './Menu.js';
|
|
13
|
-
import './MenuItem.js';
|
|
14
|
-
import 'lit/static-html.js';
|
|
15
|
-
import './Popup.js';
|
|
10
|
+
import './Icon.js';
|
|
16
11
|
import '@floating-ui/dom';
|
|
17
12
|
|
|
18
13
|
var css_248z = css`:host,
|
|
@@ -40,51 +35,85 @@ var css_248z = css`:host,
|
|
|
40
35
|
/**
|
|
41
36
|
* @tagname leu-dropdown
|
|
42
37
|
*/
|
|
43
|
-
class LeuDropdown extends
|
|
38
|
+
class LeuDropdown extends LeuElement {
|
|
44
39
|
constructor() {
|
|
45
40
|
super();
|
|
41
|
+
_defineProperty(this, "hasSlotController", new HasSlotController(this, ["icon"]));
|
|
46
42
|
_defineProperty(this, "_documentClickHandler", event => {
|
|
47
43
|
if (!this.contains(event.target)) {
|
|
48
44
|
this.expanded = false;
|
|
49
45
|
}
|
|
50
46
|
});
|
|
51
|
-
_defineProperty(this, "
|
|
52
|
-
|
|
47
|
+
_defineProperty(this, "_menuItemClickHandler", e => {
|
|
48
|
+
if (e.target.tagName.toLowerCase() === "leu-menu-item") {
|
|
49
|
+
this.expanded = false;
|
|
50
|
+
this._toggleRef.value.focus();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Close the dropdown when the user presses the Escape or the Tab key.
|
|
55
|
+
* Navigating the menu with the arrow keys is handled by the menu itself.
|
|
56
|
+
* @param {KeyboardEvent} e
|
|
57
|
+
*/
|
|
58
|
+
_defineProperty(this, "_keyDownMenuHandler", e => {
|
|
59
|
+
if (e.key === "Escape" || e.key === "Tab") {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
this.expanded = false;
|
|
62
|
+
this._toggleRef.value.focus();
|
|
63
|
+
}
|
|
53
64
|
});
|
|
54
65
|
this.label = "";
|
|
55
66
|
this.expanded = false;
|
|
56
|
-
|
|
67
|
+
|
|
68
|
+
/** @type {import("lit/directives/ref").Ref<HTMLButtonElement>} */
|
|
69
|
+
this._toggleRef = createRef();
|
|
57
70
|
}
|
|
58
71
|
connectedCallback() {
|
|
59
72
|
super.connectedCallback();
|
|
60
73
|
this.addEventListener("keyup", this._keyUpHandler);
|
|
61
74
|
document.addEventListener("click", this._documentClickHandler);
|
|
75
|
+
const menu = this._getMenu();
|
|
76
|
+
menu.addEventListener("keydown", this._keyDownMenuHandler);
|
|
77
|
+
menu.addEventListener("click", this._menuItemClickHandler);
|
|
62
78
|
}
|
|
63
79
|
disconnectedCallback() {
|
|
64
80
|
super.disconnectedCallback();
|
|
65
|
-
this._removeMenuItemListeners();
|
|
66
81
|
this.removeEventListener("keyup", this._keyUpHandler);
|
|
67
82
|
document.removeEventListener("click", this._documentClickHandler);
|
|
83
|
+
const menu = this._getMenu();
|
|
84
|
+
menu.removeEventListener("keydown", this._keyDownMenuHandler);
|
|
85
|
+
menu.removeEventListener("click", this._menuItemClickHandler);
|
|
68
86
|
}
|
|
69
87
|
_keyUpHandler(event) {
|
|
70
88
|
if (event.key === "Escape") {
|
|
71
89
|
this.expanded = false;
|
|
72
90
|
}
|
|
73
91
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
async _keyDownToggleHandler(event) {
|
|
93
|
+
if (["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key)) {
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
const menu = this._getMenu();
|
|
96
|
+
this.expanded = true;
|
|
97
|
+
await this.updateComplete;
|
|
98
|
+
if (event.key === "ArrowDown" || event.key === "Home") {
|
|
99
|
+
menu.focusItem(0);
|
|
100
|
+
} else if (event.key === "ArrowUp" || event.key === "End") {
|
|
101
|
+
menu.focusItem(-1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
83
104
|
}
|
|
84
105
|
_handleToggleClick() {
|
|
85
106
|
this.expanded = !this.expanded;
|
|
86
107
|
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @returns {import("../menu/Menu").LeuMenu}
|
|
111
|
+
*/
|
|
112
|
+
_getMenu() {
|
|
113
|
+
return this.querySelector("leu-menu");
|
|
114
|
+
}
|
|
87
115
|
render() {
|
|
116
|
+
const hasIcon = this.hasSlotController.test("icon");
|
|
88
117
|
return html`
|
|
89
118
|
<leu-popup
|
|
90
119
|
?active=${this.expanded}
|
|
@@ -95,24 +124,31 @@ class LeuDropdown extends LitElement {
|
|
|
95
124
|
autoSizePadding="8"
|
|
96
125
|
>
|
|
97
126
|
<leu-button
|
|
127
|
+
ref=${ref(this._toggleRef)}
|
|
98
128
|
class="button"
|
|
99
129
|
slot="anchor"
|
|
100
|
-
icon="download"
|
|
101
130
|
variant="ghost"
|
|
102
131
|
expanded=${this.expanded ? "true" : "false"}
|
|
103
|
-
aria-expanded=${this.expanded ? "true" : "false"}
|
|
104
|
-
aria-controls="content"
|
|
105
132
|
?active=${this.expanded}
|
|
106
133
|
@click=${this._handleToggleClick}
|
|
107
|
-
|
|
134
|
+
@keydown=${this._keyDownToggleHandler}
|
|
135
|
+
>
|
|
136
|
+
${hasIcon ? html`<slot name="icon" slot="before"></slot>` : nothing}
|
|
137
|
+
${this.label}</leu-button
|
|
108
138
|
>
|
|
109
139
|
<div id="content" class="content" ?hidden=${!this.expanded}>
|
|
110
|
-
<slot
|
|
140
|
+
<slot></slot>
|
|
111
141
|
</div>
|
|
112
142
|
</leu-popup>
|
|
113
143
|
`;
|
|
114
144
|
}
|
|
115
145
|
}
|
|
146
|
+
_defineProperty(LeuDropdown, "dependencies", {
|
|
147
|
+
"leu-button": LeuButton,
|
|
148
|
+
"leu-menu": LeuMenu,
|
|
149
|
+
"leu-menu-item": LeuMenuItem,
|
|
150
|
+
"leu-popup": LeuPopup
|
|
151
|
+
});
|
|
116
152
|
_defineProperty(LeuDropdown, "styles", css_248z);
|
|
117
153
|
_defineProperty(LeuDropdown, "properties", {
|
|
118
154
|
label: {
|
package/dist/Icon.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export type IconPathName = keyof {
|
|
2
|
+
addNew: string;
|
|
3
|
+
angleDropDown: string;
|
|
4
|
+
angleDropup: string;
|
|
5
|
+
angleLeft: string;
|
|
6
|
+
angleRight: string;
|
|
7
|
+
arrowDown: string;
|
|
8
|
+
arrowLeft: string;
|
|
9
|
+
arrowRight: string;
|
|
10
|
+
arrowUp: string;
|
|
11
|
+
calendar: string;
|
|
12
|
+
caution: string;
|
|
13
|
+
chatMessage: string;
|
|
14
|
+
check: string;
|
|
15
|
+
clear: string;
|
|
16
|
+
close: string;
|
|
17
|
+
conference: string;
|
|
18
|
+
confirm: string;
|
|
19
|
+
confirmPlain: string;
|
|
20
|
+
delete: string;
|
|
21
|
+
documents: string;
|
|
22
|
+
download: string;
|
|
23
|
+
edit: string;
|
|
24
|
+
email: string;
|
|
25
|
+
file: string;
|
|
26
|
+
fileOutline: string;
|
|
27
|
+
files: string;
|
|
28
|
+
filter: string;
|
|
29
|
+
floppy: string;
|
|
30
|
+
forward: string;
|
|
31
|
+
getInformation: string;
|
|
32
|
+
hide: string;
|
|
33
|
+
home: string;
|
|
34
|
+
link: string;
|
|
35
|
+
list: string;
|
|
36
|
+
lock: string;
|
|
37
|
+
location: string;
|
|
38
|
+
login: string;
|
|
39
|
+
logout: string;
|
|
40
|
+
map: string;
|
|
41
|
+
mapLocateMe: string;
|
|
42
|
+
mapLocation: string;
|
|
43
|
+
mapNavigation: string;
|
|
44
|
+
mapPin: string;
|
|
45
|
+
menu: string;
|
|
46
|
+
menuOverflow: string;
|
|
47
|
+
minus: string;
|
|
48
|
+
openMail: string;
|
|
49
|
+
overflow: string;
|
|
50
|
+
paperplane: string;
|
|
51
|
+
paragraph: string;
|
|
52
|
+
phoneCall: string;
|
|
53
|
+
pin: string;
|
|
54
|
+
plus: string;
|
|
55
|
+
print: string;
|
|
56
|
+
remove: string;
|
|
57
|
+
resizeText: string;
|
|
58
|
+
search: string;
|
|
59
|
+
show: string;
|
|
60
|
+
time: string;
|
|
61
|
+
upload: string;
|
|
62
|
+
cc: string;
|
|
63
|
+
fastForward: string;
|
|
64
|
+
fastRewind: string;
|
|
65
|
+
fullScreen: string;
|
|
66
|
+
next: string;
|
|
67
|
+
pause: string;
|
|
68
|
+
play: string;
|
|
69
|
+
playButton: string;
|
|
70
|
+
previews: string;
|
|
71
|
+
skipNext: string;
|
|
72
|
+
skipPrevious: string;
|
|
73
|
+
stop: string;
|
|
74
|
+
comment: string;
|
|
75
|
+
facebook: string;
|
|
76
|
+
google: string;
|
|
77
|
+
instagram: string;
|
|
78
|
+
kununu: string;
|
|
79
|
+
like: string;
|
|
80
|
+
linkedin: string;
|
|
81
|
+
love: string;
|
|
82
|
+
repost: string;
|
|
83
|
+
share: string;
|
|
84
|
+
snapchat: string;
|
|
85
|
+
twitter: string;
|
|
86
|
+
user: string;
|
|
87
|
+
users: string;
|
|
88
|
+
vote: string;
|
|
89
|
+
xing: string;
|
|
90
|
+
youtube: string;
|
|
91
|
+
youtubeLogo: string;
|
|
92
|
+
smileyThrilled: string;
|
|
93
|
+
smileySmile: string;
|
|
94
|
+
smileyIndifferent: string;
|
|
95
|
+
smileySad: string;
|
|
96
|
+
smileyDevastated: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* A component to render all defined zhWeb icons.
|
|
100
|
+
* The `fill` of the icon is set to `currentColor` and
|
|
101
|
+
* can be overriden by setting the css `color` property.
|
|
102
|
+
* If the icon name is not found, a placeholder will be displayed.
|
|
103
|
+
*
|
|
104
|
+
* @tagname leu-icon
|
|
105
|
+
* @prop {import("./paths").IconPathName} name - The name of the icon to display.
|
|
106
|
+
* @cssprop --leu-icon-size - The size of the icon.
|
|
107
|
+
*/
|
|
108
|
+
export class LeuIcon extends LeuElement {
|
|
109
|
+
/**
|
|
110
|
+
* @type {import("./paths").IconPathName | ""}
|
|
111
|
+
*/
|
|
112
|
+
name: any | "";
|
|
113
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
114
|
+
}
|
|
115
|
+
import { L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
116
|
+
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["Icon.js"],"names":[],"mappings":"2BAca;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAW;AAwGxB;;;;;;;;;GASG;AACH;IAII;;OAEG;IACH,MAFU,MAAiC,EAAE,CAE/B;IAEhB,+CAiBC;CACF;gCA3JqD,0BAA0B"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
2
|
+
import { css, html, svg } from 'lit';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
var css_248z = css`svg,
|
|
5
|
+
.placeholder {
|
|
6
|
+
display: block;
|
|
7
|
+
width: 1.5rem;
|
|
8
|
+
width: var(--leu-icon-size, 1.5rem);
|
|
9
|
+
height: 1.5rem;
|
|
10
|
+
height: var(--leu-icon-size, 1.5rem);
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {keyof paths} IconPathName
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const paths = {
|
|
9
19
|
addNew: "M12 1C5.926 1 1 5.925 1 12C1 18.075 5.926 23 12 23C18.074 23 23 18.075 23 12C23 5.925 18.074 1 12 1ZM17 13H13V17H11V13H7V11H11V7H13V11H17V13Z",
|
|
10
20
|
angleDropDown: "M17 9.5L12 14.5L7 9.5L17 9.5Z",
|
|
11
21
|
angleDropup: "M7 14.5L12 9.5L17 14.5H7Z",
|
|
@@ -38,8 +48,6 @@ const iconPaths = {
|
|
|
38
48
|
getInformation: "M12 1C5.926 1 1 5.926 1 12C1 18.074 5.926 23 12 23C18.074 23 23 18.074 23 12C23 5.926 18.074 1 12 1ZM11.5 6C11.898 6.00013 12.2796 6.15835 12.5609 6.43984C12.8422 6.72133 13.0001 7.10304 13 7.501C12.9999 7.89896 12.8417 8.28056 12.5602 8.56187C12.2787 8.84317 11.897 9.00113 11.499 9.001C11.101 9.00087 10.7194 8.84265 10.4381 8.56116C10.1568 8.27967 9.99887 7.89796 9.999 7.5C9.99913 7.10204 10.1573 6.72044 10.4388 6.43913C10.7203 6.15783 11.102 5.99987 11.5 6ZM15 18H9V16H11V12H9V10H13V16H15V18Z",
|
|
39
49
|
hide: "M23.7862 0.213819C23.6464 0.0767667 23.4584 0 23.2626 0C23.0668 0 22.8788 0.0767667 22.739 0.213819L16.9046 6.01077C15.3896 5.26962 13.7291 4.87365 12.0427 4.85138C5.31075 4.88878 0.598395 11.4711 0.411396 11.7329L0.112199 12.1817L0.411396 12.5931C1.81786 14.494 3.55313 16.128 5.53515 17.4177L0.299197 22.6536C0.213464 22.7179 0.142549 22.7999 0.0912528 22.894C0.0399571 22.9881 0.0094788 23.0921 0.00188187 23.199C-0.00571506 23.3059 0.00974673 23.4132 0.0472203 23.5136C0.0846938 23.614 0.143304 23.7051 0.219082 23.7809C0.29486 23.8567 0.386037 23.9153 0.486438 23.9528C0.586839 23.9903 0.694121 24.0057 0.801018 23.9981C0.907915 23.9905 1.01193 23.96 1.10602 23.9087C1.20012 23.8575 1.28209 23.7865 1.34639 23.7008L23.7862 1.26101C23.9232 1.12119 24 0.933204 24 0.737414C24 0.541625 23.9232 0.353641 23.7862 0.213819ZM7.55473 11.9947C7.55473 10.8044 8.02757 9.6629 8.86922 8.82125C9.71088 7.97959 10.8524 7.50675 12.0427 7.50675C12.9675 7.50625 13.8694 7.79383 14.6233 8.32954L8.37752 14.5753C7.84181 13.8215 7.55422 12.9195 7.55473 11.9947ZM19.56 7.61895L16.381 10.7979C16.5884 11.5629 16.5895 12.3692 16.3842 13.1347C16.1788 13.9002 15.7744 14.5978 15.2121 15.1563C14.6498 15.7148 13.9495 16.1145 13.1826 16.3146C12.4157 16.5148 11.6095 16.5082 10.8459 16.2957L8.34012 18.8014C9.52646 19.237 10.779 19.4647 12.0427 19.4746C18.7746 19.4746 23.487 12.8923 23.674 12.5931L23.9732 12.1817L23.674 11.7703C22.5141 10.1919 21.1279 8.7931 19.56 7.61895Z",
|
|
40
50
|
home: "M23 10L12.0071 1L1 10V12L11.9925 3L23 12V10Z M3.375 12V23H9V17H15V23H20.625V12L12 5L3.375 12Z",
|
|
41
|
-
layer1: "M15.875 6.875H9.125V0.125H6.875V6.875H0.125V9.125H6.875V15.875H9.125V9.125H15.875V6.875Z",
|
|
42
|
-
layer11: "M0.5 0.5H16.25V2.75H0.5V0.5Z",
|
|
43
51
|
link: "M22.2237 3.63526L20.3648 1.77638C19.7075 1.11912 18.816 0.749878 17.8864 0.749878C16.9569 0.749878 16.0654 1.11912 15.408 1.77638L12.3098 4.87501C11.6526 5.53238 11.2834 6.42386 11.2834 7.35338C11.2834 8.28291 11.6526 9.17438 12.3098 9.83176L12.6192 10.1415L13.182 10.704L14.4214 9.46501L13.8589 8.90251L13.5492 8.59238C13.2205 8.26374 13.0359 7.81804 13.0358 7.35327C13.0357 6.88851 13.2203 6.44275 13.5488 6.11401L16.647 3.01576C16.9758 2.68726 17.4215 2.50274 17.8862 2.50274C18.351 2.50274 18.7967 2.68726 19.1254 3.01576L20.9843 4.87501C21.3128 5.20368 21.4973 5.64934 21.4973 6.11401C21.4973 6.57868 21.3128 7.02433 20.9843 7.35301L17.886 10.4513C17.6013 10.7359 17.2273 10.9138 16.8268 10.9551C16.4264 10.9964 16.0239 10.8986 15.687 10.6781L14.4342 11.9306C15.1072 12.4782 15.9594 12.7568 16.8259 12.7125C17.6925 12.6682 18.5118 12.3041 19.1254 11.6906L22.2237 8.59238C22.5492 8.26693 22.8073 7.88055 22.9835 7.45531C23.1597 7.03007 23.2503 6.57429 23.2503 6.11401C23.2503 5.65372 23.1597 5.19795 22.9835 4.7727C22.8073 4.34746 22.5492 3.96108 22.2237 3.63563V3.63526ZM10.4513 17.8864L7.35304 20.9843C7.0243 21.3128 6.57859 21.4973 6.11385 21.4973C5.64912 21.4973 5.2034 21.3128 4.87467 20.9843L3.01579 19.1254C2.85296 18.9627 2.72378 18.7695 2.63565 18.5569C2.54751 18.3443 2.50215 18.1164 2.50215 17.8862C2.50215 17.656 2.54751 17.4281 2.63565 17.2155C2.72378 17.0029 2.85296 16.8097 3.01579 16.647L6.11404 13.5491C6.44274 13.2204 6.88856 13.0358 7.35342 13.0358C7.81827 13.0358 8.26409 13.2204 8.59279 13.5491L8.90179 13.8589L9.46429 14.4214L10.7037 13.1824L10.1408 12.6195L9.83179 12.3098C9.1744 11.6525 8.28285 11.2832 7.35323 11.2832C6.42361 11.2832 5.53206 11.6525 4.87467 12.3098L1.77642 15.408C1.45093 15.7335 1.19273 16.1198 1.01658 16.5451C0.840422 16.9703 0.749756 17.4261 0.749756 17.8864C0.749756 18.3467 0.840422 18.8024 1.01658 19.2277C1.19273 19.6529 1.45093 20.0393 1.77642 20.3648L3.63529 22.2236C4.2927 22.881 5.18433 23.2504 6.11404 23.2504C7.04375 23.2504 7.93538 22.881 8.59279 22.2236L11.6899 19.125C12.3032 18.5113 12.6672 17.692 12.7115 16.8255C12.7558 15.959 12.4774 15.1069 11.9299 14.4338L10.6774 15.6863C10.8981 16.0232 10.996 16.4258 10.9547 16.8264C10.9134 17.2271 10.7353 17.6012 10.4505 17.886L10.4513 17.8864Z M17.0416 6.95849C17.2058 7.12289 17.2981 7.34578 17.2981 7.57817C17.2981 7.81057 17.2058 8.03346 17.0416 8.19786L8.05806 17.181C7.97671 17.2624 7.88013 17.3269 7.77384 17.3709C7.66754 17.415 7.55361 17.4376 7.43856 17.4376C7.3235 17.4376 7.20957 17.415 7.10328 17.3709C6.99698 17.3269 6.90041 17.2624 6.81906 17.181C6.65471 17.0166 6.56238 16.7937 6.56238 16.5613C6.56238 16.3289 6.65471 16.106 6.81906 15.9416L15.8026 6.95849C15.9669 6.79434 16.1898 6.70215 16.4221 6.70215C16.6544 6.70215 16.8772 6.79434 17.0416 6.95849Z",
|
|
44
52
|
list: "M5 5H2V8H5V5Z M22 5H8V8H22V5Z M2 11H5V14H2V11Z M22 11H8V14H22V11Z M2 17H5V20H2V17Z M22 17H8V20H22V17Z",
|
|
45
53
|
lock: "M4.00211 15.1855C3.94503 17.4179 4.90163 19.6403 6.77048 21.1901C9.77412 23.6808 14.2259 23.6808 17.2296 21.1901C19.0987 19.6401 20.0553 17.4173 19.9979 15.1845C19.9993 15.1232 20 15.0617 20 15C20 13.4191 19.5414 11.9452 18.75 10.7043V6.48C18.75 2.90119 15.7279 0 12 0C8.2721 0 5.25002 2.90119 5.25002 6.48V10.7042C4.4586 11.9452 4 13.419 4 15C4 15.062 4.0007 15.1238 4.00211 15.1855ZM12 17C10.8954 17 10 16.1046 10 15C10 13.8954 10.8954 13 12 13C13.1046 13 14 13.8954 14 15C14 16.1046 13.1046 17 12 17ZM16.25 8.22103C15.0186 7.44741 13.5616 7 12 7C10.4384 7 8.98137 7.44741 7.75 8.22103V6.48C7.75 4.22668 9.65279 2.4 12 2.4C14.3472 2.4 16.25 4.22668 16.25 6.48V8.22103Z",
|
|
@@ -107,30 +115,51 @@ const iconPaths = {
|
|
|
107
115
|
smileySad: "M11 0.5C8.9233 0.5 6.89323 1.11581 5.16652 2.26957C3.4398 3.42332 2.09399 5.0632 1.29927 6.98182C0.50455 8.90045 0.296614 11.0116 0.701759 13.0484C1.1069 15.0852 2.10693 16.9562 3.57538 18.4246C5.04383 19.8931 6.91476 20.8931 8.95156 21.2982C10.9884 21.7034 13.0996 21.4955 15.0182 20.7007C16.9368 19.906 18.5767 18.5602 19.7304 16.8335C20.8842 15.1068 21.5 13.0767 21.5 11C21.5 8.21523 20.3938 5.54451 18.4246 3.57538C16.4555 1.60625 13.7848 0.5 11 0.5ZM7.62501 7.25C7.99585 7.25 8.35836 7.35997 8.6667 7.56599C8.97504 7.77202 9.21537 8.06486 9.35728 8.40747C9.49919 8.75008 9.53633 9.12708 9.46398 9.4908C9.39163 9.85451 9.21305 10.1886 8.95083 10.4508C8.68861 10.713 8.35451 10.8916 7.9908 10.964C7.62709 11.0363 7.25008 10.9992 6.90747 10.8573C6.56486 10.7154 6.27203 10.475 6.066 10.1667C5.85997 9.85835 5.75 9.49584 5.75 9.125C5.74792 8.87565 5.796 8.62842 5.89137 8.39803C5.98675 8.16763 6.12748 7.95876 6.3052 7.78384C6.48292 7.60892 6.69399 7.47152 6.92588 7.37981C7.15776 7.2881 7.40572 7.24396 7.655 7.25H7.62501ZM14.855 16.94C14.4548 16.2753 13.8895 15.7255 13.214 15.3437C12.5385 14.962 11.7759 14.7614 11 14.7614C10.2241 14.7614 9.46146 14.962 8.786 15.3437C8.11054 15.7255 7.54525 16.2753 7.145 16.94L5.8625 16.19C6.39645 15.3049 7.15 14.5728 8.05011 14.0646C8.95021 13.5564 9.96634 13.2894 11 13.2894C12.0337 13.2894 13.0498 13.5564 13.9499 14.0646C14.85 14.5728 15.6036 15.3049 16.1375 16.19L14.855 16.94ZM14.375 11C13.8777 11 13.4008 10.8025 13.0492 10.4508C12.6975 10.0992 12.5 9.62228 12.5 9.125C12.5 8.62772 12.6975 8.15081 13.0492 7.79917C13.4008 7.44754 13.8777 7.25 14.375 7.25C14.8723 7.25 15.3492 7.44754 15.7008 7.79917C16.0525 8.15081 16.25 8.62772 16.25 9.125C16.25 9.62228 16.0525 10.0992 15.7008 10.4508C15.3492 10.8025 14.8723 11 14.375 11Z",
|
|
108
116
|
smileyDevastated: "M11 0.5C8.9233 0.5 6.89323 1.11581 5.16652 2.26957C3.4398 3.42332 2.09399 5.0632 1.29927 6.98182C0.504549 8.90045 0.296614 11.0116 0.701759 13.0484C1.1069 15.0852 2.10693 16.9562 3.57538 18.4246C5.04383 19.8931 6.91476 20.8931 8.95156 21.2982C10.9884 21.7034 13.0996 21.4955 15.0182 20.7007C16.9368 19.906 18.5767 18.5602 19.7304 16.8335C20.8842 15.1068 21.5 13.0767 21.5 11C21.5 8.21523 20.3938 5.54451 18.4246 3.57538C16.4555 1.60625 13.7848 0.5 11 0.5ZM5.75 11.3075L4.6925 10.25L6.1925 8.75L4.6925 7.25L5.75 6.1925L7.25 7.6925L8.75 6.1925L9.8075 7.25L8.3075 8.75L9.8075 10.25L8.75 11.3075L7.25 9.8075L5.75 11.3075ZM11 17.75C10.555 17.75 10.12 17.618 9.74997 17.3708C9.37996 17.1236 9.09157 16.7722 8.92128 16.361C8.75098 15.9499 8.70642 15.4975 8.79324 15.061C8.88005 14.6246 9.09435 14.2237 9.40901 13.909C9.72368 13.5943 10.1246 13.38 10.5611 13.2932C10.9975 13.2064 11.4499 13.251 11.861 13.4213C12.2722 13.5916 12.6236 13.88 12.8708 14.25C13.118 14.62 13.25 15.055 13.25 15.5C13.25 16.0967 13.013 16.669 12.591 17.091C12.169 17.5129 11.5967 17.75 11 17.75ZM17.3075 10.25L16.25 11.3075L14.75 9.8075L13.25 11.3075L12.1925 10.25L13.6925 8.75L12.1925 7.25L13.25 6.1925L14.75 7.6925L16.25 6.1925L17.3075 7.25L15.8075 8.75L17.3075 10.25Z"
|
|
109
117
|
};
|
|
110
|
-
const ICON_NAMES = Object.keys(iconPaths);
|
|
111
|
-
Object.freeze(ICON_NAMES);
|
|
112
|
-
// console.log(JSON.stringify(Object.keys(iconPaths)).replace(/"/g, "'").replace(/,/g, "|").replace(/\[/g, "").replace(/\]/g, ""))
|
|
113
118
|
|
|
114
119
|
/**
|
|
115
|
-
*
|
|
116
|
-
* The
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
+
* A component to render all defined zhWeb icons.
|
|
121
|
+
* The `fill` of the icon is set to `currentColor` and
|
|
122
|
+
* can be overriden by setting the css `color` property.
|
|
123
|
+
* If the icon name is not found, a placeholder will be displayed.
|
|
124
|
+
*
|
|
125
|
+
* @tagname leu-icon
|
|
126
|
+
* @prop {import("./paths").IconPathName} name - The name of the icon to display.
|
|
127
|
+
* @cssprop --leu-icon-size - The size of the icon.
|
|
120
128
|
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
class LeuIcon extends LeuElement {
|
|
130
|
+
constructor() {
|
|
131
|
+
super();
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @type {import("./paths").IconPathName | ""}
|
|
135
|
+
*/
|
|
136
|
+
this.name = "";
|
|
137
|
+
}
|
|
138
|
+
render() {
|
|
139
|
+
if (!paths[this.name]) {
|
|
140
|
+
return html`<div class="placeholder"></div>`;
|
|
141
|
+
}
|
|
142
|
+
const iconPath = paths[this.name];
|
|
143
|
+
return html`
|
|
144
|
+
<svg
|
|
145
|
+
width="24"
|
|
146
|
+
height="24"
|
|
147
|
+
fill="currentColor"
|
|
148
|
+
viewBox="0 0 24 24"
|
|
149
|
+
fill-rule="evenodd"
|
|
150
|
+
role="presentation"
|
|
151
|
+
>
|
|
152
|
+
${svg`<path d=${iconPath} />`}
|
|
153
|
+
</svg>
|
|
154
|
+
`;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
_defineProperty(LeuIcon, "styles", css_248z);
|
|
158
|
+
_defineProperty(LeuIcon, "properties", {
|
|
159
|
+
name: {
|
|
160
|
+
type: String,
|
|
161
|
+
reflect: true
|
|
162
|
+
}
|
|
163
|
+
});
|
|
135
164
|
|
|
136
|
-
export {
|
|
165
|
+
export { LeuIcon };
|
package/dist/Input.d.ts
CHANGED
|
@@ -27,26 +27,26 @@
|
|
|
27
27
|
*
|
|
28
28
|
* @tagname leu-input
|
|
29
29
|
*/
|
|
30
|
-
export class LeuInput extends
|
|
30
|
+
export class LeuInput extends LeuElement {
|
|
31
31
|
static resolveErrorMessage(message: any, refernceValue: any): any;
|
|
32
32
|
disabled: boolean;
|
|
33
33
|
required: boolean;
|
|
34
34
|
clearable: boolean;
|
|
35
|
-
/** @type {
|
|
36
|
-
size:
|
|
35
|
+
/** @type {"small" | "regular"} */
|
|
36
|
+
size: "small" | "regular";
|
|
37
37
|
type: string;
|
|
38
38
|
_validity: any;
|
|
39
39
|
validationMessages: {};
|
|
40
40
|
novalidate: boolean;
|
|
41
|
+
value: string;
|
|
41
42
|
/** @internal */
|
|
42
43
|
_identifier: string;
|
|
43
|
-
/** @internal */
|
|
44
|
-
_clearIcon: import("lit-html").TemplateResult<1>;
|
|
45
44
|
/**
|
|
46
45
|
* @internal
|
|
47
46
|
* @type {import("lit/directives/ref.js").Ref<HTMLInputElement>}
|
|
48
47
|
*/
|
|
49
48
|
_inputRef: import("lit/directives/ref.js").Ref<HTMLInputElement>;
|
|
49
|
+
get valueAsNumber(): number;
|
|
50
50
|
/**
|
|
51
51
|
* Method for handling the click event of the wrapper element.
|
|
52
52
|
* Redirect every click on the wrapper to the input element.
|
|
@@ -85,7 +85,6 @@ export class LeuInput extends LitElement {
|
|
|
85
85
|
* @returns {void}
|
|
86
86
|
*/
|
|
87
87
|
private handleChange;
|
|
88
|
-
value: any;
|
|
89
88
|
/**
|
|
90
89
|
* Method for handling the input event of the input element.
|
|
91
90
|
* Sets the value property and dispatches an input event so that
|
|
@@ -128,27 +127,24 @@ export class LeuInput extends LitElement {
|
|
|
128
127
|
getValidationMessages(): any;
|
|
129
128
|
/**
|
|
130
129
|
* Creates an error list with an item for the given validity state.
|
|
131
|
-
* @
|
|
132
|
-
* @param {Object} validationMessages
|
|
133
|
-
* @param {String} idRef
|
|
134
|
-
* @returns
|
|
130
|
+
* @returns {import("lit").TemplateResult | nothing}
|
|
135
131
|
*/
|
|
136
|
-
renderErrorMessages(): import("lit
|
|
132
|
+
renderErrorMessages(): import("lit").TemplateResult | typeof nothing;
|
|
137
133
|
/**
|
|
138
134
|
* Determines the content that is displayed after the input element.
|
|
139
135
|
* This can be either an icon, a clear button or an error indicator icon.
|
|
140
136
|
*
|
|
141
137
|
* @private
|
|
142
|
-
* @returns {TemplateResult}
|
|
138
|
+
* @returns {import("lit").TemplateResult | nothing}
|
|
143
139
|
*/
|
|
144
140
|
private renderAfterContent;
|
|
145
141
|
isInvalid(): boolean;
|
|
146
142
|
render(): import("lit-html").TemplateResult<1>;
|
|
147
143
|
}
|
|
148
|
-
export
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
import {
|
|
144
|
+
export const SIZES: Readonly<{
|
|
145
|
+
SMALL: "small";
|
|
146
|
+
REGULAR: "regular";
|
|
147
|
+
}>;
|
|
148
|
+
import { L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
153
149
|
import { nothing } from 'lit';
|
|
154
150
|
//# sourceMappingURL=Input.d.ts.map
|
package/dist/Input.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["Input.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["Input.js"],"names":[],"mappings":"AA+SA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IACE,kEAKC;IAGC,kBAAqB;IACrB,kBAAqB;IACrB,mBAAsB;IAEtB,kCAAkC;IAClC,MADW,OAAO,GAAG,SAAS,CACL;IACzB,aAAkB;IAClB,eAAqB;IACrB,uBAA4B;IAC5B,oBAAuB;IACvB,cAAe;IAEf,gBAAgB;IAChB,oBAAqB;IAErB;;;OAGG;IACH,WAFU,OAAO,uBAAuB,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAEnC;IAE9B,4BAKC;IAED;;;;;;;;;;OAUG;IACH,2BAIC;IAED;;;;;;OAMG;IACH,mBAKC;IAED;;;;;;OAMG;IACH,sBAEC;IAED;;;;;;;;OAQG;IACH,qBAMC;IAED;;;;;;;OAOG;IACH,oBAOC;IAED;;;;;;;;OAQG;IACH,cAWC;IAED;;;;;;;OAOG;IACH,cAUC;IAED;;;;;;;;;;OAUG;IACH,6BAgBC;IAED;;;OAGG;IACH,uBAFa,OAAO,KAAK,EAAE,cAAc,iBAAU,CAgBlD;IAED;;;;;;OAMG;IACH,2BAsBC;IACD,qBAKC;IACD,+CA2CC;CACF;AAjVD;;;GAGG;gCA1RmD,0BAA0B;wBAC7C,KAAK"}
|