@foxy.io/elements 1.11.0-beta.3 → 1.11.0-beta.4
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 +2 -2
- package/dist/cdn/foxy-address-form.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-form.js +1 -0
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +2 -2
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-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-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -230
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +2 -2
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.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-bf28ab5e.js → shared-005e1fc5.js} +1 -1
- package/dist/cdn/{shared-84203d52.js → shared-00811efe.js} +1 -1
- package/dist/cdn/{shared-333c169c.js → shared-07867126.js} +1 -1
- package/dist/cdn/{shared-c70d9713.js → shared-09384e52.js} +1 -1
- package/dist/cdn/{shared-f01a1892.js → shared-1d138c7a.js} +1 -1
- package/dist/cdn/{shared-1a1aa39f.js → shared-2864fa12.js} +1 -1
- package/dist/cdn/{shared-525dd8c8.js → shared-420ef4a6.js} +1 -1
- package/dist/cdn/{shared-a7709d26.js → shared-423c0fb8.js} +1 -1
- package/dist/cdn/{shared-e058cb87.js → shared-50ff98d4.js} +1 -1
- package/dist/cdn/{shared-96de56d4.js → shared-524b3c41.js} +1 -1
- package/dist/cdn/{shared-bba615b8.js → shared-52d3b939.js} +19 -19
- package/dist/cdn/{shared-497fd63c.js → shared-670c194c.js} +1 -1
- package/dist/cdn/shared-7bc6d89f.js +1 -0
- package/dist/cdn/{shared-8057ee9c.js → shared-8dd2593f.js} +1 -1
- package/dist/cdn/{shared-17322a2a.js → shared-93df17fe.js} +5 -5
- package/dist/cdn/shared-957a60e1.js +1 -0
- package/dist/cdn/shared-96fcd96f.js +1 -0
- package/dist/cdn/{shared-9f78e096.js → shared-a4e05ba4.js} +1 -1
- package/dist/cdn/{shared-aac9fed8.js → shared-a6f0d39f.js} +1 -1
- package/dist/cdn/shared-b76c5f57.js +15 -0
- package/dist/cdn/{shared-23966eed.js → shared-c9e0b693.js} +1 -1
- package/dist/cdn/{shared-851b97ef.js → shared-d8160231.js} +1 -1
- package/dist/cdn/shared-dc5928e9.js +1 -0
- package/dist/cdn/{shared-a5fbfdc7.js → shared-e5ab982d.js} +1 -1
- package/dist/cdn/shared-f4119f12.js +230 -0
- package/dist/cdn/{shared-090432b4.js → shared-f62abcd5.js} +1 -1
- package/dist/cdn/{shared-bc29ada7.js → shared-f866a93f.js} +1 -1
- package/dist/cdn/{shared-f06d08d5.js → shared-fd05e1a1.js} +1 -1
- package/dist/cdn/translations/shared/de.json +1 -0
- package/dist/cdn/translations/shared/en.json +1 -0
- package/dist/cdn/translations/shared/es.json +1 -0
- package/dist/elements/public/CollectionPage/CollectionPage.d.ts +2 -0
- package/dist/elements/public/CollectionPage/CollectionPage.js +7 -0
- package/dist/elements/public/CollectionPage/CollectionPage.js.map +1 -1
- package/dist/elements/public/CollectionPage/types.d.ts +3 -0
- package/dist/elements/public/CollectionPage/types.js.map +1 -1
- package/dist/elements/public/CollectionPages/CollectionPages.d.ts +2 -0
- package/dist/elements/public/CollectionPages/CollectionPages.js +7 -0
- package/dist/elements/public/CollectionPages/CollectionPages.js.map +1 -1
- package/dist/elements/public/CollectionPages/types.d.ts +3 -0
- package/dist/elements/public/CollectionPages/types.js.map +1 -1
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.d.ts +49 -0
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +235 -0
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -0
- package/dist/elements/public/CustomFieldForm/index.d.ts +9 -0
- package/dist/elements/public/CustomFieldForm/index.js +11 -0
- package/dist/elements/public/CustomFieldForm/index.js.map +1 -0
- package/dist/elements/public/CustomFieldForm/types.d.ts +22 -0
- package/dist/elements/public/CustomFieldForm/types.js +2 -0
- package/dist/elements/public/CustomFieldForm/types.js.map +1 -0
- package/dist/elements/public/NucleonElement/NucleonElement.d.ts +8 -0
- package/dist/elements/public/NucleonElement/NucleonElement.js +40 -6
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/index.d.ts +1 -0
- package/dist/elements/public/index.defined.d.ts +1 -0
- package/dist/elements/public/index.defined.js +1 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +1 -0
- package/dist/elements/public/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-306080cb.js +0 -1
- package/dist/cdn/shared-361d5d17.js +0 -15
- package/dist/cdn/shared-6872bf5c.js +0 -1
- package/dist/cdn/shared-69d0ca61.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a9 as e,aa as t,ab as i,ac as s,ad as n,ae as a,af as r,ag as o,b as l,ah as d,ai as c,aj as
|
|
1
|
+
import{a9 as e,aa as t,ab as i,ac as s,ad as n,ae as a,af as r,ag as o,b as l,ah as d,ai as c,aj as h,ak as u,al as m,am as A,an as p,d as g,ao as v,a as _,L as y,e as f,c as b,h as x,ap as w,_ as E,aq as k}from"./shared-00811efe.js";import{F as C,P as I,a as S}from"./shared-45d647e4.js";import{E as T,C as $,T as B,a as M}from"./shared-b98f88c9.js";import"./shared-e0248713.js";import{a as V,T as L}from"./shared-3ae39e52.js";import{h as q,P as D,D as R,a as O,t as Q}from"./shared-747b0842.js";import{O as P,I as N}from"./shared-54c485d2.js";import"./foxy-i18n.js";import{p as F}from"./shared-87ca7818.js";import{c as H,b as z}from"./shared-8dd2593f.js";import{s as j}from"./shared-957a60e1.js";import{i as U}from"./shared-a4e05ba4.js";var K={raise:e,send:t,sendParent:i,sendUpdate:s,log:n,cancel:a,start:r,stop:o,assign:l,after:d,done:c,respond:h,forwardTo:u,escalate:m,choose:A,pure:p};const G=q`<dom-module id="lumo-text-area" theme-for="vaadin-text-area">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-text-field">
|
|
4
4
|
[part="input-field"],
|
|
@@ -62,7 +62,7 @@ import{a9 as e,aa as t,ab as i,ac as s,ad as n,ae as a,af as r,ag as o,b as l,ah
|
|
|
62
62
|
Copyright (c) 2017 Vaadin Ltd.
|
|
63
63
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
64
64
|
*/
|
|
65
|
-
class W extends($(
|
|
65
|
+
class W extends(T(V($(B(D))))){static get template(){return q`
|
|
66
66
|
<style include="vaadin-text-field-shared-styles">
|
|
67
67
|
.vaadin-text-area-container {
|
|
68
68
|
flex: auto;
|
|
@@ -126,7 +126,7 @@ class W extends($(L(B(M(R))))){static get template(){return D`
|
|
|
126
126
|
<div part="error-message" id="[[_errorId]]" aria-live="assertive" aria-hidden\$="[[_getErrorMessageAriaHidden(invalid, errorMessage, _errorId)]]">[[errorMessage]]</div>
|
|
127
127
|
|
|
128
128
|
</div>
|
|
129
|
-
`}static get is(){return"vaadin-text-area"}static get version(){return"2.8.4"}static get observers(){return["_textAreaValueChanged(value)"]}ready(){super.ready(),this._updateHeight(),this.addEventListener("animationend",this._onAnimationEnd),this.__safari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}_onAnimationEnd(e){0===e.animationName.indexOf("vaadin-text-area-appear")&&this._updateHeight()}get _slottedTagName(){return"textarea"}_textAreaValueChanged(e){this._updateHeight()}_updateHeight(){const e=this.root.querySelector("[part=input-field]"),t=e.scrollTop,i=this.inputElement,s=getComputedStyle(i).width,n=this.value?this.value.length:0;this._oldValueLength>=n&&(i.style.maxWidth=s,i.style.height="auto",this.__safari&&(e.style.display="block")),this._oldValueLength=n;const a=i.scrollHeight;a>i.clientHeight&&(i.style.height=a+"px"),i.style.removeProperty("max-width"),e.style.removeProperty("display"),e.scrollTop=t,this._dispatchIronResizeEventIfNeeded("InputHeight",a)}}customElements.define(W.is,W);const Y=
|
|
129
|
+
`}static get is(){return"vaadin-text-area"}static get version(){return"2.8.4"}static get observers(){return["_textAreaValueChanged(value)"]}ready(){super.ready(),this._updateHeight(),this.addEventListener("animationend",this._onAnimationEnd),this.__safari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}_onAnimationEnd(e){0===e.animationName.indexOf("vaadin-text-area-appear")&&this._updateHeight()}get _slottedTagName(){return"textarea"}_textAreaValueChanged(e){this._updateHeight()}_updateHeight(){const e=this.root.querySelector("[part=input-field]"),t=e.scrollTop,i=this.inputElement,s=getComputedStyle(i).width,n=this.value?this.value.length:0;this._oldValueLength>=n&&(i.style.maxWidth=s,i.style.height="auto",this.__safari&&(e.style.display="block")),this._oldValueLength=n;const a=i.scrollHeight;a>i.clientHeight&&(i.style.height=a+"px"),i.style.removeProperty("max-width"),e.style.removeProperty("display"),e.scrollTop=t,this._dispatchIronResizeEventIfNeeded("InputHeight",a)}}customElements.define(W.is,W);const Y=q`<dom-module id="lumo-number-field" theme-for="vaadin-number-field">
|
|
130
130
|
<template>
|
|
131
131
|
<style include="lumo-field-button">
|
|
132
132
|
:host {
|
|
@@ -173,7 +173,7 @@ class W extends($(L(B(M(R))))){static get template(){return D`
|
|
|
173
173
|
Copyright (c) 2017 Vaadin Ltd.
|
|
174
174
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
175
175
|
*/
|
|
176
|
-
const J=
|
|
176
|
+
const J=q`<dom-module id="vaadin-number-field-template">
|
|
177
177
|
<template>
|
|
178
178
|
<style>
|
|
179
179
|
:host([readonly]) [part\$="button"] {
|
|
@@ -247,16 +247,16 @@ const J=D`<dom-module id="vaadin-number-field-template">
|
|
|
247
247
|
</template>
|
|
248
248
|
|
|
249
249
|
|
|
250
|
-
</dom-module>`;let Z;document.head.appendChild(J.content);class X extends
|
|
250
|
+
</dom-module>`;let Z;document.head.appendChild(J.content);class X extends L{static get is(){return"vaadin-number-field"}static get version(){return"2.8.4"}static get properties(){return{hasControls:{type:Boolean,value:!1,reflectToAttribute:!0},min:{type:Number,reflectToAttribute:!0,observer:"_minChanged"},max:{type:Number,reflectToAttribute:!0,observer:"_maxChanged"},step:{type:Number,value:1,observer:"_stepChanged"}}}ready(){super.ready(),this.__previousValidInput=this.value||"",this.inputElement.type="number",this.inputElement.addEventListener("change",this.__onInputChange.bind(this))}_decreaseButtonTouchend(e){e.preventDefault(),this._decreaseValue()}_increaseButtonTouchend(e){e.preventDefault(),this._increaseValue()}static get template(){if(!Z){Z=super.template.cloneNode(!0);const e=R.import(this.is+"-template","template"),t=e.content.querySelector('[part="decrease-button"]'),i=e.content.querySelector('[part="increase-button"]'),s=e.content.querySelector("style"),n=Z.content.querySelector('[part="input-field"]'),a=Z.content.querySelector('[name="prefix"]');n.insertBefore(t,a),n.appendChild(i),Z.content.appendChild(s)}return Z}_createConstraintsObserver(){this._createMethodObserver("_constraintsChanged(required, minlength, maxlength, pattern, min, max, step)")}_constraintsChanged(e,t,i,s,n,a,r){if(!this.invalid)return;const o=e=>!e&&0!==e;o(n)&&o(a)?super._constraintsChanged(e,t,i,s):this.validate()}_decreaseValue(){this._incrementValue(-1)}_increaseValue(){this._incrementValue(1)}_incrementValue(e){if(this.disabled||this.readonly)return;let t=parseFloat(this.value);this.value?t<this.min?(e=0,t=this.min):t>this.max&&(e=0,t=this.max):0==this.min&&e<0||0==this.max&&e>0||0==this.max&&0==this.min?(e=0,t=0):(null==this.max||this.max>=0)&&(null==this.min||this.min<=0)?t=0:this.min>0?(t=this.min,this.max<0&&e<0&&(t=this.max),e=0):this.max<0&&(t=this.max,e<0?e=0:this._getIncrement(1,t-this.step)>this.max?t-=2*this.step:t-=this.step);const i=this._getIncrement(e,t);this.value&&0!=e&&!this._incrementIsInsideTheLimits(e,t)||this._setValue(i)}_setValue(e){this.value=this.inputElement.value=String(parseFloat(e)),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}_getIncrement(e,t){let i=this.step||1,s=this.min||0;const n=Math.max(this._getMultiplier(t),this._getMultiplier(i),this._getMultiplier(s));i*=n,s*=n;const a=((t=Math.round(t*n))-s)%i;return e>0?(t-a+i)/n:e<0?(t-(a||i))/n:t/n}_getDecimalCount(e){const t=String(e),i=t.indexOf(".");return-1===i?1:t.length-i-1}_getMultiplier(e){if(!isNaN(e))return Math.pow(10,this._getDecimalCount(e))}_incrementIsInsideTheLimits(e,t){return e<0?null==this.min||this._getIncrement(e,t)>=this.min:e>0?null==this.max||this._getIncrement(e,t)<=this.max:this._getIncrement(e,t)<=this.max&&this._getIncrement(e,t)>=this.min}_allowed(e){const t=e*(this.step||1),i=parseFloat(this.value);return!this.value||!this.disabled&&this._incrementIsInsideTheLimits(t,i)}_stepChanged(e,t){this.__validateByStep=this.__stepChangedCalled||null!==this.getAttribute("step"),this.inputElement.step=this.__validateByStep?e:"any",this.__stepChangedCalled=!0,this.setAttribute("step",e)}_minChanged(e){this.inputElement.min=e}_maxChanged(e){this.inputElement.max=e}_valueChanged(e,t){e&&isNaN(parseFloat(e))?this.value="":"string"!=typeof this.value&&(this.value=String(this.value)),super._valueChanged(this.value,t)}_onKeyDown(e){38==e.keyCode?(e.preventDefault(),this._increaseValue()):40==e.keyCode&&(e.preventDefault(),this._decreaseValue()),super._onKeyDown(e)}__onInputChange(){this.validate()}checkValidity(){return void 0!==this.min||void 0!==this.max||this.__validateByStep?this.inputElement.checkValidity():super.checkValidity()}}window.customElements.define(X.is,X);
|
|
251
251
|
/**
|
|
252
252
|
@license
|
|
253
253
|
Copyright (c) 2019 Vaadin Ltd.
|
|
254
254
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
255
255
|
*/
|
|
256
|
-
const ee=
|
|
256
|
+
const ee=q`<dom-module id="vaadin-integer-field-template">
|
|
257
257
|
|
|
258
258
|
|
|
259
|
-
</dom-module>`;document.head.appendChild(ee.content);class te extends X{static get is(){return"vaadin-integer-field"}static get version(){return"2.8.4"}static get properties(){return{pattern:String,preventInvalidInput:Boolean,minlength:Number,maxlength:Number}}ready(){super.ready(),this._enabledCharPattern="[-+\\d]"}_valueChanged(e,t){if(""!==e&&!this.__isInteger(e))return console.warn(`Trying to set non-integer value "${e}" to <vaadin-integer-field>. Clearing the value.`),void(this.value="");super._valueChanged(e,t)}_stepChanged(e,t){if(!this.__hasOnlyDigits(e))return console.warn(`Trying to set invalid step size "${e}", which is not a positive integer, to <vaadin-integer-field>. Resetting the default value 1.`),void(this.step=1);super._stepChanged(e,t)}__isInteger(e){return/^(-\d)?\d*$/.test(String(e))}__hasOnlyDigits(e){return/^\d*$/.test(String(e))}}window.customElements.define(te.is,te);class ie extends CustomEvent{constructor(e){super("change",{detail:e})}}class se extends CustomEvent{constructor(e){super("change",{detail:e})}}class ne extends CustomEvent{constructor(e){super("change",{detail:e})}}class ae extends ne{}class re extends se{}const oe=g((e=>t=>{const{element:i,name:s,strings:n}=t.committer;if(2!==n.length||""!==n[0]||""!==n[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof v)i[s]!==e&&t.setValue(e);else{if(!(t instanceof f))throw new Error("live directive can only be used on attributes or properties");i.getAttribute(s)!==e&&t.setValue(e)}})),le=new WeakMap,de=g((e=>t=>{const i=le.get(t);if(i!==e){if(le.set(t,e),e)for(const s in e){const n=e[s];if(n===_)continue;const a=s[0],{element:r}=t.committer;if("@"!==a)if("."!==a){if("?"!==a)i&&i[s]===n||(null!=n?r.setAttribute(s,String(n)):r.removeAttribute(s));else if(!i||i[s]!==n){const e=s.slice(1);n?r.setAttribute(e,""):r.removeAttribute(e)}}else i&&i[s]===n||(r[s.slice(1)]=n);else{const e=i&&i[s];if(!e||e!==n){const t=s.slice(1);e&&r.removeEventListener(t,e),r.addEventListener(t,n)}}}if(i)for(const s in i)if(!e||!(s in e)){const e=s[0],{element:n}=t.committer;if("@"===e){n.removeEventListener(s.slice(1),i[s]);continue}if("."===e){n[s.slice(1)]=void 0;continue}if("?"===e){n.removeAttribute(s.slice(1));continue}n.removeAttribute(s)}}}));let ce,ue,he=e=>e;class me extends y{constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:i}=H(e);return[t.toString(),i]}},this.__getItems=b((e=>{const t=H(e).count;return[{value:"d",label:this.__t("day",{count:t})},{value:"w",label:this.__t("week",{count:t})},{value:"m",label:this.__t("month",{count:t})},{value:"y",label:this.__t("year",{count:t})}]}))}static get properties(){return{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String},lang:{type:String}}}static get styles(){return x(ce||(ce=he`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}connectedCallback(){super.connectedCallback(),this.__untrackTranslations=customElements.get("foxy-i18n").onTranslationChange((()=>{var e,t;null===(t=(e=this.__getItems.cache).clear)||void 0===t||t.call(e),this.requestUpdate()}))}render(){return w(ue||(ue=he` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,oe(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.__untrackTranslations)||void 0===e||e.call(this)}checkValidity(){return!0}get __t(){return customElements.get("foxy-i18n").i18next.getFixedT(this.lang)}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new re(this.value))}}const Ae=E({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:K.assign({defaultCustomValue:(e,t)=>t.data}),setValue:K.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:K.assign({custom:(e,t)=>t.data}),setItems:K.assign({items:(e,t)=>t.data}),setType:K.assign({type:(e,t)=>t.data}),setMin:K.assign({min:(e,t)=>t.data}),setMax:K.assign({max:(e,t)=>t.data})}});let pe,ge,ve,fe,_e,ye,be,xe,we,Ee,ke,Ce,Ie,Se=e=>e;const Te=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class $e extends z{constructor(){super(...arguments),this.getText=e=>e,this.__service=U(Ae).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":me,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,x(ve||(ve=Se`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return k(k({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,Te]:this.items,t=Array.isArray(this.value),i=this.__service.state.matches("extension.present.selected"),s=w(fe||(fe=Se` ${0} `),e.map(((e,s,n)=>{var a;const r=this.custom&&s===n.length-1,o=r?i:t?!!(null===(a=this.value)||void 0===a?void 0:a.includes(e)):e===String(this.value),l=this.disabled||!this._isI18nReady,d=de({value:r?Te:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":l||this.readonly,"@change":t=>{const i=t.target.checked,s=e===Te?this.defaultCustomValue:e,n=this.value;Array.isArray(n)?this.value=e===Te?i?[...n,s]:n.slice(0,n.length-1):i?[s,...n]:n.filter((e=>e!==s)):this.value=i?s:null,this.dispatchEvent(new ie(this.value))}}),c=w(_e||(_e=Se` <div> ${0} </div> `),e===Te?this._t("choice.other").toString():w(ye||(ye=Se`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return w(be||(be=Se` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),s?"":"hidden",t?function(e,t,i,s,n){const a="transition ease-in-out duration-200",r=`${a} transform ${i?"scale-100":"scale-0"} ${e?"text-contrast-20":"text-tint"}`;return w(ge||(ge=Se` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-contrast-20":"border-transparent"),a,e?"":t?i?"bg-primary-50":"bg-contrast-10":i?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,i,s,t?"text-disabled":e?"text-secondary":"text-body",n)}(this.readonly,l,o,d,c):function(e,t,i,s,n){const a="transition ease-in-out duration-200",r=`${a} ${t||e?"":"shadow-xs"} transform ${i?"scale-100":"scale-0"} ${e?"bg-contrast-20":"bg-tint"}`;return w(pe||(pe=Se` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-contrast-20":"border-transparent"),a,e?"":t?i?"bg-primary-50":"bg-contrast-10":i?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,i,s,t?"text-disabled":e?"text-secondary":"text-body",n)}(this.readonly,l,o,d,c),e===Te&&i?this.__field:"",e!==Te?w(xe||(xe=Se`<slot name="${0}"></slot>`),e):"")})));return w(we||(we=Se`<form>${0}</form> `),s)}get __field(){const e=de({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new ie(this.value))}});return"frequency"===this.type?w(Ee||(Ee=Se`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?w(ke||(ke=Se`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?w(Ce||(Ce=Se`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):w(Ie||(Ie=Se`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}const Be=D`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
|
|
259
|
+
</dom-module>`;document.head.appendChild(ee.content);class te extends X{static get is(){return"vaadin-integer-field"}static get version(){return"2.8.4"}static get properties(){return{pattern:String,preventInvalidInput:Boolean,minlength:Number,maxlength:Number}}ready(){super.ready(),this._enabledCharPattern="[-+\\d]"}_valueChanged(e,t){if(""!==e&&!this.__isInteger(e))return console.warn(`Trying to set non-integer value "${e}" to <vaadin-integer-field>. Clearing the value.`),void(this.value="");super._valueChanged(e,t)}_stepChanged(e,t){if(!this.__hasOnlyDigits(e))return console.warn(`Trying to set invalid step size "${e}", which is not a positive integer, to <vaadin-integer-field>. Resetting the default value 1.`),void(this.step=1);super._stepChanged(e,t)}__isInteger(e){return/^(-\d)?\d*$/.test(String(e))}__hasOnlyDigits(e){return/^\d*$/.test(String(e))}}window.customElements.define(te.is,te);class ie extends CustomEvent{constructor(e){super("change",{detail:e})}}class se extends CustomEvent{constructor(e){super("change",{detail:e})}}class ne extends CustomEvent{constructor(e){super("change",{detail:e})}}class ae extends ne{}class re extends se{}const oe=g((e=>t=>{const{element:i,name:s,strings:n}=t.committer;if(2!==n.length||""!==n[0]||""!==n[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof v)i[s]!==e&&t.setValue(e);else{if(!(t instanceof _))throw new Error("live directive can only be used on attributes or properties");i.getAttribute(s)!==e&&t.setValue(e)}}));let le,de,ce=e=>e;class he extends y{constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:i}=F(e);return[t.toString(),i]}},this.__getItems=f((e=>{const t=F(e).count;return[{value:"d",label:this.__t("day",{count:t})},{value:"w",label:this.__t("week",{count:t})},{value:"m",label:this.__t("month",{count:t})},{value:"y",label:this.__t("year",{count:t})}]}))}static get properties(){return{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String},lang:{type:String}}}static get styles(){return b(le||(le=ce`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}connectedCallback(){super.connectedCallback(),this.__untrackTranslations=customElements.get("foxy-i18n").onTranslationChange((()=>{var e,t;null===(t=(e=this.__getItems.cache).clear)||void 0===t||t.call(e),this.requestUpdate()}))}render(){return x(de||(de=ce` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,oe(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.__untrackTranslations)||void 0===e||e.call(this)}checkValidity(){return!0}get __t(){return customElements.get("foxy-i18n").i18next.getFixedT(this.lang)}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new re(this.value))}}const ue=w({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:K.assign({defaultCustomValue:(e,t)=>t.data}),setValue:K.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:K.assign({custom:(e,t)=>t.data}),setItems:K.assign({items:(e,t)=>t.data}),setType:K.assign({type:(e,t)=>t.data}),setMin:K.assign({min:(e,t)=>t.data}),setMax:K.assign({max:(e,t)=>t.data})}});let me,Ae,pe,ge,ve,_e,ye,fe,be,xe,we,Ee,ke,Ce=e=>e;const Ie=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class Se extends H{constructor(){super(...arguments),this.getText=e=>e,this.__service=U(ue).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":he,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,b(pe||(pe=Ce`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return E(E({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,Ie]:this.items,t=Array.isArray(this.value),i=this.__service.state.matches("extension.present.selected"),s=x(ge||(ge=Ce` ${0} `),e.map(((e,s,n)=>{var a;const r=this.custom&&s===n.length-1,o=r?i:t?!!(null===(a=this.value)||void 0===a?void 0:a.includes(e)):e===String(this.value),l=this.disabled||!this._isI18nReady,d=j({value:r?Ie:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":l||this.readonly,"@change":t=>{const i=t.target.checked,s=e===Ie?this.defaultCustomValue:e,n=this.value;Array.isArray(n)?this.value=e===Ie?i?[...n,s]:n.slice(0,n.length-1):i?[s,...n]:n.filter((e=>e!==s)):this.value=i?s:null,this.dispatchEvent(new ie(this.value))}}),c=x(ve||(ve=Ce` <div> ${0} </div> `),e===Ie?this._t("choice.other").toString():x(_e||(_e=Ce`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return x(ye||(ye=Ce` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),s?"":"hidden",t?function(e,t,i,s,n){const a="transition ease-in-out duration-200",r=`${a} transform ${i?"scale-100":"scale-0"} ${e?"text-contrast-20":"text-tint"}`;return x(Ae||(Ae=Ce` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-contrast-20":"border-transparent"),a,e?"":t?i?"bg-primary-50":"bg-contrast-10":i?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,i,s,t?"text-disabled":e?"text-secondary":"text-body",n)}(this.readonly,l,o,d,c):function(e,t,i,s,n){const a="transition ease-in-out duration-200",r=`${a} ${t||e?"":"shadow-xs"} transform ${i?"scale-100":"scale-0"} ${e?"bg-contrast-20":"bg-tint"}`;return x(me||(me=Ce` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-contrast-20":"border-transparent"),a,e?"":t?i?"bg-primary-50":"bg-contrast-10":i?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",r,i,s,t?"text-disabled":e?"text-secondary":"text-body",n)}(this.readonly,l,o,d,c),e===Ie&&i?this.__field:"",e!==Ie?x(fe||(fe=Ce`<slot name="${0}"></slot>`),e):"")})));return x(be||(be=Ce`<form>${0}</form> `),s)}get __field(){const e=j({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new ie(this.value))}});return"frequency"===this.type?x(xe||(xe=Ce`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?x(we||(we=Ce`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?x(Ee||(Ee=Ce`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):x(ke||(ke=Ce`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}const Te=q`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
|
|
260
260
|
<template>
|
|
261
261
|
<style>
|
|
262
262
|
:host {
|
|
@@ -334,23 +334,23 @@ const ee=D`<dom-module id="vaadin-integer-field-template">
|
|
|
334
334
|
}
|
|
335
335
|
</style>
|
|
336
336
|
</template>
|
|
337
|
-
</dom-module>`;document.head.appendChild(
|
|
337
|
+
</dom-module>`;document.head.appendChild(Te.content);
|
|
338
338
|
/**
|
|
339
339
|
@license
|
|
340
340
|
Copyright (c) 2017 Vaadin Ltd.
|
|
341
341
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
342
342
|
*/
|
|
343
|
-
const
|
|
343
|
+
const $e=e=>class extends e{static get properties(){return{_hasVaadinListMixin:{value:!0},selected:{type:Number,reflectToAttribute:!0,notify:!0},orientation:{type:String,reflectToAttribute:!0,value:""},items:{type:Array,readOnly:!0,notify:!0},_searchBuf:{type:String,value:""}}}static get observers(){return["_enhanceItems(items, orientation, selected, disabled)"]}ready(){super.ready(),this.addEventListener("keydown",(e=>this._onKeydown(e))),this.addEventListener("click",(e=>this._onClick(e))),this._observer=new C(this,(e=>{this._setItems(this._filterItems(Array.from(this.children)))}))}_enhanceItems(e,t,i,s){if(!s&&e){this.setAttribute("aria-orientation",t||"vertical"),this.items.forEach((e=>{t?e.setAttribute("orientation",t):e.removeAttribute("orientation"),e.updateStyles()})),this._setFocusable(i);const s=e[i];e.forEach((e=>e.selected=e===s)),s&&!s.disabled&&this._scrollToItem(i)}}get focused(){return this.getRootNode().activeElement}_filterItems(e){return e.filter((e=>e._hasVaadinItemMixin))}_onClick(e){if(e.metaKey||e.shiftKey||e.ctrlKey||e.defaultPrevented)return;const t=this._filterItems(e.composedPath())[0];let i;t&&!t.disabled&&(i=this.items.indexOf(t))>=0&&(this.selected=i)}_searchKey(e,t){this._searchReset=O.debounce(this._searchReset,Q.after(500),(()=>this._searchBuf="")),this._searchBuf+=t.toLowerCase();this.items.some((e=>0===e.textContent.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().indexOf(this._searchBuf)))||(this._searchBuf=t.toLowerCase());const i=1===this._searchBuf.length?e+1:e;return this._getAvailableIndex(i,1,(e=>!(e.disabled||this._isItemHidden(e))&&0===e.textContent.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().indexOf(this._searchBuf)))}get _isRTL(){return!this._vertical&&"rtl"===this.getAttribute("dir")}_onKeydown(e){if(e.metaKey||e.ctrlKey)return;const t=e.key.replace(/^Arrow/,""),i=this.items.indexOf(this.focused);if(/[a-zA-Z0-9]/.test(t)&&1===t.length){const e=this._searchKey(i,t);return void(e>=0&&this._focus(e))}let s,n;const a=this._isRTL?-1:1;this._vertical&&"Up"===t||!this._vertical&&"Left"===t?(n=-a,s=i-a):this._vertical&&"Down"===t||!this._vertical&&"Right"===t?(n=a,s=i+a):"Home"===t?(n=1,s=0):"End"===t&&(n=-1,s=this.items.length-1),s=this._getAvailableIndex(s,n,(e=>!(e.disabled||this._isItemHidden(e)))),s>=0&&(this._focus(s),e.preventDefault())}_getAvailableIndex(e,t,i){const s=this.items.length;for(let n=0;"number"==typeof e&&n<s;n++,e+=t||1){e<0?e=s-1:e>=s&&(e=0);if(i(this.items[e]))return e}return-1}_isItemHidden(e){return"none"===getComputedStyle(e).display}_setFocusable(e){e=this._getAvailableIndex(e,1,(e=>!e.disabled));const t=this.items[e]||this.items[0];this.items.forEach((e=>e.tabIndex=e===t?0:-1))}_focus(e){const t=this.items[e];this.items.forEach((e=>e.focused=e===t)),this._setFocusable(e),this._scrollToItem(e),t.focus()}focus(){this._observer&&this._observer.flush();const e=this.querySelector('[tabindex="0"]')||(this.items?this.items[0]:null);e&&e.focus()}get _scrollerElement(){}_scrollToItem(e){const t=this.items[e];if(!t)return;const i=this._vertical?["top","bottom"]:this._isRTL?["right","left"]:["left","right"],s=this._scrollerElement.getBoundingClientRect(),n=(this.items[e+1]||t).getBoundingClientRect(),a=(this.items[e-1]||t).getBoundingClientRect();let r=0;!this._isRTL&&n[i[1]]>=s[i[1]]||this._isRTL&&n[i[1]]<=s[i[1]]?r=n[i[1]]-s[i[1]]:(!this._isRTL&&a[i[0]]<=s[i[0]]||this._isRTL&&a[i[0]]>=s[i[0]])&&(r=a[i[0]]-s[i[0]]),this._scroll(r)}get _vertical(){return"horizontal"!==this.orientation}_scroll(e){if(this._vertical)this._scrollerElement.scrollTop+=e;else{const t=M.detectScrollType(),i=M.getNormalizedScrollLeft(t,this.getAttribute("dir")||"ltr",this._scrollerElement)+e;M.setNormalizedScrollLeft(t,this.getAttribute("dir")||"ltr",this._scrollerElement,i)}}}
|
|
344
344
|
/**
|
|
345
345
|
@license
|
|
346
346
|
Copyright (c) 2019 Vaadin Ltd.
|
|
347
347
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
348
|
-
*/,
|
|
348
|
+
*/,Be=e=>class extends($e(e)){static get properties(){return{multiple:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_multipleChanged"},selectedValues:{type:Array,notify:!0,value:function(){return[]}}}}static get observers(){return["_enhanceMultipleItems(items, multiple, selected, selectedValues, selectedValues.*)"]}ready(){this.addEventListener("click",(e=>this._onMultipleClick(e))),super.ready()}_enhanceMultipleItems(e,t,i,s){if(e&&t){if(s){const t=s.map((t=>e[t]));e.forEach((e=>e.selected=-1!==t.indexOf(e)))}this._scrollToLastSelectedItem()}}_scrollToLastSelectedItem(){const e=this.selectedValues.slice(-1)[0];e&&!e.disabled&&this._scrollToItem(e)}_onMultipleClick(e){const t=this._filterItems(e.composedPath())[0],i=t&&!t.disabled?this.items.indexOf(t):-1;i<0||!this.multiple||(e.preventDefault(),-1!==this.selectedValues.indexOf(i)?this.selectedValues=this.selectedValues.filter((e=>e!==i)):this.selectedValues=this.selectedValues.concat(i))}_multipleChanged(e,t){!e&&t&&(this.selectedValues=[],this.items.forEach((e=>e.selected=!1))),e&&!t&&void 0!==this.selected&&(this.push("selectedValues",this.selected),this.selected=void 0)}}
|
|
349
349
|
/**
|
|
350
350
|
@license
|
|
351
351
|
Copyright (c) 2017 Vaadin Ltd.
|
|
352
352
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
353
|
-
*/;class
|
|
353
|
+
*/;class Me extends(T(Be(B(D)))){static get template(){return q`
|
|
354
354
|
<style>
|
|
355
355
|
:host {
|
|
356
356
|
display: flex;
|
|
@@ -370,7 +370,7 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
370
370
|
<div part="items">
|
|
371
371
|
<slot></slot>
|
|
372
372
|
</div>
|
|
373
|
-
`}static get is(){return"vaadin-list-box"}static get version(){return"1.4.0"}static get properties(){return{orientation:{readOnly:!0}}}constructor(){super(),this.focused}ready(){super.ready(),this.setAttribute("role","list"),setTimeout(this._checkImport.bind(this),2e3)}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}_checkImport(){var e=this.querySelector("vaadin-item");!e||e instanceof
|
|
373
|
+
`}static get is(){return"vaadin-list-box"}static get version(){return"1.4.0"}static get properties(){return{orientation:{readOnly:!0}}}constructor(){super(),this.focused}ready(){super.ready(),this.setAttribute("role","list"),setTimeout(this._checkImport.bind(this),2e3)}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}_checkImport(){var e=this.querySelector("vaadin-item");!e||e instanceof D||console.warn("Make sure you have imported the vaadin-item element.")}}customElements.define(Me.is,Me);const Ve=q`<dom-module id="lumo-select" theme-for="vaadin-select">
|
|
374
374
|
<template>
|
|
375
375
|
<style include="lumo-field-button">
|
|
376
376
|
:host {
|
|
@@ -497,7 +497,7 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
497
497
|
}
|
|
498
498
|
</style>
|
|
499
499
|
</template>
|
|
500
|
-
</dom-module>`;document.head.appendChild(
|
|
500
|
+
</dom-module>`;document.head.appendChild(Ve.content),
|
|
501
501
|
/**
|
|
502
502
|
@license
|
|
503
503
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -508,25 +508,25 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
508
508
|
part of the polymer project is also subject to an additional IP rights grant
|
|
509
509
|
found at http://polymer.github.io/PATENTS.txt
|
|
510
510
|
*/
|
|
511
|
-
|
|
511
|
+
I({is:"iron-media-query",properties:{queryMatches:{type:Boolean,value:!1,readOnly:!0,notify:!0},query:{type:String,observer:"queryChanged"},full:{type:Boolean,value:!1},_boundMQHandler:{value:function(){return this.queryHandler.bind(this)}},_mq:{value:null}},attached:function(){this.style.display="none",this.queryChanged()},detached:function(){this._remove()},_add:function(){this._mq&&this._mq.addListener(this._boundMQHandler)},_remove:function(){this._mq&&this._mq.removeListener(this._boundMQHandler),this._mq=null},queryChanged:function(){this._remove();var e=this.query;e&&(this.full||"("===e[0]||(e="("+e+")"),this._mq=window.matchMedia(e),this._add(),this.queryHandler(this._mq))},queryHandler:function(e){this._setQueryMatches(e.matches)}});
|
|
512
512
|
/**
|
|
513
513
|
@license
|
|
514
514
|
Copyright (c) 2017 Vaadin Ltd.
|
|
515
515
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
516
516
|
*/
|
|
517
|
-
const
|
|
517
|
+
const Le=document.createElement("template");Le.innerHTML='<dom-module id="vaadin-select-overlay-styles" theme-for="vaadin-select-overlay">\n <template>\n <style>\n :host {\n align-items: flex-start;\n justify-content: flex-start;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(Le.content);class qe extends P{static get is(){return"vaadin-select-overlay"}}
|
|
518
518
|
/**
|
|
519
519
|
@license
|
|
520
520
|
Copyright (c) 2017 Vaadin Ltd.
|
|
521
521
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
522
522
|
*/
|
|
523
|
-
let
|
|
523
|
+
let De;customElements.define(qe.is,qe);class Re extends L{static get is(){return"vaadin-select-text-field"}static get template(){if(super.template.content.querySelector('slot[name="input"]'))return super.template;if(!De){De=super.template.cloneNode(!0);const e=document.createElement("slot");e.setAttribute("name","value");const t=De.content.querySelector("input");t.parentElement.replaceChild(e,t),e.appendChild(t)}return De}get focusElement(){return this.shadowRoot.querySelector("[part=input-field]")}get inputElement(){return this.shadowRoot.querySelector("input")}}customElements.define(Re.is,Re);
|
|
524
524
|
/**
|
|
525
525
|
@license
|
|
526
526
|
Copyright (c) 2017 Vaadin Ltd.
|
|
527
527
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
528
528
|
*/
|
|
529
|
-
const
|
|
529
|
+
const Oe=document.createElement("template");Oe.innerHTML="<custom-style>\n <style>\n @font-face {\n font-family: \"vaadin-select-icons\";\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAASEAAsAAAAABDgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIGKmNtYXAAAAFoAAAAVAAAAFQXVtKHZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAHwAAAB8CohkJ2hlYWQAAAJAAAAANgAAADYOavgEaGhlYQAAAngAAAAkAAAAJAarA8ZobXR4AAACnAAAABQAAAAUCAABP2xvY2EAAAKwAAAADAAAAAwAKABSbWF4cAAAArwAAAAgAAAAIAAHABduYW1lAAAC3AAAAYYAAAGGmUoJ+3Bvc3QAAARkAAAAIAAAACAAAwAAAAMEAAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QADwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkA//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQE/AUAC6QIVABQAAAEwFx4BFxYxMDc+ATc2MTAjKgEjIgE/ISJPIiEhIk8iIUNCoEJDAhUhIk8iISEiTyIhAAEAAAABAABvL5bdXw889QALBAAAAAAA1jHaeQAAAADWMdp5AAAAAALpAhUAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAukAAQAAAAAAAAAAAAAAAAAAAAUEAAAAAAAAAAAAAAAAAAAABAABPwAAAAAACgAUAB4APgABAAAABQAVAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEABwAAAAEAAAAAAAIABwBgAAEAAAAAAAMABwA2AAEAAAAAAAQABwB1AAEAAAAAAAUACwAVAAEAAAAAAAYABwBLAAEAAAAAAAoAGgCKAAMAAQQJAAEADgAHAAMAAQQJAAIADgBnAAMAAQQJAAMADgA9AAMAAQQJAAQADgB8AAMAAQQJAAUAFgAgAAMAAQQJAAYADgBSAAMAAQQJAAoANACkaWNvbW9vbgBpAGMAbwBtAG8AbwBuVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwaWNvbW9vbgBpAGMAbwBtAG8AbwBuaWNvbW9vbgBpAGMAbwBtAG8AbwBuUmVndWxhcgBSAGUAZwB1AGwAYQByaWNvbW9vbgBpAGMAbwBtAG8AbwBuRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff');\n font-weight: normal;\n font-style: normal;\n }\n </style>\n</custom-style>",document.head.appendChild(Oe.content);class Qe extends(T($(B(S(N,D))))){static get template(){return q`
|
|
530
530
|
<style>
|
|
531
531
|
:host {
|
|
532
532
|
display: inline-block;
|
|
@@ -559,7 +559,7 @@ const Pe=document.createElement("template");Pe.innerHTML="<custom-style>\n <sty
|
|
|
559
559
|
<vaadin-select-overlay opened="{{opened}}" with-backdrop="[[_phone]]" phone\$="[[_phone]]" theme\$="[[theme]]"></vaadin-select-overlay>
|
|
560
560
|
|
|
561
561
|
<iron-media-query query="[[_phoneMediaQuery]]" query-matches="{{_phone}}"></iron-media-query>
|
|
562
|
-
`}static get is(){return"vaadin-select"}static get version(){return"2.4.0"}static get properties(){return{opened:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0,observer:"_openedChanged"},renderer:Function,errorMessage:{type:String,value:""},label:{type:String},value:{type:String,value:"",notify:!0,observer:"_valueChanged"},required:{type:Boolean,reflectToAttribute:!0,observer:"_requiredChanged"},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},name:{type:String,reflectToAttribute:!0},placeholder:{type:String},helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},_phone:Boolean,_phoneMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},_overlayElement:Object,_inputElement:Object,_toggleElement:Object,_items:Object,_contentTemplate:Object,_oldTemplate:Object,_oldRenderer:Object}}static get observers(){return["_updateSelectedItem(value, _items)","_updateAriaExpanded(opened, _toggleElement, _inputElement)","_templateOrRendererChanged(_contentTemplate, renderer, _overlayElement)"]}constructor(){super(),this._boundSetPosition=this._setPosition.bind(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("iron-resize",this._boundSetPosition)}ready(){super.ready(),this._overlayElement=this.shadowRoot.querySelector("vaadin-select-overlay"),this._valueElement=this.shadowRoot.querySelector('[part="value"]'),this._toggleElement=this.shadowRoot.querySelector('[part="toggle-button"]'),this._nativeInput=this.focusElement.shadowRoot.querySelector("input"),this._nativeInput.setAttribute("aria-hidden",!0),this._nativeInput.setAttribute("tabindex",-1),this._nativeInput.style.pointerEvents="none",this.focusElement.addEventListener("click",(e=>this.opened=!this.readonly)),this.focusElement.addEventListener("keydown",(e=>this._onKeyDown(e))),this._observer=new
|
|
562
|
+
`}static get is(){return"vaadin-select"}static get version(){return"2.4.0"}static get properties(){return{opened:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0,observer:"_openedChanged"},renderer:Function,errorMessage:{type:String,value:""},label:{type:String},value:{type:String,value:"",notify:!0,observer:"_valueChanged"},required:{type:Boolean,reflectToAttribute:!0,observer:"_requiredChanged"},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},name:{type:String,reflectToAttribute:!0},placeholder:{type:String},helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},_phone:Boolean,_phoneMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},_overlayElement:Object,_inputElement:Object,_toggleElement:Object,_items:Object,_contentTemplate:Object,_oldTemplate:Object,_oldRenderer:Object}}static get observers(){return["_updateSelectedItem(value, _items)","_updateAriaExpanded(opened, _toggleElement, _inputElement)","_templateOrRendererChanged(_contentTemplate, renderer, _overlayElement)"]}constructor(){super(),this._boundSetPosition=this._setPosition.bind(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("iron-resize",this._boundSetPosition)}ready(){super.ready(),this._overlayElement=this.shadowRoot.querySelector("vaadin-select-overlay"),this._valueElement=this.shadowRoot.querySelector('[part="value"]'),this._toggleElement=this.shadowRoot.querySelector('[part="toggle-button"]'),this._nativeInput=this.focusElement.shadowRoot.querySelector("input"),this._nativeInput.setAttribute("aria-hidden",!0),this._nativeInput.setAttribute("tabindex",-1),this._nativeInput.style.pointerEvents="none",this.focusElement.addEventListener("click",(e=>this.opened=!this.readonly)),this.focusElement.addEventListener("keydown",(e=>this._onKeyDown(e))),this._observer=new C(this,(e=>this._setTemplateFromNodes(e.addedNodes))),this._observer.flush()}_setTemplateFromNodes(e){const t=Array.from(e).filter((e=>e.localName&&"template"===e.localName))[0]||this._contentTemplate;this._overlayElement.template=this._contentTemplate=t,this._setForwardHostProps()}_setForwardHostProps(){if(this._overlayElement.content){const e=this._overlayElement._instance&&this._overlayElement._instance.forwardHostProp;this._overlayElement._instance&&(this._overlayElement._instance.forwardHostProp=(...t)=>{e.apply(this._overlayElement._instance,t),setTimeout((()=>{this._updateValueSlot()}))},this._assignMenuElement())}}render(){this._overlayElement.render(),this._menuElement&&this._menuElement.items&&this._updateSelectedItem(this.value,this._menuElement.items)}_removeNewRendererOrTemplate(e,t,i,s){e!==t?this._contentTemplate=void 0:i!==s&&(this.renderer=void 0)}_templateOrRendererChanged(e,t,i){if(i){if(e&&t)throw this._removeNewRendererOrTemplate(e,this._oldTemplate,t,this._oldRenderer),new Error("You should only use either a renderer or a template for select content");this._oldTemplate=e,this._oldRenderer=t,t&&(i.setProperties({owner:this,renderer:t}),this.render(),i.content.firstChild&&this._assignMenuElement())}}_assignMenuElement(){this._menuElement=Array.from(this._overlayElement.content.children).filter((e=>"style"!==e.localName))[0],this._menuElement&&(this._menuElement.addEventListener("items-changed",(e=>{this._items=this._menuElement.items,this._items.forEach((e=>e.setAttribute("role","option")))})),this._menuElement.addEventListener("selected-changed",(e=>this._updateValueSlot())),this._menuElement.addEventListener("keydown",(e=>this._onKeyDownInside(e))),this._menuElement.addEventListener("click",(e=>{this.__userInteraction=!0,this.opened=!1}),!0),this._menuElement.setAttribute("role","listbox"))}get focusElement(){return this._inputElement||(this._inputElement=this.shadowRoot.querySelector("vaadin-select-text-field"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("iron-resize",this._boundSetPosition),this.opened=!1}notifyResize(){super.notifyResize(),this.positionTarget&&this.opened&&(this._setPosition(),requestAnimationFrame(this._setPosition.bind(this)))}_requiredChanged(e){this.setAttribute("aria-required",e)}_valueChanged(e,t){""===e?this.focusElement.removeAttribute("has-value"):this.focusElement.setAttribute("has-value",""),""===e&&void 0===t||this.validate()}_onKeyDown(e){if(!this.readonly&&!this.opened)if(/^(Enter|SpaceBar|\s|ArrowDown|Down|ArrowUp|Up)$/.test(e.key))e.preventDefault(),this.opened=!0;else if(/[a-zA-Z0-9]/.test(e.key)&&1===e.key.length){const t=this._menuElement.selected,i=void 0!==t?t:-1,s=this._menuElement._searchKey(i,e.key);s>=0&&(this.__userInteraction=!0,this._updateSelectedItem(this._items[s].value,this._items))}}_onKeyDownInside(e){/^(Tab)$/.test(e.key)&&(this.opened=!1)}_openedChanged(e,t){if(e){if(!this._overlayElement||!this._menuElement||!this._toggleElement||!this.focusElement||this.disabled||this.readonly)return void(this.opened=!1);this._openedWithFocusRing=this.hasAttribute("focus-ring")||this.focusElement.hasAttribute("focus-ring"),this._menuElement.focus(),this._setPosition(),window.addEventListener("scroll",this._boundSetPosition,!0)}else t&&(this._phone?this._setFocused(!1):(this.focusElement.focus(),this._openedWithFocusRing&&this.focusElement.setAttribute("focus-ring","")),this.validate(),window.removeEventListener("scroll",this._boundSetPosition,!0))}_hasContent(e){return!!e&&Boolean(e.hasAttribute("label")?e.getAttribute("label"):e.textContent.trim()||e.children.length)}_attachSelectedItem(e){if(!e)return;let t;e.hasAttribute("label")?(t=document.createElement("vaadin-item"),t.textContent=e.getAttribute("label")):t=e.cloneNode(!0),t._sourceItem=e,t.removeAttribute("tabindex"),t.removeAttribute("role"),this._valueElement.appendChild(t),t.selected=!0}_updateAriaExpanded(e,t,i){t&&t.setAttribute("aria-expanded",e),i&&i.focusElement&&i.focusElement.setAttribute("aria-expanded",e)}_updateValueSlot(){this.opened=!1,this._valueElement.innerHTML="";const e=this._items[this._menuElement.selected],t=this._hasContent(e),i=this._inputElement.shadowRoot.querySelector('slot[name="input"]')?"input":"value";this._valueElement.slot=t?i:"",t&&window.ShadyDOM&&window.ShadyDOM.flush(),this._attachSelectedItem(e),!this._valueChanging&&e&&(this._selectedChanging=!0,this.value=e.value||"",this.__userInteraction&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this.__userInteraction=!1),delete this._selectedChanging)}_updateSelectedItem(e,t){t&&(this._menuElement.selected=t.reduce(((t,i,s)=>void 0===t&&i.value===e?s:t),void 0),this._selectedChanging||(this._valueChanging=!0,this._updateValueSlot(),delete this._valueChanging))}_setFocused(e){super._setFocused(this.opened||e),this.focusElement._setFocused(this.hasAttribute("focused")),!this.hasAttribute("focused")&&this.validate()}_setPosition(){const e=this._inputElement.shadowRoot.querySelector('[part~="input-field"]').getBoundingClientRect(),t=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.top>(t-e.height)/2;"rtl"===this.getAttribute("dir")?this._overlayElement.style.right=document.documentElement.clientWidth-e.right+"px":this._overlayElement.style.left=e.left+"px",i?(this._overlayElement.setAttribute("bottom-aligned",""),this._overlayElement.style.removeProperty("top"),this._overlayElement.style.bottom=t-e.bottom+"px"):(this._overlayElement.removeAttribute("bottom-aligned"),this._overlayElement.style.removeProperty("bottom"),this._overlayElement.style.top=e.top+"px"),this._overlayElement.updateStyles({"--vaadin-select-text-field-width":e.width+"px"})}validate(){return!(this.invalid=!(this.disabled||!this.required||this.value))}}customElements.define(Qe.is,Qe);let Pe=0;const Ne={},Fe=(e,t,i)=>{const s=i&&i.moduleId||"custom-style-module-"+Pe++;Array.isArray(t)||(t=t?[t]:[]),t.forEach((e=>{if(!(e instanceof k))throw new Error("An item in styles is not of type CSSResult. Use `unsafeCSS` or `css`.");if(!Ne[e]){const t=document.createElement("dom-module");t.innerHTML=`\n <template>\n <style>${e.toString()}</style>\n </template>\n `;const i="custom-style-module-"+Pe++;t.register(i),Ne[e]=i}}));const n=document.createElement("dom-module");if(e){const t=window.customElements&&window.customElements.get(e);t&&t.hasOwnProperty("__finalized")&&console.warn(`The custom element definition for "${e}"\n was finalized before a style module was registered.\n Make sure to add component specific style modules before\n importing the corresponding custom element.`),n.setAttribute("theme-for",e)}const a=i&&i.include||[];n.innerHTML=`\n <template>\n ${a.map((e=>`<style include=${e}></style>`))}\n ${t.map((e=>`<style include=${Ne[e]}></style>`))}\n </template>\n `,n.register(s)};let He,ze,je=e=>e;Fe("vaadin-list-box",b(He||(He=je`
|
|
563
563
|
[part='items'] ::slotted(vaadin-item.dropdown-divisor){
|
|
564
564
|
color:var(--lumo-contrast-40pct);
|
|
565
565
|
box-shadow:0 1px var(--lumo-contrast-10pct);
|
|
@@ -569,4 +569,4 @@ const Pe=document.createElement("template");Pe.innerHTML="<custom-style>\n <sty
|
|
|
569
569
|
[part='items'] ::slotted(vaadin-item.dropdown-sub-item){
|
|
570
570
|
margin-left:var(--lumo-space-l);
|
|
571
571
|
}
|
|
572
|
-
`)));class Ge extends y{constructor(){super(),this.disabled=!1,this.label="",this.value=null,this.items=null,this.getText=e=>e,this.__unexistentValue=`@foxy.io/elements#dropdown-${Math.random().toFixed(16).substr(2)}`,this.__renderedItems={},this.__list=document.createElement("vaadin-list-box")}static get properties(){return k(k({},super.properties),{},{disabled:{type:Boolean},getText:{type:Object,attribute:!1},items:{type:Array},label:{type:String},value:{type:String}})}static get styles(){return j.styles}render(){return w(Ue||(Ue=Ke` <vaadin-select class="w-full ${0}" data-testid="select" .label="${0}" .value="${0}" .disabled="${0}" .renderer="${0}" @change="${0}"> </vaadin-select> `),this.label?"-mt-m":"",this.label,null===this.value?this.__unexistentValue:this.value,this.disabled,this.__renderItems.bind(this),this.__handleChange)}__renderItems(e){var t;let i=e.querySelector("vaadin-list-box");null===i&&(e.appendChild(this.__list),i=this.__list);for(const e of Object.values(this.__renderedItems))e.dataset.keep="";const s=null!==(t=this.items)&&void 0!==t?t:[];for(let e=0;e<s.length;++e)if("string"==typeof s[e])this.__addOrKeepItem(s[e],s[e],i).classList.add("dropdown-item");else if(Array.isArray(s[e])){const t=this.__addOrKeepItem(s[e][0],s[e][0],i);t.classList.add("dropdown-item","dropdown-divisor"),t.disabled=!0;for(const t of s[e][1])this.__addOrKeepItem(s[e][0]+": "+t,t,i).classList.add("dropdown-sub-item")}for(const e of Object.values(this.__renderedItems)){const t=e;t.dataset.keep||(e.remove(),delete this.__renderedItems[t.dataset.trackId])}}__addOrKeepItem(e,t,i){let s;return this.__renderedItems[e]?s=this.__renderedItems[e]:(s=document.createElement("vaadin-item"),this.__renderedItems[e]=s,s.value=e,i.appendChild(s)),s.dataset.keep="true",s.dataset.trackId=e,s.textContent=this.getText(t),s}__handleChange(e){const t=e.target.value,i=t===this.__unexistentValue?null:t;this.dispatchEvent(new se(i))}}let We,Ye,Je=e=>e;class Ze extends y{constructor(){super(...arguments),this.variant=null}static get styles(){return[j.styles,x(We||(We=Je`@keyframes blink{from{opacity:.5}to{opacity:1}}.animated{animation:blink .5s infinite alternate}:host{display:inline-block;min-width:4rem}`))]}static get properties(){return k(k({},super.properties),{},{variant:{type:String}})}render(){const e="error"===this.variant?"bg-error-10":"bg-contrast-10",t=null===this.variant?"animated":"";return w(Ye||(Ye=Je` <div class="relative"> <span class="opacity-0"><slot></slot></span> <div class="${0} ${0} rounded my-xs absolute inset-0"></div> </div> `),e,t)}}let Xe,et,tt,it=e=>e;class st extends z{constructor(){super(...arguments),this.key=""}static get scopedElements(){return{"x-skeleton":Ze}}static get properties(){return k(k({},super.properties),{},{key:{type:String,reflect:!0},opts:{type:Object}})}static get styles(){return[super.styles,x(Xe||(Xe=it`:host{display:inline-block}`))]}get whenReady(){return this._whenI18nReady.then((()=>this.updateComplete))}render(){return this._isI18nReady?w(et||(et=it`${0}<slot></slot>`),this._t(this.key,this.opts)):w(tt||(tt=it`<x-skeleton class="block">${0}<slot></slot></x-skeleton>`),this.key)}}function nt(...e){return e.filter((e=>!!e))}let at,rt,ot,lt,dt=e=>e;class ct extends z{constructor(){super(...arguments),this.disabled=!1,this.value=[]}static get scopedElements(){return{"x-i18n":st}}static get properties(){return k(k({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=ct._allDays.map((e=>{try{return e.toLocaleString(this.lang,{minimumIntegerDigits:2})}catch(t){return e.toString()}}));return w(at||(at=dt` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs" style="max-width:364px;font-feature-settings:'tnum' 1"> ${0} </div> ${0} </div> `),ct._allDays.map(((t,i)=>w(rt||(rt=dt` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(t),e[i],this.disabled,this.value.includes(t),(e=>this._handleChange(e,t))))),nt(this.value.length>0&&w(ot||(ot=dt` <p class="text-s text-tertiary leading-s"> <x-i18n key="monthday-picker.hint" .opts="${0}" .lang="${0}"> </x-i18n> ${0} </p> `),{days:this.value},this.lang,nt([29,30,31].some((e=>this.value.includes(e)))&&w(lt||(lt=dt`<x-i18n key="monthday-picker.warning" .lang="${0}"></x-i18n>`),this.lang)))))}_getLabelClass(e){let t="flex items-center justify-center m-xs p-s rounded text-m font-medium transition duration-200 sm-p-0 sm-h-m sm-w-l ";return this.value.includes(e)||(t+="bg-contrast-5 "),this._isI18nReady&&!this.disabled?(t+="cursor-pointer ",t+=this.value.includes(e)?"text-base ":"hover-bg-primary-10 ",e<29?(t+="focus-within-shadow-outline ",t+=this.value.includes(e)?"bg-primary":"text-body"):(t+="focus-within-shadow-outline-error ",t+=this.value.includes(e)?"bg-error":"text-error")):(t+="text-transparent ",this.value.includes(e)&&(t+=e<29?"bg-primary-50":"bg-error-10")),t}_handleChange(e,t){e.stopPropagation(),this._toggle(t),this._sendChange()}_sendChange(){this.dispatchEvent(new ne(this.value))}_toggle(e){const t=this.value.indexOf(e);this.value=-1===t?[...this.value,e]:this.value.filter(((e,i)=>i!==t))}}ct._allDays=Array.from(new Array(31),((e,t)=>t+1));const ut=document.createElement("template");function ht(e,t,i="long"){const s=new Date;for(;s.getDay()!==e;)s.setDate(s.getDate()+1);return s.toLocaleDateString(t,{weekday:i})}ut.innerHTML='<dom-module id="lumo-badge">\n <template>\n <style>\n [theme~="badge"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n padding: 0.4em calc(0.5em + var(--lumo-border-radius-s) / 4);\n color: var(--lumo-primary-text-color);\n background-color: var(--lumo-primary-color-10pct);\n border-radius: var(--lumo-border-radius-s);\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size-s);\n line-height: 1;\n font-weight: 500;\n text-transform: initial;\n letter-spacing: initial;\n min-width: calc(var(--lumo-line-height-xs) * 1em + 0.45em);\n }\n\n /* Ensure proper vertical alignment */\n [theme~="badge"]::before {\n display: inline-block;\n content: "\\2003";\n width: 0;\n }\n\n [theme~="badge"][theme~="small"] {\n font-size: var(--lumo-font-size-xxs);\n line-height: 1;\n }\n\n /* Colors */\n\n [theme~="badge"][theme~="success"] {\n color: var(--lumo-success-text-color);\n background-color: var(--lumo-success-color-10pct);\n }\n\n [theme~="badge"][theme~="error"] {\n color: var(--lumo-error-text-color);\n background-color: var(--lumo-error-color-10pct);\n }\n\n [theme~="badge"][theme~="contrast"] {\n color: var(--lumo-contrast-80pct);\n background-color: var(--lumo-contrast-5pct);\n }\n\n /* Primary */\n\n [theme~="badge"][theme~="primary"] {\n color: var(--lumo-primary-contrast-color);\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="success"][theme~="primary"] {\n color: var(--lumo-success-contrast-color);\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"][theme~="primary"] {\n color: var(--lumo-error-contrast-color);\n background-color: var(--lumo-error-color);\n }\n\n [theme~="badge"][theme~="contrast"][theme~="primary"] {\n color: var(--lumo-base-color);\n background-color: var(--lumo-contrast);\n }\n\n /* Links */\n\n [theme~="badge"][href]:hover {\n text-decoration: none;\n }\n\n /* Icon */\n\n [theme~="badge"] iron-icon {\n margin: -0.25em 0;\n --iron-icon-width: 1.5em;\n --iron-icon-height: 1.5em;\n }\n\n [theme~="badge"] iron-icon:first-child {\n margin-left: -0.375em;\n }\n\n [theme~="badge"] iron-icon:last-child {\n margin-right: -0.375em;\n }\n\n [theme~="badge"][icon] {\n min-width: 0;\n padding: 0;\n font-size: 1rem;\n --iron-icon-width: var(--lumo-icon-size-m);\n --iron-icon-height: var(--lumo-icon-size-m);\n }\n\n [theme~="badge"][icon][theme~="small"] {\n --iron-icon-width: var(--lumo-icon-size-s);\n --iron-icon-height: var(--lumo-icon-size-s);\n }\n\n /* Empty */\n\n [theme~="badge"]:not([icon]):empty {\n min-width: 0;\n width: 1em;\n height: 1em;\n padding: 0;\n border-radius: 50%;\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="small"]:not([icon]):empty {\n width: 0.75em;\n height: 0.75em;\n }\n\n [theme~="badge"][theme~="contrast"]:not([icon]):empty {\n background-color: var(--lumo-contrast);\n }\n\n [theme~="badge"][theme~="success"]:not([icon]):empty {\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"]:not([icon]):empty {\n background-color: var(--lumo-error-color);\n }\n\n /* Pill */\n\n [theme~="badge"][theme~="pill"] {\n --lumo-border-radius-s: 1em;\n }\n\n /* RTL specific styles */\n\n [dir="rtl"][theme~="badge"] iron-icon:first-child {\n margin-right: -0.375em;\n margin-left: 0;\n }\n\n [dir="rtl"][theme~="badge"] iron-icon:last-child {\n margin-left: -0.375em;\n margin-right: 0;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(ut.content);let mt,At,pt,gt=e=>e;class vt extends ct{render(){return w(mt||(mt=gt` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs text-m uppercase"> ${0} </div> ${0} </div> `),vt._allDays.map((e=>w(At||(At=gt` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(e),ht(e,this.lang,"short"),this.disabled||!this._isI18nReady,this.value.includes(e),(t=>this._handleChange(t,e))))),nt(this.value.length>0&&w(pt||(pt=gt` <p class="text-s text-tertiary leading-s"> <x-i18n key="weekday-picker.hint" .lang="${0}" .opts="${0}"> </x-i18n> </p> `),this.lang,{days:this.value})))}_getLabelClass(e){let t="flex items-center justify-center m-xs h-m w-xl rounded font-medium transition duration-200 ";return this._isI18nReady&&!this.disabled?(t+="cursor-pointer focus-within-shadow-outline ",t+=this.value.includes(e)?"text-base bg-primary":"bg-contrast-5 hover-bg-contrast-10 text-body"):(t+="text-transparent ",t+=this.value.includes(e)?"bg-primary-50":"bg-contrast-5"),t}_sendChange(){this.dispatchEvent(new ae(this.value))}}vt._allDays=new Array(7).fill(0).map(((e,t)=>t));export{$e as C,Ge as D,st as I,ct as M,Ze as S,vt as W,te as a,Ne as b,se as c,ie as d,nt as e,K as f,ze as r,de as s,ht as t};
|
|
572
|
+
`)));class Ue extends y{constructor(){super(),this.disabled=!1,this.label="",this.value=null,this.items=null,this.getText=e=>e,this.__unexistentValue=`@foxy.io/elements#dropdown-${Math.random().toFixed(16).substr(2)}`,this.__renderedItems={},this.__list=document.createElement("vaadin-list-box")}static get properties(){return E(E({},super.properties),{},{disabled:{type:Boolean},getText:{type:Object,attribute:!1},items:{type:Array},label:{type:String},value:{type:String}})}static get styles(){return z.styles}render(){return x(ze||(ze=je` <vaadin-select class="w-full ${0}" data-testid="select" .label="${0}" .value="${0}" .disabled="${0}" .renderer="${0}" @change="${0}"> </vaadin-select> `),this.label?"-mt-m":"",this.label,null===this.value?this.__unexistentValue:this.value,this.disabled,this.__renderItems.bind(this),this.__handleChange)}__renderItems(e){var t;let i=e.querySelector("vaadin-list-box");null===i&&(e.appendChild(this.__list),i=this.__list);for(const e of Object.values(this.__renderedItems))e.dataset.keep="";const s=null!==(t=this.items)&&void 0!==t?t:[];for(let e=0;e<s.length;++e)if("string"==typeof s[e])this.__addOrKeepItem(s[e],s[e],i).classList.add("dropdown-item");else if(Array.isArray(s[e])){const t=this.__addOrKeepItem(s[e][0],s[e][0],i);t.classList.add("dropdown-item","dropdown-divisor"),t.disabled=!0;for(const t of s[e][1])this.__addOrKeepItem(s[e][0]+": "+t,t,i).classList.add("dropdown-sub-item")}for(const e of Object.values(this.__renderedItems)){const t=e;t.dataset.keep||(e.remove(),delete this.__renderedItems[t.dataset.trackId])}}__addOrKeepItem(e,t,i){let s;return this.__renderedItems[e]?s=this.__renderedItems[e]:(s=document.createElement("vaadin-item"),this.__renderedItems[e]=s,s.value=e,i.appendChild(s)),s.dataset.keep="true",s.dataset.trackId=e,s.textContent=this.getText(t),s}__handleChange(e){const t=e.target.value,i=t===this.__unexistentValue?null:t;this.dispatchEvent(new se(i))}}let Ke,Ge,We=e=>e;class Ye extends y{constructor(){super(...arguments),this.variant=null}static get styles(){return[z.styles,b(Ke||(Ke=We`@keyframes blink{from{opacity:.5}to{opacity:1}}.animated{animation:blink .5s infinite alternate}:host{display:inline-block;min-width:4rem}`))]}static get properties(){return E(E({},super.properties),{},{variant:{type:String}})}render(){const e="error"===this.variant?"bg-error-10":"bg-contrast-10",t=null===this.variant?"animated":"";return x(Ge||(Ge=We` <div class="relative"> <span class="opacity-0"><slot></slot></span> <div class="${0} ${0} rounded my-xs absolute inset-0"></div> </div> `),e,t)}}let Je,Ze,Xe,et=e=>e;class tt extends H{constructor(){super(...arguments),this.key=""}static get scopedElements(){return{"x-skeleton":Ye}}static get properties(){return E(E({},super.properties),{},{key:{type:String,reflect:!0},opts:{type:Object}})}static get styles(){return[super.styles,b(Je||(Je=et`:host{display:inline-block}`))]}get whenReady(){return this._whenI18nReady.then((()=>this.updateComplete))}render(){return this._isI18nReady?x(Ze||(Ze=et`${0}<slot></slot>`),this._t(this.key,this.opts)):x(Xe||(Xe=et`<x-skeleton class="block">${0}<slot></slot></x-skeleton>`),this.key)}}function it(...e){return e.filter((e=>!!e))}let st,nt,at,rt,ot=e=>e;class lt extends H{constructor(){super(...arguments),this.disabled=!1,this.value=[]}static get scopedElements(){return{"x-i18n":tt}}static get properties(){return E(E({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=lt._allDays.map((e=>{try{return e.toLocaleString(this.lang,{minimumIntegerDigits:2})}catch(t){return e.toString()}}));return x(st||(st=ot` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs" style="max-width:364px;font-feature-settings:'tnum' 1"> ${0} </div> ${0} </div> `),lt._allDays.map(((t,i)=>x(nt||(nt=ot` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(t),e[i],this.disabled,this.value.includes(t),(e=>this._handleChange(e,t))))),it(this.value.length>0&&x(at||(at=ot` <p class="text-s text-tertiary leading-s"> <x-i18n key="monthday-picker.hint" .opts="${0}" .lang="${0}"> </x-i18n> ${0} </p> `),{days:this.value},this.lang,it([29,30,31].some((e=>this.value.includes(e)))&&x(rt||(rt=ot`<x-i18n key="monthday-picker.warning" .lang="${0}"></x-i18n>`),this.lang)))))}_getLabelClass(e){let t="flex items-center justify-center m-xs p-s rounded text-m font-medium transition duration-200 sm-p-0 sm-h-m sm-w-l ";return this.value.includes(e)||(t+="bg-contrast-5 "),this._isI18nReady&&!this.disabled?(t+="cursor-pointer ",t+=this.value.includes(e)?"text-base ":"hover-bg-primary-10 ",e<29?(t+="focus-within-shadow-outline ",t+=this.value.includes(e)?"bg-primary":"text-body"):(t+="focus-within-shadow-outline-error ",t+=this.value.includes(e)?"bg-error":"text-error")):(t+="text-transparent ",this.value.includes(e)&&(t+=e<29?"bg-primary-50":"bg-error-10")),t}_handleChange(e,t){e.stopPropagation(),this._toggle(t),this._sendChange()}_sendChange(){this.dispatchEvent(new ne(this.value))}_toggle(e){const t=this.value.indexOf(e);this.value=-1===t?[...this.value,e]:this.value.filter(((e,i)=>i!==t))}}lt._allDays=Array.from(new Array(31),((e,t)=>t+1));const dt=document.createElement("template");function ct(e,t,i="long"){const s=new Date;for(;s.getDay()!==e;)s.setDate(s.getDate()+1);return s.toLocaleDateString(t,{weekday:i})}dt.innerHTML='<dom-module id="lumo-badge">\n <template>\n <style>\n [theme~="badge"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n padding: 0.4em calc(0.5em + var(--lumo-border-radius-s) / 4);\n color: var(--lumo-primary-text-color);\n background-color: var(--lumo-primary-color-10pct);\n border-radius: var(--lumo-border-radius-s);\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size-s);\n line-height: 1;\n font-weight: 500;\n text-transform: initial;\n letter-spacing: initial;\n min-width: calc(var(--lumo-line-height-xs) * 1em + 0.45em);\n }\n\n /* Ensure proper vertical alignment */\n [theme~="badge"]::before {\n display: inline-block;\n content: "\\2003";\n width: 0;\n }\n\n [theme~="badge"][theme~="small"] {\n font-size: var(--lumo-font-size-xxs);\n line-height: 1;\n }\n\n /* Colors */\n\n [theme~="badge"][theme~="success"] {\n color: var(--lumo-success-text-color);\n background-color: var(--lumo-success-color-10pct);\n }\n\n [theme~="badge"][theme~="error"] {\n color: var(--lumo-error-text-color);\n background-color: var(--lumo-error-color-10pct);\n }\n\n [theme~="badge"][theme~="contrast"] {\n color: var(--lumo-contrast-80pct);\n background-color: var(--lumo-contrast-5pct);\n }\n\n /* Primary */\n\n [theme~="badge"][theme~="primary"] {\n color: var(--lumo-primary-contrast-color);\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="success"][theme~="primary"] {\n color: var(--lumo-success-contrast-color);\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"][theme~="primary"] {\n color: var(--lumo-error-contrast-color);\n background-color: var(--lumo-error-color);\n }\n\n [theme~="badge"][theme~="contrast"][theme~="primary"] {\n color: var(--lumo-base-color);\n background-color: var(--lumo-contrast);\n }\n\n /* Links */\n\n [theme~="badge"][href]:hover {\n text-decoration: none;\n }\n\n /* Icon */\n\n [theme~="badge"] iron-icon {\n margin: -0.25em 0;\n --iron-icon-width: 1.5em;\n --iron-icon-height: 1.5em;\n }\n\n [theme~="badge"] iron-icon:first-child {\n margin-left: -0.375em;\n }\n\n [theme~="badge"] iron-icon:last-child {\n margin-right: -0.375em;\n }\n\n [theme~="badge"][icon] {\n min-width: 0;\n padding: 0;\n font-size: 1rem;\n --iron-icon-width: var(--lumo-icon-size-m);\n --iron-icon-height: var(--lumo-icon-size-m);\n }\n\n [theme~="badge"][icon][theme~="small"] {\n --iron-icon-width: var(--lumo-icon-size-s);\n --iron-icon-height: var(--lumo-icon-size-s);\n }\n\n /* Empty */\n\n [theme~="badge"]:not([icon]):empty {\n min-width: 0;\n width: 1em;\n height: 1em;\n padding: 0;\n border-radius: 50%;\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="small"]:not([icon]):empty {\n width: 0.75em;\n height: 0.75em;\n }\n\n [theme~="badge"][theme~="contrast"]:not([icon]):empty {\n background-color: var(--lumo-contrast);\n }\n\n [theme~="badge"][theme~="success"]:not([icon]):empty {\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"]:not([icon]):empty {\n background-color: var(--lumo-error-color);\n }\n\n /* Pill */\n\n [theme~="badge"][theme~="pill"] {\n --lumo-border-radius-s: 1em;\n }\n\n /* RTL specific styles */\n\n [dir="rtl"][theme~="badge"] iron-icon:first-child {\n margin-right: -0.375em;\n margin-left: 0;\n }\n\n [dir="rtl"][theme~="badge"] iron-icon:last-child {\n margin-left: -0.375em;\n margin-right: 0;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(dt.content);let ht,ut,mt,At=e=>e;class pt extends lt{render(){return x(ht||(ht=At` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs text-m uppercase"> ${0} </div> ${0} </div> `),pt._allDays.map((e=>x(ut||(ut=At` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(e),ct(e,this.lang,"short"),this.disabled||!this._isI18nReady,this.value.includes(e),(t=>this._handleChange(t,e))))),it(this.value.length>0&&x(mt||(mt=At` <p class="text-s text-tertiary leading-s"> <x-i18n key="weekday-picker.hint" .lang="${0}" .opts="${0}"> </x-i18n> </p> `),this.lang,{days:this.value})))}_getLabelClass(e){let t="flex items-center justify-center m-xs h-m w-xl rounded font-medium transition duration-200 ";return this._isI18nReady&&!this.disabled?(t+="cursor-pointer focus-within-shadow-outline ",t+=this.value.includes(e)?"text-base bg-primary":"bg-contrast-5 hover-bg-contrast-10 text-body"):(t+="text-transparent ",t+=this.value.includes(e)?"bg-primary-50":"bg-contrast-5"),t}_sendChange(){this.dispatchEvent(new ae(this.value))}}pt._allDays=new Array(7).fill(0).map(((e,t)=>t));export{Se as C,Ue as D,tt as I,lt as M,Ye as S,pt as W,te as a,Qe as b,se as c,ie as d,it as e,K as f,Fe as r,ct as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e,A as t}from"./shared-
|
|
1
|
+
import{F as e,A as t}from"./shared-00811efe.js";class s extends t{constructor(t){super({base:new URL(document.baseURI),fetch:(...n)=>new Promise(((c,a)=>{const o="string"==typeof n[0]?new s.WHATWGRequest(...n):n[0];o.headers.set("Content-Type","application/json"),o.headers.set("FOXY-API-VERSION","1");const r=new e("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:o,resolve:c,reject:a});t.dispatchEvent(r),r.defaultPrevented||fetch(o).then(c).catch(a)}))})}}s.FetchEvent=e;export{s as A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as r}from"./shared-00811efe.js";import{p as s}from"./shared-87ca7818.js";function t(t){var a;const e=s(t),n=null!==(a={y:"yearly",m:"monthly",w:"weekly",d:"daily"}[e.units])&&void 0!==a?a:e.units;return r(r({},e),{},{units:n})}export{t as p};
|