@golemui/gui-lit 1.0.3 → 1.1.1-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.
Files changed (83) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{button.element-3a7rRHbA.js → button.element-CJay43iR.js} +16 -13
  3. package/calendar-D31xNsxx.js +267 -0
  4. package/{range-calendar.element-_1bHW_c1.js → calendar.element-BhFrCsns.js} +16 -16
  5. package/{checkbox.element-CVskoXEc.js → checkbox.element-DAAVB651.js} +49 -49
  6. package/{currency.element-5GSakkxF.js → currency.element-D8A2ObpM.js} +15 -11
  7. package/{date-CDUlLuYy.js → date-DBuYpvcO.js} +88 -29
  8. package/date-input-DLiMreSS.js +204 -0
  9. package/date-picker.element-DeUQtbLg.js +357 -0
  10. package/date-time-calendar-DzU-FtVl.js +374 -0
  11. package/date-time-calendar.element-BLBcVsFu.js +95 -0
  12. package/date-time-input-DZaz2heD.js +246 -0
  13. package/date-time-picker.element-BUbLdV6i.js +440 -0
  14. package/date-time.element-B5onfSBG.js +93 -0
  15. package/{date.element-BZO0UQez.js → date.element-BsKhLrEc.js} +27 -19
  16. package/day-status-CsWStVQV.js +554 -0
  17. package/{dropdown.element-CyJbVAA5.js → dropdown.element-CXpMwJsU.js} +53 -37
  18. package/{errors-QjKhr6mA.js → errors-Byb2dIhK.js} +3 -2
  19. package/focus-leave.controller-2gV0pQd5.js +73 -0
  20. package/index.js +1635 -948
  21. package/index.umd.cjs +2046 -601
  22. package/lib/components/date-picker.element.d.ts +0 -11
  23. package/lib/components/date-time-calendar.element.d.ts +18 -0
  24. package/lib/components/date-time-picker.element.d.ts +18 -0
  25. package/lib/components/date-time.element.d.ts +18 -0
  26. package/lib/components/dropdown.element.d.ts +2 -0
  27. package/lib/components/range-calendar.element.d.ts +2 -1
  28. package/lib/components/range-date-picker.element.d.ts +0 -15
  29. package/lib/components/range-date-time-calendar.element.d.ts +18 -0
  30. package/lib/components/range-date-time-input.element.d.ts +18 -0
  31. package/lib/components/range-date-time-picker.element.d.ts +18 -0
  32. package/lib/components/range-time-input.element.d.ts +18 -0
  33. package/lib/components/range-time-picker.element.d.ts +18 -0
  34. package/lib/components/time-picker.element.d.ts +18 -0
  35. package/lib/components/time.element.d.ts +18 -0
  36. package/list-D730tmGN.js +297 -0
  37. package/{list.element-Co3V3Cn5.js → list.element-eo3DIOrp.js} +23 -23
  38. package/{markdown.element-p-kC47D7.js → markdown.element-FbtwdnAv.js} +310 -218
  39. package/{number.element-CBr47IiY.js → number.element-BEpOCzXy.js} +76 -61
  40. package/package.json +6 -6
  41. package/part-templates-VORbpgs2.js +691 -0
  42. package/{password.element-n-R9RbkB.js → password.element-CBaB8h5b.js} +19 -17
  43. package/pill-ranges-DpvWwP-3.js +48 -0
  44. package/{pills-B66qz_KX.js → pills-BDMO2NiR.js} +84 -59
  45. package/popup.controller-B33OvX_y.js +86 -0
  46. package/{radiogroup.element-CeQn623u.js → radiogroup.element-KWzBx8mx.js} +55 -51
  47. package/range-calendar-DO_woqcF.js +466 -0
  48. package/{calendar.element-DcnTyvfg.js → range-calendar.element-DHLZhpnj.js} +37 -29
  49. package/range-commit-8-MmYUyo.js +14 -0
  50. package/range-date-input-Br7XqQPK.js +311 -0
  51. package/{range-date-input.element-BqzAF0O3.js → range-date-input.element-BdD4SlB4.js} +12 -8
  52. package/range-date-picker.element-DWRHiAoC.js +434 -0
  53. package/range-date-time-calendar-B3EMgN1E.js +734 -0
  54. package/range-date-time-calendar.element-Coea6RF4.js +97 -0
  55. package/range-date-time-input-Cu-T_nuC.js +353 -0
  56. package/range-date-time-input.element-Cti44iuW.js +87 -0
  57. package/range-date-time-picker.element-CDN2RL1y.js +472 -0
  58. package/range-selection-CU3hxLJE.js +25 -0
  59. package/range-time-input-BP9ZL9O8.js +348 -0
  60. package/range-time-input.element-B7wtHJoQ.js +84 -0
  61. package/range-time-picker.element-CPIAiQPC.js +470 -0
  62. package/{repeater.element-CtNgB4F5.js → repeater.element-BM1Keckd.js} +1 -1
  63. package/{select.element-jcDF1h-g.js → select.element-eepcXTpL.js} +117 -107
  64. package/{tabs.element-BvAyI71N.js → tabs.element-CvcIA8P3.js} +1 -0
  65. package/{tags.element-CX3vQL8L.js → tags.element-CPHgotb0.js} +21 -14
  66. package/templates-Dmr34nwp.js +88 -0
  67. package/{textarea.element-HThYqdR_.js → textarea.element-CiNEy9uq.js} +8 -7
  68. package/{textinput.element-CkXNzMUg.js → textinput.element-AL2Nr768.js} +10 -9
  69. package/time-input-5dkSm8UW.js +201 -0
  70. package/time-list-DLcq8BAp.js +217 -0
  71. package/time-picker-g337F8d0.js +299 -0
  72. package/time-picker.element-DLihegjg.js +89 -0
  73. package/time.element-BneqgMlQ.js +85 -0
  74. package/{toggle.element-C1kCw5H8.js → toggle.element-Cz91CRdp.js} +44 -43
  75. package/abstract-calendar-D0-077XJ.js +0 -545
  76. package/calendar-BclCC9VJ.js +0 -96
  77. package/date-input-DCdGWRio.js +0 -268
  78. package/date-picker.element-k7AJFQ5W.js +0 -168
  79. package/list-D1oKnH89.js +0 -283
  80. package/range-calendar-CBINu84w.js +0 -255
  81. package/range-date-input-BYXzqnr1.js +0 -395
  82. package/range-date-picker.element-BCBefgvY.js +0 -182
  83. package/templates-Dk1jxLwS.js +0 -75
@@ -1,20 +1,20 @@
1
- import { InputWidgetAdapter as g, formContext as b, inputContext as y } from "@golemui/lit";
1
+ import { InputWidgetAdapter as m, formContext as b, inputContext as y } from "@golemui/lit";
2
2
  import { LitElement as v, html as n, nothing as u } from "lit";
3
3
  import { repeat as f } from "lit-html/directives/repeat.js";
4
- import { property as s, customElement as m } from "lit/decorators.js";
4
+ import { property as a, customElement as g } from "lit/decorators.js";
5
5
  import { classMap as $ } from "lit/directives/class-map.js";
6
- import { G as C, a as D, b as w, c as E } from "./templates-Dk1jxLwS.js";
7
- import { u as F, i as S } from "./one-of-C0ur6b_n.js";
8
- import { consume as x, provide as O } from "@lit/context";
6
+ import { G as C, a as D, b as w, c as O } from "./templates-Dmr34nwp.js";
7
+ import { u as E, i as S } from "./one-of-C0ur6b_n.js";
8
+ import { consume as F, provide as _ } from "@lit/context";
9
9
  import "rxjs";
10
- var _ = Object.defineProperty, q = Object.getOwnPropertyDescriptor, l = (t, e, r, i) => {
11
- for (var o = i > 1 ? void 0 : i ? q(e, r) : e, d = t.length - 1, p; d >= 0; d--)
12
- (p = t[d]) && (o = (i ? p(e, r, o) : p(o)) || o);
13
- return i && o && _(e, r, o), o;
10
+ var x = Object.defineProperty, q = Object.getOwnPropertyDescriptor, s = (e, i, r, l) => {
11
+ for (var o = l > 1 ? void 0 : l ? q(i, r) : i, d = e.length - 1, p; d >= 0; d--)
12
+ (p = e[d]) && (o = (l ? p(i, r, o) : p(o)) || o);
13
+ return l && o && x(i, r, o), o;
14
14
  };
15
- let a = class extends v {
15
+ let t = class extends v {
16
16
  constructor() {
17
- 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, {
17
+ 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.invalidOptionMessage = void 0, this.labelField = void 0, this.valueField = void 0, this.optionsLoading = !1, this.hasMatchingValue = !1, this.ariaController = new C(this, {
18
18
  getTargets: () => this.querySelectorAll(`select[id="${this.uid}"]`),
19
19
  getState: () => ({
20
20
  uid: this.uid,
@@ -23,7 +23,8 @@ let a = class extends v {
23
23
  errors: this.errors,
24
24
  readonly: this.readOnly,
25
25
  disabled: this.disabled,
26
- touched: this.touched
26
+ touched: this.touched,
27
+ required: this.required
27
28
  }
28
29
  })
29
30
  });
@@ -36,7 +37,7 @@ let a = class extends v {
36
37
  }
37
38
  render() {
38
39
  super.render();
39
- const t = {
40
+ const e = {
40
41
  uid: this.uid,
41
42
  label: this.label,
42
43
  errors: this.errors,
@@ -52,37 +53,36 @@ let a = class extends v {
52
53
  placeholder: this.placeholder,
53
54
  labelField: this.labelField,
54
55
  valueField: this.valueField
55
- }, e = D("select", t);
56
- this.options = F(this.options, {
56
+ }, i = D("select", e);
57
+ this.options = E(this.options, {
57
58
  labelField: this.labelField,
58
59
  valueField: this.valueField
59
- }), this.hasMatchingValue = this.options?.length ? this.options.find(({ value: i }) => i === this.value) !== void 0 : !1;
60
+ }), this.hasMatchingValue = this.options?.length ? this.options.find(({ value: l }) => l === this.value) !== void 0 : !1;
60
61
  const r = this.optionsLoading ? n`<span>Loading...</span>` : n`
61
62
  <option value="" disabled selected=${this.hasMatchingValue ? u : ""}>
62
63
  ${this.placeholder ?? "Select an option"}
63
64
  </option>
64
65
  ${f(
65
66
  this.options || [],
66
- (i) => i?.value,
67
- (i) => n`<option
68
- value=${i.value}
69
- selected=${this.hasMatchingValue && i.value === this.value ? "" : u}
67
+ (l) => l?.value,
68
+ (l) => n`<option
69
+ value=${l.value}
70
+ selected=${this.hasMatchingValue && l.value === this.value ? "" : u}
70
71
  >
71
- ${i.label}
72
+ ${l.label}
72
73
  </option>`
73
74
  )}
74
75
  `;
75
76
  return n`
76
- ${w(this.uid, t)}
77
+ ${w(this.uid, e)}
77
78
 
78
79
  <div class="gui-widget">
79
80
  <select
80
81
  id=${this.uid}
81
- tabindex="0"
82
82
  data-cy=${`${this.uid}_select`}
83
- class=${$({ "gui-widget-input": !0, ...e.widgetClasses })}
84
- ?required=${t.required}
85
- ?disabled=${t.disabled || t.readonly}
83
+ class=${$({ "gui-widget-input": !0, ...i.widgetClasses })}
84
+ ?required=${e.required}
85
+ ?disabled=${e.disabled || e.readonly}
86
86
  autocomplete=${this.autocomplete || u}
87
87
  @change=${this.valueChanged}
88
88
  @blur=${this.onBlur}
@@ -90,33 +90,39 @@ let a = class extends v {
90
90
  ${r}
91
91
  </select>
92
92
  <span class="gui-select__arrow"
93
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
93
+ ><svg
94
+ xmlns="http://www.w3.org/2000/svg"
95
+ width="16"
96
+ height="16"
97
+ viewBox="0 0 256 256"
98
+ aria-hidden="true"
99
+ >
94
100
  <path
95
101
  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"
96
102
  ></path></svg
97
103
  ></span>
98
- ${e.html}
104
+ ${i.html}
99
105
  </div>
100
106
 
101
- ${E(this.uid, t)}
107
+ ${O(this.uid, e)}
102
108
  `;
103
109
  }
104
- updated(t) {
105
- t.has("value") && !this.hasMatchingValue && this.value && this.dispatchEvent(
110
+ updated(e) {
111
+ e.has("value") && !this.hasMatchingValue && this.value && this.dispatchEvent(
106
112
  new CustomEvent("inputError", {
107
113
  detail: {
108
- message: `Invalid selection: '${this.value}' is not a valid option.`
114
+ message: (this.invalidOptionMessage ?? "Invalid selection: '{value}' is not a valid option.").replace("{value}", String(this.value))
109
115
  },
110
116
  bubbles: !0
111
117
  })
112
118
  );
113
119
  }
114
- valueChanged(t) {
115
- if (t.stopPropagation(), !this.readOnly) {
116
- const e = t.target;
120
+ valueChanged(e) {
121
+ if (e.stopPropagation(), !this.readOnly) {
122
+ const i = e.target;
117
123
  this.dispatchEvent(
118
124
  new CustomEvent("change", {
119
- detail: { value: S(e.value, this.options) },
125
+ detail: { value: S(i.value, this.options) },
120
126
  bubbles: !0,
121
127
  composed: !0
122
128
  })
@@ -132,74 +138,77 @@ let a = class extends v {
132
138
  );
133
139
  }
134
140
  };
135
- l([
136
- s({ type: String })
137
- ], a.prototype, "uid", 2);
138
- l([
139
- s({ type: String })
140
- ], a.prototype, "label", 2);
141
- l([
142
- s({ type: String, attribute: "locale-id" })
143
- ], a.prototype, "localeId", 2);
144
- l([
145
- s({ type: Array })
146
- ], a.prototype, "errors", 2);
147
- l([
148
- s({ type: Boolean })
149
- ], a.prototype, "touched", 2);
150
- l([
151
- s({ type: Boolean })
152
- ], a.prototype, "required", 2);
153
- l([
154
- s({ type: Boolean })
155
- ], a.prototype, "disabled", 2);
156
- l([
157
- s({ type: Boolean, attribute: "readonly" })
158
- ], a.prototype, "readOnly", 2);
159
- l([
160
- s({ type: String })
161
- ], a.prototype, "value", 2);
162
- l([
163
- s({ type: String })
164
- ], a.prototype, "hint", 2);
165
- l([
166
- s({ type: String })
167
- ], a.prototype, "icon", 2);
168
- l([
169
- s({ type: String })
170
- ], a.prototype, "autocomplete", 2);
171
- l([
172
- s({ type: Array })
173
- ], a.prototype, "options", 2);
174
- l([
175
- s({ type: String })
176
- ], a.prototype, "placeholder", 2);
177
- l([
178
- s({ type: String })
179
- ], a.prototype, "labelField", 2);
180
- l([
181
- s({ type: String })
182
- ], a.prototype, "valueField", 2);
183
- a = l([
184
- m("gui-select")
185
- ], a);
186
- typeof customElements < "u" && !customElements.get("gui-select") && customElements.define("gui-select", a);
187
- var I = Object.defineProperty, P = Object.getOwnPropertyDescriptor, c = (t, e, r, i) => {
188
- for (var o = i > 1 ? void 0 : i ? P(e, r) : e, d = t.length - 1, p; d >= 0; d--)
189
- (p = t[d]) && (o = (i ? p(e, r, o) : p(o)) || o);
190
- return i && o && I(e, r, o), o;
141
+ s([
142
+ a({ type: String })
143
+ ], t.prototype, "uid", 2);
144
+ s([
145
+ a({ type: String })
146
+ ], t.prototype, "label", 2);
147
+ s([
148
+ a({ type: String, attribute: "locale-id" })
149
+ ], t.prototype, "localeId", 2);
150
+ s([
151
+ a({ type: Array })
152
+ ], t.prototype, "errors", 2);
153
+ s([
154
+ a({ type: Boolean })
155
+ ], t.prototype, "touched", 2);
156
+ s([
157
+ a({ type: Boolean })
158
+ ], t.prototype, "required", 2);
159
+ s([
160
+ a({ type: Boolean })
161
+ ], t.prototype, "disabled", 2);
162
+ s([
163
+ a({ type: Boolean, attribute: "readonly" })
164
+ ], t.prototype, "readOnly", 2);
165
+ s([
166
+ a({ type: String })
167
+ ], t.prototype, "value", 2);
168
+ s([
169
+ a({ type: String })
170
+ ], t.prototype, "hint", 2);
171
+ s([
172
+ a({ type: String })
173
+ ], t.prototype, "icon", 2);
174
+ s([
175
+ a({ type: String })
176
+ ], t.prototype, "autocomplete", 2);
177
+ s([
178
+ a({ type: Array })
179
+ ], t.prototype, "options", 2);
180
+ s([
181
+ a({ type: String })
182
+ ], t.prototype, "placeholder", 2);
183
+ s([
184
+ a({ type: String, attribute: "invalid-option-message" })
185
+ ], t.prototype, "invalidOptionMessage", 2);
186
+ s([
187
+ a({ type: String })
188
+ ], t.prototype, "labelField", 2);
189
+ s([
190
+ a({ type: String })
191
+ ], t.prototype, "valueField", 2);
192
+ t = s([
193
+ g("gui-select")
194
+ ], t);
195
+ typeof customElements < "u" && !customElements.get("gui-select") && customElements.define("gui-select", t);
196
+ var M = Object.defineProperty, I = Object.getOwnPropertyDescriptor, c = (e, i, r, l) => {
197
+ for (var o = l > 1 ? void 0 : l ? I(i, r) : i, d = e.length - 1, p; d >= 0; d--)
198
+ (p = e[d]) && (o = (l ? p(i, r, o) : p(o)) || o);
199
+ return l && o && M(i, r, o), o;
191
200
  };
192
201
  let h = class extends v {
193
202
  constructor() {
194
- super(...arguments), this.adapter = new g(), this.subscriptions = [];
203
+ super(...arguments), this.adapter = new m(), this.subscriptions = [];
195
204
  }
196
205
  createRenderRoot() {
197
206
  return this;
198
207
  }
199
- updated(t) {
200
- super.updated(t);
201
- const e = this.adapter.templateData.size;
202
- e ? this.style.flex = String(e) : this.style.removeProperty("flex");
208
+ updated(e) {
209
+ super.updated(e);
210
+ const i = this.adapter.templateData.size;
211
+ i ? this.style.flex = String(i) : this.style.removeProperty("flex");
203
212
  }
204
213
  connectedCallback() {
205
214
  super.connectedCallback(), this.classList.add("gui-select", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
@@ -224,32 +233,33 @@ let h = class extends v {
224
233
  .options=${this.adapter.templateData.options}
225
234
  .labelField=${this.adapter.templateData.labelField}
226
235
  .valueField=${this.adapter.templateData.valueField}
236
+ .invalidOptionMessage=${this.adapter.templateData.invalidOptionMessage}
227
237
  @change=${this.valueChanged}
228
238
  @inputError=${this.onInputError}
229
239
  @blur=${() => this.adapter.onBlur()}
230
240
  ></gui-select>
231
241
  `;
232
242
  }
233
- valueChanged(t) {
234
- const e = t.detail.value;
235
- this.adapter.valueChanged(e);
243
+ valueChanged(e) {
244
+ const i = e.detail.value;
245
+ this.adapter.valueChanged(i);
236
246
  }
237
- onInputError(t) {
238
- this.adapter.injectValidationIssues([t.detail.message]);
247
+ onInputError(e) {
248
+ this.adapter.injectValidationIssues([e.detail.message]);
239
249
  }
240
250
  disconnectedCallback() {
241
- super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
251
+ super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
242
252
  }
243
253
  };
244
254
  c([
245
- x({ context: b }),
246
- s({ attribute: !1 })
255
+ F({ context: b }),
256
+ a({ attribute: !1 })
247
257
  ], h.prototype, "formContext", 2);
248
258
  c([
249
- O({ context: y })
259
+ _({ context: y })
250
260
  ], h.prototype, "adapter", 2);
251
261
  h = c([
252
- m("gui-select-input")
262
+ g("gui-select-input")
253
263
  ], h);
254
264
  export {
255
265
  h as SelectElement
@@ -89,6 +89,7 @@ let n = class extends y {
89
89
  (e) => e?.uid,
90
90
  (e, t) => d`<section
91
91
  role="tabpanel"
92
+ tabindex="0"
92
93
  data-cy=${`tabpanel_${this.widget.uid}_${t}`}
93
94
  id=${`tabpanel_${this.widget.uid}_${t}`}
94
95
  ?hidden=${e.uid !== this.activeTab && this.adapter.templateData.renderMode !== "activeOnly"}
@@ -1,16 +1,16 @@
1
1
  import { InputWidgetAdapter as D, formContext as w, inputContext as C } from "@golemui/lit";
2
2
  import { LitElement as y, nothing as c, html as m } from "lit";
3
- import { property as o, customElement as v } from "lit/decorators.js";
3
+ import { property as o, customElement as b } from "lit/decorators.js";
4
4
  import { classMap as f } from "lit/directives/class-map.js";
5
- import { G as A, b as P, c as S } from "./templates-Dk1jxLwS.js";
6
- import "./pills-B66qz_KX.js";
5
+ import { G as A, b as P, c as S } from "./templates-Dmr34nwp.js";
6
+ import "./pills-BDMO2NiR.js";
7
7
  import { styleMap as _ } from "lit-html/directives/style-map.js";
8
- import { consume as E, provide as O } from "@lit/context";
8
+ import { consume as E, provide as L } from "@lit/context";
9
9
  import "rxjs";
10
- var I = Object.defineProperty, L = Object.getOwnPropertyDescriptor, n = (t, e, r, a) => {
11
- for (var i = a > 1 ? void 0 : a ? L(e, r) : e, s = t.length - 1, p; s >= 0; s--)
10
+ var O = Object.defineProperty, I = Object.getOwnPropertyDescriptor, n = (t, e, r, a) => {
11
+ for (var i = a > 1 ? void 0 : a ? I(e, r) : e, s = t.length - 1, p; s >= 0; s--)
12
12
  (p = t[s]) && (i = (a ? p(e, r, i) : p(i)) || i);
13
- return a && i && I(e, r, i), i;
13
+ return a && i && O(e, r, i), i;
14
14
  };
15
15
  const x = ["Enter", ",", "Tab", "blur"];
16
16
  let l = class extends y {
@@ -24,7 +24,8 @@ let l = class extends y {
24
24
  errors: this.errors,
25
25
  readonly: this.readOnly,
26
26
  disabled: this.disabled,
27
- touched: this.touched
27
+ touched: this.touched,
28
+ required: this.required
28
29
  }
29
30
  })
30
31
  }), this.onPillRemove = (t) => {
@@ -87,11 +88,17 @@ let l = class extends y {
87
88
  role="group"
88
89
  aria-label=${this.label ?? "Tags input"}
89
90
  >
90
- ${this.icon ? m`<span class=${f(r)} data-icon=${this.icon}></span>` : c}
91
+ ${this.icon ? m`<span
92
+ class=${f(r)}
93
+ data-icon=${this.icon}
94
+ aria-hidden="true"
95
+ ></span>` : c}
91
96
 
92
97
  <gui-pills
93
98
  class="gui-tags__pills"
94
99
  style=${_(a.length ? {} : { "min-width": 0 })}
100
+ .uid=${this.uid}
101
+ .toolbarAriaLabel=${"Selected tags"}
95
102
  .items=${a}
96
103
  .removable=${!0}
97
104
  .clickable=${!1}
@@ -179,8 +186,8 @@ let l = class extends y {
179
186
  );
180
187
  if (!i.test(e)) return;
181
188
  t.preventDefault();
182
- const s = t.target instanceof HTMLInputElement ? t.target : null, d = ((s?.value ?? "") + e).split(i), b = d.slice(0, -1), $ = d[d.length - 1] ?? "";
183
- this.commitDraftBatch(b) && s && (s.value = $);
189
+ const s = t.target instanceof HTMLInputElement ? t.target : null, d = ((s?.value ?? "") + e).split(i), v = d.slice(0, -1), $ = d[d.length - 1] ?? "";
190
+ this.commitDraftBatch(v) && s && (s.value = $);
184
191
  }
185
192
  commitDraft(t) {
186
193
  const e = this.trim ? t.trim() : t;
@@ -289,7 +296,7 @@ n([
289
296
  o({ type: String, attribute: "remove-icon" })
290
297
  ], l.prototype, "removeIcon", 2);
291
298
  l = n([
292
- v("gui-tags")
299
+ b("gui-tags")
293
300
  ], l);
294
301
  typeof customElements < "u" && !customElements.get("gui-tags") && customElements.define("gui-tags", l);
295
302
  var q = Object.defineProperty, R = Object.getOwnPropertyDescriptor, g = (t, e, r, a) => {
@@ -352,10 +359,10 @@ g([
352
359
  o({ attribute: !1 })
353
360
  ], h.prototype, "formContext", 2);
354
361
  g([
355
- O({ context: C })
362
+ L({ context: C })
356
363
  ], h.prototype, "adapter", 2);
357
364
  h = g([
358
- v("gui-tags-input")
365
+ b("gui-tags-input")
359
366
  ], h);
360
367
  export {
361
368
  h as TagsElement
@@ -0,0 +1,88 @@
1
+ import { filterTap as C } from "@golemui/core";
2
+ import { html as i, nothing as o } from "lit";
3
+ import { classMap as f } from "lit/directives/class-map.js";
4
+ class E {
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: n } = this.getState(), { touched: _, errors: c, readonly: v, disabled: A, hint: y, required: q } = n, d = _ && c && c.length > 0;
16
+ C(
17
+ e,
18
+ (t) => !!t,
19
+ (t) => {
20
+ const a = ($, u) => {
21
+ u ? t.setAttribute($, u) : t.removeAttribute($);
22
+ };
23
+ a("aria-describedby", y ? `${l}_hint` : null), a("aria-invalid", d ? "true" : null), a("aria-errormessage", d ? `${l}_errors` : null), a("aria-readonly", v ? "true" : null), a("aria-disabled", A ? "true" : null), a("aria-required", q ? "true" : null);
24
+ }
25
+ );
26
+ }
27
+ }
28
+ const g = (s) => s ? i`<span aria-hidden="true"> *</span>` : o, G = (s, r, e = !1, l = void 0, n = !0) => n ? r.label ? i`<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}${g(r.required)}
35
+ ${h(s, r)} ${e ? b(s, r) : o}
36
+ </label>` : o : r.label ? i`<span
37
+ class="gui-label"
38
+ data-cy=${`${s}_label`}
39
+ id=${l ? `${s}_${l}_label` : `${s}_label`}
40
+ >
41
+ ${r.label}${g(r.required)}
42
+ ${h(s, r)} ${e ? b(s, r) : o}
43
+ </span>` : o, h = (s, r) => r.hint ? i`<div class="gui-widget-hint" id=${`${s}_hint`}>${r.hint}</div>` : i``, I = (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: i`<span
57
+ class=${f(l)}
58
+ data-icon=${r.icon}
59
+ aria-hidden="true"
60
+ ></span>`
61
+ };
62
+ } else
63
+ return { widgetClasses: e, html: i`` };
64
+ }, b = (s, r) => {
65
+ const e = r.touched && r.errors && r.errors.length > 0;
66
+ return i`<ul
67
+ class=${f({
68
+ "gui-validator": !0,
69
+ "gui-validator--empty": !e
70
+ })}
71
+ id=${`${s}_errors`}
72
+ role="alert"
73
+ data-cy=${e ? `${s}_validator-errors` : o}
74
+ >
75
+ ${e ? r.errors?.map(
76
+ (n) => i`<li class="gui-validator__error" data-cy=${`${s}_validator-error`}>
77
+ ${n}
78
+ </li>`
79
+ ) : o}
80
+ </ul>`;
81
+ };
82
+ export {
83
+ E as G,
84
+ I as a,
85
+ G as b,
86
+ b as c,
87
+ g as r
88
+ };
@@ -2,12 +2,12 @@ import { InputWidgetAdapter as v, formContext as b, inputContext as $ } from "@g
2
2
  import { LitElement as m, html as n, nothing as c } from "lit";
3
3
  import { property as i, customElement as g } from "lit/decorators.js";
4
4
  import { classMap as x } from "lit/directives/class-map.js";
5
- import { G as f, b as C, c as w } from "./templates-Dk1jxLwS.js";
5
+ import { G as f, b as C, c as w } from "./templates-Dmr34nwp.js";
6
6
  import { styleMap as D } from "lit-html/directives/style-map.js";
7
7
  import { consume as _, provide as L } from "@lit/context";
8
8
  import "rxjs";
9
- var S = Object.defineProperty, O = Object.getOwnPropertyDescriptor, o = (t, a, d, s) => {
10
- for (var e = s > 1 ? void 0 : s ? O(a, d) : a, l = t.length - 1, p; l >= 0; l--)
9
+ var S = Object.defineProperty, q = Object.getOwnPropertyDescriptor, o = (t, a, d, s) => {
10
+ for (var e = s > 1 ? void 0 : s ? q(a, d) : a, l = t.length - 1, p; l >= 0; l--)
11
11
  (p = t[l]) && (e = (s ? p(a, d, e) : p(e)) || e);
12
12
  return s && e && S(a, d, e), e;
13
13
  };
@@ -22,7 +22,8 @@ let r = class extends m {
22
22
  errors: this.errors,
23
23
  readonly: this.readOnly,
24
24
  disabled: this.disabled,
25
- touched: this.touched
25
+ touched: this.touched,
26
+ required: this.required
26
27
  }
27
28
  })
28
29
  });
@@ -170,10 +171,10 @@ r = o([
170
171
  g("gui-textarea")
171
172
  ], r);
172
173
  typeof customElements < "u" && !customElements.get("gui-textarea") && customElements.define("gui-textarea", r);
173
- var E = Object.defineProperty, q = Object.getOwnPropertyDescriptor, h = (t, a, d, s) => {
174
- for (var e = s > 1 ? void 0 : s ? q(a, d) : a, l = t.length - 1, p; l >= 0; l--)
174
+ var O = Object.defineProperty, E = Object.getOwnPropertyDescriptor, h = (t, a, d, s) => {
175
+ for (var e = s > 1 ? void 0 : s ? E(a, d) : a, l = t.length - 1, p; l >= 0; l--)
175
176
  (p = t[l]) && (e = (s ? p(a, d, e) : p(e)) || e);
176
- return s && e && E(a, d, e), e;
177
+ return s && e && O(a, d, e), e;
177
178
  };
178
179
  let u = class extends m {
179
180
  constructor() {
@@ -2,13 +2,13 @@ import { InputWidgetAdapter as b, formContext as v, inputContext as g } from "@g
2
2
  import { LitElement as c, nothing as h, html as m } from "lit";
3
3
  import { property as r, customElement as y } from "lit/decorators.js";
4
4
  import { classMap as f } from "lit/directives/class-map.js";
5
- import { G as $, a as x, b as C, c as D } from "./templates-Dk1jxLwS.js";
5
+ import { G as $, a as x, b as C, c as D } from "./templates-Dmr34nwp.js";
6
6
  import { consume as O, provide as _ } from "@lit/context";
7
7
  import "rxjs";
8
- var w = Object.defineProperty, E = Object.getOwnPropertyDescriptor, s = (t, e, o, l) => {
9
- for (var a = l > 1 ? void 0 : l ? E(e, o) : e, p = t.length - 1, d; p >= 0; p--)
8
+ var q = Object.defineProperty, w = Object.getOwnPropertyDescriptor, s = (t, e, o, l) => {
9
+ for (var a = l > 1 ? void 0 : l ? w(e, o) : e, p = t.length - 1, d; p >= 0; p--)
10
10
  (d = t[p]) && (a = (l ? d(e, o, a) : d(a)) || a);
11
- return l && a && w(e, o, a), a;
11
+ return l && a && q(e, o, a), a;
12
12
  };
13
13
  let i = class extends c {
14
14
  constructor() {
@@ -21,7 +21,8 @@ let i = class extends c {
21
21
  errors: this.errors,
22
22
  readonly: this.readOnly,
23
23
  disabled: this.disabled,
24
- touched: this.touched
24
+ touched: this.touched,
25
+ required: this.required
25
26
  }
26
27
  })
27
28
  });
@@ -61,7 +62,7 @@ let i = class extends c {
61
62
  data-cy=${`${this.uid}_textinput`}
62
63
  class=${f(o)}
63
64
  value=${this.value}
64
- ?required=${this.disabled}
65
+ ?required=${this.required}
65
66
  ?disabled=${this.disabled}
66
67
  ?readonly=${this.readOnly}
67
68
  placeholder=${this.placeholder || h}
@@ -139,10 +140,10 @@ i = s([
139
140
  y("gui-textinput")
140
141
  ], i);
141
142
  typeof customElements < "u" && !customElements.get("gui-textinput") && customElements.define("gui-textinput", i);
142
- var S = Object.defineProperty, P = Object.getOwnPropertyDescriptor, u = (t, e, o, l) => {
143
- for (var a = l > 1 ? void 0 : l ? P(e, o) : e, p = t.length - 1, d; p >= 0; p--)
143
+ var E = Object.defineProperty, S = Object.getOwnPropertyDescriptor, u = (t, e, o, l) => {
144
+ for (var a = l > 1 ? void 0 : l ? S(e, o) : e, p = t.length - 1, d; p >= 0; p--)
144
145
  (d = t[p]) && (a = (l ? d(e, o, a) : d(a)) || a);
145
- return l && a && S(e, o, a), a;
146
+ return l && a && E(e, o, a), a;
146
147
  };
147
148
  let n = class extends c {
148
149
  constructor() {