@golemui/gui-lit 1.1.0 → 1.1.1-rc.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.
- package/CHANGELOG.md +34 -0
- package/{button.element-3a7rRHbA.js → button.element-CJay43iR.js} +16 -13
- package/{calendar-BuJgwvZx.js → calendar-D31xNsxx.js} +72 -59
- package/{calendar.element-M5MPJmap.js → calendar.element-BhFrCsns.js} +22 -20
- package/{checkbox.element-CVskoXEc.js → checkbox.element-DAAVB651.js} +49 -49
- package/{currency.element-CfFrAtrr.js → currency.element-D8A2ObpM.js} +11 -10
- package/{date-Bj9mI3GU.js → date-DBuYpvcO.js} +35 -27
- package/{date-input-cJDkNnVw.js → date-input-DLiMreSS.js} +64 -44
- package/date-picker.element-DeUQtbLg.js +357 -0
- package/{date-time-calendar-BzRfkLKU.js → date-time-calendar-DzU-FtVl.js} +89 -76
- package/{date-time-calendar.element-DC4NK0y1.js → date-time-calendar.element-BLBcVsFu.js} +13 -11
- package/{date-time-input-BXxsfuyZ.js → date-time-input-DZaz2heD.js} +75 -43
- package/{date-time-picker.element-Dy-8cb-_.js → date-time-picker.element-BUbLdV6i.js} +125 -65
- package/{date-time.element-Bv4XdzMi.js → date-time.element-B5onfSBG.js} +31 -25
- package/{date.element-Consgsbb.js → date.element-BsKhLrEc.js} +22 -19
- package/{day-status-0-hJHrI7.js → day-status-CsWStVQV.js} +153 -129
- package/{dropdown.element-WsD61Qel.js → dropdown.element-CXpMwJsU.js} +19 -13
- package/{errors-QjKhr6mA.js → errors-Byb2dIhK.js} +3 -2
- package/index.js +2933 -2336
- package/index.umd.cjs +798 -405
- package/{list-CrLIL4by.js → list-D730tmGN.js} +115 -116
- package/{list.element-DV82YxnJ.js → list.element-eo3DIOrp.js} +2 -2
- 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 +9 -6
- package/{part-templates-Db871PS3.js → part-templates-VORbpgs2.js} +132 -118
- package/{password.element-n-R9RbkB.js → password.element-CBaB8h5b.js} +19 -17
- package/{pill-ranges-DCqDmpkk.js → pill-ranges-DpvWwP-3.js} +12 -12
- package/{pills-Be1UrLgq.js → pills-BDMO2NiR.js} +80 -58
- package/popup.controller-B33OvX_y.js +86 -0
- package/{radiogroup.element-CeQn623u.js → radiogroup.element-KWzBx8mx.js} +55 -51
- package/{range-calendar-CKPYeSGt.js → range-calendar-DO_woqcF.js} +101 -87
- package/{range-calendar.element-D6KYq18B.js → range-calendar.element-DHLZhpnj.js} +15 -13
- package/{range-date-input-D--AqBMv.js → range-date-input-Br7XqQPK.js} +90 -71
- package/{range-date-input.element-D4nIXJbw.js → range-date-input.element-BdD4SlB4.js} +15 -12
- package/{range-date-picker.element-dhxPAAE6.js → range-date-picker.element-DWRHiAoC.js} +97 -49
- package/{range-date-time-calendar-yksWrR7b.js → range-date-time-calendar-B3EMgN1E.js} +150 -136
- package/{range-date-time-calendar.element-C00aDefZ.js → range-date-time-calendar.element-Coea6RF4.js} +9 -7
- package/{range-date-time-input-B37TUoM3.js → range-date-time-input-Cu-T_nuC.js} +125 -94
- package/{range-date-time-input.element-DUnbv4ed.js → range-date-time-input.element-Cti44iuW.js} +31 -25
- package/{range-date-time-picker.element-Cbps6s_G.js → range-date-time-picker.element-CDN2RL1y.js} +107 -47
- package/{range-time-input-3lhqR1Ku.js → range-time-input-BP9ZL9O8.js} +85 -66
- package/{range-time-input.element-dU2iBdmJ.js → range-time-input.element-B7wtHJoQ.js} +14 -11
- package/{range-time-picker.element-v6nQsIPw.js → range-time-picker.element-CPIAiQPC.js} +92 -51
- package/{repeater.element-CtNgB4F5.js → repeater.element-BM1Keckd.js} +1 -1
- package/{select.element-C0V-Bv3L.js → select.element-eepcXTpL.js} +84 -78
- package/{tabs.element-BvAyI71N.js → tabs.element-CvcIA8P3.js} +1 -0
- package/{tags.element-DvwEpxpK.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-BOhlBGJZ.js → time-input-5dkSm8UW.js} +67 -47
- package/{time-list-Czo48bZm.js → time-list-DLcq8BAp.js} +1 -1
- package/{time-picker-bFJ63ky8.js → time-picker-g337F8d0.js} +89 -51
- package/{time-picker.element-CYZVXgRS.js → time-picker.element-DLihegjg.js} +23 -19
- package/{time.element-fK3oLi49.js → time.element-BneqgMlQ.js} +22 -19
- package/{toggle.element-C1kCw5H8.js → toggle.element-Cz91CRdp.js} +44 -43
- package/date-picker.element-va_-LGZD.js +0 -312
- package/popup.controller-eUDxE6jD.js +0 -71
- package/templates-Dk1jxLwS.js +0 -75
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { LitElement as g, nothing as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as g, nothing as l, html as m } from "lit";
|
|
2
|
+
import { property as r, state as c, customElement as y } from "lit/decorators.js";
|
|
3
3
|
import { classMap as b } from "lit/directives/class-map.js";
|
|
4
|
-
import "./time-picker-
|
|
5
|
-
import { G as v } from "./templates-
|
|
6
|
-
import { G as
|
|
7
|
-
import { G as
|
|
8
|
-
import { p,
|
|
9
|
-
import { y as w, p as
|
|
10
|
-
var
|
|
11
|
-
for (var n = o > 1 ? void 0 : o ? k(t,
|
|
12
|
-
(
|
|
13
|
-
return o && n &&
|
|
4
|
+
import "./time-picker-g337F8d0.js";
|
|
5
|
+
import { G as v } from "./templates-Dmr34nwp.js";
|
|
6
|
+
import { G as D, a as _, r as M, b as T, c as S, d as f, e as C } from "./day-status-CsWStVQV.js";
|
|
7
|
+
import { G as I } from "./focus-leave.controller-2gV0pQd5.js";
|
|
8
|
+
import { p, h as O, j as x, t as u, k as $, g as L } from "./date-DBuYpvcO.js";
|
|
9
|
+
import { y as w, p as A, z as G } from "./part-templates-VORbpgs2.js";
|
|
10
|
+
var P = Object.defineProperty, k = Object.getOwnPropertyDescriptor, a = (e, t, s, o) => {
|
|
11
|
+
for (var n = o > 1 ? void 0 : o ? k(t, s) : t, h = e.length - 1, d; h >= 0; h--)
|
|
12
|
+
(d = e[h]) && (n = (o ? d(t, s, n) : d(n)) || n);
|
|
13
|
+
return o && n && P(t, s, n), n;
|
|
14
14
|
};
|
|
15
15
|
let i = class extends g {
|
|
16
16
|
constructor() {
|
|
17
|
-
super(...arguments), this.uid = void 0, this.label = void 0, this.hint = void 0, this.localeId = void 0, this.errors = [], this.touched = void 0, this.required = !1, this.disabled = !1, this.readOnly = !1, this.prevMonthIcon = "", this.nextMonthIcon = "", this.prevMonthAriaLabel = "", this.nextMonthAriaLabel = "", this.dayFormat = "numeric", this.weekdayFormat = "narrow", this.monthFormat = "long", this.minDate = void 0, this.maxDate = void 0, this.disabledRanges = void 0, this.numberOfMonths = 1, this.value = void 0, this.hourFormat = void 0, this.minuteStep = void 0, this.minTime = void 0, this.maxTime = void 0, this.disabledTimeRanges = void 0, this.minTimeMessage = void 0, this.maxTimeMessage = void 0, this.disabledTimeRangeMessage = void 0, this.noAvailableTimesMessage = void 0, this.allowCustomTime = !1, this._selectedDate = void 0, this._selectedTime = void 0, this._timeGridOpen = !1, this._internalValueChange = !1, this._nav = new
|
|
17
|
+
super(...arguments), this.uid = void 0, this.label = void 0, this.hint = void 0, this.localeId = void 0, this.errors = [], this.touched = void 0, this.required = !1, this.disabled = !1, this.readOnly = !1, this.prevMonthIcon = "", this.nextMonthIcon = "", this.prevMonthAriaLabel = "", this.nextMonthAriaLabel = "", this.selectYearAriaLabel = void 0, this.yearGridAriaLabel = void 0, this.dayFormat = "numeric", this.weekdayFormat = "narrow", this.monthFormat = "long", this.minDate = void 0, this.maxDate = void 0, this.disabledRanges = void 0, this.numberOfMonths = 1, this.value = void 0, this.hourFormat = void 0, this.minuteStep = void 0, this.minTime = void 0, this.maxTime = void 0, this.disabledTimeRanges = void 0, this.minTimeMessage = void 0, this.maxTimeMessage = void 0, this.disabledTimeRangeMessage = void 0, this.noAvailableTimesMessage = void 0, this.allowCustomTime = !1, this._selectedDate = void 0, this._selectedTime = void 0, this._timeGridOpen = !1, this._internalValueChange = !1, this._nav = new D(this, {
|
|
18
18
|
getMinDate: () => this.minDate,
|
|
19
19
|
getMaxDate: () => this.maxDate,
|
|
20
20
|
getNumberOfMonths: () => this.numberOfMonths,
|
|
@@ -29,32 +29,31 @@ let i = class extends g {
|
|
|
29
29
|
errors: this.errors,
|
|
30
30
|
readonly: this.readOnly,
|
|
31
31
|
disabled: this.disabled,
|
|
32
|
-
touched: this.touched
|
|
32
|
+
touched: this.touched,
|
|
33
|
+
required: this.required
|
|
33
34
|
}
|
|
34
35
|
})
|
|
35
|
-
}), this._keyboard = new
|
|
36
|
+
}), this._keyboard = new _(this, {
|
|
36
37
|
canGoPrev: () => this._nav.canGoPrev(),
|
|
37
38
|
canGoNext: () => this._nav.canGoNext(),
|
|
38
39
|
goPrev: () => this._nav.prevMonth(),
|
|
39
40
|
goNext: () => this._nav.nextMonth(),
|
|
40
|
-
// Enter/Space can only fire on a focused (hence enabled, in-month) day
|
|
41
|
-
// button; the `disabled`/`readOnly` host guards stay inside `selectDate`.
|
|
42
41
|
onActivateDay: (e) => {
|
|
43
42
|
const t = p(e);
|
|
44
43
|
this.selectDate({
|
|
45
44
|
date: t,
|
|
46
45
|
dayLabel: x(this.localeId, t),
|
|
47
46
|
isCurrentMonth: !0,
|
|
48
|
-
isToday:
|
|
47
|
+
isToday: O(t),
|
|
49
48
|
isSelected: !1,
|
|
50
49
|
isFocusable: !0,
|
|
51
|
-
isDisabled:
|
|
50
|
+
isDisabled: this.isDisabled(t)
|
|
52
51
|
});
|
|
53
52
|
},
|
|
54
53
|
onSelectYear: (e) => this._nav.selectYear(e),
|
|
55
54
|
onCloseYearGrid: () => this._nav.closeYearSelector(),
|
|
56
55
|
isYearGridOpen: () => this._nav.yearSelectorOpen
|
|
57
|
-
}), this._focusLeave = new
|
|
56
|
+
}), this._focusLeave = new I(this, {
|
|
58
57
|
onLeave: () => {
|
|
59
58
|
this.dispatchEvent(new CustomEvent("blur", { bubbles: !0, composed: !0 }));
|
|
60
59
|
}
|
|
@@ -80,8 +79,8 @@ let i = class extends g {
|
|
|
80
79
|
return;
|
|
81
80
|
}
|
|
82
81
|
if (this.value) {
|
|
83
|
-
const t =
|
|
84
|
-
isNaN(t.getTime()) || (this._selectedDate =
|
|
82
|
+
const t = A(this.value);
|
|
83
|
+
isNaN(t.getTime()) || (this._selectedDate = u(t), this._selectedTime = G(t), $(t, this._nav.currentDate, this.numberOfMonths ?? 1) || (this._nav.currentDate = t));
|
|
85
84
|
} else this._selectedTime && (this._selectedDate = void 0, this._selectedTime = void 0);
|
|
86
85
|
}
|
|
87
86
|
}
|
|
@@ -99,7 +98,7 @@ let i = class extends g {
|
|
|
99
98
|
}
|
|
100
99
|
selectDate(e) {
|
|
101
100
|
if (!e.isCurrentMonth || e.isDisabled || this.disabled || this.readOnly) return;
|
|
102
|
-
const t =
|
|
101
|
+
const t = u(e.date);
|
|
103
102
|
t !== this._selectedDate && (this._selectedDate = t, this._selectedTime = void 0, this.value && (this.setValueInternal(void 0), this.emitChange(null)));
|
|
104
103
|
}
|
|
105
104
|
commitTime(e, t = !1) {
|
|
@@ -107,12 +106,12 @@ let i = class extends g {
|
|
|
107
106
|
}
|
|
108
107
|
onTimePickerChange(e) {
|
|
109
108
|
e.stopPropagation();
|
|
110
|
-
const t = e.detail.value,
|
|
109
|
+
const t = e.detail.value, s = e.detail.commit === !0;
|
|
111
110
|
if (!t) {
|
|
112
111
|
this._selectedTime = void 0, this.value && (this.setValueInternal(void 0), this.emitChange(null));
|
|
113
112
|
return;
|
|
114
113
|
}
|
|
115
|
-
this.commitTime(t,
|
|
114
|
+
this.commitTime(t, s);
|
|
116
115
|
}
|
|
117
116
|
onListToggle(e) {
|
|
118
117
|
e.stopPropagation();
|
|
@@ -137,6 +136,8 @@ let i = class extends g {
|
|
|
137
136
|
required: this.required,
|
|
138
137
|
disabled: this.disabled,
|
|
139
138
|
numberOfMonths: this.numberOfMonths,
|
|
139
|
+
localeId: this.localeId,
|
|
140
|
+
currentDate: this._nav.currentDate,
|
|
140
141
|
prevMonthIcon: this.prevMonthIcon,
|
|
141
142
|
nextMonthIcon: this.nextMonthIcon,
|
|
142
143
|
prevMonthAriaLabel: this.prevMonthAriaLabel,
|
|
@@ -146,13 +147,14 @@ let i = class extends g {
|
|
|
146
147
|
onPrevMonthClick: this._keyboard.onPrevMonthClick,
|
|
147
148
|
onNextMonthClick: this._keyboard.onNextMonthClick,
|
|
148
149
|
onFocusOut: this._focusLeave.onFocusOut,
|
|
149
|
-
renderAboveCalendar: () =>
|
|
150
|
+
renderAboveCalendar: () => l,
|
|
150
151
|
renderMonthPanel: (e) => T({
|
|
151
152
|
currentDate: this._nav.currentDate,
|
|
152
153
|
offset: e,
|
|
153
154
|
localeId: this.localeId,
|
|
154
155
|
monthFormat: this.monthFormat,
|
|
155
156
|
yearSelectorOpen: this._nav.yearSelectorOpen,
|
|
157
|
+
selectYearAriaLabel: this.selectYearAriaLabel,
|
|
156
158
|
onToggleYearSelector: () => this.toggleYearSelector(),
|
|
157
159
|
renderBelowHeader: (t) => this.renderBelowHeader(t),
|
|
158
160
|
renderPanelBody: (t) => this.renderPanelBody(t)
|
|
@@ -161,7 +163,7 @@ let i = class extends g {
|
|
|
161
163
|
}
|
|
162
164
|
/** The embedded time-picker row under the first panel's header. */
|
|
163
165
|
renderBelowHeader(e) {
|
|
164
|
-
return e !== 0 ?
|
|
166
|
+
return e !== 0 ? l : m`
|
|
165
167
|
<div class="gui-calendar__time-input-row">
|
|
166
168
|
<gui-time-picker
|
|
167
169
|
class="gui-time-picker gui-field"
|
|
@@ -190,7 +192,7 @@ let i = class extends g {
|
|
|
190
192
|
`;
|
|
191
193
|
}
|
|
192
194
|
renderPanelBody(e) {
|
|
193
|
-
return this._timeGridOpen && !this._nav.yearSelectorOpen && e === 0 ?
|
|
195
|
+
return this._timeGridOpen && !this._nav.yearSelectorOpen && e === 0 ? m`` : S({
|
|
194
196
|
offset: e,
|
|
195
197
|
yearSelectorOpen: this._nav.yearSelectorOpen,
|
|
196
198
|
years: this._nav.yearList,
|
|
@@ -198,6 +200,8 @@ let i = class extends g {
|
|
|
198
200
|
onSelectYear: (t) => this._keyboard.selectYear(t),
|
|
199
201
|
onYearKeydown: this._keyboard.handleYearKeydown,
|
|
200
202
|
localeId: this.localeId,
|
|
203
|
+
currentDate: this._nav.currentDate,
|
|
204
|
+
yearGridAriaLabel: this.yearGridAriaLabel,
|
|
201
205
|
getDays: (t) => this.getDaysInMonth(t),
|
|
202
206
|
renderDay: (t) => this.renderDay(t)
|
|
203
207
|
});
|
|
@@ -210,16 +214,19 @@ let i = class extends g {
|
|
|
210
214
|
disabled: e.isDisabled,
|
|
211
215
|
"other-month": !e.isCurrentMonth
|
|
212
216
|
};
|
|
213
|
-
return
|
|
217
|
+
return m`
|
|
214
218
|
<button
|
|
215
219
|
type="button"
|
|
216
220
|
role="gridcell"
|
|
217
221
|
class=${b(t)}
|
|
218
222
|
tabindex=${e.isFocusable ? 0 : -1}
|
|
219
|
-
?disabled=${!e.isCurrentMonth
|
|
220
|
-
|
|
223
|
+
?disabled=${!e.isCurrentMonth}
|
|
224
|
+
aria-disabled=${e.isCurrentMonth && e.isDisabled ? "true" : l}
|
|
225
|
+
aria-label=${L(this.localeId, e.date)}
|
|
226
|
+
aria-current=${e.isToday ? "date" : l}
|
|
227
|
+
data-date=${u(e.date)}
|
|
221
228
|
@click=${() => this.selectDate(e)}
|
|
222
|
-
@keydown=${(
|
|
229
|
+
@keydown=${(s) => this._keyboard.handleDayKeydown(s)}
|
|
223
230
|
aria-selected=${e.isSelected}
|
|
224
231
|
>
|
|
225
232
|
${e.dayLabel}
|
|
@@ -228,22 +235,22 @@ let i = class extends g {
|
|
|
228
235
|
}
|
|
229
236
|
getDaysInMonth(e) {
|
|
230
237
|
const t = this._selectedDate;
|
|
231
|
-
return
|
|
238
|
+
return f({
|
|
232
239
|
currentDate: this._nav.currentDate,
|
|
233
240
|
offset: e,
|
|
234
241
|
localeId: this.localeId,
|
|
235
242
|
numberOfMonths: this.numberOfMonths ?? 1,
|
|
236
|
-
isDisabled: (
|
|
237
|
-
toDay: (
|
|
238
|
-
const o = C(
|
|
243
|
+
isDisabled: (s) => this.isDisabled(s),
|
|
244
|
+
toDay: (s) => {
|
|
245
|
+
const o = C(s.date, { selectedISO: t }).isSelected;
|
|
239
246
|
return {
|
|
240
|
-
date:
|
|
241
|
-
dayLabel:
|
|
242
|
-
isCurrentMonth:
|
|
243
|
-
isToday:
|
|
244
|
-
isDisabled:
|
|
247
|
+
date: s.date,
|
|
248
|
+
dayLabel: s.dayLabel,
|
|
249
|
+
isCurrentMonth: s.isCurrentMonth,
|
|
250
|
+
isToday: s.isToday,
|
|
251
|
+
isDisabled: s.isDisabled,
|
|
245
252
|
isSelected: o,
|
|
246
|
-
isFocusable: (o ||
|
|
253
|
+
isFocusable: (o || s.isToday) && s.isCurrentMonth
|
|
247
254
|
};
|
|
248
255
|
},
|
|
249
256
|
focusFallbackDates: [t ? p(t) : /* @__PURE__ */ new Date()]
|
|
@@ -254,106 +261,112 @@ let i = class extends g {
|
|
|
254
261
|
}
|
|
255
262
|
};
|
|
256
263
|
a([
|
|
257
|
-
|
|
264
|
+
r({ type: String })
|
|
258
265
|
], i.prototype, "uid", 2);
|
|
259
266
|
a([
|
|
260
|
-
|
|
267
|
+
r({ type: String })
|
|
261
268
|
], i.prototype, "label", 2);
|
|
262
269
|
a([
|
|
263
|
-
|
|
270
|
+
r({ type: String })
|
|
264
271
|
], i.prototype, "hint", 2);
|
|
265
272
|
a([
|
|
266
|
-
|
|
273
|
+
r({ type: String, attribute: "locale-id" })
|
|
267
274
|
], i.prototype, "localeId", 2);
|
|
268
275
|
a([
|
|
269
|
-
|
|
276
|
+
r({ type: Array })
|
|
270
277
|
], i.prototype, "errors", 2);
|
|
271
278
|
a([
|
|
272
|
-
|
|
279
|
+
r({ type: Boolean })
|
|
273
280
|
], i.prototype, "touched", 2);
|
|
274
281
|
a([
|
|
275
|
-
|
|
282
|
+
r({ type: Boolean })
|
|
276
283
|
], i.prototype, "required", 2);
|
|
277
284
|
a([
|
|
278
|
-
|
|
285
|
+
r({ type: Boolean })
|
|
279
286
|
], i.prototype, "disabled", 2);
|
|
280
287
|
a([
|
|
281
|
-
|
|
288
|
+
r({ type: Boolean, attribute: "readonly" })
|
|
282
289
|
], i.prototype, "readOnly", 2);
|
|
283
290
|
a([
|
|
284
|
-
|
|
291
|
+
r({ type: String, attribute: "prev-month-icon" })
|
|
285
292
|
], i.prototype, "prevMonthIcon", 2);
|
|
286
293
|
a([
|
|
287
|
-
|
|
294
|
+
r({ type: String, attribute: "next-month-icon" })
|
|
288
295
|
], i.prototype, "nextMonthIcon", 2);
|
|
289
296
|
a([
|
|
290
|
-
|
|
297
|
+
r({ type: String, attribute: "prev-month-aria-label" })
|
|
291
298
|
], i.prototype, "prevMonthAriaLabel", 2);
|
|
292
299
|
a([
|
|
293
|
-
|
|
300
|
+
r({ type: String, attribute: "next-month-aria-label" })
|
|
294
301
|
], i.prototype, "nextMonthAriaLabel", 2);
|
|
295
302
|
a([
|
|
296
|
-
|
|
303
|
+
r({ type: String, attribute: "select-year-aria-label" })
|
|
304
|
+
], i.prototype, "selectYearAriaLabel", 2);
|
|
305
|
+
a([
|
|
306
|
+
r({ type: String, attribute: "year-grid-aria-label" })
|
|
307
|
+
], i.prototype, "yearGridAriaLabel", 2);
|
|
308
|
+
a([
|
|
309
|
+
r({ type: String })
|
|
297
310
|
], i.prototype, "dayFormat", 2);
|
|
298
311
|
a([
|
|
299
|
-
|
|
312
|
+
r({ type: String })
|
|
300
313
|
], i.prototype, "weekdayFormat", 2);
|
|
301
314
|
a([
|
|
302
|
-
|
|
315
|
+
r({ type: String })
|
|
303
316
|
], i.prototype, "monthFormat", 2);
|
|
304
317
|
a([
|
|
305
|
-
|
|
318
|
+
r({ type: String })
|
|
306
319
|
], i.prototype, "minDate", 2);
|
|
307
320
|
a([
|
|
308
|
-
|
|
321
|
+
r({ type: String })
|
|
309
322
|
], i.prototype, "maxDate", 2);
|
|
310
323
|
a([
|
|
311
|
-
|
|
324
|
+
r({ type: Array })
|
|
312
325
|
], i.prototype, "disabledRanges", 2);
|
|
313
326
|
a([
|
|
314
|
-
|
|
327
|
+
r({ type: Number })
|
|
315
328
|
], i.prototype, "numberOfMonths", 2);
|
|
316
329
|
a([
|
|
317
|
-
|
|
330
|
+
r({ type: String })
|
|
318
331
|
], i.prototype, "value", 2);
|
|
319
332
|
a([
|
|
320
|
-
|
|
333
|
+
r({ type: String, attribute: "hour-format" })
|
|
321
334
|
], i.prototype, "hourFormat", 2);
|
|
322
335
|
a([
|
|
323
|
-
|
|
336
|
+
r({ type: Number, attribute: "minute-step" })
|
|
324
337
|
], i.prototype, "minuteStep", 2);
|
|
325
338
|
a([
|
|
326
|
-
|
|
339
|
+
r({ type: String, attribute: "min-time" })
|
|
327
340
|
], i.prototype, "minTime", 2);
|
|
328
341
|
a([
|
|
329
|
-
|
|
342
|
+
r({ type: String, attribute: "max-time" })
|
|
330
343
|
], i.prototype, "maxTime", 2);
|
|
331
344
|
a([
|
|
332
|
-
|
|
345
|
+
r({ type: Array, attribute: "disabled-time-ranges" })
|
|
333
346
|
], i.prototype, "disabledTimeRanges", 2);
|
|
334
347
|
a([
|
|
335
|
-
|
|
348
|
+
r({ type: String, attribute: "min-time-message" })
|
|
336
349
|
], i.prototype, "minTimeMessage", 2);
|
|
337
350
|
a([
|
|
338
|
-
|
|
351
|
+
r({ type: String, attribute: "max-time-message" })
|
|
339
352
|
], i.prototype, "maxTimeMessage", 2);
|
|
340
353
|
a([
|
|
341
|
-
|
|
354
|
+
r({ type: String, attribute: "disabled-time-range-message" })
|
|
342
355
|
], i.prototype, "disabledTimeRangeMessage", 2);
|
|
343
356
|
a([
|
|
344
|
-
|
|
357
|
+
r({ type: String, attribute: "no-available-times-message" })
|
|
345
358
|
], i.prototype, "noAvailableTimesMessage", 2);
|
|
346
359
|
a([
|
|
347
|
-
|
|
360
|
+
r({ type: Boolean, attribute: "allow-custom-time" })
|
|
348
361
|
], i.prototype, "allowCustomTime", 2);
|
|
349
362
|
a([
|
|
350
|
-
|
|
363
|
+
c()
|
|
351
364
|
], i.prototype, "_selectedDate", 2);
|
|
352
365
|
a([
|
|
353
|
-
|
|
366
|
+
c()
|
|
354
367
|
], i.prototype, "_selectedTime", 2);
|
|
355
368
|
a([
|
|
356
|
-
|
|
369
|
+
c()
|
|
357
370
|
], i.prototype, "_timeGridOpen", 2);
|
|
358
371
|
i = a([
|
|
359
372
|
y("gui-date-time-calendar")
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { InputWidgetAdapter as
|
|
2
|
-
import "./date-time-calendar-
|
|
1
|
+
import { InputWidgetAdapter as d, formContext as m, inputContext as p } from "@golemui/lit";
|
|
2
|
+
import "./date-time-calendar-DzU-FtVl.js";
|
|
3
3
|
import { consume as u, provide as h } from "@lit/context";
|
|
4
|
-
import { LitElement as c, html as
|
|
5
|
-
import { property as
|
|
4
|
+
import { LitElement as c, html as b } from "lit";
|
|
5
|
+
import { property as $, customElement as g } from "lit/decorators.js";
|
|
6
6
|
import "rxjs";
|
|
7
|
-
var v = Object.defineProperty, x = Object.getOwnPropertyDescriptor,
|
|
7
|
+
var v = Object.defineProperty, x = Object.getOwnPropertyDescriptor, l = (e, t, s, r) => {
|
|
8
8
|
for (var a = r > 1 ? void 0 : r ? x(t, s) : t, n = e.length - 1, o; n >= 0; n--)
|
|
9
9
|
(o = e[n]) && (a = (r ? o(t, s, a) : o(a)) || a);
|
|
10
10
|
return r && a && v(t, s, a), a;
|
|
11
11
|
};
|
|
12
12
|
let i = class extends c {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(...arguments), this.adapter = new
|
|
14
|
+
super(...arguments), this.adapter = new d(), this.subscriptions = [];
|
|
15
15
|
}
|
|
16
16
|
createRenderRoot() {
|
|
17
17
|
return this;
|
|
@@ -29,7 +29,7 @@ let i = class extends c {
|
|
|
29
29
|
render() {
|
|
30
30
|
super.render();
|
|
31
31
|
const e = this.adapter.templateData;
|
|
32
|
-
return
|
|
32
|
+
return b`
|
|
33
33
|
<gui-date-time-calendar
|
|
34
34
|
.uid=${this.widget.uid}
|
|
35
35
|
.label=${e.label}
|
|
@@ -44,6 +44,8 @@ let i = class extends c {
|
|
|
44
44
|
.nextMonthIcon=${e.nextMonthIcon}
|
|
45
45
|
.prevMonthAriaLabel=${e.prevMonthAriaLabel}
|
|
46
46
|
.nextMonthAriaLabel=${e.nextMonthAriaLabel}
|
|
47
|
+
.selectYearAriaLabel=${e.selectYearAriaLabel}
|
|
48
|
+
.yearGridAriaLabel=${e.yearGridAriaLabel}
|
|
47
49
|
.dayFormat=${e.dayFormat}
|
|
48
50
|
.weekdayFormat=${e.weekdayFormat}
|
|
49
51
|
.monthFormat=${e.monthFormat}
|
|
@@ -78,14 +80,14 @@ let i = class extends c {
|
|
|
78
80
|
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
|
|
79
81
|
}
|
|
80
82
|
};
|
|
81
|
-
|
|
83
|
+
l([
|
|
82
84
|
u({ context: m }),
|
|
83
|
-
|
|
85
|
+
$({ attribute: !1 })
|
|
84
86
|
], i.prototype, "formContext", 2);
|
|
85
|
-
|
|
87
|
+
l([
|
|
86
88
|
h({ context: p })
|
|
87
89
|
], i.prototype, "adapter", 2);
|
|
88
|
-
i =
|
|
90
|
+
i = l([
|
|
89
91
|
g("gui-date-time-calendar-input")
|
|
90
92
|
], i);
|
|
91
93
|
export {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { LitElement as
|
|
1
|
+
import { LitElement as u, nothing as h, html as p } from "lit";
|
|
2
2
|
import { property as i, customElement as m } from "lit/decorators.js";
|
|
3
|
-
import { classMap as
|
|
4
|
-
import { G as
|
|
5
|
-
import { G as
|
|
6
|
-
import { d as
|
|
7
|
-
var
|
|
8
|
-
for (var
|
|
9
|
-
(d =
|
|
10
|
-
return
|
|
3
|
+
import { classMap as g } from "lit/directives/class-map.js";
|
|
4
|
+
import { G as y, b as c, c as b } from "./templates-Dmr34nwp.js";
|
|
5
|
+
import { G as v, g as D, w as f, z as E, a as S, r as A, b as L, P as T } from "./part-templates-VORbpgs2.js";
|
|
6
|
+
import { d as M } from "./date-DBuYpvcO.js";
|
|
7
|
+
var x = Object.defineProperty, P = Object.getOwnPropertyDescriptor, e = (a, o, l, s) => {
|
|
8
|
+
for (var r = s > 1 ? void 0 : s ? P(o, l) : o, n = a.length - 1, d; n >= 0; n--)
|
|
9
|
+
(d = a[n]) && (r = (s ? d(o, l, r) : d(r)) || r);
|
|
10
|
+
return s && r && x(o, l, r), r;
|
|
11
11
|
};
|
|
12
|
-
let t = class extends
|
|
12
|
+
let t = class extends u {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = void 0, this.errors = [], this.showErrors = !0, this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.icon = "", this.hint = void 0, this.hourFormat = void 0, this.minuteStep = 1, this.invalidDateMessage = void 0, this.value = void 0, this.minDate = void 0, this.maxDate = void 0, this.minTime = void 0, this.maxTime = void 0, this.minDateMessage = void 0, this.maxDateMessage = void 0, this.minTimeMessage = void 0, this.maxTimeMessage = void 0, this.inputBlockClass = "gui-date-time-input", this.groups = ["default"], this._parts = new
|
|
14
|
+
super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = void 0, this.errors = [], this.showErrors = !0, this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.icon = "", this.hint = 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.hourFormat = void 0, this.minuteStep = 1, this.invalidDateMessage = void 0, this.value = void 0, this.minDate = void 0, this.maxDate = void 0, this.minTime = void 0, this.maxTime = void 0, this.minDateMessage = void 0, this.maxDateMessage = void 0, this.minTimeMessage = void 0, this.maxTimeMessage = void 0, this.inputBlockClass = "gui-date-time-input", this.groups = ["default"], this._parts = new v(this, {
|
|
15
15
|
blockClass: this.inputBlockClass,
|
|
16
16
|
groups: this.groups,
|
|
17
|
-
getDescriptor: (
|
|
18
|
-
commitGroup: (
|
|
17
|
+
getDescriptor: (a) => this.getPartDescriptor(a),
|
|
18
|
+
commitGroup: (a) => this.validateAndEmit(a),
|
|
19
19
|
isReadonly: () => !!this.readOnly,
|
|
20
20
|
isDisabled: () => !!this.disabled,
|
|
21
21
|
onEmptyPartBlur: () => this.dispatchEvent(new CustomEvent("change", { detail: { value: null }, bubbles: !0 })),
|
|
22
22
|
getHourFormat: () => this.localeData.effectiveHourFormat,
|
|
23
23
|
getDayPeriodLabels: () => this.localeData.dayPeriodLabels
|
|
24
|
-
}), this.ariaController = new
|
|
24
|
+
}), this.ariaController = new y(this, {
|
|
25
25
|
getTargets: () => this.querySelectorAll(`.${this.inputBlockClass}`),
|
|
26
26
|
getState: () => ({
|
|
27
27
|
uid: this.uid,
|
|
@@ -30,7 +30,8 @@ let t = class extends h {
|
|
|
30
30
|
errors: this.errors,
|
|
31
31
|
readonly: this.readOnly,
|
|
32
32
|
disabled: this.disabled,
|
|
33
|
-
touched: this.touched
|
|
33
|
+
touched: this.touched,
|
|
34
|
+
required: this.required
|
|
34
35
|
}
|
|
35
36
|
})
|
|
36
37
|
});
|
|
@@ -44,26 +45,26 @@ let t = class extends h {
|
|
|
44
45
|
get localeData() {
|
|
45
46
|
return D(this.localeId, this.hourFormat, this.minuteStep, !0);
|
|
46
47
|
}
|
|
47
|
-
getPartDescriptor(
|
|
48
|
-
return this.localeData.descriptors[
|
|
48
|
+
getPartDescriptor(a) {
|
|
49
|
+
return this.localeData.descriptors[a];
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
52
|
* Constrains the date and time axes independently: `minDate`/`maxDate` bound
|
|
52
53
|
* the day, `minTime`/`maxTime` bound the time-of-day on every allowed day.
|
|
53
54
|
*/
|
|
54
|
-
boundsError(
|
|
55
|
-
return
|
|
55
|
+
boundsError(a, o) {
|
|
56
|
+
return M(a, this.minDate, this.maxDate, void 0, {
|
|
56
57
|
minDateMessage: this.minDateMessage,
|
|
57
58
|
maxDateMessage: this.maxDateMessage
|
|
58
|
-
}) ?? f(E(
|
|
59
|
+
}) ?? f(E(o), {
|
|
59
60
|
minTime: this.minTime,
|
|
60
61
|
maxTime: this.maxTime,
|
|
61
62
|
minTimeMessage: this.minTimeMessage,
|
|
62
63
|
maxTimeMessage: this.maxTimeMessage
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
willUpdate(
|
|
66
|
-
(!this.hasUpdated ||
|
|
66
|
+
willUpdate(a) {
|
|
67
|
+
(!this.hasUpdated || a.has("value") || a.has("hourFormat") || a.has("localeId")) && this._parts.setGroupFromISO(
|
|
67
68
|
"default",
|
|
68
69
|
this.value ?? "",
|
|
69
70
|
"dateTime",
|
|
@@ -71,7 +72,7 @@ let t = class extends h {
|
|
|
71
72
|
);
|
|
72
73
|
}
|
|
73
74
|
render() {
|
|
74
|
-
const
|
|
75
|
+
const a = {
|
|
75
76
|
uid: this.uid,
|
|
76
77
|
label: this.label,
|
|
77
78
|
errors: this.errors,
|
|
@@ -82,61 +83,74 @@ let t = class extends h {
|
|
|
82
83
|
value: this.value,
|
|
83
84
|
icon: this.icon,
|
|
84
85
|
hint: this.hint
|
|
85
|
-
},
|
|
86
|
+
}, o = {
|
|
86
87
|
blockClass: this.inputBlockClass,
|
|
87
88
|
groups: this.groups,
|
|
88
89
|
formatParts: S(this.localeId, this.localeData.effectiveHourFormat),
|
|
89
|
-
getDescriptor: (
|
|
90
|
+
getDescriptor: (s) => this.getPartDescriptor(s),
|
|
90
91
|
getDisplayValue: this._parts.getPartDisplay,
|
|
91
|
-
|
|
92
|
+
getPartAriaLabel: (s, r) => ({
|
|
93
|
+
day: this.dayAriaLabel,
|
|
94
|
+
month: this.monthAriaLabel,
|
|
95
|
+
year: this.yearAriaLabel,
|
|
96
|
+
hour: this.hourAriaLabel,
|
|
97
|
+
minute: this.minuteAriaLabel
|
|
98
|
+
})[r] ?? T[r],
|
|
99
|
+
dayPeriodAriaLabel: this.dayPeriodAriaLabel,
|
|
92
100
|
disabled: this.disabled,
|
|
93
101
|
partsReadonly: !!this.readOnly
|
|
94
|
-
},
|
|
102
|
+
}, l = {
|
|
95
103
|
"gui-widget-icon": !0,
|
|
96
104
|
[this.icon]: !0
|
|
97
105
|
};
|
|
98
106
|
return p`
|
|
99
|
-
${this.label ?
|
|
107
|
+
${this.label ? c(this.uid, a, !1, void 0, !1) : h}
|
|
100
108
|
|
|
101
109
|
<div class="gui-widget">
|
|
102
110
|
<div
|
|
111
|
+
id=${this.uid}
|
|
103
112
|
class="gui-widget-input gui-parts gui-parts-ring gui-date-time-input ${this.icon ? "gui-calendar--icon" : ""}"
|
|
104
113
|
role="group"
|
|
114
|
+
aria-labelledby=${`${this.uid}_label`}
|
|
105
115
|
>
|
|
106
|
-
${
|
|
116
|
+
${A("default", o, this._parts)}
|
|
107
117
|
</div>
|
|
108
|
-
${this.icon ? p`<span
|
|
118
|
+
${this.icon ? p`<span
|
|
119
|
+
class=${g(l)}
|
|
120
|
+
data-icon=${this.icon}
|
|
121
|
+
aria-hidden="true"
|
|
122
|
+
></span>` : h}
|
|
109
123
|
</div>
|
|
110
124
|
|
|
111
|
-
${this.showErrors && this.errors?.length ?
|
|
125
|
+
${this.showErrors && this.errors?.length ? b(this.uid, a) : h}
|
|
112
126
|
`;
|
|
113
127
|
}
|
|
114
|
-
validateAndEmit(
|
|
115
|
-
const { effectiveHourFormat:
|
|
116
|
-
hourFormat:
|
|
117
|
-
descriptors:
|
|
128
|
+
validateAndEmit(a) {
|
|
129
|
+
const { effectiveHourFormat: o, descriptors: l } = this.localeData, { result: s, writeBacks: r } = L(this._parts.values[a] ?? {}, {
|
|
130
|
+
hourFormat: o,
|
|
131
|
+
descriptors: l,
|
|
118
132
|
invalidDateMessage: this.invalidDateMessage
|
|
119
133
|
});
|
|
120
|
-
if (this._parts.applyWriteBacks(
|
|
134
|
+
if (this._parts.applyWriteBacks(a, r), s.kind === "incomplete") {
|
|
121
135
|
this.requestUpdate();
|
|
122
136
|
return;
|
|
123
137
|
}
|
|
124
|
-
if (
|
|
138
|
+
if (s.kind === "invalid") {
|
|
125
139
|
this.dispatchEvent(
|
|
126
|
-
new CustomEvent("inputError", { detail: { message:
|
|
140
|
+
new CustomEvent("inputError", { detail: { message: s.message }, bubbles: !0 })
|
|
127
141
|
), this.requestUpdate();
|
|
128
142
|
return;
|
|
129
143
|
}
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
144
|
+
const n = this.boundsError(s.iso, s.instant);
|
|
145
|
+
if (n) {
|
|
132
146
|
this.dispatchEvent(
|
|
133
|
-
new CustomEvent("change", { detail: { value:
|
|
147
|
+
new CustomEvent("change", { detail: { value: s.iso }, bubbles: !0 })
|
|
134
148
|
), this.dispatchEvent(
|
|
135
|
-
new CustomEvent("inputError", { detail: { message:
|
|
149
|
+
new CustomEvent("inputError", { detail: { message: n }, bubbles: !0 })
|
|
136
150
|
), this.requestUpdate();
|
|
137
151
|
return;
|
|
138
152
|
}
|
|
139
|
-
this.value =
|
|
153
|
+
this.value = s.iso, this.dispatchEvent(new CustomEvent("change", { detail: { value: this.value }, bubbles: !0 })), this.requestUpdate();
|
|
140
154
|
}
|
|
141
155
|
};
|
|
142
156
|
e([
|
|
@@ -172,6 +186,24 @@ e([
|
|
|
172
186
|
e([
|
|
173
187
|
i({ type: String })
|
|
174
188
|
], t.prototype, "hint", 2);
|
|
189
|
+
e([
|
|
190
|
+
i({ type: String })
|
|
191
|
+
], t.prototype, "dayAriaLabel", 2);
|
|
192
|
+
e([
|
|
193
|
+
i({ type: String })
|
|
194
|
+
], t.prototype, "monthAriaLabel", 2);
|
|
195
|
+
e([
|
|
196
|
+
i({ type: String })
|
|
197
|
+
], t.prototype, "yearAriaLabel", 2);
|
|
198
|
+
e([
|
|
199
|
+
i({ type: String })
|
|
200
|
+
], t.prototype, "hourAriaLabel", 2);
|
|
201
|
+
e([
|
|
202
|
+
i({ type: String })
|
|
203
|
+
], t.prototype, "minuteAriaLabel", 2);
|
|
204
|
+
e([
|
|
205
|
+
i({ type: String })
|
|
206
|
+
], t.prototype, "dayPeriodAriaLabel", 2);
|
|
175
207
|
e([
|
|
176
208
|
i({ type: String, attribute: "hour-format" })
|
|
177
209
|
], t.prototype, "hourFormat", 2);
|