@nysds/nys-datepicker 1.14.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.
- package/dist/nys-datepicker.js +338 -321
- package/dist/nys-datepicker.js.map +1 -1
- package/package.json +6 -6
- package/dist/index.d.ts +0 -1
- package/dist/nys-datepicker.d.ts +0 -174
- package/dist/nys-datepicker.figma.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nysds/nys-datepicker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.1",
|
|
4
4
|
"description": "The Datepicker component from the NYS Design System.",
|
|
5
5
|
"module": "dist/nys-datepicker.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": "
|
|
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.
|
|
27
|
-
"@nysds/nys-button": "^1.
|
|
28
|
-
"@nysds/nys-label": "^1.
|
|
29
|
-
"@nysds/nys-errormessage": "^1.
|
|
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
|
"wc-datepicker": "^0.9.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./nys-datepicker";
|
package/dist/nys-datepicker.d.ts
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
2
|
-
/**
|
|
3
|
-
* Date picker with calendar popup and form validation. Falls back to native date input
|
|
4
|
-
* on Safari and mobile.
|
|
5
|
-
*
|
|
6
|
-
* @summary Date picker with calendar popup and native fallback.
|
|
7
|
-
* @element nys-datepicker
|
|
8
|
-
*
|
|
9
|
-
* @fires nys-blur - Fired when input or calendar loses focus. Triggers validation.
|
|
10
|
-
* @fires nys-input - Fired on date selection. Detail: `{id, value}`.
|
|
11
|
-
*
|
|
12
|
-
* @example Basic date picker
|
|
13
|
-
* ```html
|
|
14
|
-
* <nys-datepicker label="Birth Date" required></nys-datepicker>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @example With width and description
|
|
18
|
-
* ```html
|
|
19
|
-
* <nys-datepicker
|
|
20
|
-
* label="Event Date"
|
|
21
|
-
* description="Select the date of your event"
|
|
22
|
-
* width="lg">
|
|
23
|
-
* </nys-datepicker>
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @example Hide buttons, set start date
|
|
27
|
-
* ```html
|
|
28
|
-
* <nys-datepicker
|
|
29
|
-
* label="Appointment"
|
|
30
|
-
* hideTodayButton
|
|
31
|
-
* hideClearButton
|
|
32
|
-
* startDate="2024-01-01">
|
|
33
|
-
* </nys-datepicker>
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @example With validation error message
|
|
37
|
-
* ```html
|
|
38
|
-
* <nys-datepicker
|
|
39
|
-
* label="Start Date"
|
|
40
|
-
* required
|
|
41
|
-
* errorMessage="Please select a valid start date">
|
|
42
|
-
* </nys-datepicker>
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare class NysDatepicker extends LitElement {
|
|
46
|
-
static styles: import("lit").CSSResult;
|
|
47
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
48
|
-
id: string;
|
|
49
|
-
/** Name for form submission. */
|
|
50
|
-
name: string;
|
|
51
|
-
/**
|
|
52
|
-
* Input width: `md` (200px), `lg` (384px), `full` (100%).
|
|
53
|
-
* @default "md"
|
|
54
|
-
*/
|
|
55
|
-
width: "md" | "lg" | "full";
|
|
56
|
-
/** Hide the "Today" button in calendar popup. */
|
|
57
|
-
hideTodayButton: boolean;
|
|
58
|
-
/** Hide the "Clear" button in calendar popup. */
|
|
59
|
-
hideClearButton: boolean;
|
|
60
|
-
/** Disable interaction. */
|
|
61
|
-
disabled: boolean;
|
|
62
|
-
/** Mark as required. Shows "Required" flag and validates on blur. */
|
|
63
|
-
required: boolean;
|
|
64
|
-
/** Show "Optional" flag. Use when most fields are required. */
|
|
65
|
-
optional: boolean;
|
|
66
|
-
/** Show error state. */
|
|
67
|
-
showError: boolean;
|
|
68
|
-
/** Error message text. */
|
|
69
|
-
errorMessage: string;
|
|
70
|
-
/** Form `id` to associate with when input is outside form. */
|
|
71
|
-
form: string | null;
|
|
72
|
-
/** Tooltip text on info icon hover. */
|
|
73
|
-
tooltip: string;
|
|
74
|
-
/** Input type. Currently only supports `date`. */
|
|
75
|
-
type: string;
|
|
76
|
-
/** Label text. Required for accessibility. */
|
|
77
|
-
label: string;
|
|
78
|
-
/** Helper text below label. */
|
|
79
|
-
description: string;
|
|
80
|
-
/** Initial date when calendar opens (YYYY-MM-DD). */
|
|
81
|
-
startDate: string;
|
|
82
|
-
/** Dark background mode. */
|
|
83
|
-
inverted: boolean;
|
|
84
|
-
/** Selected date. Accepts Date object or ISO string (YYYY-MM-DD). */
|
|
85
|
-
value: string | Date | undefined;
|
|
86
|
-
private datepickerIsOpen;
|
|
87
|
-
private _hasUserInteracted;
|
|
88
|
-
private _internals;
|
|
89
|
-
/**
|
|
90
|
-
* Lifecycle methods
|
|
91
|
-
* --------------------------------------------------------------------------
|
|
92
|
-
*/
|
|
93
|
-
static formAssociated: boolean;
|
|
94
|
-
constructor();
|
|
95
|
-
connectedCallback(): void;
|
|
96
|
-
disconnectedCallback(): void;
|
|
97
|
-
firstUpdated(): Promise<void>;
|
|
98
|
-
private _whenWcDatepickerReady;
|
|
99
|
-
/**
|
|
100
|
-
* Form Integration
|
|
101
|
-
* --------------------------------------------------------------------------
|
|
102
|
-
*/
|
|
103
|
-
/**
|
|
104
|
-
* Form helper methods:
|
|
105
|
-
* - _setValue: set internal value and trigger validation
|
|
106
|
-
* - _manageRequire: handle required state
|
|
107
|
-
* - _validate: actively validate and show errors
|
|
108
|
-
* - checkValidity: passive boolean check without UI
|
|
109
|
-
* - _setValidityMessage: sync validation message with UI and internals
|
|
110
|
-
* - _handleInvalid: handle form invalid event and focus first invalid field
|
|
111
|
-
*/
|
|
112
|
-
private _setValue;
|
|
113
|
-
private _manageRequire;
|
|
114
|
-
/**
|
|
115
|
-
* Actively validates the component:
|
|
116
|
-
* - Updates internal validity state
|
|
117
|
-
* - Updates UI (e.g. showError)
|
|
118
|
-
* - Called on blur/change or form submission
|
|
119
|
-
*/
|
|
120
|
-
private _validate;
|
|
121
|
-
/**
|
|
122
|
-
* Passive check of validity:
|
|
123
|
-
* - Returns true/false
|
|
124
|
-
* - Does NOT update UI or show errors
|
|
125
|
-
* - Used in form submission checks
|
|
126
|
-
*/
|
|
127
|
-
checkValidity(): boolean;
|
|
128
|
-
private _setValidityMessage;
|
|
129
|
-
private _handleInvalid;
|
|
130
|
-
/**
|
|
131
|
-
* Functions
|
|
132
|
-
* --------------------------------------------------------------------------
|
|
133
|
-
*/
|
|
134
|
-
/**
|
|
135
|
-
* Replaces the default wc-datepicker month navigation buttons
|
|
136
|
-
* with NYS icon components for previous and next month.
|
|
137
|
-
*/
|
|
138
|
-
private _replaceButtonSVG;
|
|
139
|
-
private _addMonthDropdownIcon;
|
|
140
|
-
private _parseLocalDate;
|
|
141
|
-
private _setTodayDate;
|
|
142
|
-
private _setFocusOnTodayDate;
|
|
143
|
-
/**
|
|
144
|
-
* Event Handlers
|
|
145
|
-
* --------------------------------------------------------------------------
|
|
146
|
-
*/
|
|
147
|
-
private _handleInputKeydown;
|
|
148
|
-
private _handleBlur;
|
|
149
|
-
private _onDocumentClick;
|
|
150
|
-
private _onKeydownEsc;
|
|
151
|
-
private _toggleDatepicker;
|
|
152
|
-
private _openDatepicker;
|
|
153
|
-
private _handleDateChange;
|
|
154
|
-
private _handleTodayClick;
|
|
155
|
-
private _handleClearClick;
|
|
156
|
-
private _handleInputChange;
|
|
157
|
-
private _getValidDateFromInput;
|
|
158
|
-
private _handleFocusTrap;
|
|
159
|
-
private _isSafari;
|
|
160
|
-
/**
|
|
161
|
-
* Determines whether the current device uses a coarse pointer.
|
|
162
|
-
* A coarse pointer usually means touch-based input where precise pointing
|
|
163
|
-
* is not expected, such as fingers on phones and most tablets.
|
|
164
|
-
*
|
|
165
|
-
* Note: This is not a guarantee of a mobile device.
|
|
166
|
-
* Some non-mobile devices may also report a coarse pointer,
|
|
167
|
-
* and some mobile devices may not.
|
|
168
|
-
*
|
|
169
|
-
* @returns `true` if the device reports a coarse pointer, otherwise `false`.
|
|
170
|
-
*/
|
|
171
|
-
private _isMobile;
|
|
172
|
-
private _shouldUseNativeDatepicker;
|
|
173
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
174
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|