@statistikzh/leu 0.1.0 → 0.3.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/CHANGELOG.md +31 -0
- package/README.md +27 -2
- package/dist/Button.js +24 -12
- package/dist/Checkbox.js +6 -4
- package/dist/CheckboxGroup.js +2 -1
- package/dist/{Chip-389013ff.js → Chip-5f70d04f.js} +2 -1
- package/dist/ChipGroup.js +2 -1
- package/dist/ChipLink.js +3 -2
- package/dist/ChipRemovable.js +1 -1
- package/dist/ChipSelectable.js +7 -4
- package/dist/Dropdown.js +2 -1
- package/dist/Input.js +38 -15
- package/dist/Menu.js +10 -3
- package/dist/MenuItem.js +4 -2
- package/dist/Pagination.js +4 -2
- package/dist/Radio.js +6 -4
- package/dist/RadioGroup.js +2 -1
- package/dist/Select.js +25 -8
- package/dist/Table.js +10 -5
- package/dist/index.js +1 -1
- package/dist/leu-chip-link.js +1 -1
- package/dist/leu-chip-removable.js +1 -1
- package/dist/leu-chip-selectable.js +1 -1
- package/dist/theme.css +7 -7
- package/package.json +6 -1
- package/src/components/accordion/Accordion.js +102 -0
- package/src/components/accordion/accordion.css +160 -0
- package/src/components/accordion/leu-accordion.js +3 -0
- package/src/components/accordion/stories/accordion.stories.js +55 -0
- package/src/components/accordion/test/accordion.test.js +22 -0
- package/src/components/button/Button.js +13 -13
- package/src/components/checkbox/Checkbox.js +3 -4
- package/src/components/checkbox/CheckboxGroup.js +1 -1
- package/src/components/chip/Chip.js +1 -1
- package/src/components/chip/ChipGroup.js +1 -1
- package/src/components/chip/ChipLink.js +1 -2
- package/src/components/chip/ChipSelectable.js +3 -3
- package/src/components/dropdown/Dropdown.js +1 -1
- package/src/components/input/Input.js +25 -15
- package/src/components/menu/MenuItem.js +2 -2
- package/src/components/menu/menu.css +9 -3
- package/src/components/pagination/Pagination.js +2 -2
- package/src/components/radio/Radio.js +3 -4
- package/src/components/radio/RadioGroup.js +1 -1
- package/src/components/select/Select.js +29 -9
- package/src/components/table/Table.js +5 -5
- package/src/styles/custom-properties.css +7 -7
|
@@ -27,7 +27,7 @@ export class LeuSelect extends LitElement {
|
|
|
27
27
|
return {
|
|
28
28
|
open: { type: Boolean, attribute: "open" },
|
|
29
29
|
|
|
30
|
-
label: { type: String },
|
|
30
|
+
label: { type: String, reflect: true },
|
|
31
31
|
options: { type: Array },
|
|
32
32
|
value: { type: Array },
|
|
33
33
|
clearable: { type: Boolean, reflect: true },
|
|
@@ -74,9 +74,19 @@ export class LeuSelect extends LitElement {
|
|
|
74
74
|
this.toggleButtonRef = createRef()
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
connectedCallback() {
|
|
78
|
+
super.connectedCallback()
|
|
79
|
+
document.addEventListener("click", this.handleDocumentClick)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
disconnectedCallback() {
|
|
83
|
+
super.disconnectedCallback()
|
|
84
|
+
document.removeEventListener("click", this.handleDocumentClick)
|
|
85
|
+
}
|
|
86
|
+
|
|
77
87
|
updated(changedProperties) {
|
|
78
88
|
if (changedProperties.has("open") && this.open) {
|
|
79
|
-
if (this.
|
|
89
|
+
if (this.filterable) {
|
|
80
90
|
this.optionFilterRef.value.focus()
|
|
81
91
|
} else {
|
|
82
92
|
this.menuRef.value.focus()
|
|
@@ -86,6 +96,17 @@ export class LeuSelect extends LitElement {
|
|
|
86
96
|
}
|
|
87
97
|
}
|
|
88
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Handles clicks outside of the component to close the dropdown.
|
|
101
|
+
* @internal
|
|
102
|
+
* @param {MouseEvent} event
|
|
103
|
+
*/
|
|
104
|
+
handleDocumentClick = (event) => {
|
|
105
|
+
if (!this.contains(event.target) && this.open) {
|
|
106
|
+
this.closeDropdown()
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
89
110
|
/**
|
|
90
111
|
* @internal
|
|
91
112
|
* @param {KeyboardEvent} e
|
|
@@ -143,12 +164,6 @@ export class LeuSelect extends LitElement {
|
|
|
143
164
|
this.emitUpdateEvents()
|
|
144
165
|
}
|
|
145
166
|
|
|
146
|
-
clearOptionFilter() {
|
|
147
|
-
// refocus before removing the button, otherwise closeDropdown is triggered
|
|
148
|
-
this.optionFilterRef.value.focus()
|
|
149
|
-
this.optionFilter = ""
|
|
150
|
-
}
|
|
151
|
-
|
|
152
167
|
toggleDropdown() {
|
|
153
168
|
if (!this.disabled) {
|
|
154
169
|
this.open = !this.open
|
|
@@ -242,7 +257,11 @@ export class LeuSelect extends LitElement {
|
|
|
242
257
|
${LeuSelect.getOptionLabel(option)}
|
|
243
258
|
</leu-menu-item>`
|
|
244
259
|
})
|
|
245
|
-
: html`<leu-menu-item disabled
|
|
260
|
+
: html`<leu-menu-item disabled
|
|
261
|
+
>${this.optionFilter === ""
|
|
262
|
+
? "Keine Optionen"
|
|
263
|
+
: "Keine Resultate"}</leu-menu-item
|
|
264
|
+
>`}
|
|
246
265
|
</leu-menu>
|
|
247
266
|
`
|
|
248
267
|
}
|
|
@@ -254,6 +273,7 @@ export class LeuSelect extends LitElement {
|
|
|
254
273
|
size="small"
|
|
255
274
|
@input=${this.handleFilterInput}
|
|
256
275
|
clearable
|
|
276
|
+
ref=${ref(this.optionFilterRef)}
|
|
257
277
|
>Nach Stichwort filtern</leu-input
|
|
258
278
|
>`
|
|
259
279
|
}
|
|
@@ -101,11 +101,11 @@ export class LeuTable extends LitElement {
|
|
|
101
101
|
static properties = {
|
|
102
102
|
columns: { type: Array },
|
|
103
103
|
data: { type: Array },
|
|
104
|
-
firstColumnSticky: { type: Boolean },
|
|
105
|
-
itemsOnAPage: { type: Number },
|
|
106
|
-
sortIndex: { type: Number },
|
|
107
|
-
sortOrderAsc: { type: Boolean },
|
|
108
|
-
width: { type: Number },
|
|
104
|
+
firstColumnSticky: { type: Boolean, reflect: true },
|
|
105
|
+
itemsOnAPage: { type: Number, reflect: true },
|
|
106
|
+
sortIndex: { type: Number, reflect: true },
|
|
107
|
+
sortOrderAsc: { type: Boolean, reflect: true },
|
|
108
|
+
width: { type: Number, reflect: true },
|
|
109
109
|
|
|
110
110
|
_shadowLeft: { type: Boolean, state: true },
|
|
111
111
|
_shadowRight: { type: Boolean, state: true },
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
--leu-color-accent-violet: #7f3da7;
|
|
30
30
|
--leu-color-accent-gray: var(--leu-color-black-60);
|
|
31
31
|
|
|
32
|
-
--leu-color-accent-blue-soft:
|
|
33
|
-
--leu-color-accent-darkblue-soft:
|
|
34
|
-
--leu-color-accent-turquoise-soft:
|
|
35
|
-
--leu-color-accent-green-soft:
|
|
36
|
-
--leu-color-accent-bordeaux-soft:
|
|
37
|
-
--leu-color-accent-magenta-soft:
|
|
38
|
-
--leu-color-accent-violet-soft:
|
|
32
|
+
--leu-color-accent-blue-soft: #edf5fa;
|
|
33
|
+
--leu-color-accent-darkblue-soft: #e0e8ee;
|
|
34
|
+
--leu-color-accent-turquoise-soft: #e8f3f2;
|
|
35
|
+
--leu-color-accent-green-soft: #ebf6eb;
|
|
36
|
+
--leu-color-accent-bordeaux-soft: #f6e3ea;
|
|
37
|
+
--leu-color-accent-magenta-soft: #fcedf3;
|
|
38
|
+
--leu-color-accent-violet-soft: #ece2f1;
|
|
39
39
|
--leu-color-accent-gray-soft: var(--leu-color-black-10);
|
|
40
40
|
|
|
41
41
|
--leu-color-func-cyan: #009ee0;
|