@gx-design-vue/pro-table 0.2.0-alpha.0 → 0.2.0-alpha.10

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