@xuda.io/runtime-bundle 1.0.878 → 1.0.880
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 +14 -509
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +14 -509
- package/js/xuda-runtime-slim.min.es.js +14 -509
- package/js/xuda-runtime-slim.min.js +1 -1
- package/package.json +1 -1
package/js/xuda-runtime-slim.js
CHANGED
|
@@ -8459,43 +8459,19 @@ func.UI.worker.init = async function (SESSION_ID) {
|
|
|
8459
8459
|
break;
|
|
8460
8460
|
}
|
|
8461
8461
|
|
|
8462
|
-
// var _session = SESSION_OBJ[val.SESSION_ID];
|
|
8463
|
-
// if (!UI_WORKER_OBJ.jobs[Number(key)] || val.job_num === 9999999)
|
|
8464
|
-
// continue;
|
|
8465
|
-
|
|
8466
|
-
// if (val.dsSessionP && !_session.DS_GLB[val.dsSessionP]) {
|
|
8467
|
-
// func.UI.worker.delete_job(val.SESSION_ID, val.job_num);
|
|
8468
|
-
// continue;
|
|
8469
|
-
// }
|
|
8470
|
-
|
|
8471
|
-
// if (val?.elementP && !val.elementP.isInViewport()) {
|
|
8472
|
-
// continue;
|
|
8473
|
-
// }
|
|
8474
|
-
|
|
8475
8462
|
await func.UI.worker.execute(val.SESSION_ID, val);
|
|
8476
8463
|
// break;
|
|
8477
8464
|
} catch (err) {
|
|
8478
8465
|
console.error(err);
|
|
8479
8466
|
}
|
|
8480
8467
|
}
|
|
8481
|
-
// setTimeout(job_iterator, 1);
|
|
8482
8468
|
}
|
|
8483
8469
|
} else {
|
|
8484
8470
|
//busy
|
|
8485
8471
|
|
|
8486
8472
|
this.attempt++;
|
|
8487
8473
|
}
|
|
8488
|
-
// return job_iterator();
|
|
8489
|
-
// run_stat = 0;
|
|
8490
8474
|
};
|
|
8491
|
-
// job_iterator();
|
|
8492
|
-
// this._interval = setInterval(() => {
|
|
8493
|
-
// if (!run_stat) {
|
|
8494
|
-
// var testId = crypto.randomUUID();
|
|
8495
|
-
// run_stat = 1;
|
|
8496
|
-
// job_iterator(testId);
|
|
8497
|
-
// }
|
|
8498
|
-
// }, 10);
|
|
8499
8475
|
|
|
8500
8476
|
this._interval = setInterval(job_iterator, 1);
|
|
8501
8477
|
|
|
@@ -8768,24 +8744,8 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
|
|
|
8768
8744
|
for await (const [key, val] of Object.entries(nodeP.children)) {
|
|
8769
8745
|
const ret = await func.UI.screen.render_ui_tree(SESSION_ID, $div, nodeP.children[key], parent_infoP, paramsP, jobNoP, is_skeleton, Number(key), null, nodeP, null, $root_container);
|
|
8770
8746
|
}
|
|
8771
|
-
|
|
8772
|
-
// const parent_id = $div.parent().attr('xu-ui-id');
|
|
8773
|
-
// if (!UI_WORKER_OBJ.viewport_height_set_ids.includes(parent_id)) {
|
|
8774
|
-
// UI_WORKER_OBJ.viewport_height_set_ids.push(parent_id);
|
|
8775
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'set_viewport_height', { $elm: $div.parent(), height: $div.height() }, null, null, paramsP.dsSessionP);
|
|
8776
|
-
// }
|
|
8777
|
-
|
|
8778
|
-
// if ($div.hasClass('viewport_height')) {
|
|
8779
|
-
// $div.css('height', 'unset');
|
|
8780
|
-
// }
|
|
8781
|
-
|
|
8782
|
-
// const height = $div.data().xuData.viewport_height;
|
|
8783
|
-
// if (typeof height !== 'undefined') {
|
|
8784
|
-
// $div.css('height', 'unset');
|
|
8785
|
-
// } else {
|
|
8747
|
+
$div[0].style.removeProperty('height');
|
|
8786
8748
|
$div.data().xuData.viewport_height = $div.height();
|
|
8787
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'set_viewport_height', { $elm: $div.parent(), height: $div.height() }, null, null, paramsP.dsSessionP);
|
|
8788
|
-
// }
|
|
8789
8749
|
|
|
8790
8750
|
// set initial default height for all children
|
|
8791
8751
|
const parent_id = $div.parent().attr('xu-ui-id');
|
|
@@ -8800,12 +8760,9 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
|
|
|
8800
8760
|
set_viewport_height: async function () {
|
|
8801
8761
|
const { $div, height } = queue_obj?.paramsP || {};
|
|
8802
8762
|
|
|
8803
|
-
// $elm.data().xuData.viewport_height = $div.height();
|
|
8804
|
-
|
|
8805
8763
|
$.each($div.parent().children(), function (key, elm) {
|
|
8806
8764
|
if (!$(elm)[0].style.height && !$(elm).children().length) {
|
|
8807
|
-
$(elm).css('height', height);
|
|
8808
|
-
// $(elm).data().xuData.viewport_height = $div.height();
|
|
8765
|
+
$(elm).css('height', height);
|
|
8809
8766
|
}
|
|
8810
8767
|
});
|
|
8811
8768
|
|
|
@@ -11400,115 +11357,15 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
11400
11357
|
$rootFrame.css('display', 'contents');
|
|
11401
11358
|
}
|
|
11402
11359
|
|
|
11403
|
-
// ////////// skeleton
|
|
11404
|
-
|
|
11405
11360
|
var node = JSON.parse(JSON.stringify(screen_ret.progUi));
|
|
11406
11361
|
|
|
11407
|
-
// const change_tree_to_skeleton = (node) => {
|
|
11408
|
-
// var tags = ["input", "button", "li", "xu-panel"];
|
|
11409
|
-
// $.each(node.children, (key, val) => {
|
|
11410
|
-
// if (val.type !== "element") return true;
|
|
11411
|
-
|
|
11412
|
-
// if (val.attributes) {
|
|
11413
|
-
// delete val.attributes.placeholder;
|
|
11414
|
-
|
|
11415
|
-
// var class_skeleton = "";
|
|
11416
|
-
|
|
11417
|
-
// if (tags.includes(val.tagName) || !val.children.length) {
|
|
11418
|
-
// class_skeleton = "skeleton";
|
|
11419
|
-
// }
|
|
11420
|
-
// if (class_skeleton) {
|
|
11421
|
-
// if (val.attributes?.class) {
|
|
11422
|
-
// val.attributes.class += ` ${class_skeleton}`;
|
|
11423
|
-
// } else {
|
|
11424
|
-
// val.attributes.class = class_skeleton;
|
|
11425
|
-
// }
|
|
11426
|
-
// if (val.tagName === "xu-panel") {
|
|
11427
|
-
// val.tagName = "div";
|
|
11428
|
-
// val.attributes.class += " skeleton-panel";
|
|
11429
|
-
// }
|
|
11430
|
-
// }
|
|
11431
|
-
// change_tree_to_skeleton(val);
|
|
11432
|
-
// }
|
|
11433
|
-
// });
|
|
11434
|
-
// };
|
|
11435
|
-
// if (!is_panelP) {
|
|
11436
|
-
// change_tree_to_skeleton(node[0]);
|
|
11437
|
-
|
|
11438
|
-
// const $skeleton_wrapper = $("<div class='skeleton_wrapper'>");
|
|
11439
|
-
// const ret_skelton = await func.UI.screen.render_ui_tree(
|
|
11440
|
-
// SESSION_ID,
|
|
11441
|
-
// $skeleton_wrapper,
|
|
11442
|
-
// node[0].children[0],
|
|
11443
|
-
// {},
|
|
11444
|
-
// params,
|
|
11445
|
-
// jobNoP,
|
|
11446
|
-
// true,
|
|
11447
|
-
// 0,
|
|
11448
|
-
// null,
|
|
11449
|
-
// node,
|
|
11450
|
-
// null,
|
|
11451
|
-
// $rootFrame
|
|
11452
|
-
// );
|
|
11453
|
-
// $rootFrame.append($skeleton_wrapper);
|
|
11454
|
-
// }
|
|
11455
|
-
|
|
11456
|
-
// const activate_skeleton = () => {
|
|
11457
|
-
// let $parent_div = $(
|
|
11458
|
-
// `[xu-ui-id="${$callingContainerP_data?.xuData?.parent_element_ui_id}"]`
|
|
11459
|
-
// );
|
|
11460
|
-
// if (!$parent_div?.length) return;
|
|
11461
|
-
|
|
11462
|
-
// var tags = ["SPAN", "INPUT", "BUTTON", "LI", "XU-PANEL"];
|
|
11463
|
-
// $.each($($parent_div).find("*"), (key, val) => {
|
|
11464
|
-
// if (tags.includes($(val).prop("tagName")) || !$(val).children().length) {
|
|
11465
|
-
// $(val).addClass("skeleton");
|
|
11466
|
-
// }
|
|
11467
|
-
// if ($(val).prop("tagName") === "XU-PANEL") {
|
|
11468
|
-
// $(val).addClass("skeleton-panel");
|
|
11469
|
-
// }
|
|
11470
|
-
// if ($(val).prop("tagName") === "IMG") {
|
|
11471
|
-
// let src = func.common.get_url(
|
|
11472
|
-
// SESSION_ID,
|
|
11473
|
-
// "dist",
|
|
11474
|
-
// "runtime/images/skeleton-img.png"
|
|
11475
|
-
// );
|
|
11476
|
-
// $(val).attr("src", src);
|
|
11477
|
-
// }
|
|
11478
|
-
// });
|
|
11479
|
-
// };
|
|
11480
|
-
// if (is_panelP) {
|
|
11481
|
-
// activate_skeleton();
|
|
11482
|
-
// }
|
|
11483
|
-
// console.log("***");
|
|
11484
11362
|
func.UI.utils.indicator.screen.busy();
|
|
11485
11363
|
|
|
11486
|
-
const ret = await func.datasource.create(
|
|
11487
|
-
SESSION_ID,
|
|
11488
|
-
prog_id,
|
|
11489
|
-
refreshed_ds, //params?.callingDataSource_objP?.dsSession
|
|
11490
|
-
params.parentDataSourceNoP,
|
|
11491
|
-
$rootFrame.attr('id'),
|
|
11492
|
-
rowIdP,
|
|
11493
|
-
jobNoP,
|
|
11494
|
-
null,
|
|
11495
|
-
parameters_raw_obj,
|
|
11496
|
-
null,
|
|
11497
|
-
null,
|
|
11498
|
-
null,
|
|
11499
|
-
null,
|
|
11500
|
-
null,
|
|
11501
|
-
parameters_obj_inP,
|
|
11502
|
-
);
|
|
11364
|
+
const ret = await func.datasource.create(SESSION_ID, prog_id, refreshed_ds, params.parentDataSourceNoP, $rootFrame.attr('id'), rowIdP, jobNoP, null, parameters_raw_obj, null, null, null, null, null, parameters_obj_inP);
|
|
11503
11365
|
|
|
11504
11366
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[ret.dsSessionP];
|
|
11505
11367
|
_ds.screen_params = params;
|
|
11506
11368
|
|
|
11507
|
-
// _ds.is_panel = is_panelP;
|
|
11508
|
-
// setInterval(() => {
|
|
11509
|
-
// _ds.ts = Date.now();
|
|
11510
|
-
// }, 10000);
|
|
11511
|
-
|
|
11512
11369
|
params.dsSessionP = ret.dsSessionP;
|
|
11513
11370
|
|
|
11514
11371
|
func.UI.screen.update_SYS_OBJ_WIN_INFO(SESSION_ID, params.dsSessionP);
|
|
@@ -11990,23 +11847,8 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
11990
11847
|
if ($elm?.length) {
|
|
11991
11848
|
const elm_data = $elm.data();
|
|
11992
11849
|
const $wrapper = $elm.parent();
|
|
11993
|
-
// const wrapper_data = $wrapper.data();
|
|
11994
|
-
const refreshed_ds = _ds.dsSession;
|
|
11995
11850
|
|
|
11996
|
-
|
|
11997
|
-
// const ts = Date.now();
|
|
11998
|
-
// $.each($elm.find('xu-root-component-' + SESSION_ID).find('*'), function (key, val) {
|
|
11999
|
-
// let xu_ui_id = $(val).attr('xu-ui-id');
|
|
12000
|
-
// if (xu_ui_id) {
|
|
12001
|
-
// let new_id = xu_ui_id + ts;
|
|
12002
|
-
// elm_to_delete.push(new_id);
|
|
12003
|
-
|
|
12004
|
-
// $(val).attr('xu-ui-id', new_id).removeData();
|
|
12005
|
-
// }
|
|
12006
|
-
// // else {
|
|
12007
|
-
// // $(val).remove();
|
|
12008
|
-
// // }
|
|
12009
|
-
// });
|
|
11851
|
+
const refreshed_ds = _ds.dsSession;
|
|
12010
11852
|
|
|
12011
11853
|
$elm.empty();
|
|
12012
11854
|
if ($elm.data()) {
|
|
@@ -12025,11 +11867,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
12025
11867
|
elm_data.xuData.$root_container, // the wrapper root container
|
|
12026
11868
|
);
|
|
12027
11869
|
|
|
12028
|
-
// // remove old screen content
|
|
12029
|
-
// $.each(elm_to_delete, async function (key, val) {
|
|
12030
|
-
// $("[xu-ui-id='" + elm_to_delete + "']").remove();
|
|
12031
|
-
// });
|
|
12032
|
-
|
|
12033
11870
|
if (glb.DEBUG_MODE) {
|
|
12034
11871
|
console.info('========= refresh main info ==============');
|
|
12035
11872
|
console.info('reason:', refresh_reason);
|
|
@@ -12125,169 +11962,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
12125
11962
|
}
|
|
12126
11963
|
};
|
|
12127
11964
|
|
|
12128
|
-
// func.UI.screen.refresh_screen_old = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
12129
|
-
// // check the main program
|
|
12130
|
-
// if (fields_changed_datasource) {
|
|
12131
|
-
// const _session = SESSION_OBJ[SESSION_ID];
|
|
12132
|
-
// const _ds = _session.DS_GLB[fields_changed_datasource];
|
|
12133
|
-
// const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
12134
|
-
// const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
12135
|
-
// for (const field_id of fields_changed_arr || []) {
|
|
12136
|
-
// }
|
|
12137
|
-
// }
|
|
12138
|
-
|
|
12139
|
-
// const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
12140
|
-
|
|
12141
|
-
// for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
12142
|
-
// const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
12143
|
-
|
|
12144
|
-
// var found, refresh_reason, refresh_details;
|
|
12145
|
-
// if (fields_changed_arr) {
|
|
12146
|
-
// if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
12147
|
-
// continue;
|
|
12148
|
-
// }
|
|
12149
|
-
// for (const field_id of fields_changed_arr) {
|
|
12150
|
-
// // get panel attributes
|
|
12151
|
-
// const _attributes = panel_val?.panelXuAttributes || {};
|
|
12152
|
-
|
|
12153
|
-
// // detect if program changed
|
|
12154
|
-
// found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
12155
|
-
|
|
12156
|
-
// if (found) {
|
|
12157
|
-
// refresh_reason = `program ${_attributes['xu-exp:program']} ${field_id} changed `;
|
|
12158
|
-
// refresh_details = _attributes;
|
|
12159
|
-
// break;
|
|
12160
|
-
// }
|
|
12161
|
-
|
|
12162
|
-
// // _attributes holds also info of parameters in code_in: @code
|
|
12163
|
-
// // search field changed in panel call send parameters exp
|
|
12164
|
-
// for (const [attr, value] of Object.entries(_attributes)) {
|
|
12165
|
-
// const pattern = /xu-exp:(\w+)/;
|
|
12166
|
-
// const match = attr.match(pattern);
|
|
12167
|
-
|
|
12168
|
-
// if (!match) {
|
|
12169
|
-
// // continue if attribute is not expression
|
|
12170
|
-
// continue;
|
|
12171
|
-
// }
|
|
12172
|
-
// // code_in
|
|
12173
|
-
// const parameter_in_field_id = match?.[1];
|
|
12174
|
-
// // @code
|
|
12175
|
-
// if (value.includes(field_id)) {
|
|
12176
|
-
// // search parameter in field in the target program's progDataSource
|
|
12177
|
-
// found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
12178
|
-
|
|
12179
|
-
// if (found) {
|
|
12180
|
-
// refresh_reason = `field ${field_id} in progDataSource parameter_in changed`;
|
|
12181
|
-
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
12182
|
-
|
|
12183
|
-
// break;
|
|
12184
|
-
// }
|
|
12185
|
-
|
|
12186
|
-
// // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
|
|
12187
|
-
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
12188
|
-
|
|
12189
|
-
// if (found) {
|
|
12190
|
-
// refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
|
|
12191
|
-
// refresh_details = found;
|
|
12192
|
-
|
|
12193
|
-
// break;
|
|
12194
|
-
// }
|
|
12195
|
-
// }
|
|
12196
|
-
// }
|
|
12197
|
-
|
|
12198
|
-
// if (found) break;
|
|
12199
|
-
|
|
12200
|
-
// // search field changed in the target program's progDataSource // @code
|
|
12201
|
-
// found = progDataSource_str?.includes('@' + field_id);
|
|
12202
|
-
// if (found) {
|
|
12203
|
-
// refresh_reason = `field ${field_id} in progDataSource changed`;
|
|
12204
|
-
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
12205
|
-
|
|
12206
|
-
// break;
|
|
12207
|
-
// }
|
|
12208
|
-
|
|
12209
|
-
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, field_id, 'xu-for').length;
|
|
12210
|
-
// if (found) {
|
|
12211
|
-
// refresh_reason = `field ${field_id} in progUi xu-for changed`;
|
|
12212
|
-
// refresh_details = found;
|
|
12213
|
-
|
|
12214
|
-
// break;
|
|
12215
|
-
// }
|
|
12216
|
-
|
|
12217
|
-
// if (found) {
|
|
12218
|
-
// break;
|
|
12219
|
-
// }
|
|
12220
|
-
// }
|
|
12221
|
-
// }
|
|
12222
|
-
|
|
12223
|
-
// if (datasource_changed) {
|
|
12224
|
-
// if (panel_val._ds.dsSession == datasource_changed) {
|
|
12225
|
-
// refresh_reason = `panel datasource ${datasource_changed} changed`;
|
|
12226
|
-
// refresh_details = '';
|
|
12227
|
-
|
|
12228
|
-
// found = true;
|
|
12229
|
-
// }
|
|
12230
|
-
// }
|
|
12231
|
-
// if (found) {
|
|
12232
|
-
// const _session = SESSION_OBJ[SESSION_ID];
|
|
12233
|
-
// if (_session.engine_mode === 'live_preview') {
|
|
12234
|
-
// console.info('========= refresh info ==============');
|
|
12235
|
-
// console.info('reason:', refresh_reason);
|
|
12236
|
-
// console.info('details:', refresh_details);
|
|
12237
|
-
// console.info('panel:', panel_val);
|
|
12238
|
-
// console.info('=====================================');
|
|
12239
|
-
// }
|
|
12240
|
-
// const $div_elm = panel_val.$panel_div;
|
|
12241
|
-
// const wrapper_data = $div_elm.data();
|
|
12242
|
-
|
|
12243
|
-
// if (_.isEmpty(wrapper_data)) continue;
|
|
12244
|
-
|
|
12245
|
-
// try {
|
|
12246
|
-
// const ts = Date.now();
|
|
12247
|
-
// // remove old panel content
|
|
12248
|
-
// $.each(panel_val.ids, async function (key, val) {
|
|
12249
|
-
// $("[xu-ui-id='" + val + "']")
|
|
12250
|
-
// .attr('xu-ui-id', val + ts)
|
|
12251
|
-
// .removeData();
|
|
12252
|
-
// });
|
|
12253
|
-
|
|
12254
|
-
// let refreshed_ds;
|
|
12255
|
-
// // check if ds exist and deleted by garbage collector
|
|
12256
|
-
|
|
12257
|
-
// if (_session.DS_GLB[panel_val._ds.dsSession]) {
|
|
12258
|
-
// refreshed_ds = panel_val._ds.dsSession;
|
|
12259
|
-
// }
|
|
12260
|
-
// for await (const item of wrapper_data.xuData.node_org.children) {
|
|
12261
|
-
// if (item.tagName !== 'xu-panel') continue;
|
|
12262
|
-
|
|
12263
|
-
// const new_$div = await func.UI.screen.render_ui_tree(
|
|
12264
|
-
// SESSION_ID,
|
|
12265
|
-
// $div_elm, // the wrapper
|
|
12266
|
-
// _.cloneDeep(item), // _.cloneDeep(wrapper_data.xuData.node_org.children[0]), // the xu-panel node
|
|
12267
|
-
// {},
|
|
12268
|
-
// wrapper_data.xuData.paramsP, // the wrapper params
|
|
12269
|
-
// null,
|
|
12270
|
-
// null,
|
|
12271
|
-
// wrapper_data.xuData.key, // the wrapper key
|
|
12272
|
-
// refreshed_ds, // the refreshed_ds
|
|
12273
|
-
// wrapper_data.xuData.parent_node, // the wrapper parent node
|
|
12274
|
-
// null,
|
|
12275
|
-
// wrapper_data.xuData.$root_container, // the wrapper root container
|
|
12276
|
-
// );
|
|
12277
|
-
// }
|
|
12278
|
-
|
|
12279
|
-
// // remove old panel content
|
|
12280
|
-
// $.each(panel_val.ids, async function (key, val) {
|
|
12281
|
-
// $("[xu-ui-id='" + val + ts + "']").remove();
|
|
12282
|
-
// });
|
|
12283
|
-
// } catch (error) {
|
|
12284
|
-
// debugger;
|
|
12285
|
-
// }
|
|
12286
|
-
// // continue;
|
|
12287
|
-
// }
|
|
12288
|
-
// }
|
|
12289
|
-
// };
|
|
12290
|
-
|
|
12291
11965
|
const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession) {
|
|
12292
11966
|
const _prog = await func.utils.VIEWS_OBJ.get(SESSION_ID, prog_id);
|
|
12293
11967
|
if (!_prog) return;
|
|
@@ -12588,31 +12262,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12588
12262
|
return field_id;
|
|
12589
12263
|
};
|
|
12590
12264
|
|
|
12591
|
-
// try {
|
|
12592
|
-
// bind_field_id = await get_bind_field(val.value);
|
|
12593
|
-
// val_is_reference_field = true;
|
|
12594
|
-
// } catch (err) {
|
|
12595
|
-
// try {
|
|
12596
|
-
// if (!_.isEmpty($elm?.data()?.xuAttributes?.['xu-exp:xu-bind'])) {
|
|
12597
|
-
// bind_field_exp = $elm.data().xuAttributes['xu-exp:xu-bind'];
|
|
12598
|
-
// const res = await func.expression.get(SESSION_ID, bind_field_exp, paramsP.dsSessionP, 'UI Attr EXP');
|
|
12599
|
-
|
|
12600
|
-
// if (Object.keys(res.fields).length) {
|
|
12601
|
-
// const field_id_from_exp = Object.keys(res.fields)[0];
|
|
12602
|
-
// bind_field_id = await get_bind_field(field_id_from_exp);
|
|
12603
|
-
// } else {
|
|
12604
|
-
// throw err?.message || err;
|
|
12605
|
-
// }
|
|
12606
|
-
// } else {
|
|
12607
|
-
// throw err?.message || err;
|
|
12608
|
-
// }
|
|
12609
|
-
// } catch (err) {
|
|
12610
|
-
// console.error(err?.message || err);
|
|
12611
|
-
// return {};
|
|
12612
|
-
// }
|
|
12613
|
-
// // return {};
|
|
12614
|
-
// }
|
|
12615
|
-
|
|
12616
12265
|
try {
|
|
12617
12266
|
bind_field_id = await get_bind_field(val.value.split('.')[0]);
|
|
12618
12267
|
val_is_reference_field = true;
|
|
@@ -12665,10 +12314,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12665
12314
|
|
|
12666
12315
|
var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
|
|
12667
12316
|
|
|
12668
|
-
// if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {
|
|
12669
|
-
// value = bind.getter($elm[0]);
|
|
12670
|
-
// }
|
|
12671
|
-
|
|
12672
12317
|
if (field_prop.props.fieldType === 'object') {
|
|
12673
12318
|
value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', input_field_type, bind.getter($elm[0]));
|
|
12674
12319
|
}
|
|
@@ -12690,14 +12335,13 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12690
12335
|
if (reference_source_obj.ret.type === 'array') {
|
|
12691
12336
|
if (iterate_info.iterator_val === bind_field_id) {
|
|
12692
12337
|
const arr_idx = Number($elm?.data()?.xuData?.iterate_info._key);
|
|
12693
|
-
|
|
12338
|
+
|
|
12694
12339
|
const dataset_arr = await func.datasource.get_value(SESSION_ID, reference_source_obj.fieldIdP, _dsP, reference_source_obj.currentRecordId);
|
|
12695
12340
|
let new_arr = _.cloneDeep(dataset_arr.ret.value);
|
|
12696
|
-
|
|
12341
|
+
|
|
12697
12342
|
if (field_prop.props.fieldType === 'object' && val_is_reference_field) {
|
|
12698
12343
|
let obj_item = new_arr[arr_idx];
|
|
12699
|
-
|
|
12700
|
-
// let new_val = eval(e_exp + `="${value}"`);
|
|
12344
|
+
|
|
12701
12345
|
let e_exp = val.value.replace(bind_field_id, 'obj_item');
|
|
12702
12346
|
|
|
12703
12347
|
let new_val = eval(e_exp + (input_field_type === 'string' ? `="${value}"` : `=${value}`));
|
|
@@ -12715,7 +12359,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12715
12359
|
},
|
|
12716
12360
|
},
|
|
12717
12361
|
};
|
|
12718
|
-
|
|
12362
|
+
|
|
12719
12363
|
await func.datasource.update(SESSION_ID, datasource_changes, null, true);
|
|
12720
12364
|
}
|
|
12721
12365
|
}
|
|
@@ -12769,7 +12413,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12769
12413
|
$('body').on('xu-bind-refresh.' + _ds.dsSession.toString(), () => {
|
|
12770
12414
|
set_value();
|
|
12771
12415
|
});
|
|
12772
|
-
|
|
12416
|
+
|
|
12773
12417
|
set_value();
|
|
12774
12418
|
return {};
|
|
12775
12419
|
},
|
|
@@ -14820,10 +14464,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14820
14464
|
function (entries) {
|
|
14821
14465
|
entries.forEach((entry) => {
|
|
14822
14466
|
if (entry.isIntersecting) {
|
|
14823
|
-
// Element is in viewport - trigger custom event
|
|
14824
|
-
// console.log('trigger>>', 'inViewport_' + $(entry.target).attr('xu-ui-id'));
|
|
14825
|
-
|
|
14826
|
-
// $(entry.target).trigger('inViewport_' + $(entry.target).attr('xu-ui-id'));
|
|
14827
14467
|
$(entry.target).trigger('inViewport');
|
|
14828
14468
|
|
|
14829
14469
|
// Optional: stop observing once triggered
|
|
@@ -14853,33 +14493,27 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14853
14493
|
},
|
|
14854
14494
|
);
|
|
14855
14495
|
|
|
14856
|
-
|
|
14857
|
-
// $div.css(height, $div.parent().data().xuData.viewport_elm_height);
|
|
14858
|
-
// }
|
|
14859
|
-
|
|
14496
|
+
let ui_job_id;
|
|
14860
14497
|
$div.on('inViewport', function () {
|
|
14861
14498
|
if ($div.children().length) {
|
|
14862
14499
|
$div.removeClass('skeleton');
|
|
14863
14500
|
return;
|
|
14864
14501
|
}
|
|
14865
14502
|
|
|
14866
|
-
// const height = $div.data().xuData.viewport_height;
|
|
14867
|
-
// if (typeof height !== 'undefined') {
|
|
14868
|
-
// $div.css('height', 'unset');
|
|
14869
|
-
$div[0].style.removeProperty('height');
|
|
14870
|
-
// }
|
|
14871
|
-
|
|
14872
14503
|
if (UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]) {
|
|
14504
|
+
$div[0].style.removeProperty('height');
|
|
14873
14505
|
$div.removeClass('skeleton');
|
|
14874
14506
|
$div.html(UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]);
|
|
14875
14507
|
} else {
|
|
14876
14508
|
hover_in($div);
|
|
14877
|
-
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);
|
|
14509
|
+
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);
|
|
14878
14510
|
}
|
|
14879
14511
|
observer_outViewport.observe($div[0]);
|
|
14880
14512
|
});
|
|
14881
14513
|
|
|
14882
14514
|
$div.on('outViewport', function () {
|
|
14515
|
+
func.UI.worker.delete_job(SESSION_ID, ui_job_id);
|
|
14516
|
+
|
|
14883
14517
|
if ($div.children().length) {
|
|
14884
14518
|
UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')] = $div.children().clone(true);
|
|
14885
14519
|
$div.empty();
|
|
@@ -14938,13 +14572,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
14938
14572
|
try {
|
|
14939
14573
|
// disabled in purpose to support create row
|
|
14940
14574
|
|
|
14941
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, doc_change.row_id);
|
|
14942
|
-
|
|
14943
|
-
// console.log(
|
|
14944
|
-
// "refresh_document_changes_for_realtime_update",
|
|
14945
|
-
// _ds.data_feed.rows[row_idx]
|
|
14946
|
-
// );
|
|
14947
|
-
|
|
14948
14575
|
if (!_ds.screen_params) continue;
|
|
14949
14576
|
if (_ds.screen_params.is_panelP) {
|
|
14950
14577
|
func.UI.screen.refresh_screen(SESSION_ID, null, key);
|
|
@@ -14957,128 +14584,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
14957
14584
|
}
|
|
14958
14585
|
}
|
|
14959
14586
|
};
|
|
14960
|
-
|
|
14961
|
-
// func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
|
|
14962
|
-
// if (is_skeleton || EXP_BUSY) return;
|
|
14963
|
-
|
|
14964
|
-
// var _session = SESSION_OBJ[SESSION_ID];
|
|
14965
|
-
// var _ds = _session.DS_GLB[paramsP.dsSessionP];
|
|
14966
|
-
|
|
14967
|
-
// const _$ = function ($elm) {
|
|
14968
|
-
// try {
|
|
14969
|
-
// const id = $elm.attr('xu-ui-id');
|
|
14970
|
-
// if (!id) return $elm;
|
|
14971
|
-
// const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
|
|
14972
|
-
|
|
14973
|
-
// if ($el.length > 1) {
|
|
14974
|
-
// console.warn('Multiple elements for xu-ui-id: ' + id, $el);
|
|
14975
|
-
// }
|
|
14976
|
-
|
|
14977
|
-
// return $($el[0]);
|
|
14978
|
-
// } catch (e) {
|
|
14979
|
-
// console.error(e);
|
|
14980
|
-
// }
|
|
14981
|
-
// };
|
|
14982
|
-
|
|
14983
|
-
// CLIENT_ACTIVITY_TS = Date.now();
|
|
14984
|
-
// if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
|
|
14985
|
-
// if (!_ds) return;
|
|
14986
|
-
// ///////// SET Attributes///////////
|
|
14987
|
-
// let attributes = {};
|
|
14988
|
-
// $.each($div[0].attributes, function (index, attr) {
|
|
14989
|
-
// attributes[attr.name] = attr.value;
|
|
14990
|
-
// });
|
|
14991
|
-
|
|
14992
|
-
// SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
|
|
14993
|
-
// //////////////////////////////////
|
|
14994
|
-
// if (!$div.data()?.xuData) return;
|
|
14995
|
-
// const _iterate_info = $div.data().xuData.iterate_info;
|
|
14996
|
-
// if (_iterate_info) {
|
|
14997
|
-
// if (_iterate_info.is_key_dynamic_field) {
|
|
14998
|
-
// _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
|
|
14999
|
-
// } else {
|
|
15000
|
-
// try {
|
|
15001
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
15002
|
-
// _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
|
|
15003
|
-
// } catch (err) {
|
|
15004
|
-
// console.error(err);
|
|
15005
|
-
// }
|
|
15006
|
-
// }
|
|
15007
|
-
|
|
15008
|
-
// if (_iterate_info.is_val_dynamic_field) {
|
|
15009
|
-
// _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
|
|
15010
|
-
// } else {
|
|
15011
|
-
// try {
|
|
15012
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
15013
|
-
// _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
|
|
15014
|
-
// } catch (err) {
|
|
15015
|
-
// console.error(err);
|
|
15016
|
-
// }
|
|
15017
|
-
// }
|
|
15018
|
-
// }
|
|
15019
|
-
|
|
15020
|
-
// if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
|
|
15021
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
|
|
15022
|
-
// }
|
|
15023
|
-
|
|
15024
|
-
// const set_value = function (field_id, value) {
|
|
15025
|
-
// var currentRecordId = _$($div).data().xuData.currentRecordId;
|
|
15026
|
-
|
|
15027
|
-
// func.UI.worker.add_to_queue(
|
|
15028
|
-
// SESSION_ID,
|
|
15029
|
-
// 'gui event',
|
|
15030
|
-
// 'update_datasource',
|
|
15031
|
-
// {
|
|
15032
|
-
// currentRecordId,
|
|
15033
|
-
// field_id,
|
|
15034
|
-
// field_value: value,
|
|
15035
|
-
// },
|
|
15036
|
-
// null,
|
|
15037
|
-
// null,
|
|
15038
|
-
// paramsP.dsSessionP,
|
|
15039
|
-
// );
|
|
15040
|
-
// };
|
|
15041
|
-
|
|
15042
|
-
// if ($div?.data()?.iterate_info) {
|
|
15043
|
-
// var data = $div.data().xuData.iterate_info;
|
|
15044
|
-
// if (data.iterator_key) {
|
|
15045
|
-
// set_value(data.iterator_key, data._key);
|
|
15046
|
-
// }
|
|
15047
|
-
// if (data.iterator_val) {
|
|
15048
|
-
// set_value(data.iterator_val, data._val);
|
|
15049
|
-
// }
|
|
15050
|
-
// }
|
|
15051
|
-
// };
|
|
15052
|
-
// func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
|
|
15053
|
-
// if (is_skeleton || EXP_BUSY) return;
|
|
15054
|
-
|
|
15055
|
-
// var _session = SESSION_OBJ[SESSION_ID];
|
|
15056
|
-
// var _ds = _session.DS_GLB[paramsP.dsSessionP];
|
|
15057
|
-
|
|
15058
|
-
// const _$ = function ($elm) {
|
|
15059
|
-
// try {
|
|
15060
|
-
// const id = $elm.attr('xu-ui-id');
|
|
15061
|
-
// if (!id) return $elm;
|
|
15062
|
-
// const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
|
|
15063
|
-
|
|
15064
|
-
// if ($el.length > 1) {
|
|
15065
|
-
// console.warn('Multiple elements for xu-ui-id: ' + id, $el);
|
|
15066
|
-
// }
|
|
15067
|
-
|
|
15068
|
-
// return $($el[0]);
|
|
15069
|
-
// } catch (e) {
|
|
15070
|
-
// console.error(e);
|
|
15071
|
-
// }
|
|
15072
|
-
// };
|
|
15073
|
-
|
|
15074
|
-
// CLIENT_ACTIVITY_TS = Date.now();
|
|
15075
|
-
// if (_$($container)?.data()?.xuData?.debug_info) {
|
|
15076
|
-
// _$($container).data().xuData.debug_info.hover_item = null;
|
|
15077
|
-
// }
|
|
15078
|
-
// if (_ds?.data_system) {
|
|
15079
|
-
// SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
|
|
15080
|
-
// }
|
|
15081
|
-
// };
|
|
15082
14587
|
func.UI.component = {};
|
|
15083
14588
|
|
|
15084
14589
|
func.UI.component.create_app_modal_component = function (
|