bkui-vue 0.0.1-beta.76 → 0.0.1-beta.77
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.cjs.js +17 -17
- package/dist/index.esm.js +16 -10
- package/dist/index.umd.js +20 -20
- package/lib/tree/constant.d.ts +2 -1
- package/lib/tree/index.js +1 -1
- package/lib/tree/use-node-attribute.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -21090,6 +21090,7 @@ var NODE_ATTRIBUTES = /* @__PURE__ */ ((NODE_ATTRIBUTES2) => {
|
|
21090
21090
|
NODE_ATTRIBUTES2["IS_CACHED"] = "__is_cached";
|
21091
21091
|
NODE_ATTRIBUTES2["IS_ASYNC"] = "__is_async";
|
21092
21092
|
NODE_ATTRIBUTES2["IS_LOADING"] = "__is_loading";
|
21093
|
+
NODE_ATTRIBUTES2["TREE_NODE_ATTR"] = "__attr__";
|
21093
21094
|
return NODE_ATTRIBUTES2;
|
21094
21095
|
})(NODE_ATTRIBUTES || {});
|
21095
21096
|
const NODE_SOURCE_ATTRS = {
|
@@ -21336,6 +21337,9 @@ var useNodeAttribute = (flatData, props) => {
|
|
21336
21337
|
uuid: getNodeId(item),
|
21337
21338
|
parentId: getNodeAttr2(item, NODE_ATTRIBUTES.PARENT_ID)
|
21338
21339
|
});
|
21340
|
+
const extendNodeAttr = (item) => __spreadProps(__spreadValues({}, item), {
|
21341
|
+
[NODE_ATTRIBUTES.TREE_NODE_ATTR]: resolveScopedSlotParam(item)
|
21342
|
+
});
|
21339
21343
|
return {
|
21340
21344
|
getSchemaVal: getSchemaVal2,
|
21341
21345
|
getNodeAttr: getNodeAttr2,
|
@@ -21357,7 +21361,8 @@ var useNodeAttribute = (flatData, props) => {
|
|
21357
21361
|
getSourceNodeByUID,
|
21358
21362
|
deleteNodeSchema,
|
21359
21363
|
resolveScopedSlotParam,
|
21360
|
-
setTreeNodeLoading
|
21364
|
+
setTreeNodeLoading,
|
21365
|
+
extendNodeAttr
|
21361
21366
|
};
|
21362
21367
|
};
|
21363
21368
|
var useNodeAsync = (props, flatData) => {
|
@@ -21376,7 +21381,7 @@ var useNodeAsync = (props, flatData) => {
|
|
21376
21381
|
updateTreeNode(getNodePath(item), props.data, props.children, props.children, nodeValue);
|
21377
21382
|
return Promise.resolve(resp);
|
21378
21383
|
}
|
21379
|
-
return Promise.
|
21384
|
+
return Promise.resolve(resp);
|
21380
21385
|
};
|
21381
21386
|
const asyncNodeClick = (item) => {
|
21382
21387
|
const {
|
@@ -21438,7 +21443,8 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
|
|
21438
21443
|
isItemOpen,
|
21439
21444
|
isNodeOpened,
|
21440
21445
|
isNodeLoading,
|
21441
|
-
resolveScopedSlotParam
|
21446
|
+
resolveScopedSlotParam,
|
21447
|
+
extendNodeAttr
|
21442
21448
|
} = useNodeAttribute(flatData, props);
|
21443
21449
|
const {
|
21444
21450
|
registerNextLoop
|
@@ -21475,18 +21481,18 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
|
|
21475
21481
|
};
|
21476
21482
|
const getLoadingIcon = (item) => {
|
21477
21483
|
var _a, _b, _c;
|
21478
|
-
return ((_c = (_b = (_a = ctx.slots).nodeLoading) == null ? void 0 : _b.call(_a,
|
21484
|
+
return ((_c = (_b = (_a = ctx.slots).nodeLoading) == null ? void 0 : _b.call(_a, extendNodeAttr(item))) != null ? _c : isNodeLoading(item)) ? createVNode(spinner, null, null) : "";
|
21479
21485
|
};
|
21480
21486
|
const getActionIcon = (item) => {
|
21481
21487
|
if (ctx.slots.nodeAction) {
|
21482
|
-
return ctx.slots.nodeAction(
|
21488
|
+
return ctx.slots.nodeAction(extendNodeAttr(item));
|
21483
21489
|
}
|
21484
21490
|
let prefixFnVal = null;
|
21485
21491
|
if (isNodeLoading(item)) {
|
21486
21492
|
return getLoadingIcon(item);
|
21487
21493
|
}
|
21488
21494
|
if (typeof props.prefixIcon === "function") {
|
21489
|
-
prefixFnVal = props.prefixIcon(
|
21495
|
+
prefixFnVal = props.prefixIcon(extendNodeAttr(item), "node_action");
|
21490
21496
|
if (prefixFnVal !== "default") {
|
21491
21497
|
return renderPrefixVal(prefixFnVal);
|
21492
21498
|
}
|
@@ -21500,11 +21506,11 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
|
|
21500
21506
|
};
|
21501
21507
|
const getNodePrefixIcon = (item) => {
|
21502
21508
|
if (ctx.slots.nodeType) {
|
21503
|
-
return ctx.slots.nodeType(
|
21509
|
+
return ctx.slots.nodeType(extendNodeAttr(item));
|
21504
21510
|
}
|
21505
21511
|
let prefixFnVal = null;
|
21506
21512
|
if (typeof props.prefixIcon === "function") {
|
21507
|
-
prefixFnVal = props.prefixIcon(
|
21513
|
+
prefixFnVal = props.prefixIcon(extendNodeAttr(item), "node_type");
|
21508
21514
|
if (prefixFnVal !== "default") {
|
21509
21515
|
return renderPrefixVal(prefixFnVal);
|
21510
21516
|
}
|
@@ -21610,7 +21616,7 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
|
|
21610
21616
|
if (!isNodeOpened(item)) {
|
21611
21617
|
hanldeTreeNodeClick(item, e);
|
21612
21618
|
}
|
21613
|
-
ctx.emit(EVENTS.NODE_CLICK, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e);
|
21619
|
+
ctx.emit(EVENTS.NODE_CLICK, item, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e);
|
21614
21620
|
};
|
21615
21621
|
const filterNextNode = (depth, node) => {
|
21616
21622
|
if (isRootNode(node)) {
|
@@ -21657,7 +21663,7 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
|
|
21657
21663
|
"class": resolveClassName("node-content")
|
21658
21664
|
}, [[getNodePrefixIcon(item)], createVNode("span", {
|
21659
21665
|
"class": resolveClassName("node-text")
|
21660
|
-
}, [(_c = (_b = (_a = ctx.slots).node) == null ? void 0 : _b.call(_a,
|
21666
|
+
}, [(_c = (_b = (_a = ctx.slots).node) == null ? void 0 : _b.call(_a, extendNodeAttr(item))) != null ? _c : [getLabel(item, props)]]), (_e = (_d = ctx.slots).nodeAppend) == null ? void 0 : _e.call(_d, extendNodeAttr(item))]), getVirtualLines(item)])]);
|
21661
21667
|
};
|
21662
21668
|
return {
|
21663
21669
|
renderTreeNode,
|