bkui-vue 0.0.1-beta.92 → 0.0.1-beta.93

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.
package/dist/index.esm.js CHANGED
@@ -22027,7 +22027,7 @@ var useNodeAsync = (props, flatData) => {
22027
22027
  };
22028
22028
  };
22029
22029
  var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption) => {
22030
- let selectedNodeId = null;
22030
+ let selectedNodeId = props.selected;
22031
22031
  const {
22032
22032
  setNodeAttr,
22033
22033
  getNodePath,
@@ -22126,7 +22126,7 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
22126
22126
  setNodeAttr(item, NODE_ATTRIBUTES.IS_OPEN, newVal);
22127
22127
  if (fireEmit) {
22128
22128
  const emitEvent = isItemOpen(item) ? EVENTS.NODE_EXPAND : EVENTS.NODE_COLLAPSE;
22129
- ctx.emit(emitEvent, [item, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e]);
22129
+ ctx.emit(emitEvent, item, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e);
22130
22130
  }
22131
22131
  };
22132
22132
  const setNodeAction = (args, action, value) => {
@@ -22143,7 +22143,7 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
22143
22143
  }
22144
22144
  if (autoOpenParents) {
22145
22145
  if (isOpen) {
22146
- setNodeAction(resolvedItem, NODE_ATTRIBUTES.IS_OPEN, isOpen);
22146
+ setNodeAction(resolvedItem, NODE_ATTRIBUTES.IS_OPEN, true);
22147
22147
  if (!isRootNode(resolvedItem)) {
22148
22148
  const parentId = getNodeAttr2(resolvedItem, NODE_ATTRIBUTES.PARENT_ID);
22149
22149
  setOpen(parentId, true, true);
@@ -22165,10 +22165,10 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
22165
22165
  if (getNodeAttr2(item, NODE_ATTRIBUTES.IS_LOADING)) {
22166
22166
  registerNextLoop("setNodeOpenedAfterLoading", {
22167
22167
  type: "once",
22168
- fn: () => setNodeOpened(item, !isOpen, e)
22168
+ fn: () => setNodeOpened(item, true, e)
22169
22169
  });
22170
22170
  } else {
22171
- setNodeOpened(item, !isOpen, e);
22171
+ setNodeOpened(item, true, e);
22172
22172
  }
22173
22173
  });
22174
22174
  };
@@ -22193,6 +22193,11 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
22193
22193
  [NODE_ATTRIBUTES.UUID]: selectedNodeId
22194
22194
  }, NODE_ATTRIBUTES.IS_SELECTED, !selected);
22195
22195
  }
22196
+ if (props.selected && props.selected !== selectedNodeId) {
22197
+ setNodeAttr({
22198
+ [NODE_ATTRIBUTES.UUID]: props.selected
22199
+ }, NODE_ATTRIBUTES.IS_SELECTED, !selected);
22200
+ }
22196
22201
  setNodeAttr(resolvedItem, NODE_ATTRIBUTES.IS_SELECTED, selected);
22197
22202
  selectedNodeId = getNodeId(resolvedItem);
22198
22203
  if (autoOpen && nodeList2.length === 1) {
@@ -22521,8 +22526,8 @@ var useTreeInit = (props) => {
22521
22526
  flatten(item, depth, parent, path);
22522
22527
  } else {
22523
22528
  if (typeof item === "object" && item !== null) {
22524
- const uuid2 = `${getUid(item)}`;
22525
22529
  const currentPath = path !== null ? `${path}-${i}` : `${i}`;
22530
+ const uuid2 = `${getUid(item)}`;
22526
22531
  const hasChildren = !!(item[children] || []).length;
22527
22532
  let isOpened = getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_OPEN);
22528
22533
  if (props2.autoOpenParentNode) {
@@ -22530,7 +22535,10 @@ var useTreeInit = (props) => {
22530
22535
  } else {
22531
22536
  isOpened = isNodeOpend(uuid2, item, parent);
22532
22537
  }
22533
- const attrs = {
22538
+ Object.assign(item, {
22539
+ [NODE_ATTRIBUTES.UUID]: uuid2
22540
+ });
22541
+ schema.set(uuid2, {
22534
22542
  [NODE_ATTRIBUTES.DEPTH]: depth,
22535
22543
  [NODE_ATTRIBUTES.INDEX]: i,
22536
22544
  [NODE_ATTRIBUTES.UUID]: uuid2,
@@ -22547,13 +22555,10 @@ var useTreeInit = (props) => {
22547
22555
  [NODE_ATTRIBUTES.IS_ASYNC]: getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_ASYNC),
22548
22556
  [NODE_ATTRIBUTES.IS_LOADING]: getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_LOADING),
22549
22557
  [children]: null
22550
- };
22551
- Object.assign(item, {
22552
- [NODE_ATTRIBUTES.UUID]: uuid2
22553
22558
  });
22554
- schema.set(uuid2, attrs);
22555
22559
  order2 += 1;
22556
- outputData.push(__spreadProps(__spreadValues({}, item), {
22560
+ outputData.push(__spreadProps(__spreadValues({}, JSON.parse(JSON.stringify(item, (k2, v2) => k2 === props2.children ? null : v2))), {
22561
+ [NODE_ATTRIBUTES.IS_OPEN]: isOpened,
22557
22562
  [children]: null
22558
22563
  }));
22559
22564
  if (Object.prototype.hasOwnProperty.call(item, children)) {
@@ -22637,7 +22642,6 @@ var useTreeInit = (props) => {
22637
22642
  };
22638
22643
  watch(() => [props.data], (newData) => {
22639
22644
  var _a2, _b;
22640
- console.log("watch data changed");
22641
22645
  const formatData2 = getFlatdata(props, newData, schemaValues.value);
22642
22646
  flatData.data = formatData2[0];
22643
22647
  flatData.schema = formatData2[1];
@@ -22650,7 +22654,6 @@ var useTreeInit = (props) => {
22650
22654
  });
22651
22655
  if (props.selectable) {
22652
22656
  watch(() => props.selected, (newData) => {
22653
- console.log("watch selected changed");
22654
22657
  afterSelectWatch.length = 0;
22655
22658
  afterSelectEvents.forEach((event) => {
22656
22659
  Reflect.apply(event, globalThis, [newData]);
@@ -22741,7 +22744,7 @@ var Component$5 = defineComponent({
22741
22744
  setNodeAction(resolveNodeItem(item), NODE_ATTRIBUTES.IS_CHECKED, checked);
22742
22745
  };
22743
22746
  onSelected((newData) => {
22744
- setSelect(newData, true, true);
22747
+ setSelect(newData, true, props.autoOpenParentNode);
22745
22748
  });
22746
22749
  const getData = () => flatData;
22747
22750
  ctx.expose({