@golemui/gui-lit 0.16.2 → 0.17.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 +4 -0
- package/{abstract-calendar-YDgwwbqe.js → abstract-calendar-s67Qu3Nt.js} +32 -32
- package/{button.element-DxwYDdu6.js → button.element-DoQmGWze.js} +42 -37
- package/{calendar-P9DzVryu.js → calendar-aXb9yz-6.js} +1 -1
- package/{calendar.element-O2of7VBr.js → calendar.element-D7OF4QVV.js} +1 -1
- package/{date-input-D_Swskk4.js → date-input-5Heujc5X.js} +4 -1
- package/{date-picker.element-CP2_u_ZE.js → date-picker.element-DStQrD4x.js} +14 -8
- package/{date.element-p6aB6OGd.js → date.element-DymfLrlq.js} +1 -1
- package/index.js +12 -12
- package/index.umd.cjs +72 -78
- package/lib/components/date-picker.element.d.ts +1 -0
- package/{markdown.element-1IF3G5KX.js → markdown.element-BiAglcXP.js} +109 -105
- package/{number.element-zgd4L5hn.js → number.element-DlpxcOBs.js} +23 -39
- package/package.json +6 -6
- package/{pills-D0yyi-op.js → pills-B66qz_KX.js} +6 -6
- package/{radiogroup.element-DzHLgRh1.js → radiogroup.element-tdHrN9V5.js} +1 -1
- package/{range-calendar-CZGBBOzO.js → range-calendar-DUoIqmOA.js} +3 -5
- package/{range-calendar.element-DQZXvd-L.js → range-calendar.element-D6FO7HpL.js} +1 -1
- package/{range-date-input-CcPYH7P3.js → range-date-input-CoFG7Qem.js} +2 -4
- package/{range-date-input.element-v71P-oUp.js → range-date-input.element-Cjl1vZfr.js} +1 -1
- package/{range-date-picker.element-CA-KcQhA.js → range-date-picker.element-DqjOBKoT.js} +2 -2
- package/{select.element-CjWqp9dd.js → select.element-Y9i1tsl-.js} +4 -4
- package/{tags.element-ed1_51GA.js → tags.element-B3JP4m0z.js} +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LitElement as M, nothing as _, html as
|
|
1
|
+
import { LitElement as M, nothing as _, html as d } from "lit";
|
|
2
2
|
import { property as o, state as w } from "lit/decorators.js";
|
|
3
|
-
import { G as S, b as
|
|
3
|
+
import { G as S, b as A, c as $ } from "./templates-Dk1jxLwS.js";
|
|
4
4
|
import { repeat as D } from "lit-html/directives/repeat.js";
|
|
5
5
|
import { d as I, e as k, t as v, w as B } from "./date-CG1562vW.js";
|
|
6
6
|
import "@golemui/gui-shared";
|
|
@@ -37,8 +37,8 @@ class i extends M {
|
|
|
37
37
|
touched: this.touched,
|
|
38
38
|
required: this.required
|
|
39
39
|
}, r = Array.from({ length: this.numberOfMonths ?? 1 }, (a, e) => e);
|
|
40
|
-
return
|
|
41
|
-
${this.label ?
|
|
40
|
+
return d`
|
|
41
|
+
${this.label ? A(this.uid, t, !1, "calendar") : _}
|
|
42
42
|
|
|
43
43
|
<div class="gui-widget" @focusout=${this.onFocusOut}>
|
|
44
44
|
<div
|
|
@@ -58,10 +58,10 @@ class i extends M {
|
|
|
58
58
|
@click=${this.prevMonth}
|
|
59
59
|
aria-label=${this.prevMonthAriaLabel ?? "Previous month"}
|
|
60
60
|
>
|
|
61
|
-
${this.prevMonthIcon ?
|
|
61
|
+
${this.prevMonthIcon ? d`<span
|
|
62
62
|
class=${`gui-widget-icon ${this.prevMonthIcon}`}
|
|
63
63
|
data-icon=${this.prevMonthIcon}
|
|
64
|
-
></span>` : "
|
|
64
|
+
></span>` : d`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256"><path d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"></path></svg>`}
|
|
65
65
|
</button>
|
|
66
66
|
|
|
67
67
|
<div class="gui-calendar__months-grid">
|
|
@@ -76,16 +76,16 @@ class i extends M {
|
|
|
76
76
|
@click=${this.nextMonth}
|
|
77
77
|
aria-label=${this.nextMonthAriaLabel ?? "Next month"}
|
|
78
78
|
>
|
|
79
|
-
${this.nextMonthIcon ?
|
|
79
|
+
${this.nextMonthIcon ? d`<span
|
|
80
80
|
class=${`gui-widget-icon ${this.nextMonthIcon}`}
|
|
81
81
|
data-icon=${this.nextMonthIcon}
|
|
82
|
-
></span>` : "
|
|
82
|
+
></span>` : d`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"></path></svg>`}
|
|
83
83
|
</button>
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
86
86
|
</div>
|
|
87
87
|
|
|
88
|
-
${this.errors?.length ?
|
|
88
|
+
${this.errors?.length ? $(this.uid, t) : _}
|
|
89
89
|
`;
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
@@ -93,22 +93,22 @@ class i extends M {
|
|
|
93
93
|
*/
|
|
94
94
|
renderMonthPanel(t) {
|
|
95
95
|
const r = this.getDaysInMonth(t), a = this.chunkDays(r), e = I(this.localeId), n = new Date(this._currentDate);
|
|
96
|
-
return n.setDate(1), n.setMonth(n.getMonth() + t),
|
|
96
|
+
return n.setDate(1), n.setMonth(n.getMonth() + t), d`
|
|
97
97
|
<div class="gui-calendar__panel">
|
|
98
98
|
${this.renderHeader(n)}
|
|
99
|
-
${this._yearSelectorOpen && t === 0 ? this.renderYearGrid() :
|
|
99
|
+
${this._yearSelectorOpen && t === 0 ? this.renderYearGrid() : d`
|
|
100
100
|
<div class="gui-calendar__days-grid" role="grid">
|
|
101
101
|
<div role="row" class="gui-calendar__rows">
|
|
102
102
|
${D(
|
|
103
103
|
e,
|
|
104
104
|
(l, c) => c,
|
|
105
|
-
(l) =>
|
|
105
|
+
(l) => d`<span class="gui-calendar__weekday" role="gridcell">${l}</span>`
|
|
106
106
|
)}
|
|
107
107
|
</div>
|
|
108
108
|
|
|
109
109
|
${D(
|
|
110
110
|
a,
|
|
111
|
-
(l) =>
|
|
111
|
+
(l) => d`
|
|
112
112
|
<div role="row" class="gui-calendar__rows">
|
|
113
113
|
${D(
|
|
114
114
|
l,
|
|
@@ -125,11 +125,11 @@ class i extends M {
|
|
|
125
125
|
}
|
|
126
126
|
renderHeader(t) {
|
|
127
127
|
const r = k(this.localeId, t, this.monthFormat);
|
|
128
|
-
return
|
|
128
|
+
return d`
|
|
129
129
|
<header class="gui-calendar__header">
|
|
130
130
|
<h2>
|
|
131
131
|
${r.map(
|
|
132
|
-
(a) => a.type === "year" ?
|
|
132
|
+
(a) => a.type === "year" ? d`<button
|
|
133
133
|
type="button"
|
|
134
134
|
tabindex="0"
|
|
135
135
|
class="gui-calendar__year-selector"
|
|
@@ -150,7 +150,7 @@ class i extends M {
|
|
|
150
150
|
></path>
|
|
151
151
|
</svg>
|
|
152
152
|
</span>
|
|
153
|
-
</button>` :
|
|
153
|
+
</button>` : d`<span class="gui-calendar__month-name">${a.value}</span>`
|
|
154
154
|
)}
|
|
155
155
|
</h2>
|
|
156
156
|
</header>
|
|
@@ -158,7 +158,7 @@ class i extends M {
|
|
|
158
158
|
}
|
|
159
159
|
renderYearGrid() {
|
|
160
160
|
const t = this._currentDate.getFullYear(), r = this._yearList;
|
|
161
|
-
return
|
|
161
|
+
return d`
|
|
162
162
|
<div
|
|
163
163
|
class="gui-calendar__year-grid"
|
|
164
164
|
role="grid"
|
|
@@ -166,10 +166,10 @@ class i extends M {
|
|
|
166
166
|
@keydown=${this.handleYearKeydown}
|
|
167
167
|
>
|
|
168
168
|
${this.chunkYears(r).map(
|
|
169
|
-
(a) =>
|
|
169
|
+
(a) => d`
|
|
170
170
|
<div role="row" class="gui-calendar__year-row">
|
|
171
171
|
${a.map(
|
|
172
|
-
(e) =>
|
|
172
|
+
(e) => d`
|
|
173
173
|
<button
|
|
174
174
|
type="button"
|
|
175
175
|
role="gridcell"
|
|
@@ -246,8 +246,8 @@ class i extends M {
|
|
|
246
246
|
case "Enter":
|
|
247
247
|
case " ": {
|
|
248
248
|
t.preventDefault();
|
|
249
|
-
const
|
|
250
|
-
isNaN(
|
|
249
|
+
const u = parseInt(r.dataset.year ?? "", 10);
|
|
250
|
+
isNaN(u) || this.selectYear(u);
|
|
251
251
|
return;
|
|
252
252
|
}
|
|
253
253
|
case "Escape": {
|
|
@@ -298,16 +298,16 @@ class i extends M {
|
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
t.preventDefault();
|
|
301
|
-
const
|
|
301
|
+
const u = this.findNextFocusableIndex(n, c, e);
|
|
302
302
|
let b = !1;
|
|
303
|
-
if (
|
|
303
|
+
if (u < 0)
|
|
304
304
|
if (this.canGoPrev())
|
|
305
305
|
this.prevMonth(), b = !0;
|
|
306
306
|
else {
|
|
307
307
|
e.find((p) => !this.isButtonDisabled(p))?.focus();
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
|
-
else if (
|
|
310
|
+
else if (u >= e.length)
|
|
311
311
|
if (this.canGoNext())
|
|
312
312
|
this.nextMonth(), b = !0;
|
|
313
313
|
else {
|
|
@@ -320,15 +320,15 @@ class i extends M {
|
|
|
320
320
|
this.querySelectorAll(".gui-calendar__day-button:not(.other-month)")
|
|
321
321
|
), p = Array.from(this.querySelectorAll(".gui-calendar__panel"));
|
|
322
322
|
let g;
|
|
323
|
-
if (
|
|
323
|
+
if (u < 0)
|
|
324
324
|
g = p[0].querySelectorAll(
|
|
325
325
|
".gui-calendar__day-button:not(.other-month)"
|
|
326
|
-
).length +
|
|
326
|
+
).length + u;
|
|
327
327
|
else {
|
|
328
328
|
const f = p[p.length - 1].querySelectorAll(
|
|
329
329
|
".gui-calendar__day-button:not(.other-month)"
|
|
330
330
|
).length;
|
|
331
|
-
g = h.length - f + (
|
|
331
|
+
g = h.length - f + (u - e.length);
|
|
332
332
|
}
|
|
333
333
|
if (this.isButtonDisabled(h[g])) {
|
|
334
334
|
const y = this.findNextFocusableIndex(g, c, h);
|
|
@@ -342,7 +342,7 @@ class i extends M {
|
|
|
342
342
|
h[y]?.focus();
|
|
343
343
|
}
|
|
344
344
|
} else
|
|
345
|
-
e[
|
|
345
|
+
e[u]?.focus();
|
|
346
346
|
}
|
|
347
347
|
/**
|
|
348
348
|
* Splits an array of calendar days into chunks of weeks, with each week consisting of up to 7 days.
|
|
@@ -384,12 +384,12 @@ class i extends M {
|
|
|
384
384
|
this._currentDate = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
385
385
|
}
|
|
386
386
|
generateDateGrid(t = 0) {
|
|
387
|
-
const r = this._currentDate.getFullYear(), a = this._currentDate.getMonth() + t, e = new Date(r, a, 1), n = e.getDay(), l = B(this.localeId)[0], c = (n - l + 7) % 7,
|
|
388
|
-
|
|
387
|
+
const r = this._currentDate.getFullYear(), a = this._currentDate.getMonth() + t, e = new Date(r, a, 1), n = e.getDay(), l = B(this.localeId)[0], c = (n - l + 7) % 7, u = new Date(e);
|
|
388
|
+
u.setDate(e.getDate() - c);
|
|
389
389
|
const b = [];
|
|
390
390
|
for (let h = 0; h < 42; h++) {
|
|
391
|
-
const p = new Date(
|
|
392
|
-
p.setDate(
|
|
391
|
+
const p = new Date(u);
|
|
392
|
+
p.setDate(u.getDate() + h), b.push(p);
|
|
393
393
|
}
|
|
394
394
|
return b;
|
|
395
395
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ActionWidgetAdapter as f, formContext as g, actionContext as
|
|
2
|
-
import { consume as
|
|
3
|
-
import { LitElement as b, html as u, nothing as
|
|
4
|
-
import { property as
|
|
1
|
+
import { ActionWidgetAdapter as f, formContext as g, actionContext as v } from "@golemui/lit";
|
|
2
|
+
import { consume as y, provide as $ } from "@lit/context";
|
|
3
|
+
import { LitElement as b, html as u, nothing as c } from "lit";
|
|
4
|
+
import { property as s, customElement as m } from "lit/decorators.js";
|
|
5
5
|
import "rxjs";
|
|
6
6
|
import "@golemui/gui-shared";
|
|
7
7
|
import { classMap as P } from "lit/directives/class-map.js";
|
|
8
8
|
var C = Object.defineProperty, x = Object.getOwnPropertyDescriptor, r = (i, t, n, o) => {
|
|
9
|
-
for (var e = o > 1 ? void 0 : o ? x(t, n) : t, p = i.length - 1,
|
|
10
|
-
(
|
|
9
|
+
for (var e = o > 1 ? void 0 : o ? x(t, n) : t, p = i.length - 1, l; p >= 0; p--)
|
|
10
|
+
(l = i[p]) && (e = (o ? l(t, n, e) : l(e)) || e);
|
|
11
11
|
return o && e && C(t, n, e), e;
|
|
12
12
|
};
|
|
13
|
-
let
|
|
13
|
+
let a = class extends b {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(...arguments), this.uid = void 0, this.label = void 0, this.disabled = !1, this.icon = void 0, this.variant = "filled", this.iconPosition = "left", this.actionType = "button";
|
|
15
|
+
super(...arguments), this.uid = void 0, this.label = void 0, this.disabled = !1, this.icon = void 0, this.variant = "filled", this.iconPosition = "left", this.actionType = "button", this.invalid = !1;
|
|
16
16
|
}
|
|
17
17
|
createRenderRoot() {
|
|
18
18
|
return this;
|
|
@@ -25,8 +25,9 @@ let s = class extends b {
|
|
|
25
25
|
"gui-button-with-icon": !!i,
|
|
26
26
|
[`gui-button-icon-${t}`]: !0,
|
|
27
27
|
"gui-button--outlined": this.variant === "outlined",
|
|
28
|
-
"gui-button--link": this.variant === "link"
|
|
29
|
-
|
|
28
|
+
"gui-button--link": this.variant === "link",
|
|
29
|
+
"gui-button--invalid": this.invalid && this.actionType === "submit"
|
|
30
|
+
}, o = i ? u`<span class="gui-widget-icon gui-button-icon ${i}" data-icon=${i}></span>` : c;
|
|
30
31
|
return u`
|
|
31
32
|
<div class="gui-widget">
|
|
32
33
|
<button
|
|
@@ -37,43 +38,46 @@ let s = class extends b {
|
|
|
37
38
|
data-cy=${`${this.uid}_button`}
|
|
38
39
|
?disabled=${this.disabled}
|
|
39
40
|
>
|
|
40
|
-
${t === "left" ? o :
|
|
41
|
-
${this.label ? u`<span>${this.label}</span>` :
|
|
42
|
-
${t === "right" ? o :
|
|
41
|
+
${t === "left" ? o : c}
|
|
42
|
+
${this.label ? u`<span>${this.label}</span>` : c}
|
|
43
|
+
${t === "right" ? o : c}
|
|
43
44
|
</button>
|
|
44
45
|
</div>
|
|
45
46
|
`;
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
49
|
r([
|
|
49
|
-
|
|
50
|
-
],
|
|
50
|
+
s({ type: String })
|
|
51
|
+
], a.prototype, "uid", 2);
|
|
51
52
|
r([
|
|
52
|
-
|
|
53
|
-
],
|
|
53
|
+
s({ type: String })
|
|
54
|
+
], a.prototype, "label", 2);
|
|
54
55
|
r([
|
|
55
|
-
|
|
56
|
-
],
|
|
56
|
+
s({ type: Boolean })
|
|
57
|
+
], a.prototype, "disabled", 2);
|
|
57
58
|
r([
|
|
58
|
-
|
|
59
|
-
],
|
|
59
|
+
s({ type: String })
|
|
60
|
+
], a.prototype, "icon", 2);
|
|
60
61
|
r([
|
|
61
|
-
|
|
62
|
-
],
|
|
62
|
+
s({ type: String })
|
|
63
|
+
], a.prototype, "variant", 2);
|
|
63
64
|
r([
|
|
64
|
-
|
|
65
|
-
],
|
|
65
|
+
s({ type: String })
|
|
66
|
+
], a.prototype, "iconPosition", 2);
|
|
66
67
|
r([
|
|
67
|
-
|
|
68
|
-
],
|
|
69
|
-
|
|
68
|
+
s({ type: String })
|
|
69
|
+
], a.prototype, "actionType", 2);
|
|
70
|
+
r([
|
|
71
|
+
s({ type: Boolean })
|
|
72
|
+
], a.prototype, "invalid", 2);
|
|
73
|
+
a = r([
|
|
70
74
|
m("gui-button")
|
|
71
|
-
],
|
|
72
|
-
typeof customElements < "u" && !customElements.get("gui-button") && customElements.define("gui-button",
|
|
73
|
-
var
|
|
74
|
-
for (var e = o > 1 ? void 0 : o ?
|
|
75
|
-
(
|
|
76
|
-
return o && e &&
|
|
75
|
+
], a);
|
|
76
|
+
typeof customElements < "u" && !customElements.get("gui-button") && customElements.define("gui-button", a);
|
|
77
|
+
var D = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, h = (i, t, n, o) => {
|
|
78
|
+
for (var e = o > 1 ? void 0 : o ? _(t, n) : t, p = i.length - 1, l; p >= 0; p--)
|
|
79
|
+
(l = i[p]) && (e = (o ? l(t, n, e) : l(e)) || e);
|
|
80
|
+
return o && e && D(t, n, e), e;
|
|
77
81
|
};
|
|
78
82
|
let d = class extends b {
|
|
79
83
|
constructor() {
|
|
@@ -99,6 +103,7 @@ let d = class extends b {
|
|
|
99
103
|
.actionType=${this.adapter.templateData.actionType ?? "button"}
|
|
100
104
|
.label=${this.adapter.templateData.label}
|
|
101
105
|
?disabled=${this.adapter.templateData.disabled === !0}
|
|
106
|
+
?invalid=${this.adapter.templateData.invalid === !0}
|
|
102
107
|
.variant=${this.adapter.templateData.variant}
|
|
103
108
|
.icon=${this.adapter.templateData.icon}
|
|
104
109
|
.iconPosition=${this.adapter.templateData.iconPosition}
|
|
@@ -111,11 +116,11 @@ let d = class extends b {
|
|
|
111
116
|
}
|
|
112
117
|
};
|
|
113
118
|
h([
|
|
114
|
-
|
|
115
|
-
|
|
119
|
+
y({ context: g }),
|
|
120
|
+
s({ attribute: !1 })
|
|
116
121
|
], d.prototype, "formContext", 2);
|
|
117
122
|
h([
|
|
118
|
-
$({ context:
|
|
123
|
+
$({ context: v })
|
|
119
124
|
], d.prototype, "adapter", 2);
|
|
120
125
|
d = h([
|
|
121
126
|
m("gui-button-interactive")
|
|
@@ -2,7 +2,7 @@ import { html as D } from "lit";
|
|
|
2
2
|
import { property as m, customElement as f } from "lit/decorators.js";
|
|
3
3
|
import { classMap as p } from "lit/directives/class-map.js";
|
|
4
4
|
import { i as h, b as g, a as v, g as M, t as w } from "./date-CG1562vW.js";
|
|
5
|
-
import { A as C } from "./abstract-calendar-
|
|
5
|
+
import { A as C } from "./abstract-calendar-s67Qu3Nt.js";
|
|
6
6
|
var _ = Object.defineProperty, y = Object.getOwnPropertyDescriptor, d = (e, t, n, r) => {
|
|
7
7
|
for (var i = r > 1 ? void 0 : r ? y(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);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputWidgetAdapter as o, formContext as l, inputContext as h } from "@golemui/lit";
|
|
2
2
|
import "@golemui/gui-shared";
|
|
3
|
-
import "./calendar-
|
|
3
|
+
import "./calendar-aXb9yz-6.js";
|
|
4
4
|
import { consume as m, provide as u } from "@lit/context";
|
|
5
5
|
import { LitElement as c, html as D } from "lit";
|
|
6
6
|
import { property as b, customElement as $ } from "lit/decorators.js";
|
|
@@ -60,7 +60,10 @@ let o = class extends y {
|
|
|
60
60
|
${this.label ? A(this.uid, t) : u}
|
|
61
61
|
|
|
62
62
|
<div class="gui-widget">
|
|
63
|
-
<div
|
|
63
|
+
<div
|
|
64
|
+
class="gui-widget-input gui-date-input ${this.icon ? "gui-calendar--icon" : ""}"
|
|
65
|
+
role="group"
|
|
66
|
+
>
|
|
64
67
|
${g(
|
|
65
68
|
e,
|
|
66
69
|
(i) => i.type,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { InputWidgetAdapter as h, formContext as u, inputContext as c } from "@golemui/lit";
|
|
2
2
|
import { a as m, b as g, c as C } from "./templates-Dk1jxLwS.js";
|
|
3
3
|
import "@golemui/gui-shared";
|
|
4
|
-
import "./date-input-
|
|
5
|
-
import "./calendar-
|
|
4
|
+
import "./date-input-5Heujc5X.js";
|
|
5
|
+
import "./calendar-aXb9yz-6.js";
|
|
6
6
|
import { consume as D, provide as $ } from "@lit/context";
|
|
7
|
-
import { LitElement as v, html as
|
|
7
|
+
import { LitElement as v, html as p, nothing as f } from "lit";
|
|
8
8
|
import { property as b, query as o, state as y, customElement as I } from "lit/decorators.js";
|
|
9
9
|
import "rxjs";
|
|
10
10
|
import { classMap as O } from "lit/directives/class-map.js";
|
|
11
11
|
var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, n = (e, t, a, i) => {
|
|
12
|
-
for (var r = i > 1 ? void 0 : i ? x(t, a) : t, d = e.length - 1,
|
|
13
|
-
(
|
|
12
|
+
for (var r = i > 1 ? void 0 : i ? x(t, a) : t, d = e.length - 1, l; d >= 0; d--)
|
|
13
|
+
(l = e[d]) && (r = (i ? l(t, a, r) : l(r)) || r);
|
|
14
14
|
return i && r && w(t, a, r), r;
|
|
15
15
|
};
|
|
16
16
|
let s = class extends v {
|
|
@@ -40,7 +40,7 @@ let s = class extends v {
|
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
42
|
super.render();
|
|
43
|
-
const e = m("datePicker", this.adapter.templateData), t = this.isCalendarOpen ?
|
|
43
|
+
const e = m("datePicker", this.adapter.templateData), t = this.isCalendarOpen ? p`<gui-calendar
|
|
44
44
|
id="calendar-input"
|
|
45
45
|
.uid=${this.widget.uid}
|
|
46
46
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -62,9 +62,9 @@ let s = class extends v {
|
|
|
62
62
|
.numberOfMonths=${this.adapter.templateData.numberOfMonths}
|
|
63
63
|
.localeId=${this.adapter.templateData.lang}
|
|
64
64
|
@blur=${this.onBlurCalendar}
|
|
65
|
-
@change=${this.
|
|
65
|
+
@change=${this.onCalendarChange}
|
|
66
66
|
></gui-calendar>` : f;
|
|
67
|
-
return
|
|
67
|
+
return p`
|
|
68
68
|
${g(this.widget.uid, {
|
|
69
69
|
...this.adapter.templateData,
|
|
70
70
|
required: this.adapter.templateData.validator?.required
|
|
@@ -113,6 +113,12 @@ let s = class extends v {
|
|
|
113
113
|
valueChanged(e) {
|
|
114
114
|
this.adapter.injectValidationIssues(null), this.adapter.valueChanged(e.detail.value);
|
|
115
115
|
}
|
|
116
|
+
// Selecting a day in the calendar commits a single date, so close the
|
|
117
|
+
// calendar afterwards. The range picker intentionally stays open so the user
|
|
118
|
+
// can select multiple ranges and closes it themselves.
|
|
119
|
+
onCalendarChange(e) {
|
|
120
|
+
this.valueChanged(e), this.closeCalendar();
|
|
121
|
+
}
|
|
116
122
|
onBlurCalendar() {
|
|
117
123
|
this.adapter.onBlur(), this.closeCalendar();
|
|
118
124
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputWidgetAdapter as l, formContext as n, inputContext as u } from "@golemui/lit";
|
|
2
2
|
import { a as h } from "./templates-Dk1jxLwS.js";
|
|
3
3
|
import "@golemui/gui-shared";
|
|
4
|
-
import "./date-input-
|
|
4
|
+
import "./date-input-5Heujc5X.js";
|
|
5
5
|
import { consume as c, provide as m } from "@lit/context";
|
|
6
6
|
import { LitElement as f, html as b } from "lit";
|
|
7
7
|
import { property as g, customElement as D } from "lit/decorators.js";
|
package/index.js
CHANGED
|
@@ -3717,27 +3717,27 @@ function Y(e, t) {
|
|
|
3717
3717
|
}
|
|
3718
3718
|
const li = {
|
|
3719
3719
|
// ACTION
|
|
3720
|
-
button: async () => (await import("./button.element-
|
|
3720
|
+
button: async () => (await import("./button.element-DoQmGWze.js")).ButtonElement,
|
|
3721
3721
|
// INPUTS
|
|
3722
|
-
calendar: async () => (await import("./calendar.element-
|
|
3723
|
-
rangeCalendar: async () => (await import("./range-calendar.element-
|
|
3724
|
-
rangeDateInput: async () => (await import("./range-date-input.element-
|
|
3725
|
-
rangeDatePicker: async () => (await import("./range-date-picker.element-
|
|
3722
|
+
calendar: async () => (await import("./calendar.element-D7OF4QVV.js")).CalendarElement,
|
|
3723
|
+
rangeCalendar: async () => (await import("./range-calendar.element-D6FO7HpL.js")).RangeCalendarElement,
|
|
3724
|
+
rangeDateInput: async () => (await import("./range-date-input.element-Cjl1vZfr.js")).RangeDateInputElement,
|
|
3725
|
+
rangeDatePicker: async () => (await import("./range-date-picker.element-DqjOBKoT.js")).RangeDatePickerElement,
|
|
3726
3726
|
currency: async () => (await import("./currency.element-ybKzwXEh.js")).CurrencyElement,
|
|
3727
|
-
dateInput: async () => (await import("./date.element-
|
|
3728
|
-
datePicker: async () => (await import("./date-picker.element-
|
|
3727
|
+
dateInput: async () => (await import("./date.element-DymfLrlq.js")).DateElement,
|
|
3728
|
+
datePicker: async () => (await import("./date-picker.element-DStQrD4x.js")).DatePickerElement,
|
|
3729
3729
|
dropdown: async () => (await import("./dropdown.element-sbd3T145.js")).DropdownElement,
|
|
3730
3730
|
list: async () => (await import("./list.element-Bgnx2CN_.js")).ListElement,
|
|
3731
|
-
markdown: async () => (await import("./markdown.element-
|
|
3731
|
+
markdown: async () => (await import("./markdown.element-BiAglcXP.js")).MarkdownElement,
|
|
3732
3732
|
password: async () => (await import("./password.element-BT65mDsp.js")).PasswordElement,
|
|
3733
3733
|
textinput: async () => (await import("./textinput.element-zI0iG-Cq.js")).TextinputElement,
|
|
3734
3734
|
textarea: async () => (await import("./textarea.element-BTJLqnnI.js")).TextareaElement,
|
|
3735
3735
|
toggle: async () => (await import("./toggle.element-NXRrhALB.js")).ToggleElement,
|
|
3736
3736
|
checkbox: async () => (await import("./checkbox.element-DMmer4Jw.js")).CheckboxElement,
|
|
3737
|
-
number: async () => (await import("./number.element-
|
|
3738
|
-
radiogroup: async () => (await import("./radiogroup.element-
|
|
3739
|
-
select: async () => (await import("./select.element-
|
|
3740
|
-
tags: async () => (await import("./tags.element-
|
|
3737
|
+
number: async () => (await import("./number.element-DlpxcOBs.js")).NumberElement,
|
|
3738
|
+
radiogroup: async () => (await import("./radiogroup.element-tdHrN9V5.js")).RadiogroupElement,
|
|
3739
|
+
select: async () => (await import("./select.element-Y9i1tsl-.js")).SelectElement,
|
|
3740
|
+
tags: async () => (await import("./tags.element-B3JP4m0z.js")).TagsElement,
|
|
3741
3741
|
// REPEATER
|
|
3742
3742
|
repeater: async () => (await import("./repeater.element-Ry8HyMfW.js")).RepeaterElement,
|
|
3743
3743
|
// LAYOUTS
|