@foxy.io/elements 1.13.0-beta.3 → 1.14.0-beta.3
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-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +2 -2
- 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-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -0
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-query-builder.js +2 -2
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +24 -7
- 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-form.js +1 -0
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/{shared-b98f88c9.js → shared-04b77f79.js} +1 -1
- package/dist/cdn/{shared-bf09e011.js → shared-1108653b.js} +23 -18
- package/dist/cdn/{shared-d4dad105.js → shared-14788132.js} +1 -1
- package/dist/cdn/{shared-54702b33.js → shared-27d93838.js} +1 -1
- package/dist/cdn/shared-2b2b56f6.js +1 -0
- package/dist/cdn/{shared-91a9e922.js → shared-2d99835c.js} +4 -4
- package/dist/cdn/{shared-f47647ac.js → shared-302d8a7b.js} +1 -1
- package/dist/cdn/{shared-5fedf5e4.js → shared-3534b284.js} +2 -2
- package/dist/cdn/shared-3553ff4d.js +1 -0
- package/dist/cdn/{shared-4059f633.js → shared-3e14c0d2.js} +1 -1
- package/dist/cdn/{shared-45d647e4.js → shared-46ee137f.js} +1 -1
- package/dist/cdn/{shared-296637c5.js → shared-4ee97558.js} +1 -1
- package/dist/cdn/{shared-d9159fe1.js → shared-57522229.js} +1 -1
- package/dist/cdn/{shared-2860a3d3.js → shared-59a0cb0f.js} +2 -2
- package/dist/cdn/{shared-cd700eac.js → shared-60126eee.js} +1 -1
- package/dist/cdn/{shared-84fa75d9.js → shared-652ef7fe.js} +1 -1
- package/dist/cdn/{shared-036a8b21.js → shared-72678c5d.js} +1 -1
- package/dist/cdn/shared-7fd12533.js +1 -0
- package/dist/cdn/shared-82dd0556.js +15 -0
- package/dist/cdn/{shared-67157a25.js → shared-84df58e1.js} +1 -1
- package/dist/cdn/{shared-ed4ed7a5.js → shared-8e38d64f.js} +2 -2
- package/dist/cdn/{shared-54c485d2.js → shared-92442eb1.js} +21 -21
- package/dist/cdn/{shared-98ee7fad.js → shared-94c83b2b.js} +1 -1
- package/dist/cdn/{shared-4a990126.js → shared-a0c2bbe0.js} +1 -1
- package/dist/cdn/{shared-e55b6bb7.js → shared-a21a7562.js} +1 -1
- package/dist/cdn/{shared-f0199313.js → shared-a4410f22.js} +1 -1
- package/dist/cdn/{shared-e0248713.js → shared-a71bd9f0.js} +1 -1
- package/dist/cdn/{shared-e9920617.js → shared-acf49ecc.js} +1 -1
- package/dist/cdn/{shared-cf248335.js → shared-b8349f79.js} +1 -1
- package/dist/cdn/{shared-f2cf6cfb.js → shared-bbc97ae0.js} +1 -1
- package/dist/cdn/shared-bec929ac.js +1 -0
- package/dist/cdn/{shared-145cc9eb.js → shared-c7f352fa.js} +5 -5
- package/dist/cdn/{shared-f4119f12.js → shared-d196432b.js} +1 -1
- package/dist/cdn/shared-d19e2399.js +1 -0
- package/dist/cdn/{shared-17968c53.js → shared-d97a6ee5.js} +0 -0
- package/dist/cdn/{shared-3ae39e52.js → shared-dce03b47.js} +3 -3
- package/dist/cdn/{shared-a99dea97.js → shared-dd66b354.js} +1 -1
- package/dist/cdn/{shared-b77179fd.js → shared-e969772e.js} +1 -1
- package/dist/cdn/{shared-e5de8675.js → shared-fda14a3d.js} +1 -1
- package/dist/cdn/{shared-747b0842.js → shared-ff79f3f9.js} +1 -1
- package/dist/cdn/translations/shared/en.json +11 -0
- package/dist/elements/private/Choice/Choice.js +0 -2
- package/dist/elements/private/Choice/Choice.js.map +1 -1
- package/dist/elements/private/I18N/I18N.js +1 -1
- package/dist/elements/private/I18N/I18N.js.map +1 -1
- package/dist/elements/public/AddressForm/AddressForm.js +8 -4
- package/dist/elements/public/AddressForm/AddressForm.js.map +1 -1
- package/dist/elements/public/AttributeForm/AttributeForm.js +8 -4
- package/dist/elements/public/AttributeForm/AttributeForm.js.map +1 -1
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +8 -4
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -1
- package/dist/elements/public/CustomerForm/CustomerForm.js +8 -4
- package/dist/elements/public/CustomerForm/CustomerForm.js.map +1 -1
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.d.ts +24 -0
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +311 -0
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -0
- package/dist/elements/public/EmailTemplateForm/index.d.ts +9 -0
- package/dist/elements/public/EmailTemplateForm/index.js +11 -0
- package/dist/elements/public/EmailTemplateForm/index.js.map +1 -0
- package/dist/elements/public/EmailTemplateForm/types.d.ts +3 -0
- package/dist/elements/public/EmailTemplateForm/types.js +2 -0
- package/dist/elements/public/EmailTemplateForm/types.js.map +1 -0
- package/dist/elements/public/ItemsForm/ItemsForm.js +2 -2
- package/dist/elements/public/ItemsForm/ItemsForm.js.map +1 -1
- package/dist/elements/public/NucleonElement/serveFromCache.js +1 -0
- package/dist/elements/public/NucleonElement/serveFromCache.js.map +1 -1
- package/dist/elements/public/TaxForm/TaxForm.js +8 -4
- package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
- package/dist/elements/public/TemplateForm/TemplateForm.d.ts +23 -0
- package/dist/elements/public/TemplateForm/TemplateForm.js +303 -0
- package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -0
- package/dist/elements/public/TemplateForm/index.d.ts +9 -0
- package/dist/elements/public/TemplateForm/index.js +11 -0
- package/dist/elements/public/TemplateForm/index.js.map +1 -0
- package/dist/elements/public/TemplateForm/types.d.ts +3 -0
- package/dist/elements/public/TemplateForm/types.js +2 -0
- package/dist/elements/public/TemplateForm/types.js.map +1 -0
- package/dist/elements/public/index.d.ts +2 -0
- package/dist/elements/public/index.defined.d.ts +2 -0
- package/dist/elements/public/index.defined.js +2 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +2 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/themeable.js +43 -12
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +2 -7
- package/dist/cdn/shared-50744508.js +0 -15
- package/dist/cdn/shared-b0b1d248.js +0 -1
- package/dist/cdn/shared-c0161e6a.js +0 -1
- package/dist/cdn/shared-c1e0e11f.js +0 -1
- package/dist/cdn/shared-dbcffd8e.js +0 -1
- package/dist/cdn/shared-e21a2aac.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{P as e,h as t}from"./shared-
|
|
1
|
+
import{P as e,h as t}from"./shared-ff79f3f9.js";import{E as s,T as i}from"./shared-04b77f79.js";import"./shared-46ee137f.js";import"./shared-a71bd9f0.js";import{r as n,S as a,C as o}from"./shared-1108653b.js";import{j as r,h as l,_ as d,w as c}from"./shared-d97a6ee5.js";import"./shared-92442eb1.js";import"./shared-60126eee.js";import"./foxy-cancellation-form.js";import"./shared-652ef7fe.js";import"./foxy-collection-pages.js";import"./foxy-form-dialog.js";import{P as u}from"./shared-4ee97558.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./foxy-i18n.js";import{C as h}from"./shared-a4410f22.js";import{S as m,T as f,a as p}from"./shared-2b2b56f6.js";import"./shared-bec929ac.js";import"./shared-dce03b47.js";import{G as y}from"./shared-dd66b354.js";import{c as b}from"./shared-4e709717.js";import{p as g}from"./shared-fda14a3d.js";import{j as _}from"./shared-d19e2399.js";import"./foxy-nucleon-element.js";import{T as v}from"./shared-2d99835c.js";import{i as x}from"./shared-94c83b2b.js";import{p as $}from"./shared-7fd12533.js";import{s as w}from"./shared-2061be9a.js";import{N as S}from"./shared-b8349f79.js";import"./shared-82dd0556.js";import"./shared-87ca7818.js";import"./shared-27d93838.js";import"./shared-3553ff4d.js";import"./shared-bbc97ae0.js";import"./shared-14788132.js";import"./shared-7684cb05.js";import"./foxy-collection-page.js";import"./shared-8e38d64f.js";import"./shared-72678c5d.js";import"./shared-302d8a7b.js";import"./shared-57522229.js";n("vcf-tooltip",r`
|
|
2
2
|
:host {
|
|
3
3
|
/* Sizing */
|
|
4
4
|
--lumo-tooltip-size: var(--lumo-size-m);
|
|
5
5
|
/* Style */
|
|
6
6
|
font-family: var(--lumo-font-family);
|
|
7
|
-
font-size: var(--lumo-font-size-
|
|
8
|
-
|
|
7
|
+
font-size: var(--lumo-font-size-s, 0.875rem);
|
|
8
|
+
line-height: var(--lumo-line-height-s, 1.375);
|
|
9
9
|
cursor: default;
|
|
10
10
|
-webkit-tap-highlight-color: transparent;
|
|
11
11
|
-webkit-font-smoothing: antialiased;
|
|
@@ -24,8 +24,16 @@ import{P as e,h as t}from"./shared-747b0842.js";import{E as s,T as i}from"./shar
|
|
|
24
24
|
-ms-user-select: none;
|
|
25
25
|
-webkit-user-select: none;
|
|
26
26
|
user-select: none;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
|
|
28
|
+
--tooltip-animation-duration: 250ms;
|
|
29
|
+
--tooltip-delay: 500ms;
|
|
30
|
+
animation: tooltipFadeIn var(--tooltip-animation-duration);
|
|
31
|
+
animation-delay: var(--tooltip-delay);
|
|
32
|
+
animation-fill-mode: both;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([manual]) {
|
|
36
|
+
--tooltip-delay: 0;
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
:host([close-button]) [part='close-button'] {
|
|
@@ -55,7 +63,7 @@ import{P as e,h as t}from"./shared-747b0842.js";import{E as s,T as i}from"./shar
|
|
|
55
63
|
color: var(--lumo-body-text-color);
|
|
56
64
|
background-color: var(--lumo-base-color);
|
|
57
65
|
border-radius: var(--lumo-border-radius);
|
|
58
|
-
|
|
66
|
+
box-shadow: var(--lumo-box-shadow-xs);
|
|
59
67
|
}
|
|
60
68
|
|
|
61
69
|
:host([hidden]) [part='content'] {
|
|
@@ -65,6 +73,15 @@ import{P as e,h as t}from"./shared-747b0842.js";import{E as s,T as i}from"./shar
|
|
|
65
73
|
:host ::slotted(*) {
|
|
66
74
|
box-sizing: border-box;
|
|
67
75
|
}
|
|
76
|
+
|
|
77
|
+
@keyframes tooltipFadeIn {
|
|
78
|
+
0% {
|
|
79
|
+
opacity: 0;
|
|
80
|
+
}
|
|
81
|
+
100% {
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
68
85
|
</style>
|
|
69
86
|
|
|
70
87
|
<div part="container" theme$="[[theme]]">
|
|
@@ -75,7 +92,7 @@ import{P as e,h as t}from"./shared-747b0842.js";import{E as s,T as i}from"./shar
|
|
|
75
92
|
<iron-icon icon="lumo:cross"></iron-icon>
|
|
76
93
|
</vaadin-button>
|
|
77
94
|
</div>
|
|
78
|
-
`}static get is(){return"vcf-tooltip"}static get version(){return"1.3.14"}static get properties(){return{for:{type:String},position:{type:String,value:"top"},align:{type:String,value:"center"},hidden:{type:Boolean,value:!0,notify:!0,reflectToAttribute:!0,observer:"_hiddenChanged"},manual:{type:Boolean,value:!1,reflectToAttribute:!0},targetElement:{type:Object,observer:"_attachToTarget"},closeButton:{type:Boolean,value:!1,reflectToAttribute:!0},theme:{type:String,reflectToAttribute:!0}}}static get observers(){return["_setPosition(targetElement, hidden, position, align)","_updateTarget(for)","_manualObserver(manual)"]}constructor(){super(),this._boundShow=this.show.bind(this),this._boundHide=this.hide.bind(this),this._boundOnKeyup=this._onKeyup.bind(this)}connectedCallback(){super.connectedCallback(),this._attachToTarget(),this._setDefaultId()}ready(){super.ready(),window.addEventListener("resize",(()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const{targetElement:e,hidden:t,position:s}=this;this.hidden||this._setPosition(e,t,s)}),100)})),this.getAttribute("theme")||this.setAttribute("theme","dark")}disconnectedCallback(){super.disconnectedCallback(),this._detachFromTarget()}_manualObserver(){this.manual?this._removeEvents():this._addEvents()}_attachToTarget(e,t){t&&(this._removeTargetEvents(t),t.describedby&&(t.removeAttribute("aria-describedby"),delete t.describedby)),e&&(this._addEvents(),e.getAttribute("aria-describedby")||(e.setAttribute("aria-describedby",this.id),e.describedby=!0))}_addEvents(){this.targetElement&&!this.manual&&(this.targetElement.addEventListener("mouseenter",this._boundShow),this.targetElement.addEventListener("focus",this._boundShow),this.targetElement.addEventListener("mouseleave",this._boundHide),this.targetElement.addEventListener("blur",this._boundHide),this.targetElement.addEventListener("tap",this._boundHide)),this.manual||(this.addEventListener("mouseenter",this._boundShow),this.addEventListener("mouseleave",this._boundHide))}_detachFromTarget(){this.manual||this._removeEvents(),this.targetElement&&this.targetElement.describedby&&(this.targetElement.removeAttribute("aria-describedby"),delete this.targetElement.describedby)}_removeEvents(){this.targetElement&&this._removeTargetEvents(this.targetElement),this.removeEventListener("mouseenter",this._boundShow),this.removeEventListener("mouseleave",this._boundHide)}_removeTargetEvents(e){e.removeEventListener("mouseenter",this._boundShow),e.removeEventListener("focus",this._boundShow),e.removeEventListener("mouseleave",this._boundHide),e.removeEventListener("blur",this._boundHide),e.removeEventListener("tap",this._boundHide)}_updateTarget(){this.targetElement=this.parentNode.querySelector(`#${this.for}`)}_setPosition(e,t,s){if(e&&!t){let e=window.innerHeight,t=window.innerWidth;this.offsetParent&&(e=this.offsetParent.scrollHeight,t=this.offsetParent.scrollWidth);const i=this.targetElement.getBoundingClientRect(),n=this.getBoundingClientRect(),a=(i.width-n.width)/2,o=(i.height-n.height)/2;let r,l,d=i.left,c=i.top,u=window.pageYOffset;switch(this._parentPostioned&&(c=this.targetElement.offsetTop,d=this.targetElement.offsetLeft,u=0),s){case"top":l=c-n.height+u,r=this._calculateLeft(d,i,n,a);break;case"bottom":l=c+i.height+u,r=this._calculateLeft(d,i,n,a);break;case"left":r=d-n.width,l=this._calculateTop(c,i,n,o,u);break;case"right":r=d+i.width,l=this._calculateTop(c,i,n,o,u)}this._setPositionInVisibleBounds(e,t,r,l,n)}}get _parentPostioned(){return"static"!==window.getComputedStyle(this.offsetParent).position}_setPositionInVisibleBounds(e,t,s,i,n){s+n.width>t?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,s)+"px",this.style.right="auto"),i+n.height>e?(this.style.bottom=e+"px",this.style.top="auto"):(this.style.top=Math.max(0,i)+"px",this.style.bottom="auto")}_calculateLeft(e,t,s,i){switch(this.align){case"left":return e;case"right":return t.left+t.width-s.width;default:return e+i}}_calculateTop(e,t,s,i,n){switch(this.align){case"top":return e+n;case"bottom":return e+t.height-s.height+n;default:return e+i+n}}show(){this.hidden=!1}hide(){this.hidden=!0}_hiddenChanged(e){e?(this.setAttribute("aria-hidden",!0),window.removeEventListener("keyup",this._boundOnKeyup)):(this.setAttribute("aria-hidden",!1),window.addEventListener("keyup",this._boundOnKeyup))}_onKeyup(e){27===e.keyCode&&this.hide()}_setDefaultId(){this.id||(Vaadin.tooltipIndex||(Vaadin.tooltipIndex=0),this.id="vcf-tooltip"+ ++Vaadin.tooltipIndex)}}function T(e){return function*(e){const t=[];for(const s of e.settings.subscriptions.allowFrequencyModification)if(_(s.jsonataQuery).evaluate(e.subscription))for(const e of s.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}customElements.define(E.is,E),window.Vaadin.VcfTooltip=E;class j extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function q(e){const t=864e5,s=31*t;if(".5m"===e)return s/2;const i=parseInt(e.substring(0,e.length-1));if(isNaN(i))throw new j(e);if(e.endsWith("y"))return 31536e6*i;if(e.endsWith("m"))return i*s;if(e.endsWith("w"))return 6048e5*i;if(e.endsWith("d"))return i*t;throw new j(e)}function D(e,t){if("boolean"==typeof t)return t;const s=t.filter((t=>Boolean(_(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var s,i,n,a,o;if(t.min){const s=e.min?q(e.min):1/0;q(t.min)<s&&(e.min=t.min)}if(t.max){const s=e.max?q(e.max):-1/0;q(t.max)>s&&(e.max=t.max)}if("day"===(null===(s=t.allowedDays)||void 0===s?void 0:s.type)){const s=[...null!==(i=e.allowedDaysOfWeek)&&void 0!==i?i:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(s))}if("month"===(null===(n=t.allowedDays)||void 0===n?void 0:n.type)){const s=[...null!==(a=e.allowedDaysOfMonth)&&void 0!==a?a:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(s))}if(t.disallowedDates){const s=[...null!==(o=e.disallowedDates)&&void 0!==o?o:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(s))}return e}),{});return 0!==Object.keys(s).length&&s}function k(e){const[t,s,i]=e.split("-").map((e=>parseInt(e)));return new Date(t,s-1,i)}function O(e){const t=e.settings.subscriptions.allow_next_date_modification;let s;return s="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,s;const i=k(e.value),n=i.getTime(),a=D(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof a)return a;if(!1===(null===(t=a.allowedDaysOfMonth)||void 0===t?void 0:t.includes(i.getDate())))return!1;if(!1===(null===(s=a.allowedDaysOfWeek)||void 0===s?void 0:s.includes(i.getDay())))return!1;if(a.disallowedDates&&a.disallowedDates.find((e=>{const[t,s]=e.split("..").map((e=>k(e).getTime()));return n===t||void 0!==s&&n>=t&&n<=s})))return!1;if(a.min){const e=g(a.min);if(null!==e&&Date.now()+e>=n)return!1}if(a.max){const e=g(a.max);if(null!==e&&Date.now()+e<=n)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:s}},subscription:e.subscription,value:e.value})}const A=["html"];let L,z,C,I,N,H,P,F,V,B,M,W,K,Q,R,J,G,Y,U,X,Z,ee=e=>e;const te=m(f(h(p(S,"subscription-form"))));class se extends te{constructor(){super(...arguments),this.settings=null,this.templates={},this.__renderHeaderSubtitle=()=>{var e;const{data:t,lang:s,ns:i}=this;if(t){let n,a,o="text-secondary";if(t.first_failed_transaction_date)o="text-error",n=t.first_failed_transaction_date,a="subscription_failed";else if(t.end_date){n=t.end_date;a=new Date(n).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}else n=null!==(e=t.next_transaction_date)&&void 0!==e?e:(new Date).toISOString(),a="subscription_"+(t.is_active?"active":"inactive");const r=l(L||(L=ee` <foxy-i18n data-testid="header-subtitle" options="${0}" class="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify({date:n}),o,s,a,i);return t.first_failed_transaction_date?l(z||(z=ee` <span id="status" class="flex items-center space-x-xs ${0}"> ${0}<iron-icon icon="icons:info-outline" class="icon-inline"></iron-icon> </span> <vcf-tooltip for="status" position="bottom"> <span class="text-s">${0}</span> </vcf-tooltip> `),o,r,t.error_message):r}return l(C||(C=ee`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeaderTitle=()=>{const{data:e,lang:t,ns:s}=this;if(e){const i=$(e.frequency),n=e._embedded["fx:last_transaction"].currency_code,a=e._embedded["fx:last_transaction"].total_order;return l(I||(I=ee` <foxy-i18n data-testid="header-title" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(d(d({},i),{},{amount:`${a} ${n}`})),t,".5m"===e.frequency?"twice_a_month":"recurring",s)}return l(N||(N=ee`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeader=()=>l(H||(H=ee` <div data-testid="header"> ${0} <div class="leading-xs text-xxl font-bold">${0}</div> <div class="leading-xs text-l">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.__renderHeaderTitle(),this.__renderHeaderSubtitle(),this.renderTemplateOrSlot("header:after")),this.__renderItemsActions=()=>l(P||(P=ee` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItemsItem=e=>{const t=e.price.toLocaleString(this.lang||"en",{style:"currency",currency:this.data._embedded["fx:last_transaction"].currency_code});let s;return s=e.quantity>1?l(F||(F=ee` <div data-testclass="item-quantity" class="px-s h-xs rounded bg-contrast-5 flex items-center font-tnum text-contrast text-s font-bold"> ${0} </div> `),e.quantity):l(V||(V=ee``)),l(B||(B=ee` <figure class="flex items-center space-x-m py-s pr-m" data-testclass="item"> <x-preview data-testclass="item-preview" class="w-l h-l" .quantity="${0}" .image="${0}"> </x-preview> <figcaption class="leading-s flex-1 flex justify-between items-center"> <div class="flex flex-col"> <span class="font-medium" data-testclass="item-name">${0}</span> <span class="text-secondary text-s" data-testclass="item-price">${0}</span> </div> ${0} </figcaption> </figure> `),e.quantity,e.image,e.name,t,s)},this.__renderItems=()=>{var e,t;const s=this.hiddenSelector,i=null!==(t=null===(e=this.data)||void 0===e?void 0:e._embedded["fx:transaction_template"]._embedded["fx:items"])&&void 0!==t?t:[],n=s.matches("items:actions",!0)?"":this.__renderItemsActions();return l(M||(M=ee` <div data-testid="items"> ${0} <x-group frame> <div slot="header">${0}</div> <div class="divide-y divide-contrast-10 pl-s">${0}</div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("items:before"),n,i.map(this.__renderItemsItem),this.renderTemplateOrSlot("items:after"))},this.__renderEndDate=()=>{const{disabledSelector:e,lang:t,ns:s}=this,i=this.hiddenSelector.zoom("end-date:form").toString();return l(W||(W=ee` <div> ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="save-button ${0}" data-testid="cancellation-form" parent="${0}" header="end_subscription" alert form="foxy-cancellation-form" href="${0}" lang="${0}" id="end-date-form" ns="${0}" .templates="${0}"> </foxy-form-dialog> <vaadin-button data-testid="end-date" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="end_subscription" ns="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),this.readonlySelector.zoom("end-date:form").toString(),e.zoom("end-date:form").toString(),i,this.parent,this.href,t,s,this.getNestedTemplates("end-date:form"),!this.data||e.matches("end-date",!0),(e=>{this.renderRoot.querySelector("#end-date-form").show(e.currentTarget)}),s,t,this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:s}=this;if(t&&s){return O({value:w(e),settings:t,subscription:s})}return e.getTime()>=Date.now()},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:s}=this,i=!!(null==e?void 0:e.is_active);return l(K||(K=ee` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),s,t,x(null==e?void 0:e.next_transaction_date.substr(0,10)),x(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),s=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",$(e)),value:e})));return l(Q||(Q=ee` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),x(this.form.frequency),s,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:s,ns:i}=this;return l(R||(R=ee` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,s,se.defaultNS,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>l(J||(J=ee` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify($(e)),e,s,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>l(G||(G=ee` <div> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__transactionsTableColumns=[{cell(e){var t;const s=v.statusColumn.cell(e),i=v.priceColumn.cell(e),n=null!==(t={declined:"text-error",rejected:"text-error"}[e.data.status])&&void 0!==t?t:"text-body";return e.html(Y||(Y=ee`
|
|
95
|
+
`}static get is(){return"vcf-tooltip"}static get version(){return"1.3.15"}static get properties(){return{for:{type:String},position:{type:String,value:"top"},align:{type:String,value:"center"},hidden:{type:Boolean,value:!0,notify:!0,reflectToAttribute:!0,observer:"_hiddenChanged"},manual:{type:Boolean,value:!1,reflectToAttribute:!0},targetElement:{type:Object,observer:"_attachToTarget"},closeButton:{type:Boolean,value:!1,reflectToAttribute:!0},theme:{type:String,reflectToAttribute:!0}}}static get observers(){return["_setPosition(targetElement, hidden, position, align)","_updateTarget(for)","_manualObserver(manual)"]}constructor(){super(),this._boundShow=this.show.bind(this),this._boundHide=this.hide.bind(this),this._boundOnKeyup=this._onKeyup.bind(this)}connectedCallback(){super.connectedCallback(),this._attachToTarget(),this._setDefaultId()}ready(){super.ready(),window.addEventListener("resize",(()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const{targetElement:e,hidden:t,position:s}=this;this.hidden||this._setPosition(e,t,s)}),100)})),this.getAttribute("theme")||this.setAttribute("theme","dark")}disconnectedCallback(){super.disconnectedCallback(),this._detachFromTarget()}_manualObserver(){this.manual?this._removeEvents():this._addEvents()}_attachToTarget(e,t){t&&(this._removeTargetEvents(t),t.describedby&&(t.removeAttribute("aria-describedby"),delete t.describedby)),e&&(this._addEvents(),e.getAttribute("aria-describedby")||(e.setAttribute("aria-describedby",this.id),e.describedby=!0))}_addEvents(){this.targetElement&&!this.manual&&(this.targetElement.addEventListener("mouseenter",this._boundShow),this.targetElement.addEventListener("focus",this._boundShow),this.targetElement.addEventListener("mouseleave",this._boundHide),this.targetElement.addEventListener("blur",this._boundHide),this.targetElement.addEventListener("tap",this._boundHide)),this.manual||(this.addEventListener("mouseenter",this._boundShow),this.addEventListener("mouseleave",this._boundHide))}_detachFromTarget(){this.manual||this._removeEvents(),this.targetElement&&this.targetElement.describedby&&(this.targetElement.removeAttribute("aria-describedby"),delete this.targetElement.describedby)}_removeEvents(){this.targetElement&&this._removeTargetEvents(this.targetElement),this.removeEventListener("mouseenter",this._boundShow),this.removeEventListener("mouseleave",this._boundHide)}_removeTargetEvents(e){e.removeEventListener("mouseenter",this._boundShow),e.removeEventListener("focus",this._boundShow),e.removeEventListener("mouseleave",this._boundHide),e.removeEventListener("blur",this._boundHide),e.removeEventListener("tap",this._boundHide)}_updateTarget(){this.targetElement=this.parentNode.querySelector(`#${this.for}`)}_setPosition(e,t,s){if(e&&!t){let e=window.innerHeight,t=window.innerWidth;this.offsetParent&&(e=this.offsetParent.scrollHeight,t=this.offsetParent.scrollWidth);const i=this.targetElement.getBoundingClientRect(),n=this.getBoundingClientRect(),a=(i.width-n.width)/2,o=(i.height-n.height)/2;let r,l,d=i.left,c=i.top,u=window.pageYOffset;switch(this._parentPostioned&&(c=this.targetElement.offsetTop,d=this.targetElement.offsetLeft,u=0),s){case"top":l=c-n.height+u,r=this._calculateLeft(d,i,n,a);break;case"bottom":l=c+i.height+u,r=this._calculateLeft(d,i,n,a);break;case"left":r=d-n.width,l=this._calculateTop(c,i,n,o,u);break;case"right":r=d+i.width,l=this._calculateTop(c,i,n,o,u)}this._setPositionInVisibleBounds(e,t,r,l,n)}}get _parentPostioned(){return"static"!==window.getComputedStyle(this.offsetParent).position}_setPositionInVisibleBounds(e,t,s,i,n){s+n.width>t?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,s)+"px",this.style.right="auto"),i+n.height>e?(this.style.bottom=e+"px",this.style.top="auto"):(this.style.top=Math.max(0,i)+"px",this.style.bottom="auto")}_calculateLeft(e,t,s,i){switch(this.align){case"left":return e;case"right":return t.left+t.width-s.width;default:return e+i}}_calculateTop(e,t,s,i,n){switch(this.align){case"top":return e+n;case"bottom":return e+t.height-s.height+n;default:return e+i+n}}show(){this.hidden=!1}hide(){this.hidden=!0}_hiddenChanged(e){e?(this.setAttribute("aria-hidden",!0),window.removeEventListener("keyup",this._boundOnKeyup)):(this.setAttribute("aria-hidden",!1),window.addEventListener("keyup",this._boundOnKeyup))}_onKeyup(e){27===e.keyCode&&this.hide()}_setDefaultId(){this.id||(Vaadin.tooltipIndex||(Vaadin.tooltipIndex=0),this.id="vcf-tooltip"+ ++Vaadin.tooltipIndex)}}function T(e){return function*(e){const t=[];for(const s of e.settings.subscriptions.allowFrequencyModification)if(_(s.jsonataQuery).evaluate(e.subscription))for(const e of s.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}customElements.define(E.is,E),window.Vaadin.VcfTooltip=E;class j extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function q(e){const t=864e5,s=31*t;if(".5m"===e)return s/2;const i=parseInt(e.substring(0,e.length-1));if(isNaN(i))throw new j(e);if(e.endsWith("y"))return 31536e6*i;if(e.endsWith("m"))return i*s;if(e.endsWith("w"))return 6048e5*i;if(e.endsWith("d"))return i*t;throw new j(e)}function D(e,t){if("boolean"==typeof t)return t;const s=t.filter((t=>Boolean(_(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var s,i,n,a,o;if(t.min){const s=e.min?q(e.min):1/0;q(t.min)<s&&(e.min=t.min)}if(t.max){const s=e.max?q(e.max):-1/0;q(t.max)>s&&(e.max=t.max)}if("day"===(null===(s=t.allowedDays)||void 0===s?void 0:s.type)){const s=[...null!==(i=e.allowedDaysOfWeek)&&void 0!==i?i:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(s))}if("month"===(null===(n=t.allowedDays)||void 0===n?void 0:n.type)){const s=[...null!==(a=e.allowedDaysOfMonth)&&void 0!==a?a:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(s))}if(t.disallowedDates){const s=[...null!==(o=e.disallowedDates)&&void 0!==o?o:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(s))}return e}),{});return 0!==Object.keys(s).length&&s}function k(e){const[t,s,i]=e.split("-").map((e=>parseInt(e)));return new Date(t,s-1,i)}function O(e){const t=e.settings.subscriptions.allow_next_date_modification;let s;return s="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,s;const i=k(e.value),n=i.getTime(),a=D(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof a)return a;if(!1===(null===(t=a.allowedDaysOfMonth)||void 0===t?void 0:t.includes(i.getDate())))return!1;if(!1===(null===(s=a.allowedDaysOfWeek)||void 0===s?void 0:s.includes(i.getDay())))return!1;if(a.disallowedDates&&a.disallowedDates.find((e=>{const[t,s]=e.split("..").map((e=>k(e).getTime()));return n===t||void 0!==s&&n>=t&&n<=s})))return!1;if(a.min){const e=g(a.min);if(null!==e&&Date.now()+e>=n)return!1}if(a.max){const e=g(a.max);if(null!==e&&Date.now()+e<=n)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:s}},subscription:e.subscription,value:e.value})}const A=["html"];let L,I,z,C,N,H,P,F,V,B,M,W,K,Q,R,J,G,Y,U,X,Z,ee=e=>e;const te=m(f(h(p(S,"subscription-form"))));class se extends te{constructor(){super(...arguments),this.settings=null,this.templates={},this.__renderHeaderSubtitle=()=>{var e;const{data:t,lang:s,ns:i}=this;if(t){let n,a,o="text-secondary";if(t.first_failed_transaction_date)o="text-error",n=t.first_failed_transaction_date,a="subscription_failed";else if(t.end_date){n=t.end_date;a=new Date(n).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}else n=null!==(e=t.next_transaction_date)&&void 0!==e?e:(new Date).toISOString(),a="subscription_"+(t.is_active?"active":"inactive");const r=l(L||(L=ee` <foxy-i18n data-testid="header-subtitle" options="${0}" class="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify({date:n}),o,s,a,i);return t.first_failed_transaction_date?l(I||(I=ee` <span id="status" class="flex items-center space-x-xs ${0}"> ${0}<iron-icon icon="icons:info-outline" class="icon-inline"></iron-icon> </span> <vcf-tooltip for="status" position="bottom"> <span class="text-s">${0}</span> </vcf-tooltip> `),o,r,t.error_message):r}return l(z||(z=ee`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeaderTitle=()=>{const{data:e,lang:t,ns:s}=this;if(e){const i=$(e.frequency),n=e._embedded["fx:last_transaction"].currency_code,a=e._embedded["fx:last_transaction"].total_order;return l(C||(C=ee` <foxy-i18n data-testid="header-title" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(d(d({},i),{},{amount:`${a} ${n}`})),t,".5m"===e.frequency?"twice_a_month":"recurring",s)}return l(N||(N=ee`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeader=()=>l(H||(H=ee` <div data-testid="header"> ${0} <div class="leading-xs text-xxl font-bold">${0}</div> <div class="leading-xs text-l">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.__renderHeaderTitle(),this.__renderHeaderSubtitle(),this.renderTemplateOrSlot("header:after")),this.__renderItemsActions=()=>l(P||(P=ee` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItemsItem=e=>{const t=e.price.toLocaleString(this.lang||"en",{style:"currency",currency:this.data._embedded["fx:last_transaction"].currency_code});let s;return s=e.quantity>1?l(F||(F=ee` <div data-testclass="item-quantity" class="px-s h-xs rounded bg-contrast-5 flex items-center font-tnum text-contrast text-s font-bold"> ${0} </div> `),e.quantity):l(V||(V=ee``)),l(B||(B=ee` <figure class="flex items-center space-x-m py-s pr-m" data-testclass="item"> <x-preview data-testclass="item-preview" class="w-l h-l" .quantity="${0}" .image="${0}"> </x-preview> <figcaption class="leading-s flex-1 flex justify-between items-center"> <div class="flex flex-col"> <span class="font-medium" data-testclass="item-name">${0}</span> <span class="text-secondary text-s" data-testclass="item-price">${0}</span> </div> ${0} </figcaption> </figure> `),e.quantity,e.image,e.name,t,s)},this.__renderItems=()=>{var e,t;const s=this.hiddenSelector,i=null!==(t=null===(e=this.data)||void 0===e?void 0:e._embedded["fx:transaction_template"]._embedded["fx:items"])&&void 0!==t?t:[],n=s.matches("items:actions",!0)?"":this.__renderItemsActions();return l(M||(M=ee` <div data-testid="items"> ${0} <x-group frame> <div slot="header">${0}</div> <div class="divide-y divide-contrast-10 pl-s">${0}</div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("items:before"),n,i.map(this.__renderItemsItem),this.renderTemplateOrSlot("items:after"))},this.__renderEndDate=()=>{const{disabledSelector:e,lang:t,ns:s}=this,i=this.hiddenSelector.zoom("end-date:form").toString();return l(W||(W=ee` <div> ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="save-button ${0}" data-testid="cancellation-form" parent="${0}" header="end_subscription" alert form="foxy-cancellation-form" href="${0}" lang="${0}" id="end-date-form" ns="${0}" .templates="${0}"> </foxy-form-dialog> <vaadin-button data-testid="end-date" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="end_subscription" ns="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),this.readonlySelector.zoom("end-date:form").toString(),e.zoom("end-date:form").toString(),i,this.parent,this.href,t,s,this.getNestedTemplates("end-date:form"),!this.data||e.matches("end-date",!0),(e=>{this.renderRoot.querySelector("#end-date-form").show(e.currentTarget)}),s,t,this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:s}=this;if(t&&s){return O({value:w(e),settings:t,subscription:s})}return e.getTime()>=Date.now()},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:s}=this,i=!!(null==e?void 0:e.is_active);return l(K||(K=ee` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),s,t,x(null==e?void 0:e.next_transaction_date.substr(0,10)),x(null==e?void 0:e.next_transaction_date),t,!i||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),s=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",$(e)),value:e})));return l(Q||(Q=ee` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),x(this.form.frequency),s,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:s,ns:i}=this;return l(R||(R=ee` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),i,s,se.defaultNS,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>l(J||(J=ee` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify($(e)),e,s,".5m"===e?"twice_a_month":"frequency",i))))},this.__renderFrequency=()=>l(G||(G=ee` <div> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__transactionsTableColumns=[{cell(e){var t;const s=v.statusColumn.cell(e),i=v.priceColumn.cell(e),n=null!==(t={declined:"text-error",rejected:"text-error"}[e.data.status])&&void 0!==t?t:"text-body";return e.html(Y||(Y=ee`
|
|
79
96
|
<span class="sr-only">${0}</span>
|
|
80
97
|
<span class="${0} text-s">${0}</span>
|
|
81
98
|
`),s,n,i)}},{cell:v.idColumn.cell,hideBelow:"sm"},{cell:v.dateColumn.cell},{cell:v.receiptColumn.cell}],this.__renderTransactionsPage=e=>{let{html:t}=e,s=c(e,A);var i,n;return t(U||(U=ee`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-spinner.js";import"./foxy-i18n.js";import{S as s}from"./shared-
|
|
1
|
+
import"./foxy-spinner.js";import"./foxy-i18n.js";import{S as s}from"./shared-c7f352fa.js";export{S as SubscriptionsTable}from"./shared-c7f352fa.js";import"./shared-46ee137f.js";import"./shared-ff79f3f9.js";import"./shared-60126eee.js";import"./shared-d97a6ee5.js";import"./shared-2b2b56f6.js";import"./shared-82dd0556.js";import"./shared-57522229.js";import"./shared-a4410f22.js";import"./shared-94c83b2b.js";import"./foxy-nucleon-element.js";import"./shared-b8349f79.js";import"./shared-14788132.js";import"./shared-7684cb05.js";import"./shared-3553ff4d.js";import"./shared-4e709717.js";import"./shared-7fd12533.js";import"./shared-87ca7818.js";customElements.define("foxy-subscriptions-table",s);
|
package/dist/cdn/foxy-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-652ef7fe.js";import"./foxy-spinner.js";import{T as s}from"./shared-57522229.js";export{T as Table}from"./shared-57522229.js";import"./shared-d97a6ee5.js";import"./shared-46ee137f.js";import"./shared-ff79f3f9.js";import"./shared-60126eee.js";import"./foxy-i18n.js";import"./shared-2b2b56f6.js";import"./shared-82dd0556.js";import"./shared-a4410f22.js";import"./shared-94c83b2b.js";import"./foxy-nucleon-element.js";import"./shared-b8349f79.js";import"./shared-14788132.js";import"./shared-7684cb05.js";import"./shared-3553ff4d.js";import"./shared-4e709717.js";customElements.define("foxy-table",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-652ef7fe.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h as r}from"./shared-d97a6ee5.js";import{a as e}from"./shared-2b2b56f6.js";import{T as t}from"./shared-84df58e1.js";import"./shared-46ee137f.js";import"./shared-ff79f3f9.js";import"./shared-60126eee.js";import"./shared-82dd0556.js";import"./shared-a4410f22.js";import"./shared-94c83b2b.js";import"./shared-b8349f79.js";import"./shared-14788132.js";import"./shared-7684cb05.js";import"./shared-3553ff4d.js";import"./shared-4e709717.js";let a,s,i=r=>r;class o extends(e(t,"tax-card")){render(){return super.render({title:({name:e})=>r(a||(a=i`${0}`),e),subtitle:()=>r(s||(s=i`${0} • ${0}`),this.__typeLabel,this.__rateLabel)})}get __typeLabel(){var r;const{type:e,country:t,region:a,city:s}=null!==(r=this.data)&&void 0!==r?r:{};return"global"===e?this.t("tax_global"):"union"===e?this.t("tax_union"):"country"===e?t:"region"===e?`${t}, ${a}`:"local"===e?`${t}, ${a}, ${s}`:void 0}get __rateLabel(){var r,e;if(!1===(null===(r=this.data)||void 0===r?void 0:r.is_live))return this.t("percent",{fraction:this.data.rate/100});const t=null===(e=this.data)||void 0===e?void 0:e.service_provider;return"onesource"===t?"Thomson Reuters ONESOURCE":"avalara"===t?"Avalara AvaTax 15":"taxjar"===t?"TaxJar":this.t("tax_rate_provider_default")}}customElements.define("foxy-tax-card",o);export{o as TaxCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-036a8b21.js";import"./shared-84fa75d9.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{D as e}from"./shared-bf09e011.js";import"./shared-3ae39e52.js";import"./shared-54c485d2.js";import"./shared-b98f88c9.js";import{_ as t,h as i}from"./shared-17968c53.js";import{C as r}from"./shared-e55b6bb7.js";import"./shared-b0b1d248.js";import{T as s,S as a,a as n}from"./shared-c1e0e11f.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import{P as o}from"./shared-b77179fd.js";import{c as d}from"./shared-4e709717.js";import{m as l}from"./shared-50744508.js";import{C as h}from"./shared-f0199313.js";import{N as c}from"./shared-cf248335.js";import{i as _}from"./shared-98ee7fad.js";import{i as u}from"./shared-c0161e6a.js";import"./shared-cd700eac.js";import"./shared-747b0842.js";import"./shared-87ca7818.js";import"./shared-54702b33.js";import"./shared-d4dad105.js";import"./shared-7684cb05.js";let m,p,y,g,v,f,$,b,x,S,T,E,k,O,C=e=>e;const w=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],H=[...w,"AU"],j=h(s(a(n(c,"tax-form"))));class A extends j{constructor(){var e;super(...arguments),e=this,this.templates={},this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=u(l.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=u(l.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-property-table":o,"x-checkbox":r,"x-dropdown":e}}static get properties(){return t(t({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return i(m||(m=C` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),d({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!this.in("busy")&&!this.in("fail")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&w.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return i(p||(p=C` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),_(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),this.in("busy")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),i(y||(y=C` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),_(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),this.in("busy")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e;const t=this.__countriesService.state.matches("busy"),r=this.in("busy"),s=t||r,a=this.__countriesService.state.context.data,n=Object.values(null!==(e=null==a?void 0:a.values)&&void 0!==e?e:{});return i(g||(g=C` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),n,0===n.length,s||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e;const t=this.__regionsService.state.matches("busy"),r=this.in("busy"),s=t||r,a=this.__regionsService.state.context.data,n=Object.values(null!==(e=null==a?void 0:a.values)&&void 0!==e?e:{});return i(v||(v=C` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),n,0===n.length,s||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return i(f||(f=C` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),_(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),this.in("busy")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||w.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),H.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),i($||($=C` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),this.in("busy")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return i(b||(b=C` <div> ${0} <vaadin-integer-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" prevent-invalid-input has-controls .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-integer-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),_(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),this.in("busy")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseInt(e.currentTarget.value);this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return i(x||(x=C` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),this.in("busy")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return i(S||(S=C` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),this.in("busy")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return i(T||(T=C` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,this.in("busy")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return i(E||(E=C` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>({name:this.t(e),value:this.data?this.t("date",{value:new Date(this.data[e])}):""}))),this.renderTemplateOrSlot("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),r=this.in({idle:{snapshot:{clean:"invalid"}}}),s=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(r||s),n=this.in("busy");return i(k||(k=C` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return i(O||(O=C` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="primary error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),this.in("busy")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};
|
|
1
|
+
import"./shared-72678c5d.js";import"./shared-652ef7fe.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{D as e}from"./shared-1108653b.js";import"./shared-dce03b47.js";import"./shared-92442eb1.js";import"./shared-04b77f79.js";import{_ as t,h as i}from"./shared-d97a6ee5.js";import{C as r}from"./shared-a21a7562.js";import"./shared-bec929ac.js";import{T as s,S as a,a as n}from"./shared-2b2b56f6.js";import"./shared-46ee137f.js";import"./shared-a71bd9f0.js";import{P as o}from"./shared-e969772e.js";import{c as d}from"./shared-4e709717.js";import{a as l}from"./shared-82dd0556.js";import{C as h}from"./shared-a4410f22.js";import{N as c}from"./shared-b8349f79.js";import{i as _}from"./shared-94c83b2b.js";import{i as u}from"./shared-3553ff4d.js";import"./shared-60126eee.js";import"./shared-ff79f3f9.js";import"./shared-87ca7818.js";import"./shared-27d93838.js";import"./shared-14788132.js";import"./shared-7684cb05.js";let m,p,y,g,v,f,$,b,x,S,T,E,k,O,C=e=>e;const w=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],H=[...w,"AU"],j=h(s(a(n(c,"tax-form"))));class A extends j{constructor(){var e;super(...arguments),e=this,this.templates={},this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=u(l.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=u(l.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-property-table":o,"x-checkbox":r,"x-dropdown":e}}static get properties(){return t(t({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return i(m||(m=C` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),d({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!this.in("busy")&&!this.in("fail")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&w.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return i(p||(p=C` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),_(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),this.in("busy")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),i(y||(y=C` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),_(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),this.in("busy")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e;const t=this.__countriesService.state.matches("busy"),r=this.in("busy"),s=t||r,a=this.__countriesService.state.context.data,n=Object.values(null!==(e=null==a?void 0:a.values)&&void 0!==e?e:{});return i(g||(g=C` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),n,0===n.length,s||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e;const t=this.__regionsService.state.matches("busy"),r=this.in("busy"),s=t||r,a=this.__regionsService.state.context.data,n=Object.values(null!==(e=null==a?void 0:a.values)&&void 0!==e?e:{});return i(v||(v=C` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),n,0===n.length,s||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return i(f||(f=C` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),_(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),this.in("busy")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||w.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),H.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),i($||($=C` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),this.in("busy")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return i(b||(b=C` <div> ${0} <vaadin-integer-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" prevent-invalid-input has-controls .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-integer-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),_(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),this.in("busy")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseInt(e.currentTarget.value);this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return i(x||(x=C` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),this.in("busy")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return i(S||(S=C` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),this.in("busy")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return i(T||(T=C` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,this.in("busy")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return i(E||(E=C` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),r=this.in({idle:{snapshot:{clean:"invalid"}}}),s=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(r||s),n=this.in("busy");return i(k||(k=C` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return i(O||(O=C` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="primary error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),this.in("busy")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-dce03b47.js";import{C as e,d as t}from"./shared-1108653b.js";import"./shared-04b77f79.js";import"./shared-72678c5d.js";import"./shared-652ef7fe.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{_ as i,j as s,h as a}from"./shared-d97a6ee5.js";import"./shared-46ee137f.js";import"./shared-a71bd9f0.js";import{C as r}from"./shared-a4410f22.js";import{S as n,T as o,a as d}from"./shared-2b2b56f6.js";import"./shared-bec929ac.js";import"./shared-92442eb1.js";import{G as l}from"./shared-dd66b354.js";import{P as c}from"./shared-e969772e.js";import{c as h}from"./shared-4e709717.js";import{N as m}from"./shared-b8349f79.js";import{i as p}from"./shared-94c83b2b.js";import"./shared-ff79f3f9.js";import"./shared-82dd0556.js";import"./shared-87ca7818.js";import"./shared-27d93838.js";import"./shared-3553ff4d.js";import"./shared-60126eee.js";import"./shared-14788132.js";import"./shared-7684cb05.js";let f,u,v,y,$,_,b,x,g=e=>e;const j=n(o(r(d(m,"template-form"))));class S extends j{constructor(){super(...arguments),this.__cacheState="idle",this.__contentChoice="default"}static get properties(){return i(i({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get styles(){return[...super.styles,s(f||(f=g`#cached-content::part(input-field){max-height:15em}`))]}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"vaadin-button":customElements.get("vaadin-button"),"x-property-table":c,"x-choice":e,"x-group":l}}render(){var e,t;const{hiddenSelector:i,href:s,lang:r,ns:n}=this,o=s?"delete":"create",d=this.in("busy"),l=this.in("fail");return a(u||(u=g` <div class="space-y-m"> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),i.matches("description",!0)?"":this.__renderDescription(),i.matches("content",!0)?"":this.__renderContent(),i.matches("timestamps",!0)||!s?"":this.__renderTimestamps(),i.matches(o)?"":this.__renderAction(o),h({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!d&&!l}),l?"error":d?"busy":"empty",r,n,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderDescription(){var e,t;return a(v||(v=g` <div> ${0} <vaadin-text-field class="w-full mb-s" label="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("description:before"),this.t("description"),null!==(t=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==t?t:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot("description:after"))}__renderContent(){var e;const i=this.form.content_url?"url":this.form.content?"clipboard":this.__contentChoice;return a(y||(y=g` <div> ${0} <x-group frame> <foxy-i18n lang="${0}" slot="header" key="template" ns="${0}"></foxy-i18n> <x-choice data-testid="template-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div slot="url" ?hidden="${0}"> <div class="flex items-center mt-0 mb-m"> <vaadin-text-field data-testid="content_url" value="${0}" class="mr-s flex-grow" @input="${0}"> </vaadin-text-field> ${0} </div> </div> <div slot="clipboard" ?hidden="${0}"> <vaadin-text-area id="cached-content" data-testid="content" class="w-full mb-m" .value="${0}" @input="${0}"> </vaadin-text-area> </div> </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("content:before"),this.lang,this.ns,i,["default","url","clipboard"],this.readonlySelector.matches("content",!0),this.in("busy")||this.disabledSelector.matches("content",!0),(e=>{e instanceof t&&(this.edit({content:"",content_url:""}),this.__contentChoice=e.detail)}),["default","url","clipboard"].map((e=>a($||($=g` <div slot="${0}-label" class="py-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s opacity-70" lang="${0}" key="template_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns,this.lang,e,this.ns))),"url"!==i,p(this.form.content_url),(e=>{const t=e.currentTarget.value;this.edit({content:"",content_url:t})}),this.form.content_url===(null===(e=this.data)||void 0===e?void 0:e.content_url)?a(_||(_=g` <vaadin-button class="relative" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> `),"busy"===this.__cacheState,this.__cache,h({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,h({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns):"","clipboard"!==i,this.form.content,(e=>{const t=e.currentTarget.value;this.edit({content:t,content_url:""})}),this.renderTemplateOrSlot("content:after"))}__renderTimestamps(){return a(b||(b=g` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot("timestamps:after"))}__renderAction(e){const{disabledSelector:t,href:i,lang:s,ns:r}=this,n=this.in({idle:{template:{dirty:"valid"}}}),o=this.in({idle:{snapshot:{dirty:"valid"}}}),d=!this.in("idle")||t.matches(e,!0),l=n||o;return a(x||(x=g` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),s,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?"primary "+(i?"error":"success"):"",e,this.in({idle:"template"})&&!l||d,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,s,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const i=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",s=await new S.API(this).fetch(i,{method:"POST"});this.__cacheState=s.ok?"idle":"fail"}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-template-form",S);export{S as TemplateForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-652ef7fe.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h as t}from"./shared-d97a6ee5.js";import{C as e}from"./shared-a4410f22.js";import{N as s}from"./shared-b8349f79.js";import{T as i,a as r}from"./shared-2b2b56f6.js";import{c as a}from"./shared-4e709717.js";import"./shared-46ee137f.js";import"./shared-ff79f3f9.js";import"./shared-60126eee.js";import"./shared-82dd0556.js";import"./shared-94c83b2b.js";import"./shared-14788132.js";import"./shared-7684cb05.js";import"./shared-3553ff4d.js";let n,o,d,c,l,m,h,p,u,f,v,y,_=t=>t;const $=i(e(r(s,"transaction-card")));class x extends ${constructor(){super(...arguments),this.templates={},this.__currencyDisplay=""}render(){var e,s;const i=this.hiddenSelector,r=!i.matches("total",!0),d=!i.matches("status",!0);return t(n||(n=_` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),a({"transition-opacity":!0,"opacity-0":!this.data}),r||d?t(o||(o=_` <div class="flex items-center justify-between"> ${0} ${0} </div> `),r?this.__renderTotal():"",d?this.__renderStatus():""):"",i.matches("description",!0)?"":this.__renderDescription(),i.matches("customer",!0)?"":this.__renderCustomer(),a({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}async _sendGet(){const t=await super._sendGet(),e=await super._fetch(t._links["fx:store"].href);return this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol",t}__renderTotal(){const e=this.data;let s;if(e){const i=`${e.total_order} ${e.currency_code}`,r=this.__currencyDisplay;s=t(d||(d=_` <foxy-i18n options="${0}" lang="${0}" key="price" ns="${0}"> </foxy-i18n> `),JSON.stringify({amount:i,currencyDisplay:r}),this.lang,this.ns)}else s=t(c||(c=_`​`));return t(l||(l=_` <div data-testid="total"> ${0} <div class="font-semibold truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("total:before"),s,this.renderTemplateOrSlot("total:after"))}__renderStatus(){var e,s,i,r;const a=(null===(e=this.data)||void 0===e?void 0:e.status)||"completed";return t(m||(m=_` <div data-testid="status"> ${0} <div class="text-tertiary text-s flex items-center space-x-s"> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> <iron-icon data-testid="status-icon" class="icon-inline text-l ${0}" title="${0}" icon="${0}"> </iron-icon> </div> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({value:null===(s=this.data)||void 0===s?void 0:s.transaction_date}),this.lang,this.ns,null!==(i={completed:"text-success",rejected:"text-error",declined:"text-error"}[a])&&void 0!==i?i:"text-tertiary",this.t(`transaction_${a}`),null!==(r={completed:"icons:done-all",refunded:"icons:restore",rejected:"icons:highlight-off",declined:"icons:highlight-off",voided:"icons:remove-circle-outline"}[a])&&void 0!==r?r:"icons:schedule",this.renderTemplateOrSlot("status:after"))}__renderDescription(){var e,s;const i=null===(s=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===s?void 0:s["fx:items"];let r;if(i){const e={most_expensive_item:[...i].sort(((t,e)=>t.price-e.price))[0],count:i.length};r=t(h||(h=_` <foxy-i18n options="${0}" lang="${0}" key="transaction_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify(e),this.lang,this.ns)}else r=t(p||(p=_`​`));return t(u||(u=_` <div data-testid="description"> ${0} <div class="text-s text-secondary truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),r,this.renderTemplateOrSlot("description:after"))}__renderCustomer(){const e=this.data,s=e?t(f||(f=_`${0} ${0} (${0})`),e.customer_first_name,e.customer_last_name,e.customer_email):t(v||(v=_`​`));return t(y||(y=_` <div data-testid="customer"> ${0} <div class="text-tertiary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),s,this.renderTemplateOrSlot("customer:after"))}}customElements.define("foxy-transaction-card",x);export{x as TransactionCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{T as s}from"./shared-2d99835c.js";export{T as TransactionsTable}from"./shared-2d99835c.js";import"./shared-ff79f3f9.js";import"./shared-d97a6ee5.js";import"./shared-2b2b56f6.js";import"./shared-82dd0556.js";import"./shared-57522229.js";import"./shared-a4410f22.js";import"./shared-94c83b2b.js";import"./foxy-nucleon-element.js";import"./shared-b8349f79.js";import"./shared-14788132.js";import"./shared-7684cb05.js";import"./shared-3553ff4d.js";import"./shared-4e709717.js";customElements.define("foxy-transactions-table",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-dce03b47.js";import"./shared-04b77f79.js";import"./shared-72678c5d.js";import"./foxy-spinner.js";import"./foxy-i18n.js";export{U as UserForm}from"./shared-a0c2bbe0.js";import"./shared-ff79f3f9.js";import"./shared-d97a6ee5.js";import"./shared-bec929ac.js";import"./shared-14788132.js";import"./shared-82dd0556.js";import"./shared-a4410f22.js";import"./shared-94c83b2b.js";import"./shared-2b2b56f6.js";import"./shared-4e709717.js";import"./shared-46ee137f.js";import"./shared-60126eee.js";import"./shared-a21a7562.js";import"./shared-a71bd9f0.js";import"./shared-1108653b.js";import"./shared-92442eb1.js";import"./shared-87ca7818.js";import"./shared-27d93838.js";import"./shared-3553ff4d.js";import"./shared-dd66b354.js";import"./shared-b8349f79.js";import"./shared-7684cb05.js";import"./shared-b738ee96.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-04b77f79.js";import"./foxy-form-dialog.js";import{r as s}from"./shared-a0c2bbe0.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h as e}from"./shared-d97a6ee5.js";import{T as a}from"./shared-57522229.js";import"./shared-ff79f3f9.js";import"./shared-72678c5d.js";import"./shared-bec929ac.js";import"./shared-14788132.js";import"./shared-82dd0556.js";import"./shared-a4410f22.js";import"./shared-94c83b2b.js";import"./shared-2b2b56f6.js";import"./shared-4e709717.js";import"./shared-7684cb05.js";import"./shared-dce03b47.js";import"./shared-a21a7562.js";import"./shared-46ee137f.js";import"./shared-a71bd9f0.js";import"./shared-1108653b.js";import"./shared-92442eb1.js";import"./shared-87ca7818.js";import"./shared-27d93838.js";import"./shared-3553ff4d.js";import"./shared-dd66b354.js";import"./shared-b8349f79.js";import"./shared-b738ee96.js";import"./shared-60126eee.js";import"./foxy-nucleon-element.js";let t,r,o,d,i,m,n,l=s=>s;class p extends a{constructor(){super(...arguments),this.columns=[p.nameColumn,p.emailColumn,p.rolesColumn,p.lastUpdatedColumn,p.actionsColumn]}render(){return e(t||(t=l` <foxy-form-dialog parent="${0}" form="foxy-user-form" lang="${0}" ns="${0}" id="form"> </foxy-form-dialog> ${0} `),this.href,this.lang,this.ns,super.render())}}p.nameColumn={cell:s=>e(r||(r=l` <span data-testclass="name" class="text-m font-medium"> ${0} ${0} </span> `),s.data.first_name,s.data.last_name)},p.emailColumn={hideBelow:"md",cell:s=>e(o||(o=l` <span data-testclass="email" class="text-m text-secondary">${0}</span> `),s.data.email)},p.rolesColumn={cell:a=>e(d||(d=l` <div data-testclass="roles" class="flex space-x-s"> ${0} </div> `),["is_merchant","is_programmer","is_front_end_developer","is_designer"].map((t=>e(i||(i=l` <div class="${0}" style="width:1rem;height:1rem"> ${0} </div> `),a.data[t]?"":"text-disabled",s.find((s=>s.property===t)).icon))))},p.lastUpdatedColumn={hideBelow:"lg",cell:s=>e(m||(m=l` <span data-testclass="lastUpdated" class="text-m text-secondary font-tnum"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </span> `),JSON.stringify({value:s.data.date_modified}),s.lang,s.ns,JSON.stringify({value:s.data.date_modified}),s.lang,s.ns)},p.actionsColumn={cell:s=>e(n||(n=l` <vaadin-button data-testclass="actions" theme="tertiary small" @click="${0}"> <foxy-i18n lang="${0}" key="update" ns="${0}"></foxy-i18n> </vaadin-button> `),(e=>{const a=e.target,t=a.getRootNode().querySelector("#form");t.href=s.data._links.self.href,t.show(a)}),s.lang,s.ns)},customElements.define("foxy-users-table",p);export{p as UsersTable};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as t,a as e,i as o,e as n,h as r,G as s,P as a,c as l}from"./shared-747b0842.js";class i extends HTMLElement{static get version(){return"1.6.1"}}customElements.define("vaadin-lumo-styles",i);const c=document.createElement("template");c.innerHTML='<custom-style>\n <style>\n html {\n /* Base (background) */\n --lumo-base-color: #FFF;\n\n /* Tint */\n --lumo-tint-5pct: hsla(0, 0%, 100%, 0.3);\n --lumo-tint-10pct: hsla(0, 0%, 100%, 0.37);\n --lumo-tint-20pct: hsla(0, 0%, 100%, 0.44);\n --lumo-tint-30pct: hsla(0, 0%, 100%, 0.5);\n --lumo-tint-40pct: hsla(0, 0%, 100%, 0.57);\n --lumo-tint-50pct: hsla(0, 0%, 100%, 0.64);\n --lumo-tint-60pct: hsla(0, 0%, 100%, 0.7);\n --lumo-tint-70pct: hsla(0, 0%, 100%, 0.77);\n --lumo-tint-80pct: hsla(0, 0%, 100%, 0.84);\n --lumo-tint-90pct: hsla(0, 0%, 100%, 0.9);\n --lumo-tint: #FFF;\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 61%, 25%, 0.05);\n --lumo-shade-10pct: hsla(214, 57%, 24%, 0.1);\n --lumo-shade-20pct: hsla(214, 53%, 23%, 0.16);\n --lumo-shade-30pct: hsla(214, 50%, 22%, 0.26);\n --lumo-shade-40pct: hsla(214, 47%, 21%, 0.38);\n --lumo-shade-50pct: hsla(214, 45%, 20%, 0.5);\n --lumo-shade-60pct: hsla(214, 43%, 19%, 0.61);\n --lumo-shade-70pct: hsla(214, 42%, 18%, 0.72);\n --lumo-shade-80pct: hsla(214, 41%, 17%, 0.83);\n --lumo-shade-90pct: hsla(214, 40%, 16%, 0.94);\n --lumo-shade: hsl(214, 35%, 15%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-shade-5pct);\n --lumo-contrast-10pct: var(--lumo-shade-10pct);\n --lumo-contrast-20pct: var(--lumo-shade-20pct);\n --lumo-contrast-30pct: var(--lumo-shade-30pct);\n --lumo-contrast-40pct: var(--lumo-shade-40pct);\n --lumo-contrast-50pct: var(--lumo-shade-50pct);\n --lumo-contrast-60pct: var(--lumo-shade-60pct);\n --lumo-contrast-70pct: var(--lumo-shade-70pct);\n --lumo-contrast-80pct: var(--lumo-shade-80pct);\n --lumo-contrast-90pct: var(--lumo-shade-90pct);\n --lumo-contrast: var(--lumo-shade);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 90%, 52%);\n --lumo-primary-color-50pct: hsla(214, 90%, 52%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 52%, 0.1);\n --lumo-primary-text-color: var(--lumo-primary-color);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 100%, 61%);\n --lumo-error-color-50pct: hsla(3, 100%, 60%, 0.5);\n --lumo-error-color-10pct: hsla(3, 100%, 60%, 0.1);\n --lumo-error-text-color: hsl(3, 92%, 53%);\n --lumo-error-contrast-color: #FFF;\n\n /* Success */\n --lumo-success-color: hsl(145, 80%, 42%); /* hsl(144,82%,37%); */\n --lumo-success-color-50pct: hsla(145, 76%, 44%, 0.55);\n --lumo-success-color-10pct: hsla(145, 76%, 44%, 0.12);\n --lumo-success-text-color: hsl(145, 100%, 32%);\n --lumo-success-contrast-color: #FFF;\n }\n </style>\n</custom-style><dom-module id="lumo-color">\n <template>\n <style>\n [theme~="dark"] {\n /* Base (background) */\n --lumo-base-color: hsl(214, 35%, 21%);\n\n /* Tint */\n --lumo-tint-5pct: hsla(214, 65%, 85%, 0.06);\n --lumo-tint-10pct: hsla(214, 60%, 80%, 0.14);\n --lumo-tint-20pct: hsla(214, 64%, 82%, 0.23);\n --lumo-tint-30pct: hsla(214, 69%, 84%, 0.32);\n --lumo-tint-40pct: hsla(214, 73%, 86%, 0.41);\n --lumo-tint-50pct: hsla(214, 78%, 88%, 0.5);\n --lumo-tint-60pct: hsla(214, 82%, 90%, 0.6);\n --lumo-tint-70pct: hsla(214, 87%, 92%, 0.7);\n --lumo-tint-80pct: hsla(214, 91%, 94%, 0.8);\n --lumo-tint-90pct: hsla(214, 96%, 96%, 0.9);\n --lumo-tint: hsl(214, 100%, 98%);\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 0%, 0%, 0.07);\n --lumo-shade-10pct: hsla(214, 4%, 2%, 0.15);\n --lumo-shade-20pct: hsla(214, 8%, 4%, 0.23);\n --lumo-shade-30pct: hsla(214, 12%, 6%, 0.32);\n --lumo-shade-40pct: hsla(214, 16%, 8%, 0.41);\n --lumo-shade-50pct: hsla(214, 20%, 10%, 0.5);\n --lumo-shade-60pct: hsla(214, 24%, 12%, 0.6);\n --lumo-shade-70pct: hsla(214, 28%, 13%, 0.7);\n --lumo-shade-80pct: hsla(214, 32%, 13%, 0.8);\n --lumo-shade-90pct: hsla(214, 33%, 13%, 0.9);\n --lumo-shade: hsl(214, 33%, 13%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-tint-5pct);\n --lumo-contrast-10pct: var(--lumo-tint-10pct);\n --lumo-contrast-20pct: var(--lumo-tint-20pct);\n --lumo-contrast-30pct: var(--lumo-tint-30pct);\n --lumo-contrast-40pct: var(--lumo-tint-40pct);\n --lumo-contrast-50pct: var(--lumo-tint-50pct);\n --lumo-contrast-60pct: var(--lumo-tint-60pct);\n --lumo-contrast-70pct: var(--lumo-tint-70pct);\n --lumo-contrast-80pct: var(--lumo-tint-80pct);\n --lumo-contrast-90pct: var(--lumo-tint-90pct);\n --lumo-contrast: var(--lumo-tint);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 86%, 55%);\n --lumo-primary-color-50pct: hsla(214, 86%, 55%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 63%, 0.1);\n --lumo-primary-text-color: hsl(214, 100%, 70%);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 90%, 63%);\n --lumo-error-color-50pct: hsla(3, 90%, 63%, 0.5);\n --lumo-error-color-10pct: hsla(3, 90%, 63%, 0.1);\n --lumo-error-text-color: hsl(3, 100%, 67%);\n\n /* Success */\n --lumo-success-color: hsl(145, 65%, 42%);\n --lumo-success-color-50pct: hsla(145, 65%, 42%, 0.5);\n --lumo-success-color-10pct: hsla(145, 65%, 42%, 0.1);\n --lumo-success-text-color: hsl(145, 85%, 47%);\n }\n\n html {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n [theme~="dark"] {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n color: var(--lumo-header-text-color);\n }\n\n a {\n color: var(--lumo-primary-text-color);\n }\n\n blockquote {\n color: var(--lumo-secondary-text-color);\n }\n\n code,\n pre {\n background-color: var(--lumo-contrast-10pct);\n border-radius: var(--lumo-border-radius-m);\n }\n </style>\n </template>\n</dom-module><dom-module id="lumo-color-legacy">\n <template>\n <style include="lumo-color">\n :host {\n color: var(--lumo-body-text-color) !important;\n background-color: var(--lumo-base-color) !important;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(c.content);const m=document.createElement("template");m.innerHTML="<custom-style>\n <style>\n html {\n --lumo-size-xs: 1.625rem;\n --lumo-size-s: 1.875rem;\n --lumo-size-m: 2.25rem;\n --lumo-size-l: 2.75rem;\n --lumo-size-xl: 3.5rem;\n\n /* Icons */\n --lumo-icon-size-s: 1.25em;\n --lumo-icon-size-m: 1.5em;\n --lumo-icon-size-l: 2.25em;\n /* For backwards compatibility */\n --lumo-icon-size: var(--lumo-icon-size-m);\n }\n </style>\n</custom-style>",document.head.appendChild(m.content);const u=document.createElement("template");u.innerHTML="<custom-style>\n <style>\n html {\n /* Square */\n --lumo-space-xs: 0.25rem;\n --lumo-space-s: 0.5rem;\n --lumo-space-m: 1rem;\n --lumo-space-l: 1.5rem;\n --lumo-space-xl: 2.5rem;\n\n /* Wide */\n --lumo-space-wide-xs: calc(var(--lumo-space-xs) / 2) var(--lumo-space-xs);\n --lumo-space-wide-s: calc(var(--lumo-space-s) / 2) var(--lumo-space-s);\n --lumo-space-wide-m: calc(var(--lumo-space-m) / 2) var(--lumo-space-m);\n --lumo-space-wide-l: calc(var(--lumo-space-l) / 2) var(--lumo-space-l);\n --lumo-space-wide-xl: calc(var(--lumo-space-xl) / 2) var(--lumo-space-xl);\n\n /* Tall */\n --lumo-space-tall-xs: var(--lumo-space-xs) calc(var(--lumo-space-xs) / 2);\n --lumo-space-tall-s: var(--lumo-space-s) calc(var(--lumo-space-s) / 2);\n --lumo-space-tall-m: var(--lumo-space-m) calc(var(--lumo-space-m) / 2);\n --lumo-space-tall-l: var(--lumo-space-l) calc(var(--lumo-space-l) / 2);\n --lumo-space-tall-xl: var(--lumo-space-xl) calc(var(--lumo-space-xl) / 2);\n }\n </style>\n</custom-style>",document.head.appendChild(u.content);const d=document.createElement("template");d.innerHTML="<custom-style>\n <style>\n html {\n /* Border radius */\n --lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */\n --lumo-border-radius-m: var(--lumo-border-radius, 0.25em); /* Button, text field, menu overlay, etc */\n --lumo-border-radius-l: 0.5em; /* Dialog, notification, etc */\n --lumo-border-radius: 0.25em; /* Deprecated */\n\n /* Shadow */\n --lumo-box-shadow-xs: 0 1px 4px -1px var(--lumo-shade-50pct);\n --lumo-box-shadow-s: 0 2px 4px -1px var(--lumo-shade-20pct), 0 3px 12px -1px var(--lumo-shade-30pct);\n --lumo-box-shadow-m: 0 2px 6px -1px var(--lumo-shade-20pct), 0 8px 24px -4px var(--lumo-shade-40pct);\n --lumo-box-shadow-l: 0 3px 18px -2px var(--lumo-shade-20pct), 0 12px 48px -6px var(--lumo-shade-40pct);\n --lumo-box-shadow-xl: 0 4px 24px -3px var(--lumo-shade-20pct), 0 18px 64px -8px var(--lumo-shade-40pct);\n\n /* Clickable element cursor */\n --lumo-clickable-cursor: default;\n }\n </style>\n</custom-style>",document.head.appendChild(d.content);const h=document.createElement("template");h.innerHTML='<custom-style>\n <style>\n html {\n /* Font families */\n --lumo-font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n\n /* Font sizes */\n --lumo-font-size-xxs: .75rem;\n --lumo-font-size-xs: .8125rem;\n --lumo-font-size-s: .875rem;\n --lumo-font-size-m: 1rem;\n --lumo-font-size-l: 1.125rem;\n --lumo-font-size-xl: 1.375rem;\n --lumo-font-size-xxl: 1.75rem;\n --lumo-font-size-xxxl: 2.5rem;\n\n /* Line heights */\n --lumo-line-height-xs: 1.25;\n --lumo-line-height-s: 1.375;\n --lumo-line-height-m: 1.625;\n }\n\n </style>\n</custom-style><dom-module id="lumo-typography">\n <template>\n <style>\n html {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n /* Can’t combine with the above selector because that doesn’t work in browsers without native shadow dom */\n :host {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n small,\n [theme~="font-size-s"] {\n font-size: var(--lumo-font-size-s);\n line-height: var(--lumo-line-height-s);\n }\n\n [theme~="font-size-xs"] {\n font-size: var(--lumo-font-size-xs);\n line-height: var(--lumo-line-height-xs);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-weight: 600;\n line-height: var(--lumo-line-height-xs);\n margin-top: 1.25em;\n }\n\n h1 {\n font-size: var(--lumo-font-size-xxxl);\n margin-bottom: 0.75em;\n }\n\n h2 {\n font-size: var(--lumo-font-size-xxl);\n margin-bottom: 0.5em;\n }\n\n h3 {\n font-size: var(--lumo-font-size-xl);\n margin-bottom: 0.5em;\n }\n\n h4 {\n font-size: var(--lumo-font-size-l);\n margin-bottom: 0.5em;\n }\n\n h5 {\n font-size: var(--lumo-font-size-m);\n margin-bottom: 0.25em;\n }\n\n h6 {\n font-size: var(--lumo-font-size-xs);\n margin-bottom: 0;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n }\n\n p,\n blockquote {\n margin-top: 0.5em;\n margin-bottom: 0.75em;\n }\n\n a {\n text-decoration: none;\n }\n\n a:hover {\n text-decoration: underline;\n }\n\n hr {\n display: block;\n align-self: stretch;\n height: 1px;\n border: 0;\n padding: 0;\n margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);\n background-color: var(--lumo-contrast-10pct);\n }\n\n blockquote {\n border-left: 2px solid var(--lumo-contrast-30pct);\n }\n\n b,\n strong {\n font-weight: 600;\n }\n\n /* RTL specific styles */\n\n blockquote[dir="rtl"] {\n border-left: none;\n border-right: 2px solid var(--lumo-contrast-30pct);\n }\n\n </style>\n </template>\n</dom-module>',document.head.appendChild(h.content);
|
|
1
|
+
import{D as t,a as e,i as o,e as n,h as r,G as s,P as a,c as l}from"./shared-ff79f3f9.js";class i extends HTMLElement{static get version(){return"1.6.1"}}customElements.define("vaadin-lumo-styles",i);const c=document.createElement("template");c.innerHTML='<custom-style>\n <style>\n html {\n /* Base (background) */\n --lumo-base-color: #FFF;\n\n /* Tint */\n --lumo-tint-5pct: hsla(0, 0%, 100%, 0.3);\n --lumo-tint-10pct: hsla(0, 0%, 100%, 0.37);\n --lumo-tint-20pct: hsla(0, 0%, 100%, 0.44);\n --lumo-tint-30pct: hsla(0, 0%, 100%, 0.5);\n --lumo-tint-40pct: hsla(0, 0%, 100%, 0.57);\n --lumo-tint-50pct: hsla(0, 0%, 100%, 0.64);\n --lumo-tint-60pct: hsla(0, 0%, 100%, 0.7);\n --lumo-tint-70pct: hsla(0, 0%, 100%, 0.77);\n --lumo-tint-80pct: hsla(0, 0%, 100%, 0.84);\n --lumo-tint-90pct: hsla(0, 0%, 100%, 0.9);\n --lumo-tint: #FFF;\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 61%, 25%, 0.05);\n --lumo-shade-10pct: hsla(214, 57%, 24%, 0.1);\n --lumo-shade-20pct: hsla(214, 53%, 23%, 0.16);\n --lumo-shade-30pct: hsla(214, 50%, 22%, 0.26);\n --lumo-shade-40pct: hsla(214, 47%, 21%, 0.38);\n --lumo-shade-50pct: hsla(214, 45%, 20%, 0.5);\n --lumo-shade-60pct: hsla(214, 43%, 19%, 0.61);\n --lumo-shade-70pct: hsla(214, 42%, 18%, 0.72);\n --lumo-shade-80pct: hsla(214, 41%, 17%, 0.83);\n --lumo-shade-90pct: hsla(214, 40%, 16%, 0.94);\n --lumo-shade: hsl(214, 35%, 15%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-shade-5pct);\n --lumo-contrast-10pct: var(--lumo-shade-10pct);\n --lumo-contrast-20pct: var(--lumo-shade-20pct);\n --lumo-contrast-30pct: var(--lumo-shade-30pct);\n --lumo-contrast-40pct: var(--lumo-shade-40pct);\n --lumo-contrast-50pct: var(--lumo-shade-50pct);\n --lumo-contrast-60pct: var(--lumo-shade-60pct);\n --lumo-contrast-70pct: var(--lumo-shade-70pct);\n --lumo-contrast-80pct: var(--lumo-shade-80pct);\n --lumo-contrast-90pct: var(--lumo-shade-90pct);\n --lumo-contrast: var(--lumo-shade);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 90%, 52%);\n --lumo-primary-color-50pct: hsla(214, 90%, 52%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 52%, 0.1);\n --lumo-primary-text-color: var(--lumo-primary-color);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 100%, 61%);\n --lumo-error-color-50pct: hsla(3, 100%, 60%, 0.5);\n --lumo-error-color-10pct: hsla(3, 100%, 60%, 0.1);\n --lumo-error-text-color: hsl(3, 92%, 53%);\n --lumo-error-contrast-color: #FFF;\n\n /* Success */\n --lumo-success-color: hsl(145, 80%, 42%); /* hsl(144,82%,37%); */\n --lumo-success-color-50pct: hsla(145, 76%, 44%, 0.55);\n --lumo-success-color-10pct: hsla(145, 76%, 44%, 0.12);\n --lumo-success-text-color: hsl(145, 100%, 32%);\n --lumo-success-contrast-color: #FFF;\n }\n </style>\n</custom-style><dom-module id="lumo-color">\n <template>\n <style>\n [theme~="dark"] {\n /* Base (background) */\n --lumo-base-color: hsl(214, 35%, 21%);\n\n /* Tint */\n --lumo-tint-5pct: hsla(214, 65%, 85%, 0.06);\n --lumo-tint-10pct: hsla(214, 60%, 80%, 0.14);\n --lumo-tint-20pct: hsla(214, 64%, 82%, 0.23);\n --lumo-tint-30pct: hsla(214, 69%, 84%, 0.32);\n --lumo-tint-40pct: hsla(214, 73%, 86%, 0.41);\n --lumo-tint-50pct: hsla(214, 78%, 88%, 0.5);\n --lumo-tint-60pct: hsla(214, 82%, 90%, 0.6);\n --lumo-tint-70pct: hsla(214, 87%, 92%, 0.7);\n --lumo-tint-80pct: hsla(214, 91%, 94%, 0.8);\n --lumo-tint-90pct: hsla(214, 96%, 96%, 0.9);\n --lumo-tint: hsl(214, 100%, 98%);\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 0%, 0%, 0.07);\n --lumo-shade-10pct: hsla(214, 4%, 2%, 0.15);\n --lumo-shade-20pct: hsla(214, 8%, 4%, 0.23);\n --lumo-shade-30pct: hsla(214, 12%, 6%, 0.32);\n --lumo-shade-40pct: hsla(214, 16%, 8%, 0.41);\n --lumo-shade-50pct: hsla(214, 20%, 10%, 0.5);\n --lumo-shade-60pct: hsla(214, 24%, 12%, 0.6);\n --lumo-shade-70pct: hsla(214, 28%, 13%, 0.7);\n --lumo-shade-80pct: hsla(214, 32%, 13%, 0.8);\n --lumo-shade-90pct: hsla(214, 33%, 13%, 0.9);\n --lumo-shade: hsl(214, 33%, 13%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-tint-5pct);\n --lumo-contrast-10pct: var(--lumo-tint-10pct);\n --lumo-contrast-20pct: var(--lumo-tint-20pct);\n --lumo-contrast-30pct: var(--lumo-tint-30pct);\n --lumo-contrast-40pct: var(--lumo-tint-40pct);\n --lumo-contrast-50pct: var(--lumo-tint-50pct);\n --lumo-contrast-60pct: var(--lumo-tint-60pct);\n --lumo-contrast-70pct: var(--lumo-tint-70pct);\n --lumo-contrast-80pct: var(--lumo-tint-80pct);\n --lumo-contrast-90pct: var(--lumo-tint-90pct);\n --lumo-contrast: var(--lumo-tint);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 86%, 55%);\n --lumo-primary-color-50pct: hsla(214, 86%, 55%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 63%, 0.1);\n --lumo-primary-text-color: hsl(214, 100%, 70%);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 90%, 63%);\n --lumo-error-color-50pct: hsla(3, 90%, 63%, 0.5);\n --lumo-error-color-10pct: hsla(3, 90%, 63%, 0.1);\n --lumo-error-text-color: hsl(3, 100%, 67%);\n\n /* Success */\n --lumo-success-color: hsl(145, 65%, 42%);\n --lumo-success-color-50pct: hsla(145, 65%, 42%, 0.5);\n --lumo-success-color-10pct: hsla(145, 65%, 42%, 0.1);\n --lumo-success-text-color: hsl(145, 85%, 47%);\n }\n\n html {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n [theme~="dark"] {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n color: var(--lumo-header-text-color);\n }\n\n a {\n color: var(--lumo-primary-text-color);\n }\n\n blockquote {\n color: var(--lumo-secondary-text-color);\n }\n\n code,\n pre {\n background-color: var(--lumo-contrast-10pct);\n border-radius: var(--lumo-border-radius-m);\n }\n </style>\n </template>\n</dom-module><dom-module id="lumo-color-legacy">\n <template>\n <style include="lumo-color">\n :host {\n color: var(--lumo-body-text-color) !important;\n background-color: var(--lumo-base-color) !important;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(c.content);const m=document.createElement("template");m.innerHTML="<custom-style>\n <style>\n html {\n --lumo-size-xs: 1.625rem;\n --lumo-size-s: 1.875rem;\n --lumo-size-m: 2.25rem;\n --lumo-size-l: 2.75rem;\n --lumo-size-xl: 3.5rem;\n\n /* Icons */\n --lumo-icon-size-s: 1.25em;\n --lumo-icon-size-m: 1.5em;\n --lumo-icon-size-l: 2.25em;\n /* For backwards compatibility */\n --lumo-icon-size: var(--lumo-icon-size-m);\n }\n </style>\n</custom-style>",document.head.appendChild(m.content);const u=document.createElement("template");u.innerHTML="<custom-style>\n <style>\n html {\n /* Square */\n --lumo-space-xs: 0.25rem;\n --lumo-space-s: 0.5rem;\n --lumo-space-m: 1rem;\n --lumo-space-l: 1.5rem;\n --lumo-space-xl: 2.5rem;\n\n /* Wide */\n --lumo-space-wide-xs: calc(var(--lumo-space-xs) / 2) var(--lumo-space-xs);\n --lumo-space-wide-s: calc(var(--lumo-space-s) / 2) var(--lumo-space-s);\n --lumo-space-wide-m: calc(var(--lumo-space-m) / 2) var(--lumo-space-m);\n --lumo-space-wide-l: calc(var(--lumo-space-l) / 2) var(--lumo-space-l);\n --lumo-space-wide-xl: calc(var(--lumo-space-xl) / 2) var(--lumo-space-xl);\n\n /* Tall */\n --lumo-space-tall-xs: var(--lumo-space-xs) calc(var(--lumo-space-xs) / 2);\n --lumo-space-tall-s: var(--lumo-space-s) calc(var(--lumo-space-s) / 2);\n --lumo-space-tall-m: var(--lumo-space-m) calc(var(--lumo-space-m) / 2);\n --lumo-space-tall-l: var(--lumo-space-l) calc(var(--lumo-space-l) / 2);\n --lumo-space-tall-xl: var(--lumo-space-xl) calc(var(--lumo-space-xl) / 2);\n }\n </style>\n</custom-style>",document.head.appendChild(u.content);const d=document.createElement("template");d.innerHTML="<custom-style>\n <style>\n html {\n /* Border radius */\n --lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */\n --lumo-border-radius-m: var(--lumo-border-radius, 0.25em); /* Button, text field, menu overlay, etc */\n --lumo-border-radius-l: 0.5em; /* Dialog, notification, etc */\n --lumo-border-radius: 0.25em; /* Deprecated */\n\n /* Shadow */\n --lumo-box-shadow-xs: 0 1px 4px -1px var(--lumo-shade-50pct);\n --lumo-box-shadow-s: 0 2px 4px -1px var(--lumo-shade-20pct), 0 3px 12px -1px var(--lumo-shade-30pct);\n --lumo-box-shadow-m: 0 2px 6px -1px var(--lumo-shade-20pct), 0 8px 24px -4px var(--lumo-shade-40pct);\n --lumo-box-shadow-l: 0 3px 18px -2px var(--lumo-shade-20pct), 0 12px 48px -6px var(--lumo-shade-40pct);\n --lumo-box-shadow-xl: 0 4px 24px -3px var(--lumo-shade-20pct), 0 18px 64px -8px var(--lumo-shade-40pct);\n\n /* Clickable element cursor */\n --lumo-clickable-cursor: default;\n }\n </style>\n</custom-style>",document.head.appendChild(d.content);const h=document.createElement("template");h.innerHTML='<custom-style>\n <style>\n html {\n /* Font families */\n --lumo-font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n\n /* Font sizes */\n --lumo-font-size-xxs: .75rem;\n --lumo-font-size-xs: .8125rem;\n --lumo-font-size-s: .875rem;\n --lumo-font-size-m: 1rem;\n --lumo-font-size-l: 1.125rem;\n --lumo-font-size-xl: 1.375rem;\n --lumo-font-size-xxl: 1.75rem;\n --lumo-font-size-xxxl: 2.5rem;\n\n /* Line heights */\n --lumo-line-height-xs: 1.25;\n --lumo-line-height-s: 1.375;\n --lumo-line-height-m: 1.625;\n }\n\n </style>\n</custom-style><dom-module id="lumo-typography">\n <template>\n <style>\n html {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n /* Can’t combine with the above selector because that doesn’t work in browsers without native shadow dom */\n :host {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n small,\n [theme~="font-size-s"] {\n font-size: var(--lumo-font-size-s);\n line-height: var(--lumo-line-height-s);\n }\n\n [theme~="font-size-xs"] {\n font-size: var(--lumo-font-size-xs);\n line-height: var(--lumo-line-height-xs);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-weight: 600;\n line-height: var(--lumo-line-height-xs);\n margin-top: 1.25em;\n }\n\n h1 {\n font-size: var(--lumo-font-size-xxxl);\n margin-bottom: 0.75em;\n }\n\n h2 {\n font-size: var(--lumo-font-size-xxl);\n margin-bottom: 0.5em;\n }\n\n h3 {\n font-size: var(--lumo-font-size-xl);\n margin-bottom: 0.5em;\n }\n\n h4 {\n font-size: var(--lumo-font-size-l);\n margin-bottom: 0.5em;\n }\n\n h5 {\n font-size: var(--lumo-font-size-m);\n margin-bottom: 0.25em;\n }\n\n h6 {\n font-size: var(--lumo-font-size-xs);\n margin-bottom: 0;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n }\n\n p,\n blockquote {\n margin-top: 0.5em;\n margin-bottom: 0.75em;\n }\n\n a {\n text-decoration: none;\n }\n\n a:hover {\n text-decoration: underline;\n }\n\n hr {\n display: block;\n align-self: stretch;\n height: 1px;\n border: 0;\n padding: 0;\n margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);\n background-color: var(--lumo-contrast-10pct);\n }\n\n blockquote {\n border-left: 2px solid var(--lumo-contrast-30pct);\n }\n\n b,\n strong {\n font-weight: 600;\n }\n\n /* RTL specific styles */\n\n blockquote[dir="rtl"] {\n border-left: none;\n border-right: 2px solid var(--lumo-contrast-30pct);\n }\n\n </style>\n </template>\n</dom-module>',document.head.appendChild(h.content);
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2017 Vaadin Ltd.
|