@foxy.io/elements 1.45.0-beta.3 → 1.45.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-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-copy-to-clipboard.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-settings.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-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-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-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-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-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +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-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.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-spinner.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-1d6ed748.js → shared-005168e0.js} +1 -1
- package/dist/cdn/{shared-4e279e77.js → shared-0fb0732a.js} +1 -1
- package/dist/cdn/{shared-5574ea83.js → shared-1091aa45.js} +1 -1
- package/dist/cdn/{shared-64210e53.js → shared-10da9bf0.js} +1 -1
- package/dist/cdn/{shared-b7401886.js → shared-138959d7.js} +1 -1
- package/dist/cdn/{shared-0b3dbac6.js → shared-1ae16c80.js} +1 -1
- package/dist/cdn/{shared-92c211bd.js → shared-1e14a3fe.js} +1 -1
- package/dist/cdn/{shared-461a25ae.js → shared-21a945fd.js} +5 -5
- package/dist/cdn/{shared-dc357e9d.js → shared-278b8790.js} +1 -1
- package/dist/cdn/{shared-7a818ad5.js → shared-2d1b1ab2.js} +1 -1
- package/dist/cdn/{shared-302f3391.js → shared-3615b419.js} +1 -1
- package/dist/cdn/{shared-d674d2ce.js → shared-3c94ab84.js} +1 -1
- package/dist/cdn/{shared-3bc9eaf7.js → shared-433eea12.js} +1 -1
- package/dist/cdn/{shared-ba0d1f31.js → shared-4b24accb.js} +1 -1
- package/dist/cdn/{shared-b148b310.js → shared-4cc42648.js} +1 -1
- package/dist/cdn/{shared-ada2d315.js → shared-4e1bff30.js} +1 -1
- package/dist/cdn/{shared-1d03ea56.js → shared-50f8f2bd.js} +1 -1
- package/dist/cdn/{shared-050780e9.js → shared-51376cac.js} +1 -1
- package/dist/cdn/{shared-ac44a3a5.js → shared-529a82a3.js} +1 -1
- package/dist/cdn/{shared-adfed461.js → shared-5380e27d.js} +1 -1
- package/dist/cdn/{shared-24998349.js → shared-5963a49e.js} +1 -1
- package/dist/cdn/{shared-c84bb30e.js → shared-597193f7.js} +1 -1
- package/dist/cdn/{shared-a1cfe9d5.js → shared-5b0c206b.js} +1 -1
- package/dist/cdn/{shared-3db3f3c3.js → shared-5bcf861e.js} +1 -1
- package/dist/cdn/{shared-0abec247.js → shared-636d6e33.js} +1 -1
- package/dist/cdn/{shared-46efbc40.js → shared-64e243c4.js} +1 -1
- package/dist/cdn/{shared-dda75cab.js → shared-6c25eb72.js} +1 -1
- package/dist/cdn/{shared-4e4766ee.js → shared-77829fbb.js} +1 -1
- package/dist/cdn/{shared-df92d411.js → shared-788173f2.js} +1 -1
- package/dist/cdn/{shared-387d7254.js → shared-7a87cd33.js} +2 -2
- package/dist/cdn/{shared-caac6517.js → shared-7d15992f.js} +1 -1
- package/dist/cdn/{shared-d35ed355.js → shared-809d503c.js} +1 -1
- package/dist/cdn/{shared-f58068b0.js → shared-8340f3ab.js} +1 -1
- package/dist/cdn/{shared-4dba0d50.js → shared-85668fe8.js} +1 -1
- package/dist/cdn/{shared-ab9dfa48.js → shared-85ed835a.js} +1 -1
- package/dist/cdn/{shared-0d01cd66.js → shared-85feff39.js} +1 -1
- package/dist/cdn/{shared-ed24a3f9.js → shared-937e58bf.js} +1 -1
- package/dist/cdn/{shared-6783fe5e.js → shared-946a7af6.js} +1 -1
- package/dist/cdn/{shared-2d6478b0.js → shared-95d34ae8.js} +1 -1
- package/dist/cdn/{shared-c1b71162.js → shared-9e8344bf.js} +1 -1
- package/dist/cdn/{shared-8bda01cf.js → shared-a1297ca4.js} +1 -1
- package/dist/cdn/{shared-db758d3b.js → shared-a268320e.js} +1 -1
- package/dist/cdn/shared-a6e889a8.js +1 -0
- package/dist/cdn/{shared-e275989e.js → shared-a704aaa4.js} +1 -1
- package/dist/cdn/{shared-a6cf5b1f.js → shared-b5a0d106.js} +1 -1
- package/dist/cdn/{shared-4f36f302.js → shared-bea6e6a7.js} +1 -1
- package/dist/cdn/{shared-297155d9.js → shared-c5c123c5.js} +1 -1
- package/dist/cdn/{shared-47269bb6.js → shared-c66ca1f5.js} +1 -1
- package/dist/cdn/{shared-a5580ef6.js → shared-c6b1b119.js} +1 -1
- package/dist/cdn/{shared-25a9d87d.js → shared-c929504f.js} +1 -1
- package/dist/cdn/{shared-7f4e3256.js → shared-cb4ac1d2.js} +1 -1
- package/dist/cdn/{shared-51919259.js → shared-cc0d9412.js} +1 -1
- package/dist/cdn/{shared-52053d0d.js → shared-d3414cf0.js} +1 -1
- package/dist/cdn/{shared-1abfcf87.js → shared-df7d368c.js} +1 -1
- package/dist/cdn/{shared-1b04321a.js → shared-e4792d4a.js} +1 -1
- package/dist/cdn/{shared-bc89d3fb.js → shared-e502a7be.js} +1 -1
- package/dist/cdn/{shared-c3d1d247.js → shared-e54135f0.js} +3 -3
- package/dist/cdn/{shared-7fa24559.js → shared-e7a2b31d.js} +1 -1
- package/dist/cdn/{shared-e6d5f375.js → shared-f1e48b0e.js} +1 -1
- package/dist/cdn/{shared-7933d898.js → shared-f8519b17.js} +1 -1
- package/dist/cdn/{shared-05e997ae.js → shared-f9d1baff.js} +1 -1
- package/dist/cdn/{shared-8ba4b5bf.js → shared-fc784ca0.js} +1 -1
- package/dist/cdn/{shared-0eef6fb7.js → shared-fd5ff448.js} +1 -1
- package/dist/cdn/translations/template-config-form/en.json +50 -0
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +6 -0
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +183 -5
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/defaults.js +1 -0
- package/dist/elements/public/TemplateConfigForm/defaults.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/types.d.ts +12 -0
- package/dist/elements/public/TemplateConfigForm/types.js.map +1 -1
- package/dist/mixins/themeable.js +4 -0
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-9585cf5b.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./shared-
|
|
1
|
+
import{t as e}from"./shared-7a87cd33.js";import{d as t}from"./shared-5bcf861e.js";
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -12,7 +12,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
12
12
|
@license
|
|
13
13
|
Copyright (c) 2017 Vaadin Ltd.
|
|
14
14
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
15
|
-
*/const
|
|
15
|
+
*/const h=e=>class extends e{static get properties(){return{_hasVaadinItemMixin:{value:!0},disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0},selected:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_selectedChanged"},_value:String}}get value(){return void 0!==this._value?this._value:this.textContent.trim()}set value(e){this._value=e}ready(){super.ready();const e=this.getAttribute("value");null!==e&&(this.value=e),this.addEventListener("focus",(e=>this._setFocused(!0)),!0),this.addEventListener("blur",(e=>this._setFocused(!1)),!0),this.addEventListener("mousedown",(e=>{this._setActive(this._mousedown=!0);const t=()=>{this._setActive(this._mousedown=!1),document.removeEventListener("mouseup",t)};document.addEventListener("mouseup",t)})),this.addEventListener("keydown",(e=>this._onKeydown(e))),this.addEventListener("keyup",(e=>this._onKeyup(e)))}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("active")&&this._setFocused(!1)}_selectedChanged(e){this.setAttribute("aria-selected",e)}_disabledChanged(e){e?(this.selected=!1,this.setAttribute("aria-disabled","true"),this.blur()):this.removeAttribute("aria-disabled")}_setFocused(e){e?(this.setAttribute("focused",""),this._mousedown||this.setAttribute("focus-ring","")):(this.removeAttribute("focused"),this.removeAttribute("focus-ring"),this._setActive(!1))}_setActive(e){e?this.setAttribute("active",""):this.removeAttribute("active")}_onKeydown(e){/^( |SpaceBar|Enter)$/.test(e.key)&&!e.defaultPrevented&&(e.preventDefault(),this._setActive(!0))}_onKeyup(e){this.hasAttribute("active")&&(this._setActive(!1),this.click())}}
|
|
16
16
|
/**
|
|
17
17
|
@license
|
|
18
18
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -22,4 +22,4 @@ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
|
22
22
|
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
23
23
|
part of the polymer project is also subject to an additional IP rights grant
|
|
24
24
|
found at http://polymer.github.io/PATENTS.txt
|
|
25
|
-
*/;var
|
|
25
|
+
*/;var d=new Set;const u={properties:{_parentResizable:{type:Object,observer:"_parentResizableChanged"},_notifyingDescendant:{type:Boolean,value:!1}},listeners:{"iron-request-resize-notifications":"_onIronRequestResizeNotifications"},created:function(){this._interestedResizables=[],this._boundNotifyResize=this.notifyResize.bind(this),this._boundOnDescendantIronResize=this._onDescendantIronResize.bind(this)},attached:function(){this._requestResizeNotifications()},detached:function(){this._parentResizable?this._parentResizable.stopResizeNotificationsFor(this):(d.delete(this),window.removeEventListener("resize",this._boundNotifyResize)),this._parentResizable=null},notifyResize:function(){this.isAttached&&(this._interestedResizables.forEach((function(e){this.resizerShouldNotify(e)&&this._notifyDescendant(e)}),this),this._fireResize())},assignParentResizable:function(e){this._parentResizable&&this._parentResizable.stopResizeNotificationsFor(this),this._parentResizable=e,e&&-1===e._interestedResizables.indexOf(this)&&(e._interestedResizables.push(this),e._subscribeIronResize(this))},stopResizeNotificationsFor:function(e){var t=this._interestedResizables.indexOf(e);t>-1&&(this._interestedResizables.splice(t,1),this._unsubscribeIronResize(e))},_subscribeIronResize:function(e){e.addEventListener("iron-resize",this._boundOnDescendantIronResize)},_unsubscribeIronResize:function(e){e.removeEventListener("iron-resize",this._boundOnDescendantIronResize)},resizerShouldNotify:function(e){return!0},_onDescendantIronResize:function(t){this._notifyingDescendant?t.stopPropagation():e||this._fireResize()},_fireResize:function(){this.fire("iron-resize",null,{node:this,bubbles:!1})},_onIronRequestResizeNotifications:function(e){var i=t(e).rootTarget;i!==this&&(i.assignParentResizable(this),this._notifyDescendant(i),e.stopPropagation())},_parentResizableChanged:function(e){e&&window.removeEventListener("resize",this._boundNotifyResize)},_notifyDescendant:function(e){this.isAttached&&(this._notifyingDescendant=!0,e.notifyResize(),this._notifyingDescendant=!1)},_requestResizeNotifications:function(){if(this.isAttached)if("loading"===document.readyState){var e=this._requestResizeNotifications.bind(this);document.addEventListener("readystatechange",(function t(){document.removeEventListener("readystatechange",t),e()}))}else this._findParent(),this._parentResizable?this._parentResizable._interestedResizables.forEach((function(e){e!==this&&e._findParent()}),this):(d.forEach((function(e){e!==this&&e._findParent()}),this),window.addEventListener("resize",this._boundNotifyResize),this.notifyResize())},_findParent:function(){this.assignParentResizable(null),this.fire("iron-request-resize-notifications",null,{node:this,bubbles:!0,cancelable:!0}),this._parentResizable?d.delete(this):d.add(this)}};export{h as I,a,u as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aq as e,ar as t,as as s,at as a,au as i,av as n,aw as r,ax as l,o,ay as d,az as A,aA as u,aB as h,aC as c,aD as m,aE as p,m as v,_ as g,aF as y}from"./shared-7fec42f2.js";import"./shared-c1b71162.js";import"./shared-a6cf5b1f.js";import"./shared-ed24a3f9.js";import"./shared-5574ea83.js";import{T as b}from"./shared-ac44a3a5.js";import"./shared-caac6517.js";import"./shared-dda75cab.js";import{d as _,P as f,A as x,c as w,h as E,L as k}from"./shared-ba5c42c7.js";import"./shared-0d01cd66.js";import{O as C}from"./shared-1abfcf87.js";import{p as S}from"./shared-64210e53.js";import{a as $,y as I,x as T,z as B}from"./shared-387d7254.js";import{I as M}from"./shared-0ea750af.js";import{s as V}from"./shared-53e476fd.js";import{i as D}from"./shared-e1e4d8f5.js";import"./shared-db758d3b.js";import"./shared-d35ed355.js";import"./shared-ab9dfa48.js";import{h as j,P as L}from"./shared-3bc9eaf7.js";import{E as Q,T as P}from"./shared-46efbc40.js";import{L as R}from"./shared-302f3391.js";import{C as O}from"./shared-24998349.js";import{b as q}from"./shared-c3d1d247.js";import"./shared-7fa24559.js";import{a as F,F as N}from"./shared-3db3f3c3.js";var U={raise:e,send:t,sendParent:s,sendUpdate:a,log:i,cancel:n,start:r,stop:l,assign:o,after:d,done:A,respond:u,forwardTo:h,escalate:c,choose:m,pure:p};const G=_((e=>t=>{const{element:s,name:a,strings:i}=t.committer;if(2!==i.length||""!==i[0]||""!==i[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof f)s[a]!==e&&t.setValue(e);else{if(!(t instanceof x))throw new Error("live directive can only be used on attributes or properties");s.getAttribute(a)!==e&&t.setValue(e)}}));class W extends CustomEvent{constructor(e){super("change",{detail:e})}}class H extends CustomEvent{constructor(e){super("change",{detail:e})}}class Y extends CustomEvent{constructor(e){super("change",{detail:e})}}class K extends Y{}class J extends H{}let z,Z,X=e=>e;class ee extends($(M(k))){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:s}=S(e);return[t.toString(),s]}},this.__getItems=v((e=>{const t=S(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return g(g({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return w(z||(z=X`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return E(Z||(Z=X` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,G(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new J(this.value))}}const te=y({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"number",cond:"showsNumberField"},{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}},number:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsNumberField:e=>"number"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:U.assign({defaultCustomValue:(e,t)=>t.data}),setValue:U.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:U.assign({custom:(e,t)=>t.data}),setItems:U.assign({items:(e,t)=>t.data}),setType:U.assign({type:(e,t)=>t.data}),setMin:U.assign({min:(e,t)=>t.data}),setMax:U.assign({max:(e,t)=>t.data})}});let se,ae,ie,ne,re,le,oe,de,Ae,ue,he,ce,me,pe,ve=e=>e;const ge=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class ye extends I{constructor(){super(...arguments),this.getText=e=>e,this.__service=D(te).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":ee,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,w(ie||(ie=ve`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return g(g({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,ge]:this.items,t=Array.isArray(this.value),s=this.__service.state.matches("extension.present.selected"),a=E(ne||(ne=ve` ${0} `),e.map(((e,a,i)=>{var n;const r=this.custom&&a===i.length-1,l=r?s:t?!!(null===(n=this.value)||void 0===n?void 0:n.includes(e)):e===String(this.value),o=this.disabled||!this._isI18nReady,d=V({value:r?ge:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":o,"@change":t=>{if(this.readonly)return t.preventDefault();const s=t.target.checked,a=e===ge?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===ge?s?[...i,a]:i.slice(0,i.length-1):s?[a,...i]:i.filter((e=>e!==a)):this.value=s?a:null,this.dispatchEvent(new W(this.value))}}),A=E(re||(re=ve` <div> ${0} </div> `),e===ge?this._t("choice.other").toString():E(le||(le=ve`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return E(oe||(oe=ve` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),a?"":"hidden",t?function(e,t,s,a,i){const n="transition ease-in-out duration-200",r=`${n} transform ${s?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return E(ae||(ae=ve` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,l,d,A):function(e,t,s,a,i){const n="transition ease-in-out duration-200",r=`${n} ${t||e?"":"shadow-xs"} transform ${s?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return E(se||(se=ve` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,l,d,A),e===ge&&s?this.__field:"",e!==ge?E(de||(de=ve`<slot name="${0}"></slot>`),e):"")})));return E(Ae||(Ae=ve`<form>${0}</form> `),a)}get __field(){const e=V({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new W(this.value))}});return"frequency"===this.type?E(ue||(ue=ve`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?E(he||(he=ve`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"number"===this.type?E(ce||(ce=ve`<vaadin-number-field ...="${0}" has-controls></vaadin-number-field>`),e):"textarea"===this.type?E(me||(me=ve`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):E(pe||(pe=ve`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}const be=j`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
|
|
1
|
+
import{aq as e,ar as t,as as s,at as a,au as i,av as n,aw as r,ax as l,o,ay as d,az as A,aA as u,aB as h,aC as c,aD as m,aE as p,m as v,_ as g,aF as y}from"./shared-7fec42f2.js";import"./shared-9e8344bf.js";import"./shared-b5a0d106.js";import"./shared-937e58bf.js";import"./shared-1091aa45.js";import{T as b}from"./shared-529a82a3.js";import"./shared-7d15992f.js";import"./shared-6c25eb72.js";import{d as _,P as f,A as x,c as w,h as E,L as k}from"./shared-ba5c42c7.js";import"./shared-85feff39.js";import{O as C}from"./shared-df7d368c.js";import{p as S}from"./shared-10da9bf0.js";import{a as $,y as I,x as T,z as B}from"./shared-7a87cd33.js";import{I as M}from"./shared-0ea750af.js";import{s as V}from"./shared-53e476fd.js";import{i as D}from"./shared-e1e4d8f5.js";import"./shared-a268320e.js";import"./shared-809d503c.js";import"./shared-85ed835a.js";import{h as j,P as L}from"./shared-433eea12.js";import{E as Q,T as P}from"./shared-64e243c4.js";import{L as R}from"./shared-3615b419.js";import{C as O}from"./shared-5963a49e.js";import{b as q}from"./shared-e54135f0.js";import"./shared-e7a2b31d.js";import{a as F,F as N}from"./shared-5bcf861e.js";var U={raise:e,send:t,sendParent:s,sendUpdate:a,log:i,cancel:n,start:r,stop:l,assign:o,after:d,done:A,respond:u,forwardTo:h,escalate:c,choose:m,pure:p};const G=_((e=>t=>{const{element:s,name:a,strings:i}=t.committer;if(2!==i.length||""!==i[0]||""!==i[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof f)s[a]!==e&&t.setValue(e);else{if(!(t instanceof x))throw new Error("live directive can only be used on attributes or properties");s.getAttribute(a)!==e&&t.setValue(e)}}));class W extends CustomEvent{constructor(e){super("change",{detail:e})}}class H extends CustomEvent{constructor(e){super("change",{detail:e})}}class Y extends CustomEvent{constructor(e){super("change",{detail:e})}}class K extends Y{}class J extends H{}let z,Z,X=e=>e;class ee extends($(M(k))){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:s}=S(e);return[t.toString(),s]}},this.__getItems=v((e=>{const t=S(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return g(g({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return w(z||(z=X`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return E(Z||(Z=X` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,G(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new J(this.value))}}const te=y({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"number",cond:"showsNumberField"},{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}},number:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsNumberField:e=>"number"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:U.assign({defaultCustomValue:(e,t)=>t.data}),setValue:U.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:U.assign({custom:(e,t)=>t.data}),setItems:U.assign({items:(e,t)=>t.data}),setType:U.assign({type:(e,t)=>t.data}),setMin:U.assign({min:(e,t)=>t.data}),setMax:U.assign({max:(e,t)=>t.data})}});let se,ae,ie,ne,re,le,oe,de,Ae,ue,he,ce,me,pe,ve=e=>e;const ge=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class ye extends I{constructor(){super(...arguments),this.getText=e=>e,this.__service=D(te).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":ee,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,w(ie||(ie=ve`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return g(g({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,ge]:this.items,t=Array.isArray(this.value),s=this.__service.state.matches("extension.present.selected"),a=E(ne||(ne=ve` ${0} `),e.map(((e,a,i)=>{var n;const r=this.custom&&a===i.length-1,l=r?s:t?!!(null===(n=this.value)||void 0===n?void 0:n.includes(e)):e===String(this.value),o=this.disabled||!this._isI18nReady,d=V({value:r?ge:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":o,"@change":t=>{if(this.readonly)return t.preventDefault();const s=t.target.checked,a=e===ge?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===ge?s?[...i,a]:i.slice(0,i.length-1):s?[a,...i]:i.filter((e=>e!==a)):this.value=s?a:null,this.dispatchEvent(new W(this.value))}}),A=E(re||(re=ve` <div> ${0} </div> `),e===ge?this._t("choice.other").toString():E(le||(le=ve`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return E(oe||(oe=ve` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),a?"":"hidden",t?function(e,t,s,a,i){const n="transition ease-in-out duration-200",r=`${n} transform ${s?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return E(ae||(ae=ve` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,l,d,A):function(e,t,s,a,i){const n="transition ease-in-out duration-200",r=`${n} ${t||e?"":"shadow-xs"} transform ${s?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return E(se||(se=ve` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,l,d,A),e===ge&&s?this.__field:"",e!==ge?E(de||(de=ve`<slot name="${0}"></slot>`),e):"")})));return E(Ae||(Ae=ve`<form>${0}</form> `),a)}get __field(){const e=V({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new W(this.value))}});return"frequency"===this.type?E(ue||(ue=ve`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?E(he||(he=ve`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"number"===this.type?E(ce||(ce=ve`<vaadin-number-field ...="${0}" has-controls></vaadin-number-field>`),e):"textarea"===this.type?E(me||(me=ve`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):E(pe||(pe=ve`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}const be=j`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as e}from"./shared-
|
|
1
|
+
import{I as e}from"./shared-1e14a3fe.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,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-b5a0d106.js";import{h as e,G as t,P as r}from"./shared-433eea12.js";import{E as o,T as i,D as s}from"./shared-64e243c4.js";import{C as a}from"./shared-5963a49e.js";import"./shared-278b8790.js";import{F as l}from"./shared-5bcf861e.js";import{I as n}from"./shared-1e14a3fe.js";import"./shared-10da9bf0.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-7a87cd33.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-
|
|
1
|
+
import"./shared-529a82a3.js";import{I as e}from"./shared-1e14a3fe.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{_ as e}from"./shared-7fec42f2.js";import{L as s,h as t}from"./shared-ba5c42c7.js";import{z as r}from"./shared-
|
|
1
|
+
import{_ as e}from"./shared-7fec42f2.js";import{L as s,h as t}from"./shared-ba5c42c7.js";import{z as r}from"./shared-7a87cd33.js";let a,o=e=>e;class i extends s{constructor(){super(...arguments),this.frame=!1}static get properties(){return e(e({},super.properties),{},{frame:{type:Boolean}})}static get styles(){return r.styles}render(){return t(a||(a=o` <section class="space-y-s font-lumo antialiased"> <h3 class="${0}"> <slot name="header"></slot> </h3> <div class="rounded ${0}"> <slot></slot> </div> </section> `),"text-l font-medium text-body leading-none "+(this.frame?"":"pl-m"),this.frame?"bg-contrast-5 overflow-hidden":"")}}export{i as G};
|
|
@@ -411,6 +411,56 @@
|
|
|
411
411
|
"option_hidden": "Hidden"
|
|
412
412
|
}
|
|
413
413
|
},
|
|
414
|
+
"csp": {
|
|
415
|
+
"label": "Checkout security",
|
|
416
|
+
"helper_text": "",
|
|
417
|
+
"csp-group-one": {
|
|
418
|
+
"label": "",
|
|
419
|
+
"helper_text": "",
|
|
420
|
+
"warning": "Please review the documentation for this functionality to ensure you understand potential impacts:",
|
|
421
|
+
"csp-enable-ro-csp": {
|
|
422
|
+
"label": "Enable Report-Only Content Security Policy",
|
|
423
|
+
"helper_text": "Test your policy without blocking content. This mode logs violations of the rules below, but still allows the content to load. As with enforced mode, Foxy-managed content (e.g., gateways, analytics) is always allowed and excluded from reporting.",
|
|
424
|
+
"checked": "Yes",
|
|
425
|
+
"unchecked": "No"
|
|
426
|
+
},
|
|
427
|
+
"csp-policy-report-script-src": {
|
|
428
|
+
"label": "Custom script sources",
|
|
429
|
+
"placeholder": "example.com, *.example.com",
|
|
430
|
+
"helper_text": "",
|
|
431
|
+
"v8n_too_long": "Domain names must not exceed 1000 characters."
|
|
432
|
+
},
|
|
433
|
+
"csp-policy-report-reporting-endpoint": {
|
|
434
|
+
"label": "Reporting URL",
|
|
435
|
+
"helper_text": "",
|
|
436
|
+
"placeholder": "Optional",
|
|
437
|
+
"v8n_too_long": "This field must not exceed 1000 characters."
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
"csp-group-two": {
|
|
441
|
+
"label": "",
|
|
442
|
+
"helper_text": "",
|
|
443
|
+
"warning": "This is security-related functionality that, when enabled, can stop custom scripts from loading on your checkout. Ensure you include any domains as custom script sources above, and review the documentation for this functionality:",
|
|
444
|
+
"csp-enable-csp": {
|
|
445
|
+
"label": "Enable Content Security Policy",
|
|
446
|
+
"helper_text": "Protects your checkout page by blocking remote content that isn’t explicitly allowed. Scripts and assets loaded by Foxy (including payment gateways and analytics) are always allowed, regardless of the settings below.",
|
|
447
|
+
"checked": "Yes",
|
|
448
|
+
"unchecked": "No"
|
|
449
|
+
},
|
|
450
|
+
"csp-policy-enforce-script-src": {
|
|
451
|
+
"label": "Custom script sources",
|
|
452
|
+
"placeholder": "example.com, *.example.com",
|
|
453
|
+
"helper_text": "",
|
|
454
|
+
"v8n_too_long": "Domain names must not exceed 1000 characters."
|
|
455
|
+
},
|
|
456
|
+
"csp-policy-enforce-reporting-endpoint": {
|
|
457
|
+
"label": "Reporting URL",
|
|
458
|
+
"helper_text": "",
|
|
459
|
+
"placeholder": "Optional",
|
|
460
|
+
"v8n_too_long": "This field must not exceed 1000 characters."
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
},
|
|
414
464
|
"analytics-config": {
|
|
415
465
|
"label": "3rd-party analytics",
|
|
416
466
|
"helper_text": "",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Data } from './types';
|
|
2
2
|
import type { PropertyDeclarations } from 'lit-element';
|
|
3
3
|
import type { TemplateResult } from 'lit-html';
|
|
4
|
+
import type { NucleonV8N } from '../NucleonElement/types';
|
|
4
5
|
import { BooleanSelector } from '@foxy.io/sdk/core';
|
|
5
6
|
import { InternalForm } from '../../internal/InternalForm/InternalForm';
|
|
6
7
|
declare const Base: typeof InternalForm & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
|
|
@@ -14,6 +15,7 @@ declare const Base: typeof InternalForm & import("lit-element").Constructor<impo
|
|
|
14
15
|
*/
|
|
15
16
|
export declare class TemplateConfigForm extends Base<Data> {
|
|
16
17
|
static get properties(): PropertyDeclarations;
|
|
18
|
+
static get v8n(): NucleonV8N<Data, TemplateConfigForm>;
|
|
17
19
|
/** URI of the `fx:countries` hAPI resource with `?include_regions=true`. */
|
|
18
20
|
countries: string | null;
|
|
19
21
|
/** @deprecated URI of the `fx:regions` hAPI resource. */
|
|
@@ -38,6 +40,10 @@ export declare class TemplateConfigForm extends Base<Data> {
|
|
|
38
40
|
private readonly __checkoutTypeAccountGetValue;
|
|
39
41
|
private readonly __customConfigGetValue;
|
|
40
42
|
private readonly __customConfigSetValue;
|
|
43
|
+
private readonly __cspUsageGetValue;
|
|
44
|
+
private readonly __cspUsageSetValue;
|
|
45
|
+
private readonly __cspRoUsageGetValue;
|
|
46
|
+
private readonly __cspRoUsageSetValue;
|
|
41
47
|
private readonly __defaultJSON;
|
|
42
48
|
get hiddenSelector(): BooleanSelector;
|
|
43
49
|
renderBody(): TemplateResult;
|
|
@@ -121,6 +121,40 @@ export class TemplateConfigForm extends Base {
|
|
|
121
121
|
}
|
|
122
122
|
this.edit({ json: JSON.stringify(formJson) });
|
|
123
123
|
};
|
|
124
|
+
this.__cspUsageGetValue = () => {
|
|
125
|
+
const usage = this.__formJson.csp.usage;
|
|
126
|
+
return usage === 'enforce' || usage === 'both';
|
|
127
|
+
};
|
|
128
|
+
this.__cspUsageSetValue = (newValue) => {
|
|
129
|
+
const formJson = this.__formJson;
|
|
130
|
+
const oldUsage = formJson.csp.usage;
|
|
131
|
+
const map = {
|
|
132
|
+
false: { both: 'report', enforce: 'none' },
|
|
133
|
+
true: { report: 'both', none: 'enforce' },
|
|
134
|
+
};
|
|
135
|
+
const newUsage = map[String(newValue)][oldUsage];
|
|
136
|
+
if (newUsage) {
|
|
137
|
+
const newJson = { ...formJson, csp: { ...formJson.csp, usage: newUsage } };
|
|
138
|
+
this.edit({ json: JSON.stringify(newJson) });
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
this.__cspRoUsageGetValue = () => {
|
|
142
|
+
const usage = this.__formJson.csp.usage;
|
|
143
|
+
return usage === 'report' || usage === 'both';
|
|
144
|
+
};
|
|
145
|
+
this.__cspRoUsageSetValue = (newValue) => {
|
|
146
|
+
const formJson = this.__formJson;
|
|
147
|
+
const oldUsage = formJson.csp.usage;
|
|
148
|
+
const map = {
|
|
149
|
+
false: { both: 'enforce', report: 'none' },
|
|
150
|
+
true: { enforce: 'both', none: 'report' },
|
|
151
|
+
};
|
|
152
|
+
const newUsage = map[String(newValue)][oldUsage];
|
|
153
|
+
if (newUsage) {
|
|
154
|
+
const newJson = { ...formJson, csp: { ...formJson.csp, usage: newUsage } };
|
|
155
|
+
this.edit({ json: JSON.stringify(newJson) });
|
|
156
|
+
}
|
|
157
|
+
};
|
|
124
158
|
this.__defaultJSON = JSON.stringify(getDefaultJSON());
|
|
125
159
|
}
|
|
126
160
|
static get properties() {
|
|
@@ -131,6 +165,34 @@ export class TemplateConfigForm extends Base {
|
|
|
131
165
|
store: {},
|
|
132
166
|
};
|
|
133
167
|
}
|
|
168
|
+
static get v8n() {
|
|
169
|
+
return [
|
|
170
|
+
({ json }) => {
|
|
171
|
+
var _a, _b;
|
|
172
|
+
const formJson = json ? JSON.parse(json) : getDefaultJSON();
|
|
173
|
+
const url = (_b = (_a = formJson.csp.policy_enforce) === null || _a === void 0 ? void 0 : _a.reporting_endpoint) !== null && _b !== void 0 ? _b : '';
|
|
174
|
+
return url.length <= 1000 || 'csp-policy-enforce-reporting-endpoint:v8n_too_long';
|
|
175
|
+
},
|
|
176
|
+
({ json }) => {
|
|
177
|
+
var _a, _b;
|
|
178
|
+
const formJson = json ? JSON.parse(json) : getDefaultJSON();
|
|
179
|
+
const url = (_b = (_a = formJson.csp.policy_report) === null || _a === void 0 ? void 0 : _a.reporting_endpoint) !== null && _b !== void 0 ? _b : '';
|
|
180
|
+
return url.length <= 1000 || 'csp-policy-report-reporting-endpoint:v8n_too_long';
|
|
181
|
+
},
|
|
182
|
+
({ json }) => {
|
|
183
|
+
var _a, _b;
|
|
184
|
+
const formJson = json ? JSON.parse(json) : getDefaultJSON();
|
|
185
|
+
const domains = (_b = (_a = formJson.csp.policy_enforce) === null || _a === void 0 ? void 0 : _a.script_src) !== null && _b !== void 0 ? _b : [];
|
|
186
|
+
return domains.every(d => d.length <= 1000) || 'csp-policy-enforce-script-src:v8n_too_long';
|
|
187
|
+
},
|
|
188
|
+
({ json }) => {
|
|
189
|
+
var _a, _b;
|
|
190
|
+
const formJson = json ? JSON.parse(json) : getDefaultJSON();
|
|
191
|
+
const domains = (_b = (_a = formJson.csp.policy_report) === null || _a === void 0 ? void 0 : _a.script_src) !== null && _b !== void 0 ? _b : [];
|
|
192
|
+
return domains.every(d => d.length <= 1000) || 'csp-policy-report-script-src:v8n_too_long';
|
|
193
|
+
},
|
|
194
|
+
];
|
|
195
|
+
}
|
|
134
196
|
get hiddenSelector() {
|
|
135
197
|
var _a, _b;
|
|
136
198
|
const alwaysHidden = [super.hiddenSelector.toString()];
|
|
@@ -181,7 +243,7 @@ export class TemplateConfigForm extends Base {
|
|
|
181
243
|
return new BooleanSelector(alwaysHidden.join(' ').trim());
|
|
182
244
|
}
|
|
183
245
|
renderBody() {
|
|
184
|
-
var _a, _b, _c, _d, _e;
|
|
246
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
185
247
|
const customCheckoutFieldRequirementsControls = [
|
|
186
248
|
[
|
|
187
249
|
'billing_address1',
|
|
@@ -204,6 +266,8 @@ export class TemplateConfigForm extends Base {
|
|
|
204
266
|
['show_product_weight', 'show_product_category', 'show_product_code', 'show_product_options'],
|
|
205
267
|
['show_sub_frequency', 'show_sub_startdate', 'show_sub_nextdate', 'show_sub_enddate'],
|
|
206
268
|
];
|
|
269
|
+
const formCspUsage = this.__formJson.csp.usage;
|
|
270
|
+
const dataCspUsage = (_b = (_a = this.__dataJson) === null || _a === void 0 ? void 0 : _a.csp) === null || _b === void 0 ? void 0 : _b.usage;
|
|
207
271
|
return html `
|
|
208
272
|
${this.renderHeader()}
|
|
209
273
|
|
|
@@ -354,7 +418,7 @@ export class TemplateConfigForm extends Base {
|
|
|
354
418
|
<foxy-internal-template-config-form-filter-values-control
|
|
355
419
|
json-template=${this.__defaultJSON}
|
|
356
420
|
json-path="location_filtering.shipping_filter_values"
|
|
357
|
-
countries=${ifDefined((
|
|
421
|
+
countries=${ifDefined((_c = this.countries) !== null && _c !== void 0 ? _c : void 0)}
|
|
358
422
|
property="json"
|
|
359
423
|
infer="location-filtering-filter-values"
|
|
360
424
|
.setValue=${this.__locationFilteringFilterValuesSetValue}
|
|
@@ -376,7 +440,7 @@ export class TemplateConfigForm extends Base {
|
|
|
376
440
|
<foxy-internal-template-config-form-filter-values-control
|
|
377
441
|
json-template=${this.__defaultJSON}
|
|
378
442
|
json-path="location_filtering.shipping_filter_values"
|
|
379
|
-
countries=${ifDefined((
|
|
443
|
+
countries=${ifDefined((_d = this.countries) !== null && _d !== void 0 ? _d : void 0)}
|
|
380
444
|
property="json"
|
|
381
445
|
infer="location-filtering-shipping-filter-values"
|
|
382
446
|
>
|
|
@@ -397,7 +461,7 @@ export class TemplateConfigForm extends Base {
|
|
|
397
461
|
<foxy-internal-template-config-form-filter-values-control
|
|
398
462
|
json-template=${this.__defaultJSON}
|
|
399
463
|
json-path="location_filtering.billing_filter_values"
|
|
400
|
-
countries=${ifDefined((
|
|
464
|
+
countries=${ifDefined((_e = this.countries) !== null && _e !== void 0 ? _e : void 0)}
|
|
401
465
|
property="json"
|
|
402
466
|
infer="location-filtering-billing-filter-values"
|
|
403
467
|
>
|
|
@@ -566,6 +630,120 @@ export class TemplateConfigForm extends Base {
|
|
|
566
630
|
})}
|
|
567
631
|
</div>
|
|
568
632
|
|
|
633
|
+
<foxy-internal-summary-control infer="csp" class="space-y-m" layout="section">
|
|
634
|
+
<foxy-internal-summary-control infer="csp-group-one">
|
|
635
|
+
<foxy-internal-switch-control
|
|
636
|
+
json-template=${this.__defaultJSON}
|
|
637
|
+
json-path="csp.usage"
|
|
638
|
+
property="json"
|
|
639
|
+
infer="csp-enable-ro-csp"
|
|
640
|
+
.getValue=${this.__cspRoUsageGetValue}
|
|
641
|
+
.setValue=${this.__cspRoUsageSetValue}
|
|
642
|
+
>
|
|
643
|
+
</foxy-internal-switch-control>
|
|
644
|
+
|
|
645
|
+
${formCspUsage === 'report' || formCspUsage === 'both'
|
|
646
|
+
? html `
|
|
647
|
+
<foxy-internal-text-control
|
|
648
|
+
json-template=${this.__defaultJSON}
|
|
649
|
+
json-path="csp.policy_report.reporting_endpoint"
|
|
650
|
+
property="json"
|
|
651
|
+
layout="summary-item"
|
|
652
|
+
infer="csp-policy-report-reporting-endpoint"
|
|
653
|
+
>
|
|
654
|
+
</foxy-internal-text-control>
|
|
655
|
+
|
|
656
|
+
<foxy-internal-editable-list-control
|
|
657
|
+
json-template=${this.__defaultJSON}
|
|
658
|
+
json-path="csp.policy_report.script_src"
|
|
659
|
+
property="json"
|
|
660
|
+
layout="summary-item"
|
|
661
|
+
infer="csp-policy-report-script-src"
|
|
662
|
+
simple-value
|
|
663
|
+
>
|
|
664
|
+
</foxy-internal-editable-list-control>
|
|
665
|
+
|
|
666
|
+
${dataCspUsage === 'none' || dataCspUsage === 'enforce'
|
|
667
|
+
? html `
|
|
668
|
+
<div
|
|
669
|
+
class="flex items-start bg-primary-10"
|
|
670
|
+
style="gap: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
|
|
671
|
+
>
|
|
672
|
+
${svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z" clip-rule="evenodd" /></svg>`}
|
|
673
|
+
<p>
|
|
674
|
+
<foxy-i18n infer="" key="warning"></foxy-i18n>
|
|
675
|
+
<a
|
|
676
|
+
target="_blank"
|
|
677
|
+
class="inline-block rounded font-medium text-primary transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50"
|
|
678
|
+
href="https://wiki.foxycart.com/v/2.0/content_security_policy"
|
|
679
|
+
>
|
|
680
|
+
wiki.foxycart.com
|
|
681
|
+
</a>
|
|
682
|
+
</p>
|
|
683
|
+
</div>
|
|
684
|
+
`
|
|
685
|
+
: ''}
|
|
686
|
+
`
|
|
687
|
+
: ''}
|
|
688
|
+
</foxy-internal-summary-control>
|
|
689
|
+
|
|
690
|
+
<foxy-internal-summary-control infer="csp-group-two">
|
|
691
|
+
<foxy-internal-switch-control
|
|
692
|
+
json-template=${this.__defaultJSON}
|
|
693
|
+
json-path="csp.usage"
|
|
694
|
+
property="json"
|
|
695
|
+
infer="csp-enable-csp"
|
|
696
|
+
.getValue=${this.__cspUsageGetValue}
|
|
697
|
+
.setValue=${this.__cspUsageSetValue}
|
|
698
|
+
>
|
|
699
|
+
</foxy-internal-switch-control>
|
|
700
|
+
|
|
701
|
+
${formCspUsage === 'enforce' || formCspUsage === 'both'
|
|
702
|
+
? html `
|
|
703
|
+
<foxy-internal-text-control
|
|
704
|
+
json-template=${this.__defaultJSON}
|
|
705
|
+
json-path="csp.policy_enforce.reporting_endpoint"
|
|
706
|
+
property="json"
|
|
707
|
+
layout="summary-item"
|
|
708
|
+
infer="csp-policy-enforce-reporting-endpoint"
|
|
709
|
+
>
|
|
710
|
+
</foxy-internal-text-control>
|
|
711
|
+
|
|
712
|
+
<foxy-internal-editable-list-control
|
|
713
|
+
json-template=${this.__defaultJSON}
|
|
714
|
+
json-path="csp.policy_enforce.script_src"
|
|
715
|
+
property="json"
|
|
716
|
+
layout="summary-item"
|
|
717
|
+
infer="csp-policy-enforce-script-src"
|
|
718
|
+
simple-value
|
|
719
|
+
>
|
|
720
|
+
</foxy-internal-editable-list-control>
|
|
721
|
+
|
|
722
|
+
${dataCspUsage === 'none' || dataCspUsage === 'report'
|
|
723
|
+
? html `
|
|
724
|
+
<div
|
|
725
|
+
class="flex items-start bg-error-10"
|
|
726
|
+
style="gap: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
|
|
727
|
+
>
|
|
728
|
+
${svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clip-rule="evenodd" /></svg>`}
|
|
729
|
+
<p>
|
|
730
|
+
<foxy-i18n infer="" key="warning"></foxy-i18n>
|
|
731
|
+
<a
|
|
732
|
+
target="_blank"
|
|
733
|
+
class="inline-block rounded font-medium text-error transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-error-50"
|
|
734
|
+
href="https://wiki.foxycart.com/v/2.0/content_security_policy"
|
|
735
|
+
>
|
|
736
|
+
wiki.foxycart.com
|
|
737
|
+
</a>
|
|
738
|
+
</p>
|
|
739
|
+
</div>
|
|
740
|
+
`
|
|
741
|
+
: ''}
|
|
742
|
+
`
|
|
743
|
+
: ''}
|
|
744
|
+
</foxy-internal-summary-control>
|
|
745
|
+
</foxy-internal-summary-control>
|
|
746
|
+
|
|
569
747
|
<foxy-internal-summary-control infer="analytics-config">
|
|
570
748
|
<foxy-internal-switch-control
|
|
571
749
|
json-template=${this.__defaultJSON}
|
|
@@ -715,7 +893,7 @@ export class TemplateConfigForm extends Base {
|
|
|
715
893
|
<foxy-nucleon
|
|
716
894
|
class="hidden"
|
|
717
895
|
infer=""
|
|
718
|
-
href=${ifDefined((
|
|
896
|
+
href=${ifDefined((_f = this.store) !== null && _f !== void 0 ? _f : (_g = this.data) === null || _g === void 0 ? void 0 : _g._links['fx:store'].href)}
|
|
719
897
|
id="storeLoader"
|
|
720
898
|
@update=${() => this.requestUpdate()}
|
|
721
899
|
>
|