@nysds/components 1.13.1 → 1.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.
- package/custom-elements.json +2061 -237
- package/dist/.vscode/vscode.css-custom-data.json +15 -0
- package/dist/.vscode/vscode.html-custom-data.json +158 -24
- package/dist/custom-elements.json +2061 -237
- package/dist/nysds.es.js +3178 -1988
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +442 -168
- package/dist/nysds.js.map +1 -1
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +4 -0
- package/dist/packages/nys-button/src/nys-button.d.ts +8 -0
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +20 -0
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +15 -0
- package/dist/packages/nys-combobox/src/index.d.ts +1 -0
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +118 -0
- package/dist/packages/nys-combobox/src/nys-combobox.figma.d.ts +1 -0
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +74 -7
- package/dist/packages/nys-dropdownmenu/src/index.d.ts +2 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +110 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.figma.d.ts +1 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +40 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +8 -0
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +8 -0
- package/dist/packages/nys-label/src/nys-label.d.ts +5 -0
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +20 -0
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +9 -0
- package/dist/packages/nys-select/src/nys-select.d.ts +8 -0
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +8 -0
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +11 -1
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +10 -1
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +10 -1
- package/dist/src/index.d.ts +2 -0
- package/package.json +21 -17
- package/dist/nys-stepper/newsletter.html +0 -4
- package/dist/nys-stepper/personal.html +0 -6
- package/dist/nys-stepper/survey.html +0 -5
- package/dist/nys-stepper/team.html +0 -6
|
@@ -11,6 +11,10 @@ import "./nys-accordionitem";
|
|
|
11
11
|
*
|
|
12
12
|
* @slot - Default slot for `nys-accordionitem` elements.
|
|
13
13
|
*
|
|
14
|
+
* @cssprop [--nys-accordion-background-color--header] - Background color of the accordion header.
|
|
15
|
+
* @cssprop [--nys-accordion-background-color--header--hover] - Background hover color of the accordion header.
|
|
16
|
+
* @cssprop [--nys-accordion-content-max-width] - Maximum readable width of accordion content. Defaults to a character-based width (80ch) for readability.
|
|
17
|
+
*
|
|
14
18
|
* @example Basic accordion
|
|
15
19
|
* ```html
|
|
16
20
|
* <nys-accordion>
|
|
@@ -59,6 +59,14 @@ import { LitElement } from "lit";
|
|
|
59
59
|
*/
|
|
60
60
|
export declare class NysButton extends LitElement {
|
|
61
61
|
static styles: import("lit").CSSResult;
|
|
62
|
+
static shadowRootOptions: {
|
|
63
|
+
delegatesFocus: boolean;
|
|
64
|
+
clonable?: boolean;
|
|
65
|
+
customElementRegistry?: CustomElementRegistry;
|
|
66
|
+
mode: ShadowRootMode;
|
|
67
|
+
serializable?: boolean;
|
|
68
|
+
slotAssignment?: SlotAssignmentMode;
|
|
69
|
+
};
|
|
62
70
|
/**
|
|
63
71
|
* Unique identifier. Auto-generated if not provided.
|
|
64
72
|
*/
|
|
@@ -15,6 +15,7 @@ import "./nys-checkboxgroup";
|
|
|
15
15
|
* @fires nys-change - Fired when checked state changes. Detail: `{id, checked, name, value}`.
|
|
16
16
|
* @fires nys-focus - Fired when checkbox gains focus.
|
|
17
17
|
* @fires nys-blur - Fired when checkbox loses focus.
|
|
18
|
+
* @fires nys-other-input - Fired when "other" text input value changes. Detail: `{id, name, value}`.
|
|
18
19
|
*
|
|
19
20
|
* @example Single checkbox
|
|
20
21
|
* ```html
|
|
@@ -31,6 +32,14 @@ import "./nys-checkboxgroup";
|
|
|
31
32
|
*/
|
|
32
33
|
export declare class NysCheckbox extends LitElement {
|
|
33
34
|
static styles: import("lit").CSSResult;
|
|
35
|
+
static shadowRootOptions: {
|
|
36
|
+
delegatesFocus: boolean;
|
|
37
|
+
clonable?: boolean;
|
|
38
|
+
customElementRegistry?: CustomElementRegistry;
|
|
39
|
+
mode: ShadowRootMode;
|
|
40
|
+
serializable?: boolean;
|
|
41
|
+
slotAssignment?: SlotAssignmentMode;
|
|
42
|
+
};
|
|
34
43
|
/** Whether checkbox is checked. */
|
|
35
44
|
checked: boolean;
|
|
36
45
|
/** Prevents interaction. */
|
|
@@ -66,6 +75,10 @@ export declare class NysCheckbox extends LitElement {
|
|
|
66
75
|
* @default "md"
|
|
67
76
|
*/
|
|
68
77
|
size: "sm" | "md";
|
|
78
|
+
other: boolean;
|
|
79
|
+
showOtherError: boolean;
|
|
80
|
+
private isMobile;
|
|
81
|
+
private _hasUserInteracted;
|
|
69
82
|
getInputElement(): Promise<HTMLInputElement | null>;
|
|
70
83
|
private _internals;
|
|
71
84
|
/**
|
|
@@ -93,14 +106,21 @@ export declare class NysCheckbox extends LitElement {
|
|
|
93
106
|
checkValidity(): boolean;
|
|
94
107
|
private _handleInvalid;
|
|
95
108
|
private _manageLabelClick;
|
|
109
|
+
get _hasDescription(): boolean;
|
|
110
|
+
private _handleResize;
|
|
96
111
|
/**
|
|
97
112
|
* Event Handlers
|
|
98
113
|
* --------------------------------------------------------------------------
|
|
99
114
|
*/
|
|
100
115
|
private _emitChangeEvent;
|
|
116
|
+
private _emitOtherInputEvent;
|
|
101
117
|
private _handleChange;
|
|
102
118
|
private _handleFocus;
|
|
103
119
|
private _handleBlur;
|
|
120
|
+
private _handleTextInputBlur;
|
|
104
121
|
private _handleKeydown;
|
|
122
|
+
private _handleTextInput;
|
|
123
|
+
private _validateOtherAndEmitError;
|
|
124
|
+
private _dispatchClearError;
|
|
105
125
|
render(): import("lit-html").TemplateResult<1>;
|
|
106
126
|
}
|
|
@@ -22,6 +22,14 @@ import { LitElement } from "lit";
|
|
|
22
22
|
*/
|
|
23
23
|
export declare class NysCheckboxgroup extends LitElement {
|
|
24
24
|
static styles: import("lit").CSSResult;
|
|
25
|
+
static shadowRootOptions: {
|
|
26
|
+
delegatesFocus: boolean;
|
|
27
|
+
clonable?: boolean;
|
|
28
|
+
customElementRegistry?: CustomElementRegistry;
|
|
29
|
+
mode: ShadowRootMode;
|
|
30
|
+
serializable?: boolean;
|
|
31
|
+
slotAssignment?: SlotAssignmentMode;
|
|
32
|
+
};
|
|
25
33
|
/** Unique identifier. Auto-generated if not provided. */
|
|
26
34
|
id: string;
|
|
27
35
|
/** Name for form submission. Set on group, not individual checkboxes. */
|
|
@@ -52,6 +60,8 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
52
60
|
*/
|
|
53
61
|
size: "sm" | "md";
|
|
54
62
|
private _slottedDescriptionText;
|
|
63
|
+
private _hasOtherError;
|
|
64
|
+
private _otherErrorCheckbox;
|
|
55
65
|
private _internals;
|
|
56
66
|
/**
|
|
57
67
|
* Lifecycle methods
|
|
@@ -67,9 +77,11 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
67
77
|
* Functions
|
|
68
78
|
* --------------------------------------------------------------------------
|
|
69
79
|
*/
|
|
80
|
+
private _hasAtLeastOneChecked;
|
|
70
81
|
private _setGroupExist;
|
|
71
82
|
private _setupCheckboxRequired;
|
|
72
83
|
private _manageRequire;
|
|
84
|
+
private _setCustomOtherError;
|
|
73
85
|
private _updateCheckboxSize;
|
|
74
86
|
private _updateCheckboxTile;
|
|
75
87
|
private _updateCheckboxInvert;
|
|
@@ -83,5 +95,8 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
83
95
|
* --------------------------------------------------------------------------
|
|
84
96
|
*/
|
|
85
97
|
private _handleCheckboxChange;
|
|
98
|
+
private _handleChildError;
|
|
99
|
+
private _handleChildErrorClear;
|
|
100
|
+
private _checkOtherInputs;
|
|
86
101
|
render(): import("lit-html").TemplateResult<1>;
|
|
87
102
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./nys-combobox";
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-combobox>` is a form-enabled combo box combining text input with a filterable dropdown.
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Type to filter options
|
|
7
|
+
* - Keyboard navigation (Arrow keys, Enter, Escape)
|
|
8
|
+
* - Mouse and keyboard interaction
|
|
9
|
+
* - Clears non-selected text on blur
|
|
10
|
+
* - Clear button when value is selected
|
|
11
|
+
* - Integrates with forms via ElementInternals
|
|
12
|
+
* - Supports native <option> and <optgroup> elements
|
|
13
|
+
* - Accessible per W3C ARIA Authoring Practices
|
|
14
|
+
*
|
|
15
|
+
* @slot description - Optional custom description content below the label.
|
|
16
|
+
* @slot default - Options (<option>, <optgroup>) to populate the dropdown
|
|
17
|
+
*
|
|
18
|
+
* @fires nys-change - Fired when selection changes. Detail: `{ id, value }`.
|
|
19
|
+
* @fires nys-input - Fired on input change. Detail: `{ id, value }`.
|
|
20
|
+
* @fires nys-focus - Fired when combobox receives focus.
|
|
21
|
+
* @fires nys-blur - Fired when combobox loses focus.
|
|
22
|
+
*/
|
|
23
|
+
export declare class NysCombobox extends LitElement {
|
|
24
|
+
static styles: import("lit").CSSResult;
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
label: string;
|
|
28
|
+
description: string;
|
|
29
|
+
value: string;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
required: boolean;
|
|
32
|
+
optional: boolean;
|
|
33
|
+
tooltip: string;
|
|
34
|
+
form: string | null;
|
|
35
|
+
width: "md" | "lg" | "full";
|
|
36
|
+
inverted: boolean;
|
|
37
|
+
showError: boolean;
|
|
38
|
+
errorMessage: string;
|
|
39
|
+
private _isOpen;
|
|
40
|
+
private _filterText;
|
|
41
|
+
private _highlightedIndex;
|
|
42
|
+
private _options;
|
|
43
|
+
private _filteredOptions;
|
|
44
|
+
private _dropdownAbove;
|
|
45
|
+
private _announcement;
|
|
46
|
+
private _input;
|
|
47
|
+
private _listbox?;
|
|
48
|
+
private _originalErrorMessage;
|
|
49
|
+
private _hasUserInteracted;
|
|
50
|
+
private _internals;
|
|
51
|
+
private _selectedLabel;
|
|
52
|
+
private _defaultValue;
|
|
53
|
+
/**
|
|
54
|
+
* Lifecycle methods
|
|
55
|
+
* --------------------------------------------------------------------------
|
|
56
|
+
*/
|
|
57
|
+
static formAssociated: boolean;
|
|
58
|
+
constructor();
|
|
59
|
+
connectedCallback(): void;
|
|
60
|
+
disconnectedCallback(): void;
|
|
61
|
+
firstUpdated(): void;
|
|
62
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
63
|
+
/**
|
|
64
|
+
* Slot handling
|
|
65
|
+
* --------------------------------------------------------------------------
|
|
66
|
+
*/
|
|
67
|
+
private _handleSlotChange;
|
|
68
|
+
/**
|
|
69
|
+
* Form Integration
|
|
70
|
+
* --------------------------------------------------------------------------
|
|
71
|
+
*/
|
|
72
|
+
private _setValue;
|
|
73
|
+
private _manageRequire;
|
|
74
|
+
private _setValidityMessage;
|
|
75
|
+
private _validate;
|
|
76
|
+
formResetCallback(): void;
|
|
77
|
+
checkValidity(): boolean;
|
|
78
|
+
private _handleInvalid;
|
|
79
|
+
/**
|
|
80
|
+
* Dropdown positioning
|
|
81
|
+
* --------------------------------------------------------------------------
|
|
82
|
+
*/
|
|
83
|
+
private _positionDropdown;
|
|
84
|
+
/**
|
|
85
|
+
* Filtering
|
|
86
|
+
* --------------------------------------------------------------------------
|
|
87
|
+
*/
|
|
88
|
+
private _filterOptions;
|
|
89
|
+
/**
|
|
90
|
+
* Keyboard navigation
|
|
91
|
+
* --------------------------------------------------------------------------
|
|
92
|
+
*/
|
|
93
|
+
private _scrollToHighlighted;
|
|
94
|
+
private _handleKeyDown;
|
|
95
|
+
private _moveHighlight;
|
|
96
|
+
/**
|
|
97
|
+
* Event Handlers
|
|
98
|
+
* --------------------------------------------------------------------------
|
|
99
|
+
*/
|
|
100
|
+
private _handleInput;
|
|
101
|
+
private _handleFocus;
|
|
102
|
+
private _handleBlur;
|
|
103
|
+
private _handleDocumentClick;
|
|
104
|
+
private _handleIconClick;
|
|
105
|
+
private _handleClearClick;
|
|
106
|
+
private _handleOptionClick;
|
|
107
|
+
private _handleOptionMouseEnter;
|
|
108
|
+
private _selectOption;
|
|
109
|
+
private _handleChange;
|
|
110
|
+
private _openDropdown;
|
|
111
|
+
private _closeDropdown;
|
|
112
|
+
/**
|
|
113
|
+
* Render helpers
|
|
114
|
+
* --------------------------------------------------------------------------
|
|
115
|
+
*/
|
|
116
|
+
private _renderOptions;
|
|
117
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
118
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,35 +1,97 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Date picker with calendar popup and form validation. Falls back to native date input
|
|
4
|
+
* on Safari and mobile.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
8
|
-
* @fires nys-input - Dispatched when user selects or types a valid date
|
|
6
|
+
* @summary Date picker with calendar popup and native fallback.
|
|
7
|
+
* @element nys-datepicker
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
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
|
+
* ```
|
|
12
44
|
*/
|
|
13
45
|
export declare class NysDatepicker extends LitElement {
|
|
14
46
|
static styles: import("lit").CSSResult;
|
|
47
|
+
static shadowRootOptions: {
|
|
48
|
+
delegatesFocus: boolean;
|
|
49
|
+
clonable?: boolean;
|
|
50
|
+
customElementRegistry?: CustomElementRegistry;
|
|
51
|
+
mode: ShadowRootMode;
|
|
52
|
+
serializable?: boolean;
|
|
53
|
+
slotAssignment?: SlotAssignmentMode;
|
|
54
|
+
};
|
|
55
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
15
56
|
id: string;
|
|
57
|
+
/** Name for form submission. */
|
|
16
58
|
name: string;
|
|
59
|
+
/**
|
|
60
|
+
* Input width: `md` (200px), `lg` (384px), `full` (100%).
|
|
61
|
+
* @default "md"
|
|
62
|
+
*/
|
|
17
63
|
width: "md" | "lg" | "full";
|
|
64
|
+
/** Hide the "Today" button in calendar popup. */
|
|
18
65
|
hideTodayButton: boolean;
|
|
66
|
+
/** Hide the "Clear" button in calendar popup. */
|
|
19
67
|
hideClearButton: boolean;
|
|
68
|
+
/** Disable interaction. */
|
|
20
69
|
disabled: boolean;
|
|
70
|
+
/** Mark as required. Shows "Required" flag and validates on blur. */
|
|
21
71
|
required: boolean;
|
|
72
|
+
/** Show "Optional" flag. Use when most fields are required. */
|
|
22
73
|
optional: boolean;
|
|
74
|
+
/** Show error state. */
|
|
23
75
|
showError: boolean;
|
|
76
|
+
/** Error message text. */
|
|
24
77
|
errorMessage: string;
|
|
78
|
+
/** Form `id` to associate with when input is outside form. */
|
|
25
79
|
form: string | null;
|
|
80
|
+
/** Tooltip text on info icon hover. */
|
|
26
81
|
tooltip: string;
|
|
82
|
+
/** Input type. Currently only supports `date`. */
|
|
27
83
|
type: string;
|
|
84
|
+
/** Label text. Required for accessibility. */
|
|
28
85
|
label: string;
|
|
86
|
+
/** Helper text below label. */
|
|
29
87
|
description: string;
|
|
88
|
+
/** Initial date when calendar opens (YYYY-MM-DD). */
|
|
30
89
|
startDate: string;
|
|
90
|
+
/** Dark background mode. */
|
|
31
91
|
inverted: boolean;
|
|
92
|
+
/** Selected date. Accepts Date object or ISO string (YYYY-MM-DD). */
|
|
32
93
|
value: string | Date | undefined;
|
|
94
|
+
private datepickerIsOpen;
|
|
33
95
|
private _hasUserInteracted;
|
|
34
96
|
private _internals;
|
|
35
97
|
/**
|
|
@@ -84,6 +146,9 @@ export declare class NysDatepicker extends LitElement {
|
|
|
84
146
|
private _replaceButtonSVG;
|
|
85
147
|
private _addMonthDropdownIcon;
|
|
86
148
|
private _parseLocalDate;
|
|
149
|
+
private _setTodayDate;
|
|
150
|
+
private _setFocusOnTodayDate;
|
|
151
|
+
private _dispatchInputEvent;
|
|
87
152
|
/**
|
|
88
153
|
* Event Handlers
|
|
89
154
|
* --------------------------------------------------------------------------
|
|
@@ -91,6 +156,7 @@ export declare class NysDatepicker extends LitElement {
|
|
|
91
156
|
private _handleInputKeydown;
|
|
92
157
|
private _handleBlur;
|
|
93
158
|
private _onDocumentClick;
|
|
159
|
+
private _onKeydownEsc;
|
|
94
160
|
private _toggleDatepicker;
|
|
95
161
|
private _openDatepicker;
|
|
96
162
|
private _handleDateChange;
|
|
@@ -98,6 +164,7 @@ export declare class NysDatepicker extends LitElement {
|
|
|
98
164
|
private _handleClearClick;
|
|
99
165
|
private _handleInputChange;
|
|
100
166
|
private _getValidDateFromInput;
|
|
167
|
+
private _handleFocusTrap;
|
|
101
168
|
private _isSafari;
|
|
102
169
|
/**
|
|
103
170
|
* Determines whether the current device uses a coarse pointer.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./nys-dropdownmenuitem";
|
|
3
|
+
/**
|
|
4
|
+
* Dropdown menus enable users to select an action from a list of options.
|
|
5
|
+
* They’re commonly used to save space by grouping related actions, or to provide actions in a confined space.
|
|
6
|
+
*
|
|
7
|
+
* @summary Action menu with auto-positioning, keyboard support, and screen reader integration.
|
|
8
|
+
* @element nys-dropdownmenu
|
|
9
|
+
*
|
|
10
|
+
* @example Basic dropdown
|
|
11
|
+
* ```html
|
|
12
|
+
* <button id="my-trigger">Actions</button>
|
|
13
|
+
* <nys-dropdownmenu for="my-trigger">
|
|
14
|
+
* <nys-dropdownmenuitem label="Edit" link="/edit"></nys-dropdownmenuitem>
|
|
15
|
+
* <nys-dropdownmenuitem label="Delete" link="/delete"></nys-dropdownmenuitem>
|
|
16
|
+
* </nys-dropdownmenu>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example Positioned dropdown
|
|
20
|
+
* ```html
|
|
21
|
+
* <button id="settings-btn">Settings</button>
|
|
22
|
+
* <nys-dropdownmenu for="settings-btn" position="top-start">
|
|
23
|
+
* <nys-dropdownmenuitem label="Profile" link="/profile"></nys-dropdownmenuitem>
|
|
24
|
+
* <nys-dropdownmenuitem label="Logout" link="/logout"></nys-dropdownmenuitem>
|
|
25
|
+
* </nys-dropdownmenu>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
type Position = "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
29
|
+
export declare class NysDropdownMenu extends LitElement {
|
|
30
|
+
static styles: import("lit").CSSResult;
|
|
31
|
+
for: string;
|
|
32
|
+
showDropdown: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Preferred position relative to trigger.
|
|
35
|
+
* @default "bottom-start"
|
|
36
|
+
*/
|
|
37
|
+
position: Position | null;
|
|
38
|
+
private _trigger;
|
|
39
|
+
private _menuElement;
|
|
40
|
+
private _ariaTarget;
|
|
41
|
+
private readonly GAP;
|
|
42
|
+
/**
|
|
43
|
+
* Lifecycle Methods
|
|
44
|
+
* --------------------------------------------------------------------------
|
|
45
|
+
*/
|
|
46
|
+
constructor();
|
|
47
|
+
connectedCallback(): void;
|
|
48
|
+
disconnectedCallback(): void;
|
|
49
|
+
firstUpdated(): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Functions
|
|
52
|
+
* --------------------------------------------------------------------------
|
|
53
|
+
*/
|
|
54
|
+
private _findTrigger;
|
|
55
|
+
private _connectTrigger;
|
|
56
|
+
private _toggleDropdown;
|
|
57
|
+
private _closeDropdown;
|
|
58
|
+
private _getMenuItems;
|
|
59
|
+
private _handleDocumentClick;
|
|
60
|
+
private _focusOnFirstItem;
|
|
61
|
+
private applyInverseTransform;
|
|
62
|
+
/**
|
|
63
|
+
* Position Logic
|
|
64
|
+
* --------------------------------------------------------------------------
|
|
65
|
+
*/
|
|
66
|
+
/**
|
|
67
|
+
* The controller function for positioning the dropdown menu.
|
|
68
|
+
* The logic diverts to if user sets position or we auto position the dropdown menu
|
|
69
|
+
*/
|
|
70
|
+
private _positionMenu;
|
|
71
|
+
private _setUserPosition;
|
|
72
|
+
/**
|
|
73
|
+
* Auto Positioning of the dropdown menu relies on the best surrounding space available
|
|
74
|
+
* to select the desirable position.
|
|
75
|
+
*/
|
|
76
|
+
private _autoPosition;
|
|
77
|
+
/**
|
|
78
|
+
* Checks if the dropdown menu fits inside the viewport on the given side of the trigger.
|
|
79
|
+
* Overrides user set position for auto-positioning if user's desire space is not available
|
|
80
|
+
*/
|
|
81
|
+
private _checkSpaceAvailable;
|
|
82
|
+
private _checkPositionFits;
|
|
83
|
+
/**
|
|
84
|
+
* This position is called for when user's set position didn't fit OR auto positioning when default position doesn't fit
|
|
85
|
+
* We look for the best alternative positions in order of preference base on the set position (e.g. bottom-start => bottom-end).
|
|
86
|
+
* @param userPosition
|
|
87
|
+
* @param space
|
|
88
|
+
* @param menuRect
|
|
89
|
+
*/
|
|
90
|
+
private _findBestAlternative;
|
|
91
|
+
private _findMostAvailableSpace;
|
|
92
|
+
/**
|
|
93
|
+
* A valid ideal position has been chosen.
|
|
94
|
+
* This function calculates the coordinate of the trigger to properly position the dropdown menu.
|
|
95
|
+
* @param position
|
|
96
|
+
* @returns
|
|
97
|
+
*/
|
|
98
|
+
private _calculateCoordinates;
|
|
99
|
+
private _applyPosition;
|
|
100
|
+
/**
|
|
101
|
+
* Event Handlers
|
|
102
|
+
* --------------------------------------------------------------------------
|
|
103
|
+
*/
|
|
104
|
+
private _handleTriggerKeydown;
|
|
105
|
+
private _handleMenuKeydown;
|
|
106
|
+
private _handleWindowResize;
|
|
107
|
+
private _handleWindowScroll;
|
|
108
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
109
|
+
}
|
|
110
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* **Slotted component.** Displays an individual dropdown item within `nys-dropdown` with label.
|
|
4
|
+
*
|
|
5
|
+
* The `nys-dropdownitem` is used as customizable item within the dropdown so users don't have to raw code <ul>, <li>, <a href>
|
|
6
|
+
* and have the benefit of default customization.
|
|
7
|
+
*
|
|
8
|
+
* @summary Dropdown item to display label and provide href link.
|
|
9
|
+
* @element nys-dropdownmenuitem
|
|
10
|
+
*
|
|
11
|
+
* @example Basic item
|
|
12
|
+
* ```html
|
|
13
|
+
* <nys-dropdownmenuitem label="Edit" link="/edit"></nys-dropdownmenuitem>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @example Disabled item
|
|
17
|
+
* ```html
|
|
18
|
+
* <nys-dropdownmenuitem label="Delete" link="/delete" disabled></nys-dropdownmenuitem>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class NysDropdownMenuItem extends LitElement {
|
|
22
|
+
static styles: import("lit").CSSResult;
|
|
23
|
+
static shadowRootOptions: {
|
|
24
|
+
delegatesFocus: boolean;
|
|
25
|
+
clonable?: boolean;
|
|
26
|
+
customElementRegistry?: CustomElementRegistry;
|
|
27
|
+
mode: ShadowRootMode;
|
|
28
|
+
serializable?: boolean;
|
|
29
|
+
slotAssignment?: SlotAssignmentMode;
|
|
30
|
+
};
|
|
31
|
+
label: string;
|
|
32
|
+
href: string;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
target: string;
|
|
35
|
+
prefixIcon: string;
|
|
36
|
+
divider: string;
|
|
37
|
+
connectedCallback(): void;
|
|
38
|
+
private _handleClick;
|
|
39
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
40
|
+
}
|
|
@@ -25,6 +25,14 @@ import "./nys-fileitem";
|
|
|
25
25
|
*/
|
|
26
26
|
export declare class NysFileinput extends LitElement {
|
|
27
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
|
+
};
|
|
28
36
|
/** Unique identifier. Auto-generated if not provided. */
|
|
29
37
|
id: string;
|
|
30
38
|
/** Name for form submission. */
|
|
@@ -12,6 +12,14 @@ import { LitElement } from "lit";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class NysFileItem extends LitElement {
|
|
14
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
|
+
};
|
|
15
23
|
/** Name of the file being displayed. */
|
|
16
24
|
filename: string;
|
|
17
25
|
/**
|
|
@@ -26,5 +26,10 @@ export declare class NysLabel extends LitElement {
|
|
|
26
26
|
get tooltip(): string;
|
|
27
27
|
set tooltip(value: string);
|
|
28
28
|
private _tooltip;
|
|
29
|
+
/**
|
|
30
|
+
* Event Handlers
|
|
31
|
+
* --------------------------------------------------------------------------
|
|
32
|
+
*/
|
|
33
|
+
private _handleLabelClick;
|
|
29
34
|
render(): import("lit-html").TemplateResult<1>;
|
|
30
35
|
}
|
|
@@ -14,6 +14,7 @@ import "./nys-radiogroup";
|
|
|
14
14
|
* @fires nys-change - Fired when selection changes. Detail: `{id, checked, name, value}`.
|
|
15
15
|
* @fires nys-focus - Fired when radio gains focus.
|
|
16
16
|
* @fires nys-blur - Fired when radio loses focus.
|
|
17
|
+
* @fires nys-other-input - Fired when "other" text input value changes. Detail: `{id, name, value}`.
|
|
17
18
|
*
|
|
18
19
|
* @example Radio group
|
|
19
20
|
* ```html
|
|
@@ -25,6 +26,14 @@ import "./nys-radiogroup";
|
|
|
25
26
|
*/
|
|
26
27
|
export declare class NysRadiobutton extends LitElement {
|
|
27
28
|
static styles: import("lit").CSSResult;
|
|
29
|
+
static shadowRootOptions: {
|
|
30
|
+
delegatesFocus: boolean;
|
|
31
|
+
clonable?: boolean;
|
|
32
|
+
customElementRegistry?: CustomElementRegistry;
|
|
33
|
+
mode: ShadowRootMode;
|
|
34
|
+
serializable?: boolean;
|
|
35
|
+
slotAssignment?: SlotAssignmentMode;
|
|
36
|
+
};
|
|
28
37
|
/** Whether this radio is selected. Only one per group can be checked. */
|
|
29
38
|
checked: boolean;
|
|
30
39
|
/** Prevents interaction. */
|
|
@@ -52,6 +61,10 @@ export declare class NysRadiobutton extends LitElement {
|
|
|
52
61
|
size: "sm" | "md";
|
|
53
62
|
/** Renders as tile with larger clickable area. */
|
|
54
63
|
tile: boolean;
|
|
64
|
+
other: boolean;
|
|
65
|
+
showOtherError: boolean;
|
|
66
|
+
private isMobile;
|
|
67
|
+
private _hasUserInteracted;
|
|
55
68
|
static buttonGroup: Record<string, NysRadiobutton>;
|
|
56
69
|
/**
|
|
57
70
|
* Lifecycle methods
|
|
@@ -66,14 +79,21 @@ export declare class NysRadiobutton extends LitElement {
|
|
|
66
79
|
*/
|
|
67
80
|
getInputElement(): Promise<HTMLInputElement | null>;
|
|
68
81
|
formResetUpdate(): void;
|
|
82
|
+
private _handleResize;
|
|
83
|
+
private _clearOtherState;
|
|
69
84
|
/**
|
|
70
85
|
* Event Handlers
|
|
71
86
|
* --------------------------------------------------------------------------
|
|
72
87
|
*/
|
|
73
88
|
private _emitChangeEvent;
|
|
89
|
+
private _emitOtherInputEvent;
|
|
74
90
|
private _handleChange;
|
|
75
91
|
private _handleFocus;
|
|
76
92
|
private _handleBlur;
|
|
77
93
|
private _callInputHandling;
|
|
94
|
+
private _handleTextInput;
|
|
95
|
+
private _handleTextInputBlur;
|
|
96
|
+
private _validateOtherAndEmitError;
|
|
97
|
+
private _handleOtherKeydown;
|
|
78
98
|
render(): import("lit-html").TemplateResult<1>;
|
|
79
99
|
}
|
|
@@ -23,6 +23,14 @@ import { LitElement } from "lit";
|
|
|
23
23
|
*/
|
|
24
24
|
export declare class NysRadiogroup extends LitElement {
|
|
25
25
|
static styles: import("lit").CSSResult;
|
|
26
|
+
static shadowRootOptions: {
|
|
27
|
+
delegatesFocus: boolean;
|
|
28
|
+
clonable?: boolean;
|
|
29
|
+
customElementRegistry?: CustomElementRegistry;
|
|
30
|
+
mode: ShadowRootMode;
|
|
31
|
+
serializable?: boolean;
|
|
32
|
+
slotAssignment?: SlotAssignmentMode;
|
|
33
|
+
};
|
|
26
34
|
/** Unique identifier. Auto-generated if not provided. */
|
|
27
35
|
id: string;
|
|
28
36
|
/** Name for form submission. Auto-populated from child radiobuttons. */
|
|
@@ -95,5 +103,6 @@ export declare class NysRadiogroup extends LitElement {
|
|
|
95
103
|
*/
|
|
96
104
|
private _handleRadioButtonChange;
|
|
97
105
|
private _handleInvalid;
|
|
106
|
+
private _handleChildError;
|
|
98
107
|
render(): import("lit-html").TemplateResult<1>;
|
|
99
108
|
}
|
|
@@ -37,6 +37,14 @@ import { LitElement } from "lit";
|
|
|
37
37
|
*/
|
|
38
38
|
export declare class NysSelect extends LitElement {
|
|
39
39
|
static styles: import("lit").CSSResult;
|
|
40
|
+
static shadowRootOptions: {
|
|
41
|
+
delegatesFocus: boolean;
|
|
42
|
+
clonable?: boolean;
|
|
43
|
+
customElementRegistry?: CustomElementRegistry;
|
|
44
|
+
mode: ShadowRootMode;
|
|
45
|
+
serializable?: boolean;
|
|
46
|
+
slotAssignment?: SlotAssignmentMode;
|
|
47
|
+
};
|
|
40
48
|
/** Unique identifier. Auto-generated if not provided. */
|
|
41
49
|
id: string;
|
|
42
50
|
/** Name for form submission. */
|