@gridengine/angular-datagrid-enterprise 0.9.0 → 0.11.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColDef } from '@gridengine/angular-datagrid';
|
|
2
2
|
export * from '@gridengine/angular-datagrid';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
|
-
import { EnvironmentProviders, OnDestroy } from '@angular/core';
|
|
4
|
+
import { EnvironmentProviders, Signal, OnDestroy } from '@angular/core';
|
|
5
5
|
import { LicenseValidationResult, LicenseTier } from '@gridengine/license-core';
|
|
6
6
|
export { LicensePayload, LicenseStatus, LicenseTier, LicenseValidationResult, SupportLevel, TIER_FEATURES } from '@gridengine/license-core';
|
|
7
7
|
|
|
@@ -447,6 +447,62 @@ declare class TransactionEngine {
|
|
|
447
447
|
private _buildDelta;
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
/**
|
|
451
|
+
* TransactionController — a reactive (signals) wrapper around `TransactionEngine`
|
|
452
|
+
* for the open-source `<gd-data-grid>`. Bind `displayRows()` to `[rowData]` and
|
|
453
|
+
* pipe `(cellValueChanged)` into `onCellValueChanged` to stage inline edits
|
|
454
|
+
* without mutating the base data; then `commit()` / `rollback()`:
|
|
455
|
+
*
|
|
456
|
+
* ```html
|
|
457
|
+
* <gd-data-grid [rowData]="txn.displayRows()" [columnDefs]="cols" [getRowId]="byId"
|
|
458
|
+
* (cellValueChanged)="txn.onCellValueChanged($event)" />
|
|
459
|
+
* <button [disabled]="!txn.isDirty()" (click)="txn.commit()">Save</button>
|
|
460
|
+
* ```
|
|
461
|
+
*
|
|
462
|
+
* `displayRows()` returns shallow clones, so the grid's in-place cell edits
|
|
463
|
+
* change the copy while the base stays clean (rollback restores it). Use a
|
|
464
|
+
* field-based `getRowId` so row identity survives cloning.
|
|
465
|
+
*/
|
|
466
|
+
|
|
467
|
+
interface TransactionControllerOptions {
|
|
468
|
+
/** Field used as the unique row ID. Default: 'id' */
|
|
469
|
+
rowIdField?: string;
|
|
470
|
+
onCommit?: (delta: TransactionDelta) => void;
|
|
471
|
+
onRollback?: () => void;
|
|
472
|
+
}
|
|
473
|
+
/** Minimal shape of the grid's cellValueChanged event this controller needs. */
|
|
474
|
+
interface CellValueChange<TData> {
|
|
475
|
+
row: TData;
|
|
476
|
+
field?: string;
|
|
477
|
+
newValue: unknown;
|
|
478
|
+
}
|
|
479
|
+
declare class TransactionController<TData extends GridRow = GridRow> {
|
|
480
|
+
private readonly _engine;
|
|
481
|
+
private readonly _rowIdField;
|
|
482
|
+
private readonly _version;
|
|
483
|
+
/** The current merged rows (base + staged changes) as shallow clones. */
|
|
484
|
+
readonly displayRows: Signal<TData[]>;
|
|
485
|
+
/** Whether there are uncommitted staged changes. */
|
|
486
|
+
readonly isDirty: Signal<boolean>;
|
|
487
|
+
constructor(initialRows: TData[], options?: TransactionControllerOptions);
|
|
488
|
+
/** Stage an inline edit emitted by the grid's `(cellValueChanged)`. */
|
|
489
|
+
onCellValueChanged(event: CellValueChange<TData>): void;
|
|
490
|
+
addRows(rows: TData[]): void;
|
|
491
|
+
updateRows(rows: TData[]): void;
|
|
492
|
+
removeRows(ids: (string | number)[]): void;
|
|
493
|
+
/** All current staged changes, grouped by kind. */
|
|
494
|
+
getDirtyRows(): {
|
|
495
|
+
added: GridRow[];
|
|
496
|
+
updated: GridRow[];
|
|
497
|
+
removed: GridRow[];
|
|
498
|
+
};
|
|
499
|
+
commit(): void;
|
|
500
|
+
rollback(): void;
|
|
501
|
+
/** Replace the base rows (e.g. after a server refresh); staged changes are kept. */
|
|
502
|
+
resetRows(rows: TData[]): void;
|
|
503
|
+
private _bump;
|
|
504
|
+
}
|
|
505
|
+
|
|
450
506
|
/**
|
|
451
507
|
* MasterDetailEngine — manages expand/collapse state and lazy-loaded, cached
|
|
452
508
|
* detail data for master rows. Pure logic. Detail data is fetched once per row
|
|
@@ -992,9 +1048,19 @@ declare function applyCellPermissions<TData>(columnDefs: ColDef<TData>[], engine
|
|
|
992
1048
|
*/
|
|
993
1049
|
declare function toPdfColumns<TData>(columnDefs: ColDef<TData>[]): PdfColumn[];
|
|
994
1050
|
|
|
1051
|
+
/** Payload emitted on paste: the parsed matrix anchored at the selection top-left. */
|
|
1052
|
+
interface RangePasteEvent {
|
|
1053
|
+
startRow: number;
|
|
1054
|
+
startCol: number;
|
|
1055
|
+
data: string[][];
|
|
1056
|
+
}
|
|
995
1057
|
declare class RangeSelectionDirective implements OnDestroy {
|
|
996
1058
|
/** Emits the copied cell matrix (rows × cols of displayed text) on Ctrl/Cmd+C. */
|
|
997
1059
|
readonly rangeCopy: _angular_core.OutputEmitterRef<string[][]>;
|
|
1060
|
+
/** Emits the parsed clipboard matrix on Ctrl/Cmd+V for the consumer to write back. */
|
|
1061
|
+
readonly rangePaste: _angular_core.OutputEmitterRef<RangePasteEvent>;
|
|
1062
|
+
/** Emits the selected range on Delete/Backspace for the consumer to clear. */
|
|
1063
|
+
readonly rangeClear: _angular_core.OutputEmitterRef<CellRange>;
|
|
998
1064
|
private readonly _host;
|
|
999
1065
|
private readonly _doc;
|
|
1000
1066
|
private readonly _engine;
|
|
@@ -1011,10 +1077,12 @@ declare class RangeSelectionDirective implements OnDestroy {
|
|
|
1011
1077
|
private _cellPosFromCell;
|
|
1012
1078
|
private _paint;
|
|
1013
1079
|
private _copy;
|
|
1080
|
+
private _paste;
|
|
1081
|
+
private _clear;
|
|
1014
1082
|
private _ensureStyles;
|
|
1015
1083
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RangeSelectionDirective, never>;
|
|
1016
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RangeSelectionDirective, "[gdRangeSelection]", never, {}, { "rangeCopy": "rangeCopy"; }, never, never, true, never>;
|
|
1084
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RangeSelectionDirective, "[gdRangeSelection]", never, {}, { "rangeCopy": "rangeCopy"; "rangePaste": "rangePaste"; "rangeClear": "rangeClear"; }, never, never, true, never>;
|
|
1017
1085
|
}
|
|
1018
1086
|
|
|
1019
|
-
export { AuditTrailEngine, CellPermissionEngine, ClipboardEngine, DEFAULT_MASK, DataGridPro, ExcelImportEngine, FillHandleEngine, FilterPresetEngine, FormEditorEngine, FormulaEngine, GridLicenseWatermark, LicenseManager, MasterDetailEngine, PDFExportEngine, PRODUCT_ID, PURCHASE_URL, RangeSelectionDirective, RangeSelectionEngine, RowLockEngine, SSRMEngine, SavedViewsEngine, TransactionEngine, UndoRedoManager, applyCellPermissions, deserializeFilter, evaluateFilter, parseCSV, parseTSV, provideGridEngineLicense, serializeFilter, toNumber, toPdfColumns, toTimestamp };
|
|
1020
|
-
export type { AuditEntry, AuditTrailEngineOptions, Block, BlockState, CellEditCommand, CellPermission, CellPermissionEngineOptions, CellRange, ClipboardEngineOptions, DeleteCommand, DetailEntry, DetailLoadState, ExcelImportEngineOptions, FillCell, FillCommand, FillDirection, FillHandleEngineOptions, FillResult, FilterCondition, FilterGroup, FilterNode, FilterOperator, FilterPreset, FilterPresetEngineOptions, FormEditorEngineOptions, FormulaEngineOptions, GridRow, ImportColumn, ImportColumnType, ImportPreview, ImportValidationError, LockedRow, MasterDetailEngineOptions, PDFExportEngineOptions, PasteCommand, PdfColumn, PdfDocumentModel, PdfExportOptions, PdfPage, PdfPageFooter, PdfPageHeader, RangeSelectionEngineOptions, RowLockEngineOptions, SSRMDataSource, SSRMEngineOptions, SSRMGetRowsParams, SSRMGetRowsResult, SavedView, SavedViewsEngineOptions, TransactionDelta, TransactionEngineOptions, UndoRedoCommand, UndoRedoManagerOptions };
|
|
1087
|
+
export { AuditTrailEngine, CellPermissionEngine, ClipboardEngine, DEFAULT_MASK, DataGridPro, ExcelImportEngine, FillHandleEngine, FilterPresetEngine, FormEditorEngine, FormulaEngine, GridLicenseWatermark, LicenseManager, MasterDetailEngine, PDFExportEngine, PRODUCT_ID, PURCHASE_URL, RangeSelectionDirective, RangeSelectionEngine, RowLockEngine, SSRMEngine, SavedViewsEngine, TransactionController, TransactionEngine, UndoRedoManager, applyCellPermissions, deserializeFilter, evaluateFilter, parseCSV, parseTSV, provideGridEngineLicense, serializeFilter, toNumber, toPdfColumns, toTimestamp };
|
|
1088
|
+
export type { AuditEntry, AuditTrailEngineOptions, Block, BlockState, CellEditCommand, CellPermission, CellPermissionEngineOptions, CellRange, CellValueChange, ClipboardEngineOptions, DeleteCommand, DetailEntry, DetailLoadState, ExcelImportEngineOptions, FillCell, FillCommand, FillDirection, FillHandleEngineOptions, FillResult, FilterCondition, FilterGroup, FilterNode, FilterOperator, FilterPreset, FilterPresetEngineOptions, FormEditorEngineOptions, FormulaEngineOptions, GridRow, ImportColumn, ImportColumnType, ImportPreview, ImportValidationError, LockedRow, MasterDetailEngineOptions, PDFExportEngineOptions, PasteCommand, PdfColumn, PdfDocumentModel, PdfExportOptions, PdfPage, PdfPageFooter, PdfPageHeader, RangePasteEvent, RangeSelectionEngineOptions, RowLockEngineOptions, SSRMDataSource, SSRMEngineOptions, SSRMGetRowsParams, SSRMGetRowsResult, SavedView, SavedViewsEngineOptions, TransactionControllerOptions, TransactionDelta, TransactionEngineOptions, UndoRedoCommand, UndoRedoManagerOptions };
|