@gx-design-vue/pro-table 0.2.0-alpha.7 → 0.2.0-alpha.9

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 (133) hide show
  1. package/dist/ProTable.d.ts +14 -492
  2. package/dist/ProTable.js +818 -518
  3. package/dist/components/ScrollBar/Bar.d.ts +81 -0
  4. package/dist/components/ScrollBar/Bar.js +84 -0
  5. package/dist/components/ScrollBar/Thumb.d.ts +52 -0
  6. package/dist/components/ScrollBar/{Thumb/index.js → Thumb.js} +67 -55
  7. package/dist/components/ScrollBar/context.d.ts +3 -4
  8. package/dist/components/ScrollBar/context.js +3 -3
  9. package/dist/components/ScrollBar/util.d.ts +6 -5
  10. package/dist/components/ScrollBar/util.js +1 -12
  11. package/dist/components/SearchForm/CollapseToggle.d.ts +55 -0
  12. package/dist/components/SearchForm/CollapseToggle.js +47 -0
  13. package/dist/components/SearchForm/FormItemContainer.d.ts +75 -0
  14. package/dist/components/SearchForm/FormItemContainer.js +225 -0
  15. package/dist/components/SearchForm/FormItemWrapper.d.ts +82 -0
  16. package/dist/components/SearchForm/FormItemWrapper.js +62 -0
  17. package/dist/components/SearchForm/SearchForm.d.ts +130 -0
  18. package/dist/components/SearchForm/SearchForm.js +319 -0
  19. package/dist/components/SearchForm/index.d.ts +2 -0
  20. package/dist/components/SearchForm/index.js +2 -0
  21. package/dist/components/Toolbar/FullscreenIcon.d.ts +26 -0
  22. package/dist/components/Toolbar/FullscreenIcon.js +22 -0
  23. package/dist/components/Toolbar/ListToolBar.d.ts +111 -0
  24. package/dist/components/Toolbar/ListToolBar.js +101 -0
  25. package/dist/components/Toolbar/index.d.ts +103 -0
  26. package/dist/components/Toolbar/index.js +101 -0
  27. package/dist/components/Toolbar/style.d.ts +8 -0
  28. package/dist/components/{ListToolBar → Toolbar}/style.js +32 -27
  29. package/dist/context/TableContext.d.ts +15 -27
  30. package/dist/context/TableContext.js +3 -3
  31. package/dist/hooks/index.d.ts +16 -0
  32. package/dist/hooks/index.js +16 -0
  33. package/dist/hooks/useBreakpoints.d.ts +13 -0
  34. package/dist/hooks/useBreakpoints.js +57 -0
  35. package/dist/hooks/useCellRender.d.ts +13 -0
  36. package/dist/hooks/useCellRender.js +28 -0
  37. package/dist/hooks/useColumnResize.d.ts +30 -0
  38. package/dist/hooks/useColumnResize.js +110 -0
  39. package/dist/hooks/useColumns.d.ts +35 -24
  40. package/dist/hooks/useColumns.js +89 -56
  41. package/dist/hooks/useFetchData.d.ts +40 -65
  42. package/dist/hooks/useFetchData.js +157 -172
  43. package/dist/hooks/useFitPage.d.ts +19 -0
  44. package/dist/hooks/useFitPage.js +90 -0
  45. package/dist/hooks/useKeepAliveReload.d.ts +21 -0
  46. package/dist/hooks/useKeepAliveReload.js +24 -0
  47. package/dist/hooks/useLoading.d.ts +18 -7
  48. package/dist/hooks/useLoading.js +26 -8
  49. package/dist/hooks/usePagination.d.ts +10 -7
  50. package/dist/hooks/usePagination.js +37 -26
  51. package/dist/hooks/useRequestOptions.d.ts +18 -0
  52. package/dist/hooks/useRequestOptions.js +39 -0
  53. package/dist/hooks/useRowSelection.d.ts +27 -15
  54. package/dist/hooks/useRowSelection.js +92 -77
  55. package/dist/hooks/useTable.d.ts +19 -77
  56. package/dist/hooks/useTable.js +66 -54
  57. package/dist/hooks/useTableForm.d.ts +15 -83
  58. package/dist/hooks/useTableForm.js +93 -56
  59. package/dist/hooks/useTableScroll.d.ts +33 -31
  60. package/dist/hooks/useTableScroll.js +71 -26
  61. package/dist/hooks/useTableSize.d.ts +17 -7
  62. package/dist/hooks/useTableSize.js +20 -6
  63. package/dist/index.d.ts +10 -7
  64. package/dist/index.js +9 -3
  65. package/dist/interface.d.ts +492 -0
  66. package/dist/pro-table.esm.js +3483 -3913
  67. package/dist/pro-table.js +1 -1
  68. package/dist/style/fit-page.d.ts +4 -2
  69. package/dist/style/fit-page.js +9 -3
  70. package/dist/style/index.d.ts +4 -6
  71. package/dist/style/index.js +24 -74
  72. package/dist/style/list.d.ts +4 -2
  73. package/dist/style/list.js +1 -10
  74. package/dist/style/resizable.d.ts +8 -0
  75. package/dist/style/resizable.js +18 -0
  76. package/dist/style/scroll.d.ts +4 -2
  77. package/dist/style/scroll.js +8 -6
  78. package/dist/style/search.d.ts +8 -0
  79. package/dist/{components/Form/style.js → style/search.js} +22 -8
  80. package/dist/theme/augment.d.ts +8 -0
  81. package/dist/theme/interface/components.d.ts +8 -0
  82. package/dist/utils/dateFormat.d.ts +9 -0
  83. package/dist/utils/dateFormat.js +29 -0
  84. package/dist/utils/formConstants.d.ts +9 -0
  85. package/dist/utils/formConstants.js +29 -0
  86. package/dist/utils/valueFormat.d.ts +9 -0
  87. package/dist/utils/valueFormat.js +27 -0
  88. package/package.json +10 -9
  89. package/dist/components/Form/components/RequestSelect.d.ts +0 -50
  90. package/dist/components/Form/components/RequestSelect.js +0 -56
  91. package/dist/components/Form/hooks/useForm.d.ts +0 -11
  92. package/dist/components/Form/hooks/useForm.js +0 -30
  93. package/dist/components/Form/index.d.ts +0 -32
  94. package/dist/components/Form/index.js +0 -476
  95. package/dist/components/Form/style.d.ts +0 -6
  96. package/dist/components/Form/utils/config.d.ts +0 -9
  97. package/dist/components/Form/utils/config.js +0 -29
  98. package/dist/components/Form/utils/dateFormat.d.ts +0 -22
  99. package/dist/components/Form/utils/dateFormat.js +0 -43
  100. package/dist/components/ListToolBar/index.d.ts +0 -59
  101. package/dist/components/ListToolBar/index.js +0 -123
  102. package/dist/components/ListToolBar/style.d.ts +0 -6
  103. package/dist/components/ScrollBar/Bar/index.d.ts +0 -49
  104. package/dist/components/ScrollBar/Bar/index.js +0 -68
  105. package/dist/components/ScrollBar/Bar/props.d.ts +0 -25
  106. package/dist/components/ScrollBar/Bar/props.js +0 -17
  107. package/dist/components/ScrollBar/Thumb/index.d.ts +0 -40
  108. package/dist/components/ScrollBar/Thumb/props.d.ts +0 -20
  109. package/dist/components/ScrollBar/Thumb/props.js +0 -17
  110. package/dist/components/TableCell/index.d.ts +0 -37
  111. package/dist/components/TableCell/index.js +0 -69
  112. package/dist/components/ToolBar/FullscreenIcon.d.ts +0 -7
  113. package/dist/components/ToolBar/FullscreenIcon.js +0 -11
  114. package/dist/components/ToolBar/index.d.ts +0 -34
  115. package/dist/components/ToolBar/index.js +0 -97
  116. package/dist/hooks/tryOnActivated.d.ts +0 -6
  117. package/dist/hooks/tryOnActivated.js +0 -12
  118. package/dist/hooks/useDebounceFn.d.ts +0 -8
  119. package/dist/hooks/useDebounceFn.js +0 -31
  120. package/dist/hooks/useScrollArea.d.ts +0 -24
  121. package/dist/hooks/useScrollArea.js +0 -102
  122. package/dist/props.d.ts +0 -340
  123. package/dist/props.js +0 -247
  124. package/dist/types/ColumnTypings.d.ts +0 -130
  125. package/dist/types/SlotsTypings.d.ts +0 -63
  126. package/dist/types/SlotsTypings.js +0 -12
  127. package/dist/types/TableTypings.d.ts +0 -359
  128. package/dist/types/index.d.ts +0 -9
  129. package/dist/utils/utils.d.ts +0 -10
  130. package/dist/utils/utils.js +0 -89
  131. /package/dist/{types/ColumnTypings.js → interface.js} +0 -0
  132. /package/dist/{types/TableTypings.js → theme/augment.js} +0 -0
  133. /package/dist/{types/index.js → theme/interface/components.js} +0 -0
package/dist/props.js DELETED
@@ -1,247 +0,0 @@
1
- import { omit } from "es-toolkit";
2
- import { tableProps as tableProps$1 } from "ant-design-vue/es/table/Table";
3
- const tableProps = {
4
- ...omit(tableProps$1(), [
5
- "rowKey",
6
- "rowSelection",
7
- "columns",
8
- "pagination",
9
- "size",
10
- "bordered",
11
- "loading",
12
- "onExpand",
13
- "onExpandedRowsChange",
14
- "onResizeColumn",
15
- "expandedRowKeys",
16
- "customHeaderRow",
17
- "customRow",
18
- "defaultExpandedRowKeys",
19
- "expandedRowRender",
20
- "expandIcon",
21
- "footer",
22
- "title",
23
- "rowClassName",
24
- "rowExpandable",
25
- "transformCellText",
26
- "onChange"
27
- ]),
28
- direction: {
29
- type: String,
30
- default: "ltr"
31
- },
32
- bordered: {
33
- type: Boolean,
34
- default: void 0
35
- },
36
- loading: {
37
- type: [Boolean, Object],
38
- default: void 0
39
- },
40
- scroll: {
41
- type: Object,
42
- default: void 0
43
- }
44
- };
45
- const proTableProps = {
46
- ...tableProps,
47
- id: {
48
- type: String,
49
- default: ""
50
- },
51
- class: {
52
- type: String,
53
- default: ""
54
- },
55
- style: {
56
- type: Object,
57
- default: () => ({})
58
- },
59
- classNames: {
60
- type: Object,
61
- default: () => ({})
62
- },
63
- styles: {
64
- type: Object,
65
- default: () => ({})
66
- },
67
- fitPage: {
68
- type: Boolean,
69
- default: false
70
- },
71
- rowSelection: {
72
- type: Object,
73
- default: void 0
74
- },
75
- columns: {
76
- type: Array,
77
- default: () => []
78
- },
79
- pagination: {
80
- type: [Object, Boolean],
81
- default: () => void 0
82
- },
83
- rowKey: {
84
- type: String,
85
- default: "id"
86
- },
87
- request: {
88
- type: Function,
89
- default: void 0
90
- },
91
- autoRequest: {
92
- type: Boolean,
93
- default: true
94
- },
95
- virtualScroll: Boolean,
96
- params: {
97
- type: Object,
98
- default: () => ({})
99
- },
100
- waitRequest: {
101
- type: Boolean,
102
- default: false
103
- },
104
- title: Function,
105
- footer: Function,
106
- transformCellText: [Function],
107
- rowExpandable: [Function],
108
- rowClassName: [Function, String],
109
- expandIcon: Function,
110
- expandedRowKeys: Array,
111
- defaultExpandedRowKeys: Array,
112
- expandedRowRender: [Function],
113
- customRow: Function,
114
- customHeaderRow: Function,
115
- polling: Number,
116
- debounceTime: {
117
- type: Number,
118
- default: 10
119
- },
120
- form: {
121
- type: [Object, Boolean],
122
- default: () => void 0
123
- },
124
- searchMap: {
125
- type: Array,
126
- default: () => []
127
- },
128
- customRender: {
129
- type: [
130
- Function,
131
- Object,
132
- Boolean,
133
- Array
134
- ],
135
- default: () => void 0
136
- },
137
- emptyText: {
138
- type: [
139
- Function,
140
- Object,
141
- Boolean,
142
- Array
143
- ],
144
- default: () => void 0
145
- },
146
- showLoading: {
147
- type: Boolean,
148
- default: true
149
- },
150
- emptyTextProps: {
151
- type: Object,
152
- default: () => ({ style: {} })
153
- },
154
- actionProps: {
155
- type: Object,
156
- default: () => ({ placement: "right" })
157
- },
158
- listToolAfter: {
159
- type: [
160
- Object,
161
- Function,
162
- Boolean,
163
- String,
164
- Array
165
- ],
166
- default: () => void 0
167
- },
168
- headerTitle: {
169
- type: [
170
- Object,
171
- Function,
172
- Boolean,
173
- String,
174
- Array
175
- ],
176
- default: () => void 0
177
- },
178
- headerTitleTip: {
179
- type: [
180
- Object,
181
- Function,
182
- Boolean,
183
- String,
184
- Array
185
- ],
186
- default: () => void 0
187
- },
188
- titleTipText: { type: String },
189
- options: {
190
- type: [Object, Boolean],
191
- default: false
192
- },
193
- keepAliveReload: {
194
- type: Boolean,
195
- default: false
196
- },
197
- showIndex: {
198
- type: Boolean,
199
- default: false
200
- },
201
- cardBordered: {
202
- type: Boolean,
203
- default: false
204
- },
205
- pageItemRender: {
206
- type: [
207
- Function,
208
- Object,
209
- Array
210
- ],
211
- default: () => void 0
212
- },
213
- size: {
214
- type: String,
215
- default: "middle"
216
- },
217
- align: {
218
- type: String,
219
- default: "left"
220
- },
221
- draggable: Boolean,
222
- autoScroll: {
223
- type: Boolean,
224
- default: true
225
- },
226
- scrollBreakpoint: [String, Number],
227
- modalScroll: Boolean,
228
- neverScroll: Boolean,
229
- columnEmptyText: {
230
- type: [String, Function],
231
- default: void 0
232
- },
233
- postData: Function,
234
- onReset: Function,
235
- onReload: Function,
236
- onSubmit: Function,
237
- onChange: Function,
238
- onSizeChange: Function,
239
- onLoadingChange: Function,
240
- onRequestError: Function,
241
- onBeforeSearchSubmit: Function,
242
- onExpand: Function,
243
- onResizeColumn: Function,
244
- onExpandedRowsChange: Function
245
- };
246
- //#endregion
247
- export { proTableProps, tableProps };
@@ -1,130 +0,0 @@
1
- import { CSSProperties } from "vue";
2
- import { RecordType } from "@gx-design-vue/pro-utils";
3
- import { ColumnType } from "ant-design-vue/es/table";
4
- import { TooltipProps } from "ant-design-vue/es/tooltip";
5
- import { AlignType } from "ant-design-vue/es/vc-table/interface";
6
-
7
- //#region src/types/ColumnTypings.d.ts
8
- /**
9
- * @param text 文本框
10
- * @param date 日期 YYYY-MM-DD
11
- * @param dateMonth 月选择器
12
- * @param dateRange 日期范围 YYYY-MM-DD[]
13
- * @param time: 时间 HH:mm:ss
14
- * @param select 下拉选择器
15
- */
16
- type ProFieldValueType = 'text' | 'number' | 'numberRange' | 'select' | 'treeSelect' | 'date' | 'dateWeek' | 'dateQuarter' | 'dateMonth' | 'dateYear' | 'dateRange' | 'time';
17
- /**
18
- * @param text 文本框
19
- * @param date 日期 YYYY-MM-DD
20
- * @param dateMonth 月选择器
21
- * @param dateRange 日期范围 YYYY-MM-DD[]
22
- * @param time: 时间 HH:mm:ss
23
- * @param select 下拉选择器
24
- */
25
- type ProFieldValueFormat = 'YYYY-MM-DD' | 'YYYY-MM' | 'YYYY-MM-DD HH:mm:ss' | 'HH:mm:ss';
26
- interface ProSchemaValueEnumType {
27
- /** @name 演示的文案 */
28
- label: any;
29
- /** @name 演示的value值 */
30
- value: any;
31
- /** @name 是否禁用 */
32
- disabled?: boolean;
33
- [key: string]: any;
34
- }
35
- type ProSchemaValueType<ValueType> = (ValueType | ProFieldValueType);
36
- interface ProSearchMap<ValueType = 'text', ParamsKey = string> {
37
- name: ParamsKey;
38
- order?: number;
39
- /** 选择如何渲染相应的模式 */
40
- valueType?: ProSchemaValueType<ValueType>;
41
- /** valueType为date|dateMonth|dateRange|time生效 */
42
- valueFormat?: ProFieldValueFormat;
43
- placeholder?: string | string[];
44
- /** valueType为select生效 */
45
- allowClear?: boolean;
46
- /** valueType为select生效 */
47
- showSearch?: boolean;
48
- /** valueType为date生效 */
49
- showToday?: boolean;
50
- /** valueType为dateRange生效 */
51
- rangeStartName?: string;
52
- /** valueType为dateRange生效 */
53
- rangeEndName?: string;
54
- /** valueType为time生效 */
55
- use12Hours?: boolean;
56
- /** valueType为select生效 */
57
- loading?: boolean;
58
- /** valueType为date、dateRange生效 */
59
- showTime?: RecordType | boolean;
60
- /** 搜索表单的默认值 */
61
- initialValue?: any;
62
- /** 针对select、treeselect取值的key */
63
- valueKey?: string;
64
- /** 远程查询数据 */
65
- request?: {
66
- fetch?: () => Promise<ProSchemaValueEnumType[]>;
67
- manual?: boolean;
68
- debounceTime?: number;
69
- };
70
- /** 查询表单label */
71
- label?: string;
72
- /** 查询表单label - 宽度 */
73
- labelWidth?: string | number;
74
- /** 查询表单label - 对齐方式 */
75
- labelAlign?: 'center' | 'left' | 'right';
76
- /** 表单的属性值(ant-design) */
77
- field?: {
78
- rules?: RegExp;
79
- [key: string]: any;
80
- };
81
- /**
82
- * 支持 object 和Map,Map 是支持其他基础类型作为 key
83
- *
84
- * @name 映射值的类型
85
- */
86
- valueEnum?: ProSchemaValueEnumType[];
87
- }
88
- type LooseAutocomplete<T> = T | (string & {});
89
- type DataIndex<T> = LooseAutocomplete<keyof T | 'action'>;
90
- type ColumnWithKeyOrDataIndex<T = any[]> = {
91
- key: DataIndex<T>;
92
- dataIndex?: DataIndex<T>;
93
- } | {
94
- key?: DataIndex<T>;
95
- dataIndex: DataIndex<T>;
96
- };
97
- interface DefaultProColumn {
98
- uuid?: string | number;
99
- align?: AlignType;
100
- fixed?: boolean | 'right' | 'left';
101
- width?: number | string;
102
- }
103
- type DefaultProColumnWithKeyOrDataIndex<T = any[]> = DefaultProColumn & ColumnWithKeyOrDataIndex<T>;
104
- type ProColumn<T = undefined, R = any[]> = T extends undefined ? DefaultProColumnWithKeyOrDataIndex<R> : DefaultProColumnWithKeyOrDataIndex<R> & T;
105
- type ProColumnType<DataValue = RecordType, SearchParams = RecordType> = ProColumn<Omit<ColumnType<DataValue>, keyof DefaultProColumnWithKeyOrDataIndex> & {
106
- children?: ProColumnsType<DataValue, SearchParams>;
107
- index?: number;
108
- copyText?: string | ((record: ProColumnType) => string);
109
- tooltip?: false | (TooltipProps & {
110
- width?: number;
111
- targetStyle?: Partial<CSSProperties>;
112
- hiddenLine?: number;
113
- class?: string;
114
- }); /** 不在列表中显示 */
115
- show?: boolean; /** 列表顺序值 */
116
- order?: number; /** 表单搜索配置 */
117
- searchConfig?: ProSearchMap<undefined, keyof DataValue | keyof SearchParams>; /** 是否拷贝 */
118
- copyable?: boolean; /** 值为空时,默认取值 */
119
- columnEmptyText?: string | ((record: DataValue) => string);
120
- valueType?: ProColumnsValueType;
121
- }, DataValue>;
122
- type ProColumnsType<DataValue = RecordType, SearchParams = RecordType> = ProColumnType<DataValue, SearchParams>[];
123
- type ProColumnsValueType = 'text' | 'link' | 'time' | 'dateMonth' | 'dateTime' | 'date' | {
124
- node?: string;
125
- class?: string;
126
- attr?: string;
127
- click?: () => void;
128
- };
129
- //#endregion
130
- export { ColumnWithKeyOrDataIndex, DefaultProColumn, DefaultProColumnWithKeyOrDataIndex, ProColumn, ProColumnType, ProColumnsType, ProColumnsValueType, ProFieldValueFormat, ProFieldValueType, ProSchemaValueEnumType, ProSearchMap };
@@ -1,63 +0,0 @@
1
- import { ProColumnType } from "./ColumnTypings.js";
2
- import { CustomRender, RecordType, WithFalse } from "@gx-design-vue/pro-utils";
3
- import { ColumnType } from "ant-design-vue/es/table";
4
- import { RenderExpandIconProps } from "ant-design-vue/es/vc-table/interface";
5
-
6
- //#region src/types/SlotsTypings.d.ts
7
- interface ProTableBodyCellProps<T = RecordType> {
8
- text: any;
9
- value: any;
10
- record: T;
11
- index: number;
12
- column: ProColumnType<T>;
13
- }
14
- interface AntTableSlotsType {
15
- emptyText?: any;
16
- expandIcon?: RenderExpandIconProps<any>;
17
- title?: any;
18
- footer?: any;
19
- summary?: any;
20
- expandedRowRender?: any;
21
- expandColumnTitle?: any;
22
- bodyCell?: (props: ProTableBodyCellProps<any>) => any;
23
- headerCell?: (props: {
24
- title: any;
25
- column: ColumnType;
26
- }) => any;
27
- customFilterIcon?: any;
28
- customFilterDropdown?: any;
29
- default: any;
30
- }
31
- type ProTableSlotsKey = 'form' | 'actions' | 'headerTitle' | 'headerTitleTip' | 'listToolAfter' | 'pageItemRender' | 'customRender' | keyof AntTableSlotsType;
32
- declare const proTableSlotsKey: ProTableSlotsKey[];
33
- interface TableSlots extends AntTableSlotsType {
34
- form: any;
35
- actions: any;
36
- headerTitle: any;
37
- headerTitleTip: any;
38
- listToolAfter: any;
39
- customRender: (params: {
40
- currentData: any[];
41
- dataSource: any[];
42
- }) => any;
43
- pageItemRender: (params: {
44
- page: number;
45
- type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next';
46
- originalElement: any;
47
- }) => any;
48
- }
49
- interface CustomRenderResult<T = RecordType> {
50
- currentData: T[];
51
- dataSource: T[];
52
- }
53
- type PageItemFn = (opt: {
54
- page: number;
55
- type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next';
56
- originalElement: any;
57
- }) => CustomRender;
58
- type CustomDataFn<T = RecordType> = (params: CustomRenderResult<T>) => CustomRender;
59
- type DefaultRender = WithFalse<CustomRender>;
60
- type PageItemRender = WithFalse<PageItemFn>;
61
- type CustomDataRender<T = RecordType> = WithFalse<CustomDataFn<T>>;
62
- //#endregion
63
- export { AntTableSlotsType, CustomDataFn, CustomDataRender, CustomRenderResult, DefaultRender, PageItemFn, PageItemRender, ProTableBodyCellProps, ProTableSlotsKey, TableSlots, proTableSlotsKey };
@@ -1,12 +0,0 @@
1
- //#region src/types/SlotsTypings.ts
2
- const proTableSlotsKey = [
3
- "form",
4
- "actions",
5
- "headerTitle",
6
- "headerTitleTip",
7
- "listToolAfter",
8
- "pageItemRender",
9
- "customRender"
10
- ];
11
- //#endregion
12
- export { proTableSlotsKey };