@golemui/gui-lit 1.0.3 → 1.1.1-rc.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 +26 -0
- package/{button.element-3a7rRHbA.js → button.element-CJay43iR.js} +16 -13
- package/calendar-D31xNsxx.js +267 -0
- package/{range-calendar.element-_1bHW_c1.js → calendar.element-BhFrCsns.js} +16 -16
- package/{checkbox.element-CVskoXEc.js → checkbox.element-DAAVB651.js} +49 -49
- package/{currency.element-5GSakkxF.js → currency.element-D8A2ObpM.js} +15 -11
- package/{date-CDUlLuYy.js → date-DBuYpvcO.js} +88 -29
- package/date-input-DLiMreSS.js +204 -0
- package/date-picker.element-DeUQtbLg.js +357 -0
- package/date-time-calendar-DzU-FtVl.js +374 -0
- package/date-time-calendar.element-BLBcVsFu.js +95 -0
- package/date-time-input-DZaz2heD.js +246 -0
- package/date-time-picker.element-BUbLdV6i.js +440 -0
- package/date-time.element-B5onfSBG.js +93 -0
- package/{date.element-BZO0UQez.js → date.element-BsKhLrEc.js} +27 -19
- package/day-status-CsWStVQV.js +554 -0
- package/{dropdown.element-CyJbVAA5.js → dropdown.element-CXpMwJsU.js} +53 -37
- package/{errors-QjKhr6mA.js → errors-Byb2dIhK.js} +3 -2
- package/focus-leave.controller-2gV0pQd5.js +73 -0
- package/index.js +1635 -948
- package/index.umd.cjs +2046 -601
- 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-D730tmGN.js +297 -0
- package/{list.element-Co3V3Cn5.js → list.element-eo3DIOrp.js} +23 -23
- package/{markdown.element-p-kC47D7.js → markdown.element-FbtwdnAv.js} +310 -218
- package/{number.element-CBr47IiY.js → number.element-BEpOCzXy.js} +76 -61
- package/package.json +6 -6
- package/part-templates-VORbpgs2.js +691 -0
- package/{password.element-n-R9RbkB.js → password.element-CBaB8h5b.js} +19 -17
- package/pill-ranges-DpvWwP-3.js +48 -0
- package/{pills-B66qz_KX.js → pills-BDMO2NiR.js} +84 -59
- package/popup.controller-B33OvX_y.js +86 -0
- package/{radiogroup.element-CeQn623u.js → radiogroup.element-KWzBx8mx.js} +55 -51
- package/range-calendar-DO_woqcF.js +466 -0
- package/{calendar.element-DcnTyvfg.js → range-calendar.element-DHLZhpnj.js} +37 -29
- package/range-commit-8-MmYUyo.js +14 -0
- package/range-date-input-Br7XqQPK.js +311 -0
- package/{range-date-input.element-BqzAF0O3.js → range-date-input.element-BdD4SlB4.js} +12 -8
- package/range-date-picker.element-DWRHiAoC.js +434 -0
- package/range-date-time-calendar-B3EMgN1E.js +734 -0
- package/range-date-time-calendar.element-Coea6RF4.js +97 -0
- package/range-date-time-input-Cu-T_nuC.js +353 -0
- package/range-date-time-input.element-Cti44iuW.js +87 -0
- package/range-date-time-picker.element-CDN2RL1y.js +472 -0
- package/range-selection-CU3hxLJE.js +25 -0
- package/range-time-input-BP9ZL9O8.js +348 -0
- package/range-time-input.element-B7wtHJoQ.js +84 -0
- package/range-time-picker.element-CPIAiQPC.js +470 -0
- package/{repeater.element-CtNgB4F5.js → repeater.element-BM1Keckd.js} +1 -1
- package/{select.element-jcDF1h-g.js → select.element-eepcXTpL.js} +117 -107
- package/{tabs.element-BvAyI71N.js → tabs.element-CvcIA8P3.js} +1 -0
- package/{tags.element-CX3vQL8L.js → tags.element-CPHgotb0.js} +21 -14
- package/templates-Dmr34nwp.js +88 -0
- package/{textarea.element-HThYqdR_.js → textarea.element-CiNEy9uq.js} +8 -7
- package/{textinput.element-CkXNzMUg.js → textinput.element-AL2Nr768.js} +10 -9
- package/time-input-5dkSm8UW.js +201 -0
- package/time-list-DLcq8BAp.js +217 -0
- package/time-picker-g337F8d0.js +299 -0
- package/time-picker.element-DLihegjg.js +89 -0
- package/time.element-BneqgMlQ.js +85 -0
- package/{toggle.element-C1kCw5H8.js → toggle.element-Cz91CRdp.js} +44 -43
- package/abstract-calendar-D0-077XJ.js +0 -545
- package/calendar-BclCC9VJ.js +0 -96
- package/date-input-DCdGWRio.js +0 -268
- package/date-picker.element-k7AJFQ5W.js +0 -168
- package/list-D1oKnH89.js +0 -283
- package/range-calendar-CBINu84w.js +0 -255
- package/range-date-input-BYXzqnr1.js +0 -395
- package/range-date-picker.element-BCBefgvY.js +0 -182
- package/templates-Dk1jxLwS.js +0 -75
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import { InputWidgetAdapter as $, formContext as y, inputContext as v } from "@golemui/lit";
|
|
2
|
+
import { LitElement as g, html as m, nothing as T } from "lit";
|
|
3
|
+
import { property as a, query as _, state as c, customElement as b } from "lit/decorators.js";
|
|
4
|
+
import { classMap as f } from "lit/directives/class-map.js";
|
|
5
|
+
import "./range-time-input-BP9ZL9O8.js";
|
|
6
|
+
import "./time-list-DLcq8BAp.js";
|
|
7
|
+
import { G as L } from "./popup.controller-B33OvX_y.js";
|
|
8
|
+
import { k as w, s as u, t as A } from "./part-templates-VORbpgs2.js";
|
|
9
|
+
import { a as S, b as k, c as I } from "./templates-Dmr34nwp.js";
|
|
10
|
+
import { I as C, b as M, e as x } from "./date-DBuYpvcO.js";
|
|
11
|
+
import { consume as E, provide as P } from "@lit/context";
|
|
12
|
+
import "rxjs";
|
|
13
|
+
var O = Object.defineProperty, R = Object.getOwnPropertyDescriptor, i = (e, s, o, n) => {
|
|
14
|
+
for (var r = n > 1 ? void 0 : n ? R(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.toggleAriaLabel = void 0, this.hourAriaLabel = void 0, this.minuteAriaLabel = void 0, this.dayPeriodAriaLabel = void 0, 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 L(this, {
|
|
21
|
+
focusRestoreSelector: "gui-range-time input, gui-range-time button",
|
|
22
|
+
focusPopupSelector: '.gui-time-list__option[tabindex="0"]',
|
|
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
|
+
}, this.onToggleClick = (e) => {
|
|
35
|
+
e.stopPropagation(), this._popup.open ? this._popup.close() : this._popup.openAndFocus();
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
createRenderRoot() {
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
connectedCallback() {
|
|
42
|
+
super.connectedCallback(), this.addEventListener("dropdowntoggle", this.onDropdownToggle);
|
|
43
|
+
}
|
|
44
|
+
disconnectedCallback() {
|
|
45
|
+
super.disconnectedCallback(), this.removeEventListener("dropdowntoggle", this.onDropdownToggle);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Bounds for the "time out" list: undefined until an "in" is chosen. Once
|
|
49
|
+
* chosen, the floor is one slot after "in" so `out > in` strictly; when that
|
|
50
|
+
* spills past the end of the day, an empty (min > max) window yields the
|
|
51
|
+
* "no available times" message.
|
|
52
|
+
*/
|
|
53
|
+
get outListBounds() {
|
|
54
|
+
if (!this._workingIn) return { minTime: this.minTime, maxTime: this.maxTime };
|
|
55
|
+
const e = w(this._workingIn, this.minuteStep);
|
|
56
|
+
return e ? { minTime: e, maxTime: this.maxTime } : { minTime: "23:59:59", maxTime: "00:00:00" };
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
const e = S("rangeTimePicker", { icon: this.icon }), s = this.outListBounds, o = this.startTimeLabel ?? "Start time", n = this.endTimeLabel ?? "End time", r = this._popup.open ? m`<div
|
|
60
|
+
class="gui-range-time-picker__panel"
|
|
61
|
+
id=${`${this.uid}_popup`}
|
|
62
|
+
role="dialog"
|
|
63
|
+
aria-label=${this.label ?? "Time list"}
|
|
64
|
+
>
|
|
65
|
+
<div class="gui-range-time-picker__column">
|
|
66
|
+
<span class="gui-range-time-picker__column-label">${o}</span>
|
|
67
|
+
<gui-time-list
|
|
68
|
+
class="gui-range-time-picker__list"
|
|
69
|
+
.uid=${this.uid}
|
|
70
|
+
.label=${o}
|
|
71
|
+
.value=${this._workingIn}
|
|
72
|
+
.localeId=${this.localeId}
|
|
73
|
+
.hourFormat=${this.hourFormat}
|
|
74
|
+
.minuteStep=${this.minuteStep}
|
|
75
|
+
.minTime=${this.minTime}
|
|
76
|
+
.maxTime=${this.maxTime}
|
|
77
|
+
.disabledRanges=${this.disabledRanges}
|
|
78
|
+
.height=${this.height}
|
|
79
|
+
.itemHeight=${this.itemHeight}
|
|
80
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
81
|
+
?readonly=${this.readOnly}
|
|
82
|
+
@change=${this.onInListChange}
|
|
83
|
+
></gui-time-list>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div class="gui-range-time-picker__column">
|
|
87
|
+
<span class="gui-range-time-picker__column-label">${n}</span>
|
|
88
|
+
<gui-time-list
|
|
89
|
+
class="gui-range-time-picker__list"
|
|
90
|
+
.uid=${this.uid}
|
|
91
|
+
.label=${n}
|
|
92
|
+
.value=${this._workingOut}
|
|
93
|
+
.localeId=${this.localeId}
|
|
94
|
+
.hourFormat=${this.hourFormat}
|
|
95
|
+
.minuteStep=${this.minuteStep}
|
|
96
|
+
.minTime=${s.minTime}
|
|
97
|
+
.maxTime=${s.maxTime}
|
|
98
|
+
.disabledRanges=${this.disabledRanges}
|
|
99
|
+
.height=${this.height}
|
|
100
|
+
.itemHeight=${this.itemHeight}
|
|
101
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
102
|
+
?disabled=${!this._workingIn}
|
|
103
|
+
?readonly=${this.readOnly}
|
|
104
|
+
@change=${this.onOutListChange}
|
|
105
|
+
></gui-time-list>
|
|
106
|
+
</div>
|
|
107
|
+
</div>` : T;
|
|
108
|
+
return m`
|
|
109
|
+
${k(
|
|
110
|
+
this.uid ?? "",
|
|
111
|
+
{
|
|
112
|
+
label: this.label,
|
|
113
|
+
hint: this.hint,
|
|
114
|
+
required: this.required
|
|
115
|
+
},
|
|
116
|
+
!1,
|
|
117
|
+
void 0,
|
|
118
|
+
!1
|
|
119
|
+
)}
|
|
120
|
+
|
|
121
|
+
<div
|
|
122
|
+
class="gui-widget"
|
|
123
|
+
@keydown=${this._popup.onAnchorKeyDown}
|
|
124
|
+
@click=${this._popup.onAnchorClick}
|
|
125
|
+
>
|
|
126
|
+
<gui-range-time
|
|
127
|
+
id="time-input"
|
|
128
|
+
class=${f(e.widgetClasses)}
|
|
129
|
+
.uid=${this.uid}
|
|
130
|
+
.hint=${this.hint}
|
|
131
|
+
.showErrors=${!1}
|
|
132
|
+
.errors=${this.errors}
|
|
133
|
+
?touched=${this.touched}
|
|
134
|
+
?required=${this.required}
|
|
135
|
+
?disabled=${this.disabled}
|
|
136
|
+
?readonly=${this.readOnly}
|
|
137
|
+
.allowCustomTime=${this.allowCustomTime ?? !1}
|
|
138
|
+
.value=${this.value}
|
|
139
|
+
.icon=${this.icon}
|
|
140
|
+
.localeId=${this.localeId}
|
|
141
|
+
.separator=${this.separator}
|
|
142
|
+
.hourFormat=${this.hourFormat}
|
|
143
|
+
.minuteStep=${this.minuteStep}
|
|
144
|
+
.minTime=${this.minTime}
|
|
145
|
+
.maxTime=${this.maxTime}
|
|
146
|
+
.disabledRanges=${this.disabledRanges}
|
|
147
|
+
.minTimeMessage=${this.minTimeMessage}
|
|
148
|
+
.maxTimeMessage=${this.maxTimeMessage}
|
|
149
|
+
.rangeOrderMessage=${this.rangeOrderMessage}
|
|
150
|
+
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
151
|
+
.removePillAriaLabel=${this.removePillAriaLabel}
|
|
152
|
+
.startTimeAriaLabel=${this.startTimeAriaLabel}
|
|
153
|
+
.endTimeAriaLabel=${this.endTimeAriaLabel}
|
|
154
|
+
.hourAriaLabel=${this.hourAriaLabel}
|
|
155
|
+
.minuteAriaLabel=${this.minuteAriaLabel}
|
|
156
|
+
.dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
|
|
157
|
+
@blur=${this.onInputBlur}
|
|
158
|
+
@focus=${this._popup.show}
|
|
159
|
+
@change=${this.onInputChange}
|
|
160
|
+
@partsChange=${this.onPartsChange}
|
|
161
|
+
@pillClick=${this.onPillClick}
|
|
162
|
+
></gui-range-time>
|
|
163
|
+
<button
|
|
164
|
+
type="button"
|
|
165
|
+
class="gui-range-time-picker__arrow"
|
|
166
|
+
aria-label=${this.toggleAriaLabel ?? "Show time list"}
|
|
167
|
+
aria-haspopup="dialog"
|
|
168
|
+
aria-expanded=${this._popup.open ? "true" : "false"}
|
|
169
|
+
aria-controls=${`${this.uid}_popup`}
|
|
170
|
+
?disabled=${this.disabled}
|
|
171
|
+
@click=${this.onToggleClick}
|
|
172
|
+
>
|
|
173
|
+
<svg
|
|
174
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
175
|
+
width="16"
|
|
176
|
+
height="16"
|
|
177
|
+
viewBox="0 0 256 256"
|
|
178
|
+
aria-hidden="true"
|
|
179
|
+
>
|
|
180
|
+
<path
|
|
181
|
+
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"
|
|
182
|
+
></path>
|
|
183
|
+
</svg>
|
|
184
|
+
</button>
|
|
185
|
+
|
|
186
|
+
${r}
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
${this.showErrors ? I(this.uid ?? "", { errors: this.errors, touched: this.touched }) : ""}
|
|
190
|
+
`;
|
|
191
|
+
}
|
|
192
|
+
onInputChange(e) {
|
|
193
|
+
e.stopPropagation(), this._workingIn = void 0, this._workingOut = void 0, this.commitValue(e.detail.value);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Mirrors the input's live, in-bounds start/end into the two lists, so typing
|
|
197
|
+
* a value that exists as a slot highlights it (and a typed start enables and
|
|
198
|
+
* floors the end list) — the reverse of a list pick filling the fields.
|
|
199
|
+
*/
|
|
200
|
+
onPartsChange(e) {
|
|
201
|
+
e.stopPropagation(), this._workingIn = e.detail.start ?? void 0, this._workingOut = e.detail.end ?? void 0;
|
|
202
|
+
}
|
|
203
|
+
onInputBlur() {
|
|
204
|
+
this.dispatchEvent(new CustomEvent("blur"));
|
|
205
|
+
}
|
|
206
|
+
onInListChange(e) {
|
|
207
|
+
e.stopPropagation();
|
|
208
|
+
const s = e.detail.value;
|
|
209
|
+
this._workingIn = s ?? void 0, this._workingOut = void 0, s && this._inputRef?.fillGroup("start", s);
|
|
210
|
+
}
|
|
211
|
+
onOutListChange(e) {
|
|
212
|
+
e.stopPropagation();
|
|
213
|
+
const s = e.detail.value;
|
|
214
|
+
if (!this._workingIn || !s || !this._inputRef) return;
|
|
215
|
+
this._inputRef.fillGroup("end", s), this._inputRef.commitFromParts() ? (this._workingIn = void 0, this._workingOut = void 0, this.updateComplete.then(() => {
|
|
216
|
+
this._inListRef()?.scrollToSelectedValue?.();
|
|
217
|
+
})) : (this._popup.close(), this.dispatchEvent(new CustomEvent("blur")));
|
|
218
|
+
}
|
|
219
|
+
_inListRef() {
|
|
220
|
+
return this.querySelector(
|
|
221
|
+
".gui-range-time-picker__column:first-child gui-time-list"
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
commitValue(e) {
|
|
225
|
+
this.value = e ?? void 0;
|
|
226
|
+
const s = this.validateBounds(this.value);
|
|
227
|
+
this.dispatchEvent(
|
|
228
|
+
new CustomEvent("change", {
|
|
229
|
+
detail: { value: e ?? null },
|
|
230
|
+
bubbles: !0,
|
|
231
|
+
composed: !0
|
|
232
|
+
})
|
|
233
|
+
), s && this.dispatchEvent(
|
|
234
|
+
new CustomEvent("inputError", {
|
|
235
|
+
detail: { message: s },
|
|
236
|
+
bubbles: !0,
|
|
237
|
+
composed: !0
|
|
238
|
+
})
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
validateBounds(e) {
|
|
242
|
+
if (!e || e.length === 0) return null;
|
|
243
|
+
for (const s of e) {
|
|
244
|
+
for (const o of [s.start, s.end])
|
|
245
|
+
if (o) {
|
|
246
|
+
if (this.minTime && u(o, this.minTime) < 0)
|
|
247
|
+
return this.minTimeMessage ?? C;
|
|
248
|
+
if (this.maxTime && u(o, this.maxTime) > 0)
|
|
249
|
+
return this.maxTimeMessage ?? M;
|
|
250
|
+
}
|
|
251
|
+
if (A(s.start, s.end, this.disabledRanges))
|
|
252
|
+
return this.disabledRangeMessage ?? x;
|
|
253
|
+
}
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
onPillClick() {
|
|
257
|
+
this._popup.show();
|
|
258
|
+
}
|
|
259
|
+
closePillsDropdown() {
|
|
260
|
+
this.querySelector("gui-pills")?.closeDropdown?.();
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
i([
|
|
264
|
+
a({ type: String })
|
|
265
|
+
], t.prototype, "uid", 2);
|
|
266
|
+
i([
|
|
267
|
+
a({ type: String })
|
|
268
|
+
], t.prototype, "label", 2);
|
|
269
|
+
i([
|
|
270
|
+
a({ type: String })
|
|
271
|
+
], t.prototype, "hint", 2);
|
|
272
|
+
i([
|
|
273
|
+
a({ type: String })
|
|
274
|
+
], t.prototype, "icon", 2);
|
|
275
|
+
i([
|
|
276
|
+
a({ type: String, attribute: "toggle-aria-label" })
|
|
277
|
+
], t.prototype, "toggleAriaLabel", 2);
|
|
278
|
+
i([
|
|
279
|
+
a({ type: String })
|
|
280
|
+
], t.prototype, "hourAriaLabel", 2);
|
|
281
|
+
i([
|
|
282
|
+
a({ type: String })
|
|
283
|
+
], t.prototype, "minuteAriaLabel", 2);
|
|
284
|
+
i([
|
|
285
|
+
a({ type: String })
|
|
286
|
+
], t.prototype, "dayPeriodAriaLabel", 2);
|
|
287
|
+
i([
|
|
288
|
+
a({ type: Array })
|
|
289
|
+
], t.prototype, "errors", 2);
|
|
290
|
+
i([
|
|
291
|
+
a({ type: Boolean })
|
|
292
|
+
], t.prototype, "showErrors", 2);
|
|
293
|
+
i([
|
|
294
|
+
a({ type: Boolean })
|
|
295
|
+
], t.prototype, "touched", 2);
|
|
296
|
+
i([
|
|
297
|
+
a({ type: Boolean })
|
|
298
|
+
], t.prototype, "required", 2);
|
|
299
|
+
i([
|
|
300
|
+
a({ type: Boolean })
|
|
301
|
+
], t.prototype, "disabled", 2);
|
|
302
|
+
i([
|
|
303
|
+
a({ type: Boolean, attribute: "readonly" })
|
|
304
|
+
], t.prototype, "readOnly", 2);
|
|
305
|
+
i([
|
|
306
|
+
a({ type: String, attribute: "locale-id" })
|
|
307
|
+
], t.prototype, "localeId", 2);
|
|
308
|
+
i([
|
|
309
|
+
a({ type: Array })
|
|
310
|
+
], t.prototype, "value", 2);
|
|
311
|
+
i([
|
|
312
|
+
a({ type: String })
|
|
313
|
+
], t.prototype, "separator", 2);
|
|
314
|
+
i([
|
|
315
|
+
a({ type: String, attribute: "remove-pill-aria-label" })
|
|
316
|
+
], t.prototype, "removePillAriaLabel", 2);
|
|
317
|
+
i([
|
|
318
|
+
a({ type: String, attribute: "start-time-aria-label" })
|
|
319
|
+
], t.prototype, "startTimeAriaLabel", 2);
|
|
320
|
+
i([
|
|
321
|
+
a({ type: String, attribute: "end-time-aria-label" })
|
|
322
|
+
], t.prototype, "endTimeAriaLabel", 2);
|
|
323
|
+
i([
|
|
324
|
+
a({ type: String, attribute: "start-time-label" })
|
|
325
|
+
], t.prototype, "startTimeLabel", 2);
|
|
326
|
+
i([
|
|
327
|
+
a({ type: String, attribute: "end-time-label" })
|
|
328
|
+
], t.prototype, "endTimeLabel", 2);
|
|
329
|
+
i([
|
|
330
|
+
a({ type: String, attribute: "hour-format" })
|
|
331
|
+
], t.prototype, "hourFormat", 2);
|
|
332
|
+
i([
|
|
333
|
+
a({ type: Number, attribute: "minute-step" })
|
|
334
|
+
], t.prototype, "minuteStep", 2);
|
|
335
|
+
i([
|
|
336
|
+
a({ type: String, attribute: "min-time" })
|
|
337
|
+
], t.prototype, "minTime", 2);
|
|
338
|
+
i([
|
|
339
|
+
a({ type: String, attribute: "max-time" })
|
|
340
|
+
], t.prototype, "maxTime", 2);
|
|
341
|
+
i([
|
|
342
|
+
a({ type: Array, attribute: "disabled-ranges" })
|
|
343
|
+
], t.prototype, "disabledRanges", 2);
|
|
344
|
+
i([
|
|
345
|
+
a({ type: Boolean, attribute: "allow-custom-time" })
|
|
346
|
+
], t.prototype, "allowCustomTime", 2);
|
|
347
|
+
i([
|
|
348
|
+
a({ type: Number })
|
|
349
|
+
], t.prototype, "height", 2);
|
|
350
|
+
i([
|
|
351
|
+
a({ type: Number, attribute: "item-height" })
|
|
352
|
+
], t.prototype, "itemHeight", 2);
|
|
353
|
+
i([
|
|
354
|
+
a({ type: String, attribute: "min-time-message" })
|
|
355
|
+
], t.prototype, "minTimeMessage", 2);
|
|
356
|
+
i([
|
|
357
|
+
a({ type: String, attribute: "max-time-message" })
|
|
358
|
+
], t.prototype, "maxTimeMessage", 2);
|
|
359
|
+
i([
|
|
360
|
+
a({ type: String, attribute: "range-order-message" })
|
|
361
|
+
], t.prototype, "rangeOrderMessage", 2);
|
|
362
|
+
i([
|
|
363
|
+
a({ type: String, attribute: "disabled-range-message" })
|
|
364
|
+
], t.prototype, "disabledRangeMessage", 2);
|
|
365
|
+
i([
|
|
366
|
+
a({ type: String, attribute: "no-available-times-message" })
|
|
367
|
+
], t.prototype, "noAvailableTimesMessage", 2);
|
|
368
|
+
i([
|
|
369
|
+
_("#time-input")
|
|
370
|
+
], t.prototype, "_inputRef", 2);
|
|
371
|
+
i([
|
|
372
|
+
c()
|
|
373
|
+
], t.prototype, "_workingIn", 2);
|
|
374
|
+
i([
|
|
375
|
+
c()
|
|
376
|
+
], t.prototype, "_workingOut", 2);
|
|
377
|
+
t = i([
|
|
378
|
+
b("gui-range-time-picker")
|
|
379
|
+
], t);
|
|
380
|
+
typeof customElements < "u" && !customElements.get("gui-range-time-picker") && customElements.define("gui-range-time-picker", t);
|
|
381
|
+
var D = Object.defineProperty, B = Object.getOwnPropertyDescriptor, h = (e, s, o, n) => {
|
|
382
|
+
for (var r = n > 1 ? void 0 : n ? B(s, o) : s, l = e.length - 1, p; l >= 0; l--)
|
|
383
|
+
(p = e[l]) && (r = (n ? p(s, o, r) : p(r)) || r);
|
|
384
|
+
return n && r && D(s, o, r), r;
|
|
385
|
+
};
|
|
386
|
+
let d = class extends g {
|
|
387
|
+
constructor() {
|
|
388
|
+
super(...arguments), this.adapter = new $(), this.subscriptions = [];
|
|
389
|
+
}
|
|
390
|
+
createRenderRoot() {
|
|
391
|
+
return this;
|
|
392
|
+
}
|
|
393
|
+
updated(e) {
|
|
394
|
+
super.updated(e);
|
|
395
|
+
const s = this.adapter.templateData.size;
|
|
396
|
+
s ? this.style.flex = String(s) : this.style.removeProperty("flex");
|
|
397
|
+
}
|
|
398
|
+
connectedCallback() {
|
|
399
|
+
super.connectedCallback(), this.classList.add("gui-range-time-picker", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
400
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
render() {
|
|
404
|
+
super.render();
|
|
405
|
+
const e = this.adapter.templateData;
|
|
406
|
+
return m`
|
|
407
|
+
<gui-range-time-picker
|
|
408
|
+
.uid=${this.widget.uid}
|
|
409
|
+
.label=${e.label}
|
|
410
|
+
.hint=${e.hint}
|
|
411
|
+
.errors=${e.errors}
|
|
412
|
+
?touched=${e.touched}
|
|
413
|
+
?required=${e.validator?.required}
|
|
414
|
+
?disabled=${e.disabled}
|
|
415
|
+
?readonly=${e.readonly}
|
|
416
|
+
.value=${e.value}
|
|
417
|
+
.icon=${e.icon}
|
|
418
|
+
.localeId=${e.lang}
|
|
419
|
+
.toggleAriaLabel=${e.toggleAriaLabel}
|
|
420
|
+
.hourAriaLabel=${e.hourAriaLabel}
|
|
421
|
+
.minuteAriaLabel=${e.minuteAriaLabel}
|
|
422
|
+
.dayPeriodAriaLabel=${e.dayPeriodAriaLabel}
|
|
423
|
+
.separator=${e.separator}
|
|
424
|
+
.removePillAriaLabel=${e.removePillAriaLabel}
|
|
425
|
+
.startTimeAriaLabel=${e.startTimeAriaLabel}
|
|
426
|
+
.endTimeAriaLabel=${e.endTimeAriaLabel}
|
|
427
|
+
.startTimeLabel=${e.startTimeLabel}
|
|
428
|
+
.endTimeLabel=${e.endTimeLabel}
|
|
429
|
+
.hourFormat=${e.hourFormat}
|
|
430
|
+
.minuteStep=${e.minuteStep}
|
|
431
|
+
.minTime=${e.minTime}
|
|
432
|
+
.maxTime=${e.maxTime}
|
|
433
|
+
.disabledRanges=${e.disabledRanges}
|
|
434
|
+
?allow-custom-time=${e.allowCustomTime}
|
|
435
|
+
.height=${e.height}
|
|
436
|
+
.itemHeight=${e.itemHeight}
|
|
437
|
+
.minTimeMessage=${e.minTimeMessage}
|
|
438
|
+
.maxTimeMessage=${e.maxTimeMessage}
|
|
439
|
+
.rangeOrderMessage=${e.rangeOrderMessage}
|
|
440
|
+
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
441
|
+
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
442
|
+
@inputError=${this.onInputError}
|
|
443
|
+
@blur=${() => this.adapter.onBlur()}
|
|
444
|
+
@change=${this.valueChanged}
|
|
445
|
+
></gui-range-time-picker>
|
|
446
|
+
`;
|
|
447
|
+
}
|
|
448
|
+
valueChanged(e) {
|
|
449
|
+
this.adapter.injectValidationIssues(null), this.adapter.valueChanged(e.detail.value);
|
|
450
|
+
}
|
|
451
|
+
onInputError(e) {
|
|
452
|
+
this.adapter.injectValidationIssues([e.detail.message]);
|
|
453
|
+
}
|
|
454
|
+
disconnectedCallback() {
|
|
455
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
h([
|
|
459
|
+
E({ context: y }),
|
|
460
|
+
a({ attribute: !1 })
|
|
461
|
+
], d.prototype, "formContext", 2);
|
|
462
|
+
h([
|
|
463
|
+
P({ context: v })
|
|
464
|
+
], d.prototype, "adapter", 2);
|
|
465
|
+
d = h([
|
|
466
|
+
b("gui-range-time-picker-input")
|
|
467
|
+
], d);
|
|
468
|
+
export {
|
|
469
|
+
d as RangeTimePickerElement
|
|
470
|
+
};
|
|
@@ -6,7 +6,7 @@ import { LitElement as b, nothing as n, html as s } from "lit";
|
|
|
6
6
|
import { repeat as f } from "lit-html/directives/repeat.js";
|
|
7
7
|
import { property as _, state as $, query as v, customElement as I } from "lit/decorators.js";
|
|
8
8
|
import "rxjs";
|
|
9
|
-
import "./errors-
|
|
9
|
+
import "./errors-Byb2dIhK.js";
|
|
10
10
|
function w(e, t) {
|
|
11
11
|
if (e != null && typeof e == "object" && "__rid" in e)
|
|
12
12
|
return e.__rid;
|