eru-grid 0.0.53 → 0.0.55
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/fesm2022/eru-grid.mjs +180 -54
- package/fesm2022/eru-grid.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eru-grid.d.ts +53 -3
package/package.json
CHANGED
package/types/eru-grid.d.ts
CHANGED
|
@@ -382,6 +382,7 @@ interface Field {
|
|
|
382
382
|
default_group?: boolean;
|
|
383
383
|
mapped_entity?: string;
|
|
384
384
|
mapped_field?: string;
|
|
385
|
+
label_overridden?: boolean;
|
|
385
386
|
tool_tip?: string;
|
|
386
387
|
description?: string;
|
|
387
388
|
default?: any;
|
|
@@ -481,6 +482,18 @@ declare const SELF_COLOURED_DATATYPES: ReadonlySet<string>;
|
|
|
481
482
|
*/
|
|
482
483
|
declare const ACTION_COLUMN_MIN_WIDTH = 56;
|
|
483
484
|
declare const SEEDED_FIELD_KEYS: readonly string[];
|
|
485
|
+
/**
|
|
486
|
+
* Keys the model seeds only until the design panel overrides them EXPLICITLY,
|
|
487
|
+
* tracked by a companion flag rather than by "does the column hold a value".
|
|
488
|
+
*
|
|
489
|
+
* `label` is the case that forced this: it is in SEEDED_FIELD_KEYS' spirit —
|
|
490
|
+
* the model's label is the default and a grid may shorten it — but a column
|
|
491
|
+
* never arrives without one, so the seeded test ("column already has a value,
|
|
492
|
+
* leave it alone") was true from the first render and the model's label never
|
|
493
|
+
* reached a mapped column. A query-derived column kept showing its raw result
|
|
494
|
+
* key as the heading.
|
|
495
|
+
*/
|
|
496
|
+
declare const EXPLICITLY_OVERRIDDEN_FIELD_KEYS: Readonly<Record<string, keyof Field>>;
|
|
484
497
|
type DataTypes = 'number' | 'textbox' | 'textarea' | 'currency' | 'date' | 'datetime' | 'duration' | 'time' | 'dropdown_single_select' | 'dropdown_multi_select' | 'location' | 'email' | 'people' | 'checkbox' | 'phone' | 'priority' | 'status' | 'progress' | 'attachment' | 'tag' | 'rating' | 'website' | 'composite' | 'page';
|
|
485
498
|
/** Resolve a data-model datatype to the canonical DataTypes value. */
|
|
486
499
|
declare function normalizeDatatype(datatype: any): DataTypes;
|
|
@@ -1470,6 +1483,11 @@ declare class EruGridStore {
|
|
|
1470
1483
|
private readonly _activeCell;
|
|
1471
1484
|
private readonly _pivotConfiguration;
|
|
1472
1485
|
private readonly _pivotResult;
|
|
1486
|
+
/**
|
|
1487
|
+
* Widths for generated pivot leaves that have no field to hold them.
|
|
1488
|
+
* Keyed by leaf name — see updateColumnWidth.
|
|
1489
|
+
*/
|
|
1490
|
+
private readonly _pivotLeafWidths;
|
|
1473
1491
|
private readonly _drilldown;
|
|
1474
1492
|
private readonly _actionClick;
|
|
1475
1493
|
private readonly _columnResize;
|
|
@@ -1529,6 +1547,7 @@ declare class EruGridStore {
|
|
|
1529
1547
|
readonly rowGrandTotal: _angular_core.Signal<RowGrandTotal | null>;
|
|
1530
1548
|
readonly pivotConfiguration: _angular_core.Signal<PivotConfiguration | null>;
|
|
1531
1549
|
readonly pivotResult: _angular_core.Signal<PivotResult | null>;
|
|
1550
|
+
readonly pivotLeafWidths: _angular_core.Signal<Map<string, number>>;
|
|
1532
1551
|
readonly drilldown: _angular_core.Signal<Drilldown | null>;
|
|
1533
1552
|
readonly actionClick: _angular_core.Signal<ActionClick | null>;
|
|
1534
1553
|
readonly columnResize: _angular_core.Signal<ColumnResize | null>;
|
|
@@ -1564,6 +1583,7 @@ declare class EruGridStore {
|
|
|
1564
1583
|
readonly isEditingEnabled: _angular_core.Signal<boolean>;
|
|
1565
1584
|
readonly displayColumns: _angular_core.Signal<Field[]>;
|
|
1566
1585
|
readonly displayData: _angular_core.Signal<PivotRow[] | Row[]>;
|
|
1586
|
+
private readonly frozenGrandTotalRow;
|
|
1567
1587
|
readonly pivotGrandTotalData: _angular_core.Signal<PivotRow[]>;
|
|
1568
1588
|
readonly pivotDisplayData: _angular_core.Signal<PivotRow[]>;
|
|
1569
1589
|
readonly tableDisplayData: _angular_core.Signal<Row[]>;
|
|
@@ -1669,6 +1689,19 @@ declare class EruGridStore {
|
|
|
1669
1689
|
setRows(rows: Row[]): void;
|
|
1670
1690
|
addRows(newRows: Row[]): void;
|
|
1671
1691
|
updateRow(rowId: string, updates: Partial<Row>): void;
|
|
1692
|
+
/**
|
|
1693
|
+
* Merge field values into the record with this id, wherever the grid is
|
|
1694
|
+
* holding it — the flat row list AND the per-group buckets a board fills.
|
|
1695
|
+
*
|
|
1696
|
+
* For a consumer that edits a record somewhere else on the page and needs the
|
|
1697
|
+
* grid to agree without refetching. `updateRow` is not enough on two counts:
|
|
1698
|
+
* it only looks at `_rows`, so a grouped/board grid keeps the stale copy, and
|
|
1699
|
+
* it replaces top-level row keys rather than merging into `entity_data`,
|
|
1700
|
+
* where an entity-backed row keeps its fields.
|
|
1701
|
+
*
|
|
1702
|
+
* Unknown ids are ignored, so a caller can announce a change blindly.
|
|
1703
|
+
*/
|
|
1704
|
+
patchRecord(entityId: string, fields: Record<string, any>): void;
|
|
1672
1705
|
selectRow(rowId: string): void;
|
|
1673
1706
|
/** Mark the single active board card (last clicked) for the selected-state highlight. */
|
|
1674
1707
|
setActiveBoardRow(row: any): void;
|
|
@@ -2170,7 +2203,6 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
2170
2203
|
* reference so it works for entity and query data alike. */
|
|
2171
2204
|
isBoardCardActive(row: Row): boolean;
|
|
2172
2205
|
initialMinHeight: number;
|
|
2173
|
-
initialTotalWidth: number;
|
|
2174
2206
|
viewport: CdkVirtualScrollViewport;
|
|
2175
2207
|
groupsViewport: CdkVirtualScrollViewport;
|
|
2176
2208
|
groupsScrollContainerEl?: ElementRef;
|
|
@@ -2266,6 +2298,19 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
2266
2298
|
* @param scrollIndex The current scroll index
|
|
2267
2299
|
*/
|
|
2268
2300
|
onPivotScroll(scrollIndex: number): void;
|
|
2301
|
+
/**
|
|
2302
|
+
* The sum of the rendered column widths — what every table in the grid is
|
|
2303
|
+
* forced to via `--table-total-width`.
|
|
2304
|
+
*
|
|
2305
|
+
* A signal, not a value captured at init. A resize writes the new width to
|
|
2306
|
+
* the column (or, in pivot mode, to the measure the leaf came from), and the
|
|
2307
|
+
* cells and `<col>`s follow it; a cached total does not, so the table stayed
|
|
2308
|
+
* at its old width while its columns changed underneath — leaving the header
|
|
2309
|
+
* and body tables wider or narrower than the columns they contain, and the
|
|
2310
|
+
* horizontal scroll range wrong. Pivot mode also changes its leaf SET as the
|
|
2311
|
+
* data changes, so even without a resize the total goes stale.
|
|
2312
|
+
*/
|
|
2313
|
+
readonly totalTableWidth: _angular_core.Signal<number>;
|
|
2269
2314
|
getTotalTableWidth(): number;
|
|
2270
2315
|
getMinHeightPx(): number;
|
|
2271
2316
|
adjustScrollWidth(): boolean;
|
|
@@ -2364,7 +2409,7 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
2364
2409
|
isAggregationHeader(column: Field): boolean;
|
|
2365
2410
|
trackByColumnFn(index: number, column: Field): string;
|
|
2366
2411
|
trackByGroupItemFn(index: number, groupItem: GroupItem): string;
|
|
2367
|
-
trackByPivotRowFn(index: number, pivotRow: PivotRow): string;
|
|
2412
|
+
trackByPivotRowFn(index: number, pivotRow: PivotRow | undefined): string;
|
|
2368
2413
|
trackByRowFn(index: number, row: any): string;
|
|
2369
2414
|
trackByGroupFn(index: number, group: RowGroup): string;
|
|
2370
2415
|
getRowsForGroup(groupId: string): Row[];
|
|
@@ -2466,6 +2511,11 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
2466
2511
|
* including an explicit `false` on a checkbox — wins from then on. Without the
|
|
2467
2512
|
* column in hand there is no way to tell "not set" from "set to the opposite",
|
|
2468
2513
|
* so an override was overwritten on every resolve.
|
|
2514
|
+
*
|
|
2515
|
+
* EXPLICITLY_OVERRIDDEN_FIELD_KEYS work the same way but ask a companion flag
|
|
2516
|
+
* instead, for keys a column always holds a value for — `label`, whose
|
|
2517
|
+
* "already set" was true from the first render, so the model's label never
|
|
2518
|
+
* won and a mapped column kept its raw result key as the heading.
|
|
2469
2519
|
*/
|
|
2470
2520
|
private buildMappedColumnPatch;
|
|
2471
2521
|
/** Get the field name used for grouping */
|
|
@@ -4012,5 +4062,5 @@ declare class ThemeToggleComponent {
|
|
|
4012
4062
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThemeToggleComponent, "eru-theme-toggle", never, {}, {}, never, never, true, never>;
|
|
4013
4063
|
}
|
|
4014
4064
|
|
|
4015
|
-
export { ACTION_COLUMN_MIN_WIDTH, AttachmentComponent, CELL_RULE_OPERATORS, CheckboxComponent, ChipListComponent, ColumnConstraintsService, CompositeComponent, CurrencyComponent, CustomVirtualScrollStrategy, DATA_TYPES, DATETIME_FORMATS, DATE_FORMATS, DateComponent, DatetimeComponent, DurationComponent, EmailComponent, EruGridComponent, EruGridService, EruGridStore, GRID_COLOR_TOKENS, INHERITED_FIELD_KEYS, LocationComponent, MATERIAL_MODULES, MATERIAL_PROVIDERS, MONTH_SHORT_NAMES, NumberComponent, NumericInputDirective, PRESENTATION_DATATYPES, PRESET_CONFIG_DEFAULTS, PRESET_MANAGED_FIELDS, PeopleComponent, PhoneComponent, PriorityComponent, ProgressComponent, RatingComponent, SEEDED_FIELD_KEYS, SELF_COLOURED_DATATYPES, SelectComponent, StatusComponent, TagComponent, TextareaComponent, TextboxComponent, ThemeService, ThemeToggleComponent, WebsiteComponent, abbreviateNumber, abbreviationScaleFor, cellRuleBarPercent, cellRuleMatches, cellRuleToCss, cellStatAlias, cellTextStyleToCss, collectColumnStatRequests, columnCellRules, composeColorValue, effectiveValueDatatype, evaluateRowCondition, formatCellValue, formatDateTimeWithPattern, formatDateWithPattern, formatNumberValue, hasOwnCellRules, matchCellRule, matchColorRange, normalizeCellRender, normalizeDatatype, normalizeDateFormat, normalizeDateTimeFormat, parseCellDate, parseCellDateTime, parseColorValue, parseDateWithPattern, readRowValue, resolveColumnRules, resolveRowValue, resolveStatValue, rowSelectionKey, statusPillColors, tagPillColors, toDateOnlyString, toDateTimeString };
|
|
4065
|
+
export { ACTION_COLUMN_MIN_WIDTH, AttachmentComponent, CELL_RULE_OPERATORS, CheckboxComponent, ChipListComponent, ColumnConstraintsService, CompositeComponent, CurrencyComponent, CustomVirtualScrollStrategy, DATA_TYPES, DATETIME_FORMATS, DATE_FORMATS, DateComponent, DatetimeComponent, DurationComponent, EXPLICITLY_OVERRIDDEN_FIELD_KEYS, EmailComponent, EruGridComponent, EruGridService, EruGridStore, GRID_COLOR_TOKENS, INHERITED_FIELD_KEYS, LocationComponent, MATERIAL_MODULES, MATERIAL_PROVIDERS, MONTH_SHORT_NAMES, NumberComponent, NumericInputDirective, PRESENTATION_DATATYPES, PRESET_CONFIG_DEFAULTS, PRESET_MANAGED_FIELDS, PeopleComponent, PhoneComponent, PriorityComponent, ProgressComponent, RatingComponent, SEEDED_FIELD_KEYS, SELF_COLOURED_DATATYPES, SelectComponent, StatusComponent, TagComponent, TextareaComponent, TextboxComponent, ThemeService, ThemeToggleComponent, WebsiteComponent, abbreviateNumber, abbreviationScaleFor, cellRuleBarPercent, cellRuleMatches, cellRuleToCss, cellStatAlias, cellTextStyleToCss, collectColumnStatRequests, columnCellRules, composeColorValue, effectiveValueDatatype, evaluateRowCondition, formatCellValue, formatDateTimeWithPattern, formatDateWithPattern, formatNumberValue, hasOwnCellRules, matchCellRule, matchColorRange, normalizeCellRender, normalizeDatatype, normalizeDateFormat, normalizeDateTimeFormat, parseCellDate, parseCellDateTime, parseColorValue, parseDateWithPattern, readRowValue, resolveColumnRules, resolveRowValue, resolveStatValue, rowSelectionKey, statusPillColors, tagPillColors, toDateOnlyString, toDateTimeString };
|
|
4016
4066
|
export type { ActionClick, AggregationFunction, AttachmentConfig, BoardCardContext, CellFormatRule, CellRender, CellRuleOperator, CellStatRef, CellStatVerb, CellTemplateContext, CellTextStyle, CellValueChange, ChipListItem, ColorRangeBand, ColumnReorder, ColumnResize, ColumnStatRequest, ColumnWidthConstraints, CompositePart, CurrencyValidationResult, DataTypes, Drilldown, DurationValue, DynamicDataRequest, EmailValidationResult, ExcelDownloadPayload, ExcelDownloadRequest, ExcelPivotConfig, Field, GridAction, GridConfiguration, GridFeatures, GridMode, GridPreset, GridStyles, GridTokens, GroupItem$1 as GroupItem, LocationConfig, LocationValidationResult, NumberValidationResult, ParsedColorValue, PeopleOption, PersonCardContext, PivotColumnGroupState, PivotColumnHeader, PivotColumnKind, PivotConfiguration, PivotHeaderStructure, PivotMetadata, PivotResult, PivotRow, PivotRowKind, RatingConfig, Row, RowDataRequest, RowDataResponse, RowGrandTotal, RowGroup, ServerValidationNotice, StatusPillColors, TagPillColors, TextareaValidationResult, TextboxValidationResult, Theme, WebsiteValidationResult };
|