@ic3/reporting-api 8.0.0-alpha.9 → 8.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/ApiUtils.d.ts +10 -0
  2. package/dist/ApiUtils.js +25 -1
  3. package/dist/ApiUtils.js.map +1 -1
  4. package/dist/INotification.d.ts +33 -0
  5. package/dist/INotification.js +3 -0
  6. package/dist/INotification.js.map +1 -0
  7. package/dist/IPluginDefinition.d.ts +4 -1
  8. package/dist/IReporting.d.ts +43 -4
  9. package/dist/IThemeManager.d.ts +1 -1
  10. package/dist/ITidyTableTransformation.d.ts +20 -1
  11. package/dist/ITypes.d.ts +3 -0
  12. package/dist/ITypes.js +3 -0
  13. package/dist/ITypes.js.map +1 -0
  14. package/dist/IWidgetVariantManager.d.ts +1 -1
  15. package/dist/LazyTreeView.d.ts +43 -1
  16. package/dist/LazyTreeView.js +5 -1
  17. package/dist/LazyTreeView.js.map +1 -1
  18. package/dist/Loader.d.ts +10 -0
  19. package/dist/Loader.js +33 -0
  20. package/dist/Loader.js.map +1 -0
  21. package/dist/PublicContext.d.ts +75 -10
  22. package/dist/PublicContext.js.map +1 -1
  23. package/dist/PublicLayout.d.ts +13 -29
  24. package/dist/PublicTemplate.d.ts +161 -58
  25. package/dist/PublicTemplate.js +16 -1
  26. package/dist/PublicTemplate.js.map +1 -1
  27. package/dist/PublicTemplateForm.d.ts +183 -20
  28. package/dist/PublicTemplateForm.js +7 -1
  29. package/dist/PublicTemplateForm.js.map +1 -1
  30. package/dist/PublicTheme.d.ts +165 -69
  31. package/dist/PublicTheme.js.map +1 -1
  32. package/dist/PublicTidyColumn.d.ts +331 -259
  33. package/dist/PublicTidyColumn.js +48 -2
  34. package/dist/PublicTidyColumn.js.map +1 -1
  35. package/dist/PublicTidyHistogram.d.ts +24 -0
  36. package/dist/PublicTidyHistogram.js +77 -0
  37. package/dist/PublicTidyHistogram.js.map +1 -0
  38. package/dist/PublicTidyMath.d.ts +49 -45
  39. package/dist/PublicTidyMath.js +0 -280
  40. package/dist/PublicTidyMath.js.map +1 -1
  41. package/dist/PublicTidyTable.d.ts +170 -154
  42. package/dist/PublicTidyTableInteractions.d.ts +34 -23
  43. package/dist/PublicTidyTableInteractions.js +5 -4
  44. package/dist/PublicTidyTableInteractions.js.map +1 -1
  45. package/dist/PublicTidyTableTypes.d.ts +133 -55
  46. package/dist/PublicTidyTableTypes.js +35 -18
  47. package/dist/PublicTidyTableTypes.js.map +1 -1
  48. package/dist/PublicTidyTree.d.ts +27 -37
  49. package/dist/PublicTidyTree.js +30 -58
  50. package/dist/PublicTidyTree.js.map +1 -1
  51. package/dist/RemoteContainerUtils.d.ts +1 -1
  52. package/dist/RemoteContainerUtils.js +9 -1
  53. package/dist/RemoteContainerUtils.js.map +1 -1
  54. package/dist/index.d.ts +12 -0
  55. package/dist/index.js +12 -0
  56. package/dist/index.js.map +1 -1
  57. package/dist/theme/ThemeFilterAutocomplete.d.ts +30 -0
  58. package/dist/theme/ThemeFilterAutocomplete.js +23 -0
  59. package/dist/theme/ThemeFilterAutocomplete.js.map +1 -0
  60. package/dist/theme/ThemeFilterButtons.d.ts +14 -2
  61. package/dist/theme/ThemeFilterButtons.js +4 -0
  62. package/dist/theme/ThemeFilterButtons.js.map +1 -1
  63. package/dist/theme/ThemeFilterCheckboxes.d.ts +18 -0
  64. package/dist/theme/ThemeFilterCheckboxes.js +11 -0
  65. package/dist/theme/ThemeFilterCheckboxes.js.map +1 -0
  66. package/dist/theme/ThemeFilterTree.d.ts +70 -0
  67. package/dist/theme/ThemeFilterTree.js +11 -0
  68. package/dist/theme/ThemeFilterTree.js.map +1 -0
  69. package/dist/theme/ThemeGoogleMapMarker.d.ts +51 -0
  70. package/dist/theme/ThemeGoogleMapMarker.js +3 -0
  71. package/dist/theme/ThemeGoogleMapMarker.js.map +1 -0
  72. package/dist/theme/ThemeHtmlBox.d.ts +7 -1
  73. package/dist/theme/ThemePivotTable.d.ts +23 -0
  74. package/dist/theme/ThemePivotTable.js +21 -0
  75. package/dist/theme/ThemePivotTable.js.map +1 -0
  76. package/dist/theme/ThemeTable.d.ts +99 -0
  77. package/dist/theme/ThemeTable.js +169 -0
  78. package/dist/theme/ThemeTable.js.map +1 -0
  79. package/package.json +9 -8
@@ -1,9 +1,19 @@
1
1
  import { IPluginDefinition } from "./IPluginDefinition";
2
2
  import { IVersionedPluginDefinition } from "./IVersionedPluginDefinition";
3
+ import { IPublicWidgetTemplateDefinition } from "./PublicTemplate";
3
4
  export declare class ApiUtils {
4
5
  /**
5
6
  * Define the form field as being localized.
6
7
  */
7
8
  static readonly TAG_I18N_FIELD = "ic3t_";
8
9
  static makePlugin(definition: IPluginDefinition): () => IVersionedPluginDefinition;
10
+ /**
11
+ * Wrap the template from another widget. The widget can come from a plugin or from the included widgets.
12
+ * Wrapping means that the template receives its not-defined settings from the template that is wrapped.
13
+ * @param wrappedTemplateId the unique identifier of the template, e.g., amCharts4.AmCharts4DonutChart.
14
+ * @param newDefinition definition of the new widget.
15
+ * @param transformOptions create the available options using the options from the wrapped template.
16
+ */
17
+ static makeWidgetTemplateWrapper<T extends IPublicWidgetTemplateDefinition<any>>(wrappedTemplateId: string, newDefinition: T, transformOptions?: (old: T['chartOptionsMeta']) => void): T;
18
+ private static resolveTemplateDefinition;
9
19
  }
package/dist/ApiUtils.js CHANGED
@@ -8,9 +8,33 @@ const ReportingVersion_1 = __importDefault(require("./ReportingVersion"));
8
8
  class ApiUtils {
9
9
  static makePlugin(definition) {
10
10
  return () => {
11
- return Object.assign({ apiVersion: new ReportingVersion_1.default("8.0.0-alpha.9" || "-", "Fri, 09 Jul 2021 08:23:42 GMT" || "-") }, definition);
11
+ return Object.assign({ apiVersion: new ReportingVersion_1.default("8.0.0-rc.4" || "-", "Mon, 14 Feb 2022 08:45:05 GMT" || "-") }, definition);
12
12
  };
13
13
  }
14
+ /**
15
+ * Wrap the template from another widget. The widget can come from a plugin or from the included widgets.
16
+ * Wrapping means that the template receives its not-defined settings from the template that is wrapped.
17
+ * @param wrappedTemplateId the unique identifier of the template, e.g., amCharts4.AmCharts4DonutChart.
18
+ * @param newDefinition definition of the new widget.
19
+ * @param transformOptions create the available options using the options from the wrapped template.
20
+ */
21
+ static makeWidgetTemplateWrapper(wrappedTemplateId, newDefinition, transformOptions) {
22
+ return Object.assign(Object.assign({}, newDefinition), { resolveDefinition: function (lib) {
23
+ const self = newDefinition;
24
+ return lib.wrapTemplateDefinition(wrappedTemplateId)
25
+ .then(definition => ApiUtils.resolveTemplateDefinition(self, definition, transformOptions));
26
+ }, jsCode: () => {
27
+ throw Error("Wrapped widget template " + wrappedTemplateId + ": unexpected jsCode() call!");
28
+ } });
29
+ }
30
+ static resolveTemplateDefinition(self, definition, transformOptions) {
31
+ const newTemplate = Object.assign(Object.assign(Object.assign({}, definition), self), { resolveDefinition: undefined });
32
+ // TODO (tom) use deepClone for the optionsMeta.
33
+ if (transformOptions != null) {
34
+ transformOptions(newTemplate.chartOptionsMeta);
35
+ }
36
+ return newTemplate;
37
+ }
14
38
  }
15
39
  exports.ApiUtils = ApiUtils;
16
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ApiUtils.js","sourceRoot":"","sources":["../src/ApiUtils.ts"],"names":[],"mappings":";;;;;;AAEA,0EAAkD;AAElD,MAAa,QAAQ;IAOjB,MAAM,CAAC,UAAU,CAAC,UAA6B;QAE3C,OAAO,GAA+B,EAAE;YAEpC,uBAEI,UAAU,EAAE,IAAI,0BAAgB,CAC5B,eAAe,IAAI,GAAG,EACtB,+BAA+B,IAAI,GAAG,CACzC,IAEE,UAAU,EAEhB;QAEL,CAAC,CAAA;IACL,CAAC;;AAvBL,4BAyBC;AAvBG;;GAEG;AACoB,uBAAc,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"ApiUtils.js","sourceRoot":"","sources":["../src/ApiUtils.ts"],"names":[],"mappings":";;;;;;AAEA,0EAAkD;AAGlD,MAAa,QAAQ;IAOjB,MAAM,CAAC,UAAU,CAAC,UAA6B;QAE3C,OAAO,GAA+B,EAAE;YAEpC,uBAEI,UAAU,EAAE,IAAI,0BAAgB,CAC5B,YAAY,IAAI,GAAG,EACnB,+BAA+B,IAAI,GAAG,CACzC,IAEE,UAAU,EAEhB;QAEL,CAAC,CAAA;IACL,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,yBAAyB,CAC5B,iBAAyB,EAAE,aAAgB,EAAE,gBAAuD;QAEpG,uCAGO,aAAa,KAEhB,iBAAiB,EAAE,UAAU,GAA8B;gBACvD,MAAM,IAAI,GAAG,aAAa,CAAC;gBAC3B,OAAO,GAAG,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;qBAC/C,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC,IAAI,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAA;YACnG,CAAC,EAED,MAAM,EAAE,GAAG,EAAE;gBACT,MAAM,KAAK,CAAC,0BAA0B,GAAG,iBAAiB,GAAG,6BAA6B,CAAC,CAAC;YAChG,CAAC,IAEJ;IACL,CAAC;IAEO,MAAM,CAAC,yBAAyB,CACpC,IAAO,EAAE,UAAgD,EAAE,gBAAuD;QAElH,MAAM,WAAW,iDAAO,UAAU,GAAK,IAAI,KAAE,iBAAiB,EAAE,SAAS,GAAC,CAAC;QAC3E,gDAAgD;QAChD,IAAI,gBAAgB,IAAI,IAAI,EAAE;YAC1B,gBAAgB,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;SAClD;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;;AA9DL,4BAgEC;AA9DG;;GAEG;AACoB,uBAAc,GAAG,OAAO,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { PaperOrientation, PaperSizeName } from "./ITypes";
2
+ export declare type AppNotificationType = "edit-report" | "print-report-dialog" | "print-report";
3
+ export interface IAppNotification {
4
+ /**
5
+ * E.g., print-report.
6
+ */
7
+ readonly type: AppNotificationType;
8
+ }
9
+ export interface IAppNotificationWithPayload<PAYLOAD> extends IAppNotification {
10
+ /**
11
+ * E.g., print-report.
12
+ */
13
+ readonly type: AppNotificationType;
14
+ /**
15
+ * E.g., print-report file name.
16
+ */
17
+ readonly payload: PAYLOAD;
18
+ }
19
+ export interface AppEditReportNotification extends IAppNotification {
20
+ readonly type: "edit-report";
21
+ }
22
+ export interface AppPrintReportDialogNotification extends IAppNotification {
23
+ readonly type: "print-report-dialog";
24
+ }
25
+ export interface AppPrintReportNotificationPayload {
26
+ fileName?: string;
27
+ paperSizeName?: PaperSizeName;
28
+ layout?: PaperOrientation;
29
+ }
30
+ export interface AppPrintReportNotification extends IAppNotificationWithPayload<AppPrintReportNotificationPayload> {
31
+ readonly type: "print-report";
32
+ }
33
+ export declare type AppNotification = AppEditReportNotification | AppPrintReportDialogNotification | AppPrintReportNotification;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=INotification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"INotification.js","sourceRoot":"","sources":["../src/INotification.ts"],"names":[],"mappings":""}
@@ -3,7 +3,7 @@ import { IThemeManager } from "./IThemeManager";
3
3
  import { IWidgetManager } from "./IWidgetManager";
4
4
  import { ITidyTableTransformationManager } from "./ITidyTableTransformationManager";
5
5
  import { IWidgetDefaultsManager } from "./IWidgetDefaultsManager";
6
- import { Theme } from "@material-ui/core/styles";
6
+ import { Theme } from "@mui/material/styles";
7
7
  export interface IPluginDefinition {
8
8
  /**
9
9
  * Keep that id simple (i.e., ASCII letter without any dot, space, separator, etc...) as it will be used
@@ -12,6 +12,9 @@ export interface IPluginDefinition {
12
12
  * That name must be unique across all the plugins loaded into an icCube server.
13
13
  */
14
14
  id: string;
15
+ /**
16
+ * When defining new widgets using amCharts 4, this method registers the icCube license.
17
+ */
15
18
  registerAmCharts4?: (callback: (am4core: any) => void) => void;
16
19
  registerLocalization?: (manager: ILocalizationManager) => void;
17
20
  registerThemes?: (manager: IThemeManager) => void;
@@ -1,18 +1,32 @@
1
1
  import ReportingVersion from "./ReportingVersion";
2
+ import { AppNotification } from "./INotification";
2
3
  export interface IReportDefinition {
3
4
  getName(): string;
4
5
  getPath(): string;
5
6
  getDefaultSchemaName(): string;
6
7
  setDefaultSchemaName(name: string): void;
7
- getDefaultCubeName(): string;
8
+ getDefaultCubeName(): string | undefined;
8
9
  setDefaultCubeName(name: string): void;
10
+ getThemeUID(): string;
11
+ setThemeUID(uid: string): void;
9
12
  }
13
+ export interface IReportAppDefinition {
14
+ }
15
+ export interface IEventContentItem {
16
+ /**
17
+ * Localized name or name.
18
+ */
19
+ caption: string;
20
+ name: string;
21
+ uniqueName: string;
22
+ }
23
+ export declare type IEventContent = IEventContentItem | IEventContentItem[];
10
24
  /**
11
25
  * Used to setup filter initial selection.
12
26
  */
13
27
  export interface IReportParam {
14
28
  channelName: string;
15
- name: string | string[];
29
+ value: IEventContent;
16
30
  }
17
31
  export interface IOpenReportOptions {
18
32
  embedded?: boolean;
@@ -40,12 +54,37 @@ export interface IOpenReportAppOptions {
40
54
  * Full path of the report app. (e.g., shared:/my-report).
41
55
  */
42
56
  path: string;
57
+ /**
58
+ * Called before the application definition is actually applied.
59
+ * Give the opportunity to change the definition.
60
+ */
61
+ onDefinition?: (report: IReportAppDefinition) => void;
62
+ /**
63
+ * If the method exist and return true then the default error dispatcher is not
64
+ * being called. Give the caller the opportunity to render the error.
65
+ */
66
+ onError?: (error: any) => boolean;
43
67
  }
44
68
  /**
45
69
  * An instance of icCube reporting application.
46
70
  */
47
71
  export interface IReporting {
48
72
  getVersion(): ReportingVersion;
49
- openReport(options: IOpenReportOptions): void;
50
- fireEvent(eventName: string, caption: string, mdx: string): void;
73
+ /**
74
+ * @param options
75
+ * @param pushToHistory defaulted to true
76
+ * @param keepGlobalFilter defaulted to true
77
+ */
78
+ openReport(options: IOpenReportOptions, pushToHistory?: boolean, keepGlobalFilter?: boolean): void;
79
+ /**
80
+ * @param options
81
+ * @param pushToHistory defaulted to true
82
+ */
83
+ openReportApp(options: IOpenReportAppOptions, pushToHistory?: boolean): void;
84
+ fireEvent(eventName: string, value: IEventContent | null): void;
85
+ onEvent(eventName: string, callback: (value: IEventContent | null) => void): void;
86
+ /**
87
+ * e.g., print-report
88
+ */
89
+ fireAppNotification(notification: AppNotification): void;
51
90
  }
@@ -1,4 +1,4 @@
1
- import { CSSInterpolation } from "@material-ui/system";
1
+ import { CSSInterpolation } from "@mui/system";
2
2
  export declare enum EmbeddedThemeNames {
3
3
  Statos = "ic3-statos"
4
4
  }
@@ -7,14 +7,33 @@ export interface ILocalizationContext {
7
7
  localize(name: string, ...args: any[]): string;
8
8
  }
9
9
  export interface ITidyTableTransformation<OPTIONS extends FormFieldObject> {
10
+ /**
11
+ * The id of the transformation. Use this id to reference the transformation in the localization.
12
+ */
10
13
  id: string;
14
+ /**
15
+ * The id of the editor group that the transformation is in.
16
+ */
11
17
  groupId: string;
12
18
  /**
13
19
  * Internal usage: pluginID.id
14
20
  */
15
21
  qualifiedId?: string;
22
+ /**
23
+ * Return the description to show below the transformation in the 'TRANSFORMATION' tab of the editor
24
+ * @param context used for accessing localization functions
25
+ * @param options user-set options for the transformation
26
+ */
16
27
  getDescription?(context: ILocalizationContext, options: OPTIONS): string;
28
+ /**
29
+ * Return the field meta for the user-editable options
30
+ */
17
31
  getFieldMeta(): FormFieldDef[] | FormFields<OPTIONS>;
18
- validateOptions(options: any): options is OPTIONS;
32
+ /**
33
+ * Run the transformation.
34
+ * @param context public context
35
+ * @param table modify this table in the transformation. It is mutable.
36
+ * @param options user-set options for the transformation
37
+ */
19
38
  apply(context: IPublicContext, table: ITidyTable, options: OPTIONS): void;
20
39
  }
@@ -0,0 +1,3 @@
1
+ export declare type PaperSizeName = "A5" | "A4" | "A3" | "B5" | "B4" | "Letter" | "Legal" | "Ledger" | "JIS-B5" | "JIS-B4";
2
+ export declare type PaperOrientation = "portrait" | "landscape";
3
+ export declare type PaperSizeUnits = "px" | "mm" | "cm" | "in";
package/dist/ITypes.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITypes.js","sourceRoot":"","sources":["../src/ITypes.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { CSSInterpolation } from "@material-ui/system";
1
+ import { CSSInterpolation } from "@mui/system";
2
2
  declare type variantName = string;
3
3
  export declare type IThemeRegisterVariant = Record<variantName, {
4
4
  /**
@@ -1,5 +1,6 @@
1
1
  import { EntityItem, MdxInfo } from "./PublicTidyTableTypes";
2
2
  import { ReactElement } from "react";
3
+ import { SelectionMode } from "./PublicTidyTableInteractions";
3
4
  /**
4
5
  * A copy of MUI TreeItemClasses
5
6
  */
@@ -37,6 +38,14 @@ export interface LazyTreeClasses {
37
38
  /** Styles applied to the TreeRoot element */
38
39
  treeRoot: string;
39
40
  }
41
+ /**
42
+ * Global classes
43
+ */
44
+ export interface Ic3GlobalClasses {
45
+ singleSelection: string;
46
+ multipleSelection: string;
47
+ }
48
+ export declare const ic3GlobalClasses: Ic3GlobalClasses;
40
49
  export declare const lazyTreeClasses: LazyTreeClasses;
41
50
  export interface ILazyTreeViewLoader {
42
51
  /**
@@ -44,11 +53,13 @@ export interface ILazyTreeViewLoader {
44
53
  */
45
54
  mapTree<T extends ReactElement>(expanded: (index: number) => boolean, factory: (index: number) => T, filter?: (info: MdxInfo) => boolean): T[];
46
55
  hasLazyChildren(index: number): boolean;
56
+ getColumnLevelDepth(index: number): number;
47
57
  lazyLoadChildren(index: number): void | number;
48
58
  getNodeIdAndCaption(index: number): [string, string];
49
59
  setCallbackOnChange(callback: () => void): void;
50
60
  toEntityItems(nodeIds: string[]): EntityItem[];
51
61
  mapNodeIds<T>(nodeIds: string[], callbackfn: (columnIdx: number) => T | null | undefined): T[];
62
+ map<T>(callback: (index: number) => T | undefined): T[];
52
63
  }
53
64
  /**
54
65
  * Controlled properties of LazyTreeView (doesn't has to be lazy)
@@ -56,14 +67,45 @@ export interface ILazyTreeViewLoader {
56
67
  export interface LazyTreeViewProps {
57
68
  lazyLoader: ILazyTreeViewLoader;
58
69
  allowEmptySelection?: boolean;
70
+ /**
71
+ *
72
+ */
59
73
  addFilterSelected?: boolean;
74
+ /**
75
+ * Adds a search input to the tree filter
76
+ */
60
77
  addSearch?: boolean;
61
- searchText?: string;
78
+ /**
79
+ * Search/Filter text when controlled (addSearch needs to be false)
80
+ */
81
+ search?: string;
82
+ /**
83
+ * Message for the search/filter when empty
84
+ */
85
+ searchPlaceholder?: string;
86
+ /**
87
+ * Message for the search/filter component (might be 'compacted' selection)
88
+ */
89
+ searchMessage?: string;
62
90
  toggleFilterSelected?: string;
63
91
  disableSelection?: boolean;
92
+ /**
93
+ * if undefined, the selection state is managed by the lazy tree as well
94
+ */
64
95
  selected?: string[];
96
+ /**
97
+ * Controlled mode for selection
98
+ */
65
99
  setSelected?: (nodeIdx: string[]) => void;
100
+ /**
101
+ * Controlled mode for expanded
102
+ */
66
103
  expanded?: string[];
104
+ /**
105
+ * The level depth of initially open nodes ( 0 first level )
106
+ */
107
+ openDepthLevel?: number;
108
+ selectionMode: SelectionMode;
67
109
  /**
68
110
  * Material-UI tree item classes Partial<TreeItemClasses>
69
111
  */
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lazyTreeClasses = void 0;
3
+ exports.lazyTreeClasses = exports.ic3GlobalClasses = void 0;
4
+ exports.ic3GlobalClasses = {
5
+ singleSelection: 'Ic3-SingleSelection',
6
+ multipleSelection: 'Ic3-MultipleSelection',
7
+ };
4
8
  exports.lazyTreeClasses = {
5
9
  toolbar: 'Ic3-LazyTreeView-toolbar',
6
10
  input: 'Ic3-LazyTreeView-toolbar-input',
@@ -1 +1 @@
1
- {"version":3,"file":"LazyTreeView.js","sourceRoot":"","sources":["../src/LazyTreeView.ts"],"names":[],"mappings":";;;AA+Ca,QAAA,eAAe,GAAoB;IAC5C,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,iCAAiC;IACzC,sBAAsB,EAAE,mCAAmC;IAC3D,uBAAuB,EAAE,oCAAoC;IAC7D,QAAQ,EAAE,2BAA2B;CACxC,CAAA"}
1
+ {"version":3,"file":"LazyTreeView.js","sourceRoot":"","sources":["../src/LazyTreeView.ts"],"names":[],"mappings":";;;AA0Da,QAAA,gBAAgB,GAAqB;IAC9C,eAAe,EAAE,qBAAqB;IACtC,iBAAiB,EAAE,uBAAuB;CAC7C,CAAA;AAGY,QAAA,eAAe,GAAoB;IAC5C,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,iCAAiC;IACzC,sBAAsB,EAAE,mCAAmC;IAC3D,uBAAuB,EAAE,oCAAoC;IAC7D,QAAQ,EAAE,2BAA2B;CACxC,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { IReporting } from "./IReporting";
2
+ export interface IDashboardsLoaderFrameParams {
3
+ /**
4
+ * An unique ID (DOM) that is identifying the icCube dashboards instance.
5
+ */
6
+ containerId: string;
7
+ onReady: (ic3: IReporting) => void;
8
+ url: string;
9
+ }
10
+ export declare function DashboardsLoaderFrame(params: IDashboardsLoaderFrameParams): void;
package/dist/Loader.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DashboardsLoaderFrame = void 0;
4
+ function DashboardsLoaderFrame(params) {
5
+ const { containerId, onReady, url } = params;
6
+ const containerELT = document.getElementById(containerId);
7
+ if (!containerELT) {
8
+ throw new Error("[ic3loader] (iFrame) missing container [" + containerId + "]");
9
+ }
10
+ console.log("[ic3loader] (iFrame) icCube URL : " + url);
11
+ console.log("[ic3loader] (iFrame) container : " + containerId);
12
+ console.log("[ic3loader] (iFrame) callback : " + onReady);
13
+ const wnd = window;
14
+ wnd.ic3loader = wnd.ic3loader || {};
15
+ wnd.ic3loader[containerId] = (ic3) => {
16
+ console.log("[ic3loader] (iFrame) ready : ", ic3);
17
+ delete wnd.ic3loader[containerId];
18
+ onReady && onReady(ic3);
19
+ };
20
+ // setup an iFrame passing a url w/ &cb=window.name.of.callback
21
+ // window. or parent. then in icCube ...
22
+ const iFrame = document.createElement('iframe');
23
+ iFrame.width = "100%";
24
+ iFrame.height = "100%";
25
+ iFrame.style.border = "0px none";
26
+ const sep = url.indexOf("?") === -1 ? "?" : "&";
27
+ const src = url + sep + "ic3callback=ic3loader." + containerId;
28
+ iFrame.setAttribute("src", src);
29
+ console.log("[ic3loader] (iFrame) iFrame : " + src);
30
+ containerELT.appendChild(iFrame);
31
+ }
32
+ exports.DashboardsLoaderFrame = DashboardsLoaderFrame;
33
+ //# sourceMappingURL=Loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loader.js","sourceRoot":"","sources":["../src/Loader.ts"],"names":[],"mappings":";;;AAeA,SAAgB,qBAAqB,CAAC,MAAoC;IAEtE,MAAM,EAAC,WAAW,EAAE,OAAO,EAAE,GAAG,EAAC,GAAG,MAAM,CAAC;IAE3C,MAAM,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAE1D,IAAI,CAAC,YAAY,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,0CAA0C,GAAG,WAAW,GAAG,GAAG,CAAC,CAAA;KAClF;IAED,OAAO,CAAC,GAAG,CAAC,oCAAoC,GAAG,GAAG,CAAC,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,oCAAoC,GAAG,WAAW,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,oCAAoC,GAAG,OAAO,CAAC,CAAC;IAE5D,MAAM,GAAG,GAAI,MAAc,CAAC;IAE5B,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;IAEpC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,GAAe,EAAE,EAAE;QAE7C,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC;QAEvD,OAAO,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAClC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAE5B,CAAC,CAAA;IAED,iEAAiE;IACjE,6CAA6C;IAE7C,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAEhD,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IAEvB,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;IAEjC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAChD,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,wBAAwB,GAAG,WAAW,CAAC;IAE/D,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEhC,OAAO,CAAC,GAAG,CAAC,oCAAoC,GAAG,GAAG,CAAC,CAAC;IAExD,YAAY,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AAErC,CAAC;AA9CD,sDA8CC"}
@@ -2,9 +2,11 @@
2
2
  import { LazyTreeViewProps } from "./LazyTreeView";
3
3
  import { ITidyTable } from "./PublicTidyTable";
4
4
  import { ITidyTableTransformation } from "./ITidyTableTransformation";
5
- import { Theme } from "@material-ui/core/styles";
5
+ import { Theme } from "@mui/material/styles";
6
6
  import { ThemeTextFormatter } from "./PublicTheme";
7
7
  import { ITidyColumn } from "./PublicTidyColumn";
8
+ import { IPublicWidgetTemplateDefinition } from "./PublicTemplate";
9
+ import { ITidyMath } from "./PublicTidyMath";
8
10
  export declare enum WidgetRenderLayoutStatus {
9
11
  RENDERING = "RENDERING",
10
12
  RENDERED = "RENDERED"
@@ -22,13 +24,31 @@ export interface IPublicContext {
22
24
  getUserName(): string;
23
25
  getReportLocale(): string;
24
26
  getNumberFormatter(format: ThemeTextFormatter): (value: any | undefined) => string;
27
+ /**
28
+ * translate the content of a report (the title of widgets, content of some widgets...). This does use another file
29
+ *
30
+ * aka content localization
31
+ */
32
+ translateContent(content: string): string;
33
+ /**
34
+ * localized report application tags (e.g. edit, write, save.. )
35
+ */
36
+ localize(name: string, ...args: any[]): string;
37
+ /**
38
+ * localized report application error tags
39
+ */
40
+ localizeError(name: string, ...args: any[]): string;
41
+ /**
42
+ * Localization for transformations
43
+ */
25
44
  localizeTransformationCaption(template: ITidyTableTransformation<any>): {
26
45
  info: string;
27
46
  description?: string;
28
47
  };
29
- localizeError(name: string, ...args: any[]): string;
30
- localize(name: string, ...args: any[]): string;
31
- translateContent(content: string): string;
48
+ /**
49
+ * A bunch of mathematical functions related to the tidy table.
50
+ */
51
+ tidyMath(): ITidyMath;
32
52
  /**
33
53
  * Not in widget public context because of transformation not applied from a widget context always.
34
54
  *
@@ -36,7 +56,7 @@ export interface IPublicContext {
36
56
  * To prevent usage of the default, pass an "empty" string that makes this method returns
37
57
  * undefined.
38
58
  */
39
- createTableRowTextExprFormatter(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): ((rowIdx: number) => string) | undefined;
59
+ createTableRowTextExpr(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): ((rowIdx: number) => string) | undefined;
40
60
  /**
41
61
  * Not in widget public context because of transformation not applied from a widget context always.
42
62
  *
@@ -44,7 +64,7 @@ export interface IPublicContext {
44
64
  * To prevent usage of the default, pass an "empty" string that makes this method returns
45
65
  * undefined.
46
66
  */
47
- createTableTextExprFormatter(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): (() => string) | undefined;
67
+ createTableTextExpr(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): (() => string) | undefined;
48
68
  /**
49
69
  * Not in widget public context because of transformation not applied from a widget context always.
50
70
  *
@@ -52,7 +72,7 @@ export interface IPublicContext {
52
72
  * To prevent usage of the default, pass an "empty" string that makes this method returns
53
73
  * undefined.
54
74
  */
55
- createTableRowHtmlExprFormatter(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): ((rowIdx: number) => string) | undefined;
75
+ createTableRowMarkdownExpr(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): ((rowIdx: number) => string) | undefined;
56
76
  /**
57
77
  * Not in widget public context because of transformation not applied from a widget context always.
58
78
  *
@@ -60,7 +80,7 @@ export interface IPublicContext {
60
80
  * To prevent usage of the default, pass an "empty" string that makes this method returns
61
81
  * undefined.
62
82
  */
63
- createTableHtmlExprFormatter(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): (() => string) | undefined;
83
+ createTableMarkdownExpr(field: string, table: ITidyTable, expression: string | undefined): (() => string) | undefined;
64
84
  /**
65
85
  * Not in widget public context because of transformation not applied from a widget context always.
66
86
  *
@@ -69,6 +89,11 @@ export interface IPublicContext {
69
89
  * undefined.
70
90
  */
71
91
  createTableRowNumericExpr(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): ((rowIdx: number) => number | undefined) | undefined;
92
+ /**
93
+ * same as createTableRowNumericExpr but returning a string
94
+ */
95
+ createTableRowNumericStringExpr(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): ((rowIdx: number) => string | undefined) | undefined;
96
+ createTableScaleRowNumericExpr(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): ((rowIdx: number) => number | undefined) | undefined;
72
97
  /**
73
98
  * Not in widget public context because of transformation not applied from a widget context always.
74
99
  *
@@ -79,11 +104,13 @@ export interface IPublicContext {
79
104
  createTableNumericExpr(field: string, table: ITidyTable, defaultColumn: ITidyColumn | undefined, expression: string | undefined): (() => number | undefined) | undefined;
80
105
  }
81
106
  export interface IWidgetPublicContext extends IPublicContext {
82
- onWidgetRenderStatusChange(status: WidgetRenderLayoutStatus): void;
83
107
  getNsId(): string;
84
108
  getWidgetId(): string;
85
109
  getTemplateId(): string;
86
110
  getWidgetPageId(): string;
111
+ isPrintingMode(): boolean;
112
+ getGoogleMapRenderedDelayMS(): number;
113
+ logInfoWidget(component: string, message: string): void;
87
114
  renderWidgetContentMessage(type: IContentMessageType, message: string): any;
88
115
  renderLazyTreeView<T>(props: LazyTreeViewProps): T;
89
116
  formatDate(value: Date | string | undefined | null, format: ThemeTextFormatter | null | undefined, locale?: string): string;
@@ -104,7 +131,45 @@ export interface IWidgetPublicContext extends IPublicContext {
104
131
  * template form fields, FormFieldDef (i.e. {zoom:14} to set the zoom to 14). If in editing mode,
105
132
  * the edited options in the widget editor panel will be updated.
106
133
  */
107
- onUserMenuAction(userMenuAction: string, callback: (event: any) => Record<string, any> | undefined): void;
134
+ onUserMenuAction(callback: (userMenuAction: string, event: any) => Record<string, any> | undefined): void;
135
+ onWidgetRenderStatusChange(status: WidgetRenderLayoutStatus): void;
136
+ /**
137
+ * Event methods that do not depend on a Table
138
+ *
139
+ * @see ITidyTableInteractionEvent for more
140
+ */
141
+ /**
142
+ * returns true if the actionName in bound to a channel
143
+ */
144
+ firesEvent(actionName: string): boolean;
145
+ /**
146
+ * actionName if the action is bound to a channel, clears the event (has no value)
147
+ */
148
+ fireClearEvent(actionName: string): void;
149
+ /**
150
+ * actionName if the action is bound to a channel, send an Mdx Event (value,mdx)
151
+ */
152
+ fireMdxEvent(actionName: string, value: string, mdx: string): void;
153
+ /**
154
+ * Cypress testing purpose, after a rendering of the chart
155
+ */
156
+ incrementWidgetContentRendering(): void;
157
+ getWidgetTemplateDefinition(qualifiedId: string): IPublicWidgetTemplateDefinition<any>;
158
+ resolveWidgetTemplateDefinition(definition: IPublicWidgetTemplateDefinition<any>): Promise<IPublicWidgetTemplateDefinition<any>>;
159
+ /**
160
+ * React -> combines useReduxOwnProps and setReduxOwnProps with a similar syntax to Redux.useState
161
+ *
162
+ * Note it's NOT the initial value but value if undefined
163
+ */
164
+ useReduxOwnPropsState<T>(fieldName: string, valueIfUndefined?: T): [T, (newValue: T) => void];
165
+ /**
166
+ * React -> useSelector on widgetOwnProps[fieldName]
167
+ */
168
+ useReduxOwnProps<T>(fieldName: string): T;
169
+ /**
170
+ * Redux -> set in Redux value in widgetOwnProps[fieldName]
171
+ */
172
+ setReduxOwnProps(fieldName: string, value: any): void;
108
173
  }
109
174
  export interface IWidgetEditorPublicContext {
110
175
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"PublicContext.js","sourceRoot":"","sources":["../src/PublicContext.ts"],"names":[],"mappings":";;;AAOA,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAChC,mDAAuB,CAAA;IACvB,iDAAqB,CAAA;AACzB,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAED,IAAY,mBAAkC;AAA9C,WAAY,mBAAmB;IAAG,6DAAI,CAAA;IAAE,+DAAK,CAAA;AAAA,CAAC,EAAlC,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAAe"}
1
+ {"version":3,"file":"PublicContext.js","sourceRoot":"","sources":["../src/PublicContext.ts"],"names":[],"mappings":";;;AASA,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAChC,mDAAuB,CAAA;IACvB,iDAAqB,CAAA;AACzB,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAED,IAAY,mBAAkC;AAA9C,WAAY,mBAAmB;IAAG,6DAAI,CAAA;IAAE,+DAAK,CAAA;AAAA,CAAC,EAAlC,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAAe"}