@golemui/gui-lit 0.12.2 → 0.13.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/abstract-calendar-YDgwwbqe.js +528 -0
  3. package/{accordion.element-81uTv6Ms.js → accordion.element-ChLmV6QT.js} +24 -22
  4. package/{alert.element-DWrS5ggK.js → alert.element-9QFlqjj9.js} +23 -21
  5. package/button.element-ATNRRDN3.js +121 -0
  6. package/calendar-P9DzVryu.js +96 -0
  7. package/{calendar.element-C1rLK7aY.js → calendar.element-O2of7VBr.js} +25 -22
  8. package/checkbox.element-DMmer4Jw.js +199 -0
  9. package/currency.element-C7SZkoPP.js +266 -0
  10. package/date-CG1562vW.js +786 -0
  11. package/date-input-VJG8lMVN.js +266 -0
  12. package/{date-picker.element-GNC8f3Qi.js → date-picker.element-Bcyhc0fb.js} +29 -25
  13. package/{date.element-Dzw-UJzC.js → date.element-DfXmcgZi.js} +25 -22
  14. package/{dropdown.element-CebROj9s.js → dropdown.element-DCUI5Y7I.js} +24 -22
  15. package/errors-QjKhr6mA.js +109 -0
  16. package/{flex.element-BMqqfxjI.js → flex.element-B0sG0YT1.js} +24 -22
  17. package/{grid.element-CBMoOuLt.js → grid.element-Bf5aEjkj.js} +24 -22
  18. package/index.js +2708 -1174
  19. package/index.umd.cjs +982 -108
  20. package/lib/components/accordion.element.d.ts +7 -7
  21. package/lib/components/alert.element.d.ts +6 -6
  22. package/lib/components/button.element.d.ts +6 -6
  23. package/lib/components/calendar.element.d.ts +6 -6
  24. package/lib/components/checkbox.element.d.ts +6 -6
  25. package/lib/components/currency.element.d.ts +6 -6
  26. package/lib/components/date-picker.element.d.ts +6 -6
  27. package/lib/components/date.element.d.ts +6 -6
  28. package/lib/components/dropdown.element.d.ts +6 -6
  29. package/lib/components/flex.element.d.ts +6 -6
  30. package/lib/components/grid.element.d.ts +6 -6
  31. package/lib/components/list.element.d.ts +6 -6
  32. package/lib/components/markdown-text.element.d.ts +6 -6
  33. package/lib/components/markdown.element.d.ts +6 -6
  34. package/lib/components/number.element.d.ts +6 -6
  35. package/lib/components/password.element.d.ts +6 -6
  36. package/lib/components/radiogroup.element.d.ts +6 -6
  37. package/lib/components/range-calendar.element.d.ts +6 -6
  38. package/lib/components/range-date-input.element.d.ts +6 -6
  39. package/lib/components/range-date-picker.element.d.ts +6 -6
  40. package/lib/components/renderer.element.d.ts +6 -6
  41. package/lib/components/repeater.element.d.ts +6 -6
  42. package/lib/components/select.element.d.ts +6 -6
  43. package/lib/components/tabs.element.d.ts +6 -6
  44. package/lib/components/textarea.element.d.ts +6 -6
  45. package/lib/components/textinput.element.d.ts +6 -6
  46. package/lib/components/toggle.element.d.ts +6 -6
  47. package/lib/widget.loaders.d.ts +2 -2
  48. package/list-CtFsv7GB.js +284 -0
  49. package/{list.element-DIIgN_Ww.js → list.element-G8RNRZXU.js} +30 -27
  50. package/markdown-text-X-BRJT6K.js +30 -0
  51. package/{markdown-text.element-DY7b-dU5.js → markdown-text.element-C_1OqrGa.js} +23 -20
  52. package/markdown.element-CT1JOOM3.js +596 -0
  53. package/number.element-HaXEg_7U.js +282 -0
  54. package/one-of-DifUsEYY.js +48 -0
  55. package/package.json +6 -6
  56. package/password.element-B4-0SCe4.js +238 -0
  57. package/radiogroup.element-DzHLgRh1.js +232 -0
  58. package/range-calendar-qpakwAba.js +326 -0
  59. package/{range-calendar.element-Bli9UfhN.js → range-calendar.element-C-4qqRGK.js} +20 -17
  60. package/range-date-input-CrNpOVHt.js +507 -0
  61. package/{range-date-input.element-BwPvGk5F.js → range-date-input.element-Iq5Y7uLQ.js} +20 -17
  62. package/{range-date-picker.element-DJQOwDPh.js → range-date-picker.element-4bg4Uraq.js} +29 -25
  63. package/{renderer.element-B99qD2mz.js → renderer.element-DMsheQGi.js} +19 -17
  64. package/{repeater.element-AaifWsOB.js → repeater.element-Ry8HyMfW.js} +41 -27
  65. package/select.element-DuGZjlZY.js +257 -0
  66. package/tabs-DzSCq_98.js +13 -0
  67. package/{tabs.element-k8JMNDXi.js → tabs.element-VLrtF1j5.js} +31 -29
  68. package/templates-Dk1jxLwS.js +75 -0
  69. package/textarea.element-C8yx2u0o.js +237 -0
  70. package/textinput.element-DKuplF1A.js +204 -0
  71. package/toggle.element-NXRrhALB.js +201 -0
  72. package/button.element-hjhVBamJ.js +0 -56
  73. package/checkbox.element-bu9_MvED.js +0 -65
  74. package/currency.element-Bxv2WxAx.js +0 -72
  75. package/default-list-item-renderer-DNVEjKSX.js +0 -23
  76. package/markdown.element-ZD_n4ObO.js +0 -73
  77. package/number.element-B0E7W2TK.js +0 -70
  78. package/password.element-C4_eLdUO.js +0 -71
  79. package/radiogroup.element-BD8qBNoO.js +0 -68
  80. package/select.element-BLxtqB0A.js +0 -74
  81. package/textarea.element-DgDwfzYP.js +0 -70
  82. package/textinput.element-DSLFDjfb.js +0 -67
  83. package/toggle.element-BLu6F99u.js +0 -65
@@ -1,15 +1,17 @@
1
- import * as n from "@golemui/lit";
2
- import { consume as c, provide as l } from "@lit/context";
3
- import { LitElement as u, html as h } from "lit";
4
- import { property as m, customElement as f } from "lit/decorators.js";
5
- var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, d = (r, e, a, s) => {
6
- for (var t = s > 1 ? void 0 : s ? g(e, a) : e, o = r.length - 1, p; o >= 0; o--)
1
+ import { DisplayWidgetAdapter as d, formContext as c, displayWidgetContext as l } from "@golemui/lit";
2
+ import "@golemui/gui-shared";
3
+ import { consume as u, provide as m } from "@lit/context";
4
+ import { LitElement as h, html as f } from "lit";
5
+ import { property as b, customElement as g } from "lit/decorators.js";
6
+ import "rxjs";
7
+ var x = Object.defineProperty, v = Object.getOwnPropertyDescriptor, n = (r, e, a, s) => {
8
+ for (var t = s > 1 ? void 0 : s ? v(e, a) : e, o = r.length - 1, p; o >= 0; o--)
7
9
  (p = r[o]) && (t = (s ? p(e, a, t) : p(t)) || t);
8
- return s && t && b(e, a, t), t;
10
+ return s && t && x(e, a, t), t;
9
11
  };
10
- let i = class extends u {
12
+ let i = class extends h {
11
13
  constructor() {
12
- super(...arguments), this.adapter = new n.DisplayWidgetAdapter(), this.subscriptions = [];
14
+ super(...arguments), this.adapter = new d(), this.subscriptions = [];
13
15
  }
14
16
  createRenderRoot() {
15
17
  return this;
@@ -25,7 +27,7 @@ let i = class extends u {
25
27
  );
26
28
  }
27
29
  render() {
28
- return h`
30
+ return f`
29
31
  <div class="gui-widget" id=${this.widget.uid}>${this.adapter.templateData.render}</div>
30
32
  `;
31
33
  }
@@ -33,15 +35,15 @@ let i = class extends u {
33
35
  super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((r) => r.unsubscribe());
34
36
  }
35
37
  };
36
- d([
37
- c({ context: n.formContext }),
38
- m({ attribute: !1 })
38
+ n([
39
+ u({ context: c }),
40
+ b({ attribute: !1 })
39
41
  ], i.prototype, "formContext", 2);
40
- d([
41
- l({ context: n.displayWidgetContext })
42
+ n([
43
+ m({ context: l })
42
44
  ], i.prototype, "adapter", 2);
43
- i = d([
44
- f("gui-renderer-component")
45
+ i = n([
46
+ g("gui-renderer-component")
45
47
  ], i);
46
48
  export {
47
49
  i as RendererElement
@@ -1,19 +1,33 @@
1
- import * as c from "@golemui/lit";
2
- import { getItemKey as l } from "@golemui/gui-shared";
3
- import { consume as h, provide as m } from "@lit/context";
4
- import { LitElement as g, nothing as n, html as s } from "lit";
5
- import { repeat as b } from "lit-html/directives/repeat.js";
6
- import { property as $, state as v, query as f, customElement as _ } from "lit/decorators.js";
7
- var I = Object.defineProperty, w = Object.getOwnPropertyDescriptor, u = (e, t, a, r) => {
8
- for (var i = r > 1 ? void 0 : r ? w(t, a) : t, d = e.length - 1, p; d >= 0; d--)
9
- (p = e[d]) && (i = (r ? p(t, a, i) : p(i)) || i);
10
- return r && i && I(t, a, i), i;
1
+ import "@golemui/gui-shared";
2
+ import "@golemui/core";
3
+ import "./index.js";
4
+ import { InputWidgetAdapter as c, formContext as l, inputContext as h } from "@golemui/lit";
5
+ import { consume as m, provide as g } from "@lit/context";
6
+ import { LitElement as b, nothing as n, html as s } from "lit";
7
+ import { repeat as f } from "lit-html/directives/repeat.js";
8
+ import { property as _, state as $, query as v, customElement as I } from "lit/decorators.js";
9
+ import "rxjs";
10
+ import "./errors-QjKhr6mA.js";
11
+ function w(e, t) {
12
+ if (e != null && typeof e == "object" && "__rid" in e)
13
+ return e.__rid;
14
+ const r = t();
15
+ return Object.defineProperty(e, "__rid", {
16
+ value: r,
17
+ enumerable: !1,
18
+ configurable: !1
19
+ }), r;
20
+ }
21
+ var y = Object.defineProperty, C = Object.getOwnPropertyDescriptor, u = (e, t, r, a) => {
22
+ for (var i = a > 1 ? void 0 : a ? C(t, r) : t, d = e.length - 1, p; d >= 0; d--)
23
+ (p = e[d]) && (i = (a ? p(t, r, i) : p(i)) || i);
24
+ return a && i && y(t, r, i), i;
11
25
  };
12
- let C = 0;
13
- const y = () => C++;
14
- let o = class extends g {
26
+ let x = 0;
27
+ const F = () => x++;
28
+ let o = class extends b {
15
29
  constructor() {
16
- super(...arguments), this.adapter = new c.InputWidgetAdapter(), this.isFocused = !1, this.subscriptions = [];
30
+ super(...arguments), this.adapter = new c(), this.isFocused = !1, this.subscriptions = [];
17
31
  }
18
32
  createRenderRoot() {
19
33
  return this;
@@ -52,20 +66,20 @@ let o = class extends g {
52
66
  .required=${e.validator?.required}
53
67
  .native=${!1}
54
68
  ></gui-label>
55
- ${e.value ? b(
69
+ ${e.value ? f(
56
70
  e.value,
57
- (a) => l(a, y),
58
- (a, r) => s`
71
+ (r) => w(r, F),
72
+ (r, a) => s`
59
73
  <div class="gui-repeater__card">
60
74
  <div class="gui-repeater__card-header">
61
75
  ${e.title ? s`<span class="gui-repeater__card-title"
62
- >${e.title} ${r + 1}</span
76
+ >${e.title} ${a + 1}</span
63
77
  >` : n}
64
78
  <button
65
79
  type="button"
66
80
  tabindex="0"
67
81
  class="gui-button gui-button--sm gui-repeater__remove-btn"
68
- @click=${() => this.removeItem(r)}
82
+ @click=${() => this.removeItem(a)}
69
83
  >
70
84
  ${e.removeButtonIcon ? s`<span
71
85
  class="gui-widget-icon gui-button-icon ${e.removeButtonIcon}"
@@ -75,7 +89,7 @@ let o = class extends g {
75
89
  </button>
76
90
  </div>
77
91
  <gui-repeater-widget
78
- .repeaterIndex=${r}
92
+ .repeaterIndex=${a}
79
93
  .widget=${e.template}
80
94
  ></gui-repeater-widget>
81
95
  </div>
@@ -111,25 +125,25 @@ let o = class extends g {
111
125
  this.adapter.valueChanged(e), this.requestUpdate();
112
126
  }
113
127
  removeItem(e) {
114
- const t = (this.adapter.templateData.value ?? []).filter((a, r) => e !== r);
128
+ const t = (this.adapter.templateData.value ?? []).filter((r, a) => e !== a);
115
129
  "structuredClone" in window ? this.adapter.valueChanged(structuredClone(t)) : this.adapter.valueChanged(JSON.parse(JSON.stringify(t))), this.requestUpdate();
116
130
  }
117
131
  };
118
132
  u([
119
- h({ context: c.formContext }),
120
- $({ attribute: !1 })
133
+ m({ context: l }),
134
+ _({ attribute: !1 })
121
135
  ], o.prototype, "formContext", 2);
122
136
  u([
123
- m({ context: c.inputContext })
137
+ g({ context: h })
124
138
  ], o.prototype, "adapter", 2);
125
139
  u([
126
- v()
140
+ $()
127
141
  ], o.prototype, "isFocused", 2);
128
142
  u([
129
- f(".gui-repeater__main-card")
143
+ v(".gui-repeater__main-card")
130
144
  ], o.prototype, "_repeaterRef", 2);
131
145
  o = u([
132
- _("gui-repeater-input")
146
+ I("gui-repeater-input")
133
147
  ], o);
134
148
  export {
135
149
  o as RepeaterElement
@@ -0,0 +1,257 @@
1
+ import { InputWidgetAdapter as g, formContext as b, inputContext as y } from "@golemui/lit";
2
+ import "@golemui/gui-shared";
3
+ import { LitElement as m, html as n, nothing as u } from "lit";
4
+ import { repeat as f } from "lit-html/directives/repeat.js";
5
+ import { property as s, customElement as v } from "lit/decorators.js";
6
+ import { classMap as $ } from "lit/directives/class-map.js";
7
+ import { G as C, a as D, b as w, c as E } from "./templates-Dk1jxLwS.js";
8
+ import { u as S, i as F } from "./one-of-DifUsEYY.js";
9
+ import { consume as x, provide as O } from "@lit/context";
10
+ import "rxjs";
11
+ var _ = Object.defineProperty, q = Object.getOwnPropertyDescriptor, l = (t, e, r, i) => {
12
+ for (var o = i > 1 ? void 0 : i ? q(e, r) : e, d = t.length - 1, p; d >= 0; d--)
13
+ (p = t[d]) && (o = (i ? p(e, r, o) : p(o)) || o);
14
+ return i && o && _(e, r, o), o;
15
+ };
16
+ let a = class extends m {
17
+ constructor() {
18
+ super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = "en", this.errors = [], this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.value = void 0, this.hint = void 0, this.icon = void 0, this.autocomplete = void 0, this.options = [], this.placeholder = void 0, this.labelField = void 0, this.valueField = void 0, this.optionsLoading = !1, this.hasMatchingValue = !1, this.ariaController = new C(this, {
19
+ getTargets: () => this.querySelectorAll(`select[id="${this.uid}"]`),
20
+ getState: () => ({
21
+ uid: this.uid,
22
+ templateData: {
23
+ hint: this.hint,
24
+ errors: this.errors,
25
+ readonly: this.readOnly,
26
+ disabled: this.disabled,
27
+ touched: this.touched
28
+ }
29
+ })
30
+ });
31
+ }
32
+ createRenderRoot() {
33
+ return this;
34
+ }
35
+ connectedCallback() {
36
+ super.connectedCallback(), this.classList.add("gui-field");
37
+ }
38
+ render() {
39
+ super.render();
40
+ const t = {
41
+ uid: this.uid,
42
+ label: this.label,
43
+ errors: this.errors,
44
+ touched: this.touched,
45
+ required: this.required,
46
+ disabled: this.disabled,
47
+ readonly: this.readOnly,
48
+ value: this.value,
49
+ hint: this.hint,
50
+ icon: this.icon,
51
+ autocomplete: this.autocomplete,
52
+ options: this.options,
53
+ placeholder: this.placeholder,
54
+ labelField: this.labelField,
55
+ valueField: this.valueField
56
+ }, e = D("select", t);
57
+ this.options = S(this.options, {
58
+ labelField: this.labelField,
59
+ valueField: this.valueField
60
+ }), this.hasMatchingValue = this.options?.length ? this.options.find(({ value: i }) => i === this.value) !== void 0 : !1;
61
+ const r = this.optionsLoading ? n`<span>Loading...</span>` : n`
62
+ <option value="" disabled selected=${this.hasMatchingValue ? u : ""}>
63
+ ${this.placeholder ?? "Select an option"}
64
+ </option>
65
+ ${f(
66
+ this.options || [],
67
+ (i) => i?.value,
68
+ (i) => n`<option
69
+ value=${i.value}
70
+ selected=${this.hasMatchingValue && i.value === this.value ? "" : u}
71
+ >
72
+ ${i.label}
73
+ </option>`
74
+ )}
75
+ `;
76
+ return n`
77
+ ${w(this.uid, t)}
78
+
79
+ <div class="gui-widget">
80
+ <select
81
+ id=${this.uid}
82
+ tabindex="0"
83
+ data-cy=${`${this.uid}_select`}
84
+ class=${$(e.widgetClasses)}
85
+ ?required=${t.required}
86
+ ?disabled=${t.disabled || t.readonly}
87
+ autocomplete=${this.autocomplete || u}
88
+ @change=${this.valueChanged}
89
+ @blur=${this.onBlur}
90
+ >
91
+ ${r}
92
+ </select>
93
+ <span class="gui-select__arrow"
94
+ ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
95
+ <path
96
+ 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"
97
+ ></path></svg
98
+ ></span>
99
+ ${e.html}
100
+ </div>
101
+
102
+ ${E(this.uid, t)}
103
+ `;
104
+ }
105
+ updated(t) {
106
+ t.has("value") && !this.hasMatchingValue && this.value && this.dispatchEvent(
107
+ new CustomEvent("inputError", {
108
+ detail: {
109
+ message: `Invalid selection: '${this.value}' is not a valid option.`
110
+ },
111
+ bubbles: !0
112
+ })
113
+ );
114
+ }
115
+ valueChanged(t) {
116
+ if (t.stopPropagation(), !this.readOnly) {
117
+ const e = t.target;
118
+ this.dispatchEvent(
119
+ new CustomEvent("change", {
120
+ detail: { value: F(e.value, this.options) },
121
+ bubbles: !0,
122
+ composed: !0
123
+ })
124
+ );
125
+ }
126
+ }
127
+ onBlur() {
128
+ this.dispatchEvent(
129
+ new CustomEvent("blur", {
130
+ bubbles: !0,
131
+ composed: !0
132
+ })
133
+ );
134
+ }
135
+ };
136
+ l([
137
+ s({ type: String })
138
+ ], a.prototype, "uid", 2);
139
+ l([
140
+ s({ type: String })
141
+ ], a.prototype, "label", 2);
142
+ l([
143
+ s({ type: String, attribute: "locale-id" })
144
+ ], a.prototype, "localeId", 2);
145
+ l([
146
+ s({ type: Array })
147
+ ], a.prototype, "errors", 2);
148
+ l([
149
+ s({ type: Boolean })
150
+ ], a.prototype, "touched", 2);
151
+ l([
152
+ s({ type: Boolean })
153
+ ], a.prototype, "required", 2);
154
+ l([
155
+ s({ type: Boolean })
156
+ ], a.prototype, "disabled", 2);
157
+ l([
158
+ s({ type: Boolean, attribute: "readonly" })
159
+ ], a.prototype, "readOnly", 2);
160
+ l([
161
+ s({ type: String })
162
+ ], a.prototype, "value", 2);
163
+ l([
164
+ s({ type: String })
165
+ ], a.prototype, "hint", 2);
166
+ l([
167
+ s({ type: String })
168
+ ], a.prototype, "icon", 2);
169
+ l([
170
+ s({ type: String })
171
+ ], a.prototype, "autocomplete", 2);
172
+ l([
173
+ s({ type: String })
174
+ ], a.prototype, "options", 2);
175
+ l([
176
+ s({ type: String })
177
+ ], a.prototype, "placeholder", 2);
178
+ l([
179
+ s({ type: String })
180
+ ], a.prototype, "labelField", 2);
181
+ l([
182
+ s({ type: String })
183
+ ], a.prototype, "valueField", 2);
184
+ a = l([
185
+ v("gui-select")
186
+ ], a);
187
+ typeof customElements < "u" && !customElements.get("gui-select") && customElements.define("gui-select", a);
188
+ var I = Object.defineProperty, P = Object.getOwnPropertyDescriptor, c = (t, e, r, i) => {
189
+ for (var o = i > 1 ? void 0 : i ? P(e, r) : e, d = t.length - 1, p; d >= 0; d--)
190
+ (p = t[d]) && (o = (i ? p(e, r, o) : p(o)) || o);
191
+ return i && o && I(e, r, o), o;
192
+ };
193
+ let h = class extends m {
194
+ constructor() {
195
+ super(...arguments), this.adapter = new g(), this.subscriptions = [];
196
+ }
197
+ createRenderRoot() {
198
+ return this;
199
+ }
200
+ updated(t) {
201
+ super.updated(t);
202
+ const e = this.adapter.templateData.size;
203
+ e ? this.style.flex = String(e) : this.style.removeProperty("flex");
204
+ }
205
+ connectedCallback() {
206
+ super.connectedCallback(), this.classList.add("gui-select", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
207
+ this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
208
+ );
209
+ }
210
+ render() {
211
+ return super.render(), n`
212
+ <gui-select
213
+ .uid=${this.widget.uid}
214
+ .label=${this.adapter.templateData.label}
215
+ .errors=${this.adapter.templateData.errors}
216
+ ?touched=${this.adapter.templateData.touched}
217
+ ?required=${this.adapter.templateData.validator?.required}
218
+ ?disabled=${this.adapter.templateData.disabled}
219
+ ?readonly=${this.adapter.templateData.readonly}
220
+ .value=${this.adapter.templateData.value}
221
+ .hint=${this.adapter.templateData.hint}
222
+ .icon=${this.adapter.templateData.icon}
223
+ .placeholder=${this.adapter.templateData.placeholder}
224
+ .autocomplete=${this.adapter.templateData.autocomplete}
225
+ .options=${this.adapter.templateData.options}
226
+ .labelField=${this.adapter.templateData.labelField}
227
+ .valueField=${this.adapter.templateData.valueField}
228
+ @change=${this.valueChanged}
229
+ @inputError=${this.onInputError}
230
+ @blur=${() => this.adapter.onBlur()}
231
+ ></gui-select>
232
+ `;
233
+ }
234
+ valueChanged(t) {
235
+ const e = t.detail.value;
236
+ this.adapter.valueChanged(e);
237
+ }
238
+ onInputError(t) {
239
+ this.adapter.injectValidationIssues([t.detail.message]);
240
+ }
241
+ disconnectedCallback() {
242
+ super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
243
+ }
244
+ };
245
+ c([
246
+ x({ context: b }),
247
+ s({ attribute: !1 })
248
+ ], h.prototype, "formContext", 2);
249
+ c([
250
+ O({ context: y })
251
+ ], h.prototype, "adapter", 2);
252
+ h = c([
253
+ v("gui-select-input")
254
+ ], h);
255
+ export {
256
+ h as SelectElement
257
+ };
@@ -0,0 +1,13 @@
1
+ function c(e, t, n) {
2
+ if (!e)
3
+ throw new TypeError("The element provided to the IntersectionObserver must exist");
4
+ const r = new IntersectionObserver((s) => {
5
+ s.forEach((o) => {
6
+ t(o.isIntersecting);
7
+ });
8
+ }, n);
9
+ return r.observe(e), r;
10
+ }
11
+ export {
12
+ c
13
+ };
@@ -1,18 +1,20 @@
1
- import * as c from "@golemui/lit";
2
- import { createIntersectionObserver as p } from "@golemui/gui-components";
3
- import { consume as m, provide as v } from "@lit/context";
4
- import { LitElement as w, html as d, nothing as $ } from "lit";
5
- import { repeat as u } from "lit-html/directives/repeat.js";
6
- import { query as b, state as g, queryAll as y, property as f, customElement as _ } from "lit/decorators.js";
7
- import { classMap as h } from "lit/directives/class-map.js";
8
- var T = Object.defineProperty, x = Object.getOwnPropertyDescriptor, o = (s, i, e, t) => {
9
- for (var r = t > 1 ? void 0 : t ? x(i, e) : i, a = s.length - 1, l; a >= 0; a--)
1
+ import { LayoutWidgetAdapter as f, formContext as m, layoutContext as v } from "@golemui/lit";
2
+ import { c } from "./tabs-DzSCq_98.js";
3
+ import "@golemui/gui-shared";
4
+ import { consume as w, provide as $ } from "@lit/context";
5
+ import { LitElement as y, html as d, nothing as _ } from "lit";
6
+ import { repeat as p } from "lit-html/directives/repeat.js";
7
+ import { query as h, state as b, queryAll as T, property as g, customElement as x } from "lit/decorators.js";
8
+ import { classMap as u } from "lit/directives/class-map.js";
9
+ import "rxjs";
10
+ var C = Object.defineProperty, O = Object.getOwnPropertyDescriptor, o = (s, i, e, t) => {
11
+ for (var r = t > 1 ? void 0 : t ? O(i, e) : i, a = s.length - 1, l; a >= 0; a--)
10
12
  (l = s[a]) && (r = (t ? l(i, e, r) : l(r)) || r);
11
- return t && r && T(i, e, r), r;
13
+ return t && r && C(i, e, r), r;
12
14
  };
13
- let n = class extends w {
15
+ let n = class extends y {
14
16
  constructor() {
15
- super(...arguments), this.activeTab = "", this.adapter = new c.LayoutWidgetAdapter(), this.subscriptions = [];
17
+ super(...arguments), this.activeTab = "", this.adapter = new f(), this.subscriptions = [];
16
18
  }
17
19
  createRenderRoot() {
18
20
  return this;
@@ -32,10 +34,10 @@ let n = class extends w {
32
34
  );
33
35
  }
34
36
  firstUpdated(s) {
35
- this.startObserver = p(
37
+ this.startObserver = c(
36
38
  this.startSentinel,
37
39
  (t) => this.isStartVisible = t
38
- ), this.endObserver = p(
40
+ ), this.endObserver = c(
39
41
  this.endSentinel,
40
42
  (t) => this.isEndVisible = t
41
43
  );
@@ -52,10 +54,10 @@ let n = class extends w {
52
54
  "gui-tabs--start-shadow": !this.isStartVisible,
53
55
  "gui-tabs--end-shadow": !this.isEndVisible
54
56
  };
55
- return d`<nav class=${h(i)} id=${this.widget.uid}>
57
+ return d`<nav class=${u(i)} id=${this.widget.uid}>
56
58
  <ul role="tablist">
57
59
  <li role="presentation" id="start-sentinel" class="gui-sentinel"></li>
58
- ${this.adapter.templateData.tabs ? u(
60
+ ${this.adapter.templateData.tabs ? p(
59
61
  this.adapter.templateData.tabs,
60
62
  (e, t) => d`
61
63
  <li role="presentation">
@@ -67,7 +69,7 @@ let n = class extends w {
67
69
  id=${`tab_${this.widget.uid}_${t}`}
68
70
  aria-controls=${`tabpanel_${this.widget.uid}_${t}`}
69
71
  aria-selected=${e.uid === this.activeTab ? "true" : "false"}
70
- class=${h({ active: e.uid === this.activeTab })}
72
+ class=${u({ active: e.uid === this.activeTab })}
71
73
  @click=${() => this.onClickTab(e.uid)}
72
74
  @keydown=${this.onKeyDown}
73
75
  @focus=${(r) => r.target.scrollIntoView({
@@ -79,11 +81,11 @@ let n = class extends w {
79
81
  </button>
80
82
  </li>
81
83
  `
82
- ) : $}
84
+ ) : _}
83
85
  <li role="presentation" id="end-sentinel" class="gui-sentinel gui-sentinel__end"></li>
84
86
  </ul>
85
87
  </nav>
86
- ${u(
88
+ ${p(
87
89
  s,
88
90
  (e) => e?.uid,
89
91
  (e, t) => d`<section
@@ -128,32 +130,32 @@ let n = class extends w {
128
130
  }
129
131
  };
130
132
  o([
131
- b("#start-sentinel")
133
+ h("#start-sentinel")
132
134
  ], n.prototype, "startSentinel", 2);
133
135
  o([
134
- b("#end-sentinel")
136
+ h("#end-sentinel")
135
137
  ], n.prototype, "endSentinel", 2);
136
138
  o([
137
- g()
139
+ b()
138
140
  ], n.prototype, "isStartVisible", 2);
139
141
  o([
140
- g()
142
+ b()
141
143
  ], n.prototype, "isEndVisible", 2);
142
144
  o([
143
- y('button[role="tab"]')
145
+ T('button[role="tab"]')
144
146
  ], n.prototype, "tabButtons", 2);
145
147
  o([
146
- f({ type: String })
148
+ g({ type: String })
147
149
  ], n.prototype, "activeTab", 2);
148
150
  o([
149
- m({ context: c.formContext }),
150
- f({ attribute: !1 })
151
+ w({ context: m }),
152
+ g({ attribute: !1 })
151
153
  ], n.prototype, "formContext", 2);
152
154
  o([
153
- v({ context: c.layoutContext })
155
+ $({ context: v })
154
156
  ], n.prototype, "adapter", 2);
155
157
  n = o([
156
- _("gui-tabs-layout")
158
+ x("gui-tabs-layout")
157
159
  ], n);
158
160
  export {
159
161
  n as TabsElement
@@ -0,0 +1,75 @@
1
+ import { filterTap as A } from "@golemui/core";
2
+ import { html as o, nothing as t } from "lit";
3
+ import { classMap as y } from "lit/directives/class-map.js";
4
+ class T {
5
+ constructor(r, e) {
6
+ r.addController(this), this.getTargets = e.getTargets, this.getState = e.getState;
7
+ }
8
+ hostConnected() {
9
+ }
10
+ hostUpdated() {
11
+ const r = this.getTargets();
12
+ if (!r) return;
13
+ let e = [];
14
+ r instanceof NodeList ? e = Array.from(r) : Array.isArray(r) ? e = r : e = [r];
15
+ const { uid: l, templateData: a } = this.getState(), { touched: b, errors: c, readonly: f, disabled: _, hint: v } = a, $ = b && c && c.length > 0;
16
+ A(
17
+ e,
18
+ (i) => !!i,
19
+ (i) => {
20
+ const n = (d, g) => {
21
+ g ? i.setAttribute(d, g) : i.removeAttribute(d);
22
+ };
23
+ n("aria-describedby", v ? `${l}_hint` : null), n("aria-invalid", $ ? "true" : null), n("aria-errormessage", $ ? `${l}_errors` : null), n("aria-readonly", _ || f ? "true" : null);
24
+ }
25
+ );
26
+ }
27
+ }
28
+ const q = (s, r, e = !1, l = void 0, a = !0) => a ? r.label ? o`<label
29
+ class="gui-label"
30
+ for=${s}
31
+ data-cy=${`${s}_label`}
32
+ id=${l ? `${s}_${l}_label` : `${s}_label`}
33
+ >
34
+ ${r.label + (r.required ? " *" : "")} ${h(s, r)}
35
+ ${e ? u(s, r) : t}
36
+ </label>` : t : r.label ? o`<span
37
+ class="gui-label"
38
+ data-cy=${`${s}_label`}
39
+ id=${l ? `${s}_${l}_label` : `${s}_label`}
40
+ >
41
+ ${r.label + (r.required ? " *" : "")} ${h(s, r)}
42
+ ${e ? u(s, r) : t}
43
+ </span>` : t, h = (s, r) => r.hint ? o`<div class="gui-widget-hint" id=${`${s}_hint`}>${r.hint}</div>` : o``, E = (s, r) => {
44
+ const e = {
45
+ [`gui-${s}--icon`]: !1,
46
+ [`gui-${s}--icon-right`]: !1
47
+ };
48
+ if (r.icon) {
49
+ e[`gui-${s}--icon`] = !0;
50
+ const l = {
51
+ "gui-widget-icon": !0,
52
+ [r.icon]: !0
53
+ };
54
+ return {
55
+ widgetClasses: e,
56
+ html: o`<span class=${y(l)} data-icon=${r.icon}></span>`
57
+ };
58
+ } else
59
+ return { widgetClasses: e, html: o`` };
60
+ }, u = (s, r) => {
61
+ const e = r.touched && r.errors && r.errors.length > 0;
62
+ return o`${e ? o`<ul class="gui-validator" id=${`${s}_errors`} data-cy=${`${s}_validator-errors`}>
63
+ ${r.errors?.map(
64
+ (l) => o`<li class="gui-validator__error" role="alert" data-cy=${`${s}_validator-error`}>
65
+ ${l}
66
+ </li>`
67
+ )}
68
+ </ul>` : ""}`;
69
+ };
70
+ export {
71
+ T as G,
72
+ E as a,
73
+ q as b,
74
+ u as c
75
+ };