@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
|
@@ -5711,7 +5711,7 @@ func.datasource.update_changes_for_out_parameter = async function (SESSION_ID, d
|
|
|
5711
5711
|
let _session = SESSION_OBJ[SESSION_ID];
|
|
5712
5712
|
let _ds = _session.DS_GLB[dsSessionP];
|
|
5713
5713
|
const _calling_ds = _session.DS_GLB[calling_dsP];
|
|
5714
|
-
|
|
5714
|
+
|
|
5715
5715
|
if (_ds.PARAM_OUT_INFO) {
|
|
5716
5716
|
let data = {};
|
|
5717
5717
|
for await (const [key, val] of Object.entries(_ds.PARAM_OUT_INFO)) {
|
|
@@ -8460,43 +8460,19 @@ func.UI.worker.init = async function (SESSION_ID) {
|
|
|
8460
8460
|
break;
|
|
8461
8461
|
}
|
|
8462
8462
|
|
|
8463
|
-
// var _session = SESSION_OBJ[val.SESSION_ID];
|
|
8464
|
-
// if (!UI_WORKER_OBJ.jobs[Number(key)] || val.job_num === 9999999)
|
|
8465
|
-
// continue;
|
|
8466
|
-
|
|
8467
|
-
// if (val.dsSessionP && !_session.DS_GLB[val.dsSessionP]) {
|
|
8468
|
-
// func.UI.worker.delete_job(val.SESSION_ID, val.job_num);
|
|
8469
|
-
// continue;
|
|
8470
|
-
// }
|
|
8471
|
-
|
|
8472
|
-
// if (val?.elementP && !val.elementP.isInViewport()) {
|
|
8473
|
-
// continue;
|
|
8474
|
-
// }
|
|
8475
|
-
|
|
8476
8463
|
await func.UI.worker.execute(val.SESSION_ID, val);
|
|
8477
8464
|
// break;
|
|
8478
8465
|
} catch (err) {
|
|
8479
8466
|
console.error(err);
|
|
8480
8467
|
}
|
|
8481
8468
|
}
|
|
8482
|
-
// setTimeout(job_iterator, 1);
|
|
8483
8469
|
}
|
|
8484
8470
|
} else {
|
|
8485
8471
|
//busy
|
|
8486
8472
|
|
|
8487
8473
|
this.attempt++;
|
|
8488
8474
|
}
|
|
8489
|
-
// return job_iterator();
|
|
8490
|
-
// run_stat = 0;
|
|
8491
8475
|
};
|
|
8492
|
-
// job_iterator();
|
|
8493
|
-
// this._interval = setInterval(() => {
|
|
8494
|
-
// if (!run_stat) {
|
|
8495
|
-
// var testId = crypto.randomUUID();
|
|
8496
|
-
// run_stat = 1;
|
|
8497
|
-
// job_iterator(testId);
|
|
8498
|
-
// }
|
|
8499
|
-
// }, 10);
|
|
8500
8476
|
|
|
8501
8477
|
this._interval = setInterval(job_iterator, 1);
|
|
8502
8478
|
|
|
@@ -8769,24 +8745,8 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
|
|
|
8769
8745
|
for await (const [key, val] of Object.entries(nodeP.children)) {
|
|
8770
8746
|
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);
|
|
8771
8747
|
}
|
|
8772
|
-
|
|
8773
|
-
// const parent_id = $div.parent().attr('xu-ui-id');
|
|
8774
|
-
// if (!UI_WORKER_OBJ.viewport_height_set_ids.includes(parent_id)) {
|
|
8775
|
-
// UI_WORKER_OBJ.viewport_height_set_ids.push(parent_id);
|
|
8776
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'set_viewport_height', { $elm: $div.parent(), height: $div.height() }, null, null, paramsP.dsSessionP);
|
|
8777
|
-
// }
|
|
8778
|
-
|
|
8779
|
-
// if ($div.hasClass('viewport_height')) {
|
|
8780
|
-
// $div.css('height', 'unset');
|
|
8781
|
-
// }
|
|
8782
|
-
|
|
8783
|
-
// const height = $div.data().xuData.viewport_height;
|
|
8784
|
-
// if (typeof height !== 'undefined') {
|
|
8785
|
-
// $div.css('height', 'unset');
|
|
8786
|
-
// } else {
|
|
8748
|
+
$div[0].style.removeProperty('height');
|
|
8787
8749
|
$div.data().xuData.viewport_height = $div.height();
|
|
8788
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'set_viewport_height', { $elm: $div.parent(), height: $div.height() }, null, null, paramsP.dsSessionP);
|
|
8789
|
-
// }
|
|
8790
8750
|
|
|
8791
8751
|
// set initial default height for all children
|
|
8792
8752
|
const parent_id = $div.parent().attr('xu-ui-id');
|
|
@@ -8801,12 +8761,9 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
|
|
|
8801
8761
|
set_viewport_height: async function () {
|
|
8802
8762
|
const { $div, height } = queue_obj?.paramsP || {};
|
|
8803
8763
|
|
|
8804
|
-
// $elm.data().xuData.viewport_height = $div.height();
|
|
8805
|
-
|
|
8806
8764
|
$.each($div.parent().children(), function (key, elm) {
|
|
8807
8765
|
if (!$(elm)[0].style.height && !$(elm).children().length) {
|
|
8808
|
-
$(elm).css('height', height);
|
|
8809
|
-
// $(elm).data().xuData.viewport_height = $div.height();
|
|
8766
|
+
$(elm).css('height', height);
|
|
8810
8767
|
}
|
|
8811
8768
|
});
|
|
8812
8769
|
|
|
@@ -9108,115 +9065,15 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
9108
9065
|
$rootFrame.css('display', 'contents');
|
|
9109
9066
|
}
|
|
9110
9067
|
|
|
9111
|
-
// ////////// skeleton
|
|
9112
|
-
|
|
9113
9068
|
var node = JSON.parse(JSON.stringify(screen_ret.progUi));
|
|
9114
9069
|
|
|
9115
|
-
// const change_tree_to_skeleton = (node) => {
|
|
9116
|
-
// var tags = ["input", "button", "li", "xu-panel"];
|
|
9117
|
-
// $.each(node.children, (key, val) => {
|
|
9118
|
-
// if (val.type !== "element") return true;
|
|
9119
|
-
|
|
9120
|
-
// if (val.attributes) {
|
|
9121
|
-
// delete val.attributes.placeholder;
|
|
9122
|
-
|
|
9123
|
-
// var class_skeleton = "";
|
|
9124
|
-
|
|
9125
|
-
// if (tags.includes(val.tagName) || !val.children.length) {
|
|
9126
|
-
// class_skeleton = "skeleton";
|
|
9127
|
-
// }
|
|
9128
|
-
// if (class_skeleton) {
|
|
9129
|
-
// if (val.attributes?.class) {
|
|
9130
|
-
// val.attributes.class += ` ${class_skeleton}`;
|
|
9131
|
-
// } else {
|
|
9132
|
-
// val.attributes.class = class_skeleton;
|
|
9133
|
-
// }
|
|
9134
|
-
// if (val.tagName === "xu-panel") {
|
|
9135
|
-
// val.tagName = "div";
|
|
9136
|
-
// val.attributes.class += " skeleton-panel";
|
|
9137
|
-
// }
|
|
9138
|
-
// }
|
|
9139
|
-
// change_tree_to_skeleton(val);
|
|
9140
|
-
// }
|
|
9141
|
-
// });
|
|
9142
|
-
// };
|
|
9143
|
-
// if (!is_panelP) {
|
|
9144
|
-
// change_tree_to_skeleton(node[0]);
|
|
9145
|
-
|
|
9146
|
-
// const $skeleton_wrapper = $("<div class='skeleton_wrapper'>");
|
|
9147
|
-
// const ret_skelton = await func.UI.screen.render_ui_tree(
|
|
9148
|
-
// SESSION_ID,
|
|
9149
|
-
// $skeleton_wrapper,
|
|
9150
|
-
// node[0].children[0],
|
|
9151
|
-
// {},
|
|
9152
|
-
// params,
|
|
9153
|
-
// jobNoP,
|
|
9154
|
-
// true,
|
|
9155
|
-
// 0,
|
|
9156
|
-
// null,
|
|
9157
|
-
// node,
|
|
9158
|
-
// null,
|
|
9159
|
-
// $rootFrame
|
|
9160
|
-
// );
|
|
9161
|
-
// $rootFrame.append($skeleton_wrapper);
|
|
9162
|
-
// }
|
|
9163
|
-
|
|
9164
|
-
// const activate_skeleton = () => {
|
|
9165
|
-
// let $parent_div = $(
|
|
9166
|
-
// `[xu-ui-id="${$callingContainerP_data?.xuData?.parent_element_ui_id}"]`
|
|
9167
|
-
// );
|
|
9168
|
-
// if (!$parent_div?.length) return;
|
|
9169
|
-
|
|
9170
|
-
// var tags = ["SPAN", "INPUT", "BUTTON", "LI", "XU-PANEL"];
|
|
9171
|
-
// $.each($($parent_div).find("*"), (key, val) => {
|
|
9172
|
-
// if (tags.includes($(val).prop("tagName")) || !$(val).children().length) {
|
|
9173
|
-
// $(val).addClass("skeleton");
|
|
9174
|
-
// }
|
|
9175
|
-
// if ($(val).prop("tagName") === "XU-PANEL") {
|
|
9176
|
-
// $(val).addClass("skeleton-panel");
|
|
9177
|
-
// }
|
|
9178
|
-
// if ($(val).prop("tagName") === "IMG") {
|
|
9179
|
-
// let src = func.common.get_url(
|
|
9180
|
-
// SESSION_ID,
|
|
9181
|
-
// "dist",
|
|
9182
|
-
// "runtime/images/skeleton-img.png"
|
|
9183
|
-
// );
|
|
9184
|
-
// $(val).attr("src", src);
|
|
9185
|
-
// }
|
|
9186
|
-
// });
|
|
9187
|
-
// };
|
|
9188
|
-
// if (is_panelP) {
|
|
9189
|
-
// activate_skeleton();
|
|
9190
|
-
// }
|
|
9191
|
-
// console.log("***");
|
|
9192
9070
|
func.UI.utils.indicator.screen.busy();
|
|
9193
9071
|
|
|
9194
|
-
const ret = await func.datasource.create(
|
|
9195
|
-
SESSION_ID,
|
|
9196
|
-
prog_id,
|
|
9197
|
-
refreshed_ds, //params?.callingDataSource_objP?.dsSession
|
|
9198
|
-
params.parentDataSourceNoP,
|
|
9199
|
-
$rootFrame.attr('id'),
|
|
9200
|
-
rowIdP,
|
|
9201
|
-
jobNoP,
|
|
9202
|
-
null,
|
|
9203
|
-
parameters_raw_obj,
|
|
9204
|
-
null,
|
|
9205
|
-
null,
|
|
9206
|
-
null,
|
|
9207
|
-
null,
|
|
9208
|
-
null,
|
|
9209
|
-
parameters_obj_inP,
|
|
9210
|
-
);
|
|
9072
|
+
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);
|
|
9211
9073
|
|
|
9212
9074
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[ret.dsSessionP];
|
|
9213
9075
|
_ds.screen_params = params;
|
|
9214
9076
|
|
|
9215
|
-
// _ds.is_panel = is_panelP;
|
|
9216
|
-
// setInterval(() => {
|
|
9217
|
-
// _ds.ts = Date.now();
|
|
9218
|
-
// }, 10000);
|
|
9219
|
-
|
|
9220
9077
|
params.dsSessionP = ret.dsSessionP;
|
|
9221
9078
|
|
|
9222
9079
|
func.UI.screen.update_SYS_OBJ_WIN_INFO(SESSION_ID, params.dsSessionP);
|
|
@@ -9698,23 +9555,8 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
9698
9555
|
if ($elm?.length) {
|
|
9699
9556
|
const elm_data = $elm.data();
|
|
9700
9557
|
const $wrapper = $elm.parent();
|
|
9701
|
-
// const wrapper_data = $wrapper.data();
|
|
9702
|
-
const refreshed_ds = _ds.dsSession;
|
|
9703
|
-
|
|
9704
|
-
// let elm_to_delete = [];
|
|
9705
|
-
// const ts = Date.now();
|
|
9706
|
-
// $.each($elm.find('xu-root-component-' + SESSION_ID).find('*'), function (key, val) {
|
|
9707
|
-
// let xu_ui_id = $(val).attr('xu-ui-id');
|
|
9708
|
-
// if (xu_ui_id) {
|
|
9709
|
-
// let new_id = xu_ui_id + ts;
|
|
9710
|
-
// elm_to_delete.push(new_id);
|
|
9711
9558
|
|
|
9712
|
-
|
|
9713
|
-
// }
|
|
9714
|
-
// // else {
|
|
9715
|
-
// // $(val).remove();
|
|
9716
|
-
// // }
|
|
9717
|
-
// });
|
|
9559
|
+
const refreshed_ds = _ds.dsSession;
|
|
9718
9560
|
|
|
9719
9561
|
$elm.empty();
|
|
9720
9562
|
if ($elm.data()) {
|
|
@@ -9733,11 +9575,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
9733
9575
|
elm_data.xuData.$root_container, // the wrapper root container
|
|
9734
9576
|
);
|
|
9735
9577
|
|
|
9736
|
-
// // remove old screen content
|
|
9737
|
-
// $.each(elm_to_delete, async function (key, val) {
|
|
9738
|
-
// $("[xu-ui-id='" + elm_to_delete + "']").remove();
|
|
9739
|
-
// });
|
|
9740
|
-
|
|
9741
9578
|
if (glb.DEBUG_MODE) {
|
|
9742
9579
|
console.info('========= refresh main info ==============');
|
|
9743
9580
|
console.info('reason:', refresh_reason);
|
|
@@ -9833,169 +9670,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
9833
9670
|
}
|
|
9834
9671
|
};
|
|
9835
9672
|
|
|
9836
|
-
// func.UI.screen.refresh_screen_old = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
9837
|
-
// // check the main program
|
|
9838
|
-
// if (fields_changed_datasource) {
|
|
9839
|
-
// const _session = SESSION_OBJ[SESSION_ID];
|
|
9840
|
-
// const _ds = _session.DS_GLB[fields_changed_datasource];
|
|
9841
|
-
// const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
9842
|
-
// const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
9843
|
-
// for (const field_id of fields_changed_arr || []) {
|
|
9844
|
-
// }
|
|
9845
|
-
// }
|
|
9846
|
-
|
|
9847
|
-
// const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
9848
|
-
|
|
9849
|
-
// for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
9850
|
-
// const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
9851
|
-
|
|
9852
|
-
// var found, refresh_reason, refresh_details;
|
|
9853
|
-
// if (fields_changed_arr) {
|
|
9854
|
-
// if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
9855
|
-
// continue;
|
|
9856
|
-
// }
|
|
9857
|
-
// for (const field_id of fields_changed_arr) {
|
|
9858
|
-
// // get panel attributes
|
|
9859
|
-
// const _attributes = panel_val?.panelXuAttributes || {};
|
|
9860
|
-
|
|
9861
|
-
// // detect if program changed
|
|
9862
|
-
// found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
9863
|
-
|
|
9864
|
-
// if (found) {
|
|
9865
|
-
// refresh_reason = `program ${_attributes['xu-exp:program']} ${field_id} changed `;
|
|
9866
|
-
// refresh_details = _attributes;
|
|
9867
|
-
// break;
|
|
9868
|
-
// }
|
|
9869
|
-
|
|
9870
|
-
// // _attributes holds also info of parameters in code_in: @code
|
|
9871
|
-
// // search field changed in panel call send parameters exp
|
|
9872
|
-
// for (const [attr, value] of Object.entries(_attributes)) {
|
|
9873
|
-
// const pattern = /xu-exp:(\w+)/;
|
|
9874
|
-
// const match = attr.match(pattern);
|
|
9875
|
-
|
|
9876
|
-
// if (!match) {
|
|
9877
|
-
// // continue if attribute is not expression
|
|
9878
|
-
// continue;
|
|
9879
|
-
// }
|
|
9880
|
-
// // code_in
|
|
9881
|
-
// const parameter_in_field_id = match?.[1];
|
|
9882
|
-
// // @code
|
|
9883
|
-
// if (value.includes(field_id)) {
|
|
9884
|
-
// // search parameter in field in the target program's progDataSource
|
|
9885
|
-
// found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
9886
|
-
|
|
9887
|
-
// if (found) {
|
|
9888
|
-
// refresh_reason = `field ${field_id} in progDataSource parameter_in changed`;
|
|
9889
|
-
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
9890
|
-
|
|
9891
|
-
// break;
|
|
9892
|
-
// }
|
|
9893
|
-
|
|
9894
|
-
// // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
|
|
9895
|
-
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
9896
|
-
|
|
9897
|
-
// if (found) {
|
|
9898
|
-
// refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
|
|
9899
|
-
// refresh_details = found;
|
|
9900
|
-
|
|
9901
|
-
// break;
|
|
9902
|
-
// }
|
|
9903
|
-
// }
|
|
9904
|
-
// }
|
|
9905
|
-
|
|
9906
|
-
// if (found) break;
|
|
9907
|
-
|
|
9908
|
-
// // search field changed in the target program's progDataSource // @code
|
|
9909
|
-
// found = progDataSource_str?.includes('@' + field_id);
|
|
9910
|
-
// if (found) {
|
|
9911
|
-
// refresh_reason = `field ${field_id} in progDataSource changed`;
|
|
9912
|
-
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
9913
|
-
|
|
9914
|
-
// break;
|
|
9915
|
-
// }
|
|
9916
|
-
|
|
9917
|
-
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, field_id, 'xu-for').length;
|
|
9918
|
-
// if (found) {
|
|
9919
|
-
// refresh_reason = `field ${field_id} in progUi xu-for changed`;
|
|
9920
|
-
// refresh_details = found;
|
|
9921
|
-
|
|
9922
|
-
// break;
|
|
9923
|
-
// }
|
|
9924
|
-
|
|
9925
|
-
// if (found) {
|
|
9926
|
-
// break;
|
|
9927
|
-
// }
|
|
9928
|
-
// }
|
|
9929
|
-
// }
|
|
9930
|
-
|
|
9931
|
-
// if (datasource_changed) {
|
|
9932
|
-
// if (panel_val._ds.dsSession == datasource_changed) {
|
|
9933
|
-
// refresh_reason = `panel datasource ${datasource_changed} changed`;
|
|
9934
|
-
// refresh_details = '';
|
|
9935
|
-
|
|
9936
|
-
// found = true;
|
|
9937
|
-
// }
|
|
9938
|
-
// }
|
|
9939
|
-
// if (found) {
|
|
9940
|
-
// const _session = SESSION_OBJ[SESSION_ID];
|
|
9941
|
-
// if (_session.engine_mode === 'live_preview') {
|
|
9942
|
-
// console.info('========= refresh info ==============');
|
|
9943
|
-
// console.info('reason:', refresh_reason);
|
|
9944
|
-
// console.info('details:', refresh_details);
|
|
9945
|
-
// console.info('panel:', panel_val);
|
|
9946
|
-
// console.info('=====================================');
|
|
9947
|
-
// }
|
|
9948
|
-
// const $div_elm = panel_val.$panel_div;
|
|
9949
|
-
// const wrapper_data = $div_elm.data();
|
|
9950
|
-
|
|
9951
|
-
// if (_.isEmpty(wrapper_data)) continue;
|
|
9952
|
-
|
|
9953
|
-
// try {
|
|
9954
|
-
// const ts = Date.now();
|
|
9955
|
-
// // remove old panel content
|
|
9956
|
-
// $.each(panel_val.ids, async function (key, val) {
|
|
9957
|
-
// $("[xu-ui-id='" + val + "']")
|
|
9958
|
-
// .attr('xu-ui-id', val + ts)
|
|
9959
|
-
// .removeData();
|
|
9960
|
-
// });
|
|
9961
|
-
|
|
9962
|
-
// let refreshed_ds;
|
|
9963
|
-
// // check if ds exist and deleted by garbage collector
|
|
9964
|
-
|
|
9965
|
-
// if (_session.DS_GLB[panel_val._ds.dsSession]) {
|
|
9966
|
-
// refreshed_ds = panel_val._ds.dsSession;
|
|
9967
|
-
// }
|
|
9968
|
-
// for await (const item of wrapper_data.xuData.node_org.children) {
|
|
9969
|
-
// if (item.tagName !== 'xu-panel') continue;
|
|
9970
|
-
|
|
9971
|
-
// const new_$div = await func.UI.screen.render_ui_tree(
|
|
9972
|
-
// SESSION_ID,
|
|
9973
|
-
// $div_elm, // the wrapper
|
|
9974
|
-
// _.cloneDeep(item), // _.cloneDeep(wrapper_data.xuData.node_org.children[0]), // the xu-panel node
|
|
9975
|
-
// {},
|
|
9976
|
-
// wrapper_data.xuData.paramsP, // the wrapper params
|
|
9977
|
-
// null,
|
|
9978
|
-
// null,
|
|
9979
|
-
// wrapper_data.xuData.key, // the wrapper key
|
|
9980
|
-
// refreshed_ds, // the refreshed_ds
|
|
9981
|
-
// wrapper_data.xuData.parent_node, // the wrapper parent node
|
|
9982
|
-
// null,
|
|
9983
|
-
// wrapper_data.xuData.$root_container, // the wrapper root container
|
|
9984
|
-
// );
|
|
9985
|
-
// }
|
|
9986
|
-
|
|
9987
|
-
// // remove old panel content
|
|
9988
|
-
// $.each(panel_val.ids, async function (key, val) {
|
|
9989
|
-
// $("[xu-ui-id='" + val + ts + "']").remove();
|
|
9990
|
-
// });
|
|
9991
|
-
// } catch (error) {
|
|
9992
|
-
// debugger;
|
|
9993
|
-
// }
|
|
9994
|
-
// // continue;
|
|
9995
|
-
// }
|
|
9996
|
-
// }
|
|
9997
|
-
// };
|
|
9998
|
-
|
|
9999
9673
|
const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession) {
|
|
10000
9674
|
const _prog = await func.utils.VIEWS_OBJ.get(SESSION_ID, prog_id);
|
|
10001
9675
|
if (!_prog) return;
|
|
@@ -10263,7 +9937,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10263
9937
|
let is_dynamic_field = false;
|
|
10264
9938
|
let field_prop;
|
|
10265
9939
|
let bind_field_id;
|
|
10266
|
-
|
|
9940
|
+
|
|
10267
9941
|
const input_field_type = $elm.attr('type');
|
|
10268
9942
|
|
|
10269
9943
|
const get_bind_field = async function (field_id) {
|
|
@@ -10274,11 +9948,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10274
9948
|
field_prop = func.common.find_item_by_key(view_ret.progFields, 'field_id', field_id);
|
|
10275
9949
|
if (!field_prop) {
|
|
10276
9950
|
/// find the field everywhere in the chain Aug 30 2024
|
|
10277
|
-
const ret_get_value = await func.datasource.get_value(
|
|
10278
|
-
SESSION_ID,
|
|
10279
|
-
field_id,
|
|
10280
|
-
_dsP, // $elm.data().xuData.paramsP.dsSessionP
|
|
10281
|
-
);
|
|
9951
|
+
const ret_get_value = await func.datasource.get_value(SESSION_ID, field_id, _dsP);
|
|
10282
9952
|
|
|
10283
9953
|
if (ret_get_value.found) {
|
|
10284
9954
|
_dsP = ret_get_value.dsSessionP;
|
|
@@ -10296,38 +9966,12 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10296
9966
|
return field_id;
|
|
10297
9967
|
};
|
|
10298
9968
|
|
|
10299
|
-
// try {
|
|
10300
|
-
// bind_field_id = await get_bind_field(val.value);
|
|
10301
|
-
// val_is_reference_field = true;
|
|
10302
|
-
// } catch (err) {
|
|
10303
|
-
// try {
|
|
10304
|
-
// if (!_.isEmpty($elm?.data()?.xuAttributes?.['xu-exp:xu-bind'])) {
|
|
10305
|
-
// bind_field_exp = $elm.data().xuAttributes['xu-exp:xu-bind'];
|
|
10306
|
-
// const res = await func.expression.get(SESSION_ID, bind_field_exp, paramsP.dsSessionP, 'UI Attr EXP');
|
|
10307
|
-
|
|
10308
|
-
// if (Object.keys(res.fields).length) {
|
|
10309
|
-
// const field_id_from_exp = Object.keys(res.fields)[0];
|
|
10310
|
-
// bind_field_id = await get_bind_field(field_id_from_exp);
|
|
10311
|
-
// } else {
|
|
10312
|
-
// throw err?.message || err;
|
|
10313
|
-
// }
|
|
10314
|
-
// } else {
|
|
10315
|
-
// throw err?.message || err;
|
|
10316
|
-
// }
|
|
10317
|
-
// } catch (err) {
|
|
10318
|
-
// console.error(err?.message || err);
|
|
10319
|
-
// return {};
|
|
10320
|
-
// }
|
|
10321
|
-
// // return {};
|
|
10322
|
-
// }
|
|
10323
|
-
|
|
10324
9969
|
try {
|
|
10325
9970
|
bind_field_id = await get_bind_field(val.value.split('.')[0]);
|
|
10326
9971
|
val_is_reference_field = true;
|
|
10327
9972
|
} catch (err) {
|
|
10328
9973
|
console.error(err?.message || err);
|
|
10329
9974
|
return {};
|
|
10330
|
-
// return {};
|
|
10331
9975
|
}
|
|
10332
9976
|
|
|
10333
9977
|
const field_changed = async function (e) {
|
|
@@ -10373,10 +10017,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10373
10017
|
|
|
10374
10018
|
var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
|
|
10375
10019
|
|
|
10376
|
-
// if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {
|
|
10377
|
-
// value = bind.getter($elm[0]);
|
|
10378
|
-
// }
|
|
10379
|
-
|
|
10380
10020
|
if (field_prop.props.fieldType === 'object') {
|
|
10381
10021
|
value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', input_field_type, bind.getter($elm[0]));
|
|
10382
10022
|
}
|
|
@@ -10398,14 +10038,13 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10398
10038
|
if (reference_source_obj.ret.type === 'array') {
|
|
10399
10039
|
if (iterate_info.iterator_val === bind_field_id) {
|
|
10400
10040
|
const arr_idx = Number($elm?.data()?.xuData?.iterate_info._key);
|
|
10401
|
-
|
|
10041
|
+
|
|
10402
10042
|
const dataset_arr = await func.datasource.get_value(SESSION_ID, reference_source_obj.fieldIdP, _dsP, reference_source_obj.currentRecordId);
|
|
10403
10043
|
let new_arr = _.cloneDeep(dataset_arr.ret.value);
|
|
10404
|
-
|
|
10044
|
+
|
|
10405
10045
|
if (field_prop.props.fieldType === 'object' && val_is_reference_field) {
|
|
10406
10046
|
let obj_item = new_arr[arr_idx];
|
|
10407
|
-
|
|
10408
|
-
// let new_val = eval(e_exp + `="${value}"`);
|
|
10047
|
+
|
|
10409
10048
|
let e_exp = val.value.replace(bind_field_id, 'obj_item');
|
|
10410
10049
|
|
|
10411
10050
|
let new_val = eval(e_exp + (input_field_type === 'string' ? `="${value}"` : `=${value}`));
|
|
@@ -10423,7 +10062,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10423
10062
|
},
|
|
10424
10063
|
},
|
|
10425
10064
|
};
|
|
10426
|
-
|
|
10065
|
+
|
|
10427
10066
|
await func.datasource.update(SESSION_ID, datasource_changes, null, true);
|
|
10428
10067
|
}
|
|
10429
10068
|
}
|
|
@@ -10477,7 +10116,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10477
10116
|
$('body').on('xu-bind-refresh.' + _ds.dsSession.toString(), () => {
|
|
10478
10117
|
set_value();
|
|
10479
10118
|
});
|
|
10480
|
-
|
|
10119
|
+
|
|
10481
10120
|
set_value();
|
|
10482
10121
|
return {};
|
|
10483
10122
|
},
|
|
@@ -12528,10 +12167,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12528
12167
|
function (entries) {
|
|
12529
12168
|
entries.forEach((entry) => {
|
|
12530
12169
|
if (entry.isIntersecting) {
|
|
12531
|
-
// Element is in viewport - trigger custom event
|
|
12532
|
-
// console.log('trigger>>', 'inViewport_' + $(entry.target).attr('xu-ui-id'));
|
|
12533
|
-
|
|
12534
|
-
// $(entry.target).trigger('inViewport_' + $(entry.target).attr('xu-ui-id'));
|
|
12535
12170
|
$(entry.target).trigger('inViewport');
|
|
12536
12171
|
|
|
12537
12172
|
// Optional: stop observing once triggered
|
|
@@ -12561,9 +12196,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12561
12196
|
},
|
|
12562
12197
|
);
|
|
12563
12198
|
|
|
12564
|
-
// if ($div.parent().data().xuData.viewport_elm_height) {
|
|
12565
|
-
// $div.css(height, $div.parent().data().xuData.viewport_elm_height);
|
|
12566
|
-
// }
|
|
12567
12199
|
let ui_job_id;
|
|
12568
12200
|
$div.on('inViewport', function () {
|
|
12569
12201
|
if ($div.children().length) {
|
|
@@ -12571,13 +12203,8 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12571
12203
|
return;
|
|
12572
12204
|
}
|
|
12573
12205
|
|
|
12574
|
-
// const height = $div.data().xuData.viewport_height;
|
|
12575
|
-
// if (typeof height !== 'undefined') {
|
|
12576
|
-
// $div.css('height', 'unset');
|
|
12577
|
-
$div[0].style.removeProperty('height');
|
|
12578
|
-
// }
|
|
12579
|
-
|
|
12580
12206
|
if (UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]) {
|
|
12207
|
+
$div[0].style.removeProperty('height');
|
|
12581
12208
|
$div.removeClass('skeleton');
|
|
12582
12209
|
$div.html(UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]);
|
|
12583
12210
|
} else {
|
|
@@ -12648,13 +12275,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
12648
12275
|
try {
|
|
12649
12276
|
// disabled in purpose to support create row
|
|
12650
12277
|
|
|
12651
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, doc_change.row_id);
|
|
12652
|
-
|
|
12653
|
-
// console.log(
|
|
12654
|
-
// "refresh_document_changes_for_realtime_update",
|
|
12655
|
-
// _ds.data_feed.rows[row_idx]
|
|
12656
|
-
// );
|
|
12657
|
-
|
|
12658
12278
|
if (!_ds.screen_params) continue;
|
|
12659
12279
|
if (_ds.screen_params.is_panelP) {
|
|
12660
12280
|
func.UI.screen.refresh_screen(SESSION_ID, null, key);
|
|
@@ -12667,128 +12287,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
12667
12287
|
}
|
|
12668
12288
|
}
|
|
12669
12289
|
};
|
|
12670
|
-
|
|
12671
|
-
// func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
|
|
12672
|
-
// if (is_skeleton || EXP_BUSY) return;
|
|
12673
|
-
|
|
12674
|
-
// var _session = SESSION_OBJ[SESSION_ID];
|
|
12675
|
-
// var _ds = _session.DS_GLB[paramsP.dsSessionP];
|
|
12676
|
-
|
|
12677
|
-
// const _$ = function ($elm) {
|
|
12678
|
-
// try {
|
|
12679
|
-
// const id = $elm.attr('xu-ui-id');
|
|
12680
|
-
// if (!id) return $elm;
|
|
12681
|
-
// const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
|
|
12682
|
-
|
|
12683
|
-
// if ($el.length > 1) {
|
|
12684
|
-
// console.warn('Multiple elements for xu-ui-id: ' + id, $el);
|
|
12685
|
-
// }
|
|
12686
|
-
|
|
12687
|
-
// return $($el[0]);
|
|
12688
|
-
// } catch (e) {
|
|
12689
|
-
// console.error(e);
|
|
12690
|
-
// }
|
|
12691
|
-
// };
|
|
12692
|
-
|
|
12693
|
-
// CLIENT_ACTIVITY_TS = Date.now();
|
|
12694
|
-
// if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
|
|
12695
|
-
// if (!_ds) return;
|
|
12696
|
-
// ///////// SET Attributes///////////
|
|
12697
|
-
// let attributes = {};
|
|
12698
|
-
// $.each($div[0].attributes, function (index, attr) {
|
|
12699
|
-
// attributes[attr.name] = attr.value;
|
|
12700
|
-
// });
|
|
12701
|
-
|
|
12702
|
-
// SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
|
|
12703
|
-
// //////////////////////////////////
|
|
12704
|
-
// if (!$div.data()?.xuData) return;
|
|
12705
|
-
// const _iterate_info = $div.data().xuData.iterate_info;
|
|
12706
|
-
// if (_iterate_info) {
|
|
12707
|
-
// if (_iterate_info.is_key_dynamic_field) {
|
|
12708
|
-
// _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
|
|
12709
|
-
// } else {
|
|
12710
|
-
// try {
|
|
12711
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
12712
|
-
// _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
|
|
12713
|
-
// } catch (err) {
|
|
12714
|
-
// console.error(err);
|
|
12715
|
-
// }
|
|
12716
|
-
// }
|
|
12717
|
-
|
|
12718
|
-
// if (_iterate_info.is_val_dynamic_field) {
|
|
12719
|
-
// _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
|
|
12720
|
-
// } else {
|
|
12721
|
-
// try {
|
|
12722
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
12723
|
-
// _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
|
|
12724
|
-
// } catch (err) {
|
|
12725
|
-
// console.error(err);
|
|
12726
|
-
// }
|
|
12727
|
-
// }
|
|
12728
|
-
// }
|
|
12729
|
-
|
|
12730
|
-
// if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
|
|
12731
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
|
|
12732
|
-
// }
|
|
12733
|
-
|
|
12734
|
-
// const set_value = function (field_id, value) {
|
|
12735
|
-
// var currentRecordId = _$($div).data().xuData.currentRecordId;
|
|
12736
|
-
|
|
12737
|
-
// func.UI.worker.add_to_queue(
|
|
12738
|
-
// SESSION_ID,
|
|
12739
|
-
// 'gui event',
|
|
12740
|
-
// 'update_datasource',
|
|
12741
|
-
// {
|
|
12742
|
-
// currentRecordId,
|
|
12743
|
-
// field_id,
|
|
12744
|
-
// field_value: value,
|
|
12745
|
-
// },
|
|
12746
|
-
// null,
|
|
12747
|
-
// null,
|
|
12748
|
-
// paramsP.dsSessionP,
|
|
12749
|
-
// );
|
|
12750
|
-
// };
|
|
12751
|
-
|
|
12752
|
-
// if ($div?.data()?.iterate_info) {
|
|
12753
|
-
// var data = $div.data().xuData.iterate_info;
|
|
12754
|
-
// if (data.iterator_key) {
|
|
12755
|
-
// set_value(data.iterator_key, data._key);
|
|
12756
|
-
// }
|
|
12757
|
-
// if (data.iterator_val) {
|
|
12758
|
-
// set_value(data.iterator_val, data._val);
|
|
12759
|
-
// }
|
|
12760
|
-
// }
|
|
12761
|
-
// };
|
|
12762
|
-
// func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
|
|
12763
|
-
// if (is_skeleton || EXP_BUSY) return;
|
|
12764
|
-
|
|
12765
|
-
// var _session = SESSION_OBJ[SESSION_ID];
|
|
12766
|
-
// var _ds = _session.DS_GLB[paramsP.dsSessionP];
|
|
12767
|
-
|
|
12768
|
-
// const _$ = function ($elm) {
|
|
12769
|
-
// try {
|
|
12770
|
-
// const id = $elm.attr('xu-ui-id');
|
|
12771
|
-
// if (!id) return $elm;
|
|
12772
|
-
// const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
|
|
12773
|
-
|
|
12774
|
-
// if ($el.length > 1) {
|
|
12775
|
-
// console.warn('Multiple elements for xu-ui-id: ' + id, $el);
|
|
12776
|
-
// }
|
|
12777
|
-
|
|
12778
|
-
// return $($el[0]);
|
|
12779
|
-
// } catch (e) {
|
|
12780
|
-
// console.error(e);
|
|
12781
|
-
// }
|
|
12782
|
-
// };
|
|
12783
|
-
|
|
12784
|
-
// CLIENT_ACTIVITY_TS = Date.now();
|
|
12785
|
-
// if (_$($container)?.data()?.xuData?.debug_info) {
|
|
12786
|
-
// _$($container).data().xuData.debug_info.hover_item = null;
|
|
12787
|
-
// }
|
|
12788
|
-
// if (_ds?.data_system) {
|
|
12789
|
-
// SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
|
|
12790
|
-
// }
|
|
12791
|
-
// };
|
|
12792
12290
|
func.UI.component = {};
|
|
12793
12291
|
|
|
12794
12292
|
func.UI.component.create_app_modal_component = function (
|
|
@@ -14267,10 +13765,9 @@ func.events.execute = async function (
|
|
|
14267
13765
|
return;
|
|
14268
13766
|
}
|
|
14269
13767
|
|
|
14270
|
-
// args.prog_id = _viewId;
|
|
14271
13768
|
if (_ds) {
|
|
14272
13769
|
func.utils.debug.watch(SESSION_ID, calling_trigger_prop?.id, functionP, null, calling_trigger_prop, expCond);
|
|
14273
|
-
|
|
13770
|
+
|
|
14274
13771
|
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);
|
|
14275
13772
|
|
|
14276
13773
|
let _ds_new = _session.DS_GLB[ret.dsSessionP];
|
|
@@ -14278,31 +13775,6 @@ func.events.execute = async function (
|
|
|
14278
13775
|
if (parameters && !_.isEmpty(parameters)) {
|
|
14279
13776
|
await func.datasource.update_changes_for_out_parameter(SESSION_ID, _ds_new.dsSession, _ds.dsSession);
|
|
14280
13777
|
}
|
|
14281
|
-
// if (parameters && !_.isEmpty(parameters) && _ds_new.PARAM_OUT_INFO) {
|
|
14282
|
-
// let data = {};
|
|
14283
|
-
// for await (const [key, val] of Object.entries(
|
|
14284
|
-
// _ds_new.PARAM_OUT_INFO
|
|
14285
|
-
// )) {
|
|
14286
|
-
// if (val.prop === "out") {
|
|
14287
|
-
// try {
|
|
14288
|
-
// const row_idx = func.common.find_ROWID_idx(
|
|
14289
|
-
// _ds_new,
|
|
14290
|
-
// _ds_new.currentRecordId
|
|
14291
|
-
// );
|
|
14292
|
-
// data[val.details] =
|
|
14293
|
-
// _ds_new.data_feed.rows[row_idx][val.fieldId];
|
|
14294
|
-
// } catch (err) {
|
|
14295
|
-
// console.error(err);
|
|
14296
|
-
// }
|
|
14297
|
-
// }
|
|
14298
|
-
// }
|
|
14299
|
-
// if (!_.isEmpty(data)) {
|
|
14300
|
-
// let datasource_changes = {
|
|
14301
|
-
// [_ds.dsSession]: { [_ds.currentRecordId]: data },
|
|
14302
|
-
// };
|
|
14303
|
-
// await func.datasource.update(SESSION_ID, datasource_changes);
|
|
14304
|
-
// }
|
|
14305
|
-
// }
|
|
14306
13778
|
|
|
14307
13779
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
14308
13780
|
return _ds_new;
|
|
@@ -14357,6 +13829,13 @@ func.events.execute = async function (
|
|
|
14357
13829
|
}
|
|
14358
13830
|
|
|
14359
13831
|
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
13832
|
+
|
|
13833
|
+
if (_ds.PARAM_OUT_INFO) {
|
|
13834
|
+
for await (const [dsSession_to_update, val] of Object.entries(datasource_changes)) {
|
|
13835
|
+
await func.datasource.update_changes_for_out_parameter(SESSION_ID, _ds.dsSession, dsSession_to_update);
|
|
13836
|
+
}
|
|
13837
|
+
}
|
|
13838
|
+
|
|
14360
13839
|
if (jobNoP) func.events.delete_job(SESSION_ID, jobNoP);
|
|
14361
13840
|
// return changes;
|
|
14362
13841
|
},
|
|
@@ -16959,7 +16438,7 @@ func.index.init_document_listeners = function () {
|
|
|
16959
16438
|
set_idle(0);
|
|
16960
16439
|
}
|
|
16961
16440
|
|
|
16962
|
-
if (_session.engine_mode === 'live_preview' || !_session.opt.
|
|
16441
|
+
if (_session.engine_mode === 'live_preview' || !_session.opt.enable_user_assist) {
|
|
16963
16442
|
return;
|
|
16964
16443
|
}
|
|
16965
16444
|
|