adp-web-components 0.0.95 → 0.0.97
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/add-icon-BpfeU8T4.js +13 -0
- package/dist/cjs/app-globals-D2j2HjfX.js +11 -0
- package/dist/cjs/arrow-up-icon-B_nvUxUm.js +12 -0
- package/dist/cjs/check-icon-gbrTPAKV.js +12 -0
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +15 -17
- package/dist/cjs/demo-form.cjs.entry.js +214 -0
- package/dist/cjs/{empty-table-icon-PdTX6gpI.js → empty-table-icon-BKTk1lZZ.js} +1 -1
- package/dist/cjs/flexible-container.cjs.entry.js +2 -2
- package/dist/cjs/form-checkbox_3.cjs.entry.js +109 -0
- package/dist/cjs/form-dialog_8.cjs.entry.js +230 -287
- package/dist/cjs/form-input-label-B4EsaC9R.js +30 -0
- package/dist/cjs/{get-local-language-CCn1p4nM.js → get-local-language-C_B5UpUK.js} +233 -15
- package/dist/cjs/{index-BjyafrBw.js → index-CW-dkZVH.js} +185 -115
- package/dist/cjs/information-table.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/loading-spinner.cjs.entry.js +2 -2
- package/dist/cjs/{material-card-Cd0L1Get.js → material-card-DFd5SQVC.js} +1 -1
- package/dist/cjs/part-lookup.cjs.entry.js +5 -5
- package/dist/cjs/{type-ZkbQVCRR.js → phone-validator-DI1aq9s6.js} +1637 -1837
- package/dist/cjs/{print-icon-C4ASnhAO.js → print-icon-CeXvXhF8.js} +1 -1
- package/dist/cjs/shift-accordion.cjs.entry.js +2 -2
- package/dist/cjs/shift-checkbox.cjs.entry.js +33 -0
- package/dist/cjs/shift-components.cjs.js +5 -4
- package/dist/cjs/shift-slider.cjs.entry.js +3 -3
- package/dist/cjs/shift-switch.cjs.entry.js +32 -0
- package/dist/cjs/shift-tab-content.cjs.entry.js +3 -3
- package/dist/cjs/shift-tabs_2.cjs.entry.js +19 -24
- package/dist/cjs/{type-D8rizwvZ.js → type-Bv0xlV1X.js} +1 -1
- package/dist/cjs/{type-CWFawTeP.js → type-ovX9euBp.js} +1 -1
- package/dist/cjs/vehicle-accessories_6.cjs.entry.js +30 -33
- package/dist/cjs/{vehicle-info-layout-Dp2Po_uc.js → vehicle-info-layout-CvgBHkXb.js} +1 -1
- package/dist/cjs/vehicle-lookup.cjs.entry.js +5 -5
- package/dist/cjs/vehicle-quotation-form.cjs.entry.js +444 -0
- package/dist/cjs/vin-extractor.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +9 -4
- package/dist/collection/components/components/empty.css +1 -0
- package/dist/collection/components/components/flexible-container.css +1 -1
- package/dist/collection/components/components/information-table.css +1 -1
- package/dist/collection/components/components/loading-spinner.css +1 -1
- package/dist/collection/components/components/shift-accordion.css +1 -1
- package/dist/collection/components/components/shift-checkbox.js +216 -0
- package/dist/collection/components/components/shift-slider.css +1 -1
- package/dist/collection/components/components/shift-slider.js +1 -1
- package/dist/collection/components/components/shift-switch.js +215 -0
- package/dist/collection/components/components/shift-tab-content.css +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-error-message.js +9 -0
- package/dist/collection/components/form-elements/components/form-input-label.js +10 -0
- package/dist/collection/components/form-elements/components/form-input-prefix.js +10 -0
- package/dist/collection/components/form-elements/form-checkbox.js +188 -0
- package/dist/collection/components/form-elements/form-dialog.js +75 -51
- package/dist/collection/components/form-elements/form-input.js +43 -172
- package/dist/collection/components/form-elements/form-inputs.css +1 -0
- package/dist/collection/components/form-elements/form-phone-number.js +251 -0
- package/dist/collection/components/form-elements/form-select.js +152 -117
- package/dist/collection/components/form-elements/form-shadow-input.js +7 -5
- package/dist/collection/components/form-elements/form-structure-error.js +3 -3
- package/dist/collection/components/form-elements/form-structure.js +63 -110
- package/dist/collection/components/form-elements/form-submit.js +74 -63
- package/dist/collection/components/form-elements/form-switch.js +188 -0
- package/dist/collection/components/form-elements/form-text-area.js +27 -160
- package/dist/collection/components/forms/demo/element-mapper.js +41 -0
- package/dist/collection/components/forms/demo/structure.js +15 -0
- package/dist/collection/components/forms/demo/themes.css +1 -0
- package/dist/collection/components/forms/demo/validations.js +34 -0
- package/dist/collection/components/forms/{service-booking-form.js → demo-form.js} +164 -101
- package/dist/collection/components/forms/vehicle-quotation/VehicleImageViewer.js +50 -0
- package/dist/collection/components/forms/vehicle-quotation/element-mapper.js +139 -0
- package/dist/collection/components/forms/vehicle-quotation/structure.js +34 -0
- package/dist/collection/components/forms/{service-booking/form.css → vehicle-quotation/themes.css} +1 -1
- package/dist/collection/components/forms/vehicle-quotation/validations.js +42 -0
- package/dist/collection/components/forms/vehicle-quotation.js +327 -0
- package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +2 -2
- package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +2 -2
- package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
- package/dist/collection/components/part-lookup/part-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +4 -11
- 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 +5 -3
- 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 +4 -4
- package/dist/collection/components/vin-extractor/vin-extractor.css +1 -1
- package/dist/collection/components/vin-extractor/vin-extractor.js +1 -1
- package/dist/collection/{global/lib → features/form-hook}/form-hook.js +72 -11
- package/dist/collection/features/form-hook/gist-loader.js +25 -0
- package/dist/collection/features/form-hook/index.js +11 -0
- package/dist/collection/features/form-hook/interface.js +1 -0
- package/dist/collection/features/form-hook/phone-validator.js +11 -0
- package/dist/collection/features/form-hook/render-structure.js +36 -0
- package/dist/collection/features/multi-lingual/get-local-language.js +5 -0
- package/dist/collection/features/multi-lingual/types.js +2 -0
- package/dist/collection/global/assets/add-icon.js +1 -1
- package/dist/collection/global/assets/loader-icon.js +6 -0
- package/dist/collection/global/assets/tick-icon.js +6 -0
- package/dist/collection/global/lib/fetch-json.js +12 -0
- package/dist/collection/global/lib/get-language-from-url.js +17 -0
- package/dist/collection/global/lib/get-nested-value.js +9 -0
- package/dist/collection/global/lib/parse-loose-json.js +23 -0
- package/dist/collection/global/types/generated/vehicle-lookup/paint-thickness-inspection-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/paint-thickness-inspection-panel-dto.js +1 -0
- package/dist/collection/locale-mapper.js +10 -2
- package/dist/collection/locales/forms/contactUs/type.js +6 -2
- package/dist/collection/locales/forms/demo/type.js +30 -0
- package/dist/collection/locales/forms/type.js +3 -1
- package/dist/collection/locales/forms/vehicleQuotation/type.js +40 -0
- package/dist/collection/locales/general/type.js +1 -1
- package/dist/collection/locales/generalTicketTypes/type.js +1 -10
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/{service-booking-form.d.ts → demo-form.d.ts} +4 -4
- package/dist/components/demo-form.js +5 -0
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/flexible-container.js +1 -1
- package/dist/components/form-checkbox.d.ts +11 -0
- package/dist/components/form-checkbox.js +5 -0
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-phone-number.d.ts +11 -0
- package/dist/components/form-phone-number.js +5 -0
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.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.d.ts +11 -0
- package/dist/components/form-switch.js +5 -0
- package/dist/components/form-text-area.js +1 -1
- package/dist/components/index.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/{p-B68G_Ld3.js → p-1_IG0jXf.js} +1 -1
- package/dist/components/p-B2MwZoPq.js +5 -0
- package/dist/components/p-B2beUAyz.js +5 -0
- package/dist/components/p-B3Uao1Ha.js +5 -0
- package/dist/components/p-BC0ykyCl.js +5 -0
- package/dist/components/p-BGTo_J4_.js +5 -0
- package/dist/components/{p-DOmV6aKY.js → p-BJ7Y_0HH.js} +1 -1
- package/dist/components/p-BXBJhfKx.js +5 -0
- package/dist/components/p-BXfdBBWy.js +5 -0
- package/dist/components/p-B_Awuajg.js +5 -0
- package/dist/components/p-BziBwpva.js +5 -0
- package/dist/components/p-C-I1G2GL.js +5 -0
- package/dist/components/p-CGKHe5aV.js +5 -0
- package/dist/components/p-CQnGszy6.js +5 -0
- package/dist/components/p-C_jDd3e_.js +5 -0
- package/dist/components/p-C_ozk0lR.js +5 -0
- package/dist/components/p-Cgt5s_xn.js +5 -0
- package/dist/components/p-Chfe8TId.js +5 -0
- package/dist/components/p-CnHfmo0x.js +5 -0
- package/dist/components/p-Cs2-cikp.js +5 -0
- package/dist/components/p-CtOrqs6B.js +5 -0
- package/dist/components/p-D0IHkGuC.js +5 -0
- package/dist/components/p-D3BMiplT.js +5 -0
- package/dist/components/p-D9VJI-bd.js +5 -0
- package/dist/components/p-DB29Litl.js +5 -0
- package/dist/components/p-DC7E4vgR.js +5 -0
- package/dist/components/p-DLNC6ubn.js +5 -0
- package/dist/components/p-DRK0oYuz.js +5 -0
- package/dist/components/p-DRnxC_Dv.js +5 -0
- package/dist/components/p-DW3sRsIe.js +5 -0
- package/dist/components/p-DijSwhFz.js +5 -0
- package/dist/components/p-DkCCdt6S.js +5 -0
- package/dist/components/p-Dn3zEIrl.js +5 -0
- package/dist/components/p-DvwR_CeT.js +5 -0
- package/dist/components/p-M7q3SKiP.js +5 -0
- package/dist/components/p-Xrfzb9z7.js +5 -0
- package/dist/components/p-nDe1Tx7N.js +5 -0
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/shift-accordion.js +1 -1
- package/dist/components/{contact-us-form.d.ts → shift-checkbox.d.ts} +4 -4
- package/dist/components/shift-checkbox.js +5 -0
- package/dist/components/shift-slider.js +1 -1
- package/dist/components/shift-switch.d.ts +11 -0
- package/dist/components/shift-switch.js +5 -0
- package/dist/components/shift-tab-content.js +1 -1
- package/dist/components/shift-tabs.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.d.ts +11 -0
- package/dist/components/vehicle-quotation-form.js +5 -0
- 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/add-icon-BYuh_IBk.js +11 -0
- package/dist/esm/app-globals-FlE3HjBb.js +9 -0
- package/dist/esm/arrow-up-icon-DxOdc6k0.js +10 -0
- package/dist/esm/check-icon-DVWsrBK6.js +10 -0
- package/dist/esm/dead-stock-lookup_3.entry.js +14 -16
- package/dist/esm/demo-form.entry.js +212 -0
- package/dist/esm/{empty-table-icon-DvQk12N9.js → empty-table-icon-CBc6OV9P.js} +1 -1
- package/dist/esm/flexible-container.entry.js +2 -2
- package/dist/esm/form-checkbox_3.entry.js +105 -0
- package/dist/esm/form-dialog_8.entry.js +230 -287
- package/dist/esm/form-input-label-D5w5EH3F.js +26 -0
- package/dist/esm/{get-local-language-BOB5F5ZP.js → get-local-language-uS6vNigf.js} +231 -16
- package/dist/esm/{index-CikEOqe0.js → index-BnEa9hGL.js} +184 -114
- package/dist/esm/information-table.entry.js +2 -2
- package/dist/esm/loader.js +4 -3
- package/dist/esm/loading-spinner.entry.js +2 -2
- package/dist/esm/{material-card-DiAl-884.js → material-card-KRdYdM6Z.js} +1 -1
- package/dist/esm/part-lookup.entry.js +5 -5
- package/dist/esm/{type-DQUNYPN-.js → phone-validator-CDkKaNS8.js} +1635 -1834
- package/dist/esm/{print-icon-Dn5kQmLo.js → print-icon-FGeHkj8F.js} +1 -1
- package/dist/esm/shift-accordion.entry.js +2 -2
- package/dist/esm/shift-checkbox.entry.js +31 -0
- package/dist/esm/shift-components.js +5 -4
- package/dist/esm/shift-slider.entry.js +3 -3
- package/dist/esm/shift-switch.entry.js +30 -0
- package/dist/esm/shift-tab-content.entry.js +3 -3
- package/dist/esm/shift-tabs_2.entry.js +17 -22
- package/dist/esm/{type-CUrex2XJ.js → type-Ct-uDjGf.js} +1 -1
- package/dist/esm/{type-BfKkCp-Z.js → type-DmjYUDuJ.js} +1 -1
- package/dist/esm/vehicle-accessories_6.entry.js +30 -33
- package/dist/esm/{vehicle-info-layout-CNGGKAia.js → vehicle-info-layout-gB294hFH.js} +1 -1
- package/dist/esm/vehicle-lookup.entry.js +5 -5
- package/dist/esm/vehicle-quotation-form.entry.js +442 -0
- package/dist/esm/vin-extractor.entry.js +3 -3
- package/dist/locales/forms/ar.json +8 -1
- package/dist/locales/forms/contactUs/ar.json +5 -1
- package/dist/locales/forms/contactUs/en.json +5 -1
- package/dist/locales/forms/contactUs/ku.json +5 -1
- package/dist/locales/forms/contactUs/ru.json +5 -1
- package/dist/locales/forms/contactUs/type.ts +26 -19
- package/dist/locales/forms/demo/ar.json +24 -0
- package/dist/locales/forms/demo/en.json +24 -0
- package/dist/locales/forms/demo/ku.json +24 -0
- package/dist/locales/forms/demo/ru.json +24 -0
- package/dist/locales/forms/demo/type.ts +31 -0
- package/dist/locales/forms/en.json +8 -1
- package/dist/locales/forms/ku.json +8 -1
- package/dist/locales/forms/ru.json +5 -1
- package/dist/locales/forms/type.ts +4 -1
- package/dist/locales/forms/vehicleQuotation/ar.json +34 -0
- package/dist/locales/forms/vehicleQuotation/en.json +34 -0
- package/dist/locales/forms/vehicleQuotation/ku.json +34 -0
- package/dist/locales/forms/vehicleQuotation/ru.json +34 -0
- package/dist/locales/forms/vehicleQuotation/type.ts +38 -0
- package/dist/locales/general/ar.json +0 -1
- package/dist/locales/general/en.json +0 -1
- package/dist/locales/general/ku.json +0 -1
- package/dist/locales/general/ru.json +0 -1
- package/dist/locales/general/type.ts +1 -1
- package/dist/locales/generalTicketTypes/ar.json +0 -2
- package/dist/locales/generalTicketTypes/en.json +0 -2
- package/dist/locales/generalTicketTypes/ku.json +0 -2
- package/dist/locales/generalTicketTypes/ru.json +0 -2
- package/dist/locales/generalTicketTypes/type.ts +1 -10
- package/dist/shift-components/p-0788630d.entry.js +5 -0
- package/dist/shift-components/{p-0c8bbdd0.entry.js → p-087fef54.entry.js} +1 -1
- package/dist/shift-components/p-203a857e.entry.js +5 -0
- package/dist/shift-components/p-3901EPA-.js +5 -0
- package/dist/shift-components/p-540f78fd.entry.js +5 -0
- package/dist/shift-components/p-54d04a69.entry.js +5 -0
- package/dist/shift-components/p-5595a43e.entry.js +5 -0
- package/dist/shift-components/p-6153b149.entry.js +5 -0
- package/dist/shift-components/{p-277c8a5b.entry.js → p-82cd67f3.entry.js} +1 -1
- package/dist/shift-components/p-8d9be2dc.entry.js +5 -0
- package/dist/shift-components/p-9464bc69.entry.js +5 -0
- package/dist/shift-components/{p-B8ZR3r4y.js → p-B-n4m635.js} +1 -1
- package/dist/shift-components/{p-DzSZ47FV.js → p-BK6OxaNt.js} +1 -1
- package/dist/shift-components/{p-Wtw8qj6x.js → p-BWuXL_w2.js} +1 -1
- package/dist/shift-components/p-Beoi5LCx.js +5 -0
- package/dist/shift-components/p-BgARsXBh.js +5 -0
- package/dist/shift-components/p-BnEa9hGL.js +6 -0
- package/dist/shift-components/p-BuKksSjk.js +5 -0
- package/dist/shift-components/p-Bzq1Jrq5.js +5 -0
- package/dist/shift-components/p-DB9dXavJ.js +5 -0
- package/dist/shift-components/p-DL_G203I.js +5 -0
- package/dist/shift-components/{p-Bx6q5cq-.js → p-DpQp5gau.js} +1 -1
- package/dist/shift-components/p-acd07f69.entry.js +5 -0
- package/dist/shift-components/p-b0ebebd3.entry.js +5 -0
- package/dist/shift-components/p-b8ae2d0d.entry.js +5 -0
- package/dist/shift-components/p-bc10e8d1.entry.js +5 -0
- package/dist/shift-components/p-c46ecd64.entry.js +5 -0
- package/dist/shift-components/p-dec7a90a.entry.js +5 -0
- package/dist/shift-components/p-e298ef79.entry.js +5 -0
- package/dist/shift-components/{p-238f5df0.entry.js → p-e67ec123.entry.js} +1 -1
- package/dist/shift-components/p-eL99WkVm.js +5 -0
- package/dist/shift-components/p-jtkSIgt7.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/components/shift-checkbox.d.ts +15 -0
- package/dist/types/components/components/shift-switch.d.ts +15 -0
- package/dist/types/components/form-elements/components/form-error-message.d.ts +7 -0
- package/dist/types/components/form-elements/components/form-input-label.d.ts +7 -0
- package/dist/types/components/form-elements/components/form-input-prefix.d.ts +7 -0
- package/dist/types/components/form-elements/form-checkbox.d.ts +17 -0
- package/dist/types/components/form-elements/form-dialog.d.ts +7 -9
- package/dist/types/components/form-elements/form-input.d.ts +8 -19
- package/dist/types/components/form-elements/form-phone-number.d.ts +23 -0
- package/dist/types/components/form-elements/form-select.d.ts +19 -19
- package/dist/types/components/form-elements/form-shadow-input.d.ts +1 -1
- package/dist/types/components/form-elements/form-structure.d.ts +11 -19
- package/dist/types/components/form-elements/form-submit.d.ts +9 -10
- package/dist/types/components/form-elements/form-switch.d.ts +17 -0
- package/dist/types/components/form-elements/form-text-area.d.ts +5 -15
- package/dist/types/components/forms/demo/element-mapper.d.ts +6 -0
- package/dist/types/components/forms/demo/structure.d.ts +12 -0
- package/dist/types/components/forms/demo/validations.d.ts +32 -0
- package/dist/types/components/forms/demo-form.d.ts +41 -0
- package/dist/types/components/forms/vehicle-quotation/VehicleImageViewer.d.ts +8 -0
- package/dist/types/components/forms/vehicle-quotation/element-mapper.d.ts +6 -0
- package/dist/types/components/forms/vehicle-quotation/structure.d.ts +0 -0
- package/dist/types/components/forms/vehicle-quotation/validations.d.ts +34 -0
- package/dist/types/components/forms/vehicle-quotation.d.ts +38 -0
- package/dist/types/components.d.ts +321 -234
- package/dist/types/features/form-hook/form-hook.d.ts +57 -0
- package/dist/types/features/form-hook/gist-loader.d.ts +2 -0
- package/dist/types/features/form-hook/index.d.ts +7 -0
- package/dist/types/features/form-hook/inputs/form-input.d.ts +4 -0
- package/dist/types/features/form-hook/inputs/form-select.d.ts +12 -0
- package/dist/types/features/form-hook/interface.d.ts +79 -0
- package/dist/types/features/form-hook/phone-validator.d.ts +9 -0
- package/dist/types/features/form-hook/render-structure.d.ts +3 -0
- package/dist/types/features/multi-lingual/get-local-language.d.ts +2 -1
- package/dist/types/features/multi-lingual/types.d.ts +33 -0
- package/dist/types/global/assets/add-icon.d.ts +1 -0
- package/dist/types/global/assets/loader-icon.d.ts +6 -0
- package/dist/types/global/assets/tick-icon.d.ts +6 -0
- package/dist/types/global/lib/fetch-json.d.ts +1 -0
- package/dist/types/global/lib/get-language-from-url.d.ts +2 -0
- package/dist/types/global/lib/get-nested-value.d.ts +1 -0
- package/dist/types/global/lib/parse-loose-json.d.ts +1 -0
- package/dist/types/global/types/generated/vehicle-lookup/paint-thickness-inspection-dto.d.ts +6 -0
- package/dist/types/global/types/generated/vehicle-lookup/paint-thickness-inspection-panel-dto.d.ts +7 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-lookup-dto.d.ts +2 -2
- package/dist/types/locale-mapper.d.ts +3 -1
- package/dist/types/locales/forms/contactUs/type.d.ts +9 -0
- package/dist/types/locales/forms/demo/type.d.ts +49 -0
- package/dist/types/locales/forms/type.d.ts +13 -0
- package/dist/types/locales/forms/vehicleQuotation/type.d.ts +68 -0
- package/dist/types/locales/forms/wrapper-type.d.ts +21 -0
- package/dist/types/locales/general/type.d.ts +0 -2
- package/dist/types/locales/generalTicketTypes/type.d.ts +0 -4
- package/dist/types/locales/vehicleLookup/serviceHistory/type.d.ts +2 -2
- package/dist/types/locales/vehicleLookup/wrapper-type.d.ts +2 -2
- package/dist/types/stencil-public-runtime.d.ts +12 -5
- package/package.json +5 -3
- package/dist/cjs/contact-us-form.cjs.entry.js +0 -198
- package/dist/cjs/service-booking-form.cjs.entry.js +0 -198
- package/dist/collection/components/form-elements/form-dialog.css +0 -1
- package/dist/collection/components/form-elements/form-input.css +0 -1
- package/dist/collection/components/form-elements/form-select.css +0 -1
- package/dist/collection/components/form-elements/form-shadow-input.css +0 -1
- package/dist/collection/components/form-elements/form-structure-error.css +0 -1
- package/dist/collection/components/form-elements/form-structure.css +0 -1
- package/dist/collection/components/form-elements/form-submit.css +0 -1
- package/dist/collection/components/form-elements/form-text-area.css +0 -1
- package/dist/collection/components/forms/contact-us/element-mapper.js +0 -88
- package/dist/collection/components/forms/contact-us/form.css +0 -1
- package/dist/collection/components/forms/contact-us/validations.js +0 -19
- package/dist/collection/components/forms/contact-us-form.js +0 -295
- package/dist/collection/components/forms/service-booking/element-mapper.js +0 -88
- package/dist/collection/components/forms/service-booking/validations.js +0 -19
- package/dist/collection/global/lib/validate-form-structure.js +0 -47
- package/dist/components/contact-us-form.js +0 -5
- package/dist/components/p-0PjZRWut.js +0 -5
- package/dist/components/p-11ylorNL.js +0 -5
- package/dist/components/p-B2qqkU3A.js +0 -5
- package/dist/components/p-B6j7vssc.js +0 -5
- package/dist/components/p-BF4ShuLZ.js +0 -5
- package/dist/components/p-BGe0MyLF.js +0 -5
- package/dist/components/p-BKq17ywX.js +0 -5
- package/dist/components/p-BSP1ayje.js +0 -5
- package/dist/components/p-BVPVJguA.js +0 -5
- package/dist/components/p-BhjL0HMA.js +0 -5
- package/dist/components/p-BjSLaXGX.js +0 -5
- package/dist/components/p-Bm8G-DAp.js +0 -5
- package/dist/components/p-CIaM3UPL.js +0 -5
- package/dist/components/p-CcP_EtCu.js +0 -5
- package/dist/components/p-CtpTKsfq.js +0 -5
- package/dist/components/p-D8xszt8E.js +0 -5
- package/dist/components/p-DXGHyX7G.js +0 -5
- package/dist/components/p-Di5SfFwc.js +0 -5
- package/dist/components/p-DyaIfEgq.js +0 -5
- package/dist/components/p-P3fAKtye.js +0 -5
- package/dist/components/p-QMinV6Ic.js +0 -5
- package/dist/components/p-TyreGxpg.js +0 -5
- package/dist/components/p-alw0x13e.js +0 -5
- package/dist/components/p-eQuyMB7o.js +0 -5
- package/dist/components/p-x0cm6Jgv.js +0 -5
- package/dist/components/service-booking-form.js +0 -5
- package/dist/esm/contact-us-form.entry.js +0 -196
- package/dist/esm/service-booking-form.entry.js +0 -196
- package/dist/shift-components/p-03f093e0.entry.js +0 -5
- package/dist/shift-components/p-077e4c82.entry.js +0 -5
- package/dist/shift-components/p-42218765.entry.js +0 -5
- package/dist/shift-components/p-43a8b998.entry.js +0 -5
- package/dist/shift-components/p-55558c0f.entry.js +0 -5
- package/dist/shift-components/p-55c5a5ea.entry.js +0 -5
- package/dist/shift-components/p-701e3fb0.entry.js +0 -5
- package/dist/shift-components/p-8d7b1edb.entry.js +0 -5
- package/dist/shift-components/p-BSpTbUWi.js +0 -5
- package/dist/shift-components/p-CTkDt6jM.js +0 -5
- package/dist/shift-components/p-CikEOqe0.js +0 -6
- package/dist/shift-components/p-DPgWys0Y.js +0 -5
- package/dist/shift-components/p-bc419485.entry.js +0 -5
- package/dist/shift-components/p-e8e37708.entry.js +0 -5
- package/dist/shift-components/p-f1181125.entry.js +0 -5
- package/dist/shift-components/p-f760aaa3.entry.js +0 -5
- package/dist/shift-components/p-fyqwD4fB.js +0 -5
- package/dist/types/components/forms/contact-us/element-mapper.d.ts +0 -3
- package/dist/types/components/forms/contact-us/validations.d.ts +0 -26
- package/dist/types/components/forms/contact-us-form.d.ts +0 -32
- package/dist/types/components/forms/service-booking/element-mapper.d.ts +0 -3
- package/dist/types/components/forms/service-booking/validations.d.ts +0 -26
- package/dist/types/components/forms/service-booking-form.d.ts +0 -32
- package/dist/types/global/lib/form-hook.d.ts +0 -47
- package/dist/types/global/lib/validate-form-structure.d.ts +0 -3
- package/dist/types/global/types/forms.d.ts +0 -64
- package/dist/types/global/types/general.d.ts +0 -23
- /package/dist/collection/{global/types/forms.js → features/form-hook/inputs/form-input.js} +0 -0
- /package/dist/collection/{global/types/general.js → features/form-hook/inputs/form-select.js} +0 -0
|
@@ -4,38 +4,58 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Host, h } from "@stencil/core";
|
|
6
6
|
import cn from "../../global/lib/cn";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
7
|
+
import demoSchema from "../../locales/forms/demo/type";
|
|
8
|
+
import { DemoStructures } from "./demo/structure";
|
|
9
|
+
import { demoElements } from "./demo/element-mapper";
|
|
10
|
+
import { demoInputsValidation } from "./demo/validations";
|
|
11
|
+
import { FormHook } from "../../features/form-hook/form-hook";
|
|
12
|
+
import { gistLoader } from "../../features/form-hook/index";
|
|
13
|
+
import { getLocaleLanguage, getSharedFormLocal, sharedFormLocalesSchema } from "../../features/multi-lingual/index";
|
|
14
|
+
export class DemoForm {
|
|
12
15
|
constructor() {
|
|
13
|
-
|
|
16
|
+
// ====== Start Localization
|
|
14
17
|
this.language = 'en';
|
|
15
|
-
this.
|
|
18
|
+
this.locale = Object.assign({ sharedFormLocales: sharedFormLocalesSchema.getDefault() }, demoSchema.getDefault());
|
|
19
|
+
this.queryString = '';
|
|
16
20
|
this.recaptchaKey = '6Lehq6IpAAAAAETTDS2Zh60nHIT1a8oVkRtJ2WsA';
|
|
17
|
-
this.renderControl = {};
|
|
18
21
|
this.recaptchaWidget = null;
|
|
19
|
-
this.form = new FormHook(this,
|
|
22
|
+
this.form = new FormHook(this, demoInputsValidation);
|
|
20
23
|
}
|
|
21
|
-
async
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
async changeLanguage(newLanguage) {
|
|
25
|
+
const [sharedLocales, locale] = await Promise.all([getSharedFormLocal(newLanguage), getLocaleLanguage(newLanguage, 'forms.demo', demoSchema)]);
|
|
26
|
+
this.locale = Object.assign(Object.assign({}, sharedLocales), locale);
|
|
27
|
+
this.form.rerender({ rerenderAll: true });
|
|
28
|
+
}
|
|
29
|
+
setIsLoading(isLoading) {
|
|
30
|
+
this.isLoading = isLoading;
|
|
31
|
+
if (this.loadingChanges)
|
|
32
|
+
this.loadingChanges(true);
|
|
33
|
+
}
|
|
34
|
+
setErrorCallback(error) {
|
|
35
|
+
if (error === null || error === void 0 ? void 0 : error.message)
|
|
36
|
+
this.errorMessage = error.message;
|
|
37
|
+
if (this.errorCallback)
|
|
38
|
+
this.errorCallback(error);
|
|
39
|
+
}
|
|
40
|
+
setSuccessCallback(data) {
|
|
41
|
+
if (this.successCallback)
|
|
42
|
+
this.successCallback(data);
|
|
43
|
+
}
|
|
44
|
+
async componentWillLoad() {
|
|
45
|
+
await this.changeLanguage(this.language);
|
|
46
|
+
if (this.structure)
|
|
47
|
+
return;
|
|
48
|
+
if (this.gistId)
|
|
49
|
+
this.structure = await gistLoader(this.gistId);
|
|
50
|
+
else if (this.theme === 'tiq')
|
|
51
|
+
this.structure = DemoStructures.tiq;
|
|
34
52
|
}
|
|
35
53
|
async formSubmit(formValues) {
|
|
36
54
|
try {
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
console.log(formValues);
|
|
56
|
+
this.setIsLoading(true);
|
|
57
|
+
if (formValues)
|
|
58
|
+
throw new Error('a');
|
|
39
59
|
const token = await grecaptcha.execute(this.recaptchaKey, { action: 'submit' });
|
|
40
60
|
const response = await fetch(`${this.baseUrl}?${this.queryString}`, {
|
|
41
61
|
method: 'post',
|
|
@@ -48,43 +68,78 @@ export class ContactUsForm {
|
|
|
48
68
|
},
|
|
49
69
|
});
|
|
50
70
|
const data = await response.json();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.form.successAnimation();
|
|
71
|
+
this.setSuccessCallback(data);
|
|
72
|
+
this.form.openDialog();
|
|
54
73
|
setTimeout(() => {
|
|
55
74
|
this.form.reset();
|
|
56
75
|
}, 1000);
|
|
57
76
|
}
|
|
58
77
|
catch (error) {
|
|
59
78
|
console.error(error);
|
|
60
|
-
|
|
61
|
-
this.errorCallback(error);
|
|
62
|
-
if (error === null || error === void 0 ? void 0 : error.message)
|
|
63
|
-
this.errorMessage = error.message;
|
|
79
|
+
this.setErrorCallback(error);
|
|
64
80
|
}
|
|
65
81
|
finally {
|
|
66
|
-
|
|
67
|
-
|
|
82
|
+
this.setIsLoading(false);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async componentDidLoad() {
|
|
86
|
+
try {
|
|
87
|
+
if (this.recaptchaKey) {
|
|
88
|
+
const script = document.createElement('script');
|
|
89
|
+
script.src = `https://www.google.com/recaptcha/api.js?render=${this.recaptchaKey}&hl=${this.language}`;
|
|
90
|
+
script.async = true;
|
|
91
|
+
script.defer = true;
|
|
92
|
+
document.head.appendChild(script);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
console.log(error);
|
|
68
97
|
}
|
|
69
98
|
}
|
|
70
99
|
render() {
|
|
71
|
-
return (h(Host, { key: '
|
|
72
|
-
[`
|
|
73
|
-
}) }, h("form-structure", { key: '
|
|
100
|
+
return (h(Host, { key: '14d89e07a2c08ef76120b6294501be5b6a123fd8', class: cn({
|
|
101
|
+
[`demo-${this.theme}`]: this.theme,
|
|
102
|
+
}) }, h("form-structure", { key: 'df56b9446ecac93641b32caa4a501cba900500f7', form: this.form, language: this.language, formLocale: this.locale, structure: this.structure, isLoading: this.isLoading, errorMessage: this.errorMessage, formElementMapper: demoElements }, h("slot", { key: 'c014998b1962835e798764b19328ed718216616f' }))));
|
|
74
103
|
}
|
|
75
|
-
static get is() { return "
|
|
104
|
+
static get is() { return "demo-form"; }
|
|
76
105
|
static get originalStyleUrls() {
|
|
77
106
|
return {
|
|
78
|
-
"$": ["
|
|
107
|
+
"$": ["demo/themes.css"]
|
|
79
108
|
};
|
|
80
109
|
}
|
|
81
110
|
static get styleUrls() {
|
|
82
111
|
return {
|
|
83
|
-
"$": ["
|
|
112
|
+
"$": ["demo/themes.css"]
|
|
84
113
|
};
|
|
85
114
|
}
|
|
86
115
|
static get properties() {
|
|
87
116
|
return {
|
|
117
|
+
"language": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"attribute": "language",
|
|
120
|
+
"mutable": false,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "LanguageKeys",
|
|
123
|
+
"resolved": "\"ar\" | \"en\" | \"ku\" | \"ru\"",
|
|
124
|
+
"references": {
|
|
125
|
+
"LanguageKeys": {
|
|
126
|
+
"location": "import",
|
|
127
|
+
"path": "~features/multi-lingual",
|
|
128
|
+
"id": "src/features/multi-lingual/index.ts::LanguageKeys"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": ""
|
|
137
|
+
},
|
|
138
|
+
"getter": false,
|
|
139
|
+
"setter": false,
|
|
140
|
+
"reflect": false,
|
|
141
|
+
"defaultValue": "'en'"
|
|
142
|
+
},
|
|
88
143
|
"theme": {
|
|
89
144
|
"type": "string",
|
|
90
145
|
"attribute": "theme",
|
|
@@ -104,9 +159,9 @@ export class ContactUsForm {
|
|
|
104
159
|
"setter": false,
|
|
105
160
|
"reflect": false
|
|
106
161
|
},
|
|
107
|
-
"
|
|
162
|
+
"gistId": {
|
|
108
163
|
"type": "string",
|
|
109
|
-
"attribute": "
|
|
164
|
+
"attribute": "gist-id",
|
|
110
165
|
"mutable": false,
|
|
111
166
|
"complexType": {
|
|
112
167
|
"original": "string",
|
|
@@ -114,7 +169,7 @@ export class ContactUsForm {
|
|
|
114
169
|
"references": {}
|
|
115
170
|
},
|
|
116
171
|
"required": false,
|
|
117
|
-
"optional":
|
|
172
|
+
"optional": true,
|
|
118
173
|
"docs": {
|
|
119
174
|
"tags": [],
|
|
120
175
|
"text": ""
|
|
@@ -142,13 +197,13 @@ export class ContactUsForm {
|
|
|
142
197
|
"setter": false,
|
|
143
198
|
"reflect": false
|
|
144
199
|
},
|
|
145
|
-
"
|
|
146
|
-
"type": "
|
|
147
|
-
"attribute": "
|
|
200
|
+
"errorCallback": {
|
|
201
|
+
"type": "unknown",
|
|
202
|
+
"attribute": "error-callback",
|
|
148
203
|
"mutable": false,
|
|
149
204
|
"complexType": {
|
|
150
|
-
"original": "
|
|
151
|
-
"resolved": "
|
|
205
|
+
"original": "(error: any) => void",
|
|
206
|
+
"resolved": "(error: any) => void",
|
|
152
207
|
"references": {}
|
|
153
208
|
},
|
|
154
209
|
"required": false,
|
|
@@ -158,24 +213,16 @@ export class ContactUsForm {
|
|
|
158
213
|
"text": ""
|
|
159
214
|
},
|
|
160
215
|
"getter": false,
|
|
161
|
-
"setter": false
|
|
162
|
-
"reflect": false,
|
|
163
|
-
"defaultValue": "''"
|
|
216
|
+
"setter": false
|
|
164
217
|
},
|
|
165
|
-
"
|
|
166
|
-
"type": "
|
|
167
|
-
"attribute": "
|
|
218
|
+
"successCallback": {
|
|
219
|
+
"type": "unknown",
|
|
220
|
+
"attribute": "success-callback",
|
|
168
221
|
"mutable": false,
|
|
169
222
|
"complexType": {
|
|
170
|
-
"original": "
|
|
171
|
-
"resolved": "
|
|
172
|
-
"references": {
|
|
173
|
-
"LanguageKeys": {
|
|
174
|
-
"location": "import",
|
|
175
|
-
"path": "~features/multi-lingual",
|
|
176
|
-
"id": "src/features/multi-lingual/index.ts::LanguageKeys"
|
|
177
|
-
}
|
|
178
|
-
}
|
|
223
|
+
"original": "(data: any) => void",
|
|
224
|
+
"resolved": "(data: any) => void",
|
|
225
|
+
"references": {}
|
|
179
226
|
},
|
|
180
227
|
"required": false,
|
|
181
228
|
"optional": false,
|
|
@@ -184,17 +231,15 @@ export class ContactUsForm {
|
|
|
184
231
|
"text": ""
|
|
185
232
|
},
|
|
186
233
|
"getter": false,
|
|
187
|
-
"setter": false
|
|
188
|
-
"reflect": false,
|
|
189
|
-
"defaultValue": "'en'"
|
|
234
|
+
"setter": false
|
|
190
235
|
},
|
|
191
|
-
"
|
|
192
|
-
"type": "
|
|
193
|
-
"attribute": "
|
|
236
|
+
"loadingChanges": {
|
|
237
|
+
"type": "unknown",
|
|
238
|
+
"attribute": "loading-changes",
|
|
194
239
|
"mutable": false,
|
|
195
240
|
"complexType": {
|
|
196
|
-
"original": "
|
|
197
|
-
"resolved": "
|
|
241
|
+
"original": "(loading: boolean) => void",
|
|
242
|
+
"resolved": "(loading: boolean) => void",
|
|
198
243
|
"references": {}
|
|
199
244
|
},
|
|
200
245
|
"required": false,
|
|
@@ -204,18 +249,27 @@ export class ContactUsForm {
|
|
|
204
249
|
"text": ""
|
|
205
250
|
},
|
|
206
251
|
"getter": false,
|
|
207
|
-
"setter": false
|
|
208
|
-
"reflect": false,
|
|
209
|
-
"defaultValue": "'[\"submit.Submit\"]'"
|
|
252
|
+
"setter": false
|
|
210
253
|
},
|
|
211
|
-
"
|
|
212
|
-
"type": "
|
|
213
|
-
"attribute": "
|
|
254
|
+
"structure": {
|
|
255
|
+
"type": "unknown",
|
|
256
|
+
"attribute": "structure",
|
|
214
257
|
"mutable": false,
|
|
215
258
|
"complexType": {
|
|
216
|
-
"original": "
|
|
217
|
-
"resolved": "string",
|
|
218
|
-
"references": {
|
|
259
|
+
"original": "FormElementStructure<demoElementNames> | undefined",
|
|
260
|
+
"resolved": "{ data?: Record<string, any>; } & { id?: string; class?: string; children?: (\"submit\" | OptionalKeys<{ confirmPolicy: boolean; ageConfirmation: true; cityId: string; email: string; message: string; generalTicketType: string; name: string; phone: string; }> | FormElementStructureComponents<\"submit\" | OptionalKeys<{ confirmPolicy: boolean; ageConfirmation: true; cityId: string; email: string; message: string; generalTicketType: string; name: string; phone: string; }>>)[]; } & { tag: string; name?: \"submit\" | OptionalKeys<{ confirmPolicy: boolean; ageConfirmation: true; cityId: string; email: string; message: string; generalTicketType: string; name: string; phone: string; }>; } | { data?: Record<string, any>; } & { id?: string; class?: string; children?: (\"submit\" | OptionalKeys<{ confirmPolicy: boolean; ageConfirmation: true; cityId: string; email: string; message: string; generalTicketType: string; name: string; phone: string; }> | FormElementStructureComponents<\"submit\" | OptionalKeys<{ confirmPolicy: boolean; ageConfirmation: true; cityId: string; email: string; message: string; generalTicketType: string; name: string; phone: string; }>>)[]; } & { tag?: string; name: \"submit\" | OptionalKeys<{ confirmPolicy: boolean; ageConfirmation: true; cityId: string; email: string; message: string; generalTicketType: string; name: string; phone: string; }>; }",
|
|
261
|
+
"references": {
|
|
262
|
+
"FormElementStructure": {
|
|
263
|
+
"location": "import",
|
|
264
|
+
"path": "~features/form-hook",
|
|
265
|
+
"id": "src/features/form-hook/index.ts::FormElementStructure"
|
|
266
|
+
},
|
|
267
|
+
"demoElementNames": {
|
|
268
|
+
"location": "import",
|
|
269
|
+
"path": "./demo/element-mapper",
|
|
270
|
+
"id": "src/components/forms/demo/element-mapper.tsx::demoElementNames"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
219
273
|
},
|
|
220
274
|
"required": false,
|
|
221
275
|
"optional": false,
|
|
@@ -224,17 +278,15 @@ export class ContactUsForm {
|
|
|
224
278
|
"text": ""
|
|
225
279
|
},
|
|
226
280
|
"getter": false,
|
|
227
|
-
"setter": false
|
|
228
|
-
"reflect": false,
|
|
229
|
-
"defaultValue": "'6Lehq6IpAAAAAETTDS2Zh60nHIT1a8oVkRtJ2WsA'"
|
|
281
|
+
"setter": false
|
|
230
282
|
},
|
|
231
|
-
"
|
|
232
|
-
"type": "
|
|
233
|
-
"attribute": "
|
|
283
|
+
"baseUrl": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"attribute": "base-url",
|
|
234
286
|
"mutable": false,
|
|
235
287
|
"complexType": {
|
|
236
|
-
"original": "
|
|
237
|
-
"resolved": "
|
|
288
|
+
"original": "string",
|
|
289
|
+
"resolved": "string",
|
|
238
290
|
"references": {}
|
|
239
291
|
},
|
|
240
292
|
"required": false,
|
|
@@ -244,15 +296,16 @@ export class ContactUsForm {
|
|
|
244
296
|
"text": ""
|
|
245
297
|
},
|
|
246
298
|
"getter": false,
|
|
247
|
-
"setter": false
|
|
299
|
+
"setter": false,
|
|
300
|
+
"reflect": false
|
|
248
301
|
},
|
|
249
|
-
"
|
|
250
|
-
"type": "
|
|
251
|
-
"attribute": "
|
|
302
|
+
"queryString": {
|
|
303
|
+
"type": "string",
|
|
304
|
+
"attribute": "query-string",
|
|
252
305
|
"mutable": false,
|
|
253
306
|
"complexType": {
|
|
254
|
-
"original": "
|
|
255
|
-
"resolved": "
|
|
307
|
+
"original": "string",
|
|
308
|
+
"resolved": "string",
|
|
256
309
|
"references": {}
|
|
257
310
|
},
|
|
258
311
|
"required": false,
|
|
@@ -262,15 +315,17 @@ export class ContactUsForm {
|
|
|
262
315
|
"text": ""
|
|
263
316
|
},
|
|
264
317
|
"getter": false,
|
|
265
|
-
"setter": false
|
|
318
|
+
"setter": false,
|
|
319
|
+
"reflect": false,
|
|
320
|
+
"defaultValue": "''"
|
|
266
321
|
},
|
|
267
|
-
"
|
|
268
|
-
"type": "
|
|
269
|
-
"attribute": "
|
|
322
|
+
"recaptchaKey": {
|
|
323
|
+
"type": "string",
|
|
324
|
+
"attribute": "recaptcha-key",
|
|
270
325
|
"mutable": false,
|
|
271
326
|
"complexType": {
|
|
272
|
-
"original": "
|
|
273
|
-
"resolved": "
|
|
327
|
+
"original": "string",
|
|
328
|
+
"resolved": "string",
|
|
274
329
|
"references": {}
|
|
275
330
|
},
|
|
276
331
|
"required": false,
|
|
@@ -280,16 +335,24 @@ export class ContactUsForm {
|
|
|
280
335
|
"text": ""
|
|
281
336
|
},
|
|
282
337
|
"getter": false,
|
|
283
|
-
"setter": false
|
|
338
|
+
"setter": false,
|
|
339
|
+
"reflect": false,
|
|
340
|
+
"defaultValue": "'6Lehq6IpAAAAAETTDS2Zh60nHIT1a8oVkRtJ2WsA'"
|
|
284
341
|
}
|
|
285
342
|
};
|
|
286
343
|
}
|
|
287
344
|
static get states() {
|
|
288
345
|
return {
|
|
346
|
+
"locale": {},
|
|
289
347
|
"isLoading": {},
|
|
290
|
-
"renderControl": {},
|
|
291
348
|
"errorMessage": {}
|
|
292
349
|
};
|
|
293
350
|
}
|
|
294
351
|
static get elementRef() { return "el"; }
|
|
352
|
+
static get watchers() {
|
|
353
|
+
return [{
|
|
354
|
+
"propName": "language",
|
|
355
|
+
"methodName": "changeLanguage"
|
|
356
|
+
}];
|
|
357
|
+
}
|
|
295
358
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
import { h } from "@stencil/core";
|
|
6
|
+
import { LoaderIcon } from "../../../global/assets/loader-icon";
|
|
7
|
+
import cn from "../../../global/lib/cn";
|
|
8
|
+
const cachedImages = {};
|
|
9
|
+
const cacheImage = (form, imSrc, id) => {
|
|
10
|
+
fetch(imSrc)
|
|
11
|
+
.then(res => res.blob())
|
|
12
|
+
.then(blob => {
|
|
13
|
+
const reader = new FileReader();
|
|
14
|
+
reader.onloadend = () => {
|
|
15
|
+
cachedImages[id] = reader.result;
|
|
16
|
+
form.rerender({ rerenderForm: true });
|
|
17
|
+
};
|
|
18
|
+
reader.readAsDataURL(blob);
|
|
19
|
+
})
|
|
20
|
+
.catch(e => {
|
|
21
|
+
console.log(e);
|
|
22
|
+
// fail silently, keep fallback
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
let imageSrcBase64 = '';
|
|
26
|
+
export const VehicleImageViewer = ({ form }) => {
|
|
27
|
+
var _a, _b, _c;
|
|
28
|
+
form.addWatcher('vehicle');
|
|
29
|
+
let vehicleId = form.getValue('vehicle');
|
|
30
|
+
let openContainer = !!vehicleId;
|
|
31
|
+
const selectedVehicle = (_a = form.context['vehicleList']) === null || _a === void 0 ? void 0 : _a.find(vehicle => `${vehicle === null || vehicle === void 0 ? void 0 : vehicle.ID}` === vehicleId);
|
|
32
|
+
let imSrc;
|
|
33
|
+
if (selectedVehicle) {
|
|
34
|
+
imSrc = selectedVehicle === null || selectedVehicle === void 0 ? void 0 : selectedVehicle.Image;
|
|
35
|
+
vehicleId = selectedVehicle.ID;
|
|
36
|
+
}
|
|
37
|
+
else if (form.context['vehicleList'] && form.context['vehicleList'][0]) {
|
|
38
|
+
imSrc = (_c = (_b = form.context['vehicleList'][0]) === null || _b === void 0 ? void 0 : _b.meta) === null || _c === void 0 ? void 0 : _c.image;
|
|
39
|
+
vehicleId = form.context['vehicleList'][0].value;
|
|
40
|
+
}
|
|
41
|
+
let isLoading = false;
|
|
42
|
+
if (cachedImages[vehicleId]) {
|
|
43
|
+
imageSrcBase64 = cachedImages[vehicleId];
|
|
44
|
+
}
|
|
45
|
+
else if (form && imSrc && vehicleId) {
|
|
46
|
+
cacheImage(form, imSrc, vehicleId);
|
|
47
|
+
isLoading = true;
|
|
48
|
+
}
|
|
49
|
+
return (h("flexible-container", { isOpened: openContainer }, h("div", { class: cn('vehicle-image-wrapper', { loading: isLoading }) }, h("div", { class: "loading-wrapper" }, h(LoaderIcon, { class: "img" })), h("img", { src: imageSrcBase64, alt: "toyota vehicle" }))));
|
|
50
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
import { forceUpdate, h } from "@stencil/core";
|
|
6
|
+
import { phoneValidator } from "./validations";
|
|
7
|
+
import { VehicleImageViewer } from "./VehicleImageViewer";
|
|
8
|
+
export const vehicleQuotationElements = {
|
|
9
|
+
'submit': ({ props }) => h("form-submit", Object.assign({}, props)),
|
|
10
|
+
'name': ({ props }) => h("form-input", Object.assign({}, props)),
|
|
11
|
+
'phone': ({ props, isLoading }) => h("form-phone-number", Object.assign({}, props, { isLoading: isLoading, defaultValue: phoneValidator.default, validator: phoneValidator })),
|
|
12
|
+
'vehicle': ({ form, language, props }) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const fetcher = async ({ signal }) => {
|
|
15
|
+
var _a;
|
|
16
|
+
const vehicleEndpoint = (_a = form.context.structure) === null || _a === void 0 ? void 0 : _a.data.vehicleApi;
|
|
17
|
+
const response = await fetch(vehicleEndpoint, { signal, headers: { 'Accept-Language': language } });
|
|
18
|
+
form.context['vehicleList'] = await response.json();
|
|
19
|
+
forceUpdate(form.formStructure);
|
|
20
|
+
return form.context['vehicleList'].map(vehicle => ({
|
|
21
|
+
label: vehicle.Title,
|
|
22
|
+
value: `${vehicle.ID}`,
|
|
23
|
+
meta: { image: vehicle.Image },
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
const params = new URLSearchParams(window.location.search);
|
|
27
|
+
const defaultValue = params.get((_a = form.context.structure.data) === null || _a === void 0 ? void 0 : _a.vehicleIdQueryParam);
|
|
28
|
+
return h("form-select", Object.assign({}, props, { defaultValue: defaultValue, searchable: true, fetcher: fetcher, language: language }));
|
|
29
|
+
},
|
|
30
|
+
'dealer': ({ form, language, props }) => {
|
|
31
|
+
const fetcher = async ({ signal }) => {
|
|
32
|
+
var _a;
|
|
33
|
+
const dealerEndpoint = (_a = form.context.structure) === null || _a === void 0 ? void 0 : _a.data.dealerApi;
|
|
34
|
+
const response = await fetch(dealerEndpoint, { signal, headers: { 'Accept-Language': language } });
|
|
35
|
+
form.context['dealerList'] = (await response.json()).map(dealer => ({
|
|
36
|
+
label: dealer.Name,
|
|
37
|
+
value: `${dealer.ID}`,
|
|
38
|
+
}));
|
|
39
|
+
return form.context['dealerList'];
|
|
40
|
+
};
|
|
41
|
+
return h("form-select", Object.assign({}, props, { clearable: true, searchable: true, fetcher: fetcher, language: language }));
|
|
42
|
+
},
|
|
43
|
+
'paymentType': ({ language, props, locale }) => {
|
|
44
|
+
const fetcher = async ({}) => {
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
value: 'Cash',
|
|
48
|
+
label: locale === null || locale === void 0 ? void 0 : locale.Cash,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: 'FlexiblePaymentPlan',
|
|
52
|
+
label: locale.Flexible,
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
};
|
|
56
|
+
return h("form-select", Object.assign({}, props, { clearable: true, fetcher: fetcher, language: language }));
|
|
57
|
+
},
|
|
58
|
+
'contactTime': ({ language, props, locale }) => {
|
|
59
|
+
const fetcher = async ({}) => {
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
value: 'Morning',
|
|
63
|
+
label: locale === null || locale === void 0 ? void 0 : locale.Morning,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: 'Noon',
|
|
67
|
+
label: locale === null || locale === void 0 ? void 0 : locale.Noon,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: 'Afternoon',
|
|
71
|
+
label: locale === null || locale === void 0 ? void 0 : locale.Afternoon,
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
};
|
|
75
|
+
return h("form-select", Object.assign({}, props, { clearable: true, fetcher: fetcher, language: language }));
|
|
76
|
+
},
|
|
77
|
+
'ownVehicle': ({ language, props, locale }) => {
|
|
78
|
+
const fetcher = async ({}) => {
|
|
79
|
+
return [
|
|
80
|
+
{
|
|
81
|
+
value: 'yes',
|
|
82
|
+
label: locale === null || locale === void 0 ? void 0 : locale.Yes,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
value: 'no',
|
|
86
|
+
label: locale === null || locale === void 0 ? void 0 : locale.No,
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
};
|
|
90
|
+
return h("form-select", Object.assign({}, props, { fetcher: fetcher, language: language }));
|
|
91
|
+
},
|
|
92
|
+
'currentVehicleBrand': ({ form, language, props, locale }) => {
|
|
93
|
+
form.addWatcher('ownVehicle');
|
|
94
|
+
const ownVehicle = form.getValue('ownVehicle') === 'yes';
|
|
95
|
+
const fetcher = async ({ signal }) => {
|
|
96
|
+
var _a;
|
|
97
|
+
const currentVehiclesEndpoint = (_a = form.context.structure) === null || _a === void 0 ? void 0 : _a.data.currentVehiclesApi;
|
|
98
|
+
const response = await fetch(currentVehiclesEndpoint, { signal, headers: { 'Accept-Language': language } });
|
|
99
|
+
form.context['currentVehiclesList'] = await response.json();
|
|
100
|
+
return [
|
|
101
|
+
...form.context['currentVehiclesList'].map(vehicle => ({
|
|
102
|
+
label: vehicle.name,
|
|
103
|
+
value: `${vehicle.id}`,
|
|
104
|
+
})),
|
|
105
|
+
{
|
|
106
|
+
value: 'others',
|
|
107
|
+
label: locale.Others,
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
};
|
|
111
|
+
return h("form-select", Object.assign({}, props, { searchable: true, fetcher: fetcher, language: language, resetKey: ownVehicle, isRequired: ownVehicle, isDisabled: !ownVehicle }));
|
|
112
|
+
},
|
|
113
|
+
'currentVehicleModel': ({ form, language, props, locale }) => {
|
|
114
|
+
form.addWatcher('ownVehicle');
|
|
115
|
+
form.addWatcher('currentVehicleBrand');
|
|
116
|
+
const ownVehicle = form.getValue('ownVehicle') === 'yes';
|
|
117
|
+
const currentVehicleBrand = form.getValue('currentVehicleBrand');
|
|
118
|
+
const fetcher = async ({}) => {
|
|
119
|
+
var _a;
|
|
120
|
+
if (!currentVehicleBrand)
|
|
121
|
+
return [];
|
|
122
|
+
const selectedBrand = (_a = form.context['currentVehiclesList']) === null || _a === void 0 ? void 0 : _a.find(vehicle => `${vehicle === null || vehicle === void 0 ? void 0 : vehicle.id}` === currentVehicleBrand);
|
|
123
|
+
if (!selectedBrand)
|
|
124
|
+
return [];
|
|
125
|
+
return [
|
|
126
|
+
...selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.models.map(model => ({ label: model.name, value: `${model.id}` })),
|
|
127
|
+
{
|
|
128
|
+
value: 'others',
|
|
129
|
+
label: locale.Others,
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
};
|
|
133
|
+
return (h("form-select", Object.assign({}, props, { searchable: true, fetcher: fetcher, language: language, resetKey: currentVehicleBrand, fetcherKey: currentVehicleBrand, isRequired: ownVehicle && currentVehicleBrand !== 'others', isDisabled: !currentVehicleBrand || currentVehicleBrand === 'others' })));
|
|
134
|
+
},
|
|
135
|
+
'vehicleImage': ({ form }) => h(VehicleImageViewer, { form: form }),
|
|
136
|
+
'choose': ({ locale }) => h("h1", { class: "section-title" }, locale.Choose),
|
|
137
|
+
'current car': ({ locale }) => h("h1", { class: "section-title" }, locale['Your current car']),
|
|
138
|
+
'contact information': ({ locale }) => h("h1", { class: "section-title" }, locale['Contact Information']),
|
|
139
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
// import { vehicleQuotationElementNames } from './element-mapper';
|
|
6
|
+
// import { FormElementStructure } from '~features/form-hook';
|
|
7
|
+
// const tiq: FormElementStructure<vehicleQuotationElementNames> = {
|
|
8
|
+
// data: {
|
|
9
|
+
// theme: 'tiq',
|
|
10
|
+
// brandId: 'kWrKw',
|
|
11
|
+
// vehicleIdQueryParam: 'cId',
|
|
12
|
+
// nameContactedVehicles: true,
|
|
13
|
+
// quotationType: 'NewVehiclePurchase',
|
|
14
|
+
// recaptchaKey: '6Lehq6IpAAAAAETTDS2Zh60nHIT1a8oVkRtJ2WsA',
|
|
15
|
+
// vehicleApi: 'https://tiq-publications-functions.azurewebsites.net/api/models',
|
|
16
|
+
// currentVehiclesApi: 'https://tiq-vehicles-functions-staging.azurewebsites.net/api/BrandAndModels',
|
|
17
|
+
// requestUrl: 'https://tiq-tickets.azurewebsites.net/api/external/website/vehicle-quotation?production=false',
|
|
18
|
+
// dealerApi: 'https://tiq-identity-server.azurewebsites.net/api/public/company-branch?brands=TYT&services=new-vehicle-sale',
|
|
19
|
+
// },
|
|
20
|
+
// tag: 'div',
|
|
21
|
+
// id: 'container',
|
|
22
|
+
// children: [
|
|
23
|
+
// 'choose',
|
|
24
|
+
// { tag: 'div', id: 'vehicle-wrapper', children: ['vehicle', 'vehicleImage'] },
|
|
25
|
+
// { tag: 'hr' },
|
|
26
|
+
// 'contact information',
|
|
27
|
+
// { tag: 'div', id: 'inputs_wrapper', children: ['name', 'phone', 'dealer', 'paymentType'] },
|
|
28
|
+
// { tag: 'hr' },
|
|
29
|
+
// 'current car',
|
|
30
|
+
// { tag: 'div', id: 'inputs_wrapper', children: ['ownVehicle', 'currentVehicleBrand', 'currentVehicleModel'] },
|
|
31
|
+
// { name: 'submit', id: 'Submit' },
|
|
32
|
+
// ],
|
|
33
|
+
// };
|
|
34
|
+
// export const VehicleQuotationStructures = { tiq };
|