@iyulab/flex-table 0.51.0 → 0.52.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.52.0] - 2026-10-07
4
+
5
+ ### Changed
6
+
7
+ - **Requires `@iyulab/components` 2.8.0** (peer `>=2.8.0`) — for its locale change notification.
8
+
9
+ ### Fixed
10
+
11
+ - **`flex-table` follows a runtime locale switch.** `Locale.set()` or registering strings (`flexTableLocale.register`)
12
+ re-renders the table at once — menus, filters, empty states and a cell's error marker (now looked up when drawn). It
13
+ kept the old language until a scroll or data change redrew it. A table detached during the switch catches up when
14
+ attached again.
15
+
3
16
  ## [0.51.0] - 2026-10-06
4
17
 
5
18
  ### Fixed
@@ -2443,10 +2443,10 @@ var K = {
2443
2443
  };
2444
2444
  }
2445
2445
  connectedCallback() {
2446
- super.connectedCallback(), this._onScroll = this._onScroll.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onDocumentClick = this._onDocumentClick.bind(this), this._onContextMenu = this._onContextMenu.bind(this), this._onDragover = this._onDragover.bind(this), this._onDragleave = this._onDragleave.bind(this), this._onDrop = this._onDrop.bind(this), this.addEventListener("scroll", this._onScroll, { passive: !0 }), this.addEventListener("keydown", this._onKeyDown), this.addEventListener("focus", this._onHostFocus), this.renderRoot.addEventListener("focusin", this._onFocusIn), this.renderRoot.addEventListener("focusout", this._onFocusOut), this.addEventListener("contextmenu", this._onContextMenu), this.addEventListener("dragover", this._onDragover), this.addEventListener("dragleave", this._onDragleave), this.addEventListener("drop", this._onDrop), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.setAttribute("role", "grid"), typeof ResizeObserver < "u" && (this._hostResizeObserver = new ResizeObserver(() => this._measureViewport()), this._hostResizeObserver.observe(this));
2446
+ super.connectedCallback(), this._unsubscribeLocale = l.subscribe(() => this.requestUpdate()), this._detachedLocaleRevision !== void 0 && this._detachedLocaleRevision !== l.revision && this.requestUpdate(), this._detachedLocaleRevision = void 0, this._onScroll = this._onScroll.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onDocumentClick = this._onDocumentClick.bind(this), this._onContextMenu = this._onContextMenu.bind(this), this._onDragover = this._onDragover.bind(this), this._onDragleave = this._onDragleave.bind(this), this._onDrop = this._onDrop.bind(this), this.addEventListener("scroll", this._onScroll, { passive: !0 }), this.addEventListener("keydown", this._onKeyDown), this.addEventListener("focus", this._onHostFocus), this.renderRoot.addEventListener("focusin", this._onFocusIn), this.renderRoot.addEventListener("focusout", this._onFocusOut), this.addEventListener("contextmenu", this._onContextMenu), this.addEventListener("dragover", this._onDragover), this.addEventListener("dragleave", this._onDragleave), this.addEventListener("drop", this._onDrop), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.setAttribute("role", "grid"), typeof ResizeObserver < "u" && (this._hostResizeObserver = new ResizeObserver(() => this._measureViewport()), this._hostResizeObserver.observe(this));
2447
2447
  }
2448
2448
  disconnectedCallback() {
2449
- super.disconnectedCallback(), this.removeEventListener("scroll", this._onScroll), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("focus", this._onHostFocus), this.renderRoot.removeEventListener("focusin", this._onFocusIn), this.renderRoot.removeEventListener("focusout", this._onFocusOut), this.removeEventListener("contextmenu", this._onContextMenu), this.removeEventListener("dragover", this._onDragover), this.removeEventListener("dragleave", this._onDragleave), this.removeEventListener("drop", this._onDrop), document.removeEventListener("click", this._onDocumentClick), document.removeEventListener("mousedown", this._onCommentPopupOutsideClick), this._isDragging = !1, this._wasDrag = !1, this._resizeCleanup &&= (this._resizeCleanup(), null), this._hostResizeObserver &&= (this._hostResizeObserver.disconnect(), null);
2449
+ super.disconnectedCallback(), this._unsubscribeLocale?.(), this._unsubscribeLocale = void 0, this._detachedLocaleRevision = l.revision, this.removeEventListener("scroll", this._onScroll), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("focus", this._onHostFocus), this.renderRoot.removeEventListener("focusin", this._onFocusIn), this.renderRoot.removeEventListener("focusout", this._onFocusOut), this.removeEventListener("contextmenu", this._onContextMenu), this.removeEventListener("dragover", this._onDragover), this.removeEventListener("dragleave", this._onDragleave), this.removeEventListener("drop", this._onDrop), document.removeEventListener("click", this._onDocumentClick), document.removeEventListener("mousedown", this._onCommentPopupOutsideClick), this._isDragging = !1, this._wasDrag = !1, this._resizeCleanup &&= (this._resizeCleanup(), null), this._hostResizeObserver &&= (this._hostResizeObserver.disconnect(), null);
2450
2450
  }
2451
2451
  firstUpdated() {
2452
2452
  this._readDensityTokens(), this._measureViewport(), this.shadowRoot && Array.isArray(this.shadowRoot.adoptedStyleSheets) && (this._baseStyleSheets = [...this.shadowRoot.adoptedStyleSheets]), this._syncStylesheets();
@@ -2693,7 +2693,7 @@ var K = {
2693
2693
  let { row: n, col: r } = t.position, i = this._toDataIndex(n), a = this.visibleColumns[r], o = t.originalValue;
2694
2694
  if (a.autocomplete === "strict" && e != null && e !== "" && !this._getAutocompleteCandidates(a, "").includes(String(e))) {
2695
2695
  let t = k("notInList");
2696
- this._markCellInvalid(n, r, t), this._emit("validation-error", {
2696
+ this._markCellInvalid(n, r, () => k("notInList")), this._emit("validation-error", {
2697
2697
  row: i,
2698
2698
  col: r,
2699
2699
  key: a.key,
@@ -2703,13 +2703,13 @@ var K = {
2703
2703
  return;
2704
2704
  }
2705
2705
  if (a.type === "number" && typeof e == "string" || a.type === "date" && typeof e == "string" && f(e) === null || a.type === "datetime" && typeof e == "string" && p(e) === null) {
2706
- let t = k(a.type === "number" ? "notANumber" : a.type === "date" ? "notADate" : "notADateTime");
2707
- this._markCellInvalid(n, r, t), this._emit("validation-error", {
2706
+ let t = a.type === "number" ? "notANumber" : a.type === "date" ? "notADate" : "notADateTime", o = k(t);
2707
+ this._markCellInvalid(n, r, () => k(t)), this._emit("validation-error", {
2708
2708
  row: i,
2709
2709
  col: r,
2710
2710
  key: a.key,
2711
2711
  value: e,
2712
- error: t
2712
+ error: o
2713
2713
  });
2714
2714
  return;
2715
2715
  }
@@ -3809,7 +3809,7 @@ var K = {
3809
3809
  }
3810
3810
  _isCellInvalid(e, t) {
3811
3811
  let n = this._invalidCells.get(this._cellKey(e, t));
3812
- return n ? n.error : null;
3812
+ return n ? typeof n.error == "function" ? n.error() : n.error : null;
3813
3813
  }
3814
3814
  _renderDateFilter(e) {
3815
3815
  let t = e.type === "datetime", n = this._dateFilterState.get(e.key) ?? {}, r = (e) => e?.slice(0, 10), o = (e) => {
@@ -345,6 +345,9 @@ export declare class FlexTable extends LitElement {
345
345
  private _rowBoundaryViewportY;
346
346
  private get totalBodyHeight();
347
347
  private get visibleRange();
348
+ /** 런타임 로캘 전환 구독 — 이 요소는 `LitElement` 를 직접 잇기에 `@iyulab/components` 의 `UElement` 구독을 받지 못한다. */
349
+ private _unsubscribeLocale?;
350
+ private _detachedLocaleRevision?;
348
351
  connectedCallback(): void;
349
352
  disconnectedCallback(): void;
350
353
  protected firstUpdated(): void;
@@ -556,6 +559,7 @@ export declare class FlexTable extends LitElement {
556
559
  private _defaultNumState;
557
560
  private _renderNumCondRow;
558
561
  private _renderNumberFilter;
562
+ /** 셀 오류 표시 — 우리 문장은 «그릴 때 찾는» 함수로(로캘 전환에 따라오게), 소비자 `validator` 문장은 그대로. */
559
563
  private _invalidCells;
560
564
  private _cellKey;
561
565
  private _markCellInvalid;
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, t as o } from "./flex-table-CEmUq0Rp.js";
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, t as o } from "./flex-table-CtlqiwD8.js";
2
2
  export { o as FlexTable, e as RowSelectionState, n as UndoStack, r as effectiveAlign, a as exportData, i as flexTableLocale, t as renderCell };
package/dist/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s as e, t } from "./flex-table-CEmUq0Rp.js";
1
+ import { s as e, t } from "./flex-table-CtlqiwD8.js";
2
2
  import { i as n, t as r } from "./query-Dw4iO0ir.js";
3
3
  import { t as i } from "./view-DiLr-TdY.js";
4
4
  import a, { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iyulab/flex-table",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "description": "A minimalist, input-centric data grid web component",
5
5
  "type": "module",
6
6
  "main": "./dist/flex-table.js",
@@ -74,7 +74,7 @@
74
74
  "odata-query": "^8.1.0"
75
75
  },
76
76
  "peerDependencies": {
77
- "@iyulab/components": ">=2.2.0",
77
+ "@iyulab/components": ">=2.8.0",
78
78
  "@lit/react": "^1.0.8",
79
79
  "react": "^18.0.0 || ^19.0.0"
80
80
  },