@ic3/reporting-api 8.0.0-alpha.9 → 8.0.0-rc.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.
Files changed (79) hide show
  1. package/dist/ApiUtils.d.ts +10 -0
  2. package/dist/ApiUtils.js +25 -1
  3. package/dist/ApiUtils.js.map +1 -1
  4. package/dist/INotification.d.ts +33 -0
  5. package/dist/INotification.js +3 -0
  6. package/dist/INotification.js.map +1 -0
  7. package/dist/IPluginDefinition.d.ts +4 -1
  8. package/dist/IReporting.d.ts +43 -4
  9. package/dist/IThemeManager.d.ts +1 -1
  10. package/dist/ITidyTableTransformation.d.ts +20 -1
  11. package/dist/ITypes.d.ts +3 -0
  12. package/dist/ITypes.js +3 -0
  13. package/dist/ITypes.js.map +1 -0
  14. package/dist/IWidgetVariantManager.d.ts +1 -1
  15. package/dist/LazyTreeView.d.ts +43 -1
  16. package/dist/LazyTreeView.js +5 -1
  17. package/dist/LazyTreeView.js.map +1 -1
  18. package/dist/Loader.d.ts +10 -0
  19. package/dist/Loader.js +33 -0
  20. package/dist/Loader.js.map +1 -0
  21. package/dist/PublicContext.d.ts +75 -10
  22. package/dist/PublicContext.js.map +1 -1
  23. package/dist/PublicLayout.d.ts +13 -29
  24. package/dist/PublicTemplate.d.ts +161 -58
  25. package/dist/PublicTemplate.js +16 -1
  26. package/dist/PublicTemplate.js.map +1 -1
  27. package/dist/PublicTemplateForm.d.ts +183 -20
  28. package/dist/PublicTemplateForm.js +7 -1
  29. package/dist/PublicTemplateForm.js.map +1 -1
  30. package/dist/PublicTheme.d.ts +165 -69
  31. package/dist/PublicTheme.js.map +1 -1
  32. package/dist/PublicTidyColumn.d.ts +331 -259
  33. package/dist/PublicTidyColumn.js +48 -2
  34. package/dist/PublicTidyColumn.js.map +1 -1
  35. package/dist/PublicTidyHistogram.d.ts +24 -0
  36. package/dist/PublicTidyHistogram.js +77 -0
  37. package/dist/PublicTidyHistogram.js.map +1 -0
  38. package/dist/PublicTidyMath.d.ts +49 -45
  39. package/dist/PublicTidyMath.js +0 -280
  40. package/dist/PublicTidyMath.js.map +1 -1
  41. package/dist/PublicTidyTable.d.ts +170 -154
  42. package/dist/PublicTidyTableInteractions.d.ts +34 -23
  43. package/dist/PublicTidyTableInteractions.js +5 -4
  44. package/dist/PublicTidyTableInteractions.js.map +1 -1
  45. package/dist/PublicTidyTableTypes.d.ts +133 -55
  46. package/dist/PublicTidyTableTypes.js +35 -18
  47. package/dist/PublicTidyTableTypes.js.map +1 -1
  48. package/dist/PublicTidyTree.d.ts +27 -37
  49. package/dist/PublicTidyTree.js +30 -58
  50. package/dist/PublicTidyTree.js.map +1 -1
  51. package/dist/RemoteContainerUtils.d.ts +1 -1
  52. package/dist/RemoteContainerUtils.js +9 -1
  53. package/dist/RemoteContainerUtils.js.map +1 -1
  54. package/dist/index.d.ts +12 -0
  55. package/dist/index.js +12 -0
  56. package/dist/index.js.map +1 -1
  57. package/dist/theme/ThemeFilterAutocomplete.d.ts +30 -0
  58. package/dist/theme/ThemeFilterAutocomplete.js +23 -0
  59. package/dist/theme/ThemeFilterAutocomplete.js.map +1 -0
  60. package/dist/theme/ThemeFilterButtons.d.ts +14 -2
  61. package/dist/theme/ThemeFilterButtons.js +4 -0
  62. package/dist/theme/ThemeFilterButtons.js.map +1 -1
  63. package/dist/theme/ThemeFilterCheckboxes.d.ts +18 -0
  64. package/dist/theme/ThemeFilterCheckboxes.js +11 -0
  65. package/dist/theme/ThemeFilterCheckboxes.js.map +1 -0
  66. package/dist/theme/ThemeFilterTree.d.ts +70 -0
  67. package/dist/theme/ThemeFilterTree.js +11 -0
  68. package/dist/theme/ThemeFilterTree.js.map +1 -0
  69. package/dist/theme/ThemeGoogleMapMarker.d.ts +51 -0
  70. package/dist/theme/ThemeGoogleMapMarker.js +3 -0
  71. package/dist/theme/ThemeGoogleMapMarker.js.map +1 -0
  72. package/dist/theme/ThemeHtmlBox.d.ts +7 -1
  73. package/dist/theme/ThemePivotTable.d.ts +23 -0
  74. package/dist/theme/ThemePivotTable.js +21 -0
  75. package/dist/theme/ThemePivotTable.js.map +1 -0
  76. package/dist/theme/ThemeTable.d.ts +99 -0
  77. package/dist/theme/ThemeTable.js +169 -0
  78. package/dist/theme/ThemeTable.js.map +1 -0
  79. package/package.json +9 -8
@@ -1,17 +1,60 @@
1
- import { AxisCoordinate, EntityItem, IMdxAxisSeriesInfo, ITidyTableSelection, MdxInfo, SortingType, TidyCellError, TidyColumnCoordinateUniqueName, TidyColumnsType } from "./PublicTidyTableTypes";
1
+ import { AxisCoordinate, ConvertToTypeParseSettings, EntityItem, IMdxAxisSeriesInfo, ITidyColumnsSource, ITidyTableSelection, MdxInfo, MdxMemberCoordinates, TidyCellError, TidyColumnsSubType, TidyColumnsType } from "./PublicTidyTableTypes";
2
2
  import { TidyActionEvent } from "./IcEvent";
3
- import { ITidyTable } from "./PublicTidyTable";
4
3
  import { ReactElement } from "react";
5
4
  import { ThemeTextFormatter } from "./PublicTheme";
5
+ import { Property } from "csstype";
6
+ import { AppNotification } from "./INotification";
7
+ export interface ITidyColumnTypedValue {
8
+ value: any;
9
+ fValue?: string;
10
+ type: TidyColumnsType;
11
+ }
12
+ export declare type ITidyColumnAddValue = ITidyColumnAddValueInsert | ITidyColumnAddValueCopyRow;
13
+ export interface ITidyColumnAddValueInsert {
14
+ options: "INSERT";
15
+ value: ITidyColumnTypedValue;
16
+ }
17
+ export interface ITidyColumnAddValueCopyRow {
18
+ options: "COPY_ROW";
19
+ rowIndex: number;
20
+ }
6
21
  /**
7
22
  * Properties with a special meaning
8
23
  */
9
24
  export declare enum ITidyColumnNamedProperties {
25
+ /**
26
+ * The formatted value of a cell. For example, 5003 in euros is formatted as €5,003
27
+ */
10
28
  mdxCellFormattedValue = "formattedValue",
29
+ /**
30
+ * MDX related colorings
31
+ */
11
32
  mdxCellBackColor = "mdxCellBackColor",
33
+ /**
34
+ * MDX related colorings
35
+ */
12
36
  mdxCellForeColor = "mdxCellForeColor",
37
+ /**
38
+ * The format string for the cell value. For example, euros are formatted using €#,###.
39
+ * and percentages using #0.00%.
40
+ */
13
41
  mdxCellFormatString = "mdxCellFormatString",
42
+ /**
43
+ * The main color of the cell
44
+ */
14
45
  mdxCellColor = "color",
46
+ /**
47
+ * Column defined to fire an app. notification.
48
+ *
49
+ * The name of the notification (e.g., print-report).
50
+ */
51
+ appNotificationType = "appNotificationType",
52
+ /**
53
+ * Column defined to fire an app. notification.
54
+ *
55
+ * The parameters of the notification (e.g., page size, filename, ...) as a JSON or a string.
56
+ */
57
+ appNotificationPayload = "appNotificationPayload",
15
58
  /**
16
59
  * Column defined to fire events, the name of the event
17
60
  */
@@ -35,9 +78,13 @@ export declare enum ITidyColumnNamedProperties {
35
78
  /**
36
79
  * Column defined as an MDX axis, the key of the column
37
80
  */
38
- key = "key",
81
+ mdxCellKey = "key",
82
+ /**
83
+ * Show this when hovering over the cell (or the visualisation representing the cell)
84
+ */
39
85
  tooltip = "tooltip"
40
86
  }
87
+ export declare const CharacterTidyColumnProperties: Set<string>;
41
88
  /**
42
89
  * A copy from XLSX CellObject (we don't want the link to the library !)
43
90
  */
@@ -71,58 +118,114 @@ export interface ITidyColumnXlsxCell {
71
118
  /** The style/theme of the cell (if applicable) */
72
119
  s?: any;
73
120
  }
74
- export declare type AllowedColumnType<T> = TidyColumnsType.UNKNOWN | (T extends string ? TidyColumnsType.COLOR | TidyColumnsType.CHARACTER : T extends number ? TidyColumnsType.NUMERIC | TidyColumnsType.LATITUDE | TidyColumnsType.LONGITUDE : T extends boolean ? TidyColumnsType.LOGICAL : T extends number[] ? TidyColumnsType.VECTOR : T extends Date ? TidyColumnsType.DATETIME : T extends null ? TidyColumnsType.NULL : TidyColumnsType.MIXED);
75
- /**
76
- * Base interface for nullable column.
77
- */
78
- export interface ITidyBaseColumn<T> {
121
+ declare type NonNullable<T> = Exclude<T, null | undefined>;
122
+ export declare type AllowedColumnType<T> = TidyColumnsType.UNKNOWN | TidyColumnsType.MIXED | (NonNullable<T> extends Property.Color ? TidyColumnsType.COLOR : TidyColumnsType.UNKNOWN) | (NonNullable<T> extends string ? TidyColumnsType.CHARACTER : TidyColumnsType.UNKNOWN) | (NonNullable<T> extends number ? TidyColumnsType.NUMERIC | TidyColumnsType.LATITUDE | TidyColumnsType.LONGITUDE : TidyColumnsType.UNKNOWN) | (NonNullable<T> extends boolean ? TidyColumnsType.LOGICAL : TidyColumnsType.UNKNOWN) | (NonNullable<T> extends any[] ? TidyColumnsType.LIST : TidyColumnsType.UNKNOWN) | (NonNullable<T> extends Date ? TidyColumnsType.DATETIME : TidyColumnsType.UNKNOWN) | (NonNullable<T> extends unknown ? TidyColumnsType : TidyColumnsType.UNKNOWN) | (T extends null ? TidyColumnsType.NULL : TidyColumnsType.UNKNOWN);
123
+ export interface ITidyBaseColumnReadonly<T> {
124
+ /**
125
+ * Returns the length of the value array.
126
+ */
127
+ length(): number;
128
+ /**
129
+ * Returns true if and only if the column has zero rows.
130
+ */
131
+ isEmpty(): boolean;
132
+ getSource(): ITidyColumnsSource;
133
+ /**
134
+ * Get the MDX role of the column
135
+ */
136
+ getRole(): string | undefined;
137
+ /**
138
+ * Return the type of the column
139
+ */
140
+ getType(): AllowedColumnType<T>;
141
+ /**
142
+ * e.g., List<T>.
143
+ */
144
+ getTypeParam(): TidyColumnsType | undefined;
145
+ /**
146
+ * E.g., datetime column: YEAR, ...
147
+ */
148
+ getSubType(): TidyColumnsSubType | undefined;
79
149
  /**
80
- * The name of the column.
150
+ * Check if column is of type
151
+ * @param type check this type
81
152
  */
82
- name: string;
153
+ is<T extends TidyColumnsType>(type: T): this is ITidyColumnIsType<T>;
83
154
  /**
84
- * Create a column.
85
- * @param name name of the column.
86
- * @param values values in the column.
87
- * @param type optional type of the column.
155
+ * Returns true if and only if the column is of the type(s) specified
156
+ * @param typesToCheck one or more types to check this column against
88
157
  */
158
+ isOfType(...typesToCheck: TidyColumnsType[]): boolean;
89
159
  /**
90
160
  * Returns the name of the column.
91
161
  */
92
162
  getName(): string;
93
163
  /**
94
- * Set the name of the column.
95
- * @param name set this as the caption of the column.
164
+ * Get the display name of the column. Both the name and the caption form the display name of the column.
96
165
  */
97
- setName(name: string): void;
166
+ getDisplayName(): string;
98
167
  /**
99
168
  * Returns the caption of the column. The caption is used for displaying localised
100
169
  * or custom captions for the axis, header, etc.
101
170
  */
102
171
  getCaption(): string;
103
172
  /**
104
- * Set the caption of the column. The caption is used for displaying localised
105
- * or custom captions for the axis, header, etc.
106
- * @param caption set this as the caption of the column.
173
+ * Returns the formatter of the column.
107
174
  */
108
- setCaption(caption: string): void;
175
+ getNumberFormat(): ThemeTextFormatter | undefined;
176
+ /**
177
+ * Returns true if the column is a hierarchical structure
178
+ */
179
+ isHierarchy(): boolean;
180
+ /**
181
+ * For hierarchical structures the tree depth (starts at zero).
182
+ */
183
+ getLevelDepthR(idx: number): number;
184
+ /**
185
+ * Returns the column values.
186
+ */
187
+ getValues(): ReadonlyArray<T>;
109
188
  /**
110
189
  * Get the value of the column at position idx.
111
190
  * @param idx the position to return the value of.
112
191
  */
113
192
  getValue(idx: number): T;
114
193
  /**
115
- * Set the value of a column at a certain index.
116
- * @param idx row index.
117
- * @param newValue new value for the column.
194
+ * Function used for value comparison in sorting and ranking. Return a positive number if a > b, a negative
195
+ * number if a < b and 0 otherwise.
196
+ * @param a value 1
197
+ * @param b value 2
198
+ */
199
+ compare(a: T, b: T): number;
200
+ /**
201
+ * Apply a function to the groups of unique values in this column
202
+ *
203
+ * @return a map with the string value and the row indices in the group.
118
204
  */
119
- setValue(idx: number, newValue: T): void;
205
+ groupBy(): Map<string, number[]>;
120
206
  /**
121
- * Get cell as expected by xlsx library (do not include the interface as it's lazy loaded !)
207
+ * Same as reIndex but creating a new column leaving this column untouched.
122
208
  *
123
- * @param idx the position to return the value of.
209
+ * @see ITidyBaseColumn.reIndex
124
210
  */
125
- getExcelCell(idx: number): ITidyColumnXlsxCell | undefined;
211
+ reIndexN(index: number[]): ITidyBaseColumn<T>;
212
+ }
213
+ /**
214
+ * Base interface for nullable column.
215
+ */
216
+ export interface ITidyBaseColumn<T> extends ITidyBaseColumnReadonly<T> {
217
+ getErrors(): (TidyCellError | undefined)[];
218
+ /**
219
+ * If an error occurred in the calculation of cells for a column, then the error can be
220
+ * retrieved using this function.
221
+ * @param idx the row index of the cell to retrieve the error of.
222
+ */
223
+ getError(idx: number): TidyCellError | undefined;
224
+ /**
225
+ * Returns first value where callback does not return undefined.
226
+ * @param callback given the row index, outputs a value or undefined.
227
+ */
228
+ findFirst<P>(callback: (idx: number) => P | undefined): P | undefined;
126
229
  /**
127
230
  * Get the formatted value of the column at position idx.
128
231
  *
@@ -132,216 +235,269 @@ export interface ITidyBaseColumn<T> {
132
235
  * @param idx the position to return the value of.
133
236
  */
134
237
  getFormattedValue(idx: number): string | undefined;
135
- getFormattedValueOrValue(idx: number): string | undefined;
136
- setNumberFormat(format: ThemeTextFormatter, fv: (value: T | undefined) => string): void;
137
- setFormattedValues(formatString: string, formattedValues: string[]): void;
138
238
  /**
139
- * Returns the formatter of the column.
239
+ * Return the formatted value. Fallback on the value itself.
140
240
  */
141
- getNumberFormat(): ThemeTextFormatter | undefined;
241
+ getFormattedValueOrValue(idx: number): string | undefined;
142
242
  getNumberFormatInfo(): string | undefined;
143
243
  /**
144
- * Returns the column values.
145
- */
146
- getValues(): Array<T>;
147
- /**
148
- * Set the values of this column. Ensure that the length remains the same, if not, an error is thrown.
149
- * @param values new values of the column.
150
- */
151
- setValues<P>(values: P[]): void;
152
- /**
153
- * Returns the column internal values object.
154
- * @deprecated Use {getValues} or {unique} instead.
155
- * @see {getValues} {unique}
244
+ * Get cell as expected by xlsx library (do not include the interface as it's lazy loaded !)
245
+ * Does not return the format string.
246
+ *
247
+ * @param idx the position to return the value of.
156
248
  */
157
- getInternalValues(): Array<T>;
249
+ getExcelCell(idx: number): ITidyColumnXlsxCell | undefined;
158
250
  /**
159
- * Return a new column with transformed values.
160
- * @param fun function with one parameter. Describes the transformation.
161
- * @param columnName the name of the new column.
162
- * @param newType new type for the column. Leave blank for auto inference of the type.
251
+ * Returns the type for Material-UI Table/Grid
163
252
  */
164
- mapToColumn<P>(fun: (value: T, index: number) => P, columnName: string, newType?: AllowedColumnType<P>): ITidyBaseColumn<P>;
253
+ getXGridType(): "string" | "number" | "date" | "dateTime" | "boolean" | undefined;
165
254
  /**
166
- * Apply a transformation to all values in the column. Note, this functions alters the values in the column.
167
- * @param fun function with one parameter. Describes the transformation. In the function, index represents the
168
- * index of the internal data structure.
169
- * @param newType new type for the column. Leave blank for auto inference of the type.
255
+ * Return the cell decoration of the column
170
256
  */
171
- apply<P>(fun: (value: T, index: number) => P, newType?: AllowedColumnType<P>): void;
257
+ getCellDecoration(): PublicTidyColumnCellDecoration | undefined;
172
258
  /**
173
- * Fill the column with a single value.
259
+ * Returns true if the column has a property of requested name.
174
260
  */
175
- fill<P>(value: P): void;
261
+ hasProperty(name: ITidyColumnNamedProperties | string): boolean;
176
262
  /**
177
- * Get the unique values in this column.
263
+ * Returns true if the column has color property or is a color column
178
264
  */
179
- unique(): T[];
265
+ hasColorProperty(): boolean;
180
266
  /**
181
- * Get the axis values in this column.
267
+ * Returns the color column (if defined).
182
268
  *
183
- * If it's an MDX Axis, the potentially sorted MDX axis (e.g. pivot table sort)
184
- *
185
- * If it's not, return undefined
269
+ * If the column has type 'color', then it returns itself. Else it returns the
270
+ * column of the first property with type 'color'.
186
271
  */
187
- mdxAxis(): T[] | undefined;
272
+ getColorColumn(): ITidyColorColumn | undefined;
188
273
  /**
189
- * Returns true if and only if the column has zero rows.
274
+ * Returns the color of a cell (if defined).
275
+ *
276
+ * If the column has type 'color', then it returns the cell value. Else it returns the
277
+ * value at rowIdx of the first property with type 'color' (if it is defined).
190
278
  */
191
- isEmpty(): boolean;
279
+ getColor(rowIdx: number): Property.Color | undefined;
192
280
  /**
193
- * Returns the length of the value array.
281
+ * Returns the property at the specified property coordinate.
282
+ * @param name name of the property.
194
283
  */
195
- length(): number;
284
+ getProperty(name: ITidyColumnNamedProperties | string): ITidyUnknownColumn;
196
285
  /**
197
- * Sort the values of the column. Edge cases such as NaN and null are sorted to the end of the column.
198
- * Sort ascending by default.
286
+ * Returns the property at the specified property coordinate.
287
+ * @param name name of the property.
199
288
  */
200
- sort(order?: SortingType): void;
289
+ getOptionalProperty(name: ITidyColumnNamedProperties | string): ITidyUnknownColumn | undefined;
201
290
  /**
202
- * Get the ranking of the values. Smallest value gets rank 0,
203
- * second smallest rank 1, etc. until rank n-1. Sort ascending by default.
204
- * @param order sorting order. Default = ascending.
291
+ * Get the value of the property for the given property coordinate and the given row (undefined if the property does not exist)
292
+ * @param name name of the property.
293
+ * @param rowIdx row index for the value to return.
205
294
  */
206
- getRank(order?: SortingType): number[];
295
+ getPropertyAt(name: ITidyColumnNamedProperties | string, rowIdx: number): any;
207
296
  /**
208
- * Export the column as a flat object.
297
+ * Return the properties of a column for a given cell index.
298
+ *
299
+ * @param idx row index of cell.
209
300
  */
210
- toChartData(): {
211
- [key: string]: T;
212
- }[];
301
+ getPropertiesAt(idx: number): Record<string, any>;
213
302
  /**
214
- * Returns the mdx info at a row index.
215
- * TODO (tom) this must not return undefined to ensure that we always have a unique name. Currently
216
- * we use getSelectionRowIdentifier and getCoordinateUniqueName.
303
+ * Return available properties for this column as a list of columns.
217
304
  */
218
- getMdxInfo(idx: number): MdxInfo | undefined;
305
+ getPropertiesAsColumns(): ITidyUnknownColumn[];
219
306
  isWithEntityItem(): boolean;
220
- getEntityItem(idx: number): EntityItem | undefined;
221
- getMdxCoordinates(rowIdx: number): [number, number, number] | [];
222
307
  /**
223
- * Returns true if the column is a hierarchical structure
308
+ * Create and return the entity item at position idx for generating events.
224
309
  */
225
- isHierarchy(): boolean;
310
+ getEntityItem(idx: number): EntityItem | undefined;
226
311
  /**
227
- * Get the index of the parent. Returns idx if there is no hierarchy.
312
+ * Get the index of the parent. Returns -1 if the parent is the root.
228
313
  * @param idx the index to find the parent of.
229
314
  */
230
315
  getParentIdx(idx: number): number;
231
- /**
232
- * Returns true if the entry at position idx does not have children
233
- * @param idx the position to check
234
- */
235
- isLeaf(idx: number): boolean;
236
- /**
237
- * Get the indices of the level 0 children of this node. Returns [] if the
238
- * column is not a hierarchy.
239
- * @param idx
240
- */
241
- getLeaves(idx: number): number[];
242
316
  /**
243
317
  * Return the descendants of the node in the hierarchy at the index.
244
318
  * Returned set excludes the node itself.
245
319
  * @param index
246
320
  */
247
321
  getDescendants(index: number): number[];
248
- /**
249
- * Returns the children of the node in the hierarchy. Excludes the node itself.
250
- * @param index
251
- */
252
- getChildren(index: number): number[];
253
322
  /**
254
323
  * Return the siblings of the node in the hierarchy at the index.
255
324
  * Including the node itself.
256
325
  * @param index
257
326
  */
258
327
  getSiblings(index: number): number[];
259
- mapAllRows<P>(fun: (index: number) => P): P[];
260
328
  /**
261
- * Map the rows that are visible given a hierarchical axis and an array of boolean values
262
- * @param expanded an array indicating for each index if it is expanded or not. If it is collapsed, then all
263
- * children are not visible.
264
- * @param fun function to apply
329
+ * Get the default member of the dimension that the column represents. Returns undefined
330
+ * if the column is not a MDX dimension.
265
331
  */
266
- mapVisibleRows<P>(expanded: (rowIdx: number) => boolean, fun: (index: number) => P): P[];
267
- mapTreeVisibleRows<P extends ReactElement>(expanded: (rowIdx: number) => boolean, fun: (index: number) => P, filter?: (info: MdxInfo) => boolean): P[];
332
+ getHierarchyDefaultMember(): EntityItem | undefined;
268
333
  /**
269
- * For hierarchical structures de tree depth, starts at zero.
334
+ * Get the mdx coordinate (axeIdx,hierIdx,tupleIdx) of the cell at rowIdx. Defines a member in a MDX Query result axes
270
335
  */
271
- getLevelDepth(idx: number): number | undefined;
272
- hasMdxChildren(rowIdx: number): boolean;
336
+ getMdxCoordinates(rowIdx: number): MdxMemberCoordinates | undefined;
273
337
  /**
274
- * Returns a string representation of the coordinate
338
+ * Get the array of MDX info in the column.
339
+ * Returns an empty array if there is no MDX info.
275
340
  */
276
- getCoordinateUniqueName(rowIdx: number): TidyColumnCoordinateUniqueName;
341
+ getMdxInfos(): (MdxInfo | undefined)[];
277
342
  /**
278
- * Returns true if the column has a property of requested type.
343
+ * Returns the MDX info at a row index.
279
344
  */
280
- hasProperty(type: TidyColumnsType): boolean;
345
+ getMdxInfo(idx: number): MdxInfo | undefined;
281
346
  /**
282
- * Returns the property at the specified property coordinate.
283
- * @param name name of the property.
347
+ * Get extra information of the MDX axis used for this column, if available.
284
348
  */
285
- getProperty(name: ITidyColumnNamedProperties | string): ITidyUnknownColumn;
349
+ getAxisInfo(): IMdxAxisSeriesInfo | undefined;
286
350
  /**
287
- * Returns the property at the specified property coordinate.
288
- * @param name name of the property.
351
+ * Get the MDX axis coordinate, if available.
352
+ * @see {AxisCoordinate}
289
353
  */
290
- getOptionalProperty(name: ITidyColumnNamedProperties | string): ITidyUnknownColumn | undefined;
354
+ getAxisCoordinate(): AxisCoordinate | undefined;
291
355
  /**
292
- * Get the value of the property for the given property coordinate and the given row (undefined if the property does not exist)
293
- * @param name name of the property.
294
- * @param rowIdx row index for the value to return.
356
+ * Get the axis values in this column.
357
+ *
358
+ * If it's an MDX Axis, the potentially sorted MDX axis (e.g. pivot table sort)
359
+ *
360
+ * If it's not, return undefined
295
361
  */
296
- getPropertyAt(name: ITidyColumnNamedProperties | string, rowIdx: number): any;
362
+ mdxAxis(): ReadonlyArray<T> | undefined;
363
+ /**
364
+ * Get the unique values in this column.
365
+ */
366
+ unique(ignoreNull: boolean): T[];
297
367
  /**
298
- * Returns true if the column has color property or is a color column
368
+ * Set the name of the column.
369
+ * @param name set this as the caption of the column.
299
370
  *
371
+ * Note, do not use this for columns that are in tables as it can cause duplicate columns in a table.
372
+ * Use setCaption to change the name visible to the user.
300
373
  */
301
- hasColorProperty(): boolean;
374
+ setName(name: string): void;
302
375
  /**
303
- * Returns the color of a cell (if defined).
376
+ * Set the number formatter of the column, calculating and adding the 'formattedValue' property.
377
+ */
378
+ setNumberFormat(format: ThemeTextFormatter | undefined): void;
379
+ /**
380
+ * Set the caption of the column. The caption is used for displaying localised
381
+ * or custom captions for the axis, header, etc.
382
+ * @param caption set this as the caption of the column.
383
+ */
384
+ setCaption(caption: string): void;
385
+ /**
386
+ * Convert the column to another type. This modifies the values to be of that type.
304
387
  *
305
- * If the column has type 'color', then it returns the cell value. Else it returns the
306
- * value at rowIdx of the first property with type 'color' (if it is defined).
388
+ * If type is datetime, then the settings contain the date locale (default='en_US') and
389
+ * the dateformat (default = 'yyyy-MM-dd').
307
390
  */
308
- getColor(rowIdx: number): string | undefined;
391
+ convertToType(type: TidyColumnsType, settings?: ConvertToTypeParseSettings): void;
309
392
  /**
310
- * Return available properties for this column as a list of columns.
393
+ * Same as convertToType but creating a new column.
311
394
  */
312
- getProperties(): ITidyUnknownColumn[];
395
+ convertToTypeN(type: TidyColumnsType, settings?: ConvertToTypeParseSettings): ITidyBaseColumn<T>;
313
396
  /**
314
- * Return the properties for the column as a table.
397
+ * Create a new column with the content of this column changing both its name and its caption.
315
398
  */
316
- getPropertyTable(): ITidyTable;
399
+ duplicate(name: string, caption: string): ITidyBaseColumn<T>;
317
400
  /**
318
- * Set a table as the properties for this column. Ensure that the row count of the table is equal to the length
319
- * of the column.
320
- * @param tableWithProperties table with columns that will become properties of the column.
401
+ * Change the values of the column.
402
+ * @param values the new values for the column.
403
+ * @param newType the new type of the column. Leave undefined for automatic inference.
321
404
  */
322
- setPropertyTable(tableWithProperties: ITidyTable): void;
405
+ setValues<P>(values: P[], newType?: AllowedColumnType<P>): void;
323
406
  /**
324
- * Return the properties of a column for a given cell index.
325
- * @param idx row index of cell.
407
+ * Apply a transformation to all values in the column. Note, this functions alters the values in the column.
408
+ * @param fun function with one parameter. Describes the transformation. In the function, index represents the
409
+ * index of the internal data structure.
410
+ * @param newType new type for the column. Leave blank for auto inference of the type.
326
411
  */
327
- getPropertiesAt(idx: number): Record<string, any>;
412
+ apply<P>(fun: (value: T, index: number) => P, newType?: AllowedColumnType<P>): void;
413
+ /**
414
+ * Inserts are sorted according to the insertion indices.
415
+ *
416
+ * e.g., add totals.
417
+ */
418
+ insertValues(inserts: Map<number, ITidyColumnAddValue>): void;
419
+ /**
420
+ * Repeat the values in the column.
421
+ *
422
+ * Examples:
423
+ * column.getValues() --> ['a','b','c']
424
+ * column.repeat(6,1) --> ['a','b','c','a','b','c']
425
+ * column.repeat(6,2) --> ['a','a','b','b','c','c']
426
+ * column.repeat(12,2) --> ['a','a','b','b','c','c','a','a','b','b','c','c']
427
+ *
428
+ * @param newLength new length of the array.
429
+ * @param repetition how many times to repeat each value.
430
+ */
431
+ repeat(newLength: number, repetition?: number): void;
432
+ /**
433
+ * Same as repeat but creating a new column leaving this column untouched.
434
+ *
435
+ * @see repeat
436
+ */
437
+ repeatN(newLength: number, repetition?: number): ITidyBaseColumn<T>;
438
+ /**
439
+ * Push a value to the end of the column's values.
440
+ */
441
+ pushValue(pushValue: ITidyColumnTypedValue): void;
328
442
  /**
329
- * For each row matching the lookup value call func()
443
+ * Apply a new index to the column and its properties (e.g., limiting rows, reordering rows, copying rows).
444
+ *
445
+ * Examples:
446
+ * <pre>
447
+ * initial values -> [ 'a', 'b', 'c']
448
+ * reIndex: [2,1,0] -> [ 'c', 'b', 'a']
449
+ * reIndex: [2,2,1] -> [ 'c', 'c', 'b']
450
+ * reIndex: [0,1,2,2] -> [ 'a', 'b', 'c','c']
451
+ * reIndex: [0] -> [ 'a' ]
452
+ * reIndex: [0,5] -> [ 'a', null ]
453
+ * </pre>
330
454
  *
331
- * @param lookupValue
332
- * @param func if false, stop the foreach
455
+ * @param index new row indices
456
+ *
457
+ * @see ITidyColumn.reIndexN
458
+ */
459
+ reIndex(index: number[]): void;
460
+ /**
461
+ * Set the formatted values. Use this if you have the formatted values pre-calculated
462
+ * or a function to calculate the formatted values.
463
+ */
464
+ setFormattedValues(formattedValues: (string | null)[] | ((value: T | undefined) => string)): void;
465
+ /**
466
+ * Return a new column with transformed values.
467
+ * @param fun function with one parameter. Describes the transformation.
468
+ * @param columnName the name of the new column.
469
+ * @param newType new type for the column. Leave blank for auto inference of the type.
333
470
  */
334
- forEachMatching(lookupValue: any, func: (rowIdx: number) => void | boolean): void;
471
+ mapToColumn<P>(fun: (value: T, index: number) => P, columnName: string, newType: AllowedColumnType<P>): ITidyBaseColumn<P>;
472
+ /**
473
+ *
474
+ * if it's an mdx axis, for each row of the undelying mdx Axis
475
+ * if no, for each row
476
+ *
477
+ * @see mdxAxis
478
+ */
479
+ mapAxisOrRows<K>(callbackfn: (rowIdx: number, column: ITidyBaseColumn<T>) => K): K[];
480
+ /**
481
+ * @param callbackfn if the return value is undefined do not map the row
482
+ */
483
+ mapAllRows<P>(callbackfn: (index: number, column: ITidyBaseColumn<T>) => P | undefined, forceMapAllRows?: boolean): P[];
484
+ /**
485
+ * Map the rows that are visible given a hierarchical axis and an array of boolean values
486
+ * @param expanded an array indicating for each index if it is expanded or not. If it is collapsed, then all
487
+ * children are not visible.
488
+ * @param fun function to apply
489
+ */
490
+ mapVisibleRows<P>(expanded: (rowIdx: number) => boolean, fun: (index: number) => P): P[];
491
+ mapTreeVisibleRows<P extends ReactElement>(expanded: (rowIdx: number) => boolean, fun: (index: number) => P, filter?: (info: MdxInfo) => boolean): P[];
335
492
  /**
336
493
  * Set a property on the column. If the property already exists, it is overwritten.
337
494
  * @param property the column to set as a property. Ensure that the lengths are the same.
338
495
  */
339
496
  setProperty(property: ITidyColumn): void;
340
497
  /**
341
- * Returns first value where callback does not return undefined.
342
- * @param callback given the row index, outputs a value or undefined.
498
+ * Delete a property on the column
343
499
  */
344
- findFirst<P>(callback: (idx: number) => P | undefined): P | undefined;
500
+ deleteProperty(propertyName: ITidyColumn | string): void;
345
501
  /**
346
502
  * @param column the initial selection as a column
347
503
  * @param items the initial selection (name, ...)
@@ -358,36 +514,12 @@ export interface ITidyBaseColumn<T> {
358
514
  */
359
515
  findRowIdxForSelection(sel: ITidyTableSelection, colIdx?: number, startIdx?: number): number | undefined;
360
516
  /**
361
- * If an error occurred in the calculation of cells for a column, then the error can be
362
- * retrieved using this function.
363
- * @param idx the row index of the cell to retrieve the error of.
364
- */
365
- getError(idx: number): TidyCellError | undefined;
366
- setErrors(errors: (TidyCellError | undefined)[]): void;
367
- /**
368
- * Returns the row index of the first occurrence where the values of this column equals value. Returns undefined
369
- * if it did not find the value.
517
+ * Returns the row index of the first occurrence where the values of this column equals value.
518
+ * Returns undefined if it did not find the value.
519
+ *
370
520
  * @param value value to search for.
371
521
  */
372
522
  getRowIndexOf(value: T): number | undefined;
373
- /**
374
- * Apply a function to the groups of unique values in this column
375
- */
376
- groupBy(): Map<T, number[]>;
377
- /**
378
- * Get the default member of the dimension that the column represents. Returns undefined
379
- * if the column is not a MDX dimension.
380
- */
381
- getHierarchyDefaultMember(): string | undefined;
382
- /**
383
- * Get extra information of the MDX axis used for this column, if available.
384
- */
385
- getAxisInfo(): IMdxAxisSeriesInfo | undefined;
386
- /**
387
- * Get the MDX axis coordinate, if available.
388
- * @see {AxisCoordinate}
389
- */
390
- getAxisCoordinate(): AxisCoordinate | undefined;
391
523
  /**
392
524
  * For a hierarchical columns returns a a list of transformed colummns columns as needed by a pivot
393
525
  * table like structure
@@ -405,99 +537,38 @@ export interface ITidyBaseColumn<T> {
405
537
  */
406
538
  getNodePath(rowIdx: number): number[];
407
539
  /**
408
- * Returns if present an action as defined by the properties of the columns
540
+ * Returns if present a notification as defined by the properties of the columns
409
541
  */
410
- getEventAction(rowIdx: number): [string, TidyActionEvent] | undefined;
542
+ getAppNotification(rowIdx: number): AppNotification | undefined;
411
543
  /**
412
- * Insert a column into this column.
413
- * @param column column to add.
414
- * @param index insert the column at this index. If undefined, insert at the start of the
415
- * this column.
544
+ * Returns if present an action as defined by the properties of the columns
416
545
  */
417
- insertColumn(column: ITidyColumn, index?: number): void;
546
+ getEventAction(rowIdx: number): [string, TidyActionEvent] | undefined;
418
547
  mapUniqueNames<T>(uniqueNames: string[], mapper: (idx: number) => T | null | undefined): T[];
419
- /**
420
- * Apply a new index to the column and its properties.
421
- *
422
- * Examples:
423
- * column.getValues() --> ['a','b','c']
424
- * column.reIndex([2,1,0]) --> ['c','b','a']
425
- * column.reIndex([2,2,1]) --> ['c','c','b']
426
- * column.reIndex([0]) --> ['a']
427
- * column.reIndex([0,5]) --> ['a',undefined]
428
- *
429
- * @param index list of integers.
430
- */
431
- reIndex(index: number[], keepingAxisOrder?: boolean): void;
432
- slice(index: number[]): ITidyBaseColumn<T>;
433
- /**
434
- * Repeat the values in the column.
435
- *
436
- * Examples:
437
- * column.getValues() --> ['a','b','c']
438
- * column.repeat(6,1) --> ['a','b','c','a','b','c']
439
- * column.repeat(6,2) --> ['a','a','b','b','c','c']
440
- * column.repeat(12,2) --> ['a','a','b','b','c','c','a','a','b','b','c','c']
441
- *
442
- * @param newLength new length of the array.
443
- * @param repetition how many times to repeat each value.
444
- */
445
- repeat(newLength: number, repetition?: number): void;
446
- /**
447
- * Function used for value comparison in sorting and ranking. Return a positive number if a > b, a negative
448
- * number if a < b and 0 otherwise. Add the sorting type if nulls and NaNs should be pushed to the back of the
449
- * column.
450
- * @param a value 1
451
- * @param b value 2
452
- */
453
- compare(a: T, b: T): number;
454
- isNumeric(): this is ITidyNumericColumn;
455
- isVector(): this is ITidyVectorColumn;
456
- isDatetime(): this is ITidyDateColumn;
457
- isCharacter(): this is ITidyCharacterColumn;
458
- isLogical(): this is ITidyLogicalColumn;
459
- isColor(): this is ITidyColorColumn;
460
- /**
461
- * Convert the column to another type. This modifies the values to be of that type.
462
- */
463
- convertToType(type: TidyColumnsType): void;
464
- /**
465
- * Change the type of the column. Note, only types that model the values in the column are allowed. For conversion,
466
- * use {@link convertToType}
467
- * @param type
468
- */
469
- setType(type: AllowedColumnType<T>): void;
470
- getType(): AllowedColumnType<T>;
471
548
  /**
472
549
  * Cell decoration
473
550
  */
474
- setCellDecoration(decoration: Partial<PublicTidyColumnCellDecoration>): void;
475
- getCellDecoration(): Partial<PublicTidyColumnCellDecoration>;
476
- /**
477
- * Set a value in the cache of the column.
478
- */
479
- setCachedValue(key: string, value: any): void;
480
- /**
481
- * Get a value from the columns cache.
482
- */
483
- getCachedValue(key: string): any;
484
- /**
485
- * Clear the columns cache.
486
- */
487
- clearCache(): void;
551
+ setCellDecoration(decoration: PublicTidyColumnCellDecoration): void;
488
552
  }
489
- export interface PublicTidyColumnCellDecoration {
490
- rendered: (rowIdx: number) => React.ReactElement;
553
+ export declare type PublicTidyColumnCellDecoration = Partial<{
554
+ handlesCellsOnError: boolean;
555
+ appliesToCell: (rowIdx: number) => boolean;
556
+ rendered: (rowIdx: number, sizing?: {
557
+ width: number;
558
+ height: number;
559
+ }) => React.ReactElement;
491
560
  cssStyles: (rowIdx: number) => Record<string, any> | undefined;
492
- }
561
+ }>;
493
562
  export declare type ITidyColumn = ITidyBaseColumn<any>;
494
- export declare type ITidyUnknownColumn = ITidyBaseColumn<unknown>;
563
+ export declare type ITidyUnknownColumn = ITidyBaseColumn<unknown | null>;
564
+ export declare type ITidyNullColumn = ITidyBaseColumn<null>;
495
565
  export declare type ITidyNumericColumn = ITidyBaseColumn<number | null>;
496
566
  export declare type ITidyCharacterColumn = ITidyBaseColumn<string | null>;
497
- export declare type ITidyColorColumn = ITidyBaseColumn<string | null>;
567
+ export declare type ITidyColorColumn = ITidyBaseColumn<Property.Color | null>;
498
568
  export declare type ITidyDateColumn = ITidyBaseColumn<Date | null>;
499
569
  export declare type ITidyLogicalColumn = ITidyBaseColumn<boolean | null>;
500
- export declare type ITidyVectorColumn = ITidyBaseColumn<any[] | null>;
570
+ export declare type ITidyListColumn = ITidyBaseColumn<any[] | null>;
571
+ export declare type ITidyColumnIsType<T extends TidyColumnsType> = T extends TidyColumnsType.ANY ? ITidyColumn : T extends TidyColumnsType.COLOR ? ITidyColorColumn : T extends TidyColumnsType.LONGITUDE ? ITidyBaseColumn<number | null> : T extends TidyColumnsType.LATITUDE ? ITidyBaseColumn<number | null> : T extends TidyColumnsType.ISO2_LOCATION_CODE ? ITidyCharacterColumn : T extends TidyColumnsType.DATETIME ? ITidyDateColumn : T extends TidyColumnsType.NUMERIC ? ITidyNumericColumn : T extends TidyColumnsType.CHARACTER ? ITidyCharacterColumn : T extends TidyColumnsType.LOGICAL ? ITidyLogicalColumn : T extends TidyColumnsType.LIST ? ITidyListColumn : T extends TidyColumnsType.MIXED ? ITidyColumn : T extends TidyColumnsType.NULL ? ITidyNullColumn : ITidyUnknownColumn;
501
572
  /**
502
573
  * Introduced for tidy table HTML expression (e.g., tooltip) completion.
503
574
  *
@@ -510,3 +581,4 @@ export interface TidyTableExprColumnMeta {
510
581
  }
511
582
  export declare const TidyTableTextExprColumnMetas: TidyTableExprColumnMeta[];
512
583
  export declare const TidyTableNumberExprColumnMetas: TidyTableExprColumnMeta[];
584
+ export {};