bruce-models 2.5.6 → 2.5.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/bruce-models.umd.js
CHANGED
|
@@ -11434,6 +11434,9 @@
|
|
|
11434
11434
|
api
|
|
11435
11435
|
})).plugin;
|
|
11436
11436
|
}
|
|
11437
|
+
if (plugin && !pluginId) {
|
|
11438
|
+
pluginId = plugin.ID;
|
|
11439
|
+
}
|
|
11437
11440
|
const { indexFileUrl } = GetLoadUrl({
|
|
11438
11441
|
api,
|
|
11439
11442
|
pluginId,
|
|
@@ -11446,20 +11449,30 @@
|
|
|
11446
11449
|
const paramsId = exports.ObjectUtils.UId();
|
|
11447
11450
|
window[paramsId] = pluginParams ? pluginParams : {};
|
|
11448
11451
|
const disposeId = exports.ObjectUtils.UId();
|
|
11452
|
+
const elementId = exports.ObjectUtils.UId();
|
|
11449
11453
|
let script = `
|
|
11450
11454
|
function run() {
|
|
11451
11455
|
${fileContent}
|
|
11452
11456
|
|
|
11453
11457
|
const paramsId = "${paramsId}";
|
|
11454
|
-
const containerId = "${
|
|
11458
|
+
const containerId = "${containerId}";
|
|
11455
11459
|
let container;
|
|
11456
11460
|
if (containerId) {
|
|
11457
|
-
container = document.getElementById("${
|
|
11461
|
+
container = document.getElementById("${containerId}");
|
|
11462
|
+
}
|
|
11463
|
+
|
|
11464
|
+
let pluginHTML = null;
|
|
11465
|
+
if (container) {
|
|
11466
|
+
pluginHTML = document.createElement("div");
|
|
11467
|
+
pluginHTML.id = "${elementId}";
|
|
11468
|
+
container.appendChild(pluginHTML);
|
|
11458
11469
|
}
|
|
11470
|
+
|
|
11459
11471
|
{TEMPLATE_CODE}
|
|
11460
11472
|
const params = window["${paramsId}"];
|
|
11461
11473
|
|
|
11462
11474
|
window["${disposeId}"] = Run({
|
|
11475
|
+
element: pluginHTML,
|
|
11463
11476
|
container: container,
|
|
11464
11477
|
pluginParams: params
|
|
11465
11478
|
});
|
|
@@ -11487,7 +11500,15 @@
|
|
|
11487
11500
|
};
|
|
11488
11501
|
}
|
|
11489
11502
|
const callDispose = window[disposeId];
|
|
11490
|
-
return () =>
|
|
11503
|
+
return () => {
|
|
11504
|
+
if (elementId) {
|
|
11505
|
+
const element = document.getElementById(elementId);
|
|
11506
|
+
if (element && element.parentElement) {
|
|
11507
|
+
element.parentElement.removeChild(element);
|
|
11508
|
+
}
|
|
11509
|
+
}
|
|
11510
|
+
callDispose();
|
|
11511
|
+
};
|
|
11491
11512
|
}
|
|
11492
11513
|
};
|
|
11493
11514
|
});
|