@iyulab/components 1.27.1 → 1.27.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,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.27.2] - 2026-08-11
4
+
5
+ ### Fixed
6
+
7
+ - **`u-input`'s form submission value now stays in sync with `value` across every change
8
+ path**, not just on blur. Previously, `ElementInternals.setFormValue()` was only called from
9
+ the blur handler, so submitting a form before a field lost focus (an initial `value`
10
+ attribute, a programmatic `.value =` assignment, or the clear button from 1.27.1) could send a
11
+ stale or missing value. Sync now happens reactively whenever `value` changes, matching
12
+ `u-select`'s existing contract.
13
+
3
14
  ## [1.27.1] - 2026-08-11
4
15
 
5
16
  ### Fixed
@@ -1,3 +1,4 @@
1
+ import { PropertyValues } from 'lit';
1
2
  import { UFormControlElement } from '../UFormControlElement.js';
2
3
  import { UPopover } from '../popover/UPopover.js';
3
4
  export type InputType = 'text' | 'password' | 'email' | 'tel' | 'url' | 'search' | 'number' | 'date' | 'time' | 'datetime-local' | 'month' | 'week';
@@ -81,6 +82,12 @@ export declare class UInput extends UFormControlElement<string> {
81
82
  private options;
82
83
  disconnectedCallback(): void;
83
84
  render(): import('lit-html').TemplateResult<1>;
85
+ /** `value`가 바뀌는 모든 경로(초기 속성 설정 · 프로그램적 대입 · clear 버튼)에서
86
+ * 폼 제출값을 동기화한다 — 종전에는 `handleInputBlur`에서만 수동으로 호출해,
87
+ * blur 전에 폼이 제출되면(다른 컨트롤의 Enter 등) `FormData`가 낡은 값을 돌려줬다.
88
+ * 형제 `USelect`의 `updated()`+`onChangeValue()` 패턴과 같은 경계 — `T`가 이미
89
+ * `string`이라 `valueAsString` 같은 변환 없이 그대로 넘긴다. */
90
+ protected updated(changedProperties: PropertyValues): void;
84
91
  protected setValidity(): void;
85
92
  reset(): void;
86
93
  focus(options?: FocusOptions): void;
@@ -53,7 +53,6 @@ var UInput = class UInput extends UFormControlElement {
53
53
  };
54
54
  this.handleInputBlur = (_) => {
55
55
  this.value = this.inputEl?.value || "";
56
- this.internals?.setFormValue(this.value);
57
56
  if (!this.novalidate) this.validate();
58
57
  this.dispatchEvent(new Event("change", {
59
58
  bubbles: true,
@@ -213,6 +212,15 @@ var UInput = class UInput extends UFormControlElement {
213
212
  </u-popover>
214
213
  `;
215
214
  }
215
+ /** `value`가 바뀌는 모든 경로(초기 속성 설정 · 프로그램적 대입 · clear 버튼)에서
216
+ * 폼 제출값을 동기화한다 — 종전에는 `handleInputBlur`에서만 수동으로 호출해,
217
+ * blur 전에 폼이 제출되면(다른 컨트롤의 Enter 등) `FormData`가 낡은 값을 돌려줬다.
218
+ * 형제 `USelect`의 `updated()`+`onChangeValue()` 패턴과 같은 경계 — `T`가 이미
219
+ * `string`이라 `valueAsString` 같은 변환 없이 그대로 넘긴다. */
220
+ updated(changedProperties) {
221
+ super.updated(changedProperties);
222
+ if (changedProperties.has("value")) this.internals?.setFormValue(this.value ?? "");
223
+ }
216
224
  setValidity() {
217
225
  const v = this.inputEl?.validity;
218
226
  let flags = {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/components",
3
3
  "description": "web-components library based on lit-element made by iyulab",
4
- "version": "1.27.1",
4
+ "version": "1.27.2",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",