adp-web-components 0.4.0 → 0.4.2
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-BklgM02f.js → add-icon-r-uugVfd.js} +1 -1
- package/dist/cjs/{app-globals-XGpRBTr6.js → app-globals-BoQSQFz7.js} +1 -1
- package/dist/cjs/{arrow-up-icon-BLo1aQC2.js → arrow-up-icon-BfnEuyBs.js} +1 -1
- package/dist/cjs/branch-date-dropdown_17.cjs.entry.js +51 -45
- package/dist/cjs/{calendar-days-icon-Cf14ROXV.js → calendar-days-icon-CDsv0_-r.js} +1 -1
- package/dist/cjs/{check-icon-DaQxP2EY.js → check-icon-BNxUv6rL.js} +1 -1
- package/dist/cjs/clock-DsYk5zt3.js +30 -0
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +10 -9
- package/dist/cjs/{decode-time-offset-DOUImlif.js → decode-time-offset-CcpzHLhD.js} +10 -2
- package/dist/cjs/flexible-container.cjs.entry.js +2 -2
- package/dist/cjs/form-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/form-date-picker.cjs.entry.js +25 -19
- package/dist/cjs/{form-error-message-BtLdHgxO.js → form-error-message-DdEeLvoD.js} +1 -1
- package/dist/cjs/{form-input-label-B4lkF89K.js → form-input-label-U5kCHkJl.js} +1 -1
- package/dist/cjs/form-input_7.cjs.entry.js +13 -13
- package/dist/cjs/form-switch.cjs.entry.js +3 -3
- package/dist/cjs/form-time-picker.cjs.entry.js +4 -4
- package/dist/cjs/{functions-gb1i8Hkl.js → functions-Bz2-CHK9.js} +5 -4
- package/dist/cjs/general-form.cjs.entry.js +11 -10
- package/dist/cjs/general-inquiry-form.cjs.entry.js +11 -10
- package/dist/cjs/{get-language-from-url-DwOt9DVH.js → get-language-from-url-CivsCH6R.js} +1 -1
- package/dist/cjs/{get-local-language-CZeC0BN9.js → get-local-language-BBdU8ppU.js} +2 -2
- package/dist/cjs/get-mock-files-VecUdVE7.js +61 -0
- package/dist/cjs/{index-BdHAYIvO.js → index-BXyIPFx-.js} +3 -0
- package/dist/cjs/information-table.cjs.entry.js +3 -3
- package/dist/cjs/{loader-icon-aY56OHXW.js → loader-icon-BkPuyYFm.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +4 -4
- package/dist/cjs/{mappers-DnWgECCv.js → mappers-D-v6mh0y.js} +10 -8
- package/dist/cjs/{material-card-D1UQcy6U.js → material-card-mXTu16Ev.js} +1 -1
- package/dist/cjs/mock-assets-Dio-Q8Yd.js +13 -0
- package/dist/cjs/part-lookup.cjs.entry.js +4 -4
- package/dist/cjs/{qr-code-scan-CtKK6wLL.js → qr-code-scan-BH1paDvW.js} +1 -1
- package/dist/cjs/{reveal-below-CyYolTYX.js → reveal-below-7_fSN_sU.js} +1 -1
- package/dist/cjs/service-booking-form.cjs.entry.js +11 -10
- package/dist/cjs/shift-accordion.cjs.entry.js +1 -1
- package/dist/cjs/shift-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/shift-components.cjs.js +3 -3
- package/dist/cjs/shift-slider.cjs.entry.js +1 -1
- package/dist/cjs/shift-switch.cjs.entry.js +2 -2
- package/dist/cjs/shift-tab-content.cjs.entry.js +2 -2
- package/dist/cjs/shift-tabs_2.cjs.entry.js +7 -7
- package/dist/cjs/ssc-lookup-form.cjs.entry.js +11 -10
- package/dist/cjs/test-drive-form.cjs.entry.js +11 -10
- package/dist/cjs/{triangle-alert-CTvU1eGY.js → triangle-alert-C_xSEmRy.js} +1 -1
- package/dist/cjs/vehicle-accessories_8.cjs.entry.js +72 -44
- package/dist/cjs/{vehicle-info-layout-CRpL8UMY.js → vehicle-info-layout-CjYyiBEq.js} +1 -1
- package/dist/cjs/vehicle-lookup.cjs.entry.js +21 -17
- package/dist/cjs/vehicle-quotation-form.cjs.entry.js +8 -7
- package/dist/cjs/{white-loader-CveXuRsH.js → white-loader-CH2BrmT6.js} +1 -1
- package/dist/collection/components/components/empty.css +1 -1
- 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/shift-portal.css +1 -1
- package/dist/collection/components/components/shift-select-dropdown.css +1 -1
- package/dist/collection/components/components/shift-select.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/branch-date-picker.js +30 -8
- package/dist/collection/components/form-elements/branch-slot-dropdown.css +1 -1
- package/dist/collection/components/form-elements/branch-slot-picker.js +29 -6
- package/dist/collection/components/form-elements/form-date-picker-legacy.js +40 -15
- package/dist/collection/components/form-elements/form-inputs.css +1 -1
- package/dist/collection/components/form-elements/form-picker-input.js +27 -7
- package/dist/collection/components/form-elements/form-structure.js +20 -1
- package/dist/collection/components/forms/defaults/mappers.js +6 -4
- package/dist/collection/components/forms/general-form.js +21 -2
- package/dist/collection/components/forms/general-inquiry.js +21 -2
- package/dist/collection/components/forms/service-booking.js +21 -2
- package/dist/collection/components/forms/ssc-lookup.js +21 -2
- package/dist/collection/components/forms/test-drive.js +21 -2
- package/dist/collection/components/forms/vehicle-quotation.js +21 -2
- package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
- 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/part-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/components/CoverageTimeline.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +21 -2
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +24 -5
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +61 -12
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.js +19 -0
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.js +21 -2
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.js +20 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +20 -1
- package/dist/collection/components/vehicle-lookup/vehicle-ssc.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-ssc.js +57 -12
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-timeline.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-timeline.js +20 -1
- package/dist/collection/features/form-hook/functions.js +2 -1
- package/dist/collection/features/form-hook/render-structure.js +1 -1
- package/dist/collection/features/mocks/data/assets/accessories/accessory.svg +10 -0
- package/dist/collection/features/mocks/data/assets/accessories/floor-mats.svg +10 -0
- package/dist/collection/features/mocks/data/assets/accessories/mud-guards.svg +11 -0
- package/dist/collection/features/mocks/data/assets/accessories/roof-rack.svg +11 -0
- package/dist/collection/features/mocks/data/assets/accessories/roof-rails.svg +11 -0
- package/dist/collection/features/mocks/data/assets/accessories/side-steps.svg +11 -0
- package/dist/collection/features/mocks/data/assets/accessories/tow-bar.svg +12 -0
- package/dist/collection/features/mocks/data/assets/badges/badge-1.svg +5 -0
- package/dist/collection/features/mocks/data/assets/badges/badge-2.svg +5 -0
- package/dist/collection/features/mocks/data/assets/badges/badge-3.svg +5 -0
- package/dist/collection/features/mocks/data/assets/badges/badge-4.svg +5 -0
- package/dist/collection/features/mocks/data/assets/badges/badge-5.svg +5 -0
- package/dist/collection/features/mocks/data/assets/badges/badge-6.svg +5 -0
- package/dist/collection/features/mocks/data/assets/documents/service-invoice-qr.svg +18 -0
- package/dist/collection/features/mocks/data/assets/documents/signed-claim-document.svg +21 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/door-front-left-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/door-front-left.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/door-front-right-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/door-front-right.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/door-rear-left-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/door-rear-left.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/door-rear-right-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/door-rear-right.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/fender-front-left-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/fender-front-left.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/fender-front-right-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/fender-front-right.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/fender-rear-left-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/fender-rear-left.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/fender-rear-right-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/fender-rear-right.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/hood-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/hood.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/panel.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/roof-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/roof.svg +6 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/tail-gate-detail.svg +7 -0
- package/dist/collection/features/mocks/data/assets/paint-panels/tail-gate.svg +6 -0
- package/dist/collection/features/mocks/get-mock-files.js +19 -14
- package/dist/collection/features/mocks/index.js +1 -0
- package/dist/collection/features/mocks/mock-assets.js +33 -0
- package/dist/collection/features/vehicle-lookup-component/vehicle-lookup-api-integration.js +3 -1
- package/dist/collection/global/lib/clock.js +25 -0
- package/dist/collection/global/lib/decode-time-offset.js +9 -1
- package/dist/collection/templates/forms/docs-content/structure.js +1 -1
- package/dist/collection/templates/harness-connection.js +282 -0
- package/dist/collection/templates/harness-environment.js +31 -0
- package/dist/collection/templates/harness.js +610 -83
- package/dist/collection/templates/site-header.js +2 -2
- package/dist/components/branch-date-picker.js +1 -1
- package/dist/components/branch-slot-dropdown.js +1 -1
- package/dist/components/branch-slot-picker.js +1 -1
- 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-file.js +1 -1
- package/dist/components/form-input-preview.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-phone-number.js +1 -1
- package/dist/components/form-picker-input.js +1 -1
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.js +1 -1
- package/dist/components/form-stepper-control.js +1 -1
- package/dist/components/form-stepper-submit.js +1 -1
- package/dist/components/form-stepper.js +1 -1
- package/dist/components/form-structure-error.js +1 -1
- package/dist/components/form-structure.js +1 -1
- package/dist/components/form-submit.js +1 -1
- package/dist/components/form-switch.js +1 -1
- package/dist/components/form-text-area.js +1 -1
- package/dist/components/form-time-picker.js +1 -1
- package/dist/components/form-vin-input.js +1 -1
- package/dist/components/general-form.js +1 -1
- package/dist/components/general-inquiry-form.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/information-table.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/manufacturer-part-lookup.js +1 -1
- package/dist/components/{p-Ype8FNjy.js → p-3e83-if9.js} +1 -1
- package/dist/components/p-B3ztFt72.js +5 -0
- package/dist/components/p-B4PUnAtc.js +5 -0
- package/dist/components/{p-bVbnoz7C.js → p-B7OLLrcA.js} +1 -1
- package/dist/components/{p-d1WgLP9O.js → p-BEHSLtOA.js} +1 -1
- package/dist/components/{p-UFwS4oV2.js → p-B_EZX2Nj.js} +1 -1
- package/dist/components/{p-BAkLdLKZ.js → p-BcgJGb3U.js} +1 -1
- package/dist/components/p-BdxXAS3w.js +5 -0
- package/dist/components/{p-CebvOd8T.js → p-Bf7SK7BI.js} +1 -1
- package/dist/components/{p-BDOUh9fr.js → p-Bhy0nttE.js} +1 -1
- package/dist/components/p-BjDxP9Ar.js +5 -0
- package/dist/components/{p-DxRQkoRz.js → p-C-R7Zf1I.js} +1 -1
- package/dist/components/{p-CT-MbmyW.js → p-C1-ek7if.js} +1 -1
- package/dist/components/p-C3gFyogx.js +5 -0
- package/dist/components/p-CI0_r45y.js +5 -0
- package/dist/components/p-CJkthPWR.js +5 -0
- package/dist/components/{p-BxGye2qd.js → p-COKUmuuf.js} +1 -1
- package/dist/components/{p-D4aXUm2Y.js → p-CQ0f2MVb.js} +1 -1
- package/dist/components/{p-ByrX91PC.js → p-CYj0zRtR.js} +1 -1
- package/dist/components/{p-DOIpj5PH.js → p-C_91yYxZ.js} +1 -1
- package/dist/components/p-CbIjjt3n.js +5 -0
- package/dist/components/{p-BhekdMkM.js → p-CpX72zLP.js} +1 -1
- package/dist/components/{p-DkCqJ072.js → p-Cuy8EM9Y.js} +1 -1
- package/dist/components/p-CwYr8ZOV.js +5 -0
- package/dist/components/{p-BySGDlQi.js → p-Cy-0pkLa.js} +1 -1
- package/dist/components/p-DDWKS6lH.js +5 -0
- package/dist/components/p-DJr19tRD.js +5 -0
- package/dist/components/p-DNpppK6M.js +5 -0
- package/dist/components/{p-D_uU2Pi-.js → p-DRtn1_4P.js} +1 -1
- package/dist/components/{p-BwoBk7eI.js → p-D_2r73sx.js} +1 -1
- package/dist/components/p-De3WmHLm.js +5 -0
- package/dist/components/{p-BvM3siIc.js → p-DokN3NzH.js} +1 -1
- package/dist/components/{p-D4VK-Fv7.js → p-DqCIuURq.js} +1 -1
- package/dist/components/{p-DConDqrK.js → p-DuaTomIT.js} +1 -1
- package/dist/components/{p-DVkAlTjC.js → p-DzPqV0I6.js} +1 -1
- package/dist/components/p-GgvQ0B7I.js +5 -0
- package/dist/components/p-HVSqY6-d.js +5 -0
- package/dist/components/{p-DCO6piZ9.js → p-RKSY-Miv.js} +1 -1
- package/dist/components/p-Ty1rh9Up.js +5 -0
- package/dist/components/{p-AkWKeTFc.js → p-VTefgaxv.js} +1 -1
- package/dist/components/{p-DDTSLfBG.js → p-_8V0swcd.js} +1 -1
- package/dist/components/{p-B2Rwfoy0.js → p-ge2RA7lk.js} +1 -1
- package/dist/components/p-mZnLUhNr.js +5 -0
- package/dist/components/{p-CbRoCi89.js → p-mzWr8UUl.js} +1 -1
- package/dist/components/{p-D8w2fZLP.js → p-wX0fQQYY.js} +1 -1
- package/dist/components/{p-CETvww16.js → p-x1Tlf19a.js} +1 -1
- package/dist/components/p-z7jdJ402.js +5 -0
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-booking-form.js +1 -1
- package/dist/components/shift-accordion.js +1 -1
- package/dist/components/shift-checkbox.js +1 -1
- package/dist/components/shift-portal.js +1 -1
- package/dist/components/shift-select-dropdown.js +1 -1
- package/dist/components/shift-select.js +1 -1
- package/dist/components/shift-slider.js +1 -1
- package/dist/components/shift-switch.js +1 -1
- package/dist/components/shift-tab-content.js +1 -1
- package/dist/components/shift-tabs.js +1 -1
- package/dist/components/ssc-lookup-form.js +1 -1
- package/dist/components/test-drive-form.js +1 -1
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-claimable-items.js +1 -1
- package/dist/components/vehicle-item-claim-form.js +1 -1
- package/dist/components/vehicle-lookup.js +1 -1
- package/dist/components/vehicle-paint-thickness.js +1 -1
- package/dist/components/vehicle-quotation-form.js +1 -1
- package/dist/components/vehicle-sale-information.js +1 -1
- package/dist/components/vehicle-service-history.js +1 -1
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/vehicle-ssc.js +1 -1
- package/dist/components/vehicle-warranty-timeline.js +1 -1
- package/dist/esm/{add-icon-DHh6DJXR.js → add-icon-D9Jel7-B.js} +1 -1
- package/dist/esm/{app-globals-CusTGK9D.js → app-globals-inc67m-q.js} +1 -1
- package/dist/esm/{arrow-up-icon-Dw_d-rG9.js → arrow-up-icon-Dfl2olS1.js} +1 -1
- package/dist/esm/branch-date-dropdown_17.entry.js +51 -45
- package/dist/esm/{calendar-days-icon-CnASOv7M.js → calendar-days-icon-zUqcb-fP.js} +1 -1
- package/dist/esm/{check-icon-BZQF4tzH.js → check-icon-CcYgNcDZ.js} +1 -1
- package/dist/esm/clock-DDWKS6lH.js +27 -0
- package/dist/esm/dead-stock-lookup_3.entry.js +10 -9
- package/dist/esm/{decode-time-offset-Cib1aJfV.js → decode-time-offset-CDd68_1V.js} +10 -2
- package/dist/esm/flexible-container.entry.js +2 -2
- package/dist/esm/form-checkbox.entry.js +3 -3
- package/dist/esm/form-date-picker.entry.js +25 -19
- package/dist/esm/{form-error-message-DWl6p6Dz.js → form-error-message-DxLEOczK.js} +1 -1
- package/dist/esm/{form-input-label-6blOw1BN.js → form-input-label-DEqq8CcC.js} +1 -1
- package/dist/esm/form-input_7.entry.js +13 -13
- package/dist/esm/form-switch.entry.js +3 -3
- package/dist/esm/form-time-picker.entry.js +4 -4
- package/dist/esm/{functions-SHZO3nZB.js → functions-M6Gsc8Mz.js} +5 -4
- package/dist/esm/general-form.entry.js +11 -10
- package/dist/esm/general-inquiry-form.entry.js +11 -10
- package/dist/esm/{get-language-from-url-fV-K15uy.js → get-language-from-url-Bq07dpsD.js} +1 -1
- package/dist/esm/{get-local-language-BLpgwBTx.js → get-local-language-D9DW53vG.js} +2 -2
- package/dist/esm/get-mock-files-DQV5ioOw.js +59 -0
- package/dist/esm/{index-CteZTPhq.js → index-CsEiWLCt.js} +3 -1
- package/dist/esm/information-table.entry.js +3 -3
- package/dist/esm/{loader-icon-BvAmA41s.js → loader-icon-CbaFiiB_.js} +1 -1
- package/dist/esm/loader.js +4 -4
- package/dist/esm/loading-spinner.entry.js +1 -1
- package/dist/esm/manufacturer-part-lookup.entry.js +4 -4
- package/dist/esm/{mappers-CZs2R7k6.js → mappers-DOWx0ySR.js} +10 -8
- package/dist/esm/{material-card-jbQd-0as.js → material-card-CB2xHWMN.js} +1 -1
- package/dist/esm/mock-assets-Bixlrdd4.js +11 -0
- package/dist/esm/part-lookup.entry.js +4 -4
- package/dist/esm/{qr-code-scan-B1nViqZl.js → qr-code-scan-FY8RR9ow.js} +1 -1
- package/dist/esm/{reveal-below-DWXRi5w3.js → reveal-below-8wAOxdZk.js} +1 -1
- package/dist/esm/service-booking-form.entry.js +11 -10
- package/dist/esm/shift-accordion.entry.js +1 -1
- package/dist/esm/shift-checkbox.entry.js +3 -3
- package/dist/esm/shift-components.js +4 -4
- package/dist/esm/shift-slider.entry.js +1 -1
- package/dist/esm/shift-switch.entry.js +2 -2
- package/dist/esm/shift-tab-content.entry.js +2 -2
- package/dist/esm/shift-tabs_2.entry.js +7 -7
- package/dist/esm/ssc-lookup-form.entry.js +11 -10
- package/dist/esm/test-drive-form.entry.js +11 -10
- package/dist/esm/{triangle-alert-BlnfPzWh.js → triangle-alert-DNqiuE_3.js} +1 -1
- package/dist/esm/vehicle-accessories_8.entry.js +73 -45
- package/dist/esm/{vehicle-info-layout-Dmx94GLp.js → vehicle-info-layout-I6iG9Fcg.js} +1 -1
- package/dist/esm/vehicle-lookup.entry.js +21 -17
- package/dist/esm/vehicle-quotation-form.entry.js +8 -7
- package/dist/esm/{white-loader-B3tJFuNO.js → white-loader-DusGamWD.js} +1 -1
- package/dist/integration-manifest.json +19 -9
- package/dist/mocks/assets/README.md +54 -0
- package/dist/mocks/assets/accessories/accessory.svg +10 -0
- package/dist/mocks/assets/accessories/floor-mats.svg +10 -0
- package/dist/mocks/assets/accessories/mud-guards.svg +11 -0
- package/dist/mocks/assets/accessories/roof-rack.svg +11 -0
- package/dist/mocks/assets/accessories/roof-rails.svg +11 -0
- package/dist/mocks/assets/accessories/side-steps.svg +11 -0
- package/dist/mocks/assets/accessories/tow-bar.svg +12 -0
- package/dist/mocks/assets/badges/badge-1.svg +5 -0
- package/dist/mocks/assets/badges/badge-2.svg +5 -0
- package/dist/mocks/assets/badges/badge-3.svg +5 -0
- package/dist/mocks/assets/badges/badge-4.svg +5 -0
- package/dist/mocks/assets/badges/badge-5.svg +5 -0
- package/dist/mocks/assets/badges/badge-6.svg +5 -0
- package/dist/mocks/assets/documents/service-invoice-qr.svg +18 -0
- package/dist/mocks/assets/documents/signed-claim-document.svg +21 -0
- package/dist/mocks/assets/paint-panels/door-front-left-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/door-front-left.svg +6 -0
- package/dist/mocks/assets/paint-panels/door-front-right-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/door-front-right.svg +6 -0
- package/dist/mocks/assets/paint-panels/door-rear-left-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/door-rear-left.svg +6 -0
- package/dist/mocks/assets/paint-panels/door-rear-right-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/door-rear-right.svg +6 -0
- package/dist/mocks/assets/paint-panels/fender-front-left-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/fender-front-left.svg +6 -0
- package/dist/mocks/assets/paint-panels/fender-front-right-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/fender-front-right.svg +6 -0
- package/dist/mocks/assets/paint-panels/fender-rear-left-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/fender-rear-left.svg +6 -0
- package/dist/mocks/assets/paint-panels/fender-rear-right-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/fender-rear-right.svg +6 -0
- package/dist/mocks/assets/paint-panels/hood-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/hood.svg +6 -0
- package/dist/mocks/assets/paint-panels/panel.svg +6 -0
- package/dist/mocks/assets/paint-panels/roof-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/roof.svg +6 -0
- package/dist/mocks/assets/paint-panels/tail-gate-detail.svg +7 -0
- package/dist/mocks/assets/paint-panels/tail-gate.svg +6 -0
- package/dist/shift-components/{p-c40bda31.entry.js → p-0395b900.entry.js} +1 -1
- package/dist/shift-components/{p-be19d7ff.entry.js → p-041ff6e5.entry.js} +1 -1
- package/dist/shift-components/p-131c79c9.entry.js +5 -0
- package/dist/shift-components/{p-3895d8e5.entry.js → p-287c5e75.entry.js} +1 -1
- package/dist/shift-components/{p-164eeced.entry.js → p-30be4db4.entry.js} +1 -1
- package/dist/shift-components/p-3c735b0a.entry.js +5 -0
- package/dist/shift-components/{p-90034cd8.entry.js → p-4c826390.entry.js} +1 -1
- package/dist/shift-components/p-6833930c.entry.js +5 -0
- package/dist/shift-components/{p-391c55af.entry.js → p-7760cb43.entry.js} +1 -1
- package/dist/shift-components/p-81a7b7dd.entry.js +5 -0
- package/dist/shift-components/p-82adf890.entry.js +5 -0
- package/dist/shift-components/{p-3790e469.entry.js → p-91d15921.entry.js} +1 -1
- package/dist/shift-components/{p-005d0a3a.entry.js → p-9f017e84.entry.js} +1 -1
- package/dist/shift-components/p-B2ivJ0St.js +5 -0
- package/dist/shift-components/{p-Tjvj6pk4.js → p-BHLT4-AT.js} +1 -1
- package/dist/shift-components/p-BKobZCvH.js +5 -0
- package/dist/shift-components/{p-MzYTUgsB.js → p-BTJYrubY.js} +1 -1
- package/dist/shift-components/p-BTfrQeMt.js +5 -0
- package/dist/shift-components/{p-BkVfhjgg.js → p-Bxxrkd94.js} +1 -1
- package/dist/shift-components/{p-C8PvXL-3.js → p-C7KIr58m.js} +1 -1
- package/dist/shift-components/{p-Ccwtsrgg.js → p-CHQ9vjK9.js} +1 -1
- package/dist/shift-components/{p-DzV_ls5o.js → p-CTvdWiVG.js} +1 -1
- package/dist/shift-components/p-CTy3HfBE.js +5 -0
- package/dist/shift-components/{p-oQAUbfw7.js → p-Cet0ur1z.js} +1 -1
- package/dist/shift-components/{p-OlAbjfKx.js → p-Cn5_F5mW.js} +1 -1
- package/dist/shift-components/p-CsEiWLCt.js +6 -0
- package/dist/shift-components/{p-oFzLYYzz.js → p-D5QsRU5_.js} +1 -1
- package/dist/shift-components/p-DBog8aSI.js +5 -0
- package/dist/shift-components/p-DDWKS6lH.js +5 -0
- package/dist/shift-components/{p-DtD7FZCG.js → p-DZGcyLWV.js} +1 -1
- package/dist/shift-components/p-Dh2tKZeJ.js +5 -0
- package/dist/shift-components/{p-BTNA9XsD.js → p-DxRW_Tfa.js} +1 -1
- package/dist/shift-components/{p-D7cqTTll.js → p-M1S8gM54.js} +1 -1
- package/dist/shift-components/p-a863f984.entry.js +5 -0
- package/dist/shift-components/p-a8c58abe.entry.js +5 -0
- package/dist/shift-components/p-b6dfb75b.entry.js +5 -0
- package/dist/shift-components/{p-d47428d1.entry.js → p-bcfc5126.entry.js} +1 -1
- package/dist/shift-components/{p-879faeec.entry.js → p-c20b97c6.entry.js} +1 -1
- package/dist/shift-components/p-c7e694c0.entry.js +5 -0
- package/dist/shift-components/p-ceeebc95.entry.js +5 -0
- package/dist/shift-components/p-d118078b.entry.js +5 -0
- package/dist/shift-components/{p-af71f000.entry.js → p-d89b19fa.entry.js} +1 -1
- package/dist/shift-components/p-dc408027.entry.js +5 -0
- package/dist/shift-components/p-e3c2fb00.entry.js +5 -0
- package/dist/shift-components/{p-f638970e.entry.js → p-e3f9e20f.entry.js} +1 -1
- package/dist/shift-components/p-f6ca88a5.entry.js +5 -0
- package/dist/shift-components/{p-bfwabdVa.js → p-h1L6xTqG.js} +1 -1
- package/dist/shift-components/p-iSEtUbmS.js +5 -0
- package/dist/shift-components/p-xtI4pqVk.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/stencil-docs.json +501 -1
- package/dist/types/components/form-elements/branch-date-picker.d.ts +2 -0
- package/dist/types/components/form-elements/branch-slot-picker.d.ts +2 -0
- package/dist/types/components/form-elements/form-date-picker-legacy.d.ts +4 -0
- package/dist/types/components/form-elements/form-picker-input.d.ts +2 -0
- package/dist/types/components/form-elements/form-structure.d.ts +1 -0
- package/dist/types/components/forms/general-form.d.ts +2 -0
- package/dist/types/components/forms/general-inquiry.d.ts +2 -0
- package/dist/types/components/forms/service-booking.d.ts +2 -0
- package/dist/types/components/forms/ssc-lookup.d.ts +2 -0
- package/dist/types/components/forms/test-drive.d.ts +2 -0
- package/dist/types/components/forms/vehicle-quotation.d.ts +2 -0
- package/dist/types/components/vehicle-lookup/vehicle-accessories.d.ts +1 -0
- package/dist/types/components/vehicle-lookup/vehicle-claimable-items.d.ts +1 -0
- package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +5 -1
- package/dist/types/components/vehicle-lookup/vehicle-paint-thickness.d.ts +1 -0
- package/dist/types/components/vehicle-lookup/vehicle-sale-information.d.ts +1 -0
- package/dist/types/components/vehicle-lookup/vehicle-service-history.d.ts +1 -0
- package/dist/types/components/vehicle-lookup/vehicle-specification.d.ts +1 -0
- package/dist/types/components/vehicle-lookup/vehicle-ssc.d.ts +14 -1
- package/dist/types/components/vehicle-lookup/vehicle-warranty-timeline.d.ts +2 -0
- package/dist/types/components.d.ts +136 -0
- package/dist/types/features/form-hook/interface.d.ts +1 -0
- package/dist/types/features/mocks/index.d.ts +1 -0
- package/dist/types/features/mocks/mock-assets.d.ts +1 -0
- package/dist/types/features/vehicle-lookup-component/interface.d.ts +1 -0
- package/dist/types/global/lib/clock.d.ts +11 -0
- package/dist/types/global/lib/decode-time-offset.d.ts +2 -1
- package/package.json +2 -1
- package/dist/cjs/get-mock-files-NMHm1Vgn.js +0 -53
- package/dist/collection/global/api/urls.js +0 -6
- package/dist/collection/templates/vehicle-lookup/mock-data.js +0 -4922
- package/dist/collection/templates/vehicle-lookup/mock-loader.js +0 -26
- package/dist/collection/templates/vehicle-lookup/warranty-mock-data.js +0 -3211
- package/dist/components/p-B4nj03om.js +0 -5
- package/dist/components/p-BDCBfHZQ.js +0 -5
- package/dist/components/p-BGf2deKN.js +0 -5
- package/dist/components/p-BNmsN10T.js +0 -5
- package/dist/components/p-BOaqSzZZ.js +0 -5
- package/dist/components/p-BpZlI-gl.js +0 -5
- package/dist/components/p-C9uBduBY.js +0 -5
- package/dist/components/p-CUO3vXQr.js +0 -5
- package/dist/components/p-DJDhhX5A.js +0 -5
- package/dist/components/p-DKWqzBVM.js +0 -5
- package/dist/components/p-DfVskL_i.js +0 -5
- package/dist/components/p-DpuHkgw0.js +0 -5
- package/dist/components/p-Imck426q.js +0 -5
- package/dist/components/p-XFwQkeZH.js +0 -5
- package/dist/components/p-a4ooD0o_.js +0 -5
- package/dist/components/p-d7wdNFwt.js +0 -5
- package/dist/components/p-vlA3PJQv.js +0 -5
- package/dist/esm/get-mock-files-Dpb0udoz.js +0 -51
- package/dist/mocks/generated/broker-dealer/paint-thickness-certificate.json +0 -1
- package/dist/mocks/generated/broker-dealer/part-lookup.json +0 -155
- package/dist/mocks/generated/broker-dealer/vehicle-lookup.json +0 -794
- package/dist/mocks/generated/edge-cases/paint-thickness-certificate.json +0 -1
- package/dist/mocks/generated/edge-cases/part-lookup.json +0 -1
- package/dist/mocks/generated/edge-cases/vehicle-lookup.json +0 -124
- package/dist/mocks/generated/standard-dealer/paint-thickness-certificate.json +0 -146
- package/dist/mocks/generated/standard-dealer/part-lookup.json +0 -157
- package/dist/mocks/generated/standard-dealer/vehicle-lookup.json +0 -809
- package/dist/shift-components/p-0965eb41.entry.js +0 -5
- package/dist/shift-components/p-219e589c.entry.js +0 -5
- package/dist/shift-components/p-3324bdf6.entry.js +0 -5
- package/dist/shift-components/p-3ba3f543.entry.js +0 -5
- package/dist/shift-components/p-48Fp2I0C.js +0 -5
- package/dist/shift-components/p-5c28fb6d.entry.js +0 -5
- package/dist/shift-components/p-60232b66.entry.js +0 -5
- package/dist/shift-components/p-82bb8960.entry.js +0 -5
- package/dist/shift-components/p-93ddc847.entry.js +0 -5
- package/dist/shift-components/p-B9INqdFT.js +0 -5
- package/dist/shift-components/p-C4NpWwNE.js +0 -5
- package/dist/shift-components/p-C_QDvFTV.js +0 -5
- package/dist/shift-components/p-CteZTPhq.js +0 -6
- package/dist/shift-components/p-DIe_G0iC.js +0 -5
- package/dist/shift-components/p-DWoutohJ.js +0 -5
- package/dist/shift-components/p-a4f1502c.entry.js +0 -5
- package/dist/shift-components/p-bd8dbd1d.entry.js +0 -5
- package/dist/shift-components/p-d8844424.entry.js +0 -5
- package/dist/shift-components/p-e7986265.entry.js +0 -5
- package/dist/shift-components/p-f93d79bc.entry.js +0 -5
- package/dist/shift-components/p-fa296247.entry.js +0 -5
- package/dist/shift-components/p-pkYWYULB.js +0 -5
- package/dist/types/global/api/urls.d.ts +0 -2
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { Build } from "@stencil/core";
|
|
6
6
|
import { version } from "../../../package.json";
|
|
7
7
|
import { MockFiles } from "./types";
|
|
8
|
+
import { localizeMockAssets } from "./mock-assets";
|
|
8
9
|
const cachedMocks = {};
|
|
9
10
|
export async function getMockFile(mockFileName, externalUrl = '') {
|
|
10
11
|
const fileName = MockFiles[mockFileName];
|
|
@@ -14,22 +15,26 @@ export async function getMockFile(mockFileName, externalUrl = '') {
|
|
|
14
15
|
return response;
|
|
15
16
|
}
|
|
16
17
|
async function requestMockFile(mockFile, externalUrl) {
|
|
17
|
-
|
|
18
|
-
return await cachedMocks[mockFile];
|
|
18
|
+
let fetchUrl = externalUrl === null || externalUrl === void 0 ? void 0 : externalUrl.trim();
|
|
19
19
|
try {
|
|
20
|
-
|
|
21
|
-
if (!!externalUrl && !!externalUrl.trim().length)
|
|
22
|
-
fetchUrl = externalUrl;
|
|
23
|
-
else if (Build.isDev)
|
|
20
|
+
if (!fetchUrl && Build.isDev)
|
|
24
21
|
fetchUrl = 'http://localhost:3000/mocks/' + mockFile;
|
|
25
|
-
else
|
|
22
|
+
else if (!fetchUrl)
|
|
26
23
|
fetchUrl = `https://cdn.jsdelivr.net/npm/adp-web-components@${version}/dist/mocks/${mockFile}`;
|
|
27
|
-
|
|
24
|
+
// The same file kind exists in every generated environment. Caching by the
|
|
25
|
+
// old logical filename made an environment change resurrect the first file
|
|
26
|
+
// after toggling back into development mode.
|
|
27
|
+
if (cachedMocks[fetchUrl])
|
|
28
|
+
return await cachedMocks[fetchUrl];
|
|
29
|
+
const fetchPromise = fetch(fetchUrl)
|
|
30
|
+
.then(res => {
|
|
28
31
|
if (!res.ok)
|
|
29
|
-
delete cachedMocks[
|
|
32
|
+
delete cachedMocks[fetchUrl];
|
|
30
33
|
return res.json();
|
|
31
|
-
})
|
|
32
|
-
|
|
34
|
+
})
|
|
35
|
+
// Fixture pictures point at the CDN copy of the package; a dev build reads the dev server's.
|
|
36
|
+
.then(localizeMockAssets);
|
|
37
|
+
cachedMocks[fetchUrl] = fetchPromise;
|
|
33
38
|
const result = await fetchPromise;
|
|
34
39
|
const count = Object.keys(result).length;
|
|
35
40
|
console.log(`✅ Loaded mock: ${mockFile} (${count} items)`);
|
|
@@ -37,11 +42,11 @@ async function requestMockFile(mockFile, externalUrl) {
|
|
|
37
42
|
key,
|
|
38
43
|
value,
|
|
39
44
|
})));
|
|
40
|
-
cachedMocks[
|
|
45
|
+
cachedMocks[fetchUrl] = result;
|
|
41
46
|
return result;
|
|
42
47
|
}
|
|
43
|
-
catch (
|
|
44
|
-
delete cachedMocks[
|
|
48
|
+
catch (_a) {
|
|
49
|
+
delete cachedMocks[fetchUrl];
|
|
45
50
|
return {};
|
|
46
51
|
}
|
|
47
52
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
import { Build } from "@stencil/core";
|
|
6
|
+
/**
|
|
7
|
+
* The generated fixtures point their pictures (paint panels, company badges, claim documents,
|
|
8
|
+
* accessories) at the copy of `dist/mocks/assets/` on the CDN, so one URL works wherever a fixture
|
|
9
|
+
* is loaded. On the CDN those files exist only from the first release that carries them; the dev
|
|
10
|
+
* server has them right away, at `/mocks/assets/` (the build copies `features/mocks/data` there).
|
|
11
|
+
* In a dev build every such URL is rewritten to the local copy, whichever way the fixture arrived
|
|
12
|
+
* (the component's own fetch or a harness pushing `setMockData`). Prod builds leave the data alone.
|
|
13
|
+
*/
|
|
14
|
+
const CDN_MOCKS_PREFIX = /^https:\/\/cdn\.jsdelivr\.net\/npm\/adp-web-components@[^/]+\/dist\/mocks\//;
|
|
15
|
+
const DEV_MOCKS_BASE = 'http://localhost:3000/mocks/';
|
|
16
|
+
export function localizeMockAssets(value) {
|
|
17
|
+
if (!Build.isDev)
|
|
18
|
+
return value;
|
|
19
|
+
return rewrite(value);
|
|
20
|
+
}
|
|
21
|
+
function rewrite(value) {
|
|
22
|
+
if (typeof value === 'string')
|
|
23
|
+
return value.replace(CDN_MOCKS_PREFIX, DEV_MOCKS_BASE);
|
|
24
|
+
if (Array.isArray(value))
|
|
25
|
+
return value.map(rewrite);
|
|
26
|
+
if (value && typeof value === 'object') {
|
|
27
|
+
const copy = {};
|
|
28
|
+
for (const [key, entry] of Object.entries(value))
|
|
29
|
+
copy[key] = rewrite(entry);
|
|
30
|
+
return copy;
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
5
|
import { smartInvokable } from "../blazor-ref/index";
|
|
6
|
+
import { localizeMockAssets } from "../mocks/index";
|
|
6
7
|
import { resolveRequestHeaders } from "./request-headers";
|
|
7
8
|
import validateVin from "../../global/lib/validate-vin";
|
|
8
9
|
export const setVehicleLookupData = async (context, newData, headers = {}, { beforeAssignment } = {}) => {
|
|
@@ -76,7 +77,8 @@ export const getVehicleLookup = async (context, generalProps, headers = {}) => {
|
|
|
76
77
|
}
|
|
77
78
|
};
|
|
78
79
|
if (context === null || context === void 0 ? void 0 : context.isDev) {
|
|
79
|
-
|
|
80
|
+
// Fixture pictures point at the CDN copy of the package; a dev build reads the dev server's.
|
|
81
|
+
const newData = localizeMockAssets(context === null || context === void 0 ? void 0 : context.mockData[vin]);
|
|
80
82
|
return handleResult(newData);
|
|
81
83
|
}
|
|
82
84
|
else {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
const ISO_CALENDAR_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves a component's optional calendar-date clock to an instant.
|
|
8
|
+
*
|
|
9
|
+
* A supplied value is always midnight UTC. Invalid values fall back to the wall
|
|
10
|
+
* clock so a malformed host attribute cannot leave date UI holding an Invalid
|
|
11
|
+
* Date. Callers that need a calendar label should use `today`, which keeps the
|
|
12
|
+
* same UTC interpretation.
|
|
13
|
+
*/
|
|
14
|
+
export function now(value) {
|
|
15
|
+
if (value && ISO_CALENDAR_DATE.test(value)) {
|
|
16
|
+
const resolved = new Date(`${value}T00:00:00.000Z`);
|
|
17
|
+
if (!Number.isNaN(resolved.getTime()) && resolved.toISOString().slice(0, 10) === value)
|
|
18
|
+
return resolved;
|
|
19
|
+
}
|
|
20
|
+
return new Date();
|
|
21
|
+
}
|
|
22
|
+
/** Resolves a component's optional clock to an ISO calendar date in UTC. */
|
|
23
|
+
export function today(value) {
|
|
24
|
+
return now(value).toISOString().slice(0, 10);
|
|
25
|
+
}
|
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
5
|
import { addDays, addHours, addMinutes, addMonths, addSeconds, addYears, format, startOfDay } from "date-fns";
|
|
6
|
-
|
|
6
|
+
import { now } from "./clock";
|
|
7
|
+
export function decodeTimeOffset({ offsets, type, date, today }) {
|
|
8
|
+
if (!date) {
|
|
9
|
+
const clock = now(today);
|
|
10
|
+
// date-fns performs calendar arithmetic in local time. Mirror an explicit
|
|
11
|
+
// UTC calendar date into local time first so a negative offset cannot roll
|
|
12
|
+
// the anchor back to the previous day.
|
|
13
|
+
date = today ? new Date(clock.getUTCFullYear(), clock.getUTCMonth(), clock.getUTCDate()) : startOfDay(clock);
|
|
14
|
+
}
|
|
7
15
|
if (offsets.length > 0)
|
|
8
16
|
date = addYears(date, offsets[0]);
|
|
9
17
|
if (offsets.length > 1)
|
|
@@ -248,7 +248,7 @@ export const dataKeys = [
|
|
|
248
248
|
summary:
|
|
249
249
|
'A tiny rewrite language applied to the payload just before it is sent, in object-key order. Four behaviours, chosen by the shape of each entry:\n' +
|
|
250
250
|
'1. value is an ARRAY — join. Each item is looked up in the payload; if there is no such key the item is used as a literal. The result is assigned to the entry key. Source fields are NOT removed.\n' +
|
|
251
|
-
'2. key starts with `parse date: ` — `payload[rest] = parse(payload[rest], <value>,
|
|
251
|
+
'2. key starts with `parse date: ` — `payload[rest] = parse(payload[rest], <value>, now(today))` using the date-fns format in the value and the form’s optional `today` clock. Produces a Date object.\n' +
|
|
252
252
|
'3. key starts with `format date: ` — `payload[rest] = formatISO(payload[rest])`. The value is ignored; any non-empty string works, so write something self-documenting.\n' +
|
|
253
253
|
'4. anything else — RENAME AND MOVE: `additionalData[<value>] = payload[<key>]`, then `delete payload[<key>]`.\n' +
|
|
254
254
|
'Whenever this key is present and non-empty, `payload.additionalData` is set, even if it ends up `{}`.',
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
const HTTP_PROTOCOLS = new Set(['http:', 'https:']);
|
|
2
|
+
const HEADER_NAME = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
3
|
+
const STORAGE_VERSION = 1;
|
|
4
|
+
|
|
5
|
+
const clone = value => {
|
|
6
|
+
if (value === undefined || value === null || typeof value !== 'object') return value;
|
|
7
|
+
|
|
8
|
+
return JSON.parse(JSON.stringify(value));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const asObject = value => {
|
|
12
|
+
if (!value) return {};
|
|
13
|
+
|
|
14
|
+
if (typeof value === 'object' && !Array.isArray(value)) return clone(value);
|
|
15
|
+
|
|
16
|
+
if (typeof value !== 'string') return {};
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const parsed = JSON.parse(value);
|
|
20
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {};
|
|
21
|
+
} catch {
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const urlField = (name, label, required = true) => ({
|
|
27
|
+
name,
|
|
28
|
+
label,
|
|
29
|
+
kind: 'url',
|
|
30
|
+
inputType: 'url',
|
|
31
|
+
required,
|
|
32
|
+
placeholder: 'https://api.example.invalid/',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const secretField = (name, label, kind, placeholder) => ({
|
|
36
|
+
name,
|
|
37
|
+
label,
|
|
38
|
+
kind,
|
|
39
|
+
inputType: 'password',
|
|
40
|
+
required: true,
|
|
41
|
+
placeholder,
|
|
42
|
+
secret: true,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export function connectionFields(profile, options = {}) {
|
|
46
|
+
if (profile === 'part') {
|
|
47
|
+
return [urlField('endpointUrl', 'Endpoint URL'), secretField('queryJson', 'Query JSON', 'query', '{"code":""}')];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (profile === 'form') return [urlField('structureUrl', 'Structure URL')];
|
|
51
|
+
if (profile === 'vin-extractor') return [urlField('ocrEndpoint', 'OCR endpoint')];
|
|
52
|
+
|
|
53
|
+
const fields = [urlField('baseUrl', 'Base URL'), secretField('headersJson', 'Request headers JSON', 'headers', '{}')];
|
|
54
|
+
|
|
55
|
+
if (options.recaptcha) fields.push(secretField('recaptchaSiteKey', 'reCAPTCHA site key', 'text', 'Site key'));
|
|
56
|
+
if (options.claim) fields.push(urlField('claimEndpoint', 'Claim endpoint'));
|
|
57
|
+
if (options.unauthorizedSsc) fields.push(urlField('unauthorizedSscEndpoint', 'Manufacturer-check endpoint'));
|
|
58
|
+
|
|
59
|
+
return fields;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function emptyConnectionDraft(profile, options = {}) {
|
|
63
|
+
return Object.fromEntries(connectionFields(profile, options).map(field => [field.name, field.kind === 'headers' || field.kind === 'query' ? '{}' : '']));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const validateUrl = value => {
|
|
67
|
+
try {
|
|
68
|
+
const url = new URL(value);
|
|
69
|
+
|
|
70
|
+
return HTTP_PROTOCOLS.has(url.protocol) && !url.username && !url.password;
|
|
71
|
+
} catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const parseJsonObject = (value, field, errors) => {
|
|
77
|
+
try {
|
|
78
|
+
const parsed = JSON.parse(value);
|
|
79
|
+
|
|
80
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) throw new Error();
|
|
81
|
+
|
|
82
|
+
return parsed;
|
|
83
|
+
} catch {
|
|
84
|
+
errors[field] = 'Enter one JSON object.';
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export function validateConnection(profile, draft, options = {}) {
|
|
90
|
+
const errors = {};
|
|
91
|
+
const settings = {};
|
|
92
|
+
|
|
93
|
+
for (const field of connectionFields(profile, options)) {
|
|
94
|
+
const value = String(draft?.[field.name] ?? '').trim();
|
|
95
|
+
|
|
96
|
+
if (!value) {
|
|
97
|
+
if (field.required) errors[field.name] = `${field.label} is required.`;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (field.kind === 'url') {
|
|
102
|
+
if (!validateUrl(value)) errors[field.name] = 'Enter an absolute HTTP or HTTPS URL without embedded credentials.';
|
|
103
|
+
else settings[field.name] = value;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (field.kind === 'headers') {
|
|
108
|
+
const parsed = parseJsonObject(value, field.name, errors);
|
|
109
|
+
|
|
110
|
+
if (parsed) {
|
|
111
|
+
const invalidName = Object.keys(parsed).some(name => !HEADER_NAME.test(name));
|
|
112
|
+
const invalidValue = Object.values(parsed).some(header => !['string', 'number', 'boolean'].includes(typeof header));
|
|
113
|
+
|
|
114
|
+
if (invalidName || invalidValue) errors[field.name] = 'Use valid header names with string, number, or boolean values.';
|
|
115
|
+
else settings.headers = Object.fromEntries(Object.entries(parsed).map(([name, header]) => [name, String(header)]));
|
|
116
|
+
}
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (field.kind === 'query') {
|
|
121
|
+
const parsed = parseJsonObject(value, field.name, errors);
|
|
122
|
+
if (parsed) settings.query = parsed;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
settings[field.name] = value;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return { ok: Object.keys(errors).length === 0, errors, settings };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const settingsToDraft = (profile, settings, options) => ({
|
|
133
|
+
...emptyConnectionDraft(profile, options),
|
|
134
|
+
...settings,
|
|
135
|
+
headersJson: JSON.stringify(settings?.headers ?? {}),
|
|
136
|
+
queryJson: JSON.stringify(settings?.query ?? {}),
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export function connectionStorageKey(profile, pathname) {
|
|
140
|
+
return `adp-harness-connection:v${STORAGE_VERSION}:${profile}:${pathname || '/'}`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function saveConnection(storage, key, settings) {
|
|
144
|
+
storage.setItem(key, JSON.stringify({ version: STORAGE_VERSION, settings }));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function loadConnection(storage, key, profile, options = {}) {
|
|
148
|
+
try {
|
|
149
|
+
const stored = JSON.parse(storage.getItem(key));
|
|
150
|
+
if (stored?.version !== STORAGE_VERSION) return null;
|
|
151
|
+
|
|
152
|
+
const validated = validateConnection(profile, settingsToDraft(profile, stored.settings, options), options);
|
|
153
|
+
return validated.ok ? validated.settings : null;
|
|
154
|
+
} catch {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function clearConnection(storage, key) {
|
|
160
|
+
storage.removeItem(key);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function connectionOptions(profile, configured) {
|
|
164
|
+
const options = configured && typeof configured === 'object' ? configured : {};
|
|
165
|
+
|
|
166
|
+
return {
|
|
167
|
+
recaptcha: profile === 'composite' || options.recaptcha === true,
|
|
168
|
+
claim: profile === 'composite' || options.claim === true,
|
|
169
|
+
unauthorizedSsc: profile === 'composite' || options.unauthorizedSsc === true,
|
|
170
|
+
targets: options.targets ?? null,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function captureConnectionState(profile, subject, options = {}) {
|
|
175
|
+
if (profile === 'part') return { endpoint: clone(subject.endpoint) };
|
|
176
|
+
if (profile === 'form') return { structureUrl: subject.structureUrl || subject.getAttribute?.('structure-url') || '', fields: clone(subject.fields) };
|
|
177
|
+
if (profile === 'vin-extractor') return { endpoints: (options.targets ?? [subject]).map(target => target.ocrEndpoint || target.getAttribute?.('ocr-endpoint') || '') };
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
baseUrl: subject.baseUrl ?? '',
|
|
181
|
+
headers: clone(subject.headers ?? {}),
|
|
182
|
+
requestHeadersProvider: subject.requestHeadersProvider,
|
|
183
|
+
recaptchaKey: subject.recaptchaKey ?? '',
|
|
184
|
+
claimEndPoint: subject.claimEndPoint ?? '',
|
|
185
|
+
unauthorizedSscLookupBaseUrl: subject.unauthorizedSscLookupBaseUrl ?? '',
|
|
186
|
+
childrenProps: clone(subject.childrenProps),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const applyCompositeSettings = (subject, settings, options) => {
|
|
191
|
+
const props = asObject(subject.childrenProps);
|
|
192
|
+
|
|
193
|
+
if (options.recaptcha || options.unauthorizedSsc) {
|
|
194
|
+
props['vehicle-ssc'] = {
|
|
195
|
+
...(props['vehicle-ssc'] ?? {}),
|
|
196
|
+
...(options.recaptcha ? { recaptchaKey: settings.recaptchaSiteKey } : {}),
|
|
197
|
+
...(options.unauthorizedSsc ? { unauthorizedSscLookupBaseUrl: settings.unauthorizedSscEndpoint } : {}),
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (options.claim) {
|
|
202
|
+
props['vehicle-claimable-items'] = {
|
|
203
|
+
...(props['vehicle-claimable-items'] ?? {}),
|
|
204
|
+
claimEndPoint: settings.claimEndpoint,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
subject.childrenProps = props;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export function connectProfile(profile, subject, settings, options = {}) {
|
|
212
|
+
if (profile === 'part') {
|
|
213
|
+
subject.endpoint = { url: settings.endpointUrl, query: clone(settings.query) };
|
|
214
|
+
subject.isDev = false;
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (profile === 'form') {
|
|
219
|
+
subject.structureUrl = settings.structureUrl;
|
|
220
|
+
subject.isDev = false;
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (profile === 'vin-extractor') {
|
|
225
|
+
for (const target of options.targets ?? [subject]) target.ocrEndpoint = settings.ocrEndpoint;
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
subject.baseUrl = settings.baseUrl;
|
|
230
|
+
subject.headers = clone(settings.headers);
|
|
231
|
+
subject.requestHeadersProvider = () => clone(settings.headers);
|
|
232
|
+
|
|
233
|
+
if (profile === 'composite') applyCompositeSettings(subject, settings, options);
|
|
234
|
+
else {
|
|
235
|
+
if (options.recaptcha) subject.recaptchaKey = settings.recaptchaSiteKey;
|
|
236
|
+
if (options.claim) subject.claimEndPoint = settings.claimEndpoint;
|
|
237
|
+
if (options.unauthorizedSsc) subject.unauthorizedSscLookupBaseUrl = settings.unauthorizedSscEndpoint;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
subject.isDev = false;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export function disconnectProfile(profile, subject, baseline, options = {}) {
|
|
244
|
+
if (profile === 'part') {
|
|
245
|
+
subject.endpoint = clone(baseline.endpoint);
|
|
246
|
+
subject.isDev = true;
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (profile === 'form') {
|
|
251
|
+
subject.structureUrl = baseline.structureUrl;
|
|
252
|
+
subject.fields = clone(baseline.fields);
|
|
253
|
+
subject.isDev = true;
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (profile === 'vin-extractor') {
|
|
258
|
+
(options.targets ?? [subject]).forEach((target, index) => {
|
|
259
|
+
target.ocrEndpoint = baseline.endpoints[index] ?? '';
|
|
260
|
+
});
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
subject.baseUrl = baseline.baseUrl;
|
|
265
|
+
subject.headers = clone(baseline.headers);
|
|
266
|
+
subject.requestHeadersProvider = baseline.requestHeadersProvider;
|
|
267
|
+
subject.recaptchaKey = baseline.recaptchaKey;
|
|
268
|
+
subject.claimEndPoint = baseline.claimEndPoint;
|
|
269
|
+
subject.unauthorizedSscLookupBaseUrl = baseline.unauthorizedSscLookupBaseUrl;
|
|
270
|
+
subject.childrenProps = clone(baseline.childrenProps);
|
|
271
|
+
subject.isDev = true;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export function todayChoiceAvailable(mode, connected, hasAnchor) {
|
|
275
|
+
if (connected) return mode === 'live';
|
|
276
|
+
return mode !== 'anchor' || hasAnchor;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export function connectionLog(action, profile) {
|
|
280
|
+
const label = profile === 'vin-extractor' ? 'VIN extractor' : profile === 'form' ? 'form' : profile === 'part' ? 'part lookup' : 'vehicle lookup';
|
|
281
|
+
return action === 'connect' ? `${label} · live settings applied · credentials withheld` : `${label} · generated settings restored`;
|
|
282
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const ENVIRONMENT_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
2
|
+
|
|
3
|
+
/** Keep the generated index as the only authority for names, anchors and files. */
|
|
4
|
+
export function environmentsFrom(index) {
|
|
5
|
+
if (!Array.isArray(index?.environments)) return [];
|
|
6
|
+
|
|
7
|
+
return index.environments
|
|
8
|
+
.filter(environment => {
|
|
9
|
+
if (!ENVIRONMENT_NAME.test(environment?.name || '') || typeof environment?.files !== 'object' || environment.files === null) return false;
|
|
10
|
+
|
|
11
|
+
return Object.values(environment.files).every(keys => Array.isArray(keys));
|
|
12
|
+
})
|
|
13
|
+
.map(environment => ({ ...environment, label: environmentLabel(environment.name) }));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Query string wins, then this tab's memory, then the first generated entry. */
|
|
17
|
+
export function chooseEnvironment(environments, requested, stored) {
|
|
18
|
+
return environments.find(environment => environment.name === requested) ?? environments.find(environment => environment.name === stored) ?? environments[0] ?? null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function environmentFileUrl(siteRoot, environment, file) {
|
|
22
|
+
return new URL(`mocks/generated/${environment}/${file}.json`, siteRoot);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function environmentLabel(name) {
|
|
26
|
+
return String(name)
|
|
27
|
+
.split('-')
|
|
28
|
+
.filter(Boolean)
|
|
29
|
+
.map(word => word[0].toUpperCase() + word.slice(1))
|
|
30
|
+
.join(' ');
|
|
31
|
+
}
|