@foxy.io/elements 1.44.0 → 1.45.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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-admin-subscription-form.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-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-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-form.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- 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-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-experimental-add-to-cart-builder.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-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-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 +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 +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-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-nucleon-element.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 +1 -1
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-container-card.js +1 -1
- package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-shipping-service-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-card.js +1 -1
- package/dist/cdn/foxy-user-invitation-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-f00cd094.js → shared-05e997ae.js} +1 -1
- package/dist/cdn/{shared-d0c1664e.js → shared-0abec247.js} +1 -1
- package/dist/cdn/{shared-9b599205.js → shared-0b3dbac6.js} +1 -1
- package/dist/cdn/{shared-15a7e329.js → shared-1b04321a.js} +1 -1
- package/dist/cdn/{shared-cee1c6f1.js → shared-4e279e77.js} +1 -1
- package/dist/cdn/{shared-e6559d84.js → shared-4e4766ee.js} +1 -1
- package/dist/cdn/{shared-d525b69b.js → shared-4f36f302.js} +1 -1
- package/dist/cdn/{shared-c4df3a2a.js → shared-52053d0d.js} +1 -1
- package/dist/cdn/{shared-57b7386e.js → shared-6783fe5e.js} +1 -1
- package/dist/cdn/{shared-da95bb48.js → shared-69074dae.js} +1 -1
- package/dist/cdn/{shared-da4f539a.js → shared-7933d898.js} +1 -1
- package/dist/cdn/{shared-8f2da12b.js → shared-7f4e3256.js} +1 -1
- package/dist/cdn/{shared-8a83a6eb.js → shared-8ba28691.js} +1 -1
- package/dist/cdn/{shared-b56949d3.js → shared-8ba4b5bf.js} +1 -1
- package/dist/cdn/{shared-b4a3d776.js → shared-8bda01cf.js} +1 -1
- package/dist/cdn/{shared-6c2a7d2f.js → shared-92c211bd.js} +1 -1
- package/dist/cdn/shared-9585cf5b.js +1 -0
- package/dist/cdn/{shared-64c855e5.js → shared-ada2d315.js} +1 -1
- package/dist/cdn/{shared-5b93d193.js → shared-adfed461.js} +1 -1
- package/dist/cdn/{shared-438e41ab.js → shared-b148b310.js} +1 -1
- package/dist/cdn/{shared-090ee4eb.js → shared-b7401886.js} +1 -1
- package/dist/cdn/{shared-264fb8a2.js → shared-ba0d1f31.js} +1 -1
- package/dist/cdn/{shared-a1f181bf.js → shared-bc89d3fb.js} +1 -1
- package/dist/cdn/{shared-8ee6bff5.js → shared-c84bb30e.js} +1 -1
- package/dist/cdn/{shared-af39ffd8.js → shared-d674d2ce.js} +1 -1
- package/dist/cdn/{shared-597fffaa.js → shared-df92d411.js} +1 -1
- package/dist/cdn/{shared-73c199ae.js → shared-f58068b0.js} +1 -1
- package/dist/cdn/translations/admin-subscription-form/en.json +2 -0
- package/dist/cdn/translations/cart-form/en.json +2 -0
- package/dist/cdn/translations/coupon-card/en.json +9 -9
- package/dist/cdn/translations/coupon-form/en.json +10 -8
- package/dist/cdn/translations/discount-builder/en.json +3 -1
- package/dist/cdn/translations/experimental-add-to-cart-builder/en.json +15 -5
- package/dist/cdn/translations/item-category-form/en.json +2 -0
- package/dist/cdn/translations/item-form/en.json +2 -0
- package/dist/cdn/translations/store-form/en.json +16 -4
- package/dist/cdn/translations/transaction/en.json +2 -0
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js +1 -1
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js.map +1 -1
- package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js +174 -149
- package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js.map +1 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js +11 -6
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +0 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
- package/dist/elements/public/StoreForm/StoreForm.js +6 -6
- package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
- package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.js +0 -2
- package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-02dd05dd.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-a6cf5b1f.js";import{h as e,G as t,P as r}from"./shared-3bc9eaf7.js";import{E as o,T as i,D as s}from"./shared-46efbc40.js";import{C as a}from"./shared-24998349.js";import"./shared-dc357e9d.js";import{F as l}from"./shared-3db3f3c3.js";import{I as n}from"./shared-
|
|
1
|
+
import"./shared-a6cf5b1f.js";import{h as e,G as t,P as r}from"./shared-3bc9eaf7.js";import{E as o,T as i,D as s}from"./shared-46efbc40.js";import{C as a}from"./shared-24998349.js";import"./shared-dc357e9d.js";import{F as l}from"./shared-3db3f3c3.js";import{I as n}from"./shared-92c211bd.js";import"./shared-64210e53.js";import{_ as d}from"./shared-7fec42f2.js";import{i as h}from"./shared-53e42a77.js";import{c,h as u}from"./shared-ba5c42c7.js";import{c as p}from"./shared-4e709717.js";import{x as b}from"./shared-387d7254.js";const m=e`<dom-module id="lumo-radio-button" theme-for="vaadin-radio-button">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-a6b2bd14.js";import"./shared-
|
|
1
|
+
import"./shared-a6b2bd14.js";import"./shared-05e997ae.js";import"./shared-d674d2ce.js";import"./shared-8ba4b5bf.js";import{I as e}from"./shared-4e4766ee.js";import{a as t}from"./shared-92c211bd.js";import"./shared-64210e53.js";import{i as s}from"./shared-53e42a77.js";import{h as o}from"./shared-ba5c42c7.js";import{c as r,_ as n,B as i}from"./shared-7fec42f2.js";import{S as a,a as l}from"./shared-387d7254.js";import{v as d}from"./shared-b738ee96.js";import{c}from"./shared-4e709717.js";let h,p=e=>e;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends t{renderControl(){var e,t;const r=this.nucleon;return o(h||(h=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(t=null===(e=null==r?void 0:r.settings)||void 0===e?void 0:e.tos_checkbox_settings)||void 0===t?void 0:t.url))}});var u=r((function(e){!function(){const t=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(e,s=t,o="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let r=e||"";s[0].minDiversity=0,s[0].minLength=0;const n=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];o&&n.push({regex:`[${o}]`,message:"symbol"});let i={};i.contains=n.filter((e=>new RegExp(`${e.regex}`).test(r))).map((e=>e.message)),i.length=r.length;let a=s.filter((e=>i.contains.length>=e.minDiversity)).filter((e=>i.length>=e.minLength)).sort(((e,t)=>t.id-e.id)).map((e=>({id:e.id,value:e.value})));return Object.assign(i,a[0]),i};e.exports={passwordStrength:s,defaultOptions:t}}()}));let m,f,_=e=>e;const g=a(l(e,"customer-form")),x=u.passwordStrength;class v extends g{constructor(){super(...arguments),this.passwordless=!1,this.settings=null,this.__passwordGeneratorOptions={checkStrength:e=>x(e).id>=2},this.__isAnonymousGetValue=()=>{var e;return!1===(null===(e=this.form)||void 0===e?void 0:e.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=e=>{const t="true"===e;this.edit({is_anonymous:t}),t&&this.form.password&&this.edit({password:""}),t&&this.form.password_old&&this.edit({password_old:""}),t&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-spinner":customElements.get("foxy-spinner"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return n(n({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:e,_links:t,is_anonymous:s=!0},o)=>!!o.passwordless||(!!(t||s||e)||"password:v8n_required"),({password_old:e,password:t,_links:s},o)=>{var r;return!s||(void 0===(null===(r=o.settings)||void 0===r?void 0:r.sign_up)||(!(t&&!e)||"password-old:v8n_required"))},({first_name:e})=>!e||e.length<=50||"first-name:v8n_too_long",({last_name:e})=>!e||e.length<=50||"last-name:v8n_too_long",({password:e})=>!e||x(e).id>=2||"password:v8n_too_weak",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({tax_id:e})=>!e||e.length<=50||"tax-id:v8n_too_long",({email:e})=>e&&e.length>0||"email:v8n_required",({email:e})=>!e||e.length<=100||"email:v8n_too_long",({email:e})=>!e||d(e)||"email:v8n_invalid_email"]}get hiddenSelector(){const e=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(e.add("forgot-password"),e.add("is-anonymous"),this.form.password||e.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&e.add("legal-notice")):(!1!==this.form.is_anonymous&&(e.add("forgot-password"),e.add("password")),e.add("password-old"),e.add("legal-notice")),this.href&&(e.add("is-anonymous"),e.add("legal-notice")),new i(Array.from(e).join(" ").trim())}get headerTitleOptions(){var e,t;const s=this.data;return!s||(null===(e=s.first_name)||void 0===e?void 0:e.trim())||(null===(t=s.last_name)||void 0===t?void 0:t.trim())?super.headerTitleOptions:n(n({},super.headerTitleOptions),{},{context:"no_name"})}get headerSubtitleKey(){var e;return(null===(e=this.data)||void 0===e?void 0:e.is_anonymous)?"subtitle_anonymous":"subtitle_registered"}get headerSubtitleOptions(){return n(n({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}disconnectedCallback(){super.disconnectedCallback();const e=this.__refreshInterval;e&&clearInterval(e)}connectedCallback(){super.connectedCallback();const e=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=e}renderBody(){var e,t,s,r;const n=this.hiddenSelector.matches("first-name",!0),i=this.hiddenSelector.matches("last-name",!0);return o(m||(m=_` ${0} <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),this.renderHeader(),c({"grid-cols-2":!n&&!i,hidden:n&&i,"gap-m":!0,grid:!n||!i}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__passwordGeneratorOptions,this.__forgotPasswordHelperText,!this.data&&(null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.enabled)&&"hcaptcha"===(null===(r=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===r?void 0:r.verification.type)?o(f||(f=_` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:e})=>{this.edit({verification:{type:"hcaptcha",token:e}}),super.submit()})):"",super.renderBody())}submit(){var e,t,s,o,r;"hcaptcha"!==(null===(s=null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(o=this.__hcaptcha)||void 0===o||o.reset(),null===(r=this.__hcaptcha)||void 0===r||r.execute())}async _sendPatch(e){const t=await super._sendPatch(e);if(e.password){const e={key:"password_change_success",options:{email:t.email}};this.status=e}return t}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw"Conflict"===t||t.startsWith("This email address is already in use")?["error:email_already_used"]:t.startsWith("Customer registration is disabled")?["error:registration_disabled"]:t.startsWith("Client verification failed")?["error:verification_failed"]:t.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:e}}get __forgotPasswordHelperText(){var e,t;const s=null===(e=this.data)||void 0===e?void 0:e.forgot_password_timestamp,o="forgot-password.helper_text";if((null===(t=this.data)||void 0===t?void 0:t.forgot_password)&&s){const e=new Date(new Date(s).getTime()+18e5),t=Math.floor((e.getTime()-Date.now())/1e3/60);return t<=0?this.t(`${o}_expired_on`,{expiresOn:e}):this.t(`${o}_expires_in`,{expiresInMin:`${t}minutes`})}return this.t(o)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var e;return(null===(e=this.data)||void 0===e?void 0:e.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",v);export{v as C,u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-5574ea83.js";import"./shared-ac44a3a5.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-5574ea83.js";import"./shared-ac44a3a5.js";import{I as e}from"./shared-92c211bd.js";import{_ as t}from"./shared-7fec42f2.js";import{c as i,h as s}from"./shared-ba5c42c7.js";import{i as r}from"./shared-53e42a77.js";import{c as a}from"./shared-4e709717.js";let l,n,o,d,u,h,p,m=e=>e;customElements.define("foxy-internal-number-control",class extends e{constructor(){super(...arguments),this.layout=null,this.prefix=null,this.suffix=null,this.step=null,this.min=null,this.max=null,this.__isErrorVisible=!1}static get properties(){return t(t({},super.properties),{},{layout:{},prefix:{},suffix:{},step:{type:Number},min:{type:Number},max:{type:Number},__isErrorVisible:{attribute:!1}})}static get styles(){return[...super.styles,i(l||(l=m`input::-webkit-contacts-auto-fill-button{visibility:hidden;display:none!important;pointer-events:none;position:absolute;right:0}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input{-moz-appearance:textfield}`))]}reportValidity(){this.__isErrorVisible=!0,super.reportValidity()}renderControl(){var e,t,i;return"summary-item"===this.layout?this.__renderSummaryItemLayout():s(n||(n=m` <vaadin-number-field error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" step="${0}" min="${0}" max="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" clear-button-visible @keydown="${0}" @change="${0}"> ${0} ${0} </vaadin-number-field> `),r(this._errorMessage),this.placeholder,this.helperText,this.label,r(null!==(e=this.step)&&void 0!==e?e:void 0),r(null!==(t=this.min)&&void 0!==t?t:void 0),r(null!==(i=this.max)&&void 0!==i?i:void 0),this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{const t=e.currentTarget;this._value=parseFloat(t.value)}),this.prefix?s(o||(o=m`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?s(d||(d=m`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}__renderSummaryItemLayout(){var e,t,i;return s(u||(u=m` <div class="leading-xs"> <div class="flex items-center gap-xs"> <label class="text-m text-body flex-1 whitespace-nowrap" for="input">${0}</label> ${0} <input placeholder="${0}" style="min-width:10ch" class="${0}" type="number" step="${0}" min="${0}" max="${0}" id="input" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @blur="${0}" @input="${0}"> ${0} </div> <div style="max-width:32rem"> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> </div> `),this.label,this.prefix?s(h||(h=m`<div>${0}</div>`),this.prefix):"",this.placeholder,a({"w-full appearance-none text-right bg-transparent transition-colors":!0,"text-m rounded-s focus-outline-none":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),r(null!==(e=this.step)&&void 0!==e?e:void 0),r(null!==(t=this.min)&&void 0!==t?t:void 0),r(null!==(i=this.max)&&void 0!==i?i:void 0),this._value,this.disabled,this.readonly,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(()=>this.__isErrorVisible=!0),(e=>{e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)||(this._value=t)}),this.suffix?s(p||(p=m`<div class="font-medium text-secondary">${0}</div>`),this.suffix):"",this.helperText,!this.__isErrorVisible||this.disabled||this.readonly,this._errorMessage)}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as t}from"./shared-c782b9fa.js";import{R as e}from"./shared-387d7254.js";import{I as s}from"./shared-
|
|
1
|
+
import{C as t}from"./shared-c782b9fa.js";import{R as e}from"./shared-387d7254.js";import{I as s}from"./shared-ba0d1f31.js";import{h as i}from"./shared-ba5c42c7.js";let r,d,a,l=t=>t;const o=e(t(s));class n extends o{constructor(){super(...arguments),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="relative text-body text-m font-lumo leading-xs sm-h-auto sm-flex 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"./shared-24998349.js";import{a as r}from"./shared-
|
|
1
|
+
import"./shared-24998349.js";import{a as r}from"./shared-92c211bd.js";import"./foxy-form-dialog.js";import"./shared-64210e53.js";import{_ as e}from"./shared-7fec42f2.js";import{i as t}from"./shared-53e42a77.js";import{h as o}from"./shared-ba5c42c7.js";let a,i=r=>r;customElements.define("foxy-internal-bulk-add-action-control",class extends r{constructor(){super(...arguments),this.related=[],this.parent=null,this.form=null}static get properties(){return e(e({},super.properties),{},{related:{type:Array},parent:{},form:{}})}renderControl(){var r,e;return o(a||(a=i` <foxy-form-dialog header="header" parent="${0}" infer="dialog" form="${0}" alert .related="${0}"> </foxy-form-dialog> <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_text"></foxy-i18n> </vaadin-button> `),t(null!==(r=this.parent)&&void 0!==r?r:void 0),t(null!==(e=this.form)&&void 0!==e?e:void 0),this.related,this.disabled,(r=>{const e=this.renderRoot.querySelector("foxy-form-dialog"),t=r.target;e&&(e.href="",e.show(t))}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-24998349.js";import"./shared-64210e53.js";import{a as e}from"./shared-
|
|
1
|
+
import"./shared-24998349.js";import"./shared-64210e53.js";import{a as e}from"./shared-92c211bd.js";import{h as t}from"./shared-ba5c42c7.js";import{l as r,_ as i,B as s}from"./shared-7fec42f2.js";import"./shared-25a9d87d.js";import"./foxy-copy-to-clipboard.js";import"./foxy-spinner.js";import{g as n}from"./shared-bab2ea2c.js";import{C as o}from"./shared-c782b9fa.js";import{T as a}from"./shared-387d7254.js";import{N as d}from"./shared-69074dae.js";import{c as l}from"./shared-4e709717.js";let c,f=e=>e;customElements.define("foxy-internal-timestamps-control",class extends e{renderControl(){return t(c||(c=f` <p class="font-lumo text-s 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:r(this,"nucleon.data.date_created")},{value:r(this,"nucleon.data.date_modified")})}});let h,u=e=>e;customElements.define("foxy-internal-submit-control",class extends e{constructor(){super(...arguments),this.theme="primary"}static get properties(){return i(i({},super.properties),{},{theme:{type:String}})}renderControl(){return t(h||(h=u` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="caption"></foxy-i18n> </vaadin-button> `),this.theme,this.disabled,(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.submit()}))}});let p,y=e=>e;customElements.define("foxy-internal-delete-control",class extends e{constructor(){super(...arguments),this.theme="error"}static get properties(){return i(i({},super.properties),{},{theme:{type:String}})}renderControl(){return t(p||(p=y` <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 m,x=e=>e;customElements.define("foxy-internal-undo-control",class extends e{constructor(){super(...arguments),this.theme="secondary"}static get properties(){return i(i({},super.properties),{},{theme:{type:String}})}renderControl(){return t(m||(m=x` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="caption"></foxy-i18n> </vaadin-button> `),this.theme,this.disabled,(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.undo()}))}});let b,v,g,$,k,S,_,j,E,O,T,C,w,B=e=>e;const K=o(a(d));class H extends K{constructor(){super(...arguments),this.status=null}static get properties(){return i(i({},super.properties),{},{status:{type:Object}})}renderHeaderActions(e){return null}get headerTitleKey(){return"title"}get headerTitleOptions(){return i(i({},this.data),{},{context:this.data?"existing":"new",id:this.data?n(this.data._links.self.href):null})}get headerSubtitleKey(){return"subtitle"}get headerSubtitleOptions(){var e;return null!==(e=this.data)&&void 0!==e?e:{}}get headerSubtitleBadges(){return[]}get headerCopyIdValue(){var e;return this.data&&null!==(e=n(this.data._links.self.href))&&void 0!==e?e:""}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.href&&e.unshift("create"),this.href||e.unshift("delete","timestamps","submit"),this.in({idle:{snapshot:"dirty"}})||e.unshift("undo","submit"),new s(e.join(" ").trim())}renderHeader(){if(this.hiddenSelector.matches("header",!0))return t(b||(b=B``));const e=this.data,r=e?this.renderHeaderActions(e):null;return t(v||(v=B` <div> ${0} <h2> <span class="flex items-center gap-s leading-xs text-xl font-medium break-all"> <foxy-i18n options="${0}" infer="header" key="${0}"> </foxy-i18n> ${0} </span> ${0} </h2> ${0} </div> `),this.renderTemplateOrSlot("header:before"),JSON.stringify(this.headerTitleOptions),this.headerTitleKey,e?t(g||(g=B` ${0} ${0} `),this.hiddenSelector.matches("header:copy-id",!0)?"":t($||($=B` <foxy-copy-to-clipboard infer="header copy-id" class="text-m" text="${0}"> </foxy-copy-to-clipboard> `),this.headerCopyIdValue),this.hiddenSelector.matches("header:copy-json",!0)?"":t(k||(k=B` <foxy-copy-to-clipboard infer="header copy-json" class="text-m" icon="icons:code" text="${0}"> </foxy-copy-to-clipboard> `),JSON.stringify(e,null,2))):"",e?t(S||(S=B` <div class="flex items-center gap-s text-secondary leading-s"> ${0} <foxy-i18n infer="header" key="${0}" .options="${0}"> </foxy-i18n> </div> ${0} `),this.headerSubtitleBadges.map((e=>t(_||(_=B` <foxy-i18n class="border border-contrast-60 font-medium uppercase tracking-wider block rounded-s px-xs text-xs" infer="header badges" key="${0}"> </foxy-i18n> `),e.key))),this.headerSubtitleKey,this.headerSubtitleOptions,r?t(j||(j=B`<div class="mt-xs flex gap-m">${0}</div>`),r):""):"",this.renderTemplateOrSlot("header:after"))}renderBody(){return t(E||(E=B` <foxy-internal-timestamps-control infer="timestamps"></foxy-internal-timestamps-control> <div class="flex gap-m" ?hidden="${0}"> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> <div class="w-full"></div> <foxy-internal-undo-control infer="undo"> </foxy-internal-undo-control> <foxy-internal-submit-control infer="submit"> </foxy-internal-submit-control> <foxy-internal-submit-control infer="create" theme="primary success"> </foxy-internal-submit-control> </div> `),["delete","undo","submit","create"].every((e=>this.hiddenSelector.matches(e,!0))))}render(){const e=!(this.in("idle")||this.in({busy:"fetching"})&&this.data);return t(O||(O=B` <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}" state="${0}" infer="spinner"> </foxy-spinner> ${0} </div> </div> `),this.in("busy"),l({"space-y-m":!0,"transition-all filter":!0,"opacity-30 blur-sm pointer-events-none":e}),this.__generalErrors.map((e=>this.__renderGeneralError(e))),this.status?this.__renderStatus(this.status):"",this.renderBody(),l({"flex flex-col items-center justify-center gap-m":!0,"transition-opacity absolute inset-0":!0,"opacity-0 pointer-events-none":!e}),this.in("fail")?"vertical":"no-label",this.in("fail")?"error":"busy",this.href&&this.in("fail")?t(T||(T=B` <vaadin-button theme="small contrast" @click="${0}"> <foxy-i18n infer="spinner" key="refresh"></foxy-i18n> </vaadin-button> `),(()=>this.refresh())):"")}get __generalErrors(){const e=this.constructor.generalErrorPrefix;return this.errors.filter((t=>t.startsWith(e)))}__renderGeneralError(e){return t(C||(C=B` <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}){if(!this.hiddenSelector.matches("status",!0))return t(w||(w=B` <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))}}H.generalErrorPrefix="error:",customElements.define("foxy-internal-form",H);export{H as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-2d6478b0.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-2d6478b0.js";import{I as e}from"./shared-92c211bd.js";import{x as t}from"./shared-387d7254.js";import{c as a,h as r}from"./shared-ba5c42c7.js";import{_ as o}from"./shared-7fec42f2.js";import{s as i}from"./shared-2061be9a.js";import{p as l}from"./shared-f0fa0a88.js";import{i as s}from"./shared-53e42a77.js";let n;function m(e){return new Array(7).fill(new Date).map(((t,a)=>{for(;t.getDay()!==a;)t.setDate(t.getDate()+1);return t.toLocaleDateString(e,{weekday:"short"})}))}function h(e){return new Array(7).fill(new Date).map(((t,a)=>{for(;t.getDay()!==a;)t.setDate(t.getDate()+1);return t.toLocaleDateString(e,{weekday:"long"})}))}t("vaadin-date-picker-text-field",a(n||(n=(e=>e)`:host([theme~=summary-item])::before{display:none}:host([theme~=summary-item]) .vaadin-text-field-container{display:grid;grid-template-columns:auto 1fr;grid-template-rows:repeat(3,min-content);gap:0 var(--lumo-space-m)}:host([theme~=summary-item]) [part=label]{font:normal var(--lumo-font-size-m) var(--lumo-font-family);color:var(--lumo-body-text-color)!important;grid-row:1;-webkit-text-fill-color:var(--lumo-body-text-color)!important}:host([theme~=summary-item]) [part=helper-text]{font:normal var(--lumo-font-size-s) var(--lumo-font-family);color:var(--lumo-secondary-text-color)!important;grid-row:2}:host([theme~=summary-item]) [part=helper-text]::before{display:none}:host([theme~=summary-item]) [part=error-message]{font:normal var(--lumo-font-size-s) var(--lumo-font-family);color:var(--lumo-error-text-color);grid-row:3}:host([theme~=summary-item]) [part=error-message],:host([theme~=summary-item]) [part=helper-text],:host([theme~=summary-item]) [part=label]{line-height:var(--lumo-line-height-xs);grid-column:1;padding:0}:host([theme~=summary-item]) [part=input-field]{grid-column:2;grid-row:1;padding:0;background:0 0;align-self:start;height:1em;--lumo-icon-size-m:1rem}:host([theme~=summary-item]) [part=input-field]::after,:host([theme~=summary-item][readonly]) [part=input-field] slot[name=suffix]{display:none}:host([theme~=summary-item]) [part=value]{line-height:var(--lumo-line-height-xs);text-align:right;min-height:auto;padding:0;margin-right:var(--lumo-space-xs);-webkit-mask-image:none}:host([theme~=summary-item][readonly]) [part=value]{margin-right:0}:host([theme~=summary-item]) [part=clear-button]{transform:scale(1.5)}:host([has-value]) slot[name=suffix]{display:none}`)));let u,d=e=>e;customElements.define("foxy-internal-date-control",class extends e{constructor(){super(...arguments),this.hideClearButton=!1,this.format=null,this.layout=null,this.min=null}static get properties(){return o(o({},super.properties),{},{hideClearButton:{type:Boolean,attribute:"hide-clear-button",reflect:!0},format:{},layout:{},min:{}})}renderControl(){var e,t,a,o;let n;return n="0000-00-00"!==this._value&&this._value?"unix"===this.format?i(new Date(1e3*(null!==(e=this._value)&&void 0!==e?e:0))):"iso-long"===this.format?i(new Date(this._value)):(null!==(t=this._value)&&void 0!==t?t:"").substring(0,10):"",r(u||(u=d` <vaadin-date-picker error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" theme="${0}" min="${0}" ?clear-button-visible="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" .i18n="${0}" @keydown="${0}" @change="${0}"> </vaadin-date-picker> `),s(this._errorMessage),this.placeholder,this.helperText,this.label,null!==(a=this.layout)&&void 0!==a?a:"standalone",s(null!==(o=this.min)&&void 0!==o?o:void 0),!this.hideClearButton,this.disabled,this.readonly,this._checkValidity,n,this.__pickerI18n,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{var t,a,r,o;const i=e.currentTarget;"unix"===this.format?this._value=Math.floor((null!==(a=null===(t=l(i.value))||void 0===t?void 0:t.getTime())&&void 0!==a?a:0)/1e3):"iso-long"===this.format?this._value=null!==(o=null===(r=l(i.value))||void 0===r?void 0:r.toISOString())&&void 0!==o?o:null:this._value=i.value}))}get __pickerI18n(){return{monthNames:(e=this.lang||"en",new Array(12).fill(new Date).map(((t,a)=>(t.setMonth(a),t.toLocaleDateString(e,{month:"long"}))))),weekdays:h(this.lang||"en"),weekdaysShort:m(this.lang||"en"),firstDayOfWeek:0,week:this.t("week"),calendar:this.t("calendar"),clear:this.t("clear"),today:this.t("today"),cancel:this.t("cancel"),referenceDate:"",parseDate:null,formatTitle:(e,t)=>e+" "+t,formatDate:e=>this.t("display_value",{value:new Date(e.year,e.month,e.day)})};var e}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-1d6ed748.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-1d6ed748.js";import{I as e}from"./shared-92c211bd.js";import"./shared-64210e53.js";import{_ as t}from"./shared-7fec42f2.js";import{h as s,s as i}from"./shared-ba5c42c7.js";import{c as l}from"./shared-4e709717.js";let r,a,o,h,n,c,d=e=>e;customElements.define("foxy-internal-switch-control",class extends e{constructor(){super(...arguments),this.helperTextAsToolip=!1,this.falseAlias=null,this.trueAlias=null,this.invert=!1}static get properties(){return t(t({},super.properties),{},{helperTextAsToolip:{type:Boolean,attribute:"helper-text-as-tooltip"},falseAlias:{attribute:"false-alias"},trueAlias:{attribute:"true-alias"},invert:{type:Boolean}})}renderControl(){const e=this.invert?!this._value:!!this._value;return s(r||(r=d` <div class="flex items-start gap-s leading-xs text-m"> <div class="flex-1"> <label class="text-m text-body" for="input">${0}</label> ${0} <p class="text-xs text-error" style="max-width:32rem" ?hidden="${0}"> ${0} </p> </div> ${0} ${0} </div> `),this.label,this.helperTextAsToolip?"":s(a||(a=d`<p class="text-xs text-secondary" style="max-width:32rem"> ${0} </p>`),this.helperText),this.disabled||this.readonly,this._errorMessage,this.readonly?s(o||(o=d`<p class="text-secondary">${0}</p>`),e?this.t("checked"):this.t("unchecked")):s(h||(h=d` <div style="height:calc(1em * var(--lumo-line-height-xs))" class="flex items-center"> <div style="border-radius:var(--lumo-size-xl);width:calc((1em * var(--lumo-line-height-xs)) - 3px + var(--lumo-space-m))" class="${0}" @click="${0}"> <div style="margin:1.5px;width:calc((1em * var(--lumo-line-height-xs)) - 6px);height:calc((1em * var(--lumo-line-height-xs)) - 6px)" class="${0}"></div> <input class="opacity-0 absolute inset-0 focus-outline-none" type="checkbox" id="input" switch ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </div> </div> `),l({"cursor-pointer group transition-colors relative":!0,"flex flex-shrink-0 items-center":!0,"bg-success":!this.disabled&&e,"bg-contrast-20 hover-bg-contrast-30":!this.disabled&&!e,"bg-contrast-10":this.disabled,"focus-within-ring-2 focus-within-ring-primary-50":!0}),(()=>this._value=!this._value),l({"transition-all transform block rounded-full":!0,"translate-x-m":e,"translate-x-0":!e,"bg-base":this.disabled,"bg-tint":!this.disabled}),this.disabled,this.readonly,e,(e=>{const t=e.currentTarget;this._value=this.invert?!t.checked:t.checked})),this.helperTextAsToolip&&this.helperText?s(n||(n=d` <div class="transition-colors text-tertiary flex-shrink-0 cursor-pointer hover-text-body" id="trigger"> ${0} </div> <vcf-tooltip for="trigger" style="--lumo-base-color:black;max-width:30rem" class="mt-s" theme="light" position="bottom"> <span class="text-s" style="color:#fff">${0}</span> </vcf-tooltip> `),i(c||(c=d`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: calc(1em * var(--lumo-line-height-xs)); height: calc(1em * var(--lumo-line-height-xs)); margin-right: -0.12em"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`)),this.helperText):"")}get _value(){const e=super._value;return!(!this.trueAlias||e!==this.trueAlias)||(!this.falseAlias||e!==this.falseAlias)&&!!e}set _value(e){this.trueAlias&&!0===e?super._value=this.trueAlias:this.falseAlias&&!1===e?super._value=this.falseAlias:super._value=e}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-a1cfe9d5.js";import"./shared-c1b71162.js";import"./shared-
|
|
1
|
+
import"./shared-a1cfe9d5.js";import"./shared-c1b71162.js";import"./shared-b148b310.js";import"./shared-64210e53.js";import{_ as e}from"./shared-7fec42f2.js";import{R as l,T as a,a as n}from"./shared-387d7254.js";import{C as t}from"./shared-c782b9fa.js";import{s as r,h as o,c as s,L as i}from"./shared-ba5c42c7.js";import{I as u}from"./shared-0ea750af.js";import{O as d,T as v}from"./shared-8874ec69.js";import{o as c}from"./shared-63c32024.js";import{c as p}from"./shared-4e709717.js";import{r as h}from"./shared-5fd5805c.js";import{i as f}from"./shared-53e42a77.js";import{s as b}from"./shared-2061be9a.js";import{p as g}from"./shared-f0fa0a88.js";let m;const y=r(m||(m=(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>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e,f as t,t as r,g as s,h as i,j as n,k as o,l as a,_ as u,m as l,n as h,o as c,R as d,F as f}from"./shared-7fec42f2.js";import{h as _,L as v}from"./shared-ba5c42c7.js";import{A as m}from"./shared-65b2760f.js";import{U as p,a as g}from"./shared-cd96ff03.js";import{I as y}from"./shared-0ea750af.js";import{i as R,c as E,a as S}from"./shared-37869bac.js";import{d as b}from"./shared-d6a0954b.js";import{s as w}from"./shared-1da47f50.js";import{i as P}from"./shared-e1e4d8f5.js";var k=Date.now;var T,x,U,L=b?function(e,t){return b(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:R,A=(T=L,x=0,U=0,function(){var e=k(),t=16-(e-U);if(U=e,t>0){if(++x>=800)return arguments[0]}else x=0;return T.apply(void 0,arguments)});function j(e){return e!=e}function F(e,t,r){return t==t?function(e,t,r){for(var s=r-1,i=e.length;++s<i;)if(e[s]===t)return s;return-1}(e,t,r):function(e,t,r,s){for(var i=e.length,n=r+(s?1:-1);s?n--:++n<i;)if(t(e[n],n,e))return n;return-1}(e,j,r)}var H=Math.max;function N(e,t){return A(function(e,t,r){return t=H(void 0===t?e.length-1:t,0),function(){for(var s=arguments,i=-1,n=H(s.length-t,0),o=Array(n);++i<n;)o[i]=s[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=s[i];return a[t]=r(o),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,a)}}(e,t,R),e+"")}function C(t,r){return r.length<2?t:e(t,function(e,t,r){var s=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var n=Array(i);++s<i;)n[s]=e[s+t];return n}(r,0,-1))}function D(e,t,r,s){for(var i=r-1,n=e.length;++i<n;)if(s(e[i],t))return i;return-1}var I=Array.prototype.splice;var Q=N((function(e,t){return e&&e.length&&t&&t.length?function(e,t,r,n){var o=n?D:F,a=-1,u=t.length,l=e;for(e===t&&(t=E(t)),r&&(l=s(e,i(r)));++a<u;)for(var h=0,c=t[a],d=r?r(c):c;(h=o(l,d,h,n))>-1;)l!==e&&I.call(l,h,1),I.call(e,h,1);return e}(e,t):e})),O=0;function W(e){var t=++O;return n(e)+t}function $(e,s){return null==e||function(e,s){return null==(e=C(e,s=t(s,e)))||delete e[r((i=s,n=null==i?0:i.length,n?i[n-1]:void 0))];var i,n}(e,s)}function G(e,t){let r=null;return o(t).forEach((function(){var t,s,i,n,o,a,u,l,h,c,d;if(null===(i=null===(s=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===s?void 0:s.self)||void 0===i?void 0:i.href){const t=null===(a=null===(o=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===o?void 0:o.self)||void 0===a?void 0:a.href,s=new URL(null===(h=null===(l=null===(u=this.node)||void 0===u?void 0:u._links)||void 0===l?void 0:l.self)||void 0===h?void 0:h.href);if(s.searchParams.delete("zoom"),e===t||e===s.toString())return r=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(d=null===(c=this.node)||void 0===c?void 0:c._links)&&void 0!==d?d:{}).some((([t,s])=>{var i,n;if(s.href!==e)return!1;const o=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!o||!Array.isArray(o))return!1;const a=o.length<20?o.length:21,u=new URL(e),l=new URL(e);return u.searchParams.set("offset",o.length.toString()),l.searchParams.set("offset",a.toString()),r=JSON.stringify({returned_items:o.length,total_items:a,offset:0,limit:20,_embedded:{[t]:o},_links:{curies:this.node._links.curies,first:{href:e},last:{href:l.toString()},prev:{href:e},next:{href:u.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(r,{status:r?200:404})}async function M(e,t){var r,s;if(t.in("busy"))return Promise.resolve(new Response(null,{status:500}));const i=new URL(e.url);i.search="",i.hash="";const n=i.toString().replace(`foxy://${t.virtualHost}/form/`,"").split("/").map(decodeURIComponent),o=a(t.form,n);let l,h=405;if("GET"===e.method)if(Array.isArray(o)){const i=parseInt(null!==(r=new URL(e.url).searchParams.get("offset"))&&void 0!==r?r:""),a=parseInt(null!==(s=new URL(e.url).searchParams.get("limit"))&&void 0!==s?s:""),c=isNaN(i)||i<0?0:i,d=isNaN(a)||a<0?20:a,f=o.slice(c,c+d).map(((e,r)=>{const s=["form",...n,String(r)],i=`foxy://${t.virtualHost}/${s.map(encodeURIComponent).join("/")}`;return u({_links:{self:{href:i}}},e)})),_=new URL(e.url);_.searchParams.set("offset","0"),_.searchParams.set("limit",String(d));const v=new URL(e.url);v.searchParams.set("offset",String(Math.max(0,c-d))),v.searchParams.set("limit",String(d));const m=new URL(e.url);m.searchParams.set("offset",String(Math.min(o.length,c+d))),m.searchParams.set("limit",String(d));const p=new URL(e.url);p.searchParams.set("offset",String(Math.max(0,o.length-d))),p.searchParams.set("limit",String(d)),h=200,l={returned_items:f.length,total_items:o.length,offset:c,limit:d,_embedded:{"fx:slice":f},_links:{first:{href:_.toString()},last:{href:p.toString()},prev:{href:v.toString()},next:{href:m.toString()},self:{href:e.url}}}}else h=200,l=u({_links:{self:{href:e.url}}},o);if("POST"===e.method){const r=await e.json(),s=S(t.form),i=a(s,n).push(r)-1;t.edit(s);const o=["form",...n,String(i)].map(encodeURIComponent).join("/");h=200,l={_links:{self:{href:`foxy://${t.virtualHost}/${o}`}},message:"Resource created successfully."}}if("PATCH"===e.method){const r=S(t.form),s=u(u({},a(r,n)),await e.json());t.edit(w(r,n,s)),h=200,l=u({_links:{self:{href:e.url}}},s)}if("DELETE"===e.method){const r=S(t.form),s=a(r,n.slice(0,-1));Array.isArray(s)?Q(s,a(r,n)):$(r,n),t.edit(r),h=200,l={_links:{self:{href:e.url}},message:"Resource deleted successfully."}}return Promise.resolve(new Response(JSON.stringify(l),{status:h}))}let q,J=e=>e;class V extends(y(v)){constructor(){super(),this.lang="",this.parent="",this.related=[],this.virtualHost=W("nucleon-"),this.__hrefToLoad=null,this.__group="",this.__unsubscribeFromRumour=null,this.__fetchEventQueue=[],this.__service=P(h.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:c({errors:e=>{const t=this.constructor.v8n,r=u(u({},e.data),e.edits);return t.map((e=>e(r,this))).filter((e=>"string"==typeof e)).filter(((e,t,r)=>r.indexOf(e)===t))}})}})),this.__createService()}static get inferredProperties(){return[...super.inferredProperties,"group","lang"]}static get properties(){return{__state:{type:String,reflect:!0,attribute:"state"},virtualHost:{attribute:"virtual-host"},related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.failure)&&void 0!==t?t:null}get errors(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.errors)&&void 0!==t?t:[]}get form(){var e,t;const{data:r,edits:s}=null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context)&&void 0!==t?t:{};return u(u({},r),s)}get data(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.data)&&void 0!==t?t:null}set data(e){this.__destroyRumour(),this.__hrefToLoad=null,this.__service.send({type:"SET_DATA",data:e}),e&&this.__createRumour()}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){var e,t,r;return null!==(r=null!==(t=null===(e=this.form._links)||void 0===e?void 0:e.self.href)&&void 0!==t?t:this.__hrefToLoad)&&void 0!==r?r:""}set href(e){this.__hrefToLoad=e,e?this.__service.send({type:"FETCH"}):this.data=null}in(e){var t;return!!(null===(t=this.__service.state)||void 0===t?void 0:t.matches(e))}undo(){this.__service.send({type:"UNDO"})}edit(e){var t;"string"==typeof(null===(t=e._links)||void 0===t?void 0:t.self.href)&&(this.__hrefToLoad=null),this.__service.send({type:"EDIT",data:e})}submit(){this.reportValidity(),this.__service.send({type:"SUBMIT"})}checkValidity(){const e=this.in({idle:{template:{dirty:"valid"}}}),t=this.in({idle:{snapshot:{dirty:"valid"}}}),r=this.in({idle:{template:{clean:"valid"}}}),s=this.in({idle:{snapshot:{clean:"valid"}}});return r||e||(s||t)}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());return this.checkValidity()}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}render(){return _(q||(q=J`<slot></slot>`))}connectedCallback(){super.connectedCallback(),this.href&&!this.data&&this.__service.send({type:"FETCH"}),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue(),this.dispatchEvent(new p)}disconnectedCallback(){super.disconnectedCallback(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected"),this.dispatchEvent(new p)}applyInferredProperties(e){var t,r;super.applyInferredProperties(e),null!==this.infer&&(this.group=null!==(t=e.get("group"))&&void 0!==t?t:"",this.lang=null!==(r=e.get("lang"))&&void 0!==r?r:"")}async _fetch(...e){const t=await new m(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){let t;this.__destroyRumour();try{const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});t=await this._fetch(s._links.self.href);const i=V.Rumour(this.group),n=[...this.related,this.parent];i.share({data:t,related:n,source:t._links.self.href})}finally{this.__createRumour()}return t}async _sendGet(){let e;this.__destroyRumour();try{e=await this._fetch(this.href),V.Rumour(this.group).share({data:e,source:this.href})}finally{this.__createRumour()}return e}async _sendPatch(e){let t;this.__destroyRumour();try{const r=JSON.stringify(e);t=await this._fetch(this.href,{body:r,method:"PATCH"});V.Rumour(this.group).share({data:t,source:this.href,related:this.related})}finally{this.__createRumour()}return t}async _sendDelete(){this.__destroyRumour();try{await this._fetch(this.href,{method:"DELETE"});const e=V.Rumour(this.group),t=[...this.related,this.parent];e.share({data:null,source:this.href,related:t})}finally{this.__createRumour()}return null}get __state(){const e=this.__service.state,t=null==e?void 0:e.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);return[...new Set(null!=t?t:[])].join(" ")}__createService(){this.__service.onTransition((e=>{var t,r,s,i;if(!e.changed)return;let n;e.matches("idle")&&0===e.context.errors.length&&((null===(t=e.history)||void 0===t?void 0:t.matches({busy:"deleting"}))?n=g.ResourceDeleted:(null===(r=e.history)||void 0===r?void 0:r.matches({busy:"creating"}))?n=g.ResourceCreated:(null===(s=e.history)||void 0===s?void 0:s.matches({busy:"updating"}))?n=g.ResourceUpdated:(null===(i=e.history)||void 0===i?void 0:i.matches({busy:"fetching"}))&&(n=g.ResourceFetched)),this.requestUpdate(),this.dispatchEvent(new p("update",{detail:{result:n}})),e.matches("busy")||this.__processFetchEventQueue()})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new p)})),this.__service.start()}__createRumour(){const e=V.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this),this.__unsubscribeFromRumour=null}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const r=null===(t=this.__service.state)||void 0===t?void 0:t.context.data,s=r?e(r):r;if(s!==r&&(this.data=s,!s)){const e=g.ResourceDeleted,t=new p("update",{detail:{result:e}});this.dispatchEvent(t)}}catch(e){if(!(e instanceof d.UpdateError))throw e;setTimeout((()=>this.refresh()))}}__processFetchEventQueue(){const e=new V.API(this);this.__fetchEventQueue.forEach((t=>{const r=t.request;if(this.virtualHost&&r.url.startsWith(`foxy://${this.virtualHost}/form/`))return t.respondWith(M(r,this));const s=G(r.url,this.data),i=s.ok?s:e.fetch(r);t.respondWith(Promise.resolve(i)),s.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${r.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){var t;if(!(e instanceof f))return;if(e.defaultPrevented)return;if(e.composedPath()[0]===this)return;const{url:r,method:s}=e.request;if(r.startsWith("foxy://")){if(!this.virtualHost||!r.startsWith(`foxy://${this.virtualHost}/form/`))return;if("GET"!==s)return e.respondWith(M(e.request,this))}"GET"===s&&(e.preventDefault(),this.__fetchEventQueue.push(e),(null===(t=this.__service.state)||void 0===t?void 0:t.matches("busy"))||this.__processFetchEventQueue())}}V.UpdateEvent=p,V.Rumour=l((()=>new d)),V.API=m;export{V as N,N as b,G as s,W as u};
|
|
1
|
+
import{e,f as t,t as r,g as s,h as i,j as n,k as o,l as a,_ as l,m as u,n as h,o as c,R as d,F as f}from"./shared-7fec42f2.js";import{h as _,L as v}from"./shared-ba5c42c7.js";import{A as m}from"./shared-65b2760f.js";import{U as p,a as g}from"./shared-cd96ff03.js";import{I as y}from"./shared-0ea750af.js";import{i as R,c as E,a as S}from"./shared-37869bac.js";import{d as b}from"./shared-d6a0954b.js";import{s as w}from"./shared-1da47f50.js";import{i as P}from"./shared-e1e4d8f5.js";var k=Date.now;var T,x,U,L=b?function(e,t){return b(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:R,A=(T=L,x=0,U=0,function(){var e=k(),t=16-(e-U);if(U=e,t>0){if(++x>=800)return arguments[0]}else x=0;return T.apply(void 0,arguments)});function F(e){return e!=e}function H(e,t,r){return t==t?function(e,t,r){for(var s=r-1,i=e.length;++s<i;)if(e[s]===t)return s;return-1}(e,t,r):function(e,t,r,s){for(var i=e.length,n=r+(s?1:-1);s?n--:++n<i;)if(t(e[n],n,e))return n;return-1}(e,F,r)}var j=Math.max;function N(e,t){return A(function(e,t,r){return t=j(void 0===t?e.length-1:t,0),function(){for(var s=arguments,i=-1,n=j(s.length-t,0),o=Array(n);++i<n;)o[i]=s[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=s[i];return a[t]=r(o),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,a)}}(e,t,R),e+"")}function C(t,r){return r.length<2?t:e(t,function(e,t,r){var s=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var n=Array(i);++s<i;)n[s]=e[s+t];return n}(r,0,-1))}function D(e,t,r,s){for(var i=r-1,n=e.length;++i<n;)if(s(e[i],t))return i;return-1}var I=Array.prototype.splice;var Q=N((function(e,t){return e&&e.length&&t&&t.length?function(e,t,r,n){var o=n?D:H,a=-1,l=t.length,u=e;for(e===t&&(t=E(t)),r&&(u=s(e,i(r)));++a<l;)for(var h=0,c=t[a],d=r?r(c):c;(h=o(u,d,h,n))>-1;)u!==e&&I.call(u,h,1),I.call(e,h,1);return e}(e,t):e})),O=0;function W(e){var t=++O;return n(e)+t}function $(e,s){return null==e||function(e,s){return null==(e=C(e,s=t(s,e)))||delete e[r((i=s,n=null==i?0:i.length,n?i[n-1]:void 0))];var i,n}(e,s)}function G(e,t){let r=null;return o(t).forEach((function(){var t,s,i,n,o,a,l,u,h,c,d;if(null===(i=null===(s=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===s?void 0:s.self)||void 0===i?void 0:i.href){const t=null===(a=null===(o=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===o?void 0:o.self)||void 0===a?void 0:a.href,s=new URL(null===(h=null===(u=null===(l=this.node)||void 0===l?void 0:l._links)||void 0===u?void 0:u.self)||void 0===h?void 0:h.href);if(s.searchParams.delete("zoom"),e===t||e===s.toString())return r=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(d=null===(c=this.node)||void 0===c?void 0:c._links)&&void 0!==d?d:{}).some((([t,s])=>{var i,n;if(s.href!==e)return!1;const o=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!o||!Array.isArray(o))return!1;const a=o.length<20?o.length:21,l=new URL(e),u=new URL(e);return l.searchParams.set("offset",o.length.toString()),u.searchParams.set("offset",a.toString()),r=JSON.stringify({returned_items:o.length,total_items:a,offset:0,limit:20,_embedded:{[t]:o},_links:{curies:this.node._links.curies,first:{href:e},last:{href:u.toString()},prev:{href:e},next:{href:l.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(r,{status:r?200:404})}async function q(e,t){var r,s;if(t.in("busy"))return Promise.resolve(new Response(null,{status:500}));const i=new URL(e.url);i.search="",i.hash="";const n=i.toString().replace(`foxy://${t.virtualHost}/form/`,"").split("/").map(decodeURIComponent),o=a(t.form,n);let u,h=405;if("GET"===e.method)if(Array.isArray(o)){const i=parseInt(null!==(r=new URL(e.url).searchParams.get("offset"))&&void 0!==r?r:""),a=parseInt(null!==(s=new URL(e.url).searchParams.get("limit"))&&void 0!==s?s:""),c=isNaN(i)||i<0?0:i,d=isNaN(a)||a<0?20:a,f=o.slice(c,c+d).map(((e,r)=>{const s=["form",...n,String(r)],i=`foxy://${t.virtualHost}/${s.map(encodeURIComponent).join("/")}`;return l({_links:{self:{href:i}}},e)})),_=new URL(e.url);_.searchParams.set("offset","0"),_.searchParams.set("limit",String(d));const v=new URL(e.url);v.searchParams.set("offset",String(Math.max(0,c-d))),v.searchParams.set("limit",String(d));const m=new URL(e.url);m.searchParams.set("offset",String(Math.min(o.length,c+d))),m.searchParams.set("limit",String(d));const p=new URL(e.url);p.searchParams.set("offset",String(Math.max(0,o.length-d))),p.searchParams.set("limit",String(d)),h=200,u={returned_items:f.length,total_items:o.length,offset:c,limit:d,_embedded:{"fx:slice":f},_links:{first:{href:_.toString()},last:{href:p.toString()},prev:{href:v.toString()},next:{href:m.toString()},self:{href:e.url}}}}else h=200,u=l({_links:{self:{href:e.url}}},o);if("POST"===e.method){const r=await e.json(),s=S(t.form),i=a(s,n).push(r)-1;t.edit(s);const o=["form",...n,String(i)].map(encodeURIComponent).join("/");h=200,u={_links:{self:{href:`foxy://${t.virtualHost}/${o}`}},message:"Resource created successfully."}}if("PATCH"===e.method){const r=S(t.form),s=l(l({},a(r,n)),await e.json());t.edit(w(r,n,s)),h=200,u=l({_links:{self:{href:e.url}}},s)}if("DELETE"===e.method){const r=S(t.form),s=a(r,n.slice(0,-1));Array.isArray(s)?Q(s,a(r,n)):$(r,n),t.edit(r),h=200,u={_links:{self:{href:e.url}},message:"Resource deleted successfully."}}return Promise.resolve(new Response(JSON.stringify(u),{status:h}))}let M,J=e=>e;class V extends(y(v)){constructor(){super(),this.lang="",this.parent="",this.related=[],this.virtualHost=W("nucleon-"),this.__hrefToLoad=null,this.__group="",this.__unsubscribeFromRumour=null,this.__fetchEventQueue=[],this.__service=P(h.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:c({errors:e=>{const t=this.constructor.v8n,r=l(l({},e.data),e.edits);return t.map((e=>e(r,this))).filter((e=>"string"==typeof e)).filter(((e,t,r)=>r.indexOf(e)===t))}})}})),this.__createService()}static get inferredProperties(){return[...super.inferredProperties,"group","lang"]}static get properties(){return{__state:{type:String,reflect:!0,attribute:"state"},virtualHost:{attribute:"virtual-host"},related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.failure)&&void 0!==t?t:null}get errors(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.errors)&&void 0!==t?t:[]}get form(){var e,t;const{data:r,edits:s}=null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context)&&void 0!==t?t:{};return l(l({},r),s)}get data(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.data)&&void 0!==t?t:null}set data(e){this.__destroyRumour(),this.__hrefToLoad=null,this.__service.send({type:"SET_DATA",data:e}),e&&this.__createRumour()}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){var e,t,r;return null!==(r=null!==(t=null===(e=this.form._links)||void 0===e?void 0:e.self.href)&&void 0!==t?t:this.__hrefToLoad)&&void 0!==r?r:""}set href(e){this.__hrefToLoad=e,e?this.__service.send({type:"FETCH"}):this.data=null}in(e){var t;return!!(null===(t=this.__service.state)||void 0===t?void 0:t.matches(e))}undo(){this.__service.send({type:"UNDO"})}edit(e){var t;"string"==typeof(null===(t=e._links)||void 0===t?void 0:t.self.href)&&(this.__hrefToLoad=null),this.__service.send({type:"EDIT",data:e})}submit(){this.reportValidity(),this.__service.send({type:"SUBMIT"})}checkValidity(){const e=this.in({idle:{template:{dirty:"valid"}}}),t=this.in({idle:{snapshot:{dirty:"valid"}}}),r=this.in({idle:{template:{clean:"valid"}}}),s=this.in({idle:{snapshot:{clean:"valid"}}});return r||e||(s||t)}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());return this.checkValidity()}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}render(){return _(M||(M=J`<slot></slot>`))}connectedCallback(){super.connectedCallback(),this.href&&!this.data&&this.__service.send({type:"FETCH"}),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue(),this.dispatchEvent(new p)}disconnectedCallback(){super.disconnectedCallback(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected"),this.dispatchEvent(new p)}applyInferredProperties(e){var t,r;super.applyInferredProperties(e),null!==this.infer&&(this.group=null!==(t=e.get("group"))&&void 0!==t?t:"",this.lang=null!==(r=e.get("lang"))&&void 0!==r?r:"")}async _fetch(...e){const t=await new m(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){let t;this.__destroyRumour();try{const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});t=await this._fetch(s._links.self.href);const i=V.Rumour(this.group),n=[...this.related,this.parent];i.share({data:t,related:n,source:t._links.self.href})}finally{this.__createRumour()}return t}async _sendGet(){let e;this.__destroyRumour();try{const t="REFRESH"===this.__service.state.event.type?{"cache-control":"no-cache"}:void 0;e=await this._fetch(this.href,{headers:t}),V.Rumour(this.group).share({data:e,source:this.href})}finally{this.__createRumour()}return e}async _sendPatch(e){let t;this.__destroyRumour();try{const r=JSON.stringify(e);t=await this._fetch(this.href,{body:r,method:"PATCH"});V.Rumour(this.group).share({data:t,source:this.href,related:this.related})}finally{this.__createRumour()}return t}async _sendDelete(){this.__destroyRumour();try{await this._fetch(this.href,{method:"DELETE"});const e=V.Rumour(this.group),t=[...this.related,this.parent];e.share({data:null,source:this.href,related:t})}finally{this.__createRumour()}return null}get __state(){const e=this.__service.state,t=null==e?void 0:e.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);return[...new Set(null!=t?t:[])].join(" ")}__createService(){this.__service.onTransition((e=>{var t,r,s,i;if(!e.changed)return;let n;e.matches("idle")&&0===e.context.errors.length&&((null===(t=e.history)||void 0===t?void 0:t.matches({busy:"deleting"}))?n=g.ResourceDeleted:(null===(r=e.history)||void 0===r?void 0:r.matches({busy:"creating"}))?n=g.ResourceCreated:(null===(s=e.history)||void 0===s?void 0:s.matches({busy:"updating"}))?n=g.ResourceUpdated:(null===(i=e.history)||void 0===i?void 0:i.matches({busy:"fetching"}))&&(n=g.ResourceFetched)),this.requestUpdate(),this.dispatchEvent(new p("update",{detail:{result:n}})),e.matches("busy")||this.__processFetchEventQueue()})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new p)})),this.__service.start()}__createRumour(){const e=V.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this),this.__unsubscribeFromRumour=null}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const r=null===(t=this.__service.state)||void 0===t?void 0:t.context.data,s=r?e(r):r;if(s!==r&&(this.data=s,!s)){const e=g.ResourceDeleted,t=new p("update",{detail:{result:e}});this.dispatchEvent(t)}}catch(e){if(!(e instanceof d.UpdateError))throw e;setTimeout((()=>this.refresh()))}}__processFetchEventQueue(){const e=new V.API(this);this.__fetchEventQueue.forEach((t=>{const r=t.request;if(this.virtualHost&&r.url.startsWith(`foxy://${this.virtualHost}/form/`))return t.respondWith(q(r,this));let s=null;if("no-cache"!==t.request.headers.get("cache-control")){const e=G(r.url,this.data);e.ok&&(s=Promise.resolve(e),console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${r.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;",""))}t.respondWith(Promise.resolve(null!=s?s:e.fetch(r)))})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){var t;if(!(e instanceof f))return;if(e.defaultPrevented)return;if(e.composedPath()[0]===this)return;const{url:r,method:s}=e.request;if(r.startsWith("foxy://")){if(!this.virtualHost||!r.startsWith(`foxy://${this.virtualHost}/form/`))return;if("GET"!==s)return e.respondWith(q(e.request,this))}"GET"===s&&(e.preventDefault(),this.__fetchEventQueue.push(e),(null===(t=this.__service.state)||void 0===t?void 0:t.matches("busy"))||this.__processFetchEventQueue())}}V.UpdateEvent=p,V.Rumour=u((()=>new d)),V.API=m;export{V as N,N as b,G as s,W as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as e}from"./shared-
|
|
1
|
+
import{I as e}from"./shared-92c211bd.js";import{_ as r}from"./shared-7fec42f2.js";import{c as t,h as s}from"./shared-ba5c42c7.js";import{r as a}from"./shared-5fd5805c.js";let o,i,d,l,n,c=e=>e;customElements.define("foxy-internal-source-control",class extends e{constructor(){super(...arguments),this.__isErrorVisible=!1,this.__hovered=!1,this.__focused=!1}static get properties(){return r(r({},super.properties),{},{__isErrorVisible:{attribute:!1},__hovered:{attribute:!1},__focused:{attribute:!1}})}static get styles(){return[...super.styles,t(o||(o=c`.monospace{font-family:monospace}.resize-none{resize:none}.max-h-16em{max-height:16em}textarea::selection{background:var(--lumo-contrast-10pct)}`))]}renderControl(){var e;let r,t,o;return this.disabled?(r="bg-contrast-5 text-disabled",o="text-disabled",this.readonly?(r+=" border-dashed border-contrast-20",t="border-dashed border-contrast-30"):(r+=" border-transparent",t="border-contrast-10")):this.readonly?(r="border-dashed border-contrast-30 bg-transparent text-secondary",t="border-dashed border-contrast-30",o="text-secondary",this.__focused&&(t+=" ring-2 ring-primary-50")):this.__focused?(r="border-transparent bg-contrast-10 text-tertiary",t="border-primary-50 ring-1 ring-primary-50",o="text-body"):this.__hovered?(r="border-transparent bg-contrast-20 text-tertiary",t="border-contrast-20",o="text-body"):(r="border-transparent bg-contrast-10 text-tertiary",t="border-contrast-10",o="text-body"),s(i||(i=c` <label class="block h-full" @mouseenter="${0}" @mouseleave="${0}"> <div class="mb-s leading-s" ?hidden="${0}"> <div class="transition-colors text-l font-medium" part="label">${0}</div> <div class="transition-colors text-s text-secondary" part="helper-text"> ${0} </div> </div> <div class="max-h-16em h-full transition-colors flex-1 flex bg-base rounded overflow-auto border ${0}" part="editor"> <div class="h-full transition-colors monospace leading-s text-s text-right border-r ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <textarea placeholder="${0}" class="bg-base whitespace-pre leading-s text-s focus-outline-none monospace resize-none block w-full select-text transition-colors ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" rows="1" .value="${0}" ?disabled="${0}" ?readonly="${0}" @focus="${0}" @blur="${0}" @input="${0}">
|
|
2
2
|
</textarea> </div> <div class="mt-s text-s leading-xs text-error" ?hidden="${0}"> ${0} </div> </label> `),(()=>this.__hovered=!0),(()=>this.__hovered=!1),!this.label&&!this.helperText,this.label,this.helperText,t,r,a(null!==(e=this._value.split("\n"))&&void 0!==e?e:[],((e,r)=>String(r)),((e,r)=>s(d||(d=c`<div>${0}${0}<span>${0}<span></span></span></div>`),r<9?s(l||(l=c`<span class="opacity-0">0</span>`)):"",r<99?s(n||(n=c`<span class="opacity-0">0</span>`)):"",r+1))),this.placeholder,o,this._value,this.disabled,this.readonly,(()=>this.__focused=!0),(()=>{this.__focused=!1,this.__isErrorVisible=!0}),(e=>{const r=e.currentTarget;this._value=r.value}),!this.__isErrorVisible||!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}updated(e){super.updated(e),this.renderRoot.querySelectorAll("textarea").forEach((e=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`,e.style.overflowY="hidden"}))}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-dda75cab.js";import"./shared-ac44a3a5.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-dda75cab.js";import"./shared-ac44a3a5.js";import{I as e}from"./shared-92c211bd.js";import{i as a}from"./shared-53e42a77.js";import{h as r}from"./shared-ba5c42c7.js";let t,s=e=>e;customElements.define("foxy-internal-text-area-control",class extends e{renderControl(){return r(t||(t=s` <vaadin-text-area 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}"> </vaadin-text-area> `),a(this._errorMessage),this.helperText,this.placeholder,this.label,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var a;return"Enter"===e.key&&(null===(a=this.nucleon)||void 0===a?void 0:a.submit())}),(e=>{const a=e.currentTarget;this._value=a.value}))}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as t}from"./shared-7fec42f2.js";import{T as s}from"./shared-
|
|
1
|
+
import{_ as t}from"./shared-7fec42f2.js";import{T as s}from"./shared-f58068b0.js";import{a as e}from"./shared-387d7254.js";import{p as n}from"./shared-47269bb6.js";import{g as a}from"./shared-ada5e9f5.js";import{c as o}from"./shared-4e709717.js";let r,l,m,i,u=t=>t;class c extends(e(s,"subscriptions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.subTokenURLColumn]}}c.priceColumn={cell:s=>{const e=s.data._embedded["fx:transaction_template"],a=`${e.total_order} ${e.currency_code}`;return s.html(r||(r=u`
|
|
2
2
|
<foxy-i18n
|
|
3
3
|
data-testclass="i18n frequencies"
|
|
4
4
|
class="font-medium text-m font-tnum"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-ac44a3a5.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-ac44a3a5.js";import{I as e}from"./shared-92c211bd.js";import{_ as t}from"./shared-7fec42f2.js";import{c as s,h as i,s as r}from"./shared-ba5c42c7.js";import{i as a}from"./shared-53e42a77.js";import{c as l}from"./shared-4e709717.js";import{l as o}from"./shared-d0aed1c1.js";let d,n,u,h,p,c,f,m,v=e=>e;customElements.define("foxy-internal-text-control",class extends e{constructor(){super(...arguments),this.layout=null,this.prefix=null,this.suffix=null,this.__isErrorVisible=!1}static get properties(){return t(t({},super.properties),{},{layout:{},prefix:{},suffix:{},__isErrorVisible:{attribute:!1}})}static get styles(){return[super.styles,s(d||(d=v`input::-webkit-contacts-auto-fill-button{visibility:hidden;display:none!important;pointer-events:none;position:absolute;right:0}`))]}reportValidity(){this.__isErrorVisible=!0,super.reportValidity()}renderControl(){return"summary-item"===this.layout?this.__renderSummaryItemLayout():i(n||(n=v` <vaadin-text-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?clear-button-visible="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} ${0} </vaadin-text-field> `),a(this._errorMessage),this.helperText,this.placeholder,this.label,!this.suffix,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{const t=e.currentTarget;this._value=t.value}),this.prefix?i(u||(u=v`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?i(h||(h=v`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}__renderSummaryItemLayout(){return i(p||(p=v` <div class="leading-xs"> <div class="flex items-center gap-xs"> <label class="text-m text-body flex-1 whitespace-nowrap" for="input">${0}</label> ${0} <input placeholder="${0}" class="${0}" type="text" id="input" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @blur="${0}" @input="${0}"> ${0} <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> <div style="max-width:32rem"> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> </div> `),this.label,this.prefix?i(c||(c=v`<div>${0}</div>`),this.prefix):"",this.placeholder,l({"w-full appearance-none text-right bg-transparent transition-colors":!0,"text-m rounded-s focus-outline-none":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),o(this._value),this.disabled,this.readonly,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(()=>this.__isErrorVisible=!0),(e=>{e.stopPropagation(),this._value=e.target.value}),this.suffix?i(f||(f=v`<div class="font-medium text-secondary">${0}</div>`),this.suffix):"",this.t("clear"),l({"flex-shrink-0 rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!this._value,(()=>{this._value="",this.dispatchEvent(new CustomEvent("clear"))}),r(m||(m=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em"><path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" /></svg>`)),this.helperText,!this.__isErrorVisible||this.disabled||this.readonly,this._errorMessage)}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-297155d9.js";import"./foxy-collection-page.js";import"./foxy-nucleon-element.js";import"./foxy-pagination.js";import"./shared-64210e53.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-297155d9.js";import"./foxy-collection-page.js";import"./foxy-nucleon-element.js";import"./foxy-pagination.js";import"./shared-64210e53.js";import{I as e}from"./shared-92c211bd.js";import{m as t,_ as i}from"./shared-7fec42f2.js";import{N as r}from"./shared-69074dae.js";import{i as s}from"./shared-53e42a77.js";import{c as n}from"./shared-4e709717.js";import{h as o,c as l}from"./shared-ba5c42c7.js";import{x as a}from"./shared-387d7254.js";let d,h,c,u,f,m=e=>e;let p,v=e=>e;customElements.define("foxy-internal-async-resource-link-list-control",class extends e{constructor(){super(...arguments),this.foreignKeyForUri=null,this.foreignKeyForId=null,this.ownKeyForUri=null,this.optionsHref=null,this.linksHref=null,this.embedKey=null,this.ownUri=null,this.limit=20,this.item=null,this.__getItemRenderer=t(((e,t)=>new Function("ctx",`return ctx.html\`\n <${null!=e?e:"foxy-null"}\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n infer=""\n ${t?".data=${ctx.data}":"href=${ctx.href}"}\n ...=\${ctx.spread(ctx.props)}\n >\n </${null!=e?e:"foxy-null"}>\``)),((...e)=>e.join())),this.__renderItem=e=>{var t;const i=this.__getItemRenderer(this.item,!!e.data),r=e=>o(d||(d=m` <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)">${0}</div> `),e);if(!e.href||e.href.startsWith("foxy://"))return r(i(e));if(this.readonly)return r(i(e));const s=this.foreignKeyForUri,n=s?null===(t=this.__allLinks)||void 0===t?void 0:t.find((t=>t[s]===e.href)):void 0,l=this.disabled||!this.__allLinks||this.__isFetching;return r(o(h||(h=m` <vaadin-checkbox class="block foxy-internal-checkbox-style-0" ?disabled="${0}" ?checked="${0}" @change="${0}"> <div class="transition-opacity ${0}"> ${0} </div> </vaadin-checkbox> `),l,!!n,(t=>{var i,r,s;t.currentTarget.checked?this.__insertLink(null!==(r=null===(i=e.data)||void 0===i?void 0:i._links.self.href)&&void 0!==r?r:""):this.__deleteLink(null!==(s=null==n?void 0:n._links.self.href)&&void 0!==s?s:"")}),l?"opacity-50":"opacity-100",i(e)))},this.__isFetching=!1}static get properties(){return i(i({},super.properties),{},{foreignKeyForUri:{attribute:"foreign-key-for-uri"},foreignKeyForId:{attribute:"foreign-key-for-id"},ownKeyForUri:{attribute:"own-key-for-uri"},optionsHref:{attribute:"options-href"},linksHref:{attribute:"links-href"},embedKey:{attribute:"embed-key"},ownUri:{attribute:"own-uri"},limit:{type:Number},item:{},__isFetching:{attribute:!1}})}static get styles(){return[super.styles,l(c||(c=m`vaadin-checkbox::part(label){margin:0 0 0 calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);align-self:center;flex:1}`))]}renderControl(){var e;let t;try{const i=new URL(null!==(e=this.optionsHref)&&void 0!==e?e:"");i.searchParams.set("limit",this.limit.toString()),t=i.toString()}catch(e){t=void 0}const i=this.__isFetching||!this.__allLinks;return o(u||(u=m` <div class="group"> <div class="mb-s" ?hidden="${0}"> <div class="flex justify-between font-medium text-l" ?hidden="${0}"> <span>${0}</span> <foxy-i18n class="text-m text-tertiary font-normal transition-opacity ${0}" infer="" key="${0}"> </foxy-i18n> </div> <div class="text-secondary text-s" ?hidden="${0}">${0}</div> </div> <foxy-pagination first="${0}" infer="pagination"> <foxy-collection-page infer="card" class="${0}" .item="${0}"> </foxy-collection-page> </foxy-pagination> <div class="mt-s text-s leading-xs text-error" ?hidden="${0}"> ${0} </div> ${0} </div> `),!this.label&&!this.helperText,!this.label,this.label,i?"opacity-100":"opacity-0",this.__isFetching?"status_saving":"status_loading",!this.helperText,this.helperText,s(t),n({"block transition-colors divide-y rounded overflow-hidden":!0,"bg-contrast-5 divide-base":!0}),this.__renderItem,!this._errorMessage||this.disabled||this.readonly,this._errorMessage,this.__renderLinkResourceLoaders())}updated(e){var t,i;super.updated(e),e.has("item")&&(null===(i=(t=this.__getItemRenderer.cache).clear)||void 0===i||i.call(t))}async __insertLink(e){var t,i,s,n,o,l,a;this.__isFetching=!0;const d=new r.API(this),h=await d.fetch(null!==(t=this.linksHref)&&void 0!==t?t:"",{method:"POST",body:JSON.stringify({[null!==(i=this.foreignKeyForUri)&&void 0!==i?i:""]:e,[null!==(s=this.ownKeyForUri)&&void 0!==s?s:""]:this.ownUri})});if(h.ok){const e=await h.json(),t=await d.fetch(e._links.self.href);if(t.ok){const i=r.Rumour(null!==(o=null===(n=this.nucleon)||void 0===n?void 0:n.group)&&void 0!==o?o:""),s=await t.json();console.log({related:[null!==(l=this.linksHref)&&void 0!==l?l:""],source:e._links.self.href,data:s}),i.share({related:[null!==(a=this.linksHref)&&void 0!==a?a:""],source:e._links.self.href,data:s})}}this.__isFetching=!1}async __deleteLink(e){var t,i,s;this.__isFetching=!0;const n=new r.API(this);if((await n.fetch(e,{method:"DELETE"})).ok){r.Rumour(null!==(i=null===(t=this.nucleon)||void 0===t?void 0:t.group)&&void 0!==i?i:"").share({related:[null!==(s=this.linksHref)&&void 0!==s?s:""],source:e,data:null})}this.__isFetching=!1}__renderLinkResourceLoaders(){var e,t,i;const r=200,s=this.renderRoot.querySelector("[data-link-page]"),n=Number(null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e.total_items)&&void 0!==t?t:r),l=[];try{for(let e=0;e<Math.max(1,Math.ceil(n/r));e++){const t=new URL(null!==(i=this.linksHref)&&void 0!==i?i:"");t.searchParams.set("offset",String(e*r)),t.searchParams.set("limit",String(r)),l.push(t.toString())}}catch(e){}return l.map((e=>o(f||(f=m` <foxy-nucleon class="hidden" data-link-page infer="" href="${0}" @update="${0}"> </foxy-nucleon> `),e,(()=>this.requestUpdate()))))}get __allLinks(){var e,t;const i=this.embedKey;if(!i)return null;const r=this.renderRoot.querySelectorAll("[data-link-page]"),s=[];for(const n of r){const r=null===(t=null===(e=n.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t[i];if(!r)return null;s.push(...r)}return s}});try{a("vaadin-checkbox",l(p||(p=v`:host(.foxy-internal-checkbox-style-0) label{display:flex}`)))}catch(e){}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-5212ef4f.js";import"./shared-64210e53.js";import{_ as e,l as t}from"./shared-7fec42f2.js";import{C as r}from"./shared-c782b9fa.js";import{a as s,T as i,w as n}from"./shared-387d7254.js";import{h as l,r as o,L as h}from"./shared-ba5c42c7.js";import{I as a}from"./shared-0ea750af.js";import{N as p}from"./shared-
|
|
1
|
+
import"./shared-5212ef4f.js";import"./shared-64210e53.js";import{_ as e,l as t}from"./shared-7fec42f2.js";import{C as r}from"./shared-c782b9fa.js";import{a as s,T as i,w as n}from"./shared-387d7254.js";import{h as l,r as o,L as h}from"./shared-ba5c42c7.js";import{I as a}from"./shared-0ea750af.js";import{N as p}from"./shared-69074dae.js";import{s as u}from"./shared-1da47f50.js";let c,d,_,f,v=e=>e;class y extends(r(s(i(a(h))))){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,t){return"nucleon"===e&&t instanceof p?t:super.inferFromElement(e,t)}applyInferredProperties(e){var t,r;super.applyInferredProperties(e),this.nucleon=null!==(t=e.get("nucleon"))&&void 0!==t?t:null,!1===(null===(r=this.nucleon)||void 0===r?void 0:r.in("idle"))&&(this.disabled=!0)}renderLightDom(){if("string"!=typeof this.infer)return;const e=l(c||(c=v` <slot name="${0}:before" slot="before"></slot> <slot name="${0}:after" slot="after"></slot> `),this.infer,this.infer);o(e,this)}updated(e){super.updated(e),this.renderLightDom()}renderControl(){return l(d||(d=v``))}render(){return this.hidden?l(_||(_=v``)):l(f||(f=v` ${0} ${0} ${0} `),this.renderTemplateOrSlot("before",this.nucleon),this.renderControl(),this.renderTemplateOrSlot("after",this.nucleon))}}function m(e){try{return JSON.parse(e)}catch(e){return null}}customElements.define("foxy-internal-control",y);class g extends y{constructor(){var e;super(...arguments),e=this,this.checkValidityAsync=null,this.jsonTemplate=null,this.jsonPath=null,this.getValue=()=>{var e;const r=t(null===(e=this.nucleon)||void 0===e?void 0:e.form,this.property);if(this.jsonPath){const e=m(r),s=m(this.jsonTemplate);return t(e,this.jsonPath,t(s,this.jsonPath))}return r},this.setValue=e=>{var t,r,s,i,n,l,o,h,a;const[p,...c]=this.property.split(".");if(c.length){const l=null!==(r=null===(t=this.nucleon)||void 0===t?void 0:t.form[p])&&void 0!==r?r:{};if(this.jsonPath){const t=null!==(i=m(null===(s=this.nucleon)||void 0===s?void 0:s.form[p]))&&void 0!==i?i:m(this.jsonTemplate);u(t,this.jsonPath,e),u(l,c,JSON.stringify(t))}else u(l,c,e);null===(n=this.nucleon)||void 0===n||n.edit({[p]:l})}else if(this.jsonPath){const t=null!==(o=m(null===(l=this.nucleon)||void 0===l?void 0:l.form[p]))&&void 0!==o?o:m(this.jsonTemplate);u(t,this.jsonPath,e),null===(h=this.nucleon)||void 0===h||h.edit({[p]:JSON.stringify(t)})}else null===(a=this.nucleon)||void 0===a||a.edit({[p]:e})},this.__debouncedCheckValidityAsync=n((async function(t){var r;const s=await(null===(r=e.checkValidityAsync)||void 0===r?void 0:r.call(e,t));e._value===t&&(e.__asyncError=!0===s?null:null!=s?s:null)}),300),this.__previousValue=null,this.__placeholder=null,this.__helperText=null,this.__asyncError=null,this.__v8nPrefix=null,this.__property=null,this.__label=null}static get properties(){return e(e({},super.properties),{},{checkValidityAsync:{attribute:!1},jsonTemplate:{attribute:"json-template"},placeholder:{type:String,noAccessor:!0},helperText:{type:String,attribute:"helper-text",noAccessor:!0},v8nPrefix:{type:String,attribute:"v8n-prefix",noAccessor:!0},jsonPath:{attribute:"json-path"},getValue:{attribute:!1},setValue:{attribute:!1},property:{type:String,noAccessor:!0},label:{type:String,noAccessor:!0},__asyncError:{attribute:!1}})}get placeholder(){return"string"==typeof this.__placeholder?this.__placeholder:this.t("placeholder")}set placeholder(e){const t=this.__placeholder;this.__placeholder=e,this.requestUpdate("placeholder",t)}get helperText(){return"string"==typeof this.__helperText?this.__helperText:this.t("helper_text")}set helperText(e){const t=this.__helperText;this.__helperText=e,this.requestUpdate("helperText",t)}get v8nPrefix(){return"string"==typeof this.__v8nPrefix?this.__v8nPrefix:"string"==typeof this.infer?`${this.infer}:`:""}set v8nPrefix(e){const t=this.__v8nPrefix;this.__v8nPrefix=e,this.requestUpdate("v8nPrefix",t)}get property(){return"string"==typeof this.__property?this.__property:"string"==typeof this.infer?this.infer.replace(/-/g,"_"):""}set property(e){const t=this.__property;this.__property=e,this.requestUpdate("property",t)}get label(){return"string"==typeof this.__label?this.__label:this.t("label")}set label(e){const t=this.__label;this.__label=e,this.requestUpdate("label",t)}resetPlaceholder(){const e=this.__placeholder;this.__placeholder=null,this.requestUpdate("placeholder",e)}resetHelperText(){const e=this.__helperText;this.__helperText=null,this.requestUpdate("helperText",e)}resetV8nPrefix(){const e=this.__v8nPrefix;this.__v8nPrefix=null,this.requestUpdate("v8nPrefix",e)}resetProperty(){const e=this.__property;this.__property=null,this.requestUpdate("property",e)}resetLabel(){const e=this.__label;this.__label=null,this.requestUpdate("label",e)}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){this.__previousValue=this._value,this.__asyncError=null,this._error||this.__previousValue===e||this.__debouncedCheckValidityAsync(e);const t=new CustomEvent("change",{cancelable:!0,detail:e});this.dispatchEvent(t)&&this.setValue(e)}get _error(){var e,t;const r=null===(e=this.nucleon)||void 0===e?void 0:e.errors.find((e=>e.startsWith(this.v8nPrefix)));return null!==(t=null!=r?r:this.__asyncError)&&void 0!==t?t:void 0}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",g);export{g as I,y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./foxy-spinner.js";import{I as e}from"./shared-ba0d1f31.js";customElements.define("foxy-internal-card",e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-5574ea83.js";import"./shared-ac44a3a5.js";import"./shared-caac6517.js";import"./shared-0d01cd66.js";import"./shared-1abfcf87.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-5574ea83.js";import"./shared-ac44a3a5.js";import"./shared-caac6517.js";import"./shared-0d01cd66.js";import"./shared-1abfcf87.js";import{I as e}from"./shared-92c211bd.js";import{_ as t}from"./shared-7fec42f2.js";import{c as i,h as a,s}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import{c as o}from"./shared-4e709717.js";let n,r,d,h,u,c,p=e=>e;customElements.define("foxy-internal-frequency-control",class extends e{constructor(){super(...arguments),this.allowTwiceAMonth=!1,this.options=[{value:"d",label:"day"},{value:"w",label:"week"},{value:"m",label:"month"},{value:"y",label:"year"}],this.layout=null,this.max=999,this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{var t;const i=e.startsWith(".")?`0${e}`:e,a=parseFloat(e.substring(0,Math.max(i.length-1,0))),s=null!==(t=i[i.length-1])&&void 0!==t?t:"";return isNaN(a)?["0",""]:[a.toString(),s]}}}static get properties(){return t(t({},super.properties),{},{allowTwiceAMonth:{type:Boolean,attribute:"allow-twice-a-month"},options:{attribute:!1},layout:{},max:{type:Number}})}static get styles(){return[super.styles,i(n||(n=p`: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}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input{-moz-appearance:textfield}`))]}renderControl(){var e,t;if("summary-item"===this.layout)return this.__renderSummaryItemLayout();const i=null!==(e=this._value)&&void 0!==e?e:"",s=parseFloat(this.__i18n.parseValue(i)[0]),o=this.options.map((({value:e,label:t})=>({label:this.t(t,{count:s}),value:e})));return a(r||(r=p` <vaadin-custom-field ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .errorMessage="${0}" .helperText="${0}" .label="${0}" .value="${0}" .i18n="${0}" @change="${0}"> <vaadin-integer-field max="${0}" min="1" prevent-invalid-input has-controls ?disabled="${0}" ?readonly="${0}" ?invalid="${0}" @keydown="${0}"> </vaadin-integer-field> <vaadin-combo-box item-value-path="value" item-label-path="label" ?disabled="${0}" ?readonly="${0}" ?invalid="${0}" .items="${0}" @keydown="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.disabled,this.readonly,this._checkValidity,null!==(t=this._errorMessage)&&void 0!==t?t:"",this.helperText,this.label,i,this.__i18n,(e=>{const t=e.currentTarget;this._value=t.value}),l(this.max||void 0),this.disabled,this.readonly,!this._checkValidity(),(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),this.disabled,this.readonly,!this._checkValidity(),o,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}))}updated(e){var t;super.updated(e);const i=this.renderRoot.querySelector("vaadin-custom-field");i&&i.value!==this._value&&(i.value=null!==(t=this._value)&&void 0!==t?t:"")}__renderSummaryItemLayout(){var e,t;const i=null!==(e=this._value)&&void 0!==e?e:"",[n,r]=this.__i18n.parseValue(i),m=parseFloat(n),v=".5m"!==this._value||this.allowTwiceAMonth?this.options.find((e=>e.value===r)):void 0;return a(d||(d=p` <div class="leading-xs"> <div class="flex items-center gap-xs"> <label class="text-m text-body flex-1 whitespace-nowrap" for="input">${0}</label> <input placeholder="${0}" inputmode="numeric" style="min-width:10ch" class="${0}" type="number" step="1" min="1" max="${0}" id="input" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <div class="${0}"> <div class="flex items-center gap-xs"> <div class="whitespace-nowrap"> ${0} </div> ${0} </div> <select class="${0}" id="select" ?disabled="${0}" ?hidden="${0}" @change="${0}"> <option value="" ?selected="${0}" disabled="disabled" hidden>${0}</option> ${0} ${0} </select> </div> </div> <div style="max-width:32rem"> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> </div> `),this.label,this.placeholder,o({"w-full appearance-none text-right bg-transparent transition-colors":!0,"text-m rounded-s focus-outline-none":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),l(null!==(t=this.max)&&void 0!==t?t:void 0),".5m"===i?this.allowTwiceAMonth?2:"":m,this.disabled,this.readonly,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{e.stopPropagation();const t=e.currentTarget,i=r||this.options[0].value;this._value=this.__i18n.formatValue([t.value,i])}),o({"relative rounded-s transition-colors transition-opacity":!0,"focus-within-ring-2 focus-within-ring-primary-50":!this.disabled&&!this.readonly,"text-body hover-opacity-80 cursor-pointer":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),".5m"===i?this.t("times_a_month"):v?this.t(v.label,{count:m}):this.t("select"),this.readonly?"":s(h||(h=p`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25)"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),o({"absolute inset-0 opacity-0":!0,"cursor-pointer":!this.disabled&&!this.readonly}),this.disabled,this.readonly,(e=>{e.stopPropagation();const t=e.currentTarget.value;this._value="times_a_month"===t?".5m":this.__i18n.formatValue([m||1,t])}),!v,this.t("select"),!this.allowTwiceAMonth||2!==m&&".5m"!==i?"":a(u||(u=p` <option value="times_a_month" ?selected="${0}"> ${0} </option> `),".5m"===i,this.t("times_a_month")),this.options.map((e=>a(c||(c=p` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.value,".5m"!==i&&e.value===(null==v?void 0:v.value),this.t(e.label,{count:m})))),this.helperText,this.disabled||this.readonly,this._errorMessage)}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as e}from"./shared-297155d9.js";import"./shared-a6cf5b1f.js";import"./shared-dc357e9d.js";import{h as t,P as r}from"./shared-3bc9eaf7.js";import{F as o}from"./shared-3db3f3c3.js";import{T as a,D as s}from"./shared-46efbc40.js";import{I as l}from"./shared-
|
|
1
|
+
import{C as e}from"./shared-297155d9.js";import"./shared-a6cf5b1f.js";import"./shared-dc357e9d.js";import{h as t,P as r}from"./shared-3bc9eaf7.js";import{F as o}from"./shared-3db3f3c3.js";import{T as a,D as s}from"./shared-46efbc40.js";import{I as l}from"./shared-92c211bd.js";import"./shared-64210e53.js";import{_ as i}from"./shared-7fec42f2.js";import{i as h}from"./shared-53e42a77.js";import{h as d}from"./shared-ba5c42c7.js";const n=t`<dom-module id="lumo-checkbox-group" theme-for="vaadin-checkbox-group">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-required-field">
|
|
4
4
|
:host {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as e}from"./shared-
|
|
1
|
+
import{I as e}from"./shared-92c211bd.js";import"./shared-64210e53.js";import{_ as t}from"./shared-7fec42f2.js";import{d as s,N as r,i as o,c as a,h as i,s as n}from"./shared-ba5c42c7.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-24998349.js";import"./shared-
|
|
1
|
+
import"./shared-24998349.js";import"./shared-df92d411.js";import{I as e}from"./shared-92c211bd.js";import{I as t}from"./shared-4e4766ee.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-form-dialog.js";import"./shared-64210e53.js";import{_ as s,m as i,F as r}from"./shared-7fec42f2.js";import{h as o,s as l}from"./shared-ba5c42c7.js";import{s as a}from"./shared-53e476fd.js";import{g as n}from"./shared-bab2ea2c.js";import{i as d}from"./shared-53e42a77.js";import{c as h}from"./shared-4e709717.js";import{u}from"./shared-69074dae.js";let c,f=e=>e;let p,y,m,v,x,b,g,$,_=e=>e;customElements.define("foxy-internal-resource-picker-control-form",class extends t{constructor(){super(...arguments),this.selectionProps={}}static get properties(){return s(s({},super.properties),{},{selectionProps:{attribute:!1}})}renderBody(){return o(c||(c=f` <foxy-internal-async-list-control infer="selection" form="foxy-null" hide-delete-button hide-create-button @itemclick="${0}" ...="${0}"> </foxy-internal-async-list-control> `),(e=>{e.preventDefault(),this.edit({selection:e.detail}),this.submit()}),a(this.selectionProps))}}),customElements.define("foxy-internal-resource-picker-control",class extends e{constructor(){super(...arguments),this.getDisplayValueOptions=e=>({resource:e}),this.showCopyIdButton=!1,this.virtualHost=u("internal-resource-picker-control-"),this.getItemUrl=null,this.formProps={},this.filters=[],this.layout=null,this.first=null,this.item=null,this.form=null,this.__getItemRenderer=i((e=>new Function("ctx",`return ctx.html\`\n <${null!=e?e:"foxy-null"}\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n infer="card"\n href=\${ctx.href}\n ...=\${ctx.spread(ctx.props)}\n >\n </${null!=e?e:"foxy-null"}>\``)))}static get properties(){return s(s({},super.properties),{},{getDisplayValueOptions:{attribute:!1},showCopyIdButton:{type:Boolean,attribute:"show-copy-id-button"},virtualHost:{},getItemUrl:{attribute:!1},formProps:{type:Object},filters:{type:Array},layout:{},first:{},item:{},form:{}})}renderControl(){var e;const t=s(s({},this.formProps),{},{".selectionProps":{".filters":this.filters,".first":this.first,".item":this.item}});return o(p||(p=_` <foxy-form-dialog parent="foxy://${0}/select" header="header" infer="dialog" alert .props="${0}" .form="${0}" @fetch="${0}"> </foxy-form-dialog> ${0} `),this.virtualHost,t,null!==(e=this.form)&&void 0!==e?e:"foxy-internal-resource-picker-control-form",this.__handleFetchEvent,"summary-item"===this.layout?this.__renderSummaryItemLayout():this.__renderStandaloneLayout())}updated(e){var t,s;super.updated(e),e.has("item")&&(null===(s=(t=this.__getItemRenderer.cache).clear)||void 0===s||s.call(t))}__clear(){this._value="",this.dispatchEvent(new CustomEvent("clear"))}__renderSummaryItemLayout(){const e=this.renderRoot.querySelector("#value");return o(y||(y=_` <div class="leading-xs"> <div class="flex items-center gap-xs"> <div class="text-m text-body whitespace-nowrap flex-1">${0}</div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div class="truncate min-w-0"> ${0} </div> </button> <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> <div style="max-width:32rem"> <div class="text-xs text-secondary">${0}</div> <div class="text-xs text-error" ?hidden="${0}"> ${0} </div> </div> </div> <foxy-nucleon infer="" href="${0}" id="value" @update="${0}"> </foxy-nucleon> `),this.label,this.t("select"),h({"text-right min-w-0 transition-colors transition-opacity":!0,"rounded-s focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"cursor-pointer text-body hover-opacity-80":!this.disabled&&!this.readonly,"font-medium":!this.readonly}),this.disabled||this.readonly,(e=>{if(this.disabled||this.readonly)return;const t=e.currentTarget,s=this.renderRoot.querySelector("foxy-form-dialog");s.href="",s.show(t)}),this._value?o(m||(m=_` <foxy-i18n infer="" key="value" .options="${0}"> </foxy-i18n> `),(null==e?void 0:e.data)?this.getDisplayValueOptions(e.data):{context:(null==e?void 0:e.in("fail"))?"fail":"busy"}):this.placeholder,this.t("clear"),h({"rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!this._value,this.__clear,l(v||(v=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em"><path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" /></svg>`)),this.helperText,this.disabled||this.readonly,this._errorMessage,d(this._value||void 0),(()=>this.requestUpdate()))}__renderStandaloneLayout(){var e,t,s,i,r;const l=this.__valueLoader,u="string"==typeof this._value?n(this._value):void 0,c="string"==typeof this._value?null===(e=this.getItemUrl)||void 0===e?void 0:e.call(this,this._value,null!==(t=null==l?void 0:l.data)&&void 0!==t?t:null):void 0;return o(x||(x=_` <div class="block group"> <div class="${0}"> <span class="mr-auto text-l">${0}</span> ${0} ${0} ${0} </div> <div class="text-secondary text-s" ?hidden="${0}">${0}</div> <button class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" ?disabled="${0}" @click="${0}"> <div class="${0}"> <foxy-nucleon class="block" infer="" href="${0}" id="valueLoader" @update="${0}"> ${0} </foxy-nucleon> </div> </button> <div class="mt-xs text-xs leading-xs text-error" ?hidden="${0}"> ${0} </div> </div> `),h({"flex items-center gap-s transition-colors font-medium":!0,"text-disabled":this.disabled}),this.label,c?o(b||(b=_` <a class="text-body rounded transition-opacity hover-opacity-90 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="view"></foxy-i18n> </a> `),c):"",this.showCopyIdButton&&null!==u?o(g||(g=_` <foxy-copy-to-clipboard layout="text" theme="contrast tertiary-inline" infer="copy-id" text="${0}"> </foxy-copy-to-clipboard> `),u):"",this.readonly||!this._value?"":o($||($=_` <vaadin-button theme="error tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="clear"></foxy-i18n> </vaadin-button> `),this.disabled,this.__clear),!this.helperText,this.helperText,h({"block w-full bg-contrast-5 rounded text-left transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer hover-bg-contrast-10":!this.disabled&&!this.readonly,"cursor-default":this.disabled||this.readonly,"mt-s":!!this.label||!!this.helperText}),this.disabled||this.readonly,(e=>{const t=e.currentTarget,s=this.renderRoot.querySelector("foxy-form-dialog");s.href="",s.show(t)}),h({"transition-opacity":!0,"opacity-50":this.disabled}),d(this._value||void 0),(()=>this.requestUpdate()),this.__getItemRenderer(this.item)({html:o,data:null!==(s=null==l?void 0:l.data)&&void 0!==s?s:null,href:this._value||"",related:[],parent:"",props:{},spread:a,simplifyNsLoading:this.simplifyNsLoading,disabled:this.disabled,disabledControls:this.disabledControls,readonly:this.readonly,readonlyControls:this.readonlyControls,hidden:this.hidden,hiddenControls:this.hiddenControls,templates:this.templates,previous:null,next:null,group:null!==(r=null===(i=this.nucleon)||void 0===i?void 0:i.group)&&void 0!==r?r:"",lang:this.lang,ns:this.ns}),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}__handleFetchEvent(e){if(!(e instanceof r))return;if(e.defaultPrevented)return;const{url:t,method:s}=e.request;return t===`foxy://${this.virtualHost}/select`&&"POST"===s?e.respondWith(this.__handleSelect(e.request)):t===`foxy://${this.virtualHost}/empty`&&"GET"===s?e.respondWith(this.__handleEmpty()):void 0}async __handleSelect(e){const t=await e.clone().json();return this._value=t.selection,new Response(JSON.stringify({_links:{self:{href:`foxy://${this.virtualHost}/empty`}},message:"Resource selected."}))}async __handleEmpty(){return new Response(JSON.stringify({_links:{self:{href:`foxy://${this.virtualHost}/empty`}},message:"Resource selected."}))}get __valueLoader(){return this.renderRoot.querySelector("#valueLoader")}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as e}from"./shared-387d7254.js";import{N as t}from"./shared-
|
|
1
|
+
import{T as e}from"./shared-387d7254.js";import{N as t}from"./shared-69074dae.js";import{c as i}from"./shared-4e709717.js";import{h as s}from"./shared-ba5c42c7.js";let r,a,n=e=>e;class o extends(e(t)){renderBody(){return s(r||(r=n``))}render(){const e=this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy";return s(a||(a=n` <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}" infer="spinner"> </foxy-spinner> </div> </div> `),this.in("busy"),i({"transition duration-500 ease-in-out":!0,"opacity-0 pointer-events-none":!this.isBodyReady}),this.renderBody(),i({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"items-center justify-center":!0,"opacity-0 pointer-events-none":this.isBodyReady}),"busy"===e?"no-label":"horizontal",e)}get isBodyReady(){return!!this.data}}export{o as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-1abfcf87.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-1abfcf87.js";import{I as e}from"./shared-92c211bd.js";import"./shared-64210e53.js";import{_ as t}from"./shared-7fec42f2.js";import{i as s}from"./shared-53e42a77.js";import{h as i,s as a}from"./shared-ba5c42c7.js";import{c as l}from"./shared-4e709717.js";let r,o,d,h,n=e=>e;customElements.define("foxy-internal-select-control",class extends e{constructor(){super(...arguments),this.options=[],this.layout=null,this.theme=null,this.__isErrorVisible=!1}static get properties(){return t(t({},super.properties),{},{options:{type:Array},layout:{},theme:{type:String},__isErrorVisible:{attribute:!1}})}renderControl(){var e;return"summary-item"===this.layout?this.__renderSummaryItemLayout():i(r||(r=n` <vaadin-combo-box item-value-path="value" item-label-path="label" error-message="${0}" item-id-path="value" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" theme="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible .checkValidity="${0}" .items="${0}" .value="${0}" @change="${0}"> </vaadin-combo-box> `),s(this._errorMessage),this.helperText,this.placeholder,this.label,s(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled,this.readonly,this._checkValidity,this.options.map((e=>({label:"label"in e?this.t(e.label):e.rawLabel,value:e.value}))),this._value,(e=>{e.stopPropagation();const t=e.currentTarget;this._value=t.value,t.validate()}))}reportValidity(){this.__isErrorVisible=!0,super.reportValidity()}updated(e){super.updated(e);const t=this.renderRoot.querySelector("vaadin-combo-box");t&&t.value!==this._value&&(t.value=this._value)}__renderSummaryItemLayout(){const e=this.options.find((e=>e.value===this._value));return i(o||(o=n` <div class="leading-xs"> <div class="flex items-center gap-s"> <label class="text-m text-body flex-1 whitespace-nowrap" for="select"> ${0} </label> <div class="${0}"> <div class="flex items-center gap-xs min-w-0"> <div class="truncate min-w-0"> ${0} </div> ${0} </div> <select class="${0}" id="select" ?disabled="${0}" ?hidden="${0}" @blur="${0}" @change="${0}"> <option value="" ?selected="${0}" disabled="disabled" hidden>${0}</option> ${0} </select> </div> </div> <div style="max-width:32rem"> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> </div> `),this.label,l({"relative rounded-s transition-colors transition-opacity min-w-0":!0,"focus-within-ring-2 focus-within-ring-primary-50":!this.disabled&&!this.readonly,"text-body hover-opacity-80 cursor-pointer":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),e?"label"in e?this.t(e.label):e.rawLabel:this.placeholder,this.readonly?"":a(d||(d=n`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="flex-shrink-0" style="width: 1em; height: 1em; transform: scale(1.25)"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),l({"absolute inset-0 opacity-0":!0,"cursor-pointer":!this.disabled&&!this.readonly}),this.disabled,this.readonly,(()=>this.__isErrorVisible=!0),(e=>{e.stopPropagation(),this._value=e.target.value}),!e,this.placeholder,this.options.map((t=>i(h||(h=n` <option value="${0}" ?selected="${0}"> ${0} </option> `),t.value,e&&t.value===this._value,"label"in t?this.t(t.label):t.rawLabel))),this.helperText,!this.__isErrorVisible||this.disabled||this.readonly,this._errorMessage)}});
|