@sisense/sdk-ui 2.24.0 → 2.25.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 +59 -59
- package/dist/ai.js +919 -980
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +856 -1030
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{execute-query-b9oy2Egy.js → apply-styled-options-to-query-BsBTwL6W.js} +1518 -1446
- package/dist/apply-styled-options-to-query-mFJvsssw.cjs +1 -0
- package/dist/{index-Ck-0gJC9.cjs → index-BX9p-XrU.cjs} +1 -1
- package/dist/{index-r66Tjiqj.js → index-D7mHzfx0.js} +9 -0
- package/dist/index.cjs +467 -452
- package/dist/index.js +25112 -32394
- package/dist/index.umd.js +708 -685
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.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 +17 -5
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +4 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/rename-widget/use-widget-renaming.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/persistence-manager.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +52 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +5 -28
- package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +4 -2
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-collapsible.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-top-slot-shell.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +40 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/build-narrative-request.d.ts +36 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +28 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +36 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +62 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +39 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/apply-styled-options-to-query.d.ts +87 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/translate-data-options.d.ts +13 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/compose-code-to-readable.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +6 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +26 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-params-to-view-model.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill-bubble-tooltip.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/types.d.ts +51 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +50 -2
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +5 -2
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-api-types.d.ts +32 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-constants.d.ts +6 -0
- package/dist/packages/sdk-ui/src/{modules/ai/api/narration-endpoints.d.ts → infra/api/narrative/narrative-endpoints.d.ts} +8 -7
- package/dist/packages/sdk-ui/src/infra/api/narrative/send-ai-feedback.d.ts +8 -0
- package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/emotion-cache-provider.d.ts +31 -3
- package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/stylis-plugins/css-selector-prefix-plugin.d.ts +18 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +18 -0
- package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/ai/api/types.d.ts +5 -18
- package/dist/packages/sdk-ui/src/modules/ai/chart/nlq-chart-widget.d.ts +2 -0
- package/dist/packages/sdk-ui/src/modules/ai/common/collapsible.d.ts +3 -0
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +5 -13
- package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/ai/use-get-nlg-insights.d.ts +4 -26
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +3 -7
- package/dist/packages/sdk-ui/src/props.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +7 -1
- package/dist/packages/sdk-ui/src/types.d.ts +1 -1
- package/dist/parse-compose-code-DfZskSng.js +352 -0
- package/dist/parse-compose-code-v4J9BrUg.cjs +1 -0
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +10 -1
- package/dist/translations/en-us.cjs +1 -1
- package/dist/translations/en-us.js +1 -1
- package/dist/translations/es-ar.cjs +1 -1
- package/dist/translations/es-ar.js +10 -1
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +10 -1
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +10 -1
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +12 -3
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +12 -3
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +12 -3
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +12 -3
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +10 -1
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +12 -3
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +10 -1
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +12 -3
- package/dist/{types-DJtC8_5_.js → types-BBp2sp_s.js} +1 -1
- package/dist/types-GFLaiax5.cjs +1 -0
- package/dist/use-hover-DsnmY-p_.cjs +721 -0
- package/dist/{quota-notification-CeKnEyQG.js → use-hover-mptQLQ4S.js} +27603 -19263
- package/dist/{utils-D8O1_kl3.cjs → utils-BlNqPAG8.cjs} +45 -45
- package/dist/{utils-BCp2ISWh.js → utils-DTUC-wtI.js} +7724 -7512
- package/dist/{widget-composer-BkHZISs7.cjs → widget-composer-CDb2iOoS.cjs} +1 -1
- package/dist/{widget-composer-CDNL9_XF.js → widget-composer-D0BZrLna.js} +3 -3
- package/package.json +11 -10
- package/dist/dimensions-C1R5YRt-.js +0 -204
- package/dist/dimensions-C7yXAoZs.cjs +0 -1
- package/dist/execute-query-0Y9Fn9Pf.cjs +0 -1
- package/dist/packages/sdk-ui/src/infra/styled/index.d.ts +0 -4
- package/dist/packages/sdk-ui/src/infra/styled/with-css-selector-prefix.d.ts +0 -2
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/constants.d.ts +0 -8
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/parse-compose-code.d.ts +0 -34
- package/dist/quota-notification-BqRYSJ7r.cjs +0 -713
- package/dist/types-C0QU2tsE.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var le=Object.defineProperty,de=Object.defineProperties;var ce=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var $=(e,t,r)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t)=>{for(var r in t||(t={}))q.call(t,r)&&$(e,r,t[r]);if(C)for(var r of C(t))k.call(t,r)&&$(e,r,t[r]);return e},m=(e,t)=>de(e,ce(t));var B=(e,t)=>{var r={};for(var i in e)q.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&C)for(var i of C(e))t.indexOf(i)<0&&k.call(e,i)&&(r[i]=e[i]);return r};const A=require("./types-
|
|
1
|
+
"use strict";var le=Object.defineProperty,de=Object.defineProperties;var ce=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var $=(e,t,r)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t)=>{for(var r in t||(t={}))q.call(t,r)&&$(e,r,t[r]);if(C)for(var r of C(t))k.call(t,r)&&$(e,r,t[r]);return e},m=(e,t)=>de(e,ce(t));var B=(e,t)=>{var r={};for(var i in e)q.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&C)for(var i of C(e))t.indexOf(i)<0&&k.call(e,i)&&(r[i]=e[i]);return r};const A=require("./types-GFLaiax5.cjs"),d=require("./utils-BlNqPAG8.cjs"),s=require("./apply-styled-options-to-query-mFJvsssw.cjs");function ue(e){return e.replace(/\s+/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function pe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function me(e){const t=/\[(.+?)\s\(Calendar\)\]/;return e.replace(t,"[$1]").trim()}function ge(e){if(e)if(e.metadata){if(!e.model)throw new s.TranslatableError("errors.missingModelTitle")}else throw new s.TranslatableError("errors.missingMetadata");else throw new s.TranslatableError("errors.emptyModel");return e}function fe(e){return!e||!e.jaql.datasource.title||!e.jaql.metadata.length}function J(e){if(![...s.ALL_CHART_TYPES,"pivot","pivot2"].includes(e))throw new s.TranslatableError("errors.chartTypeNotSupported",{chartType:e})}function ye(e){return"widgetType"in e&&e.widgetType==="pivot"}function h(e){var t;return"column"in e&&((t=e.column)==null?void 0:t.expression)&&/\(.*\)/.test(e.column.expression)}function _(e){const t="measures"in e&&g(e.measures)||"values"in e&&g(e.values);return ye(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}function g(e){return Array.isArray(e)&&e.length>0}function Se(e){const t=e.split(`
|
|
2
2
|
`);for(let r=0;r<t.length-1;r++)if(t[r].trim()===""){const i=t[r+1].trim();if(i.startsWith("import *")||i.startsWith("import {")){t.splice(r,1);break}}return t.join(`
|
|
3
3
|
`)}function Oe(e){const t=i=>/^[$A-Z_][0-9A-Z_$]*$/i.test(i);if("composeCode"in e)return e;const r={};for(const[i,a]of Object.entries(e)){const n=t(i)?i:`"${i}"`;r[n]=a}return r}const he={react:{baseChartTmpl:`import { {{componentString}} } from '@sisense/sdk-ui';
|
|
4
4
|
{{extraImportsString}}
|
|
@@ -19,9 +19,9 @@ var q = (e, t) => {
|
|
|
19
19
|
t.indexOf(i) < 0 && k.call(e, i) && (r[i] = e[i]);
|
|
20
20
|
return r;
|
|
21
21
|
};
|
|
22
|
-
import { J as ue, c as Z, i as pe } from "./types-
|
|
23
|
-
import { C as me, i as ge, a as fe, b as ye, n as _, m as w, g as B } from "./utils-
|
|
24
|
-
import { T as b, A as Se, n as he, k as G, l as Oe, m as l, o as be, q as T, D as Te, r as W, s as X, t as ve, u as Ee, v as xe } from "./
|
|
22
|
+
import { J as ue, c as Z, i as pe } from "./types-BBp2sp_s.js";
|
|
23
|
+
import { C as me, i as ge, a as fe, b as ye, n as _, m as w, g as B } from "./utils-DTUC-wtI.js";
|
|
24
|
+
import { T as b, A as Se, n as he, k as G, l as Oe, m as l, o as be, q as T, D as Te, r as W, s as X, t as ve, u as Ee, v as xe } from "./apply-styled-options-to-query-BsBTwL6W.js";
|
|
25
25
|
function Ce(e) {
|
|
26
26
|
return e.replace(/\s+/g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Sisense",
|
|
12
12
|
"Compose SDK"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.25.0",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
"@mui/icons-material": "^6.4.11",
|
|
78
78
|
"@mui/material": "^6.4.11",
|
|
79
79
|
"@mui/system": "^6.4.11",
|
|
80
|
-
"@sisense/sdk-common": "2.
|
|
81
|
-
"@sisense/sdk-data": "2.
|
|
82
|
-
"@sisense/sdk-pivot-query-client": "2.
|
|
83
|
-
"@sisense/sdk-pivot-ui": "2.
|
|
84
|
-
"@sisense/sdk-query-client": "2.
|
|
85
|
-
"@sisense/sdk-rest-client": "2.
|
|
86
|
-
"@sisense/sdk-tracking": "2.
|
|
80
|
+
"@sisense/sdk-common": "2.25.0",
|
|
81
|
+
"@sisense/sdk-data": "2.25.0",
|
|
82
|
+
"@sisense/sdk-pivot-query-client": "2.25.0",
|
|
83
|
+
"@sisense/sdk-pivot-ui": "2.25.0",
|
|
84
|
+
"@sisense/sdk-query-client": "2.25.0",
|
|
85
|
+
"@sisense/sdk-rest-client": "2.25.0",
|
|
86
|
+
"@sisense/sdk-tracking": "2.25.0",
|
|
87
87
|
"@sisense/sisense-charts": "5.2.5",
|
|
88
88
|
"@tanstack/react-query": "4.43.0",
|
|
89
89
|
"classnames": "^2.3.2",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"date-fns-tz": "^2.0.0",
|
|
93
93
|
"dayjs": "^1.11.7",
|
|
94
94
|
"deepmerge": "^4.3.1",
|
|
95
|
-
"dompurify": "^3.
|
|
95
|
+
"dompurify": "^3.3.2",
|
|
96
96
|
"fixed-data-table-2": "^2.0.21",
|
|
97
97
|
"geojson": "^0.5.0",
|
|
98
98
|
"highcharts-react-official": "^3.2.1",
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
"react-i18next": "^13.2.2",
|
|
108
108
|
"react-number-format": "^5.4.0",
|
|
109
109
|
"semver": "^7.7.4",
|
|
110
|
+
"stylis": "4.2.0",
|
|
110
111
|
"superjson": "^2.2.2",
|
|
111
112
|
"ts-deepmerge": "6.0.2",
|
|
112
113
|
"ts-essentials": "^9.3.0",
|
|
@@ -155,7 +156,6 @@
|
|
|
155
156
|
"@testing-library/react": "16.3.0",
|
|
156
157
|
"@testing-library/user-event": "^14.6.1",
|
|
157
158
|
"@types/d3": "^7",
|
|
158
|
-
"@types/dompurify": "^3.0.5",
|
|
159
159
|
"@types/fixed-data-table-2": "^1.0.0",
|
|
160
160
|
"@types/leaflet": "^1.9.8",
|
|
161
161
|
"@types/lodash": "^4.14.194",
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
"@types/react-dom": "19.1.6",
|
|
166
166
|
"@types/react-grid-layout": "^1.3.5",
|
|
167
167
|
"@types/react-plotly.js": "^2.6.0",
|
|
168
|
+
"@types/stylis": "4.2.7",
|
|
168
169
|
"@vitejs/plugin-react-swc": "^3.8.0",
|
|
169
170
|
"autoprefixer": "^10.4.14",
|
|
170
171
|
"blob-polyfill": "^7.0.20220408",
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { D as T, M as h, S as f, p as _, a as H, w as b, n as A, j as R, b as n, c as u, d as w } from "./execute-query-b9oy2Egy.js";
|
|
2
|
-
class y extends T {
|
|
3
|
-
constructor(t, e, r, o, d, m, l, c, a, g) {
|
|
4
|
-
if (super(t, d || h.Dimension, m, c, a), this.__serializable = "DimensionalDimension", this._dimensions = [], this._attributes = [], this._sort = f.None, !a && e) {
|
|
5
|
-
const { table: D, column: s } = _(e);
|
|
6
|
-
this.composeCode = `${H}.${b(D)}.${b(s)}`;
|
|
7
|
-
}
|
|
8
|
-
this._sort = l || f.None, this._expression = e, this.setDimensions(o || []), this.setAttributes(r), g && (this.defaultAttribute = g);
|
|
9
|
-
}
|
|
10
|
-
static parseType(t) {
|
|
11
|
-
switch (t) {
|
|
12
|
-
case "datetime":
|
|
13
|
-
case h.DateDimension:
|
|
14
|
-
return h.DateDimension;
|
|
15
|
-
case "text":
|
|
16
|
-
case h.TextDimension:
|
|
17
|
-
return h.TextDimension;
|
|
18
|
-
case "numeric":
|
|
19
|
-
case h.NumericDimension:
|
|
20
|
-
return h.NumericDimension;
|
|
21
|
-
}
|
|
22
|
-
return h.TextDimension;
|
|
23
|
-
}
|
|
24
|
-
getAttachedName(t, e) {
|
|
25
|
-
let r = t;
|
|
26
|
-
const o = A(t);
|
|
27
|
-
return (o === "id" || o === "name" || Object.getOwnPropertyDescriptor(this, o) !== void 0 || this[o] !== void 0) && (r = e), r;
|
|
28
|
-
}
|
|
29
|
-
setDimensions(t) {
|
|
30
|
-
this._dimensions = t;
|
|
31
|
-
for (let e = 0; e < t.length; e++) {
|
|
32
|
-
const r = this.getAttachedName(t[e].name, t[e].attributes[0].expression);
|
|
33
|
-
this[A(r)] = t[e], r != t[e].name && (t[e].name = r);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
setAttributes(t) {
|
|
37
|
-
this._attributes = t || [];
|
|
38
|
-
for (let e = 0; e < t.length; e++) {
|
|
39
|
-
const r = this.getAttachedName(t[e].name, t[e].expression);
|
|
40
|
-
this[A(r)] = t[e], t[e].name != r && (t[e].name = r);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* gets the element's ID
|
|
45
|
-
*/
|
|
46
|
-
get id() {
|
|
47
|
-
return this._expression;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Gets the child attributes
|
|
51
|
-
*/
|
|
52
|
-
get attributes() {
|
|
53
|
-
return this._attributes;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Gets the child dimensions
|
|
57
|
-
*/
|
|
58
|
-
get dimensions() {
|
|
59
|
-
return this._dimensions;
|
|
60
|
-
}
|
|
61
|
-
get expression() {
|
|
62
|
-
return this._expression;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Gets the sort definition of this instance
|
|
66
|
-
*
|
|
67
|
-
* @returns The Sort definition of this instance
|
|
68
|
-
*/
|
|
69
|
-
getSort() {
|
|
70
|
-
return this._sort;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Gets a sorted {@link Dimension} with the given definition
|
|
74
|
-
*
|
|
75
|
-
* @param sort - Sort definition
|
|
76
|
-
* @returns An instance representing the sorted {@link Dimension} of this instance
|
|
77
|
-
*/
|
|
78
|
-
sort(t) {
|
|
79
|
-
return new y(this.name, this.expression, this.attributes, this.dimensions, this.type, this.description, t, this.dataSource, this.composeCode, this.defaultAttribute);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Gets a serializable representation of the element
|
|
83
|
-
*/
|
|
84
|
-
serialize() {
|
|
85
|
-
const t = super.serialize();
|
|
86
|
-
return t.expression = this.expression, this.getSort() !== void 0 && (t.sort = this.getSort()), t.attributes = this._attributes.map((e) => e.serialize()), t.dimensions = this._dimensions.map((e) => e.serialize()), this.defaultAttribute && (t.defaultAttribute = this.defaultAttribute.serialize()), t;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Gets the JAQL representation of this instance
|
|
90
|
-
*
|
|
91
|
-
* @param nested - defines whether the JAQL is nested within parent JAQL statement or a root JAQL element
|
|
92
|
-
*/
|
|
93
|
-
jaql(t) {
|
|
94
|
-
if (this.defaultAttribute)
|
|
95
|
-
return this.defaultAttribute.jaql(t);
|
|
96
|
-
if (this.dimensions.length > 0)
|
|
97
|
-
return this.dimensions[0].jaql(t);
|
|
98
|
-
const e = {
|
|
99
|
-
jaql: {
|
|
100
|
-
title: this.name,
|
|
101
|
-
dim: this.expression,
|
|
102
|
-
datatype: R(this.type)
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
return this._sort != f.None && (e.jaql.sort = this._sort == f.Ascending ? "asc" : "desc"), t === !0 ? e.jaql : e;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const z = (i) => i && i.__serializable === "DimensionalDimension";
|
|
109
|
-
class p extends y {
|
|
110
|
-
constructor(t, e, r, o, d, m, l, c) {
|
|
111
|
-
super(t, e, [], [], h.DateDimension, r, o, d, m), this.__serializable = "DimensionalDateDimension";
|
|
112
|
-
const a = [r, o, d, void 0, void 0, l, c];
|
|
113
|
-
this.defaultLevel = n.Years, this.Years = new u(n.Years, e, n.Years, "yyyy", ...a), this.Quarters = new u(n.Quarters, e, n.Quarters, "Q yyyy", ...a), this.Months = new u(n.Months, e, n.Months, "yyyy-MM", ...a), this.Weeks = new u(n.Weeks, e, n.Weeks, "ww yyyy", ...a), this.Days = new u(n.Days, e, n.Days, "yyyy-MM-dd", ...a), this.Hours = new u(n.Hours, e, n.Hours, "yyyy-MM-dd HH:mm", ...a), this.MinutesRoundTo30 = new u(n.MinutesRoundTo30, e, n.MinutesRoundTo30, "yyyy-MM-dd HH:mm", r, o, d), this.MinutesRoundTo15 = new u(n.MinutesRoundTo15, e, n.MinutesRoundTo15, "yyyy-MM-dd HH:mm", ...a), this.Minutes = new u(n.Minutes, e, n.Minutes, "yyyy-MM-dd HH:mm", ...a), this.Seconds = new u(n.Seconds, e, n.Seconds, "yyyy-MM-dd HH:mm:ss", r, o, d), this.AggHours = new u(n.AggHours, e, n.AggHours, "HH:mm", ...a), this.AggMinutesRoundTo30 = new u(n.AggMinutesRoundTo30, e, n.AggMinutesRoundTo30, "HH:mm", r, o, d), this.AggMinutesRoundTo15 = new u(n.AggMinutesRoundTo15, e, n.AggMinutesRoundTo15, "HH:mm", ...a), this.AggMinutesRoundTo1 = new u(n.AggMinutesRoundTo1, e, n.AggMinutesRoundTo1, "HH:mm", ...a), this.setAttributes([
|
|
114
|
-
this.Years,
|
|
115
|
-
this.Quarters,
|
|
116
|
-
this.Months,
|
|
117
|
-
this.Weeks,
|
|
118
|
-
this.Days,
|
|
119
|
-
this.Hours,
|
|
120
|
-
this.MinutesRoundTo30,
|
|
121
|
-
this.MinutesRoundTo15,
|
|
122
|
-
this.Minutes,
|
|
123
|
-
this.Seconds,
|
|
124
|
-
this.AggHours,
|
|
125
|
-
this.AggMinutesRoundTo30,
|
|
126
|
-
this.AggMinutesRoundTo15,
|
|
127
|
-
this.AggMinutesRoundTo1
|
|
128
|
-
]);
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* gets the element's ID
|
|
132
|
-
*/
|
|
133
|
-
get id() {
|
|
134
|
-
return this.expression;
|
|
135
|
-
}
|
|
136
|
-
setDimensions() {
|
|
137
|
-
}
|
|
138
|
-
setAttributes(t) {
|
|
139
|
-
this._attributes = t;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Gets the sort definition of this instance
|
|
143
|
-
*
|
|
144
|
-
* @returns The Sort definition of this instance
|
|
145
|
-
*/
|
|
146
|
-
getSort() {
|
|
147
|
-
return this._sort;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Gets a sorted {@link Dimension} with the given definition
|
|
151
|
-
*
|
|
152
|
-
* @param sort - Sort definition
|
|
153
|
-
* @returns An instance representing the sorted {@link Dimension} of this instance
|
|
154
|
-
*/
|
|
155
|
-
sort(t) {
|
|
156
|
-
return new p(this.name, this.expression, this.description, t, this.dataSource, this.composeCode, this.indexed, this.merged);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Gets a serializable representation of the element
|
|
160
|
-
*/
|
|
161
|
-
serialize() {
|
|
162
|
-
return super.serialize();
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Gets the JAQL representation of this instance
|
|
166
|
-
*
|
|
167
|
-
* @param nested - defines whether the JAQL is nested within parent JAQL statement or a root JAQL element
|
|
168
|
-
*/
|
|
169
|
-
jaql(t) {
|
|
170
|
-
const e = this[this.defaultLevel].jaql();
|
|
171
|
-
return e.jaql.title = this.name, t ? e.jaql : e;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
const S = (i) => i && i.__serializable === "DimensionalDateDimension";
|
|
175
|
-
function N(i) {
|
|
176
|
-
const t = i.name || i.title, e = i.desc || i.description, r = i.expression || i.dim, o = y.parseType(i.dimtype || i.type), d = i.sort, m = i.dataSource, l = i.indexed, c = i.merged;
|
|
177
|
-
if (o == h.DateDimension)
|
|
178
|
-
return new p(t, r, e, d, m, void 0, l, c);
|
|
179
|
-
const a = Object.getOwnPropertyNames(i).map((s) => i[s]).filter((s) => h.isAttribute(s == null ? void 0 : s.type));
|
|
180
|
-
if (a.length == 0)
|
|
181
|
-
if (i.attributes) {
|
|
182
|
-
let s;
|
|
183
|
-
for (let M = 0; M < i.attributes.length; M++)
|
|
184
|
-
s = i.attributes[M], a.push(new w(s.name, s.expression, s.type, s.description, s.sort, s.dataSource, void 0, void 0, s.indexed, s.merged));
|
|
185
|
-
} else r && a.push(new w(t, r, o, e, d, m, void 0, void 0, l, c));
|
|
186
|
-
const g = Object.getOwnPropertyNames(i).map((s) => i[s]).filter((s) => h.isDimension(s == null ? void 0 : s.type));
|
|
187
|
-
if (g.length == 0 && i.dimensions)
|
|
188
|
-
for (let s = 0; s < i.dimensions.length; s++)
|
|
189
|
-
g.push(N(i.dimensions[s]));
|
|
190
|
-
const D = new y(t, r, a, g, o, e, d, m);
|
|
191
|
-
return i.defaultAttribute && (D.defaultAttribute = a.find((s) => s.name === i.defaultAttribute)), D;
|
|
192
|
-
}
|
|
193
|
-
function q(i) {
|
|
194
|
-
const t = i.name || i.title, e = i.expression || i.dim, r = i.desc || i.description, o = i.sort, d = i.dataSource;
|
|
195
|
-
return new p(t, e, r, o, d, void 0, i.indexed, i.merged);
|
|
196
|
-
}
|
|
197
|
-
export {
|
|
198
|
-
y as D,
|
|
199
|
-
q as a,
|
|
200
|
-
S as b,
|
|
201
|
-
N as c,
|
|
202
|
-
p as d,
|
|
203
|
-
z as i
|
|
204
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./execute-query-0Y9Fn9Pf.cjs");class D extends e.DimensionalElement{constructor(i,t,a,o,u,l,d,m,r,h){if(super(i,u||e.MetadataTypes.Dimension,l,m,r),this.__serializable="DimensionalDimension",this._dimensions=[],this._attributes=[],this._sort=e.Sort.None,!r&&t){const{table:y,column:n}=e.parseExpression(t);this.composeCode=`${e.DATA_MODEL_MODULE_NAME}.${e.wrapIfNeedsNormalization(y)}.${e.wrapIfNeedsNormalization(n)}`}this._sort=d||e.Sort.None,this._expression=t,this.setDimensions(o||[]),this.setAttributes(a),h&&(this.defaultAttribute=h)}static parseType(i){switch(i){case"datetime":case e.MetadataTypes.DateDimension:return e.MetadataTypes.DateDimension;case"text":case e.MetadataTypes.TextDimension:return e.MetadataTypes.TextDimension;case"numeric":case e.MetadataTypes.NumericDimension:return e.MetadataTypes.NumericDimension}return e.MetadataTypes.TextDimension}getAttachedName(i,t){let a=i;const o=e.normalizeName(i);return(o==="id"||o==="name"||Object.getOwnPropertyDescriptor(this,o)!==void 0||this[o]!==void 0)&&(a=t),a}setDimensions(i){this._dimensions=i;for(let t=0;t<i.length;t++){const a=this.getAttachedName(i[t].name,i[t].attributes[0].expression);this[e.normalizeName(a)]=i[t],a!=i[t].name&&(i[t].name=a)}}setAttributes(i){this._attributes=i||[];for(let t=0;t<i.length;t++){const a=this.getAttachedName(i[t].name,i[t].expression);this[e.normalizeName(a)]=i[t],i[t].name!=a&&(i[t].name=a)}}get id(){return this._expression}get attributes(){return this._attributes}get dimensions(){return this._dimensions}get expression(){return this._expression}getSort(){return this._sort}sort(i){return new D(this.name,this.expression,this.attributes,this.dimensions,this.type,this.description,i,this.dataSource,this.composeCode,this.defaultAttribute)}serialize(){const i=super.serialize();return i.expression=this.expression,this.getSort()!==void 0&&(i.sort=this.getSort()),i.attributes=this._attributes.map(t=>t.serialize()),i.dimensions=this._dimensions.map(t=>t.serialize()),this.defaultAttribute&&(i.defaultAttribute=this.defaultAttribute.serialize()),i}jaql(i){if(this.defaultAttribute)return this.defaultAttribute.jaql(i);if(this.dimensions.length>0)return this.dimensions[0].jaql(i);const t={jaql:{title:this.name,dim:this.expression,datatype:e.jaqlSimpleColumnType(this.type)}};return this._sort!=e.Sort.None&&(t.jaql.sort=this._sort==e.Sort.Ascending?"asc":"desc"),i===!0?t.jaql:t}}const M=s=>s&&s.__serializable==="DimensionalDimension";class c extends D{constructor(i,t,a,o,u,l,d,m){super(i,t,[],[],e.MetadataTypes.DateDimension,a,o,u,l),this.__serializable="DimensionalDateDimension";const r=[a,o,u,void 0,void 0,d,m];this.defaultLevel=e.DateLevels.Years,this.Years=new e.DimensionalLevelAttribute(e.DateLevels.Years,t,e.DateLevels.Years,"yyyy",...r),this.Quarters=new e.DimensionalLevelAttribute(e.DateLevels.Quarters,t,e.DateLevels.Quarters,"Q yyyy",...r),this.Months=new e.DimensionalLevelAttribute(e.DateLevels.Months,t,e.DateLevels.Months,"yyyy-MM",...r),this.Weeks=new e.DimensionalLevelAttribute(e.DateLevels.Weeks,t,e.DateLevels.Weeks,"ww yyyy",...r),this.Days=new e.DimensionalLevelAttribute(e.DateLevels.Days,t,e.DateLevels.Days,"yyyy-MM-dd",...r),this.Hours=new e.DimensionalLevelAttribute(e.DateLevels.Hours,t,e.DateLevels.Hours,"yyyy-MM-dd HH:mm",...r),this.MinutesRoundTo30=new e.DimensionalLevelAttribute(e.DateLevels.MinutesRoundTo30,t,e.DateLevels.MinutesRoundTo30,"yyyy-MM-dd HH:mm",a,o,u),this.MinutesRoundTo15=new e.DimensionalLevelAttribute(e.DateLevels.MinutesRoundTo15,t,e.DateLevels.MinutesRoundTo15,"yyyy-MM-dd HH:mm",...r),this.Minutes=new e.DimensionalLevelAttribute(e.DateLevels.Minutes,t,e.DateLevels.Minutes,"yyyy-MM-dd HH:mm",...r),this.Seconds=new e.DimensionalLevelAttribute(e.DateLevels.Seconds,t,e.DateLevels.Seconds,"yyyy-MM-dd HH:mm:ss",a,o,u),this.AggHours=new e.DimensionalLevelAttribute(e.DateLevels.AggHours,t,e.DateLevels.AggHours,"HH:mm",...r),this.AggMinutesRoundTo30=new e.DimensionalLevelAttribute(e.DateLevels.AggMinutesRoundTo30,t,e.DateLevels.AggMinutesRoundTo30,"HH:mm",a,o,u),this.AggMinutesRoundTo15=new e.DimensionalLevelAttribute(e.DateLevels.AggMinutesRoundTo15,t,e.DateLevels.AggMinutesRoundTo15,"HH:mm",...r),this.AggMinutesRoundTo1=new e.DimensionalLevelAttribute(e.DateLevels.AggMinutesRoundTo1,t,e.DateLevels.AggMinutesRoundTo1,"HH:mm",...r),this.setAttributes([this.Years,this.Quarters,this.Months,this.Weeks,this.Days,this.Hours,this.MinutesRoundTo30,this.MinutesRoundTo15,this.Minutes,this.Seconds,this.AggHours,this.AggMinutesRoundTo30,this.AggMinutesRoundTo15,this.AggMinutesRoundTo1])}get id(){return this.expression}setDimensions(){}setAttributes(i){this._attributes=i}getSort(){return this._sort}sort(i){return new c(this.name,this.expression,this.description,i,this.dataSource,this.composeCode,this.indexed,this.merged)}serialize(){return super.serialize()}jaql(i){const t=this[this.defaultLevel].jaql();return t.jaql.title=this.name,i?t.jaql:t}}const A=s=>s&&s.__serializable==="DimensionalDateDimension";function p(s){const i=s.name||s.title,t=s.desc||s.description,a=s.expression||s.dim,o=D.parseType(s.dimtype||s.type),u=s.sort,l=s.dataSource,d=s.indexed,m=s.merged;if(o==e.MetadataTypes.DateDimension)return new c(i,a,t,u,l,void 0,d,m);const r=Object.getOwnPropertyNames(s).map(n=>s[n]).filter(n=>e.MetadataTypes.isAttribute(n==null?void 0:n.type));if(r.length==0)if(s.attributes){let n;for(let g=0;g<s.attributes.length;g++)n=s.attributes[g],r.push(new e.DimensionalAttribute(n.name,n.expression,n.type,n.description,n.sort,n.dataSource,void 0,void 0,n.indexed,n.merged))}else a&&r.push(new e.DimensionalAttribute(i,a,o,t,u,l,void 0,void 0,d,m));const h=Object.getOwnPropertyNames(s).map(n=>s[n]).filter(n=>e.MetadataTypes.isDimension(n==null?void 0:n.type));if(h.length==0&&s.dimensions)for(let n=0;n<s.dimensions.length;n++)h.push(p(s.dimensions[n]));const y=new D(i,a,r,h,o,t,u,l);return s.defaultAttribute&&(y.defaultAttribute=r.find(n=>n.name===s.defaultAttribute)),y}function f(s){const i=s.name||s.title,t=s.expression||s.dim,a=s.desc||s.description,o=s.sort,u=s.dataSource;return new c(i,t,a,o,u,void 0,s.indexed,s.merged)}exports.DimensionalDateDimension=c;exports.DimensionalDimension=D;exports.createDateDimension=f;exports.createDimension=p;exports.isDimensionalDateDimension=A;exports.isDimensionalDimension=M;
|