@nysds/nys-fileinput 1.19.0 → 1.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.
@@ -0,0 +1,118 @@
1
+ import { LitElement } from "lit";
2
+ import "./nys-fileitem";
3
+ /**
4
+ * A file input for uploading files with support for multiple files, drag-and-drop, and progress tracking.
5
+ * Validates file types via magic bytes (not just extension). Form-associated via ElementInternals.
6
+ *
7
+ * Use for document uploads, image uploads, or any file submission. Enable `dropzone` for drag-and-drop UI.
8
+ *
9
+ * @summary File input with drag-and-drop, validation, and progress tracking.
10
+ * @element nys-fileinput
11
+ *
12
+ * @slot description - Custom HTML description content.
13
+ *
14
+ * @fires nys-change - Fired when files are added or removed. Detail: `{id, files}`.
15
+ *
16
+ * @example Single file upload
17
+ * ```html
18
+ * <nys-fileinput label="Upload document" accept=".pdf,.doc" required></nys-fileinput>
19
+ * ```
20
+ *
21
+ * @example Multiple files with dropzone
22
+ * ```html
23
+ * <nys-fileinput label="Upload images" accept="image/*" multiple dropzone></nys-fileinput>
24
+ * ```
25
+ */
26
+ export declare class NysFileinput extends LitElement {
27
+ static styles: import("lit").CSSResult;
28
+ static shadowRootOptions: {
29
+ delegatesFocus: boolean;
30
+ clonable?: boolean;
31
+ customElementRegistry?: CustomElementRegistry;
32
+ mode: ShadowRootMode;
33
+ serializable?: boolean;
34
+ slotAssignment?: SlotAssignmentMode;
35
+ };
36
+ /** Unique identifier. Auto-generated if not provided. */
37
+ id: string;
38
+ /** Name for form submission. */
39
+ name: string;
40
+ /** Visible label text. */
41
+ label: string;
42
+ /** Helper text below label. Use slot for custom HTML. */
43
+ description: string;
44
+ /** Allows selecting multiple files. */
45
+ multiple: boolean;
46
+ /** Form `id` to associate with. */
47
+ form: string | null;
48
+ /** Tooltip text shown on hover/focus of info icon. */
49
+ tooltip: string;
50
+ /** Accepted file types. Use MIME types (`image/*`) or extensions (`.pdf`). Validated via magic bytes. */
51
+ accept: string;
52
+ /** Prevents interaction. */
53
+ disabled: boolean;
54
+ /** Requires at least one file to be uploaded. */
55
+ required: boolean;
56
+ /** Shows "Optional" flag. */
57
+ optional: boolean;
58
+ /** Shows error message when true. */
59
+ showError: boolean;
60
+ /** Error message text. Shown only when `showError` is true. */
61
+ errorMessage: string;
62
+ /** Enables drag-and-drop zone UI. */
63
+ dropzone: boolean;
64
+ /**
65
+ * Component width: `lg` (384px) or `full` (100%, default).
66
+ * @default "full"
67
+ */
68
+ width: "lg" | "full";
69
+ /** Adjusts colors for dark backgrounds. */
70
+ inverted: boolean;
71
+ private _selectedFiles;
72
+ private _dragActive;
73
+ private get _isDropDisabled();
74
+ private get _buttonAriaLabel();
75
+ private get _buttonAriaDescription();
76
+ private get _innerNysButton();
77
+ private _internals;
78
+ /**
79
+ * Lifecycle methods
80
+ * --------------------------------------------------------------------------
81
+ */
82
+ static formAssociated: boolean;
83
+ constructor();
84
+ connectedCallback(): void;
85
+ disconnectedCallback(): void;
86
+ firstUpdated(): void;
87
+ /**
88
+ * Form Integration
89
+ * --------------------------------------------------------------------------
90
+ */
91
+ private _setValue;
92
+ private _manageRequire;
93
+ private _setValidityMessage;
94
+ private _validate;
95
+ checkValidity(): boolean;
96
+ formResetCallback(): void;
97
+ private _handleInvalid;
98
+ /**
99
+ * Functions
100
+ * --------------------------------------------------------------------------
101
+ */
102
+ private _saveSelectedFiles;
103
+ private _processFile;
104
+ private _dispatchChangeEvent;
105
+ private _openFileDialog;
106
+ private _handlePostFileSelectionFocus;
107
+ private _focusFirstFileItemIfSingleMode;
108
+ /**
109
+ * Event Handlers
110
+ * --------------------------------------------------------------------------
111
+ */
112
+ private _handleFileChange;
113
+ private _handleFileRemove;
114
+ private _onDragOver;
115
+ private _onDragLeave;
116
+ private _onDrop;
117
+ render(): import("lit-html").TemplateResult<1>;
118
+ }
@@ -6,7 +6,7 @@ import { ifDefined as m } from "lit/directives/if-defined.js";
6
6
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
7
7
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
8
8
  *
9
- * Fileinput Component v1.19.0
9
+ * Fileinput Component v1.19.2
10
10
  * Part of the New York State Design System
11
11
  * Repository: https://github.com/its-hcd/nysds
12
12
  * License: MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-fileinput",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "description": "The Fileinput component from the NYS Design System.",
5
5
  "module": "dist/nys-fileinput.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,10 +23,10 @@
23
23
  "lit-analyze": "lit-analyzer '**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.19.0",
27
- "@nysds/nys-button": "^1.19.0",
28
- "@nysds/nys-label": "^1.19.0",
29
- "@nysds/nys-errormessage": "^1.19.0"
26
+ "@nysds/nys-icon": "^1.19.2",
27
+ "@nysds/nys-button": "^1.19.2",
28
+ "@nysds/nys-label": "^1.19.2",
29
+ "@nysds/nys-errormessage": "^1.19.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "lit": "^3.3.1",
@@ -43,5 +43,6 @@
43
43
  "forms"
44
44
  ],
45
45
  "author": "New York State Design System Team",
46
- "license": "MIT"
46
+ "license": "MIT",
47
+ "sideEffects": true
47
48
  }