@golemui/gui-lit 1.3.0 → 1.4.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 +10 -0
- package/accordion.element-BEenQrCh.js +102 -0
- package/{alert.element-CHn49Yaf.js → alert.element-Dzv49O-1.js} +19 -19
- package/{button.element-C9fHivSw.js → button.element-CKYv0Glr.js} +14 -14
- package/{calendar.element-XkojKTJk.js → calendar.element-DkHZFBNr.js} +16 -16
- package/{checkbox.element-DU_tVMXu.js → checkbox.element-MukoziRw.js} +16 -16
- package/{currency.element-BmAH5KS_.js → currency.element-DNumeSKA.js} +13 -13
- package/{date-picker.element-Bg3rF95F.js → date-picker.element-DpQmremq.js} +5 -5
- package/{date-time-calendar.element-sywQCeQQ.js → date-time-calendar.element-GAr8VMGa.js} +5 -5
- package/{date-time-picker.element-HHpwjWTQ.js → date-time-picker.element-Bt0GYSpS.js} +5 -5
- package/{date-time.element-ucETvSTC.js → date-time.element-WfLnY_Cb.js} +14 -14
- package/{date.element-BEHGxRFF.js → date.element-ChpTi2AQ.js} +15 -15
- package/default-multi-list-item-renderer-Cv-guvEX.js +31 -0
- package/{dropdown.element-Dg80G2PL.js → dropdown.element-D9wMyqWQ.js} +76 -55
- package/{flex.element-pwba7621.js → flex.element-DiZWJBwt.js} +14 -14
- package/{grid.element-C8K7_Qi3.js → grid.element-DJ9ACsqZ.js} +22 -22
- package/index.js +79 -77
- package/index.umd.cjs +374 -117
- package/lib/components/accordion.element.d.ts +3 -2
- package/lib/components/default-multi-list-item-renderer.d.ts +2 -0
- package/lib/components/dropdown.element.d.ts +3 -2
- package/lib/components/multi-dropdown.element.d.ts +48 -0
- package/lib/components/multi-list.element.d.ts +27 -0
- package/lib/components/tabs.element.d.ts +3 -0
- package/{list.element-ZtEMKE2x.js → list.element-DD5IL4QB.js} +7 -7
- package/{markdown-text.element-DDm36qD0.js → markdown-text.element-DflCQwAo.js} +16 -16
- package/{markdown.element-DWz3U9rG.js → markdown.element-DUHHoi2Y.js} +13 -13
- package/multi-dropdown.element-iEOlPvux.js +312 -0
- package/multi-list.element-CCX3i3k6.js +162 -0
- package/{number.element-VkG5wScD.js → number.element-mQSFQsYC.js} +16 -16
- package/package.json +6 -6
- package/{password.element-C5vQHq5P.js → password.element-xw5gugEg.js} +13 -13
- package/{radiogroup.element-CKdO9HwO.js → radiogroup.element-TqfrxVyI.js} +15 -15
- package/{range-calendar.element-BznGrej5.js → range-calendar.element-BJr97SVA.js} +13 -5
- package/{range-date-input.element-BloTHRDl.js → range-date-input.element-DDRYvP9h.js} +23 -15
- package/{range-date-picker.element-DKhwFasW.js → range-date-picker.element-rdEr0_wu.js} +25 -17
- package/{range-date-time-calendar.element-CZCET-sb.js → range-date-time-calendar.element-UlL1BBRJ.js} +25 -17
- package/{range-date-time-input.element-Dr2VrYhG.js → range-date-time-input.element-Cq4IdW7N.js} +17 -9
- package/{range-date-time-picker.element-CYeIMWLp.js → range-date-time-picker.element-CnJcIN9C.js} +27 -19
- package/{range-time-input.element-7OZhPQqx.js → range-time-input.element-Cq0TrGe9.js} +17 -9
- package/{range-time-picker.element-D0mRFZkK.js → range-time-picker.element-BzlIuZ6m.js} +24 -16
- package/{renderer.element-DbsFoBba.js → renderer.element-BVwerbtL.js} +15 -15
- package/repeater.element-DQNI4b7I.js +133 -0
- package/{select.element-Bb_9jAVB.js → select.element-RBtbAvLx.js} +12 -11
- package/tabs.element-BiVaQlvt.js +171 -0
- package/{tags.element-BSN3i9Gx.js → tags.element-CGvxhMmX.js} +18 -19
- package/{textarea.element-Dl1ZEOqO.js → textarea.element-E2ntRBtE.js} +13 -13
- package/{textinput.element-C5Vbbkxq.js → textinput.element-0q5F5ol3.js} +16 -16
- package/{time-picker.element-Crmj9YDy.js → time-picker.element-BiLaLr_c.js} +5 -5
- package/{time.element-DfSeAZp4.js → time.element-92goKRwJ.js} +15 -15
- package/{toggle.element-ORsprZ2M.js → toggle.element-zDUc9Vja.js} +16 -16
- package/accordion.element-C9GzfKrY.js +0 -103
- package/repeater.element-DGEbwvhY.js +0 -138
- package/tabs.element-BYDNF_pm.js +0 -161
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { InputWidgetAdapter as l, formContext as n, inputContext as o } from "@golemui/lit";
|
|
2
2
|
import { addIcon as m } from "@golemui/gui-components/internals";
|
|
3
|
-
import {
|
|
3
|
+
import { unsubscribeAll as h, safeDefine as u } from "@golemui/lit/internals";
|
|
4
4
|
import "@golemui/gui-components/date-input";
|
|
5
|
-
import { consume as
|
|
6
|
-
import { LitElement as
|
|
7
|
-
import { property as
|
|
5
|
+
import { consume as c, provide as D } from "@lit/context";
|
|
6
|
+
import { LitElement as g, html as $ } from "lit";
|
|
7
|
+
import { property as b } from "lit/decorators.js";
|
|
8
8
|
import "rxjs";
|
|
9
|
-
import { classMap as
|
|
10
|
-
var
|
|
9
|
+
import { classMap as f } from "lit/directives/class-map.js";
|
|
10
|
+
var v = Object.defineProperty, d = (r, t, a, x) => {
|
|
11
11
|
for (var e = void 0, i = r.length - 1, p; i >= 0; i--)
|
|
12
12
|
(p = r[i]) && (e = p(t, a, e) || e);
|
|
13
|
-
return e &&
|
|
13
|
+
return e && v(t, a, e), e;
|
|
14
14
|
};
|
|
15
|
-
class s extends
|
|
15
|
+
class s extends g {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), this.adapter = new l(), this.subscriptions = [];
|
|
18
18
|
}
|
|
@@ -32,9 +32,9 @@ class s extends D {
|
|
|
32
32
|
render() {
|
|
33
33
|
super.render();
|
|
34
34
|
const t = m("date", this.adapter.templateData);
|
|
35
|
-
return
|
|
35
|
+
return $`
|
|
36
36
|
<gui-date
|
|
37
|
-
class=${
|
|
37
|
+
class=${f(t.widgetClasses)}
|
|
38
38
|
.uid=${this.widget.uid}
|
|
39
39
|
.label=${this.adapter.templateData.label}
|
|
40
40
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -68,17 +68,17 @@ class s extends D {
|
|
|
68
68
|
this.adapter.injectValidationIssues([t.detail.message]);
|
|
69
69
|
}
|
|
70
70
|
disconnectedCallback() {
|
|
71
|
-
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions
|
|
71
|
+
super.disconnectedCallback(), this.adapter.destroy(), h(this.subscriptions);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
d([
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
c({ context: n }),
|
|
76
|
+
b({ attribute: !1 })
|
|
77
77
|
], s.prototype, "formContext");
|
|
78
78
|
d([
|
|
79
|
-
|
|
79
|
+
D({ context: o })
|
|
80
80
|
], s.prototype, "adapter");
|
|
81
|
-
|
|
81
|
+
u("gui-date-input", s);
|
|
82
82
|
export {
|
|
83
83
|
s as DateElement
|
|
84
84
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { html as i } from "lit";
|
|
2
|
+
import { classMap as t } from "lit/directives/class-map.js";
|
|
3
|
+
import "@golemui/core";
|
|
4
|
+
const r = (e) => {
|
|
5
|
+
const s = {
|
|
6
|
+
"gui-list__item": !0,
|
|
7
|
+
"gui-list__item-selected": !!e.selected,
|
|
8
|
+
"gui-list__item-focused": !!e.focused,
|
|
9
|
+
"gui-list__item-disabled": !!e.disabled
|
|
10
|
+
};
|
|
11
|
+
return i`
|
|
12
|
+
<div
|
|
13
|
+
role="option"
|
|
14
|
+
class=${t(s)}
|
|
15
|
+
aria-selected=${e.selected ? "true" : "false"}
|
|
16
|
+
aria-disabled=${e.disabled ? "true" : "false"}
|
|
17
|
+
>
|
|
18
|
+
<span class="gui-list__item-check" aria-hidden="true">
|
|
19
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 256 256">
|
|
20
|
+
<path
|
|
21
|
+
d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"
|
|
22
|
+
></path>
|
|
23
|
+
</svg>
|
|
24
|
+
</span>
|
|
25
|
+
${e.template}
|
|
26
|
+
</div>
|
|
27
|
+
`;
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
r as d
|
|
31
|
+
};
|
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import { InputWidgetAdapter as
|
|
2
|
-
import { consume as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { InputWidgetAdapter as F, formContext as x, inputContext as C } from "@golemui/lit";
|
|
2
|
+
import { consume as D, provide as R } from "@lit/context";
|
|
3
|
+
import { LitElement as L, nothing as p, html as _ } from "lit";
|
|
4
|
+
import { classMap as v } from "lit/directives/class-map.js";
|
|
5
|
+
import { property as k, state as d, query as $ } from "lit/decorators.js";
|
|
6
|
+
import { unsubscribeAll as V, safeDefine as P } from "@golemui/lit/internals";
|
|
7
|
+
import { Subject as S, debounceTime as T } from "rxjs";
|
|
8
|
+
import { d as j } from "./default-list-item-renderer-CuPJ9jUD.js";
|
|
8
9
|
import "@golemui/gui-components/label";
|
|
9
10
|
import "@golemui/gui-components/list";
|
|
10
11
|
import "@golemui/gui-components/errors";
|
|
11
|
-
var
|
|
12
|
-
for (var i = void 0, u =
|
|
13
|
-
(h =
|
|
14
|
-
return i &&
|
|
12
|
+
var q = Object.defineProperty, l = (g, e, t, s) => {
|
|
13
|
+
for (var i = void 0, u = g.length - 1, h; u >= 0; u--)
|
|
14
|
+
(h = g[u]) && (i = h(e, t, i) || i);
|
|
15
|
+
return i && q(e, t, i), i;
|
|
15
16
|
};
|
|
16
|
-
class a extends
|
|
17
|
+
class a extends L {
|
|
17
18
|
constructor() {
|
|
18
|
-
super(...arguments), this.adapter = new
|
|
19
|
+
super(...arguments), this.adapter = new F(), this.debouncer = new S(), this.subscriptions = [], this._range = { start: 0, end: 10 }, this._filteredItems = [], this._listItems = [], this._focusedIndex = -1, this._isFiltering = !1, this._isListVisible = !1, this._selectedItem = void 0, this._ignoreNextFocus = !1, this.onDocumentClick = (e) => {
|
|
19
20
|
if (!this._isListVisible) return;
|
|
20
21
|
const t = e.composedPath(), s = this._inputRef && t.includes(this._inputRef), i = this._panelRef && t.includes(this._panelRef);
|
|
21
22
|
!s && !i && (this._isListVisible = !1);
|
|
23
|
+
}, this._onToggleMouseDown = (e) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
}, this._onToggleClick = (e) => {
|
|
26
|
+
e.stopPropagation(), this._isListVisible ? (this._isListVisible = !1, this._isFiltering = !1, this._ignoreNextFocus = !0, this._inputRef?.focus(), setTimeout(() => {
|
|
27
|
+
this._ignoreNextFocus = !1;
|
|
28
|
+
})) : (this._inputRef?.focus(), this._onFocus());
|
|
22
29
|
};
|
|
23
30
|
}
|
|
24
31
|
createRenderRoot() {
|
|
@@ -35,13 +42,13 @@ class a extends R {
|
|
|
35
42
|
const e = this.adapter.templateData;
|
|
36
43
|
e.items && this._listItems?.length === 0 && this._filteredItems?.length === 0 && (this._filteredItems = e.items, this._listItems = e.items), this.requestUpdate();
|
|
37
44
|
}),
|
|
38
|
-
this.debouncer.pipe(
|
|
45
|
+
this.debouncer.pipe(T(this.adapter.templateData.inputDebounce ?? 500)).subscribe((e) => {
|
|
39
46
|
this._filterItems(e);
|
|
40
47
|
})
|
|
41
48
|
);
|
|
42
49
|
}
|
|
43
50
|
disconnectedCallback() {
|
|
44
|
-
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions
|
|
51
|
+
super.disconnectedCallback(), this.adapter.destroy(), V(this.subscriptions);
|
|
45
52
|
}
|
|
46
53
|
_onRangeChange(e) {
|
|
47
54
|
this._range = { start: e.detail.startIndex, end: e.detail.endIndex };
|
|
@@ -86,14 +93,14 @@ class a extends R {
|
|
|
86
93
|
if (this.adapter.filterChanged(e), e && !s) {
|
|
87
94
|
this._isFiltering = !0, this._isListVisible = !0;
|
|
88
95
|
const i = t.searchFields ?? [t.labelField, t.valueField].filter(
|
|
89
|
-
(
|
|
90
|
-
), u = i.length > 0,
|
|
91
|
-
if (
|
|
92
|
-
return
|
|
93
|
-
const
|
|
94
|
-
return u ?
|
|
96
|
+
(o) => !!o
|
|
97
|
+
), u = i.length > 0, m = (t.items || []).filter((o) => {
|
|
98
|
+
if (o === null || typeof o != "object")
|
|
99
|
+
return o != null && o.toString().toLowerCase().includes(e.toLowerCase());
|
|
100
|
+
const f = Object.keys(o), n = (c, b) => c || o[b].toString().toLowerCase().includes(e.toLowerCase());
|
|
101
|
+
return u ? f.filter((c) => i.includes(c)).reduce(n, !1) : f.reduce(n, !1);
|
|
95
102
|
});
|
|
96
|
-
this._filteredItems = [...
|
|
103
|
+
this._filteredItems = [...m];
|
|
97
104
|
} else
|
|
98
105
|
this._isFiltering = !1, this._filteredItems = [...t.items];
|
|
99
106
|
}
|
|
@@ -109,19 +116,16 @@ class a extends R {
|
|
|
109
116
|
const t = e.target;
|
|
110
117
|
this._listRef && this._listRef.contains(t) || e.preventDefault();
|
|
111
118
|
}
|
|
112
|
-
|
|
119
|
+
_onFocusOut(e) {
|
|
113
120
|
const t = e.relatedTarget;
|
|
114
121
|
t && this.contains(t) || (this.adapter.onBlur(), this._isListVisible = !1, this._isFiltering = !1);
|
|
115
122
|
}
|
|
116
|
-
_onBlur() {
|
|
117
|
-
this.adapter.onBlur(), this._isListVisible = !1, this._isFiltering = !1;
|
|
118
|
-
}
|
|
119
123
|
render() {
|
|
120
124
|
const e = this.adapter.templateData, t = e.touched && e.errors && e.errors.length > 0, s = this._listItems.slice(this._range.start, this._range.end), i = this.adapter.getItemRenderer(
|
|
121
125
|
e.itemRenderer,
|
|
122
|
-
|
|
123
|
-
), h = this._selectedItem?.template !== null && typeof this._selectedItem?.template == "object" ? e.labelField ?? "label" : null,
|
|
124
|
-
return
|
|
126
|
+
j
|
|
127
|
+
), h = this._selectedItem?.template !== null && typeof this._selectedItem?.template == "object" ? e.labelField ?? "label" : null, m = h ? this._selectedItem?.template[h] : this._selectedItem?.template, o = !!this.widget.on?.filter;
|
|
128
|
+
return _`
|
|
125
129
|
<gui-label
|
|
126
130
|
.targetElement=${[this._listRef, this._inputRef]}
|
|
127
131
|
.uid=${this.widget.uid}
|
|
@@ -133,14 +137,22 @@ class a extends R {
|
|
|
133
137
|
.native=${!1}
|
|
134
138
|
></gui-label>
|
|
135
139
|
|
|
136
|
-
<div class="gui-widget" @keydown=${this._onWidgetKeyDown}>
|
|
140
|
+
<div class="gui-widget" @keydown=${this._onWidgetKeyDown} @focusout=${this._onFocusOut}>
|
|
141
|
+
${e.icon ? _`<span
|
|
142
|
+
class=${v({ "gui-widget-icon": !0, [e.icon]: !0 })}
|
|
143
|
+
data-icon=${e.icon}
|
|
144
|
+
aria-hidden="true"
|
|
145
|
+
></span>` : p}
|
|
137
146
|
<input
|
|
138
147
|
type="text"
|
|
139
148
|
role="combobox"
|
|
140
149
|
id=${this.widget.uid}
|
|
141
150
|
data-cy=${`${this.widget.uid}_textinput`}
|
|
142
|
-
class
|
|
143
|
-
|
|
151
|
+
class=${v({
|
|
152
|
+
"gui-widget-input": !0,
|
|
153
|
+
"gui-dropdown--icon": !!e.icon
|
|
154
|
+
})}
|
|
155
|
+
.value=${m ?? e.value ?? ""}
|
|
144
156
|
?required=${e.validator?.required}
|
|
145
157
|
?disabled=${e.disabled}
|
|
146
158
|
?readonly=${e.readonly}
|
|
@@ -148,7 +160,6 @@ class a extends R {
|
|
|
148
160
|
autocomplete=${e.autocomplete || p}
|
|
149
161
|
@keydown=${this._onKeyDown}
|
|
150
162
|
@input=${this._onInput}
|
|
151
|
-
@focusout=${this._onFocusOutInput}
|
|
152
163
|
@focus=${this._onFocus}
|
|
153
164
|
aria-expanded=${this._isListVisible ? "true" : "false"}
|
|
154
165
|
aria-controls=${`${this.widget.uid}-list`}
|
|
@@ -156,8 +167,18 @@ class a extends R {
|
|
|
156
167
|
aria-labelledby=${e.label ? `${this.widget.uid}_label` : p}
|
|
157
168
|
aria-describedby=${e.hint ? `${this.widget.uid}_hint` : p}
|
|
158
169
|
/>
|
|
159
|
-
<
|
|
160
|
-
|
|
170
|
+
<button
|
|
171
|
+
type="button"
|
|
172
|
+
class="gui-dropdown__arrow"
|
|
173
|
+
aria-label=${e.toggleAriaLabel ?? "Show options"}
|
|
174
|
+
aria-haspopup="listbox"
|
|
175
|
+
aria-expanded=${this._isListVisible ? "true" : "false"}
|
|
176
|
+
aria-controls=${`${this.widget.uid}-list`}
|
|
177
|
+
?disabled=${e.disabled}
|
|
178
|
+
@mousedown=${this._onToggleMouseDown}
|
|
179
|
+
@click=${this._onToggleClick}
|
|
180
|
+
>
|
|
181
|
+
<svg
|
|
161
182
|
xmlns="http://www.w3.org/2000/svg"
|
|
162
183
|
width="16"
|
|
163
184
|
height="16"
|
|
@@ -166,8 +187,9 @@ class a extends R {
|
|
|
166
187
|
>
|
|
167
188
|
<path
|
|
168
189
|
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"
|
|
169
|
-
></path
|
|
170
|
-
|
|
190
|
+
></path>
|
|
191
|
+
</svg>
|
|
192
|
+
</button>
|
|
171
193
|
|
|
172
194
|
<div
|
|
173
195
|
class="gui-picker__panel"
|
|
@@ -179,7 +201,7 @@ class a extends R {
|
|
|
179
201
|
.uid=${this.widget.uid}
|
|
180
202
|
.value=${e.value ?? ""}
|
|
181
203
|
.valueField=${e.valueField}
|
|
182
|
-
.items=${this._isFiltering && !
|
|
204
|
+
.items=${this._isFiltering && !o ? this._filteredItems : e.items}
|
|
183
205
|
.itemHeight=${e.itemHeight}
|
|
184
206
|
.height=${e.height}
|
|
185
207
|
?required=${e.validator?.required}
|
|
@@ -191,35 +213,34 @@ class a extends R {
|
|
|
191
213
|
@gui-update-items=${this._onUpdateItems}
|
|
192
214
|
@gui-focus-change=${this._onFocusChange}
|
|
193
215
|
@focus=${this._onFocus}
|
|
194
|
-
@blur=${this._onBlur}
|
|
195
216
|
@change=${this._onValueChange}
|
|
196
217
|
>
|
|
197
|
-
${s.map((
|
|
198
|
-
const
|
|
199
|
-
return
|
|
218
|
+
${s.map((r, f) => {
|
|
219
|
+
const n = this._range.start + f, c = e.value === r.value, b = this._focusedIndex === n, w = !!e.disabled || !!r.disabled, I = e.labelField ?? "label", y = r.template !== null && typeof r.template == "object" && I && !e.itemRenderer ? r.template[I] : r.template;
|
|
220
|
+
return _`
|
|
200
221
|
<div
|
|
201
222
|
role="option"
|
|
202
223
|
tabindex="-1"
|
|
203
224
|
class="gui-list__item-wrapper"
|
|
204
|
-
id="${this.widget.uid}-item-${
|
|
225
|
+
id="${this.widget.uid}-item-${n}"
|
|
205
226
|
style="height: ${e.itemHeight || 40}px"
|
|
206
227
|
aria-selected=${c ? "true" : "false"}
|
|
207
|
-
aria-disabled=${
|
|
208
|
-
@click=${() => this._onClickItem(
|
|
228
|
+
aria-disabled=${w ? "true" : "false"}
|
|
229
|
+
@click=${() => this._onClickItem(r, n)}
|
|
209
230
|
>
|
|
210
231
|
${i({
|
|
211
|
-
template:
|
|
212
|
-
value:
|
|
213
|
-
index:
|
|
232
|
+
template: y,
|
|
233
|
+
value: r.value,
|
|
234
|
+
index: n,
|
|
214
235
|
selected: c,
|
|
215
|
-
disabled:
|
|
236
|
+
disabled: w,
|
|
216
237
|
focused: b
|
|
217
238
|
})}
|
|
218
239
|
</div>
|
|
219
240
|
`;
|
|
220
241
|
})}
|
|
221
242
|
</gui-list>
|
|
222
|
-
${t ?
|
|
243
|
+
${t ? _`<gui-errors
|
|
223
244
|
panel
|
|
224
245
|
.uid=${this.widget.uid}
|
|
225
246
|
.errors=${e.errors}
|
|
@@ -228,7 +249,7 @@ class a extends R {
|
|
|
228
249
|
</div>
|
|
229
250
|
</div>
|
|
230
251
|
|
|
231
|
-
${t ?
|
|
252
|
+
${t ? _`<gui-errors
|
|
232
253
|
.uid=${this.widget.uid}
|
|
233
254
|
.errors=${e.errors}
|
|
234
255
|
.touched=${e.touched}
|
|
@@ -237,11 +258,11 @@ class a extends R {
|
|
|
237
258
|
}
|
|
238
259
|
}
|
|
239
260
|
l([
|
|
240
|
-
|
|
241
|
-
|
|
261
|
+
D({ context: x }),
|
|
262
|
+
k({ attribute: !1 })
|
|
242
263
|
], a.prototype, "formContext");
|
|
243
264
|
l([
|
|
244
|
-
|
|
265
|
+
R({ context: C })
|
|
245
266
|
], a.prototype, "adapter");
|
|
246
267
|
l([
|
|
247
268
|
d()
|
|
@@ -273,7 +294,7 @@ l([
|
|
|
273
294
|
l([
|
|
274
295
|
$(".gui-picker__panel")
|
|
275
296
|
], a.prototype, "_panelRef");
|
|
276
|
-
|
|
297
|
+
P("gui-dropdown-input", a);
|
|
277
298
|
export {
|
|
278
299
|
a as DropdownElement
|
|
279
300
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { LayoutWidgetAdapter as n, formContext as o, layoutContext as u } from "@golemui/lit";
|
|
2
2
|
import { consume as g, provide as c } from "@lit/context";
|
|
3
|
-
import { LitElement as m, html as
|
|
3
|
+
import { LitElement as m, html as l } from "lit";
|
|
4
4
|
import { property as f } from "lit/decorators.js";
|
|
5
|
-
import {
|
|
5
|
+
import { unsubscribeAll as h, safeDefine as _ } from "@golemui/lit/internals";
|
|
6
6
|
import "rxjs";
|
|
7
|
-
import { repeat as
|
|
8
|
-
import { classMap as
|
|
9
|
-
var
|
|
7
|
+
import { repeat as x } from "lit-html/directives/repeat.js";
|
|
8
|
+
import { classMap as w } from "lit/directives/class-map.js";
|
|
9
|
+
var D = Object.defineProperty, d = (i, e, t, y) => {
|
|
10
10
|
for (var a = void 0, r = i.length - 1, p; r >= 0; r--)
|
|
11
11
|
(p = i[r]) && (a = p(e, t, a) || a);
|
|
12
|
-
return a &&
|
|
12
|
+
return a && D(e, t, a), a;
|
|
13
13
|
};
|
|
14
14
|
class s extends m {
|
|
15
15
|
constructor() {
|
|
@@ -46,32 +46,32 @@ class s extends m {
|
|
|
46
46
|
"gui-flex__widget--align-space-around": this.adapter.templateData.align === "space-around",
|
|
47
47
|
"gui-flex__widget--align-space-evenly": this.adapter.templateData.align === "space-evenly"
|
|
48
48
|
};
|
|
49
|
-
return
|
|
49
|
+
return l`
|
|
50
50
|
<div
|
|
51
|
-
class=${
|
|
51
|
+
class=${w(e)}
|
|
52
52
|
id=${this.widget?.uid}
|
|
53
53
|
style=${this.adapter.templateData.gap ? `gap: ${this.adapter.templateData.gap}px` : ""}
|
|
54
54
|
>
|
|
55
|
-
${
|
|
55
|
+
${x(
|
|
56
56
|
this.adapter.templateData.children || [],
|
|
57
57
|
(t) => t?.uid,
|
|
58
|
-
(t) =>
|
|
58
|
+
(t) => l`<gui-widget .widget=${t}></gui-widget>`
|
|
59
59
|
)}
|
|
60
60
|
</div>
|
|
61
61
|
`;
|
|
62
62
|
}
|
|
63
63
|
disconnectedCallback() {
|
|
64
|
-
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions
|
|
64
|
+
super.disconnectedCallback(), this.adapter.destroy(), h(this.subscriptions);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
d([
|
|
68
68
|
g({ context: o }),
|
|
69
69
|
f({ attribute: !1 })
|
|
70
70
|
], s.prototype, "formContext");
|
|
71
|
-
|
|
71
|
+
d([
|
|
72
72
|
c({ context: u })
|
|
73
73
|
], s.prototype, "adapter");
|
|
74
|
-
|
|
74
|
+
_("gui-flex-layout", s);
|
|
75
75
|
export {
|
|
76
76
|
s as FlexElement
|
|
77
77
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { LayoutWidgetAdapter as
|
|
1
|
+
import { LayoutWidgetAdapter as l, formContext as o, layoutContext as u } from "@golemui/lit";
|
|
2
2
|
import { consume as c, provide as m } from "@lit/context";
|
|
3
3
|
import { LitElement as h, html as n } from "lit";
|
|
4
4
|
import { property as _ } from "lit/decorators.js";
|
|
5
|
-
import {
|
|
5
|
+
import { unsubscribeAll as f, safeDefine as w } from "@golemui/lit/internals";
|
|
6
6
|
import "rxjs";
|
|
7
|
-
import { repeat as
|
|
8
|
-
import { classMap as
|
|
9
|
-
var
|
|
10
|
-
for (var
|
|
11
|
-
(r = s[i]) && (
|
|
12
|
-
return
|
|
7
|
+
import { repeat as y } from "lit-html/directives/repeat.js";
|
|
8
|
+
import { classMap as D } from "lit/directives/class-map.js";
|
|
9
|
+
var b = Object.defineProperty, g = (s, a, t, p) => {
|
|
10
|
+
for (var e = void 0, i = s.length - 1, r; i >= 0; i--)
|
|
11
|
+
(r = s[i]) && (e = r(a, t, e) || e);
|
|
12
|
+
return e && b(a, t, e), e;
|
|
13
13
|
};
|
|
14
14
|
class d extends h {
|
|
15
15
|
constructor() {
|
|
16
|
-
super(...arguments), this.adapter = new
|
|
16
|
+
super(...arguments), this.adapter = new l(), this.subscriptions = [];
|
|
17
17
|
}
|
|
18
18
|
createRenderRoot() {
|
|
19
19
|
return this;
|
|
20
20
|
}
|
|
21
|
-
updated(
|
|
22
|
-
super.updated(
|
|
23
|
-
const
|
|
24
|
-
|
|
21
|
+
updated(a) {
|
|
22
|
+
super.updated(a);
|
|
23
|
+
const t = this.adapter.templateData.size;
|
|
24
|
+
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
25
25
|
}
|
|
26
26
|
connectedCallback() {
|
|
27
27
|
super.connectedCallback(), this.classList.add("gui-grid", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
@@ -29,11 +29,11 @@ class d extends h {
|
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
const
|
|
32
|
+
const a = this.adapter.templateData.direction === "column", t = !a, p = this.adapter.templateData.autoFit ?? !0, e = {
|
|
33
33
|
"gui-grid__widget": !0,
|
|
34
|
-
"gui-grid__widget--row":
|
|
35
|
-
"gui-grid__widget--row--auto-fit":
|
|
36
|
-
"gui-grid__widget--column":
|
|
34
|
+
"gui-grid__widget--row": t,
|
|
35
|
+
"gui-grid__widget--row--auto-fit": t && p,
|
|
36
|
+
"gui-grid__widget--column": a,
|
|
37
37
|
"gui-grid__widget--align-center": this.adapter.templateData.align === "center",
|
|
38
38
|
"gui-grid__widget--align-start": this.adapter.templateData.align === "start",
|
|
39
39
|
"gui-grid__widget--align-end": this.adapter.templateData.align === "end",
|
|
@@ -47,8 +47,8 @@ class d extends h {
|
|
|
47
47
|
"gui-grid__widget--justify-stretch": this.adapter.templateData.justify === "stretch"
|
|
48
48
|
}, i = [];
|
|
49
49
|
return this.adapter.templateData.columnGap !== void 0 && i.push(`column-gap: ${this.adapter.templateData.columnGap}px`), this.adapter.templateData.rowGap !== void 0 && i.push(`row-gap: ${this.adapter.templateData.rowGap}px`), n`
|
|
50
|
-
<div class=${
|
|
51
|
-
${
|
|
50
|
+
<div class=${D(e)} id=${this.widget?.uid} style=${i.join("; ")}>
|
|
51
|
+
${y(
|
|
52
52
|
this.adapter.templateData.children || [],
|
|
53
53
|
(r) => r?.uid,
|
|
54
54
|
(r) => n`<div class="gui-grid__cell" style="grid-column: span ${r.size || 1}">
|
|
@@ -59,17 +59,17 @@ class d extends h {
|
|
|
59
59
|
`;
|
|
60
60
|
}
|
|
61
61
|
disconnectedCallback() {
|
|
62
|
-
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions
|
|
62
|
+
super.disconnectedCallback(), this.adapter.destroy(), f(this.subscriptions);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
g([
|
|
66
|
-
c({ context:
|
|
66
|
+
c({ context: o }),
|
|
67
67
|
_({ attribute: !1 })
|
|
68
68
|
], d.prototype, "formContext");
|
|
69
69
|
g([
|
|
70
70
|
m({ context: u })
|
|
71
71
|
], d.prototype, "adapter");
|
|
72
|
-
|
|
72
|
+
w("gui-grid-layout", d);
|
|
73
73
|
export {
|
|
74
74
|
d as GridElement
|
|
75
75
|
};
|