@golemui/gui-lit 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## 1.0.1 (2026-06-15)
2
+
3
+ This was a version bump only for gui-lit to align it with other projects, there were no code changes.
4
+
5
+ # 1.0.0 (2026-06-14)
6
+
7
+ ### 🚀 Features
8
+
9
+ - surface form init errors instead of a silent blank form ([#184](https://github.com/golemui/golemui/pull/184))
10
+
11
+ ### 🩹 Fixes
12
+
13
+ - added license field and copied license to all publishable packages ([#189](https://github.com/golemui/golemui/pull/189))
14
+ - ⚠️ Clean Public API ([#173](https://github.com/golemui/golemui/pull/173))
15
+
16
+ ### ⚠️ Breaking Changes
17
+
18
+ - Clean Public API ([#173](https://github.com/golemui/golemui/pull/173))
19
+ Promoted dx functions, widget props and golemForm to internals API, import now from
20
+ @golemui/gui-shared/internals
21
+
22
+ ### ❤️ Thank You
23
+
24
+ - alberto-golem-ui
25
+ - Mud Scientist @mudscientist
26
+ - Raúl Jiménez @Elecash
27
+
1
28
  ## 1.0.0-rc.5 (2026-06-14)
2
29
 
3
30
  This was a version bump only for gui-lit to align it with other projects, there were no code changes.
@@ -1,16 +1,16 @@
1
1
  import { InputWidgetAdapter as g, formContext as b, inputContext as v } from "@golemui/lit";
2
- import { LitElement as m, nothing as p, html as c } from "lit";
2
+ import { LitElement as m, nothing as p, html as d } from "lit";
3
3
  import { property as a, state as f, query as $, customElement as y } from "lit/decorators.js";
4
4
  import { classMap as D } from "lit/directives/class-map.js";
5
5
  import { G as C, a as x, b as F, c as S } from "./templates-Dk1jxLwS.js";
6
6
  import { consume as _, provide as w } from "@lit/context";
7
7
  import "rxjs";
8
- var E = Object.defineProperty, I = Object.getOwnPropertyDescriptor, r = (t, i, o, l) => {
9
- for (var s = l > 1 ? void 0 : l ? I(i, o) : i, n = t.length - 1, u; n >= 0; n--)
10
- (u = t[n]) && (s = (l ? u(i, o, s) : u(s)) || s);
11
- return l && s && E(i, o, s), s;
8
+ var E = Object.defineProperty, I = Object.getOwnPropertyDescriptor, r = (t, e, o, l) => {
9
+ for (var s = l > 1 ? void 0 : l ? I(e, o) : e, n = t.length - 1, u; n >= 0; n--)
10
+ (u = t[n]) && (s = (l ? u(e, o, s) : u(s)) || s);
11
+ return l && s && E(e, o, s), s;
12
12
  };
13
- let e = class extends m {
13
+ let i = class extends m {
14
14
  constructor() {
15
15
  super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = void 0, this.errors = [], this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.value = void 0, this.currency = void 0, this.step = void 0, this.maximumFractionDigits = void 0, this.minimumFractionDigits = void 0, this.hint = void 0, this.icon = void 0, this.placeholder = void 0, this.autocomplete = void 0, this.ariaController = new C(this, {
16
16
  getTargets: () => this.querySelectorAll(`input[id="${this.uid}"]`),
@@ -55,11 +55,11 @@ let e = class extends m {
55
55
  autocomplete: this.autocomplete
56
56
  };
57
57
  this.displayValue = this.formatCurrency(this.value);
58
- const i = x("currency", t), o = {
58
+ const e = x("currency", t), o = {
59
59
  "gui-widget-input": !0,
60
60
  "gui-currency--icon": !!this.icon
61
61
  };
62
- return c`
62
+ return d`
63
63
  ${F(this.uid, t)}
64
64
 
65
65
  <div class="gui-widget">
@@ -80,12 +80,12 @@ let e = class extends m {
80
80
  @focus=${this.handleFocus}
81
81
  @blur=${this.handleBlur}
82
82
  />
83
- ${this.displayValue ? c`<label
83
+ ${this.displayValue ? d`<label
84
84
  for=${this.uid}
85
85
  class="gui-currency__format-value ${this.icon ? "gui-currency__format-value--icon" : ""}"
86
86
  >${this.displayValue}</label
87
87
  >` : p}
88
- ${i.html}
88
+ ${e.html}
89
89
  </div>
90
90
 
91
91
  ${S(this.uid, t)}
@@ -93,10 +93,12 @@ let e = class extends m {
93
93
  }
94
94
  handleInput(t) {
95
95
  if (t.stopPropagation(), !this.readOnly) {
96
- const i = t.target;
97
- this.displayValue = this.formatCurrency(i.valueAsNumber), this.dispatchEvent(
96
+ const e = t.target;
97
+ this.displayValue = this.formatCurrency(e.valueAsNumber);
98
+ const o = e.valueAsNumber;
99
+ this.dispatchEvent(
98
100
  new CustomEvent("input", {
99
- detail: { value: i.valueAsNumber },
101
+ detail: { value: Number.isNaN(o) ? void 0 : o },
100
102
  bubbles: !0,
101
103
  composed: !0
102
104
  })
@@ -117,14 +119,15 @@ let e = class extends m {
117
119
  formatCurrency(t) {
118
120
  if (t === "" || t === void 0 || t === null || isNaN(t)) return "";
119
121
  try {
122
+ const e = this.maximumFractionDigits ?? Math.max(this.minimumFractionDigits ?? 2, 2), o = Math.min(this.minimumFractionDigits ?? 2, e);
120
123
  return new Intl.NumberFormat(this.localeId ?? "en", {
121
124
  style: "currency",
122
125
  currency: this.currency ?? "USD",
123
- maximumFractionDigits: this.maximumFractionDigits ?? Math.max(this.minimumFractionDigits ?? 2, 2),
124
- minimumFractionDigits: this.minimumFractionDigits ?? 2
126
+ maximumFractionDigits: e,
127
+ minimumFractionDigits: o
125
128
  }).format(t);
126
- } catch (i) {
127
- return console.warn("Invalid locale or currency", i), t.toString();
129
+ } catch (e) {
130
+ return console.warn("Invalid locale or currency", e), t.toString();
128
131
  }
129
132
  }
130
133
  get separators() {
@@ -137,71 +140,71 @@ let e = class extends m {
137
140
  };
138
141
  r([
139
142
  a({ type: String })
140
- ], e.prototype, "uid", 2);
143
+ ], i.prototype, "uid", 2);
141
144
  r([
142
145
  a({ type: String })
143
- ], e.prototype, "label", 2);
146
+ ], i.prototype, "label", 2);
144
147
  r([
145
148
  a({ type: String, attribute: "locale-id" })
146
- ], e.prototype, "localeId", 2);
149
+ ], i.prototype, "localeId", 2);
147
150
  r([
148
151
  a({ type: Array })
149
- ], e.prototype, "errors", 2);
152
+ ], i.prototype, "errors", 2);
150
153
  r([
151
154
  a({ type: Boolean })
152
- ], e.prototype, "touched", 2);
155
+ ], i.prototype, "touched", 2);
153
156
  r([
154
157
  a({ type: Boolean })
155
- ], e.prototype, "required", 2);
158
+ ], i.prototype, "required", 2);
156
159
  r([
157
160
  a({ type: Boolean })
158
- ], e.prototype, "disabled", 2);
161
+ ], i.prototype, "disabled", 2);
159
162
  r([
160
163
  a({ type: Boolean, attribute: "readonly" })
161
- ], e.prototype, "readOnly", 2);
164
+ ], i.prototype, "readOnly", 2);
162
165
  r([
163
166
  a({ type: String })
164
- ], e.prototype, "value", 2);
167
+ ], i.prototype, "value", 2);
165
168
  r([
166
169
  a({ type: String })
167
- ], e.prototype, "currency", 2);
170
+ ], i.prototype, "currency", 2);
168
171
  r([
169
172
  a({ type: String })
170
- ], e.prototype, "step", 2);
173
+ ], i.prototype, "step", 2);
171
174
  r([
172
175
  a({ type: String })
173
- ], e.prototype, "maximumFractionDigits", 2);
176
+ ], i.prototype, "maximumFractionDigits", 2);
174
177
  r([
175
178
  a({ type: String })
176
- ], e.prototype, "minimumFractionDigits", 2);
179
+ ], i.prototype, "minimumFractionDigits", 2);
177
180
  r([
178
181
  a({ type: String })
179
- ], e.prototype, "hint", 2);
182
+ ], i.prototype, "hint", 2);
180
183
  r([
181
184
  a({ type: String })
182
- ], e.prototype, "icon", 2);
185
+ ], i.prototype, "icon", 2);
183
186
  r([
184
187
  a({ type: String })
185
- ], e.prototype, "placeholder", 2);
188
+ ], i.prototype, "placeholder", 2);
186
189
  r([
187
190
  a({ type: String })
188
- ], e.prototype, "autocomplete", 2);
191
+ ], i.prototype, "autocomplete", 2);
189
192
  r([
190
193
  f()
191
- ], e.prototype, "displayValue", 2);
194
+ ], i.prototype, "displayValue", 2);
192
195
  r([
193
196
  $("input")
194
- ], e.prototype, "inputElement", 2);
195
- e = r([
197
+ ], i.prototype, "inputElement", 2);
198
+ i = r([
196
199
  y("gui-currency")
197
- ], e);
198
- typeof customElements < "u" && !customElements.get("gui-currency") && customElements.define("gui-currency", e);
199
- var O = Object.defineProperty, q = Object.getOwnPropertyDescriptor, h = (t, i, o, l) => {
200
- for (var s = l > 1 ? void 0 : l ? q(i, o) : i, n = t.length - 1, u; n >= 0; n--)
201
- (u = t[n]) && (s = (l ? u(i, o, s) : u(s)) || s);
202
- return l && s && O(i, o, s), s;
200
+ ], i);
201
+ typeof customElements < "u" && !customElements.get("gui-currency") && customElements.define("gui-currency", i);
202
+ var O = Object.defineProperty, q = Object.getOwnPropertyDescriptor, h = (t, e, o, l) => {
203
+ for (var s = l > 1 ? void 0 : l ? q(e, o) : e, n = t.length - 1, u; n >= 0; n--)
204
+ (u = t[n]) && (s = (l ? u(e, o, s) : u(s)) || s);
205
+ return l && s && O(e, o, s), s;
203
206
  };
204
- let d = class extends m {
207
+ let c = class extends m {
205
208
  constructor() {
206
209
  super(...arguments), this.adapter = new g(), this.subscriptions = [];
207
210
  }
@@ -210,8 +213,8 @@ let d = class extends m {
210
213
  }
211
214
  updated(t) {
212
215
  super.updated(t);
213
- const i = this.adapter.templateData.size;
214
- i ? this.style.flex = String(i) : this.style.removeProperty("flex");
216
+ const e = this.adapter.templateData.size;
217
+ e ? this.style.flex = String(e) : this.style.removeProperty("flex");
215
218
  }
216
219
  connectedCallback() {
217
220
  super.connectedCallback(), this.classList.add("gui-currency", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
@@ -219,7 +222,7 @@ let d = class extends m {
219
222
  );
220
223
  }
221
224
  render() {
222
- return super.render(), c`
225
+ return super.render(), d`
223
226
  <gui-currency
224
227
  .uid=${this.widget.uid}
225
228
  .label=${this.adapter.templateData.label}
@@ -244,8 +247,8 @@ let d = class extends m {
244
247
  `;
245
248
  }
246
249
  valueChanged(t) {
247
- const i = t.detail.value;
248
- this.adapter.valueChanged(i);
250
+ const e = t.detail.value;
251
+ this.adapter.valueChanged(e);
249
252
  }
250
253
  disconnectedCallback() {
251
254
  super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
@@ -254,13 +257,13 @@ let d = class extends m {
254
257
  h([
255
258
  _({ context: b }),
256
259
  a({ attribute: !1 })
257
- ], d.prototype, "formContext", 2);
260
+ ], c.prototype, "formContext", 2);
258
261
  h([
259
262
  w({ context: v })
260
- ], d.prototype, "adapter", 2);
261
- d = h([
263
+ ], c.prototype, "adapter", 2);
264
+ c = h([
262
265
  y("gui-currency-input")
263
- ], d);
266
+ ], c);
264
267
  export {
265
- d as CurrencyElement
268
+ c as CurrencyElement
266
269
  };
package/index.js CHANGED
@@ -3389,18 +3389,18 @@ const Us = {
3389
3389
  rangeCalendar: async () => (await import("./range-calendar.element-QTE6vGNP.js")).RangeCalendarElement,
3390
3390
  rangeDateInput: async () => (await import("./range-date-input.element-Dj29D_OQ.js")).RangeDateInputElement,
3391
3391
  rangeDatePicker: async () => (await import("./range-date-picker.element-CuKIBkIO.js")).RangeDatePickerElement,
3392
- currency: async () => (await import("./currency.element-YyL4TeL0.js")).CurrencyElement,
3392
+ currency: async () => (await import("./currency.element-BHXWcOEu.js")).CurrencyElement,
3393
3393
  dateInput: async () => (await import("./date.element-BtVJSIRk.js")).DateElement,
3394
3394
  datePicker: async () => (await import("./date-picker.element-DabW_-0-.js")).DatePickerElement,
3395
3395
  dropdown: async () => (await import("./dropdown.element-DqzC6aXR.js")).DropdownElement,
3396
3396
  list: async () => (await import("./list.element-Co3V3Cn5.js")).ListElement,
3397
- markdown: async () => (await import("./markdown.element-CNp4wbg9.js")).MarkdownElement,
3397
+ markdown: async () => (await import("./markdown.element-p-kC47D7.js")).MarkdownElement,
3398
3398
  password: async () => (await import("./password.element-n-R9RbkB.js")).PasswordElement,
3399
3399
  textinput: async () => (await import("./textinput.element-CkXNzMUg.js")).TextinputElement,
3400
- textarea: async () => (await import("./textarea.element-Cu9ZW3K4.js")).TextareaElement,
3400
+ textarea: async () => (await import("./textarea.element-HThYqdR_.js")).TextareaElement,
3401
3401
  toggle: async () => (await import("./toggle.element-C1kCw5H8.js")).ToggleElement,
3402
3402
  checkbox: async () => (await import("./checkbox.element-CVskoXEc.js")).CheckboxElement,
3403
- number: async () => (await import("./number.element-B6TsvHMK.js")).NumberElement,
3403
+ number: async () => (await import("./number.element-BhEyoOtc.js")).NumberElement,
3404
3404
  radiogroup: async () => (await import("./radiogroup.element-CeQn623u.js")).RadiogroupElement,
3405
3405
  select: async () => (await import("./select.element-jcDF1h-g.js")).SelectElement,
3406
3406
  tags: async () => (await import("./tags.element-CX3vQL8L.js")).TagsElement,