@statistikzh/leu 0.19.0 → 0.19.2
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 +14 -0
- package/dist/Accordion.js +1 -1
- package/dist/Button.js +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/ChartWrapper.js +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/CheckboxGroup.js +1 -1
- 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 +1 -1
- package/dist/FileInput.d.ts +6 -0
- package/dist/FileInput.js +22 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.js +1 -1
- package/dist/{LeuElement-CKq5epyY.js → LeuElement-CcarVabH.js} +1 -1
- package/dist/Menu.js +1 -1
- package/dist/MenuItem.js +1 -1
- package/dist/Message.js +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Placeholder.js +1 -1
- package/dist/Popup.js +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/Radio.js +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/Range.js +1 -1
- package/dist/ScrollTop.js +1 -1
- package/dist/Select.js +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/Tag.js +1 -1
- package/dist/VisuallyHidden.js +1 -1
- package/dist/components/file-input/FileInput.d.ts +6 -0
- package/dist/components/file-input/FileInput.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/leu-accordion.js +1 -1
- package/dist/leu-button-group.js +1 -1
- package/dist/leu-button.js +1 -1
- package/dist/leu-chart-wrapper.js +1 -1
- package/dist/leu-checkbox-group.js +1 -1
- package/dist/leu-checkbox.js +1 -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 +1 -1
- package/dist/leu-file-input.js +1 -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-message.js +1 -1
- package/dist/leu-pagination.js +1 -1
- package/dist/leu-placeholder.js +1 -1
- package/dist/leu-popup.js +1 -1
- package/dist/leu-progress-bar.js +1 -1
- package/dist/leu-radio-group.js +1 -1
- package/dist/leu-radio.js +1 -1
- package/dist/leu-range.js +1 -1
- package/dist/leu-scroll-top.js +1 -1
- package/dist/leu-select.js +1 -1
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.js +1 -1
- package/dist/leu-tag.js +1 -1
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/vue/index.d.ts +9 -1
- package/dist/web-types.json +10 -4
- package/package.json +1 -1
- package/src/components/file-input/FileInput.ts +28 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.19.2](https://github.com/statistikZH/leu/compare/leu-v0.19.1...leu-v0.19.2) (2025-10-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **file-input:** dispatch input and change events when files are added and removed ([ad2faf5](https://github.com/statistikZH/leu/commit/ad2faf59ff96b0f0990f3022f3e2c07d8cc0975d))
|
|
9
|
+
|
|
10
|
+
## [0.19.1](https://github.com/statistikZH/leu/compare/leu-v0.19.0...leu-v0.19.1) (2025-10-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **file-input:** reset the input when the form resets ([874c684](https://github.com/statistikZH/leu/commit/874c684df5682a9eb60206bf6d23b259d044fa1b))
|
|
16
|
+
|
|
3
17
|
## [0.19.0](https://github.com/statistikZH/leu/compare/leu-v0.18.1...leu-v0.19.0) (2025-10-15)
|
|
4
18
|
|
|
5
19
|
|
package/dist/Accordion.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
|
2
2
|
import { css, nothing } from 'lit';
|
|
3
3
|
import { unsafeStatic, html } from 'lit/static-html.js';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-
|
|
5
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
6
6
|
|
|
7
7
|
var css_248z = css`:host {
|
|
8
8
|
--accordion-font-regular: var(--leu-font-family-regular);
|
package/dist/Button.js
CHANGED
|
@@ -4,7 +4,7 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
5
|
import { property } from 'lit/decorators.js';
|
|
6
6
|
import { LeuIcon } from './Icon.js';
|
|
7
|
-
import { L as LeuElement } from './LeuElement-
|
|
7
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
8
8
|
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
9
9
|
|
|
10
10
|
/**
|
package/dist/ButtonGroup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css, html } from 'lit';
|
|
2
|
-
import { L as LeuElement } from './LeuElement-
|
|
2
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
3
3
|
import { LeuButton } from './Button.js';
|
|
4
4
|
import './_tslib-CNEFicEt.js';
|
|
5
5
|
import 'lit/directives/class-map.js';
|
package/dist/ChartWrapper.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
2
2
|
import { css, nothing, html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
|
-
import { L as LeuElement } from './LeuElement-
|
|
4
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
5
5
|
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
6
6
|
import { LeuSpinner } from './Spinner.js';
|
|
7
7
|
|
package/dist/Checkbox.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
|
-
import { L as LeuElement } from './LeuElement-
|
|
4
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
5
5
|
import { LeuIcon } from './Icon.js';
|
|
6
6
|
|
|
7
7
|
var css_248z = css`:host {
|
package/dist/CheckboxGroup.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-
|
|
5
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
6
6
|
import { LeuCheckbox } from './Checkbox.js';
|
|
7
7
|
import './Icon.js';
|
|
8
8
|
|
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-CcarVabH.js';
|
|
5
5
|
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
6
6
|
import { LeuIcon } from './Icon.js';
|
|
7
7
|
import './_tslib-CNEFicEt.js';
|
package/dist/Dropdown.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-CcarVabH.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';
|
package/dist/FileInput.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ import { LeuIcon } from './Icon.js';
|
|
|
6
6
|
import { LeuVisuallyHidden } from './VisuallyHidden.js';
|
|
7
7
|
import './leu-icon.js';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @todo Pluralize text when multiple files are allowed
|
|
11
|
+
* @todo Hide dropzone when not multiple and already filled
|
|
12
|
+
*/
|
|
9
13
|
/**
|
|
10
14
|
* @tagname leu-file-input
|
|
11
15
|
*/
|
|
@@ -45,6 +49,8 @@ declare class LeuFileInput extends LeuElement {
|
|
|
45
49
|
get name(): string;
|
|
46
50
|
updated(changedProperties: any): void;
|
|
47
51
|
protected handleInput(): void;
|
|
52
|
+
private handleChange;
|
|
53
|
+
formResetCallback(): void;
|
|
48
54
|
protected updateFormValue(): void;
|
|
49
55
|
protected removeFile(fileToRemove: File): void;
|
|
50
56
|
protected static formatFileSize(size: number): lit_html.TemplateResult<1>;
|
package/dist/FileInput.js
CHANGED
|
@@ -3,7 +3,7 @@ import { css, html, nothing } from 'lit';
|
|
|
3
3
|
import { property, state, query } from 'lit/decorators.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
5
|
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
-
import { L as LeuElement } from './LeuElement-
|
|
6
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
7
7
|
import './Accordion.js';
|
|
8
8
|
import { LeuButton } from './Button.js';
|
|
9
9
|
import './ButtonGroup.js';
|
|
@@ -157,6 +157,10 @@ var css_248z = css`:host {
|
|
|
157
157
|
}
|
|
158
158
|
`;
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* @todo Pluralize text when multiple files are allowed
|
|
162
|
+
* @todo Hide dropzone when not multiple and already filled
|
|
163
|
+
*/
|
|
160
164
|
/**
|
|
161
165
|
* @tagname leu-file-input
|
|
162
166
|
*/
|
|
@@ -235,6 +239,14 @@ class LeuFileInput extends LeuElement {
|
|
|
235
239
|
: acceptableFiles.slice(0, 1);
|
|
236
240
|
}
|
|
237
241
|
}
|
|
242
|
+
handleChange(event) {
|
|
243
|
+
const customEvent = new CustomEvent(event.type, event);
|
|
244
|
+
this.dispatchEvent(customEvent);
|
|
245
|
+
}
|
|
246
|
+
formResetCallback() {
|
|
247
|
+
this.files = [];
|
|
248
|
+
this.input.value = "";
|
|
249
|
+
}
|
|
238
250
|
updateFormValue() {
|
|
239
251
|
const formData = new FormData();
|
|
240
252
|
const files = this.multiple ? this.files : this.files.slice(0, 1);
|
|
@@ -245,6 +257,14 @@ class LeuFileInput extends LeuElement {
|
|
|
245
257
|
}
|
|
246
258
|
removeFile(fileToRemove) {
|
|
247
259
|
this.files = this.files.filter((file) => file !== fileToRemove);
|
|
260
|
+
this.dispatchEvent(new CustomEvent("input", {
|
|
261
|
+
composed: true,
|
|
262
|
+
bubbles: true,
|
|
263
|
+
}));
|
|
264
|
+
this.dispatchEvent(new CustomEvent("change", {
|
|
265
|
+
composed: true,
|
|
266
|
+
bubbles: true,
|
|
267
|
+
}));
|
|
248
268
|
}
|
|
249
269
|
static formatFileSize(size) {
|
|
250
270
|
if (size < 1e3) {
|
|
@@ -295,6 +315,7 @@ class LeuFileInput extends LeuElement {
|
|
|
295
315
|
accept=${ifDefined(this.accept)}
|
|
296
316
|
?disabled=${this.disabled}
|
|
297
317
|
@input=${this.handleInput}
|
|
318
|
+
@change=${this.handleChange}
|
|
298
319
|
/>
|
|
299
320
|
</leu-visually-hidden>
|
|
300
321
|
<div
|
package/dist/Icon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
2
2
|
import { css, html, svg } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
|
-
import { L as LeuElement } from './LeuElement-
|
|
4
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
5
5
|
|
|
6
6
|
var css_248z = css`:host {
|
|
7
7
|
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-
|
|
6
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
7
7
|
import { LeuIcon } from './Icon.js';
|
|
8
8
|
import './_tslib-CNEFicEt.js';
|
|
9
9
|
import 'lit/decorators.js';
|
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-CcarVabH.js';
|
|
4
4
|
import { LeuIcon } from './Icon.js';
|
|
5
5
|
import './_tslib-CNEFicEt.js';
|
|
6
6
|
import 'lit/decorators.js';
|
package/dist/Message.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
|
2
2
|
import { css, html, nothing } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-
|
|
5
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
6
6
|
import { LeuIcon } from './Icon.js';
|
|
7
7
|
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
8
8
|
|
package/dist/Pagination.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { live } from 'lit/directives/live.js';
|
|
4
4
|
import { property, state } from 'lit/decorators.js';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-
|
|
5
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
6
6
|
import { LeuButton } from './Button.js';
|
|
7
7
|
import { LeuVisuallyHidden } from './VisuallyHidden.js';
|
|
8
8
|
import { LeuIcon } from './Icon.js';
|
package/dist/Placeholder.js
CHANGED
package/dist/Popup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css, html } from 'lit';
|
|
2
2
|
import { autoUpdate, size, flip, shift, computePosition } from '@floating-ui/dom';
|
|
3
|
-
import { L as LeuElement } from './LeuElement-
|
|
3
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
4
4
|
|
|
5
5
|
var css_248z = css`:host {
|
|
6
6
|
--popup-font-regular: var(--leu-font-family-regular);
|
package/dist/ProgressBar.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
|
2
2
|
import { css, nothing, html } from 'lit';
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-
|
|
5
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
6
6
|
|
|
7
7
|
var css_248z = css`/* :host {
|
|
8
8
|
--progress-bar-font-regular: var(--leu-font-family-regular);
|
package/dist/Radio.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
|
-
import { L as LeuElement } from './LeuElement-
|
|
4
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
5
5
|
|
|
6
6
|
var css_248z = css`:host {
|
|
7
7
|
--radio-color: var(--leu-color-black-40);
|
package/dist/RadioGroup.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-
|
|
5
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
6
6
|
import { LeuRadio } from './Radio.js';
|
|
7
7
|
|
|
8
8
|
var css_248z = css`:host {
|
package/dist/Range.js
CHANGED
package/dist/ScrollTop.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css, html } from 'lit';
|
|
2
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
-
import { L as LeuElement } from './LeuElement-
|
|
3
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
4
4
|
import { LeuButton } from './Button.js';
|
|
5
5
|
import { LeuIcon } from './Icon.js';
|
|
6
6
|
import './_tslib-CNEFicEt.js';
|
package/dist/Select.js
CHANGED
|
@@ -2,7 +2,7 @@ import { css, nothing, html } from 'lit';
|
|
|
2
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
3
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-
|
|
5
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
6
6
|
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
7
7
|
import { LeuButton } from './Button.js';
|
|
8
8
|
import { LeuMenu } from './Menu.js';
|
package/dist/Spinner.js
CHANGED
package/dist/Table.js
CHANGED
|
@@ -2,7 +2,7 @@ import { css, html, nothing } from 'lit';
|
|
|
2
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
3
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
4
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-
|
|
5
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
6
6
|
import { LeuIcon } from './Icon.js';
|
|
7
7
|
import { LeuPagination } from './Pagination.js';
|
|
8
8
|
import './_tslib-CNEFicEt.js';
|
package/dist/Tag.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __decorate } from './_tslib-CNEFicEt.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
|
-
import { L as LeuElement } from './LeuElement-
|
|
4
|
+
import { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
5
5
|
|
|
6
6
|
var css_248z = css`:host {
|
|
7
7
|
/* --tag-font-regular: var(--leu-font-family-regular);
|
package/dist/VisuallyHidden.js
CHANGED
|
@@ -2,6 +2,10 @@ import { LeuElement } from "../../lib/LeuElement.js";
|
|
|
2
2
|
import { LeuButton } from "../../index.js";
|
|
3
3
|
import { LeuIcon } from "../icon/leu-icon.js";
|
|
4
4
|
import { LeuVisuallyHidden } from "../visually-hidden/VisuallyHidden.js";
|
|
5
|
+
/**
|
|
6
|
+
* @todo Pluralize text when multiple files are allowed
|
|
7
|
+
* @todo Hide dropzone when not multiple and already filled
|
|
8
|
+
*/
|
|
5
9
|
/**
|
|
6
10
|
* @tagname leu-file-input
|
|
7
11
|
*/
|
|
@@ -41,6 +45,8 @@ export declare class LeuFileInput extends LeuElement {
|
|
|
41
45
|
get name(): string;
|
|
42
46
|
updated(changedProperties: any): void;
|
|
43
47
|
protected handleInput(): void;
|
|
48
|
+
private handleChange;
|
|
49
|
+
formResetCallback(): void;
|
|
44
50
|
protected updateFormValue(): void;
|
|
45
51
|
protected removeFile(fileToRemove: File): void;
|
|
46
52
|
protected static formatFileSize(size: number): import("lit-html").TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../../src/components/file-input/FileInput.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAExE;;GAEG;AACH,qBAAa,YAAa,SAAQ,UAAU;IAC1C,MAAM,CAAC,YAAY;;;;MAIlB;IAED,MAAM,CAAC,MAAM,iCAA8B;IAE3C,MAAM,CAAC,iBAAiB;;;;;;;MAGvB;IAED,MAAM,CAAC,cAAc,UAAO;IAE5B,SAAS,CAAC,SAAS,EAAE,gBAAgB,CAAA;IAGrC,KAAK,EAAE,MAAM,CAAK;IAElB,0MAA0M;IAE1M,MAAM,EAAE,MAAM,CAAK;IAEnB,0CAA0C;IAE1C,QAAQ,EAAE,OAAO,CAAQ;IAEzB,oDAAoD;IAEpD,QAAQ,EAAE,OAAO,CAAQ;IAEzB,0CAA0C;IAE1C,QAAQ,EAAE,OAAO,CAAQ;IAEzB,6EAA6E;IAE7E,OAAO,EAAE,QAAQ,GAAG,aAAa,CAAW;IAGrC,KAAK,EAAE,IAAI,EAAE,CAAK;IAGzB,OAAO,CAAC,UAAU,CAAiB;IAGnC,KAAK,EAAE,gBAAgB,CAAA;;IAQvB,IAAI,IAAI,oBAEP;IAED,IAAI,IAAI,WAEP;IAED,OAAO,CAAC,iBAAiB,KAAA;IAUzB,SAAS,CAAC,WAAW;IAarB,SAAS,CAAC,eAAe;IAYzB,SAAS,CAAC,UAAU,CAAC,YAAY,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../../src/components/file-input/FileInput.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAExE;;;GAGG;AAEH;;GAEG;AACH,qBAAa,YAAa,SAAQ,UAAU;IAC1C,MAAM,CAAC,YAAY;;;;MAIlB;IAED,MAAM,CAAC,MAAM,iCAA8B;IAE3C,MAAM,CAAC,iBAAiB;;;;;;;MAGvB;IAED,MAAM,CAAC,cAAc,UAAO;IAE5B,SAAS,CAAC,SAAS,EAAE,gBAAgB,CAAA;IAGrC,KAAK,EAAE,MAAM,CAAK;IAElB,0MAA0M;IAE1M,MAAM,EAAE,MAAM,CAAK;IAEnB,0CAA0C;IAE1C,QAAQ,EAAE,OAAO,CAAQ;IAEzB,oDAAoD;IAEpD,QAAQ,EAAE,OAAO,CAAQ;IAEzB,0CAA0C;IAE1C,QAAQ,EAAE,OAAO,CAAQ;IAEzB,6EAA6E;IAE7E,OAAO,EAAE,QAAQ,GAAG,aAAa,CAAW;IAGrC,KAAK,EAAE,IAAI,EAAE,CAAK;IAGzB,OAAO,CAAC,UAAU,CAAiB;IAGnC,KAAK,EAAE,gBAAgB,CAAA;;IAQvB,IAAI,IAAI,oBAEP;IAED,IAAI,IAAI,WAEP;IAED,OAAO,CAAC,iBAAiB,KAAA;IAUzB,SAAS,CAAC,WAAW;IAarB,OAAO,CAAC,YAAY;IAKb,iBAAiB;IAKxB,SAAS,CAAC,eAAe;IAYzB,SAAS,CAAC,UAAU,CAAC,YAAY,EAAE,IAAI;IAgBvC,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM;IAY5C,SAAS,CAAC,eAAe,UAAW,SAAS,UAQ5C;IAGD,SAAS,CAAC,cAAc,UAAW,SAAS,UAK3C;IAED,SAAS,CAAC,eAAe,UAAW,SAAS,UAM5C;IAED,SAAS,CAAC,UAAU,UAAW,SAAS,UAcvC;IAED,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO;IA4BnC,MAAM;CAkEP"}
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export { LeuRadio } from './Radio.js';
|
|
|
18
18
|
export { LeuRadioGroup } from './RadioGroup.js';
|
|
19
19
|
export { LeuSelect } from './Select.js';
|
|
20
20
|
export { LeuTable } from './Table.js';
|
|
21
|
-
export { L as LeuElement } from './LeuElement-
|
|
21
|
+
export { L as LeuElement } from './LeuElement-CcarVabH.js';
|
|
22
22
|
import './_tslib-CNEFicEt.js';
|
|
23
23
|
import 'lit';
|
|
24
24
|
import 'lit/static-html.js';
|
package/dist/leu-accordion.js
CHANGED
package/dist/leu-button-group.js
CHANGED
package/dist/leu-button.js
CHANGED
|
@@ -5,7 +5,7 @@ import 'lit/directives/class-map.js';
|
|
|
5
5
|
import 'lit/directives/if-defined.js';
|
|
6
6
|
import 'lit/decorators.js';
|
|
7
7
|
import './Icon.js';
|
|
8
|
-
import './LeuElement-
|
|
8
|
+
import './LeuElement-CcarVabH.js';
|
|
9
9
|
import './hasSlotController-Bm2tipvG.js';
|
|
10
10
|
|
|
11
11
|
LeuButton.define("leu-button");
|
|
@@ -2,7 +2,7 @@ import { LeuChartWrapper } from './ChartWrapper.js';
|
|
|
2
2
|
import './_tslib-CNEFicEt.js';
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit/decorators.js';
|
|
5
|
-
import './LeuElement-
|
|
5
|
+
import './LeuElement-CcarVabH.js';
|
|
6
6
|
import './hasSlotController-Bm2tipvG.js';
|
|
7
7
|
import './Spinner.js';
|
|
8
8
|
|
package/dist/leu-checkbox.js
CHANGED
package/dist/leu-chip-group.js
CHANGED
package/dist/leu-chip-link.js
CHANGED
package/dist/leu-dialog.js
CHANGED
|
@@ -2,7 +2,7 @@ import { LeuDialog } from './Dialog.js';
|
|
|
2
2
|
import 'lit';
|
|
3
3
|
import 'lit/directives/ref.js';
|
|
4
4
|
import 'lit/directives/class-map.js';
|
|
5
|
-
import './LeuElement-
|
|
5
|
+
import './LeuElement-CcarVabH.js';
|
|
6
6
|
import './hasSlotController-Bm2tipvG.js';
|
|
7
7
|
import './Icon.js';
|
|
8
8
|
import './_tslib-CNEFicEt.js';
|
package/dist/leu-dropdown.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LeuDropdown } from './Dropdown.js';
|
|
2
2
|
import 'lit';
|
|
3
3
|
import 'lit/directives/ref.js';
|
|
4
|
-
import './LeuElement-
|
|
4
|
+
import './LeuElement-CcarVabH.js';
|
|
5
5
|
import './hasSlotController-Bm2tipvG.js';
|
|
6
6
|
import './Button.js';
|
|
7
7
|
import './_tslib-CNEFicEt.js';
|
package/dist/leu-file-input.js
CHANGED
|
@@ -4,7 +4,7 @@ import 'lit';
|
|
|
4
4
|
import 'lit/decorators.js';
|
|
5
5
|
import 'lit/directives/if-defined.js';
|
|
6
6
|
import 'lit/directives/class-map.js';
|
|
7
|
-
import './LeuElement-
|
|
7
|
+
import './LeuElement-CcarVabH.js';
|
|
8
8
|
import './Accordion.js';
|
|
9
9
|
import 'lit/static-html.js';
|
|
10
10
|
import './Button.js';
|
package/dist/leu-icon.js
CHANGED
package/dist/leu-input.js
CHANGED
|
@@ -4,7 +4,7 @@ import 'lit/directives/class-map.js';
|
|
|
4
4
|
import 'lit/directives/if-defined.js';
|
|
5
5
|
import 'lit/directives/live.js';
|
|
6
6
|
import 'lit/directives/ref.js';
|
|
7
|
-
import './LeuElement-
|
|
7
|
+
import './LeuElement-CcarVabH.js';
|
|
8
8
|
import './Icon.js';
|
|
9
9
|
import './_tslib-CNEFicEt.js';
|
|
10
10
|
import 'lit/decorators.js';
|
package/dist/leu-menu-item.js
CHANGED
package/dist/leu-menu.js
CHANGED
package/dist/leu-message.js
CHANGED
package/dist/leu-pagination.js
CHANGED
|
@@ -3,7 +3,7 @@ import './_tslib-CNEFicEt.js';
|
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit/directives/live.js';
|
|
5
5
|
import 'lit/decorators.js';
|
|
6
|
-
import './LeuElement-
|
|
6
|
+
import './LeuElement-CcarVabH.js';
|
|
7
7
|
import './Button.js';
|
|
8
8
|
import 'lit/directives/class-map.js';
|
|
9
9
|
import 'lit/directives/if-defined.js';
|
package/dist/leu-placeholder.js
CHANGED
package/dist/leu-popup.js
CHANGED
package/dist/leu-progress-bar.js
CHANGED
package/dist/leu-radio-group.js
CHANGED
package/dist/leu-radio.js
CHANGED
package/dist/leu-range.js
CHANGED
package/dist/leu-scroll-top.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LeuScrollTop } from './ScrollTop.js';
|
|
2
2
|
import 'lit';
|
|
3
3
|
import 'lit/directives/class-map.js';
|
|
4
|
-
import './LeuElement-
|
|
4
|
+
import './LeuElement-CcarVabH.js';
|
|
5
5
|
import './Button.js';
|
|
6
6
|
import './_tslib-CNEFicEt.js';
|
|
7
7
|
import 'lit/directives/if-defined.js';
|
package/dist/leu-select.js
CHANGED
|
@@ -3,7 +3,7 @@ import 'lit';
|
|
|
3
3
|
import 'lit/directives/class-map.js';
|
|
4
4
|
import 'lit/directives/ref.js';
|
|
5
5
|
import 'lit/directives/if-defined.js';
|
|
6
|
-
import './LeuElement-
|
|
6
|
+
import './LeuElement-CcarVabH.js';
|
|
7
7
|
import './hasSlotController-Bm2tipvG.js';
|
|
8
8
|
import './Button.js';
|
|
9
9
|
import './_tslib-CNEFicEt.js';
|
package/dist/leu-spinner.js
CHANGED
package/dist/leu-table.js
CHANGED
|
@@ -3,7 +3,7 @@ import 'lit';
|
|
|
3
3
|
import 'lit/directives/class-map.js';
|
|
4
4
|
import 'lit/directives/style-map.js';
|
|
5
5
|
import 'lit/directives/ref.js';
|
|
6
|
-
import './LeuElement-
|
|
6
|
+
import './LeuElement-CcarVabH.js';
|
|
7
7
|
import './Icon.js';
|
|
8
8
|
import './_tslib-CNEFicEt.js';
|
|
9
9
|
import 'lit/decorators.js';
|
package/dist/leu-tag.js
CHANGED
package/dist/vue/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { LeuChipRemovable } from "../ChipRemovable.js";
|
|
|
12
12
|
import type { LeuChipSelectable, CustomEvent } from "../ChipSelectable.js";
|
|
13
13
|
import type { LeuDialog } from "../Dialog.js";
|
|
14
14
|
import type { LeuDropdown } from "../Dropdown.js";
|
|
15
|
-
import type { LeuFileInput } from "../FileInput.js";
|
|
15
|
+
import type { LeuFileInput, CustomEvent } from "../FileInput.js";
|
|
16
16
|
import type { LeuIcon } from "../Icon.js";
|
|
17
17
|
import type { LeuInput, CustomEvent } from "../Input.js";
|
|
18
18
|
import type { LeuMenu } from "../Menu.js";
|
|
@@ -208,6 +208,10 @@ type LeuFileInputProps = {
|
|
|
208
208
|
form?: LeuFileInput["form"];
|
|
209
209
|
/** */
|
|
210
210
|
name?: LeuFileInput["name"];
|
|
211
|
+
/** */
|
|
212
|
+
oninput?: (e: CustomEvent<CustomEvent>) => void;
|
|
213
|
+
/** */
|
|
214
|
+
onchange?: (e: CustomEvent<CustomEvent>) => void;
|
|
211
215
|
};
|
|
212
216
|
|
|
213
217
|
type LeuIconProps = {
|
|
@@ -632,6 +636,10 @@ export type CustomElements = {
|
|
|
632
636
|
*
|
|
633
637
|
* ---
|
|
634
638
|
*
|
|
639
|
+
*
|
|
640
|
+
* ### **Events:**
|
|
641
|
+
* - **input**
|
|
642
|
+
* - **change**
|
|
635
643
|
*/
|
|
636
644
|
"leu-file-input": DefineComponent<LeuFileInputProps>;
|
|
637
645
|
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@statistikzh/leu",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -597,7 +597,7 @@
|
|
|
597
597
|
},
|
|
598
598
|
{
|
|
599
599
|
"name": "leu-file-input",
|
|
600
|
-
"description": "\n---\n",
|
|
600
|
+
"description": "\n---\n\n\n### **Events:**\n - **input**\n- **change**",
|
|
601
601
|
"doc-url": "",
|
|
602
602
|
"attributes": [
|
|
603
603
|
{
|
|
@@ -633,7 +633,10 @@
|
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
],
|
|
636
|
-
"events": [
|
|
636
|
+
"events": [
|
|
637
|
+
{ "name": "input", "type": "CustomEvent" },
|
|
638
|
+
{ "name": "change", "type": "CustomEvent" }
|
|
639
|
+
],
|
|
637
640
|
"js": {
|
|
638
641
|
"properties": [
|
|
639
642
|
{ "name": "label", "type": "string" },
|
|
@@ -667,7 +670,10 @@
|
|
|
667
670
|
{ "name": "form" },
|
|
668
671
|
{ "name": "name" }
|
|
669
672
|
],
|
|
670
|
-
"events": [
|
|
673
|
+
"events": [
|
|
674
|
+
{ "name": "input", "type": "CustomEvent" },
|
|
675
|
+
{ "name": "change", "type": "CustomEvent" }
|
|
676
|
+
]
|
|
671
677
|
}
|
|
672
678
|
},
|
|
673
679
|
{
|
package/package.json
CHANGED
|
@@ -10,6 +10,11 @@ import { LeuButton } from "../../index.js"
|
|
|
10
10
|
import { LeuIcon } from "../icon/leu-icon.js"
|
|
11
11
|
import { LeuVisuallyHidden } from "../visually-hidden/VisuallyHidden.js"
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @todo Pluralize text when multiple files are allowed
|
|
15
|
+
* @todo Hide dropzone when not multiple and already filled
|
|
16
|
+
*/
|
|
17
|
+
|
|
13
18
|
/**
|
|
14
19
|
* @tagname leu-file-input
|
|
15
20
|
*/
|
|
@@ -100,6 +105,16 @@ export class LeuFileInput extends LeuElement {
|
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
107
|
|
|
108
|
+
private handleChange(event: Event & { target: HTMLInputElement }) {
|
|
109
|
+
const customEvent = new CustomEvent(event.type, event)
|
|
110
|
+
this.dispatchEvent(customEvent)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
public formResetCallback() {
|
|
114
|
+
this.files = []
|
|
115
|
+
this.input.value = ""
|
|
116
|
+
}
|
|
117
|
+
|
|
103
118
|
protected updateFormValue() {
|
|
104
119
|
const formData = new FormData()
|
|
105
120
|
|
|
@@ -114,6 +129,18 @@ export class LeuFileInput extends LeuElement {
|
|
|
114
129
|
|
|
115
130
|
protected removeFile(fileToRemove: File) {
|
|
116
131
|
this.files = this.files.filter((file) => file !== fileToRemove)
|
|
132
|
+
this.dispatchEvent(
|
|
133
|
+
new CustomEvent("input", {
|
|
134
|
+
composed: true,
|
|
135
|
+
bubbles: true,
|
|
136
|
+
}),
|
|
137
|
+
)
|
|
138
|
+
this.dispatchEvent(
|
|
139
|
+
new CustomEvent("change", {
|
|
140
|
+
composed: true,
|
|
141
|
+
bubbles: true,
|
|
142
|
+
}),
|
|
143
|
+
)
|
|
117
144
|
}
|
|
118
145
|
|
|
119
146
|
protected static formatFileSize(size: number) {
|
|
@@ -215,6 +242,7 @@ export class LeuFileInput extends LeuElement {
|
|
|
215
242
|
accept=${ifDefined(this.accept)}
|
|
216
243
|
?disabled=${this.disabled}
|
|
217
244
|
@input=${this.handleInput}
|
|
245
|
+
@change=${this.handleChange}
|
|
218
246
|
/>
|
|
219
247
|
</leu-visually-hidden>
|
|
220
248
|
<div
|