@esri/calcite-components 5.1.0-next.3 → 5.1.0-next.30

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 (462) hide show
  1. package/dist/cdn/2I24Q6HG.js +2 -0
  2. package/dist/cdn/2LUMWQZY.js +2 -0
  3. package/dist/cdn/{QOXTJ7PA.js → 34WUOWO6.js} +1 -1
  4. package/dist/cdn/{6C5JMRKM.js → 3FXLCXEF.js} +1 -1
  5. package/dist/cdn/3LVPP52S.js +2 -0
  6. package/dist/cdn/3UU6PUEZ.js +2 -0
  7. package/dist/cdn/{RHJW4CXA.js → 46XYBXSA.js} +1 -1
  8. package/dist/cdn/{LCPYWUGK.js → 47ZWM6SP.js} +1 -1
  9. package/dist/cdn/4CGPBRFI.js +2 -0
  10. package/dist/cdn/{EQ4Z4LBA.js → 4RP3OGCP.js} +1 -1
  11. package/dist/cdn/{X6LSQXQT.js → 57CIL36H.js} +1 -1
  12. package/dist/cdn/{SQLDNSI6.js → 5DEP6UL7.js} +1 -1
  13. package/dist/cdn/5DEXYRFH.js +2 -0
  14. package/dist/cdn/66BQUAEF.js +2 -0
  15. package/dist/cdn/6742QPEE.js +2 -0
  16. package/dist/cdn/6FSL67XJ.js +2 -0
  17. package/dist/cdn/{IZBELXZC.js → 6KMNIG3H.js} +1 -1
  18. package/dist/cdn/{B4VMCAZI.js → 6LODJ26H.js} +1 -1
  19. package/dist/cdn/74EOXSPH.js +2 -0
  20. package/dist/cdn/7GTG7SUF.js +2 -0
  21. package/dist/cdn/7I5EKIDO.js +2 -0
  22. package/dist/cdn/7Q6FVOSE.js +2 -0
  23. package/dist/cdn/7WMQKIBY.js +2 -0
  24. package/dist/cdn/7YQW7B7E.js +2 -0
  25. package/dist/cdn/7ZBXJRPO.js +2 -0
  26. package/dist/cdn/{ECURCDZ2.js → A7RILTOO.js} +1 -1
  27. package/dist/cdn/AFGHAQUQ.js +2 -0
  28. package/dist/cdn/{QGBPRJIT.js → AHEDZHQ2.js} +1 -1
  29. package/dist/cdn/AJTOSFDH.js +2 -0
  30. package/dist/cdn/AOP3NH2U.js +2 -0
  31. package/dist/cdn/{D3ZA3ZSE.js → AOQ34WQ6.js} +1 -1
  32. package/dist/cdn/AQNYPIPX.js +2 -0
  33. package/dist/cdn/ARNANVZZ.js +2 -0
  34. package/dist/cdn/AVYPI52K.js +2 -0
  35. package/dist/cdn/B3EBGYCI.js +2 -0
  36. package/dist/cdn/{2EN543JD.js → BS547LGW.js} +1 -1
  37. package/dist/cdn/{KHE57SV3.js → BXIBMOE6.js} +1 -1
  38. package/dist/cdn/BYS4GNCX.js +2 -0
  39. package/dist/cdn/{YX5LYAIV.js → C32S4HGX.js} +1 -1
  40. package/dist/cdn/CBWGCOIO.js +2 -0
  41. package/dist/cdn/{XLOC3L55.js → CJQWESQ2.js} +3 -3
  42. package/dist/cdn/CJTB2G5O.js +2 -0
  43. package/dist/cdn/CNQVNMR7.js +2 -0
  44. package/dist/cdn/CPIWY5GX.js +2 -0
  45. package/dist/cdn/D3G4KNL4.js +2 -0
  46. package/dist/cdn/{EHIAXJAL.js → DCWL5FUH.js} +1 -1
  47. package/dist/cdn/DDDUIVNA.js +2 -0
  48. package/dist/cdn/{I5LZP3DC.js → DJ5TODX7.js} +1 -1
  49. package/dist/cdn/{IF5AIFNS.js → DQJ3PS72.js} +1 -1
  50. package/dist/cdn/DSY7BOJJ.js +2 -0
  51. package/dist/cdn/{VZDUTHQS.js → DUYCNBSR.js} +1 -1
  52. package/dist/cdn/DWIB4FVP.js +2 -0
  53. package/dist/cdn/E3OAYCPO.js +2 -0
  54. package/dist/cdn/{EYR3DX5M.js → EHTWHFIN.js} +1 -1
  55. package/dist/cdn/EUJFL2WJ.js +2 -0
  56. package/dist/cdn/{NPTVRXRO.js → F6O2MDAB.js} +1 -1
  57. package/dist/cdn/FBBEDCIC.js +2 -0
  58. package/dist/cdn/{N5SFF63Q.js → FIGNBXC4.js} +1 -1
  59. package/dist/cdn/{R265ZYQR.js → FS3FIZQ7.js} +1 -1
  60. package/dist/cdn/G5IYZRZD.js +2 -0
  61. package/dist/cdn/GBL55CBG.js +2 -0
  62. package/dist/cdn/GEWRKDNT.js +2 -0
  63. package/dist/cdn/{RTSHUMUI.js → GLYCZM27.js} +1 -1
  64. package/dist/cdn/{ULGKAMEK.js → GNUO7A4Y.js} +1 -1
  65. package/dist/cdn/H43C4DT4.js +2 -0
  66. package/dist/cdn/H4ESHMLA.js +2 -0
  67. package/dist/cdn/H5G45SF4.js +2 -0
  68. package/dist/cdn/{WUW46I4S.js → HDQ72ZNE.js} +1 -1
  69. package/dist/cdn/HIHNC2W6.js +2 -0
  70. package/dist/cdn/HKSMMZUW.js +2 -0
  71. package/dist/cdn/{TG6MK4QD.js → HWBVGZHG.js} +1 -1
  72. package/dist/cdn/HXIVUHZU.js +2 -0
  73. package/dist/cdn/ICNEOIAY.js +2 -0
  74. package/dist/cdn/{4ILCK5CI.js → IDJOHYLJ.js} +1 -1
  75. package/dist/cdn/{GIV3RH7X.js → ITD5YGM3.js} +1 -1
  76. package/dist/cdn/J3P6S2E2.js +2 -0
  77. package/dist/cdn/JEALIYFT.js +2 -0
  78. package/dist/cdn/JPDWZDO2.js +2 -0
  79. package/dist/cdn/JPE6LVAD.js +2 -0
  80. package/dist/cdn/{YKP66AQ5.js → JWEKZH6L.js} +1 -1
  81. package/dist/cdn/KI33EXTI.js +2 -0
  82. package/dist/cdn/{LJIHBKNI.js → KJIYAJA4.js} +1 -1
  83. package/dist/cdn/KW4BHBBW.js +2 -0
  84. package/dist/cdn/{4ZGFXXYL.js → L7DEPZAJ.js} +1 -1
  85. package/dist/cdn/{4NDBPQOW.js → L7TOPWGR.js} +1 -1
  86. package/dist/cdn/LK7OAPDO.js +2 -0
  87. package/dist/cdn/{KBSNJSUL.js → LOJGQFL6.js} +1 -1
  88. package/dist/cdn/{HFPBP7XA.js → LTDQ3KMS.js} +1 -1
  89. package/dist/cdn/{732QLUKT.js → LVZ24HEK.js} +1 -1
  90. package/dist/cdn/{QQYOGIVS.js → M6TXECYZ.js} +1 -1
  91. package/dist/cdn/MORUF5PU.js +2 -0
  92. package/dist/cdn/{RMERVJA5.js → MPGZXCBO.js} +1 -1
  93. package/dist/cdn/{XGISY6QA.js → MWS2HEQR.js} +1 -1
  94. package/dist/cdn/{3ZYN3227.js → MXDC3OC2.js} +1 -1
  95. package/dist/cdn/{3GV45XL7.js → MYDCGCGV.js} +1 -1
  96. package/dist/cdn/{HJ45IHRA.js → NWCFNDM2.js} +1 -1
  97. package/dist/cdn/{RRN6YM7F.js → NWIU5L4M.js} +1 -1
  98. package/dist/cdn/NYL2Z7AD.js +2 -0
  99. package/dist/cdn/{LKHFQ3U6.js → O5WPS55F.js} +1 -1
  100. package/dist/cdn/{FXFRKJEJ.js → ODAV2DWN.js} +1 -1
  101. package/dist/cdn/OGQ6UAE2.js +2 -0
  102. package/dist/cdn/OLXLHWGL.js +2 -0
  103. package/dist/cdn/{RBGGE65K.js → P2ZPFKR7.js} +1 -1
  104. package/dist/cdn/{LDLJRK76.js → P32KQQAD.js} +1 -1
  105. package/dist/cdn/{ZJ34LWXC.js → QAG6VFG2.js} +1 -1
  106. package/dist/cdn/QRH3LFLT.js +2 -0
  107. package/dist/cdn/{MSGQMPT6.js → QVMVZTAX.js} +1 -1
  108. package/dist/cdn/QXFX3OAF.js +2 -0
  109. package/dist/cdn/{YQST67WD.js → R2DCCWBB.js} +1 -1
  110. package/dist/cdn/R3Z5LCK3.js +2 -0
  111. package/dist/cdn/RFQSI4MJ.js +2 -0
  112. package/dist/cdn/RNFEU4JP.js +2 -0
  113. package/dist/cdn/{DKD23HP3.js → RRVD3RYN.js} +1 -1
  114. package/dist/cdn/{N234JPQQ.js → S6WMWFN7.js} +1 -1
  115. package/dist/cdn/{6KLHDA5V.js → SAK5TSCY.js} +1 -1
  116. package/dist/cdn/SMHE5GTR.js +2 -0
  117. package/dist/cdn/{2HPKL5UL.js → STISOSDG.js} +1 -1
  118. package/dist/cdn/TRMTKJYB.js +2 -0
  119. package/dist/cdn/TTFYMTZC.js +2 -0
  120. package/dist/cdn/{XRVUSKBQ.js → TWHGJHW2.js} +1 -1
  121. package/dist/cdn/TXRNHBI5.js +2 -0
  122. package/dist/cdn/{WTL6TTVY.js → TZAUE2UM.js} +1 -1
  123. package/dist/cdn/UESKV37D.js +2 -0
  124. package/dist/cdn/UQC63ORI.js +2 -0
  125. package/dist/cdn/{SDDDIVHA.js → UYAS53RY.js} +1 -1
  126. package/dist/cdn/{ILHS3TD7.js → V4RO7LWG.js} +1 -1
  127. package/dist/cdn/VE3ULCBL.js +2 -0
  128. package/dist/cdn/{EPKWV7TT.js → VIB4WBRW.js} +1 -1
  129. package/dist/cdn/{7CVLFVE5.js → VL7C7DUX.js} +1 -1
  130. package/dist/cdn/{MTIRRGHA.js → WMWPUGOP.js} +1 -1
  131. package/dist/cdn/{4PZDI5YW.js → WN6LIOTB.js} +1 -1
  132. package/dist/cdn/{UQBN3Z6H.js → WQOYAKXN.js} +1 -1
  133. package/dist/cdn/{UG6FM2IU.js → WUPDOPI3.js} +1 -1
  134. package/dist/cdn/{PNBC2B77.js → X4CROIR6.js} +1 -1
  135. package/dist/cdn/X62QRK2A.js +2 -0
  136. package/dist/cdn/{A26SXPLB.js → XOT64MSN.js} +1 -1
  137. package/dist/cdn/{SK7CWKMU.js → XS5BO3QC.js} +1 -1
  138. package/dist/cdn/XWGKICAS.js +2 -0
  139. package/dist/cdn/{FUL4JV2P.js → YRHSBDX4.js} +1 -1
  140. package/dist/cdn/{GY6M2LPM.js → YSWTVICN.js} +1 -1
  141. package/dist/cdn/Z445ZVWS.js +2 -0
  142. package/dist/cdn/{U63GYZ74.js → Z5FNOUD3.js} +2 -2
  143. package/dist/cdn/ZC6A5OHK.js +2 -0
  144. package/dist/cdn/{Z2R5VRT7.js → ZHZF3WW4.js} +1 -1
  145. package/dist/cdn/assets/combobox/t9n/messages.ar.json +1 -1
  146. package/dist/cdn/assets/combobox/t9n/messages.bg.json +1 -1
  147. package/dist/cdn/assets/combobox/t9n/messages.bs.json +1 -1
  148. package/dist/cdn/assets/combobox/t9n/messages.ca.json +1 -1
  149. package/dist/cdn/assets/combobox/t9n/messages.cs.json +1 -1
  150. package/dist/cdn/assets/combobox/t9n/messages.da.json +1 -1
  151. package/dist/cdn/assets/combobox/t9n/messages.de.json +1 -1
  152. package/dist/cdn/assets/combobox/t9n/messages.el.json +1 -1
  153. package/dist/cdn/assets/combobox/t9n/messages.en.json +1 -1
  154. package/dist/cdn/assets/combobox/t9n/messages.es.json +1 -1
  155. package/dist/cdn/assets/combobox/t9n/messages.et.json +1 -1
  156. package/dist/cdn/assets/combobox/t9n/messages.fi.json +1 -1
  157. package/dist/cdn/assets/combobox/t9n/messages.fr.json +1 -1
  158. package/dist/cdn/assets/combobox/t9n/messages.he.json +1 -1
  159. package/dist/cdn/assets/combobox/t9n/messages.hr.json +1 -1
  160. package/dist/cdn/assets/combobox/t9n/messages.hu.json +1 -1
  161. package/dist/cdn/assets/combobox/t9n/messages.id.json +1 -1
  162. package/dist/cdn/assets/combobox/t9n/messages.it.json +1 -1
  163. package/dist/cdn/assets/combobox/t9n/messages.ja.json +1 -1
  164. package/dist/cdn/assets/combobox/t9n/messages.json +1 -1
  165. package/dist/cdn/assets/combobox/t9n/messages.ko.json +1 -1
  166. package/dist/cdn/assets/combobox/t9n/messages.lt.json +1 -1
  167. package/dist/cdn/assets/combobox/t9n/messages.lv.json +1 -1
  168. package/dist/cdn/assets/combobox/t9n/messages.nl.json +1 -1
  169. package/dist/cdn/assets/combobox/t9n/messages.no.json +1 -1
  170. package/dist/cdn/assets/combobox/t9n/messages.pl.json +1 -1
  171. package/dist/cdn/assets/combobox/t9n/messages.pt-BR.json +1 -1
  172. package/dist/cdn/assets/combobox/t9n/messages.pt-PT.json +1 -1
  173. package/dist/cdn/assets/combobox/t9n/messages.ro.json +1 -1
  174. package/dist/cdn/assets/combobox/t9n/messages.ru.json +1 -1
  175. package/dist/cdn/assets/combobox/t9n/messages.sk.json +1 -1
  176. package/dist/cdn/assets/combobox/t9n/messages.sl.json +1 -1
  177. package/dist/cdn/assets/combobox/t9n/messages.sr.json +1 -1
  178. package/dist/cdn/assets/combobox/t9n/messages.sv.json +1 -1
  179. package/dist/cdn/assets/combobox/t9n/messages.th.json +1 -1
  180. package/dist/cdn/assets/combobox/t9n/messages.tr.json +1 -1
  181. package/dist/cdn/assets/combobox/t9n/messages.uk.json +1 -1
  182. package/dist/cdn/assets/combobox/t9n/messages.vi.json +1 -1
  183. package/dist/cdn/assets/combobox/t9n/messages.zh-CN.json +1 -1
  184. package/dist/cdn/assets/combobox/t9n/messages.zh-HK.json +1 -1
  185. package/dist/cdn/assets/combobox/t9n/messages.zh-TW.json +1 -1
  186. package/dist/cdn/assets/icon/arcgisQuickcapture16.json +1 -0
  187. package/dist/cdn/assets/icon/arcgisQuickcapture24.json +1 -0
  188. package/dist/cdn/assets/icon/arcgisQuickcapture32.json +1 -0
  189. package/dist/cdn/assets/icon/arcgisSurvey12316.json +1 -0
  190. package/dist/cdn/assets/icon/arcgisSurvey12324.json +1 -0
  191. package/dist/cdn/assets/icon/arcgisSurvey12332.json +1 -0
  192. package/dist/cdn/assets/icon/layerStreamSetting16.json +1 -0
  193. package/dist/cdn/assets/icon/layerStreamSetting24.json +1 -0
  194. package/dist/cdn/assets/icon/layerStreamSetting32.json +1 -0
  195. package/dist/cdn/assets/icon/publish16.json +1 -0
  196. package/dist/cdn/assets/icon/publish24.json +1 -0
  197. package/dist/cdn/assets/icon/publish32.json +1 -0
  198. package/dist/cdn/assets/icon/velocityServer16.json +1 -0
  199. package/dist/cdn/assets/icon/velocityServer24.json +1 -0
  200. package/dist/cdn/assets/icon/velocityServer32.json +1 -0
  201. package/dist/cdn/index.js +1 -1
  202. package/dist/chunks/ExpandToggle.js +4 -5
  203. package/dist/chunks/Heading.js +3 -3
  204. package/dist/chunks/dom.js +23 -28
  205. package/dist/chunks/floating-ui.js +3 -6
  206. package/dist/chunks/label.js +1 -1
  207. package/dist/chunks/locale.js +29 -12
  208. package/dist/chunks/manager.js +505 -0
  209. package/dist/chunks/openCloseComponent.js +1 -1
  210. package/dist/chunks/resources5.js +2 -1
  211. package/dist/chunks/resources6.js +2 -0
  212. package/dist/chunks/runtime.js +4 -4
  213. package/dist/chunks/useFocusTrap.js +1 -1
  214. package/dist/chunks/useForm.js +294 -0
  215. package/dist/chunks/useFormTrigger.js +25 -0
  216. package/dist/chunks/useSetFocus.js +1 -1
  217. package/dist/chunks/{sortableComponent.js → useSortable.js} +67 -44
  218. package/dist/chunks/utils2.js +1 -1
  219. package/dist/components/calcite-accordion-item/customElement.d.ts +6 -6
  220. package/dist/components/calcite-accordion-item/customElement.js +4 -3
  221. package/dist/components/calcite-action/customElement.d.ts +12 -12
  222. package/dist/components/calcite-action/customElement.js +7 -13
  223. package/dist/components/calcite-action-bar/customElement.d.ts +20 -4
  224. package/dist/components/calcite-action-bar/customElement.js +43 -15
  225. package/dist/components/calcite-action-group/customElement.d.ts +6 -6
  226. package/dist/components/calcite-action-menu/customElement.d.ts +2 -2
  227. package/dist/components/calcite-action-pad/customElement.d.ts +3 -3
  228. package/dist/components/calcite-action-pad/customElement.js +5 -3
  229. package/dist/components/calcite-alert/customElement.d.ts +2 -2
  230. package/dist/components/calcite-alert/customElement.js +2 -2
  231. package/dist/components/calcite-autocomplete/customElement.d.ts +11 -12
  232. package/dist/components/calcite-autocomplete/customElement.js +23 -32
  233. package/dist/components/calcite-autocomplete-item/customElement.d.ts +6 -0
  234. package/dist/components/calcite-autocomplete-item/customElement.js +9 -4
  235. package/dist/components/calcite-avatar/customElement.js +1 -1
  236. package/dist/components/calcite-block/customElement.d.ts +5 -5
  237. package/dist/components/calcite-block/customElement.js +2 -2
  238. package/dist/components/calcite-block-group/customElement.d.ts +1 -1
  239. package/dist/components/calcite-block-group/customElement.js +4 -4
  240. package/dist/components/calcite-block-group/interfaces.d.ts +2 -6
  241. package/dist/components/calcite-block-section/customElement.d.ts +1 -1
  242. package/dist/components/calcite-button/customElement.d.ts +5 -5
  243. package/dist/components/calcite-button/customElement.js +11 -23
  244. package/dist/components/calcite-card/customElement.d.ts +4 -4
  245. package/dist/components/calcite-card-group/customElement.d.ts +2 -2
  246. package/dist/components/calcite-carousel/customElement.d.ts +1 -1
  247. package/dist/components/calcite-carousel/customElement.js +27 -25
  248. package/dist/components/calcite-checkbox/customElement.d.ts +4 -5
  249. package/dist/components/calcite-checkbox/customElement.js +10 -23
  250. package/dist/components/calcite-chip/customElement.d.ts +2 -2
  251. package/dist/components/calcite-chip/customElement.js +1 -1
  252. package/dist/components/calcite-chip-group/customElement.d.ts +1 -1
  253. package/dist/components/calcite-chip-group/customElement.js +1 -1
  254. package/dist/components/calcite-color-picker/customElement.d.ts +2 -2
  255. package/dist/components/calcite-color-picker/customElement.js +4 -2
  256. package/dist/components/calcite-color-picker-hex-input/customElement.d.ts +1 -1
  257. package/dist/components/calcite-color-picker-swatch/customElement.d.ts +1 -1
  258. package/dist/components/calcite-color-picker-swatch/customElement.js +1 -1
  259. package/dist/components/calcite-combobox/customElement.d.ts +16 -6
  260. package/dist/components/calcite-combobox/customElement.js +151 -60
  261. package/dist/components/calcite-combobox-item/customElement.d.ts +1 -1
  262. package/dist/components/calcite-combobox-item/customElement.js +10 -4
  263. package/dist/components/calcite-date-picker/customElement.d.ts +1 -1
  264. package/dist/components/calcite-date-picker-day/customElement.d.ts +1 -1
  265. package/dist/components/calcite-date-picker-month/customElement.js +1 -1
  266. package/dist/components/calcite-date-picker-month-header/customElement.js +1 -1
  267. package/dist/components/calcite-dialog/customElement.d.ts +7 -3
  268. package/dist/components/calcite-dialog/customElement.js +5 -3
  269. package/dist/components/calcite-dropdown/customElement.d.ts +15 -5
  270. package/dist/components/calcite-dropdown/customElement.js +168 -90
  271. package/dist/components/calcite-dropdown-item/customElement.d.ts +2 -2
  272. package/dist/components/calcite-dropdown-item/customElement.js +14 -32
  273. package/dist/components/calcite-fab/customElement.d.ts +1 -1
  274. package/dist/components/calcite-filter/customElement.d.ts +1 -1
  275. package/dist/components/calcite-flow/customElement.d.ts +1 -1
  276. package/dist/components/calcite-flow-item/customElement.d.ts +9 -5
  277. package/dist/components/calcite-flow-item/customElement.js +7 -5
  278. package/dist/components/calcite-handle/customElement.d.ts +1 -1
  279. package/dist/components/calcite-icon/customElement.d.ts +1 -1
  280. package/dist/components/calcite-icon/customElement.js +4 -3
  281. package/dist/components/calcite-inline-editable/customElement.d.ts +1 -1
  282. package/dist/components/calcite-inline-editable/customElement.js +1 -1
  283. package/dist/components/calcite-input/customElement.d.ts +17 -18
  284. package/dist/components/calcite-input/customElement.js +20 -42
  285. package/dist/components/calcite-input-date-picker/customElement.d.ts +6 -7
  286. package/dist/components/calcite-input-date-picker/customElement.js +34 -28
  287. package/dist/components/calcite-input-message/customElement.d.ts +1 -1
  288. package/dist/components/calcite-input-message/customElement.js +1 -1
  289. package/dist/components/calcite-input-number/customElement.d.ts +13 -14
  290. package/dist/components/calcite-input-number/customElement.js +17 -42
  291. package/dist/components/calcite-input-text/customElement.d.ts +11 -12
  292. package/dist/components/calcite-input-text/customElement.js +16 -41
  293. package/dist/components/calcite-input-time-picker/customElement.d.ts +6 -7
  294. package/dist/components/calcite-input-time-picker/customElement.js +14 -25
  295. package/dist/components/calcite-input-time-zone/customElement.d.ts +5 -6
  296. package/dist/components/calcite-input-time-zone/customElement.js +21 -19
  297. package/dist/components/calcite-link/customElement.d.ts +2 -2
  298. package/dist/components/calcite-link/customElement.js +4 -3
  299. package/dist/components/calcite-list/customElement.d.ts +1 -1
  300. package/dist/components/calcite-list/customElement.js +29 -7
  301. package/dist/components/calcite-list/interfaces.d.ts +2 -6
  302. package/dist/components/calcite-list-item/customElement.d.ts +2 -2
  303. package/dist/components/calcite-list-item/customElement.js +6 -4
  304. package/dist/components/calcite-list-item-group/customElement.js +1 -1
  305. package/dist/components/calcite-loader/customElement.d.ts +1 -1
  306. package/dist/components/calcite-menu/customElement.d.ts +1 -1
  307. package/dist/components/calcite-menu/customElement.js +1 -1
  308. package/dist/components/calcite-menu-item/customElement.d.ts +3 -3
  309. package/dist/components/calcite-menu-item/customElement.js +4 -2
  310. package/dist/components/calcite-meter/customElement.d.ts +7 -1
  311. package/dist/components/calcite-meter/customElement.js +4 -8
  312. package/dist/components/calcite-navigation/customElement.d.ts +2 -2
  313. package/dist/components/calcite-navigation-logo/customElement.d.ts +3 -3
  314. package/dist/components/calcite-navigation-user/customElement.d.ts +1 -1
  315. package/dist/components/calcite-notice/customElement.d.ts +3 -3
  316. package/dist/components/calcite-notice/customElement.js +1 -1
  317. package/dist/components/calcite-pagination/customElement.d.ts +1 -1
  318. package/dist/components/calcite-pagination/customElement.js +1 -1
  319. package/dist/components/calcite-panel/customElement.d.ts +11 -7
  320. package/dist/components/calcite-panel/customElement.js +21 -9
  321. package/dist/components/calcite-popover/customElement.d.ts +2 -2
  322. package/dist/components/calcite-popover/customElement.js +14 -175
  323. package/dist/components/calcite-progress/customElement.js +3 -2
  324. package/dist/components/calcite-radio-button/customElement.d.ts +1 -1
  325. package/dist/components/calcite-radio-button/customElement.js +173 -5
  326. package/dist/components/calcite-radio-button-group/customElement.d.ts +1 -1
  327. package/dist/components/calcite-rating/customElement.d.ts +3 -4
  328. package/dist/components/calcite-rating/customElement.js +12 -18
  329. package/dist/components/calcite-scrim/customElement.js +1 -1
  330. package/dist/components/calcite-segmented-control/customElement.d.ts +3 -4
  331. package/dist/components/calcite-segmented-control/customElement.js +13 -22
  332. package/dist/components/calcite-segmented-control-item/customElement.js +2 -2
  333. package/dist/components/calcite-select/customElement.d.ts +3 -4
  334. package/dist/components/calcite-select/customElement.js +8 -19
  335. package/dist/components/calcite-sheet/customElement.d.ts +2 -2
  336. package/dist/components/calcite-sheet/customElement.js +9 -6
  337. package/dist/components/calcite-shell/customElement.js +1 -1
  338. package/dist/components/calcite-shell-panel/customElement.js +7 -5
  339. package/dist/components/calcite-slider/customElement.d.ts +3 -4
  340. package/dist/components/calcite-slider/customElement.js +12 -22
  341. package/dist/components/calcite-sort-handle/customElement.d.ts +4 -4
  342. package/dist/components/calcite-sort-handle/customElement.js +44 -17
  343. package/dist/components/calcite-sortable-list/customElement.d.ts +1 -1
  344. package/dist/components/calcite-sortable-list/customElement.js +4 -4
  345. package/dist/components/calcite-split-button/customElement.d.ts +8 -8
  346. package/dist/components/calcite-stepper/customElement.d.ts +2 -2
  347. package/dist/components/calcite-stepper/customElement.js +30 -43
  348. package/dist/components/calcite-stepper-item/customElement.d.ts +1 -1
  349. package/dist/components/calcite-stepper-item/customElement.js +4 -10
  350. package/dist/components/calcite-swatch/customElement.d.ts +1 -1
  351. package/dist/components/calcite-swatch-group/customElement.js +1 -1
  352. package/dist/components/calcite-switch/customElement.d.ts +4 -4
  353. package/dist/components/calcite-switch/customElement.js +9 -8
  354. package/dist/components/calcite-tab/customElement.d.ts +1 -1
  355. package/dist/components/calcite-tab/customElement.js +2 -2
  356. package/dist/components/calcite-tab-nav/customElement.js +4 -2
  357. package/dist/components/calcite-tab-title/customElement.js +6 -4
  358. package/dist/components/calcite-table/customElement.js +1 -1
  359. package/dist/components/calcite-table-cell/customElement.d.ts +2 -2
  360. package/dist/components/calcite-table-cell/customElement.js +3 -2
  361. package/dist/components/calcite-table-header/customElement.d.ts +2 -2
  362. package/dist/components/calcite-table-row/customElement.d.ts +1 -1
  363. package/dist/components/calcite-tabs/customElement.js +1 -1
  364. package/dist/components/calcite-text-area/customElement.d.ts +13 -14
  365. package/dist/components/calcite-text-area/customElement.js +32 -37
  366. package/dist/components/calcite-tile/customElement.d.ts +1 -1
  367. package/dist/components/calcite-time-picker/customElement.d.ts +1 -1
  368. package/dist/components/calcite-time-picker/customElement.js +4 -3
  369. package/dist/components/calcite-tooltip/customElement.d.ts +15 -2
  370. package/dist/components/calcite-tooltip/customElement.js +27 -315
  371. package/dist/components/calcite-tree/customElement.js +1 -1
  372. package/dist/components/calcite-tree-item/customElement.js +5 -4
  373. package/dist/controllers/useSortable.d.ts +7 -0
  374. package/dist/docs/api.json +1 -1
  375. package/dist/docs/docs.json +1 -1
  376. package/dist/docs/supported-browsers.json +1 -1
  377. package/dist/docs/translations.json +1 -1
  378. package/dist/docs/vscode.css-custom-data.json +1 -1
  379. package/dist/docs/vscode.html-custom-data.json +1 -1
  380. package/dist/docs/web-types.json +1 -1
  381. package/dist/loader.js +23 -23
  382. package/dist/types/lumina.d.ts +5 -5
  383. package/dist/types/preact.d.ts +5 -5
  384. package/dist/types/react.d.ts +5 -5
  385. package/dist/types/stencil.d.ts +5 -5
  386. package/package.json +13 -12
  387. package/dist/cdn/2CCRLQOV.js +0 -2
  388. package/dist/cdn/2SXQFDOQ.js +0 -2
  389. package/dist/cdn/2UXQ7FQU.js +0 -2
  390. package/dist/cdn/32TBZZTY.js +0 -2
  391. package/dist/cdn/3KAMTN22.js +0 -2
  392. package/dist/cdn/3TLJ5JOP.js +0 -2
  393. package/dist/cdn/46F46R3T.js +0 -2
  394. package/dist/cdn/4DX77VVY.js +0 -2
  395. package/dist/cdn/4ET37OQN.js +0 -2
  396. package/dist/cdn/4I67VFAN.js +0 -2
  397. package/dist/cdn/5XFHSV4Z.js +0 -2
  398. package/dist/cdn/66NDMEG2.js +0 -2
  399. package/dist/cdn/76VE6QGI.js +0 -2
  400. package/dist/cdn/7AJLMSNL.js +0 -2
  401. package/dist/cdn/7J3JDTWK.js +0 -2
  402. package/dist/cdn/7PFEVHWG.js +0 -2
  403. package/dist/cdn/ALRQOPMQ.js +0 -2
  404. package/dist/cdn/AO7ZTAVY.js +0 -2
  405. package/dist/cdn/BEHKDUR6.js +0 -2
  406. package/dist/cdn/BKAZFAPN.js +0 -2
  407. package/dist/cdn/C7TED56N.js +0 -2
  408. package/dist/cdn/CSRCARFW.js +0 -2
  409. package/dist/cdn/DADGP3DW.js +0 -2
  410. package/dist/cdn/EC3GCET5.js +0 -2
  411. package/dist/cdn/EREDWMAC.js +0 -2
  412. package/dist/cdn/ETXIJA2R.js +0 -2
  413. package/dist/cdn/EVZEXLBF.js +0 -2
  414. package/dist/cdn/FH7GL6DM.js +0 -2
  415. package/dist/cdn/GETIWK4G.js +0 -2
  416. package/dist/cdn/GJ5VSZCN.js +0 -2
  417. package/dist/cdn/HSNJW6OM.js +0 -2
  418. package/dist/cdn/I6XABN6A.js +0 -2
  419. package/dist/cdn/IQ23RSWK.js +0 -2
  420. package/dist/cdn/JC2AVKOO.js +0 -2
  421. package/dist/cdn/JLJULYTE.js +0 -2
  422. package/dist/cdn/JRAIIHMU.js +0 -2
  423. package/dist/cdn/JZWQZ5BO.js +0 -2
  424. package/dist/cdn/KFPRUCQK.js +0 -2
  425. package/dist/cdn/LFGU3E4X.js +0 -2
  426. package/dist/cdn/LGDOYO5J.js +0 -2
  427. package/dist/cdn/MHSIIKU2.js +0 -2
  428. package/dist/cdn/MOZ5AAJM.js +0 -2
  429. package/dist/cdn/MTQHRNJW.js +0 -2
  430. package/dist/cdn/N6YVNJ3O.js +0 -2
  431. package/dist/cdn/NB3LG2PS.js +0 -2
  432. package/dist/cdn/NNVU3JV4.js +0 -2
  433. package/dist/cdn/O5XHZCXZ.js +0 -2
  434. package/dist/cdn/OXJIN4W5.js +0 -2
  435. package/dist/cdn/OXZJMSLQ.js +0 -2
  436. package/dist/cdn/P2745LUP.js +0 -2
  437. package/dist/cdn/QHUMJCWK.js +0 -2
  438. package/dist/cdn/QJ2FRJRU.js +0 -2
  439. package/dist/cdn/QUJE6MIQ.js +0 -2
  440. package/dist/cdn/REAIBS67.js +0 -2
  441. package/dist/cdn/RKSFMXT4.js +0 -2
  442. package/dist/cdn/RMKYCARB.js +0 -2
  443. package/dist/cdn/S5KQDAMG.js +0 -2
  444. package/dist/cdn/SUIJIBLR.js +0 -2
  445. package/dist/cdn/TDDLSMO5.js +0 -2
  446. package/dist/cdn/TQQTV5HV.js +0 -2
  447. package/dist/cdn/UMLQ6PVE.js +0 -2
  448. package/dist/cdn/UODBUSON.js +0 -2
  449. package/dist/cdn/WJXZ7BPV.js +0 -2
  450. package/dist/cdn/X2HWVZ5U.js +0 -2
  451. package/dist/cdn/XPGAQQQC.js +0 -2
  452. package/dist/cdn/XSMU7S2O.js +0 -2
  453. package/dist/cdn/YT6UJRLT.js +0 -2
  454. package/dist/cdn/YUZXLNNW.js +0 -2
  455. package/dist/cdn/YZ4W6DFR.js +0 -2
  456. package/dist/cdn/Z2BYWKFB.js +0 -2
  457. package/dist/cdn/ZCBRPKAV.js +0 -2
  458. package/dist/cdn/ZQLGBHLZ.js +0 -2
  459. package/dist/chunks/form.js +0 -268
  460. package/dist/chunks/input.js +0 -30
  461. package/dist/utils/form.d.ts +0 -3
  462. package/dist/utils/sortableComponent.d.ts +0 -7
@@ -1,15 +1,183 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import { c as customElement } from "../../chunks/runtime.js";
3
- import { css, nothing, html } from "lit";
3
+ import { html, isServer, css, nothing } from "lit";
4
4
  import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
5
5
  import { createRef, ref } from "lit/directives/ref.js";
6
+ import { useDirection } from "@arcgis/lumina/controllers";
6
7
  import { g as getRoundRobinIndex } from "../../chunks/array.js";
7
- import { g as getElementDir } from "../../chunks/dom.js";
8
- import { c as connectForm, d as disconnectForm, H as HiddenFormInputSlot } from "../../chunks/form.js";
8
+ import { q as queryElementRoots, c as closestElementCrossShadowBoundary } from "../../chunks/dom.js";
9
9
  import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
10
10
  import { I as InternalLabel } from "../../chunks/InternalLabel.js";
11
11
  import { u as useSetFocus } from "../../chunks/useSetFocus.js";
12
12
  import { u as useInteractive } from "../../chunks/useInteractive.js";
13
+ const hiddenFormInputSlotName = "hidden-form-input";
14
+ function isCheckable(component) {
15
+ return "checked" in component;
16
+ }
17
+ const onFormResetMap = /* @__PURE__ */ new WeakMap();
18
+ const formComponentSet = /* @__PURE__ */ new WeakSet();
19
+ function hasRegisteredFormComponentParent(form, formComponentEl) {
20
+ const hasParentComponentWithFormIdSet = closestElementCrossShadowBoundary(formComponentEl.parentElement, "[form]");
21
+ if (hasParentComponentWithFormIdSet) {
22
+ return true;
23
+ }
24
+ const formComponentRegisterEventName = "calciteInternalFormComponentRegister";
25
+ let hasRegisteredFormComponentParent2 = false;
26
+ form.addEventListener(formComponentRegisterEventName, (event) => {
27
+ hasRegisteredFormComponentParent2 = event.composedPath().some((element) => formComponentSet.has(element));
28
+ event.stopPropagation();
29
+ }, { once: true });
30
+ formComponentEl.dispatchEvent(new CustomEvent(formComponentRegisterEventName, {
31
+ bubbles: true,
32
+ composed: true
33
+ }));
34
+ return hasRegisteredFormComponentParent2;
35
+ }
36
+ function getValidationComponent(el) {
37
+ if (el.nodeName === "CALCITE-RADIO-BUTTON") {
38
+ return closestElementCrossShadowBoundary(el, "calcite-radio-button-group");
39
+ }
40
+ return el;
41
+ }
42
+ function connectForm(component) {
43
+ const { el, value } = component;
44
+ const associatedForm = findAssociatedForm(component);
45
+ if (!associatedForm || hasRegisteredFormComponentParent(associatedForm, el)) {
46
+ return;
47
+ }
48
+ component.formEl = associatedForm;
49
+ component.defaultValue = value;
50
+ if (isCheckable(component)) {
51
+ component.defaultChecked = component.checked;
52
+ }
53
+ const boundOnFormReset = onFormReset.bind(component);
54
+ associatedForm.addEventListener("reset", boundOnFormReset);
55
+ onFormResetMap.set(component.el, boundOnFormReset);
56
+ formComponentSet.add(el);
57
+ }
58
+ function findAssociatedForm(component) {
59
+ const { el, form } = component;
60
+ return form ? queryElementRoots(el, { id: form }) : closestElementCrossShadowBoundary(el, "form");
61
+ }
62
+ function onFormReset() {
63
+ if ("status" in this) {
64
+ this.status = "idle";
65
+ }
66
+ if ("validationIcon" in this) {
67
+ this.validationIcon = false;
68
+ }
69
+ if ("validationMessage" in this) {
70
+ this.validationMessage = "";
71
+ }
72
+ if (isCheckable(this)) {
73
+ this.checked = this.defaultChecked;
74
+ return;
75
+ }
76
+ this.value = this.defaultValue;
77
+ this.onFormReset?.();
78
+ }
79
+ function disconnectForm(component) {
80
+ const { el, formEl } = component;
81
+ if (!formEl) {
82
+ return;
83
+ }
84
+ const boundOnFormReset = onFormResetMap.get(el);
85
+ formEl.removeEventListener("reset", boundOnFormReset);
86
+ onFormResetMap.delete(el);
87
+ component.formEl = null;
88
+ formComponentSet.delete(el);
89
+ }
90
+ const internalHiddenInputInputEvent = "calciteInternalHiddenInputInput";
91
+ const hiddenInputInputHandler = (event) => {
92
+ event.target.dispatchEvent(new CustomEvent(internalHiddenInputInputEvent, { bubbles: true }));
93
+ };
94
+ const removeHiddenInputChangeEventListener = (input) => input.removeEventListener("input", hiddenInputInputHandler);
95
+ function syncHiddenFormInput(component) {
96
+ const { el, formEl, name, value } = component;
97
+ const { ownerDocument } = el;
98
+ if (isServer) {
99
+ return;
100
+ }
101
+ const inputs = el.querySelectorAll(`input[slot="${hiddenFormInputSlotName}"]`);
102
+ if (!formEl || !name) {
103
+ inputs.forEach((input) => {
104
+ removeHiddenInputChangeEventListener(input);
105
+ input.remove();
106
+ });
107
+ return;
108
+ }
109
+ const values = Array.isArray(value) ? value : [value];
110
+ const extra = [];
111
+ const seen = /* @__PURE__ */ new Set();
112
+ inputs.forEach((input) => {
113
+ const valueMatch = values.find((val) => (
114
+ /* intentional non-strict equality check */
115
+ val == input.value
116
+ ));
117
+ if (valueMatch != null) {
118
+ seen.add(valueMatch);
119
+ defaultSyncHiddenFormInput(component, input, valueMatch);
120
+ } else {
121
+ extra.push(input);
122
+ }
123
+ });
124
+ let docFrag;
125
+ values.forEach((value2) => {
126
+ if (seen.has(value2)) {
127
+ return;
128
+ }
129
+ let input = extra.pop();
130
+ if (!input) {
131
+ input = ownerDocument.createElement("input");
132
+ input.ariaHidden = "true";
133
+ input.slot = hiddenFormInputSlotName;
134
+ }
135
+ if (!docFrag) {
136
+ docFrag = ownerDocument.createDocumentFragment();
137
+ }
138
+ docFrag.append(input);
139
+ input.addEventListener("input", hiddenInputInputHandler);
140
+ defaultSyncHiddenFormInput(component, input, value2);
141
+ });
142
+ if (docFrag) {
143
+ el.append(docFrag);
144
+ }
145
+ extra.forEach((input) => {
146
+ removeHiddenInputChangeEventListener(input);
147
+ input.remove();
148
+ });
149
+ }
150
+ function defaultSyncHiddenFormInput(component, input, value) {
151
+ const { defaultValue, disabled, form, name, required } = component;
152
+ input.defaultValue = defaultValue;
153
+ input.disabled = disabled;
154
+ input.name = name;
155
+ input.required = required;
156
+ input.tabIndex = -1;
157
+ if (form) {
158
+ input.setAttribute("form", form);
159
+ } else {
160
+ input.removeAttribute("form");
161
+ }
162
+ if (isCheckable(component)) {
163
+ input.checked = component.checked;
164
+ input.defaultChecked = component.defaultChecked;
165
+ input.value = component.checked ? value || "on" : "";
166
+ } else {
167
+ input.value = value || "";
168
+ }
169
+ component.syncHiddenFormInput?.(input);
170
+ const validationComponent = getValidationComponent(component.el);
171
+ if (validationComponent && "validity" in validationComponent) {
172
+ for (const key in { ...input?.validity }) {
173
+ validationComponent.validity[key] = input.validity[key];
174
+ }
175
+ }
176
+ }
177
+ const HiddenFormInputSlot = ({ component }) => {
178
+ syncHiddenFormInput(component);
179
+ return html`<slot name=${hiddenFormInputSlotName}></slot>`;
180
+ };
13
181
  const CSS = {
14
182
  container: "container",
15
183
  radio: "radio"
@@ -19,6 +187,7 @@ class RadioButton extends LitElement {
19
187
  constructor() {
20
188
  super();
21
189
  this.containerRef = createRef();
190
+ this.direction = useDirection();
22
191
  this.focusSetter = useSetFocus()(this);
23
192
  this.interactiveContainer = useInteractive(this);
24
193
  this.checked = false;
@@ -196,7 +365,6 @@ class RadioButton extends LitElement {
196
365
  handleKeyDown(event) {
197
366
  const keys = ["ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", " "];
198
367
  const { key } = event;
199
- const { el } = this;
200
368
  if (keys.indexOf(key) === -1) {
201
369
  return;
202
370
  }
@@ -206,7 +374,7 @@ class RadioButton extends LitElement {
206
374
  return;
207
375
  }
208
376
  let adjustedKey = key;
209
- if (getElementDir(el) === "rtl") {
377
+ if (this.direction === "rtl") {
210
378
  if (key === "ArrowRight") {
211
379
  adjustedKey = "ArrowLeft";
212
380
  }
@@ -62,7 +62,7 @@ export abstract class RadioButtonGroup extends LitElement {
62
62
  * Sets focus on the fist focusable `calcite-radio-button` element in the component.
63
63
  *
64
64
  * @param options - When specified an optional object customizes the component's focusing process. When `preventScroll` is `true`, scrolling will not occur on the component.
65
- * @mdn [focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
65
+ * @see [MDN - focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
66
66
  */
67
67
  setFocus(options?: FocusOptions): Promise<void>;
68
68
  /** Fires when the component has changed. */
@@ -1,6 +1,5 @@
1
1
  /// <reference path="../../index.d.ts" />
2
2
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
- import type { MutableValidityState } from "../../utils/form.js";
4
3
  import type { Scale, Status } from "../interfaces.js";
5
4
  import type { IconName } from "../calcite-icon/interfaces.js";
6
5
 
@@ -72,16 +71,16 @@ export abstract class Rating extends LitElement {
72
71
  /**
73
72
  * The component's current validation state.
74
73
  *
75
- * @mdn [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)
74
+ * @see [MDN - ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)
76
75
  */
77
- get validity(): MutableValidityState;
76
+ get validity(): ValidityState;
78
77
  /** The component's value. */
79
78
  accessor value: number;
80
79
  /**
81
80
  * Sets focus on the component.
82
81
  *
83
82
  * @param options - When specified an optional object customizes the component's focusing process. When `preventScroll` is `true`, scrolling will not occur on the component.
84
- * @mdn [focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
83
+ * @see [MDN - focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
85
84
  */
86
85
  setFocus(options?: FocusOptions): Promise<void>;
87
86
  /** Fires when the component's value changes. */
@@ -3,7 +3,6 @@ import { c as customElement } from "../../chunks/runtime.js";
3
3
  import { live } from "lit/directives/live.js";
4
4
  import { html, css } from "lit";
5
5
  import { safeClassMap, LitElement, createEvent, stringOrBoolean, nothing, safeStyleMap } from "@arcgis/lumina";
6
- import { c as connectForm, d as disconnectForm, H as HiddenFormInputSlot } from "../../chunks/form.js";
7
6
  import { g as guid } from "../../chunks/guid.js";
8
7
  import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
9
8
  import { I as InternalLabel } from "../../chunks/InternalLabel.js";
@@ -11,6 +10,7 @@ import { V as Validation } from "../../chunks/Validation.js";
11
10
  import { u as useT9n } from "../../chunks/useT9n.js";
12
11
  import { u as useSetFocus } from "../../chunks/useSetFocus.js";
13
12
  import { u as useInteractive } from "../../chunks/useInteractive.js";
13
+ import { u as useForm } from "../../chunks/useForm.js";
14
14
  const StarIcon = ({ full, scale, partial }) => html`<calcite-icon class=${safeClassMap(partial ? void 0 : "icon")} .icon=${full ? "star-f" : "star"} .scale=${scale}></calcite-icon>`;
15
15
  const CSS = {
16
16
  fieldSet: "fieldset",
@@ -31,6 +31,12 @@ class Rating extends LitElement {
31
31
  constructor() {
32
32
  super();
33
33
  this.emit = false;
34
+ this.formSupport = useForm({
35
+ inputType: "number",
36
+ getValue: () => {
37
+ return this.value === 0 ? "" : this.value;
38
+ }
39
+ })(this);
34
40
  this.guid = IDS.host(guid());
35
41
  this.isKeyboardInteraction = true;
36
42
  this.labelElements = [];
@@ -45,26 +51,16 @@ class Rating extends LitElement {
45
51
  this.scale = "m";
46
52
  this.showChip = false;
47
53
  this.status = "idle";
48
- this.validity = {
49
- valid: false,
50
- badInput: false,
51
- customError: false,
52
- patternMismatch: false,
53
- rangeOverflow: false,
54
- rangeUnderflow: false,
55
- stepMismatch: false,
56
- tooLong: false,
57
- tooShort: false,
58
- typeMismatch: false,
59
- valueMissing: false
60
- };
61
54
  this.calciteRatingChange = createEvent({ cancelable: false });
62
55
  this.listen("keydown", this.handleHostKeyDown);
63
56
  this.listen("pointerout", this.handleRatingPointerOut);
64
57
  this.listen("pointerover", this.handleRatingPointerOver);
65
58
  }
66
59
  static {
67
- this.properties = { hoverValue: [16, {}, { state: true }], average: [11, {}, { reflect: true, type: Number }], count: [11, {}, { reflect: true, type: Number }], disabled: [7, {}, { reflect: true, type: Boolean }], form: [3, {}, { reflect: true }], labelText: 1, messageOverrides: [0, {}, { attribute: false }], name: [3, {}, { reflect: true }], readOnly: [7, {}, { reflect: true, type: Boolean }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], showChip: [7, {}, { reflect: true, type: Boolean }], status: [3, {}, { reflect: true }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [0, {}, { attribute: false }], value: [11, {}, { reflect: true, type: Number }] };
60
+ this.properties = { hoverValue: [16, {}, { state: true }], average: [11, {}, { reflect: true, type: Number }], count: [11, {}, { reflect: true, type: Number }], disabled: [7, {}, { reflect: true, type: Boolean }], form: [3, {}, { reflect: true }], labelText: 1, messageOverrides: [0, {}, { attribute: false }], name: [3, {}, { reflect: true }], readOnly: [7, {}, { reflect: true, type: Boolean }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], showChip: [7, {}, { reflect: true, type: Boolean }], status: [3, {}, { reflect: true }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [32, {}, { readOnly: true, attribute: false }], value: [11, {}, { reflect: true, type: Number }] };
61
+ }
62
+ static {
63
+ this.formAssociated = true;
68
64
  }
69
65
  static {
70
66
  this.styles = styles;
@@ -87,7 +83,6 @@ class Rating extends LitElement {
87
83
  connectedCallback() {
88
84
  super.connectedCallback();
89
85
  connectLabel(this);
90
- connectForm(this);
91
86
  }
92
87
  async load() {
93
88
  this.requestUpdate("value");
@@ -122,7 +117,6 @@ class Rating extends LitElement {
122
117
  disconnectedCallback() {
123
118
  super.disconnectedCallback();
124
119
  disconnectLabel(this);
125
- disconnectForm(this);
126
120
  }
127
121
  handleValueUpdate(newValue) {
128
122
  this.hoverValue = newValue;
@@ -233,7 +227,7 @@ class Rating extends LitElement {
233
227
  average,
234
228
  partial
235
229
  })} data-value=${value ?? nothing} for=${id ?? nothing} @click=${this.handleLabelClick} @focus=${this.handleLabelFocus} @keydown=${this.handleLabelKeyDown} @pointerdown=${this.handleLabelPointerDown} @pointerover=${this.handleLabelPointerOver} tabindex=${tabIndex ?? nothing}><input aria-errormessage=${IDS.validationMessage} .ariaInvalid=${this.status === "invalid"} .ariaLabel=${getLabelText(this)} .ariaRequired=${this.required} .checked=${checked} class=${safeClassMap(CSS.visuallyHidden)} .disabled=${this.disabled || this.readOnly} id=${id ?? nothing} name=${this.guid ?? nothing} @change=${this.handleInputChange} tabindex=-1 type=radio .value=${live(value ?? "")}>${StarIcon({ full: selected || average || hovered, scale: this.scale })}${partial && html`<div class=${safeClassMap(CSS.fraction)} style=${safeStyleMap({ width: `${fraction * 100}%` })}>${StarIcon({ full: true, partial: true, scale: this.scale })}</div>` || ""}<span class=${safeClassMap(CSS.visuallyHidden)}>${this.messages.stars.replace("{num}", `${value}`)}</span></label>`;
236
- })}${(this.count || this.average) && this.showChip ? html`<calcite-chip .label=${countString} .scale=${this.scale} .value=${countString}>${!!this.average && html`<span class=${safeClassMap(CSS.numberAverage)}>${this.average.toString()}</span>` || ""}${!!this.count && html`<span class=${safeClassMap(CSS.numberCount)}>(${countString})</span>` || ""}</calcite-chip>` : null}</fieldset>${HiddenFormInputSlot({ component: this })}${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}</span>` });
230
+ })}${(this.count || this.average) && this.showChip ? html`<calcite-chip .label=${countString} .scale=${this.scale} .value=${countString}>${!!this.average && html`<span class=${safeClassMap(CSS.numberAverage)}>${this.average.toString()}</span>` || ""}${!!this.count && html`<span class=${safeClassMap(CSS.numberCount)}>(${countString})</span>` || ""}</calcite-chip>` : null}</fieldset>${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}</span>` });
237
231
  }
238
232
  }
239
233
  customElement("calcite-rating", Rating);
@@ -4,7 +4,7 @@ import { css, html } from "lit";
4
4
  import { LitElement, safeClassMap } from "@arcgis/lumina";
5
5
  import { createRef, ref } from "lit/directives/ref.js";
6
6
  import { c as createObserver } from "../../chunks/observers.js";
7
- import { n as slotChangeHasContent } from "../../chunks/dom.js";
7
+ import { m as slotChangeHasContent } from "../../chunks/dom.js";
8
8
  import { u as useT9n } from "../../chunks/useT9n.js";
9
9
  const CSS = {
10
10
  scrim: "scrim",
@@ -1,6 +1,5 @@
1
1
  /// <reference path="../../index.d.ts" />
2
2
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
- import type { MutableValidityState } from "../../utils/form.js";
4
3
  import type { Appearance, Layout, Scale, Status, Width } from "../interfaces.js";
5
4
  import type { IconName } from "../calcite-icon/interfaces.js";
6
5
  import type { SegmentedControlItem } from "../calcite-segmented-control-item/customElement.js";
@@ -69,9 +68,9 @@ export abstract class SegmentedControl extends LitElement {
69
68
  /**
70
69
  * The component's current validation state.
71
70
  *
72
- * @mdn [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)
71
+ * @see [MDN - ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)
73
72
  */
74
- get validity(): MutableValidityState;
73
+ get validity(): ValidityState;
75
74
  /** The component's `selectedItem` value. */
76
75
  accessor value: string;
77
76
  /**
@@ -84,7 +83,7 @@ export abstract class SegmentedControl extends LitElement {
84
83
  * Sets focus on the component.
85
84
  *
86
85
  * @param options - When specified an optional object customizes the component's focusing process. When `preventScroll` is `true`, scrolling will not occur on the component.
87
- * @mdn [focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
86
+ * @see [MDN - focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
88
87
  */
89
88
  setFocus(options?: FocusOptions): Promise<void>;
90
89
  /** Fires when the `calcite-segmented-control-item` selection changes. */
@@ -2,14 +2,15 @@
2
2
  import { c as customElement } from "../../chunks/runtime.js";
3
3
  import { css, isServer, nothing, html } from "lit";
4
4
  import { LitElement, createEvent, stringOrBoolean, safeClassMap } from "@arcgis/lumina";
5
- import { g as getElementDir, b as slotChangeGetAssignedElements } from "../../chunks/dom.js";
6
- import { c as connectForm, a as afterConnectDefaultValueSet, d as disconnectForm, H as HiddenFormInputSlot } from "../../chunks/form.js";
5
+ import { useDirection } from "@arcgis/lumina/controllers";
6
+ import { a as slotChangeGetAssignedElements } from "../../chunks/dom.js";
7
7
  import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
8
8
  import { I as InternalLabel } from "../../chunks/InternalLabel.js";
9
9
  import { V as Validation } from "../../chunks/Validation.js";
10
10
  import { u as useT9n } from "../../chunks/useT9n.js";
11
11
  import { u as useSetFocus } from "../../chunks/useSetFocus.js";
12
12
  import { u as useInteractive } from "../../chunks/useInteractive.js";
13
+ import { u as useForm } from "../../chunks/useForm.js";
13
14
  const CSS = {
14
15
  itemWrapper: "item-wrapper"
15
16
  };
@@ -20,6 +21,8 @@ const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;use
20
21
  class SegmentedControl extends LitElement {
21
22
  constructor() {
22
23
  super();
24
+ this.direction = useDirection();
25
+ this.formSupport = useForm({ inputType: "text" })(this);
23
26
  this.items = [];
24
27
  this.messages = useT9n();
25
28
  this.focusSetter = useSetFocus()(this);
@@ -30,19 +33,6 @@ class SegmentedControl extends LitElement {
30
33
  this.required = false;
31
34
  this.scale = "m";
32
35
  this.status = "idle";
33
- this.validity = {
34
- valid: false,
35
- badInput: false,
36
- customError: false,
37
- patternMismatch: false,
38
- rangeOverflow: false,
39
- rangeUnderflow: false,
40
- stepMismatch: false,
41
- tooLong: false,
42
- tooShort: false,
43
- typeMismatch: false,
44
- valueMissing: false
45
- };
46
36
  this.value = null;
47
37
  this.width = "auto";
48
38
  this.calciteSegmentedControlChange = createEvent({ cancelable: false });
@@ -51,7 +41,10 @@ class SegmentedControl extends LitElement {
51
41
  this.listen("click", this.handleClick);
52
42
  }
53
43
  static {
54
- this.properties = { appearance: [3, {}, { reflect: true }], disabled: [7, {}, { reflect: true, type: Boolean }], form: [3, {}, { reflect: true }], layout: [3, {}, { reflect: true }], labelText: 1, messageOverrides: [0, {}, { attribute: false }], name: [3, {}, { reflect: true }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectedItem: [0, {}, { attribute: false }], status: [3, {}, { reflect: true }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [0, {}, { attribute: false }], value: 1, width: [3, {}, { reflect: true }] };
44
+ this.properties = { appearance: [3, {}, { reflect: true }], disabled: [7, {}, { reflect: true, type: Boolean }], form: [3, {}, { reflect: true }], layout: [3, {}, { reflect: true }], labelText: 1, messageOverrides: [0, {}, { attribute: false }], name: [3, {}, { reflect: true }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectedItem: [0, {}, { attribute: false }], status: [3, {}, { reflect: true }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [32, {}, { readOnly: true, attribute: false }], value: 1, width: [3, {}, { reflect: true }] };
45
+ }
46
+ static {
47
+ this.formAssociated = true;
55
48
  }
56
49
  static {
57
50
  this.styles = styles;
@@ -62,7 +55,6 @@ class SegmentedControl extends LitElement {
62
55
  connectedCallback() {
63
56
  super.connectedCallback();
64
57
  connectLabel(this);
65
- connectForm(this);
66
58
  }
67
59
  willUpdate(changes) {
68
60
  if (changes.has("appearance") && (this.hasUpdated || this.appearance !== "solid") || changes.has("layout") && (this.hasUpdated || this.layout !== "horizontal") || changes.has("scale") && (this.hasUpdated || this.scale !== "m")) {
@@ -76,12 +68,11 @@ class SegmentedControl extends LitElement {
76
68
  }
77
69
  }
78
70
  loaded() {
79
- afterConnectDefaultValueSet(this, this.value);
71
+ this.formSupport.overrideDefaultValue(this.value);
80
72
  }
81
73
  disconnectedCallback() {
82
74
  super.disconnectedCallback();
83
75
  disconnectLabel(this);
84
- disconnectForm(this);
85
76
  }
86
77
  valueHandler(value) {
87
78
  const { items } = this;
@@ -119,12 +110,12 @@ class SegmentedControl extends LitElement {
119
110
  handleKeyDown(event) {
120
111
  const keys = ["ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", " "];
121
112
  const { key } = event;
122
- const { el, selectedItem } = this;
113
+ const { selectedItem } = this;
123
114
  if (keys.indexOf(key) === -1) {
124
115
  return;
125
116
  }
126
117
  let adjustedKey = key;
127
- if (getElementDir(el) === "rtl") {
118
+ if (this.direction === "rtl") {
128
119
  if (key === "ArrowRight") {
129
120
  adjustedKey = "ArrowLeft";
130
121
  }
@@ -216,7 +207,7 @@ class SegmentedControl extends LitElement {
216
207
  }
217
208
  render() {
218
209
  this.el.role = "radiogroup";
219
- return html`${this.labelText && InternalLabel({ labelText: this.labelText, onClick: this.onLabelClick, required: this.required, tooltipText: this.messages.required }) || ""}<div aria-errormessage=${IDS.validationMessage} aria-label=${getLabelText(this) ?? nothing} .ariaInvalid=${this.status === "invalid"} .ariaRequired=${this.required} class=${safeClassMap(CSS.itemWrapper)}>${this.interactiveContainer({ disabled: this.disabled, children: html`<slot @slotchange=${this.handleDefaultSlotChange}></slot>${HiddenFormInputSlot({ component: this })}` })}</div>${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}`;
210
+ return html`${this.labelText && InternalLabel({ labelText: this.labelText, onClick: this.onLabelClick, required: this.required, tooltipText: this.messages.required }) || ""}<div aria-errormessage=${IDS.validationMessage} aria-label=${getLabelText(this) ?? nothing} .ariaInvalid=${this.status === "invalid"} .ariaRequired=${this.required} class=${safeClassMap(CSS.itemWrapper)}>${this.interactiveContainer({ disabled: this.disabled, children: html`<slot @slotchange=${this.handleDefaultSlotChange}></slot>` })}</div>${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}`;
220
211
  }
221
212
  }
222
213
  customElement("calcite-segmented-control", SegmentedControl);
@@ -2,7 +2,7 @@
2
2
  import { c as customElement } from "../../chunks/runtime.js";
3
3
  import { css, html } from "lit";
4
4
  import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
5
- import { n as slotChangeHasContent } from "../../chunks/dom.js";
5
+ import { m as slotChangeHasContent } from "../../chunks/dom.js";
6
6
  import { t as toAriaBoolean } from "../../chunks/aria.js";
7
7
  const SLOTS = {
8
8
  input: "input"
@@ -16,7 +16,7 @@ const CSS = {
16
16
  icon: "icon",
17
17
  iconSolo: "icon--solo"
18
18
  };
19
- const styles = css`:host{display:flex;cursor:pointer;align-self:stretch;font-weight:var(--calcite-font-weight-normal);outline-color:transparent;transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out,border-color var(--calcite-animation-timing) ease-in-out}.label{pointer-events:none;margin:.125rem;box-sizing:border-box;display:flex;flex:1 1 0%;align-items:center;color:var(--calcite-segmented-control-color, var(--calcite-color-text-3));background-color:var(--calcite-segmented-control-background-color);box-shadow:var(--calcite-segmented-control-shadow);border-color:var(--calcite-segmented-control-border-color);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out,border-color var(--calcite-internal-animation-timing-fast) ease-in-out,color var(--calcite-internal-animation-timing-fast) ease-in-out}.label--horizontal{justify-content:center}:host(:focus){outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))));outline-offset:-1px;z-index:var(--calcite-z-index)}.label--scale-s{padding-inline:.5rem;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);padding-block:.125rem}.label--scale-m{padding-inline:.75rem;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);padding-block:.375rem}.label--scale-l{padding-inline:1rem;padding-block:.625rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md)}:host(:hover) .label{background-color:var(--calcite-segmented-control-background-color, var(--calcite-color-foreground-2));color:var(--calcite-segmented-control-color, var(--calcite-color-text-1))}:host(:active) .label{background-color:var(--calcite-segmented-control-background-color, var(--calcite-color-foreground-3))}:host([checked]) .label{cursor:default;background-color:var(--calcite-segmented-control-background-color, var(--calcite-color-brand));border-color:var(--calcite-segmented-control-border-color, var(--calcite-color-brand));color:var(--calcite-segmented-control-color, var(--calcite-color-text-inverse))}:host([checked]) .label--outline,:host([checked]) .label--outline-fill{background-color:var(--calcite-segmented-control-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-segmented-control-border-color, var(--calcite-color-brand));box-shadow:var(--calcite-segmented-control-shadow, inset 0 0 0 1px var(--calcite-color-brand));color:var(--calcite-segmented-control-color, var(--calcite-color-brand))}:host([checked]) .label--outline{background-color:var(--calcite-segmented-control-background-color, transparent)}::slotted(input){display:none}@media(forced-colors:active){:host([checked]) .label{background-color:highlight}:host([checked]) .label--outline,:host([checked]) .label--outline-fill{outline:2px solid transparent;outline-offset:2px}:host([checked]) .label:not([class~=label--outline]) .icon{color:highlightText}}.icon{position:relative;margin:0;display:inline-flex;line-height:inherit;margin-inline-start:var(--calcite-internal-segmented-control-icon-margin-start);margin-inline-end:var(--calcite-internal-segmented-control-icon-margin-end);--calcite-icon-color: var(--calcite-segmented-control-icon-color)}:host([icon-start]) .label--scale-s{--calcite-internal-segmented-control-icon-margin-end: .5rem}:host([icon-end]) .label--scale-s{--calcite-internal-segmented-control-icon-margin-start: .5rem}:host([icon-start]) .label--scale-m{--calcite-internal-segmented-control-icon-margin-end: .75rem}:host([icon-end]) .label--scale-m{--calcite-internal-segmented-control-icon-margin-start: .75rem}:host([icon-start]) .label--scale-l{--calcite-internal-segmented-control-icon-margin-end: 1rem}:host([icon-end]) .label--scale-l{--calcite-internal-segmented-control-icon-margin-start: 1rem}.label .icon--solo{--calcite-internal-segmented-control-icon-margin-start: 0;--calcite-internal-segmented-control-icon-margin-end: 0}:host([hidden]){display:none}[hidden]{display:none}`;
19
+ const styles = css`:host{display:flex;cursor:pointer;align-self:stretch;font-weight:var(--calcite-font-weight-normal);outline-color:transparent;transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out,border-color var(--calcite-animation-timing) ease-in-out}.label{pointer-events:none;margin:.125rem;box-sizing:border-box;display:flex;flex:1 1 0%;align-items:center;color:var(--calcite-segmented-control-color, var(--calcite-color-text-3));background-color:var(--calcite-segmented-control-background-color);box-shadow:var(--calcite-segmented-control-shadow);border-color:var(--calcite-segmented-control-border-color);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out,border-color var(--calcite-internal-animation-timing-fast) ease-in-out,color var(--calcite-internal-animation-timing-fast) ease-in-out}.label--horizontal{justify-content:center}:host(:focus){outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))));outline-offset:-1px;z-index:var(--calcite-z-index)}.label--scale-s{padding-inline:.5rem;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);padding-block:.125rem}.label--scale-m{padding-inline:.75rem;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);padding-block:.375rem}.label--scale-l{padding-inline:1rem;padding-block:var(--calcite-space-sm-plus);font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md)}:host(:hover) .label{background-color:var(--calcite-segmented-control-background-color, var(--calcite-color-foreground-2));color:var(--calcite-segmented-control-color, var(--calcite-color-text-1))}:host(:active) .label{background-color:var(--calcite-segmented-control-background-color, var(--calcite-color-foreground-3))}:host([checked]) .label{cursor:default;background-color:var(--calcite-segmented-control-background-color, var(--calcite-color-brand));border-color:var(--calcite-segmented-control-border-color, var(--calcite-color-brand));color:var(--calcite-segmented-control-color, var(--calcite-color-text-inverse))}:host([checked]) .label--outline,:host([checked]) .label--outline-fill{background-color:var(--calcite-segmented-control-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-segmented-control-border-color, var(--calcite-color-brand));box-shadow:var(--calcite-segmented-control-shadow, inset 0 0 0 1px var(--calcite-color-brand));color:var(--calcite-segmented-control-color, var(--calcite-color-brand))}:host([checked]) .label--outline{background-color:var(--calcite-segmented-control-background-color, transparent)}::slotted(input){display:none}@media(forced-colors:active){:host([checked]) .label{background-color:highlight}:host([checked]) .label--outline,:host([checked]) .label--outline-fill{outline:2px solid transparent;outline-offset:2px}:host([checked]) .label:not([class~=label--outline]) .icon{color:highlightText}}.icon{position:relative;margin:0;display:inline-flex;line-height:inherit;margin-inline-start:var(--calcite-internal-segmented-control-icon-margin-start);margin-inline-end:var(--calcite-internal-segmented-control-icon-margin-end);--calcite-icon-color: var(--calcite-segmented-control-icon-color)}:host([icon-start]) .label--scale-s{--calcite-internal-segmented-control-icon-margin-end: .5rem}:host([icon-end]) .label--scale-s{--calcite-internal-segmented-control-icon-margin-start: .5rem}:host([icon-start]) .label--scale-m{--calcite-internal-segmented-control-icon-margin-end: .75rem}:host([icon-end]) .label--scale-m{--calcite-internal-segmented-control-icon-margin-start: .75rem}:host([icon-start]) .label--scale-l{--calcite-internal-segmented-control-icon-margin-end: 1rem}:host([icon-end]) .label--scale-l{--calcite-internal-segmented-control-icon-margin-start: 1rem}.label .icon--solo{--calcite-internal-segmented-control-icon-margin-start: 0;--calcite-internal-segmented-control-icon-margin-end: 0}:host([hidden]){display:none}[hidden]{display:none}`;
20
20
  class SegmentedControlItem extends LitElement {
21
21
  constructor() {
22
22
  super(...arguments);
@@ -1,6 +1,5 @@
1
1
  /// <reference path="../../index.d.ts" />
2
2
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
- import type { MutableValidityState } from "../../utils/form.js";
4
3
  import type { Scale, Status, Width } from "../interfaces.js";
5
4
  import type { IconName } from "../calcite-icon/interfaces.js";
6
5
  import type { Option } from "../calcite-option/customElement.js";
@@ -70,9 +69,9 @@ export abstract class Select extends LitElement {
70
69
  /**
71
70
  * The component's current validation state.
72
71
  *
73
- * @mdn [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)
72
+ * @see [MDN - ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)
74
73
  */
75
- get validity(): MutableValidityState;
74
+ get validity(): ValidityState;
76
75
  /** The component's `selectedOption` value. */
77
76
  accessor value: string;
78
77
  /**
@@ -85,7 +84,7 @@ export abstract class Select extends LitElement {
85
84
  * Sets focus on the component.
86
85
  *
87
86
  * @param options - When specified an optional object customizes the component's focusing process. When `preventScroll` is `true`, scrolling will not occur on the component.
88
- * @mdn [focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
87
+ * @see [MDN - focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
89
88
  */
90
89
  setFocus(options?: FocusOptions): Promise<void>;
91
90
  /** Fires when the `selectedOption` changes. */
@@ -4,7 +4,6 @@ import { css, html } from "lit";
4
4
  import { LitElement, createEvent, stringOrBoolean, safeClassMap } from "@arcgis/lumina";
5
5
  import { createRef, ref } from "lit/directives/ref.js";
6
6
  import { u as useT9n } from "../../chunks/useT9n.js";
7
- import { c as connectForm, a as afterConnectDefaultValueSet, d as disconnectForm, H as HiddenFormInputSlot } from "../../chunks/form.js";
8
7
  import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
9
8
  import { c as createObserver } from "../../chunks/observers.js";
10
9
  import { g as getIconScale } from "../../chunks/component.js";
@@ -12,6 +11,7 @@ import { I as InternalLabel } from "../../chunks/InternalLabel.js";
12
11
  import { V as Validation } from "../../chunks/Validation.js";
13
12
  import { u as useSetFocus } from "../../chunks/useSetFocus.js";
14
13
  import { u as useInteractive } from "../../chunks/useInteractive.js";
14
+ import { u as useForm } from "../../chunks/useForm.js";
15
15
  const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;font-size:var(--calcite-select-font-size);font-weight:var(--calcite-internal-select-font-weight, var(--calcite-font-weight-regular))}.wrapper{position:relative;display:flex;align-items:stretch;inline-size:var(--select-width);block-size:var(--calcite-internal-select-block-size, 32px)}.wrapper:focus-within .icon,.wrapper:active .icon,.wrapper:hover .icon{color:var(--calcite-select-icon-color-hover, var(--calcite-color-text-1))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([scale=s]){--calcite-internal-select-font-size: var(--calcite-font-size-relative-sm);--calcite-select-spacing-inline: .5rem 2rem;--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-sm);--calcite-internal-select-block-size: 24px}:host([scale=m]){--calcite-internal-select-font-size: var(--calcite-font-size-relative-base);--calcite-select-spacing-inline: .75rem 2.5rem;--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-md)}:host([scale=l]){--calcite-internal-select-font-size: var(--calcite-font-size-relative-md);--calcite-select-spacing-inline: 1rem 3rem;--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-lg);--calcite-internal-select-block-size: 44px}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}.select{margin:0;box-sizing:border-box;inline-size:100%;cursor:pointer;appearance:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-style:solid;font-family:inherit;outline-color:transparent;font-weight:inherit;font-size:var(--calcite-select-font-size, var(--calcite-internal-select-font-size));color:var(--calcite-select-text-color, var(--calcite-color-text-2));border-color:var(--calcite-select-border-color, var(--calcite-color-border-input));border-width:var(--calcite-select-internal-border-width, var(--calcite-border-width-sm));padding-inline:var(--calcite-select-spacing-inline);padding-block:var(--calcite-internal-select-spacing-block);border-inline-end-width:0;line-height:var(--calcite-internal-select-line-height, normal);background-color:var(--calcite-select-background-color, var(--calcite-color-foreground-1));border-radius:var(--calcite-select-corner-radius, var(--calcite-corner-radius-none));box-shadow:var(--calcite-select-shadow, var(--calcite-shadow-small))}.select:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}select:disabled{border-color:var(--calcite-color-border-input);--tw-bg-opacity: 1}.icon-container{pointer-events:none;position:absolute;inset-block:0px;display:flex;align-items:center;border-width:0px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:transparent;color:var(--calcite-color-text-2);inset-inline-end:0px;border-start-start-radius:var(--calcite-select-corner-radius, var(--calcite-corner-radius-none));border-start-end-radius:var(--calcite-select-corner-radius, var(--calcite-corner-radius-none));border-end-start-radius:var(--calcite-select-corner-radius, var(--calcite-corner-radius-none));border-end-end-radius:var(--calcite-select-corner-radius, var(--calcite-corner-radius-none));border-color:var(--calcite-select-border-color, var(--calcite-color-border-input));border-inline-width:0 var(--calcite-select-internal-icon-border-inline-end-width, var(--calcite-border-width-sm));padding-inline:var(--calcite-internal-select-icon-container-padding-inline)}.icon-container .icon{color:var(--calcite-select-icon-color, var(--calcite-color-text-3))}:host([status=invalid]) select,:host([status=invalid]) .icon-container{border-color:var(--calcite-color-status-danger)}:host([status=invalid]) select:focus,:host([status=invalid]) .icon-container:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-status-danger);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.select:focus~.icon-container{border-color:transparent}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-spacing-base)}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-xxs)}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-md)}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}::slotted(input[slot=hidden-form-input]){margin:0!important;opacity:0!important;outline:none!important;padding:0!important;position:absolute!important;inset:0!important;transform:none!important;-webkit-appearance:none!important;z-index:-1!important}:host([hidden]){display:none}[hidden]{display:none}`;
16
16
  const CSS = {
17
17
  icon: "icon",
@@ -32,6 +32,7 @@ class Select extends LitElement {
32
32
  constructor() {
33
33
  super();
34
34
  this.componentToNativeEl = /* @__PURE__ */ new Map();
35
+ this.formSupport = useForm({ inputType: "text" })(this);
35
36
  this.mutationObserver = createObserver("mutation", () => this.populateInternalSelect());
36
37
  this.selectRef = createRef();
37
38
  this.messages = useT9n();
@@ -41,19 +42,6 @@ class Select extends LitElement {
41
42
  this.required = false;
42
43
  this.scale = "m";
43
44
  this.status = "idle";
44
- this.validity = {
45
- valid: false,
46
- badInput: false,
47
- customError: false,
48
- patternMismatch: false,
49
- rangeOverflow: false,
50
- rangeUnderflow: false,
51
- stepMismatch: false,
52
- tooLong: false,
53
- tooShort: false,
54
- typeMismatch: false,
55
- valueMissing: false
56
- };
57
45
  this.value = null;
58
46
  this.width = "auto";
59
47
  this.calciteSelectChange = createEvent({ cancelable: false });
@@ -61,7 +49,10 @@ class Select extends LitElement {
61
49
  this.listen("calciteInternalOptionGroupChange", this.handleOptionOrGroupChange);
62
50
  }
63
51
  static {
64
- this.properties = { disabled: [7, {}, { reflect: true, type: Boolean }], form: [3, {}, { reflect: true }], label: 1, labelText: 1, name: [3, {}, { reflect: true }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectedOption: [0, {}, { attribute: false }], status: [3, {}, { reflect: true }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [0, {}, { attribute: false }], value: 1, width: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }] };
52
+ this.properties = { disabled: [7, {}, { reflect: true, type: Boolean }], form: [3, {}, { reflect: true }], label: 1, labelText: 1, name: [3, {}, { reflect: true }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectedOption: [0, {}, { attribute: false }], status: [3, {}, { reflect: true }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [32, {}, { readOnly: true, attribute: false }], value: 1, width: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }] };
53
+ }
54
+ static {
55
+ this.formAssociated = true;
65
56
  }
66
57
  static {
67
58
  this.styles = styles;
@@ -76,7 +67,6 @@ class Select extends LitElement {
76
67
  childList: true
77
68
  });
78
69
  connectLabel(this);
79
- connectForm(this);
80
70
  }
81
71
  willUpdate(changes) {
82
72
  if (changes.has("value") && (this.hasUpdated || this.value !== null)) {
@@ -93,13 +83,12 @@ class Select extends LitElement {
93
83
  this.populateInternalSelect();
94
84
  const selected = this.selectRef.value?.selectedOptions[0];
95
85
  this.selectFromNativeOption(selected);
96
- afterConnectDefaultValueSet(this, this.selectedOption?.value ?? "");
86
+ this.formSupport.overrideDefaultValue(this.selectedOption?.value ?? "");
97
87
  }
98
88
  disconnectedCallback() {
99
89
  super.disconnectedCallback();
100
90
  this.mutationObserver?.disconnect();
101
91
  disconnectLabel(this);
102
- disconnectForm(this);
103
92
  }
104
93
  handleInternalSelectChange() {
105
94
  const selected = this.selectRef.value.selectedOptions[0];
@@ -196,7 +185,7 @@ class Select extends LitElement {
196
185
  }
197
186
  render() {
198
187
  const { disabled } = this;
199
- return this.interactiveContainer({ disabled, children: html`${this.labelText && InternalLabel({ labelText: this.labelText, onClick: this.onLabelClick, required: this.required, tooltipText: this.messages.required }) || ""}<div class=${safeClassMap(CSS.wrapper)}><select aria-errormessage=${IDS.validationMessage} .ariaInvalid=${this.status === "invalid"} .ariaLabel=${getLabelText(this)} class=${safeClassMap(CSS.select)} .disabled=${disabled} @change=${this.handleInternalSelectChange} .required=${this.required} ${ref(this.selectRef)}><slot></slot></select>${this.renderChevron()}${HiddenFormInputSlot({ component: this })}</div>${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}` });
188
+ return this.interactiveContainer({ disabled, children: html`${this.labelText && InternalLabel({ labelText: this.labelText, onClick: this.onLabelClick, required: this.required, tooltipText: this.messages.required }) || ""}<div class=${safeClassMap(CSS.wrapper)}><select aria-errormessage=${IDS.validationMessage} .ariaInvalid=${this.status === "invalid"} .ariaLabel=${getLabelText(this)} class=${safeClassMap(CSS.select)} .disabled=${disabled} @change=${this.handleInternalSelectChange} .required=${this.required} ${ref(this.selectRef)}><slot></slot></select>${this.renderChevron()}</div>${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}` });
200
189
  }
201
190
  }
202
191
  customElement("calcite-select", Select);