@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,374 @@
|
|
|
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
|
+
import { classMap as b } from "lit/directives/class-map.js";
|
|
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
|
+
};
|
|
15
|
+
let i = class extends g {
|
|
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.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
|
+
getMinDate: () => this.minDate,
|
|
19
|
+
getMaxDate: () => this.maxDate,
|
|
20
|
+
getNumberOfMonths: () => this.numberOfMonths,
|
|
21
|
+
getDisabledRanges: () => this.disabledRanges,
|
|
22
|
+
onYearSelectorToggled: () => this._keyboard.onYearGridToggled()
|
|
23
|
+
}), this.ariaController = new v(this, {
|
|
24
|
+
getTargets: () => this.querySelectorAll(".gui-calendar-input"),
|
|
25
|
+
getState: () => ({
|
|
26
|
+
uid: this.uid,
|
|
27
|
+
templateData: {
|
|
28
|
+
hint: this.hint,
|
|
29
|
+
errors: this.errors,
|
|
30
|
+
readonly: this.readOnly,
|
|
31
|
+
disabled: this.disabled,
|
|
32
|
+
touched: this.touched,
|
|
33
|
+
required: this.required
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
}), this._keyboard = new _(this, {
|
|
37
|
+
canGoPrev: () => this._nav.canGoPrev(),
|
|
38
|
+
canGoNext: () => this._nav.canGoNext(),
|
|
39
|
+
goPrev: () => this._nav.prevMonth(),
|
|
40
|
+
goNext: () => this._nav.nextMonth(),
|
|
41
|
+
onActivateDay: (e) => {
|
|
42
|
+
const t = p(e);
|
|
43
|
+
this.selectDate({
|
|
44
|
+
date: t,
|
|
45
|
+
dayLabel: x(this.localeId, t),
|
|
46
|
+
isCurrentMonth: !0,
|
|
47
|
+
isToday: O(t),
|
|
48
|
+
isSelected: !1,
|
|
49
|
+
isFocusable: !0,
|
|
50
|
+
isDisabled: this.isDisabled(t)
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
onSelectYear: (e) => this._nav.selectYear(e),
|
|
54
|
+
onCloseYearGrid: () => this._nav.closeYearSelector(),
|
|
55
|
+
isYearGridOpen: () => this._nav.yearSelectorOpen
|
|
56
|
+
}), this._focusLeave = new I(this, {
|
|
57
|
+
onLeave: () => {
|
|
58
|
+
this.dispatchEvent(new CustomEvent("blur", { bubbles: !0, composed: !0 }));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** The disabled time ranges in effect on the selected day. */
|
|
63
|
+
get resolvedTimeRanges() {
|
|
64
|
+
return this._selectedDate ? w(this.disabledTimeRanges, this._selectedDate) : [];
|
|
65
|
+
}
|
|
66
|
+
get timePicker() {
|
|
67
|
+
return this.querySelector("gui-time-picker");
|
|
68
|
+
}
|
|
69
|
+
createRenderRoot() {
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
connectedCallback() {
|
|
73
|
+
super.connectedCallback(), this.classList.add("gui-field");
|
|
74
|
+
}
|
|
75
|
+
willUpdate(e) {
|
|
76
|
+
if (e.has("value")) {
|
|
77
|
+
if (this._internalValueChange) {
|
|
78
|
+
this._internalValueChange = !1;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (this.value) {
|
|
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));
|
|
84
|
+
} else this._selectedTime && (this._selectedDate = void 0, this._selectedTime = void 0);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
setValueInternal(e) {
|
|
88
|
+
this._internalValueChange = !0, this.value = e;
|
|
89
|
+
}
|
|
90
|
+
emitChange(e, t = !1) {
|
|
91
|
+
this.dispatchEvent(
|
|
92
|
+
new CustomEvent("change", {
|
|
93
|
+
detail: { value: e, commit: t },
|
|
94
|
+
bubbles: !0,
|
|
95
|
+
composed: !0
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
selectDate(e) {
|
|
100
|
+
if (!e.isCurrentMonth || e.isDisabled || this.disabled || this.readOnly) return;
|
|
101
|
+
const t = u(e.date);
|
|
102
|
+
t !== this._selectedDate && (this._selectedDate = t, this._selectedTime = void 0, this.value && (this.setValueInternal(void 0), this.emitChange(null)));
|
|
103
|
+
}
|
|
104
|
+
commitTime(e, t = !1) {
|
|
105
|
+
this._selectedDate && (this._selectedTime = e, this.setValueInternal(`${this._selectedDate}T${e}`), this.emitChange(this.value, t));
|
|
106
|
+
}
|
|
107
|
+
onTimePickerChange(e) {
|
|
108
|
+
e.stopPropagation();
|
|
109
|
+
const t = e.detail.value, s = e.detail.commit === !0;
|
|
110
|
+
if (!t) {
|
|
111
|
+
this._selectedTime = void 0, this.value && (this.setValueInternal(void 0), this.emitChange(null));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.commitTime(t, s);
|
|
115
|
+
}
|
|
116
|
+
onListToggle(e) {
|
|
117
|
+
e.stopPropagation();
|
|
118
|
+
const { open: t } = e.detail;
|
|
119
|
+
if (t && this.readOnly) {
|
|
120
|
+
this.timePicker?.closeList();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this._timeGridOpen = t, t && (this._nav.yearSelectorOpen = !1);
|
|
124
|
+
}
|
|
125
|
+
/** Closes the embedded time picker before flipping the year grid. */
|
|
126
|
+
toggleYearSelector() {
|
|
127
|
+
this.timePicker?.closeList(), this._nav.toggleYearSelector();
|
|
128
|
+
}
|
|
129
|
+
render() {
|
|
130
|
+
return M({
|
|
131
|
+
uid: this.uid,
|
|
132
|
+
label: this.label,
|
|
133
|
+
hint: this.hint,
|
|
134
|
+
errors: this.errors,
|
|
135
|
+
touched: this.touched,
|
|
136
|
+
required: this.required,
|
|
137
|
+
disabled: this.disabled,
|
|
138
|
+
numberOfMonths: this.numberOfMonths,
|
|
139
|
+
localeId: this.localeId,
|
|
140
|
+
currentDate: this._nav.currentDate,
|
|
141
|
+
prevMonthIcon: this.prevMonthIcon,
|
|
142
|
+
nextMonthIcon: this.nextMonthIcon,
|
|
143
|
+
prevMonthAriaLabel: this.prevMonthAriaLabel,
|
|
144
|
+
nextMonthAriaLabel: this.nextMonthAriaLabel,
|
|
145
|
+
canGoPrev: this._nav.canGoPrev(),
|
|
146
|
+
canGoNext: this._nav.canGoNext(),
|
|
147
|
+
onPrevMonthClick: this._keyboard.onPrevMonthClick,
|
|
148
|
+
onNextMonthClick: this._keyboard.onNextMonthClick,
|
|
149
|
+
onFocusOut: this._focusLeave.onFocusOut,
|
|
150
|
+
renderAboveCalendar: () => l,
|
|
151
|
+
renderMonthPanel: (e) => T({
|
|
152
|
+
currentDate: this._nav.currentDate,
|
|
153
|
+
offset: e,
|
|
154
|
+
localeId: this.localeId,
|
|
155
|
+
monthFormat: this.monthFormat,
|
|
156
|
+
yearSelectorOpen: this._nav.yearSelectorOpen,
|
|
157
|
+
selectYearAriaLabel: this.selectYearAriaLabel,
|
|
158
|
+
onToggleYearSelector: () => this.toggleYearSelector(),
|
|
159
|
+
renderBelowHeader: (t) => this.renderBelowHeader(t),
|
|
160
|
+
renderPanelBody: (t) => this.renderPanelBody(t)
|
|
161
|
+
})
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/** The embedded time-picker row under the first panel's header. */
|
|
165
|
+
renderBelowHeader(e) {
|
|
166
|
+
return e !== 0 ? l : m`
|
|
167
|
+
<div class="gui-calendar__time-input-row">
|
|
168
|
+
<gui-time-picker
|
|
169
|
+
class="gui-time-picker gui-field"
|
|
170
|
+
.uid=${this.uid ? `${this.uid}-time` : void 0}
|
|
171
|
+
.showErrors=${!1}
|
|
172
|
+
?required=${this.required}
|
|
173
|
+
?disabled=${this.disabled || !this._selectedDate}
|
|
174
|
+
?readonly=${this.readOnly}
|
|
175
|
+
.allowCustomTime=${this.allowCustomTime}
|
|
176
|
+
.value=${this._selectedTime}
|
|
177
|
+
.localeId=${this.localeId}
|
|
178
|
+
.hourFormat=${this.hourFormat}
|
|
179
|
+
.minuteStep=${this.minuteStep}
|
|
180
|
+
.minTime=${this.minTime}
|
|
181
|
+
.maxTime=${this.maxTime}
|
|
182
|
+
.disabledRanges=${this.resolvedTimeRanges}
|
|
183
|
+
.columns=${4}
|
|
184
|
+
.minTimeMessage=${this.minTimeMessage}
|
|
185
|
+
.maxTimeMessage=${this.maxTimeMessage}
|
|
186
|
+
.disabledRangeMessage=${this.disabledTimeRangeMessage}
|
|
187
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
188
|
+
@change=${this.onTimePickerChange}
|
|
189
|
+
@listtoggle=${this.onListToggle}
|
|
190
|
+
></gui-time-picker>
|
|
191
|
+
</div>
|
|
192
|
+
`;
|
|
193
|
+
}
|
|
194
|
+
renderPanelBody(e) {
|
|
195
|
+
return this._timeGridOpen && !this._nav.yearSelectorOpen && e === 0 ? m`` : S({
|
|
196
|
+
offset: e,
|
|
197
|
+
yearSelectorOpen: this._nav.yearSelectorOpen,
|
|
198
|
+
years: this._nav.yearList,
|
|
199
|
+
currentYear: this._nav.currentDate.getFullYear(),
|
|
200
|
+
onSelectYear: (t) => this._keyboard.selectYear(t),
|
|
201
|
+
onYearKeydown: this._keyboard.handleYearKeydown,
|
|
202
|
+
localeId: this.localeId,
|
|
203
|
+
currentDate: this._nav.currentDate,
|
|
204
|
+
yearGridAriaLabel: this.yearGridAriaLabel,
|
|
205
|
+
getDays: (t) => this.getDaysInMonth(t),
|
|
206
|
+
renderDay: (t) => this.renderDay(t)
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
renderDay(e) {
|
|
210
|
+
const t = {
|
|
211
|
+
"gui-calendar__day-button": !0,
|
|
212
|
+
today: e.isToday,
|
|
213
|
+
selected: e.isSelected,
|
|
214
|
+
disabled: e.isDisabled,
|
|
215
|
+
"other-month": !e.isCurrentMonth
|
|
216
|
+
};
|
|
217
|
+
return m`
|
|
218
|
+
<button
|
|
219
|
+
type="button"
|
|
220
|
+
role="gridcell"
|
|
221
|
+
class=${b(t)}
|
|
222
|
+
tabindex=${e.isFocusable ? 0 : -1}
|
|
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)}
|
|
228
|
+
@click=${() => this.selectDate(e)}
|
|
229
|
+
@keydown=${(s) => this._keyboard.handleDayKeydown(s)}
|
|
230
|
+
aria-selected=${e.isSelected}
|
|
231
|
+
>
|
|
232
|
+
${e.dayLabel}
|
|
233
|
+
</button>
|
|
234
|
+
`;
|
|
235
|
+
}
|
|
236
|
+
getDaysInMonth(e) {
|
|
237
|
+
const t = this._selectedDate;
|
|
238
|
+
return f({
|
|
239
|
+
currentDate: this._nav.currentDate,
|
|
240
|
+
offset: e,
|
|
241
|
+
localeId: this.localeId,
|
|
242
|
+
numberOfMonths: this.numberOfMonths ?? 1,
|
|
243
|
+
isDisabled: (s) => this.isDisabled(s),
|
|
244
|
+
toDay: (s) => {
|
|
245
|
+
const o = C(s.date, { selectedISO: t }).isSelected;
|
|
246
|
+
return {
|
|
247
|
+
date: s.date,
|
|
248
|
+
dayLabel: s.dayLabel,
|
|
249
|
+
isCurrentMonth: s.isCurrentMonth,
|
|
250
|
+
isToday: s.isToday,
|
|
251
|
+
isDisabled: s.isDisabled,
|
|
252
|
+
isSelected: o,
|
|
253
|
+
isFocusable: (o || s.isToday) && s.isCurrentMonth
|
|
254
|
+
};
|
|
255
|
+
},
|
|
256
|
+
focusFallbackDates: [t ? p(t) : /* @__PURE__ */ new Date()]
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
isDisabled(e) {
|
|
260
|
+
return this._nav.isDisabled(e);
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
a([
|
|
264
|
+
r({ type: String })
|
|
265
|
+
], i.prototype, "uid", 2);
|
|
266
|
+
a([
|
|
267
|
+
r({ type: String })
|
|
268
|
+
], i.prototype, "label", 2);
|
|
269
|
+
a([
|
|
270
|
+
r({ type: String })
|
|
271
|
+
], i.prototype, "hint", 2);
|
|
272
|
+
a([
|
|
273
|
+
r({ type: String, attribute: "locale-id" })
|
|
274
|
+
], i.prototype, "localeId", 2);
|
|
275
|
+
a([
|
|
276
|
+
r({ type: Array })
|
|
277
|
+
], i.prototype, "errors", 2);
|
|
278
|
+
a([
|
|
279
|
+
r({ type: Boolean })
|
|
280
|
+
], i.prototype, "touched", 2);
|
|
281
|
+
a([
|
|
282
|
+
r({ type: Boolean })
|
|
283
|
+
], i.prototype, "required", 2);
|
|
284
|
+
a([
|
|
285
|
+
r({ type: Boolean })
|
|
286
|
+
], i.prototype, "disabled", 2);
|
|
287
|
+
a([
|
|
288
|
+
r({ type: Boolean, attribute: "readonly" })
|
|
289
|
+
], i.prototype, "readOnly", 2);
|
|
290
|
+
a([
|
|
291
|
+
r({ type: String, attribute: "prev-month-icon" })
|
|
292
|
+
], i.prototype, "prevMonthIcon", 2);
|
|
293
|
+
a([
|
|
294
|
+
r({ type: String, attribute: "next-month-icon" })
|
|
295
|
+
], i.prototype, "nextMonthIcon", 2);
|
|
296
|
+
a([
|
|
297
|
+
r({ type: String, attribute: "prev-month-aria-label" })
|
|
298
|
+
], i.prototype, "prevMonthAriaLabel", 2);
|
|
299
|
+
a([
|
|
300
|
+
r({ type: String, attribute: "next-month-aria-label" })
|
|
301
|
+
], i.prototype, "nextMonthAriaLabel", 2);
|
|
302
|
+
a([
|
|
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 })
|
|
310
|
+
], i.prototype, "dayFormat", 2);
|
|
311
|
+
a([
|
|
312
|
+
r({ type: String })
|
|
313
|
+
], i.prototype, "weekdayFormat", 2);
|
|
314
|
+
a([
|
|
315
|
+
r({ type: String })
|
|
316
|
+
], i.prototype, "monthFormat", 2);
|
|
317
|
+
a([
|
|
318
|
+
r({ type: String })
|
|
319
|
+
], i.prototype, "minDate", 2);
|
|
320
|
+
a([
|
|
321
|
+
r({ type: String })
|
|
322
|
+
], i.prototype, "maxDate", 2);
|
|
323
|
+
a([
|
|
324
|
+
r({ type: Array })
|
|
325
|
+
], i.prototype, "disabledRanges", 2);
|
|
326
|
+
a([
|
|
327
|
+
r({ type: Number })
|
|
328
|
+
], i.prototype, "numberOfMonths", 2);
|
|
329
|
+
a([
|
|
330
|
+
r({ type: String })
|
|
331
|
+
], i.prototype, "value", 2);
|
|
332
|
+
a([
|
|
333
|
+
r({ type: String, attribute: "hour-format" })
|
|
334
|
+
], i.prototype, "hourFormat", 2);
|
|
335
|
+
a([
|
|
336
|
+
r({ type: Number, attribute: "minute-step" })
|
|
337
|
+
], i.prototype, "minuteStep", 2);
|
|
338
|
+
a([
|
|
339
|
+
r({ type: String, attribute: "min-time" })
|
|
340
|
+
], i.prototype, "minTime", 2);
|
|
341
|
+
a([
|
|
342
|
+
r({ type: String, attribute: "max-time" })
|
|
343
|
+
], i.prototype, "maxTime", 2);
|
|
344
|
+
a([
|
|
345
|
+
r({ type: Array, attribute: "disabled-time-ranges" })
|
|
346
|
+
], i.prototype, "disabledTimeRanges", 2);
|
|
347
|
+
a([
|
|
348
|
+
r({ type: String, attribute: "min-time-message" })
|
|
349
|
+
], i.prototype, "minTimeMessage", 2);
|
|
350
|
+
a([
|
|
351
|
+
r({ type: String, attribute: "max-time-message" })
|
|
352
|
+
], i.prototype, "maxTimeMessage", 2);
|
|
353
|
+
a([
|
|
354
|
+
r({ type: String, attribute: "disabled-time-range-message" })
|
|
355
|
+
], i.prototype, "disabledTimeRangeMessage", 2);
|
|
356
|
+
a([
|
|
357
|
+
r({ type: String, attribute: "no-available-times-message" })
|
|
358
|
+
], i.prototype, "noAvailableTimesMessage", 2);
|
|
359
|
+
a([
|
|
360
|
+
r({ type: Boolean, attribute: "allow-custom-time" })
|
|
361
|
+
], i.prototype, "allowCustomTime", 2);
|
|
362
|
+
a([
|
|
363
|
+
c()
|
|
364
|
+
], i.prototype, "_selectedDate", 2);
|
|
365
|
+
a([
|
|
366
|
+
c()
|
|
367
|
+
], i.prototype, "_selectedTime", 2);
|
|
368
|
+
a([
|
|
369
|
+
c()
|
|
370
|
+
], i.prototype, "_timeGridOpen", 2);
|
|
371
|
+
i = a([
|
|
372
|
+
y("gui-date-time-calendar")
|
|
373
|
+
], i);
|
|
374
|
+
typeof customElements < "u" && !customElements.get("gui-date-time-calendar") && customElements.define("gui-date-time-calendar", i);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { InputWidgetAdapter as d, formContext as m, inputContext as p } from "@golemui/lit";
|
|
2
|
+
import "./date-time-calendar-DzU-FtVl.js";
|
|
3
|
+
import { consume as u, provide as h } from "@lit/context";
|
|
4
|
+
import { LitElement as c, html as b } from "lit";
|
|
5
|
+
import { property as $, customElement as g } from "lit/decorators.js";
|
|
6
|
+
import "rxjs";
|
|
7
|
+
var v = Object.defineProperty, x = Object.getOwnPropertyDescriptor, l = (e, t, s, r) => {
|
|
8
|
+
for (var a = r > 1 ? void 0 : r ? x(t, s) : t, n = e.length - 1, o; n >= 0; n--)
|
|
9
|
+
(o = e[n]) && (a = (r ? o(t, s, a) : o(a)) || a);
|
|
10
|
+
return r && a && v(t, s, a), a;
|
|
11
|
+
};
|
|
12
|
+
let i = class extends c {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.adapter = new d(), this.subscriptions = [];
|
|
15
|
+
}
|
|
16
|
+
createRenderRoot() {
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
updated(e) {
|
|
20
|
+
super.updated(e);
|
|
21
|
+
const t = this.adapter.templateData.size;
|
|
22
|
+
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
23
|
+
}
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback(), this.classList.add("gui-date-time-calendar", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
26
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
super.render();
|
|
31
|
+
const e = this.adapter.templateData;
|
|
32
|
+
return b`
|
|
33
|
+
<gui-date-time-calendar
|
|
34
|
+
.uid=${this.widget.uid}
|
|
35
|
+
.label=${e.label}
|
|
36
|
+
.hint=${e.hint}
|
|
37
|
+
.errors=${e.errors}
|
|
38
|
+
?touched=${e.touched}
|
|
39
|
+
?required=${e.validator?.required}
|
|
40
|
+
?disabled=${e.disabled}
|
|
41
|
+
?readonly=${e.readonly}
|
|
42
|
+
.value=${e.value}
|
|
43
|
+
.prevMonthIcon=${e.prevMonthIcon}
|
|
44
|
+
.nextMonthIcon=${e.nextMonthIcon}
|
|
45
|
+
.prevMonthAriaLabel=${e.prevMonthAriaLabel}
|
|
46
|
+
.nextMonthAriaLabel=${e.nextMonthAriaLabel}
|
|
47
|
+
.selectYearAriaLabel=${e.selectYearAriaLabel}
|
|
48
|
+
.yearGridAriaLabel=${e.yearGridAriaLabel}
|
|
49
|
+
.dayFormat=${e.dayFormat}
|
|
50
|
+
.weekdayFormat=${e.weekdayFormat}
|
|
51
|
+
.monthFormat=${e.monthFormat}
|
|
52
|
+
.minDate=${e.minDate}
|
|
53
|
+
.maxDate=${e.maxDate}
|
|
54
|
+
.disabledRanges=${e.disabledRanges}
|
|
55
|
+
.numberOfMonths=${e.numberOfMonths}
|
|
56
|
+
.localeId=${e.lang}
|
|
57
|
+
.hourFormat=${e.hourFormat}
|
|
58
|
+
.minuteStep=${e.minuteStep}
|
|
59
|
+
.minTime=${e.minTime}
|
|
60
|
+
.maxTime=${e.maxTime}
|
|
61
|
+
.disabledTimeRanges=${e.disabledTimeRanges}
|
|
62
|
+
?allow-custom-time=${e.allowCustomTime}
|
|
63
|
+
.minTimeMessage=${e.minTimeMessage}
|
|
64
|
+
.maxTimeMessage=${e.maxTimeMessage}
|
|
65
|
+
.disabledTimeRangeMessage=${e.disabledTimeRangeMessage}
|
|
66
|
+
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
67
|
+
@change=${this.valueChanged}
|
|
68
|
+
@inputError=${this.onInputError}
|
|
69
|
+
@blur=${() => this.adapter.onBlur()}
|
|
70
|
+
></gui-date-time-calendar>
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
valueChanged(e) {
|
|
74
|
+
this.adapter.injectValidationIssues(null), this.adapter.valueChanged(e.detail.value);
|
|
75
|
+
}
|
|
76
|
+
onInputError(e) {
|
|
77
|
+
this.adapter.injectValidationIssues([e.detail.message]);
|
|
78
|
+
}
|
|
79
|
+
disconnectedCallback() {
|
|
80
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
l([
|
|
84
|
+
u({ context: m }),
|
|
85
|
+
$({ attribute: !1 })
|
|
86
|
+
], i.prototype, "formContext", 2);
|
|
87
|
+
l([
|
|
88
|
+
h({ context: p })
|
|
89
|
+
], i.prototype, "adapter", 2);
|
|
90
|
+
i = l([
|
|
91
|
+
g("gui-date-time-calendar-input")
|
|
92
|
+
], i);
|
|
93
|
+
export {
|
|
94
|
+
i as DateTimeCalendarElement
|
|
95
|
+
};
|