@foxy.io/elements 1.14.0-beta.3 → 1.14.0-beta.7

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.
Files changed (127) hide show
  1. package/README.md +1 -1
  2. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  3. package/dist/cdn/foxy-address-card.js +1 -1
  4. package/dist/cdn/foxy-address-form.js +1 -1
  5. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  6. package/dist/cdn/foxy-attribute-card.js +1 -1
  7. package/dist/cdn/foxy-attribute-form.js +1 -1
  8. package/dist/cdn/foxy-cancellation-form.js +1 -1
  9. package/dist/cdn/foxy-collection-page.js +1 -1
  10. package/dist/cdn/foxy-collection-pages.js +1 -1
  11. package/dist/cdn/foxy-custom-field-card.js +1 -1
  12. package/dist/cdn/foxy-custom-field-form.js +1 -1
  13. package/dist/cdn/foxy-customer-api.js +1 -1
  14. package/dist/cdn/foxy-customer-card.js +1 -1
  15. package/dist/cdn/foxy-customer-form.js +1 -1
  16. package/dist/cdn/foxy-customer-portal-settings.js +9 -9
  17. package/dist/cdn/foxy-customer-portal.js +2 -2
  18. package/dist/cdn/foxy-customer.js +2 -2
  19. package/dist/cdn/foxy-customers-table.js +1 -1
  20. package/dist/cdn/foxy-discount-card.js +1 -1
  21. package/dist/cdn/foxy-donation.js +1 -1
  22. package/dist/cdn/foxy-email-template-form.js +1 -1
  23. package/dist/cdn/foxy-error-entry-card.js +1 -1
  24. package/dist/cdn/foxy-form-dialog.js +1 -1
  25. package/dist/cdn/foxy-i18n.js +1 -1
  26. package/dist/cdn/foxy-items-form.js +1 -1
  27. package/dist/cdn/foxy-nucleon-element.js +1 -1
  28. package/dist/cdn/foxy-payment-card.js +1 -1
  29. package/dist/cdn/foxy-payment-method-card.js +1 -1
  30. package/dist/cdn/foxy-query-builder.js +1 -1
  31. package/dist/cdn/foxy-sign-in-form.js +1 -1
  32. package/dist/cdn/foxy-spinner.js +1 -1
  33. package/dist/cdn/foxy-subscription-card.js +1 -1
  34. package/dist/cdn/foxy-subscription-form.js +4 -4
  35. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  36. package/dist/cdn/foxy-table.js +1 -1
  37. package/dist/cdn/foxy-tax-card.js +1 -1
  38. package/dist/cdn/foxy-tax-form.js +1 -1
  39. package/dist/cdn/foxy-template-config-form.js +14 -0
  40. package/dist/cdn/foxy-template-form.js +1 -1
  41. package/dist/cdn/foxy-transaction-card.js +1 -1
  42. package/dist/cdn/foxy-transactions-table.js +1 -1
  43. package/dist/cdn/foxy-user-form.js +1 -1
  44. package/dist/cdn/foxy-users-table.js +1 -1
  45. package/dist/cdn/{shared-14788132.js → shared-00563cb0.js} +1 -1
  46. package/dist/cdn/shared-09feabf8.js +1 -0
  47. package/dist/cdn/{shared-57522229.js → shared-0ba88744.js} +1 -1
  48. package/dist/cdn/shared-0ced76a0.js +358 -0
  49. package/dist/cdn/{shared-84df58e1.js → shared-16e28f3b.js} +1 -1
  50. package/dist/cdn/{shared-d196432b.js → shared-16f72e27.js} +1 -1
  51. package/dist/cdn/{shared-82dd0556.js → shared-1761daef.js} +1 -1
  52. package/dist/cdn/{shared-302d8a7b.js → shared-1bafffd0.js} +1 -1
  53. package/dist/cdn/{shared-3534b284.js → shared-200f613b.js} +1 -1
  54. package/dist/cdn/{shared-3e14c0d2.js → shared-218ba06e.js} +1 -1
  55. package/dist/cdn/{shared-acf49ecc.js → shared-34b2c1e2.js} +1 -1
  56. package/dist/cdn/{shared-2b2b56f6.js → shared-3f35fa81.js} +1 -1
  57. package/dist/cdn/{shared-b8349f79.js → shared-44cfc617.js} +1 -1
  58. package/dist/cdn/{shared-dd66b354.js → shared-4d3c7828.js} +1 -1
  59. package/dist/cdn/{shared-c7f352fa.js → shared-50c7a176.js} +1 -1
  60. package/dist/cdn/{shared-a4410f22.js → shared-593f7e2c.js} +1 -1
  61. package/dist/cdn/{shared-d19e2399.js → shared-59e44f29.js} +1 -1
  62. package/dist/cdn/{shared-d97a6ee5.js → shared-63eaded9.js} +3 -3
  63. package/dist/cdn/shared-691da586.js +1 -0
  64. package/dist/cdn/{shared-7fd12533.js → shared-6b7602c7.js} +1 -1
  65. package/dist/cdn/{shared-94c83b2b.js → shared-6d45a07b.js} +1 -1
  66. package/dist/cdn/{shared-2d99835c.js → shared-6ecbc785.js} +1 -1
  67. package/dist/cdn/{shared-bbc97ae0.js → shared-6f7f752e.js} +1 -1
  68. package/dist/cdn/shared-7629a1a5.js +314 -0
  69. package/dist/cdn/shared-8edee4e1.js +264 -0
  70. package/dist/cdn/{shared-652ef7fe.js → shared-9221e6b2.js} +1 -1
  71. package/dist/cdn/{shared-59a0cb0f.js → shared-94b0ae99.js} +1 -1
  72. package/dist/cdn/{shared-3553ff4d.js → shared-a46edf4b.js} +1 -1
  73. package/dist/cdn/{shared-72678c5d.js → shared-a6c047b1.js} +1 -1
  74. package/dist/cdn/shared-ace85f1b.js +1 -0
  75. package/dist/cdn/{shared-27d93838.js → shared-b0f0e8b5.js} +1 -1
  76. package/dist/cdn/{shared-8e38d64f.js → shared-b710881a.js} +2 -2
  77. package/dist/cdn/{shared-dce03b47.js → shared-bb824ab4.js} +1 -1
  78. package/dist/cdn/{shared-e969772e.js → shared-c66e9946.js} +1 -1
  79. package/dist/cdn/shared-d8852c42.js +1 -0
  80. package/dist/cdn/shared-df573cea.js +12 -0
  81. package/dist/cdn/{shared-fda14a3d.js → shared-e7f8ffe9.js} +1 -1
  82. package/dist/cdn/{shared-92442eb1.js → shared-ec861f31.js} +1 -1
  83. package/dist/cdn/{shared-a71bd9f0.js → shared-f0a83bd6.js} +1 -1
  84. package/dist/cdn/translations/shared/en.json +83 -1
  85. package/dist/elements/private/Checkbox/Checkbox.js +5 -1
  86. package/dist/elements/private/Checkbox/Checkbox.js.map +1 -1
  87. package/dist/elements/private/Choice/Choice.js +2 -2
  88. package/dist/elements/private/Choice/Choice.js.map +1 -1
  89. package/dist/elements/private/Group/Group.js +1 -1
  90. package/dist/elements/private/Group/Group.js.map +1 -1
  91. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +1 -1
  92. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -1
  93. package/dist/elements/public/TemplateConfigForm/CountriesList.d.ts +23 -0
  94. package/dist/elements/public/TemplateConfigForm/CountriesList.js +129 -0
  95. package/dist/elements/public/TemplateConfigForm/CountriesList.js.map +1 -0
  96. package/dist/elements/public/TemplateConfigForm/CountryCard.d.ts +20 -0
  97. package/dist/elements/public/TemplateConfigForm/CountryCard.js +125 -0
  98. package/dist/elements/public/TemplateConfigForm/CountryCard.js.map +1 -0
  99. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +34 -0
  100. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +1123 -0
  101. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -0
  102. package/dist/elements/public/TemplateConfigForm/defaults.d.ts +2 -0
  103. package/dist/elements/public/TemplateConfigForm/defaults.js +95 -0
  104. package/dist/elements/public/TemplateConfigForm/defaults.js.map +1 -0
  105. package/dist/elements/public/TemplateConfigForm/index.d.ts +9 -0
  106. package/dist/elements/public/TemplateConfigForm/index.js +11 -0
  107. package/dist/elements/public/TemplateConfigForm/index.js.map +1 -0
  108. package/dist/elements/public/TemplateConfigForm/types.d.ts +116 -0
  109. package/dist/elements/public/TemplateConfigForm/types.js +2 -0
  110. package/dist/elements/public/TemplateConfigForm/types.js.map +1 -0
  111. package/dist/elements/public/TemplateForm/TemplateForm.js +1 -1
  112. package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
  113. package/dist/elements/public/index.d.ts +1 -0
  114. package/dist/elements/public/index.defined.d.ts +1 -0
  115. package/dist/elements/public/index.defined.js +1 -0
  116. package/dist/elements/public/index.defined.js.map +1 -1
  117. package/dist/elements/public/index.js +1 -0
  118. package/dist/elements/public/index.js.map +1 -1
  119. package/dist/mixins/themeable.js +72 -0
  120. package/dist/mixins/themeable.js.map +1 -1
  121. package/package.json +1 -1
  122. package/dist/cdn/shared-04b77f79.js +0 -369
  123. package/dist/cdn/shared-1108653b.js +0 -577
  124. package/dist/cdn/shared-4ee97558.js +0 -1
  125. package/dist/cdn/shared-a0c2bbe0.js +0 -1
  126. package/dist/cdn/shared-a21a7562.js +0 -1
  127. package/dist/cdn/shared-bec929ac.js +0 -1
@@ -1,577 +0,0 @@
1
- import{k as e,P as t,A as i,L as s,j as n,h as a,_ as r,C as o}from"./shared-d97a6ee5.js";import{F as l,P as d,a as h}from"./shared-46ee137f.js";import{E as c,C as u,T as m,a as p}from"./shared-04b77f79.js";import"./shared-a71bd9f0.js";import{a as A,T as g}from"./shared-dce03b47.js";import{h as v,P as y,D as _,a as f,t as b}from"./shared-ff79f3f9.js";import{O as x,I as w}from"./shared-92442eb1.js";import"./foxy-i18n.js";import{Q as E,T as k,U as C,V as I,W as T,X as S,Y as $,Z as B,b as M,$ as V,a0 as L,a1 as D,a2 as q,a3 as R,a4 as O,a5 as Q,m as P,a6 as N}from"./shared-82dd0556.js";import{p as z}from"./shared-87ca7818.js";import{c as F,b as H}from"./shared-2b2b56f6.js";import{s as j}from"./shared-27d93838.js";import{i as U}from"./shared-3553ff4d.js";var K={raise:E,send:k,sendParent:C,sendUpdate:I,log:T,cancel:S,start:$,stop:B,assign:M,after:V,done:L,respond:D,forwardTo:q,escalate:R,choose:O,pure:Q};const W=v`<dom-module id="lumo-text-area" theme-for="vaadin-text-area">
2
- <template>
3
- <style include="lumo-text-field">
4
- [part="input-field"],
5
- [part="input-field"] ::slotted(textarea) {
6
- /* Equal to the implicit padding in vaadin-text-field */
7
- padding-top: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);
8
- padding-bottom: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);
9
- height: auto;
10
- box-sizing: border-box;
11
- transition: background-color 0.1s;
12
- line-height: var(--lumo-line-height-s);
13
- }
14
-
15
- :host(:not([readonly])) [part="input-field"]::after {
16
- display: none;
17
- }
18
-
19
- :host([readonly]) [part="input-field"] {
20
- border: 1px dashed var(--lumo-contrast-30pct);
21
- }
22
-
23
- :host([readonly]) [part="input-field"]::after {
24
- border: none;
25
- }
26
-
27
- :host(:hover:not([readonly]):not([focused]):not([invalid])) [part="input-field"] {
28
- background-color: var(--lumo-contrast-20pct);
29
- }
30
-
31
- @media (pointer: coarse) {
32
- :host(:hover:not([readonly]):not([focused]):not([invalid])) [part="input-field"] {
33
- background-color: var(--lumo-contrast-10pct);
34
- }
35
-
36
- :host(:active:not([readonly]):not([focused])) [part="input-field"] {
37
- background-color: var(--lumo-contrast-20pct);
38
- }
39
- }
40
-
41
- [part="value"],
42
- [part="input-field"] ::slotted(textarea) {
43
- line-height: inherit;
44
- --_lumo-text-field-overflow-mask-image: none;
45
- }
46
-
47
- /* Vertically align icon prefix/suffix with the first line of text */
48
- [part="input-field"] ::slotted(iron-icon) {
49
- margin-top: calc((var(--lumo-icon-size-m) - 1em * var(--lumo-line-height-s)) / -2);
50
- }
51
-
52
- [part="input-field"] [part="value"],
53
- [part="input-field"] ::slotted(textarea) {
54
- white-space: pre-wrap; /* override \`nowrap\` from <vaadin-text-field> */
55
- align-self: stretch; /* override \`baseline\` from <vaadin-text-field> */
56
- }
57
- </style>
58
- </template>
59
- </dom-module>`;document.head.appendChild(W.content);
60
- /**
61
- @license
62
- Copyright (c) 2017 Vaadin Ltd.
63
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
64
- */
65
- class G extends(c(A(u(m(y))))){static get template(){return v`
66
- <style include="vaadin-text-field-shared-styles">
67
- .vaadin-text-area-container {
68
- flex: auto;
69
- max-height: inherit; /* MSIE 11 */
70
- min-height: inherit; /* MSIE 11 */
71
- }
72
-
73
- /* The label, helper text and the error message should neither grow nor shrink. */
74
- [part="label"],
75
- [part="helper-text"],
76
- [part="error-message"] {
77
- flex: none;
78
- }
79
-
80
- [part="input-field"] {
81
- overflow: auto;
82
- -webkit-overflow-scrolling: touch;
83
- }
84
-
85
- [part="value"] {
86
- resize: none;
87
- }
88
-
89
- [part="value"],
90
- [part="input-field"] ::slotted(*) {
91
- align-self: flex-start;
92
- }
93
-
94
- @keyframes vaadin-text-area-appear {
95
- to {
96
- opacity: 1;
97
- }
98
- }
99
-
100
- :host {
101
- animation: 1ms vaadin-text-area-appear;
102
- }
103
-
104
- /* Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=1739079 */
105
- :host([disabled]) [part='value'] {
106
- user-select: none;
107
- }
108
- </style>
109
-
110
- <div class="vaadin-text-area-container">
111
-
112
- <label part="label" on-click="focus" id="[[_labelId]]">[[label]]</label>
113
-
114
- <div part="input-field" id="[[_inputId]]">
115
-
116
- <slot name="prefix"></slot>
117
-
118
- <slot name="textarea">
119
- <textarea part="value"></textarea>
120
- </slot>
121
-
122
- <div part="clear-button" id="clearButton" role="button" aria-label\$="[[i18n.clear]]"></div>
123
- <slot name="suffix"></slot>
124
-
125
- </div>
126
-
127
- <div part="helper-text" id="[[_helperTextId]]">
128
- <slot name="helper">[[helperText]]</slot>
129
- </div>
130
-
131
- <div part="error-message" id="[[_errorId]]" aria-live="assertive" aria-hidden\$="[[_getErrorMessageAriaHidden(invalid, errorMessage, _errorId)]]">[[errorMessage]]</div>
132
-
133
- </div>
134
- `}static get is(){return"vaadin-text-area"}static get version(){return"2.9.0"}static get properties(){return{pattern:{type:String}}}static get observers(){return["_textAreaValueChanged(value)"]}ready(){super.ready(),this._updateHeight(),this.addEventListener("animationend",this._onAnimationEnd)}_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=this.value?this.value.length:0;if(this._oldValueLength>=s){const t=getComputedStyle(e).height,s=getComputedStyle(i).width;e.style.display="block",e.style.height=t,i.style.maxWidth=s,i.style.height="auto"}this._oldValueLength=s;const n=i.scrollHeight;n>i.clientHeight&&(i.style.height=n+"px"),i.style.removeProperty("max-width"),e.style.removeProperty("display"),e.style.removeProperty("height"),e.scrollTop=t,this._dispatchIronResizeEventIfNeeded("InputHeight",n)}checkValidity(){if(!super.checkValidity())return!1;if(!this.pattern||!this.inputElement.value)return!0;try{const e=this.inputElement.value.match(this.pattern);return!!e&&e[0]===e.input}catch(e){return!0}}}customElements.define(G.is,G);const Y=v`<dom-module id="lumo-number-field" theme-for="vaadin-number-field">
135
- <template>
136
- <style include="lumo-field-button">
137
- :host {
138
- width: 8em;
139
- }
140
-
141
- :host([has-controls]:not([theme~="align-right"])) [part="value"] {
142
- text-align: center;
143
- }
144
-
145
- [part="decrease-button"][disabled],
146
- [part="increase-button"][disabled] {
147
- opacity: 0.2;
148
- }
149
-
150
- :host([has-controls]) [part="input-field"] {
151
- padding: 0;
152
- }
153
-
154
- [part="decrease-button"],
155
- [part="increase-button"] {
156
- cursor: pointer;
157
- font-size: var(--lumo-icon-size-s);
158
- width: 1.6em;
159
- height: 1.6em;
160
- }
161
-
162
- [part="decrease-button"]::before,
163
- [part="increase-button"]::before {
164
- margin-top: 0.2em;
165
- }
166
-
167
- /* RTL specific styles */
168
-
169
- :host([dir="rtl"]) [part="value"],
170
- :host([dir="rtl"]) [part="input-field"] ::slotted(input) {
171
- --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
172
- }
173
- </style>
174
- </template>
175
- </dom-module>`;document.head.appendChild(Y.content);
176
- /**
177
- @license
178
- Copyright (c) 2017 Vaadin Ltd.
179
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
180
- */
181
- const J=v`<dom-module id="vaadin-number-field-template">
182
- <template>
183
- <style>
184
- :host([readonly]) [part\$="button"] {
185
- pointer-events: none;
186
- }
187
-
188
- [part="decrease-button"]::before {
189
- content: "−";
190
- }
191
-
192
- [part="increase-button"]::before {
193
- content: "+";
194
- }
195
-
196
- [part="decrease-button"],
197
- [part="increase-button"] {
198
- -webkit-user-select: none;
199
- -moz-user-select: none;
200
- -ms-user-select: none;
201
- user-select: none;
202
- }
203
-
204
- /* Hide the native arrow icons */
205
- [part="value"]::-webkit-outer-spin-button,
206
- [part="value"]::-webkit-inner-spin-button {
207
- -webkit-appearance: none;
208
- margin: 0;
209
- }
210
-
211
- [part="value"] {
212
- /* Older Firefox versions (v47.0) requires !important */
213
- -moz-appearance: textfield !important;
214
- }
215
-
216
- :host([dir="rtl"]) [part="input-field"] {
217
- direction: ltr;
218
- }
219
-
220
- :host([dir="rtl"]) [part="value"]::placeholder {
221
- direction: rtl;
222
- }
223
-
224
- :host([dir="rtl"]) [part="input-field"] ::slotted(input)::placeholder {
225
- direction: rtl;
226
- }
227
-
228
- :host([dir="rtl"]) [part="value"]:-ms-input-placeholder,
229
- :host([dir="rtl"]) [part="input-field"] ::slotted(input):-ms-input-placeholder {
230
- direction: rtl;
231
- }
232
-
233
- :host([dir="rtl"]:not([has-controls])) [part="value"]::placeholder {
234
- text-align: left;
235
- }
236
-
237
- :host([dir="rtl"]:not([has-controls])) [part="input-field"] ::slotted(input)::placeholder {
238
- text-align: left;
239
- }
240
-
241
- :host([dir="rtl"]:not([has-controls])) [part="value"]:-ms-input-placeholder,
242
- :host([dir="rtl"]:not([has-controls])) [part="input-field"] ::slotted(input):-ms-input-placeholder {
243
- text-align: left;
244
- }
245
- </style>
246
-
247
- <div disabled\$="[[!_allowed(-1, value, min, max, step)]]" part="decrease-button" on-click="_decreaseValue" on-touchend="_decreaseButtonTouchend" hidden\$="[[!hasControls]]">
248
- </div>
249
-
250
- <div disabled\$="[[!_allowed(1, value, min, max, step)]]" part="increase-button" on-click="_increaseValue" on-touchend="_increaseButtonTouchend" hidden\$="[[!hasControls]]">
251
- </div>
252
- </template>
253
-
254
-
255
- </dom-module>`;let Z;document.head.appendChild(J.content);class X extends g{static get is(){return"vaadin-number-field"}static get version(){return"2.9.0"}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=_.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);
256
- /**
257
- @license
258
- Copyright (c) 2019 Vaadin Ltd.
259
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
260
- */
261
- const ee=v`<dom-module id="vaadin-integer-field-template">
262
-
263
-
264
- </dom-module>`;document.head.appendChild(ee.content);class te extends X{static get is(){return"vaadin-integer-field"}static get version(){return"2.9.0"}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=e((e=>s=>{const{element:n,name:a,strings:r}=s.committer;if(2!==r.length||""!==r[0]||""!==r[1])throw new Error("live directive bindings must not contain any static values");if(s.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(s instanceof t)n[a]!==e&&s.setValue(e);else{if(!(s instanceof i))throw new Error("live directive can only be used on attributes or properties");n.getAttribute(a)!==e&&s.setValue(e)}}));let le,de,he=e=>e;class ce extends s{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}=z(e);return[t.toString(),i]}},this.__getItems=P((e=>{const t=z(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 n(le||(le=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 a(de||(de=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 ue=N({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,pe,Ae,ge,ve,ye,_e,fe,be,xe,we,Ee,ke,Ce=e=>e;const Ie=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class Te extends F{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":ce,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,n(Ae||(Ae=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 r(r({},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=a(ge||(ge=Ce` ${0} `),e.map(((e,s,n)=>{var r;const o=this.custom&&s===n.length-1,l=o?i:t?!!(null===(r=this.value)||void 0===r?void 0:r.includes(e)):e===String(this.value),d=this.disabled||!this._isI18nReady,h=j({value:o?Ie:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":d||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=a(ve||(ve=Ce` <div> ${0} </div> `),e===Ie?this._t("choice.other").toString():a(ye||(ye=Ce`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return a(_e||(_e=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 r="transition ease-in-out duration-200",o=`${r} transform ${i?"scale-100":"scale-0"} ${e?"text-contrast-20":"text-tint"}`;return a(pe||(pe=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"),r,e?"":t?i?"bg-primary-50":"bg-contrast-10":i?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",o,i,s,t?"text-disabled":e?"text-secondary":"text-body",n)}(this.readonly,d,l,h,c):function(e,t,i,s,n){const r="transition ease-in-out duration-200",o=`${r} ${t||e?"":"shadow-xs"} transform ${i?"scale-100":"scale-0"} ${e?"bg-contrast-20":"bg-tint"}`;return a(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"),r,e?"":t?i?"bg-primary-50":"bg-contrast-10":i?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",o,i,s,t?"text-disabled":e?"text-secondary":"text-body",n)}(this.readonly,d,l,h,c),e===Ie&&i?this.__field:"",e!==Ie?a(fe||(fe=Ce`<slot name="${0}"></slot>`),e):"")})));return a(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?a(xe||(xe=Ce`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?a(we||(we=Ce`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?a(Ee||(Ee=Ce`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):a(ke||(ke=Ce`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}const Se=v`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
265
- <template>
266
- <style>
267
- :host {
268
- -webkit-tap-highlight-color: transparent;
269
- --_lumo-item-selected-icon-display: var(--_lumo-list-box-item-selected-icon-display, block);
270
- }
271
-
272
- /* IE11 flexbox issue workaround (vaadin-items are flex containers with min-height) */
273
- [part="items"] {
274
- display: flex;
275
- flex-direction: column;
276
- }
277
-
278
- [part="items"] ::slotted(*) {
279
- flex: none;
280
- }
281
-
282
- /* Normal item */
283
-
284
- [part="items"] ::slotted(vaadin-item) {
285
- -webkit-tap-highlight-color: var(--lumo-primary-color-10pct);
286
- cursor: default;
287
- }
288
-
289
- [part="items"] ::slotted(vaadin-item) {
290
- outline: none;
291
- border-radius: var(--lumo-border-radius);
292
- padding-left: var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius) / 4));
293
- padding-right: calc(var(--lumo-space-l) + var(--lumo-border-radius) / 4);
294
- }
295
-
296
- /* Workaround to display checkmark in IE11 when list-box is not used in dropdown-menu */
297
- [part="items"] ::slotted(vaadin-item)::before {
298
- display: var(--_lumo-item-selected-icon-display);
299
- }
300
-
301
- /* Hovered item */
302
- /* TODO a workaround until we have "focus-follows-mouse". After that, use the hover style for focus-ring as well */
303
-
304
- [part="items"] ::slotted(vaadin-item:hover:not([disabled])) {
305
- background-color: var(--lumo-primary-color-10pct);
306
- }
307
-
308
- /* Focused item */
309
-
310
- [part="items"] ::slotted([focus-ring]:not([disabled])) {
311
- box-shadow: inset 0 0 0 2px var(--lumo-primary-color-50pct);
312
- }
313
-
314
- @media (pointer: coarse) {
315
- [part="items"] ::slotted(vaadin-item:hover:not([disabled])) {
316
- background-color: transparent;
317
- }
318
-
319
- [part="items"] ::slotted([focus-ring]:not([disabled])) {
320
- box-shadow: none;
321
- }
322
- }
323
-
324
- /* Easily add section dividers */
325
-
326
- [part="items"] ::slotted(hr) {
327
- height: 1px;
328
- border: 0;
329
- padding: 0;
330
- margin: var(--lumo-space-s) var(--lumo-border-radius);
331
- background-color: var(--lumo-contrast-10pct);
332
- }
333
-
334
- /* RTL specific styles */
335
-
336
- :host([dir="rtl"]) [part="items"] ::slotted(vaadin-item) {
337
- padding-left: calc(var(--lumo-space-l) + var(--lumo-border-radius) / 4);
338
- padding-right: var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius) / 4));
339
- }
340
- </style>
341
- </template>
342
- </dom-module>`;document.head.appendChild(Se.content);
343
- /**
344
- @license
345
- Copyright (c) 2017 Vaadin Ltd.
346
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
347
- */
348
- 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 l(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=f.debounce(this._searchReset,b.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=p.detectScrollType(),i=p.getNormalizedScrollLeft(t,this.getAttribute("dir")||"ltr",this._scrollerElement)+e;p.setNormalizedScrollLeft(t,this.getAttribute("dir")||"ltr",this._scrollerElement,i)}}}
349
- /**
350
- @license
351
- Copyright (c) 2019 Vaadin Ltd.
352
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
353
- */,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)}}
354
- /**
355
- @license
356
- Copyright (c) 2017 Vaadin Ltd.
357
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
358
- */;class Me extends(c(Be(m(y)))){static get template(){return v`
359
- <style>
360
- :host {
361
- display: flex;
362
- }
363
-
364
- :host([hidden]) {
365
- display: none !important;
366
- }
367
-
368
- [part="items"] {
369
- height: 100%;
370
- width: 100%;
371
- overflow-y: auto;
372
- -webkit-overflow-scrolling: touch;
373
- }
374
- </style>
375
- <div part="items">
376
- <slot></slot>
377
- </div>
378
- `}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 y||console.warn("Make sure you have imported the vaadin-item element.")}}customElements.define(Me.is,Me);const Ve=v`<dom-module id="lumo-select" theme-for="vaadin-select">
379
- <template>
380
- <style include="lumo-field-button">
381
- :host {
382
- outline: none;
383
- -webkit-tap-highlight-color: transparent;
384
- }
385
-
386
- [selected] {
387
- padding-left: 0;
388
- padding-right: 0;
389
- flex: auto;
390
- }
391
-
392
- :host([theme~="small"]) [selected] {
393
- padding: 0;
394
- min-height: var(--lumo-size-s);
395
- }
396
-
397
- :host([theme~="align-left"]) [selected] {
398
- text-align: left;
399
- }
400
-
401
- :host([theme~="align-right"]) [selected] {
402
- text-align: right;
403
- }
404
-
405
- :host([theme~="align-center"]) [selected] {
406
- text-align: center;
407
- }
408
-
409
- [part="toggle-button"]::before {
410
- content: var(--lumo-icons-dropdown);
411
- }
412
-
413
- /* Highlight the toggle button when hovering over the entire component */
414
- :host(:hover:not([readonly]):not([disabled])) [part="toggle-button"] {
415
- color: var(--lumo-contrast-80pct);
416
- }
417
- </style>
418
- </template>
419
- </dom-module><dom-module id="lumo-select-text-field" theme-for="vaadin-select-text-field">
420
- <template>
421
- <style>
422
- :host([theme~="align-center"]) ::slotted([part~="value"]) {
423
- --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent 0.25em, #000 1.5em);
424
- }
425
-
426
- :host([theme~="align-center"]) ::slotted([part~="value"]) {
427
- --_lumo-text-field-overflow-mask-image: none;
428
- }
429
-
430
- :host([theme~="align-right"]) ::slotted([part~="value"]) {
431
- --_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent 0.25em, #000 1.5em);
432
- }
433
-
434
- [part="input-field"] {
435
- cursor: default;
436
- }
437
-
438
- [part="input-field"] ::slotted([part="value"]) {
439
- display: flex;
440
- }
441
-
442
- /* ShadyCSS limitation workaround */
443
- [part="input-field"] ::slotted([part="value"]) [selected]::before {
444
- display: none;
445
- }
446
-
447
- [part="input-field"]:focus {
448
- outline: none;
449
- }
450
-
451
- /* RTL specific styles */
452
-
453
- :host([theme~="align-left"][dir="rtl"]) ::slotted([part~="value"]) {
454
- --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent 0.25em, #000 1.5em);
455
- }
456
-
457
- :host([theme~="align-center"][dir="rtl"]) ::slotted([part~="value"]) {
458
- --_lumo-text-field-overflow-mask-image: none;
459
- }
460
-
461
- :host([dir="rtl"]) ::slotted([part~="value"]),
462
- :host([theme~="align-right"][dir="rtl"]) ::slotted([part~="value"]) {
463
- --_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent 0.25em, #000 1.5em);
464
- }
465
- </style>
466
- </template>
467
- </dom-module><dom-module id="lumo-select-overlay" theme-for="vaadin-select-overlay">
468
- <template>
469
- <style include="lumo-menu-overlay">
470
- :host {
471
- --_lumo-item-selected-icon-display: block;
472
- }
473
-
474
- :host([bottom-aligned]) {
475
- justify-content: flex-end;
476
- }
477
-
478
- [part~="overlay"] {
479
- min-width: var(--vaadin-select-text-field-width);
480
- }
481
-
482
- /* Small viewport adjustment */
483
- :host([phone]) {
484
- top: 0 !important;
485
- right: 0 !important;
486
- bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
487
- left: 0 !important;
488
- align-items: stretch;
489
- justify-content: flex-end;
490
- }
491
-
492
- :host([theme~="align-left"]) {
493
- text-align: left;
494
- }
495
-
496
- :host([theme~="align-right"]) {
497
- text-align: right;
498
- }
499
-
500
- :host([theme~="align-center"]) {
501
- text-align: center;
502
- }
503
- </style>
504
- </template>
505
- </dom-module>`;document.head.appendChild(Ve.content),
506
- /**
507
- @license
508
- Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
509
- This code may only be used under the BSD style license found at
510
- http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
511
- http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
512
- found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
513
- part of the polymer project is also subject to an additional IP rights grant
514
- found at http://polymer.github.io/PATENTS.txt
515
- */
516
- d({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)}});
517
- /**
518
- @license
519
- Copyright (c) 2017 Vaadin Ltd.
520
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
521
- */
522
- 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 De extends x{static get is(){return"vaadin-select-overlay"}}
523
- /**
524
- @license
525
- Copyright (c) 2017 Vaadin Ltd.
526
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
527
- */
528
- let qe;customElements.define(De.is,De);class Re extends g{static get is(){return"vaadin-select-text-field"}static get template(){if(super.template.content.querySelector('slot[name="input"]'))return super.template;if(!qe){qe=super.template.cloneNode(!0);const e=document.createElement("slot");e.setAttribute("name","value");const t=qe.content.querySelector("input");t.parentElement.replaceChild(e,t),e.appendChild(t)}return qe}get focusElement(){return this.shadowRoot.querySelector("[part=input-field]")}get inputElement(){return this.shadowRoot.querySelector("input")}}customElements.define(Re.is,Re);
529
- /**
530
- @license
531
- Copyright (c) 2017 Vaadin Ltd.
532
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
533
- */
534
- 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(c(u(m(h(w,y))))){static get template(){return v`
535
- <style>
536
- :host {
537
- display: inline-block;
538
- }
539
-
540
- vaadin-select-text-field {
541
- width: 100%;
542
- min-width: 0;
543
- }
544
-
545
- :host([hidden]) {
546
- display: none !important;
547
- }
548
-
549
- [part="toggle-button"] {
550
- font-family: "vaadin-select-icons";
551
- }
552
-
553
- [part="toggle-button"]::before {
554
- content: "\\e900";
555
- }
556
- </style>
557
-
558
- <vaadin-select-text-field placeholder="[[placeholder]]" label="[[label]]" required="[[required]]" invalid="[[invalid]]" error-message="[[errorMessage]]" readonly\$="[[readonly]]" helper-text="[[helperText]]" theme\$="[[theme]]">
559
- <slot name="prefix" slot="prefix"></slot>
560
- <slot name="helper" slot="helper">[[helperText]]</slot>
561
- <div part="value"></div>
562
- <div part="toggle-button" slot="suffix" role="button" aria-haspopup="listbox" aria-label="Toggle"></div>
563
- </vaadin-select-text-field>
564
- <vaadin-select-overlay opened="{{opened}}" with-backdrop="[[_phone]]" phone\$="[[_phone]]" theme\$="[[theme]]"></vaadin-select-overlay>
565
-
566
- <iron-media-query query="[[_phoneMediaQuery]]" query-matches="{{_phone}}"></iron-media-query>
567
- `}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=>{const t=Array.from(e.composedPath()).some((e=>e.nodeType===Node.ELEMENT_NODE&&"helper"===e.getAttribute("slot")));this.opened=!this.readonly&&!t})),this.focusElement.addEventListener("keydown",(e=>this._onKeyDown(e))),this._observer=new l(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={},ze=(e,t,i)=>{const s=i&&i.moduleId||"custom-style-module-"+Pe++;Array.isArray(t)||(t=t?[t]:[]),t.forEach((e=>{if(!(e instanceof o))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 Fe,He,je=e=>e;ze("vaadin-list-box",n(Fe||(Fe=je`
568
- [part='items'] ::slotted(vaadin-item.dropdown-divisor){
569
- color:var(--lumo-contrast-40pct);
570
- box-shadow:0 1px var(--lumo-contrast-10pct);
571
- border-radius:0;
572
- }
573
-
574
- [part='items'] ::slotted(vaadin-item.dropdown-sub-item){
575
- margin-left:var(--lumo-space-l);
576
- }
577
- `)));class Ue extends s{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 r(r({},super.properties),{},{disabled:{type:Boolean},getText:{type:Object,attribute:!1},items:{type:Array},label:{type:String},value:{type:String}})}static get styles(){return H.styles}render(){return a(He||(He=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,We,Ge=e=>e;class Ye extends s{constructor(){super(...arguments),this.variant=null}static get styles(){return[H.styles,n(Ke||(Ke=Ge`@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 r(r({},super.properties),{},{variant:{type:String}})}render(){const e="error"===this.variant?"bg-error-10":"bg-contrast-10",t=null===this.variant?"animated":"";return a(We||(We=Ge` <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 F{constructor(){super(...arguments),this.key=""}static get scopedElements(){return{"x-skeleton":Ye}}static get properties(){return r(r({},super.properties),{},{key:{type:String,reflect:!0},opts:{type:Object}})}static get styles(){return[super.styles,n(Je||(Je=et`:host{display:inline-block}`))]}get whenReady(){return this._whenI18nReady.then((()=>this.updateComplete))}render(){return this._isI18nReady?a(Ze||(Ze=et`${0}<slot></slot>`),this._t(this.key,this.opts)):a(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 F{constructor(){super(...arguments),this.disabled=!1,this.value=[]}static get scopedElements(){return{"x-i18n":tt}}static get properties(){return r(r({},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 a(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)=>a(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&&a(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)))&&a(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 ht(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 ct,ut,mt,pt=e=>e;class At extends lt{render(){return a(ct||(ct=pt` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs text-m uppercase"> ${0} </div> ${0} </div> `),At._allDays.map((e=>a(ut||(ut=pt` <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))))),it(this.value.length>0&&a(mt||(mt=pt` <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))}}At._allDays=new Array(7).fill(0).map(((e,t)=>t));export{Te as C,Ue as D,tt as I,lt as M,Ye as S,At as W,te as a,Qe as b,se as c,ie as d,it as e,K as f,ze as r,ht as t};