bkui-vue 0.0.1-beta.2 → 0.0.1-beta.20
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/README.md +25 -17
- package/README_EN.md +89 -0
- package/dist/bkui-vue.cjs.js +9736 -1174
- package/dist/bkui-vue.esm.js +9873 -1358
- package/dist/bkui-vue.umd.js +9736 -1174
- package/dist/style.css +3189 -166
- package/lib/alert/alert.d.ts +24 -15
- package/lib/alert/alert.variable.css +32 -0
- package/lib/alert/index.d.ts +180 -3
- package/lib/alert/index.js +1 -1
- package/lib/animate-number/animate-number.d.ts +12 -7
- package/lib/animate-number/index.d.ts +97 -2
- package/lib/animate-number/index.js +1 -1
- package/lib/backtop/backtop.d.ts +27 -13
- package/lib/backtop/backtop.variable.css +32 -0
- package/lib/backtop/index.d.ts +166 -2
- package/lib/backtop/index.js +1 -1
- package/lib/badge/badge.d.ts +40 -19
- package/lib/badge/badge.variable.css +32 -0
- package/lib/badge/index.d.ts +217 -2
- package/lib/badge/index.js +1 -1
- package/lib/breadcrumb/breadcrumb-item.d.ts +13 -9
- package/lib/breadcrumb/breadcrumb.css +10 -1
- package/lib/breadcrumb/breadcrumb.d.ts +37 -9
- package/lib/breadcrumb/breadcrumb.less +13 -2
- package/lib/breadcrumb/breadcrumb.variable.css +42 -1
- package/lib/breadcrumb/index.d.ts +144 -43
- package/lib/breadcrumb/index.js +1 -1
- package/lib/button/button-group.d.ts +3 -5
- package/lib/button/button.d.ts +35 -30
- package/lib/button/button.less +6 -6
- package/lib/button/button.variable.css +32 -0
- package/lib/button/index.d.ts +187 -3
- package/lib/button/index.js +1 -1
- package/lib/card/card.d.ts +30 -15
- package/lib/card/card.variable.css +32 -0
- package/lib/card/index.d.ts +187 -2
- package/lib/card/index.js +1 -1
- package/lib/checkbox/checkbox-group.d.ts +13 -9
- package/lib/checkbox/checkbox.d.ts +31 -22
- package/lib/checkbox/checkbox.variable.css +32 -0
- package/lib/checkbox/index.d.ts +261 -2
- package/lib/checkbox/index.js +1 -1
- package/lib/checkbox/type.d.ts +6 -5
- package/lib/collapse/collapse.css +8 -0
- package/lib/collapse/collapse.d.ts +50 -18
- package/lib/collapse/collapse.less +10 -0
- package/lib/collapse/collapse.variable.css +8 -0
- package/lib/collapse/index.d.ts +166 -2
- package/lib/collapse/index.js +1 -1
- package/lib/components.d.ts +37 -0
- package/lib/date-picker/date-picker.css +407 -0
- package/lib/date-picker/date-picker.d.ts +404 -0
- package/lib/date-picker/date-picker.less +526 -0
- package/lib/date-picker/date-picker.variable.css +500 -0
- package/lib/date-picker/fecha.d.ts +6 -0
- package/lib/date-picker/index.d.ts +713 -0
- package/lib/date-picker/index.js +1 -0
- package/lib/date-picker/interface.d.ts +22 -0
- package/lib/date-picker/utils.d.ts +97 -0
- package/lib/dialog/dialog.d.ts +57 -27
- package/lib/dialog/index.d.ts +286 -2
- package/lib/dialog/index.js +1 -1
- package/lib/directives/clickoutside.d.ts +23 -0
- package/lib/directives/index.d.ts +2 -0
- package/lib/directives/index.js +14 -14
- package/lib/directives/tooltips.d.ts +17 -0
- package/lib/divider/divider.css +38 -0
- package/lib/divider/divider.d.ts +48 -0
- package/lib/divider/divider.less +53 -0
- package/lib/divider/divider.variable.css +131 -0
- package/lib/divider/index.d.ts +142 -0
- package/lib/divider/index.js +1 -0
- package/lib/dropdown/dropdown-item.d.ts +19 -0
- package/lib/dropdown/dropdown-menu.d.ts +16 -0
- package/lib/dropdown/dropdown.css +43 -0
- package/lib/dropdown/dropdown.d.ts +61 -0
- package/lib/dropdown/dropdown.less +54 -0
- package/lib/dropdown/dropdown.variable.css +136 -0
- package/lib/dropdown/index.d.ts +192 -0
- package/lib/dropdown/index.js +1 -0
- package/lib/exception/exception.d.ts +11 -9
- package/lib/exception/exception.variable.css +32 -0
- package/lib/exception/index.d.ts +95 -1
- package/lib/exception/index.js +1 -1
- package/lib/fixed-navbar/fixed-navbar.d.ts +15 -9
- package/lib/fixed-navbar/fixed-navbar.variable.css +32 -0
- package/lib/fixed-navbar/index.d.ts +112 -2
- package/lib/fixed-navbar/index.js +1 -1
- package/lib/form/common.d.ts +3 -0
- package/lib/form/form-item.d.ts +159 -0
- package/lib/form/form.css +39 -0
- package/lib/form/form.d.ts +84 -0
- package/lib/form/form.less +50 -0
- package/lib/form/form.variable.css +39 -0
- package/lib/form/index.d.ts +286 -0
- package/lib/form/index.js +1 -0
- package/lib/form/type.d.ts +21 -0
- package/lib/form/validator.d.ts +8 -0
- package/lib/icon/angle-double-down-line.d.ts +4 -0
- package/lib/icon/angle-double-down-line.js +15 -0
- package/lib/icon/angle-double-left-line.d.ts +4 -0
- package/lib/icon/angle-double-left-line.js +15 -0
- package/lib/icon/angle-double-left.d.ts +4 -0
- package/lib/icon/angle-double-left.js +15 -0
- package/lib/icon/angle-double-right-line.d.ts +4 -0
- package/lib/icon/angle-double-right-line.js +15 -0
- package/lib/icon/angle-double-right.d.ts +4 -0
- package/lib/icon/angle-double-right.js +15 -0
- package/lib/icon/angle-double-up-line.d.ts +4 -0
- package/lib/icon/angle-double-up-line.js +15 -0
- package/lib/icon/angle-down-fill.d.ts +4 -0
- package/lib/icon/angle-down-fill.js +15 -0
- package/lib/icon/angle-down-line.d.ts +4 -0
- package/lib/icon/angle-down-line.js +15 -0
- package/lib/icon/angle-down.d.ts +4 -0
- package/lib/icon/angle-down.js +15 -0
- package/lib/icon/angle-left.d.ts +4 -0
- package/lib/icon/angle-left.js +15 -0
- package/lib/icon/angle-right.d.ts +4 -0
- package/lib/icon/angle-right.js +15 -0
- package/lib/icon/angle-up-fill.d.ts +4 -0
- package/lib/icon/angle-up-fill.js +15 -0
- package/lib/icon/angle-up.d.ts +4 -0
- package/lib/icon/angle-up.js +15 -0
- package/lib/icon/arrows-left.d.ts +4 -0
- package/lib/icon/arrows-left.js +15 -0
- package/lib/icon/arrows-right.d.ts +4 -0
- package/lib/icon/arrows-right.js +15 -0
- package/lib/icon/bk.d.ts +4 -0
- package/lib/icon/bk.js +15 -0
- package/lib/icon/circle.d.ts +4 -0
- package/lib/icon/circle.js +15 -0
- package/lib/icon/close.d.ts +4 -0
- package/lib/icon/close.js +15 -0
- package/lib/icon/code.d.ts +4 -0
- package/lib/icon/code.js +15 -0
- package/lib/icon/cog-shape.d.ts +4 -0
- package/lib/icon/cog-shape.js +15 -0
- package/lib/icon/collapse-left.d.ts +4 -0
- package/lib/icon/collapse-left.js +15 -0
- package/lib/icon/copy.d.ts +4 -0
- package/lib/icon/copy.js +15 -0
- package/lib/icon/done.d.ts +4 -0
- package/lib/icon/done.js +15 -0
- package/lib/icon/down-shape.d.ts +4 -0
- package/lib/icon/down-shape.js +15 -0
- package/lib/icon/down-small.d.ts +4 -0
- package/lib/icon/down-small.js +15 -0
- package/lib/icon/ellipsis.d.ts +4 -0
- package/lib/icon/ellipsis.js +15 -0
- package/lib/icon/error.d.ts +4 -0
- package/lib/icon/error.js +15 -0
- package/lib/icon/eye.d.ts +4 -0
- package/lib/icon/eye.js +15 -0
- package/lib/icon/folder-open.d.ts +4 -0
- package/lib/icon/folder-open.js +15 -0
- package/lib/icon/folder-shape-open.d.ts +4 -0
- package/lib/icon/folder-shape-open.js +15 -0
- package/lib/icon/folder-shape.d.ts +4 -0
- package/lib/icon/folder-shape.js +15 -0
- package/lib/icon/folder.d.ts +4 -0
- package/lib/icon/folder.js +15 -0
- package/lib/icon/help-document-fill.d.ts +4 -0
- package/lib/icon/help-document-fill.js +15 -0
- package/lib/icon/help-fill.d.ts +4 -0
- package/lib/icon/help-fill.js +15 -0
- package/lib/icon/help.d.ts +4 -0
- package/lib/icon/help.js +15 -0
- package/lib/icon/icon.d.ts +12 -0
- package/lib/icon/icon.js +15 -0
- package/lib/icon/index.d.ts +42 -0
- package/lib/icon/index.js +1 -1
- package/lib/icon/info-line.d.ts +4 -0
- package/lib/icon/info-line.js +15 -0
- package/lib/icon/info.d.ts +4 -0
- package/lib/icon/info.js +15 -0
- package/lib/icon/left-shape.d.ts +4 -0
- package/lib/icon/left-shape.js +15 -0
- package/lib/icon/play-shape.d.ts +4 -0
- package/lib/icon/play-shape.js +15 -0
- package/lib/icon/plus.d.ts +4 -0
- package/lib/icon/plus.js +15 -0
- package/lib/icon/qq.d.ts +4 -0
- package/lib/icon/qq.js +15 -0
- package/lib/icon/right-shape.d.ts +4 -0
- package/lib/icon/right-shape.js +15 -0
- package/lib/icon/search.d.ts +4 -0
- package/lib/icon/search.js +15 -0
- package/lib/icon/share.d.ts +4 -0
- package/lib/icon/share.js +15 -0
- package/lib/icon/spinner.d.ts +4 -0
- package/lib/icon/spinner.js +15 -0
- package/lib/icon/success.d.ts +4 -0
- package/lib/icon/success.js +15 -0
- package/lib/icon/switcher-loading.d.ts +4 -0
- package/lib/icon/switcher-loading.js +15 -0
- package/lib/icon/text-file.d.ts +4 -0
- package/lib/icon/text-file.js +15 -0
- package/lib/icon/tree-application-shape.d.ts +4 -0
- package/lib/icon/tree-application-shape.js +15 -0
- package/lib/icon/unvisible.d.ts +4 -0
- package/lib/icon/unvisible.js +15 -0
- package/lib/icon/up-shape.d.ts +4 -0
- package/lib/icon/up-shape.js +15 -0
- package/lib/icon/warn.d.ts +4 -0
- package/lib/icon/warn.js +15 -0
- package/lib/icon/weixin.d.ts +4 -0
- package/lib/icon/weixin.js +15 -0
- package/lib/index.d.ts +4 -0
- package/lib/input/index.d.ts +363 -2
- package/lib/input/index.js +2 -2
- package/lib/input/input.css +1 -0
- package/lib/input/input.d.ts +68 -46
- package/lib/input/input.less +4 -3
- package/lib/input/input.variable.css +33 -0
- package/lib/link/index.d.ts +164 -2
- package/lib/link/index.js +1 -1
- package/lib/link/link.d.ts +25 -13
- package/lib/link/link.variable.css +32 -0
- package/lib/loading/index.d.ts +124 -2
- package/lib/loading/index.js +1 -1
- package/lib/loading/loading.d.ts +26 -15
- package/lib/loading/loading.variable.css +32 -0
- package/lib/menu/index.d.ts +188 -0
- package/lib/menu/index.js +1 -0
- package/lib/menu/menu-group.d.ts +14 -0
- package/lib/menu/menu-item.d.ts +16 -0
- package/lib/menu/menu.css +182 -0
- package/lib/menu/menu.d.ts +64 -0
- package/lib/menu/menu.less +180 -0
- package/lib/menu/menu.variable.css +275 -0
- package/lib/menu/submenu.css +3 -0
- package/lib/menu/submenu.d.ts +22 -0
- package/lib/menu/submenu.less +5 -0
- package/lib/menu/submenu.variable.css +96 -0
- package/lib/menu/utils.d.ts +41 -0
- package/lib/message/index.d.ts +2 -0
- package/lib/message/index.js +1 -0
- package/lib/message/message.css +53 -0
- package/lib/message/message.less +61 -0
- package/lib/message/message.variable.css +146 -0
- package/lib/message/messageConstructor.d.ts +73 -0
- package/lib/modal/index.d.ts +214 -3
- package/lib/modal/index.js +1 -1
- package/lib/modal/modal.d.ts +33 -15
- package/lib/modal/props.mixin.d.ts +5 -1
- package/lib/navigation/index.d.ts +2 -0
- package/lib/navigation/index.js +1 -0
- package/lib/navigation/navigation-title.d.ts +25 -0
- package/lib/navigation/navigation.css +184 -0
- package/lib/navigation/navigation.d.ts +111 -0
- package/lib/navigation/navigation.less +210 -0
- package/lib/navigation/navigation.variable.css +277 -0
- package/lib/notify/index.d.ts +2 -0
- package/lib/notify/index.js +1 -0
- package/lib/notify/notify.css +49 -0
- package/lib/notify/notify.less +58 -0
- package/lib/notify/notify.variable.css +142 -0
- package/lib/notify/notifyConstructor.d.ts +91 -0
- package/lib/pagination/index.d.ts +395 -0
- package/lib/pagination/index.js +1 -0
- package/lib/pagination/pagination.css +179 -0
- package/lib/pagination/pagination.d.ts +220 -0
- package/lib/pagination/pagination.less +201 -0
- package/lib/pagination/pagination.variable.css +272 -0
- package/lib/pagination/type.d.ts +6 -0
- package/lib/pagination/use-limit.d.ts +8 -0
- package/lib/pagination/use-list.d.ts +8 -0
- package/lib/pagination/use-small-list.d.ts +5 -0
- package/lib/pagination/use-total.d.ts +5 -0
- package/lib/popover/index.d.ts +287 -27
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.css +23 -14
- package/lib/popover/popover.d.ts +74 -45
- package/lib/popover/popover.less +57 -46
- package/lib/popover/popover.variable.css +55 -14
- package/lib/popover/props.d.ts +77 -0
- package/lib/preset.d.ts +7 -0
- package/lib/process/index.d.ts +205 -0
- package/lib/process/index.js +15 -0
- package/lib/process/process.css +138 -0
- package/lib/process/process.d.ts +131 -0
- package/lib/process/process.less +178 -0
- package/lib/process/process.variable.css +231 -0
- package/lib/progress/index.d.ts +398 -2
- package/lib/progress/index.js +1 -1
- package/lib/progress/progress.css +0 -3
- package/lib/progress/progress.d.ts +88 -35
- package/lib/progress/progress.less +0 -4
- package/lib/progress/progress.variable.css +32 -3
- package/lib/radio/index.d.ts +277 -2
- package/lib/radio/index.js +1 -1
- package/lib/radio/radio-button.d.ts +24 -16
- package/lib/radio/radio-group.d.ts +11 -10
- package/lib/radio/radio.css +6 -0
- package/lib/radio/radio.d.ts +23 -13
- package/lib/radio/radio.less +7 -0
- package/lib/radio/radio.variable.css +38 -0
- package/lib/rate/index.d.ts +113 -2
- package/lib/rate/index.js +1 -1
- package/lib/rate/rate.d.ts +13 -10
- package/lib/rate/star.d.ts +33 -16
- package/lib/select/common.d.ts +13 -3
- package/lib/select/index.d.ts +962 -2
- package/lib/select/index.js +15 -1
- package/lib/select/option.d.ts +12 -19
- package/lib/select/optionGroup.d.ts +130 -0
- package/lib/select/select.css +130 -14
- package/lib/select/select.d.ts +152 -150
- package/lib/select/select.less +164 -26
- package/lib/select/select.variable.css +162 -14
- package/lib/shared/bk-helper-core.d.ts +6 -0
- package/lib/shared/bk-mask-manager.d.ts +32 -3
- package/lib/shared/bk-pop-manager.d.ts +8 -1
- package/lib/shared/bk-popover.d.ts +56 -5
- package/lib/shared/index.d.ts +24 -0
- package/lib/shared/index.js +1 -1
- package/lib/shared/utils.d.ts +6 -0
- package/lib/shared/vue-types.d.ts +3 -6
- package/lib/shared/z-index-manager.d.ts +6 -1
- package/lib/sideslider/index.d.ts +206 -2
- package/lib/sideslider/index.js +1 -1
- package/lib/sideslider/sideslider.d.ts +39 -18
- package/lib/sideslider/sideslider.variable.css +32 -0
- package/{index.d.ts → lib/slider/index.d.ts} +4 -5
- package/lib/slider/index.js +15 -0
- package/{commitlint.config.js → lib/slider/slider-button.d.ts} +50 -42
- package/lib/slider/slider.css +149 -0
- package/lib/slider/slider.d.ts +189 -0
- package/lib/slider/slider.less +179 -0
- package/lib/slider/slider.variable.css +242 -0
- package/lib/steps/index.d.ts +250 -0
- package/lib/steps/index.js +15 -0
- package/lib/steps/steps.css +288 -0
- package/lib/steps/steps.d.ts +161 -0
- package/lib/steps/steps.less +324 -0
- package/lib/steps/steps.variable.css +381 -0
- package/lib/styles/index.d.ts +43 -25
- package/lib/styles/index.js +1 -1
- package/lib/styles/mixins/popper.css +43 -0
- package/lib/styles/mixins/popper.less +52 -0
- package/lib/styles/mixins/popper.variable.css +43 -0
- package/lib/styles/mixins/size.less +9 -0
- package/lib/styles/reset.css +273 -0
- package/lib/styles/reset.less +313 -0
- package/lib/styles/reset.variable.css +273 -0
- package/lib/styles/themes/themes.less +52 -2
- package/lib/switcher/index.d.ts +286 -2
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.css +149 -135
- package/lib/switcher/switcher.d.ts +48 -32
- package/lib/switcher/switcher.less +210 -154
- package/lib/switcher/switcher.variable.css +181 -135
- package/lib/tab/index.d.ts +552 -0
- package/lib/tab/index.js +1 -0
- package/lib/tab/tab-nav.d.ts +190 -0
- package/lib/tab/tab-panel.d.ts +48 -0
- package/lib/tab/tab.css +147 -0
- package/lib/tab/tab.d.ts +163 -0
- package/lib/tab/tab.less +221 -0
- package/lib/tab/tab.variable.css +240 -0
- package/lib/table/const.d.ts +4 -0
- package/lib/table/index.d.ts +259 -2
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +110 -0
- package/lib/table/render.d.ts +72 -0
- package/lib/table/table.css +83 -0
- package/lib/table/table.d.ts +75 -38
- package/lib/table/table.less +107 -1
- package/lib/table/table.variable.css +115 -0
- package/lib/table/utils.d.ts +69 -0
- package/lib/tag/index.d.ts +229 -2
- package/lib/tag/index.js +1 -1
- package/lib/tag/tag.css +91 -0
- package/lib/tag/tag.d.ts +83 -53
- package/lib/tag/tag.less +103 -2
- package/lib/tag/tag.variable.css +123 -0
- package/lib/timeline/index.d.ts +129 -0
- package/lib/timeline/index.js +1 -0
- package/lib/timeline/timeline.css +235 -0
- package/lib/timeline/timeline.d.ts +81 -0
- package/lib/timeline/timeline.less +239 -0
- package/lib/timeline/timeline.variable.css +328 -0
- package/{changelog.config.js → lib/transfer/index.d.ts} +2 -8
- package/lib/transfer/index.js +1 -0
- package/lib/transfer/transfer.css +158 -0
- package/lib/transfer/transfer.d.ts +185 -0
- package/lib/transfer/transfer.less +171 -0
- package/lib/transfer/transfer.variable.css +251 -0
- package/lib/tree/index.d.ts +254 -0
- package/lib/tree/index.js +1 -0
- package/lib/tree/props.d.ts +80 -0
- package/lib/tree/tree.css +44 -0
- package/lib/tree/tree.d.ts +98 -0
- package/lib/tree/tree.less +55 -0
- package/lib/tree/tree.variable.css +44 -0
- package/lib/tree/util.d.ts +57 -0
- package/lib/use-form.d.ts +3 -0
- package/lib/use-message.d.ts +2 -0
- package/lib/virtual-render/index.d.ts +556 -0
- package/lib/virtual-render/index.js +1 -0
- package/lib/virtual-render/props.d.ts +157 -0
- package/lib/virtual-render/v-virtual-render.d.ts +7 -0
- package/lib/virtual-render/virtual-render.css +40 -0
- package/lib/virtual-render/virtual-render.d.ts +244 -0
- package/lib/virtual-render/virtual-render.less +51 -0
- package/lib/virtual-render/virtual-render.variable.css +40 -0
- package/package.json +63 -48
- package/index.html +0 -40
- package/lib/checkbox-group/index.d.ts +0 -2
- package/lib/checkbox-group/index.js +0 -1
- package/lib/radio-button/index.d.ts +0 -2
- package/lib/radio-button/index.js +0 -1
- package/lib/radio-group/index.d.ts +0 -2
- package/lib/radio-group/index.js +0 -1
- package/lib/table/common.d.ts +0 -3
- package/lib/table/table-layout.d.ts +0 -14
- package/lib/table/type.d.ts +0 -12
@@ -0,0 +1,254 @@
|
|
1
|
+
declare const BkTree: {
|
2
|
+
new (...args: any[]): {
|
3
|
+
$: import("vue").ComponentInternalInstance;
|
4
|
+
$data: {};
|
5
|
+
$props: Partial<{
|
6
|
+
data: any[];
|
7
|
+
lineHeight: number;
|
8
|
+
prefixIcon: any;
|
9
|
+
children: string;
|
10
|
+
indent: number;
|
11
|
+
levelLine: any;
|
12
|
+
virtualRender: boolean;
|
13
|
+
asyncLoad: (...args: any[]) => any;
|
14
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
15
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
16
|
+
default: () => any[];
|
17
|
+
};
|
18
|
+
label: import("vue-types").VueTypeDef<any>;
|
19
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
20
|
+
default: string;
|
21
|
+
} & {
|
22
|
+
default: string;
|
23
|
+
};
|
24
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
25
|
+
default: number;
|
26
|
+
} & {
|
27
|
+
default: number;
|
28
|
+
};
|
29
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
30
|
+
default: number;
|
31
|
+
} & {
|
32
|
+
default: number;
|
33
|
+
};
|
34
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
35
|
+
default: any;
|
36
|
+
};
|
37
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
38
|
+
default: boolean;
|
39
|
+
} & {
|
40
|
+
default: boolean;
|
41
|
+
};
|
42
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
43
|
+
default: any;
|
44
|
+
};
|
45
|
+
asyncLoad: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
46
|
+
default: (...args: any[]) => any;
|
47
|
+
} & {
|
48
|
+
default: (...args: any[]) => any;
|
49
|
+
};
|
50
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "lineHeight" | "prefixIcon" | "children" | "indent" | "levelLine" | "virtualRender" | "asyncLoad">;
|
51
|
+
$attrs: {
|
52
|
+
[x: string]: unknown;
|
53
|
+
};
|
54
|
+
$refs: {
|
55
|
+
[x: string]: unknown;
|
56
|
+
};
|
57
|
+
$slots: Readonly<{
|
58
|
+
[name: string]: import("vue").Slot;
|
59
|
+
}>;
|
60
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
61
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
62
|
+
$emit: (event: string, ...args: any[]) => void;
|
63
|
+
$el: any;
|
64
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
65
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
66
|
+
default: () => any[];
|
67
|
+
};
|
68
|
+
label: import("vue-types").VueTypeDef<any>;
|
69
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
70
|
+
default: string;
|
71
|
+
} & {
|
72
|
+
default: string;
|
73
|
+
};
|
74
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
75
|
+
default: number;
|
76
|
+
} & {
|
77
|
+
default: number;
|
78
|
+
};
|
79
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
80
|
+
default: number;
|
81
|
+
} & {
|
82
|
+
default: number;
|
83
|
+
};
|
84
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
85
|
+
default: any;
|
86
|
+
};
|
87
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
88
|
+
default: boolean;
|
89
|
+
} & {
|
90
|
+
default: boolean;
|
91
|
+
};
|
92
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
93
|
+
default: any;
|
94
|
+
};
|
95
|
+
asyncLoad: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
96
|
+
default: (...args: any[]) => any;
|
97
|
+
} & {
|
98
|
+
default: (...args: any[]) => any;
|
99
|
+
};
|
100
|
+
}>>, {
|
101
|
+
renderData: import("vue").ComputedRef<any[]>;
|
102
|
+
flatData: {
|
103
|
+
data: any[];
|
104
|
+
schema: any[] | Map<string, any>;
|
105
|
+
levelLineSchema: {};
|
106
|
+
};
|
107
|
+
hanldeTreeNodeClick: (item: any) => void;
|
108
|
+
getActionIcon: (item: any) => string | JSX.Element;
|
109
|
+
getRootIcon: (item: any) => JSX.Element;
|
110
|
+
getVirtualLines: (node: any) => JSX.Element[];
|
111
|
+
getNodePrefixIcon: (item: any) => string | JSX.Element;
|
112
|
+
getLoadingIcon: (item: any) => "" | JSX.Element;
|
113
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
114
|
+
data: any[];
|
115
|
+
lineHeight: number;
|
116
|
+
prefixIcon: any;
|
117
|
+
children: string;
|
118
|
+
indent: number;
|
119
|
+
levelLine: any;
|
120
|
+
virtualRender: boolean;
|
121
|
+
asyncLoad: (...args: any[]) => any;
|
122
|
+
}> & {
|
123
|
+
beforeCreate?: (() => void) | (() => void)[];
|
124
|
+
created?: (() => void) | (() => void)[];
|
125
|
+
beforeMount?: (() => void) | (() => void)[];
|
126
|
+
mounted?: (() => void) | (() => void)[];
|
127
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
128
|
+
updated?: (() => void) | (() => void)[];
|
129
|
+
activated?: (() => void) | (() => void)[];
|
130
|
+
deactivated?: (() => void) | (() => void)[];
|
131
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
132
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
133
|
+
destroyed?: (() => void) | (() => void)[];
|
134
|
+
unmounted?: (() => void) | (() => void)[];
|
135
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
136
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
137
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>, info: string) => boolean | void)[];
|
138
|
+
};
|
139
|
+
$forceUpdate: () => void;
|
140
|
+
$nextTick: typeof import("vue").nextTick;
|
141
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
|
142
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
143
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
144
|
+
default: () => any[];
|
145
|
+
};
|
146
|
+
label: import("vue-types").VueTypeDef<any>;
|
147
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
148
|
+
default: string;
|
149
|
+
} & {
|
150
|
+
default: string;
|
151
|
+
};
|
152
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
153
|
+
default: number;
|
154
|
+
} & {
|
155
|
+
default: number;
|
156
|
+
};
|
157
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
158
|
+
default: number;
|
159
|
+
} & {
|
160
|
+
default: number;
|
161
|
+
};
|
162
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
163
|
+
default: any;
|
164
|
+
};
|
165
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
166
|
+
default: boolean;
|
167
|
+
} & {
|
168
|
+
default: boolean;
|
169
|
+
};
|
170
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
171
|
+
default: any;
|
172
|
+
};
|
173
|
+
asyncLoad: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
174
|
+
default: (...args: any[]) => any;
|
175
|
+
} & {
|
176
|
+
default: (...args: any[]) => any;
|
177
|
+
};
|
178
|
+
}>> & import("vue").ShallowUnwrapRef<{
|
179
|
+
renderData: import("vue").ComputedRef<any[]>;
|
180
|
+
flatData: {
|
181
|
+
data: any[];
|
182
|
+
schema: any[] | Map<string, any>;
|
183
|
+
levelLineSchema: {};
|
184
|
+
};
|
185
|
+
hanldeTreeNodeClick: (item: any) => void;
|
186
|
+
getActionIcon: (item: any) => string | JSX.Element;
|
187
|
+
getRootIcon: (item: any) => JSX.Element;
|
188
|
+
getVirtualLines: (node: any) => JSX.Element[];
|
189
|
+
getNodePrefixIcon: (item: any) => string | JSX.Element;
|
190
|
+
getLoadingIcon: (item: any) => "" | JSX.Element;
|
191
|
+
}> & {} & {} & import("vue").ComponentCustomProperties;
|
192
|
+
__isFragment?: never;
|
193
|
+
__isTeleport?: never;
|
194
|
+
__isSuspense?: never;
|
195
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
196
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
197
|
+
default: () => any[];
|
198
|
+
};
|
199
|
+
label: import("vue-types").VueTypeDef<any>;
|
200
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
201
|
+
default: string;
|
202
|
+
} & {
|
203
|
+
default: string;
|
204
|
+
};
|
205
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
206
|
+
default: number;
|
207
|
+
} & {
|
208
|
+
default: number;
|
209
|
+
};
|
210
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
211
|
+
default: number;
|
212
|
+
} & {
|
213
|
+
default: number;
|
214
|
+
};
|
215
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
216
|
+
default: any;
|
217
|
+
};
|
218
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
219
|
+
default: boolean;
|
220
|
+
} & {
|
221
|
+
default: boolean;
|
222
|
+
};
|
223
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
224
|
+
default: any;
|
225
|
+
};
|
226
|
+
asyncLoad: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
227
|
+
default: (...args: any[]) => any;
|
228
|
+
} & {
|
229
|
+
default: (...args: any[]) => any;
|
230
|
+
};
|
231
|
+
}>>, {
|
232
|
+
renderData: import("vue").ComputedRef<any[]>;
|
233
|
+
flatData: {
|
234
|
+
data: any[];
|
235
|
+
schema: any[] | Map<string, any>;
|
236
|
+
levelLineSchema: {};
|
237
|
+
};
|
238
|
+
hanldeTreeNodeClick: (item: any) => void;
|
239
|
+
getActionIcon: (item: any) => string | JSX.Element;
|
240
|
+
getRootIcon: (item: any) => JSX.Element;
|
241
|
+
getVirtualLines: (node: any) => JSX.Element[];
|
242
|
+
getNodePrefixIcon: (item: any) => string | JSX.Element;
|
243
|
+
getLoadingIcon: (item: any) => "" | JSX.Element;
|
244
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
245
|
+
data: any[];
|
246
|
+
lineHeight: number;
|
247
|
+
prefixIcon: any;
|
248
|
+
children: string;
|
249
|
+
indent: number;
|
250
|
+
levelLine: any;
|
251
|
+
virtualRender: boolean;
|
252
|
+
asyncLoad: (...args: any[]) => any;
|
253
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
|
254
|
+
export default BkTree;
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue"),require("crypto"),require("../icon/"),require("../shared"),require("../virtual-render")):"function"==typeof define&&define.amd?define(["exports","vue","crypto","../icon/","../shared","../virtual-render"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.require$$0,e._,e.Shared,e["@bkui-vue/virtual-render"])}(this,(function(e,n,t,r,o,i){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(t),a=u(i);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s={exports:{}};!function(e){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(s);var d=c(s.exports),f={exports:{}};!function(e){e.exports=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e},e.exports.__esModule=!0,e.exports.default=e.exports}(f);var p=c(f.exports),v={exports:{}},y={exports:{}},h={exports:{}};!function(e){e.exports=function(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(h),function(e){var n=h.exports;e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(y);var _={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(_);var g={exports:{}};!function(e){var n=h.exports;e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(g);var x={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(x),function(e){var n=y.exports,t=_.exports,r=g.exports,o=x.exports;e.exports=function(e){return n(e)||t(e)||r(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports}(v);for(var b=c(v.exports),m=l.default,O=function(){return m.randomBytes(16)},j=[],N=0;N<256;++N)j[N]=(N+256).toString(16).substr(1);var T,P,I=function(e,n){var t=n||0,r=j;return[r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]]].join("")},w=O,L=I,S=0,A=0;var C=function(e,n,t){var r=n&&t||0,o=n||[],i=(e=e||{}).node||T,u=void 0!==e.clockseq?e.clockseq:P;if(null==i||null==u){var l=w();null==i&&(i=T=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==u&&(u=P=16383&(l[6]<<8|l[7]))}var a=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:A+1,s=a-S+(c-A)/1e4;if(s<0&&void 0===e.clockseq&&(u=u+1&16383),(s<0||a>S)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");S=a,A=c,P=u;var d=(1e4*(268435455&(a+=122192928e5))+c)%4294967296;o[r++]=d>>>24&255,o[r++]=d>>>16&255,o[r++]=d>>>8&255,o[r++]=255&d;var f=a/4294967296*1e4&268435455;o[r++]=f>>>8&255,o[r++]=255&f,o[r++]=f>>>24&15|16,o[r++]=f>>>16&255,o[r++]=u>>>8|128,o[r++]=255&u;for(var p=0;p<6;++p)o[r+p]=i[p];return n||L(o)},k=O,M=I;var V=function(e,n,t){var r=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||k)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n)for(var i=0;i<16;++i)n[r+i]=o[i];return n||M(o)},q=C,R=V,D=R;D.v1=q,D.v4=R;var H=D,$=void 0,F="1px dashed #c3cdd7",E=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=e.data,o=e.children,i=[],u=0,l=new Map;function a(e){return(t||[]).some((function(n){return n.__uuid===e&&n.__isOpen}))}function c(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=0;s<e.length;s++){var f=e[s];if(Array.isArray(f))c(f,n,t,r);else if("object"===d(f)&&null!==f){var v=f.__uuid||H.v4(),y=a(v),h=null!==r?"".concat(r,"-").concat(s):"".concat(s),_=p({__depth:n,__index:s,__uuid:v,__parentId:t,__parentPath:r,__hasChild:!!(f[o]||[]).length,__path:h,__isRoot:null===t,__order:u,__isOpen:y},o,null);Object.assign(f,{__uuid:v}),l.set(v,_),u+=1,i.push(Object.assign(Object.assign({},f),p({},o,null))),Object.prototype.hasOwnProperty.call(f,o)&&c(f[o]||[],n+1,v,h)}}}return c(n||r),[i,l]},B=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],u=e[n];return"boolean"==typeof u?u?r:o:U(t,e,n,i)},U=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=n[t];if("string"==typeof o)return"object"===d(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,o)||console.error("cannot find node label with key ".concat(o)),e[o]):o;if("function"==typeof o){var i=o.apply($,[e].concat(b(r)));return"string"==typeof i?i:void console.error("props label with function return value is not string, please check and return string")}},z=function(e,n){return U(e,n,"label")},G=function(e,n){return e.get(n)||{}},J=function(e,n,t){return(G(e,n)||{})[t]},K=function(e,n){return{"--level-line":B(n,"levelLine",e,F,null,["tree"]),"--lineHeight":"".concat(n.lineHeight,"px"),"--indent":"".concat(n.indent,"px"),padding:0}},Q=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.levelLineSchema,o=t.schema,i=r[e.__uuid]||{},u=i.childNodeCount,l=void 0===u?0:u,a=i.isLeaf,c=void 0!==a&&a,s=i.lastNode,d=void 0===s?null:s,f=c?0:(r[d]||{childNodeCount:0}).childNodeCount,p=J(o,e.__uuid,"__depth");return Object.assign({"--depth":p,paddingLeft:0,"--lines":l-f},"function"==typeof n.levelLine?{"--level-line":B(n,"levelLine",e,F,null,["node"])}:{})},W=function(e,n,t){var r=G(n,e.__uuid)||{};return{"is-root":r.__isRoot,"bk-tree-node":!0,"is-open":r.__isOpen,"is-virtual-render":t.virtualRender}},X=function(e,n,t,r,o){var i=e.split("-").reduce((function(e,n){var r=Number(n);return Array.isArray(e)?e[r]:e[t][r]}),n);Object.assign(i,p({},r,o))},Y={data:o.PropTypes.arrayOf(o.PropTypes.any).def([]),label:o.PropTypes.oneOfType([o.PropTypes.func.def(void 0),o.PropTypes.string.def("label")]),children:o.PropTypes.string.def("children"),indent:o.PropTypes.number.def(18),lineHeight:o.PropTypes.number.def(32),levelLine:o.PropTypes.oneOfType([o.PropTypes.bool.def(!1),o.PropTypes.func.def(void 0),o.PropTypes.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:o.PropTypes.bool.def(!1),prefixIcon:o.PropTypes.oneOfType([o.PropTypes.func.def((function(){})),o.PropTypes.bool.def(!1)]).def(!0),asyncLoad:o.PropTypes.func.def(null)},Z=n.defineComponent({name:"Tree",props:Y,setup:function(e){var t=E(e),o=n.reactive({data:t[0],schema:t[1],levelLineSchema:{}});n.watch((function(){return[e.data]}),(function(n){console.log("props.data changed");var t=E(e,n,i.value);o.data=t[0],o.schema=t[1],b()}),{deep:!0}),n.watch((function(){return[e.levelLine]}),(function(){b()}));var i=n.computed((function(){return Array.from(o.schema.values())})),u=function(e){return o.schema.get(e)},l=function(e,n){var t;return null===(t=u(e.__uuid))||void 0===t?void 0:t[n]},a=function(e,n,t){return o.schema.set(e.__uuid,Object.assign(Object.assign({},u(e.__uuid)),p({},n,t)))},c=function(e){return l(e,"__path")},s=function(e){return l(e,"__isRoot")},f=function(e){return l(e,"__hasChild")},v=n.computed((function(){return o.data.filter((function(e){return m(e)}))})),y=n.computed((function(){return v.value.map((function(e){return c(e)}))})),h=function(e){var n;return"object"===d(e)?l(e,"__isOpen"):"string"==typeof e&&(null===(n=u(e))||void 0===n?void 0:n.__isOpen)},_=function(e){return h(e)?n.createVNode(r.FolderShapeOpen,{class:"bk-tree-icon"},null):n.createVNode(r.Folder,{class:"bk-tree-icon"},null)},g=function(e){if("string"==typeof e)return e;if("object"===d(e)&&null!==e){var t=e.node,r=e.className,o=e.text,i=e.style;return n.h(t,{class:r,style:i},o)}return null},x=function(n,t){if("object"===d(n)&&null!==n){a(t,"__isOpen",!0);var r=Array.isArray(n)?n:[n];X(c(t),e.data,e.children,e.children,r)}},b=function(){e.levelLine?setTimeout((function(){for(var e=v.value.length,n={},t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.prototype.hasOwnProperty.call(n,e)||Object.assign(n,p({},e,Object.assign(Object.assign({childNodeCount:0,isLastNode:!1},null!==t?{lastNode:t}:{}),null!==r?{isLeaf:r}:{})))};e>0;e--){var r=v.value[e-1],i=l(r,"__parentId"),u=c(r),a=!y.value.includes("".concat(u,"-0"));t(r.__uuid,null,a),t(i,r.__uuid);var s=n[i],d=n[r.__uuid],f=d.childNodeCount,h=void 0===f?0:f;d.childNodeCount=h+1,d.isLastNode=s.lastNode===r.__uuid,s.childNodeCount+=d.childNodeCount}o.levelLineSchema=n})):o.levelLineSchema={}},m=function(e){return s(e)||h(e)||h(l(e,"__parentId"))};return b(),{renderData:v,flatData:o,hanldeTreeNodeClick:function(n){n.async&&("function"==typeof e.asyncLoad?(Object.assign(n,{loading:!0}),e.asyncLoad(n,(function(e){return x(e,n)})).then((function(e){return x(e,n)})).catch((function(e){return console.error("load remote data error:",e)})).finally((function(){X(c(n),e.data,e.children,"loading",!1)}))):console.error("async need to set prop: asyncLoad with function wich will return promise object")),f(n)&&function(e){var n=!h(e);a(e,"__isOpen",n),b()}(n)},getActionIcon:function(t){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(s(t),f(t)||t.async,h(t),"action",t))?g(o):("default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon)&&(f(t)||t.async)?h(t)?n.createVNode(r.DownShape,null,null):n.createVNode(r.RightShape,null,null):null},getRootIcon:_,getVirtualLines:function(t){if(!e.virtualRender)return null;var r=l(t,"__depth")+1;return new Array(r).fill("").map((function(e,n){return n})).filter((function(e){return function(e,n){if(s(n))return!1;var t=c(n),r="".concat(t).split("-").slice(0,e+1);if(r.join("-")===t)return!0;var o=r.pop(),u=parseInt(o,10);r.push("".concat(u+1));var l=r.join("-");return i.value.some((function(e){return e.__path===l}))}(e,t)})).filter((function(e){return e>0})).map((function(e){return n.createVNode("span",{class:"node-virtual-line",style:(t=r-e,{"--depth":t})},null);var t}))},getNodePrefixIcon:function(t){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(s(t),f(t)||t.async,h(t),"node_type",t))?g(o):"default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon?s(t)?_(t):n.createVNode(r.TextFile,{class:"bk-tree-icon"},null):null},getLoadingIcon:function(e){return e.loading?n.createVNode(r.Spinner,null,null):""}}},render:function(){var e=this,t=this.$props,r=function(r){return n.createVNode("div",{class:W(r,e.flatData.schema,t),style:Q(r,t,e.flatData),onClick:function(){return e.hanldeTreeNodeClick(r)}},[[e.getActionIcon(r),e.getNodePrefixIcon(r),e.getLoadingIcon(r)],n.createVNode("span",null,[z(r,t)]),e.getVirtualLines(r)])};return n.createVNode(a.default,{class:"bk-tree",style:K(null,t),list:this.renderData,lineHeight:t.lineHeight,enabled:t.virtualRender},{default:function(e){return(e.data||[]).map(r)}})}}),ee=o.withInstall(Z);e.default=ee,Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
2
|
+
/**
|
3
|
+
* Tree Prop: prefixIcon function
|
4
|
+
* @param {} isRoot 是否为分跟节点
|
5
|
+
* @param {} hasChild 是否有孩子节点
|
6
|
+
* @param {} isOpen 当前节点是否展开
|
7
|
+
* @param {} renderType 当前渲染类型(action: 用来标识当前节点状态,展开 | 收起, node_type:节点类型,文件、文件夹)
|
8
|
+
* @param {} item 当前节点数据
|
9
|
+
*/
|
10
|
+
export declare type IPrefixIcon = (isRoot: boolean, hasChild: boolean, isOpen: boolean, renderType: string, item: any) => any;
|
11
|
+
export declare const treeProps: {
|
12
|
+
/**
|
13
|
+
* 渲染列表
|
14
|
+
*/
|
15
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
16
|
+
default: () => any[];
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* 指定节点标签为节点对象的某个属性值
|
20
|
+
*/
|
21
|
+
label: import("vue-types").VueTypeDef<any>;
|
22
|
+
/**
|
23
|
+
* 子节点 Key, 用于读取子节点
|
24
|
+
* 默认 children
|
25
|
+
*/
|
26
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
27
|
+
default: string;
|
28
|
+
} & {
|
29
|
+
default: string;
|
30
|
+
};
|
31
|
+
/**
|
32
|
+
* 相邻级节点间的水平缩进,单位为像素
|
33
|
+
*/
|
34
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
35
|
+
default: number;
|
36
|
+
} & {
|
37
|
+
default: number;
|
38
|
+
};
|
39
|
+
/**
|
40
|
+
* 设置行高
|
41
|
+
*/
|
42
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
43
|
+
default: number;
|
44
|
+
} & {
|
45
|
+
default: number;
|
46
|
+
};
|
47
|
+
/**
|
48
|
+
* 设置层级连线
|
49
|
+
*/
|
50
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
51
|
+
default: any;
|
52
|
+
};
|
53
|
+
/**
|
54
|
+
* 是否开启虚拟滚动
|
55
|
+
* 默认虚拟滚动是开启的,数据量大的情况下有利于性能优化,可以通过设置 virtualRender = false 关闭虚拟滚动
|
56
|
+
*/
|
57
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
58
|
+
default: boolean;
|
59
|
+
} & {
|
60
|
+
default: boolean;
|
61
|
+
};
|
62
|
+
/**
|
63
|
+
* 当前节点标识图标
|
64
|
+
* 默认 true
|
65
|
+
*/
|
66
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
67
|
+
default: any;
|
68
|
+
};
|
69
|
+
/**
|
70
|
+
* 异步请求方法
|
71
|
+
* func<Promise>: (node: any) => ({ })
|
72
|
+
* 如果node设置了async = true,则会触发此方法
|
73
|
+
*/
|
74
|
+
asyncLoad: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
75
|
+
default: (...args: any[]) => any;
|
76
|
+
} & {
|
77
|
+
default: (...args: any[]) => any;
|
78
|
+
};
|
79
|
+
};
|
80
|
+
export declare type TreePropTypes = Readonly<ExtractPropTypes<typeof treeProps>>;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
.bk-tree .bk-tree-node {
|
2
|
+
position: relative;
|
3
|
+
height: var(--lineHeight);
|
4
|
+
padding-left: 0;
|
5
|
+
line-height: var(--lineHeight);
|
6
|
+
cursor: pointer;
|
7
|
+
}
|
8
|
+
.bk-tree .bk-tree-node.is-open:not(.is-virtual-render)::after {
|
9
|
+
position: absolute;
|
10
|
+
top: calc(var(--lineHeight) / 2 + 6px);
|
11
|
+
left: 6px;
|
12
|
+
z-index: 1;
|
13
|
+
width: 0;
|
14
|
+
height: calc(var(--lines) * var(--lineHeight) - 6px);
|
15
|
+
pointer-events: none;
|
16
|
+
border-left: var(--level-line);
|
17
|
+
content: '';
|
18
|
+
}
|
19
|
+
.bk-tree .bk-tree-node:not(.is-root) {
|
20
|
+
margin-left: calc(var(--depth)*var(--indent));
|
21
|
+
}
|
22
|
+
.bk-tree .bk-tree-node:not(.is-root)::before {
|
23
|
+
position: absolute;
|
24
|
+
top: calc(50% + 1px);
|
25
|
+
left: calc(0px - var(--indent) + 6px);
|
26
|
+
z-index: 1;
|
27
|
+
width: calc(var(--indent) - 6px);
|
28
|
+
height: 0;
|
29
|
+
pointer-events: none;
|
30
|
+
border-bottom: var(--level-line);
|
31
|
+
content: '';
|
32
|
+
}
|
33
|
+
.bk-tree .bk-tree-node .node-virtual-line {
|
34
|
+
display: inline-block;
|
35
|
+
position: absolute;
|
36
|
+
left: calc(var(--depth) * var(--indent) * -1 + 6px);
|
37
|
+
top: -12px;
|
38
|
+
bottom: 50%;
|
39
|
+
width: 0;
|
40
|
+
border-left: var(--level-line);
|
41
|
+
}
|
42
|
+
.bk-tree .bk-tree-node .bk-tree-icon {
|
43
|
+
margin: 0 6px 0 4px;
|
44
|
+
}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
import { TreePropTypes as defineTypes } from './props';
|
2
|
+
export declare type TreePropTypes = defineTypes;
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
4
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
5
|
+
default: () => any[];
|
6
|
+
};
|
7
|
+
label: import("vue-types").VueTypeDef<any>;
|
8
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
9
|
+
default: string;
|
10
|
+
} & {
|
11
|
+
default: string;
|
12
|
+
};
|
13
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
14
|
+
default: number;
|
15
|
+
} & {
|
16
|
+
default: number;
|
17
|
+
};
|
18
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
19
|
+
default: number;
|
20
|
+
} & {
|
21
|
+
default: number;
|
22
|
+
};
|
23
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
24
|
+
default: any;
|
25
|
+
};
|
26
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
27
|
+
default: boolean;
|
28
|
+
} & {
|
29
|
+
default: boolean;
|
30
|
+
};
|
31
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
32
|
+
default: any;
|
33
|
+
};
|
34
|
+
asyncLoad: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
35
|
+
default: (...args: any[]) => any;
|
36
|
+
} & {
|
37
|
+
default: (...args: any[]) => any;
|
38
|
+
};
|
39
|
+
}, {
|
40
|
+
renderData: import("vue").ComputedRef<any[]>;
|
41
|
+
flatData: {
|
42
|
+
data: any[];
|
43
|
+
schema: any[] | Map<string, any>;
|
44
|
+
levelLineSchema: {};
|
45
|
+
};
|
46
|
+
hanldeTreeNodeClick: (item: any) => void;
|
47
|
+
getActionIcon: (item: any) => string | JSX.Element;
|
48
|
+
getRootIcon: (item: any) => JSX.Element;
|
49
|
+
getVirtualLines: (node: any) => JSX.Element[];
|
50
|
+
getNodePrefixIcon: (item: any) => string | JSX.Element;
|
51
|
+
getLoadingIcon: (item: any) => "" | JSX.Element;
|
52
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
53
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
54
|
+
default: () => any[];
|
55
|
+
};
|
56
|
+
label: import("vue-types").VueTypeDef<any>;
|
57
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
58
|
+
default: string;
|
59
|
+
} & {
|
60
|
+
default: string;
|
61
|
+
};
|
62
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
63
|
+
default: number;
|
64
|
+
} & {
|
65
|
+
default: number;
|
66
|
+
};
|
67
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
68
|
+
default: number;
|
69
|
+
} & {
|
70
|
+
default: number;
|
71
|
+
};
|
72
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
73
|
+
default: any;
|
74
|
+
};
|
75
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
76
|
+
default: boolean;
|
77
|
+
} & {
|
78
|
+
default: boolean;
|
79
|
+
};
|
80
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
81
|
+
default: any;
|
82
|
+
};
|
83
|
+
asyncLoad: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
84
|
+
default: (...args: any[]) => any;
|
85
|
+
} & {
|
86
|
+
default: (...args: any[]) => any;
|
87
|
+
};
|
88
|
+
}>>, {
|
89
|
+
data: any[];
|
90
|
+
lineHeight: number;
|
91
|
+
prefixIcon: any;
|
92
|
+
children: string;
|
93
|
+
indent: number;
|
94
|
+
levelLine: any;
|
95
|
+
virtualRender: boolean;
|
96
|
+
asyncLoad: (...args: any[]) => any;
|
97
|
+
}>;
|
98
|
+
export default _default;
|
@@ -0,0 +1,55 @@
|
|
1
|
+
.bk-tree {
|
2
|
+
.bk-tree-node {
|
3
|
+
position: relative;
|
4
|
+
height: var(--lineHeight);
|
5
|
+
padding-left: 0;
|
6
|
+
line-height: var(--lineHeight);
|
7
|
+
cursor: pointer;
|
8
|
+
|
9
|
+
&.is-open {
|
10
|
+
&:not(.is-virtual-render) {
|
11
|
+
&::after {
|
12
|
+
position: absolute;
|
13
|
+
top: calc(var(--lineHeight) / 2 + 6px);
|
14
|
+
left: 6px;
|
15
|
+
z-index: 1;
|
16
|
+
width: 0;
|
17
|
+
height: calc(var(--lines) * var(--lineHeight) - 6px);
|
18
|
+
pointer-events: none;
|
19
|
+
border-left: var(--level-line);
|
20
|
+
content: '';
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
&:not(.is-root) {
|
26
|
+
margin-left: calc(var(--depth)*var(--indent));
|
27
|
+
|
28
|
+
&::before {
|
29
|
+
position: absolute;
|
30
|
+
top: calc(50% + 1px);
|
31
|
+
left: calc(0px - var(--indent) + 6px);
|
32
|
+
z-index: 1;
|
33
|
+
width: calc(var(--indent) - 6px);
|
34
|
+
height: 0;
|
35
|
+
pointer-events: none;
|
36
|
+
border-bottom: var(--level-line);
|
37
|
+
content: '';
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
.node-virtual-line {
|
42
|
+
display: inline-block;
|
43
|
+
position: absolute;
|
44
|
+
left: calc(var(--depth) * var(--indent) * -1 + 6px);
|
45
|
+
top: -12px;
|
46
|
+
bottom: 50%;
|
47
|
+
width: 0;
|
48
|
+
border-left: var(--level-line);
|
49
|
+
}
|
50
|
+
|
51
|
+
.bk-tree-icon {
|
52
|
+
margin: 0 6px 0 4px;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
.bk-tree .bk-tree-node {
|
2
|
+
position: relative;
|
3
|
+
height: var(--lineHeight);
|
4
|
+
padding-left: 0;
|
5
|
+
line-height: var(--lineHeight);
|
6
|
+
cursor: pointer;
|
7
|
+
}
|
8
|
+
.bk-tree .bk-tree-node.is-open:not(.is-virtual-render)::after {
|
9
|
+
position: absolute;
|
10
|
+
top: calc(var(--lineHeight) / 2 + 6px);
|
11
|
+
left: 6px;
|
12
|
+
z-index: 1;
|
13
|
+
width: 0;
|
14
|
+
height: calc(var(--lines) * var(--lineHeight) - 6px);
|
15
|
+
pointer-events: none;
|
16
|
+
border-left: var(--level-line);
|
17
|
+
content: '';
|
18
|
+
}
|
19
|
+
.bk-tree .bk-tree-node:not(.is-root) {
|
20
|
+
margin-left: calc(var(--depth)*var(--indent));
|
21
|
+
}
|
22
|
+
.bk-tree .bk-tree-node:not(.is-root)::before {
|
23
|
+
position: absolute;
|
24
|
+
top: calc(50% + 1px);
|
25
|
+
left: calc(0px - var(--indent) + 6px);
|
26
|
+
z-index: 1;
|
27
|
+
width: calc(var(--indent) - 6px);
|
28
|
+
height: 0;
|
29
|
+
pointer-events: none;
|
30
|
+
border-bottom: var(--level-line);
|
31
|
+
content: '';
|
32
|
+
}
|
33
|
+
.bk-tree .bk-tree-node .node-virtual-line {
|
34
|
+
display: inline-block;
|
35
|
+
position: absolute;
|
36
|
+
left: calc(var(--depth) * var(--indent) * -1 + 6px);
|
37
|
+
top: -12px;
|
38
|
+
bottom: 50%;
|
39
|
+
width: 0;
|
40
|
+
border-left: var(--level-line);
|
41
|
+
}
|
42
|
+
.bk-tree .bk-tree-node .bk-tree-icon {
|
43
|
+
margin: 0 6px 0 4px;
|
44
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { TreePropTypes } from './props';
|
2
|
+
/**
|
3
|
+
* 扁平化当前数据
|
4
|
+
* @param arrData
|
5
|
+
* @returns
|
6
|
+
*/
|
7
|
+
export declare const getFlatdata: (props: TreePropTypes, treeData?: Array<any>, cachedSchema?: any[]) => (any[] | Map<string, any>)[];
|
8
|
+
/**
|
9
|
+
* 获取当前节点显示Label
|
10
|
+
* @param item 当前节点
|
11
|
+
* @param props Props
|
12
|
+
*/
|
13
|
+
export declare const getLabel: (item: any, props: TreePropTypes) => any;
|
14
|
+
/**
|
15
|
+
* 根据Props获取Tree样式设置
|
16
|
+
* @param item
|
17
|
+
* @param props
|
18
|
+
* @returns
|
19
|
+
*/
|
20
|
+
export declare const getTreeStyle: (item: any, props: TreePropTypes) => {
|
21
|
+
'--level-line': any;
|
22
|
+
'--lineHeight': string;
|
23
|
+
'--indent': string;
|
24
|
+
padding: number;
|
25
|
+
};
|
26
|
+
/**
|
27
|
+
* 获取节点样式配置
|
28
|
+
* @param item
|
29
|
+
* @param props
|
30
|
+
* @returns
|
31
|
+
*/
|
32
|
+
export declare const getNodeItemStyle: (item: any, props: TreePropTypes, flatData?: any) => {
|
33
|
+
'--level-line'?: any;
|
34
|
+
'--depth': any;
|
35
|
+
paddingLeft: number;
|
36
|
+
'--lines': number;
|
37
|
+
};
|
38
|
+
/**
|
39
|
+
* 获取当前渲染节点Class List
|
40
|
+
* @param item
|
41
|
+
* @returns
|
42
|
+
*/
|
43
|
+
export declare const getNodeItemClass: (item: any, schema: any, props: TreePropTypes) => {
|
44
|
+
'is-root': any;
|
45
|
+
'bk-tree-node': boolean;
|
46
|
+
'is-open': any;
|
47
|
+
'is-virtual-render': boolean;
|
48
|
+
};
|
49
|
+
/**
|
50
|
+
* 根据路径更新指定节点Child-Data
|
51
|
+
* @param path 节点路径
|
52
|
+
* @param treeData Tree Data
|
53
|
+
* @param childKey Child Key
|
54
|
+
* @param nodekey 节点key
|
55
|
+
* @param nodeValue 节点值
|
56
|
+
*/
|
57
|
+
export declare const updateTreeNode: (path: string, treeData: any[], childKey: string, nodekey: string, nodeValue: any) => void;
|