@foxy.io/elements 1.25.0-beta.3 → 1.25.0-beta.5
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-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- 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-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-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 -1
- 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 -1
- 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-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 +3 -3
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.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-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.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-code-log-card.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-editor.js +2 -2
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +4 -4
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.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-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +5 -5
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +2 -96
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- 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-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +95 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-user-card.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 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-b113467e.js → shared-00c2793e.js} +1 -1
- package/dist/cdn/{shared-15dfa16d.js → shared-029816d7.js} +1 -1
- package/dist/cdn/{shared-61b1fd60.js → shared-02bc0368.js} +1 -1
- package/dist/cdn/{shared-87f55237.js → shared-174f37e9.js} +1 -1
- package/dist/cdn/{shared-3f3903d4.js → shared-20ba4cdc.js} +1 -1
- package/dist/cdn/{shared-06916671.js → shared-268571df.js} +1 -1
- package/dist/cdn/{shared-8d99b885.js → shared-2b27e2e7.js} +1 -1
- package/dist/cdn/{shared-979e24ec.js → shared-2bdc99f4.js} +1 -1
- package/dist/cdn/{shared-3d95605f.js → shared-2c8c4b43.js} +3 -3
- package/dist/cdn/shared-2cf08dd4.js +1 -0
- package/dist/cdn/{shared-f8d1abc9.js → shared-2f09d4df.js} +4 -4
- package/dist/cdn/{shared-54cbd346.js → shared-30d00b64.js} +1 -1
- package/dist/cdn/{shared-d9f4138b.js → shared-32e736eb.js} +1 -1
- package/dist/cdn/{shared-a1d39ddd.js → shared-43f449bb.js} +1 -1
- package/dist/cdn/{shared-87824001.js → shared-4462dc70.js} +2 -2
- package/dist/cdn/{shared-02f8245a.js → shared-4aa4d980.js} +1 -1
- package/dist/cdn/{shared-63d11888.js → shared-4c124efc.js} +7 -7
- package/dist/cdn/shared-4c650e5c.js +1 -0
- package/dist/cdn/{shared-b984ab7c.js → shared-4e59fd48.js} +16 -16
- package/dist/cdn/{shared-69c3549d.js → shared-54b0e48f.js} +1 -1
- package/dist/cdn/{shared-ecd5eb1b.js → shared-5fa697c4.js} +1 -1
- package/dist/cdn/shared-61ade33e.js +6 -0
- package/dist/cdn/{shared-3bd99d11.js → shared-6a9ae42e.js} +1 -1
- package/dist/cdn/{shared-a95067d6.js → shared-76400719.js} +1 -1
- package/dist/cdn/{shared-ceec93fa.js → shared-7dd17943.js} +1 -1
- package/dist/cdn/{shared-ea1ab750.js → shared-7deff07c.js} +1 -1
- package/dist/cdn/{shared-fad099e6.js → shared-7e1953f5.js} +1 -1
- package/dist/cdn/shared-8201d0b5.js +1 -0
- package/dist/cdn/{shared-29e74661.js → shared-8952aeac.js} +1 -1
- package/dist/cdn/{shared-320fadbf.js → shared-896982f9.js} +1 -1
- package/dist/cdn/{shared-a5a03f4f.js → shared-8d8bed82.js} +1 -1
- package/dist/cdn/{shared-92dd9964.js → shared-99c0ae04.js} +1 -1
- package/dist/cdn/{shared-6ffa9f84.js → shared-9c08cfab.js} +1 -1
- package/dist/cdn/{shared-0ffe26d8.js → shared-9df8f842.js} +2 -2
- package/dist/cdn/{shared-0961f769.js → shared-a8dc23f1.js} +1 -1
- package/dist/cdn/{shared-3fee360a.js → shared-ac7c5a5e.js} +14 -14
- package/dist/cdn/{shared-5db2fec0.js → shared-ad34b6db.js} +1 -1
- package/dist/cdn/{shared-a1be9c27.js → shared-b1b8ea67.js} +1 -1
- package/dist/cdn/{shared-85712eed.js → shared-b509bc2c.js} +1 -1
- package/dist/cdn/{shared-de8bf756.js → shared-bc0d8d01.js} +2 -2
- package/dist/cdn/{shared-4105aacf.js → shared-be7bfbb0.js} +1 -1
- package/dist/cdn/{shared-745a575c.js → shared-bed7aae1.js} +1 -1
- package/dist/cdn/{shared-5291bdca.js → shared-c7b3d22b.js} +3 -3
- package/dist/cdn/{shared-264c82b8.js → shared-c9ba1b64.js} +3 -3
- package/dist/cdn/{shared-c43cd1fa.js → shared-ca4c5f0f.js} +1 -1
- package/dist/cdn/{shared-efbd62cb.js → shared-cdd2358f.js} +4 -4
- package/dist/cdn/{shared-d8ca5c87.js → shared-d21fa1a6.js} +1 -1
- package/dist/cdn/{shared-835cf735.js → shared-d57fac94.js} +1 -1
- package/dist/cdn/{shared-d600815d.js → shared-dbadd9cf.js} +1 -1
- package/dist/cdn/{shared-452e38da.js → shared-e39807f8.js} +1 -1
- package/dist/cdn/{shared-25edf241.js → shared-e83f2983.js} +1 -1
- package/dist/cdn/{shared-d1265ca0.js → shared-e91453df.js} +1 -1
- package/dist/cdn/{shared-5f1f0d8f.js → shared-ea527e98.js} +1 -1
- package/dist/cdn/shared-f9a3d1ff.js +6 -0
- package/dist/cdn/{shared-324665fd.js → shared-fa4f6cd3.js} +1 -1
- package/dist/cdn/shared-fc15a882.js +1 -0
- package/dist/cdn/{shared-2c92c192.js → shared-ff8ca16b.js} +1 -1
- package/dist/cdn/{shared-6d0be1e4.js → shared-ff9791cf.js} +1 -1
- package/dist/cdn/translations/cart-form/en.json +7 -6
- package/dist/cdn/translations/customer/en.json +23 -14
- package/dist/cdn/translations/customer-portal/en.json +22 -13
- package/dist/cdn/translations/item-card/en.json +1 -0
- package/dist/cdn/translations/item-form/en.json +2 -2
- package/dist/cdn/translations/payments-api-payment-preset-form/en.json +2 -2
- package/dist/cdn/translations/shipment-card/en.json +1 -0
- package/dist/cdn/translations/subscription-form/en.json +23 -14
- package/dist/cdn/translations/transaction/en.json +27 -26
- package/dist/cdn/translations/transaction-card/en.json +22 -22
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +28 -23
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
- package/dist/elements/internal/InternalControl/InternalControl.js +2 -1
- package/dist/elements/internal/InternalControl/InternalControl.js.map +1 -1
- package/dist/elements/private/Dialog/Dialog.js +7 -1
- package/dist/elements/private/Dialog/Dialog.js.map +1 -1
- package/dist/elements/public/BillingAddressCard/BillingAddressCard.d.ts +2 -1
- package/dist/elements/public/BillingAddressCard/BillingAddressCard.js.map +1 -1
- package/dist/elements/public/CouponForm/types.d.ts +3 -7
- package/dist/elements/public/CouponForm/types.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +2 -2
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
- package/dist/elements/public/ItemCard/ItemCard.js +4 -2
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
- package/dist/elements/public/ItemsForm/private/Item.js +1 -0
- package/dist/elements/public/ItemsForm/private/Item.js.map +1 -1
- package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js.map +1 -1
- package/dist/elements/public/PaymentCard/PaymentCard.js.map +1 -1
- package/dist/elements/public/PaymentsApi/api/types.d.ts +2 -0
- package/dist/elements/public/PaymentsApi/api/types.js.map +1 -1
- package/dist/elements/public/ShipmentCard/ShipmentCard.js +5 -2
- package/dist/elements/public/ShipmentCard/ShipmentCard.js.map +1 -1
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js +2 -2
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js.map +1 -1
- package/dist/elements/public/SubscriptionCard/types.d.ts +2 -2
- package/dist/elements/public/SubscriptionCard/types.js.map +1 -1
- package/dist/elements/public/Transaction/Transaction.d.ts +2 -3
- package/dist/elements/public/Transaction/Transaction.js +129 -127
- package/dist/elements/public/Transaction/Transaction.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js +6 -4
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js.map +1 -1
- package/dist/elements/public/Transaction/types.d.ts +4 -17
- package/dist/elements/public/Transaction/types.js.map +1 -1
- package/dist/elements/public/TransactionCard/TransactionCard.d.ts +8 -10
- package/dist/elements/public/TransactionCard/TransactionCard.js +71 -51
- package/dist/elements/public/TransactionCard/TransactionCard.js.map +1 -1
- package/dist/elements/public/TransactionCard/index.d.ts +2 -1
- package/dist/elements/public/TransactionCard/index.js +2 -1
- package/dist/elements/public/TransactionCard/index.js.map +1 -1
- package/dist/elements/public/TransactionCard/types.d.ts +8 -2
- package/dist/elements/public/TransactionCard/types.js.map +1 -1
- package/dist/mixins/themeable.js +4 -0
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-4761cbda.js +0 -1
- package/dist/cdn/shared-87142858.js +0 -1
- package/dist/cdn/shared-e9276306.js +0 -1
- package/dist/cdn/shared-eacc4539.js +0 -1
- package/dist/cdn/shared-ec59505f.js +0 -12
- package/dist/cdn/shared-f3cd4d07.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-30d00b64.js";import"./shared-ff9791cf.js";import{_ as e}from"./shared-1522d76f.js";import{s as l,h as t,c as a,L as s}from"./shared-7f33a83a.js";import{o as n}from"./shared-bb05cfed.js";import{c as o}from"./shared-4e709717.js";import{i}from"./shared-d3bf9ac0.js";import{a as r}from"./shared-79d0699c.js";import{r as d}from"./shared-d519a301.js";import{R as u,T as c,a as v}from"./shared-5fa697c4.js";import{I as p}from"./shared-30cbf0a6.js";import{C as f}from"./shared-b23c903e.js";var h,b;!function(e){e.Attribute="attribute",e.Boolean="boolean",e.String="string",e.Number="number",e.Date="date",e.Any="any"}(h||(h={})),function(e){e.LessThanOrEqual="lessthanorequal",e.LessThan="lessthan",e.GreaterThanOrEqual="greaterthanorequal",e.GreaterThan="greaterthan",e.IsDefined="isdefined",e.Not="not",e.In="in"}(b||(b={}));let g;const m=l(g||(g=(e=>e)`
|
|
2
2
|
<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path d="M26.4 14.7399C26.4 15.2922 25.9523 15.7399 25.4 15.7399H10.6C10.0477 15.7399 9.60001 15.2922 9.60001 14.7399V14.2C9.60001 13.6477 10.0477 13.2 10.6 13.2H25.4C25.9523 13.2 26.4 13.6477 26.4 14.2V14.7399ZM26.4 21.8C26.4 22.3523 25.9523 22.8 25.4 22.8H10.6C10.0477 22.8 9.60001 22.3523 9.60001 21.8V21.2601C9.60001 20.7078 10.0477 20.2601 10.6 20.2601H25.4C25.9523 20.2601 26.4 20.7078 26.4 21.2601V21.8Z" class="fill-current"/>
|
|
4
4
|
</svg>
|
|
@@ -61,4 +61,4 @@ import"./shared-54cbd346.js";import"./shared-6d0be1e4.js";import{_ as e}from"./s
|
|
|
61
61
|
<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
62
62
|
<path d="M11 11V14H16.5V26H19.5V14H25V11H11Z" class="fill-current"/>
|
|
63
63
|
</svg>
|
|
64
|
-
`));let R,U,G,W,F,Q=e=>e;function J(e){var l,a,s;const n=null===(a=null===(l=e.list)||void 0===l?void 0:l.every((l=>l.value!==e.value)))||void 0===a||a;return t(R||(R=Q` <label class="${0}"> <div class="relative flex-1 min-w-0 overflow-hidden"> <select class="${0}" ?disabled="${0}" @change="${0}"> ${0} ${0} </select> </div> ${0} </label> `),o({"flex items-center transition-colors group text-tertiary":!0,"cursor-pointer hover-bg-contrast-5":!e.disabled&&!e.readonly,"cursor-default":e.disabled||e.readonly}),o({"bg-transparent relative appearance-none flex h-m px-s":!0,"font-medium w-full max-w-full whitespace-nowrap focus-outline-none":!0,"text-tertiary":n&&!e.disabled,"text-body":!n&&!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":!n&&e.readonly,"cursor-pointer":!e.disabled&&!e.readonly,"cursor-default":e.disabled||e.readonly}),e.disabled||e.readonly,(l=>{const t=l.currentTarget,a=t.options[t.options.selectedIndex].value;e.onChange(a)}),n?t(U||(U=Q` <option value="" disabled="disabled" ?selected="${0}">${0}</option> `),n,e.t(e.label)):"",null===(s=e.list)||void 0===s?void 0:s.map((({label:l,value:a})=>t(G||(G=Q` <option value="${0}" ?selected="${0}"> ${0} </option> `),a,a===e.value,e.t(l)))),n?"":t(W||(W=Q` <span class="${0}"> ${0} </span> ${0} `),o({"font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.clearable&&!e.readonly?t(F||(F=Q` <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="icon-inline text-l" icon="icons:remove-circle-outline"> </iron-icon> </button> `),e.t("delete"),o({"w-s h-s mr-xs flex items-center justify-center transition-colors rounded-full":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"hover-bg-contrast-5 hover-text-error text-body":!e.disabled,"text-disabled":e.disabled}),e.disabled,(()=>e.onChange(""))):""))}let K,P,X,Y,ee,le=e=>e;function te(e){var l;const a=`${null!==(l=e.id)&&void 0!==l?l:String(Math.floor(Math.random()*Math.pow(10,8)))}-list`,s=!!e.displayValue;let n=e.value;if("date"===e.type){const l=new Date(e.value);n=isNaN(l.getTime())?"":r(l)}return t(K||(K=le` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> ${0} <input placeholder="${0}" class="${0}" list="${0}" type="${0}" max="${0}" .value="${0}" ?disabled="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} ${0} </label> `),s?t(P||(P=le` <div aria-hidden="true" class="${0}"> <div class="truncate">${0}</div> </div> `),o({"absolute inset-0 h-m px-s font-medium flex items-center":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.displayValue)):"",n||"date"===e.type?"":e.t(e.label),o({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0,"opacity-0 focus-opacity-100":s}),i(e.list?a:void 0),"date"===e.type?"datetime-local":e.type,i("date"===e.type?"9999-12-31T23:59":""),n,e.disabled||e.readonly,(l=>{const t=l.currentTarget;let a=t.value;try{if("date"===e.type){const e=new Date(t.value);isNaN(e.getTime())||(a=e.toISOString())}}catch(e){}e.onChange(a)}),o({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!n||"date"===e.type,"sr-only":!n&&"date"!==e.type,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.list?t(X||(X=le` <datalist id="${0}"> ${0} </datalist> `),a,e.list.map((({label:l,value:a})=>t(Y||(Y=le`<option value="${0}">${0}</option>`),a,e.t(l))))):"",e.disabled||e.readonly?"":t(ee||(ee=le` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let ae,se,ne=e=>e;let oe,ie=e=>e;function re({parsedValue:l,disabled:t,readonly:a,options:s,option:n,t:o,onChange:i}){return te({displayValue:null==n?void 0:n.label,disabled:t,readonly:a,value:l.path,label:"field",list:s.map((l=>e(e({},l),{},{value:l.path}))),type:"text",id:"path",t:o,onChange:e=>i({operator:null,value:"",path:e})})}let de,ue=e=>e;let ce,ve,pe=e=>e;function be(l){var a,s;const{parsedValue:i,isFullSize:r,isNested:u,readonly:c,disabled:v,options:p,t:b,onConvert:g,onDelete:C,onChange:x}=l,V=null!==(a=p.find((e=>e.path===i.path)))&&void 0!==a?a:null,H=null!==(s=null==V?void 0:V.type)&&void 0!==s?s:f.Any,M=i.operator,N={parsedValue:i,disabled:v,readonly:c,options:p,option:V,t:b,onChange:x},j={[f.Attribute]:B,[f.Boolean]:_,[f.Number]:S,[f.String]:z,[f.Date]:q,[f.Any]:A};return t(ce||(ce=pe` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="${0}"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base" title="${0}"> <div class="${0}" aria-hidden="true"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base">${0}</div> <div class="bg-base"> ${0} </div> </div> </div> </div> <div class="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:remove-circle-outline"> </iron-icon> </button> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:add-circle-outline"> </iron-icon> </button> </div> </div> `),b("query_builder_rule"),o({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!u&&!c,"border-contrast-50":!!u||c,"border-dashed":c,"border-solid":!c}),b(`type_${H}`),o({"w-m h-m":!0,"text-tertiary":!c&&!v,"text-disabled":c||v}),V?j[H]:A,i.path&&(H===f.Attribute||i.name)?t(ve||(ve=pe` <div class="bg-contrast-10 grid gap-1px grid-cols-1 sm-grid-cols-2"> <div class="bg-base">${0}</div> <div class="bg-base">${0}</div> </div> `),re(N),function(l){var t;return te({disabled:l.disabled,readonly:l.readonly,value:null!==(t=l.parsedValue.name)&&void 0!==t?t:"",label:"name",type:"text",t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{name:t}))})}(N)):re(N),function(l){const a=l.parsedValue.operator,s={[h.GreaterThan]:y,[h.GreaterThanOrEqual]:n,[h.In]:w,[h.IsDefined]:$,[h.LessThan]:L,[h.LessThanOrEqual]:Z,[h.Not]:I},i={[f.Attribute]:[h.In,h.Not,h.IsDefined],[f.Boolean]:[],[f.String]:[h.In,h.Not],[f.Number]:[h.In,h.Not,h.GreaterThan,h.LessThan,h.GreaterThanOrEqual,h.LessThanOrEqual],[f.Date]:[h.In,h.Not],[f.Any]:Object.values(h)},r=l.option?i[l.option.type]:l.parsedValue.name?Object.values(h):Object.values(h).filter((e=>e!==h.IsDefined)),d=l.disabled||l.readonly||0===r.length||!l.parsedValue.path;return t(oe||(oe=ie` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),l.t(`operator_${null!=a?a:"equal"}`),o({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-disabled cursor-default":d,"hover-bg-contrast-5":!d}),d,(()=>{var t;const s=a?r.indexOf(a):-1,n=null!==(t=r[s+1])&&void 0!==t?t:null;l.onChange(e(e({},l.parsedValue),{},{operator:n,value:l.parsedValue.value}))}),a?s[a]:m)}(N),M===h.In?function(l){var a,s,n,o;const i=(null===(a=l.option)||void 0===a?void 0:a.list)?J:te,r=l.parsedValue.value.split(","),u=null!==(n=null===(s=l.option)||void 0===s?void 0:s.type)&&void 0!==n?n:f.Any,c=u===f.Number?"number":u===f.Date?"date":"text",v=null===(o=l.option)||void 0===o?void 0:o.list,p=[...r.filter((e=>!!e))];return l.readonly||p.push(null),t(ae||(ae=ne` <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> `),d(p,((e,l)=>l),((a,s)=>{var n;return t(se||(se=ne` <div class="bg-base"> ${0} </div> `),i({type:c,list:v,t:l.t,value:null!=a?a:"",label:a?String(s+1):"add_value",disabled:l.disabled,readonly:l.readonly,clearable:!0,displayValue:null===(n=null==v?void 0:v.find((e=>e.value===a)))||void 0===n?void 0:n.label,onChange:t=>{t?r[s]=t:r.splice(s,1),l.onChange(e(e({},l.parsedValue),{},{value:r.join(",")}))}}))})))}(N):M===h.IsDefined?function(l){return J({readonly:l.readonly,disabled:l.disabled,value:l.parsedValue.value,label:"value",list:[{label:"is_defined_true",value:"true"},{label:"is_defined_false",value:"false"}],t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{value:t}))})}(N):H===f.Boolean?function(l){var t,a,s,n,o,i;const{parsedValue:r,option:d,readonly:u,disabled:c,t:v,onChange:p}=l,b=null!==(s=null===(a=null===(t=null==d?void 0:d.list)||void 0===t?void 0:t.find((e=>"false"===e.value)))||void 0===a?void 0:a.label)&&void 0!==s?s:"false",f=[{label:null!==(i=null===(o=null===(n=null==d?void 0:d.list)||void 0===n?void 0:n.find((e=>"true"===e.value)))||void 0===o?void 0:o.label)&&void 0!==i?i:"true",value:"true"},{label:b,value:"false"}];return J({disabled:c,readonly:u,value:r.value,label:"value",list:f,t:v,onChange:l=>p(e(e({},r),{},{value:l}))})}(N):null===M&&[f.Number,f.Date].includes(H)?function(l){var a,s,n;const{t:o,parsedValue:i,option:r,readonly:d,disabled:u,onChange:c}=l,v=i.value.split(".."),p=v.length>=1?v[0]:"",b=v.length>=2?v[1]:"",h=(null==r?void 0:r.list)?J:te,g=null!==(a=null==r?void 0:r.type)&&void 0!==a?a:f.Any,m=g===f.Number?"number":g===f.Date?"date":"text",C=null==r?void 0:r.list;return t(de||(de=ue` <div class="grid bg-contrast-10 gap-1px grid-cols-1 grid-rows-2 sm-grid-cols-2 sm-grid-rows-1"> <div class="bg-base"> ${0} </div> <div class="bg-base"> ${0} </div> </div> `),h({displayValue:null===(s=null==C?void 0:C.find((e=>e.value===p)))||void 0===s?void 0:s.label,readonly:d,disabled:u,value:p,label:"range_from",type:m,list:C,t:o,onChange:l=>c(e(e({},i),{},{value:`${l}..${b}`}))}),h({displayValue:null===(n=null==C?void 0:C.find((e=>e.value===b)))||void 0===n?void 0:n.label,readonly:d,disabled:u,label:"range_to",value:b,type:m,list:C,t:o,onChange:l=>c(e(e({},i),{},{value:`${p}..${l}`}))}))}(N):function(l){var t,a,s,n;const{t:o,option:i,parsedValue:r,readonly:d,disabled:u,onChange:c}=l,v=(null==i?void 0:i.list)?J:te,p=null!==(t=null==i?void 0:i.type)&&void 0!==t?t:f.Any;return v({displayValue:null===(s=null===(a=null==i?void 0:i.list)||void 0===a?void 0:a.find((e=>e.value===r.value)))||void 0===s?void 0:s.label,readonly:d,disabled:u||!r.path,value:null!==(n=r.value)&&void 0!==n?n:"",label:"value",type:p===f.Number?"number":p===f.Date?"date":"text",list:null==i?void 0:i.list,t:o,onChange:l=>c(e(e({},r),{},{value:l}))})}(N),o({"-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center":!0,"border-t border-b border-transparent divide-y divide-transparent":!0,hidden:!!r||c,flex:!r}),b("delete"),o({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!v,"cursor-default text-disabled":v,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path}),v||c||!i.path,C,b("add_or_clause"),o({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-success hover-bg-contrast-5":!v,"cursor-default text-disabled":v,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path||!!u}),v||c||!i.path,g)}let fe,he,ge,me,Ce=e=>e;function ye(l){const a=t(fe||(fe=Ce`<div class="h-xs"></div>`)),s=t(he||(he=Ce` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-30"> ${0} </div> <div class="flex-1 border-t border-contrast-20"></div> <div class="w-m ml-s flex-shrink-0"></div> <div class="hidden sm-block w-m flex-shrink-0"></div> </div> `),l.t("or"));return t(ge||(ge=Ce` <div aria-label="${0}"> ${0} </div> `),l.t("query_builder_group"),d([...l.parsedValues,null],((e,l)=>String(l)),((n,o)=>{const i=o>0?l.isNested?s:a:"";return null===n?[i,be({isFullSize:!l.isNested&&0===l.parsedValues.length,isNested:l.isNested,disabled:l.disabled,readonly:l.readonly,options:l.options,parsedValue:{path:"",operator:null,value:""},t:l.t,onChange:e=>l.onChange([...l.parsedValues,e])})]:Array.isArray(n)?[i,t(me||(me=Ce` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),ye({parsedValues:n,isNested:!0,disabled:l.disabled,readonly:l.readonly,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues],a=e;t[o]=e.length>1?a:a[0],l.onChange(t)}}))]:[i,be({parsedValue:n,isNested:l.isNested,disabled:l.disabled,readonly:l.readonly,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues];t[o]=e,l.onChange(t)},onDelete:()=>{const e=l.parsedValues.filter(((e,l)=>l!==o));l.onChange(e)},onConvert:()=>{const t=[...l.parsedValues];t[o]=[n,e(e({},n),{},{operator:null,value:""})],l.onChange(t)}})]})))}function xe(e){var l;const[t,a]=e.split("=").map(decodeURIComponent),s=null!==(l=Object.values(h).find((e=>t.endsWith(`:${e}`))))&&void 0!==l?l:null;let n,o=t.substring(0,s?t.lastIndexOf(":"):void 0);const i=t.lastIndexOf("[");return o.endsWith("]")&&-1!==i&&(n=o.substring(i+1,o.length-1),o=o.substring(0,i),o.endsWith(":name")&&(o=o.substring(0,o.length-5))),{name:n,path:o,value:a,operator:s}}function we(e){let l=e.path;return e.name&&(l+=`:name[${e.name}]`),e.operator&&(l+=`:${e.operator}`),l=`${encodeURIComponent(l)}=${encodeURIComponent(e.value)}`,"="===l?"":l}function Ve(e){const l=e.reduce(((e,l)=>{if(Array.isArray(l)){const t=[l[0].value,l.slice(1).map((e=>we(e)))].join("|");e.push(`${l[0].path}=${encodeURIComponent(t)}`)}else"zoom"!==l.path&&e.push(we(l));return e}),[]),t=$e(e).join(",");return t&&l.push(`zoom=${encodeURIComponent(t)}`),l.join("&")}function $e(e){return e.map((e=>{if(Array.isArray(e))return $e(e);if(e.name)return[e.path];const l=e.path.split(":");return l.slice(0,l.length-1)})).flat().sort(((e,l)=>l.length-e.length)).filter(((e,l,t)=>t.every(((t,a)=>(a>=l||t!==e)&&!t.startsWith(`${e}:`)))))}let He;const Le=a(He||(He=(e=>e)`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`)),Me=b(u(c(v(p(s),"query-builder"))));class Ze extends Me{constructor(){super(...arguments),this.options=null,this.value=null}static get properties(){return e(e({},super.properties),{},{options:{type:Array},value:{type:String}})}static get styles(){return[super.styles,Le]}render(){var e,l;const t=new Set(["zoom","limit","offset","order","fields"]),a=[],s=[];var n;return(n=null!==(e=this.value)&&void 0!==e?e:"",n.split("&").filter((e=>!!e)).map((e=>{const[l,t]=e.split("=").map(decodeURIComponent);return(null==t?void 0:t.includes("|"))?`${encodeURIComponent(l)}=${t}`.split("|").map((e=>xe(e))):xe(e)}))).forEach((e=>{Array.isArray(e)||!t.has(e.path)?s.push(e):a.push(e)})),ye({parsedValues:s,disabled:this.disabled,readonly:this.readonly,options:null!==(l=this.options)&&void 0!==l?l:[],t:this.t.bind(this),onChange:e=>{this.value=Ve([...e,...a]),this.dispatchEvent(new Ze.ChangeEvent("change"))}})}}Ze.ChangeEvent=class extends CustomEvent{},Ze.Operator=h,Ze.Type=f,customElements.define("foxy-query-builder",Ze);export{Ze as Q,f as T};
|
|
64
|
+
`));let R,U,G,W,F,Q=e=>e;function J(e){var l,a,s;const n=null===(a=null===(l=e.list)||void 0===l?void 0:l.every((l=>l.value!==e.value)))||void 0===a||a;return t(R||(R=Q` <label class="${0}"> <div class="relative flex-1 min-w-0 overflow-hidden"> <select class="${0}" ?disabled="${0}" @change="${0}"> ${0} ${0} </select> </div> ${0} </label> `),o({"flex items-center transition-colors group text-tertiary":!0,"cursor-pointer hover-bg-contrast-5":!e.disabled&&!e.readonly,"cursor-default":e.disabled||e.readonly}),o({"bg-transparent relative appearance-none flex h-m px-s":!0,"font-medium w-full max-w-full whitespace-nowrap focus-outline-none":!0,"text-tertiary":n&&!e.disabled,"text-body":!n&&!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":!n&&e.readonly,"cursor-pointer":!e.disabled&&!e.readonly,"cursor-default":e.disabled||e.readonly}),e.disabled||e.readonly,(l=>{const t=l.currentTarget,a=t.options[t.options.selectedIndex].value;e.onChange(a)}),n?t(U||(U=Q` <option value="" disabled="disabled" ?selected="${0}">${0}</option> `),n,e.t(e.label)):"",null===(s=e.list)||void 0===s?void 0:s.map((({label:l,value:a})=>t(G||(G=Q` <option value="${0}" ?selected="${0}"> ${0} </option> `),a,a===e.value,e.t(l)))),n?"":t(W||(W=Q` <span class="${0}"> ${0} </span> ${0} `),o({"font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.clearable&&!e.readonly?t(F||(F=Q` <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="icon-inline text-l" icon="icons:remove-circle-outline"> </iron-icon> </button> `),e.t("delete"),o({"w-s h-s mr-xs flex items-center justify-center transition-colors rounded-full":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"hover-bg-contrast-5 hover-text-error text-body":!e.disabled,"text-disabled":e.disabled}),e.disabled,(()=>e.onChange(""))):""))}let K,P,X,Y,ee,le=e=>e;function te(e){var l;const a=`${null!==(l=e.id)&&void 0!==l?l:String(Math.floor(Math.random()*Math.pow(10,8)))}-list`,s=!!e.displayValue;let n=e.value;if("date"===e.type){const l=new Date(e.value);n=isNaN(l.getTime())?"":r(l)}return t(K||(K=le` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> ${0} <input placeholder="${0}" class="${0}" list="${0}" type="${0}" max="${0}" .value="${0}" ?disabled="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} ${0} </label> `),s?t(P||(P=le` <div aria-hidden="true" class="${0}"> <div class="truncate">${0}</div> </div> `),o({"absolute inset-0 h-m px-s font-medium flex items-center":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.displayValue)):"",n||"date"===e.type?"":e.t(e.label),o({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0,"opacity-0 focus-opacity-100":s}),i(e.list?a:void 0),"date"===e.type?"datetime-local":e.type,i("date"===e.type?"9999-12-31T23:59":""),n,e.disabled||e.readonly,(l=>{const t=l.currentTarget;let a=t.value;try{if("date"===e.type){const e=new Date(t.value);isNaN(e.getTime())||(a=e.toISOString())}}catch(e){}e.onChange(a)}),o({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!n||"date"===e.type,"sr-only":!n&&"date"!==e.type,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.list?t(X||(X=le` <datalist id="${0}"> ${0} </datalist> `),a,e.list.map((({label:l,value:a})=>t(Y||(Y=le`<option value="${0}">${0}</option>`),a,e.t(l))))):"",e.disabled||e.readonly?"":t(ee||(ee=le` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let ae,se,ne=e=>e;let oe,ie=e=>e;function re({parsedValue:l,disabled:t,readonly:a,options:s,option:n,t:o,onChange:i}){return te({displayValue:null==n?void 0:n.label,disabled:t,readonly:a,value:l.path,label:"field",list:s.map((l=>e(e({},l),{},{value:l.path}))),type:"text",id:"path",t:o,onChange:e=>i({operator:null,value:"",path:e})})}let de,ue=e=>e;let ce,ve,pe=e=>e;function fe(l){var a,s;const{parsedValue:i,isFullSize:r,isNested:u,readonly:c,disabled:v,options:p,t:f,onConvert:g,onDelete:C,onChange:x}=l,V=null!==(a=p.find((e=>e.path===i.path)))&&void 0!==a?a:null,H=null!==(s=null==V?void 0:V.type)&&void 0!==s?s:h.Any,M=i.operator,N={parsedValue:i,disabled:v,readonly:c,options:p,option:V,t:f,onChange:x},j={[h.Attribute]:B,[h.Boolean]:_,[h.Number]:S,[h.String]:z,[h.Date]:q,[h.Any]:A};return t(ce||(ce=pe` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="${0}"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base" title="${0}"> <div class="${0}" aria-hidden="true"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base">${0}</div> <div class="bg-base"> ${0} </div> </div> </div> </div> <div class="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:remove-circle-outline"> </iron-icon> </button> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:add-circle-outline"> </iron-icon> </button> </div> </div> `),f("query_builder_rule"),o({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!u&&!c,"border-contrast-50":!!u||c,"border-dashed":c,"border-solid":!c}),f(`type_${H}`),o({"w-m h-m":!0,"text-tertiary":!c&&!v,"text-disabled":c||v}),V?j[H]:A,i.path&&(H===h.Attribute||i.name)?t(ve||(ve=pe` <div class="bg-contrast-10 grid gap-1px grid-cols-1 sm-grid-cols-2"> <div class="bg-base">${0}</div> <div class="bg-base">${0}</div> </div> `),re(N),function(l){var t;return te({disabled:l.disabled,readonly:l.readonly,value:null!==(t=l.parsedValue.name)&&void 0!==t?t:"",label:"name",type:"text",t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{name:t}))})}(N)):re(N),function(l){const a=l.parsedValue.operator,s={[b.GreaterThan]:y,[b.GreaterThanOrEqual]:n,[b.In]:w,[b.IsDefined]:$,[b.LessThan]:L,[b.LessThanOrEqual]:Z,[b.Not]:I},i={[h.Attribute]:[b.In,b.Not,b.IsDefined],[h.Boolean]:[],[h.String]:[b.In,b.Not],[h.Number]:[b.In,b.Not,b.GreaterThan,b.LessThan,b.GreaterThanOrEqual,b.LessThanOrEqual],[h.Date]:[b.In,b.Not],[h.Any]:Object.values(b)},r=l.option?i[l.option.type]:l.parsedValue.name?Object.values(b):Object.values(b).filter((e=>e!==b.IsDefined)),d=l.disabled||l.readonly||0===r.length||!l.parsedValue.path;return t(oe||(oe=ie` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),l.t(`operator_${null!=a?a:"equal"}`),o({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-disabled cursor-default":d,"hover-bg-contrast-5":!d}),d,(()=>{var t;const s=a?r.indexOf(a):-1,n=null!==(t=r[s+1])&&void 0!==t?t:null;l.onChange(e(e({},l.parsedValue),{},{operator:n,value:l.parsedValue.value}))}),a?s[a]:m)}(N),M===b.In?function(l){var a,s,n,o;const i=(null===(a=l.option)||void 0===a?void 0:a.list)?J:te,r=l.parsedValue.value.split(","),u=null!==(n=null===(s=l.option)||void 0===s?void 0:s.type)&&void 0!==n?n:h.Any,c=u===h.Number?"number":u===h.Date?"date":"text",v=null===(o=l.option)||void 0===o?void 0:o.list,p=[...r.filter((e=>!!e))];return l.readonly||p.push(null),t(ae||(ae=ne` <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> `),d(p,((e,l)=>l),((a,s)=>{var n;return t(se||(se=ne` <div class="bg-base"> ${0} </div> `),i({type:c,list:v,t:l.t,value:null!=a?a:"",label:a?String(s+1):"add_value",disabled:l.disabled,readonly:l.readonly,clearable:!0,displayValue:null===(n=null==v?void 0:v.find((e=>e.value===a)))||void 0===n?void 0:n.label,onChange:t=>{t?r[s]=t:r.splice(s,1),l.onChange(e(e({},l.parsedValue),{},{value:r.join(",")}))}}))})))}(N):M===b.IsDefined?function(l){return J({readonly:l.readonly,disabled:l.disabled,value:l.parsedValue.value,label:"value",list:[{label:"is_defined_true",value:"true"},{label:"is_defined_false",value:"false"}],t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{value:t}))})}(N):H===h.Boolean?function(l){var t,a,s,n,o,i;const{parsedValue:r,option:d,readonly:u,disabled:c,t:v,onChange:p}=l,f=null!==(s=null===(a=null===(t=null==d?void 0:d.list)||void 0===t?void 0:t.find((e=>"false"===e.value)))||void 0===a?void 0:a.label)&&void 0!==s?s:"false",h=[{label:null!==(i=null===(o=null===(n=null==d?void 0:d.list)||void 0===n?void 0:n.find((e=>"true"===e.value)))||void 0===o?void 0:o.label)&&void 0!==i?i:"true",value:"true"},{label:f,value:"false"}];return J({disabled:c,readonly:u,value:r.value,label:"value",list:h,t:v,onChange:l=>p(e(e({},r),{},{value:l}))})}(N):null===M&&[h.Number,h.Date].includes(H)?function(l){var a,s,n;const{t:o,parsedValue:i,option:r,readonly:d,disabled:u,onChange:c}=l,v=i.value.split(".."),p=v.length>=1?v[0]:"",f=v.length>=2?v[1]:"",b=(null==r?void 0:r.list)?J:te,g=null!==(a=null==r?void 0:r.type)&&void 0!==a?a:h.Any,m=g===h.Number?"number":g===h.Date?"date":"text",C=null==r?void 0:r.list;return t(de||(de=ue` <div class="grid bg-contrast-10 gap-1px grid-cols-1 grid-rows-2 sm-grid-cols-2 sm-grid-rows-1"> <div class="bg-base"> ${0} </div> <div class="bg-base"> ${0} </div> </div> `),b({displayValue:null===(s=null==C?void 0:C.find((e=>e.value===p)))||void 0===s?void 0:s.label,readonly:d,disabled:u,value:p,label:"range_from",type:m,list:C,t:o,onChange:l=>c(e(e({},i),{},{value:`${l}..${f}`}))}),b({displayValue:null===(n=null==C?void 0:C.find((e=>e.value===f)))||void 0===n?void 0:n.label,readonly:d,disabled:u,label:"range_to",value:f,type:m,list:C,t:o,onChange:l=>c(e(e({},i),{},{value:`${p}..${l}`}))}))}(N):function(l){var t,a,s,n;const{t:o,option:i,parsedValue:r,readonly:d,disabled:u,onChange:c}=l,v=(null==i?void 0:i.list)?J:te,p=null!==(t=null==i?void 0:i.type)&&void 0!==t?t:h.Any;return v({displayValue:null===(s=null===(a=null==i?void 0:i.list)||void 0===a?void 0:a.find((e=>e.value===r.value)))||void 0===s?void 0:s.label,readonly:d,disabled:u||!r.path,value:null!==(n=r.value)&&void 0!==n?n:"",label:"value",type:p===h.Number?"number":p===h.Date?"date":"text",list:null==i?void 0:i.list,t:o,onChange:l=>c(e(e({},r),{},{value:l}))})}(N),o({"-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center":!0,"border-t border-b border-transparent divide-y divide-transparent":!0,hidden:!!r||c,flex:!r}),f("delete"),o({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!v,"cursor-default text-disabled":v,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path}),v||c||!i.path,C,f("add_or_clause"),o({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-success hover-bg-contrast-5":!v,"cursor-default text-disabled":v,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path||!!u}),v||c||!i.path,g)}let he,be,ge,me,Ce=e=>e;function ye(l){const a=t(he||(he=Ce`<div class="h-xs"></div>`)),s=t(be||(be=Ce` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-30"> ${0} </div> <div class="flex-1 border-t border-contrast-20"></div> <div class="w-m ml-s flex-shrink-0"></div> <div class="hidden sm-block w-m flex-shrink-0"></div> </div> `),l.t("or"));return t(ge||(ge=Ce` <div aria-label="${0}"> ${0} </div> `),l.t("query_builder_group"),d([...l.parsedValues,null],((e,l)=>String(l)),((n,o)=>{const i=o>0?l.isNested?s:a:"";return null===n?[i,fe({isFullSize:!l.isNested&&0===l.parsedValues.length,isNested:l.isNested,disabled:l.disabled,readonly:l.readonly,options:l.options,parsedValue:{path:"",operator:null,value:""},t:l.t,onChange:e=>l.onChange([...l.parsedValues,e])})]:Array.isArray(n)?[i,t(me||(me=Ce` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),ye({parsedValues:n,isNested:!0,disabled:l.disabled,readonly:l.readonly,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues],a=e;t[o]=e.length>1?a:a[0],l.onChange(t)}}))]:[i,fe({parsedValue:n,isNested:l.isNested,disabled:l.disabled,readonly:l.readonly,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues];t[o]=e,l.onChange(t)},onDelete:()=>{const e=l.parsedValues.filter(((e,l)=>l!==o));l.onChange(e)},onConvert:()=>{const t=[...l.parsedValues];t[o]=[n,e(e({},n),{},{operator:null,value:""})],l.onChange(t)}})]})))}function xe(e){var l;const[t,a]=e.split("=").map(decodeURIComponent),s=null!==(l=Object.values(b).find((e=>t.endsWith(`:${e}`))))&&void 0!==l?l:null;let n,o=t.substring(0,s?t.lastIndexOf(":"):void 0);const i=t.lastIndexOf("[");return o.endsWith("]")&&-1!==i&&(n=o.substring(i+1,o.length-1),o=o.substring(0,i),o.endsWith(":name")&&(o=o.substring(0,o.length-5))),{name:n,path:o,value:a,operator:s}}function we(e){let l=e.path;return e.name&&(l+=`:name[${e.name}]`),e.operator&&(l+=`:${e.operator}`),l=`${encodeURIComponent(l)}=${encodeURIComponent(e.value)}`,"="===l?"":l}function Ve(e){const l=e.reduce(((e,l)=>{if(Array.isArray(l)){const t=[l[0].value,l.slice(1).map((e=>we(e)))].join("|");e.push(`${l[0].path}=${encodeURIComponent(t)}`)}else"zoom"!==l.path&&e.push(we(l));return e}),[]),t=$e(e).join(",");return t&&l.push(`zoom=${encodeURIComponent(t)}`),l.join("&")}function $e(e){return e.map((e=>{if(Array.isArray(e))return $e(e);if(e.name)return[e.path];const l=e.path.split(":");return l.slice(0,l.length-1)})).flat().sort(((e,l)=>l.length-e.length)).filter(((e,l,t)=>t.every(((t,a)=>(a>=l||t!==e)&&!t.startsWith(`${e}:`)))))}let He;const Le=a(He||(He=(e=>e)`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`)),Me=f(u(c(v(p(s),"query-builder"))));class Ze extends Me{constructor(){super(...arguments),this.options=null,this.value=null}static get properties(){return e(e({},super.properties),{},{options:{type:Array},value:{type:String}})}static get styles(){return[super.styles,Le]}render(){var e,l;const t=new Set(["zoom","limit","offset","order","fields"]),a=[],s=[];var n;return(n=null!==(e=this.value)&&void 0!==e?e:"",n.split("&").filter((e=>!!e)).map((e=>{const[l,t]=e.split("=").map(decodeURIComponent);return(null==t?void 0:t.includes("|"))?`${encodeURIComponent(l)}=${t}`.split("|").map((e=>xe(e))):xe(e)}))).forEach((e=>{Array.isArray(e)||!t.has(e.path)?s.push(e):a.push(e)})),ye({parsedValues:s,disabled:this.disabled,readonly:this.readonly,options:null!==(l=this.options)&&void 0!==l?l:[],t:this.t.bind(this),onChange:e=>{this.value=Ve([...e,...a]),this.dispatchEvent(new Ze.ChangeEvent("change"))}})}}Ze.ChangeEvent=class extends CustomEvent{},Ze.Operator=b,Ze.Type=h,customElements.define("foxy-query-builder",Ze);export{Ze as Q,h as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as r,h as s}from"./shared-7f33a83a.js";import{w as e}from"./shared-
|
|
1
|
+
import{L as r,h as s}from"./shared-7f33a83a.js";import{w as e}from"./shared-5fa697c4.js";let t,o=r=>r;class a extends r{static get styles(){return e.styles}render(){return s(t||(t=o` <p class="flex text-s border border-contrast-10 rounded p-s text-body leading-s"> <iron-icon icon="lumo:error" class="text-error flex-shrink-0 mr-s"></iron-icon> <slot></slot> </p> `))}}export{a as W};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./shared-
|
|
1
|
+
import{I as e}from"./shared-fc15a882.js";import{_ as t}from"./shared-1522d76f.js";class r extends e{constructor(){super(...arguments),this.getValue=()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.form[this.property]},this.setValue=e=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[this.property]:e})},this.__placeholder=null,this.__helperText=null,this.__v8nPrefix=null,this.__property=null,this.__label=null}static get properties(){return t(t({},super.properties),{},{placeholder:{type:String,noAccessor:!0},helperText:{type:String,attribute:"helper-text",noAccessor:!0},v8nPrefix:{type:String,attribute:"v8n-prefix",noAccessor:!0},getValue:{attribute:!1},setValue:{attribute:!1},property:{type:String,noAccessor:!0},label:{type:String,noAccessor:!0}})}get placeholder(){return"string"==typeof this.__placeholder?this.__placeholder:this.t("placeholder")}set placeholder(e){this.requestUpdate("placeholder",this.__placeholder),this.__placeholder=e}get helperText(){return"string"==typeof this.__helperText?this.__helperText:this.t("helper_text")}set helperText(e){this.requestUpdate("helperText",this.__helperText),this.__helperText=e}get v8nPrefix(){return"string"==typeof this.__v8nPrefix?this.__v8nPrefix:"string"==typeof this.infer?`${this.infer}:`:""}set v8nPrefix(e){this.requestUpdate("v8nPrefix",this.__v8nPrefix),this.__v8nPrefix=e}get property(){return"string"==typeof this.__property?this.__property:"string"==typeof this.infer?this.infer.replace(/-/g,"_"):""}set property(e){this.requestUpdate("property",this.__property),this.__property=e}get label(){return"string"==typeof this.__label?this.__label:this.t("label")}set label(e){this.requestUpdate("label",this.__label),this.__label=e}resetPlaceholder(){this.requestUpdate("placeholder",this.__placeholder),this.__placeholder=null}resetHelperText(){this.requestUpdate("helperText",this.__helperText),this.__helperText=null}resetV8nPrefix(){this.requestUpdate("v8nPrefix",this.__v8nPrefix),this.__v8nPrefix=null}resetProperty(){this.requestUpdate("property",this.__property),this.__property=null}resetLabel(){this.requestUpdate("label",this.__label),this.__label=null}reportValidity(){const e=this.ownerDocument.createTreeWalker(this.renderRoot,NodeFilter.SHOW_ELEMENT);do{const t=e.currentNode,r=["reportValidity","validate"];for(const e of r)if(e in t)try{t[e]();break}catch(e){continue}}while(e.nextNode())}get _value(){return this.getValue()}set _value(e){const t=new CustomEvent("change",{cancelable:!0,detail:e});this.dispatchEvent(t)&&this.setValue(e)}get _error(){var e;return null===(e=this.nucleon)||void 0===e?void 0:e.errors.find((e=>e.startsWith(this.v8nPrefix)))}get _errorMessage(){return this._error?this.t(this._error.substring(this.v8nPrefix.length)):void 0}get _checkValidity(){return()=>!this._error}}customElements.define("foxy-internal-editable-control",r);export{r as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as t,
|
|
1
|
+
import{E as t,T as e}from"./shared-f9a3d1ff.js";import{h as o,G as r,P as i,b as a}from"./shared-43f449bb.js";import{C as s}from"./shared-61ade33e.js";const n=o`<dom-module id="lumo-button" theme-for="vaadin-button">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -287,7 +287,7 @@ import{E as t,C as e,T as o}from"./shared-ec59505f.js";import{h as r,G as i,P as
|
|
|
287
287
|
Copyright (c) 2017 Vaadin Ltd.
|
|
288
288
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
289
289
|
*/
|
|
290
|
-
class l extends(t(e(
|
|
290
|
+
class l extends(t(s(e(r(i))))){static get template(){return o`
|
|
291
291
|
<style>
|
|
292
292
|
:host {
|
|
293
293
|
display: inline-block;
|
|
@@ -355,4 +355,4 @@ class l extends(t(e(o(i(a))))){static get template(){return r`
|
|
|
355
355
|
</div>
|
|
356
356
|
</div>
|
|
357
357
|
<button id="button" type="button"></button>
|
|
358
|
-
`}static get is(){return"vaadin-button"}static get version(){return"2.4.0"}ready(){super.ready(),this.setAttribute("role","button"),this.$.button.setAttribute("role","presentation"),this._addActiveListeners(),window.ShadyDOM&&window.ShadyDOM.flush()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("active")&&this.removeAttribute("active")}_addActiveListeners(){
|
|
358
|
+
`}static get is(){return"vaadin-button"}static get version(){return"2.4.0"}ready(){super.ready(),this.setAttribute("role","button"),this.$.button.setAttribute("role","presentation"),this._addActiveListeners(),window.ShadyDOM&&window.ShadyDOM.flush()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("active")&&this.removeAttribute("active")}_addActiveListeners(){a(this,"down",(()=>!this.disabled&&this.setAttribute("active",""))),a(this,"up",(()=>this.removeAttribute("active"))),this.addEventListener("keydown",(t=>!this.disabled&&[13,32].indexOf(t.keyCode)>=0&&this.setAttribute("active",""))),this.addEventListener("keyup",(()=>this.removeAttribute("active"))),this.addEventListener("blur",(()=>this.removeAttribute("active")))}get focusElement(){return this.$.button}}customElements.define(l.is,l);export{l as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as e,
|
|
1
|
+
import{E as e,T as t}from"./shared-f9a3d1ff.js";import"./shared-b509bc2c.js";import{h as r,D as n,t as a,a as i,P as o}from"./shared-43f449bb.js";import{C as l}from"./shared-61ade33e.js";const s=document.createElement("template");s.innerHTML='<dom-module id="lumo-required-field">\n <template>\n <style>\n [part="label"] {\n align-self: flex-start;\n color: var(--lumo-secondary-text-color);\n font-weight: 500;\n font-size: var(--lumo-font-size-s);\n margin-left: calc(var(--lumo-border-radius-m) / 4);\n transition: color 0.2s;\n line-height: 1;\n padding-bottom: 0.5em;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n position: relative;\n max-width: 100%;\n box-sizing: border-box;\n }\n\n :host([has-label])::before {\n margin-top: calc(var(--lumo-font-size-s) * 1.5);\n }\n\n :host([has-label]) {\n padding-top: var(--lumo-space-m);\n }\n\n :host([required]) [part="label"] {\n padding-right: 1em;\n }\n\n [part="label"]::after {\n content: var(--lumo-required-field-indicator, "•");\n transition: opacity 0.2s;\n opacity: 0;\n color: var(--lumo-primary-text-color);\n position: absolute;\n right: 0;\n width: 1em;\n text-align: center;\n }\n\n :host([required]:not([has-value])) [part="label"]::after {\n opacity: 1;\n }\n\n :host([invalid]) [part="label"]::after {\n color: var(--lumo-error-text-color);\n }\n\n [part="error-message"] {\n margin-left: calc(var(--lumo-border-radius-m) / 4);\n font-size: var(--lumo-font-size-xs);\n line-height: var(--lumo-line-height-xs);\n color: var(--lumo-error-text-color);\n will-change: max-height;\n transition: 0.4s max-height;\n max-height: 5em;\n }\n\n /* Margin that doesn’t reserve space when there’s no error message */\n [part="error-message"]:not(:empty)::before,\n [part="error-message"]:not(:empty)::after {\n content: "";\n display: block;\n height: 0.4em;\n }\n\n :host(:not([invalid])) [part="error-message"] {\n max-height: 0;\n overflow: hidden;\n }\n\n /* RTL specific styles */\n\n :host([dir="rtl"]) [part="label"] {\n margin-left: 0;\n margin-right: calc(var(--lumo-border-radius-m) / 4);\n }\n\n :host([required][dir="rtl"]) [part="label"] {\n padding-left: 1em;\n padding-right: 0;\n }\n\n :host([dir="rtl"]) [part="label"]::after {\n right: auto;\n left: 0;\n }\n\n :host([dir="rtl"]) [part="error-message"] {\n margin-left: 0;\n margin-right: calc(var(--lumo-border-radius-m) / 4);\n }\n\n </style>\n </template>\n</dom-module>',document.head.appendChild(s.content);const d=document.createElement("template");d.innerHTML='<dom-module id="lumo-field-button">\n <template>\n <style>\n [part$="button"] {\n flex: none;\n width: 1em;\n height: 1em;\n line-height: 1;\n font-size: var(--lumo-icon-size-m);\n text-align: center;\n color: var(--lumo-contrast-60pct);\n transition: 0.2s color;\n cursor: var(--lumo-clickable-cursor);\n }\n\n :host(:not([readonly])) [part$="button"]:hover {\n color: var(--lumo-contrast-90pct);\n }\n\n :host([disabled]) [part$="button"],\n :host([readonly]) [part$="button"] {\n color: var(--lumo-contrast-20pct);\n }\n\n [part$="button"]::before {\n font-family: "lumo-icons";\n display: block;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(d.content);const h=r`<dom-module id="lumo-text-field" theme-for="vaadin-text-field">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-required-field lumo-field-button">
|
|
4
4
|
:host {
|
|
@@ -489,12 +489,12 @@ const u=r`<dom-module id="vaadin-text-field-shared-styles">
|
|
|
489
489
|
}
|
|
490
490
|
</style>
|
|
491
491
|
</template>
|
|
492
|
-
</dom-module>`;document.head.appendChild(u.content);const p={default:["list","autofocus","pattern","autocapitalize","autocorrect","maxlength","minlength","name","placeholder","autocomplete","title","disabled","readonly","required"],accessible:["invalid"]},c={DEFAULT:"default",ACCESSIBLE:"accessible"},m=e=>class extends e{static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String},autoselect:{type:Boolean,value:!1},clearButtonVisible:{type:Boolean,value:!1},errorMessage:{type:String,value:"",observer:"_errorMessageChanged"},i18n:{type:Object,value:()=>({clear:"Clear"})},label:{type:String,value:"",observer:"_labelChanged"},helperText:{type:String,value:"",observer:"_helperTextChanged"},maxlength:{type:Number},minlength:{type:Number},name:{type:String},placeholder:{type:String},readonly:{type:Boolean,reflectToAttribute:!0},required:{type:Boolean,reflectToAttribute:!0},value:{type:String,value:"",observer:"_valueChanged",notify:!0},_hasInputValue:{type:Boolean,value:!1,observer:"_hasInputValueChanged"},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},hasValue:{type:Boolean,reflectToAttribute:!0},preventInvalidInput:{type:Boolean},_enabledCharPattern:String,_labelId:String,_helperTextId:String,_errorId:String,_inputId:String,_hasSlottedHelper:Boolean}}static get observers(){return["_stateChanged(disabled, readonly, clearButtonVisible, hasValue)","_hostPropsChanged("+p.default.join(", ")+")","_hostAccessiblePropsChanged("+p.accessible.join(", ")+")","_getActiveErrorId(invalid, errorMessage, _errorId, helperText, _helperTextId, _hasSlottedHelper)","_getActiveLabelId(label, _labelId, _inputId)","__observeOffsetHeight(errorMessage, invalid, label, helperText)","__enabledCharPatternChanged(_enabledCharPattern)"]}get focusElement(){if(!this.shadowRoot)return;const e=this.querySelector(`${this._slottedTagName}[slot="${this._slottedTagName}"]`);return e||this.shadowRoot.querySelector('[part="value"]')}get inputElement(){return this.focusElement}get _slottedTagName(){return"input"}_createConstraintsObserver(){this._createMethodObserver("_constraintsChanged(required, minlength, maxlength, pattern)")}get _inputElementValueProperty(){return"value"}get _inputElementValue(){return this.inputElement?this.inputElement[this._inputElementValueProperty]:void 0}set _inputElementValue(e){this.inputElement&&(this.inputElement[this._inputElementValueProperty]=e)}_setHasInputValue(e){this._hasInputValue=e.target.value.length>0}__onInput(e){this._setHasInputValue(e),this._onInput(e)}_onInput(e){if(this.__preventInput)return e.stopImmediatePropagation(),void(this.__preventInput=!1);if(this.preventInvalidInput){const e=this.inputElement;if(e.value.length>0&&!this.checkValidity())return e.value=this.value||"",this.setAttribute("input-prevented",""),void(this._inputDebouncer=a.debounce(this._inputDebouncer,i.after(200),(()=>{this.removeAttribute("input-prevented")})))}e.__fromClearButton||(this.__userInput=!0),this.value=e.target.value,this.__userInput=!1}_stateChanged(e,t,n,r){!e&&!t&&n&&r?this.$.clearButton.removeAttribute("hidden"):this.$.clearButton.setAttribute("hidden",!0)}_hasInputValueChanged(e,t){(e||t)&&this.dispatchEvent(new CustomEvent("has-input-value-changed"))}_onChange(e){if(this._valueClearing)return;const t=new CustomEvent("change",{detail:{sourceEvent:e},bubbles:e.bubbles,cancelable:e.cancelable});this.dispatchEvent(t)}_valueChanged(e,t){""===e&&void 0===t||(this.hasValue=""!==e&&null!=e,this.__userInput||(void 0!==e?this._inputElementValue=e:this.value=this._inputElementValue="",this.invalid&&this.validate()))}_labelChanged(e){this._setOrToggleAttribute("has-label",!!e,this)}_helperTextChanged(e){this._setOrToggleAttribute("has-helper",!!e,this)}_errorMessageChanged(e){this._setOrToggleAttribute("has-error-message",!!e,this)}_onHelperSlotChange(){const e=this.shadowRoot.querySelector('[name="helper"]').assignedNodes({flatten:!0});this._hasSlottedHelper=e.filter((e=>3!==e.nodeType)).length,this._hasSlottedHelper?this.setAttribute("has-helper","slotted"):""!==this.helperText&&null!==this.helperText||this.removeAttribute("has-helper")}_onSlotChange(){const e=this.querySelector(`${this._slottedTagName}[slot="${this._slottedTagName}"]`);this.value&&(this._inputElementValue=this.value,this.validate()),e&&!this._slottedInput?(this._validateSlottedValue(e),this._addInputListeners(e),this._addIEListeners(e),this._slottedInput=e):!e&&this._slottedInput&&(this._removeInputListeners(this._slottedInput),this._removeIEListeners(this._slottedInput),this._slottedInput=void 0),Object.keys(c).map((e=>c[e])).forEach((e=>this._propagateHostAttributes(p[e].map((e=>this[e])),e)))}_hostPropsChanged(...e){this._propagateHostAttributes(e,c.DEFAULT)}_hostAccessiblePropsChanged(...e){this._propagateHostAttributes(e,c.ACCESSIBLE)}_validateSlottedValue(e){e.value!==this.value&&(console.warn("Please define value on the vaadin-text-field component!"),e.value="")}_propagateHostAttributes(e,t){const n=this.inputElement,r=p[t];t===c.ACCESSIBLE?r.forEach(((t,r)=>{this._setOrToggleAttribute(t,e[r],n),this._setOrToggleAttribute(`aria-${t}`,!!e[r]&&"true",n)})):r.forEach(((t,r)=>{this._setOrToggleAttribute(t,e[r],n)}))}_setOrToggleAttribute(e,t,n){e&&n&&(t?n.setAttribute(e,"boolean"==typeof t?"":t):n.removeAttribute(e))}_constraintsChanged(e,t,n,r){this.invalid&&(e||t||n||r?this.validate():this._setInvalid(!1))}checkValidity(){return this.required||this.pattern||this.maxlength||this.minlength||this.__forceCheckValidity?this.inputElement.checkValidity():!this.invalid}_addInputListeners(e){e.addEventListener("input",this._boundOnInput),e.addEventListener("change",this._boundOnChange),e.addEventListener("blur",this._boundOnBlur),e.addEventListener("focus",this._boundOnFocus),e.addEventListener("paste",this._boundOnPaste),e.addEventListener("drop",this._boundOnDrop),e.addEventListener("beforeinput",this._boundOnBeforeInput)}_removeInputListeners(e){e.removeEventListener("input",this._boundOnInput),e.removeEventListener("change",this._boundOnChange),e.removeEventListener("blur",this._boundOnBlur),e.removeEventListener("focus",this._boundOnFocus),e.removeEventListener("paste",this._boundOnPaste),e.removeEventListener("drop",this._boundOnDrop),e.removeEventListener("beforeinput",this._boundOnBeforeInput)}ready(){super.ready(),this._createConstraintsObserver(),this._boundOnInput=this.__onInput.bind(this),this._boundOnChange=this._onChange.bind(this),this._boundOnBlur=this._onBlur.bind(this),this._boundOnFocus=this._onFocus.bind(this),this._boundOnPaste=this._onPaste.bind(this),this._boundOnDrop=this._onDrop.bind(this),this._boundOnBeforeInput=this._onBeforeInput.bind(this);const e=this.shadowRoot.querySelector('[part="value"]');this._slottedInput=this.querySelector(`${this._slottedTagName}[slot="${this._slottedTagName}"]`),this._addInputListeners(e),this._addIEListeners(e),this._slottedInput&&(this._addIEListeners(this._slottedInput),this._addInputListeners(this._slottedInput)),this.shadowRoot.querySelector('[name="input"], [name="textarea"]').addEventListener("slotchange",this._onSlotChange.bind(this)),this._onHelperSlotChange(),this.shadowRoot.querySelector('[name="helper"]').addEventListener("slotchange",this._onHelperSlotChange.bind(this)),window.ShadyCSS&&window.ShadyCSS.nativeCss||this.updateStyles(),this.$.clearButton.addEventListener("mousedown",(()=>this._valueClearing=!0)),this.$.clearButton.addEventListener("mouseleave",(()=>this._valueClearing=!1)),this.$.clearButton.addEventListener("click",this._onClearButtonClick.bind(this)),this.addEventListener("keydown",this._onKeyDown.bind(this));var t=m._uniqueId=1+m._uniqueId||0;this._errorId=`${this.constructor.is}-error-${t}`,this._labelId=`${this.constructor.is}-label-${t}`,this._helperTextId=`${this.constructor.is}-helper-${t}`,this._inputId=`${this.constructor.is}-input-${t}`,this.shadowRoot.querySelector('[part="error-message"]').addEventListener("transitionend",(()=>{this.__observeOffsetHeight()}))}_setInvalid(e){this._shouldSetInvalid(e)&&(this.invalid=e)}_shouldSetInvalid(e){return!0}validate(){const e=this.checkValidity();return this._setInvalid(!e),this.dispatchEvent(new CustomEvent("validated",{detail:{valid:e}})),e}clear(){this._hasInputValue=!1,this.value=""}_onBlur(){this.validate()}_onFocus(){this.autoselect&&(this.inputElement.select(),setTimeout((()=>{try{this.inputElement.setSelectionRange(0,9999)}catch(e){}})))}_onClearButtonClick(e){e.preventDefault(),this.inputElement.focus(),this.clear(),this._valueClearing=!1,navigator.userAgent.match(/Trident/)&&(this.__preventInput=!1);const t=new Event("input",{bubbles:!0,composed:!0});t.__fromClearButton=!0;const n=new Event("change",{bubbles:!this._slottedInput});n.__fromClearButton=!0,this.inputElement.dispatchEvent(t),this.inputElement.dispatchEvent(n)}_onKeyDown(e){if(27===e.keyCode&&this.clearButtonVisible){const e=!!this.value;this.clear(),e&&this.inputElement.dispatchEvent(new Event("change",{bubbles:!this._slottedInput}))}this._enabledCharPattern&&!this.__shouldAcceptKey(e)&&e.preventDefault()}__shouldAcceptKey(e){return e.metaKey||e.ctrlKey||!e.key||1!==e.key.length||this.__enabledCharRegExp.test(e.key)}_onPaste(e){if(this._enabledCharPattern){const t=(e.clipboardData||window.clipboardData).getData("text");this.__enabledTextRegExp.test(t)||e.preventDefault()}}_onDrop(e){if(this._enabledCharPattern){const t=e.dataTransfer.getData("text");this.__enabledTextRegExp.test(t)||e.preventDefault()}}_onBeforeInput(e){this._enabledCharPattern&&e.data&&!this.__enabledTextRegExp.test(e.data)&&e.preventDefault()}__enabledCharPatternChanged(e){this.__enabledCharRegExp=e&&new RegExp("^"+e+"$"),this.__enabledTextRegExp=e&&new RegExp("^"+e+"*$")}_addIEListeners(e){navigator.userAgent.match(/Trident/)&&(this._shouldPreventInput=()=>{this.__preventInput=!0,requestAnimationFrame((()=>{this.__preventInput=!1}))},e.addEventListener("focusin",this._shouldPreventInput),e.addEventListener("focusout",this._shouldPreventInput),this._createPropertyObserver("placeholder",this._shouldPreventInput))}_removeIEListeners(e){navigator.userAgent.match(/Trident/)&&(e.removeEventListener("focusin",this._shouldPreventInput),e.removeEventListener("focusout",this._shouldPreventInput))}_getActiveErrorId(e,t,n,r,a,i){const o=[];(r||i)&&o.push(a),t&&e&&o.push(n),this._setOrToggleAttribute("aria-describedby",o.join(" "),this.focusElement)}_getActiveLabelId(e,t,n){let r=n;e&&(r=`${t} ${n}`),this.focusElement.setAttribute("aria-labelledby",r)}_getErrorMessageAriaHidden(e,t,n){return(!(t&&e?n:void 0)).toString()}_dispatchIronResizeEventIfNeeded(e,t){const n="__previous"+e;void 0!==this[n]&&this[n]!==t&&this.dispatchEvent(new CustomEvent("iron-resize",{bubbles:!0,composed:!0})),this[n]=t}__observeOffsetHeight(){this.__observeOffsetHeightDebouncer=a.debounce(this.__observeOffsetHeightDebouncer,o,(()=>{this._dispatchIronResizeEventIfNeeded("Height",this.offsetHeight)}))}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),window.ShadyCSS&&window.ShadyCSS.nativeCss||!/^(focused|focus-ring|invalid|disabled|placeholder|has-value)$/.test(e)||this.updateStyles();if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.root){const e="-webkit-backface-visibility";this.root.querySelectorAll("*").forEach((t=>{t.style[e]="visible",t.style[e]=""}))}}get __data(){return this.__dataValue||{}}set __data(e){this.__dataValue=e}}
|
|
492
|
+
</dom-module>`;document.head.appendChild(u.content);const p={default:["list","autofocus","pattern","autocapitalize","autocorrect","maxlength","minlength","name","placeholder","autocomplete","title","disabled","readonly","required"],accessible:["invalid"]},c={DEFAULT:"default",ACCESSIBLE:"accessible"},m=e=>class extends e{static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String},autoselect:{type:Boolean,value:!1},clearButtonVisible:{type:Boolean,value:!1},errorMessage:{type:String,value:"",observer:"_errorMessageChanged"},i18n:{type:Object,value:()=>({clear:"Clear"})},label:{type:String,value:"",observer:"_labelChanged"},helperText:{type:String,value:"",observer:"_helperTextChanged"},maxlength:{type:Number},minlength:{type:Number},name:{type:String},placeholder:{type:String},readonly:{type:Boolean,reflectToAttribute:!0},required:{type:Boolean,reflectToAttribute:!0},value:{type:String,value:"",observer:"_valueChanged",notify:!0},_hasInputValue:{type:Boolean,value:!1,observer:"_hasInputValueChanged"},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},hasValue:{type:Boolean,reflectToAttribute:!0},preventInvalidInput:{type:Boolean},_enabledCharPattern:String,_labelId:String,_helperTextId:String,_errorId:String,_inputId:String,_hasSlottedHelper:Boolean}}static get observers(){return["_stateChanged(disabled, readonly, clearButtonVisible, hasValue)","_hostPropsChanged("+p.default.join(", ")+")","_hostAccessiblePropsChanged("+p.accessible.join(", ")+")","_getActiveErrorId(invalid, errorMessage, _errorId, helperText, _helperTextId, _hasSlottedHelper)","_getActiveLabelId(label, _labelId, _inputId)","__observeOffsetHeight(errorMessage, invalid, label, helperText)","__enabledCharPatternChanged(_enabledCharPattern)"]}get focusElement(){if(!this.shadowRoot)return;const e=this.querySelector(`${this._slottedTagName}[slot="${this._slottedTagName}"]`);return e||this.shadowRoot.querySelector('[part="value"]')}get inputElement(){return this.focusElement}get _slottedTagName(){return"input"}_createConstraintsObserver(){this._createMethodObserver("_constraintsChanged(required, minlength, maxlength, pattern)")}get _inputElementValueProperty(){return"value"}get _inputElementValue(){return this.inputElement?this.inputElement[this._inputElementValueProperty]:void 0}set _inputElementValue(e){this.inputElement&&(this.inputElement[this._inputElementValueProperty]=e)}_setHasInputValue(e){this._hasInputValue=e.target.value.length>0}__onInput(e){this._setHasInputValue(e),this._onInput(e)}_onInput(e){if(this.__preventInput)return e.stopImmediatePropagation(),void(this.__preventInput=!1);if(this.preventInvalidInput){const e=this.inputElement;if(e.value.length>0&&!this.checkValidity())return e.value=this.value||"",this.setAttribute("input-prevented",""),void(this._inputDebouncer=n.debounce(this._inputDebouncer,a.after(200),(()=>{this.removeAttribute("input-prevented")})))}e.__fromClearButton||(this.__userInput=!0),this.value=e.target.value,this.__userInput=!1}_stateChanged(e,t,r,n){!e&&!t&&r&&n?this.$.clearButton.removeAttribute("hidden"):this.$.clearButton.setAttribute("hidden",!0)}_hasInputValueChanged(e,t){(e||t)&&this.dispatchEvent(new CustomEvent("has-input-value-changed"))}_onChange(e){if(this._valueClearing)return;const t=new CustomEvent("change",{detail:{sourceEvent:e},bubbles:e.bubbles,cancelable:e.cancelable});this.dispatchEvent(t)}_valueChanged(e,t){""===e&&void 0===t||(this.hasValue=""!==e&&null!=e,this.__userInput||(void 0!==e?this._inputElementValue=e:this.value=this._inputElementValue="",this.invalid&&this.validate()))}_labelChanged(e){this._setOrToggleAttribute("has-label",!!e,this)}_helperTextChanged(e){this._setOrToggleAttribute("has-helper",!!e,this)}_errorMessageChanged(e){this._setOrToggleAttribute("has-error-message",!!e,this)}_onHelperSlotChange(){const e=this.shadowRoot.querySelector('[name="helper"]').assignedNodes({flatten:!0});this._hasSlottedHelper=e.filter((e=>3!==e.nodeType)).length,this._hasSlottedHelper?this.setAttribute("has-helper","slotted"):""!==this.helperText&&null!==this.helperText||this.removeAttribute("has-helper")}_onSlotChange(){const e=this.querySelector(`${this._slottedTagName}[slot="${this._slottedTagName}"]`);this.value&&(this._inputElementValue=this.value,this.validate()),e&&!this._slottedInput?(this._validateSlottedValue(e),this._addInputListeners(e),this._addIEListeners(e),this._slottedInput=e):!e&&this._slottedInput&&(this._removeInputListeners(this._slottedInput),this._removeIEListeners(this._slottedInput),this._slottedInput=void 0),Object.keys(c).map((e=>c[e])).forEach((e=>this._propagateHostAttributes(p[e].map((e=>this[e])),e)))}_hostPropsChanged(...e){this._propagateHostAttributes(e,c.DEFAULT)}_hostAccessiblePropsChanged(...e){this._propagateHostAttributes(e,c.ACCESSIBLE)}_validateSlottedValue(e){e.value!==this.value&&(console.warn("Please define value on the vaadin-text-field component!"),e.value="")}_propagateHostAttributes(e,t){const r=this.inputElement,n=p[t];t===c.ACCESSIBLE?n.forEach(((t,n)=>{this._setOrToggleAttribute(t,e[n],r),this._setOrToggleAttribute(`aria-${t}`,!!e[n]&&"true",r)})):n.forEach(((t,n)=>{this._setOrToggleAttribute(t,e[n],r)}))}_setOrToggleAttribute(e,t,r){e&&r&&(t?r.setAttribute(e,"boolean"==typeof t?"":t):r.removeAttribute(e))}_constraintsChanged(e,t,r,n){this.invalid&&(e||t||r||n?this.validate():this._setInvalid(!1))}checkValidity(){return this.required||this.pattern||this.maxlength||this.minlength||this.__forceCheckValidity?this.inputElement.checkValidity():!this.invalid}_addInputListeners(e){e.addEventListener("input",this._boundOnInput),e.addEventListener("change",this._boundOnChange),e.addEventListener("blur",this._boundOnBlur),e.addEventListener("focus",this._boundOnFocus),e.addEventListener("paste",this._boundOnPaste),e.addEventListener("drop",this._boundOnDrop),e.addEventListener("beforeinput",this._boundOnBeforeInput)}_removeInputListeners(e){e.removeEventListener("input",this._boundOnInput),e.removeEventListener("change",this._boundOnChange),e.removeEventListener("blur",this._boundOnBlur),e.removeEventListener("focus",this._boundOnFocus),e.removeEventListener("paste",this._boundOnPaste),e.removeEventListener("drop",this._boundOnDrop),e.removeEventListener("beforeinput",this._boundOnBeforeInput)}ready(){super.ready(),this._createConstraintsObserver(),this._boundOnInput=this.__onInput.bind(this),this._boundOnChange=this._onChange.bind(this),this._boundOnBlur=this._onBlur.bind(this),this._boundOnFocus=this._onFocus.bind(this),this._boundOnPaste=this._onPaste.bind(this),this._boundOnDrop=this._onDrop.bind(this),this._boundOnBeforeInput=this._onBeforeInput.bind(this);const e=this.shadowRoot.querySelector('[part="value"]');this._slottedInput=this.querySelector(`${this._slottedTagName}[slot="${this._slottedTagName}"]`),this._addInputListeners(e),this._addIEListeners(e),this._slottedInput&&(this._addIEListeners(this._slottedInput),this._addInputListeners(this._slottedInput)),this.shadowRoot.querySelector('[name="input"], [name="textarea"]').addEventListener("slotchange",this._onSlotChange.bind(this)),this._onHelperSlotChange(),this.shadowRoot.querySelector('[name="helper"]').addEventListener("slotchange",this._onHelperSlotChange.bind(this)),window.ShadyCSS&&window.ShadyCSS.nativeCss||this.updateStyles(),this.$.clearButton.addEventListener("mousedown",(()=>this._valueClearing=!0)),this.$.clearButton.addEventListener("mouseleave",(()=>this._valueClearing=!1)),this.$.clearButton.addEventListener("click",this._onClearButtonClick.bind(this)),this.addEventListener("keydown",this._onKeyDown.bind(this));var t=m._uniqueId=1+m._uniqueId||0;this._errorId=`${this.constructor.is}-error-${t}`,this._labelId=`${this.constructor.is}-label-${t}`,this._helperTextId=`${this.constructor.is}-helper-${t}`,this._inputId=`${this.constructor.is}-input-${t}`,this.shadowRoot.querySelector('[part="error-message"]').addEventListener("transitionend",(()=>{this.__observeOffsetHeight()}))}_setInvalid(e){this._shouldSetInvalid(e)&&(this.invalid=e)}_shouldSetInvalid(e){return!0}validate(){const e=this.checkValidity();return this._setInvalid(!e),this.dispatchEvent(new CustomEvent("validated",{detail:{valid:e}})),e}clear(){this._hasInputValue=!1,this.value=""}_onBlur(){this.validate()}_onFocus(){this.autoselect&&(this.inputElement.select(),setTimeout((()=>{try{this.inputElement.setSelectionRange(0,9999)}catch(e){}})))}_onClearButtonClick(e){e.preventDefault(),this.inputElement.focus(),this.clear(),this._valueClearing=!1,navigator.userAgent.match(/Trident/)&&(this.__preventInput=!1);const t=new Event("input",{bubbles:!0,composed:!0});t.__fromClearButton=!0;const r=new Event("change",{bubbles:!this._slottedInput});r.__fromClearButton=!0,this.inputElement.dispatchEvent(t),this.inputElement.dispatchEvent(r)}_onKeyDown(e){if(27===e.keyCode&&this.clearButtonVisible){const e=!!this.value;this.clear(),e&&this.inputElement.dispatchEvent(new Event("change",{bubbles:!this._slottedInput}))}this._enabledCharPattern&&!this.__shouldAcceptKey(e)&&e.preventDefault()}__shouldAcceptKey(e){return e.metaKey||e.ctrlKey||!e.key||1!==e.key.length||this.__enabledCharRegExp.test(e.key)}_onPaste(e){if(this._enabledCharPattern){const t=(e.clipboardData||window.clipboardData).getData("text");this.__enabledTextRegExp.test(t)||e.preventDefault()}}_onDrop(e){if(this._enabledCharPattern){const t=e.dataTransfer.getData("text");this.__enabledTextRegExp.test(t)||e.preventDefault()}}_onBeforeInput(e){this._enabledCharPattern&&e.data&&!this.__enabledTextRegExp.test(e.data)&&e.preventDefault()}__enabledCharPatternChanged(e){this.__enabledCharRegExp=e&&new RegExp("^"+e+"$"),this.__enabledTextRegExp=e&&new RegExp("^"+e+"*$")}_addIEListeners(e){navigator.userAgent.match(/Trident/)&&(this._shouldPreventInput=()=>{this.__preventInput=!0,requestAnimationFrame((()=>{this.__preventInput=!1}))},e.addEventListener("focusin",this._shouldPreventInput),e.addEventListener("focusout",this._shouldPreventInput),this._createPropertyObserver("placeholder",this._shouldPreventInput))}_removeIEListeners(e){navigator.userAgent.match(/Trident/)&&(e.removeEventListener("focusin",this._shouldPreventInput),e.removeEventListener("focusout",this._shouldPreventInput))}_getActiveErrorId(e,t,r,n,a,i){const o=[];(n||i)&&o.push(a),t&&e&&o.push(r),this._setOrToggleAttribute("aria-describedby",o.join(" "),this.focusElement)}_getActiveLabelId(e,t,r){let n=r;e&&(n=`${t} ${r}`),this.focusElement.setAttribute("aria-labelledby",n)}_getErrorMessageAriaHidden(e,t,r){return(!(t&&e?r:void 0)).toString()}_dispatchIronResizeEventIfNeeded(e,t){const r="__previous"+e;void 0!==this[r]&&this[r]!==t&&this.dispatchEvent(new CustomEvent("iron-resize",{bubbles:!0,composed:!0})),this[r]=t}__observeOffsetHeight(){this.__observeOffsetHeightDebouncer=n.debounce(this.__observeOffsetHeightDebouncer,i,(()=>{this._dispatchIronResizeEventIfNeeded("Height",this.offsetHeight)}))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),window.ShadyCSS&&window.ShadyCSS.nativeCss||!/^(focused|focus-ring|invalid|disabled|placeholder|has-value)$/.test(e)||this.updateStyles();if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.root){const e="-webkit-backface-visibility";this.root.querySelectorAll("*").forEach((t=>{t.style[e]="visible",t.style[e]=""}))}}get __data(){return this.__dataValue||{}}set __data(e){this.__dataValue=e}}
|
|
493
493
|
/**
|
|
494
494
|
@license
|
|
495
495
|
Copyright (c) 2017 Vaadin Ltd.
|
|
496
496
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
497
|
-
*/;class v extends(e(m(t(
|
|
497
|
+
*/;class v extends(e(m(l(t(o))))){static get template(){return r`
|
|
498
498
|
<style include="vaadin-text-field-shared-styles">
|
|
499
499
|
/* polymer-cli linter breaks with empty line */
|
|
500
500
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-d57fac94.js";import"./shared-c9ba1b64.js";import{I as e}from"./shared-bed7aae1.js";import{_ as r}from"./shared-1522d76f.js";import{i as t}from"./shared-d3bf9ac0.js";import{h as a,s}from"./shared-7f33a83a.js";import{c as l}from"./shared-4e709717.js";let o,i,n,d=e=>e;customElements.define("foxy-internal-password-control",class extends e{constructor(){super(...arguments),this.showGenerator=!1}static get properties(){return r(r({},super.properties),{},{showGenerator:{type:Boolean,attribute:"show-generator"}})}renderControl(){return a(o||(o=d` <vaadin-password-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} </vaadin-password-field> `),t(this._errorMessage),this.helperText,this.placeholder,this.label,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var r;return"Enter"===e.key&&(null===(r=this.nucleon)||void 0===r?void 0:r.submit())}),(e=>{const r=e.currentTarget;this._value=r.value}),this.showGenerator?this.__renderGenerator():"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}__renderGenerator(){return a(i||(i=d` <div data-testid="generator" class="${0}" slot="suffix" @click="${0}"> ${0} </div> `),l({"w-s h-s flex items-center justify-center cursor-default transition-colors":!0,"text-contrast-60 hover-text-contrast-80":!this.disabled&&!this.readonly,"text-contrast-20":this.disabled||this.readonly}),(()=>{this._value=function(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let r="";for(let t=0;t<18;t++)t>0&&t%6==0&&(r+="-"),r+=e[Math.floor(62*Math.random())];return r}();const e=this.renderRoot.querySelector("vaadin-password-field");null==e||e._setPasswordVisible(!0)}),s(n||(n=d`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.15em; height: 1.15em"><path d="M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z" /></svg>`)))}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as t,T as e}from"./shared-
|
|
1
|
+
import{E as t,T as e}from"./shared-f9a3d1ff.js";import{h as o,P as r}from"./shared-43f449bb.js";import"./shared-b509bc2c.js";import{L as a}from"./shared-2b27e2e7.js";import{I as i,a as s,b as n}from"./shared-2c8c4b43.js";import{a as l}from"./shared-ff9791cf.js";const c=o`<dom-module id="lumo-tab" theme-for="vaadin-tab">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -220,15 +220,15 @@ import{E as t,T as e}from"./shared-ec59505f.js";import{h as o,P as r}from"./shar
|
|
|
220
220
|
}
|
|
221
221
|
</style>
|
|
222
222
|
</template>
|
|
223
|
-
</dom-module>`;document.head.appendChild(
|
|
223
|
+
</dom-module>`;document.head.appendChild(c.content);
|
|
224
224
|
/**
|
|
225
225
|
@license
|
|
226
226
|
Copyright (c) 2017 Vaadin Ltd.
|
|
227
227
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
228
228
|
*/
|
|
229
|
-
class
|
|
229
|
+
class d extends(t(e(i(r)))){static get template(){return o`
|
|
230
230
|
<slot></slot>
|
|
231
|
-
`}static get is(){return"vaadin-tab"}static get version(){return"3.2.0"}ready(){super.ready(),this.setAttribute("role","tab")}_onKeyup(t){const e=this.hasAttribute("active");if(super._onKeyup(t),e){const t=this.querySelector("a");t&&t.click()}}}customElements.define(
|
|
231
|
+
`}static get is(){return"vaadin-tab"}static get version(){return"3.2.0"}ready(){super.ready(),this.setAttribute("role","tab")}_onKeyup(t){const e=this.hasAttribute("active");if(super._onKeyup(t),e){const t=this.querySelector("a");t&&t.click()}}}customElements.define(d.is,d);const m=o`<dom-module id="lumo-tabs" theme-for="vaadin-tabs">
|
|
232
232
|
<template>
|
|
233
233
|
<style>
|
|
234
234
|
:host {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-c7b3d22b.js";import"./shared-029816d7.js";import{_ as t}from"./shared-1522d76f.js";import{h as e}from"./shared-7f33a83a.js";import{D as s}from"./shared-268571df.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,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-b509bc2c.js";import"./shared-f9a3d1ff.js";import{h as A}from"./shared-43f449bb.js";import{T as e}from"./shared-c9ba1b64.js";import{D as t}from"./shared-5fa697c4.js";const s=A`<dom-module id="lumo-password-field" theme-for="vaadin-password-field">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
[part="reveal-button"]::before {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-collection-page.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-
|
|
1
|
+
import"./foxy-collection-page.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-029816d7.js";import{I as e}from"./shared-fc15a882.js";import"./shared-30d00b64.js";import"./shared-ff9791cf.js";import{_ as t}from"./shared-1522d76f.js";import{h as r,L as s}from"./shared-7f33a83a.js";import{I as i}from"./shared-30cbf0a6.js";import{T as o}from"./shared-5fa697c4.js";import{c as n}from"./shared-4e709717.js";let a,c=e=>e;class l extends(o(i(s))){constructor(){super(...arguments),this.summary=null,this.open=!1}static get properties(){return t(t({},super.properties),{},{summary:{type:String},open:{type:Boolean}})}render(){var e;return r(a||(a=c` <details class="w-full border border-contrast-10 rounded" ?open="${0}" @toggle="${0}"> <summary class="${0}"> <div class="flex items-center h-m pl-m pr-s"> <div class="flex items-center flex-1"> <foxy-i18n class="flex items-center text-xs tracking-wide uppercase font-medium text-body" infer="" key="${0}"> </foxy-i18n> <slot name="actions"></slot> </div> <iron-icon class="icon-inline text-xl text-body" icon="icons:expand-${0}"> </iron-icon> </div> </summary> <div class="border-t border-contrast-10"> <slot></slot> </div> </details> `),this.open,(e=>{this.open=e.currentTarget.open}),n({"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"transition-colors cursor-pointer hover-bg-contrast-5":!0,"rounded-t":!0,"rounded-b":!this.open}),null!==(e=this.summary)&&void 0!==e?e:"",this.open?"less":"more")}}customElements.define("foxy-internal-details",l);let d,f,m,p,h,u=e=>e;customElements.define("foxy-internal-async-details-control",class extends e{constructor(){super(...arguments),this.related=[],this.limit=20,this.first="",this.form="",this.item="",this.open=!1,this.__cachedCardRenderer=null,this.__itemRenderer=e=>{if(!this.form||!e.data)return this.__cardRenderer(e);const t=this.disabledSelector.matches("card",!0);return r(d||(d=u` <button ?disabled="${0}" class="${0}" @click="${0}"> ${0} </button> `),t,n({"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-left w-full block transition-colors":!0,"hover-bg-contrast-5":!t}),(t=>{const r=t.currentTarget,s=this.__dialog;s.header="header_update",s.href=e.href,s.show(r)}),this.__cardRenderer(e))}}static get properties(){return t(t({},super.properties),{},{related:{type:Array},first:{type:String},limit:{type:Number},form:{type:String},item:{type:String},open:{type:Boolean}})}renderControl(){let e;try{const t=new URL(this.first);t.searchParams.set("limit",String(this.limit)),e=t.toString()}catch(t){e=this.first}return r(f||(f=u` <foxy-internal-details summary="title" infer="" ?open="${0}" @toggle="${0}"> ${0} <foxy-pagination class="px-m pb-s" first="${0}" infer="pagination"> <foxy-collection-page class="-mx-m block divide-y divide-contrast-10 mb-s" infer="card" .related="${0}" .item="${0}"> </foxy-collection-page> </foxy-pagination> </foxy-internal-details> `),this.open,(e=>this.open=e.currentTarget.open),this.form?r(m||(m=u` <foxy-form-dialog parent="${0}" infer="dialog" id="form" .related="${0}" .form="${0}"> </foxy-form-dialog> ${0} `),e,this.related,this.form,this.readonly?"":r(p||(p=u` <button class="h-xs w-xs rounded-full text-success flex items-center justify-center text-l focus-outline-none focus-ring-2 focus-ring-primary-50" slot="actions" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline" icon="icons:add"></iron-icon> </button> `),this.disabled,(e=>{e.preventDefault(),e.stopPropagation();const t=this.__dialog,r=e.currentTarget;t.header="header_create",t.href="",t.show(r)}))):"",e,this.related,this.__itemRenderer)}get __dialog(){return this.renderRoot.querySelector("#form")}get __cardRenderer(){var e;const t=this.item;if((null===(e=this.__cachedCardRenderer)||void 0===e?void 0:e.item)!==t){let e;e=null===t?()=>r(h||(h=u``)):"string"==typeof t?new Function("ctx",`return ctx.html\`<${t} related=\${JSON.stringify(ctx.related)} parent=\${ctx.parent} class="p-m" infer href=\${ctx.href}></${t}>\``):t,this.__cachedCardRenderer={item:t,render:e}}return this.__cachedCardRenderer.render}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as e,$ as t,a0 as a,a1 as s,a2 as i,a3 as n,a4 as r,a5 as o,f as l,a6 as d,a7 as u,a8 as c,a9 as h,aa as m,ab as v,ac as g,m as p,_ as y,ad as b}from"./shared-1522d76f.js";import"./shared-6d0be1e4.js";import"./shared-ec59505f.js";import"./shared-6ffa9f84.js";import"./shared-5f1f0d8f.js";import"./shared-264c82b8.js";import"./shared-92dd9964.js";import"./shared-0ffe26d8.js";import{d as f,P as x,A as _,L as w,c as $,h as E}from"./shared-7f33a83a.js";import"./shared-5db2fec0.js";import"./shared-b984ab7c.js";import{p as k}from"./shared-15dfa16d.js";import{a as T,x as S}from"./shared-ecd5eb1b.js";import{I as V}from"./shared-30cbf0a6.js";import{s as C}from"./shared-11c2efc8.js";import{i as A}from"./shared-eb116b3e.js";var M={raise:e,send:t,sendParent:a,sendUpdate:s,log:i,cancel:n,start:r,stop:o,assign:l,after:d,done:u,respond:c,forwardTo:h,escalate:m,choose:v,pure:g};const j=f((e=>t=>{const{element:a,name:s,strings:i}=t.committer;if(2!==i.length||""!==i[0]||""!==i[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof x)a[s]!==e&&t.setValue(e);else{if(!(t instanceof _))throw new Error("live directive can only be used on attributes or properties");a.getAttribute(s)!==e&&t.setValue(e)}}));class I extends CustomEvent{constructor(e){super("change",{detail:e})}}class F extends CustomEvent{constructor(e){super("change",{detail:e})}}class U extends F{}let D,P,q=e=>e;class L extends(T(V(w))){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:a}=k(e);return[t.toString(),a]}},this.__getItems=p((e=>{const t=k(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return y(y({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return $(D||(D=q`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return E(P||(P=q` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,j(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new U(this.value))}}const N=b({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"number",cond:"showsNumberField"},{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}},number:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsNumberField:e=>"number"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:M.assign({defaultCustomValue:(e,t)=>t.data}),setValue:M.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:M.assign({custom:(e,t)=>t.data}),setItems:M.assign({items:(e,t)=>t.data}),setType:M.assign({type:(e,t)=>t.data}),setMin:M.assign({min:(e,t)=>t.data}),setMax:M.assign({max:(e,t)=>t.data})}});let B,O,Y,R,z,X,Z,G,H,J,K,Q,W,ee,te=e=>e;const ae=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class se extends S{constructor(){super(...arguments),this.getText=e=>e,this.__service=A(N).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":L,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,$(Y||(Y=te`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return y(y({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,ae]:this.items,t=Array.isArray(this.value),a=this.__service.state.matches("extension.present.selected"),s=E(R||(R=te` ${0} `),e.map(((e,s,i)=>{var n;const r=this.custom&&s===i.length-1,o=r?a:t?!!(null===(n=this.value)||void 0===n?void 0:n.includes(e)):e===String(this.value),l=this.disabled||!this._isI18nReady,d=C({value:r?ae:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":l,"@change":t=>{if(this.readonly)return t.preventDefault();const a=t.target.checked,s=e===ae?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===ae?a?[...i,s]:i.slice(0,i.length-1):a?[s,...i]:i.filter((e=>e!==s)):this.value=a?s:null,this.dispatchEvent(new I(this.value))}}),u=E(z||(z=te` <div> ${0} </div> `),e===ae?this._t("choice.other").toString():E(X||(X=te`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return E(Z||(Z=te` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),s?"":"hidden",t?function(e,t,a,s,i){const n="transition ease-in-out duration-200",r=`${n} transform ${a?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return E(O||(O=te` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,l,o,d,u):function(e,t,a,s,i){const n="transition ease-in-out duration-200",r=`${n} ${t||e?"":"shadow-xs"} transform ${a?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return E(B||(B=te` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,l,o,d,u),e===ae&&a?this.__field:"",e!==ae?E(G||(G=te`<slot name="${0}"></slot>`),e):"")})));return E(H||(H=te`<form>${0}</form> `),s)}get __field(){const e=C({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new I(this.value))}});return"frequency"===this.type?E(J||(J=te`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?E(K||(K=te`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"number"===this.type?E(Q||(Q=te`<vaadin-number-field ...="${0}" has-controls></vaadin-number-field>`),e):"textarea"===this.type?E(W||(W=te`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):E(ee||(ee=te`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}export{se as C,F as D,L as F,I as a,M as b};
|
|
1
|
+
import{Z as e,$ as t,a0 as a,a1 as s,a2 as i,a3 as n,a4 as r,a5 as o,f as l,a6 as d,a7 as c,a8 as u,a9 as h,aa as m,ab as v,ac as g,m as p,_ as y,ad as b}from"./shared-1522d76f.js";import"./shared-ff9791cf.js";import"./shared-f9a3d1ff.js";import"./shared-9c08cfab.js";import"./shared-ea527e98.js";import"./shared-c9ba1b64.js";import"./shared-99c0ae04.js";import"./shared-9df8f842.js";import{d as f,P as x,A as _,L as w,c as $,h as E}from"./shared-7f33a83a.js";import"./shared-ad34b6db.js";import"./shared-4e59fd48.js";import{p as k}from"./shared-029816d7.js";import{a as T,x as S}from"./shared-5fa697c4.js";import{I as V}from"./shared-30cbf0a6.js";import{s as C}from"./shared-11c2efc8.js";import{i as A}from"./shared-eb116b3e.js";var M={raise:e,send:t,sendParent:a,sendUpdate:s,log:i,cancel:n,start:r,stop:o,assign:l,after:d,done:c,respond:u,forwardTo:h,escalate:m,choose:v,pure:g};const j=f((e=>t=>{const{element:a,name:s,strings:i}=t.committer;if(2!==i.length||""!==i[0]||""!==i[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof x)a[s]!==e&&t.setValue(e);else{if(!(t instanceof _))throw new Error("live directive can only be used on attributes or properties");a.getAttribute(s)!==e&&t.setValue(e)}}));class I extends CustomEvent{constructor(e){super("change",{detail:e})}}class F extends CustomEvent{constructor(e){super("change",{detail:e})}}class U extends F{}let D,P,q=e=>e;class L extends(T(V(w))){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:a}=k(e);return[t.toString(),a]}},this.__getItems=p((e=>{const t=k(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return y(y({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return $(D||(D=q`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return E(P||(P=q` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,j(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new U(this.value))}}const N=b({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"number",cond:"showsNumberField"},{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}},number:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsNumberField:e=>"number"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:M.assign({defaultCustomValue:(e,t)=>t.data}),setValue:M.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:M.assign({custom:(e,t)=>t.data}),setItems:M.assign({items:(e,t)=>t.data}),setType:M.assign({type:(e,t)=>t.data}),setMin:M.assign({min:(e,t)=>t.data}),setMax:M.assign({max:(e,t)=>t.data})}});let B,O,Y,R,z,X,Z,G,H,J,K,Q,W,ee,te=e=>e;const ae=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class se extends S{constructor(){super(...arguments),this.getText=e=>e,this.__service=A(N).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":L,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,$(Y||(Y=te`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return y(y({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,ae]:this.items,t=Array.isArray(this.value),a=this.__service.state.matches("extension.present.selected"),s=E(R||(R=te` ${0} `),e.map(((e,s,i)=>{var n;const r=this.custom&&s===i.length-1,o=r?a:t?!!(null===(n=this.value)||void 0===n?void 0:n.includes(e)):e===String(this.value),l=this.disabled||!this._isI18nReady,d=C({value:r?ae:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":l,"@change":t=>{if(this.readonly)return t.preventDefault();const a=t.target.checked,s=e===ae?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===ae?a?[...i,s]:i.slice(0,i.length-1):a?[s,...i]:i.filter((e=>e!==s)):this.value=a?s:null,this.dispatchEvent(new I(this.value))}}),c=E(z||(z=te` <div> ${0} </div> `),e===ae?this._t("choice.other").toString():E(X||(X=te`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return E(Z||(Z=te` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),s?"":"hidden",t?function(e,t,a,s,i){const n="transition ease-in-out duration-200",r=`${n} transform ${a?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return E(O||(O=te` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,l,o,d,c):function(e,t,a,s,i){const n="transition ease-in-out duration-200",r=`${n} ${t||e?"":"shadow-xs"} transform ${a?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return E(B||(B=te` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,l,o,d,c),e===ae&&a?this.__field:"",e!==ae?E(G||(G=te`<slot name="${0}"></slot>`),e):"")})));return E(H||(H=te`<form>${0}</form> `),s)}get __field(){const e=C({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new I(this.value))}});return"frequency"===this.type?E(J||(J=te`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?E(K||(K=te`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"number"===this.type?E(Q||(Q=te`<vaadin-number-field ...="${0}" has-controls></vaadin-number-field>`),e):"textarea"===this.type?E(W||(W=te`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):E(ee||(ee=te`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}export{se as C,F as D,L as F,I as a,M as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as t}from"./shared-b23c903e.js";import{R as e}from"./shared-
|
|
1
|
+
import{C as t}from"./shared-b23c903e.js";import{R as e}from"./shared-5fa697c4.js";import{I as s}from"./shared-e91453df.js";import{h as i}from"./shared-7f33a83a.js";let r,d,a,l=t=>t;const o=e(t(s));class n extends o{constructor(){super(...arguments),this.templates={},this.__renderTitle=t=>i(r||(r=l` <div data-testid="title"> ${0} <div class="font-medium truncate"> ${0}​ </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),this.data?null==t?void 0:t(this.data):"",this.renderTemplateOrSlot("title:after")),this.__renderSubtitle=t=>i(d||(d=l` <div data-testid="subtitle"> ${0} <div class="text-secondary truncate text-s sm-text-m"> ${0}​ </div> ${0} </div> `),this.renderTemplateOrSlot("subtitle:before"),this.data?null==t?void 0:t(this.data):"",this.renderTemplateOrSlot("subtitle:after"))}renderBody(t){const e=this.hiddenSelector;return i(a||(a=l` <div class="h-s flex flex-col justify-center relative text-body text-m font-lumo leading-xs sm-h-xs sm-flex-row sm-items-center sm-justify-between"> ${0} ${0} </div> `),e.matches("title",!0)?"":this.__renderTitle(null==t?void 0:t.title),e.matches("subtitle",!0)?"":this.__renderSubtitle(null==t?void 0:t.subtitle))}}export{n as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as e}from"./shared-
|
|
1
|
+
import{T as e}from"./shared-5fa697c4.js";import{N as s}from"./shared-6a7f96c4.js";import{c as t}from"./shared-4e709717.js";import{h as i}from"./shared-7f33a83a.js";let a,r,o=e=>e;class n extends(e(s)){renderBody(){return i(a||(a=o``))}render(){const e=this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy";return i(r||(r=o` <div aria-busy="${0}" aria-live="polite" class="relative leading-m text-body text-m font-lumo"> <div class="${0}"> ${0} </div> <div class="${0}"> <foxy-spinner layout="${0}" state="${0}" class="m-auto" infer="spinner"> </foxy-spinner> </div> </div> `),this.in("busy"),t({"transition duration-500 ease-in-out":!0,"opacity-0 pointer-events-none":!this.isBodyReady}),this.renderBody(),t({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.isBodyReady}),"busy"===e?"no-label":"horizontal",e)}get isBodyReady(){return!!this.data}}export{n as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-b509bc2c.js";import"./shared-f9a3d1ff.js";import{T as e}from"./shared-c9ba1b64.js";import{h as t}from"./shared-43f449bb.js";import{D as i}from"./shared-5fa697c4.js";const n=t`<dom-module id="lumo-number-field" theme-for="vaadin-number-field">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-field-button">
|
|
4
4
|
:host {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{D as t,i as n,e}from"./shared-43f449bb.js";import{D as o}from"./shared-5fa697c4.js";class l extends HTMLElement{static get version(){return"1.6.1"}}customElements.define("vaadin-lumo-styles",l);const a=document.createElement("template");a.innerHTML='<custom-style>\n <style>\n html {\n /* Base (background) */\n --lumo-base-color: #FFF;\n\n /* Tint */\n --lumo-tint-5pct: hsla(0, 0%, 100%, 0.3);\n --lumo-tint-10pct: hsla(0, 0%, 100%, 0.37);\n --lumo-tint-20pct: hsla(0, 0%, 100%, 0.44);\n --lumo-tint-30pct: hsla(0, 0%, 100%, 0.5);\n --lumo-tint-40pct: hsla(0, 0%, 100%, 0.57);\n --lumo-tint-50pct: hsla(0, 0%, 100%, 0.64);\n --lumo-tint-60pct: hsla(0, 0%, 100%, 0.7);\n --lumo-tint-70pct: hsla(0, 0%, 100%, 0.77);\n --lumo-tint-80pct: hsla(0, 0%, 100%, 0.84);\n --lumo-tint-90pct: hsla(0, 0%, 100%, 0.9);\n --lumo-tint: #FFF;\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 61%, 25%, 0.05);\n --lumo-shade-10pct: hsla(214, 57%, 24%, 0.1);\n --lumo-shade-20pct: hsla(214, 53%, 23%, 0.16);\n --lumo-shade-30pct: hsla(214, 50%, 22%, 0.26);\n --lumo-shade-40pct: hsla(214, 47%, 21%, 0.38);\n --lumo-shade-50pct: hsla(214, 45%, 20%, 0.5);\n --lumo-shade-60pct: hsla(214, 43%, 19%, 0.61);\n --lumo-shade-70pct: hsla(214, 42%, 18%, 0.72);\n --lumo-shade-80pct: hsla(214, 41%, 17%, 0.83);\n --lumo-shade-90pct: hsla(214, 40%, 16%, 0.94);\n --lumo-shade: hsl(214, 35%, 15%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-shade-5pct);\n --lumo-contrast-10pct: var(--lumo-shade-10pct);\n --lumo-contrast-20pct: var(--lumo-shade-20pct);\n --lumo-contrast-30pct: var(--lumo-shade-30pct);\n --lumo-contrast-40pct: var(--lumo-shade-40pct);\n --lumo-contrast-50pct: var(--lumo-shade-50pct);\n --lumo-contrast-60pct: var(--lumo-shade-60pct);\n --lumo-contrast-70pct: var(--lumo-shade-70pct);\n --lumo-contrast-80pct: var(--lumo-shade-80pct);\n --lumo-contrast-90pct: var(--lumo-shade-90pct);\n --lumo-contrast: var(--lumo-shade);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 90%, 52%);\n --lumo-primary-color-50pct: hsla(214, 90%, 52%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 52%, 0.1);\n --lumo-primary-text-color: var(--lumo-primary-color);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 100%, 61%);\n --lumo-error-color-50pct: hsla(3, 100%, 60%, 0.5);\n --lumo-error-color-10pct: hsla(3, 100%, 60%, 0.1);\n --lumo-error-text-color: hsl(3, 92%, 53%);\n --lumo-error-contrast-color: #FFF;\n\n /* Success */\n --lumo-success-color: hsl(145, 80%, 42%); /* hsl(144,82%,37%); */\n --lumo-success-color-50pct: hsla(145, 76%, 44%, 0.55);\n --lumo-success-color-10pct: hsla(145, 76%, 44%, 0.12);\n --lumo-success-text-color: hsl(145, 100%, 32%);\n --lumo-success-contrast-color: #FFF;\n }\n </style>\n</custom-style><dom-module id="lumo-color">\n <template>\n <style>\n [theme~="dark"] {\n /* Base (background) */\n --lumo-base-color: hsl(214, 35%, 21%);\n\n /* Tint */\n --lumo-tint-5pct: hsla(214, 65%, 85%, 0.06);\n --lumo-tint-10pct: hsla(214, 60%, 80%, 0.14);\n --lumo-tint-20pct: hsla(214, 64%, 82%, 0.23);\n --lumo-tint-30pct: hsla(214, 69%, 84%, 0.32);\n --lumo-tint-40pct: hsla(214, 73%, 86%, 0.41);\n --lumo-tint-50pct: hsla(214, 78%, 88%, 0.5);\n --lumo-tint-60pct: hsla(214, 82%, 90%, 0.6);\n --lumo-tint-70pct: hsla(214, 87%, 92%, 0.7);\n --lumo-tint-80pct: hsla(214, 91%, 94%, 0.8);\n --lumo-tint-90pct: hsla(214, 96%, 96%, 0.9);\n --lumo-tint: hsl(214, 100%, 98%);\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 0%, 0%, 0.07);\n --lumo-shade-10pct: hsla(214, 4%, 2%, 0.15);\n --lumo-shade-20pct: hsla(214, 8%, 4%, 0.23);\n --lumo-shade-30pct: hsla(214, 12%, 6%, 0.32);\n --lumo-shade-40pct: hsla(214, 16%, 8%, 0.41);\n --lumo-shade-50pct: hsla(214, 20%, 10%, 0.5);\n --lumo-shade-60pct: hsla(214, 24%, 12%, 0.6);\n --lumo-shade-70pct: hsla(214, 28%, 13%, 0.7);\n --lumo-shade-80pct: hsla(214, 32%, 13%, 0.8);\n --lumo-shade-90pct: hsla(214, 33%, 13%, 0.9);\n --lumo-shade: hsl(214, 33%, 13%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-tint-5pct);\n --lumo-contrast-10pct: var(--lumo-tint-10pct);\n --lumo-contrast-20pct: var(--lumo-tint-20pct);\n --lumo-contrast-30pct: var(--lumo-tint-30pct);\n --lumo-contrast-40pct: var(--lumo-tint-40pct);\n --lumo-contrast-50pct: var(--lumo-tint-50pct);\n --lumo-contrast-60pct: var(--lumo-tint-60pct);\n --lumo-contrast-70pct: var(--lumo-tint-70pct);\n --lumo-contrast-80pct: var(--lumo-tint-80pct);\n --lumo-contrast-90pct: var(--lumo-tint-90pct);\n --lumo-contrast: var(--lumo-tint);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 86%, 55%);\n --lumo-primary-color-50pct: hsla(214, 86%, 55%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 63%, 0.1);\n --lumo-primary-text-color: hsl(214, 100%, 70%);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 90%, 63%);\n --lumo-error-color-50pct: hsla(3, 90%, 63%, 0.5);\n --lumo-error-color-10pct: hsla(3, 90%, 63%, 0.1);\n --lumo-error-text-color: hsl(3, 100%, 67%);\n\n /* Success */\n --lumo-success-color: hsl(145, 65%, 42%);\n --lumo-success-color-50pct: hsla(145, 65%, 42%, 0.5);\n --lumo-success-color-10pct: hsla(145, 65%, 42%, 0.1);\n --lumo-success-text-color: hsl(145, 85%, 47%);\n }\n\n html {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n [theme~="dark"] {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n color: var(--lumo-header-text-color);\n }\n\n a {\n color: var(--lumo-primary-text-color);\n }\n\n blockquote {\n color: var(--lumo-secondary-text-color);\n }\n\n code,\n pre {\n background-color: var(--lumo-contrast-10pct);\n border-radius: var(--lumo-border-radius-m);\n }\n </style>\n </template>\n</dom-module><dom-module id="lumo-color-legacy">\n <template>\n <style include="lumo-color">\n :host {\n color: var(--lumo-body-text-color) !important;\n background-color: var(--lumo-base-color) !important;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(a.content);const s=document.createElement("template");s.innerHTML="<custom-style>\n <style>\n html {\n --lumo-size-xs: 1.625rem;\n --lumo-size-s: 1.875rem;\n --lumo-size-m: 2.25rem;\n --lumo-size-l: 2.75rem;\n --lumo-size-xl: 3.5rem;\n\n /* Icons */\n --lumo-icon-size-s: 1.25em;\n --lumo-icon-size-m: 1.5em;\n --lumo-icon-size-l: 2.25em;\n /* For backwards compatibility */\n --lumo-icon-size: var(--lumo-icon-size-m);\n }\n </style>\n</custom-style>",document.head.appendChild(s.content);const r=document.createElement("template");r.innerHTML="<custom-style>\n <style>\n html {\n /* Square */\n --lumo-space-xs: 0.25rem;\n --lumo-space-s: 0.5rem;\n --lumo-space-m: 1rem;\n --lumo-space-l: 1.5rem;\n --lumo-space-xl: 2.5rem;\n\n /* Wide */\n --lumo-space-wide-xs: calc(var(--lumo-space-xs) / 2) var(--lumo-space-xs);\n --lumo-space-wide-s: calc(var(--lumo-space-s) / 2) var(--lumo-space-s);\n --lumo-space-wide-m: calc(var(--lumo-space-m) / 2) var(--lumo-space-m);\n --lumo-space-wide-l: calc(var(--lumo-space-l) / 2) var(--lumo-space-l);\n --lumo-space-wide-xl: calc(var(--lumo-space-xl) / 2) var(--lumo-space-xl);\n\n /* Tall */\n --lumo-space-tall-xs: var(--lumo-space-xs) calc(var(--lumo-space-xs) / 2);\n --lumo-space-tall-s: var(--lumo-space-s) calc(var(--lumo-space-s) / 2);\n --lumo-space-tall-m: var(--lumo-space-m) calc(var(--lumo-space-m) / 2);\n --lumo-space-tall-l: var(--lumo-space-l) calc(var(--lumo-space-l) / 2);\n --lumo-space-tall-xl: var(--lumo-space-xl) calc(var(--lumo-space-xl) / 2);\n }\n </style>\n</custom-style>",document.head.appendChild(r.content);const c=document.createElement("template");c.innerHTML="<custom-style>\n <style>\n html {\n /* Border radius */\n --lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */\n --lumo-border-radius-m: var(--lumo-border-radius, 0.25em); /* Button, text field, menu overlay, etc */\n --lumo-border-radius-l: 0.5em; /* Dialog, notification, etc */\n --lumo-border-radius: 0.25em; /* Deprecated */\n\n /* Shadow */\n --lumo-box-shadow-xs: 0 1px 4px -1px var(--lumo-shade-50pct);\n --lumo-box-shadow-s: 0 2px 4px -1px var(--lumo-shade-20pct), 0 3px 12px -1px var(--lumo-shade-30pct);\n --lumo-box-shadow-m: 0 2px 6px -1px var(--lumo-shade-20pct), 0 8px 24px -4px var(--lumo-shade-40pct);\n --lumo-box-shadow-l: 0 3px 18px -2px var(--lumo-shade-20pct), 0 12px 48px -6px var(--lumo-shade-40pct);\n --lumo-box-shadow-xl: 0 4px 24px -3px var(--lumo-shade-20pct), 0 18px 64px -8px var(--lumo-shade-40pct);\n\n /* Clickable element cursor */\n --lumo-clickable-cursor: default;\n }\n </style>\n</custom-style>",document.head.appendChild(c.content);const m=document.createElement("template");m.innerHTML='<custom-style>\n <style>\n html {\n /* Font families */\n --lumo-font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n\n /* Font sizes */\n --lumo-font-size-xxs: .75rem;\n --lumo-font-size-xs: .8125rem;\n --lumo-font-size-s: .875rem;\n --lumo-font-size-m: 1rem;\n --lumo-font-size-l: 1.125rem;\n --lumo-font-size-xl: 1.375rem;\n --lumo-font-size-xxl: 1.75rem;\n --lumo-font-size-xxxl: 2.5rem;\n\n /* Line heights */\n --lumo-line-height-xs: 1.25;\n --lumo-line-height-s: 1.375;\n --lumo-line-height-m: 1.625;\n }\n\n </style>\n</custom-style><dom-module id="lumo-typography">\n <template>\n <style>\n html {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n /* Can’t combine with the above selector because that doesn’t work in browsers without native shadow dom */\n :host {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n small,\n [theme~="font-size-s"] {\n font-size: var(--lumo-font-size-s);\n line-height: var(--lumo-line-height-s);\n }\n\n [theme~="font-size-xs"] {\n font-size: var(--lumo-font-size-xs);\n line-height: var(--lumo-line-height-xs);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-weight: 600;\n line-height: var(--lumo-line-height-xs);\n margin-top: 1.25em;\n }\n\n h1 {\n font-size: var(--lumo-font-size-xxxl);\n margin-bottom: 0.75em;\n }\n\n h2 {\n font-size: var(--lumo-font-size-xxl);\n margin-bottom: 0.5em;\n }\n\n h3 {\n font-size: var(--lumo-font-size-xl);\n margin-bottom: 0.5em;\n }\n\n h4 {\n font-size: var(--lumo-font-size-l);\n margin-bottom: 0.5em;\n }\n\n h5 {\n font-size: var(--lumo-font-size-m);\n margin-bottom: 0.25em;\n }\n\n h6 {\n font-size: var(--lumo-font-size-xs);\n margin-bottom: 0;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n }\n\n p,\n blockquote {\n margin-top: 0.5em;\n margin-bottom: 0.75em;\n }\n\n a {\n text-decoration: none;\n }\n\n a:hover {\n text-decoration: underline;\n }\n\n hr {\n display: block;\n align-self: stretch;\n height: 1px;\n border: 0;\n padding: 0;\n margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);\n background-color: var(--lumo-contrast-10pct);\n }\n\n blockquote {\n border-left: 2px solid var(--lumo-contrast-30pct);\n }\n\n b,\n strong {\n font-weight: 600;\n }\n\n /* RTL specific styles */\n\n blockquote[dir="rtl"] {\n border-left: none;\n border-right: 2px solid var(--lumo-contrast-30pct);\n }\n\n </style>\n </template>\n</dom-module>',document.head.appendChild(m.content);const i=t=>class extends t{static get properties(){return{theme:{type:String,readOnly:!0}}}attributeChangedCallback(t,n,e){super.attributeChangedCallback(t,n,e),"theme"===t&&this._setTheme(e)}},u=t=>class extends(i(t)){static finalize(){super.finalize();const t=this.prototype._template,n=this.template&&this.template.parentElement&&this.template.parentElement.id===this.is,e=Object.getPrototypeOf(this.prototype)._template;e&&!n&&Array.from(e.content.querySelectorAll("style[include]")).forEach((n=>{this._includeStyle(n.getAttribute("include"),t)})),this._includeMatchingThemes(t)}static _includeMatchingThemes(t){const n=o.prototype.modules;let e=!1;const l=this.is+"-default-theme";Object.keys(n).sort(((t,n)=>{const e=0===t.indexOf("vaadin-"),o=0===n.indexOf("vaadin-"),l=["lumo-","material-"],a=l.filter((n=>0===t.indexOf(n))).length>0,s=l.filter((t=>0===n.indexOf(t))).length>0;return e!==o?e?-1:1:a!==s?a?-1:1:0})).forEach((o=>{if(o!==l){const l=n[o].getAttribute("theme-for");l&&l.split(" ").forEach((n=>{new RegExp("^"+n.split("*").join(".*")+"$").test(this.is)&&(e=!0,this._includeStyle(o,t))}))}})),!e&&n[l]&&this._includeStyle(l,t)}static _includeStyle(t,n){if(n&&!n.content.querySelector(`style[include="${t}"]`)){const e=document.createElement("style");e.setAttribute("include",t),n.content.appendChild(e)}}}
|
|
2
|
+
/**
|
|
3
|
+
@license
|
|
4
|
+
Copyright (c) 2020 Vaadin Ltd.
|
|
5
|
+
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6
|
+
*/;class d{static detectScrollType(){const t=document.createElement("div");t.textContent="ABCD",t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t);let n="reverse";return t.scrollLeft>0?n="default":(t.scrollLeft=2,t.scrollLeft<2&&(n="negative")),document.body.removeChild(t),n}static getNormalizedScrollLeft(t,n,e){const{scrollLeft:o}=e;if("rtl"!==n||!t)return o;switch(t){case"negative":return e.scrollWidth-e.clientWidth+o;case"reverse":return e.scrollWidth-e.clientWidth-o}return o}static setNormalizedScrollLeft(t,n,e,o){if("rtl"===n&&t)switch(t){case"negative":e.scrollLeft=e.clientWidth-e.scrollWidth+o;break;case"reverse":e.scrollLeft=e.scrollWidth-e.clientWidth-o;break;default:e.scrollLeft=o}else e.scrollLeft=o}}const p=[];let h;new MutationObserver((function(){const t=f();p.forEach((n=>{v(n,t)}))})).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const v=function(t,n){n?t.setAttribute("dir",n):t.removeAttribute("dir")},f=function(){return document.documentElement.getAttribute("dir")},x=t=>class extends t{static get properties(){return{dir:{type:String,readOnly:!0}}}static finalize(){super.finalize(),h||(h=d.detectScrollType())}connectedCallback(){super.connectedCallback(),this.hasAttribute("dir")||(this.__subscribe(),v(this,f()))}attributeChangedCallback(t,n,e){if(super.attributeChangedCallback(t,n,e),"dir"!==t)return;const o=e===f()&&-1===p.indexOf(this),l=!e&&n&&-1===p.indexOf(this),a=e!==f()&&n===f();o||l?(this.__subscribe(),v(this,f())):a&&this.__subscribe(!1)}disconnectedCallback(){super.disconnectedCallback(),this.__subscribe(!1),this.removeAttribute("dir")}__subscribe(t=!0){t?-1===p.indexOf(this)&&p.push(this):p.indexOf(this)>-1&&p.splice(p.indexOf(this),1)}__getNormalizedScrollLeft(t){return d.getNormalizedScrollLeft(h,this.getAttribute("dir")||"ltr",t)}__setNormalizedScrollLeft(t,n){return d.setNormalizedScrollLeft(h,this.getAttribute("dir")||"ltr",t,n)}},b=/\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i,y=window.Vaadin&&window.Vaadin.Flow&&window.Vaadin.Flow.clients;function g(t,n){if("function"!=typeof t)return;const e=b.exec(t.toString());if(e)try{t=new Function(e[1])}catch(t){console.log("vaadin-development-mode-detector: uncommentAndRun() failed",t)}return t(n)}window.Vaadin=window.Vaadin||{};const w=function(t,n){if(window.Vaadin.developmentMode)return g(t,n)};function z(){}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=function(){try{return!!localStorage.getItem("vaadin.developmentmode.force")||["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0&&(y?!(y&&Object.keys(y).map((t=>y[t])).filter((t=>t.productionMode)).length>0):!g((function(){return!0})))}catch(t){return!1}}());const k=function(){return w(z)};let C;window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations=window.Vaadin.registrations||[],window.Vaadin.developmentModeCallback=window.Vaadin.developmentModeCallback||{},window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){k&&k()};const S=new Set,F=o=>class extends(x(o)){static finalize(){super.finalize();const{is:o}=this;o&&!S.has(o)&&(window.Vaadin.registrations.push(this),S.add(o),window.Vaadin.developmentModeCallback&&(C=t.debounce(C,n,(()=>{window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]()})),e(C)))}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}};export{x as D,F as E,u as T,d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t}from"./shared-1522d76f.js";import{h as e,L as s}from"./shared-7f33a83a.js";import{C as i}from"./shared-b23c903e.js";import{a as r,T as o}from"./shared-
|
|
1
|
+
import{_ as t}from"./shared-1522d76f.js";import{h as e,L as s}from"./shared-7f33a83a.js";import{C as i}from"./shared-b23c903e.js";import{a as r,T as o}from"./shared-5fa697c4.js";import{c as n}from"./shared-4e709717.js";import{l as a}from"./shared-f3b35364.js";import{r as l}from"./shared-d519a301.js";import{I as c}from"./shared-30cbf0a6.js";let d,h,u,m=t=>t;const p=r(i(o(c(s))));class f extends p{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 t=n({"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}),s=n({"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 e(d||(d=m` <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,(t=>t.value),((i,r)=>{var o;return e(h||(h=m` <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> `),s,null!==(o=i.label)&&void 0!==o?o:i.value,this.t("delete"),t,this.disabled,(()=>{this.items.splice(r,1),this.requestUpdate("items"),this.dispatchEvent(new CustomEvent("change"))}))})),n({"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,(t=>"Enter"===t.key&&r()),(t=>t.stopPropagation()),(t=>{this.__newItem=t.currentTarget.value.trim()}),this.options.map((({label:t,value:s})=>{if(!this.items.some((t=>t.value===s)))return e(u||(u=m`<option value="${0}">${0}</option>`),s,null!=t?t:s)})),this.__newItem?"opacity-100":"opacity-0",this.t("submit"),n({"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{f as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-f9180815.js";import"./shared-029816d7.js";import{_ as e}from"./shared-1522d76f.js";import{C as r}from"./shared-b23c903e.js";import{a as t,T as s}from"./shared-5fa697c4.js";import{h as n,f as o,L as i}from"./shared-7f33a83a.js";import{I as a}from"./shared-30cbf0a6.js";import{N as l}from"./shared-6a7f96c4.js";let d,f,p,u,h=e=>e;class m extends(r(t(s(a(i))))){constructor(){super(...arguments),this.nucleon=null}static get inferredProperties(){return[...super.inferredProperties,"nucleon"]}static get properties(){return e(e({},super.properties),{},{nucleon:{attribute:!1}})}inferFromElement(e,r){return"nucleon"===e&&r instanceof l?r:super.inferFromElement(e,r)}applyInferredProperties(e){var r,t;super.applyInferredProperties(e),this.nucleon=null!==(r=e.get("nucleon"))&&void 0!==r?r:null,!1===(null===(t=this.nucleon)||void 0===t?void 0:t.in("idle"))&&(this.disabled=!0)}updated(e){if(super.updated(e),"string"==typeof this.infer){const e=n(d||(d=h` <slot name="${0}:before" slot="before"></slot> <slot name="${0}:after" slot="after"></slot> `),this.infer,this.infer);o(e,this)}}renderControl(){return n(f||(f=h``))}render(){return this.hidden?n(p||(p=h``)):n(u||(u=h` ${0} ${0} ${0} `),this.renderTemplateOrSlot("before",this.nucleon),this.renderControl(),this.renderTemplateOrSlot("after",this.nucleon))}}customElements.define("foxy-internal-control",m);export{m as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-c7b3d22b.js";import"./shared-029816d7.js";import{I as e}from"./shared-fc15a882.js";import{h as t}from"./shared-7f33a83a.js";import{_ as r,Y as i}from"./shared-1522d76f.js";import"./shared-d21fa1a6.js";import"./foxy-spinner.js";import{C as n}from"./shared-b23c903e.js";import{T as s}from"./shared-5fa697c4.js";import{N as a}from"./shared-6a7f96c4.js";import{c as o}from"./shared-4e709717.js";let l,d=e=>e;customElements.define("foxy-internal-delete-control",class extends e{constructor(){super(...arguments),this.theme="error"}static get properties(){return r(r({},super.properties),{},{theme:{type:String}})}renderControl(){return t(l||(l=d` <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" infer="" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button data-testid="delete" theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="delete"></foxy-i18n> </vaadin-button> `),(e=>{var t;return!e.detail.cancelled&&(null===(t=this.nucleon)||void 0===t?void 0:t.delete())}),this.theme,this.disabled||this.readonly,(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}))}});let c,u=e=>e;customElements.define("foxy-internal-create-control",class extends e{constructor(){super(...arguments),this.theme="primary success"}static get properties(){return r(r({},super.properties),{},{theme:{type:String}})}renderControl(){return t(c||(c=u` <vaadin-button class="w-full" theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="create"></foxy-i18n> </vaadin-button> `),this.theme,this.disabled||this.__isInvalid,(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.submit()}))}get __isCleanTemplateInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{template:{clean:"invalid"}}}))}get __isDirtyTemplateInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{template:{dirty:"invalid"}}}))}get __isCleanSnapshotInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{snapshot:{clean:"invalid"}}}))}get __isDirtySnapshotInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{snapshot:{dirty:"invalid"}}}))}get __isTemplateInvalid(){return this.__isCleanTemplateInvalid||this.__isDirtyTemplateInvalid}get __isSnapshotInvalid(){return this.__isCleanSnapshotInvalid||this.__isDirtySnapshotInvalid}get __isInvalid(){return this.__isSnapshotInvalid||this.__isTemplateInvalid}});let p,f=e=>e;customElements.define("foxy-internal-timestamps-control",class extends e{renderControl(){return t(p||(p=f` <p class="font-lumo text-xs leading-s text-secondary"> <foxy-i18n infer="" key="date_created"></foxy-i18n> <foxy-i18n .options="${0}" infer="" key="date"> </foxy-i18n> <span>•<span> <foxy-i18n infer="" key="date_modified"></foxy-i18n> <foxy-i18n .options="${0}" infer="" key="date"> </foxy-i18n> </span></span></p> `),{value:i(this,"nucleon.data.date_created")},{value:i(this,"nucleon.data.date_modified")})}});let h,m,y,v,x,_=e=>e;const g=n(s(a));class b extends g{constructor(){super(...arguments),this.status=null}static get properties(){return r(r({},super.properties),{},{status:{type:Object}})}renderBody(){return this.data?t(h||(h=_` <foxy-internal-timestamps-control infer="timestamps"></foxy-internal-timestamps-control> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `)):t(m||(m=_`<foxy-internal-create-control infer="create"></foxy-internal-create-control>`))}render(){const e=!(this.in("idle")||this.in({busy:"fetching"})&&this.data);return t(y||(y=_` <div aria-busy="${0}" aria-live="polite" class="relative"> <div class="${0}"> ${0} ${0} ${0} </div> <div data-testid="spinner" class="${0}"> <foxy-spinner layout="${0}" class="m-auto" state="${0}" infer="spinner"> </foxy-spinner> </div> </div> `),this.in("busy"),o({"grid grid-cols-1 gap-m":!0,"transition-opacity":!0,"opacity-0 pointer-events-none":e}),this.__generalErrors.map((e=>this.__renderGeneralError(e))),this.status?this.__renderStatus(this.status):"",this.renderBody(),o({"transition-opacity absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!e}),this.in("fail")?"vertical":"no-label",this.in("fail")?"error":"busy")}get __generalErrors(){const e=this.constructor.generalErrorPrefix;return this.errors.filter((t=>t.startsWith(e)))}__renderGeneralError(e){return t(v||(v=_` <foxy-i18n class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" infer="error" key="${0}"> </foxy-i18n> `),e.replace("error:",""))}__renderStatus({key:e,options:r}){return t(x||(x=_` <p data-testid="status" class="leading-xs text-body rounded bg-success-10 flex items-start gap-m" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n class="flex-1" infer="status" key="${0}" .options="${0}"></foxy-i18n> <vaadin-button class="flex-shrink-0" theme="success tertiary-inline" @click="${0}"> <foxy-i18n class="flex-1" infer="status" key="close"></foxy-i18n> </vaadin-button> </p> `),e,r,(()=>this.status=null))}}b.generalErrorPrefix="error:",customElements.define("foxy-internal-form",b);export{b as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as e,M as t,n as s,c as i,d as n,g as r,V as o,j as l,k as a,l as h,u as c,m as d,o as u,w as _,p,E as f,G as m,q as y,r as g,s as b,D as C,t as v,v as x,x as w,P as S,y as P,z as E,e as I,A as O,h as A}from"./shared-
|
|
1
|
+
import{f as e,M as t,n as s,c as i,d as n,g as r,V as o,j as l,k as a,l as h,u as c,m as d,o as u,w as _,p,E as f,G as m,q as y,r as g,s as b,D as C,t as v,v as x,x as w,P as S,y as P,z as E,e as I,A as O,h as A}from"./shared-43f449bb.js";import{l as k,b as N,s as T,c as M,u as D,d as R,f as F}from"./shared-5fa697c4.js";
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|