eru-grid 0.0.46 → 0.0.48

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,6 +1,6 @@
1
1
  {
2
2
  "name": "eru-grid",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.2",
6
6
  "@angular/core": "^21.1.2",
@@ -45,7 +45,6 @@ interface GridFeatures {
45
45
  columnReorderable: boolean;
46
46
  cellSelection: boolean;
47
47
  rowSelection: boolean;
48
- exportable: boolean;
49
48
  filtering: boolean;
50
49
  showColumnLines?: boolean;
51
50
  showRowLines?: boolean;
@@ -156,6 +155,17 @@ interface ExcelDownloadPayload {
156
155
  }];
157
156
  };
158
157
  }>;
158
+ pivot_config?: Record<string, ExcelPivotConfig>;
159
+ }
160
+ interface ExcelPivotConfig {
161
+ rows: string[];
162
+ columns: string[];
163
+ aggregations: {
164
+ aggregation_function: string;
165
+ field_name: string;
166
+ }[];
167
+ show_columns_totals: boolean;
168
+ show_rows_totals: boolean;
159
169
  }
160
170
  /**
161
171
  * Descriptor enqueued by the grid when the excel-download icon is clicked.
@@ -284,6 +294,7 @@ interface Field {
284
294
  enableDrilldown?: boolean;
285
295
  open_status?: any[];
286
296
  close_status?: any[];
297
+ status_view?: 'pill' | 'dot';
287
298
  color_ranges?: {
288
299
  from?: number | null;
289
300
  to?: number | null;
@@ -392,6 +403,33 @@ interface StatusPillColors {
392
403
  * look different depending on which control renders it.
393
404
  */
394
405
  declare function statusPillColors(color: string | null | undefined): StatusPillColors;
406
+ /** The colours a tag pill is painted with. */
407
+ interface TagPillColors {
408
+ background: string;
409
+ text: string;
410
+ dot: string;
411
+ }
412
+ /**
413
+ * The colours for a tag pill, from the single colour the data model gives it.
414
+ *
415
+ * A tag is deliberately not a status. Status owns the ringed pill — a tint fill
416
+ * inside a full-saturation border — because a record has exactly one status and
417
+ * it is the state the row is judged by. A tag field holds a list, so the same
418
+ * treatment repeated four times across one cell turns into four competing
419
+ * outlines. Tags instead get a tint fill with no border and a full-saturation
420
+ * dot ahead of the label: quieter than status at a glance, still carrying the
421
+ * palette colour at full strength in the dot so a pale entry stays identifiable.
422
+ *
423
+ * The fill is lightened 88% toward white and the text darkened 35% — slightly
424
+ * more contrast than the status pill, since with no border the fill alone has
425
+ * to describe the pill's edge.
426
+ *
427
+ * Lives here beside `statusPillColors` because eru-grid's tag cell and
428
+ * eru-studio's tag control paint the same values, and two copies of this
429
+ * arithmetic is two ways for one field to look different depending on which
430
+ * control renders it.
431
+ */
432
+ declare function tagPillColors(color: string | null | undefined): TagPillColors;
395
433
  /** Short month names, for the `MMM` token. */
396
434
  declare const MONTH_SHORT_NAMES: string[];
397
435
  /**
@@ -1147,6 +1185,14 @@ declare class EruGridStore {
1147
1185
  setCellValueChange(change: CellValueChange): void;
1148
1186
  setGroups(groups: RowGroup[]): void;
1149
1187
  toggleGroupExpansion(groupId: string): void;
1188
+ /**
1189
+ * Merge server-computed subtotals into the groups already on screen, keyed by
1190
+ * group id. Needed because the totals can arrive after the group list: the
1191
+ * columns a grid aggregates are not always known when the group call goes
1192
+ * out, so a later pass fills them in. Everything else about a group — its
1193
+ * loaded rows, counts, expansion state — is left alone.
1194
+ */
1195
+ setGroupSubtotals(subtotals: Record<string, Record<string, number>>): void;
1150
1196
  updateGroupLoadingState(groupId: string, isLoading: boolean): void;
1151
1197
  updateGroupAfterLoading(groupId: string, loadedCount: number, fullyExhausted?: boolean): void;
1152
1198
  setRows(rows: Row[]): void;
@@ -1590,6 +1636,25 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
1590
1636
  */
1591
1637
  onExcelDownloadClick(event: Event): void;
1592
1638
  private buildExcelDownloadPayload;
1639
+ /**
1640
+ * The columns the `columns` block of the excel-download payload describes.
1641
+ * Always the grid's own source columns — the same set table mode sends — even
1642
+ * in pivot mode, where displayColumns() would hand back the generated
1643
+ * cross-tab leaves (`<dimension value>|<measure>`, `_count_column_grand_total_*`)
1644
+ * that mean nothing to the server. The pivot layout travels separately, in
1645
+ * `pivot_config`.
1646
+ */
1647
+ private excelDownloadColumns;
1648
+ /**
1649
+ * The pivot half of the excel-download payload — the cross-tab layout the
1650
+ * server rebuilds in the sheet. Null outside pivot mode, so the payload keeps
1651
+ * the exact shape table/board mode has always sent.
1652
+ *
1653
+ * Dimensions and measures are emitted as their display labels (the same
1654
+ * header_label the `columns` block carries) rather than field names, because
1655
+ * that is what the sheet's own header row reads.
1656
+ */
1657
+ private buildExcelPivotConfig;
1593
1658
  /** Whether a board card is the active (last-clicked) one. Compared by row
1594
1659
  * reference so it works for entity and query data alike. */
1595
1660
  isBoardCardActive(row: Row): boolean;
@@ -1636,7 +1701,10 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
1636
1701
  grandTotalPositionColumn: _angular_core.Signal<"before" | "after">;
1637
1702
  enableColumnGrandTotal: _angular_core.Signal<boolean>;
1638
1703
  enableColumnSubtotals: _angular_core.Signal<boolean>;
1704
+ enableRowSubtotals: _angular_core.Signal<boolean>;
1705
+ enableGrandTotal: _angular_core.Signal<boolean>;
1639
1706
  subtotalPositionColumn: _angular_core.Signal<"before" | "after">;
1707
+ subtotalPosition: _angular_core.Signal<"before" | "after">;
1640
1708
  subtotalLabel: _angular_core.Signal<string>;
1641
1709
  /**
1642
1710
  * Check if a group has subtotal data
@@ -2902,6 +2970,12 @@ declare class StatusComponent implements OnInit {
2902
2970
  text: string;
2903
2971
  color: string;
2904
2972
  }>;
2973
+ /**
2974
+ * How the read-only cell paints the status: the labelled pill, or a colour dot
2975
+ * that carries the label in its tooltip. Anything the column does not set
2976
+ * reads as the pill, so existing grids are untouched.
2977
+ */
2978
+ statusView: _angular_core.Signal<"pill" | "dot">;
2905
2979
  constructor();
2906
2980
  ngOnInit(): void;
2907
2981
  onActivate(): void;
@@ -2991,10 +3065,7 @@ declare class TagComponent implements OnInit {
2991
3065
  onDrillableClick(event: Event): void;
2992
3066
  getProperty(property: string): any;
2993
3067
  removeTag(tag: string, event: Event): void;
2994
- getTagColor(tag: string): {
2995
- background: string;
2996
- color: string;
2997
- };
3068
+ getTagColor(tag: string): TagPillColors;
2998
3069
  isTagSelected(tagValue: string): boolean;
2999
3070
  trackByValueAndIndex(index: number, option: {
3000
3071
  value: string;
@@ -3144,5 +3215,5 @@ declare class ThemeToggleComponent {
3144
3215
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThemeToggleComponent, "eru-theme-toggle", never, {}, {}, never, never, true, never>;
3145
3216
  }
3146
3217
 
3147
- export { AttachmentComponent, CheckboxComponent, ColumnConstraintsService, CurrencyComponent, CustomVirtualScrollStrategy, DATA_TYPES, DATETIME_FORMATS, DATE_FORMATS, DateComponent, DatetimeComponent, DurationComponent, EmailComponent, EruGridComponent, EruGridService, EruGridStore, INHERITED_FIELD_KEYS, LocationComponent, MATERIAL_MODULES, MATERIAL_PROVIDERS, MONTH_SHORT_NAMES, NumberComponent, PRESET_CONFIG_DEFAULTS, PRESET_MANAGED_FIELDS, PeopleComponent, PhoneComponent, PriorityComponent, ProgressComponent, RatingComponent, SelectComponent, StatusComponent, TagComponent, TextareaComponent, TextboxComponent, ThemeService, ThemeToggleComponent, WebsiteComponent, evaluateRowCondition, formatDateWithPattern, matchColorRange, normalizeDatatype, normalizeDateFormat, normalizeDateTimeFormat, parseDateWithPattern, resolveRowValue, statusPillColors };
3148
- export type { ActionClick, AggregationFunction, AttachmentConfig, BoardCardContext, CellValueChange, ColorRangeBand, ColumnReorder, ColumnResize, ColumnWidthConstraints, CurrencyValidationResult, DataTypes, Drilldown, DurationValue, DynamicDataRequest, EmailValidationResult, ExcelDownloadPayload, ExcelDownloadRequest, Field, GridAction, GridConfiguration, GridFeatures, GridMode, GridPreset, GridStyles, GridTokens, GroupItem$1 as GroupItem, LocationConfig, LocationValidationResult, NumberValidationResult, PeopleOption, PersonCardContext, PivotColumnGroupState, PivotColumnHeader, PivotColumnKind, PivotConfiguration, PivotHeaderStructure, PivotMetadata, PivotResult, PivotRow, PivotRowKind, RatingConfig, Row, RowDataRequest, RowDataResponse, RowGrandTotal, RowGroup, ServerValidationNotice, StatusPillColors, TextareaValidationResult, TextboxValidationResult, Theme, WebsiteValidationResult };
3218
+ export { AttachmentComponent, CheckboxComponent, ColumnConstraintsService, CurrencyComponent, CustomVirtualScrollStrategy, DATA_TYPES, DATETIME_FORMATS, DATE_FORMATS, DateComponent, DatetimeComponent, DurationComponent, EmailComponent, EruGridComponent, EruGridService, EruGridStore, INHERITED_FIELD_KEYS, LocationComponent, MATERIAL_MODULES, MATERIAL_PROVIDERS, MONTH_SHORT_NAMES, NumberComponent, PRESET_CONFIG_DEFAULTS, PRESET_MANAGED_FIELDS, PeopleComponent, PhoneComponent, PriorityComponent, ProgressComponent, RatingComponent, SelectComponent, StatusComponent, TagComponent, TextareaComponent, TextboxComponent, ThemeService, ThemeToggleComponent, WebsiteComponent, evaluateRowCondition, formatDateWithPattern, matchColorRange, normalizeDatatype, normalizeDateFormat, normalizeDateTimeFormat, parseDateWithPattern, resolveRowValue, statusPillColors, tagPillColors };
3219
+ export type { ActionClick, AggregationFunction, AttachmentConfig, BoardCardContext, CellValueChange, ColorRangeBand, ColumnReorder, ColumnResize, ColumnWidthConstraints, CurrencyValidationResult, DataTypes, Drilldown, DurationValue, DynamicDataRequest, EmailValidationResult, ExcelDownloadPayload, ExcelDownloadRequest, ExcelPivotConfig, Field, GridAction, GridConfiguration, GridFeatures, GridMode, GridPreset, GridStyles, GridTokens, GroupItem$1 as GroupItem, LocationConfig, LocationValidationResult, NumberValidationResult, PeopleOption, PersonCardContext, PivotColumnGroupState, PivotColumnHeader, PivotColumnKind, PivotConfiguration, PivotHeaderStructure, PivotMetadata, PivotResult, PivotRow, PivotRowKind, RatingConfig, Row, RowDataRequest, RowDataResponse, RowGrandTotal, RowGroup, ServerValidationNotice, StatusPillColors, TagPillColors, TextareaValidationResult, TextboxValidationResult, Theme, WebsiteValidationResult };