@golemui/gui-lit 1.0.1 → 1.0.3
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 +8 -0
- package/{abstract-calendar-BoqKPRmS.js → abstract-calendar-D0-077XJ.js} +18 -18
- package/{calendar-DTYKVYc3.js → calendar-BclCC9VJ.js} +26 -26
- package/{calendar.element-MubSE1bx.js → calendar.element-DcnTyvfg.js} +1 -1
- package/{currency.element-YyL4TeL0.js → currency.element-5GSakkxF.js} +65 -59
- package/{date-DTYg8sog.js → date-CDUlLuYy.js} +50 -45
- package/{date-input-BeQvyfln.js → date-input-DCdGWRio.js} +8 -8
- package/{date-picker.element-DabW_-0-.js → date-picker.element-k7AJFQ5W.js} +8 -6
- package/{date.element-BtVJSIRk.js → date.element-BZO0UQez.js} +1 -1
- package/{dropdown.element-DqzC6aXR.js → dropdown.element-CyJbVAA5.js} +23 -24
- package/index.js +69 -69
- package/index.umd.cjs +150 -146
- package/{markdown.element-CNp4wbg9.js → markdown.element-p-kC47D7.js} +22 -21
- package/{number.element-B6TsvHMK.js → number.element-CBr47IiY.js} +20 -18
- package/numeric-jmOOKz30.js +12 -0
- package/package.json +6 -6
- package/{range-calendar-9skwbwlB.js → range-calendar-CBINu84w.js} +54 -54
- package/{range-calendar.element-QTE6vGNP.js → range-calendar.element-_1bHW_c1.js} +1 -1
- package/{range-date-input-Uy8134vi.js → range-date-input-BYXzqnr1.js} +26 -26
- package/{range-date-input.element-Dj29D_OQ.js → range-date-input.element-BqzAF0O3.js} +1 -1
- package/{range-date-picker.element-CuKIBkIO.js → range-date-picker.element-BCBefgvY.js} +2 -2
- package/{textarea.element-Cu9ZW3K4.js → textarea.element-HThYqdR_.js} +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 1.0.2 (2026-06-26)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for gui-lit to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 1.0.1 (2026-06-15)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for gui-lit to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
1
9
|
# 1.0.0 (2026-06-14)
|
|
2
10
|
|
|
3
11
|
### 🚀 Features
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as o, state as
|
|
3
|
-
import { G as
|
|
1
|
+
import { LitElement as S, nothing as _, html as d } from "lit";
|
|
2
|
+
import { property as o, state as x } from "lit/decorators.js";
|
|
3
|
+
import { G as A, b as $, c as I } from "./templates-Dk1jxLwS.js";
|
|
4
4
|
import { repeat as D } from "lit-html/directives/repeat.js";
|
|
5
|
-
import { d as
|
|
6
|
-
var
|
|
5
|
+
import { d as k, e as B, p as w, t as v, w as Y } from "./date-CDUlLuYy.js";
|
|
6
|
+
var O = Object.defineProperty, s = (m, t, r, a) => {
|
|
7
7
|
for (var e = void 0, n = m.length - 1, l; n >= 0; n--)
|
|
8
8
|
(l = m[n]) && (e = l(t, r, e) || e);
|
|
9
|
-
return e &&
|
|
9
|
+
return e && O(t, r, e), e;
|
|
10
10
|
};
|
|
11
|
-
class i extends
|
|
11
|
+
class i extends S {
|
|
12
12
|
constructor() {
|
|
13
|
-
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._currentDate = /* @__PURE__ */ new Date(), this._yearSelectorOpen = !1, this.ariaController = new
|
|
13
|
+
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._currentDate = /* @__PURE__ */ new Date(), this._yearSelectorOpen = !1, this.ariaController = new A(this, {
|
|
14
14
|
getTargets: () => this.querySelectorAll(".gui-calendar-input"),
|
|
15
15
|
getState: () => ({
|
|
16
16
|
uid: this.uid,
|
|
@@ -37,7 +37,7 @@ class i extends M {
|
|
|
37
37
|
required: this.required
|
|
38
38
|
}, r = Array.from({ length: this.numberOfMonths ?? 1 }, (a, e) => e);
|
|
39
39
|
return d`
|
|
40
|
-
${this.label ?
|
|
40
|
+
${this.label ? $(this.uid, t, !1, "calendar") : _}
|
|
41
41
|
|
|
42
42
|
<div class="gui-widget" @focusout=${this.onFocusOut}>
|
|
43
43
|
<div
|
|
@@ -102,14 +102,14 @@ class i extends M {
|
|
|
102
102
|
</div>
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
|
-
${this.errors?.length ?
|
|
105
|
+
${this.errors?.length ? I(this.uid, t) : _}
|
|
106
106
|
`;
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Render a month panel
|
|
110
110
|
*/
|
|
111
111
|
renderMonthPanel(t) {
|
|
112
|
-
const r = this.getDaysInMonth(t), a = this.chunkDays(r), e =
|
|
112
|
+
const r = this.getDaysInMonth(t), a = this.chunkDays(r), e = k(this.localeId), n = new Date(this._currentDate);
|
|
113
113
|
return n.setDate(1), n.setMonth(n.getMonth() + t), d`
|
|
114
114
|
<div class="gui-calendar__panel">
|
|
115
115
|
${this.renderHeader(n)}
|
|
@@ -141,7 +141,7 @@ class i extends M {
|
|
|
141
141
|
`;
|
|
142
142
|
}
|
|
143
143
|
renderHeader(t) {
|
|
144
|
-
const r =
|
|
144
|
+
const r = B(this.localeId, t, this.monthFormat);
|
|
145
145
|
return d`
|
|
146
146
|
<header class="gui-calendar__header">
|
|
147
147
|
<h2>
|
|
@@ -279,10 +279,10 @@ class i extends M {
|
|
|
279
279
|
c >= 0 && c < a.length && a[c].focus();
|
|
280
280
|
}
|
|
281
281
|
get _effectiveMinYear() {
|
|
282
|
-
return this.minDate ?
|
|
282
|
+
return this.minDate ? w(this.minDate).getFullYear() : 1900;
|
|
283
283
|
}
|
|
284
284
|
get _effectiveMaxYear() {
|
|
285
|
-
return this.maxDate ?
|
|
285
|
+
return this.maxDate ? w(this.maxDate).getFullYear() : 2099;
|
|
286
286
|
}
|
|
287
287
|
get _yearList() {
|
|
288
288
|
const t = [];
|
|
@@ -350,7 +350,7 @@ class i extends M {
|
|
|
350
350
|
if (this.isButtonDisabled(h[g])) {
|
|
351
351
|
const y = this.findNextFocusableIndex(g, c, h);
|
|
352
352
|
if (y < 0 || y >= h.length) {
|
|
353
|
-
const f = h.findIndex((
|
|
353
|
+
const f = h.findIndex((M) => !this.isButtonDisabled(M));
|
|
354
354
|
f > -1 && h[f].focus();
|
|
355
355
|
} else
|
|
356
356
|
h[y]?.focus();
|
|
@@ -401,7 +401,7 @@ class i extends M {
|
|
|
401
401
|
this._currentDate = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
402
402
|
}
|
|
403
403
|
generateDateGrid(t = 0) {
|
|
404
|
-
const r = this._currentDate.getFullYear(), a = this._currentDate.getMonth() + t, e = new Date(r, a, 1), n = e.getDay(), l =
|
|
404
|
+
const r = this._currentDate.getFullYear(), a = this._currentDate.getMonth() + t, e = new Date(r, a, 1), n = e.getDay(), l = Y(this.localeId)[0], c = (n - l + 7) % 7, u = new Date(e);
|
|
405
405
|
u.setDate(e.getDate() - c);
|
|
406
406
|
const b = [];
|
|
407
407
|
for (let h = 0; h < 42; h++) {
|
|
@@ -535,10 +535,10 @@ s([
|
|
|
535
535
|
o({ type: Number })
|
|
536
536
|
], i.prototype, "numberOfMonths");
|
|
537
537
|
s([
|
|
538
|
-
|
|
538
|
+
x()
|
|
539
539
|
], i.prototype, "_currentDate");
|
|
540
540
|
s([
|
|
541
|
-
|
|
541
|
+
x()
|
|
542
542
|
], i.prototype, "_yearSelectorOpen");
|
|
543
543
|
export {
|
|
544
544
|
i as A
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { html as
|
|
2
|
-
import { property as
|
|
3
|
-
import { classMap as
|
|
4
|
-
import {
|
|
5
|
-
import { A as
|
|
6
|
-
var
|
|
7
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1
|
+
import { html as p } from "lit";
|
|
2
|
+
import { property as f, customElement as g } from "lit/decorators.js";
|
|
3
|
+
import { classMap as v } from "lit/directives/class-map.js";
|
|
4
|
+
import { p as c, i as d, t as b, b as M, a as C, g as _ } from "./date-CDUlLuYy.js";
|
|
5
|
+
import { A as y } from "./abstract-calendar-D0-077XJ.js";
|
|
6
|
+
var w = Object.defineProperty, O = Object.getOwnPropertyDescriptor, D = (e, t, n, r) => {
|
|
7
|
+
for (var i = r > 1 ? void 0 : r ? O(t, n) : t, s = e.length - 1, a; s >= 0; s--)
|
|
8
8
|
(a = e[s]) && (i = (r ? a(t, n, i) : a(i)) || i);
|
|
9
|
-
return r && i &&
|
|
9
|
+
return r && i && w(t, n, i), i;
|
|
10
10
|
};
|
|
11
|
-
let l = class extends
|
|
11
|
+
let l = class extends y {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this.value = void 0;
|
|
14
14
|
}
|
|
@@ -20,8 +20,8 @@ let l = class extends C {
|
|
|
20
20
|
}
|
|
21
21
|
willUpdate(e) {
|
|
22
22
|
if (e.has("value") && this.value) {
|
|
23
|
-
const t =
|
|
24
|
-
!isNaN(t.getTime()) && !
|
|
23
|
+
const t = c(this.value);
|
|
24
|
+
!isNaN(t.getTime()) && !d(t, this._currentDate, this.numberOfMonths ?? 1) && (this._currentDate = t);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
renderDay(e) {
|
|
@@ -32,14 +32,14 @@ let l = class extends C {
|
|
|
32
32
|
disabled: e.isDisabled,
|
|
33
33
|
"other-month": !e.isCurrentMonth
|
|
34
34
|
};
|
|
35
|
-
return
|
|
35
|
+
return p`
|
|
36
36
|
<button
|
|
37
37
|
type="button"
|
|
38
38
|
role="gridcell"
|
|
39
|
-
class=${
|
|
39
|
+
class=${v(t)}
|
|
40
40
|
tabindex=${e.isFocusable ? 0 : -1}
|
|
41
41
|
?disabled=${!e.isCurrentMonth || e.isDisabled}
|
|
42
|
-
data-date=${e.date
|
|
42
|
+
data-date=${b(e.date)}
|
|
43
43
|
@click=${() => this.selectDate(e)}
|
|
44
44
|
@keydown=${(n) => this.handleKeydown(n, e)}
|
|
45
45
|
aria-selected=${e.isSelected}
|
|
@@ -53,22 +53,22 @@ let l = class extends C {
|
|
|
53
53
|
t.setDate(1), t.setMonth(t.getMonth() + e);
|
|
54
54
|
const n = this.generateDateGrid(e), r = t.getMonth();
|
|
55
55
|
let i = n.map((s) => {
|
|
56
|
-
const a = s.getMonth() === r, o = this.isDisabled(s),
|
|
56
|
+
const a = s.getMonth() === r, o = this.isDisabled(s), u = !!this.value && M(s, c(this.value)), h = C(s), m = (u || h) && a;
|
|
57
57
|
return {
|
|
58
58
|
date: s,
|
|
59
|
-
dayLabel:
|
|
59
|
+
dayLabel: _(this.localeId, s),
|
|
60
60
|
isCurrentMonth: a,
|
|
61
|
-
isToday:
|
|
61
|
+
isToday: h,
|
|
62
62
|
isDisabled: o,
|
|
63
|
-
isSelected:
|
|
64
|
-
isFocusable:
|
|
63
|
+
isSelected: u,
|
|
64
|
+
isFocusable: m
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
67
|
for (let s = 0; s < 2; s++)
|
|
68
68
|
i.slice(-7).every((o) => !o.isCurrentMonth) && (i = i.slice(0, -7));
|
|
69
69
|
if (e === 0 && !i.some((s) => s.isFocusable)) {
|
|
70
|
-
const s = this.value ?
|
|
71
|
-
if (!
|
|
70
|
+
const s = this.value ? c(this.value) : /* @__PURE__ */ new Date();
|
|
71
|
+
if (!d(s, this._currentDate, this.numberOfMonths ?? 1)) {
|
|
72
72
|
const a = i.find((o) => o.isCurrentMonth && !o.isDisabled);
|
|
73
73
|
a && (a.isFocusable = !0);
|
|
74
74
|
}
|
|
@@ -77,7 +77,7 @@ let l = class extends C {
|
|
|
77
77
|
}
|
|
78
78
|
selectDate(e) {
|
|
79
79
|
if (!e.isCurrentMonth || e.isDisabled || this.disabled || this.readOnly) return;
|
|
80
|
-
const t =
|
|
80
|
+
const t = b(e.date);
|
|
81
81
|
this.value = t, this.dispatchEvent(
|
|
82
82
|
new CustomEvent("change", {
|
|
83
83
|
detail: { value: t },
|
|
@@ -87,10 +87,10 @@ let l = class extends C {
|
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
D([
|
|
91
|
+
f({ type: String })
|
|
92
92
|
], l.prototype, "value", 2);
|
|
93
|
-
l =
|
|
94
|
-
|
|
93
|
+
l = D([
|
|
94
|
+
g("gui-calendar")
|
|
95
95
|
], l);
|
|
96
96
|
typeof customElements < "u" && !customElements.get("gui-calendar") && customElements.define("gui-calendar", l);
|
|
@@ -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-BclCC9VJ.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";
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { InputWidgetAdapter as g, formContext as b, inputContext as v } from "@golemui/lit";
|
|
2
|
-
import { LitElement as m, nothing as p, html as
|
|
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
|
-
let
|
|
14
|
+
let i = class extends m {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = void 0, this.errors = [], this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.value = void 0, this.currency = void 0, this.step = void 0, this.maximumFractionDigits = void 0, this.minimumFractionDigits = void 0, this.hint = void 0, this.icon = void 0, this.placeholder = void 0, this.autocomplete = void 0, this.ariaController = new C(this, {
|
|
16
17
|
getTargets: () => this.querySelectorAll(`input[id="${this.uid}"]`),
|
|
@@ -55,11 +56,11 @@ let e = class extends m {
|
|
|
55
56
|
autocomplete: this.autocomplete
|
|
56
57
|
};
|
|
57
58
|
this.displayValue = this.formatCurrency(this.value);
|
|
58
|
-
const
|
|
59
|
+
const e = x("currency", t), o = {
|
|
59
60
|
"gui-widget-input": !0,
|
|
60
61
|
"gui-currency--icon": !!this.icon
|
|
61
62
|
};
|
|
62
|
-
return
|
|
63
|
+
return d`
|
|
63
64
|
${F(this.uid, t)}
|
|
64
65
|
|
|
65
66
|
<div class="gui-widget">
|
|
@@ -77,26 +78,30 @@ let e = 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
|
/>
|
|
83
|
-
${this.displayValue ?
|
|
86
|
+
${this.displayValue ? d`<label
|
|
84
87
|
for=${this.uid}
|
|
85
88
|
class="gui-currency__format-value ${this.icon ? "gui-currency__format-value--icon" : ""}"
|
|
86
89
|
>${this.displayValue}</label
|
|
87
90
|
>` : p}
|
|
88
|
-
${
|
|
91
|
+
${e.html}
|
|
89
92
|
</div>
|
|
90
93
|
|
|
91
|
-
${
|
|
94
|
+
${w(this.uid, t)}
|
|
92
95
|
`;
|
|
93
96
|
}
|
|
94
97
|
handleInput(t) {
|
|
95
98
|
if (t.stopPropagation(), !this.readOnly) {
|
|
96
|
-
const
|
|
97
|
-
this.displayValue = this.formatCurrency(
|
|
99
|
+
const e = t.target;
|
|
100
|
+
this.displayValue = this.formatCurrency(e.valueAsNumber);
|
|
101
|
+
const o = e.valueAsNumber;
|
|
102
|
+
this.dispatchEvent(
|
|
98
103
|
new CustomEvent("input", {
|
|
99
|
-
detail: { value:
|
|
104
|
+
detail: { value: Number.isNaN(o) ? void 0 : o },
|
|
100
105
|
bubbles: !0,
|
|
101
106
|
composed: !0
|
|
102
107
|
})
|
|
@@ -117,14 +122,15 @@ let e = class extends m {
|
|
|
117
122
|
formatCurrency(t) {
|
|
118
123
|
if (t === "" || t === void 0 || t === null || isNaN(t)) return "";
|
|
119
124
|
try {
|
|
125
|
+
const e = this.maximumFractionDigits ?? Math.max(this.minimumFractionDigits ?? 2, 2), o = Math.min(this.minimumFractionDigits ?? 2, e);
|
|
120
126
|
return new Intl.NumberFormat(this.localeId ?? "en", {
|
|
121
127
|
style: "currency",
|
|
122
128
|
currency: this.currency ?? "USD",
|
|
123
|
-
maximumFractionDigits:
|
|
124
|
-
minimumFractionDigits:
|
|
129
|
+
maximumFractionDigits: e,
|
|
130
|
+
minimumFractionDigits: o
|
|
125
131
|
}).format(t);
|
|
126
|
-
} catch (
|
|
127
|
-
return console.warn("Invalid locale or currency",
|
|
132
|
+
} catch (e) {
|
|
133
|
+
return console.warn("Invalid locale or currency", e), t.toString();
|
|
128
134
|
}
|
|
129
135
|
}
|
|
130
136
|
get separators() {
|
|
@@ -137,71 +143,71 @@ let e = class extends m {
|
|
|
137
143
|
};
|
|
138
144
|
r([
|
|
139
145
|
a({ type: String })
|
|
140
|
-
],
|
|
146
|
+
], i.prototype, "uid", 2);
|
|
141
147
|
r([
|
|
142
148
|
a({ type: String })
|
|
143
|
-
],
|
|
149
|
+
], i.prototype, "label", 2);
|
|
144
150
|
r([
|
|
145
151
|
a({ type: String, attribute: "locale-id" })
|
|
146
|
-
],
|
|
152
|
+
], i.prototype, "localeId", 2);
|
|
147
153
|
r([
|
|
148
154
|
a({ type: Array })
|
|
149
|
-
],
|
|
155
|
+
], i.prototype, "errors", 2);
|
|
150
156
|
r([
|
|
151
157
|
a({ type: Boolean })
|
|
152
|
-
],
|
|
158
|
+
], i.prototype, "touched", 2);
|
|
153
159
|
r([
|
|
154
160
|
a({ type: Boolean })
|
|
155
|
-
],
|
|
161
|
+
], i.prototype, "required", 2);
|
|
156
162
|
r([
|
|
157
163
|
a({ type: Boolean })
|
|
158
|
-
],
|
|
164
|
+
], i.prototype, "disabled", 2);
|
|
159
165
|
r([
|
|
160
166
|
a({ type: Boolean, attribute: "readonly" })
|
|
161
|
-
],
|
|
167
|
+
], i.prototype, "readOnly", 2);
|
|
162
168
|
r([
|
|
163
169
|
a({ type: String })
|
|
164
|
-
],
|
|
170
|
+
], i.prototype, "value", 2);
|
|
165
171
|
r([
|
|
166
172
|
a({ type: String })
|
|
167
|
-
],
|
|
173
|
+
], i.prototype, "currency", 2);
|
|
168
174
|
r([
|
|
169
175
|
a({ type: String })
|
|
170
|
-
],
|
|
176
|
+
], i.prototype, "step", 2);
|
|
171
177
|
r([
|
|
172
178
|
a({ type: String })
|
|
173
|
-
],
|
|
179
|
+
], i.prototype, "maximumFractionDigits", 2);
|
|
174
180
|
r([
|
|
175
181
|
a({ type: String })
|
|
176
|
-
],
|
|
182
|
+
], i.prototype, "minimumFractionDigits", 2);
|
|
177
183
|
r([
|
|
178
184
|
a({ type: String })
|
|
179
|
-
],
|
|
185
|
+
], i.prototype, "hint", 2);
|
|
180
186
|
r([
|
|
181
187
|
a({ type: String })
|
|
182
|
-
],
|
|
188
|
+
], i.prototype, "icon", 2);
|
|
183
189
|
r([
|
|
184
190
|
a({ type: String })
|
|
185
|
-
],
|
|
191
|
+
], i.prototype, "placeholder", 2);
|
|
186
192
|
r([
|
|
187
193
|
a({ type: String })
|
|
188
|
-
],
|
|
194
|
+
], i.prototype, "autocomplete", 2);
|
|
189
195
|
r([
|
|
190
196
|
f()
|
|
191
|
-
],
|
|
197
|
+
], i.prototype, "displayValue", 2);
|
|
192
198
|
r([
|
|
193
199
|
$("input")
|
|
194
|
-
],
|
|
195
|
-
|
|
200
|
+
], i.prototype, "inputElement", 2);
|
|
201
|
+
i = r([
|
|
196
202
|
y("gui-currency")
|
|
197
|
-
],
|
|
198
|
-
typeof customElements < "u" && !customElements.get("gui-currency") && customElements.define("gui-currency",
|
|
199
|
-
var
|
|
200
|
-
for (var s =
|
|
201
|
-
(u = t[
|
|
202
|
-
return
|
|
203
|
+
], i);
|
|
204
|
+
typeof customElements < "u" && !customElements.get("gui-currency") && customElements.define("gui-currency", i);
|
|
205
|
+
var q = Object.defineProperty, P = Object.getOwnPropertyDescriptor, h = (t, e, o, n) => {
|
|
206
|
+
for (var s = n > 1 ? void 0 : n ? P(e, o) : e, l = t.length - 1, u; l >= 0; l--)
|
|
207
|
+
(u = t[l]) && (s = (n ? u(e, o, s) : u(s)) || s);
|
|
208
|
+
return n && s && q(e, o, s), s;
|
|
203
209
|
};
|
|
204
|
-
let
|
|
210
|
+
let c = class extends m {
|
|
205
211
|
constructor() {
|
|
206
212
|
super(...arguments), this.adapter = new g(), this.subscriptions = [];
|
|
207
213
|
}
|
|
@@ -210,8 +216,8 @@ let d = class extends m {
|
|
|
210
216
|
}
|
|
211
217
|
updated(t) {
|
|
212
218
|
super.updated(t);
|
|
213
|
-
const
|
|
214
|
-
|
|
219
|
+
const e = this.adapter.templateData.size;
|
|
220
|
+
e ? this.style.flex = String(e) : this.style.removeProperty("flex");
|
|
215
221
|
}
|
|
216
222
|
connectedCallback() {
|
|
217
223
|
super.connectedCallback(), this.classList.add("gui-currency", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
@@ -219,7 +225,7 @@ let d = class extends m {
|
|
|
219
225
|
);
|
|
220
226
|
}
|
|
221
227
|
render() {
|
|
222
|
-
return super.render(),
|
|
228
|
+
return super.render(), d`
|
|
223
229
|
<gui-currency
|
|
224
230
|
.uid=${this.widget.uid}
|
|
225
231
|
.label=${this.adapter.templateData.label}
|
|
@@ -244,23 +250,23 @@ let d = class extends m {
|
|
|
244
250
|
`;
|
|
245
251
|
}
|
|
246
252
|
valueChanged(t) {
|
|
247
|
-
const
|
|
248
|
-
this.adapter.valueChanged(
|
|
253
|
+
const e = t.detail.value;
|
|
254
|
+
this.adapter.valueChanged(e);
|
|
249
255
|
}
|
|
250
256
|
disconnectedCallback() {
|
|
251
257
|
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
|
|
252
258
|
}
|
|
253
259
|
};
|
|
254
260
|
h([
|
|
255
|
-
|
|
261
|
+
E({ context: b }),
|
|
256
262
|
a({ attribute: !1 })
|
|
257
|
-
],
|
|
263
|
+
], c.prototype, "formContext", 2);
|
|
258
264
|
h([
|
|
259
|
-
|
|
260
|
-
],
|
|
261
|
-
|
|
265
|
+
I({ context: v })
|
|
266
|
+
], c.prototype, "adapter", 2);
|
|
267
|
+
c = h([
|
|
262
268
|
y("gui-currency-input")
|
|
263
|
-
],
|
|
269
|
+
], c);
|
|
264
270
|
export {
|
|
265
|
-
|
|
271
|
+
c as CurrencyElement
|
|
266
272
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const r = {
|
|
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 },
|
|
@@ -711,75 +711,80 @@ const t = {
|
|
|
711
711
|
zu: { firstDay: 7, weekend: [6, 7], minimalDays: 1 }
|
|
712
712
|
};
|
|
713
713
|
function y(e) {
|
|
714
|
-
const
|
|
715
|
-
return `${
|
|
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
716
|
}
|
|
717
|
-
function
|
|
718
|
-
|
|
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);
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
-
return e
|
|
721
|
+
function w(e) {
|
|
722
|
+
return f(e, /* @__PURE__ */ new Date());
|
|
722
723
|
}
|
|
723
|
-
function f(e) {
|
|
724
|
-
|
|
725
|
-
return [...i.slice(n), ...i.slice(0, n)];
|
|
724
|
+
function f(e, a) {
|
|
725
|
+
return e.getDate() === a.getDate() && e.getMonth() === a.getMonth() && e.getFullYear() === a.getFullYear();
|
|
726
726
|
}
|
|
727
727
|
function l(e) {
|
|
728
|
-
const
|
|
729
|
-
return
|
|
728
|
+
const a = [0, 1, 2, 3, 4, 5, 6], n = e % 7;
|
|
729
|
+
return [...a.slice(n), ...a.slice(0, n)];
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
const
|
|
733
|
-
return l(
|
|
731
|
+
function d(e) {
|
|
732
|
+
const a = r[e ?? "en"] || { firstDay: 0 };
|
|
733
|
+
return l(a.firstDay);
|
|
734
|
+
}
|
|
735
|
+
function o(e) {
|
|
736
|
+
const a = new Intl.DateTimeFormat(e, { weekday: "narrow" }), n = new Date(2025, 10, 30);
|
|
737
|
+
return d(e).map((i) => {
|
|
734
738
|
const s = new Date(n);
|
|
735
|
-
return s.setDate(n.getDate() +
|
|
739
|
+
return s.setDate(n.getDate() + i), a.format(s);
|
|
736
740
|
});
|
|
737
741
|
}
|
|
738
|
-
function
|
|
739
|
-
for (let
|
|
740
|
-
const s = new Date(
|
|
742
|
+
function u(e, a, n) {
|
|
743
|
+
for (let i = 0; i < n; i++) {
|
|
744
|
+
const s = new Date(a.getFullYear(), a.getMonth() + i, 1);
|
|
741
745
|
if (e.getMonth() === s.getMonth() && e.getFullYear() === s.getFullYear())
|
|
742
746
|
return !0;
|
|
743
747
|
}
|
|
744
748
|
return !1;
|
|
745
749
|
}
|
|
746
|
-
function g(e,
|
|
747
|
-
return new Intl.DateTimeFormat(e, { month: n, year: "numeric" }).formatToParts(
|
|
750
|
+
function g(e, a, n = "long") {
|
|
751
|
+
return new Intl.DateTimeFormat(e, { month: n, year: "numeric" }).formatToParts(a).filter((s) => s.type === "month" || s.type === "year");
|
|
748
752
|
}
|
|
749
|
-
function
|
|
750
|
-
const n = e || "en-US", m = new Intl.DateTimeFormat(n, { day: "numeric" }).formatToParts(
|
|
751
|
-
return m ? m.value :
|
|
753
|
+
function c(e, a) {
|
|
754
|
+
const n = e || "en-US", m = new Intl.DateTimeFormat(n, { day: "numeric" }).formatToParts(a).find((D) => D.type === "day");
|
|
755
|
+
return m ? m.value : a.getDate().toString();
|
|
752
756
|
}
|
|
753
|
-
function
|
|
754
|
-
const n = y(e),
|
|
755
|
-
return n ===
|
|
757
|
+
function k(e, a) {
|
|
758
|
+
const n = y(e), i = y(a);
|
|
759
|
+
return n === i ? { start: n } : { start: n, end: i };
|
|
756
760
|
}
|
|
757
|
-
function
|
|
758
|
-
return e.length ? e.map((
|
|
759
|
-
start:
|
|
760
|
-
end:
|
|
761
|
-
})).sort((
|
|
762
|
-
(
|
|
763
|
-
const m =
|
|
761
|
+
function b(e) {
|
|
762
|
+
return e.length ? e.map((i) => ({
|
|
763
|
+
start: t(i.start).getTime(),
|
|
764
|
+
end: t(i.end ?? i.start).getTime()
|
|
765
|
+
})).sort((i, s) => i.start - s.start).reduce(
|
|
766
|
+
(i, s) => {
|
|
767
|
+
const m = i[i.length - 1];
|
|
764
768
|
if (m) {
|
|
765
769
|
const D = new Date(m.end);
|
|
766
770
|
if (D.setDate(D.getDate() + 1), s.start <= D.getTime())
|
|
767
|
-
return m.end = Math.max(m.end, s.end),
|
|
771
|
+
return m.end = Math.max(m.end, s.end), i;
|
|
768
772
|
}
|
|
769
|
-
return [...
|
|
773
|
+
return [...i, s];
|
|
770
774
|
},
|
|
771
775
|
[]
|
|
772
|
-
).map((
|
|
776
|
+
).map((i) => k(new Date(i.start), new Date(i.end))) : [];
|
|
773
777
|
}
|
|
774
778
|
export {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
+
w as a,
|
|
780
|
+
f as b,
|
|
781
|
+
k as c,
|
|
782
|
+
o as d,
|
|
779
783
|
g as e,
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
784
|
+
c as g,
|
|
785
|
+
u as i,
|
|
786
|
+
b as m,
|
|
787
|
+
t as p,
|
|
783
788
|
y as t,
|
|
784
|
-
|
|
789
|
+
d as w
|
|
785
790
|
};
|
|
@@ -3,12 +3,12 @@ import { repeat as g } from "lit-html/directives/repeat.js";
|
|
|
3
3
|
import { property as l, state as p, customElement as m } from "lit/decorators.js";
|
|
4
4
|
import { classMap as _ } from "lit/directives/class-map.js";
|
|
5
5
|
import { live as f } from "lit/directives/live.js";
|
|
6
|
-
import { G as v, b as
|
|
7
|
-
import { t as w } from "./date-
|
|
8
|
-
var
|
|
9
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
6
|
+
import { G as v, b as S, c as A } from "./templates-Dk1jxLwS.js";
|
|
7
|
+
import { p as b, t as w } from "./date-CDUlLuYy.js";
|
|
8
|
+
var I = Object.defineProperty, D = Object.getOwnPropertyDescriptor, h = (t, e, a, i) => {
|
|
9
|
+
for (var r = i > 1 ? void 0 : i ? D(e, a) : e, n = t.length - 1, s; n >= 0; n--)
|
|
10
10
|
(s = t[n]) && (r = (i ? s(e, a, r) : s(r)) || r);
|
|
11
|
-
return i && r &&
|
|
11
|
+
return i && r && I(e, a, r), r;
|
|
12
12
|
};
|
|
13
13
|
let o = class extends y {
|
|
14
14
|
constructor() {
|
|
@@ -56,7 +56,7 @@ let o = class extends y {
|
|
|
56
56
|
[this.icon]: !0
|
|
57
57
|
};
|
|
58
58
|
return d`
|
|
59
|
-
${this.label ?
|
|
59
|
+
${this.label ? S(this.uid, t) : u}
|
|
60
60
|
|
|
61
61
|
<div class="gui-widget">
|
|
62
62
|
<div
|
|
@@ -86,7 +86,7 @@ let o = class extends y {
|
|
|
86
86
|
${this.icon ? d`<span class=${_(a)} data-icon=${this.icon}></span>` : u}
|
|
87
87
|
</div>
|
|
88
88
|
|
|
89
|
-
${this.showErrors && this.errors?.length ?
|
|
89
|
+
${this.showErrors && this.errors?.length ? A(this.uid, t) : u}
|
|
90
90
|
`;
|
|
91
91
|
}
|
|
92
92
|
renderInput(t, e, a, i, r) {
|
|
@@ -120,7 +120,7 @@ let o = class extends y {
|
|
|
120
120
|
this._day = "", this._month = "", this._year = "";
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
const e =
|
|
123
|
+
const e = b(t);
|
|
124
124
|
isNaN(e.getTime()) || (this._day = e.getDate().toString().padStart(2, "0"), this._month = (e.getMonth() + 1).toString().padStart(2, "0"), this._year = e.getFullYear().toString());
|
|
125
125
|
}
|
|
126
126
|
handleKeyDown(t) {
|