@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,40 +1,31 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "@golemui/
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { getItemKey as c } from "@golemui/gui-shared/internals";
|
|
2
|
+
import { InputWidgetAdapter as l, formContext as h, inputContext as m } from "@golemui/lit";
|
|
3
|
+
import { consume as g, provide as b } from "@lit/context";
|
|
4
|
+
import { LitElement as f, nothing as i, html as a } from "lit";
|
|
5
|
+
import { repeat as $ } from "lit-html/directives/repeat.js";
|
|
6
|
+
import { property as v, state as _, query as I } from "lit/decorators.js";
|
|
7
|
+
import { safeDefine as C } from "@golemui/lit/internals";
|
|
8
8
|
import "rxjs";
|
|
9
|
-
import "
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
value: r,
|
|
16
|
-
enumerable: !1,
|
|
17
|
-
configurable: !1
|
|
18
|
-
}), r;
|
|
19
|
-
}
|
|
20
|
-
var y = Object.defineProperty, C = Object.getOwnPropertyDescriptor, u = (e, t, r, a) => {
|
|
21
|
-
for (var i = a > 1 ? void 0 : a ? C(t, r) : t, d = e.length - 1, p; d >= 0; d--)
|
|
22
|
-
(p = e[d]) && (i = (a ? p(t, r, i) : p(i)) || i);
|
|
23
|
-
return a && i && y(t, r, i), i;
|
|
9
|
+
import "@golemui/gui-components/label";
|
|
10
|
+
import "@golemui/gui-components/errors";
|
|
11
|
+
var w = Object.defineProperty, n = (d, e, r, o) => {
|
|
12
|
+
for (var t = void 0, u = d.length - 1, p; u >= 0; u--)
|
|
13
|
+
(p = d[u]) && (t = p(e, r, t) || t);
|
|
14
|
+
return t && w(e, r, t), t;
|
|
24
15
|
};
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
|
|
16
|
+
let y = 0;
|
|
17
|
+
const x = () => y++;
|
|
18
|
+
class s extends f {
|
|
28
19
|
constructor() {
|
|
29
|
-
super(...arguments), this.adapter = new
|
|
20
|
+
super(...arguments), this.adapter = new l(), this.isFocused = !1, this.subscriptions = [];
|
|
30
21
|
}
|
|
31
22
|
createRenderRoot() {
|
|
32
23
|
return this;
|
|
33
24
|
}
|
|
34
25
|
updated(e) {
|
|
35
26
|
super.updated(e);
|
|
36
|
-
const
|
|
37
|
-
|
|
27
|
+
const r = this.adapter.templateData.size;
|
|
28
|
+
r ? this.style.flex = String(r) : this.style.removeProperty("flex");
|
|
38
29
|
}
|
|
39
30
|
connectedCallback() {
|
|
40
31
|
super.connectedCallback(), this.classList.add("gui-repeater", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
@@ -48,8 +39,8 @@ let o = class extends b {
|
|
|
48
39
|
e.stopPropagation(), this.adapter.onBlur(), this.isFocused = !1;
|
|
49
40
|
}
|
|
50
41
|
render() {
|
|
51
|
-
const e = this.adapter.templateData,
|
|
52
|
-
return
|
|
42
|
+
const e = this.adapter.templateData, r = e.touched && e.errors && e.errors.length > 0;
|
|
43
|
+
return a`
|
|
53
44
|
<div
|
|
54
45
|
id=${this.widget.uid}
|
|
55
46
|
class=${`gui-repeater__main-card gui-repeater__card ${this.isFocused ? "gui-repeater__card--focused" : ""}`}
|
|
@@ -65,35 +56,35 @@ let o = class extends b {
|
|
|
65
56
|
.required=${e.validator?.required}
|
|
66
57
|
.native=${!1}
|
|
67
58
|
></gui-label>
|
|
68
|
-
${e.value ?
|
|
59
|
+
${e.value ? $(
|
|
69
60
|
e.value,
|
|
70
|
-
(
|
|
71
|
-
(
|
|
61
|
+
(o) => c(o, x),
|
|
62
|
+
(o, t) => a`
|
|
72
63
|
<div class="gui-repeater__card">
|
|
73
64
|
<div class="gui-repeater__card-header">
|
|
74
|
-
${e.title ?
|
|
75
|
-
>${e.title} ${
|
|
76
|
-
>` :
|
|
65
|
+
${e.title ? a`<span class="gui-repeater__card-title"
|
|
66
|
+
>${e.title} ${t + 1}</span
|
|
67
|
+
>` : i}
|
|
77
68
|
<button
|
|
78
69
|
type="button"
|
|
79
70
|
tabindex="0"
|
|
80
71
|
class="gui-button gui-button--sm gui-repeater__remove-btn"
|
|
81
|
-
@click=${() => this.removeItem(
|
|
72
|
+
@click=${() => this.removeItem(t)}
|
|
82
73
|
>
|
|
83
|
-
${e.removeButtonIcon ?
|
|
74
|
+
${e.removeButtonIcon ? a`<span
|
|
84
75
|
class="gui-widget-icon gui-button-icon ${e.removeButtonIcon}"
|
|
85
76
|
data-icon=${e.removeButtonIcon}
|
|
86
|
-
></span>` :
|
|
77
|
+
></span>` : i}
|
|
87
78
|
${e.removeLabel ?? "Remove"}
|
|
88
79
|
</button>
|
|
89
80
|
</div>
|
|
90
81
|
<gui-repeater-widget
|
|
91
|
-
.repeaterIndex=${
|
|
82
|
+
.repeaterIndex=${t}
|
|
92
83
|
.widget=${e.template}
|
|
93
84
|
></gui-repeater-widget>
|
|
94
85
|
</div>
|
|
95
86
|
`
|
|
96
|
-
) :
|
|
87
|
+
) : i}
|
|
97
88
|
|
|
98
89
|
<button
|
|
99
90
|
type="button"
|
|
@@ -102,18 +93,18 @@ let o = class extends b {
|
|
|
102
93
|
@click=${() => this.addItem()}
|
|
103
94
|
?disabled=${!!(e.limit && e.limit === e.value?.length)}
|
|
104
95
|
>
|
|
105
|
-
${e.addButtonIcon ?
|
|
96
|
+
${e.addButtonIcon ? a`<span
|
|
106
97
|
class="gui-widget-icon gui-button-icon ${e.addButtonIcon}"
|
|
107
98
|
data-icon=${e.addButtonIcon}
|
|
108
|
-
></span>` :
|
|
99
|
+
></span>` : i}
|
|
109
100
|
${e.addLabel ?? "Add"}
|
|
110
101
|
</button>
|
|
111
102
|
</div>
|
|
112
|
-
${
|
|
103
|
+
${r ? a`<gui-errors
|
|
113
104
|
.uid=${this.widget.uid}
|
|
114
105
|
.errors=${e.errors}
|
|
115
106
|
.touched=${e.touched}
|
|
116
|
-
></gui-errors>` :
|
|
107
|
+
></gui-errors>` : i}
|
|
117
108
|
`;
|
|
118
109
|
}
|
|
119
110
|
disconnectedCallback() {
|
|
@@ -124,26 +115,24 @@ let o = class extends b {
|
|
|
124
115
|
this.adapter.valueChanged(e), this.requestUpdate();
|
|
125
116
|
}
|
|
126
117
|
removeItem(e) {
|
|
127
|
-
const
|
|
128
|
-
"structuredClone" in window ? this.adapter.valueChanged(structuredClone(
|
|
118
|
+
const r = (this.adapter.templateData.value ?? []).filter((o, t) => e !== t);
|
|
119
|
+
"structuredClone" in window ? this.adapter.valueChanged(structuredClone(r)) : this.adapter.valueChanged(JSON.parse(JSON.stringify(r))), this.requestUpdate();
|
|
129
120
|
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
],
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
],
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
],
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
],
|
|
144
|
-
|
|
145
|
-
I("gui-repeater-input")
|
|
146
|
-
], o);
|
|
121
|
+
}
|
|
122
|
+
n([
|
|
123
|
+
g({ context: h }),
|
|
124
|
+
v({ attribute: !1 })
|
|
125
|
+
], s.prototype, "formContext");
|
|
126
|
+
n([
|
|
127
|
+
b({ context: m })
|
|
128
|
+
], s.prototype, "adapter");
|
|
129
|
+
n([
|
|
130
|
+
_()
|
|
131
|
+
], s.prototype, "isFocused");
|
|
132
|
+
n([
|
|
133
|
+
I(".gui-repeater__main-card")
|
|
134
|
+
], s.prototype, "_repeaterRef");
|
|
135
|
+
C("gui-repeater-input", s);
|
|
147
136
|
export {
|
|
148
|
-
|
|
137
|
+
s as RepeaterElement
|
|
149
138
|
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { InputWidgetAdapter as d, formContext as o, inputContext as n } from "@golemui/lit";
|
|
2
|
+
import "@golemui/gui-components/select";
|
|
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 f } from "lit/decorators.js";
|
|
6
|
+
import { safeDefine as b } from "@golemui/lit/internals";
|
|
7
|
+
import "rxjs";
|
|
8
|
+
var $ = Object.defineProperty, l = (r, t, e, v) => {
|
|
9
|
+
for (var a = void 0, i = r.length - 1, p; i >= 0; i--)
|
|
10
|
+
(p = r[i]) && (a = p(t, e, a) || a);
|
|
11
|
+
return a && $(t, e, a), a;
|
|
12
|
+
};
|
|
13
|
+
class s extends c {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.adapter = new d(), 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-select", "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-select
|
|
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
|
+
.icon=${this.adapter.templateData.icon}
|
|
43
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
44
|
+
.autocomplete=${this.adapter.templateData.autocomplete}
|
|
45
|
+
.options=${this.adapter.templateData.options}
|
|
46
|
+
.labelField=${this.adapter.templateData.labelField}
|
|
47
|
+
.valueField=${this.adapter.templateData.valueField}
|
|
48
|
+
.invalidOptionMessage=${this.adapter.templateData.invalidOptionMessage}
|
|
49
|
+
@change=${this.valueChanged}
|
|
50
|
+
@inputError=${this.onInputError}
|
|
51
|
+
@blur=${() => this.adapter.onBlur()}
|
|
52
|
+
></gui-select>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
valueChanged(t) {
|
|
56
|
+
const e = t.detail.value;
|
|
57
|
+
this.adapter.valueChanged(e);
|
|
58
|
+
}
|
|
59
|
+
onInputError(t) {
|
|
60
|
+
this.adapter.injectValidationIssues([t.detail.message]);
|
|
61
|
+
}
|
|
62
|
+
disconnectedCallback() {
|
|
63
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
l([
|
|
67
|
+
u({ context: o }),
|
|
68
|
+
f({ attribute: !1 })
|
|
69
|
+
], s.prototype, "formContext");
|
|
70
|
+
l([
|
|
71
|
+
h({ context: n })
|
|
72
|
+
], s.prototype, "adapter");
|
|
73
|
+
b("gui-select-input", s);
|
|
74
|
+
export {
|
|
75
|
+
s as SelectElement
|
|
76
|
+
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { LayoutWidgetAdapter as f, formContext as m, layoutContext as v } from "@golemui/lit";
|
|
2
|
-
import { c } from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { createIntersectionObserver as c } from "@golemui/gui-components/internals";
|
|
3
|
+
import { safeDefine as $ } from "@golemui/lit/internals";
|
|
4
|
+
import { consume as y, provide as w } from "@lit/context";
|
|
5
|
+
import { LitElement as T, html as d, nothing as _ } from "lit";
|
|
5
6
|
import { repeat as p } from "lit-html/directives/repeat.js";
|
|
6
|
-
import { query as h, state as b, queryAll as
|
|
7
|
+
import { query as h, state as b, queryAll as x, property as g } from "lit/decorators.js";
|
|
7
8
|
import { classMap as u } from "lit/directives/class-map.js";
|
|
8
9
|
import "rxjs";
|
|
9
|
-
var
|
|
10
|
-
for (var
|
|
11
|
-
(
|
|
12
|
-
return t &&
|
|
10
|
+
var k = Object.defineProperty, o = (l, s, e, i) => {
|
|
11
|
+
for (var t = void 0, n = l.length - 1, a; n >= 0; n--)
|
|
12
|
+
(a = l[n]) && (t = a(s, e, t) || t);
|
|
13
|
+
return t && k(s, e, t), t;
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
+
class r extends T {
|
|
15
16
|
constructor() {
|
|
16
17
|
super(...arguments), this.activeTab = "", this.adapter = new f(), this.subscriptions = [];
|
|
17
18
|
}
|
|
@@ -20,8 +21,8 @@ let n = class extends y {
|
|
|
20
21
|
}
|
|
21
22
|
updated(s) {
|
|
22
23
|
super.updated(s);
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const e = this.adapter.templateData.size;
|
|
25
|
+
e ? this.style.flex = String(e) : this.style.removeProperty("flex");
|
|
25
26
|
}
|
|
26
27
|
connectedCallback() {
|
|
27
28
|
super.connectedCallback(), this.classList.add("gui-tabs", "gui-field");
|
|
@@ -40,43 +41,43 @@ let n = class extends y {
|
|
|
40
41
|
this.endSentinel,
|
|
41
42
|
(t) => this.isEndVisible = t
|
|
42
43
|
);
|
|
43
|
-
const
|
|
44
|
-
this.tabButtons[
|
|
44
|
+
const i = this.widget.props.tabs.findIndex((t) => t.uid === this.activeTab);
|
|
45
|
+
this.tabButtons[i].scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
45
46
|
}
|
|
46
47
|
render() {
|
|
47
48
|
if (!this.adapter.templateData) return d``;
|
|
48
49
|
const s = this.widget.children.filter(
|
|
49
|
-
(
|
|
50
|
-
),
|
|
50
|
+
(i) => i.uid === this.activeTab || this.adapter.templateData.renderMode !== "activeOnly"
|
|
51
|
+
), e = {
|
|
51
52
|
"gui-widget": !0,
|
|
52
53
|
"gui-widget--horizontal": !0,
|
|
53
54
|
"gui-tabs--start-shadow": !this.isStartVisible,
|
|
54
55
|
"gui-tabs--end-shadow": !this.isEndVisible
|
|
55
56
|
};
|
|
56
|
-
return d`<nav class=${u(
|
|
57
|
+
return d`<nav class=${u(e)} id=${this.widget.uid}>
|
|
57
58
|
<ul role="tablist">
|
|
58
59
|
<li role="presentation" id="start-sentinel" class="gui-sentinel"></li>
|
|
59
60
|
${this.adapter.templateData.tabs ? p(
|
|
60
61
|
this.adapter.templateData.tabs,
|
|
61
|
-
(
|
|
62
|
+
(i, t) => d`
|
|
62
63
|
<li role="presentation">
|
|
63
64
|
<button
|
|
64
65
|
type="button"
|
|
65
66
|
role="tab"
|
|
66
|
-
tabindex=${
|
|
67
|
+
tabindex=${i.uid === this.activeTab ? "0" : "-1"}
|
|
67
68
|
data-cy=${`tab_${this.widget.uid}_${t}`}
|
|
68
69
|
id=${`tab_${this.widget.uid}_${t}`}
|
|
69
70
|
aria-controls=${`tabpanel_${this.widget.uid}_${t}`}
|
|
70
|
-
aria-selected=${
|
|
71
|
-
class=${u({ active:
|
|
72
|
-
@click=${() => this.onClickTab(
|
|
71
|
+
aria-selected=${i.uid === this.activeTab ? "true" : "false"}
|
|
72
|
+
class=${u({ active: i.uid === this.activeTab })}
|
|
73
|
+
@click=${() => this.onClickTab(i.uid)}
|
|
73
74
|
@keydown=${this.onKeyDown}
|
|
74
|
-
@focus=${(
|
|
75
|
+
@focus=${(n) => n.target.scrollIntoView({
|
|
75
76
|
block: "nearest",
|
|
76
77
|
inline: "nearest"
|
|
77
78
|
})}
|
|
78
79
|
>
|
|
79
|
-
${
|
|
80
|
+
${i.label}
|
|
80
81
|
</button>
|
|
81
82
|
</li>
|
|
82
83
|
`
|
|
@@ -86,16 +87,16 @@ let n = class extends y {
|
|
|
86
87
|
</nav>
|
|
87
88
|
${p(
|
|
88
89
|
s,
|
|
89
|
-
(
|
|
90
|
-
(
|
|
90
|
+
(i) => i?.uid,
|
|
91
|
+
(i, t) => d`<section
|
|
91
92
|
role="tabpanel"
|
|
92
93
|
tabindex="0"
|
|
93
94
|
data-cy=${`tabpanel_${this.widget.uid}_${t}`}
|
|
94
95
|
id=${`tabpanel_${this.widget.uid}_${t}`}
|
|
95
|
-
?hidden=${
|
|
96
|
+
?hidden=${i.uid !== this.activeTab && this.adapter.templateData.renderMode !== "activeOnly"}
|
|
96
97
|
aria-labelledby=${`tab_${this.widget.uid}_${t}`}
|
|
97
98
|
>
|
|
98
|
-
<gui-widget .widget=${
|
|
99
|
+
<gui-widget .widget=${i}></gui-widget>
|
|
99
100
|
</section>`
|
|
100
101
|
)}`;
|
|
101
102
|
}
|
|
@@ -106,57 +107,55 @@ let n = class extends y {
|
|
|
106
107
|
this.activeTab = s, this.adapter.change(s), this.requestUpdate();
|
|
107
108
|
}
|
|
108
109
|
onKeyDown(s) {
|
|
109
|
-
const
|
|
110
|
+
const e = this.widget.props.tabs, i = e.findIndex((a) => a.uid === this.activeTab), t = Array.from(this.tabButtons), n = window.getComputedStyle(this).direction === "rtl";
|
|
110
111
|
switch (s.key) {
|
|
111
112
|
case "ArrowLeft": {
|
|
112
|
-
const a =
|
|
113
|
-
a >= 0 && a <
|
|
113
|
+
const a = i + (n ? 1 : -1);
|
|
114
|
+
a >= 0 && a < e.length && (this.activeTab = e[a].uid, t[a].focus());
|
|
114
115
|
break;
|
|
115
116
|
}
|
|
116
117
|
case "ArrowRight": {
|
|
117
|
-
const a =
|
|
118
|
-
a >= 0 && a <
|
|
118
|
+
const a = i + (n ? -1 : 1);
|
|
119
|
+
a >= 0 && a < e.length && (this.activeTab = e[a].uid, t[a].focus());
|
|
119
120
|
break;
|
|
120
121
|
}
|
|
121
122
|
case "Home":
|
|
122
|
-
this.activeTab =
|
|
123
|
+
this.activeTab = e[0].uid, t[0].focus();
|
|
123
124
|
break;
|
|
124
125
|
case "End":
|
|
125
|
-
this.activeTab =
|
|
126
|
+
this.activeTab = e[e.length - 1].uid, t[e.length - 1].focus();
|
|
126
127
|
break;
|
|
127
128
|
default:
|
|
128
129
|
return;
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
|
-
}
|
|
132
|
+
}
|
|
132
133
|
o([
|
|
133
134
|
h("#start-sentinel")
|
|
134
|
-
],
|
|
135
|
+
], r.prototype, "startSentinel");
|
|
135
136
|
o([
|
|
136
137
|
h("#end-sentinel")
|
|
137
|
-
],
|
|
138
|
+
], r.prototype, "endSentinel");
|
|
138
139
|
o([
|
|
139
140
|
b()
|
|
140
|
-
],
|
|
141
|
+
], r.prototype, "isStartVisible");
|
|
141
142
|
o([
|
|
142
143
|
b()
|
|
143
|
-
],
|
|
144
|
+
], r.prototype, "isEndVisible");
|
|
144
145
|
o([
|
|
145
|
-
|
|
146
|
-
],
|
|
146
|
+
x('button[role="tab"]')
|
|
147
|
+
], r.prototype, "tabButtons");
|
|
147
148
|
o([
|
|
148
149
|
g({ type: String })
|
|
149
|
-
],
|
|
150
|
+
], r.prototype, "activeTab");
|
|
150
151
|
o([
|
|
151
|
-
|
|
152
|
+
y({ context: m }),
|
|
152
153
|
g({ attribute: !1 })
|
|
153
|
-
],
|
|
154
|
+
], r.prototype, "formContext");
|
|
154
155
|
o([
|
|
155
|
-
|
|
156
|
-
],
|
|
157
|
-
|
|
158
|
-
x("gui-tabs-layout")
|
|
159
|
-
], n);
|
|
156
|
+
w({ context: v })
|
|
157
|
+
], r.prototype, "adapter");
|
|
158
|
+
$("gui-tabs-layout", r);
|
|
160
159
|
export {
|
|
161
|
-
|
|
160
|
+
r as TabsElement
|
|
162
161
|
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { InputWidgetAdapter as d, formContext as o, inputContext as n } from "@golemui/lit";
|
|
2
|
+
import "@golemui/gui-components/tags";
|
|
3
|
+
import { consume as h, provide as u } from "@lit/context";
|
|
4
|
+
import { LitElement as m, html as c } from "lit";
|
|
5
|
+
import { property as f } from "lit/decorators.js";
|
|
6
|
+
import { safeDefine as D } from "@golemui/lit/internals";
|
|
7
|
+
import "rxjs";
|
|
8
|
+
var b = Object.defineProperty, l = (r, t, e, g) => {
|
|
9
|
+
for (var a = void 0, i = r.length - 1, p; i >= 0; i--)
|
|
10
|
+
(p = r[i]) && (a = p(t, e, a) || a);
|
|
11
|
+
return a && b(t, e, a), a;
|
|
12
|
+
};
|
|
13
|
+
class s extends m {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.adapter = new d(), 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-tags", "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(), c`
|
|
32
|
+
<gui-tags
|
|
33
|
+
.uid=${this.widget.uid}
|
|
34
|
+
.label=${this.adapter.templateData.label}
|
|
35
|
+
.hint=${this.adapter.templateData.hint}
|
|
36
|
+
.errors=${this.adapter.templateData.errors}
|
|
37
|
+
?touched=${this.adapter.templateData.touched}
|
|
38
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
39
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
40
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
41
|
+
.value=${this.adapter.templateData.value}
|
|
42
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
43
|
+
.icon=${this.adapter.templateData.icon}
|
|
44
|
+
.separators=${this.adapter.templateData.separators}
|
|
45
|
+
.allowDuplicates=${this.adapter.templateData.allowDuplicates ?? !0}
|
|
46
|
+
.trim=${this.adapter.templateData.trim ?? !0}
|
|
47
|
+
.limit=${this.adapter.templateData.limit}
|
|
48
|
+
.removeAriaLabel=${this.adapter.templateData.removeAriaLabel}
|
|
49
|
+
.removeIcon=${this.adapter.templateData.removeIcon}
|
|
50
|
+
@change=${this.valueChanged}
|
|
51
|
+
@blur=${() => this.adapter.onBlur()}
|
|
52
|
+
></gui-tags>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
valueChanged(t) {
|
|
56
|
+
const e = t.detail.value;
|
|
57
|
+
this.adapter.valueChanged(e);
|
|
58
|
+
}
|
|
59
|
+
disconnectedCallback() {
|
|
60
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
l([
|
|
64
|
+
h({ context: o }),
|
|
65
|
+
f({ attribute: !1 })
|
|
66
|
+
], s.prototype, "formContext");
|
|
67
|
+
l([
|
|
68
|
+
u({ context: n })
|
|
69
|
+
], s.prototype, "adapter");
|
|
70
|
+
D("gui-tags-input", s);
|
|
71
|
+
export {
|
|
72
|
+
s as TagsElement
|
|
73
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { InputWidgetAdapter as o, formContext as l, inputContext as n } from "@golemui/lit";
|
|
2
|
+
import "@golemui/gui-components/textarea";
|
|
3
|
+
import { consume as u, provide as h } from "@lit/context";
|
|
4
|
+
import { LitElement as m, html as c } from "lit";
|
|
5
|
+
import { property as f } from "lit/decorators.js";
|
|
6
|
+
import { safeDefine as b } from "@golemui/lit/internals";
|
|
7
|
+
import "rxjs";
|
|
8
|
+
var g = Object.defineProperty, d = (r, t, e, x) => {
|
|
9
|
+
for (var a = void 0, i = r.length - 1, p; i >= 0; i--)
|
|
10
|
+
(p = r[i]) && (a = p(t, e, a) || a);
|
|
11
|
+
return a && g(t, e, a), a;
|
|
12
|
+
};
|
|
13
|
+
class s extends m {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.adapter = new o(), 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-textarea", "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(), c`
|
|
32
|
+
<gui-textarea
|
|
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
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
43
|
+
.autocomplete=${this.adapter.templateData.autocomplete}
|
|
44
|
+
.counterMode=${this.adapter.templateData.counterMode}
|
|
45
|
+
.minimumHeight=${this.adapter.templateData.minimumHeight}
|
|
46
|
+
.autoGrow=${this.adapter.templateData.autoGrow}
|
|
47
|
+
.maxLength=${this.adapter.templateData.validator?.maxLength}
|
|
48
|
+
@input=${this.valueChanged}
|
|
49
|
+
@blur=${() => this.adapter.onBlur()}
|
|
50
|
+
></gui-textarea>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
valueChanged(t) {
|
|
54
|
+
const e = t.detail.value;
|
|
55
|
+
this.adapter.valueChanged(e);
|
|
56
|
+
}
|
|
57
|
+
disconnectedCallback() {
|
|
58
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
d([
|
|
62
|
+
u({ context: l }),
|
|
63
|
+
f({ attribute: !1 })
|
|
64
|
+
], s.prototype, "formContext");
|
|
65
|
+
d([
|
|
66
|
+
h({ context: n })
|
|
67
|
+
], s.prototype, "adapter");
|
|
68
|
+
b("gui-textarea-input", s);
|
|
69
|
+
export {
|
|
70
|
+
s as TextareaElement
|
|
71
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { InputWidgetAdapter as o, formContext as l, inputContext as n } from "@golemui/lit";
|
|
2
|
+
import "@golemui/gui-components/textinput";
|
|
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 f } from "lit/decorators.js";
|
|
6
|
+
import { safeDefine as b } from "@golemui/lit/internals";
|
|
7
|
+
import "rxjs";
|
|
8
|
+
var x = Object.defineProperty, d = (r, t, e, v) => {
|
|
9
|
+
for (var a = void 0, i = r.length - 1, p; i >= 0; i--)
|
|
10
|
+
(p = r[i]) && (a = p(t, e, a) || a);
|
|
11
|
+
return a && x(t, e, a), a;
|
|
12
|
+
};
|
|
13
|
+
class s extends c {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.adapter = new o(), 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-textinput", "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-textinput
|
|
33
|
+
.uid=${this.widget.uid}
|
|
34
|
+
.label=${this.adapter.templateData.label}
|
|
35
|
+
.hint=${this.adapter.templateData.hint}
|
|
36
|
+
.errors=${this.adapter.templateData.errors}
|
|
37
|
+
?touched=${this.adapter.templateData.touched}
|
|
38
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
39
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
40
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
41
|
+
.value=${this.adapter.templateData.value}
|
|
42
|
+
.icon=${this.adapter.templateData.icon}
|
|
43
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
44
|
+
.autocomplete=${this.adapter.templateData.autocomplete}
|
|
45
|
+
@input=${this.valueChanged}
|
|
46
|
+
@blur=${() => this.adapter.onBlur()}
|
|
47
|
+
></gui-textinput>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
valueChanged(t) {
|
|
51
|
+
const e = t.detail.value;
|
|
52
|
+
this.adapter.valueChanged(e);
|
|
53
|
+
}
|
|
54
|
+
disconnectedCallback() {
|
|
55
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
d([
|
|
59
|
+
u({ context: l }),
|
|
60
|
+
f({ attribute: !1 })
|
|
61
|
+
], s.prototype, "formContext");
|
|
62
|
+
d([
|
|
63
|
+
h({ context: n })
|
|
64
|
+
], s.prototype, "adapter");
|
|
65
|
+
b("gui-textinput-input", s);
|
|
66
|
+
export {
|
|
67
|
+
s as TextinputElement
|
|
68
|
+
};
|