@xuda.io/runtime-bundle 1.0.974 → 1.0.975
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/js/xuda-runtime-slim.js
CHANGED
|
@@ -12081,7 +12081,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12081
12081
|
// };
|
|
12082
12082
|
const program = val.value?.prog || val.value;
|
|
12083
12083
|
var $wrapper = $('<div>');
|
|
12084
|
-
var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
|
|
12084
|
+
var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
|
|
12085
12085
|
const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
|
|
12086
12086
|
let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, params_obj.params_res, 'alterXu_panel', undefined, undefined, params_obj.params_raw);
|
|
12087
12087
|
ret = {
|
|
@@ -13404,7 +13404,7 @@ func.UI.screen.panel_post_render_handler = async function (
|
|
|
13404
13404
|
return jobNoP;
|
|
13405
13405
|
};
|
|
13406
13406
|
|
|
13407
|
-
func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
|
|
13407
|
+
func.UI.screen.create_container = async function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
|
|
13408
13408
|
const _paramsP = _.cloneDeep(paramsP);
|
|
13409
13409
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_paramsP.dsSessionP];
|
|
13410
13410
|
var $appendTo = $container;
|
|
@@ -13475,7 +13475,24 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
|
|
|
13475
13475
|
// $div = $(`<${div} ${attr_str ? attr_str : ""} ${svg_attributes_str}>`);
|
|
13476
13476
|
// } else {
|
|
13477
13477
|
// $div = $(`<${div} ${attr_str ? attr_str : ""}>`);
|
|
13478
|
-
|
|
13478
|
+
|
|
13479
|
+
async function generateHash(str, algorithm = 'SHA-256') {
|
|
13480
|
+
// Encode the string as UTF-8
|
|
13481
|
+
const msgBuffer = new TextEncoder().encode(str);
|
|
13482
|
+
|
|
13483
|
+
// Hash the string
|
|
13484
|
+
const hashBuffer = await crypto.subtle.digest(algorithm, msgBuffer);
|
|
13485
|
+
|
|
13486
|
+
// Convert to hex string
|
|
13487
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
13488
|
+
const hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
13489
|
+
|
|
13490
|
+
return hashHex;
|
|
13491
|
+
}
|
|
13492
|
+
|
|
13493
|
+
const new_ui_id = await generateHash(ui_id);
|
|
13494
|
+
|
|
13495
|
+
$div.attr('xu-ui-id', new_ui_id).data({
|
|
13479
13496
|
xuData: {
|
|
13480
13497
|
prog_id: _paramsP.prog_id,
|
|
13481
13498
|
nodeid: nodeP.id,
|
|
@@ -13492,7 +13509,7 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
|
|
|
13492
13509
|
node: nodeP,
|
|
13493
13510
|
node_org: _.cloneDeep(nodeP),
|
|
13494
13511
|
is_panelP: _paramsP.is_panelP,
|
|
13495
|
-
ui_id,
|
|
13512
|
+
ui_id: new_ui_id,
|
|
13496
13513
|
elem_prop: elem_propP,
|
|
13497
13514
|
debug_info: {
|
|
13498
13515
|
id: nodeP.id,
|
|
@@ -14166,7 +14183,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14166
14183
|
var exist_elm_obj = get_element_info();
|
|
14167
14184
|
var $div = exist_elm_obj.div;
|
|
14168
14185
|
if (!exist_elm_obj.div) {
|
|
14169
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
|
|
14186
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
|
|
14170
14187
|
|
|
14171
14188
|
//////////////////////////
|
|
14172
14189
|
|
|
@@ -14368,7 +14385,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14368
14385
|
|
|
14369
14386
|
if (!exist_elm_obj.div) {
|
|
14370
14387
|
var $wrapper = $('<div>');
|
|
14371
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
|
|
14388
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
|
|
14372
14389
|
|
|
14373
14390
|
if (!$div) return;
|
|
14374
14391
|
|
|
@@ -14508,7 +14525,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14508
14525
|
};
|
|
14509
14526
|
|
|
14510
14527
|
var $wrapper = $('<div>');
|
|
14511
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
|
|
14528
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
|
|
14512
14529
|
|
|
14513
14530
|
let ret = await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $div.clone(true), true, undefined, refreshed_ds);
|
|
14514
14531
|
if (ret.abort) {
|
|
@@ -14538,7 +14555,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14538
14555
|
if (!element || element === 'script') return await done();
|
|
14539
14556
|
let str = '';
|
|
14540
14557
|
|
|
14541
|
-
var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
|
|
14558
|
+
var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
|
|
14542
14559
|
|
|
14543
14560
|
$div.hover(
|
|
14544
14561
|
function (e) {
|
|
@@ -9808,7 +9808,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
9808
9808
|
// };
|
|
9809
9809
|
const program = val.value?.prog || val.value;
|
|
9810
9810
|
var $wrapper = $('<div>');
|
|
9811
|
-
var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
|
|
9811
|
+
var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
|
|
9812
9812
|
const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
|
|
9813
9813
|
let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, params_obj.params_res, 'alterXu_panel', undefined, undefined, params_obj.params_raw);
|
|
9814
9814
|
ret = {
|
|
@@ -11131,7 +11131,7 @@ func.UI.screen.panel_post_render_handler = async function (
|
|
|
11131
11131
|
return jobNoP;
|
|
11132
11132
|
};
|
|
11133
11133
|
|
|
11134
|
-
func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
|
|
11134
|
+
func.UI.screen.create_container = async function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
|
|
11135
11135
|
const _paramsP = _.cloneDeep(paramsP);
|
|
11136
11136
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_paramsP.dsSessionP];
|
|
11137
11137
|
var $appendTo = $container;
|
|
@@ -11202,7 +11202,24 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
|
|
|
11202
11202
|
// $div = $(`<${div} ${attr_str ? attr_str : ""} ${svg_attributes_str}>`);
|
|
11203
11203
|
// } else {
|
|
11204
11204
|
// $div = $(`<${div} ${attr_str ? attr_str : ""}>`);
|
|
11205
|
-
|
|
11205
|
+
|
|
11206
|
+
async function generateHash(str, algorithm = 'SHA-256') {
|
|
11207
|
+
// Encode the string as UTF-8
|
|
11208
|
+
const msgBuffer = new TextEncoder().encode(str);
|
|
11209
|
+
|
|
11210
|
+
// Hash the string
|
|
11211
|
+
const hashBuffer = await crypto.subtle.digest(algorithm, msgBuffer);
|
|
11212
|
+
|
|
11213
|
+
// Convert to hex string
|
|
11214
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
11215
|
+
const hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
11216
|
+
|
|
11217
|
+
return hashHex;
|
|
11218
|
+
}
|
|
11219
|
+
|
|
11220
|
+
const new_ui_id = await generateHash(ui_id);
|
|
11221
|
+
|
|
11222
|
+
$div.attr('xu-ui-id', new_ui_id).data({
|
|
11206
11223
|
xuData: {
|
|
11207
11224
|
prog_id: _paramsP.prog_id,
|
|
11208
11225
|
nodeid: nodeP.id,
|
|
@@ -11219,7 +11236,7 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
|
|
|
11219
11236
|
node: nodeP,
|
|
11220
11237
|
node_org: _.cloneDeep(nodeP),
|
|
11221
11238
|
is_panelP: _paramsP.is_panelP,
|
|
11222
|
-
ui_id,
|
|
11239
|
+
ui_id: new_ui_id,
|
|
11223
11240
|
elem_prop: elem_propP,
|
|
11224
11241
|
debug_info: {
|
|
11225
11242
|
id: nodeP.id,
|
|
@@ -11893,7 +11910,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
11893
11910
|
var exist_elm_obj = get_element_info();
|
|
11894
11911
|
var $div = exist_elm_obj.div;
|
|
11895
11912
|
if (!exist_elm_obj.div) {
|
|
11896
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
|
|
11913
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
|
|
11897
11914
|
|
|
11898
11915
|
//////////////////////////
|
|
11899
11916
|
|
|
@@ -12095,7 +12112,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12095
12112
|
|
|
12096
12113
|
if (!exist_elm_obj.div) {
|
|
12097
12114
|
var $wrapper = $('<div>');
|
|
12098
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
|
|
12115
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
|
|
12099
12116
|
|
|
12100
12117
|
if (!$div) return;
|
|
12101
12118
|
|
|
@@ -12235,7 +12252,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12235
12252
|
};
|
|
12236
12253
|
|
|
12237
12254
|
var $wrapper = $('<div>');
|
|
12238
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
|
|
12255
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
|
|
12239
12256
|
|
|
12240
12257
|
let ret = await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $div.clone(true), true, undefined, refreshed_ds);
|
|
12241
12258
|
if (ret.abort) {
|
|
@@ -12265,7 +12282,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12265
12282
|
if (!element || element === 'script') return await done();
|
|
12266
12283
|
let str = '';
|
|
12267
12284
|
|
|
12268
|
-
var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
|
|
12285
|
+
var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
|
|
12269
12286
|
|
|
12270
12287
|
$div.hover(
|
|
12271
12288
|
function (e) {
|