@aurodesignsystem-dev/auro-formkit 0.0.0-pr1497.5 → 0.0.0-pr1498.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/components/checkbox/demo/customize.min.js +2 -2
- package/components/checkbox/demo/getting-started.min.js +2 -2
- package/components/checkbox/demo/index.min.js +2 -2
- package/components/checkbox/dist/index.js +2 -2
- package/components/checkbox/dist/registered.js +2 -2
- package/components/combobox/demo/customize.md +7 -3
- package/components/combobox/demo/customize.min.js +1438 -1668
- package/components/combobox/demo/getting-started.min.js +1440 -1670
- package/components/combobox/demo/index.min.js +1440 -1670
- package/components/combobox/dist/auro-combobox.d.ts +5 -0
- package/components/combobox/dist/index.js +485 -140
- package/components/combobox/dist/registered.js +485 -140
- package/components/counter/demo/customize.min.js +20 -3
- package/components/counter/demo/index.min.js +20 -3
- package/components/counter/dist/index.js +5447 -192
- package/components/counter/dist/registered.js +5447 -192
- package/components/datepicker/demo/customize.min.js +149 -58
- package/components/datepicker/demo/index.min.js +149 -58
- package/components/datepicker/dist/index.js +149 -58
- package/components/datepicker/dist/registered.js +149 -58
- package/components/dropdown/demo/customize.min.js +18 -1
- package/components/dropdown/demo/getting-started.min.js +18 -1
- package/components/dropdown/demo/index.min.js +18 -1
- package/components/dropdown/dist/auro-dropdown.d.ts +1 -0
- package/components/dropdown/dist/index.js +18 -1
- package/components/dropdown/dist/registered.js +18 -1
- package/components/form/demo/customize.min.js +7910 -7909
- package/components/form/demo/getting-started.min.js +7910 -7909
- package/components/form/demo/index.min.js +7910 -7909
- package/components/form/demo/registerDemoDeps.min.js +7872 -7871
- package/components/input/demo/customize.min.js +131 -56
- package/components/input/demo/getting-started.min.js +131 -56
- package/components/input/demo/index.min.js +131 -56
- package/components/input/dist/base-input.d.ts +16 -0
- package/components/input/dist/index.js +131 -56
- package/components/input/dist/registered.js +131 -56
- package/components/menu/demo/api.md +41 -45
- package/components/menu/demo/customize.md +0 -28
- package/components/menu/demo/index.min.js +779 -1354
- package/components/menu/dist/auro-menu.d.ts +95 -110
- package/components/menu/dist/auro-menuoption.d.ts +32 -138
- package/components/menu/dist/index.js +753 -1308
- package/components/menu/dist/registered.js +765 -1308
- package/components/radio/demo/customize.min.js +2 -2
- package/components/radio/demo/getting-started.min.js +2 -2
- package/components/radio/demo/index.min.js +2 -2
- package/components/radio/dist/index.js +2 -2
- package/components/radio/dist/registered.js +2 -2
- package/components/select/demo/customize.md +7 -3
- package/components/select/demo/customize.min.js +1088 -1615
- package/components/select/demo/getting-started.min.js +1088 -1615
- package/components/select/demo/index.min.js +1088 -1615
- package/components/select/dist/index.js +63 -15
- package/components/select/dist/registered.js +63 -15
- package/components/select/dist/selectUtils.d.ts +12 -0
- package/custom-elements.json +2296 -2942
- package/package.json +1 -1
- package/components/menu/dist/auro-menu.context.d.ts +0 -238
package/package.json
CHANGED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
export class MenuService {
|
|
2
|
-
/**
|
|
3
|
-
* CONSTRUCTOR
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new MenuService instance.
|
|
7
|
-
* @param {Object} options - The options object.
|
|
8
|
-
* @param {AuroMenu} options.host - The host element that this service will control. Required.
|
|
9
|
-
* @throws {Error} If the host is not provided.
|
|
10
|
-
*/
|
|
11
|
-
constructor({ host }?: {
|
|
12
|
-
host: AuroMenu;
|
|
13
|
-
});
|
|
14
|
-
/**
|
|
15
|
-
* PROPERTIES AND GETTERS
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Gets the list of registered menu options.
|
|
19
|
-
* @returns {AuroMenuOption[]}
|
|
20
|
-
*/
|
|
21
|
-
get menuOptions(): AuroMenuOption[];
|
|
22
|
-
/**
|
|
23
|
-
* Gets the currently highlighted option.
|
|
24
|
-
* @returns {AuroMenuOption|null}
|
|
25
|
-
*/
|
|
26
|
-
get highlightedOption(): AuroMenuOption | null;
|
|
27
|
-
/**
|
|
28
|
-
* Gets the current value(s) of the selected option(s).
|
|
29
|
-
* @returns {string|string[]|undefined}
|
|
30
|
-
*/
|
|
31
|
-
get currentValue(): string | string[] | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Gets the label(s) of the currently selected option(s).
|
|
34
|
-
* @returns {string}
|
|
35
|
-
*/
|
|
36
|
-
get currentLabel(): string;
|
|
37
|
-
/**
|
|
38
|
-
* Gets the string representation of the current value(s).
|
|
39
|
-
* For multi-select, this is a JSON stringified array.
|
|
40
|
-
* @returns {string|undefined}
|
|
41
|
-
*/
|
|
42
|
-
get stringValue(): string | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Gets the key(s) of the currently selected option(s).
|
|
45
|
-
* @returns {string|string[]|undefined}
|
|
46
|
-
*/
|
|
47
|
-
get currentKeys(): string | string[] | undefined;
|
|
48
|
-
host: any;
|
|
49
|
-
size: any;
|
|
50
|
-
shape: any;
|
|
51
|
-
noCheckmark: any;
|
|
52
|
-
disabled: any;
|
|
53
|
-
matchWord: any;
|
|
54
|
-
multiSelect: any;
|
|
55
|
-
allowDeselect: any;
|
|
56
|
-
selectAllMatchingOptions: any;
|
|
57
|
-
highlightedIndex: number;
|
|
58
|
-
_menuOptions: any[];
|
|
59
|
-
_subscribers: any[];
|
|
60
|
-
internalUpdateInProgress: boolean;
|
|
61
|
-
selectedOptions: any[];
|
|
62
|
-
_pendingValue: string | number | (string | number)[] | null;
|
|
63
|
-
_pendingRetryScheduled: boolean;
|
|
64
|
-
_pendingRetryCount: number;
|
|
65
|
-
/**
|
|
66
|
-
* PROPERTY SYNCING
|
|
67
|
-
*/
|
|
68
|
-
/**
|
|
69
|
-
* Handles host updates.
|
|
70
|
-
* This is a lit reactive lifecycle method.
|
|
71
|
-
* This comes from the Lit controller interface provided by adding this service as a controller to the host.
|
|
72
|
-
* See constructor for `this.host.addController(this)`
|
|
73
|
-
* You can read more about Lit reactive controllers here: https://lit.dev/docs/composition/controllers/
|
|
74
|
-
*/
|
|
75
|
-
hostUpdated(): void;
|
|
76
|
-
/**
|
|
77
|
-
* Handles host disconnection and memory cleanup.
|
|
78
|
-
*/
|
|
79
|
-
hostDisconnected(): void;
|
|
80
|
-
/**
|
|
81
|
-
* Sets a property value if it exists on the instance and the value has changed.
|
|
82
|
-
* @param {string} property
|
|
83
|
-
* @param {any} value
|
|
84
|
-
*/
|
|
85
|
-
setProperty(property: string, value: any): void;
|
|
86
|
-
/**
|
|
87
|
-
* Sets multiple properties on the instance.
|
|
88
|
-
* @param {Object} properties - Key-value pairs of properties to set.
|
|
89
|
-
*/
|
|
90
|
-
setProperties(properties: Object): void;
|
|
91
|
-
/**
|
|
92
|
-
* MENU OPTION HIGHLIGHTING
|
|
93
|
-
*/
|
|
94
|
-
/**
|
|
95
|
-
* Highlights the next active option in the menu.
|
|
96
|
-
*/
|
|
97
|
-
highlightNext(): void;
|
|
98
|
-
/**
|
|
99
|
-
* Highlights the previous active option in the menu.
|
|
100
|
-
*/
|
|
101
|
-
highlightPrevious(): void;
|
|
102
|
-
/**
|
|
103
|
-
* Moves the highlighted option in the specified direction.
|
|
104
|
-
* @param {string} direction - The direction to move the highlight ("next" or "previous").
|
|
105
|
-
*/
|
|
106
|
-
moveHighlightedOption(direction: string): void;
|
|
107
|
-
/**
|
|
108
|
-
* Sets the highlighted index to the specified option.
|
|
109
|
-
* @param {AuroMenuOption} option - The option to highlight.
|
|
110
|
-
*/
|
|
111
|
-
setHighlightedOption(option: AuroMenuOption): void;
|
|
112
|
-
/**
|
|
113
|
-
* Sets the highlighted option to the option at the specified index if it exists.
|
|
114
|
-
* @param {number} index
|
|
115
|
-
*/
|
|
116
|
-
setHighlightedIndex(index: number): void;
|
|
117
|
-
/**
|
|
118
|
-
* Selects the currently highlighted option.
|
|
119
|
-
*/
|
|
120
|
-
selectHighlightedOption(): void;
|
|
121
|
-
/**
|
|
122
|
-
* SELECTION AND DESELECTION METHODS
|
|
123
|
-
*/
|
|
124
|
-
/**
|
|
125
|
-
* Selects one or more options in a batch operation
|
|
126
|
-
* @param {AuroMenuOption|AuroMenuOption[]} options - Single option or array of options to select
|
|
127
|
-
*/
|
|
128
|
-
selectOptions(options: AuroMenuOption | AuroMenuOption[]): void;
|
|
129
|
-
/**
|
|
130
|
-
* Deselects one or more options in a batch operation
|
|
131
|
-
* @param {AuroMenuOption|AuroMenuOption[]} options - Single option or array of options to deselect
|
|
132
|
-
*/
|
|
133
|
-
deselectOptions(options: AuroMenuOption | AuroMenuOption[]): void;
|
|
134
|
-
/**
|
|
135
|
-
* Selects a single option.
|
|
136
|
-
* @param {AuroMenuOption} option
|
|
137
|
-
*/
|
|
138
|
-
selectOption(option: AuroMenuOption): void;
|
|
139
|
-
/**
|
|
140
|
-
* Deselects a single option.
|
|
141
|
-
* @param {AuroMenuOption} option
|
|
142
|
-
*/
|
|
143
|
-
deselectOption(option: AuroMenuOption): void;
|
|
144
|
-
/**
|
|
145
|
-
* Toggles the selection state of a single option.
|
|
146
|
-
* @param {AuroMenuOption} option
|
|
147
|
-
*/
|
|
148
|
-
toggleOption(option: AuroMenuOption): void;
|
|
149
|
-
/**
|
|
150
|
-
* Selects options based on their value(s) when compared to a passed value or values.
|
|
151
|
-
* Value or values are normalized to an array of strings that can be matched to option keys.
|
|
152
|
-
* @param {string|number|Array<string|number>} value - The value(s) to select.
|
|
153
|
-
*/
|
|
154
|
-
selectByValue(value: string | number | Array<string | number>): void;
|
|
155
|
-
/**
|
|
156
|
-
* Queues a pending value and schedules a bounded retry.
|
|
157
|
-
* @param {string|number|Array<string|number>} value - The value to retry.
|
|
158
|
-
*/
|
|
159
|
-
queuePendingValue(value: string | number | Array<string | number>): void;
|
|
160
|
-
/**
|
|
161
|
-
* Clears pending retry state.
|
|
162
|
-
*/
|
|
163
|
-
clearPendingValue(): void;
|
|
164
|
-
/**
|
|
165
|
-
* Resets the selected options to an empty array.
|
|
166
|
-
*/
|
|
167
|
-
reset(): void;
|
|
168
|
-
/**
|
|
169
|
-
* SUBSCRIPTION, NOTIFICATION AND EVENT DISPATCH METHODS
|
|
170
|
-
*/
|
|
171
|
-
/**
|
|
172
|
-
* Subscribes a callback to menu service events.
|
|
173
|
-
* @param {Function} callback - The callback to invoke on events.
|
|
174
|
-
*/
|
|
175
|
-
subscribe(callback: Function): void;
|
|
176
|
-
/**
|
|
177
|
-
* Remove a previously subscribed callback from menu service events.
|
|
178
|
-
* @param {Function} callback
|
|
179
|
-
*/
|
|
180
|
-
unsubscribe(callback: Function): void;
|
|
181
|
-
/**
|
|
182
|
-
* Stages an update to notify subscribers of state and value changes.
|
|
183
|
-
*/
|
|
184
|
-
stageUpdate(meta?: {}): void;
|
|
185
|
-
/**
|
|
186
|
-
* Notifies subscribers of a menu service event.
|
|
187
|
-
* All notifications are sent to all subscribers.
|
|
188
|
-
* @param {string} event - The event to send to subscribers.
|
|
189
|
-
*/
|
|
190
|
-
notify(event: string): void;
|
|
191
|
-
/**
|
|
192
|
-
* Notifies subscribers of a state change (selected options has changed).
|
|
193
|
-
*/
|
|
194
|
-
notifyStateChange(meta?: {}): void;
|
|
195
|
-
/**
|
|
196
|
-
* Notifies subscribers of a value change (current value has changed).
|
|
197
|
-
*/
|
|
198
|
-
notifyValueChange(meta?: {}): void;
|
|
199
|
-
/**
|
|
200
|
-
* Dispatches a custom event from the host element.
|
|
201
|
-
* @param {string} eventName
|
|
202
|
-
* @param {any} detail
|
|
203
|
-
*/
|
|
204
|
-
dispatchChangeEvent(eventName: string, detail: any): void;
|
|
205
|
-
/**
|
|
206
|
-
* MENU OPTION MANAGEMENT METHODS
|
|
207
|
-
*/
|
|
208
|
-
/**
|
|
209
|
-
* Adds a menu option to the service's list.
|
|
210
|
-
* @param {AuroMenuOption} option - the option to track
|
|
211
|
-
*/
|
|
212
|
-
addMenuOption(option: AuroMenuOption): void;
|
|
213
|
-
/**
|
|
214
|
-
* Removes a menu option from the service's list.
|
|
215
|
-
* @param {AuroMenuOption} option - the option to remove
|
|
216
|
-
*/
|
|
217
|
-
removeMenuOption(option: AuroMenuOption): void;
|
|
218
|
-
/**
|
|
219
|
-
* UTILITIES
|
|
220
|
-
*/
|
|
221
|
-
/**
|
|
222
|
-
* Normalizes a value or array of values into an array of strings for option selection.
|
|
223
|
-
* This function ensures that input values are consistently formatted for matching menu options.
|
|
224
|
-
*
|
|
225
|
-
* @param {string|number|Array<string|number>} value - The value(s) to normalize.
|
|
226
|
-
* @returns {Array<string>} An array of string values suitable for option matching.
|
|
227
|
-
* @throws {Error} If any value is not a string or number.
|
|
228
|
-
*/
|
|
229
|
-
_getNormalizedValues(value: string | number | Array<string | number>): Array<string>;
|
|
230
|
-
/**
|
|
231
|
-
* Returns whether two arrays of options contain the same elements.
|
|
232
|
-
* @param {AuroMenuOption[]} arr1 - First array of options.
|
|
233
|
-
* @param {AuroMenuOption[]} arr2 - Second array of options.
|
|
234
|
-
* @returns {boolean} True if arrays match, false otherwise.
|
|
235
|
-
*/
|
|
236
|
-
optionsArraysMatch(arr1: AuroMenuOption[], arr2: AuroMenuOption[]): boolean;
|
|
237
|
-
}
|
|
238
|
-
export const MenuContext: import("@lit/context").Context<"menu-context", any>;
|