@ic3/reporting-api 8.3.0-alpha.1 → 8.4.0-alpha.1

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 (88) hide show
  1. package/README.md +6 -4
  2. package/dist/ApiUtils.js +1 -1
  3. package/dist/ApiUtils.js.map +1 -1
  4. package/dist/INotification.d.ts +17 -2
  5. package/dist/IOnNewEventJsContext.d.ts +1 -1
  6. package/dist/IPluginDefinition.d.ts +3 -0
  7. package/dist/IThemeManager.d.ts +1 -1
  8. package/dist/ITypes.d.ts +3 -3
  9. package/dist/IWidgetVariantManager.d.ts +2 -2
  10. package/dist/LazyTreeView.d.ts +1 -1
  11. package/dist/Logger.d.ts +1 -1
  12. package/dist/PublicAmCharts4Base.d.ts +91 -0
  13. package/dist/{IReporting.js → PublicAmCharts4Base.js} +1 -1
  14. package/dist/PublicAmCharts4Base.js.map +1 -0
  15. package/dist/PublicAmchartsData.d.ts +41 -15
  16. package/dist/PublicAmchartsData.js +32 -21
  17. package/dist/PublicAmchartsData.js.map +1 -1
  18. package/dist/PublicContext.d.ts +27 -1
  19. package/dist/PublicContext.js +6 -1
  20. package/dist/PublicContext.js.map +1 -1
  21. package/dist/PublicLayout.d.ts +2 -2
  22. package/dist/PublicTemplate.d.ts +16 -5
  23. package/dist/PublicTemplate.js.map +1 -1
  24. package/dist/PublicTemplateForm.d.ts +39 -20
  25. package/dist/PublicTemplateForm.js.map +1 -1
  26. package/dist/PublicTemplates.d.ts +4 -2
  27. package/dist/PublicTheme.d.ts +215 -85
  28. package/dist/PublicTheme.js.map +1 -1
  29. package/dist/PublicTidyColumn.d.ts +39 -19
  30. package/dist/PublicTidyColumn.js +3 -14
  31. package/dist/PublicTidyColumn.js.map +1 -1
  32. package/dist/PublicTidyHistogram.d.ts +20 -1
  33. package/dist/PublicTidyHistogram.js +28 -5
  34. package/dist/PublicTidyHistogram.js.map +1 -1
  35. package/dist/PublicTidyMath.d.ts +7 -1
  36. package/dist/PublicTidyTableInteractions.d.ts +11 -2
  37. package/dist/PublicTidyTableInteractions.js.map +1 -1
  38. package/dist/PublicTidyTableTypes.d.ts +49 -18
  39. package/dist/PublicTidyTableTypes.js +3 -4
  40. package/dist/PublicTidyTableTypes.js.map +1 -1
  41. package/dist/PublicTidyTree.d.ts +1 -1
  42. package/dist/index.d.ts +3 -2
  43. package/dist/index.js +3 -2
  44. package/dist/index.js.map +1 -1
  45. package/dist/theme/ThemeAmCharts4.d.ts +88 -25
  46. package/dist/theme/ThemeAmCharts4.js +7 -1
  47. package/dist/theme/ThemeAmCharts4.js.map +1 -1
  48. package/dist/theme/ThemeCodeMirror.d.ts +4 -0
  49. package/dist/theme/ThemeCodeMirror.js +8 -0
  50. package/dist/theme/ThemeCodeMirror.js.map +1 -0
  51. package/dist/theme/ThemeDatePicker.d.ts +10 -0
  52. package/dist/theme/ThemeEditorTopBar.d.ts +4 -0
  53. package/dist/theme/ThemeEditorTopBar.js +4 -0
  54. package/dist/theme/ThemeEditorTopBar.js.map +1 -1
  55. package/dist/theme/ThemeEmbeddedReport.d.ts +9 -0
  56. package/dist/theme/ThemeEmbeddedReport.js +6 -0
  57. package/dist/theme/ThemeEmbeddedReport.js.map +1 -1
  58. package/dist/theme/ThemeFilterAutocomplete.d.ts +9 -1
  59. package/dist/theme/ThemeFilterButtons.d.ts +5 -0
  60. package/dist/theme/ThemeFilterCheckboxRadio.d.ts +4 -0
  61. package/dist/theme/ThemeFilterPanel.d.ts +4 -0
  62. package/dist/theme/ThemeFilterSlider.d.ts +8 -0
  63. package/dist/theme/ThemeFilterTree.d.ts +6 -1
  64. package/dist/theme/ThemeHtmlBox.d.ts +4 -5
  65. package/dist/theme/ThemeHtmlBox.js +0 -1
  66. package/dist/theme/ThemeHtmlBox.js.map +1 -1
  67. package/dist/theme/ThemeLazyTreeClasses.d.ts +3 -0
  68. package/dist/theme/ThemeListCounter.d.ts +7 -0
  69. package/dist/theme/ThemeListCounter.js +9 -0
  70. package/dist/theme/ThemeListCounter.js.map +1 -0
  71. package/dist/theme/ThemePrintButton.d.ts +25 -0
  72. package/dist/theme/ThemePrintButton.js +10 -0
  73. package/dist/theme/ThemePrintButton.js.map +1 -0
  74. package/dist/theme/ThemeSinglePanelFilter.d.ts +18 -0
  75. package/dist/theme/ThemeSinglePanelFilter.js +3 -0
  76. package/dist/theme/ThemeSinglePanelFilter.js.map +1 -0
  77. package/dist/theme/ThemeTable.d.ts +1 -6
  78. package/dist/theme/ThemeTable.js.map +1 -1
  79. package/dist/theme/ThemeWidgetBox.d.ts +3 -0
  80. package/dist/theme/ThemeWidgetFilteredBy.d.ts +5 -0
  81. package/dist/theme/ThemeWidgetFilteredBy.js +9 -0
  82. package/dist/theme/ThemeWidgetFilteredBy.js.map +1 -0
  83. package/package.json +8 -10
  84. package/dist/IReporting.d.ts +0 -112
  85. package/dist/IReporting.js.map +0 -1
  86. package/dist/Loader.d.ts +0 -117
  87. package/dist/Loader.js +0 -208
  88. package/dist/Loader.js.map +0 -1
package/README.md CHANGED
@@ -1,9 +1,6 @@
1
1
  ## icCube Dashboards API
2
2
 
3
- The icCube Dashboards API allows for:
4
-
5
- - developing new themes, widgets (charts, maps, etc...), data transformations, etc...
6
- - embedding icCube Dashboards into a Web application.
3
+ The icCube Dashboards API allows for developing new themes, widgets (charts, maps, etc...), data transformations, etc...
7
4
 
8
5
  ### Getting Started
9
6
 
@@ -13,4 +10,9 @@ The API is written in Javascript/Typescript and is available as an `npm` package
13
10
 
14
11
  See this [page](./doc/Overview.md) for a detailed documentation of the API.
15
12
 
13
+ ### Embedding icCube Dashboards
14
+
15
+ Since `8.4.0`, this API does not contain anymore the code for embedding icCube into an existing Web application.
16
+ Instead, please refer to the following GitHub [project](https://github.com/ic3-software/ic3-reporting-api-embedded).
17
+
16
18
  _
package/dist/ApiUtils.js CHANGED
@@ -8,7 +8,7 @@ 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.2.3-ct.3" || "-", "Wed, 19 Oct 2022 04:19:01 GMT" || "-") }, definition);
11
+ return Object.assign({ apiVersion: new ReportingVersion_1.default("8.4.0-alpha.1" || "-", "Mon, 13 Mar 2023 10:03:34 GMT" || "-") }, definition);
12
12
  };
13
13
  }
14
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ApiUtils.js","sourceRoot":"","sources":["../src/ApiUtils.ts"],"names":[],"mappings":";;;;;;AAEA,0EAAkD;AAiDlD,MAAa,QAAQ;IAOV,MAAM,CAAC,UAAU,CAAC,UAA6B;QAElD,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;;;;;OAKG;IACI,MAAM,CAAC,oCAAoC,CAAkC,UAAsE;QAEtJ,uCAEO,UAAU,KAEb,MAAM,EAAE,CAAC,OAA6B,EAAE,SAAyB,EAAE,EAAE;gBACjE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;YAC1D,CAAC,EAED,cAAc,EAAE,KAAK,EAErB,6BAA6B,EAAE,KAAK,IAEvC;IAEL,CAAC;IAEM,MAAM,CAAC,wCAAwC,CAAkC,UAAoD,EAAE,OAA6C;QAEvL,OAAO,8CAEA,OAAO,GACP,UAAU,KAEb,iBAAiB,EAAE,SAAS,EAC5B,MAAM,EAAE,OAAO,CAAC,MAAM,GAEmB,CAAA;IAEjD,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,4CAA4C,CAAmC,KAAyC;QAElI,OAAO;YAEH,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;YACxC,uBAAuB,EAAE,KAAK,CAAC,uBAAuB;YAEtD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE;gBAEjB,qDAEO,OAAO,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AAC"}
@@ -1,5 +1,5 @@
1
1
  import { PaperOrientation, PaperSizeName } from "./ITypes";
2
- export declare type AppNotificationType = "edit-report" | "print-report-dialog" | "print-report" | "print-report-without-state" | "print-report-in-browser" | "save-state-to-localstorage" | "restore-state-from-localstorage" | "save-ownprops-to-localstorage" | "restore-ownprops-from-localstorage" | "save-reportwidgets-ownprops-to-localstorage" | "restore-reportwidgets-ownprops-from-localstorage";
2
+ export type AppNotificationType = "edit-report" | "print-report-dialog" | "print-report" | "print-report-without-state" | "print-report-in-browser" | "clear-selection-all-widgets" | "initialize-selection-all-widgets" | "save-state-to-localstorage" | "restore-state-from-localstorage" | "save-ownprops-to-localstorage" | "restore-ownprops-from-localstorage" | "save-reportwidgets-ownprops-to-localstorage" | "restore-reportwidgets-ownprops-from-localstorage";
3
3
  export interface IAppNotification {
4
4
  /**
5
5
  * E.g., print-report.
@@ -56,4 +56,19 @@ export interface SaveWidgetOwnPropsToLocalStorageNotification extends IAppNotifi
56
56
  export interface RestoreWidgetOwnPropsFromLocalStorageNotification extends IAppNotification {
57
57
  readonly type: "restore-reportwidgets-ownprops-from-localstorage";
58
58
  }
59
- export declare type AppNotification = AppEditReportNotification | AppPrintReportDialogNotification | AppPrintReportNotification | AppPrintReportWithoutStateNotification | AppPrintReportInBrowserNotification | SaveStateToLocalStorageNotification | RestoreStateFromLocalStorageNotification | SaveOwnPropsToLocalStorageNotification | RestoreWidgetOwnPropsFromLocalStorageNotification | SaveWidgetOwnPropsToLocalStorageNotification | RestoreOwnPropsFromLocalStorageNotification;
59
+ export interface ClearSelectionAllWidgetsNotification extends IAppNotification {
60
+ readonly type: "clear-selection-all-widgets";
61
+ }
62
+ export interface InitializeSelectionAllWidgetsNotification extends IAppNotification {
63
+ readonly type: "initialize-selection-all-widgets";
64
+ }
65
+ export type AppNotification = AppEditReportNotification | AppPrintReportDialogNotification | AppPrintReportNotification | AppPrintReportWithoutStateNotification | AppPrintReportInBrowserNotification | SaveStateToLocalStorageNotification | RestoreStateFromLocalStorageNotification | SaveOwnPropsToLocalStorageNotification | RestoreWidgetOwnPropsFromLocalStorageNotification | SaveWidgetOwnPropsToLocalStorageNotification | RestoreOwnPropsFromLocalStorageNotification | InitializeSelectionAllWidgetsNotification | ClearSelectionAllWidgetsNotification;
66
+ export interface IAppNotificationToken {
67
+ type: AppNotificationType;
68
+ uid: number;
69
+ }
70
+ export interface IAppNotificationCallback {
71
+ onStarted: (token: IAppNotificationToken) => void;
72
+ onSuccess: (token: IAppNotificationToken) => void;
73
+ onError: (token: IAppNotificationToken, error: any) => void;
74
+ }
@@ -45,7 +45,7 @@ export interface IOnNewEventJsContext {
45
45
  /**
46
46
  * Returns the widget jQuery object
47
47
  *
48
- * Using JQuery might conflit with React's state.
48
+ * Using JQuery might conflict with React's state.
49
49
  * Use with care as you will modify the DOM directly.
50
50
  */
51
51
  getWidget$(widgetId: string): any;
@@ -24,6 +24,9 @@ export interface IPluginDefinition {
24
24
  registerThemes?: (logger: ILogger, manager: IThemeManager) => void;
25
25
  registerWidgets?: (logger: ILogger, manager: IWidgetManager) => void;
26
26
  registerTidyTableTransformations?: (logger: ILogger, manager: ITidyTableTransformationManager) => void;
27
+ /**
28
+ * Register widget defaults for all themes.
29
+ */
27
30
  registerWidgetDefaults?: (logger: ILogger, theme: Theme, manager: IWidgetDefaultsManager) => void;
28
31
  /**
29
32
  * Allows for selecting the available widgets.
@@ -35,7 +35,7 @@ export interface IThemeWidgetDefaults {
35
35
  /**
36
36
  * Sort of named set of predefined options.
37
37
  */
38
- export declare type IThemeWidgetVariant = {
38
+ export type IThemeWidgetVariant = {
39
39
  props: {
40
40
  variant: string;
41
41
  } & Record<string, string>;
package/dist/ITypes.d.ts CHANGED
@@ -1,6 +1,6 @@
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";
1
+ export type PaperSizeName = "A5" | "A4" | "A3" | "B5" | "B4" | "Letter" | "Legal" | "Ledger" | "JIS-B5" | "JIS-B4";
2
+ export type PaperOrientation = "portrait" | "landscape";
3
+ export type PaperSizeUnits = "px" | "mm" | "cm" | "in";
4
4
  export declare enum CompareTextInterpretationType {
5
5
  MORE = "more=better",
6
6
  LESS = "less=better",
@@ -1,6 +1,6 @@
1
1
  import { CSSInterpolation } from "@mui/system";
2
- declare type variantName = string;
3
- export declare type IThemeRegisterVariant = Record<variantName, {
2
+ type variantName = string;
3
+ export type IThemeRegisterVariant = Record<variantName, {
4
4
  /**
5
5
  * for styled MUI like components additional properties defining when the variant applies
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { EntityItem, MdxInfo, TreeRowPropsTreeData } from "./PublicTidyTableTypes";
2
2
  import React, { ReactElement } from "react";
3
- export declare type ScrollDirection = "forward" | "backward";
3
+ export type ScrollDirection = "forward" | "backward";
4
4
  export interface ListOnScrollProps {
5
5
  scrollDirection: ScrollDirection;
6
6
  scrollOffset: number;
package/dist/Logger.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type LoggerComponent = "AlertDialog" | "AmCharts4" | "AmCharts4GeoMap" | "AmCharts5" | "App" | "AppCustomHeaders" | "AppStarter" | "AppStatus" | "ChartTemplateWidget" | "Demo" | "EmbeddedReport" | "ErrorRenderer" | "Font" | "General" | "GoogleMap" | "Help" | "History" | "Keyboard" | "Layout" | "LayoutPage" | "LayoutRender" | "Loader" | "Localization" | "Other" | "PivotTable" | "PivotTablePagingView" | "Plugin" | "Profiler" | "ReportAppBar" | "ReportAppMenu" | "ReportInitializer" | "ReportStarter" | "RepetitionWidget" | "Request" | "SchemaDataUpdate" | "Storage" | "Table" | "WidgetBox" | "WidgetBoxWrapper" | "WidgetTemplateLibrary";
1
+ export type LoggerComponent = "AlertDialog" | "AmCharts4" | "AmCharts4GeoMap" | "AmCharts5" | "App" | "AppCustomHeaders" | "AppStarter" | "AppStatus" | "ChartTemplateWidget" | "Demo" | "EmbeddedReport" | "ErrorRenderer" | "Font" | "General" | "GoogleMap" | "Help" | "History" | "Keyboard" | "Layout" | "LayoutPage" | "LayoutRender" | "Loader" | "Localization" | "Operation" | "Other" | "PivotTable" | "PivotTablePagingView" | "Plugin" | "Profiler" | "ReportAppBar" | "ReportAppMenu" | "ReportInitializer" | "ReportStarter" | "RepetitionWidget" | "Request" | "SchemaDataUpdate" | "Storage" | "Table" | "WidgetBox" | "WidgetBoxWrapper" | "WidgetTemplateLibrary";
2
2
  export interface ILogger {
3
3
  resetTime(): void;
4
4
  disable(component: LoggerComponent): void;
@@ -0,0 +1,91 @@
1
+ import { IWidgetPublicContext } from "./PublicContext";
2
+ import { ITidyColorColumn, ITidyColumn } from "./PublicTidyColumn";
3
+ import { ITidyTable } from "./PublicTidyTable";
4
+ import { ITidyTableInteraction } from "./PublicTidyTableInteractions";
5
+ import { Theme } from "@mui/material/styles";
6
+ import { ITidyMath } from "./PublicTidyMath";
7
+ import { IWidgetTemplateTidyData } from "./PublicTemplate";
8
+ import { Am4ChartOptions } from "./theme/ThemeAmCharts4";
9
+ import { Property } from "csstype";
10
+ export interface PublicAmCharts4Base<CHART, OPTIONS extends Am4ChartOptions> {
11
+ readonly context: IWidgetPublicContext;
12
+ /**
13
+ * The theme of the report
14
+ */
15
+ readonly theme: Theme;
16
+ tidyMath(): ITidyMath;
17
+ /**
18
+ * Get the color manager of the chart. This manager can create color columns using the default
19
+ * theme palette.
20
+ */
21
+ getColorManager(): PublicAm4ColorManager;
22
+ /**
23
+ * Render the chart. Function called by plugin module.
24
+ */
25
+ renderJS(template: IWidgetTemplateTidyData, options: OPTIONS): void;
26
+ /**
27
+ * Dispose/ destroy the chart.
28
+ */
29
+ dispose(): void;
30
+ /**
31
+ * Adds an event listener to a series in the chart. This function adds the selection and the
32
+ * events to fire that are in 'getEventsToFire'.
33
+ * @param sprite a amcharts series object.
34
+ * @param dataKey the data key identifies the series in the chart data.
35
+ */
36
+ addClickEventOnSprite(sprite: any, dataKey: string | undefined): void;
37
+ /**
38
+ * Returns the row for a certain data item.
39
+ * @param dataItem the data item of a sprite (bar, line, circle, etc..)
40
+ * @param dataKey the data key identifies the series in the chart data.
41
+ */
42
+ getRowFromDataItem(dataItem: unknown, dataKey: string | undefined): number | undefined;
43
+ /**
44
+ * Get the tidy table. Only use this function in update methods, otherwise it might not be defined and then it
45
+ * throws an error.
46
+ */
47
+ getTable(): ITidyTable;
48
+ /**
49
+ * Get the options. Only use this function in update methods, otherwise it might not be defined and then it
50
+ * throws an error.
51
+ */
52
+ getOptions(): OPTIONS;
53
+ getInter(): ITidyTableInteraction;
54
+ getChart(): CHART;
55
+ /**
56
+ * Perform interactions on the chart. Possible interaction can be a selection,
57
+ * a drilldown or the firing of an event.
58
+ *
59
+ * Available interactions are set via the 'Interactions' tab in the widget editor.
60
+ *
61
+ * @param rowIdx the index of the row.
62
+ * @param mouseEvent the html mouse event of the click. Used for multiple selection using ctrl and shift.
63
+ */
64
+ performInteraction(rowIdx: number, mouseEvent: MouseEvent | TouchEvent): void;
65
+ /**
66
+ * Returns the am4core instance used by the amCharts4 plugin.
67
+ */
68
+ getAm4core(): any;
69
+ /**
70
+ * Returns the am4charts instance used by the amCharts4 plugin.
71
+ */
72
+ getAm4charts(): any;
73
+ }
74
+ export type Am4Color = Property.Color;
75
+ export interface PublicAm4ColorManager {
76
+ /**
77
+ * Generate a color column.
78
+ * @param table create the color column for this table (same length).
79
+ * @param categoryColumn if available, use the values in this column to generate colors.
80
+ */
81
+ generateColors(table: ITidyTable, categoryColumn?: ITidyColumn): ITidyColorColumn;
82
+ /**
83
+ * Get a color
84
+ * @param dataKey string to generate color for
85
+ */
86
+ getColor(dataKey: unknown): Am4Color;
87
+ /**
88
+ * Returns the default single color
89
+ */
90
+ getDefaultColor(): Am4Color;
91
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IReporting.js.map
3
+ //# sourceMappingURL=PublicAmCharts4Base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PublicAmCharts4Base.js","sourceRoot":"","sources":["../src/PublicAmCharts4Base.ts"],"names":[],"mappings":""}
@@ -11,6 +11,7 @@ export interface ISeriesValues {
11
11
  type: ISeriesValuesType;
12
12
  values: ITidyNumericColumn;
13
13
  colors?: ITidyColorColumn;
14
+ parentSeriesId?: string;
14
15
  }
15
16
  /**
16
17
  * Used for managing amcharts data in the Amcharts plugin. This class controls both the creation of the charts
@@ -23,6 +24,7 @@ export declare class PublicAmchartsData {
23
24
  private readonly onGroup;
24
25
  private readonly table;
25
26
  constructor(table: ITidyTable, onValues: ISeriesValues[], onAxis: ITidyColumn, onGroup?: ITidyColumn, onLevel?: ITidyColumn);
27
+ static getSeriesId(seriesId: number, rowIdx?: number, group?: ITidyColumn): string;
26
28
  /**
27
29
  * Get the data for the chart.
28
30
  */
@@ -30,23 +32,10 @@ export declare class PublicAmchartsData {
30
32
  /**
31
33
  * Create, update and remove series in the chart.
32
34
  * @param itemControl map keeping track of current series in the chart.
33
- * @param create create a new series if it is not in itemControl.
34
- * - seriesId: unique id of the series
35
- * - groupKey: key for the group by (if defined). If not defined, use _
36
- * - valueKey: series value datafield
37
- * - fillKey: series fill datafield
38
- * - sValue: the onValues part used
39
- * @param update update a series.
40
- * - seriesId: unique id of the series
41
- * - groupKey: key for the group by (if defined). If not defined, use _
42
- * - series: the charts series to update
43
- * - sValue: the onValues part used
44
- * - groupRows: row indices of the group. Length >= 1.
45
- * @param remove remove the series.
46
- * @param typeFilter if defined, only call create, update and remove where typeFilter(type) returns true.
35
+ * @param seriesControl object controlling the adding/removing/updating of series.
47
36
  * @param firstGroupOnly only call the first group
48
37
  */
49
- updateSeries<T>(itemControl: Map<string, T>, create: (seriesId: string, groupKey: string, valueKey: string, fillKey: string, sValue: ISeriesValues) => T, update: (seriesId: string, groupKey: string, series: T, sValue: ISeriesValues, groupRows: GroupRowIndices) => void, remove: (item: T) => void, typeFilter?: (type: ISeriesValuesType) => boolean, firstGroupOnly?: boolean): void;
38
+ updateSeries<T>(itemControl: Map<string, T>, seriesControl: IAmchartsSeriesControl<T>, firstGroupOnly?: boolean): void;
50
39
  getAxis(): ITidyColumn;
51
40
  getLevel(): ITidyColumn | undefined;
52
41
  getGroup(): ITidyColumn | undefined;
@@ -55,6 +44,11 @@ export declare class PublicAmchartsData {
55
44
  * @param idx n
56
45
  */
57
46
  getValueColumn(idx: number): ITidyNumericColumn;
47
+ /**
48
+ * Call a function on each series and it's column
49
+ * @param itemControl map keeping track of current series in the chart.
50
+ */
51
+ forEachSeries<T>(itemControl: Map<string, T>, callback: (col: ITidyNumericColumn, seriesId: string, series: T) => void): void;
58
52
  /**
59
53
  * Returns the first item in the onValues argument of the constructor.
60
54
  */
@@ -64,3 +58,35 @@ export declare class PublicAmchartsData {
64
58
  */
65
59
  isMultiMeasure(): boolean;
66
60
  }
61
+ /**
62
+ * Controls when to add / remove / dispose / update series. This class exists because using chart.setSeries removes
63
+ * trend-series. This class handles the adding and removing of series and keeps the series in the order of the data.
64
+ */
65
+ export interface IAmchartsSeriesControl<T> {
66
+ /**
67
+ * If defined, only call create, update and remove where typeFilter(type) returns true.
68
+ */
69
+ typeFilter?: (type: ISeriesValuesType) => boolean;
70
+ /**
71
+ * Create a new series if it is not in itemControl. Use 'add' to add it to the chart.
72
+ * @param seriesId unique id of the series
73
+ * @param groupKey key for the group by (if defined). If not defined, use _
74
+ * @param valueKey series value dataField
75
+ * @param fillKey series fill dataField
76
+ * @param sValue the onValues part used
77
+ */
78
+ create: (seriesId: string, groupKey: string, valueKey: string, fillKey: string, sValue: ISeriesValues) => T;
79
+ /**
80
+ * Update a series.
81
+ * @param seriesId unique id of the series
82
+ * @param groupKey key for the group by (if defined). If not defined, use _
83
+ * @param series the charts series to update
84
+ * @param sValue the onValues part used
85
+ * @param groupRows row indices of the group. Length >= 1.
86
+ */
87
+ update: (seriesId: string, groupKey: string, series: T, sValue: ISeriesValues, groupRows: GroupRowIndices) => void;
88
+ /**
89
+ * Destroy an item. Called when the item can be cleared from memory. E.g., dispose() on the series.
90
+ */
91
+ remove: (item: T) => void;
92
+ }
@@ -21,6 +21,12 @@ class PublicAmchartsData {
21
21
  this.onLevel = onLevel;
22
22
  this.table = table;
23
23
  }
24
+ static getSeriesId(seriesId, rowIdx, group) {
25
+ if (group && rowIdx != null) {
26
+ return group.getAmcharts4GroupKey(rowIdx) + "." + String(seriesId);
27
+ }
28
+ return PublicTidyTableTypes_1.IAmcharts4DataKey.NULL + "." + String(seriesId);
29
+ }
24
30
  /**
25
31
  * Get the data for the chart.
26
32
  */
@@ -48,38 +54,25 @@ class PublicAmchartsData {
48
54
  /**
49
55
  * Create, update and remove series in the chart.
50
56
  * @param itemControl map keeping track of current series in the chart.
51
- * @param create create a new series if it is not in itemControl.
52
- * - seriesId: unique id of the series
53
- * - groupKey: key for the group by (if defined). If not defined, use _
54
- * - valueKey: series value datafield
55
- * - fillKey: series fill datafield
56
- * - sValue: the onValues part used
57
- * @param update update a series.
58
- * - seriesId: unique id of the series
59
- * - groupKey: key for the group by (if defined). If not defined, use _
60
- * - series: the charts series to update
61
- * - sValue: the onValues part used
62
- * - groupRows: row indices of the group. Length >= 1.
63
- * @param remove remove the series.
64
- * @param typeFilter if defined, only call create, update and remove where typeFilter(type) returns true.
57
+ * @param seriesControl object controlling the adding/removing/updating of series.
65
58
  * @param firstGroupOnly only call the first group
66
59
  */
67
- updateSeries(itemControl, create, update, remove, typeFilter, firstGroupOnly) {
60
+ updateSeries(itemControl, seriesControl, firstGroupOnly) {
68
61
  const group = this.onGroup;
69
62
  const updated = new Set();
70
63
  const forEachSeries = (groupKey, groupIdx) => {
71
64
  this.onValues.forEach((onValue, idx) => {
72
- if (typeFilter != null && !typeFilter(onValue.type)) {
65
+ if (seriesControl.typeFilter != null && !seriesControl.typeFilter(onValue.type)) {
73
66
  return;
74
67
  }
75
68
  const seriesKey = groupKey + "." + String(idx);
76
69
  let item = itemControl.get(seriesKey);
77
70
  if (item == null) {
78
- const newItem = create(seriesKey, groupKey, seriesKey + "v", seriesKey + "c", onValue);
71
+ const newItem = seriesControl.create(seriesKey, groupKey, seriesKey + "v", seriesKey + "c", onValue);
79
72
  itemControl.set(seriesKey, newItem);
80
73
  item = newItem;
81
74
  }
82
- update(seriesKey, groupKey, item, onValue, groupIdx);
75
+ seriesControl.update(seriesKey, groupKey, item, onValue, groupIdx);
83
76
  updated.add(seriesKey);
84
77
  });
85
78
  };
@@ -89,13 +82,13 @@ class PublicAmchartsData {
89
82
  const groupIdx = index.values().next();
90
83
  if (!groupIdx.done) {
91
84
  const firstIndex = groupIdx.value[0];
92
- const groupKey = group.getUid(firstIndex);
85
+ const groupKey = group.getAmcharts4GroupKey(firstIndex);
93
86
  forEachSeries(groupKey, groupIdx.value);
94
87
  }
95
88
  }
96
89
  else {
97
90
  index.forEach(groupIdx => {
98
- const groupKey = group.getUid(groupIdx[0]);
91
+ const groupKey = group.getAmcharts4GroupKey(groupIdx[0]);
99
92
  forEachSeries(groupKey, groupIdx);
100
93
  });
101
94
  }
@@ -107,7 +100,7 @@ class PublicAmchartsData {
107
100
  itemControl.forEach((item, key) => {
108
101
  if (!updated.has(key)) {
109
102
  itemControl.delete(key);
110
- remove(item);
103
+ seriesControl.remove(item);
111
104
  }
112
105
  });
113
106
  }
@@ -127,6 +120,24 @@ class PublicAmchartsData {
127
120
  getValueColumn(idx) {
128
121
  return this.onValues[idx].values;
129
122
  }
123
+ /**
124
+ * Call a function on each series and it's column
125
+ * @param itemControl map keeping track of current series in the chart.
126
+ */
127
+ forEachSeries(itemControl, callback) {
128
+ this.updateSeries(itemControl, {
129
+ create: () => {
130
+ throw Error("SNBH series cannot be created");
131
+ },
132
+ update: (seriesId, groupKey, series, sValue, groupRows) => {
133
+ callback(sValue.values, seriesId, series);
134
+ },
135
+ remove: () => {
136
+ throw Error("SNBH series cannot be removed");
137
+ },
138
+ typeFilter: type => type !== ISeriesValuesType.TREND
139
+ }, true);
140
+ }
130
141
  /**
131
142
  * Returns the first item in the onValues argument of the constructor.
132
143
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PublicAmchartsData.js","sourceRoot":"","sources":["../src/PublicAmchartsData.ts"],"names":[],"mappings":";;;AAEA,iEAA2G;AAE3G,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,yDAAI,CAAA;IACJ,6DAAM,CAAA;IACN,2DAAK,CAAA;IACL,mEAAS,CAAA;AACb,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B;AAWD;;;GAGG;AACH,MAAa,kBAAkB;IAQ3B,YAAY,KAAiB,EAAE,QAAyB,EAAE,MAAmB,EAAE,OAAqB,EACxF,OAAqB;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,YAAY;QAER,MAAM,WAAW,GAAgC,EAAE,CAAC;QACpD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAEjC;;;eAGG;YACH,IAAI,WAAwB,CAAC;YAC7B,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,CAAC,SAAS,EAAE;gBAC5C,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE,sCAAe,CAAC,OAAO,CAAC,CAAC;aAC7G;iBAAM;gBACH,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;aAC9B;YAED,WAAW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B,EAAE,QAAsE;QAEhH,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE;YAC3B,MAAM,EAAE,GAAG,EAAE;gBACT,MAAM,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACjD,CAAC;YACD,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;gBACtD,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC9C,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACT,MAAM,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACjD,CAAC;YACD,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,iBAAiB,CAAC,KAAK;SACvD,EAAE,IAAI,CAAC,CAAC;IACb,CAAC;IAED;;OAEG;IACH,aAAa;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,cAAc;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,iBAAiB,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACpF,CAAC;CAEJ;AAvKD,gDAuKC"}
@@ -8,10 +8,15 @@ import { ITidyColumn, ITidyNumericColumn } from "./PublicTidyColumn";
8
8
  import { IPublicWidgetTemplateDefinition } from "./PublicTemplate";
9
9
  import { ITidyMath } from "./PublicTidyMath";
10
10
  import { ILogger } from "./Logger";
11
+ import { AppNotification } from "./INotification";
11
12
  export declare enum WidgetRenderLayoutStatus {
12
13
  RENDERING = "RENDERING",
13
14
  RENDERED = "RENDERED"
14
15
  }
16
+ export declare enum WidgetWarningSeverity {
17
+ WARNING = 0,
18
+ ERROR = 1
19
+ }
15
20
  export declare enum IContentMessageType {
16
21
  info = 0,
17
22
  error = 1
@@ -84,7 +89,7 @@ export interface IPublicContext {
84
89
  * To prevent usage of the default, pass an "empty" string that makes this method returns
85
90
  * undefined.
86
91
  */
87
- createTableMarkdownExpr(field: string, table: ITidyTable, expression: string | undefined): (() => string) | undefined;
92
+ createTableMarkdownExpr(field: string, table: ITidyTable, currentColumn: ITidyColumn | undefined, expression: string | undefined, selectedColumns: ITidyColumn[] | undefined): (() => string) | undefined;
88
93
  /**
89
94
  * Not in widget public context because of transformation not applied from a widget context always.
90
95
  *
@@ -108,6 +113,14 @@ export interface IPublicContext {
108
113
  createTableNumericExpr(field: string, table: ITidyTable, currentColumn: ITidyColumn | undefined, expression: string | undefined, selectedColumns: ITidyColumn[] | undefined): (() => number | undefined) | undefined;
109
114
  }
110
115
  export interface IWidgetPublicContext extends IPublicContext {
116
+ /**
117
+ * Get the width of the widget box in pixels.
118
+ */
119
+ getWidgetWidth(): number | undefined;
120
+ /**
121
+ * Get the height of the widget box in pixels.
122
+ */
123
+ getWidgetHeight(): number | undefined;
111
124
  getNsId(): string;
112
125
  getWidgetId(): string;
113
126
  getWidgetPageNb(): number;
@@ -152,6 +165,10 @@ export interface IWidgetPublicContext extends IPublicContext {
152
165
  * actionName if the action is bound to a channel, send an Mdx Event (value,mdx)
153
166
  */
154
167
  fireMdxEvent(actionName: string, value: string, mdx: string): void;
168
+ /**
169
+ * Used for publishing app notifications (e.g., print the report).
170
+ */
171
+ fireAppNotification(notification: AppNotification): void;
155
172
  /**
156
173
  * Cypress testing purpose, after a rendering of the chart
157
174
  */
@@ -216,6 +233,15 @@ export interface IWidgetPublicContext extends IPublicContext {
216
233
  */
217
234
  getMapCoordinates(table: ITidyTable): [ITidyNumericColumn, ITidyNumericColumn] | [];
218
235
  getGoogleMapRenderedDelayMS(): number;
236
+ /**
237
+ * Displays an warning icon in the widget header showing the warning when the user hovers the icon.
238
+ * Be sure to clear all warnings before rendering using {@see widgetClearWarnings}
239
+ */
240
+ addWidgetWarning(warning: string, severity?: WidgetWarningSeverity): void;
241
+ /**
242
+ * Clear the warnings in the widget.
243
+ */
244
+ widgetClearWarnings(): void;
219
245
  }
220
246
  export interface IWidgetEditorPublicContext {
221
247
  /**
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IContentMessageType = exports.WidgetRenderLayoutStatus = void 0;
3
+ exports.IContentMessageType = exports.WidgetWarningSeverity = exports.WidgetRenderLayoutStatus = void 0;
4
4
  var WidgetRenderLayoutStatus;
5
5
  (function (WidgetRenderLayoutStatus) {
6
6
  WidgetRenderLayoutStatus["RENDERING"] = "RENDERING";
7
7
  WidgetRenderLayoutStatus["RENDERED"] = "RENDERED";
8
8
  })(WidgetRenderLayoutStatus = exports.WidgetRenderLayoutStatus || (exports.WidgetRenderLayoutStatus = {}));
9
+ var WidgetWarningSeverity;
10
+ (function (WidgetWarningSeverity) {
11
+ WidgetWarningSeverity[WidgetWarningSeverity["WARNING"] = 0] = "WARNING";
12
+ WidgetWarningSeverity[WidgetWarningSeverity["ERROR"] = 1] = "ERROR";
13
+ })(WidgetWarningSeverity = exports.WidgetWarningSeverity || (exports.WidgetWarningSeverity = {}));
9
14
  var IContentMessageType;
10
15
  (function (IContentMessageType) {
11
16
  IContentMessageType[IContentMessageType["info"] = 0] = "info";
@@ -1 +1 @@
1
- {"version":3,"file":"PublicContext.js","sourceRoot":"","sources":["../src/PublicContext.ts"],"names":[],"mappings":";;;AAUA,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":";;;AAWA,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAChC,mDAAuB,CAAA;IACvB,iDAAqB,CAAA;AACzB,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAED,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC7B,uEAAO,CAAA;IACP,mEAAK,CAAA;AACT,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC;AAED,IAAY,mBAAkC;AAA9C,WAAY,mBAAmB;IAAG,6DAAI,CAAA;IAAE,+DAAK,CAAA;AAAA,CAAC,EAAlC,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAAe"}
@@ -1,12 +1,12 @@
1
1
  import { PaperOrientation, PaperSizeUnits } from "./ITypes";
2
2
  import { Property } from "csstype";
3
- declare type CSSProperties = any;
3
+ type CSSProperties = any;
4
4
  /**
5
5
  * <pre>
6
6
  * unlimited: in height (page width is always known).
7
7
  * </pre>
8
8
  */
9
- export declare type PageSize = "known" | "manual" | "unlimited";
9
+ export type PageSize = "known" | "manual" | "unlimited";
10
10
  export interface IPageSize {
11
11
  type: PageSize;
12
12
  }
@@ -38,8 +38,7 @@ export interface IWidgetLayoutInfo extends IRectangle {
38
38
  data?: IWidgetLayoutData;
39
39
  resizingConstraint?: ResizingConstraintOptions;
40
40
  }
41
- declare type ChartTemplateWidgetProps = any;
42
- export declare type IPublicWidgetTemplateDefinition<T extends FormFieldObject> = IPublicWidgetReactTemplateDefinition<T> | IPublicWidgetJsTemplateDefinition<T>;
41
+ export type IPublicWidgetTemplateDefinition<T extends FormFieldObject> = IPublicWidgetReactTemplateDefinition<T> | IPublicWidgetJsTemplateDefinition<T>;
43
42
  export declare enum IWidgetTemplateMdxBuilderAxisPropsConstraint {
44
43
  DateType = "DateType",
45
44
  GeoLatLong = "GeoLatLong",
@@ -100,9 +99,13 @@ export interface IWidgetTemplateMdxBuilderMapping {
100
99
  */
101
100
  mdxIsForFilter?: true;
102
101
  /**
103
- * The cell values are not needed
102
+ * The cell values are not needed.
104
103
  */
105
104
  withoutCellValues?: true;
105
+ /**
106
+ * The cell values are not needed if there is a single axis in the query.
107
+ */
108
+ withoutCellValuesSingleAxis?: true;
106
109
  /**
107
110
  * An MDX query if the builder is empty.
108
111
  */
@@ -119,7 +122,7 @@ export interface IPublicReactChartTemplate<T extends FormFieldObject> {
119
122
  * @param options the options (possibly edited and/or from the theme) of this widget
120
123
  * @param header aka. widget title
121
124
  */
122
- reactElement: (data: IWidgetTemplateTidyData, options: T, header: string, props: ChartTemplateWidgetProps) => ReactElement;
125
+ reactElement: (data: IWidgetTemplateTidyData, options: T, header: string) => ReactElement;
123
126
  }
124
127
  /**
125
128
  * A widget that renders using plain Javascript/Typescript.
@@ -298,6 +301,9 @@ interface IPublicCommonWidgetTemplateDefinition<OPTIONS extends FormFieldObject>
298
301
  * If and only if not null, hide option 'Interactions' > 'Drilldown' > 'Pivot Table Like' and set it default value to withDrilldownPivotTableLikeAs.
299
302
  */
300
303
  withDrilldownPivotTableLikeAs?: boolean;
304
+ /**
305
+ * Extra options for in the widgets user menu when in viewer mode.
306
+ */
301
307
  userMenuOptions?: string[];
302
308
  /**
303
309
  * Additional widget user menu options when in editing mode.
@@ -407,6 +413,11 @@ interface IPublicCommonWidgetTemplateDefinition<OPTIONS extends FormFieldObject>
407
413
  * Defaults: all of them.
408
414
  */
409
415
  withQueryTypes?: QueryType[];
416
+ /**
417
+ * Change the data to show when the user presses show-data from the widget menu.
418
+ * @param ownProps
419
+ */
420
+ getShowHideDataTable?: (table: ITidyTable | undefined, options: OPTIONS, ownProps: any) => ITidyTable | undefined;
410
421
  }
411
422
  /**
412
423
  * *********************************************************************************************************************
@@ -437,7 +448,7 @@ export interface IChartVisualizationTypedInput<T extends FormFieldObject> {
437
448
  * validity. The widget generates an error if columns are selected that are not in the allowed properties, or if
438
449
  * columns are mandatory but there is no selection or fallback.
439
450
  */
440
- export declare type IWidgetTemplateDataMappingDef = IFormColumnChooserFieldDef;
451
+ export type IWidgetTemplateDataMappingDef = IFormColumnChooserFieldDef;
441
452
  /**
442
453
  * Predefined roles
443
454
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PublicTemplate.js","sourceRoot":"","sources":["../src/PublicTemplate.ts"],"names":[],"mappings":";;;AA2DA,IAAY,4CAIX;AAJD,WAAY,4CAA4C;IACpD,qEAAqB,CAAA;IACrB,yEAAyB,CAAA;IACzB,2EAA2B,CAAA;AAC/B,CAAC,EAJW,4CAA4C,GAA5C,oDAA4C,KAA5C,oDAA4C,QAIvD;AA2bD;;;;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;AA6BD;;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":";;;AAyDA,IAAY,4CAIX;AAJD,WAAY,4CAA4C;IACpD,qEAAqB,CAAA;IACrB,yEAAyB,CAAA;IACzB,2EAA2B,CAAA;AAC/B,CAAC,EAJW,4CAA4C,GAA5C,oDAA4C,KAA5C,oDAA4C,QAIvD;AA0cD;;;;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;AA6BD;;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"}