@dazhicheng/ui 1.5.265 → 1.6.0
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/components/tt-area/TtArea.vue.js +1 -1
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-drawer/src/hooks/useResizable.js +2 -2
- package/dist/components/tt-form/src/components/FormElInput.vue.js +51 -38
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +36 -36
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +3 -3
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +3 -1
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-modal-form/index.vue.js +13 -12
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +93 -86
- package/dist/components/tt-panel-select/src/index.vue.js +1 -0
- package/dist/components/tt-select/src/Select.vue.d.ts +4 -4
- package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
- package/dist/components/tt-table/index.d.ts +523 -358
- package/dist/components/tt-table/index.js +7 -4
- package/dist/components/tt-table/src/Table.vue.d.ts +306 -216
- package/dist/components/tt-table/src/Table.vue.js +405 -618
- package/dist/components/tt-table/src/TableForm.vue.d.ts +384 -19
- package/dist/components/tt-table/src/TableForm.vue.js +219 -228
- package/dist/components/tt-table/src/components/TableAction.vue.js +108 -131
- package/dist/components/tt-table/src/components/TableButtons.js +25 -25
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +88 -85
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.d.ts +80 -0
- package/dist/components/tt-table/src/components/{TableToobalTools.vue.js → TableToolbarTools.vue.js} +29 -31
- package/dist/components/tt-table/src/components/TableToolbarTools.vue2.js +4 -0
- package/dist/components/tt-table/src/emits.js +2 -1
- package/dist/components/tt-table/src/hooks/useColumnPersistence.d.ts +19 -0
- package/dist/components/tt-table/src/hooks/useColumnPersistence.js +63 -0
- package/dist/components/tt-table/src/hooks/useColumns.d.ts +505 -21
- package/dist/components/tt-table/src/hooks/useColumns.js +100 -245
- package/dist/components/tt-table/src/hooks/useGridProps.d.ts +36 -0
- package/dist/components/tt-table/src/hooks/useGridProps.js +121 -0
- package/dist/components/tt-table/src/hooks/useKeyboardNav.d.ts +11 -0
- package/dist/components/tt-table/src/hooks/useKeyboardNav.js +97 -0
- package/dist/components/tt-table/src/hooks/usePagination.d.ts +14 -8
- package/dist/components/tt-table/src/hooks/usePagination.js +29 -33
- package/dist/components/tt-table/src/hooks/useQuery.d.ts +41 -0
- package/dist/components/tt-table/src/hooks/useQuery.js +147 -0
- package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +22 -0
- package/dist/components/tt-table/src/hooks/useRowIdentity.js +96 -0
- package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +23 -7
- package/dist/components/tt-table/src/hooks/useRowSelection.js +95 -71
- package/dist/components/tt-table/src/hooks/{useLeftRightSlot.d.ts → useSideSlot.d.ts} +25 -17
- package/dist/components/tt-table/src/hooks/useSideSlot.js +77 -0
- package/dist/components/tt-table/src/hooks/useSyncProps.d.ts +12 -0
- package/dist/components/tt-table/src/hooks/useSyncProps.js +55 -0
- package/dist/components/tt-table/src/hooks/useTableData.d.ts +71 -0
- package/dist/components/tt-table/src/hooks/useTableData.js +307 -0
- package/dist/components/tt-table/src/hooks/useTableFooter.d.ts +15 -0
- package/dist/components/tt-table/src/hooks/useTableFooter.js +46 -0
- package/dist/components/tt-table/src/hooks/useTableForm.d.ts +10 -5
- package/dist/components/tt-table/src/hooks/useTableForm.js +55 -48
- package/dist/components/tt-table/src/hooks/useTableMethods.d.ts +165 -0
- package/dist/components/tt-table/src/hooks/useTableMethods.js +183 -0
- package/dist/components/tt-table/src/hooks/useTableRender.d.ts +24 -55
- package/dist/components/tt-table/src/props.d.ts +318 -151
- package/dist/components/tt-table/src/props.js +117 -270
- package/dist/components/tt-table/src/table-defaults.d.ts +25 -0
- package/dist/components/tt-table/src/table-defaults.js +71 -0
- package/dist/components/tt-table/src/table-mutation-events.d.ts +43 -0
- package/dist/components/tt-table/src/table-mutation-events.js +70 -0
- package/dist/components/tt-table/src/types/table.d.ts +207 -88
- package/dist/components/tt-table/src/types/tableAction.d.ts +23 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +15 -26
- package/dist/components/tt-table/src/utils/action-tab-index.d.ts +2 -0
- package/dist/components/tt-table/src/utils/action-tab-index.js +50 -0
- package/dist/components/tt-table/src/utils/context.js +25 -12
- package/dist/components/tt-table/src/utils/table-api.d.ts +136 -58
- package/dist/components/tt-table/src/utils/table-api.js +198 -165
- package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
- package/dist/components/tt-table/src/utils/table-form-api.js +41 -31
- package/dist/components/types.d.ts +0 -20
- package/dist/hooks/useSetup.js +0 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +105 -101
- package/dist/packages/hooks/src/useDebounce.js +6 -6
- package/dist/packages/utils/src/is.js +20 -18
- package/dist/packages/utils/src/tool.js +76 -149
- package/dist/style.css +1 -1
- package/dist/utils/uppercaseInput.d.ts +29 -0
- package/dist/utils/uppercaseInput.js +16 -0
- package/package.json +3 -3
- package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +0 -576
- package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +0 -4
- package/dist/components/tt-table/src/enum.d.ts +0 -2
- package/dist/components/tt-table/src/hooks/useCellArea.d.ts +0 -15
- package/dist/components/tt-table/src/hooks/useCellArea.js +0 -15
- package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +0 -20
- package/dist/components/tt-table/src/hooks/useCustomColumns.js +0 -65
- package/dist/components/tt-table/src/hooks/useDataSource.d.ts +0 -29
- package/dist/components/tt-table/src/hooks/useDataSource.js +0 -232
- package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +0 -64
- package/dist/components/tt-table/src/hooks/useTable.d.ts +0 -7
- package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +0 -101
- package/dist/components/tt-table/src/hooks/useTableEvent.js +0 -197
- package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +0 -10
- package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +0 -15
- package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +0 -11
- package/dist/components/tt-table/src/hooks/useTableSlot.js +0 -17
- package/dist/components/tt-table/src/utils/filters.d.ts +0 -109
- package/dist/components/tt-table/src/utils/vxeTable.d.ts +0 -28
- package/dist/packages/utils/src/check.js +0 -10
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { propTypes as o } from "../../../packages/hooks/src/propTypes.js";
|
|
1
2
|
import "axios";
|
|
2
3
|
import "element-plus";
|
|
3
|
-
import
|
|
4
|
+
import "dayjs";
|
|
4
5
|
import "vue";
|
|
5
6
|
import "xe-utils";
|
|
6
|
-
import "dayjs";
|
|
7
7
|
import "dayjs/plugin/utc";
|
|
8
8
|
import "dayjs/plugin/timezone";
|
|
9
9
|
import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
@@ -12,109 +12,71 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-u
|
|
|
12
12
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
13
13
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
14
14
|
import "lodash-es";
|
|
15
|
-
import { propTypes as t } from "../../../packages/hooks/src/propTypes.js";
|
|
16
15
|
import "vue-router";
|
|
17
|
-
import { GlobalConfig as
|
|
18
|
-
|
|
16
|
+
import { GlobalConfig as a } from "../../../hooks/useSetup.js";
|
|
17
|
+
import { createSharedTableDefaults as l } from "./table-defaults.js";
|
|
18
|
+
function e(t) {
|
|
19
|
+
return l()[t];
|
|
20
|
+
}
|
|
21
|
+
const r = {
|
|
19
22
|
/** 是否显示分页 */
|
|
20
|
-
showPager:
|
|
21
|
-
/** 数据总数 */
|
|
22
|
-
total: t.number.def(0),
|
|
23
|
+
showPager: { type: Boolean, default: () => e("showPager") },
|
|
23
24
|
/** 当前页数 field */
|
|
24
|
-
currentPageField: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: () => {
|
|
27
|
-
var e;
|
|
28
|
-
return (e = o.table) == null ? void 0 : e.currentPageField;
|
|
29
|
-
}
|
|
30
|
-
},
|
|
25
|
+
currentPageField: { type: String, default: () => e("currentPageField") },
|
|
31
26
|
/** 当前页的大小 field */
|
|
32
|
-
pageSizeField: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: () => {
|
|
35
|
-
var e;
|
|
36
|
-
return (e = o.table) == null ? void 0 : e.pageSizeField;
|
|
37
|
-
}
|
|
38
|
-
},
|
|
27
|
+
pageSizeField: { type: String, default: () => e("pageSizeField") },
|
|
39
28
|
/** 总数 field */
|
|
40
|
-
totalField: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: () => {
|
|
43
|
-
var e;
|
|
44
|
-
return (e = o.table) == null ? void 0 : e.totalField;
|
|
45
|
-
}
|
|
46
|
-
},
|
|
29
|
+
totalField: { type: String, default: () => e("totalField") },
|
|
47
30
|
/** 数据的 field */
|
|
48
|
-
dataField: {
|
|
49
|
-
|
|
50
|
-
default: () => {
|
|
51
|
-
var e;
|
|
52
|
-
return (e = o.table) == null ? void 0 : e.dataField;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}, i = {
|
|
31
|
+
dataField: { type: String, default: () => e("dataField") }
|
|
32
|
+
}, p = {
|
|
56
33
|
/** 是否显示复选框 */
|
|
57
|
-
showCheckbox:
|
|
34
|
+
showCheckbox: { type: Boolean, default: () => e("showCheckbox") },
|
|
35
|
+
/** 是否跨页保持复选框选中状态 */
|
|
36
|
+
reserveSelection: { type: Boolean, default: () => e("reserveSelection") },
|
|
58
37
|
/** 是否显示单选框 */
|
|
59
|
-
showRadio:
|
|
38
|
+
showRadio: { type: Boolean, default: () => e("showRadio") },
|
|
60
39
|
/** 是否显示展开列 */
|
|
61
|
-
showExpand:
|
|
40
|
+
showExpand: { type: Boolean, default: () => e("showExpand") },
|
|
62
41
|
/** 是否显示序号 */
|
|
63
|
-
showIndex:
|
|
42
|
+
showIndex: { type: Boolean, default: () => e("showIndex") },
|
|
64
43
|
/** 是否需要列拖拽 */
|
|
65
|
-
isCellResize:
|
|
66
|
-
/**
|
|
67
|
-
* 是否拖动列
|
|
68
|
-
* @deprecated 请使用 column-config drag 配合column-drag-config配置 支持的版本看官方文档,后续不在维护列拖拽
|
|
69
|
-
* @default true
|
|
70
|
-
*/
|
|
71
|
-
isColumnsDrag: t.bool.def(!1),
|
|
44
|
+
isCellResize: { type: Boolean, default: () => e("isCellResize") },
|
|
72
45
|
/** 是否列排序 */
|
|
73
|
-
isCellSort:
|
|
74
|
-
/**
|
|
75
|
-
* 是否checkbox区域选择 选中数据
|
|
76
|
-
* @deprecated
|
|
77
|
-
*/
|
|
78
|
-
isAreaCheckData: t.bool.def(!1),
|
|
46
|
+
isCellSort: { type: Boolean, default: () => e("isCellSort") },
|
|
79
47
|
/** 是否显示操作列 */
|
|
80
|
-
showAction:
|
|
48
|
+
showAction: { type: Boolean, default: () => e("showAction") },
|
|
81
49
|
/** 操作列宽度 */
|
|
82
|
-
actionWidth:
|
|
50
|
+
actionWidth: { type: Number, default: () => e("actionWidth") },
|
|
83
51
|
/** 操作列列名 */
|
|
84
|
-
actionTitle:
|
|
52
|
+
actionTitle: { type: String, default: () => e("actionTitle") },
|
|
85
53
|
/** 操作列Props */
|
|
86
54
|
actionProps: {
|
|
87
55
|
type: Object,
|
|
88
|
-
default: () => (
|
|
56
|
+
default: () => e("actionProps")
|
|
89
57
|
},
|
|
90
58
|
/** 序号列Props */
|
|
91
59
|
indexColumnProps: {
|
|
92
60
|
type: Object,
|
|
93
|
-
default: () => (
|
|
61
|
+
default: () => e("indexColumnProps")
|
|
94
62
|
},
|
|
95
63
|
/** 复选框列Props */
|
|
96
64
|
checkboxColumnProps: {
|
|
97
65
|
type: Object,
|
|
98
|
-
default: () => (
|
|
66
|
+
default: () => e("checkboxColumnProps")
|
|
99
67
|
},
|
|
100
68
|
/** 展开行props */
|
|
101
69
|
expandColumnProps: {
|
|
102
70
|
type: Object,
|
|
103
|
-
default: () => (
|
|
71
|
+
default: () => e("expandColumnProps")
|
|
104
72
|
},
|
|
105
73
|
/** 单选框列Props */
|
|
106
74
|
radioColumnProps: {
|
|
107
75
|
type: Object,
|
|
108
|
-
default: () => (
|
|
76
|
+
default: () => e("radioColumnProps")
|
|
109
77
|
},
|
|
110
78
|
/** 表格行id */
|
|
111
|
-
tableRowId: {
|
|
112
|
-
type: String,
|
|
113
|
-
default: () => {
|
|
114
|
-
var e;
|
|
115
|
-
return (e = o.table) == null ? void 0 : e.tableRowId;
|
|
116
|
-
}
|
|
117
|
-
},
|
|
79
|
+
tableRowId: { type: String, default: () => e("tableRowId") },
|
|
118
80
|
/** 自定义Column函数 */
|
|
119
81
|
customizeColumn: {
|
|
120
82
|
type: Function
|
|
@@ -127,20 +89,9 @@ const f = {
|
|
|
127
89
|
default: null
|
|
128
90
|
},
|
|
129
91
|
/** 表格额外参数 */
|
|
130
|
-
searchInfo: {
|
|
131
|
-
type: Object,
|
|
132
|
-
default: () => ({})
|
|
133
|
-
},
|
|
92
|
+
searchInfo: { type: Object, default: () => e("searchInfo") },
|
|
134
93
|
/** 是否初始化加载数据 */
|
|
135
|
-
immediate:
|
|
136
|
-
/**
|
|
137
|
-
* 请求的状态吗
|
|
138
|
-
* @deprecated
|
|
139
|
-
*/
|
|
140
|
-
resultCode: {
|
|
141
|
-
type: [String, Number],
|
|
142
|
-
default: 200
|
|
143
|
-
},
|
|
94
|
+
immediate: { type: Boolean, default: () => e("immediate") },
|
|
144
95
|
/** 请求后的回调 */
|
|
145
96
|
afterFetch: {
|
|
146
97
|
type: Function,
|
|
@@ -154,160 +105,85 @@ const f = {
|
|
|
154
105
|
/** data */
|
|
155
106
|
data: {
|
|
156
107
|
type: Array,
|
|
157
|
-
default: []
|
|
108
|
+
default: () => []
|
|
158
109
|
},
|
|
159
110
|
/** 是否滚动加载数据 */
|
|
160
|
-
isScrollFetch: {
|
|
161
|
-
|
|
162
|
-
default: !1
|
|
163
|
-
},
|
|
164
|
-
/** 滚动加载数据是否显示loading */
|
|
165
|
-
showScrollFetchLoading: {
|
|
166
|
-
type: Boolean,
|
|
167
|
-
default: !0
|
|
168
|
-
}
|
|
169
|
-
}, u = {
|
|
111
|
+
isScrollFetch: { type: Boolean, default: () => e("isScrollFetch") }
|
|
112
|
+
}, i = {
|
|
170
113
|
/** 是否显示toolbar */
|
|
171
|
-
showToolbar:
|
|
114
|
+
showToolbar: { type: Boolean, default: () => e("showToolbar") },
|
|
172
115
|
/** 具体某些列排序 field数组 */
|
|
173
|
-
columnsFieldSort:
|
|
116
|
+
columnsFieldSort: {
|
|
117
|
+
type: Array,
|
|
118
|
+
default: () => e("columnsFieldSort")
|
|
119
|
+
},
|
|
174
120
|
/** 具体某些列不排序 field数组 */
|
|
175
|
-
columnsFieldNoSort:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
type: Boolean,
|
|
179
|
-
default: () => {
|
|
180
|
-
var e;
|
|
181
|
-
return (e = o.table) == null ? void 0 : e.showRefresh;
|
|
182
|
-
}
|
|
121
|
+
columnsFieldNoSort: {
|
|
122
|
+
type: Array,
|
|
123
|
+
default: () => e("columnsFieldNoSort")
|
|
183
124
|
},
|
|
125
|
+
/** 是否显示右边刷新按钮 */
|
|
126
|
+
showRefresh: { type: Boolean, default: () => e("showRefresh") },
|
|
184
127
|
/** 是否显示右边设置 */
|
|
185
|
-
showSetting: {
|
|
186
|
-
type: Boolean,
|
|
187
|
-
default: () => {
|
|
188
|
-
var e;
|
|
189
|
-
return (e = o.table) == null ? void 0 : e.showSetting;
|
|
190
|
-
}
|
|
191
|
-
},
|
|
128
|
+
showSetting: { type: Boolean, default: () => e("showSetting") },
|
|
192
129
|
/** 是否显示自定义列 */
|
|
193
|
-
showSetColumn: {
|
|
194
|
-
type: Boolean,
|
|
195
|
-
default: () => {
|
|
196
|
-
var e;
|
|
197
|
-
return (e = o.table) == null ? void 0 : e.showSetColumn;
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
/** 是否显示自定义行距 */
|
|
201
|
-
showLineHeight: {
|
|
202
|
-
type: Boolean,
|
|
203
|
-
default: () => {
|
|
204
|
-
var e;
|
|
205
|
-
return (e = o.table) == null ? void 0 : e.showLineHeight;
|
|
206
|
-
}
|
|
207
|
-
},
|
|
130
|
+
showSetColumn: { type: Boolean, default: () => e("showSetColumn") },
|
|
208
131
|
/** 不可自定义列数组 field数组 */
|
|
209
|
-
notSetColumnField:
|
|
210
|
-
/** 需要对不显示的字段进行过滤 主要针对于自定义 field数组 */
|
|
211
|
-
filterNoVisibleField: t.array.def([]),
|
|
212
|
-
/** 是否显示表格上方 alert */
|
|
213
|
-
showTableAlert: t.bool.def(!1)
|
|
214
|
-
}, p = {
|
|
215
|
-
modelValue: {
|
|
132
|
+
notSetColumnField: {
|
|
216
133
|
type: Array,
|
|
217
|
-
default: () =>
|
|
134
|
+
default: () => e("notSetColumnField")
|
|
218
135
|
},
|
|
219
|
-
/**
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
showTitle: t.bool.def(!1),
|
|
223
|
-
/** 是否自适应高度 */
|
|
224
|
-
autoHeight: t.bool.def(!0),
|
|
136
|
+
/** 是否显示表格上方 alert */
|
|
137
|
+
showTableAlert: { type: Boolean, default: () => e("showTableAlert") }
|
|
138
|
+
}, T = {
|
|
225
139
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
140
|
+
* 是否自适应高度
|
|
141
|
+
*
|
|
142
|
+
* 组件方式默认 `true`,与 `table-api.ts` 的 `getDefaultState()` 里 hook 方式默认 `false` 有意不同,
|
|
143
|
+
* 不要统一:改任一边都会改变现有页面的表格高度。因此它不进 `createSharedTableDefaults()`。
|
|
228
144
|
*/
|
|
229
|
-
|
|
145
|
+
autoHeight: o.bool.def(!0),
|
|
230
146
|
/** 左侧插槽的宽度 */
|
|
231
|
-
leftSlotWidth:
|
|
147
|
+
leftSlotWidth: { type: Number, default: () => e("leftSlotWidth") },
|
|
232
148
|
/** 右侧插槽的宽度 */
|
|
233
|
-
rightSlotWidth:
|
|
234
|
-
/** loading text */
|
|
235
|
-
loadingText: {
|
|
236
|
-
type: String,
|
|
237
|
-
default: () => {
|
|
238
|
-
var e;
|
|
239
|
-
return (e = o.table) == null ? void 0 : e.loadingText;
|
|
240
|
-
}
|
|
241
|
-
},
|
|
149
|
+
rightSlotWidth: { type: Number, default: () => e("rightSlotWidth") },
|
|
242
150
|
/** 暂无数据的样式 */
|
|
243
|
-
emptyImageStyle:
|
|
151
|
+
emptyImageStyle: { type: Object, default: () => e("emptyImageStyle") },
|
|
244
152
|
/** 暂无数据 */
|
|
245
|
-
emptyText: {
|
|
246
|
-
type: String,
|
|
247
|
-
default: () => {
|
|
248
|
-
var e;
|
|
249
|
-
return (e = o.table) == null ? void 0 : e.emptyText;
|
|
250
|
-
}
|
|
251
|
-
},
|
|
153
|
+
emptyText: { type: String, default: () => e("emptyText") },
|
|
252
154
|
/**
|
|
253
155
|
* 空数据图片状态, 对于不传api的默认展示情况
|
|
254
156
|
* @default 'no-data'
|
|
255
157
|
*/
|
|
256
158
|
emptyImageStatus: {
|
|
257
159
|
type: String,
|
|
258
|
-
default: "
|
|
160
|
+
default: () => e("emptyImageStatus")
|
|
259
161
|
},
|
|
260
162
|
/** 未查询时文字 */
|
|
261
|
-
noSearchText: {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
/** 是否手动触发查询事件 */
|
|
269
|
-
isHanderSubmit: t.bool.def(!1),
|
|
270
|
-
/** 储存的key值,支持函数动态获取 */
|
|
163
|
+
noSearchText: { type: String, default: () => e("noSearchText") },
|
|
164
|
+
/**
|
|
165
|
+
* 储存的key值,支持函数动态获取
|
|
166
|
+
*
|
|
167
|
+
* 组件方式固定取 `""`,与 `table-api.ts` 的 hook 方式取 `GlobalConfig.table?.columnsKey` 有意不同,
|
|
168
|
+
* 不要统一:统一会改变组件方式下的列配置缓存 key,已存的服务端列配置会读不到。
|
|
169
|
+
*/
|
|
271
170
|
columnsKey: {
|
|
272
171
|
type: [String, Function],
|
|
273
172
|
default: ""
|
|
274
173
|
},
|
|
275
174
|
/** 是否开启服务端缓存 */
|
|
276
|
-
useHttpCache: {
|
|
277
|
-
type: Boolean,
|
|
278
|
-
default: () => {
|
|
279
|
-
var e;
|
|
280
|
-
return (e = o.table) == null ? void 0 : e.useHttpCache;
|
|
281
|
-
}
|
|
282
|
-
},
|
|
175
|
+
useHttpCache: { type: Boolean, default: () => e("useHttpCache") },
|
|
283
176
|
/** 开启服务端缓存时默认展示的列 用户列为null时默认展示的列 */
|
|
284
177
|
defaultDisplayFields: {
|
|
285
178
|
type: Array,
|
|
286
|
-
default: () =>
|
|
287
|
-
var e;
|
|
288
|
-
return (e = o.table) == null ? void 0 : e.defaultDisplayFields;
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
/**
|
|
292
|
-
* 是否需要行拖拽-树形表格
|
|
293
|
-
* @deprecated 请使用 row-config drag 配合row-drag-config配置 支持的版本看官方文档,后续不在维护行拖拽
|
|
294
|
-
* @default false
|
|
295
|
-
*/
|
|
296
|
-
treeNode: t.bool.def(!1),
|
|
297
|
-
/** 外部插槽 */
|
|
298
|
-
getSyncSlotComponent: {
|
|
299
|
-
type: Function
|
|
179
|
+
default: () => e("defaultDisplayFields")
|
|
300
180
|
},
|
|
301
181
|
/** 是否清空树形展开状态 */
|
|
302
|
-
clearTreeExpand:
|
|
303
|
-
/**
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
|
|
307
|
-
* 设置为 false 时,会有性能问题
|
|
308
|
-
* @default true
|
|
309
|
-
*/
|
|
310
|
-
isDataCloneDeep: t.bool.def(!0),
|
|
182
|
+
clearTreeExpand: { type: Boolean, default: () => e("clearTreeExpand") },
|
|
183
|
+
/** 表头标题是否显示 tooltip */
|
|
184
|
+
showHeaderTooltip: { type: Boolean, default: () => e("showHeaderTooltip") },
|
|
185
|
+
/** 单元格内容是否显示 tooltip */
|
|
186
|
+
showCellTooltip: { type: Boolean, default: () => e("showCellTooltip") },
|
|
311
187
|
/** 表格的api */
|
|
312
188
|
tableApi: {
|
|
313
189
|
type: Object
|
|
@@ -317,74 +193,53 @@ const f = {
|
|
|
317
193
|
type: Object
|
|
318
194
|
},
|
|
319
195
|
/** 是否使用搜索form */
|
|
320
|
-
useSearchForm:
|
|
321
|
-
/** 是否禁用Teleport将节点输送至body */
|
|
322
|
-
disabledTeleport: t.bool.def(!1),
|
|
196
|
+
useSearchForm: o.bool.def(!1),
|
|
323
197
|
/** 表格 testId,用于生成测试标识 */
|
|
324
198
|
testId: {
|
|
325
199
|
type: String,
|
|
326
200
|
default: void 0
|
|
327
201
|
},
|
|
328
|
-
...
|
|
329
|
-
...
|
|
202
|
+
...r,
|
|
203
|
+
...p,
|
|
330
204
|
...n,
|
|
331
|
-
...
|
|
332
|
-
},
|
|
205
|
+
...i
|
|
206
|
+
}, d = {
|
|
333
207
|
/** 按键配置项 */
|
|
334
208
|
keyboardConfig: {
|
|
335
209
|
type: Object,
|
|
336
|
-
default: () =>
|
|
337
|
-
var e;
|
|
338
|
-
return (e = o.table) == null ? void 0 : e.keyboardConfig;
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
/** 右键菜单配置项 */
|
|
342
|
-
menuConfig: {
|
|
343
|
-
type: Object,
|
|
344
|
-
default: () => ({})
|
|
210
|
+
default: () => e("keyboardConfig")
|
|
345
211
|
},
|
|
346
212
|
/** 鼠标配置项 */
|
|
347
213
|
mouseConfig: {
|
|
348
214
|
type: Object,
|
|
349
|
-
default: () =>
|
|
350
|
-
var e;
|
|
351
|
-
return (e = o.table) == null ? void 0 : e.mouseConfig;
|
|
352
|
-
}
|
|
215
|
+
default: () => e("mouseConfig")
|
|
353
216
|
},
|
|
354
217
|
/** 复选框配置项 */
|
|
355
218
|
checkboxConfig: {
|
|
356
219
|
type: Object,
|
|
357
|
-
default: () =>
|
|
358
|
-
var e;
|
|
359
|
-
return (e = o.table) == null ? void 0 : e.checkboxConfig;
|
|
360
|
-
}
|
|
220
|
+
default: () => e("checkboxConfig")
|
|
361
221
|
},
|
|
362
222
|
/** 单选框配置项 */
|
|
363
223
|
radioConfig: {
|
|
364
224
|
type: Object,
|
|
365
|
-
default: () =>
|
|
366
|
-
var e;
|
|
367
|
-
return (e = o.table) == null ? void 0 : e.radioConfig;
|
|
368
|
-
}
|
|
225
|
+
default: () => e("radioConfig")
|
|
369
226
|
}
|
|
370
|
-
},
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
},
|
|
381
|
-
/** table参数 */
|
|
227
|
+
}, j = {
|
|
228
|
+
/**
|
|
229
|
+
* table参数
|
|
230
|
+
*
|
|
231
|
+
* `default` 必须是工厂函数:Vue 的 object prop 直接给对象时所有 `TtTableForm` 实例共享同一个引用。
|
|
232
|
+
*
|
|
233
|
+
* 取值为共用默认值加上组件方式口径的三个字段。`autoHeight` / `columnsKey` / `useSearchForm` 都不在
|
|
234
|
+
* 共用默认值里(前两个两处取值不同,后一个只在组件方式出现),而 `TtTableForm` 属于组件方式调用点,
|
|
235
|
+
* 因此这里显式补上组件方式的字面量 —— 它们与改动前 `Object.entries(tableProps).reduce(...)` 的产物逐字段相等。
|
|
236
|
+
*/
|
|
382
237
|
table: {
|
|
383
238
|
type: Object,
|
|
384
|
-
default:
|
|
239
|
+
default: () => ({ ...l(), autoHeight: !0, columnsKey: "", useSearchForm: !1 })
|
|
385
240
|
},
|
|
386
241
|
/** 是否使用搜索form */
|
|
387
|
-
useSearchForm:
|
|
242
|
+
useSearchForm: o.bool.def(!0),
|
|
388
243
|
/** BasicFormProps 的配置 */
|
|
389
244
|
form: {
|
|
390
245
|
type: Object,
|
|
@@ -409,8 +264,8 @@ const f = {
|
|
|
409
264
|
tableRowId: {
|
|
410
265
|
type: String,
|
|
411
266
|
default: () => {
|
|
412
|
-
var
|
|
413
|
-
return (
|
|
267
|
+
var t;
|
|
268
|
+
return (t = a.table) == null ? void 0 : t.tableRowId;
|
|
414
269
|
}
|
|
415
270
|
},
|
|
416
271
|
/** 表格 testId,用于生成测试标识 */
|
|
@@ -422,7 +277,7 @@ const f = {
|
|
|
422
277
|
tableFormApi: {
|
|
423
278
|
type: Object
|
|
424
279
|
}
|
|
425
|
-
},
|
|
280
|
+
}, I = {
|
|
426
281
|
/** 列配置 */
|
|
427
282
|
columns: {
|
|
428
283
|
type: Array,
|
|
@@ -433,7 +288,7 @@ const f = {
|
|
|
433
288
|
*/
|
|
434
289
|
height: {
|
|
435
290
|
type: [Number, String],
|
|
436
|
-
default:
|
|
291
|
+
default: () => e("height")
|
|
437
292
|
},
|
|
438
293
|
/**
|
|
439
294
|
* 设置所有内容过长时显示为省略号(如果是固定列建议设置该值,提升渲染速度
|
|
@@ -441,7 +296,7 @@ const f = {
|
|
|
441
296
|
*/
|
|
442
297
|
showOverflow: {
|
|
443
298
|
type: [String, Boolean],
|
|
444
|
-
default:
|
|
299
|
+
default: () => e("showOverflow")
|
|
445
300
|
},
|
|
446
301
|
/**
|
|
447
302
|
* @description 内部使用插槽重写title内容。true 和 'tooltip' 都会有 tooltip 效果,false 和其他的值会显示省略号不会有 tooltip 效果
|
|
@@ -449,33 +304,26 @@ const f = {
|
|
|
449
304
|
*/
|
|
450
305
|
showHeaderOverflow: {
|
|
451
306
|
type: [String, Boolean],
|
|
452
|
-
default:
|
|
307
|
+
default: () => e("showHeaderOverflow")
|
|
453
308
|
},
|
|
454
309
|
/** 分页配置 */
|
|
455
310
|
pagerConfig: {
|
|
456
311
|
type: Object,
|
|
457
|
-
default: () =>
|
|
458
|
-
var e;
|
|
459
|
-
return (e = o.table) == null ? void 0 : e.pagerConfig;
|
|
460
|
-
}
|
|
312
|
+
default: () => e("pagerConfig")
|
|
461
313
|
},
|
|
462
|
-
/**
|
|
314
|
+
/**
|
|
315
|
+
* toolbar 配置
|
|
316
|
+
*
|
|
317
|
+
* 不写 `default`,取值由共用默认值里的 `toolbarConfig: undefined` 提供:
|
|
318
|
+
* `useGridProps` 用解构默认值 `toolbarConfig = {}` 兜底,而 ES 解构默认值只对 `undefined` 生效。
|
|
319
|
+
*/
|
|
463
320
|
toolbarConfig: {
|
|
464
|
-
type: Object
|
|
465
|
-
default: () => null
|
|
466
|
-
},
|
|
467
|
-
/** 缩放配置项 */
|
|
468
|
-
zoomConfig: {
|
|
469
|
-
type: Object,
|
|
470
|
-
default: () => null
|
|
321
|
+
type: Object
|
|
471
322
|
},
|
|
472
323
|
/** 表格大小 */
|
|
473
324
|
size: {
|
|
474
325
|
type: String,
|
|
475
|
-
default: () =>
|
|
476
|
-
var e;
|
|
477
|
-
return (e = o.table) == null ? void 0 : e.size;
|
|
478
|
-
}
|
|
326
|
+
default: () => e("size")
|
|
479
327
|
},
|
|
480
328
|
/**
|
|
481
329
|
* tooltip错误提示方向,用于控制错误信息提示的显示位置
|
|
@@ -486,11 +334,10 @@ const f = {
|
|
|
486
334
|
type: String,
|
|
487
335
|
default: "right"
|
|
488
336
|
},
|
|
489
|
-
...
|
|
337
|
+
...d
|
|
490
338
|
};
|
|
491
339
|
export {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
p as tableProps
|
|
340
|
+
j as tableFormProps,
|
|
341
|
+
I as tableOtherProps,
|
|
342
|
+
T as tableProps
|
|
496
343
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TtTableProps } from './types/table';
|
|
2
|
+
/**
|
|
3
|
+
* 创建组件方式(`props.ts` 的 `tableProps`)与 hook 方式(`table-api.ts` 的 `getDefaultState()`)
|
|
4
|
+
* 共用的表格默认配置,是这批默认值的唯一来源。
|
|
5
|
+
*
|
|
6
|
+
* 只收敛两处原本逐字重复的部分:18 个读 `GlobalConfig.table` 的字段,加上两处取值相同的静态默认。
|
|
7
|
+
* 只在一处出现的字段(`api` / `data` / `useSearchForm` / `testId` / `stripe` / `border` / 三个列配置接口等)
|
|
8
|
+
* 与两处取值不同的字段(`autoHeight` / `columnsKey`)都不在这里,仍由各调用点自己声明。
|
|
9
|
+
*
|
|
10
|
+
* `autoHeight` 为何不在其中:组件方式默认 `true`(表格铺满父容器),hook 方式默认 `false`。
|
|
11
|
+
* 这是有意保留的差异,改任一边都会改变现有页面的表格高度,属于调用方可见的布局回退。
|
|
12
|
+
* 两个调用点各写一行字面量并互相注释指向对方,不为它引入 `usage` 参数或枚举。
|
|
13
|
+
*
|
|
14
|
+
* `columnsKey` 为何不在其中:组件方式取 `""`,hook 方式取 `GlobalConfig.table?.columnsKey`。
|
|
15
|
+
* 统一会改变组件方式下的列配置缓存 key,已存的服务端列配置会读不到。
|
|
16
|
+
*
|
|
17
|
+
* 为何必须是工厂函数而不是模块级常量:
|
|
18
|
+
* 1. Vue 的 object prop 用 `default:` 直接给对象时所有实例共享同一个引用,一个实例改配置会影响另一个;
|
|
19
|
+
* 每次调用返回新的顶层对象才能隔离实例(`GlobalConfig` 上的嵌套对象仍是共享引用,与改动前一致)。
|
|
20
|
+
* 2. `GlobalConfig.table` 由 `useSetup` 的 `setup()` 在应用启动时写入,模块顶层求值会拿到初始化前的空配置。
|
|
21
|
+
* 未初始化时读到的字段全为 `undefined`,与改动前 `default: () => GlobalConfig.table?.x` 的时机一致。
|
|
22
|
+
*
|
|
23
|
+
* @returns 每次调用都是新对象,不与其他调用的返回值共享引用;不含 `autoHeight` 键
|
|
24
|
+
*/
|
|
25
|
+
export declare function createSharedTableDefaults(): TtTableProps;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { GlobalConfig as e } from "../../../hooks/useSetup.js";
|
|
2
|
+
function S() {
|
|
3
|
+
var o, l, t, a, i, s, r, n, d, f, h, b, c, u, g, p, C, m;
|
|
4
|
+
return {
|
|
5
|
+
showPager: !0,
|
|
6
|
+
showCheckbox: !1,
|
|
7
|
+
/** 跨页选中默认关闭,与改动前「翻页后只剩当前页选中」的行为一致。 */
|
|
8
|
+
reserveSelection: !1,
|
|
9
|
+
showExpand: !1,
|
|
10
|
+
showRadio: !1,
|
|
11
|
+
showIndex: !1,
|
|
12
|
+
isCellResize: !1,
|
|
13
|
+
isCellSort: !1,
|
|
14
|
+
showAction: !1,
|
|
15
|
+
actionWidth: 0,
|
|
16
|
+
actionTitle: "",
|
|
17
|
+
actionProps: {},
|
|
18
|
+
indexColumnProps: {},
|
|
19
|
+
checkboxColumnProps: {},
|
|
20
|
+
expandColumnProps: {},
|
|
21
|
+
radioColumnProps: {},
|
|
22
|
+
searchInfo: {},
|
|
23
|
+
immediate: !0,
|
|
24
|
+
showToolbar: !1,
|
|
25
|
+
columnsFieldSort: [],
|
|
26
|
+
columnsFieldNoSort: [],
|
|
27
|
+
notSetColumnField: [],
|
|
28
|
+
showTableAlert: !1,
|
|
29
|
+
leftSlotWidth: 0,
|
|
30
|
+
rightSlotWidth: 0,
|
|
31
|
+
emptyImageStyle: {},
|
|
32
|
+
emptyImageStatus: "no-data",
|
|
33
|
+
clearTreeExpand: !0,
|
|
34
|
+
showOverflow: !0,
|
|
35
|
+
showHeaderOverflow: !0,
|
|
36
|
+
/** 表头 tooltip 默认关闭,与改动前「表头从不出 tooltip」的现状一致。 */
|
|
37
|
+
showHeaderTooltip: !1,
|
|
38
|
+
/** 单元格 tooltip 默认关闭,关闭时 `showOverflow` 沿用原有取值,与改动前一致。 */
|
|
39
|
+
showCellTooltip: !1,
|
|
40
|
+
height: void 0,
|
|
41
|
+
formApi: void 0,
|
|
42
|
+
isScrollFetch: !1,
|
|
43
|
+
/**
|
|
44
|
+
* 必须是 `undefined` 而不是 `null`:`useGridProps` 用 ES 解构默认值 `toolbarConfig = {}` 兜底,
|
|
45
|
+
* 而解构默认值只对 `undefined` 生效。对 vxe 而言两者等价(`Object.assign` 忽略两者,
|
|
46
|
+
* 三处启用判定都是 `props.toolbarConfig && isEnableConf(...)`,两者同为 falsy)。
|
|
47
|
+
*/
|
|
48
|
+
toolbarConfig: void 0,
|
|
49
|
+
useHttpCache: (o = e.table) == null ? void 0 : o.useHttpCache,
|
|
50
|
+
defaultDisplayFields: (l = e.table) == null ? void 0 : l.defaultDisplayFields,
|
|
51
|
+
emptyText: (t = e.table) == null ? void 0 : t.emptyText,
|
|
52
|
+
noSearchText: (a = e.table) == null ? void 0 : a.noSearchText,
|
|
53
|
+
showSetColumn: (i = e.table) == null ? void 0 : i.showSetColumn,
|
|
54
|
+
showSetting: (s = e.table) == null ? void 0 : s.showSetting,
|
|
55
|
+
showRefresh: (r = e.table) == null ? void 0 : r.showRefresh,
|
|
56
|
+
tableRowId: (n = e.table) == null ? void 0 : n.tableRowId,
|
|
57
|
+
currentPageField: (d = e.table) == null ? void 0 : d.currentPageField,
|
|
58
|
+
pageSizeField: (f = e.table) == null ? void 0 : f.pageSizeField,
|
|
59
|
+
totalField: (h = e.table) == null ? void 0 : h.totalField,
|
|
60
|
+
dataField: (b = e.table) == null ? void 0 : b.dataField,
|
|
61
|
+
pagerConfig: (c = e.table) == null ? void 0 : c.pagerConfig,
|
|
62
|
+
size: (u = e.table) == null ? void 0 : u.size,
|
|
63
|
+
keyboardConfig: (g = e.table) == null ? void 0 : g.keyboardConfig,
|
|
64
|
+
mouseConfig: (p = e.table) == null ? void 0 : p.mouseConfig,
|
|
65
|
+
checkboxConfig: (C = e.table) == null ? void 0 : C.checkboxConfig,
|
|
66
|
+
radioConfig: (m = e.table) == null ? void 0 : m.radioConfig
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
S as createSharedTableDefaults
|
|
71
|
+
};
|