@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/ButtonGroup.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @prop {string} value - The value of the currenty selected (active) button
|
|
5
5
|
* @fires input - When the value of the group changes by clicking a button
|
|
6
6
|
*/
|
|
7
|
-
export class LeuButtonGroup extends
|
|
7
|
+
export class LeuButtonGroup extends LeuElement {
|
|
8
8
|
/**
|
|
9
9
|
* @param {import("../button/Button").LeuButton} button
|
|
10
10
|
* @returns {string}
|
|
@@ -20,5 +20,5 @@ export class LeuButtonGroup extends LitElement {
|
|
|
20
20
|
_handleButtonClick(button: any): void;
|
|
21
21
|
render(): import("lit-html").TemplateResult<1>;
|
|
22
22
|
}
|
|
23
|
-
import {
|
|
23
|
+
import { L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
24
24
|
//# sourceMappingURL=ButtonGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["ButtonGroup.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH;IAME;;;OAGG;IACH,oCAFa,MAAM,CAIlB;IATC,cAAgB;IAclB,4BAMC;IAVD,oBAGC;IAQD,0BA+BC;IAED;;OAEG;IACH,sCAWC;IACD,+CAMC;CACF;
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["ButtonGroup.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH;IAME;;;OAGG;IACH,oCAFa,MAAM,CAIlB;IATC,cAAgB;IAclB,4BAMC;IAVD,oBAGC;IAQD,0BA+BC;IAED;;OAEG;IACH,sCAWC;IACD,+CAMC;CACF;gCApGqD,0BAA0B"}
|
package/dist/ButtonGroup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _defineProperty } from './
|
|
2
|
-
import { css,
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
2
|
+
import { css, html } from 'lit';
|
|
3
3
|
|
|
4
4
|
var css_248z = css`:host,
|
|
5
5
|
:host * {
|
|
@@ -19,7 +19,7 @@ var css_248z = css`:host,
|
|
|
19
19
|
* @prop {string} value - The value of the currenty selected (active) button
|
|
20
20
|
* @fires input - When the value of the group changes by clicking a button
|
|
21
21
|
*/
|
|
22
|
-
class LeuButtonGroup extends
|
|
22
|
+
class LeuButtonGroup extends LeuElement {
|
|
23
23
|
constructor() {
|
|
24
24
|
super();
|
|
25
25
|
this._items = [];
|
package/dist/Checkbox.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @tagname leu-checkbox
|
|
3
3
|
*/
|
|
4
|
-
export class LeuCheckbox extends
|
|
4
|
+
export class LeuCheckbox extends LeuElement {
|
|
5
5
|
checked: boolean;
|
|
6
6
|
disabled: boolean;
|
|
7
|
-
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
8
9
|
handleChange(event: any): void;
|
|
9
10
|
handleInput(event: any): void;
|
|
10
11
|
render(): import("lit-html").TemplateResult<1>;
|
|
11
12
|
}
|
|
12
|
-
import {
|
|
13
|
+
import { L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
13
14
|
//# sourceMappingURL=Checkbox.d.ts.map
|
package/dist/Checkbox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["Checkbox.js"],"names":[],"mappings":"AAiGA;;GAEG;AACH;IAGI,iBAAoB;IACpB,kBAAqB;IACrB,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["Checkbox.js"],"names":[],"mappings":"AAiGA;;GAEG;AACH;IAGI,iBAAoB;IACpB,kBAAqB;IACrB,aAAc;IACd,cAAe;IAEjB,+BAIC;IACD,8BAEC;IACD,+CAgBC;CACF;gCArIqD,0BAA0B"}
|
package/dist/Checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _defineProperty } from './
|
|
2
|
-
import { css,
|
|
3
|
-
import {
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
2
|
+
import { css, html } from 'lit';
|
|
3
|
+
import { LeuIcon } from './Icon.js';
|
|
4
4
|
|
|
5
5
|
var css_248z = css`:host {
|
|
6
6
|
--checkbox-color: var(--leu-color-black-40);
|
|
@@ -98,12 +98,13 @@ var css_248z = css`:host {
|
|
|
98
98
|
/**
|
|
99
99
|
* @tagname leu-checkbox
|
|
100
100
|
*/
|
|
101
|
-
class LeuCheckbox extends
|
|
101
|
+
class LeuCheckbox extends LeuElement {
|
|
102
102
|
constructor() {
|
|
103
103
|
super();
|
|
104
104
|
this.checked = false;
|
|
105
105
|
this.disabled = false;
|
|
106
|
-
this.
|
|
106
|
+
this.name = "";
|
|
107
|
+
this.value = "";
|
|
107
108
|
}
|
|
108
109
|
handleChange(event) {
|
|
109
110
|
this.checked = event.target.checked;
|
|
@@ -116,7 +117,7 @@ class LeuCheckbox extends LitElement {
|
|
|
116
117
|
render() {
|
|
117
118
|
return html`
|
|
118
119
|
<input
|
|
119
|
-
id=${this.
|
|
120
|
+
id=${`checkbox-${this.name}`}
|
|
120
121
|
class="checkbox"
|
|
121
122
|
type="checkbox"
|
|
122
123
|
name="${this.name}"
|
|
@@ -126,14 +127,18 @@ class LeuCheckbox extends LitElement {
|
|
|
126
127
|
?disabled=${this.disabled}
|
|
127
128
|
.value=${this.value}
|
|
128
129
|
/>
|
|
129
|
-
<label for=${this.
|
|
130
|
-
<
|
|
130
|
+
<label for=${`checkbox-${this.name}`} class="label"><slot></slot></label>
|
|
131
|
+
<leu-icon class="icon" name="check"></leu-icon>
|
|
131
132
|
`;
|
|
132
133
|
}
|
|
133
134
|
}
|
|
135
|
+
_defineProperty(LeuCheckbox, "dependencies", {
|
|
136
|
+
"leu-icon": LeuIcon
|
|
137
|
+
});
|
|
134
138
|
_defineProperty(LeuCheckbox, "styles", css_248z);
|
|
139
|
+
/** @internal */
|
|
135
140
|
_defineProperty(LeuCheckbox, "shadowRootOptions", {
|
|
136
|
-
...
|
|
141
|
+
...LeuElement.shadowRootOptions,
|
|
137
142
|
delegatesFocus: true
|
|
138
143
|
});
|
|
139
144
|
_defineProperty(LeuCheckbox, "properties", {
|
|
@@ -145,10 +150,6 @@ _defineProperty(LeuCheckbox, "properties", {
|
|
|
145
150
|
type: Boolean,
|
|
146
151
|
reflect: true
|
|
147
152
|
},
|
|
148
|
-
identifier: {
|
|
149
|
-
type: String,
|
|
150
|
-
reflect: true
|
|
151
|
-
},
|
|
152
153
|
value: {
|
|
153
154
|
type: String,
|
|
154
155
|
reflect: true
|
|
@@ -156,10 +157,6 @@ _defineProperty(LeuCheckbox, "properties", {
|
|
|
156
157
|
name: {
|
|
157
158
|
type: String,
|
|
158
159
|
reflect: true
|
|
159
|
-
},
|
|
160
|
-
label: {
|
|
161
|
-
type: String,
|
|
162
|
-
reflect: true
|
|
163
160
|
}
|
|
164
161
|
});
|
|
165
162
|
|
package/dist/CheckboxGroup.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @tagname leu-checkbox-group
|
|
3
3
|
*/
|
|
4
|
-
export class LeuCheckboxGroup extends
|
|
4
|
+
export class LeuCheckboxGroup extends LeuElement {
|
|
5
5
|
orientation: string;
|
|
6
6
|
items: any[];
|
|
7
7
|
get value(): any[];
|
|
@@ -9,5 +9,5 @@ export class LeuCheckboxGroup extends LitElement {
|
|
|
9
9
|
handleItems(): void;
|
|
10
10
|
render(): import("lit-html").TemplateResult<1>;
|
|
11
11
|
}
|
|
12
|
-
import {
|
|
12
|
+
import { L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
13
13
|
//# sourceMappingURL=CheckboxGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["CheckboxGroup.js"],"names":[],"mappings":"AAqCA;;GAEG;AACH;IAGI,oBAA+B;IAC/B,aAAe;IAEjB,mBAEC;IACD,yBAEC;IACD,oBAEC;IACD,+CAWC;CACF;
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["CheckboxGroup.js"],"names":[],"mappings":"AAqCA;;GAEG;AACH;IAGI,oBAA+B;IAC/B,aAAe;IAEjB,mBAEC;IACD,yBAEC;IACD,oBAEC;IACD,+CAWC;CACF;gCAnEqD,0BAA0B"}
|
package/dist/CheckboxGroup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _defineProperty } from './
|
|
2
|
-
import { css,
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
2
|
+
import { css, html } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
|
|
5
5
|
var css_248z = css`:host {
|
|
@@ -38,7 +38,7 @@ var css_248z = css`:host {
|
|
|
38
38
|
/**
|
|
39
39
|
* @tagname leu-checkbox-group
|
|
40
40
|
*/
|
|
41
|
-
class LeuCheckboxGroup extends
|
|
41
|
+
class LeuCheckboxGroup extends LeuElement {
|
|
42
42
|
constructor() {
|
|
43
43
|
super();
|
|
44
44
|
this.orientation = "HORIZONTAL";
|
|
@@ -51,7 +51,7 @@ class LeuCheckboxGroup extends LitElement {
|
|
|
51
51
|
this.handleItems();
|
|
52
52
|
}
|
|
53
53
|
handleItems() {
|
|
54
|
-
this.items =
|
|
54
|
+
this.items = Array.from(this.querySelectorAll(":scope > *:not([slot])"));
|
|
55
55
|
}
|
|
56
56
|
render() {
|
|
57
57
|
const fieldsetClasses = {
|
package/dist/Chip.d.ts
CHANGED
package/dist/Chip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["Chip.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["Chip.js"],"names":[],"mappings":"AAwJA;IAGI,kBAAqB;CAExB;gCA7JqD,0BAA0B"}
|
package/dist/Chip.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _defineProperty } from './
|
|
2
|
-
import { css
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
2
|
+
import { css } from 'lit';
|
|
3
3
|
|
|
4
4
|
var css_248z = css`:host,
|
|
5
5
|
:host *,
|
|
@@ -11,17 +11,17 @@ var css_248z = css`:host,
|
|
|
11
11
|
:host {
|
|
12
12
|
--chip-background-color-default: var(--leu-color-black-transp-10);
|
|
13
13
|
--chip-background-color-hover: var(--leu-color-black-transp-20);
|
|
14
|
-
--chip-background-color-
|
|
15
|
-
--chip-background-color-
|
|
14
|
+
--chip-background-color-checked: var(--leu-color-black-100);
|
|
15
|
+
--chip-background-color-checked-hover: var(--leu-color-black-transp-80);
|
|
16
16
|
|
|
17
17
|
--chip-color-default: var(--leu-color-black-transp-60);
|
|
18
18
|
--chip-color-hover: var(--leu-color-black-100);
|
|
19
|
-
--chip-color-
|
|
19
|
+
--chip-color-checked: var(--leu-color-black-0);
|
|
20
20
|
|
|
21
21
|
--chip-radio-border-default: var(--leu-color-black-transp-40);
|
|
22
|
-
--chip-radio-border-
|
|
22
|
+
--chip-radio-border-checked: var(--leu-color-black-0);
|
|
23
23
|
--chip-radio-background-default: var(--leu-color-black-0);
|
|
24
|
-
--chip-radio-background-
|
|
24
|
+
--chip-radio-background-checked: var(--leu-color-func-cyan);
|
|
25
25
|
|
|
26
26
|
--chip-font-regular: var(--leu-font-family-regular);
|
|
27
27
|
--chip-font-black: var(--leu-font-family-black);
|
|
@@ -31,6 +31,8 @@ var css_248z = css`:host,
|
|
|
31
31
|
--chip-radio-border: var(--chip-radio-border-default);
|
|
32
32
|
--chip-radio-background: var(--chip-radio-background-default);
|
|
33
33
|
|
|
34
|
+
--leu-icon-size: 1rem;
|
|
35
|
+
|
|
34
36
|
font-family: var(--leu-font-family-regular);
|
|
35
37
|
|
|
36
38
|
font-family: var(--chip-font-regular);
|
|
@@ -45,14 +47,14 @@ var css_248z = css`:host,
|
|
|
45
47
|
|
|
46
48
|
--chip-color-default: var(--leu-color-black-0);
|
|
47
49
|
--chip-color-hover: var(--leu-color-black-0);
|
|
48
|
-
--chip-color-
|
|
50
|
+
--chip-color-checked: var(--leu-color-black-0);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
:host([
|
|
52
|
-
--chip-background-color: var(--chip-background-color-
|
|
53
|
-
--chip-color: var(--chip-color-
|
|
54
|
-
--chip-radio-border: var(--chip-radio-border-
|
|
55
|
-
--chip-radio-background: var(--chip-radio-background-
|
|
53
|
+
:host([checked]) {
|
|
54
|
+
--chip-background-color: var(--chip-background-color-checked);
|
|
55
|
+
--chip-color: var(--chip-color-checked);
|
|
56
|
+
--chip-radio-border: var(--chip-radio-border-checked);
|
|
57
|
+
--chip-radio-background: var(--chip-radio-background-checked);
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
.button {
|
|
@@ -65,6 +67,7 @@ var css_248z = css`:host,
|
|
|
65
67
|
padding: 0.5rem 1rem;
|
|
66
68
|
|
|
67
69
|
color: var(--chip-color);
|
|
70
|
+
font-family: inherit;
|
|
68
71
|
font-size: 0.875rem;
|
|
69
72
|
line-height: 1rem;
|
|
70
73
|
|
|
@@ -100,10 +103,10 @@ var css_248z = css`:host,
|
|
|
100
103
|
text-decoration: none;
|
|
101
104
|
}
|
|
102
105
|
|
|
103
|
-
:host([
|
|
104
|
-
:host([
|
|
105
|
-
--chip-background-color: var(--chip-background-color-
|
|
106
|
-
--chip-color: var(--chip-color-
|
|
106
|
+
:host([checked]) .button:hover,
|
|
107
|
+
:host([checked]) .button:focus-visible {
|
|
108
|
+
--chip-background-color: var(--chip-background-color-checked-hover);
|
|
109
|
+
--chip-color: var(--chip-color-checked);
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
:host([href][size="large"]) .button {
|
|
@@ -131,7 +134,7 @@ var css_248z = css`:host,
|
|
|
131
134
|
border-radius: 50%;
|
|
132
135
|
}
|
|
133
136
|
|
|
134
|
-
:host([variant="radio"][
|
|
137
|
+
:host([variant="radio"][checked]) .button::before {
|
|
135
138
|
border-width: 3px;
|
|
136
139
|
}
|
|
137
140
|
|
|
@@ -143,15 +146,11 @@ var css_248z = css`:host,
|
|
|
143
146
|
text-overflow: ellipsis;
|
|
144
147
|
white-space: nowrap;
|
|
145
148
|
}
|
|
146
|
-
|
|
147
|
-
.icon svg {
|
|
148
|
-
display: block;
|
|
149
|
-
}
|
|
150
149
|
`;
|
|
151
150
|
|
|
152
151
|
/* Design: https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=21161-184433&mode=design&t=Kjo5VDiqivihn8dh-11 */
|
|
153
152
|
|
|
154
|
-
class LeuChipBase extends
|
|
153
|
+
class LeuChipBase extends LeuElement {
|
|
155
154
|
constructor() {
|
|
156
155
|
super();
|
|
157
156
|
this.inverted = false;
|
|
@@ -160,17 +159,13 @@ class LeuChipBase extends LitElement {
|
|
|
160
159
|
_defineProperty(LeuChipBase, "styles", css_248z);
|
|
161
160
|
/** @internal */
|
|
162
161
|
_defineProperty(LeuChipBase, "shadowRootOptions", {
|
|
163
|
-
...
|
|
162
|
+
...LeuElement.shadowRootOptions,
|
|
164
163
|
delegatesFocus: true
|
|
165
164
|
});
|
|
166
165
|
_defineProperty(LeuChipBase, "properties", {
|
|
167
166
|
inverted: {
|
|
168
167
|
type: Boolean,
|
|
169
168
|
reflect: true
|
|
170
|
-
},
|
|
171
|
-
label: {
|
|
172
|
-
type: String,
|
|
173
|
-
reflect: true
|
|
174
169
|
}
|
|
175
170
|
});
|
|
176
171
|
|
package/dist/ChipGroup.d.ts
CHANGED
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
* @cssproperty --leu-chip-group-gap - The gap between the chips
|
|
4
4
|
* @tagname leu-chip-group
|
|
5
5
|
*/
|
|
6
|
-
export class LeuChipGroup extends
|
|
6
|
+
export class LeuChipGroup extends LeuElement {
|
|
7
7
|
items: any[];
|
|
8
8
|
inverted: boolean;
|
|
9
9
|
headingLevel: number;
|
|
10
10
|
label: string;
|
|
11
|
-
|
|
11
|
+
/** @type {"single" | "multiple" | "none"} */
|
|
12
|
+
selectionMode: "single" | "multiple" | "none";
|
|
13
|
+
/**
|
|
14
|
+
* Checks the items with the given values.
|
|
15
|
+
* If the selectionMode is single, only the first item with the given value is checked.
|
|
16
|
+
* @param {string[]} valueList
|
|
17
|
+
*/
|
|
18
|
+
set value(valueList: string[]);
|
|
19
|
+
get value(): string[];
|
|
12
20
|
/**
|
|
13
21
|
* Determines the heading tag of the accordion toggle.
|
|
14
22
|
* The headingLevel shouldn't be used directly to render the heading tag
|
|
@@ -19,10 +27,10 @@ export class LeuChipGroup extends LitElement {
|
|
|
19
27
|
_getHeadingTag(): string;
|
|
20
28
|
render(): import("lit-html").TemplateResult;
|
|
21
29
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
import {
|
|
30
|
+
export const SELECTION_MODES: Readonly<{
|
|
31
|
+
single: "single";
|
|
32
|
+
multiple: "multiple";
|
|
33
|
+
none: "none";
|
|
34
|
+
}>;
|
|
35
|
+
import { L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
28
36
|
//# sourceMappingURL=ChipGroup.d.ts.map
|
package/dist/ChipGroup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipGroup.d.ts","sourceRoot":"","sources":["ChipGroup.js"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH;IAiBM,aAAkB;IAEpB,kBAAqB;IACrB,qBAAqB;IACrB,cAAe;
|
|
1
|
+
{"version":3,"file":"ChipGroup.d.ts","sourceRoot":"","sources":["ChipGroup.js"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH;IAiBM,aAAkB;IAEpB,kBAAqB;IACrB,qBAAqB;IACrB,cAAe;IAKf,6CAA6C;IAC7C,eADW,QAAQ,GAAG,UAAU,GAAG,MAAM,CACA;IA0B3C;;;;OAIG;IACH,+BAQC;IAjBD,sBAEC;IAiBD;;;;;;OAMG;IACH,yBAMC;IACD,4CAeC;CACF;AA7GD;;;;GAIG;gCA5BmD,0BAA0B"}
|
package/dist/ChipGroup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _defineProperty } from './
|
|
2
|
-
import { css, LitElement } from 'lit';
|
|
1
|
+
import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
|
|
3
2
|
import { html, unsafeStatic } from 'lit/static-html.js';
|
|
3
|
+
import { css } from 'lit';
|
|
4
4
|
|
|
5
5
|
var css_248z = css`.label {
|
|
6
6
|
margin: 0 0 0.5rem;
|
|
@@ -22,25 +22,25 @@ var css_248z = css`.label {
|
|
|
22
22
|
|
|
23
23
|
/* Figma https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=131766-248643&mode=design&t=Kjo5VDiqivihn8dh-11 */
|
|
24
24
|
|
|
25
|
-
const SELECTION_MODES = {
|
|
25
|
+
const SELECTION_MODES = Object.freeze({
|
|
26
26
|
single: "single",
|
|
27
27
|
multiple: "multiple",
|
|
28
28
|
none: "none"
|
|
29
|
-
};
|
|
29
|
+
});
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* @slot - Place leu-chip-* elements inside this slot
|
|
33
33
|
* @cssproperty --leu-chip-group-gap - The gap between the chips
|
|
34
34
|
* @tagname leu-chip-group
|
|
35
35
|
*/
|
|
36
|
-
class LeuChipGroup extends
|
|
36
|
+
class LeuChipGroup extends LeuElement {
|
|
37
37
|
constructor() {
|
|
38
38
|
super();
|
|
39
39
|
/** @internal */
|
|
40
40
|
_defineProperty(this, "handleInput", e => {
|
|
41
41
|
if (this.selectionMode === SELECTION_MODES.single) {
|
|
42
42
|
this.items.forEach(item => {
|
|
43
|
-
item.
|
|
43
|
+
item.checked = item === e.target; // eslint-disable-line no-param-reassign
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
});
|
|
@@ -58,17 +58,47 @@ class LeuChipGroup extends LitElement {
|
|
|
58
58
|
|
|
59
59
|
/** @internal */
|
|
60
60
|
this.items = [];
|
|
61
|
+
|
|
62
|
+
/** @type {"single" | "multiple" | "none"} */
|
|
63
|
+
this.selectionMode = SELECTION_MODES.none;
|
|
61
64
|
}
|
|
62
65
|
connectedCallback() {
|
|
63
66
|
super.connectedCallback();
|
|
64
|
-
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* It is technically possible to add an event listener to the host element
|
|
70
|
+
* before it is connected to the dom. In that case the outside event listener would
|
|
71
|
+
* be called before the following event listener. But at this point multiple
|
|
72
|
+
* radio chips could be selected at the same time because `handleInput` hasn't been
|
|
73
|
+
* called yet. That's why we use the capture phase.
|
|
74
|
+
*/
|
|
75
|
+
this.addEventListener("input", this.handleInput, {
|
|
76
|
+
capture: true
|
|
77
|
+
});
|
|
65
78
|
}
|
|
66
79
|
disconnectedCallback() {
|
|
67
80
|
super.disconnectedCallback();
|
|
68
|
-
this.removeEventListener("input", this.handleInput
|
|
81
|
+
this.removeEventListener("input", this.handleInput, {
|
|
82
|
+
capture: true
|
|
83
|
+
});
|
|
69
84
|
}
|
|
70
85
|
get value() {
|
|
71
|
-
return this.items.filter(i => i.
|
|
86
|
+
return this.items.filter(i => i.checked).map(i => i.value);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Checks the items with the given values.
|
|
91
|
+
* If the selectionMode is single, only the first item with the given value is checked.
|
|
92
|
+
* @param {string[]} valueList
|
|
93
|
+
*/
|
|
94
|
+
set value(valueList) {
|
|
95
|
+
let hasChanged = false;
|
|
96
|
+
for (const item of this.items) {
|
|
97
|
+
item.checked = hasChanged ? false : valueList.includes(item.value);
|
|
98
|
+
if (this.selectionMode === SELECTION_MODES.single && item.checked) {
|
|
99
|
+
hasChanged = true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
72
102
|
}
|
|
73
103
|
|
|
74
104
|
/**
|
package/dist/ChipLink.d.ts
CHANGED
package/dist/ChipLink.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipLink.d.ts","sourceRoot":"","sources":["ChipLink.js"],"names":[],"mappings":"AASA
|
|
1
|
+
{"version":3,"file":"ChipLink.d.ts","sourceRoot":"","sources":["ChipLink.js"],"names":[],"mappings":"AASA;;;;GAIG;AACH;IAII,aAAyB;IACzB,aAAc;IAEhB,+CAIC;CACF;;;;;4BAxB2B,WAAW"}
|
package/dist/ChipLink.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
|
|
|
@@ -8,8 +8,9 @@ const SIZES = {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @slot - The content of the chip
|
|
12
11
|
* @tagname leu-chip-link
|
|
12
|
+
* @slot - The content of the chip
|
|
13
|
+
* @prop {keyof typeof SIZES} size - The size of the chip
|
|
13
14
|
*/
|
|
14
15
|
class LeuChipLink extends LeuChipBase {
|
|
15
16
|
constructor() {
|
|
@@ -20,16 +21,12 @@ class LeuChipLink extends LeuChipBase {
|
|
|
20
21
|
}
|
|
21
22
|
render() {
|
|
22
23
|
return html`<a href=${this.href} class="button">
|
|
23
|
-
<span class="label"
|
|
24
|
+
<span class="label"><slot></slot></span>
|
|
24
25
|
</a>`;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
_defineProperty(LeuChipLink, "properties", {
|
|
28
29
|
...LeuChipBase.properties,
|
|
29
|
-
/**
|
|
30
|
-
* The size of the chip
|
|
31
|
-
* @type {keyof typeof SIZES}
|
|
32
|
-
*/
|
|
33
30
|
size: {
|
|
34
31
|
type: String,
|
|
35
32
|
reflect: true
|
package/dist/ChipRemovable.d.ts
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* @fires remove - Dispatched when the user clicks on the chip
|
|
5
5
|
*/
|
|
6
6
|
export class LeuChipRemovable extends LeuChipBase {
|
|
7
|
-
/** @internal */
|
|
8
|
-
_removeIcon: import("lit-html").TemplateResult<1>;
|
|
9
7
|
handleClick(): void;
|
|
10
8
|
render(): import("lit-html").TemplateResult<1>;
|
|
11
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipRemovable.d.ts","sourceRoot":"","sources":["ChipRemovable.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"ChipRemovable.d.ts","sourceRoot":"","sources":["ChipRemovable.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH;IACE,oBAMC;IACD,+CAKC;CACF;4BAtB2B,WAAW"}
|
package/dist/ChipRemovable.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
import {
|
|
4
|
+
import { LeuIcon } from './Icon.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @slot - The content of the chip
|
|
@@ -9,26 +9,23 @@ import { I as Icon } from './icon-03e86700.js';
|
|
|
9
9
|
* @fires remove - Dispatched when the user clicks on the chip
|
|
10
10
|
*/
|
|
11
11
|
class LeuChipRemovable extends LeuChipBase {
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
|
|
15
|
-
/** @internal */
|
|
16
|
-
this._removeIcon = Icon("close", 16);
|
|
17
|
-
}
|
|
18
12
|
handleClick() {
|
|
19
13
|
const customEvent = new CustomEvent("leu:remove", {
|
|
20
|
-
|
|
14
|
+
bubbles: true,
|
|
21
15
|
composed: true
|
|
22
16
|
});
|
|
23
17
|
this.dispatchEvent(customEvent);
|
|
24
18
|
}
|
|
25
19
|
render() {
|
|
26
20
|
return html`<button @click=${e => this.handleClick(e)} class="button">
|
|
27
|
-
<span class="label"
|
|
28
|
-
<
|
|
21
|
+
<span class="label"><slot></slot></span>
|
|
22
|
+
<leu-icon name="close" class="icon"></leu-icon>
|
|
29
23
|
</button>`;
|
|
30
24
|
}
|
|
31
25
|
}
|
|
26
|
+
_defineProperty(LeuChipRemovable, "dependencies", {
|
|
27
|
+
"leu-icon": LeuIcon
|
|
28
|
+
});
|
|
32
29
|
_defineProperty(LeuChipRemovable, "properties", {
|
|
33
30
|
...LeuChipBase.properties
|
|
34
31
|
});
|
package/dist/ChipSelectable.d.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A chip component that can be selected.
|
|
3
|
-
* @slot - The content of the chip
|
|
4
3
|
* @tagname leu-chip-selectable
|
|
4
|
+
* @slot - The content of the chip
|
|
5
|
+
* @prop {keyof typeof SIZES} size - The size of the chip. Not supported for radio variant.
|
|
6
|
+
* @prop {keyof typeof VARIANTS} variant - `toggle` or `radio`. Determines if only one or multiple chips can be selected.
|
|
7
|
+
* @prop {boolean} checked - Whether the chip is selected.
|
|
8
|
+
* @prop {string} value - The value of the chip.
|
|
5
9
|
*/
|
|
6
10
|
export class LeuChipSelectable extends LeuChipBase {
|
|
7
11
|
size: string;
|
|
12
|
+
/**
|
|
13
|
+
* The variant of the chip. Has an effect not only on the visual appearance but also on the behavior.
|
|
14
|
+
* - `toggle`: The chip behaves like a toggle button.
|
|
15
|
+
* - `radio`: The chip behaves like a radio button.
|
|
16
|
+
* @default "toggle"
|
|
17
|
+
*/
|
|
8
18
|
variant: string;
|
|
9
|
-
|
|
19
|
+
checked: boolean;
|
|
10
20
|
handleClick(): void;
|
|
11
21
|
render(): import("lit-html").TemplateResult<1>;
|
|
12
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipSelectable.d.ts","sourceRoot":"","sources":["ChipSelectable.js"],"names":[],"mappings":"AAaA
|
|
1
|
+
{"version":3,"file":"ChipSelectable.d.ts","sourceRoot":"","sources":["ChipSelectable.js"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AACH;IAGI,aAAyB;IAEzB;;;;;OAKG;IACH,gBAA8B;IAC9B,iBAAoB;IAKtB,oBAiBC;IACD,+CAQC;CACF;;;;;;;;;4BAhE2B,WAAW"}
|