adp-web-components 0.1.78 → 0.1.80
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 +11 -11
- package/dist/cjs/decode-time-offset-CY6JVxX3.js +37 -0
- package/dist/cjs/flexible-container.cjs.entry.js +1 -1
- package/dist/cjs/form-checkbox.cjs.entry.js +5 -5
- package/dist/cjs/form-date-picker.cjs.entry.js +5 -5
- package/dist/cjs/form-dialog_13.cjs.entry.js +1354 -0
- package/dist/cjs/{form-input-C3gQ_Noj.js → form-input-DH-U4kEM.js} +8 -6
- package/dist/cjs/form-input_4.cjs.entry.js +15 -18
- package/dist/cjs/form-switch.cjs.entry.js +5 -5
- package/dist/cjs/form-time-picker.cjs.entry.js +6 -6
- package/dist/cjs/general-form.cjs.entry.js +83 -0
- package/dist/cjs/general-inquiry-form.cjs.entry.js +19 -19
- package/dist/cjs/{get-language-from-url-Bqqqxz28.js → get-language-from-url-D5rCyA1u.js} +18 -4
- package/dist/cjs/{get-local-language-PewhmlEg.js → get-local-language-D02WksZl.js} +2 -2
- package/dist/cjs/information-table.cjs.entry.js +1 -1
- package/dist/{esm/index-BILW0yP6.js → cjs/loader-icon-j5dMQ4bN.js} +16 -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 +6 -6
- package/dist/cjs/part-lookup.cjs.entry.js +5 -5
- package/dist/cjs/{loader-icon-ToaEwO9B.js → phone-validator-D6nzYTs8.js} +14 -18
- package/dist/cjs/service-booking-form.cjs.entry.js +19 -19
- package/dist/cjs/shift-components.cjs.js +1 -1
- package/dist/cjs/shift-tab-content.cjs.entry.js +1 -1
- package/dist/cjs/shift-tabs_2.cjs.entry.js +10 -10
- package/dist/cjs/ssc-lookup-form.cjs.entry.js +19 -19
- package/dist/cjs/{state-object-C1tgQfnz.js → state-object-B2D8PkT8.js} +21 -9
- package/dist/cjs/test-drive-form.cjs.entry.js +19 -19
- package/dist/cjs/{type-BSH0OxyO.js → type-BkehR16K.js} +1 -1
- package/dist/cjs/{type-BvWomz0N.js → type-CjTn3Uuy.js} +1 -1
- package/dist/cjs/{type-CFTS0FUJ.js → type-DhEJjKzj.js} +1 -1
- package/dist/cjs/{types-B3WMBBhs.js → types-DV_cOCRi.js} +18 -0
- package/dist/cjs/{validation-DEdJb-KL.js → validation-N-XMdEIM.js} +15 -2
- package/dist/cjs/vehicle-accessories_7.cjs.entry.js +24 -24
- package/dist/cjs/vehicle-lookup.cjs.entry.js +4 -4
- package/dist/cjs/vehicle-quotation-form.cjs.entry.js +17 -17
- package/dist/cjs/{white-loader-55klC_ZH.js → white-loader-kSznMo_u.js} +4 -0
- package/dist/collection/collection-manifest.json +2 -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-tab-content.css +1 -1
- package/dist/collection/components/components/shift-tabs.css +1 -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 +608 -0
- 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 +2 -2
- package/dist/collection/components/form-elements/form-picker-input.js +2 -2
- package/dist/collection/components/form-elements/form-select.js +1 -1
- package/dist/collection/components/form-elements/form-shadow-input.js +1 -1
- package/dist/collection/components/form-elements/form-stepper-control.js +2 -2
- package/dist/collection/components/form-elements/form-stepper-submit.js +2 -2
- 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-submit.js +2 -2
- 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 +13 -1
- package/dist/collection/components/forms/defaults/validation.js +9 -1
- package/dist/collection/components/forms/general-form.js +490 -0
- package/dist/collection/components/forms/general-inquiry.js +2 -2
- package/dist/collection/components/forms/service-booking.js +2 -2
- package/dist/collection/components/forms/ssc-lookup.js +2 -2
- package/dist/collection/components/forms/test-drive.js +2 -2
- package/dist/collection/components/forms/vehicle-quotation.js +2 -2
- 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/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.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 -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-paint-thickness.css +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 +4 -4
- package/dist/collection/components/vin-extractor/vin-extractor.js +1 -1
- package/dist/collection/features/form-hook/form-hook.js +18 -4
- package/dist/collection/features/form-hook/functions.js +8 -0
- package/dist/collection/features/form-hook/inputs/form-input.js +7 -5
- 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.d.ts +11 -0
- package/dist/components/form-file.js +5 -0
- 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.d.ts +11 -0
- package/dist/components/general-form.js +5 -0
- 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-DLsR20_B.js → p-8IdtkeX1.js} +1 -1
- package/dist/components/p-B14TvlWp.js +5 -0
- package/dist/components/{p-B4IN85i9.js → p-B68P3DtP.js} +1 -1
- package/dist/components/p-B807sG0U.js +5 -0
- package/dist/components/p-B882WrlQ.js +5 -0
- package/dist/components/p-B9Kquvk4.js +5 -0
- package/dist/components/p-BFaCcwNv.js +5 -0
- package/dist/components/p-BN3IFAWI.js +5 -0
- package/dist/components/p-BeL46S5b.js +5 -0
- package/dist/components/p-BiRjebkj.js +5 -0
- package/dist/components/p-Bsnu7u9K.js +5 -0
- package/dist/components/{p-CKmHT-QE.js → p-BxeKiQ5h.js} +1 -1
- package/dist/components/p-CPGswmtd.js +5 -0
- package/dist/components/p-CXoG03EM.js +5 -0
- package/dist/components/{p-R7ARfZoC.js → p-CXzb5oyt.js} +1 -1
- package/dist/components/{p-CRsaHzS7.js → p-CZ_bF39p.js} +1 -1
- package/dist/components/p-CeUdMJED.js +5 -0
- package/dist/components/{p-ChRCBwh-.js → p-CjZxWPIE.js} +1 -1
- package/dist/components/{p-FGM9oY6C.js → p-CqTxdwgo.js} +1 -1
- package/dist/components/{p-C_89017x.js → p-CvoSPdhp.js} +1 -1
- package/dist/components/p-D0oHH_yi.js +5 -0
- package/dist/components/p-D7ZYsC-o.js +5 -0
- package/dist/components/p-DKzEP2g4.js +5 -0
- package/dist/components/p-DN4c_zdE.js +5 -0
- package/dist/components/{p-BzUPQ6H3.js → p-DOS_lP0E.js} +1 -1
- package/dist/components/p-DSTKQdoW.js +5 -0
- package/dist/components/p-DT2OVZtH.js +5 -0
- package/dist/components/p-DY9gBU2J.js +5 -0
- package/dist/components/p-D_bnut2e.js +5 -0
- package/dist/components/p-DhQjm81u.js +5 -0
- package/dist/components/p-Dj3_tuTX.js +5 -0
- package/dist/components/p-DtCTkfsR.js +5 -0
- package/dist/components/p-DwyZCgYl.js +5 -0
- package/dist/components/p-JSG4fAIl.js +5 -0
- package/dist/components/p-MdiEjk1X.js +5 -0
- package/dist/components/p-QsYqPaPW.js +5 -0
- package/dist/components/p-VufjPJkT.js +5 -0
- package/dist/{shift-components/p-CWP4hZcw.js → components/p-YQJevg3-.js} +1 -1
- package/dist/components/p-aHqL2KKd.js +5 -0
- package/dist/components/p-dM4PJkDk.js +5 -0
- package/dist/components/{p-BD-FgNDo.js → p-gEeo-RSf.js} +1 -1
- package/dist/components/p-rvbbkr0i.js +5 -0
- package/dist/components/{p-TSe2YuoV.js → p-zyFVlTck.js} +1 -1
- 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-slider.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 +11 -11
- package/dist/esm/{decode-time-offset-Cfi43WoV.js → decode-time-offset-DFZOybyr.js} +1 -1
- package/dist/esm/flexible-container.entry.js +1 -1
- package/dist/esm/form-checkbox.entry.js +5 -5
- package/dist/esm/form-date-picker.entry.js +5 -5
- package/dist/esm/form-dialog_13.entry.js +1340 -0
- package/dist/esm/{form-input-C5O2h7ti.js → form-input-DKjuSVBS.js} +8 -6
- package/dist/esm/form-input_4.entry.js +14 -17
- package/dist/esm/form-switch.entry.js +5 -5
- package/dist/esm/form-time-picker.entry.js +6 -6
- package/dist/esm/general-form.entry.js +81 -0
- package/dist/esm/general-inquiry-form.entry.js +11 -11
- package/dist/esm/{get-language-from-url-Ba709Um1.js → get-language-from-url-fGWv4JfI.js} +18 -4
- package/dist/esm/{get-local-language-DFjoRspr.js → get-local-language-DtdpsfQH.js} +2 -2
- package/dist/esm/information-table.entry.js +1 -1
- package/dist/{cjs/index-D5c513Xn.js → esm/loader-icon-DM4Vm5gX.js} +12 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-spinner.entry.js +1 -1
- package/dist/esm/manufacturer-part-lookup.entry.js +6 -6
- package/dist/esm/part-lookup.entry.js +5 -5
- package/dist/esm/{loader-icon-BUXaFxSO.js → phone-validator-CW0vHN1w.js} +13 -16
- package/dist/esm/service-booking-form.entry.js +10 -10
- package/dist/esm/shift-components.js +1 -1
- package/dist/esm/shift-tab-content.entry.js +1 -1
- package/dist/esm/shift-tabs_2.entry.js +10 -10
- package/dist/esm/ssc-lookup-form.entry.js +10 -10
- package/dist/esm/{state-object-BA8Hnuoh.js → state-object-D__N3A52.js} +17 -5
- package/dist/esm/test-drive-form.entry.js +10 -10
- package/dist/esm/{type-DDlXvsYW.js → type-8o_W9bXK.js} +1 -1
- package/dist/esm/{type-Dw5qeiT3.js → type-C2SCytyp.js} +1 -1
- package/dist/esm/{type-DwvmWsdz.js → type-DCLi-Gh3.js} +1 -1
- package/dist/esm/{types-CWP4hZcw.js → types-BDhR4pDq.js} +18 -1
- package/dist/esm/{validation-iKTmTjB0.js → validation-CjIBF497.js} +11 -3
- package/dist/esm/vehicle-accessories_7.entry.js +24 -24
- package/dist/esm/vehicle-lookup.entry.js +4 -4
- package/dist/esm/vehicle-quotation-form.entry.js +7 -7
- package/dist/esm/{white-loader-BpnYQ3A6.js → white-loader-CG4JPVdv.js} +4 -1
- package/dist/shift-components/{p-c6959721.entry.js → p-00514dfd.entry.js} +1 -1
- package/dist/shift-components/{p-0faa9bc7.entry.js → p-136ce48d.entry.js} +1 -1
- package/dist/shift-components/p-16eb4c57.entry.js +5 -0
- package/dist/shift-components/p-2cb2cf2c.entry.js +5 -0
- package/dist/shift-components/{p-027cb758.entry.js → p-31193ab5.entry.js} +1 -1
- package/dist/shift-components/p-37bbc653.entry.js +5 -0
- package/dist/shift-components/p-3c5f015c.entry.js +5 -0
- package/dist/shift-components/p-3eb1890a.entry.js +5 -0
- package/dist/shift-components/{p-70017eaf.entry.js → p-49803ea5.entry.js} +1 -1
- package/dist/shift-components/p-6f563241.entry.js +5 -0
- package/dist/shift-components/p-6fca3b48.entry.js +5 -0
- package/dist/shift-components/p-7PtHUjhE.js +5 -0
- package/dist/shift-components/{p-e0ce0597.entry.js → p-9b910889.entry.js} +1 -1
- package/dist/shift-components/{p-c75631eb.entry.js → p-9d25df8c.entry.js} +1 -1
- package/dist/{components/p-DkIqSrtn.js → shift-components/p-BDhR4pDq.js} +1 -1
- package/dist/shift-components/p-BffuX06w.js +5 -0
- package/dist/shift-components/{p-Birh6Z1w.js → p-BrJd1o0-.js} +1 -1
- package/dist/shift-components/{p-XyQhTm0V.js → p-Cv7m_MLQ.js} +1 -1
- package/dist/shift-components/p-D-IGTVAo.js +5 -0
- package/dist/shift-components/p-DCHyQw_L.js +5 -0
- package/dist/shift-components/{p-ZgT-eNvW.js → p-DFsecEMm.js} +1 -1
- package/dist/shift-components/p-DOaMIJLj.js +5 -0
- package/dist/shift-components/p-D_IVXzoK.js +5 -0
- package/dist/shift-components/{p-DJSST74z.js → p-DyLtxN1c.js} +1 -1
- package/dist/shift-components/p-a6ad0fdf.entry.js +5 -0
- package/dist/shift-components/{p-9b895f00.entry.js → p-b1f9f6e3.entry.js} +1 -1
- package/dist/shift-components/p-baa868f8.entry.js +5 -0
- package/dist/shift-components/p-d26ff83d.entry.js +5 -0
- package/dist/shift-components/p-d915cd1c.entry.js +5 -0
- package/dist/shift-components/{p-074e4e31.entry.js → p-dcde6026.entry.js} +1 -1
- package/dist/shift-components/p-e2d72fb9.entry.js +5 -0
- package/dist/shift-components/{p-074d156e.entry.js → p-fa57b412.entry.js} +1 -1
- package/dist/shift-components/p-fd8ec358.entry.js +5 -0
- package/dist/shift-components/{p-BVrQRz1r.js → p-nGZ6Nphz.js} +1 -1
- package/dist/shift-components/p-zqc-VRCh.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/form-elements/form-file.d.ts +52 -0
- package/dist/types/components/forms/defaults/mappers.d.ts +10 -0
- package/dist/types/components/forms/defaults/validation.d.ts +6 -0
- package/dist/types/components/forms/general-form.d.ts +40 -0
- package/dist/types/components.d.ts +136 -0
- package/dist/types/features/form-hook/form-hook.d.ts +2 -1
- package/package.json +1 -1
- package/dist/cjs/decode-time-offset-DqzP0mck.js +0 -37
- package/dist/cjs/form-dialog_12.cjs.entry.js +0 -1092
- package/dist/components/p-1rMNgTmN.js +0 -5
- package/dist/components/p-5y4OeEh5.js +0 -5
- package/dist/components/p-B7jki48I.js +0 -5
- package/dist/components/p-BDorSYsl.js +0 -5
- package/dist/components/p-BI-RaMUW.js +0 -5
- package/dist/components/p-BdHM2JNo.js +0 -5
- package/dist/components/p-BfYWRQqS.js +0 -5
- package/dist/components/p-Bx3oB_px.js +0 -5
- package/dist/components/p-BzD7w6vv.js +0 -5
- package/dist/components/p-CA80NnNb.js +0 -5
- package/dist/components/p-CW9-cijc.js +0 -5
- package/dist/components/p-CulaExZZ.js +0 -5
- package/dist/components/p-CvR5UOI8.js +0 -5
- package/dist/components/p-D5oaVEZk.js +0 -5
- package/dist/components/p-DArD2CFn.js +0 -5
- package/dist/components/p-DETXwIlB.js +0 -5
- package/dist/components/p-DGirJnhP.js +0 -5
- package/dist/components/p-DHSj0x8N.js +0 -5
- package/dist/components/p-DfcSO_Lp.js +0 -5
- package/dist/components/p-Dxb6_It9.js +0 -5
- package/dist/components/p-OzpzJAse.js +0 -5
- package/dist/components/p-SffSBcMo.js +0 -5
- package/dist/components/p-fNVz39Xz.js +0 -5
- package/dist/components/p-h4hnAK_n.js +0 -5
- package/dist/components/p-kcv3fNWl.js +0 -5
- package/dist/components/p-mpwCz5yf.js +0 -5
- package/dist/components/p-rb0wr9GD.js +0 -5
- package/dist/components/p-tFW3Rzil.js +0 -5
- package/dist/esm/form-dialog_12.entry.js +0 -1079
- package/dist/shift-components/p-472951d3.entry.js +0 -5
- package/dist/shift-components/p-7987323f.entry.js +0 -5
- package/dist/shift-components/p-89f00e9b.entry.js +0 -5
- package/dist/shift-components/p-916ece0b.entry.js +0 -5
- package/dist/shift-components/p-9ec92261.entry.js +0 -5
- package/dist/shift-components/p-BAltXAam.js +0 -5
- package/dist/shift-components/p-BILW0yP6.js +0 -5
- package/dist/shift-components/p-Bp-HDfJB.js +0 -5
- package/dist/shift-components/p-CK-8T86o.js +0 -5
- package/dist/shift-components/p-CjY50XS3.js +0 -5
- package/dist/shift-components/p-CyHfimfF.js +0 -5
- package/dist/shift-components/p-DqkWfr2C.js +0 -5
- package/dist/shift-components/p-b1bace88.entry.js +0 -5
- package/dist/shift-components/p-b3d50c22.entry.js +0 -5
- package/dist/shift-components/p-b6d44745.entry.js +0 -5
- package/dist/shift-components/p-c19b26bb.entry.js +0 -5
- package/dist/shift-components/p-d36de486.entry.js +0 -5
- package/dist/shift-components/p-e665d41c.entry.js +0 -5
- package/dist/shift-components/p-fd8a5f5d.entry.js +0 -5
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
import { Host, h } from "@stencil/core";
|
|
6
|
+
import cn from "../../global/lib/cn";
|
|
7
|
+
import { getInputLocalization } from "../../features/form-hook/index";
|
|
8
|
+
import { FormInputLabel } from "./components/form-input-label";
|
|
9
|
+
import { FormErrorMessage } from "./components/form-error-message";
|
|
10
|
+
import { LoaderIcon } from "../../global/assets/loader-icon";
|
|
11
|
+
import { TickIcon } from "../../global/assets/tick-icon";
|
|
12
|
+
import { mixed } from "yup";
|
|
13
|
+
import { meta, format, size, require, max } from "../forms/defaults/validation";
|
|
14
|
+
const partKeyPrefix = 'form-file-';
|
|
15
|
+
export class FormFile {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.maxUpload = 1;
|
|
18
|
+
this.signMethod = 'POST';
|
|
19
|
+
this.localization = {};
|
|
20
|
+
this.fileName = '';
|
|
21
|
+
this.uploadState = 'idle';
|
|
22
|
+
this.failedText = '';
|
|
23
|
+
this.sasFiles = [];
|
|
24
|
+
this.controlsFormLoading = false;
|
|
25
|
+
this.wasFormLoading = false;
|
|
26
|
+
this.openFilePicker = () => {
|
|
27
|
+
if (!this.fileInput)
|
|
28
|
+
return;
|
|
29
|
+
this.reset(); // clears old file + state
|
|
30
|
+
this.fileInput.click();
|
|
31
|
+
};
|
|
32
|
+
this.handleFileChange = async (event) => {
|
|
33
|
+
const target = event.target;
|
|
34
|
+
const fileList = Array.from((target === null || target === void 0 ? void 0 : target.files) || []);
|
|
35
|
+
if (!fileList.length)
|
|
36
|
+
return;
|
|
37
|
+
const limited = typeof this.maxUpload === 'number' && this.maxUpload > 0 ? fileList.slice(0, this.maxUpload) : fileList;
|
|
38
|
+
this.fileName = limited.map(f => f.name).join(', ');
|
|
39
|
+
this.failedText = '';
|
|
40
|
+
this.uploadState = 'uploading';
|
|
41
|
+
this.startGlobalLoading();
|
|
42
|
+
const dataTransfer = new DataTransfer();
|
|
43
|
+
try {
|
|
44
|
+
if (this.signUrl) {
|
|
45
|
+
const signedFiles = await this.requestSignedUpload(limited);
|
|
46
|
+
this.form.pendingRequests[this.name] = async () => await this.uploadToSignedUrl(limited, signedFiles);
|
|
47
|
+
}
|
|
48
|
+
this.uploadState = 'success';
|
|
49
|
+
this.syncValue([...limited]);
|
|
50
|
+
limited.forEach(file => dataTransfer.items.add(file));
|
|
51
|
+
target.files = dataTransfer.files;
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
this.sasFiles = [];
|
|
55
|
+
console.error(error);
|
|
56
|
+
target.files = dataTransfer.files;
|
|
57
|
+
const [locale, language] = this.form.getFormLocale();
|
|
58
|
+
this.uploadState = 'error';
|
|
59
|
+
this.failedText = this.getFailureText(locale, language);
|
|
60
|
+
this.syncValue();
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
if (this.fileInput)
|
|
63
|
+
this.fileInput.value = [];
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
this.stopGlobalLoading();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
this.validate = () => {
|
|
70
|
+
let validation = mixed().meta(meta(this.name));
|
|
71
|
+
if (this.required) {
|
|
72
|
+
validation = validation.test(require(this.name), require(this.name), (value) => {
|
|
73
|
+
if (!Array.isArray(value))
|
|
74
|
+
return false;
|
|
75
|
+
const count = value.length;
|
|
76
|
+
return count > 0;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
validation = validation.optional();
|
|
81
|
+
}
|
|
82
|
+
if (this.maxUpload && this.maxUpload > 0) {
|
|
83
|
+
validation = validation.test(max(this.name), max(this.name), (value) => {
|
|
84
|
+
if (!Array.isArray(value))
|
|
85
|
+
return true;
|
|
86
|
+
const count = value.length;
|
|
87
|
+
return count <= this.maxUpload;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (this.maxSize) {
|
|
91
|
+
validation = validation.test(size(this.name), size(this.name), (value) => {
|
|
92
|
+
if (!Array.isArray(value))
|
|
93
|
+
return true;
|
|
94
|
+
if (!value.length)
|
|
95
|
+
return true;
|
|
96
|
+
const maxSizeInBytes = this.maxSize * 1024 * 1024;
|
|
97
|
+
return value.every(f => f.size <= maxSizeInBytes);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (this.accept) {
|
|
101
|
+
validation = validation.test(format(this.name), format(this.name), (value) => {
|
|
102
|
+
if (!Array.isArray(value))
|
|
103
|
+
return true;
|
|
104
|
+
if (!value.length)
|
|
105
|
+
return true;
|
|
106
|
+
return value.every(f => this.matchesAccept(f));
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return validation;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
async componentWillLoad() {
|
|
113
|
+
this.form.subscribe(this.name, this);
|
|
114
|
+
}
|
|
115
|
+
componentDidLoad() {
|
|
116
|
+
this.fileInput = this.el.querySelector(`.${partKeyPrefix}${this.name}-input`);
|
|
117
|
+
}
|
|
118
|
+
async disconnectedCallback() {
|
|
119
|
+
this.stopGlobalLoading();
|
|
120
|
+
this.form.unsubscribe(this.name);
|
|
121
|
+
}
|
|
122
|
+
reset() {
|
|
123
|
+
this.stopGlobalLoading();
|
|
124
|
+
if (this.fileInput)
|
|
125
|
+
this.fileInput.value = '';
|
|
126
|
+
this.fileName = '';
|
|
127
|
+
this.uploadState = 'idle';
|
|
128
|
+
}
|
|
129
|
+
startGlobalLoading() {
|
|
130
|
+
var _a, _b, _c, _d;
|
|
131
|
+
if (!((_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.setIsLoading) || this.controlsFormLoading)
|
|
132
|
+
return;
|
|
133
|
+
this.wasFormLoading = !!((_d = (_c = this.form) === null || _c === void 0 ? void 0 : _c.context) === null || _d === void 0 ? void 0 : _d.isLoading);
|
|
134
|
+
this.controlsFormLoading = true;
|
|
135
|
+
this.form.context.setIsLoading(true);
|
|
136
|
+
}
|
|
137
|
+
stopGlobalLoading() {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
if (!this.controlsFormLoading || !((_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.setIsLoading))
|
|
140
|
+
return;
|
|
141
|
+
this.form.context.setIsLoading(this.wasFormLoading);
|
|
142
|
+
this.controlsFormLoading = false;
|
|
143
|
+
}
|
|
144
|
+
getLoadingText(locale, language) {
|
|
145
|
+
var _a, _b, _c;
|
|
146
|
+
return ((_b = (_a = this.localization) === null || _a === void 0 ? void 0 : _a[language]) === null || _b === void 0 ? void 0 : _b.uploading) || ((_c = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _c === void 0 ? void 0 : _c.loading) || 'Uploading...';
|
|
147
|
+
}
|
|
148
|
+
getUploadText(locale, language, placeholder) {
|
|
149
|
+
var _a, _b, _c;
|
|
150
|
+
return ((_b = (_a = this.localization) === null || _a === void 0 ? void 0 : _a[language]) === null || _b === void 0 ? void 0 : _b.upload) || placeholder || ((_c = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _c === void 0 ? void 0 : _c.uploadLabel) || 'Upload file';
|
|
151
|
+
}
|
|
152
|
+
getFailureText(locale, language) {
|
|
153
|
+
var _a, _b, _c, _d;
|
|
154
|
+
return ((_b = (_a = this.localization) === null || _a === void 0 ? void 0 : _a[language]) === null || _b === void 0 ? void 0 : _b.failure) || ((_d = (_c = locale === null || locale === void 0 ? void 0 : locale.sharedFormLocales) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d.wildCard) || 'Upload failed. Please try again.';
|
|
155
|
+
}
|
|
156
|
+
matchesAccept(value) {
|
|
157
|
+
var _a;
|
|
158
|
+
if (!this.accept)
|
|
159
|
+
return true;
|
|
160
|
+
const rules = this.accept
|
|
161
|
+
.split(',')
|
|
162
|
+
.map(rule => rule.trim())
|
|
163
|
+
.filter(Boolean)
|
|
164
|
+
.map(rule => rule.toLowerCase());
|
|
165
|
+
if (!rules.length)
|
|
166
|
+
return true;
|
|
167
|
+
const fileName = typeof value === 'string' ? value : (value === null || value === void 0 ? void 0 : value.name) || '';
|
|
168
|
+
const mime = typeof value === 'string' ? '' : ((_a = value === null || value === void 0 ? void 0 : value.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '';
|
|
169
|
+
const ext = fileName.includes('.') ? fileName.slice(fileName.lastIndexOf('.')).toLowerCase() : '';
|
|
170
|
+
return rules.some(rule => {
|
|
171
|
+
if (rule === '*/*')
|
|
172
|
+
return true;
|
|
173
|
+
if (rule.endsWith('/*'))
|
|
174
|
+
return mime ? mime.startsWith(rule.replace('/*', '/')) : false;
|
|
175
|
+
if (rule.startsWith('.'))
|
|
176
|
+
return ext === rule;
|
|
177
|
+
if (rule.includes('/'))
|
|
178
|
+
return mime ? mime === rule : false;
|
|
179
|
+
return true;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
syncValue(value) {
|
|
183
|
+
var _a, _b;
|
|
184
|
+
const resolved = (value === null || value === void 0 ? void 0 : value[0]) || '';
|
|
185
|
+
this.fileName = typeof resolved === 'string' ? resolved : resolved === null || resolved === void 0 ? void 0 : resolved.name;
|
|
186
|
+
// @ts-ignore
|
|
187
|
+
(_a = this.form) === null || _a === void 0 ? void 0 : _a.validateForm(this.name, !!value ? value : [], false);
|
|
188
|
+
(_b = this.form) === null || _b === void 0 ? void 0 : _b.rerender({ inputName: this.name, rerenderForm: true });
|
|
189
|
+
}
|
|
190
|
+
async requestSignedUpload(files) {
|
|
191
|
+
var _a, _b, _c;
|
|
192
|
+
const formHeaders = { 'Content-Type': 'application/json' };
|
|
193
|
+
const recaptchaKey = (_c = (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.context.structure) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.recaptchaKey;
|
|
194
|
+
if (grecaptcha && recaptchaKey) {
|
|
195
|
+
const token = await grecaptcha.execute(recaptchaKey, { action: 'submit' });
|
|
196
|
+
formHeaders['Recaptcha-Token'] = token;
|
|
197
|
+
}
|
|
198
|
+
const payload = files === null || files === void 0 ? void 0 : files.map(file => ({
|
|
199
|
+
name: file.name,
|
|
200
|
+
blob: this.signPrefix ? `${this.signPrefix}${file.name}` : file.name,
|
|
201
|
+
accountName: this.accountName,
|
|
202
|
+
containerName: this.containerName,
|
|
203
|
+
contentType: null,
|
|
204
|
+
size: file === null || file === void 0 ? void 0 : file.size,
|
|
205
|
+
width: null,
|
|
206
|
+
height: null,
|
|
207
|
+
}));
|
|
208
|
+
const response = await fetch(this.signUrl, {
|
|
209
|
+
headers: formHeaders,
|
|
210
|
+
body: JSON.stringify(payload),
|
|
211
|
+
method: this.signMethod || 'POST',
|
|
212
|
+
});
|
|
213
|
+
if (!response.ok)
|
|
214
|
+
throw new Error('Failed to get signed upload URL');
|
|
215
|
+
const json = await response.json();
|
|
216
|
+
const list = (json === null || json === void 0 ? void 0 : json.entity) || (json === null || json === void 0 ? void 0 : json.Entity) || json;
|
|
217
|
+
const arr = Array.isArray(list) ? list : Array.isArray(json) ? json : [];
|
|
218
|
+
const signedFiles = arr.map((file, idx) => {
|
|
219
|
+
var _a;
|
|
220
|
+
// @ts-ignore
|
|
221
|
+
files[idx].blob = (file === null || file === void 0 ? void 0 : file.Blob) || (file === null || file === void 0 ? void 0 : file.blob);
|
|
222
|
+
// @ts-ignore
|
|
223
|
+
files[idx].contentType = (_a = files[idx]) === null || _a === void 0 ? void 0 : _a.type;
|
|
224
|
+
// @ts-ignore
|
|
225
|
+
files[idx].url = file.Url || file.url;
|
|
226
|
+
return {
|
|
227
|
+
uploadUrl: file.url || file.Url || file.uploadUrl || file.UploadUrl,
|
|
228
|
+
headers: file.headers || file.Headers || {},
|
|
229
|
+
key: file.blob || file.Blob || file.path || file.Path || file.key || file.Key || (file === null || file === void 0 ? void 0 : file.name),
|
|
230
|
+
};
|
|
231
|
+
});
|
|
232
|
+
this.sasFiles = arr;
|
|
233
|
+
return signedFiles;
|
|
234
|
+
}
|
|
235
|
+
async uploadToSignedUrl(files, signedFiles) {
|
|
236
|
+
files === null || files === void 0 ? void 0 : files.forEach(async (file, idx) => {
|
|
237
|
+
var _a, _b;
|
|
238
|
+
try {
|
|
239
|
+
const response = await fetch((_a = signedFiles === null || signedFiles === void 0 ? void 0 : signedFiles[idx]) === null || _a === void 0 ? void 0 : _a.uploadUrl, {
|
|
240
|
+
method: 'PUT',
|
|
241
|
+
headers: Object.assign({ 'Content-Type': file.type || 'application/octet-stream', 'x-ms-blob-type': 'BlockBlob' }, (_b = signedFiles === null || signedFiles === void 0 ? void 0 : signedFiles[idx]) === null || _b === void 0 ? void 0 : _b.headers),
|
|
242
|
+
body: file,
|
|
243
|
+
});
|
|
244
|
+
if (!response.ok)
|
|
245
|
+
console.error(response);
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
console.error(error);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
render() {
|
|
253
|
+
const { disabled, isRequired, meta, isError, errorMessage } = this.form.getInputState(this.name);
|
|
254
|
+
const [locale, language] = this.form.getFormLocale();
|
|
255
|
+
const { label, placeholder, errorTextMessage } = getInputLocalization(this, meta, errorMessage);
|
|
256
|
+
const disableInput = disabled || this.isLoading || this.uploadState === 'uploading' || this.isDisabled;
|
|
257
|
+
const showSpinner = this.uploadState === 'uploading';
|
|
258
|
+
const displayText = this.uploadState === 'success' && this.fileName ? this.fileName : this.getUploadText(locale, language, placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder));
|
|
259
|
+
const isErrorState = this.uploadState !== 'uploading' && (!!this.failedText || isError);
|
|
260
|
+
// @ts-ignore
|
|
261
|
+
window === null || window === void 0 ? void 0 : window.s = this.form;
|
|
262
|
+
return (h(Host, { key: '1ac018408496850180cff70c25d07874519b5347' }, h("label", { key: '7c0c6c6ec4bb61842a821c0f1488077319585525', part: `form-file ${this.name}`, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: disableInput }) }, h(FormInputLabel, { key: '96a77917e918acec9a300cebd037992d7db46ae5', name: this.name, isRequired: isRequired, label: label }), h("div", { key: 'ea1c84d37ba1443f3ab79abf1f67d1be62997238', part: `${this.name}-container form-input-container`, class: cn('form-input-container') }, h("input", { key: '1d7978c8001a3e4c4de6329de318fc9760a77288', type: "file", name: this.name, accept: this.accept, disabled: disableInput, multiple: this.maxUpload > 1, onChange: this.handleFileChange, part: `${this.name}-file-input form-file-input`, class: cn('form-file-input', `${partKeyPrefix}${this.name}-input`) }), h("button", { key: '4c6eae45ee23b104c67c3de178ee668e5d30547d', type: "button", disabled: disableInput, onClick: this.openFilePicker, part: `${this.name}-file-trigger form-file-trigger form-input`, title: showSpinner ? this.getLoadingText(locale, language) : displayText, class: cn('form-file-trigger form-input-style', {
|
|
263
|
+
'form-input-error-style': isErrorState,
|
|
264
|
+
'form-file-trigger-loading': showSpinner,
|
|
265
|
+
'form-file-trigger-success': this.uploadState === 'success',
|
|
266
|
+
}) }, h("span", { key: '382b6596dd75f5e6671e94567ebf62f4cd38cecc', part: `${this.name}-file-text form-file-text`, class: "form-file-text" }, showSpinner ? this.getLoadingText(locale, language) : displayText), h("span", { key: 'aedc912707556399969dc5009a1d82664db9a9a9', part: `${this.name}-file-icon form-file-icon`, class: "form-file-icon" }, showSpinner && h(LoaderIcon, { key: 'e1b05e66c53223983ab56271903c265c8f54bd68', class: "form-file-spinner" }), !showSpinner && this.uploadState === 'success' && h(TickIcon, { key: '7ea689db8e63a34dd69308165b4054474975f080', class: "form-file-success-icon" })))), h(FormErrorMessage, { key: '455434e25f6f422dbf805af2d05dd3757d8eace8', name: this.name, isError: isErrorState, errorMessage: this.failedText || errorTextMessage }))));
|
|
267
|
+
}
|
|
268
|
+
static get is() { return "form-file"; }
|
|
269
|
+
static get originalStyleUrls() {
|
|
270
|
+
return {
|
|
271
|
+
"$": ["form-inputs.css"]
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
static get styleUrls() {
|
|
275
|
+
return {
|
|
276
|
+
"$": ["form-inputs.css"]
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
static get properties() {
|
|
280
|
+
return {
|
|
281
|
+
"name": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"attribute": "name",
|
|
284
|
+
"mutable": false,
|
|
285
|
+
"complexType": {
|
|
286
|
+
"original": "string",
|
|
287
|
+
"resolved": "string",
|
|
288
|
+
"references": {}
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"optional": false,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": ""
|
|
295
|
+
},
|
|
296
|
+
"getter": false,
|
|
297
|
+
"setter": false,
|
|
298
|
+
"reflect": false
|
|
299
|
+
},
|
|
300
|
+
"wrapperId": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"attribute": "wrapper-id",
|
|
303
|
+
"mutable": false,
|
|
304
|
+
"complexType": {
|
|
305
|
+
"original": "string",
|
|
306
|
+
"resolved": "string",
|
|
307
|
+
"references": {}
|
|
308
|
+
},
|
|
309
|
+
"required": false,
|
|
310
|
+
"optional": false,
|
|
311
|
+
"docs": {
|
|
312
|
+
"tags": [],
|
|
313
|
+
"text": ""
|
|
314
|
+
},
|
|
315
|
+
"getter": false,
|
|
316
|
+
"setter": false,
|
|
317
|
+
"reflect": false
|
|
318
|
+
},
|
|
319
|
+
"form": {
|
|
320
|
+
"type": "unknown",
|
|
321
|
+
"attribute": "form",
|
|
322
|
+
"mutable": false,
|
|
323
|
+
"complexType": {
|
|
324
|
+
"original": "FormHook<any>",
|
|
325
|
+
"resolved": "FormHook<any>",
|
|
326
|
+
"references": {
|
|
327
|
+
"FormHook": {
|
|
328
|
+
"location": "import",
|
|
329
|
+
"path": "~features/form-hook",
|
|
330
|
+
"id": "src/features/form-hook/index.ts::FormHook"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
"required": false,
|
|
335
|
+
"optional": false,
|
|
336
|
+
"docs": {
|
|
337
|
+
"tags": [],
|
|
338
|
+
"text": ""
|
|
339
|
+
},
|
|
340
|
+
"getter": false,
|
|
341
|
+
"setter": false
|
|
342
|
+
},
|
|
343
|
+
"isLoading": {
|
|
344
|
+
"type": "boolean",
|
|
345
|
+
"attribute": "is-loading",
|
|
346
|
+
"mutable": false,
|
|
347
|
+
"complexType": {
|
|
348
|
+
"original": "boolean",
|
|
349
|
+
"resolved": "boolean",
|
|
350
|
+
"references": {}
|
|
351
|
+
},
|
|
352
|
+
"required": false,
|
|
353
|
+
"optional": true,
|
|
354
|
+
"docs": {
|
|
355
|
+
"tags": [],
|
|
356
|
+
"text": ""
|
|
357
|
+
},
|
|
358
|
+
"getter": false,
|
|
359
|
+
"setter": false,
|
|
360
|
+
"reflect": false
|
|
361
|
+
},
|
|
362
|
+
"wrapperClass": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"attribute": "wrapper-class",
|
|
365
|
+
"mutable": false,
|
|
366
|
+
"complexType": {
|
|
367
|
+
"original": "string",
|
|
368
|
+
"resolved": "string",
|
|
369
|
+
"references": {}
|
|
370
|
+
},
|
|
371
|
+
"required": false,
|
|
372
|
+
"optional": false,
|
|
373
|
+
"docs": {
|
|
374
|
+
"tags": [],
|
|
375
|
+
"text": ""
|
|
376
|
+
},
|
|
377
|
+
"getter": false,
|
|
378
|
+
"setter": false,
|
|
379
|
+
"reflect": false
|
|
380
|
+
},
|
|
381
|
+
"isDisabled": {
|
|
382
|
+
"type": "boolean",
|
|
383
|
+
"attribute": "is-disabled",
|
|
384
|
+
"mutable": false,
|
|
385
|
+
"complexType": {
|
|
386
|
+
"original": "boolean",
|
|
387
|
+
"resolved": "boolean",
|
|
388
|
+
"references": {}
|
|
389
|
+
},
|
|
390
|
+
"required": false,
|
|
391
|
+
"optional": true,
|
|
392
|
+
"docs": {
|
|
393
|
+
"tags": [],
|
|
394
|
+
"text": ""
|
|
395
|
+
},
|
|
396
|
+
"getter": false,
|
|
397
|
+
"setter": false,
|
|
398
|
+
"reflect": false
|
|
399
|
+
},
|
|
400
|
+
"accept": {
|
|
401
|
+
"type": "string",
|
|
402
|
+
"attribute": "accept",
|
|
403
|
+
"mutable": false,
|
|
404
|
+
"complexType": {
|
|
405
|
+
"original": "string",
|
|
406
|
+
"resolved": "string",
|
|
407
|
+
"references": {}
|
|
408
|
+
},
|
|
409
|
+
"required": false,
|
|
410
|
+
"optional": true,
|
|
411
|
+
"docs": {
|
|
412
|
+
"tags": [],
|
|
413
|
+
"text": ""
|
|
414
|
+
},
|
|
415
|
+
"getter": false,
|
|
416
|
+
"setter": false,
|
|
417
|
+
"reflect": false
|
|
418
|
+
},
|
|
419
|
+
"maxSize": {
|
|
420
|
+
"type": "number",
|
|
421
|
+
"attribute": "max-size",
|
|
422
|
+
"mutable": false,
|
|
423
|
+
"complexType": {
|
|
424
|
+
"original": "number",
|
|
425
|
+
"resolved": "number",
|
|
426
|
+
"references": {}
|
|
427
|
+
},
|
|
428
|
+
"required": false,
|
|
429
|
+
"optional": true,
|
|
430
|
+
"docs": {
|
|
431
|
+
"tags": [],
|
|
432
|
+
"text": ""
|
|
433
|
+
},
|
|
434
|
+
"getter": false,
|
|
435
|
+
"setter": false,
|
|
436
|
+
"reflect": false
|
|
437
|
+
},
|
|
438
|
+
"required": {
|
|
439
|
+
"type": "boolean",
|
|
440
|
+
"attribute": "required",
|
|
441
|
+
"mutable": false,
|
|
442
|
+
"complexType": {
|
|
443
|
+
"original": "boolean",
|
|
444
|
+
"resolved": "boolean",
|
|
445
|
+
"references": {}
|
|
446
|
+
},
|
|
447
|
+
"required": false,
|
|
448
|
+
"optional": true,
|
|
449
|
+
"docs": {
|
|
450
|
+
"tags": [],
|
|
451
|
+
"text": ""
|
|
452
|
+
},
|
|
453
|
+
"getter": false,
|
|
454
|
+
"setter": false,
|
|
455
|
+
"reflect": false
|
|
456
|
+
},
|
|
457
|
+
"signUrl": {
|
|
458
|
+
"type": "string",
|
|
459
|
+
"attribute": "sign-url",
|
|
460
|
+
"mutable": false,
|
|
461
|
+
"complexType": {
|
|
462
|
+
"original": "string",
|
|
463
|
+
"resolved": "string",
|
|
464
|
+
"references": {}
|
|
465
|
+
},
|
|
466
|
+
"required": false,
|
|
467
|
+
"optional": true,
|
|
468
|
+
"docs": {
|
|
469
|
+
"tags": [],
|
|
470
|
+
"text": ""
|
|
471
|
+
},
|
|
472
|
+
"getter": false,
|
|
473
|
+
"setter": false,
|
|
474
|
+
"reflect": false
|
|
475
|
+
},
|
|
476
|
+
"maxUpload": {
|
|
477
|
+
"type": "number",
|
|
478
|
+
"attribute": "max-upload",
|
|
479
|
+
"mutable": false,
|
|
480
|
+
"complexType": {
|
|
481
|
+
"original": "number",
|
|
482
|
+
"resolved": "number",
|
|
483
|
+
"references": {}
|
|
484
|
+
},
|
|
485
|
+
"required": false,
|
|
486
|
+
"optional": false,
|
|
487
|
+
"docs": {
|
|
488
|
+
"tags": [],
|
|
489
|
+
"text": ""
|
|
490
|
+
},
|
|
491
|
+
"getter": false,
|
|
492
|
+
"setter": false,
|
|
493
|
+
"reflect": false,
|
|
494
|
+
"defaultValue": "1"
|
|
495
|
+
},
|
|
496
|
+
"signMethod": {
|
|
497
|
+
"type": "string",
|
|
498
|
+
"attribute": "sign-method",
|
|
499
|
+
"mutable": false,
|
|
500
|
+
"complexType": {
|
|
501
|
+
"original": "'POST' | 'PUT'",
|
|
502
|
+
"resolved": "\"POST\" | \"PUT\"",
|
|
503
|
+
"references": {}
|
|
504
|
+
},
|
|
505
|
+
"required": false,
|
|
506
|
+
"optional": false,
|
|
507
|
+
"docs": {
|
|
508
|
+
"tags": [],
|
|
509
|
+
"text": ""
|
|
510
|
+
},
|
|
511
|
+
"getter": false,
|
|
512
|
+
"setter": false,
|
|
513
|
+
"reflect": false,
|
|
514
|
+
"defaultValue": "'POST'"
|
|
515
|
+
},
|
|
516
|
+
"signPrefix": {
|
|
517
|
+
"type": "string",
|
|
518
|
+
"attribute": "sign-prefix",
|
|
519
|
+
"mutable": false,
|
|
520
|
+
"complexType": {
|
|
521
|
+
"original": "string",
|
|
522
|
+
"resolved": "string",
|
|
523
|
+
"references": {}
|
|
524
|
+
},
|
|
525
|
+
"required": false,
|
|
526
|
+
"optional": true,
|
|
527
|
+
"docs": {
|
|
528
|
+
"tags": [],
|
|
529
|
+
"text": ""
|
|
530
|
+
},
|
|
531
|
+
"getter": false,
|
|
532
|
+
"setter": false,
|
|
533
|
+
"reflect": false
|
|
534
|
+
},
|
|
535
|
+
"accountName": {
|
|
536
|
+
"type": "string",
|
|
537
|
+
"attribute": "account-name",
|
|
538
|
+
"mutable": false,
|
|
539
|
+
"complexType": {
|
|
540
|
+
"original": "string",
|
|
541
|
+
"resolved": "string",
|
|
542
|
+
"references": {}
|
|
543
|
+
},
|
|
544
|
+
"required": false,
|
|
545
|
+
"optional": true,
|
|
546
|
+
"docs": {
|
|
547
|
+
"tags": [],
|
|
548
|
+
"text": ""
|
|
549
|
+
},
|
|
550
|
+
"getter": false,
|
|
551
|
+
"setter": false,
|
|
552
|
+
"reflect": false
|
|
553
|
+
},
|
|
554
|
+
"containerName": {
|
|
555
|
+
"type": "string",
|
|
556
|
+
"attribute": "container-name",
|
|
557
|
+
"mutable": false,
|
|
558
|
+
"complexType": {
|
|
559
|
+
"original": "string",
|
|
560
|
+
"resolved": "string",
|
|
561
|
+
"references": {}
|
|
562
|
+
},
|
|
563
|
+
"required": false,
|
|
564
|
+
"optional": true,
|
|
565
|
+
"docs": {
|
|
566
|
+
"tags": [],
|
|
567
|
+
"text": ""
|
|
568
|
+
},
|
|
569
|
+
"getter": false,
|
|
570
|
+
"setter": false,
|
|
571
|
+
"reflect": false
|
|
572
|
+
},
|
|
573
|
+
"localization": {
|
|
574
|
+
"type": "unknown",
|
|
575
|
+
"attribute": "localization",
|
|
576
|
+
"mutable": false,
|
|
577
|
+
"complexType": {
|
|
578
|
+
"original": "FormInputLocalization<{\n uploading?: string;\n upload?: string;\n failure?: string;\n success?: string;\n }>",
|
|
579
|
+
"resolved": "{ [lang: string]: { label?: string; placeholder?: string; require?: string; format?: string; minMessage: string; maxMessage: string; betweenMessage: string; } & { uploading?: string; upload?: string; failure?: string; success?: string; }; }",
|
|
580
|
+
"references": {
|
|
581
|
+
"FormInputLocalization": {
|
|
582
|
+
"location": "import",
|
|
583
|
+
"path": "~features/form-hook",
|
|
584
|
+
"id": "src/features/form-hook/index.ts::FormInputLocalization"
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
"required": false,
|
|
589
|
+
"optional": true,
|
|
590
|
+
"docs": {
|
|
591
|
+
"tags": [],
|
|
592
|
+
"text": ""
|
|
593
|
+
},
|
|
594
|
+
"getter": false,
|
|
595
|
+
"setter": false,
|
|
596
|
+
"defaultValue": "{}"
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
static get states() {
|
|
601
|
+
return {
|
|
602
|
+
"fileName": {},
|
|
603
|
+
"uploadState": {},
|
|
604
|
+
"failedText": {}
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
static get elementRef() { return "el"; }
|
|
608
|
+
}
|
|
@@ -63,9 +63,9 @@ export class FormInput {
|
|
|
63
63
|
});
|
|
64
64
|
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));
|
|
65
65
|
const { label, placeholder, errorTextMessage } = getInputLocalization(this, meta, errorMessage);
|
|
66
|
-
return (h(Host, { key: '
|
|
66
|
+
return (h(Host, { key: 'ed5d2212454eab457f361396290da6e8a143027f' }, h("label", { key: '94c82a2b9b0d4c0d1381206a23bf79106325b13e', part: this.name, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: isDisabled }) }, h(FormInputLabel, { key: 'fcb1f35c27c7a9211192a38941ec9b843f971fdd', isRequired: isRequired, label: label }), h("div", { key: '112ab028d512964ce17c57f7e05859ded81193f1', part: `${this.name}-container form-input-container`, class: "form-input-container" }, h(FormInputPrefix, { key: 'cffe4099ee953c24793d66300fcd0e21a739ddff', 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", Object.assign({ key: '5593ef339d4bf5e8bfa63b2e11edf2f0b5ebf8ab', name: this.name, type: this === null || this === void 0 ? void 0 : this.type, disabled: isDisabled, onInput: this.onInputChange, defaultValue: this.formatter ? this.formatter(this.defaultValue || '') : this.defaultValue, part: `${this.name}-input form-input`, placeholder: placeholder || (meta === null || meta === void 0 ? void 0 : meta.placeholder), style: Object.assign(Object.assign({}, (this.prefixWidth ? { [isRtl ? 'paddingRight' : 'paddingLeft']: `${this.prefixWidth}px` } : {})), (this.icon ? { [iconPaddingSide]: '40px' } : {})), class: cn('form-input-style', part, {
|
|
67
67
|
'form-input-error-style': isError,
|
|
68
|
-
}) }, this.inputProps)), this.icon && renderIcon()), h(FormErrorMessage, { key: '
|
|
68
|
+
}) }, this.inputProps)), this.icon && renderIcon()), h(FormErrorMessage, { key: 'a6d678840a1b9d89a746915e2d025c7d9297a2be', name: this.name, isError: isError, errorMessage: errorTextMessage }))));
|
|
69
69
|
}
|
|
70
70
|
static get is() { return "form-input"; }
|
|
71
71
|
static get originalStyleUrls() {
|