@dazhicheng/ui 1.5.30 → 1.5.32

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.
Files changed (174) hide show
  1. package/dist/{index-NG5FNCLD.js → index-CMjNBMj5.js} +3 -2
  2. package/dist/index.js +384 -342
  3. package/dist/{index.modern-DfItAsVf.js → index.modern-BfZxYaPy.js} +1 -1
  4. package/dist/plugins.js +30 -29
  5. package/package.json +1 -1
  6. package/dist/components/tt-area/TtArea.vue.d.ts +0 -2
  7. package/dist/components/tt-area/index.d.ts +0 -1
  8. package/dist/components/tt-button/components/AddButton.vue.d.ts +0 -2
  9. package/dist/components/tt-button/index.d.ts +0 -1740
  10. package/dist/components/tt-button/index.vue.d.ts +0 -1004
  11. package/dist/components/tt-checkbox/index.d.ts +0 -36
  12. package/dist/components/tt-checkbox/index.vue.d.ts +0 -28
  13. package/dist/components/tt-checkbox/type.d.ts +0 -9
  14. package/dist/components/tt-drawer/index.d.ts +0 -3703
  15. package/dist/components/tt-drawer/src/RenderDrawer.vue.d.ts +0 -2121
  16. package/dist/components/tt-drawer/src/components/DrawerFooter.vue.d.ts +0 -94
  17. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.d.ts +0 -27
  18. package/dist/components/tt-drawer/src/hooks/useDrawerRender.d.ts +0 -10
  19. package/dist/components/tt-drawer/src/hooks/useResizable.d.ts +0 -9
  20. package/dist/components/tt-drawer/src/index.d.ts +0 -10
  21. package/dist/components/tt-drawer/src/props.d.ts +0 -99
  22. package/dist/components/tt-drawer/src/typing.d.ts +0 -154
  23. package/dist/components/tt-drawer/src/utils/drawer-api.d.ts +0 -87
  24. package/dist/components/tt-empty/index.d.ts +0 -18
  25. package/dist/components/tt-form/index.d.ts +0 -13
  26. package/dist/components/tt-form/src/components/ExpandableArrow.vue.d.ts +0 -33
  27. package/dist/components/tt-form/src/components/FormActions.vue.d.ts +0 -34
  28. package/dist/components/tt-form/src/components/Slot.d.ts +0 -7
  29. package/dist/components/tt-form/src/config.d.ts +0 -6
  30. package/dist/components/tt-form/src/form/FormControl.vue.d.ts +0 -19
  31. package/dist/components/tt-form/src/form/FormDescription.vue.d.ts +0 -23
  32. package/dist/components/tt-form/src/form/FormItem.vue.d.ts +0 -23
  33. package/dist/components/tt-form/src/form/FormLabel.vue.d.ts +0 -23
  34. package/dist/components/tt-form/src/form/FormMessage.vue.d.ts +0 -2
  35. package/dist/components/tt-form/src/form/FormMessageToolTip.vue.d.ts +0 -8
  36. package/dist/components/tt-form/src/form/FormWarnMessage.vue.d.ts +0 -25
  37. package/dist/components/tt-form/src/form/RenderContent.vue.d.ts +0 -23
  38. package/dist/components/tt-form/src/form/index.d.ts +0 -10
  39. package/dist/components/tt-form/src/form/injectionKeys.d.ts +0 -2
  40. package/dist/components/tt-form/src/form/useFormField.d.ts +0 -11
  41. package/dist/components/tt-form/src/form-render/FormField.vue.d.ts +0 -28
  42. package/dist/components/tt-form/src/form-render/FormLabel.vue.d.ts +0 -27
  43. package/dist/components/tt-form/src/form-render/context.d.ts +0 -7
  44. package/dist/components/tt-form/src/form-render/dependencies.d.ts +0 -361
  45. package/dist/components/tt-form/src/form-render/expandable.d.ts +0 -9
  46. package/dist/components/tt-form/src/form-render/form.vue.d.ts +0 -38
  47. package/dist/components/tt-form/src/form-render/helper.d.ts +0 -11
  48. package/dist/components/tt-form/src/form-render/index.d.ts +0 -3
  49. package/dist/components/tt-form/src/formApi.d.ts +0 -71
  50. package/dist/components/tt-form/src/hooks/useEmitAsProps.d.ts +0 -7
  51. package/dist/components/tt-form/src/hooks/useFormFieldBus.d.ts +0 -14
  52. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.d.ts +0 -14
  53. package/dist/components/tt-form/src/hooks/useForwardProps.d.ts +0 -7
  54. package/dist/components/tt-form/src/hooks/useForwardPropsEmits.d.ts +0 -8
  55. package/dist/components/tt-form/src/index.vue.d.ts +0 -27
  56. package/dist/components/tt-form/src/shared/createContext.d.ts +0 -8
  57. package/dist/components/tt-form/src/shared/global-state.d.ts +0 -17
  58. package/dist/components/tt-form/src/shared/store.d.ts +0 -1
  59. package/dist/components/tt-form/src/shared/zod-defaults.d.ts +0 -54
  60. package/dist/components/tt-form/src/types/common.d.ts +0 -11
  61. package/dist/components/tt-form/src/types/forms.d.ts +0 -280
  62. package/dist/components/tt-form/src/types/index.d.ts +0 -3
  63. package/dist/components/tt-form/src/types/paths.d.ts +0 -142
  64. package/dist/components/tt-form/src/types/shared.d.ts +0 -19
  65. package/dist/components/tt-form/src/types.d.ts +0 -385
  66. package/dist/components/tt-form/src/useForm.d.ts +0 -2
  67. package/dist/components/tt-form/src/useFormContext.d.ts +0 -12
  68. package/dist/components/tt-form-item-error-tooltip/index.d.ts +0 -1549
  69. package/dist/components/tt-form-item-error-tooltip/index.vue.d.ts +0 -784
  70. package/dist/components/tt-icon/index.d.ts +0 -76
  71. package/dist/components/tt-icon/index.vue.d.ts +0 -32
  72. package/dist/components/tt-image/index.d.ts +0 -127
  73. package/dist/components/tt-image/src/components/ImageViewer.d.ts +0 -89
  74. package/dist/components/tt-image/tt-image.d.ts +0 -126
  75. package/dist/components/tt-loading/index.d.ts +0 -16
  76. package/dist/components/tt-loading/src/directive.d.ts +0 -9
  77. package/dist/components/tt-loading/src/loading.vue.d.ts +0 -12
  78. package/dist/components/tt-loading/src/service.d.ts +0 -25
  79. package/dist/components/tt-loading/src/type.d.ts +0 -20
  80. package/dist/components/tt-modal/index.d.ts +0 -1809
  81. package/dist/components/tt-modal/src/RenderModal.vue.d.ts +0 -1008
  82. package/dist/components/tt-modal/src/components/ModalFooter.vue.d.ts +0 -210
  83. package/dist/components/tt-modal/src/components/ModalHeader.vue.d.ts +0 -31
  84. package/dist/components/tt-modal/src/components/ModalWrapper.vue.d.ts +0 -224
  85. package/dist/components/tt-modal/src/hooks/useModalRender.d.ts +0 -110
  86. package/dist/components/tt-modal/src/index.d.ts +0 -5
  87. package/dist/components/tt-modal/src/props.d.ts +0 -161
  88. package/dist/components/tt-modal/src/typing.d.ts +0 -188
  89. package/dist/components/tt-modal/src/utils/modal-api.d.ts +0 -97
  90. package/dist/components/tt-modal-form/hooks/useModalFormSlot.d.ts +0 -6
  91. package/dist/components/tt-modal-form/index.d.ts +0 -2
  92. package/dist/components/tt-modal-form/index.vue.d.ts +0 -43
  93. package/dist/components/tt-modal-form/props.d.ts +0 -38
  94. package/dist/components/tt-modal-form/useModalForm.d.ts +0 -6
  95. package/dist/components/tt-select/index.d.ts +0 -7
  96. package/dist/components/tt-select/src/Select.vue.d.ts +0 -861
  97. package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +0 -111
  98. package/dist/components/tt-select/src/components/Table.vue.d.ts +0 -250
  99. package/dist/components/tt-select/src/const.d.ts +0 -16
  100. package/dist/components/tt-select/src/hooks/useDataSource.d.ts +0 -115
  101. package/dist/components/tt-select/src/hooks/useGrid.d.ts +0 -32
  102. package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +0 -59
  103. package/dist/components/tt-select/src/hooks/usePagination.d.ts +0 -16
  104. package/dist/components/tt-select/src/hooks/useSelect.d.ts +0 -87
  105. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +0 -178
  106. package/dist/components/tt-select/src/props.d.ts +0 -190
  107. package/dist/components/tt-select/src/types/index.d.ts +0 -142
  108. package/dist/components/tt-select/src/utils/index.d.ts +0 -9
  109. package/dist/components/tt-table/index.d.ts +0 -127
  110. package/dist/components/tt-table/src/Table.vue.d.ts +0 -1685
  111. package/dist/components/tt-table/src/componentMap.d.ts +0 -8
  112. package/dist/components/tt-table/src/components/RowContext.d.ts +0 -24
  113. package/dist/components/tt-table/src/components/TableAction.vue.d.ts +0 -79
  114. package/dist/components/tt-table/src/components/TableButtons.d.ts +0 -30
  115. package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts +0 -26
  116. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +0 -1531
  117. package/dist/components/tt-table/src/emits.d.ts +0 -1
  118. package/dist/components/tt-table/src/enum.d.ts +0 -2
  119. package/dist/components/tt-table/src/hooks/useCellArea.d.ts +0 -15
  120. package/dist/components/tt-table/src/hooks/useColumns.d.ts +0 -27
  121. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +0 -20
  122. package/dist/components/tt-table/src/hooks/useDataSource.d.ts +0 -29
  123. package/dist/components/tt-table/src/hooks/useLeftRightSlot.d.ts +0 -1082
  124. package/dist/components/tt-table/src/hooks/usePagination.d.ts +0 -102
  125. package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +0 -30
  126. package/dist/components/tt-table/src/hooks/useTable.d.ts +0 -7
  127. package/dist/components/tt-table/src/hooks/useTableContext.d.ts +0 -43
  128. package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +0 -101
  129. package/dist/components/tt-table/src/hooks/useTableForm.d.ts +0 -15
  130. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +0 -10
  131. package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +0 -15
  132. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +0 -93
  133. package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +0 -11
  134. package/dist/components/tt-table/src/props.d.ts +0 -433
  135. package/dist/components/tt-table/src/toolProps.d.ts +0 -19
  136. package/dist/components/tt-table/src/types/table.d.ts +0 -489
  137. package/dist/components/tt-table/src/types/tableAction.d.ts +0 -26
  138. package/dist/components/tt-table/src/types/tableForm.d.ts +0 -64
  139. package/dist/components/tt-table/src/types/tableTools.d.ts +0 -10
  140. package/dist/components/tt-table/src/utils/context.d.ts +0 -18
  141. package/dist/components/tt-table/src/utils/filters.d.ts +0 -109
  142. package/dist/components/tt-table/src/utils/table-api.d.ts +0 -250
  143. package/dist/components/tt-table/src/utils/table-form-api.d.ts +0 -88
  144. package/dist/components/tt-table/src/utils/vxeTable.d.ts +0 -28
  145. package/dist/components/tt-text/index.d.ts +0 -76
  146. package/dist/components/tt-text/index.vue.d.ts +0 -50
  147. package/dist/components/tt-tree-select/index.d.ts +0 -5
  148. package/dist/components/tt-tree-select/src/TtTreeSelect.vue.d.ts +0 -6
  149. package/dist/components/tt-tree-select/src/cache-options.d.ts +0 -35
  150. package/dist/components/tt-tree-select/src/select.d.ts +0 -10
  151. package/dist/components/tt-tree-select/src/tree.d.ts +0 -23
  152. package/dist/components/tt-tree-select/src/utils.d.ts +0 -10
  153. package/dist/components/tt-upload/index.d.ts +0 -428
  154. package/dist/components/tt-upload/src/TtUpload.d.ts +0 -449
  155. package/dist/components/tt-upload/src/typing.d.ts +0 -251
  156. package/dist/components/types.d.ts +0 -230
  157. package/dist/directives/auto-tip/index.d.ts +0 -3
  158. package/dist/directives/dialog-resize/index.d.ts +0 -25
  159. package/dist/directives/dialog-resize/use-css-variable.d.ts +0 -1
  160. package/dist/directives/dialog-resize/use-draggable.d.ts +0 -4
  161. package/dist/directives/dialog-resize/use-fullscreen.d.ts +0 -1
  162. package/dist/directives/dialog-resize/use-parse-translate.d.ts +0 -4
  163. package/dist/directives/dialog-resize/use-resizer.d.ts +0 -2
  164. package/dist/directives/disabled-tip/index.d.ts +0 -17
  165. package/dist/directives/index.d.ts +0 -3
  166. package/dist/hooks/useFormat.d.ts +0 -73
  167. package/dist/hooks/useLoading.d.ts +0 -9
  168. package/dist/hooks/useSetup.d.ts +0 -8
  169. package/dist/hooks/useTable.d.ts +0 -5
  170. package/dist/hooks/useTemplateSlot.d.ts +0 -9
  171. package/dist/index.d.ts +0 -46
  172. package/dist/plugins/index.d.ts +0 -1
  173. package/dist/plugins/vxeTable/switchStatus.d.ts +0 -7
  174. package/dist/plugins.d.ts +0 -2
@@ -1,489 +0,0 @@
1
- import { ComputedRef, CSSProperties, MaybeRef, Ref, VNode } from 'vue';
2
- import { VxeGridMethods, VxeGridProps, VxeGridPropTypes, VxeTableDefines, VxeTablePropTypes } from 'vxe-table';
3
- import { TableApi } from '../utils/table-api';
4
- import { TtExtendedFormApi } from '../../../tt-form';
5
- export type TtTablePagerProps = {
6
- /** 是否显示分页 */
7
- showPager?: boolean;
8
- /** 数据总数 */
9
- total?: number;
10
- /** 当前页数 field */
11
- currentPageField?: string;
12
- /** 当前页的大小 field */
13
- pageSizeField?: string;
14
- /** 总数 field */
15
- totalField?: string;
16
- /** 数据的 field */
17
- dataField?: string;
18
- };
19
- export type TtTableColumnsProps = {
20
- /** 是否显示复选框 */
21
- showCheckbox?: boolean;
22
- /** 是否显示单选框 */
23
- showRadio?: boolean;
24
- /** 是否显示序号 */
25
- showIndex?: boolean;
26
- /** 是否显示操作列 */
27
- showAction?: boolean;
28
- /** 是否显示导出按钮 */
29
- showExport?: boolean;
30
- /** 是否显示导入按钮 */
31
- showImport?: boolean;
32
- /** 操作列宽度 */
33
- actionWidth?: number;
34
- /** 操作列列名 */
35
- actionTitle?: string;
36
- /** 是否需要列宽拖拽 */
37
- isCellResize?: boolean;
38
- /**
39
- * 是否拖动列
40
- * @deprecated 请使用 column-config drag 配合column-drag-config配置 支持的版本看官方文档,后续不在维护列拖拽 如需用官方的设置为false
41
- * @default true
42
- */
43
- isColumnsDrag?: boolean;
44
- /** 是否列排序 */
45
- isCellSort?: boolean;
46
- /**
47
- * 是否checkbox区域选择 选中数据
48
- * @deprecated
49
- */
50
- isAreaCheckData?: boolean;
51
- /** 操作列Props */
52
- actionProps?: VxeTableDefines.ColumnOptions;
53
- /** 序号列Props */
54
- indexColumnProps?: VxeTableDefines.ColumnOptions;
55
- /** 复选框列Props */
56
- checkboxColumnProps?: VxeTableDefines.ColumnOptions;
57
- /** 拖拽 */
58
- rowDragColumnProps?: VxeTableDefines.ColumnOptions;
59
- /** 单选框列Props */
60
- radioColumnProps?: VxeTableDefines.ColumnOptions;
61
- /** 表格行id */
62
- tableRowId?: string;
63
- /**
64
- * 是否需要行拖拽
65
- * @deprecated 请使用 row-config drag 配合row-drag-config配置 支持的版本看官方文档,后续不在维护行拖拽
66
- * @default false
67
- */
68
- isRowDrag?: boolean;
69
- /**
70
- * 是否需要行拖拽-树形表格
71
- * @deprecated 请使用 row-config drag 配合row-drag-config配置 支持的版本看官方文档,后续不在维护行拖拽
72
- * @default false
73
- */
74
- treeNode?: boolean;
75
- };
76
- export type TtTableFetchProps = {
77
- /** api请求方法 */
78
- api?: (...arg: any[]) => Promise<Recordable>;
79
- /** filter api请求方法 */
80
- filterApi?: (...arg: any[]) => Promise<Recordable>;
81
- /** filter option api请求方法 */
82
- filterOptionApi?: (...arg: any[]) => Promise<Recordable>;
83
- /** 表格额外参数 */
84
- searchInfo?: Recordable;
85
- /** 是否初始化加载数据 */
86
- immediate?: boolean;
87
- /** 请求的状态码 @deprecated */
88
- resultCode?: string | number;
89
- /**
90
- * 请求后的回调
91
- * @param data 表格数据
92
- * @param res 原始结果数据
93
- */
94
- afterFetch?: (data: VxeTablePropTypes.Row[], res: Recordable) => Promise<VxeTablePropTypes.Row[]>;
95
- /**
96
- * 请求前的回调
97
- * @param params 请求参数
98
- */
99
- beforeFetch?: (params: Recordable) => Promise<Recordable>;
100
- /** 是否滚动加载 */
101
- isScrollFetch?: boolean;
102
- /**
103
- * 滚动加载是否加载动画
104
- * @default true
105
- */
106
- showScrollFetchLoading?: boolean;
107
- };
108
- export type TtTableToolbarProps = {
109
- /** 是否显示toolbar */
110
- showToolbar?: boolean;
111
- /** 具体某些列排序 field数组 */
112
- columnsFieldSort?: string[];
113
- /** 具体某些列不排序 field数组 */
114
- columnsFieldNoSort?: string[];
115
- /** 不可自定义列数组 field数组 */
116
- notSetColumnField?: string[];
117
- /** 需要对不显示的字段进行过滤 主要针对于自定义 field数组 */
118
- filterNoVisibleField?: string[];
119
- /** 是否显示表格上方 alert */
120
- showTableAlert?: boolean;
121
- };
122
- type UseTableProps = TtTablePagerProps & TtTableColumnsProps & TtTableFetchProps & TtTableToolbarProps;
123
- export type TtTableProps = {
124
- /** 标题内容 */
125
- title?: string;
126
- /** 是否显示标题 */
127
- showTitle?: boolean;
128
- /** 是否自适应高度 */
129
- autoHeight?: boolean;
130
- /**
131
- * 额外减去的高度
132
- * @deprecated
133
- */
134
- offsetHeight?: number;
135
- loading?: boolean;
136
- /** loading text */
137
- loadingText?: string;
138
- /** 空数据的提示文字 */
139
- emptyText?: string;
140
- /** 未查询时文字 */
141
- noSearchText?: string;
142
- /** 暂无数据的样式 */
143
- emptyImageStyle?: CSSProperties;
144
- /**
145
- * 空数据图片状态, 对于不传api的默认展示情况
146
- * @default 'no-data'
147
- */
148
- emptyImageStatus?: "no-data" | "no-search";
149
- /** 是否手动触发查询事件 */
150
- isHanderSubmit?: boolean;
151
- modelValue?: Array<Recordable>;
152
- /** form-methods */
153
- formApi?: Partial<TtExtendedFormApi>;
154
- /** 储存的列key值,支持函数动态获取 */
155
- columnsKey?: string | (() => string);
156
- /**
157
- * 是否显示设置按钮icon
158
- * @default true
159
- */
160
- showSetting?: boolean;
161
- /**
162
- * 是否显示设置列配置icon
163
- * @default true
164
- */
165
- showSetColumn?: boolean;
166
- /** 左侧插槽的宽度 */
167
- leftSlotWidth?: number;
168
- /** 右侧插槽的宽度 */
169
- rightSlotWidth?: number;
170
- /**
171
- * 是否显示行高设置icon
172
- * @default true
173
- */
174
- showLineHeight?: boolean;
175
- /**
176
- * 是否显示刷新icon
177
- * @default true
178
- */
179
- showRefresh?: boolean;
180
- /** 是否使用服务器保存用户配置 */
181
- useHttpCache?: boolean;
182
- /** 开启服务端缓存时默认展示的列 用户列为null时默认展示的列 */
183
- defaultDisplayFields?: string[];
184
- /** 自定义列服务端配置接口 - 获取 */
185
- getColumnsApi?: (params: {
186
- permissionOnlyCode: string;
187
- userId: string | number;
188
- }) => Promise<{
189
- data: any;
190
- }>;
191
- /** 自定义列服务端配置接口 - 当没有id值得时候 */
192
- setColumnsApi?: (params: {
193
- permissionOnlyCode: string;
194
- json: string;
195
- userId: string | number;
196
- }) => Promise<any>;
197
- /** 自定义列服务端配置接口 - 当有id值得时候 */
198
- updateColumnsApi?: (params: {
199
- permissionOnlyCode: string;
200
- json: string;
201
- userId: string | number;
202
- id: string | number;
203
- }) => Promise<any>;
204
- /** 外部插槽 */
205
- getSyncSlotComponent?: (column: any, row: any, type: "default" | "edit") => VNode | VNode[] | string;
206
- /** 自定义Column */
207
- customizeColumn?: (column: VxeTableDefines.ColumnOptions) => VxeTableDefines.ColumnOptions;
208
- /** 是否清空树形展开的状态 */
209
- clearTreeExpand?: boolean;
210
- /** 是否进行国际化 */
211
- isI18n?: boolean;
212
- /**
213
- * 外部数据是否拷贝一份
214
- * 设置为 false 时,会有性能问题
215
- * @default true
216
- */
217
- isDataCloneDeep?: boolean;
218
- /** 是否使用搜索表单 */
219
- useSearchForm?: boolean;
220
- /** 数据源 */
221
- data?: MaybeRef<any[]>;
222
- /** */
223
- columns?: MaybeRef<VxeTableDefines.ColumnOptions[]>;
224
- /**
225
- * 表格 testId,用于生成测试标识
226
- * 如果不指定,将从 api 路径自动提取
227
- * @example
228
- * testId="user" → data-testid="user-table"
229
- * api="/api/user-management/list" → data-testid="user-management-table"
230
- */
231
- testId?: string;
232
- /**
233
- * tooltip错误提示方向,用于控制错误信息提示的显示位置
234
- * 可选值: 'top', 'bottom', 'left', 'right'
235
- * @default 'right'
236
- */
237
- toolTipErrorPlacement?: "top" | "bottom" | "left" | "right";
238
- } & Omit<VxeGridProps, "data" | "columns"> & UseTableProps;
239
- export type VxeTableMethods<DT> = {
240
- /**
241
- * 往表格插入临时数据,从第一行新增一行或多行新数据
242
- * @param records 新数据
243
- */
244
- insert: (records: any) => Promise<{
245
- row: DT;
246
- rows: DT[];
247
- }>;
248
- /**
249
- * 往表格指定行中插入临时数据
250
- * 如果 row 为空则从插入到顶部,如果为树结构,则插入到目标节点顶部
251
- * 如果 row 为 -1 则从插入到底部,如果为树结构,则插入到目标节点底部
252
- * 如果 row 为有效行则插入到该行的位置,如果为树结构,则有插入到效的目标节点该行的位置
253
- * @param {Object/Array} records 新的数据
254
- * @param {Row} row 指定行
255
- */
256
- insertAt: (records: any, row: any | -1 | null) => Promise<{
257
- row: DT;
258
- rows: DT[];
259
- }>;
260
- /**
261
- * 删除指定行数据,指定 row 或 [row, ...] 删除多条数据,如果为空则删除所有数据
262
- * @param rows 指定行
263
- */
264
- remove: (rows?: any | any[]) => Promise<{
265
- row: DT;
266
- rows: DT[];
267
- }>;
268
- /**
269
- * 删除复选框选中的行数据
270
- */
271
- removeCheckboxRow: () => Promise<{
272
- row: DT;
273
- rows: DT[];
274
- }>;
275
- /**
276
- * 删除单选框选中的行数据
277
- */
278
- removeRadioRow: () => Promise<{
279
- row: DT;
280
- rows: DT[];
281
- }>;
282
- /**
283
- * 删除当前行选中的行数据
284
- */
285
- removeCurrentRow: () => Promise<{
286
- row: DT;
287
- rows: DT[];
288
- }>;
289
- /**
290
- * 清除编辑状态并重置数据
291
- */
292
- clearEditRevertData: (records: DT) => void;
293
- /**
294
- * 指定行激活编辑
295
- */
296
- setEditRow: (row: DT, fieldOrColumn?: boolean | string | VxeTableDefines.ColumnInfo) => void;
297
- /**
298
- * 指定单元格激活编辑
299
- */
300
- setEditCell: (row: DT, fieldOrColumn: string | VxeTableDefines.ColumnInfo) => void;
301
- /**
302
- * 加载数据
303
- * @param data 数据
304
- */
305
- loadData: (data: any[]) => Promise<any>;
306
- /**
307
- * 加载数据并恢复到初始状态
308
- * @param data 数据
309
- */
310
- reloadData: (data: any[]) => Promise<void>;
311
- /**
312
- * 重新加载列
313
- * @param columns 列对象
314
- */
315
- reloadColumn: (columns: (VxeTableDefines.ColumnOptions<any> | VxeTableDefines.ColumnInfo<any>)[]) => Promise<void>;
316
- /**
317
- * 局部加载行数据并恢复到初始状态
318
- * @param rows 行对象
319
- * @param record 新数据
320
- * @param field 指定字段名
321
- */
322
- reloadRow: (rows: any | any[], record?: any, field?: string) => Promise<void>;
323
- /**
324
- * 手动清空单元格内容,如果不传参数,则清空整个表格内容,如果传了行则清空指定行内容,如果传了指定字段,则清空该字段内容
325
- * @param rows 指定行
326
- * @param field 字段名
327
- */
328
- clearData: (rows?: any | any[], field?: string) => Promise<any>;
329
- /**
330
- * 重新懒加载展开行,并展开内容
331
- * @param row 指定行
332
- */
333
- reloadRowExpand: (row: any) => Promise<void>;
334
- /**
335
- * 重新懒加载树节点,并展开该节点
336
- * @param rows 指定行
337
- */
338
- reloadTreeExpand: (row: any) => Promise<any>;
339
- };
340
- export type TtSelectRowKeysType = Array<string | number> | string | number | undefined | any;
341
- export type TtSelectRowsType = VxeTablePropTypes.Row | Array<VxeTablePropTypes.Row> | any;
342
- export type TtTableMethods<DT = VxeTablePropTypes.Row> = {
343
- /**
344
- * @description: 表格重载数据, 默认重置为第一页,可全局配置 isReloadResetToFirstPage:false 不重置为第一页
345
- * @param {FetchParams | undefined} data 加载的params
346
- * @return {*}
347
- */
348
- reload: (data?: FetchParams) => Promise<void>;
349
- /**
350
- * @description: 重新计算高度
351
- * @return {*}
352
- */
353
- redoHeight: () => void;
354
- /**
355
- * @description: 设置表格props
356
- * @param {Partial<TtTableProps>} props 表格props
357
- */
358
- setProps: (props: Partial<TtTableProps>) => void;
359
- /**
360
- * @description: 设置表格loading
361
- * @param {boolean} loading
362
- */
363
- setLoading: (loading: boolean) => void;
364
- /**
365
- * @description: 获取表格loading
366
- * @return {boolean} loading
367
- */
368
- getLoading?: ComputedRef<boolean | undefined>;
369
- /**
370
- * @description: 设置表格columns
371
- * @param {VxeGridPropTypes.Columns<DT>} columns columns
372
- * @return {*}
373
- */
374
- setTableColumns: (columns: VxeGridPropTypes.Columns<DT>) => void;
375
- /**
376
- * @description: 获取表格columns
377
- * @return {VxeGridPropTypes.Columns<DT> | undefined}
378
- */
379
- emitLoading?: (loading: boolean, uid: number) => void;
380
- /**
381
- * @description: 获取表格数据
382
- * @return {DT[]}
383
- */
384
- getDataSource: () => DT[];
385
- /**
386
- * @description: 设置表格pagination
387
- * @param {Partial<VxeGridPropTypes.PagerConfig>} props 表格pagination
388
- */
389
- setPagination: (props: Partial<VxeGridPropTypes.PagerConfig>) => void;
390
- /**
391
- * @description: 获取表格pagination
392
- * @return {VxeGridPropTypes.PagerConfig | undefined}
393
- */
394
- getPagination: () => VxeGridPropTypes.PagerConfig | undefined;
395
- /**
396
- * @description: 获取vxe-grid实例
397
- * @return {VxeGridMethods}
398
- */
399
- getTableInstance: () => VxeGridMethods;
400
- /**
401
- * @description: 获取选中数据的keys集合
402
- * @return {Array<string>}
403
- */
404
- getSelectRowKeys: () => TtSelectRowKeysType;
405
- /**
406
- * @description: 获取选中数据
407
- * @return {Array<string>}
408
- */
409
- getSelectRows: () => TtSelectRowsType;
410
- /**
411
- * @description: 获取表格columns
412
- * @return {VxeGridPropTypes.Columns<DT> | undefined}
413
- */
414
- getTableColumns: () => VxeGridPropTypes.Columns<DT> | undefined;
415
- /**
416
- * @description: 设置表格选中数据
417
- * @param {DT[]} rows 选中的数据
418
- * @param {string | number[]} keys 选中的数据keys
419
- */
420
- setSelectedRowKeys: (rows: TtSelectRowsType, keys?: TtSelectRowKeysType) => void;
421
- /**
422
- * @description: 清除全部行选择
423
- */
424
- clearSelectedRowKeys: () => void;
425
- /**
426
- * @description: 获取表格选中数据
427
- * @return {DT[]}
428
- */
429
- selectedKeys: MaybeRef<TtSelectRowKeysType>;
430
- /**
431
- * @description: 获取表格选中数据
432
- * @return {DT[]}
433
- */
434
- selectedRows: MaybeRef<TtSelectRowsType>;
435
- } & VxeTableMethods<DT>;
436
- /** 服务端筛选排序-字段筛选条件 */
437
- export type FieldFilterConditionRequest = {
438
- /** 字段名 */
439
- fieldName: string;
440
- /** 全选 */
441
- checkAll: boolean;
442
- /** 包含的值 */
443
- includeValues: string[];
444
- /** 排除的值 */
445
- excludeValues: string[];
446
- };
447
- /** 服务端筛选排序-排序条件 */
448
- export type SortConditionRequest = {
449
- /** 字段名 */
450
- fieldName: string;
451
- /** 是否升序 */
452
- isAscending: boolean;
453
- };
454
- export type FetchParams = {
455
- tablePage: VxeGridPropTypes.PagerConfig;
456
- searchInfo?: Recordable;
457
- /** 服务端漏斗查询 */
458
- serverFilterParams?: {
459
- filterConditions: FieldFilterConditionRequest[];
460
- sortConditions: SortConditionRequest[];
461
- };
462
- } | Recordable;
463
- export type InsertReturnData = {
464
- row: VxeTablePropTypes.Row;
465
- rows: VxeTablePropTypes.Row[];
466
- };
467
- export type RowDragEvent = {
468
- newIndex: number;
469
- oldIndex: number;
470
- currRow: VxeTablePropTypes.Row;
471
- data?: VxeTablePropTypes.Row[];
472
- };
473
- export type TtTableLeftRightRowNode = {
474
- /** 距离父盒子顶部的坐标 */
475
- offsetTop?: number;
476
- rowid?: string;
477
- item?: any;
478
- /** 所有数据 */
479
- items?: any[];
480
- index?: number;
481
- parent?: any;
482
- };
483
- export type TtTableExtendedTableApi = TableApi & {
484
- useStore: <T = NoInfer<TtTableProps>>(selector?: (state: NoInfer<TtTableProps>) => T) => Readonly<Ref<T>>;
485
- };
486
- export type RowSelectionHandlers = {
487
- clearSelectedRowKeys?: () => void;
488
- };
489
- export {};
@@ -1,26 +0,0 @@
1
- import { TipConfig } from '../../../../directives/disabled-tip';
2
- import { ButtonProps } from 'element-plus';
3
- export type TtActionComponentType = "TtAddButton" | "TtDelButton" | "TtUploadButton" | "TtEnableButton" | "TtDisabledButton";
4
- export type TtActionItem = {
5
- onClick?: Fn;
6
- handler?: Fn;
7
- label?: string;
8
- icon?: string;
9
- iconSize?: number;
10
- type?: "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger";
11
- class?: string;
12
- iconFont?: string;
13
- divider?: boolean;
14
- loading?: boolean;
15
- auth?: string[];
16
- ifShow?: boolean | ((action: TtActionItem) => boolean);
17
- disabled?: boolean;
18
- disabledTip?: Array<TipConfig> | TipConfig;
19
- color?: string;
20
- component?: TtActionComponentType;
21
- children?: TtActionItem[];
22
- slot?: string;
23
- size?: "" | "default" | "small" | "large";
24
- isTextHide?: boolean;
25
- props?: Partial<ButtonProps>;
26
- };
@@ -1,64 +0,0 @@
1
- import { MaybeRef, Ref } from 'vue';
2
- import { VxeGridMethods } from 'vxe-table';
3
- import { TtSelectRowKeysType, TtTableMethods, TtTableProps } from '../types/table';
4
- import { TableFormApi } from '../utils/table-form-api';
5
- import { TtTableToolsProps } from './tableTools';
6
- import { TtExtendedFormApi, TtFormProps } from '../../../tt-form';
7
- export type TtTableFormRenderFormProps = Partial<TtFormProps>;
8
- export type TtTableRenderFormInstance = TtExtendedFormApi;
9
- export type TtTableFormProps = {
10
- /** 双向绑定的表格数据 */
11
- tableData?: Array<Recordable>;
12
- /** 表格配置 */
13
- table?: Partial<TtTableProps>;
14
- /** form 配置 */
15
- form?: TtTableFormRenderFormProps;
16
- /** 是否开启form表单 */
17
- useSearchForm?: boolean;
18
- handleSearchInfoFn?: Fn;
19
- /** tool配置 */
20
- toolConfig?: TtTableToolsProps;
21
- /** 刷新前的调用方法 */
22
- tableRefreshBefore?: (...arg: any[]) => Promise<any>;
23
- /** 表格行id */
24
- tableRowId?: string;
25
- /**
26
- * 表格 testId,用于生成测试标识
27
- * 如果不指定,将从 table.api 路径自动提取
28
- * @example
29
- * testId="user" → data-testid="user-tableform", "user-search-form", "user-table"
30
- */
31
- testId?: string;
32
- };
33
- export type TtTableFormInstance = {
34
- /** 获取TtTableV2实例 */
35
- tableInstance: () => Promise<TtTableMethods>;
36
- /** 获取TtForm实例 */
37
- formInstance: () => Promise<TtTableRenderFormInstance>;
38
- /** 获取VxeGrid实例 */
39
- vxeGridInstance: () => Promise<VxeGridMethods>;
40
- };
41
- export type TtTableFormActionType = {
42
- setTableProps: (props: Partial<TtTableProps>) => void;
43
- setFormProps: TtExtendedFormApi["setState"];
44
- tableMethods: TtTableMethods;
45
- formMethods: TtTableRenderFormInstance;
46
- /** 设置props */
47
- setProps: (props: Partial<TtTableFormProps>) => void;
48
- /** reload */
49
- reload: TtTableMethods["reload"];
50
- /**
51
- * @description: 获取表格选中数据
52
- * @return {TtSelectRowKeysType[]}
53
- */
54
- selectedKeys: MaybeRef<TtSelectRowKeysType>;
55
- };
56
- export type TtTableFormMethod = TtTableFormInstance & Omit<TtTableFormActionType, "tableMethods" | "formMethods"> & {
57
- tableMethods?: TtTableMethods;
58
- formMethods?: TtTableRenderFormInstance;
59
- };
60
- export type TableFormRegisterFn = (instance: TtTableFormActionType, uuid: string) => void;
61
- export type UseTtTableFormReturnType = [TableFormRegisterFn, TtTableFormMethod];
62
- export type TtTableExtendedTableFormApi = TableFormApi & {
63
- useStore: <T = NoInfer<TtTableFormProps>>(selector?: (state: NoInfer<TtTableFormProps>) => T) => Readonly<Ref<T>>;
64
- };
@@ -1,10 +0,0 @@
1
- export type TtTableToolsProps = {
2
- /** 是否显示设置 */
3
- showSetting?: boolean;
4
- /** 是否显示刷新按钮 */
5
- showRefresh?: boolean;
6
- /** 是否显示列设置按钮 */
7
- showSetColumn?: boolean;
8
- /** 储存的key,支持函数动态获取 */
9
- columnsKey?: string | (() => string);
10
- };
@@ -1,18 +0,0 @@
1
- import { ComputedRef } from 'vue';
2
- /**
3
- * @param providerComponentName - The name(s) of the component(s) providing the context.
4
- *
5
- * There are situations where context can come from multiple components. In such cases, you might need to give an array of component names to provide your context, instead of just a single string.
6
- *
7
- * @param contextName The description for injection key symbol.
8
- */
9
- export declare function createContext<ContextValue>(providerComponentName: string | string[], contextName?: string): readonly [<T extends ContextValue | null | undefined = ContextValue>(fallback?: T) => T extends null ? ContextValue | null : ContextValue, (contextValue: ContextValue) => ContextValue];
10
- /**
11
- * 表单操作按钮 testid 上下文
12
- * 用于传递查询/重置等按钮的 testid
13
- */
14
- export type FormActionTestIds = {
15
- submit?: string;
16
- reset?: string;
17
- };
18
- export declare const injectFormActionTestIds: <T extends ComputedRef<FormActionTestIds> | null | undefined = ComputedRef<FormActionTestIds>>(fallback?: T | undefined) => T extends null ? ComputedRef<FormActionTestIds> | null : ComputedRef<FormActionTestIds>, provideFormActionTestIds: (contextValue: ComputedRef<FormActionTestIds>) => ComputedRef<FormActionTestIds>;