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
package/lib/table/index.d.ts
CHANGED
@@ -1,2 +1,259 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
declare const BkTable: {
|
2
|
+
new (...args: any[]): {
|
3
|
+
$: import("vue").ComponentInternalInstance;
|
4
|
+
$data: {};
|
5
|
+
$props: Partial<{
|
6
|
+
data: any[];
|
7
|
+
height: string | number;
|
8
|
+
minHeight: string | number;
|
9
|
+
border: string[];
|
10
|
+
headHeight: number;
|
11
|
+
columnPick: string;
|
12
|
+
rowHeight: any;
|
13
|
+
showHead: boolean;
|
14
|
+
virtualEnabled: boolean;
|
15
|
+
pagination: boolean | {
|
16
|
+
[key: string]: any;
|
17
|
+
};
|
18
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
19
|
+
onRowClick: FunctionConstructor;
|
20
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
21
|
+
default: () => any[];
|
22
|
+
};
|
23
|
+
columns: import("vue-types").VueTypeDef<import("./props").Column[]>;
|
24
|
+
activeColumn: import("vue-types").VueTypeDef<number | number[]>;
|
25
|
+
columnPick: import("vue-types").VueTypeDef<string> & {
|
26
|
+
default: string;
|
27
|
+
};
|
28
|
+
height: import("vue-types").VueTypeDef<string | number> & {
|
29
|
+
default: string | number;
|
30
|
+
};
|
31
|
+
minHeight: import("vue-types").VueTypeDef<string | number> & {
|
32
|
+
default: string | number;
|
33
|
+
};
|
34
|
+
rowHeight: import("vue-types").VueTypeDef<any> & {
|
35
|
+
default: any;
|
36
|
+
};
|
37
|
+
headHeight: import("vue-types").VueTypeValidableDef<number> & {
|
38
|
+
default: number;
|
39
|
+
} & {
|
40
|
+
default: number;
|
41
|
+
};
|
42
|
+
showHead: import("vue-types").VueTypeValidableDef<boolean> & {
|
43
|
+
default: boolean;
|
44
|
+
} & {
|
45
|
+
default: boolean;
|
46
|
+
};
|
47
|
+
virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
48
|
+
default: boolean;
|
49
|
+
} & {
|
50
|
+
default: boolean;
|
51
|
+
};
|
52
|
+
border: import("vue-types").VueTypeDef<string[]> & {
|
53
|
+
default: () => string[];
|
54
|
+
};
|
55
|
+
pagination: import("vue-types").VueTypeDef<boolean | {
|
56
|
+
[key: string]: any;
|
57
|
+
}> & {
|
58
|
+
default: boolean | (() => {
|
59
|
+
[key: string]: any;
|
60
|
+
});
|
61
|
+
};
|
62
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "height" | "minHeight" | "border" | "headHeight" | "columnPick" | "rowHeight" | "showHead" | "virtualEnabled" | "pagination">;
|
63
|
+
$attrs: {
|
64
|
+
[x: string]: unknown;
|
65
|
+
};
|
66
|
+
$refs: {
|
67
|
+
[x: string]: unknown;
|
68
|
+
};
|
69
|
+
$slots: Readonly<{
|
70
|
+
[name: string]: import("vue").Slot;
|
71
|
+
}>;
|
72
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
73
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
74
|
+
$emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
|
75
|
+
$el: any;
|
76
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
77
|
+
onRowClick: FunctionConstructor;
|
78
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
79
|
+
default: () => any[];
|
80
|
+
};
|
81
|
+
columns: import("vue-types").VueTypeDef<import("./props").Column[]>;
|
82
|
+
activeColumn: import("vue-types").VueTypeDef<number | number[]>;
|
83
|
+
columnPick: import("vue-types").VueTypeDef<string> & {
|
84
|
+
default: string;
|
85
|
+
};
|
86
|
+
height: import("vue-types").VueTypeDef<string | number> & {
|
87
|
+
default: string | number;
|
88
|
+
};
|
89
|
+
minHeight: import("vue-types").VueTypeDef<string | number> & {
|
90
|
+
default: string | number;
|
91
|
+
};
|
92
|
+
rowHeight: import("vue-types").VueTypeDef<any> & {
|
93
|
+
default: any;
|
94
|
+
};
|
95
|
+
headHeight: import("vue-types").VueTypeValidableDef<number> & {
|
96
|
+
default: number;
|
97
|
+
} & {
|
98
|
+
default: number;
|
99
|
+
};
|
100
|
+
showHead: import("vue-types").VueTypeValidableDef<boolean> & {
|
101
|
+
default: boolean;
|
102
|
+
} & {
|
103
|
+
default: boolean;
|
104
|
+
};
|
105
|
+
virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
106
|
+
default: boolean;
|
107
|
+
} & {
|
108
|
+
default: boolean;
|
109
|
+
};
|
110
|
+
border: import("vue-types").VueTypeDef<string[]> & {
|
111
|
+
default: () => string[];
|
112
|
+
};
|
113
|
+
pagination: import("vue-types").VueTypeDef<boolean | {
|
114
|
+
[key: string]: any;
|
115
|
+
}> & {
|
116
|
+
default: boolean | (() => {
|
117
|
+
[key: string]: any;
|
118
|
+
});
|
119
|
+
};
|
120
|
+
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
|
121
|
+
data: any[];
|
122
|
+
height: string | number;
|
123
|
+
minHeight: string | number;
|
124
|
+
border: string[];
|
125
|
+
headHeight: number;
|
126
|
+
columnPick: string;
|
127
|
+
rowHeight: any;
|
128
|
+
showHead: boolean;
|
129
|
+
virtualEnabled: boolean;
|
130
|
+
pagination: boolean | {
|
131
|
+
[key: string]: any;
|
132
|
+
};
|
133
|
+
}> & {
|
134
|
+
beforeCreate?: (() => void) | (() => void)[];
|
135
|
+
created?: (() => void) | (() => void)[];
|
136
|
+
beforeMount?: (() => void) | (() => void)[];
|
137
|
+
mounted?: (() => void) | (() => void)[];
|
138
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
139
|
+
updated?: (() => void) | (() => void)[];
|
140
|
+
activated?: (() => void) | (() => void)[];
|
141
|
+
deactivated?: (() => void) | (() => void)[];
|
142
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
143
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
144
|
+
destroyed?: (() => void) | (() => void)[];
|
145
|
+
unmounted?: (() => void) | (() => void)[];
|
146
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
147
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
148
|
+
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)[];
|
149
|
+
};
|
150
|
+
$forceUpdate: () => void;
|
151
|
+
$nextTick: typeof import("vue").nextTick;
|
152
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
|
153
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
154
|
+
onRowClick: FunctionConstructor;
|
155
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
156
|
+
default: () => any[];
|
157
|
+
};
|
158
|
+
columns: import("vue-types").VueTypeDef<import("./props").Column[]>;
|
159
|
+
activeColumn: import("vue-types").VueTypeDef<number | number[]>;
|
160
|
+
columnPick: import("vue-types").VueTypeDef<string> & {
|
161
|
+
default: string;
|
162
|
+
};
|
163
|
+
height: import("vue-types").VueTypeDef<string | number> & {
|
164
|
+
default: string | number;
|
165
|
+
};
|
166
|
+
minHeight: import("vue-types").VueTypeDef<string | number> & {
|
167
|
+
default: string | number;
|
168
|
+
};
|
169
|
+
rowHeight: import("vue-types").VueTypeDef<any> & {
|
170
|
+
default: any;
|
171
|
+
};
|
172
|
+
headHeight: import("vue-types").VueTypeValidableDef<number> & {
|
173
|
+
default: number;
|
174
|
+
} & {
|
175
|
+
default: number;
|
176
|
+
};
|
177
|
+
showHead: import("vue-types").VueTypeValidableDef<boolean> & {
|
178
|
+
default: boolean;
|
179
|
+
} & {
|
180
|
+
default: boolean;
|
181
|
+
};
|
182
|
+
virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
183
|
+
default: boolean;
|
184
|
+
} & {
|
185
|
+
default: boolean;
|
186
|
+
};
|
187
|
+
border: import("vue-types").VueTypeDef<string[]> & {
|
188
|
+
default: () => string[];
|
189
|
+
};
|
190
|
+
pagination: import("vue-types").VueTypeDef<boolean | {
|
191
|
+
[key: string]: any;
|
192
|
+
}> & {
|
193
|
+
default: boolean | (() => {
|
194
|
+
[key: string]: any;
|
195
|
+
});
|
196
|
+
};
|
197
|
+
}>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & {} & import("vue").ComponentCustomProperties;
|
198
|
+
__isFragment?: never;
|
199
|
+
__isTeleport?: never;
|
200
|
+
__isSuspense?: never;
|
201
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
202
|
+
onRowClick: FunctionConstructor;
|
203
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
204
|
+
default: () => any[];
|
205
|
+
};
|
206
|
+
columns: import("vue-types").VueTypeDef<import("./props").Column[]>;
|
207
|
+
activeColumn: import("vue-types").VueTypeDef<number | number[]>;
|
208
|
+
columnPick: import("vue-types").VueTypeDef<string> & {
|
209
|
+
default: string;
|
210
|
+
};
|
211
|
+
height: import("vue-types").VueTypeDef<string | number> & {
|
212
|
+
default: string | number;
|
213
|
+
};
|
214
|
+
minHeight: import("vue-types").VueTypeDef<string | number> & {
|
215
|
+
default: string | number;
|
216
|
+
};
|
217
|
+
rowHeight: import("vue-types").VueTypeDef<any> & {
|
218
|
+
default: any;
|
219
|
+
};
|
220
|
+
headHeight: import("vue-types").VueTypeValidableDef<number> & {
|
221
|
+
default: number;
|
222
|
+
} & {
|
223
|
+
default: number;
|
224
|
+
};
|
225
|
+
showHead: import("vue-types").VueTypeValidableDef<boolean> & {
|
226
|
+
default: boolean;
|
227
|
+
} & {
|
228
|
+
default: boolean;
|
229
|
+
};
|
230
|
+
virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
231
|
+
default: boolean;
|
232
|
+
} & {
|
233
|
+
default: boolean;
|
234
|
+
};
|
235
|
+
border: import("vue-types").VueTypeDef<string[]> & {
|
236
|
+
default: () => string[];
|
237
|
+
};
|
238
|
+
pagination: import("vue-types").VueTypeDef<boolean | {
|
239
|
+
[key: string]: any;
|
240
|
+
}> & {
|
241
|
+
default: boolean | (() => {
|
242
|
+
[key: string]: any;
|
243
|
+
});
|
244
|
+
};
|
245
|
+
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
|
246
|
+
data: any[];
|
247
|
+
height: string | number;
|
248
|
+
minHeight: string | number;
|
249
|
+
border: string[];
|
250
|
+
headHeight: number;
|
251
|
+
columnPick: string;
|
252
|
+
rowHeight: any;
|
253
|
+
showHead: boolean;
|
254
|
+
virtualEnabled: boolean;
|
255
|
+
pagination: boolean | {
|
256
|
+
[key: string]: any;
|
257
|
+
};
|
258
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
|
259
|
+
export default BkTable;
|
package/lib/table/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("vue"),require("../shared"),require("../directives")):"function"==typeof define&&define.amd?define(["exports","vue","../shared","../directives"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.Shared,e.Directives)}(this,(function(e,r,t,o){"use strict";function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a={exports:{}};!function(e){e.exports=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0}(a);var i=s(a.exports),n=function e(o){var s=this;i(this,e),this.table=null,this.showHeader=!0,this.headerHeight=r.ref(44),this.bodyWidth=r.ref(null),this.scrollY=r.ref(!1),this.gutterWidth=t.scrollbarWidth(),this.bodyHeight=r.ref(null),this.footerHeight=r.ref(44),this.paginationHeight=r.ref(0),Object.keys(o).forEach((function(e){r.isRef(s[e])?s[e].value=o[e]:s[e]=o[e]}))},l={showHeader:t.PropTypes.bool.def(!0),headerBorder:t.PropTypes.bool.def(!0),defaultSort:t.PropTypes.object.def({prop:"",order:""})},d=r.defineComponent({name:"BkTable",props:l,directives:{mousewheel:o.mousewheel},setup:function(e){var t,o=(t=r.getCurrentInstance().refs,{handleHeaderFooterMousewheel:function(e,r){var o=r.pixelX,s=r.pixelY;Math.abs(o)>=Math.abs(s)&&(t.bodyWrapper.scrollLeft+=r.pixelX/5)}}).handleHeaderFooterMousewheel,s=r.getCurrentInstance(),a=new n({table:s,showHeader:e.showHeader});return console.error("layout",a),{handleHeaderFooterMousewheel:o}},render:function(){var e=t.classes({"bk-table":!0});return r.createVNode("div",{class:e},[this.showHeader?r.withDirectives(r.createVNode("div",{ref:"headerWrapper",class:"bk-table-header-wrapper"},null),[[r.resolveDirective("mousewheel"),this.handleHeaderFooterMousewheel]]):""])}});d.install=function(e){e.component(d.name,d)},e.default=d,Object.defineProperty(e,"__esModule",{value:!0})}));
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("../shared"),require("../pagination"),require("../virtual-render")):"function"==typeof define&&define.amd?define(["exports","vue","../shared","../pagination","../virtual-render"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.Shared,e.Pagination,e["@bkui-vue/virtual-render"])}(this,(function(e,t,r,o,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(o),s=i(n);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u={exports:{}};!function(e){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports}(u);var l=c(u.exports),p=["none","row","col","outer"],d={onRowClick:Function},f=Object.assign({data:r.PropTypes.arrayOf(r.PropTypes.any).def([]),columns:r.PropTypes.arrayOf(r.PropTypes.shape({label:r.PropTypes.oneOfType([r.PropTypes.func.def((function(){return""})),r.PropTypes.string.def("")]),field:r.PropTypes.oneOfType([r.PropTypes.func.def((function(){return""})),r.PropTypes.string.def("")]),render:r.PropTypes.oneOfType([r.PropTypes.func.def((function(){return""})),r.PropTypes.string.def("")]),width:r.PropTypes.oneOfType([r.PropTypes.number.def(void 0),r.PropTypes.string.def("auto")])})),activeColumn:r.PropTypes.oneOfType([r.PropTypes.number.def(-1),r.PropTypes.arrayOf(r.PropTypes.number.def(-1))]),columnPick:r.PropTypes.commonType(["multi","single","disabled"],"columnPick").def("disabled"),height:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string]).def("auto"),minHeight:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string]).def("auto"),rowHeight:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.func]).def(40),headHeight:r.PropTypes.number.def(40),showHead:r.PropTypes.bool.def(!0),virtualEnabled:r.PropTypes.bool.def(!1),border:r.PropTypes.arrayOf(r.PropTypes.commonType(p,"border")).def(["row"]),pagination:r.PropTypes.oneOfType([r.PropTypes.bool.def(!1),r.PropTypes.object.def({})]).def(!1)},d),y={exports:{}};!function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(y);var v=c(y.exports),h={exports:{}};!function(e){function t(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.exports=function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(h);var m=c(h.exports),b={exports:{}};!function(e){function t(r){return e.exports=t="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,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(b);var x=c(b.exports),g={exports:{}},T={exports:{}},P={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o},e.exports.__esModule=!0,e.exports.default=e.exports}(P),function(e){var t=P.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(T);var C={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}(C);var w={exports:{}};!function(e){var t=P.exports;e.exports=function(e,r){if(e){if("string"==typeof e)return t(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,r):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(w);var O={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}(O),function(e){var t=T.exports,r=C.exports,o=w.exports,n=O.exports;e.exports=function(e){return t(e)||r(e)||o(e)||n()},e.exports.__esModule=!0,e.exports.default=e.exports}(g);var k=c(g.exports),_=void 0,N=function(e,t,r){var o;if(Object.prototype.hasOwnProperty.call(e,t))return"function"==typeof e[t]?(o=e[t]).call.apply(o,[_].concat(k(r))):e[t]},j=function(e){return"disabled"!==e.columnPick?"multi"===e.columnPick?Array.isArray(e.activeColumn)?e.activeColumn:A(e.activeColumn):Array.isArray(e.activeColumn)?A(e.activeColumn[0]):A(e.activeColumn):[]},A=function(e){return/^\d+$/.test("".concat(e))?[parseInt("".concat(e),10)]:[]},H=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"100%",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o="";return o=/^auto|null|undefined$/gi.test("".concat(e))?t:/^\d+\.?\d+$/.test("".concat(e))?"".concat(e,"px"):e,r&&(o="calc(".concat(o," - ").concat(r,")")),o},V=m((function e(t,r){v(this,e),this.props=null,this.ctx=null,this.props=t,this.ctx=r})),S=function(){function e(t,r,o,n){v(this,e),this.props=t,this.context=r,this.reactiveProp=o,this.colgroups=n,this.plugins=new V(t,r)}return m(e,[{key:"propActiveCols",get:function(){return this.reactiveProp.activeColumns}},{key:"renderTableHeadSchema",value:function(){return t.createVNode("table",{cellpadding:0,cellspacing:0},[this.renderColGroup(),this.renderHeader()])}},{key:"renderTableBodySchema",value:function(e){return t.createVNode("table",{cellpadding:0,cellspacing:0},[this.renderColGroup(),this.renderTBody(e)])}},{key:"renderTableFooter",value:function(e){return t.createVNode(a.default,e,null)}},{key:"setColumnActive",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.propActiveCols.find((function(t){return t.index===e}));Object.assign(r,{active:!r.active}),t&&this.propActiveCols.filter((function(t){return t.index!==e&&t.active})).forEach((function(e){Object.assign(e,{active:!1})}))}},{key:"handleColumnHeadClick",value:function(e){"disabled"!==this.props.columnPick&&(this.setColumnActive(e,"single"===this.props.columnPick),this.context.emit("column-pick",this.propActiveCols))}},{key:"renderHeader",value:function(){var e=this,o={"--row-height":"".concat(N(this.props,"headHeight",["thead"]),"px")};return t.createVNode("thead",{style:o},[t.createVNode("tr",null,[this.props.columns.map((function(o,n){return t.createVNode("th",{colspan:1,rowspan:1,class:r.classes({active:e.isColActive(n)}),onClick:function(){return e.handleColumnHeadClick(n)}},[t.createVNode("div",{class:"cell"},[N(o,"label",[o])])])}))])])}},{key:"renderTBody",value:function(e){var r=this;return t.createVNode("tbody",null,[e.map((function(o,n){var i={"--row-height":"".concat(N(r.props,"rowHeight",["tbody",o,n]),"px")};return t.createVNode("tr",{style:i,onClick:function(t){return r.handleRowClick(t,o,n,e)}},[r.props.columns.map((function(i){return t.createVNode("td",{colspan:1,rowspan:1},[t.createVNode("div",{class:"cell"},[r.renderCell(o,i,n,e)])])}))])}))])}},{key:"handleRowClick",value:function(e,t,r,o){this.context.emit("row-click",e,t,r,o,this)}},{key:"renderCell",value:function(e,t,r,o){var n=e[N(t,"field",[t,e])];return"function"==typeof t.render?t.render(n,e,r,o):n}},{key:"isColActive",value:function(e){return"disabled"!==this.props.columnPick&&this.propActiveCols.some((function(t){return t.index===e&&t.active}))}},{key:"renderColGroup",value:function(){var e=this;return t.createVNode("colgroup",null,[(this.colgroups||[]).map((function(o,n){var i,a=r.classes({active:e.isColActive(n)}),s={width:(i=o.calcWidth,H(i,"auto"))};return t.createVNode("col",{class:a,style:s},null)}))])}}]),e}(),M=t.defineComponent({name:"Table",props:f,setup:function(e,o){var n=t.reactive(j(e)),i=t.reactive(e.columns.map((function(e){return Object.assign(Object.assign({},e),{calcWidth:null})}))),a=t.reactive({count:0,limit:10,current:1}),c=null,u=t.ref(),d=function(){return(e.columns||[]).map((function(e,t){return{index:t,active:n.some((function(e){return e===t})),_column:e}}))},f=t.reactive({activeColumns:d(),scrollTranslateY:0}),y=t.computed((function(){return{minHeight:H(e.minHeight,"auto")}})),v=t.computed((function(){var t,r=H(e.height),o=e.showHead?H(e.headHeight):"0",n=(t=e.height,!/^\d+\.?\d*(px|%)?$/.test("".concat(t)));return Object.assign({display:"block"},n?{maxHeight:"calc(".concat(r," - ").concat(o," - 2px)")}:{height:"calc(".concat(r," - ").concat(o," - 2px)")})}));t.watch((function(){return[e.activeColumn,e.columns,e.pagination]}),(function(){t.nextTick((function(){f.activeColumns=d();var t,r,o=j(e);f.activeColumns.forEach((function(e,t){Object.assign(e,{active:o.some((function(e){return e===t}))})})),t=e.pagination,r=a,a=t?"object"===x(t)?Object.assign(Object.assign({},t),r):r:{}}))}),{deep:!0});var h=new S(e,o,f,i),m=t.computed((function(){return r.classes(l({},r.resolveClassName("table"),!0),(t=e.border,o=["row"],"string"==typeof t&&o.push(t),Array.isArray(t)&&o.push.apply(o,k(t.filter((function(e){return p.includes(e)})))),k(new Set(o)).map((function(e){return"bordered-".concat(e)})).join(" ")));var t,o})),b=r.classes(l({},r.resolveClassName("table-head"),!0)),g=r.classes(l({},r.resolveClassName("table-body"),!0)),T=r.classes(l({},r.resolveClassName("table-footer"),!0)),P=function(e){var t=e[1];f.scrollTranslateY=t.translateY};return t.onMounted((function(){c=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=r.throttle((function(){"function"==typeof t&&t()}),o),a=new ResizeObserver((function(){i()}));return n&&"function"==typeof t&&t(),{start:function(){a.observe(e)},stop:function(){a.disconnect(),a.unobserve(e)}}}(u.value,(function(){!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20,o=(e.getBoundingClientRect()||{}).width,n=[],i=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Object.assign(e,{calcWidth:t}),r&&(o-=t)<0&&(o=0)};if(t.forEach((function(e,t){var a=String(e.width),s=!0;if(/^\d+\.?\d*(px)?$/.test(a)){var c=Number(a.replace("px",""));i(e,c),s=!1}if(/^\d+\.?\d*%$/.test(a)){var u=r;if(o>0){var l=Number(a.replace("%",""));u=o*l/100}i(e,u),s=!1}s&&n.push(t)})),n.length>0){var a=r;o>0&&(a=o/n.length,n.forEach((function(e){return i(t[e],a,!1)})))}}(u.value,i,20)}),60,!0),c.start()})),t.onBeforeUnmount((function(){c.stop(),c=null})),o.expose({plugins:h.plugins}),function(){return t.createVNode("div",{class:m.value,style:y.value,ref:u},[t.createVNode("div",{class:b},[e.showHead&&h.renderTableHeadSchema()]),t.createVNode(s.default,{lineHeight:e.rowHeight,contentClassName:g,style:v.value,list:e.data,onContentScroll:P,throttleDelay:0,enabled:e.virtualEnabled},{default:function(t){return h.renderTableBodySchema(t.data||e.data)},afterContent:function(){return t.createVNode("div",{class:r.resolveClassName("table-fixed")},null)}}),t.createVNode("div",{class:T},[e.pagination&&h.renderTableFooter(a)])])}}}),E=r.withInstall(M);e.default=E,Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -0,0 +1,110 @@
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
2
|
+
export declare const tableProps: {
|
3
|
+
onRowClick: FunctionConstructor;
|
4
|
+
/**
|
5
|
+
* 渲染列表
|
6
|
+
*/
|
7
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
8
|
+
default: () => any[];
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* Table 列渲染
|
12
|
+
*/
|
13
|
+
columns: import("vue-types").VueTypeDef<Column[]>;
|
14
|
+
/**
|
15
|
+
* 当前选中列
|
16
|
+
* 当设置选中多列时(columnPick = multi),配置为数组[index1, index2, index3],只能选中单列时,可以为数值或者数组[index]
|
17
|
+
*/
|
18
|
+
activeColumn: import("vue-types").VueTypeDef<number | number[]>;
|
19
|
+
/**
|
20
|
+
* 表格列选中方式
|
21
|
+
* 支持:单列(single),多列(multi),禁用(disabled)
|
22
|
+
* 默认:disabled
|
23
|
+
*/
|
24
|
+
columnPick: import("vue-types").VueTypeDef<string> & {
|
25
|
+
default: string;
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
* 设置表格高度
|
29
|
+
* 默认:auto,依赖外层高度
|
30
|
+
*/
|
31
|
+
height: import("vue-types").VueTypeDef<string | number> & {
|
32
|
+
default: string | number;
|
33
|
+
};
|
34
|
+
/**
|
35
|
+
* 设置表格最小高度
|
36
|
+
* 默认:auto,依赖外层高度
|
37
|
+
*/
|
38
|
+
minHeight: import("vue-types").VueTypeDef<string | number> & {
|
39
|
+
default: string | number;
|
40
|
+
};
|
41
|
+
/**
|
42
|
+
* 行高,可以为固定数值类型
|
43
|
+
* 可以是函数,返回当前行的高度,返回值为数值类型
|
44
|
+
*/
|
45
|
+
rowHeight: import("vue-types").VueTypeDef<any> & {
|
46
|
+
default: any;
|
47
|
+
};
|
48
|
+
/**
|
49
|
+
* Thead行高,可以为固定数值类型
|
50
|
+
*/
|
51
|
+
headHeight: import("vue-types").VueTypeValidableDef<number> & {
|
52
|
+
default: number;
|
53
|
+
} & {
|
54
|
+
default: number;
|
55
|
+
};
|
56
|
+
/**
|
57
|
+
* 是否显示Head
|
58
|
+
*/
|
59
|
+
showHead: import("vue-types").VueTypeValidableDef<boolean> & {
|
60
|
+
default: boolean;
|
61
|
+
} & {
|
62
|
+
default: boolean;
|
63
|
+
};
|
64
|
+
/**
|
65
|
+
* 是否启用虚拟渲染 & 滚动
|
66
|
+
* 当数据量很大时,启用虚拟渲染可以解决压面卡顿问题
|
67
|
+
*/
|
68
|
+
virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
69
|
+
default: boolean;
|
70
|
+
} & {
|
71
|
+
default: boolean;
|
72
|
+
};
|
73
|
+
/**
|
74
|
+
* 表格边框显示设置,可以是一个组合
|
75
|
+
* 生效规则: 除非单独设置 none,否则会追加每个设置
|
76
|
+
*/
|
77
|
+
border: import("vue-types").VueTypeDef<string[]> & {
|
78
|
+
default: () => string[];
|
79
|
+
};
|
80
|
+
/**
|
81
|
+
* 分页配置
|
82
|
+
* 默认值为false,不启用分页
|
83
|
+
* 设置为 true,启用分页功能,默认值参考分页组件 Pagination
|
84
|
+
*/
|
85
|
+
pagination: import("vue-types").VueTypeDef<boolean | {
|
86
|
+
[key: string]: any;
|
87
|
+
}> & {
|
88
|
+
default: boolean | (() => {
|
89
|
+
[key: string]: any;
|
90
|
+
});
|
91
|
+
};
|
92
|
+
};
|
93
|
+
export declare type Column = {
|
94
|
+
label: Function | string;
|
95
|
+
field: Function | string;
|
96
|
+
render?: Function | string;
|
97
|
+
width?: number | string;
|
98
|
+
};
|
99
|
+
export declare type GroupColumn = {
|
100
|
+
calcWidth?: number;
|
101
|
+
} & Column;
|
102
|
+
export declare type Columns = ReadonlyArray<Column>;
|
103
|
+
export declare type TablePropTypes = Readonly<ExtractPropTypes<typeof tableProps>>;
|
104
|
+
export declare type IColumnActive = {
|
105
|
+
index: number;
|
106
|
+
active: boolean;
|
107
|
+
};
|
108
|
+
export declare type IReactiveProp = {
|
109
|
+
activeColumns: IColumnActive[];
|
110
|
+
};
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import { SetupContext } from 'vue';
|
2
|
+
import { GroupColumn, IColumnActive, IReactiveProp, TablePropTypes } from './props';
|
3
|
+
import { TablePlugins } from './plugins/index';
|
4
|
+
export default class TableRender {
|
5
|
+
props: TablePropTypes;
|
6
|
+
context: SetupContext;
|
7
|
+
reactiveProp: any;
|
8
|
+
colgroups: GroupColumn[];
|
9
|
+
plugins: TablePlugins;
|
10
|
+
constructor(props: TablePropTypes, ctx: SetupContext, reactiveProp: IReactiveProp, colgroups: GroupColumn[]);
|
11
|
+
get propActiveCols(): IColumnActive[];
|
12
|
+
/**
|
13
|
+
* 渲染Table Head
|
14
|
+
* @param activeColumns 当前选中的列
|
15
|
+
* @returns
|
16
|
+
*/
|
17
|
+
renderTableHeadSchema(): JSX.Element;
|
18
|
+
/**
|
19
|
+
* 渲染Table主体
|
20
|
+
* @param activeColumns 当前选中的列
|
21
|
+
* @returns
|
22
|
+
*/
|
23
|
+
renderTableBodySchema(rows: any[]): JSX.Element;
|
24
|
+
renderTableFooter(options: any): JSX.Element;
|
25
|
+
/**
|
26
|
+
* 指定列选中状态
|
27
|
+
* @param index 指定选中的列Index
|
28
|
+
* @param single 是否重置其他列,当只允许选中一列的情况下需要先重置
|
29
|
+
*/
|
30
|
+
private setColumnActive;
|
31
|
+
/**
|
32
|
+
* 点击选中一列事件
|
33
|
+
* @param index 当前选中列Index
|
34
|
+
*/
|
35
|
+
private handleColumnHeadClick;
|
36
|
+
/**
|
37
|
+
* 渲染Table Header
|
38
|
+
* @returns
|
39
|
+
*/
|
40
|
+
private renderHeader;
|
41
|
+
/**
|
42
|
+
* 渲染Table Body
|
43
|
+
* @returns
|
44
|
+
*/
|
45
|
+
private renderTBody;
|
46
|
+
/**
|
47
|
+
* table row click handle
|
48
|
+
* @param e
|
49
|
+
* @param row
|
50
|
+
* @param index
|
51
|
+
* @param rows
|
52
|
+
*/
|
53
|
+
private handleRowClick;
|
54
|
+
/**
|
55
|
+
* 渲染表格Cell内容
|
56
|
+
* @param row 当前行
|
57
|
+
* @param column 当前列
|
58
|
+
* @returns
|
59
|
+
*/
|
60
|
+
private renderCell;
|
61
|
+
/**
|
62
|
+
* 判定指定列是否为选中状态
|
63
|
+
* @param colIndex 指定列Index
|
64
|
+
* @returns
|
65
|
+
*/
|
66
|
+
private isColActive;
|
67
|
+
/**
|
68
|
+
* 渲染表格Col分组
|
69
|
+
* @returns
|
70
|
+
*/
|
71
|
+
private renderColGroup;
|
72
|
+
}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
.bk-table {
|
2
|
+
overflow: auto;
|
3
|
+
border-top: 1px solid #dcdee5;
|
4
|
+
border-bottom: 1px solid #dcdee5;
|
5
|
+
}
|
6
|
+
.bk-table .bk-table-head,
|
7
|
+
.bk-table .bk-table-body {
|
8
|
+
background: white;
|
9
|
+
}
|
10
|
+
.bk-table .bk-table-head table,
|
11
|
+
.bk-table .bk-table-body table {
|
12
|
+
width: 100%;
|
13
|
+
border-collapse: collapse;
|
14
|
+
}
|
15
|
+
.bk-table .bk-table-head table th,
|
16
|
+
.bk-table .bk-table-body table th,
|
17
|
+
.bk-table .bk-table-head table td,
|
18
|
+
.bk-table .bk-table-body table td {
|
19
|
+
min-width: 80px;
|
20
|
+
}
|
21
|
+
.bk-table .bk-table-head table th .cell,
|
22
|
+
.bk-table .bk-table-body table th .cell,
|
23
|
+
.bk-table .bk-table-head table td .cell,
|
24
|
+
.bk-table .bk-table-body table td .cell {
|
25
|
+
height: var(--row-height);
|
26
|
+
padding: 0 15px;
|
27
|
+
overflow: hidden;
|
28
|
+
line-height: var(--row-height);
|
29
|
+
color: #575961;
|
30
|
+
text-align: left;
|
31
|
+
text-overflow: ellipsis;
|
32
|
+
white-space: nowrap;
|
33
|
+
}
|
34
|
+
.bk-table .bk-table-head table thead th,
|
35
|
+
.bk-table .bk-table-body table thead th {
|
36
|
+
position: sticky;
|
37
|
+
top: 0;
|
38
|
+
z-index: 1;
|
39
|
+
color: #313238;
|
40
|
+
background-color: #fafbfd;
|
41
|
+
}
|
42
|
+
.bk-table .bk-table-head table thead th.active,
|
43
|
+
.bk-table .bk-table-body table thead th.active,
|
44
|
+
.bk-table .bk-table-head table thead th:hover,
|
45
|
+
.bk-table .bk-table-body table thead th:hover {
|
46
|
+
background: #f0f1f5;
|
47
|
+
}
|
48
|
+
.bk-table .bk-table-head table tbody tr:hover td,
|
49
|
+
.bk-table .bk-table-body table tbody tr:hover td {
|
50
|
+
background: #f5f7fa;
|
51
|
+
}
|
52
|
+
.bk-table.bordered-row .cell {
|
53
|
+
border-bottom: 1px solid #dcdee5;
|
54
|
+
}
|
55
|
+
.bk-table.bordered-outer {
|
56
|
+
border-right: 1px solid #dcdee5;
|
57
|
+
border-left: 1px solid #dcdee5;
|
58
|
+
}
|
59
|
+
.bk-table.bordered-col th .cell,
|
60
|
+
.bk-table.bordered-col td .cell {
|
61
|
+
border-right: 1px solid #dcdee5;
|
62
|
+
}
|
63
|
+
.bk-table.bordered-col th:last-child .cell,
|
64
|
+
.bk-table.bordered-col td:last-child .cell {
|
65
|
+
border-right: none;
|
66
|
+
}
|
67
|
+
.bk-table.bordered-none th .cell,
|
68
|
+
.bk-table.bordered-none td .cell {
|
69
|
+
border-top: none;
|
70
|
+
border-right: none;
|
71
|
+
border-bottom: none;
|
72
|
+
border-left: none;
|
73
|
+
}
|
74
|
+
.bk-table .bk-table-fixed {
|
75
|
+
width: 100%;
|
76
|
+
}
|
77
|
+
.bk-table colgroup col {
|
78
|
+
background: white;
|
79
|
+
}
|
80
|
+
.bk-table colgroup col.active {
|
81
|
+
position: relative;
|
82
|
+
background: #f0f1f5;
|
83
|
+
}
|