@sisense/sdk-ui 2.30.0 → 2.31.0
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/dist/ai.cjs +2 -2
- package/dist/ai.js +6 -6
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +1841 -1321
- package/dist/analytics-composer.cjs +2 -2
- package/dist/analytics-composer.js +8 -8
- package/dist/apply-styled-options-to-query-BddNnNsW.js +7028 -0
- package/dist/apply-styled-options-to-query-BrP6xVFh.cjs +1 -0
- package/dist/index-BcggtLDg.js +847 -0
- package/dist/index-DhUTJSni.cjs +1 -0
- package/dist/index.cjs +443 -417
- package/dist/index.js +23357 -23604
- package/dist/index.umd.js +818 -716
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header/constants.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/{dashboard-header-config.d.ts → dashboard-header/dashboard-header-config.d.ts} +17 -22
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/{dashboard-header-targets.d.ts → dashboard-header/dashboard-header-targets.d.ts} +0 -4
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/{dashboard-header-title.d.ts → dashboard-header/dashboard-header-title.d.ts} +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/{dashboard-header.d.ts → dashboard-header/dashboard-header.d.ts} +1 -4
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/toolbar/edit-toggle.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/toolbar/filter-toggle.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-helpers.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-module/types.d.ts +9 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-edit-mode-with-history.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-updates-persistence.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/update-types.d.ts +4 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +30 -13
- package/dist/packages/sdk-ui/src/domains/dashboarding/utils.d.ts +29 -6
- package/dist/packages/sdk-ui/src/domains/filters/components/filters-panel/filters-panel.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-widget-narrative-from-widget-props.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/narrative/core/{widget-narrative-options.d.ts → widget-narrative-config.d.ts} +12 -12
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +8 -8
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/shared/header/header-item-cell.d.ts +25 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/header-item-size.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/shared/header/header-items-renderer.d.ts +6 -2
- package/dist/packages/sdk-ui/src/domains/shared/header/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/helpers/calc-column-widths.d.ts +19 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/styles/style-constants.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/types.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +0 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/chart-options-service.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-levels.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-series.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/types.d.ts +2 -10
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-excel-download.d.ts +1 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/use-custom-widget-excel-download.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/types.d.ts +2 -9
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-pivot-widget-excel-download.d.ts +1 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget/types.d.ts +25 -9
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-dashboard-filters.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/categorical-labels-style.d.ts +94 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/series-label-affix-style.d.ts +59 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +13 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/widget-narrative-style.d.ts +8 -8
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +72 -1
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model.d.ts +5 -6
- package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +11 -0
- package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +1 -3
- package/dist/packages/sdk-ui/src/infra/app/types.d.ts +4 -5
- package/dist/packages/sdk-ui/src/infra/decorators/component-decorators/with-tracking/use-track-component-init.d.ts +8 -0
- package/dist/packages/sdk-ui/src/infra/modules/types.d.ts +24 -5
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +11 -5
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +2 -2
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/custom-formula/validate-custom-formula.d.ts +11 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/datetime-filter-processors.d.ts +6 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/measure-processors.d.ts +16 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/schema-index.d.ts +4 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/validation/datetime-member-validation.d.ts +2 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/validation/datetime-range-validation.d.ts +2 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/validation/datetime-relative-validation.d.ts +1 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/validation/datetime-validation-utils.d.ts +40 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/validation/flatten-filters.d.ts +5 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/validation/normalize-member-for-granularity.d.ts +5 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/validation/query-datetime-validation.d.ts +7 -0
- package/dist/packages/sdk-ui/src/modules/analytics-composer/types.d.ts +16 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/widget/to-widget-code.d.ts +1 -1
- package/dist/packages/sdk-ui/src/props.d.ts +1 -2
- package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +1 -5
- package/dist/packages/sdk-ui/src/public-api/beta.d.ts +3 -1
- package/dist/packages/sdk-ui/src/public-api/public.d.ts +4 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +0 -1
- package/dist/packages/sdk-ui/src/shared/components/alert/alert.d.ts +1 -50
- package/dist/packages/sdk-ui/src/shared/components/alert/index.d.ts +2 -2
- package/dist/packages/sdk-ui/src/shared/components/no-results-overlay/images/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/shared/components/quota-notification/quota-notification.d.ts +3 -10
- package/dist/packages/sdk-ui/src/shared/components/radio.d.ts +1 -0
- package/dist/packages/sdk-ui/src/shared/hooks/use-synced-state.d.ts +6 -7
- package/dist/packages/sdk-ui/src/shared/icons/warning-icon.d.ts +2 -3
- package/dist/packages/sdk-ui/src/shared/icons/x-circle-icon.d.ts +2 -3
- package/dist/packages/sdk-ui/src/shared/utils/color/color-interpolation.d.ts +1 -1
- package/dist/packages/sdk-ui/src/shared/utils/color/colorjs.d.ts +36 -0
- package/dist/packages/sdk-ui/src/shared/utils/gradient.d.ts +3 -2
- package/dist/packages/sdk-ui/src/types.d.ts +30 -19
- package/dist/{quota-notification-DqabeDbO.js → quota-notification-BMxiL8zu.js} +12530 -12922
- package/dist/quota-notification-CsGmQ05h.cjs +750 -0
- package/dist/{types-DecTaxy7.js → types-BB6n10Af.js} +1 -1
- package/dist/{types-DSNnndG6.cjs → types-CMUXHDie.cjs} +1 -1
- package/dist/{utils-L-HO2pCd.js → utils-C39pRlFD.js} +14643 -14371
- package/dist/utils-CL2eytnK.cjs +180 -0
- package/dist/{widget-composer-CyWQaInf.cjs → widget-composer-DDulWu8l.cjs} +85 -10
- package/dist/{widget-composer-u6NMLm1C.js → widget-composer-DrfnZQa0.js} +350 -259
- package/package.json +13 -16
- package/dist/apply-styled-options-to-query-BK1NnV4P.js +0 -6453
- package/dist/apply-styled-options-to-query-Dl8vVNxo.cjs +0 -1
- package/dist/packages/sdk-ui/src/shared/hooks/use-quota-warning-dismissed.d.ts +0 -8
- package/dist/quota-notification-gYE6PTWA.cjs +0 -750
- package/dist/utils-Cpeyj9TN.cjs +0 -179
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var oe = Object.defineProperty, le = Object.defineProperties;
|
|
2
|
+
var de = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var I = Object.getOwnPropertySymbols;
|
|
4
|
+
var z = Object.prototype.hasOwnProperty, Y = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var U = (e, t, r) => t in e ? oe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, o = (e, t) => {
|
|
6
6
|
for (var r in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var r of
|
|
10
|
-
|
|
7
|
+
z.call(t, r) && U(e, r, t[r]);
|
|
8
|
+
if (I)
|
|
9
|
+
for (var r of I(t))
|
|
10
|
+
Y.call(t, r) && U(e, r, t[r]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, m = (e, t) => le(e, de(t));
|
|
13
|
+
var J = (e, t) => {
|
|
14
14
|
var r = {};
|
|
15
15
|
for (var i in e)
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var i of
|
|
19
|
-
t.indexOf(i) < 0 &&
|
|
16
|
+
z.call(e, i) && t.indexOf(i) < 0 && (r[i] = e[i]);
|
|
17
|
+
if (e != null && I)
|
|
18
|
+
for (var i of I(e))
|
|
19
|
+
t.indexOf(i) < 0 && Y.call(e, i) && (r[i] = e[i]);
|
|
20
20
|
return r;
|
|
21
21
|
};
|
|
22
|
-
import { J as
|
|
23
|
-
import { C as
|
|
24
|
-
import { T, A as
|
|
22
|
+
import { J as ce, c as X, i as ue } from "./types-BB6n10Af.js";
|
|
23
|
+
import { C as pe, i as me, a as ge, b as fe, n as P, m as W, g as K } from "./utils-C39pRlFD.js";
|
|
24
|
+
import { T as v, A as ye, n as Se, e as ee, f as Oe, h as l, m as he, i as x, D as be, j, k as te, l as Te, o as ve, p as xe, q as Ee } from "./apply-styled-options-to-query-BddNnNsW.js";
|
|
25
25
|
function De(e) {
|
|
26
26
|
return e.replace(/\s+/g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function kt(e) {
|
|
29
29
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Pt(e) {
|
|
32
32
|
const t = /\[(.+?)\s\(Calendar\)\]/;
|
|
33
33
|
return e.replace(t, "[$1]").trim();
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function $t(e) {
|
|
36
36
|
if (e)
|
|
37
37
|
if (e.metadata) {
|
|
38
38
|
if (!e.model)
|
|
39
|
-
throw new
|
|
40
|
-
} else throw new
|
|
41
|
-
else throw new
|
|
39
|
+
throw new v("errors.missingModelTitle");
|
|
40
|
+
} else throw new v("errors.missingMetadata");
|
|
41
|
+
else throw new v("errors.emptyModel");
|
|
42
42
|
return e;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ce(e) {
|
|
45
45
|
return !e || !e.jaql.datasource.title || !e.jaql.metadata.length;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
if (![...
|
|
49
|
-
throw new
|
|
47
|
+
function we(e) {
|
|
48
|
+
if (![...ye, "pivot", "pivot2"].includes(e))
|
|
49
|
+
throw new v("errors.chartTypeNotSupported", { chartType: e });
|
|
50
50
|
}
|
|
51
51
|
function Le(e) {
|
|
52
52
|
return "widgetType" in e && e.widgetType === "pivot";
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function h(e) {
|
|
55
55
|
var t;
|
|
56
56
|
return "column" in e && ((t = e.column) == null ? void 0 : t.expression) && /\(.*\)/.test(e.column.expression);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
const t = "measures" in e &&
|
|
60
|
-
return Le(e) ? "values" in e.dataOptions &&
|
|
58
|
+
function V(e) {
|
|
59
|
+
const t = "measures" in e && g(e.measures) || "values" in e && g(e.values);
|
|
60
|
+
return Le(e) ? "values" in e.dataOptions && g(e.dataOptions.values) : "chartType" in e ? e.chartType === "indicator" ? "value" in e.dataOptions && g(e.dataOptions.value) || "secondary" in e.dataOptions && g(e.dataOptions.secondary) : e.chartType === "table" ? !("columns" in e.dataOptions) || !g(e.dataOptions.columns) ? !1 : e.dataOptions.columns.some((i) => h(i)) : e.chartType === "boxplot" ? !1 : e.chartType === "scatter" ? "x" in e.dataOptions && e.dataOptions.x !== void 0 && h(e.dataOptions.x) || "y" in e.dataOptions && e.dataOptions.y !== void 0 && h(e.dataOptions.y) || "size" in e.dataOptions && e.dataOptions.size !== void 0 : e.chartType === "scattermap" ? "colorBy" in e.dataOptions && e.dataOptions.colorBy !== void 0 && h(e.dataOptions.colorBy) || "details" in e.dataOptions && e.dataOptions.details !== void 0 && h(e.dataOptions.details) || "size" in e.dataOptions && e.dataOptions.size !== void 0 && h(e.dataOptions.size) : e.chartType === "areamap" ? "geo" in e.dataOptions && g(e.dataOptions.geo) && "color" in e.dataOptions && g(e.dataOptions.color) : "value" in e.dataOptions && g(e.dataOptions.value) : t;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function g(e) {
|
|
63
63
|
return Array.isArray(e) && e.length > 0;
|
|
64
64
|
}
|
|
65
65
|
function Ae(e) {
|
|
@@ -82,12 +82,12 @@ function Ie(e) {
|
|
|
82
82
|
return e;
|
|
83
83
|
const r = {};
|
|
84
84
|
for (const [i, a] of Object.entries(e)) {
|
|
85
|
-
const
|
|
86
|
-
r[
|
|
85
|
+
const s = t(i) ? i : `"${i}"`;
|
|
86
|
+
r[s] = a;
|
|
87
87
|
}
|
|
88
88
|
return r;
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const We = {
|
|
91
91
|
react: {
|
|
92
92
|
baseChartTmpl: `import { {{componentString}} } from '@sisense/sdk-ui';
|
|
93
93
|
{{extraImportsString}}
|
|
@@ -242,6 +242,27 @@ export default function CodeExample() {
|
|
|
242
242
|
filters: {{filtersString}},
|
|
243
243
|
styleOptions: {{styleOptionsString}},
|
|
244
244
|
}`,
|
|
245
|
+
customWidgetTmpl: `
|
|
246
|
+
/* Please make sure "{{customWidgetTypeString}}" is registered as a plugin in your application. */
|
|
247
|
+
import { Widget } from '@sisense/sdk-ui';
|
|
248
|
+
{{extraImportsString}}
|
|
249
|
+
import * as DM from './{{dataSourceString}}'; // generated with @sisense/sdk-cli
|
|
250
|
+
|
|
251
|
+
export default function CodeExample() {
|
|
252
|
+
return (
|
|
253
|
+
<Widget
|
|
254
|
+
id="{{customWidgetTypeString}}-1"
|
|
255
|
+
widgetType="custom"
|
|
256
|
+
customWidgetType="{{customWidgetTypeString}}"
|
|
257
|
+
title={'{{titleString}}'}
|
|
258
|
+
dataSource={DM.DataSource}
|
|
259
|
+
dataOptions={ {{dataOptionsString}} }
|
|
260
|
+
filters={ {{filtersString}} }
|
|
261
|
+
styleOptions={ {{styleOptionsString}} }
|
|
262
|
+
customOptions={ {{customOptionsString}} }
|
|
263
|
+
/>
|
|
264
|
+
);
|
|
265
|
+
}`,
|
|
245
266
|
dashboardByIdTmpl: `import { DashboardById } from '@sisense/sdk-ui';
|
|
246
267
|
|
|
247
268
|
const CodeExample = () => {
|
|
@@ -427,6 +448,37 @@ export class CodeExample {
|
|
|
427
448
|
filters: {{filtersString}},
|
|
428
449
|
styleOptions: {{styleOptionsString}},
|
|
429
450
|
}`,
|
|
451
|
+
customWidgetTmpl: `/* Please make sure "{{customWidgetTypeString}}" is registered as a plugin in your application. */
|
|
452
|
+
import { Component } from '@angular/core';
|
|
453
|
+
import { SdkUiModule, type GenericDataOptions } from '@sisense/sdk-ui-angular';
|
|
454
|
+
{{extraImportsString}}
|
|
455
|
+
import * as DM from './{{dataSourceString}}'; // generated with @sisense/sdk-cli
|
|
456
|
+
|
|
457
|
+
@Component({
|
|
458
|
+
selector: 'code-example',
|
|
459
|
+
imports: [SdkUiModule],
|
|
460
|
+
template: \`
|
|
461
|
+
<csdk-widget
|
|
462
|
+
id="{{customWidgetTypeString}}-1"
|
|
463
|
+
widgetType="custom"
|
|
464
|
+
[customWidgetType]="customWidgetType"
|
|
465
|
+
[title]="'{{titleString}}'"
|
|
466
|
+
[dataSource]="DM.DataSource"
|
|
467
|
+
[dataOptions]="dataOptions"
|
|
468
|
+
[filters]="filters"
|
|
469
|
+
[styleOptions]="styleOptions"
|
|
470
|
+
[customOptions]="customOptions"
|
|
471
|
+
/>
|
|
472
|
+
\`
|
|
473
|
+
})
|
|
474
|
+
export class CodeExample {
|
|
475
|
+
DM = DM;
|
|
476
|
+
customWidgetType = "{{customWidgetTypeString}}";
|
|
477
|
+
dataOptions: GenericDataOptions = {{dataOptionsString}};
|
|
478
|
+
filters = {{filtersString}};
|
|
479
|
+
styleOptions = {{styleOptionsString}};
|
|
480
|
+
customOptions = {{customOptionsString}};
|
|
481
|
+
}`,
|
|
430
482
|
dashboardByIdTmpl: `import { Component } from '@angular/core';
|
|
431
483
|
|
|
432
484
|
@Component({
|
|
@@ -538,6 +590,32 @@ const { data, isLoading, isError, error } = useExecuteQuery(queryProps);
|
|
|
538
590
|
filters: {{filtersString}},
|
|
539
591
|
styleOptions: {{styleOptionsString}},
|
|
540
592
|
}`,
|
|
593
|
+
customWidgetTmpl: `<!-- Please make sure "{{customWidgetTypeString}}" is registered as a plugin in your application. -->
|
|
594
|
+
<script setup lang="ts">
|
|
595
|
+
import { ref } from 'vue';
|
|
596
|
+
import { Widget } from '@sisense/sdk-ui-vue';
|
|
597
|
+
{{extraImportsString}}
|
|
598
|
+
import * as DM from './{{dataSourceString}}'; // generated with @sisense/sdk-cli
|
|
599
|
+
|
|
600
|
+
const dataOptions = ref({{dataOptionsString}});
|
|
601
|
+
const filters = ref({{filtersString}});
|
|
602
|
+
const styleOptions = ref({{styleOptionsString}});
|
|
603
|
+
const customOptions = ref({{customOptionsString}});
|
|
604
|
+
<\/script>
|
|
605
|
+
|
|
606
|
+
<template>
|
|
607
|
+
<Widget
|
|
608
|
+
id="{{customWidgetTypeString}}-1"
|
|
609
|
+
widgetType="custom"
|
|
610
|
+
customWidgetType="{{customWidgetTypeString}}"
|
|
611
|
+
title="{{titleString}}"
|
|
612
|
+
:dataSource="DM.DataSource"
|
|
613
|
+
:dataOptions="dataOptions"
|
|
614
|
+
:filters="filters"
|
|
615
|
+
:styleOptions="styleOptions"
|
|
616
|
+
:customOptions="customOptions"
|
|
617
|
+
/>
|
|
618
|
+
</template>`,
|
|
541
619
|
dashboardByIdTmpl: `<script setup lang="ts">
|
|
542
620
|
import { DashboardById } from '@sisense/sdk-ui-vue';
|
|
543
621
|
|
|
@@ -550,62 +628,62 @@ const config = {{configString}};
|
|
|
550
628
|
dashboardTmpl: "/** COMING SOON */"
|
|
551
629
|
}
|
|
552
630
|
};
|
|
553
|
-
function
|
|
554
|
-
return e.replace(/\[\[([^\]]+)\]\]/g, (t, r) =>
|
|
631
|
+
function _e(e) {
|
|
632
|
+
return e.replace(/\[\[([^\]]+)\]\]/g, (t, r) => Se(r));
|
|
555
633
|
}
|
|
556
|
-
const
|
|
634
|
+
const re = (e, t) => We[t][e].replace(
|
|
557
635
|
/{{(.*?)Tmpl}}/g,
|
|
558
|
-
(i, a) =>
|
|
559
|
-
), Me = (e, t) => e.replace(/{{(.*?)}}/g, (r, i) => i in t ? t[i] : (console.warn(`Placeholder ${i} not found in data`), r)),
|
|
560
|
-
const i =
|
|
561
|
-
return Ae(
|
|
562
|
-
},
|
|
636
|
+
(i, a) => re(`${a}Tmpl`, t)
|
|
637
|
+
), Me = (e, t) => e.replace(/{{(.*?)}}/g, (r, i) => i in t ? t[i] : (console.warn(`Placeholder ${i} not found in data`), r)), M = (e, t, r = "react") => {
|
|
638
|
+
const i = re(e, r), a = Me(i, t);
|
|
639
|
+
return Ae(_e(a));
|
|
640
|
+
}, ke = () => Object.values(Oe).map((t) => ee.aggregationToJAQL(t)).join("|"), ie = (e) => {
|
|
563
641
|
const { formula: t, context: r, filter: i } = e;
|
|
564
642
|
if (!r || !t)
|
|
565
643
|
return e;
|
|
566
644
|
const a = Object.keys(r);
|
|
567
645
|
if (a.length !== 1)
|
|
568
646
|
return e;
|
|
569
|
-
const
|
|
570
|
-
if (typeof
|
|
647
|
+
const s = a[0];
|
|
648
|
+
if (typeof s != "string")
|
|
571
649
|
return e;
|
|
572
|
-
const
|
|
573
|
-
if (f && t.includes(
|
|
650
|
+
const n = r[`${s}`], p = ke(), d = new RegExp(`^\\s*(${p})\\(\\[\\w+\\]\\)$`), f = t.match(d);
|
|
651
|
+
if (f && t.includes(s)) {
|
|
574
652
|
const c = f[1];
|
|
575
653
|
return o({
|
|
576
|
-
dim:
|
|
577
|
-
table:
|
|
578
|
-
column:
|
|
579
|
-
datatype:
|
|
654
|
+
dim: n.dim,
|
|
655
|
+
table: n.table,
|
|
656
|
+
column: n.column,
|
|
657
|
+
datatype: n.datatype,
|
|
580
658
|
agg: c,
|
|
581
659
|
title: e.title
|
|
582
660
|
}, i ? { filter: o({}, i) } : {});
|
|
583
661
|
}
|
|
584
662
|
return e;
|
|
585
|
-
},
|
|
663
|
+
}, k = (e) => {
|
|
586
664
|
let t = e;
|
|
587
|
-
if ("formula" in e && (t =
|
|
665
|
+
if ("formula" in e && (t = ie(e)), "context" in t) {
|
|
588
666
|
const r = o({}, t.context);
|
|
589
667
|
Object.keys(r).forEach((i) => {
|
|
590
|
-
r[`${i}`] =
|
|
668
|
+
r[`${i}`] = k(r[`${i}`]);
|
|
591
669
|
}), t.context = r;
|
|
592
670
|
}
|
|
593
671
|
return t;
|
|
594
|
-
},
|
|
672
|
+
}, Pe = (e) => {
|
|
595
673
|
var i;
|
|
596
674
|
const t = e;
|
|
597
675
|
if (t.panel !== "scope") return t;
|
|
598
676
|
const { jaql: r } = t;
|
|
599
|
-
return (i = r.filter) != null && i.by && (r.filter.by =
|
|
677
|
+
return (i = r.filter) != null && i.by && (r.filter.by = ie(r.filter.by)), m(o({}, t), { jaql: r });
|
|
600
678
|
}, $e = (e) => {
|
|
601
679
|
let t = e;
|
|
602
|
-
t =
|
|
680
|
+
t = Pe(t);
|
|
603
681
|
const { jaql: r, measure: i, by: a } = t;
|
|
604
|
-
return o(o(
|
|
605
|
-
jaql:
|
|
606
|
-
}), a ? { by:
|
|
607
|
-
},
|
|
608
|
-
function
|
|
682
|
+
return o(o(m(o({}, t), {
|
|
683
|
+
jaql: k(r)
|
|
684
|
+
}), a ? { by: k(a) } : {}), i ? { measure: k(i) } : {});
|
|
685
|
+
}, O = 6;
|
|
686
|
+
function Fe(e) {
|
|
609
687
|
switch (e) {
|
|
610
688
|
case "line":
|
|
611
689
|
case "area":
|
|
@@ -640,7 +718,7 @@ function Ne(e) {
|
|
|
640
718
|
return {};
|
|
641
719
|
}
|
|
642
720
|
}
|
|
643
|
-
const
|
|
721
|
+
const Ne = {
|
|
644
722
|
subtype: "indicator/numeric",
|
|
645
723
|
numericSubtype: "numericSimple",
|
|
646
724
|
skin: "vertical",
|
|
@@ -771,8 +849,8 @@ const ke = {
|
|
|
771
849
|
categoriesCapacity: 200
|
|
772
850
|
}
|
|
773
851
|
};
|
|
774
|
-
function
|
|
775
|
-
return
|
|
852
|
+
function T(e) {
|
|
853
|
+
return he({}, qe, e);
|
|
776
854
|
}
|
|
777
855
|
const ze = {
|
|
778
856
|
subtype: "pie/classic",
|
|
@@ -839,7 +917,7 @@ const ze = {
|
|
|
839
917
|
mode: "value"
|
|
840
918
|
}
|
|
841
919
|
}, Ve = {
|
|
842
|
-
subtype:
|
|
920
|
+
subtype: pe.SUBTYPE,
|
|
843
921
|
viewType: "month",
|
|
844
922
|
startOfWeek: "sunday",
|
|
845
923
|
cellLabels: {
|
|
@@ -864,7 +942,7 @@ const ze = {
|
|
|
864
942
|
tooltip: {
|
|
865
943
|
mode: "value"
|
|
866
944
|
}
|
|
867
|
-
},
|
|
945
|
+
}, Ge = {
|
|
868
946
|
legend: {
|
|
869
947
|
enabled: !0,
|
|
870
948
|
position: "bottom"
|
|
@@ -916,7 +994,7 @@ const ze = {
|
|
|
916
994
|
scatterBubbleMinSize: 10,
|
|
917
995
|
scatterBubbleMaxSize: 10
|
|
918
996
|
}
|
|
919
|
-
},
|
|
997
|
+
}, Ze = {
|
|
920
998
|
header: {
|
|
921
999
|
color: {
|
|
922
1000
|
enabled: !1
|
|
@@ -999,17 +1077,17 @@ const ze = {
|
|
|
999
1077
|
function rt(e) {
|
|
1000
1078
|
switch (e) {
|
|
1001
1079
|
case "indicator":
|
|
1002
|
-
return l(
|
|
1080
|
+
return l(Ne);
|
|
1003
1081
|
case "line":
|
|
1004
|
-
return
|
|
1082
|
+
return T(Be);
|
|
1005
1083
|
case "area":
|
|
1006
|
-
return
|
|
1084
|
+
return T(Re);
|
|
1007
1085
|
case "bar":
|
|
1008
|
-
return
|
|
1086
|
+
return T(je);
|
|
1009
1087
|
case "column":
|
|
1010
|
-
return
|
|
1088
|
+
return T(Qe);
|
|
1011
1089
|
case "polar":
|
|
1012
|
-
return
|
|
1090
|
+
return T(Ue);
|
|
1013
1091
|
case "pie":
|
|
1014
1092
|
return l(ze);
|
|
1015
1093
|
case "funnel":
|
|
@@ -1021,7 +1099,7 @@ function rt(e) {
|
|
|
1021
1099
|
case "sunburst":
|
|
1022
1100
|
return l(He);
|
|
1023
1101
|
case "scatter":
|
|
1024
|
-
return l(
|
|
1102
|
+
return l(Ge);
|
|
1025
1103
|
case "scattermap":
|
|
1026
1104
|
return l(Xe);
|
|
1027
1105
|
case "areamap":
|
|
@@ -1029,7 +1107,7 @@ function rt(e) {
|
|
|
1029
1107
|
case "boxplot":
|
|
1030
1108
|
return l(tt);
|
|
1031
1109
|
case "table":
|
|
1032
|
-
return l(
|
|
1110
|
+
return l(Ze);
|
|
1033
1111
|
case "pivot":
|
|
1034
1112
|
return l(Je);
|
|
1035
1113
|
case "pivot2":
|
|
@@ -1041,102 +1119,102 @@ function rt(e) {
|
|
|
1041
1119
|
}
|
|
1042
1120
|
}
|
|
1043
1121
|
const _ = `
|
|
1044
|
-
`,
|
|
1122
|
+
`, R = "UNKNOWN", it = (e, t) => {
|
|
1045
1123
|
let r = "";
|
|
1046
1124
|
return r += `measureFactory.customFormula(
|
|
1047
|
-
`, r += " ".repeat(t), r += ` '${
|
|
1125
|
+
`, r += " ".repeat(t), r += ` '${x(e.title)}',
|
|
1048
1126
|
`, r += " ".repeat(t), r += ` '${e.formula}',
|
|
1049
1127
|
`, r += " ".repeat(t), r += ` {
|
|
1050
1128
|
`, Object.entries(e.context).forEach(([i, a]) => {
|
|
1051
|
-
const
|
|
1052
|
-
a.table ||
|
|
1053
|
-
a.column ||
|
|
1129
|
+
const s = te(
|
|
1130
|
+
a.table || R,
|
|
1131
|
+
a.column || R,
|
|
1054
1132
|
void 0,
|
|
1055
1133
|
"DM"
|
|
1056
1134
|
);
|
|
1057
|
-
r += " ".repeat(t), r += ` '${i.slice(1, -1)}': ${
|
|
1135
|
+
r += " ".repeat(t), r += ` '${i.slice(1, -1)}': ${s},
|
|
1058
1136
|
`;
|
|
1059
1137
|
}), r += " ".repeat(t), r += ` }
|
|
1060
1138
|
`, r += " ".repeat(t), r += ")", r;
|
|
1061
1139
|
}, at = (e) => {
|
|
1062
|
-
const { level: t, table: r, column: i, agg: a, title:
|
|
1063
|
-
let
|
|
1064
|
-
return r && i && (
|
|
1140
|
+
const { level: t, table: r, column: i, agg: a, title: s } = e;
|
|
1141
|
+
let n;
|
|
1142
|
+
return r && i && (n = te(r, i, t, "DM")), a && r && i && s && (n = `measureFactory.${ee.aggregationFromJAQL(
|
|
1065
1143
|
a
|
|
1066
|
-
)}(${
|
|
1067
|
-
},
|
|
1144
|
+
)}(${n}, '${x(s)}')`), n || R;
|
|
1145
|
+
}, st = (e, t) => {
|
|
1068
1146
|
const r = e.jaql(!1).jaql;
|
|
1069
1147
|
return "formula" in r ? it(r, t) : at(r);
|
|
1070
|
-
},
|
|
1148
|
+
}, u = (e, t = 0, r = !1) => {
|
|
1071
1149
|
if (!e)
|
|
1072
1150
|
return "";
|
|
1073
1151
|
if (typeof e == "string")
|
|
1074
|
-
return `'${
|
|
1075
|
-
if (e instanceof
|
|
1076
|
-
return
|
|
1077
|
-
if (e instanceof
|
|
1152
|
+
return `'${x(e)}'`;
|
|
1153
|
+
if (e instanceof ce)
|
|
1154
|
+
return st(e, t);
|
|
1155
|
+
if (e instanceof be)
|
|
1078
1156
|
return e.composeCode || "";
|
|
1079
1157
|
let i = "";
|
|
1080
|
-
return Array.isArray(e) ? i += `[${e.map((a) =>
|
|
1081
|
-
if (r && typeof a == "string" && (a = `'${
|
|
1082
|
-
i += `${a}: [${
|
|
1083
|
-
else if (typeof
|
|
1084
|
-
const
|
|
1085
|
-
i += `${a}: ${
|
|
1086
|
-
} else ["number", "boolean", "undefined"].includes(typeof
|
|
1158
|
+
return Array.isArray(e) ? i += `[${e.map((a) => u(a, t + 2))}${e.length ? _ + " ".repeat(t + 2) : ""}]` : (i += `{${_}`, Object.entries(e).forEach(([a, s]) => {
|
|
1159
|
+
if (r && typeof a == "string" && (a = `'${x(a)}'`), i += " ".repeat(t + 2), Array.isArray(s))
|
|
1160
|
+
i += `${a}: [${s.map((n) => u(n, t + 4, r))}${s.length ? _ + " ".repeat(t + 2) : ""}]`;
|
|
1161
|
+
else if (typeof s == "object" && s !== null) {
|
|
1162
|
+
const n = Array.isArray(s) ? s : Ie(s);
|
|
1163
|
+
i += `${a}: ${u(n, t + 2, r)}`;
|
|
1164
|
+
} else ["number", "boolean", "undefined"].includes(typeof s) || s === null ? i += `${a}: ${s}` : typeof s == "string" ? i += `${a}: '${x(s)}'` : i += `${a}: ${s}`;
|
|
1087
1165
|
i += `,${_}`;
|
|
1088
1166
|
}), i += " ".repeat(t), i += "}"), i;
|
|
1089
1167
|
};
|
|
1090
|
-
function
|
|
1168
|
+
function Q(e, t) {
|
|
1091
1169
|
if (t === void 0 || t && typeof t == "object" && !Array.isArray(t) && Object.keys(t).length === 0)
|
|
1092
1170
|
return e;
|
|
1093
|
-
if (!
|
|
1171
|
+
if (!j(e, t)) {
|
|
1094
1172
|
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
1095
1173
|
const r = {};
|
|
1096
1174
|
for (const i of Object.keys(e)) {
|
|
1097
|
-
const a =
|
|
1098
|
-
(a !== void 0 || !
|
|
1175
|
+
const a = Q(e[i], t == null ? void 0 : t[i]), s = t && Object.prototype.hasOwnProperty.call(t, i), n = s ? t[i] : void 0;
|
|
1176
|
+
(a !== void 0 || !s || e[i] === void 0 && n !== void 0) && (r[i] = a);
|
|
1099
1177
|
}
|
|
1100
1178
|
return Object.keys(r).length ? r : void 0;
|
|
1101
1179
|
}
|
|
1102
1180
|
return e;
|
|
1103
1181
|
}
|
|
1104
1182
|
}
|
|
1105
|
-
function
|
|
1183
|
+
function H(e, t) {
|
|
1106
1184
|
if (!e || Object.keys(e).length === 0)
|
|
1107
1185
|
return {};
|
|
1108
1186
|
const r = rt(t);
|
|
1109
|
-
if (
|
|
1187
|
+
if (j(e, r))
|
|
1110
1188
|
return {};
|
|
1111
|
-
const i =
|
|
1189
|
+
const i = Q(e, r);
|
|
1112
1190
|
return i != null ? i : {};
|
|
1113
1191
|
}
|
|
1114
|
-
function
|
|
1115
|
-
const r =
|
|
1116
|
-
if (
|
|
1192
|
+
function G(e, t) {
|
|
1193
|
+
const r = Fe(t);
|
|
1194
|
+
if (j(e, r))
|
|
1117
1195
|
return e;
|
|
1118
|
-
const i =
|
|
1196
|
+
const i = Q(e, r);
|
|
1119
1197
|
return i != null ? i : {};
|
|
1120
1198
|
}
|
|
1121
|
-
function
|
|
1122
|
-
return
|
|
1199
|
+
function nt(e) {
|
|
1200
|
+
return u(e, O);
|
|
1123
1201
|
}
|
|
1124
|
-
function
|
|
1202
|
+
function N(e, t = "data-source-placeholder") {
|
|
1125
1203
|
if (!e)
|
|
1126
1204
|
return t;
|
|
1127
1205
|
const r = typeof e == "object" && "title" in e ? e.title : e;
|
|
1128
1206
|
return De(r);
|
|
1129
1207
|
}
|
|
1130
|
-
function
|
|
1208
|
+
function q(e, t = !0) {
|
|
1131
1209
|
const r = [];
|
|
1132
|
-
return t && r.push("measureFactory"),
|
|
1210
|
+
return t && r.push("measureFactory"), g(e) && r.push("filterFactory"), r.length > 0 ? `import { ${r.join(", ")} } from '@sisense/sdk-data';` : "";
|
|
1133
1211
|
}
|
|
1134
1212
|
const Z = `
|
|
1135
1213
|
`, ot = (e, t) => {
|
|
1136
1214
|
if (e.composeCode)
|
|
1137
1215
|
return `${Z}${" ".repeat(t)}${e.composeCode}`;
|
|
1138
1216
|
const r = e.jaql().jaql;
|
|
1139
|
-
return `${Z}${" ".repeat(t)}filterFactory.customFilter(${
|
|
1217
|
+
return `${Z}${" ".repeat(t)}filterFactory.customFilter(${u(
|
|
1140
1218
|
r,
|
|
1141
1219
|
t,
|
|
1142
1220
|
!0
|
|
@@ -1147,83 +1225,96 @@ const Z = `
|
|
|
1147
1225
|
let r = "";
|
|
1148
1226
|
return r += `[${e.map((i) => ot(i, t + 2))}${e.length ? `
|
|
1149
1227
|
` + " ".repeat(t + 2) : ""}]`, r;
|
|
1150
|
-
},
|
|
1228
|
+
}, B = (e) => e ? Array.isArray(e) ? lt(e, 6) : "/** Filter relations not supported yet */" : "[]", dt = ["executeQueryByWidgetIdTmpl", "widgetByIdTmpl"], ct = "chartWidgetTmpl", ut = "pivotTableWidgetTmpl", pt = "customWidgetTmpl", mt = (e) => e, gt = ({
|
|
1151
1229
|
dashboardOid: e,
|
|
1152
1230
|
widgetOid: t,
|
|
1153
1231
|
uiFramework: r = "react",
|
|
1154
|
-
|
|
1155
|
-
includeChart: a = !0
|
|
1232
|
+
includeChart: i = !0
|
|
1156
1233
|
}) => {
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
if (
|
|
1162
|
-
|
|
1163
|
-
const
|
|
1234
|
+
const a = { dashboardOid: e, widgetOid: t }, s = dt[Number(i)];
|
|
1235
|
+
return M(s, a, r);
|
|
1236
|
+
}, ft = (e, t, r, i) => {
|
|
1237
|
+
var a;
|
|
1238
|
+
if (me(e)) {
|
|
1239
|
+
we(e.chartType);
|
|
1240
|
+
const s = V(e), n = {
|
|
1164
1241
|
idString: e.id,
|
|
1165
1242
|
widgetTypeString: "chart",
|
|
1166
1243
|
titleString: e.title,
|
|
1167
|
-
dataSourceString:
|
|
1168
|
-
chartTypeString:
|
|
1169
|
-
dataOptionsString:
|
|
1170
|
-
i ?
|
|
1244
|
+
dataSourceString: N(e.dataSource),
|
|
1245
|
+
chartTypeString: mt(e.chartType),
|
|
1246
|
+
dataOptionsString: nt(
|
|
1247
|
+
i ? G(e.dataOptions, e.chartType) : e.dataOptions
|
|
1171
1248
|
),
|
|
1172
|
-
filtersString:
|
|
1249
|
+
filtersString: B(e.filters),
|
|
1173
1250
|
componentString: "ChartWidget",
|
|
1174
|
-
extraImportsString:
|
|
1175
|
-
styleOptionsString:
|
|
1176
|
-
i ?
|
|
1177
|
-
|
|
1251
|
+
extraImportsString: q(e.filters || [], s),
|
|
1252
|
+
styleOptionsString: u(
|
|
1253
|
+
i ? H(e.styleOptions || {}, e.chartType) : e.styleOptions || {},
|
|
1254
|
+
O
|
|
1178
1255
|
),
|
|
1179
|
-
drilldownOptionsString:
|
|
1256
|
+
drilldownOptionsString: u(
|
|
1180
1257
|
e.drilldownOptions || {},
|
|
1181
|
-
|
|
1258
|
+
O
|
|
1182
1259
|
)
|
|
1183
1260
|
};
|
|
1184
|
-
return
|
|
1261
|
+
return M(r.chart, n, t);
|
|
1185
1262
|
}
|
|
1186
|
-
if (
|
|
1187
|
-
const
|
|
1263
|
+
if (ge(e)) {
|
|
1264
|
+
const s = V(e), n = {
|
|
1188
1265
|
idString: e.id,
|
|
1189
1266
|
widgetTypeString: "pivot",
|
|
1190
1267
|
titleString: e.title,
|
|
1191
|
-
dataSourceString:
|
|
1192
|
-
dataOptionsString:
|
|
1193
|
-
i ?
|
|
1268
|
+
dataSourceString: N(e.dataSource),
|
|
1269
|
+
dataOptionsString: u(
|
|
1270
|
+
i ? G(e.dataOptions, e.widgetType) : e.dataOptions
|
|
1194
1271
|
),
|
|
1195
|
-
filtersString:
|
|
1272
|
+
filtersString: B(e.filters),
|
|
1196
1273
|
componentString: "PivotTableWidget",
|
|
1197
|
-
extraImportsString:
|
|
1198
|
-
styleOptionsString:
|
|
1199
|
-
i ?
|
|
1200
|
-
|
|
1274
|
+
extraImportsString: q(e.filters || [], s),
|
|
1275
|
+
styleOptionsString: u(
|
|
1276
|
+
i ? H(e.styleOptions || {}, e.widgetType) : e.styleOptions || {},
|
|
1277
|
+
O
|
|
1201
1278
|
)
|
|
1202
1279
|
};
|
|
1203
|
-
return
|
|
1280
|
+
return M(r.pivot, n, t);
|
|
1204
1281
|
}
|
|
1205
|
-
if (
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1282
|
+
if (fe(e)) {
|
|
1283
|
+
if (!r.custom)
|
|
1284
|
+
return "/** Custom widget code not supported yet */";
|
|
1285
|
+
const s = {
|
|
1286
|
+
customWidgetTypeString: e.customWidgetType,
|
|
1287
|
+
titleString: (a = e.title) != null ? a : "",
|
|
1288
|
+
dataSourceString: N(e.dataSource),
|
|
1289
|
+
dataOptionsString: u(e.dataOptions, O),
|
|
1290
|
+
filtersString: B(e.filters),
|
|
1291
|
+
extraImportsString: q(e.filters || []),
|
|
1292
|
+
styleOptionsString: u(e.styleOptions || {}, O),
|
|
1293
|
+
customOptionsString: u(e.customOptions || {}, O)
|
|
1294
|
+
};
|
|
1295
|
+
return M(r.custom, s, t);
|
|
1296
|
+
}
|
|
1297
|
+
throw new v("errors.otherWidgetTypesNotSupported");
|
|
1298
|
+
}, yt = ({
|
|
1209
1299
|
widgetProps: e,
|
|
1210
1300
|
uiFramework: t = "react",
|
|
1211
1301
|
removeDefaultProps: r = !1
|
|
1212
|
-
}) =>
|
|
1302
|
+
}) => ft(e, t, {
|
|
1213
1303
|
chart: ct,
|
|
1214
|
-
pivot: ut
|
|
1304
|
+
pivot: ut,
|
|
1305
|
+
custom: pt
|
|
1215
1306
|
}, r);
|
|
1216
|
-
function
|
|
1307
|
+
function St(e) {
|
|
1217
1308
|
return !!(e && (e.top !== void 0 || e.bottom !== void 0));
|
|
1218
1309
|
}
|
|
1219
|
-
const
|
|
1310
|
+
const Ot = (e) => {
|
|
1220
1311
|
const t = e.find((r) => r.panel === "rows");
|
|
1221
1312
|
return t ? e.map((r) => {
|
|
1222
1313
|
const i = r.jaql.filter;
|
|
1223
|
-
if (!(r.panel === "scope" &&
|
|
1314
|
+
if (!(r.panel === "scope" && St(i) && i.by === void 0))
|
|
1224
1315
|
return r;
|
|
1225
|
-
const c = r.jaql, { type:
|
|
1226
|
-
return
|
|
1316
|
+
const c = r.jaql, { type: s, context: n, formula: p, filter: d } = c, f = J(c, ["type", "context", "formula", "filter"]);
|
|
1317
|
+
return m(o({}, r), {
|
|
1227
1318
|
jaql: o({
|
|
1228
1319
|
// Copy dimension properties from rows dimension
|
|
1229
1320
|
dim: t.jaql.dim,
|
|
@@ -1231,23 +1322,23 @@ const St = (e) => {
|
|
|
1231
1322
|
column: t.jaql.column,
|
|
1232
1323
|
datatype: t.jaql.datatype,
|
|
1233
1324
|
// Keep the filter but add the by clause
|
|
1234
|
-
filter:
|
|
1325
|
+
filter: m(o({}, d), {
|
|
1235
1326
|
by: {
|
|
1236
|
-
type:
|
|
1237
|
-
context:
|
|
1238
|
-
formula:
|
|
1327
|
+
type: s,
|
|
1328
|
+
context: n,
|
|
1329
|
+
formula: p
|
|
1239
1330
|
}
|
|
1240
1331
|
})
|
|
1241
1332
|
}, f)
|
|
1242
1333
|
});
|
|
1243
1334
|
}) : e;
|
|
1244
|
-
},
|
|
1335
|
+
}, Ft = (e) => "chartType" in e.chartRecommendations ? e.chartRecommendations : {
|
|
1245
1336
|
chartType: "table",
|
|
1246
1337
|
chartFamily: "table",
|
|
1247
1338
|
axesMapping: {}
|
|
1248
|
-
},
|
|
1339
|
+
}, ht = (e) => ({
|
|
1249
1340
|
dataOptions: { columns: e.map(X) }
|
|
1250
|
-
}),
|
|
1341
|
+
}), bt = Object.freeze({
|
|
1251
1342
|
convolution: {
|
|
1252
1343
|
enabled: !0,
|
|
1253
1344
|
selectedConvolutionType: "bySlicesCount",
|
|
@@ -1266,7 +1357,7 @@ const St = (e) => {
|
|
|
1266
1357
|
xAxis: {
|
|
1267
1358
|
gridLines: !1
|
|
1268
1359
|
}
|
|
1269
|
-
}),
|
|
1360
|
+
}), $ = Object.freeze({
|
|
1270
1361
|
area: "area/stacked",
|
|
1271
1362
|
arearange: "arearange/spline",
|
|
1272
1363
|
bar: "bar/stacked",
|
|
@@ -1275,30 +1366,30 @@ const St = (e) => {
|
|
|
1275
1366
|
line: "line/spline",
|
|
1276
1367
|
pie: "pie/donut",
|
|
1277
1368
|
polar: "polar/column"
|
|
1278
|
-
}),
|
|
1279
|
-
const i = e.reduce((
|
|
1280
|
-
const [
|
|
1281
|
-
return
|
|
1282
|
-
var
|
|
1283
|
-
const c =
|
|
1369
|
+
}), Tt = (e, t, r) => {
|
|
1370
|
+
const i = e.reduce((s, n) => (s[n.jaql.title] = n, s), {}), a = Object.entries(r).reduce((s, n) => {
|
|
1371
|
+
const [p, d] = n;
|
|
1372
|
+
return s[`${p}`] = Array.isArray(d) ? d.map((f) => {
|
|
1373
|
+
var E, D;
|
|
1374
|
+
const c = P(f);
|
|
1284
1375
|
delete c.enabled;
|
|
1285
1376
|
const y = i[c.column.name];
|
|
1286
1377
|
if (!y) return { column: { type: "", name: c.column.name } };
|
|
1287
1378
|
const S = X(y);
|
|
1288
1379
|
if (y.panel === "measures")
|
|
1289
|
-
return
|
|
1380
|
+
return m(o({}, c), {
|
|
1290
1381
|
column: S
|
|
1291
1382
|
});
|
|
1292
|
-
if (
|
|
1293
|
-
const C = y.jaql,
|
|
1294
|
-
if (
|
|
1295
|
-
return
|
|
1383
|
+
if (Te(S.type)) {
|
|
1384
|
+
const C = y.jaql, w = C.dateTimeLevel || C.level, L = w ? (D = (E = y.format) == null ? void 0 : E.mask) == null ? void 0 : D[w] : void 0;
|
|
1385
|
+
if (L)
|
|
1386
|
+
return m(o({}, c), {
|
|
1296
1387
|
column: S,
|
|
1297
|
-
dateFormat:
|
|
1388
|
+
dateFormat: L
|
|
1298
1389
|
});
|
|
1299
1390
|
}
|
|
1300
|
-
return
|
|
1301
|
-
}) : d,
|
|
1391
|
+
return m(o({}, c), { column: S });
|
|
1392
|
+
}) : d, s;
|
|
1302
1393
|
}, {});
|
|
1303
1394
|
switch (t) {
|
|
1304
1395
|
case "cartesian":
|
|
@@ -1313,43 +1404,43 @@ const St = (e) => {
|
|
|
1313
1404
|
value: []
|
|
1314
1405
|
}, a);
|
|
1315
1406
|
case "scatter":
|
|
1316
|
-
return Object.keys(a).forEach((
|
|
1317
|
-
a[`${
|
|
1407
|
+
return Object.keys(a).forEach((s) => {
|
|
1408
|
+
a[`${s}`] = a[`${s}`][0];
|
|
1318
1409
|
}), a;
|
|
1319
1410
|
case "scattermap":
|
|
1320
|
-
return Object.keys(a).forEach((
|
|
1321
|
-
|
|
1411
|
+
return Object.keys(a).forEach((s) => {
|
|
1412
|
+
s !== "geo" && (a[`${s}`] = a[`${s}`][0]);
|
|
1322
1413
|
}), a;
|
|
1323
1414
|
case "table":
|
|
1324
|
-
return Object.keys(a).length === 0 ?
|
|
1415
|
+
return Object.keys(a).length === 0 ? ht(e).dataOptions : a;
|
|
1325
1416
|
case "boxplot":
|
|
1326
1417
|
case "areamap":
|
|
1327
1418
|
case "indicator":
|
|
1328
1419
|
default:
|
|
1329
1420
|
return a;
|
|
1330
1421
|
}
|
|
1331
|
-
},
|
|
1332
|
-
var r, i, a,
|
|
1333
|
-
return t === "x" ? (i = (r = e.category) != null ? r : e.x) == null ? void 0 : i.map((
|
|
1334
|
-
},
|
|
1422
|
+
}, b = (e, t) => {
|
|
1423
|
+
var r, i, a, s;
|
|
1424
|
+
return t === "x" ? (i = (r = e.category) != null ? r : e.x) == null ? void 0 : i.map((n) => P(n).column.name).join(", ") : (s = (a = e.value) != null ? a : e.y) == null ? void 0 : s.map((n) => P(n).column.name).join(", ");
|
|
1425
|
+
}, F = (e, t) => {
|
|
1335
1426
|
var r;
|
|
1336
|
-
return (r = e[t]) == null ? void 0 : r.map((i) =>
|
|
1427
|
+
return (r = e[t]) == null ? void 0 : r.map((i) => P(i).column.name).join(", ");
|
|
1337
1428
|
}, Nt = (e, t) => {
|
|
1338
1429
|
var r;
|
|
1339
|
-
if (e in
|
|
1340
|
-
const i =
|
|
1341
|
-
return
|
|
1430
|
+
if (e in $) {
|
|
1431
|
+
const i = $[`${e}`];
|
|
1432
|
+
return ve(e) ? {
|
|
1342
1433
|
subtype: i,
|
|
1343
1434
|
yAxis: {
|
|
1344
1435
|
title: {
|
|
1345
1436
|
enabled: !0,
|
|
1346
|
-
text:
|
|
1437
|
+
text: b(t, "y")
|
|
1347
1438
|
}
|
|
1348
1439
|
},
|
|
1349
1440
|
xAxis: {
|
|
1350
1441
|
title: {
|
|
1351
1442
|
enabled: !0,
|
|
1352
|
-
text:
|
|
1443
|
+
text: b(t, "x")
|
|
1353
1444
|
}
|
|
1354
1445
|
}
|
|
1355
1446
|
} : { subtype: i };
|
|
@@ -1359,13 +1450,13 @@ const St = (e) => {
|
|
|
1359
1450
|
xAxis: {
|
|
1360
1451
|
title: {
|
|
1361
1452
|
enabled: !0,
|
|
1362
|
-
text:
|
|
1453
|
+
text: b(t, "x")
|
|
1363
1454
|
}
|
|
1364
1455
|
},
|
|
1365
1456
|
yAxis: {
|
|
1366
1457
|
title: {
|
|
1367
1458
|
enabled: !0,
|
|
1368
|
-
text:
|
|
1459
|
+
text: b(t, "y")
|
|
1369
1460
|
}
|
|
1370
1461
|
}
|
|
1371
1462
|
};
|
|
@@ -1373,20 +1464,20 @@ const St = (e) => {
|
|
|
1373
1464
|
const i = {
|
|
1374
1465
|
title: {
|
|
1375
1466
|
shouldBeShown: !0,
|
|
1376
|
-
text: (r =
|
|
1467
|
+
text: (r = F(t, "value")) != null ? r : ""
|
|
1377
1468
|
}
|
|
1378
|
-
}, a =
|
|
1469
|
+
}, a = F(t, "secondary");
|
|
1379
1470
|
return a && (i.secondaryTitle = {
|
|
1380
1471
|
text: a
|
|
1381
1472
|
}), { indicatorComponents: i };
|
|
1382
1473
|
}
|
|
1383
1474
|
return {};
|
|
1384
|
-
},
|
|
1475
|
+
}, vt = (e, t, r, i) => {
|
|
1385
1476
|
let a;
|
|
1386
|
-
if (i && e in
|
|
1387
|
-
a =
|
|
1388
|
-
|
|
1389
|
-
subtype:
|
|
1477
|
+
if (i && e in $)
|
|
1478
|
+
a = W(
|
|
1479
|
+
W(bt, {
|
|
1480
|
+
subtype: $[`${e}`]
|
|
1390
1481
|
}),
|
|
1391
1482
|
{
|
|
1392
1483
|
legend: {
|
|
@@ -1396,58 +1487,58 @@ const St = (e) => {
|
|
|
1396
1487
|
yAxis: {
|
|
1397
1488
|
title: {
|
|
1398
1489
|
enabled: !0,
|
|
1399
|
-
text:
|
|
1490
|
+
text: b(t, "y")
|
|
1400
1491
|
}
|
|
1401
1492
|
},
|
|
1402
1493
|
xAxis: {
|
|
1403
1494
|
title: {
|
|
1404
1495
|
enabled: !0,
|
|
1405
|
-
text:
|
|
1496
|
+
text: b(t, "x")
|
|
1406
1497
|
}
|
|
1407
1498
|
}
|
|
1408
1499
|
},
|
|
1409
1500
|
r
|
|
1410
1501
|
);
|
|
1411
1502
|
else if (i && e === "indicator") {
|
|
1412
|
-
const
|
|
1503
|
+
const s = {
|
|
1413
1504
|
indicatorComponents: {
|
|
1414
1505
|
title: {
|
|
1415
1506
|
shouldBeShown: !0,
|
|
1416
|
-
text:
|
|
1507
|
+
text: F(t, "value")
|
|
1417
1508
|
}
|
|
1418
1509
|
}
|
|
1419
|
-
},
|
|
1420
|
-
|
|
1421
|
-
text:
|
|
1422
|
-
}), a =
|
|
1423
|
-
|
|
1424
|
-
|
|
1510
|
+
}, n = F(t, "secondary");
|
|
1511
|
+
n && (s != null && s.indicatorComponents) && (s.indicatorComponents.secondaryTitle = {
|
|
1512
|
+
text: n
|
|
1513
|
+
}), a = W(
|
|
1514
|
+
K(),
|
|
1515
|
+
s,
|
|
1425
1516
|
r
|
|
1426
1517
|
);
|
|
1427
1518
|
} else
|
|
1428
|
-
a =
|
|
1519
|
+
a = W(K(), r);
|
|
1429
1520
|
return a;
|
|
1430
|
-
},
|
|
1521
|
+
}, xt = (e, t, r = !0) => {
|
|
1431
1522
|
const {
|
|
1432
1523
|
chartFamily: i,
|
|
1433
1524
|
chartType: a,
|
|
1434
|
-
axesMapping:
|
|
1435
|
-
styleOptions:
|
|
1436
|
-
} = t,
|
|
1525
|
+
axesMapping: s = {},
|
|
1526
|
+
styleOptions: n = {}
|
|
1527
|
+
} = t, p = Tt(e, i, s), d = vt(
|
|
1437
1528
|
a,
|
|
1438
|
-
n,
|
|
1439
1529
|
s,
|
|
1530
|
+
n,
|
|
1440
1531
|
r
|
|
1441
1532
|
);
|
|
1442
1533
|
return {
|
|
1443
|
-
dataOptions:
|
|
1534
|
+
dataOptions: p,
|
|
1444
1535
|
chartStyleOptions: d
|
|
1445
1536
|
};
|
|
1446
|
-
},
|
|
1537
|
+
}, Et = (e) => "chartType" in e ? e : {
|
|
1447
1538
|
chartType: "table",
|
|
1448
1539
|
chartFamily: "table",
|
|
1449
1540
|
axesMapping: {}
|
|
1450
|
-
},
|
|
1541
|
+
}, Dt = (e) => e.map((t) => xe(t.jaql)), Ct = (e) => e.reduce(
|
|
1451
1542
|
(t, r) => {
|
|
1452
1543
|
if ((r.panel === "scope" || r.jaql.filter) && t.metadataFilters.push(l(r)), r.panel !== "scope") {
|
|
1453
1544
|
const i = l(r);
|
|
@@ -1456,62 +1547,62 @@ const St = (e) => {
|
|
|
1456
1547
|
return t;
|
|
1457
1548
|
},
|
|
1458
1549
|
{ metadataColumns: [], metadataFilters: [] }
|
|
1459
|
-
),
|
|
1460
|
-
if (!
|
|
1550
|
+
), wt = (e, t) => {
|
|
1551
|
+
if (!Ce(e))
|
|
1461
1552
|
try {
|
|
1462
|
-
const { useCustomizedStyleOptions: r = !1 } = t || {}, { jaql: i, chartRecommendations: a, queryTitle:
|
|
1463
|
-
jaql:
|
|
1553
|
+
const { useCustomizedStyleOptions: r = !1 } = t || {}, { jaql: i, chartRecommendations: a, queryTitle: s } = e, { metadata: n, datasource: p } = i, d = m(o({}, p), { type: p.type || "elasticube" }), f = Ee(d), y = Ot(n).map((A) => $e(A)).map((A) => m(o({}, A), {
|
|
1554
|
+
jaql: m(o({}, A.jaql), {
|
|
1464
1555
|
datasource: f
|
|
1465
1556
|
})
|
|
1466
|
-
})), S =
|
|
1557
|
+
})), S = Et(a), E = S.chartType.toLowerCase(), D = {
|
|
1467
1558
|
cornerRadius: "Small",
|
|
1468
1559
|
header: {
|
|
1469
1560
|
// remove info button and render empty toolbar instead
|
|
1470
1561
|
renderToolbar: () => null
|
|
1471
1562
|
}
|
|
1472
|
-
}, { metadataColumns: C, metadataFilters:
|
|
1563
|
+
}, { metadataColumns: C, metadataFilters: w } = Ct(y), L = Dt(w), { dataOptions: ae, chartStyleOptions: se } = xt(
|
|
1473
1564
|
C,
|
|
1474
1565
|
S,
|
|
1475
1566
|
r
|
|
1476
|
-
),
|
|
1567
|
+
), ne = o(o({}, se), D);
|
|
1477
1568
|
return {
|
|
1478
1569
|
widgetType: "chart",
|
|
1479
|
-
id:
|
|
1480
|
-
title:
|
|
1481
|
-
chartType:
|
|
1570
|
+
id: s,
|
|
1571
|
+
title: s,
|
|
1572
|
+
chartType: E,
|
|
1482
1573
|
dataSource: d,
|
|
1483
|
-
dataOptions:
|
|
1484
|
-
filters:
|
|
1485
|
-
styleOptions:
|
|
1574
|
+
dataOptions: ae,
|
|
1575
|
+
filters: L,
|
|
1576
|
+
styleOptions: ne
|
|
1486
1577
|
};
|
|
1487
1578
|
} catch (r) {
|
|
1488
1579
|
console.error(r);
|
|
1489
1580
|
return;
|
|
1490
1581
|
}
|
|
1491
|
-
},
|
|
1582
|
+
}, Lt = (e, t) => wt(e, t), At = (e) => ue(e) ? gt(e) : yt(e), qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1492
1583
|
__proto__: null,
|
|
1493
|
-
toWidgetCode:
|
|
1494
|
-
toWidgetProps:
|
|
1584
|
+
toWidgetCode: At,
|
|
1585
|
+
toWidgetProps: Lt
|
|
1495
1586
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1496
1587
|
export {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1588
|
+
O as C,
|
|
1589
|
+
u as a,
|
|
1590
|
+
M as b,
|
|
1591
|
+
kt as c,
|
|
1592
|
+
V as d,
|
|
1593
|
+
N as e,
|
|
1594
|
+
B as f,
|
|
1595
|
+
ft as g,
|
|
1596
|
+
q as h,
|
|
1506
1597
|
$e as i,
|
|
1507
|
-
|
|
1508
|
-
|
|
1598
|
+
Ft as j,
|
|
1599
|
+
Tt as k,
|
|
1509
1600
|
Nt as l,
|
|
1510
|
-
|
|
1511
|
-
|
|
1601
|
+
vt as m,
|
|
1602
|
+
xt as n,
|
|
1512
1603
|
Me as p,
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1604
|
+
Pt as s,
|
|
1605
|
+
Lt as t,
|
|
1606
|
+
$t as v,
|
|
1607
|
+
qt as w
|
|
1517
1608
|
};
|