@foxy.io/elements 1.24.0-beta.4 → 1.24.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) 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-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-api-browser.js +1 -1
  6. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  8. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  9. package/dist/cdn/foxy-attribute-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-form.js +1 -1
  11. package/dist/cdn/foxy-cancellation-form.js +1 -1
  12. package/dist/cdn/foxy-cart-card.js +1 -1
  13. package/dist/cdn/foxy-cart-form.js +1 -1
  14. package/dist/cdn/foxy-client-card.js +1 -1
  15. package/dist/cdn/foxy-client-form.js +1 -1
  16. package/dist/cdn/foxy-collection-page.js +1 -1
  17. package/dist/cdn/foxy-collection-pages.js +1 -1
  18. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  19. package/dist/cdn/foxy-coupon-card.js +1 -1
  20. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  21. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  22. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-form.js +1 -1
  24. package/dist/cdn/foxy-custom-field-card.js +1 -1
  25. package/dist/cdn/foxy-custom-field-form.js +1 -1
  26. package/dist/cdn/foxy-customer-api.js +1 -1
  27. package/dist/cdn/foxy-customer-card.js +1 -1
  28. package/dist/cdn/foxy-customer-form.js +1 -1
  29. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  30. package/dist/cdn/foxy-customer-portal.js +2 -2
  31. package/dist/cdn/foxy-customer.js +1 -1
  32. package/dist/cdn/foxy-customers-table.js +1 -1
  33. package/dist/cdn/foxy-discount-builder.js +1 -1
  34. package/dist/cdn/foxy-discount-card.js +1 -1
  35. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  36. package/dist/cdn/foxy-donation.js +1 -1
  37. package/dist/cdn/foxy-downloadable-card.js +1 -1
  38. package/dist/cdn/foxy-downloadable-form.js +1 -1
  39. package/dist/cdn/foxy-email-template-card.js +1 -1
  40. package/dist/cdn/foxy-email-template-form.js +1 -1
  41. package/dist/cdn/foxy-error-entry-card.js +1 -1
  42. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  43. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  44. package/dist/cdn/foxy-form-dialog.js +1 -1
  45. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  46. package/dist/cdn/foxy-gift-card-card.js +1 -1
  47. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  48. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  49. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  50. package/dist/cdn/foxy-gift-card-form.js +1 -1
  51. package/dist/cdn/foxy-i18n-editor.js +2 -2
  52. package/dist/cdn/foxy-i18n.js +1 -1
  53. package/dist/cdn/foxy-integration-card.js +1 -1
  54. package/dist/cdn/foxy-integration-form.js +1 -1
  55. package/dist/cdn/foxy-item-card.js +1 -1
  56. package/dist/cdn/foxy-item-category-card.js +1 -1
  57. package/dist/cdn/foxy-item-category-form.js +1 -1
  58. package/dist/cdn/foxy-item-form.js +1 -1
  59. package/dist/cdn/foxy-item-option-card.js +1 -1
  60. package/dist/cdn/foxy-item-option-form.js +1 -1
  61. package/dist/cdn/foxy-items-form.js +1 -1
  62. package/dist/cdn/foxy-nucleon-element.js +1 -1
  63. package/dist/cdn/foxy-pagination.js +1 -1
  64. package/dist/cdn/foxy-passkey-card.js +1 -1
  65. package/dist/cdn/foxy-passkey-form.js +1 -1
  66. package/dist/cdn/foxy-payment-card.js +1 -1
  67. package/dist/cdn/foxy-payment-method-card.js +1 -1
  68. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  69. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  70. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  71. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  72. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  73. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  74. package/dist/cdn/foxy-payments-api.js +1 -1
  75. package/dist/cdn/foxy-query-builder.js +1 -1
  76. package/dist/cdn/foxy-report-form.js +4 -4
  77. package/dist/cdn/foxy-reports-table.js +1 -1
  78. package/dist/cdn/foxy-shipment-card.js +1 -1
  79. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  80. package/dist/cdn/foxy-sign-in-form.js +1 -1
  81. package/dist/cdn/foxy-spinner.js +2 -2
  82. package/dist/cdn/foxy-store-card.js +1 -1
  83. package/dist/cdn/foxy-store-form.js +1 -1
  84. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  85. package/dist/cdn/foxy-subscription-card.js +1 -1
  86. package/dist/cdn/foxy-subscription-form.js +2 -2
  87. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  88. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  89. package/dist/cdn/foxy-table.js +1 -1
  90. package/dist/cdn/foxy-tax-card.js +1 -1
  91. package/dist/cdn/foxy-tax-form.js +1 -1
  92. package/dist/cdn/foxy-template-config-form.js +1 -1
  93. package/dist/cdn/foxy-template-form.js +1 -1
  94. package/dist/cdn/foxy-template-set-card.js +1 -1
  95. package/dist/cdn/foxy-template-set-form.js +1 -1
  96. package/dist/cdn/foxy-transaction-card.js +1 -1
  97. package/dist/cdn/foxy-transaction.js +1 -1
  98. package/dist/cdn/foxy-transactions-table.js +1 -1
  99. package/dist/cdn/foxy-user-card.js +1 -1
  100. package/dist/cdn/foxy-user-form.js +1 -1
  101. package/dist/cdn/foxy-users-table.js +1 -1
  102. package/dist/cdn/foxy-webhook-card.js +1 -1
  103. package/dist/cdn/foxy-webhook-form.js +1 -1
  104. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  105. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  106. package/dist/cdn/{shared-9caffb4d.js → shared-017ab35f.js} +1 -1
  107. package/dist/cdn/{shared-e6828dbf.js → shared-0689b25a.js} +5 -5
  108. package/dist/cdn/shared-0dabe195.js +15 -0
  109. package/dist/cdn/{shared-1b060170.js → shared-125d1a00.js} +1 -1
  110. package/dist/cdn/shared-13cc4ed4.js +9 -0
  111. package/dist/cdn/{shared-ff992ead.js → shared-15fe0f50.js} +1 -1
  112. package/dist/cdn/{shared-379b37e6.js → shared-19c9fe00.js} +7 -11
  113. package/dist/cdn/shared-1b2e0709.js +1 -0
  114. package/dist/cdn/shared-1e43b4db.js +1 -0
  115. package/dist/cdn/{shared-c7f2f1ab.js → shared-1fd59009.js} +1 -1
  116. package/dist/cdn/{shared-31651a9c.js → shared-2fa6a5a0.js} +1 -1
  117. package/dist/cdn/{shared-65318cc1.js → shared-3164d0c3.js} +1 -1
  118. package/dist/cdn/{shared-e10052d0.js → shared-31a891e8.js} +3 -3
  119. package/dist/cdn/{shared-b3ac59eb.js → shared-403af08d.js} +2 -2
  120. package/dist/cdn/{shared-a92ae606.js → shared-421e46e9.js} +1 -1
  121. package/dist/cdn/{shared-dccf0420.js → shared-42adf053.js} +1 -1
  122. package/dist/cdn/{shared-77a4d8e8.js → shared-46f3f71c.js} +1 -1
  123. package/dist/cdn/{shared-e84fa0ea.js → shared-4966b3e4.js} +1 -1
  124. package/dist/cdn/{shared-b48a83b0.js → shared-4a0298cb.js} +1 -1
  125. package/dist/cdn/{shared-17d0db7f.js → shared-4bd1efd7.js} +3 -3
  126. package/dist/cdn/{shared-51d28e6d.js → shared-527abf31.js} +1 -1
  127. package/dist/cdn/{shared-fe54babe.js → shared-53532131.js} +1 -1
  128. package/dist/cdn/{shared-9c626d58.js → shared-5616a12f.js} +1 -1
  129. package/dist/cdn/{shared-c97e0d6e.js → shared-57922341.js} +1 -1
  130. package/dist/cdn/shared-619bcf83.js +1 -0
  131. package/dist/cdn/{shared-ba658670.js → shared-6273b7e1.js} +1 -1
  132. package/dist/cdn/{shared-4904bca4.js → shared-639dda4b.js} +1 -1
  133. package/dist/cdn/{shared-d14c2060.js → shared-6b0498b2.js} +3 -3
  134. package/dist/cdn/{shared-6f84ac3e.js → shared-6b3be508.js} +1 -1
  135. package/dist/cdn/{shared-c6c6ba69.js → shared-6dffe67d.js} +1 -1
  136. package/dist/cdn/{shared-4c956a8e.js → shared-72a13fda.js} +1 -1
  137. package/dist/cdn/{shared-4b67d699.js → shared-763a6797.js} +1 -1
  138. package/dist/cdn/shared-7680d300.js +122 -0
  139. package/dist/cdn/shared-79d01877.js +1 -0
  140. package/dist/cdn/{shared-6abdfcf2.js → shared-7bf6e728.js} +1 -1
  141. package/dist/cdn/{shared-69a21b9d.js → shared-7d4e0011.js} +1 -1
  142. package/dist/cdn/shared-7e887e5b.js +1 -0
  143. package/dist/cdn/{shared-8474bc4a.js → shared-7ead930c.js} +1 -1
  144. package/dist/cdn/shared-7f33a83a.js +12 -12
  145. package/dist/cdn/{shared-6dc64a17.js → shared-8128b5e3.js} +1 -1
  146. package/dist/cdn/{shared-984fcdf5.js → shared-8134d8a7.js} +3 -3
  147. package/dist/cdn/{shared-c4240bc6.js → shared-8465a37a.js} +1 -1
  148. package/dist/cdn/{shared-e7c3b7b6.js → shared-848813a4.js} +1 -1
  149. package/dist/cdn/shared-8528906b.js +1 -0
  150. package/dist/cdn/{shared-a3c73e91.js → shared-897ab5e6.js} +1 -1
  151. package/dist/cdn/{shared-4bbd600d.js → shared-8fbab85c.js} +1 -1
  152. package/dist/cdn/{shared-4dc58b73.js → shared-90be9ac7.js} +1 -1
  153. package/dist/cdn/{shared-0a248c0d.js → shared-91eb066c.js} +1 -1
  154. package/dist/cdn/{shared-1d28220a.js → shared-9765be8f.js} +1 -1
  155. package/dist/cdn/{shared-e6997950.js → shared-9bdd5400.js} +1 -1
  156. package/dist/cdn/{shared-dfe2602a.js → shared-a134d313.js} +1 -1
  157. package/dist/cdn/shared-a6517170.js +1 -0
  158. package/dist/cdn/shared-a7475f62.js +212 -0
  159. package/dist/cdn/shared-a88c5cf1.js +29 -0
  160. package/dist/cdn/{shared-479ad951.js → shared-a96a2154.js} +1 -1
  161. package/dist/cdn/shared-aa22ee61.js +1 -0
  162. package/dist/cdn/shared-aa569a99.js +804 -0
  163. package/dist/cdn/{shared-e8e92fe3.js → shared-ad0256d0.js} +2 -2
  164. package/dist/cdn/{shared-25f64060.js → shared-b334c8b6.js} +1 -1
  165. package/dist/cdn/{shared-1d08a5ad.js → shared-bbbb8894.js} +1 -1
  166. package/dist/cdn/{shared-bafcab47.js → shared-bf2113a4.js} +3 -3
  167. package/dist/cdn/{shared-88e36564.js → shared-c541c9e9.js} +26 -27
  168. package/dist/cdn/{shared-36725fe3.js → shared-c758220c.js} +1 -1
  169. package/dist/cdn/{shared-4674063d.js → shared-c97f7178.js} +27 -27
  170. package/dist/cdn/shared-d2222c8d.js +1 -0
  171. package/dist/cdn/{shared-64f98a0f.js → shared-db06114b.js} +7 -2
  172. package/dist/cdn/{shared-665d6cc4.js → shared-e5786b8b.js} +1 -1
  173. package/dist/cdn/shared-e640e9fa.js +1 -0
  174. package/dist/cdn/{shared-30bebd39.js → shared-eb232194.js} +3 -3
  175. package/dist/cdn/{shared-bdb51db9.js → shared-f4822b9e.js} +1 -1
  176. package/dist/cdn/{shared-db21f6db.js → shared-fa5f0117.js} +2 -2
  177. package/dist/cdn/shared-fc77174e.js +1 -0
  178. package/dist/cdn/shared-fec6fd04.js +1 -0
  179. package/dist/cdn/translations/address-form/en.json +577 -0
  180. package/dist/cdn/translations/customer/en.json +577 -0
  181. package/dist/cdn/translations/customer-portal/en.json +579 -1
  182. package/dist/elements/public/AddressForm/AddressForm.d.ts +2 -1
  183. package/dist/elements/public/AddressForm/AddressForm.js +53 -17
  184. package/dist/elements/public/AddressForm/AddressForm.js.map +1 -1
  185. package/dist/elements/public/AddressForm/countries.d.ts +1 -1
  186. package/dist/elements/public/AddressForm/countries.js +554 -251
  187. package/dist/elements/public/AddressForm/countries.js.map +1 -1
  188. package/package.json +10 -10
  189. package/dist/cdn/shared-09d4fbb8.js +0 -29
  190. package/dist/cdn/shared-1eac92fa.js +0 -1
  191. package/dist/cdn/shared-307262a1.js +0 -15
  192. package/dist/cdn/shared-332f2997.js +0 -1
  193. package/dist/cdn/shared-39f3b48d.js +0 -1
  194. package/dist/cdn/shared-432c5183.js +0 -9
  195. package/dist/cdn/shared-4dee79d4.js +0 -1
  196. package/dist/cdn/shared-53061389.js +0 -1
  197. package/dist/cdn/shared-59042137.js +0 -201
  198. package/dist/cdn/shared-65ba8b39.js +0 -1
  199. package/dist/cdn/shared-7f5618ba.js +0 -1
  200. package/dist/cdn/shared-92f27a38.js +0 -1
  201. package/dist/cdn/shared-b0f534ef.js +0 -1
  202. package/dist/cdn/shared-be24dd36.js +0 -804
  203. package/dist/cdn/shared-bf62a65b.js +0 -1
  204. package/dist/cdn/shared-c2d3b32b.js +0 -1
  205. package/dist/cdn/shared-cf269a17.js +0 -1
  206. package/dist/cdn/shared-fef9ecc1.js +0 -122
  207. package/dist/elements/public/AddressForm/regions.d.ts +0 -1
  208. package/dist/elements/public/AddressForm/regions.js +0 -67
  209. package/dist/elements/public/AddressForm/regions.js.map +0 -1
  210. /package/dist/cdn/{shared-64657919.js → shared-343d1fd7.js} +0 -0
  211. /package/dist/cdn/{shared-d6276c83.js → shared-3ab0306f.js} +0 -0
  212. /package/dist/cdn/{shared-e6f3e9f0.js → shared-bb05cfed.js} +0 -0
  213. /package/dist/cdn/{shared-99065f2a.js → shared-d7be11de.js} +0 -0
  214. /package/dist/cdn/{shared-0479553e.js → shared-f9180815.js} +0 -0
@@ -0,0 +1,804 @@
1
+ import{T as e,D as t,E as a,C as i}from"./shared-4bd1efd7.js";import{O as s,I as o,a as n}from"./shared-c541c9e9.js";import{h as r,G as l,P as h,D as d,t as u,b as c,s as p}from"./shared-a7475f62.js";import"./shared-9bdd5400.js";import"./shared-2fa6a5a0.js";import{T as m}from"./shared-0689b25a.js";import"./shared-19c9fe00.js";import{D as _,t as f,f as v,a as g}from"./shared-c97f7178.js";import{a as y,b}from"./shared-6b0498b2.js";const D=r`<dom-module id="lumo-date-picker-overlay" theme-for="vaadin-date-picker-overlay">
2
+ <template>
3
+ <style include="lumo-menu-overlay">
4
+ [part="overlay"] {
5
+ /*
6
+ Width:
7
+ date cell widths
8
+ + month calendar side padding
9
+ + year scroller width
10
+ */
11
+ width:
12
+ calc(
13
+ var(--lumo-size-m) * 7
14
+ + var(--lumo-space-xs) * 2
15
+ + 57px
16
+ );
17
+ height: 100%;
18
+ max-height: calc(var(--lumo-size-m) * 14);
19
+ overflow: hidden;
20
+ -webkit-tap-highlight-color: transparent;
21
+ }
22
+
23
+ [part="overlay"] {
24
+ flex-direction: column;
25
+ }
26
+
27
+ [part="content"] {
28
+ padding: 0;
29
+ height: 100%;
30
+ overflow: hidden;
31
+ -webkit-mask-image: none;
32
+ mask-image: none;
33
+ }
34
+
35
+ @media (max-width: 420px), (max-height: 420px) {
36
+ [part="overlay"] {
37
+ width: 100vw;
38
+ height: 70vh;
39
+ max-height: 70vh;
40
+ }
41
+ }
42
+ </style>
43
+ </template>
44
+ </dom-module>`;document.head.appendChild(D.content);const w=r`<dom-module id="lumo-date-picker-overlay-content" theme-for="vaadin-date-picker-overlay-content">
45
+ <template>
46
+ <style>
47
+ :host {
48
+ position: relative;
49
+ background-color: transparent;
50
+ /* Background for the year scroller, placed here as we are using a mask image on the actual years part */
51
+ background-image: linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
52
+ background-size: 57px 100%;
53
+ background-position: top right;
54
+ background-repeat: no-repeat;
55
+ cursor: default;
56
+ }
57
+
58
+ /* Month scroller */
59
+
60
+ [part="months"] {
61
+ /* Month calendar height:
62
+ header height + margin-bottom
63
+ + weekdays height + margin-bottom
64
+ + date cell heights
65
+ + small margin between month calendars
66
+ */
67
+ --vaadin-infinite-scroller-item-height:
68
+ calc(
69
+ var(--lumo-font-size-l) + var(--lumo-space-m)
70
+ + var(--lumo-font-size-xs) + var(--lumo-space-s)
71
+ + var(--lumo-size-m) * 6
72
+ + var(--lumo-space-s)
73
+ );
74
+ --vaadin-infinite-scroller-buffer-offset: 10%;
75
+ -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
76
+ mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
77
+ position: relative;
78
+ margin-right: 57px;
79
+ }
80
+
81
+ /* Year scroller */
82
+
83
+ [part="years"] {
84
+ /* TODO get rid of fixed magic number */
85
+ --vaadin-infinite-scroller-buffer-width: 97px;
86
+ width: 57px;
87
+ height: auto;
88
+ top: 0;
89
+ bottom: 0;
90
+ font-size: var(--lumo-font-size-s);
91
+ box-shadow: inset 2px 0 4px 0 var(--lumo-shade-5pct);
92
+ -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
93
+ mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
94
+ }
95
+
96
+ [part="year-number"],
97
+ [part="year-separator"] {
98
+ opacity: 0.5;
99
+ transition: 0.2s opacity;
100
+ }
101
+
102
+ [part="years"]:hover [part="year-number"],
103
+ [part="years"]:hover [part="year-separator"] {
104
+ opacity: 1;
105
+ }
106
+
107
+ /* TODO unsupported selector */
108
+ #scrollers {
109
+ position: static;
110
+ display: block;
111
+ }
112
+
113
+ /* TODO unsupported selector, should fix this in vaadin-date-picker that it adapts to the
114
+ * width of the year scroller */
115
+ #scrollers[desktop] [part="months"] {
116
+ right: auto;
117
+ }
118
+
119
+ /* Year scroller position indicator */
120
+ [part="years"]::before {
121
+ border: none;
122
+ width: 1em;
123
+ height: 1em;
124
+ background-color: var(--lumo-base-color);
125
+ background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
126
+ transform: translate(-75%, -50%) rotate(45deg);
127
+ border-top-right-radius: calc(var(--lumo-border-radius) / 2);
128
+ box-shadow: 2px -2px 6px 0 var(--lumo-shade-5pct);
129
+ z-index: 1;
130
+ }
131
+
132
+ [part="year-number"],
133
+ [part="year-separator"] {
134
+ display: flex;
135
+ align-items: center;
136
+ justify-content: center;
137
+ height: 50%;
138
+ transform: translateY(-50%);
139
+ }
140
+
141
+ [part="years"] [part="year-separator"]::after {
142
+ color: var(--lumo-disabled-text-color);
143
+ content: "•";
144
+ }
145
+
146
+ /* Current year */
147
+
148
+ [part="years"] [part="year-number"][current] {
149
+ color: var(--lumo-primary-text-color);
150
+ }
151
+
152
+ /* Toolbar (footer) */
153
+
154
+ [part="toolbar"] {
155
+ padding: var(--lumo-space-s);
156
+ box-shadow: 0 -1px 0 0 var(--lumo-contrast-10pct);
157
+ border-bottom-left-radius: var(--lumo-border-radius);
158
+ margin-right: 57px;
159
+ }
160
+
161
+ @supports (mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000)) {
162
+ [part="toolbar"] {
163
+ box-shadow: none;
164
+ }
165
+ }
166
+
167
+ [part="toolbar"] [part\$="button"] {
168
+ margin: 0;
169
+ }
170
+
171
+ /* Narrow viewport mode (fullscreen) */
172
+
173
+ :host([fullscreen]) [part="toolbar"] {
174
+ order: -1;
175
+ background-color: var(--lumo-base-color);
176
+ }
177
+
178
+ :host([fullscreen]) [part="overlay-header"] {
179
+ order: -2;
180
+ height: var(--lumo-size-m);
181
+ padding: var(--lumo-space-s);
182
+ position: absolute;
183
+ left: 0;
184
+ right: 0;
185
+ justify-content: center;
186
+ }
187
+
188
+ :host([fullscreen]) [part="toggle-button"],
189
+ :host([fullscreen]) [part="clear-button"],
190
+ [part="overlay-header"] [part="label"] {
191
+ display: none;
192
+ }
193
+
194
+ /* Very narrow screen (year scroller initially hidden) */
195
+
196
+ [part="years-toggle-button"] {
197
+ position: relative;
198
+ right: auto;
199
+ display: flex;
200
+ align-items: center;
201
+ height: var(--lumo-size-s);
202
+ padding: 0 0.5em;
203
+ border-radius: var(--lumo-border-radius);
204
+ z-index: 3;
205
+ color: var(--lumo-primary-text-color);
206
+ font-weight: 500;
207
+ -webkit-font-smoothing: antialiased;
208
+ -moz-osx-font-smoothing: grayscale;
209
+ }
210
+
211
+ :host([years-visible]) [part="years-toggle-button"] {
212
+ background-color: var(--lumo-primary-color);
213
+ color: var(--lumo-primary-contrast-color);
214
+ }
215
+
216
+ [part="years-toggle-button"]::before {
217
+ content: none;
218
+ }
219
+
220
+ /* TODO magic number (same as used for iron-media-query in vaadin-date-picker-overlay-content) */
221
+ @media screen and (max-width: 374px) {
222
+ :host {
223
+ background-image: none;
224
+ }
225
+
226
+ [part="years"] {
227
+ background-color: var(--lumo-shade-5pct);
228
+ }
229
+
230
+ [part="toolbar"],
231
+ [part="months"] {
232
+ margin-right: 0;
233
+ }
234
+
235
+ /* TODO make date-picker adapt to the width of the years part */
236
+ [part="years"] {
237
+ --vaadin-infinite-scroller-buffer-width: 90px;
238
+ width: 50px;
239
+ }
240
+
241
+ :host([years-visible]) [part="months"] {
242
+ padding-left: 50px;
243
+ }
244
+ }
245
+ </style>
246
+ </template>
247
+ </dom-module>`;document.head.appendChild(w.content);const k=r`<dom-module id="lumo-month-calendar" theme-for="vaadin-month-calendar">
248
+ <template>
249
+ <style>
250
+ :host {
251
+ -moz-user-select: none;
252
+ -ms-user-select: none;
253
+ -webkit-user-select: none;
254
+ -webkit-tap-highlight-color: transparent;
255
+ user-select: none;
256
+ font-size: var(--lumo-font-size-m);
257
+ color: var(--lumo-body-text-color);
258
+ text-align: center;
259
+ padding: 0 var(--lumo-space-xs);
260
+ }
261
+
262
+ /* Month header */
263
+
264
+ [part="month-header"] {
265
+ color: var(--lumo-header-text-color);
266
+ font-size: var(--lumo-font-size-l);
267
+ line-height: 1;
268
+ font-weight: 500;
269
+ margin-bottom: var(--lumo-space-m);
270
+ }
271
+
272
+ /* Week days and numbers */
273
+
274
+ [part="weekdays"],
275
+ [part="weekday"],
276
+ [part="week-numbers"] {
277
+ font-size: var(--lumo-font-size-xs);
278
+ line-height: 1;
279
+ color: var(--lumo-tertiary-text-color);
280
+ }
281
+
282
+ [part="weekdays"] {
283
+ margin-bottom: var(--lumo-space-s);
284
+ }
285
+
286
+ /* TODO should have part="week-number" for the cell in weekdays-container */
287
+ [part="weekday"]:empty,
288
+ [part="week-numbers"] {
289
+ width: var(--lumo-size-xs);
290
+ }
291
+
292
+ /* Date and week number cells */
293
+
294
+ [part="date"],
295
+ [part="week-number"] {
296
+ box-sizing: border-box;
297
+ display: inline-flex;
298
+ align-items: center;
299
+ justify-content: center;
300
+ height: var(--lumo-size-m);
301
+ position: relative;
302
+ }
303
+
304
+ [part="date"] {
305
+ transition: color 0.1s;
306
+ }
307
+
308
+ /* Today date */
309
+
310
+ [part="date"][today] {
311
+ color: var(--lumo-primary-text-color);
312
+ }
313
+
314
+ /* Focused date */
315
+
316
+ [part="date"]::before {
317
+ content: "";
318
+ position: absolute;
319
+ z-index: -1;
320
+ top: 50%;
321
+ left: 50%;
322
+ transform: translate(-50%, -50%);
323
+ min-width: 2em;
324
+ min-height: 2em;
325
+ width: 80%;
326
+ height: 80%;
327
+ max-height: 100%;
328
+ max-width: 100%;
329
+ border-radius: var(--lumo-border-radius);
330
+ }
331
+
332
+ [part="date"][focused]::before {
333
+ box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);
334
+ }
335
+
336
+ :host(:not([focused])) [part="date"][focused]::before {
337
+ animation: vaadin-date-picker-month-calendar-focus-date 1.4s infinite;
338
+ }
339
+
340
+ @keyframes vaadin-date-picker-month-calendar-focus-date {
341
+ 50% {
342
+ box-shadow: 0 0 0 2px transparent;
343
+ }
344
+ }
345
+
346
+ /* TODO should not rely on the role attribute */
347
+ [part="date"][role="button"]:not([disabled]):not([selected]):hover::before {
348
+ background-color: var(--lumo-primary-color-10pct);
349
+ }
350
+
351
+ [part="date"][selected] {
352
+ color: var(--lumo-primary-contrast-color);
353
+ }
354
+
355
+ [part="date"][selected]::before {
356
+ background-color: var(--lumo-primary-color);
357
+ }
358
+
359
+ [part="date"][disabled] {
360
+ color: var(--lumo-disabled-text-color);
361
+ }
362
+
363
+ @media (pointer: coarse) {
364
+ [part="date"]:hover:not([selected])::before,
365
+ [part="date"][focused]:not([selected])::before {
366
+ display: none;
367
+ }
368
+
369
+ [part="date"][role="button"]:not([disabled]):active::before {
370
+ display: block;
371
+ }
372
+
373
+ [part="date"][selected]::before {
374
+ box-shadow: none;
375
+ }
376
+ }
377
+
378
+ /* Disabled */
379
+
380
+ :host([disabled]) * {
381
+ color: var(--lumo-disabled-text-color) !important;
382
+ }
383
+ </style>
384
+ </template>
385
+ </dom-module><custom-style>
386
+ <style>
387
+ @keyframes vaadin-date-picker-month-calendar-focus-date {
388
+ 50% {
389
+ box-shadow: 0 0 0 2px transparent;
390
+ }
391
+ }
392
+ </style>
393
+ </custom-style>`;document.head.appendChild(k.content);const x=r`<dom-module id="lumo-date-picker" theme-for="vaadin-date-picker">
394
+ <template>
395
+ <style include="lumo-field-button">
396
+ :host {
397
+ outline: none;
398
+ }
399
+
400
+ [part="toggle-button"]::before {
401
+ content: var(--lumo-icons-calendar);
402
+ }
403
+
404
+ [part="clear-button"]::before {
405
+ content: var(--lumo-icons-cross);
406
+ }
407
+
408
+ @media (max-width: 420px), (max-height: 420px) {
409
+ [part="overlay-content"] {
410
+ height: 70vh;
411
+ }
412
+ }
413
+ </style>
414
+ </template>
415
+ </dom-module>`;document.head.appendChild(x.content);const S=r`<dom-module id="lumo-date-picker-text-field" theme-for="vaadin-date-picker-text-field">
416
+ <template>
417
+ <style>
418
+ :not(*):placeholder-shown, /* to prevent broken styles on IE */
419
+ :host([dir="rtl"]) [part="value"]:placeholder-shown,
420
+ :host([dir="rtl"]) [part="input-field"] ::slotted(input:placeholder-shown) {
421
+ --_lumo-text-field-overflow-mask-image: none;
422
+ }
423
+
424
+ :host([dir="rtl"]) [part="value"],
425
+ :host([dir="rtl"]) [part="input-field"] ::slotted(input) {
426
+ --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
427
+ }
428
+ </style>
429
+ </template>
430
+ </dom-module>`;document.head.appendChild(S.content);
431
+ /**
432
+ @license
433
+ Copyright (c) 2019 Vaadin Ltd.
434
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
435
+ */
436
+ const C=document.createElement("template");C.innerHTML='<dom-module id="vaadin-date-picker-text-field-styles" theme-for="vaadin-date-picker-text-field">\n <template>\n <style>\n :host([dir="rtl"]) [part="input-field"] {\n direction: ltr;\n }\n\n :host([dir="rtl"]) [part="value"]::placeholder {\n direction: rtl;\n text-align: left;\n }\n\n :host([dir="rtl"]) [part="input-field"] ::slotted(input)::placeholder {\n direction: rtl;\n text-align: left;\n }\n\n :host([dir="rtl"]) [part="value"]:-ms-input-placeholder,\n :host([dir="rtl"]) [part="input-field"] ::slotted(input):-ms-input-placeholder {\n direction: rtl;\n text-align: left;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(C.content);class E extends m{static get is(){return"vaadin-date-picker-text-field"}}customElements.define(E.is,E);
437
+ /**
438
+ @license
439
+ Copyright (c) 2017 Vaadin Ltd.
440
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
441
+ */
442
+ class M extends(_(s)){static get is(){return"vaadin-date-picker-overlay"}}customElements.define(M.is,M);
443
+ /**
444
+ @license
445
+ Copyright (c) 2017 Vaadin Ltd.
446
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
447
+ */
448
+ const T=class{static _getISOWeekNumber(e){var t=e.getDay();0===t&&(t=7);var a=4-t,i=new Date(e.getTime()+24*a*3600*1e3),s=new Date(0,0);s.setFullYear(i.getFullYear());var o=i.getTime()-s.getTime(),n=Math.round(o/864e5);return Math.floor(n/7+1)}static _getAdjustedYear(e,t,a=0,i=1){if(t>99)throw new Error("The provided year cannot have more than 2 digits.");if(t<0)throw new Error("The provided year cannot be negative.");let s=t+100*Math.floor(e.getFullYear()/100);return e<new Date(s-50,a,i)?s-=100:e>new Date(s+50,a,i)&&(s+=100),s}static _parseDate(e){var t=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/.exec(e);if(t){var a=new Date(0,0);return a.setFullYear(parseInt(t[1],10)),a.setMonth(parseInt(t[2],10)-1),a.setDate(parseInt(t[3],10)),a}}static _dateEquals(e,t){return e instanceof Date&&t instanceof Date&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}static _dateAllowed(e,t,a){return(!t||e>=t)&&(!a||e<=a)}static _getClosestDate(e,t){return t.filter((e=>void 0!==e)).reduce(((t,a)=>a?t?Math.abs(e.getTime()-a.getTime())<Math.abs(t.getTime()-e.getTime())?a:t:a:t))}static _extractDateParts(e){return{day:e.getDate(),month:e.getMonth(),year:e.getFullYear()}}};
449
+ /**
450
+ @license
451
+ Copyright (c) 2017 Vaadin Ltd.
452
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
453
+ */class I extends(e(l(h))){static get template(){return r`
454
+ <style>
455
+ :host {
456
+ display: block;
457
+ }
458
+
459
+ [part="weekdays"],
460
+ #days {
461
+ display: flex;
462
+ flex-wrap: wrap;
463
+ flex-grow: 1;
464
+ }
465
+
466
+ #days-container,
467
+ #weekdays-container {
468
+ display: flex;
469
+ }
470
+
471
+ [part="week-numbers"] {
472
+ display: flex;
473
+ flex-direction: column;
474
+ justify-content: space-between;
475
+ flex-shrink: 0;
476
+ }
477
+
478
+ [part="week-numbers"][hidden],
479
+ [part="weekday"][hidden] {
480
+ display: none;
481
+ }
482
+
483
+ [part="weekday"],
484
+ [part="date"] {
485
+ /* Would use calc(100% / 7) but it doesn't work nice on IE */
486
+ width: 14.285714286%;
487
+ }
488
+
489
+ [part="weekday"]:empty,
490
+ [part="week-numbers"] {
491
+ width: 12.5%;
492
+ flex-shrink: 0;
493
+ }
494
+ </style>
495
+
496
+ <div part="month-header" role="heading">[[_getTitle(month, i18n.monthNames)]]</div>
497
+ <div id="monthGrid" on-tap="_handleTap" on-touchend="_preventDefault" on-touchstart="_onMonthGridTouchStart">
498
+ <div id="weekdays-container">
499
+ <div hidden="[[!_showWeekSeparator(showWeekNumbers, i18n.firstDayOfWeek)]]" part="weekday"></div>
500
+ <div part="weekdays">
501
+ <template is="dom-repeat" items="[[_getWeekDayNames(i18n.weekdays, i18n.weekdaysShort, showWeekNumbers, i18n.firstDayOfWeek)]]">
502
+ <div part="weekday" role="heading" aria-label\$="[[item.weekDay]]">[[item.weekDayShort]]</div>
503
+ </template>
504
+ </div>
505
+ </div>
506
+ <div id="days-container">
507
+ <div part="week-numbers" hidden="[[!_showWeekSeparator(showWeekNumbers, i18n.firstDayOfWeek)]]">
508
+ <template is="dom-repeat" items="[[_getWeekNumbers(_days)]]">
509
+ <div part="week-number" role="heading" aria-label\$="[[i18n.week]] [[item]]">[[item]]</div>
510
+ </template>
511
+ </div>
512
+ <div id="days">
513
+ <template is="dom-repeat" items="[[_days]]">
514
+ <div part="date" today\$="[[_isToday(item)]]" selected\$="[[_dateEquals(item, selectedDate)]]" focused\$="[[_dateEquals(item, focusedDate)]]" date="[[item]]" disabled\$="[[!_dateAllowed(item, minDate, maxDate)]]" role\$="[[_getRole(item)]]" aria-label\$="[[_getAriaLabel(item)]]" aria-disabled\$="[[_getAriaDisabled(item, minDate, maxDate)]]">[[_getDate(item)]]</div>
515
+ </template>
516
+ </div>
517
+ </div>
518
+ </div>
519
+ `}static get is(){return"vaadin-month-calendar"}static get properties(){return{month:{type:Date,value:new Date},selectedDate:{type:Date,notify:!0},focusedDate:Date,showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Date,value:null},maxDate:{type:Date,value:null},_days:{type:Array,computed:"_getDays(month, i18n.firstDayOfWeek, minDate, maxDate)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n.firstDayOfWeek)"]}_dateEquals(e,t){return T._dateEquals(e,t)}_dateAllowed(e,t,a){return T._dateAllowed(e,t,a)}_isDisabled(e,t,a){var i=new Date(0,0);i.setFullYear(e.getFullYear()),i.setMonth(e.getMonth()),i.setDate(1);var s=new Date(0,0);return s.setFullYear(e.getFullYear()),s.setMonth(e.getMonth()+1),s.setDate(0),!(t&&a&&t.getMonth()===a.getMonth()&&t.getMonth()===e.getMonth()&&a.getDate()-t.getDate()>=0)&&(!this._dateAllowed(i,t,a)&&!this._dateAllowed(s,t,a))}_getTitle(e,t){if(void 0!==e&&void 0!==t)return this.i18n.formatTitle(t[e.getMonth()],e.getFullYear())}_onMonthGridTouchStart(){this._notTapping=!1,setTimeout((()=>this._notTapping=!0),300)}_dateAdd(e,t){e.setDate(e.getDate()+t)}_applyFirstDayOfWeek(e,t){if(void 0!==e&&void 0!==t)return e.slice(t).concat(e.slice(0,t))}_getWeekDayNames(e,t,a,i){if(void 0!==e&&void 0!==t&&void 0!==a&&void 0!==i)return e=this._applyFirstDayOfWeek(e,i),t=this._applyFirstDayOfWeek(t,i),e=e.map(((e,a)=>({weekDay:e,weekDayShort:t[a]})))}_getDate(e){return e?e.getDate():""}_showWeekNumbersChanged(e,t){e&&1===t?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}_showWeekSeparator(e,t){return e&&1===t}_isToday(e){return this._dateEquals(new Date,e)}_getDays(e,t){if(void 0!==e&&void 0!==t){var a=new Date(0,0);for(a.setFullYear(e.getFullYear()),a.setMonth(e.getMonth()),a.setDate(1);a.getDay()!==t;)this._dateAdd(a,-1);for(var i=[],s=a.getMonth(),o=e.getMonth();a.getMonth()===o||a.getMonth()===s;)i.push(a.getMonth()===o?new Date(a.getTime()):null),this._dateAdd(a,1);return i}}_getWeekNumber(e,t){if(void 0!==e&&void 0!==t)return e||(e=t.reduce(((e,t)=>!e&&t?t:e))),T._getISOWeekNumber(e)}_getWeekNumbers(e){return e.map((t=>this._getWeekNumber(t,e))).filter(((e,t,a)=>a.indexOf(e)===t))}_handleTap(e){this.ignoreTaps||this._notTapping||!e.target.date||e.target.hasAttribute("disabled")||(this.selectedDate=e.target.date,this.dispatchEvent(new CustomEvent("date-tap",{bubbles:!0,composed:!0})))}_preventDefault(e){e.preventDefault()}_getRole(e){return e?"button":"presentation"}_getAriaLabel(e){if(!e)return"";var t=this._getDate(e)+" "+this.i18n.monthNames[e.getMonth()]+" "+e.getFullYear()+", "+this.i18n.weekdays[e.getDay()];return this._isToday(e)&&(t+=", "+this.i18n.today),t}_getAriaDisabled(e,t,a){if(void 0!==e&&void 0!==t&&void 0!==a)return this._dateAllowed(e,t,a)?"false":"true"}}customElements.define(I.is,I);
520
+ /**
521
+ @license
522
+ Copyright (c) 2017 Vaadin Ltd.
523
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
524
+ */
525
+ class A extends h{static get template(){return r`
526
+ <style>
527
+ :host {
528
+ display: block;
529
+ overflow: hidden;
530
+ height: 500px;
531
+ }
532
+
533
+ #scroller {
534
+ position: relative;
535
+ height: 100%;
536
+ overflow: auto;
537
+ outline: none;
538
+ margin-right: -40px;
539
+ -webkit-overflow-scrolling: touch;
540
+ -ms-overflow-style: none;
541
+ overflow-x: hidden;
542
+ }
543
+
544
+ #scroller.notouchscroll {
545
+ -webkit-overflow-scrolling: auto;
546
+ }
547
+
548
+ #scroller::-webkit-scrollbar {
549
+ display: none;
550
+ }
551
+
552
+ .buffer {
553
+ position: absolute;
554
+ width: var(--vaadin-infinite-scroller-buffer-width, 100%);
555
+ box-sizing: border-box;
556
+ padding-right: 40px;
557
+ top: var(--vaadin-infinite-scroller-buffer-offset, 0);
558
+ animation: fadein 0.2s;
559
+ }
560
+
561
+ @keyframes fadein {
562
+ from { opacity: 0; }
563
+ to { opacity: 1; }
564
+ }
565
+ </style>
566
+
567
+ <div id="scroller" on-scroll="_scroll">
568
+ <div class="buffer"></div>
569
+ <div class="buffer"></div>
570
+ <div id="fullHeight"></div>
571
+ </div>
572
+ `}static get is(){return"vaadin-infinite-scroller"}static get properties(){return{bufferSize:{type:Number,value:20},_initialScroll:{value:5e5},_initialIndex:{value:0},_buffers:Array,_preventScrollEvent:Boolean,_mayHaveMomentum:Boolean,_initialized:Boolean,active:{type:Boolean,observer:"_activated"}}}ready(){super.ready(),this._buffers=Array.prototype.slice.call(this.root.querySelectorAll(".buffer")),this.$.fullHeight.style.height=2*this._initialScroll+"px";var e=this.querySelector("template");this._TemplateClass=f(e,this,{forwardHostProp:function(e,t){"index"!==e&&this._buffers.forEach((a=>{[].forEach.call(a.children,(a=>{a._itemWrapper.instance[e]=t}))}))}}),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(this.$.scroller.tabIndex=-1)}forceUpdate(){this._debouncerUpdateClones&&(this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(),this._debouncerUpdateClones.cancel())}_activated(e){e&&!this._initialized&&(this._createPool(),this._initialized=!0)}_finishInit(){this._initDone||(this._buffers.forEach((e=>{[].forEach.call(e.children,(e=>this._ensureStampedInstance(e._itemWrapper)))}),this),this._buffers[0].translateY||this._reset(),this._initDone=!0)}_translateBuffer(e){var t=e?1:0;this._buffers[t].translateY=this._buffers[t?0:1].translateY+this._bufferHeight*(t?-1:1),this._buffers[t].style.transform="translate3d(0, "+this._buffers[t].translateY+"px, 0)",this._buffers[t].updated=!1,this._buffers.reverse()}_scroll(){if(this._scrollDisabled)return;var e=this.$.scroller.scrollTop;(e<this._bufferHeight||e>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());const t=this.itemHeight+this.bufferOffset,a=e>this._buffers[1].translateY+t,i=e<this._buffers[0].translateY+t;(a||i)&&(this._translateBuffer(i),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=d.debounce(this._debouncerScrollFinish,u.after(200),(()=>{var e=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],e)||this._isVisible(this._buffers[1],e)||(this.position=this.position)}))}set position(e){this._preventScrollEvent=!0,e>this._firstIndex&&e<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(e-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~e,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=e%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout((()=>{this.$.scroller.classList.remove("notouchscroll")}),10))}get bufferOffset(){return this._buffers[0].offsetTop}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}get itemHeight(){if(!this._itemHeightVal){window.ShadyCSS&&window.ShadyCSS.nativeCss||this.updateStyles();const e=window.ShadyCSS?window.ShadyCSS.getComputedStyleValue(this,"--vaadin-infinite-scroller-item-height"):getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),t="background-position";this.$.fullHeight.style.setProperty(t,e);const a=getComputedStyle(this.$.fullHeight).getPropertyValue(t);this.$.fullHeight.style.removeProperty(t),this._itemHeightVal=parseFloat(a)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach((e=>{e.style.transform="translate3d(0, "+e.translateY+"px, 0)"})),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=d.debounce(this._debouncerUpdateClones,u.after(200),(()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()})),this._scrollDisabled=!1}_createPool(){var e=this.getBoundingClientRect();this._buffers.forEach((t=>{for(var a=0;a<this.bufferSize;a++){const a=document.createElement("div");a.style.height=this.itemHeight+"px",a.instance={};const i="vaadin-infinite-scroller-item-content-"+(A._contentIndex=A._contentIndex+1||0),s=document.createElement("slot");s.setAttribute("name",i),s._itemWrapper=a,t.appendChild(s),a.setAttribute("slot",i),this.appendChild(a),v(),setTimeout((()=>{this._isVisible(a,e)&&this._ensureStampedInstance(a)}),1)}}),this),setTimeout((()=>{y(this,this._finishInit.bind(this))}),1)}_ensureStampedInstance(e){if(!e.firstElementChild){var t=e.instance;e.instance=new this._TemplateClass({}),e.appendChild(e.instance.root),Object.keys(t).forEach((a=>{e.instance.set(a,t[a])}))}}_updateClones(e){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;var t=e?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(((a,i)=>{if(!a.updated){var s=this._firstIndex+this.bufferSize*i;[].forEach.call(a.children,((a,i)=>{const o=a._itemWrapper;e&&!this._isVisible(o,t)||(o.instance.index=s+i)})),a.updated=!0}}),this)}_isVisible(e,t){var a=e.getBoundingClientRect();return a.bottom>t.top&&a.top<t.bottom}}customElements.define(A.is,A);const O=document.createElement("template");O.innerHTML='<dom-module id="vaadin-date-picker-overlay-styles" theme-for="vaadin-date-picker-overlay">\n <template>\n <style>\n :host {\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n :host([bottom-aligned]) {\n justify-content: flex-end;\n }\n\n :host([right-aligned]) {\n align-items: flex-end;\n }\n\n :host([dir="rtl"]) {\n align-items: flex-end;\n }\n\n :host([dir="rtl"][right-aligned]) {\n align-items: flex-start;\n }\n\n [part="overlay"] {\n display: flex;\n flex: auto;\n }\n\n [part~="content"] {\n flex: auto;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(O.content);
573
+ /**
574
+ @license
575
+ Copyright (c) 2017 Vaadin Ltd.
576
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
577
+ */
578
+ class $ extends(e(t(l(h)))){static get template(){return r`
579
+ <style>
580
+ :host {
581
+ display: flex;
582
+ flex-direction: column;
583
+ height: 100%;
584
+ width: 100%;
585
+ outline: none;
586
+ background: #fff;
587
+ }
588
+
589
+ [part="overlay-header"] {
590
+ display: flex;
591
+ flex-shrink: 0;
592
+ flex-wrap: nowrap;
593
+ align-items: center;
594
+ }
595
+
596
+ :host(:not([fullscreen])) [part="overlay-header"] {
597
+ display: none;
598
+ }
599
+
600
+ [part="label"] {
601
+ flex-grow: 1;
602
+ }
603
+
604
+ [part="clear-button"]:not([showclear]) {
605
+ display: none;
606
+ }
607
+
608
+ [part="years-toggle-button"] {
609
+ display: flex;
610
+ }
611
+
612
+ [part="years-toggle-button"][desktop] {
613
+ display: none;
614
+ }
615
+
616
+ :host(:not([years-visible])) [part="years-toggle-button"]::before {
617
+ transform: rotate(180deg);
618
+ }
619
+
620
+ #scrollers {
621
+ display: flex;
622
+ height: 100%;
623
+ width: 100%;
624
+ position: relative;
625
+ overflow: hidden;
626
+ }
627
+
628
+ [part="months"],
629
+ [part="years"] {
630
+ height: 100%;
631
+ }
632
+
633
+ [part="months"] {
634
+ --vaadin-infinite-scroller-item-height: 270px;
635
+ position: absolute;
636
+ top: 0;
637
+ left: 0;
638
+ right: 0;
639
+ bottom: 0;
640
+ }
641
+
642
+ #scrollers[desktop] [part="months"] {
643
+ right: 50px;
644
+ transform: none !important;
645
+ }
646
+
647
+ [part="years"] {
648
+ --vaadin-infinite-scroller-item-height: 80px;
649
+ width: 50px;
650
+ position: absolute;
651
+ right: 0;
652
+ transform: translateX(100%);
653
+ -webkit-tap-highlight-color: transparent;
654
+ -webkit-user-select: none;
655
+ -moz-user-select: none;
656
+ -ms-user-select: none;
657
+ user-select: none;
658
+ /* Center the year scroller position. */
659
+ --vaadin-infinite-scroller-buffer-offset: 50%;
660
+ }
661
+
662
+ #scrollers[desktop] [part="years"] {
663
+ position: absolute;
664
+ transform: none !important;
665
+ }
666
+
667
+ [part="years"]::before {
668
+ content: '';
669
+ display: block;
670
+ background: transparent;
671
+ width: 0;
672
+ height: 0;
673
+ position: absolute;
674
+ left: 0;
675
+ top: 50%;
676
+ transform: translateY(-50%);
677
+ border-width: 6px;
678
+ border-style: solid;
679
+ border-color: transparent;
680
+ border-left-color: #000;
681
+ }
682
+
683
+ :host(.animate) [part="months"],
684
+ :host(.animate) [part="years"] {
685
+ transition: all 200ms;
686
+ }
687
+
688
+ [part="toolbar"] {
689
+ display: flex;
690
+ justify-content: space-between;
691
+ z-index: 2;
692
+ flex-shrink: 0;
693
+ }
694
+
695
+ [part~="overlay-header"]:not([desktop]) {
696
+ padding-bottom: 40px;
697
+ }
698
+
699
+ [part~="years-toggle-button"] {
700
+ position: absolute;
701
+ top: auto;
702
+ right: 8px;
703
+ bottom: 0;
704
+ z-index: 1;
705
+ padding: 8px;
706
+ }
707
+
708
+ #announcer {
709
+ display: inline-block;
710
+ position: fixed;
711
+ clip: rect(0, 0, 0, 0);
712
+ clip-path: inset(100%);
713
+ }
714
+ </style>
715
+
716
+ <div id="announcer" role="alert" aria-live="polite">
717
+ [[i18n.calendar]]
718
+ </div>
719
+
720
+ <div part="overlay-header" on-touchend="_preventDefault" desktop\$="[[_desktopMode]]" aria-hidden="true">
721
+ <div part="label">[[_formatDisplayed(selectedDate, i18n.formatDate, label)]]</div>
722
+ <div part="clear-button" on-tap="_clear" showclear\$="[[_showClear(selectedDate)]]"></div>
723
+ <div part="toggle-button" on-tap="_cancel"></div>
724
+
725
+ <div part="years-toggle-button" desktop\$="[[_desktopMode]]" on-tap="_toggleYearScroller" aria-hidden="true">
726
+ [[_yearAfterXMonths(_visibleMonthIndex)]]
727
+ </div>
728
+ </div>
729
+
730
+ <div id="scrollers" desktop\$="[[_desktopMode]]" on-track="_track">
731
+ <vaadin-infinite-scroller id="monthScroller" on-custom-scroll="_onMonthScroll" on-touchstart="_onMonthScrollTouchStart" buffer-size="3" active="[[initialPosition]]" part="months">
732
+ <template>
733
+ <vaadin-month-calendar i18n="[[i18n]]" month="[[_dateAfterXMonths(index)]]" selected-date="{{selectedDate}}" focused-date="[[focusedDate]]" ignore-taps="[[_ignoreTaps]]" show-week-numbers="[[showWeekNumbers]]" min-date="[[minDate]]" max-date="[[maxDate]]" focused\$="[[_focused]]" part="month" theme\$="[[theme]]">
734
+ </vaadin-month-calendar>
735
+ </template>
736
+ </vaadin-infinite-scroller>
737
+ <vaadin-infinite-scroller id="yearScroller" on-tap="_onYearTap" on-custom-scroll="_onYearScroll" on-touchstart="_onYearScrollTouchStart" buffer-size="12" active="[[initialPosition]]" part="years">
738
+ <template>
739
+ <div part="year-number" role="button" current\$="[[_isCurrentYear(index)]]" selected\$="[[_isSelectedYear(index, selectedDate)]]">
740
+ [[_yearAfterXYears(index)]]
741
+ </div>
742
+ <div part="year-separator" aria-hidden="true"></div>
743
+ </template>
744
+ </vaadin-infinite-scroller>
745
+ </div>
746
+
747
+ <div on-touchend="_preventDefault" role="toolbar" part="toolbar">
748
+ <vaadin-button id="todayButton" theme="tertiary" part="today-button" disabled="[[!_isTodayAllowed(minDate, maxDate)]]" on-tap="_onTodayTap">
749
+ [[i18n.today]]
750
+ </vaadin-button>
751
+ <vaadin-button id="cancelButton" theme="tertiary" part="cancel-button" on-tap="_cancel">
752
+ [[i18n.cancel]]
753
+ </vaadin-button>
754
+ </div>
755
+
756
+ <iron-media-query query="(min-width: 375px)" query-matches="{{_desktopMode}}"></iron-media-query>
757
+ `}static get is(){return"vaadin-date-picker-overlay-content"}static get properties(){return{selectedDate:{type:Date,notify:!0},focusedDate:{type:Date,notify:!0,observer:"_focusedDateChanged"},_focusedMonthDate:Number,initialPosition:{type:Date,observer:"_initialPositionChanged"},_originDate:{value:new Date},_visibleMonthIndex:Number,_desktopMode:Boolean,_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:Date,maxDate:Date,_focused:Boolean,label:String}}get __isRTL(){return"rtl"===this.getAttribute("dir")}get __useSubMonthScrolling(){return this.$.monthScroller.clientHeight<this.$.monthScroller.itemHeight+this.$.monthScroller.bufferOffset}ready(){super.ready(),this.setAttribute("tabindex",0),this.addEventListener("keydown",this._onKeydown.bind(this)),c(this,"tap",this._stopPropagation),this.addEventListener("focus",this._onOverlayFocus.bind(this)),this.addEventListener("blur",this._onOverlayBlur.bind(this))}connectedCallback(){super.connectedCallback(),this._closeYearScroller(),this._toggleAnimateClass(!0),p(this.$.scrollers,"pan-y"),o.requestAvailability()}announceFocusedDate(){var e=this._currentlyFocusedDate(),t=[];T._dateEquals(e,new Date)&&t.push(this.i18n.today),t=t.concat([this.i18n.weekdays[e.getDay()],e.getDate(),this.i18n.monthNames[e.getMonth()],e.getFullYear()]),this.showWeekNumbers&&1===this.i18n.firstDayOfWeek&&(t.push(this.i18n.week),t.push(T._getISOWeekNumber(e))),this.dispatchEvent(new CustomEvent("iron-announce",{bubbles:!0,composed:!0,detail:{text:t.join(" ")}}))}focusCancel(){this.$.cancelButton.focus()}scrollToDate(e,t){const a=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(e):0;this._scrollToPosition(this._differenceInMonths(e,this._originDate)+a,t),this.$.monthScroller.forceUpdate()}_focusedDateChanged(e){this.revealDate(e)}_isCurrentYear(e){return 0===e}_isSelectedYear(e,t){if(t)return t.getFullYear()===this._originDate.getFullYear()+e}revealDate(e,t=!0){if(!e)return;const a=this._differenceInMonths(e,this._originDate);if(this.__useSubMonthScrolling){const i=this._calculateWeekScrollOffset(e);return void this._scrollToPosition(a+i,t)}const i=this.$.monthScroller.position>a,s=Math.max(this.$.monthScroller.itemHeight,this.$.monthScroller.clientHeight-2*this.$.monthScroller.bufferOffset)/this.$.monthScroller.itemHeight,o=this.$.monthScroller.position+s-1<a;i?this._scrollToPosition(a,t):o&&this._scrollToPosition(a-s+1,t)}_calculateWeekScrollOffset(e){const t=new Date(0,0);t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(1);let a=0;for(;t.getDate()<e.getDate();)t.setDate(t.getDate()+1),t.getDay()===this.i18n.firstDayOfWeek&&(a+=1);return a/6}_onOverlayFocus(){this._focused=!0}_onOverlayBlur(){this._focused=!1}_initialPositionChanged(e){this.scrollToDate(e)}_repositionYearScroller(){this._visibleMonthIndex=Math.floor(this.$.monthScroller.position),this.$.yearScroller.position=(this.$.monthScroller.position+this._originDate.getMonth())/12}_repositionMonthScroller(){this.$.monthScroller.position=12*this.$.yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this.$.monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>this._notTapping=!0),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=d.debounce(this._debouncer,u.after(300),(()=>this._ignoreTaps=!1))}_formatDisplayed(e,t,a){return e?t(T._extractDateParts(e)):a}_onTodayTap(){var e=new Date;Math.abs(this.$.monthScroller.position-this._differenceInMonths(e,this._originDate))<.001?(this.selectedDate=e,this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_showClear(e){return!!e}_onYearTap(e){if(!this._ignoreTaps&&!this._notTapping){var t=(e.detail.y-(this.$.yearScroller.getBoundingClientRect().top+this.$.yearScroller.clientHeight/2))/this.$.yearScroller.itemHeight;this._scrollToPosition(this.$.monthScroller.position+12*t,!0)}}_scrollToPosition(e,t){if(void 0===this._targetPosition){if(!t)return this.$.monthScroller.position=e,this._targetPosition=void 0,void this._repositionYearScroller();this._targetPosition=e;var a=t?300:0,i=0,s=this.$.monthScroller.position,o=e=>{var t,n,r,l=e-(i=i||e);if(l<a){var h=(t=l,n=s,r=this._targetPosition-s,(t/=a/2)<1?r/2*t*t+n:-r/2*(--t*(t-2)-1)+n);this.$.monthScroller.position=h,window.requestAnimationFrame(o)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:s}})),this.$.monthScroller.position=this._targetPosition,this._targetPosition=void 0;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(o)}else this._targetPosition=e}_limit(e,t){return Math.min(t.max,Math.max(t.min,e))}_handleTrack(e){if(!(Math.abs(e.detail.dx)<10||Math.abs(e.detail.ddy)>10)){Math.abs(e.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0);var t=this._translateX+e.detail.ddx;this._translateX=this._limit(t,{min:0,max:this._yearScrollerWidth})}}_track(e){if(!this._desktopMode)switch(e.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(e);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(e){e?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(e){this._desktopMode||(this.$.monthScroller.style.transform="translateX("+(e-this._yearScrollerWidth)+"px)",this.$.yearScroller.style.transform="translateX("+e+"px)")}_yearAfterXYears(e){var t=new Date(this._originDate);return t.setFullYear(parseInt(e)+this._originDate.getFullYear()),t.getFullYear()}_yearAfterXMonths(e){return this._dateAfterXMonths(e).getFullYear()}_dateAfterXMonths(e){var t=new Date(this._originDate);return t.setDate(1),t.setMonth(parseInt(e)+this._originDate.getMonth()),t}_differenceInMonths(e,t){return 12*(e.getFullYear()-t.getFullYear())-t.getMonth()+e.getMonth()}_differenceInYears(e,t){return this._differenceInMonths(e,t)/12}_clear(){this.selectedDate=""}_close(){const e=this.getRootNode().host,t=e?e.getRootNode().host:null;t&&(t.opened=!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(e){e.preventDefault()}_eventKey(e){for(var t=["down","up","right","left","enter","space","home","end","pageup","pagedown","tab","esc"],a=0;a<t.length;a++){var i=t[a];if(n.keyboardEventMatchesKeys(e,i))return i}}_onKeydown(e){var t=this._currentlyFocusedDate();const a=e.composedPath().indexOf(this.$.todayButton)>=0,i=e.composedPath().indexOf(this.$.cancelButton)>=0,s=!a&&!i;var o=this._eventKey(e);if("tab"===o){e.stopPropagation();const t=this.hasAttribute("fullscreen"),o=e.shiftKey;t?e.preventDefault():o&&s||!o&&i?(e.preventDefault(),this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))):o&&a?(this._focused=!0,setTimeout((()=>this.revealDate(this.focusedDate)),1)):this._focused=!1}else if(o)switch(e.preventDefault(),e.stopPropagation(),o){case"down":this._moveFocusByDays(7),this.focus();break;case"up":this._moveFocusByDays(-7),this.focus();break;case"right":s&&this._moveFocusByDays(this.__isRTL?-1:1);break;case"left":s&&this._moveFocusByDays(this.__isRTL?1:-1);break;case"enter":s||i?this._close():a&&this._onTodayTap();break;case"space":if(i)this._close();else if(a)this._onTodayTap();else{var n=this.focusedDate;T._dateEquals(n,this.selectedDate)?(this.selectedDate="",this.focusedDate=n):this.selectedDate=n}break;case"home":this._moveFocusInsideMonth(t,"minDate");break;case"end":this._moveFocusInsideMonth(t,"maxDate");break;case"pagedown":this._moveFocusByMonths(e.shiftKey?12:1);break;case"pageup":this._moveFocusByMonths(e.shiftKey?-12:-1);break;case"esc":this._cancel()}}_currentlyFocusedDate(){return this.focusedDate||this.selectedDate||this.initialPosition||new Date}_focusDate(e){this.focusedDate=e,this._focusedMonthDate=e.getDate()}_focusClosestDate(e){this._focusDate(T._getClosestDate(e,[this.minDate,this.maxDate]))}_moveFocusByDays(e){var t=this._currentlyFocusedDate(),a=new Date(0,0);a.setFullYear(t.getFullYear()),a.setMonth(t.getMonth()),a.setDate(t.getDate()+e),this._dateAllowed(a,this.minDate,this.maxDate)?this._focusDate(a):this._dateAllowed(t,this.minDate,this.maxDate)?e>0?this._focusDate(this.maxDate):this._focusDate(this.minDate):this._focusClosestDate(t)}_moveFocusByMonths(e){var t=this._currentlyFocusedDate(),a=new Date(0,0);a.setFullYear(t.getFullYear()),a.setMonth(t.getMonth()+e);var i=a.getMonth();a.setDate(this._focusedMonthDate||(this._focusedMonthDate=t.getDate())),a.getMonth()!==i&&a.setDate(0),this._dateAllowed(a,this.minDate,this.maxDate)?this.focusedDate=a:this._dateAllowed(t,this.minDate,this.maxDate)?e>0?this._focusDate(this.maxDate):this._focusDate(this.minDate):this._focusClosestDate(t)}_moveFocusInsideMonth(e,t){var a=new Date(0,0);a.setFullYear(e.getFullYear()),"minDate"===t?(a.setMonth(e.getMonth()),a.setDate(1)):(a.setMonth(e.getMonth()+1),a.setDate(0)),this._dateAllowed(a,this.minDate,this.maxDate)?this._focusDate(a):this._dateAllowed(e,this.minDate,this.maxDate)?this._focusDate(this[t]):this._focusClosestDate(e)}_dateAllowed(e,t,a){return(!t||e>=t)&&(!a||e<=a)}_isTodayAllowed(e,t){var a=new Date,i=new Date(0,0);return i.setFullYear(a.getFullYear()),i.setMonth(a.getMonth()),i.setDate(a.getDate()),this._dateAllowed(i,e,t)}_stopPropagation(e){e.stopPropagation()}}customElements.define($.is,$);
758
+ /**
759
+ @license
760
+ Copyright (c) 2017 Vaadin Ltd.
761
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
762
+ */
763
+ const F=e=>class extends(g([b],e)){static get properties(){return{_selectedDate:{type:Date},_focusedDate:Date,value:{type:String,observer:"_valueChanged",notify:!0,value:""},required:{type:Boolean,value:!1},name:{type:String},initialPosition:String,label:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged"},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean},_fullscreen:{value:!1,observer:"_fullscreenChanged"},_fullscreenMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},_touchPrevented:Array,i18n:{type:Object,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,week:"Week",calendar:"Calendar",clear:"Clear",today:"Today",cancel:"Cancel",referenceDate:"",formatDate:e=>{const t=String(e.year).replace(/\d+/,(e=>"0000".substr(e.length)+e));return[e.month+1,e.day,t].join("/")},parseDate(e){const t=e.split("/"),a=new Date;let i,s=a.getMonth(),o=a.getFullYear();if(3===t.length){if(s=parseInt(t[0])-1,i=parseInt(t[1]),o=parseInt(t[2]),t[2].length<3&&o>=0){const e=this.referenceDate?T._parseDate(this.referenceDate):new Date;o=T._getAdjustedYear(e,o,s,i)}}else 2===t.length?(s=parseInt(t[0])-1,i=parseInt(t[1])):1===t.length&&(i=parseInt(t[0]));if(void 0!==i)return{day:i,month:s,year:o}},formatTitle:(e,t)=>`${e} ${t}`})},min:{type:String,observer:"_minChanged"},max:{type:String,observer:"_maxChanged"},_minDate:{type:Date,value:""},_maxDate:{type:Date,value:""},_noInput:{type:Boolean,computed:"_isNoInput(_fullscreen, _ios, i18n, i18n.*, opened, autoOpenDisabled)"},_hasInputValue:{type:Boolean,value:!1,observer:"_hasInputValueChanged"},_ios:{type:Boolean,value:navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/)},_webkitOverflowScroll:{type:Boolean,value:""===document.createElement("div").style.webkitOverflowScrolling},_ignoreAnnounce:{value:!0},_focusOverlayOnOpen:Boolean,_overlayInitialized:Boolean}}static get observers(){return["_updateHasValue(value)","_selectedDateChanged(_selectedDate, i18n.formatDate)","_focusedDateChanged(_focusedDate, i18n.formatDate)","_announceFocusedDate(_focusedDate, opened, _ignoreAnnounce)"]}ready(){super.ready(),this._boundOnScroll=this._onScroll.bind(this),this._boundFocus=this._focus.bind(this),this._boundUpdateAlignmentAndPosition=this._updateAlignmentAndPosition.bind(this);const e=e=>{const t=e.composedPath(),a=t.indexOf(this._inputElement);return 1===t.slice(0,a).filter((e=>e.getAttribute&&"clear-button"===e.getAttribute("part"))).length};c(this,"tap",(t=>{e(t)||this.autoOpenDisabled&&!this._noInput||this.open()})),this.addEventListener("touchend",(t=>{this._noInput&&!e(t)&&t.preventDefault()})),this.addEventListener("keydown",this._onKeydown.bind(this)),this.addEventListener("input",this.__onUserInput.bind(this)),this.addEventListener("focus",(e=>this._noInput&&e.target.blur())),this.addEventListener("blur",(e=>{if(!this.opened){if(this.autoOpenDisabled){const e=this._getParsedDate();this._isValidDate(e)&&(this._selectedDate=e)}""===this._inputElementValue&&this.__dispatchChange?(this.validate(),this.value="",this.__dispatchChange=!1):this.validate()}}))}_initOverlay(){this.$.overlay.removeAttribute("disable-upgrade"),this._overlayInitialized=!0,this.$.overlay.addEventListener("opened-changed",(e=>this.opened=e.detail.value)),this._overlayContent.addEventListener("close",this._close.bind(this)),this._overlayContent.addEventListener("focus-input",this._focusAndSelect.bind(this)),this.$.overlay.addEventListener("vaadin-overlay-escape-press",this._boundFocus),this._overlayContent.addEventListener("focus",(()=>this.focusElement._setFocused(!0))),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this));const e=e=>{this.$.overlay.bringToFront&&requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))};this.addEventListener("mousedown",e),this.addEventListener("touchstart",e)}disconnectedCallback(){super.disconnectedCallback(),this._overlayInitialized&&this.$.overlay.removeEventListener("vaadin-overlay-escape-press",this._boundFocus),this.opened=!1}open(){this.disabled||this.readonly||(this.opened=!0)}_close(e){e&&e.stopPropagation(),this._focus(),this.close()}close(){(this._overlayInitialized||this.autoOpenDisabled)&&this.$.overlay.close()}get _inputElement(){return this._input()}get _nativeInput(){if(this._inputElement)return this._inputElement.focusElement?this._inputElement.focusElement:this._inputElement.inputElement?this._inputElement.inputElement:window.unwrap?window.unwrap(this._inputElement):this._inputElement}_parseDate(e){var t=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/.exec(e);if(t){var a=new Date(0,0);return a.setFullYear(parseInt(t[1],10)),a.setMonth(parseInt(t[2],10)-1),a.setDate(parseInt(t[3],10)),a}}_isNoInput(e,t,a,i,s,o){const n=e&&(!o||s),r=t&&s;return!this._inputElement||n||r||!a.parseDate}_formatISO(e){if(!(e instanceof Date))return"";const t=(e,t="00")=>(t+e).substr((t+e).length-t.length);let a="",i="0000",s=e.getFullYear();s<0?(s=-s,a="-",i="000000"):e.getFullYear()>=1e4&&(a="+",i="000000");return[a+t(s,i),t(e.getMonth()+1),t(e.getDate())].join("-")}_openedChanged(e){e&&!this._overlayInitialized&&this._initOverlay(),this._overlayInitialized&&(this.$.overlay.opened=e),e&&this._updateAlignmentAndPosition()}_selectedDateChanged(e,t){if(void 0===e||void 0===t)return;this.__userInputOccurred&&(this.__dispatchChange=!0);const a=this._formatISO(e);this.__keepInputValue||this._applyInputValue(e),a!==this.value&&(this.validate(),this.value=a),this.__userInputOccurred=!1,this.__dispatchChange=!1,this._ignoreFocusedDateChange=!0,this._focusedDate=e,this._ignoreFocusedDateChange=!1}_focusedDateChanged(e,t){void 0!==e&&void 0!==t&&(this.__userInputOccurred=!0,this._ignoreFocusedDateChange||this._noInput||this._applyInputValue(e))}_updateHasValue(e){e?this.setAttribute("has-value",""):this.removeAttribute("has-value")}__getOverlayTheme(e,t){if(t)return e}_handleDateChange(e,t,a){if(t){var i=this._parseDate(t);i?T._dateEquals(this[e],i)||(this[e]=i,this.value&&this.validate()):this.value=a}else this[e]=""}_valueChanged(e,t){this.__dispatchChange&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._handleDateChange("_selectedDate",e,t)}_minChanged(e,t){this._handleDateChange("_minDate",e,t)}_maxChanged(e,t){this._handleDateChange("_maxDate",e,t)}_updateAlignmentAndPosition(){if(this._overlayInitialized){if(!this._fullscreen){const e=this._inputElement.getBoundingClientRect(),t=e.top>window.innerHeight/2;if(e.left+this.clientWidth/2>window.innerWidth/2){const t=Math.min(window.innerWidth,document.documentElement.clientWidth);this.$.overlay.setAttribute("right-aligned",""),this.$.overlay.style.removeProperty("left"),this.$.overlay.style.right=t-e.right+"px"}else this.$.overlay.removeAttribute("right-aligned"),this.$.overlay.style.removeProperty("right"),this.$.overlay.style.left=e.left+"px";if(t){const t=Math.min(window.innerHeight,document.documentElement.clientHeight);this.$.overlay.setAttribute("bottom-aligned",""),this.$.overlay.style.removeProperty("top"),this.$.overlay.style.bottom=t-e.top+"px"}else this.$.overlay.removeAttribute("bottom-aligned"),this.$.overlay.style.removeProperty("bottom"),this.$.overlay.style.top=e.bottom+"px"}this.$.overlay.setAttribute("dir",getComputedStyle(this._inputElement).getPropertyValue("direction")),this._overlayContent._repositionYearScroller()}}_fullscreenChanged(){this._overlayInitialized&&this.$.overlay.opened&&this._updateAlignmentAndPosition()}_onOverlayOpened(){this._openedWithFocusRing=this.hasAttribute("focus-ring")||this.focusElement&&this.focusElement.hasAttribute("focus-ring");var e=this._parseDate(this.initialPosition),t=this._selectedDate||this._overlayContent.initialPosition||e||new Date;e||T._dateAllowed(t,this._minDate,this._maxDate)?this._overlayContent.initialPosition=t:this._overlayContent.initialPosition=T._getClosestDate(t,[this._minDate,this._maxDate]),this._overlayContent.scrollToDate(this._overlayContent.focusedDate||this._overlayContent.initialPosition),this._ignoreFocusedDateChange=!0,this._overlayContent.focusedDate=this._overlayContent.focusedDate||this._overlayContent.initialPosition,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this.addEventListener("iron-resize",this._boundUpdateAlignmentAndPosition),this._webkitOverflowScroll&&(this._touchPrevented=this._preventWebkitOverflowScrollingTouch(this.parentElement)),this._focusOverlayOnOpen?(this._overlayContent.focus(),this._focusOverlayOnOpen=!1):this._focus(),this._noInput&&this.focusElement&&this.focusElement.blur(),this.updateStyles(),this._ignoreAnnounce=!1}_preventWebkitOverflowScrollingTouch(e){for(var t=[];e;){if("touch"===window.getComputedStyle(e).webkitOverflowScrolling){var a=e.style.webkitOverflowScrolling;e.style.webkitOverflowScrolling="auto",t.push({element:e,oldInlineValue:a})}e=e.parentElement}return t}_selectParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const e=this._inputElementValue||"",t=this._getParsedDate(e);this._isValidDate(t)?this._selectedDate=t:(this.__keepInputValue=!0,this._selectedDate=null,this.__keepInputValue=!1)}else this._focusedDate&&(this._selectedDate=this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this._ignoreAnnounce=!0,window.removeEventListener("scroll",this._boundOnScroll,!0),this.removeEventListener("iron-resize",this._boundUpdateAlignmentAndPosition),this._touchPrevented&&(this._touchPrevented.forEach((e=>e.element.style.webkitOverflowScrolling=e.oldInlineValue)),this._touchPrevented=[]),this.updateStyles(),this._selectParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),this.value||this.validate()}get _inputElementValueProperty(){return"value"}get _inputElementValue(){return this._inputElement?this._inputElement[this._inputElementValueProperty]:void 0}set _inputElementValue(e){this._inputElement&&(this._inputElement[this._inputElementValueProperty]=e,this._hasInputValue=!1)}_setInvalid(e){this._shouldSetInvalid(e)&&(this.invalid=e)}_shouldSetInvalid(e){return!0}validate(){const e=this.checkValidity(this._inputElementValue);return this._setInvalid(!e),this.dispatchEvent(new CustomEvent("validated",{detail:{valid:e}})),e}checkValidity(){const e=!this._inputElementValue||this._selectedDate&&this._inputElementValue===this._getFormattedDate(this.i18n.formatDate,this._selectedDate),t=!this._selectedDate||T._dateAllowed(this._selectedDate,this._minDate,this._maxDate);let a=!0;return this._inputElement&&(this._inputElement.checkValidity?(this._inputElement.__forceCheckValidity=!0,a=this._inputElement.checkValidity(),this._inputElement.__forceCheckValidity=!1):this._inputElement.validate&&(a=this._inputElement.validate())),!!(e&&t&&a)}_onScroll(e){e.target!==window&&this._overlayContent.contains(e.target)||this._updateAlignmentAndPosition()}_focus(){this._noInput?this._overlayInitialized&&this._overlayContent.focus():this._inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(e){this._inputElementValue=e?this._getFormattedDate(this.i18n.formatDate,e):""}_getFormattedDate(e,t){return e(T._extractDateParts(t))}_setSelectionRange(e,t){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(e,t)}_eventKey(e){for(var t=["down","up","enter","esc","tab"],a=0;a<t.length;a++){var i=t[a];if(n.keyboardEventMatchesKeys(e,i))return i}}_isValidDate(e){return e&&!isNaN(e.getTime())}_onKeydown(e){if(this._noInput){-1===[9].indexOf(e.keyCode)&&e.preventDefault()}switch(this._eventKey(e)){case"down":case"up":e.preventDefault(),this.opened?(this._overlayContent.focus(),this._overlayContent._onKeydown(e)):(this._focusOverlayOnOpen=!0,this.open());break;case"enter":{const e=this._getParsedDate(),t=this._isValidDate(e);if(this.opened)this._overlayInitialized&&this._overlayContent.focusedDate&&t&&(this._selectedDate=this._overlayContent.focusedDate),this.close();else if(t||""===this._inputElementValue){const e=this.value;this._selectParsedOrFocusedDate(),e===this.value&&this.validate()}else this.validate();break}case"esc":this.opened?(this._focusedDate=this._selectedDate,this._close()):this.autoOpenDisabled?(""===this._inputElementValue&&(this._selectedDate=null),this._applyInputValue(this._selectedDate)):(this._focusedDate=this._selectedDate,this._selectParsedOrFocusedDate());break;case"tab":this.opened&&(e.preventDefault(),this._setSelectionRange(0,0),e.shiftKey?this._overlayContent.focusCancel():(this._overlayContent.focus(),this._overlayContent.revealDate(this._focusedDate)))}}_getParsedDate(e=this._inputElementValue){const t=this.i18n.parseDate&&this.i18n.parseDate(e);return t&&this._parseDate(t.year+"-"+(t.month+1)+"-"+t.day)}_setHasInputValue(e){const t=e.composedPath()[0];this._hasInputValue=t.value.length>0}__onUserInput(e){this._setHasInputValue(e),this._onUserInput(e)}_hasInputValueChanged(e,t){(e||t)&&this.dispatchEvent(new CustomEvent("has-input-value-changed"))}_onUserInput(e){this.opened||!this._inputElementValue||this.autoOpenDisabled||this.open(),this._userInputValueChanged(),e.__fromClearButton&&(this.validate(),this.__dispatchChange=!0,this.value="",this.__dispatchChange=!1)}_userInputValueChanged(e){if(this._inputElementValue){const e=this._getParsedDate();this._isValidDate(e)&&(this._ignoreFocusedDateChange=!0,T._dateEquals(e,this._focusedDate)||(this._focusedDate=e),this._ignoreFocusedDateChange=!1)}}_announceFocusedDate(e,t,a){t&&!a&&this._overlayContent.announceFocusedDate()}get _overlayContent(){return this.$.overlay.content.querySelector("#overlay-content")}}
764
+ /**
765
+ @license
766
+ Copyright (c) 2017 Vaadin Ltd.
767
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
768
+ */;class Y extends(a(i(e(F(l(h)))))){static get template(){return r`
769
+ <style>
770
+ :host {
771
+ display: inline-block;
772
+ }
773
+
774
+ :host([hidden]) {
775
+ display: none !important;
776
+ }
777
+
778
+ :host([opened]) {
779
+ pointer-events: auto;
780
+ }
781
+
782
+ [part="text-field"] {
783
+ width: 100%;
784
+ min-width: 0;
785
+ }
786
+ </style>
787
+
788
+
789
+ <vaadin-date-picker-text-field id="input" role="application" autocomplete="off" on-focus="_focus" value="{{_userInputValue}}" invalid="[[invalid]]" label="[[label]]" name="[[name]]" placeholder="[[placeholder]]" required="[[required]]" disabled="[[disabled]]" readonly="[[readonly]]" error-message="[[errorMessage]]" clear-button-visible="[[clearButtonVisible]]" aria-label\$="[[label]]" part="text-field" helper-text="[[helperText]]" theme\$="[[theme]]">
790
+ <slot name="prefix" slot="prefix"></slot>
791
+ <slot name="helper" slot="helper">[[helperText]]</slot>
792
+ <div part="toggle-button" slot="suffix" on-tap="_toggle" role="button" aria-label\$="[[i18n.calendar]]" aria-expanded\$="[[_getAriaExpanded(opened)]]"></div>
793
+ </vaadin-date-picker-text-field>
794
+
795
+ <vaadin-date-picker-overlay id="overlay" fullscreen\$="[[_fullscreen]]" theme\$="[[__getOverlayTheme(theme, _overlayInitialized)]]" on-vaadin-overlay-open="_onOverlayOpened" on-vaadin-overlay-close="_onOverlayClosed" disable-upgrade="">
796
+ <template>
797
+ <vaadin-date-picker-overlay-content id="overlay-content" i18n="[[i18n]]" fullscreen\$="[[_fullscreen]]" label="[[label]]" selected-date="{{_selectedDate}}" slot="dropdown-content" focused-date="{{_focusedDate}}" show-week-numbers="[[showWeekNumbers]]" min-date="[[_minDate]]" max-date="[[_maxDate]]" role="dialog" on-date-tap="_close" part="overlay-content" theme\$="[[__getOverlayTheme(theme, _overlayInitialized)]]">
798
+ </vaadin-date-picker-overlay-content>
799
+ </template>
800
+ </vaadin-date-picker-overlay>
801
+
802
+ <iron-media-query query="[[_fullscreenMediaQuery]]" query-matches="{{_fullscreen}}">
803
+ </iron-media-query>
804
+ `}static get is(){return"vaadin-date-picker"}static get version(){return"4.6.0"}static get properties(){return{clearButtonVisible:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},errorMessage:String,placeholder:String,helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_userInputValue:String}}static get observers(){return["_userInputValueChanged(_userInputValue)","_setClearButtonLabel(i18n.clear)"]}ready(){super.ready(),y(this,(()=>this._inputElement.validate=()=>{})),this._inputElement.addEventListener("change",(e=>{""!==this._inputElementValue||e.__fromClearButton||(this.__dispatchChange=!0)}))}_onVaadinOverlayClose(e){this._openedWithFocusRing&&this.hasAttribute("focused")?this.focusElement.setAttribute("focus-ring",""):this.hasAttribute("focused")||this.focusElement.blur(),e.detail.sourceEvent&&-1!==e.detail.sourceEvent.composedPath().indexOf(this)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this[this._overlayInitialized&&this.$.overlay.opened?"close":"open"]()}_input(){return this.$.input}_getAriaExpanded(e){return Boolean(e).toString()}get focusElement(){return this._input()||this}_setClearButtonLabel(e){this._inputElement.shadowRoot.querySelector('[part="clear-button"]').setAttribute("aria-label",e)}}customElements.define(Y.is,Y);export{Y as D,T as a};