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.
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +7 -7
- package/dist/cjs/flexible-container.cjs.entry.js +1 -1
- package/dist/cjs/form-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/form-date-picker.cjs.entry.js +5 -5
- package/dist/cjs/form-dialog_13.cjs.entry.js +4568 -40
- package/dist/cjs/{form-input-CfVsbpFP.js → form-input-cvIkC0L1.js} +1 -1
- package/dist/cjs/form-input_5.cjs.entry.js +356 -0
- package/dist/cjs/form-switch.cjs.entry.js +4 -4
- package/dist/cjs/form-time-picker.cjs.entry.js +6 -6
- package/dist/cjs/functions-D5J5cdK2.js +298 -0
- package/dist/cjs/general-form.cjs.entry.js +19 -20
- package/dist/cjs/general-inquiry-form.cjs.entry.js +19 -20
- package/dist/cjs/{get-language-from-url-DoohcPbK.js → get-language-from-url-Ct6kvnEu.js} +8 -5
- package/dist/cjs/{get-local-language-zK9ue0lN.js → get-local-language-CWfRQqOw.js} +1 -1
- package/dist/cjs/{get-mock-files-DRVrAMed.js → get-mock-files-DG4Nk29D.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +3 -3
- package/dist/cjs/{state-object-CX8v4Go5.js → mappers-C82gH1dw.js} +1 -11
- package/dist/cjs/part-lookup.cjs.entry.js +2 -2
- package/dist/cjs/service-booking-form.cjs.entry.js +19 -20
- package/dist/cjs/shift-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/shift-components.cjs.js +1 -1
- package/dist/cjs/shift-slider.cjs.entry.js +1 -1
- package/dist/cjs/shift-switch.cjs.entry.js +2 -2
- package/dist/cjs/shift-tab-content.cjs.entry.js +1 -1
- package/dist/cjs/shift-tabs_2.cjs.entry.js +12 -12
- package/dist/cjs/ssc-lookup-form.cjs.entry.js +19 -20
- package/dist/cjs/test-drive-form.cjs.entry.js +19 -20
- package/dist/cjs/{validation-BAHdEc4w.js → validation-jJwLyk27.js} +1 -7
- package/dist/cjs/vehicle-accessories_7.cjs.entry.js +19 -19
- package/dist/cjs/vehicle-lookup.cjs.entry.js +4 -4
- package/dist/cjs/vehicle-quotation-form.cjs.entry.js +17 -27
- package/dist/cjs/{white-loader-kSznMo_u.js → white-loader-D6sR0fOI.js} +3 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/components/empty.css +1 -1
- package/dist/collection/components/components/flexible-container.css +1 -1
- package/dist/collection/components/components/loading-spinner.css +1 -1
- package/dist/collection/components/components/shift-checkbox.js +1 -1
- package/dist/collection/components/components/shift-select.css +1 -0
- package/dist/collection/components/components/shift-select.js +568 -0
- package/dist/collection/components/components/shift-slider.js +1 -1
- package/dist/collection/components/components/shift-switch.js +1 -1
- package/dist/collection/components/components/shift-tab-content.js +1 -1
- package/dist/collection/components/components/shift-tabs.css +1 -1
- package/dist/collection/components/components/shift-tabs.js +2 -2
- package/dist/collection/components/form-elements/components/form-input-prefix.js +3 -1
- package/dist/collection/components/form-elements/form-checkbox.js +1 -1
- package/dist/collection/components/form-elements/form-date-picker-legacy.js +4 -4
- package/dist/collection/components/form-elements/form-dialog.js +3 -3
- package/dist/collection/components/form-elements/form-file.js +2 -2
- package/dist/collection/components/form-elements/form-input.js +2 -2
- package/dist/collection/components/form-elements/form-inputs.css +1 -1
- package/dist/collection/components/form-elements/form-phone-number.js +130 -30
- package/dist/collection/components/form-elements/form-picker-input.js +2 -2
- package/dist/collection/components/form-elements/form-select.js +12 -73
- package/dist/collection/components/form-elements/form-stepper.js +1 -1
- package/dist/collection/components/form-elements/form-structure-error.js +1 -1
- package/dist/collection/components/form-elements/form-structure.js +1 -1
- package/dist/collection/components/form-elements/form-switch.js +1 -1
- package/dist/collection/components/form-elements/form-text-area.js +2 -2
- package/dist/collection/components/form-elements/form-time-picker-legacy.js +5 -5
- package/dist/collection/components/form-elements/form-vin-input.js +2 -2
- package/dist/collection/components/forms/defaults/mappers.js +1 -7
- package/dist/collection/components/forms/defaults/style.css +1 -1
- package/dist/collection/components/forms/defaults/validation.js +1 -7
- package/dist/collection/components/forms/general-form.js +4 -6
- package/dist/collection/components/forms/general-inquiry.js +4 -6
- package/dist/collection/components/forms/service-booking.js +4 -6
- package/dist/collection/components/forms/ssc-lookup.js +4 -6
- package/dist/collection/components/forms/test-drive.js +4 -6
- package/dist/collection/components/forms/vehicle-quotation/element-mapper.js +1 -8
- package/dist/collection/components/forms/vehicle-quotation/themes.css +1 -1
- package/dist/collection/components/forms/vehicle-quotation/validations.js +0 -5
- package/dist/collection/components/forms/vehicle-quotation.js +3 -3
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +2 -2
- package/dist/collection/components/part-lookup/distributor-lookup.js +2 -2
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +1 -1
- package/dist/collection/components/part-lookup/manufacturer-part-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-part-lookup.js +1 -1
- package/dist/collection/components/part-lookup/part-lookup.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +4 -4
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.js +8 -8
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.js +1 -1
- package/dist/collection/components/vin-extractor/vin-extractor.js +1 -1
- package/dist/collection/features/form-hook/form-hook.js +8 -5
- package/dist/collection/features/form-hook/functions.js +0 -1
- package/dist/collection/features/form-hook/phone-validator.js +1 -41
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/flexible-container.js +1 -1
- package/dist/components/form-checkbox.js +1 -1
- package/dist/components/form-date-picker.js +1 -1
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-file.js +1 -1
- package/dist/components/form-input-preview.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-phone-number.js +1 -1
- package/dist/components/form-picker-input.js +1 -1
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.js +1 -1
- package/dist/components/form-stepper-control.js +1 -1
- package/dist/components/form-stepper-submit.js +1 -1
- package/dist/components/form-stepper.js +1 -1
- package/dist/components/form-structure-error.js +1 -1
- package/dist/components/form-structure.js +1 -1
- package/dist/components/form-submit.js +1 -1
- package/dist/components/form-switch.js +1 -1
- package/dist/components/form-text-area.js +1 -1
- package/dist/components/form-time-picker.js +1 -1
- package/dist/components/form-vin-input.js +1 -1
- package/dist/components/general-form.js +1 -1
- package/dist/components/general-inquiry-form.js +1 -1
- package/dist/components/information-table.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/manufacturer-part-lookup.js +1 -1
- package/dist/components/p-04wNXJ_q.js +5 -0
- package/dist/components/p-4n_cgPjf.js +5 -0
- package/dist/components/p-8XSbLgc1.js +5 -0
- package/dist/components/p-B8X9IaVO.js +5 -0
- package/dist/components/p-BDgNqOMe.js +5 -0
- package/dist/components/p-BFxBL1n-.js +5 -0
- package/dist/components/p-BUnCuQVo.js +5 -0
- package/dist/components/p-BV90NnNh.js +5 -0
- package/dist/components/p-BY5Ji84D.js +5 -0
- package/dist/components/{p-CNzel4L2.js → p-BgttkHzs.js} +1 -1
- package/dist/components/p-Bk0lC2Er.js +5 -0
- package/dist/components/p-C2TMzq3P.js +5 -0
- package/dist/components/p-C5obPa8c.js +5 -0
- package/dist/components/{p-BgC7TfjM.js → p-CAvWNw8_.js} +1 -1
- package/dist/components/{p-B9DO0698.js → p-CHjkTvcK.js} +1 -1
- package/dist/components/p-CJbV4CRN.js +5 -0
- package/dist/components/p-CKWUV8sc.js +5 -0
- package/dist/components/p-CO0Weo2C.js +5 -0
- package/dist/components/p-CQ1pe5_N.js +5 -0
- package/dist/components/p-CSltLdDZ.js +5 -0
- package/dist/components/p-CVP-Kfuq.js +5 -0
- package/dist/components/p-CX0MCoJm.js +5 -0
- package/dist/components/p-CZPaKPho.js +5 -0
- package/dist/components/p-CxL9hBt2.js +5 -0
- package/dist/components/p-D1sSrUE7.js +5 -0
- package/dist/components/p-D5Vp16LE.js +5 -0
- package/dist/components/p-DAOx9Qnb.js +5 -0
- package/dist/components/p-DEniRp-Y.js +5 -0
- package/dist/components/p-DNT9N8sa.js +5 -0
- package/dist/components/p-DdJblbUj.js +5 -0
- package/dist/components/{p-BV8ZkPEF.js → p-DqaISuxu.js} +1 -1
- package/dist/components/p-E1MRBxpY.js +5 -0
- package/dist/components/p-EVz2SQxD.js +5 -0
- package/dist/components/p-KlUIwQJ_.js +5 -0
- package/dist/components/p-NC__PzEk.js +5 -0
- package/dist/components/p-OMoAsmX4.js +5 -0
- package/dist/components/p-R9s5HIai.js +5 -0
- package/dist/components/p-Rs-gwVEC.js +5 -0
- package/dist/components/p-Toqpa7YK.js +5 -0
- package/dist/components/p-ZTF1sGMh.js +5 -0
- package/dist/components/p-ajNVZbZb.js +5 -0
- package/dist/components/p-lM8Wndby.js +5 -0
- package/dist/components/p-nzjwgyi2.js +5 -0
- package/dist/components/p-rgNGWak-.js +5 -0
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-booking-form.js +1 -1
- package/dist/components/shift-accordion.js +1 -1
- package/dist/components/shift-checkbox.js +1 -1
- package/dist/components/shift-select.d.ts +11 -0
- package/dist/components/shift-select.js +5 -0
- package/dist/components/shift-slider.js +1 -1
- package/dist/components/shift-switch.js +1 -1
- package/dist/components/shift-tab-content.js +1 -1
- package/dist/components/shift-tabs.js +1 -1
- package/dist/components/ssc-lookup-form.js +1 -1
- package/dist/components/test-drive-form.js +1 -1
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-claimable-items.js +1 -1
- package/dist/components/vehicle-item-claim-form.js +1 -1
- package/dist/components/vehicle-lookup.js +1 -1
- package/dist/components/vehicle-paint-thickness.js +1 -1
- package/dist/components/vehicle-quotation-form.js +1 -1
- package/dist/components/vehicle-sale-information.js +1 -1
- package/dist/components/vehicle-service-history.js +1 -1
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/vehicle-warranty-details.js +1 -1
- package/dist/components/vin-extractor.js +1 -1
- package/dist/esm/dead-stock-lookup_3.entry.js +7 -7
- package/dist/esm/flexible-container.entry.js +1 -1
- package/dist/esm/form-checkbox.entry.js +4 -4
- package/dist/esm/form-date-picker.entry.js +5 -5
- package/dist/esm/form-dialog_13.entry.js +4569 -41
- package/dist/esm/{form-input-BZhw7_xV.js → form-input-Dcr-Pd8b.js} +1 -1
- package/dist/esm/form-input_5.entry.js +350 -0
- package/dist/esm/form-switch.entry.js +4 -4
- package/dist/esm/form-time-picker.entry.js +6 -6
- package/dist/esm/functions-DtSiZ2w7.js +287 -0
- package/dist/esm/general-form.entry.js +10 -11
- package/dist/esm/general-inquiry-form.entry.js +10 -11
- package/dist/esm/{get-language-from-url-X9X1Ax8Z.js → get-language-from-url-C-Rb5RW0.js} +8 -5
- package/dist/esm/{get-local-language-CDB3-v5P.js → get-local-language-TggqJhkD.js} +1 -1
- package/dist/esm/{get-mock-files-CaGwKZM4.js → get-mock-files-CqnoWX3h.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-spinner.entry.js +1 -1
- package/dist/esm/manufacturer-part-lookup.entry.js +3 -3
- package/dist/esm/{state-object-YMqxT3DF.js → mappers-Bk5UgY3t.js} +2 -11
- package/dist/esm/part-lookup.entry.js +2 -2
- package/dist/esm/service-booking-form.entry.js +10 -11
- package/dist/esm/shift-checkbox.entry.js +2 -2
- package/dist/esm/shift-components.js +1 -1
- package/dist/esm/shift-slider.entry.js +1 -1
- package/dist/esm/shift-switch.entry.js +2 -2
- package/dist/esm/shift-tab-content.entry.js +1 -1
- package/dist/esm/shift-tabs_2.entry.js +12 -12
- package/dist/esm/ssc-lookup-form.entry.js +10 -11
- package/dist/esm/test-drive-form.entry.js +10 -11
- package/dist/esm/{validation-DI1MnYKr.js → validation-oieVWBn1.js} +1 -7
- package/dist/esm/vehicle-accessories_7.entry.js +19 -19
- package/dist/esm/vehicle-lookup.entry.js +4 -4
- package/dist/esm/vehicle-quotation-form.entry.js +8 -18
- package/dist/esm/{white-loader-CG4JPVdv.js → white-loader-DG6pqLQw.js} +3 -1
- package/dist/mocks/generated/broker-dealer/part-lookup.json +127 -0
- package/dist/mocks/generated/broker-dealer/vehicle-lookup.json +275 -0
- package/dist/shift-components/p-0f6a4a2c.entry.js +5 -0
- package/dist/shift-components/p-1c18a25e.entry.js +5 -0
- package/dist/shift-components/p-29cb1041.entry.js +5 -0
- package/dist/shift-components/p-3123d3fd.entry.js +5 -0
- package/dist/shift-components/p-411f777f.entry.js +5 -0
- package/dist/shift-components/{p-3d1e5f22.entry.js → p-5ce126f7.entry.js} +1 -1
- package/dist/shift-components/p-5db9ae4b.entry.js +5 -0
- package/dist/shift-components/p-800d78fe.entry.js +5 -0
- package/dist/shift-components/p-8882ac0f.entry.js +5 -0
- package/dist/shift-components/{p-BJJ8dVwO.js → p-B8VkFyfR.js} +1 -1
- package/dist/shift-components/p-BuurMgGN.js +5 -0
- package/dist/shift-components/{p-Be3Jd2wI.js → p-Bvk_2TgY.js} +1 -1
- package/dist/shift-components/p-DQUCHNJ-.js +5 -0
- package/dist/shift-components/p-DlOwT0yg.js +5 -0
- package/dist/shift-components/{p-DT8y6uYH.js → p-EubhneKo.js} +1 -1
- package/dist/shift-components/p-YbxvNbN5.js +5 -0
- package/dist/shift-components/p-a4abc248.entry.js +5 -0
- package/dist/shift-components/p-a9f6c258.entry.js +5 -0
- package/dist/shift-components/p-adb7282c.entry.js +5 -0
- package/dist/shift-components/p-b6518621.entry.js +5 -0
- package/dist/shift-components/p-ca014643.entry.js +5 -0
- package/dist/shift-components/p-cc033f27.entry.js +5 -0
- package/dist/shift-components/p-ccb80e4d.entry.js +5 -0
- package/dist/shift-components/p-cf23180a.entry.js +5 -0
- package/dist/shift-components/p-d6619b20.entry.js +5 -0
- package/dist/shift-components/p-d6dfb9bd.entry.js +5 -0
- package/dist/shift-components/p-df8df3ab.entry.js +5 -0
- package/dist/shift-components/{p-76fe6d18.entry.js → p-e225d38c.entry.js} +1 -1
- package/dist/shift-components/p-e3252106.entry.js +5 -0
- package/dist/shift-components/p-f6b6e66e.entry.js +5 -0
- package/dist/shift-components/p-f6f9027f.entry.js +5 -0
- package/dist/shift-components/p-veklgezh.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/components/shift-select.d.ts +41 -0
- package/dist/types/components/form-elements/form-phone-number.d.ts +19 -3
- package/dist/types/components/form-elements/form-select.d.ts +3 -9
- package/dist/types/components/forms/defaults/mappers.d.ts +1 -1
- package/dist/types/components/forms/defaults/validation.d.ts +1 -3
- package/dist/types/components/forms/vehicle-quotation/element-mapper.d.ts +2 -3
- package/dist/types/components/forms/vehicle-quotation/validations.d.ts +3 -3
- package/dist/types/components.d.ts +123 -4
- package/dist/types/features/form-hook/interface.d.ts +1 -0
- package/dist/types/features/form-hook/phone-validator.d.ts +1 -2
- package/package.json +1 -1
- package/dist/cjs/form-input_4.cjs.entry.js +0 -319
- package/dist/cjs/phone-validator-Bi9emAzR.js +0 -4791
- package/dist/collection/components/forms/defaults/state-object.js +0 -5
- package/dist/components/p-3U517ERo.js +0 -5
- package/dist/components/p-9SYAxR5D.js +0 -5
- package/dist/components/p-B0MhGaG1.js +0 -5
- package/dist/components/p-B9pETmLI.js +0 -5
- package/dist/components/p-BJu-gvWT.js +0 -5
- package/dist/components/p-BSODiZ3e.js +0 -5
- package/dist/components/p-BYlmz8H8.js +0 -5
- package/dist/components/p-BaXSdgrz.js +0 -5
- package/dist/components/p-BbYlJcJL.js +0 -5
- package/dist/components/p-BbZZSs2z.js +0 -5
- package/dist/components/p-Be6aBWtX.js +0 -5
- package/dist/components/p-Bru6COhI.js +0 -5
- package/dist/components/p-BxeKiQ5h.js +0 -5
- package/dist/components/p-C0-JyFe2.js +0 -5
- package/dist/components/p-CDynFOo9.js +0 -5
- package/dist/components/p-CRB1QtlE.js +0 -5
- package/dist/components/p-CRuaQMX0.js +0 -5
- package/dist/components/p-CnzWHmTp.js +0 -5
- package/dist/components/p-Cr6RxvjN.js +0 -5
- package/dist/components/p-CvwANsMG.js +0 -5
- package/dist/components/p-D6G60Qle.js +0 -5
- package/dist/components/p-DNwpXqOm.js +0 -5
- package/dist/components/p-DYdL_Qjt.js +0 -5
- package/dist/components/p-D_aPhtf6.js +0 -5
- package/dist/components/p-DaR1VHdR.js +0 -5
- package/dist/components/p-DqPjMHKd.js +0 -5
- package/dist/components/p-DrRm2GeC.js +0 -5
- package/dist/components/p-JZv7UYk_.js +0 -5
- package/dist/components/p-MW_RDlUT.js +0 -5
- package/dist/components/p-Sl_Dlac0.js +0 -5
- package/dist/components/p-V4RS2bVl.js +0 -5
- package/dist/components/p-d53FlScY.js +0 -5
- package/dist/components/p-jy9nZx0Y.js +0 -5
- package/dist/components/p-l6FwCuo4.js +0 -5
- package/dist/components/p-nSzOFNku.js +0 -5
- package/dist/components/p-okkx_Dxf.js +0 -5
- package/dist/components/p-pgyBiEEk.js +0 -5
- package/dist/components/p-uERtY6Fc.js +0 -5
- package/dist/components/p-zPFPWP-C.js +0 -5
- package/dist/esm/form-input_4.entry.js +0 -314
- package/dist/esm/phone-validator-BtVkeXq8.js +0 -4779
- package/dist/shift-components/p-11d17669.entry.js +0 -5
- package/dist/shift-components/p-19ed338d.entry.js +0 -5
- package/dist/shift-components/p-3058431e.entry.js +0 -5
- package/dist/shift-components/p-342d0174.entry.js +0 -5
- package/dist/shift-components/p-3c9fc400.entry.js +0 -5
- package/dist/shift-components/p-3e83654e.entry.js +0 -5
- package/dist/shift-components/p-54f0635f.entry.js +0 -5
- package/dist/shift-components/p-58b67b80.entry.js +0 -5
- package/dist/shift-components/p-60e77a30.entry.js +0 -5
- package/dist/shift-components/p-676836bc.entry.js +0 -5
- package/dist/shift-components/p-73d4e1db.entry.js +0 -5
- package/dist/shift-components/p-78ebd5aa.entry.js +0 -5
- package/dist/shift-components/p-7PtHUjhE.js +0 -5
- package/dist/shift-components/p-7fd11913.entry.js +0 -5
- package/dist/shift-components/p-B1_PA5hq.js +0 -5
- package/dist/shift-components/p-CIoBnd96.js +0 -5
- package/dist/shift-components/p-CN6bh2lr.js +0 -5
- package/dist/shift-components/p-Cm_2J53u.js +0 -5
- package/dist/shift-components/p-b7ccfb5d.entry.js +0 -5
- package/dist/shift-components/p-c35b5c7e.entry.js +0 -5
- package/dist/shift-components/p-cdea798f.entry.js +0 -5
- package/dist/shift-components/p-e1994b6f.entry.js +0 -5
- package/dist/shift-components/p-e2ced3b0.entry.js +0 -5
- package/dist/shift-components/p-e42c0a58.entry.js +0 -5
- package/dist/shift-components/p-f4dbe8aa.entry.js +0 -5
- package/dist/shift-components/p-fb4a3ba5.entry.js +0 -5
- package/dist/shift-components/p-fe87b5dc.entry.js +0 -5
- 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(
|
|
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
|
-
|
|
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, {
|
|
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
|
-
"
|
|
372
|
+
"localization": {
|
|
279
373
|
"type": "unknown",
|
|
280
|
-
"attribute": "
|
|
374
|
+
"attribute": "localization",
|
|
281
375
|
"mutable": false,
|
|
282
376
|
"complexType": {
|
|
283
|
-
"original": "
|
|
284
|
-
"resolved": "
|
|
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
|
-
"
|
|
380
|
+
"FormInputLocalization": {
|
|
287
381
|
"location": "import",
|
|
288
382
|
"path": "~features/form-hook",
|
|
289
|
-
"id": "src/features/form-hook/index.ts::
|
|
383
|
+
"id": "src/features/form-hook/index.ts::FormInputLocalization"
|
|
290
384
|
}
|
|
291
385
|
}
|
|
292
386
|
},
|
|
293
387
|
"required": false,
|
|
294
|
-
"optional":
|
|
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
|
-
"
|
|
303
|
-
"type": "
|
|
304
|
-
"attribute": "
|
|
397
|
+
"countryCode": {
|
|
398
|
+
"type": "string",
|
|
399
|
+
"attribute": "country-code",
|
|
305
400
|
"mutable": false,
|
|
306
401
|
"complexType": {
|
|
307
|
-
"original": "
|
|
308
|
-
"resolved": "
|
|
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
|
-
"
|
|
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: '
|
|
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: '
|
|
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 {
|
|
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.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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.
|
|
39
|
-
|
|
40
|
-
this
|
|
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,
|
|
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
|
-
"
|
|
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: '
|
|
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: '
|
|
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,
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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 = (
|
|
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);
|