@gx-design-vue/pro-table 0.2.0-alpha.11 → 0.2.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ProTable.js +12 -16
- package/dist/components/ScrollBar/Bar.d.ts +1 -1
- package/dist/components/ScrollBar/Thumb.js +1 -1
- package/dist/components/SearchForm/CollapseToggle.d.ts +1 -1
- package/dist/components/SearchForm/CollapseToggle.js +2 -2
- package/dist/components/SearchForm/FormItemContainer.d.ts +2 -2
- package/dist/components/SearchForm/SearchForm.d.ts +4 -4
- package/dist/components/Toolbar/FullscreenIcon.js +2 -2
- package/dist/components/Toolbar/ListToolBar.d.ts +8 -8
- package/dist/components/Toolbar/ListToolBar.js +2 -2
- package/dist/components/Toolbar/index.d.ts +5 -5
- package/dist/components/Toolbar/index.js +2 -2
- package/dist/pro-table.esm.js +900 -1384
- package/dist/pro-table.js +1 -1
- package/package.json +7 -8
package/dist/ProTable.js
CHANGED
|
@@ -19,7 +19,7 @@ import { useTableSize } from "./hooks/useTableSize.js";
|
|
|
19
19
|
import "./hooks/index.js";
|
|
20
20
|
import style_default from "./style/index.js";
|
|
21
21
|
import { Fragment, Teleport, computed, createVNode, defineComponent, mergeDefaults, mergeProps, ref, toRef, watch } from "vue";
|
|
22
|
-
import {
|
|
22
|
+
import { useProConfigContext } from "@gx-design-vue/pro-provider";
|
|
23
23
|
import { classNames, getSlotVNode } from "@gx-design-vue/pro-utils";
|
|
24
24
|
import { useFullscreen } from "@vueuse/core";
|
|
25
25
|
import { Pagination, Spin, Table } from "antdv-next";
|
|
@@ -65,7 +65,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
65
65
|
const { prefixCls } = useBaseConfig("pro-table", props);
|
|
66
66
|
const rootCls = useCSSVarCls(prefixCls);
|
|
67
67
|
const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
|
|
68
|
-
const
|
|
68
|
+
const configContext = useProConfigContext();
|
|
69
69
|
const rootEl = ref();
|
|
70
70
|
const { toggle: toggleFullscreen, isFullscreen } = useFullscreen(rootEl);
|
|
71
71
|
watch(isFullscreen, (val) => {
|
|
@@ -224,7 +224,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
224
224
|
props,
|
|
225
225
|
key: "emptyText"
|
|
226
226
|
});
|
|
227
|
-
if (emptyTextSlot
|
|
227
|
+
if (emptyTextSlot && configContext?.renderEmpty?.value) return emptyTextSlot || configContext?.renderEmpty?.value?.();
|
|
228
228
|
return null;
|
|
229
229
|
}
|
|
230
230
|
function onCustomPaginationChange(currentPage, currentPageSize) {
|
|
@@ -283,7 +283,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
283
283
|
props,
|
|
284
284
|
key: "emptyText"
|
|
285
285
|
});
|
|
286
|
-
if (emptyTextRender ||
|
|
286
|
+
if (emptyTextRender || configContext?.renderEmpty?.value) result.emptyText = () => emptyTextRender || configContext?.renderEmpty?.value?.();
|
|
287
287
|
return result;
|
|
288
288
|
});
|
|
289
289
|
expose({
|
|
@@ -567,12 +567,11 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
567
567
|
emptyText: {
|
|
568
568
|
type: [
|
|
569
569
|
Function,
|
|
570
|
-
Object,
|
|
571
570
|
String,
|
|
572
571
|
Number,
|
|
573
|
-
Boolean,
|
|
574
572
|
null,
|
|
575
|
-
|
|
573
|
+
Object,
|
|
574
|
+
Boolean
|
|
576
575
|
],
|
|
577
576
|
required: false,
|
|
578
577
|
default: void 0
|
|
@@ -580,12 +579,11 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
580
579
|
headerTitle: {
|
|
581
580
|
type: [
|
|
582
581
|
Function,
|
|
583
|
-
Object,
|
|
584
582
|
String,
|
|
585
583
|
Number,
|
|
586
|
-
Boolean,
|
|
587
584
|
null,
|
|
588
|
-
|
|
585
|
+
Object,
|
|
586
|
+
Boolean
|
|
589
587
|
],
|
|
590
588
|
required: false,
|
|
591
589
|
default: void 0
|
|
@@ -593,12 +591,11 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
593
591
|
headerTitleTip: {
|
|
594
592
|
type: [
|
|
595
593
|
Function,
|
|
596
|
-
Object,
|
|
597
594
|
String,
|
|
598
595
|
Number,
|
|
599
|
-
Boolean,
|
|
600
596
|
null,
|
|
601
|
-
|
|
597
|
+
Object,
|
|
598
|
+
Boolean
|
|
602
599
|
],
|
|
603
600
|
required: false,
|
|
604
601
|
default: void 0
|
|
@@ -606,12 +603,11 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
606
603
|
listToolAfter: {
|
|
607
604
|
type: [
|
|
608
605
|
Function,
|
|
609
|
-
Object,
|
|
610
606
|
String,
|
|
611
607
|
Number,
|
|
612
|
-
Boolean,
|
|
613
608
|
null,
|
|
614
|
-
|
|
609
|
+
Object,
|
|
610
|
+
Boolean
|
|
615
611
|
],
|
|
616
612
|
required: false,
|
|
617
613
|
default: void 0
|
|
@@ -70,11 +70,11 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
70
70
|
};
|
|
71
71
|
}>> & Readonly<{}>, {
|
|
72
72
|
readonly always: boolean;
|
|
73
|
+
readonly minSize: number;
|
|
73
74
|
readonly barStyle: {
|
|
74
75
|
x: CSSProperties;
|
|
75
76
|
y: CSSProperties;
|
|
76
77
|
};
|
|
77
|
-
readonly minSize: number;
|
|
78
78
|
readonly hasScrollY: boolean;
|
|
79
79
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
80
80
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useInjectScrollBarContext } from "./context.js";
|
|
2
2
|
import { BAR_MAP, renderThumbStyle } from "./util.js";
|
|
3
3
|
import { computed, createVNode, defineComponent, onBeforeUnmount, ref } from "vue";
|
|
4
|
-
import { useEventListener } from "@vueuse/core";
|
|
5
4
|
import { unit } from "@gx-design-vue/pro-provider";
|
|
5
|
+
import { useEventListener } from "@vueuse/core";
|
|
6
6
|
//#region src/components/ScrollBar/Thumb.tsx
|
|
7
7
|
const thumbProps = {
|
|
8
8
|
vertical: Boolean,
|
|
@@ -47,9 +47,9 @@ declare const CollapseToggle: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
47
47
|
required: true;
|
|
48
48
|
};
|
|
49
49
|
}>> & Readonly<{}>, {
|
|
50
|
-
hashId: string;
|
|
51
50
|
collapsed: boolean;
|
|
52
51
|
collapseRender: WithFalse<(collapsed?: boolean) => CustomRender>;
|
|
52
|
+
hashId: string;
|
|
53
53
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
54
54
|
//#endregion
|
|
55
55
|
export { CollapseToggle };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createVNode, defineComponent } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { GIcon } from "@gx-design-vue/icon";
|
|
3
3
|
//#region src/components/SearchForm/CollapseToggle.tsx
|
|
4
4
|
const CollapseToggle = /* @__PURE__ */ defineComponent({
|
|
5
5
|
name: "ProTableCollapseToggle",
|
|
@@ -39,7 +39,7 @@ const CollapseToggle = /* @__PURE__ */ defineComponent({
|
|
|
39
39
|
return createVNode("span", {
|
|
40
40
|
"class": `${props.prefixCls}-search-control-text`,
|
|
41
41
|
"onClick": () => props.onToggle(!props.collapsed)
|
|
42
|
-
}, [props.collapsed ? "展开" : "收起", props.collapsed ? createVNode(
|
|
42
|
+
}, [props.collapsed ? "展开" : "收起", props.collapsed ? createVNode(GIcon, { "type": "DownOutlined" }, null) : createVNode(GIcon, { "type": "UpOutlined" }, null)]);
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
});
|
|
@@ -67,9 +67,9 @@ declare const FormItemContainer: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
67
67
|
default: any;
|
|
68
68
|
};
|
|
69
69
|
}>> & Readonly<{}>, {
|
|
70
|
-
onSubmit: () => void;
|
|
71
|
-
loading: boolean;
|
|
72
70
|
autoRequest: boolean;
|
|
71
|
+
loading: boolean;
|
|
72
|
+
onSubmit: () => void;
|
|
73
73
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
74
74
|
//#endregion
|
|
75
75
|
export { FormItemContainer };
|
|
@@ -111,9 +111,7 @@ declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
111
111
|
default: any;
|
|
112
112
|
};
|
|
113
113
|
}>> & Readonly<{}>, {
|
|
114
|
-
|
|
115
|
-
proClasses: Record<string, string>;
|
|
116
|
-
proStyles: Record<string, any>;
|
|
114
|
+
loading: any;
|
|
117
115
|
formColumns: ProSearchMap<"text", string>[];
|
|
118
116
|
formConfig: FormConfig;
|
|
119
117
|
formAutoRequest: boolean;
|
|
@@ -123,8 +121,10 @@ declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
123
121
|
searchText?: string;
|
|
124
122
|
resetText?: string;
|
|
125
123
|
};
|
|
126
|
-
loading: any;
|
|
127
124
|
cardBordered: boolean;
|
|
125
|
+
proClasses: Record<string, string>;
|
|
126
|
+
proStyles: Record<string, any>;
|
|
127
|
+
onReset: (params: Record<string, any>) => void;
|
|
128
128
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
129
129
|
//#endregion
|
|
130
130
|
export { ProTableSearchForm as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createVNode, defineComponent } from "vue";
|
|
2
2
|
import { Tooltip } from "antdv-next";
|
|
3
|
-
import {
|
|
3
|
+
import { GIcon } from "@gx-design-vue/icon";
|
|
4
4
|
//#region src/components/Toolbar/FullscreenIcon.tsx
|
|
5
5
|
const FullscreenIcon = /* @__PURE__ */ defineComponent({
|
|
6
6
|
name: "ProTableFullscreenIcon",
|
|
@@ -15,7 +15,7 @@ const FullscreenIcon = /* @__PURE__ */ defineComponent({
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
setup(props) {
|
|
18
|
-
return () => createVNode(Tooltip, { "title": props.isFullscreen ? "退出全屏" : "全屏" }, { default: () => [createVNode("span", { "onClick": props.onToggle }, [props.isFullscreen ? createVNode(
|
|
18
|
+
return () => createVNode(Tooltip, { "title": props.isFullscreen ? "退出全屏" : "全屏" }, { default: () => [createVNode("span", { "onClick": props.onToggle }, [props.isFullscreen ? createVNode(GIcon, { "type": "FullscreenExitOutlined" }, null) : createVNode(GIcon, { "type": "FullscreenOutlined" }, null)])] });
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
//#endregion
|
|
@@ -93,19 +93,19 @@ declare const ListToolBar: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
93
93
|
default: () => {};
|
|
94
94
|
};
|
|
95
95
|
}>> & Readonly<{}>, {
|
|
96
|
-
headerTitle: any;
|
|
97
|
-
headerTitleTip: any;
|
|
98
|
-
titleTipText: string;
|
|
99
|
-
settings: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
100
|
-
[key: string]: any;
|
|
101
|
-
}>[];
|
|
102
96
|
actions: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
103
97
|
[key: string]: any;
|
|
104
98
|
}>[];
|
|
105
|
-
actionsPlacement: ToolbarPlacement;
|
|
106
|
-
listToolAfter: any;
|
|
107
99
|
proClasses: Record<string, any>;
|
|
108
100
|
proStyles: Record<string, any>;
|
|
101
|
+
titleTipText: string;
|
|
102
|
+
actionsPlacement: ToolbarPlacement;
|
|
103
|
+
headerTitle: any;
|
|
104
|
+
listToolAfter: any;
|
|
105
|
+
headerTitleTip: any;
|
|
106
|
+
settings: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
}>[];
|
|
109
109
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
110
110
|
//#endregion
|
|
111
111
|
export { ListToolBar, ListToolBarSetting };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createVNode, defineComponent, isVNode } from "vue";
|
|
2
2
|
import { Tooltip } from "antdv-next";
|
|
3
|
-
import {
|
|
3
|
+
import { GIcon } from "@gx-design-vue/icon";
|
|
4
4
|
//#region src/components/Toolbar/ListToolBar.tsx
|
|
5
5
|
function renderSettingItem(setting) {
|
|
6
6
|
if (isVNode(setting)) return setting;
|
|
@@ -76,7 +76,7 @@ const ListToolBar = /* @__PURE__ */ defineComponent({
|
|
|
76
76
|
}, [hasTitle.value && createVNode("div", {
|
|
77
77
|
"class": [`${prefix}-list-toolbar-title`, props.proClasses.toolbarTitle],
|
|
78
78
|
"style": props.proStyles.toolbarTitle
|
|
79
|
-
}, [props.headerTitle, props.headerTitleTip && createVNode(Tooltip, { "title": props.titleTipText }, { default: () => [typeof props.headerTitleTip === "boolean" ? createVNode(
|
|
79
|
+
}, [props.headerTitle, props.headerTitleTip && createVNode(Tooltip, { "title": props.titleTipText }, { default: () => [typeof props.headerTitleTip === "boolean" ? createVNode(GIcon, { "type": "InfoCircleOutlined" }, null) : props.headerTitleTip] })]), leftActions.value.length > 0 && createVNode("div", { "class": `${prefix}-list-toolbar-actions` }, [leftActions.value])]) : hasRight.value ? createVNode("div", {
|
|
80
80
|
"class": `${prefix}-list-toolbar-left`,
|
|
81
81
|
"style": props.proStyles.toolbarLeft
|
|
82
82
|
}, null) : null;
|
|
@@ -87,17 +87,17 @@ declare const Toolbar: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
87
87
|
default: () => {};
|
|
88
88
|
};
|
|
89
89
|
}>> & Readonly<{}>, {
|
|
90
|
-
headerTitle: any;
|
|
91
|
-
headerTitleTip: any;
|
|
92
|
-
titleTipText: string;
|
|
93
90
|
actions: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
94
91
|
[key: string]: any;
|
|
95
92
|
}>[];
|
|
96
|
-
actionsPlacement: ToolbarPlacement;
|
|
97
|
-
listToolAfter: any;
|
|
98
93
|
proClasses: Record<string, any>;
|
|
99
94
|
proStyles: Record<string, any>;
|
|
100
95
|
options: any;
|
|
96
|
+
titleTipText: string;
|
|
97
|
+
actionsPlacement: ToolbarPlacement;
|
|
98
|
+
headerTitle: any;
|
|
99
|
+
listToolAfter: any;
|
|
100
|
+
headerTitleTip: any;
|
|
101
101
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
102
102
|
//#endregion
|
|
103
103
|
export { Toolbar, Toolbar as default };
|
|
@@ -3,7 +3,7 @@ import { FullscreenIcon } from "./FullscreenIcon.js";
|
|
|
3
3
|
import { ListToolBar } from "./ListToolBar.js";
|
|
4
4
|
import { computed, createVNode, defineComponent, unref } from "vue";
|
|
5
5
|
import { Tooltip } from "antdv-next";
|
|
6
|
-
import {
|
|
6
|
+
import { GIcon } from "@gx-design-vue/icon";
|
|
7
7
|
//#region src/components/Toolbar/index.tsx
|
|
8
8
|
function isObject(val) {
|
|
9
9
|
return val !== null && typeof val === "object";
|
|
@@ -66,7 +66,7 @@ const Toolbar = /* @__PURE__ */ defineComponent({
|
|
|
66
66
|
} else result.push(createVNode(Tooltip, {
|
|
67
67
|
"title": "刷新",
|
|
68
68
|
"key": "reload"
|
|
69
|
-
}, { default: () => [createVNode("span", { "onClick": reloadAction }, [createVNode(
|
|
69
|
+
}, { default: () => [createVNode("span", { "onClick": reloadAction }, [createVNode(GIcon, { "type": "ReloadOutlined" }, null)])] }));
|
|
70
70
|
}
|
|
71
71
|
if (options.fullScreen !== false) {
|
|
72
72
|
const toggleAction = () => ctx?.toggleFullscreen?.();
|