@hpcc-js/composite 3.5.5 → 3.5.6
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/LICENSE +43 -43
- package/dist/index.js +1 -1
- 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 +11 -11
- package/src/ChartPanel.css +26 -26
- package/src/ChartPanel.ts +80 -80
- package/src/Dermatology.css +37 -37
- package/src/Dermatology.ts +101 -101
- package/src/MegaChart.css +5 -5
- package/src/MegaChart.ts +504 -504
- package/src/MultiChart.ts +376 -376
- package/src/MultiChartSurface.ts +68 -68
- package/src/Persist.ts +131 -131
- package/src/Utility.ts +21 -21
- package/src/__package__.ts +3 -3
- package/src/index.ts +9 -9
package/src/MultiChartSurface.ts
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { INDChart } from "@hpcc-js/api";
|
|
2
|
-
import { ResizeSurface } from "@hpcc-js/common";
|
|
3
|
-
import { MultiChart } from "./MultiChart.ts";
|
|
4
|
-
|
|
5
|
-
export function MultiChartSurface() {
|
|
6
|
-
ResizeSurface.call(this);
|
|
7
|
-
INDChart.call(this);
|
|
8
|
-
|
|
9
|
-
this._title = "MultiChartSurface";
|
|
10
|
-
|
|
11
|
-
this._content = new MultiChart();
|
|
12
|
-
const context = this;
|
|
13
|
-
this._content.click = function (row, column) {
|
|
14
|
-
context.click(row, column);
|
|
15
|
-
};
|
|
16
|
-
this._menu.click = function (d) {
|
|
17
|
-
context._content.chartType(d).render();
|
|
18
|
-
};
|
|
19
|
-
this.content(this._content);
|
|
20
|
-
this.mode("all");
|
|
21
|
-
}
|
|
22
|
-
MultiChartSurface.prototype = Object.create(ResizeSurface.prototype);
|
|
23
|
-
MultiChartSurface.prototype.constructor = MultiChartSurface;
|
|
24
|
-
MultiChartSurface.prototype._class += " chart_MultiChartSurface";
|
|
25
|
-
MultiChartSurface.prototype.implements(INDChart.prototype);
|
|
26
|
-
|
|
27
|
-
MultiChartSurface.prototype.publish("mode", "2D", "set", "Chart Type", ["1D", "2D", "ND", "all"]);
|
|
28
|
-
MultiChartSurface.prototype.publishProxy("chartType", "_content");
|
|
29
|
-
|
|
30
|
-
MultiChartSurface.prototype.columns = function (_) {
|
|
31
|
-
if (!arguments.length) return this.content().columns();
|
|
32
|
-
this.content().columns(_);
|
|
33
|
-
return this;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
MultiChartSurface.prototype.data = function (_) {
|
|
37
|
-
if (!arguments.length) return this.content().data();
|
|
38
|
-
this.content().data(_);
|
|
39
|
-
return this;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
MultiChartSurface.prototype._origMode = MultiChartSurface.prototype.mode;
|
|
43
|
-
MultiChartSurface.prototype.mode = function (_) {
|
|
44
|
-
const retVal = MultiChartSurface.prototype._origMode.apply(this, arguments);
|
|
45
|
-
if (arguments.length) {
|
|
46
|
-
this._mode = _;
|
|
47
|
-
switch (this._mode) {
|
|
48
|
-
case "1d":
|
|
49
|
-
case "1D":
|
|
50
|
-
this.menu(this.content()._1DChartTypes.map(function (item) { return item.display; }).sort());
|
|
51
|
-
break;
|
|
52
|
-
case "2d":
|
|
53
|
-
case "2D":
|
|
54
|
-
this.menu(this.content()._2DChartTypes.concat(this.content()._NDChartTypes.concat(this.content()._anyChartTypes)).map(function (item) { return item.display; }).sort());
|
|
55
|
-
break;
|
|
56
|
-
case "multi":
|
|
57
|
-
/* falls through */
|
|
58
|
-
case "ND":
|
|
59
|
-
this.menu(this.content()._NDChartTypes.concat(this.content()._anyChartTypes).map(function (item) { return item.display; }).sort());
|
|
60
|
-
break;
|
|
61
|
-
case "all":
|
|
62
|
-
/* falls through */
|
|
63
|
-
default:
|
|
64
|
-
this.menu(this.content()._allChartTypes.map(function (item) { return item.display; }).sort());
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return retVal;
|
|
68
|
-
};
|
|
1
|
+
import { INDChart } from "@hpcc-js/api";
|
|
2
|
+
import { ResizeSurface } from "@hpcc-js/common";
|
|
3
|
+
import { MultiChart } from "./MultiChart.ts";
|
|
4
|
+
|
|
5
|
+
export function MultiChartSurface() {
|
|
6
|
+
ResizeSurface.call(this);
|
|
7
|
+
INDChart.call(this);
|
|
8
|
+
|
|
9
|
+
this._title = "MultiChartSurface";
|
|
10
|
+
|
|
11
|
+
this._content = new MultiChart();
|
|
12
|
+
const context = this;
|
|
13
|
+
this._content.click = function (row, column) {
|
|
14
|
+
context.click(row, column);
|
|
15
|
+
};
|
|
16
|
+
this._menu.click = function (d) {
|
|
17
|
+
context._content.chartType(d).render();
|
|
18
|
+
};
|
|
19
|
+
this.content(this._content);
|
|
20
|
+
this.mode("all");
|
|
21
|
+
}
|
|
22
|
+
MultiChartSurface.prototype = Object.create(ResizeSurface.prototype);
|
|
23
|
+
MultiChartSurface.prototype.constructor = MultiChartSurface;
|
|
24
|
+
MultiChartSurface.prototype._class += " chart_MultiChartSurface";
|
|
25
|
+
MultiChartSurface.prototype.implements(INDChart.prototype);
|
|
26
|
+
|
|
27
|
+
MultiChartSurface.prototype.publish("mode", "2D", "set", "Chart Type", ["1D", "2D", "ND", "all"]);
|
|
28
|
+
MultiChartSurface.prototype.publishProxy("chartType", "_content");
|
|
29
|
+
|
|
30
|
+
MultiChartSurface.prototype.columns = function (_) {
|
|
31
|
+
if (!arguments.length) return this.content().columns();
|
|
32
|
+
this.content().columns(_);
|
|
33
|
+
return this;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
MultiChartSurface.prototype.data = function (_) {
|
|
37
|
+
if (!arguments.length) return this.content().data();
|
|
38
|
+
this.content().data(_);
|
|
39
|
+
return this;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
MultiChartSurface.prototype._origMode = MultiChartSurface.prototype.mode;
|
|
43
|
+
MultiChartSurface.prototype.mode = function (_) {
|
|
44
|
+
const retVal = MultiChartSurface.prototype._origMode.apply(this, arguments);
|
|
45
|
+
if (arguments.length) {
|
|
46
|
+
this._mode = _;
|
|
47
|
+
switch (this._mode) {
|
|
48
|
+
case "1d":
|
|
49
|
+
case "1D":
|
|
50
|
+
this.menu(this.content()._1DChartTypes.map(function (item) { return item.display; }).sort());
|
|
51
|
+
break;
|
|
52
|
+
case "2d":
|
|
53
|
+
case "2D":
|
|
54
|
+
this.menu(this.content()._2DChartTypes.concat(this.content()._NDChartTypes.concat(this.content()._anyChartTypes)).map(function (item) { return item.display; }).sort());
|
|
55
|
+
break;
|
|
56
|
+
case "multi":
|
|
57
|
+
/* falls through */
|
|
58
|
+
case "ND":
|
|
59
|
+
this.menu(this.content()._NDChartTypes.concat(this.content()._anyChartTypes).map(function (item) { return item.display; }).sort());
|
|
60
|
+
break;
|
|
61
|
+
case "all":
|
|
62
|
+
/* falls through */
|
|
63
|
+
default:
|
|
64
|
+
this.menu(this.content()._allChartTypes.map(function (item) { return item.display; }).sort());
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return retVal;
|
|
68
|
+
};
|
package/src/Persist.ts
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
import { Platform, Utility, Widget } from "@hpcc-js/common";
|
|
2
|
-
import { Persist } from "@hpcc-js/other";
|
|
3
|
-
import { requireWidget } from "./Utility.ts";
|
|
4
|
-
|
|
5
|
-
export function retrofit_114_serialization(state, replacement_version) {
|
|
6
|
-
replacement_version = !replacement_version || replacement_version === "1.14.2-dev" ? "1.18.0" : replacement_version;
|
|
7
|
-
if (!state.__version) return state;
|
|
8
|
-
const state_version_obj = Utility.parseVersionString(state.__version);
|
|
9
|
-
const target_version_obj = Utility.parseVersionString(replacement_version);
|
|
10
|
-
if (state_version_obj.major === 1 && state_version_obj.minor === 14) {
|
|
11
|
-
console.info("Upgrading old persist from " + state.__version + " to " + replacement_version);
|
|
12
|
-
let _json_str = JSON.stringify(state);
|
|
13
|
-
_json_str = _json_str.split('"' + state.__version).join('"' + replacement_version);
|
|
14
|
-
|
|
15
|
-
const ret_obj = JSON.parse(_json_str);
|
|
16
|
-
if (ret_obj.__properties && ret_obj.__properties.content) {
|
|
17
|
-
ret_obj.__properties.content.forEach(function (n) {// FOR EACH top tier layout_Cell
|
|
18
|
-
if (JSON.stringify(n).split("graph_Graph").length > 1 && target_version_obj.minor >= 16) {
|
|
19
|
-
n.__properties.widget.__id = n.__properties.widget.__properties.widget.__id;
|
|
20
|
-
n.__properties.widget.__class = "composite_MegaChart";
|
|
21
|
-
n.__properties.widget.__properties.showCSV = false;
|
|
22
|
-
n.__properties.widget.__properties.chartType = "GRAPH";
|
|
23
|
-
n.__properties.widget.__properties.chart = n.__properties.widget.__properties.widget;
|
|
24
|
-
delete n.__properties.widget.__properties.chart.__id;
|
|
25
|
-
delete n.__properties.widget.__properties.widget;
|
|
26
|
-
}
|
|
27
|
-
if ("undefined" === typeof n.__properties.fields) {
|
|
28
|
-
n.__properties.fields = [];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return ret_obj;
|
|
33
|
-
} else {
|
|
34
|
-
return state;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function deserializeFromObject(widget, state) {
|
|
39
|
-
const promises = [];
|
|
40
|
-
Persist.widgetPropertyWalker(widget, null, (w, item) => {
|
|
41
|
-
w[item.id + "_reset"]();
|
|
42
|
-
if (state.__properties[item.id] !== undefined) {
|
|
43
|
-
switch (item.type) {
|
|
44
|
-
case "widget":
|
|
45
|
-
const widgetKey = item.id;
|
|
46
|
-
promises.push(create(state.__properties[item.id]).then((w2: any) => {
|
|
47
|
-
w2._owner = w;
|
|
48
|
-
w[widgetKey](w2);
|
|
49
|
-
return w2;
|
|
50
|
-
}));
|
|
51
|
-
break;
|
|
52
|
-
case "widgetArray":
|
|
53
|
-
case "propertyArray":
|
|
54
|
-
const widgetArrayKey = item.id;
|
|
55
|
-
const widgetStateArray = state.__properties[item.id];
|
|
56
|
-
if (widgetStateArray.length) {
|
|
57
|
-
const arrPromises = [];
|
|
58
|
-
for (const widgetState of widgetStateArray) {
|
|
59
|
-
arrPromises.push(create(widgetState).then((widgetItem: any) => {
|
|
60
|
-
widgetItem._owner = w;
|
|
61
|
-
return widgetItem;
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
promises.push(Promise.all(arrPromises).then(widgetArray => {
|
|
65
|
-
w[widgetArrayKey](widgetArray);
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
default:
|
|
70
|
-
w[item.id](state.__properties[item.id]);
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
return Promise.all(promises).then(widgets => {
|
|
76
|
-
if (state.__data) {
|
|
77
|
-
for (const key in state.__data) {
|
|
78
|
-
if (state.__data.HasOwnProperty(key)) {
|
|
79
|
-
switch (key) {
|
|
80
|
-
case "data":
|
|
81
|
-
widget.data(state.__data[key]);
|
|
82
|
-
break;
|
|
83
|
-
default:
|
|
84
|
-
console.warn("Unexpected __data item: " + key);
|
|
85
|
-
widget[key](state.__data[key]);
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (state.__state) {
|
|
92
|
-
if (widget.deserializeState) {
|
|
93
|
-
widget.deserializeState(state.__state);
|
|
94
|
-
} else if (state.__state.data && widget.data) {
|
|
95
|
-
widget.data(state.__state.data);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return widget;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function deserialize(widget, state) {
|
|
103
|
-
if (typeof state === "string") {
|
|
104
|
-
state = JSON.parse(state);
|
|
105
|
-
}
|
|
106
|
-
if (state.__id && state.__id.indexOf(widget._idSeed) !== 0 && widget._id !== state.__id) {
|
|
107
|
-
console.warn("Deserialize: IDs do not match - " + widget._id);
|
|
108
|
-
}
|
|
109
|
-
deserializeFromObject(widget, state);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function create(state: any): Promise<Widget> {
|
|
113
|
-
if (typeof state === "string") {
|
|
114
|
-
state = JSON.parse(state);
|
|
115
|
-
}
|
|
116
|
-
state = retrofit_114_serialization(state, Platform.version());
|
|
117
|
-
return requireWidget(state.__class).then((WidgetClass: any) => {
|
|
118
|
-
const widget = new WidgetClass();
|
|
119
|
-
if (state.__id && state.__id.indexOf(widget._idSeed) !== 0 && state.__id.indexOf("_pe") !== 0) {
|
|
120
|
-
widget._id = state.__id;
|
|
121
|
-
}
|
|
122
|
-
return deserializeFromObject(widget, state);
|
|
123
|
-
}).catch(function (e) {
|
|
124
|
-
console.error("Persist.create: ***exception***");
|
|
125
|
-
console.error(e);
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export function clone(widget) {
|
|
130
|
-
create(Persist.serializeToObject(widget, undefined, true, true));
|
|
131
|
-
}
|
|
1
|
+
import { Platform, Utility, Widget } from "@hpcc-js/common";
|
|
2
|
+
import { Persist } from "@hpcc-js/other";
|
|
3
|
+
import { requireWidget } from "./Utility.ts";
|
|
4
|
+
|
|
5
|
+
export function retrofit_114_serialization(state, replacement_version) {
|
|
6
|
+
replacement_version = !replacement_version || replacement_version === "1.14.2-dev" ? "1.18.0" : replacement_version;
|
|
7
|
+
if (!state.__version) return state;
|
|
8
|
+
const state_version_obj = Utility.parseVersionString(state.__version);
|
|
9
|
+
const target_version_obj = Utility.parseVersionString(replacement_version);
|
|
10
|
+
if (state_version_obj.major === 1 && state_version_obj.minor === 14) {
|
|
11
|
+
console.info("Upgrading old persist from " + state.__version + " to " + replacement_version);
|
|
12
|
+
let _json_str = JSON.stringify(state);
|
|
13
|
+
_json_str = _json_str.split('"' + state.__version).join('"' + replacement_version);
|
|
14
|
+
|
|
15
|
+
const ret_obj = JSON.parse(_json_str);
|
|
16
|
+
if (ret_obj.__properties && ret_obj.__properties.content) {
|
|
17
|
+
ret_obj.__properties.content.forEach(function (n) {// FOR EACH top tier layout_Cell
|
|
18
|
+
if (JSON.stringify(n).split("graph_Graph").length > 1 && target_version_obj.minor >= 16) {
|
|
19
|
+
n.__properties.widget.__id = n.__properties.widget.__properties.widget.__id;
|
|
20
|
+
n.__properties.widget.__class = "composite_MegaChart";
|
|
21
|
+
n.__properties.widget.__properties.showCSV = false;
|
|
22
|
+
n.__properties.widget.__properties.chartType = "GRAPH";
|
|
23
|
+
n.__properties.widget.__properties.chart = n.__properties.widget.__properties.widget;
|
|
24
|
+
delete n.__properties.widget.__properties.chart.__id;
|
|
25
|
+
delete n.__properties.widget.__properties.widget;
|
|
26
|
+
}
|
|
27
|
+
if ("undefined" === typeof n.__properties.fields) {
|
|
28
|
+
n.__properties.fields = [];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return ret_obj;
|
|
33
|
+
} else {
|
|
34
|
+
return state;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function deserializeFromObject(widget, state) {
|
|
39
|
+
const promises = [];
|
|
40
|
+
Persist.widgetPropertyWalker(widget, null, (w, item) => {
|
|
41
|
+
w[item.id + "_reset"]();
|
|
42
|
+
if (state.__properties[item.id] !== undefined) {
|
|
43
|
+
switch (item.type) {
|
|
44
|
+
case "widget":
|
|
45
|
+
const widgetKey = item.id;
|
|
46
|
+
promises.push(create(state.__properties[item.id]).then((w2: any) => {
|
|
47
|
+
w2._owner = w;
|
|
48
|
+
w[widgetKey](w2);
|
|
49
|
+
return w2;
|
|
50
|
+
}));
|
|
51
|
+
break;
|
|
52
|
+
case "widgetArray":
|
|
53
|
+
case "propertyArray":
|
|
54
|
+
const widgetArrayKey = item.id;
|
|
55
|
+
const widgetStateArray = state.__properties[item.id];
|
|
56
|
+
if (widgetStateArray.length) {
|
|
57
|
+
const arrPromises = [];
|
|
58
|
+
for (const widgetState of widgetStateArray) {
|
|
59
|
+
arrPromises.push(create(widgetState).then((widgetItem: any) => {
|
|
60
|
+
widgetItem._owner = w;
|
|
61
|
+
return widgetItem;
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
promises.push(Promise.all(arrPromises).then(widgetArray => {
|
|
65
|
+
w[widgetArrayKey](widgetArray);
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
w[item.id](state.__properties[item.id]);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return Promise.all(promises).then(widgets => {
|
|
76
|
+
if (state.__data) {
|
|
77
|
+
for (const key in state.__data) {
|
|
78
|
+
if (state.__data.HasOwnProperty(key)) {
|
|
79
|
+
switch (key) {
|
|
80
|
+
case "data":
|
|
81
|
+
widget.data(state.__data[key]);
|
|
82
|
+
break;
|
|
83
|
+
default:
|
|
84
|
+
console.warn("Unexpected __data item: " + key);
|
|
85
|
+
widget[key](state.__data[key]);
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (state.__state) {
|
|
92
|
+
if (widget.deserializeState) {
|
|
93
|
+
widget.deserializeState(state.__state);
|
|
94
|
+
} else if (state.__state.data && widget.data) {
|
|
95
|
+
widget.data(state.__state.data);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return widget;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function deserialize(widget, state) {
|
|
103
|
+
if (typeof state === "string") {
|
|
104
|
+
state = JSON.parse(state);
|
|
105
|
+
}
|
|
106
|
+
if (state.__id && state.__id.indexOf(widget._idSeed) !== 0 && widget._id !== state.__id) {
|
|
107
|
+
console.warn("Deserialize: IDs do not match - " + widget._id);
|
|
108
|
+
}
|
|
109
|
+
deserializeFromObject(widget, state);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function create(state: any): Promise<Widget> {
|
|
113
|
+
if (typeof state === "string") {
|
|
114
|
+
state = JSON.parse(state);
|
|
115
|
+
}
|
|
116
|
+
state = retrofit_114_serialization(state, Platform.version());
|
|
117
|
+
return requireWidget(state.__class).then((WidgetClass: any) => {
|
|
118
|
+
const widget = new WidgetClass();
|
|
119
|
+
if (state.__id && state.__id.indexOf(widget._idSeed) !== 0 && state.__id.indexOf("_pe") !== 0) {
|
|
120
|
+
widget._id = state.__id;
|
|
121
|
+
}
|
|
122
|
+
return deserializeFromObject(widget, state);
|
|
123
|
+
}).catch(function (e) {
|
|
124
|
+
console.error("Persist.create: ***exception***");
|
|
125
|
+
console.error(e);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function clone(widget) {
|
|
130
|
+
create(Persist.serializeToObject(widget, undefined, true, true));
|
|
131
|
+
}
|
package/src/Utility.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Utility } from "@hpcc-js/common";
|
|
2
|
-
|
|
3
|
-
declare const require: any;
|
|
4
|
-
export function requireWidget(classID) {
|
|
5
|
-
return new Promise(function (resolve, _reject) {
|
|
6
|
-
const parsedClassID = Utility.parseClassID(classID);
|
|
7
|
-
if (require) {
|
|
8
|
-
require([parsedClassID.package], function (Package) {
|
|
9
|
-
let Widget = null;
|
|
10
|
-
if (Package && Package[parsedClassID.widgetID]) {
|
|
11
|
-
Widget = Package[parsedClassID.widgetID];
|
|
12
|
-
}
|
|
13
|
-
resolve(parsedClassID.memberWidgetID ? (Widget.prototype ? Widget.prototype[parsedClassID.memberWidgetID] : Widget[parsedClassID.memberWidgetID]) : Widget);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function requireWidgets(classIDs) {
|
|
20
|
-
return Promise.all(classIDs.map(requireWidget));
|
|
21
|
-
}
|
|
1
|
+
import { Utility } from "@hpcc-js/common";
|
|
2
|
+
|
|
3
|
+
declare const require: any;
|
|
4
|
+
export function requireWidget(classID) {
|
|
5
|
+
return new Promise(function (resolve, _reject) {
|
|
6
|
+
const parsedClassID = Utility.parseClassID(classID);
|
|
7
|
+
if (require) {
|
|
8
|
+
require([parsedClassID.package], function (Package) {
|
|
9
|
+
let Widget = null;
|
|
10
|
+
if (Package && Package[parsedClassID.widgetID]) {
|
|
11
|
+
Widget = Package[parsedClassID.widgetID];
|
|
12
|
+
}
|
|
13
|
+
resolve(parsedClassID.memberWidgetID ? (Widget.prototype ? Widget.prototype[parsedClassID.memberWidgetID] : Widget[parsedClassID.memberWidgetID]) : Widget);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function requireWidgets(classIDs) {
|
|
20
|
+
return Promise.all(classIDs.map(requireWidget));
|
|
21
|
+
}
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const PKG_NAME = "__PACKAGE_NAME__";
|
|
2
|
-
export const PKG_VERSION = "__PACKAGE_VERSION__";
|
|
3
|
-
export const BUILD_VERSION = "__BUILD_VERSION__";
|
|
1
|
+
export const PKG_NAME = "__PACKAGE_NAME__";
|
|
2
|
+
export const PKG_VERSION = "__PACKAGE_VERSION__";
|
|
3
|
+
export const BUILD_VERSION = "__BUILD_VERSION__";
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./__package__.ts";
|
|
2
|
-
export * from "./ChartPanel.ts";
|
|
3
|
-
export * from "./Dermatology.ts";
|
|
4
|
-
export * from "./MegaChart.ts";
|
|
5
|
-
export * from "./MultiChart.ts";
|
|
6
|
-
import * as Persist from "./Persist.ts";
|
|
7
|
-
export { Persist };
|
|
8
|
-
import * as Utility from "./Utility.ts";
|
|
9
|
-
export { Utility };
|
|
1
|
+
export * from "./__package__.ts";
|
|
2
|
+
export * from "./ChartPanel.ts";
|
|
3
|
+
export * from "./Dermatology.ts";
|
|
4
|
+
export * from "./MegaChart.ts";
|
|
5
|
+
export * from "./MultiChart.ts";
|
|
6
|
+
import * as Persist from "./Persist.ts";
|
|
7
|
+
export { Persist };
|
|
8
|
+
import * as Utility from "./Utility.ts";
|
|
9
|
+
export { Utility };
|