@golemui/gui-lit 1.6.0-rc.1 → 2.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 +84 -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/{dropdown.element-Ckh9JvEK.js → dropdown.element-Djee1u1L.js} +15 -29
- 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 +289 -352
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- package/lib/components/multi-file-upload.element.d.ts +0 -1
- package/lib/components/multi-list.element.d.ts +0 -1
- 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-UIKmXzeH.js → list.element-DfLD2X8s.js} +37 -38
- 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-B1vV4rF-.js} +51 -65
- package/{multi-file-upload.element-DzAZAfc1.js → multi-file-upload.element-4h6JQgRF.js} +16 -21
- package/{multi-list.element-Bs-UN2Cy.js → multi-list.element-CNVHVkj0.js} +44 -45
- 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/flex.element-BW0_kx8z.js +0 -79
- package/grid.element-C019lV76.js +0 -78
- package/lib/components/flex.element.d.ts +0 -16
- package/tabs.element-BiVaQlvt.js +0 -171
|
@@ -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
|
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { LayoutWidgetAdapter as u, formContext as f, layoutContext as m } from "@golemui/lit";
|
|
2
|
-
import { repeaterIndexSuffix as g, accordionSectionId as c, accordionButtonId as p } from "@golemui/gui-shared/internals";
|
|
3
|
-
import { consume as v, provide as w } from "@lit/context";
|
|
4
|
-
import { LitElement as x, html as s, nothing as l } from "lit";
|
|
5
|
-
import { property as b } from "lit/decorators.js";
|
|
6
|
-
import { unsubscribeAll as S, safeDefine as $ } from "@golemui/lit/internals";
|
|
7
|
-
import "rxjs";
|
|
8
|
-
import { repeat as y } from "lit-html/directives/repeat.js";
|
|
9
|
-
import { classMap as C } from "lit/directives/class-map.js";
|
|
10
|
-
var D = Object.defineProperty, h = (r, t, e, a) => {
|
|
11
|
-
for (var i = void 0, d = r.length - 1, n; d >= 0; d--)
|
|
12
|
-
(n = r[d]) && (i = n(t, e, i) || i);
|
|
13
|
-
return i && D(t, e, i), i;
|
|
14
|
-
};
|
|
15
|
-
class o extends x {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments), this.activeSections = {}, this.adapter = new u(), this.subscriptions = [], this.rowIndexSuffix = "";
|
|
18
|
-
}
|
|
19
|
-
createRenderRoot() {
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
updated(t) {
|
|
23
|
-
super.updated(t);
|
|
24
|
-
const e = this.adapter.templateData.size;
|
|
25
|
-
e ? this.style.flex = String(e) : this.style.removeProperty("flex");
|
|
26
|
-
}
|
|
27
|
-
connectedCallback() {
|
|
28
|
-
super.connectedCallback(), this.classList.add("gui-accordion", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.activeSections = { ...this.adapter.templateData.defaultOpen ?? {} }, this.rowIndexSuffix = g(this.widget.uid), this.subscriptions.push(
|
|
29
|
-
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
onClickButton(t) {
|
|
33
|
-
this.adapter.templateData.singleOpen && Object.keys(this.activeSections).filter((e) => e !== t).forEach((e) => {
|
|
34
|
-
this.activeSections[e] = !1;
|
|
35
|
-
}), this.activeSections[t] = !this.activeSections[t], this.adapter.change({ ...this.activeSections }), this.requestUpdate();
|
|
36
|
-
}
|
|
37
|
-
getChild(t) {
|
|
38
|
-
return (this.adapter.templateData.children ?? []).find((a) => a.uid === `${t}${this.rowIndexSuffix}`);
|
|
39
|
-
}
|
|
40
|
-
render() {
|
|
41
|
-
return this.adapter.templateData ? s`
|
|
42
|
-
<div class="gui-widget" id=${this.widget.uid}>
|
|
43
|
-
${this.adapter.templateData.sections ? y(
|
|
44
|
-
this.adapter.templateData.sections,
|
|
45
|
-
(t) => t.uid,
|
|
46
|
-
(t) => {
|
|
47
|
-
const e = this.getChild(t.uid), a = e !== void 0 && (this.activeSections[t.uid] || this.adapter.templateData.renderMode !== "activeOnly") ? s`<section
|
|
48
|
-
class="gui-widget"
|
|
49
|
-
role="region"
|
|
50
|
-
id=${c(this.widget.uid, t.uid)}
|
|
51
|
-
?hidden=${!this.activeSections[t.uid] && this.adapter.templateData.renderMode !== "activeOnly"}
|
|
52
|
-
aria-labelledby=${p(this.widget.uid, t.uid)}
|
|
53
|
-
>
|
|
54
|
-
<gui-widget .widget=${e}></gui-widget>
|
|
55
|
-
</section>` : l;
|
|
56
|
-
return s`<div class="gui-accordion__section">
|
|
57
|
-
<button
|
|
58
|
-
type="button"
|
|
59
|
-
tabindex="0"
|
|
60
|
-
class=${C({
|
|
61
|
-
active: this.activeSections[t.uid]
|
|
62
|
-
})}
|
|
63
|
-
id=${p(this.widget.uid, t.uid)}
|
|
64
|
-
aria-controls=${c(this.widget.uid, t.uid)}
|
|
65
|
-
aria-expanded=${this.activeSections[t.uid] ? "true" : "false"}
|
|
66
|
-
@click=${() => this.onClickButton(t.uid)}
|
|
67
|
-
>
|
|
68
|
-
${t.label}<span class="gui-accordion__arrow"
|
|
69
|
-
><svg
|
|
70
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
71
|
-
width="16"
|
|
72
|
-
height="16"
|
|
73
|
-
viewBox="0 0 256 256"
|
|
74
|
-
>
|
|
75
|
-
<path
|
|
76
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
77
|
-
></path></svg
|
|
78
|
-
></span>
|
|
79
|
-
</button>
|
|
80
|
-
|
|
81
|
-
${a}
|
|
82
|
-
</div>`;
|
|
83
|
-
}
|
|
84
|
-
) : l}
|
|
85
|
-
</div>
|
|
86
|
-
` : s``;
|
|
87
|
-
}
|
|
88
|
-
disconnectedCallback() {
|
|
89
|
-
super.disconnectedCallback(), this.adapter.destroy(), S(this.subscriptions);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
h([
|
|
93
|
-
v({ context: f }),
|
|
94
|
-
b({ attribute: !1 })
|
|
95
|
-
], o.prototype, "formContext");
|
|
96
|
-
h([
|
|
97
|
-
w({ context: m })
|
|
98
|
-
], o.prototype, "adapter");
|
|
99
|
-
$("gui-accordion-layout", o);
|
|
100
|
-
export {
|
|
101
|
-
o as AccordionElement
|
|
102
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { LitElement as p, html as l } from "lit";
|
|
2
|
-
import { property as n } from "lit/decorators.js";
|
|
3
|
-
import { unsubscribeAll as c, safeDefine as u } from "@golemui/lit/internals";
|
|
4
|
-
import { consume as m, provide as f } from "@lit/context";
|
|
5
|
-
import { DisplayWidgetAdapter as h, formContext as g, displayWidgetContext as b } from "@golemui/lit";
|
|
6
|
-
import "rxjs";
|
|
7
|
-
var v = Object.defineProperty, d = (r, i, e, x) => {
|
|
8
|
-
for (var t = void 0, a = r.length - 1, o; a >= 0; a--)
|
|
9
|
-
(o = r[a]) && (t = o(i, e, t) || t);
|
|
10
|
-
return t && v(i, e, t), t;
|
|
11
|
-
};
|
|
12
|
-
class s extends p {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments), this.adapter = new h(), this.subscriptions = [];
|
|
15
|
-
}
|
|
16
|
-
createRenderRoot() {
|
|
17
|
-
return this;
|
|
18
|
-
}
|
|
19
|
-
updated(i) {
|
|
20
|
-
super.updated(i);
|
|
21
|
-
const e = this.adapter.templateData.size;
|
|
22
|
-
e ? this.style.flex = String(e) : this.style.removeProperty("flex");
|
|
23
|
-
}
|
|
24
|
-
connectedCallback() {
|
|
25
|
-
super.connectedCallback(), this.classList.add("gui-alert", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
26
|
-
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
render() {
|
|
30
|
-
return l`
|
|
31
|
-
<div class="gui-widget" id=${this.widget.uid}>
|
|
32
|
-
<div
|
|
33
|
-
role="alert"
|
|
34
|
-
class="gui-alert-notification gui-alert-notification--${this.adapter.templateData.level || "default"}"
|
|
35
|
-
>
|
|
36
|
-
${this.adapter.templateData.text}
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
`;
|
|
40
|
-
}
|
|
41
|
-
disconnectedCallback() {
|
|
42
|
-
super.disconnectedCallback(), this.adapter.destroy(), c(this.subscriptions);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
d([
|
|
46
|
-
m({ context: g }),
|
|
47
|
-
n({ attribute: !1 })
|
|
48
|
-
], s.prototype, "formContext");
|
|
49
|
-
d([
|
|
50
|
-
f({ context: b })
|
|
51
|
-
], s.prototype, "adapter");
|
|
52
|
-
u("gui-alert-display", s);
|
|
53
|
-
export {
|
|
54
|
-
s as AlertElement
|
|
55
|
-
};
|