@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.
- package/dist/ApiUtils.d.ts +10 -0
- package/dist/ApiUtils.js +25 -1
- package/dist/ApiUtils.js.map +1 -1
- package/dist/INotification.d.ts +32 -0
- package/dist/INotification.js +3 -0
- package/dist/INotification.js.map +1 -0
- package/dist/IPluginDefinition.d.ts +4 -1
- package/dist/IReporting.d.ts +41 -4
- package/dist/IThemeManager.d.ts +13 -18
- package/dist/IThemeManager.js.map +1 -1
- package/dist/ITidyTableTransformation.d.ts +20 -1
- package/dist/IWidgetVariantManager.d.ts +20 -2
- package/dist/LazyTreeView.d.ts +43 -1
- package/dist/LazyTreeView.js +5 -1
- package/dist/LazyTreeView.js.map +1 -1
- package/dist/Loader.d.ts +10 -0
- package/dist/Loader.js +33 -0
- package/dist/Loader.js.map +1 -0
- package/dist/PublicContext.d.ts +75 -10
- package/dist/PublicContext.js.map +1 -1
- package/dist/PublicLayout.d.ts +6 -6
- package/dist/PublicTemplate.d.ts +161 -58
- package/dist/PublicTemplate.js +16 -1
- package/dist/PublicTemplate.js.map +1 -1
- package/dist/PublicTemplateForm.d.ts +131 -29
- package/dist/PublicTemplateForm.js +7 -1
- package/dist/PublicTemplateForm.js.map +1 -1
- package/dist/PublicTheme.d.ts +114 -69
- package/dist/PublicTheme.js.map +1 -1
- package/dist/PublicTidyColumn.d.ts +327 -259
- package/dist/PublicTidyColumn.js +48 -2
- package/dist/PublicTidyColumn.js.map +1 -1
- package/dist/PublicTidyHistogram.d.ts +24 -0
- package/dist/PublicTidyHistogram.js +77 -0
- package/dist/PublicTidyHistogram.js.map +1 -0
- package/dist/PublicTidyMath.d.ts +49 -45
- package/dist/PublicTidyMath.js +0 -280
- package/dist/PublicTidyMath.js.map +1 -1
- package/dist/PublicTidyTable.d.ts +170 -154
- package/dist/PublicTidyTableInteractions.d.ts +30 -23
- package/dist/PublicTidyTableInteractions.js +5 -4
- package/dist/PublicTidyTableInteractions.js.map +1 -1
- package/dist/PublicTidyTableTypes.d.ts +133 -55
- package/dist/PublicTidyTableTypes.js +35 -18
- package/dist/PublicTidyTableTypes.js.map +1 -1
- package/dist/PublicTidyTree.d.ts +27 -37
- package/dist/PublicTidyTree.js +30 -58
- package/dist/PublicTidyTree.js.map +1 -1
- package/dist/RemoteContainerUtils.d.ts +1 -1
- package/dist/RemoteContainerUtils.js +9 -1
- package/dist/RemoteContainerUtils.js.map +1 -1
- package/dist/ReportingVersion.d.ts +1 -1
- package/dist/ReportingVersion.js +1 -1
- package/dist/ReportingVersion.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/theme/ThemeFilterAutocomplete.d.ts +30 -0
- package/dist/theme/ThemeFilterAutocomplete.js +23 -0
- package/dist/theme/ThemeFilterAutocomplete.js.map +1 -0
- package/dist/theme/ThemeFilterButtons.d.ts +28 -3
- package/dist/theme/ThemeFilterButtons.js +9 -3
- package/dist/theme/ThemeFilterButtons.js.map +1 -1
- package/dist/theme/ThemeFilterCheckboxes.d.ts +18 -0
- package/dist/theme/ThemeFilterCheckboxes.js +11 -0
- package/dist/theme/ThemeFilterCheckboxes.js.map +1 -0
- package/dist/theme/ThemeFilterSlider.d.ts +47 -0
- package/dist/theme/ThemeFilterSlider.js +29 -0
- package/dist/theme/ThemeFilterSlider.js.map +1 -0
- package/dist/theme/ThemeFilterTree.d.ts +70 -0
- package/dist/theme/ThemeFilterTree.js +11 -0
- package/dist/theme/ThemeFilterTree.js.map +1 -0
- package/dist/theme/ThemeGoogleMapMarker.d.ts +51 -0
- package/dist/theme/ThemeGoogleMapMarker.js +3 -0
- package/dist/theme/ThemeGoogleMapMarker.js.map +1 -0
- package/dist/theme/ThemeHtmlBox.d.ts +7 -1
- package/dist/theme/ThemePivotTable.d.ts +23 -0
- package/dist/theme/ThemePivotTable.js +21 -0
- package/dist/theme/ThemePivotTable.js.map +1 -0
- package/dist/theme/ThemeTable.d.ts +15 -0
- package/dist/theme/ThemeTable.js +5 -0
- package/dist/theme/ThemeTable.js.map +1 -0
- package/package.json +11 -10
|
@@ -1,17 +1,60 @@
|
|
|
1
|
-
import { AxisCoordinate, EntityItem, IMdxAxisSeriesInfo, ITidyTableSelection, MdxInfo,
|
|
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
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
*
|
|
142
|
+
* E.g., datetime column: YEAR, ...
|
|
81
143
|
*/
|
|
82
|
-
|
|
144
|
+
getSubType(): TidyColumnsSubType | undefined;
|
|
83
145
|
/**
|
|
84
|
-
*
|
|
85
|
-
* @param
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* @param
|
|
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
|
-
|
|
201
|
+
groupBy(): Map<string, number[]>;
|
|
120
202
|
/**
|
|
121
|
-
*
|
|
203
|
+
* Same as reIndex but creating a new column leaving this column untouched.
|
|
122
204
|
*
|
|
123
|
-
* @
|
|
205
|
+
* @see ITidyBaseColumn.reIndex
|
|
124
206
|
*/
|
|
125
|
-
|
|
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
|
-
*
|
|
235
|
+
* Return the formatted value. Fallback on the value itself.
|
|
140
236
|
*/
|
|
141
|
-
|
|
237
|
+
getFormattedValueOrValue(idx: number): string | undefined;
|
|
142
238
|
getNumberFormatInfo(): string | undefined;
|
|
143
239
|
/**
|
|
144
|
-
*
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
245
|
+
getExcelCell(idx: number): ITidyColumnXlsxCell | undefined;
|
|
158
246
|
/**
|
|
159
|
-
*
|
|
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
|
-
|
|
249
|
+
getXGridType(): "string" | "number" | "date" | "dateTime" | "boolean" | undefined;
|
|
165
250
|
/**
|
|
166
|
-
*
|
|
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
|
-
|
|
253
|
+
getCellDecoration(): PublicTidyColumnCellDecoration | undefined;
|
|
172
254
|
/**
|
|
173
|
-
*
|
|
255
|
+
* Returns true if the column has a property of requested name.
|
|
174
256
|
*/
|
|
175
|
-
|
|
257
|
+
hasProperty(name: ITidyColumnNamedProperties | string): boolean;
|
|
176
258
|
/**
|
|
177
|
-
*
|
|
259
|
+
* Returns true if the column has color property or is a color column
|
|
178
260
|
*/
|
|
179
|
-
|
|
261
|
+
hasColorProperty(): boolean;
|
|
180
262
|
/**
|
|
181
|
-
*
|
|
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
|
|
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
|
-
|
|
268
|
+
getColorColumn(): ITidyColorColumn | undefined;
|
|
188
269
|
/**
|
|
189
|
-
* Returns
|
|
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
|
-
|
|
275
|
+
getColor(rowIdx: number): Property.Color | undefined;
|
|
192
276
|
/**
|
|
193
|
-
* Returns the
|
|
277
|
+
* Returns the property at the specified property coordinate.
|
|
278
|
+
* @param name name of the property.
|
|
194
279
|
*/
|
|
195
|
-
|
|
280
|
+
getProperty(name: ITidyColumnNamedProperties | string): ITidyUnknownColumn;
|
|
196
281
|
/**
|
|
197
|
-
*
|
|
198
|
-
*
|
|
282
|
+
* Returns the property at the specified property coordinate.
|
|
283
|
+
* @param name name of the property.
|
|
199
284
|
*/
|
|
200
|
-
|
|
285
|
+
getOptionalProperty(name: ITidyColumnNamedProperties | string): ITidyUnknownColumn | undefined;
|
|
201
286
|
/**
|
|
202
|
-
* Get the
|
|
203
|
-
*
|
|
204
|
-
* @param
|
|
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
|
-
|
|
291
|
+
getPropertyAt(name: ITidyColumnNamedProperties | string, rowIdx: number): any;
|
|
207
292
|
/**
|
|
208
|
-
*
|
|
293
|
+
* Return the properties of a column for a given cell index.
|
|
294
|
+
*
|
|
295
|
+
* @param idx row index of cell.
|
|
209
296
|
*/
|
|
210
|
-
|
|
211
|
-
[key: string]: T;
|
|
212
|
-
}[];
|
|
297
|
+
getPropertiesAt(idx: number): Record<string, any>;
|
|
213
298
|
/**
|
|
214
|
-
*
|
|
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
|
-
|
|
301
|
+
getPropertiesAsColumns(): ITidyUnknownColumn[];
|
|
219
302
|
isWithEntityItem(): boolean;
|
|
220
|
-
getEntityItem(idx: number): EntityItem | undefined;
|
|
221
|
-
getMdxCoordinates(rowIdx: number): [number, number, number] | [];
|
|
222
303
|
/**
|
|
223
|
-
*
|
|
304
|
+
* Create and return the entity item at position idx for generating events.
|
|
224
305
|
*/
|
|
225
|
-
|
|
306
|
+
getEntityItem(idx: number): EntityItem | undefined;
|
|
226
307
|
/**
|
|
227
|
-
* Get the index of the parent. Returns
|
|
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
|
-
*
|
|
262
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
272
|
-
hasMdxChildren(rowIdx: number): boolean;
|
|
332
|
+
getMdxCoordinates(rowIdx: number): MdxMemberCoordinates | undefined;
|
|
273
333
|
/**
|
|
274
|
-
*
|
|
334
|
+
* Get the array of MDX info in the column.
|
|
335
|
+
* Returns an empty array if there is no MDX info.
|
|
275
336
|
*/
|
|
276
|
-
|
|
337
|
+
getMdxInfos(): (MdxInfo | undefined)[];
|
|
277
338
|
/**
|
|
278
|
-
* Returns
|
|
339
|
+
* Returns the MDX info at a row index.
|
|
279
340
|
*/
|
|
280
|
-
|
|
341
|
+
getMdxInfo(idx: number): MdxInfo | undefined;
|
|
281
342
|
/**
|
|
282
|
-
*
|
|
283
|
-
* @param name name of the property.
|
|
343
|
+
* Get extra information of the MDX axis used for this column, if available.
|
|
284
344
|
*/
|
|
285
|
-
|
|
345
|
+
getAxisInfo(): IMdxAxisSeriesInfo | undefined;
|
|
286
346
|
/**
|
|
287
|
-
*
|
|
288
|
-
* @
|
|
347
|
+
* Get the MDX axis coordinate, if available.
|
|
348
|
+
* @see {AxisCoordinate}
|
|
289
349
|
*/
|
|
290
|
-
|
|
350
|
+
getAxisCoordinate(): AxisCoordinate | undefined;
|
|
291
351
|
/**
|
|
292
|
-
* Get the
|
|
293
|
-
*
|
|
294
|
-
*
|
|
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
|
-
|
|
358
|
+
mdxAxis(): ReadonlyArray<T> | undefined;
|
|
297
359
|
/**
|
|
298
|
-
*
|
|
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
|
-
|
|
370
|
+
setName(name: string): void;
|
|
302
371
|
/**
|
|
303
|
-
*
|
|
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
|
|
306
|
-
*
|
|
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
|
-
|
|
387
|
+
convertToType(type: TidyColumnsType, settings?: ConvertToTypeParseSettings): void;
|
|
309
388
|
/**
|
|
310
|
-
*
|
|
389
|
+
* Same as convertToType but creating a new column.
|
|
311
390
|
*/
|
|
312
|
-
|
|
391
|
+
convertToTypeN(type: TidyColumnsType, settings?: ConvertToTypeParseSettings): ITidyBaseColumn<T>;
|
|
313
392
|
/**
|
|
314
|
-
*
|
|
393
|
+
* Create a new column with the content of this column changing both its name and its caption.
|
|
315
394
|
*/
|
|
316
|
-
|
|
395
|
+
duplicate(name: string, caption: string): ITidyBaseColumn<T>;
|
|
317
396
|
/**
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* @param
|
|
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
|
-
|
|
401
|
+
setValues<P>(values: P[], newType?: AllowedColumnType<P>): void;
|
|
323
402
|
/**
|
|
324
|
-
*
|
|
325
|
-
* @param
|
|
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
|
-
|
|
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
|
-
*
|
|
332
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
342
|
-
* @param callback given the row index, outputs a value or undefined.
|
|
494
|
+
* Delete a property on the column
|
|
343
495
|
*/
|
|
344
|
-
|
|
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
|
-
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
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
|
|
536
|
+
* Returns if present a notification as defined by the properties of the columns
|
|
409
537
|
*/
|
|
410
|
-
|
|
538
|
+
getAppNotification(rowIdx: number): AppNotification | undefined;
|
|
411
539
|
/**
|
|
412
|
-
*
|
|
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
|
-
|
|
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:
|
|
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
|
|
490
|
-
|
|
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<
|
|
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
|
|
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 {};
|