@aurodesignsystem/auro-formkit 2.0.0-beta.31 → 2.0.0-beta.33

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 (155) hide show
  1. package/.turbo/cache/02882630667e46f8-meta.json +1 -0
  2. package/.turbo/cache/02882630667e46f8.tar.zst +0 -0
  3. package/.turbo/cache/0899fc2ef909db30-meta.json +1 -0
  4. package/.turbo/cache/0899fc2ef909db30.tar.zst +0 -0
  5. package/.turbo/cache/1d4280429ff4222f-meta.json +1 -1
  6. package/.turbo/cache/1e094164b4932553-meta.json +1 -1
  7. package/.turbo/cache/1e3f844e58a3d4f2-meta.json +1 -0
  8. package/.turbo/cache/{cdb0e45299352fce.tar.zst → 1e3f844e58a3d4f2.tar.zst} +0 -0
  9. package/.turbo/cache/251ba344c6338ba3-meta.json +1 -1
  10. package/.turbo/cache/28fe2121c9ba81e2-meta.json +1 -0
  11. package/.turbo/cache/28fe2121c9ba81e2.tar.zst +0 -0
  12. package/.turbo/cache/298b6ff0272e6226-meta.json +1 -1
  13. package/.turbo/cache/2abb5400a01a1694-meta.json +1 -1
  14. package/.turbo/cache/30fda91ef83677e4-meta.json +1 -1
  15. package/.turbo/cache/317b33937a355f80-meta.json +1 -0
  16. package/.turbo/cache/317b33937a355f80.tar.zst +0 -0
  17. package/.turbo/cache/3221d91a94756c26-meta.json +1 -1
  18. package/.turbo/cache/3ab09fe7cf32b3bf-meta.json +1 -1
  19. package/.turbo/cache/3c795c4f80600a07-meta.json +1 -0
  20. package/.turbo/cache/3c795c4f80600a07.tar.zst +0 -0
  21. package/.turbo/cache/3f1b3db13386acdc-meta.json +1 -1
  22. package/.turbo/cache/430c124614841675-meta.json +1 -1
  23. package/.turbo/cache/45bdeb0396723b25-meta.json +1 -1
  24. package/.turbo/cache/4e8248fc9e1e3e8f-meta.json +1 -1
  25. package/.turbo/cache/4e8248fc9e1e3e8f.tar.zst +0 -0
  26. package/.turbo/cache/4e9c9a5dd62c50a4-meta.json +1 -1
  27. package/.turbo/cache/5326b73ddda05291-meta.json +1 -1
  28. package/.turbo/cache/5fc9a7a072827b7b-meta.json +1 -1
  29. package/.turbo/cache/62214e9883afcc4d-meta.json +1 -1
  30. package/.turbo/cache/6e0b3da6e3ff3718-meta.json +1 -1
  31. package/.turbo/cache/721262daa6b8164a-meta.json +1 -0
  32. package/.turbo/cache/721262daa6b8164a.tar.zst +0 -0
  33. package/.turbo/cache/753b119a389426be-meta.json +1 -1
  34. package/.turbo/cache/7593109ea54e7505-meta.json +1 -0
  35. package/.turbo/cache/7629bef0037115af-meta.json +1 -0
  36. package/.turbo/cache/76667a5d27a45c7a-meta.json +1 -0
  37. package/.turbo/cache/{c13e85d809af02f6.tar.zst → 76667a5d27a45c7a.tar.zst} +0 -0
  38. package/.turbo/cache/785960dbbde053b6-meta.json +1 -0
  39. package/.turbo/cache/785960dbbde053b6.tar.zst +0 -0
  40. package/.turbo/cache/92b4b6ba93458685-meta.json +1 -1
  41. package/.turbo/cache/9c15f2276d1905d6-meta.json +1 -0
  42. package/.turbo/cache/9c15f2276d1905d6.tar.zst +0 -0
  43. package/.turbo/cache/a263932c5b42ec4f-meta.json +1 -0
  44. package/.turbo/cache/{4f81392ada08f240.tar.zst → a263932c5b42ec4f.tar.zst} +0 -0
  45. package/.turbo/cache/b10915c26145587e-meta.json +1 -0
  46. package/.turbo/cache/b10915c26145587e.tar.zst +0 -0
  47. package/.turbo/cache/b169402fda42f218-meta.json +1 -1
  48. package/.turbo/cache/b169402fda42f218.tar.zst +0 -0
  49. package/.turbo/cache/b32a99cd28bc1388-meta.json +1 -0
  50. package/.turbo/cache/b32a99cd28bc1388.tar.zst +0 -0
  51. package/.turbo/cache/bed01678759af66e-meta.json +1 -0
  52. package/.turbo/cache/{8f94ccea023ee254.tar.zst → bed01678759af66e.tar.zst} +0 -0
  53. package/.turbo/cache/bf154f26b6bb6f24-meta.json +1 -0
  54. package/.turbo/cache/{9337429c745d33f9.tar.zst → bf154f26b6bb6f24.tar.zst} +0 -0
  55. package/.turbo/cache/bf3d1eace5e676f9-meta.json +1 -1
  56. package/.turbo/cache/c103542625831d7c-meta.json +1 -0
  57. package/.turbo/cache/c103542625831d7c.tar.zst +0 -0
  58. package/.turbo/cache/c860cecd25be20af-meta.json +1 -1
  59. package/.turbo/cache/ca9625ba0a5cd272-meta.json +1 -0
  60. package/.turbo/cache/ca9625ba0a5cd272.tar.zst +0 -0
  61. package/.turbo/cache/cbcd9db8ac9a2d52-meta.json +1 -1
  62. package/.turbo/cache/d3afdb9a7db9eacc-meta.json +1 -1
  63. package/.turbo/cache/d8ecdff9c663c38e-meta.json +1 -1
  64. package/.turbo/cache/de494df6a3006101-meta.json +1 -1
  65. package/.turbo/cache/e56a9865641ec3e8-meta.json +1 -1
  66. package/.turbo/cache/e7ed9e7056d80938-meta.json +1 -1
  67. package/.turbo/cache/e837827cd24834c4-meta.json +1 -1
  68. package/.turbo/cache/e9ff93179777aa26-meta.json +1 -1
  69. package/.turbo/cache/ed455be2856be7ac-meta.json +1 -0
  70. package/.turbo/cache/f2e689c8cdd1aafe-meta.json +1 -1
  71. package/.turbo/cache/f473f3d9902768db-meta.json +1 -0
  72. package/.turbo/cache/f7ab9a13f9acc0ab-meta.json +1 -1
  73. package/.turbo/cache/f93a33e9c99af8e4-meta.json +1 -0
  74. package/.turbo/cache/f93a33e9c99af8e4.tar.zst +0 -0
  75. package/.turbo/cache/ff3c8a3042cab66e-meta.json +1 -1
  76. package/CHANGELOG.md +21 -0
  77. package/components/checkbox/.turbo/turbo-build.log +3 -3
  78. package/components/checkbox/README.md +1 -1
  79. package/components/combobox/.turbo/turbo-build.log +2 -2
  80. package/components/combobox/README.md +4 -4
  81. package/components/counter/.turbo/turbo-build.log +3 -3
  82. package/components/counter/.turbo/turbo-bundler.log +3 -3
  83. package/components/counter/README.md +1 -1
  84. package/components/datepicker/.turbo/turbo-build.log +1 -1
  85. package/components/datepicker/README.md +6 -6
  86. package/components/datepicker/demo/api.min.js +1 -1
  87. package/components/datepicker/demo/index.min.js +1 -1
  88. package/components/datepicker/dist/index.js +1 -1
  89. package/components/datepicker/package.json +2 -2
  90. package/components/datepicker/src/styles/style-css.js +1 -1
  91. package/components/datepicker/src/styles/style.css +55 -29
  92. package/components/datepicker/src/styles/style.scss +45 -7
  93. package/components/dropdown/.turbo/turbo-build.log +3 -3
  94. package/components/dropdown/README.md +1 -1
  95. package/components/form/.turbo/turbo-build.log +3 -3
  96. package/components/form/.turbo/turbo-bundler.log +3 -3
  97. package/components/form/README.md +1 -1
  98. package/components/form/demo/api.min.js +75 -33
  99. package/components/form/demo/index.min.js +75 -33
  100. package/components/form/demo/registerDemoDeps.js +13 -0
  101. package/components/form/dist/auro-form.d.ts +18 -0
  102. package/components/form/dist/auro-form.d.ts.map +1 -1
  103. package/components/form/dist/index.js +75 -33
  104. package/components/form/src/auro-form.js +75 -33
  105. package/components/helptext/.turbo/turbo-build.log +1 -1
  106. package/components/helptext/.turbo/turbo-bundler.log +1 -1
  107. package/components/input/.turbo/turbo-build.log +3 -3
  108. package/components/input/README.md +1 -1
  109. package/components/menu/.turbo/turbo-build.log +3 -3
  110. package/components/menu/.turbo/turbo-bundler.log +3 -3
  111. package/components/menu/README.md +1 -1
  112. package/components/radio/.turbo/turbo-build.log +3 -3
  113. package/components/radio/README.md +1 -1
  114. package/components/select/.turbo/turbo-build.log +3 -3
  115. package/components/select/README.md +3 -3
  116. package/package.json +1 -1
  117. package/.turbo/cache/0b59b3b61897d950-meta.json +0 -1
  118. package/.turbo/cache/1215c5e3dd25e0c3-meta.json +0 -1
  119. package/.turbo/cache/1215c5e3dd25e0c3.tar.zst +0 -0
  120. package/.turbo/cache/13ff0d757be18ae9-meta.json +0 -1
  121. package/.turbo/cache/13ff0d757be18ae9.tar.zst +0 -0
  122. package/.turbo/cache/1b653bcfa2eef748-meta.json +0 -1
  123. package/.turbo/cache/1b653bcfa2eef748.tar.zst +0 -0
  124. package/.turbo/cache/24cb18ffa2f611b1-meta.json +0 -1
  125. package/.turbo/cache/24cb18ffa2f611b1.tar.zst +0 -0
  126. package/.turbo/cache/4f81392ada08f240-meta.json +0 -1
  127. package/.turbo/cache/59481fd7f6f355ed-meta.json +0 -1
  128. package/.turbo/cache/59481fd7f6f355ed.tar.zst +0 -0
  129. package/.turbo/cache/79c16437b6eb7e44-meta.json +0 -1
  130. package/.turbo/cache/79c16437b6eb7e44.tar.zst +0 -0
  131. package/.turbo/cache/8388331cc15d7fd2-meta.json +0 -1
  132. package/.turbo/cache/8c637a8d4c2166c5-meta.json +0 -1
  133. package/.turbo/cache/8c637a8d4c2166c5.tar.zst +0 -0
  134. package/.turbo/cache/8f94ccea023ee254-meta.json +0 -1
  135. package/.turbo/cache/9337429c745d33f9-meta.json +0 -1
  136. package/.turbo/cache/a5717ca784f036bc-meta.json +0 -1
  137. package/.turbo/cache/a5717ca784f036bc.tar.zst +0 -0
  138. package/.turbo/cache/a7dea1f1ae1fdc27-meta.json +0 -1
  139. package/.turbo/cache/a7dea1f1ae1fdc27.tar.zst +0 -0
  140. package/.turbo/cache/abfc52db26c84ceb-meta.json +0 -1
  141. package/.turbo/cache/abfc52db26c84ceb.tar.zst +0 -0
  142. package/.turbo/cache/b7aefb222b98306d-meta.json +0 -1
  143. package/.turbo/cache/c13e85d809af02f6-meta.json +0 -1
  144. package/.turbo/cache/c89150633a136dc8-meta.json +0 -1
  145. package/.turbo/cache/cdb0e45299352fce-meta.json +0 -1
  146. package/.turbo/cache/df379f765f10ec9c-meta.json +0 -1
  147. package/.turbo/cache/df379f765f10ec9c.tar.zst +0 -0
  148. package/.turbo/cache/e95b9e3b7f35e801-meta.json +0 -1
  149. package/.turbo/cache/e95b9e3b7f35e801.tar.zst +0 -0
  150. package/.turbo/cache/fb3845d2ca66fee8-meta.json +0 -1
  151. package/.turbo/cache/fb3845d2ca66fee8.tar.zst +0 -0
  152. /package/.turbo/cache/{b7aefb222b98306d.tar.zst → 7593109ea54e7505.tar.zst} +0 -0
  153. /package/.turbo/cache/{8388331cc15d7fd2.tar.zst → 7629bef0037115af.tar.zst} +0 -0
  154. /package/.turbo/cache/{0b59b3b61897d950.tar.zst → ed455be2856be7ac.tar.zst} +0 -0
  155. /package/.turbo/cache/{c89150633a136dc8.tar.zst → f473f3d9902768db.tar.zst} +0 -0
@@ -44,48 +44,74 @@
44
44
  [auro-input]::part(wrapper) {
45
45
  border-width: 0 !important;
46
46
  }
47
+ [auro-input]:not(:first-child)::part(wrapper) {
48
+ /* stylelint-disable-next-line selector-pseudo-element-colon-notation */
49
+ }
50
+ [auro-input]:not(:first-child)::part(wrapper)::after {
51
+ position: absolute;
52
+ left: 50%;
53
+ width: 95%;
54
+ height: 1px;
55
+ background-color: var(--ds-auro-datepicker-range-input-divider-color);
56
+ content: "";
57
+ transform: translateX(-50%);
58
+ }
47
59
 
48
60
  .outerWrapper {
49
61
  position: relative;
62
+ container: outerwrapper/inline-size;
50
63
  }
51
64
 
52
65
  .dpTriggerContent {
53
66
  display: flex;
54
- flex-direction: row;
67
+ flex-direction: column;
55
68
  }
56
69
  .dpTriggerContent [auro-input] {
57
70
  flex: 1;
58
71
  }
59
- .dpTriggerContent [auro-input]:first-of-type {
60
- margin-right: var(--ds-size-150, 0.75rem);
61
- }
62
- .dpTriggerContent [auro-input]:nth-child(2) {
63
- margin-left: var(--ds-size-150, 0.75rem);
64
- }
65
- .dpTriggerContent [auro-input]:nth-child(2)::part(accentIcon) {
66
- display: none;
67
- }
68
- .dpTriggerContent [auro-input]:nth-child(2)::part(label) {
69
- left: 0;
70
- width: 100%;
71
- }
72
- .dpTriggerContent [auro-input]:nth-child(2)::part(input) {
73
- padding-left: 0;
74
- }
75
- .dpTriggerContent [auro-input]:nth-child(2):before {
76
- position: absolute;
77
- top: 13px;
78
- left: calc(var(--ds-size-150, 0.75rem) * -1);
79
- display: block;
80
- width: 1px;
81
- height: 2rem;
82
- content: "";
83
- }
84
72
 
85
- :host([range]) [auro-input] {
86
- max-width: 50%;
73
+ /* This value is per design but relates to
74
+ https://github.com/AlaskaAirlines/AuroDesignTokens/issues/206
75
+ */
76
+ @container outerwrapper (min-width: 390px) {
77
+ .dpTriggerContent {
78
+ flex-direction: row;
79
+ }
80
+ [auro-input]:first-of-type {
81
+ margin-right: var(--ds-size-150, 0.75rem);
82
+ }
83
+ [auro-input]:nth-child(2) {
84
+ margin-left: var(--ds-size-150, 0.75rem);
85
+ }
86
+ [auro-input]:nth-child(2)::part(accentIcon) {
87
+ display: none;
88
+ }
89
+ [auro-input]:nth-child(2)::part(label) {
90
+ left: 0;
91
+ width: 100%;
92
+ }
93
+ [auro-input]:nth-child(2)::part(input) {
94
+ padding-left: 0;
95
+ }
96
+ [auro-input]:nth-child(2):before {
97
+ position: absolute;
98
+ top: 13px;
99
+ left: calc(var(--ds-size-150, 0.75rem) * -1);
100
+ display: block;
101
+ width: 1px;
102
+ height: 2rem;
103
+ content: "";
104
+ }
105
+ [auro-input]:not(:first-child) {
106
+ /* stylelint-disable-next-line selector-pseudo-element-colon-notation */
107
+ }
108
+ [auro-input]:not(:first-child)::part(wrapper):after {
109
+ content: none;
110
+ }
111
+ :host([range]) [auro-input] {
112
+ max-width: 50%;
113
+ }
87
114
  }
88
-
89
115
  @media screen and (max-width: 576px) {
90
116
  ::part(popover) {
91
117
  position: fixed !important;
@@ -11,10 +11,8 @@
11
11
  [auro-input] {
12
12
  &::part(iconContainer) {
13
13
  top: 0;
14
-
15
14
  display: flex;
16
15
  height: 100%;
17
-
18
16
  align-items: center;
19
17
  }
20
18
 
@@ -29,19 +27,49 @@
29
27
  &::part(wrapper) {
30
28
  border-width: 0 !important;
31
29
  }
30
+
31
+ // Horizontal ruler
32
+ &:not(:first-child) {
33
+ &::part(wrapper) {
34
+ /* stylelint-disable-next-line selector-pseudo-element-colon-notation */
35
+ &::after {
36
+ position: absolute;
37
+ left: 50%;
38
+ width: 95%;
39
+ height: 1px;
40
+ background-color: var(--ds-auro-datepicker-range-input-divider-color);
41
+ content: '';
42
+ transform: translateX(-50%);
43
+ }
44
+ }
45
+ }
32
46
  }
33
47
 
34
48
  .outerWrapper {
35
49
  position: relative;
50
+ container: outerwrapper / inline-size;
36
51
  }
37
52
 
38
53
  .dpTriggerContent {
39
54
  display: flex;
40
- flex-direction: row;
55
+ flex-direction: column;
41
56
 
42
57
  [auro-input] {
43
58
  flex: 1;
59
+ }
60
+ }
61
+
62
+ // Container queries
44
63
 
64
+ /* This value is per design but relates to
65
+ https://github.com/AlaskaAirlines/AuroDesignTokens/issues/206
66
+ */
67
+ @container outerwrapper (min-width: 390px) {
68
+ .dpTriggerContent {
69
+ flex-direction: row;
70
+ }
71
+
72
+ [auro-input] {
45
73
  &:first-of-type {
46
74
  margin-right: var(--ds-size-150, $ds-size-150);
47
75
  }
@@ -72,12 +100,22 @@
72
100
  content: '';
73
101
  }
74
102
  }
103
+
104
+ // Hide horizontal ruler
105
+ &:not(:first-child) {
106
+ /* stylelint-disable-next-line selector-pseudo-element-colon-notation */
107
+ &::part(wrapper) {
108
+ &:after {
109
+ content: none;
110
+ }
111
+ }
112
+ }
75
113
  }
76
- }
77
114
 
78
- :host([range]) {
79
- [auro-input] {
80
- max-width: 50%;
115
+ :host([range]) {
116
+ [auro-input] {
117
+ max-width: 50%;
118
+ }
81
119
  }
82
120
  }
83
121
 
@@ -90,13 +90,13 @@ More info and automated migrator: https://sass-lang.com/d/import
90
90
 
91
91
  
92
92
  ./src/index.js → dist...
93
- created dist in 1.2s
93
+ created dist in 1.1s
94
94
  
95
95
  ./demo/index.js → ./demo/...
96
- created ./demo/ in 823ms
96
+ created ./demo/ in 765ms
97
97
  
98
98
  ./demo/api.js → ./demo/...
99
- created ./demo/ in 655ms
99
+ created ./demo/ in 502ms
100
100
 
101
101
  > @aurodesignsystem/auro-dropdown@3.0.0 build:docs
102
102
  > wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component dropdown
@@ -97,7 +97,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
97
97
  <!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
98
98
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.9.2/dist/tokens/CSSCustomProperties.css" />
99
99
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
100
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-dropdown@2.0.0-beta.30/dist/auro-dropdown__bundled.js" type="module"></script>
100
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-dropdown@2.0.0-beta.32/dist/auro-dropdown__bundled.js" type="module"></script>
101
101
  <!-- AURO-GENERATED-CONTENT:END -->
102
102
 
103
103
  ## auro-dropdown use cases
@@ -69,13 +69,13 @@ Run in verbose mode to see all warnings.
69
69
 
70
70
  
71
71
  ./src/index.js → dist...
72
- created dist in 148ms
72
+ created dist in 150ms
73
73
  
74
74
  ./demo/index.js → ./demo/...
75
- created ./demo/ in 80ms
75
+ created ./demo/ in 79ms
76
76
  
77
77
  ./demo/api.js → ./demo/...
78
- created ./demo/ in 70ms
78
+ created ./demo/ in 69ms
79
79
 
80
80
  > @aurodesignsystem/auro-form@1.0.0 build:docs
81
81
  > wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component form
@@ -4,10 +4,10 @@
4
4
 
5
5
  
6
6
  ./src/index.js → dist...
7
- created dist in 299ms
7
+ created dist in 447ms
8
8
  
9
9
  ./demo/index.js → ./demo/...
10
- created ./demo/ in 241ms
10
+ created ./demo/ in 214ms
11
11
  
12
12
  ./demo/api.js → ./demo/...
13
- created ./demo/ in 178ms
13
+ created ./demo/ in 175ms
@@ -98,7 +98,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
98
98
  <!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
99
99
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
100
100
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
101
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-form@2.0.0-beta.30/dist/auro-form__bundled.js" type="module"></script>
101
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-form@2.0.0-beta.32/dist/auro-form__bundled.js" type="module"></script>
102
102
  <!-- AURO-GENERATED-CONTENT:END -->
103
103
 
104
104
  ## auro-form use cases
@@ -155,6 +155,8 @@ class AuroForm extends r {
155
155
  // Bind listeners
156
156
  this.reset = this.reset.bind(this);
157
157
  this.submit = this.submit.bind(this);
158
+ this.sharedInputListener = this.sharedInputListener.bind(this);
159
+ this.sharedValidationListener = this.sharedValidationListener.bind(this);
158
160
  }
159
161
 
160
162
  // Note: button is NOT considered a form element in this context
@@ -164,7 +166,12 @@ class AuroForm extends r {
164
166
  'auro-input',
165
167
  'auro-select',
166
168
  'auro-datepicker',
169
+ 'auro-combobox',
170
+ // checkbox and radio are grouped elements
167
171
  'auro-checkbox-group',
172
+ 'auro-radio-group',
173
+ // while counter is groupable, the group is for min/max values and not for grouped values
174
+ 'auro-counter-group'
168
175
  ];
169
176
  }
170
177
 
@@ -199,6 +206,18 @@ class AuroForm extends r {
199
206
  return this._isInElementCollection(AuroForm.formElementTags, element);
200
207
  }
201
208
 
209
+ /**
210
+ * Validates if an event is from a valid form element with a name.
211
+ * @param {Event} event - The event to validate.
212
+ * @returns {boolean} - True if event is valid for processing.
213
+ * @private
214
+ */
215
+ _eventIsValidFormEvent(event) {
216
+ const targetName = event.target.getAttribute("name");
217
+ return this.isFormElement(event.target) && targetName;
218
+ }
219
+
220
+
202
221
  static get buttonElementTags() {
203
222
  return [
204
223
  'button',
@@ -358,7 +377,7 @@ class AuroForm extends r {
358
377
  }
359
378
 
360
379
  this.formState[targetName] = {
361
- value: element.getAttribute('value'),
380
+ value: element.value || element.getAttribute('value'),
362
381
  validity: element.validity || null,
363
382
  required: element.hasAttribute('required'),
364
383
  // element
@@ -466,48 +485,69 @@ class AuroForm extends r {
466
485
  AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroForm);
467
486
  }
468
487
 
469
- firstUpdated(_changedProperties) {
470
- super.firstUpdated(_changedProperties);
488
+ /**
489
+ * Shared input listener for all form elements.
490
+ * @param {Event} event - The event that is fired from the form element.
491
+ */
492
+ sharedInputListener(event) {
493
+ const targetName = event.target.getAttribute("name");
471
494
 
472
- const slot = this.shadowRoot.querySelector('slot');
495
+ // This should only happen if some bubble-up event is fired from inside a form element.
496
+ if (!this._eventIsValidFormEvent(event)) {
497
+ return;
498
+ }
473
499
 
474
- // Update the form state when a form element is detected
475
- slot.addEventListener('input', (event) => {
476
- const targetName = event.target.getAttribute("name");
477
- if (!this.isFormElement(event.target) || !targetName) {
478
- return;
479
- }
500
+ // Occasionally, a form element will emit their event before the form can read data about the form element.
501
+ if (!this.formState[targetName] && this.isFormElement(event.target)) {
502
+ this._addElementToState(event.target);
503
+ }
480
504
 
481
- // Occasionally, a form element will emit their event before the form can read data about the form element.
482
- if (!this.formState[targetName] && this.isFormElement(event.target)) {
483
- this._addElementToState(event.target);
484
- }
505
+ // Check special input types and handle their edge cases
506
+ if (this._isElementTag('auro-datepicker', event.target) && event.target.hasAttribute('range')) {
507
+ this.formState[targetName].value = event.target.values;
508
+ this.requestUpdate('formState');
509
+ } else {
510
+ this.formState[targetName].value = event.target.value;
511
+ this.requestUpdate('formState');
512
+ }
513
+ }
485
514
 
486
- // Check special input types and handle their edge cases
487
- if (this._isElementTag('auro-datepicker', event.target) && event.target.hasAttribute('range')) {
488
- this.formState[targetName].value = event.target.values;
489
- this.requestUpdate('formState');
490
- } else {
491
- this.formState[targetName].value = event.target.value;
492
- this.requestUpdate('formState');
493
- }
494
- });
515
+ /**
516
+ * Shared validation listener for all form elements.
517
+ * @param {Event} event - The event that is fired from the form element.
518
+ */
519
+ sharedValidationListener(event) {
520
+ const targetName = event.target.getAttribute("name");
521
+ if (!this._eventIsValidFormEvent(event)) {
522
+ return;
523
+ }
495
524
 
496
- slot.addEventListener('auroFormElement-validated', (event) => {
497
- const targetName = event.target.getAttribute("name");
498
- if (!this.isFormElement(event.target) || !targetName) {
499
- return;
500
- }
525
+ if (!this.formState[targetName]) {
526
+ this._addElementToState(event.target);
527
+ }
501
528
 
502
- if (!this.formState[targetName]) {
503
- this._addElementToState(event.target);
504
- }
529
+ this.formState[targetName].validity = event.detail.validity;
530
+ this._calculateValidity();
531
+ }
505
532
 
506
- this.formState[targetName].validity = event.detail.validity;
507
- this._calculateValidity();
533
+ _attachEventListeners() {
534
+ this.queryAuroElements().forEach((element) => {
535
+ // remove any existing event listeners (in case of re-initialization)
536
+ element.removeEventListener('input', this.sharedInputListener);
537
+ element.removeEventListener('auroFormElement-validated', this.sharedValidationListener);
538
+
539
+ // add new event listeners
540
+ element.addEventListener('input', this.sharedInputListener);
541
+ element.addEventListener('auroFormElement-validated', this.sharedValidationListener);
508
542
  });
509
543
  }
510
544
 
545
+ firstUpdated(_changedProperties) {
546
+ super.firstUpdated(_changedProperties);
547
+
548
+ this._attachEventListeners();
549
+ }
550
+
511
551
  updated(_changedProperties) {
512
552
  super.updated(_changedProperties);
513
553
 
@@ -525,6 +565,8 @@ class AuroForm extends r {
525
565
 
526
566
  onSlotChange() {
527
567
  this.initializeState();
568
+ // Safe to call as we remove and re-add event listeners
569
+ this._attachEventListeners();
528
570
  }
529
571
 
530
572
  // function that renders the HTML and CSS into the scope of the component
@@ -155,6 +155,8 @@ class AuroForm extends r {
155
155
  // Bind listeners
156
156
  this.reset = this.reset.bind(this);
157
157
  this.submit = this.submit.bind(this);
158
+ this.sharedInputListener = this.sharedInputListener.bind(this);
159
+ this.sharedValidationListener = this.sharedValidationListener.bind(this);
158
160
  }
159
161
 
160
162
  // Note: button is NOT considered a form element in this context
@@ -164,7 +166,12 @@ class AuroForm extends r {
164
166
  'auro-input',
165
167
  'auro-select',
166
168
  'auro-datepicker',
169
+ 'auro-combobox',
170
+ // checkbox and radio are grouped elements
167
171
  'auro-checkbox-group',
172
+ 'auro-radio-group',
173
+ // while counter is groupable, the group is for min/max values and not for grouped values
174
+ 'auro-counter-group'
168
175
  ];
169
176
  }
170
177
 
@@ -199,6 +206,18 @@ class AuroForm extends r {
199
206
  return this._isInElementCollection(AuroForm.formElementTags, element);
200
207
  }
201
208
 
209
+ /**
210
+ * Validates if an event is from a valid form element with a name.
211
+ * @param {Event} event - The event to validate.
212
+ * @returns {boolean} - True if event is valid for processing.
213
+ * @private
214
+ */
215
+ _eventIsValidFormEvent(event) {
216
+ const targetName = event.target.getAttribute("name");
217
+ return this.isFormElement(event.target) && targetName;
218
+ }
219
+
220
+
202
221
  static get buttonElementTags() {
203
222
  return [
204
223
  'button',
@@ -358,7 +377,7 @@ class AuroForm extends r {
358
377
  }
359
378
 
360
379
  this.formState[targetName] = {
361
- value: element.getAttribute('value'),
380
+ value: element.value || element.getAttribute('value'),
362
381
  validity: element.validity || null,
363
382
  required: element.hasAttribute('required'),
364
383
  // element
@@ -466,48 +485,69 @@ class AuroForm extends r {
466
485
  AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroForm);
467
486
  }
468
487
 
469
- firstUpdated(_changedProperties) {
470
- super.firstUpdated(_changedProperties);
488
+ /**
489
+ * Shared input listener for all form elements.
490
+ * @param {Event} event - The event that is fired from the form element.
491
+ */
492
+ sharedInputListener(event) {
493
+ const targetName = event.target.getAttribute("name");
471
494
 
472
- const slot = this.shadowRoot.querySelector('slot');
495
+ // This should only happen if some bubble-up event is fired from inside a form element.
496
+ if (!this._eventIsValidFormEvent(event)) {
497
+ return;
498
+ }
473
499
 
474
- // Update the form state when a form element is detected
475
- slot.addEventListener('input', (event) => {
476
- const targetName = event.target.getAttribute("name");
477
- if (!this.isFormElement(event.target) || !targetName) {
478
- return;
479
- }
500
+ // Occasionally, a form element will emit their event before the form can read data about the form element.
501
+ if (!this.formState[targetName] && this.isFormElement(event.target)) {
502
+ this._addElementToState(event.target);
503
+ }
480
504
 
481
- // Occasionally, a form element will emit their event before the form can read data about the form element.
482
- if (!this.formState[targetName] && this.isFormElement(event.target)) {
483
- this._addElementToState(event.target);
484
- }
505
+ // Check special input types and handle their edge cases
506
+ if (this._isElementTag('auro-datepicker', event.target) && event.target.hasAttribute('range')) {
507
+ this.formState[targetName].value = event.target.values;
508
+ this.requestUpdate('formState');
509
+ } else {
510
+ this.formState[targetName].value = event.target.value;
511
+ this.requestUpdate('formState');
512
+ }
513
+ }
485
514
 
486
- // Check special input types and handle their edge cases
487
- if (this._isElementTag('auro-datepicker', event.target) && event.target.hasAttribute('range')) {
488
- this.formState[targetName].value = event.target.values;
489
- this.requestUpdate('formState');
490
- } else {
491
- this.formState[targetName].value = event.target.value;
492
- this.requestUpdate('formState');
493
- }
494
- });
515
+ /**
516
+ * Shared validation listener for all form elements.
517
+ * @param {Event} event - The event that is fired from the form element.
518
+ */
519
+ sharedValidationListener(event) {
520
+ const targetName = event.target.getAttribute("name");
521
+ if (!this._eventIsValidFormEvent(event)) {
522
+ return;
523
+ }
495
524
 
496
- slot.addEventListener('auroFormElement-validated', (event) => {
497
- const targetName = event.target.getAttribute("name");
498
- if (!this.isFormElement(event.target) || !targetName) {
499
- return;
500
- }
525
+ if (!this.formState[targetName]) {
526
+ this._addElementToState(event.target);
527
+ }
501
528
 
502
- if (!this.formState[targetName]) {
503
- this._addElementToState(event.target);
504
- }
529
+ this.formState[targetName].validity = event.detail.validity;
530
+ this._calculateValidity();
531
+ }
505
532
 
506
- this.formState[targetName].validity = event.detail.validity;
507
- this._calculateValidity();
533
+ _attachEventListeners() {
534
+ this.queryAuroElements().forEach((element) => {
535
+ // remove any existing event listeners (in case of re-initialization)
536
+ element.removeEventListener('input', this.sharedInputListener);
537
+ element.removeEventListener('auroFormElement-validated', this.sharedValidationListener);
538
+
539
+ // add new event listeners
540
+ element.addEventListener('input', this.sharedInputListener);
541
+ element.addEventListener('auroFormElement-validated', this.sharedValidationListener);
508
542
  });
509
543
  }
510
544
 
545
+ firstUpdated(_changedProperties) {
546
+ super.firstUpdated(_changedProperties);
547
+
548
+ this._attachEventListeners();
549
+ }
550
+
511
551
  updated(_changedProperties) {
512
552
  super.updated(_changedProperties);
513
553
 
@@ -525,6 +565,8 @@ class AuroForm extends r {
525
565
 
526
566
  onSlotChange() {
527
567
  this.initializeState();
568
+ // Safe to call as we remove and re-add event listeners
569
+ this._attachEventListeners();
528
570
  }
529
571
 
530
572
  // function that renders the HTML and CSS into the scope of the component
@@ -1,6 +1,19 @@
1
1
  import {AuroInput} from "@aurodesignsystem/auro-input";
2
2
  import {AuroDatePicker} from "@aurodesignsystem/auro-datepicker";
3
+ import {AuroCounter, AuroCounterGroup} from "@aurodesignsystem/auro-counter";
4
+ import {AuroCheckbox, AuroCheckboxGroup} from "@aurodesignsystem/auro-checkbox";
5
+ import {AuroCombobox} from "@aurodesignsystem/auro-combobox";
6
+ import {AuroMenu, AuroMenuOption} from "@aurodesignsystem/auro-menu";
7
+ import {AuroSelect} from "@aurodesignsystem/auro-select";
3
8
 
4
9
  AuroInput.register();
5
10
  AuroInput.register('auro-input-two');
6
11
  AuroDatePicker.register();
12
+ AuroCounter.register();
13
+ AuroCounterGroup.register();
14
+ AuroCheckbox.register();
15
+ AuroCheckboxGroup.register();
16
+ AuroCombobox.register();
17
+ AuroMenu.register();
18
+ AuroMenuOption.register();
19
+ AuroSelect.register();
@@ -68,6 +68,16 @@ export class AuroForm extends LitElement {
68
68
  * Submit fires an event called `submit` - just as you would expect from a normal form.
69
69
  */
70
70
  submit(): void;
71
+ /**
72
+ * Shared input listener for all form elements.
73
+ * @param {Event} event - The event that is fired from the form element.
74
+ */
75
+ sharedInputListener(event: Event): void;
76
+ /**
77
+ * Shared validation listener for all form elements.
78
+ * @param {Event} event - The event that is fired from the form element.
79
+ */
80
+ sharedValidationListener(event: Event): void;
71
81
  /**
72
82
  * Compare tag name with element to identify it (for API purposes).
73
83
  * @param {string} elementTag - The HTML tag name like `auro-datepicker`.
@@ -90,6 +100,13 @@ export class AuroForm extends LitElement {
90
100
  * @returns {boolean}
91
101
  */
92
102
  isFormElement(element: HTMLElement): boolean;
103
+ /**
104
+ * Validates if an event is from a valid form element with a name.
105
+ * @param {Event} event - The event to validate.
106
+ * @returns {boolean} - True if event is valid for processing.
107
+ * @private
108
+ */
109
+ private _eventIsValidFormEvent;
93
110
  /**
94
111
  * Check if the tag name is a button element.
95
112
  * @param {HTMLElement} element - The element to check.
@@ -148,6 +165,7 @@ export class AuroForm extends LitElement {
148
165
  * Initialize (or reinitialize) the form state.
149
166
  */
150
167
  initializeState(): void;
168
+ _attachEventListeners(): void;
151
169
  firstUpdated(_changedProperties: any): void;
152
170
  updated(_changedProperties: any): void;
153
171
  onSlotChange(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"auro-form.d.ts","sourceRoot":"","sources":["../src/auro-form.js"],"names":[],"mappings":"AAcA;;;;;;GAMG;AAEH;;GAEG;AAIH;;;;;GAKG;AAGH;IACE;;;;;;;;;;;;;;;;;;;MASC;IA4BD,uCAOC;IAiCD,yCAKC;IAWD,+CAEC;IA6OD;;;;;;;OAOG;IACH,uBANW,MAAM,QAQhB;IAxUC,wBAAwB;IACxB,WADW,SAAS,CACD;IAEnB,yCAAyC;IACzC,WADW,OAAO,GAAG,SAAS,GAAG,IAAI,CAChB;IACrB,yBAA2B;IAE3B,oDAAoD;IACpD,WADW,CAAC,WAAW,GAAG;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAC,CAAC,EAAE,CAC7B;IAEnB,kCAAkC;IAClC,iBADW,iBAAiB,EAAE,CACL;IAEzB,kCAAkC;IAClC,gBADW,iBAAiB,EAAE,CACN;IA4P1B;;OAEG;IACH,cAuBC;IAED;;OAEG;IACH,eAmBC;IA5RD;;;;;;OAMG;IACH,sBAEC;IAED;;;;;;OAMG;IACH,+BAEC;IAED;;;;OAIG;IACH,uBAHW,WAAW,GACT,OAAO,CAInB;IASD;;;;OAIG;IACH,yBAHW,WAAW,GACT,OAAO,CAInB;IAMD;;;;;;;;OAQG;IACH,aAFa,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,CAOvE;IAED;;;OAGG;IACH,sBAFa,iBAAiB,EAAE,CAI/B;IAED;;;OAGG;IACH,qBAFa,iBAAiB,EAAE,CAI/B;IAED;;;OAGG;IACH,2BAcC;IAED;;;OAGG;IACH,gBAFa,OAAO,GAAG,SAAS,CAO/B;IAED,yBAUC;IAED;;;OAGG;IACH,sBAFa,OAAO,CAInB;IAED,kCAgBC;IAED;;;OAGG;IACH,qBAFa,QAAQ,CAsBpB;IAED;;;;OAIG;IACH,2BAcC;IAED;;OAEG;IACH,wBA8BC;IAkED,4CAwCC;IAED,uCAaC;IAED,qBAEC;IAGD,+CAMC;CACF;;;;;;;;WAlba,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI;;;;cAC3C,aAAa;;;;cACb,OAAO;;;;aACP,WAAW;;;;;;;;2BAXQ,KAAK"}
1
+ {"version":3,"file":"auro-form.d.ts","sourceRoot":"","sources":["../src/auro-form.js"],"names":[],"mappings":"AAcA;;;;;;GAMG;AAEH;;GAEG;AAIH;;;;;GAKG;AAGH;IACE;;;;;;;;;;;;;;;;;;;MASC;IA8BD,uCAYC;IA6CD,yCAKC;IAWD,+CAEC;IA6OD;;;;;;;OAOG;IACH,uBANW,MAAM,QAQhB;IA3VC,wBAAwB;IACxB,WADW,SAAS,CACD;IAEnB,yCAAyC;IACzC,WADW,OAAO,GAAG,SAAS,GAAG,IAAI,CAChB;IACrB,yBAA2B;IAE3B,oDAAoD;IACpD,WADW,CAAC,WAAW,GAAG;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAC,CAAC,EAAE,CAC7B;IAEnB,kCAAkC;IAClC,iBADW,iBAAiB,EAAE,CACL;IAEzB,kCAAkC;IAClC,gBADW,iBAAiB,EAAE,CACN;IA+Q1B;;OAEG;IACH,cAuBC;IAED;;OAEG;IACH,eAmBC;IAcD;;;OAGG;IACH,2BAFW,KAAK,QAuBf;IAED;;;OAGG;IACH,gCAFW,KAAK,QAcf;IAjWD;;;;;;OAMG;IACH,sBAEC;IAED;;;;;;OAMG;IACH,+BAEC;IAED;;;;OAIG;IACH,uBAHW,WAAW,GACT,OAAO,CAInB;IAED;;;;;OAKG;IACH,+BAGC;IAUD;;;;OAIG;IACH,yBAHW,WAAW,GACT,OAAO,CAInB;IAMD;;;;;;;;OAQG;IACH,aAFa,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,CAOvE;IAED;;;OAGG;IACH,sBAFa,iBAAiB,EAAE,CAI/B;IAED;;;OAGG;IACH,qBAFa,iBAAiB,EAAE,CAI/B;IAED;;;OAGG;IACH,2BAcC;IAED;;;OAGG;IACH,gBAFa,OAAO,GAAG,SAAS,CAO/B;IAED,yBAUC;IAED;;;OAGG;IACH,sBAFa,OAAO,CAInB;IAED,kCAgBC;IAED;;;OAGG;IACH,qBAFa,QAAQ,CAsBpB;IAED;;;;OAIG;IACH,2BAcC;IAED;;OAEG;IACH,wBA8BC;IA+GD,8BAUC;IAED,4CAIC;IAED,uCAaC;IAED,qBAIC;IAGD,+CAMC;CACF;;;;;;;;WA5da,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI;;;;cAC3C,aAAa;;;;cACb,OAAO;;;;aACP,WAAW;;;;;;;;2BAXQ,KAAK"}