@keenmate/web-grid 1.0.3 → 1.0.4
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/README.md +6 -3
- package/ai/basic-setup.txt +1 -0
- package/ai/editing.txt +21 -0
- package/ai/public-methods.txt +6 -0
- package/ai/styling-theming.txt +3 -0
- package/dist/grid.d.ts +11 -0
- package/dist/types.d.ts +1 -0
- package/dist/web-component.d.ts +4 -0
- package/dist/web-grid.js +411 -375
- package/dist/web-grid.umd.js +35 -35
- package/package.json +1 -1
- package/src/css/_dark-mode.css +5 -0
- package/src/css/_dirty-indicator.css +37 -0
- package/src/css/_variables.css +8 -0
- package/src/css/main.css +9 -8
package/README.md
CHANGED
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
A feature-rich, framework-agnostic data grid web component built with TypeScript. Sorting, filtering, pagination, inline editing (8 editor types), cell range selection, clipboard support, row toolbar, context menus, frozen columns, column reorder/resize, fill handle, virtual scroll, dark mode, and full CSS variable theming — all in a Shadow DOM encapsulated `<web-grid>` element.
|
|
4
4
|
|
|
5
|
-
## What's New in v1.0.
|
|
5
|
+
## What's New in v1.0.4
|
|
6
|
+
|
|
7
|
+
- **Dirty cell/row indicator**: New `isDirtyIndicatorVisible` property (default: `true`). Edited cells show a subtle orange tint + corner triangle; row numbers get an orange left border. Themable via `--wg-dirty-*` variables. Public methods: `isCellDirty()`, `isRowDirty()`.
|
|
8
|
+
- **Dropdown positioning fix**: Fixed dropdown editors appearing offset in shadow DOM by switching from `position: fixed` to `position: absolute`.
|
|
9
|
+
|
|
10
|
+
### v1.0.3
|
|
6
11
|
|
|
7
12
|
- **`onrowfocus` fixes**: No longer fires during cell range selection (drag/shift+click). Mouse-triggered row focus now defers to click (mouseup) instead of mousedown; keyboard navigation still fires immediately.
|
|
8
13
|
- **Cell selection visual fix**: Focused cell outline no longer persists during cell range drag.
|
|
9
14
|
- **Toolbar fixes**: Tooltip hides when toolbar moves/closes. Selections cleared on toolbar action click. `triggerElement` in `ontoolbarclick` detail stays alive (no longer detached by synchronous re-render).
|
|
10
15
|
- **Z-index layer system**: All z-index values now use CSS custom properties (`--wg-z-header`, `--wg-z-frozen`, etc.). Fixes cell selection bleeding through sticky header and frozen header stacking.
|
|
11
|
-
- **Logging system**: loglevel-based logging with 4 categories (`GRID:INIT`, `GRID:DATA`, `GRID:UI`, `GRID:INTERACTION`). Enable via `window.components['web-grid'].logging.enableLogging()`.
|
|
12
|
-
- **Runtime API**: `window.components['web-grid']` with `version()`, `config`, and `logging` — matching web-multiselect and web-daterangepicker.
|
|
13
16
|
|
|
14
17
|
### v1.0.2
|
|
15
18
|
|
package/ai/basic-setup.txt
CHANGED
|
@@ -89,6 +89,7 @@ page-size pageSize number 10 Rows per pa
|
|
|
89
89
|
is-editable isEditable boolean false Enable cell editing
|
|
90
90
|
edit-trigger editTrigger string 'dblclick' How editing starts (see below)
|
|
91
91
|
is-row-numbers-visible isRowNumbersVisible boolean false Show row number column
|
|
92
|
+
isDirtyIndicatorVisible boolean true Show dirty indicator on edited cells
|
|
92
93
|
mode mode string (none) Grid mode (see below)
|
|
93
94
|
is-scrollable isScrollable boolean false Enable scroll container
|
|
94
95
|
freeze-columns freezeColumns number 0 Freeze first N columns
|
package/ai/editing.txt
CHANGED
|
@@ -427,6 +427,27 @@ Draft behavior:
|
|
|
427
427
|
- The onrowchange callback includes both row (original) and draftRow (with
|
|
428
428
|
changes) so the consumer can compare.
|
|
429
429
|
|
|
430
|
+
Dirty indicator:
|
|
431
|
+
grid.isDirtyIndicatorVisible (boolean, default: true)
|
|
432
|
+
When enabled, edited cells show a subtle orange background tint and a small
|
|
433
|
+
corner triangle. Row numbers show an orange left border when any cell in
|
|
434
|
+
the row has been modified.
|
|
435
|
+
|
|
436
|
+
grid.isCellDirty(rowIndex, field) -- Returns true if the cell's draft value
|
|
437
|
+
differs from the original.
|
|
438
|
+
grid.isRowDirty(rowIndex) -- Returns true if any cell in the row
|
|
439
|
+
has been modified (draft exists).
|
|
440
|
+
|
|
441
|
+
CSS variables for theming:
|
|
442
|
+
--wg-dirty-indicator-color (default: #ed8b00)
|
|
443
|
+
--wg-dirty-indicator-size (default: 6px)
|
|
444
|
+
--wg-dirty-cell-bg (default: rgba(237, 139, 0, 0.08))
|
|
445
|
+
--wg-dirty-row-number-border-color (default: #ed8b00)
|
|
446
|
+
|
|
447
|
+
CSS classes applied:
|
|
448
|
+
.wg__cell--dirty -- on dirty data cells
|
|
449
|
+
.wg__row-number--dirty -- on row number cells of dirty rows
|
|
450
|
+
|
|
430
451
|
|
|
431
452
|
EVENTS (CALLBACKS)
|
|
432
453
|
------------------
|
package/ai/public-methods.txt
CHANGED
|
@@ -53,6 +53,12 @@ discardAllDrafts(): void
|
|
|
53
53
|
Discard all draft changes across all rows. Reverts every edited cell
|
|
54
54
|
to its original value.
|
|
55
55
|
|
|
56
|
+
isCellDirty(rowIndex: number, field: string): boolean
|
|
57
|
+
Check if a specific cell has been modified (draft value differs from original).
|
|
58
|
+
|
|
59
|
+
isRowDirty(rowIndex: number): boolean
|
|
60
|
+
Check if any cell in a row has been modified (draft exists for that row).
|
|
61
|
+
|
|
56
62
|
|
|
57
63
|
----------------------------------------------------------------------
|
|
58
64
|
VALIDATION
|
package/ai/styling-theming.txt
CHANGED
|
@@ -115,6 +115,9 @@ All four methods apply the same dark palette overrides:
|
|
|
115
115
|
--wg-hover-bg: #3a3a3a
|
|
116
116
|
--wg-danger-color: #f87c86
|
|
117
117
|
--wg-danger-bg-light: #442726
|
|
118
|
+
--wg-dirty-indicator-color: #ffa940
|
|
119
|
+
--wg-dirty-cell-bg: rgba(255, 169, 64, 0.12)
|
|
120
|
+
--wg-dirty-row-number-border-color: #ffa940
|
|
118
121
|
|
|
119
122
|
The attribute can be on the <web-grid> element itself or any ancestor:
|
|
120
123
|
|
package/dist/grid.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare class WebGrid<T = unknown> {
|
|
|
28
28
|
protected _isStickyRowNumbers: boolean;
|
|
29
29
|
protected _freezeColumns: number;
|
|
30
30
|
protected _invalidCells: CellValidationState[];
|
|
31
|
+
protected _isDirtyIndicatorVisible: boolean;
|
|
31
32
|
protected _isRowToolbarVisible: boolean;
|
|
32
33
|
protected _rowToolbar: RowToolbarConfig<T>[];
|
|
33
34
|
protected _toolbarVerticalAlign: 'top' | 'center' | 'bottom';
|
|
@@ -200,6 +201,8 @@ export declare class WebGrid<T = unknown> {
|
|
|
200
201
|
set isCheckboxAlwaysEditable(value: boolean);
|
|
201
202
|
get isRowNumbersVisible(): boolean;
|
|
202
203
|
set isRowNumbersVisible(value: boolean);
|
|
204
|
+
get isDirtyIndicatorVisible(): boolean;
|
|
205
|
+
set isDirtyIndicatorVisible(value: boolean);
|
|
203
206
|
get isStickyRowNumbers(): boolean;
|
|
204
207
|
set isStickyRowNumbers(value: boolean);
|
|
205
208
|
get freezeColumns(): number;
|
|
@@ -544,6 +547,14 @@ export declare class WebGrid<T = unknown> {
|
|
|
544
547
|
protected requestUpdate(): void;
|
|
545
548
|
getRowDraft(rowIndex: number): T | undefined;
|
|
546
549
|
hasRowDraft(rowIndex: number): boolean;
|
|
550
|
+
/**
|
|
551
|
+
* Check if a specific cell has been modified (draft value differs from original)
|
|
552
|
+
*/
|
|
553
|
+
isCellDirty(rowIndex: number, field: string): boolean;
|
|
554
|
+
/**
|
|
555
|
+
* Check if any cell in a row has been modified
|
|
556
|
+
*/
|
|
557
|
+
isRowDirty(rowIndex: number): boolean;
|
|
547
558
|
discardRowDraft(rowIndex: number): void;
|
|
548
559
|
/**
|
|
549
560
|
* Discard draft value for a single cell (field)
|
package/dist/types.d.ts
CHANGED
package/dist/web-component.d.ts
CHANGED
|
@@ -113,6 +113,10 @@ export declare class GridElement<T = unknown> extends HTMLElement implements Gri
|
|
|
113
113
|
set isCheckboxAlwaysEditable(value: boolean);
|
|
114
114
|
get isRowNumbersVisible(): boolean;
|
|
115
115
|
set isRowNumbersVisible(value: boolean);
|
|
116
|
+
get isDirtyIndicatorVisible(): boolean;
|
|
117
|
+
set isDirtyIndicatorVisible(value: boolean);
|
|
118
|
+
isCellDirty(rowIndex: number, field: string): boolean;
|
|
119
|
+
isRowDirty(rowIndex: number): boolean;
|
|
116
120
|
get isStickyRowNumbers(): boolean;
|
|
117
121
|
set isStickyRowNumbers(value: boolean);
|
|
118
122
|
get freezeColumns(): number;
|