@golemui/gui-lit 1.3.0 → 1.4.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/accordion.element-BEenQrCh.js +102 -0
  3. package/{alert.element-CHn49Yaf.js → alert.element-Dzv49O-1.js} +19 -19
  4. package/{button.element-C9fHivSw.js → button.element-CKYv0Glr.js} +14 -14
  5. package/{calendar.element-XkojKTJk.js → calendar.element-DkHZFBNr.js} +16 -16
  6. package/{checkbox.element-DU_tVMXu.js → checkbox.element-MukoziRw.js} +16 -16
  7. package/{currency.element-BmAH5KS_.js → currency.element-DNumeSKA.js} +13 -13
  8. package/{date-picker.element-Bg3rF95F.js → date-picker.element-DpQmremq.js} +5 -5
  9. package/{date-time-calendar.element-sywQCeQQ.js → date-time-calendar.element-GAr8VMGa.js} +5 -5
  10. package/{date-time-picker.element-HHpwjWTQ.js → date-time-picker.element-Bt0GYSpS.js} +5 -5
  11. package/{date-time.element-ucETvSTC.js → date-time.element-WfLnY_Cb.js} +14 -14
  12. package/{date.element-BEHGxRFF.js → date.element-ChpTi2AQ.js} +15 -15
  13. package/default-multi-list-item-renderer-Cv-guvEX.js +31 -0
  14. package/{dropdown.element-Dg80G2PL.js → dropdown.element-D9wMyqWQ.js} +76 -55
  15. package/{flex.element-pwba7621.js → flex.element-DiZWJBwt.js} +14 -14
  16. package/{grid.element-C8K7_Qi3.js → grid.element-DJ9ACsqZ.js} +22 -22
  17. package/index.js +79 -77
  18. package/index.umd.cjs +374 -117
  19. package/lib/components/accordion.element.d.ts +3 -2
  20. package/lib/components/default-multi-list-item-renderer.d.ts +2 -0
  21. package/lib/components/dropdown.element.d.ts +3 -2
  22. package/lib/components/multi-dropdown.element.d.ts +48 -0
  23. package/lib/components/multi-list.element.d.ts +27 -0
  24. package/lib/components/tabs.element.d.ts +3 -0
  25. package/{list.element-ZtEMKE2x.js → list.element-DD5IL4QB.js} +7 -7
  26. package/{markdown-text.element-DDm36qD0.js → markdown-text.element-DflCQwAo.js} +16 -16
  27. package/{markdown.element-DWz3U9rG.js → markdown.element-DUHHoi2Y.js} +13 -13
  28. package/multi-dropdown.element-iEOlPvux.js +312 -0
  29. package/multi-list.element-CCX3i3k6.js +162 -0
  30. package/{number.element-VkG5wScD.js → number.element-mQSFQsYC.js} +16 -16
  31. package/package.json +6 -6
  32. package/{password.element-C5vQHq5P.js → password.element-xw5gugEg.js} +13 -13
  33. package/{radiogroup.element-CKdO9HwO.js → radiogroup.element-TqfrxVyI.js} +15 -15
  34. package/{range-calendar.element-BznGrej5.js → range-calendar.element-BJr97SVA.js} +13 -5
  35. package/{range-date-input.element-BloTHRDl.js → range-date-input.element-DDRYvP9h.js} +23 -15
  36. package/{range-date-picker.element-DKhwFasW.js → range-date-picker.element-rdEr0_wu.js} +25 -17
  37. package/{range-date-time-calendar.element-CZCET-sb.js → range-date-time-calendar.element-UlL1BBRJ.js} +25 -17
  38. package/{range-date-time-input.element-Dr2VrYhG.js → range-date-time-input.element-Cq4IdW7N.js} +17 -9
  39. package/{range-date-time-picker.element-CYeIMWLp.js → range-date-time-picker.element-CnJcIN9C.js} +27 -19
  40. package/{range-time-input.element-7OZhPQqx.js → range-time-input.element-Cq0TrGe9.js} +17 -9
  41. package/{range-time-picker.element-D0mRFZkK.js → range-time-picker.element-BzlIuZ6m.js} +24 -16
  42. package/{renderer.element-DbsFoBba.js → renderer.element-BVwerbtL.js} +15 -15
  43. package/repeater.element-DQNI4b7I.js +133 -0
  44. package/{select.element-Bb_9jAVB.js → select.element-RBtbAvLx.js} +12 -11
  45. package/tabs.element-BiVaQlvt.js +171 -0
  46. package/{tags.element-BSN3i9Gx.js → tags.element-CGvxhMmX.js} +18 -19
  47. package/{textarea.element-Dl1ZEOqO.js → textarea.element-E2ntRBtE.js} +13 -13
  48. package/{textinput.element-C5Vbbkxq.js → textinput.element-0q5F5ol3.js} +16 -16
  49. package/{time-picker.element-Crmj9YDy.js → time-picker.element-BiLaLr_c.js} +5 -5
  50. package/{time.element-DfSeAZp4.js → time.element-92goKRwJ.js} +15 -15
  51. package/{toggle.element-ORsprZ2M.js → toggle.element-zDUc9Vja.js} +16 -16
  52. package/accordion.element-C9GzfKrY.js +0 -103
  53. package/repeater.element-DGEbwvhY.js +0 -138
  54. package/tabs.element-BYDNF_pm.js +0 -161
@@ -0,0 +1,171 @@
1
+ import { LayoutWidgetAdapter as v, formContext as w, layoutContext as y } from "@golemui/lit";
2
+ import { createIntersectionObserver as h } from "@golemui/gui-components/internals";
3
+ import { unsubscribeAll as x, safeDefine as $ } from "@golemui/lit/internals";
4
+ import { repeaterIndexSuffix as T, tabButtonId as c, tabPanelId as u } from "@golemui/gui-shared/internals";
5
+ import { consume as C, provide as k } from "@lit/context";
6
+ import { LitElement as D, html as o, nothing as I } from "lit";
7
+ import { repeat as p } from "lit-html/directives/repeat.js";
8
+ import { query as f, state as g, queryAll as S, property as m } from "lit/decorators.js";
9
+ import { classMap as b } from "lit/directives/class-map.js";
10
+ import "rxjs";
11
+ var _ = Object.defineProperty, d = (l, s, e, n) => {
12
+ for (var t = void 0, a = l.length - 1, i; a >= 0; a--)
13
+ (i = l[a]) && (t = i(s, e, t) || t);
14
+ return t && _(s, e, t), t;
15
+ };
16
+ class r extends D {
17
+ constructor() {
18
+ super(...arguments), this.activeTab = "", this.adapter = new v(), this.subscriptions = [], this.rowIndexSuffix = "";
19
+ }
20
+ get activeChildUid() {
21
+ return this.childUid(this.activeTab);
22
+ }
23
+ childUid(s) {
24
+ return `${s}${this.rowIndexSuffix}`;
25
+ }
26
+ createRenderRoot() {
27
+ return this;
28
+ }
29
+ updated(s) {
30
+ super.updated(s);
31
+ const e = this.adapter.templateData.size;
32
+ e ? this.style.flex = String(e) : this.style.removeProperty("flex");
33
+ }
34
+ connectedCallback() {
35
+ super.connectedCallback(), this.classList.add("gui-tabs", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget);
36
+ const s = this.adapter.templateData;
37
+ this.activeTab = s.defaultOpen ?? s.tabs?.[0]?.uid ?? "", this.rowIndexSuffix = T(this.widget.uid), this.subscriptions.push(
38
+ this.adapter.templateDataChanged$.subscribe(() => {
39
+ this.requestUpdate();
40
+ })
41
+ );
42
+ }
43
+ firstUpdated(s) {
44
+ this.startObserver = h(
45
+ this.startSentinel,
46
+ (t) => this.isStartVisible = t
47
+ ), this.endObserver = h(
48
+ this.endSentinel,
49
+ (t) => this.isEndVisible = t
50
+ );
51
+ const n = (this.adapter.templateData.tabs ?? []).findIndex((t) => t.uid === this.activeTab);
52
+ n > -1 && this.tabButtons[n].scrollIntoView({ block: "nearest", inline: "nearest" });
53
+ }
54
+ render() {
55
+ if (!this.adapter.templateData) return o``;
56
+ const s = this.adapter.templateData.children ?? [], e = (this.adapter.templateData.tabs ?? []).map((t) => {
57
+ const a = s.find((i) => i.uid === this.childUid(t.uid));
58
+ return { tab: t, child: a, isActive: a?.uid === this.activeChildUid };
59
+ }).filter(
60
+ ({ child: t, isActive: a }) => t !== void 0 && (a || this.adapter.templateData.renderMode !== "activeOnly")
61
+ ), n = {
62
+ "gui-widget": !0,
63
+ "gui-widget--horizontal": !0,
64
+ "gui-tabs--start-shadow": !this.isStartVisible,
65
+ "gui-tabs--end-shadow": !this.isEndVisible
66
+ };
67
+ return o`<nav class=${b(n)} id=${this.widget.uid}>
68
+ <ul role="tablist">
69
+ <li role="presentation" class="gui-sentinel gui-sentinel__start"></li>
70
+ ${this.adapter.templateData.tabs ? p(
71
+ this.adapter.templateData.tabs,
72
+ (t) => o`
73
+ <li role="presentation">
74
+ <button
75
+ type="button"
76
+ role="tab"
77
+ tabindex=${t.uid === this.activeTab ? "0" : "-1"}
78
+ data-cy=${c(this.widget.uid, t.uid)}
79
+ id=${c(this.widget.uid, t.uid)}
80
+ aria-controls=${u(this.widget.uid, t.uid)}
81
+ aria-selected=${t.uid === this.activeTab ? "true" : "false"}
82
+ class=${b({ active: t.uid === this.activeTab })}
83
+ @click=${() => this.onClickTab(t.uid)}
84
+ @keydown=${this.onKeyDown}
85
+ @focus=${(a) => a.target.scrollIntoView({
86
+ block: "nearest",
87
+ inline: "nearest"
88
+ })}
89
+ >
90
+ ${t.label}
91
+ </button>
92
+ </li>
93
+ `
94
+ ) : I}
95
+ <li role="presentation" class="gui-sentinel gui-sentinel__end"></li>
96
+ </ul>
97
+ </nav>
98
+ ${p(
99
+ e,
100
+ ({ tab: t }) => t.uid,
101
+ ({ tab: t, child: a, isActive: i }) => o`<section
102
+ role="tabpanel"
103
+ tabindex="0"
104
+ data-cy=${u(this.widget.uid, t.uid)}
105
+ id=${u(this.widget.uid, t.uid)}
106
+ ?hidden=${!i}
107
+ aria-labelledby=${c(this.widget.uid, t.uid)}
108
+ >
109
+ <gui-widget .widget=${a}></gui-widget>
110
+ </section>`
111
+ )}`;
112
+ }
113
+ disconnectedCallback() {
114
+ super.disconnectedCallback(), this.adapter.destroy(), x(this.subscriptions), this.startObserver?.disconnect(), this.endObserver?.disconnect();
115
+ }
116
+ onClickTab(s) {
117
+ this.activeTab = s, this.adapter.change(s), this.requestUpdate();
118
+ }
119
+ onKeyDown(s) {
120
+ const e = this.adapter.templateData.tabs ?? [], n = e.findIndex((i) => i.uid === this.activeTab), t = Array.from(this.tabButtons), a = window.getComputedStyle(this).direction === "rtl";
121
+ switch (s.key) {
122
+ case "ArrowLeft": {
123
+ const i = n + (a ? 1 : -1);
124
+ i >= 0 && i < e.length && (this.activeTab = e[i].uid, t[i].focus());
125
+ break;
126
+ }
127
+ case "ArrowRight": {
128
+ const i = n + (a ? -1 : 1);
129
+ i >= 0 && i < e.length && (this.activeTab = e[i].uid, t[i].focus());
130
+ break;
131
+ }
132
+ case "Home":
133
+ this.activeTab = e[0].uid, t[0].focus();
134
+ break;
135
+ case "End":
136
+ this.activeTab = e[e.length - 1].uid, t[e.length - 1].focus();
137
+ break;
138
+ default:
139
+ return;
140
+ }
141
+ }
142
+ }
143
+ d([
144
+ f(".gui-sentinel__start")
145
+ ], r.prototype, "startSentinel");
146
+ d([
147
+ f(".gui-sentinel__end")
148
+ ], r.prototype, "endSentinel");
149
+ d([
150
+ g()
151
+ ], r.prototype, "isStartVisible");
152
+ d([
153
+ g()
154
+ ], r.prototype, "isEndVisible");
155
+ d([
156
+ S('button[role="tab"]')
157
+ ], r.prototype, "tabButtons");
158
+ d([
159
+ m({ type: String })
160
+ ], r.prototype, "activeTab");
161
+ d([
162
+ C({ context: w }),
163
+ m({ attribute: !1 })
164
+ ], r.prototype, "formContext");
165
+ d([
166
+ k({ context: y })
167
+ ], r.prototype, "adapter");
168
+ $("gui-tabs-layout", r);
169
+ export {
170
+ r as TabsElement
171
+ };
@@ -1,14 +1,14 @@
1
1
  import { InputWidgetAdapter as d, formContext as o, inputContext as n } from "@golemui/lit";
2
2
  import "@golemui/gui-components/tags";
3
- import { consume as h, provide as u } from "@lit/context";
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 f } from "lit/decorators.js";
6
- import { safeDefine as D } from "@golemui/lit/internals";
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
- var b = Object.defineProperty, l = (r, t, e, g) => {
8
+ var D = Object.defineProperty, l = (r, e, t, v) => {
9
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;
10
+ (p = r[i]) && (a = p(e, t, a) || a);
11
+ return a && D(e, t, a), a;
12
12
  };
13
13
  class s extends m {
14
14
  constructor() {
@@ -17,10 +17,10 @@ class s extends m {
17
17
  createRenderRoot() {
18
18
  return this;
19
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");
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
24
  }
25
25
  connectedCallback() {
26
26
  super.connectedCallback(), this.classList.add("gui-tags", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
@@ -44,7 +44,6 @@ class s extends m {
44
44
  .separators=${this.adapter.templateData.separators}
45
45
  .allowDuplicates=${this.adapter.templateData.allowDuplicates ?? !0}
46
46
  .trim=${this.adapter.templateData.trim ?? !0}
47
- .limit=${this.adapter.templateData.limit}
48
47
  .removeAriaLabel=${this.adapter.templateData.removeAriaLabel}
49
48
  .removeIcon=${this.adapter.templateData.removeIcon}
50
49
  @change=${this.valueChanged}
@@ -52,22 +51,22 @@ class s extends m {
52
51
  ></gui-tags>
53
52
  `;
54
53
  }
55
- valueChanged(t) {
56
- const e = t.detail.value;
57
- this.adapter.valueChanged(e);
54
+ valueChanged(e) {
55
+ const t = e.detail.value;
56
+ this.adapter.valueChanged(t);
58
57
  }
59
58
  disconnectedCallback() {
60
- super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
59
+ super.disconnectedCallback(), this.adapter.destroy(), f(this.subscriptions);
61
60
  }
62
61
  }
63
62
  l([
64
- h({ context: o }),
65
- f({ attribute: !1 })
63
+ u({ context: o }),
64
+ b({ attribute: !1 })
66
65
  ], s.prototype, "formContext");
67
66
  l([
68
- u({ context: n })
67
+ h({ context: n })
69
68
  ], s.prototype, "adapter");
70
- D("gui-tags-input", s);
69
+ g("gui-tags-input", s);
71
70
  export {
72
71
  s as TagsElement
73
72
  };
@@ -3,12 +3,12 @@ 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
5
  import { property as f } from "lit/decorators.js";
6
- import { safeDefine as b } from "@golemui/lit/internals";
6
+ import { unsubscribeAll as b, safeDefine as g } from "@golemui/lit/internals";
7
7
  import "rxjs";
8
- var g = Object.defineProperty, d = (r, t, e, x) => {
8
+ var x = Object.defineProperty, d = (r, e, t, $) => {
9
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;
10
+ (p = r[i]) && (a = p(e, t, a) || a);
11
+ return a && x(e, t, a), a;
12
12
  };
13
13
  class s extends m {
14
14
  constructor() {
@@ -17,10 +17,10 @@ class s extends m {
17
17
  createRenderRoot() {
18
18
  return this;
19
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");
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
24
  }
25
25
  connectedCallback() {
26
26
  super.connectedCallback(), this.classList.add("gui-textarea", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
@@ -50,12 +50,12 @@ class s extends m {
50
50
  ></gui-textarea>
51
51
  `;
52
52
  }
53
- valueChanged(t) {
54
- const e = t.detail.value;
55
- this.adapter.valueChanged(e);
53
+ valueChanged(e) {
54
+ const t = e.detail.value;
55
+ this.adapter.valueChanged(t);
56
56
  }
57
57
  disconnectedCallback() {
58
- super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
58
+ super.disconnectedCallback(), this.adapter.destroy(), b(this.subscriptions);
59
59
  }
60
60
  }
61
61
  d([
@@ -65,7 +65,7 @@ d([
65
65
  d([
66
66
  h({ context: n })
67
67
  ], s.prototype, "adapter");
68
- b("gui-textarea-input", s);
68
+ g("gui-textarea-input", s);
69
69
  export {
70
70
  s as TextareaElement
71
71
  };
@@ -1,26 +1,26 @@
1
- import { InputWidgetAdapter as o, formContext as l, inputContext as n } from "@golemui/lit";
1
+ import { InputWidgetAdapter as l, formContext as o, 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
4
  import { LitElement as c, html as m } from "lit";
5
5
  import { property as f } from "lit/decorators.js";
6
- import { safeDefine as b } from "@golemui/lit/internals";
6
+ import { unsubscribeAll as b, safeDefine as x } from "@golemui/lit/internals";
7
7
  import "rxjs";
8
- var x = Object.defineProperty, d = (r, t, e, v) => {
8
+ var v = Object.defineProperty, d = (r, e, t, $) => {
9
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;
10
+ (p = r[i]) && (a = p(e, t, a) || a);
11
+ return a && v(e, t, a), a;
12
12
  };
13
13
  class s extends c {
14
14
  constructor() {
15
- super(...arguments), this.adapter = new o(), this.subscriptions = [];
15
+ super(...arguments), this.adapter = new l(), this.subscriptions = [];
16
16
  }
17
17
  createRenderRoot() {
18
18
  return this;
19
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");
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
24
  }
25
25
  connectedCallback() {
26
26
  super.connectedCallback(), this.classList.add("gui-textinput", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
@@ -47,22 +47,22 @@ class s extends c {
47
47
  ></gui-textinput>
48
48
  `;
49
49
  }
50
- valueChanged(t) {
51
- const e = t.detail.value;
52
- this.adapter.valueChanged(e);
50
+ valueChanged(e) {
51
+ const t = e.detail.value;
52
+ this.adapter.valueChanged(t);
53
53
  }
54
54
  disconnectedCallback() {
55
- super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
55
+ super.disconnectedCallback(), this.adapter.destroy(), b(this.subscriptions);
56
56
  }
57
57
  }
58
58
  d([
59
- u({ context: l }),
59
+ u({ context: o }),
60
60
  f({ attribute: !1 })
61
61
  ], s.prototype, "formContext");
62
62
  d([
63
63
  h({ context: n })
64
64
  ], s.prototype, "adapter");
65
- b("gui-textinput-input", s);
65
+ x("gui-textinput-input", s);
66
66
  export {
67
67
  s as TextinputElement
68
68
  };
@@ -3,12 +3,12 @@ import "@golemui/gui-components/time-picker";
3
3
  import { consume as p, provide as u } from "@lit/context";
4
4
  import { LitElement as h, html as c } from "lit";
5
5
  import { property as g } from "lit/decorators.js";
6
- import { safeDefine as b } from "@golemui/lit/internals";
6
+ import { unsubscribeAll as b, safeDefine as $ } from "@golemui/lit/internals";
7
7
  import "rxjs";
8
- var $ = Object.defineProperty, n = (a, e, i, f) => {
8
+ var f = Object.defineProperty, n = (a, e, i, v) => {
9
9
  for (var t = void 0, r = a.length - 1, o; r >= 0; r--)
10
10
  (o = a[r]) && (t = o(e, i, t) || t);
11
- return t && $(e, i, t), t;
11
+ return t && f(e, i, t), t;
12
12
  };
13
13
  class s extends h {
14
14
  constructor() {
@@ -73,7 +73,7 @@ class s extends h {
73
73
  this.adapter.injectValidationIssues([e.detail.message]);
74
74
  }
75
75
  disconnectedCallback() {
76
- super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
76
+ super.disconnectedCallback(), this.adapter.destroy(), b(this.subscriptions);
77
77
  }
78
78
  }
79
79
  n([
@@ -83,7 +83,7 @@ n([
83
83
  n([
84
84
  u({ context: m })
85
85
  ], s.prototype, "adapter");
86
- b("gui-time-picker-input", s);
86
+ $("gui-time-picker-input", s);
87
87
  export {
88
88
  s as TimePickerElement
89
89
  };
@@ -1,18 +1,18 @@
1
1
  import { InputWidgetAdapter as l, formContext as o, inputContext as m } from "@golemui/lit";
2
2
  import { addIcon as n } from "@golemui/gui-components/internals";
3
- import { safeDefine as h } from "@golemui/lit/internals";
3
+ import { unsubscribeAll as h, safeDefine as u } from "@golemui/lit/internals";
4
4
  import "@golemui/gui-components/time-input";
5
- import { consume as u, provide as c } from "@lit/context";
6
- import { LitElement as $, html as b } from "lit";
7
- import { property as g } from "lit/decorators.js";
5
+ import { consume as c, provide as $ } from "@lit/context";
6
+ import { LitElement as b, html as g } from "lit";
7
+ import { property as D } from "lit/decorators.js";
8
8
  import "rxjs";
9
- import { classMap as D } from "lit/directives/class-map.js";
10
- var f = Object.defineProperty, d = (i, t, a, x) => {
9
+ import { classMap as f } from "lit/directives/class-map.js";
10
+ var x = Object.defineProperty, d = (i, t, a, v) => {
11
11
  for (var e = void 0, r = i.length - 1, p; r >= 0; r--)
12
12
  (p = i[r]) && (e = p(t, a, e) || e);
13
- return e && f(t, a, e), e;
13
+ return e && x(t, a, e), e;
14
14
  };
15
- class s extends $ {
15
+ class s extends b {
16
16
  constructor() {
17
17
  super(...arguments), this.adapter = new l(), this.subscriptions = [];
18
18
  }
@@ -32,9 +32,9 @@ class s extends $ {
32
32
  render() {
33
33
  super.render();
34
34
  const t = n("time", this.adapter.templateData);
35
- return b`
35
+ return g`
36
36
  <gui-time
37
- class=${D(t.widgetClasses)}
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}
@@ -69,17 +69,17 @@ class s extends $ {
69
69
  this.adapter.injectValidationIssues([t.detail.message]);
70
70
  }
71
71
  disconnectedCallback() {
72
- super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
72
+ super.disconnectedCallback(), this.adapter.destroy(), h(this.subscriptions);
73
73
  }
74
74
  }
75
75
  d([
76
- u({ context: o }),
77
- g({ attribute: !1 })
76
+ c({ context: o }),
77
+ D({ attribute: !1 })
78
78
  ], s.prototype, "formContext");
79
79
  d([
80
- c({ context: m })
80
+ $({ context: m })
81
81
  ], s.prototype, "adapter");
82
- h("gui-time-input", s);
82
+ u("gui-time-input", s);
83
83
  export {
84
84
  s as TimeElement
85
85
  };
@@ -1,26 +1,26 @@
1
1
  import { InputWidgetAdapter as p, 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
- import { LitElement as c, html as m } from "lit";
4
+ import { LitElement as m, html as c } from "lit";
5
5
  import { property as g } from "lit/decorators.js";
6
- import { safeDefine as f } from "@golemui/lit/internals";
6
+ import { unsubscribeAll as f, safeDefine as b } from "@golemui/lit/internals";
7
7
  import "rxjs";
8
- var b = Object.defineProperty, d = (r, t, e, v) => {
8
+ var v = Object.defineProperty, d = (r, e, t, C) => {
9
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;
10
+ (o = r[i]) && (a = o(e, t, a) || a);
11
+ return a && v(e, t, a), a;
12
12
  };
13
- class s extends c {
13
+ class s extends m {
14
14
  constructor() {
15
15
  super(...arguments), this.adapter = new p(), this.subscriptions = [];
16
16
  }
17
17
  createRenderRoot() {
18
18
  return this;
19
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");
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
24
  }
25
25
  connectedCallback() {
26
26
  super.connectedCallback(), this.classList.add("gui-toggle", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
@@ -28,7 +28,7 @@ class s extends c {
28
28
  );
29
29
  }
30
30
  render() {
31
- return super.render(), m`
31
+ return super.render(), c`
32
32
  <gui-toggle
33
33
  .uid=${this.widget.uid}
34
34
  .label=${this.adapter.templateData.label}
@@ -45,12 +45,12 @@ class s extends c {
45
45
  ></gui-toggle>
46
46
  `;
47
47
  }
48
- valueChanged(t) {
49
- const e = t.detail.value;
50
- this.adapter.valueChanged(e);
48
+ valueChanged(e) {
49
+ const t = e.detail.value;
50
+ this.adapter.valueChanged(t);
51
51
  }
52
52
  disconnectedCallback() {
53
- super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
53
+ super.disconnectedCallback(), this.adapter.destroy(), f(this.subscriptions);
54
54
  }
55
55
  }
56
56
  d([
@@ -60,7 +60,7 @@ d([
60
60
  d([
61
61
  h({ context: n })
62
62
  ], s.prototype, "adapter");
63
- f("gui-toggle-input", s);
63
+ b("gui-toggle-input", s);
64
64
  export {
65
65
  s as ToggleElement
66
66
  };
@@ -1,103 +0,0 @@
1
- import { LayoutWidgetAdapter as l, formContext as h, layoutContext as u } from "@golemui/lit";
2
- import { consume as g, provide as m } from "@lit/context";
3
- import { LitElement as f, html as s, nothing as c } from "lit";
4
- import { property as v } from "lit/decorators.js";
5
- import { safeDefine as b } from "@golemui/lit/internals";
6
- import "rxjs";
7
- import { repeat as w } from "lit-html/directives/repeat.js";
8
- import { classMap as $ } from "lit/directives/class-map.js";
9
- var _ = Object.defineProperty, p = (r, t, e, a) => {
10
- for (var i = void 0, o = r.length - 1, d; o >= 0; o--)
11
- (d = r[o]) && (i = d(t, e, i) || i);
12
- return i && _(t, e, i), i;
13
- };
14
- class n extends f {
15
- constructor() {
16
- super(...arguments), this.activeSections = {}, this.adapter = new l(), this.subscriptions = [];
17
- }
18
- createRenderRoot() {
19
- return this;
20
- }
21
- updated(t) {
22
- super.updated(t);
23
- const e = this.adapter.templateData.size;
24
- e ? this.style.flex = String(e) : this.style.removeProperty("flex");
25
- }
26
- connectedCallback() {
27
- super.connectedCallback(), this.classList.add("gui-accordion", "gui-field");
28
- const t = this.widget.props;
29
- this.adapter.context = this.formContext, this.adapter.init(this.widget), this.activeSections = t.defaultOpen ?? {}, this.subscriptions.push(
30
- this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
31
- );
32
- }
33
- onClickButton(t) {
34
- this.widget.props.singleOpen && Object.keys(this.activeSections).filter((a) => a !== t).forEach((a) => {
35
- this.activeSections[a] = !1;
36
- }), this.activeSections[t] = !this.activeSections[t], this.adapter.change(this.activeSections), this.requestUpdate();
37
- }
38
- getChild(t) {
39
- return this.widget.children.find((e) => e.uid === t);
40
- }
41
- render() {
42
- return this.adapter.templateData ? s`
43
- <div class="gui-widget" id=${this.widget.uid}>
44
- ${this.adapter.templateData.sections ? w(
45
- this.adapter.templateData.sections,
46
- (t) => t.uid,
47
- (t) => {
48
- const e = this.activeSections[t.uid] || this.adapter.templateData.renderMode !== "activeOnly" ? s`<section
49
- class="gui-widget"
50
- role="region"
51
- id=${`accordion_section_${t.uid}`}
52
- ?hidden=${!this.activeSections[t.uid] && this.adapter.templateData.renderMode !== "activeOnly"}
53
- aria-labelledby=${`accordion_button_${t.uid}`}
54
- >
55
- <gui-widget .widget=${this.getChild(t.uid)}></gui-widget>
56
- </section>` : c;
57
- return s`<div class="gui-accordion__section">
58
- <button
59
- type="button"
60
- tabindex="0"
61
- class=${$({
62
- active: this.activeSections[t.uid]
63
- })}
64
- id=${`accordion_button_${t.uid}`}
65
- aria-controls=${`accordion_section_${t.uid}`}
66
- aria-expanded=${this.activeSections[t.uid] ? "true" : "false"}
67
- @click=${() => this.onClickButton(t.uid)}
68
- >
69
- ${t.label}<span class="gui-accordion__arrow"
70
- ><svg
71
- xmlns="http://www.w3.org/2000/svg"
72
- width="16"
73
- height="16"
74
- viewBox="0 0 256 256"
75
- >
76
- <path
77
- 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"
78
- ></path></svg
79
- ></span>
80
- </button>
81
-
82
- ${e}
83
- </div>`;
84
- }
85
- ) : c}
86
- </div>
87
- ` : s``;
88
- }
89
- disconnectedCallback() {
90
- super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
91
- }
92
- }
93
- p([
94
- g({ context: h }),
95
- v({ attribute: !1 })
96
- ], n.prototype, "formContext");
97
- p([
98
- m({ context: u })
99
- ], n.prototype, "adapter");
100
- b("gui-accordion-layout", n);
101
- export {
102
- n as AccordionElement
103
- };