@statistikzh/leu 0.3.0 → 0.5.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/.github/workflows/deploy-github-pages.yaml +33 -0
- package/.storybook/main.js +27 -1
- package/.storybook/manager-head.html +1 -0
- package/.storybook/manager.js +9 -0
- package/.storybook/preview-head.html +1 -1
- package/.storybook/preview.js +59 -6
- package/.storybook/static/logo.svg +19 -0
- package/.storybook/theme.js +7 -0
- package/CHANGELOG.md +54 -0
- package/README.md +1 -1
- package/custom-elements-manifest.config.js +46 -0
- package/dist/Accordion.d.ts +31 -0
- package/dist/Accordion.d.ts.map +1 -0
- package/dist/Accordion.js +257 -0
- package/dist/Breadcrumb.d.ts +69 -0
- package/dist/Breadcrumb.d.ts.map +1 -0
- package/dist/Breadcrumb.js +392 -0
- package/dist/Button-da11d064.d.ts +84 -0
- package/dist/Button-da11d064.d.ts.map +1 -0
- package/dist/Button-da11d064.js +542 -0
- package/dist/Button.d.ts +2 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.js +6 -423
- package/dist/ButtonGroup.d.ts +24 -0
- package/dist/ButtonGroup.d.ts.map +1 -0
- package/dist/ButtonGroup.js +72 -43
- package/dist/Checkbox.d.ts +13 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.js +101 -84
- package/dist/CheckboxGroup.d.ts +13 -0
- package/dist/CheckboxGroup.d.ts.map +1 -0
- package/dist/CheckboxGroup.js +41 -37
- package/dist/Chip.d.ts +5 -0
- package/dist/Chip.d.ts.map +1 -0
- package/dist/{Chip-5f70d04f.js → Chip.js} +21 -6
- package/dist/ChipGroup.d.ts +28 -0
- package/dist/ChipGroup.d.ts.map +1 -0
- package/dist/ChipGroup.js +64 -10
- package/dist/ChipLink.d.ts +15 -0
- package/dist/ChipLink.d.ts.map +1 -0
- package/dist/ChipLink.js +4 -7
- package/dist/ChipRemovable.d.ts +13 -0
- package/dist/ChipRemovable.d.ts.map +1 -0
- package/dist/ChipRemovable.js +5 -8
- package/dist/ChipSelectable.d.ts +22 -0
- package/dist/ChipSelectable.d.ts.map +1 -0
- package/dist/ChipSelectable.js +8 -11
- package/dist/Dropdown.d.ts +15 -0
- package/dist/Dropdown.d.ts.map +1 -0
- package/dist/Dropdown.js +73 -26
- package/dist/Input.d.ts +154 -0
- package/dist/Input.d.ts.map +1 -0
- package/dist/Input.js +42 -35
- package/dist/Menu.d.ts +8 -0
- package/dist/Menu.d.ts.map +1 -0
- package/dist/Menu.js +2 -5
- package/dist/MenuItem.d.ts +21 -0
- package/dist/MenuItem.d.ts.map +1 -0
- package/dist/MenuItem.js +32 -17
- package/dist/Pagination.d.ts +27 -0
- package/dist/Pagination.d.ts.map +1 -0
- package/dist/Pagination.js +121 -89
- package/dist/Popup.d.ts +18 -0
- package/dist/Popup.d.ts.map +1 -0
- package/dist/Popup.js +215 -0
- package/dist/Radio.d.ts +12 -0
- package/dist/Radio.d.ts.map +1 -0
- package/dist/Radio.js +9 -8
- package/dist/RadioGroup.d.ts +20 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +41 -39
- package/dist/ScrollTop.d.ts +19 -0
- package/dist/ScrollTop.d.ts.map +1 -0
- package/dist/ScrollTop.js +122 -0
- package/dist/Select.d.ts +98 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.js +79 -122
- package/dist/Table.d.ts +48 -0
- package/dist/Table.d.ts.map +1 -0
- package/dist/Table.js +141 -121
- package/dist/VisuallyHidden.d.ts +8 -0
- package/dist/VisuallyHidden.d.ts.map +1 -0
- package/dist/VisuallyHidden.js +28 -0
- package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts +3 -0
- package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts.map +1 -0
- package/dist/{defineElement-ba770aed.js → _rollupPluginBabelHelpers-20f659f4.js} +1 -15
- package/dist/defineElement-40372b4b.d.ts +9 -0
- package/dist/defineElement-40372b4b.d.ts.map +1 -0
- package/dist/defineElement-40372b4b.js +15 -0
- package/dist/icon-03e86700.d.ts +11 -0
- package/dist/icon-03e86700.d.ts.map +1 -0
- package/dist/index.js.d.ts +21 -0
- package/dist/index.js.d.ts.map +1 -0
- package/dist/index.js.js +42 -0
- package/dist/leu-accordion.d.ts +3 -0
- package/dist/leu-accordion.d.ts.map +1 -0
- package/dist/leu-accordion.js +9 -0
- package/dist/leu-breadcrumb.d.ts +3 -0
- package/dist/leu-breadcrumb.d.ts.map +1 -0
- package/dist/leu-breadcrumb.js +23 -0
- package/dist/leu-button-group.d.ts +3 -0
- package/dist/leu-button-group.d.ts.map +1 -0
- package/dist/leu-button-group.js +6 -6
- package/dist/leu-button.d.ts +3 -0
- package/dist/leu-button.d.ts.map +1 -0
- package/dist/leu-button.js +7 -3
- package/dist/leu-checkbox-group.d.ts +3 -0
- package/dist/leu-checkbox-group.d.ts.map +1 -0
- package/dist/leu-checkbox-group.js +6 -3
- package/dist/leu-checkbox.d.ts +3 -0
- package/dist/leu-checkbox.d.ts.map +1 -0
- package/dist/leu-checkbox.js +6 -3
- package/dist/leu-chip-group.d.ts +3 -0
- package/dist/leu-chip-group.d.ts.map +1 -0
- package/dist/leu-chip-group.js +7 -3
- package/dist/leu-chip-link.d.ts +3 -0
- package/dist/leu-chip-link.d.ts.map +1 -0
- package/dist/leu-chip-link.js +7 -4
- package/dist/leu-chip-removable.d.ts +3 -0
- package/dist/leu-chip-removable.d.ts.map +1 -0
- package/dist/leu-chip-removable.js +7 -4
- package/dist/leu-chip-selectable.d.ts +3 -0
- package/dist/leu-chip-selectable.d.ts.map +1 -0
- package/dist/leu-chip-selectable.js +7 -4
- package/dist/leu-dropdown.d.ts +3 -0
- package/dist/leu-dropdown.d.ts.map +1 -0
- package/dist/leu-dropdown.js +15 -4
- package/dist/leu-input.d.ts +3 -0
- package/dist/leu-input.d.ts.map +1 -0
- package/dist/leu-input.js +7 -3
- package/dist/leu-menu-item.d.ts +3 -0
- package/dist/leu-menu-item.d.ts.map +1 -0
- package/dist/leu-menu-item.js +8 -3
- package/dist/leu-menu.d.ts +3 -0
- package/dist/leu-menu.d.ts.map +1 -0
- package/dist/leu-menu.js +6 -3
- package/dist/leu-pagination.d.ts +3 -0
- package/dist/leu-pagination.d.ts.map +1 -0
- package/dist/leu-pagination.js +12 -4
- package/dist/leu-popup.d.ts +3 -0
- package/dist/leu-popup.d.ts.map +1 -0
- package/dist/leu-popup.js +9 -0
- package/dist/leu-radio-group.d.ts +3 -0
- package/dist/leu-radio-group.d.ts.map +1 -0
- package/dist/leu-radio-group.js +6 -3
- package/dist/leu-radio.d.ts +3 -0
- package/dist/leu-radio.d.ts.map +1 -0
- package/dist/leu-radio.js +6 -3
- package/dist/leu-scroll-top.d.ts +3 -0
- package/dist/leu-scroll-top.d.ts.map +1 -0
- package/dist/leu-scroll-top.js +14 -0
- package/dist/leu-select.d.ts +3 -0
- package/dist/leu-select.d.ts.map +1 -0
- package/dist/leu-select.js +16 -4
- package/dist/leu-table.d.ts +3 -0
- package/dist/leu-table.d.ts.map +1 -0
- package/dist/leu-table.js +13 -4
- package/dist/leu-visually-hidden.d.ts +3 -0
- package/dist/leu-visually-hidden.d.ts.map +1 -0
- package/dist/leu-visually-hidden.js +8 -0
- package/dist/theme.css +386 -2
- package/dist/utils-65469421.d.ts +16 -0
- package/dist/utils-65469421.d.ts.map +1 -0
- package/dist/utils-65469421.js +35 -0
- package/index.js +3 -0
- package/package.json +47 -17
- package/postcss.config.cjs +2 -0
- package/rollup.config.js +21 -40
- package/scripts/generate-component/templates/[Name].js +0 -5
- package/scripts/generate-component/templates/[name].css +3 -3
- package/scripts/generate-component/templates/[namespace]-[name].js +5 -2
- package/scripts/postcss-leu-font-styles.cjs +160 -0
- package/src/components/accordion/Accordion.js +0 -6
- package/src/components/accordion/accordion.css +2 -2
- package/src/components/accordion/leu-accordion.js +5 -2
- package/src/components/accordion/stories/accordion.stories.js +8 -4
- package/src/components/accordion/test/accordion.test.js +95 -3
- package/src/components/breadcrumb/Breadcrumb.js +311 -0
- package/src/components/breadcrumb/breadcrumb.css +103 -0
- package/src/components/breadcrumb/leu-breadcrumb.js +6 -0
- package/src/components/breadcrumb/stories/breadcrumb.stories.js +73 -0
- package/src/components/breadcrumb/test/breadcrumb.test.js +141 -0
- package/src/components/button/Button.js +76 -20
- package/src/components/button/button.css +13 -5
- package/src/components/button/leu-button.js +5 -2
- package/src/components/button/stories/button.stories.js +79 -105
- package/src/components/button/test/button.test.js +184 -3
- package/src/components/button-group/ButtonGroup.js +76 -40
- package/src/components/button-group/leu-button-group.js +5 -2
- package/src/components/button-group/stories/button-group.stories.js +19 -6
- package/src/components/button-group/test/button-group.test.js +87 -4
- package/src/components/checkbox/Checkbox.js +6 -85
- package/src/components/checkbox/CheckboxGroup.js +8 -38
- package/src/components/checkbox/checkbox-group.css +29 -0
- package/src/components/checkbox/checkbox.css +76 -0
- package/src/components/checkbox/leu-checkbox-group.js +5 -2
- package/src/components/checkbox/leu-checkbox.js +5 -2
- package/src/components/checkbox/stories/checkbox-group.stories.js +44 -21
- package/src/components/checkbox/stories/checkbox.stories.js +7 -1
- package/src/components/checkbox/test/checkbox-group.test.js +124 -0
- package/src/components/checkbox/test/checkbox.test.js +72 -59
- package/src/components/chip/Chip.js +1 -0
- package/src/components/chip/ChipGroup.js +42 -7
- package/src/components/chip/ChipLink.js +1 -6
- package/src/components/chip/ChipRemovable.js +2 -7
- package/src/components/chip/ChipSelectable.js +5 -10
- package/src/components/chip/chip-group.css +12 -2
- package/src/components/chip/chip.css +14 -3
- package/src/components/chip/exports.js +4 -10
- package/src/components/chip/leu-chip-group.js +5 -2
- package/src/components/chip/leu-chip-link.js +5 -2
- package/src/components/chip/leu-chip-removable.js +5 -2
- package/src/components/chip/leu-chip-selectable.js +5 -2
- package/src/components/chip/stories/chip-group.stories.js +110 -44
- package/src/components/chip/stories/chip-link.stories.js +16 -4
- package/src/components/chip/stories/chip-removable.stories.js +15 -4
- package/src/components/chip/stories/chip-selectable.stories.js +13 -3
- package/src/components/chip/test/chip-group.test.js +124 -0
- package/src/components/chip/test/chip-link.test.js +58 -0
- package/src/components/chip/test/chip-removable.test.js +79 -0
- package/src/components/chip/test/chip-selectable.test.js +95 -0
- package/src/components/chip/test/chip.test.js +1 -1
- package/src/components/dropdown/Dropdown.js +72 -24
- package/src/components/dropdown/dropdown.css +1 -2
- package/src/components/dropdown/leu-dropdown.js +5 -2
- package/src/components/dropdown/stories/dropdown.stories.js +11 -5
- package/src/components/dropdown/test/dropdown.test.js +6 -6
- package/src/components/icon/icon.js +1 -1
- package/src/components/icon/test/icon.test.js +66 -0
- package/src/components/input/Input.js +25 -28
- package/src/components/input/input.css +11 -8
- package/src/components/input/leu-input.js +5 -2
- package/src/components/input/stories/input.stories.js +21 -2
- package/src/components/input/test/input.test.js +432 -4
- package/src/components/menu/Menu.js +0 -5
- package/src/components/menu/MenuItem.js +20 -13
- package/src/components/menu/leu-menu-item.js +5 -2
- package/src/components/menu/leu-menu.js +5 -2
- package/src/components/menu/menu-item.css +7 -4
- package/src/components/menu/stories/menu-item.stories.js +13 -4
- package/src/components/menu/stories/menu.stories.js +11 -5
- package/src/components/menu/test/menu-item.test.js +180 -0
- package/src/components/menu/test/menu.test.js +10 -2
- package/src/components/pagination/Pagination.js +118 -99
- package/src/components/pagination/leu-pagination.js +5 -2
- package/src/components/pagination/pagination.css +6 -1
- package/src/components/pagination/stories/pagination.stories.js +30 -9
- package/src/components/pagination/test/pagination.test.js +191 -5
- package/src/components/popup/Popup.js +200 -0
- package/src/components/popup/leu-popup.js +6 -0
- package/src/components/popup/popup.css +27 -0
- package/src/components/popup/stories/popup.stories.js +58 -0
- package/src/components/popup/test/popup.test.js +29 -0
- package/src/components/radio/Radio.js +2 -6
- package/src/components/radio/RadioGroup.js +6 -38
- package/src/components/radio/leu-radio-group.js +5 -2
- package/src/components/radio/leu-radio.js +5 -2
- package/src/components/radio/radio-group.css +29 -0
- package/src/components/radio/radio.css +1 -1
- package/src/components/radio/stories/radio-group.stories.js +38 -19
- package/src/components/radio/stories/radio.stories.js +7 -1
- package/src/components/radio/test/radio-group.test.js +86 -0
- package/src/components/radio/test/radio.test.js +108 -17
- package/src/components/scroll-top/ScrollTop.js +87 -0
- package/src/components/scroll-top/leu-scroll-top.js +6 -0
- package/src/components/scroll-top/scroll-top.css +34 -0
- package/src/components/scroll-top/stories/scroll-top.stories.js +217 -0
- package/src/components/scroll-top/test/scroll-top.test.js +22 -0
- package/src/components/select/Select.js +58 -37
- package/src/components/select/leu-select.js +5 -2
- package/src/components/select/select.css +15 -15
- package/src/components/select/stories/select.stories.js +15 -168
- package/src/components/select/test/fixtures.js +162 -0
- package/src/components/select/test/select.test.js +236 -12
- package/src/components/table/Table.js +43 -118
- package/src/components/table/leu-table.js +5 -2
- package/src/components/table/stories/table.stories.js +20 -10
- package/src/components/table/table.css +99 -0
- package/src/components/table/test/table.test.js +1 -1
- package/src/components/visually-hidden/VisuallyHidden.js +13 -0
- package/src/components/visually-hidden/leu-visually-hidden.js +6 -0
- package/src/components/visually-hidden/stories/visually-hidden.stories.js +22 -0
- package/src/components/visually-hidden/test/visually-hidden.test.js +36 -0
- package/src/components/visually-hidden/visually-hidden.css +10 -0
- package/src/lib/defineElement.js +1 -1
- package/src/lib/hasSlotController.js +5 -3
- package/src/lib/utils.js +35 -0
- package/src/styles/custom-properties.css +6 -2
- package/src/styles/font-definitions.json +202 -0
- package/stylelint.config.mjs +2 -0
- package/tsconfig.build.json +21 -0
- package/tsconfig.json +16 -0
- package/{web-dev-server-storybook.config.mjs → web-dev-server.config.mjs} +1 -2
- package/web-test-runner.config.mjs +15 -2
- package/dist/index.js +0 -26
package/dist/ChipSelectable.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { _ as _defineProperty
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import { LeuChipBase } from './Chip.js';
|
|
4
4
|
|
|
5
5
|
const SIZES = {
|
|
6
6
|
small: "small",
|
|
7
7
|
regular: "regular"
|
|
8
8
|
};
|
|
9
9
|
const VARIANTS = {
|
|
10
|
-
|
|
10
|
+
toggle: "toggle",
|
|
11
11
|
radio: "radio"
|
|
12
12
|
};
|
|
13
13
|
|
|
@@ -48,9 +48,9 @@ class LeuChipSelectable extends LeuChipBase {
|
|
|
48
48
|
return html`<button
|
|
49
49
|
@click=${e => this.handleClick(e)}
|
|
50
50
|
class="button"
|
|
51
|
-
aria-
|
|
51
|
+
aria-pressed=${this.selected ? "true" : "false"}
|
|
52
52
|
>
|
|
53
|
-
<span class="label"
|
|
53
|
+
<span class="label">${this.label}</span>
|
|
54
54
|
</button>`;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -67,11 +67,11 @@ _defineProperty(LeuChipSelectable, "properties", {
|
|
|
67
67
|
},
|
|
68
68
|
/**
|
|
69
69
|
* The variant of the chip. Has an effect not only on the visual appearance but also on the behavior.
|
|
70
|
-
* - `
|
|
70
|
+
* - `toggle`: The chip behaves like a toggle button.
|
|
71
71
|
* - `radio`: The chip behaves like a radio button.
|
|
72
72
|
*
|
|
73
73
|
* @type {keyof typeof VARIANTS}
|
|
74
|
-
* @default "
|
|
74
|
+
* @default "toggle"
|
|
75
75
|
*/
|
|
76
76
|
variant: {
|
|
77
77
|
type: String,
|
|
@@ -86,8 +86,5 @@ _defineProperty(LeuChipSelectable, "properties", {
|
|
|
86
86
|
reflect: true
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
|
-
function defineChipSelectableElements() {
|
|
90
|
-
defineElement("chip-selectable", LeuChipSelectable);
|
|
91
|
-
}
|
|
92
89
|
|
|
93
|
-
export { LeuChipSelectable, SIZES, VARIANTS
|
|
90
|
+
export { LeuChipSelectable, SIZES, VARIANTS };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tagname leu-dropdown
|
|
3
|
+
*/
|
|
4
|
+
export class LeuDropdown extends LitElement {
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
label: string;
|
|
7
|
+
menuItems: any[];
|
|
8
|
+
_keyUpHandler(event: any): void;
|
|
9
|
+
_handleSlotChange(): void;
|
|
10
|
+
_removeMenuItemListeners(): void;
|
|
11
|
+
_handleToggleClick(): void;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
import { LitElement } from 'lit';
|
|
15
|
+
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["Dropdown.js"],"names":[],"mappings":"AAmCA;;GAEG;AACH;IAKQ,kBAAqB;IAMzB,cAAe;IAEf,iBAAmB;IAarB,gCAIC;IACD,0BAIC;IACD,iCAIC;IACD,2BAEC;IACD,+CA0BC;CACF;2BA5GqC,KAAK"}
|
package/dist/Dropdown.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { _ as _defineProperty
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { css, LitElement, html } from 'lit';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import './leu-button.js';
|
|
4
|
+
import './leu-menu.js';
|
|
5
|
+
import './leu-menu-item.js';
|
|
6
|
+
import './leu-popup.js';
|
|
7
|
+
import './defineElement-40372b4b.js';
|
|
8
|
+
import './Button-da11d064.js';
|
|
6
9
|
import 'lit/directives/class-map.js';
|
|
10
|
+
import 'lit/directives/if-defined.js';
|
|
7
11
|
import './icon-03e86700.js';
|
|
12
|
+
import './Menu.js';
|
|
13
|
+
import './MenuItem.js';
|
|
14
|
+
import 'lit/static-html.js';
|
|
15
|
+
import './Popup.js';
|
|
16
|
+
import '@floating-ui/dom';
|
|
8
17
|
|
|
9
18
|
var css_248z = css`:host,
|
|
10
19
|
:host * {
|
|
@@ -20,8 +29,7 @@ var css_248z = css`:host,
|
|
|
20
29
|
box-shadow: var(--leu-box-shadow-short);
|
|
21
30
|
border-radius: 2px;
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
top: calc(100% + 0.5rem);
|
|
32
|
+
margin-top: 0.5rem;
|
|
25
33
|
}
|
|
26
34
|
`;
|
|
27
35
|
|
|
@@ -31,27 +39,72 @@ var css_248z = css`:host,
|
|
|
31
39
|
class LeuDropdown extends LitElement {
|
|
32
40
|
constructor() {
|
|
33
41
|
super();
|
|
42
|
+
_defineProperty(this, "_documentClickHandler", event => {
|
|
43
|
+
if (!this.contains(event.target)) {
|
|
44
|
+
this.expanded = false;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
_defineProperty(this, "_handleMenuItemClick", () => {
|
|
48
|
+
this.expanded = false;
|
|
49
|
+
});
|
|
34
50
|
this.label = "";
|
|
35
51
|
this.expanded = false;
|
|
52
|
+
this.menuItems = [];
|
|
36
53
|
}
|
|
37
|
-
|
|
54
|
+
connectedCallback() {
|
|
55
|
+
super.connectedCallback();
|
|
56
|
+
this.addEventListener("keyup", this._keyUpHandler);
|
|
57
|
+
document.addEventListener("click", this._documentClickHandler);
|
|
58
|
+
}
|
|
59
|
+
disconnectedCallback() {
|
|
60
|
+
super.disconnectedCallback();
|
|
61
|
+
this._removeMenuItemListeners();
|
|
62
|
+
this.removeEventListener("keyup", this._keyUpHandler);
|
|
63
|
+
document.removeEventListener("click", this._documentClickHandler);
|
|
64
|
+
}
|
|
65
|
+
_keyUpHandler(event) {
|
|
66
|
+
if (event.key === "Escape") {
|
|
67
|
+
this.expanded = false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
_handleSlotChange() {
|
|
71
|
+
this._removeMenuItemListeners();
|
|
72
|
+
this.menuItems = [...this.querySelectorAll("leu-menu > leu-menu-item")];
|
|
73
|
+
this.menuItems.forEach(item => item.addEventListener("click", this._handleMenuItemClick));
|
|
74
|
+
}
|
|
75
|
+
_removeMenuItemListeners() {
|
|
76
|
+
this.menuItems.forEach(item => {
|
|
77
|
+
item.removeEventListener("click", this._handleMenuItemClick);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
_handleToggleClick() {
|
|
38
81
|
this.expanded = !this.expanded;
|
|
39
82
|
}
|
|
40
83
|
render() {
|
|
41
84
|
return html`
|
|
42
|
-
<leu-
|
|
43
|
-
icon="download"
|
|
44
|
-
variant="ghost"
|
|
45
|
-
label=${this.label}
|
|
46
|
-
expanded=${this.expanded ? "open" : "closed"}
|
|
47
|
-
aria-expanded=${this.expanded ? "true" : "false"}
|
|
48
|
-
aria-controls="content"
|
|
85
|
+
<leu-popup
|
|
49
86
|
?active=${this.expanded}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
87
|
+
placement="bottom-start"
|
|
88
|
+
shift
|
|
89
|
+
shiftPadding="8"
|
|
90
|
+
autoSize="width"
|
|
91
|
+
autoSizePadding="8"
|
|
92
|
+
>
|
|
93
|
+
<leu-button
|
|
94
|
+
slot="anchor"
|
|
95
|
+
icon="download"
|
|
96
|
+
variant="ghost"
|
|
97
|
+
expanded=${this.expanded ? "true" : "false"}
|
|
98
|
+
aria-expanded=${this.expanded ? "true" : "false"}
|
|
99
|
+
aria-controls="content"
|
|
100
|
+
?active=${this.expanded}
|
|
101
|
+
@click=${this._handleToggleClick}
|
|
102
|
+
>${this.label}</leu-button
|
|
103
|
+
>
|
|
104
|
+
<div id="content" class="content" ?hidden=${!this.expanded}>
|
|
105
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
106
|
+
</div>
|
|
107
|
+
</leu-popup>
|
|
55
108
|
`;
|
|
56
109
|
}
|
|
57
110
|
}
|
|
@@ -66,11 +119,5 @@ _defineProperty(LeuDropdown, "properties", {
|
|
|
66
119
|
reflect: true
|
|
67
120
|
}
|
|
68
121
|
});
|
|
69
|
-
function defineDropdownElements() {
|
|
70
|
-
defineElement("dropdown", LeuDropdown);
|
|
71
|
-
defineButtonElements();
|
|
72
|
-
defineMenuElements();
|
|
73
|
-
defineMenuItemElements();
|
|
74
|
-
}
|
|
75
122
|
|
|
76
|
-
export { LeuDropdown
|
|
123
|
+
export { LeuDropdown };
|
package/dist/Input.d.ts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A text input element.
|
|
3
|
+
*
|
|
4
|
+
* @prop {boolean} disabled - Disables the input element.
|
|
5
|
+
* @prop {boolean} required - Marks the input element as required.
|
|
6
|
+
* @prop {boolean} clearable - Adds a button to clear the input element.
|
|
7
|
+
* @prop {string} value - The value of the input element.
|
|
8
|
+
* @prop {string} name - The name of the input element.
|
|
9
|
+
* @prop {string} label - The label of the input element.
|
|
10
|
+
* @prop {string} error - A custom error that is completely independent of the validity state. Useful for displaying server side errors.
|
|
11
|
+
* @prop {string} size - The size of the input element.
|
|
12
|
+
* @prop {string} icon - The icon that is displayed at the end of the input element.
|
|
13
|
+
* @prop {string} prefix - A prefix that relates to the value of the input (e.g. CHF).
|
|
14
|
+
* @prop {string} suffix - A suffix that relates to the value of the input (e.g. mm).
|
|
15
|
+
* @prop {string} pattern - A regular expression that the value is checked against.
|
|
16
|
+
* @prop {string} type - The type of the input element.
|
|
17
|
+
* @prop {string} min - The minimum value of the input element.
|
|
18
|
+
* @prop {string} max - The maximum value of the input element.
|
|
19
|
+
* @prop {string} minlength - The minimum length of the input element.
|
|
20
|
+
* @prop {string} maxlength - The maximum length of the input element.
|
|
21
|
+
* @prop {object} validationMessages - Custom validation messages. The key is the name of the validity state and the value is the message.
|
|
22
|
+
* @prop {boolean} novalidate - Disables the browser's validation.
|
|
23
|
+
* @prop {string} step - The step value of the input element.
|
|
24
|
+
*
|
|
25
|
+
* @fires {CustomEvent} input - Dispatched when the value of the input element changes.
|
|
26
|
+
* @fires {CustomEvent} change - Dispatched when the value of the input element changes and the input element loses focus.
|
|
27
|
+
*
|
|
28
|
+
* @tagname leu-input
|
|
29
|
+
*/
|
|
30
|
+
export class LeuInput extends LitElement {
|
|
31
|
+
static resolveErrorMessage(message: any, refernceValue: any): any;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
required: boolean;
|
|
34
|
+
clearable: boolean;
|
|
35
|
+
/** @type {keyof typeof SIZE_TYPES} */
|
|
36
|
+
size: keyof typeof SIZE_TYPES;
|
|
37
|
+
type: string;
|
|
38
|
+
_validity: any;
|
|
39
|
+
validationMessages: {};
|
|
40
|
+
novalidate: boolean;
|
|
41
|
+
/** @internal */
|
|
42
|
+
_identifier: string;
|
|
43
|
+
/** @internal */
|
|
44
|
+
_clearIcon: import("lit-html").TemplateResult<1>;
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
* @type {import("lit/directives/ref.js").Ref<HTMLInputElement>}
|
|
48
|
+
*/
|
|
49
|
+
_inputRef: import("lit/directives/ref.js").Ref<HTMLInputElement>;
|
|
50
|
+
/**
|
|
51
|
+
* Method for handling the click event of the wrapper element.
|
|
52
|
+
* Redirect every click on the wrapper to the input element.
|
|
53
|
+
* This is only necessary for click events because the wrapper element
|
|
54
|
+
* looks like the input element. But the actual input field does not
|
|
55
|
+
* completely fill the wrapper element. Keyboard events don't need to be
|
|
56
|
+
* handled because the actual input element is focusable.
|
|
57
|
+
* @private
|
|
58
|
+
* @param {MouseEvent|PointerEvent} event
|
|
59
|
+
* @returns {void}
|
|
60
|
+
*/
|
|
61
|
+
private handleWrapperClick;
|
|
62
|
+
/**
|
|
63
|
+
* Method for handling the blur event of the input element.
|
|
64
|
+
* Checks validity of the input element and sets the validity state.
|
|
65
|
+
* @private
|
|
66
|
+
* @param {FocusEvent} event
|
|
67
|
+
* @returns {void}
|
|
68
|
+
*/
|
|
69
|
+
private handleBlur;
|
|
70
|
+
/**
|
|
71
|
+
* Method for handling the invalid event of the input element.
|
|
72
|
+
* Sets the validity state.
|
|
73
|
+
* @private
|
|
74
|
+
* @param {Event} event
|
|
75
|
+
* @returns {void}
|
|
76
|
+
*/
|
|
77
|
+
private handleInvalid;
|
|
78
|
+
/**
|
|
79
|
+
* Method for handling the change event of the input element.
|
|
80
|
+
* Sets the value property and dispatches a change event so that
|
|
81
|
+
* the event can be handled outside the shadow DOM.
|
|
82
|
+
* @private
|
|
83
|
+
* @param {Event} event
|
|
84
|
+
* @fires {CustomEvent} change
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
87
|
+
private handleChange;
|
|
88
|
+
value: any;
|
|
89
|
+
/**
|
|
90
|
+
* Method for handling the input event of the input element.
|
|
91
|
+
* Sets the value property and dispatches an input event so that
|
|
92
|
+
* the event can be handled outside the shadow DOM.
|
|
93
|
+
* @private
|
|
94
|
+
* @param {Event} event
|
|
95
|
+
* @returns {void}
|
|
96
|
+
*/
|
|
97
|
+
private handleInput;
|
|
98
|
+
/**
|
|
99
|
+
* Method for clearing the input element.
|
|
100
|
+
* Sets the value property to an empty string and dispatches
|
|
101
|
+
* an input and a change event.
|
|
102
|
+
* @private
|
|
103
|
+
* @returns {void}
|
|
104
|
+
* @fires {CustomEvent} input
|
|
105
|
+
* @fires {CustomEvent} change
|
|
106
|
+
*/
|
|
107
|
+
private clear;
|
|
108
|
+
/**
|
|
109
|
+
* Method for getting the id of the input element.
|
|
110
|
+
* If the id attribute is set, the value of the id attribute is returned.
|
|
111
|
+
* Otherwise a random id is generated and returned.
|
|
112
|
+
*
|
|
113
|
+
* @private
|
|
114
|
+
* @returns {string} id
|
|
115
|
+
*/
|
|
116
|
+
private getId;
|
|
117
|
+
/**
|
|
118
|
+
* Merge custom and default validation messages.
|
|
119
|
+
* A validation message can be a function or a string.
|
|
120
|
+
* If it s a function, the function is called with the corresponding
|
|
121
|
+
* attribute value as argument.
|
|
122
|
+
* e.g.
|
|
123
|
+
* `tooLong(this.maxlength)`
|
|
124
|
+
* This way the framework user can create reasonable validation messages
|
|
125
|
+
*
|
|
126
|
+
* @returns {Object} validationMessages
|
|
127
|
+
*/
|
|
128
|
+
getValidationMessages(): any;
|
|
129
|
+
/**
|
|
130
|
+
* Creates an error list with an item for the given validity state.
|
|
131
|
+
* @param {ValidityState} validityState
|
|
132
|
+
* @param {Object} validationMessages
|
|
133
|
+
* @param {String} idRef
|
|
134
|
+
* @returns
|
|
135
|
+
*/
|
|
136
|
+
renderErrorMessages(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
137
|
+
/**
|
|
138
|
+
* Determines the content that is displayed after the input element.
|
|
139
|
+
* This can be either an icon, a clear button or an error indicator icon.
|
|
140
|
+
*
|
|
141
|
+
* @private
|
|
142
|
+
* @returns {TemplateResult}
|
|
143
|
+
*/
|
|
144
|
+
private renderAfterContent;
|
|
145
|
+
isInvalid(): boolean;
|
|
146
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
147
|
+
}
|
|
148
|
+
export namespace SIZE_TYPES {
|
|
149
|
+
let SMALL: string;
|
|
150
|
+
let REGULAR: string;
|
|
151
|
+
}
|
|
152
|
+
import { LitElement } from 'lit';
|
|
153
|
+
import { nothing } from 'lit';
|
|
154
|
+
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["Input.js"],"names":[],"mappings":"AA6SA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IACE,kEAKC;IAGC,kBAAqB;IACrB,kBAAqB;IACrB,mBAAsB;IAEtB,sCAAsC;IACtC,MADW,MAAM,iBAAiB,CACJ;IAC9B,aAAkB;IAClB,eAAqB;IACrB,uBAA4B;IAC5B,oBAAuB;IAEvB,gBAAgB;IAChB,oBAAqB;IAErB,gBAAgB;IAChB,iDAA+B;IAE/B;;;OAGG;IACH,WAFU,OAAO,uBAAuB,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAEnC;IAG9B;;;;;;;;;;OAUG;IACH,2BAIC;IAED;;;;;;OAMG;IACH,mBAKC;IAED;;;;;;OAMG;IACH,sBAEC;IAED;;;;;;;;OAQG;IACH,qBAMC;IAJG,WAA+B;IAMnC;;;;;;;OAOG;IACH,oBAOC;IAED;;;;;;;;OAQG;IACH,cAWC;IAED;;;;;;;OAOG;IACH,cAUC;IAED;;;;;;;;;;OAUG;IACH,6BAgBC;IAED;;;;;;OAMG;IACH,6EAcC;IAED;;;;;;OAMG;IACH,2BAkBC;IACD,qBAKC;IACD,+CA2CC;CACF;;;;;2BAhmB8C,KAAK;wBAAL,KAAK"}
|
package/dist/Input.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { _ as _defineProperty
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { css, LitElement, nothing, html } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import { live } from 'lit/directives/live.js';
|
|
5
6
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
6
7
|
import { I as Icon } from './icon-03e86700.js';
|
|
7
8
|
|
|
@@ -33,11 +34,11 @@ var css_248z = css`:host,
|
|
|
33
34
|
|
|
34
35
|
--input-clear-color: var(--leu-color-black-60);
|
|
35
36
|
|
|
36
|
-
--input-font-regular: var(--leu-font-regular);
|
|
37
|
-
--input-font-black: var(--leu-font-black);
|
|
37
|
+
--input-font-regular: var(--leu-font-family-regular);
|
|
38
|
+
--input-font-black: var(--leu-font-family-black);
|
|
38
39
|
|
|
39
40
|
display: block;
|
|
40
|
-
font-family: var(--leu-font-regular);
|
|
41
|
+
font-family: var(--leu-font-family-regular);
|
|
41
42
|
font-family: var(--input-font-regular);
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -137,6 +138,7 @@ var css_248z = css`:host,
|
|
|
137
138
|
|
|
138
139
|
/* is size regular AND (has focus OR contains a value) */
|
|
139
140
|
|
|
141
|
+
.input-wrapper--invalid .label,
|
|
140
142
|
:host(:not([size])) .label,
|
|
141
143
|
:host([size="regular"]) .label {
|
|
142
144
|
top: calc(0.75rem - var(--input-border-width));
|
|
@@ -161,20 +163,22 @@ var css_248z = css`:host,
|
|
|
161
163
|
content: "*";
|
|
162
164
|
}
|
|
163
165
|
|
|
166
|
+
/* is not disabled AND has focus AND is empty */
|
|
167
|
+
|
|
168
|
+
:host(:not([disabled]):not(:focus-within)) .input-wrapper--empty .label {
|
|
169
|
+
--input-label-color: var(--input-label-color-empty);
|
|
170
|
+
}
|
|
171
|
+
|
|
164
172
|
/* is empty AND has no focus */
|
|
165
173
|
|
|
166
|
-
:host(:not(:focus-within))
|
|
174
|
+
:host(:not(:focus-within))
|
|
175
|
+
.input-wrapper--empty:not(.input-wrapper--invalid)
|
|
176
|
+
.label {
|
|
167
177
|
font-family: var(--input-font-regular);
|
|
168
178
|
font-size: 1rem;
|
|
169
179
|
top: calc(1.5rem - var(--input-border-width));
|
|
170
180
|
}
|
|
171
181
|
|
|
172
|
-
/* is not disabled AND has focus AND is empty */
|
|
173
|
-
|
|
174
|
-
:host(:not([disabled]):not(:focus-within)) .input-wrapper--empty .label {
|
|
175
|
-
--input-label-color: var(--input-label-color-empty);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
182
|
/* is size small AND has no focus AND is empty */
|
|
179
183
|
|
|
180
184
|
:host(:not(:focus-within)[size="small"]) .input-wrapper--empty .label {
|
|
@@ -317,6 +321,7 @@ const VALIDATION_MESSAGES = {
|
|
|
317
321
|
* @prop {string} maxlength - The maximum length of the input element.
|
|
318
322
|
* @prop {object} validationMessages - Custom validation messages. The key is the name of the validity state and the value is the message.
|
|
319
323
|
* @prop {boolean} novalidate - Disables the browser's validation.
|
|
324
|
+
* @prop {string} step - The step value of the input element.
|
|
320
325
|
*
|
|
321
326
|
* @fires {CustomEvent} input - Dispatched when the value of the input element changes.
|
|
322
327
|
* @fires {CustomEvent} change - Dispatched when the value of the input element changes and the input element loses focus.
|
|
@@ -335,16 +340,9 @@ class LeuInput extends LitElement {
|
|
|
335
340
|
this.disabled = false;
|
|
336
341
|
this.required = false;
|
|
337
342
|
this.clearable = false;
|
|
338
|
-
this.value = "";
|
|
339
|
-
this.name = "";
|
|
340
|
-
this.error = "";
|
|
341
|
-
this.label = "";
|
|
342
|
-
this.prefix = "";
|
|
343
|
-
this.suffix = "";
|
|
344
343
|
|
|
345
344
|
/** @type {keyof typeof SIZE_TYPES} */
|
|
346
345
|
this.size = SIZE_TYPES.REGULAR;
|
|
347
|
-
this.icon = "";
|
|
348
346
|
this.type = "text";
|
|
349
347
|
this._validity = null;
|
|
350
348
|
this.validationMessages = {};
|
|
@@ -415,7 +413,9 @@ class LeuInput extends LitElement {
|
|
|
415
413
|
* @returns {void}
|
|
416
414
|
*/
|
|
417
415
|
handleChange(event) {
|
|
418
|
-
|
|
416
|
+
if (event.target.validity.valid) {
|
|
417
|
+
this.value = event.target.value;
|
|
418
|
+
}
|
|
419
419
|
const customEvent = new CustomEvent(event.type, event);
|
|
420
420
|
this.dispatchEvent(customEvent);
|
|
421
421
|
}
|
|
@@ -430,6 +430,11 @@ class LeuInput extends LitElement {
|
|
|
430
430
|
*/
|
|
431
431
|
handleInput(event) {
|
|
432
432
|
this.value = event.target.value;
|
|
433
|
+
const customEvent = new CustomEvent("input", {
|
|
434
|
+
bubbles: true,
|
|
435
|
+
composed: true
|
|
436
|
+
});
|
|
437
|
+
this.dispatchEvent(customEvent);
|
|
433
438
|
}
|
|
434
439
|
|
|
435
440
|
/**
|
|
@@ -537,7 +542,7 @@ class LeuInput extends LitElement {
|
|
|
537
542
|
if (this.isInvalid()) {
|
|
538
543
|
return html`<div class="error-icon">${Icon("caution")}</div>`;
|
|
539
544
|
}
|
|
540
|
-
if (this.clearable && this.value
|
|
545
|
+
if (this.clearable && this.value) {
|
|
541
546
|
return html`<button
|
|
542
547
|
class="clear-button"
|
|
543
548
|
@click=${this.clear}
|
|
@@ -547,13 +552,13 @@ class LeuInput extends LitElement {
|
|
|
547
552
|
${this._clearIcon}
|
|
548
553
|
</button>`;
|
|
549
554
|
}
|
|
550
|
-
if (this.icon
|
|
555
|
+
if (this.icon) {
|
|
551
556
|
return html`<div class="icon">${Icon(this.icon)}</div>`;
|
|
552
557
|
}
|
|
553
558
|
return nothing;
|
|
554
559
|
}
|
|
555
560
|
isInvalid() {
|
|
556
|
-
if (this.error
|
|
561
|
+
if (this.error) {
|
|
557
562
|
return true;
|
|
558
563
|
}
|
|
559
564
|
return this._validity === null || this.novalidate ? false : !this._validity.valid;
|
|
@@ -562,7 +567,7 @@ class LeuInput extends LitElement {
|
|
|
562
567
|
const isInvalid = this.isInvalid();
|
|
563
568
|
const inputWrapperClasses = {
|
|
564
569
|
"input-wrapper": true,
|
|
565
|
-
"input-wrapper--empty": this.value
|
|
570
|
+
"input-wrapper--empty": !this.value,
|
|
566
571
|
"input-wrapper--invalid": isInvalid
|
|
567
572
|
};
|
|
568
573
|
|
|
@@ -584,18 +589,19 @@ class LeuInput extends LitElement {
|
|
|
584
589
|
@invalid=${this.handleInvalid}
|
|
585
590
|
?disabled=${this.disabled}
|
|
586
591
|
?required=${this.required}
|
|
592
|
+
.value=${live(this.value ?? "")}
|
|
587
593
|
pattern=${ifDefined(this.pattern)}
|
|
588
594
|
min=${ifDefined(this.min)}
|
|
589
595
|
max=${ifDefined(this.max)}
|
|
590
596
|
maxlength=${ifDefined(this.maxlength)}
|
|
591
597
|
minlength=${ifDefined(this.minlength)}
|
|
592
|
-
|
|
598
|
+
step=${ifDefined(this.step)}
|
|
593
599
|
ref=${ref(this._inputRef)}
|
|
594
600
|
aria-invalid=${isInvalid}
|
|
595
601
|
/>
|
|
596
|
-
<label for="input-${this.getId()}" class="label"
|
|
597
|
-
${this.prefix
|
|
598
|
-
${this.suffix
|
|
602
|
+
<label for="input-${this.getId()}" class="label">${this.label}</label>
|
|
603
|
+
${this.prefix ? html`<div class="prefix" .aria-hidden=${true}>${this.prefix}</div>` : nothing}
|
|
604
|
+
${this.suffix ? html`<div class="suffix" .aria-hidden=${true}>${this.suffix}</div>` : nothing}
|
|
599
605
|
${this.renderAfterContent()}
|
|
600
606
|
</div>
|
|
601
607
|
${this.renderErrorMessages()}
|
|
@@ -665,19 +671,19 @@ _defineProperty(LeuInput, "properties", {
|
|
|
665
671
|
reflect: true
|
|
666
672
|
},
|
|
667
673
|
min: {
|
|
668
|
-
type:
|
|
674
|
+
type: String,
|
|
669
675
|
reflect: true
|
|
670
676
|
},
|
|
671
677
|
max: {
|
|
672
|
-
type:
|
|
678
|
+
type: String,
|
|
673
679
|
reflect: true
|
|
674
680
|
},
|
|
675
681
|
maxlength: {
|
|
676
|
-
type:
|
|
682
|
+
type: String,
|
|
677
683
|
reflect: true
|
|
678
684
|
},
|
|
679
685
|
minlength: {
|
|
680
|
-
type:
|
|
686
|
+
type: String,
|
|
681
687
|
reflect: true
|
|
682
688
|
},
|
|
683
689
|
validationMessages: {
|
|
@@ -687,13 +693,14 @@ _defineProperty(LeuInput, "properties", {
|
|
|
687
693
|
type: Boolean,
|
|
688
694
|
reflect: true
|
|
689
695
|
},
|
|
696
|
+
step: {
|
|
697
|
+
type: String,
|
|
698
|
+
reflect: true
|
|
699
|
+
},
|
|
690
700
|
/** @type {ValidityState} */
|
|
691
701
|
_validity: {
|
|
692
702
|
state: true
|
|
693
703
|
}
|
|
694
704
|
});
|
|
695
|
-
function defineInputElements() {
|
|
696
|
-
defineElement("input", LeuInput);
|
|
697
|
-
}
|
|
698
705
|
|
|
699
|
-
export { LeuInput, SIZE_TYPES
|
|
706
|
+
export { LeuInput, SIZE_TYPES };
|
package/dist/Menu.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["Menu.js"],"names":[],"mappings":"AA0BA;;GAEG;AACH;IACE,+CAEC;CACF;2BAhCqC,KAAK"}
|
package/dist/Menu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { css, LitElement, html } from 'lit';
|
|
3
3
|
|
|
4
4
|
var css_248z = css`:host,
|
|
@@ -33,8 +33,5 @@ class LeuMenu extends LitElement {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
_defineProperty(LeuMenu, "styles", css_248z);
|
|
36
|
-
function defineMenuElements() {
|
|
37
|
-
defineElement("menu", LeuMenu);
|
|
38
|
-
}
|
|
39
36
|
|
|
40
|
-
export { LeuMenu
|
|
37
|
+
export { LeuMenu };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tagname leu-menu-item
|
|
3
|
+
* @slot - The label of the menu item
|
|
4
|
+
*/
|
|
5
|
+
export class LeuMenuItem extends LitElement {
|
|
6
|
+
static getIconOrText(name: any): any;
|
|
7
|
+
active: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* A programmatic way to highlight the menu item like it is hovered.
|
|
11
|
+
* This is just a visual effect and does not change the active state.
|
|
12
|
+
*/
|
|
13
|
+
highlighted: boolean;
|
|
14
|
+
renderBefore(): typeof nothing | import("lit-html").TemplateResult;
|
|
15
|
+
renderAfter(): typeof nothing | import("lit-html").TemplateResult;
|
|
16
|
+
getTagName(): "button" | "a";
|
|
17
|
+
render(): import("lit-html").TemplateResult;
|
|
18
|
+
}
|
|
19
|
+
import { LitElement } from 'lit';
|
|
20
|
+
import { nothing } from 'lit';
|
|
21
|
+
//# sourceMappingURL=MenuItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["MenuItem.js"],"names":[],"mappings":"AAsFA;;;GAGG;AACH;IAYE,qCAQC;IAjBC,gBAAmB;IACnB,kBAAqB;IAErB;;;OAGG;IACH,qBAAwB;IAW1B,mEAMC;IACD,kEAMC;IACD,6BAEC;IACD,4CAQC;CACF;2BAxIwC,KAAK;wBAAL,KAAK"}
|