@aurodesignsystem/auro-formkit 2.0.0-beta.7 → 2.0.0-beta.9

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 (291) hide show
  1. package/.turbo/cache/012997da408d7381-meta.json +1 -0
  2. package/.turbo/cache/0c8124a987c1cc05-meta.json +1 -1
  3. package/.turbo/cache/114f70925d97840c-meta.json +1 -0
  4. package/.turbo/cache/114f70925d97840c.tar.zst +0 -0
  5. package/.turbo/cache/144803363093af6b-meta.json +1 -0
  6. package/.turbo/cache/18129dba20f51b6b-meta.json +1 -1
  7. package/.turbo/cache/19afa09c8e45c25d-meta.json +1 -0
  8. package/.turbo/cache/19afa09c8e45c25d.tar.zst +0 -0
  9. package/.turbo/cache/20a17be1e896dc95-meta.json +1 -0
  10. package/.turbo/cache/20a17be1e896dc95.tar.zst +0 -0
  11. package/.turbo/cache/2624bedf18a03ab1-meta.json +1 -0
  12. package/.turbo/cache/2624bedf18a03ab1.tar.zst +0 -0
  13. package/.turbo/cache/2706814699cff63a-meta.json +1 -0
  14. package/.turbo/cache/2787020e69f50af2-meta.json +1 -1
  15. package/.turbo/cache/29d704afd7578cda-meta.json +1 -0
  16. package/.turbo/cache/29d704afd7578cda.tar.zst +0 -0
  17. package/.turbo/cache/2edcc8b31cd713fc-meta.json +1 -0
  18. package/.turbo/cache/2edcc8b31cd713fc.tar.zst +0 -0
  19. package/.turbo/cache/318a9085a92f2d32-meta.json +1 -0
  20. package/.turbo/cache/326d9e4692d61af1-meta.json +1 -0
  21. package/.turbo/cache/326d9e4692d61af1.tar.zst +0 -0
  22. package/.turbo/cache/36962b1c4c89a3a2-meta.json +1 -0
  23. package/.turbo/cache/36962b1c4c89a3a2.tar.zst +0 -0
  24. package/.turbo/cache/3cd8fc5f388323db-meta.json +1 -1
  25. package/.turbo/cache/3f8ea42b850fd7b1-meta.json +1 -0
  26. package/.turbo/cache/{c114d428251f56a5.tar.zst → 3f8ea42b850fd7b1.tar.zst} +0 -0
  27. package/.turbo/cache/4006a206400d5c7b-meta.json +1 -1
  28. package/.turbo/cache/457af7906413d2ff-meta.json +1 -0
  29. package/.turbo/cache/492dda333b8d15f1-meta.json +1 -1
  30. package/.turbo/cache/508f2fcc60e5046f-meta.json +1 -0
  31. package/.turbo/cache/508f2fcc60e5046f.tar.zst +0 -0
  32. package/.turbo/cache/50993de942ec15a9-meta.json +1 -1
  33. package/.turbo/cache/51eaa58d5c167de8-meta.json +1 -1
  34. package/.turbo/cache/5567d6b2fdae56a9-meta.json +1 -0
  35. package/.turbo/cache/5a6290b52b84f5ef-meta.json +1 -0
  36. package/.turbo/cache/5a6290b52b84f5ef.tar.zst +0 -0
  37. package/.turbo/cache/5aadae8d3f94202e-meta.json +1 -1
  38. package/.turbo/cache/6081837e8943b62e-meta.json +1 -0
  39. package/.turbo/cache/6081837e8943b62e.tar.zst +0 -0
  40. package/.turbo/cache/60ad74320c682a2b-meta.json +1 -1
  41. package/.turbo/cache/61e218aba69cff58-meta.json +1 -1
  42. package/.turbo/cache/64ac8d6a4669ba20-meta.json +1 -0
  43. package/.turbo/cache/64ac8d6a4669ba20.tar.zst +0 -0
  44. package/.turbo/cache/706649b429184693-meta.json +1 -0
  45. package/.turbo/cache/706649b429184693.tar.zst +0 -0
  46. package/.turbo/cache/71dbeaf0706c12fe-meta.json +1 -1
  47. package/.turbo/cache/7445df6e7feed2a7-meta.json +1 -1
  48. package/.turbo/cache/769652d1b874d7cf-meta.json +1 -0
  49. package/.turbo/cache/77da375a012de9d0-meta.json +1 -1
  50. package/.turbo/cache/7bf2b06a479d0b30-meta.json +1 -1
  51. package/.turbo/cache/7c4645de5001b034-meta.json +1 -0
  52. package/.turbo/cache/7c4645de5001b034.tar.zst +0 -0
  53. package/.turbo/cache/7e3244d67de2d977-meta.json +1 -0
  54. package/.turbo/cache/7e3244d67de2d977.tar.zst +0 -0
  55. package/.turbo/cache/7f3b42ddf36d0158-meta.json +1 -1
  56. package/.turbo/cache/804ad767c7ba2fc3-meta.json +1 -0
  57. package/.turbo/cache/804ad767c7ba2fc3.tar.zst +0 -0
  58. package/.turbo/cache/8366405184d123d2-meta.json +1 -0
  59. package/.turbo/cache/{a3db8f78e018a955.tar.zst → 8366405184d123d2.tar.zst} +0 -0
  60. package/.turbo/cache/85cc23a2de6b1009-meta.json +1 -0
  61. package/.turbo/cache/99936b010f1533f9-meta.json +1 -0
  62. package/.turbo/cache/{dc6fbe2a8d5b9d9b.tar.zst → 99936b010f1533f9.tar.zst} +0 -0
  63. package/.turbo/cache/9a9b4e449cd84be4-meta.json +1 -1
  64. package/.turbo/cache/9ae99e8e7bd83d06-meta.json +1 -1
  65. package/.turbo/cache/a275406512608e45-meta.json +1 -1
  66. package/.turbo/cache/a54b4d75b5d265de-meta.json +1 -0
  67. package/.turbo/cache/b280ed4daaf15dcb-meta.json +1 -0
  68. package/.turbo/cache/b5e6dc7fb9ae1a2f-meta.json +1 -1
  69. package/.turbo/cache/b6a202cc85cb61a0-meta.json +1 -1
  70. package/.turbo/cache/c44efc9e4ddd8a0e-meta.json +1 -1
  71. package/.turbo/cache/c47b8032d18fc452-meta.json +1 -0
  72. package/.turbo/cache/c47b8032d18fc452.tar.zst +0 -0
  73. package/.turbo/cache/c6c6411199b68170-meta.json +1 -1
  74. package/.turbo/cache/d3a05e38449c9b24-meta.json +1 -1
  75. package/.turbo/cache/d44acd685455b288-meta.json +1 -0
  76. package/.turbo/cache/d5db503b2eaf239c-meta.json +1 -1
  77. package/.turbo/cache/d683a7d23b0d7073-meta.json +1 -0
  78. package/.turbo/cache/d683a7d23b0d7073.tar.zst +0 -0
  79. package/.turbo/cache/d7caaacb8114772f-meta.json +1 -0
  80. package/.turbo/cache/d7caaacb8114772f.tar.zst +0 -0
  81. package/.turbo/cache/dad3d78b33edd9e4-meta.json +1 -0
  82. package/.turbo/cache/dad3d78b33edd9e4.tar.zst +0 -0
  83. package/.turbo/cache/db4ea5071b44ee8c-meta.json +1 -1
  84. package/.turbo/cache/de44707e76bdd80c-meta.json +1 -0
  85. package/.turbo/cache/de44707e76bdd80c.tar.zst +0 -0
  86. package/.turbo/cache/e03997efe5adad43-meta.json +1 -0
  87. package/.turbo/cache/e1aa836f0cc2d7c5-meta.json +1 -0
  88. package/.turbo/cache/e1aa836f0cc2d7c5.tar.zst +0 -0
  89. package/.turbo/cache/e62cfee068e3ef36-meta.json +1 -1
  90. package/.turbo/cache/e820cc8f220a05f3-meta.json +1 -0
  91. package/.turbo/cache/e9e36823f6c98f07-meta.json +1 -0
  92. package/.turbo/cache/e9e36823f6c98f07.tar.zst +0 -0
  93. package/.turbo/cache/f3f4ddfd3230e489-meta.json +1 -0
  94. package/.turbo/cache/f3f4ddfd3230e489.tar.zst +0 -0
  95. package/.turbo/cache/fdaf484b1ec4b5ed-meta.json +1 -0
  96. package/.vscode/settings.json +3 -0
  97. package/CHANGELOG.md +27 -0
  98. package/components/checkbox/.turbo/turbo-build.log +2 -2
  99. package/components/checkbox/.turbo/turbo-bundler.log +3 -3
  100. package/components/checkbox/README.md +1 -1
  101. package/components/checkbox/demo/api.min.js +79 -20
  102. package/components/checkbox/demo/index.min.js +79 -20
  103. package/components/checkbox/dist/index.js +79 -20
  104. package/components/combobox/.turbo/turbo-build.log +2 -2
  105. package/components/combobox/.turbo/turbo-bundler.log +3 -3
  106. package/components/combobox/README.md +4 -4
  107. package/components/combobox/demo/api.min.js +160 -42
  108. package/components/combobox/demo/index.min.js +160 -42
  109. package/components/combobox/dist/index.js +158 -40
  110. package/components/counter/.turbo/turbo-build$colon$sass.log +172 -0
  111. package/components/counter/.turbo/turbo-build$colon$version.log +10 -0
  112. package/components/counter/.turbo/turbo-build.log +278 -4
  113. package/components/counter/.turbo/turbo-bundler.log +3 -3
  114. package/components/counter/.turbo/turbo-sass$colon$render.log +36 -0
  115. package/components/counter/README.md +188 -0
  116. package/components/counter/demo/api.md +98 -1016
  117. package/components/counter/demo/api.min.js +1670 -32
  118. package/components/counter/demo/index.js +2 -1
  119. package/components/counter/demo/index.md +194 -0
  120. package/components/counter/demo/index.min.js +1702 -19
  121. package/components/counter/dist/auro-counter-button.d.ts +13 -0
  122. package/components/counter/dist/auro-counter-button.d.ts.map +1 -0
  123. package/components/counter/dist/auro-counter-group.d.ts +77 -6
  124. package/components/counter/dist/auro-counter-group.d.ts.map +1 -1
  125. package/components/counter/dist/auro-counter.d.ts +78 -0
  126. package/components/counter/dist/auro-counter.d.ts.map +1 -1
  127. package/components/counter/dist/formkit/auro-dropdownVersion.d.ts +3 -0
  128. package/components/counter/dist/formkit/auro-dropdownVersion.d.ts.map +1 -0
  129. package/components/counter/dist/iconVersion.d.ts +3 -0
  130. package/components/counter/dist/iconVersion.d.ts.map +1 -0
  131. package/components/counter/dist/index.js +1670 -32
  132. package/components/counter/dist/styles/color-css.d.ts +3 -0
  133. package/components/counter/dist/styles/color-css.d.ts.map +1 -0
  134. package/components/counter/dist/styles/counter-button-color-css.d.ts +3 -0
  135. package/components/counter/dist/styles/counter-button-color-css.d.ts.map +1 -0
  136. package/components/counter/dist/styles/counter-button-css.d.ts +3 -0
  137. package/components/counter/dist/styles/counter-button-css.d.ts.map +1 -0
  138. package/components/counter/dist/styles/counter-button-tokens-css.d.ts +3 -0
  139. package/components/counter/dist/styles/counter-button-tokens-css.d.ts.map +1 -0
  140. package/components/counter/dist/styles/counter-group-color-css.d.ts +3 -0
  141. package/components/counter/dist/styles/counter-group-color-css.d.ts.map +1 -0
  142. package/components/counter/dist/styles/tokens-css.d.ts +3 -0
  143. package/components/counter/dist/styles/tokens-css.d.ts.map +1 -0
  144. package/components/counter/package.json +8 -2
  145. package/components/counter/src/auro-counter-button.js +42 -0
  146. package/components/counter/src/auro-counter-group.js +150 -21
  147. package/components/counter/src/auro-counter.js +272 -12
  148. package/components/counter/src/formkit/auro-dropdownVersion.js +1 -0
  149. package/components/counter/src/iconVersion.js +1 -0
  150. package/components/counter/src/index.js +1 -1
  151. package/components/counter/src/styles/color-css.js +2 -0
  152. package/components/counter/src/styles/color.css +25 -0
  153. package/components/counter/src/styles/color.scss +44 -0
  154. package/components/counter/src/styles/counter-button-color-css.js +2 -0
  155. package/components/counter/src/styles/counter-button-color.css +14 -0
  156. package/components/counter/src/styles/counter-button-color.scss +29 -0
  157. package/components/counter/src/styles/counter-button-css.js +2 -0
  158. package/components/counter/src/styles/counter-button-tokens-css.js +2 -0
  159. package/components/counter/src/styles/counter-button-tokens.css +7 -0
  160. package/components/counter/src/styles/counter-button-tokens.scss +9 -0
  161. package/components/counter/src/styles/counter-button.css +187 -0
  162. package/components/counter/src/styles/counter-button.scss +83 -0
  163. package/components/counter/src/styles/counter-group-color-css.js +2 -0
  164. package/components/counter/src/styles/counter-group-color.css +4 -0
  165. package/components/counter/src/styles/counter-group-color.scss +19 -0
  166. package/components/counter/src/styles/counter-group-css.js +1 -1
  167. package/components/counter/src/styles/counter-group.css +13 -1
  168. package/components/counter/src/styles/counter-group.scss +14 -1
  169. package/components/counter/src/styles/style-css.js +1 -1
  170. package/components/counter/src/styles/style.css +43 -1
  171. package/components/counter/src/styles/style.scss +48 -2
  172. package/components/counter/src/styles/tokens-css.js +2 -0
  173. package/components/counter/src/styles/tokens.css +11 -0
  174. package/components/counter/src/styles/tokens.scss +24 -0
  175. package/components/datepicker/.turbo/turbo-build.log +2 -2
  176. package/components/datepicker/.turbo/turbo-bundler.log +2 -2
  177. package/components/datepicker/README.md +4 -4
  178. package/components/datepicker/demo/api.min.js +160 -41
  179. package/components/datepicker/demo/index.min.js +160 -41
  180. package/components/datepicker/dist/auro-datepicker.d.ts.map +1 -1
  181. package/components/datepicker/dist/index.js +160 -41
  182. package/components/datepicker/src/auro-datepicker.js +2 -1
  183. package/components/dropdown/.turbo/turbo-build.log +3 -3
  184. package/components/dropdown/.turbo/turbo-bundler.log +3 -3
  185. package/components/dropdown/README.md +1 -1
  186. package/components/form/.turbo/turbo-build.log +3 -3
  187. package/components/form/.turbo/turbo-bundler.log +3 -3
  188. package/components/form/README.md +1 -1
  189. package/components/input/.turbo/turbo-build.log +3 -3
  190. package/components/input/.turbo/turbo-bundler.log +3 -3
  191. package/components/input/README.md +1 -1
  192. package/components/input/demo/api.min.js +79 -20
  193. package/components/input/demo/index.min.js +79 -20
  194. package/components/input/dist/index.js +79 -20
  195. package/components/menu/.turbo/turbo-build.log +3 -3
  196. package/components/menu/.turbo/turbo-bundler.log +3 -3
  197. package/components/menu/README.md +1 -1
  198. package/components/radio/.turbo/turbo-build.log +3 -3
  199. package/components/radio/.turbo/turbo-bundler.log +3 -3
  200. package/components/radio/README.md +1 -1
  201. package/components/radio/demo/api.min.js +79 -20
  202. package/components/radio/demo/index.min.js +79 -20
  203. package/components/radio/dist/index.js +79 -20
  204. package/components/select/.turbo/turbo-build.log +3 -3
  205. package/components/select/.turbo/turbo-bundler.log +3 -3
  206. package/components/select/README.md +3 -3
  207. package/components/select/demo/api.min.js +79 -20
  208. package/components/select/demo/index.min.js +79 -20
  209. package/components/select/dist/index.js +79 -20
  210. package/package.json +1 -1
  211. package/packages/form-validation/src/validation.js +79 -20
  212. package/packages/utils/package.json +12 -0
  213. package/packages/utils/src/iconUtil.js +25 -0
  214. package/packages/utils/src/index.js +1 -0
  215. package/.turbo/cache/06845874cc82b186-meta.json +0 -1
  216. package/.turbo/cache/06845874cc82b186.tar.zst +0 -0
  217. package/.turbo/cache/0a96f136af026d57-meta.json +0 -1
  218. package/.turbo/cache/0a96f136af026d57.tar.zst +0 -0
  219. package/.turbo/cache/0c9ee13a7c863709-meta.json +0 -1
  220. package/.turbo/cache/0ca9c5ccf3e90704-meta.json +0 -1
  221. package/.turbo/cache/0ca9c5ccf3e90704.tar.zst +0 -0
  222. package/.turbo/cache/1a8d6e4cab38121a-meta.json +0 -1
  223. package/.turbo/cache/2ec1b6d23563659e-meta.json +0 -1
  224. package/.turbo/cache/3afc5b2ea7c1bf51-meta.json +0 -1
  225. package/.turbo/cache/3afc5b2ea7c1bf51.tar.zst +0 -0
  226. package/.turbo/cache/40de011abc31c0cf-meta.json +0 -1
  227. package/.turbo/cache/40de011abc31c0cf.tar.zst +0 -0
  228. package/.turbo/cache/426c825f57054f5f-meta.json +0 -1
  229. package/.turbo/cache/426c825f57054f5f.tar.zst +0 -0
  230. package/.turbo/cache/4524aae614598308-meta.json +0 -1
  231. package/.turbo/cache/4524aae614598308.tar.zst +0 -0
  232. package/.turbo/cache/45ea3e30ae949d53-meta.json +0 -1
  233. package/.turbo/cache/45ea3e30ae949d53.tar.zst +0 -0
  234. package/.turbo/cache/577d86e4072c01f5-meta.json +0 -1
  235. package/.turbo/cache/577d86e4072c01f5.tar.zst +0 -0
  236. package/.turbo/cache/5d770c787aa78d4d-meta.json +0 -1
  237. package/.turbo/cache/5d770c787aa78d4d.tar.zst +0 -0
  238. package/.turbo/cache/624bf5350aacae42-meta.json +0 -1
  239. package/.turbo/cache/66333b75c8f57565-meta.json +0 -1
  240. package/.turbo/cache/66333b75c8f57565.tar.zst +0 -0
  241. package/.turbo/cache/66e9cca767930b1d-meta.json +0 -1
  242. package/.turbo/cache/66e9cca767930b1d.tar.zst +0 -0
  243. package/.turbo/cache/68060c79df03f45a-meta.json +0 -1
  244. package/.turbo/cache/68060c79df03f45a.tar.zst +0 -0
  245. package/.turbo/cache/68e3afb31feab4e9-meta.json +0 -1
  246. package/.turbo/cache/6a1c28febca6163f-meta.json +0 -1
  247. package/.turbo/cache/6bc4e2d881af6ffb-meta.json +0 -1
  248. package/.turbo/cache/6bc4e2d881af6ffb.tar.zst +0 -0
  249. package/.turbo/cache/6c8ea74dc3b07640-meta.json +0 -1
  250. package/.turbo/cache/7a6ef918375d4010-meta.json +0 -1
  251. package/.turbo/cache/7a6ef918375d4010.tar.zst +0 -0
  252. package/.turbo/cache/83e1029b14af6545-meta.json +0 -1
  253. package/.turbo/cache/98936c69a55361fc-meta.json +0 -1
  254. package/.turbo/cache/a3db8f78e018a955-meta.json +0 -1
  255. package/.turbo/cache/ad2b775dd9172ae8-meta.json +0 -1
  256. package/.turbo/cache/ad2b775dd9172ae8.tar.zst +0 -0
  257. package/.turbo/cache/b91d2888e699c76a-meta.json +0 -1
  258. package/.turbo/cache/b91d2888e699c76a.tar.zst +0 -0
  259. package/.turbo/cache/bdc6aadfdbb6feb9-meta.json +0 -1
  260. package/.turbo/cache/be128506a9bcaa65-meta.json +0 -1
  261. package/.turbo/cache/be128506a9bcaa65.tar.zst +0 -0
  262. package/.turbo/cache/c114d428251f56a5-meta.json +0 -1
  263. package/.turbo/cache/c7338727efbc457a-meta.json +0 -1
  264. package/.turbo/cache/c7338727efbc457a.tar.zst +0 -0
  265. package/.turbo/cache/cf235df1ef8d90b0-meta.json +0 -1
  266. package/.turbo/cache/d1d1a072ee099992-meta.json +0 -1
  267. package/.turbo/cache/d9331772756d3d94-meta.json +0 -1
  268. package/.turbo/cache/d9331772756d3d94.tar.zst +0 -0
  269. package/.turbo/cache/dc6fbe2a8d5b9d9b-meta.json +0 -1
  270. package/.turbo/cache/e1e2582a7131011f-meta.json +0 -1
  271. package/.turbo/cache/e6271174c00888fe-meta.json +0 -1
  272. package/.turbo/cache/e8485d2a584b5f08-meta.json +0 -1
  273. package/.turbo/cache/e8485d2a584b5f08.tar.zst +0 -0
  274. package/.turbo/cache/e86451b8f88594b2-meta.json +0 -1
  275. package/.turbo/cache/e86451b8f88594b2.tar.zst +0 -0
  276. package/.turbo/cache/e9872ba002963dd3-meta.json +0 -1
  277. package/.turbo/cache/e9872ba002963dd3.tar.zst +0 -0
  278. /package/.turbo/cache/{e6271174c00888fe.tar.zst → 012997da408d7381.tar.zst} +0 -0
  279. /package/.turbo/cache/{6a1c28febca6163f.tar.zst → 144803363093af6b.tar.zst} +0 -0
  280. /package/.turbo/cache/{0c9ee13a7c863709.tar.zst → 2706814699cff63a.tar.zst} +0 -0
  281. /package/.turbo/cache/{68e3afb31feab4e9.tar.zst → 318a9085a92f2d32.tar.zst} +0 -0
  282. /package/.turbo/cache/{1a8d6e4cab38121a.tar.zst → 457af7906413d2ff.tar.zst} +0 -0
  283. /package/.turbo/cache/{6c8ea74dc3b07640.tar.zst → 5567d6b2fdae56a9.tar.zst} +0 -0
  284. /package/.turbo/cache/{d1d1a072ee099992.tar.zst → 769652d1b874d7cf.tar.zst} +0 -0
  285. /package/.turbo/cache/{bdc6aadfdbb6feb9.tar.zst → 85cc23a2de6b1009.tar.zst} +0 -0
  286. /package/.turbo/cache/{e1e2582a7131011f.tar.zst → a54b4d75b5d265de.tar.zst} +0 -0
  287. /package/.turbo/cache/{83e1029b14af6545.tar.zst → b280ed4daaf15dcb.tar.zst} +0 -0
  288. /package/.turbo/cache/{624bf5350aacae42.tar.zst → d44acd685455b288.tar.zst} +0 -0
  289. /package/.turbo/cache/{cf235df1ef8d90b0.tar.zst → e03997efe5adad43.tar.zst} +0 -0
  290. /package/.turbo/cache/{2ec1b6d23563659e.tar.zst → e820cc8f220a05f3.tar.zst} +0 -0
  291. /package/.turbo/cache/{98936c69a55361fc.tar.zst → fdaf484b1ec4b5ed.tar.zst} +0 -0
@@ -135,30 +135,87 @@ let AuroFormValidation$1 = class AuroFormValidation {
135
135
  }
136
136
 
137
137
  /**
138
- * Determines the validity state of the element based on the common attribute restrictions (pattern).
139
- * @private
140
- * @param {object} elem - HTML element to validate.
138
+ * Validates the attributes of a given element based on predefined validation rules.
139
+ *
140
+ * @param {HTMLElement} elem - The element to be validated.
141
141
  * @returns {void}
142
+ *
143
+ * @example
144
+ * // Assuming `inputElement` is a reference to an input element in the DOM
145
+ * validateElementAttributes(inputElement);
146
+ *
147
+ * The function checks the element's attributes against the validation rules defined for 'input' and 'counter' types.
148
+ * If a validation rule is violated, it sets the element's validity state and error message accordingly.
149
+ *
150
+ * Validation rules:
151
+ * - input:
152
+ * - length:
153
+ * - tooShort: Checks if the value length is less than the minimum length.
154
+ * - tooLong: Checks if the value length exceeds the maximum length.
155
+ * - pattern:
156
+ * - patternMismatch: Checks if the value does not match the specified pattern.
157
+ * - counter:
158
+ * - range:
159
+ * - rangeOverflow: Checks if the value exceeds the maximum value.
160
+ * - rangeUnderflow: Checks if the value is less than the minimum value.
142
161
  */
143
- validateAttributes(elem) {
144
- if (elem.pattern) {
145
- const pattern = new RegExp(`^${elem.pattern}$`, 'u');
146
-
147
- if (!pattern.test(elem.value)) {
148
- elem.validity = 'patternMismatch';
149
- elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
162
+ validateElementAttributes(elem) {
163
+ const validationRules = {
164
+ input: {
165
+ length: [
166
+ {
167
+ check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
168
+ validity: 'tooShort',
169
+ message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
170
+ },
171
+ {
172
+ check: (e) => e.value?.length > e.maxLength,
173
+ validity: 'tooLong',
174
+ message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
175
+ }
176
+ ],
177
+ pattern: [
178
+ {
179
+ check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
180
+ validity: 'patternMismatch',
181
+ message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
182
+ }
183
+ ]
184
+ },
185
+ counter: {
186
+ range: [
187
+ {
188
+ check: (e) => e.max !== undefined && Number(e.max) < Number(e.value),
189
+ validity: 'rangeOverflow',
190
+ message: e => e.getAttribute('setCustomValidityRangeOverflow') || ''
191
+ },
192
+ {
193
+ check: (e) => e.min !== undefined && Number(e.min) > Number(e.value),
194
+ validity: 'rangeUnderflow',
195
+ message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
196
+ }
197
+ ]
150
198
  }
151
- }
152
-
153
- // Length > 0 is required to prevent the error message from showing when the input is empty
154
- if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
155
- elem.validity = 'tooShort';
156
- elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
199
+ };
200
+
201
+ let elementType;
202
+ if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
203
+ elementType = 'input';
204
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
205
+ elementType = 'counter';
157
206
  }
158
207
 
159
- if (elem.value?.length > elem.maxLength) {
160
- elem.validity = 'tooLong';
161
- elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
208
+ if (elementType) {
209
+ const rules = validationRules[elementType];
210
+
211
+ if (rules) {
212
+ Object.values(rules).flat().forEach(rule => {
213
+ if (rule.check(elem)) {
214
+ elem.validity = rule.validity;
215
+ elem.errorMessage = rule.message(elem);
216
+ }
217
+ });
218
+ }
162
219
  }
163
220
  }
164
221
 
@@ -268,7 +325,9 @@ let AuroFormValidation$1 = class AuroFormValidation {
268
325
  elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
269
326
  } else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
270
327
  this.validateType(elem);
271
- this.validateAttributes(elem);
328
+ this.validateElementAttributes(elem);
329
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
330
+ this.validateElementAttributes(elem);
272
331
  }
273
332
  }
274
333
 
@@ -15244,30 +15303,87 @@ class AuroFormValidation {
15244
15303
  }
15245
15304
 
15246
15305
  /**
15247
- * Determines the validity state of the element based on the common attribute restrictions (pattern).
15248
- * @private
15249
- * @param {object} elem - HTML element to validate.
15306
+ * Validates the attributes of a given element based on predefined validation rules.
15307
+ *
15308
+ * @param {HTMLElement} elem - The element to be validated.
15250
15309
  * @returns {void}
15310
+ *
15311
+ * @example
15312
+ * // Assuming `inputElement` is a reference to an input element in the DOM
15313
+ * validateElementAttributes(inputElement);
15314
+ *
15315
+ * The function checks the element's attributes against the validation rules defined for 'input' and 'counter' types.
15316
+ * If a validation rule is violated, it sets the element's validity state and error message accordingly.
15317
+ *
15318
+ * Validation rules:
15319
+ * - input:
15320
+ * - length:
15321
+ * - tooShort: Checks if the value length is less than the minimum length.
15322
+ * - tooLong: Checks if the value length exceeds the maximum length.
15323
+ * - pattern:
15324
+ * - patternMismatch: Checks if the value does not match the specified pattern.
15325
+ * - counter:
15326
+ * - range:
15327
+ * - rangeOverflow: Checks if the value exceeds the maximum value.
15328
+ * - rangeUnderflow: Checks if the value is less than the minimum value.
15251
15329
  */
15252
- validateAttributes(elem) {
15253
- if (elem.pattern) {
15254
- const pattern = new RegExp(`^${elem.pattern}$`, 'u');
15255
-
15256
- if (!pattern.test(elem.value)) {
15257
- elem.validity = 'patternMismatch';
15258
- elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
15330
+ validateElementAttributes(elem) {
15331
+ const validationRules = {
15332
+ input: {
15333
+ length: [
15334
+ {
15335
+ check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
15336
+ validity: 'tooShort',
15337
+ message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
15338
+ },
15339
+ {
15340
+ check: (e) => e.value?.length > e.maxLength,
15341
+ validity: 'tooLong',
15342
+ message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
15343
+ }
15344
+ ],
15345
+ pattern: [
15346
+ {
15347
+ check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
15348
+ validity: 'patternMismatch',
15349
+ message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
15350
+ }
15351
+ ]
15352
+ },
15353
+ counter: {
15354
+ range: [
15355
+ {
15356
+ check: (e) => e.max !== undefined && Number(e.max) < Number(e.value),
15357
+ validity: 'rangeOverflow',
15358
+ message: e => e.getAttribute('setCustomValidityRangeOverflow') || ''
15359
+ },
15360
+ {
15361
+ check: (e) => e.min !== undefined && Number(e.min) > Number(e.value),
15362
+ validity: 'rangeUnderflow',
15363
+ message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
15364
+ }
15365
+ ]
15259
15366
  }
15367
+ };
15368
+
15369
+ let elementType;
15370
+ if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
15371
+ elementType = 'input';
15372
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
15373
+ elementType = 'counter';
15260
15374
  }
15261
-
15262
- // Length > 0 is required to prevent the error message from showing when the input is empty
15263
- if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
15264
- elem.validity = 'tooShort';
15265
- elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
15266
- }
15267
15375
 
15268
- if (elem.value?.length > elem.maxLength) {
15269
- elem.validity = 'tooLong';
15270
- elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
15376
+ if (elementType) {
15377
+ const rules = validationRules[elementType];
15378
+
15379
+ if (rules) {
15380
+ Object.values(rules).flat().forEach(rule => {
15381
+ if (rule.check(elem)) {
15382
+ elem.validity = rule.validity;
15383
+ elem.errorMessage = rule.message(elem);
15384
+ }
15385
+ });
15386
+ }
15271
15387
  }
15272
15388
  }
15273
15389
 
@@ -15377,7 +15493,9 @@ class AuroFormValidation {
15377
15493
  elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
15378
15494
  } else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
15379
15495
  this.validateType(elem);
15380
- this.validateAttributes(elem);
15496
+ this.validateElementAttributes(elem);
15497
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
15498
+ this.validateElementAttributes(elem);
15381
15499
  }
15382
15500
  }
15383
15501
 
@@ -18224,10 +18342,11 @@ class AuroDatePicker extends r$7 {
18224
18342
  if (!this.value || !this.util.validDateStr(this.value)) {
18225
18343
  this.value = newDate;
18226
18344
  } else if (!this.valueEnd || !this.util.validDateStr(this.valueEnd)) {
18227
-
18228
18345
  // verify the date is after this.value to insure we are setting a proper range
18229
18346
  if (new Date(newDate) >= new Date(this.value)) {
18230
18347
  this.valueEnd = newDate;
18348
+ } else {
18349
+ this.value = newDate;
18231
18350
  }
18232
18351
  } else {
18233
18352
  this.value = newDate;
@@ -682,10 +682,11 @@ export class AuroDatePicker extends LitElement {
682
682
  if (!this.value || !this.util.validDateStr(this.value)) {
683
683
  this.value = newDate;
684
684
  } else if (!this.valueEnd || !this.util.validDateStr(this.valueEnd)) {
685
-
686
685
  // verify the date is after this.value to insure we are setting a proper range
687
686
  if (new Date(newDate) >= new Date(this.value)) {
688
687
  this.valueEnd = newDate;
688
+ } else {
689
+ this.value = newDate;
689
690
  }
690
691
  } else {
691
692
  this.value = newDate;
@@ -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 2.1s
93
+ created dist in 1.7s
94
94
  
95
95
  ./demo/index.js → ./demo/...
96
- created ./demo/ in 927ms
96
+ created ./demo/ in 1s
97
97
  
98
98
  ./demo/api.js → ./demo/...
99
- created ./demo/ in 977ms
99
+ created ./demo/ in 1.2s
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
@@ -4,10 +4,10 @@
4
4
 
5
5
  
6
6
  ./src/index.js → dist...
7
- created dist in 2.5s
7
+ created dist in 1.8s
8
8
  
9
9
  ./demo/index.js → ./demo/...
10
- created ./demo/ in 1.3s
10
+ created ./demo/ in 1s
11
11
  
12
12
  ./demo/api.js → ./demo/...
13
- created ./demo/ in 1s
13
+ created ./demo/ in 1.1s
@@ -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.6/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.8/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 463ms
72
+ created dist in 649ms
73
73
  
74
74
  ./demo/index.js → ./demo/...
75
- created ./demo/ in 436ms
75
+ created ./demo/ in 330ms
76
76
  
77
77
  ./demo/api.js → ./demo/...
78
- created ./demo/ in 444ms
78
+ created ./demo/ in 339ms
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 585ms
7
+ created dist in 872ms
8
8
  
9
9
  ./demo/index.js → ./demo/...
10
- created ./demo/ in 370ms
10
+ created ./demo/ in 450ms
11
11
  
12
12
  ./demo/api.js → ./demo/...
13
- created ./demo/ in 286ms
13
+ created ./demo/ in 444ms
@@ -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.12.1/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-form@2.0.0-beta.6/dist/auro-form__bundled.js" type="module"></script>
100
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-form@2.0.0-beta.8/dist/auro-form__bundled.js" type="module"></script>
101
101
  <!-- AURO-GENERATED-CONTENT:END -->
102
102
 
103
103
  ## auro-form use cases
@@ -216,13 +216,13 @@ More info and automated migrator: https://sass-lang.com/d/import
216
216
 
217
217
  
218
218
  ./src/index.js → dist...
219
- created dist in 2.1s
219
+ created dist in 2s
220
220
  
221
221
  ./demo/index.js → ./demo/...
222
- created ./demo/ in 1.4s
222
+ created ./demo/ in 1.6s
223
223
  
224
224
  ./demo/api.js → ./demo/...
225
- created ./demo/ in 852ms
225
+ created ./demo/ in 1.8s
226
226
 
227
227
  > @aurodesignsystem/auro-input@4.2.0 build:docs
228
228
  > wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component input
@@ -4,10 +4,10 @@
4
4
 
5
5
  
6
6
  ./src/index.js → dist...
7
- created dist in 2.1s
7
+ created dist in 1.8s
8
8
  
9
9
  ./demo/index.js → ./demo/...
10
- created ./demo/ in 1.5s
10
+ created ./demo/ in 1.1s
11
11
  
12
12
  ./demo/api.js → ./demo/...
13
- created ./demo/ in 1.1s
13
+ created ./demo/ in 1.3s
@@ -89,7 +89,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
89
89
  <!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
90
90
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
91
91
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
92
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-input@2.0.0-beta.6/dist/auro-input__bundled.js" type="module"></script>
92
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-input@2.0.0-beta.8/dist/auro-input__bundled.js" type="module"></script>
93
93
  <!-- AURO-GENERATED-CONTENT:END -->
94
94
 
95
95
  ## auro-input use cases
@@ -1912,30 +1912,87 @@ class AuroFormValidation {
1912
1912
  }
1913
1913
 
1914
1914
  /**
1915
- * Determines the validity state of the element based on the common attribute restrictions (pattern).
1916
- * @private
1917
- * @param {object} elem - HTML element to validate.
1915
+ * Validates the attributes of a given element based on predefined validation rules.
1916
+ *
1917
+ * @param {HTMLElement} elem - The element to be validated.
1918
1918
  * @returns {void}
1919
+ *
1920
+ * @example
1921
+ * // Assuming `inputElement` is a reference to an input element in the DOM
1922
+ * validateElementAttributes(inputElement);
1923
+ *
1924
+ * The function checks the element's attributes against the validation rules defined for 'input' and 'counter' types.
1925
+ * If a validation rule is violated, it sets the element's validity state and error message accordingly.
1926
+ *
1927
+ * Validation rules:
1928
+ * - input:
1929
+ * - length:
1930
+ * - tooShort: Checks if the value length is less than the minimum length.
1931
+ * - tooLong: Checks if the value length exceeds the maximum length.
1932
+ * - pattern:
1933
+ * - patternMismatch: Checks if the value does not match the specified pattern.
1934
+ * - counter:
1935
+ * - range:
1936
+ * - rangeOverflow: Checks if the value exceeds the maximum value.
1937
+ * - rangeUnderflow: Checks if the value is less than the minimum value.
1919
1938
  */
1920
- validateAttributes(elem) {
1921
- if (elem.pattern) {
1922
- const pattern = new RegExp(`^${elem.pattern}$`, 'u');
1923
-
1924
- if (!pattern.test(elem.value)) {
1925
- elem.validity = 'patternMismatch';
1926
- elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
1939
+ validateElementAttributes(elem) {
1940
+ const validationRules = {
1941
+ input: {
1942
+ length: [
1943
+ {
1944
+ check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
1945
+ validity: 'tooShort',
1946
+ message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
1947
+ },
1948
+ {
1949
+ check: (e) => e.value?.length > e.maxLength,
1950
+ validity: 'tooLong',
1951
+ message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
1952
+ }
1953
+ ],
1954
+ pattern: [
1955
+ {
1956
+ check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
1957
+ validity: 'patternMismatch',
1958
+ message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
1959
+ }
1960
+ ]
1961
+ },
1962
+ counter: {
1963
+ range: [
1964
+ {
1965
+ check: (e) => e.max !== undefined && Number(e.max) < Number(e.value),
1966
+ validity: 'rangeOverflow',
1967
+ message: e => e.getAttribute('setCustomValidityRangeOverflow') || ''
1968
+ },
1969
+ {
1970
+ check: (e) => e.min !== undefined && Number(e.min) > Number(e.value),
1971
+ validity: 'rangeUnderflow',
1972
+ message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
1973
+ }
1974
+ ]
1927
1975
  }
1976
+ };
1977
+
1978
+ let elementType;
1979
+ if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
1980
+ elementType = 'input';
1981
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
1982
+ elementType = 'counter';
1928
1983
  }
1929
-
1930
- // Length > 0 is required to prevent the error message from showing when the input is empty
1931
- if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
1932
- elem.validity = 'tooShort';
1933
- elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
1934
- }
1935
1984
 
1936
- if (elem.value?.length > elem.maxLength) {
1937
- elem.validity = 'tooLong';
1938
- elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
1985
+ if (elementType) {
1986
+ const rules = validationRules[elementType];
1987
+
1988
+ if (rules) {
1989
+ Object.values(rules).flat().forEach(rule => {
1990
+ if (rule.check(elem)) {
1991
+ elem.validity = rule.validity;
1992
+ elem.errorMessage = rule.message(elem);
1993
+ }
1994
+ });
1995
+ }
1939
1996
  }
1940
1997
  }
1941
1998
 
@@ -2045,7 +2102,9 @@ class AuroFormValidation {
2045
2102
  elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
2046
2103
  } else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
2047
2104
  this.validateType(elem);
2048
- this.validateAttributes(elem);
2105
+ this.validateElementAttributes(elem);
2106
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
2107
+ this.validateElementAttributes(elem);
2049
2108
  }
2050
2109
  }
2051
2110
 
@@ -1850,30 +1850,87 @@ class AuroFormValidation {
1850
1850
  }
1851
1851
 
1852
1852
  /**
1853
- * Determines the validity state of the element based on the common attribute restrictions (pattern).
1854
- * @private
1855
- * @param {object} elem - HTML element to validate.
1853
+ * Validates the attributes of a given element based on predefined validation rules.
1854
+ *
1855
+ * @param {HTMLElement} elem - The element to be validated.
1856
1856
  * @returns {void}
1857
+ *
1858
+ * @example
1859
+ * // Assuming `inputElement` is a reference to an input element in the DOM
1860
+ * validateElementAttributes(inputElement);
1861
+ *
1862
+ * The function checks the element's attributes against the validation rules defined for 'input' and 'counter' types.
1863
+ * If a validation rule is violated, it sets the element's validity state and error message accordingly.
1864
+ *
1865
+ * Validation rules:
1866
+ * - input:
1867
+ * - length:
1868
+ * - tooShort: Checks if the value length is less than the minimum length.
1869
+ * - tooLong: Checks if the value length exceeds the maximum length.
1870
+ * - pattern:
1871
+ * - patternMismatch: Checks if the value does not match the specified pattern.
1872
+ * - counter:
1873
+ * - range:
1874
+ * - rangeOverflow: Checks if the value exceeds the maximum value.
1875
+ * - rangeUnderflow: Checks if the value is less than the minimum value.
1857
1876
  */
1858
- validateAttributes(elem) {
1859
- if (elem.pattern) {
1860
- const pattern = new RegExp(`^${elem.pattern}$`, 'u');
1861
-
1862
- if (!pattern.test(elem.value)) {
1863
- elem.validity = 'patternMismatch';
1864
- elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
1877
+ validateElementAttributes(elem) {
1878
+ const validationRules = {
1879
+ input: {
1880
+ length: [
1881
+ {
1882
+ check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
1883
+ validity: 'tooShort',
1884
+ message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
1885
+ },
1886
+ {
1887
+ check: (e) => e.value?.length > e.maxLength,
1888
+ validity: 'tooLong',
1889
+ message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
1890
+ }
1891
+ ],
1892
+ pattern: [
1893
+ {
1894
+ check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
1895
+ validity: 'patternMismatch',
1896
+ message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
1897
+ }
1898
+ ]
1899
+ },
1900
+ counter: {
1901
+ range: [
1902
+ {
1903
+ check: (e) => e.max !== undefined && Number(e.max) < Number(e.value),
1904
+ validity: 'rangeOverflow',
1905
+ message: e => e.getAttribute('setCustomValidityRangeOverflow') || ''
1906
+ },
1907
+ {
1908
+ check: (e) => e.min !== undefined && Number(e.min) > Number(e.value),
1909
+ validity: 'rangeUnderflow',
1910
+ message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
1911
+ }
1912
+ ]
1865
1913
  }
1866
- }
1867
-
1868
- // Length > 0 is required to prevent the error message from showing when the input is empty
1869
- if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
1870
- elem.validity = 'tooShort';
1871
- elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
1914
+ };
1915
+
1916
+ let elementType;
1917
+ if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
1918
+ elementType = 'input';
1919
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
1920
+ elementType = 'counter';
1872
1921
  }
1873
1922
 
1874
- if (elem.value?.length > elem.maxLength) {
1875
- elem.validity = 'tooLong';
1876
- elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
1923
+ if (elementType) {
1924
+ const rules = validationRules[elementType];
1925
+
1926
+ if (rules) {
1927
+ Object.values(rules).flat().forEach(rule => {
1928
+ if (rule.check(elem)) {
1929
+ elem.validity = rule.validity;
1930
+ elem.errorMessage = rule.message(elem);
1931
+ }
1932
+ });
1933
+ }
1877
1934
  }
1878
1935
  }
1879
1936
 
@@ -1983,7 +2040,9 @@ class AuroFormValidation {
1983
2040
  elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
1984
2041
  } else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
1985
2042
  this.validateType(elem);
1986
- this.validateAttributes(elem);
2043
+ this.validateElementAttributes(elem);
2044
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
2045
+ this.validateElementAttributes(elem);
1987
2046
  }
1988
2047
  }
1989
2048