@iyulab/flex-table 0.25.0 → 0.26.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,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.26.0] - 2026-08-20
4
+
5
+ ### Added
6
+
7
+ - **`ColumnDefinition.headerAlign`** (`'start' | 'center' | 'end'`, default `'start'`). Header
8
+ label alignment was previously fixed to the left regardless of how the column's own content is
9
+ rendered. A column whose `renderer` centers its content (an icon-only action column, for
10
+ example) had no way to make the header label match, so the two visually drifted apart. Setting
11
+ `headerAlign: 'center'` (or `'end'`) aligns the header text independently of cell content
12
+ alignment, which the consumer already fully controls via `renderer`.
13
+
3
14
  ## [0.25.0] - 2026-08-07
4
15
 
5
16
  ### Added
package/README.md CHANGED
@@ -4,6 +4,12 @@ A lightweight, schema-agnostic data grid web component built with [Lit](https://
4
4
 
5
5
  Designed for effortless data input and crystal-clear visibility. Bridges the gap between spreadsheet freedom and database structural integrity.
6
6
 
7
+ **`flex-table` vs. `URichTable`** (`@iyulab/data-components`): both can consume external data
8
+ sources such as OData — the choice is about scale and interaction, not the data source.
9
+
10
+ - **`flex-table`** — large datasets, cell-level editing, spreadsheet-grade interaction
11
+ - **`URichTable`** — small-to-medium datasets, row-level CRUD, selection/filter-focused UX
12
+
7
13
  ## Install
8
14
 
9
15
  ```bash
@@ -153,6 +153,9 @@ var s = t`
153
153
  .ft-header-cell.ft-sortable { cursor: pointer; }
154
154
  .ft-header-cell.ft-sortable:hover { background: var(--ft-header-hover-bg); }
155
155
 
156
+ .ft-header-cell.ft-header-align-center { justify-content: center; }
157
+ .ft-header-cell.ft-header-align-end { justify-content: flex-end; }
158
+
156
159
  .ft-resize-handle {
157
160
  position: absolute;
158
161
  right: 0; top: 0; bottom: 0;
@@ -1535,7 +1538,7 @@ async function xe(e) {
1535
1538
  };
1536
1539
  }
1537
1540
  //#endregion
1538
- //#region \0@oxc-project+runtime@0.143.0/helpers/esm/decorate.js
1541
+ //#region \0@oxc-project+runtime@0.146.0/helpers/esm/decorate.js
1539
1542
  function q(e, t, n, r) {
1540
1543
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
1541
1544
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
@@ -2793,7 +2796,9 @@ var J = {
2793
2796
  let i = e.sortable !== !1, a = this._sortCriteria.find((t) => t.key === e.key), o = this._sortCriteria.length > 1 ? this._sortCriteria.findIndex((t) => t.key === e.key) : -1, s = this._filters.some((t) => t.key === e.key), c = e.pinned === "left", l = e.pinned === "right", u = [
2794
2797
  "ft-header-cell",
2795
2798
  i ? "ft-sortable" : "",
2796
- c || l ? "ft-pinned" : ""
2799
+ c || l ? "ft-pinned" : "",
2800
+ e.headerAlign === "center" ? "ft-header-align-center" : "",
2801
+ e.headerAlign === "end" ? "ft-header-align-end" : ""
2797
2802
  ].filter(Boolean).join(" "), d = i ? a ? a.direction === "asc" ? "ascending" : "descending" : "none" : void 0, f = this._getColWidth(e), p = this.headerHeight, m = this._colLeftOffsets[t] ?? 0, h;
2798
2803
  h = c ? `position: absolute; top: 0; left: ${this._scrollLeft + this._getPinnedLeft(t)}px; width: ${f}px; height: ${p}px; z-index: 4;` : l ? `position: absolute; top: 0; right: ${-this._scrollLeft + this._getPinnedRight(t)}px; width: ${f}px; height: ${p}px; z-index: 4;` : `left: ${m}px; width: ${f}px; height: ${p}px;`;
2799
2804
  let g = this._colDrag?.active && this._colDrag.colIndex === t, _ = [...u.split(" "), g ? "ft-col-dragging" : ""].filter(Boolean).join(" "), v = this.columns, y = v.findIndex((t) => t.key === e.key), b = [];
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r, t as i } from "./flex-table-DZFtW02v.js";
1
+ import { a as e, i as t, n, r, t as i } from "./flex-table-BSxnKOL3.js";
2
2
  export { i as FlexTable, t as RowSelectionState, r as UndoStack, n as exportData, e as renderCell };
@@ -59,6 +59,13 @@ export interface ColumnDefinition<T = DataRow> {
59
59
  hidden?: boolean;
60
60
  /** Whether the column is sortable (default: true) */
61
61
  sortable?: boolean;
62
+ /**
63
+ * Horizontal alignment of the header label (default: 'start').
64
+ * Independent of cell content alignment — a consumer centering cell content
65
+ * via a custom `renderer` (e.g. an icon-only action column) sets this to
66
+ * 'center' so the header visually matches.
67
+ */
68
+ headerAlign?: 'start' | 'center' | 'end';
62
69
  /** Custom cell renderer — overrides built-in type rendering */
63
70
  renderer?: CellRenderer<T>;
64
71
  /** Whether the column is editable (default: true — follows global editable setting) */
package/dist/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./flex-table-DZFtW02v.js";
1
+ import { t as e } from "./flex-table-BSxnKOL3.js";
2
2
  import t from "react";
3
3
  import { createComponent as n } from "@lit/react";
4
4
  var r = n({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iyulab/flex-table",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "A minimalist, input-centric data grid web component",
5
5
  "type": "module",
6
6
  "main": "./dist/flex-table.js",