@xuda.io/runtime-bundle 1.0.1263 → 1.0.1265

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.
@@ -8674,10 +8674,10 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8674
8674
  }
8675
8675
 
8676
8676
  const fx = {
8677
- update_datasource: async function () {
8677
+ update_datasource: async function (currentRecordId) {
8678
8678
  if (queue_obj?.paramsP) {
8679
8679
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[queue_obj.dsSession];
8680
- _ds.currentRecordId = queue_obj.paramsP.currentRecordId;
8680
+ _ds.currentRecordId = currentRecordId || queue_obj.paramsP.currentRecordId;
8681
8681
 
8682
8682
  var datasource_changes = {
8683
8683
  [_ds.dsSession]: { [_ds.currentRecordId]: 'set' },
@@ -8815,6 +8815,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8815
8815
  render_viewport: async function () {
8816
8816
  const { nodeP, $div, parent_infoP, $root_container, jobNoP, is_skeleton, paramsP, $container } = queue_obj?.paramsP || {};
8817
8817
  if (nodeP?.children?.length && !$div.children().length) {
8818
+ await fx.update_datasource($div?.data()?.xuData?.currentRecordId);
8818
8819
  $div.removeClass('skeleton');
8819
8820
  for await (const [key, val] of Object.entries(nodeP.children)) {
8820
8821
  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);
@@ -14323,28 +14324,28 @@ func.UI.screen.set_attributes_new = async function (SESSION_ID, is_skeleton, $ro
14323
14324
 
14324
14325
  // ALL
14325
14326
 
14326
- function sortArrayByIncludedStrings(mainArray, searchStrings) {
14327
- return mainArray.sort((a, b) => {
14328
- // Check if 'a' includes any of the search strings
14329
- const aIncludesSearchString = searchStrings.some((str) => a[0].includes(str));
14330
- // Check if 'b' includes any of the search strings
14331
- const bIncludesSearchString = searchStrings.some((str) => b[0].includes(str));
14332
-
14333
- if (aIncludesSearchString && !bIncludesSearchString) {
14334
- // 'a' has a search string, 'b' doesn't, so 'a' comes first
14335
- return -1;
14336
- } else if (!aIncludesSearchString && bIncludesSearchString) {
14337
- // 'b' has a search string, 'a' doesn't, so 'b' comes first
14338
- return 1;
14339
- } else {
14340
- // Both or neither include a search string, maintain original relative order or use another sorting criteria
14341
- // For example, you could sort alphabetically here:
14342
- return -1; //a.localeCompare(b);
14343
- }
14344
- });
14345
- }
14327
+ // function sortArrayByIncludedStrings(mainArray, searchStrings) {
14328
+ // return mainArray.sort((a, b) => {
14329
+ // // Check if 'a' includes any of the search strings
14330
+ // const aIncludesSearchString = searchStrings.some((str) => a[0].includes(str));
14331
+ // // Check if 'b' includes any of the search strings
14332
+ // const bIncludesSearchString = searchStrings.some((str) => b[0].includes(str));
14333
+
14334
+ // if (aIncludesSearchString && !bIncludesSearchString) {
14335
+ // // 'a' has a search string, 'b' doesn't, so 'a' comes first
14336
+ // return -1;
14337
+ // } else if (!aIncludesSearchString && bIncludesSearchString) {
14338
+ // // 'b' has a search string, 'a' doesn't, so 'b' comes first
14339
+ // return 1;
14340
+ // } else {
14341
+ // // Both or neither include a search string, maintain original relative order or use another sorting criteria
14342
+ // // For example, you could sort alphabetically here:
14343
+ // return 0; //a.localeCompare(b);
14344
+ // }
14345
+ // });
14346
+ // }
14346
14347
 
14347
- const sortedAttrs = sortArrayByIncludedStrings(Object.entries(nodeP.attributes), ['xu-exp:xu-render', 'xu-render', 'xu-exp:program', 'program']);
14348
+ // const sortedAttrs = sortArrayByIncludedStrings(Object.entries(nodeP.attributes), ['xu-exp:xu-render', 'xu-render', 'xu-exp:program', 'program']);
14348
14349
 
14349
14350
  for await (const [key, val] of Object.entries(nodeP.attributes)) {
14350
14351
  if (_ret.abort || $container?.data()?.xuData?.pending_to_delete) break;
@@ -8675,10 +8675,10 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8675
8675
  }
8676
8676
 
8677
8677
  const fx = {
8678
- update_datasource: async function () {
8678
+ update_datasource: async function (currentRecordId) {
8679
8679
  if (queue_obj?.paramsP) {
8680
8680
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[queue_obj.dsSession];
8681
- _ds.currentRecordId = queue_obj.paramsP.currentRecordId;
8681
+ _ds.currentRecordId = currentRecordId || queue_obj.paramsP.currentRecordId;
8682
8682
 
8683
8683
  var datasource_changes = {
8684
8684
  [_ds.dsSession]: { [_ds.currentRecordId]: 'set' },
@@ -8816,6 +8816,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8816
8816
  render_viewport: async function () {
8817
8817
  const { nodeP, $div, parent_infoP, $root_container, jobNoP, is_skeleton, paramsP, $container } = queue_obj?.paramsP || {};
8818
8818
  if (nodeP?.children?.length && !$div.children().length) {
8819
+ await fx.update_datasource($div?.data()?.xuData?.currentRecordId);
8819
8820
  $div.removeClass('skeleton');
8820
8821
  for await (const [key, val] of Object.entries(nodeP.children)) {
8821
8822
  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);
@@ -12048,28 +12049,28 @@ func.UI.screen.set_attributes_new = async function (SESSION_ID, is_skeleton, $ro
12048
12049
 
12049
12050
  // ALL
12050
12051
 
12051
- function sortArrayByIncludedStrings(mainArray, searchStrings) {
12052
- return mainArray.sort((a, b) => {
12053
- // Check if 'a' includes any of the search strings
12054
- const aIncludesSearchString = searchStrings.some((str) => a[0].includes(str));
12055
- // Check if 'b' includes any of the search strings
12056
- const bIncludesSearchString = searchStrings.some((str) => b[0].includes(str));
12057
-
12058
- if (aIncludesSearchString && !bIncludesSearchString) {
12059
- // 'a' has a search string, 'b' doesn't, so 'a' comes first
12060
- return -1;
12061
- } else if (!aIncludesSearchString && bIncludesSearchString) {
12062
- // 'b' has a search string, 'a' doesn't, so 'b' comes first
12063
- return 1;
12064
- } else {
12065
- // Both or neither include a search string, maintain original relative order or use another sorting criteria
12066
- // For example, you could sort alphabetically here:
12067
- return -1; //a.localeCompare(b);
12068
- }
12069
- });
12070
- }
12052
+ // function sortArrayByIncludedStrings(mainArray, searchStrings) {
12053
+ // return mainArray.sort((a, b) => {
12054
+ // // Check if 'a' includes any of the search strings
12055
+ // const aIncludesSearchString = searchStrings.some((str) => a[0].includes(str));
12056
+ // // Check if 'b' includes any of the search strings
12057
+ // const bIncludesSearchString = searchStrings.some((str) => b[0].includes(str));
12058
+
12059
+ // if (aIncludesSearchString && !bIncludesSearchString) {
12060
+ // // 'a' has a search string, 'b' doesn't, so 'a' comes first
12061
+ // return -1;
12062
+ // } else if (!aIncludesSearchString && bIncludesSearchString) {
12063
+ // // 'b' has a search string, 'a' doesn't, so 'b' comes first
12064
+ // return 1;
12065
+ // } else {
12066
+ // // Both or neither include a search string, maintain original relative order or use another sorting criteria
12067
+ // // For example, you could sort alphabetically here:
12068
+ // return 0; //a.localeCompare(b);
12069
+ // }
12070
+ // });
12071
+ // }
12071
12072
 
12072
- const sortedAttrs = sortArrayByIncludedStrings(Object.entries(nodeP.attributes), ['xu-exp:xu-render', 'xu-render', 'xu-exp:program', 'program']);
12073
+ // const sortedAttrs = sortArrayByIncludedStrings(Object.entries(nodeP.attributes), ['xu-exp:xu-render', 'xu-render', 'xu-exp:program', 'program']);
12073
12074
 
12074
12075
  for await (const [key, val] of Object.entries(nodeP.attributes)) {
12075
12076
  if (_ret.abort || $container?.data()?.xuData?.pending_to_delete) break;