@aurodesignsystem-dev/auro-formkit 0.0.0-pr1498.0 → 0.0.0-pr1499.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 (62) hide show
  1. package/components/checkbox/demo/customize.min.js +2 -2
  2. package/components/checkbox/demo/getting-started.min.js +2 -2
  3. package/components/checkbox/demo/index.min.js +2 -2
  4. package/components/checkbox/dist/index.js +2 -2
  5. package/components/checkbox/dist/registered.js +2 -2
  6. package/components/combobox/demo/customize.md +3 -7
  7. package/components/combobox/demo/customize.min.js +1705 -1459
  8. package/components/combobox/demo/getting-started.min.js +1705 -1459
  9. package/components/combobox/demo/index.min.js +1705 -1459
  10. package/components/combobox/dist/auro-combobox.d.ts +0 -5
  11. package/components/combobox/dist/index.js +162 -491
  12. package/components/combobox/dist/registered.js +162 -491
  13. package/components/counter/demo/customize.min.js +19 -18
  14. package/components/counter/demo/index.min.js +19 -18
  15. package/components/counter/dist/index.js +187 -5442
  16. package/components/counter/dist/registered.js +187 -5442
  17. package/components/datepicker/demo/customize.md +477 -384
  18. package/components/datepicker/demo/customize.min.js +96 -161
  19. package/components/datepicker/demo/index.md +0 -1
  20. package/components/datepicker/demo/index.min.js +96 -161
  21. package/components/datepicker/dist/index.js +96 -161
  22. package/components/datepicker/dist/registered.js +96 -161
  23. package/components/datepicker/dist/src/auro-datepicker.d.ts +2 -2
  24. package/components/dropdown/demo/customize.min.js +17 -16
  25. package/components/dropdown/demo/getting-started.min.js +17 -16
  26. package/components/dropdown/demo/index.min.js +17 -16
  27. package/components/dropdown/dist/auro-dropdown.d.ts +2 -1
  28. package/components/dropdown/dist/index.js +17 -16
  29. package/components/dropdown/dist/registered.js +17 -16
  30. package/components/form/demo/customize.min.js +7965 -7884
  31. package/components/form/demo/getting-started.min.js +7965 -7884
  32. package/components/form/demo/index.min.js +7965 -7884
  33. package/components/form/demo/registerDemoDeps.min.js +7934 -7853
  34. package/components/input/demo/customize.md +539 -472
  35. package/components/input/demo/customize.min.js +61 -132
  36. package/components/input/demo/getting-started.min.js +61 -132
  37. package/components/input/demo/index.min.js +61 -132
  38. package/components/input/dist/base-input.d.ts +0 -16
  39. package/components/input/dist/index.js +61 -132
  40. package/components/input/dist/registered.js +61 -132
  41. package/components/menu/demo/api.md +45 -41
  42. package/components/menu/demo/customize.md +28 -0
  43. package/components/menu/demo/index.min.js +1358 -783
  44. package/components/menu/dist/auro-menu.context.d.ts +238 -0
  45. package/components/menu/dist/auro-menu.d.ts +110 -95
  46. package/components/menu/dist/auro-menuoption.d.ts +138 -32
  47. package/components/menu/dist/index.js +1312 -757
  48. package/components/menu/dist/registered.js +1312 -769
  49. package/components/radio/demo/customize.min.js +2 -2
  50. package/components/radio/demo/getting-started.min.js +2 -2
  51. package/components/radio/demo/index.min.js +2 -2
  52. package/components/radio/dist/index.js +2 -2
  53. package/components/radio/dist/registered.js +2 -2
  54. package/components/select/demo/customize.md +3 -7
  55. package/components/select/demo/customize.min.js +1634 -1089
  56. package/components/select/demo/getting-started.min.js +1634 -1089
  57. package/components/select/demo/index.min.js +1634 -1089
  58. package/components/select/dist/index.js +31 -61
  59. package/components/select/dist/registered.js +31 -61
  60. package/custom-elements.json +2085 -1439
  61. package/package.json +1 -1
  62. package/components/select/dist/selectUtils.d.ts +0 -12
@@ -5,62 +5,103 @@
5
5
  * @slot default - The default slot for the menu option text.
6
6
  *
7
7
  * @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
8
- * @event auroMenuOption-click - Notifies that this option has been clicked.
9
8
  */
10
9
  export class AuroMenuOption extends AuroElement {
10
+ /**
11
+ * This will register this element with the browser.
12
+ * @param {string} [name="auro-menuoption"] - The name of the element that you want to register.
13
+ *
14
+ * @example
15
+ * AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
16
+ *
17
+ */
18
+ static register(name?: string): void;
11
19
  static get properties(): {
12
- noCheckmark: {
20
+ /**
21
+ * When true, disables the menu option.
22
+ */
23
+ disabled: {
13
24
  type: BooleanConstructor;
14
25
  reflect: boolean;
15
26
  };
16
- selected: {
17
- type: BooleanConstructor;
27
+ /**
28
+ * @private
29
+ */
30
+ event: {
31
+ type: StringConstructor;
18
32
  reflect: boolean;
19
33
  };
20
- disabled: {
21
- type: BooleanConstructor;
22
- reflect: boolean;
34
+ /**
35
+ * @private
36
+ */
37
+ layout: {
38
+ type: StringConstructor;
23
39
  };
24
- value: {
40
+ /**
41
+ * Allows users to set a unique key for the menu option for specified option selection. If no key is provided, the value property will be used.
42
+ */
43
+ key: {
25
44
  type: StringConstructor;
26
45
  reflect: boolean;
27
46
  };
28
- tabIndex: {
29
- type: NumberConstructor;
30
- reflect: boolean;
47
+ /**
48
+ * @private
49
+ */
50
+ menuService: {
51
+ type: ObjectConstructor;
52
+ state: boolean;
31
53
  };
32
54
  /**
33
55
  * @private
34
56
  */
35
- event: {
57
+ matchWord: {
36
58
  type: StringConstructor;
59
+ state: boolean;
60
+ };
61
+ /**
62
+ * @private
63
+ */
64
+ noCheckmark: {
65
+ type: BooleanConstructor;
37
66
  reflect: boolean;
38
67
  };
39
68
  /**
40
- * When true, marks this option as the "no matching results" placeholder shown by combobox
41
- * when the user's input does not match any available options.
69
+ * When true, marks this option as the "no matching results" placeholder shown by combobox when the user's input does not match any available options. Enables distinct styling and prevents the option from being treated as a selectable match.
42
70
  */
43
71
  noMatch: {
44
72
  type: BooleanConstructor;
45
73
  reflect: boolean;
46
74
  attribute: string;
47
75
  };
48
- layout: {
76
+ /**
77
+ * Specifies that an option is selected.
78
+ */
79
+ selected: {
80
+ type: BooleanConstructor;
81
+ reflect: boolean;
82
+ };
83
+ /**
84
+ * Specifies the tab index of the menu option.
85
+ */
86
+ tabIndex: {
87
+ type: NumberConstructor;
88
+ reflect: boolean;
89
+ };
90
+ /**
91
+ * Specifies the value to be sent to a server.
92
+ */
93
+ value: {
49
94
  type: StringConstructor;
50
- attribute: string;
51
95
  reflect: boolean;
52
96
  };
53
97
  };
54
98
  static get styles(): import("lit").CSSResult[];
55
99
  /**
56
- * This will register this element with the browser.
57
- * @param {string} [name="auro-menuoption"] - The name of element that you want to register to.
58
- *
59
- * @example
60
- * AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
61
- *
100
+ * Returns whether the menu option is currently active and selectable.
101
+ * An option is considered active if it is not hidden, not disabled, and not static.
102
+ * @returns {boolean} True if the option is active, false otherwise.
62
103
  */
63
- static register(name?: string): void;
104
+ get isActive(): boolean;
64
105
  /**
65
106
  * @private
66
107
  */
@@ -78,23 +119,87 @@ export class AuroMenuOption extends AuroElement {
78
119
  * @private
79
120
  */
80
121
  private runtimeUtils;
122
+ menuService: Object | null;
123
+ unsubscribe: any;
81
124
  /**
82
- * Returns whether the menu option is currently active and selectable.
83
- * @returns {boolean}
125
+ * Handles changes from the menu service and updates the option's state.
126
+ * This function synchronizes the option's properties and selection/highlight state with menu events.
127
+ * @param {Object} event - The event object from the menu service.
84
128
  */
85
- get isActive(): boolean;
129
+ handleMenuChange(event: Object): void;
130
+ _contextConsumer: ContextConsumer<import("@lit/context").Context<"menu-context", any>, this> | undefined;
131
+ key: any;
86
132
  firstUpdated(): void;
87
133
  updated(changedProperties: any): void;
88
- handleMenuChange(): void;
89
- setSelected(value: any): void;
90
- updateActive(active: any): void;
91
- active: any;
92
- attachTo(): void;
93
134
  /**
94
- * Handles click events on the menu option.
135
+ * Sets up event listeners for user interaction with the menu option.
136
+ * This function enables click and mouse enter events to trigger selection and highlighting logic.
137
+ */
138
+ bindEvents(): void;
139
+ /**
140
+ * Attaches this menu option to a menu service and subscribes to its events.
141
+ * This method enables the option to participate in menu selection and highlighting logic.
142
+ * @param {Object} service - The menu service instance to attach to.
143
+ */
144
+ attachTo(service: Object): void;
145
+ active: boolean | undefined;
146
+ /**
147
+ * Updates the internal selected state of the menu option bypassing 'updated' and triggers custom events if selected.
148
+ * This function ensures the option's selection state is synchronized with menu logic and notifies listeners.
149
+ * @param {boolean} isSelected - Whether the option should be marked as selected.
150
+ */
151
+ setInternalSelected(isSelected: boolean): void;
152
+ internalUpdateInProgress: boolean | undefined;
153
+ /**
154
+ * Sets the selected state of the menu option.
155
+ * This function updates whether the option is currently selected.
156
+ * @param {boolean} isSelected - Whether the option should be marked as selected.
157
+ * @deprecated Simply modify the `selected` property directly instead.
158
+ */
159
+ setSelected(isSelected: boolean): void;
160
+ /**
161
+ * Updates the active state and visual highlighting of the menu option.
162
+ * This function toggles the option's active status and applies or removes the active CSS class.
163
+ * @param {boolean} isActive - Whether the option should be marked as active.
164
+ * @deprecated Simply modify the `active` property directly instead.
165
+ */
166
+ updateActive(isActive: boolean): void;
167
+ /**
168
+ * Updates the CSS class for the menu option based on its active state.
169
+ * This function adds or removes the 'active' class to visually indicate the option's active status.
170
+ * @private
171
+ */
172
+ private updateActiveClasses;
173
+ /**
174
+ * Updates the visual highlighting of text within the menu option based on the current match word.
175
+ * This function highlights matching text segments and manages nested spacers for display formatting.
176
+ * @private
177
+ */
178
+ private updateTextHighlight;
179
+ /**
180
+ * Handles click events on the menu option, toggling its selected state.
181
+ * This function dispatches a click event and updates selection if the option is not disabled.
95
182
  * @private
96
183
  */
97
184
  private handleClick;
185
+ /**
186
+ * Handles mouse enter events to highlight the menu option.
187
+ * This function updates the menu service to set this option as the currently highlighted item if not disabled.
188
+ * @private
189
+ */
190
+ private handleMouseEnter;
191
+ /**
192
+ * Dispatches custom events defined for this menu option.
193
+ * This function notifies listeners when a custom event is triggered by the option.
194
+ * @private
195
+ */
196
+ private handleCustomEvent;
197
+ /**
198
+ * Dispatches a click event for this menu option.
199
+ * This function notifies listeners that the option has been clicked.
200
+ * @private
201
+ */
202
+ private dispatchClickEvent;
98
203
  /**
99
204
  * Generates an HTML element containing an SVG icon based on the provided `svgContent`.
100
205
  *
@@ -111,3 +216,4 @@ export class AuroMenuOption extends AuroElement {
111
216
  protected renderLayout(): void;
112
217
  }
113
218
  import { AuroElement } from "../../layoutElement/src/auroElement.js";
219
+ import { ContextConsumer } from '@lit/context';