@golemui/gui-lit 1.6.0 → 2.0.0-rc.1
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 +86 -0
- package/accordion.element-CE1gDRCy.js +84 -0
- package/alert.element-Bqcad7bR.js +43 -0
- package/{button.element-CKYv0Glr.js → button.element-CjeUWaly.js} +23 -24
- package/{calendar.element-DkHZFBNr.js → calendar.element-DXI9bfFN.js} +17 -22
- package/{checkbox.element-MukoziRw.js → checkbox.element-D8hXKLjW.js} +18 -22
- package/{currency.element-DNumeSKA.js → currency.element-D8t_MtIs.js} +22 -26
- package/{date-picker.element-DpQmremq.js → date-picker.element-X__hfSnj.js} +16 -21
- package/{date-time-calendar.element-GAr8VMGa.js → date-time-calendar.element-Dmyd7LQ0.js} +17 -21
- package/{date-time-picker.element-Bt0GYSpS.js → date-time-picker.element-QGn5dEbf.js} +23 -27
- package/{date-time.element-WfLnY_Cb.js → date-time.element-B0OuRjlf.js} +20 -25
- package/{date.element-ChpTi2AQ.js → date.element-Ba8wmaNU.js} +13 -18
- package/default-list-item-renderer-sJeXkSKR.js +15 -0
- package/{default-multi-list-item-renderer-Cv-guvEX.js → default-multi-list-item-renderer-CG3Fuye0.js} +7 -12
- package/{dropdown.element-Ckh9JvEK.js → dropdown.element-C55MHVq-.js} +98 -132
- package/{file-upload.element-l_l_ubxJ.js → file-upload.element-B3oBEQ_s.js} +18 -23
- package/grid.element-CwDdlQ4b.js +54 -0
- package/index.js +42 -42
- package/index.umd.cjs +287 -374
- package/lib/components/accordion.element.d.ts +2 -2
- package/lib/components/alert.element.d.ts +0 -1
- package/lib/components/calendar.element.d.ts +0 -1
- package/lib/components/checkbox.element.d.ts +0 -1
- package/lib/components/currency.element.d.ts +0 -1
- package/lib/components/date-picker.element.d.ts +0 -1
- package/lib/components/date-time-calendar.element.d.ts +0 -1
- package/lib/components/date-time-picker.element.d.ts +0 -1
- package/lib/components/date-time.element.d.ts +0 -1
- package/lib/components/date.element.d.ts +0 -1
- package/lib/components/dropdown.element.d.ts +2 -6
- package/lib/components/file-upload.element.d.ts +0 -1
- package/lib/components/grid.element.d.ts +3 -3
- package/lib/components/list.element.d.ts +2 -8
- package/lib/components/markdown-text.element.d.ts +0 -1
- package/lib/components/markdown.element.d.ts +0 -1
- package/lib/components/multi-dropdown.element.d.ts +2 -6
- package/lib/components/multi-file-upload.element.d.ts +0 -1
- package/lib/components/multi-list.element.d.ts +2 -8
- package/lib/components/number.element.d.ts +0 -1
- package/lib/components/password.element.d.ts +0 -1
- package/lib/components/radiogroup.element.d.ts +0 -1
- package/lib/components/range-calendar.element.d.ts +0 -1
- package/lib/components/range-date-input.element.d.ts +0 -1
- package/lib/components/range-date-picker.element.d.ts +0 -1
- package/lib/components/range-date-time-calendar.element.d.ts +0 -1
- package/lib/components/range-date-time-input.element.d.ts +0 -1
- package/lib/components/range-date-time-picker.element.d.ts +0 -1
- package/lib/components/range-time-input.element.d.ts +0 -1
- package/lib/components/range-time-picker.element.d.ts +0 -1
- package/lib/components/renderer.element.d.ts +0 -1
- package/lib/components/repeater.element.d.ts +0 -1
- package/lib/components/select.element.d.ts +0 -1
- package/lib/components/tabs.element.d.ts +4 -15
- package/lib/components/tags.element.d.ts +0 -1
- package/lib/components/textarea.element.d.ts +0 -1
- package/lib/components/textinput.element.d.ts +0 -1
- package/lib/components/time-picker.element.d.ts +0 -1
- package/lib/components/time.element.d.ts +0 -1
- package/lib/components/toggle.element.d.ts +0 -1
- package/list.element-CIrv32zU.js +125 -0
- package/{markdown-text.element-DflCQwAo.js → markdown-text.element-Jos6zKYy.js} +17 -22
- package/{markdown.element-DUHHoi2Y.js → markdown.element-7tvZ028P.js} +11 -15
- package/{multi-dropdown.element-mX06nBBb.js → multi-dropdown.element-nOsP8HUx.js} +99 -135
- package/{multi-file-upload.element-DzAZAfc1.js → multi-file-upload.element-4h6JQgRF.js} +16 -21
- package/multi-list.element-CZfmTbCf.js +139 -0
- package/{number.element-mQSFQsYC.js → number.element-WRHwQGZz.js} +19 -23
- package/package.json +6 -6
- package/{password.element-xw5gugEg.js → password.element-DnV_PqKI.js} +17 -21
- package/{radiogroup.element-TqfrxVyI.js → radiogroup.element-Cqn_48Ao.js} +20 -24
- package/{range-calendar.element-BJr97SVA.js → range-calendar.element-V_56ZeT9.js} +13 -18
- package/{range-date-input.element-DDRYvP9h.js → range-date-input.element-D3ZG8OW-.js} +15 -20
- package/{range-date-picker.element-rdEr0_wu.js → range-date-picker.element-CaNHjueS.js} +21 -26
- package/{range-date-time-calendar.element-UlL1BBRJ.js → range-date-time-calendar.element-DyiiUB5Q.js} +19 -24
- package/{range-date-time-input.element-Cq4IdW7N.js → range-date-time-input.element-CVCPS7FC.js} +20 -25
- package/{range-date-time-picker.element-CnJcIN9C.js → range-date-time-picker.element-6nBQ_NZs.js} +16 -21
- package/{range-time-input.element-Cq0TrGe9.js → range-time-input.element-GXw45kMr.js} +12 -17
- package/{range-time-picker.element-BzlIuZ6m.js → range-time-picker.element-CG4PJg3u.js} +24 -29
- package/{renderer.element-BVwerbtL.js → renderer.element-FWOUTePl.js} +16 -21
- package/{repeater.element-DQNI4b7I.js → repeater.element-V508AKTJ.js} +8 -13
- package/{select.element-RBtbAvLx.js → select.element-BPrqKmDM.js} +17 -20
- package/tabs.element-CeZOk5Bj.js +88 -0
- package/{tags.element-CGvxhMmX.js → tags.element-CVCUsKZ0.js} +12 -17
- package/{textarea.element-E2ntRBtE.js → textarea.element-DrWG3xvs.js} +23 -27
- package/{textinput.element-0q5F5ol3.js → textinput.element-CCgsbYTB.js} +25 -29
- package/{time-picker.element-BiLaLr_c.js → time-picker.element-Q_OWcBVy.js} +21 -26
- package/{time.element-92goKRwJ.js → time.element-B0L2sriD.js} +20 -25
- package/{toggle.element-zDUc9Vja.js → toggle.element-BTjo7IVK.js} +18 -22
- package/accordion.element-BEenQrCh.js +0 -102
- package/alert.element-Dzv49O-1.js +0 -55
- package/default-list-item-renderer-CuPJ9jUD.js +0 -24
- package/flex.element-BW0_kx8z.js +0 -79
- package/grid.element-C019lV76.js +0 -78
- package/lib/components/flex.element.d.ts +0 -16
- package/list.element-UIKmXzeH.js +0 -148
- package/multi-list.element-Bs-UN2Cy.js +0 -162
- package/tabs.element-BiVaQlvt.js +0 -171
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { LayoutWidgetAdapter as g, formContext as f, layoutContext as b } from "@golemui/lit";
|
|
2
|
+
import { unsubscribeAll as m, safeDefine as x } from "@golemui/lit/internals";
|
|
3
|
+
import { repeaterIndexSuffix as $, tabButtonId as p, tabPanelId as c } from "@golemui/gui-shared/internals";
|
|
4
|
+
import { consume as v, provide as w } from "@lit/context";
|
|
5
|
+
import { LitElement as C, html as s } from "lit";
|
|
6
|
+
import { repeat as l } from "lit/directives/repeat.js";
|
|
7
|
+
import { property as y, state as T } from "lit/decorators.js";
|
|
8
|
+
import "rxjs";
|
|
9
|
+
import "@golemui/gui-components/tabs";
|
|
10
|
+
var D = Object.defineProperty, n = (u, i, r, o) => {
|
|
11
|
+
for (var e = void 0, t = u.length - 1, a; t >= 0; t--)
|
|
12
|
+
(a = u[t]) && (e = a(i, r, e) || e);
|
|
13
|
+
return e && D(i, r, e), e;
|
|
14
|
+
};
|
|
15
|
+
class d extends C {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments), this.adapter = new g(), this.activeTab = "", this.subscriptions = [], this.rowIndexSuffix = "", this.onTabChange = (i) => {
|
|
18
|
+
i.target === i.currentTarget && (this.activeTab = i.detail.value, this.adapter.change(i.detail.value));
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
createRenderRoot() {
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback(), this.classList.add("gui-tabs", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget);
|
|
26
|
+
const i = this.adapter.templateData;
|
|
27
|
+
this.activeTab = i.defaultOpen ?? i.tabs?.[0]?.uid ?? "", this.rowIndexSuffix = $(this.widget.uid), this.subscriptions.push(
|
|
28
|
+
this.adapter.templateDataChanged$.subscribe(() => {
|
|
29
|
+
this.requestUpdate();
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
if (!this.adapter.templateData) return s``;
|
|
35
|
+
const { tabs: i = [], children: r = [], renderMode: o } = this.adapter.templateData, e = i.map((t) => ({
|
|
36
|
+
tab: t,
|
|
37
|
+
child: r.find((a) => a.uid === `${t.uid}${this.rowIndexSuffix}`),
|
|
38
|
+
isActive: t.uid === this.activeTab
|
|
39
|
+
})).filter(({ child: t, isActive: a }) => t && (a || o !== "activeOnly"));
|
|
40
|
+
return s`<gui-tabs
|
|
41
|
+
id=${this.widget.uid}
|
|
42
|
+
.active=${this.activeTab}
|
|
43
|
+
@gui-tab-change=${this.onTabChange}
|
|
44
|
+
>
|
|
45
|
+
<gui-tab-list>
|
|
46
|
+
${l(
|
|
47
|
+
i,
|
|
48
|
+
(t) => t.uid,
|
|
49
|
+
(t) => s`<gui-tab
|
|
50
|
+
panel=${t.uid}
|
|
51
|
+
id=${p(this.widget.uid, t.uid)}
|
|
52
|
+
data-cy=${p(this.widget.uid, t.uid)}
|
|
53
|
+
>${t.label}</gui-tab
|
|
54
|
+
>`
|
|
55
|
+
)}
|
|
56
|
+
</gui-tab-list>
|
|
57
|
+
${l(
|
|
58
|
+
e,
|
|
59
|
+
({ tab: t }) => t.uid,
|
|
60
|
+
({ tab: t, child: a, isActive: h }) => s`<gui-tab-panel
|
|
61
|
+
name=${t.uid}
|
|
62
|
+
id=${c(this.widget.uid, t.uid)}
|
|
63
|
+
data-cy=${c(this.widget.uid, t.uid)}
|
|
64
|
+
?hidden=${!h}
|
|
65
|
+
>
|
|
66
|
+
<gui-widget .widget=${a}></gui-widget>
|
|
67
|
+
</gui-tab-panel>`
|
|
68
|
+
)}
|
|
69
|
+
</gui-tabs>`;
|
|
70
|
+
}
|
|
71
|
+
disconnectedCallback() {
|
|
72
|
+
super.disconnectedCallback(), this.adapter.destroy(), m(this.subscriptions);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
n([
|
|
76
|
+
v({ context: f }),
|
|
77
|
+
y({ attribute: !1 })
|
|
78
|
+
], d.prototype, "formContext");
|
|
79
|
+
n([
|
|
80
|
+
w({ context: b })
|
|
81
|
+
], d.prototype, "adapter");
|
|
82
|
+
n([
|
|
83
|
+
T()
|
|
84
|
+
], d.prototype, "activeTab");
|
|
85
|
+
x("gui-tabs-layout", d);
|
|
86
|
+
export {
|
|
87
|
+
d as TabsElement
|
|
88
|
+
};
|
|
@@ -3,12 +3,12 @@ import "@golemui/gui-components/tags";
|
|
|
3
3
|
import { consume as u, provide as h } from "@lit/context";
|
|
4
4
|
import { LitElement as m, html as c } from "lit";
|
|
5
5
|
import { property as b } from "lit/decorators.js";
|
|
6
|
-
import { unsubscribeAll as
|
|
6
|
+
import { unsubscribeAll as g, safeDefine as D } from "@golemui/lit/internals";
|
|
7
7
|
import "rxjs";
|
|
8
|
-
var
|
|
9
|
-
for (var
|
|
10
|
-
(p = r[i]) && (
|
|
11
|
-
return
|
|
8
|
+
var $ = Object.defineProperty, l = (r, e, a, v) => {
|
|
9
|
+
for (var t = void 0, i = r.length - 1, p; i >= 0; i--)
|
|
10
|
+
(p = r[i]) && (t = p(e, a, t) || t);
|
|
11
|
+
return t && $(e, a, t), t;
|
|
12
12
|
};
|
|
13
13
|
class s extends m {
|
|
14
14
|
constructor() {
|
|
@@ -17,11 +17,6 @@ class s extends m {
|
|
|
17
17
|
createRenderRoot() {
|
|
18
18
|
return this;
|
|
19
19
|
}
|
|
20
|
-
updated(e) {
|
|
21
|
-
super.updated(e);
|
|
22
|
-
const t = this.adapter.templateData.size;
|
|
23
|
-
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
24
|
-
}
|
|
25
20
|
connectedCallback() {
|
|
26
21
|
super.connectedCallback(), this.classList.add("gui-tags", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
27
22
|
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
@@ -34,7 +29,7 @@ class s extends m {
|
|
|
34
29
|
.label=${this.adapter.templateData.label}
|
|
35
30
|
.hint=${this.adapter.templateData.hint}
|
|
36
31
|
.errors=${this.adapter.templateData.errors}
|
|
37
|
-
|
|
32
|
+
.touched=${this.adapter.templateData.touched}
|
|
38
33
|
?required=${this.adapter.templateData.validator?.required}
|
|
39
34
|
?disabled=${this.adapter.templateData.disabled}
|
|
40
35
|
?readonly=${this.adapter.templateData.readonly}
|
|
@@ -46,17 +41,17 @@ class s extends m {
|
|
|
46
41
|
.trim=${this.adapter.templateData.trim ?? !0}
|
|
47
42
|
.removeAriaLabel=${this.adapter.templateData.removeAriaLabel}
|
|
48
43
|
.removeIcon=${this.adapter.templateData.removeIcon}
|
|
49
|
-
@
|
|
50
|
-
@blur=${() => this.adapter.onBlur()}
|
|
44
|
+
@gui-input=${this.valueChanged}
|
|
45
|
+
@gui-blur=${() => this.adapter.onBlur()}
|
|
51
46
|
></gui-tags>
|
|
52
47
|
`;
|
|
53
48
|
}
|
|
54
49
|
valueChanged(e) {
|
|
55
|
-
const
|
|
56
|
-
this.adapter.valueChanged(
|
|
50
|
+
const a = e.detail.value;
|
|
51
|
+
this.adapter.valueChanged(a);
|
|
57
52
|
}
|
|
58
53
|
disconnectedCallback() {
|
|
59
|
-
super.disconnectedCallback(), this.adapter.destroy(),
|
|
54
|
+
super.disconnectedCallback(), this.adapter.destroy(), g(this.subscriptions);
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
57
|
l([
|
|
@@ -66,7 +61,7 @@ l([
|
|
|
66
61
|
l([
|
|
67
62
|
h({ context: n })
|
|
68
63
|
], s.prototype, "adapter");
|
|
69
|
-
|
|
64
|
+
D("gui-tags-input", s);
|
|
70
65
|
export {
|
|
71
66
|
s as TagsElement
|
|
72
67
|
};
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { InputWidgetAdapter as
|
|
1
|
+
import { InputWidgetAdapter as d, formContext as l, inputContext as n } from "@golemui/lit";
|
|
2
2
|
import "@golemui/gui-components/textarea";
|
|
3
3
|
import { consume as u, provide as h } from "@lit/context";
|
|
4
4
|
import { LitElement as m, html as c } from "lit";
|
|
5
|
-
import { property as
|
|
6
|
-
import { unsubscribeAll as b, safeDefine as
|
|
5
|
+
import { property as g } from "lit/decorators.js";
|
|
6
|
+
import { unsubscribeAll as b, safeDefine as f } from "@golemui/lit/internals";
|
|
7
7
|
import "rxjs";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { live as $ } from "lit/directives/live.js";
|
|
9
|
+
var v = Object.defineProperty, o = (r, e, a, x) => {
|
|
10
|
+
for (var t = void 0, i = r.length - 1, s; i >= 0; i--)
|
|
11
|
+
(s = r[i]) && (t = s(e, a, t) || t);
|
|
12
|
+
return t && v(e, a, t), t;
|
|
12
13
|
};
|
|
13
|
-
class
|
|
14
|
+
class p extends m {
|
|
14
15
|
constructor() {
|
|
15
|
-
super(...arguments), this.adapter = new
|
|
16
|
+
super(...arguments), this.adapter = new d(), this.subscriptions = [];
|
|
16
17
|
}
|
|
17
18
|
createRenderRoot() {
|
|
18
19
|
return this;
|
|
19
20
|
}
|
|
20
|
-
updated(e) {
|
|
21
|
-
super.updated(e);
|
|
22
|
-
const t = this.adapter.templateData.size;
|
|
23
|
-
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
24
|
-
}
|
|
25
21
|
connectedCallback() {
|
|
26
22
|
super.connectedCallback(), this.classList.add("gui-textarea", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
27
23
|
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
@@ -33,11 +29,11 @@ class s extends m {
|
|
|
33
29
|
.uid=${this.widget.uid}
|
|
34
30
|
.label=${this.adapter.templateData.label}
|
|
35
31
|
.errors=${this.adapter.templateData.errors}
|
|
36
|
-
|
|
32
|
+
.touched=${this.adapter.templateData.touched}
|
|
37
33
|
?required=${this.adapter.templateData.validator?.required}
|
|
38
34
|
?disabled=${this.adapter.templateData.disabled}
|
|
39
35
|
?readonly=${this.adapter.templateData.readonly}
|
|
40
|
-
.value=${this.adapter.templateData.value}
|
|
36
|
+
.value=${$(this.adapter.templateData.value)}
|
|
41
37
|
.hint=${this.adapter.templateData.hint}
|
|
42
38
|
.placeholder=${this.adapter.templateData.placeholder}
|
|
43
39
|
.autocomplete=${this.adapter.templateData.autocomplete}
|
|
@@ -45,27 +41,27 @@ class s extends m {
|
|
|
45
41
|
.minimumHeight=${this.adapter.templateData.minimumHeight}
|
|
46
42
|
.autoGrow=${this.adapter.templateData.autoGrow}
|
|
47
43
|
.maxLength=${this.adapter.templateData.validator?.maxLength}
|
|
48
|
-
@input=${this.valueChanged}
|
|
49
|
-
@blur=${() => this.adapter.onBlur()}
|
|
44
|
+
@gui-input=${this.valueChanged}
|
|
45
|
+
@gui-blur=${() => this.adapter.onBlur()}
|
|
50
46
|
></gui-textarea>
|
|
51
47
|
`;
|
|
52
48
|
}
|
|
53
49
|
valueChanged(e) {
|
|
54
|
-
const
|
|
55
|
-
this.adapter.valueChanged(
|
|
50
|
+
const a = e.detail.value;
|
|
51
|
+
this.adapter.valueChanged(a);
|
|
56
52
|
}
|
|
57
53
|
disconnectedCallback() {
|
|
58
54
|
super.disconnectedCallback(), this.adapter.destroy(), b(this.subscriptions);
|
|
59
55
|
}
|
|
60
56
|
}
|
|
61
|
-
|
|
57
|
+
o([
|
|
62
58
|
u({ context: l }),
|
|
63
|
-
|
|
64
|
-
],
|
|
65
|
-
|
|
59
|
+
g({ attribute: !1 })
|
|
60
|
+
], p.prototype, "formContext");
|
|
61
|
+
o([
|
|
66
62
|
h({ context: n })
|
|
67
|
-
],
|
|
68
|
-
|
|
63
|
+
], p.prototype, "adapter");
|
|
64
|
+
f("gui-textarea-input", p);
|
|
69
65
|
export {
|
|
70
|
-
|
|
66
|
+
p as TextareaElement
|
|
71
67
|
};
|
|
@@ -1,68 +1,64 @@
|
|
|
1
|
-
import { InputWidgetAdapter as
|
|
1
|
+
import { InputWidgetAdapter as o, formContext as l, inputContext as n } from "@golemui/lit";
|
|
2
2
|
import "@golemui/gui-components/textinput";
|
|
3
3
|
import { consume as u, provide as h } from "@lit/context";
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { property as
|
|
6
|
-
import { unsubscribeAll as
|
|
4
|
+
import { LitElement as m, html as c } from "lit";
|
|
5
|
+
import { property as b } from "lit/decorators.js";
|
|
6
|
+
import { unsubscribeAll as f, safeDefine as g } from "@golemui/lit/internals";
|
|
7
7
|
import "rxjs";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { live as v } from "lit/directives/live.js";
|
|
9
|
+
var $ = Object.defineProperty, d = (r, e, a, x) => {
|
|
10
|
+
for (var t = void 0, i = r.length - 1, s; i >= 0; i--)
|
|
11
|
+
(s = r[i]) && (t = s(e, a, t) || t);
|
|
12
|
+
return t && $(e, a, t), t;
|
|
12
13
|
};
|
|
13
|
-
class
|
|
14
|
+
class p extends m {
|
|
14
15
|
constructor() {
|
|
15
|
-
super(...arguments), this.adapter = new
|
|
16
|
+
super(...arguments), this.adapter = new o(), this.subscriptions = [];
|
|
16
17
|
}
|
|
17
18
|
createRenderRoot() {
|
|
18
19
|
return this;
|
|
19
20
|
}
|
|
20
|
-
updated(e) {
|
|
21
|
-
super.updated(e);
|
|
22
|
-
const t = this.adapter.templateData.size;
|
|
23
|
-
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
24
|
-
}
|
|
25
21
|
connectedCallback() {
|
|
26
22
|
super.connectedCallback(), this.classList.add("gui-textinput", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
27
23
|
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
28
24
|
);
|
|
29
25
|
}
|
|
30
26
|
render() {
|
|
31
|
-
return super.render(),
|
|
27
|
+
return super.render(), c`
|
|
32
28
|
<gui-textinput
|
|
33
29
|
.uid=${this.widget.uid}
|
|
34
30
|
.label=${this.adapter.templateData.label}
|
|
35
31
|
.hint=${this.adapter.templateData.hint}
|
|
36
32
|
.errors=${this.adapter.templateData.errors}
|
|
37
|
-
|
|
33
|
+
.touched=${this.adapter.templateData.touched}
|
|
38
34
|
?required=${this.adapter.templateData.validator?.required}
|
|
39
35
|
?disabled=${this.adapter.templateData.disabled}
|
|
40
36
|
?readonly=${this.adapter.templateData.readonly}
|
|
41
|
-
.value=${this.adapter.templateData.value}
|
|
37
|
+
.value=${v(this.adapter.templateData.value)}
|
|
42
38
|
.icon=${this.adapter.templateData.icon}
|
|
43
39
|
.placeholder=${this.adapter.templateData.placeholder}
|
|
44
40
|
.autocomplete=${this.adapter.templateData.autocomplete}
|
|
45
|
-
@input=${this.valueChanged}
|
|
46
|
-
@blur=${() => this.adapter.onBlur()}
|
|
41
|
+
@gui-input=${this.valueChanged}
|
|
42
|
+
@gui-blur=${() => this.adapter.onBlur()}
|
|
47
43
|
></gui-textinput>
|
|
48
44
|
`;
|
|
49
45
|
}
|
|
50
46
|
valueChanged(e) {
|
|
51
|
-
const
|
|
52
|
-
this.adapter.valueChanged(
|
|
47
|
+
const a = e.detail.value;
|
|
48
|
+
this.adapter.valueChanged(a);
|
|
53
49
|
}
|
|
54
50
|
disconnectedCallback() {
|
|
55
|
-
super.disconnectedCallback(), this.adapter.destroy(),
|
|
51
|
+
super.disconnectedCallback(), this.adapter.destroy(), f(this.subscriptions);
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
d([
|
|
59
|
-
u({ context:
|
|
60
|
-
|
|
61
|
-
],
|
|
55
|
+
u({ context: l }),
|
|
56
|
+
b({ attribute: !1 })
|
|
57
|
+
], p.prototype, "formContext");
|
|
62
58
|
d([
|
|
63
59
|
h({ context: n })
|
|
64
|
-
],
|
|
65
|
-
|
|
60
|
+
], p.prototype, "adapter");
|
|
61
|
+
g("gui-textinput-input", p);
|
|
66
62
|
export {
|
|
67
|
-
|
|
63
|
+
p as TextinputElement
|
|
68
64
|
};
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import { InputWidgetAdapter as l, formContext as d, inputContext as
|
|
1
|
+
import { InputWidgetAdapter as l, formContext as d, inputContext as u } from "@golemui/lit";
|
|
2
2
|
import "@golemui/gui-components/time-picker";
|
|
3
|
-
import { consume as
|
|
4
|
-
import { LitElement as
|
|
3
|
+
import { consume as m, provide as p } from "@lit/context";
|
|
4
|
+
import { LitElement as c, html as h } from "lit";
|
|
5
5
|
import { property as g } from "lit/decorators.js";
|
|
6
6
|
import { unsubscribeAll as b, safeDefine as $ } from "@golemui/lit/internals";
|
|
7
7
|
import "rxjs";
|
|
8
|
-
var f = Object.defineProperty,
|
|
9
|
-
for (var t = void 0,
|
|
10
|
-
(
|
|
11
|
-
return t && f(e,
|
|
8
|
+
var f = Object.defineProperty, o = (i, e, s, v) => {
|
|
9
|
+
for (var t = void 0, a = i.length - 1, n; a >= 0; a--)
|
|
10
|
+
(n = i[a]) && (t = n(e, s, t) || t);
|
|
11
|
+
return t && f(e, s, t), t;
|
|
12
12
|
};
|
|
13
|
-
class
|
|
13
|
+
class r extends c {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments), this.adapter = new l(), this.subscriptions = [];
|
|
16
16
|
}
|
|
17
17
|
createRenderRoot() {
|
|
18
18
|
return this;
|
|
19
19
|
}
|
|
20
|
-
updated(e) {
|
|
21
|
-
super.updated(e);
|
|
22
|
-
const i = this.adapter.templateData.size;
|
|
23
|
-
i ? this.style.flex = String(i) : this.style.removeProperty("flex");
|
|
24
|
-
}
|
|
25
20
|
connectedCallback() {
|
|
26
21
|
super.connectedCallback(), this.classList.add("gui-time-picker", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
27
22
|
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
@@ -30,13 +25,13 @@ class s extends h {
|
|
|
30
25
|
render() {
|
|
31
26
|
super.render();
|
|
32
27
|
const e = this.adapter.templateData;
|
|
33
|
-
return
|
|
28
|
+
return h`
|
|
34
29
|
<gui-time-picker
|
|
35
30
|
.uid=${this.widget.uid}
|
|
36
31
|
.label=${e.label}
|
|
37
32
|
.hint=${e.hint}
|
|
38
33
|
.errors=${e.errors}
|
|
39
|
-
|
|
34
|
+
.touched=${e.touched}
|
|
40
35
|
?required=${e.validator?.required}
|
|
41
36
|
?disabled=${e.disabled}
|
|
42
37
|
?readonly=${e.readonly}
|
|
@@ -60,9 +55,9 @@ class s extends h {
|
|
|
60
55
|
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
61
56
|
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
62
57
|
.incompleteMessage=${e.incompleteMessage}
|
|
63
|
-
@
|
|
64
|
-
@blur=${() => this.adapter.onBlur()}
|
|
65
|
-
@
|
|
58
|
+
@gui-input-error=${this.onInputError}
|
|
59
|
+
@gui-blur=${() => this.adapter.onBlur()}
|
|
60
|
+
@gui-input=${this.valueChanged}
|
|
66
61
|
></gui-time-picker>
|
|
67
62
|
`;
|
|
68
63
|
}
|
|
@@ -76,14 +71,14 @@ class s extends h {
|
|
|
76
71
|
super.disconnectedCallback(), this.adapter.destroy(), b(this.subscriptions);
|
|
77
72
|
}
|
|
78
73
|
}
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
o([
|
|
75
|
+
m({ context: d }),
|
|
81
76
|
g({ attribute: !1 })
|
|
82
|
-
],
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
],
|
|
86
|
-
$("gui-time-picker-input",
|
|
77
|
+
], r.prototype, "formContext");
|
|
78
|
+
o([
|
|
79
|
+
p({ context: u })
|
|
80
|
+
], r.prototype, "adapter");
|
|
81
|
+
$("gui-time-picker-input", r);
|
|
87
82
|
export {
|
|
88
|
-
|
|
83
|
+
r as TimePickerElement
|
|
89
84
|
};
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import { InputWidgetAdapter as l, formContext as
|
|
1
|
+
import { InputWidgetAdapter as l, formContext as m, inputContext as o } from "@golemui/lit";
|
|
2
2
|
import { addIcon as n } from "@golemui/gui-components/internals";
|
|
3
|
-
import { unsubscribeAll as
|
|
3
|
+
import { unsubscribeAll as u, safeDefine as h } from "@golemui/lit/internals";
|
|
4
4
|
import "@golemui/gui-components/time-input";
|
|
5
5
|
import { consume as c, provide as $ } from "@lit/context";
|
|
6
|
-
import { LitElement as
|
|
6
|
+
import { LitElement as g, html as b } from "lit";
|
|
7
7
|
import { property as D } from "lit/decorators.js";
|
|
8
8
|
import "rxjs";
|
|
9
9
|
import { classMap as f } from "lit/directives/class-map.js";
|
|
10
|
-
var
|
|
11
|
-
for (var e = void 0,
|
|
12
|
-
(p = i
|
|
13
|
-
return e &&
|
|
10
|
+
var C = Object.defineProperty, d = (a, t, s, v) => {
|
|
11
|
+
for (var e = void 0, i = a.length - 1, p; i >= 0; i--)
|
|
12
|
+
(p = a[i]) && (e = p(t, s, e) || e);
|
|
13
|
+
return e && C(t, s, e), e;
|
|
14
14
|
};
|
|
15
|
-
class
|
|
15
|
+
class r extends g {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), this.adapter = new l(), this.subscriptions = [];
|
|
18
18
|
}
|
|
19
19
|
createRenderRoot() {
|
|
20
20
|
return this;
|
|
21
21
|
}
|
|
22
|
-
updated(t) {
|
|
23
|
-
super.updated(t);
|
|
24
|
-
const a = this.adapter.templateData.size;
|
|
25
|
-
a ? this.style.flex = String(a) : this.style.removeProperty("flex");
|
|
26
|
-
}
|
|
27
22
|
connectedCallback() {
|
|
28
23
|
super.connectedCallback(), this.classList.add("gui-time", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
29
24
|
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
@@ -32,14 +27,14 @@ class s extends b {
|
|
|
32
27
|
render() {
|
|
33
28
|
super.render();
|
|
34
29
|
const t = n("time", this.adapter.templateData);
|
|
35
|
-
return
|
|
30
|
+
return b`
|
|
36
31
|
<gui-time
|
|
37
32
|
class=${f(t.widgetClasses)}
|
|
38
33
|
.uid=${this.widget.uid}
|
|
39
34
|
.label=${this.adapter.templateData.label}
|
|
40
35
|
.hint=${this.adapter.templateData.hint}
|
|
41
36
|
.errors=${this.adapter.templateData.errors}
|
|
42
|
-
|
|
37
|
+
.touched=${this.adapter.templateData.touched}
|
|
43
38
|
?required=${this.adapter.templateData.validator?.required}
|
|
44
39
|
?disabled=${this.adapter.templateData.disabled}
|
|
45
40
|
?readonly=${this.adapter.templateData.readonly}
|
|
@@ -56,9 +51,9 @@ class s extends b {
|
|
|
56
51
|
.minTimeMessage=${this.adapter.templateData.minTimeMessage}
|
|
57
52
|
.maxTimeMessage=${this.adapter.templateData.maxTimeMessage}
|
|
58
53
|
.incompleteMessage=${this.adapter.templateData.incompleteMessage}
|
|
59
|
-
@
|
|
60
|
-
@blur=${() => this.adapter.onBlur()}
|
|
61
|
-
@
|
|
54
|
+
@gui-input-error=${this.onInputError}
|
|
55
|
+
@gui-blur=${() => this.adapter.onBlur()}
|
|
56
|
+
@gui-input=${this.valueChanged}
|
|
62
57
|
></gui-time>
|
|
63
58
|
`;
|
|
64
59
|
}
|
|
@@ -69,17 +64,17 @@ class s extends b {
|
|
|
69
64
|
this.adapter.injectValidationIssues([t.detail.message]);
|
|
70
65
|
}
|
|
71
66
|
disconnectedCallback() {
|
|
72
|
-
super.disconnectedCallback(), this.adapter.destroy(),
|
|
67
|
+
super.disconnectedCallback(), this.adapter.destroy(), u(this.subscriptions);
|
|
73
68
|
}
|
|
74
69
|
}
|
|
75
70
|
d([
|
|
76
|
-
c({ context:
|
|
71
|
+
c({ context: m }),
|
|
77
72
|
D({ attribute: !1 })
|
|
78
|
-
],
|
|
73
|
+
], r.prototype, "formContext");
|
|
79
74
|
d([
|
|
80
|
-
$({ context:
|
|
81
|
-
],
|
|
82
|
-
|
|
75
|
+
$({ context: o })
|
|
76
|
+
], r.prototype, "adapter");
|
|
77
|
+
h("gui-time-input", r);
|
|
83
78
|
export {
|
|
84
|
-
|
|
79
|
+
r as TimeElement
|
|
85
80
|
};
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { InputWidgetAdapter as
|
|
1
|
+
import { InputWidgetAdapter as d, formContext as l, inputContext as n } from "@golemui/lit";
|
|
2
2
|
import "@golemui/gui-components/toggle";
|
|
3
3
|
import { consume as u, provide as h } from "@lit/context";
|
|
4
4
|
import { LitElement as m, html as c } from "lit";
|
|
5
5
|
import { property as g } from "lit/decorators.js";
|
|
6
|
-
import { unsubscribeAll as
|
|
6
|
+
import { unsubscribeAll as b, safeDefine as f } from "@golemui/lit/internals";
|
|
7
7
|
import "rxjs";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { live as v } from "lit/directives/live.js";
|
|
9
|
+
var C = Object.defineProperty, p = (r, e, a, $) => {
|
|
10
|
+
for (var t = void 0, i = r.length - 1, o; i >= 0; i--)
|
|
11
|
+
(o = r[i]) && (t = o(e, a, t) || t);
|
|
12
|
+
return t && C(e, a, t), t;
|
|
12
13
|
};
|
|
13
14
|
class s extends m {
|
|
14
15
|
constructor() {
|
|
15
|
-
super(...arguments), this.adapter = new
|
|
16
|
+
super(...arguments), this.adapter = new d(), this.subscriptions = [];
|
|
16
17
|
}
|
|
17
18
|
createRenderRoot() {
|
|
18
19
|
return this;
|
|
19
20
|
}
|
|
20
|
-
updated(e) {
|
|
21
|
-
super.updated(e);
|
|
22
|
-
const t = this.adapter.templateData.size;
|
|
23
|
-
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
24
|
-
}
|
|
25
21
|
connectedCallback() {
|
|
26
22
|
super.connectedCallback(), this.classList.add("gui-toggle", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
27
23
|
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
@@ -33,34 +29,34 @@ class s extends m {
|
|
|
33
29
|
.uid=${this.widget.uid}
|
|
34
30
|
.label=${this.adapter.templateData.label}
|
|
35
31
|
.errors=${this.adapter.templateData.errors}
|
|
36
|
-
|
|
32
|
+
.touched=${this.adapter.templateData.touched}
|
|
37
33
|
?required=${this.adapter.templateData.validator?.required}
|
|
38
34
|
?disabled=${this.adapter.templateData.disabled}
|
|
39
35
|
?readonly=${this.adapter.templateData.readonly}
|
|
40
|
-
.value=${this.adapter.templateData.value}
|
|
36
|
+
.value=${v(this.adapter.templateData.value)}
|
|
41
37
|
.hint=${this.adapter.templateData.hint}
|
|
42
38
|
.togglePosition=${this.adapter.templateData.togglePosition}
|
|
43
|
-
@
|
|
44
|
-
@blur=${() => this.adapter.onBlur()}
|
|
39
|
+
@gui-input=${this.valueChanged}
|
|
40
|
+
@gui-blur=${() => this.adapter.onBlur()}
|
|
45
41
|
></gui-toggle>
|
|
46
42
|
`;
|
|
47
43
|
}
|
|
48
44
|
valueChanged(e) {
|
|
49
|
-
const
|
|
50
|
-
this.adapter.valueChanged(
|
|
45
|
+
const a = e.detail.value;
|
|
46
|
+
this.adapter.valueChanged(a);
|
|
51
47
|
}
|
|
52
48
|
disconnectedCallback() {
|
|
53
|
-
super.disconnectedCallback(), this.adapter.destroy(),
|
|
49
|
+
super.disconnectedCallback(), this.adapter.destroy(), b(this.subscriptions);
|
|
54
50
|
}
|
|
55
51
|
}
|
|
56
|
-
|
|
52
|
+
p([
|
|
57
53
|
u({ context: l }),
|
|
58
54
|
g({ attribute: !1 })
|
|
59
55
|
], s.prototype, "formContext");
|
|
60
|
-
|
|
56
|
+
p([
|
|
61
57
|
h({ context: n })
|
|
62
58
|
], s.prototype, "adapter");
|
|
63
|
-
|
|
59
|
+
f("gui-toggle-input", s);
|
|
64
60
|
export {
|
|
65
61
|
s as ToggleElement
|
|
66
62
|
};
|