@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.
Files changed (140) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +8 -0
  3. package/dist/Accordion.js +2 -30
  4. package/dist/Button.d.ts +56 -68
  5. package/dist/Button.js +74 -52
  6. package/dist/ButtonGroup.d.ts +9 -9
  7. package/dist/ButtonGroup.js +30 -20
  8. package/dist/ChartWrapper.d.ts +38 -0
  9. package/dist/ChartWrapper.js +153 -0
  10. package/dist/Checkbox.d.ts +6 -21
  11. package/dist/Checkbox.js +17 -9
  12. package/dist/CheckboxGroup.d.ts +13 -14
  13. package/dist/CheckboxGroup.js +18 -11
  14. package/dist/Chip.js +1 -1
  15. package/dist/ChipGroup.js +1 -1
  16. package/dist/ChipLink.js +1 -1
  17. package/dist/ChipRemovable.js +1 -1
  18. package/dist/ChipSelectable.js +1 -1
  19. package/dist/Dialog.js +1 -1
  20. package/dist/Dropdown.js +3 -1
  21. package/dist/Icon.js +1 -1
  22. package/dist/Input.js +1 -1
  23. package/dist/{LeuElement-x8UlIDDl.js → LeuElement-BhAmogDy.js} +1 -1
  24. package/dist/Menu.js +1 -1
  25. package/dist/MenuItem.js +1 -1
  26. package/dist/Pagination.d.ts +40 -28
  27. package/dist/Pagination.js +39 -14
  28. package/dist/Placeholder.d.ts +27 -0
  29. package/dist/Placeholder.js +90 -0
  30. package/dist/Popup.js +1 -1
  31. package/dist/Radio.d.ts +6 -21
  32. package/dist/Radio.js +17 -9
  33. package/dist/RadioGroup.d.ts +28 -23
  34. package/dist/RadioGroup.js +29 -16
  35. package/dist/Range.js +1 -1
  36. package/dist/ScrollTop.d.ts +0 -1
  37. package/dist/ScrollTop.js +3 -1
  38. package/dist/Select.js +3 -1
  39. package/dist/Spinner.js +1 -1
  40. package/dist/Table.d.ts +0 -1
  41. package/dist/Table.js +3 -1
  42. package/dist/VisuallyHidden.js +1 -1
  43. package/dist/_tslib-CNEFicEt.js +30 -0
  44. package/dist/components/button/Button.d.ts +55 -67
  45. package/dist/components/button/Button.d.ts.map +1 -1
  46. package/dist/components/button/stories/button.stories.d.ts.map +1 -1
  47. package/dist/components/button-group/ButtonGroup.d.ts +9 -9
  48. package/dist/components/button-group/ButtonGroup.d.ts.map +1 -1
  49. package/dist/components/checkbox/Checkbox.d.ts +6 -21
  50. package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
  51. package/dist/components/checkbox/CheckboxGroup.d.ts +13 -14
  52. package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -1
  53. package/dist/components/icon/stories/icon.stories.d.ts +10 -0
  54. package/dist/components/icon/stories/icon.stories.d.ts.map +1 -1
  55. package/dist/components/pagination/Pagination.d.ts +40 -27
  56. package/dist/components/pagination/Pagination.d.ts.map +1 -1
  57. package/dist/components/pagination/stories/pagination.stories.d.ts +10 -2
  58. package/dist/components/pagination/stories/pagination.stories.d.ts.map +1 -1
  59. package/dist/components/placeholder/Placeholder.d.ts +23 -0
  60. package/dist/components/placeholder/Placeholder.d.ts.map +1 -0
  61. package/dist/components/placeholder/leu-placeholder.d.ts +3 -0
  62. package/dist/components/placeholder/leu-placeholder.d.ts.map +1 -0
  63. package/dist/components/placeholder/stories/placeholder.stories.d.ts +27 -0
  64. package/dist/components/placeholder/stories/placeholder.stories.d.ts.map +1 -0
  65. package/dist/components/placeholder/test/placeholder.test.d.ts +2 -0
  66. package/dist/components/placeholder/test/placeholder.test.d.ts.map +1 -0
  67. package/dist/components/radio/Radio.d.ts +6 -21
  68. package/dist/components/radio/Radio.d.ts.map +1 -1
  69. package/dist/components/radio/RadioGroup.d.ts +28 -23
  70. package/dist/components/radio/RadioGroup.d.ts.map +1 -1
  71. package/dist/components/visualization/ChartWrapper.d.ts +34 -0
  72. package/dist/components/visualization/ChartWrapper.d.ts.map +1 -0
  73. package/dist/components/visualization/leu-chart-wrapper.d.ts +3 -0
  74. package/dist/components/visualization/leu-chart-wrapper.d.ts.map +1 -0
  75. package/dist/components/visualization/stories/chart-wrapper.stories.d.ts +28 -0
  76. package/dist/components/visualization/stories/chart-wrapper.stories.d.ts.map +1 -0
  77. package/dist/components/visualization/test/chart-wrapper.test.d.ts +2 -0
  78. package/dist/components/visualization/test/chart-wrapper.test.d.ts.map +1 -0
  79. package/dist/index.js +3 -2
  80. package/dist/leu-accordion.js +2 -1
  81. package/dist/leu-button-group.js +8 -1
  82. package/dist/leu-button.d.ts +0 -1
  83. package/dist/leu-button.js +3 -1
  84. package/dist/leu-chart-wrapper.d.ts +6 -0
  85. package/dist/leu-chart-wrapper.js +11 -0
  86. package/dist/leu-checkbox-group.js +5 -1
  87. package/dist/leu-checkbox.js +3 -1
  88. package/dist/leu-chip-group.js +1 -1
  89. package/dist/leu-chip-link.js +1 -1
  90. package/dist/leu-chip-removable.js +1 -1
  91. package/dist/leu-chip-selectable.js +1 -1
  92. package/dist/leu-dialog.js +1 -1
  93. package/dist/leu-dropdown.js +3 -1
  94. package/dist/leu-icon.js +1 -1
  95. package/dist/leu-input.js +1 -1
  96. package/dist/leu-menu-item.js +1 -1
  97. package/dist/leu-menu.js +1 -1
  98. package/dist/leu-pagination.d.ts +0 -1
  99. package/dist/leu-pagination.js +3 -1
  100. package/dist/leu-placeholder.d.ts +4 -0
  101. package/dist/leu-placeholder.js +7 -0
  102. package/dist/leu-popup.js +1 -1
  103. package/dist/leu-radio-group.js +4 -1
  104. package/dist/leu-radio.js +3 -1
  105. package/dist/leu-range.js +1 -1
  106. package/dist/leu-scroll-top.d.ts +0 -1
  107. package/dist/leu-scroll-top.js +3 -1
  108. package/dist/leu-select.js +3 -1
  109. package/dist/leu-spinner.js +1 -1
  110. package/dist/leu-table.d.ts +0 -1
  111. package/dist/leu-table.js +3 -1
  112. package/dist/leu-visually-hidden.js +1 -1
  113. package/dist/lib/a11y.d.ts +2 -2
  114. package/dist/vscode.html-custom-data.json +92 -22
  115. package/dist/vue/index.d.ts +78 -38
  116. package/dist/web-types.json +208 -66
  117. package/package.json +1 -1
  118. package/release-please-config.json +0 -2
  119. package/scripts/generate-component/templates/stories/[name].stories.ts +17 -4
  120. package/src/components/button/Button.ts +95 -79
  121. package/src/components/button/stories/button.stories.ts +5 -6
  122. package/src/components/button-group/ButtonGroup.ts +18 -13
  123. package/src/components/checkbox/Checkbox.ts +13 -15
  124. package/src/components/checkbox/CheckboxGroup.ts +20 -16
  125. package/src/components/icon/stories/icon.stories.ts +27 -0
  126. package/src/components/pagination/Pagination.ts +45 -32
  127. package/src/components/pagination/stories/pagination.stories.ts +28 -17
  128. package/src/components/placeholder/Placeholder.ts +33 -0
  129. package/src/components/placeholder/leu-placeholder.ts +5 -0
  130. package/src/components/placeholder/placeholder.css +59 -0
  131. package/src/components/placeholder/stories/placeholder.stories.ts +34 -0
  132. package/src/components/placeholder/test/placeholder.test.ts +31 -0
  133. package/src/components/radio/Radio.ts +13 -15
  134. package/src/components/radio/RadioGroup.ts +42 -28
  135. package/src/components/visualization/ChartWrapper.ts +75 -0
  136. package/src/components/visualization/chart-wrapper.css +78 -0
  137. package/src/components/visualization/leu-chart-wrapper.ts +5 -0
  138. package/src/components/visualization/stories/chart-wrapper.stories.ts +52 -0
  139. package/src/components/visualization/test/chart-wrapper.test.ts +74 -0
  140. 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 };
@@ -20,27 +20,12 @@ declare class LeuCheckbox extends LeuElement {
20
20
  customElements?: CustomElementRegistry;
21
21
  registry?: CustomElementRegistry;
22
22
  };
23
- static properties: {
24
- checked: {
25
- type: BooleanConstructor;
26
- reflect: boolean;
27
- };
28
- disabled: {
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 { L as LeuElement } from './LeuElement-x8UlIDDl.js';
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
- LeuCheckbox.properties = {
144
- checked: { type: Boolean, reflect: true },
145
- disabled: { type: Boolean, reflect: true },
146
- value: { type: String, reflect: true },
147
- name: { type: String, reflect: true },
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 };
@@ -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
- static properties: {
11
- orientation: {
12
- type: StringConstructor;
13
- reflect: boolean;
14
- };
15
- label: {
16
- type: StringConstructor;
17
- reflect: boolean;
18
- };
19
- };
20
- constructor();
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
 
@@ -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 { L as LeuElement } from './LeuElement-x8UlIDDl.js';
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
- /** @type {"horizontal" | "vertical"} */
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.handleItems();
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
- LeuCheckboxGroup.properties = {
72
- orientation: { type: String, reflect: true },
73
- label: { type: String, reflect: true },
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
@@ -1,4 +1,4 @@
1
- import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
1
+ import { L as LeuElement } from './LeuElement-BhAmogDy.js';
2
2
  import { css } from 'lit';
3
3
 
4
4
  var css_248z = css`:host *::before,
package/dist/ChipGroup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { unsafeStatic, html } from 'lit/static-html.js';
2
- import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
2
+ import { L as LeuElement } from './LeuElement-BhAmogDy.js';
3
3
  import { css } from 'lit';
4
4
 
5
5
  var css_248z = css`.label {
package/dist/ChipLink.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { html } from 'lit';
2
2
  import { LeuChipBase } from './Chip.js';
3
- import './LeuElement-x8UlIDDl.js';
3
+ import './LeuElement-BhAmogDy.js';
4
4
 
5
5
  const SIZES = {
6
6
  regular: "regular",
@@ -1,7 +1,7 @@
1
1
  import { html } from 'lit';
2
2
  import { LeuChipBase } from './Chip.js';
3
3
  import { LeuIcon } from './Icon.js';
4
- import './LeuElement-x8UlIDDl.js';
4
+ import './LeuElement-BhAmogDy.js';
5
5
 
6
6
  /**
7
7
  * @slot - The content of the chip
@@ -1,6 +1,6 @@
1
1
  import { html } from 'lit';
2
2
  import { LeuChipBase } from './Chip.js';
3
- import './LeuElement-x8UlIDDl.js';
3
+ import './LeuElement-BhAmogDy.js';
4
4
 
5
5
  const SIZES = {
6
6
  small: "small",
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-x8UlIDDl.js';
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-x8UlIDDl.js';
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
@@ -1,5 +1,5 @@
1
1
  import { css, html, svg } from 'lit';
2
- import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
2
+ import { L as LeuElement } from './LeuElement-BhAmogDy.js';
3
3
 
4
4
  var css_248z = css`:host {
5
5
  display: contents;
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-x8UlIDDl.js';
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 {
@@ -35,7 +35,7 @@ class LeuElement extends LitElement {
35
35
  }
36
36
  }
37
37
  }
38
- LeuElement.version = "0.14.4";
38
+ LeuElement.version = "0.15.0";
39
39
  LeuElement.dependencies = {};
40
40
  LeuElement.styles = css_248z;
41
41
 
package/dist/Menu.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { css, html } from 'lit';
2
- import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
2
+ import { L as LeuElement } from './LeuElement-BhAmogDy.js';
3
3
  import { LeuMenuItem } from './MenuItem.js';
4
4
  import 'lit/directives/if-defined.js';
5
5
  import './Icon.js';
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-x8UlIDDl.js';
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 {
@@ -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
- static properties: {
31
- defaultPage: {
32
- type: NumberConstructor;
33
- reflect: boolean;
34
- };
35
- itemsPerPage: {
36
- type: NumberConstructor;
37
- reflect: boolean;
38
- };
39
- numOfItems: {
40
- type: NumberConstructor;
41
- reflect: boolean;
42
- };
43
- _page: {
44
- state: boolean;
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
- get page(): any;
50
- set page(page: any);
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(): boolean;
55
- _isLastPage(): boolean;
56
- _clampPage(page: any): number;
57
- _updatePage(page: any): void;
58
- _handleChange(event: any): void;
59
- _handleInput(event: any): void;
60
- _handleKeyDown(event: any): void;
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
 
@@ -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 { L as LeuElement } from './LeuElement-x8UlIDDl.js';
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
- /** @type {Number} */
80
- this.numOfItems = 1;
81
- /** @type {Number} */
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
- LeuPagination.properties = {
210
- defaultPage: { type: Number, reflect: true },
211
- itemsPerPage: { type: Number, reflect: true },
212
- numOfItems: { type: Number, reflect: true },
213
- _page: { state: true },
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 };