@sisense/sdk-ui 2.25.0 → 2.26.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.
Files changed (92) hide show
  1. package/dist/ai.cjs +33 -33
  2. package/dist/ai.js +626 -639
  3. package/dist/analytics-composer/node.cjs +1 -1
  4. package/dist/analytics-composer/node.js +1010 -865
  5. package/dist/analytics-composer.cjs +1 -1
  6. package/dist/analytics-composer.js +6 -6
  7. package/dist/{apply-styled-options-to-query-BsBTwL6W.js → apply-styled-options-to-query-Bzt2GrgO.js} +1459 -1426
  8. package/dist/apply-styled-options-to-query-COD9fRYD.cjs +1 -0
  9. package/dist/dimensions-Ce2zWFrs.js +204 -0
  10. package/dist/dimensions-u3w5qNF0.cjs +1 -0
  11. package/dist/index.cjs +380 -380
  12. package/dist/index.js +17024 -16696
  13. package/dist/index.umd.js +649 -660
  14. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +2 -0
  15. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +11 -0
  16. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +12 -0
  17. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +5 -2
  18. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts +16 -0
  19. package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +2 -3
  20. package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-dimensions.d.ts +10 -0
  21. package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-fields.d.ts +2 -0
  22. package/dist/packages/sdk-ui/src/domains/drilldown/components/drilldown-widget/drilldown-widget.d.ts +2 -2
  23. package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +2 -1
  24. package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +2 -2
  25. package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +1 -1
  26. package/dist/packages/sdk-ui/src/domains/query-execution/core/date-formats/simple-date-format-replacers.d.ts +13 -0
  27. package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-pivot-query/use-execute-pivot-query.d.ts +2 -2
  28. package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-query/use-execute-query.d.ts +2 -2
  29. package/dist/packages/sdk-ui/src/domains/visualizations/components/area-chart.d.ts +2 -2
  30. package/dist/packages/sdk-ui/src/domains/visualizations/components/areamap-chart.d.ts +2 -2
  31. package/dist/packages/sdk-ui/src/domains/visualizations/components/bar-chart.d.ts +2 -2
  32. package/dist/packages/sdk-ui/src/domains/visualizations/components/boxplot-chart/boxplot-chart.d.ts +2 -2
  33. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/chart.d.ts +2 -2
  34. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/axis.d.ts +1 -1
  35. package/dist/packages/sdk-ui/src/domains/visualizations/components/column-chart.d.ts +2 -2
  36. package/dist/packages/sdk-ui/src/domains/visualizations/components/funnel-chart.d.ts +2 -2
  37. package/dist/packages/sdk-ui/src/domains/visualizations/components/line-chart.d.ts +2 -2
  38. package/dist/packages/sdk-ui/src/domains/visualizations/components/pie-chart/pie-chart.d.ts +2 -2
  39. package/dist/packages/sdk-ui/src/domains/visualizations/components/polar-chart.d.ts +2 -2
  40. package/dist/packages/sdk-ui/src/domains/visualizations/components/scatter-chart.d.ts +2 -2
  41. package/dist/packages/sdk-ui/src/domains/visualizations/components/scattermap-chart.d.ts +2 -2
  42. package/dist/packages/sdk-ui/src/domains/visualizations/components/sunburst-chart/sunburst-chart.d.ts +2 -2
  43. package/dist/packages/sdk-ui/src/domains/visualizations/components/table/table.d.ts +2 -2
  44. package/dist/packages/sdk-ui/src/domains/visualizations/components/treemap-chart/treemap-chart.d.ts +2 -2
  45. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +6 -6
  46. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts +6 -1
  47. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/plot-bands.d.ts +2 -1
  48. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/axis-section.d.ts +29 -1
  49. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +1 -0
  50. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/tooltip-utils.d.ts +1 -1
  51. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/compose-code-to-readable.d.ts +24 -4
  52. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +3 -0
  53. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-params-to-view-model.d.ts +6 -2
  54. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +6 -1
  55. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +118 -2
  56. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +18 -0
  57. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/use-scroller-location-save.d.ts +8 -0
  58. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/utils.d.ts +9 -0
  59. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/widget-by-id.d.ts +2 -2
  60. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/with-navigator-scroll-save.d.ts +10 -0
  61. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/use-get-widget-model.d.ts +2 -2
  62. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +170 -0
  63. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +8 -14
  64. package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +3 -3
  65. package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +12 -1
  66. package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +10 -2
  67. package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/use-custom-widgets.d.ts +10 -3
  68. package/dist/packages/sdk-ui/src/infra/plugins/plugin-context.d.ts +2 -2
  69. package/dist/packages/sdk-ui/src/infra/plugins/types.d.ts +2 -2
  70. package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +9 -0
  71. package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +3 -4
  72. package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +1 -0
  73. package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -1
  74. package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +1 -1
  75. package/dist/packages/sdk-ui/src/shared/utils/filter-relations.d.ts +2 -0
  76. package/dist/packages/sdk-ui/src/types.d.ts +7 -7
  77. package/dist/{types-GFLaiax5.cjs → types-COBvZZm_.cjs} +1 -1
  78. package/dist/{types-BBp2sp_s.js → types-D6jCGncV.js} +1 -1
  79. package/dist/{use-hover-mptQLQ4S.js → use-hover-B1HPf4hF.js} +6190 -6093
  80. package/dist/{use-hover-DsnmY-p_.cjs → use-hover-CaQrW_gv.cjs} +112 -112
  81. package/dist/{utils-DTUC-wtI.js → utils-BQtueE3Z.js} +9591 -9422
  82. package/dist/utils-CAubp1g1.cjs +179 -0
  83. package/dist/{widget-composer-D0BZrLna.js → widget-composer-BAJFWk3t.js} +3 -3
  84. package/dist/{widget-composer-CDb2iOoS.cjs → widget-composer-C75b-E6W.cjs} +1 -1
  85. package/package.json +8 -8
  86. package/dist/apply-styled-options-to-query-mFJvsssw.cjs +0 -1
  87. package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/index.d.ts +0 -2
  88. package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/table-widget.d.ts +0 -22
  89. package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/types.d.ts +0 -61
  90. package/dist/parse-compose-code-DfZskSng.js +0 -352
  91. package/dist/parse-compose-code-v4J9BrUg.cjs +0 -1
  92. package/dist/utils-BlNqPAG8.cjs +0 -190
@@ -1,352 +0,0 @@
1
- import { D as x, M as m, S as y, p as R, a as S, w, n as A, j as W, b as u, c as l, d as b } from "./apply-styled-options-to-query-BsBTwL6W.js";
2
- class g extends x {
3
- constructor(i, e, n, s, r, a, h, c, d, f) {
4
- if (super(i, r || m.Dimension, a, c, d), this.__serializable = "DimensionalDimension", this._dimensions = [], this._attributes = [], this._sort = y.None, !d && e) {
5
- const { table: p, column: o } = R(e);
6
- this.composeCode = `${S}.${w(p)}.${w(o)}`;
7
- }
8
- this._sort = h || y.None, this._expression = e, this.setDimensions(s || []), this.setAttributes(n), f && (this.defaultAttribute = f);
9
- }
10
- static parseType(i) {
11
- switch (i) {
12
- case "datetime":
13
- case m.DateDimension:
14
- return m.DateDimension;
15
- case "text":
16
- case m.TextDimension:
17
- return m.TextDimension;
18
- case "numeric":
19
- case m.NumericDimension:
20
- return m.NumericDimension;
21
- }
22
- return m.TextDimension;
23
- }
24
- getAttachedName(i, e) {
25
- let n = i;
26
- const s = A(i);
27
- return (s === "id" || s === "name" || Object.getOwnPropertyDescriptor(this, s) !== void 0 || this[s] !== void 0) && (n = e), n;
28
- }
29
- setDimensions(i) {
30
- this._dimensions = i;
31
- for (let e = 0; e < i.length; e++) {
32
- const n = this.getAttachedName(i[e].name, i[e].attributes[0].expression);
33
- this[A(n)] = i[e], n != i[e].name && (i[e].name = n);
34
- }
35
- }
36
- setAttributes(i) {
37
- this._attributes = i || [];
38
- for (let e = 0; e < i.length; e++) {
39
- const n = this.getAttachedName(i[e].name, i[e].expression);
40
- this[A(n)] = i[e], i[e].name != n && (i[e].name = n);
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(i) {
79
- return new g(this.name, this.expression, this.attributes, this.dimensions, this.type, this.description, i, this.dataSource, this.composeCode, this.defaultAttribute);
80
- }
81
- /**
82
- * Gets a serializable representation of the element
83
- */
84
- serialize() {
85
- const i = super.serialize();
86
- return i.expression = this.expression, this.getSort() !== void 0 && (i.sort = this.getSort()), i.attributes = this._attributes.map((e) => e.serialize()), i.dimensions = this._dimensions.map((e) => e.serialize()), this.defaultAttribute && (i.defaultAttribute = this.defaultAttribute.serialize()), i;
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(i) {
94
- if (this.defaultAttribute)
95
- return this.defaultAttribute.jaql(i);
96
- if (this.dimensions.length > 0)
97
- return this.dimensions[0].jaql(i);
98
- const e = {
99
- jaql: {
100
- title: this.name,
101
- dim: this.expression,
102
- datatype: W(this.type)
103
- }
104
- };
105
- return this._sort != y.None && (e.jaql.sort = this._sort == y.Ascending ? "asc" : "desc"), i === !0 ? e.jaql : e;
106
- }
107
- }
108
- const L = (t) => t && t.__serializable === "DimensionalDimension";
109
- class D extends g {
110
- constructor(i, e, n, s, r, a, h, c) {
111
- super(i, e, [], [], m.DateDimension, n, s, r, a), this.__serializable = "DimensionalDateDimension";
112
- const d = [n, s, r, void 0, void 0, h, c];
113
- this.defaultLevel = u.Years, this.Years = new l(u.Years, e, u.Years, "yyyy", ...d), this.Quarters = new l(u.Quarters, e, u.Quarters, "Q yyyy", ...d), this.Months = new l(u.Months, e, u.Months, "yyyy-MM", ...d), this.Weeks = new l(u.Weeks, e, u.Weeks, "ww yyyy", ...d), this.Days = new l(u.Days, e, u.Days, "yyyy-MM-dd", ...d), this.Hours = new l(u.Hours, e, u.Hours, "yyyy-MM-dd HH:mm", ...d), this.MinutesRoundTo30 = new l(u.MinutesRoundTo30, e, u.MinutesRoundTo30, "yyyy-MM-dd HH:mm", n, s, r), this.MinutesRoundTo15 = new l(u.MinutesRoundTo15, e, u.MinutesRoundTo15, "yyyy-MM-dd HH:mm", ...d), this.Minutes = new l(u.Minutes, e, u.Minutes, "yyyy-MM-dd HH:mm", ...d), this.Seconds = new l(u.Seconds, e, u.Seconds, "yyyy-MM-dd HH:mm:ss", n, s, r), this.AggHours = new l(u.AggHours, e, u.AggHours, "HH:mm", ...d), this.AggMinutesRoundTo30 = new l(u.AggMinutesRoundTo30, e, u.AggMinutesRoundTo30, "HH:mm", n, s, r), this.AggMinutesRoundTo15 = new l(u.AggMinutesRoundTo15, e, u.AggMinutesRoundTo15, "HH:mm", ...d), this.AggMinutesRoundTo1 = new l(u.AggMinutesRoundTo1, e, u.AggMinutesRoundTo1, "HH:mm", ...d), 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(i) {
139
- this._attributes = i;
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(i) {
156
- return new D(this.name, this.expression, this.description, i, 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(i) {
170
- const e = this[this.defaultLevel].jaql();
171
- return e.jaql.title = this.name, i ? e.jaql : e;
172
- }
173
- }
174
- const I = (t) => t && t.__serializable === "DimensionalDateDimension";
175
- function z(t) {
176
- const i = t.name || t.title, e = t.desc || t.description, n = t.expression || t.dim, s = g.parseType(t.dimtype || t.type), r = t.sort, a = t.dataSource, h = t.indexed, c = t.merged;
177
- if (s == m.DateDimension)
178
- return new D(i, n, e, r, a, void 0, h, c);
179
- const d = Object.getOwnPropertyNames(t).map((o) => t[o]).filter((o) => m.isAttribute(o == null ? void 0 : o.type));
180
- if (d.length == 0)
181
- if (t.attributes) {
182
- let o;
183
- for (let M = 0; M < t.attributes.length; M++)
184
- o = t.attributes[M], d.push(new b(o.name, o.expression, o.type, o.description, o.sort, o.dataSource, void 0, void 0, o.indexed, o.merged));
185
- } else n && d.push(new b(i, n, s, e, r, a, void 0, void 0, h, c));
186
- const f = Object.getOwnPropertyNames(t).map((o) => t[o]).filter((o) => m.isDimension(o == null ? void 0 : o.type));
187
- if (f.length == 0 && t.dimensions)
188
- for (let o = 0; o < t.dimensions.length; o++)
189
- f.push(z(t.dimensions[o]));
190
- const p = new g(i, n, d, f, s, e, r, a);
191
- return t.defaultAttribute && (p.defaultAttribute = d.find((o) => o.name === t.defaultAttribute)), p;
192
- }
193
- function Q(t) {
194
- const i = t.name || t.title, e = t.expression || t.dim, n = t.desc || t.description, s = t.sort, r = t.dataSource;
195
- return new D(i, e, n, s, r, void 0, t.indexed, t.merged);
196
- }
197
- function T(t, i) {
198
- const e = [];
199
- let n = "", s = 0, r = !1, a = null;
200
- for (let h = 0; h < t.length; h++) {
201
- const c = t[h], d = t[h + 1];
202
- if (r) {
203
- if (c !== a) {
204
- n += c;
205
- continue;
206
- }
207
- if (d === a) {
208
- n += c + d, h++;
209
- continue;
210
- }
211
- r = !1, a = null, n += c;
212
- continue;
213
- } else {
214
- if (c === "'" || c === '"') {
215
- r = !0, a = c, n += c;
216
- continue;
217
- }
218
- if ("([{".includes(c) && s++, ")]}".includes(c) && s--, c === i && s === 0) {
219
- e.push(n.trim()), n = "";
220
- continue;
221
- }
222
- }
223
- n += c;
224
- }
225
- return n.trim() && e.push(n.trim()), e;
226
- }
227
- function N(t, i) {
228
- let e = 0, n = !1, s = null;
229
- for (let r = 0; r < t.length; r++) {
230
- const a = t[r], h = t[r + 1];
231
- if (n) {
232
- if (a !== s)
233
- continue;
234
- if (h === s) {
235
- r++;
236
- continue;
237
- }
238
- n = !1, s = null;
239
- } else {
240
- if (a === "'" || a === '"') {
241
- n = !0, s = a;
242
- continue;
243
- }
244
- if ("([{".includes(a) && e++, ")]}".includes(a) && e--, a === i && e === 0)
245
- return r;
246
- }
247
- }
248
- return -1;
249
- }
250
- function Y(t, i) {
251
- if (t[i] !== "(")
252
- return -1;
253
- let e = 1, n = i + 1, s = !1, r = null;
254
- for (; n < t.length; ) {
255
- const a = t[n], h = t[n + 1];
256
- if (s) {
257
- if (a !== r) {
258
- n++;
259
- continue;
260
- }
261
- if (h === r) {
262
- n += 2;
263
- continue;
264
- }
265
- s = !1, r = null, n++;
266
- } else {
267
- if (a === "'" || a === '"') {
268
- s = !0, r = a, n++;
269
- continue;
270
- }
271
- if ("([{".includes(a) && e++, ")]}".includes(a) && --e === 0)
272
- return n;
273
- n++;
274
- }
275
- }
276
- return -1;
277
- }
278
- function C(t) {
279
- return t.startsWith("'") && t.endsWith("'") || t.startsWith('"') && t.endsWith('"') ? t.slice(1, -1) : t;
280
- }
281
- function q(t) {
282
- if (!t || typeof t != "string")
283
- throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof t}`);
284
- const i = t.trim();
285
- if (!i)
286
- throw new Error("Invalid composeCode: empty string");
287
- const e = i.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
288
- if (!e)
289
- throw new Error(`Invalid composeCode format: expected function call, got '${i}'`);
290
- const n = e[1], s = e[2], r = _(s);
291
- return {
292
- function: n,
293
- args: r
294
- };
295
- }
296
- function _(t) {
297
- return t.trim() ? T(t, ",").map(H) : [];
298
- }
299
- function H(t) {
300
- if (!t)
301
- throw new Error("Cannot parse empty argument value");
302
- if (t === "null")
303
- return null;
304
- if (t === "undefined")
305
- return;
306
- if (t === "true")
307
- return !0;
308
- if (t === "false")
309
- return !1;
310
- if (t.match(/^-?\d+(\.\d+)?$/))
311
- return parseFloat(t);
312
- if (t.startsWith("'") && t.endsWith("'") || t.startsWith('"') && t.endsWith('"')) {
313
- const e = t[0];
314
- return t.slice(1, -1).replace(new RegExp(`${e}${e}`, "g"), e);
315
- }
316
- if (t.startsWith("[") && t.endsWith("]")) {
317
- const e = t.slice(1, -1).trim();
318
- if (!e)
319
- return [];
320
- const n = _(e);
321
- return n.every((s) => typeof s == "string"), n;
322
- }
323
- if (t.startsWith("{") && t.endsWith("}")) {
324
- const e = t.slice(1, -1).trim();
325
- return e ? $(e) : {};
326
- }
327
- return t.includes("(") && t.includes(")") ? q(t) : (t.startsWith("DM."), t);
328
- }
329
- function E(t) {
330
- const i = N(t, ":");
331
- if (i === -1)
332
- throw new Error(`Invalid object property: expected 'key: value', got '${t}'`);
333
- const e = C(t.slice(0, i).trim()), n = H(t.slice(i + 1).trim());
334
- return [e, n];
335
- }
336
- function $(t) {
337
- if (!t.trim())
338
- return {};
339
- const i = T(t, ",").map(E).filter(([, e]) => e !== null);
340
- return Object.fromEntries(i);
341
- }
342
- export {
343
- g as D,
344
- Q as a,
345
- I as b,
346
- z as c,
347
- D as d,
348
- Y as f,
349
- L as i,
350
- q as p,
351
- T as s
352
- };
@@ -1 +0,0 @@
1
- "use strict";const i=require("./apply-styled-options-to-query-mFJvsssw.cjs");class h extends i.DimensionalElement{constructor(n,t,s,r,o,u,m,d,l,c){if(super(n,o||i.MetadataTypes.Dimension,u,d,l),this.__serializable="DimensionalDimension",this._dimensions=[],this._attributes=[],this._sort=i.Sort.None,!l&&t){const{table:D,column:a}=i.parseExpression(t);this.composeCode=`${i.DATA_MODEL_MODULE_NAME}.${i.wrapIfNeedsNormalization(D)}.${i.wrapIfNeedsNormalization(a)}`}this._sort=m||i.Sort.None,this._expression=t,this.setDimensions(r||[]),this.setAttributes(s),c&&(this.defaultAttribute=c)}static parseType(n){switch(n){case"datetime":case i.MetadataTypes.DateDimension:return i.MetadataTypes.DateDimension;case"text":case i.MetadataTypes.TextDimension:return i.MetadataTypes.TextDimension;case"numeric":case i.MetadataTypes.NumericDimension:return i.MetadataTypes.NumericDimension}return i.MetadataTypes.TextDimension}getAttachedName(n,t){let s=n;const r=i.normalizeName(n);return(r==="id"||r==="name"||Object.getOwnPropertyDescriptor(this,r)!==void 0||this[r]!==void 0)&&(s=t),s}setDimensions(n){this._dimensions=n;for(let t=0;t<n.length;t++){const s=this.getAttachedName(n[t].name,n[t].attributes[0].expression);this[i.normalizeName(s)]=n[t],s!=n[t].name&&(n[t].name=s)}}setAttributes(n){this._attributes=n||[];for(let t=0;t<n.length;t++){const s=this.getAttachedName(n[t].name,n[t].expression);this[i.normalizeName(s)]=n[t],n[t].name!=s&&(n[t].name=s)}}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(n){return new h(this.name,this.expression,this.attributes,this.dimensions,this.type,this.description,n,this.dataSource,this.composeCode,this.defaultAttribute)}serialize(){const n=super.serialize();return n.expression=this.expression,this.getSort()!==void 0&&(n.sort=this.getSort()),n.attributes=this._attributes.map(t=>t.serialize()),n.dimensions=this._dimensions.map(t=>t.serialize()),this.defaultAttribute&&(n.defaultAttribute=this.defaultAttribute.serialize()),n}jaql(n){if(this.defaultAttribute)return this.defaultAttribute.jaql(n);if(this.dimensions.length>0)return this.dimensions[0].jaql(n);const t={jaql:{title:this.name,dim:this.expression,datatype:i.jaqlSimpleColumnType(this.type)}};return this._sort!=i.Sort.None&&(t.jaql.sort=this._sort==i.Sort.Ascending?"asc":"desc"),n===!0?t.jaql:t}}const L=e=>e&&e.__serializable==="DimensionalDimension";class f extends h{constructor(n,t,s,r,o,u,m,d){super(n,t,[],[],i.MetadataTypes.DateDimension,s,r,o,u),this.__serializable="DimensionalDateDimension";const l=[s,r,o,void 0,void 0,m,d];this.defaultLevel=i.DateLevels.Years,this.Years=new i.DimensionalLevelAttribute(i.DateLevels.Years,t,i.DateLevels.Years,"yyyy",...l),this.Quarters=new i.DimensionalLevelAttribute(i.DateLevels.Quarters,t,i.DateLevels.Quarters,"Q yyyy",...l),this.Months=new i.DimensionalLevelAttribute(i.DateLevels.Months,t,i.DateLevels.Months,"yyyy-MM",...l),this.Weeks=new i.DimensionalLevelAttribute(i.DateLevels.Weeks,t,i.DateLevels.Weeks,"ww yyyy",...l),this.Days=new i.DimensionalLevelAttribute(i.DateLevels.Days,t,i.DateLevels.Days,"yyyy-MM-dd",...l),this.Hours=new i.DimensionalLevelAttribute(i.DateLevels.Hours,t,i.DateLevels.Hours,"yyyy-MM-dd HH:mm",...l),this.MinutesRoundTo30=new i.DimensionalLevelAttribute(i.DateLevels.MinutesRoundTo30,t,i.DateLevels.MinutesRoundTo30,"yyyy-MM-dd HH:mm",s,r,o),this.MinutesRoundTo15=new i.DimensionalLevelAttribute(i.DateLevels.MinutesRoundTo15,t,i.DateLevels.MinutesRoundTo15,"yyyy-MM-dd HH:mm",...l),this.Minutes=new i.DimensionalLevelAttribute(i.DateLevels.Minutes,t,i.DateLevels.Minutes,"yyyy-MM-dd HH:mm",...l),this.Seconds=new i.DimensionalLevelAttribute(i.DateLevels.Seconds,t,i.DateLevels.Seconds,"yyyy-MM-dd HH:mm:ss",s,r,o),this.AggHours=new i.DimensionalLevelAttribute(i.DateLevels.AggHours,t,i.DateLevels.AggHours,"HH:mm",...l),this.AggMinutesRoundTo30=new i.DimensionalLevelAttribute(i.DateLevels.AggMinutesRoundTo30,t,i.DateLevels.AggMinutesRoundTo30,"HH:mm",s,r,o),this.AggMinutesRoundTo15=new i.DimensionalLevelAttribute(i.DateLevels.AggMinutesRoundTo15,t,i.DateLevels.AggMinutesRoundTo15,"HH:mm",...l),this.AggMinutesRoundTo1=new i.DimensionalLevelAttribute(i.DateLevels.AggMinutesRoundTo1,t,i.DateLevels.AggMinutesRoundTo1,"HH:mm",...l),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(n){this._attributes=n}getSort(){return this._sort}sort(n){return new f(this.name,this.expression,this.description,n,this.dataSource,this.composeCode,this.indexed,this.merged)}serialize(){return super.serialize()}jaql(n){const t=this[this.defaultLevel].jaql();return t.jaql.title=this.name,n?t.jaql:t}}const T=e=>e&&e.__serializable==="DimensionalDateDimension";function y(e){const n=e.name||e.title,t=e.desc||e.description,s=e.expression||e.dim,r=h.parseType(e.dimtype||e.type),o=e.sort,u=e.dataSource,m=e.indexed,d=e.merged;if(r==i.MetadataTypes.DateDimension)return new f(n,s,t,o,u,void 0,m,d);const l=Object.getOwnPropertyNames(e).map(a=>e[a]).filter(a=>i.MetadataTypes.isAttribute(a==null?void 0:a.type));if(l.length==0)if(e.attributes){let a;for(let p=0;p<e.attributes.length;p++)a=e.attributes[p],l.push(new i.DimensionalAttribute(a.name,a.expression,a.type,a.description,a.sort,a.dataSource,void 0,void 0,a.indexed,a.merged))}else s&&l.push(new i.DimensionalAttribute(n,s,r,t,o,u,void 0,void 0,m,d));const c=Object.getOwnPropertyNames(e).map(a=>e[a]).filter(a=>i.MetadataTypes.isDimension(a==null?void 0:a.type));if(c.length==0&&e.dimensions)for(let a=0;a<e.dimensions.length;a++)c.push(y(e.dimensions[a]));const D=new h(n,s,l,c,r,t,o,u);return e.defaultAttribute&&(D.defaultAttribute=l.find(a=>a.name===e.defaultAttribute)),D}function w(e){const n=e.name||e.title,t=e.expression||e.dim,s=e.desc||e.description,r=e.sort,o=e.dataSource;return new f(n,t,s,r,o,void 0,e.indexed,e.merged)}function g(e,n){const t=[];let s="",r=0,o=!1,u=null;for(let m=0;m<e.length;m++){const d=e[m],l=e[m+1];if(o){if(d!==u){s+=d;continue}if(l===u){s+=d+l,m++;continue}o=!1,u=null,s+=d;continue}else{if(d==="'"||d==='"'){o=!0,u=d,s+=d;continue}if("([{".includes(d)&&r++,")]}".includes(d)&&r--,d===n&&r===0){t.push(s.trim()),s="";continue}}s+=d}return s.trim()&&t.push(s.trim()),t}function _(e,n){let t=0,s=!1,r=null;for(let o=0;o<e.length;o++){const u=e[o],m=e[o+1];if(s){if(u!==r)continue;if(m===r){o++;continue}s=!1,r=null}else{if(u==="'"||u==='"'){s=!0,r=u;continue}if("([{".includes(u)&&t++,")]}".includes(u)&&t--,u===n&&t===0)return o}}return-1}function v(e,n){if(e[n]!=="(")return-1;let t=1,s=n+1,r=!1,o=null;for(;s<e.length;){const u=e[s],m=e[s+1];if(r){if(u!==o){s++;continue}if(m===o){s+=2;continue}r=!1,o=null,s++}else{if(u==="'"||u==='"'){r=!0,o=u,s++;continue}if("([{".includes(u)&&t++,")]}".includes(u)&&--t===0)return s;s++}}return-1}function H(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function M(e){if(!e||typeof e!="string")throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);const n=e.trim();if(!n)throw new Error("Invalid composeCode: empty string");const t=n.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);if(!t)throw new Error(`Invalid composeCode format: expected function call, got '${n}'`);const s=t[1],r=t[2],o=A(r);return{function:s,args:o}}function A(e){return e.trim()?g(e,",").map(b):[]}function b(e){if(!e)throw new Error("Cannot parse empty argument value");if(e==="null")return null;if(e==="undefined")return;if(e==="true")return!0;if(e==="false")return!1;if(e.match(/^-?\d+(\.\d+)?$/))return parseFloat(e);if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')){const t=e[0];return e.slice(1,-1).replace(new RegExp(`${t}${t}`,"g"),t)}if(e.startsWith("[")&&e.endsWith("]")){const t=e.slice(1,-1).trim();if(!t)return[];const s=A(t);return s.every(r=>typeof r=="string"),s}if(e.startsWith("{")&&e.endsWith("}")){const t=e.slice(1,-1).trim();return t?x(t):{}}return e.includes("(")&&e.includes(")")?M(e):(e.startsWith("DM."),e)}function R(e){const n=_(e,":");if(n===-1)throw new Error(`Invalid object property: expected 'key: value', got '${e}'`);const t=H(e.slice(0,n).trim()),s=b(e.slice(n+1).trim());return[t,s]}function x(e){if(!e.trim())return{};const n=g(e,",").map(R).filter(([,t])=>t!==null);return Object.fromEntries(n)}exports.DimensionalDateDimension=f;exports.DimensionalDimension=h;exports.createDateDimension=w;exports.createDimension=y;exports.findMatchingCloseParen=v;exports.isDimensionalDateDimension=T;exports.isDimensionalDimension=L;exports.parseComposeCodeToFunctionCall=M;exports.splitAtDepthZero=g;