@golemui/gui-lit 1.2.0 → 1.2.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 +31 -0
- package/{accordion.element-BIgxl5e9.js → accordion.element-C9GzfKrY.js} +29 -30
- package/alert.element-CHn49Yaf.js +55 -0
- package/button.element-C9fHivSw.js +59 -0
- package/{calendar.element-Cv3RBphf.js → calendar.element-XkojKTJk.js} +30 -31
- package/checkbox.element-DU_tVMXu.js +66 -0
- package/currency.element-BmAH5KS_.js +73 -0
- package/date-picker.element-Bg3rF95F.js +94 -0
- package/{date-time-calendar.element-DlbWZjoe.js → date-time-calendar.element-sywQCeQQ.js} +24 -24
- package/date-time-picker.element-HHpwjWTQ.js +107 -0
- package/{date-time.element-CLLxM2nV.js → date-time.element-ucETvSTC.js} +26 -26
- package/{date.element-B8ZHK9KJ.js → date.element-BEHGxRFF.js} +27 -27
- package/default-list-item-renderer-CuPJ9jUD.js +24 -0
- package/{dropdown.element-DMZ7oL5n.js → dropdown.element-DUqG_p1x.js} +85 -84
- package/{flex.element-DG4Uaj_X.js → flex.element-pwba7621.js} +27 -28
- package/{grid.element-DCZsh-3J.js → grid.element-C8K7_Qi3.js} +29 -30
- package/index.js +1316 -3883
- package/index.umd.cjs +117 -2132
- package/{list.element-ADtUK2na.js → list.element-ZtEMKE2x.js} +41 -40
- package/markdown-text.element-DDm36qD0.js +54 -0
- package/markdown.element-DWz3U9rG.js +84 -0
- package/number.element-VkG5wScD.js +71 -0
- package/package.json +6 -6
- package/password.element-C5vQHq5P.js +72 -0
- package/radiogroup.element-CKdO9HwO.js +69 -0
- package/{range-calendar.element-D5eb2f7p.js → range-calendar.element-BznGrej5.js} +23 -24
- package/{range-date-input.element-C35grlYo.js → range-date-input.element-BloTHRDl.js} +24 -24
- package/range-date-picker.element-DKhwFasW.js +98 -0
- package/{range-date-time-calendar.element-BV0J96Gu.js → range-date-time-calendar.element-CZCET-sb.js} +26 -26
- package/{range-date-time-input.element-CzgRbR9F.js → range-date-time-input.element-Dr2VrYhG.js} +24 -24
- package/range-date-time-picker.element-CYeIMWLp.js +109 -0
- package/{range-time-input.element-BOHLUO8z.js → range-time-input.element-7OZhPQqx.js} +23 -23
- package/range-time-picker.element-D0mRFZkK.js +96 -0
- package/renderer.element-DbsFoBba.js +48 -0
- package/{repeater.element-Da8YN1Vy.js → repeater.element-DGEbwvhY.js} +54 -65
- package/select.element-Bb_9jAVB.js +76 -0
- package/{tabs.element-CvcIA8P3.js → tabs.element-BYDNF_pm.js} +49 -50
- package/tags.element-BSN3i9Gx.js +73 -0
- package/textarea.element-Dl1ZEOqO.js +71 -0
- package/textinput.element-C5Vbbkxq.js +68 -0
- package/{time-picker.element-C3oR0EkQ.js → time-picker.element-Crmj9YDy.js} +26 -26
- package/{time.element-X286nthD.js → time.element-DfSeAZp4.js} +29 -29
- package/toggle.element-ORsprZ2M.js +66 -0
- package/alert.element-DPWq9-0F.js +0 -56
- package/button.element-CJay43iR.js +0 -132
- package/calendar-DleRbmvP.js +0 -267
- package/checkbox.element-CpmrzdH0.js +0 -200
- package/currency.element-Cezgzbbs.js +0 -276
- package/date-DBuYpvcO.js +0 -849
- package/date-input-B3yHsn-g.js +0 -204
- package/date-picker.element-ByZefznr.js +0 -357
- package/date-time-calendar-CB5cNoOX.js +0 -374
- package/date-time-input-DrY68YDX.js +0 -246
- package/date-time-picker.element-CYwmumfq.js +0 -440
- package/day-status-ljexnwEO.js +0 -554
- package/errors-Bs_vYN-_.js +0 -110
- package/focus-leave.controller-2gV0pQd5.js +0 -73
- package/list-D730tmGN.js +0 -297
- package/markdown-text-X-BRJT6K.js +0 -30
- package/markdown-text.element-B8TfVLIO.js +0 -55
- package/markdown.element-D5zcxAUS.js +0 -693
- package/number.element-DEY5tR_y.js +0 -291
- package/numeric-jmOOKz30.js +0 -12
- package/one-of-anKkm7mD.js +0 -50
- package/part-templates-VORbpgs2.js +0 -691
- package/password.element-C1aQh_iz.js +0 -240
- package/pill-ranges-DpvWwP-3.js +0 -48
- package/pills-BDMO2NiR.js +0 -348
- package/popup.controller-B33OvX_y.js +0 -86
- package/radiogroup.element-B2G-XyGx.js +0 -235
- package/range-calendar-D7sG24Kx.js +0 -466
- package/range-commit-8-MmYUyo.js +0 -14
- package/range-date-input-BChaoBC1.js +0 -311
- package/range-date-picker.element-Do5YsL5V.js +0 -434
- package/range-date-time-calendar-DulGK2EQ.js +0 -734
- package/range-date-time-input-8ggqckP7.js +0 -353
- package/range-date-time-picker.element-hi5KdopZ.js +0 -472
- package/range-selection-CU3hxLJE.js +0 -25
- package/range-time-input-D7GFdDeA.js +0 -348
- package/range-time-picker.element-DDNQMA_u.js +0 -470
- package/renderer.element-CNyMn2Lu.js +0 -49
- package/select.element-SDxBhGjz.js +0 -266
- package/tabs-DzSCq_98.js +0 -13
- package/tags.element-Bnhfevp3.js +0 -369
- package/templates-Df7abEkB.js +0 -92
- package/textarea.element-Dx7eYEnl.js +0 -239
- package/textinput.element-BnIoDRmY.js +0 -205
- package/time-input-Kk4EX6at.js +0 -201
- package/time-list-DLcq8BAp.js +0 -217
- package/time-picker-DLj1rhOf.js +0 -299
- package/toggle.element-Dokdat_o.js +0 -203
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { InputWidgetAdapter as
|
|
2
|
-
import "
|
|
3
|
-
import { consume as p, provide as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { property as
|
|
1
|
+
import { InputWidgetAdapter as l, formContext as d, inputContext as m } from "@golemui/lit";
|
|
2
|
+
import "@golemui/gui-components/time-picker";
|
|
3
|
+
import { consume as p, provide as u } from "@lit/context";
|
|
4
|
+
import { LitElement as h, html as c } from "lit";
|
|
5
|
+
import { property as g } from "lit/decorators.js";
|
|
6
|
+
import { safeDefine as b } from "@golemui/lit/internals";
|
|
6
7
|
import "rxjs";
|
|
7
|
-
var
|
|
8
|
-
for (var
|
|
9
|
-
(
|
|
10
|
-
return
|
|
8
|
+
var $ = Object.defineProperty, n = (a, e, i, f) => {
|
|
9
|
+
for (var t = void 0, r = a.length - 1, o; r >= 0; r--)
|
|
10
|
+
(o = a[r]) && (t = o(e, i, t) || t);
|
|
11
|
+
return t && $(e, i, t), t;
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
class s extends h {
|
|
13
14
|
constructor() {
|
|
14
|
-
super(...arguments), this.adapter = new
|
|
15
|
+
super(...arguments), this.adapter = new l(), this.subscriptions = [];
|
|
15
16
|
}
|
|
16
17
|
createRenderRoot() {
|
|
17
18
|
return this;
|
|
18
19
|
}
|
|
19
20
|
updated(e) {
|
|
20
21
|
super.updated(e);
|
|
21
|
-
const
|
|
22
|
-
|
|
22
|
+
const i = this.adapter.templateData.size;
|
|
23
|
+
i ? this.style.flex = String(i) : this.style.removeProperty("flex");
|
|
23
24
|
}
|
|
24
25
|
connectedCallback() {
|
|
25
26
|
super.connectedCallback(), this.classList.add("gui-time-picker", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
@@ -29,7 +30,7 @@ let r = class extends c {
|
|
|
29
30
|
render() {
|
|
30
31
|
super.render();
|
|
31
32
|
const e = this.adapter.templateData;
|
|
32
|
-
return
|
|
33
|
+
return c`
|
|
33
34
|
<gui-time-picker
|
|
34
35
|
.uid=${this.widget.uid}
|
|
35
36
|
.label=${e.label}
|
|
@@ -58,6 +59,7 @@ let r = class extends c {
|
|
|
58
59
|
.maxTimeMessage=${e.maxTimeMessage}
|
|
59
60
|
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
60
61
|
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
62
|
+
.incompleteMessage=${e.incompleteMessage}
|
|
61
63
|
@inputError=${this.onInputError}
|
|
62
64
|
@blur=${() => this.adapter.onBlur()}
|
|
63
65
|
@change=${this.valueChanged}
|
|
@@ -73,17 +75,15 @@ let r = class extends c {
|
|
|
73
75
|
disconnectedCallback() {
|
|
74
76
|
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
|
|
75
77
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
p({ context:
|
|
79
|
-
|
|
80
|
-
],
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
],
|
|
84
|
-
|
|
85
|
-
$("gui-time-picker-input")
|
|
86
|
-
], r);
|
|
78
|
+
}
|
|
79
|
+
n([
|
|
80
|
+
p({ context: d }),
|
|
81
|
+
g({ attribute: !1 })
|
|
82
|
+
], s.prototype, "formContext");
|
|
83
|
+
n([
|
|
84
|
+
u({ context: m })
|
|
85
|
+
], s.prototype, "adapter");
|
|
86
|
+
b("gui-time-picker-input", s);
|
|
87
87
|
export {
|
|
88
|
-
|
|
88
|
+
s as TimePickerElement
|
|
89
89
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { InputWidgetAdapter as
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
1
|
+
import { InputWidgetAdapter as l, formContext as o, inputContext as m } from "@golemui/lit";
|
|
2
|
+
import { addIcon as n } from "@golemui/gui-components/internals";
|
|
3
|
+
import { safeDefine as h } from "@golemui/lit/internals";
|
|
4
|
+
import "@golemui/gui-components/time-input";
|
|
4
5
|
import { consume as u, provide as c } from "@lit/context";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { property as
|
|
6
|
+
import { LitElement as $, html as b } from "lit";
|
|
7
|
+
import { property as g } from "lit/decorators.js";
|
|
7
8
|
import "rxjs";
|
|
8
|
-
import { classMap as
|
|
9
|
-
var
|
|
10
|
-
for (var
|
|
11
|
-
(
|
|
12
|
-
return
|
|
9
|
+
import { classMap as D } from "lit/directives/class-map.js";
|
|
10
|
+
var f = Object.defineProperty, d = (i, t, a, x) => {
|
|
11
|
+
for (var e = void 0, r = i.length - 1, p; r >= 0; r--)
|
|
12
|
+
(p = i[r]) && (e = p(t, a, e) || e);
|
|
13
|
+
return e && f(t, a, e), e;
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
+
class s extends $ {
|
|
15
16
|
constructor() {
|
|
16
|
-
super(...arguments), this.adapter = new
|
|
17
|
+
super(...arguments), this.adapter = new l(), this.subscriptions = [];
|
|
17
18
|
}
|
|
18
19
|
createRenderRoot() {
|
|
19
20
|
return this;
|
|
20
21
|
}
|
|
21
22
|
updated(t) {
|
|
22
23
|
super.updated(t);
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const a = this.adapter.templateData.size;
|
|
25
|
+
a ? this.style.flex = String(a) : this.style.removeProperty("flex");
|
|
25
26
|
}
|
|
26
27
|
connectedCallback() {
|
|
27
28
|
super.connectedCallback(), this.classList.add("gui-time", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
@@ -30,10 +31,10 @@ let r = class extends b {
|
|
|
30
31
|
}
|
|
31
32
|
render() {
|
|
32
33
|
super.render();
|
|
33
|
-
const t =
|
|
34
|
-
return
|
|
34
|
+
const t = n("time", this.adapter.templateData);
|
|
35
|
+
return b`
|
|
35
36
|
<gui-time
|
|
36
|
-
class=${
|
|
37
|
+
class=${D(t.widgetClasses)}
|
|
37
38
|
.uid=${this.widget.uid}
|
|
38
39
|
.label=${this.adapter.templateData.label}
|
|
39
40
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -54,6 +55,7 @@ let r = class extends b {
|
|
|
54
55
|
.maxTime=${this.adapter.templateData.maxTime}
|
|
55
56
|
.minTimeMessage=${this.adapter.templateData.minTimeMessage}
|
|
56
57
|
.maxTimeMessage=${this.adapter.templateData.maxTimeMessage}
|
|
58
|
+
.incompleteMessage=${this.adapter.templateData.incompleteMessage}
|
|
57
59
|
@inputError=${this.onInputError}
|
|
58
60
|
@blur=${() => this.adapter.onBlur()}
|
|
59
61
|
@change=${this.valueChanged}
|
|
@@ -69,17 +71,15 @@ let r = class extends b {
|
|
|
69
71
|
disconnectedCallback() {
|
|
70
72
|
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
|
|
71
73
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
u({ context:
|
|
75
|
-
|
|
76
|
-
],
|
|
77
|
-
|
|
78
|
-
c({ context:
|
|
79
|
-
],
|
|
80
|
-
|
|
81
|
-
g("gui-time-input")
|
|
82
|
-
], r);
|
|
74
|
+
}
|
|
75
|
+
d([
|
|
76
|
+
u({ context: o }),
|
|
77
|
+
g({ attribute: !1 })
|
|
78
|
+
], s.prototype, "formContext");
|
|
79
|
+
d([
|
|
80
|
+
c({ context: m })
|
|
81
|
+
], s.prototype, "adapter");
|
|
82
|
+
h("gui-time-input", s);
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
s as TimeElement
|
|
85
85
|
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { InputWidgetAdapter as p, formContext as l, inputContext as n } from "@golemui/lit";
|
|
2
|
+
import "@golemui/gui-components/toggle";
|
|
3
|
+
import { consume as u, provide as h } from "@lit/context";
|
|
4
|
+
import { LitElement as c, html as m } from "lit";
|
|
5
|
+
import { property as g } from "lit/decorators.js";
|
|
6
|
+
import { safeDefine as f } from "@golemui/lit/internals";
|
|
7
|
+
import "rxjs";
|
|
8
|
+
var b = Object.defineProperty, d = (r, t, e, v) => {
|
|
9
|
+
for (var a = void 0, i = r.length - 1, o; i >= 0; i--)
|
|
10
|
+
(o = r[i]) && (a = o(t, e, a) || a);
|
|
11
|
+
return a && b(t, e, a), a;
|
|
12
|
+
};
|
|
13
|
+
class s extends c {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.adapter = new p(), this.subscriptions = [];
|
|
16
|
+
}
|
|
17
|
+
createRenderRoot() {
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
updated(t) {
|
|
21
|
+
super.updated(t);
|
|
22
|
+
const e = this.adapter.templateData.size;
|
|
23
|
+
e ? this.style.flex = String(e) : this.style.removeProperty("flex");
|
|
24
|
+
}
|
|
25
|
+
connectedCallback() {
|
|
26
|
+
super.connectedCallback(), this.classList.add("gui-toggle", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
27
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
return super.render(), m`
|
|
32
|
+
<gui-toggle
|
|
33
|
+
.uid=${this.widget.uid}
|
|
34
|
+
.label=${this.adapter.templateData.label}
|
|
35
|
+
.errors=${this.adapter.templateData.errors}
|
|
36
|
+
?touched=${this.adapter.templateData.touched}
|
|
37
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
38
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
39
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
40
|
+
.value=${this.adapter.templateData.value}
|
|
41
|
+
.hint=${this.adapter.templateData.hint}
|
|
42
|
+
.togglePosition=${this.adapter.templateData.togglePosition}
|
|
43
|
+
@change=${this.valueChanged}
|
|
44
|
+
@blur=${() => this.adapter.onBlur()}
|
|
45
|
+
></gui-toggle>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
valueChanged(t) {
|
|
49
|
+
const e = t.detail.value;
|
|
50
|
+
this.adapter.valueChanged(e);
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
d([
|
|
57
|
+
u({ context: l }),
|
|
58
|
+
g({ attribute: !1 })
|
|
59
|
+
], s.prototype, "formContext");
|
|
60
|
+
d([
|
|
61
|
+
h({ context: n })
|
|
62
|
+
], s.prototype, "adapter");
|
|
63
|
+
f("gui-toggle-input", s);
|
|
64
|
+
export {
|
|
65
|
+
s as ToggleElement
|
|
66
|
+
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { LitElement as d, html as n } from "lit";
|
|
2
|
-
import { property as c, customElement as u } from "lit/decorators.js";
|
|
3
|
-
import { consume as h, provide as m } from "@lit/context";
|
|
4
|
-
import { DisplayWidgetAdapter as f, formContext as b, displayWidgetContext as g } from "@golemui/lit";
|
|
5
|
-
import "rxjs";
|
|
6
|
-
var v = Object.defineProperty, x = Object.getOwnPropertyDescriptor, l = (r, t, a, i) => {
|
|
7
|
-
for (var e = i > 1 ? void 0 : i ? x(t, a) : t, o = r.length - 1, p; o >= 0; o--)
|
|
8
|
-
(p = r[o]) && (e = (i ? p(t, a, e) : p(e)) || e);
|
|
9
|
-
return i && e && v(t, a, e), e;
|
|
10
|
-
};
|
|
11
|
-
let s = class extends d {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments), this.adapter = new f(), this.subscriptions = [];
|
|
14
|
-
}
|
|
15
|
-
createRenderRoot() {
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
updated(r) {
|
|
19
|
-
super.updated(r);
|
|
20
|
-
const t = this.adapter.templateData.size;
|
|
21
|
-
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
22
|
-
}
|
|
23
|
-
connectedCallback() {
|
|
24
|
-
super.connectedCallback(), this.classList.add("gui-alert", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
25
|
-
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
return n`
|
|
30
|
-
<div class="gui-widget" id=${this.widget.uid}>
|
|
31
|
-
<div
|
|
32
|
-
role="alert"
|
|
33
|
-
class="gui-alert-notification gui-alert-notification--${this.adapter.templateData.level || "default"}"
|
|
34
|
-
>
|
|
35
|
-
${this.adapter.templateData.text}
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
`;
|
|
39
|
-
}
|
|
40
|
-
disconnectedCallback() {
|
|
41
|
-
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((r) => r.unsubscribe());
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
l([
|
|
45
|
-
h({ context: b }),
|
|
46
|
-
c({ attribute: !1 })
|
|
47
|
-
], s.prototype, "formContext", 2);
|
|
48
|
-
l([
|
|
49
|
-
m({ context: g })
|
|
50
|
-
], s.prototype, "adapter", 2);
|
|
51
|
-
s = l([
|
|
52
|
-
u("gui-alert-display")
|
|
53
|
-
], s);
|
|
54
|
-
export {
|
|
55
|
-
s as AlertElement
|
|
56
|
-
};
|
|
@@ -1,132 +0,0 @@
|
|
|
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 c, nothing as u } from "lit";
|
|
4
|
-
import { property as s, customElement as m } from "lit/decorators.js";
|
|
5
|
-
import "rxjs";
|
|
6
|
-
import { classMap as P } from "lit/directives/class-map.js";
|
|
7
|
-
var C = Object.defineProperty, D = Object.getOwnPropertyDescriptor, r = (i, t, n, o) => {
|
|
8
|
-
for (var e = o > 1 ? void 0 : o ? D(t, n) : t, p = i.length - 1, l; p >= 0; p--)
|
|
9
|
-
(l = i[p]) && (e = (o ? l(t, n, e) : l(e)) || e);
|
|
10
|
-
return o && e && C(t, n, e), e;
|
|
11
|
-
};
|
|
12
|
-
let a = class extends b {
|
|
13
|
-
constructor() {
|
|
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;
|
|
15
|
-
}
|
|
16
|
-
createRenderRoot() {
|
|
17
|
-
return this;
|
|
18
|
-
}
|
|
19
|
-
connectedCallback() {
|
|
20
|
-
super.connectedCallback(), this.classList.add("gui-field");
|
|
21
|
-
}
|
|
22
|
-
render() {
|
|
23
|
-
const i = this.icon, t = this.iconPosition || "left", n = {
|
|
24
|
-
"gui-button-with-icon": !!i,
|
|
25
|
-
[`gui-button-icon-${t}`]: !0,
|
|
26
|
-
"gui-button--outlined": this.variant === "outlined",
|
|
27
|
-
"gui-button--link": this.variant === "link",
|
|
28
|
-
"gui-button--invalid": this.invalid && this.actionType === "submit"
|
|
29
|
-
}, o = i ? c`<span
|
|
30
|
-
class="gui-widget-icon gui-button-icon ${i}"
|
|
31
|
-
data-icon=${i}
|
|
32
|
-
aria-hidden="true"
|
|
33
|
-
></span>` : u;
|
|
34
|
-
return c`
|
|
35
|
-
<div class="gui-widget">
|
|
36
|
-
<button
|
|
37
|
-
type=${this.actionType ?? "button"}
|
|
38
|
-
id=${this.uid}
|
|
39
|
-
class=${P(n)}
|
|
40
|
-
data-cy=${`${this.uid}_button`}
|
|
41
|
-
?disabled=${this.disabled}
|
|
42
|
-
>
|
|
43
|
-
${t === "left" ? o : u}
|
|
44
|
-
${this.label ? c`<span>${this.label}</span>` : u}
|
|
45
|
-
${t === "right" ? o : u}
|
|
46
|
-
</button>
|
|
47
|
-
</div>
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
r([
|
|
52
|
-
s({ type: String })
|
|
53
|
-
], a.prototype, "uid", 2);
|
|
54
|
-
r([
|
|
55
|
-
s({ type: String })
|
|
56
|
-
], a.prototype, "label", 2);
|
|
57
|
-
r([
|
|
58
|
-
s({ type: Boolean })
|
|
59
|
-
], a.prototype, "disabled", 2);
|
|
60
|
-
r([
|
|
61
|
-
s({ type: String })
|
|
62
|
-
], a.prototype, "icon", 2);
|
|
63
|
-
r([
|
|
64
|
-
s({ type: String })
|
|
65
|
-
], a.prototype, "variant", 2);
|
|
66
|
-
r([
|
|
67
|
-
s({ type: String })
|
|
68
|
-
], a.prototype, "iconPosition", 2);
|
|
69
|
-
r([
|
|
70
|
-
s({ type: String })
|
|
71
|
-
], a.prototype, "actionType", 2);
|
|
72
|
-
r([
|
|
73
|
-
s({ type: Boolean })
|
|
74
|
-
], a.prototype, "invalid", 2);
|
|
75
|
-
a = r([
|
|
76
|
-
m("gui-button")
|
|
77
|
-
], a);
|
|
78
|
-
typeof customElements < "u" && !customElements.get("gui-button") && customElements.define("gui-button", a);
|
|
79
|
-
var _ = Object.defineProperty, x = Object.getOwnPropertyDescriptor, h = (i, t, n, o) => {
|
|
80
|
-
for (var e = o > 1 ? void 0 : o ? x(t, n) : t, p = i.length - 1, l; p >= 0; p--)
|
|
81
|
-
(l = i[p]) && (e = (o ? l(t, n, e) : l(e)) || e);
|
|
82
|
-
return o && e && _(t, n, e), e;
|
|
83
|
-
};
|
|
84
|
-
let d = class extends b {
|
|
85
|
-
constructor() {
|
|
86
|
-
super(...arguments), this.adapter = new f(), this.subscriptions = [];
|
|
87
|
-
}
|
|
88
|
-
createRenderRoot() {
|
|
89
|
-
return this;
|
|
90
|
-
}
|
|
91
|
-
updated(i) {
|
|
92
|
-
super.updated(i);
|
|
93
|
-
const t = this.adapter.templateData.size;
|
|
94
|
-
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
95
|
-
}
|
|
96
|
-
connectedCallback() {
|
|
97
|
-
super.connectedCallback(), this.classList.add("gui-button", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
98
|
-
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
render() {
|
|
102
|
-
return c`
|
|
103
|
-
<gui-button
|
|
104
|
-
.uid=${this.widget.uid}
|
|
105
|
-
.actionType=${this.adapter.templateData.actionType ?? "button"}
|
|
106
|
-
.label=${this.adapter.templateData.label}
|
|
107
|
-
?disabled=${this.adapter.templateData.disabled === !0}
|
|
108
|
-
?invalid=${this.adapter.templateData.invalid === !0}
|
|
109
|
-
.variant=${this.adapter.templateData.variant}
|
|
110
|
-
.icon=${this.adapter.templateData.icon}
|
|
111
|
-
.iconPosition=${this.adapter.templateData.iconPosition}
|
|
112
|
-
@click=${() => this.adapter.click()}
|
|
113
|
-
></gui-button>
|
|
114
|
-
`;
|
|
115
|
-
}
|
|
116
|
-
disconnectedCallback() {
|
|
117
|
-
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((i) => i.unsubscribe());
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
h([
|
|
121
|
-
y({ context: g }),
|
|
122
|
-
s({ attribute: !1 })
|
|
123
|
-
], d.prototype, "formContext", 2);
|
|
124
|
-
h([
|
|
125
|
-
$({ context: v })
|
|
126
|
-
], d.prototype, "adapter", 2);
|
|
127
|
-
d = h([
|
|
128
|
-
m("gui-button-interactive")
|
|
129
|
-
], d);
|
|
130
|
-
export {
|
|
131
|
-
d as ButtonElement
|
|
132
|
-
};
|