@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,14 +1,81 @@
1
1
  import { ITidyTable } from "./PublicTidyTable";
2
- import { ChartTemplateDataMapping, TidyColumnsType } from "./PublicTidyTableTypes";
3
2
  import { ITidyTableInteraction } from "./PublicTidyTableInteractions";
4
3
  import { IWidgetPublicContext } from "./PublicContext";
5
- import { FormFieldDef, FormFieldObject, FormFields } from "./PublicTemplateForm";
4
+ import { FormFieldDef, FormFieldObject, FormFields, IFormColumnChooserFieldDef } from "./PublicTemplateForm";
6
5
  import { IWidgetVariantManager } from "./IWidgetVariantManager";
7
6
  import { ITidyColumn } from "./PublicTidyColumn";
8
7
  import { ReactElement } from "react";
9
- import { Theme } from "@material-ui/core/styles";
8
+ import { Theme } from "@mui/material/styles";
10
9
  declare type ChartTemplateWidgetProps = any;
11
10
  export declare type IPublicWidgetTemplateDefinition<T extends FormFieldObject> = IPublicWidgetReactTemplateDefinition<T> | IPublicWidgetJsTemplateDefinition<T>;
11
+ export declare enum IWidgetTemplateMdxBuilderAxisPropsConstraint {
12
+ DateType = "DateType",
13
+ GeoLatLong = "GeoLatLong",
14
+ GeoIso2Code = "GeoIso2Code"
15
+ }
16
+ export interface IWidgetTemplateMdxBuilderAxisProps {
17
+ /**
18
+ * Unique name used in the UI and if mdxAxisName not defined for building the query.
19
+ * If name is 'rows' for example, then in the query it will use 'ON "rows"'.
20
+ */
21
+ name: string;
22
+ /**
23
+ * The axis can be empty
24
+ */
25
+ isOptional?: true;
26
+ /**
27
+ * All axes with the same (not null) value for mdxAxisName are put as a tuple on the same axis. And the roles are
28
+ * comma separated.
29
+ */
30
+ mdxAxisName?: string;
31
+ /**
32
+ * Disable empty
33
+ */
34
+ disableNonEmpty?: true;
35
+ /**
36
+ * For filters add lazy load feature to the axis
37
+ */
38
+ addLazyLoad?: true;
39
+ /**
40
+ * Allow only a single member
41
+ */
42
+ singleMember?: true;
43
+ /**
44
+ * Allow a multiple hierarchies to build a crossjoin
45
+ */
46
+ multipleHierarchy?: true;
47
+ /**
48
+ * Additional constraints for the set/members
49
+ */
50
+ constraint?: IWidgetTemplateMdxBuilderAxisPropsConstraint;
51
+ decoration?: {
52
+ with?: string;
53
+ set: string;
54
+ };
55
+ /**
56
+ * Show the mdxAxis names in this order in the builder
57
+ */
58
+ showOrder?: number;
59
+ }
60
+ export interface IWidgetTemplateMdxBuilderMapping {
61
+ /**
62
+ * The order determines the order of the statements in the query. E.g., the first position is ON 0, the second ON 1,
63
+ * etc., where '0' and '1' are replaced by the name.
64
+ */
65
+ mdxAxis: Readonly<IWidgetTemplateMdxBuilderAxisProps[]>;
66
+ /**
67
+ * The generated Mdx is for a filter (the cell values are not of interest)
68
+ */
69
+ mdxIsForFilter?: true;
70
+ /**
71
+ * the cell values are not needed
72
+ */
73
+ withoutCellValues?: true;
74
+ /**
75
+ * an MDX query if the builder is empty
76
+ */
77
+ mdxQueryIfEmpty?: boolean;
78
+ }
12
79
  /**
13
80
  * A widget that renders using React.
14
81
  *
@@ -56,6 +123,14 @@ export interface IPublicWidgetJsTemplateDefinition<T extends FormFieldObject> ex
56
123
  jsCode: (context: IWidgetPublicContext, container: HTMLDivElement) => IPublicJsChartTemplate<T>;
57
124
  reactComponent?: false;
58
125
  }
126
+ /**
127
+ * List of special selection granularities (column selectors)
128
+ */
129
+ export declare enum SelectionGranularityOptions {
130
+ PivotTableTopHeader = "ic3pivotTableTopHeader",
131
+ PivotTableLeftHeader = "ic3pivotTableLeftHeader",
132
+ PivotTableCell = "ic3pivotTableCell"
133
+ }
59
134
  /**
60
135
  * Definition - static - of a widget template
61
136
  */
@@ -66,7 +141,7 @@ interface IPublicCommonWidgetTemplateDefinition {
66
141
  */
67
142
  type: WidgetTemplateDefinitionType;
68
143
  /**
69
- * Unique within the plugin. Must not contain any dot.
144
+ * Unique within the plugin. Must not contain any dot (this is NOT the templateId)
70
145
  *
71
146
  * The widget chooser is using that id to localize its name and description.
72
147
  *
@@ -76,6 +151,18 @@ interface IPublicCommonWidgetTemplateDefinition {
76
151
  * </pre>
77
152
  */
78
153
  id: string;
154
+ /**
155
+ * Internal usage: while investigating lazy registration (setup upon registration).
156
+ */
157
+ debug?: string;
158
+ /**
159
+ * Internal usage: pluginId.templateId (setup upon registration).
160
+ */
161
+ qualifiedId?: string;
162
+ /**
163
+ * Internal usage: pluginId (setup upon registration).
164
+ */
165
+ pluginId?: string;
79
166
  /**
80
167
  * Used for localization right now.
81
168
  *
@@ -95,15 +182,23 @@ interface IPublicCommonWidgetTemplateDefinition {
95
182
  * in the "Maps" group in the widget chooser.
96
183
  */
97
184
  groupId: string;
98
- /**
99
- * Internal usage: pluginID.id
100
- */
101
- qualifiedId?: string;
102
185
  /**
103
186
  * A way to ensure we do not display in the widget chooser templates that cannot
104
187
  * be used because the rendering depends on a given theme.
105
188
  */
106
189
  dependsOnTheme?: string;
190
+ /**
191
+ * A sort of "preview" of the widget in the widget chooser. Providing an empty string will display a default image.
192
+ *
193
+ * <pre>
194
+ * import donut from "./images/donut.svg";
195
+ *
196
+ * {
197
+ * image: "donut",
198
+ * }
199
+ * </pre>
200
+ */
201
+ image: string;
107
202
  /**
108
203
  * No widget box decoration.
109
204
  */
@@ -122,7 +217,13 @@ interface IPublicCommonWidgetTemplateDefinition {
122
217
  withoutQuery?: boolean;
123
218
  withoutSelection?: boolean;
124
219
  withoutDrilldown?: boolean;
220
+ withoutEvents?: boolean;
125
221
  withoutUserMenu?: boolean;
222
+ withoutGlobalFilter?: boolean;
223
+ /**
224
+ * Otherwise the widget box is rendering a floating icon to mention some data errors.
225
+ */
226
+ handleCellsOnError?: boolean;
126
227
  renderIfNotInViewport?: boolean;
127
228
  /**
128
229
  * This widget needs to render even if its query has not been executed yet. The default is false.
@@ -138,12 +239,30 @@ interface IPublicCommonWidgetTemplateDefinition {
138
239
  * header is repeating on each page.
139
240
  */
140
241
  withOptionAutoExpandKeepTableHeader?: boolean;
242
+ /**
243
+ * If and only if not null, hide option 'Interactions' > 'Drilldown' > 'Pivot Table Like' and set it default value to withDrilldownPivotTableLikeAs.
244
+ */
245
+ withDrilldownPivotTableLikeAs?: boolean;
141
246
  userMenuOptions?: string[];
247
+ /**
248
+ * Additional widget user menu options when in editing mode.
249
+ */
142
250
  userMenuOptionsOnEditing?: string[];
251
+ /**
252
+ * Disables the user menu option to switch between selection and drilldown
253
+ *
254
+ * E.g a Pivot table can manage both modes
255
+ */
256
+ userMenuDisableInteractionMode?: boolean;
143
257
  /**
144
258
  * @deprecated
145
259
  */
146
260
  withoutTidyTable?: boolean;
261
+ /**
262
+ * This widget knows how to render a result without any data.
263
+ * (e.g., data picker)
264
+ */
265
+ handlesNoData?: boolean;
147
266
  /**
148
267
  * This widget is responsible to notify its rendered status. Required with asynchronous rendering
149
268
  * (e.g., Google maps).
@@ -152,27 +271,32 @@ interface IPublicCommonWidgetTemplateDefinition {
152
271
  */
153
272
  handlesWidgetStatus?: boolean;
154
273
  eventRoles?: ITemplateEventActionDef;
155
- /**
156
- * The meta information that defined which data column to use in the widget.
157
- */
158
- dataMappingMeta?: IWidgetTemplateDataMappingDef[];
274
+ selection?: {
275
+ /**
276
+ * The list of columns that can be part of the selection. The end-user can then select the actual
277
+ * columns from the Interaction/Selection configuration (see Selection Granularity).
278
+ */
279
+ allowedColumns: (column: ITidyColumn) => boolean;
280
+ optionValues?: undefined;
281
+ } | {
282
+ allowedColumns?: undefined;
283
+ optionValues?: SelectionGranularityOptions[];
284
+ };
285
+ mdxBuilderSettings?: IWidgetTemplateMdxBuilderMapping;
159
286
  /**
160
287
  * The meta information required for editing the widget options.
161
288
  */
162
289
  chartOptionsMeta?: FormFieldDef[] | FormFields<FormFieldObject>;
163
- registerVariants?: (theme: Theme, manager: IWidgetVariantManager) => void;
164
290
  /**
165
- * A sort of "preview" of the widget in the widget chooser. Providing an empty string will display a default image.
166
- *
291
+ * When registering a variant add the following field editor meta:
167
292
  * <pre>
168
- * import donut from "./images/donut.svg";
169
- *
170
- * {
171
- * image: "donut",
172
- * }
293
+ * widgetVariant: {
294
+ * fieldType: "widgetVariant",
295
+ * localizationTag: "variant" // icCube localization,
296
+ * },
173
297
  * </pre>
174
298
  */
175
- image: string;
299
+ registerVariants?: (theme: Theme, manager: IWidgetVariantManager) => void;
176
300
  /**
177
301
  * e.g., amCharts4.
178
302
  * */
@@ -181,9 +305,15 @@ interface IPublicCommonWidgetTemplateDefinition {
181
305
  * Whether or not that component is using React for rendering.
182
306
  */
183
307
  reactComponent?: boolean;
184
- selection?: {
185
- allowedColumns: (column: ITidyColumn) => boolean;
186
- };
308
+ resolveDefinition?: (library: IResolveDefinitionLibrary) => Promise<IPublicWidgetTemplateDefinition<any>>;
309
+ /**
310
+ * When defining new widgets using amCharts 4, this method registers the icCube license.
311
+ */
312
+ registerAmCharts4?: (callback: (am4core: any) => void) => void;
313
+ /**
314
+ * When opening "Use Global Filter" option on Interaction tab
315
+ */
316
+ enableUseGlobalFilter?: boolean;
187
317
  }
188
318
  /**
189
319
  * *********************************************************************************************************************
@@ -197,7 +327,6 @@ export declare enum WidgetTemplateDefinitionType {
197
327
  Misc = "misc"
198
328
  }
199
329
  export interface IChartVisualizationInput {
200
- mapping: ChartTemplateDataMapping;
201
330
  table: ITidyTable;
202
331
  inter: ITidyTableInteraction;
203
332
  options: {
@@ -207,47 +336,18 @@ export interface IChartVisualizationInput {
207
336
  export interface IWidgetTemplateTidyData {
208
337
  table: ITidyTable;
209
338
  inter: ITidyTableInteraction;
210
- mapping: ChartTemplateDataMapping;
211
339
  }
212
340
  export interface IChartVisualizationTypedInput<T extends FormFieldObject> {
213
341
  table: ITidyTable;
214
342
  inter: ITidyTableInteraction;
215
- mapping: ChartTemplateDataMapping;
216
343
  options: T;
217
344
  }
218
345
  /**
219
- * The mapping meta describes the coordinate system of the chart (e.g. axis, groups, values).
220
- * An error occurs when the columns in the mapping do not uniquely identify each row in the table.
346
+ * The mapping meta are all the column that the user can select in the chart options. These options are checked for
347
+ * validity. The widget generates an error if columns are selected that are not in the allowed properties, or if
348
+ * columns are mandatory but there is no selection or fallback.
221
349
  */
222
- export interface IWidgetTemplateDataMappingDef {
223
- /**
224
- * The alias for the column.
225
- */
226
- mappingName: string;
227
- /**
228
- * When defined, adds the mapping options to a group in the widget editor.
229
- */
230
- mappingGroup?: string;
231
- /**
232
- * When defined, the value is added as a prefix to the fieldPath to defined the localization tag.
233
- */
234
- mappingTag?: string;
235
- /**
236
- * Only columns of this/these type(s) are allowed.
237
- */
238
- allowedTypes: TidyColumnsType[] | ((column: ITidyColumn) => boolean);
239
- /**
240
- * If true, fallback to a column that is both an Mdx axis and has a type that is allowed.
241
- * Note, properties of columns are not considered.
242
- */
243
- fallback?: boolean;
244
- /**
245
- * A column must be mapped to this alias, either by fallback or by user input.
246
- * Throw an error of no column is mapped to this alias.
247
- */
248
- mandatory?: boolean;
249
- isForDrilldown?: boolean;
250
- }
350
+ export declare type IWidgetTemplateDataMappingDef = IFormColumnChooserFieldDef;
251
351
  /**
252
352
  * Predefined roles
253
353
  */
@@ -285,4 +385,7 @@ export interface ITemplateEventActionDef {
285
385
  */
286
386
  selectionSubscribe?: string;
287
387
  }
388
+ export interface IResolveDefinitionLibrary {
389
+ wrapTemplateDefinition(id: string): Promise<IPublicWidgetTemplateDefinition<any>>;
390
+ }
288
391
  export {};
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TemplateEventActionNames = exports.WidgetTemplateDefinitionType = void 0;
3
+ exports.TemplateEventActionNames = exports.WidgetTemplateDefinitionType = exports.SelectionGranularityOptions = exports.IWidgetTemplateMdxBuilderAxisPropsConstraint = void 0;
4
+ var IWidgetTemplateMdxBuilderAxisPropsConstraint;
5
+ (function (IWidgetTemplateMdxBuilderAxisPropsConstraint) {
6
+ IWidgetTemplateMdxBuilderAxisPropsConstraint["DateType"] = "DateType";
7
+ IWidgetTemplateMdxBuilderAxisPropsConstraint["GeoLatLong"] = "GeoLatLong";
8
+ IWidgetTemplateMdxBuilderAxisPropsConstraint["GeoIso2Code"] = "GeoIso2Code";
9
+ })(IWidgetTemplateMdxBuilderAxisPropsConstraint = exports.IWidgetTemplateMdxBuilderAxisPropsConstraint || (exports.IWidgetTemplateMdxBuilderAxisPropsConstraint = {}));
10
+ /**
11
+ * List of special selection granularities (column selectors)
12
+ */
13
+ var SelectionGranularityOptions;
14
+ (function (SelectionGranularityOptions) {
15
+ SelectionGranularityOptions["PivotTableTopHeader"] = "ic3pivotTableTopHeader";
16
+ SelectionGranularityOptions["PivotTableLeftHeader"] = "ic3pivotTableLeftHeader";
17
+ SelectionGranularityOptions["PivotTableCell"] = "ic3pivotTableCell";
18
+ })(SelectionGranularityOptions = exports.SelectionGranularityOptions || (exports.SelectionGranularityOptions = {}));
4
19
  /**
5
20
  * *********************************************************************************************************************
6
21
  * DO NOT CHANGE THEIR VALUE : USED FOR FINDING THE DOCUMENTATION.
@@ -1 +1 @@
1
- {"version":3,"file":"PublicTemplate.js","sourceRoot":"","sources":["../src/PublicTemplate.ts"],"names":[],"mappings":";;;AAwOA;;;;GAIG;AACH,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACpC,+CAAe,CAAA;IACf,iDAAiB,CAAA;IACjB,2CAAW,CAAA;IACX,6CAAa,CAAA;AACjB,CAAC,EALW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAKvC;AAuED;;GAEG;AACH,IAAY,wBAMX;AAND,WAAY,wBAAwB;IAChC,mDAAuB,CAAA;IAEvB,gBAAgB;IAChB,0DAA8B,CAAA;IAC9B,iEAAqC,CAAA;AACzC,CAAC,EANW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAMnC"}
1
+ {"version":3,"file":"PublicTemplate.js","sourceRoot":"","sources":["../src/PublicTemplate.ts"],"names":[],"mappings":";;;AAcA,IAAY,4CAIX;AAJD,WAAY,4CAA4C;IACpD,qEAAqB,CAAA;IACrB,yEAAyB,CAAA;IACzB,2EAA2B,CAAA;AAC/B,CAAC,EAJW,4CAA4C,GAA5C,oDAA4C,KAA5C,oDAA4C,QAIvD;AA8ID;;GAEG;AAEH,IAAY,2BAIX;AAJD,WAAY,2BAA2B;IACnC,6EAA8C,CAAA;IAC9C,+EAAgD,CAAA;IAChD,mEAAoC,CAAA;AACxC,CAAC,EAJW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAItC;AAiOD;;;;GAIG;AACH,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACpC,+CAAe,CAAA;IACf,iDAAiB,CAAA;IACjB,2CAAW,CAAA;IACX,6CAAa,CAAA;AACjB,CAAC,EALW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAKvC;AAkCD;;GAEG;AACH,IAAY,wBAMX;AAND,WAAY,wBAAwB;IAChC,mDAAuB,CAAA;IAEvB,gBAAgB;IAChB,0DAA8B,CAAA;IAC9B,iEAAqC,CAAA;AACzC,CAAC,EANW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAMnC"}