@statistikzh/leu 0.2.0 → 0.4.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 -5
- package/.storybook/static/logo.svg +19 -0
- package/.storybook/theme.js +7 -0
- package/CHANGELOG.md +43 -0
- package/README.md +1 -1
- package/dist/Button.js +39 -30
- package/dist/ButtonGroup.js +5 -7
- package/dist/Checkbox.js +107 -88
- package/dist/CheckboxGroup.js +43 -38
- package/dist/{Chip-389013ff.js → Chip-dac7337d.js} +7 -2
- package/dist/ChipGroup.js +4 -6
- package/dist/ChipLink.js +6 -8
- package/dist/ChipRemovable.js +4 -7
- package/dist/ChipSelectable.js +10 -10
- package/dist/Dropdown.js +57 -27
- package/dist/Input.js +59 -43
- package/dist/Menu.js +2 -5
- package/dist/MenuItem.js +34 -17
- package/dist/Pagination.js +57 -55
- package/dist/Radio.js +13 -10
- package/dist/RadioGroup.js +43 -40
- package/dist/Select.js +57 -44
- package/dist/Table.js +147 -125
- package/dist/{defineElement-ba770aed.js → _rollupPluginBabelHelpers-20f659f4.js} +1 -15
- package/dist/defineElement-47d4f665.js +15 -0
- package/dist/index.js +29 -19
- package/dist/leu-button-group.js +7 -3
- package/dist/leu-button.js +6 -3
- package/dist/leu-checkbox-group.js +6 -3
- package/dist/leu-checkbox.js +6 -3
- package/dist/leu-chip-group.js +6 -3
- package/dist/leu-chip-link.js +7 -4
- package/dist/leu-chip-removable.js +7 -4
- package/dist/leu-chip-selectable.js +7 -4
- package/dist/leu-dropdown.js +13 -3
- package/dist/leu-input.js +7 -3
- package/dist/leu-menu-item.js +8 -3
- package/dist/leu-menu.js +6 -3
- package/dist/leu-pagination.js +8 -3
- package/dist/leu-popup-4bf6f1f4.js +216 -0
- package/dist/leu-radio-group.js +6 -3
- package/dist/leu-radio.js +6 -3
- package/dist/leu-select.js +14 -3
- package/dist/leu-table.js +9 -3
- package/package.json +29 -12
- package/scripts/generate-component/templates/[Name].js +0 -5
- package/scripts/generate-component/templates/[name].css +1 -1
- package/scripts/generate-component/templates/[namespace]-[name].js +5 -2
- package/src/components/accordion/Accordion.js +3 -9
- package/src/components/accordion/leu-accordion.js +5 -2
- package/src/components/accordion/stories/accordion.stories.js +7 -4
- package/src/components/accordion/test/accordion.test.js +92 -2
- package/src/components/breadcrumb/Breadcrumb.js +310 -0
- package/src/components/breadcrumb/breadcrumb.css +114 -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 +22 -27
- package/src/components/button/button.css +3 -3
- package/src/components/button/leu-button.js +5 -2
- package/src/components/button/stories/button.stories.js +58 -37
- package/src/components/button/test/button.test.js +112 -2
- package/src/components/button-group/ButtonGroup.js +1 -7
- package/src/components/button-group/leu-button-group.js +5 -2
- package/src/components/button-group/stories/button-group.stories.js +6 -0
- package/src/components/button-group/test/button-group.test.js +79 -3
- package/src/components/checkbox/Checkbox.js +9 -89
- package/src/components/checkbox/CheckboxGroup.js +9 -39
- 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 +2 -1
- package/src/components/chip/ChipGroup.js +1 -6
- package/src/components/chip/ChipLink.js +2 -8
- package/src/components/chip/ChipRemovable.js +1 -6
- package/src/components/chip/ChipSelectable.js +4 -9
- 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 +18 -6
- 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 +53 -25
- 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 +33 -39
- package/src/components/input/input.css +9 -6
- package/src/components/input/leu-input.js +5 -2
- package/src/components/input/stories/input.stories.js +8 -2
- package/src/components/input/test/input.test.js +431 -4
- package/src/components/menu/Menu.js +0 -5
- package/src/components/menu/MenuItem.js +22 -15
- 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 +5 -2
- 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 +53 -65
- package/src/components/pagination/leu-pagination.js +5 -2
- package/src/components/pagination/stories/pagination.stories.js +17 -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 +5 -10
- package/src/components/radio/RadioGroup.js +7 -39
- 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/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/select/Select.js +35 -32
- package/src/components/select/leu-select.js +5 -2
- package/src/components/select/select.css +13 -13
- 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 +48 -123
- 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/lib/utils.js +17 -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/Checkbox.js
CHANGED
|
@@ -1,7 +1,100 @@
|
|
|
1
|
-
import { _ as _defineProperty
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { css, LitElement, html } from 'lit';
|
|
3
3
|
import { I as Icon } from './icon-03e86700.js';
|
|
4
4
|
|
|
5
|
+
var css_248z = css`:host {
|
|
6
|
+
--checkbox-color: var(--leu-color-black-40);
|
|
7
|
+
--checkbox-color-disabled: var(--leu-color-black-20);
|
|
8
|
+
--checkbox-color-focus: var(--leu-color-func-cyan);
|
|
9
|
+
|
|
10
|
+
--checkbox-label-color: var(--leu-color-black-100);
|
|
11
|
+
--checkbox-label-color-disabled: var(--checkbox-color-disabled);
|
|
12
|
+
|
|
13
|
+
--checkbox-tick-color: var(--leu-color-black-0);
|
|
14
|
+
|
|
15
|
+
--checkbox-font-regular: var(--leu-font-regular);
|
|
16
|
+
|
|
17
|
+
position: relative;
|
|
18
|
+
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
gap: 0.5rem;
|
|
22
|
+
|
|
23
|
+
font-family: var(--leu-font-regular);
|
|
24
|
+
|
|
25
|
+
font-family: var(--checkbox-font-regular);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.checkbox {
|
|
29
|
+
--_length: 1.5rem;
|
|
30
|
+
-webkit-appearance: none;
|
|
31
|
+
-moz-appearance: none;
|
|
32
|
+
appearance: none;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
|
|
35
|
+
width: 1.5rem;
|
|
36
|
+
|
|
37
|
+
width: var(--_length);
|
|
38
|
+
height: 1.5rem;
|
|
39
|
+
height: var(--_length);
|
|
40
|
+
margin: 0;
|
|
41
|
+
|
|
42
|
+
border: 2px solid var(--checkbox-color);
|
|
43
|
+
border-radius: 2px;
|
|
44
|
+
|
|
45
|
+
flex: 1 0 1.5rem;
|
|
46
|
+
|
|
47
|
+
flex: 1 0 var(--_length);
|
|
48
|
+
|
|
49
|
+
display: grid;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-items: center;
|
|
52
|
+
place-items: center;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.checkbox:checked {
|
|
56
|
+
background-color: var(--checkbox-color);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.checkbox:checked {
|
|
60
|
+
--checkbox-color: var(--checkbox-color-focus);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.checkbox:hover, .checkbox:focus {
|
|
64
|
+
--checkbox-color: var(--checkbox-color-focus);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.checkbox:focus-visible {
|
|
68
|
+
outline: 2px solid var(--checkbox-color-focus);
|
|
69
|
+
outline-offset: 2px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.checkbox:disabled {
|
|
73
|
+
--checkbox-color: var(--checkbox-color-disabled);
|
|
74
|
+
cursor: not-allowed;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.label {
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
color: var(--checkbox-label-color);
|
|
80
|
+
font-size: 1rem;
|
|
81
|
+
line-height: 1.5;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.checkbox:disabled + .label {
|
|
85
|
+
--checkbox-label-color: var(--checkbox-label-color-disabled);
|
|
86
|
+
cursor: not-allowed;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.icon {
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 0;
|
|
92
|
+
left: 0;
|
|
93
|
+
color: var(--checkbox-tick-color);
|
|
94
|
+
pointer-events: none;
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
|
|
5
98
|
/**
|
|
6
99
|
* @tagname leu-checkbox
|
|
7
100
|
*/
|
|
@@ -10,7 +103,6 @@ class LeuCheckbox extends LitElement {
|
|
|
10
103
|
super();
|
|
11
104
|
this.checked = false;
|
|
12
105
|
this.disabled = false;
|
|
13
|
-
this.tabIndex = 0;
|
|
14
106
|
this.checkIcon = Icon("check");
|
|
15
107
|
}
|
|
16
108
|
handleChange(event) {
|
|
@@ -34,89 +126,12 @@ class LeuCheckbox extends LitElement {
|
|
|
34
126
|
?disabled=${this.disabled}
|
|
35
127
|
.value=${this.value}
|
|
36
128
|
/>
|
|
37
|
-
<label for=${this.identifier} class="label"
|
|
129
|
+
<label for=${this.identifier} class="label">${this.label}</label>
|
|
38
130
|
<div class="icon">${this.checkIcon}</div>
|
|
39
131
|
`;
|
|
40
132
|
}
|
|
41
133
|
}
|
|
42
|
-
_defineProperty(LeuCheckbox, "styles",
|
|
43
|
-
:host {
|
|
44
|
-
--checkbox-color: var(--leu-color-black-40);
|
|
45
|
-
--checkbox-color-disabled: var(--leu-color-black-20);
|
|
46
|
-
--checkbox-color-focus: var(--leu-color-func-cyan);
|
|
47
|
-
|
|
48
|
-
--checkbox-label-color: var(--leu-color-black-100);
|
|
49
|
-
--checkbox-label-color-disabled: var(--checkbox-color-disabled);
|
|
50
|
-
|
|
51
|
-
--checkbox-tick-color: var(--leu-color-black-0);
|
|
52
|
-
|
|
53
|
-
--checkbox-font-regular: var(--leu-font-regular);
|
|
54
|
-
|
|
55
|
-
position: relative;
|
|
56
|
-
|
|
57
|
-
display: inline-flex;
|
|
58
|
-
align-items: flex-start;
|
|
59
|
-
gap: 0.5rem;
|
|
60
|
-
|
|
61
|
-
font-family: var(--checkbox-font-regular);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.checkbox {
|
|
65
|
-
--_length: 1.5rem;
|
|
66
|
-
appearance: none;
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
|
|
69
|
-
width: var(--_length);
|
|
70
|
-
height: var(--_length);
|
|
71
|
-
margin: 0;
|
|
72
|
-
|
|
73
|
-
border: 2px solid var(--checkbox-color);
|
|
74
|
-
border-radius: 2px;
|
|
75
|
-
|
|
76
|
-
flex: 1 0 var(--_length);
|
|
77
|
-
|
|
78
|
-
display: grid;
|
|
79
|
-
place-items: center;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.checkbox:checked {
|
|
83
|
-
background-color: var(--checkbox-color);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.checkbox:is(:hover, :checked, :focus) {
|
|
87
|
-
--checkbox-color: var(--checkbox-color-focus);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.checkbox:focus-visible {
|
|
91
|
-
outline: 2px solid var(--checkbox-color-focus);
|
|
92
|
-
outline-offset: 2px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.checkbox:disabled {
|
|
96
|
-
--checkbox-color: var(--checkbox-color-disabled);
|
|
97
|
-
cursor: not-allowed;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.label {
|
|
101
|
-
cursor: pointer;
|
|
102
|
-
color: var(--checkbox-label-color);
|
|
103
|
-
font-size: 1rem;
|
|
104
|
-
line-height: 1.5;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.checkbox:disabled + .label {
|
|
108
|
-
--checkbox-label-color: var(--checkbox-label-color-disabled);
|
|
109
|
-
cursor: not-allowed;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.icon {
|
|
113
|
-
position: absolute;
|
|
114
|
-
top: 0;
|
|
115
|
-
left: 0;
|
|
116
|
-
color: var(--checkbox-tick-color);
|
|
117
|
-
pointer-events: none;
|
|
118
|
-
}
|
|
119
|
-
`);
|
|
134
|
+
_defineProperty(LeuCheckbox, "styles", css_248z);
|
|
120
135
|
_defineProperty(LeuCheckbox, "shadowRootOptions", {
|
|
121
136
|
...LitElement.shadowRootOptions,
|
|
122
137
|
delegatesFocus: true
|
|
@@ -131,17 +146,21 @@ _defineProperty(LeuCheckbox, "properties", {
|
|
|
131
146
|
reflect: true
|
|
132
147
|
},
|
|
133
148
|
identifier: {
|
|
134
|
-
type: String
|
|
149
|
+
type: String,
|
|
150
|
+
reflect: true
|
|
135
151
|
},
|
|
136
152
|
value: {
|
|
137
|
-
type: String
|
|
153
|
+
type: String,
|
|
154
|
+
reflect: true
|
|
138
155
|
},
|
|
139
156
|
name: {
|
|
140
|
-
type: String
|
|
157
|
+
type: String,
|
|
158
|
+
reflect: true
|
|
159
|
+
},
|
|
160
|
+
label: {
|
|
161
|
+
type: String,
|
|
162
|
+
reflect: true
|
|
141
163
|
}
|
|
142
164
|
});
|
|
143
|
-
function defineCheckboxElements() {
|
|
144
|
-
defineElement("checkbox", LeuCheckbox);
|
|
145
|
-
}
|
|
146
165
|
|
|
147
|
-
export { LeuCheckbox
|
|
166
|
+
export { LeuCheckbox };
|
package/dist/CheckboxGroup.js
CHANGED
|
@@ -1,7 +1,40 @@
|
|
|
1
|
-
import { _ as _defineProperty
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { css, LitElement, html } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
|
|
5
|
+
var css_248z = css`:host {
|
|
6
|
+
--group-font-regular: var(--leu-font-regular);
|
|
7
|
+
--group-font-black: var(--leu-font-black);
|
|
8
|
+
|
|
9
|
+
font-family: var(--leu-font-regular);
|
|
10
|
+
|
|
11
|
+
font-family: var(--group-font-regular);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.fieldset {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: flex-start;
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
gap: 0.5rem 1rem;
|
|
19
|
+
|
|
20
|
+
border: none;
|
|
21
|
+
padding: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.fieldset--vertical {
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 1rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.legend {
|
|
30
|
+
font-family: var(--group-font-black);
|
|
31
|
+
font-size: 1.125rem;
|
|
32
|
+
line-height: 1.5;
|
|
33
|
+
|
|
34
|
+
margin-bottom: 0.5rem;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
|
|
5
38
|
/**
|
|
6
39
|
* @tagname leu-checkbox-group
|
|
7
40
|
*/
|
|
@@ -27,50 +60,22 @@ class LeuCheckboxGroup extends LitElement {
|
|
|
27
60
|
};
|
|
28
61
|
return html`
|
|
29
62
|
<fieldset class=${classMap(fieldsetClasses)}>
|
|
30
|
-
|
|
63
|
+
${this.label ? html`<legend class="legend">${this.label}</legend>` : html``}
|
|
31
64
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
32
65
|
</fieldset>
|
|
33
66
|
`;
|
|
34
67
|
}
|
|
35
68
|
}
|
|
36
|
-
_defineProperty(LeuCheckboxGroup, "styles",
|
|
37
|
-
:host {
|
|
38
|
-
--group-font-regular: var(--leu-font-regular);
|
|
39
|
-
--group-font-black: var(--leu-font-black);
|
|
40
|
-
|
|
41
|
-
font-family: var(--group-font-regular);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.fieldset {
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: flex-start;
|
|
47
|
-
flex-wrap: wrap;
|
|
48
|
-
gap: 0.5rem 1rem;
|
|
49
|
-
|
|
50
|
-
border: none;
|
|
51
|
-
padding: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.fieldset--vertical {
|
|
55
|
-
flex-direction: column;
|
|
56
|
-
gap: 1rem;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.legend {
|
|
60
|
-
font-family: var(--group-font-black);
|
|
61
|
-
font-size: 1.125rem;
|
|
62
|
-
line-height: 1.5;
|
|
63
|
-
|
|
64
|
-
margin-bottom: 0.5rem;
|
|
65
|
-
}
|
|
66
|
-
`);
|
|
69
|
+
_defineProperty(LeuCheckboxGroup, "styles", css_248z);
|
|
67
70
|
_defineProperty(LeuCheckboxGroup, "properties", {
|
|
68
71
|
orientation: {
|
|
69
|
-
type: String
|
|
72
|
+
type: String,
|
|
73
|
+
reflect: true
|
|
74
|
+
},
|
|
75
|
+
label: {
|
|
76
|
+
type: String,
|
|
77
|
+
reflect: true
|
|
70
78
|
}
|
|
71
79
|
});
|
|
72
|
-
function defineCheckboxGroupElements() {
|
|
73
|
-
defineElement("checkbox-group", LeuCheckboxGroup);
|
|
74
|
-
}
|
|
75
80
|
|
|
76
|
-
export { LeuCheckboxGroup
|
|
81
|
+
export { LeuCheckboxGroup };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty } from './
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { css, LitElement } from 'lit';
|
|
3
3
|
|
|
4
4
|
var css_248z = css`:host,
|
|
@@ -154,7 +154,12 @@ _defineProperty(LeuChipBase, "shadowRootOptions", {
|
|
|
154
154
|
});
|
|
155
155
|
_defineProperty(LeuChipBase, "properties", {
|
|
156
156
|
inverted: {
|
|
157
|
-
type: Boolean
|
|
157
|
+
type: Boolean,
|
|
158
|
+
reflect: true
|
|
159
|
+
},
|
|
160
|
+
label: {
|
|
161
|
+
type: String,
|
|
162
|
+
reflect: true
|
|
158
163
|
}
|
|
159
164
|
});
|
|
160
165
|
|
package/dist/ChipGroup.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 {
|
|
@@ -62,11 +62,9 @@ _defineProperty(LeuChipGroup, "styles", css_248z);
|
|
|
62
62
|
_defineProperty(LeuChipGroup, "properties", {
|
|
63
63
|
selectionMode: {
|
|
64
64
|
type: String,
|
|
65
|
-
attribute: "selection-mode"
|
|
65
|
+
attribute: "selection-mode",
|
|
66
|
+
reflect: true
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
|
-
function defineChipGroupElements() {
|
|
69
|
-
defineElement("chip-group", LeuChipGroup);
|
|
70
|
-
}
|
|
71
69
|
|
|
72
|
-
export { LeuChipGroup, SELECTION_MODES
|
|
70
|
+
export { LeuChipGroup, SELECTION_MODES };
|
package/dist/ChipLink.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _defineProperty
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
-
import { L as LeuChipBase } from './Chip-
|
|
3
|
+
import { L as LeuChipBase } from './Chip-dac7337d.js';
|
|
4
4
|
|
|
5
5
|
const SIZES = {
|
|
6
6
|
regular: "regular",
|
|
@@ -20,7 +20,7 @@ class LeuChipLink extends LeuChipBase {
|
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
22
|
return html`<a href=${this.href} class="button">
|
|
23
|
-
<span class="label"
|
|
23
|
+
<span class="label">${this.label}</span>
|
|
24
24
|
</a>`;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -31,15 +31,13 @@ _defineProperty(LeuChipLink, "properties", {
|
|
|
31
31
|
* @type {keyof typeof SIZES}
|
|
32
32
|
*/
|
|
33
33
|
size: {
|
|
34
|
-
type: String
|
|
34
|
+
type: String,
|
|
35
|
+
reflect: true
|
|
35
36
|
},
|
|
36
37
|
href: {
|
|
37
38
|
type: String,
|
|
38
39
|
reflect: true
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
|
-
function defineChipLinkElements() {
|
|
42
|
-
defineElement("chip-link", LeuChipLink);
|
|
43
|
-
}
|
|
44
42
|
|
|
45
|
-
export { LeuChipLink, SIZES
|
|
43
|
+
export { LeuChipLink, SIZES };
|
package/dist/ChipRemovable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _defineProperty
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
-
import { L as LeuChipBase } from './Chip-
|
|
3
|
+
import { L as LeuChipBase } from './Chip-dac7337d.js';
|
|
4
4
|
import { I as Icon } from './icon-03e86700.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -24,7 +24,7 @@ class LeuChipRemovable extends LeuChipBase {
|
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
26
|
return html`<button @click=${e => this.handleClick(e)} class="button">
|
|
27
|
-
<span class="label"
|
|
27
|
+
<span class="label">${this.label}</span>
|
|
28
28
|
<div class="icon">${this._removeIcon}</div>
|
|
29
29
|
</button>`;
|
|
30
30
|
}
|
|
@@ -32,8 +32,5 @@ class LeuChipRemovable extends LeuChipBase {
|
|
|
32
32
|
_defineProperty(LeuChipRemovable, "properties", {
|
|
33
33
|
...LeuChipBase.properties
|
|
34
34
|
});
|
|
35
|
-
function defineChipRemovableElements() {
|
|
36
|
-
defineElement("chip-removable", LeuChipRemovable);
|
|
37
|
-
}
|
|
38
35
|
|
|
39
|
-
export { LeuChipRemovable
|
|
36
|
+
export { LeuChipRemovable };
|
package/dist/ChipSelectable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _defineProperty
|
|
1
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
-
import { L as LeuChipBase } from './Chip-
|
|
3
|
+
import { L as LeuChipBase } from './Chip-dac7337d.js';
|
|
4
4
|
|
|
5
5
|
const SIZES = {
|
|
6
6
|
small: "small",
|
|
@@ -50,7 +50,7 @@ class LeuChipSelectable extends LeuChipBase {
|
|
|
50
50
|
class="button"
|
|
51
51
|
aria-selected=${this.selected ? "true" : "false"}
|
|
52
52
|
>
|
|
53
|
-
<span class="label"
|
|
53
|
+
<span class="label">${this.label}</span>
|
|
54
54
|
</button>`;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -62,7 +62,8 @@ _defineProperty(LeuChipSelectable, "properties", {
|
|
|
62
62
|
* @default "regular"
|
|
63
63
|
*/
|
|
64
64
|
size: {
|
|
65
|
-
type: String
|
|
65
|
+
type: String,
|
|
66
|
+
reflect: true
|
|
66
67
|
},
|
|
67
68
|
/**
|
|
68
69
|
* The variant of the chip. Has an effect not only on the visual appearance but also on the behavior.
|
|
@@ -73,18 +74,17 @@ _defineProperty(LeuChipSelectable, "properties", {
|
|
|
73
74
|
* @default "default"
|
|
74
75
|
*/
|
|
75
76
|
variant: {
|
|
76
|
-
type: String
|
|
77
|
+
type: String,
|
|
78
|
+
reflect: true
|
|
77
79
|
},
|
|
78
80
|
selected: {
|
|
79
81
|
type: Boolean,
|
|
80
82
|
reflect: true
|
|
81
83
|
},
|
|
82
84
|
value: {
|
|
83
|
-
type: String
|
|
85
|
+
type: String,
|
|
86
|
+
reflect: true
|
|
84
87
|
}
|
|
85
88
|
});
|
|
86
|
-
function defineChipSelectableElements() {
|
|
87
|
-
defineElement("chip-selectable", LeuChipSelectable);
|
|
88
|
-
}
|
|
89
89
|
|
|
90
|
-
export { LeuChipSelectable, SIZES, VARIANTS
|
|
90
|
+
export { LeuChipSelectable, SIZES, VARIANTS };
|
package/dist/Dropdown.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
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-4bf6f1f4.js';
|
|
7
|
+
import './defineElement-47d4f665.js';
|
|
8
|
+
import './Button.js';
|
|
6
9
|
import 'lit/directives/class-map.js';
|
|
7
10
|
import './icon-03e86700.js';
|
|
11
|
+
import './Menu.js';
|
|
12
|
+
import './MenuItem.js';
|
|
13
|
+
import 'lit/static-html.js';
|
|
14
|
+
import 'lit/directives/if-defined.js';
|
|
15
|
+
import '@floating-ui/dom';
|
|
8
16
|
|
|
9
17
|
var css_248z = css`:host,
|
|
10
18
|
:host * {
|
|
@@ -20,8 +28,7 @@ var css_248z = css`:host,
|
|
|
20
28
|
box-shadow: var(--leu-box-shadow-short);
|
|
21
29
|
border-radius: 2px;
|
|
22
30
|
|
|
23
|
-
|
|
24
|
-
top: calc(100% + 0.5rem);
|
|
31
|
+
margin-top: 0.5rem;
|
|
25
32
|
}
|
|
26
33
|
`;
|
|
27
34
|
|
|
@@ -31,45 +38,68 @@ var css_248z = css`:host,
|
|
|
31
38
|
class LeuDropdown extends LitElement {
|
|
32
39
|
constructor() {
|
|
33
40
|
super();
|
|
41
|
+
_defineProperty(this, "_handleMenuItemClick", () => {
|
|
42
|
+
this.expanded = false;
|
|
43
|
+
});
|
|
34
44
|
this.label = "";
|
|
35
45
|
this.expanded = false;
|
|
46
|
+
this.menuItems = [];
|
|
36
47
|
}
|
|
37
|
-
|
|
48
|
+
disconnectedCallback() {
|
|
49
|
+
super.disconnectedCallback();
|
|
50
|
+
this._removeMenuItemListeners();
|
|
51
|
+
}
|
|
52
|
+
_handleSlotChange() {
|
|
53
|
+
this._removeMenuItemListeners();
|
|
54
|
+
this.menuItems = [...this.querySelectorAll("leu-menu > leu-menu-item")];
|
|
55
|
+
this.menuItems.forEach(item => item.addEventListener("click", this._handleMenuItemClick));
|
|
56
|
+
}
|
|
57
|
+
_removeMenuItemListeners() {
|
|
58
|
+
this.menuItems.forEach(item => {
|
|
59
|
+
item.removeEventListener("click", this._handleMenuItemClick);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
_handleToggleClick() {
|
|
38
63
|
this.expanded = !this.expanded;
|
|
39
64
|
}
|
|
40
65
|
render() {
|
|
41
66
|
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"
|
|
67
|
+
<leu-popup
|
|
49
68
|
?active=${this.expanded}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
placement="bottom-start"
|
|
70
|
+
shift
|
|
71
|
+
shiftPadding="8"
|
|
72
|
+
autoSize="width"
|
|
73
|
+
autoSizePadding="8"
|
|
74
|
+
>
|
|
75
|
+
<leu-button
|
|
76
|
+
slot="anchor"
|
|
77
|
+
icon="download"
|
|
78
|
+
variant="ghost"
|
|
79
|
+
label=${this.label}
|
|
80
|
+
expanded=${this.expanded ? "open" : "closed"}
|
|
81
|
+
aria-expanded=${this.expanded ? "true" : "false"}
|
|
82
|
+
aria-controls="content"
|
|
83
|
+
?active=${this.expanded}
|
|
84
|
+
@click=${this._handleToggleClick}
|
|
85
|
+
></leu-button>
|
|
86
|
+
<div id="content" class="content" ?hidden=${!this.expanded}>
|
|
87
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
88
|
+
</div>
|
|
89
|
+
</leu-popup>
|
|
55
90
|
`;
|
|
56
91
|
}
|
|
57
92
|
}
|
|
58
93
|
_defineProperty(LeuDropdown, "styles", css_248z);
|
|
59
94
|
_defineProperty(LeuDropdown, "properties", {
|
|
60
95
|
label: {
|
|
61
|
-
type: String
|
|
96
|
+
type: String,
|
|
97
|
+
reflect: true
|
|
62
98
|
},
|
|
63
99
|
expanded: {
|
|
64
100
|
type: Boolean,
|
|
65
101
|
reflect: true
|
|
66
102
|
}
|
|
67
103
|
});
|
|
68
|
-
function defineDropdownElements() {
|
|
69
|
-
defineElement("dropdown", LeuDropdown);
|
|
70
|
-
defineButtonElements();
|
|
71
|
-
defineMenuElements();
|
|
72
|
-
defineMenuItemElements();
|
|
73
|
-
}
|
|
74
104
|
|
|
75
|
-
export { LeuDropdown
|
|
105
|
+
export { LeuDropdown };
|