@golemui/gui-lit 1.6.0-rc.1 → 2.0.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/accordion.element-CE1gDRCy.js +84 -0
  3. package/alert.element-Bqcad7bR.js +43 -0
  4. package/{button.element-CKYv0Glr.js → button.element-CjeUWaly.js} +23 -24
  5. package/{calendar.element-DkHZFBNr.js → calendar.element-DXI9bfFN.js} +17 -22
  6. package/{checkbox.element-MukoziRw.js → checkbox.element-D8hXKLjW.js} +18 -22
  7. package/{currency.element-DNumeSKA.js → currency.element-D8t_MtIs.js} +22 -26
  8. package/{date-picker.element-DpQmremq.js → date-picker.element-X__hfSnj.js} +16 -21
  9. package/{date-time-calendar.element-GAr8VMGa.js → date-time-calendar.element-Dmyd7LQ0.js} +17 -21
  10. package/{date-time-picker.element-Bt0GYSpS.js → date-time-picker.element-QGn5dEbf.js} +23 -27
  11. package/{date-time.element-WfLnY_Cb.js → date-time.element-B0OuRjlf.js} +20 -25
  12. package/{date.element-ChpTi2AQ.js → date.element-Ba8wmaNU.js} +13 -18
  13. package/{dropdown.element-Ckh9JvEK.js → dropdown.element-Djee1u1L.js} +15 -29
  14. package/{file-upload.element-l_l_ubxJ.js → file-upload.element-B3oBEQ_s.js} +18 -23
  15. package/grid.element-CwDdlQ4b.js +54 -0
  16. package/index.js +42 -42
  17. package/index.umd.cjs +289 -352
  18. package/lib/components/accordion.element.d.ts +2 -2
  19. package/lib/components/alert.element.d.ts +0 -1
  20. package/lib/components/calendar.element.d.ts +0 -1
  21. package/lib/components/checkbox.element.d.ts +0 -1
  22. package/lib/components/currency.element.d.ts +0 -1
  23. package/lib/components/date-picker.element.d.ts +0 -1
  24. package/lib/components/date-time-calendar.element.d.ts +0 -1
  25. package/lib/components/date-time-picker.element.d.ts +0 -1
  26. package/lib/components/date-time.element.d.ts +0 -1
  27. package/lib/components/date.element.d.ts +0 -1
  28. package/lib/components/dropdown.element.d.ts +0 -1
  29. package/lib/components/file-upload.element.d.ts +0 -1
  30. package/lib/components/grid.element.d.ts +3 -3
  31. package/lib/components/list.element.d.ts +0 -1
  32. package/lib/components/markdown-text.element.d.ts +0 -1
  33. package/lib/components/markdown.element.d.ts +0 -1
  34. package/lib/components/multi-dropdown.element.d.ts +0 -1
  35. package/lib/components/multi-file-upload.element.d.ts +0 -1
  36. package/lib/components/multi-list.element.d.ts +0 -1
  37. package/lib/components/number.element.d.ts +0 -1
  38. package/lib/components/password.element.d.ts +0 -1
  39. package/lib/components/radiogroup.element.d.ts +0 -1
  40. package/lib/components/range-calendar.element.d.ts +0 -1
  41. package/lib/components/range-date-input.element.d.ts +0 -1
  42. package/lib/components/range-date-picker.element.d.ts +0 -1
  43. package/lib/components/range-date-time-calendar.element.d.ts +0 -1
  44. package/lib/components/range-date-time-input.element.d.ts +0 -1
  45. package/lib/components/range-date-time-picker.element.d.ts +0 -1
  46. package/lib/components/range-time-input.element.d.ts +0 -1
  47. package/lib/components/range-time-picker.element.d.ts +0 -1
  48. package/lib/components/renderer.element.d.ts +0 -1
  49. package/lib/components/repeater.element.d.ts +0 -1
  50. package/lib/components/select.element.d.ts +0 -1
  51. package/lib/components/tabs.element.d.ts +4 -15
  52. package/lib/components/tags.element.d.ts +0 -1
  53. package/lib/components/textarea.element.d.ts +0 -1
  54. package/lib/components/textinput.element.d.ts +0 -1
  55. package/lib/components/time-picker.element.d.ts +0 -1
  56. package/lib/components/time.element.d.ts +0 -1
  57. package/lib/components/toggle.element.d.ts +0 -1
  58. package/{list.element-UIKmXzeH.js → list.element-DfLD2X8s.js} +37 -38
  59. package/{markdown-text.element-DflCQwAo.js → markdown-text.element-Jos6zKYy.js} +17 -22
  60. package/{markdown.element-DUHHoi2Y.js → markdown.element-7tvZ028P.js} +11 -15
  61. package/{multi-dropdown.element-mX06nBBb.js → multi-dropdown.element-B1vV4rF-.js} +51 -65
  62. package/{multi-file-upload.element-DzAZAfc1.js → multi-file-upload.element-4h6JQgRF.js} +16 -21
  63. package/{multi-list.element-Bs-UN2Cy.js → multi-list.element-CNVHVkj0.js} +44 -45
  64. package/{number.element-mQSFQsYC.js → number.element-WRHwQGZz.js} +19 -23
  65. package/package.json +6 -6
  66. package/{password.element-xw5gugEg.js → password.element-DnV_PqKI.js} +17 -21
  67. package/{radiogroup.element-TqfrxVyI.js → radiogroup.element-Cqn_48Ao.js} +20 -24
  68. package/{range-calendar.element-BJr97SVA.js → range-calendar.element-V_56ZeT9.js} +13 -18
  69. package/{range-date-input.element-DDRYvP9h.js → range-date-input.element-D3ZG8OW-.js} +15 -20
  70. package/{range-date-picker.element-rdEr0_wu.js → range-date-picker.element-CaNHjueS.js} +21 -26
  71. package/{range-date-time-calendar.element-UlL1BBRJ.js → range-date-time-calendar.element-DyiiUB5Q.js} +19 -24
  72. package/{range-date-time-input.element-Cq4IdW7N.js → range-date-time-input.element-CVCPS7FC.js} +20 -25
  73. package/{range-date-time-picker.element-CnJcIN9C.js → range-date-time-picker.element-6nBQ_NZs.js} +16 -21
  74. package/{range-time-input.element-Cq0TrGe9.js → range-time-input.element-GXw45kMr.js} +12 -17
  75. package/{range-time-picker.element-BzlIuZ6m.js → range-time-picker.element-CG4PJg3u.js} +24 -29
  76. package/{renderer.element-BVwerbtL.js → renderer.element-FWOUTePl.js} +16 -21
  77. package/{repeater.element-DQNI4b7I.js → repeater.element-V508AKTJ.js} +8 -13
  78. package/{select.element-RBtbAvLx.js → select.element-BPrqKmDM.js} +17 -20
  79. package/tabs.element-CeZOk5Bj.js +88 -0
  80. package/{tags.element-CGvxhMmX.js → tags.element-CVCUsKZ0.js} +12 -17
  81. package/{textarea.element-E2ntRBtE.js → textarea.element-DrWG3xvs.js} +23 -27
  82. package/{textinput.element-0q5F5ol3.js → textinput.element-CCgsbYTB.js} +25 -29
  83. package/{time-picker.element-BiLaLr_c.js → time-picker.element-Q_OWcBVy.js} +21 -26
  84. package/{time.element-92goKRwJ.js → time.element-B0L2sriD.js} +20 -25
  85. package/{toggle.element-zDUc9Vja.js → toggle.element-BTjo7IVK.js} +18 -22
  86. package/accordion.element-BEenQrCh.js +0 -102
  87. package/alert.element-Dzv49O-1.js +0 -55
  88. package/flex.element-BW0_kx8z.js +0 -79
  89. package/grid.element-C019lV76.js +0 -78
  90. package/lib/components/flex.element.d.ts +0 -16
  91. package/tabs.element-BiVaQlvt.js +0 -171
@@ -1,34 +1,29 @@
1
- import { LitElement as p, html as n } from "lit";
2
- import { property as l } from "lit/decorators.js";
3
- import { unsubscribeAll as m, safeDefine as c } from "@golemui/lit/internals";
1
+ import { LitElement as n, html as p } from "lit";
2
+ import { property as m } from "lit/decorators.js";
3
+ import { unsubscribeAll as c, safeDefine as l } from "@golemui/lit/internals";
4
4
  import { consume as u, provide as h } from "@lit/context";
5
- import { DisplayWidgetAdapter as f, formContext as x, displayWidgetContext as g } from "@golemui/lit";
5
+ import { DisplayWidgetAdapter as f, formContext as x, displayWidgetContext as b } from "@golemui/lit";
6
6
  import "@golemui/gui-components/markdown-text";
7
7
  import "rxjs";
8
- var b = Object.defineProperty, o = (r, i, e, y) => {
9
- for (var t = void 0, s = r.length - 1, d; s >= 0; s--)
10
- (d = r[s]) && (t = d(i, e, t) || t);
11
- return t && b(i, e, t), t;
8
+ var g = Object.defineProperty, o = (e, s, a, C) => {
9
+ for (var t = void 0, r = e.length - 1, d; r >= 0; r--)
10
+ (d = e[r]) && (t = d(s, a, t) || t);
11
+ return t && g(s, a, t), t;
12
12
  };
13
- class a extends p {
13
+ class i extends n {
14
14
  constructor() {
15
15
  super(...arguments), this.adapter = new f(), this.subscriptions = [];
16
16
  }
17
17
  createRenderRoot() {
18
18
  return this;
19
19
  }
20
- updated(i) {
21
- super.updated(i);
22
- const e = this.adapter.templateData.size;
23
- e ? this.style.flex = String(e) : this.style.removeProperty("flex");
24
- }
25
20
  connectedCallback() {
26
21
  super.connectedCallback(), this.classList.add("gui-markdown-text", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
27
22
  this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
28
23
  );
29
24
  }
30
25
  render() {
31
- return n`
26
+ return p`
32
27
  <div class="gui-widget" id=${this.widget.uid}>
33
28
  <gui-markdown-text
34
29
  .md=${this.adapter.templateData.md}
@@ -38,17 +33,17 @@ class a extends p {
38
33
  `;
39
34
  }
40
35
  disconnectedCallback() {
41
- super.disconnectedCallback(), this.adapter.destroy(), m(this.subscriptions);
36
+ super.disconnectedCallback(), this.adapter.destroy(), c(this.subscriptions);
42
37
  }
43
38
  }
44
39
  o([
45
40
  u({ context: x }),
46
- l({ attribute: !1 })
47
- ], a.prototype, "formContext");
41
+ m({ attribute: !1 })
42
+ ], i.prototype, "formContext");
48
43
  o([
49
- h({ context: g })
50
- ], a.prototype, "adapter");
51
- c("gui-markdown-text-display", a);
44
+ h({ context: b })
45
+ ], i.prototype, "adapter");
46
+ l("gui-markdown-text-display", i);
52
47
  export {
53
- a as MarkdownTextElement
48
+ i as MarkdownTextElement
54
49
  };
@@ -5,10 +5,11 @@ import { LitElement as u, html as c } from "lit";
5
5
  import { property as $ } from "lit/decorators.js";
6
6
  import { unsubscribeAll as D, safeDefine as b } from "@golemui/lit/internals";
7
7
  import "rxjs";
8
- var f = Object.defineProperty, d = (i, e, t, g) => {
9
- for (var a = void 0, r = i.length - 1, p; r >= 0; r--)
10
- (p = i[r]) && (a = p(e, t, a) || a);
11
- return a && f(e, t, a), a;
8
+ import { live as g } from "lit/directives/live.js";
9
+ var f = Object.defineProperty, d = (i, e, a, v) => {
10
+ for (var t = void 0, r = i.length - 1, p; r >= 0; r--)
11
+ (p = i[r]) && (t = p(e, a, t) || t);
12
+ return t && f(e, a, t), t;
12
13
  };
13
14
  class l extends u {
14
15
  constructor() {
@@ -17,11 +18,6 @@ class l extends u {
17
18
  createRenderRoot() {
18
19
  return this;
19
20
  }
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
- }
25
21
  connectedCallback() {
26
22
  super.connectedCallback(), this.classList.add("gui-markdown", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
27
23
  this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
@@ -33,11 +29,11 @@ class l extends u {
33
29
  .uid=${this.widget.uid}
34
30
  .label=${this.adapter.templateData.label}
35
31
  .errors=${this.adapter.templateData.errors}
36
- ?touched=${this.adapter.templateData.touched}
32
+ .touched=${this.adapter.templateData.touched}
37
33
  ?required=${this.adapter.templateData.validator?.required}
38
34
  ?disabled=${this.adapter.templateData.disabled}
39
35
  ?readonly=${this.adapter.templateData.readonly}
40
- .value=${this.adapter.templateData.value}
36
+ .value=${g(this.adapter.templateData.value)}
41
37
  .hint=${this.adapter.templateData.hint}
42
38
  .placeholder=${this.adapter.templateData.placeholder}
43
39
  .autocomplete=${this.adapter.templateData.autocomplete}
@@ -58,14 +54,14 @@ class l extends u {
58
54
  .defaultOpenPreview=${this.adapter.templateData.defaultOpenPreview}
59
55
  .maxLength=${this.adapter.templateData.validator?.maxLength}
60
56
  .dependencies=${this.adapter.templateData.deps}
61
- @input=${this.valueChanged}
62
- @blur=${() => this.adapter.onBlur()}
57
+ @gui-input=${this.valueChanged}
58
+ @gui-blur=${() => this.adapter.onBlur()}
63
59
  ></gui-markdown>
64
60
  `;
65
61
  }
66
62
  valueChanged(e) {
67
- const t = e.detail.value;
68
- this.adapter.valueChanged(t);
63
+ const a = e.detail.value;
64
+ this.adapter.valueChanged(a);
69
65
  }
70
66
  disconnectedCallback() {
71
67
  super.disconnectedCallback(), this.adapter.destroy(), D(this.subscriptions);
@@ -1,23 +1,24 @@
1
- import { InputWidgetAdapter as I, formContext as v, inputContext as D } from "@golemui/lit";
1
+ import { InputWidgetAdapter as y, formContext as v, inputContext as D } from "@golemui/lit";
2
2
  import { updateListItems as F } from "@golemui/gui-components/internals";
3
- import { consume as x, provide as L } from "@lit/context";
4
- import { LitElement as R, nothing as w, html as m } from "lit";
5
- import { property as C, state as h, query as b } from "lit/decorators.js";
3
+ import { consume as L, provide as R } from "@lit/context";
4
+ import { LitElement as x, nothing as I, html as m } from "lit";
5
+ import { property as C, state as c, query as b } from "lit/decorators.js";
6
6
  import { unsubscribeAll as k, cspStyleMap as V, safeDefine as P } from "@golemui/lit/internals";
7
- import { Subject as S, debounceTime as T } from "rxjs";
7
+ import { Subject as T, debounceTime as S } from "rxjs";
8
8
  import { d as A } from "./default-multi-list-item-renderer-Cv-guvEX.js";
9
9
  import "@golemui/gui-components/label";
10
10
  import "@golemui/gui-components/multi-list";
11
11
  import "@golemui/gui-components/multi-select-trigger";
12
12
  import "@golemui/gui-components/errors";
13
- var j = Object.defineProperty, n = (f, e, t, r) => {
14
- for (var i = void 0, l = f.length - 1, a; l >= 0; l--)
15
- (a = f[l]) && (i = a(e, t, i) || i);
16
- return i && j(e, t, i), i;
13
+ import { live as j } from "lit/directives/live.js";
14
+ var q = Object.defineProperty, n = (f, e, t, r) => {
15
+ for (var i = void 0, l = f.length - 1, o; l >= 0; l--)
16
+ (o = f[l]) && (i = o(e, t, i) || i);
17
+ return i && q(e, t, i), i;
17
18
  };
18
- class o extends R {
19
+ class a extends x {
19
20
  constructor() {
20
- super(...arguments), this.adapter = new I(), 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._ignoreNextFocus = !1, this.onDocumentClick = (e) => {
21
+ super(...arguments), this.adapter = new y(), this.debouncer = new T(), this.subscriptions = [], this._range = { start: 0, end: 10 }, this._filteredItems = [], this._listItems = [], this._focusedIndex = -1, this._isFiltering = !1, this._isListVisible = !1, this._ignoreNextFocus = !1, this.onDocumentClick = (e) => {
21
22
  if (!this._isListVisible) return;
22
23
  const t = e.composedPath(), r = this._triggerRef && t.includes(this._triggerRef), i = this._panelRef && t.includes(this._panelRef);
23
24
  !r && !i && (this._isListVisible = !1);
@@ -32,18 +33,13 @@ class o extends R {
32
33
  createRenderRoot() {
33
34
  return this;
34
35
  }
35
- updated(e) {
36
- super.updated(e);
37
- const t = this.adapter.templateData.size;
38
- t ? this.style.flex = String(t) : this.style.removeProperty("flex");
39
- }
40
36
  connectedCallback() {
41
37
  super.connectedCallback(), typeof document < "u" && document.addEventListener("click", this.onDocumentClick), this.classList.add("gui-multi-dropdown", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this._filteredItems = this.adapter.templateData.items, this.subscriptions.push(
42
38
  this.adapter.templateDataChanged$.subscribe(() => {
43
39
  const e = this.adapter.templateData;
44
40
  e.items && this._listItems?.length === 0 && this._filteredItems?.length === 0 && (this._filteredItems = e.items, this._listItems = e.items), this.requestUpdate();
45
41
  }),
46
- this.debouncer.pipe(T(this.adapter.templateData.inputDebounce ?? 500)).subscribe((e) => {
42
+ this.debouncer.pipe(S(this.adapter.templateData.inputDebounce ?? 500)).subscribe((e) => {
47
43
  this._filterItems(e);
48
44
  })
49
45
  );
@@ -61,7 +57,7 @@ class o extends R {
61
57
  t
62
58
  );
63
59
  return e.map((l) => {
64
- const a = i.find((u) => u.value === l) ?? this._listItems.find((u) => u.value === l), c = a != null && a.template !== null && typeof a.template == "object", s = a == null ? String(l) : String(c ? a.template[r] : a.template);
60
+ const o = i.find((u) => u.value === l) ?? this._listItems.find((u) => u.value === l), h = o != null && o.template !== null && typeof o.template == "object", s = o == null ? String(l) : String(h ? o.template[r] : o.template);
65
61
  return { key: String(l), label: s };
66
62
  });
67
63
  }
@@ -113,13 +109,13 @@ class o extends R {
113
109
  this._isFiltering = !0, this._isListVisible = !0;
114
110
  const i = t.searchFields ?? [t.labelField, t.valueField].filter(
115
111
  (s) => !!s
116
- ), l = i.length > 0, c = (t.items || []).filter((s) => {
112
+ ), l = i.length > 0, h = (t.items || []).filter((s) => {
117
113
  if (s === null || typeof s != "object")
118
114
  return s != null && s.toString().toLowerCase().includes(e.toLowerCase());
119
115
  const d = Object.keys(s), p = (g, _) => g || s[_].toString().toLowerCase().includes(e.toLowerCase());
120
116
  return l ? d.filter((g) => i.includes(g)).reduce(p, !1) : d.reduce(p, !1);
121
117
  });
122
- this._filteredItems = [...c];
118
+ this._filteredItems = [...h];
123
119
  } else
124
120
  this._isFiltering = !1, this._filteredItems = [...t.items];
125
121
  }
@@ -142,10 +138,10 @@ class o extends R {
142
138
  t && this.contains(t) || (this.adapter.onBlur(), this._isListVisible = !1, this._isFiltering = !1);
143
139
  }
144
140
  render() {
145
- const e = this.adapter.templateData, t = e.touched && e.errors && e.errors.length > 0, r = this._listItems.slice(this._range.start, this._range.end), i = this._currentValues(), l = this._pillItems(i), a = this.adapter.getItemRenderer(
141
+ const e = this.adapter.templateData, t = e.touched && e.errors && e.errors.length > 0, r = this._listItems.slice(this._range.start, this._range.end), i = this._currentValues(), l = this._pillItems(i), o = this.adapter.getItemRenderer(
146
142
  e.itemRenderer,
147
143
  A
148
- ), c = !!this.widget.on?.filter;
144
+ ), h = !!this.widget.on?.filter;
149
145
  return m`
150
146
  <gui-label
151
147
  .targetElement=${[this._listRef, this._triggerRef?.input]}
@@ -180,8 +176,8 @@ class o extends R {
180
176
  @keydown=${this._onKeyDown}
181
177
  @input=${this._onInput}
182
178
  @focusin=${this._onFocusIn}
183
- @pillremove=${this._onPillRemove}
184
- @dropdowntoggle=${this._onPillsDropdownToggle}
179
+ @gui-pill-remove=${this._onPillRemove}
180
+ @gui-dropdown-toggle=${this._onPillsDropdownToggle}
185
181
  ></gui-multi-select-trigger>
186
182
  <button
187
183
  type="button"
@@ -194,17 +190,7 @@ class o extends R {
194
190
  @mousedown=${this._onToggleMouseDown}
195
191
  @click=${this._onToggleClick}
196
192
  >
197
- <svg
198
- xmlns="http://www.w3.org/2000/svg"
199
- width="16"
200
- height="16"
201
- viewBox="0 0 256 256"
202
- aria-hidden="true"
203
- >
204
- <path
205
- 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"
206
- ></path>
207
- </svg>
193
+ <span class="gui-caret" aria-hidden="true"></span>
208
194
  </button>
209
195
 
210
196
  <div
@@ -215,23 +201,23 @@ class o extends R {
215
201
  <gui-multi-list
216
202
  id=${`${this.widget.uid}-list`}
217
203
  .uid=${this.widget.uid}
218
- .values=${i}
204
+ .values=${j(i)}
219
205
  .valueField=${e.valueField}
220
- .items=${this._isFiltering && !c ? this._filteredItems : e.items}
206
+ .items=${this._isFiltering && !h ? this._filteredItems : e.items}
221
207
  .itemHeight=${e.itemHeight}
222
208
  .height=${e.height}
223
209
  ?required=${e.validator?.required}
224
- ?touched=${e.touched}
210
+ .touched=${e.touched}
225
211
  ?disabled=${e.disabled}
226
212
  ?readonly=${e.readonly}
227
213
  ?hidden=${!this._isListVisible}
228
214
  @gui-range-change=${this._onRangeChange}
229
215
  @gui-update-items=${this._onUpdateItems}
230
216
  @gui-focus-change=${this._onFocusChange}
231
- @change=${this._onValueChange}
217
+ @gui-item-toggle=${this._onValueChange}
232
218
  >
233
219
  ${r.map((s, u) => {
234
- const d = this._range.start + u, p = i.includes(s.value), g = this._focusedIndex === d, _ = !!e.disabled || !!s.disabled, $ = e.labelField ?? "label", y = s.template !== null && typeof s.template == "object" && $ && !e.itemRenderer ? s.template[$] : s.template;
220
+ const d = this._range.start + u, p = i.includes(s.value), g = this._focusedIndex === d, _ = !!e.disabled || !!s.disabled, $ = e.labelField ?? "label", w = s.template !== null && typeof s.template == "object" && $ && !e.itemRenderer ? s.template[$] : s.template;
235
221
  return m`
236
222
  <div
237
223
  role="option"
@@ -243,8 +229,8 @@ class o extends R {
243
229
  aria-disabled=${_ ? "true" : "false"}
244
230
  @click=${() => this._onClickItem(s, d)}
245
231
  >
246
- ${a({
247
- template: y,
232
+ ${o({
233
+ template: w,
248
234
  value: s.value,
249
235
  index: d,
250
236
  selected: p,
@@ -260,7 +246,7 @@ class o extends R {
260
246
  .uid=${this.widget.uid}
261
247
  .errors=${e.errors}
262
248
  .touched=${e.touched}
263
- ></gui-errors>` : w}
249
+ ></gui-errors>` : I}
264
250
  </div>
265
251
  </div>
266
252
 
@@ -268,45 +254,45 @@ class o extends R {
268
254
  .uid=${this.widget.uid}
269
255
  .errors=${e.errors}
270
256
  .touched=${e.touched}
271
- ></gui-errors>` : w}
257
+ ></gui-errors>` : I}
272
258
  `;
273
259
  }
274
260
  }
275
261
  n([
276
- x({ context: v }),
262
+ L({ context: v }),
277
263
  C({ attribute: !1 })
278
- ], o.prototype, "formContext");
264
+ ], a.prototype, "formContext");
279
265
  n([
280
- L({ context: D })
281
- ], o.prototype, "adapter");
266
+ R({ context: D })
267
+ ], a.prototype, "adapter");
282
268
  n([
283
- h()
284
- ], o.prototype, "_range");
269
+ c()
270
+ ], a.prototype, "_range");
285
271
  n([
286
- h()
287
- ], o.prototype, "_filteredItems");
272
+ c()
273
+ ], a.prototype, "_filteredItems");
288
274
  n([
289
- h()
290
- ], o.prototype, "_listItems");
275
+ c()
276
+ ], a.prototype, "_listItems");
291
277
  n([
292
- h()
293
- ], o.prototype, "_focusedIndex");
278
+ c()
279
+ ], a.prototype, "_focusedIndex");
294
280
  n([
295
- h()
296
- ], o.prototype, "_isFiltering");
281
+ c()
282
+ ], a.prototype, "_isFiltering");
297
283
  n([
298
- h()
299
- ], o.prototype, "_isListVisible");
284
+ c()
285
+ ], a.prototype, "_isListVisible");
300
286
  n([
301
287
  b("gui-multi-select-trigger")
302
- ], o.prototype, "_triggerRef");
288
+ ], a.prototype, "_triggerRef");
303
289
  n([
304
290
  b("gui-multi-list")
305
- ], o.prototype, "_listRef");
291
+ ], a.prototype, "_listRef");
306
292
  n([
307
293
  b(".gui-picker__panel")
308
- ], o.prototype, "_panelRef");
309
- P("gui-multi-dropdown-input", o);
294
+ ], a.prototype, "_panelRef");
295
+ P("gui-multi-dropdown-input", a);
310
296
  export {
311
- o as MultiDropdownElement
297
+ a as MultiDropdownElement
312
298
  };
@@ -1,27 +1,22 @@
1
- import { InputWidgetAdapter as n, formContext as d, inputContext as p } from "@golemui/lit";
1
+ import { InputWidgetAdapter as l, formContext as d, inputContext as u } from "@golemui/lit";
2
2
  import "@golemui/gui-components/multi-file-upload";
3
- import { consume as u, provide as c } from "@lit/context";
4
- import { LitElement as m, html as h } from "lit";
5
- import { property as g } from "lit/decorators.js";
3
+ import { consume as p, provide as c } from "@lit/context";
4
+ import { LitElement as m, html as g } from "lit";
5
+ import { property as h } from "lit/decorators.js";
6
6
  import { unsubscribeAll as $, safeDefine as b } from "@golemui/lit/internals";
7
7
  import "rxjs";
8
- var f = Object.defineProperty, l = (r, e, t, v) => {
8
+ var f = Object.defineProperty, n = (r, e, t, v) => {
9
9
  for (var a = void 0, i = r.length - 1, o; i >= 0; i--)
10
10
  (o = r[i]) && (a = o(e, t, a) || a);
11
11
  return a && f(e, t, a), a;
12
12
  };
13
13
  class s extends m {
14
14
  constructor() {
15
- super(...arguments), this.adapter = new n(), this.subscriptions = [];
15
+ super(...arguments), this.adapter = new l(), this.subscriptions = [];
16
16
  }
17
17
  createRenderRoot() {
18
18
  return this;
19
19
  }
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
- }
25
20
  connectedCallback() {
26
21
  super.connectedCallback(), this.classList.add("gui-multi-file-upload", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
27
22
  this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
@@ -30,14 +25,14 @@ class s extends m {
30
25
  render() {
31
26
  super.render();
32
27
  const e = this.adapter.templateData;
33
- return h`
28
+ return g`
34
29
  <gui-multi-file-upload
35
30
  .uid=${this.widget.uid}
36
31
  .path=${this.widget.path}
37
32
  .label=${e.label}
38
33
  .hint=${e.hint}
39
34
  .errors=${e.errors}
40
- ?touched=${e.touched}
35
+ .touched=${e.touched}
41
36
  ?required=${e.validator?.required}
42
37
  ?disabled=${e.disabled}
43
38
  ?readonly=${e.readonly}
@@ -59,9 +54,9 @@ class s extends m {
59
54
  .uploadedMessage=${e.uploadedMessage}
60
55
  .removedMessage=${e.removedMessage}
61
56
  .failedMessage=${e.failedMessage}
62
- @change=${this.valueChanged}
63
- @blur=${() => this.adapter.onBlur()}
64
- @inputError=${this.onInputError}
57
+ @gui-input=${this.valueChanged}
58
+ @gui-blur=${() => this.adapter.onBlur()}
59
+ @gui-input-error=${this.onInputError}
65
60
  ></gui-multi-file-upload>
66
61
  `;
67
62
  }
@@ -77,12 +72,12 @@ class s extends m {
77
72
  super.disconnectedCallback(), this.adapter.destroy(), $(this.subscriptions);
78
73
  }
79
74
  }
80
- l([
81
- u({ context: d }),
82
- g({ attribute: !1 })
75
+ n([
76
+ p({ context: d }),
77
+ h({ attribute: !1 })
83
78
  ], s.prototype, "formContext");
84
- l([
85
- c({ context: p })
79
+ n([
80
+ c({ context: u })
86
81
  ], s.prototype, "adapter");
87
82
  b("gui-multi-file-upload-input", s);
88
83
  export {
@@ -1,30 +1,26 @@
1
1
  import { InputWidgetAdapter as $, formContext as v, inputContext as I } from "@golemui/lit";
2
- import { consume as x, provide as y } from "@lit/context";
2
+ import { consume as y, provide as x } from "@lit/context";
3
3
  import { LitElement as C, nothing as u, html as h } from "lit";
4
- import { property as R, state as p, query as w } from "lit/decorators.js";
4
+ import { property as R, state as c, query as w } from "lit/decorators.js";
5
5
  import { unsubscribeAll as D, cspStyleMap as L, safeDefine as k } from "@golemui/lit/internals";
6
6
  import "rxjs";
7
7
  import { d as F } from "./default-multi-list-item-renderer-Cv-guvEX.js";
8
8
  import "@golemui/gui-components/label";
9
9
  import "@golemui/gui-components/multi-list";
10
10
  import "@golemui/gui-components/errors";
11
- var q = Object.defineProperty, d = (o, e, t, r) => {
12
- for (var i = void 0, l = o.length - 1, s; l >= 0; l--)
13
- (s = o[l]) && (i = s(e, t, i) || i);
14
- return i && q(e, t, i), i;
11
+ import { live as q } from "lit/directives/live.js";
12
+ var A = Object.defineProperty, d = (o, e, s, a) => {
13
+ for (var t = void 0, l = o.length - 1, i; l >= 0; l--)
14
+ (i = o[l]) && (t = i(e, s, t) || t);
15
+ return t && A(e, s, t), t;
15
16
  };
16
- class a extends C {
17
+ class r extends C {
17
18
  constructor() {
18
19
  super(...arguments), this.adapter = new $(), this.subscriptions = [], this._range = { start: 0, end: 10 }, this._listItems = [], this._focusedIndex = -1;
19
20
  }
20
21
  createRenderRoot() {
21
22
  return this;
22
23
  }
23
- updated(e) {
24
- super.updated(e);
25
- const t = this.adapter.templateData.size;
26
- t ? this.style.flex = String(t) : this.style.removeProperty("flex");
27
- }
28
24
  connectedCallback() {
29
25
  super.connectedCallback(), this.classList.add("gui-multi-list-widget", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
30
26
  this.adapter.templateDataChanged$.subscribe(() => {
@@ -37,7 +33,7 @@ class a extends C {
37
33
  super.disconnectedCallback(), this.adapter.destroy(), D(this.subscriptions);
38
34
  }
39
35
  render() {
40
- const e = this.adapter.templateData, t = e.touched && e.errors && e.errors.length > 0, r = this._listItems.slice(this._range.start, this._range.end), i = this._currentValues(), l = this.adapter.getItemRenderer(
36
+ const e = this.adapter.templateData, s = e.touched && e.errors && e.errors.length > 0, a = this._listItems.slice(this._range.start, this._range.end), t = this._currentValues(), l = this.adapter.getItemRenderer(
41
37
  e.itemRenderer,
42
38
  F
43
39
  );
@@ -50,19 +46,21 @@ class a extends C {
50
46
  .errors=${e.errors}
51
47
  .touched=${e.touched}
52
48
  .required=${e.validator?.required}
49
+ .disabled=${e.disabled}
50
+ .readOnly=${e.readonly}
53
51
  .native=${!1}
54
52
  ></gui-label>
55
53
 
56
54
  <div class="gui-widget">
57
55
  <gui-multi-list
58
56
  .uid=${this.widget.uid}
59
- .values=${i}
57
+ .values=${q(t)}
60
58
  .valueField=${e.valueField}
61
59
  .items=${e.items}
62
60
  .itemHeight=${e.itemHeight}
63
61
  .height=${e.height}
64
62
  ?required=${e.validator?.required}
65
- ?touched=${e.touched}
63
+ .touched=${e.touched}
66
64
  ?disabled=${e.disabled}
67
65
  ?readonly=${e.readonly}
68
66
  aria-labelledby=${e.label ? `${this.widget.uid}_label` : u}
@@ -70,11 +68,11 @@ class a extends C {
70
68
  @gui-range-change=${this._onRangeChange}
71
69
  @gui-update-items=${this._onUpdateItems}
72
70
  @gui-focus-change=${this._onFocusChange}
73
- @blur=${() => this.adapter.onBlur()}
74
- @change=${this._valueChanged}
71
+ @gui-blur=${() => this.adapter.onBlur()}
72
+ @gui-item-toggle=${this._valueChanged}
75
73
  >
76
- ${r.map((s, f) => {
77
- const n = this._range.start + f, c = i.includes(s.value), _ = this._focusedIndex === n, g = !!e.disabled || !!s.disabled, m = e.labelField ?? "label", b = s.template !== null && typeof s.template == "object" && m && !e.itemRenderer ? s.template[m] : s.template;
74
+ ${a.map((i, f) => {
75
+ const n = this._range.start + f, p = t.includes(i.value), _ = this._focusedIndex === n, g = !!e.disabled || !!i.disabled, m = e.labelField ?? "label", b = i.template !== null && typeof i.template == "object" && m && !e.itemRenderer ? i.template[m] : i.template;
78
76
  return h`
79
77
  <div
80
78
  role="option"
@@ -82,15 +80,15 @@ class a extends C {
82
80
  class="gui-list__item-wrapper"
83
81
  id="${this.widget.uid}-item-${n}"
84
82
  style=${L({ height: `${e.itemHeight || 40}px` })}
85
- aria-selected=${c ? "true" : "false"}
83
+ aria-selected=${p ? "true" : "false"}
86
84
  aria-disabled=${g ? "true" : "false"}
87
- @click=${() => this._onClickItem(s, n)}
85
+ @click=${() => this._onClickItem(i, n)}
88
86
  >
89
87
  ${l({
90
88
  template: b,
91
- value: s.value,
89
+ value: i.value,
92
90
  index: n,
93
- selected: c,
91
+ selected: p,
94
92
  disabled: g,
95
93
  focused: _
96
94
  })}
@@ -100,7 +98,7 @@ class a extends C {
100
98
  </gui-multi-list>
101
99
  </div>
102
100
 
103
- ${t ? h`<gui-errors
101
+ ${s ? h`<gui-errors
104
102
  .uid=${this.widget.uid}
105
103
  .errors=${e.errors}
106
104
  .touched=${e.touched}
@@ -112,14 +110,14 @@ class a extends C {
112
110
  return Array.isArray(e) ? e : [];
113
111
  }
114
112
  _toggleValue(e) {
115
- const t = this.adapter.templateData;
116
- if (t.disabled || t.readonly) return;
117
- const r = this._currentValues();
118
- if (r.includes(e)) {
119
- this.adapter.valueChanged(r.filter((i) => i !== e));
113
+ const s = this.adapter.templateData;
114
+ if (s.disabled || s.readonly) return;
115
+ const a = this._currentValues();
116
+ if (a.includes(e)) {
117
+ this.adapter.valueChanged(a.filter((t) => t !== e));
120
118
  return;
121
119
  }
122
- this.adapter.valueChanged([...r, e]);
120
+ this.adapter.valueChanged([...a, e]);
123
121
  }
124
122
  _onRangeChange(e) {
125
123
  this._range = { start: e.detail.startIndex, end: e.detail.endIndex };
@@ -130,33 +128,34 @@ class a extends C {
130
128
  _onFocusChange(e) {
131
129
  this._focusedIndex = e.detail.index;
132
130
  }
133
- _onClickItem(e, t) {
134
- this.adapter.templateData.disabled || e.disabled || (this._toggleValue(e.value), this._focusedIndex = t, this._guiListRef && typeof this._guiListRef.focusItemAtIndex == "function" && this._guiListRef.focusItemAtIndex(t));
131
+ _onClickItem(e, s) {
132
+ const { disabled: a, readonly: t } = this.adapter.templateData;
133
+ a || t || e.disabled || (this._toggleValue(e.value), this._focusedIndex = s, this._guiListRef && typeof this._guiListRef.focusItemAtIndex == "function" && this._guiListRef.focusItemAtIndex(s));
135
134
  }
136
135
  _valueChanged(e) {
137
136
  this.adapter.templateData.readonly || this._toggleValue(e.detail.value);
138
137
  }
139
138
  }
140
139
  d([
141
- x({ context: v }),
140
+ y({ context: v }),
142
141
  R({ attribute: !1 })
143
- ], a.prototype, "formContext");
142
+ ], r.prototype, "formContext");
144
143
  d([
145
- y({ context: I })
146
- ], a.prototype, "adapter");
144
+ x({ context: I })
145
+ ], r.prototype, "adapter");
147
146
  d([
148
- p()
149
- ], a.prototype, "_range");
147
+ c()
148
+ ], r.prototype, "_range");
150
149
  d([
151
- p()
152
- ], a.prototype, "_listItems");
150
+ c()
151
+ ], r.prototype, "_listItems");
153
152
  d([
154
- p()
155
- ], a.prototype, "_focusedIndex");
153
+ c()
154
+ ], r.prototype, "_focusedIndex");
156
155
  d([
157
156
  w("gui-multi-list")
158
- ], a.prototype, "_guiListRef");
159
- k("gui-multi-list-input", a);
157
+ ], r.prototype, "_guiListRef");
158
+ k("gui-multi-list-input", r);
160
159
  export {
161
- a as MultiListElement
160
+ r as MultiListElement
162
161
  };