@golemui/gui-lit 0.16.2 → 1.0.0-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 +20 -0
- package/{abstract-calendar-YDgwwbqe.js → abstract-calendar-BoqKPRmS.js} +51 -34
- package/{accordion.element-ChLmV6QT.js → accordion.element-BIgxl5e9.js} +0 -1
- package/{alert.element-9QFlqjj9.js → alert.element-DPWq9-0F.js} +3 -4
- package/{button.element-DxwYDdu6.js → button.element-3a7rRHbA.js} +42 -38
- package/{calendar-P9DzVryu.js → calendar-DTYKVYc3.js} +2 -2
- package/{calendar.element-O2of7VBr.js → calendar.element-MubSE1bx.js} +11 -12
- package/{checkbox.element-DMmer4Jw.js → checkbox.element-CVskoXEc.js} +0 -1
- package/{currency.element-ybKzwXEh.js → currency.element-YyL4TeL0.js} +0 -1
- package/{date-CG1562vW.js → date-DTYg8sog.js} +12 -13
- package/{date-input-D_Swskk4.js → date-input-BeQvyfln.js} +5 -3
- package/{date-picker.element-CP2_u_ZE.js → date-picker.element-DabW_-0-.js} +14 -9
- package/{date.element-p6aB6OGd.js → date.element-BtVJSIRk.js} +1 -2
- package/{dropdown.element-sbd3T145.js → dropdown.element-DqzC6aXR.js} +1 -2
- package/{flex.element-B0sG0YT1.js → flex.element-DG4Uaj_X.js} +0 -1
- package/{grid.element-Bf5aEjkj.js → grid.element-DCZsh-3J.js} +0 -1
- package/index.js +1243 -1210
- package/index.umd.cjs +136 -116
- package/lib/components/accordion.element.d.ts +1 -1
- package/lib/components/alert.element.d.ts +1 -1
- package/lib/components/button.element.d.ts +1 -1
- package/lib/components/calendar.element.d.ts +1 -1
- package/lib/components/checkbox.element.d.ts +1 -1
- package/lib/components/currency.element.d.ts +1 -1
- package/lib/components/date-picker.element.d.ts +2 -1
- package/lib/components/date.element.d.ts +1 -1
- package/lib/components/dropdown.element.d.ts +1 -1
- package/lib/components/flex.element.d.ts +1 -1
- package/lib/components/grid.element.d.ts +1 -1
- package/lib/components/list.element.d.ts +1 -1
- package/lib/components/markdown-text.element.d.ts +1 -1
- package/lib/components/markdown.element.d.ts +1 -1
- package/lib/components/number.element.d.ts +1 -1
- package/lib/components/password.element.d.ts +1 -1
- package/lib/components/radiogroup.element.d.ts +1 -1
- package/lib/components/range-calendar.element.d.ts +1 -1
- package/lib/components/range-date-input.element.d.ts +1 -1
- package/lib/components/range-date-picker.element.d.ts +1 -1
- package/lib/components/renderer.element.d.ts +1 -1
- package/lib/components/repeater.element.d.ts +1 -1
- package/lib/components/select.element.d.ts +1 -1
- package/lib/components/tabs.element.d.ts +1 -1
- package/lib/components/tags.element.d.ts +1 -1
- package/lib/components/textarea.element.d.ts +1 -1
- package/lib/components/textinput.element.d.ts +1 -1
- package/lib/components/toggle.element.d.ts +1 -1
- package/lib/widget.loaders.d.ts +1 -1
- package/{list-CVDHuXKS.js → list-D1oKnH89.js} +2 -3
- package/{list.element-Bgnx2CN_.js → list.element-Co3V3Cn5.js} +9 -10
- package/{markdown-text.element-C_1OqrGa.js → markdown-text.element-B8TfVLIO.js} +0 -1
- package/{markdown.element-1IF3G5KX.js → markdown.element-CNp4wbg9.js} +109 -106
- package/{number.element-zgd4L5hn.js → number.element-B6TsvHMK.js} +31 -40
- package/{one-of-DifUsEYY.js → one-of-C0ur6b_n.js} +13 -11
- package/package.json +6 -6
- package/{password.element-BT65mDsp.js → password.element-n-R9RbkB.js} +0 -1
- package/{pills-D0yyi-op.js → pills-B66qz_KX.js} +6 -6
- package/{radiogroup.element-DzHLgRh1.js → radiogroup.element-CeQn623u.js} +6 -7
- package/{range-calendar-CZGBBOzO.js → range-calendar-9skwbwlB.js} +4 -7
- package/{range-calendar.element-DQZXvd-L.js → range-calendar.element-QTE6vGNP.js} +1 -2
- package/{range-date-input-CcPYH7P3.js → range-date-input-Uy8134vi.js} +3 -6
- package/{range-date-input.element-v71P-oUp.js → range-date-input.element-Dj29D_OQ.js} +1 -2
- package/{range-date-picker.element-CA-KcQhA.js → range-date-picker.element-BUUKtKkz.js} +2 -3
- package/{renderer.element-DMsheQGi.js → renderer.element-CNyMn2Lu.js} +0 -1
- package/{repeater.element-Ry8HyMfW.js → repeater.element-CtNgB4F5.js} +0 -1
- package/{select.element-CjWqp9dd.js → select.element-jcDF1h-g.js} +10 -11
- package/{tabs.element-VLrtF1j5.js → tabs.element-BvAyI71N.js} +0 -1
- package/{tags.element-ed1_51GA.js → tags.element-CX3vQL8L.js} +2 -5
- package/{textarea.element-BTJLqnnI.js → textarea.element-Cu9ZW3K4.js} +0 -1
- package/{textinput.element-zI0iG-Cq.js → textinput.element-CkXNzMUg.js} +0 -1
- package/{toggle.element-NXRrhALB.js → toggle.element-C1kCw5H8.js} +9 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 0.17.0 (2026-06-08)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **core:** validation-aware submit buttons ([#167](https://github.com/golemui/golemui/pull/167))
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- minor UI fixes and design updates ([#168](https://github.com/golemui/golemui/pull/168))
|
|
10
|
+
- **core:** clear `data` after an input widget is removed ([#157](https://github.com/golemui/golemui/pull/157))
|
|
11
|
+
|
|
12
|
+
### ❤️ Thank You
|
|
13
|
+
|
|
14
|
+
- Mud Scientist @mudscientist
|
|
15
|
+
- Raúl Jiménez @Elecash
|
|
16
|
+
|
|
17
|
+
## 0.16.2 (2026-05-30)
|
|
18
|
+
|
|
19
|
+
This was a version bump only for gui-lit to align it with other projects, there were no code changes.
|
|
20
|
+
|
|
1
21
|
## 0.16.1 (2026-05-30)
|
|
2
22
|
|
|
3
23
|
This was a version bump only for gui-lit to align it with other projects, there were no code changes.
|
|
@@ -1,9 +1,8 @@
|
|
|
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
|
-
import { d as I, e as k, t as v, w as B } from "./date-
|
|
6
|
-
import "@golemui/gui-shared";
|
|
5
|
+
import { d as I, e as k, t as v, w as B } from "./date-DTYg8sog.js";
|
|
7
6
|
var Y = Object.defineProperty, s = (m, t, r, a) => {
|
|
8
7
|
for (var e = void 0, n = m.length - 1, l; n >= 0; n--)
|
|
9
8
|
(l = m[n]) && (e = l(t, r, e) || e);
|
|
@@ -37,8 +36,8 @@ class i extends M {
|
|
|
37
36
|
touched: this.touched,
|
|
38
37
|
required: this.required
|
|
39
38
|
}, r = Array.from({ length: this.numberOfMonths ?? 1 }, (a, e) => e);
|
|
40
|
-
return
|
|
41
|
-
${this.label ?
|
|
39
|
+
return d`
|
|
40
|
+
${this.label ? A(this.uid, t, !1, "calendar") : _}
|
|
42
41
|
|
|
43
42
|
<div class="gui-widget" @focusout=${this.onFocusOut}>
|
|
44
43
|
<div
|
|
@@ -58,10 +57,19 @@ class i extends M {
|
|
|
58
57
|
@click=${this.prevMonth}
|
|
59
58
|
aria-label=${this.prevMonthAriaLabel ?? "Previous month"}
|
|
60
59
|
>
|
|
61
|
-
${this.prevMonthIcon ?
|
|
60
|
+
${this.prevMonthIcon ? d`<span
|
|
62
61
|
class=${`gui-widget-icon ${this.prevMonthIcon}`}
|
|
63
62
|
data-icon=${this.prevMonthIcon}
|
|
64
|
-
></span>` :
|
|
63
|
+
></span>` : d`<svg
|
|
64
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
65
|
+
width="16"
|
|
66
|
+
height="16"
|
|
67
|
+
viewBox="0 0 256 256"
|
|
68
|
+
>
|
|
69
|
+
<path
|
|
70
|
+
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"
|
|
71
|
+
></path>
|
|
72
|
+
</svg>`}
|
|
65
73
|
</button>
|
|
66
74
|
|
|
67
75
|
<div class="gui-calendar__months-grid">
|
|
@@ -76,16 +84,25 @@ class i extends M {
|
|
|
76
84
|
@click=${this.nextMonth}
|
|
77
85
|
aria-label=${this.nextMonthAriaLabel ?? "Next month"}
|
|
78
86
|
>
|
|
79
|
-
${this.nextMonthIcon ?
|
|
87
|
+
${this.nextMonthIcon ? d`<span
|
|
80
88
|
class=${`gui-widget-icon ${this.nextMonthIcon}`}
|
|
81
89
|
data-icon=${this.nextMonthIcon}
|
|
82
|
-
></span>` :
|
|
90
|
+
></span>` : d`<svg
|
|
91
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
92
|
+
width="16"
|
|
93
|
+
height="16"
|
|
94
|
+
viewBox="0 0 256 256"
|
|
95
|
+
>
|
|
96
|
+
<path
|
|
97
|
+
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"
|
|
98
|
+
></path>
|
|
99
|
+
</svg>`}
|
|
83
100
|
</button>
|
|
84
101
|
</div>
|
|
85
102
|
</div>
|
|
86
103
|
</div>
|
|
87
104
|
|
|
88
|
-
${this.errors?.length ?
|
|
105
|
+
${this.errors?.length ? $(this.uid, t) : _}
|
|
89
106
|
`;
|
|
90
107
|
}
|
|
91
108
|
/**
|
|
@@ -93,22 +110,22 @@ class i extends M {
|
|
|
93
110
|
*/
|
|
94
111
|
renderMonthPanel(t) {
|
|
95
112
|
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),
|
|
113
|
+
return n.setDate(1), n.setMonth(n.getMonth() + t), d`
|
|
97
114
|
<div class="gui-calendar__panel">
|
|
98
115
|
${this.renderHeader(n)}
|
|
99
|
-
${this._yearSelectorOpen && t === 0 ? this.renderYearGrid() :
|
|
116
|
+
${this._yearSelectorOpen && t === 0 ? this.renderYearGrid() : d`
|
|
100
117
|
<div class="gui-calendar__days-grid" role="grid">
|
|
101
118
|
<div role="row" class="gui-calendar__rows">
|
|
102
119
|
${D(
|
|
103
120
|
e,
|
|
104
121
|
(l, c) => c,
|
|
105
|
-
(l) =>
|
|
122
|
+
(l) => d`<span class="gui-calendar__weekday" role="gridcell">${l}</span>`
|
|
106
123
|
)}
|
|
107
124
|
</div>
|
|
108
125
|
|
|
109
126
|
${D(
|
|
110
127
|
a,
|
|
111
|
-
(l) =>
|
|
128
|
+
(l) => d`
|
|
112
129
|
<div role="row" class="gui-calendar__rows">
|
|
113
130
|
${D(
|
|
114
131
|
l,
|
|
@@ -125,11 +142,11 @@ class i extends M {
|
|
|
125
142
|
}
|
|
126
143
|
renderHeader(t) {
|
|
127
144
|
const r = k(this.localeId, t, this.monthFormat);
|
|
128
|
-
return
|
|
145
|
+
return d`
|
|
129
146
|
<header class="gui-calendar__header">
|
|
130
147
|
<h2>
|
|
131
148
|
${r.map(
|
|
132
|
-
(a) => a.type === "year" ?
|
|
149
|
+
(a) => a.type === "year" ? d`<button
|
|
133
150
|
type="button"
|
|
134
151
|
tabindex="0"
|
|
135
152
|
class="gui-calendar__year-selector"
|
|
@@ -150,7 +167,7 @@ class i extends M {
|
|
|
150
167
|
></path>
|
|
151
168
|
</svg>
|
|
152
169
|
</span>
|
|
153
|
-
</button>` :
|
|
170
|
+
</button>` : d`<span class="gui-calendar__month-name">${a.value}</span>`
|
|
154
171
|
)}
|
|
155
172
|
</h2>
|
|
156
173
|
</header>
|
|
@@ -158,7 +175,7 @@ class i extends M {
|
|
|
158
175
|
}
|
|
159
176
|
renderYearGrid() {
|
|
160
177
|
const t = this._currentDate.getFullYear(), r = this._yearList;
|
|
161
|
-
return
|
|
178
|
+
return d`
|
|
162
179
|
<div
|
|
163
180
|
class="gui-calendar__year-grid"
|
|
164
181
|
role="grid"
|
|
@@ -166,10 +183,10 @@ class i extends M {
|
|
|
166
183
|
@keydown=${this.handleYearKeydown}
|
|
167
184
|
>
|
|
168
185
|
${this.chunkYears(r).map(
|
|
169
|
-
(a) =>
|
|
186
|
+
(a) => d`
|
|
170
187
|
<div role="row" class="gui-calendar__year-row">
|
|
171
188
|
${a.map(
|
|
172
|
-
(e) =>
|
|
189
|
+
(e) => d`
|
|
173
190
|
<button
|
|
174
191
|
type="button"
|
|
175
192
|
role="gridcell"
|
|
@@ -246,8 +263,8 @@ class i extends M {
|
|
|
246
263
|
case "Enter":
|
|
247
264
|
case " ": {
|
|
248
265
|
t.preventDefault();
|
|
249
|
-
const
|
|
250
|
-
isNaN(
|
|
266
|
+
const u = parseInt(r.dataset.year ?? "", 10);
|
|
267
|
+
isNaN(u) || this.selectYear(u);
|
|
251
268
|
return;
|
|
252
269
|
}
|
|
253
270
|
case "Escape": {
|
|
@@ -298,16 +315,16 @@ class i extends M {
|
|
|
298
315
|
return;
|
|
299
316
|
}
|
|
300
317
|
t.preventDefault();
|
|
301
|
-
const
|
|
318
|
+
const u = this.findNextFocusableIndex(n, c, e);
|
|
302
319
|
let b = !1;
|
|
303
|
-
if (
|
|
320
|
+
if (u < 0)
|
|
304
321
|
if (this.canGoPrev())
|
|
305
322
|
this.prevMonth(), b = !0;
|
|
306
323
|
else {
|
|
307
324
|
e.find((p) => !this.isButtonDisabled(p))?.focus();
|
|
308
325
|
return;
|
|
309
326
|
}
|
|
310
|
-
else if (
|
|
327
|
+
else if (u >= e.length)
|
|
311
328
|
if (this.canGoNext())
|
|
312
329
|
this.nextMonth(), b = !0;
|
|
313
330
|
else {
|
|
@@ -320,15 +337,15 @@ class i extends M {
|
|
|
320
337
|
this.querySelectorAll(".gui-calendar__day-button:not(.other-month)")
|
|
321
338
|
), p = Array.from(this.querySelectorAll(".gui-calendar__panel"));
|
|
322
339
|
let g;
|
|
323
|
-
if (
|
|
340
|
+
if (u < 0)
|
|
324
341
|
g = p[0].querySelectorAll(
|
|
325
342
|
".gui-calendar__day-button:not(.other-month)"
|
|
326
|
-
).length +
|
|
343
|
+
).length + u;
|
|
327
344
|
else {
|
|
328
345
|
const f = p[p.length - 1].querySelectorAll(
|
|
329
346
|
".gui-calendar__day-button:not(.other-month)"
|
|
330
347
|
).length;
|
|
331
|
-
g = h.length - f + (
|
|
348
|
+
g = h.length - f + (u - e.length);
|
|
332
349
|
}
|
|
333
350
|
if (this.isButtonDisabled(h[g])) {
|
|
334
351
|
const y = this.findNextFocusableIndex(g, c, h);
|
|
@@ -342,7 +359,7 @@ class i extends M {
|
|
|
342
359
|
h[y]?.focus();
|
|
343
360
|
}
|
|
344
361
|
} else
|
|
345
|
-
e[
|
|
362
|
+
e[u]?.focus();
|
|
346
363
|
}
|
|
347
364
|
/**
|
|
348
365
|
* Splits an array of calendar days into chunks of weeks, with each week consisting of up to 7 days.
|
|
@@ -384,12 +401,12 @@ class i extends M {
|
|
|
384
401
|
this._currentDate = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
385
402
|
}
|
|
386
403
|
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
|
-
|
|
404
|
+
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);
|
|
405
|
+
u.setDate(e.getDate() - c);
|
|
389
406
|
const b = [];
|
|
390
407
|
for (let h = 0; h < 42; h++) {
|
|
391
|
-
const p = new Date(
|
|
392
|
-
p.setDate(
|
|
408
|
+
const p = new Date(u);
|
|
409
|
+
p.setDate(u.getDate() + h), b.push(p);
|
|
393
410
|
}
|
|
394
411
|
return b;
|
|
395
412
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LayoutWidgetAdapter as l, formContext as u, layoutContext as h } from "@golemui/lit";
|
|
2
|
-
import "@golemui/gui-shared";
|
|
3
2
|
import { consume as g, provide as m } from "@lit/context";
|
|
4
3
|
import { LitElement as v, html as r, nothing as p } from "lit";
|
|
5
4
|
import { property as f, customElement as b } from "lit/decorators.js";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LitElement as d, html as n } from "lit";
|
|
2
2
|
import { property as c, customElement as u } from "lit/decorators.js";
|
|
3
|
-
import { consume as
|
|
3
|
+
import { consume as h, provide as m } from "@lit/context";
|
|
4
4
|
import { DisplayWidgetAdapter as f, formContext as b, displayWidgetContext as g } from "@golemui/lit";
|
|
5
|
-
import "@golemui/gui-shared";
|
|
6
5
|
import "rxjs";
|
|
7
6
|
var v = Object.defineProperty, x = Object.getOwnPropertyDescriptor, l = (r, t, a, i) => {
|
|
8
7
|
for (var e = i > 1 ? void 0 : i ? x(t, a) : t, o = r.length - 1, p; o >= 0; o--)
|
|
@@ -43,11 +42,11 @@ let s = class extends d {
|
|
|
43
42
|
}
|
|
44
43
|
};
|
|
45
44
|
l([
|
|
46
|
-
|
|
45
|
+
h({ context: b }),
|
|
47
46
|
c({ attribute: !1 })
|
|
48
47
|
], s.prototype, "formContext", 2);
|
|
49
48
|
l([
|
|
50
|
-
|
|
49
|
+
m({ context: g })
|
|
51
50
|
], s.prototype, "adapter", 2);
|
|
52
51
|
s = l([
|
|
53
52
|
u("gui-alert-display")
|
|
@@ -1,18 +1,17 @@
|
|
|
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
|
-
import "@golemui/gui-shared";
|
|
7
6
|
import { classMap as P } from "lit/directives/class-map.js";
|
|
8
7
|
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
|
-
(
|
|
8
|
+
for (var e = o > 1 ? void 0 : o ? x(t, n) : t, p = i.length - 1, l; p >= 0; p--)
|
|
9
|
+
(l = i[p]) && (e = (o ? l(t, n, e) : l(e)) || e);
|
|
11
10
|
return o && e && C(t, n, e), e;
|
|
12
11
|
};
|
|
13
|
-
let
|
|
12
|
+
let a = class extends b {
|
|
14
13
|
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";
|
|
14
|
+
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
15
|
}
|
|
17
16
|
createRenderRoot() {
|
|
18
17
|
return this;
|
|
@@ -25,8 +24,9 @@ let s = class extends b {
|
|
|
25
24
|
"gui-button-with-icon": !!i,
|
|
26
25
|
[`gui-button-icon-${t}`]: !0,
|
|
27
26
|
"gui-button--outlined": this.variant === "outlined",
|
|
28
|
-
"gui-button--link": this.variant === "link"
|
|
29
|
-
|
|
27
|
+
"gui-button--link": this.variant === "link",
|
|
28
|
+
"gui-button--invalid": this.invalid && this.actionType === "submit"
|
|
29
|
+
}, o = i ? u`<span class="gui-widget-icon gui-button-icon ${i}" data-icon=${i}></span>` : c;
|
|
30
30
|
return u`
|
|
31
31
|
<div class="gui-widget">
|
|
32
32
|
<button
|
|
@@ -37,43 +37,46 @@ let s = class extends b {
|
|
|
37
37
|
data-cy=${`${this.uid}_button`}
|
|
38
38
|
?disabled=${this.disabled}
|
|
39
39
|
>
|
|
40
|
-
${t === "left" ? o :
|
|
41
|
-
${this.label ? u`<span>${this.label}</span>` :
|
|
42
|
-
${t === "right" ? o :
|
|
40
|
+
${t === "left" ? o : c}
|
|
41
|
+
${this.label ? u`<span>${this.label}</span>` : c}
|
|
42
|
+
${t === "right" ? o : c}
|
|
43
43
|
</button>
|
|
44
44
|
</div>
|
|
45
45
|
`;
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
r([
|
|
49
|
-
|
|
50
|
-
],
|
|
49
|
+
s({ type: String })
|
|
50
|
+
], a.prototype, "uid", 2);
|
|
51
51
|
r([
|
|
52
|
-
|
|
53
|
-
],
|
|
52
|
+
s({ type: String })
|
|
53
|
+
], a.prototype, "label", 2);
|
|
54
54
|
r([
|
|
55
|
-
|
|
56
|
-
],
|
|
55
|
+
s({ type: Boolean })
|
|
56
|
+
], a.prototype, "disabled", 2);
|
|
57
57
|
r([
|
|
58
|
-
|
|
59
|
-
],
|
|
58
|
+
s({ type: String })
|
|
59
|
+
], a.prototype, "icon", 2);
|
|
60
60
|
r([
|
|
61
|
-
|
|
62
|
-
],
|
|
61
|
+
s({ type: String })
|
|
62
|
+
], a.prototype, "variant", 2);
|
|
63
63
|
r([
|
|
64
|
-
|
|
65
|
-
],
|
|
64
|
+
s({ type: String })
|
|
65
|
+
], a.prototype, "iconPosition", 2);
|
|
66
66
|
r([
|
|
67
|
-
|
|
68
|
-
],
|
|
69
|
-
|
|
67
|
+
s({ type: String })
|
|
68
|
+
], a.prototype, "actionType", 2);
|
|
69
|
+
r([
|
|
70
|
+
s({ type: Boolean })
|
|
71
|
+
], a.prototype, "invalid", 2);
|
|
72
|
+
a = r([
|
|
70
73
|
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 &&
|
|
74
|
+
], a);
|
|
75
|
+
typeof customElements < "u" && !customElements.get("gui-button") && customElements.define("gui-button", a);
|
|
76
|
+
var D = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, h = (i, t, n, o) => {
|
|
77
|
+
for (var e = o > 1 ? void 0 : o ? _(t, n) : t, p = i.length - 1, l; p >= 0; p--)
|
|
78
|
+
(l = i[p]) && (e = (o ? l(t, n, e) : l(e)) || e);
|
|
79
|
+
return o && e && D(t, n, e), e;
|
|
77
80
|
};
|
|
78
81
|
let d = class extends b {
|
|
79
82
|
constructor() {
|
|
@@ -99,6 +102,7 @@ let d = class extends b {
|
|
|
99
102
|
.actionType=${this.adapter.templateData.actionType ?? "button"}
|
|
100
103
|
.label=${this.adapter.templateData.label}
|
|
101
104
|
?disabled=${this.adapter.templateData.disabled === !0}
|
|
105
|
+
?invalid=${this.adapter.templateData.invalid === !0}
|
|
102
106
|
.variant=${this.adapter.templateData.variant}
|
|
103
107
|
.icon=${this.adapter.templateData.icon}
|
|
104
108
|
.iconPosition=${this.adapter.templateData.iconPosition}
|
|
@@ -111,11 +115,11 @@ let d = class extends b {
|
|
|
111
115
|
}
|
|
112
116
|
};
|
|
113
117
|
h([
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
y({ context: g }),
|
|
119
|
+
s({ attribute: !1 })
|
|
116
120
|
], d.prototype, "formContext", 2);
|
|
117
121
|
h([
|
|
118
|
-
$({ context:
|
|
122
|
+
$({ context: v })
|
|
119
123
|
], d.prototype, "adapter", 2);
|
|
120
124
|
d = h([
|
|
121
125
|
m("gui-button-interactive")
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
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
|
-
import { i as h, b as g, a as v, g as M, t as w } from "./date-
|
|
5
|
-
import { A as C } from "./abstract-calendar-
|
|
4
|
+
import { i as h, b as g, a as v, g as M, t as w } from "./date-DTYg8sog.js";
|
|
5
|
+
import { A as C } from "./abstract-calendar-BoqKPRmS.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,16 +1,15 @@
|
|
|
1
1
|
import { InputWidgetAdapter as o, formContext as l, inputContext as h } from "@golemui/lit";
|
|
2
|
-
import "
|
|
3
|
-
import "./calendar-P9DzVryu.js";
|
|
2
|
+
import "./calendar-DTYKVYc3.js";
|
|
4
3
|
import { consume as m, provide as u } from "@lit/context";
|
|
5
4
|
import { LitElement as c, html as D } from "lit";
|
|
6
5
|
import { property as b, customElement as $ } from "lit/decorators.js";
|
|
7
6
|
import "rxjs";
|
|
8
|
-
var f = Object.defineProperty, g = Object.getOwnPropertyDescriptor, d = (e, t,
|
|
9
|
-
for (var a = r > 1 ? void 0 : r ? g(t,
|
|
10
|
-
(n = e[p]) && (a = (r ? n(t,
|
|
11
|
-
return r && a && f(t,
|
|
7
|
+
var f = Object.defineProperty, g = Object.getOwnPropertyDescriptor, d = (e, t, i, r) => {
|
|
8
|
+
for (var a = r > 1 ? void 0 : r ? g(t, i) : t, p = e.length - 1, n; p >= 0; p--)
|
|
9
|
+
(n = e[p]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
10
|
+
return r && a && f(t, i, a), a;
|
|
12
11
|
};
|
|
13
|
-
let
|
|
12
|
+
let s = class extends c {
|
|
14
13
|
constructor() {
|
|
15
14
|
super(...arguments), this.adapter = new o(), this.subscriptions = [];
|
|
16
15
|
}
|
|
@@ -67,13 +66,13 @@ let i = class extends c {
|
|
|
67
66
|
d([
|
|
68
67
|
m({ context: l }),
|
|
69
68
|
b({ attribute: !1 })
|
|
70
|
-
],
|
|
69
|
+
], s.prototype, "formContext", 2);
|
|
71
70
|
d([
|
|
72
71
|
u({ context: h })
|
|
73
|
-
],
|
|
74
|
-
|
|
72
|
+
], s.prototype, "adapter", 2);
|
|
73
|
+
s = d([
|
|
75
74
|
$("gui-calendar-input")
|
|
76
|
-
],
|
|
75
|
+
], s);
|
|
77
76
|
export {
|
|
78
|
-
|
|
77
|
+
s as CalendarElement
|
|
79
78
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InputWidgetAdapter as g, formContext as m, inputContext as y } from "@golemui/lit";
|
|
2
|
-
import "@golemui/gui-shared";
|
|
3
2
|
import { G as v, c as f } from "./templates-Dk1jxLwS.js";
|
|
4
3
|
import { LitElement as u, nothing as $, html as p } from "lit";
|
|
5
4
|
import { property as r, customElement as b } from "lit/decorators.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InputWidgetAdapter as g, formContext as b, inputContext as v } from "@golemui/lit";
|
|
2
|
-
import "@golemui/gui-shared";
|
|
3
2
|
import { LitElement as m, nothing as p, html as c } from "lit";
|
|
4
3
|
import { property as a, state as f, query as $, customElement as y } from "lit/decorators.js";
|
|
5
4
|
import { classMap as D } from "lit/directives/class-map.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "@golemui/gui-shared";
|
|
2
1
|
const t = {
|
|
3
2
|
aa: { firstDay: 7, weekend: [6, 7], minimalDays: 1 },
|
|
4
3
|
"aa-DJ": { firstDay: 6, weekend: [6, 7], minimalDays: 1 },
|
|
@@ -715,7 +714,7 @@ function y(e) {
|
|
|
715
714
|
const i = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), a = String(e.getDate()).padStart(2, "0");
|
|
716
715
|
return `${i}-${n}-${a}`;
|
|
717
716
|
}
|
|
718
|
-
function
|
|
717
|
+
function k(e) {
|
|
719
718
|
return r(e, /* @__PURE__ */ new Date());
|
|
720
719
|
}
|
|
721
720
|
function r(e, i) {
|
|
@@ -729,14 +728,14 @@ function l(e) {
|
|
|
729
728
|
const i = t[e ?? "en"] || { firstDay: 0 };
|
|
730
729
|
return f(i.firstDay);
|
|
731
730
|
}
|
|
732
|
-
function
|
|
731
|
+
function w(e) {
|
|
733
732
|
const i = new Intl.DateTimeFormat(e, { weekday: "narrow" }), n = new Date(2025, 10, 30);
|
|
734
733
|
return l(e).map((a) => {
|
|
735
734
|
const s = new Date(n);
|
|
736
735
|
return s.setDate(n.getDate() + a), i.format(s);
|
|
737
736
|
});
|
|
738
737
|
}
|
|
739
|
-
function
|
|
738
|
+
function o(e, i, n) {
|
|
740
739
|
for (let a = 0; a < n; a++) {
|
|
741
740
|
const s = new Date(i.getFullYear(), i.getMonth() + a, 1);
|
|
742
741
|
if (e.getMonth() === s.getMonth() && e.getFullYear() === s.getFullYear())
|
|
@@ -744,10 +743,10 @@ function g(e, i, n) {
|
|
|
744
743
|
}
|
|
745
744
|
return !1;
|
|
746
745
|
}
|
|
747
|
-
function
|
|
746
|
+
function g(e, i, n = "long") {
|
|
748
747
|
return new Intl.DateTimeFormat(e, { month: n, year: "numeric" }).formatToParts(i).filter((s) => s.type === "month" || s.type === "year");
|
|
749
748
|
}
|
|
750
|
-
function
|
|
749
|
+
function u(e, i) {
|
|
751
750
|
const n = e || "en-US", m = new Intl.DateTimeFormat(n, { day: "numeric" }).formatToParts(i).find((D) => D.type === "day");
|
|
752
751
|
return m ? m.value : i.getDate().toString();
|
|
753
752
|
}
|
|
@@ -755,7 +754,7 @@ function d(e, i) {
|
|
|
755
754
|
const n = y(e), a = y(i);
|
|
756
755
|
return n === a ? { start: n } : { start: n, end: a };
|
|
757
756
|
}
|
|
758
|
-
function
|
|
757
|
+
function c(e) {
|
|
759
758
|
return e.length ? e.map((a) => ({
|
|
760
759
|
start: new Date(a.start).getTime(),
|
|
761
760
|
end: new Date(a.end ?? a.start).getTime()
|
|
@@ -773,14 +772,14 @@ function M(e) {
|
|
|
773
772
|
).map((a) => d(new Date(a.start), new Date(a.end))) : [];
|
|
774
773
|
}
|
|
775
774
|
export {
|
|
776
|
-
|
|
775
|
+
k as a,
|
|
777
776
|
r as b,
|
|
778
777
|
d as c,
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
778
|
+
w as d,
|
|
779
|
+
g as e,
|
|
780
|
+
u as g,
|
|
781
|
+
o as i,
|
|
782
|
+
c as m,
|
|
784
783
|
y as t,
|
|
785
784
|
l as w
|
|
786
785
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import "@golemui/gui-shared";
|
|
2
1
|
import { LitElement as y, nothing as u, html as d } from "lit";
|
|
3
2
|
import { repeat as g } from "lit-html/directives/repeat.js";
|
|
4
3
|
import { property as l, state as p, customElement as m } from "lit/decorators.js";
|
|
5
4
|
import { classMap as _ } from "lit/directives/class-map.js";
|
|
6
5
|
import { live as f } from "lit/directives/live.js";
|
|
7
6
|
import { G as v, b as A, c as S } from "./templates-Dk1jxLwS.js";
|
|
8
|
-
import { t as w } from "./date-
|
|
7
|
+
import { t as w } from "./date-DTYg8sog.js";
|
|
9
8
|
var b = Object.defineProperty, I = Object.getOwnPropertyDescriptor, h = (t, e, a, i) => {
|
|
10
9
|
for (var r = i > 1 ? void 0 : i ? I(e, a) : e, n = t.length - 1, s; n >= 0; n--)
|
|
11
10
|
(s = t[n]) && (r = (i ? s(e, a, r) : s(r)) || r);
|
|
@@ -60,7 +59,10 @@ let o = class extends y {
|
|
|
60
59
|
${this.label ? A(this.uid, t) : u}
|
|
61
60
|
|
|
62
61
|
<div class="gui-widget">
|
|
63
|
-
<div
|
|
62
|
+
<div
|
|
63
|
+
class="gui-widget-input gui-date-input ${this.icon ? "gui-calendar--icon" : ""}"
|
|
64
|
+
role="group"
|
|
65
|
+
>
|
|
64
66
|
${g(
|
|
65
67
|
e,
|
|
66
68
|
(i) => i.type,
|
|
@@ -1,16 +1,15 @@
|
|
|
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
|
-
import "
|
|
4
|
-
import "./
|
|
5
|
-
import "./calendar-P9DzVryu.js";
|
|
3
|
+
import "./date-input-BeQvyfln.js";
|
|
4
|
+
import "./calendar-DTYKVYc3.js";
|
|
6
5
|
import { consume as D, provide as $ } from "@lit/context";
|
|
7
|
-
import { LitElement as v, html as
|
|
6
|
+
import { LitElement as v, html as p, nothing as f } from "lit";
|
|
8
7
|
import { property as b, query as o, state as y, customElement as I } from "lit/decorators.js";
|
|
9
8
|
import "rxjs";
|
|
10
9
|
import { classMap as O } from "lit/directives/class-map.js";
|
|
11
10
|
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
|
-
(
|
|
11
|
+
for (var r = i > 1 ? void 0 : i ? x(t, a) : t, d = e.length - 1, l; d >= 0; d--)
|
|
12
|
+
(l = e[d]) && (r = (i ? l(t, a, r) : l(r)) || r);
|
|
14
13
|
return i && r && w(t, a, r), r;
|
|
15
14
|
};
|
|
16
15
|
let s = class extends v {
|
|
@@ -40,7 +39,7 @@ let s = class extends v {
|
|
|
40
39
|
}
|
|
41
40
|
render() {
|
|
42
41
|
super.render();
|
|
43
|
-
const e = m("datePicker", this.adapter.templateData), t = this.isCalendarOpen ?
|
|
42
|
+
const e = m("datePicker", this.adapter.templateData), t = this.isCalendarOpen ? p`<gui-calendar
|
|
44
43
|
id="calendar-input"
|
|
45
44
|
.uid=${this.widget.uid}
|
|
46
45
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -62,9 +61,9 @@ let s = class extends v {
|
|
|
62
61
|
.numberOfMonths=${this.adapter.templateData.numberOfMonths}
|
|
63
62
|
.localeId=${this.adapter.templateData.lang}
|
|
64
63
|
@blur=${this.onBlurCalendar}
|
|
65
|
-
@change=${this.
|
|
64
|
+
@change=${this.onCalendarChange}
|
|
66
65
|
></gui-calendar>` : f;
|
|
67
|
-
return
|
|
66
|
+
return p`
|
|
68
67
|
${g(this.widget.uid, {
|
|
69
68
|
...this.adapter.templateData,
|
|
70
69
|
required: this.adapter.templateData.validator?.required
|
|
@@ -113,6 +112,12 @@ let s = class extends v {
|
|
|
113
112
|
valueChanged(e) {
|
|
114
113
|
this.adapter.injectValidationIssues(null), this.adapter.valueChanged(e.detail.value);
|
|
115
114
|
}
|
|
115
|
+
// Selecting a day in the calendar commits a single date, so close the
|
|
116
|
+
// calendar afterwards. The range picker intentionally stays open so the user
|
|
117
|
+
// can select multiple ranges and closes it themselves.
|
|
118
|
+
onCalendarChange(e) {
|
|
119
|
+
this.valueChanged(e), this.closeCalendar();
|
|
120
|
+
}
|
|
116
121
|
onBlurCalendar() {
|
|
117
122
|
this.adapter.onBlur(), this.closeCalendar();
|
|
118
123
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
-
import "
|
|
4
|
-
import "./date-input-D_Swskk4.js";
|
|
3
|
+
import "./date-input-BeQvyfln.js";
|
|
5
4
|
import { consume as c, provide as m } from "@lit/context";
|
|
6
5
|
import { LitElement as f, html as b } from "lit";
|
|
7
6
|
import { property as g, customElement as D } from "lit/decorators.js";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { InputWidgetAdapter as v, formContext as w, inputContext as y } from "@golemui/lit";
|
|
2
|
-
import "@golemui/gui-shared";
|
|
3
2
|
import { consume as F, provide as C } from "@lit/context";
|
|
4
3
|
import { LitElement as x, nothing as m, html as f } from "lit";
|
|
5
4
|
import { property as D, state as c, query as I, customElement as L } from "lit/decorators.js";
|
|
6
5
|
import { Subject as R, debounceTime as V } from "rxjs";
|
|
7
|
-
import { d as k } from "./list-
|
|
6
|
+
import { d as k } from "./list-D1oKnH89.js";
|
|
8
7
|
import "./errors-QjKhr6mA.js";
|
|
9
8
|
var O = Object.defineProperty, j = Object.getOwnPropertyDescriptor, l = (e, t, i, s) => {
|
|
10
9
|
for (var n = s > 1 ? void 0 : s ? j(t, i) : t, d = e.length - 1, o; d >= 0; d--)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LayoutWidgetAdapter as o, formContext as u, layoutContext as g } from "@golemui/lit";
|
|
2
|
-
import "@golemui/gui-shared";
|
|
3
2
|
import { consume as c, provide as m } from "@lit/context";
|
|
4
3
|
import { LitElement as f, html as n } from "lit";
|
|
5
4
|
import { property as h, customElement as _ } from "lit/decorators.js";
|