/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 built by swimly
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

function updateTable(parentRef) {
  let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  if (!parentRef || !parentRef.$children || level >= 6) return;
  const children = parentRef.$children;
  for (let i = 0, len = children.length; i < len; i++) {
    const node = children[i];
    const name = node?.$options?.name;
    if (name && /(TTable|TBaseTable|TPrimaryTable|TEnhancedTable)/i.test(name) && node.refreshTable) {
      node.refreshTable();
      return;
    }
    if (node?.$children?.length) updateTable(node, level + 1);
  }
}
function updateElement(parentRef) {
  updateTable(parentRef);
}
function useDestroyOnClose(parentRef) {
  const updateElement2 = () => {
    updateTable(parentRef);
  };
  return {
    updateElement: updateElement2
  };
}

exports["default"] = useDestroyOnClose;
exports.updateElement = updateElement;
exports.updateTable = updateTable;
//# sourceMappingURL=useDestroyOnClose.js.map
