adp-web-components 0.1.84 → 0.1.86

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 (351) hide show
  1. package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +7 -7
  2. package/dist/cjs/flexible-container.cjs.entry.js +1 -1
  3. package/dist/cjs/form-checkbox.cjs.entry.js +4 -4
  4. package/dist/cjs/form-date-picker.cjs.entry.js +5 -5
  5. package/dist/cjs/form-dialog_13.cjs.entry.js +4568 -40
  6. package/dist/cjs/{form-input-CfVsbpFP.js → form-input-cvIkC0L1.js} +1 -1
  7. package/dist/cjs/form-input_5.cjs.entry.js +356 -0
  8. package/dist/cjs/form-switch.cjs.entry.js +4 -4
  9. package/dist/cjs/form-time-picker.cjs.entry.js +6 -6
  10. package/dist/cjs/functions-D5J5cdK2.js +298 -0
  11. package/dist/cjs/general-form.cjs.entry.js +19 -20
  12. package/dist/cjs/general-inquiry-form.cjs.entry.js +19 -20
  13. package/dist/cjs/{get-language-from-url-DoohcPbK.js → get-language-from-url-Ct6kvnEu.js} +8 -5
  14. package/dist/cjs/{get-local-language-zK9ue0lN.js → get-local-language-CWfRQqOw.js} +1 -1
  15. package/dist/cjs/{get-mock-files-DRVrAMed.js → get-mock-files-DG4Nk29D.js} +1 -1
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
  18. package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +3 -3
  19. package/dist/cjs/{state-object-CX8v4Go5.js → mappers-C82gH1dw.js} +1 -11
  20. package/dist/cjs/part-lookup.cjs.entry.js +2 -2
  21. package/dist/cjs/service-booking-form.cjs.entry.js +19 -20
  22. package/dist/cjs/shift-checkbox.cjs.entry.js +2 -2
  23. package/dist/cjs/shift-components.cjs.js +1 -1
  24. package/dist/cjs/shift-slider.cjs.entry.js +1 -1
  25. package/dist/cjs/shift-switch.cjs.entry.js +2 -2
  26. package/dist/cjs/shift-tab-content.cjs.entry.js +1 -1
  27. package/dist/cjs/shift-tabs_2.cjs.entry.js +12 -12
  28. package/dist/cjs/ssc-lookup-form.cjs.entry.js +19 -20
  29. package/dist/cjs/test-drive-form.cjs.entry.js +19 -20
  30. package/dist/cjs/{validation-BAHdEc4w.js → validation-jJwLyk27.js} +1 -7
  31. package/dist/cjs/vehicle-accessories_7.cjs.entry.js +19 -19
  32. package/dist/cjs/vehicle-lookup.cjs.entry.js +4 -4
  33. package/dist/cjs/vehicle-quotation-form.cjs.entry.js +17 -27
  34. package/dist/cjs/{white-loader-kSznMo_u.js → white-loader-D6sR0fOI.js} +3 -1
  35. package/dist/collection/collection-manifest.json +1 -0
  36. package/dist/collection/components/components/empty.css +1 -1
  37. package/dist/collection/components/components/flexible-container.css +1 -1
  38. package/dist/collection/components/components/loading-spinner.css +1 -1
  39. package/dist/collection/components/components/shift-checkbox.js +1 -1
  40. package/dist/collection/components/components/shift-select.css +1 -0
  41. package/dist/collection/components/components/shift-select.js +568 -0
  42. package/dist/collection/components/components/shift-slider.js +1 -1
  43. package/dist/collection/components/components/shift-switch.js +1 -1
  44. package/dist/collection/components/components/shift-tab-content.js +1 -1
  45. package/dist/collection/components/components/shift-tabs.css +1 -1
  46. package/dist/collection/components/components/shift-tabs.js +2 -2
  47. package/dist/collection/components/form-elements/components/form-input-prefix.js +3 -1
  48. package/dist/collection/components/form-elements/form-checkbox.js +1 -1
  49. package/dist/collection/components/form-elements/form-date-picker-legacy.js +4 -4
  50. package/dist/collection/components/form-elements/form-dialog.js +3 -3
  51. package/dist/collection/components/form-elements/form-file.js +2 -2
  52. package/dist/collection/components/form-elements/form-input.js +2 -2
  53. package/dist/collection/components/form-elements/form-inputs.css +1 -1
  54. package/dist/collection/components/form-elements/form-phone-number.js +130 -30
  55. package/dist/collection/components/form-elements/form-picker-input.js +2 -2
  56. package/dist/collection/components/form-elements/form-select.js +12 -73
  57. package/dist/collection/components/form-elements/form-stepper.js +1 -1
  58. package/dist/collection/components/form-elements/form-structure-error.js +1 -1
  59. package/dist/collection/components/form-elements/form-structure.js +1 -1
  60. package/dist/collection/components/form-elements/form-switch.js +1 -1
  61. package/dist/collection/components/form-elements/form-text-area.js +2 -2
  62. package/dist/collection/components/form-elements/form-time-picker-legacy.js +5 -5
  63. package/dist/collection/components/form-elements/form-vin-input.js +2 -2
  64. package/dist/collection/components/forms/defaults/mappers.js +1 -7
  65. package/dist/collection/components/forms/defaults/style.css +1 -1
  66. package/dist/collection/components/forms/defaults/validation.js +1 -7
  67. package/dist/collection/components/forms/general-form.js +4 -6
  68. package/dist/collection/components/forms/general-inquiry.js +4 -6
  69. package/dist/collection/components/forms/service-booking.js +4 -6
  70. package/dist/collection/components/forms/ssc-lookup.js +4 -6
  71. package/dist/collection/components/forms/test-drive.js +4 -6
  72. package/dist/collection/components/forms/vehicle-quotation/element-mapper.js +1 -8
  73. package/dist/collection/components/forms/vehicle-quotation/themes.css +1 -1
  74. package/dist/collection/components/forms/vehicle-quotation/validations.js +0 -5
  75. package/dist/collection/components/forms/vehicle-quotation.js +3 -3
  76. package/dist/collection/components/part-lookup/dead-stock-lookup.js +2 -2
  77. package/dist/collection/components/part-lookup/distributor-lookup.js +2 -2
  78. package/dist/collection/components/part-lookup/manufacturer-lookup.js +1 -1
  79. package/dist/collection/components/part-lookup/manufacturer-part-lookup.css +1 -1
  80. package/dist/collection/components/part-lookup/manufacturer-part-lookup.js +1 -1
  81. package/dist/collection/components/part-lookup/part-lookup.js +1 -1
  82. package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
  83. package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +1 -1
  84. package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
  85. package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +4 -4
  86. package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
  87. package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.js +8 -8
  88. package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
  89. package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +1 -1
  90. package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
  91. package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.js +1 -1
  92. package/dist/collection/components/vehicle-lookup/vehicle-sale-information.css +1 -1
  93. package/dist/collection/components/vehicle-lookup/vehicle-sale-information.js +2 -2
  94. package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -1
  95. package/dist/collection/components/vehicle-lookup/vehicle-service-history.js +1 -1
  96. package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
  97. package/dist/collection/components/vehicle-lookup/vehicle-specification.js +1 -1
  98. package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -1
  99. package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.js +1 -1
  100. package/dist/collection/components/vin-extractor/vin-extractor.js +1 -1
  101. package/dist/collection/features/form-hook/form-hook.js +8 -5
  102. package/dist/collection/features/form-hook/functions.js +0 -1
  103. package/dist/collection/features/form-hook/phone-validator.js +1 -41
  104. package/dist/components/dead-stock-lookup.js +1 -1
  105. package/dist/components/distributor-lookup.js +1 -1
  106. package/dist/components/flexible-container.js +1 -1
  107. package/dist/components/form-checkbox.js +1 -1
  108. package/dist/components/form-date-picker.js +1 -1
  109. package/dist/components/form-dialog.js +1 -1
  110. package/dist/components/form-file.js +1 -1
  111. package/dist/components/form-input-preview.js +1 -1
  112. package/dist/components/form-input.js +1 -1
  113. package/dist/components/form-phone-number.js +1 -1
  114. package/dist/components/form-picker-input.js +1 -1
  115. package/dist/components/form-select.js +1 -1
  116. package/dist/components/form-shadow-input.js +1 -1
  117. package/dist/components/form-stepper-control.js +1 -1
  118. package/dist/components/form-stepper-submit.js +1 -1
  119. package/dist/components/form-stepper.js +1 -1
  120. package/dist/components/form-structure-error.js +1 -1
  121. package/dist/components/form-structure.js +1 -1
  122. package/dist/components/form-submit.js +1 -1
  123. package/dist/components/form-switch.js +1 -1
  124. package/dist/components/form-text-area.js +1 -1
  125. package/dist/components/form-time-picker.js +1 -1
  126. package/dist/components/form-vin-input.js +1 -1
  127. package/dist/components/general-form.js +1 -1
  128. package/dist/components/general-inquiry-form.js +1 -1
  129. package/dist/components/information-table.js +1 -1
  130. package/dist/components/loading-spinner.js +1 -1
  131. package/dist/components/manufacturer-lookup.js +1 -1
  132. package/dist/components/manufacturer-part-lookup.js +1 -1
  133. package/dist/components/p-04wNXJ_q.js +5 -0
  134. package/dist/components/p-4n_cgPjf.js +5 -0
  135. package/dist/components/p-8XSbLgc1.js +5 -0
  136. package/dist/components/p-B8X9IaVO.js +5 -0
  137. package/dist/components/p-BDgNqOMe.js +5 -0
  138. package/dist/components/p-BFxBL1n-.js +5 -0
  139. package/dist/components/p-BUnCuQVo.js +5 -0
  140. package/dist/components/p-BV90NnNh.js +5 -0
  141. package/dist/components/p-BY5Ji84D.js +5 -0
  142. package/dist/components/{p-CNzel4L2.js → p-BgttkHzs.js} +1 -1
  143. package/dist/components/p-Bk0lC2Er.js +5 -0
  144. package/dist/components/p-C2TMzq3P.js +5 -0
  145. package/dist/components/p-C5obPa8c.js +5 -0
  146. package/dist/components/{p-BgC7TfjM.js → p-CAvWNw8_.js} +1 -1
  147. package/dist/components/{p-B9DO0698.js → p-CHjkTvcK.js} +1 -1
  148. package/dist/components/p-CJbV4CRN.js +5 -0
  149. package/dist/components/p-CKWUV8sc.js +5 -0
  150. package/dist/components/p-CO0Weo2C.js +5 -0
  151. package/dist/components/p-CQ1pe5_N.js +5 -0
  152. package/dist/components/p-CSltLdDZ.js +5 -0
  153. package/dist/components/p-CVP-Kfuq.js +5 -0
  154. package/dist/components/p-CX0MCoJm.js +5 -0
  155. package/dist/components/p-CZPaKPho.js +5 -0
  156. package/dist/components/p-CxL9hBt2.js +5 -0
  157. package/dist/components/p-D1sSrUE7.js +5 -0
  158. package/dist/components/p-D5Vp16LE.js +5 -0
  159. package/dist/components/p-DAOx9Qnb.js +5 -0
  160. package/dist/components/p-DEniRp-Y.js +5 -0
  161. package/dist/components/p-DNT9N8sa.js +5 -0
  162. package/dist/components/p-DdJblbUj.js +5 -0
  163. package/dist/components/{p-BV8ZkPEF.js → p-DqaISuxu.js} +1 -1
  164. package/dist/components/p-E1MRBxpY.js +5 -0
  165. package/dist/components/p-EVz2SQxD.js +5 -0
  166. package/dist/components/p-KlUIwQJ_.js +5 -0
  167. package/dist/components/p-NC__PzEk.js +5 -0
  168. package/dist/components/p-OMoAsmX4.js +5 -0
  169. package/dist/components/p-R9s5HIai.js +5 -0
  170. package/dist/components/p-Rs-gwVEC.js +5 -0
  171. package/dist/components/p-Toqpa7YK.js +5 -0
  172. package/dist/components/p-ZTF1sGMh.js +5 -0
  173. package/dist/components/p-ajNVZbZb.js +5 -0
  174. package/dist/components/p-lM8Wndby.js +5 -0
  175. package/dist/components/p-nzjwgyi2.js +5 -0
  176. package/dist/components/p-rgNGWak-.js +5 -0
  177. package/dist/components/part-lookup.js +1 -1
  178. package/dist/components/service-booking-form.js +1 -1
  179. package/dist/components/shift-accordion.js +1 -1
  180. package/dist/components/shift-checkbox.js +1 -1
  181. package/dist/components/shift-select.d.ts +11 -0
  182. package/dist/components/shift-select.js +5 -0
  183. package/dist/components/shift-slider.js +1 -1
  184. package/dist/components/shift-switch.js +1 -1
  185. package/dist/components/shift-tab-content.js +1 -1
  186. package/dist/components/shift-tabs.js +1 -1
  187. package/dist/components/ssc-lookup-form.js +1 -1
  188. package/dist/components/test-drive-form.js +1 -1
  189. package/dist/components/vehicle-accessories.js +1 -1
  190. package/dist/components/vehicle-claimable-items.js +1 -1
  191. package/dist/components/vehicle-item-claim-form.js +1 -1
  192. package/dist/components/vehicle-lookup.js +1 -1
  193. package/dist/components/vehicle-paint-thickness.js +1 -1
  194. package/dist/components/vehicle-quotation-form.js +1 -1
  195. package/dist/components/vehicle-sale-information.js +1 -1
  196. package/dist/components/vehicle-service-history.js +1 -1
  197. package/dist/components/vehicle-specification.js +1 -1
  198. package/dist/components/vehicle-warranty-details.js +1 -1
  199. package/dist/components/vin-extractor.js +1 -1
  200. package/dist/esm/dead-stock-lookup_3.entry.js +7 -7
  201. package/dist/esm/flexible-container.entry.js +1 -1
  202. package/dist/esm/form-checkbox.entry.js +4 -4
  203. package/dist/esm/form-date-picker.entry.js +5 -5
  204. package/dist/esm/form-dialog_13.entry.js +4569 -41
  205. package/dist/esm/{form-input-BZhw7_xV.js → form-input-Dcr-Pd8b.js} +1 -1
  206. package/dist/esm/form-input_5.entry.js +350 -0
  207. package/dist/esm/form-switch.entry.js +4 -4
  208. package/dist/esm/form-time-picker.entry.js +6 -6
  209. package/dist/esm/functions-DtSiZ2w7.js +287 -0
  210. package/dist/esm/general-form.entry.js +10 -11
  211. package/dist/esm/general-inquiry-form.entry.js +10 -11
  212. package/dist/esm/{get-language-from-url-X9X1Ax8Z.js → get-language-from-url-C-Rb5RW0.js} +8 -5
  213. package/dist/esm/{get-local-language-CDB3-v5P.js → get-local-language-TggqJhkD.js} +1 -1
  214. package/dist/esm/{get-mock-files-CaGwKZM4.js → get-mock-files-CqnoWX3h.js} +1 -1
  215. package/dist/esm/loader.js +1 -1
  216. package/dist/esm/loading-spinner.entry.js +1 -1
  217. package/dist/esm/manufacturer-part-lookup.entry.js +3 -3
  218. package/dist/esm/{state-object-YMqxT3DF.js → mappers-Bk5UgY3t.js} +2 -11
  219. package/dist/esm/part-lookup.entry.js +2 -2
  220. package/dist/esm/service-booking-form.entry.js +10 -11
  221. package/dist/esm/shift-checkbox.entry.js +2 -2
  222. package/dist/esm/shift-components.js +1 -1
  223. package/dist/esm/shift-slider.entry.js +1 -1
  224. package/dist/esm/shift-switch.entry.js +2 -2
  225. package/dist/esm/shift-tab-content.entry.js +1 -1
  226. package/dist/esm/shift-tabs_2.entry.js +12 -12
  227. package/dist/esm/ssc-lookup-form.entry.js +10 -11
  228. package/dist/esm/test-drive-form.entry.js +10 -11
  229. package/dist/esm/{validation-DI1MnYKr.js → validation-oieVWBn1.js} +1 -7
  230. package/dist/esm/vehicle-accessories_7.entry.js +19 -19
  231. package/dist/esm/vehicle-lookup.entry.js +4 -4
  232. package/dist/esm/vehicle-quotation-form.entry.js +8 -18
  233. package/dist/esm/{white-loader-CG4JPVdv.js → white-loader-DG6pqLQw.js} +3 -1
  234. package/dist/mocks/generated/broker-dealer/part-lookup.json +127 -0
  235. package/dist/mocks/generated/broker-dealer/vehicle-lookup.json +275 -0
  236. package/dist/shift-components/p-0f6a4a2c.entry.js +5 -0
  237. package/dist/shift-components/p-1c18a25e.entry.js +5 -0
  238. package/dist/shift-components/p-29cb1041.entry.js +5 -0
  239. package/dist/shift-components/p-3123d3fd.entry.js +5 -0
  240. package/dist/shift-components/p-411f777f.entry.js +5 -0
  241. package/dist/shift-components/{p-3d1e5f22.entry.js → p-5ce126f7.entry.js} +1 -1
  242. package/dist/shift-components/p-5db9ae4b.entry.js +5 -0
  243. package/dist/shift-components/p-800d78fe.entry.js +5 -0
  244. package/dist/shift-components/p-8882ac0f.entry.js +5 -0
  245. package/dist/shift-components/{p-BJJ8dVwO.js → p-B8VkFyfR.js} +1 -1
  246. package/dist/shift-components/p-BuurMgGN.js +5 -0
  247. package/dist/shift-components/{p-Be3Jd2wI.js → p-Bvk_2TgY.js} +1 -1
  248. package/dist/shift-components/p-DQUCHNJ-.js +5 -0
  249. package/dist/shift-components/p-DlOwT0yg.js +5 -0
  250. package/dist/shift-components/{p-DT8y6uYH.js → p-EubhneKo.js} +1 -1
  251. package/dist/shift-components/p-YbxvNbN5.js +5 -0
  252. package/dist/shift-components/p-a4abc248.entry.js +5 -0
  253. package/dist/shift-components/p-a9f6c258.entry.js +5 -0
  254. package/dist/shift-components/p-adb7282c.entry.js +5 -0
  255. package/dist/shift-components/p-b6518621.entry.js +5 -0
  256. package/dist/shift-components/p-ca014643.entry.js +5 -0
  257. package/dist/shift-components/p-cc033f27.entry.js +5 -0
  258. package/dist/shift-components/p-ccb80e4d.entry.js +5 -0
  259. package/dist/shift-components/p-cf23180a.entry.js +5 -0
  260. package/dist/shift-components/p-d6619b20.entry.js +5 -0
  261. package/dist/shift-components/p-d6dfb9bd.entry.js +5 -0
  262. package/dist/shift-components/p-df8df3ab.entry.js +5 -0
  263. package/dist/shift-components/{p-76fe6d18.entry.js → p-e225d38c.entry.js} +1 -1
  264. package/dist/shift-components/p-e3252106.entry.js +5 -0
  265. package/dist/shift-components/p-f6b6e66e.entry.js +5 -0
  266. package/dist/shift-components/p-f6f9027f.entry.js +5 -0
  267. package/dist/shift-components/p-veklgezh.js +5 -0
  268. package/dist/shift-components/shift-components.esm.js +1 -1
  269. package/dist/types/components/components/shift-select.d.ts +41 -0
  270. package/dist/types/components/form-elements/form-phone-number.d.ts +19 -3
  271. package/dist/types/components/form-elements/form-select.d.ts +3 -9
  272. package/dist/types/components/forms/defaults/mappers.d.ts +1 -1
  273. package/dist/types/components/forms/defaults/validation.d.ts +1 -3
  274. package/dist/types/components/forms/vehicle-quotation/element-mapper.d.ts +2 -3
  275. package/dist/types/components/forms/vehicle-quotation/validations.d.ts +3 -3
  276. package/dist/types/components.d.ts +123 -4
  277. package/dist/types/features/form-hook/interface.d.ts +1 -0
  278. package/dist/types/features/form-hook/phone-validator.d.ts +1 -2
  279. package/package.json +1 -1
  280. package/dist/cjs/form-input_4.cjs.entry.js +0 -319
  281. package/dist/cjs/phone-validator-Bi9emAzR.js +0 -4791
  282. package/dist/collection/components/forms/defaults/state-object.js +0 -5
  283. package/dist/components/p-3U517ERo.js +0 -5
  284. package/dist/components/p-9SYAxR5D.js +0 -5
  285. package/dist/components/p-B0MhGaG1.js +0 -5
  286. package/dist/components/p-B9pETmLI.js +0 -5
  287. package/dist/components/p-BJu-gvWT.js +0 -5
  288. package/dist/components/p-BSODiZ3e.js +0 -5
  289. package/dist/components/p-BYlmz8H8.js +0 -5
  290. package/dist/components/p-BaXSdgrz.js +0 -5
  291. package/dist/components/p-BbYlJcJL.js +0 -5
  292. package/dist/components/p-BbZZSs2z.js +0 -5
  293. package/dist/components/p-Be6aBWtX.js +0 -5
  294. package/dist/components/p-Bru6COhI.js +0 -5
  295. package/dist/components/p-BxeKiQ5h.js +0 -5
  296. package/dist/components/p-C0-JyFe2.js +0 -5
  297. package/dist/components/p-CDynFOo9.js +0 -5
  298. package/dist/components/p-CRB1QtlE.js +0 -5
  299. package/dist/components/p-CRuaQMX0.js +0 -5
  300. package/dist/components/p-CnzWHmTp.js +0 -5
  301. package/dist/components/p-Cr6RxvjN.js +0 -5
  302. package/dist/components/p-CvwANsMG.js +0 -5
  303. package/dist/components/p-D6G60Qle.js +0 -5
  304. package/dist/components/p-DNwpXqOm.js +0 -5
  305. package/dist/components/p-DYdL_Qjt.js +0 -5
  306. package/dist/components/p-D_aPhtf6.js +0 -5
  307. package/dist/components/p-DaR1VHdR.js +0 -5
  308. package/dist/components/p-DqPjMHKd.js +0 -5
  309. package/dist/components/p-DrRm2GeC.js +0 -5
  310. package/dist/components/p-JZv7UYk_.js +0 -5
  311. package/dist/components/p-MW_RDlUT.js +0 -5
  312. package/dist/components/p-Sl_Dlac0.js +0 -5
  313. package/dist/components/p-V4RS2bVl.js +0 -5
  314. package/dist/components/p-d53FlScY.js +0 -5
  315. package/dist/components/p-jy9nZx0Y.js +0 -5
  316. package/dist/components/p-l6FwCuo4.js +0 -5
  317. package/dist/components/p-nSzOFNku.js +0 -5
  318. package/dist/components/p-okkx_Dxf.js +0 -5
  319. package/dist/components/p-pgyBiEEk.js +0 -5
  320. package/dist/components/p-uERtY6Fc.js +0 -5
  321. package/dist/components/p-zPFPWP-C.js +0 -5
  322. package/dist/esm/form-input_4.entry.js +0 -314
  323. package/dist/esm/phone-validator-BtVkeXq8.js +0 -4779
  324. package/dist/shift-components/p-11d17669.entry.js +0 -5
  325. package/dist/shift-components/p-19ed338d.entry.js +0 -5
  326. package/dist/shift-components/p-3058431e.entry.js +0 -5
  327. package/dist/shift-components/p-342d0174.entry.js +0 -5
  328. package/dist/shift-components/p-3c9fc400.entry.js +0 -5
  329. package/dist/shift-components/p-3e83654e.entry.js +0 -5
  330. package/dist/shift-components/p-54f0635f.entry.js +0 -5
  331. package/dist/shift-components/p-58b67b80.entry.js +0 -5
  332. package/dist/shift-components/p-60e77a30.entry.js +0 -5
  333. package/dist/shift-components/p-676836bc.entry.js +0 -5
  334. package/dist/shift-components/p-73d4e1db.entry.js +0 -5
  335. package/dist/shift-components/p-78ebd5aa.entry.js +0 -5
  336. package/dist/shift-components/p-7PtHUjhE.js +0 -5
  337. package/dist/shift-components/p-7fd11913.entry.js +0 -5
  338. package/dist/shift-components/p-B1_PA5hq.js +0 -5
  339. package/dist/shift-components/p-CIoBnd96.js +0 -5
  340. package/dist/shift-components/p-CN6bh2lr.js +0 -5
  341. package/dist/shift-components/p-Cm_2J53u.js +0 -5
  342. package/dist/shift-components/p-b7ccfb5d.entry.js +0 -5
  343. package/dist/shift-components/p-c35b5c7e.entry.js +0 -5
  344. package/dist/shift-components/p-cdea798f.entry.js +0 -5
  345. package/dist/shift-components/p-e1994b6f.entry.js +0 -5
  346. package/dist/shift-components/p-e2ced3b0.entry.js +0 -5
  347. package/dist/shift-components/p-e42c0a58.entry.js +0 -5
  348. package/dist/shift-components/p-f4dbe8aa.entry.js +0 -5
  349. package/dist/shift-components/p-fb4a3ba5.entry.js +0 -5
  350. package/dist/shift-components/p-fe87b5dc.entry.js +0 -5
  351. package/dist/types/components/forms/defaults/state-object.d.ts +0 -6
@@ -8,25 +8,87 @@ import { getInputLocalization } from "../../features/form-hook/index";
8
8
  import { FormInputLabel } from "./components/form-input-label";
9
9
  import { FormErrorMessage } from "./components/form-error-message";
10
10
  import { FormInputPrefix } from "./components/form-input-prefix";
11
+ import { string } from "yup";
12
+ import { AsYouType } from "libphonenumber-js";
13
+ import { y } from "../forms/defaults/validation";
11
14
  const partKeyPrefix = 'form-input-';
12
15
  export class FormPhoneNumber {
13
16
  constructor() {
14
17
  this.type = 'text';
15
- this.localization = {};
16
18
  this.prefixWidth = 0;
19
+ this.localization = {};
20
+ this.countryCode = 'IQ';
21
+ this.isOpen = false;
22
+ this.externalRequired = false;
17
23
  this.onInputChange = (event) => {
18
24
  const target = event.target;
19
25
  this.validator.reset();
20
- target.value = this.validator.input(target.value);
26
+ target.value = this.validator.input(this.getValue()).replace(this.inputPrefix, '').trim();
27
+ this.form.onInput(event);
28
+ };
29
+ this.validate = () => {
30
+ // @ts-ignore
31
+ let v = string().meta(y.meta(this.name));
32
+ v = v.test(y.require(this.name), y.require(this.name), value => {
33
+ if (!this.externalRequired && !this.required)
34
+ return true;
35
+ return !!value.replace(this.inputPrefix, '').trim();
36
+ });
37
+ v = v.test(y.format(this.name), y.format(this.name), value => {
38
+ if (!value.replace(this.inputPrefix, '').trim())
39
+ return true; // let required handle empty cases
40
+ const checker = new AsYouType(this.selectedValue);
41
+ checker.input(this.getValue());
42
+ return checker.isValid();
43
+ });
44
+ return v;
45
+ };
46
+ this.getValue = () => {
47
+ var _a;
48
+ const raw = this.inputRef.value.trim().replace(/^\+/, '');
49
+ const prefix = (_a = this.inputPrefix) === null || _a === void 0 ? void 0 : _a.trim().replace(/^\+/, '');
50
+ const stripped = raw.startsWith(prefix) ? raw.slice(prefix.length).trim() : raw;
51
+ const hasPrefix = raw.startsWith(prefix);
52
+ return hasPrefix ? '+' + prefix + ' ' + stripped : this.inputPrefix + ' ' + raw;
53
+ };
54
+ this.updateShiftSelectContext = (newValues) => {
55
+ Object.entries(newValues).forEach(([key, value]) => {
56
+ this[key] = value;
57
+ });
58
+ };
59
+ this.handleSelection = (option) => {
60
+ this.selectedValue = option.value;
61
+ this.isOpen = false;
62
+ };
63
+ this.renderCountryOption = (renderOption) => {
64
+ var _a, _b, _c;
65
+ const v = new AsYouType((_a = renderOption.meta) === null || _a === void 0 ? void 0 : _a.code);
66
+ const countryNumber = ((_c = (_b = v.metadata) === null || _b === void 0 ? void 0 : _b.numberingPlan) === null || _c === void 0 ? void 0 : _c.metadata[0]) || '';
67
+ return (h("div", { part: cn('custom-form-select-option form-select-option', { 'custom-form-select-option-selected form-select-option-selected': this.selectedValue === renderOption.value }), class: cn('flex gap-2 overflow-hidden') }, h("span", { part: "country-code", class: "capitalize block min-w-[30px]" }, renderOption === null || renderOption === void 0 ? void 0 : renderOption.label), !!countryNumber && h("span", { part: "country-number" }, '+' + countryNumber)));
21
68
  };
22
69
  }
23
70
  async componentWillLoad() {
24
71
  this.onDefaultValueChange();
25
72
  this.form.subscribe(this.name, this);
26
73
  this.onStaticValueChange(this.staticValue, false);
74
+ if (typeof this.countryCode === 'string') {
75
+ this.selectedValue = this.countryCode;
76
+ }
77
+ else if (Array.isArray(this.countryCode) && typeof this.countryCode[0] === 'string') {
78
+ this.selectedValue = this.countryCode[0];
79
+ }
80
+ else if (Array.isArray(this.countryCode) && typeof this.countryCode[0] === 'object') {
81
+ this.selectedValue = this.countryCode[0].code;
82
+ }
83
+ }
84
+ async onCountryChange() {
85
+ var _a, _b, _c;
86
+ this.validator = new AsYouType(this.selectedValue);
87
+ this.inputPrefix = this.validator ? '+' + ((_c = (_b = (_a = this.validator) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.numberingPlan) === null || _c === void 0 ? void 0 : _c.metadata[0]) : undefined;
88
+ this.form.validateInput(this.name);
27
89
  }
28
90
  async onDefaultValueChange() {
29
- if (this.defaultValue) {
91
+ if (this.defaultValue && this.validator) {
30
92
  this.validator.reset();
31
93
  this.defaultValue = this.validator.input(this.defaultValue || '');
32
94
  }
@@ -41,8 +103,11 @@ export class FormPhoneNumber {
41
103
  this.inputRef.value = '';
42
104
  }
43
105
  }
106
+ async onValidatorChange() {
107
+ await this.componentDidLoad();
108
+ }
44
109
  async componentDidLoad() {
45
- const prefix = this.el.getElementsByClassName('prefix')[0];
110
+ const prefix = this.el.getElementsByClassName(this.name + '-prefix')[0];
46
111
  this.prefixWidth = prefix ? prefix.getBoundingClientRect().width : 0;
47
112
  this.inputRef = this.el.getElementsByClassName(partKeyPrefix + this.name)[0];
48
113
  }
@@ -58,13 +123,23 @@ export class FormPhoneNumber {
58
123
  }
59
124
  render() {
60
125
  const { disabled, isRequired, meta, isError, errorMessage } = this.form.getInputState(this.name);
61
- const [locale] = this.form.getFormLocale();
62
126
  const part = partKeyPrefix + this.name;
63
127
  const { label, placeholder, errorTextMessage } = getInputLocalization(this, meta, errorMessage);
64
- const isDisabled = disabled || this.isLoading || !!this.staticValue || this.isDisabled;
65
- return (h(Host, { key: 'e84058ed5c9b0a95c7ce67bf849a0e7de8c1deb3' }, h("label", { key: '4be4a5cf698cf5bea3ff4082db1760862c606c3a', part: this.name, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: 'dc74dadc292e08c731847fa8e5955e20f73aaae0', name: this.name, isRequired: isRequired, label: label }), h("div", { key: 'a2b18f59911bb6d489027007652f4bb1bf3d8237', dir: "ltr", part: `${this.name}-container form-input-container`, class: "form-input-container" }, h(FormInputPrefix, { key: '71b5223176fbdef788060cba6c60bbbbf83be80e', name: this.name, direction: locale.sharedFormLocales.direction, prefix: this.inputPrefix }), h("input", { key: 'b1618e490c2ab2d79b3cda9d617a3abcd4eda956', type: this.type, name: this.name, disabled: isDisabled, onInput: this.onInputChange, defaultValue: this.defaultValue, part: `${this.name}-input form-input`, placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), style: Object.assign({}, (this.prefixWidth ? { [locale.sharedFormLocales.direction === 'rtl' ? 'paddingRight' : 'paddingLeft']: `${this.prefixWidth}px` } : {})), class: cn('form-input-style', part, {
128
+ const isDisabled = disabled || this.isLoading || !!this.staticValue || this.isDisabled || !this.selectedValue;
129
+ this.externalRequired = isRequired;
130
+ const hasMultipleCountries = Array.isArray(this.countryCode) && this.countryCode.length > 1;
131
+ const options = Array.isArray(this.countryCode) &&
132
+ this.countryCode.map(country => {
133
+ if (typeof country === 'string') {
134
+ return { value: country, label: country, meta: { code: country } };
135
+ }
136
+ else {
137
+ return { value: country.code, label: country === null || country === void 0 ? void 0 : country.code, meta: { code: country.code } };
138
+ }
139
+ });
140
+ return (h(Host, { translate: "no" }, h("label", { part: this.name, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { name: this.name, isRequired: isRequired, label: label }), h("div", { dir: "ltr", part: cn(`${this.name}-container form-input-container form-phone-container`, { 'form-input-container-country': hasMultipleCountries }), class: cn('form-input-container form-phone-container', { 'form-input-container-country': hasMultipleCountries }) }, hasMultipleCountries && (h("div", { part: `${this.name}-input-country-selection form-input form-input-country-selection`, class: cn('form-input-country-selection shrink-0') }, h("shift-select", { hasTick: false, options: options, isOpen: this.isOpen, disableInput: isDisabled, selectedValue: this.selectedValue, handleSelection: this.handleSelection, renderOption: this.renderCountryOption, name: this.name + '-country-selection', updateContext: this.updateShiftSelectContext }))), h("div", { part: "form-input-container-wrapper", class: cn('form-input-container-wrapper', { 'flex-1 relative': hasMultipleCountries }) }, h(FormInputPrefix, { name: this.name, direction: "ltr", prefix: this.inputPrefix }), h("input", { type: this.type, name: this.name, disabled: isDisabled, onInput: this.onInputChange, defaultValue: this.defaultValue, part: cn(`${this.name}-input form-input`, { [`${this.name}-input-with-country form-input-with-country`]: hasMultipleCountries }), placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), style: Object.assign({}, (this.prefixWidth ? { ['paddingLeft']: `${this.prefixWidth}px` } : {})), class: cn('form-input-style', part, {
66
141
  'form-input-error-style': isError,
67
- }) })), h(FormErrorMessage, { key: '49e40e5dace5b4a9f8b1faaa240b09809741be06', name: this.name, isError: isError, errorMessage: errorTextMessage }))));
142
+ }) }))), h(FormErrorMessage, { name: this.name, isError: isError, errorMessage: errorTextMessage }))));
68
143
  }
69
144
  static get is() { return "form-phone-number"; }
70
145
  static get originalStyleUrls() {
@@ -117,6 +192,25 @@ export class FormPhoneNumber {
117
192
  "setter": false,
118
193
  "reflect": false
119
194
  },
195
+ "required": {
196
+ "type": "boolean",
197
+ "attribute": "required",
198
+ "mutable": false,
199
+ "complexType": {
200
+ "original": "boolean",
201
+ "resolved": "boolean",
202
+ "references": {}
203
+ },
204
+ "required": false,
205
+ "optional": true,
206
+ "docs": {
207
+ "tags": [],
208
+ "text": ""
209
+ },
210
+ "getter": false,
211
+ "setter": false,
212
+ "reflect": false
213
+ },
120
214
  "isLoading": {
121
215
  "type": "boolean",
122
216
  "attribute": "is-loading",
@@ -275,44 +369,39 @@ export class FormPhoneNumber {
275
369
  "setter": false,
276
370
  "reflect": false
277
371
  },
278
- "validator": {
372
+ "localization": {
279
373
  "type": "unknown",
280
- "attribute": "validator",
374
+ "attribute": "localization",
281
375
  "mutable": false,
282
376
  "complexType": {
283
- "original": "PhoneValidator",
284
- "resolved": "AsYouType & { default: string; formattedOutput: string; metadata: { numberingPlan: { metadata: [string]; }; }; geIsValidPhoneNumber: () => boolean; }",
377
+ "original": "FormInputLocalization",
378
+ "resolved": "{ [lang: string]: { label?: string; placeholder?: string; require?: string; format?: string; minMessage: string; maxMessage: string; betweenMessage: string; }; }",
285
379
  "references": {
286
- "PhoneValidator": {
380
+ "FormInputLocalization": {
287
381
  "location": "import",
288
382
  "path": "~features/form-hook",
289
- "id": "src/features/form-hook/index.ts::PhoneValidator"
383
+ "id": "src/features/form-hook/index.ts::FormInputLocalization"
290
384
  }
291
385
  }
292
386
  },
293
387
  "required": false,
294
- "optional": false,
388
+ "optional": true,
295
389
  "docs": {
296
390
  "tags": [],
297
391
  "text": ""
298
392
  },
299
393
  "getter": false,
300
- "setter": false
394
+ "setter": false,
395
+ "defaultValue": "{}"
301
396
  },
302
- "localization": {
303
- "type": "unknown",
304
- "attribute": "localization",
397
+ "countryCode": {
398
+ "type": "string",
399
+ "attribute": "country-code",
305
400
  "mutable": false,
306
401
  "complexType": {
307
- "original": "FormInputLocalization",
308
- "resolved": "{ [lang: string]: { label?: string; placeholder?: string; require?: string; format?: string; minMessage: string; maxMessage: string; betweenMessage: string; }; }",
309
- "references": {
310
- "FormInputLocalization": {
311
- "location": "import",
312
- "path": "~features/form-hook",
313
- "id": "src/features/form-hook/index.ts::FormInputLocalization"
314
- }
315
- }
402
+ "original": "string | string[] | { code: string; icon?: string }[]",
403
+ "resolved": "string | string[] | { code: string; icon?: string; }[]",
404
+ "references": {}
316
405
  },
317
406
  "required": false,
318
407
  "optional": true,
@@ -322,23 +411,34 @@ export class FormPhoneNumber {
322
411
  },
323
412
  "getter": false,
324
413
  "setter": false,
325
- "defaultValue": "{}"
414
+ "reflect": false,
415
+ "defaultValue": "'IQ'"
326
416
  }
327
417
  };
328
418
  }
329
419
  static get states() {
330
420
  return {
331
- "prefixWidth": {}
421
+ "prefixWidth": {},
422
+ "selectedValue": {},
423
+ "isOpen": {},
424
+ "validator": {},
425
+ "externalRequired": {}
332
426
  };
333
427
  }
334
428
  static get elementRef() { return "el"; }
335
429
  static get watchers() {
336
430
  return [{
431
+ "propName": "selectedValue",
432
+ "methodName": "onCountryChange"
433
+ }, {
337
434
  "propName": "defaultValue",
338
435
  "methodName": "onDefaultValueChange"
339
436
  }, {
340
437
  "propName": "staticValue",
341
438
  "methodName": "onStaticValueChange"
439
+ }, {
440
+ "propName": "inputPrefix",
441
+ "methodName": "onValidatorChange"
342
442
  }];
343
443
  }
344
444
  }
@@ -179,9 +179,9 @@ export class FormPickerInput {
179
179
  'form-input-icon-interactive': !!this.iconAction,
180
180
  });
181
181
  const renderIcon = () => this.iconAction ? (h("button", { type: "button", disabled: isDisabled, onClick: this.iconAction, part: `${this.name}-icon form-input-icon`, class: iconClass }, this.icon)) : (h("span", { part: `${this.name}-icon form-input-icon`, class: iconClass }, this.icon));
182
- return (h(Host, { key: '1536f7ac25186302182e35ee0a925df7d87576f9' }, h("label", { key: '6c847bb0f8ae8b0ac678ab3770e285e17f0dc068', part: this.name, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: 'aff5940864c09455fe2a7204594886248b7c216f', isRequired: isRequired, label: label }), h("div", { key: '81ee5161276a47391522d307b9be29965e047ed1', part: `${this.name}-container form-input-container relative`, class: "form-input-container" }, h(FormInputPrefix, { key: '4684e33b1ba304796359b79c0ce0c4b3248ca58b', name: this.name, direction: (_b = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _b === void 0 ? void 0 : _b.direction, prefix: this.inputPrefix }), h("input", { key: 'fad8b6c2edae1491dbb18e87c4382ba43089fa32', type: "text", readonly: true, tabIndex: -1, part: `form-input`, disabled: isDisabled, value: this.displayedValue, onClick: this.onInputClick, onKeyDown: e => e.preventDefault(), placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), style: Object.assign(Object.assign(Object.assign({}, (this.prefixWidth ? { [isRtl ? 'paddingRight' : 'paddingLeft']: `${this.prefixWidth}px` } : {})), (this.icon ? { [iconPaddingSide]: '40px' } : {})), { pointerEvents: 'none' }), class: cn('form-input-style enabled:cursor-pointer', {
182
+ return (h(Host, { key: 'a808095734d28bb0a3f56ec3cc450100c66d12c5', translate: "no" }, h("label", { key: 'aa30dca9f926619689fd4961cb4e43b919cecfd7', part: this.name, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: 'c85669989b965019eef74f7e3e19b5d57d839b64', isRequired: isRequired, label: label }), h("div", { key: '85f883ea8955645be536fd7c683e67a0c6fd757d', part: `${this.name}-container form-input-container relative`, class: "form-input-container" }, h(FormInputPrefix, { key: '1c96a1a1b4c2ece451a28c06c2ad752cd99e431a', name: this.name, direction: (_b = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _b === void 0 ? void 0 : _b.direction, prefix: this.inputPrefix }), h("input", { key: '974214929d1bea617f409a036022236d05e250e0', type: "text", readonly: true, tabIndex: -1, part: `form-input`, disabled: isDisabled, value: this.displayedValue, onClick: this.onInputClick, onKeyDown: e => e.preventDefault(), placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), style: Object.assign(Object.assign(Object.assign({}, (this.prefixWidth ? { [isRtl ? 'paddingRight' : 'paddingLeft']: `${this.prefixWidth}px` } : {})), (this.icon ? { [iconPaddingSide]: '40px' } : {})), { pointerEvents: 'none' }), class: cn('form-input-style enabled:cursor-pointer', {
183
183
  'form-input-error-style': isError,
184
- }) }), h("input", Object.assign({ key: '12daf58386a6bdddbe6d085d474383ef1a0c4a66', type: this.type, name: this.name }, this.inputProps, { onBlur: this.onInputBlur, onClick: this.onInputClick, onInput: this.onInputChange, part: `${this.name}-input ${part}`, class: cn('shadow-input size-full absolute top-0 left-0 opacity-0 cursor-pointer', part), min: Array.isArray(this.min) ? decodeTimeOffset({ offsets: this.min, type: this.type }) : this.min, max: Array.isArray(this.max) ? decodeTimeOffset({ offsets: this.max, type: this.type }) : this.max })), this.icon && renderIcon()), h(FormErrorMessage, { key: '407846f793b1bd3fe776787bfc4f86fea62cd37a', name: this.name, isError: isError, errorMessage: errorTextMessage }))));
184
+ }) }), h("input", Object.assign({ key: '846c1e5a37644d0159db6339cecc009854142c9c', type: this.type, name: this.name }, this.inputProps, { onBlur: this.onInputBlur, onClick: this.onInputClick, onInput: this.onInputChange, part: `${this.name}-input ${part}`, class: cn('shadow-input size-full absolute top-0 left-0 opacity-0 cursor-pointer', part), min: Array.isArray(this.min) ? decodeTimeOffset({ offsets: this.min, type: this.type }) : this.min, max: Array.isArray(this.max) ? decodeTimeOffset({ offsets: this.max, type: this.type }) : this.max })), this.icon && renderIcon()), h(FormErrorMessage, { key: 'b6c800e4a7dd87062b3e7865afe240a608457001', name: this.name, isError: isError, errorMessage: errorTextMessage }))));
185
185
  }
186
186
  static get is() { return "form-picker-input"; }
187
187
  static get originalStyleUrls() {
@@ -4,14 +4,10 @@
4
4
  */
5
5
  import { Host, forceUpdate, h } from "@stencil/core";
6
6
  import cn from "../../global/lib/cn";
7
- import { getNestedValue } from "../../global/lib/get-nested-value";
8
7
  import { getInputLocalization } from "../../features/form-hook/index";
9
- import Loader from "~assets/loader.svg";
10
- import { TickIcon } from "../../global/assets/tick-icon";
11
- import { ArrowUpIcon } from "../../global/assets/arrow-up-icon";
12
8
  import { FormInputLabel } from "./components/form-input-label";
13
9
  import { FormErrorMessage } from "./components/form-error-message";
14
- import { AddIcon } from "../../global/assets/add-icon";
10
+ import { getNestedValue } from "../../global/lib/get-nested-value";
15
11
  export class FormSelect {
16
12
  constructor() {
17
13
  this.language = 'en';
@@ -22,36 +18,21 @@ export class FormSelect {
22
18
  this.searchValue = '';
23
19
  this.isOpen = false;
24
20
  this.selectedValue = '';
25
- this.openUpwards = false;
26
21
  this.options = [];
27
22
  this.fetchingErrorMessage = null;
28
- this.toggleDropdown = () => {
29
- if (this.isOpen && !this.searchable)
30
- this.isOpen = false;
31
- else
32
- this.adjustDropdownPosition();
23
+ this.handleSelection = (option) => {
24
+ this.selectedValue = option.value;
25
+ this.searchValue = option.label;
26
+ this.isOpen = false;
33
27
  };
34
28
  this.reset = (newValue = '') => {
35
29
  const defaultOption = this.options.find(opt => opt.value === newValue || opt.value === this.defaultValue) || { value: newValue, label: '' };
36
30
  this.handleSelection(defaultOption);
37
31
  };
38
- this.closeDropdown = (event) => {
39
- if (!this.el.contains(event.target)) {
40
- this.isOpen = false;
41
- }
42
- };
43
- this.onSearchInput = (event) => {
44
- const target = event.target;
45
- this.searchValue = target.value;
46
- this.selectedValue = '';
47
- };
48
- this.clearInput = () => {
49
- this.searchValue = '';
50
- this.selectedValue = '';
51
- const selectButton = this.el.getElementsByClassName('form-input-select')[0];
52
- selectButton.focus();
53
- if (!this.isOpen)
54
- this.adjustDropdownPosition();
32
+ this.updateShiftSelectContext = (newValues) => {
33
+ Object.entries(newValues).forEach(([key, value]) => {
34
+ this[key] = value;
35
+ });
55
36
  };
56
37
  }
57
38
  async changeLanguage() {
@@ -69,38 +50,11 @@ export class FormSelect {
69
50
  this.defaultValue = this.staticValue.value;
70
51
  this.clearable = false;
71
52
  }
72
- this.selectedValue = this.defaultValue;
73
53
  }
74
54
  async disconnectedCallback() {
75
55
  var _a;
76
56
  (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
77
57
  this.form.unsubscribe(this.name);
78
- document.removeEventListener('click', this.closeDropdown);
79
- document.removeEventListener('keydown', this.handleKeyDown.bind(this));
80
- }
81
- adjustDropdownPosition() {
82
- requestAnimationFrame(() => {
83
- const selectButton = this.el.getElementsByClassName('form-input-select')[0];
84
- const selectContainer = this.el.getElementsByClassName('form-select-container')[0];
85
- const rect = selectButton.getBoundingClientRect();
86
- const spaceBelow = window.innerHeight - rect.bottom - 20; // 20 is padding
87
- this.openUpwards = spaceBelow < selectContainer.getBoundingClientRect().height || this.forceOpenUpwards;
88
- setTimeout(() => {
89
- this.isOpen = true;
90
- }, 10);
91
- });
92
- }
93
- handleSelection(option) {
94
- this.selectedValue = option.value;
95
- this.searchValue = option.label;
96
- this.isOpen = false;
97
- }
98
- handleKeyDown(event) {
99
- if (!this.isOpen)
100
- return;
101
- if (event.key === 'Escape') {
102
- this.isOpen = false;
103
- }
104
58
  }
105
59
  async fetch() {
106
60
  var _a, _b, _c, _d;
@@ -144,8 +98,6 @@ export class FormSelect {
144
98
  }
145
99
  async componentDidLoad() {
146
100
  this.fetch();
147
- document.addEventListener('click', this.closeDropdown);
148
- document.addEventListener('keydown', this.handleKeyDown.bind(this));
149
101
  }
150
102
  render() {
151
103
  var _a, _b, _c;
@@ -159,20 +111,8 @@ export class FormSelect {
159
111
  const filteredOptions = selectedItem ? this.options : this.options.filter(option => { var _a, _b; return (_a = option === null || option === void 0 ? void 0 : option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes((_b = this.searchValue) === null || _b === void 0 ? void 0 : _b.toLowerCase()); });
160
112
  const disableInput = disabled || this.isDisabled || this.isLoading || !!this.staticValue;
161
113
  if (this.isHidden)
162
- return (h(Host, { style: { display: this.isHidden ? 'none' : 'block' } }, h("form-shadow-input", { name: this.name, form: this.form, value: this.selectedValue })));
163
- return (h(Host, null, h("label", { part: `${this.name}`, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: disableInput }) }, h(FormInputLabel, { name: this.name, isRequired: isRequired || this.isRequired, label: label }), h("div", { part: `${this.name}-container form-input-container`, class: cn('form-input-container', { open: this.isOpen, disableInput }) }, h("form-shadow-input", { name: this.name, form: this.form, value: this.selectedValue }), h("input", { type: "text", disabled: disableInput, part: `${this.name}-input-select form-input-select`, value: this.searchable ? this.searchValue : (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) || '', readOnly: !this.searchable, onInput: this.onSearchInput, onClick: this.toggleDropdown, placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), class: cn('form-input-style form-input-select', {
164
- 'form-input-error-style': isError,
165
- }) }), h("div", { part: `${this.name}-select-icon-container form-input-select-icon-container`, class: "form-input-select-icon-container" }, (selectedItem || this.searchValue) && this.clearable ? (h(AddIcon, { part: `${this.name}-cross-icon`, onClick: this.clearInput, class: "form-input-select-icon cross" })) : (h(ArrowUpIcon, { part: `${this.name}-arrow-icon select-arrow`, class: "form-input-select-icon arrow" }))), h("div", { part: cn(`${this.name}-select-container form-select-container`, {
166
- 'form-select-container-upwards': this.openUpwards || this.forceOpenUpwards,
167
- 'form-select-container-downwards': !this.openUpwards && !this.forceOpenUpwards,
168
- }), class: cn('form-select-container', {
169
- upwards: this.openUpwards || this.forceOpenUpwards,
170
- downwards: !this.openUpwards && !this.forceOpenUpwards,
171
- }) }, !!filteredOptions.length &&
172
- (this.reverseOptions ? [...filteredOptions].reverse() : filteredOptions).map(option => (h("button", { type: "button", part: cn(`${this.name}-select-option form-select-option`, { 'form-select-option-selected': this.selectedValue === option.value }), onClick: () => this.handleSelection(option), class: cn('form-select-option', {
173
- selected: this.selectedValue === option.value,
174
- }) }, h("div", { part: `${this.name}-select-option-label form-select-option-label`, class: "form-select-option-label" }, option.label), h(TickIcon, { part: `${this.name}-tick-icon`, class: "form-select-option-tick" })))), !filteredOptions.length && (h("div", { part: `${this.name}-select-empty-container form-select-empty-container`, class: cn('form-select-empty-container', { error: this.fetchingErrorMessage }) }, this.fetchingErrorMessage && (getNestedValue(locale, this.fetchingErrorMessage) || this.fetchingErrorMessage || ((_b = (_a = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _a === void 0 ? void 0 : _a.errors) === null || _b === void 0 ? void 0 : _b.wildCard)), !this.fetchingErrorMessage &&
175
- (this.isFetching ? (h("img", { part: `${this.name}-select-spinner form-select-spinner`, class: "form-select-spinner", src: Loader })) : ((_c = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _c === void 0 ? void 0 : _c.noSelectOptions)))))), h(FormErrorMessage, { name: this.name, isError: isError, errorMessage: errorTextMessage }))));
114
+ return (h(Host, { translate: "no", style: { display: this.isHidden ? 'none' : 'block' } }, h("form-shadow-input", { name: this.name, form: this.form, value: this.selectedValue })));
115
+ return (h(Host, { translate: "no" }, h("label", { part: `${this.name}`, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: disableInput }) }, h(FormInputLabel, { name: this.name, isRequired: isRequired || this.isRequired, label: label }), h("shift-select", { name: this.name, isError: isError, isOpen: this.isOpen, options: filteredOptions, clearable: this.clearable, isLoading: this.isFetching, disableInput: disableInput, searchable: this.searchable, searchValue: this.searchValue, selectedValue: this.selectedValue, reverseOptions: this.reverseOptions, handleSelection: this.handleSelection, forceOpenUpwards: this.forceOpenUpwards, updateContext: this.updateShiftSelectContext, placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), noSelectionText: (_a = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _a === void 0 ? void 0 : _a.noSelectOptions, fetchingErrorText: !this.fetchingErrorMessage ? '' : getNestedValue(locale, this.fetchingErrorMessage) || this.fetchingErrorMessage || ((_c = (_b = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c.wildCard) }, h("form-shadow-input", { name: this.name, form: this.form, value: this.selectedValue })), h(FormErrorMessage, { name: this.name, isError: isError, errorMessage: errorTextMessage }))));
176
116
  }
177
117
  static get is() { return "form-select"; }
178
118
  static get originalStyleUrls() {
@@ -584,10 +524,9 @@ export class FormSelect {
584
524
  static get states() {
585
525
  return {
586
526
  "searchValue": {},
587
- "isFetching": {},
588
527
  "isOpen": {},
589
528
  "selectedValue": {},
590
- "openUpwards": {},
529
+ "isFetching": {},
591
530
  "options": {},
592
531
  "fetchingErrorMessage": {}
593
532
  };
@@ -48,7 +48,7 @@ export class FormStepper {
48
48
  const [_, language] = this.form.getFormLocale();
49
49
  const steps = ((_c = (_b = (_a = this === null || this === void 0 ? void 0 : this.form) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.structure) === null || _c === void 0 ? void 0 : _c.steps) || [];
50
50
  const currentStep = (_e = (_d = this.form) === null || _d === void 0 ? void 0 : _d.formStructure) === null || _e === void 0 ? void 0 : _e.currentStep;
51
- return (h(Host, { key: '4229918e35f2cfef35820080714c0a7a710176f8' }, h("div", { key: 'a3f2af611d381a3f104fa6cfde3f2c35c11851de', part: cn(formStepperId, this === null || this === void 0 ? void 0 : this.name), class: "w-full", id: this.wrapperId }, h("div", { key: 'f043f6ab1e97f78de770051305f4eae450f1d45c', part: cn(formStepperId + 'container', (this === null || this === void 0 ? void 0 : this.name) + 'container'), ref: el => (this.container = el), class: "relative flex items-center justify-between px-1 w-full" }, h("div", { key: '08d2b754a29cd23f489c3b9f128ee7a1543cf90f', part: cn(formStepperId + '-line'), ref: el => (this.line = el), class: "absolute w-full h-[1px] -translate-y-[50%] -translate-x-[50%] top-[16px] left-[50%]", style: { background: 'repeating-linear-gradient(to right,black 0px,black 12px,transparent 6px,transparent 24px)' } }), steps.map((step, i) => {
51
+ return (h(Host, { key: 'a48eb2647a05f7a1c7b3a20c38187ad7a32b935c', translate: "no" }, h("div", { key: 'de19c8e4587f5c6fd965f81ae3b1b13f9bb5e44c', part: cn(formStepperId, this === null || this === void 0 ? void 0 : this.name), class: "w-full", id: this.wrapperId }, h("div", { key: '67f8024a2d3804e94ad727c8d556aedfaf9ddc34', part: cn(formStepperId + 'container', (this === null || this === void 0 ? void 0 : this.name) + 'container'), ref: el => (this.container = el), class: "relative flex items-center justify-between px-1 w-full" }, h("div", { key: 'e272708c498df5c07f4302fb100958a2f8aa4965', part: cn(formStepperId + '-line'), ref: el => (this.line = el), class: "absolute w-full h-[1px] -translate-y-[50%] -translate-x-[50%] top-[16px] left-[50%]", style: { background: 'repeating-linear-gradient(to right,black 0px,black 12px,transparent 6px,transparent 24px)' } }), steps.map((step, i) => {
52
52
  var _a, _b, _c;
53
53
  return (h("div", { key: i, class: "flex items-center" }, h("div", { part: cn(formStepperId + '-step', formStepperId + '-step-' + (i + 1), {
54
54
  [formStepperId + '-step-done']: i + 1 < currentStep,
@@ -16,7 +16,7 @@ export class FormStructureError {
16
16
  this.sharedLocales = await getSharedLocal(newLanguage);
17
17
  }
18
18
  render() {
19
- return (h(Host, { key: 'dd624e9f2a6bc15ef50d5792fdca51061cf89928' }, h("div", { key: '89ff3170d5ae151afa3134ac6bba44c7e16094c2', dir: this.sharedLocales.direction, part: "form-structure-error-container", class: "form-structure-error-container" }, h("div", { key: 'daa69e4328619fece0851d5ea97e0455eab111c9', part: "form-structure-error-content", class: "form-structure-error-content" }, this.sharedLocales.errors.wrongFormStructure))));
19
+ return (h(Host, { key: '161f83221df8faeb1d91e6cd863ce11bc7f31bf9', translate: "no" }, h("div", { key: 'fff9f6ca2495f9336517532b97079bacf5b1303c', dir: this.sharedLocales.direction, part: "form-structure-error-container", class: "form-structure-error-container" }, h("div", { key: '3868b1d864d7622c0889f848f363fde66c697fdb', part: "form-structure-error-content", class: "form-structure-error-content" }, this.sharedLocales.errors.wrongFormStructure))));
20
20
  }
21
21
  static get is() { return "form-structure-error"; }
22
22
  static get originalStyleUrls() {
@@ -43,7 +43,7 @@ export class FormStructure {
43
43
  if (!this.structure)
44
44
  return h("form-structure-error", { language: this.language });
45
45
  const { formController, resetFormErrorMessage } = this.form;
46
- return (h(Host, null, h("form", Object.assign({ id: this.formId, class: "relative", dir: this.locale.sharedLocales.direction }, formController), h("form-dialog", { dialogClosed: resetFormErrorMessage, isError: !!this.errorMessage, closeText: (_a = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _a === void 0 ? void 0 : _a.close, form: this.form, message: this.errorMessage }, h("div", { class: "form-success-container" }, h("svg", { fill: "none", "stroke-width": "2", viewBox: "0 0 24 24", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", xmlns: "http://www.w3.org/2000/svg", class: "size-[70px] stroke-green-700" }, h("path", { d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z" }), h("path", { d: "m9 12 2 2 4-4" })), this.successMessage)), h("div", { part: "form-structure-form-container" }, !((_b = this === null || this === void 0 ? void 0 : this.structure) === null || _b === void 0 ? void 0 : _b.steps) && renderStructure(this.structure, this.formElementMapper, generalProps, this.fields, -2), !!((_c = this === null || this === void 0 ? void 0 : this.structure) === null || _c === void 0 ? void 0 : _c.steps) && (h("div", { part: "form-stepper-container", class: "overflow-hidden" }, renderStructure(this.structure, this.formElementMapper, generalProps, this.fields, -1), h("div", { class: "grid grid-cols-1 grid-rows-1" }, (_d = this === null || this === void 0 ? void 0 : this.structure) === null || _d === void 0 ? void 0 : _d.steps.map((_, i) => (h("div", { class: cn('col-start-1 row-start-1 transition-all !duration-700', {
46
+ return (h(Host, { translate: "no" }, h("form", Object.assign({ id: this.formId, class: "relative", dir: this.locale.sharedLocales.direction }, formController), h("form-dialog", { dialogClosed: resetFormErrorMessage, isError: !!this.errorMessage, closeText: (_a = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _a === void 0 ? void 0 : _a.close, form: this.form, message: this.errorMessage }, h("div", { class: "form-success-container" }, h("svg", { fill: "none", "stroke-width": "2", viewBox: "0 0 24 24", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", xmlns: "http://www.w3.org/2000/svg", class: "size-[70px] stroke-green-700" }, h("path", { d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z" }), h("path", { d: "m9 12 2 2 4-4" })), this.successMessage)), h("div", { part: "form-structure-form-container" }, !((_b = this === null || this === void 0 ? void 0 : this.structure) === null || _b === void 0 ? void 0 : _b.steps) && renderStructure(this.structure, this.formElementMapper, generalProps, this.fields, -2), !!((_c = this === null || this === void 0 ? void 0 : this.structure) === null || _c === void 0 ? void 0 : _c.steps) && (h("div", { part: "form-stepper-container", class: "overflow-hidden" }, renderStructure(this.structure, this.formElementMapper, generalProps, this.fields, -1), h("div", { class: "grid grid-cols-1 grid-rows-1" }, (_d = this === null || this === void 0 ? void 0 : this.structure) === null || _d === void 0 ? void 0 : _d.steps.map((_, i) => (h("div", { class: cn('col-start-1 row-start-1 transition-all !duration-700', {
47
47
  'pointer-events-none! *:pointer-events-none!': this.currentStep !== i + 1,
48
48
  'translate-x-full rtl:-translate-x-full opacity-0': this.currentStep < i + 1,
49
49
  'translate-x-0 opacity-100': this.currentStep === i + 1,
@@ -28,7 +28,7 @@ export class FormSwitch {
28
28
  render() {
29
29
  const { disabled, meta, errorMessage, isError } = this.form.getInputState(this.name);
30
30
  const { label, errorTextMessage } = getInputLocalization(this, meta, errorMessage);
31
- return (h(Host, { key: '21b21d6279e5dd9faa7bc6354e30fe14248d8706' }, h("div", { key: '00b94ccb30b48116b82cd81b2308c9a960bafe9e', part: `${this.name}`, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, disabled) }, h("div", { key: '8265cb8be934b8f2b86ef0464d251f6d32136167', part: `${this.name}-container form-input-container`, class: "form-input-container" }, h("shift-switch", { key: '83ab4704810ab0ffd6f11311e65d13fe79b0f087', name: this.name, label: label, class: "form-switch" })), h(FormErrorMessage, { key: '7ef3f5b09cf051ab20ac0a7f8851c92da8988d33', name: this.name, isError: isError, errorMessage: errorTextMessage }))));
31
+ return (h(Host, { key: '5a2fe6a337c4858c530e14c20c1b65d40e7a4106', translate: "no" }, h("div", { key: 'b56e99750bb85bfb8f5a2b7f51232c662864581c', part: `${this.name}`, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, disabled) }, h("div", { key: '7e362f04edec3bb2e722a00a3b196041a602c2ff', part: `${this.name}-container form-input-container`, class: "form-input-container" }, h("shift-switch", { key: 'f876fe63eac18903cc2b3232110c3db21dbf5d50', name: this.name, label: label, class: "form-switch" })), h(FormErrorMessage, { key: 'd5d5a88b4e018f8959e325877770434828b88edf', name: this.name, isError: isError, errorMessage: errorTextMessage }))));
32
32
  }
33
33
  static get is() { return "form-switch"; }
34
34
  static get originalStyleUrls() {
@@ -40,9 +40,9 @@ export class FormTextArea {
40
40
  const { disabled, isRequired, meta, isError, errorMessage } = this.form.getInputState(this.name);
41
41
  const { label, placeholder, errorTextMessage } = getInputLocalization(this, meta, errorMessage);
42
42
  const isDisabled = disabled || this.isLoading || !!this.staticValue || this.isDisabled;
43
- return (h(Host, { key: '036354c8fbb5a638462b2409c8f916e87f36e060' }, h("label", { key: '28a5e1d68352992301d08c4133728a90414678e2', part: `form-textarea ${this.name}`, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: 'e16bf70bcf7b3416e70e72756c6ecbc22e1df20c', name: this.name, isRequired: isRequired, label: label }), h("div", { key: '7a76ada19fcad73f11717d2157dbd24a74754632', part: `${this.name}-container form-input-container`, class: "form-input-container" }, h("textarea", { key: 'd2d3d8c16fc50c210892851154fab25bb9c4fda0', name: this.name, disabled: isDisabled, placeholder: placeholder, part: `${this.name}-textarea form-input-textarea`, class: cn('form-input-style form-input-textarea-style', partKeyPrefix + this.name, {
43
+ return (h(Host, { key: '0c5b11dba02a36e6db36c0af28093be7eeb8944e', translate: "no" }, h("label", { key: 'c2cdd39072d38b30848b35cb49860e7975617847', part: `form-textarea ${this.name}`, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: '97ccfbea906149c3c1e2cc5e2a8d2870e5872a5f', name: this.name, isRequired: isRequired, label: label }), h("div", { key: 'c6c606d06bb010f3399cec097adffb9ca928f2b9', part: `${this.name}-container form-input-container`, class: "form-input-container" }, h("textarea", { key: '49ef2aff82fdd06ca054dae2acd770f9df8ac2d6', name: this.name, disabled: isDisabled, placeholder: placeholder, part: `${this.name}-textarea form-input-textarea`, class: cn('form-input-style form-input-textarea-style', partKeyPrefix + this.name, {
44
44
  'form-input-error-style': isError,
45
- }) }, this.defaultValue)), h("div", { key: 'ded83b993895928ad873df986b99011009b963f3', class: "-mt-1" }, h(FormErrorMessage, { key: 'd3bc659c75e302ad3623f2966b1d1964403024cb', name: this.name, isError: isError, errorMessage: errorTextMessage })))));
45
+ }) }, this.defaultValue)), h("div", { key: 'd5384d8b11af7534edded15433cfdae324f3a365', class: "-mt-1" }, h(FormErrorMessage, { key: '9bb0096450f006f0832dd018e4f4c53fd3459cb8', name: this.name, isError: isError, errorMessage: errorTextMessage })))));
46
46
  }
47
47
  static get is() { return "form-text-area"; }
48
48
  static get originalStyleUrls() {
@@ -133,22 +133,22 @@ export class FormTimePicker {
133
133
  const step = this.minuteStep || 1;
134
134
  const hours = Array.from({ length: 24 }, (_, i) => i);
135
135
  const minutes = Array.from({ length: Math.ceil(60 / step) }, (_, i) => i * step);
136
- return (h(Host, { key: 'd6663c643f3a007f1049d01d6dd2f1eb3103db51' }, h("label", { key: '420d14b690418abbc17eba871bded694063abfeb', part: this.name, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: '289ce0a23859f6a2ae0bb33fab56f8ea870b758a', isRequired: isRequired, label: label }), h("form-shadow-input", { key: '133d1e0ff04b9f19c2f87811141f5ed630b81634', name: this.name, form: this.form, value: this.selectedValue }), h("div", { key: '68a56bd6b2f2103247d8897e8236f5ed6707b135', part: `${this.name}-container form-input-container`, class: cn('form-input-container', { open: this.isOpen }) }, h("input", { key: 'a298fbafe64a25c518b2626fe74f8d804371b1ab', type: "text", readOnly: true, disabled: isDisabled, value: this.selectedValue, onClick: this.toggleDropdown, part: `${this.name}-input form-input`, placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), class: cn('form-input-style form-input-select', {
136
+ return (h(Host, { key: '9d5bdcda658b5befe52aec5ee79c2d4a7f6761d1', translate: "no" }, h("label", { key: '1a849ecca842fd68593a3bf8bc734fc7b5e21eab', part: this.name, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: '984af4d271bff3948fae8f5d9c6d899ec8a68be0', isRequired: isRequired, label: label }), h("form-shadow-input", { key: '6d67bd827114a2e8b3917c6d1b79583273335073', name: this.name, form: this.form, value: this.selectedValue }), h("div", { key: 'c2ee3949f0ca43dfd87b3c53a02fa4a35026a0b8', part: `${this.name}-container form-input-container`, class: cn('form-input-container', { open: this.isOpen }) }, h("input", { key: '3d691f1cbdd084ca42ac62586e84709e526fd0a2', type: "text", readOnly: true, disabled: isDisabled, value: this.selectedValue, onClick: this.toggleDropdown, part: `${this.name}-input form-input`, placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), class: cn('form-input-style form-input-select', {
137
137
  'form-input-error-style': isError,
138
- }) }), h("span", { key: '843de77fd1e98dc9b72a2bb6c43752c94f384fa1', part: `${this.name}-icon form-time-picker-icon`, class: "form-input-icon form-input-icon-end" }, h("svg", { key: 'f7c7a8012c4a9bc5e20848b1215461c12516e8a7', "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "size-full" }, h("circle", { key: '8466c577706d8d0943bbcbf662b325122d03cbca', cx: "12", cy: "12", r: "10" }), h("polyline", { key: '852ab08f1b34d059b68dc2c0e1415a327ce80f16', points: "12 6 12 12 16 14" }))), h("div", { key: 'af53b61dc0b745444e1c5b62690472d547481dd9', part: `${this.name}-dropdown form-time-picker-dropdown`, class: cn('form-picker-dropdown', {
138
+ }) }), h("span", { key: '6084eceb26190e8a829a71edf8751f4e830a544b', part: `${this.name}-icon form-time-picker-icon`, class: "form-input-icon form-input-icon-end" }, h("svg", { key: '26abe8de8826ac2a28ab234dddae744b6014905a', "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "size-full" }, h("circle", { key: 'cdc4a4bc0f811167e534caa36f9f41dcf2bf15be', cx: "12", cy: "12", r: "10" }), h("polyline", { key: '84f14df89b62ecd9ed69f797fdc39d8d8e62c0f6', points: "12 6 12 12 16 14" }))), h("div", { key: 'bbe67aa4ca67e5f86c6240ad7eba840eb6b69086', part: `${this.name}-dropdown form-time-picker-dropdown`, class: cn('form-picker-dropdown', {
139
139
  upwards: this.openUpwards,
140
140
  downwards: !this.openUpwards,
141
- }) }, h("div", { key: 'e7be6706900041eb0b01d268cfd2a50f75b37991', class: "form-time-picker-columns" }, h("div", { key: '2134137b646480e823e78de2424c7b4e337c0919', class: "form-time-picker-column form-time-picker-hours" }, h("div", { key: '7b7d05ad2db51fca1ed974f61f9b22d3f47ae48b', class: "form-time-picker-column-header" }, "HH"), hours.map(hour => {
141
+ }) }, h("div", { key: 'aeb7b96e88cfbb5b43c7f6a308b8f1a0dce97112', class: "form-time-picker-columns" }, h("div", { key: '7f6c11471fdfb06c5ea679e2870c78663f001d05', class: "form-time-picker-column form-time-picker-hours" }, h("div", { key: '8ce375ff1f3f896dd0b4eea3abbc964e69790515', class: "form-time-picker-column-header" }, "HH"), hours.map(hour => {
142
142
  const hourDisabled = this.isHourDisabled(hour);
143
143
  return (h("button", { type: "button", disabled: hourDisabled, onClick: () => this.selectHour(hour), part: cn('form-time-picker-option', { 'form-time-picker-option-selected': hour === selectedHour }), class: cn('form-time-picker-option', {
144
144
  selected: hour === selectedHour,
145
145
  }) }, String(hour).padStart(2, '0')));
146
- })), h("div", { key: 'd16846c8e002ba6e7b3677f926cdb18a0e801e59', class: "form-time-picker-column form-time-picker-minutes" }, h("div", { key: '36b24906997ee197a4e8c48c4f2466806e3fc0f3', class: "form-time-picker-column-header" }, "MM"), minutes.map(minute => {
146
+ })), h("div", { key: '2465c3958cd9822e774bbec5dba7cd8162eafcc2', class: "form-time-picker-column form-time-picker-minutes" }, h("div", { key: '0a1678b7fd7dac48cb69f4437c171a3272a14e74', class: "form-time-picker-column-header" }, "MM"), minutes.map(minute => {
147
147
  const minuteDisabled = selectedHour >= 0 ? this.isMinuteDisabled(selectedHour, minute) : false;
148
148
  return (h("button", { type: "button", disabled: minuteDisabled, onClick: () => this.selectMinute(minute), part: cn('form-time-picker-option', { 'form-time-picker-option-selected': minute === selectedMinute }), class: cn('form-time-picker-option', {
149
149
  selected: minute === selectedMinute,
150
150
  }) }, String(minute).padStart(2, '0')));
151
- }))))), h(FormErrorMessage, { key: '8222c5dbcdd090f06cc940d22f4f129b2d66cd38', name: this.name, isError: isError, errorMessage: locale[errorMessage] || errorMessage }))));
151
+ }))))), h(FormErrorMessage, { key: 'f25fd5ee20a4fd8ba257cac5b916a62f943115d1', name: this.name, isError: isError, errorMessage: locale[errorMessage] || errorMessage }))));
152
152
  }
153
153
  static get is() { return "form-time-picker"; }
154
154
  static get originalStyleUrls() {
@@ -52,9 +52,9 @@ export class FormVinInput {
52
52
  const { label, placeholder, errorTextMessage } = getInputLocalization(this, meta, errorMessage);
53
53
  const isDisabled = disabled || this.isLoading || !!this.staticValue || this.isDisabled;
54
54
  const extractorTitle = ((_b = (_a = this.localization) === null || _a === void 0 ? void 0 : _a[language]) === null || _b === void 0 ? void 0 : _b.scan) || ((_j = (_g = (_f = (_e = (_d = (_c = this.form) === null || _c === void 0 ? void 0 : _c.context) === null || _d === void 0 ? void 0 : _d.structure) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.localization) === null || _g === void 0 ? void 0 : _g[(_h = this.form.context) === null || _h === void 0 ? void 0 : _h.language]) === null || _j === void 0 ? void 0 : _j['vin-scan']) || 'Scan Your VIN';
55
- return (h(Host, { key: 'e935f68ad484fdd6b8eac606259d4266eb164af0' }, h("label", { key: '9cbfa9cc93a4738de2e98bbe97b52bc0907f1507', part: this.name, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: '27661de7bef808af4c3ca6ce65609c31a988a3b6', isRequired: isRequired, label: label }), h("div", { key: 'a3cf3c9b4d5a81f9539b6e61db626e7e3f84c803', part: `${this.name}-container form-input-container`, class: "form-input-container" }, h(FormInputPrefix, { key: 'a0a970ecc14f97ec169c45f1939e8f89cab37f93', name: this.name, direction: (_k = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _k === void 0 ? void 0 : _k.direction, prefix: this.inputPrefix }), h("input", Object.assign({ key: '43a7e55f026e76fe7925dd73b1b3b8a43ce3b2a6' }, this.inputProps, { name: this.name, disabled: isDisabled, defaultValue: this.defaultValue, part: `${this.name}-input form-input`, placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), style: Object.assign({}, (this.prefixWidth ? { [((_l = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _l === void 0 ? void 0 : _l.direction) === 'rtl' ? 'paddingRight' : 'paddingLeft']: `${this.prefixWidth}px` } : {})), class: cn('form-input-style !uppercase', part, {
55
+ return (h(Host, { key: '7f0be690ebbd9a754968ac7fbc539db62c0c3ec7', translate: "no" }, h("label", { key: '44e3bbd8db35554fc6f917162e75cf5eb889ef47', part: this.name, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: 'df1967c356cf4d17f31f1eaa0107d32a598eba13', isRequired: isRequired, label: label }), h("div", { key: '681fa3eb80651e728d346f8dc9686abb9abe49ec', part: `${this.name}-container form-input-container`, class: "form-input-container" }, h(FormInputPrefix, { key: 'b6acc27a74ebead32324129497f5a5422fe04af6', name: this.name, direction: (_k = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _k === void 0 ? void 0 : _k.direction, prefix: this.inputPrefix }), h("input", Object.assign({ key: 'd44d5499a73f12d8f0f185ece29064330a238632' }, this.inputProps, { name: this.name, disabled: isDisabled, defaultValue: this.defaultValue, part: `${this.name}-input form-input`, placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), style: Object.assign({}, (this.prefixWidth ? { [((_l = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _l === void 0 ? void 0 : _l.direction) === 'rtl' ? 'paddingRight' : 'paddingLeft']: `${this.prefixWidth}px` } : {})), class: cn('form-input-style !uppercase', part, {
56
56
  'form-input-error-style': isError,
57
- }) })), !!this.scannerIcon && (this.useOcr || this.readSticker) && (h("button", { key: 'c2665d8ab8ca8e673444457c54f656a95d911e5b', type: "button", disabled: isDisabled, part: cn('vin-validator', part + '-vin'), onClick: () => { var _a; return (_a = this === null || this === void 0 ? void 0 : this.el.getElementsByTagName('vin-extractor')[0]) === null || _a === void 0 ? void 0 : _a.open(); }, class: "absolute transition-all duration-500 disabled:!pointer-events-none disabled:!opacity-0 flex justify-center items-center end-3.5 !text-[#576675] enabled:hover:!text-black/85 aspect-square h-[70%] top-1/2 -translate-y-1/2" }, this.scannerIcon === 'qr-code' && h(QrCodeScanIcon, { key: '6c514dad1e627494b81971d053e7d75dfc5be13b', class: "size-[90%] text-inherit" }), this.scannerIcon === 'camera' && h(CameraIcon, { key: '5987670985521ceac807a20bff5bb0a286395b76', class: "size-[90%] text-inherit" })))), h(FormErrorMessage, { key: 'c7fb1546bbc155ef7cf7b8e5a77c03da97b6a392', name: this.name, isError: isError, errorMessage: errorTextMessage })), (this.useOcr || this.readSticker) && (h("div", { key: 'be3f07f5c4bbbd78be51890b23ddeb201c3791c2', class: "absolute" }, h("vin-extractor", { key: '17feec3c00754195455242bdc0c281fb38adf35b', verbose: true, manualCapture: true, useOcr: this.useOcr, title: extractorTitle, skipValidation: false, readSticker: this.readSticker, ocrEndpoint: this.ocrEndpoint, onExtract: newVin => {
57
+ }) })), !!this.scannerIcon && (this.useOcr || this.readSticker) && (h("button", { key: 'd30a7ead951bc286a1929a7ffa2bf3cdb65d9dbd', type: "button", disabled: isDisabled, part: cn('vin-validator', part + '-vin'), onClick: () => { var _a; return (_a = this === null || this === void 0 ? void 0 : this.el.getElementsByTagName('vin-extractor')[0]) === null || _a === void 0 ? void 0 : _a.open(); }, class: "absolute transition-all duration-500 disabled:!pointer-events-none disabled:!opacity-0 flex justify-center items-center end-3.5 !text-[#576675] enabled:hover:!text-black/85 aspect-square h-[70%] top-1/2 -translate-y-1/2" }, this.scannerIcon === 'qr-code' && h(QrCodeScanIcon, { key: '14b0055cf0551e7c2688be5520d5d2886a8c48dd', class: "size-[90%] text-inherit" }), this.scannerIcon === 'camera' && h(CameraIcon, { key: '91ab1477ae490b6c2552cda22c59b2a6a06fdd25', class: "size-[90%] text-inherit" })))), h(FormErrorMessage, { key: '9cc4877e621b0d04b8e971958c22ea6b3153a9c8', name: this.name, isError: isError, errorMessage: errorTextMessage })), (this.useOcr || this.readSticker) && (h("div", { key: 'b2985fcf816a684c0b93347e0e31a1d751a524d7', class: "absolute" }, h("vin-extractor", { key: '847023951fdc4cd651bf0f743d3df0c5cd3e9007', verbose: true, manualCapture: true, useOcr: this.useOcr, title: extractorTitle, skipValidation: false, readSticker: this.readSticker, ocrEndpoint: this.ocrEndpoint, onExtract: newVin => {
58
58
  var _a, _b;
59
59
  this.inputRef.value = newVin;
60
60
  (_a = this.form) === null || _a === void 0 ? void 0 : _a.validateInput(this === null || this === void 0 ? void 0 : this.name);
@@ -3,18 +3,12 @@
3
3
  * Copyright (c)
4
4
  */
5
5
  import { h } from "@stencil/core";
6
- import { getPhoneValidator } from "../../../features/form-hook/index";
7
6
  import { VehicleImageViewer } from "../../form-elements/VehicleImageViewer";
8
7
  import { CalendarDaysIcon } from "../../../global/assets/calendar-days-icon";
9
8
  import { format, isBefore, isEqual } from "date-fns";
10
9
  import { decodeTimeOffset } from "../../../global/lib/decode-time-offset";
11
10
  import { populateItems } from "../../../global/lib/populate-items";
12
- export const getFormMappers = (stateObject, extraMappers = {}) => (Object.assign({ submit: ({ props }) => h("form-submit", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), inputPreview: ({ props }) => h("form-input-preview", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), fileUploader: ({ props }) => h("form-file", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), formStepper: ({ props, language }) => h("form-stepper", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name, language: language }, props)), back: ({ props }) => h("form-stepper-control", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), stepperSubmit: ({ props }) => h("form-stepper-submit", Object.assign({ key: (props === null || props === void 0 ? void 0 : props.step) || (props === null || props === void 0 ? void 0 : props.name) }, props)), name: ({ props }) => h("form-input", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), lastName: ({ props }) => h("form-input", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), email: ({ props }) => h("form-input", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name, type: "email" }, props)), message: ({ props }) => h("form-text-area", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), file: ({ props }) => h("form-file", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), vin: ({ props }) => h("form-vin-input", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), vehicleImage: ({ form }) => h(VehicleImageViewer, { form: form }), phone: ({ props, isLoading }) => {
13
- if (!stateObject.phoneValidator) {
14
- stateObject.phoneValidator = getPhoneValidator((props === null || props === void 0 ? void 0 : props.countryCode) || '');
15
- }
16
- return h("form-phone-number", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name, defaultValue: stateObject.phoneValidator.default }, props, { isLoading: isLoading, validator: stateObject.phoneValidator }));
17
- }, vehicle: ({ language, props }) => {
11
+ export const getFormMappers = (extraMappers = {}) => (Object.assign({ submit: ({ props }) => h("form-submit", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), inputPreview: ({ props }) => h("form-input-preview", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), fileUploader: ({ props }) => h("form-file", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), formStepper: ({ props, language }) => h("form-stepper", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name, language: language }, props)), back: ({ props }) => h("form-stepper-control", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), stepperSubmit: ({ props }) => h("form-stepper-submit", Object.assign({ key: (props === null || props === void 0 ? void 0 : props.step) || (props === null || props === void 0 ? void 0 : props.name) }, props)), name: ({ props }) => h("form-input", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), lastName: ({ props }) => h("form-input", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), email: ({ props }) => h("form-input", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name, type: "email" }, props)), message: ({ props }) => h("form-text-area", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), file: ({ props }) => h("form-file", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), vin: ({ props }) => h("form-vin-input", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name }, props)), vehicleImage: ({ form }) => h(VehicleImageViewer, { form: form }), phone: ({ props, isLoading }) => h("form-phone-number", Object.assign({ key: props === null || props === void 0 ? void 0 : props.name, isLoading: isLoading }, props)), vehicle: ({ language, props }) => {
18
12
  const fetcher = async ({ signal, context }) => {
19
13
  var _a, _b;
20
14
  const params = new URLSearchParams(window.location.search);