eru-grid 0.0.37 → 0.0.38

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.37",
3
+ "version": "0.0.38",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.2",
6
6
  "@angular/core": "^21.1.2",
@@ -69,6 +69,26 @@ interface GridFeatures {
69
69
  actionColumnPosition?: 'before' | 'after';
70
70
  designMode?: boolean;
71
71
  groupBar?: boolean;
72
+ excel_download?: boolean;
73
+ response_key?: string;
74
+ header_fill_color?: string[];
75
+ header_fill_type?: string;
76
+ header_fill_pattern?: number;
77
+ header_font_family?: string;
78
+ header_font_size?: number;
79
+ header_font_bold?: boolean;
80
+ header_border_type?: string;
81
+ header_border_color?: string;
82
+ header_border_style?: number;
83
+ data_fill_color?: string[];
84
+ data_fill_type?: string;
85
+ data_fill_pattern?: number;
86
+ data_font_family?: string;
87
+ data_font_size?: number;
88
+ data_font_bold?: boolean;
89
+ data_border_type?: string;
90
+ data_border_color?: string;
91
+ data_border_style?: number;
72
92
  wrapHeaders?: boolean;
73
93
  headerRowHeight?: number;
74
94
  dataRowHeight?: number;
@@ -79,6 +99,64 @@ interface GridFeatures {
79
99
  boardColumnMinWidth?: number;
80
100
  boardColumnHeight?: number;
81
101
  }
102
+ interface ExcelDownloadPayload {
103
+ columns: Record<string, {
104
+ headers: Record<string, {
105
+ max_width: number;
106
+ sub_total: boolean;
107
+ header_label: string;
108
+ header_name: string;
109
+ }>;
110
+ }>;
111
+ excel_styles: Record<string, {
112
+ header_style: {
113
+ fill: {
114
+ color: string[];
115
+ type: string;
116
+ pattern: number;
117
+ };
118
+ font: {
119
+ family: string;
120
+ size: number;
121
+ bold: boolean;
122
+ };
123
+ border: [{
124
+ type: string;
125
+ color: string;
126
+ style: number;
127
+ }];
128
+ };
129
+ data_style: {
130
+ fill: {
131
+ color: string[];
132
+ type: string;
133
+ pattern: number;
134
+ };
135
+ font: {
136
+ family: string;
137
+ size: number;
138
+ bold: boolean;
139
+ };
140
+ border: [{
141
+ type: string;
142
+ color: string;
143
+ style: number;
144
+ }];
145
+ };
146
+ }>;
147
+ }
148
+ /**
149
+ * Descriptor enqueued by the grid when the excel-download icon is clicked.
150
+ * Consumers listen to EruGridStore.excelDownloadRequest() the same way they
151
+ * already listen to requestQueue()/dynamicDataRequest() — same
152
+ * enqueue/drain/remove pattern, not a one-off output event — and remove the
153
+ * request via EruGridStore.removeExcelDownloadRequest(id) once the file has
154
+ * been fetched and downloaded.
155
+ */
156
+ interface ExcelDownloadRequest extends ExcelDownloadPayload {
157
+ id: number;
158
+ timestamp: number;
159
+ }
82
160
  interface GridStyles {
83
161
  subTotalStyle?: 'bold' | 'italic' | 'highlighted';
84
162
  grandTotalStyle?: 'bold' | 'italic' | 'highlighted';
@@ -608,6 +686,7 @@ declare class EruGridStore {
608
686
  private readonly _sortColumns;
609
687
  private readonly _dataRequest;
610
688
  private readonly _requestQueue;
689
+ private readonly _excelDownloadRequest;
611
690
  private readonly _selectedDesignColumn;
612
691
  readonly selectedDesignColumn: _angular_core.Signal<string | null>;
613
692
  private readonly _columnDesignUpdate;
@@ -645,6 +724,7 @@ declare class EruGridStore {
645
724
  readonly dataRequest: _angular_core.Signal<RowDataRequest | null>;
646
725
  readonly dynamicDataRequest: _angular_core.Signal<DynamicDataRequest[] | null>;
647
726
  readonly dynamicData: _angular_core.Signal<Map<string, any> | null>;
727
+ readonly excelDownloadRequest: _angular_core.Signal<ExcelDownloadRequest[]>;
648
728
  readonly selectedRows: _angular_core.Signal<Row[]>;
649
729
  readonly totalSelectedCount: _angular_core.Signal<number>;
650
730
  readonly hasSelection: _angular_core.Signal<boolean>;
@@ -781,6 +861,16 @@ declare class EruGridStore {
781
861
  * Clear all requests from queue
782
862
  */
783
863
  clearRequestQueue(): void;
864
+ /**
865
+ * Enqueue an excel-download request (called by the grid component when the
866
+ * excel-download icon is clicked).
867
+ */
868
+ addExcelDownloadRequest(request: ExcelDownloadRequest): void;
869
+ /**
870
+ * Remove an excel-download request from the queue (called by the consumer
871
+ * once it has fetched and downloaded the file for that request).
872
+ */
873
+ removeExcelDownloadRequest(id: number): void;
784
874
  /**
785
875
  * Clear the data request signal (called by consumer after handling)
786
876
  */
@@ -1046,6 +1136,18 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
1046
1136
  group?: RowGroup;
1047
1137
  }>;
1048
1138
  emitRowSelect(row: Row, mode: 'table' | 'board', group?: RowGroup): void;
1139
+ /**
1140
+ * Fires when the user clicks the excel download icon (shown when
1141
+ * `config.excel_download` is enabled). Enqueues an ExcelDownloadRequest
1142
+ * onto gridStore.excelDownloadRequest() — the same enqueue/drain/remove
1143
+ * pattern already used for row-data pagination (requestQueue) and cell
1144
+ * option-lists (dynamicDataRequest) — rather than a one-off output event.
1145
+ * The consumer's effect drains the queue, performs its own entity/query
1146
+ * fetch (the library never makes HTTP calls itself), and removes the
1147
+ * request via gridStore.removeExcelDownloadRequest(id) once done.
1148
+ */
1149
+ onExcelDownloadClick(event: Event): void;
1150
+ private buildExcelDownloadPayload;
1049
1151
  /** Whether a board card is the active (last-clicked) one. Compared by row
1050
1152
  * reference so it works for entity and query data alike. */
1051
1153
  isBoardCardActive(row: Row): boolean;
@@ -1080,6 +1182,7 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
1080
1182
  isSortable: _angular_core.Signal<boolean>;
1081
1183
  showSortBar: _angular_core.Signal<boolean>;
1082
1184
  showGroupBar: _angular_core.Signal<boolean>;
1185
+ showExcelDownload: _angular_core.Signal<boolean>;
1083
1186
  wrapHeaders: _angular_core.Signal<boolean>;
1084
1187
  headerRowHeight: _angular_core.Signal<number>;
1085
1188
  dataRowHeight: _angular_core.Signal<number>;
@@ -2307,4 +2410,4 @@ declare class ThemeToggleComponent {
2307
2410
  }
2308
2411
 
2309
2412
  export { AttachmentComponent, CheckboxComponent, ColumnConstraintsService, CurrencyComponent, CustomVirtualScrollStrategy, DATA_TYPES, DateComponent, DatetimeComponent, DurationComponent, EmailComponent, EruGridComponent, EruGridService, EruGridStore, LocationComponent, MATERIAL_MODULES, MATERIAL_PROVIDERS, NumberComponent, PRESET_CONFIG_DEFAULTS, PRESET_MANAGED_FIELDS, PeopleComponent, PhoneComponent, PriorityComponent, ProgressComponent, RatingComponent, SelectComponent, StatusComponent, TagComponent, TextareaComponent, TextboxComponent, ThemeService, ThemeToggleComponent, WebsiteComponent };
2310
- export type { ActionClick, AggregationFunction, AttachmentConfig, BoardCardContext, CellValueChange, ColumnReorder, ColumnResize, ColumnWidthConstraints, CurrencyValidationResult, DataTypes, Drilldown, DurationValue, DynamicDataRequest, EmailValidationResult, Field, GridConfiguration, GridFeatures, GridMode, GridPreset, GridStyles, GridTokens, GroupItem$1 as GroupItem, LocationConfig, LocationValidationResult, NumberValidationResult, PeopleOption, PivotColumnGroupState, PivotColumnHeader, PivotConfiguration, PivotHeaderStructure, PivotMetadata, PivotResult, PivotRow, RatingConfig, Row, RowDataRequest, RowDataResponse, RowGrandTotal, RowGroup, TextareaValidationResult, TextboxValidationResult, Theme, WebsiteValidationResult };
2413
+ export type { ActionClick, AggregationFunction, AttachmentConfig, BoardCardContext, CellValueChange, ColumnReorder, ColumnResize, ColumnWidthConstraints, CurrencyValidationResult, DataTypes, Drilldown, DurationValue, DynamicDataRequest, EmailValidationResult, ExcelDownloadPayload, ExcelDownloadRequest, Field, GridConfiguration, GridFeatures, GridMode, GridPreset, GridStyles, GridTokens, GroupItem$1 as GroupItem, LocationConfig, LocationValidationResult, NumberValidationResult, PeopleOption, PivotColumnGroupState, PivotColumnHeader, PivotConfiguration, PivotHeaderStructure, PivotMetadata, PivotResult, PivotRow, RatingConfig, Row, RowDataRequest, RowDataResponse, RowGrandTotal, RowGroup, TextareaValidationResult, TextboxValidationResult, Theme, WebsiteValidationResult };