@hpcc-js/ddl-shim 3.4.6 → 3.4.8
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/index.js +45 -41
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var t = Object.defineProperty, __name = (e, n) => t(e, "name", {
|
|
|
10
10
|
enumerable: !0
|
|
11
11
|
});
|
|
12
12
|
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
13
|
-
}, n = "@hpcc-js/ddl-shim", r = "3.4.
|
|
13
|
+
}, n = "@hpcc-js/ddl-shim", r = "3.4.8", i = "3.32.0", a = /* @__PURE__ */ __exportAll({
|
|
14
14
|
isChoroVisualization: () => isChoroVisualization,
|
|
15
15
|
isDatabombDatasource: () => isDatabombDatasource,
|
|
16
16
|
isFormVisualization: () => isFormVisualization,
|
|
@@ -202,13 +202,15 @@ function apply_to_dataviews(e, t) {
|
|
|
202
202
|
}
|
|
203
203
|
function apply_widget_property_mapping(t, n) {
|
|
204
204
|
e.visualization.title = e.visualization.title || n.title || "", e.visualization.description = "", e.visualization.visibility = e.visualization.visibility === "flyout" ? "flyout" : "normal", e.visualization.chartType = e.visualization.__class.split("_")[1];
|
|
205
|
-
for (let t in n) if (l[t] !== void 0)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
205
|
+
for (let t in n) if (l[t] !== void 0) {
|
|
206
|
+
if (l[t] instanceof Array) l[t].forEach((r) => {
|
|
207
|
+
let i = r.name;
|
|
208
|
+
e.visualization.properties.widget[i] = r.transform(n[t]), typeof l[t].transform == "function" ? e.visualization.properties.widget[i] = l[t].transform(n[t]) : e.visualization.properties.widget[i] = n[t];
|
|
209
|
+
});
|
|
210
|
+
else {
|
|
211
|
+
let r = l[t].name;
|
|
212
|
+
e.visualization.properties.widget[r] = l[t].transform(n[t]);
|
|
213
|
+
}
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
216
|
}
|
|
@@ -351,13 +353,11 @@ var DDLUpgrade = class {
|
|
|
351
353
|
switch (e.function) {
|
|
352
354
|
case "SUM":
|
|
353
355
|
case "MIN":
|
|
354
|
-
case "MAX":
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
});
|
|
360
|
-
break;
|
|
356
|
+
case "MAX": r.push({
|
|
357
|
+
type: this.func2aggr(e.function),
|
|
358
|
+
inFieldID: this.toLowerCase(e.params.param1),
|
|
359
|
+
fieldID: this.toLowerCase(i.id)
|
|
360
|
+
});
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
e.push({
|
|
@@ -383,13 +383,15 @@ var DDLUpgrade = class {
|
|
|
383
383
|
throw Error(`Unknown DDL1 Function Type: ${e}`);
|
|
384
384
|
}
|
|
385
385
|
readMappings() {
|
|
386
|
-
for (let e of this._ddl.dashboards) for (let t of e.visualizations) if (!isFormVisualization(t))
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
386
|
+
for (let e of this._ddl.dashboards) for (let t of e.visualizations) if (!isFormVisualization(t)) {
|
|
387
|
+
if (isPieVisualization(t)) this.readPieMappings(t);
|
|
388
|
+
else if (isChoroVisualization(t)) this.readChoroMappings(t);
|
|
389
|
+
else if (isLineVisualization(t)) this.readLineMappings(t);
|
|
390
|
+
else if (isTableVisualization(t)) this.readTableMappings(t);
|
|
391
|
+
else if (isGraphVisualization(t)) this.readGraphMappings(t);
|
|
392
|
+
else if (isSliderVisualization(t)) this.readSliderMappings(t);
|
|
393
|
+
else throw Error(`Unkown DDL1 mapping type: ${t.type}`);
|
|
394
|
+
}
|
|
393
395
|
}
|
|
394
396
|
readPieMappings(e) {
|
|
395
397
|
let t = this._ddl2DataviewActivities[e.id].mappings;
|
|
@@ -499,26 +501,28 @@ var DDLUpgrade = class {
|
|
|
499
501
|
let n = t.events[e];
|
|
500
502
|
for (let e of n.updates) {
|
|
501
503
|
let n = this._ddl2Dataviews[e.visualization], r = this.getDatasourceFilters(e.datasource, n.id);
|
|
502
|
-
if (e.mappings)
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
let
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
504
|
+
if (e.mappings) {
|
|
505
|
+
if (isRoxieServiceRef(n.datasource)) for (let r in e.mappings) n.datasource.request.push({
|
|
506
|
+
source: t.id,
|
|
507
|
+
remoteFieldID: this.toLowerCase(r),
|
|
508
|
+
localFieldID: this.toLowerCase(e.mappings[r])
|
|
509
|
+
});
|
|
510
|
+
else {
|
|
511
|
+
let i = {
|
|
512
|
+
viewID: t.id,
|
|
513
|
+
mappings: []
|
|
514
|
+
};
|
|
515
|
+
for (let a in e.mappings) {
|
|
516
|
+
let o = e.mappings[a], s = o && r[o] ? r[o].filter : void 0;
|
|
517
|
+
s ? i.mappings.push({
|
|
518
|
+
remoteFieldID: this.toLowerCase(a),
|
|
519
|
+
localFieldID: this.toLowerCase(e.mappings[a]),
|
|
520
|
+
condition: this.rule2condition(s.rule),
|
|
521
|
+
nullable: s.nullable
|
|
522
|
+
}) : console.warn(`Select Mapping "${o}" in viz "${t.id}" not found in filters for "${n.id}"`);
|
|
523
|
+
}
|
|
524
|
+
this._ddl2DataviewActivities[n.id].filters.conditions.push(i);
|
|
520
525
|
}
|
|
521
|
-
this._ddl2DataviewActivities[n.id].filters.conditions.push(i);
|
|
522
526
|
}
|
|
523
527
|
}
|
|
524
528
|
}
|