@hpcc-js/ddl-shim 3.4.7 → 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 +40 -34
- 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
|
}
|
|
@@ -381,13 +383,15 @@ var DDLUpgrade = class {
|
|
|
381
383
|
throw Error(`Unknown DDL1 Function Type: ${e}`);
|
|
382
384
|
}
|
|
383
385
|
readMappings() {
|
|
384
|
-
for (let e of this._ddl.dashboards) for (let t of e.visualizations) if (!isFormVisualization(t))
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
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
|
+
}
|
|
391
395
|
}
|
|
392
396
|
readPieMappings(e) {
|
|
393
397
|
let t = this._ddl2DataviewActivities[e.id].mappings;
|
|
@@ -497,26 +501,28 @@ var DDLUpgrade = class {
|
|
|
497
501
|
let n = t.events[e];
|
|
498
502
|
for (let e of n.updates) {
|
|
499
503
|
let n = this._ddl2Dataviews[e.visualization], r = this.getDatasourceFilters(e.datasource, n.id);
|
|
500
|
-
if (e.mappings)
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
let
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
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);
|
|
518
525
|
}
|
|
519
|
-
this._ddl2DataviewActivities[n.id].filters.conditions.push(i);
|
|
520
526
|
}
|
|
521
527
|
}
|
|
522
528
|
}
|