@xuda.io/runtime-bundle 1.0.461 → 1.0.463

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.
@@ -3053,18 +3053,7 @@ var STUDIO_PEER_CONN_MSG_QUEUE = [];
3053
3053
 
3054
3054
  var CLIENT_ACTIVITY_TS;
3055
3055
 
3056
- glb.REFERENCE_LESS_FUNCTIONS = [
3057
- "update",
3058
- "raise_event",
3059
- "call_library",
3060
- "invoke_action",
3061
- "loader_on",
3062
- "loader_off",
3063
- "emit_event",
3064
- "delay",
3065
- "execute_evaluate_javascript",
3066
- "execute_native_javascript",
3067
- ];
3056
+ glb.REFERENCE_LESS_FUNCTIONS = ['update', 'raise_event', 'call_library', 'invoke_action', 'loader_on', 'loader_off', 'emit_event', 'delay', 'execute_evaluate_javascript', 'execute_native_javascript'];
3068
3057
 
3069
3058
  var CACHE_PROG_UI = {};
3070
3059
 
@@ -3081,7 +3070,7 @@ var ELEMENT_CLICK_EVENT = null;
3081
3070
  var posX = 0; //cursor x
3082
3071
  var posY = 0; //cursor x
3083
3072
  var LOADER_ACTIVE = false;
3084
- var LOADER_TEXT = "";
3073
+ var LOADER_TEXT = '';
3085
3074
  var REFRESHER_IN_PROGRESS = false;
3086
3075
 
3087
3076
  glb.screen_num = 0;
@@ -3094,115 +3083,105 @@ var IS_PROGRESS_SCREEN_OPEN = null;
3094
3083
  var UI_WORKER_OBJ = { jobs: [], num: 9000 };
3095
3084
 
3096
3085
  glb.html5_events_handler = [
3097
- "onabort",
3098
- "onafterprint",
3099
- "onautocomplete",
3100
- "onautocompleteerror",
3101
- "onbeforeprint",
3102
- "onbeforeunload",
3103
- "onblur",
3104
- "oncancel",
3105
- "oncanplay",
3106
- "oncanplaythrough",
3107
- "onchange",
3108
- "onclick",
3109
- "onclose",
3110
- "oncontextmenu",
3111
- "oncopy",
3112
- "oncuechange",
3113
- "oncut",
3114
- "ondblclick",
3115
- "ondrag",
3116
- "ondragend",
3117
- "ondragenter",
3118
- "ondragexit",
3119
- "ondragleave",
3120
- "ondragover",
3121
- "ondragstart",
3122
- "ondrop",
3123
- "ondurationchange",
3124
- "onemptied",
3125
- "onended",
3126
- "onerror",
3127
- "onfocus",
3128
- "onhashchange",
3129
- "oninput",
3130
- "oninvalid",
3131
- "onkeydown",
3132
- "onkeypress",
3133
- "onkeyup",
3134
- "onload",
3135
- "onloadeddata",
3136
- "onloadedmetadata",
3137
- "onloadstart",
3138
- "onmessage",
3139
- "onmousedown",
3140
- "onmouseenter",
3141
- "onmouseleave",
3142
- "onmousemove",
3143
- "onmouseout",
3144
- "onmouseover",
3145
- "onmouseup",
3146
- "onmousewheel",
3147
- "onoffline",
3148
- "ononline",
3149
- "onpagehide",
3150
- "onpageshow",
3151
- "onpaste",
3152
- "onpause",
3153
- "onplay",
3154
- "onplaying",
3155
- "onpopstate",
3156
- "onprogress",
3157
- "onratechange",
3158
- "onreset",
3159
- "onresize",
3160
- "onscroll",
3161
- "onsearch",
3162
- "onseeked",
3163
- "onseeking",
3164
- "onselect",
3165
- "onshow",
3166
- "onsort",
3167
- "onstalled",
3168
- "onstorage",
3169
- "onsubmit",
3170
- "onsuspend",
3171
- "ontimeupdate",
3172
- "ontoggle",
3173
- "onunload",
3174
- "onvolumechange",
3175
- "onwaiting",
3086
+ 'onabort',
3087
+ 'onafterprint',
3088
+ 'onautocomplete',
3089
+ 'onautocompleteerror',
3090
+ 'onbeforeprint',
3091
+ 'onbeforeunload',
3092
+ 'onblur',
3093
+ 'oncancel',
3094
+ 'oncanplay',
3095
+ 'oncanplaythrough',
3096
+ 'onchange',
3097
+ 'onclick',
3098
+ 'onclose',
3099
+ 'oncontextmenu',
3100
+ 'oncopy',
3101
+ 'oncuechange',
3102
+ 'oncut',
3103
+ 'ondblclick',
3104
+ 'ondrag',
3105
+ 'ondragend',
3106
+ 'ondragenter',
3107
+ 'ondragexit',
3108
+ 'ondragleave',
3109
+ 'ondragover',
3110
+ 'ondragstart',
3111
+ 'ondrop',
3112
+ 'ondurationchange',
3113
+ 'onemptied',
3114
+ 'onended',
3115
+ 'onerror',
3116
+ 'onfocus',
3117
+ 'onhashchange',
3118
+ 'oninput',
3119
+ 'oninvalid',
3120
+ 'onkeydown',
3121
+ 'onkeypress',
3122
+ 'onkeyup',
3123
+ 'onload',
3124
+ 'onloadeddata',
3125
+ 'onloadedmetadata',
3126
+ 'onloadstart',
3127
+ 'onmessage',
3128
+ 'onmousedown',
3129
+ 'onmouseenter',
3130
+ 'onmouseleave',
3131
+ 'onmousemove',
3132
+ 'onmouseout',
3133
+ 'onmouseover',
3134
+ 'onmouseup',
3135
+ 'onmousewheel',
3136
+ 'onoffline',
3137
+ 'ononline',
3138
+ 'onpagehide',
3139
+ 'onpageshow',
3140
+ 'onpaste',
3141
+ 'onpause',
3142
+ 'onplay',
3143
+ 'onplaying',
3144
+ 'onpopstate',
3145
+ 'onprogress',
3146
+ 'onratechange',
3147
+ 'onreset',
3148
+ 'onresize',
3149
+ 'onscroll',
3150
+ 'onsearch',
3151
+ 'onseeked',
3152
+ 'onseeking',
3153
+ 'onselect',
3154
+ 'onshow',
3155
+ 'onsort',
3156
+ 'onstalled',
3157
+ 'onstorage',
3158
+ 'onsubmit',
3159
+ 'onsuspend',
3160
+ 'ontimeupdate',
3161
+ 'ontoggle',
3162
+ 'onunload',
3163
+ 'onvolumechange',
3164
+ 'onwaiting',
3176
3165
  ];
3177
3166
 
3178
3167
  glb.lifecycle = {
3179
3168
  plugins: {},
3180
3169
  // queue: [],
3181
- fn_arr: [
3182
- "beforeInit",
3183
- "initialized",
3184
- "systemReady",
3185
- "beforeMounted",
3186
- "mounted",
3187
- ],
3170
+ fn_arr: ['beforeInit', 'initialized', 'systemReady', 'beforeMounted', 'mounted'],
3188
3171
  // add(type, fn, params) {
3189
3172
  // this.queue.push({ type, fn, params });
3190
3173
  // },
3191
3174
  execute: async function (SESSION_ID, event) {
3192
3175
  const _session = SESSION_OBJ[SESSION_ID];
3193
3176
 
3194
- const xu_api = await func.common.get_module(
3177
+ const xu_api = await func.common.get_module(SESSION_ID, 'xuda-api-library.mjs', {
3178
+ func,
3179
+ glb,
3180
+ SESSION_OBJ,
3195
3181
  SESSION_ID,
3196
- "xuda-api-library.mjs",
3197
- {
3198
- func,
3199
- glb,
3200
- SESSION_OBJ,
3201
- SESSION_ID,
3202
- APP_OBJ,
3203
- dsSession: func.utils.get_last_datasource_no(SESSION_ID),
3204
- }
3205
- );
3182
+ APP_OBJ,
3183
+ dsSession: func.utils.get_last_datasource_no(SESSION_ID),
3184
+ });
3206
3185
 
3207
3186
  var params = {
3208
3187
  SESSION_ID,
@@ -3211,9 +3190,7 @@ glb.lifecycle = {
3211
3190
  xu_api,
3212
3191
  };
3213
3192
 
3214
- for await (const [plugin_name, val] of Object.entries(
3215
- glb.lifecycle.plugins
3216
- )) {
3193
+ for await (const [plugin_name, val] of Object.entries(glb.lifecycle.plugins)) {
3217
3194
  if (val?.plugin_script?.[event]) {
3218
3195
  params.setup_data = val.setup_data;
3219
3196
  await val.plugin_script[event](params);
@@ -3223,27 +3200,17 @@ glb.lifecycle = {
3223
3200
  };
3224
3201
 
3225
3202
  glb.run_xu_before = [
3226
- "xu-cdn",
3227
- "xu-style",
3228
- "xu-render",
3229
- "xu-for-key",
3230
- "xu-for-val",
3203
+ 'xu-cdn',
3204
+ 'xu-style',
3205
+ 'xu-render',
3206
+ 'xu-for-key',
3207
+ 'xu-for-val',
3231
3208
  // "xu-ui-plugin",
3232
3209
  // "programParameters",
3233
3210
  ];
3234
- glb.run_xu_after = ["xu-bind", "xu-class", "xu-script", "xu-ui-plugin"];
3235
- glb.attr_abbreviations_arr = [
3236
- "xu-click",
3237
- "xu-dblclick",
3238
- "xu-contextmenu",
3239
- "xu-focus",
3240
- "xu-keyup",
3241
- "xu-change",
3242
- "xu-blur",
3243
- "xu-init",
3244
- ];
3245
- glb.solid_attributes = ["disabled"];
3246
-
3211
+ glb.run_xu_after = ['xu-bind', 'xu-class', 'xu-script', 'xu-ui-plugin'];
3212
+ glb.attr_abbreviations_arr = ['xu-click', 'xu-dblclick', 'xu-contextmenu', 'xu-focus', 'xu-keyup', 'xu-change', 'xu-blur', 'xu-init'];
3213
+ glb.solid_attributes = ['disabled'];
3247
3214
  func.datasource = {};
3248
3215
  func.datasource.create = async function (
3249
3216
  SESSION_ID,
@@ -3886,7 +3853,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
3886
3853
  _ds.data_feed.rows = [];
3887
3854
 
3888
3855
  switch (prog_obj.progDataSource?.dataSourceType) {
3889
- case 'table':
3856
+ case 'table': {
3890
3857
  _ds._dataSourceTableId = prog_obj.progDataSource?.dataSourceTableId; // get file id
3891
3858
 
3892
3859
  if (prog_obj.progDataSource?.dataSourceTableIdExp) {
@@ -3928,8 +3895,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
3928
3895
  filterModelUserSql: _ds.progDataSource.filterModelUserSql,
3929
3896
  };
3930
3897
 
3931
- // _ds.data_feed = {};
3932
-
3933
3898
  _ds.v.raw_data = await func.db.get_query(
3934
3899
  SESSION_ID,
3935
3900
  _ds._dataSourceTableId,
@@ -3947,6 +3912,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
3947
3912
  filterModel,
3948
3913
  _ds?.progDataSource?.dataSourceFilterModelType,
3949
3914
  );
3915
+
3950
3916
  if (_ds?.progDataSource?.dataSourceLimit) {
3951
3917
  const ret_rows_found = await func.db.get_query(
3952
3918
  SESSION_ID,
@@ -3970,7 +3936,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
3970
3936
  _ds.rows_found = _ds?.v?.raw_data?.rows?.length || 0;
3971
3937
  }
3972
3938
  break;
3973
-
3939
+ }
3974
3940
  case 'array': {
3975
3941
  let data = await get_data_from_source();
3976
3942
 
@@ -4018,7 +3984,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
4018
3984
  break;
4019
3985
  }
4020
3986
 
4021
- case 'csv':
3987
+ case 'csv': {
4022
3988
  let data = await get_data_from_source();
4023
3989
  if (data === null) {
4024
3990
  data = '';
@@ -4047,7 +4013,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
4047
4013
  }
4048
4014
  _ds.rows_found = arr?.length || 0;
4049
4015
  break;
4050
-
4016
+ }
4051
4017
  default:
4052
4018
  break;
4053
4019
  }
@@ -4141,7 +4107,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
4141
4107
  break;
4142
4108
  }
4143
4109
 
4144
- case 'get_data':
4110
+ case 'get_data': {
4145
4111
  if (await get_before_record_count()) {
4146
4112
  await func.datasource.execute_view_events(SESSION_ID, dataSourceSession, 'before_record');
4147
4113
  }
@@ -4153,8 +4119,8 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
4153
4119
  }
4154
4120
  await func.datasource.set_outputField(SESSION_ID, dataSourceSession, _ds?.v?.raw_data?.rows, _ds.args);
4155
4121
  break;
4156
-
4157
- case 'set_data':
4122
+ }
4123
+ case 'set_data': {
4158
4124
  if (!prog_obj.progDataSource?.dataSourceType || _ds.progDataSource.dataSourceType !== 'table' || !_ds._dataSourceTableId) {
4159
4125
  return func.utils.debug_report(SESSION_ID, 'Data source', 'Datasource DB Table must be defined for Set Data operation', 'E');
4160
4126
  }
@@ -4244,8 +4210,9 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
4244
4210
  // ret = await callback_datasource();
4245
4211
  await func.datasource.set_outputField(SESSION_ID, dataSourceSession, _ds?.v?.raw_data?.rows, _ds.args);
4246
4212
  break;
4247
-
4248
- case 'component':
4213
+ }
4214
+ case 'component': {
4215
+ debugger;
4249
4216
  _raw_data_rows = _ds?.v.raw_data?.rows || [];
4250
4217
  _ds.rows_processed = 0;
4251
4218
  _ds.viewRangeExp_rows_deleted = 0;
@@ -4343,7 +4310,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
4343
4310
  await finish_form();
4344
4311
 
4345
4312
  break;
4346
-
4313
+ }
4347
4314
  default:
4348
4315
  return func.utils.debug_report(SESSION_ID, 'Data source', 'Program type not defined', 'E');
4349
4316
  }
@@ -8593,6 +8560,7 @@ func.UI.utils.init_ui_framework = async function (SESSION_ID, prog_id) {
8593
8560
  }
8594
8561
  }
8595
8562
  };
8563
+ // old
8596
8564
  func.UI.utils.get_panels_from_dom = function (SESSION_ID, ignore_disableAutoRefresh) {
8597
8565
  const $elm = func.UI.utils.find_in_element_data('xuPanelData', $(SESSION_OBJ[SESSION_ID].root_element), 'parent_element_ui_id');
8598
8566
  var panels_obj = {};
@@ -8642,13 +8610,6 @@ func.UI.utils.get_panels_wrapper_from_dom = async function (SESSION_ID, $xu_embe
8642
8610
 
8643
8611
  if (!panelXuAttributes) continue; // skip if no longer in dom
8644
8612
 
8645
- // let prog_id = panelXuAttributes?.program;
8646
- // const exp = panelXuAttributes?.['xu-exp:program'];
8647
- // if (exp) {
8648
- // let exp_ret = await func.expression.get(SESSION_ID, exp, $xu_embed_container?.data()?.xuData?.paramsP?.dsSessionP, 'UI Attr EXP');
8649
- // prog_id = func.UI.screen.fix_val_defaults('program', exp_ret.result);
8650
- // }
8651
-
8652
8613
  const xu_ui_id = $panel_div.attr('xu-ui-id');
8653
8614
 
8654
8615
  if (!panels_obj[xu_ui_id]) {
@@ -11820,34 +11781,9 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11820
11781
  }
11821
11782
  };
11822
11783
 
11823
- func.UI.screen.refresh_screen2 = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
11824
- // const $elm = func.UI.utils.find_in_element_data('xuPanelData', $(SESSION_OBJ[SESSION_ID].root_element), 'parent_element_ui_id');
11825
-
11784
+ func.UI.screen.refresh_screen_old = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
11826
11785
  const panels_obj = func.UI.utils.get_panels_from_dom(SESSION_ID, false);
11827
11786
 
11828
- // const find_field_in_progUi = function (progUi, field_id, prop) {
11829
- // let found;
11830
- // const iterate_progUi = function (node) {
11831
- // for (let item of node) {
11832
- // // if (item.tagName === "xu-panel") {
11833
- // if (!_.isEmpty(item.attributes)) {
11834
- // for (const [attr, val] of Object.entries(item.attributes)) {
11835
- // if (attr === `xu-exp:${prop}`) {
11836
- // found = val.includes('@' + field_id);
11837
- // }
11838
- // }
11839
- // }
11840
- // if (found) break;
11841
- // // }
11842
- // if (item.children) {
11843
- // iterate_progUi(item.children);
11844
- // }
11845
- // }
11846
- // };
11847
- // iterate_progUi(progUi);
11848
- // return found;
11849
- // };
11850
-
11851
11787
  for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
11852
11788
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val._ds.prog_id);
11853
11789
  const progDataSource_str = JSON.stringify(prog_doc.progDataSource);