@golemui/gui-lit 1.2.0 → 1.2.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 +19 -0
- package/{accordion.element-BIgxl5e9.js → accordion.element-C9GzfKrY.js} +29 -30
- package/alert.element-CHn49Yaf.js +55 -0
- package/button.element-C9fHivSw.js +59 -0
- package/{calendar.element-Cv3RBphf.js → calendar.element-XkojKTJk.js} +30 -31
- package/checkbox.element-DU_tVMXu.js +66 -0
- package/currency.element-BmAH5KS_.js +73 -0
- package/date-picker.element-Bg3rF95F.js +94 -0
- package/{date-time-calendar.element-DlbWZjoe.js → date-time-calendar.element-sywQCeQQ.js} +24 -24
- package/date-time-picker.element-HHpwjWTQ.js +107 -0
- package/{date-time.element-CLLxM2nV.js → date-time.element-ucETvSTC.js} +26 -26
- package/{date.element-B8ZHK9KJ.js → date.element-BEHGxRFF.js} +27 -27
- package/default-list-item-renderer-CuPJ9jUD.js +24 -0
- package/{dropdown.element-DMZ7oL5n.js → dropdown.element-DUqG_p1x.js} +85 -84
- package/{flex.element-DG4Uaj_X.js → flex.element-pwba7621.js} +27 -28
- package/{grid.element-DCZsh-3J.js → grid.element-C8K7_Qi3.js} +29 -30
- package/index.js +1316 -3883
- package/index.umd.cjs +117 -2132
- package/{list.element-ADtUK2na.js → list.element-ZtEMKE2x.js} +41 -40
- package/markdown-text.element-DDm36qD0.js +54 -0
- package/markdown.element-DWz3U9rG.js +84 -0
- package/number.element-VkG5wScD.js +71 -0
- package/package.json +6 -6
- package/password.element-C5vQHq5P.js +72 -0
- package/radiogroup.element-CKdO9HwO.js +69 -0
- package/{range-calendar.element-D5eb2f7p.js → range-calendar.element-BznGrej5.js} +23 -24
- package/{range-date-input.element-C35grlYo.js → range-date-input.element-BloTHRDl.js} +24 -24
- package/range-date-picker.element-DKhwFasW.js +98 -0
- package/{range-date-time-calendar.element-BV0J96Gu.js → range-date-time-calendar.element-CZCET-sb.js} +26 -26
- package/{range-date-time-input.element-CzgRbR9F.js → range-date-time-input.element-Dr2VrYhG.js} +24 -24
- package/range-date-time-picker.element-CYeIMWLp.js +109 -0
- package/{range-time-input.element-BOHLUO8z.js → range-time-input.element-7OZhPQqx.js} +23 -23
- package/range-time-picker.element-D0mRFZkK.js +96 -0
- package/renderer.element-DbsFoBba.js +48 -0
- package/{repeater.element-Da8YN1Vy.js → repeater.element-DGEbwvhY.js} +54 -65
- package/select.element-Bb_9jAVB.js +76 -0
- package/{tabs.element-CvcIA8P3.js → tabs.element-BYDNF_pm.js} +49 -50
- package/tags.element-BSN3i9Gx.js +73 -0
- package/textarea.element-Dl1ZEOqO.js +71 -0
- package/textinput.element-C5Vbbkxq.js +68 -0
- package/{time-picker.element-C3oR0EkQ.js → time-picker.element-Crmj9YDy.js} +26 -26
- package/{time.element-X286nthD.js → time.element-DfSeAZp4.js} +29 -29
- package/toggle.element-ORsprZ2M.js +66 -0
- package/alert.element-DPWq9-0F.js +0 -56
- package/button.element-CJay43iR.js +0 -132
- package/calendar-DleRbmvP.js +0 -267
- package/checkbox.element-CpmrzdH0.js +0 -200
- package/currency.element-Cezgzbbs.js +0 -276
- package/date-DBuYpvcO.js +0 -849
- package/date-input-B3yHsn-g.js +0 -204
- package/date-picker.element-ByZefznr.js +0 -357
- package/date-time-calendar-CB5cNoOX.js +0 -374
- package/date-time-input-DrY68YDX.js +0 -246
- package/date-time-picker.element-CYwmumfq.js +0 -440
- package/day-status-ljexnwEO.js +0 -554
- package/errors-Bs_vYN-_.js +0 -110
- package/focus-leave.controller-2gV0pQd5.js +0 -73
- package/list-D730tmGN.js +0 -297
- package/markdown-text-X-BRJT6K.js +0 -30
- package/markdown-text.element-B8TfVLIO.js +0 -55
- package/markdown.element-D5zcxAUS.js +0 -693
- package/number.element-DEY5tR_y.js +0 -291
- package/numeric-jmOOKz30.js +0 -12
- package/one-of-anKkm7mD.js +0 -50
- package/part-templates-VORbpgs2.js +0 -691
- package/password.element-C1aQh_iz.js +0 -240
- package/pill-ranges-DpvWwP-3.js +0 -48
- package/pills-BDMO2NiR.js +0 -348
- package/popup.controller-B33OvX_y.js +0 -86
- package/radiogroup.element-B2G-XyGx.js +0 -235
- package/range-calendar-D7sG24Kx.js +0 -466
- package/range-commit-8-MmYUyo.js +0 -14
- package/range-date-input-BChaoBC1.js +0 -311
- package/range-date-picker.element-Do5YsL5V.js +0 -434
- package/range-date-time-calendar-DulGK2EQ.js +0 -734
- package/range-date-time-input-8ggqckP7.js +0 -353
- package/range-date-time-picker.element-hi5KdopZ.js +0 -472
- package/range-selection-CU3hxLJE.js +0 -25
- package/range-time-input-D7GFdDeA.js +0 -348
- package/range-time-picker.element-DDNQMA_u.js +0 -470
- package/renderer.element-CNyMn2Lu.js +0 -49
- package/select.element-SDxBhGjz.js +0 -266
- package/tabs-DzSCq_98.js +0 -13
- package/tags.element-Bnhfevp3.js +0 -369
- package/templates-Df7abEkB.js +0 -92
- package/textarea.element-Dx7eYEnl.js +0 -239
- package/textinput.element-BnIoDRmY.js +0 -205
- package/time-input-Kk4EX6at.js +0 -201
- package/time-list-DLcq8BAp.js +0 -217
- package/time-picker-DLj1rhOf.js +0 -299
- package/toggle.element-Dokdat_o.js +0 -203
|
@@ -1,466 +0,0 @@
|
|
|
1
|
-
import { LitElement as b, html as p, nothing as l } from "lit";
|
|
2
|
-
import { property as r, state as v, customElement as y } from "lit/decorators.js";
|
|
3
|
-
import { classMap as m } from "lit/directives/class-map.js";
|
|
4
|
-
import { G as D } from "./templates-Df7abEkB.js";
|
|
5
|
-
import { G as f, a as _, r as S, b as R, c as M, d as I, e as C } from "./day-status-ljexnwEO.js";
|
|
6
|
-
import { G as A } from "./focus-leave.controller-2gV0pQd5.js";
|
|
7
|
-
import { p as d, g as O, t as h, r as L, D as E, m as P, c as x } from "./date-DBuYpvcO.js";
|
|
8
|
-
import { r as G, f as $, a as k, b as w, s as N, c as T } from "./pill-ranges-DpvWwP-3.js";
|
|
9
|
-
import { i as Y, s as F, r as g } from "./range-selection-CU3hxLJE.js";
|
|
10
|
-
import "./pills-BDMO2NiR.js";
|
|
11
|
-
var B = Object.defineProperty, q = Object.getOwnPropertyDescriptor, n = (e, t, o, a) => {
|
|
12
|
-
for (var s = a > 1 ? void 0 : a ? q(t, o) : t, u = e.length - 1, c; u >= 0; u--)
|
|
13
|
-
(c = e[u]) && (s = (a ? c(t, o, s) : c(s)) || s);
|
|
14
|
-
return a && s && B(t, o, s), s;
|
|
15
|
-
};
|
|
16
|
-
let i = class extends b {
|
|
17
|
-
constructor() {
|
|
18
|
-
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 = [], this.focusDate = void 0, this.hidePills = !1, this.removePillAriaLabel = void 0, this.disabledDateRangeMessage = void 0, this.invalidRange = null, this._selection = Y(), this._invalidRange = null, this._skipValueNavigation = !1, this._nav = new f(this, {
|
|
19
|
-
getMinDate: () => this.minDate,
|
|
20
|
-
getMaxDate: () => this.maxDate,
|
|
21
|
-
getNumberOfMonths: () => this.numberOfMonths,
|
|
22
|
-
getDisabledRanges: () => this.disabledRanges,
|
|
23
|
-
onYearSelectorToggled: () => this._keyboard.onYearGridToggled()
|
|
24
|
-
}), this.ariaController = new D(this, {
|
|
25
|
-
getTargets: () => this.querySelectorAll(".gui-calendar-input"),
|
|
26
|
-
getState: () => ({
|
|
27
|
-
uid: this.uid,
|
|
28
|
-
templateData: {
|
|
29
|
-
hint: this.hint,
|
|
30
|
-
errors: this.errors,
|
|
31
|
-
readonly: this.readOnly,
|
|
32
|
-
disabled: this.disabled,
|
|
33
|
-
touched: this.touched,
|
|
34
|
-
required: this.required
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
}), this._keyboard = new _(this, {
|
|
38
|
-
canGoPrev: () => this._nav.canGoPrev(),
|
|
39
|
-
canGoNext: () => this._nav.canGoNext(),
|
|
40
|
-
goPrev: () => this._nav.prevMonth(),
|
|
41
|
-
goNext: () => this._nav.nextMonth(),
|
|
42
|
-
onActivateDay: (e, t) => this.selectDate(this.activationDay(e), t),
|
|
43
|
-
onSelectYear: (e) => this._nav.selectYear(e),
|
|
44
|
-
onCloseYearGrid: () => this._nav.closeYearSelector(),
|
|
45
|
-
isYearGridOpen: () => this._nav.yearSelectorOpen
|
|
46
|
-
}), this._focusLeave = new A(this, {
|
|
47
|
-
onLeave: () => this.dispatchEvent(new CustomEvent("blur", { bubbles: !0, composed: !0 }))
|
|
48
|
-
}), this.onPillRemoveEvent = (e) => {
|
|
49
|
-
if (this.disabled || this.readOnly) return;
|
|
50
|
-
const t = G(this.value, e.detail.key);
|
|
51
|
-
t && (this.value = t.next, this.dispatchEvent(
|
|
52
|
-
new CustomEvent("change", {
|
|
53
|
-
detail: { value: this.value },
|
|
54
|
-
bubbles: !0,
|
|
55
|
-
composed: !0
|
|
56
|
-
})
|
|
57
|
-
));
|
|
58
|
-
}, this.onPillClickEvent = (e) => {
|
|
59
|
-
const t = $(this.getSortedPills(), e.detail.key);
|
|
60
|
-
t && this.navigateToDate(t.start);
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
/** The nav controller's month cursor, kept under its historical name. */
|
|
64
|
-
get _currentDate() {
|
|
65
|
-
return this._nav.currentDate;
|
|
66
|
-
}
|
|
67
|
-
set _currentDate(e) {
|
|
68
|
-
this._nav.currentDate = e;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Full instant of an endpoint, used to order the pills. Date-only here; a
|
|
72
|
-
* subclass whose endpoints carry a time overrides it so two ranges on the
|
|
73
|
-
* same day still sort by time.
|
|
74
|
-
*/
|
|
75
|
-
parseEndpoint(e) {
|
|
76
|
-
return d(e);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Midnight-truncated calendar day of an endpoint, used to highlight the day
|
|
80
|
-
* grid.
|
|
81
|
-
*/
|
|
82
|
-
endpointDay(e) {
|
|
83
|
-
return d(e);
|
|
84
|
-
}
|
|
85
|
-
/** Pill text for one committed range. */
|
|
86
|
-
formatPillLabel(e) {
|
|
87
|
-
return k(e, (t) => T(t, this.localeId));
|
|
88
|
-
}
|
|
89
|
-
/** Day-button inner content. */
|
|
90
|
-
renderDayContent(e) {
|
|
91
|
-
return p`${e.dayLabel}`;
|
|
92
|
-
}
|
|
93
|
-
createRenderRoot() {
|
|
94
|
-
return this;
|
|
95
|
-
}
|
|
96
|
-
connectedCallback() {
|
|
97
|
-
super.connectedCallback(), this.classList.add("gui-field");
|
|
98
|
-
}
|
|
99
|
-
willUpdate(e) {
|
|
100
|
-
if (e.has("invalidRange"))
|
|
101
|
-
if (this.invalidRange) {
|
|
102
|
-
const t = this.endpointDay(this.invalidRange.start), o = this.endpointDay(this.invalidRange.end);
|
|
103
|
-
this._invalidRange = isNaN(t.getTime()) || isNaN(o.getTime()) ? null : { start: t, end: o };
|
|
104
|
-
} else
|
|
105
|
-
this._invalidRange = null;
|
|
106
|
-
if (e.has("value") && !e.has("focusDate")) {
|
|
107
|
-
if (this._skipValueNavigation)
|
|
108
|
-
this._skipValueNavigation = !1;
|
|
109
|
-
else if (this.value) {
|
|
110
|
-
const t = Array.isArray(this.value) ? this.value : [{ start: this.value }];
|
|
111
|
-
t.length > 0 && t[0].start && this._nav.navigateToDate(this.endpointDay(t[0].start));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (e.has("focusDate") && this.focusDate) {
|
|
115
|
-
const t = d(this.focusDate);
|
|
116
|
-
isNaN(t.getTime()) || (this._nav.navigateToDate(t), this.focusDate = void 0);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
render() {
|
|
120
|
-
return S({
|
|
121
|
-
uid: this.uid,
|
|
122
|
-
label: this.label,
|
|
123
|
-
hint: this.hint,
|
|
124
|
-
errors: this.errors,
|
|
125
|
-
touched: this.touched,
|
|
126
|
-
required: this.required,
|
|
127
|
-
disabled: this.disabled,
|
|
128
|
-
numberOfMonths: this.numberOfMonths,
|
|
129
|
-
localeId: this.localeId,
|
|
130
|
-
currentDate: this._nav.currentDate,
|
|
131
|
-
prevMonthIcon: this.prevMonthIcon,
|
|
132
|
-
nextMonthIcon: this.nextMonthIcon,
|
|
133
|
-
prevMonthAriaLabel: this.prevMonthAriaLabel,
|
|
134
|
-
nextMonthAriaLabel: this.nextMonthAriaLabel,
|
|
135
|
-
canGoPrev: this._nav.canGoPrev(),
|
|
136
|
-
canGoNext: this._nav.canGoNext(),
|
|
137
|
-
onPrevMonthClick: this._keyboard.onPrevMonthClick,
|
|
138
|
-
onNextMonthClick: this._keyboard.onNextMonthClick,
|
|
139
|
-
onFocusOut: this._focusLeave.onFocusOut,
|
|
140
|
-
renderAboveCalendar: () => this.renderAboveCalendar(),
|
|
141
|
-
renderMonthPanel: (e) => R({
|
|
142
|
-
currentDate: this._nav.currentDate,
|
|
143
|
-
offset: e,
|
|
144
|
-
localeId: this.localeId,
|
|
145
|
-
monthFormat: this.monthFormat,
|
|
146
|
-
yearSelectorOpen: this._nav.yearSelectorOpen,
|
|
147
|
-
selectYearAriaLabel: this.selectYearAriaLabel,
|
|
148
|
-
onToggleYearSelector: () => this.toggleYearSelector(),
|
|
149
|
-
renderBelowHeader: (t) => this.renderBelowHeader(t),
|
|
150
|
-
renderPanelBody: (t) => this.renderPanelBody(t)
|
|
151
|
-
})
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
/** Hook rendered between the header and the panel body. Default: nothing. */
|
|
155
|
-
renderBelowHeader(e) {
|
|
156
|
-
return l;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* The panel content below the header: the year grid replaces the days grid
|
|
160
|
-
* of the first panel while the year selector is open. Subclasses can swap
|
|
161
|
-
* in other bodies (e.g. the date-time calendar's time grid).
|
|
162
|
-
*/
|
|
163
|
-
renderPanelBody(e) {
|
|
164
|
-
return M({
|
|
165
|
-
offset: e,
|
|
166
|
-
yearSelectorOpen: this._nav.yearSelectorOpen,
|
|
167
|
-
years: this._nav.yearList,
|
|
168
|
-
currentYear: this._nav.currentDate.getFullYear(),
|
|
169
|
-
onSelectYear: (t) => this._keyboard.selectYear(t),
|
|
170
|
-
onYearKeydown: this._keyboard.handleYearKeydown,
|
|
171
|
-
localeId: this.localeId,
|
|
172
|
-
currentDate: this._nav.currentDate,
|
|
173
|
-
yearGridAriaLabel: this.yearGridAriaLabel,
|
|
174
|
-
getDays: (t) => this.getDaysInMonth(t),
|
|
175
|
-
renderDay: (t) => this.renderDay(t)
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Kept as a thin override point — the range date-time subclass closes its
|
|
180
|
-
* time pickers before delegating to the nav controller.
|
|
181
|
-
*/
|
|
182
|
-
toggleYearSelector() {
|
|
183
|
-
this._nav.toggleYearSelector();
|
|
184
|
-
}
|
|
185
|
-
isDisabled(e) {
|
|
186
|
-
return this._nav.isDisabled(e);
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Rebuilds the day context for an Enter/Space activation from the button's
|
|
190
|
-
* `data-date`. Legitimate because a day button can only be focused when it
|
|
191
|
-
* is enabled and in-month; the `disabled`/`readOnly` guards stay in
|
|
192
|
-
* `selectDate`.
|
|
193
|
-
*/
|
|
194
|
-
activationDay(e) {
|
|
195
|
-
const t = d(e);
|
|
196
|
-
return {
|
|
197
|
-
date: t,
|
|
198
|
-
isCurrentMonth: !0,
|
|
199
|
-
isDisabled: this.isDisabled(t),
|
|
200
|
-
isFocusable: !0,
|
|
201
|
-
dayLabel: "",
|
|
202
|
-
isToday: !1,
|
|
203
|
-
isRangeStart: !1,
|
|
204
|
-
isRangeEnd: !1,
|
|
205
|
-
isInRange: !1,
|
|
206
|
-
isOneDayRange: !1,
|
|
207
|
-
isAnchor: !1,
|
|
208
|
-
isSelecting: !1,
|
|
209
|
-
isInvalidStart: !1,
|
|
210
|
-
isInvalidEnd: !1,
|
|
211
|
-
isInvalidInRange: !1
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
renderDay(e) {
|
|
215
|
-
const t = e.isInvalidStart && e.isInvalidEnd, o = {
|
|
216
|
-
"gui-calendar__day-button": !0,
|
|
217
|
-
today: e.isToday,
|
|
218
|
-
"other-month": !e.isCurrentMonth,
|
|
219
|
-
"range-start": e.isRangeStart && !e.isOneDayRange,
|
|
220
|
-
"range-end": e.isRangeEnd && !e.isOneDayRange,
|
|
221
|
-
selected: e.isOneDayRange,
|
|
222
|
-
"in-range": e.isInRange,
|
|
223
|
-
"invalid-range-start": e.isInvalidStart && !t,
|
|
224
|
-
"invalid-range-end": e.isInvalidEnd && !t,
|
|
225
|
-
"invalid-range-single": t,
|
|
226
|
-
"invalid-in-range": e.isInvalidInRange,
|
|
227
|
-
"is-anchor": e.isAnchor,
|
|
228
|
-
"is-selecting": e.isSelecting,
|
|
229
|
-
disabled: e.isDisabled
|
|
230
|
-
};
|
|
231
|
-
return p`
|
|
232
|
-
<button
|
|
233
|
-
type="button"
|
|
234
|
-
role="gridcell"
|
|
235
|
-
class=${m(o)}
|
|
236
|
-
tabindex=${e.isFocusable ? 0 : -1}
|
|
237
|
-
?disabled=${!e.isCurrentMonth}
|
|
238
|
-
aria-disabled=${e.isCurrentMonth && e.isDisabled ? "true" : l}
|
|
239
|
-
aria-label=${O(this.localeId, e.date)}
|
|
240
|
-
aria-current=${e.isToday ? "date" : l}
|
|
241
|
-
data-date=${h(e.date)}
|
|
242
|
-
@click=${(a) => this.selectDate(e, a)}
|
|
243
|
-
@mouseover=${() => this.onMouseOver(e)}
|
|
244
|
-
@focus=${() => this.onMouseOver(e)}
|
|
245
|
-
@keydown=${(a) => this._keyboard.handleDayKeydown(a)}
|
|
246
|
-
aria-selected=${e.isRangeStart || e.isRangeEnd || e.isInRange ? "true" : "false"}
|
|
247
|
-
>
|
|
248
|
-
${this.renderDayContent(e)}
|
|
249
|
-
</button>
|
|
250
|
-
`;
|
|
251
|
-
}
|
|
252
|
-
getDaysInMonth(e) {
|
|
253
|
-
const t = (this.value ?? []).map((a) => ({
|
|
254
|
-
start: this.endpointDay(a.start),
|
|
255
|
-
end: a.end ? this.endpointDay(a.end) : void 0
|
|
256
|
-
})), o = F(this._selection);
|
|
257
|
-
return I({
|
|
258
|
-
currentDate: this._currentDate,
|
|
259
|
-
offset: e,
|
|
260
|
-
localeId: this.localeId,
|
|
261
|
-
numberOfMonths: this.numberOfMonths ?? 1,
|
|
262
|
-
isDisabled: (a) => this.isDisabled(a),
|
|
263
|
-
toDay: (a) => {
|
|
264
|
-
const s = C(a.date, {
|
|
265
|
-
ranges: t,
|
|
266
|
-
anchor: this._selection.anchor,
|
|
267
|
-
selectingSpan: o,
|
|
268
|
-
invalidRange: this._invalidRange
|
|
269
|
-
});
|
|
270
|
-
return {
|
|
271
|
-
date: a.date,
|
|
272
|
-
dayLabel: a.dayLabel,
|
|
273
|
-
isCurrentMonth: a.isCurrentMonth,
|
|
274
|
-
isToday: a.isToday,
|
|
275
|
-
isRangeStart: s.isRangeStart,
|
|
276
|
-
isRangeEnd: s.isRangeEnd,
|
|
277
|
-
isInRange: s.isInRange,
|
|
278
|
-
isInvalidStart: s.isInvalidStart && a.isCurrentMonth,
|
|
279
|
-
isInvalidEnd: s.isInvalidEnd && a.isCurrentMonth,
|
|
280
|
-
isInvalidInRange: s.isInvalidInRange && a.isCurrentMonth,
|
|
281
|
-
isDisabled: a.isDisabled,
|
|
282
|
-
isOneDayRange: s.isOneDayRange,
|
|
283
|
-
isAnchor: s.isAnchor,
|
|
284
|
-
isFocusable: a.isToday || s.isRangeStart,
|
|
285
|
-
isSelecting: s.isSelecting && a.isCurrentMonth
|
|
286
|
-
};
|
|
287
|
-
},
|
|
288
|
-
focusFallbackDates: [
|
|
289
|
-
/* @__PURE__ */ new Date(),
|
|
290
|
-
...(this.value ?? []).map((a) => this.endpointDay(a.start))
|
|
291
|
-
]
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
selectDate(e, t = null) {
|
|
295
|
-
if (!e.isCurrentMonth || e.isDisabled || this.disabled || this.readOnly) return;
|
|
296
|
-
const { state: o, commit: a } = g(this._selection, {
|
|
297
|
-
type: "pick",
|
|
298
|
-
date: e.date
|
|
299
|
-
});
|
|
300
|
-
if (this._selection = o, !a) {
|
|
301
|
-
this._invalidRange = null;
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
if (L(
|
|
305
|
-
h(a.start),
|
|
306
|
-
h(a.end),
|
|
307
|
-
this.disabledRanges,
|
|
308
|
-
this.minDate,
|
|
309
|
-
this.maxDate
|
|
310
|
-
)) {
|
|
311
|
-
this._invalidRange = { start: a.start, end: a.end }, this.dispatchEvent(
|
|
312
|
-
new CustomEvent("inputError", {
|
|
313
|
-
detail: {
|
|
314
|
-
message: this.disabledDateRangeMessage ?? E,
|
|
315
|
-
range: { start: h(a.start), end: h(a.end) }
|
|
316
|
-
},
|
|
317
|
-
bubbles: !0,
|
|
318
|
-
composed: !0
|
|
319
|
-
})
|
|
320
|
-
), this.requestUpdate();
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
this._invalidRange = null, this._skipValueNavigation = !0, this.value = P([
|
|
324
|
-
...this.value || [],
|
|
325
|
-
x(a.start, a.end)
|
|
326
|
-
]), this.dispatchEvent(
|
|
327
|
-
new CustomEvent("change", {
|
|
328
|
-
detail: { value: this.value },
|
|
329
|
-
bubbles: !0,
|
|
330
|
-
composed: !0
|
|
331
|
-
})
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
onMouseOver(e) {
|
|
335
|
-
e.isDisabled || (this._selection = g(this._selection, {
|
|
336
|
-
type: "hover",
|
|
337
|
-
date: e.date
|
|
338
|
-
}).state);
|
|
339
|
-
}
|
|
340
|
-
// --- Pills ---
|
|
341
|
-
renderAboveCalendar() {
|
|
342
|
-
if (this.hidePills) return l;
|
|
343
|
-
const e = this.getSortedPills();
|
|
344
|
-
if (e.length === 0) return l;
|
|
345
|
-
const t = w(e, (o) => this.formatPillLabel(o));
|
|
346
|
-
return p`
|
|
347
|
-
<gui-pills
|
|
348
|
-
class="gui-range-calendar__pills"
|
|
349
|
-
.uid=${this.uid}
|
|
350
|
-
.toolbarAriaLabel=${"Selected date ranges"}
|
|
351
|
-
.items=${t}
|
|
352
|
-
.removable=${!0}
|
|
353
|
-
.clickable=${!0}
|
|
354
|
-
.bubble=${!1}
|
|
355
|
-
?disabled=${this.disabled}
|
|
356
|
-
?readonly=${this.readOnly}
|
|
357
|
-
.removeAriaLabel=${this.removePillAriaLabel ?? "Remove date"}
|
|
358
|
-
@pillremove=${this.onPillRemoveEvent}
|
|
359
|
-
@pillclick=${this.onPillClickEvent}
|
|
360
|
-
></gui-pills>
|
|
361
|
-
`;
|
|
362
|
-
}
|
|
363
|
-
getSortedPills() {
|
|
364
|
-
return N(
|
|
365
|
-
this.value,
|
|
366
|
-
(e, t) => this.parseEndpoint(e).getTime() - this.parseEndpoint(t).getTime()
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
navigateToDate(e) {
|
|
370
|
-
this._nav.navigateToDate(this.endpointDay(e));
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
n([
|
|
374
|
-
r({ type: String })
|
|
375
|
-
], i.prototype, "uid", 2);
|
|
376
|
-
n([
|
|
377
|
-
r({ type: String })
|
|
378
|
-
], i.prototype, "label", 2);
|
|
379
|
-
n([
|
|
380
|
-
r({ type: String })
|
|
381
|
-
], i.prototype, "hint", 2);
|
|
382
|
-
n([
|
|
383
|
-
r({ type: String, attribute: "locale-id" })
|
|
384
|
-
], i.prototype, "localeId", 2);
|
|
385
|
-
n([
|
|
386
|
-
r({ type: Array })
|
|
387
|
-
], i.prototype, "errors", 2);
|
|
388
|
-
n([
|
|
389
|
-
r({ type: Boolean })
|
|
390
|
-
], i.prototype, "touched", 2);
|
|
391
|
-
n([
|
|
392
|
-
r({ type: Boolean })
|
|
393
|
-
], i.prototype, "required", 2);
|
|
394
|
-
n([
|
|
395
|
-
r({ type: Boolean })
|
|
396
|
-
], i.prototype, "disabled", 2);
|
|
397
|
-
n([
|
|
398
|
-
r({ type: Boolean, attribute: "readonly" })
|
|
399
|
-
], i.prototype, "readOnly", 2);
|
|
400
|
-
n([
|
|
401
|
-
r({ type: String, attribute: "prev-month-icon" })
|
|
402
|
-
], i.prototype, "prevMonthIcon", 2);
|
|
403
|
-
n([
|
|
404
|
-
r({ type: String, attribute: "next-month-icon" })
|
|
405
|
-
], i.prototype, "nextMonthIcon", 2);
|
|
406
|
-
n([
|
|
407
|
-
r({ type: String, attribute: "prev-month-aria-label" })
|
|
408
|
-
], i.prototype, "prevMonthAriaLabel", 2);
|
|
409
|
-
n([
|
|
410
|
-
r({ type: String, attribute: "next-month-aria-label" })
|
|
411
|
-
], i.prototype, "nextMonthAriaLabel", 2);
|
|
412
|
-
n([
|
|
413
|
-
r({ type: String, attribute: "select-year-aria-label" })
|
|
414
|
-
], i.prototype, "selectYearAriaLabel", 2);
|
|
415
|
-
n([
|
|
416
|
-
r({ type: String, attribute: "year-grid-aria-label" })
|
|
417
|
-
], i.prototype, "yearGridAriaLabel", 2);
|
|
418
|
-
n([
|
|
419
|
-
r({ type: String })
|
|
420
|
-
], i.prototype, "dayFormat", 2);
|
|
421
|
-
n([
|
|
422
|
-
r({ type: String })
|
|
423
|
-
], i.prototype, "weekdayFormat", 2);
|
|
424
|
-
n([
|
|
425
|
-
r({ type: String })
|
|
426
|
-
], i.prototype, "monthFormat", 2);
|
|
427
|
-
n([
|
|
428
|
-
r({ type: String })
|
|
429
|
-
], i.prototype, "minDate", 2);
|
|
430
|
-
n([
|
|
431
|
-
r({ type: String })
|
|
432
|
-
], i.prototype, "maxDate", 2);
|
|
433
|
-
n([
|
|
434
|
-
r({ type: Array })
|
|
435
|
-
], i.prototype, "disabledRanges", 2);
|
|
436
|
-
n([
|
|
437
|
-
r({ type: Number })
|
|
438
|
-
], i.prototype, "numberOfMonths", 2);
|
|
439
|
-
n([
|
|
440
|
-
r({ type: Array })
|
|
441
|
-
], i.prototype, "value", 2);
|
|
442
|
-
n([
|
|
443
|
-
r({ type: String })
|
|
444
|
-
], i.prototype, "focusDate", 2);
|
|
445
|
-
n([
|
|
446
|
-
r({ type: Boolean })
|
|
447
|
-
], i.prototype, "hidePills", 2);
|
|
448
|
-
n([
|
|
449
|
-
r({ type: String })
|
|
450
|
-
], i.prototype, "removePillAriaLabel", 2);
|
|
451
|
-
n([
|
|
452
|
-
r({ type: String, attribute: "disabled-date-range-message" })
|
|
453
|
-
], i.prototype, "disabledDateRangeMessage", 2);
|
|
454
|
-
n([
|
|
455
|
-
r({ attribute: !1 })
|
|
456
|
-
], i.prototype, "invalidRange", 2);
|
|
457
|
-
n([
|
|
458
|
-
v()
|
|
459
|
-
], i.prototype, "_selection", 2);
|
|
460
|
-
n([
|
|
461
|
-
v()
|
|
462
|
-
], i.prototype, "_invalidRange", 2);
|
|
463
|
-
i = n([
|
|
464
|
-
y("gui-range-calendar")
|
|
465
|
-
], i);
|
|
466
|
-
typeof customElements < "u" && !customElements.get("gui-range-calendar") && customElements.define("gui-range-calendar", i);
|
package/range-commit-8-MmYUyo.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
function u(e, i, r) {
|
|
2
|
-
return r(i, e) < 0 ? { start: i, end: e } : { start: e, end: i };
|
|
3
|
-
}
|
|
4
|
-
function v(e, i, r, n) {
|
|
5
|
-
if (e.kind === "invalid") return { kind: "invalid", message: e.message };
|
|
6
|
-
if (i.kind === "invalid") return { kind: "invalid", message: i.message };
|
|
7
|
-
if (e.kind !== "valid" || i.kind !== "valid") return { kind: "incomplete" };
|
|
8
|
-
const d = n.order ? n.order(e.value, i.value) : { start: e.value, end: i.value }, a = n.validate?.(d) ?? null;
|
|
9
|
-
return a !== null ? { kind: "invalid", message: a } : { kind: "commit", value: n.merge([...r ?? [], n.toRange(d)]) };
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
v as c,
|
|
13
|
-
u as o
|
|
14
|
-
};
|