@xuda.io/runtime-bundle 1.0.879 → 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 +10 -507
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +10 -507
- package/js/xuda-runtime-slim.min.es.js +10 -507
- package/js/xuda-runtime-slim.min.js +1 -1
- package/package.json +1 -1
|
@@ -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
9558
|
|
|
9704
|
-
|
|
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
|
-
|
|
9712
|
-
// $(val).attr('xu-ui-id', new_id).removeData();
|
|
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;
|
|
@@ -10296,31 +9970,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10296
9970
|
return field_id;
|
|
10297
9971
|
};
|
|
10298
9972
|
|
|
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
9973
|
try {
|
|
10325
9974
|
bind_field_id = await get_bind_field(val.value.split('.')[0]);
|
|
10326
9975
|
val_is_reference_field = true;
|
|
@@ -10373,10 +10022,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10373
10022
|
|
|
10374
10023
|
var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
|
|
10375
10024
|
|
|
10376
|
-
// if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {
|
|
10377
|
-
// value = bind.getter($elm[0]);
|
|
10378
|
-
// }
|
|
10379
|
-
|
|
10380
10025
|
if (field_prop.props.fieldType === 'object') {
|
|
10381
10026
|
value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', input_field_type, bind.getter($elm[0]));
|
|
10382
10027
|
}
|
|
@@ -10398,14 +10043,13 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10398
10043
|
if (reference_source_obj.ret.type === 'array') {
|
|
10399
10044
|
if (iterate_info.iterator_val === bind_field_id) {
|
|
10400
10045
|
const arr_idx = Number($elm?.data()?.xuData?.iterate_info._key);
|
|
10401
|
-
|
|
10046
|
+
|
|
10402
10047
|
const dataset_arr = await func.datasource.get_value(SESSION_ID, reference_source_obj.fieldIdP, _dsP, reference_source_obj.currentRecordId);
|
|
10403
10048
|
let new_arr = _.cloneDeep(dataset_arr.ret.value);
|
|
10404
|
-
|
|
10049
|
+
|
|
10405
10050
|
if (field_prop.props.fieldType === 'object' && val_is_reference_field) {
|
|
10406
10051
|
let obj_item = new_arr[arr_idx];
|
|
10407
|
-
|
|
10408
|
-
// let new_val = eval(e_exp + `="${value}"`);
|
|
10052
|
+
|
|
10409
10053
|
let e_exp = val.value.replace(bind_field_id, 'obj_item');
|
|
10410
10054
|
|
|
10411
10055
|
let new_val = eval(e_exp + (input_field_type === 'string' ? `="${value}"` : `=${value}`));
|
|
@@ -10423,7 +10067,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10423
10067
|
},
|
|
10424
10068
|
},
|
|
10425
10069
|
};
|
|
10426
|
-
|
|
10070
|
+
|
|
10427
10071
|
await func.datasource.update(SESSION_ID, datasource_changes, null, true);
|
|
10428
10072
|
}
|
|
10429
10073
|
}
|
|
@@ -10477,7 +10121,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
10477
10121
|
$('body').on('xu-bind-refresh.' + _ds.dsSession.toString(), () => {
|
|
10478
10122
|
set_value();
|
|
10479
10123
|
});
|
|
10480
|
-
|
|
10124
|
+
|
|
10481
10125
|
set_value();
|
|
10482
10126
|
return {};
|
|
10483
10127
|
},
|
|
@@ -12528,10 +12172,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12528
12172
|
function (entries) {
|
|
12529
12173
|
entries.forEach((entry) => {
|
|
12530
12174
|
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
12175
|
$(entry.target).trigger('inViewport');
|
|
12536
12176
|
|
|
12537
12177
|
// Optional: stop observing once triggered
|
|
@@ -12561,9 +12201,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12561
12201
|
},
|
|
12562
12202
|
);
|
|
12563
12203
|
|
|
12564
|
-
// if ($div.parent().data().xuData.viewport_elm_height) {
|
|
12565
|
-
// $div.css(height, $div.parent().data().xuData.viewport_elm_height);
|
|
12566
|
-
// }
|
|
12567
12204
|
let ui_job_id;
|
|
12568
12205
|
$div.on('inViewport', function () {
|
|
12569
12206
|
if ($div.children().length) {
|
|
@@ -12571,13 +12208,8 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12571
12208
|
return;
|
|
12572
12209
|
}
|
|
12573
12210
|
|
|
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
12211
|
if (UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]) {
|
|
12212
|
+
$div[0].style.removeProperty('height');
|
|
12581
12213
|
$div.removeClass('skeleton');
|
|
12582
12214
|
$div.html(UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]);
|
|
12583
12215
|
} else {
|
|
@@ -12648,13 +12280,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
12648
12280
|
try {
|
|
12649
12281
|
// disabled in purpose to support create row
|
|
12650
12282
|
|
|
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
12283
|
if (!_ds.screen_params) continue;
|
|
12659
12284
|
if (_ds.screen_params.is_panelP) {
|
|
12660
12285
|
func.UI.screen.refresh_screen(SESSION_ID, null, key);
|
|
@@ -12667,128 +12292,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
12667
12292
|
}
|
|
12668
12293
|
}
|
|
12669
12294
|
};
|
|
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
12295
|
func.UI.component = {};
|
|
12793
12296
|
|
|
12794
12297
|
func.UI.component.create_app_modal_component = function (
|