bkui-vue 2.1.0-dev-beta.7 → 2.1.0-dev-beta.9
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 +44 -44
- package/dist/index.esm.js +13484 -13350
- package/dist/index.umd.js +44 -44
- package/lib/index.js +1 -1
- package/lib/popover/index.js +15 -19
- package/lib/tree/constant.d.ts +4 -0
- package/lib/tree/index.d.ts +31 -0
- package/lib/tree/index.js +439 -183
- package/lib/tree/props.d.ts +62 -2
- package/lib/tree/tree.d.ts +17 -0
- package/lib/tree/use-node-action.d.ts +1 -1
- package/lib/tree/use-node-async.d.ts +2 -2
- package/lib/tree/use-node-drag.d.ts +1 -1
- package/lib/tree/use-tree-init.d.ts +1 -1
- package/lib/tree/util.d.ts +23 -1
- package/package.json +2 -1
package/lib/index.js
CHANGED
package/lib/popover/index.js
CHANGED
|
@@ -45,7 +45,7 @@ const shared_namespaceObject = x({ ["PlacementEnum"]: () => __WEBPACK_EXTERNAL_M
|
|
|
45
45
|
;// CONCATENATED MODULE: external "vue"
|
|
46
46
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
47
47
|
var external_vue_y = x => () => x
|
|
48
|
-
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentScope"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentScope, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onScopeDispose"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onScopeDispose, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["shallowReadonly"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowReadonly, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
|
|
48
|
+
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentScope"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentScope, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onScopeDispose"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onScopeDispose, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["shallowReadonly"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowReadonly, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["useAttrs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.useAttrs, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
|
|
49
49
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
50
50
|
function _arrayLikeToArray(r, a) {
|
|
51
51
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -332,13 +332,11 @@ function useDelay(options, emit) {
|
|
|
332
332
|
(0,external_vue_namespaceObject.watch)(function () {
|
|
333
333
|
return options.value.isShow;
|
|
334
334
|
}, function (newVal) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
hide();
|
|
341
|
-
}
|
|
335
|
+
// 避免循环更新:只有当状态不一致时才更新
|
|
336
|
+
if (newVal && !isOpen.value) {
|
|
337
|
+
show();
|
|
338
|
+
} else if (!newVal && isOpen.value) {
|
|
339
|
+
hide();
|
|
342
340
|
}
|
|
343
341
|
}, {
|
|
344
342
|
immediate: true
|
|
@@ -3297,12 +3295,14 @@ var EMIT_EVENTS = {
|
|
|
3297
3295
|
};
|
|
3298
3296
|
/* harmony default export */ const popover = ((0,external_vue_namespaceObject.defineComponent)({
|
|
3299
3297
|
name: 'Popover',
|
|
3298
|
+
inheritAttrs: false,
|
|
3300
3299
|
props: PopoverProps,
|
|
3301
3300
|
emits: [EMIT_EVENTS.AFTER_SHOW, EMIT_EVENTS.AFTER_HIDDEN, EMIT_EVENTS.CLICK_OUTSIDE, EMIT_EVENTS.CONTENT_MOUSEENTER, EMIT_EVENTS.CONTENT_MOUSELEAVE, EMIT_EVENTS.UPDATE_IS_SHOW],
|
|
3302
3301
|
setup: function setup(props, _ref) {
|
|
3303
3302
|
var slots = _ref.slots,
|
|
3304
3303
|
emit = _ref.emit,
|
|
3305
3304
|
expose = _ref.expose;
|
|
3305
|
+
var attrs = (0,external_vue_namespaceObject.useAttrs)();
|
|
3306
3306
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
|
3307
3307
|
resolveClassName = _usePrefix.resolveClassName;
|
|
3308
3308
|
// 当前实例 id(用于注册表与事件路径识别)
|
|
@@ -3417,20 +3417,15 @@ var EMIT_EVENTS = {
|
|
|
3417
3417
|
/**
|
|
3418
3418
|
* 解析默认 slot reference 元素
|
|
3419
3419
|
*
|
|
3420
|
-
*
|
|
3421
|
-
*
|
|
3422
|
-
* 从而让 floating-ui 使用错误的 reference 位置,并触发 hide middleware 的 referenceHidden。
|
|
3420
|
+
* referenceWrapperRef 使用 display: contents,自身无布局尺寸,
|
|
3421
|
+
* 因此需要从子元素中找到实际的 reference 元素。
|
|
3423
3422
|
*
|
|
3424
|
-
*
|
|
3423
|
+
* 策略:优先使用第一个元素子节点作为 reference;否则向下寻找第一个具有可见尺寸的 HTMLElement。
|
|
3425
3424
|
*/
|
|
3426
3425
|
var resolveDefaultReferenceElement = function resolveDefaultReferenceElement() {
|
|
3427
3426
|
var wrapper = referenceWrapperRef.value;
|
|
3428
3427
|
if (!wrapper) return null;
|
|
3429
|
-
|
|
3430
|
-
if (wrapperRect.width > 0 || wrapperRect.height > 0) {
|
|
3431
|
-
return wrapper;
|
|
3432
|
-
}
|
|
3433
|
-
// 常见场景:slot 内元素为 absolute,wrapper 自身尺寸为 0,但第一个元素子节点就是实际触发器
|
|
3428
|
+
// display: contents 的元素自身尺寸为 0,直接查找子元素
|
|
3434
3429
|
var firstChild = wrapper.firstElementChild;
|
|
3435
3430
|
if (firstChild instanceof HTMLElement) {
|
|
3436
3431
|
return firstChild;
|
|
@@ -3927,12 +3922,13 @@ var EMIT_EVENTS = {
|
|
|
3927
3922
|
});
|
|
3928
3923
|
}
|
|
3929
3924
|
// 默认情况:渲染 reference 和 floating content
|
|
3925
|
+
// 使用 display: contents 避免影响内部元素布局
|
|
3930
3926
|
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)("span", (0,external_vue_namespaceObject.mergeProps)({
|
|
3931
3927
|
"ref": referenceWrapperRef,
|
|
3932
3928
|
"style": {
|
|
3933
|
-
display: '
|
|
3929
|
+
display: 'contents'
|
|
3934
3930
|
},
|
|
3935
|
-
"class": referenceCls.value
|
|
3931
|
+
"class": [referenceCls.value, attrs["class"]]
|
|
3936
3932
|
}, referenceListeners.value), [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Teleport, {
|
|
3937
3933
|
"disabled": disableTeleport.value,
|
|
3938
3934
|
"to": teleportTo.value
|
package/lib/tree/constant.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare enum EVENTS {
|
|
2
|
+
NODE_ASYNC_LOAD = "nodeAsyncLoad",
|
|
3
|
+
NODE_ASYNC_LOAD_ERROR = "nodeAsyncLoadError",
|
|
2
4
|
NODE_CHECKED = "nodeChecked",
|
|
3
5
|
NODE_CLICK = "nodeClick",
|
|
4
6
|
NODE_COLLAPSE = "nodeCollapse",
|
|
@@ -12,6 +14,8 @@ export declare enum EVENTS {
|
|
|
12
14
|
NODE_SELECTED = "nodeSelected"
|
|
13
15
|
}
|
|
14
16
|
export declare const TreeEmitEventsType: {
|
|
17
|
+
nodeAsyncLoad: (..._args: any[]) => boolean;
|
|
18
|
+
nodeAsyncLoadError: (..._args: any[]) => boolean;
|
|
15
19
|
nodeClick: (..._args: any[]) => boolean;
|
|
16
20
|
nodeCollapse: (..._args: any[]) => boolean;
|
|
17
21
|
nodeExpand: (..._args: any[]) => boolean;
|
package/lib/tree/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ declare const BkTree: {
|
|
|
38
38
|
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
|
39
39
|
default: any;
|
|
40
40
|
};
|
|
41
|
+
onDataChange: import("vue").PropType<import("./props").TreeDataChangeHandler>;
|
|
41
42
|
async: import("vue-types").VueTypeShape<{
|
|
42
43
|
callback: (item: any, cb: any) => Promise<string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
43
44
|
[key: string]: any;
|
|
@@ -134,10 +135,17 @@ declare const BkTree: {
|
|
|
134
135
|
} & {
|
|
135
136
|
default: boolean;
|
|
136
137
|
};
|
|
138
|
+
deepWatch: import("vue-types").VueTypeValidableDef<boolean> & {
|
|
139
|
+
default: boolean;
|
|
140
|
+
} & {
|
|
141
|
+
default: boolean;
|
|
142
|
+
};
|
|
137
143
|
intersectionObserver: import("vue-types").VueTypeDef<boolean | import("./props").IIntersectionObserver> & {
|
|
138
144
|
default: boolean | (() => import("./props").IIntersectionObserver);
|
|
139
145
|
};
|
|
140
146
|
}>> & Readonly<{
|
|
147
|
+
onNodeAsyncLoad?: (...args: any[]) => any;
|
|
148
|
+
onNodeAsyncLoadError?: (...args: any[]) => any;
|
|
141
149
|
onNodeChecked?: (...args: any[]) => any;
|
|
142
150
|
onNodeClick?: (...args: any[]) => any;
|
|
143
151
|
onNodeCollapse?: (...args: any[]) => any;
|
|
@@ -150,6 +158,8 @@ declare const BkTree: {
|
|
|
150
158
|
onNodeExpand?: (...args: any[]) => any;
|
|
151
159
|
onNodeSelected?: (...args: any[]) => any;
|
|
152
160
|
}>, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
161
|
+
nodeAsyncLoad: (..._args: any[]) => boolean;
|
|
162
|
+
nodeAsyncLoadError: (..._args: any[]) => boolean;
|
|
153
163
|
nodeClick: (..._args: any[]) => boolean;
|
|
154
164
|
nodeCollapse: (..._args: any[]) => boolean;
|
|
155
165
|
nodeExpand: (..._args: any[]) => boolean;
|
|
@@ -192,6 +202,7 @@ declare const BkTree: {
|
|
|
192
202
|
nodeContentAction: any;
|
|
193
203
|
keepSlotData: boolean;
|
|
194
204
|
checkStrictly: boolean;
|
|
205
|
+
deepWatch: boolean;
|
|
195
206
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
196
207
|
P: {};
|
|
197
208
|
B: {};
|
|
@@ -238,6 +249,7 @@ declare const BkTree: {
|
|
|
238
249
|
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
|
239
250
|
default: any;
|
|
240
251
|
};
|
|
252
|
+
onDataChange: import("vue").PropType<import("./props").TreeDataChangeHandler>;
|
|
241
253
|
async: import("vue-types").VueTypeShape<{
|
|
242
254
|
callback: (item: any, cb: any) => Promise<string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
243
255
|
[key: string]: any;
|
|
@@ -334,10 +346,17 @@ declare const BkTree: {
|
|
|
334
346
|
} & {
|
|
335
347
|
default: boolean;
|
|
336
348
|
};
|
|
349
|
+
deepWatch: import("vue-types").VueTypeValidableDef<boolean> & {
|
|
350
|
+
default: boolean;
|
|
351
|
+
} & {
|
|
352
|
+
default: boolean;
|
|
353
|
+
};
|
|
337
354
|
intersectionObserver: import("vue-types").VueTypeDef<boolean | import("./props").IIntersectionObserver> & {
|
|
338
355
|
default: boolean | (() => import("./props").IIntersectionObserver);
|
|
339
356
|
};
|
|
340
357
|
}>> & Readonly<{
|
|
358
|
+
onNodeAsyncLoad?: (...args: any[]) => any;
|
|
359
|
+
onNodeAsyncLoadError?: (...args: any[]) => any;
|
|
341
360
|
onNodeChecked?: (...args: any[]) => any;
|
|
342
361
|
onNodeClick?: (...args: any[]) => any;
|
|
343
362
|
onNodeCollapse?: (...args: any[]) => any;
|
|
@@ -380,6 +399,7 @@ declare const BkTree: {
|
|
|
380
399
|
nodeContentAction: any;
|
|
381
400
|
keepSlotData: boolean;
|
|
382
401
|
checkStrictly: boolean;
|
|
402
|
+
deepWatch: boolean;
|
|
383
403
|
}>;
|
|
384
404
|
__isFragment?: never;
|
|
385
405
|
__isTeleport?: never;
|
|
@@ -423,6 +443,7 @@ declare const BkTree: {
|
|
|
423
443
|
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
|
424
444
|
default: any;
|
|
425
445
|
};
|
|
446
|
+
onDataChange: import("vue").PropType<import("./props").TreeDataChangeHandler>;
|
|
426
447
|
async: import("vue-types").VueTypeShape<{
|
|
427
448
|
callback: (item: any, cb: any) => Promise<string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
428
449
|
[key: string]: any;
|
|
@@ -519,10 +540,17 @@ declare const BkTree: {
|
|
|
519
540
|
} & {
|
|
520
541
|
default: boolean;
|
|
521
542
|
};
|
|
543
|
+
deepWatch: import("vue-types").VueTypeValidableDef<boolean> & {
|
|
544
|
+
default: boolean;
|
|
545
|
+
} & {
|
|
546
|
+
default: boolean;
|
|
547
|
+
};
|
|
522
548
|
intersectionObserver: import("vue-types").VueTypeDef<boolean | import("./props").IIntersectionObserver> & {
|
|
523
549
|
default: boolean | (() => import("./props").IIntersectionObserver);
|
|
524
550
|
};
|
|
525
551
|
}>> & Readonly<{
|
|
552
|
+
onNodeAsyncLoad?: (...args: any[]) => any;
|
|
553
|
+
onNodeAsyncLoadError?: (...args: any[]) => any;
|
|
526
554
|
onNodeChecked?: (...args: any[]) => any;
|
|
527
555
|
onNodeClick?: (...args: any[]) => any;
|
|
528
556
|
onNodeCollapse?: (...args: any[]) => any;
|
|
@@ -535,6 +563,8 @@ declare const BkTree: {
|
|
|
535
563
|
onNodeExpand?: (...args: any[]) => any;
|
|
536
564
|
onNodeSelected?: (...args: any[]) => any;
|
|
537
565
|
}>, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
566
|
+
nodeAsyncLoad: (..._args: any[]) => boolean;
|
|
567
|
+
nodeAsyncLoadError: (..._args: any[]) => boolean;
|
|
538
568
|
nodeClick: (..._args: any[]) => boolean;
|
|
539
569
|
nodeCollapse: (..._args: any[]) => boolean;
|
|
540
570
|
nodeExpand: (..._args: any[]) => boolean;
|
|
@@ -577,5 +607,6 @@ declare const BkTree: {
|
|
|
577
607
|
nodeContentAction: any;
|
|
578
608
|
keepSlotData: boolean;
|
|
579
609
|
checkStrictly: boolean;
|
|
610
|
+
deepWatch: boolean;
|
|
580
611
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[], any[]>;
|
|
581
612
|
export default BkTree;
|