@golemui/gui-lit 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/calendar-BuJgwvZx.js +254 -0
- package/{calendar.element-MubSE1bx.js → calendar.element-M5MPJmap.js} +1 -1
- package/{currency.element-BHXWcOEu.js → currency.element-CfFrAtrr.js} +20 -14
- package/{date-DTYg8sog.js → date-Bj9mI3GU.js} +106 -50
- package/date-input-cJDkNnVw.js +184 -0
- package/date-picker.element-va_-LGZD.js +312 -0
- package/date-time-calendar-BzRfkLKU.js +361 -0
- package/date-time-calendar.element-DC4NK0y1.js +93 -0
- package/date-time-input-BXxsfuyZ.js +214 -0
- package/date-time-picker.element-Dy-8cb-_.js +380 -0
- package/date-time.element-Bv4XdzMi.js +87 -0
- package/{date.element-BtVJSIRk.js → date.element-Consgsbb.js} +32 -27
- package/day-status-0-hJHrI7.js +530 -0
- package/{dropdown.element-DqzC6aXR.js → dropdown.element-WsD61Qel.js} +57 -48
- package/focus-leave.controller-2gV0pQd5.js +73 -0
- package/index.js +1209 -981
- package/index.umd.cjs +1574 -519
- package/lib/components/date-picker.element.d.ts +0 -11
- package/lib/components/date-time-calendar.element.d.ts +18 -0
- package/lib/components/date-time-picker.element.d.ts +18 -0
- package/lib/components/date-time.element.d.ts +18 -0
- package/lib/components/dropdown.element.d.ts +2 -0
- package/lib/components/range-calendar.element.d.ts +2 -1
- package/lib/components/range-date-picker.element.d.ts +0 -15
- package/lib/components/range-date-time-calendar.element.d.ts +18 -0
- package/lib/components/range-date-time-input.element.d.ts +18 -0
- package/lib/components/range-date-time-picker.element.d.ts +18 -0
- package/lib/components/range-time-input.element.d.ts +18 -0
- package/lib/components/range-time-picker.element.d.ts +18 -0
- package/lib/components/time-picker.element.d.ts +18 -0
- package/lib/components/time.element.d.ts +18 -0
- package/{list-D1oKnH89.js → list-CrLIL4by.js} +76 -61
- package/{list.element-Co3V3Cn5.js → list.element-DV82YxnJ.js} +22 -22
- package/{number.element-BhEyoOtc.js → number.element-CBr47IiY.js} +18 -16
- package/numeric-jmOOKz30.js +12 -0
- package/package.json +6 -6
- package/part-templates-Db871PS3.js +677 -0
- package/pill-ranges-DCqDmpkk.js +48 -0
- package/{pills-B66qz_KX.js → pills-Be1UrLgq.js} +4 -1
- package/popup.controller-eUDxE6jD.js +71 -0
- package/range-calendar-CKPYeSGt.js +452 -0
- package/{range-calendar.element-QTE6vGNP.js → range-calendar.element-D6KYq18B.js} +24 -20
- package/range-commit-8-MmYUyo.js +14 -0
- package/range-date-input-D--AqBMv.js +292 -0
- package/{range-date-input.element-Dj29D_OQ.js → range-date-input.element-D4nIXJbw.js} +8 -7
- package/range-date-picker.element-dhxPAAE6.js +386 -0
- package/range-date-time-calendar-yksWrR7b.js +720 -0
- package/range-date-time-calendar.element-C00aDefZ.js +95 -0
- package/range-date-time-input-B37TUoM3.js +322 -0
- package/range-date-time-input.element-DUnbv4ed.js +81 -0
- package/range-date-time-picker.element-Cbps6s_G.js +412 -0
- package/range-selection-CU3hxLJE.js +25 -0
- package/range-time-input-3lhqR1Ku.js +329 -0
- package/range-time-input.element-dU2iBdmJ.js +81 -0
- package/range-time-picker.element-v6nQsIPw.js +429 -0
- package/{select.element-jcDF1h-g.js → select.element-C0V-Bv3L.js} +94 -90
- package/{tags.element-CX3vQL8L.js → tags.element-DvwEpxpK.js} +1 -1
- package/time-input-BOhlBGJZ.js +181 -0
- package/time-list-Czo48bZm.js +217 -0
- package/time-picker-bFJ63ky8.js +261 -0
- package/time-picker.element-CYZVXgRS.js +85 -0
- package/time.element-fK3oLi49.js +82 -0
- package/abstract-calendar-BoqKPRmS.js +0 -545
- package/calendar-DTYKVYc3.js +0 -96
- package/date-input-BeQvyfln.js +0 -268
- package/date-picker.element-DabW_-0-.js +0 -166
- package/range-calendar-9skwbwlB.js +0 -255
- package/range-date-input-Uy8134vi.js +0 -395
- package/range-date-picker.element-CuKIBkIO.js +0 -182
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { InputWidgetAdapter as v, formContext as y, inputContext as T } from "@golemui/lit";
|
|
2
|
+
import { LitElement as g, html as d, nothing as _ } from "lit";
|
|
3
|
+
import { property as a, query as c, state as b, customElement as $ } from "lit/decorators.js";
|
|
4
|
+
import { classMap as f } from "lit/directives/class-map.js";
|
|
5
|
+
import "./range-time-input-3lhqR1Ku.js";
|
|
6
|
+
import "./time-list-Czo48bZm.js";
|
|
7
|
+
import { G as w } from "./popup.controller-eUDxE6jD.js";
|
|
8
|
+
import { k as I, s as u, t as k } from "./part-templates-Db871PS3.js";
|
|
9
|
+
import { a as L, b as S, c as M } from "./templates-Dk1jxLwS.js";
|
|
10
|
+
import { I as C, a as A, b as x } from "./date-Bj9mI3GU.js";
|
|
11
|
+
import { consume as E, provide as R } from "@lit/context";
|
|
12
|
+
import "rxjs";
|
|
13
|
+
var O = Object.defineProperty, P = Object.getOwnPropertyDescriptor, i = (e, s, o, n) => {
|
|
14
|
+
for (var r = n > 1 ? void 0 : n ? P(s, o) : s, l = e.length - 1, p; l >= 0; l--)
|
|
15
|
+
(p = e[l]) && (r = (n ? p(s, o, r) : p(r)) || r);
|
|
16
|
+
return n && r && O(s, o, r), r;
|
|
17
|
+
};
|
|
18
|
+
let t = class extends g {
|
|
19
|
+
constructor() {
|
|
20
|
+
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.separator = void 0, this.removePillAriaLabel = void 0, this.startTimeAriaLabel = void 0, this.endTimeAriaLabel = void 0, this.startTimeLabel = void 0, this.endTimeLabel = void 0, this.hourFormat = void 0, this.minuteStep = void 0, this.minTime = void 0, this.maxTime = void 0, this.disabledRanges = void 0, this.allowCustomTime = !1, this.height = void 0, this.itemHeight = void 0, this.minTimeMessage = void 0, this.maxTimeMessage = void 0, this.rangeOrderMessage = void 0, this.disabledRangeMessage = void 0, this.noAvailableTimesMessage = void 0, this._workingIn = void 0, this._workingOut = void 0, this._popup = new w(this, {
|
|
21
|
+
getInteriorElements: () => [this._inputRef, this._panelRef],
|
|
22
|
+
focusRestoreSelector: "gui-range-time input, gui-range-time button",
|
|
23
|
+
isDisabled: () => !!this.disabled,
|
|
24
|
+
clickIntent: (e) => e.closest(".gui-time-list__option") ? "ignore" : e.closest(".gui-range-time-input__part") || e.closest(".gui-range-time-picker__panel") ? "open" : "toggle",
|
|
25
|
+
keyToggleMode: "openClose",
|
|
26
|
+
beforeOpen: (e) => {
|
|
27
|
+
this.querySelector(".gui-pills__dropdown") && e.suppressNextFocusOut(), this.closePillsDropdown();
|
|
28
|
+
},
|
|
29
|
+
onOpenChanged: (e) => {
|
|
30
|
+
e || (this._workingIn = void 0, this._workingOut = void 0);
|
|
31
|
+
}
|
|
32
|
+
}), this.onDropdownToggle = (e) => {
|
|
33
|
+
e.detail?.open && this._popup.open && this._popup.close();
|
|
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
|
+
/**
|
|
46
|
+
* Bounds for the "time out" list: undefined until an "in" is chosen. Once
|
|
47
|
+
* chosen, the floor is one slot after "in" so `out > in` strictly; when that
|
|
48
|
+
* spills past the end of the day, an empty (min > max) window yields the
|
|
49
|
+
* "no available times" message.
|
|
50
|
+
*/
|
|
51
|
+
get outListBounds() {
|
|
52
|
+
if (!this._workingIn) return { minTime: this.minTime, maxTime: this.maxTime };
|
|
53
|
+
const e = I(this._workingIn, this.minuteStep);
|
|
54
|
+
return e ? { minTime: e, maxTime: this.maxTime } : { minTime: "23:59:59", maxTime: "00:00:00" };
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
const e = L("rangeTimePicker", { icon: this.icon }), s = this.outListBounds, o = this.startTimeLabel ?? "Start time", n = this.endTimeLabel ?? "End time", r = this._popup.open ? d`<div class="gui-range-time-picker__panel" id="list-panel" role="group">
|
|
58
|
+
<div class="gui-range-time-picker__column">
|
|
59
|
+
<span class="gui-range-time-picker__column-label">${o}</span>
|
|
60
|
+
<gui-time-list
|
|
61
|
+
class="gui-range-time-picker__list"
|
|
62
|
+
.uid=${this.uid}
|
|
63
|
+
.label=${o}
|
|
64
|
+
.value=${this._workingIn}
|
|
65
|
+
.localeId=${this.localeId}
|
|
66
|
+
.hourFormat=${this.hourFormat}
|
|
67
|
+
.minuteStep=${this.minuteStep}
|
|
68
|
+
.minTime=${this.minTime}
|
|
69
|
+
.maxTime=${this.maxTime}
|
|
70
|
+
.disabledRanges=${this.disabledRanges}
|
|
71
|
+
.height=${this.height}
|
|
72
|
+
.itemHeight=${this.itemHeight}
|
|
73
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
74
|
+
?readonly=${this.readOnly}
|
|
75
|
+
@change=${this.onInListChange}
|
|
76
|
+
></gui-time-list>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div class="gui-range-time-picker__column">
|
|
80
|
+
<span class="gui-range-time-picker__column-label">${n}</span>
|
|
81
|
+
<gui-time-list
|
|
82
|
+
class="gui-range-time-picker__list"
|
|
83
|
+
.uid=${this.uid}
|
|
84
|
+
.label=${n}
|
|
85
|
+
.value=${this._workingOut}
|
|
86
|
+
.localeId=${this.localeId}
|
|
87
|
+
.hourFormat=${this.hourFormat}
|
|
88
|
+
.minuteStep=${this.minuteStep}
|
|
89
|
+
.minTime=${s.minTime}
|
|
90
|
+
.maxTime=${s.maxTime}
|
|
91
|
+
.disabledRanges=${this.disabledRanges}
|
|
92
|
+
.height=${this.height}
|
|
93
|
+
.itemHeight=${this.itemHeight}
|
|
94
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
95
|
+
?disabled=${!this._workingIn}
|
|
96
|
+
?readonly=${this.readOnly}
|
|
97
|
+
@change=${this.onOutListChange}
|
|
98
|
+
></gui-time-list>
|
|
99
|
+
</div>
|
|
100
|
+
</div>` : _;
|
|
101
|
+
return d`
|
|
102
|
+
${S(this.uid ?? "", {
|
|
103
|
+
label: this.label,
|
|
104
|
+
hint: this.hint,
|
|
105
|
+
required: this.required
|
|
106
|
+
})}
|
|
107
|
+
|
|
108
|
+
<div
|
|
109
|
+
role="button"
|
|
110
|
+
tabindex="-1"
|
|
111
|
+
class="gui-widget"
|
|
112
|
+
aria-expanded=${this._popup.open}
|
|
113
|
+
@keyup=${this._popup.onAnchorKeyUp}
|
|
114
|
+
@keydown=${this._popup.onAnchorKeyDown}
|
|
115
|
+
@click=${this._popup.onAnchorClick}
|
|
116
|
+
>
|
|
117
|
+
<gui-range-time
|
|
118
|
+
id="time-input"
|
|
119
|
+
class=${f(e.widgetClasses)}
|
|
120
|
+
.uid=${this.uid}
|
|
121
|
+
.hint=${this.hint}
|
|
122
|
+
.showErrors=${!1}
|
|
123
|
+
.errors=${this.errors}
|
|
124
|
+
?touched=${this.touched}
|
|
125
|
+
?required=${this.required}
|
|
126
|
+
?disabled=${this.disabled}
|
|
127
|
+
?readonly=${this.readOnly}
|
|
128
|
+
.allowCustomTime=${this.allowCustomTime ?? !1}
|
|
129
|
+
.value=${this.value}
|
|
130
|
+
.icon=${this.icon}
|
|
131
|
+
.localeId=${this.localeId}
|
|
132
|
+
.separator=${this.separator}
|
|
133
|
+
.hourFormat=${this.hourFormat}
|
|
134
|
+
.minuteStep=${this.minuteStep}
|
|
135
|
+
.minTime=${this.minTime}
|
|
136
|
+
.maxTime=${this.maxTime}
|
|
137
|
+
.disabledRanges=${this.disabledRanges}
|
|
138
|
+
.minTimeMessage=${this.minTimeMessage}
|
|
139
|
+
.maxTimeMessage=${this.maxTimeMessage}
|
|
140
|
+
.rangeOrderMessage=${this.rangeOrderMessage}
|
|
141
|
+
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
142
|
+
.removePillAriaLabel=${this.removePillAriaLabel}
|
|
143
|
+
.startTimeAriaLabel=${this.startTimeAriaLabel}
|
|
144
|
+
.endTimeAriaLabel=${this.endTimeAriaLabel}
|
|
145
|
+
@blur=${this.onInputBlur}
|
|
146
|
+
@focus=${this._popup.show}
|
|
147
|
+
@change=${this.onInputChange}
|
|
148
|
+
@partsChange=${this.onPartsChange}
|
|
149
|
+
@pillClick=${this.onPillClick}
|
|
150
|
+
></gui-range-time>
|
|
151
|
+
<span class="gui-range-time-picker__arrow"
|
|
152
|
+
><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
|
|
153
|
+
<path
|
|
154
|
+
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"
|
|
155
|
+
></path></svg
|
|
156
|
+
></span>
|
|
157
|
+
|
|
158
|
+
${r}
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
${this.showErrors ? M(this.uid ?? "", { errors: this.errors, touched: this.touched }) : ""}
|
|
162
|
+
`;
|
|
163
|
+
}
|
|
164
|
+
onInputChange(e) {
|
|
165
|
+
e.stopPropagation(), this._workingIn = void 0, this._workingOut = void 0, this.commitValue(e.detail.value);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Mirrors the input's live, in-bounds start/end into the two lists, so typing
|
|
169
|
+
* a value that exists as a slot highlights it (and a typed start enables and
|
|
170
|
+
* floors the end list) — the reverse of a list pick filling the fields.
|
|
171
|
+
*/
|
|
172
|
+
onPartsChange(e) {
|
|
173
|
+
e.stopPropagation(), this._workingIn = e.detail.start ?? void 0, this._workingOut = e.detail.end ?? void 0;
|
|
174
|
+
}
|
|
175
|
+
onInputBlur() {
|
|
176
|
+
this.dispatchEvent(new CustomEvent("blur"));
|
|
177
|
+
}
|
|
178
|
+
onInListChange(e) {
|
|
179
|
+
e.stopPropagation();
|
|
180
|
+
const s = e.detail.value;
|
|
181
|
+
this._workingIn = s ?? void 0, this._workingOut = void 0, s && this._inputRef?.fillGroup("start", s);
|
|
182
|
+
}
|
|
183
|
+
onOutListChange(e) {
|
|
184
|
+
e.stopPropagation();
|
|
185
|
+
const s = e.detail.value;
|
|
186
|
+
if (!this._workingIn || !s || !this._inputRef) return;
|
|
187
|
+
this._inputRef.fillGroup("end", s), this._inputRef.commitFromParts() ? (this._workingIn = void 0, this._workingOut = void 0, this.updateComplete.then(() => {
|
|
188
|
+
this._inListRef()?.scrollToSelectedValue?.();
|
|
189
|
+
})) : (this._popup.close(), this.dispatchEvent(new CustomEvent("blur")));
|
|
190
|
+
}
|
|
191
|
+
_inListRef() {
|
|
192
|
+
return this.querySelector(
|
|
193
|
+
".gui-range-time-picker__column:first-child gui-time-list"
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
commitValue(e) {
|
|
197
|
+
this.value = e ?? void 0;
|
|
198
|
+
const s = this.validateBounds(this.value);
|
|
199
|
+
this.dispatchEvent(
|
|
200
|
+
new CustomEvent("change", {
|
|
201
|
+
detail: { value: e ?? null },
|
|
202
|
+
bubbles: !0,
|
|
203
|
+
composed: !0
|
|
204
|
+
})
|
|
205
|
+
), s && this.dispatchEvent(
|
|
206
|
+
new CustomEvent("inputError", {
|
|
207
|
+
detail: { message: s },
|
|
208
|
+
bubbles: !0,
|
|
209
|
+
composed: !0
|
|
210
|
+
})
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
validateBounds(e) {
|
|
214
|
+
if (!e || e.length === 0) return null;
|
|
215
|
+
for (const s of e) {
|
|
216
|
+
for (const o of [s.start, s.end])
|
|
217
|
+
if (o) {
|
|
218
|
+
if (this.minTime && u(o, this.minTime) < 0)
|
|
219
|
+
return this.minTimeMessage ?? C;
|
|
220
|
+
if (this.maxTime && u(o, this.maxTime) > 0)
|
|
221
|
+
return this.maxTimeMessage ?? A;
|
|
222
|
+
}
|
|
223
|
+
if (k(s.start, s.end, this.disabledRanges))
|
|
224
|
+
return this.disabledRangeMessage ?? x;
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
onPillClick() {
|
|
229
|
+
this._popup.show();
|
|
230
|
+
}
|
|
231
|
+
closePillsDropdown() {
|
|
232
|
+
this.querySelector("gui-pills")?.closeDropdown?.();
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
i([
|
|
236
|
+
a({ type: String })
|
|
237
|
+
], t.prototype, "uid", 2);
|
|
238
|
+
i([
|
|
239
|
+
a({ type: String })
|
|
240
|
+
], t.prototype, "label", 2);
|
|
241
|
+
i([
|
|
242
|
+
a({ type: String })
|
|
243
|
+
], t.prototype, "hint", 2);
|
|
244
|
+
i([
|
|
245
|
+
a({ type: String })
|
|
246
|
+
], t.prototype, "icon", 2);
|
|
247
|
+
i([
|
|
248
|
+
a({ type: Array })
|
|
249
|
+
], t.prototype, "errors", 2);
|
|
250
|
+
i([
|
|
251
|
+
a({ type: Boolean })
|
|
252
|
+
], t.prototype, "showErrors", 2);
|
|
253
|
+
i([
|
|
254
|
+
a({ type: Boolean })
|
|
255
|
+
], t.prototype, "touched", 2);
|
|
256
|
+
i([
|
|
257
|
+
a({ type: Boolean })
|
|
258
|
+
], t.prototype, "required", 2);
|
|
259
|
+
i([
|
|
260
|
+
a({ type: Boolean })
|
|
261
|
+
], t.prototype, "disabled", 2);
|
|
262
|
+
i([
|
|
263
|
+
a({ type: Boolean, attribute: "readonly" })
|
|
264
|
+
], t.prototype, "readOnly", 2);
|
|
265
|
+
i([
|
|
266
|
+
a({ type: String, attribute: "locale-id" })
|
|
267
|
+
], t.prototype, "localeId", 2);
|
|
268
|
+
i([
|
|
269
|
+
a({ type: Array })
|
|
270
|
+
], t.prototype, "value", 2);
|
|
271
|
+
i([
|
|
272
|
+
a({ type: String })
|
|
273
|
+
], t.prototype, "separator", 2);
|
|
274
|
+
i([
|
|
275
|
+
a({ type: String, attribute: "remove-pill-aria-label" })
|
|
276
|
+
], t.prototype, "removePillAriaLabel", 2);
|
|
277
|
+
i([
|
|
278
|
+
a({ type: String, attribute: "start-time-aria-label" })
|
|
279
|
+
], t.prototype, "startTimeAriaLabel", 2);
|
|
280
|
+
i([
|
|
281
|
+
a({ type: String, attribute: "end-time-aria-label" })
|
|
282
|
+
], t.prototype, "endTimeAriaLabel", 2);
|
|
283
|
+
i([
|
|
284
|
+
a({ type: String, attribute: "start-time-label" })
|
|
285
|
+
], t.prototype, "startTimeLabel", 2);
|
|
286
|
+
i([
|
|
287
|
+
a({ type: String, attribute: "end-time-label" })
|
|
288
|
+
], t.prototype, "endTimeLabel", 2);
|
|
289
|
+
i([
|
|
290
|
+
a({ type: String, attribute: "hour-format" })
|
|
291
|
+
], t.prototype, "hourFormat", 2);
|
|
292
|
+
i([
|
|
293
|
+
a({ type: Number, attribute: "minute-step" })
|
|
294
|
+
], t.prototype, "minuteStep", 2);
|
|
295
|
+
i([
|
|
296
|
+
a({ type: String, attribute: "min-time" })
|
|
297
|
+
], t.prototype, "minTime", 2);
|
|
298
|
+
i([
|
|
299
|
+
a({ type: String, attribute: "max-time" })
|
|
300
|
+
], t.prototype, "maxTime", 2);
|
|
301
|
+
i([
|
|
302
|
+
a({ type: Array, attribute: "disabled-ranges" })
|
|
303
|
+
], t.prototype, "disabledRanges", 2);
|
|
304
|
+
i([
|
|
305
|
+
a({ type: Boolean, attribute: "allow-custom-time" })
|
|
306
|
+
], t.prototype, "allowCustomTime", 2);
|
|
307
|
+
i([
|
|
308
|
+
a({ type: Number })
|
|
309
|
+
], t.prototype, "height", 2);
|
|
310
|
+
i([
|
|
311
|
+
a({ type: Number, attribute: "item-height" })
|
|
312
|
+
], t.prototype, "itemHeight", 2);
|
|
313
|
+
i([
|
|
314
|
+
a({ type: String, attribute: "min-time-message" })
|
|
315
|
+
], t.prototype, "minTimeMessage", 2);
|
|
316
|
+
i([
|
|
317
|
+
a({ type: String, attribute: "max-time-message" })
|
|
318
|
+
], t.prototype, "maxTimeMessage", 2);
|
|
319
|
+
i([
|
|
320
|
+
a({ type: String, attribute: "range-order-message" })
|
|
321
|
+
], t.prototype, "rangeOrderMessage", 2);
|
|
322
|
+
i([
|
|
323
|
+
a({ type: String, attribute: "disabled-range-message" })
|
|
324
|
+
], t.prototype, "disabledRangeMessage", 2);
|
|
325
|
+
i([
|
|
326
|
+
a({ type: String, attribute: "no-available-times-message" })
|
|
327
|
+
], t.prototype, "noAvailableTimesMessage", 2);
|
|
328
|
+
i([
|
|
329
|
+
c("#time-input")
|
|
330
|
+
], t.prototype, "_inputRef", 2);
|
|
331
|
+
i([
|
|
332
|
+
c("#list-panel")
|
|
333
|
+
], t.prototype, "_panelRef", 2);
|
|
334
|
+
i([
|
|
335
|
+
b()
|
|
336
|
+
], t.prototype, "_workingIn", 2);
|
|
337
|
+
i([
|
|
338
|
+
b()
|
|
339
|
+
], t.prototype, "_workingOut", 2);
|
|
340
|
+
t = i([
|
|
341
|
+
$("gui-range-time-picker")
|
|
342
|
+
], t);
|
|
343
|
+
typeof customElements < "u" && !customElements.get("gui-range-time-picker") && customElements.define("gui-range-time-picker", t);
|
|
344
|
+
var D = Object.defineProperty, B = Object.getOwnPropertyDescriptor, h = (e, s, o, n) => {
|
|
345
|
+
for (var r = n > 1 ? void 0 : n ? B(s, o) : s, l = e.length - 1, p; l >= 0; l--)
|
|
346
|
+
(p = e[l]) && (r = (n ? p(s, o, r) : p(r)) || r);
|
|
347
|
+
return n && r && D(s, o, r), r;
|
|
348
|
+
};
|
|
349
|
+
let m = class extends g {
|
|
350
|
+
constructor() {
|
|
351
|
+
super(...arguments), this.adapter = new v(), this.subscriptions = [];
|
|
352
|
+
}
|
|
353
|
+
createRenderRoot() {
|
|
354
|
+
return this;
|
|
355
|
+
}
|
|
356
|
+
updated(e) {
|
|
357
|
+
super.updated(e);
|
|
358
|
+
const s = this.adapter.templateData.size;
|
|
359
|
+
s ? this.style.flex = String(s) : this.style.removeProperty("flex");
|
|
360
|
+
}
|
|
361
|
+
connectedCallback() {
|
|
362
|
+
super.connectedCallback(), this.classList.add("gui-range-time-picker", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
363
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
render() {
|
|
367
|
+
super.render();
|
|
368
|
+
const e = this.adapter.templateData;
|
|
369
|
+
return d`
|
|
370
|
+
<gui-range-time-picker
|
|
371
|
+
.uid=${this.widget.uid}
|
|
372
|
+
.label=${e.label}
|
|
373
|
+
.hint=${e.hint}
|
|
374
|
+
.errors=${e.errors}
|
|
375
|
+
?touched=${e.touched}
|
|
376
|
+
?required=${e.validator?.required}
|
|
377
|
+
?disabled=${e.disabled}
|
|
378
|
+
?readonly=${e.readonly}
|
|
379
|
+
.value=${e.value}
|
|
380
|
+
.icon=${e.icon}
|
|
381
|
+
.localeId=${e.lang}
|
|
382
|
+
.separator=${e.separator}
|
|
383
|
+
.removePillAriaLabel=${e.removePillAriaLabel}
|
|
384
|
+
.startTimeAriaLabel=${e.startTimeAriaLabel}
|
|
385
|
+
.endTimeAriaLabel=${e.endTimeAriaLabel}
|
|
386
|
+
.startTimeLabel=${e.startTimeLabel}
|
|
387
|
+
.endTimeLabel=${e.endTimeLabel}
|
|
388
|
+
.hourFormat=${e.hourFormat}
|
|
389
|
+
.minuteStep=${e.minuteStep}
|
|
390
|
+
.minTime=${e.minTime}
|
|
391
|
+
.maxTime=${e.maxTime}
|
|
392
|
+
.disabledRanges=${e.disabledRanges}
|
|
393
|
+
?allow-custom-time=${e.allowCustomTime}
|
|
394
|
+
.height=${e.height}
|
|
395
|
+
.itemHeight=${e.itemHeight}
|
|
396
|
+
.minTimeMessage=${e.minTimeMessage}
|
|
397
|
+
.maxTimeMessage=${e.maxTimeMessage}
|
|
398
|
+
.rangeOrderMessage=${e.rangeOrderMessage}
|
|
399
|
+
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
400
|
+
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
401
|
+
@inputError=${this.onInputError}
|
|
402
|
+
@blur=${() => this.adapter.onBlur()}
|
|
403
|
+
@change=${this.valueChanged}
|
|
404
|
+
></gui-range-time-picker>
|
|
405
|
+
`;
|
|
406
|
+
}
|
|
407
|
+
valueChanged(e) {
|
|
408
|
+
this.adapter.injectValidationIssues(null), this.adapter.valueChanged(e.detail.value);
|
|
409
|
+
}
|
|
410
|
+
onInputError(e) {
|
|
411
|
+
this.adapter.injectValidationIssues([e.detail.message]);
|
|
412
|
+
}
|
|
413
|
+
disconnectedCallback() {
|
|
414
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
h([
|
|
418
|
+
E({ context: y }),
|
|
419
|
+
a({ attribute: !1 })
|
|
420
|
+
], m.prototype, "formContext", 2);
|
|
421
|
+
h([
|
|
422
|
+
R({ context: T })
|
|
423
|
+
], m.prototype, "adapter", 2);
|
|
424
|
+
m = h([
|
|
425
|
+
$("gui-range-time-picker-input")
|
|
426
|
+
], m);
|
|
427
|
+
export {
|
|
428
|
+
m as RangeTimePickerElement
|
|
429
|
+
};
|