@xuda.io/xuda-worker-bundle 1.3.2680 → 1.3.2682

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.
Files changed (2) hide show
  1. package/index.js +15 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2818,13 +2818,24 @@ func.runtime.ui.build_xu_ui_id_seed = function (nodeP, dsSessionP, key_path, cur
2818
2818
  const elem_key = `${nodeId}-${key_path}-${currentRecordId}`;
2819
2819
  return `${nodeP.id}-${elem_key}-${dsSessionP?.toString() || ''}`;
2820
2820
  };
2821
+ func.runtime.ui.build_container_key_path = function (container_xu_data, keyP, parent_infoP, nodeP, parent_nodeP) {
2822
+ const key_segment = typeof keyP === 'undefined' || keyP === null ? '0' : `${keyP}`;
2823
+ let key_path = `${container_xu_data?.key_path || '0'}-${key_segment}`;
2824
+ const parent_identity = parent_nodeP?.xu_tree_id || parent_nodeP?.id;
2825
+ const node_identity = nodeP?.xu_tree_id || nodeP?.id;
2826
+ const is_iterated_clone = !!(parent_infoP?.iterate_info && parent_identity && node_identity && parent_identity === node_identity);
2827
+ if (is_iterated_clone) {
2828
+ key_path += '-iter';
2829
+ }
2830
+ return key_path;
2831
+ };
2821
2832
  func.runtime.ui.generate_xu_ui_id = async function (SESSION_ID, nodeP, $container, paramsP, keyP, precomputed) {
2822
2833
  precomputed = precomputed || {};
2823
2834
  const dsSessionP = paramsP.dsSessionP;
2824
2835
  const _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP];
2825
2836
  const containerXuData = precomputed.container_xu_data || func.runtime.ui.get_data($container)?.xuData;
2826
2837
  const currentRecordId = typeof precomputed.currentRecordId !== 'undefined' ? precomputed.currentRecordId : containerXuData?.recordid || _ds?.currentRecordId || '';
2827
- const key_path = precomputed.key_path || `${containerXuData?.key_path || '0'}-${keyP || '0'}`;
2838
+ const key_path = precomputed.key_path || func.runtime.ui.build_container_key_path(containerXuData, keyP, precomputed.parent_infoP, nodeP, precomputed.parent_nodeP);
2828
2839
  const ui_id = func.runtime.ui.build_xu_ui_id_seed(nodeP, dsSessionP, key_path, currentRecordId);
2829
2840
 
2830
2841
  if (func.runtime.ui.ui_id_hash_cache.has(ui_id)) {
@@ -2846,13 +2857,15 @@ func.runtime.ui.create_container = async function (options) {
2846
2857
  const currentRecordId = container_xu_data?.recordid || (_ds ? _ds.currentRecordId : '');
2847
2858
 
2848
2859
  try {
2849
- const key_path = `${container_xu_data?.key_path || '0'}-${options.keyP || '0'}`;
2860
+ const key_path = func.runtime.ui.build_container_key_path(container_xu_data, options.keyP, options.parent_infoP, options.nodeP, options.parent_nodeP);
2850
2861
  const elem_key = `${options.nodeP.xu_tree_id || options.nodeP.id}-${key_path}-${currentRecordId}`;
2851
2862
  const $div = func.runtime.ui.create_container_element(options.div_typeP);
2852
2863
  const new_ui_id = await func.runtime.ui.generate_xu_ui_id(options.SESSION_ID, options.nodeP, options.$container, options.paramsP, options.keyP, {
2853
2864
  container_xu_data,
2854
2865
  currentRecordId,
2855
2866
  key_path,
2867
+ parent_infoP: options.parent_infoP,
2868
+ parent_nodeP: options.parent_nodeP,
2856
2869
  });
2857
2870
 
2858
2871
  func.runtime.ui.apply_container_meta($div, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle",
3
- "version": "1.3.2680",
3
+ "version": "1.3.2682",
4
4
  "description": "xuda framework",
5
5
  "main": "index.js",
6
6
  "scripts": {