@ic3/reporting-api 8.3.0 → 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.
- package/README.md +6 -4
- package/dist/ApiUtils.js +1 -1
- package/dist/ApiUtils.js.map +1 -1
- package/dist/INotification.d.ts +8 -2
- package/dist/IPluginDefinition.d.ts +3 -0
- package/dist/PublicAmCharts4Base.d.ts +91 -0
- package/dist/{IReporting.js → PublicAmCharts4Base.js} +1 -1
- package/dist/PublicAmCharts4Base.js.map +1 -0
- package/dist/PublicAmchartsData.d.ts +41 -15
- package/dist/PublicAmchartsData.js +32 -21
- package/dist/PublicAmchartsData.js.map +1 -1
- package/dist/PublicContext.d.ts +9 -1
- package/dist/PublicTemplate.d.ts +8 -0
- package/dist/PublicTemplate.js.map +1 -1
- package/dist/PublicTemplateForm.d.ts +21 -3
- package/dist/PublicTemplateForm.js.map +1 -1
- package/dist/PublicTheme.d.ts +140 -37
- package/dist/PublicTheme.js.map +1 -1
- package/dist/PublicTidyColumn.d.ts +16 -2
- package/dist/PublicTidyColumn.js +3 -14
- package/dist/PublicTidyColumn.js.map +1 -1
- package/dist/PublicTidyHistogram.d.ts +20 -1
- package/dist/PublicTidyHistogram.js +28 -5
- package/dist/PublicTidyHistogram.js.map +1 -1
- package/dist/PublicTidyMath.d.ts +7 -1
- package/dist/PublicTidyTableInteractions.d.ts +4 -0
- package/dist/PublicTidyTableTypes.d.ts +4 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/theme/ThemeAmCharts4.d.ts +30 -7
- package/dist/theme/ThemeAmCharts4.js +7 -1
- package/dist/theme/ThemeAmCharts4.js.map +1 -1
- package/dist/theme/ThemeCodeMirror.d.ts +4 -0
- package/dist/theme/ThemeCodeMirror.js +8 -0
- package/dist/theme/ThemeCodeMirror.js.map +1 -0
- package/dist/theme/ThemeDatePicker.d.ts +2 -0
- package/dist/theme/ThemeEmbeddedReport.d.ts +9 -0
- package/dist/theme/ThemeEmbeddedReport.js +6 -0
- package/dist/theme/ThemeEmbeddedReport.js.map +1 -1
- package/dist/theme/ThemeFilterAutocomplete.d.ts +3 -0
- package/dist/theme/ThemeFilterButtons.d.ts +5 -0
- package/dist/theme/ThemeFilterCheckboxRadio.d.ts +4 -0
- package/dist/theme/ThemeFilterSlider.d.ts +8 -0
- package/dist/theme/ThemeFilterTree.d.ts +5 -0
- package/dist/theme/ThemeHtmlBox.d.ts +3 -4
- package/dist/theme/ThemeHtmlBox.js +0 -1
- package/dist/theme/ThemeHtmlBox.js.map +1 -1
- package/dist/theme/ThemeLazyTreeClasses.d.ts +2 -0
- package/dist/theme/ThemeListCounter.d.ts +2 -0
- package/dist/theme/ThemePrintButton.d.ts +3 -0
- package/dist/theme/ThemeTable.d.ts +1 -6
- package/dist/theme/ThemeTable.js.map +1 -1
- package/dist/theme/ThemeWidgetBox.d.ts +3 -0
- package/dist/theme/ThemeWidgetFilteredBy.d.ts +5 -0
- package/dist/theme/ThemeWidgetFilteredBy.js +9 -0
- package/dist/theme/ThemeWidgetFilteredBy.js.map +1 -0
- package/package.json +8 -10
- package/dist/IReporting.d.ts +0 -153
- package/dist/IReporting.js.map +0 -1
- package/dist/Loader.d.ts +0 -191
- package/dist/Loader.js +0 -209
- 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.
|
|
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
|
/**
|
package/dist/ApiUtils.js.map
CHANGED
|
@@ -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,
|
|
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,eAAe,IAAI,GAAG,EACtB,+BAA+B,IAAI,GAAG,CACzC,IAEE,UAAU,EAEhB;QAEL,CAAC,CAAA;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,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CAAC,CAAC,CAAC;oBAEP,CAAC,IACJ;YACL,CAAC;SAEwC,CAAC;IAElD,CAAC;;AA/GL,4BAiHC;AA/GG;;GAEG;AACoB,uBAAc,GAAG,OAAO,CAAC"}
|
package/dist/INotification.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PaperOrientation, PaperSizeName } from "./ITypes";
|
|
2
|
-
export 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,7 +56,13 @@ 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
|
|
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;
|
|
60
66
|
export interface IAppNotificationToken {
|
|
61
67
|
type: AppNotificationType;
|
|
62
68
|
uid: number;
|
|
@@ -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.
|
|
@@ -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
|
+
}
|
|
@@ -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
|
|
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>,
|
|
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
|
|
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,
|
|
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.
|
|
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.
|
|
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;
|
|
1
|
+
{"version":3,"file":"PublicAmchartsData.js","sourceRoot":"","sources":["../src/PublicAmchartsData.ts"],"names":[],"mappings":";;;AAEA,iEAA2G;AAE3G,IAAY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C,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACpF,CAAC;CAEJ;AAvKD,gDAuKC"}
|
package/dist/PublicContext.d.ts
CHANGED
|
@@ -89,7 +89,7 @@ export interface IPublicContext {
|
|
|
89
89
|
* To prevent usage of the default, pass an "empty" string that makes this method returns
|
|
90
90
|
* undefined.
|
|
91
91
|
*/
|
|
92
|
-
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;
|
|
93
93
|
/**
|
|
94
94
|
* Not in widget public context because of transformation not applied from a widget context always.
|
|
95
95
|
*
|
|
@@ -113,6 +113,14 @@ export interface IPublicContext {
|
|
|
113
113
|
createTableNumericExpr(field: string, table: ITidyTable, currentColumn: ITidyColumn | undefined, expression: string | undefined, selectedColumns: ITidyColumn[] | undefined): (() => number | undefined) | undefined;
|
|
114
114
|
}
|
|
115
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;
|
|
116
124
|
getNsId(): string;
|
|
117
125
|
getWidgetId(): string;
|
|
118
126
|
getWidgetPageNb(): number;
|
package/dist/PublicTemplate.d.ts
CHANGED
|
@@ -301,6 +301,9 @@ interface IPublicCommonWidgetTemplateDefinition<OPTIONS extends FormFieldObject>
|
|
|
301
301
|
* If and only if not null, hide option 'Interactions' > 'Drilldown' > 'Pivot Table Like' and set it default value to withDrilldownPivotTableLikeAs.
|
|
302
302
|
*/
|
|
303
303
|
withDrilldownPivotTableLikeAs?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Extra options for in the widgets user menu when in viewer mode.
|
|
306
|
+
*/
|
|
304
307
|
userMenuOptions?: string[];
|
|
305
308
|
/**
|
|
306
309
|
* Additional widget user menu options when in editing mode.
|
|
@@ -410,6 +413,11 @@ interface IPublicCommonWidgetTemplateDefinition<OPTIONS extends FormFieldObject>
|
|
|
410
413
|
* Defaults: all of them.
|
|
411
414
|
*/
|
|
412
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;
|
|
413
421
|
}
|
|
414
422
|
/**
|
|
415
423
|
* *********************************************************************************************************************
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -98,7 +98,7 @@ export type FormFields<T extends FormFieldObject> = {
|
|
|
98
98
|
} | {
|
|
99
99
|
defaultValue?: any;
|
|
100
100
|
mandatory?: false;
|
|
101
|
-
}) & (Required<T>[key] extends FormFieldObject ? Omit<IFormEmbeddedFieldDef<Required<T>[key]>, 'fieldPath'> : Required<T>[key] extends IPaletteDef ? Omit<IFormPaletteEditorFieldDef, 'fieldPath'> : Required<T>[key] extends IColorDef ? Omit<IFormColorEditorFieldDef, 'fieldPath'> : Required<T>[key] extends TidyTableColumnSelector[] ? Omit<IFormColumnChooserMultipleFieldDef, 'fieldPath'> : Required<T>[key] extends TidyTableColumnSelector ? Omit<IFormColumnChooserSingleFieldDef, 'fieldPath'> : Required<T>[key] extends IFormEventMappingArrayFieldDefType ? Omit<IFormEventMappingArrayFieldDef, 'fieldPath'> : Required<T>[key] extends IFormEventArrayFieldDefType ? Omit<IFormEventArrayFieldDef, 'fieldPath'> : Required<T>[key] extends Hook<any> ? Omit<IFormHookFieldDef<any>, 'fieldPath'> : Required<T>[key] extends boolean ? Omit<IFormBooleanFieldDef, 'fieldPath'> : Required<T>[key] extends number ? Omit<IFormNumberFieldDef, 'fieldPath'> : Required<T>[key] extends number ? Omit<IFormMaskFieldDef, 'fieldPath'> : Required<T>[key] extends string ? Omit<IFormOptionFieldSingleDef, 'fieldPath'> | Omit<IFormStringFieldDef, 'fieldPath'> | Omit<IFormFormatterPickerFieldDef, 'fieldPath'> | Omit<IFormWidgetVariantFieldDef, 'fieldPath'> | Omit<IFormTidyTableTextExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableTextRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableHtmlRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableHtmlExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableNumericExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableNumericRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableColorRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableStringRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableScaleRowExprFieldDef, 'fieldPath'> | Omit<IFormJsFieldDef, 'fieldPath'> | Omit<IFormJsonFieldDef, 'fieldPath'> | Omit<IFormMarkdownFieldDef, 'fieldPath'> | Omit<IFormOptionFieldReportPathDef, 'fieldPath'> : Required<T>[key] extends string[] ? Omit<IFormOptionFieldMultipleDef, 'fieldPath'> | Omit<IFormGroupsFieldDef, 'fieldPath'> : never);
|
|
101
|
+
}) & (Required<T>[key] extends FormFieldObject ? Omit<IFormEmbeddedFieldDef<Required<T>[key]>, 'fieldPath'> : Required<T>[key] extends IPaletteDef ? Omit<IFormPaletteEditorFieldDef, 'fieldPath'> : Required<T>[key] extends IColorDef ? Omit<IFormColorEditorFieldDef, 'fieldPath'> : Required<T>[key] extends TidyTableColumnSelector[] ? Omit<IFormColumnChooserMultipleFieldDef, 'fieldPath'> : Required<T>[key] extends TidyTableColumnSelector ? Omit<IFormColumnChooserSingleFieldDef, 'fieldPath'> : Required<T>[key] extends IFormEventMappingArrayFieldDefType ? Omit<IFormEventMappingArrayFieldDef, 'fieldPath'> : Required<T>[key] extends IFormEventArrayFieldDefType ? Omit<IFormEventArrayFieldDef, 'fieldPath'> : Required<T>[key] extends IFormSearchAndReplaceArrayFieldDefType ? Omit<IFormSearchAndReplaceArrayFieldDef, 'fieldPath'> : Required<T>[key] extends Hook<any> ? Omit<IFormHookFieldDef<any>, 'fieldPath'> : Required<T>[key] extends boolean ? Omit<IFormBooleanFieldDef, 'fieldPath'> : Required<T>[key] extends number ? Omit<IFormNumberFieldDef, 'fieldPath'> : Required<T>[key] extends number ? Omit<IFormMaskFieldDef, 'fieldPath'> : Required<T>[key] extends string ? Omit<IFormOptionFieldSingleDef, 'fieldPath'> | Omit<IFormStringFieldDef, 'fieldPath'> | Omit<IFormFormatterPickerFieldDef, 'fieldPath'> | Omit<IFormWidgetVariantFieldDef, 'fieldPath'> | Omit<IFormTidyTableTextExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableTextRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableHtmlRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableHtmlExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableNumericExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableNumericRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableColorRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableStringRowExprFieldDef, 'fieldPath'> | Omit<IFormTidyTableScaleRowExprFieldDef, 'fieldPath'> | Omit<IFormJsFieldDef, 'fieldPath'> | Omit<IFormJsonFieldDef, 'fieldPath'> | Omit<IFormMarkdownFieldDef, 'fieldPath'> | Omit<IFormOptionFieldReportPathDef, 'fieldPath'> : Required<T>[key] extends string[] ? Omit<IFormOptionFieldMultipleDef, 'fieldPath'> | Omit<IFormGroupsFieldDef, 'fieldPath'> : never);
|
|
102
102
|
};
|
|
103
103
|
export declare enum IFormFieldGroupTypes {
|
|
104
104
|
Selection = "selection",
|
|
@@ -261,7 +261,11 @@ export type FormFieldType =
|
|
|
261
261
|
/**
|
|
262
262
|
* @see IFormGranularitySelectionFieldDef
|
|
263
263
|
*/
|
|
264
|
-
"granularityChooser"
|
|
264
|
+
"granularityChooser" |
|
|
265
|
+
/**
|
|
266
|
+
* @see IFormSearchAndReplaceArrayFieldDefType
|
|
267
|
+
*/
|
|
268
|
+
"searchAndReplaceArray";
|
|
265
269
|
export type FormFieldTidyTableExprType = "tidyTableHtmlExpr" | "tidyTableHtmlRowExpr" | "tidyTableNumericExpr" | "tidyTableNumericRowExpr" | "tidyTableScaleRowExpr" | "tidyTableTextExpr" | "tidyTableTextRowExpr" | "tidyTableStringRowExpr" | "tidyTableColorRowExpr";
|
|
266
270
|
export declare function isTidyTableExpr(type: FormFieldType): type is FormFieldTidyTableExprType;
|
|
267
271
|
export declare function isTidyTableExprTable(type: FormFieldType): boolean;
|
|
@@ -452,6 +456,16 @@ export type IFormEventMappingArrayFieldDefType = {
|
|
|
452
456
|
export interface IFormEventMappingArrayFieldDef extends IFormFieldDef<IFormEventMappingArrayFieldDefType> {
|
|
453
457
|
fieldType: "eventMappingArray";
|
|
454
458
|
}
|
|
459
|
+
/**
|
|
460
|
+
* @see FormFieldDef
|
|
461
|
+
*/
|
|
462
|
+
export type IFormSearchAndReplaceArrayFieldDefType = {
|
|
463
|
+
from: string;
|
|
464
|
+
to: string;
|
|
465
|
+
}[];
|
|
466
|
+
export interface IFormSearchAndReplaceArrayFieldDef extends IFormFieldDef<IFormSearchAndReplaceArrayFieldDefType> {
|
|
467
|
+
fieldType: "searchAndReplaceArray";
|
|
468
|
+
}
|
|
455
469
|
/**
|
|
456
470
|
* @see FormFieldDef
|
|
457
471
|
*/
|
|
@@ -669,6 +683,10 @@ export interface IFormTidyTableHtmlExprFieldDef extends IFormFieldDef<string> {
|
|
|
669
683
|
* The default selected columns come from the second dependsOn option.
|
|
670
684
|
*/
|
|
671
685
|
useSelectedColumns?: boolean;
|
|
686
|
+
/**
|
|
687
|
+
* If true, the user can use $value.totalSelectedOrTotal$ to get the total of the selected for this field.
|
|
688
|
+
*/
|
|
689
|
+
allowTotalOfSelection?: boolean;
|
|
672
690
|
};
|
|
673
691
|
}
|
|
674
692
|
/**
|
|
@@ -898,5 +916,5 @@ export interface IFormWidgetVariantFieldDef extends IFormFieldDef<string> {
|
|
|
898
916
|
export interface IFormFormatterPickerFieldDef extends IFormFieldDef<string> {
|
|
899
917
|
fieldType: "formatterPicker";
|
|
900
918
|
}
|
|
901
|
-
export type FormFieldDef = IFormAutocompleteFieldDef<any> | IFormBooleanFieldDef | IFormColorEditorFieldDef | IFormColumnChooserFieldDef | IFormColumnSelectionFieldDef | IFormConstantsFieldDef | IFormEventArrayFieldDef | IFormEventMappingArrayFieldDef | IFormFileUploaderFieldDef | IFormGroupsFieldDef | IFormJsFieldDef | IFormMarkdownFieldDef | IFormMaskFieldDef | IFormMdxFieldDef | IFormNumberFieldDef | IFormOptionFieldDef | IFormOptionFieldSingleDef | IFormOptionFieldMultipleDef | IFormPaletteEditorFieldDef | IFormReportPathFieldDef | IFormReportPermaLinkFieldDef | IFormStringFieldDef | IFormTidyTableHtmlExprFieldDef | IFormTidyTableHtmlRowExprFieldDef | IFormTidyTableNumericExprFieldDef | IFormTidyTableNumericRowExprFieldDef | IFormTidyTableStringRowExprFieldDef | IFormTidyTableColorRowExprFieldDef | IFormTidyTableScaleRowExprFieldDef | IFormTidyTableTextExprFieldDef | IFormTidyTableTextRowExprFieldDef | IFormWidgetVariantFieldDef | IFormFormatterPickerFieldDef | IFormGranularitySelectionFieldDef;
|
|
919
|
+
export type FormFieldDef = IFormAutocompleteFieldDef<any> | IFormBooleanFieldDef | IFormColorEditorFieldDef | IFormColumnChooserFieldDef | IFormColumnSelectionFieldDef | IFormConstantsFieldDef | IFormEventArrayFieldDef | IFormEventMappingArrayFieldDef | IFormFileUploaderFieldDef | IFormGroupsFieldDef | IFormJsFieldDef | IFormMarkdownFieldDef | IFormMaskFieldDef | IFormMdxFieldDef | IFormNumberFieldDef | IFormOptionFieldDef | IFormOptionFieldSingleDef | IFormOptionFieldMultipleDef | IFormPaletteEditorFieldDef | IFormReportPathFieldDef | IFormReportPermaLinkFieldDef | IFormStringFieldDef | IFormTidyTableHtmlExprFieldDef | IFormTidyTableHtmlRowExprFieldDef | IFormTidyTableNumericExprFieldDef | IFormTidyTableNumericRowExprFieldDef | IFormTidyTableStringRowExprFieldDef | IFormTidyTableColorRowExprFieldDef | IFormTidyTableScaleRowExprFieldDef | IFormTidyTableTextExprFieldDef | IFormTidyTableTextRowExprFieldDef | IFormWidgetVariantFieldDef | IFormFormatterPickerFieldDef | IFormGranularitySelectionFieldDef | IFormSearchAndReplaceArrayFieldDef;
|
|
902
920
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicTemplateForm.js","sourceRoot":"","sources":["../src/PublicTemplateForm.ts"],"names":[],"mappings":";;;AAkBA,SAAgB,oBAAoB,CAAC,KAAyB;IAC1D,OAAO,KAAK,CAAC,KAAK,KAAK,oBAAoB,CAAC,SAAS,CAAC;AAC1D,CAAC;AAFD,oDAEC;
|
|
1
|
+
{"version":3,"file":"PublicTemplateForm.js","sourceRoot":"","sources":["../src/PublicTemplateForm.ts"],"names":[],"mappings":";;;AAkBA,SAAgB,oBAAoB,CAAC,KAAyB;IAC1D,OAAO,KAAK,CAAC,KAAK,KAAK,oBAAoB,CAAC,SAAS,CAAC;AAC1D,CAAC;AAFD,oDAEC;AAwJD,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC5B,+CAAuB,CAAA;IACvB,yEAAiD,CAAA;IACjD,sDAA8B,CAAA;AAClC,CAAC,EAJW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAI/B;AAoLD,SAAgB,eAAe,CAAC,IAAmB;IAC/C,OAAO,IAAI,KAAK,mBAAmB;WAC5B,IAAI,KAAK,sBAAsB;WAC/B,IAAI,KAAK,mBAAmB;WAC5B,IAAI,KAAK,sBAAsB;WAC/B,IAAI,KAAK,sBAAsB;WAC/B,IAAI,KAAK,yBAAyB;WAClC,IAAI,KAAK,wBAAwB;WACjC,IAAI,KAAK,uBAAuB;WAChC,IAAI,KAAK,uBAAuB,CAClC;AACT,CAAC;AAXD,0CAWC;AAED,SAAgB,oBAAoB,CAAC,IAAmB;IACpD,OAAO,IAAI,KAAK,mBAAmB;WAC5B,IAAI,KAAK,mBAAmB;WAC5B,IAAI,KAAK,sBAAsB,CACjC;AACT,CAAC;AALD,oDAKC;AAED,SAAgB,kBAAkB,CAAC,IAAmB;IAClD,OAAO,IAAI,KAAK,sBAAsB;WAC/B,IAAI,KAAK,sBAAsB;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