@foxy.io/elements 1.15.0 → 1.16.0-beta.11
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/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +5 -0
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -0
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -0
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +15 -15
- package/dist/cdn/foxy-customer.js +6 -6
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -0
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -0
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -0
- package/dist/cdn/foxy-item-form.js +1 -0
- package/dist/cdn/foxy-item-option-card.js +1 -0
- package/dist/cdn/foxy-item-option-form.js +1 -0
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +195 -0
- package/dist/cdn/foxy-reports-table.js +41 -0
- package/dist/cdn/foxy-shipment-card.js +17 -0
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +4 -4
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-swipe-actions.js +1 -0
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +64 -0
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -0
- package/dist/cdn/foxy-webhook-form.js +318 -0
- package/dist/cdn/foxy-webhook-log-card.js +1 -0
- package/dist/cdn/foxy-webhook-status-card.js +1 -0
- package/dist/cdn/shared-0504c8dc.js +1 -0
- package/dist/cdn/{shared-5a54a9bc.js → shared-0c806443.js} +1 -1
- package/dist/cdn/{shared-218ba06e.js → shared-0eb966c5.js} +1 -1
- package/dist/cdn/{shared-d58c947c.js → shared-17437844.js} +2 -2
- package/dist/cdn/{shared-59e44f29.js → shared-1bbd9b73.js} +1 -1
- package/dist/cdn/shared-1d67ea08.js +9 -0
- package/dist/cdn/{shared-07134f93.js → shared-22ba9566.js} +1 -1
- package/dist/cdn/{shared-448781f9.js → shared-26ce8d23.js} +1 -1
- package/dist/cdn/shared-31f90f98.js +1 -0
- package/dist/cdn/shared-322d50e3.js +1 -0
- package/dist/cdn/shared-32fe791c.js +1 -0
- package/dist/cdn/{shared-65dfd512.js → shared-3a31785e.js} +2 -11
- package/dist/cdn/shared-41df4012.js +1 -0
- package/dist/cdn/{shared-7f0a9790.js → shared-45feee83.js} +1 -1
- package/dist/cdn/shared-4d1b8098.js +1 -0
- package/dist/cdn/shared-5323ef71.js +1 -0
- package/dist/cdn/shared-59a3f7dd.js +1 -0
- package/dist/cdn/shared-6762b56b.js +12 -0
- package/dist/cdn/{shared-023a97c2.js → shared-68ebb1d1.js} +7 -7
- package/dist/cdn/shared-79bfb59a.js +1 -0
- package/dist/cdn/{shared-a040d79d.js → shared-7b02ce85.js} +1 -1
- package/dist/cdn/{shared-756034e4.js → shared-7c8bb60c.js} +1 -1
- package/dist/cdn/shared-7e960a32.js +1 -0
- package/dist/cdn/shared-7f264e87.js +1 -0
- package/dist/cdn/shared-7facf7ba.js +1 -0
- package/dist/cdn/{shared-60126eee.js → shared-8be42cfd.js} +1 -1
- package/dist/cdn/{shared-09c5f9f1.js → shared-8c1f3b5d.js} +1 -1
- package/dist/cdn/shared-90553b38.js +1 -0
- package/dist/cdn/{shared-5535f38f.js → shared-92327224.js} +2 -2
- package/dist/cdn/{shared-6d45a07b.js → shared-9803aa7c.js} +1 -1
- package/dist/cdn/shared-98497473.js +1 -0
- package/dist/cdn/{shared-b0f0e8b5.js → shared-99940888.js} +1 -1
- package/dist/cdn/{shared-b710881a.js → shared-a0c6a159.js} +2 -2
- package/dist/cdn/{shared-fab8c705.js → shared-a4f49e9c.js} +10 -10
- package/dist/cdn/{shared-625c1272.js → shared-a8bf2435.js} +14 -19
- package/dist/cdn/shared-ac44429d.js +1 -0
- package/dist/cdn/shared-b2b3f0e0.js +201 -0
- package/dist/cdn/{shared-073cb8e9.js → shared-b76a1f1d.js} +1 -1
- package/dist/cdn/shared-b9607e68.js +1 -0
- package/dist/cdn/{shared-9fc4a896.js → shared-be26193a.js} +5 -5
- package/dist/cdn/{shared-340f7584.js → shared-c0c5d201.js} +10 -10
- package/dist/cdn/{shared-0f38a631.js → shared-cf9696be.js} +1 -1
- package/dist/cdn/shared-cfb3d161.js +1 -0
- package/dist/cdn/{shared-f4ad24f4.js → shared-d1fae22a.js} +1 -1
- package/dist/cdn/shared-d6444ed0.js +1 -0
- package/dist/cdn/shared-dc73b9a5.js +159 -0
- package/dist/cdn/{shared-1a67bc75.js → shared-e05209a8.js} +4 -4
- package/dist/cdn/{shared-9221e6b2.js → shared-e1c1e8e2.js} +1 -1
- package/dist/cdn/shared-e82cc599.js +29 -0
- package/dist/cdn/shared-e9a4a204.js +1 -0
- package/dist/cdn/shared-f0a57ef6.js +1 -0
- package/dist/cdn/{shared-9cd49a3e.js → shared-f5419ce4.js} +1 -1
- package/dist/cdn/shared-f9f9ed5b.js +6 -0
- package/dist/cdn/shared-fadcb2e1.js +1 -0
- package/dist/cdn/{shared-46ee137f.js → shared-fd789489.js} +10 -10
- package/dist/cdn/translations/api-browser/en.json +28 -0
- package/dist/cdn/translations/copy-to-clipboard/en.json +6 -0
- package/dist/cdn/translations/coupon-form/en.json +21 -2
- package/dist/cdn/translations/discount-builder/en.json +14 -0
- package/dist/cdn/translations/gift-card-form/en.json +21 -0
- package/dist/cdn/translations/item-card/en.json +9 -0
- package/dist/cdn/translations/item-form/en.json +411 -0
- package/dist/cdn/translations/item-option-form/en.json +43 -0
- package/dist/cdn/translations/report-form/en.json +38 -0
- package/dist/cdn/translations/reports-table/en.json +21 -0
- package/dist/cdn/translations/shipment-card/en.json +470 -0
- package/dist/cdn/translations/transaction/en.json +965 -0
- package/dist/cdn/translations/webhook-card/en.json +7 -0
- package/dist/cdn/translations/webhook-form/en.json +101 -0
- package/dist/cdn/translations/webhook-log-card/en.json +8 -0
- package/dist/cdn/translations/webhook-status-card/en.json +11 -0
- package/dist/elements/index.d.ts +1 -0
- package/dist/elements/index.js +2 -0
- package/dist/elements/index.js.map +1 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.d.ts +22 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js +79 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js.map +1 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/index.d.ts +4 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/index.js +6 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/index.js.map +1 -0
- package/dist/elements/internal/InternalAsyncDetailsControl/InternalAsyncDetailsControl.d.ts +30 -0
- package/dist/elements/internal/InternalAsyncDetailsControl/InternalAsyncDetailsControl.js +131 -0
- package/dist/elements/internal/InternalAsyncDetailsControl/InternalAsyncDetailsControl.js.map +1 -0
- package/dist/elements/internal/InternalAsyncDetailsControl/index.d.ts +7 -0
- package/dist/elements/internal/InternalAsyncDetailsControl/index.js +9 -0
- package/dist/elements/internal/InternalAsyncDetailsControl/index.js.map +1 -0
- package/dist/elements/internal/InternalCard/InternalCard.d.ts +21 -0
- package/dist/elements/internal/InternalCard/InternalCard.js +53 -0
- package/dist/elements/internal/InternalCard/InternalCard.js.map +1 -0
- package/dist/elements/internal/InternalCard/index.d.ts +3 -0
- package/dist/elements/internal/InternalCard/index.js +5 -0
- package/dist/elements/internal/InternalCard/index.js.map +1 -0
- package/dist/elements/internal/InternalControl/InternalControl.d.ts +41 -0
- package/dist/elements/internal/InternalControl/InternalControl.js +74 -0
- package/dist/elements/internal/InternalControl/InternalControl.js.map +1 -0
- package/dist/elements/internal/InternalControl/index.d.ts +4 -0
- package/dist/elements/internal/InternalControl/index.js +6 -0
- package/dist/elements/internal/InternalControl/index.js.map +1 -0
- package/dist/elements/internal/InternalCreateControl/InternalCreateControl.d.ts +22 -0
- package/dist/elements/internal/InternalCreateControl/InternalCreateControl.js +60 -0
- package/dist/elements/internal/InternalCreateControl/InternalCreateControl.js.map +1 -0
- package/dist/elements/internal/InternalCreateControl/index.d.ts +5 -0
- package/dist/elements/internal/InternalCreateControl/index.js +7 -0
- package/dist/elements/internal/InternalCreateControl/index.js.map +1 -0
- package/dist/elements/internal/InternalDateControl/InternalDateControl.d.ts +14 -0
- package/dist/elements/internal/InternalDateControl/InternalDateControl.js +60 -0
- package/dist/elements/internal/InternalDateControl/InternalDateControl.js.map +1 -0
- package/dist/elements/internal/InternalDateControl/index.d.ts +4 -0
- package/dist/elements/internal/InternalDateControl/index.js +6 -0
- package/dist/elements/internal/InternalDateControl/index.js.map +1 -0
- package/dist/elements/internal/InternalDeleteControl/InternalDeleteControl.d.ts +15 -0
- package/dist/elements/internal/InternalDeleteControl/InternalDeleteControl.js +51 -0
- package/dist/elements/internal/InternalDeleteControl/InternalDeleteControl.js.map +1 -0
- package/dist/elements/internal/InternalDeleteControl/index.d.ts +6 -0
- package/dist/elements/internal/InternalDeleteControl/index.js +8 -0
- package/dist/elements/internal/InternalDeleteControl/index.js.map +1 -0
- package/dist/elements/internal/InternalDetails/InternalDetails.d.ts +22 -0
- package/dist/elements/internal/InternalDetails/InternalDetails.js +71 -0
- package/dist/elements/internal/InternalDetails/InternalDetails.js.map +1 -0
- package/dist/elements/internal/InternalDetails/index.d.ts +6 -0
- package/dist/elements/internal/InternalDetails/index.js +8 -0
- package/dist/elements/internal/InternalDetails/index.js.map +1 -0
- package/dist/elements/internal/InternalEditableControl/InternalEditableControl.d.ts +77 -0
- package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +153 -0
- package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -0
- package/dist/elements/internal/InternalEditableControl/index.d.ts +3 -0
- package/dist/elements/internal/InternalEditableControl/index.js +5 -0
- package/dist/elements/internal/InternalEditableControl/index.js.map +1 -0
- package/dist/elements/internal/InternalForm/InternalForm.d.ts +27 -0
- package/dist/elements/internal/InternalForm/InternalForm.js +65 -0
- package/dist/elements/internal/InternalForm/InternalForm.js.map +1 -0
- package/dist/elements/internal/InternalForm/index.d.ts +6 -0
- package/dist/elements/internal/InternalForm/index.js +8 -0
- package/dist/elements/internal/InternalForm/index.js.map +1 -0
- package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.d.ts +14 -0
- package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js +115 -0
- package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js.map +1 -0
- package/dist/elements/internal/InternalFrequencyControl/index.d.ts +6 -0
- package/dist/elements/internal/InternalFrequencyControl/index.js +8 -0
- package/dist/elements/internal/InternalFrequencyControl/index.js.map +1 -0
- package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.d.ts +13 -0
- package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js +41 -0
- package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js.map +1 -0
- package/dist/elements/internal/InternalIntegerControl/index.d.ts +4 -0
- package/dist/elements/internal/InternalIntegerControl/index.js +6 -0
- package/dist/elements/internal/InternalIntegerControl/index.js.map +1 -0
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.d.ts +13 -0
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +41 -0
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -0
- package/dist/elements/internal/InternalNumberControl/index.d.ts +4 -0
- package/dist/elements/internal/InternalNumberControl/index.js +6 -0
- package/dist/elements/internal/InternalNumberControl/index.js.map +1 -0
- package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.d.ts +17 -0
- package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js +51 -0
- package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js.map +1 -0
- package/dist/elements/internal/InternalRadioGroupControl/index.d.ts +6 -0
- package/dist/elements/internal/InternalRadioGroupControl/index.js +8 -0
- package/dist/elements/internal/InternalRadioGroupControl/index.js.map +1 -0
- package/dist/elements/internal/InternalRadioGroupControl/types.d.ts +6 -0
- package/dist/elements/internal/InternalRadioGroupControl/types.js +2 -0
- package/dist/elements/internal/InternalRadioGroupControl/types.js.map +1 -0
- package/dist/elements/internal/InternalTextControl/InternalTextControl.d.ts +13 -0
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js +40 -0
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -0
- package/dist/elements/internal/InternalTextControl/index.d.ts +4 -0
- package/dist/elements/internal/InternalTextControl/index.js +6 -0
- package/dist/elements/internal/InternalTextControl/index.js.map +1 -0
- package/dist/elements/internal/InternalTimestampsControl/InternalTimestampsControl.d.ts +14 -0
- package/dist/elements/internal/InternalTimestampsControl/InternalTimestampsControl.js +57 -0
- package/dist/elements/internal/InternalTimestampsControl/InternalTimestampsControl.js.map +1 -0
- package/dist/elements/internal/InternalTimestampsControl/index.d.ts +4 -0
- package/dist/elements/internal/InternalTimestampsControl/index.js +6 -0
- package/dist/elements/internal/InternalTimestampsControl/index.js.map +1 -0
- package/dist/elements/private/Dialog/Dialog.d.ts +4 -2
- package/dist/elements/private/Dialog/Dialog.js +3 -1
- package/dist/elements/private/Dialog/Dialog.js.map +1 -1
- package/dist/elements/private/EditableList/EditableList.d.ts +4 -2
- package/dist/elements/private/EditableList/EditableList.js +3 -1
- package/dist/elements/private/EditableList/EditableList.js.map +1 -1
- package/dist/elements/private/FrequencyInput/FrequencyInput.d.ts +3 -1
- package/dist/elements/private/FrequencyInput/FrequencyInput.js +2 -1
- package/dist/elements/private/FrequencyInput/FrequencyInput.js.map +1 -1
- package/dist/elements/public/ApiBrowser/ApiBrowser.d.ts +31 -0
- package/dist/elements/public/ApiBrowser/ApiBrowser.js +215 -0
- package/dist/elements/public/ApiBrowser/ApiBrowser.js.map +1 -0
- package/dist/elements/public/ApiBrowser/index.d.ts +9 -0
- package/dist/elements/public/ApiBrowser/index.js +11 -0
- package/dist/elements/public/ApiBrowser/index.js.map +1 -0
- package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/InternalApiBrowserResourceForm.d.ts +25 -0
- package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/InternalApiBrowserResourceForm.js +285 -0
- package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/InternalApiBrowserResourceForm.js.map +1 -0
- package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/index.d.ts +10 -0
- package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/index.js +12 -0
- package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/index.js.map +1 -0
- package/dist/elements/public/ApiBrowser/types.d.ts +10 -0
- package/dist/elements/public/ApiBrowser/types.js +2 -0
- package/dist/elements/public/ApiBrowser/types.js.map +1 -0
- package/dist/elements/public/CollectionPage/CollectionPage.d.ts +4 -3
- package/dist/elements/public/CollectionPage/CollectionPage.js +5 -3
- package/dist/elements/public/CollectionPage/CollectionPage.js.map +1 -1
- package/dist/elements/public/CollectionPage/types.d.ts +1 -0
- package/dist/elements/public/CollectionPage/types.js.map +1 -1
- package/dist/elements/public/CollectionPages/CollectionPages.d.ts +4 -2
- package/dist/elements/public/CollectionPages/CollectionPages.js +3 -1
- package/dist/elements/public/CollectionPages/CollectionPages.js.map +1 -1
- package/dist/elements/public/CopyToClipboard/CopyToClipboard.d.ts +22 -0
- package/dist/elements/public/CopyToClipboard/CopyToClipboard.js +121 -0
- package/dist/elements/public/CopyToClipboard/CopyToClipboard.js.map +1 -0
- package/dist/elements/public/CopyToClipboard/index.d.ts +5 -0
- package/dist/elements/public/CopyToClipboard/index.js +7 -0
- package/dist/elements/public/CopyToClipboard/index.js.map +1 -0
- package/dist/elements/public/CouponDetailCard/CouponDetailCard.d.ts +25 -0
- package/dist/elements/public/CouponDetailCard/CouponDetailCard.js +58 -0
- package/dist/elements/public/CouponDetailCard/CouponDetailCard.js.map +1 -0
- package/dist/elements/public/CouponDetailCard/index.d.ts +5 -0
- package/dist/elements/public/CouponDetailCard/index.js +7 -0
- package/dist/elements/public/CouponDetailCard/index.js.map +1 -0
- package/dist/elements/public/CouponDetailCard/types.d.ts +3 -0
- package/dist/elements/public/CouponDetailCard/types.js +2 -0
- package/dist/elements/public/CouponDetailCard/types.js.map +1 -0
- package/dist/elements/public/CouponForm/CouponForm.js +36 -35
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CouponForm/index.d.ts +1 -0
- package/dist/elements/public/CouponForm/index.js +1 -0
- package/dist/elements/public/CouponForm/index.js.map +1 -1
- package/dist/elements/public/CustomerApi/CustomerApi.d.ts +3 -1
- package/dist/elements/public/CustomerApi/CustomerApi.js +2 -1
- package/dist/elements/public/CustomerApi/CustomerApi.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalChangePassword.d.ts +3 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalChangePassword.js +2 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalChangePassword.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +12 -3
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.d.ts +3 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +2 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.d.ts +3 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +2 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalTransactions.d.ts +3 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalTransactions.js +2 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalTransactions.js.map +1 -1
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.d.ts +40 -0
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js +342 -0
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js.map +1 -0
- package/dist/elements/public/DiscountBuilder/index.d.ts +3 -0
- package/dist/elements/public/DiscountBuilder/index.js +5 -0
- package/dist/elements/public/DiscountBuilder/index.js.map +1 -0
- package/dist/elements/public/DiscountBuilder/types.d.ts +32 -0
- package/dist/elements/public/DiscountBuilder/types.js +2 -0
- package/dist/elements/public/DiscountBuilder/types.js.map +1 -0
- package/dist/elements/public/DiscountDetailCard/DiscountDetailCard.d.ts +25 -0
- package/dist/elements/public/DiscountDetailCard/DiscountDetailCard.js +58 -0
- package/dist/elements/public/DiscountDetailCard/DiscountDetailCard.js.map +1 -0
- package/dist/elements/public/DiscountDetailCard/index.d.ts +5 -0
- package/dist/elements/public/DiscountDetailCard/index.js +7 -0
- package/dist/elements/public/DiscountDetailCard/index.js.map +1 -0
- package/dist/elements/public/DiscountDetailCard/types.d.ts +3 -0
- package/dist/elements/public/DiscountDetailCard/types.js +2 -0
- package/dist/elements/public/DiscountDetailCard/types.js.map +1 -0
- package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js +2 -1
- package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js.map +1 -1
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +28 -15
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/GiftCardForm/index.d.ts +1 -0
- package/dist/elements/public/GiftCardForm/index.js +1 -0
- package/dist/elements/public/GiftCardForm/index.js.map +1 -1
- package/dist/elements/public/I18n/I18n.d.ts +3 -1
- package/dist/elements/public/I18n/I18n.js +2 -1
- package/dist/elements/public/I18n/I18n.js.map +1 -1
- package/dist/elements/public/I18n/format/discount.js +1 -0
- package/dist/elements/public/I18n/format/discount.js.map +1 -1
- package/dist/elements/public/ItemCard/ItemCard.d.ts +16 -0
- package/dist/elements/public/ItemCard/ItemCard.js +142 -0
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -0
- package/dist/elements/public/ItemCard/index.d.ts +4 -0
- package/dist/elements/public/ItemCard/index.js +6 -0
- package/dist/elements/public/ItemCard/index.js.map +1 -0
- package/dist/elements/public/ItemCard/types.d.ts +5 -0
- package/dist/elements/public/ItemCard/types.js +2 -0
- package/dist/elements/public/ItemCard/types.js.map +1 -0
- package/dist/elements/public/ItemForm/ItemForm.d.ts +19 -0
- package/dist/elements/public/ItemForm/ItemForm.js +96 -0
- package/dist/elements/public/ItemForm/ItemForm.js.map +1 -0
- package/dist/elements/public/ItemForm/index.d.ts +19 -0
- package/dist/elements/public/ItemForm/index.js +21 -0
- package/dist/elements/public/ItemForm/index.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/InternalItemFormCartControl.d.ts +6 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/InternalItemFormCartControl.js +23 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/InternalItemFormCartControl.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/index.d.ts +6 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/index.js +8 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/index.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/InternalItemFormInventoryControl.d.ts +6 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/InternalItemFormInventoryControl.js +31 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/InternalItemFormInventoryControl.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/index.d.ts +5 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/index.js +7 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/index.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/InternalItemFormLineItemDiscountControl.d.ts +6 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/InternalItemFormLineItemDiscountControl.js +48 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/InternalItemFormLineItemDiscountControl.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/index.d.ts +7 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/index.js +9 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/index.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/InternalItemFormShippingControl.d.ts +6 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/InternalItemFormShippingControl.js +32 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/InternalItemFormShippingControl.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/index.d.ts +5 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/index.js +7 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/index.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/InternalItemFormSubscriptionControl.d.ts +6 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/InternalItemFormSubscriptionControl.js +75 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/InternalItemFormSubscriptionControl.js.map +1 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/index.d.ts +8 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/index.js +10 -0
- package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/index.js.map +1 -0
- package/dist/elements/public/ItemForm/types.d.ts +3 -0
- package/dist/elements/public/ItemForm/types.js +2 -0
- package/dist/elements/public/ItemForm/types.js.map +1 -0
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.d.ts +25 -0
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.js +56 -0
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.js.map +1 -0
- package/dist/elements/public/ItemOptionCard/index.d.ts +6 -0
- package/dist/elements/public/ItemOptionCard/index.js +8 -0
- package/dist/elements/public/ItemOptionCard/index.js.map +1 -0
- package/dist/elements/public/ItemOptionCard/types.d.ts +11 -0
- package/dist/elements/public/ItemOptionCard/types.js +2 -0
- package/dist/elements/public/ItemOptionCard/types.js.map +1 -0
- package/dist/elements/public/ItemOptionForm/ItemOptionForm.d.ts +30 -0
- package/dist/elements/public/ItemOptionForm/ItemOptionForm.js +41 -0
- package/dist/elements/public/ItemOptionForm/ItemOptionForm.js.map +1 -0
- package/dist/elements/public/ItemOptionForm/index.d.ts +5 -0
- package/dist/elements/public/ItemOptionForm/index.js +7 -0
- package/dist/elements/public/ItemOptionForm/index.js.map +1 -0
- package/dist/elements/public/ItemOptionForm/types.d.ts +3 -0
- package/dist/elements/public/ItemOptionForm/types.js +2 -0
- package/dist/elements/public/ItemOptionForm/types.js.map +1 -0
- package/dist/elements/public/NucleonElement/NucleonElement.d.ts +7 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js +13 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/Pagination/Pagination.d.ts +3 -1
- package/dist/elements/public/Pagination/Pagination.js +3 -2
- package/dist/elements/public/Pagination/Pagination.js.map +1 -1
- package/dist/elements/public/PaymentCard/PaymentCard.js +1 -1
- package/dist/elements/public/PaymentCard/PaymentCard.js.map +1 -1
- package/dist/elements/public/QueryBuilder/QueryBuilder.d.ts +3 -1
- package/dist/elements/public/QueryBuilder/QueryBuilder.js +2 -1
- package/dist/elements/public/QueryBuilder/QueryBuilder.js.map +1 -1
- package/dist/elements/public/ReportForm/ReportForm.d.ts +48 -0
- package/dist/elements/public/ReportForm/ReportForm.js +391 -0
- package/dist/elements/public/ReportForm/ReportForm.js.map +1 -0
- package/dist/elements/public/ReportForm/index.d.ts +11 -0
- package/dist/elements/public/ReportForm/index.js +13 -0
- package/dist/elements/public/ReportForm/index.js.map +1 -0
- package/dist/elements/public/ReportForm/types.d.ts +17 -0
- package/dist/elements/public/ReportForm/types.js +2 -0
- package/dist/elements/public/ReportForm/types.js.map +1 -0
- package/dist/elements/public/ReportForm/utils.d.ts +16 -0
- package/dist/elements/public/ReportForm/utils.js +73 -0
- package/dist/elements/public/ReportForm/utils.js.map +1 -0
- package/dist/elements/public/ReportsTable/ReportsTable.d.ts +21 -0
- package/dist/elements/public/ReportsTable/ReportsTable.js +101 -0
- package/dist/elements/public/ReportsTable/ReportsTable.js.map +1 -0
- package/dist/elements/public/ReportsTable/index.d.ts +4 -0
- package/dist/elements/public/ReportsTable/index.js +6 -0
- package/dist/elements/public/ReportsTable/index.js.map +1 -0
- package/dist/elements/public/ReportsTable/types.d.ts +3 -0
- package/dist/elements/public/ReportsTable/types.js +2 -0
- package/dist/elements/public/ReportsTable/types.js.map +1 -0
- package/dist/elements/public/ShipmentCard/ShipmentCard.d.ts +22 -0
- package/dist/elements/public/ShipmentCard/ShipmentCard.js +117 -0
- package/dist/elements/public/ShipmentCard/ShipmentCard.js.map +1 -0
- package/dist/elements/public/ShipmentCard/index.d.ts +7 -0
- package/dist/elements/public/ShipmentCard/index.js +9 -0
- package/dist/elements/public/ShipmentCard/index.js.map +1 -0
- package/dist/elements/public/ShipmentCard/types.d.ts +18 -0
- package/dist/elements/public/ShipmentCard/types.js +2 -0
- package/dist/elements/public/ShipmentCard/types.js.map +1 -0
- package/dist/elements/public/Spinner/Spinner.d.ts +4 -2
- package/dist/elements/public/Spinner/Spinner.js +3 -1
- package/dist/elements/public/Spinner/Spinner.js.map +1 -1
- package/dist/elements/public/SwipeActions/SwipeActions.d.ts +13 -0
- package/dist/elements/public/SwipeActions/SwipeActions.js +116 -0
- package/dist/elements/public/SwipeActions/SwipeActions.js.map +1 -0
- package/dist/elements/public/SwipeActions/index.d.ts +2 -0
- package/dist/elements/public/SwipeActions/index.js +4 -0
- package/dist/elements/public/SwipeActions/index.js.map +1 -0
- package/dist/elements/public/Transaction/Transaction.d.ts +13 -0
- package/dist/elements/public/Transaction/Transaction.js +101 -0
- package/dist/elements/public/Transaction/Transaction.js.map +1 -0
- package/dist/elements/public/Transaction/index.d.ts +19 -0
- package/dist/elements/public/Transaction/index.js +21 -0
- package/dist/elements/public/Transaction/index.js.map +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.d.ts +9 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js +69 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js.map +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.d.ts +4 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js +6 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js.map +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/InternalTransactionCustomerControl.d.ts +5 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/InternalTransactionCustomerControl.js +36 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/InternalTransactionCustomerControl.js.map +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/index.d.ts +7 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/index.js +9 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/index.js.map +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.d.ts +11 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.js +61 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.js.map +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.d.ts +6 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.js +8 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.js.map +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.d.ts +8 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js +77 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js.map +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/index.d.ts +4 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/index.js +6 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/index.js.map +1 -0
- package/dist/elements/public/Transaction/types.d.ts +3 -0
- package/dist/elements/public/Transaction/types.js +2 -0
- package/dist/elements/public/Transaction/types.js.map +1 -0
- package/dist/elements/public/WebhookCard/WebhookCard.d.ts +16 -0
- package/dist/elements/public/WebhookCard/WebhookCard.js +36 -0
- package/dist/elements/public/WebhookCard/WebhookCard.js.map +1 -0
- package/dist/elements/public/WebhookCard/index.d.ts +5 -0
- package/dist/elements/public/WebhookCard/index.js +7 -0
- package/dist/elements/public/WebhookCard/index.js.map +1 -0
- package/dist/elements/public/WebhookCard/types.d.ts +3 -0
- package/dist/elements/public/WebhookCard/types.js +2 -0
- package/dist/elements/public/WebhookCard/types.js.map +1 -0
- package/dist/elements/public/WebhookForm/WebhookForm.d.ts +47 -0
- package/dist/elements/public/WebhookForm/WebhookForm.js +101 -0
- package/dist/elements/public/WebhookForm/WebhookForm.js.map +1 -0
- package/dist/elements/public/WebhookForm/index.d.ts +8 -0
- package/dist/elements/public/WebhookForm/index.js +10 -0
- package/dist/elements/public/WebhookForm/index.js.map +1 -0
- package/dist/elements/public/WebhookForm/types.d.ts +3 -0
- package/dist/elements/public/WebhookForm/types.js +2 -0
- package/dist/elements/public/WebhookForm/types.js.map +1 -0
- package/dist/elements/public/WebhookLogCard/WebhookLogCard.d.ts +16 -0
- package/dist/elements/public/WebhookLogCard/WebhookLogCard.js +28 -0
- package/dist/elements/public/WebhookLogCard/WebhookLogCard.js.map +1 -0
- package/dist/elements/public/WebhookLogCard/index.d.ts +4 -0
- package/dist/elements/public/WebhookLogCard/index.js +6 -0
- package/dist/elements/public/WebhookLogCard/index.js.map +1 -0
- package/dist/elements/public/WebhookLogCard/types.d.ts +3 -0
- package/dist/elements/public/WebhookLogCard/types.js +2 -0
- package/dist/elements/public/WebhookLogCard/types.js.map +1 -0
- package/dist/elements/public/WebhookStatusCard/WebhookStatusCard.d.ts +16 -0
- package/dist/elements/public/WebhookStatusCard/WebhookStatusCard.js +41 -0
- package/dist/elements/public/WebhookStatusCard/WebhookStatusCard.js.map +1 -0
- package/dist/elements/public/WebhookStatusCard/index.d.ts +4 -0
- package/dist/elements/public/WebhookStatusCard/index.js +6 -0
- package/dist/elements/public/WebhookStatusCard/index.js.map +1 -0
- package/dist/elements/public/WebhookStatusCard/types.d.ts +3 -0
- package/dist/elements/public/WebhookStatusCard/types.js +2 -0
- package/dist/elements/public/WebhookStatusCard/types.js.map +1 -0
- package/dist/elements/public/index.d.ts +18 -0
- package/dist/elements/public/index.defined.d.ts +18 -0
- package/dist/elements/public/index.defined.js +18 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +18 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/configurable.d.ts +5 -3
- package/dist/mixins/configurable.js +40 -4
- package/dist/mixins/configurable.js.map +1 -1
- package/dist/mixins/inferrable.d.ts +15 -0
- package/dist/mixins/inferrable.js +67 -0
- package/dist/mixins/inferrable.js.map +1 -0
- package/dist/mixins/themeable.js +6832 -13
- package/dist/mixins/themeable.js.map +1 -1
- package/dist/mixins/translatable.d.ts +3 -1
- package/dist/mixins/translatable.js +16 -2
- package/dist/mixins/translatable.js.map +1 -1
- package/package.json +3 -3
- package/dist/cdn/shared-00d6a968.js +0 -1
- package/dist/cdn/shared-027c537d.js +0 -1
- package/dist/cdn/shared-21419f10.js +0 -1
- package/dist/cdn/shared-39e3ae67.js +0 -1
- package/dist/cdn/shared-3f0a9c2c.js +0 -1
- package/dist/cdn/shared-3f965dce.js +0 -1
- package/dist/cdn/shared-5e2fd1c7.js +0 -1
- package/dist/cdn/shared-60d43523.js +0 -1
- package/dist/cdn/shared-63eaded9.js +0 -159
- package/dist/cdn/shared-84d2d490.js +0 -1
- package/dist/cdn/shared-8b20bc23.js +0 -12
- package/dist/cdn/shared-8c8a910c.js +0 -1
- package/dist/cdn/shared-ab71552b.js +0 -1
- package/dist/cdn/shared-ae8cd227.js +0 -1
- package/dist/cdn/shared-ba39823e.js +0 -1
- package/dist/cdn/shared-df730f90.js +0 -1
- package/dist/cdn/shared-e55088b4.js +0 -1
- package/dist/cdn/shared-ecfd3539.js +0 -1
- package/dist/cdn/shared-f2a69797.js +0 -1
- package/dist/cdn/shared-ff79f3f9.js +0 -230
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeable.js","sourceRoot":"","sources":["../../src/mixins/themeable.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,EAA0C,UAAU,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,wBAAqB;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAI/D,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,WAAkB,EACkB,EAAE;IACtC,OAAO,MAAM,gBAAiB,SAAQ,WAAW;QAC/C,MAAM,KAAK,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAqHF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,OAAgB,SAAU,SAAQ,mBAAmB,CACzD,eAAe,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAC5C;CAAG","sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport { CSSResult, CSSResultArray, Constructor, LitElement, css } from 'lit-element';\n\nimport { ResponsiveMixin } from './responsive';\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements';\n\ntype Base = Constructor<LitElement> & { styles?: CSSResult | CSSResultArray | CSSStyleSheet };\n\nexport const ThemeableMixin = <TBase extends Base>(\n BaseElement: TBase\n): TBase & { styles: CSSResultArray } => {\n return class ThemeableElement extends BaseElement {\n static get styles(): CSSResultArray {\n const originalCSS = super.styles;\n\n return [\n ...(originalCSS ? (Array.isArray(originalCSS) ? originalCSS : [originalCSS]) : []),\n css`\n @tailwind base;\n\n * {\n -webkit-tap-highlight-color: transparent;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n :host {\n display: block;\n }\n\n details > summary::-webkit-details-marker {\n display: none;\n }\n\n details > summary {\n list-style: none;\n }\n\n vaadin-select {\n margin-top: -4px;\n margin-bottom: -4px;\n }\n\n vaadin-text-area,\n vaadin-text-field,\n vaadin-date-picker,\n vaadin-email-field,\n vaadin-number-field,\n vaadin-custom-field,\n vaadin-integer-field,\n vaadin-password-field,\n vaadin-combo-box::part(text-field) {\n padding-top: 0;\n padding-bottom: 0;\n }\n\n vaadin-date-picker::part(text-field) {\n padding-top: 0;\n padding-bottom: 0;\n }\n\n vaadin-button {\n margin: 0;\n }\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n }\n\n vaadin-checkbox::part(label) {\n margin: 0.1875em var(--lumo-space-m);\n }\n\n .appearance-none {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n }\n\n .appearance-none::-webkit-calendar-picker-indicator,\n .appearance-none::-webkit-outer-spin-button,\n .appearance-none::-webkit-inner-spin-button,\n .appearance-none::-webkit-list-button {\n opacity: 0 !important;\n width: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n\n input::-webkit-date-and-time-value {\n text-align: inherit !important;\n }\n\n @tailwind components;\n\n @tailwind utilities;\n\n @layer utilities {\n .border-radius-overflow-fix {\n -webkit-mask-image: -webkit-radial-gradient(white, black);\n }\n\n @variants sm, md, lg, xl {\n .grid-rows-auto {\n grid-auto-rows: 1fr;\n }\n\n .icon-inline {\n --iron-icon-height: 1em;\n --iron-icon-width: 1em;\n }\n\n .bg-blurred {\n backdrop-filter: blur(25px);\n background: var(--lumo-tint-80pct);\n }\n\n .max-w-modal {\n max-width: 28rem;\n }\n\n .w-narrow-modal {\n width: 18rem;\n }\n\n .snap-x-mandatory {\n scroll-snap-type: x mandatory;\n }\n\n .snap-start {\n scroll-snap-align: start;\n }\n }\n }\n `,\n ];\n }\n };\n};\n\n/**\n * One of the base classes for each rel-specific element in the collection\n * providing shared TailwindCSS styles for Shadow DOM content.\n * This class MUST NOT be used on its own (hence the `abstract` keyword) or\n * referenced externally (outside of the package).\n *\n * @deprecated\n */\nexport abstract class Themeable extends ScopedElementsMixin(\n ResponsiveMixin(ThemeableMixin(LitElement))\n) {}\n"]}
|
|
1
|
+
{"version":3,"file":"themeable.js","sourceRoot":"","sources":["../../src/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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAOF,CACF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,OAAgB,SAAU,SAAQ,mBAAmB,CACzD,eAAe,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAC5C;CAAG","sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport { CSSResult, CSSResultArray, Constructor, LitElement, css } from 'lit-element';\n\nimport { ResponsiveMixin } from './responsive';\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { registerStyles } from '@vaadin/vaadin-themable-mixin/register-styles';\n\ntype Base = Constructor<LitElement> & { styles?: CSSResult | CSSResultArray | CSSStyleSheet };\n\nexport const ThemeableMixin = <TBase extends Base>(\n BaseElement: TBase\n): TBase & { styles: CSSResultArray } => {\n return class ThemeableElement extends BaseElement {\n static get styles(): CSSResultArray {\n const originalCSS = super.styles;\n\n return [\n ...(originalCSS ? (Array.isArray(originalCSS) ? originalCSS : [originalCSS]) : []),\n css`\n @tailwind base;\n\n * {\n -webkit-tap-highlight-color: transparent;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n :host {\n display: block;\n color: var(--lumo-body-text-color);\n line-height: var(--lumo-line-height-m);\n font: normal var(--lumo-font-size-m) var(--lumo-font-family);\n }\n\n details > summary::-webkit-details-marker {\n display: none;\n }\n\n details > summary {\n list-style: none;\n }\n\n vaadin-select {\n margin-top: -4px;\n margin-bottom: -4px;\n }\n\n vaadin-text-area,\n vaadin-text-field,\n vaadin-date-picker,\n vaadin-email-field,\n vaadin-number-field,\n vaadin-custom-field,\n vaadin-integer-field,\n vaadin-password-field,\n vaadin-checkbox-group,\n vaadin-radio-group,\n vaadin-combo-box::part(text-field),\n vaadin-date-picker::part(text-field) {\n padding-top: 0;\n padding-bottom: 0;\n }\n\n vaadin-time-picker,\n vaadin-date-time-picker {\n width: 100%;\n }\n\n vaadin-button,\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n }\n\n vaadin-checkbox::part(label) {\n margin: 0.1875em var(--lumo-space-m);\n }\n\n .appearance-none {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n }\n\n .appearance-none::-webkit-calendar-picker-indicator,\n .appearance-none::-webkit-outer-spin-button,\n .appearance-none::-webkit-inner-spin-button,\n .appearance-none::-webkit-list-button {\n opacity: 0 !important;\n width: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n\n input::-webkit-date-and-time-value {\n text-align: inherit !important;\n }\n\n @tailwind components;\n\n @tailwind utilities;\n\n @layer utilities {\n .border-radius-overflow-fix {\n -webkit-mask-image: -webkit-radial-gradient(white, black);\n }\n\n @variants sm, md, lg, xl {\n .grid-rows-auto {\n grid-auto-rows: 1fr;\n }\n\n .icon-inline {\n --iron-icon-height: 1em;\n --iron-icon-width: 1em;\n }\n\n .bg-blurred {\n backdrop-filter: blur(25px);\n background: var(--lumo-tint-80pct);\n }\n\n .max-w-modal {\n max-width: 28rem;\n }\n\n .w-narrow-modal {\n width: 18rem;\n }\n\n .snap-x-mandatory {\n scroll-snap-type: x mandatory;\n }\n\n .snap-start {\n scroll-snap-align: start;\n }\n }\n }\n `,\n ];\n }\n };\n};\n\nregisterStyles(\n 'vaadin-date-time-picker',\n css`\n vaadin-date-time-picker-custom-field {\n --lumo-text-field-size: auto;\n padding: 0;\n }\n\n vaadin-date-time-picker-custom-field::part(label) {\n padding-bottom: 0.5em;\n }\n `\n);\n\nregisterStyles(\n 'vaadin-date-time-picker-date-picker',\n css`\n :host {\n --lumo-text-field-size: auto;\n }\n vaadin-date-time-picker-date-text-field {\n padding: 0;\n }\n `\n);\n\nregisterStyles(\n 'vaadin-date-time-picker-time-picker',\n css`\n :host {\n --lumo-text-field-size: auto;\n }\n vaadin-date-time-picker-time-text-field {\n padding: 0;\n }\n `\n);\n\n/**\n * One of the base classes for each rel-specific element in the collection\n * providing shared TailwindCSS styles for Shadow DOM content.\n * This class MUST NOT be used on its own (hence the `abstract` keyword) or\n * referenced externally (outside of the package).\n *\n * @deprecated\n */\nexport abstract class Themeable extends ScopedElementsMixin(\n ResponsiveMixin(ThemeableMixin(LitElement))\n) {}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Constructor, LitElement, PropertyDeclarations } from 'lit-element';
|
|
2
2
|
import { StringMap, TFunction, i18n } from 'i18next';
|
|
3
3
|
import { Themeable } from './themeable';
|
|
4
|
+
import { InferrableMixinHost } from './inferrable';
|
|
4
5
|
/**
|
|
5
6
|
* One of the base classes for each rel-specific element in the collection,
|
|
6
7
|
* providing internationalization capabilities to the derived components.
|
|
@@ -64,8 +65,9 @@ export declare abstract class Translatable extends Themeable {
|
|
|
64
65
|
protected get _isI18nReady(): boolean;
|
|
65
66
|
protected get _t(): TFunction;
|
|
66
67
|
}
|
|
67
|
-
declare type Base = Constructor<LitElement> & {
|
|
68
|
+
declare type Base = Constructor<InferrableMixinHost> & Constructor<LitElement> & {
|
|
68
69
|
properties?: PropertyDeclarations;
|
|
70
|
+
inferredProperties: string[];
|
|
69
71
|
};
|
|
70
72
|
declare type Translator = (key: string, options?: StringMap) => string;
|
|
71
73
|
export declare class TranslatableMixinHost {
|
|
@@ -157,9 +157,11 @@ export const TranslatableMixin = (BaseElement, defaultNS = '') => {
|
|
|
157
157
|
if (!I18nElement)
|
|
158
158
|
return key;
|
|
159
159
|
const keys = [
|
|
160
|
-
...
|
|
160
|
+
...this.ns
|
|
161
|
+
.split(' ')
|
|
162
|
+
.reverse()
|
|
161
163
|
.map(v => v.trim())
|
|
162
|
-
.filter(
|
|
164
|
+
.filter(v => v.length > 0)
|
|
163
165
|
.reverse()
|
|
164
166
|
.map((v, i, a) => `${v}:${[...a.slice(i + 1), key].join('.')}`),
|
|
165
167
|
`shared:${key}`,
|
|
@@ -167,6 +169,9 @@ export const TranslatableMixin = (BaseElement, defaultNS = '') => {
|
|
|
167
169
|
return I18nElement.i18next.t(keys, { lng: this.lang, ...options }).toString();
|
|
168
170
|
};
|
|
169
171
|
}
|
|
172
|
+
static get inferredProperties() {
|
|
173
|
+
return [...super.inferredProperties, 'lang', 'ns'];
|
|
174
|
+
}
|
|
170
175
|
static get properties() {
|
|
171
176
|
return {
|
|
172
177
|
...super.properties,
|
|
@@ -198,6 +203,15 @@ export const TranslatableMixin = (BaseElement, defaultNS = '') => {
|
|
|
198
203
|
super.disconnectedCallback();
|
|
199
204
|
(_a = this.__untrackTranslations) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
200
205
|
}
|
|
206
|
+
applyInferredProperties(context) {
|
|
207
|
+
super.applyInferredProperties(context);
|
|
208
|
+
if (this.infer === null)
|
|
209
|
+
return;
|
|
210
|
+
const lang = context.get('lang');
|
|
211
|
+
const ns = context.get('ns');
|
|
212
|
+
this.lang = lang !== null && lang !== void 0 ? lang : '';
|
|
213
|
+
this.ns = ns ? `${ns} ${this.infer}`.trim() : defaultNS;
|
|
214
|
+
}
|
|
201
215
|
};
|
|
202
216
|
};
|
|
203
217
|
//# sourceMappingURL=translatable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translatable.js","sourceRoot":"","sources":["../../src/mixins/translatable.ts"],"names":[],"mappings":"AACA,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F,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1F,CAAC;QAED,oBAAoB;;YAClB,KAAK,CAAC,oBAAoB,EAAE,CAAC;YAC7B,MAAA,IAAI,CAAC,qBAAqB,+CAA1B,IAAI,EAA2B;QACjC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Constructor, LitElement, PropertyDeclarations } from 'lit-element';\nimport i18next, { FormatFunction, StringMap, TFunction, i18n } from 'i18next';\n\nimport HttpApi from 'i18next-http-backend';\nimport { I18n } from '../elements/public/I18n/I18n';\nimport { Themeable } from './themeable';\nimport { cdn } from '../env';\n\n/**\n * One of the base classes for each rel-specific element in the collection,\n * providing internationalization capabilities to the derived components.\n * This class MUST NOT be used on its own (hence the `abstract` keyword) or\n * referenced externally (outside of the package).\n *\n * @deprecated\n */\nexport abstract class Translatable extends Themeable {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n lang: { type: String, noAccessor: true },\n ns: { type: String, noAccessor: true },\n };\n }\n\n /**\n * i18next formatter that converts given value to lowecase.\n * @see https://www.i18next.com/translation-function/formatting\n */\n private static __fLowercase: FormatFunction = (value): string => {\n return value.toLowerCase();\n };\n\n /**\n * i18next formatter that presents an array of serializable items\n * as `[0], [1], [...] and [length - 1]`. For example, given an array like\n * the following: `['a', 'b', 'c']`, it will output `'a, b and c'`.\n * @see https://www.i18next.com/translation-function/formatting\n */\n private static __fList: FormatFunction = (value): string => {\n return (value as string[])\n .map((v, i, a) => {\n if (i === 0) return v;\n const part = i === a.length - 1 ? ` $t(and) ` : ',';\n return `${part} ${v}`;\n })\n .join('');\n };\n\n /**\n * Chooses the right i18next formatter for the given template.\n * @see https://www.i18next.com/translation-function/formatting\n */\n private static __f: FormatFunction = (...args): string => {\n const value = args[0];\n const formats = args[1]?.split(' ') ?? [];\n\n return formats.reduce((result, format) => {\n switch (format) {\n case 'lowercase':\n return Translatable.__fLowercase(result);\n case 'list':\n return Translatable.__fList(result);\n default:\n return result;\n }\n }, value);\n };\n\n private static __whenI18NReady: Promise<TFunction>;\n\n private static __isI18NReady = false;\n\n private static __i18n: i18n;\n\n private __lang = (this._i18n.options.fallbackLng as string[])[0];\n\n private __ns = (this._i18n.options.fallbackNS as string[])[0];\n\n /**\n * Creates class instance and starts loading missing translations\n * in background. Triggers render when ready.\n *\n * @param defaultNS Name of the folder translations for this component are stored in. Usually a node name without vendor prefix.\n */\n constructor(defaultNS = 'global') {\n super();\n this.ns = defaultNS;\n this._whenI18nReady.then(() => this.requestUpdate());\n }\n\n /**\n * Contains the language this component presents its translatable\n * content in. Assigning a value to this property will load new\n * translations in background and trigger a render afterwards.\n *\n * **Example:** `\"en\"`\n */\n public get lang(): string {\n return this.__lang;\n }\n\n public set lang(value: string) {\n if (!value || value === 'undefined') return;\n this.__lang = value;\n this._i18n.loadLanguages(value).then(() => {\n if (this.__lang === value) this.requestUpdate();\n });\n }\n\n /**\n * The namespace to look for the translations in. We use this property to\n * sync namespace settings with the parent element and it's highly unlikely\n * that you'll ever need to set or read it in your code.\n *\n * **Example:** `\"admin\"`\n */\n public get ns(): string {\n return this.__ns;\n }\n\n public set ns(value: string) {\n this.__ns = value;\n this._i18n.loadNamespaces(value).then(() => {\n if (this.__ns === value) this.requestUpdate();\n });\n }\n\n private static __initI18N() {\n this.__i18n = i18next.createInstance();\n this.__i18n.use(HttpApi);\n\n this.__whenI18NReady = this.__i18n.init({\n ns: ['global'],\n supportedLngs: ['nl', 'en', 'es', 'sv', 'fi', 'fr', 'de', 'zh', 'no', 'it', 'pl'],\n interpolation: { format: Translatable.__f },\n fallbackLng: 'en',\n fallbackNS: 'global',\n defaultNS: 'global',\n detection: {\n order: ['querystring', 'navigator', 'htmlTag', 'path', 'subdomain'],\n caches: [],\n },\n backend: {\n loadPath: `${cdn}/translations/{{ns}}/{{lng}}.json`,\n },\n });\n\n this.__whenI18NReady.then(() => (this.__isI18NReady = true));\n\n return this.__i18n;\n }\n\n protected get _i18n(): i18n {\n return Translatable.__i18n ?? Translatable.__initI18N();\n }\n\n protected get _whenI18nReady(): Promise<TFunction> {\n return Translatable.__whenI18NReady;\n }\n\n protected get _isI18nReady(): boolean {\n return Translatable.__isI18NReady;\n }\n\n protected get _t(): TFunction {\n const ns = [this.__ns, this._i18n.options.fallbackNS as string];\n return this._i18n.getFixedT(this.__lang, ns);\n }\n}\n\ntype Base = Constructor<LitElement> & { properties?: PropertyDeclarations };\ntype Translator = (key: string, options?: StringMap) => string;\n\nexport declare class TranslatableMixinHost {\n /** Optional ISO 639-1 code describing the language element content is written in. */\n lang: string;\n\n /**\n * Namespace used by this element.\n * @since 1.4.0\n */\n ns: string;\n\n /**\n * Translation function from i18next fixed to the current language and element namespace.\n * @since 1.4.0\n */\n get t(): Translator;\n}\n\nexport const TranslatableMixin = <T extends Base>(\n BaseElement: T,\n defaultNS = ''\n): T & Constructor<TranslatableMixinHost> & { defaultNS: string } => {\n return class TranslatableElement extends BaseElement {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n lang: { type: String },\n ns: { type: String },\n };\n }\n\n static get defaultNS(): string {\n return defaultNS;\n }\n\n lang = '';\n\n ns = defaultNS;\n\n t: Translator = (key, options) => {\n const I18nElement = customElements.get('foxy-i18n') as typeof I18n | undefined;\n\n if (!I18nElement) return key;\n\n const keys = [\n ...[defaultNS, ...this.ns.split(' ').reverse()]\n .map(v => v.trim())\n .filter((v, i, a) => a.indexOf(v) === i && v.length > 0)\n .reverse()\n .map((v, i, a) => `${v}:${[...a.slice(i + 1), key].join('.')}`),\n `shared:${key}`,\n ];\n\n return I18nElement.i18next.t(keys, { lng: this.lang, ...options }).toString();\n };\n\n private __untrackTranslations?: () => void;\n\n connectedCallback(): void {\n super.connectedCallback();\n const I18nElement = customElements.get('foxy-i18n') as typeof I18n | undefined;\n this.__untrackTranslations = I18nElement?.onTranslationChange(() => this.requestUpdate());\n }\n\n /** @readonly */\n updated(changedProperties: Map<keyof I18n, unknown>): void {\n super.updated(changedProperties);\n\n const I18nElement = customElements.get('foxy-i18n') as typeof I18n | undefined;\n if (!I18nElement) return;\n\n if (changedProperties.has('lang')) I18nElement.i18next.loadLanguages(this.lang);\n if (changedProperties.has('ns')) I18nElement.i18next.loadNamespaces(this.ns.split(' '));\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.__untrackTranslations?.();\n }\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"translatable.js","sourceRoot":"","sources":["../../src/mixins/translatable.ts"],"names":[],"mappings":"AACA,OAAO,OAAuD,MAAM,SAAS,CAAC;AAE9E,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,uBAAoB;AACxC,OAAO,EAAE,GAAG,EAAE,kBAAe;AAG7B;;;;;;;GAOG;AACH,MAAM,OAAgB,YAAa,SAAQ,SAAS;IA+DlD;;;;;OAKG;IACH,YAAY,SAAS,GAAG,QAAQ;QAC9B,KAAK,EAAE,CAAC;QAXF,WAAM,GAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAwB,CAAC,CAAC,CAAC,CAAC;QAEzD,SAAI,GAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAuB,CAAC,CAAC,CAAC,CAAC;QAU5D,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC;QACpB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IACvD,CAAC;IAxED,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;YACxC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;SAC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C,CAAC","sourcesContent":["import { Constructor, LitElement, PropertyDeclarations } from 'lit-element';\nimport i18next, { FormatFunction, StringMap, TFunction, i18n } from 'i18next';\n\nimport HttpApi from 'i18next-http-backend';\nimport { I18n } from '../elements/public/I18n/I18n';\nimport { Themeable } from './themeable';\nimport { cdn } from '../env';\nimport { InferrableMixinHost } from './inferrable';\n\n/**\n * One of the base classes for each rel-specific element in the collection,\n * providing internationalization capabilities to the derived components.\n * This class MUST NOT be used on its own (hence the `abstract` keyword) or\n * referenced externally (outside of the package).\n *\n * @deprecated\n */\nexport abstract class Translatable extends Themeable {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n lang: { type: String, noAccessor: true },\n ns: { type: String, noAccessor: true },\n };\n }\n\n /**\n * i18next formatter that converts given value to lowecase.\n * @see https://www.i18next.com/translation-function/formatting\n */\n private static __fLowercase: FormatFunction = (value): string => {\n return value.toLowerCase();\n };\n\n /**\n * i18next formatter that presents an array of serializable items\n * as `[0], [1], [...] and [length - 1]`. For example, given an array like\n * the following: `['a', 'b', 'c']`, it will output `'a, b and c'`.\n * @see https://www.i18next.com/translation-function/formatting\n */\n private static __fList: FormatFunction = (value): string => {\n return (value as string[])\n .map((v, i, a) => {\n if (i === 0) return v;\n const part = i === a.length - 1 ? ` $t(and) ` : ',';\n return `${part} ${v}`;\n })\n .join('');\n };\n\n /**\n * Chooses the right i18next formatter for the given template.\n * @see https://www.i18next.com/translation-function/formatting\n */\n private static __f: FormatFunction = (...args): string => {\n const value = args[0];\n const formats = args[1]?.split(' ') ?? [];\n\n return formats.reduce((result, format) => {\n switch (format) {\n case 'lowercase':\n return Translatable.__fLowercase(result);\n case 'list':\n return Translatable.__fList(result);\n default:\n return result;\n }\n }, value);\n };\n\n private static __whenI18NReady: Promise<TFunction>;\n\n private static __isI18NReady = false;\n\n private static __i18n: i18n;\n\n private __lang = (this._i18n.options.fallbackLng as string[])[0];\n\n private __ns = (this._i18n.options.fallbackNS as string[])[0];\n\n /**\n * Creates class instance and starts loading missing translations\n * in background. Triggers render when ready.\n *\n * @param defaultNS Name of the folder translations for this component are stored in. Usually a node name without vendor prefix.\n */\n constructor(defaultNS = 'global') {\n super();\n this.ns = defaultNS;\n this._whenI18nReady.then(() => this.requestUpdate());\n }\n\n /**\n * Contains the language this component presents its translatable\n * content in. Assigning a value to this property will load new\n * translations in background and trigger a render afterwards.\n *\n * **Example:** `\"en\"`\n */\n public get lang(): string {\n return this.__lang;\n }\n\n public set lang(value: string) {\n if (!value || value === 'undefined') return;\n this.__lang = value;\n this._i18n.loadLanguages(value).then(() => {\n if (this.__lang === value) this.requestUpdate();\n });\n }\n\n /**\n * The namespace to look for the translations in. We use this property to\n * sync namespace settings with the parent element and it's highly unlikely\n * that you'll ever need to set or read it in your code.\n *\n * **Example:** `\"admin\"`\n */\n public get ns(): string {\n return this.__ns;\n }\n\n public set ns(value: string) {\n this.__ns = value;\n this._i18n.loadNamespaces(value).then(() => {\n if (this.__ns === value) this.requestUpdate();\n });\n }\n\n private static __initI18N() {\n this.__i18n = i18next.createInstance();\n this.__i18n.use(HttpApi);\n\n this.__whenI18NReady = this.__i18n.init({\n ns: ['global'],\n supportedLngs: ['nl', 'en', 'es', 'sv', 'fi', 'fr', 'de', 'zh', 'no', 'it', 'pl'],\n interpolation: { format: Translatable.__f },\n fallbackLng: 'en',\n fallbackNS: 'global',\n defaultNS: 'global',\n detection: {\n order: ['querystring', 'navigator', 'htmlTag', 'path', 'subdomain'],\n caches: [],\n },\n backend: {\n loadPath: `${cdn}/translations/{{ns}}/{{lng}}.json`,\n },\n });\n\n this.__whenI18NReady.then(() => (this.__isI18NReady = true));\n\n return this.__i18n;\n }\n\n protected get _i18n(): i18n {\n return Translatable.__i18n ?? Translatable.__initI18N();\n }\n\n protected get _whenI18nReady(): Promise<TFunction> {\n return Translatable.__whenI18NReady;\n }\n\n protected get _isI18nReady(): boolean {\n return Translatable.__isI18NReady;\n }\n\n protected get _t(): TFunction {\n const ns = [this.__ns, this._i18n.options.fallbackNS as string];\n return this._i18n.getFixedT(this.__lang, ns);\n }\n}\n\ntype Base = Constructor<InferrableMixinHost> &\n Constructor<LitElement> & { properties?: PropertyDeclarations; inferredProperties: string[] };\n\ntype Translator = (key: string, options?: StringMap) => string;\n\nexport declare class TranslatableMixinHost {\n /** Optional ISO 639-1 code describing the language element content is written in. */\n lang: string;\n\n /**\n * Namespace used by this element.\n * @since 1.4.0\n */\n ns: string;\n\n /**\n * Translation function from i18next fixed to the current language and element namespace.\n * @since 1.4.0\n */\n get t(): Translator;\n}\n\nexport const TranslatableMixin = <T extends Base>(\n BaseElement: T,\n defaultNS = ''\n): T & Constructor<TranslatableMixinHost> & { defaultNS: string } => {\n return class TranslatableElement extends BaseElement {\n static get inferredProperties(): string[] {\n return [...super.inferredProperties, 'lang', 'ns'];\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n lang: { type: String },\n ns: { type: String },\n };\n }\n\n static get defaultNS(): string {\n return defaultNS;\n }\n\n lang = '';\n\n ns = defaultNS;\n\n t: Translator = (key, options) => {\n const I18nElement = customElements.get('foxy-i18n') as typeof I18n | undefined;\n\n if (!I18nElement) return key;\n\n const keys = [\n ...this.ns\n .split(' ')\n .reverse()\n .map(v => v.trim())\n .filter(v => v.length > 0)\n .reverse()\n .map((v, i, a) => `${v}:${[...a.slice(i + 1), key].join('.')}`),\n `shared:${key}`,\n ];\n\n return I18nElement.i18next.t(keys, { lng: this.lang, ...options }).toString();\n };\n\n private __untrackTranslations?: () => void;\n\n connectedCallback(): void {\n super.connectedCallback();\n const I18nElement = customElements.get('foxy-i18n') as typeof I18n | undefined;\n this.__untrackTranslations = I18nElement?.onTranslationChange(() => this.requestUpdate());\n }\n\n /** @readonly */\n updated(changedProperties: Map<keyof I18n, unknown>): void {\n super.updated(changedProperties);\n\n const I18nElement = customElements.get('foxy-i18n') as typeof I18n | undefined;\n if (!I18nElement) return;\n\n if (changedProperties.has('lang')) I18nElement.i18next.loadLanguages(this.lang);\n if (changedProperties.has('ns')) I18nElement.i18next.loadNamespaces(this.ns.split(' '));\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.__untrackTranslations?.();\n }\n\n applyInferredProperties(context: Map<string, unknown>): void {\n super.applyInferredProperties(context);\n if (this.infer === null) return;\n\n const lang = context.get('lang') as string | undefined;\n const ns = context.get('ns') as string | undefined;\n\n this.lang = lang ?? '';\n this.ns = ns ? `${ns} ${this.infer}`.trim() : defaultNS;\n }\n };\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foxy.io/elements",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.16.0-beta.11",
|
|
5
5
|
"description": "E-commerce web components by Foxy.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"format": "npm run format:eslint && npm run format:prettier",
|
|
22
22
|
"format:eslint": "eslint --ext .ts,.html . --fix --ignore-path .gitignore",
|
|
23
23
|
"format:prettier": "prettier \"**/*.js\" \"**/*.ts\" --write --ignore-path .gitignore",
|
|
24
|
-
"test": "wtr src
|
|
24
|
+
"test": "wtr src/elements/public/ReportCard/ReportCard.test.ts --debug=true",
|
|
25
25
|
"test:watch": "wtr src/**/*.test.ts --watch",
|
|
26
26
|
"prepack": "npm run lint && rimraf dist && node ./.build/compile-for-npm.js && rollup -c"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@foxy.io/sdk": "^1.
|
|
29
|
+
"@foxy.io/sdk": "^1.9.1",
|
|
30
30
|
"@open-wc/lit-helpers": "^0.3.11",
|
|
31
31
|
"@open-wc/scoped-elements": "1.2.1",
|
|
32
32
|
"@polymer/iron-icons": "^3.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./shared-5a54a9bc.js";import"./shared-84d2d490.js";import{_ as t,h as e}from"./shared-63eaded9.js";import{D as s}from"./shared-3f0a9c2c.js";let i,n=t=>t;customElements.define("foxy-internal-confirm-dialog",class extends s{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.alert=!0,this.confirm="confirm",this.message="message",this.cancel="cancel",this.theme="primary"}static get properties(){return t(t({},super.properties),{},{confirm:{type:String},message:{type:String},cancel:{type:String},theme:{type:String}})}render(){return super.render((()=>e(i||(i=n` <foxy-i18n class="block font-lumo text-m text-body text-center mb-m" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> <vaadin-button data-testid="cancelButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> <vaadin-button theme="${0}" data-testid="confirmButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> </div> `),this.lang,this.message,this.ns,this.__handleCancel,this.ns,this.lang,this.cancel,this.theme,this.__handleConfirm,this.ns,this.lang,this.confirm)))}async __handleCancel(){await this.hide(!0)}async __handleConfirm(){await this.hide()}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L as e,_ as s,h as t}from"./shared-63eaded9.js";import{b as r}from"./shared-ae8cd227.js";let a,o=e=>e;class d extends e{constructor(){super(...arguments),this.frame=!1}static get properties(){return s(s({},super.properties),{},{frame:{type:Boolean}})}static get styles(){return r.styles}render(){return t(a||(a=o` <section class="space-y-s font-lumo antialiased"> <h3 class="${0}"> <slot name="header"></slot> </h3> <div class="rounded-t-l rounded-b-l ${0}"> <slot></slot> </div> </section> `),"text-s font-medium text-secondary leading-none "+(this.frame?"":"pl-m"),this.frame?"border border-contrast-10 overflow-hidden":"")}}export{d as G};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,g as t,L as r,_ as n,h as s}from"./shared-63eaded9.js";import{A as o}from"./shared-448781f9.js";import"./shared-59e44f29.js";import{C as i}from"./shared-df730f90.js";import{F as a}from"./shared-5535f38f.js";var u=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatCookie=void 0;var r=function(e){var t=e.path,r=e.domain,n=e.expires,s=e.secure,o=function(e){var t=e.sameSite;return void 0===t?null:["none","lax","strict"].indexOf(t.toLowerCase())>=0?t:null}(e);return[null==t?"":";path="+t,null==r?"":";domain="+r,null==n?"":";expires="+n.toUTCString(),void 0===s||!1===s?"":";secure",null===o?"":";SameSite="+o].join("")};t.formatCookie=function(e,t,n){return[encodeURIComponent(e),"=",encodeURIComponent(t),r(n)].join("")}})),c=e((function(e,t){function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,s=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){s=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(s)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}Object.defineProperty(t,"__esModule",{value:!0}),t.parseCookies=void 0;t.parseCookies=function(e){if(0===e.length)return{};var t={},n=new RegExp("\\s*;\\s*");return e.split(n).forEach((function(e){var n=r(e.split("="),2),s=n[0],o=n[1],i=decodeURIComponent(s),a=decodeURIComponent(o);t[i]=a})),t}})),l=e((function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.CookieStorage=void 0;var n=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaultOptions=Object.assign({domain:null,expires:null,path:null,secure:!1},t),"undefined"!=typeof Proxy)return new Proxy(this,s)}var t,n,o;return t=e,(n=[{key:"clear",value:function(){var e=this,t=c.parseCookies(this._getCookie());Object.keys(t).forEach((function(t){return e.removeItem(t)}))}},{key:"getItem",value:function(e){var t=c.parseCookies(this._getCookie());return Object.prototype.hasOwnProperty.call(t,e)?t[e]:null}},{key:"key",value:function(e){var t=c.parseCookies(this._getCookie()),r=Object.keys(t).sort();return e<r.length?r[e]:null}},{key:"removeItem",value:function(e,t){var r=Object.assign(Object.assign(Object.assign({},this._defaultOptions),t),{expires:new Date(0)}),n=u.formatCookie(e,"",r);this._setCookie(n)}},{key:"setItem",value:function(e,t,r){var n=Object.assign(Object.assign({},this._defaultOptions),r),s=u.formatCookie(e,t,n);this._setCookie(s)}},{key:"_getCookie",value:function(){return"undefined"==typeof document||void 0===document.cookie?"":document.cookie}},{key:"_setCookie",value:function(e){document.cookie=e}},{key:"length",get:function(){var e=c.parseCookies(this._getCookie());return Object.keys(e).length}}])&&r(t.prototype,n),o&&r(t,o),e}();t.CookieStorage=n;var s={defineProperty:function(e,t,r){return e.setItem(t.toString(),String(r.value)),!0},deleteProperty:function(e,t){return e.removeItem(t.toString()),!0},get:function(e,t,r){if("string"==typeof t&&t in e)return e[t];var n=e.getItem(t.toString());return null!==n?n:void 0},getOwnPropertyDescriptor:function(e,t){if(!(t in e))return{configurable:!0,enumerable:!0,value:e.getItem(t.toString()),writable:!0}},has:function(e,t){return"string"==typeof t&&t in e||null!==e.getItem(t.toString())},ownKeys:function(e){for(var t=[],r=0;r<e.length;r++){var n=e.key(r);null!==n&&t.push(n)}return t},preventExtensions:function(e){throw new TypeError("can't prevent extensions on this proxy object")},set:function(e,t,r,n){return e.setItem(t.toString(),String(r)),!0}}})),f=t(e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CookieStorage",{enumerable:!0,get:function(){return l.CookieStorage}}),Object.defineProperty(t,"formatCookie",{enumerable:!0,get:function(){return u.formatCookie}}),Object.defineProperty(t,"parseCookies",{enumerable:!0,get:function(){return c.parseCookies}})})));class p extends f.CookieStorage{constructor(){super({sameSite:"Strict",expires:new Date,secure:!0,domain:location.hostname,path:"/"})}getItem(e){if(e===o.SESSION){const e=super.getItem("fx.customer"),t=super.getItem("fx.customer.duration"),r=super.getItem("fx.customer.start"),n=super.getItem("fx.customer.jwt");if(null===e||null===t||null===r||null===n)return null;const s={session_token:e,date_created:r,expires_in:parseInt(t),jwt:n},o=super.getItem("fx.customer.sso");return null!==o&&(s.sso=o),JSON.stringify(s)}return super.getItem(e)}setItem(e,t,r){if(e!==o.SESSION)return super.setItem(e,t,r);{const e=JSON.parse(t),r=1e3*e.expires_in,n=new Date(new Date(e.date_created).getTime()+r);super.setItem("fx.customer",e.session_token,{expires:n}),super.setItem("fx.customer.jwt",e.jwt,{expires:n}),super.setItem("fx.customer.start",e.date_created,{expires:n}),super.setItem("fx.customer.duration",String(e.expires_in),{expires:n}),e.sso&&super.setItem("fx.customer.sso",e.sso,{expires:n})}}clear(){for(let e=0;e<this.length;){const t=super.key(e);t.startsWith("fx.customer")?super.removeItem(t):e++}}}const h=new p;let d,m=e=>e;class g extends(i(r)){constructor(){var e;super(...arguments),e=this,this.__storage="local",this.__level=0,this.__base=location.origin,this.__api=this.__createAPIInstance(),this.__handleFetch=async function(t){if(!(t instanceof a))return;if(t.defaultPrevented)return;if(t.composedPath()[0]===e)return;t.preventDefault();const r=new a("fetch",{cancelable:!0,composed:!0,request:t.request,bubbles:!0,reject:e=>t.respondWith(Promise.reject(e)),resolve:n=>{"foxy://customer-api/session"===r.request.url&&e.requestUpdate(),401===n.status&&e.requestUpdate(),t.respondWith(Promise.resolve(n))}});e.dispatchEvent(r)&&r.respondWith(e.__handleRequest(r.request))}}static get properties(){return n(n({},super.properties),{},{storage:{type:String,noAccessor:!0},level:{type:Number,noAccessor:!0},base:{type:String,noAccessor:!0}})}get isLoggedIn(){return!!this.api.storage.getItem(o.SESSION)}get api(){return this.__api}get base(){return this.__base}set base(e){this.__base=e,this.__api=this.__createAPIInstance()}get level(){return this.__level}set level(e){this.__level=e,this.__api=this.__createAPIInstance()}get storage(){return this.__storage}set storage(e){this.__storage=e,this.__api=this.__createAPIInstance()}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__handleFetch)}render(){return s(d||(d=m` ${0} <slot></slot> `),this.renderTemplateOrSlot(this.isLoggedIn?"logged-in":"logged-out"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("fetch",this.__handleFetch)}__createAPIInstance(){const e={session:sessionStorage,cookie:h,local:localStorage};return new o({storage:e[this.storage],level:this.level,base:new URL(this.base)})}async __handleVirtualAuthSessionDelete(){return await this.api.signOut(),this.dispatchEvent(new g.SignOutEvent("signout")),this.requestUpdate(),new Response}async __handleVirtualAuthSessionPost(e){const t=await e.clone().json();if("password"!==t.type)throw new Error(`Unknown payload type ${t.type}`);let r,s;try{await this.api.signIn(t.credential),this.dispatchEvent(new g.SignInEvent("signin")),this.requestUpdate(),r=200,s=n({_links:{self:{href:e.url}}},t)}catch(e){if(!(e instanceof o.AuthError))throw e;if("UNAUTHORIZED"!==e.code)throw e;r=401,s={total:1,_embedded:{"fx:errors":[{message:e.message,logref:"unavailable",code:"invalid_credential_error"}]}}}return new Response(JSON.stringify(s),{status:r})}async __handleVirtualAuthRecoverPost(e){const t=await e.clone().json();if("email"===t.type)return await this.api.sendPasswordResetEmail(t.detail),new Response(JSON.stringify({_links:{self:{href:e.url}},email:t.email}));throw new Error(`Unknown payload type ${t.type}`)}async __handleRequest(e){const t=e.url,r=e.method;try{if("foxy://customer-api/session"===t){if("DELETE"===r)return this.__handleVirtualAuthSessionDelete();if("POST"===r)return this.__handleVirtualAuthSessionPost(e)}if("foxy://customer-api/recover"===t&&"POST"===r)return this.__handleVirtualAuthRecoverPost(e);const n=await this.api.fetch(e);return 401===n.status&&(this.api.storage.clear(),this.dispatchEvent(new g.SignOutEvent("signout")),this.requestUpdate()),n}catch(e){return new Response(null,{status:500})}}}g.SignOutEvent=class extends CustomEvent{},g.SignInEvent=class extends CustomEvent{};export{g as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L as e,_ as t}from"./shared-63eaded9.js";import{t as s,m as r,a as i,b as n,R as h,F as o}from"./shared-5535f38f.js";import{A as a}from"./shared-7f0a9790.js";import{U as _}from"./shared-7684cb05.js";import{i as u}from"./shared-756034e4.js";function d(e,t){let r=null;return s(t).forEach((function(){var t,s,i,n,h,o,a,_,u,d,c;if(null===(i=null===(s=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===s?void 0:s.self)||void 0===i?void 0:i.href){const t=null===(o=null===(h=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===h?void 0:h.self)||void 0===o?void 0:o.href,s=new URL(null===(u=null===(_=null===(a=this.node)||void 0===a?void 0:a._links)||void 0===_?void 0:_.self)||void 0===u?void 0:u.href);if(s.searchParams.delete("zoom"),e===t||e===s.toString())return r=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(c=null===(d=this.node)||void 0===d?void 0:d._links)&&void 0!==c?c:{}).some((([t,s])=>{var i,n;if(s.href!==e)return!1;const h=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!h||!Array.isArray(h))return!1;const o=h.length<20?h.length:21,a=new URL(e),_=new URL(e);return a.searchParams.set("offset",h.length.toString()),_.searchParams.set("offset",o.toString()),r=JSON.stringify({returned_items:h.length,total_items:o,offset:0,limit:20,_embedded:{[t]:h},_links:{curies:this.node._links.curies,first:{href:e},last:{href:_.toString()},prev:{href:e},next:{href:a.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(r,{status:r?200:404})}class c extends e{constructor(){super(...arguments),this.lang="",this.parent="",this.related=[],this.__href="",this.__group="",this.__fetchEventQueue=[],this.__service=u(i.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:n({errors:e=>{const s=this.constructor.v8n,r=t(t({},e.data),e.edits);return s.map((e=>e(r))).filter((e=>"string"==typeof e)).filter(((e,t,s)=>s.indexOf(e)===t))}})}}))}static get properties(){return{related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){return this.__service.state.context.failure}get errors(){return this.__service.state.context.errors}get form(){const{data:e,edits:s}=this.__service.state.context;return t(t({},e),s)}get data(){return this.__service.state.context.data}set data(e){var t;this.__service.send({type:"SET_DATA",data:e}),this.__href=null!==(t=null==e?void 0:e._links.self.href)&&void 0!==t?t:""}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){return this.__href}set href(e){this.__href=e,e?this.__service.send({type:"FETCH"}):this.__service.send({type:"SET_DATA",data:null})}in(e){return this.__service.state.matches(e)}undo(){this.__service.send({type:"UNDO"})}edit(e){this.__service.send({type:"EDIT",data:e})}submit(){this.__service.send({type:"SUBMIT"})}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}connectedCallback(){super.connectedCallback(),this.__createService(),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue()}disconnectedCallback(){super.disconnectedCallback(),this.__destroyService(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected")}async _fetch(...e){const t=await new a(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){this.__destroyRumour();const t=JSON.stringify(e),s=await this._fetch(this.parent,{body:t,method:"POST"}),r=c.Rumour(this.group),i=[...this.related,this.parent];return r.share({data:s,related:i,source:s._links.self.href}),this.__createRumour(),s}async _sendGet(){this.__destroyRumour();const e=await this._fetch(this.href);return c.Rumour(this.group).share({data:e,source:this.href}),this.__createRumour(),e}async _sendPatch(e){this.__destroyRumour();const t=JSON.stringify(e),s=await this._fetch(this.href,{body:t,method:"PATCH"});return c.Rumour(this.group).share({data:s,source:this.href,related:this.related}),this.__createRumour(),s}async _sendDelete(){this.__destroyRumour();const e=await this._fetch(this.href,{method:"DELETE"}),t=c.Rumour(this.group),s=[...this.related,this.parent];return t.share({data:null,source:this.href,related:s}),this.__createRumour(),e}__createService(){this.__service.onTransition((e=>{if(!e.changed)return;const t=e.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);this.setAttribute("state",[...new Set(t)].join(" ")),this.requestUpdate(),this.dispatchEvent(new _),e.matches("busy")||this.__processFetchEventQueue()})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new _)})),this.__service.start()}__destroyService(){this.__service.stop()}__createRumour(){const e=c.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this)}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.data;if(!s)return;const r=e(s);r!==s&&this.__service.send({data:r,type:"SET_DATA"})}catch(e){if(!(e instanceof h.UpdateError))throw e;this.__service.send({type:"REFRESH"})}}__processFetchEventQueue(){const e=new c.API(this);this.__fetchEventQueue.forEach((t=>{const s=t.request,r=d(s.url,this.data),i=r.ok?r:e.fetch(s);t.respondWith(Promise.resolve(i)),r.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${s.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){e instanceof o&&(e.defaultPrevented||"GET"===e.request.method&&(e.request.url.startsWith("foxy://")||e.composedPath()[0]!==this&&(e.preventDefault(),this.__fetchEventQueue.push(e),this.in("busy")||this.__processFetchEventQueue())))}}c.UpdateEvent=_,c.Rumour=r((()=>new h)),c.API=a;export{c as N,d as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L as e,j as t,_ as s,h as i}from"./shared-63eaded9.js";import{A as a}from"./shared-7f0a9790.js";import{C as o}from"./shared-df730f90.js";import{T as n,R as l,a as d}from"./shared-ae8cd227.js";import{F as r}from"./shared-5535f38f.js";import{c as h}from"./shared-4e709717.js";class c extends CustomEvent{constructor(e=!1){super("hide",{detail:{cancelled:e}})}}class u extends CustomEvent{constructor(){super("show")}}let p,m=e=>e;class v extends(n(l(e))){static get styles(){return[super.styles,t(p||(p=m`:host{position:relative;z-index:200}`))]}}let b,_,y,g,f,w,x,$=e=>e;class D extends(d(o(n(e)))){constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.header="",this.alert=!1,this.__handleKeyDown=e=>{"Escape"===e.key&&D.openDialogs[0]===this&&this.closable&&this.hide(this.editable)},this.__connected=!1,this.__visible=!1}static get properties(){return s(s({},super.properties),{},{__connected:{attribute:!1},__visible:{attribute:!1},centered:{type:Boolean},closable:{type:Boolean},editable:{type:Boolean},header:{type:String},alert:{type:Boolean},open:{type:Boolean,noAccessor:!0}})}static get styles(){return[super.styles,t(b||(b=$`.grid-cols-header{grid-template-columns:1fr auto 1fr}.scale-85{--tw-scale-x:0.85;--tw-scale-y:0.85}`))]}get open(){return this.__visible&&this.__connected}set open(e){e===this.open||(e?this.show():this.hide(this.editable))}connectedCallback(){super.connectedCallback(),addEventListener("keydown",this.__handleKeyDown)}disconnectedCallback(){var e;super.disconnectedCallback(),removeEventListener("keydown",this.__handleKeyDown),null===(e=D.dialogWindows.get(this))||void 0===e||e.remove(),D.dialogWindows.delete(this)}createRenderRoot(){const e=new v,t=document.querySelectorAll(D.dialogWindowsHost),s=Array.from(t).pop();return e.addEventListener("fetch",(e=>{e instanceof r&&(e.stopImmediatePropagation(),e.preventDefault(),e.respondWith(new a(this).fetch(e.request)))})),null==s||s.appendChild(e),D.dialogWindows.set(this,e),e.shadowRoot}render(e){if(!this.__connected)return i(_||(_=$``));const t=D.openDialogs[0]===this,s=D.openDialogs[1]===this,a=D.openDialogs[2]===this,o=!t&&!s&&!a;return i(y||(y=$` <div class="${0}"> <div id="backdrop" class="${0}" tabindex="-1" @click="${0}"></div> <div role="dialog" aria-labelledby="dialog-title" class="${0}"> <div class="${0}"> <div class="h-l grid grid-cols-header text-m font-lumo font-medium border-b border-contrast-10"> ${0} <h1 id="dialog-title" class="truncate self-center text-center"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </h1> ${0} </div> <div class="flex-1 overflow-y-auto overflow-x-hidden overscroll-contain"> <div class="p-m relative">${0}</div> </div> </div> </div> </div> `),h({"z-50 fixed inset-0":!0,"pointer-events-none":!this.__visible}),h({"select-none ease-in-out transition duration-500 absolute inset-0 bg-shade-50 focus-outline-none":!0,"opacity-100":this.__visible,"opacity-0":!this.__visible}),(()=>this.closable&&this.hide(this.editable)),h({"transform origin-bottom ease-in-out transition duration-500 relative h-full ml-auto sm-origin-center sm-max-w-modal":!0,"flex justify-center items-end sm-items-center mr-auto":this.alert,"translate-y-full sm-translate-y-0":!this.__visible,"sm-translate-x-full":!this.alert&&!this.__visible,"sm-opacity-0 sm-scale-110":this.alert&&!this.__visible,"translate-y-0 translate-x-0":t&&this.__visible,"scale-95 -translate-y-s sm-translate-y-0":s&&this.__visible,"scale-90 -translate-y-m sm-translate-y-0":a&&this.__visible,"opacity-0 scale-85 -translate-y-l sm-translate-y-0":o&&this.__visible}),h({"overflow-hidden flex flex-col bg-base rounded-t-l sm-rounded-b-l":!0,"absolute inset-0 mt-xl sm-m-xl":!this.alert,"shadow-xxl":this.__visible}),this.closable&&!this.hiddenSelector.matches("close-button",!0)?i(g||(g=$` <vaadin-button id="close-button" theme="tertiary-inline" class="mr-auto m-s px-s" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("close-button",!0),(()=>this.hide(this.editable)),this.lang,this.editable?"cancel":"close",this.ns):i(f||(f=$`<div></div>`)),this.ns,this.lang,this.header,this.editable&&!this.hiddenSelector.matches("save-button",!0)?i(w||(w=$` <vaadin-button data-testid="save-button" ?disabled="${0}" theme="primary" class="ml-auto h-auto min-h-0 min-w-0 m-xs px-m" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="save"></foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("save-button",!0),this.save,this.ns,this.lang):i(x||(x=$`<div></div>`)),null==e?void 0:e())}async hide(e=!1){var t;null===(t=this.__returnFocusTo)||void 0===t||t.focus(),await this.__setOpenDialogs(D.openDialogs.filter((e=>e!==this))),await this.__setConnected(!1),this.dispatchEvent(new D.HideEvent(!!e))}async show(e){this.__returnFocusTo=e,await this.__setConnected(!0),await this.__setOpenDialogs([this,...D.openDialogs]);const t=this.renderRoot.querySelector("#close-button");null==t||t.focus(),this.dispatchEvent(new D.ShowEvent)}async save(){await this.hide(!1)}async __setOpenDialogs(e){D.openDialogs.length=0,D.openDialogs.push(...e),await Promise.all([Promise.all(D.openDialogs.map((e=>e.requestUpdate()))),new Promise((e=>{this.renderRoot.querySelector("#backdrop").addEventListener("transitionend",e,{once:!0}),this.__visible=D.openDialogs.includes(this)}))])}async __setConnected(e){this.__connected=e,await this.updateComplete.then((()=>this.getBoundingClientRect()))}}D.dialogWindowsHost="#foxy-dialog-windows-host, body",D.dialogWindows=new WeakMap,D.openDialogs=[],D.ShowEvent=u,D.HideEvent=c,customElements.define("foxy-dialog-window",v);export{D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L as e,_ as t,h as s}from"./shared-63eaded9.js";import{C as i}from"./shared-df730f90.js";import{a as r,T as n}from"./shared-ae8cd227.js";import{c as o}from"./shared-4e709717.js";import{l as a}from"./shared-07134f93.js";import{r as l}from"./shared-b710881a.js";let d,c,h,u=e=>e;class m extends(r(i(n(e)))){constructor(){super(...arguments),this.options=[],this.items=[],this.__newItem=""}static get properties(){return t(t({},super.properties),{},{options:{type:Array},items:{type:Array},__newItem:{attribute:!1}})}render(){const e=o({"w-xs h-xs mr-xs rounded-full transition-colors flex-shrink-0":!0,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!0,"text-tertiary hover-bg-error-10 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"flex items-center justify-center":!this.readonly,hidden:this.readonly}),t=o({"transition-colors h-l ml-m flex items-center":!0,"text-secondary":this.readonly,"text-disabled":this.disabled}),i=this.disabled||!this.__newItem,r=()=>{this.__newItem&&(this.items.push({value:this.__newItem}),this.requestUpdate("items"),this.dispatchEvent(new CustomEvent("change")),this.__newItem="")};return s(d||(d=u` <slot></slot> <ol class="divide-y divide-contrast-10"> ${0} </ol> <div class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m focus-outline-none" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @change="${0}" @input="${0}"> <datalist id="list"> ${0} </datalist> <div class="transition-opacity ${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="lumo:plus" class="icon-inline text-l"></iron-icon> </button> </div> </div> `),l(this.items,(e=>e.value),((i,r)=>{var n;return s(c||(c=u` <li class="${0}"> <div class="flex-1 mr-s">${0}</div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="lumo:cross" class="icon-inline text-xl"></iron-icon> </button> </li> `),t,null!==(n=i.label)&&void 0!==n?n:i.value,this.t("delete"),e,this.disabled,(()=>{this.items.splice(r,1),this.requestUpdate("items"),this.dispatchEvent(new CustomEvent("change"))}))})),o({"ml-m h-l flex items-center":!0,"border-t border-contrast-10":this.items.length>0,flex:!this.readonly,hidden:this.readonly}),this.t("type_here"),a(this.__newItem),this.disabled,this.readonly,(e=>"Enter"===e.key&&r()),(e=>e.stopPropagation()),(e=>{this.__newItem=e.currentTarget.value.trim()}),this.options.map((({label:e,value:t})=>{if(!this.items.some((e=>e.value===t)))return s(h||(h=u`<option value="${0}">${0}</option>`),t,null!=e?e:t)})),this.__newItem?"opacity-100":"opacity-0",this.t("submit"),o({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50 focus-outline-none":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":i,"bg-success-10 text-success cursor-pointer":!i,"hover-bg-success hover-text-success-contrast":!i,"focus-ring-2":!i}),i,r)}}export{m as E};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L as e,_ as s,j as t,h as r}from"./shared-63eaded9.js";import"./shared-46ee137f.js";import"./shared-8b20bc23.js";import"./shared-073cb8e9.js";import{T as a}from"./shared-ae8cd227.js";import{c as i}from"./shared-4e709717.js";class c extends CustomEvent{constructor(e){super("change",{detail:e})}}let o,l,d=e=>e;class h extends(a(e)){constructor(){super(...arguments),this.readonly=!1,this.disabled=!1,this.checked=!1}static get properties(){return s(s({},super.properties),{},{readonly:{type:Boolean},disabled:{type:Boolean},checked:{type:Boolean}})}static get styles(){return[super.styles,t(o||(o=d`:host{--check-size:1.125rem}label{margin:calc(((1rem * var(--lumo-line-height-s)) - var(--check-size))/ -2) 0}label>:first-child{height:calc(1rem * var(--lumo-line-height-s))}.ml-xxl{margin-left:calc(var(--lumo-space-m) + var(--check-size))}.check{height:var(--check-size);width:var(--check-size)}`))]}render(){return r(l||(l=d` <label class="${0}"> <div class="flex items-center"> <div class="${0}"> <iron-icon icon="lumo:checkmark" class="${0}"> </iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ?disabled="${0}" data-testid="input" @change="${0}"> </div> </div> <div class="flex-1 font-lumo leading-s ml-m"> <slot></slot> </div> </label> <div class="${0}"> <slot name="content"></slot> </div> `),i({"flex items-start group transition-colors":!0,"cursor-default":this.disabled||this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"cursor-pointer":!this.disabled}),i({"flex-shrink-0 check transition-colors rounded-s border":!0,"focus-within-shadow-outline":!0,"bg-primary text-primary-contrast":!this.readonly&&this.checked,"border-dashed border-contrast-30":this.readonly,"border-transparent":!this.readonly,"opacity-50":this.disabled,"text-secondary bg-contrast-20":!this.readonly&&!this.checked,"group-hover-bg-contrast-30":!this.readonly&&!this.checked}),i({"block w-full h-full transition-transform transform":!0,"scale-100":this.checked,"scale-0":!this.checked}),this.checked,this.disabled,(e=>{if(this.readonly)return e.preventDefault();e.stopPropagation(),this.checked=!this.checked,this.dispatchEvent(new c(this.checked))}),i({"font-lumo ml-xxl transition-colors":!0,"text-disabled":this.disabled}))}}export{h as C,c as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,_ as t,h as r}from"./shared-63eaded9.js";import{B as s}from"./shared-5a54a9bc.js";import{c as n}from"./shared-ae8cd227.js";import{I as o}from"./shared-340f7584.js";let i,a,l,c=e=>e;class d{constructor(e="unknown"){this.type=e}}class h extends CustomEvent{constructor(){super("reload")}}class p extends n{constructor(){super(...arguments),this.type="unknown",this.reload=!1}static get scopedElements(){return{"vaadin-button":s,"iron-icon":customElements.get("iron-icon"),"x-i18n":o}}static get styles(){return[super.styles,e(i||(i=c`:host{position:absolute;top:0;right:0;bottom:0;left:0}.container-narrow{max-width:400px}`))]}static get properties(){return t(t({},super.properties),{},{reload:{type:Boolean,reflect:!0},type:{type:String}})}render(){return r(a||(a=c` <article class="bg-base font-lumo text-center leading-m p-m h-full flex flex-col items-center justify-center"> <iron-icon icon="lumo:error" class="text-error w-l h-l mb-m"></iron-icon> <header class="text-xl text-header container-narrow font-medium"> <x-i18n ns="${0}" lang="${0}" key="errors.${0}.title"></x-i18n> </header> <p class="text-m text-secondary container-narrow mb-l"> <x-i18n ns="${0}" lang="${0}" key="errors.${0}.message"></x-i18n> </p> <div class="flex space-x-s"> <a rel="nofollow noreferrer noopener" href="${0}" target="_blank" class="px-m py-xs text-primary font-medium tracking-wide border border-contrast-10 rounded transition-colors duration-200 hover-bg-primary-10 hover-border-primary-10 focus-outline-none focus-shadow-outline" router-ignore> <x-i18n ns="${0}" lang="${0}" key="errors.${0}.action"></x-i18n> </a> ${0} </div> </article> `),this.ns,this.lang,this.type,this.ns,this.lang,this.type,this._i18n.t(`errors.${this.type}.href`).toString(),this.ns,this.lang,this.type,this.reload?r(l||(l=c` <vaadin-button data-testid="reload" theme="primary" @click="${0}"> <x-i18n ns="${0}" lang="${0}" key="reload"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> `),(()=>this.dispatchEvent(new h)),this.ns,this.lang):"")}}export{p as E,d as F};
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
4
|
-
* This code may only be used under the BSD style license found at
|
|
5
|
-
* http://polymer.github.io/LICENSE.txt
|
|
6
|
-
* The complete set of authors may be found at
|
|
7
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
8
|
-
* The complete set of contributors may be found at
|
|
9
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
10
|
-
* Code distributed by Google as part of the polymer project is also
|
|
11
|
-
* subject to an additional IP rights grant found at
|
|
12
|
-
* http://polymer.github.io/PATENTS.txt
|
|
13
|
-
*/
|
|
14
|
-
const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,e=(t,e,r=null,s=null)=>{for(;e!==r;){const r=e.nextSibling;t.insertBefore(e,s),e=r}},r=(t,e,r=null)=>{for(;e!==r;){const r=e.nextSibling;t.removeChild(e),e=r}},s=`{{lit-${String(Math.random()).slice(2)}}}`,n=`\x3c!--${s}--\x3e`,i=new RegExp(`${s}|${n}`);class o{constructor(t,e){this.parts=[],this.element=e;const r=[],n=[],o=document.createTreeWalker(e.content,133,null,!1);let l=0,d=-1,u=0;const{strings:p,values:{length:f}}=t;for(;u<f;){const t=o.nextNode();if(null!==t){if(d++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:r}=e;let s=0;for(let t=0;t<r;t++)a(e[t].name,"$lit$")&&s++;for(;s-- >0;){const e=p[u],r=c.exec(e)[2],s=r.toLowerCase()+"$lit$",n=t.getAttribute(s);t.removeAttribute(s);const o=n.split(i);this.parts.push({type:"attribute",index:d,name:r,strings:o}),u+=o.length-1}}"TEMPLATE"===t.tagName&&(n.push(t),o.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(s)>=0){const s=t.parentNode,n=e.split(i),o=n.length-1;for(let e=0;e<o;e++){let r,i=n[e];if(""===i)r=h();else{const t=c.exec(i);null!==t&&a(t[2],"$lit$")&&(i=i.slice(0,t.index)+t[1]+t[2].slice(0,-"$lit$".length)+t[3]),r=document.createTextNode(i)}s.insertBefore(r,t),this.parts.push({type:"node",index:++d})}""===n[o]?(s.insertBefore(h(),t),r.push(t)):t.data=n[o],u+=o}}else if(8===t.nodeType)if(t.data===s){const e=t.parentNode;null!==t.previousSibling&&d!==l||(d++,e.insertBefore(h(),t)),l=d,this.parts.push({type:"node",index:d}),null===t.nextSibling?t.data="":(r.push(t),d--),u++}else{let e=-1;for(;-1!==(e=t.data.indexOf(s,e+1));)this.parts.push({type:"node",index:-1}),u++}}else o.currentNode=n.pop()}for(const t of r)t.parentNode.removeChild(t)}}const a=(t,e)=>{const r=t.length-e.length;return r>=0&&t.slice(r)===e},l=t=>-1!==t.index,h=()=>document.createComment(""),c=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function d(t,e){const{element:{content:r},parts:s}=t,n=document.createTreeWalker(r,133,null,!1);let i=p(s),o=s[i],a=-1,l=0;const h=[];let c=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===c&&(c=null),e.has(t)&&(h.push(t),null===c&&(c=t)),null!==c&&l++;void 0!==o&&o.index===a;)o.index=null!==c?-1:o.index-l,i=p(s,i),o=s[i]}h.forEach((t=>t.parentNode.removeChild(t)))}const u=t=>{let e=11===t.nodeType?0:1;const r=document.createTreeWalker(t,133,null,!1);for(;r.nextNode();)e++;return e},p=(t,e=-1)=>{for(let r=e+1;r<t.length;r++){const e=t[r];if(l(e))return r}return-1};
|
|
15
|
-
/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
18
|
-
* This code may only be used under the BSD style license found at
|
|
19
|
-
* http://polymer.github.io/LICENSE.txt
|
|
20
|
-
* The complete set of authors may be found at
|
|
21
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
22
|
-
* The complete set of contributors may be found at
|
|
23
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
24
|
-
* Code distributed by Google as part of the polymer project is also
|
|
25
|
-
* subject to an additional IP rights grant found at
|
|
26
|
-
* http://polymer.github.io/PATENTS.txt
|
|
27
|
-
*/
|
|
28
|
-
const f=new WeakMap,y=t=>(...e)=>{const r=t(...e);return f.set(r,!0),r},m=t=>"function"==typeof t&&f.has(t),_={},g={};
|
|
29
|
-
/**
|
|
30
|
-
* @license
|
|
31
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
32
|
-
* This code may only be used under the BSD style license found at
|
|
33
|
-
* http://polymer.github.io/LICENSE.txt
|
|
34
|
-
* The complete set of authors may be found at
|
|
35
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
36
|
-
* The complete set of contributors may be found at
|
|
37
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
38
|
-
* Code distributed by Google as part of the polymer project is also
|
|
39
|
-
* subject to an additional IP rights grant found at
|
|
40
|
-
* http://polymer.github.io/PATENTS.txt
|
|
41
|
-
*/
|
|
42
|
-
class b{constructor(t,e,r){this.__parts=[],this.template=t,this.processor=e,this.options=r}update(t){let e=0;for(const r of this.__parts)void 0!==r&&r.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const e=t?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),r=[],s=this.template.parts,n=document.createTreeWalker(e,133,null,!1);let i,o=0,a=0,h=n.nextNode();for(;o<s.length;)if(i=s[o],l(i)){for(;a<i.index;)a++,"TEMPLATE"===h.nodeName&&(r.push(h),n.currentNode=h.content),null===(h=n.nextNode())&&(n.currentNode=r.pop(),h=n.nextNode());if("node"===i.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(h.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(h,i.name,i.strings,this.options));o++}else this.__parts.push(void 0),o++;return t&&(document.adoptNode(e),customElements.upgrade(e)),e}}
|
|
43
|
-
/**
|
|
44
|
-
* @license
|
|
45
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
46
|
-
* This code may only be used under the BSD style license found at
|
|
47
|
-
* http://polymer.github.io/LICENSE.txt
|
|
48
|
-
* The complete set of authors may be found at
|
|
49
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
50
|
-
* The complete set of contributors may be found at
|
|
51
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
52
|
-
* Code distributed by Google as part of the polymer project is also
|
|
53
|
-
* subject to an additional IP rights grant found at
|
|
54
|
-
* http://polymer.github.io/PATENTS.txt
|
|
55
|
-
*/const v=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),w=` ${s} `;class S{constructor(t,e,r,s){this.strings=t,this.values=e,this.type=r,this.processor=s}getHTML(){const t=this.strings.length-1;let e="",r=!1;for(let i=0;i<t;i++){const t=this.strings[i],o=t.lastIndexOf("\x3c!--");r=(o>-1||r)&&-1===t.indexOf("--\x3e",o+1);const a=c.exec(t);e+=null===a?t+(r?w:n):t.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+s}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==v&&(e=v.createHTML(e)),t.innerHTML=e,t}}class x extends S{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),r=t.content,s=r.firstChild;return r.removeChild(s),e(r,s.firstChild),t}}
|
|
56
|
-
/**
|
|
57
|
-
* @license
|
|
58
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
59
|
-
* This code may only be used under the BSD style license found at
|
|
60
|
-
* http://polymer.github.io/LICENSE.txt
|
|
61
|
-
* The complete set of authors may be found at
|
|
62
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
63
|
-
* The complete set of contributors may be found at
|
|
64
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
65
|
-
* Code distributed by Google as part of the polymer project is also
|
|
66
|
-
* subject to an additional IP rights grant found at
|
|
67
|
-
* http://polymer.github.io/PATENTS.txt
|
|
68
|
-
*/const P=t=>null===t||!("object"==typeof t||"function"==typeof t),E=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class O{constructor(t,e,r){this.dirty=!0,this.element=t,this.name=e,this.strings=r,this.parts=[];for(let t=0;t<r.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new T(this)}_getValue(){const t=this.strings,e=t.length-1,r=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=r[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!E(t))return t}let s="";for(let n=0;n<e;n++){s+=t[n];const e=r[n];if(void 0!==e){const t=e.value;if(P(t)||!E(t))s+="string"==typeof t?t:String(t);else for(const e of t)s+="string"==typeof e?e:String(e)}}return s+=t[e],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class T{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===_||P(t)&&t===this.value||(this.value=t,m(t)||(this.committer.dirty=!0))}commit(){for(;m(this.value);){const t=this.value;this.value=_,t(this)}this.value!==_&&this.committer.commit()}}class A{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(h()),this.endNode=t.appendChild(h())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=h()),t.__insert(this.endNode=h())}insertAfterPart(t){t.__insert(this.startNode=h()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;m(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=_,t(this)}const t=this.__pendingValue;t!==_&&(P(t)?t!==this.value&&this.__commitText(t):t instanceof S?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):E(t)?this.__commitIterable(t):t===g?(this.value=g,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,r="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=r:this.__commitNode(document.createTextNode(r)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof b&&this.value.template===e)this.value.update(t.values);else{const r=new b(e,t.processor,this.options),s=r._clone();r.update(t.values),this.__commitNode(s),this.value=r}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let r,s=0;for(const n of t)r=e[s],void 0===r&&(r=new A(this.options),e.push(r),0===s?r.appendIntoPart(this):r.insertAfterPart(e[s-1])),r.setValue(n),r.commit(),s++;s<e.length&&(e.length=s,this.clear(r&&r.endNode))}clear(t=this.startNode){r(this.startNode.parentNode,t.nextSibling,this.endNode)}}class C{constructor(t,e,r){if(this.value=void 0,this.__pendingValue=void 0,2!==r.length||""!==r[0]||""!==r[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=r}setValue(t){this.__pendingValue=t}commit(){for(;m(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=_,t(this)}if(this.__pendingValue===_)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=_}}class N extends O{constructor(t,e,r){super(t,e,r),this.single=2===r.length&&""===r[0]&&""===r[1]}_createPart(){return new j(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class j extends T{}let U=!1;(()=>{try{const t={get capture(){return U=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class R{constructor(t,e,r){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=r,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;m(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=_,t(this)}if(this.__pendingValue===_)return;const t=this.__pendingValue,e=this.value,r=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),s=null!=t&&(null==e||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=B(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=_}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const B=t=>t&&(U?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)
|
|
69
|
-
/**
|
|
70
|
-
* @license
|
|
71
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
72
|
-
* This code may only be used under the BSD style license found at
|
|
73
|
-
* http://polymer.github.io/LICENSE.txt
|
|
74
|
-
* The complete set of authors may be found at
|
|
75
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
76
|
-
* The complete set of contributors may be found at
|
|
77
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
78
|
-
* Code distributed by Google as part of the polymer project is also
|
|
79
|
-
* subject to an additional IP rights grant found at
|
|
80
|
-
* http://polymer.github.io/PATENTS.txt
|
|
81
|
-
*/;function V(t){let e=M.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},M.set(t.type,e));let r=e.stringsArray.get(t.strings);if(void 0!==r)return r;const n=t.strings.join(s);return r=e.keyString.get(n),void 0===r&&(r=new o(t,t.getTemplateElement()),e.keyString.set(n,r)),e.stringsArray.set(t.strings,r),r}const M=new Map,k=new WeakMap;
|
|
82
|
-
/**
|
|
83
|
-
* @license
|
|
84
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
85
|
-
* This code may only be used under the BSD style license found at
|
|
86
|
-
* http://polymer.github.io/LICENSE.txt
|
|
87
|
-
* The complete set of authors may be found at
|
|
88
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
89
|
-
* The complete set of contributors may be found at
|
|
90
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
91
|
-
* Code distributed by Google as part of the polymer project is also
|
|
92
|
-
* subject to an additional IP rights grant found at
|
|
93
|
-
* http://polymer.github.io/PATENTS.txt
|
|
94
|
-
*/const D=new
|
|
95
|
-
/**
|
|
96
|
-
* @license
|
|
97
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
98
|
-
* This code may only be used under the BSD style license found at
|
|
99
|
-
* http://polymer.github.io/LICENSE.txt
|
|
100
|
-
* The complete set of authors may be found at
|
|
101
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
102
|
-
* The complete set of contributors may be found at
|
|
103
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
104
|
-
* Code distributed by Google as part of the polymer project is also
|
|
105
|
-
* subject to an additional IP rights grant found at
|
|
106
|
-
* http://polymer.github.io/PATENTS.txt
|
|
107
|
-
*/
|
|
108
|
-
class{handleAttributeExpressions(t,e,r,s){const n=e[0];if("."===n){return new N(t,e.slice(1),r).parts}if("@"===n)return[new R(t,e.slice(1),s.eventContext)];if("?"===n)return[new C(t,e.slice(1),r)];return new O(t,e,r).parts}handleTextExpression(t){return new A(t)}};
|
|
109
|
-
/**
|
|
110
|
-
* @license
|
|
111
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
112
|
-
* This code may only be used under the BSD style license found at
|
|
113
|
-
* http://polymer.github.io/LICENSE.txt
|
|
114
|
-
* The complete set of authors may be found at
|
|
115
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
116
|
-
* The complete set of contributors may be found at
|
|
117
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
118
|
-
* Code distributed by Google as part of the polymer project is also
|
|
119
|
-
* subject to an additional IP rights grant found at
|
|
120
|
-
* http://polymer.github.io/PATENTS.txt
|
|
121
|
-
*/"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const I=(t,...e)=>new S(t,e,"html",D),q=(t,...e)=>new x(t,e,"svg",D)
|
|
122
|
-
/**
|
|
123
|
-
* @license
|
|
124
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
125
|
-
* This code may only be used under the BSD style license found at
|
|
126
|
-
* http://polymer.github.io/LICENSE.txt
|
|
127
|
-
* The complete set of authors may be found at
|
|
128
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
129
|
-
* The complete set of contributors may be found at
|
|
130
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
131
|
-
* Code distributed by Google as part of the polymer project is also
|
|
132
|
-
* subject to an additional IP rights grant found at
|
|
133
|
-
* http://polymer.github.io/PATENTS.txt
|
|
134
|
-
*/,F=(t,e)=>`${t}--${e}`;let L=!0;void 0===window.ShadyCSS?L=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),L=!1);const H=t=>e=>{const r=F(e.type,t);let n=M.get(r);void 0===n&&(n={stringsArray:new WeakMap,keyString:new Map},M.set(r,n));let i=n.stringsArray.get(e.strings);if(void 0!==i)return i;const a=e.strings.join(s);if(i=n.keyString.get(a),void 0===i){const r=e.getTemplateElement();L&&window.ShadyCSS.prepareTemplateDom(r,t),i=new o(e,r),n.keyString.set(a,i)}return n.stringsArray.set(e.strings,i),i},$=["html","svg"],z=new Set,W=(t,e,r)=>{z.add(t);const s=r?r.element:document.createElement("template"),n=e.querySelectorAll("style"),{length:i}=n;if(0===i)return void window.ShadyCSS.prepareTemplateStyles(s,t);const o=document.createElement("style");for(let t=0;t<i;t++){const e=n[t];e.parentNode.removeChild(e),o.textContent+=e.textContent}(t=>{$.forEach((e=>{const r=M.get(F(e,t));void 0!==r&&r.keyString.forEach((t=>{const{element:{content:e}}=t,r=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{r.add(t)})),d(t,r)}))}))})(t);const a=s.content;r?function(t,e,r=null){const{element:{content:s},parts:n}=t;if(null==r)return void s.appendChild(e);const i=document.createTreeWalker(s,133,null,!1);let o=p(n),a=0,l=-1;for(;i.nextNode();)for(l++,i.currentNode===r&&(a=u(e),r.parentNode.insertBefore(e,r));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=p(n,o);return}o=p(n,o)}}(r,o,a.firstChild):a.insertBefore(o,a.firstChild),window.ShadyCSS.prepareTemplateStyles(s,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(r){a.insertBefore(o,a.firstChild);const t=new Set;t.add(o),d(r,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const J={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},G=(t,e)=>e!==t&&(e==e||t==t),X={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:G};class K extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,r)=>{const s=this._attributeNameForProperty(r,e);void 0!==s&&(this._attributeToPropertyMap.set(s,r),t.push(s))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach(((t,e)=>this._classProperties.set(e,t)))}}static createProperty(t,e=X){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const r="symbol"==typeof t?Symbol():`__${t}`,s=this.getPropertyDescriptor(t,r,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}static getPropertyDescriptor(t,e,r){return{get(){return this[e]},set(s){const n=this[t];this[e]=s,this.requestUpdateInternal(t,n,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||X}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const r of e)this.createProperty(r,t[r])}}static _attributeNameForProperty(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,r=G){return r(t,e)}static _propertyValueFromAttribute(t,e){const r=e.type,s=e.converter||J,n="function"==typeof s?s:s.fromAttribute;return n?n(t,r):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const r=e.type,s=e.converter;return(s&&s.toAttribute||J.toAttribute)(t,r)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,e)=>this[e]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,r){e!==r&&this._attributeToProperty(t,r)}_propertyToAttribute(t,e,r=X){const s=this.constructor,n=s._attributeNameForProperty(t,r);if(void 0!==n){const t=s._propertyValueToAttribute(e,r);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(n):this.setAttribute(n,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const r=this.constructor,s=r._attributeToPropertyMap.get(t);if(void 0!==s){const t=r.getPropertyOptions(s);this._updateState=16|this._updateState,this[s]=r._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,r){let s=!0;if(void 0!==t){const n=this.constructor;r=r||n.getPropertyOptions(t),n._valueHasChanged(this[t],e,r.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==r.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,r))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((t,e)=>this._propertyToAttribute(e,this[e],t))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}K.finalized=!0;
|
|
135
|
-
/**
|
|
136
|
-
@license
|
|
137
|
-
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
|
|
138
|
-
This code may only be used under the BSD style license found at
|
|
139
|
-
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
140
|
-
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
141
|
-
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
142
|
-
part of the polymer project is also subject to an additional IP rights grant
|
|
143
|
-
found at http://polymer.github.io/PATENTS.txt
|
|
144
|
-
*/
|
|
145
|
-
const Q=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Y=Symbol();class Z{constructor(t,e){if(e!==Y)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(Q?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const tt=t=>new Z(String(t),Y),et=(t,...e)=>{const r=e.reduce(((e,r,s)=>e+(t=>{if(t instanceof Z)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(r)+t[s+1]),t[0]);return new Z(r,Y)};
|
|
146
|
-
/**
|
|
147
|
-
* @license
|
|
148
|
-
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
149
|
-
* This code may only be used under the BSD style license found at
|
|
150
|
-
* http://polymer.github.io/LICENSE.txt
|
|
151
|
-
* The complete set of authors may be found at
|
|
152
|
-
* http://polymer.github.io/AUTHORS.txt
|
|
153
|
-
* The complete set of contributors may be found at
|
|
154
|
-
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
155
|
-
* Code distributed by Google as part of the polymer project is also
|
|
156
|
-
* subject to an additional IP rights grant found at
|
|
157
|
-
* http://polymer.github.io/PATENTS.txt
|
|
158
|
-
*/
|
|
159
|
-
(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const rt={};class st extends K{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,r)=>t.reduceRight(((t,r)=>Array.isArray(r)?e(r,t):(t.add(r),t)),r),r=e(t,new Set),s=[];r.forEach((t=>s.unshift(t))),this._styles=s}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!Q){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return tt(e)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Q?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==rt&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return rt}}function nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,s)}return r}function it(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(r),!0).forEach((function(e){ot(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ot(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function at(t,e){if(null==t)return{};var r,s,n=function(t,e){if(null==t)return{};var r,s,n={},i=Object.keys(t);for(s=0;s<i.length;s++)r=i[s],e.indexOf(r)>=0||(n[r]=t[r]);return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)r=i[s],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}st.finalized=!0,st.render=(t,e,s)=>{if(!s||"object"!=typeof s||!s.scopeName)throw new Error("The `scopeName` option is required.");const n=s.scopeName,i=k.has(e),o=L&&11===e.nodeType&&!!e.host,a=o&&!z.has(n),l=a?document.createDocumentFragment():e;if(((t,e,s)=>{let n=k.get(e);void 0===n&&(r(e,e.firstChild),k.set(e,n=new A(Object.assign({templateFactory:V},s))),n.appendInto(e)),n.setValue(t),n.commit()})(t,l,Object.assign({templateFactory:H(n)},s)),a){const t=k.get(l);k.delete(l);const s=t.value instanceof b?t.value.template:void 0;W(n,l,s),r(e,e.firstChild),e.appendChild(l),k.set(e,t)}!i&&o&&window.ShadyCSS.styleElement(e.host)},st.shadowRootOptions={mode:"open"};var lt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ht(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ct(t){var e={exports:{}};return t(e,e.exports),e.exports}function dt(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}var ut=ct((function(t,e){var r="undefined"!=typeof self?self:lt,s=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,s="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,o="ArrayBuffer"in t;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function h(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return s&&(e[Symbol.iterator]=function(){return e}),e}function u(t){this.map={},t instanceof u?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function y(t){var e=new FileReader,r=f(e);return e.readAsArrayBuffer(t),r}function m(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&n&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=m(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=m(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var t,e,r,s=p(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=f(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),s=0;s<e.length;s++)r[s]=String.fromCharCode(e[s]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(t,e){t=h(t),e=c(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},u.prototype.delete=function(t){delete this.map[h(t)]},u.prototype.get=function(t){return t=h(t),this.has(t)?this.map[t]:null},u.prototype.has=function(t){return this.map.hasOwnProperty(h(t))},u.prototype.set=function(t,e){this.map[h(t)]=c(e)},u.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},u.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),d(t)},u.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},u.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),d(t)},s&&(u.prototype[Symbol.iterator]=u.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var r,s,n=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new u(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new u(e.headers)),this.method=(r=e.method||this.method||"GET",s=r.toUpperCase(),g.indexOf(s)>-1?s:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function v(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),s=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(s),decodeURIComponent(n))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new u(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},_.call(b.prototype),_.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var S=[301,302,303,307,308];w.redirect=function(t,e){if(-1===S.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function x(t,r){return new Promise((function(s,i){var o=new b(t,r);if(o.signal&&o.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new u,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),s=r.shift().trim();if(s){var n=r.join(":").trim();e.append(s,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;s(new w(n,r))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",l)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}x.polyfill=!0,t.fetch||(t.fetch=x,t.Headers=u,t.Request=b,t.Response=w),e.Headers=u,e.Request=b,e.Response=w,e.fetch=x,Object.defineProperty(e,"__esModule",{value:!0})}({})}(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var n=s;(e=n.fetch).default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e}));function pt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var ft="object"==typeof global&&global&&global.Object===Object&&global,yt="object"==typeof self&&self&&self.Object===Object&&self,mt=ft||yt||Function("return this")(),_t=mt.Symbol,gt=Object.prototype,bt=gt.hasOwnProperty,vt=gt.toString,wt=_t?_t.toStringTag:void 0;var St=Object.prototype.toString;var xt=_t?_t.toStringTag:void 0;function Pt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":xt&&xt in Object(t)?function(t){var e=bt.call(t,wt),r=t[wt];try{t[wt]=void 0;var s=!0}catch(t){}var n=vt.call(t);return s&&(e?t[wt]=r:delete t[wt]),n}(t):function(t){return St.call(t)}(t)}function Et(t){return null!=t&&"object"==typeof t}function Ot(t){return"symbol"==typeof t||Et(t)&&"[object Symbol]"==Pt(t)}export{T as A,C as B,Z as C,R as E,st as L,A as N,j as P,_t as S,o as T,it as _,lt as a,dt as b,ct as c,ut as d,pt as e,S as f,ht as g,I as h,Ot as i,et as j,y as k,Pt as l,s as m,Et as n,ft as o,_ as p,h as q,mt as r,q as s,M as t,e as u,r as v,at as w,tt as x};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L as e,_ as t,h as n}from"./shared-63eaded9.js";import{i as r,a as s}from"./shared-ae8cd227.js";import{F as a,A as i}from"./shared-5535f38f.js";const o={type:"backend",init:()=>{},read:(e,t,n)=>{const r=async e=>{const t=e.ok?null:new Error(await e.text()),r=!!e.ok&&await e.json();n(t,r)},s=e=>{const t=e instanceof Error?e:new Error(String(e));n(t,!1)},o=new a("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:new i.WHATWGRequest(`foxy://i18n/${t}/${e}`),resolve:r,reject:s});dispatchEvent(o),o.defaultPrevented||fetch(o.request).then(r).catch(s)},create:()=>{throw new Error("foxy-i18n does not support resource creation")}};function c(e,t=!1){var n;const r=e.replace(/(y|m|w|d)/,""),s=e.replace(/\.?\d+/,"");return{count:".5"===r?.5:parseInt(r),units:t&&null!==(n={y:"year",m:"month",w:"week",d:"day"}[s])&&void 0!==n?n:s}}const l={discount:({ns:e,type:t,details:n},r,s)=>{const a=t.endsWith("_percentage")?.01:1,i=n.split("|"),o=`${["allunits","incremental","repeat","single"].includes(i[0])?i.shift():"single"}_${t}_discount_summary`;return i.map((t=>{var n,r;const s=null!==(r=null===(n=/[-+]/.exec(t))||void 0===n?void 0:n.index)&&void 0!==r?r:-1,i=parseFloat(t.substring(s))*a,c=parseFloat(t.substring(0,s));return`$t(${o}, ${JSON.stringify({adjustment:i,from:c,ns:e})})`})).join("; ")},relative:(e,t,n)=>{const r=new Intl.RelativeTimeFormat(n);let{count:s,units:a}=c(e,!0);return.5===s&&"month"===a&&(s=2,a="week"),r.format(s,a)},percent:(e,t,n)=>{let r=null;try{"number"==typeof e&&(r=e.toLocaleString(n,{style:"percent"}))}catch(e){console.warn(`i18next formatter error: ${e.message}`)}return r||String(e)},ordinal:(e,t,n)=>`${e}$t(ordinal_${new Intl.PluralRules(n,{type:"ordinal"}).select(e)})`,price:(e,t,n,r)=>{var s;try{const[t,a]=e.split(" ");return parseFloat(t).toLocaleString(n,{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:null!==(s=null==r?void 0:r.currencyDisplay)&&void 0!==s?s:"symbol",style:"currency",currency:a})}catch(t){return e}},date:(e,t,n)=>{if(!e)return"$t(unknown)";const r=new Date(e),s=(new Date).getFullYear()===r.getFullYear()?void 0:"numeric";return r.toLocaleDateString(n,{month:"long",year:s,day:"numeric"})},time:(e,t,n)=>new Date(e).toLocaleTimeString(n,{hour:"numeric",minute:"numeric"})};let u,d=e=>e;class p extends(s(e,"")){constructor(){super(...arguments),this.options={},this.key=""}static onTranslationChange(e){const t=["initialized","loaded"],n=["removed","added"];return t.forEach((t=>p.i18next.on(t,e))),n.forEach((t=>p.i18next.store.on(t,e))),()=>{t.forEach((t=>p.i18next.off(t,e))),n.forEach((t=>p.i18next.store.off(t,e)))}}static onResourceFetch(e){const t=t=>{if(t instanceof a&&t.request.url.startsWith("foxy://i18n/")){const[n,r]=t.request.url.split("/").reverse();t.respondWith(e(r,n))}};return addEventListener("fetch",t),()=>removeEventListener("fetch",t)}static setGateways({values:e}){for(const t in e)this.i18next.addResource("en","gateways",`gateways.${t}`,e[t].name)}static get properties(){return t(t({},super.properties),{},{options:{type:Object},key:{type:String}})}connectedCallback(){super.connectedCallback(),this.__unsubscribe=p.onTranslationChange((()=>this.requestUpdate()))}render(){return n(u||(u=d`<span>${0}</span>`),this.t(this.key,t(t({},this.options),{},{lng:this.lang})))}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.__unsubscribe)||void 0===e||e.call(this)}}p.FetchEvent=a,p.i18next=r.createInstance().use(o),p.i18next.init({interpolation:{format:(e,t="",n="en",r={})=>t.split(" ").filter((e=>!!e.trim())).reduce(((e,t)=>{var s,a;return null!==(a=null===(s=l[t])||void 0===s?void 0:s.call(l,e,t,n,r))&&void 0!==a?a:e}),e),escapeValue:!1},fallbackLng:"en",fallbackNS:"shared",defaultNS:"shared",ns:["shared"]}),customElements.define("foxy-i18n",p);export{p as I,c as p};
|