@statistikzh/leu 0.14.4 → 0.15.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/Accordion.js +2 -30
- package/dist/Button.d.ts +56 -68
- package/dist/Button.js +74 -52
- package/dist/ButtonGroup.d.ts +9 -9
- package/dist/ButtonGroup.js +30 -20
- package/dist/ChartWrapper.d.ts +38 -0
- package/dist/ChartWrapper.js +153 -0
- package/dist/Checkbox.d.ts +6 -21
- package/dist/Checkbox.js +17 -9
- package/dist/CheckboxGroup.d.ts +13 -14
- package/dist/CheckboxGroup.js +18 -11
- package/dist/Chip.js +1 -1
- package/dist/ChipGroup.js +1 -1
- package/dist/ChipLink.js +1 -1
- package/dist/ChipRemovable.js +1 -1
- package/dist/ChipSelectable.js +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/Dropdown.js +3 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.js +1 -1
- package/dist/{LeuElement-x8UlIDDl.js → LeuElement-BhAmogDy.js} +1 -1
- package/dist/Menu.js +1 -1
- package/dist/MenuItem.js +1 -1
- package/dist/Pagination.d.ts +40 -28
- package/dist/Pagination.js +39 -14
- package/dist/Placeholder.d.ts +27 -0
- package/dist/Placeholder.js +90 -0
- package/dist/Popup.js +1 -1
- package/dist/Radio.d.ts +6 -21
- package/dist/Radio.js +17 -9
- package/dist/RadioGroup.d.ts +28 -23
- package/dist/RadioGroup.js +29 -16
- package/dist/Range.js +1 -1
- package/dist/ScrollTop.d.ts +0 -1
- package/dist/ScrollTop.js +3 -1
- package/dist/Select.js +3 -1
- package/dist/Spinner.js +1 -1
- package/dist/Table.d.ts +0 -1
- package/dist/Table.js +3 -1
- package/dist/VisuallyHidden.js +1 -1
- package/dist/_tslib-CNEFicEt.js +30 -0
- package/dist/components/button/Button.d.ts +55 -67
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/stories/button.stories.d.ts.map +1 -1
- package/dist/components/button-group/ButtonGroup.d.ts +9 -9
- package/dist/components/button-group/ButtonGroup.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.d.ts +6 -21
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/CheckboxGroup.d.ts +13 -14
- package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/icon/stories/icon.stories.d.ts +10 -0
- package/dist/components/icon/stories/icon.stories.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.d.ts +40 -27
- package/dist/components/pagination/Pagination.d.ts.map +1 -1
- package/dist/components/pagination/stories/pagination.stories.d.ts +10 -2
- package/dist/components/pagination/stories/pagination.stories.d.ts.map +1 -1
- package/dist/components/placeholder/Placeholder.d.ts +23 -0
- package/dist/components/placeholder/Placeholder.d.ts.map +1 -0
- package/dist/components/placeholder/leu-placeholder.d.ts +3 -0
- package/dist/components/placeholder/leu-placeholder.d.ts.map +1 -0
- package/dist/components/placeholder/stories/placeholder.stories.d.ts +27 -0
- package/dist/components/placeholder/stories/placeholder.stories.d.ts.map +1 -0
- package/dist/components/placeholder/test/placeholder.test.d.ts +2 -0
- package/dist/components/placeholder/test/placeholder.test.d.ts.map +1 -0
- package/dist/components/radio/Radio.d.ts +6 -21
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.d.ts +28 -23
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/visualization/ChartWrapper.d.ts +34 -0
- package/dist/components/visualization/ChartWrapper.d.ts.map +1 -0
- package/dist/components/visualization/leu-chart-wrapper.d.ts +3 -0
- package/dist/components/visualization/leu-chart-wrapper.d.ts.map +1 -0
- package/dist/components/visualization/stories/chart-wrapper.stories.d.ts +28 -0
- package/dist/components/visualization/stories/chart-wrapper.stories.d.ts.map +1 -0
- package/dist/components/visualization/test/chart-wrapper.test.d.ts +2 -0
- package/dist/components/visualization/test/chart-wrapper.test.d.ts.map +1 -0
- package/dist/index.js +3 -2
- package/dist/leu-accordion.js +2 -1
- package/dist/leu-button-group.js +8 -1
- package/dist/leu-button.d.ts +0 -1
- package/dist/leu-button.js +3 -1
- package/dist/leu-chart-wrapper.d.ts +6 -0
- package/dist/leu-chart-wrapper.js +11 -0
- package/dist/leu-checkbox-group.js +5 -1
- package/dist/leu-checkbox.js +3 -1
- package/dist/leu-chip-group.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/leu-dialog.js +1 -1
- package/dist/leu-dropdown.js +3 -1
- package/dist/leu-icon.js +1 -1
- package/dist/leu-input.js +1 -1
- package/dist/leu-menu-item.js +1 -1
- package/dist/leu-menu.js +1 -1
- package/dist/leu-pagination.d.ts +0 -1
- package/dist/leu-pagination.js +3 -1
- package/dist/leu-placeholder.d.ts +4 -0
- package/dist/leu-placeholder.js +7 -0
- package/dist/leu-popup.js +1 -1
- package/dist/leu-radio-group.js +4 -1
- package/dist/leu-radio.js +3 -1
- package/dist/leu-range.js +1 -1
- package/dist/leu-scroll-top.d.ts +0 -1
- package/dist/leu-scroll-top.js +3 -1
- package/dist/leu-select.js +3 -1
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.d.ts +0 -1
- package/dist/leu-table.js +3 -1
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/lib/a11y.d.ts +2 -2
- package/dist/vscode.html-custom-data.json +92 -22
- package/dist/vue/index.d.ts +78 -38
- package/dist/web-types.json +208 -66
- package/package.json +1 -1
- package/release-please-config.json +0 -2
- package/scripts/generate-component/templates/stories/[name].stories.ts +17 -4
- package/src/components/button/Button.ts +95 -79
- package/src/components/button/stories/button.stories.ts +5 -6
- package/src/components/button-group/ButtonGroup.ts +18 -13
- package/src/components/checkbox/Checkbox.ts +13 -15
- package/src/components/checkbox/CheckboxGroup.ts +20 -16
- package/src/components/icon/stories/icon.stories.ts +27 -0
- package/src/components/pagination/Pagination.ts +45 -32
- package/src/components/pagination/stories/pagination.stories.ts +28 -17
- package/src/components/placeholder/Placeholder.ts +33 -0
- package/src/components/placeholder/leu-placeholder.ts +5 -0
- package/src/components/placeholder/placeholder.css +59 -0
- package/src/components/placeholder/stories/placeholder.stories.ts +34 -0
- package/src/components/placeholder/test/placeholder.test.ts +31 -0
- package/src/components/radio/Radio.ts +13 -15
- package/src/components/radio/RadioGroup.ts +42 -28
- package/src/components/visualization/ChartWrapper.ts +75 -0
- package/src/components/visualization/chart-wrapper.css +78 -0
- package/src/components/visualization/leu-chart-wrapper.ts +5 -0
- package/src/components/visualization/stories/chart-wrapper.stories.ts +52 -0
- package/src/components/visualization/test/chart-wrapper.test.ts +74 -0
- package/src/lib/a11y.ts +2 -2
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
2
|
+
import { css, nothing, html } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { L as LeuElement } from './LeuElement-BhAmogDy.js';
|
|
5
|
+
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
6
|
+
import { LeuSpinner } from './Spinner.js';
|
|
7
|
+
|
|
8
|
+
var css_248z = css`.title::slotted(h2) {
|
|
9
|
+
font: var(--leu-t-curve-large-black-font);
|
|
10
|
+
margin: 0 0 0.75rem;
|
|
11
|
+
}
|
|
12
|
+
@media (min-width: 840px) {
|
|
13
|
+
.title::slotted(h2) {
|
|
14
|
+
margin: 0 0 1.25rem;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
@media (min-width: 1280px) {
|
|
18
|
+
.title::slotted(h2) {
|
|
19
|
+
margin: 0 0 1.5rem;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
.title::slotted(h3) {
|
|
23
|
+
font: var(--leu-t-curve-medium-black-font);
|
|
24
|
+
margin: 0 0 0.5rem;
|
|
25
|
+
}
|
|
26
|
+
.title::slotted(h4) {
|
|
27
|
+
font: var(--leu-t-curve-regular-black-font);
|
|
28
|
+
margin: 0 0 0.5rem;
|
|
29
|
+
}
|
|
30
|
+
.description,
|
|
31
|
+
.chart {
|
|
32
|
+
display: block;
|
|
33
|
+
margin-bottom: 0.75rem;
|
|
34
|
+
}
|
|
35
|
+
@media (min-width: 840px) {
|
|
36
|
+
.description,
|
|
37
|
+
.chart {
|
|
38
|
+
margin-bottom: 1.25rem;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
@media (min-width: 1280px) {
|
|
42
|
+
.description,
|
|
43
|
+
.chart {
|
|
44
|
+
margin-bottom: 1.5rem;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
.description {
|
|
48
|
+
font: var(--leu-t-curve-small-regular-font);
|
|
49
|
+
color: var(--leu-color-black-60);
|
|
50
|
+
}
|
|
51
|
+
.caption {
|
|
52
|
+
font: var(--leu-t-curve-tiny-regular-font);
|
|
53
|
+
color: var(--leu-color-black-60);
|
|
54
|
+
}
|
|
55
|
+
.ruler {
|
|
56
|
+
display: block;
|
|
57
|
+
border: none;
|
|
58
|
+
border-top: 1px solid var(--leu-color-black-transp-20);
|
|
59
|
+
margin: 0.75rem 0;
|
|
60
|
+
}
|
|
61
|
+
@media (min-width: 1280px) {
|
|
62
|
+
.ruler {
|
|
63
|
+
margin-top: 1rem;
|
|
64
|
+
margin-bottom: 1rem;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
.download {
|
|
68
|
+
display: block;
|
|
69
|
+
margin-left: -0.5rem;
|
|
70
|
+
}
|
|
71
|
+
.chart-container {
|
|
72
|
+
position: relative;
|
|
73
|
+
}
|
|
74
|
+
.spinner-container {
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: 0;
|
|
77
|
+
left: 0;
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
display: grid;
|
|
81
|
+
align-content: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
place-content: center;
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* A wrapper element for charts.
|
|
89
|
+
* @tagname leu-chart-wrapper
|
|
90
|
+
* @slot title - The title of the chart. Use a heading tag (h2-4) depending on your context.
|
|
91
|
+
* @slot description - A description of the chart. Content is wrapped in a `<p>` tag by the component.
|
|
92
|
+
* @slot chart - The actual chart
|
|
93
|
+
* @slot caption - A caption for the chart, e.g. a source or explanation of the data.
|
|
94
|
+
* @slot download - A download button or dropdown to export the chart in different formats.
|
|
95
|
+
*/
|
|
96
|
+
class LeuChartWrapper extends LeuElement {
|
|
97
|
+
constructor() {
|
|
98
|
+
super(...arguments);
|
|
99
|
+
/**
|
|
100
|
+
* Whether the chart is currently loading or not.
|
|
101
|
+
* When set to `true`, a spinner will be shown in the chart container.
|
|
102
|
+
*/
|
|
103
|
+
this.pending = false;
|
|
104
|
+
this.hasSlotController = new HasSlotController(this, [
|
|
105
|
+
"description",
|
|
106
|
+
"caption",
|
|
107
|
+
"download",
|
|
108
|
+
]);
|
|
109
|
+
}
|
|
110
|
+
render() {
|
|
111
|
+
const hasDescription = this.hasSlotController.test("description");
|
|
112
|
+
const hasCaption = this.hasSlotController.test("caption");
|
|
113
|
+
const hasDownload = this.hasSlotController.test("download");
|
|
114
|
+
return html `
|
|
115
|
+
<figure>
|
|
116
|
+
<slot name="title" class="title"></slot>
|
|
117
|
+
${hasDescription
|
|
118
|
+
? html `<slot name="description" class="description"></slot>`
|
|
119
|
+
: nothing}
|
|
120
|
+
<div class="chart-container">
|
|
121
|
+
<slot name="chart" class="chart"></slot>
|
|
122
|
+
${this.pending
|
|
123
|
+
? html `<div class="spinner-container">
|
|
124
|
+
<leu-spinner class="spinner"></leu-spinner>
|
|
125
|
+
</div>`
|
|
126
|
+
: nothing}
|
|
127
|
+
</div>
|
|
128
|
+
${hasCaption
|
|
129
|
+
? html `<figcaption>
|
|
130
|
+
<slot name="caption" class="caption"></slot>
|
|
131
|
+
</figcaption>`
|
|
132
|
+
: nothing}
|
|
133
|
+
<hr class="ruler" />
|
|
134
|
+
${hasDownload
|
|
135
|
+
? html `<slot name="download" class="download"></slot>`
|
|
136
|
+
: nothing}
|
|
137
|
+
</figure>
|
|
138
|
+
`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
LeuChartWrapper.styles = [LeuElement.styles, css_248z];
|
|
142
|
+
LeuChartWrapper.shadowRootOptions = {
|
|
143
|
+
...LeuElement.shadowRootOptions,
|
|
144
|
+
delegatesFocus: true,
|
|
145
|
+
};
|
|
146
|
+
LeuChartWrapper.dependencies = {
|
|
147
|
+
"leu-spinner": LeuSpinner,
|
|
148
|
+
};
|
|
149
|
+
__decorate([
|
|
150
|
+
property({ type: Boolean, reflect: true })
|
|
151
|
+
], LeuChartWrapper.prototype, "pending", void 0);
|
|
152
|
+
|
|
153
|
+
export { LeuChartWrapper };
|
package/dist/Checkbox.d.ts
CHANGED
|
@@ -20,27 +20,12 @@ declare class LeuCheckbox extends LeuElement {
|
|
|
20
20
|
customElements?: CustomElementRegistry;
|
|
21
21
|
registry?: CustomElementRegistry;
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
type: BooleanConstructor;
|
|
30
|
-
reflect: boolean;
|
|
31
|
-
};
|
|
32
|
-
value: {
|
|
33
|
-
type: StringConstructor;
|
|
34
|
-
reflect: boolean;
|
|
35
|
-
};
|
|
36
|
-
name: {
|
|
37
|
-
type: StringConstructor;
|
|
38
|
-
reflect: boolean;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
constructor();
|
|
42
|
-
handleChange(event: any): void;
|
|
43
|
-
handleInput(event: any): void;
|
|
23
|
+
checked: boolean;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
value: string;
|
|
26
|
+
name: string;
|
|
27
|
+
private handleChange;
|
|
28
|
+
private handleInput;
|
|
44
29
|
render(): lit_html.TemplateResult<1>;
|
|
45
30
|
}
|
|
46
31
|
|
package/dist/Checkbox.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
1
2
|
import { css, html } from 'lit';
|
|
2
|
-
import {
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { L as LeuElement } from './LeuElement-BhAmogDy.js';
|
|
3
5
|
import { LeuIcon } from './Icon.js';
|
|
4
6
|
|
|
5
7
|
var css_248z = css`:host {
|
|
@@ -99,11 +101,11 @@ var css_248z = css`:host {
|
|
|
99
101
|
*/
|
|
100
102
|
class LeuCheckbox extends LeuElement {
|
|
101
103
|
constructor() {
|
|
102
|
-
super();
|
|
104
|
+
super(...arguments);
|
|
103
105
|
this.checked = false;
|
|
104
106
|
this.disabled = false;
|
|
105
|
-
this.name = "";
|
|
106
107
|
this.value = "";
|
|
108
|
+
this.name = "";
|
|
107
109
|
}
|
|
108
110
|
handleChange(event) {
|
|
109
111
|
this.checked = event.target.checked;
|
|
@@ -140,11 +142,17 @@ LeuCheckbox.shadowRootOptions = {
|
|
|
140
142
|
...LeuElement.shadowRootOptions,
|
|
141
143
|
delegatesFocus: true,
|
|
142
144
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
__decorate([
|
|
146
|
+
property({ type: Boolean, reflect: true })
|
|
147
|
+
], LeuCheckbox.prototype, "checked", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
property({ type: Boolean, reflect: true })
|
|
150
|
+
], LeuCheckbox.prototype, "disabled", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
property({ type: String, reflect: true })
|
|
153
|
+
], LeuCheckbox.prototype, "value", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
property({ type: String, reflect: true })
|
|
156
|
+
], LeuCheckbox.prototype, "name", void 0);
|
|
149
157
|
|
|
150
158
|
export { LeuCheckbox };
|
package/dist/CheckboxGroup.d.ts
CHANGED
|
@@ -3,24 +3,23 @@ import * as lit from 'lit';
|
|
|
3
3
|
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
*
|
|
7
|
+
* @slot - Place the checkboxes inside the default slot.
|
|
6
8
|
* @tagname leu-checkbox-group
|
|
7
9
|
*/
|
|
8
10
|
declare class LeuCheckboxGroup extends LeuElement {
|
|
9
11
|
static styles: lit.CSSResultGroup[];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
get value(): any;
|
|
22
|
-
handleSlotChange(): void;
|
|
23
|
-
handleItems(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Defines how the checkboxes should be aligned.
|
|
14
|
+
*/
|
|
15
|
+
orientation: "horizontal" | "vertical";
|
|
16
|
+
/**
|
|
17
|
+
* The label of the checkbox group
|
|
18
|
+
*/
|
|
19
|
+
label?: string;
|
|
20
|
+
private items;
|
|
21
|
+
get value(): string[];
|
|
22
|
+
private handleSlotChange;
|
|
24
23
|
render(): lit_html.TemplateResult<1>;
|
|
25
24
|
}
|
|
26
25
|
|
package/dist/CheckboxGroup.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
1
2
|
import { css, html } from 'lit';
|
|
2
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
-
import {
|
|
4
|
+
import { property } from 'lit/decorators.js';
|
|
5
|
+
import { L as LeuElement } from './LeuElement-BhAmogDy.js';
|
|
6
|
+
import { LeuCheckbox } from './Checkbox.js';
|
|
7
|
+
import './Icon.js';
|
|
4
8
|
|
|
5
9
|
var css_248z = css`:host {
|
|
6
10
|
--group-font-regular: var(--leu-font-family-regular);
|
|
@@ -34,12 +38,16 @@ var css_248z = css`:host {
|
|
|
34
38
|
`;
|
|
35
39
|
|
|
36
40
|
/**
|
|
41
|
+
*
|
|
42
|
+
* @slot - Place the checkboxes inside the default slot.
|
|
37
43
|
* @tagname leu-checkbox-group
|
|
38
44
|
*/
|
|
39
45
|
class LeuCheckboxGroup extends LeuElement {
|
|
40
46
|
constructor() {
|
|
41
|
-
super();
|
|
42
|
-
/**
|
|
47
|
+
super(...arguments);
|
|
48
|
+
/**
|
|
49
|
+
* Defines how the checkboxes should be aligned.
|
|
50
|
+
*/
|
|
43
51
|
this.orientation = "horizontal";
|
|
44
52
|
this.items = [];
|
|
45
53
|
}
|
|
@@ -47,10 +55,7 @@ class LeuCheckboxGroup extends LeuElement {
|
|
|
47
55
|
return this.items.filter((i) => i.checked).map((i) => i.value);
|
|
48
56
|
}
|
|
49
57
|
handleSlotChange() {
|
|
50
|
-
this.
|
|
51
|
-
}
|
|
52
|
-
handleItems() {
|
|
53
|
-
this.items = Array.from(this.querySelectorAll(":scope > *:not([slot])"));
|
|
58
|
+
this.items = Array.from(this.querySelectorAll(":scope > *:not([slot])")).filter((el) => el instanceof LeuCheckbox);
|
|
54
59
|
}
|
|
55
60
|
render() {
|
|
56
61
|
const fieldsetClasses = {
|
|
@@ -68,9 +73,11 @@ class LeuCheckboxGroup extends LeuElement {
|
|
|
68
73
|
}
|
|
69
74
|
}
|
|
70
75
|
LeuCheckboxGroup.styles = [LeuElement.styles, css_248z];
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: String, reflect: true })
|
|
78
|
+
], LeuCheckboxGroup.prototype, "orientation", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: String, reflect: true })
|
|
81
|
+
], LeuCheckboxGroup.prototype, "label", void 0);
|
|
75
82
|
|
|
76
83
|
export { LeuCheckboxGroup };
|
package/dist/Chip.js
CHANGED
package/dist/ChipGroup.js
CHANGED
package/dist/ChipLink.js
CHANGED
package/dist/ChipRemovable.js
CHANGED
package/dist/ChipSelectable.js
CHANGED
package/dist/Dialog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css, nothing, html } from 'lit';
|
|
2
2
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
-
import { L as LeuElement } from './LeuElement-
|
|
4
|
+
import { L as LeuElement } from './LeuElement-BhAmogDy.js';
|
|
5
5
|
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
6
6
|
import { LeuIcon } from './Icon.js';
|
|
7
7
|
|
package/dist/Dropdown.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { css, nothing, html } from 'lit';
|
|
2
2
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
3
|
-
import { L as LeuElement } from './LeuElement-
|
|
3
|
+
import { L as LeuElement } from './LeuElement-BhAmogDy.js';
|
|
4
4
|
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
5
5
|
import { LeuButton } from './Button.js';
|
|
6
6
|
import { LeuMenu } from './Menu.js';
|
|
7
7
|
import { LeuMenuItem } from './MenuItem.js';
|
|
8
8
|
import { LeuPopup } from './Popup.js';
|
|
9
|
+
import './_tslib-CNEFicEt.js';
|
|
9
10
|
import 'lit/directives/class-map.js';
|
|
10
11
|
import 'lit/directives/if-defined.js';
|
|
12
|
+
import 'lit/decorators.js';
|
|
11
13
|
import './Icon.js';
|
|
12
14
|
import '@floating-ui/dom';
|
|
13
15
|
|
package/dist/Icon.js
CHANGED
package/dist/Input.js
CHANGED
|
@@ -3,7 +3,7 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
4
|
import { live } from 'lit/directives/live.js';
|
|
5
5
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
6
|
-
import { L as LeuElement } from './LeuElement-
|
|
6
|
+
import { L as LeuElement } from './LeuElement-BhAmogDy.js';
|
|
7
7
|
import { LeuIcon } from './Icon.js';
|
|
8
8
|
|
|
9
9
|
var css_248z = css`:host {
|
package/dist/Menu.js
CHANGED
package/dist/MenuItem.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css, html, nothing } from 'lit';
|
|
2
2
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
|
-
import { L as LeuElement } from './LeuElement-
|
|
3
|
+
import { L as LeuElement } from './LeuElement-BhAmogDy.js';
|
|
4
4
|
import { LeuIcon } from './Icon.js';
|
|
5
5
|
|
|
6
6
|
var css_248z = css`:host {
|
package/dist/Pagination.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
|
4
4
|
import { LeuButton } from './Button.js';
|
|
5
5
|
import { LeuVisuallyHidden } from './VisuallyHidden.js';
|
|
6
6
|
import { LeuIcon } from './Icon.js';
|
|
7
|
-
import './hasSlotController.d-emXwVXWF.js';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* @tagname leu-pagination
|
|
@@ -27,37 +26,50 @@ declare class LeuPagination extends LeuElement {
|
|
|
27
26
|
customElements?: CustomElementRegistry;
|
|
28
27
|
registry?: CustomElementRegistry;
|
|
29
28
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
constructor();
|
|
29
|
+
defaultPage?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Number of items per page.
|
|
32
|
+
*/
|
|
33
|
+
itemsPerPage: number;
|
|
34
|
+
/**
|
|
35
|
+
* Total number of items to paginate.
|
|
36
|
+
*/
|
|
37
|
+
numOfItems: number;
|
|
38
|
+
/**
|
|
39
|
+
* Internal page state that contains an
|
|
40
|
+
* already clamped page number. Should only
|
|
41
|
+
* be accessed through the `page` getter and
|
|
42
|
+
* setter.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
private _page;
|
|
48
46
|
attributeChangedCallback(name: any, oldVal: any, newVal: any): void;
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The current page number. This is a 1-based index.
|
|
49
|
+
* When setting this value, it will be clamped
|
|
50
|
+
* to the range of valid pages.
|
|
51
|
+
*/
|
|
52
|
+
get page(): number;
|
|
53
|
+
set page(page: number);
|
|
54
|
+
/**
|
|
55
|
+
* The index of the first item on the current page.
|
|
56
|
+
*/
|
|
51
57
|
get startIndex(): number;
|
|
58
|
+
/**
|
|
59
|
+
* The index of the last item on the current page.
|
|
60
|
+
* This is exclusive, meaning it is one past the last item.
|
|
61
|
+
*
|
|
62
|
+
* @todo This value should be inclusive, meaning it should be the index of the last item on the page.
|
|
63
|
+
*/
|
|
52
64
|
get endIndex(): number;
|
|
53
65
|
get _maxPage(): number;
|
|
54
|
-
_isFirstPage
|
|
55
|
-
_isLastPage
|
|
56
|
-
_clampPage
|
|
57
|
-
_updatePage
|
|
58
|
-
_handleChange
|
|
59
|
-
_handleInput
|
|
60
|
-
_handleKeyDown
|
|
66
|
+
private _isFirstPage;
|
|
67
|
+
private _isLastPage;
|
|
68
|
+
private _clampPage;
|
|
69
|
+
private _updatePage;
|
|
70
|
+
private _handleChange;
|
|
71
|
+
private _handleInput;
|
|
72
|
+
private _handleKeyDown;
|
|
61
73
|
render(): lit_html.TemplateResult<1>;
|
|
62
74
|
}
|
|
63
75
|
|
package/dist/Pagination.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
1
2
|
import { css, html } from 'lit';
|
|
2
3
|
import { live } from 'lit/directives/live.js';
|
|
3
|
-
import {
|
|
4
|
+
import { property, state } from 'lit/decorators.js';
|
|
5
|
+
import { L as LeuElement } from './LeuElement-BhAmogDy.js';
|
|
4
6
|
import { LeuButton } from './Button.js';
|
|
5
7
|
import { LeuVisuallyHidden } from './VisuallyHidden.js';
|
|
6
8
|
import { LeuIcon } from './Icon.js';
|
|
@@ -75,17 +77,20 @@ const MIN_PAGE = 1;
|
|
|
75
77
|
*/
|
|
76
78
|
class LeuPagination extends LeuElement {
|
|
77
79
|
constructor() {
|
|
78
|
-
super();
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
super(...arguments);
|
|
81
|
+
/**
|
|
82
|
+
* Number of items per page.
|
|
83
|
+
*/
|
|
82
84
|
this.itemsPerPage = 1;
|
|
85
|
+
/**
|
|
86
|
+
* Total number of items to paginate.
|
|
87
|
+
*/
|
|
88
|
+
this.numOfItems = 1;
|
|
83
89
|
/**
|
|
84
90
|
* Internal page state that contains an
|
|
85
91
|
* already clamped page number. Should only
|
|
86
92
|
* be accessed through the `page` getter and
|
|
87
93
|
* setter.
|
|
88
|
-
* @type {Number}
|
|
89
94
|
* @internal
|
|
90
95
|
*/
|
|
91
96
|
this._page = 1;
|
|
@@ -96,15 +101,29 @@ class LeuPagination extends LeuElement {
|
|
|
96
101
|
this.page = parseInt(newVal, 10);
|
|
97
102
|
}
|
|
98
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* The current page number. This is a 1-based index.
|
|
106
|
+
* When setting this value, it will be clamped
|
|
107
|
+
* to the range of valid pages.
|
|
108
|
+
*/
|
|
99
109
|
get page() {
|
|
100
110
|
return this._page;
|
|
101
111
|
}
|
|
102
112
|
set page(page) {
|
|
103
113
|
this._page = this._clampPage(page);
|
|
104
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* The index of the first item on the current page.
|
|
117
|
+
*/
|
|
105
118
|
get startIndex() {
|
|
106
119
|
return (this.page - 1) * this.itemsPerPage;
|
|
107
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* The index of the last item on the current page.
|
|
123
|
+
* This is exclusive, meaning it is one past the last item.
|
|
124
|
+
*
|
|
125
|
+
* @todo This value should be inclusive, meaning it should be the index of the last item on the page.
|
|
126
|
+
*/
|
|
108
127
|
get endIndex() {
|
|
109
128
|
return Math.min(this.startIndex + this.itemsPerPage, this.numOfItems);
|
|
110
129
|
}
|
|
@@ -174,7 +193,7 @@ class LeuPagination extends LeuElement {
|
|
|
174
193
|
<leu-button
|
|
175
194
|
variant="secondary"
|
|
176
195
|
label="Vorherige Seite"
|
|
177
|
-
@click=${(
|
|
196
|
+
@click=${() => {
|
|
178
197
|
this._updatePage(this.page - 1);
|
|
179
198
|
}}
|
|
180
199
|
?disabled=${this._isFirstPage()}
|
|
@@ -183,7 +202,7 @@ class LeuPagination extends LeuElement {
|
|
|
183
202
|
<leu-button
|
|
184
203
|
variant="secondary"
|
|
185
204
|
label="Nächste Seite"
|
|
186
|
-
@click=${(
|
|
205
|
+
@click=${() => {
|
|
187
206
|
this._updatePage(this.page + 1);
|
|
188
207
|
}}
|
|
189
208
|
?disabled=${this._isLastPage()}
|
|
@@ -206,11 +225,17 @@ LeuPagination.shadowRootOptions = {
|
|
|
206
225
|
...LeuElement.shadowRootOptions,
|
|
207
226
|
delegatesFocus: true,
|
|
208
227
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
228
|
+
__decorate([
|
|
229
|
+
property({ type: Number, reflect: true })
|
|
230
|
+
], LeuPagination.prototype, "defaultPage", void 0);
|
|
231
|
+
__decorate([
|
|
232
|
+
property({ type: Number, reflect: true })
|
|
233
|
+
], LeuPagination.prototype, "itemsPerPage", void 0);
|
|
234
|
+
__decorate([
|
|
235
|
+
property({ type: Number, reflect: true })
|
|
236
|
+
], LeuPagination.prototype, "numOfItems", void 0);
|
|
237
|
+
__decorate([
|
|
238
|
+
state()
|
|
239
|
+
], LeuPagination.prototype, "_page", void 0);
|
|
215
240
|
|
|
216
241
|
export { LeuPagination };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @summary * A placeholder to display when no content is available.
|
|
7
|
+
* @tagname leu-placeholder
|
|
8
|
+
* @slot title - The placeholders title. Use a heading tag (h1-6) depeneding on your context.
|
|
9
|
+
* @slot description - A description of the placeholder. Content is wrapped in a `<p>` tag by the component.
|
|
10
|
+
* @slot cta - A call to action button like "Reload" or "Create". Add a single `<leu-button>`.
|
|
11
|
+
*
|
|
12
|
+
* @todo Add pending state with a skeleton.
|
|
13
|
+
*/
|
|
14
|
+
declare class LeuPlaceholder extends LeuElement {
|
|
15
|
+
static styles: lit.CSSResultGroup[];
|
|
16
|
+
static shadowRootOptions: {
|
|
17
|
+
delegatesFocus: boolean;
|
|
18
|
+
mode: ShadowRootMode;
|
|
19
|
+
serializable?: boolean;
|
|
20
|
+
slotAssignment?: SlotAssignmentMode;
|
|
21
|
+
customElements?: CustomElementRegistry;
|
|
22
|
+
registry?: CustomElementRegistry;
|
|
23
|
+
};
|
|
24
|
+
render(): lit_html.TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { LeuPlaceholder };
|