@aurodesignsystem/auro-formkit 3.5.0 → 4.0.0-rc-658.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/CHANGELOG.md +40 -1
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/README.md +1 -1
- package/components/combobox/demo/api.md +27 -27
- package/components/combobox/demo/api.min.js +63 -275
- package/components/combobox/demo/index.html +1 -0
- package/components/combobox/demo/index.min.js +61 -273
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/dist/auro-combobox.d.ts +5 -10
- package/components/combobox/dist/index.js +22 -149
- package/components/combobox/dist/registered.js +22 -149
- package/components/counter/README.md +1 -1
- package/components/counter/demo/readme.md +1 -1
- package/components/datepicker/README.md +1 -1
- package/components/datepicker/demo/readme.md +1 -1
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/demo/readme.md +1 -1
- package/components/form/README.md +1 -1
- package/components/form/demo/readme.md +1 -1
- package/components/input/README.md +1 -1
- package/components/input/demo/readme.md +1 -1
- package/components/menu/README.md +1 -1
- package/components/menu/demo/api.md +11 -11
- package/components/menu/demo/api.min.js +39 -124
- package/components/menu/demo/index.min.js +39 -124
- package/components/menu/demo/readme.md +1 -1
- package/components/menu/dist/auro-menu-utils.d.ts +0 -8
- package/components/menu/dist/auro-menu.d.ts +3 -8
- package/components/menu/dist/index.d.ts +1 -1
- package/components/menu/dist/index.js +40 -84
- package/components/menu/dist/registered.js +39 -124
- package/components/radio/README.md +1 -1
- package/components/radio/demo/api.md +8 -0
- package/components/radio/demo/api.min.js +13 -5
- package/components/radio/demo/index.min.js +13 -5
- package/components/radio/demo/readme.md +1 -1
- package/components/radio/dist/auro-radio.d.ts +4 -0
- package/components/radio/dist/index.js +13 -5
- package/components/radio/dist/registered.js +13 -5
- package/components/select/README.md +35 -35
- package/components/select/demo/api.md +32 -32
- package/components/select/demo/api.min.js +99 -199
- package/components/select/demo/index.min.js +97 -197
- package/components/select/demo/readme.md +1 -1
- package/components/select/dist/auro-select.d.ts +12 -13
- package/components/select/dist/index.js +57 -72
- package/components/select/dist/registered.js +57 -72
- package/package.json +1 -1
|
@@ -124,61 +124,6 @@ function arrayConverter(value) {
|
|
|
124
124
|
throw new Error('Invalid value: Input must be an array or undefined');
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/**
|
|
128
|
-
* Compare two arrays for equality.
|
|
129
|
-
* @private
|
|
130
|
-
* @param {Array} arr1 - First array to compare.
|
|
131
|
-
* @param {Array} arr2 - Second array to compare.
|
|
132
|
-
* @returns {boolean} True if arrays are equal.
|
|
133
|
-
*/
|
|
134
|
-
function arraysAreEqual(arr1, arr2) {
|
|
135
|
-
// If both arrays undefined, they are equal (true)
|
|
136
|
-
if (arr1 === undefined || arr2 === undefined) {
|
|
137
|
-
return arr1 === arr2;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// If arrays have different lengths, they are not equal
|
|
141
|
-
if (arr1.length !== arr2.length) {
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// If every item at each index is the same, return true
|
|
146
|
-
for (let index = 0; index < arr1.length; index += 1) {
|
|
147
|
-
if (arr1[index] !== arr2[index]) {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Compares array for changes.
|
|
156
|
-
* @private
|
|
157
|
-
* @param {Array|any} newVal - New value to compare.
|
|
158
|
-
* @param {Array|any} oldVal - Old value to compare.
|
|
159
|
-
* @returns {boolean} True if arrays have changed.
|
|
160
|
-
*/
|
|
161
|
-
function arrayOrUndefinedHasChanged(newVal, oldVal) {
|
|
162
|
-
try {
|
|
163
|
-
// Check if values are undefined or arrays
|
|
164
|
-
const isArrayOrUndefined = (val) => val === undefined || Array.isArray(val);
|
|
165
|
-
|
|
166
|
-
// If non-array or non-undefined, throw error
|
|
167
|
-
if (!isArrayOrUndefined(newVal) || !isArrayOrUndefined(oldVal)) {
|
|
168
|
-
const invalidValue = isArrayOrUndefined(newVal) ? oldVal : newVal;
|
|
169
|
-
throw new Error(`Value must be an array or undefined, received ${typeof invalidValue}`);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Return true if arrays have changed, false if they are the same
|
|
173
|
-
return !arraysAreEqual(newVal, oldVal);
|
|
174
|
-
} catch (error) {
|
|
175
|
-
/* eslint-disable no-console */
|
|
176
|
-
console.error(error);
|
|
177
|
-
// If validation fails, it has changed
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
127
|
/**
|
|
183
128
|
* Validates if an option can be interacted with.
|
|
184
129
|
* @private
|
|
@@ -211,7 +156,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
211
156
|
element.dispatchEvent(new CustomEvent(eventName, eventConfig));
|
|
212
157
|
}
|
|
213
158
|
|
|
214
|
-
// Copyright (c)
|
|
159
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
215
160
|
// See LICENSE in the project root for license information.
|
|
216
161
|
|
|
217
162
|
|
|
@@ -219,14 +164,14 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
219
164
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
220
165
|
/**
|
|
221
166
|
* The auro-menu element provides users a way to select from a list of options.
|
|
222
|
-
* @attr {Array<HTMLElement
|
|
167
|
+
* @attr {HTMLElement|Array<HTMLElement>} optionSelected - An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
|
|
223
168
|
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
224
169
|
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
225
170
|
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
226
171
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
227
172
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
228
173
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
229
|
-
* @attr {Array<string
|
|
174
|
+
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
230
175
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
231
176
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
232
177
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -239,7 +184,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
239
184
|
* @slot - Slot for insertion of menu options.
|
|
240
185
|
*/
|
|
241
186
|
|
|
242
|
-
/* eslint-disable no-magic-numbers, max-lines */
|
|
187
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
243
188
|
|
|
244
189
|
class AuroMenu extends LitElement {
|
|
245
190
|
constructor() {
|
|
@@ -319,9 +264,8 @@ class AuroMenu extends LitElement {
|
|
|
319
264
|
reflect: true
|
|
320
265
|
},
|
|
321
266
|
optionSelected: {
|
|
322
|
-
// Allow HTMLElement[] arrays and undefined
|
|
323
|
-
|
|
324
|
-
hasChanged: arrayOrUndefinedHasChanged
|
|
267
|
+
// Allow HTMLElement, HTMLElement[] arrays and undefined
|
|
268
|
+
type: Object
|
|
325
269
|
},
|
|
326
270
|
optionActive: {
|
|
327
271
|
type: Object,
|
|
@@ -337,10 +281,8 @@ class AuroMenu extends LitElement {
|
|
|
337
281
|
attribute: 'multiselect'
|
|
338
282
|
},
|
|
339
283
|
value: {
|
|
340
|
-
// Allow string[] arrays and undefined
|
|
341
|
-
type: Object
|
|
342
|
-
converter: arrayConverter,
|
|
343
|
-
hasChanged: arrayOrUndefinedHasChanged
|
|
284
|
+
// Allow string, string[] arrays and undefined
|
|
285
|
+
type: Object
|
|
344
286
|
}
|
|
345
287
|
};
|
|
346
288
|
}
|
|
@@ -393,30 +335,39 @@ class AuroMenu extends LitElement {
|
|
|
393
335
|
}
|
|
394
336
|
|
|
395
337
|
updated(changedProperties) {
|
|
338
|
+
if (changedProperties.has('multiSelect')) {
|
|
339
|
+
// Reset selection if multiSelect mode changes
|
|
340
|
+
this.clearSelection();
|
|
341
|
+
}
|
|
342
|
+
|
|
396
343
|
if (changedProperties.has('value')) {
|
|
397
344
|
// Handle null/undefined case
|
|
398
345
|
if (this.value === undefined || this.value === null) {
|
|
399
346
|
this.optionSelected = undefined;
|
|
400
|
-
// Reset index tracking
|
|
401
347
|
this.index = -1;
|
|
402
348
|
} else {
|
|
403
|
-
|
|
404
|
-
|
|
349
|
+
if (this.multiSelect) {
|
|
350
|
+
// In multiselect mode, this.value should be an array of strings
|
|
351
|
+
const valueArray = Array.isArray(this.value) ? this.value : [this.value];
|
|
352
|
+
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
405
353
|
|
|
406
|
-
|
|
407
|
-
|
|
354
|
+
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
355
|
+
} else {
|
|
356
|
+
// In single-select mode, this.value should be a string
|
|
357
|
+
const matchingOptions = this.items.find((item) => item.value === this.value);
|
|
408
358
|
|
|
409
|
-
|
|
410
|
-
if (this.multiSelect) {
|
|
411
|
-
// For multiselect, keep all matching options
|
|
359
|
+
if (matchingOptions) {
|
|
412
360
|
this.optionSelected = matchingOptions;
|
|
361
|
+
this.index = this.items.indexOf(matchingOptions);
|
|
413
362
|
} else {
|
|
414
|
-
//
|
|
415
|
-
this.optionSelected =
|
|
416
|
-
this.index =
|
|
363
|
+
// If no matching option found, reset selection
|
|
364
|
+
this.optionSelected = undefined;
|
|
365
|
+
this.index = -1;
|
|
417
366
|
}
|
|
418
|
-
}
|
|
419
|
-
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// If no matching options were found in either mode
|
|
370
|
+
if (!this.optionSelected || (Array.isArray(this.optionSelected) && this.optionSelected.length === 0)) {
|
|
420
371
|
dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
|
|
421
372
|
this.optionSelected = undefined;
|
|
422
373
|
this.index = -1;
|
|
@@ -568,8 +519,8 @@ class AuroMenu extends LitElement {
|
|
|
568
519
|
}
|
|
569
520
|
} else {
|
|
570
521
|
// Single select - use arrays with single values
|
|
571
|
-
this.value =
|
|
572
|
-
this.optionSelected =
|
|
522
|
+
this.value = option.value;
|
|
523
|
+
this.optionSelected = option;
|
|
573
524
|
}
|
|
574
525
|
|
|
575
526
|
this.index = this.items.indexOf(option);
|
|
@@ -891,8 +842,13 @@ class AuroMenu extends LitElement {
|
|
|
891
842
|
if (!this.optionSelected) {
|
|
892
843
|
return false;
|
|
893
844
|
}
|
|
894
|
-
|
|
895
|
-
|
|
845
|
+
|
|
846
|
+
if (this.multiSelect) {
|
|
847
|
+
// In multi-select mode, check if the option is in the selected array
|
|
848
|
+
return Array.isArray(this.optionSelected) && this.optionSelected.some((selectedOption) => selectedOption === option);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
return this.optionSelected === option;
|
|
896
852
|
}
|
|
897
853
|
|
|
898
854
|
/**
|
|
@@ -1423,4 +1379,4 @@ class AuroMenuOption extends LitElement {
|
|
|
1423
1379
|
}
|
|
1424
1380
|
}
|
|
1425
1381
|
|
|
1426
|
-
export { AuroMenu, AuroMenuOption, arrayConverter,
|
|
1382
|
+
export { AuroMenu, AuroMenuOption, arrayConverter, dispatchMenuEvent, isOptionInteractive };
|
|
@@ -82,102 +82,6 @@ class AuroLibraryRuntimeUtils {
|
|
|
82
82
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
83
83
|
// See LICENSE in the project root for license information.
|
|
84
84
|
|
|
85
|
-
// ---------------------------------------------------------------------
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Converts value to an array.
|
|
89
|
-
* If the value is a JSON string representing an array, it will be parsed.
|
|
90
|
-
* If the value is already an array, it is returned.
|
|
91
|
-
* If the value is undefined, it returns undefined.
|
|
92
|
-
* @private
|
|
93
|
-
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
94
|
-
* @returns {Array|undefined} - The converted array or undefined.
|
|
95
|
-
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
96
|
-
* or if the value cannot be parsed into an array from a JSON string.
|
|
97
|
-
*/
|
|
98
|
-
function arrayConverter(value) {
|
|
99
|
-
// Allow undefined
|
|
100
|
-
if (value === undefined) {
|
|
101
|
-
return undefined;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Return the value if it is already an array
|
|
105
|
-
if (Array.isArray(value)) {
|
|
106
|
-
return value;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
try {
|
|
110
|
-
// If value is a JSON string, parse it
|
|
111
|
-
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
112
|
-
|
|
113
|
-
// Check if the parsed value is an array
|
|
114
|
-
if (Array.isArray(parsed)) {
|
|
115
|
-
return parsed;
|
|
116
|
-
}
|
|
117
|
-
} catch (error) {
|
|
118
|
-
// If JSON parsing fails, continue to throw an error below
|
|
119
|
-
/* eslint-disable no-console */
|
|
120
|
-
console.error('JSON parsing failed:', error);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Throw error if the input is not an array or undefined
|
|
124
|
-
throw new Error('Invalid value: Input must be an array or undefined');
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Compare two arrays for equality.
|
|
129
|
-
* @private
|
|
130
|
-
* @param {Array} arr1 - First array to compare.
|
|
131
|
-
* @param {Array} arr2 - Second array to compare.
|
|
132
|
-
* @returns {boolean} True if arrays are equal.
|
|
133
|
-
*/
|
|
134
|
-
function arraysAreEqual(arr1, arr2) {
|
|
135
|
-
// If both arrays undefined, they are equal (true)
|
|
136
|
-
if (arr1 === undefined || arr2 === undefined) {
|
|
137
|
-
return arr1 === arr2;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// If arrays have different lengths, they are not equal
|
|
141
|
-
if (arr1.length !== arr2.length) {
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// If every item at each index is the same, return true
|
|
146
|
-
for (let index = 0; index < arr1.length; index += 1) {
|
|
147
|
-
if (arr1[index] !== arr2[index]) {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Compares array for changes.
|
|
156
|
-
* @private
|
|
157
|
-
* @param {Array|any} newVal - New value to compare.
|
|
158
|
-
* @param {Array|any} oldVal - Old value to compare.
|
|
159
|
-
* @returns {boolean} True if arrays have changed.
|
|
160
|
-
*/
|
|
161
|
-
function arrayOrUndefinedHasChanged(newVal, oldVal) {
|
|
162
|
-
try {
|
|
163
|
-
// Check if values are undefined or arrays
|
|
164
|
-
const isArrayOrUndefined = (val) => val === undefined || Array.isArray(val);
|
|
165
|
-
|
|
166
|
-
// If non-array or non-undefined, throw error
|
|
167
|
-
if (!isArrayOrUndefined(newVal) || !isArrayOrUndefined(oldVal)) {
|
|
168
|
-
const invalidValue = isArrayOrUndefined(newVal) ? oldVal : newVal;
|
|
169
|
-
throw new Error(`Value must be an array or undefined, received ${typeof invalidValue}`);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Return true if arrays have changed, false if they are the same
|
|
173
|
-
return !arraysAreEqual(newVal, oldVal);
|
|
174
|
-
} catch (error) {
|
|
175
|
-
/* eslint-disable no-console */
|
|
176
|
-
console.error(error);
|
|
177
|
-
// If validation fails, it has changed
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
85
|
|
|
182
86
|
/**
|
|
183
87
|
* Validates if an option can be interacted with.
|
|
@@ -211,7 +115,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
211
115
|
element.dispatchEvent(new CustomEvent(eventName, eventConfig));
|
|
212
116
|
}
|
|
213
117
|
|
|
214
|
-
// Copyright (c)
|
|
118
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
215
119
|
// See LICENSE in the project root for license information.
|
|
216
120
|
|
|
217
121
|
|
|
@@ -219,14 +123,14 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
219
123
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
220
124
|
/**
|
|
221
125
|
* The auro-menu element provides users a way to select from a list of options.
|
|
222
|
-
* @attr {Array<HTMLElement
|
|
126
|
+
* @attr {HTMLElement|Array<HTMLElement>} optionSelected - An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
|
|
223
127
|
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
224
128
|
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
225
129
|
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
226
130
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
227
131
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
228
132
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
229
|
-
* @attr {Array<string
|
|
133
|
+
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
230
134
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
231
135
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
232
136
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -239,7 +143,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
239
143
|
* @slot - Slot for insertion of menu options.
|
|
240
144
|
*/
|
|
241
145
|
|
|
242
|
-
/* eslint-disable no-magic-numbers, max-lines */
|
|
146
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
243
147
|
|
|
244
148
|
class AuroMenu extends LitElement {
|
|
245
149
|
constructor() {
|
|
@@ -319,9 +223,8 @@ class AuroMenu extends LitElement {
|
|
|
319
223
|
reflect: true
|
|
320
224
|
},
|
|
321
225
|
optionSelected: {
|
|
322
|
-
// Allow HTMLElement[] arrays and undefined
|
|
323
|
-
|
|
324
|
-
hasChanged: arrayOrUndefinedHasChanged
|
|
226
|
+
// Allow HTMLElement, HTMLElement[] arrays and undefined
|
|
227
|
+
type: Object
|
|
325
228
|
},
|
|
326
229
|
optionActive: {
|
|
327
230
|
type: Object,
|
|
@@ -337,10 +240,8 @@ class AuroMenu extends LitElement {
|
|
|
337
240
|
attribute: 'multiselect'
|
|
338
241
|
},
|
|
339
242
|
value: {
|
|
340
|
-
// Allow string[] arrays and undefined
|
|
341
|
-
type: Object
|
|
342
|
-
converter: arrayConverter,
|
|
343
|
-
hasChanged: arrayOrUndefinedHasChanged
|
|
243
|
+
// Allow string, string[] arrays and undefined
|
|
244
|
+
type: Object
|
|
344
245
|
}
|
|
345
246
|
};
|
|
346
247
|
}
|
|
@@ -393,30 +294,39 @@ class AuroMenu extends LitElement {
|
|
|
393
294
|
}
|
|
394
295
|
|
|
395
296
|
updated(changedProperties) {
|
|
297
|
+
if (changedProperties.has('multiSelect')) {
|
|
298
|
+
// Reset selection if multiSelect mode changes
|
|
299
|
+
this.clearSelection();
|
|
300
|
+
}
|
|
301
|
+
|
|
396
302
|
if (changedProperties.has('value')) {
|
|
397
303
|
// Handle null/undefined case
|
|
398
304
|
if (this.value === undefined || this.value === null) {
|
|
399
305
|
this.optionSelected = undefined;
|
|
400
|
-
// Reset index tracking
|
|
401
306
|
this.index = -1;
|
|
402
307
|
} else {
|
|
403
|
-
|
|
404
|
-
|
|
308
|
+
if (this.multiSelect) {
|
|
309
|
+
// In multiselect mode, this.value should be an array of strings
|
|
310
|
+
const valueArray = Array.isArray(this.value) ? this.value : [this.value];
|
|
311
|
+
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
405
312
|
|
|
406
|
-
|
|
407
|
-
|
|
313
|
+
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
314
|
+
} else {
|
|
315
|
+
// In single-select mode, this.value should be a string
|
|
316
|
+
const matchingOptions = this.items.find((item) => item.value === this.value);
|
|
408
317
|
|
|
409
|
-
|
|
410
|
-
if (this.multiSelect) {
|
|
411
|
-
// For multiselect, keep all matching options
|
|
318
|
+
if (matchingOptions) {
|
|
412
319
|
this.optionSelected = matchingOptions;
|
|
320
|
+
this.index = this.items.indexOf(matchingOptions);
|
|
413
321
|
} else {
|
|
414
|
-
//
|
|
415
|
-
this.optionSelected =
|
|
416
|
-
this.index =
|
|
322
|
+
// If no matching option found, reset selection
|
|
323
|
+
this.optionSelected = undefined;
|
|
324
|
+
this.index = -1;
|
|
417
325
|
}
|
|
418
|
-
}
|
|
419
|
-
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// If no matching options were found in either mode
|
|
329
|
+
if (!this.optionSelected || (Array.isArray(this.optionSelected) && this.optionSelected.length === 0)) {
|
|
420
330
|
dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
|
|
421
331
|
this.optionSelected = undefined;
|
|
422
332
|
this.index = -1;
|
|
@@ -568,8 +478,8 @@ class AuroMenu extends LitElement {
|
|
|
568
478
|
}
|
|
569
479
|
} else {
|
|
570
480
|
// Single select - use arrays with single values
|
|
571
|
-
this.value =
|
|
572
|
-
this.optionSelected =
|
|
481
|
+
this.value = option.value;
|
|
482
|
+
this.optionSelected = option;
|
|
573
483
|
}
|
|
574
484
|
|
|
575
485
|
this.index = this.items.indexOf(option);
|
|
@@ -891,8 +801,13 @@ class AuroMenu extends LitElement {
|
|
|
891
801
|
if (!this.optionSelected) {
|
|
892
802
|
return false;
|
|
893
803
|
}
|
|
894
|
-
|
|
895
|
-
|
|
804
|
+
|
|
805
|
+
if (this.multiSelect) {
|
|
806
|
+
// In multi-select mode, check if the option is in the selected array
|
|
807
|
+
return Array.isArray(this.optionSelected) && this.optionSelected.some((selectedOption) => selectedOption === option);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
return this.optionSelected === option;
|
|
896
811
|
}
|
|
897
812
|
|
|
898
813
|
/**
|
|
@@ -100,7 +100,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
100
100
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
101
101
|
|
|
102
102
|
```html
|
|
103
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@
|
|
103
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@latest/auro-radio/+esm"></script>
|
|
104
104
|
```
|
|
105
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
106
|
|
|
@@ -80,6 +80,14 @@
|
|
|
80
80
|
| [focusSelected](#focusSelected) | `CustomEvent<any>` | Notifies that the component has gained focus. |
|
|
81
81
|
| [resetRadio](#resetRadio) | `CustomEvent<any>` | Notifies that the component has reset the checked/selected state. |
|
|
82
82
|
| [toggleSelected](#toggleSelected) | `CustomEvent<any>` | Notifies that the component has toggled the checked/selected state. |
|
|
83
|
+
|
|
84
|
+
## CSS Shadow Parts
|
|
85
|
+
|
|
86
|
+
| Part | Description |
|
|
87
|
+
|---------------|-------------------------------------------|
|
|
88
|
+
| [radio](#radio) | apply css to a specific checkbox. |
|
|
89
|
+
| `radio-input` | apply css to a specific checkbox's input. |
|
|
90
|
+
| `radio-label` | apply css to a specific checkbox's label. |
|
|
83
91
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
84
92
|
|
|
85
93
|
## API Examples
|
|
@@ -70,7 +70,7 @@ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = cl
|
|
|
70
70
|
|
|
71
71
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t();}(0,function(){function e(e){var t=true,n=false,o=null,d={text:true,search:true,url:true,tel:true,email:true,password:true,number:true,date:true,month:true,week:true,time:true,datetime:true,"datetime-local":true};function i(e){return !!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""));}function u(e){t=false;}function a(){document.addEventListener("mousemove",c),document.addEventListener("mousedown",c),document.addEventListener("mouseup",c),document.addEventListener("pointermove",c),document.addEventListener("pointerdown",c),document.addEventListener("pointerup",c),document.addEventListener("touchmove",c),document.addEventListener("touchstart",c),document.addEventListener("touchend",c);}function c(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=false,document.removeEventListener("mousemove",c),document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",c),document.removeEventListener("pointermove",c),document.removeEventListener("pointerdown",c),document.removeEventListener("pointerup",c),document.removeEventListener("touchmove",c),document.removeEventListener("touchstart",c),document.removeEventListener("touchend",c));}document.addEventListener("keydown",function(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=true);},true),document.addEventListener("mousedown",u,true),document.addEventListener("pointerdown",u,true),document.addEventListener("touchstart",u,true),document.addEventListener("visibilitychange",function(e){"hidden"===document.visibilityState&&(n&&(t=true),a());},true),a(),e.addEventListener("focus",function(e){var n,o,u;i(e.target)&&(t||(n=e.target,o=n.type,"INPUT"===(u=n.tagName)&&d[o]&&!n.readOnly||"TEXTAREA"===u&&!n.readOnly||n.isContentEditable))&&s(e.target);},true),e.addEventListener("blur",function(e){var t;i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=true,window.clearTimeout(o),o=window.setTimeout(function(){n=false;},100),(t=e.target).hasAttribute("data-focus-visible-added")&&(t.classList.remove("focus-visible"),t.removeAttribute("data-focus-visible-added")));},true),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""));}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready");}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",false,false,{});}window.dispatchEvent(t);}"undefined"!=typeof document&&e(document);});
|
|
72
72
|
|
|
73
|
-
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;outline:unset}:host(.focus-visible) .displayFlex .inputGroup:focus-within{width:auto}:host(.focus-visible) .rdoGroup{display:block;padding-right:var(--ds-size-100, 0.5rem);outline:3px solid transparent}:host(.focus-visible) .rdoGroup .label:after{outline-width:1px;outline-style:solid}.rdoGroup{position:relative;padding-right:var(--ds-size-100, 0.5rem);padding-left:var(--ds-size-100, 0.5rem);line-height:var(--ds-size-400, 2rem)}.label{display:block;margin-left:var(--ds-size-300, 1.5rem)}.label:hover{cursor:pointer}.label:after{position:absolute;z-index:1;top:
|
|
73
|
+
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;outline:unset}:host(.focus-visible) .displayFlex .inputGroup:focus-within{width:auto}:host(.focus-visible) .rdoGroup{display:block;padding-right:var(--ds-size-100, 0.5rem);outline:3px solid transparent}:host(.focus-visible) .rdoGroup .label:after{outline-width:1px;outline-style:solid}.rdoGroup{position:relative;padding-right:var(--ds-size-100, 0.5rem);padding-left:var(--ds-size-100, 0.5rem);line-height:var(--ds-size-400, 2rem)}.label{display:block;margin-left:var(--ds-size-300, 1.5rem)}.label:hover{cursor:pointer}.label:after{position:absolute;z-index:1;top:var(--ds-size-200, 1rem);left:var(--ds-size-50, 0.25rem);width:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));height:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));transform:translateY(-50%);content:"";border-radius:50%;border:1px solid}.slotContent{display:block;margin-left:var(--ds-size-400, 2rem);padding-left:var(--ds-size-100, 0.5rem)}`;
|
|
74
74
|
|
|
75
75
|
var colorCss$2 = i$5`.label{color:var(--ds-auro-radio-label-color)}.label:after{background-color:var(--ds-auro-radio-btn-fill-color);border-color:var(--ds-auro-radio-btn-border-color);box-shadow:inset 0 0 0 3px var(--ds-auro-radio-btn-inset-color);outline-color:var(--ds-auro-radio-btn-border-color);-webkit-tap-highlight-color:var(--ds-auro-radio-tap-color)}:host([checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator, #ffffff);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue, #01426a);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue, #01426a)}:host([error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-disabled, #dddddd);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-disabled, #dddddd)}:host(.focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([onDark]){--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([onDark][checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator-inverse, #00274a);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff)}:host([onDark][error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894)}:host([onDark].focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
|
|
76
76
|
|
|
@@ -165,6 +165,10 @@ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
|
165
165
|
* @event auroRadio-blur - Notifies that the component has lost focus.
|
|
166
166
|
* @event resetRadio - Notifies that the component has reset the checked/selected state.
|
|
167
167
|
* @event auroRadio-selected - Notifies that the component has been marked as checked/selected.
|
|
168
|
+
*
|
|
169
|
+
* @csspart radio - apply css to a specific checkbox.
|
|
170
|
+
* @csspart radio-input - apply css to a specific checkbox's input.
|
|
171
|
+
* @csspart radio-label - apply css to a specific checkbox's label.
|
|
168
172
|
*/
|
|
169
173
|
|
|
170
174
|
// build the component class
|
|
@@ -395,9 +399,10 @@ class AuroRadio extends i$2 {
|
|
|
395
399
|
};
|
|
396
400
|
|
|
397
401
|
return x`
|
|
398
|
-
<div class="ods-inputGroup rdoGroup">
|
|
402
|
+
<div class="ods-inputGroup rdoGroup" part="radio">
|
|
399
403
|
<input
|
|
400
404
|
class="util_displayHiddenVisually ods-inputOption rdo--input"
|
|
405
|
+
part="radio-input"
|
|
401
406
|
@focus="${this.handleFocus}"
|
|
402
407
|
@input="${this.handleInput}"
|
|
403
408
|
@change="${this.handleChange}"
|
|
@@ -409,13 +414,16 @@ class AuroRadio extends i$2 {
|
|
|
409
414
|
name="${o$1(this.name)}"
|
|
410
415
|
type="radio"
|
|
411
416
|
.value="${this.value}"
|
|
412
|
-
|
|
417
|
+
tabindex="-1"
|
|
413
418
|
/>
|
|
414
419
|
|
|
415
|
-
<label
|
|
420
|
+
<label
|
|
421
|
+
for="${this.inputId}"
|
|
422
|
+
class="${e(labelClasses)}"
|
|
423
|
+
part="radio-label"
|
|
424
|
+
>
|
|
416
425
|
<slot>${this.label}</slot>
|
|
417
426
|
</label>
|
|
418
|
-
|
|
419
427
|
</div>
|
|
420
428
|
<slot name="content" class="slotContent"></slot>
|
|
421
429
|
`;
|
|
@@ -45,7 +45,7 @@ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = cl
|
|
|
45
45
|
|
|
46
46
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t();}(0,function(){function e(e){var t=true,n=false,o=null,d={text:true,search:true,url:true,tel:true,email:true,password:true,number:true,date:true,month:true,week:true,time:true,datetime:true,"datetime-local":true};function i(e){return !!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""));}function u(e){t=false;}function a(){document.addEventListener("mousemove",c),document.addEventListener("mousedown",c),document.addEventListener("mouseup",c),document.addEventListener("pointermove",c),document.addEventListener("pointerdown",c),document.addEventListener("pointerup",c),document.addEventListener("touchmove",c),document.addEventListener("touchstart",c),document.addEventListener("touchend",c);}function c(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=false,document.removeEventListener("mousemove",c),document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",c),document.removeEventListener("pointermove",c),document.removeEventListener("pointerdown",c),document.removeEventListener("pointerup",c),document.removeEventListener("touchmove",c),document.removeEventListener("touchstart",c),document.removeEventListener("touchend",c));}document.addEventListener("keydown",function(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=true);},true),document.addEventListener("mousedown",u,true),document.addEventListener("pointerdown",u,true),document.addEventListener("touchstart",u,true),document.addEventListener("visibilitychange",function(e){"hidden"===document.visibilityState&&(n&&(t=true),a());},true),a(),e.addEventListener("focus",function(e){var n,o,u;i(e.target)&&(t||(n=e.target,o=n.type,"INPUT"===(u=n.tagName)&&d[o]&&!n.readOnly||"TEXTAREA"===u&&!n.readOnly||n.isContentEditable))&&s(e.target);},true),e.addEventListener("blur",function(e){var t;i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=true,window.clearTimeout(o),o=window.setTimeout(function(){n=false;},100),(t=e.target).hasAttribute("data-focus-visible-added")&&(t.classList.remove("focus-visible"),t.removeAttribute("data-focus-visible-added")));},true),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""));}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready");}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",false,false,{});}window.dispatchEvent(t);}"undefined"!=typeof document&&e(document);});
|
|
47
47
|
|
|
48
|
-
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;outline:unset}:host(.focus-visible) .displayFlex .inputGroup:focus-within{width:auto}:host(.focus-visible) .rdoGroup{display:block;padding-right:var(--ds-size-100, 0.5rem);outline:3px solid transparent}:host(.focus-visible) .rdoGroup .label:after{outline-width:1px;outline-style:solid}.rdoGroup{position:relative;padding-right:var(--ds-size-100, 0.5rem);padding-left:var(--ds-size-100, 0.5rem);line-height:var(--ds-size-400, 2rem)}.label{display:block;margin-left:var(--ds-size-300, 1.5rem)}.label:hover{cursor:pointer}.label:after{position:absolute;z-index:1;top:
|
|
48
|
+
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;outline:unset}:host(.focus-visible) .displayFlex .inputGroup:focus-within{width:auto}:host(.focus-visible) .rdoGroup{display:block;padding-right:var(--ds-size-100, 0.5rem);outline:3px solid transparent}:host(.focus-visible) .rdoGroup .label:after{outline-width:1px;outline-style:solid}.rdoGroup{position:relative;padding-right:var(--ds-size-100, 0.5rem);padding-left:var(--ds-size-100, 0.5rem);line-height:var(--ds-size-400, 2rem)}.label{display:block;margin-left:var(--ds-size-300, 1.5rem)}.label:hover{cursor:pointer}.label:after{position:absolute;z-index:1;top:var(--ds-size-200, 1rem);left:var(--ds-size-50, 0.25rem);width:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));height:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));transform:translateY(-50%);content:"";border-radius:50%;border:1px solid}.slotContent{display:block;margin-left:var(--ds-size-400, 2rem);padding-left:var(--ds-size-100, 0.5rem)}`;
|
|
49
49
|
|
|
50
50
|
var colorCss$2 = i$5`.label{color:var(--ds-auro-radio-label-color)}.label:after{background-color:var(--ds-auro-radio-btn-fill-color);border-color:var(--ds-auro-radio-btn-border-color);box-shadow:inset 0 0 0 3px var(--ds-auro-radio-btn-inset-color);outline-color:var(--ds-auro-radio-btn-border-color);-webkit-tap-highlight-color:var(--ds-auro-radio-tap-color)}:host([checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator, #ffffff);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue, #01426a);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue, #01426a)}:host([error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-disabled, #dddddd);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-disabled, #dddddd)}:host(.focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([onDark]){--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([onDark][checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator-inverse, #00274a);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff)}:host([onDark][error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894)}:host([onDark].focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
|
|
51
51
|
|
|
@@ -140,6 +140,10 @@ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
|
140
140
|
* @event auroRadio-blur - Notifies that the component has lost focus.
|
|
141
141
|
* @event resetRadio - Notifies that the component has reset the checked/selected state.
|
|
142
142
|
* @event auroRadio-selected - Notifies that the component has been marked as checked/selected.
|
|
143
|
+
*
|
|
144
|
+
* @csspart radio - apply css to a specific checkbox.
|
|
145
|
+
* @csspart radio-input - apply css to a specific checkbox's input.
|
|
146
|
+
* @csspart radio-label - apply css to a specific checkbox's label.
|
|
143
147
|
*/
|
|
144
148
|
|
|
145
149
|
// build the component class
|
|
@@ -370,9 +374,10 @@ class AuroRadio extends i$2 {
|
|
|
370
374
|
};
|
|
371
375
|
|
|
372
376
|
return x`
|
|
373
|
-
<div class="ods-inputGroup rdoGroup">
|
|
377
|
+
<div class="ods-inputGroup rdoGroup" part="radio">
|
|
374
378
|
<input
|
|
375
379
|
class="util_displayHiddenVisually ods-inputOption rdo--input"
|
|
380
|
+
part="radio-input"
|
|
376
381
|
@focus="${this.handleFocus}"
|
|
377
382
|
@input="${this.handleInput}"
|
|
378
383
|
@change="${this.handleChange}"
|
|
@@ -384,13 +389,16 @@ class AuroRadio extends i$2 {
|
|
|
384
389
|
name="${o$1(this.name)}"
|
|
385
390
|
type="radio"
|
|
386
391
|
.value="${this.value}"
|
|
387
|
-
|
|
392
|
+
tabindex="-1"
|
|
388
393
|
/>
|
|
389
394
|
|
|
390
|
-
<label
|
|
395
|
+
<label
|
|
396
|
+
for="${this.inputId}"
|
|
397
|
+
class="${e(labelClasses)}"
|
|
398
|
+
part="radio-label"
|
|
399
|
+
>
|
|
391
400
|
<slot>${this.label}</slot>
|
|
392
401
|
</label>
|
|
393
|
-
|
|
394
402
|
</div>
|
|
395
403
|
<slot name="content" class="slotContent"></slot>
|
|
396
404
|
`;
|
|
@@ -100,7 +100,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
100
100
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
101
101
|
|
|
102
102
|
```html
|
|
103
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@
|
|
103
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@latest/auro-radio/+esm"></script>
|
|
104
104
|
```
|
|
105
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
106
|
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
* @event auroRadio-blur - Notifies that the component has lost focus.
|
|
14
14
|
* @event resetRadio - Notifies that the component has reset the checked/selected state.
|
|
15
15
|
* @event auroRadio-selected - Notifies that the component has been marked as checked/selected.
|
|
16
|
+
*
|
|
17
|
+
* @csspart radio - apply css to a specific checkbox.
|
|
18
|
+
* @csspart radio-input - apply css to a specific checkbox's input.
|
|
19
|
+
* @csspart radio-label - apply css to a specific checkbox's label.
|
|
16
20
|
*/
|
|
17
21
|
export class AuroRadio extends LitElement {
|
|
18
22
|
static get styles(): import("lit").CSSResult[];
|