@xuda.io/runtime-bundle 1.0.879 → 1.0.881
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 +22 -543
- package/js/xuda-runtime-bundle.min.js +3 -3
- package/js/xuda-runtime-slim.js +22 -543
- package/js/xuda-runtime-slim.min.es.js +22 -543
- package/js/xuda-runtime-slim.min.js +3 -3
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +9 -28
- package/js/xuda-worker-bundle.js +9 -28
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
package/js/xuda-runtime-slim.js
CHANGED
|
@@ -5710,7 +5710,7 @@ func.datasource.update_changes_for_out_parameter = async function (SESSION_ID, d
|
|
|
5710
5710
|
let _session = SESSION_OBJ[SESSION_ID];
|
|
5711
5711
|
let _ds = _session.DS_GLB[dsSessionP];
|
|
5712
5712
|
const _calling_ds = _session.DS_GLB[calling_dsP];
|
|
5713
|
-
|
|
5713
|
+
|
|
5714
5714
|
if (_ds.PARAM_OUT_INFO) {
|
|
5715
5715
|
let data = {};
|
|
5716
5716
|
for await (const [key, val] of Object.entries(_ds.PARAM_OUT_INFO)) {
|
|
@@ -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
|
|
|
@@ -9854,10 +9811,9 @@ func.events.execute = async function (
|
|
|
9854
9811
|
return;
|
|
9855
9812
|
}
|
|
9856
9813
|
|
|
9857
|
-
// args.prog_id = _viewId;
|
|
9858
9814
|
if (_ds) {
|
|
9859
9815
|
func.utils.debug.watch(SESSION_ID, calling_trigger_prop?.id, functionP, null, calling_trigger_prop, expCond);
|
|
9860
|
-
|
|
9816
|
+
|
|
9861
9817
|
const ret = await func.datasource.create(SESSION_ID, await get_prog_id(), args.dataSourceNoP, args.parentDataSourceNoP, args.containerIdP, args.rowIdP, args.jobNoP, args.calling_trigger_prop, null, null, args.callingSourceP, args.calling_jobP, args.screen_dsP, args.is_panelP, params_obj);
|
|
9862
9818
|
|
|
9863
9819
|
let _ds_new = _session.DS_GLB[ret.dsSessionP];
|
|
@@ -9865,31 +9821,6 @@ func.events.execute = async function (
|
|
|
9865
9821
|
if (parameters && !_.isEmpty(parameters)) {
|
|
9866
9822
|
await func.datasource.update_changes_for_out_parameter(SESSION_ID, _ds_new.dsSession, _ds.dsSession);
|
|
9867
9823
|
}
|
|
9868
|
-
// if (parameters && !_.isEmpty(parameters) && _ds_new.PARAM_OUT_INFO) {
|
|
9869
|
-
// let data = {};
|
|
9870
|
-
// for await (const [key, val] of Object.entries(
|
|
9871
|
-
// _ds_new.PARAM_OUT_INFO
|
|
9872
|
-
// )) {
|
|
9873
|
-
// if (val.prop === "out") {
|
|
9874
|
-
// try {
|
|
9875
|
-
// const row_idx = func.common.find_ROWID_idx(
|
|
9876
|
-
// _ds_new,
|
|
9877
|
-
// _ds_new.currentRecordId
|
|
9878
|
-
// );
|
|
9879
|
-
// data[val.details] =
|
|
9880
|
-
// _ds_new.data_feed.rows[row_idx][val.fieldId];
|
|
9881
|
-
// } catch (err) {
|
|
9882
|
-
// console.error(err);
|
|
9883
|
-
// }
|
|
9884
|
-
// }
|
|
9885
|
-
// }
|
|
9886
|
-
// if (!_.isEmpty(data)) {
|
|
9887
|
-
// let datasource_changes = {
|
|
9888
|
-
// [_ds.dsSession]: { [_ds.currentRecordId]: data },
|
|
9889
|
-
// };
|
|
9890
|
-
// await func.datasource.update(SESSION_ID, datasource_changes);
|
|
9891
|
-
// }
|
|
9892
|
-
// }
|
|
9893
9824
|
|
|
9894
9825
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
9895
9826
|
return _ds_new;
|
|
@@ -9944,6 +9875,13 @@ func.events.execute = async function (
|
|
|
9944
9875
|
}
|
|
9945
9876
|
|
|
9946
9877
|
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
9878
|
+
|
|
9879
|
+
if (_ds.PARAM_OUT_INFO) {
|
|
9880
|
+
for await (const [dsSession_to_update, val] of Object.entries(datasource_changes)) {
|
|
9881
|
+
await func.datasource.update_changes_for_out_parameter(SESSION_ID, _ds.dsSession, dsSession_to_update);
|
|
9882
|
+
}
|
|
9883
|
+
}
|
|
9884
|
+
|
|
9947
9885
|
if (jobNoP) func.events.delete_job(SESSION_ID, jobNoP);
|
|
9948
9886
|
// return changes;
|
|
9949
9887
|
},
|
|
@@ -11400,115 +11338,15 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
11400
11338
|
$rootFrame.css('display', 'contents');
|
|
11401
11339
|
}
|
|
11402
11340
|
|
|
11403
|
-
// ////////// skeleton
|
|
11404
|
-
|
|
11405
11341
|
var node = JSON.parse(JSON.stringify(screen_ret.progUi));
|
|
11406
11342
|
|
|
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
11343
|
func.UI.utils.indicator.screen.busy();
|
|
11485
11344
|
|
|
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
|
-
);
|
|
11345
|
+
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
11346
|
|
|
11504
11347
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[ret.dsSessionP];
|
|
11505
11348
|
_ds.screen_params = params;
|
|
11506
11349
|
|
|
11507
|
-
// _ds.is_panel = is_panelP;
|
|
11508
|
-
// setInterval(() => {
|
|
11509
|
-
// _ds.ts = Date.now();
|
|
11510
|
-
// }, 10000);
|
|
11511
|
-
|
|
11512
11350
|
params.dsSessionP = ret.dsSessionP;
|
|
11513
11351
|
|
|
11514
11352
|
func.UI.screen.update_SYS_OBJ_WIN_INFO(SESSION_ID, params.dsSessionP);
|
|
@@ -11990,23 +11828,8 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
11990
11828
|
if ($elm?.length) {
|
|
11991
11829
|
const elm_data = $elm.data();
|
|
11992
11830
|
const $wrapper = $elm.parent();
|
|
11993
|
-
// const wrapper_data = $wrapper.data();
|
|
11994
|
-
const refreshed_ds = _ds.dsSession;
|
|
11995
|
-
|
|
11996
|
-
// let elm_to_delete = [];
|
|
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
11831
|
|
|
12004
|
-
|
|
12005
|
-
// }
|
|
12006
|
-
// // else {
|
|
12007
|
-
// // $(val).remove();
|
|
12008
|
-
// // }
|
|
12009
|
-
// });
|
|
11832
|
+
const refreshed_ds = _ds.dsSession;
|
|
12010
11833
|
|
|
12011
11834
|
$elm.empty();
|
|
12012
11835
|
if ($elm.data()) {
|
|
@@ -12025,11 +11848,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
12025
11848
|
elm_data.xuData.$root_container, // the wrapper root container
|
|
12026
11849
|
);
|
|
12027
11850
|
|
|
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
11851
|
if (glb.DEBUG_MODE) {
|
|
12034
11852
|
console.info('========= refresh main info ==============');
|
|
12035
11853
|
console.info('reason:', refresh_reason);
|
|
@@ -12125,169 +11943,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
12125
11943
|
}
|
|
12126
11944
|
};
|
|
12127
11945
|
|
|
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
11946
|
const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession) {
|
|
12292
11947
|
const _prog = await func.utils.VIEWS_OBJ.get(SESSION_ID, prog_id);
|
|
12293
11948
|
if (!_prog) return;
|
|
@@ -12555,7 +12210,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12555
12210
|
let is_dynamic_field = false;
|
|
12556
12211
|
let field_prop;
|
|
12557
12212
|
let bind_field_id;
|
|
12558
|
-
|
|
12213
|
+
|
|
12559
12214
|
const input_field_type = $elm.attr('type');
|
|
12560
12215
|
|
|
12561
12216
|
const get_bind_field = async function (field_id) {
|
|
@@ -12566,11 +12221,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12566
12221
|
field_prop = func.common.find_item_by_key(view_ret.progFields, 'field_id', field_id);
|
|
12567
12222
|
if (!field_prop) {
|
|
12568
12223
|
/// find the field everywhere in the chain Aug 30 2024
|
|
12569
|
-
const ret_get_value = await func.datasource.get_value(
|
|
12570
|
-
SESSION_ID,
|
|
12571
|
-
field_id,
|
|
12572
|
-
_dsP, // $elm.data().xuData.paramsP.dsSessionP
|
|
12573
|
-
);
|
|
12224
|
+
const ret_get_value = await func.datasource.get_value(SESSION_ID, field_id, _dsP);
|
|
12574
12225
|
|
|
12575
12226
|
if (ret_get_value.found) {
|
|
12576
12227
|
_dsP = ret_get_value.dsSessionP;
|
|
@@ -12588,38 +12239,12 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12588
12239
|
return field_id;
|
|
12589
12240
|
};
|
|
12590
12241
|
|
|
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
12242
|
try {
|
|
12617
12243
|
bind_field_id = await get_bind_field(val.value.split('.')[0]);
|
|
12618
12244
|
val_is_reference_field = true;
|
|
12619
12245
|
} catch (err) {
|
|
12620
12246
|
console.error(err?.message || err);
|
|
12621
12247
|
return {};
|
|
12622
|
-
// return {};
|
|
12623
12248
|
}
|
|
12624
12249
|
|
|
12625
12250
|
const field_changed = async function (e) {
|
|
@@ -12665,10 +12290,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12665
12290
|
|
|
12666
12291
|
var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
|
|
12667
12292
|
|
|
12668
|
-
// if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {
|
|
12669
|
-
// value = bind.getter($elm[0]);
|
|
12670
|
-
// }
|
|
12671
|
-
|
|
12672
12293
|
if (field_prop.props.fieldType === 'object') {
|
|
12673
12294
|
value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', input_field_type, bind.getter($elm[0]));
|
|
12674
12295
|
}
|
|
@@ -12690,14 +12311,13 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12690
12311
|
if (reference_source_obj.ret.type === 'array') {
|
|
12691
12312
|
if (iterate_info.iterator_val === bind_field_id) {
|
|
12692
12313
|
const arr_idx = Number($elm?.data()?.xuData?.iterate_info._key);
|
|
12693
|
-
|
|
12314
|
+
|
|
12694
12315
|
const dataset_arr = await func.datasource.get_value(SESSION_ID, reference_source_obj.fieldIdP, _dsP, reference_source_obj.currentRecordId);
|
|
12695
12316
|
let new_arr = _.cloneDeep(dataset_arr.ret.value);
|
|
12696
|
-
|
|
12317
|
+
|
|
12697
12318
|
if (field_prop.props.fieldType === 'object' && val_is_reference_field) {
|
|
12698
12319
|
let obj_item = new_arr[arr_idx];
|
|
12699
|
-
|
|
12700
|
-
// let new_val = eval(e_exp + `="${value}"`);
|
|
12320
|
+
|
|
12701
12321
|
let e_exp = val.value.replace(bind_field_id, 'obj_item');
|
|
12702
12322
|
|
|
12703
12323
|
let new_val = eval(e_exp + (input_field_type === 'string' ? `="${value}"` : `=${value}`));
|
|
@@ -12715,7 +12335,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12715
12335
|
},
|
|
12716
12336
|
},
|
|
12717
12337
|
};
|
|
12718
|
-
|
|
12338
|
+
|
|
12719
12339
|
await func.datasource.update(SESSION_ID, datasource_changes, null, true);
|
|
12720
12340
|
}
|
|
12721
12341
|
}
|
|
@@ -12769,7 +12389,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12769
12389
|
$('body').on('xu-bind-refresh.' + _ds.dsSession.toString(), () => {
|
|
12770
12390
|
set_value();
|
|
12771
12391
|
});
|
|
12772
|
-
|
|
12392
|
+
|
|
12773
12393
|
set_value();
|
|
12774
12394
|
return {};
|
|
12775
12395
|
},
|
|
@@ -14820,10 +14440,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14820
14440
|
function (entries) {
|
|
14821
14441
|
entries.forEach((entry) => {
|
|
14822
14442
|
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
14443
|
$(entry.target).trigger('inViewport');
|
|
14828
14444
|
|
|
14829
14445
|
// Optional: stop observing once triggered
|
|
@@ -14853,9 +14469,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14853
14469
|
},
|
|
14854
14470
|
);
|
|
14855
14471
|
|
|
14856
|
-
// if ($div.parent().data().xuData.viewport_elm_height) {
|
|
14857
|
-
// $div.css(height, $div.parent().data().xuData.viewport_elm_height);
|
|
14858
|
-
// }
|
|
14859
14472
|
let ui_job_id;
|
|
14860
14473
|
$div.on('inViewport', function () {
|
|
14861
14474
|
if ($div.children().length) {
|
|
@@ -14863,13 +14476,8 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14863
14476
|
return;
|
|
14864
14477
|
}
|
|
14865
14478
|
|
|
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
14479
|
if (UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]) {
|
|
14480
|
+
$div[0].style.removeProperty('height');
|
|
14873
14481
|
$div.removeClass('skeleton');
|
|
14874
14482
|
$div.html(UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]);
|
|
14875
14483
|
} else {
|
|
@@ -14940,13 +14548,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
14940
14548
|
try {
|
|
14941
14549
|
// disabled in purpose to support create row
|
|
14942
14550
|
|
|
14943
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, doc_change.row_id);
|
|
14944
|
-
|
|
14945
|
-
// console.log(
|
|
14946
|
-
// "refresh_document_changes_for_realtime_update",
|
|
14947
|
-
// _ds.data_feed.rows[row_idx]
|
|
14948
|
-
// );
|
|
14949
|
-
|
|
14950
14551
|
if (!_ds.screen_params) continue;
|
|
14951
14552
|
if (_ds.screen_params.is_panelP) {
|
|
14952
14553
|
func.UI.screen.refresh_screen(SESSION_ID, null, key);
|
|
@@ -14959,128 +14560,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
14959
14560
|
}
|
|
14960
14561
|
}
|
|
14961
14562
|
};
|
|
14962
|
-
|
|
14963
|
-
// func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
|
|
14964
|
-
// if (is_skeleton || EXP_BUSY) return;
|
|
14965
|
-
|
|
14966
|
-
// var _session = SESSION_OBJ[SESSION_ID];
|
|
14967
|
-
// var _ds = _session.DS_GLB[paramsP.dsSessionP];
|
|
14968
|
-
|
|
14969
|
-
// const _$ = function ($elm) {
|
|
14970
|
-
// try {
|
|
14971
|
-
// const id = $elm.attr('xu-ui-id');
|
|
14972
|
-
// if (!id) return $elm;
|
|
14973
|
-
// const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
|
|
14974
|
-
|
|
14975
|
-
// if ($el.length > 1) {
|
|
14976
|
-
// console.warn('Multiple elements for xu-ui-id: ' + id, $el);
|
|
14977
|
-
// }
|
|
14978
|
-
|
|
14979
|
-
// return $($el[0]);
|
|
14980
|
-
// } catch (e) {
|
|
14981
|
-
// console.error(e);
|
|
14982
|
-
// }
|
|
14983
|
-
// };
|
|
14984
|
-
|
|
14985
|
-
// CLIENT_ACTIVITY_TS = Date.now();
|
|
14986
|
-
// if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
|
|
14987
|
-
// if (!_ds) return;
|
|
14988
|
-
// ///////// SET Attributes///////////
|
|
14989
|
-
// let attributes = {};
|
|
14990
|
-
// $.each($div[0].attributes, function (index, attr) {
|
|
14991
|
-
// attributes[attr.name] = attr.value;
|
|
14992
|
-
// });
|
|
14993
|
-
|
|
14994
|
-
// SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
|
|
14995
|
-
// //////////////////////////////////
|
|
14996
|
-
// if (!$div.data()?.xuData) return;
|
|
14997
|
-
// const _iterate_info = $div.data().xuData.iterate_info;
|
|
14998
|
-
// if (_iterate_info) {
|
|
14999
|
-
// if (_iterate_info.is_key_dynamic_field) {
|
|
15000
|
-
// _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
|
|
15001
|
-
// } else {
|
|
15002
|
-
// try {
|
|
15003
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
15004
|
-
// _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
|
|
15005
|
-
// } catch (err) {
|
|
15006
|
-
// console.error(err);
|
|
15007
|
-
// }
|
|
15008
|
-
// }
|
|
15009
|
-
|
|
15010
|
-
// if (_iterate_info.is_val_dynamic_field) {
|
|
15011
|
-
// _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
|
|
15012
|
-
// } else {
|
|
15013
|
-
// try {
|
|
15014
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
15015
|
-
// _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
|
|
15016
|
-
// } catch (err) {
|
|
15017
|
-
// console.error(err);
|
|
15018
|
-
// }
|
|
15019
|
-
// }
|
|
15020
|
-
// }
|
|
15021
|
-
|
|
15022
|
-
// if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
|
|
15023
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
|
|
15024
|
-
// }
|
|
15025
|
-
|
|
15026
|
-
// const set_value = function (field_id, value) {
|
|
15027
|
-
// var currentRecordId = _$($div).data().xuData.currentRecordId;
|
|
15028
|
-
|
|
15029
|
-
// func.UI.worker.add_to_queue(
|
|
15030
|
-
// SESSION_ID,
|
|
15031
|
-
// 'gui event',
|
|
15032
|
-
// 'update_datasource',
|
|
15033
|
-
// {
|
|
15034
|
-
// currentRecordId,
|
|
15035
|
-
// field_id,
|
|
15036
|
-
// field_value: value,
|
|
15037
|
-
// },
|
|
15038
|
-
// null,
|
|
15039
|
-
// null,
|
|
15040
|
-
// paramsP.dsSessionP,
|
|
15041
|
-
// );
|
|
15042
|
-
// };
|
|
15043
|
-
|
|
15044
|
-
// if ($div?.data()?.iterate_info) {
|
|
15045
|
-
// var data = $div.data().xuData.iterate_info;
|
|
15046
|
-
// if (data.iterator_key) {
|
|
15047
|
-
// set_value(data.iterator_key, data._key);
|
|
15048
|
-
// }
|
|
15049
|
-
// if (data.iterator_val) {
|
|
15050
|
-
// set_value(data.iterator_val, data._val);
|
|
15051
|
-
// }
|
|
15052
|
-
// }
|
|
15053
|
-
// };
|
|
15054
|
-
// func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
|
|
15055
|
-
// if (is_skeleton || EXP_BUSY) return;
|
|
15056
|
-
|
|
15057
|
-
// var _session = SESSION_OBJ[SESSION_ID];
|
|
15058
|
-
// var _ds = _session.DS_GLB[paramsP.dsSessionP];
|
|
15059
|
-
|
|
15060
|
-
// const _$ = function ($elm) {
|
|
15061
|
-
// try {
|
|
15062
|
-
// const id = $elm.attr('xu-ui-id');
|
|
15063
|
-
// if (!id) return $elm;
|
|
15064
|
-
// const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
|
|
15065
|
-
|
|
15066
|
-
// if ($el.length > 1) {
|
|
15067
|
-
// console.warn('Multiple elements for xu-ui-id: ' + id, $el);
|
|
15068
|
-
// }
|
|
15069
|
-
|
|
15070
|
-
// return $($el[0]);
|
|
15071
|
-
// } catch (e) {
|
|
15072
|
-
// console.error(e);
|
|
15073
|
-
// }
|
|
15074
|
-
// };
|
|
15075
|
-
|
|
15076
|
-
// CLIENT_ACTIVITY_TS = Date.now();
|
|
15077
|
-
// if (_$($container)?.data()?.xuData?.debug_info) {
|
|
15078
|
-
// _$($container).data().xuData.debug_info.hover_item = null;
|
|
15079
|
-
// }
|
|
15080
|
-
// if (_ds?.data_system) {
|
|
15081
|
-
// SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
|
|
15082
|
-
// }
|
|
15083
|
-
// };
|
|
15084
14563
|
func.UI.component = {};
|
|
15085
14564
|
|
|
15086
14565
|
func.UI.component.create_app_modal_component = function (
|
|
@@ -16958,7 +16437,7 @@ func.index.init_document_listeners = function () {
|
|
|
16958
16437
|
set_idle(0);
|
|
16959
16438
|
}
|
|
16960
16439
|
|
|
16961
|
-
if (_session.engine_mode === 'live_preview' || !_session.opt.
|
|
16440
|
+
if (_session.engine_mode === 'live_preview' || !_session.opt.enable_user_assist) {
|
|
16962
16441
|
return;
|
|
16963
16442
|
}
|
|
16964
16443
|
|