@golemui/gui-lit 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/calendar-BuJgwvZx.js +254 -0
- package/{calendar.element-MubSE1bx.js → calendar.element-M5MPJmap.js} +1 -1
- package/{currency.element-BHXWcOEu.js → currency.element-CfFrAtrr.js} +20 -14
- package/{date-DTYg8sog.js → date-Bj9mI3GU.js} +106 -50
- package/date-input-cJDkNnVw.js +184 -0
- package/date-picker.element-va_-LGZD.js +312 -0
- package/date-time-calendar-BzRfkLKU.js +361 -0
- package/date-time-calendar.element-DC4NK0y1.js +93 -0
- package/date-time-input-BXxsfuyZ.js +214 -0
- package/date-time-picker.element-Dy-8cb-_.js +380 -0
- package/date-time.element-Bv4XdzMi.js +87 -0
- package/{date.element-BtVJSIRk.js → date.element-Consgsbb.js} +32 -27
- package/day-status-0-hJHrI7.js +530 -0
- package/{dropdown.element-DqzC6aXR.js → dropdown.element-WsD61Qel.js} +57 -48
- package/focus-leave.controller-2gV0pQd5.js +73 -0
- package/index.js +1209 -981
- package/index.umd.cjs +1574 -519
- package/lib/components/date-picker.element.d.ts +0 -11
- package/lib/components/date-time-calendar.element.d.ts +18 -0
- package/lib/components/date-time-picker.element.d.ts +18 -0
- package/lib/components/date-time.element.d.ts +18 -0
- package/lib/components/dropdown.element.d.ts +2 -0
- package/lib/components/range-calendar.element.d.ts +2 -1
- package/lib/components/range-date-picker.element.d.ts +0 -15
- package/lib/components/range-date-time-calendar.element.d.ts +18 -0
- package/lib/components/range-date-time-input.element.d.ts +18 -0
- package/lib/components/range-date-time-picker.element.d.ts +18 -0
- package/lib/components/range-time-input.element.d.ts +18 -0
- package/lib/components/range-time-picker.element.d.ts +18 -0
- package/lib/components/time-picker.element.d.ts +18 -0
- package/lib/components/time.element.d.ts +18 -0
- package/{list-D1oKnH89.js → list-CrLIL4by.js} +76 -61
- package/{list.element-Co3V3Cn5.js → list.element-DV82YxnJ.js} +22 -22
- package/{number.element-BhEyoOtc.js → number.element-CBr47IiY.js} +18 -16
- package/numeric-jmOOKz30.js +12 -0
- package/package.json +6 -6
- package/part-templates-Db871PS3.js +677 -0
- package/pill-ranges-DCqDmpkk.js +48 -0
- package/{pills-B66qz_KX.js → pills-Be1UrLgq.js} +4 -1
- package/popup.controller-eUDxE6jD.js +71 -0
- package/range-calendar-CKPYeSGt.js +452 -0
- package/{range-calendar.element-QTE6vGNP.js → range-calendar.element-D6KYq18B.js} +24 -20
- package/range-commit-8-MmYUyo.js +14 -0
- package/range-date-input-D--AqBMv.js +292 -0
- package/{range-date-input.element-Dj29D_OQ.js → range-date-input.element-D4nIXJbw.js} +8 -7
- package/range-date-picker.element-dhxPAAE6.js +386 -0
- package/range-date-time-calendar-yksWrR7b.js +720 -0
- package/range-date-time-calendar.element-C00aDefZ.js +95 -0
- package/range-date-time-input-B37TUoM3.js +322 -0
- package/range-date-time-input.element-DUnbv4ed.js +81 -0
- package/range-date-time-picker.element-Cbps6s_G.js +412 -0
- package/range-selection-CU3hxLJE.js +25 -0
- package/range-time-input-3lhqR1Ku.js +329 -0
- package/range-time-input.element-dU2iBdmJ.js +81 -0
- package/range-time-picker.element-v6nQsIPw.js +429 -0
- package/{select.element-jcDF1h-g.js → select.element-C0V-Bv3L.js} +94 -90
- package/{tags.element-CX3vQL8L.js → tags.element-DvwEpxpK.js} +1 -1
- package/time-input-BOhlBGJZ.js +181 -0
- package/time-list-Czo48bZm.js +217 -0
- package/time-picker-bFJ63ky8.js +261 -0
- package/time-picker.element-CYZVXgRS.js +85 -0
- package/time.element-fK3oLi49.js +82 -0
- package/abstract-calendar-BoqKPRmS.js +0 -545
- package/calendar-DTYKVYc3.js +0 -96
- package/date-input-BeQvyfln.js +0 -268
- package/date-picker.element-DabW_-0-.js +0 -166
- package/range-calendar-9skwbwlB.js +0 -255
- package/range-date-input-Uy8134vi.js +0 -395
- package/range-date-picker.element-CuKIBkIO.js +0 -182
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## 1.0.3 (2026-07-02)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- firefox issues with date inputs, numeric inputs and dropdown ([#215](https://github.com/golemui/golemui/pull/215))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- Mud Scientist @mudscientist
|
|
10
|
+
- Raúl Jiménez @Elecash
|
|
11
|
+
|
|
12
|
+
## 1.0.2 (2026-06-26)
|
|
13
|
+
|
|
14
|
+
This was a version bump only for gui-lit to align it with other projects, there were no code changes.
|
|
15
|
+
|
|
1
16
|
## 1.0.1 (2026-06-15)
|
|
2
17
|
|
|
3
18
|
This was a version bump only for gui-lit to align it with other projects, there were no code changes.
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { LitElement as u, html as p, nothing as y } from "lit";
|
|
2
|
+
import { property as o, customElement as b } from "lit/decorators.js";
|
|
3
|
+
import { classMap as v } from "lit/directives/class-map.js";
|
|
4
|
+
import { G as m } from "./templates-Dk1jxLwS.js";
|
|
5
|
+
import { G as g, a as D, r as M, c as _, d as S, b as f, e as C } from "./day-status-0-hJHrI7.js";
|
|
6
|
+
import { G as O } from "./focus-leave.controller-2gV0pQd5.js";
|
|
7
|
+
import { p as d, f as I, h as x, t as c } from "./date-Bj9mI3GU.js";
|
|
8
|
+
var L = Object.defineProperty, G = Object.getOwnPropertyDescriptor, a = (e, t, n, i) => {
|
|
9
|
+
for (var s = i > 1 ? void 0 : i ? G(t, n) : t, l = e.length - 1, h; l >= 0; l--)
|
|
10
|
+
(h = e[l]) && (s = (i ? h(t, n, s) : h(s)) || s);
|
|
11
|
+
return i && s && L(t, n, s), s;
|
|
12
|
+
};
|
|
13
|
+
let r = class extends u {
|
|
14
|
+
constructor() {
|
|
15
|
+
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._nav = new g(this, {
|
|
16
|
+
getMinDate: () => this.minDate,
|
|
17
|
+
getMaxDate: () => this.maxDate,
|
|
18
|
+
getNumberOfMonths: () => this.numberOfMonths,
|
|
19
|
+
getDisabledRanges: () => this.disabledRanges,
|
|
20
|
+
onYearSelectorToggled: () => this._keyboard.onYearGridToggled()
|
|
21
|
+
}), this.ariaController = new m(this, {
|
|
22
|
+
getTargets: () => this.querySelectorAll(".gui-calendar-input"),
|
|
23
|
+
getState: () => ({
|
|
24
|
+
uid: this.uid,
|
|
25
|
+
templateData: {
|
|
26
|
+
hint: this.hint,
|
|
27
|
+
errors: this.errors,
|
|
28
|
+
readonly: this.readOnly,
|
|
29
|
+
disabled: this.disabled,
|
|
30
|
+
touched: this.touched
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
}), this._keyboard = new D(this, {
|
|
34
|
+
canGoPrev: () => this._nav.canGoPrev(),
|
|
35
|
+
canGoNext: () => this._nav.canGoNext(),
|
|
36
|
+
goPrev: () => this._nav.prevMonth(),
|
|
37
|
+
goNext: () => this._nav.nextMonth(),
|
|
38
|
+
// Enter/Space can only fire on a focused (hence enabled, in-month) day
|
|
39
|
+
// button; the `disabled`/`readOnly` host guards stay inside `selectDate`.
|
|
40
|
+
onActivateDay: (e) => {
|
|
41
|
+
const t = d(e);
|
|
42
|
+
this.selectDate({
|
|
43
|
+
date: t,
|
|
44
|
+
dayLabel: x(this.localeId, t),
|
|
45
|
+
isCurrentMonth: !0,
|
|
46
|
+
isToday: I(t),
|
|
47
|
+
isSelected: !1,
|
|
48
|
+
isFocusable: !0,
|
|
49
|
+
isDisabled: !1
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
onSelectYear: (e) => this._nav.selectYear(e),
|
|
53
|
+
onCloseYearGrid: () => this._nav.closeYearSelector(),
|
|
54
|
+
isYearGridOpen: () => this._nav.yearSelectorOpen
|
|
55
|
+
}), this._focusLeave = new O(this, {
|
|
56
|
+
onLeave: () => {
|
|
57
|
+
this.dispatchEvent(new CustomEvent("blur", { bubbles: !0, composed: !0 }));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** The nav controller's month cursor, kept under its historical name. */
|
|
62
|
+
get _currentDate() {
|
|
63
|
+
return this._nav.currentDate;
|
|
64
|
+
}
|
|
65
|
+
set _currentDate(e) {
|
|
66
|
+
this._nav.currentDate = e;
|
|
67
|
+
}
|
|
68
|
+
createRenderRoot() {
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
connectedCallback() {
|
|
72
|
+
super.connectedCallback(), this.classList.add("gui-field");
|
|
73
|
+
}
|
|
74
|
+
willUpdate(e) {
|
|
75
|
+
e.has("value") && this.value && this._nav.navigateToDate(d(this.value));
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
return M({
|
|
79
|
+
uid: this.uid,
|
|
80
|
+
label: this.label,
|
|
81
|
+
hint: this.hint,
|
|
82
|
+
errors: this.errors,
|
|
83
|
+
touched: this.touched,
|
|
84
|
+
required: this.required,
|
|
85
|
+
disabled: this.disabled,
|
|
86
|
+
numberOfMonths: this.numberOfMonths,
|
|
87
|
+
prevMonthIcon: this.prevMonthIcon,
|
|
88
|
+
nextMonthIcon: this.nextMonthIcon,
|
|
89
|
+
prevMonthAriaLabel: this.prevMonthAriaLabel,
|
|
90
|
+
nextMonthAriaLabel: this.nextMonthAriaLabel,
|
|
91
|
+
canGoPrev: this._nav.canGoPrev(),
|
|
92
|
+
canGoNext: this._nav.canGoNext(),
|
|
93
|
+
onPrevMonthClick: this._keyboard.onPrevMonthClick,
|
|
94
|
+
onNextMonthClick: this._keyboard.onNextMonthClick,
|
|
95
|
+
onFocusOut: this._focusLeave.onFocusOut,
|
|
96
|
+
renderAboveCalendar: () => y,
|
|
97
|
+
renderMonthPanel: (e) => f({
|
|
98
|
+
currentDate: this._nav.currentDate,
|
|
99
|
+
offset: e,
|
|
100
|
+
localeId: this.localeId,
|
|
101
|
+
monthFormat: this.monthFormat,
|
|
102
|
+
yearSelectorOpen: this._nav.yearSelectorOpen,
|
|
103
|
+
onToggleYearSelector: () => this._nav.toggleYearSelector(),
|
|
104
|
+
renderPanelBody: (t) => this.renderPanelBody(t)
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The panel content below the header: the year grid replaces the days grid
|
|
110
|
+
* of the first panel while the year selector is open. Subclasses can swap
|
|
111
|
+
* in other bodies (e.g. the date-time calendar's time grid).
|
|
112
|
+
*/
|
|
113
|
+
renderPanelBody(e) {
|
|
114
|
+
return _({
|
|
115
|
+
offset: e,
|
|
116
|
+
yearSelectorOpen: this._nav.yearSelectorOpen,
|
|
117
|
+
years: this._nav.yearList,
|
|
118
|
+
currentYear: this._nav.currentDate.getFullYear(),
|
|
119
|
+
onSelectYear: (t) => this._keyboard.selectYear(t),
|
|
120
|
+
onYearKeydown: this._keyboard.handleYearKeydown,
|
|
121
|
+
localeId: this.localeId,
|
|
122
|
+
getDays: (t) => this.getDaysInMonth(t),
|
|
123
|
+
renderDay: (t) => this.renderDay(t)
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
renderDay(e) {
|
|
127
|
+
const t = {
|
|
128
|
+
"gui-calendar__day-button": !0,
|
|
129
|
+
today: e.isToday,
|
|
130
|
+
selected: e.isSelected,
|
|
131
|
+
disabled: e.isDisabled,
|
|
132
|
+
"other-month": !e.isCurrentMonth
|
|
133
|
+
};
|
|
134
|
+
return p`
|
|
135
|
+
<button
|
|
136
|
+
type="button"
|
|
137
|
+
role="gridcell"
|
|
138
|
+
class=${v(t)}
|
|
139
|
+
tabindex=${e.isFocusable ? 0 : -1}
|
|
140
|
+
?disabled=${!e.isCurrentMonth || e.isDisabled}
|
|
141
|
+
data-date=${c(e.date)}
|
|
142
|
+
@click=${() => this.selectDate(e)}
|
|
143
|
+
@keydown=${(n) => this._keyboard.handleDayKeydown(n)}
|
|
144
|
+
aria-selected=${e.isSelected}
|
|
145
|
+
>
|
|
146
|
+
${e.dayLabel}
|
|
147
|
+
</button>
|
|
148
|
+
`;
|
|
149
|
+
}
|
|
150
|
+
getDaysInMonth(e) {
|
|
151
|
+
const t = this.value;
|
|
152
|
+
return S({
|
|
153
|
+
currentDate: this._currentDate,
|
|
154
|
+
offset: e,
|
|
155
|
+
localeId: this.localeId,
|
|
156
|
+
numberOfMonths: this.numberOfMonths ?? 1,
|
|
157
|
+
isDisabled: (n) => this.isDisabled(n),
|
|
158
|
+
toDay: (n) => {
|
|
159
|
+
const i = C(n.date, { selectedISO: t }).isSelected;
|
|
160
|
+
return {
|
|
161
|
+
date: n.date,
|
|
162
|
+
dayLabel: n.dayLabel,
|
|
163
|
+
isCurrentMonth: n.isCurrentMonth,
|
|
164
|
+
isToday: n.isToday,
|
|
165
|
+
isDisabled: n.isDisabled,
|
|
166
|
+
isSelected: i,
|
|
167
|
+
isFocusable: (i || n.isToday) && n.isCurrentMonth
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
focusFallbackDates: [t ? d(t) : /* @__PURE__ */ new Date()]
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
selectDate(e) {
|
|
174
|
+
if (!e.isCurrentMonth || e.isDisabled || this.disabled || this.readOnly) return;
|
|
175
|
+
const t = c(e.date);
|
|
176
|
+
this.value = t, this.dispatchEvent(
|
|
177
|
+
new CustomEvent("change", {
|
|
178
|
+
detail: { value: t },
|
|
179
|
+
bubbles: !0,
|
|
180
|
+
composed: !0
|
|
181
|
+
})
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
isDisabled(e) {
|
|
185
|
+
return this._nav.isDisabled(e);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
a([
|
|
189
|
+
o({ type: String })
|
|
190
|
+
], r.prototype, "uid", 2);
|
|
191
|
+
a([
|
|
192
|
+
o({ type: String })
|
|
193
|
+
], r.prototype, "label", 2);
|
|
194
|
+
a([
|
|
195
|
+
o({ type: String })
|
|
196
|
+
], r.prototype, "hint", 2);
|
|
197
|
+
a([
|
|
198
|
+
o({ type: String, attribute: "locale-id" })
|
|
199
|
+
], r.prototype, "localeId", 2);
|
|
200
|
+
a([
|
|
201
|
+
o({ type: Array })
|
|
202
|
+
], r.prototype, "errors", 2);
|
|
203
|
+
a([
|
|
204
|
+
o({ type: Boolean })
|
|
205
|
+
], r.prototype, "touched", 2);
|
|
206
|
+
a([
|
|
207
|
+
o({ type: Boolean })
|
|
208
|
+
], r.prototype, "required", 2);
|
|
209
|
+
a([
|
|
210
|
+
o({ type: Boolean })
|
|
211
|
+
], r.prototype, "disabled", 2);
|
|
212
|
+
a([
|
|
213
|
+
o({ type: Boolean, attribute: "readonly" })
|
|
214
|
+
], r.prototype, "readOnly", 2);
|
|
215
|
+
a([
|
|
216
|
+
o({ type: String, attribute: "prev-month-icon" })
|
|
217
|
+
], r.prototype, "prevMonthIcon", 2);
|
|
218
|
+
a([
|
|
219
|
+
o({ type: String, attribute: "next-month-icon" })
|
|
220
|
+
], r.prototype, "nextMonthIcon", 2);
|
|
221
|
+
a([
|
|
222
|
+
o({ type: String, attribute: "prev-month-aria-label" })
|
|
223
|
+
], r.prototype, "prevMonthAriaLabel", 2);
|
|
224
|
+
a([
|
|
225
|
+
o({ type: String, attribute: "next-month-aria-label" })
|
|
226
|
+
], r.prototype, "nextMonthAriaLabel", 2);
|
|
227
|
+
a([
|
|
228
|
+
o({ type: String })
|
|
229
|
+
], r.prototype, "dayFormat", 2);
|
|
230
|
+
a([
|
|
231
|
+
o({ type: String })
|
|
232
|
+
], r.prototype, "weekdayFormat", 2);
|
|
233
|
+
a([
|
|
234
|
+
o({ type: String })
|
|
235
|
+
], r.prototype, "monthFormat", 2);
|
|
236
|
+
a([
|
|
237
|
+
o({ type: String })
|
|
238
|
+
], r.prototype, "minDate", 2);
|
|
239
|
+
a([
|
|
240
|
+
o({ type: String })
|
|
241
|
+
], r.prototype, "maxDate", 2);
|
|
242
|
+
a([
|
|
243
|
+
o({ type: Array })
|
|
244
|
+
], r.prototype, "disabledRanges", 2);
|
|
245
|
+
a([
|
|
246
|
+
o({ type: Number })
|
|
247
|
+
], r.prototype, "numberOfMonths", 2);
|
|
248
|
+
a([
|
|
249
|
+
o({ type: String })
|
|
250
|
+
], r.prototype, "value", 2);
|
|
251
|
+
r = a([
|
|
252
|
+
b("gui-calendar")
|
|
253
|
+
], r);
|
|
254
|
+
typeof customElements < "u" && !customElements.get("gui-calendar") && customElements.define("gui-calendar", r);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputWidgetAdapter as o, formContext as l, inputContext as h } from "@golemui/lit";
|
|
2
|
-
import "./calendar-
|
|
2
|
+
import "./calendar-BuJgwvZx.js";
|
|
3
3
|
import { consume as m, provide as u } from "@lit/context";
|
|
4
4
|
import { LitElement as c, html as D } from "lit";
|
|
5
5
|
import { property as b, customElement as $ } from "lit/decorators.js";
|
|
@@ -2,13 +2,14 @@ import { InputWidgetAdapter as g, formContext as b, inputContext as v } from "@g
|
|
|
2
2
|
import { LitElement as m, nothing as p, html as d } from "lit";
|
|
3
3
|
import { property as a, state as f, query as $, customElement as y } from "lit/decorators.js";
|
|
4
4
|
import { classMap as D } from "lit/directives/class-map.js";
|
|
5
|
-
import { G as C, a as x, b as F, c as
|
|
6
|
-
import {
|
|
5
|
+
import { G as C, a as x, b as F, c as w } from "./templates-Dk1jxLwS.js";
|
|
6
|
+
import { b as S, a as _ } from "./numeric-jmOOKz30.js";
|
|
7
|
+
import { consume as E, provide as I } from "@lit/context";
|
|
7
8
|
import "rxjs";
|
|
8
|
-
var
|
|
9
|
-
for (var s =
|
|
10
|
-
(u = t[
|
|
11
|
-
return
|
|
9
|
+
var O = Object.defineProperty, N = Object.getOwnPropertyDescriptor, r = (t, e, o, n) => {
|
|
10
|
+
for (var s = n > 1 ? void 0 : n ? N(e, o) : e, l = t.length - 1, u; l >= 0; l--)
|
|
11
|
+
(u = t[l]) && (s = (n ? u(e, o, s) : u(s)) || s);
|
|
12
|
+
return n && s && O(e, o, s), s;
|
|
12
13
|
};
|
|
13
14
|
let i = class extends m {
|
|
14
15
|
constructor() {
|
|
@@ -77,6 +78,8 @@ let i = class extends m {
|
|
|
77
78
|
placeholder=${this.placeholder || p}
|
|
78
79
|
autocomplete=${this.autocomplete || p}
|
|
79
80
|
@input=${this.handleInput}
|
|
81
|
+
@beforeinput=${S}
|
|
82
|
+
@keydown=${_}
|
|
80
83
|
@focus=${this.handleFocus}
|
|
81
84
|
@blur=${this.handleBlur}
|
|
82
85
|
/>
|
|
@@ -88,7 +91,7 @@ let i = class extends m {
|
|
|
88
91
|
${e.html}
|
|
89
92
|
</div>
|
|
90
93
|
|
|
91
|
-
${
|
|
94
|
+
${w(this.uid, t)}
|
|
92
95
|
`;
|
|
93
96
|
}
|
|
94
97
|
handleInput(t) {
|
|
@@ -119,7 +122,10 @@ let i = class extends m {
|
|
|
119
122
|
formatCurrency(t) {
|
|
120
123
|
if (t === "" || t === void 0 || t === null || isNaN(t)) return "";
|
|
121
124
|
try {
|
|
122
|
-
const e = this.maximumFractionDigits ?? Math.max(this.minimumFractionDigits ?? 2, 2), o = Math.min(
|
|
125
|
+
const e = this.maximumFractionDigits ?? Math.max(this.minimumFractionDigits ?? 2, 2), o = Math.min(
|
|
126
|
+
this.minimumFractionDigits ?? 2,
|
|
127
|
+
e
|
|
128
|
+
);
|
|
123
129
|
return new Intl.NumberFormat(this.localeId ?? "en", {
|
|
124
130
|
style: "currency",
|
|
125
131
|
currency: this.currency ?? "USD",
|
|
@@ -199,10 +205,10 @@ i = r([
|
|
|
199
205
|
y("gui-currency")
|
|
200
206
|
], i);
|
|
201
207
|
typeof customElements < "u" && !customElements.get("gui-currency") && customElements.define("gui-currency", i);
|
|
202
|
-
var
|
|
203
|
-
for (var s =
|
|
204
|
-
(u = t[
|
|
205
|
-
return
|
|
208
|
+
var q = Object.defineProperty, P = Object.getOwnPropertyDescriptor, h = (t, e, o, n) => {
|
|
209
|
+
for (var s = n > 1 ? void 0 : n ? P(e, o) : e, l = t.length - 1, u; l >= 0; l--)
|
|
210
|
+
(u = t[l]) && (s = (n ? u(e, o, s) : u(s)) || s);
|
|
211
|
+
return n && s && q(e, o, s), s;
|
|
206
212
|
};
|
|
207
213
|
let c = class extends m {
|
|
208
214
|
constructor() {
|
|
@@ -255,11 +261,11 @@ let c = class extends m {
|
|
|
255
261
|
}
|
|
256
262
|
};
|
|
257
263
|
h([
|
|
258
|
-
|
|
264
|
+
E({ context: b }),
|
|
259
265
|
a({ attribute: !1 })
|
|
260
266
|
], c.prototype, "formContext", 2);
|
|
261
267
|
h([
|
|
262
|
-
|
|
268
|
+
I({ context: v })
|
|
263
269
|
], c.prototype, "adapter", 2);
|
|
264
270
|
c = h([
|
|
265
271
|
y("gui-currency-input")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l = {
|
|
2
2
|
aa: { firstDay: 7, weekend: [6, 7], minimalDays: 1 },
|
|
3
3
|
"aa-DJ": { firstDay: 6, weekend: [6, 7], minimalDays: 1 },
|
|
4
4
|
"aa-ER": { firstDay: 1, weekend: [6, 7], minimalDays: 1 },
|
|
@@ -709,77 +709,133 @@ const t = {
|
|
|
709
709
|
"zh-Hant-HK": { firstDay: 7, weekend: [6, 7], minimalDays: 1 },
|
|
710
710
|
"zh-Hant-MO": { firstDay: 7, weekend: [6, 7], minimalDays: 1 },
|
|
711
711
|
zu: { firstDay: 7, weekend: [6, 7], minimalDays: 1 }
|
|
712
|
-
};
|
|
713
|
-
function
|
|
714
|
-
const
|
|
715
|
-
return `${
|
|
712
|
+
}, M = "Invalid date: day is greater than the maximum valid day for the month and year.", k = "Invalid date: date is before the minimum allowed date.", w = "Invalid date: date is after the maximum allowed date.", o = "Invalid date: date is within a disabled range.", I = "Invalid time: time is before the minimum allowed time.", S = "Invalid time: time is after the maximum allowed time.", E = "Invalid range: end time must be after start time.", h = "Invalid time: time is within a disabled range.", b = "Invalid date-time: date-time is before the minimum allowed date-time.", L = "Invalid date-time: date-time is after the maximum allowed date-time.";
|
|
713
|
+
function r(e) {
|
|
714
|
+
const a = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), i = String(e.getDate()).padStart(2, "0");
|
|
715
|
+
return `${a}-${n}-${i}`;
|
|
716
|
+
}
|
|
717
|
+
function t(e) {
|
|
718
|
+
const a = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
719
|
+
return a ? new Date(Number(a[1]), Number(a[2]) - 1, Number(a[3])) : new Date(e);
|
|
720
|
+
}
|
|
721
|
+
function d(e, a, n, i) {
|
|
722
|
+
const s = e.split("T")[0];
|
|
723
|
+
if (a && s < a.split("T")[0] || n && s > n.split("T")[0]) return !0;
|
|
724
|
+
if (i && i.length > 0)
|
|
725
|
+
for (const m of i) {
|
|
726
|
+
const D = m.start.split("T")[0], y = m.end ? m.end.split("T")[0] : D;
|
|
727
|
+
if (s >= D && s <= y)
|
|
728
|
+
return !0;
|
|
729
|
+
}
|
|
730
|
+
return !1;
|
|
716
731
|
}
|
|
717
|
-
function
|
|
718
|
-
|
|
732
|
+
function G(e, a, n, i, s) {
|
|
733
|
+
const m = e.split("T")[0];
|
|
734
|
+
return a && m < a.split("T")[0] ? s?.minDateMessage ?? k : n && m > n.split("T")[0] ? s?.maxDateMessage ?? w : d(m, void 0, void 0, i) ? s?.disabledDateRangeMessage ?? o : null;
|
|
719
735
|
}
|
|
720
|
-
function
|
|
721
|
-
|
|
736
|
+
function T(e, a, n, i, s) {
|
|
737
|
+
const m = t(e), D = t(a);
|
|
738
|
+
if (isNaN(m.getTime()) || isNaN(D.getTime())) return !1;
|
|
739
|
+
const y = new Date(m);
|
|
740
|
+
y.setHours(0, 0, 0, 0);
|
|
741
|
+
const f = new Date(D);
|
|
742
|
+
for (f.setHours(0, 0, 0, 0); y <= f; ) {
|
|
743
|
+
if (d(r(y), i, s, n))
|
|
744
|
+
return !0;
|
|
745
|
+
y.setDate(y.getDate() + 1);
|
|
746
|
+
}
|
|
747
|
+
return !1;
|
|
722
748
|
}
|
|
723
|
-
function
|
|
724
|
-
|
|
725
|
-
|
|
749
|
+
function N(e) {
|
|
750
|
+
return new Intl.DateTimeFormat(e ?? "en", {
|
|
751
|
+
year: "numeric",
|
|
752
|
+
month: "numeric",
|
|
753
|
+
day: "numeric"
|
|
754
|
+
}).formatToParts(/* @__PURE__ */ new Date());
|
|
726
755
|
}
|
|
727
|
-
function
|
|
728
|
-
|
|
729
|
-
return f(i.firstDay);
|
|
756
|
+
function p(e, a) {
|
|
757
|
+
return e === 2 ? new Date(a, 1, 29).getDate() === 29 || !a ? 29 : 28 : e === 4 || e === 6 || e === 9 || e === 11 ? 30 : 31;
|
|
730
758
|
}
|
|
731
|
-
function
|
|
732
|
-
|
|
733
|
-
|
|
759
|
+
function C(e) {
|
|
760
|
+
return u(e, /* @__PURE__ */ new Date());
|
|
761
|
+
}
|
|
762
|
+
function u(e, a) {
|
|
763
|
+
return e.getDate() === a.getDate() && e.getMonth() === a.getMonth() && e.getFullYear() === a.getFullYear();
|
|
764
|
+
}
|
|
765
|
+
function c(e) {
|
|
766
|
+
const a = [0, 1, 2, 3, 4, 5, 6], n = e % 7;
|
|
767
|
+
return [...a.slice(n), ...a.slice(0, n)];
|
|
768
|
+
}
|
|
769
|
+
function g(e) {
|
|
770
|
+
const a = e ?? "en", n = l[a] || l[a.split("-")[0]] || { firstDay: 0 };
|
|
771
|
+
return c(n.firstDay);
|
|
772
|
+
}
|
|
773
|
+
function v(e) {
|
|
774
|
+
const a = new Intl.DateTimeFormat(e, { weekday: "narrow" }), n = new Date(2025, 10, 30);
|
|
775
|
+
return g(e).map((i) => {
|
|
734
776
|
const s = new Date(n);
|
|
735
|
-
return s.setDate(n.getDate() +
|
|
777
|
+
return s.setDate(n.getDate() + i), a.format(s);
|
|
736
778
|
});
|
|
737
779
|
}
|
|
738
|
-
function
|
|
739
|
-
for (let
|
|
740
|
-
const s = new Date(
|
|
780
|
+
function B(e, a, n) {
|
|
781
|
+
for (let i = 0; i < n; i++) {
|
|
782
|
+
const s = new Date(a.getFullYear(), a.getMonth() + i, 1);
|
|
741
783
|
if (e.getMonth() === s.getMonth() && e.getFullYear() === s.getFullYear())
|
|
742
784
|
return !0;
|
|
743
785
|
}
|
|
744
786
|
return !1;
|
|
745
787
|
}
|
|
746
|
-
function
|
|
747
|
-
return new Intl.DateTimeFormat(e, { month: n, year: "numeric" }).formatToParts(
|
|
788
|
+
function R(e, a, n = "long") {
|
|
789
|
+
return new Intl.DateTimeFormat(e, { month: n, year: "numeric" }).formatToParts(a).filter((s) => s.type === "month" || s.type === "year");
|
|
748
790
|
}
|
|
749
|
-
function
|
|
750
|
-
const n = e || "en-US", m = new Intl.DateTimeFormat(n, { day: "numeric" }).formatToParts(
|
|
751
|
-
return m ? m.value :
|
|
791
|
+
function H(e, a) {
|
|
792
|
+
const n = e || "en-US", m = new Intl.DateTimeFormat(n, { day: "numeric" }).formatToParts(a).find((D) => D.type === "day");
|
|
793
|
+
return m ? m.value : a.getDate().toString();
|
|
752
794
|
}
|
|
753
|
-
function
|
|
754
|
-
const n =
|
|
755
|
-
return n ===
|
|
795
|
+
function A(e, a) {
|
|
796
|
+
const n = r(e), i = r(a);
|
|
797
|
+
return n === i ? { start: n } : { start: n, end: i };
|
|
756
798
|
}
|
|
757
|
-
function
|
|
758
|
-
return e.length ? e.map((
|
|
759
|
-
start:
|
|
760
|
-
end:
|
|
761
|
-
})).sort((
|
|
762
|
-
(
|
|
763
|
-
const m =
|
|
799
|
+
function _(e) {
|
|
800
|
+
return e.length ? e.map((i) => ({
|
|
801
|
+
start: t(i.start).getTime(),
|
|
802
|
+
end: t(i.end ?? i.start).getTime()
|
|
803
|
+
})).sort((i, s) => i.start - s.start).reduce(
|
|
804
|
+
(i, s) => {
|
|
805
|
+
const m = i[i.length - 1];
|
|
764
806
|
if (m) {
|
|
765
807
|
const D = new Date(m.end);
|
|
766
808
|
if (D.setDate(D.getDate() + 1), s.start <= D.getTime())
|
|
767
|
-
return m.end = Math.max(m.end, s.end),
|
|
809
|
+
return m.end = Math.max(m.end, s.end), i;
|
|
768
810
|
}
|
|
769
|
-
return [...
|
|
811
|
+
return [...i, s];
|
|
770
812
|
},
|
|
771
813
|
[]
|
|
772
|
-
).map((
|
|
814
|
+
).map((i) => A(new Date(i.start), new Date(i.end))) : [];
|
|
773
815
|
}
|
|
774
816
|
export {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
817
|
+
o as D,
|
|
818
|
+
I,
|
|
819
|
+
S as a,
|
|
820
|
+
h as b,
|
|
821
|
+
A as c,
|
|
822
|
+
G as d,
|
|
823
|
+
E as e,
|
|
824
|
+
C as f,
|
|
825
|
+
N as g,
|
|
826
|
+
H as h,
|
|
827
|
+
d as i,
|
|
828
|
+
B as j,
|
|
829
|
+
v as k,
|
|
830
|
+
R as l,
|
|
831
|
+
_ as m,
|
|
832
|
+
u as n,
|
|
833
|
+
b as o,
|
|
834
|
+
t as p,
|
|
835
|
+
L as q,
|
|
836
|
+
T as r,
|
|
837
|
+
p as s,
|
|
838
|
+
r as t,
|
|
839
|
+
M as u,
|
|
840
|
+
g as w
|
|
785
841
|
};
|