@ic3/reporting-api 8.0.0-alpha.6 → 8.0.0-rc.3

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