@xuda.io/runtime-bundle 1.0.1018 → 1.0.1020
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-bundle.js +298 -273
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +299 -274
- package/js/xuda-runtime-slim.min.es.js +299 -274
- package/js/xuda-runtime-slim.min.js +1 -1
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +2 -0
- package/js/xuda-worker-bundle.js +2 -0
- package/js/xuda-worker-bundle.min.js +1 -1
- package/js/xuda_common-bundle.js +2 -0
- package/js/xuda_common-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -2678,6 +2678,8 @@ func.common.sha256 = async function (str) {
|
|
|
2678
2678
|
const bytes = new Uint8Array(buf);
|
|
2679
2679
|
return [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
2680
2680
|
};
|
|
2681
|
+
|
|
2682
|
+
glb.new_xu_render = true;
|
|
2681
2683
|
glb.DEBUG_INFO_OBJ = {};
|
|
2682
2684
|
// var CONNECTION_ATTEMPTS = 0;
|
|
2683
2685
|
glb.APP_INFO = {};
|
|
@@ -10192,300 +10194,310 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10192
10194
|
set_value();
|
|
10193
10195
|
return {};
|
|
10194
10196
|
},
|
|
10195
|
-
'xu-render
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10197
|
+
'xu-render': async function ($elm, val, from_panel) {
|
|
10198
|
+
const old_render = async function () {
|
|
10199
|
+
var value = await func.common.get_cast_val(SESSION_ID, 'common fx', 'xu-render', 'bool', val.value);
|
|
10200
|
+
const init_render = function () {
|
|
10201
|
+
if (!value) {
|
|
10202
|
+
var cloned_$div = $elm.clone(true);
|
|
10203
|
+
|
|
10204
|
+
let $xurender = $('<xurender>').attr('xu-ui-id', $elm.attr('xu-ui-id')).attr('hidden', true).appendTo($container).hide();
|
|
10205
|
+
let original_data_obj = {
|
|
10206
|
+
$container: cloned_$div,
|
|
10207
|
+
nodeP: _.cloneDeep(nodeP),
|
|
10208
|
+
parent_infoP,
|
|
10209
|
+
paramsP,
|
|
10210
|
+
keyP,
|
|
10211
|
+
parent_nodeP,
|
|
10212
|
+
$root_container,
|
|
10213
|
+
};
|
|
10214
|
+
$xurender.data('xuData', cloned_$div.data().xuData);
|
|
10215
|
+
$xurender.data().xuData.original_data_obj = original_data_obj;
|
|
10216
|
+
$xurender.data().xuData.xurender_node = cloned_$div;
|
|
10217
|
+
$xurender.data().xuAttributes = nodeP.attributes || {};
|
|
10218
|
+
$xurender.hide();
|
|
10200
10219
|
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
paramsP,
|
|
10207
|
-
keyP,
|
|
10208
|
-
parent_nodeP,
|
|
10209
|
-
$root_container,
|
|
10210
|
-
};
|
|
10211
|
-
$xurender.data('xuData', cloned_$div.data().xuData);
|
|
10212
|
-
$xurender.data().xuData.original_data_obj = original_data_obj;
|
|
10213
|
-
$xurender.data().xuData.xurender_node = cloned_$div;
|
|
10214
|
-
$xurender.data().xuAttributes = nodeP.attributes || {};
|
|
10215
|
-
$xurender.hide();
|
|
10220
|
+
$elm.remove();
|
|
10221
|
+
return { abort: true };
|
|
10222
|
+
}
|
|
10223
|
+
return {};
|
|
10224
|
+
};
|
|
10216
10225
|
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10226
|
+
const post_render = async function () {
|
|
10227
|
+
if (value) {
|
|
10228
|
+
try {
|
|
10229
|
+
// abort if already rended
|
|
10230
|
+
if ($elm[0].tagName !== 'XURENDER' && $elm?.length) {
|
|
10231
|
+
return func.events.delete_job(SESSION_ID, jobNoP);
|
|
10232
|
+
}
|
|
10222
10233
|
|
|
10223
|
-
|
|
10224
|
-
if (value) {
|
|
10225
|
-
try {
|
|
10226
|
-
// abort if already rended
|
|
10227
|
-
if ($elm[0].tagName !== 'XURENDER' && $elm?.length) {
|
|
10228
|
-
return func.events.delete_job(SESSION_ID, jobNoP);
|
|
10229
|
-
}
|
|
10234
|
+
let original_data_obj = $elm.data().xuData.original_data_obj;
|
|
10230
10235
|
|
|
10231
|
-
|
|
10236
|
+
if (!original_data_obj) {
|
|
10237
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10238
|
+
return { delete_job: jobNoP };
|
|
10239
|
+
}
|
|
10232
10240
|
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
|
|
10241
|
+
const new_$div = await func.UI.screen.render_ui_tree(
|
|
10242
|
+
SESSION_ID,
|
|
10243
|
+
$elm, //original_data_obj.$container,
|
|
10244
|
+
_.cloneDeep(original_data_obj.nodeP),
|
|
10245
|
+
original_data_obj.parent_infoP,
|
|
10246
|
+
original_data_obj.paramsP,
|
|
10247
|
+
jobNoP,
|
|
10248
|
+
null,
|
|
10249
|
+
original_data_obj.keyP,
|
|
10250
|
+
null,
|
|
10251
|
+
original_data_obj.parent_nodeP,
|
|
10252
|
+
null,
|
|
10253
|
+
original_data_obj.$root_container,
|
|
10254
|
+
);
|
|
10237
10255
|
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
$elm
|
|
10241
|
-
_.cloneDeep(original_data_obj.nodeP),
|
|
10242
|
-
original_data_obj.parent_infoP,
|
|
10243
|
-
original_data_obj.paramsP,
|
|
10244
|
-
jobNoP,
|
|
10245
|
-
null,
|
|
10246
|
-
original_data_obj.keyP,
|
|
10247
|
-
null,
|
|
10248
|
-
original_data_obj.parent_nodeP,
|
|
10249
|
-
null,
|
|
10250
|
-
original_data_obj.$root_container,
|
|
10251
|
-
);
|
|
10256
|
+
new_$div.data().xuData.original_data_obj = original_data_obj;
|
|
10257
|
+
new_$div.data().xuData.xurender_node = $elm.clone(true);
|
|
10258
|
+
new_$div.data().xuAttributes = $elm.data().xuAttributes || {};
|
|
10252
10259
|
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10260
|
+
const replace = async function () {
|
|
10261
|
+
$elm.replaceWith(new_$div);
|
|
10262
|
+
if (from_panel) {
|
|
10263
|
+
const xuPanelWrapper = _.clone(new_$div.data().xuPanelWrapper);
|
|
10264
|
+
$elm.parent().data().xuPanelWrapper = xuPanelWrapper;
|
|
10265
|
+
$elm.replaceWith(new_$div.children());
|
|
10266
|
+
}
|
|
10256
10267
|
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
$elm.replaceWith(new_$div.children());
|
|
10263
|
-
}
|
|
10268
|
+
if (val.fields_arr) {
|
|
10269
|
+
return await func.UI.screen.refresh_xu_attributes(SESSION_ID, val.fields_arr, val.jobNoP, new_$div);
|
|
10270
|
+
}
|
|
10271
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10272
|
+
};
|
|
10264
10273
|
|
|
10265
|
-
if (
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
};
|
|
10274
|
+
if ($elm && func.UI.utils.find_in_element_data('xuData', $(SESSION_OBJ[SESSION_ID].root_element), 'xu_id', $elm.data().xuData.xu_id).length) {
|
|
10275
|
+
if (new_$div.data().xuData.paramsP) {
|
|
10276
|
+
return await replace();
|
|
10277
|
+
}
|
|
10270
10278
|
|
|
10271
|
-
|
|
10272
|
-
if (new_$div.data().xuData.paramsP) {
|
|
10273
|
-
return await replace();
|
|
10279
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10274
10280
|
}
|
|
10275
|
-
|
|
10281
|
+
} catch (error) {
|
|
10276
10282
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10277
10283
|
}
|
|
10278
|
-
|
|
10284
|
+
return;
|
|
10285
|
+
}
|
|
10286
|
+
// if (!value) {
|
|
10287
|
+
if ($elm.prop('tagName') === 'XURENDER') {
|
|
10279
10288
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10289
|
+
return;
|
|
10280
10290
|
}
|
|
10281
|
-
return;
|
|
10282
|
-
}
|
|
10283
|
-
// if (!value) {
|
|
10284
|
-
if ($elm.prop('tagName') === 'XURENDER') {
|
|
10285
|
-
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10286
|
-
return;
|
|
10287
|
-
}
|
|
10288
10291
|
|
|
10289
|
-
|
|
10292
|
+
let tmp_$div = $('<div>');
|
|
10290
10293
|
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10294
|
+
let $xurender = $('<xurender>').attr('xu-ui-id', $elm.attr('xu-ui-id')).appendTo(tmp_$div).hide();
|
|
10295
|
+
// was true before
|
|
10296
|
+
if ($elm.data().xuData.xurender_node) {
|
|
10297
|
+
$xurender.data({
|
|
10298
|
+
xuAttributes: $elm.data().xuData.xurender_node.data().xuAttributes || {},
|
|
10299
|
+
xuData: $elm.data().xuData.xurender_node.data().xuData || {},
|
|
10300
|
+
});
|
|
10301
|
+
} else {
|
|
10302
|
+
// default new state
|
|
10300
10303
|
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10304
|
+
$xurender.data({
|
|
10305
|
+
xuAttributes: $elm.data().xuAttributes || {},
|
|
10306
|
+
xuData: $elm.data().xuData || {},
|
|
10307
|
+
});
|
|
10308
|
+
const original_data_obj = {
|
|
10309
|
+
nodeP: _.cloneDeep($elm.data().xuData.node_org),
|
|
10310
|
+
paramsP: $elm.data().xuData.paramsP,
|
|
10311
|
+
$container: $elm.clone(true),
|
|
10312
|
+
parent_infoP: parent_infoP,
|
|
10313
|
+
};
|
|
10311
10314
|
|
|
10312
|
-
|
|
10313
|
-
|
|
10315
|
+
$xurender.data().xuData.original_data_obj = original_data_obj;
|
|
10316
|
+
}
|
|
10314
10317
|
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
+
$elm.replaceWith(tmp_$div.children());
|
|
10319
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10320
|
+
// }
|
|
10321
|
+
};
|
|
10322
|
+
if (is_init) {
|
|
10323
|
+
return init_render();
|
|
10324
|
+
}
|
|
10325
|
+
return await post_render();
|
|
10318
10326
|
};
|
|
10319
|
-
if (is_init) {
|
|
10320
|
-
return init_render();
|
|
10321
|
-
}
|
|
10322
|
-
return await post_render();
|
|
10323
|
-
},
|
|
10324
|
-
'xu-render': async function ($elm, val, from_panel) {
|
|
10325
|
-
var value = await func.common.get_cast_val(SESSION_ID, 'common fx', 'xu-render', 'bool', val.value);
|
|
10326
|
-
const init_render = async function () {
|
|
10327
|
-
if (!value) {
|
|
10328
|
-
const cloned_$div = $elm.clone(true);
|
|
10329
10327
|
|
|
10330
|
-
|
|
10328
|
+
const new_render = async function () {
|
|
10329
|
+
var value = await func.common.get_cast_val(SESSION_ID, 'common fx', 'xu-render', 'bool', val.value);
|
|
10330
|
+
const init_render = async function () {
|
|
10331
|
+
nodeP.xu_render_made = value;
|
|
10332
|
+
if (!value) {
|
|
10333
|
+
// const cloned_$div = $elm.clone(true);
|
|
10334
|
+
|
|
10335
|
+
// const xu_ui_id = await generate_xu_ui_id(SESSION_ID, nodeP, $container, paramsP, keyP);
|
|
10336
|
+
|
|
10337
|
+
// let $xurender = $('<xurender>').attr('xu-ui-id', xu_ui_id).attr('hidden', true).appendTo($container).hide();
|
|
10338
|
+
// let original_data_obj = {
|
|
10339
|
+
// force_render: true,
|
|
10340
|
+
// $container: cloned_$div,
|
|
10341
|
+
// nodeP: _.cloneDeep(nodeP),
|
|
10342
|
+
// parent_infoP,
|
|
10343
|
+
// paramsP,
|
|
10344
|
+
// keyP,
|
|
10345
|
+
// parent_nodeP,
|
|
10346
|
+
// $root_container,
|
|
10347
|
+
// };
|
|
10348
|
+
// $xurender.data('xuData', cloned_$div.data().xuData);
|
|
10349
|
+
// $xurender.data().xuData.original_data_obj = original_data_obj;
|
|
10350
|
+
// $xurender.data().xuData.xurender_node = cloned_$div;
|
|
10351
|
+
// $xurender.data().xuAttributes = nodeP.attributes || {};
|
|
10352
|
+
// $xurender.hide();
|
|
10353
|
+
|
|
10354
|
+
// $elm.remove();
|
|
10355
|
+
// nodeP.xu_render_made = true;
|
|
10356
|
+
return { xu_render_in_process: true };
|
|
10357
|
+
}
|
|
10358
|
+
return {};
|
|
10359
|
+
};
|
|
10331
10360
|
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
keyP,
|
|
10340
|
-
parent_nodeP,
|
|
10341
|
-
$root_container,
|
|
10342
|
-
};
|
|
10343
|
-
$xurender.data('xuData', cloned_$div.data().xuData);
|
|
10344
|
-
$xurender.data().xuData.original_data_obj = original_data_obj;
|
|
10345
|
-
$xurender.data().xuData.xurender_node = cloned_$div;
|
|
10346
|
-
$xurender.data().xuAttributes = nodeP.attributes || {};
|
|
10347
|
-
$xurender.hide();
|
|
10361
|
+
const post_render = async function () {
|
|
10362
|
+
if (value) {
|
|
10363
|
+
try {
|
|
10364
|
+
// abort if already rended
|
|
10365
|
+
if ($elm[0].tagName !== 'XURENDER' && $elm?.length) {
|
|
10366
|
+
return func.events.delete_job(SESSION_ID, jobNoP);
|
|
10367
|
+
}
|
|
10348
10368
|
|
|
10349
|
-
|
|
10350
|
-
return { abort: true };
|
|
10351
|
-
}
|
|
10352
|
-
return {};
|
|
10353
|
-
};
|
|
10369
|
+
let original_data_obj = $elm.data().xuData.original_data_obj;
|
|
10354
10370
|
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
if ($elm[0].tagName !== 'XURENDER' && $elm?.length) {
|
|
10360
|
-
return func.events.delete_job(SESSION_ID, jobNoP);
|
|
10361
|
-
}
|
|
10371
|
+
if (!original_data_obj) {
|
|
10372
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10373
|
+
return { delete_job: jobNoP };
|
|
10374
|
+
}
|
|
10362
10375
|
|
|
10363
|
-
|
|
10376
|
+
////////////
|
|
10377
|
+
const cache_str = await get_xu_render_cache_str(SESSION_ID, paramsP.dsSessionP);
|
|
10378
|
+
const xu_ui_id = $elm.attr('xu-ui-id');
|
|
10379
|
+
let new_$div = UI_WORKER_OBJ?.xu_render_cache?.[xu_ui_id]?.[cache_str]?.$container.clone(true);
|
|
10364
10380
|
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
return { delete_job: jobNoP };
|
|
10368
|
-
}
|
|
10381
|
+
/////////////
|
|
10382
|
+
// let new_$div = original_data_obj.$container.clone(true);
|
|
10369
10383
|
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10384
|
+
if (original_data_obj.force_render || !new_$div) {
|
|
10385
|
+
new_$div = await func.UI.screen.render_ui_tree(
|
|
10386
|
+
SESSION_ID,
|
|
10387
|
+
$elm, //original_data_obj.$container,
|
|
10388
|
+
_.cloneDeep(original_data_obj.nodeP),
|
|
10389
|
+
original_data_obj.parent_infoP,
|
|
10390
|
+
original_data_obj.paramsP,
|
|
10391
|
+
jobNoP,
|
|
10392
|
+
null,
|
|
10393
|
+
original_data_obj.keyP,
|
|
10394
|
+
null,
|
|
10395
|
+
original_data_obj.parent_nodeP,
|
|
10396
|
+
null,
|
|
10397
|
+
original_data_obj.$root_container,
|
|
10398
|
+
);
|
|
10399
|
+
}
|
|
10400
|
+
////////////
|
|
10401
|
+
if (!UI_WORKER_OBJ.xu_render_cache[xu_ui_id]) {
|
|
10402
|
+
UI_WORKER_OBJ.xu_render_cache[xu_ui_id] = {};
|
|
10403
|
+
}
|
|
10404
|
+
UI_WORKER_OBJ.xu_render_cache[xu_ui_id][cache_str] = original_data_obj;
|
|
10405
|
+
//////////////
|
|
10406
|
+
new_$div.data().xuData.original_data_obj = original_data_obj;
|
|
10407
|
+
new_$div.data().xuData.xurender_node = $elm.clone(true);
|
|
10408
|
+
new_$div.data().xuAttributes = $elm.data().xuAttributes || {};
|
|
10409
|
+
|
|
10410
|
+
const replace = async function () {
|
|
10411
|
+
$elm.replaceWith(new_$div);
|
|
10412
|
+
if (from_panel) {
|
|
10413
|
+
const xuPanelWrapper = _.clone(new_$div.data().xuPanelWrapper);
|
|
10414
|
+
$elm.parent().data().xuPanelWrapper = xuPanelWrapper;
|
|
10415
|
+
$elm.replaceWith(new_$div.children());
|
|
10416
|
+
}
|
|
10374
10417
|
|
|
10375
|
-
|
|
10376
|
-
|
|
10418
|
+
if (val.fields_arr) {
|
|
10419
|
+
return await func.UI.screen.refresh_xu_attributes(SESSION_ID, val.fields_arr, val.jobNoP, new_$div);
|
|
10420
|
+
}
|
|
10421
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10422
|
+
};
|
|
10377
10423
|
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
_.cloneDeep(original_data_obj.nodeP),
|
|
10383
|
-
original_data_obj.parent_infoP,
|
|
10384
|
-
original_data_obj.paramsP,
|
|
10385
|
-
jobNoP,
|
|
10386
|
-
null,
|
|
10387
|
-
original_data_obj.keyP,
|
|
10388
|
-
null,
|
|
10389
|
-
original_data_obj.parent_nodeP,
|
|
10390
|
-
null,
|
|
10391
|
-
original_data_obj.$root_container,
|
|
10392
|
-
);
|
|
10393
|
-
}
|
|
10394
|
-
////////////
|
|
10395
|
-
if (!UI_WORKER_OBJ.xu_render_cache[xu_ui_id]) {
|
|
10396
|
-
UI_WORKER_OBJ.xu_render_cache[xu_ui_id] = {};
|
|
10397
|
-
}
|
|
10398
|
-
UI_WORKER_OBJ.xu_render_cache[xu_ui_id][cache_str] = original_data_obj;
|
|
10399
|
-
//////////////
|
|
10400
|
-
new_$div.data().xuData.original_data_obj = original_data_obj;
|
|
10401
|
-
new_$div.data().xuData.xurender_node = $elm.clone(true);
|
|
10402
|
-
new_$div.data().xuAttributes = $elm.data().xuAttributes || {};
|
|
10403
|
-
|
|
10404
|
-
const replace = async function () {
|
|
10405
|
-
$elm.replaceWith(new_$div);
|
|
10406
|
-
if (from_panel) {
|
|
10407
|
-
const xuPanelWrapper = _.clone(new_$div.data().xuPanelWrapper);
|
|
10408
|
-
$elm.parent().data().xuPanelWrapper = xuPanelWrapper;
|
|
10409
|
-
$elm.replaceWith(new_$div.children());
|
|
10410
|
-
}
|
|
10424
|
+
if ($elm && func.UI.utils.find_in_element_data('xuData', $(SESSION_OBJ[SESSION_ID].root_element), 'xu_id', $elm.data().xuData.xu_id).length) {
|
|
10425
|
+
if (new_$div.data().xuData.paramsP) {
|
|
10426
|
+
return await replace();
|
|
10427
|
+
}
|
|
10411
10428
|
|
|
10412
|
-
|
|
10413
|
-
return await func.UI.screen.refresh_xu_attributes(SESSION_ID, val.fields_arr, val.jobNoP, new_$div);
|
|
10429
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10414
10430
|
}
|
|
10431
|
+
} catch (error) {
|
|
10415
10432
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10416
|
-
}
|
|
10433
|
+
}
|
|
10434
|
+
return;
|
|
10435
|
+
}
|
|
10417
10436
|
|
|
10418
|
-
|
|
10419
|
-
if (new_$div.data().xuData.paramsP) {
|
|
10420
|
-
return await replace();
|
|
10421
|
-
}
|
|
10437
|
+
/////////// !value ///////////
|
|
10422
10438
|
|
|
10423
|
-
|
|
10424
|
-
}
|
|
10425
|
-
} catch (error) {
|
|
10439
|
+
if ($elm.prop('tagName') === 'XURENDER') {
|
|
10426
10440
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10441
|
+
return;
|
|
10427
10442
|
}
|
|
10428
|
-
return;
|
|
10429
|
-
}
|
|
10430
10443
|
|
|
10431
|
-
|
|
10444
|
+
let tmp_$div = $('<div>');
|
|
10445
|
+
// const xu_ui_id = $elm.attr('xu-ui-id');
|
|
10446
|
+
const xu_ui_id = await generate_xu_ui_id(SESSION_ID, nodeP, $container, paramsP, keyP);
|
|
10432
10447
|
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10448
|
+
let $xurender = $('<xurender>').attr('xu-ui-id', xu_ui_id).appendTo(tmp_$div).hide();
|
|
10449
|
+
// // was true before
|
|
10450
|
+
// if ($elm.data().xuData.xurender_node) {
|
|
10451
|
+
// $xurender.data({
|
|
10452
|
+
// xuAttributes: $elm.data().xuData.xurender_node.data().xuAttributes || {},
|
|
10453
|
+
// xuData: $elm.data().xuData.xurender_node.data().xuData || {},
|
|
10454
|
+
// });
|
|
10455
|
+
// } else {
|
|
10456
|
+
// default new state
|
|
10437
10457
|
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
|
|
10455
|
-
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
10459
|
-
// $container: $elm.clone(true),
|
|
10460
|
-
// parent_infoP: parent_infoP,
|
|
10461
|
-
// };
|
|
10462
|
-
const cloned_$div = $elm.clone(true);
|
|
10463
|
-
let original_data_obj = {
|
|
10464
|
-
force_render: false,
|
|
10465
|
-
$container: cloned_$div,
|
|
10466
|
-
nodeP: cloned_$div.data().xuData.node_org,
|
|
10467
|
-
parent_infoP,
|
|
10468
|
-
paramsP,
|
|
10469
|
-
keyP,
|
|
10470
|
-
parent_nodeP, //:cloned_$div.data().xuData.original_data_obj.parent_nodeP,
|
|
10471
|
-
$root_container,
|
|
10472
|
-
};
|
|
10458
|
+
$xurender.data({
|
|
10459
|
+
xuAttributes: $elm.data().xuAttributes || {},
|
|
10460
|
+
xuData: $elm.data().xuData || {},
|
|
10461
|
+
});
|
|
10462
|
+
// const original_data_obj = {
|
|
10463
|
+
// nodeP: _.cloneDeep($elm.data().xuData.node_org),
|
|
10464
|
+
// paramsP: $elm.data().xuData.paramsP,
|
|
10465
|
+
// $container: $elm.clone(true),
|
|
10466
|
+
// parent_infoP: parent_infoP,
|
|
10467
|
+
// };
|
|
10468
|
+
const cloned_$div = $elm.clone(true);
|
|
10469
|
+
let original_data_obj = {
|
|
10470
|
+
force_render: false,
|
|
10471
|
+
$container: cloned_$div,
|
|
10472
|
+
nodeP: cloned_$div.data().xuData.node_org,
|
|
10473
|
+
parent_infoP,
|
|
10474
|
+
paramsP,
|
|
10475
|
+
keyP,
|
|
10476
|
+
parent_nodeP, //:cloned_$div.data().xuData.original_data_obj.parent_nodeP,
|
|
10477
|
+
$root_container,
|
|
10478
|
+
};
|
|
10473
10479
|
|
|
10474
|
-
|
|
10480
|
+
$xurender.data().xuData.original_data_obj = original_data_obj;
|
|
10475
10481
|
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10482
|
+
const cache_str = await get_xu_render_cache_str(SESSION_ID, paramsP.dsSessionP);
|
|
10483
|
+
if (!UI_WORKER_OBJ.xu_render_cache[xu_ui_id]) {
|
|
10484
|
+
UI_WORKER_OBJ.xu_render_cache[xu_ui_id] = {};
|
|
10485
|
+
}
|
|
10486
|
+
UI_WORKER_OBJ.xu_render_cache[xu_ui_id][cache_str] = original_data_obj;
|
|
10487
|
+
// }
|
|
10488
|
+
$elm.replaceWith(tmp_$div.children());
|
|
10489
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10490
|
+
};
|
|
10491
|
+
if (is_init) {
|
|
10492
|
+
return await init_render();
|
|
10479
10493
|
}
|
|
10480
|
-
|
|
10481
|
-
// }
|
|
10482
|
-
$elm.replaceWith(tmp_$div.children());
|
|
10483
|
-
func.events.delete_job(SESSION_ID, jobNoP);
|
|
10494
|
+
return await post_render();
|
|
10484
10495
|
};
|
|
10485
|
-
|
|
10486
|
-
|
|
10496
|
+
|
|
10497
|
+
if (glb.new_xu_render) {
|
|
10498
|
+
return new_render();
|
|
10487
10499
|
}
|
|
10488
|
-
return
|
|
10500
|
+
return old_render();
|
|
10489
10501
|
},
|
|
10490
10502
|
'xu-show': async function ($elm, val) {
|
|
10491
10503
|
var value = await func.common.get_cast_val(SESSION_ID, 'common fx', 'xu-show', 'bool', val.value);
|
|
@@ -11044,22 +11056,6 @@ func.UI.screen.set_attributes_new = async function (SESSION_ID, is_skeleton, $ro
|
|
|
11044
11056
|
continue;
|
|
11045
11057
|
}
|
|
11046
11058
|
|
|
11047
|
-
// if (!nodeP.attributes || !nodeP.attributes[attr] & !nodeP.attributes[`xu-exp:${attr}`]) {
|
|
11048
|
-
// continue;
|
|
11049
|
-
// }
|
|
11050
|
-
|
|
11051
|
-
// if (_.isEmpty(nodeP.attributes)) {
|
|
11052
|
-
// break;
|
|
11053
|
-
// }
|
|
11054
|
-
|
|
11055
|
-
// if (typeof nodeP.attributes[attr] === 'undefined') {
|
|
11056
|
-
// continue;
|
|
11057
|
-
// }
|
|
11058
|
-
|
|
11059
|
-
// if (typeof func.UI.screen.fix_val_defaults(attr, (await get_xuExp(attr)) || nodeP.attributes[attr]) === 'undefined') {
|
|
11060
|
-
// continue;
|
|
11061
|
-
// }
|
|
11062
|
-
|
|
11063
11059
|
if (!nodeP?.attributes?.hasOwnProperty(attr) && !nodeP?.attributes?.hasOwnProperty(`xu-exp:${attr}`)) {
|
|
11064
11060
|
continue;
|
|
11065
11061
|
}
|
|
@@ -11084,7 +11080,6 @@ func.UI.screen.set_attributes_new = async function (SESSION_ID, is_skeleton, $ro
|
|
|
11084
11080
|
{
|
|
11085
11081
|
key: attr,
|
|
11086
11082
|
|
|
11087
|
-
// value: (await get_xuExp(attr)) || func.UI.screen.fix_val_defaults(attr, nodeP.attributes[attr]),
|
|
11088
11083
|
value: await get_attr_value(attr),
|
|
11089
11084
|
},
|
|
11090
11085
|
is_init,
|
|
@@ -11658,6 +11653,11 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
11658
11653
|
// debugger;
|
|
11659
11654
|
}
|
|
11660
11655
|
|
|
11656
|
+
///////////
|
|
11657
|
+
if (glb.new_xu_render) {
|
|
11658
|
+
}
|
|
11659
|
+
|
|
11660
|
+
///////////
|
|
11661
11661
|
var is_mobile = glb.MOBILE_ARR.includes(paramsP.screenInfo.properties?.menuType) ? true : false;
|
|
11662
11662
|
|
|
11663
11663
|
const get_element_info = function () {
|
|
@@ -11810,6 +11810,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
11810
11810
|
node_promises.push(
|
|
11811
11811
|
new Promise(async (resolve, reject) => {
|
|
11812
11812
|
const ret = await func.UI.screen.render_ui_tree(SESSION_ID, $divP, nodeP.children[key], parent_infoP, paramsP, jobNoP, is_skeleton, Number(key), null, nodeP, null, $root_container);
|
|
11813
|
+
debugger;
|
|
11813
11814
|
resolve();
|
|
11814
11815
|
}),
|
|
11815
11816
|
);
|
|
@@ -12480,13 +12481,27 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12480
12481
|
};
|
|
12481
12482
|
|
|
12482
12483
|
const draw_html_element = async function (element) {
|
|
12483
|
-
|
|
12484
|
-
|
|
12484
|
+
let temp_$container = $('<tmp>');
|
|
12485
|
+
if (!glb.new_xu_render) {
|
|
12486
|
+
temp_$container = $container;
|
|
12487
|
+
}
|
|
12488
|
+
const done = async function (ret) {
|
|
12489
|
+
if (glb.new_xu_render) {
|
|
12490
|
+
if (ret.xu_render_in_process) {
|
|
12491
|
+
debugger;
|
|
12492
|
+
$container.append(temp_$container.children());
|
|
12493
|
+
return $div;
|
|
12494
|
+
} else {
|
|
12495
|
+
return $div;
|
|
12496
|
+
}
|
|
12497
|
+
} else {
|
|
12498
|
+
return $div;
|
|
12499
|
+
}
|
|
12485
12500
|
};
|
|
12486
12501
|
if (!element || element === 'script') return await done();
|
|
12487
12502
|
let str = '';
|
|
12488
12503
|
|
|
12489
|
-
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);
|
|
12504
|
+
var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, temp_$container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
|
|
12490
12505
|
|
|
12491
12506
|
$div.hover(
|
|
12492
12507
|
function (e) {
|
|
@@ -12502,8 +12517,10 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12502
12517
|
});
|
|
12503
12518
|
}
|
|
12504
12519
|
|
|
12505
|
-
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, true);
|
|
12506
|
-
if (ret.abort || nodeP.tagName === 'svg' || !_.isEmpty(nodeP?.attributes?.['xu-text']) || !_.isEmpty(nodeP?.attributes?.['xu-html']) || !_.isEmpty(nodeP?.attributes?.['xu-exp:xu-text']) || !_.isEmpty(nodeP?.attributes?.['xu-exp:xu-html']))
|
|
12520
|
+
let ret = await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, temp_$container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $div, true);
|
|
12521
|
+
if (ret.abort || nodeP.tagName === 'svg' || !_.isEmpty(nodeP?.attributes?.['xu-text']) || !_.isEmpty(nodeP?.attributes?.['xu-html']) || !_.isEmpty(nodeP?.attributes?.['xu-exp:xu-text']) || !_.isEmpty(nodeP?.attributes?.['xu-exp:xu-html'])) {
|
|
12522
|
+
return await done();
|
|
12523
|
+
}
|
|
12507
12524
|
// check if iterator made to prevent children render
|
|
12508
12525
|
|
|
12509
12526
|
if (nodeP?.attributes?.['xu-viewport'] == 'true') {
|
|
@@ -12573,7 +12590,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12573
12590
|
// $div.html(UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]);
|
|
12574
12591
|
// } else {
|
|
12575
12592
|
hover_in($div);
|
|
12576
|
-
ui_job_id = func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'render_viewport', { $div, nodeP, parent_infoP, $root_container, paramsP, jobNoP, is_skeleton, keyP, refreshed_ds, parent_nodeP, check_existP, $container }, null, null, paramsP.dsSessionP);
|
|
12593
|
+
ui_job_id = func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'render_viewport', { $div, nodeP, parent_infoP, $root_container, paramsP, jobNoP, is_skeleton, keyP, refreshed_ds, parent_nodeP, check_existP, temp_$container }, null, null, paramsP.dsSessionP);
|
|
12577
12594
|
// }
|
|
12578
12595
|
observer_outViewport.observe($div[0]);
|
|
12579
12596
|
});
|
|
@@ -12597,11 +12614,19 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12597
12614
|
};
|
|
12598
12615
|
xu_viewport();
|
|
12599
12616
|
} else {
|
|
12600
|
-
|
|
12617
|
+
if (glb.new_xu_render) {
|
|
12618
|
+
if (ret.xu_render_in_process) {
|
|
12619
|
+
iterate_child($div, nodeP, parent_infoP, $root_container);
|
|
12620
|
+
} else {
|
|
12621
|
+
await iterate_child($div, nodeP, parent_infoP, $root_container);
|
|
12622
|
+
}
|
|
12623
|
+
} else {
|
|
12624
|
+
await iterate_child($div, nodeP, parent_infoP, $root_container);
|
|
12625
|
+
}
|
|
12601
12626
|
}
|
|
12602
12627
|
|
|
12603
12628
|
// const ret_iterate_child = await iterate_child($div, nodeP, parent_infoP, null, $root_container);
|
|
12604
|
-
return await done();
|
|
12629
|
+
return await done(ret);
|
|
12605
12630
|
};
|
|
12606
12631
|
|
|
12607
12632
|
if (nodeP.content && nodeP.attributes) {
|