@aurodesignsystem/auro-formkit 2.0.0-beta.10 → 2.0.0-beta.11

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 (197) hide show
  1. package/.turbo/cache/0c8124a987c1cc05-meta.json +1 -1
  2. package/.turbo/cache/0cd512cdf86242c7-meta.json +1 -0
  3. package/.turbo/cache/{ff4dbfffc29255ab.tar.zst → 0cd512cdf86242c7.tar.zst} +0 -0
  4. package/.turbo/cache/123c83cd8727dff3-meta.json +1 -0
  5. package/.turbo/cache/123c83cd8727dff3.tar.zst +0 -0
  6. package/.turbo/cache/18129dba20f51b6b-meta.json +1 -1
  7. package/.turbo/cache/253e861af7025ed4-meta.json +1 -0
  8. package/.turbo/cache/253e861af7025ed4.tar.zst +0 -0
  9. package/.turbo/cache/2787020e69f50af2-meta.json +1 -1
  10. package/.turbo/cache/2a5295c8f561ed84-meta.json +1 -0
  11. package/.turbo/cache/2c0d681132c153dd-meta.json +1 -1
  12. package/.turbo/cache/4006a206400d5c7b-meta.json +1 -1
  13. package/.turbo/cache/492dda333b8d15f1-meta.json +1 -1
  14. package/.turbo/cache/4e3619d9dfc86809-meta.json +1 -0
  15. package/.turbo/cache/4e3619d9dfc86809.tar.zst +0 -0
  16. package/.turbo/cache/50993de942ec15a9-meta.json +1 -1
  17. package/.turbo/cache/50cd7dcfc9f820c5-meta.json +1 -0
  18. package/.turbo/cache/50cd7dcfc9f820c5.tar.zst +0 -0
  19. package/.turbo/cache/51eaa58d5c167de8-meta.json +1 -1
  20. package/.turbo/cache/5a0d3e26da304c62-meta.json +1 -0
  21. package/.turbo/cache/5a0d3e26da304c62.tar.zst +0 -0
  22. package/.turbo/cache/5c960af698582835-meta.json +1 -0
  23. package/.turbo/cache/5c960af698582835.tar.zst +0 -0
  24. package/.turbo/cache/5dbbb71dffc3f542-meta.json +1 -0
  25. package/.turbo/cache/5dbbb71dffc3f542.tar.zst +0 -0
  26. package/.turbo/cache/6081837e8943b62e-meta.json +1 -1
  27. package/.turbo/cache/60ad74320c682a2b-meta.json +1 -1
  28. package/.turbo/cache/61e218aba69cff58-meta.json +1 -1
  29. package/.turbo/cache/77da375a012de9d0-meta.json +1 -1
  30. package/.turbo/cache/7964d1656e9e702a-meta.json +1 -0
  31. package/.turbo/cache/7964d1656e9e702a.tar.zst +0 -0
  32. package/.turbo/cache/7bf2b06a479d0b30-meta.json +1 -1
  33. package/.turbo/cache/7c9ca6163e61285c-meta.json +1 -1
  34. package/.turbo/cache/80aca269cd346fb4-meta.json +1 -0
  35. package/.turbo/cache/80aca269cd346fb4.tar.zst +0 -0
  36. package/.turbo/cache/8602fc2bb737a5cf-meta.json +1 -0
  37. package/.turbo/cache/89e0e7a6148e854f-meta.json +1 -0
  38. package/.turbo/cache/89e0e7a6148e854f.tar.zst +0 -0
  39. package/.turbo/cache/8bb856bd31b5b479-meta.json +1 -1
  40. package/.turbo/cache/93c887fb93a10daa-meta.json +1 -0
  41. package/.turbo/cache/93c887fb93a10daa.tar.zst +0 -0
  42. package/.turbo/cache/94dae2a64e9d8356-meta.json +1 -0
  43. package/.turbo/cache/97f6fe83b54acf09-meta.json +1 -0
  44. package/.turbo/cache/{080ca6155e637d5d.tar.zst → 97f6fe83b54acf09.tar.zst} +0 -0
  45. package/.turbo/cache/98317b0d14d94df7-meta.json +1 -0
  46. package/.turbo/cache/98317b0d14d94df7.tar.zst +0 -0
  47. package/.turbo/cache/9ae99e8e7bd83d06-meta.json +1 -1
  48. package/.turbo/cache/9cbcd13b1d031f63-meta.json +1 -0
  49. package/.turbo/cache/{8af27c076dc010c3.tar.zst → 9cbcd13b1d031f63.tar.zst} +0 -0
  50. package/.turbo/cache/afbbd49ed1a558b9-meta.json +1 -0
  51. package/.turbo/cache/b353ce8f6da43dea-meta.json +1 -0
  52. package/.turbo/cache/b5e6dc7fb9ae1a2f-meta.json +1 -1
  53. package/.turbo/cache/b6a202cc85cb61a0-meta.json +1 -1
  54. package/.turbo/cache/b8db059a9b9ccb5d-meta.json +1 -0
  55. package/.turbo/cache/bc24a38aa1b1a102-meta.json +1 -0
  56. package/.turbo/cache/be0b95293ea517cc-meta.json +1 -1
  57. package/.turbo/cache/c3a4f7a3565d6706-meta.json +1 -0
  58. package/.turbo/cache/c3a4f7a3565d6706.tar.zst +0 -0
  59. package/.turbo/cache/c44efc9e4ddd8a0e-meta.json +1 -1
  60. package/.turbo/cache/c6c6411199b68170-meta.json +1 -1
  61. package/.turbo/cache/c97b043e748e3580-meta.json +1 -0
  62. package/.turbo/cache/d5db503b2eaf239c-meta.json +1 -1
  63. package/.turbo/cache/d775555355d6b8fc-meta.json +1 -1
  64. package/.turbo/cache/d7c3007be148d2a1-meta.json +1 -1
  65. package/.turbo/cache/dad3d78b33edd9e4-meta.json +1 -1
  66. package/.turbo/cache/dc597b3ea4f61ec8-meta.json +1 -0
  67. package/.turbo/cache/dc597b3ea4f61ec8.tar.zst +0 -0
  68. package/.turbo/cache/df40b180126e5351-meta.json +1 -0
  69. package/.turbo/cache/df40b180126e5351.tar.zst +0 -0
  70. package/.turbo/cache/e5f217f77c32c93b-meta.json +1 -0
  71. package/.turbo/cache/{c2b51643f886a493.tar.zst → e5f217f77c32c93b.tar.zst} +0 -0
  72. package/.turbo/cache/e62cfee068e3ef36-meta.json +1 -1
  73. package/.turbo/cache/e9e36823f6c98f07-meta.json +1 -1
  74. package/.turbo/cache/ee1a3c1fe389da51-meta.json +1 -0
  75. package/.turbo/cache/f3c7b40f2c6a4094-meta.json +1 -0
  76. package/.turbo/cache/{b22ca87b2f7f9cc2.tar.zst → f3c7b40f2c6a4094.tar.zst} +0 -0
  77. package/.turbo/cache/f5958c3acb889631-meta.json +1 -0
  78. package/.turbo/cache/fb3809ac3f90e3b2-meta.json +1 -0
  79. package/.turbo/cache/{eb1dbe885532c1dc.tar.zst → fb3809ac3f90e3b2.tar.zst} +0 -0
  80. package/.turbo/cache/fd5ddfa43ebd8e5c-meta.json +1 -0
  81. package/.turbo/cache/fd5ddfa43ebd8e5c.tar.zst +0 -0
  82. package/CHANGELOG.md +13 -0
  83. package/components/checkbox/.turbo/turbo-build.log +3 -3
  84. package/components/checkbox/.turbo/turbo-bundler.log +3 -3
  85. package/components/checkbox/README.md +1 -1
  86. package/components/combobox/.turbo/turbo-build.log +3 -3
  87. package/components/combobox/README.md +4 -4
  88. package/components/combobox/demo/api.md +9 -9
  89. package/components/combobox/demo/api.min.js +2508 -642
  90. package/components/combobox/demo/index.min.js +2505 -639
  91. package/components/combobox/dist/auro-combobox.d.ts +9 -4
  92. package/components/combobox/dist/auro-combobox.d.ts.map +1 -1
  93. package/components/combobox/dist/index.js +1863 -312
  94. package/components/combobox/src/auro-combobox.js +70 -26
  95. package/components/counter/.turbo/turbo-build.log +3 -3
  96. package/components/counter/.turbo/turbo-bundler.log +3 -3
  97. package/components/counter/README.md +1 -1
  98. package/components/datepicker/.turbo/turbo-build.log +3 -3
  99. package/components/datepicker/README.md +4 -4
  100. package/components/dropdown/.turbo/turbo-build.log +3 -3
  101. package/components/dropdown/.turbo/turbo-bundler.log +2 -2
  102. package/components/dropdown/README.md +1 -1
  103. package/components/form/.turbo/turbo-build.log +3 -3
  104. package/components/form/.turbo/turbo-bundler.log +3 -3
  105. package/components/form/README.md +1 -1
  106. package/components/input/.turbo/turbo-build.log +3 -3
  107. package/components/input/.turbo/turbo-bundler.log +3 -3
  108. package/components/input/README.md +1 -1
  109. package/components/menu/.turbo/turbo-build.log +4 -2
  110. package/components/menu/.turbo/turbo-bundler.log +3 -3
  111. package/components/menu/README.md +1 -1
  112. package/components/menu/demo/api.md +57 -20
  113. package/components/menu/demo/api.min.js +620 -305
  114. package/components/menu/demo/index.min.js +618 -303
  115. package/components/menu/dist/auro-menu-utils.d.ts +43 -0
  116. package/components/menu/dist/auro-menu-utils.d.ts.map +1 -0
  117. package/components/menu/dist/auro-menu.d.ts +97 -81
  118. package/components/menu/dist/auro-menu.d.ts.map +1 -1
  119. package/components/menu/dist/index.d.ts +1 -0
  120. package/components/menu/dist/index.js +619 -304
  121. package/components/menu/src/auro-menu-utils.js +131 -0
  122. package/components/menu/src/auro-menu.js +493 -303
  123. package/components/menu/src/index.js +7 -0
  124. package/components/radio/.turbo/turbo-build.log +3 -3
  125. package/components/radio/.turbo/turbo-bundler.log +3 -3
  126. package/components/radio/README.md +1 -1
  127. package/components/select/.turbo/turbo-build.log +5 -3
  128. package/components/select/README.md +3 -3
  129. package/components/select/demo/api.md +46 -11
  130. package/components/select/demo/api.min.js +2336 -485
  131. package/components/select/demo/index.min.js +2337 -486
  132. package/components/select/dist/auro-select.d.ts +17 -6
  133. package/components/select/dist/auro-select.d.ts.map +1 -1
  134. package/components/select/dist/index.js +1706 -170
  135. package/components/select/src/auro-select.js +53 -24
  136. package/components/select/src/styles/style-css.js +1 -1
  137. package/components/select/src/styles/style.css +7 -0
  138. package/components/select/src/styles/style.scss +13 -0
  139. package/package.json +1 -1
  140. package/.turbo/cache/026e4d886ba97e63-meta.json +0 -1
  141. package/.turbo/cache/026e4d886ba97e63.tar.zst +0 -0
  142. package/.turbo/cache/080ca6155e637d5d-meta.json +0 -1
  143. package/.turbo/cache/0b115e30ff606299-meta.json +0 -1
  144. package/.turbo/cache/0b115e30ff606299.tar.zst +0 -0
  145. package/.turbo/cache/1c630fb3411e4a41-meta.json +0 -1
  146. package/.turbo/cache/24b19ac5895e5dd6-meta.json +0 -1
  147. package/.turbo/cache/24b19ac5895e5dd6.tar.zst +0 -0
  148. package/.turbo/cache/29b72c73cbccb53d-meta.json +0 -1
  149. package/.turbo/cache/29b72c73cbccb53d.tar.zst +0 -0
  150. package/.turbo/cache/3e647c5863d32e6f-meta.json +0 -1
  151. package/.turbo/cache/3e647c5863d32e6f.tar.zst +0 -0
  152. package/.turbo/cache/43f5206cc4e69b44-meta.json +0 -1
  153. package/.turbo/cache/4a85ec226b585fd5-meta.json +0 -1
  154. package/.turbo/cache/50a29c70b93c57dd-meta.json +0 -1
  155. package/.turbo/cache/50a29c70b93c57dd.tar.zst +0 -0
  156. package/.turbo/cache/56455145cd768755-meta.json +0 -1
  157. package/.turbo/cache/56455145cd768755.tar.zst +0 -0
  158. package/.turbo/cache/5c06332cf9f132da-meta.json +0 -1
  159. package/.turbo/cache/5e613afc6868d0e2-meta.json +0 -1
  160. package/.turbo/cache/5e613afc6868d0e2.tar.zst +0 -0
  161. package/.turbo/cache/639dac15b979bedc-meta.json +0 -1
  162. package/.turbo/cache/664c2e08614fd212-meta.json +0 -1
  163. package/.turbo/cache/6c51b0ebfc086faa-meta.json +0 -1
  164. package/.turbo/cache/6c51b0ebfc086faa.tar.zst +0 -0
  165. package/.turbo/cache/7216d994164825fb-meta.json +0 -1
  166. package/.turbo/cache/7216d994164825fb.tar.zst +0 -0
  167. package/.turbo/cache/83a167e135cb431a-meta.json +0 -1
  168. package/.turbo/cache/83a167e135cb431a.tar.zst +0 -0
  169. package/.turbo/cache/8af27c076dc010c3-meta.json +0 -1
  170. package/.turbo/cache/953c8216249d3509-meta.json +0 -1
  171. package/.turbo/cache/95a5e76ffd8c5110-meta.json +0 -1
  172. package/.turbo/cache/95a5e76ffd8c5110.tar.zst +0 -0
  173. package/.turbo/cache/a8b0fa0a9aa707c5-meta.json +0 -1
  174. package/.turbo/cache/a8b0fa0a9aa707c5.tar.zst +0 -0
  175. package/.turbo/cache/b22ca87b2f7f9cc2-meta.json +0 -1
  176. package/.turbo/cache/b7bbe2e7d44b77f0-meta.json +0 -1
  177. package/.turbo/cache/b7bbe2e7d44b77f0.tar.zst +0 -0
  178. package/.turbo/cache/c2b51643f886a493-meta.json +0 -1
  179. package/.turbo/cache/c74d369a0475b124-meta.json +0 -1
  180. package/.turbo/cache/c7f5a276ddb73cf7-meta.json +0 -1
  181. package/.turbo/cache/c96933d40404e4c8-meta.json +0 -1
  182. package/.turbo/cache/c96933d40404e4c8.tar.zst +0 -0
  183. package/.turbo/cache/eb1dbe885532c1dc-meta.json +0 -1
  184. package/.turbo/cache/f1f6744948f1b18f-meta.json +0 -1
  185. package/.turbo/cache/f1f6744948f1b18f.tar.zst +0 -0
  186. package/.turbo/cache/feefbc25d550c1cd-meta.json +0 -1
  187. package/.turbo/cache/ff4dbfffc29255ab-meta.json +0 -1
  188. /package/.turbo/cache/{639dac15b979bedc.tar.zst → 2a5295c8f561ed84.tar.zst} +0 -0
  189. /package/.turbo/cache/{1c630fb3411e4a41.tar.zst → 8602fc2bb737a5cf.tar.zst} +0 -0
  190. /package/.turbo/cache/{664c2e08614fd212.tar.zst → 94dae2a64e9d8356.tar.zst} +0 -0
  191. /package/.turbo/cache/{c7f5a276ddb73cf7.tar.zst → afbbd49ed1a558b9.tar.zst} +0 -0
  192. /package/.turbo/cache/{43f5206cc4e69b44.tar.zst → b353ce8f6da43dea.tar.zst} +0 -0
  193. /package/.turbo/cache/{c74d369a0475b124.tar.zst → b8db059a9b9ccb5d.tar.zst} +0 -0
  194. /package/.turbo/cache/{4a85ec226b585fd5.tar.zst → bc24a38aa1b1a102.tar.zst} +0 -0
  195. /package/.turbo/cache/{5c06332cf9f132da.tar.zst → c97b043e748e3580.tar.zst} +0 -0
  196. /package/.turbo/cache/{953c8216249d3509.tar.zst → ee1a3c1fe389da51.tar.zst} +0 -0
  197. /package/.turbo/cache/{feefbc25d550c1cd.tar.zst → f5958c3acb889631.tar.zst} +0 -0
@@ -0,0 +1,131 @@
1
+ // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
2
+ // See LICENSE in the project root for license information.
3
+
4
+ // ---------------------------------------------------------------------
5
+
6
+ /**
7
+ * Converts value to an array.
8
+ * If the value is a JSON string representing an array, it will be parsed.
9
+ * If the value is already an array, it is returned.
10
+ * If the value is undefined, it returns undefined.
11
+ * @private
12
+ * @param {any} value - The value to be converted. Can be a string, array, or undefined.
13
+ * @returns {Array|undefined} - The converted array or undefined.
14
+ * @throws {Error} - Throws an error if the value is not an array, undefined,
15
+ * or if the value cannot be parsed into an array from a JSON string.
16
+ */
17
+ export function arrayConverter(value) {
18
+ // Allow undefined
19
+ if (value === undefined) {
20
+ return undefined;
21
+ }
22
+
23
+ // Return the value if it is already an array
24
+ if (Array.isArray(value)) {
25
+ return value;
26
+ }
27
+
28
+ try {
29
+ // If value is a JSON string, parse it
30
+ const parsed = typeof value === 'string' ? JSON.parse(value) : value;
31
+
32
+ // Check if the parsed value is an array
33
+ if (Array.isArray(parsed)) {
34
+ return parsed;
35
+ }
36
+ } catch (error) {
37
+ // If JSON parsing fails, continue to throw an error below
38
+ /* eslint-disable no-console */
39
+ console.error('JSON parsing failed:', error);
40
+ }
41
+
42
+ // Throw error if the input is not an array or undefined
43
+ throw new Error('Invalid value: Input must be an array or undefined');
44
+ }
45
+
46
+ /**
47
+ * Compare two arrays for equality.
48
+ * @private
49
+ * @param {Array} arr1 - First array to compare.
50
+ * @param {Array} arr2 - Second array to compare.
51
+ * @returns {boolean} True if arrays are equal.
52
+ */
53
+ export function arraysAreEqual(arr1, arr2) {
54
+ // If both arrays undefined, they are equal (true)
55
+ if (arr1 === undefined || arr2 === undefined) {
56
+ return arr1 === arr2;
57
+ }
58
+
59
+ // If arrays have different lengths, they are not equal
60
+ if (arr1.length !== arr2.length) {
61
+ return false;
62
+ }
63
+
64
+ // If every item at each index is the same, return true
65
+ for (let index = 0; index < arr1.length; index += 1) {
66
+ if (arr1[index] !== arr2[index]) {
67
+ return false;
68
+ }
69
+ }
70
+ return true;
71
+ }
72
+
73
+ /**
74
+ * Compares array for changes.
75
+ * @private
76
+ * @param {Array|any} newVal - New value to compare.
77
+ * @param {Array|any} oldVal - Old value to compare.
78
+ * @returns {boolean} True if arrays have changed.
79
+ */
80
+ export function arrayOrUndefinedHasChanged(newVal, oldVal) {
81
+ try {
82
+ // Check if values are undefined or arrays
83
+ const isArrayOrUndefined = (val) => val === undefined || Array.isArray(val);
84
+
85
+ // If non-array or non-undefined, throw error
86
+ if (!isArrayOrUndefined(newVal) || !isArrayOrUndefined(oldVal)) {
87
+ const invalidValue = isArrayOrUndefined(newVal) ? oldVal : newVal;
88
+ throw new Error(`Value must be an array or undefined, received ${typeof invalidValue}`);
89
+ }
90
+
91
+ // Return true if arrays have changed, false if they are the same
92
+ return !arraysAreEqual(newVal, oldVal);
93
+ } catch (error) {
94
+ /* eslint-disable no-console */
95
+ console.error(error);
96
+ // If validation fails, it has changed
97
+ return true;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Validates if an option can be interacted with.
103
+ * @private
104
+ * @param {HTMLElement} option - The option to check.
105
+ * @returns {boolean} True if option is interactive.
106
+ */
107
+ export function isOptionInteractive(option) {
108
+ return !option.hasAttribute('hidden') &&
109
+ !option.hasAttribute('disabled') &&
110
+ !option.hasAttribute('static');
111
+ }
112
+
113
+ /**
114
+ * Helper method to dispatch custom events.
115
+ * @param {HTMLElement} element - Element to dispatch event from.
116
+ * @param {string} eventName - Name of the event to dispatch.
117
+ * @param {Object} [detail] - Optional detail object to include with the event.
118
+ */
119
+ export function dispatchMenuEvent(element, eventName, detail = null) {
120
+ const eventConfig = {
121
+ bubbles: true,
122
+ cancelable: false,
123
+ composed: true
124
+ };
125
+
126
+ if (detail !== null) {
127
+ eventConfig.detail = detail;
128
+ }
129
+
130
+ element.dispatchEvent(new CustomEvent(eventName, eventConfig));
131
+ }