@foxy.io/elements 1.15.0-beta.1 → 1.15.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  5. package/dist/cdn/foxy-attribute-card.js +1 -1
  6. package/dist/cdn/foxy-attribute-form.js +1 -1
  7. package/dist/cdn/foxy-cancellation-form.js +1 -1
  8. package/dist/cdn/foxy-collection-page.js +1 -1
  9. package/dist/cdn/foxy-collection-pages.js +1 -1
  10. package/dist/cdn/foxy-coupon-card.js +1 -0
  11. package/dist/cdn/foxy-coupon-code-form.js +1 -0
  12. package/dist/cdn/foxy-coupon-codes-form.js +1 -0
  13. package/dist/cdn/foxy-coupon-form.js +1 -0
  14. package/dist/cdn/foxy-custom-field-card.js +1 -1
  15. package/dist/cdn/foxy-custom-field-form.js +1 -1
  16. package/dist/cdn/foxy-customer-api.js +1 -1
  17. package/dist/cdn/foxy-customer-card.js +1 -1
  18. package/dist/cdn/foxy-customer-form.js +1 -1
  19. package/dist/cdn/foxy-customer-portal-settings.js +4 -807
  20. package/dist/cdn/foxy-customer-portal.js +4 -4
  21. package/dist/cdn/foxy-customer.js +1 -1
  22. package/dist/cdn/foxy-customers-table.js +1 -1
  23. package/dist/cdn/foxy-discount-card.js +1 -1
  24. package/dist/cdn/foxy-donation.js +1 -1
  25. package/dist/cdn/foxy-email-template-form.js +1 -1
  26. package/dist/cdn/foxy-error-entry-card.js +1 -1
  27. package/dist/cdn/foxy-form-dialog.js +1 -1
  28. package/dist/cdn/foxy-generate-codes-form.js +1 -0
  29. package/dist/cdn/foxy-i18n.js +1 -1
  30. package/dist/cdn/foxy-items-form.js +1 -1
  31. package/dist/cdn/foxy-nucleon-element.js +1 -1
  32. package/dist/cdn/foxy-pagination.js +1 -0
  33. package/dist/cdn/foxy-payment-card.js +1 -1
  34. package/dist/cdn/foxy-payment-method-card.js +1 -1
  35. package/dist/cdn/foxy-query-builder.js +1 -69
  36. package/dist/cdn/foxy-sign-in-form.js +1 -1
  37. package/dist/cdn/foxy-spinner.js +1 -1
  38. package/dist/cdn/foxy-subscription-card.js +1 -1
  39. package/dist/cdn/foxy-subscription-form.js +3 -3
  40. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  41. package/dist/cdn/foxy-table.js +1 -1
  42. package/dist/cdn/foxy-tax-card.js +1 -1
  43. package/dist/cdn/foxy-tax-form.js +1 -1
  44. package/dist/cdn/foxy-template-config-form.js +1 -1
  45. package/dist/cdn/foxy-template-form.js +1 -1
  46. package/dist/cdn/foxy-transaction-card.js +1 -1
  47. package/dist/cdn/foxy-transactions-table.js +1 -1
  48. package/dist/cdn/foxy-user-form.js +1 -1
  49. package/dist/cdn/foxy-users-table.js +1 -1
  50. package/dist/cdn/{shared-5c8b531d.js → shared-0bda8ecb.js} +1 -1
  51. package/dist/cdn/{shared-07abcd7b.js → shared-0fcdd1c4.js} +1 -1
  52. package/dist/cdn/{shared-a46edf4b.js → shared-30131f76.js} +1 -1
  53. package/dist/cdn/shared-36629ded.js +131 -0
  54. package/dist/cdn/{shared-bc2bfe52.js → shared-4038cb18.js} +1 -1
  55. package/dist/cdn/{shared-44cfc617.js → shared-423a4840.js} +1 -1
  56. package/dist/cdn/shared-4fa5f144.js +1 -0
  57. package/dist/cdn/shared-51b5e223.js +1 -0
  58. package/dist/cdn/{shared-593f7e2c.js → shared-51e28c83.js} +1 -1
  59. package/dist/cdn/shared-710ed658.js +134 -0
  60. package/dist/cdn/shared-800a5471.js +1 -0
  61. package/dist/cdn/{shared-8a7bee0d.js → shared-8f7a66c4.js} +1 -1
  62. package/dist/cdn/{shared-91e768be.js → shared-9af7b5f0.js} +1 -1
  63. package/dist/cdn/{shared-7a42073a.js → shared-a11160e7.js} +5 -5
  64. package/dist/cdn/{shared-5f54e916.js → shared-a4e6ecb0.js} +1 -1
  65. package/dist/cdn/{shared-b5147166.js → shared-a8d96c23.js} +1 -1
  66. package/dist/cdn/{shared-322e60b1.js → shared-b03b6d72.js} +1 -1
  67. package/dist/cdn/shared-b2330475.js +1 -0
  68. package/dist/cdn/{shared-1761daef.js → shared-c1dadefe.js} +1 -1
  69. package/dist/cdn/shared-c6a4b2d6.js +1 -0
  70. package/dist/cdn/shared-ccea5a33.js +69 -0
  71. package/dist/cdn/shared-cd3c902e.js +1 -0
  72. package/dist/cdn/{shared-34b2c1e2.js → shared-d3831f99.js} +1 -1
  73. package/dist/cdn/shared-d9a260f0.js +1 -0
  74. package/dist/cdn/{shared-e5cbf291.js → shared-f875a4f8.js} +1 -1
  75. package/dist/cdn/{shared-e7f8ffe9.js → shared-fb403e1f.js} +1 -1
  76. package/dist/cdn/shared-ff149b55.js +804 -0
  77. package/dist/cdn/translations/shared/en.json +105 -0
  78. package/dist/elements/private/Checkbox/Checkbox.js +36 -22
  79. package/dist/elements/private/Checkbox/Checkbox.js.map +1 -1
  80. package/dist/elements/private/EditableList/EditableList.d.ts +20 -0
  81. package/dist/elements/private/EditableList/EditableList.js +123 -0
  82. package/dist/elements/private/EditableList/EditableList.js.map +1 -0
  83. package/dist/elements/public/CouponCard/CouponCard.d.ts +29 -0
  84. package/dist/elements/public/CouponCard/CouponCard.js +130 -0
  85. package/dist/elements/public/CouponCard/CouponCard.js.map +1 -0
  86. package/dist/elements/public/CouponCard/index.d.ts +5 -0
  87. package/dist/elements/public/CouponCard/index.js +7 -0
  88. package/dist/elements/public/CouponCard/index.js.map +1 -0
  89. package/dist/elements/public/CouponCard/types.d.ts +15 -0
  90. package/dist/elements/public/CouponCard/types.js +2 -0
  91. package/dist/elements/public/CouponCard/types.js.map +1 -0
  92. package/dist/elements/public/CouponCodeForm/CouponCodeForm.d.ts +45 -0
  93. package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +218 -0
  94. package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -0
  95. package/dist/elements/public/CouponCodeForm/index.d.ts +8 -0
  96. package/dist/elements/public/CouponCodeForm/index.js +10 -0
  97. package/dist/elements/public/CouponCodeForm/index.js.map +1 -0
  98. package/dist/elements/public/CouponCodeForm/types.d.ts +15 -0
  99. package/dist/elements/public/CouponCodeForm/types.js +2 -0
  100. package/dist/elements/public/CouponCodeForm/types.js.map +1 -0
  101. package/dist/elements/public/CouponCodesForm/CouponCodesForm.d.ts +29 -0
  102. package/dist/elements/public/CouponCodesForm/CouponCodesForm.js +209 -0
  103. package/dist/elements/public/CouponCodesForm/CouponCodesForm.js.map +1 -0
  104. package/dist/elements/public/CouponCodesForm/index.d.ts +8 -0
  105. package/dist/elements/public/CouponCodesForm/index.js +12 -0
  106. package/dist/elements/public/CouponCodesForm/index.js.map +1 -0
  107. package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.d.ts +14 -0
  108. package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js +48 -0
  109. package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js.map +1 -0
  110. package/dist/elements/public/CouponCodesForm/types.d.ts +16 -0
  111. package/dist/elements/public/CouponCodesForm/types.js +2 -0
  112. package/dist/elements/public/CouponCodesForm/types.js.map +1 -0
  113. package/dist/elements/public/CouponForm/CouponForm.d.ts +77 -0
  114. package/dist/elements/public/CouponForm/CouponForm.js +1266 -0
  115. package/dist/elements/public/CouponForm/CouponForm.js.map +1 -0
  116. package/dist/elements/public/CouponForm/index.d.ts +19 -0
  117. package/dist/elements/public/CouponForm/index.js +21 -0
  118. package/dist/elements/public/CouponForm/index.js.map +1 -0
  119. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.d.ts +19 -0
  120. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js +98 -0
  121. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js.map +1 -0
  122. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.d.ts +19 -0
  123. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js +51 -0
  124. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js.map +1 -0
  125. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.d.ts +19 -0
  126. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js +52 -0
  127. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js.map +1 -0
  128. package/dist/elements/public/CouponForm/types.d.ts +27 -0
  129. package/dist/elements/public/CouponForm/types.js +2 -0
  130. package/dist/elements/public/CouponForm/types.js.map +1 -0
  131. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +19 -6
  132. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
  133. package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.d.ts +39 -0
  134. package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js +197 -0
  135. package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js.map +1 -0
  136. package/dist/elements/public/GenerateCodesForm/index.d.ts +8 -0
  137. package/dist/elements/public/GenerateCodesForm/index.js +10 -0
  138. package/dist/elements/public/GenerateCodesForm/index.js.map +1 -0
  139. package/dist/elements/public/GenerateCodesForm/types.d.ts +24 -0
  140. package/dist/elements/public/GenerateCodesForm/types.js +2 -0
  141. package/dist/elements/public/GenerateCodesForm/types.js.map +1 -0
  142. package/dist/elements/public/I18n/I18n.js +1 -1
  143. package/dist/elements/public/I18n/I18n.js.map +1 -1
  144. package/dist/elements/public/I18n/format/date.js +7 -6
  145. package/dist/elements/public/I18n/format/date.js.map +1 -1
  146. package/dist/elements/public/I18n/format/discount.d.ts +6 -0
  147. package/dist/elements/public/I18n/format/discount.js +20 -0
  148. package/dist/elements/public/I18n/format/discount.js.map +1 -0
  149. package/dist/elements/public/I18n/format/index.js +4 -0
  150. package/dist/elements/public/I18n/format/index.js.map +1 -1
  151. package/dist/elements/public/I18n/format/ordinal.d.ts +6 -0
  152. package/dist/elements/public/I18n/format/ordinal.js +9 -0
  153. package/dist/elements/public/I18n/format/ordinal.js.map +1 -0
  154. package/dist/elements/public/Pagination/Pagination.d.ts +37 -0
  155. package/dist/elements/public/Pagination/Pagination.js +154 -0
  156. package/dist/elements/public/Pagination/Pagination.js.map +1 -0
  157. package/dist/elements/public/Pagination/index.d.ts +6 -0
  158. package/dist/elements/public/Pagination/index.js +8 -0
  159. package/dist/elements/public/Pagination/index.js.map +1 -0
  160. package/dist/elements/public/Table/Table.js +20 -5
  161. package/dist/elements/public/Table/Table.js.map +1 -1
  162. package/dist/elements/public/index.d.ts +6 -0
  163. package/dist/elements/public/index.defined.d.ts +6 -0
  164. package/dist/elements/public/index.defined.js +6 -0
  165. package/dist/elements/public/index.defined.js.map +1 -1
  166. package/dist/elements/public/index.js +6 -0
  167. package/dist/elements/public/index.js.map +1 -1
  168. package/dist/mixins/themeable.js +80 -4
  169. package/dist/mixins/themeable.js.map +1 -1
  170. package/package.json +1 -1
  171. package/dist/cdn/shared-00563cb0.js +0 -1
  172. package/dist/cdn/shared-35dbd2c5.js +0 -1
  173. package/dist/cdn/shared-9a40309d.js +0 -1
  174. package/dist/cdn/shared-ce1da35d.js +0 -1
  175. package/dist/cdn/shared-d01d809a.js +0 -1
  176. package/dist/cdn/shared-d8ffb279.js +0 -264
  177. package/dist/cdn/shared-f1dc1c6c.js +0 -1
@@ -1,264 +0,0 @@
1
- import{k as e,P as t,A as a,L as i,j as s,h as n,_ as r}from"./shared-63eaded9.js";import"./shared-46ee137f.js";import{E as l,C as o,T as d}from"./shared-df573cea.js";import"./shared-f0a83bd6.js";import{a as u,T as h}from"./shared-bb824ab4.js";import{h as c,P as p,D as m}from"./shared-ff79f3f9.js";import"./shared-ec861f31.js";import"./foxy-i18n.js";import{Q as g,T as v,U as f,V as y,W as _,X as b,Y as x,Z as w,b as C,$ as E,a0 as k,a1 as T,a2 as $,a3 as V,a4 as S,a5 as I,m as A,a6 as M}from"./shared-1761daef.js";import{p as D}from"./shared-87ca7818.js";import{c as q}from"./shared-9a40309d.js";import{s as L}from"./shared-b0f0e8b5.js";import{i as N}from"./shared-a46edf4b.js";var B={raise:g,send:v,sendParent:f,sendUpdate:y,log:_,cancel:b,start:x,stop:w,assign:C,after:E,done:k,respond:T,forwardTo:$,escalate:V,choose:S,pure:I};const j=c`<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(j.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 P extends(l(u(o(d(p))))){static get template(){return c`
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,a=this.inputElement,i=this.value?this.value.length:0;if(this._oldValueLength>=i){const t=getComputedStyle(e).height,i=getComputedStyle(a).width;e.style.display="block",e.style.height=t,a.style.maxWidth=i,a.style.height="auto"}this._oldValueLength=i;const s=a.scrollHeight;s>a.clientHeight&&(a.style.height=s+"px"),a.style.removeProperty("max-width"),e.style.removeProperty("display"),e.style.removeProperty("height"),e.scrollTop=t,this._dispatchIronResizeEventIfNeeded("InputHeight",s)}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(P.is,P);const F=c`<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(F.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 z=c`<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 U;document.head.appendChild(z.content);class O extends h{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(!U){U=super.template.cloneNode(!0);const e=m.import(this.is+"-template","template"),t=e.content.querySelector('[part="decrease-button"]'),a=e.content.querySelector('[part="increase-button"]'),i=e.content.querySelector("style"),s=U.content.querySelector('[part="input-field"]'),n=U.content.querySelector('[name="prefix"]');s.insertBefore(t,n),s.appendChild(a),U.content.appendChild(i)}return U}_createConstraintsObserver(){this._createMethodObserver("_constraintsChanged(required, minlength, maxlength, pattern, min, max, step)")}_constraintsChanged(e,t,a,i,s,n,r){if(!this.invalid)return;const l=e=>!e&&0!==e;l(s)&&l(n)?super._constraintsChanged(e,t,a,i):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 a=this._getIncrement(e,t);this.value&&0!=e&&!this._incrementIsInsideTheLimits(e,t)||this._setValue(a)}_setValue(e){this.value=this.inputElement.value=String(parseFloat(e)),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}_getIncrement(e,t){let a=this.step||1,i=this.min||0;const s=Math.max(this._getMultiplier(t),this._getMultiplier(a),this._getMultiplier(i));a*=s,i*=s;const n=((t=Math.round(t*s))-i)%a;return e>0?(t-n+a)/s:e<0?(t-(n||a))/s:t/s}_getDecimalCount(e){const t=String(e),a=t.indexOf(".");return-1===a?1:t.length-a-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),a=parseFloat(this.value);return!this.value||!this.disabled&&this._incrementIsInsideTheLimits(t,a)}_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(O.is,O);
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 H=c`<dom-module id="vaadin-integer-field-template">
262
-
263
-
264
- </dom-module>`;document.head.appendChild(H.content);class R extends O{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(R.is,R);class Y extends CustomEvent{constructor(e){super("change",{detail:e})}}class W extends CustomEvent{constructor(e){super("change",{detail:e})}}class X extends W{}const K=e((e=>i=>{const{element:s,name:n,strings:r}=i.committer;if(2!==r.length||""!==r[0]||""!==r[1])throw new Error("live directive bindings must not contain any static values");if(i.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(i instanceof t)s[n]!==e&&i.setValue(e);else{if(!(i instanceof a))throw new Error("live directive can only be used on attributes or properties");s.getAttribute(n)!==e&&i.setValue(e)}}));let Q,Z,G=e=>e;class J extends i{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:a}=D(e);return[t.toString(),a]}},this.__getItems=A((e=>{const t=D(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 s(Q||(Q=G`: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 n(Z||(Z=G` <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,K(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 X(this.value))}}const ee=M({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:B.assign({defaultCustomValue:(e,t)=>t.data}),setValue:B.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:B.assign({custom:(e,t)=>t.data}),setItems:B.assign({items:(e,t)=>t.data}),setType:B.assign({type:(e,t)=>t.data}),setMin:B.assign({min:(e,t)=>t.data}),setMax:B.assign({max:(e,t)=>t.data})}});let te,ae,ie,se,ne,re,le,oe,de,ue,he,ce,pe,me=e=>e;const ge=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class ve extends q{constructor(){super(...arguments),this.getText=e=>e,this.__service=N(ee).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":J,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,s(ie||(ie=me`: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,ge]:this.items,t=Array.isArray(this.value),a=this.__service.state.matches("extension.present.selected"),i=n(se||(se=me` ${0} `),e.map(((e,i,s)=>{var r;const l=this.custom&&i===s.length-1,o=l?a:t?!!(null===(r=this.value)||void 0===r?void 0:r.includes(e)):e===String(this.value),d=this.disabled||!this._isI18nReady,u=L({value:l?ge:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":d,"@change":t=>{if(this.readonly)return t.preventDefault();const a=t.target.checked,i=e===ge?this.defaultCustomValue:e,s=this.value;Array.isArray(s)?this.value=e===ge?a?[...s,i]:s.slice(0,s.length-1):a?[i,...s]:s.filter((e=>e!==i)):this.value=a?i:null,this.dispatchEvent(new Y(this.value))}}),h=n(ne||(ne=me` <div> ${0} </div> `),e===ge?this._t("choice.other").toString():n(re||(re=me`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return n(le||(le=me` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),i?"":"hidden",t?function(e,t,a,i,s){const r="transition ease-in-out duration-200",l=`${r} transform ${a?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return n(ae||(ae=me` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",l,a,i,t?"text-disabled":e?"text-secondary":"text-body",s)}(this.readonly,d,o,u,h):function(e,t,a,i,s){const r="transition ease-in-out duration-200",l=`${r} ${t||e?"":"shadow-xs"} transform ${a?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return n(te||(te=me` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",l,a,i,t?"text-disabled":e?"text-secondary":"text-body",s)}(this.readonly,d,o,u,h),e===ge&&a?this.__field:"",e!==ge?n(oe||(oe=me`<slot name="${0}"></slot>`),e):"")})));return n(de||(de=me`<form>${0}</form> `),i)}get __field(){const e=L({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 Y(this.value))}});return"frequency"===this.type?n(ue||(ue=me`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?n(he||(he=me`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?n(ce||(ce=me`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):n(pe||(pe=me`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}export{ve as C,W as D,R as I,Y as a,B as b};
@@ -1 +0,0 @@
1
- import{L as e,_ as s,j as t,h as r}from"./shared-63eaded9.js";import"./shared-46ee137f.js";import"./shared-df573cea.js";import"./shared-f0a83bd6.js";import{T as a}from"./shared-9a40309d.js";import{c as o}from"./shared-4e709717.js";class i extends CustomEvent{constructor(e){super("change",{detail:e})}}let d,c,l=e=>e;class n extends(a(e)){constructor(){super(...arguments),this.readonly=!1,this.disabled=!1,this.checked=!1}static get properties(){return s(s({},super.properties),{},{readonly:{type:Boolean},disabled:{type:Boolean},checked:{type:Boolean}})}static get styles(){return[super.styles,t(d||(d=l`.ml-xxl{margin-left:calc(var(--lumo-space-m) + 1.125rem)}.check{height:1.125rem;width:1.125rem}`))]}render(){return r(c||(c=l` <label class="${0}"> <div class="${0}"> <iron-icon icon="lumo:checkmark" class="${0}"> </iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ?disabled="${0}" data-testid="input" @change="${0}"> </div> <div class="flex-1 font-lumo leading-m -mt-xs ml-m"> <slot></slot> </div> </label> <div class="${0}"> <slot name="content"></slot> </div> `),o({"flex group transition-colors":!0,"cursor-default":this.disabled||this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"cursor-pointer":!this.disabled}),o({"flex-shrink-0 check transition-colors rounded-s border":!0,"focus-within-shadow-outline":!0,"bg-primary text-primary-contrast":!this.readonly&&this.checked,"border-dashed border-contrast-30":this.readonly,"border-transparent":!this.readonly,"opacity-50":this.disabled,"text-secondary bg-contrast-20":!this.readonly&&!this.checked,"group-hover-bg-contrast-30":!this.readonly&&!this.checked}),o({"block w-full h-full transition-transform transform":!0,"scale-100":this.checked,"scale-0":!this.checked}),this.checked,this.disabled,(e=>{if(this.readonly)return e.preventDefault();e.stopPropagation(),this.checked=!this.checked,this.dispatchEvent(new i(this.checked))}),o({"font-lumo ml-xxl transition-colors":!0,"text-disabled":this.disabled}))}}export{n as C};