@aurodesignsystem-dev/auro-formkit 0.0.0-pr1480.9 → 0.0.0-pr1482.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.
Files changed (115) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +0 -7
  2. package/components/bibtemplate/dist/index.js +1 -9
  3. package/components/bibtemplate/dist/registered.js +1 -9
  4. package/components/checkbox/demo/customize.min.js +1 -1
  5. package/components/checkbox/demo/getting-started.min.js +1 -1
  6. package/components/checkbox/demo/index.min.js +1 -1
  7. package/components/checkbox/demo/pages.json +1 -1
  8. package/components/checkbox/dist/index.js +1 -1
  9. package/components/checkbox/dist/registered.js +1 -1
  10. package/components/combobox/demo/customize.md +7 -3
  11. package/components/combobox/demo/customize.min.js +1257 -1816
  12. package/components/combobox/demo/getting-started.min.js +1257 -1816
  13. package/components/combobox/demo/index.min.js +1257 -1816
  14. package/components/combobox/demo/keyboard-behavior.md +68 -8
  15. package/components/combobox/demo/pages.json +1 -1
  16. package/components/combobox/dist/auro-combobox.d.ts +5 -0
  17. package/components/combobox/dist/index.js +335 -319
  18. package/components/combobox/dist/registered.js +335 -319
  19. package/components/counter/demo/customize.min.js +15 -233
  20. package/components/counter/demo/index.min.js +15 -233
  21. package/components/counter/demo/keyboard-behavior.md +0 -1
  22. package/components/counter/demo/pages.json +1 -1
  23. package/components/counter/dist/index.js +5204 -208
  24. package/components/counter/dist/registered.js +5204 -208
  25. package/components/datepicker/demo/accessibility.md +3 -54
  26. package/components/datepicker/demo/api.md +2 -11
  27. package/components/datepicker/demo/customize.html +0 -2
  28. package/components/datepicker/demo/customize.md +8 -72
  29. package/components/datepicker/demo/design.md +1 -3
  30. package/components/datepicker/demo/index.js +1 -5
  31. package/components/datepicker/demo/index.md +2 -85
  32. package/components/datepicker/demo/index.min.js +183 -2288
  33. package/components/datepicker/demo/keyboard-behavior.md +2 -201
  34. package/components/datepicker/demo/pages.json +1 -1
  35. package/components/datepicker/demo/voiceover.md +12 -21
  36. package/components/datepicker/dist/index.js +156 -2174
  37. package/components/datepicker/dist/registered.js +156 -2174
  38. package/components/datepicker/dist/src/auro-calendar-cell.d.ts +11 -111
  39. package/components/datepicker/dist/src/auro-calendar-month.d.ts +0 -37
  40. package/components/datepicker/dist/src/auro-calendar.d.ts +0 -246
  41. package/components/datepicker/dist/src/auro-datepicker.d.ts +0 -88
  42. package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +3 -5
  43. package/components/dropdown/demo/accessibility.md +0 -11
  44. package/components/dropdown/demo/api.md +0 -1
  45. package/components/dropdown/demo/customize.md +0 -3
  46. package/components/dropdown/demo/customize.min.js +13 -223
  47. package/components/dropdown/demo/getting-started.min.js +13 -223
  48. package/components/dropdown/demo/index.min.js +13 -223
  49. package/components/dropdown/demo/keyboard-behavior.md +0 -1
  50. package/components/dropdown/demo/pages.json +1 -1
  51. package/components/dropdown/dist/auro-dropdown.d.ts +1 -33
  52. package/components/dropdown/dist/index.js +13 -223
  53. package/components/dropdown/dist/registered.js +13 -223
  54. package/components/form/demo/customize.min.js +7765 -10745
  55. package/components/form/demo/getting-started.min.js +7765 -10745
  56. package/components/form/demo/index.min.js +7765 -10745
  57. package/components/form/demo/pages.json +1 -1
  58. package/components/form/demo/registerDemoDeps.min.js +7764 -10744
  59. package/components/input/demo/customize.min.js +1 -1
  60. package/components/input/demo/getting-started.min.js +1 -1
  61. package/components/input/demo/index.min.js +1 -1
  62. package/components/input/demo/pages.json +1 -1
  63. package/components/input/dist/index.js +1 -1
  64. package/components/input/dist/registered.js +1 -1
  65. package/components/menu/demo/api.md +41 -45
  66. package/components/menu/demo/customize.md +0 -28
  67. package/components/menu/demo/index.min.js +779 -1354
  68. package/components/menu/demo/pages.json +1 -1
  69. package/components/menu/dist/auro-menu.d.ts +95 -110
  70. package/components/menu/dist/auro-menuoption.d.ts +32 -138
  71. package/components/menu/dist/index.js +753 -1308
  72. package/components/menu/dist/registered.js +765 -1308
  73. package/components/radio/demo/getting-started.js +1 -1
  74. package/components/radio/demo/getting-started.md +1 -1
  75. package/components/radio/demo/index.min.js +1 -1
  76. package/components/radio/demo/pages.json +1 -1
  77. package/components/radio/dist/index.js +1 -1
  78. package/components/radio/dist/registered.js +1 -1
  79. package/components/select/demo/customize.md +7 -3
  80. package/components/select/demo/customize.min.js +999 -1759
  81. package/components/select/demo/getting-started.min.js +999 -1759
  82. package/components/select/demo/index.min.js +999 -1759
  83. package/components/select/demo/keyboard-behavior.md +54 -9
  84. package/components/select/demo/pages.json +1 -1
  85. package/components/select/dist/index.js +76 -261
  86. package/components/select/dist/registered.js +76 -261
  87. package/components/select/dist/selectUtils.d.ts +12 -0
  88. package/custom-elements.json +2406 -4134
  89. package/package.json +4 -4
  90. package/components/checkbox/demo/why-checkbox.html +0 -57
  91. package/components/checkbox/demo/why-checkbox.md +0 -86
  92. package/components/combobox/demo/why-combobox.html +0 -57
  93. package/components/combobox/demo/why-combobox.md +0 -113
  94. package/components/counter/demo/why-counter.html +0 -57
  95. package/components/counter/demo/why-counter.md +0 -108
  96. package/components/datepicker/demo/customize.js +0 -19
  97. package/components/datepicker/demo/customize.min.js +0 -26655
  98. package/components/datepicker/demo/why-datepicker.html +0 -57
  99. package/components/datepicker/demo/why-datepicker.md +0 -133
  100. package/components/dropdown/demo/why-dropdown.html +0 -57
  101. package/components/dropdown/demo/why-dropdown.md +0 -97
  102. package/components/form/demo/why-form.html +0 -57
  103. package/components/form/demo/why-form.md +0 -101
  104. package/components/input/demo/why-input.html +0 -57
  105. package/components/input/demo/why-input.md +0 -121
  106. package/components/menu/demo/why-menu.html +0 -57
  107. package/components/menu/demo/why-menu.md +0 -104
  108. package/components/menu/dist/auro-menu.context.d.ts +0 -238
  109. package/components/radio/demo/customize.min.js +0 -2186
  110. package/components/radio/demo/demo-support.min.js +0 -55807
  111. package/components/radio/demo/getting-started.min.js +0 -2205
  112. package/components/radio/demo/why-radio.html +0 -57
  113. package/components/radio/demo/why-radio.md +0 -92
  114. package/components/select/demo/why-select.html +0 -57
  115. package/components/select/demo/why-select.md +0 -128
@@ -1,121 +0,0 @@
1
- <auro-header level="1" id="overview">Why auro-input?</auro-header>
2
- <p>The native <code>&lt;input&gt;</code> element is the workhorse of HTML forms, but it has significant limitations in styling, validation messaging, input formatting, and accessibility. <code>auro-input</code> addresses these while remaining a drop-in upgrade for common input types.</p>
3
- <auro-header level="2" id="accessibility">Accessibility</auro-header>
4
- <p>Native inputs require manual <code>&lt;label&gt;</code> wiring, have no standard pattern for error announcements, and provide no built-in clear or show/hide password controls.</p>
5
- <p><code>auro-input</code> provides:</p>
6
- <ul>
7
- <li><strong>Automatic label binding</strong> — The label slot is automatically associated with the input. No <code>for</code>/<code>id</code> wiring required.</li>
8
- <li><strong>Dynamic label positioning</strong> — Labels float above the input when focused or populated, providing context without consuming space.</li>
9
- <li><strong>Clear button</strong> — An accessible clear button appears when the input has a value, with a customizable ARIA label via the <code>ariaLabel.clear</code> slot.</li>
10
- <li><strong>Password toggle</strong> — For <code>type="password"</code>, a show/hide toggle is built in with customizable ARIA labels for both states (<code>ariaLabel.password.show</code>, <code>ariaLabel.password.hide</code>).</li>
11
- <li><strong>Validation announcements</strong> — Error messages display in help text with appropriate ARIA roles so screen readers announce validity changes.</li>
12
- </ul>
13
- <auro-header level="2" id="inputMaskingAndFormatting">Input masking and formatting</auro-header>
14
- <p>Native inputs have no concept of input masks. Building formatted input (phone numbers, dates, credit card numbers) requires third-party libraries and manual integration.</p>
15
- <p><code>auro-input</code> includes IMask integration:</p>
16
- <ul>
17
- <li><strong>Format attribute</strong> — Set <code>format="(###) ###-####"</code> for phone numbers, <code>format="mm/dd/yyyy"</code> for dates, or any custom pattern.</li>
18
- <li><strong>Auto-formatting</strong> — Characters are formatted as the user types, with cursor position preserved.</li>
19
- <li><strong>Date formats</strong> — Supports <code>mm/dd/yyyy</code>, <code>dd/mm/yyyy</code>, <code>yyyy-mm-dd</code> with automatic conversion.</li>
20
- </ul>
21
- <auro-header level="2" id="creditCardDetection">Credit card detection</auro-header>
22
- <p>There is no native way to detect a credit card type from input, apply the correct formatting mask, or display the appropriate card icon.</p>
23
- <p><code>auro-input</code> with <code>type="credit-card"</code> provides:</p>
24
- <ul>
25
- <li><strong>Auto-detection</strong> — Identifies Visa, Mastercard, American Express, Discover, Diners Club, and Alaska Airlines cards from the first digits typed.</li>
26
- <li><strong>Dynamic formatting</strong> — Applies the correct digit grouping (e.g., 4-4-4-4 for Visa, 4-6-5 for Amex).</li>
27
- <li><strong>Card icon</strong> — Displays the detected card brand icon automatically.</li>
28
- <li><strong>Luhn validation</strong> — Validates the card number using the Luhn algorithm.</li>
29
- </ul>
30
- <auro-header level="2" id="validation">Validation</auro-header>
31
- <p>Native input validation provides <code>required</code>, <code>min</code>, <code>max</code>, <code>minlength</code>, <code>maxlength</code>, and <code>pattern</code>, but error messages are browser-controlled and cannot be customized.</p>
32
- <p><code>auro-input</code> provides:</p>
33
- <ul>
34
- <li>Custom error messages for every validity state: <code>setCustomValidityValueMissing</code>, <code>setCustomValidityRangeOverflow</code>, <code>setCustomValidityRangeUnderflow</code>, <code>setCustomValidityTooLong</code>, <code>setCustomValidityTooShort</code>, <code>setCustomValidityBadInput</code>, <code>setCustomValidityCustomError</code>, <code>setCustomValidityForType</code></li>
35
- <li>Type-specific validation (email format, credit card Luhn, phone format, date format)</li>
36
- <li>Validation timing control: on blur (default), on every input (<code>validateOnInput</code>), or disabled (<code>noValidate</code>)</li>
37
- <li>Programmatic vs. user input distinction — the component tracks whether a value change was user-initiated or programmatic</li>
38
- </ul>
39
- <auro-header level="2" id="displayValueMasking">Display value masking</auro-header>
40
- <p>Native inputs show the raw value at all times. There is no way to display a formatted or alternative representation when the input is not focused.</p>
41
- <p><code>auro-input</code> supports a <code>displayValue</code> slot that shows custom HTML when the input is blurred, hiding the raw value. This is useful for displaying formatted currency, masked account numbers, or rich content while keeping the underlying value clean for submission.</p>
42
- <auro-header level="2" id="layoutOptions">Layout options</auro-header>
43
- <p>Native inputs have a single visual presentation controlled by browser defaults.</p>
44
- <p><code>auro-input</code> offers:</p>
45
- <ul>
46
- <li><strong>Three layouts</strong> — Classic (floating label), emphasized (prominent label), and snowflake (custom positioning)</li>
47
- <li><strong>Shape variants</strong> — Box, pill, pill-left, pill-right for different visual contexts</li>
48
- <li><strong>Nested mode</strong> — Removes borders and hides help/error text for embedding inside other components</li>
49
- <li><strong>Simple mode</strong> — Borderless variant for inline use</li>
50
- </ul>
51
- <auro-header level="2" id="designSystemIntegration">Design system integration</auro-header>
52
- <p>Native input styling varies across browsers and requires extensive CSS resets to normalize.</p>
53
- <p><code>auro-input</code> is built with the Auro Design System:</p>
54
- <ul>
55
- <li>Consistent visual language across all browsers and platforms</li>
56
- <li>Light and dark theme support (<code>appearance</code>)</li>
57
- <li>CSS <code>::part()</code> selectors for granular styling (<code>wrapper</code>, <code>label</code>, <code>input</code>, <code>helpText</code>, <code>accentIcon</code>, <code>iconContainer</code>, <code>displayValue</code>)</li>
58
- <li>Design token integration for colors, spacing, and typography</li>
59
- </ul>
60
- <auro-header level="2" id="summary">Summary</auro-header>
61
- <table>
62
- <thead>
63
- <tr>
64
- <th>Capability</th>
65
- <th><code>&lt;input&gt;</code></th>
66
- <th><code>auro-input</code></th>
67
- </tr>
68
- </thead>
69
- <tbody>
70
- <tr>
71
- <td>Automatic label binding</td>
72
- <td>No (<code>for</code>/<code>id</code> required)</td>
73
- <td>Yes (slot-based)</td>
74
- </tr>
75
- <tr>
76
- <td>Input masking</td>
77
- <td>No</td>
78
- <td>Built-in (IMask)</td>
79
- </tr>
80
- <tr>
81
- <td>Credit card detection</td>
82
- <td>No</td>
83
- <td>Auto-detect with icon and formatting</td>
84
- </tr>
85
- <tr>
86
- <td>Custom validation messages</td>
87
- <td>Browser-controlled</td>
88
- <td>Per-constraint custom messages</td>
89
- </tr>
90
- <tr>
91
- <td>Clear button</td>
92
- <td>No</td>
93
- <td>Built-in with ARIA label</td>
94
- </tr>
95
- <tr>
96
- <td>Password show/hide</td>
97
- <td>No</td>
98
- <td>Built-in toggle</td>
99
- </tr>
100
- <tr>
101
- <td>Display value masking</td>
102
- <td>No</td>
103
- <td><code>displayValue</code> slot</td>
104
- </tr>
105
- <tr>
106
- <td>Multiple layouts</td>
107
- <td>No</td>
108
- <td>Classic, emphasized, snowflake</td>
109
- </tr>
110
- <tr>
111
- <td>Consistent cross-browser UI</td>
112
- <td>No</td>
113
- <td>Yes</td>
114
- </tr>
115
- <tr>
116
- <td>Theming</td>
117
- <td>Browser-dependent</td>
118
- <td>Full design system integration</td>
119
- </tr>
120
- </tbody>
121
- </table>
@@ -1,57 +0,0 @@
1
- <!--
2
- Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
3
- See LICENSE in the project root for license information.
4
-
5
- HTML in this document is standardized and NOT to be edited.
6
- All demo code should be added/edited in ./demo/why-menu.md
7
-
8
- With the exception of adding custom elements if needed for the demo.
9
-
10
- ----------------------- DO NOT EDIT -----------------------------
11
-
12
- -->
13
-
14
- <!DOCTYPE html>
15
- <html lang="en">
16
- <head>
17
- <meta charset="UTF-8" />
18
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
19
- <title>Auro Web Component Demo | auro-menu | Why auro-menu</title>
20
-
21
- <!-- highlight.js Stylesheet -->
22
- <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
23
-
24
- <!-- Legacy reference is still needed to support auro-menu's use of legacy token values at this time -->
25
- <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
26
-
27
- <!-- Design Token Alaska Theme -->
28
- <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
29
-
30
- <!-- Webcore Stylesheet Alaska Theme -->
31
- <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
32
-
33
- <!-- Demo Specific Styles -->
34
- <link rel="stylesheet" type="text/css" href="./styles.min.css" />
35
- <style>
36
- table {
37
- --ds-color-container-secondary-default: transparent;
38
- }
39
-
40
- tr:not(:last-of-type) {
41
- border-bottom: 1px solid var(--ds-color-border-tertiary-default);
42
- }
43
- </style>
44
- </head>
45
- <body class="auro-markdown">
46
- <main></main>
47
-
48
- <script type="module">
49
- import { renderPage } from './demo-support.min.js';
50
- await renderPage('./why-menu.md');
51
- </script>
52
-
53
- <!-- If additional elements are needed for the demo, add them here. -->
54
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
55
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
56
- </body>
57
- </html>
@@ -1,104 +0,0 @@
1
- <auro-header level="1" id="overview">Why auro-menu?</auro-header>
2
- <p>Native HTML has no dedicated menu component for selection lists. <code>&lt;select&gt;</code> only accepts <code>&lt;option&gt;</code> elements with plain text. Building a rich, accessible, keyboard-navigable menu with nested groups, loading states, and multi-select support requires significant custom work. <code>auro-menu</code> provides this as a composable primitive.</p>
3
- <auro-header level="2" id="accessibility">Accessibility</auro-header>
4
- <p>Custom list implementations often fail to provide correct ARIA semantics, keyboard navigation, or screen reader announcements.</p>
5
- <p><code>auro-menu</code> provides:</p>
6
- <ul>
7
- <li><strong>Keyboard navigation</strong> — Arrow keys move between options, Enter selects, Escape cancels, Home/End jump to the first and last options.</li>
8
- <li><strong>Active option tracking</strong> — The currently highlighted option is tracked programmatically, enabling <code>aria-activedescendant</code> patterns in parent components like <code>auro-select</code> and <code>auro-combobox</code>.</li>
9
- <li><strong>Multi-select semantics</strong> — When <code>multiSelect</code> is enabled, <code>aria-multiselectable</code> is set on the menu.</li>
10
- <li><strong>Loading state</strong> — <code>aria-busy</code> is set during loading, with customizable loading icon and text slots.</li>
11
- </ul>
12
- <auro-header level="2" id="richOptionContent">Rich option content</auro-header>
13
- <p><code>&lt;option&gt;</code> elements accept only plain text. There is no native way to add icons, descriptions, or nested structure to options.</p>
14
- <p><code>auro-menu</code> options support:</p>
15
- <ul>
16
- <li>Full HTML content in each option</li>
17
- <li>Icons alongside option text</li>
18
- <li>Nested submenus for hierarchical navigation</li>
19
- <li>Checkmark indicators for selected options (configurable via <code>noCheckmark</code>)</li>
20
- </ul>
21
- <auro-header level="2" id="multiselect">Multi-select</auro-header>
22
- <p>Native <code>&lt;select multiple&gt;</code> renders a fixed-height list box that is widely considered a poor user experience. There is no checkmark feedback, and the interaction model (Ctrl+click) is unintuitive.</p>
23
- <p><code>auro-menu</code> provides:</p>
24
- <ul>
25
- <li>Checkmark indicators for each selected option</li>
26
- <li>A <code>value</code> that returns a JSON-stringified array of selections</li>
27
- <li><code>allowDeselect</code> to toggle selections off</li>
28
- <li><code>selectAllMatchingOptions</code> for bulk selection operations</li>
29
- <li><code>clearSelection()</code> and <code>reset()</code> methods for programmatic control</li>
30
- </ul>
31
- <auro-header level="2" id="searchAndFiltering">Search and filtering</auro-header>
32
- <p>Native menus have no concept of filtering or highlighting matched text.</p>
33
- <p><code>auro-menu</code> supports:</p>
34
- <ul>
35
- <li><code>matchWord</code> to highlight matching portions of option text as the user types (used by <code>auro-combobox</code> for real-time filtering)</li>
36
- <li>Programmatic <code>navigateOptions(direction)</code> for keyboard-driven traversal</li>
37
- </ul>
38
- <auro-header level="2" id="loadingState">Loading state</auro-header>
39
- <p>Native selects have no loading pattern. When options are fetched asynchronously, there is no standard way to communicate this to the user.</p>
40
- <p><code>auro-menu</code> provides:</p>
41
- <ul>
42
- <li>A <code>loading</code> attribute that displays a loading indicator</li>
43
- <li><code>loadingIcon</code> and <code>loadingText</code> slots for custom loading UI</li>
44
- <li><code>auroMenu-loadingChange</code> event when the loading state changes</li>
45
- </ul>
46
- <auro-header level="2" id="composability">Composability</auro-header>
47
- <p><code>auro-menu</code> is designed as a building block. It is the selection engine inside:</p>
48
- <ul>
49
- <li><strong><code>auro-select</code></strong> — Dropdown selection</li>
50
- <li><strong><code>auro-combobox</code></strong> — Autocomplete with filtering</li>
51
- </ul>
52
- <p>This architecture means selection behavior, keyboard navigation, and ARIA semantics are consistent across all selection components.</p>
53
- <auro-header level="2" id="summary">Summary</auro-header>
54
- <table>
55
- <thead>
56
- <tr>
57
- <th>Capability</th>
58
- <th><code>&lt;select&gt;</code> / <code>&lt;option&gt;</code></th>
59
- <th><code>auro-menu</code></th>
60
- </tr>
61
- </thead>
62
- <tbody>
63
- <tr>
64
- <td>Rich HTML in options</td>
65
- <td>Plain text only</td>
66
- <td>Full HTML</td>
67
- </tr>
68
- <tr>
69
- <td>Nested submenus</td>
70
- <td>Not supported</td>
71
- <td>Built-in</td>
72
- </tr>
73
- <tr>
74
- <td>Multi-select with checkmarks</td>
75
- <td>Ctrl+click list box</td>
76
- <td>Checkmark toggle</td>
77
- </tr>
78
- <tr>
79
- <td>Search/filter highlighting</td>
80
- <td>No</td>
81
- <td><code>matchWord</code> attribute</td>
82
- </tr>
83
- <tr>
84
- <td>Loading state</td>
85
- <td>No</td>
86
- <td>Built-in with custom slots</td>
87
- </tr>
88
- <tr>
89
- <td>Keyboard navigation</td>
90
- <td>Browser-dependent</td>
91
- <td>Full arrow/Enter/Escape/Home/End</td>
92
- </tr>
93
- <tr>
94
- <td>Composable primitive</td>
95
- <td>No</td>
96
- <td>Foundation for select and combobox</td>
97
- </tr>
98
- <tr>
99
- <td>Deselect support</td>
100
- <td>No</td>
101
- <td><code>allowDeselect</code> attribute</td>
102
- </tr>
103
- </tbody>
104
- </table>
@@ -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>;