@iyulab/flex-table 0.27.0 → 0.28.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 +15 -0
- package/README.md +3 -0
- package/dist/{flex-table-CeT8zkEi.js → flex-table-BQvkNkCu.js} +7 -4
- package/dist/flex-table.d.ts +11 -0
- package/dist/flex-table.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.28.0] - 2026-08-23
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **`stylesheets: CSSStyleSheet[]`** — constructable stylesheets adopted into the grid's shadow
|
|
8
|
+
root alongside its own styles. A `ColumnDefinition.renderer` returns content that's inserted
|
|
9
|
+
inside `<flex-table>`'s shadow root, so a class-based utility from the host document's CSS
|
|
10
|
+
(`.is-xs`, a design-system size variant, anything selector-based rather than a CSS custom
|
|
11
|
+
property) never reaches it — the class attaches but no rule matches, since document stylesheets
|
|
12
|
+
don't cross the shadow boundary. Passing the same `CSSStyleSheet` the host document already
|
|
13
|
+
uses (`document.adoptedStyleSheets`) into this new property closes that gap without copying
|
|
14
|
+
CSS or reaching into internals. Reassigning `stylesheets` swaps the previously-adopted sheets
|
|
15
|
+
for the new ones — it doesn't accumulate — and the grid's own styles are never affected either
|
|
16
|
+
way.
|
|
17
|
+
|
|
3
18
|
## [0.27.0] - 2026-08-23
|
|
4
19
|
|
|
5
20
|
### Added
|
package/README.md
CHANGED
|
@@ -84,6 +84,9 @@ npm install @iyulab/flex-table
|
|
|
84
84
|
| `selectionMode` | `selection-mode` | `'single' \| 'multi'` | `'multi'` | Row selection mode |
|
|
85
85
|
| `dataMode` | `data-mode` | `'client' \| 'server'` | `'client'` | Client-side or server-side data processing |
|
|
86
86
|
| `footerData` | `footer-data` | `Record<string, string>` | `null` | Footer/summary row data (keys match column keys) |
|
|
87
|
+
| `emptyMessage` | `empty-message` | `string` | `'No data'` | Shown when `data` is empty |
|
|
88
|
+
| `noMatchingMessage` | `no-matching-message` | `string` | `'No matching data'` | Shown when `data` has rows but every one is hidden by an active column filter |
|
|
89
|
+
| `stylesheets` | — | `CSSStyleSheet[]` | `[]` | Constructable stylesheets adopted into the shadow root alongside the grid's own styles — the escape hatch for styling content a `renderer` inserts, since document CSS doesn't cross the shadow boundary. Reassigning swaps the previous set, it doesn't accumulate |
|
|
87
90
|
|
|
88
91
|
### Read-only Properties
|
|
89
92
|
|
|
@@ -1564,7 +1564,7 @@ var J = {
|
|
|
1564
1564
|
lte: "≤"
|
|
1565
1565
|
}, Y = 120, X = 40, Z = 32, Q = 5, $ = class extends e {
|
|
1566
1566
|
constructor(...e) {
|
|
1567
|
-
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss = Z, this.showRowNumbers = !1, this.theme = void 0, this.maxRows = 0, this.editable = !0, this.showFilters = !1, this.showContextMenu = !1, this.frozenRows = 0, this.emptyMessage = "No data", this.noMatchingMessage = "No matching data", this.loading = !1, this.importEnabled = !1, this.selectable = !1, this.dataMode = "client", this.footerData = null, this._scrollTop = 0, this._scrollLeft = 0, this._viewportHeight = 0, this._viewportWidth = 0, this._colLeftOffsets = [], this._totalRowWidth = 0, this._activeCell = null, this._editingCell = null, this._sortCriteria = [], this._selection = new y(), this._editing = new b(), this._rowSelection = new x(), this._undo = new D(), this._filters = [], this._filteredIndices = [], this._sortedIndices = [], this._openFilterKey = null, this._rowSelectionVersion = 0, this._lastCheckboxRowIndex = null, this._checkboxShiftPending = !1, this._autocompleteState = null, this._headerMenu = null, this._bodyContextMenu = null, this._commentPopup = null, this._viewDirty = !0, this._isDragging = !1, this._wasDrag = !1, this._resizing = null, this._resizeCleanup = null, this._colDrag = null, this._colDragIndicatorLeft = null, this._fillDrag = null, this._rowDrag = null, this._rowDragIndicatorY = null, this._findState = null, this._columnWidths = /* @__PURE__ */ new Map(), this._hostResizeObserver = null, this._comments = /* @__PURE__ */ new Map(), this._isDragOver = !1, this._onCommentPopupOutsideClick = () => {
|
|
1567
|
+
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss = Z, this.showRowNumbers = !1, this.theme = void 0, this.maxRows = 0, this.editable = !0, this.showFilters = !1, this.showContextMenu = !1, this.frozenRows = 0, this.emptyMessage = "No data", this.noMatchingMessage = "No matching data", this.loading = !1, this.importEnabled = !1, this.selectable = !1, this.dataMode = "client", this.footerData = null, this.stylesheets = [], this._scrollTop = 0, this._scrollLeft = 0, this._viewportHeight = 0, this._viewportWidth = 0, this._colLeftOffsets = [], this._totalRowWidth = 0, this._baseStyleSheets = [], this._activeCell = null, this._editingCell = null, this._sortCriteria = [], this._selection = new y(), this._editing = new b(), this._rowSelection = new x(), this._undo = new D(), this._filters = [], this._filteredIndices = [], this._sortedIndices = [], this._openFilterKey = null, this._rowSelectionVersion = 0, this._lastCheckboxRowIndex = null, this._checkboxShiftPending = !1, this._autocompleteState = null, this._headerMenu = null, this._bodyContextMenu = null, this._commentPopup = null, this._viewDirty = !0, this._isDragging = !1, this._wasDrag = !1, this._resizing = null, this._resizeCleanup = null, this._colDrag = null, this._colDragIndicatorLeft = null, this._fillDrag = null, this._rowDrag = null, this._rowDragIndicatorY = null, this._findState = null, this._columnWidths = /* @__PURE__ */ new Map(), this._hostResizeObserver = null, this._comments = /* @__PURE__ */ new Map(), this._isDragOver = !1, this._onCommentPopupOutsideClick = () => {
|
|
1568
1568
|
this._commitCommentPopup();
|
|
1569
1569
|
}, this._invalidCells = /* @__PURE__ */ new Map(), this._textFilterState = /* @__PURE__ */ new Map(), this._numberFilterState = /* @__PURE__ */ new Map(), this._dateFilterState = /* @__PURE__ */ new Map(), this._emptyFilterState = /* @__PURE__ */ new Map();
|
|
1570
1570
|
}
|
|
@@ -2115,7 +2115,10 @@ var J = {
|
|
|
2115
2115
|
super.disconnectedCallback(), this.removeEventListener("scroll", this._onScroll), this.removeEventListener("keydown", this._onKeyDown), 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);
|
|
2116
2116
|
}
|
|
2117
2117
|
firstUpdated() {
|
|
2118
|
-
this._readDensityTokens(), this._measureViewport();
|
|
2118
|
+
this._readDensityTokens(), this._measureViewport(), this.shadowRoot && Array.isArray(this.shadowRoot.adoptedStyleSheets) && (this._baseStyleSheets = [...this.shadowRoot.adoptedStyleSheets]), this._syncStylesheets();
|
|
2119
|
+
}
|
|
2120
|
+
_syncStylesheets() {
|
|
2121
|
+
!this.shadowRoot || !Array.isArray(this.shadowRoot.adoptedStyleSheets) || (this.shadowRoot.adoptedStyleSheets = [...this._baseStyleSheets, ...this.stylesheets]);
|
|
2119
2122
|
}
|
|
2120
2123
|
_readDensityTokens() {
|
|
2121
2124
|
let e = getComputedStyle(this).getPropertyValue("--ft-row-height").trim();
|
|
@@ -2161,7 +2164,7 @@ var J = {
|
|
|
2161
2164
|
(!(e.size <= 2 && !e.has("data") && !e.has("columns") && !e.has("_openFilterKey") && !e.has("_editingCell") && !e.has("_activeCell") && (e.has("_scrollTop") || e.has("_scrollLeft"))) || this._viewDirty) && (this._recomputeView(), this._viewDirty = !1), this._updateColOffsets(), this._selection.setDimensions(this._visibleRowCount, this.visibleColumns.length), this._rowSelection.setRowCount(this._visibleRowCount);
|
|
2162
2165
|
}
|
|
2163
2166
|
updated(e) {
|
|
2164
|
-
this._focusEditor(), this._adjustFilterDropdown();
|
|
2167
|
+
this._focusEditor(), this._adjustFilterDropdown(), e.has("stylesheets") && this._syncStylesheets();
|
|
2165
2168
|
let t = String(this._visibleRowCount), n = String(this.visibleColumns.length);
|
|
2166
2169
|
if (this.getAttribute("aria-rowcount") !== t && this.setAttribute("aria-rowcount", t), this.getAttribute("aria-colcount") !== n && this.setAttribute("aria-colcount", n), this.loading ? this.getAttribute("aria-busy") !== "true" && this.setAttribute("aria-busy", "true") : this.hasAttribute("aria-busy") && this.removeAttribute("aria-busy"), e.has("_commentPopup") && this._commentPopup) {
|
|
2167
2170
|
let e = this.shadowRoot?.querySelector(".ft-comment-popup textarea");
|
|
@@ -4096,7 +4099,7 @@ q([a({ type: Array })], $.prototype, "columns", void 0), q([a({
|
|
|
4096
4099
|
})], $.prototype, "dataMode", void 0), q([a({
|
|
4097
4100
|
type: Object,
|
|
4098
4101
|
attribute: "footer-data"
|
|
4099
|
-
})], $.prototype, "footerData", void 0), q([a({
|
|
4102
|
+
})], $.prototype, "footerData", void 0), q([a({ attribute: !1 })], $.prototype, "stylesheets", void 0), q([a({
|
|
4100
4103
|
type: Number,
|
|
4101
4104
|
attribute: "max-undo-size"
|
|
4102
4105
|
})], $.prototype, "maxUndoSize", null), q([o()], $.prototype, "_scrollTop", void 0), q([o()], $.prototype, "_scrollLeft", void 0), q([o()], $.prototype, "_viewportHeight", void 0), q([o()], $.prototype, "_viewportWidth", void 0), q([o()], $.prototype, "_activeCell", void 0), q([o()], $.prototype, "_editingCell", void 0), q([o()], $.prototype, "_sortCriteria", void 0), q([o()], $.prototype, "_openFilterKey", void 0), q([o()], $.prototype, "_rowSelectionVersion", void 0), q([o()], $.prototype, "_autocompleteState", void 0), q([o()], $.prototype, "_headerMenu", void 0), q([o()], $.prototype, "_bodyContextMenu", void 0), q([o()], $.prototype, "_commentPopup", void 0), q([o()], $.prototype, "_isDragOver", void 0), $ = q([i("flex-table")], $);
|
package/dist/flex-table.d.ts
CHANGED
|
@@ -85,6 +85,14 @@ export declare class FlexTable extends LitElement {
|
|
|
85
85
|
dataMode: DataMode;
|
|
86
86
|
/** Footer/summary row data. Keys match column keys; values are display strings. */
|
|
87
87
|
footerData: Record<string, string | TemplateResult> | null;
|
|
88
|
+
/**
|
|
89
|
+
* Constructable stylesheets adopted into this element's shadow root, in addition to the
|
|
90
|
+
* grid's own styles. Cell renderers run inside the shadow root, so external document
|
|
91
|
+
* stylesheets (class-based utilities, design-system CSS) don't reach elements a `renderer`
|
|
92
|
+
* returns — this is the escape hatch for that. Not an attribute (a `CSSStyleSheet` can't be
|
|
93
|
+
* serialized to one) — set it as a property.
|
|
94
|
+
*/
|
|
95
|
+
stylesheets: CSSStyleSheet[];
|
|
88
96
|
set maxUndoSize(value: number);
|
|
89
97
|
get maxUndoSize(): number;
|
|
90
98
|
private _scrollTop;
|
|
@@ -93,6 +101,8 @@ export declare class FlexTable extends LitElement {
|
|
|
93
101
|
private _viewportWidth;
|
|
94
102
|
private _colLeftOffsets;
|
|
95
103
|
private _totalRowWidth;
|
|
104
|
+
/** The grid's own compiled styles, captured once so `stylesheets` merges without dropping them. */
|
|
105
|
+
private _baseStyleSheets;
|
|
96
106
|
private _activeCell;
|
|
97
107
|
private _editingCell;
|
|
98
108
|
private _sortCriteria;
|
|
@@ -294,6 +304,7 @@ export declare class FlexTable extends LitElement {
|
|
|
294
304
|
connectedCallback(): void;
|
|
295
305
|
disconnectedCallback(): void;
|
|
296
306
|
protected firstUpdated(): void;
|
|
307
|
+
private _syncStylesheets;
|
|
297
308
|
/**
|
|
298
309
|
* `--ft-row-height` 를 판독해 가상화 계산에 넣는다.
|
|
299
310
|
*
|
package/dist/flex-table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./flex-table-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./flex-table-BQvkNkCu.js";
|
|
2
2
|
export { i as FlexTable, t as RowSelectionState, r as UndoStack, n as exportData, e as renderCell };
|
package/dist/react.js
CHANGED