@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,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.5", "Mon, 05 Jul 2021 13:46:39 GMT", "") }, definition);
11
+ return Object.assign({ apiVersion: new ReportingVersion_1.default("8.0.0-rc.3" || "-", "Fri, 21 Jan 2022 09:28:37 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,CAAC,eAAe,EAAE,+BAA+B,EAAE,EAAE,CAAC,IAEnF,UAAU,EAEhB;QAEL,CAAC,CAAA;IACL,CAAC;;AApBL,4BAsBC;AApBG;;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,32 @@
1
+ export declare type AppNotificationType = "edit-report" | "print-report-dialog" | "print-report";
2
+ export interface IAppNotification {
3
+ /**
4
+ * E.g., print-report.
5
+ */
6
+ readonly type: AppNotificationType;
7
+ }
8
+ export interface IAppNotificationWithPayload<PAYLOAD> extends IAppNotification {
9
+ /**
10
+ * E.g., print-report.
11
+ */
12
+ readonly type: AppNotificationType;
13
+ /**
14
+ * E.g., print-report file name.
15
+ */
16
+ readonly payload: PAYLOAD;
17
+ }
18
+ export interface AppEditReportNotification extends IAppNotification {
19
+ readonly type: "edit-report";
20
+ }
21
+ export interface AppPrintReportDialogNotification extends IAppNotification {
22
+ readonly type: "print-report-dialog";
23
+ }
24
+ export interface AppPrintReportNotificationPayload {
25
+ fileName?: string;
26
+ paperSizeName?: "A5" | "A4" | "A3" | "B5" | "B4" | "Letter" | "Legal" | "Ledger" | "JIS-B5" | "JIS-B4";
27
+ layout?: "portrait" | "landscape";
28
+ }
29
+ export interface AppPrintReportNotification extends IAppNotificationWithPayload<AppPrintReportNotificationPayload> {
30
+ readonly type: "print-report";
31
+ }
32
+ 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,30 @@
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;
9
10
  }
11
+ export interface IReportAppDefinition {
12
+ }
13
+ export interface IEventContentItem {
14
+ /**
15
+ * Localized name or name.
16
+ */
17
+ caption: string;
18
+ name: string;
19
+ uniqueName: string;
20
+ }
21
+ export declare type IEventContent = IEventContentItem | IEventContentItem[];
10
22
  /**
11
23
  * Used to setup filter initial selection.
12
24
  */
13
25
  export interface IReportParam {
14
26
  channelName: string;
15
- name: string | string[];
27
+ value: IEventContent;
16
28
  }
17
29
  export interface IOpenReportOptions {
18
30
  embedded?: boolean;
@@ -40,12 +52,37 @@ export interface IOpenReportAppOptions {
40
52
  * Full path of the report app. (e.g., shared:/my-report).
41
53
  */
42
54
  path: string;
55
+ /**
56
+ * Called before the application definition is actually applied.
57
+ * Give the opportunity to change the definition.
58
+ */
59
+ onDefinition?: (report: IReportAppDefinition) => void;
60
+ /**
61
+ * If the method exist and return true then the default error dispatcher is not
62
+ * being called. Give the caller the opportunity to render the error.
63
+ */
64
+ onError?: (error: any) => boolean;
43
65
  }
44
66
  /**
45
67
  * An instance of icCube reporting application.
46
68
  */
47
69
  export interface IReporting {
48
70
  getVersion(): ReportingVersion;
49
- openReport(options: IOpenReportOptions): void;
50
- fireEvent(eventName: string, caption: string, mdx: string): void;
71
+ /**
72
+ * @param options
73
+ * @param pushToHistory defaulted to true
74
+ * @param keepGlobalFilter defaulted to true
75
+ */
76
+ openReport(options: IOpenReportOptions, pushToHistory?: boolean, keepGlobalFilter?: boolean): void;
77
+ /**
78
+ * @param options
79
+ * @param pushToHistory defaulted to true
80
+ */
81
+ openReportApp(options: IOpenReportAppOptions, pushToHistory?: boolean): void;
82
+ fireEvent(eventName: string, value: IEventContent | null): void;
83
+ onEvent(eventName: string, callback: (value: IEventContent | null) => void): void;
84
+ /**
85
+ * e.g., print-report
86
+ */
87
+ fireAppNotification(notification: AppNotification): void;
51
88
  }
@@ -1,3 +1,4 @@
1
+ import { CSSInterpolation } from "@mui/system";
1
2
  export declare enum EmbeddedThemeNames {
2
3
  Statos = "ic3-statos"
3
4
  }
@@ -35,24 +36,18 @@ export interface IThemeWidgetDefaults {
35
36
  /**
36
37
  * Sort of named set of predefined options.
37
38
  */
38
- export interface IThemeWidgetVariant {
39
- id: string;
40
- /**
41
- * Default values.
42
- */
43
- widgetDefaults: {
44
- /**
45
- * Default values for widget chart options.
46
- *
47
- * <pre>
48
- * IWidgetDefinition
49
- * dataRenderOptions: IWidgetDataRenderDefinition
50
- * chartOptions: IChartTemplateDataRenderDefinition
51
- * </pre>
52
- */
53
- options: Record<string, any>;
54
- };
55
- }
39
+ export declare type IThemeWidgetVariant = {
40
+ props: {
41
+ variant: string;
42
+ } & Record<string, string>;
43
+ style: CSSInterpolation;
44
+ defaultProps?: Record<string, any>;
45
+ } | {
46
+ props: {
47
+ variant: string;
48
+ } & Record<string, string>;
49
+ defaultProps: Record<string, any>;
50
+ };
56
51
  export interface IThemeManager {
57
52
  /**
58
53
  * The theme decorator allows to setup the Theme.components and Theme.ic3 using the theme
@@ -1 +1 @@
1
- {"version":3,"file":"IThemeManager.js","sourceRoot":"","sources":["../src/IThemeManager.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAE1B,2CAAqB,CAAA;AAEzB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B"}
1
+ {"version":3,"file":"IThemeManager.js","sourceRoot":"","sources":["../src/IThemeManager.ts"],"names":[],"mappings":";;;AAEA,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAE1B,2CAAqB,CAAA;AAEzB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B"}
@@ -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
  }
@@ -1,4 +1,22 @@
1
- import { IThemeWidgetVariant } from "./IThemeManager";
1
+ import { CSSInterpolation } from "@mui/system";
2
+ declare type variantName = string;
3
+ export declare type IThemeRegisterVariant = Record<variantName, {
4
+ /**
5
+ * for styled MUI like components additional properties defining when the variant applies
6
+ */
7
+ props?: {
8
+ variant: string;
9
+ } & Record<string, any>;
10
+ /**
11
+ * default properties for the fields/options of the widget
12
+ */
13
+ defaultProps: Record<string, any>;
14
+ /**
15
+ * for styled MUI like components, css styles
16
+ */
17
+ style?: CSSInterpolation;
18
+ }>;
2
19
  export interface IWidgetVariantManager {
3
- registerVariants(variants: IThemeWidgetVariant[]): void;
20
+ registerVariants(variants: IThemeRegisterVariant): void;
4
21
  }
22
+ export {};
@@ -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;
@@ -105,10 +132,48 @@ export interface IWidgetPublicContext extends IPublicContext {
105
132
  * the edited options in the widget editor panel will be updated.
106
133
  */
107
134
  onUserMenuAction(userMenuAction: string, callback: (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
  /**
111
176
  * The variants available in the theme for the edited widget.
112
177
  */
113
- getWidgetVariantIds(): string[];
178
+ getWidgetVariantIds(componentName?: string): string[];
114
179
  }
@@ -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"}
@@ -62,17 +62,17 @@ export interface IPageHeaderFooterLogoDefinition {
62
62
  }
63
63
  export interface IPageHeaderFooterContentDefinition {
64
64
  /**
65
- * Used for formatting @dateTime variable (https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/)
65
+ * Used for formatting @dateTime variable
66
66
  */
67
- dateTimeFormat?: string;
67
+ dateTimeFormat: string;
68
68
  /**
69
- * Used for formatting @date variable (https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/)
69
+ * Used for formatting @date variable
70
70
  */
71
- dateFormat?: string;
71
+ dateFormat: string;
72
72
  /**
73
- * Used for formatting @time variable (https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/)
73
+ * Used for formatting @time variable
74
74
  */
75
- timeFormat?: string;
75
+ timeFormat: string;
76
76
  text: string;
77
77
  style?: CSSProperties;
78
78
  align?: 'inherit' | 'left' | 'center' | 'right' | 'justify';