@aurodesignsystem-dev/auro-formkit 0.0.0-pr1594.2 → 0.0.0-pr1595.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/components/bibtemplate/dist/auro-bibtemplate.d.ts +11 -0
- package/components/bibtemplate/dist/index.js +13 -0
- package/components/bibtemplate/dist/registered.js +13 -0
- package/components/checkbox/demo/api.md +17 -11
- package/components/checkbox/demo/customize.min.js +23 -6
- package/components/checkbox/demo/getting-started.min.js +23 -6
- package/components/checkbox/demo/index.min.js +23 -6
- package/components/checkbox/dist/auro-checkbox-group.d.ts +8 -0
- package/components/checkbox/dist/auro-checkbox.d.ts +4 -0
- package/components/checkbox/dist/index.js +23 -6
- package/components/checkbox/dist/registered.js +23 -6
- package/components/combobox/demo/api.md +26 -18
- package/components/combobox/demo/customize.min.js +426 -126
- package/components/combobox/demo/getting-started.min.js +426 -126
- package/components/combobox/demo/index.min.js +426 -126
- package/components/combobox/dist/auro-combobox.d.ts +38 -21
- package/components/combobox/dist/index.js +338 -111
- package/components/combobox/dist/registered.js +338 -111
- package/components/counter/demo/api.md +34 -16
- package/components/counter/demo/customize.min.js +204 -64
- package/components/counter/demo/index.min.js +204 -64
- package/components/counter/dist/auro-counter-button.d.ts +4 -0
- package/components/counter/dist/auro-counter-group.d.ts +27 -4
- package/components/counter/dist/auro-counter.d.ts +7 -0
- package/components/counter/dist/index.js +204 -64
- package/components/counter/dist/registered.js +204 -64
- package/components/datepicker/demo/api.md +55 -49
- package/components/datepicker/demo/customize.min.js +515 -134
- package/components/datepicker/demo/index.min.js +515 -134
- package/components/datepicker/dist/auro-calendar-cell.d.ts +58 -4
- package/components/datepicker/dist/auro-calendar-month.d.ts +10 -4
- package/components/datepicker/dist/auro-calendar.d.ts +25 -6
- package/components/datepicker/dist/auro-datepicker.d.ts +70 -22
- package/components/datepicker/dist/index.js +515 -134
- package/components/datepicker/dist/registered.js +515 -134
- package/components/dropdown/demo/api.md +25 -22
- package/components/dropdown/demo/customize.min.js +107 -37
- package/components/dropdown/demo/getting-started.min.js +245 -82
- package/components/dropdown/demo/index.min.js +107 -37
- package/components/dropdown/dist/auro-dropdown.d.ts +34 -8
- package/components/dropdown/dist/auro-dropdownBib.d.ts +17 -5
- package/components/dropdown/dist/index.js +107 -37
- package/components/dropdown/dist/registered.js +107 -37
- package/components/form/demo/customize.min.js +1518 -466
- package/components/form/demo/getting-started.min.js +1518 -466
- package/components/form/demo/index.min.js +1518 -466
- package/components/form/demo/registerDemoDeps.min.js +1518 -466
- package/components/helptext/dist/auro-helptext.d.ts +8 -7
- package/components/helptext/dist/index.js +7 -2
- package/components/helptext/dist/registered.js +7 -2
- package/components/input/demo/api.md +30 -30
- package/components/input/demo/customize.min.js +138 -45
- package/components/input/demo/getting-started.min.js +138 -45
- package/components/input/demo/index.min.js +138 -45
- package/components/input/dist/base-input.d.ts +79 -25
- package/components/input/dist/index.js +138 -45
- package/components/input/dist/registered.js +138 -45
- package/components/layoutElement/dist/auroElement.d.ts +10 -17
- package/components/layoutElement/dist/index.js +20 -20
- package/components/layoutElement/dist/registered.js +20 -20
- package/components/menu/demo/api.md +31 -27
- package/components/menu/demo/index.min.js +108 -35
- package/components/menu/dist/auro-menu.d.ts +26 -21
- package/components/menu/dist/auro-menuoption.d.ts +27 -1
- package/components/menu/dist/index.js +108 -35
- package/components/menu/dist/registered.js +108 -35
- package/components/radio/demo/api.md +8 -7
- package/components/radio/demo/customize.min.js +21 -7
- package/components/radio/demo/getting-started.min.js +21 -7
- package/components/radio/demo/index.min.js +21 -7
- package/components/radio/dist/auro-radio-group.d.ts +8 -3
- package/components/radio/dist/auro-radio.d.ts +1 -0
- package/components/radio/dist/index.js +21 -7
- package/components/radio/dist/registered.js +21 -7
- package/components/select/demo/api.md +18 -15
- package/components/select/demo/customize.min.js +259 -79
- package/components/select/demo/getting-started.min.js +259 -79
- package/components/select/demo/index.min.js +259 -79
- package/components/select/dist/auro-select.d.ts +17 -0
- package/components/select/dist/index.js +171 -64
- package/components/select/dist/registered.js +171 -64
- package/custom-elements.json +1189 -1336
- package/package.json +1 -1
|
@@ -7,32 +7,35 @@ The `auro-menu` element provides users a way to select from a list of options.
|
|
|
7
7
|
|
|
8
8
|
## Properties
|
|
9
9
|
|
|
10
|
-
| Property | Attribute | Modifiers | Type
|
|
11
|
-
|
|
12
|
-
| `currentLabel` | | readonly | `string`
|
|
13
|
-
| `disabled` | `disabled` | | `boolean`
|
|
14
|
-
| `hasLoadingPlaceholder` | | readonly | `boolean`
|
|
15
|
-
| `index` | | | `number`
|
|
16
|
-
| `layout` |
|
|
17
|
-
| `loading` | `loading` | | `boolean`
|
|
18
|
-
| `matchWord` | `matchword` | | `string`
|
|
19
|
-
| `multiSelect` | `multiselect` | | `boolean`
|
|
20
|
-
| `noCheckmark` | `nocheckmark` | | `boolean`
|
|
21
|
-
| `optionActive` | | | `
|
|
22
|
-
| `optionSelected` | | | `
|
|
23
|
-
| `options` | | readonly | `HTMLElement[]`
|
|
24
|
-
| `selectedOption` | | readonly | `HTMLElement \| null`
|
|
25
|
-
| `selectedOptions` | | readonly | `HTMLElement[]`
|
|
26
|
-
| `
|
|
10
|
+
| Property | Attribute | Modifiers | Type | Default | Description |
|
|
11
|
+
|-------------------------|---------------|-----------|----------------------------------------|-------------|--------------------------------------------------|
|
|
12
|
+
| `currentLabel` | | readonly | `string` | | |
|
|
13
|
+
| `disabled` | `disabled` | | `boolean` | | When true, the entire menu and all options are disabled. |
|
|
14
|
+
| `hasLoadingPlaceholder` | | readonly | `boolean` | | Getter for loading placeholder state. |
|
|
15
|
+
| `index` | | | `number` | | |
|
|
16
|
+
| `layout` | `layout` | | `string` | | Applies a named layout variant to the menu. Free-form string consumed by the shared architecture helpers; menu defines no closed value set. |
|
|
17
|
+
| `loading` | `loading` | | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
|
|
18
|
+
| `matchWord` | `matchword` | | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
|
|
19
|
+
| `multiSelect` | `multiselect` | | `boolean` | false | When true, the selected option can be multiple options. |
|
|
20
|
+
| `noCheckmark` | `nocheckmark` | | `boolean` | false | When true, selected option will not show the checkmark. |
|
|
21
|
+
| `optionActive` | | | `HTMLElement` | "undefined" | Specifies the current active menuOption. |
|
|
22
|
+
| `optionSelected` | | | `HTMLElement \| HTMLElement[]` | "undefined" | The currently selected menu option(s). In single-select mode this is a single `HTMLElement` (or `undefined` when nothing is selected). In multi-select mode this is an array of `HTMLElement`s. |
|
|
23
|
+
| `options` | | readonly | `HTMLElement[]` | | |
|
|
24
|
+
| `selectedOption` | | readonly | `HTMLElement \| null` | | Gets the first selected option, or null if none. |
|
|
25
|
+
| `selectedOptions` | | readonly | `HTMLElement[]` | | Gets the currently selected options as an array. |
|
|
26
|
+
| `shape` | `shape` | | `'box' \| 'pill' \| 'snowflake'` | "'box'" | Sets the shape of the menu options. |
|
|
27
|
+
| `size` | `size` | | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | "'sm'" | Sets the size of the menu options. |
|
|
28
|
+
| `value` | `value` | | `string` | "undefined" | The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.<br />Options marked `disabled` or `static` are not selectable by value; `hidden` options remain selectable. In single-select mode, if the value matches a non-selectable option the selection is cleared (`optionSelected` becomes `undefined`) and `auroMenu-selectValueFailure` is dispatched. In multi-select mode, non-selectable entries are dropped from the value and the remaining selectable entries are selected; `auroMenu-selectValueFailure` is dispatched only when none of the entries match a selectable option. |
|
|
27
29
|
|
|
28
30
|
## Methods
|
|
29
31
|
|
|
30
|
-
| Method
|
|
31
|
-
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
32
|
+
| Method | Type | Description |
|
|
33
|
+
|----------------------------------|--------------------------------------------------|--------------------------------------------------|
|
|
34
|
+
| `initializeArchitectureDefaults` | `(): void` | |
|
|
35
|
+
| `navigateOptions` | `(direction: string): void` | Navigates through options using keyboard.<br /><br />**direction**: 'up' or 'down'. |
|
|
36
|
+
| `reset` | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
|
|
37
|
+
| `selectByValue` | `(value: string \| string[] \| null \| undefined): void` | Selects options by value. Options marked `disabled` or `static` are not selectable; `hidden` options remain selectable. In single-select mode, if the value matches a non-selectable option the selection is cleared and `auroMenu-selectValueFailure` is dispatched. In multi-select mode, non-selectable entries are dropped and the remaining selectable entries are selected; `auroMenu-selectValueFailure` is dispatched only when none of the entries match a selectable option. Passing `undefined`, `null`, an empty string, or an empty array clears the selection without dispatching a failure.<br /><br />**value**: The value(s) to select. |
|
|
38
|
+
| `updateActiveOption` | `(indexOrOption: number \| HTMLElement): void` | Updates the active option state and dispatches events.<br />Accepts either a numeric index or an HTMLElement option.<br /><br />**indexOrOption**: Index of the option or the option element to make active. |
|
|
36
39
|
|
|
37
40
|
## Events
|
|
38
41
|
|
|
@@ -41,7 +44,7 @@ The `auro-menu` element provides users a way to select from a list of options.
|
|
|
41
44
|
| `auroMenu-activatedOption` | `CustomEvent<Element>` | Notifies that a menuoption has been made `active`. |
|
|
42
45
|
| `auroMenu-customEventFired` | `CustomEvent<any>` | Notifies that a custom event has been fired. |
|
|
43
46
|
| `auroMenu-loadingChange` | `CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>` | Notifies when the loading attribute is changed. |
|
|
44
|
-
| `auroMenu-optionsChange` | `CustomEvent<{ options:
|
|
47
|
+
| `auroMenu-optionsChange` | `CustomEvent<{ options: Array<HTMLElement> }>` | Notifies that the set of available menu options has changed. |
|
|
45
48
|
| `auroMenu-selectValueFailure` | `CustomEvent<any>` | Notifies that an attempt to select a menuoption by matching a value has failed. |
|
|
46
49
|
| `auroMenu-selectValueReset` | `CustomEvent<any>` | Notifies that the component value has been reset. |
|
|
47
50
|
| `auroMenu-selectedOption` | `CustomEvent<any>` | Notifies that a new menuoption selection has been made. |
|
|
@@ -68,15 +71,16 @@ The `auro-menuoption` element provides users a way to define a menu option.
|
|
|
68
71
|
|
|
69
72
|
| Property | Attribute | Modifiers | Type | Default | Description |
|
|
70
73
|
|---------------|---------------|-----------|-----------|---------|--------------------------------------------------|
|
|
71
|
-
| `disabled` | `disabled` | | `boolean` | false |
|
|
74
|
+
| `disabled` | `disabled` | | `boolean` | false | When true, the option is disabled and cannot be selected. |
|
|
75
|
+
| `event` | `event` | | `string` | | When set, selecting this option dispatches a custom event of the given name from the parent `auro-menu` (and an `auroMenu-customEventFired` event) instead of selecting the option. |
|
|
72
76
|
| `iconTag` | | | | | |
|
|
73
77
|
| `isActive` | | readonly | `boolean` | | Returns whether the menu option is currently active and selectable. |
|
|
74
78
|
| `layout` | | | `string` | | |
|
|
75
|
-
| `noCheckmark` | `
|
|
79
|
+
| `noCheckmark` | `nocheckmark` | | `boolean` | false | When true, this option will not show the checkmark when selected. |
|
|
76
80
|
| `noMatch` | `nomatch` | | `boolean` | false | When true, marks this option as the "no matching results" placeholder shown by combobox<br />when the user's input does not match any available options. |
|
|
77
81
|
| `persistent` | `persistent` | | `boolean` | false | When true, this option is excluded from `matchWord` DOM rewriting — useful for utility rows (e.g., "Add new…") that must render identically regardless of the current filter. |
|
|
78
82
|
| `selected` | `selected` | | `boolean` | false | **Deprecated.** Use the `value` attribute on `auro-menu` to set the selected option when the menu renders (or call `menu.selectByValue(value)` programmatically). Support for the child-level `selected` attribute will be removed in a future major release. |
|
|
79
|
-
| `value` | `value` | | `string` | |
|
|
83
|
+
| `value` | `value` | | `string` | | The value associated with this menu option. |
|
|
80
84
|
|
|
81
85
|
## Methods
|
|
82
86
|
|
|
@@ -30,37 +30,37 @@ var colorCss$1 = i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-div
|
|
|
30
30
|
|
|
31
31
|
var tokensCss = i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* AuroElement is the shared base class for layout-aware Auro form components.
|
|
35
|
+
*
|
|
36
|
+
* It defines the common `layout`, `shape`, `size`, and `ondark` reactive
|
|
37
|
+
* properties and the architecture helpers (`renderLayout`, `resetShapeClasses`,
|
|
38
|
+
* `resetLayoutClasses`) that subclasses use to render a chosen layout and apply
|
|
39
|
+
* the matching `shape-*` / `layout-*` wrapper classes. Subclasses supply their
|
|
40
|
+
* own default and valid value set for `layout`, `shape`, and `size`.
|
|
41
|
+
*/
|
|
33
42
|
class AuroElement extends i$2 {
|
|
34
43
|
static get properties() {
|
|
35
44
|
return {
|
|
36
45
|
|
|
37
46
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @default {'default'}
|
|
47
|
+
* When true, renders the component styled for use on a dark background.
|
|
40
48
|
*/
|
|
41
|
-
layout: {
|
|
42
|
-
type: String,
|
|
43
|
-
attribute: "layout",
|
|
44
|
-
reflect: true
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
shape: {
|
|
48
|
-
type: String,
|
|
49
|
-
attribute: "shape",
|
|
50
|
-
reflect: true
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
size: {
|
|
54
|
-
type: String,
|
|
55
|
-
attribute: "size",
|
|
56
|
-
reflect: true
|
|
57
|
-
},
|
|
58
|
-
|
|
59
49
|
onDark: {
|
|
60
50
|
type: Boolean,
|
|
61
51
|
attribute: "ondark",
|
|
62
52
|
reflect: true
|
|
63
53
|
}
|
|
54
|
+
|
|
55
|
+
// NOTE: `layout`, `shape`, and `size` are intentionally NOT declared here.
|
|
56
|
+
// Their valid value sets differ per component, and the CEM analyzer roots
|
|
57
|
+
// an inherited property's `type` in the class that declares it — a base
|
|
58
|
+
// declaration would force every subclass's `@type` to be discarded and
|
|
59
|
+
// emitted as plain `string`. Each subclass declares its own `layout` /
|
|
60
|
+
// `shape` / `size` with an exact `@type` union instead. AuroElement still
|
|
61
|
+
// consumes `this.layout` / `this.shape` / `this.size` in its render and
|
|
62
|
+
// architecture helpers below (subclasses guarantee the reactive props).
|
|
63
|
+
// See AlaskaAirlines/discussions#653.
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -423,6 +423,7 @@ let menuInstanceIdCounter = 0;
|
|
|
423
423
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
424
424
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
425
425
|
* @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
|
|
426
|
+
* @event {CustomEvent<{ options: Array<HTMLElement> }>} auroMenu-optionsChange - Notifies that the set of available menu options has changed.
|
|
426
427
|
* @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
|
|
427
428
|
* @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
|
|
428
429
|
* @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
|
|
@@ -437,15 +438,7 @@ class AuroMenu extends AuroElement {
|
|
|
437
438
|
|
|
438
439
|
// State properties (reactive)
|
|
439
440
|
|
|
440
|
-
|
|
441
|
-
* @private
|
|
442
|
-
*/
|
|
443
|
-
this.shape = "box";
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* @private
|
|
447
|
-
*/
|
|
448
|
-
this.size = "sm";
|
|
441
|
+
this.initializeArchitectureDefaults();
|
|
449
442
|
|
|
450
443
|
// Value of the selected options
|
|
451
444
|
this.value = undefined;
|
|
@@ -486,8 +479,6 @@ class AuroMenu extends AuroElement {
|
|
|
486
479
|
|
|
487
480
|
// Instance properties (non-reactive)
|
|
488
481
|
|
|
489
|
-
menuInstanceIdCounter += 1;
|
|
490
|
-
|
|
491
482
|
Object.assign(this, {
|
|
492
483
|
// Root-level menu (true) or a nested submenu (false)
|
|
493
484
|
rootMenu: true,
|
|
@@ -499,7 +490,7 @@ class AuroMenu extends AuroElement {
|
|
|
499
490
|
loadingSlots: null,
|
|
500
491
|
// Unique id for this menu instance; prefixes every auto-generated option
|
|
501
492
|
// key so keys never collide across menus in the same document.
|
|
502
|
-
_menuInstanceId: `menu-${menuInstanceIdCounter}`,
|
|
493
|
+
_menuInstanceId: `menu-${menuInstanceIdCounter += 1}`,
|
|
503
494
|
// Monotonically increasing counter for option key generation. Never
|
|
504
495
|
// resets, so a key is never reused within this instance's lifetime.
|
|
505
496
|
_optionKeyCounter: 0,
|
|
@@ -515,10 +506,50 @@ class AuroMenu extends AuroElement {
|
|
|
515
506
|
});
|
|
516
507
|
}
|
|
517
508
|
|
|
509
|
+
// Defaults for the layout/shape/size architecture props are set in a helper
|
|
510
|
+
// (not the constructor body) so the CEM analyzer keeps their `@type` unions
|
|
511
|
+
// instead of inferring `string` from a constructor-literal assignment.
|
|
512
|
+
// See AlaskaAirlines/discussions#653.
|
|
513
|
+
initializeArchitectureDefaults() {
|
|
514
|
+
this.shape = "box";
|
|
515
|
+
this.size = "sm";
|
|
516
|
+
}
|
|
517
|
+
|
|
518
518
|
static get properties() {
|
|
519
519
|
return {
|
|
520
520
|
...super.properties,
|
|
521
521
|
|
|
522
|
+
/**
|
|
523
|
+
* Applies a named layout variant to the menu. Free-form string consumed by the shared architecture helpers; menu defines no closed value set.
|
|
524
|
+
*/
|
|
525
|
+
layout: {
|
|
526
|
+
type: String,
|
|
527
|
+
attribute: "layout",
|
|
528
|
+
reflect: true
|
|
529
|
+
},
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Sets the shape of the menu options.
|
|
533
|
+
* @type {'box' | 'pill' | 'snowflake'}
|
|
534
|
+
* @default 'box'
|
|
535
|
+
*/
|
|
536
|
+
shape: {
|
|
537
|
+
type: String,
|
|
538
|
+
attribute: "shape",
|
|
539
|
+
reflect: true
|
|
540
|
+
},
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Sets the size of the menu options.
|
|
544
|
+
* @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
|
|
545
|
+
* @default 'sm'
|
|
546
|
+
*/
|
|
547
|
+
size: {
|
|
548
|
+
type: String,
|
|
549
|
+
attribute: "size",
|
|
550
|
+
reflect: true
|
|
551
|
+
},
|
|
552
|
+
|
|
522
553
|
/**
|
|
523
554
|
* When true, the entire menu and all options are disabled.
|
|
524
555
|
*/
|
|
@@ -574,6 +605,7 @@ class AuroMenu extends AuroElement {
|
|
|
574
605
|
/**
|
|
575
606
|
* Specifies the current active menuOption.
|
|
576
607
|
* @readonly
|
|
608
|
+
* @type {HTMLElement}
|
|
577
609
|
*/
|
|
578
610
|
optionActive: {
|
|
579
611
|
type: Object,
|
|
@@ -583,6 +615,7 @@ class AuroMenu extends AuroElement {
|
|
|
583
615
|
/**
|
|
584
616
|
* The currently selected menu option(s). In single-select mode this is a single `HTMLElement` (or `undefined` when nothing is selected). In multi-select mode this is an array of `HTMLElement`s.
|
|
585
617
|
* @readonly
|
|
618
|
+
* @type {HTMLElement | HTMLElement[]}
|
|
586
619
|
*/
|
|
587
620
|
optionSelected: {
|
|
588
621
|
// Allow HTMLElement, HTMLElement[] arrays and undefined
|
|
@@ -1853,9 +1886,36 @@ class AuroMenuOption extends AuroElement {
|
|
|
1853
1886
|
static get properties() {
|
|
1854
1887
|
return {
|
|
1855
1888
|
...super.properties,
|
|
1889
|
+
|
|
1890
|
+
/**
|
|
1891
|
+
* Sets the shape of the option. When unset, it inherits the shape of the parent `auro-menu`.
|
|
1892
|
+
* @type {'box' | 'pill' | 'snowflake'}
|
|
1893
|
+
* @default 'box'
|
|
1894
|
+
*/
|
|
1895
|
+
shape: {
|
|
1896
|
+
type: String,
|
|
1897
|
+
attribute: "shape",
|
|
1898
|
+
reflect: true
|
|
1899
|
+
},
|
|
1900
|
+
|
|
1901
|
+
/**
|
|
1902
|
+
* Sets the size of the option. When unset, it inherits the size of the parent `auro-menu`.
|
|
1903
|
+
* @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
|
|
1904
|
+
* @default 'sm'
|
|
1905
|
+
*/
|
|
1906
|
+
size: {
|
|
1907
|
+
type: String,
|
|
1908
|
+
attribute: "size",
|
|
1909
|
+
reflect: true
|
|
1910
|
+
},
|
|
1911
|
+
|
|
1912
|
+
/**
|
|
1913
|
+
* When true, this option will not show the checkmark when selected.
|
|
1914
|
+
*/
|
|
1856
1915
|
noCheckmark: {
|
|
1857
1916
|
type: Boolean,
|
|
1858
|
-
reflect: true
|
|
1917
|
+
reflect: true,
|
|
1918
|
+
attribute: 'nocheckmark'
|
|
1859
1919
|
},
|
|
1860
1920
|
|
|
1861
1921
|
/**
|
|
@@ -1867,21 +1927,34 @@ class AuroMenuOption extends AuroElement {
|
|
|
1867
1927
|
type: Boolean,
|
|
1868
1928
|
reflect: true
|
|
1869
1929
|
},
|
|
1930
|
+
|
|
1931
|
+
/**
|
|
1932
|
+
* When true, the option is disabled and cannot be selected.
|
|
1933
|
+
*/
|
|
1870
1934
|
disabled: {
|
|
1871
1935
|
type: Boolean,
|
|
1872
1936
|
reflect: true
|
|
1873
1937
|
},
|
|
1938
|
+
|
|
1939
|
+
/**
|
|
1940
|
+
* The value associated with this menu option.
|
|
1941
|
+
*/
|
|
1874
1942
|
value: {
|
|
1875
1943
|
type: String,
|
|
1876
1944
|
reflect: true
|
|
1877
1945
|
},
|
|
1946
|
+
|
|
1947
|
+
/**
|
|
1948
|
+
* Sets the tab order of the menu option.
|
|
1949
|
+
*/
|
|
1878
1950
|
tabIndex: {
|
|
1879
1951
|
type: Number,
|
|
1880
|
-
reflect: true
|
|
1952
|
+
reflect: true,
|
|
1953
|
+
attribute: 'tabindex'
|
|
1881
1954
|
},
|
|
1882
1955
|
|
|
1883
1956
|
/**
|
|
1884
|
-
*
|
|
1957
|
+
* When set, selecting this option dispatches a custom event of the given name from the parent `auro-menu` (and an `auroMenu-customEventFired` event) instead of selecting the option.
|
|
1885
1958
|
*/
|
|
1886
1959
|
event: {
|
|
1887
1960
|
type: String,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
6
6
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
7
7
|
* @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
|
|
8
|
+
* @event {CustomEvent<{ options: Array<HTMLElement> }>} auroMenu-optionsChange - Notifies that the set of available menu options has changed.
|
|
8
9
|
* @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
|
|
9
10
|
* @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
|
|
10
11
|
* @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
|
|
@@ -14,6 +15,26 @@
|
|
|
14
15
|
*/
|
|
15
16
|
export class AuroMenu extends AuroElement {
|
|
16
17
|
static get properties(): {
|
|
18
|
+
/**
|
|
19
|
+
* Applies a named layout variant to the menu. Free-form string consumed by the shared architecture helpers; menu defines no closed value set.
|
|
20
|
+
*/
|
|
21
|
+
layout: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
attribute: string;
|
|
24
|
+
reflect: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Sets the shape of the menu options.
|
|
28
|
+
* @type {'box' | 'pill' | 'snowflake'}
|
|
29
|
+
* @default 'box'
|
|
30
|
+
*/
|
|
31
|
+
shape: "box" | "pill" | "snowflake";
|
|
32
|
+
/**
|
|
33
|
+
* Sets the size of the menu options.
|
|
34
|
+
* @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
|
|
35
|
+
* @default 'sm'
|
|
36
|
+
*/
|
|
37
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
17
38
|
/**
|
|
18
39
|
* When true, the entire menu and all options are disabled.
|
|
19
40
|
*/
|
|
@@ -60,14 +81,8 @@ export class AuroMenu extends AuroElement {
|
|
|
60
81
|
reflect: boolean;
|
|
61
82
|
attribute: string;
|
|
62
83
|
};
|
|
63
|
-
optionActive:
|
|
64
|
-
|
|
65
|
-
attribute: boolean;
|
|
66
|
-
};
|
|
67
|
-
optionSelected: {
|
|
68
|
-
type: ObjectConstructor;
|
|
69
|
-
attribute: boolean;
|
|
70
|
-
};
|
|
84
|
+
optionActive: HTMLElement;
|
|
85
|
+
optionSelected: HTMLElement | HTMLElement[];
|
|
71
86
|
/**
|
|
72
87
|
* The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
|
|
73
88
|
* Options marked `disabled` or `static` are not selectable by value; `hidden` options remain selectable. In single-select mode, if the value matches a non-selectable option the selection is cleared (`optionSelected` becomes `undefined`) and `auroMenu-selectValueFailure` is dispatched. In multi-select mode, non-selectable entries are dropped from the value and the remaining selectable entries are selected; `auroMenu-selectValueFailure` is dispatched only when none of the entries match a selectable option.
|
|
@@ -77,11 +92,6 @@ export class AuroMenu extends AuroElement {
|
|
|
77
92
|
reflect: boolean;
|
|
78
93
|
attribute: string;
|
|
79
94
|
};
|
|
80
|
-
layout: {
|
|
81
|
-
type: StringConstructor;
|
|
82
|
-
attribute: string;
|
|
83
|
-
reflect: boolean;
|
|
84
|
-
};
|
|
85
95
|
};
|
|
86
96
|
static get styles(): import("lit").CSSResult[];
|
|
87
97
|
/**
|
|
@@ -93,14 +103,6 @@ export class AuroMenu extends AuroElement {
|
|
|
93
103
|
*
|
|
94
104
|
*/
|
|
95
105
|
static register(name?: string): void;
|
|
96
|
-
/**
|
|
97
|
-
* @private
|
|
98
|
-
*/
|
|
99
|
-
private shape;
|
|
100
|
-
/**
|
|
101
|
-
* @private
|
|
102
|
-
*/
|
|
103
|
-
private size;
|
|
104
106
|
value: any;
|
|
105
107
|
optionSelected: any;
|
|
106
108
|
matchWord: any;
|
|
@@ -131,6 +133,9 @@ export class AuroMenu extends AuroElement {
|
|
|
131
133
|
* @private
|
|
132
134
|
*/
|
|
133
135
|
private handleSlotChange;
|
|
136
|
+
initializeArchitectureDefaults(): void;
|
|
137
|
+
shape: string | undefined;
|
|
138
|
+
size: string | undefined;
|
|
134
139
|
/**
|
|
135
140
|
* @readonly
|
|
136
141
|
* @returns {Array<HTMLElement>} - Returns the array of available menu options.
|
|
@@ -10,9 +10,25 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export class AuroMenuOption extends AuroElement {
|
|
12
12
|
static get properties(): {
|
|
13
|
+
/**
|
|
14
|
+
* Sets the shape of the option. When unset, it inherits the shape of the parent `auro-menu`.
|
|
15
|
+
* @type {'box' | 'pill' | 'snowflake'}
|
|
16
|
+
* @default 'box'
|
|
17
|
+
*/
|
|
18
|
+
shape: "box" | "pill" | "snowflake";
|
|
19
|
+
/**
|
|
20
|
+
* Sets the size of the option. When unset, it inherits the size of the parent `auro-menu`.
|
|
21
|
+
* @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
|
|
22
|
+
* @default 'sm'
|
|
23
|
+
*/
|
|
24
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
25
|
+
/**
|
|
26
|
+
* When true, this option will not show the checkmark when selected.
|
|
27
|
+
*/
|
|
13
28
|
noCheckmark: {
|
|
14
29
|
type: BooleanConstructor;
|
|
15
30
|
reflect: boolean;
|
|
31
|
+
attribute: string;
|
|
16
32
|
};
|
|
17
33
|
/**
|
|
18
34
|
* **Deprecated.** Use the `value` attribute on `auro-menu` to set the selected option when the menu renders (or call `menu.selectByValue(value)` programmatically). Support for the child-level `selected` attribute will be removed in a future major release.
|
|
@@ -23,20 +39,30 @@ export class AuroMenuOption extends AuroElement {
|
|
|
23
39
|
type: BooleanConstructor;
|
|
24
40
|
reflect: boolean;
|
|
25
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* When true, the option is disabled and cannot be selected.
|
|
44
|
+
*/
|
|
26
45
|
disabled: {
|
|
27
46
|
type: BooleanConstructor;
|
|
28
47
|
reflect: boolean;
|
|
29
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* The value associated with this menu option.
|
|
51
|
+
*/
|
|
30
52
|
value: {
|
|
31
53
|
type: StringConstructor;
|
|
32
54
|
reflect: boolean;
|
|
33
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Sets the tab order of the menu option.
|
|
58
|
+
*/
|
|
34
59
|
tabIndex: {
|
|
35
60
|
type: NumberConstructor;
|
|
36
61
|
reflect: boolean;
|
|
62
|
+
attribute: string;
|
|
37
63
|
};
|
|
38
64
|
/**
|
|
39
|
-
*
|
|
65
|
+
* When set, selecting this option dispatches a custom event of the given name from the parent `auro-menu` (and an `auroMenu-customEventFired` event) instead of selecting the option.
|
|
40
66
|
*/
|
|
41
67
|
event: {
|
|
42
68
|
type: StringConstructor;
|