@xuda.io/runtime-bundle 1.0.461 → 1.0.462

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.
@@ -25013,18 +25013,7 @@ var STUDIO_PEER_CONN_MSG_QUEUE = [];
25013
25013
 
25014
25014
  var CLIENT_ACTIVITY_TS;
25015
25015
 
25016
- glb.REFERENCE_LESS_FUNCTIONS = [
25017
- "update",
25018
- "raise_event",
25019
- "call_library",
25020
- "invoke_action",
25021
- "loader_on",
25022
- "loader_off",
25023
- "emit_event",
25024
- "delay",
25025
- "execute_evaluate_javascript",
25026
- "execute_native_javascript",
25027
- ];
25016
+ glb.REFERENCE_LESS_FUNCTIONS = ['update', 'raise_event', 'call_library', 'invoke_action', 'loader_on', 'loader_off', 'emit_event', 'delay', 'execute_evaluate_javascript', 'execute_native_javascript'];
25028
25017
 
25029
25018
  var CACHE_PROG_UI = {};
25030
25019
 
@@ -25041,7 +25030,7 @@ var ELEMENT_CLICK_EVENT = null;
25041
25030
  var posX = 0; //cursor x
25042
25031
  var posY = 0; //cursor x
25043
25032
  var LOADER_ACTIVE = false;
25044
- var LOADER_TEXT = "";
25033
+ var LOADER_TEXT = '';
25045
25034
  var REFRESHER_IN_PROGRESS = false;
25046
25035
 
25047
25036
  glb.screen_num = 0;
@@ -25054,115 +25043,105 @@ var IS_PROGRESS_SCREEN_OPEN = null;
25054
25043
  var UI_WORKER_OBJ = { jobs: [], num: 9000 };
25055
25044
 
25056
25045
  glb.html5_events_handler = [
25057
- "onabort",
25058
- "onafterprint",
25059
- "onautocomplete",
25060
- "onautocompleteerror",
25061
- "onbeforeprint",
25062
- "onbeforeunload",
25063
- "onblur",
25064
- "oncancel",
25065
- "oncanplay",
25066
- "oncanplaythrough",
25067
- "onchange",
25068
- "onclick",
25069
- "onclose",
25070
- "oncontextmenu",
25071
- "oncopy",
25072
- "oncuechange",
25073
- "oncut",
25074
- "ondblclick",
25075
- "ondrag",
25076
- "ondragend",
25077
- "ondragenter",
25078
- "ondragexit",
25079
- "ondragleave",
25080
- "ondragover",
25081
- "ondragstart",
25082
- "ondrop",
25083
- "ondurationchange",
25084
- "onemptied",
25085
- "onended",
25086
- "onerror",
25087
- "onfocus",
25088
- "onhashchange",
25089
- "oninput",
25090
- "oninvalid",
25091
- "onkeydown",
25092
- "onkeypress",
25093
- "onkeyup",
25094
- "onload",
25095
- "onloadeddata",
25096
- "onloadedmetadata",
25097
- "onloadstart",
25098
- "onmessage",
25099
- "onmousedown",
25100
- "onmouseenter",
25101
- "onmouseleave",
25102
- "onmousemove",
25103
- "onmouseout",
25104
- "onmouseover",
25105
- "onmouseup",
25106
- "onmousewheel",
25107
- "onoffline",
25108
- "ononline",
25109
- "onpagehide",
25110
- "onpageshow",
25111
- "onpaste",
25112
- "onpause",
25113
- "onplay",
25114
- "onplaying",
25115
- "onpopstate",
25116
- "onprogress",
25117
- "onratechange",
25118
- "onreset",
25119
- "onresize",
25120
- "onscroll",
25121
- "onsearch",
25122
- "onseeked",
25123
- "onseeking",
25124
- "onselect",
25125
- "onshow",
25126
- "onsort",
25127
- "onstalled",
25128
- "onstorage",
25129
- "onsubmit",
25130
- "onsuspend",
25131
- "ontimeupdate",
25132
- "ontoggle",
25133
- "onunload",
25134
- "onvolumechange",
25135
- "onwaiting",
25046
+ 'onabort',
25047
+ 'onafterprint',
25048
+ 'onautocomplete',
25049
+ 'onautocompleteerror',
25050
+ 'onbeforeprint',
25051
+ 'onbeforeunload',
25052
+ 'onblur',
25053
+ 'oncancel',
25054
+ 'oncanplay',
25055
+ 'oncanplaythrough',
25056
+ 'onchange',
25057
+ 'onclick',
25058
+ 'onclose',
25059
+ 'oncontextmenu',
25060
+ 'oncopy',
25061
+ 'oncuechange',
25062
+ 'oncut',
25063
+ 'ondblclick',
25064
+ 'ondrag',
25065
+ 'ondragend',
25066
+ 'ondragenter',
25067
+ 'ondragexit',
25068
+ 'ondragleave',
25069
+ 'ondragover',
25070
+ 'ondragstart',
25071
+ 'ondrop',
25072
+ 'ondurationchange',
25073
+ 'onemptied',
25074
+ 'onended',
25075
+ 'onerror',
25076
+ 'onfocus',
25077
+ 'onhashchange',
25078
+ 'oninput',
25079
+ 'oninvalid',
25080
+ 'onkeydown',
25081
+ 'onkeypress',
25082
+ 'onkeyup',
25083
+ 'onload',
25084
+ 'onloadeddata',
25085
+ 'onloadedmetadata',
25086
+ 'onloadstart',
25087
+ 'onmessage',
25088
+ 'onmousedown',
25089
+ 'onmouseenter',
25090
+ 'onmouseleave',
25091
+ 'onmousemove',
25092
+ 'onmouseout',
25093
+ 'onmouseover',
25094
+ 'onmouseup',
25095
+ 'onmousewheel',
25096
+ 'onoffline',
25097
+ 'ononline',
25098
+ 'onpagehide',
25099
+ 'onpageshow',
25100
+ 'onpaste',
25101
+ 'onpause',
25102
+ 'onplay',
25103
+ 'onplaying',
25104
+ 'onpopstate',
25105
+ 'onprogress',
25106
+ 'onratechange',
25107
+ 'onreset',
25108
+ 'onresize',
25109
+ 'onscroll',
25110
+ 'onsearch',
25111
+ 'onseeked',
25112
+ 'onseeking',
25113
+ 'onselect',
25114
+ 'onshow',
25115
+ 'onsort',
25116
+ 'onstalled',
25117
+ 'onstorage',
25118
+ 'onsubmit',
25119
+ 'onsuspend',
25120
+ 'ontimeupdate',
25121
+ 'ontoggle',
25122
+ 'onunload',
25123
+ 'onvolumechange',
25124
+ 'onwaiting',
25136
25125
  ];
25137
25126
 
25138
25127
  glb.lifecycle = {
25139
25128
  plugins: {},
25140
25129
  // queue: [],
25141
- fn_arr: [
25142
- "beforeInit",
25143
- "initialized",
25144
- "systemReady",
25145
- "beforeMounted",
25146
- "mounted",
25147
- ],
25130
+ fn_arr: ['beforeInit', 'initialized', 'systemReady', 'beforeMounted', 'mounted'],
25148
25131
  // add(type, fn, params) {
25149
25132
  // this.queue.push({ type, fn, params });
25150
25133
  // },
25151
25134
  execute: async function (SESSION_ID, event) {
25152
25135
  const _session = SESSION_OBJ[SESSION_ID];
25153
25136
 
25154
- const xu_api = await func.common.get_module(
25137
+ const xu_api = await func.common.get_module(SESSION_ID, 'xuda-api-library.mjs', {
25138
+ func,
25139
+ glb,
25140
+ SESSION_OBJ,
25155
25141
  SESSION_ID,
25156
- "xuda-api-library.mjs",
25157
- {
25158
- func,
25159
- glb,
25160
- SESSION_OBJ,
25161
- SESSION_ID,
25162
- APP_OBJ,
25163
- dsSession: func.utils.get_last_datasource_no(SESSION_ID),
25164
- }
25165
- );
25142
+ APP_OBJ,
25143
+ dsSession: func.utils.get_last_datasource_no(SESSION_ID),
25144
+ });
25166
25145
 
25167
25146
  var params = {
25168
25147
  SESSION_ID,
@@ -25171,9 +25150,7 @@ glb.lifecycle = {
25171
25150
  xu_api,
25172
25151
  };
25173
25152
 
25174
- for await (const [plugin_name, val] of Object.entries(
25175
- glb.lifecycle.plugins
25176
- )) {
25153
+ for await (const [plugin_name, val] of Object.entries(glb.lifecycle.plugins)) {
25177
25154
  if (val?.plugin_script?.[event]) {
25178
25155
  params.setup_data = val.setup_data;
25179
25156
  await val.plugin_script[event](params);
@@ -25183,27 +25160,17 @@ glb.lifecycle = {
25183
25160
  };
25184
25161
 
25185
25162
  glb.run_xu_before = [
25186
- "xu-cdn",
25187
- "xu-style",
25188
- "xu-render",
25189
- "xu-for-key",
25190
- "xu-for-val",
25163
+ 'xu-cdn',
25164
+ 'xu-style',
25165
+ 'xu-render',
25166
+ 'xu-for-key',
25167
+ 'xu-for-val',
25191
25168
  // "xu-ui-plugin",
25192
25169
  // "programParameters",
25193
25170
  ];
25194
- glb.run_xu_after = ["xu-bind", "xu-class", "xu-script", "xu-ui-plugin"];
25195
- glb.attr_abbreviations_arr = [
25196
- "xu-click",
25197
- "xu-dblclick",
25198
- "xu-contextmenu",
25199
- "xu-focus",
25200
- "xu-keyup",
25201
- "xu-change",
25202
- "xu-blur",
25203
- "xu-init",
25204
- ];
25205
- glb.solid_attributes = ["disabled"];
25206
-
25171
+ glb.run_xu_after = ['xu-bind', 'xu-class', 'xu-script', 'xu-ui-plugin'];
25172
+ glb.attr_abbreviations_arr = ['xu-click', 'xu-dblclick', 'xu-contextmenu', 'xu-focus', 'xu-keyup', 'xu-change', 'xu-blur', 'xu-init'];
25173
+ glb.solid_attributes = ['disabled'];
25207
25174
  func.utils = {};
25208
25175
 
25209
25176
  func.utils.debug = {};
@@ -27775,6 +27742,7 @@ func.UI.utils.init_ui_framework = async function (SESSION_ID, prog_id) {
27775
27742
  }
27776
27743
  }
27777
27744
  };
27745
+ // old
27778
27746
  func.UI.utils.get_panels_from_dom = function (SESSION_ID, ignore_disableAutoRefresh) {
27779
27747
  const $elm = func.UI.utils.find_in_element_data('xuPanelData', $(SESSION_OBJ[SESSION_ID].root_element), 'parent_element_ui_id');
27780
27748
  var panels_obj = {};
@@ -27824,13 +27792,6 @@ func.UI.utils.get_panels_wrapper_from_dom = async function (SESSION_ID, $xu_embe
27824
27792
 
27825
27793
  if (!panelXuAttributes) continue; // skip if no longer in dom
27826
27794
 
27827
- // let prog_id = panelXuAttributes?.program;
27828
- // const exp = panelXuAttributes?.['xu-exp:program'];
27829
- // if (exp) {
27830
- // let exp_ret = await func.expression.get(SESSION_ID, exp, $xu_embed_container?.data()?.xuData?.paramsP?.dsSessionP, 'UI Attr EXP');
27831
- // prog_id = func.UI.screen.fix_val_defaults('program', exp_ret.result);
27832
- // }
27833
-
27834
27795
  const xu_ui_id = $panel_div.attr('xu-ui-id');
27835
27796
 
27836
27797
  if (!panels_obj[xu_ui_id]) {
@@ -28977,7 +28938,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
28977
28938
  _ds.data_feed.rows = [];
28978
28939
 
28979
28940
  switch (prog_obj.progDataSource?.dataSourceType) {
28980
- case 'table':
28941
+ case 'table': {
28981
28942
  _ds._dataSourceTableId = prog_obj.progDataSource?.dataSourceTableId; // get file id
28982
28943
 
28983
28944
  if (prog_obj.progDataSource?.dataSourceTableIdExp) {
@@ -29019,8 +28980,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
29019
28980
  filterModelUserSql: _ds.progDataSource.filterModelUserSql,
29020
28981
  };
29021
28982
 
29022
- // _ds.data_feed = {};
29023
-
29024
28983
  _ds.v.raw_data = await func.db.get_query(
29025
28984
  SESSION_ID,
29026
28985
  _ds._dataSourceTableId,
@@ -29038,6 +28997,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
29038
28997
  filterModel,
29039
28998
  _ds?.progDataSource?.dataSourceFilterModelType,
29040
28999
  );
29000
+
29041
29001
  if (_ds?.progDataSource?.dataSourceLimit) {
29042
29002
  const ret_rows_found = await func.db.get_query(
29043
29003
  SESSION_ID,
@@ -29061,7 +29021,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
29061
29021
  _ds.rows_found = _ds?.v?.raw_data?.rows?.length || 0;
29062
29022
  }
29063
29023
  break;
29064
-
29024
+ }
29065
29025
  case 'array': {
29066
29026
  let data = await get_data_from_source();
29067
29027
 
@@ -29109,7 +29069,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
29109
29069
  break;
29110
29070
  }
29111
29071
 
29112
- case 'csv':
29072
+ case 'csv': {
29113
29073
  let data = await get_data_from_source();
29114
29074
  if (data === null) {
29115
29075
  data = '';
@@ -29138,7 +29098,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
29138
29098
  }
29139
29099
  _ds.rows_found = arr?.length || 0;
29140
29100
  break;
29141
-
29101
+ }
29142
29102
  default:
29143
29103
  break;
29144
29104
  }
@@ -29354,6 +29314,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
29354
29314
  }
29355
29315
 
29356
29316
  const row_not_found = async function () {
29317
+ debugger;
29357
29318
  if (!prog_obj.progDataSource?.dataSourceType || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
29358
29319
  _ds.currentRecordId = 'newRecord';
29359
29320
  _ds.set_mode = 'C';
@@ -31852,34 +31813,9 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
31852
31813
  }
31853
31814
  };
31854
31815
 
31855
- func.UI.screen.refresh_screen2 = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
31856
- // const $elm = func.UI.utils.find_in_element_data('xuPanelData', $(SESSION_OBJ[SESSION_ID].root_element), 'parent_element_ui_id');
31857
-
31816
+ func.UI.screen.refresh_screen_old = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
31858
31817
  const panels_obj = func.UI.utils.get_panels_from_dom(SESSION_ID, false);
31859
31818
 
31860
- // const find_field_in_progUi = function (progUi, field_id, prop) {
31861
- // let found;
31862
- // const iterate_progUi = function (node) {
31863
- // for (let item of node) {
31864
- // // if (item.tagName === "xu-panel") {
31865
- // if (!_.isEmpty(item.attributes)) {
31866
- // for (const [attr, val] of Object.entries(item.attributes)) {
31867
- // if (attr === `xu-exp:${prop}`) {
31868
- // found = val.includes('@' + field_id);
31869
- // }
31870
- // }
31871
- // }
31872
- // if (found) break;
31873
- // // }
31874
- // if (item.children) {
31875
- // iterate_progUi(item.children);
31876
- // }
31877
- // }
31878
- // };
31879
- // iterate_progUi(progUi);
31880
- // return found;
31881
- // };
31882
-
31883
31819
  for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
31884
31820
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val._ds.prog_id);
31885
31821
  const progDataSource_str = JSON.stringify(prog_doc.progDataSource);