@xuda.io/runtime-bundle 1.0.347 → 1.0.349

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.
@@ -8042,10 +8042,10 @@ func.utils.get_last_datasource_no = function (SESSION_ID) {
8042
8042
  func.UI.utils.indicator = {};
8043
8043
  func.UI.utils.indicator.worker = {};
8044
8044
  func.UI.utils.indicator.worker.busy = function () {
8045
- $(".progressLoader").addClass("progress_busy");
8045
+ $('.progressLoader').addClass('progress_busy');
8046
8046
  };
8047
8047
  func.UI.utils.indicator.worker.normal = function () {
8048
- $(".progressLoader").removeClass("progress_busy");
8048
+ $('.progressLoader').removeClass('progress_busy');
8049
8049
  };
8050
8050
  func.UI.utils.indicator.server = {};
8051
8051
  func.UI.utils.indicator.server.busy = function () {
@@ -8057,10 +8057,10 @@ func.UI.utils.indicator.server.normal = function () {
8057
8057
 
8058
8058
  func.UI.utils.indicator.screen = {};
8059
8059
  func.UI.utils.indicator.screen.busy = function () {
8060
- $(".progressLoader").addClass("progress_busy2");
8060
+ $('.progressLoader').addClass('progress_busy2');
8061
8061
  };
8062
8062
  func.UI.utils.indicator.screen.normal = function () {
8063
- $(".progressLoader").removeClass("progress_busy2");
8063
+ $('.progressLoader').removeClass('progress_busy2');
8064
8064
  };
8065
8065
 
8066
8066
  func.UI.utils.save = function (SESSION_ID, stateP) {
@@ -8070,7 +8070,7 @@ func.UI.utils.save = function (SESSION_ID, stateP) {
8070
8070
 
8071
8071
  func.UI.utils.screen_blocker = function (onP, idP, dsP) {
8072
8072
  if (!idP) {
8073
- func.utils.debug_report("", "Worker", "Missing reference id", "E");
8073
+ func.utils.debug_report('', 'Worker', 'Missing reference id', 'E');
8074
8074
  return;
8075
8075
  }
8076
8076
  window.oncontextmenu = function () {
@@ -8083,33 +8083,20 @@ func.UI.utils.screen_blocker = function (onP, idP, dsP) {
8083
8083
  return;
8084
8084
  }
8085
8085
 
8086
- if (idP !== "Worker") {
8086
+ if (idP !== 'Worker') {
8087
8087
  SCREEN_BLOCKER_OBJ[idP] = Date.now();
8088
8088
  }
8089
8089
  };
8090
8090
 
8091
- func.UI.utils.get_node_elm = function (
8092
- SESSION_ID,
8093
- dsSessionP,
8094
- ui_idP,
8095
- $container,
8096
- is_app_panel,
8097
- ui_type,
8098
- functionP
8099
- ) {
8091
+ func.UI.utils.get_node_elm = function (SESSION_ID, dsSessionP, ui_idP, $container, is_app_panel, ui_type, functionP) {
8100
8092
  if (!$container) {
8101
- $container = $("body");
8093
+ $container = $('body');
8102
8094
  }
8103
- var $elm = func.UI.utils.find_in_element_data(
8104
- is_app_panel ? "xuPanelData" : "xuData",
8105
- $container,
8106
- "ui_id",
8107
- ui_idP
8108
- );
8095
+ var $elm = func.UI.utils.find_in_element_data(is_app_panel ? 'xuPanelData' : 'xuData', $container, 'ui_id', ui_idP);
8109
8096
  const _session = SESSION_OBJ[SESSION_ID];
8110
8097
  var _ds = _session.DS_GLB[dsSessionP];
8111
8098
 
8112
- if (_ds.tree_obj.renderType === "form") {
8099
+ if (_ds.tree_obj.renderType === 'form') {
8113
8100
  return $elm;
8114
8101
  }
8115
8102
  var $grid_elm;
@@ -8123,47 +8110,17 @@ func.UI.utils.get_node_elm = function (
8123
8110
 
8124
8111
  return $elm;
8125
8112
  };
8126
- func.UI.utils.get_nodeId = function (
8127
- SESSION_ID,
8128
- dsSessionP,
8129
- ui_idP,
8130
- $container,
8131
- is_app_panel
8132
- ) {
8133
- var $elm = func.UI.utils.get_node_elm(
8134
- SESSION_ID,
8135
- dsSessionP,
8136
- ui_idP,
8137
- $container,
8138
- is_app_panel,
8139
- null,
8140
- null
8141
- );
8113
+ func.UI.utils.get_nodeId = function (SESSION_ID, dsSessionP, ui_idP, $container, is_app_panel) {
8114
+ var $elm = func.UI.utils.get_node_elm(SESSION_ID, dsSessionP, ui_idP, $container, is_app_panel, null, null);
8142
8115
 
8143
8116
  if (is_app_panel) {
8144
8117
  return $elm.data().xuData.panel_info.prop.id;
8145
8118
  } else {
8146
- return $elm.attr("nodeId");
8119
+ return $elm.attr('nodeId');
8147
8120
  }
8148
8121
  };
8149
- func.UI.utils.get_element_info = function (
8150
- SESSION_ID,
8151
- dsSessionP,
8152
- ui_idP,
8153
- $container,
8154
- is_app_panel,
8155
- ui_type,
8156
- functionP
8157
- ) {
8158
- var $elm = func.UI.utils.get_node_elm(
8159
- SESSION_ID,
8160
- dsSessionP,
8161
- ui_idP,
8162
- $container,
8163
- is_app_panel,
8164
- ui_type,
8165
- functionP
8166
- );
8122
+ func.UI.utils.get_element_info = function (SESSION_ID, dsSessionP, ui_idP, $container, is_app_panel, ui_type, functionP) {
8123
+ var $elm = func.UI.utils.get_node_elm(SESSION_ID, dsSessionP, ui_idP, $container, is_app_panel, ui_type, functionP);
8167
8124
  var ret = {};
8168
8125
  if ($elm?.length) {
8169
8126
  //length added 20210209
@@ -8181,40 +8138,14 @@ func.UI.utils.get_element_info = function (
8181
8138
  ret.$elm = $elm;
8182
8139
  return ret;
8183
8140
  };
8184
- func.UI.utils.get_ui_id_count = function (
8185
- SESSION_ID,
8186
- dsSessionP,
8187
- ui_idP,
8188
- $container
8189
- ) {
8190
- return func.UI.utils.get_node_elm(
8191
- SESSION_ID,
8192
- dsSessionP,
8193
- ui_idP,
8194
- $container,
8195
- null,
8196
- null
8197
- ).length;
8141
+ func.UI.utils.get_ui_id_count = function (SESSION_ID, dsSessionP, ui_idP, $container) {
8142
+ return func.UI.utils.get_node_elm(SESSION_ID, dsSessionP, ui_idP, $container, null, null).length;
8198
8143
  };
8199
- func.UI.utils.get_ui_info_tree_scope = function (
8200
- SESSION_ID,
8201
- dsP,
8202
- ui_id,
8203
- is_app_panel,
8204
- ui_type,
8205
- $container,
8206
- functionP
8207
- ) {
8144
+ func.UI.utils.get_ui_info_tree_scope = function (SESSION_ID, dsP, ui_id, is_app_panel, ui_type, $container, functionP) {
8208
8145
  var drill_parent = function () {
8209
8146
  if (SESSION_OBJ[SESSION_ID].DS_GLB[dsP].parentDataSourceNo) {
8210
- return func.UI.utils.get_ui_info_tree_scope(
8211
- SESSION_ID,
8212
- SESSION_OBJ[SESSION_ID].DS_GLB[dsP].parentDataSourceNo,
8213
- ui_id,
8214
- is_app_panel,
8215
- ui_type
8216
- );
8217
- } else if (ui_type === "xu-app-page") {
8147
+ return func.UI.utils.get_ui_info_tree_scope(SESSION_ID, SESSION_OBJ[SESSION_ID].DS_GLB[dsP].parentDataSourceNo, ui_id, is_app_panel, ui_type);
8148
+ } else if (ui_type === 'xu-app-page') {
8218
8149
  if (elm_info.$elm.length) {
8219
8150
  return {
8220
8151
  ds: dsP,
@@ -8226,15 +8157,7 @@ func.UI.utils.get_ui_info_tree_scope = function (
8226
8157
  };
8227
8158
  if (!SESSION_OBJ[SESSION_ID].DS_GLB[dsP]) return;
8228
8159
 
8229
- var elm_info = func.UI.utils.get_element_info(
8230
- SESSION_ID,
8231
- dsP,
8232
- ui_id,
8233
- $container,
8234
- is_app_panel,
8235
- ui_type,
8236
- functionP
8237
- );
8160
+ var elm_info = func.UI.utils.get_element_info(SESSION_ID, dsP, ui_id, $container, is_app_panel, ui_type, functionP);
8238
8161
  var id = elm_info.nodeId;
8239
8162
 
8240
8163
  if (!id) {
@@ -8242,9 +8165,7 @@ func.UI.utils.get_ui_info_tree_scope = function (
8242
8165
  } else {
8243
8166
  if (is_app_panel) {
8244
8167
  return {
8245
- ds: func.UI.utils
8246
- .get_node_elm(SESSION_ID, dsP, ui_id, $container, is_app_panel)
8247
- .data().xuData.paramsP.dsSessionP,
8168
+ ds: func.UI.utils.get_node_elm(SESSION_ID, dsP, ui_id, $container, is_app_panel).data().xuData.paramsP.dsSessionP,
8248
8169
  id: id,
8249
8170
  $elm: elm_info.$elm,
8250
8171
  };
@@ -8269,43 +8190,19 @@ func.UI.utils.clean_node_busy = function (node) {
8269
8190
  return node;
8270
8191
  };
8271
8192
 
8272
- func.UI.utils.get_ui_info_tree_scope_sync = function (
8273
- SESSION_ID,
8274
- dsP,
8275
- ui_id,
8276
- ui_type,
8277
- callback,
8278
- $container,
8279
- functionP
8280
- ) {
8193
+ func.UI.utils.get_ui_info_tree_scope_sync = function (SESSION_ID, dsP, ui_id, ui_type, callback, $container, functionP) {
8281
8194
  var ret;
8282
8195
  var is_app_panel = false;
8283
- if (ui_type === "xu-panel") {
8196
+ if (ui_type === 'xu-panel') {
8284
8197
  is_app_panel = true;
8285
8198
  }
8286
8199
 
8287
- ret = func.UI.utils.get_ui_info_tree_scope(
8288
- SESSION_ID,
8289
- dsP,
8290
- ui_id,
8291
- is_app_panel,
8292
- ui_type,
8293
- $container,
8294
- functionP
8295
- );
8200
+ ret = func.UI.utils.get_ui_info_tree_scope(SESSION_ID, dsP, ui_id, is_app_panel, ui_type, $container, functionP);
8296
8201
 
8297
8202
  if (!ret) {
8298
8203
  var attempts = 0;
8299
8204
  const run = function () {
8300
- ret = func.UI.utils.get_ui_info_tree_scope(
8301
- SESSION_ID,
8302
- dsP,
8303
- ui_id,
8304
- is_app_panel,
8305
- ui_type,
8306
- $container,
8307
- functionP
8308
- );
8205
+ ret = func.UI.utils.get_ui_info_tree_scope(SESSION_ID, dsP, ui_id, is_app_panel, ui_type, $container, functionP);
8309
8206
  if (ret || attempts > 10) {
8310
8207
  callback(ret);
8311
8208
  } else {
@@ -8323,22 +8220,19 @@ func.UI.utils.get_ui_info_tree_scope_sync = function (
8323
8220
  };
8324
8221
 
8325
8222
  func.UI.utils.live_preview_element_inspect_on = function (SESSION_ID, service) {
8326
- $.each($("[xu-ui-id]"), function (key, val) {
8327
- $(val).on("mouseenter.live_preview_element_inspector", function () {
8328
- $("body")
8329
- .find(".preview_mark")
8330
- .removeClass("preview_mark")
8331
- .off("click.live_preview_element_inspector");
8332
- $(this).addClass("preview_mark");
8333
- $(this).on("click.live_preview_element_inspector", function (e) {
8223
+ $.each($('[xu-ui-id]'), function (key, val) {
8224
+ $(val).on('mouseenter.live_preview_element_inspector', function () {
8225
+ $('body').find('.preview_mark').removeClass('preview_mark').off('click.live_preview_element_inspector');
8226
+ $(this).addClass('preview_mark');
8227
+ $(this).on('click.live_preview_element_inspector', function (e) {
8334
8228
  const _session = SESSION_OBJ[SESSION_ID];
8335
8229
  console.log($(this).data());
8336
8230
  const data = $(this).data();
8337
8231
  const obj = {
8338
- service: service + "_result",
8232
+ service: service + '_result',
8339
8233
  id: STUDIO_WEBSOCKET_CONNECTION_ID,
8340
8234
  uid: _session.USR_OBJ._id,
8341
- source: "runtime",
8235
+ source: 'runtime',
8342
8236
  app_id: _session.app_id,
8343
8237
  gtp_token: _session.gtp_token,
8344
8238
  session_id: SESSION_ID,
@@ -8346,16 +8240,16 @@ func.UI.utils.live_preview_element_inspect_on = function (SESSION_ID, service) {
8346
8240
  };
8347
8241
 
8348
8242
  switch (service) {
8349
- case "live_preview_element_reference":
8243
+ case 'live_preview_element_reference':
8350
8244
  obj.data = { prog_id: data.xuData.prog_id, node: data.xuData.node };
8351
8245
  break;
8352
- case "live_preview_element_info":
8246
+ case 'live_preview_element_info':
8353
8247
  obj.data = {
8354
8248
  element_info: data.debug_info,
8355
8249
  datasource: _session.DS_GLB[data.paramsP.dsSessionP],
8356
8250
  };
8357
8251
  break;
8358
- case "live_preview_element_dnd":
8252
+ case 'live_preview_element_dnd':
8359
8253
  // code block
8360
8254
  break;
8361
8255
  default:
@@ -8367,49 +8261,37 @@ func.UI.utils.live_preview_element_inspect_on = function (SESSION_ID, service) {
8367
8261
 
8368
8262
  func.UI.utils.live_preview_element_inspect_off();
8369
8263
 
8370
- if (typeof LIVE_PREVIEW_APP_ACTIVE !== "undefined") {
8371
- $(`#live_preview_element_reference_btn`).css("color", "unset");
8372
- $(`#live_preview_element_info_btn`).css("color", "unset");
8264
+ if (typeof LIVE_PREVIEW_APP_ACTIVE !== 'undefined') {
8265
+ $(`#live_preview_element_reference_btn`).css('color', 'unset');
8266
+ $(`#live_preview_element_info_btn`).css('color', 'unset');
8373
8267
  }
8374
8268
  });
8375
8269
  });
8376
8270
 
8377
- $(val).on("mouseleave.live_preview_element_inspector", function () {
8378
- $(this).removeClass("preview_mark");
8379
- $(this).off("click.live_preview_element_inspector");
8271
+ $(val).on('mouseleave.live_preview_element_inspector', function () {
8272
+ $(this).removeClass('preview_mark');
8273
+ $(this).off('click.live_preview_element_inspector');
8380
8274
  });
8381
8275
  });
8382
8276
  };
8383
8277
 
8384
8278
  func.UI.utils.live_preview_element_inspect_off = function () {
8385
- $.each($("[xu-ui-id]"), function (key, val) {
8386
- $(val).off(
8387
- "mouseenter.live_preview_element_inspector mouseleave.live_preview_element_inspector"
8388
- );
8279
+ $.each($('[xu-ui-id]'), function (key, val) {
8280
+ $(val).off('mouseenter.live_preview_element_inspector mouseleave.live_preview_element_inspector');
8389
8281
  });
8390
- $("body")
8391
- .find(".preview_mark")
8392
- .removeClass("preview_mark")
8393
- .off("click.live_preview_element_inspector");
8282
+ $('body').find('.preview_mark').removeClass('preview_mark').off('click.live_preview_element_inspector');
8394
8283
  };
8395
8284
 
8396
8285
  func.UI.utils.live_preview_show_selected_element = function (nodeid) {
8397
- $("body").find(".preview_mark").removeClass("preview_mark");
8398
- $(`[nodeid="${nodeid}"]`).addClass("preview_mark");
8286
+ $('body').find('.preview_mark').removeClass('preview_mark');
8287
+ $(`[nodeid="${nodeid}"]`).addClass('preview_mark');
8399
8288
  };
8400
8289
 
8401
8290
  func.UI.utils.get_url_attribute = function (SESSION_ID, key) {
8402
8291
  var ret = glb.URL_PARAMS.get(key);
8403
8292
 
8404
8293
  const _session = SESSION_OBJ[SESSION_ID];
8405
- return (
8406
- glb.URL_PARAMS.get(key) ||
8407
- $(_session.root_element).attr(key) ||
8408
- _session.opt?.params?.[key] ||
8409
- _session.opt[key] ||
8410
- $.cookie(key) ||
8411
- window.localStorage.getItem(key)
8412
- );
8294
+ return glb.URL_PARAMS.get(key) || $(_session.root_element).attr(key) || _session.opt?.params?.[key] || _session.opt[key] || $.cookie(key) || window.localStorage.getItem(key);
8413
8295
  };
8414
8296
 
8415
8297
  func.UI.utils.get_root_element_attributes = function (SESSION_ID) {
@@ -8428,21 +8310,12 @@ func.UI.utils.get_root_element_attributes = function (SESSION_ID) {
8428
8310
  return ret;
8429
8311
  };
8430
8312
 
8431
- func.UI.utils.prompt_confirm_window = async function (
8432
- SESSION_ID,
8433
- messageP,
8434
- picP,
8435
- confirmYesFuncP,
8436
- confirmNoFuncP,
8437
- confirmCancelFuncP,
8438
- title,
8439
- colorP
8440
- ) {
8313
+ func.UI.utils.prompt_confirm_window = async function (SESSION_ID, messageP, picP, confirmYesFuncP, confirmNoFuncP, confirmCancelFuncP, title, colorP) {
8441
8314
  if (confirmNoFuncP) {
8442
8315
  buttons.push({
8443
- text: "Disagree",
8444
- role: "no",
8445
- cssClass: "secondary",
8316
+ text: 'Disagree',
8317
+ role: 'no',
8318
+ cssClass: 'secondary',
8446
8319
  handler: () => {
8447
8320
  confirmNoFuncP();
8448
8321
  },
@@ -8450,9 +8323,9 @@ func.UI.utils.prompt_confirm_window = async function (
8450
8323
  }
8451
8324
  if (confirmYesFuncP) {
8452
8325
  buttons.push({
8453
- text: "Agree",
8454
- role: "yes",
8455
- cssClass: "secondary",
8326
+ text: 'Agree',
8327
+ role: 'yes',
8328
+ cssClass: 'secondary',
8456
8329
  handler: () => {
8457
8330
  confirmYesFuncP();
8458
8331
  },
@@ -8461,9 +8334,9 @@ func.UI.utils.prompt_confirm_window = async function (
8461
8334
 
8462
8335
  if (confirmCancelFuncP) {
8463
8336
  buttons.push({
8464
- text: "Dismiss",
8465
- role: "cancel",
8466
- cssClass: "secondary",
8337
+ text: 'Dismiss',
8338
+ role: 'cancel',
8339
+ cssClass: 'secondary',
8467
8340
  handler: () => {
8468
8341
  confirmCancelFuncP();
8469
8342
  },
@@ -8478,22 +8351,14 @@ func.UI.utils.alert = function (msg) {
8478
8351
  };
8479
8352
 
8480
8353
  func.UI.utils.progressScreen = {};
8481
- func.UI.utils.progressScreen.show = function (
8482
- SESSION_ID,
8483
- textP,
8484
- show_bytesP,
8485
- error,
8486
- progress_off,
8487
- logo_off
8488
- ) {
8354
+ func.UI.utils.progressScreen.show = function (SESSION_ID, textP, show_bytesP, error, progress_off, logo_off) {
8489
8355
  if (glb.IS_WORKER) {
8490
8356
  return;
8491
8357
  }
8492
8358
  const app_obj = APP_OBJ?.[SESSION_OBJ?.[SESSION_ID]?.app_id];
8493
8359
 
8494
- var background_color = "";
8495
- var icon =
8496
- app_obj?._conf?.logo_url || "https://xuda.io/dist/images/xuda_logo.png";
8360
+ var background_color = '';
8361
+ var icon = app_obj?._conf?.logo_url || 'https://xuda.io/dist/images/xuda_logo.png';
8497
8362
  if (app_obj?.app_pic) {
8498
8363
  icon = app_obj.app_pic;
8499
8364
  }
@@ -8511,14 +8376,14 @@ func.UI.utils.progressScreen.show = function (
8511
8376
  }
8512
8377
 
8513
8378
  IS_PROGRESS_SCREEN_OPEN = true;
8514
- var $progressScreen = $("#progressScreen2").empty();
8515
- $(".loader").hide();
8516
- $progressScreen = $("#progressScreen2").css({});
8379
+ var $progressScreen = $('#progressScreen2').empty();
8380
+ $('.loader').hide();
8381
+ $progressScreen = $('#progressScreen2').css({});
8517
8382
 
8518
8383
  if (background_color) {
8519
8384
  $progressScreen.css({
8520
8385
  color: func.common.getContrast_color(background_color),
8521
- "background-color": background_color,
8386
+ 'background-color': background_color,
8522
8387
  });
8523
8388
  }
8524
8389
 
@@ -8539,26 +8404,17 @@ func.UI.utils.progressScreen.show = function (
8539
8404
  // );
8540
8405
  // });
8541
8406
 
8542
- $("#progressScreen2_text").show(500, function () {
8407
+ $('#progressScreen2_text').show(500, function () {
8543
8408
  if (!logo_off) {
8544
8409
  $(this).prepend(`<img class='progressScreen_logo' src='${icon}'>`);
8545
8410
  }
8546
- $(this).append(
8547
- error
8548
- ? error_msg
8549
- : typeof textP === "object"
8550
- ? textP
8551
- : `<p>${textP}</p>`
8552
- );
8411
+ $(this).append(error ? error_msg : typeof textP === 'object' ? textP : `<p>${textP}</p>`);
8553
8412
  });
8554
8413
  }
8555
8414
  }, 500);
8556
8415
 
8557
- $("#progressScreen2").show();
8558
- $("<div>")
8559
- .attr("id", "progressScreen2_text")
8560
- .hide()
8561
- .appendTo($progressScreen);
8416
+ $('#progressScreen2').show();
8417
+ $('<div>').attr('id', 'progressScreen2_text').hide().appendTo($progressScreen);
8562
8418
  // .hide()
8563
8419
  // .fadeIn("slow"); //.append(textP)
8564
8420
  };
@@ -8569,8 +8425,8 @@ func.UI.utils.progressScreen.hide = function () {
8569
8425
  IS_PROGRESS_SCREEN_OPEN = false;
8570
8426
  // window.clearInterval(PROGRESS_INTERVAL);
8571
8427
  // setTimeout(function () {
8572
- $("#progressScreen2").hide(); //fadeOut('fast');
8573
- $("#progressScreen2_text").empty(); //.fadeOut('fast').empty();
8428
+ $('#progressScreen2').hide(); //fadeOut('fast');
8429
+ $('#progressScreen2_text').empty(); //.fadeOut('fast').empty();
8574
8430
  // $("#progressScreen2").css({
8575
8431
  // height: "0px",
8576
8432
  // top: "-100px",
@@ -8579,8 +8435,8 @@ func.UI.utils.progressScreen.hide = function () {
8579
8435
  };
8580
8436
 
8581
8437
  func.UI.utils.find_in_element_data = function (folder, $elm, key, val) {
8582
- return $elm.find("*").filter(function () {
8583
- if (typeof val === "undefined") {
8438
+ return $elm.find('*').filter(function () {
8439
+ if (typeof val === 'undefined') {
8584
8440
  return $(this).data()?.[folder]?.[key];
8585
8441
  }
8586
8442
 
@@ -8589,53 +8445,50 @@ func.UI.utils.find_in_element_data = function (folder, $elm, key, val) {
8589
8445
  };
8590
8446
 
8591
8447
  func.UI.utils.init_ui_framework = async function (SESSION_ID, prog_id) {
8592
- if (typeof glb.SLIM_BUNDLE !== "undefined" || glb.SLIM_BUNDLE) return;
8448
+ if (typeof glb.SLIM_BUNDLE !== 'undefined' || glb.SLIM_BUNDLE) return;
8593
8449
 
8594
8450
  var _session = SESSION_OBJ[SESSION_ID];
8595
8451
  var tree_obj = await func.utils.TREE_OBJ.get(SESSION_ID, prog_id);
8596
8452
  if (_.isEmpty(tree_obj)) {
8597
- return console.error("Error: prog " + prog_id + " not found.");
8453
+ return console.error('Error: prog ' + prog_id + ' not found.');
8598
8454
  }
8599
8455
  const report_error = function (descP, warn) {
8600
8456
  func.utils.debug.log(SESSION_ID, prog_id, {
8601
- module: "component",
8602
- action: "Init",
8603
- source: "install ui framework",
8457
+ module: 'component',
8458
+ action: 'Init',
8459
+ source: 'install ui framework',
8604
8460
  prop: descP,
8605
8461
  details: descP,
8606
8462
  result: null,
8607
8463
  error: warn ? false : true,
8608
8464
  fields: null,
8609
- type: "component",
8465
+ type: 'component',
8610
8466
  prog_id: prog_id,
8611
8467
  });
8612
8468
  };
8613
8469
  const plugin_name = tree_obj.uiFramework;
8614
8470
 
8615
8471
  if (!plugin_name) {
8616
- return report_error("no frameworks plugin defined", true);
8472
+ return report_error('no frameworks plugin defined', true);
8617
8473
  }
8618
8474
 
8619
8475
  if (plugin_name === UI_FRAMEWORK_INSTALLED) return;
8620
8476
 
8621
- const _plugin =
8622
- APP_OBJ[_session.app_id]?.app_plugins_purchased?.[plugin_name];
8477
+ const _plugin = APP_OBJ[_session.app_id]?.app_plugins_purchased?.[plugin_name];
8623
8478
 
8624
8479
  if (!_plugin?.installed) {
8625
8480
  return report_error(`plugin ${plugin_name} not installed`);
8626
8481
  }
8627
8482
 
8628
8483
  const get_path = function (plugin_name, resource) {
8629
- var path = `https://${_session.domain}/plugins/${plugin_name}${resource ? "/" + resource : ""
8630
- }?app_id=${_session.app_id}`;
8484
+ var path = `https://${_session.domain}/plugins/${plugin_name}${resource ? '/' + resource : ''}?app_id=${_session.app_id}`;
8631
8485
 
8632
8486
  return path;
8633
8487
  };
8634
8488
 
8635
8489
  var _ui_framework_index;
8636
8490
  try {
8637
- const runtime_mjs = `${_plugin.manifest["runtime.mjs"].dist ? "dist/" : ""
8638
- }runtime.mjs`;
8491
+ const runtime_mjs = `${_plugin.manifest['runtime.mjs'].dist ? 'dist/' : ''}runtime.mjs`;
8639
8492
 
8640
8493
  _ui_framework_index = await import(get_path(plugin_name, runtime_mjs));
8641
8494
  } catch (error) {
@@ -8658,31 +8511,23 @@ func.UI.utils.init_ui_framework = async function (SESSION_ID, prog_id) {
8658
8511
  const ui_framework_core = new _ui_framework_index.core();
8659
8512
  if (ui_framework_core.init) {
8660
8513
  try {
8661
- const setup_mjs = `${_plugin.manifest["index.mjs"].dist ? "dist/" : ""
8662
- }index.mjs`;
8663
- _ui_framework_dashboard_setup = await import(
8664
- get_path(plugin_name, setup_mjs)
8665
- );
8514
+ const setup_mjs = `${_plugin.manifest['index.mjs'].dist ? 'dist/' : ''}index.mjs`;
8515
+ _ui_framework_dashboard_setup = await import(get_path(plugin_name, setup_mjs));
8666
8516
  if (_ui_framework_dashboard_setup) {
8667
- _ui_framework_dashboard_setup_data_ret =
8668
- await func.utils.get_plugin_setup(SESSION_ID, plugin_name);
8517
+ _ui_framework_dashboard_setup_data_ret = await func.utils.get_plugin_setup(SESSION_ID, plugin_name);
8669
8518
  }
8670
- } catch (error) { }
8519
+ } catch (error) {}
8671
8520
  }
8672
8521
 
8673
8522
  if (plugin_name !== UI_FRAMEWORK_INSTALLED) {
8674
8523
  UI_FRAMEWORK_INSTALLED = plugin_name;
8675
- const _plugin_INSTALLED =
8676
- APP_OBJ[_session.app_id]?.app_plugins_purchased?.[UI_FRAMEWORK_INSTALLED];
8524
+ const _plugin_INSTALLED = APP_OBJ[_session.app_id]?.app_plugins_purchased?.[UI_FRAMEWORK_INSTALLED];
8677
8525
  UI_FRAMEWORK_PLUGIN = _ui_framework_index;
8678
8526
  if (UI_FRAMEWORK_INSTALLED) {
8679
8527
  var _current_ui_framework_runtime;
8680
8528
  try {
8681
- const _runtime_mjs = `${_plugin_INSTALLED.manifest["runtime.mjs"].dist ? "dist/" : ""
8682
- }runtime.mjs`;
8683
- _current_ui_framework_runtime = await import(
8684
- get_path(UI_FRAMEWORK_INSTALLED, _runtime_mjs)
8685
- );
8529
+ const _runtime_mjs = `${_plugin_INSTALLED.manifest['runtime.mjs'].dist ? 'dist/' : ''}runtime.mjs`;
8530
+ _current_ui_framework_runtime = await import(get_path(UI_FRAMEWORK_INSTALLED, _runtime_mjs));
8686
8531
  } catch (error) {
8687
8532
  return report_error(`plugin ${UI_FRAMEWORK_INSTALLED} not found`);
8688
8533
  }
@@ -8706,19 +8551,19 @@ func.UI.utils.init_ui_framework = async function (SESSION_ID, prog_id) {
8706
8551
 
8707
8552
  var url = val.url;
8708
8553
  switch (val.type) {
8709
- case "module":
8554
+ case 'module':
8710
8555
  try {
8711
8556
  // ret = await load_module(url);
8712
- ret = await func.utils.load_js_on_demand(url, "module");
8557
+ ret = await func.utils.load_js_on_demand(url, 'module');
8713
8558
  } catch (error) {
8714
8559
  debugger;
8715
8560
  }
8716
8561
 
8717
8562
  break;
8718
- case "css":
8563
+ case 'css':
8719
8564
  ret = func.utils.load_css_on_demand(url);
8720
8565
  break;
8721
- case "js":
8566
+ case 'js':
8722
8567
  ret = await func.utils.load_js_on_demand(url);
8723
8568
  break;
8724
8569
 
@@ -8731,25 +8576,18 @@ func.UI.utils.init_ui_framework = async function (SESSION_ID, prog_id) {
8731
8576
  }
8732
8577
  }
8733
8578
  if (ui_framework_core.init) {
8734
- init_id = await ui_framework_core.init(
8735
- _ui_framework_dashboard_setup_data_ret?.code > -1 &&
8736
- _ui_framework_dashboard_setup_data_ret.data
8737
- );
8579
+ init_id = await ui_framework_core.init(_ui_framework_dashboard_setup_data_ret?.code > -1 && _ui_framework_dashboard_setup_data_ret.data);
8738
8580
  UI_FRAMEWORK_PLUGIN.init_id = init_id;
8739
8581
  }
8740
8582
  }
8741
8583
  };
8742
8584
  func.UI.utils.get_panels_from_dom = function (SESSION_ID, ignore_disableAutoRefresh) {
8743
- const $elm = func.UI.utils.find_in_element_data(
8744
- "xuPanelData",
8745
- $(SESSION_OBJ[SESSION_ID].root_element),
8746
- "parent_element_ui_id"
8747
- );
8585
+ const $elm = func.UI.utils.find_in_element_data('xuPanelData', $(SESSION_OBJ[SESSION_ID].root_element), 'parent_element_ui_id');
8748
8586
  var panels_obj = {};
8749
8587
 
8750
8588
  // set panels_obj
8751
8589
  for (const [elem_key, elem_val] of Object.entries($elm)) {
8752
- if (elem_key === "length") break;
8590
+ if (elem_key === 'length') break;
8753
8591
  var $div = $(elem_val);
8754
8592
  let xuData = $div.data().xuData;
8755
8593
 
@@ -8772,11 +8610,11 @@ func.UI.utils.get_panels_from_dom = function (SESSION_ID, ignore_disableAutoRefr
8772
8610
  ids: [],
8773
8611
  };
8774
8612
  }
8775
- panels_obj[parent_element_ui_id].ids.push($div.attr("xu-ui-id"));
8613
+ panels_obj[parent_element_ui_id].ids.push($div.attr('xu-ui-id'));
8776
8614
  }
8777
8615
 
8778
- return panels_obj
8779
- }
8616
+ return panels_obj;
8617
+ };
8780
8618
 
8781
8619
  func.UI.worker = {};
8782
8620
  func.UI.worker.ID = null;
@@ -8852,11 +8690,7 @@ func.UI.worker.init = async function (SESSION_ID) {
8852
8690
  let from_job_num_to_run = last_job_in_queue;
8853
8691
  last_job_in_queue = UI_WORKER_OBJ.num - from_job_num_to_run;
8854
8692
 
8855
- if (
8856
- typeof UI_WORKER_OBJ.stat === "undefined" ||
8857
- UI_WORKER_OBJ.stat === "undefined" ||
8858
- UI_WORKER_OBJ.stat === null
8859
- ) {
8693
+ if (typeof UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === null) {
8860
8694
  // idle
8861
8695
  this.attempt = 0;
8862
8696
  if (UI_WORKER_OBJ.jobs.length) {
@@ -8900,16 +8734,7 @@ func.UI.worker.init = async function (SESSION_ID) {
8900
8734
  func.UI.garbage_collector();
8901
8735
  }, 10000);
8902
8736
  };
8903
- func.UI.worker.add_to_queue = async function (
8904
- SESSION_ID,
8905
- source,
8906
- functionP,
8907
- paramsP,
8908
- calling_job,
8909
- elementP,
8910
- dsSession,
8911
- calling_trigger_prop
8912
- ) {
8737
+ func.UI.worker.add_to_queue = async function (SESSION_ID, source, functionP, paramsP, calling_job, elementP, dsSession, calling_trigger_prop) {
8913
8738
  // try {
8914
8739
  // let params = _.cloneDeep(paramsP);
8915
8740
 
@@ -8954,15 +8779,8 @@ func.UI.worker.add_to_queue = async function (
8954
8779
  // obj.parentDataSourceNo = _ds.parentDataSourceNo;
8955
8780
  // obj.nodeId = _ds.nodeId;
8956
8781
  // }
8957
- if (functionP === "execute_xu_all_attributes") {
8958
- const queue_key =
8959
- source +
8960
- "_" +
8961
- functionP +
8962
- "_" +
8963
- (elementP?.attr("xu-ui-id") || "") +
8964
- "_" +
8965
- (paramsP?.fields_arr?.toString() || "");
8782
+ if (functionP === 'execute_xu_all_attributes') {
8783
+ const queue_key = source + '_' + functionP + '_' + (elementP?.attr('xu-ui-id') || '') + '_' + (paramsP?.fields_arr?.toString() || '');
8966
8784
 
8967
8785
  obj.queue_key = queue_key;
8968
8786
 
@@ -8984,21 +8802,17 @@ func.UI.worker.add_to_queue = async function (
8984
8802
  if (calling_job) {
8985
8803
  var job_index = func.UI.worker.find_job_index(SESSION_ID, calling_job);
8986
8804
 
8987
- if (job_index === null || typeof job_index === "undefined") return;
8805
+ if (job_index === null || typeof job_index === 'undefined') return;
8988
8806
 
8989
8807
  try {
8990
8808
  if (!UI_WORKER_OBJ.jobs[job_index].splice_count) {
8991
8809
  UI_WORKER_OBJ.jobs[job_index].splice_count = 0;
8992
8810
  }
8993
8811
  UI_WORKER_OBJ.jobs[job_index].splice_count++;
8994
- UI_WORKER_OBJ.jobs.splice(
8995
- job_index + UI_WORKER_OBJ.jobs[job_index].splice_count,
8996
- 0,
8997
- obj
8998
- );
8812
+ UI_WORKER_OBJ.jobs.splice(job_index + UI_WORKER_OBJ.jobs[job_index].splice_count, 0, obj);
8999
8813
  // }
9000
8814
  } catch (e) {
9001
- console.error("bug");
8815
+ console.error('bug');
9002
8816
  // UI_WORKER_OBJ.jobs.splice(0, 0, obj);
9003
8817
  }
9004
8818
  } else {
@@ -9029,16 +8843,9 @@ func.UI.worker.delete_job = async function (SESSION_ID, jobNoP) {
9029
8843
  var dsSession = UI_WORKER_OBJ.jobs[job_index].dsSession;
9030
8844
  let ds_obj = _session?.DS_GLB[dsSession];
9031
8845
  if (ds_obj) {
9032
- delete SCREEN_BLOCKER_OBJ[
9033
- ds_obj.screenId +
9034
- (ds_obj.callingScreenId ? "_" + ds_obj.callingScreenId : "")
9035
- ];
8846
+ delete SCREEN_BLOCKER_OBJ[ds_obj.screenId + (ds_obj.callingScreenId ? '_' + ds_obj.callingScreenId : '')];
9036
8847
  }
9037
- if (
9038
- dsSession &&
9039
- ds_obj?.loops_limit &&
9040
- ds_obj?.loops_count < ds_obj?.loops_limit - 1
9041
- ) {
8848
+ if (dsSession && ds_obj?.loops_limit && ds_obj?.loops_count < ds_obj?.loops_limit - 1) {
9042
8849
  return;
9043
8850
  }
9044
8851
  UI_WORKER_OBJ.stat = null;
@@ -9047,7 +8854,7 @@ func.UI.worker.delete_job = async function (SESSION_ID, jobNoP) {
9047
8854
  };
9048
8855
  func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
9049
8856
  var job_index = func.UI.worker.find_job_index(SESSION_ID, queue_obj.job_num);
9050
- if (UI_WORKER_OBJ.jobs?.[job_index]?.stat === "busy") {
8857
+ if (UI_WORKER_OBJ.jobs?.[job_index]?.stat === 'busy') {
9051
8858
  if (queue_obj.jobNoP) UI_WORKER_OBJ.stat = job_index;
9052
8859
  return;
9053
8860
  }
@@ -9058,7 +8865,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
9058
8865
 
9059
8866
  if (queue_obj.jobNoP) UI_WORKER_OBJ.stat = job_index;
9060
8867
  if (UI_WORKER_OBJ.jobs[job_index]) {
9061
- UI_WORKER_OBJ.jobs[job_index].stat = "busy";
8868
+ UI_WORKER_OBJ.jobs[job_index].stat = 'busy';
9062
8869
  }
9063
8870
 
9064
8871
  const fx = {
@@ -9067,7 +8874,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
9067
8874
  _ds.currentRecordId = queue_obj.paramsP.currentRecordId;
9068
8875
 
9069
8876
  var datasource_changes = {
9070
- [_ds.dsSession]: { [_ds.currentRecordId]: "set" },
8877
+ [_ds.dsSession]: { [_ds.currentRecordId]: 'set' },
9071
8878
  };
9072
8879
  await func.datasource.update(SESSION_ID, datasource_changes);
9073
8880
 
@@ -9087,26 +8894,12 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
9087
8894
  execute_xu_render_attributes: async function () {
9088
8895
  const _data = queue_obj.paramsP.elem_val.$elm.data();
9089
8896
  if (_data?.xuData?.paramsP) {
9090
- await func.UI.screen.execute_xu_functions(
9091
- SESSION_ID,
9092
- null,
9093
- _data.xuData.$root_container,
9094
- _data.xuData.node,
9095
- _data.xuData.$container,
9096
- _data.xuData.paramsP,
9097
- {},
9098
- queue_obj.jobNoP,
9099
- null,
9100
- null,
9101
- "xu-render",
9102
- queue_obj.paramsP.elem_val.$elm,
9103
- {
9104
- key: "xu-render",
9105
- value: queue_obj.paramsP.attr_value, //? "Y" : "N",
9106
- fields_arr: queue_obj.paramsP.fields_arr,
9107
- jobNoP: queue_obj.jobNoP,
9108
- }
9109
- );
8897
+ await func.UI.screen.execute_xu_functions(SESSION_ID, null, _data.xuData.$root_container, _data.xuData.node, _data.xuData.$container, _data.xuData.paramsP, {}, queue_obj.jobNoP, null, null, 'xu-render', queue_obj.paramsP.elem_val.$elm, {
8898
+ key: 'xu-render',
8899
+ value: queue_obj.paramsP.attr_value, //? "Y" : "N",
8900
+ fields_arr: queue_obj.paramsP.fields_arr,
8901
+ jobNoP: queue_obj.jobNoP,
8902
+ });
9110
8903
  }
9111
8904
 
9112
8905
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
@@ -9116,49 +8909,39 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
9116
8909
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
9117
8910
  };
9118
8911
 
9119
- var $elm = func.UI.utils.find_in_element_data(
9120
- "xuData",
9121
- $(SESSION_OBJ[SESSION_ID].root_element),
9122
- "xu_id",
9123
- queue_obj.paramsP.elem_key
9124
- );
8912
+ var $elm = func.UI.utils.find_in_element_data('xuData', $(SESSION_OBJ[SESSION_ID].root_element), 'xu_id', queue_obj.paramsP.elem_key);
9125
8913
 
9126
8914
  if (!$elm.length) {
9127
8915
  return done();
9128
8916
  }
9129
- for await (const [key, attr] of Object.entries(
9130
- queue_obj.paramsP.elem_val.attributes
9131
- )) {
9132
- if (attr === "xu-exp:xu-render" || attr === "xu-exp:xu-for" || attr === "xu-for" || attr === "xu-exp:xu-bind") {
8917
+ for await (const [key, attr] of Object.entries(queue_obj.paramsP.elem_val.attributes)) {
8918
+ if (attr === 'xu-exp:xu-render' || attr === 'xu-exp:xu-for' || attr === 'xu-for' || attr === 'xu-exp:xu-bind') {
9133
8919
  continue;
9134
8920
  }
9135
8921
 
9136
8922
  var res = {
9137
8923
  result: queue_obj.paramsP.elem_val.$elm.data().xuAttributes[attr],
9138
8924
  };
9139
- if (attr !== "xu-class") {
8925
+ if (attr !== 'xu-class') {
9140
8926
  res = await func.expression.get(
9141
8927
  queue_obj.paramsP.SESSION_ID,
9142
8928
  queue_obj.paramsP.elem_val.$elm.data().xuAttributes[attr],
9143
8929
  queue_obj.paramsP.elem_val.$elm.data().xuData.paramsP.dsSessionP,
9144
- "UI Property EXP",
8930
+ 'UI Property EXP',
9145
8931
  queue_obj.paramsP.elem_val.$elm.data().xuData.recordid,
9146
8932
  null,
9147
8933
  null,
9148
8934
  null,
9149
8935
  null,
9150
8936
  null,
9151
- queue_obj.paramsP.elem_val.$elm.data().xuData.iterate_info
8937
+ queue_obj.paramsP.elem_val.$elm.data().xuData.iterate_info,
9152
8938
  );
9153
8939
  }
9154
8940
 
9155
- const attr_new = attr.split("xu-exp:")[1];
8941
+ const attr_new = attr.split('xu-exp:')[1];
9156
8942
  // REGULAR ATTRIBUTE
9157
- if (attr_new && attr_new.substr(0, 2) !== "xu") {
9158
- queue_obj.paramsP.elem_val.$elm.attr(
9159
- attr_new !== "viewBox" ? attr_new.toLowerCase() : attr_new,
9160
- res.result
9161
- );
8943
+ if (attr_new && attr_new.substr(0, 2) !== 'xu') {
8944
+ queue_obj.paramsP.elem_val.$elm.attr(attr_new !== 'viewBox' ? attr_new.toLowerCase() : attr_new, res.result);
9162
8945
  } else {
9163
8946
  try {
9164
8947
  // XU ATTRIBUTE
@@ -9166,24 +8949,10 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
9166
8949
  if (!_data || _.isEmpty(_data)) {
9167
8950
  continue;
9168
8951
  }
9169
- await func.UI.screen.execute_xu_functions(
9170
- SESSION_ID,
9171
- null,
9172
- _data.xuData.$root_container,
9173
- _data.xuData.node,
9174
- _data.xuData.$container,
9175
- _data.xuData.paramsP,
9176
- {},
9177
- queue_obj.jobNoP,
9178
- null,
9179
- null,
9180
- attr_new || attr,
9181
- queue_obj.paramsP.elem_val.$elm,
9182
- {
9183
- key: attr_new || attr,
9184
- value: res.result,
9185
- }
9186
- );
8952
+ await func.UI.screen.execute_xu_functions(SESSION_ID, null, _data.xuData.$root_container, _data.xuData.node, _data.xuData.$container, _data.xuData.paramsP, {}, queue_obj.jobNoP, null, null, attr_new || attr, queue_obj.paramsP.elem_val.$elm, {
8953
+ key: attr_new || attr,
8954
+ value: res.result,
8955
+ });
9187
8956
  } catch (error) {
9188
8957
  debugger;
9189
8958
  }
@@ -9200,7 +8969,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
9200
8969
  // queue_obj.paramsP.elem_key
9201
8970
  // );
9202
8971
 
9203
- var $elm = queue_obj?.paramsP?.elem_val?.$elm;// $(SESSION_OBJ[SESSION_ID].root_element).find(`[xu-ui-id=${queue_obj.paramsP.elem_key}]`)
8972
+ var $elm = queue_obj?.paramsP?.elem_val?.$elm; // $(SESSION_OBJ[SESSION_ID].root_element).find(`[xu-ui-id=${queue_obj.paramsP.elem_key}]`)
9204
8973
 
9205
8974
  if (!$elm?.length) {
9206
8975
  // return func.events.delete_job(SESSION_ID, queue_obj.jobNoP);
@@ -9220,7 +8989,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
9220
8989
  null,
9221
8990
  _data.xuData.parent_node,
9222
8991
  null,
9223
- _data.xuData.$root_container
8992
+ _data.xuData.$root_container,
9224
8993
  );
9225
8994
 
9226
8995
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
@@ -9241,10 +9010,7 @@ func.UI.worker.find_job_index = function (SESSION_ID, jobNoP) {
9241
9010
  return ret;
9242
9011
  };
9243
9012
 
9244
- func.UI.garbage_collector = function (
9245
- SESSION_ID = Object.keys(SESSION_OBJ)[0],
9246
- re_check
9247
- ) {
9013
+ func.UI.garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0], re_check) {
9248
9014
  // return;
9249
9015
  let _session = SESSION_OBJ[SESSION_ID];
9250
9016
 
@@ -9252,10 +9018,16 @@ func.UI.garbage_collector = function (
9252
9018
  if (_data_system?.SYS_GLOBAL_BOL_AJAX_BUSY) return;
9253
9019
  if (!_data_system?.SYS_GLOBAL_BOL_IDLE) return;
9254
9020
 
9021
+ for (const [key, val] of Object.entries(_data_system._data_system)) {
9022
+ if (!val?.$el?.length) {
9023
+ delete _data_system._data_system[key];
9024
+ }
9025
+ }
9026
+
9255
9027
  let abort;
9256
9028
 
9257
9029
  for (const [dsP, _ds] of Object.entries(_session.DS_GLB)) {
9258
- if (_ds.stat === "busy") {
9030
+ if (_ds.stat === 'busy') {
9259
9031
  abort = true;
9260
9032
  break;
9261
9033
  }
@@ -9267,7 +9039,7 @@ func.UI.garbage_collector = function (
9267
9039
 
9268
9040
  let ds_pending_to_delete = [],
9269
9041
  ds_approve_to_delete = [];
9270
- const $elm = $("body").find("*");
9042
+ const $elm = $('body').find('*');
9271
9043
  for (const [dsP, _ds] of Object.entries(_session.DS_GLB)) {
9272
9044
  if (!_ds.screen_params) continue;
9273
9045
  let found;
@@ -9285,19 +9057,11 @@ func.UI.garbage_collector = function (
9285
9057
  }
9286
9058
  // console.log(ds_pending_to_delete);
9287
9059
 
9288
- const sortedKeys = Object.keys(_session.DS_GLB).sort((a, b) =>
9289
- b.localeCompare(a)
9290
- );
9060
+ const sortedKeys = Object.keys(_session.DS_GLB).sort((a, b) => b.localeCompare(a));
9291
9061
  sortedKeys.forEach((key) => {
9292
9062
  const val = _session.DS_GLB[key];
9293
- if (
9294
- !ds_pending_to_delete.includes(key) &&
9295
- typeof val.parentDataSourceNo !== "undefined" &&
9296
- ds_pending_to_delete.includes(val.parentDataSourceNo.toString())
9297
- ) {
9298
- ds_pending_to_delete = ds_pending_to_delete.filter(
9299
- (item) => item !== val.parentDataSourceNo.toString()
9300
- );
9063
+ if (!ds_pending_to_delete.includes(key) && typeof val.parentDataSourceNo !== 'undefined' && ds_pending_to_delete.includes(val.parentDataSourceNo.toString())) {
9064
+ ds_pending_to_delete = ds_pending_to_delete.filter((item) => item !== val.parentDataSourceNo.toString());
9301
9065
  }
9302
9066
  });
9303
9067
 
@@ -9306,7 +9070,6 @@ func.UI.garbage_collector = function (
9306
9070
  func.datasource.del(SESSION_ID, val);
9307
9071
  }
9308
9072
  };
9309
-
9310
9073
  func.events = {};
9311
9074
  func.events.validate = async function (SESSION_ID, triggerP, dsSessionP, eventIdP, sourceP, argumentsP, return_validation_onlyP) {
9312
9075
  var _session = SESSION_OBJ[SESSION_ID];
@@ -12201,13 +11964,15 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12201
11964
 
12202
11965
  const common_fx = {
12203
11966
  'xu-ref': async function ($elm, val) {
12204
- console.log('xu-ref', $elm, val);
11967
+ // console.log('xu-ref', $elm, val);
11968
+ const _session = SESSION_OBJ[SESSION_ID];
12205
11969
  let _ds_0 = _session.DS_GLB[0];
12206
- if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS']) {
12207
- _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'] = {};
12208
- }
11970
+ // if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS']) {
11971
+ // _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'] = {};
11972
+ // }
12209
11973
  // if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val]) {
12210
- _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val] = { $el: $elm };
11974
+ const _ds = _session.DS_GLB[paramsP.dsSessionP];
11975
+ _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { $el: $elm, ds: _ds, data: _ds?.data_feed?.rows || {}, props: $elm?.data()?.xuData?.properties };
12211
11976
  // }
12212
11977
  return {};
12213
11978
  },