@nysds/nys-fileinput 1.15.0 → 1.15.1

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.
@@ -6,7 +6,7 @@ import { ifDefined as m } from "lit/directives/if-defined.js";
6
6
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
7
7
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
8
8
  *
9
- * Fileinput Component
9
+ * Fileinput Component v1.15.1
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.15.0",
3
+ "version": "1.15.1",
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",
@@ -16,17 +16,17 @@
16
16
  ],
17
17
  "scripts": {
18
18
  "dev": "tsc --emitDeclarationOnly && vite",
19
- "build": "tsc --emitDeclarationOnly && vite build",
19
+ "build": "vite build",
20
20
  "test": "vite build && wtr",
21
21
  "build:watch": "tsc --emitDeclarationOnly && vite build --watch",
22
22
  "test:watch": "vite build && wtr --watch",
23
23
  "lit-analyze": "lit-analyzer '**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.15.0",
27
- "@nysds/nys-button": "^1.15.0",
28
- "@nysds/nys-label": "^1.15.0",
29
- "@nysds/nys-errormessage": "^1.15.0"
26
+ "@nysds/nys-icon": "^1.15.1",
27
+ "@nysds/nys-button": "^1.15.1",
28
+ "@nysds/nys-label": "^1.15.1",
29
+ "@nysds/nys-errormessage": "^1.15.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "lit": "^3.3.1",
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./nys-fileinput";
@@ -1,118 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,37 +0,0 @@
1
- import { LitElement } from "lit";
2
- /**
3
- * **Internal component.** Displays an individual file within `nys-fileinput` with status and progress.
4
- *
5
- * Rendered automatically by `nys-fileinput` for each selected file. Shows filename, upload status
6
- * (pending/processing/done/error), progress bar during upload, and error messages. Remove button emits event.
7
- *
8
- * @summary Internal file item display with status, progress bar, and remove action.
9
- * @element nys-fileitem
10
- *
11
- * @fires nys-fileRemove - Fired when remove button is clicked. Detail: `{filename}`.
12
- */
13
- export declare class NysFileItem extends LitElement {
14
- static styles: import("lit").CSSResult;
15
- static shadowRootOptions: {
16
- delegatesFocus: boolean;
17
- clonable?: boolean;
18
- customElementRegistry?: CustomElementRegistry;
19
- mode: ShadowRootMode;
20
- serializable?: boolean;
21
- slotAssignment?: SlotAssignmentMode;
22
- };
23
- /** Name of the file being displayed. */
24
- filename: string;
25
- /**
26
- * Upload status: `pending` (queued), `processing` (uploading), `done` (complete), `error` (failed).
27
- * @default "pending"
28
- */
29
- status: "pending" | "processing" | "done" | "error";
30
- /** Upload progress percentage (0-100). Only shown when status is `processing`. */
31
- progress: number;
32
- /** Error message displayed when status is `error`. */
33
- errorMessage: string;
34
- private _handleRemove;
35
- private splitFilename;
36
- render(): import("lit-html").TemplateResult<1>;
37
- }
@@ -1 +0,0 @@
1
- export declare function validateFileHeader(file: File, accept: string): Promise<boolean>;