@golemui/gui-lit 1.2.0 → 1.2.1

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 (91) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/{accordion.element-BIgxl5e9.js → accordion.element-C9GzfKrY.js} +29 -30
  3. package/alert.element-CHn49Yaf.js +55 -0
  4. package/button.element-C9fHivSw.js +59 -0
  5. package/{calendar.element-Cv3RBphf.js → calendar.element-XkojKTJk.js} +30 -31
  6. package/checkbox.element-DU_tVMXu.js +66 -0
  7. package/currency.element-BmAH5KS_.js +73 -0
  8. package/date-picker.element-Bg3rF95F.js +94 -0
  9. package/{date-time-calendar.element-DlbWZjoe.js → date-time-calendar.element-sywQCeQQ.js} +24 -24
  10. package/date-time-picker.element-HHpwjWTQ.js +107 -0
  11. package/{date-time.element-CLLxM2nV.js → date-time.element-ucETvSTC.js} +26 -26
  12. package/{date.element-B8ZHK9KJ.js → date.element-BEHGxRFF.js} +27 -27
  13. package/default-list-item-renderer-CuPJ9jUD.js +24 -0
  14. package/{dropdown.element-DMZ7oL5n.js → dropdown.element-DUqG_p1x.js} +85 -84
  15. package/{flex.element-DG4Uaj_X.js → flex.element-pwba7621.js} +27 -28
  16. package/{grid.element-DCZsh-3J.js → grid.element-C8K7_Qi3.js} +29 -30
  17. package/index.js +1316 -3883
  18. package/index.umd.cjs +117 -2132
  19. package/{list.element-ADtUK2na.js → list.element-ZtEMKE2x.js} +41 -40
  20. package/markdown-text.element-DDm36qD0.js +54 -0
  21. package/markdown.element-DWz3U9rG.js +84 -0
  22. package/number.element-VkG5wScD.js +71 -0
  23. package/package.json +6 -6
  24. package/password.element-C5vQHq5P.js +72 -0
  25. package/radiogroup.element-CKdO9HwO.js +69 -0
  26. package/{range-calendar.element-D5eb2f7p.js → range-calendar.element-BznGrej5.js} +23 -24
  27. package/{range-date-input.element-C35grlYo.js → range-date-input.element-BloTHRDl.js} +24 -24
  28. package/range-date-picker.element-DKhwFasW.js +98 -0
  29. package/{range-date-time-calendar.element-BV0J96Gu.js → range-date-time-calendar.element-CZCET-sb.js} +26 -26
  30. package/{range-date-time-input.element-CzgRbR9F.js → range-date-time-input.element-Dr2VrYhG.js} +24 -24
  31. package/range-date-time-picker.element-CYeIMWLp.js +109 -0
  32. package/{range-time-input.element-BOHLUO8z.js → range-time-input.element-7OZhPQqx.js} +23 -23
  33. package/range-time-picker.element-D0mRFZkK.js +96 -0
  34. package/renderer.element-DbsFoBba.js +48 -0
  35. package/{repeater.element-Da8YN1Vy.js → repeater.element-DGEbwvhY.js} +54 -65
  36. package/select.element-Bb_9jAVB.js +76 -0
  37. package/{tabs.element-CvcIA8P3.js → tabs.element-BYDNF_pm.js} +49 -50
  38. package/tags.element-BSN3i9Gx.js +73 -0
  39. package/textarea.element-Dl1ZEOqO.js +71 -0
  40. package/textinput.element-C5Vbbkxq.js +68 -0
  41. package/{time-picker.element-C3oR0EkQ.js → time-picker.element-Crmj9YDy.js} +26 -26
  42. package/{time.element-X286nthD.js → time.element-DfSeAZp4.js} +29 -29
  43. package/toggle.element-ORsprZ2M.js +66 -0
  44. package/alert.element-DPWq9-0F.js +0 -56
  45. package/button.element-CJay43iR.js +0 -132
  46. package/calendar-DleRbmvP.js +0 -267
  47. package/checkbox.element-CpmrzdH0.js +0 -200
  48. package/currency.element-Cezgzbbs.js +0 -276
  49. package/date-DBuYpvcO.js +0 -849
  50. package/date-input-B3yHsn-g.js +0 -204
  51. package/date-picker.element-ByZefznr.js +0 -357
  52. package/date-time-calendar-CB5cNoOX.js +0 -374
  53. package/date-time-input-DrY68YDX.js +0 -246
  54. package/date-time-picker.element-CYwmumfq.js +0 -440
  55. package/day-status-ljexnwEO.js +0 -554
  56. package/errors-Bs_vYN-_.js +0 -110
  57. package/focus-leave.controller-2gV0pQd5.js +0 -73
  58. package/list-D730tmGN.js +0 -297
  59. package/markdown-text-X-BRJT6K.js +0 -30
  60. package/markdown-text.element-B8TfVLIO.js +0 -55
  61. package/markdown.element-D5zcxAUS.js +0 -693
  62. package/number.element-DEY5tR_y.js +0 -291
  63. package/numeric-jmOOKz30.js +0 -12
  64. package/one-of-anKkm7mD.js +0 -50
  65. package/part-templates-VORbpgs2.js +0 -691
  66. package/password.element-C1aQh_iz.js +0 -240
  67. package/pill-ranges-DpvWwP-3.js +0 -48
  68. package/pills-BDMO2NiR.js +0 -348
  69. package/popup.controller-B33OvX_y.js +0 -86
  70. package/radiogroup.element-B2G-XyGx.js +0 -235
  71. package/range-calendar-D7sG24Kx.js +0 -466
  72. package/range-commit-8-MmYUyo.js +0 -14
  73. package/range-date-input-BChaoBC1.js +0 -311
  74. package/range-date-picker.element-Do5YsL5V.js +0 -434
  75. package/range-date-time-calendar-DulGK2EQ.js +0 -734
  76. package/range-date-time-input-8ggqckP7.js +0 -353
  77. package/range-date-time-picker.element-hi5KdopZ.js +0 -472
  78. package/range-selection-CU3hxLJE.js +0 -25
  79. package/range-time-input-D7GFdDeA.js +0 -348
  80. package/range-time-picker.element-DDNQMA_u.js +0 -470
  81. package/renderer.element-CNyMn2Lu.js +0 -49
  82. package/select.element-SDxBhGjz.js +0 -266
  83. package/tabs-DzSCq_98.js +0 -13
  84. package/tags.element-Bnhfevp3.js +0 -369
  85. package/templates-Df7abEkB.js +0 -92
  86. package/textarea.element-Dx7eYEnl.js +0 -239
  87. package/textinput.element-BnIoDRmY.js +0 -205
  88. package/time-input-Kk4EX6at.js +0 -201
  89. package/time-list-DLcq8BAp.js +0 -217
  90. package/time-picker-DLj1rhOf.js +0 -299
  91. package/toggle.element-Dokdat_o.js +0 -203
@@ -1,472 +0,0 @@
1
- import { InputWidgetAdapter as g, formContext as c, inputContext as y } from "@golemui/lit";
2
- import { LitElement as m, html as h, nothing as $ } from "lit";
3
- import { property as i, state as v, customElement as b } from "lit/decorators.js";
4
- import { classMap as L } from "lit/directives/class-map.js";
5
- import "./range-date-time-input-8ggqckP7.js";
6
- import "./range-date-time-calendar-DulGK2EQ.js";
7
- import { G as A } from "./popup.controller-B33OvX_y.js";
8
- import { a as D, b as T, c as f } from "./templates-Df7abEkB.js";
9
- import { consume as M, provide as C } from "@lit/context";
10
- import "rxjs";
11
- var w = Object.defineProperty, S = Object.getOwnPropertyDescriptor, a = (e, r, n, s) => {
12
- for (var o = s > 1 ? void 0 : s ? S(r, n) : r, l = e.length - 1, d; l >= 0; l--)
13
- (d = e[l]) && (o = (s ? d(r, n, o) : d(o)) || o);
14
- return s && o && w(r, n, o), o;
15
- };
16
- let t = class extends m {
17
- constructor() {
18
- super(...arguments), this.uid = void 0, this.label = void 0, this.hint = void 0, this.icon = "", this.errors = [], this.showErrors = !0, this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.localeId = void 0, this.value = [], this.toggleAriaLabel = void 0, this.dayAriaLabel = void 0, this.monthAriaLabel = void 0, this.yearAriaLabel = void 0, this.hourAriaLabel = void 0, this.minuteAriaLabel = void 0, this.dayPeriodAriaLabel = void 0, this.separator = void 0, this.removePillAriaLabel = void 0, this.startDateTimeAriaLabel = void 0, this.endDateTimeAriaLabel = void 0, this.invalidDateMessage = void 0, this.prevMonthIcon = "", this.nextMonthIcon = "", this.prevMonthAriaLabel = void 0, this.nextMonthAriaLabel = void 0, this.selectYearAriaLabel = void 0, this.yearGridAriaLabel = void 0, this.dayFormat = void 0, this.weekdayFormat = void 0, this.monthFormat = void 0, this.numberOfMonths = void 0, this.hourFormat = void 0, this.minuteStep = void 0, this.allowCustomTime = !1, this.startTimeLabel = void 0, this.endTimeLabel = void 0, this.minDateTime = void 0, this.maxDateTime = void 0, this.minDateTimeMessage = void 0, this.maxDateTimeMessage = void 0, this.disabledRanges = void 0, this.disabledRangeMessage = void 0, this.noAvailableTimesMessage = void 0, this.dayCountAriaLabel = void 0, this.disabledDayCountAriaLabel = void 0, this._focusDate = void 0, this._popup = new A(this, {
19
- focusRestoreSelector: "gui-range-date-time input",
20
- focusPopupSelector: '.gui-calendar__day-button[tabindex="0"]',
21
- isDisabled: () => !!this.disabled,
22
- clickIntent: (e) => e.closest(".gui-calendar__day-button") || e.closest(".gui-time-list__option") || e.closest("gui-time-picker") ? "ignore" : e.closest(".gui-range-date-time-input__field") || e.closest("gui-range-date-time-calendar") ? "open" : "toggle",
23
- keyToggleMode: "openClose",
24
- beforeOpen: (e) => {
25
- this.querySelector(".gui-pills__dropdown") && e.suppressNextFocusOut(), this.closePillsDropdown();
26
- },
27
- onOpenChanged: (e) => {
28
- e || (this._focusDate = void 0);
29
- }
30
- }), this.onDropdownToggle = (e) => {
31
- e.detail?.open && this._popup.open && this._popup.close();
32
- }, this.onToggleClick = (e) => {
33
- e.stopPropagation(), this._popup.open ? this._popup.close() : this._popup.openAndFocus();
34
- };
35
- }
36
- createRenderRoot() {
37
- return this;
38
- }
39
- connectedCallback() {
40
- super.connectedCallback(), this.addEventListener("dropdowntoggle", this.onDropdownToggle);
41
- }
42
- disconnectedCallback() {
43
- super.disconnectedCallback(), this.removeEventListener("dropdowntoggle", this.onDropdownToggle);
44
- }
45
- render() {
46
- const e = D("datePicker", { icon: this.icon }), r = this._popup.open ? h`<gui-range-date-time-calendar
47
- id=${`${this.uid}_popup`}
48
- role="dialog"
49
- aria-label=${this.label ?? "Calendar"}
50
- .uid=${this.uid}
51
- .hint=${this.hint}
52
- ?touched=${this.touched}
53
- ?required=${this.required}
54
- ?disabled=${this.disabled}
55
- ?readonly=${this.readOnly}
56
- .value=${this.value}
57
- .focusDate=${this._focusDate}
58
- .hidePills=${!0}
59
- .localeId=${this.localeId}
60
- .prevMonthIcon=${this.prevMonthIcon}
61
- .nextMonthIcon=${this.nextMonthIcon}
62
- .prevMonthAriaLabel=${this.prevMonthAriaLabel}
63
- .nextMonthAriaLabel=${this.nextMonthAriaLabel}
64
- .selectYearAriaLabel=${this.selectYearAriaLabel}
65
- .yearGridAriaLabel=${this.yearGridAriaLabel}
66
- .dayFormat=${this.dayFormat}
67
- .weekdayFormat=${this.weekdayFormat}
68
- .monthFormat=${this.monthFormat}
69
- .numberOfMonths=${this.numberOfMonths}
70
- .hourFormat=${this.hourFormat}
71
- .minuteStep=${this.minuteStep}
72
- .allowCustomTime=${this.allowCustomTime}
73
- .startTimeLabel=${this.startTimeLabel}
74
- .endTimeLabel=${this.endTimeLabel}
75
- .minDateTime=${this.minDateTime}
76
- .maxDateTime=${this.maxDateTime}
77
- .minDateTimeMessage=${this.minDateTimeMessage}
78
- .maxDateTimeMessage=${this.maxDateTimeMessage}
79
- .disabledRanges=${this.disabledRanges}
80
- .disabledRangeMessage=${this.disabledRangeMessage}
81
- .noAvailableTimesMessage=${this.noAvailableTimesMessage}
82
- .dayCountAriaLabel=${this.dayCountAriaLabel}
83
- .disabledDayCountAriaLabel=${this.disabledDayCountAriaLabel}
84
- @blur=${this.onCalendarBlur}
85
- @change=${this.onCalendarChange}
86
- @inputError=${this.onCalendarInputError}
87
- ></gui-range-date-time-calendar>` : $;
88
- return h`
89
- ${T(
90
- this.uid ?? "",
91
- {
92
- label: this.label,
93
- hint: this.hint,
94
- required: this.required
95
- },
96
- !1,
97
- void 0,
98
- !1
99
- )}
100
-
101
- <div
102
- class="gui-widget"
103
- @keydown=${this._popup.onAnchorKeyDown}
104
- @click=${this._popup.onAnchorClick}
105
- >
106
- <gui-range-date-time
107
- id="date-input"
108
- class=${L(e.widgetClasses)}
109
- .uid=${this.uid}
110
- .hint=${this.hint}
111
- .showErrors=${!1}
112
- .errors=${this.errors}
113
- ?touched=${this.touched}
114
- ?required=${this.required}
115
- ?disabled=${this.disabled}
116
- ?readonly=${this.readOnly}
117
- .value=${this.value}
118
- .icon=${this.icon}
119
- .localeId=${this.localeId}
120
- .hourFormat=${this.hourFormat}
121
- .minuteStep=${this.minuteStep}
122
- .separator=${this.separator}
123
- .removePillAriaLabel=${this.removePillAriaLabel}
124
- .startDateTimeAriaLabel=${this.startDateTimeAriaLabel}
125
- .endDateTimeAriaLabel=${this.endDateTimeAriaLabel}
126
- .dayAriaLabel=${this.dayAriaLabel}
127
- .monthAriaLabel=${this.monthAriaLabel}
128
- .yearAriaLabel=${this.yearAriaLabel}
129
- .hourAriaLabel=${this.hourAriaLabel}
130
- .minuteAriaLabel=${this.minuteAriaLabel}
131
- .dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
132
- .invalidDateMessage=${this.invalidDateMessage}
133
- .minDateTime=${this.minDateTime}
134
- .maxDateTime=${this.maxDateTime}
135
- .minDateTimeMessage=${this.minDateTimeMessage}
136
- .maxDateTimeMessage=${this.maxDateTimeMessage}
137
- .disabledRanges=${this.disabledRanges}
138
- .disabledRangeMessage=${this.disabledRangeMessage}
139
- @blur=${this.onDateBlur}
140
- @focus=${this._popup.show}
141
- @change=${this.onDateChange}
142
- @pillClick=${this.onPillClick}
143
- ></gui-range-date-time>
144
- <button
145
- type="button"
146
- class="gui-range-date-time-picker__arrow"
147
- aria-label=${this.toggleAriaLabel ?? "Show calendar"}
148
- aria-haspopup="dialog"
149
- aria-expanded=${this._popup.open ? "true" : "false"}
150
- aria-controls=${`${this.uid}_popup`}
151
- ?disabled=${this.disabled}
152
- @click=${this.onToggleClick}
153
- >
154
- <svg
155
- xmlns="http://www.w3.org/2000/svg"
156
- width="16"
157
- height="16"
158
- viewBox="0 0 256 256"
159
- aria-hidden="true"
160
- >
161
- <path
162
- d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
163
- ></path>
164
- </svg>
165
- </button>
166
-
167
- ${r}
168
- </div>
169
-
170
- ${this.showErrors ? f(this.uid ?? "", { errors: this.errors, touched: this.touched }) : ""}
171
- `;
172
- }
173
- onDateChange(e) {
174
- e.stopPropagation(), this.commitValue(e.detail.value);
175
- }
176
- onDateBlur() {
177
- this.dispatchEvent(new CustomEvent("blur"));
178
- }
179
- onCalendarChange(e) {
180
- if (!this._popup.open) {
181
- e.stopPropagation();
182
- return;
183
- }
184
- e.stopPropagation(), this.commitValue(e.detail.value), this._popup.suppressNextFocusOut(), requestAnimationFrame(() => {
185
- if (!this._popup.open) return;
186
- this.querySelector(
187
- 'gui-range-date-time-calendar .gui-calendar__day-button[tabindex="0"]'
188
- )?.focus();
189
- });
190
- }
191
- onCalendarInputError(e) {
192
- e.stopPropagation(), this.dispatchEvent(
193
- new CustomEvent("inputError", {
194
- detail: e.detail,
195
- bubbles: !0,
196
- composed: !0
197
- })
198
- );
199
- }
200
- commitValue(e) {
201
- this.value = e ?? void 0, this.dispatchEvent(
202
- new CustomEvent("change", {
203
- detail: { value: e ?? null },
204
- bubbles: !0,
205
- composed: !0
206
- })
207
- );
208
- }
209
- onCalendarBlur() {
210
- this._popup.closeOnFocusLeave();
211
- }
212
- onPillClick(e) {
213
- this._focusDate = e.detail.range.start, this._popup.show();
214
- }
215
- closePillsDropdown() {
216
- this.querySelector("gui-pills")?.closeDropdown?.();
217
- }
218
- };
219
- a([
220
- i({ type: String })
221
- ], t.prototype, "uid", 2);
222
- a([
223
- i({ type: String })
224
- ], t.prototype, "label", 2);
225
- a([
226
- i({ type: String })
227
- ], t.prototype, "hint", 2);
228
- a([
229
- i({ type: String })
230
- ], t.prototype, "icon", 2);
231
- a([
232
- i({ type: Array })
233
- ], t.prototype, "errors", 2);
234
- a([
235
- i({ type: Boolean })
236
- ], t.prototype, "showErrors", 2);
237
- a([
238
- i({ type: Boolean })
239
- ], t.prototype, "touched", 2);
240
- a([
241
- i({ type: Boolean })
242
- ], t.prototype, "required", 2);
243
- a([
244
- i({ type: Boolean })
245
- ], t.prototype, "disabled", 2);
246
- a([
247
- i({ type: Boolean, attribute: "readonly" })
248
- ], t.prototype, "readOnly", 2);
249
- a([
250
- i({ type: String, attribute: "locale-id" })
251
- ], t.prototype, "localeId", 2);
252
- a([
253
- i({ type: Array })
254
- ], t.prototype, "value", 2);
255
- a([
256
- i({ type: String, attribute: "toggle-aria-label" })
257
- ], t.prototype, "toggleAriaLabel", 2);
258
- a([
259
- i({ type: String })
260
- ], t.prototype, "dayAriaLabel", 2);
261
- a([
262
- i({ type: String })
263
- ], t.prototype, "monthAriaLabel", 2);
264
- a([
265
- i({ type: String })
266
- ], t.prototype, "yearAriaLabel", 2);
267
- a([
268
- i({ type: String })
269
- ], t.prototype, "hourAriaLabel", 2);
270
- a([
271
- i({ type: String })
272
- ], t.prototype, "minuteAriaLabel", 2);
273
- a([
274
- i({ type: String })
275
- ], t.prototype, "dayPeriodAriaLabel", 2);
276
- a([
277
- i({ type: String })
278
- ], t.prototype, "separator", 2);
279
- a([
280
- i({ type: String, attribute: "remove-pill-aria-label" })
281
- ], t.prototype, "removePillAriaLabel", 2);
282
- a([
283
- i({ type: String, attribute: "start-date-time-aria-label" })
284
- ], t.prototype, "startDateTimeAriaLabel", 2);
285
- a([
286
- i({ type: String, attribute: "end-date-time-aria-label" })
287
- ], t.prototype, "endDateTimeAriaLabel", 2);
288
- a([
289
- i({ type: String, attribute: "invalid-date-message" })
290
- ], t.prototype, "invalidDateMessage", 2);
291
- a([
292
- i({ type: String, attribute: "prev-month-icon" })
293
- ], t.prototype, "prevMonthIcon", 2);
294
- a([
295
- i({ type: String, attribute: "next-month-icon" })
296
- ], t.prototype, "nextMonthIcon", 2);
297
- a([
298
- i({ type: String, attribute: "prev-month-aria-label" })
299
- ], t.prototype, "prevMonthAriaLabel", 2);
300
- a([
301
- i({ type: String, attribute: "next-month-aria-label" })
302
- ], t.prototype, "nextMonthAriaLabel", 2);
303
- a([
304
- i({ type: String, attribute: "select-year-aria-label" })
305
- ], t.prototype, "selectYearAriaLabel", 2);
306
- a([
307
- i({ type: String, attribute: "year-grid-aria-label" })
308
- ], t.prototype, "yearGridAriaLabel", 2);
309
- a([
310
- i({ type: String, attribute: "day-format" })
311
- ], t.prototype, "dayFormat", 2);
312
- a([
313
- i({ type: String, attribute: "weekday-format" })
314
- ], t.prototype, "weekdayFormat", 2);
315
- a([
316
- i({ type: String, attribute: "month-format" })
317
- ], t.prototype, "monthFormat", 2);
318
- a([
319
- i({ type: Number, attribute: "number-of-months" })
320
- ], t.prototype, "numberOfMonths", 2);
321
- a([
322
- i({ type: String, attribute: "hour-format" })
323
- ], t.prototype, "hourFormat", 2);
324
- a([
325
- i({ type: Number, attribute: "minute-step" })
326
- ], t.prototype, "minuteStep", 2);
327
- a([
328
- i({ type: Boolean, attribute: "allow-custom-time" })
329
- ], t.prototype, "allowCustomTime", 2);
330
- a([
331
- i({ type: String, attribute: "start-time-label" })
332
- ], t.prototype, "startTimeLabel", 2);
333
- a([
334
- i({ type: String, attribute: "end-time-label" })
335
- ], t.prototype, "endTimeLabel", 2);
336
- a([
337
- i({ type: String, attribute: "min-date-time" })
338
- ], t.prototype, "minDateTime", 2);
339
- a([
340
- i({ type: String, attribute: "max-date-time" })
341
- ], t.prototype, "maxDateTime", 2);
342
- a([
343
- i({ type: String, attribute: "min-date-time-message" })
344
- ], t.prototype, "minDateTimeMessage", 2);
345
- a([
346
- i({ type: String, attribute: "max-date-time-message" })
347
- ], t.prototype, "maxDateTimeMessage", 2);
348
- a([
349
- i({ type: Array, attribute: "disabled-ranges" })
350
- ], t.prototype, "disabledRanges", 2);
351
- a([
352
- i({ type: String, attribute: "disabled-range-message" })
353
- ], t.prototype, "disabledRangeMessage", 2);
354
- a([
355
- i({ type: String, attribute: "no-available-times-message" })
356
- ], t.prototype, "noAvailableTimesMessage", 2);
357
- a([
358
- i({ type: String, attribute: "day-count-aria-label" })
359
- ], t.prototype, "dayCountAriaLabel", 2);
360
- a([
361
- i({ type: String, attribute: "disabled-day-count-aria-label" })
362
- ], t.prototype, "disabledDayCountAriaLabel", 2);
363
- a([
364
- v()
365
- ], t.prototype, "_focusDate", 2);
366
- t = a([
367
- b("gui-range-date-time-picker")
368
- ], t);
369
- typeof customElements < "u" && !customElements.get("gui-range-date-time-picker") && customElements.define("gui-range-date-time-picker", t);
370
- var x = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, u = (e, r, n, s) => {
371
- for (var o = s > 1 ? void 0 : s ? _(r, n) : r, l = e.length - 1, d; l >= 0; l--)
372
- (d = e[l]) && (o = (s ? d(r, n, o) : d(o)) || o);
373
- return s && o && x(r, n, o), o;
374
- };
375
- let p = class extends m {
376
- constructor() {
377
- super(...arguments), this.adapter = new g(), this.subscriptions = [];
378
- }
379
- createRenderRoot() {
380
- return this;
381
- }
382
- updated(e) {
383
- super.updated(e);
384
- const r = this.adapter.templateData.size;
385
- r ? this.style.flex = String(r) : this.style.removeProperty("flex");
386
- }
387
- connectedCallback() {
388
- super.connectedCallback(), this.classList.add("gui-range-date-time-picker", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
389
- this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
390
- );
391
- }
392
- render() {
393
- super.render();
394
- const e = this.adapter.templateData;
395
- return h`
396
- <gui-range-date-time-picker
397
- .uid=${this.widget.uid}
398
- .label=${e.label}
399
- .hint=${e.hint}
400
- .icon=${e.icon}
401
- .errors=${e.errors}
402
- ?touched=${e.touched}
403
- ?required=${e.validator?.required}
404
- ?disabled=${e.disabled}
405
- ?readonly=${e.readonly}
406
- .value=${e.value}
407
- .separator=${e.separator}
408
- .removePillAriaLabel=${e.removePillAriaLabel}
409
- .startDateTimeAriaLabel=${e.startDateTimeAriaLabel}
410
- .endDateTimeAriaLabel=${e.endDateTimeAriaLabel}
411
- .invalidDateMessage=${e.invalidDateMessage}
412
- .prevMonthIcon=${e.prevMonthIcon}
413
- .nextMonthIcon=${e.nextMonthIcon}
414
- .prevMonthAriaLabel=${e.prevMonthAriaLabel}
415
- .nextMonthAriaLabel=${e.nextMonthAriaLabel}
416
- .selectYearAriaLabel=${e.selectYearAriaLabel}
417
- .yearGridAriaLabel=${e.yearGridAriaLabel}
418
- .dayFormat=${e.dayFormat}
419
- .weekdayFormat=${e.weekdayFormat}
420
- .monthFormat=${e.monthFormat}
421
- .numberOfMonths=${e.numberOfMonths}
422
- .localeId=${e.lang}
423
- .toggleAriaLabel=${e.toggleAriaLabel}
424
- .dayAriaLabel=${e.dayAriaLabel}
425
- .monthAriaLabel=${e.monthAriaLabel}
426
- .yearAriaLabel=${e.yearAriaLabel}
427
- .hourAriaLabel=${e.hourAriaLabel}
428
- .minuteAriaLabel=${e.minuteAriaLabel}
429
- .dayPeriodAriaLabel=${e.dayPeriodAriaLabel}
430
- .hourFormat=${e.hourFormat}
431
- .minuteStep=${e.minuteStep}
432
- ?allow-custom-time=${e.allowCustomTime}
433
- .startTimeLabel=${e.startTimeLabel}
434
- .endTimeLabel=${e.endTimeLabel}
435
- .minDateTime=${e.minDateTime}
436
- .maxDateTime=${e.maxDateTime}
437
- .disabledRanges=${e.disabledRanges}
438
- .minDateTimeMessage=${e.minDateTimeMessage}
439
- .maxDateTimeMessage=${e.maxDateTimeMessage}
440
- .disabledRangeMessage=${e.disabledRangeMessage}
441
- .noAvailableTimesMessage=${e.noAvailableTimesMessage}
442
- .dayCountAriaLabel=${e.dayCountAriaLabel}
443
- .disabledDayCountAriaLabel=${e.disabledDayCountAriaLabel}
444
- @change=${this.valueChanged}
445
- @inputError=${this.onInputError}
446
- @blur=${() => this.adapter.onBlur()}
447
- ></gui-range-date-time-picker>
448
- `;
449
- }
450
- valueChanged(e) {
451
- this.adapter.injectValidationIssues(null), this.adapter.valueChanged(e.detail.value);
452
- }
453
- onInputError(e) {
454
- this.adapter.injectValidationIssues([e.detail.message]), this.adapter.onBlur();
455
- }
456
- disconnectedCallback() {
457
- super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
458
- }
459
- };
460
- u([
461
- M({ context: c }),
462
- i({ attribute: !1 })
463
- ], p.prototype, "formContext", 2);
464
- u([
465
- C({ context: y })
466
- ], p.prototype, "adapter", 2);
467
- p = u([
468
- b("gui-range-date-time-picker-input")
469
- ], p);
470
- export {
471
- p as RangeDateTimePickerElement
472
- };
@@ -1,25 +0,0 @@
1
- function o() {
2
- return { anchor: null, hover: null, selecting: !1 };
3
- }
4
- function i(r, e) {
5
- switch (e.type) {
6
- case "pick": {
7
- if (!r.anchor)
8
- return { state: { anchor: e.date, hover: r.hover, selecting: !0 } };
9
- let n = r.anchor, c = e.date;
10
- return e.date < n && (n = e.date, c = r.anchor), { state: o(), commit: { start: n, end: c } };
11
- }
12
- case "hover":
13
- return r.selecting ? { state: { ...r, hover: e.date } } : { state: r };
14
- case "reset":
15
- return { state: o() };
16
- }
17
- }
18
- function h(r) {
19
- return !r.selecting || !r.hover || !r.anchor ? null : r.hover.getTime() > r.anchor.getTime() ? { start: r.anchor, end: r.hover } : { start: r.hover, end: r.anchor };
20
- }
21
- export {
22
- o as i,
23
- i as r,
24
- h as s
25
- };