@antdv-vue/pro-listy 0.0.0-stage → 2.0.3
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/CHANGELOG.md +241 -0
- package/README.md +47 -2
- package/dist/BaseListy.d.ts +12 -0
- package/dist/BaseListy.js +151 -0
- package/dist/InternalProListy.d.ts +6 -0
- package/dist/InternalProListy.js +209 -0
- package/dist/Item.d.ts +66 -0
- package/dist/Item.js +124 -0
- package/dist/ItemMeta.d.ts +17 -0
- package/dist/ItemMeta.js +85 -0
- package/dist/ListView.d.ts +46 -0
- package/dist/ListView.js +374 -0
- package/dist/Listy.d.ts +15 -0
- package/dist/Listy.js +150 -0
- package/dist/RenderTypings.d.ts +9 -0
- package/dist/RenderTypings.js +1 -0
- package/dist/context.d.ts +13 -0
- package/dist/context.js +11 -0
- package/dist/field/dist/ProField.d.ts +2 -0
- package/dist/field/dist/ProPureField.d.ts +1 -0
- package/dist/field/dist/ValueTypeToComponent.d.ts +1 -0
- package/dist/field/dist/components/AutoComplete/index.d.ts +1 -0
- package/dist/field/dist/components/Cascader/index.d.ts +1 -0
- package/dist/field/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/field/dist/components/Code/index.d.ts +1 -0
- package/dist/field/dist/components/ColorPicker/index.d.ts +1 -0
- package/dist/field/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/field/dist/components/Digit/index.d.ts +1 -0
- package/dist/field/dist/components/DigitRange/index.d.ts +1 -0
- package/dist/field/dist/components/FromNow/index.d.ts +1 -0
- package/dist/field/dist/components/Image/index.d.ts +1 -0
- package/dist/field/dist/components/IndexColumn/index.d.ts +1 -0
- package/dist/field/dist/components/Money/index.d.ts +2 -0
- package/dist/field/dist/components/OTP/index.d.ts +1 -0
- package/dist/field/dist/components/Options/index.d.ts +1 -0
- package/dist/field/dist/components/Password/index.d.ts +3 -0
- package/dist/field/dist/components/Percent/index.d.ts +1 -0
- package/dist/field/dist/components/Progress/index.d.ts +1 -0
- package/dist/field/dist/components/Radio/index.d.ts +1 -0
- package/dist/field/dist/components/RangePicker/DatePicker.d.ts +1 -0
- package/dist/field/dist/components/RangePicker/TimePicker.d.ts +1 -0
- package/dist/field/dist/components/Rate/index.d.ts +1 -0
- package/dist/field/dist/components/Second/index.d.ts +1 -0
- package/dist/field/dist/components/Segmented/index.d.ts +1 -0
- package/dist/field/dist/components/Select/index.d.ts +1 -0
- package/dist/field/dist/components/Slider/index.d.ts +1 -0
- package/dist/field/dist/components/Status/index.d.ts +1 -0
- package/dist/field/dist/components/Switch/index.d.ts +1 -0
- package/dist/field/dist/components/Text/index.d.ts +2 -0
- package/dist/field/dist/components/TextArea/index.d.ts +3 -0
- package/dist/field/dist/components/TimePicker/index.d.ts +1 -0
- package/dist/field/dist/components/TreeSelect/index.d.ts +1 -0
- package/dist/field/dist/index.d.ts +1 -0
- package/dist/field/dist/typing.d.ts +1 -0
- package/dist/form/dist/BaseForm/BaseForm.d.ts +8 -0
- package/dist/form/dist/BaseForm/EditOrReadOnlyContext.d.ts +1 -0
- package/dist/form/dist/BaseForm/LightWrapper/index.d.ts +1 -0
- package/dist/form/dist/BaseForm/Submitter/index.d.ts +1 -0
- package/dist/form/dist/BaseForm/createField.d.ts +1 -0
- package/dist/form/dist/FieldContext.d.ts +1 -0
- package/dist/form/dist/RenderTypings.d.ts +1 -0
- package/dist/form/dist/components/Captcha/index.d.ts +1 -0
- package/dist/form/dist/components/Cascader/index.d.ts +1 -0
- package/dist/form/dist/components/Checkbox/group.d.ts +1 -0
- package/dist/form/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/form/dist/components/ColorPicker/index.d.ts +1 -0
- package/dist/form/dist/components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/form/dist/components/DatePicker/DateTimePicker.d.ts +1 -0
- package/dist/form/dist/components/DatePicker/MonthPicker.d.ts +2 -0
- package/dist/form/dist/components/DatePicker/QuarterPicker.d.ts +1 -0
- package/dist/form/dist/components/DatePicker/WeekPicker.d.ts +1 -0
- package/dist/form/dist/components/DatePicker/YearPicker.d.ts +1 -0
- package/dist/form/dist/components/Dependency/index.d.ts +1 -0
- package/dist/form/dist/components/Digit/index.d.ts +1 -0
- package/dist/form/dist/components/DigitRange/index.d.ts +1 -0
- package/dist/form/dist/components/Field/index.d.ts +1 -0
- package/dist/form/dist/components/FieldSet/index.d.ts +1 -0
- package/dist/form/dist/components/FormItem/WrapFormItem.d.ts +1 -0
- package/dist/form/dist/components/FormItem/index.d.ts +2 -0
- package/dist/form/dist/components/Group/index.d.ts +1 -0
- package/dist/form/dist/components/List/ListItem.d.ts +2 -0
- package/dist/form/dist/components/List/context.d.ts +1 -0
- package/dist/form/dist/components/List/index.d.ts +1 -0
- package/dist/form/dist/components/Money/index.d.ts +1 -0
- package/dist/form/dist/components/Password/index.d.ts +1 -0
- package/dist/form/dist/components/Radio/group.d.ts +1 -0
- package/dist/form/dist/components/Radio/index.d.ts +1 -0
- package/dist/form/dist/components/RangePicker/DateMonthRangePicker.d.ts +1 -0
- package/dist/form/dist/components/RangePicker/DateQuarterRangePicker.d.ts +1 -0
- package/dist/form/dist/components/RangePicker/DateRangePicker.d.ts +1 -0
- package/dist/form/dist/components/RangePicker/DateTimeRangePicker.d.ts +1 -0
- package/dist/form/dist/components/RangePicker/DateWeekRangePicker.d.ts +1 -0
- package/dist/form/dist/components/RangePicker/DateYearRangePicker.d.ts +1 -0
- package/dist/form/dist/components/RangePicker/TimeRangePicker.d.ts +1 -0
- package/dist/form/dist/components/Rate/index.d.ts +1 -0
- package/dist/form/dist/components/SchemaForm/index.d.ts +1 -0
- package/dist/form/dist/components/SchemaForm/typing.d.ts +1 -0
- package/dist/form/dist/components/Segmented/index.d.ts +1 -0
- package/dist/form/dist/components/Select/Search/index.d.ts +1 -0
- package/dist/form/dist/components/Select/index.d.ts +1 -0
- package/dist/form/dist/components/Slider/index.d.ts +1 -0
- package/dist/form/dist/components/Switch/index.d.ts +1 -0
- package/dist/form/dist/components/Text/index.d.ts +1 -0
- package/dist/form/dist/components/TextArea/index.d.ts +1 -0
- package/dist/form/dist/components/TimePicker/index.d.ts +1 -0
- package/dist/form/dist/components/TreeSelect/index.d.ts +1 -0
- package/dist/form/dist/components/UploadButton/index.d.ts +1 -0
- package/dist/form/dist/components/UploadDragger/index.d.ts +1 -0
- package/dist/form/dist/index.d.ts +1 -0
- package/dist/form/dist/layouts/DrawerForm/index.d.ts +1 -0
- package/dist/form/dist/layouts/LightFilter/index.d.ts +1 -0
- package/dist/form/dist/layouts/LoginForm/index.d.ts +1 -0
- package/dist/form/dist/layouts/LoginFormPage/index.d.ts +1 -0
- package/dist/form/dist/layouts/ModalForm/index.d.ts +1 -0
- package/dist/form/dist/layouts/ProForm/index.d.ts +1 -0
- package/dist/form/dist/layouts/QueryFilter/Actions.d.ts +1 -0
- package/dist/form/dist/layouts/QueryFilter/index.d.ts +1 -0
- package/dist/form/dist/layouts/StepsForm/StepForm.d.ts +1 -0
- package/dist/form/dist/layouts/StepsForm/index.d.ts +1 -0
- package/dist/form/dist/layouts/StepsForm/typing.d.ts +2 -0
- package/dist/form/dist/typing.d.ts +1 -0
- package/dist/form/dist/utils/index.d.ts +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/dist/pro-listy.esm.js +743 -0
- package/dist/style/index.d.ts +11 -0
- package/dist/style/index.js +203 -0
- package/dist/typing.d.ts +41 -0
- package/dist/typing.js +1 -0
- package/dist/utils/index.d.ts +37 -0
- package/dist/utils/index.js +10 -0
- package/package.json +64 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# @antdv-vue/pro-listy
|
|
2
|
+
|
|
3
|
+
## 2.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [ef5cfb6]
|
|
8
|
+
- @antdv-vue/pro-utils@2.1.1
|
|
9
|
+
- @antdv-vue/pro-card@3.0.2
|
|
10
|
+
- @antdv-vue/pro-table@2.0.3
|
|
11
|
+
|
|
12
|
+
## 2.0.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 244f208: fix: register the ListView locale prop.
|
|
17
|
+
- Updated dependencies [244f208]
|
|
18
|
+
- @antdv-vue/pro-utils@2.1.0
|
|
19
|
+
- @antdv-vue/pro-card@3.0.1
|
|
20
|
+
- @antdv-vue/pro-table@2.0.2
|
|
21
|
+
|
|
22
|
+
## 2.0.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Fix pagination size mapping.
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @antdv-vue/pro-table@2.0.1
|
|
29
|
+
|
|
30
|
+
## 2.0.0
|
|
31
|
+
|
|
32
|
+
### Major Changes
|
|
33
|
+
|
|
34
|
+
- feat!: remove the UMD bundle target from package builds.
|
|
35
|
+
- docs: sync structured changelog pages for every package.
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
- @antdv-vue/pro-card@3.0.0
|
|
41
|
+
- @antdv-vue/pro-provider@2.0.0
|
|
42
|
+
- @antdv-vue/pro-table@2.0.0
|
|
43
|
+
- @antdv-vue/pro-utils@2.0.0
|
|
44
|
+
|
|
45
|
+
## 1.0.26
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Updated dependencies
|
|
50
|
+
- @antdv-vue/pro-card@2.0.23
|
|
51
|
+
- @antdv-vue/pro-table@1.0.36
|
|
52
|
+
|
|
53
|
+
## 1.0.25
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- fix card, form bugs
|
|
58
|
+
- Updated dependencies
|
|
59
|
+
- @antdv-vue/pro-utils@1.0.23
|
|
60
|
+
- @antdv-vue/pro-card@2.0.22
|
|
61
|
+
- @antdv-vue/pro-table@1.0.35
|
|
62
|
+
|
|
63
|
+
## 1.0.24
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies
|
|
68
|
+
- @antdv-vue/pro-table@1.0.34
|
|
69
|
+
|
|
70
|
+
## 1.0.23
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- fix bugs
|
|
75
|
+
- Updated dependencies
|
|
76
|
+
- @antdv-vue/pro-table@1.0.33
|
|
77
|
+
- @antdv-vue/pro-card@2.0.21
|
|
78
|
+
|
|
79
|
+
## 1.0.22
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- @antdv-vue/pro-table@1.0.32
|
|
84
|
+
|
|
85
|
+
## 1.0.21
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- Updated dependencies
|
|
90
|
+
- @antdv-vue/pro-provider@1.0.14
|
|
91
|
+
- @antdv-vue/pro-card@2.0.20
|
|
92
|
+
- @antdv-vue/pro-table@1.0.31
|
|
93
|
+
- @antdv-vue/pro-utils@1.0.22
|
|
94
|
+
|
|
95
|
+
## 1.0.20
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- fix layout filed form card bugs
|
|
100
|
+
- Updated dependencies
|
|
101
|
+
- @antdv-vue/pro-card@2.0.19
|
|
102
|
+
- @antdv-vue/pro-provider@1.0.13
|
|
103
|
+
- @antdv-vue/pro-table@1.0.30
|
|
104
|
+
- @antdv-vue/pro-utils@1.0.21
|
|
105
|
+
|
|
106
|
+
## 1.0.19
|
|
107
|
+
|
|
108
|
+
### Patch Changes
|
|
109
|
+
|
|
110
|
+
- Updated dependencies
|
|
111
|
+
- @antdv-vue/pro-provider@1.0.12
|
|
112
|
+
- @antdv-vue/pro-card@2.0.18
|
|
113
|
+
- @antdv-vue/pro-table@1.0.29
|
|
114
|
+
- @antdv-vue/pro-utils@1.0.20
|
|
115
|
+
|
|
116
|
+
## 1.0.18
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies
|
|
121
|
+
- @antdv-vue/pro-provider@1.0.11
|
|
122
|
+
- @antdv-vue/pro-card@2.0.17
|
|
123
|
+
- @antdv-vue/pro-table@1.0.28
|
|
124
|
+
- @antdv-vue/pro-utils@1.0.19
|
|
125
|
+
|
|
126
|
+
## 1.0.17
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- fix listy style build and raw list behavior
|
|
131
|
+
- Updated dependencies
|
|
132
|
+
- @antdv-vue/pro-card@2.0.16
|
|
133
|
+
- @antdv-vue/pro-provider@1.0.10
|
|
134
|
+
- @antdv-vue/pro-table@1.0.27
|
|
135
|
+
- @antdv-vue/pro-utils@1.0.18
|
|
136
|
+
|
|
137
|
+
## 1.0.15
|
|
138
|
+
|
|
139
|
+
### Patch Changes
|
|
140
|
+
|
|
141
|
+
- fix bugs
|
|
142
|
+
- Updated dependencies
|
|
143
|
+
- @antdv-vue/pro-card@2.0.14
|
|
144
|
+
- @antdv-vue/pro-table@1.0.25
|
|
145
|
+
- @antdv-vue/pro-utils@1.0.16
|
|
146
|
+
|
|
147
|
+
## 1.0.15
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- fix css-in-js style Transition bugs
|
|
152
|
+
- Updated dependencies
|
|
153
|
+
- @antdv-vue/pro-table@1.0.25
|
|
154
|
+
- @antdv-vue/pro-utils@1.0.16
|
|
155
|
+
- @antdv-vue/pro-card@2.0.14
|
|
156
|
+
|
|
157
|
+
## 1.0.14
|
|
158
|
+
|
|
159
|
+
### Patch Changes
|
|
160
|
+
|
|
161
|
+
- @antdv-vue/pro-table@1.0.24
|
|
162
|
+
|
|
163
|
+
## 1.0.13
|
|
164
|
+
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- @antdv-vue/pro-table@1.0.23
|
|
168
|
+
|
|
169
|
+
## 1.0.12
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- @antdv-vue/pro-table@1.0.22
|
|
174
|
+
|
|
175
|
+
## 1.0.11
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- fix bugs
|
|
180
|
+
- Updated dependencies
|
|
181
|
+
- @antdv-vue/pro-card@2.0.13
|
|
182
|
+
- @antdv-vue/pro-provider@1.0.9
|
|
183
|
+
- @antdv-vue/pro-table@1.0.21
|
|
184
|
+
- @antdv-vue/pro-utils@1.0.15
|
|
185
|
+
|
|
186
|
+
## 1.0.10
|
|
187
|
+
|
|
188
|
+
### Patch Changes
|
|
189
|
+
|
|
190
|
+
- fix card listy form some bugs
|
|
191
|
+
- Updated dependencies
|
|
192
|
+
- @antdv-vue/pro-card@2.0.12
|
|
193
|
+
- @antdv-vue/pro-table@1.0.20
|
|
194
|
+
|
|
195
|
+
## 1.0.9
|
|
196
|
+
|
|
197
|
+
### Patch Changes
|
|
198
|
+
|
|
199
|
+
- expose listy methods
|
|
200
|
+
- Updated dependencies
|
|
201
|
+
- @antdv-vue/pro-table@1.0.19
|
|
202
|
+
|
|
203
|
+
## 1.0.8
|
|
204
|
+
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- create listy card mode
|
|
208
|
+
- Updated dependencies
|
|
209
|
+
- @antdv-vue/pro-provider@1.0.8
|
|
210
|
+
- @antdv-vue/pro-utils@1.0.14
|
|
211
|
+
- @antdv-vue/pro-card@2.0.11
|
|
212
|
+
- @antdv-vue/pro-table@1.0.18
|
|
213
|
+
|
|
214
|
+
## 1.0.7
|
|
215
|
+
|
|
216
|
+
### Patch Changes
|
|
217
|
+
|
|
218
|
+
- Updated dependencies
|
|
219
|
+
- @antdv-vue/pro-card@2.0.10
|
|
220
|
+
- @antdv-vue/pro-provider@1.0.7
|
|
221
|
+
- @antdv-vue/pro-utils@1.0.13
|
|
222
|
+
- @antdv-vue/pro-table@1.0.17
|
|
223
|
+
|
|
224
|
+
## 1.0.6
|
|
225
|
+
|
|
226
|
+
### Patch Changes
|
|
227
|
+
|
|
228
|
+
- fix layout bugs and listy
|
|
229
|
+
- Updated dependencies
|
|
230
|
+
- @antdv-vue/pro-provider@1.0.6
|
|
231
|
+
- @antdv-vue/pro-card@2.0.9
|
|
232
|
+
- @antdv-vue/pro-table@1.0.16
|
|
233
|
+
- @antdv-vue/pro-utils@1.0.12
|
|
234
|
+
|
|
235
|
+
## 1.0.5
|
|
236
|
+
|
|
237
|
+
### Patch Changes
|
|
238
|
+
|
|
239
|
+
- fix ProForm bugs
|
|
240
|
+
- Updated dependencies
|
|
241
|
+
- @antdv-vue/pro-provider@1.0.5
|
package/README.md
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @antdv-vue/pro-listy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Advanced list component for Pro Components, providing flexible list rendering with item and meta support.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @antdv-vue/pro-listy
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @antdv-vue/pro-listy
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Peer Dependencies
|
|
14
|
+
|
|
15
|
+
- `vue` >= 3.5.30
|
|
16
|
+
- `antdv-next` >= 1.3.6
|
|
17
|
+
|
|
18
|
+
## Components
|
|
19
|
+
|
|
20
|
+
| Component | Description |
|
|
21
|
+
|-----------|-------------|
|
|
22
|
+
| `ProListy` | Main list component with advanced features |
|
|
23
|
+
| `ProListyItem` | Individual list item component |
|
|
24
|
+
| `ProListyItemMeta` | Item meta information (title, description, avatar, etc.) |
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import { ProListy, ProListyItem, ProListyItemMeta } from '@antdv-vue/pro-listy'
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<ProListy>
|
|
35
|
+
<ProListyItem>
|
|
36
|
+
<ProListyItemMeta title="Item Title" description="Item description" />
|
|
37
|
+
</ProListyItem>
|
|
38
|
+
</ProListy>
|
|
39
|
+
</template>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Dependencies
|
|
43
|
+
|
|
44
|
+
- `@antdv-vue/pro-provider` — Theme and configuration context
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
[MIT](../../LICENSE)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProListyProps } from "./typing.js";
|
|
2
|
+
import { ComponentOptionsMixin, CreateComponentPublicInstanceWithMixins } from "vue";
|
|
3
|
+
import { CustomSlotsType, VueNode } from "@v-c/util/dist/type";
|
|
4
|
+
|
|
5
|
+
//#region src/BaseListy.d.ts
|
|
6
|
+
/** BaseProListy 默认隐藏卡片、搜索和工具栏 */
|
|
7
|
+
declare const _BaseProListy: new <RecordType extends Record<string, any>, U extends Record<string, any> = Record<string, any>>(props: ProListyProps<RecordType, U>) => CreateComponentPublicInstanceWithMixins<ProListyProps<RecordType, U>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, {}, {}, false, {}, CustomSlotsType<{
|
|
8
|
+
itemRender?: ProListyProps<RecordType, U>["itemRender"];
|
|
9
|
+
default?: () => VueNode;
|
|
10
|
+
}>>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { _BaseProListy as default };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import InternalProListy from "./InternalProListy.js";
|
|
2
|
+
import { useProListyInstanceExpose } from "./utils/index.js";
|
|
3
|
+
import { createVNode, defineComponent, mergeProps, shallowRef } from "vue";
|
|
4
|
+
import { ProConfigProvider } from "@antdv-vue/pro-provider";
|
|
5
|
+
import { transformBooleanProps } from "@antdv-vue/pro-utils";
|
|
6
|
+
//#region src/BaseListy.tsx
|
|
7
|
+
/** BaseProListy 默认隐藏卡片、搜索和工具栏 */
|
|
8
|
+
const _BaseProListy = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose }) => {
|
|
9
|
+
const listyRef = shallowRef(null);
|
|
10
|
+
expose(useProListyInstanceExpose(listyRef));
|
|
11
|
+
return () => {
|
|
12
|
+
const booleanProps = transformBooleanProps([
|
|
13
|
+
"manualRequest",
|
|
14
|
+
"showSorterTooltip",
|
|
15
|
+
"showHeader",
|
|
16
|
+
"rowHoverable",
|
|
17
|
+
"revalidateOnFocus",
|
|
18
|
+
"loading",
|
|
19
|
+
"virtual",
|
|
20
|
+
"sticky",
|
|
21
|
+
"tailor",
|
|
22
|
+
"bordered",
|
|
23
|
+
"cardBordered",
|
|
24
|
+
"ghost"
|
|
25
|
+
], props);
|
|
26
|
+
return createVNode(ProConfigProvider, { "needDeps": true }, { default: () => [createVNode(InternalProListy, mergeProps({ "ref": listyRef }, attrs, {
|
|
27
|
+
"class": attrs.class,
|
|
28
|
+
"style": attrs.style,
|
|
29
|
+
"cardProps": false,
|
|
30
|
+
"search": false,
|
|
31
|
+
"toolBarRender": false
|
|
32
|
+
}, props, booleanProps), slots)] });
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
name: "BaseProListy",
|
|
36
|
+
inheritAttrs: false,
|
|
37
|
+
props: [
|
|
38
|
+
"grid",
|
|
39
|
+
"itemLayout",
|
|
40
|
+
"variant",
|
|
41
|
+
"split",
|
|
42
|
+
"beforeSearchSubmit",
|
|
43
|
+
"bodyCell",
|
|
44
|
+
"bordered",
|
|
45
|
+
"caption",
|
|
46
|
+
"cardBordered",
|
|
47
|
+
"cardProps",
|
|
48
|
+
"childrenColumnName",
|
|
49
|
+
"classes",
|
|
50
|
+
"columnEmptyText",
|
|
51
|
+
"columns",
|
|
52
|
+
"columnsState",
|
|
53
|
+
"components",
|
|
54
|
+
"dataSource",
|
|
55
|
+
"dateFormatter",
|
|
56
|
+
"debounceTime",
|
|
57
|
+
"defaultData",
|
|
58
|
+
"defaultExpandAllRows",
|
|
59
|
+
"defaultExpandedRowKeys",
|
|
60
|
+
"defaultSize",
|
|
61
|
+
"direction",
|
|
62
|
+
"dropdownPrefixCls",
|
|
63
|
+
"editable",
|
|
64
|
+
"errorBoundaryRender",
|
|
65
|
+
"expandIcon",
|
|
66
|
+
"expandIconColumnIndex",
|
|
67
|
+
"expandRowByClick",
|
|
68
|
+
"expandable",
|
|
69
|
+
"expandedRowClassName",
|
|
70
|
+
"expandedRowKeys",
|
|
71
|
+
"expandedRowRender",
|
|
72
|
+
"form",
|
|
73
|
+
"getContainerWidth",
|
|
74
|
+
"getPopupContainer",
|
|
75
|
+
"ghost",
|
|
76
|
+
"group",
|
|
77
|
+
"headerCell",
|
|
78
|
+
"headerTitle",
|
|
79
|
+
"height",
|
|
80
|
+
"id",
|
|
81
|
+
"indentSize",
|
|
82
|
+
"itemCardProps",
|
|
83
|
+
"tooltip",
|
|
84
|
+
"itemRender",
|
|
85
|
+
"loading",
|
|
86
|
+
"locale",
|
|
87
|
+
"manualRequest",
|
|
88
|
+
"measureRowRender",
|
|
89
|
+
"name",
|
|
90
|
+
"onChange",
|
|
91
|
+
"onDataSourceChange",
|
|
92
|
+
"onExpand",
|
|
93
|
+
"onExpandedRowsChange",
|
|
94
|
+
"onHeaderRow",
|
|
95
|
+
"onLoad",
|
|
96
|
+
"onLoadingChange",
|
|
97
|
+
"onRequestError",
|
|
98
|
+
"onReset",
|
|
99
|
+
"onRow",
|
|
100
|
+
"onScroll",
|
|
101
|
+
"onSizeChange",
|
|
102
|
+
"onSubmit",
|
|
103
|
+
"options",
|
|
104
|
+
"optionsRender",
|
|
105
|
+
"pagination",
|
|
106
|
+
"params",
|
|
107
|
+
"polling",
|
|
108
|
+
"postData",
|
|
109
|
+
"prefixCls",
|
|
110
|
+
"request",
|
|
111
|
+
"revalidateOnFocus",
|
|
112
|
+
"rootClass",
|
|
113
|
+
"rowClassName",
|
|
114
|
+
"rowHoverable",
|
|
115
|
+
"rowKey",
|
|
116
|
+
"rowSelection",
|
|
117
|
+
"scroll",
|
|
118
|
+
"search",
|
|
119
|
+
"searchFormRender",
|
|
120
|
+
"showHeader",
|
|
121
|
+
"showSorterTooltip",
|
|
122
|
+
"sortDirections",
|
|
123
|
+
"sticky",
|
|
124
|
+
"styles",
|
|
125
|
+
"summary",
|
|
126
|
+
"tableAlertOptionRender",
|
|
127
|
+
"tableAlertRender",
|
|
128
|
+
"tableClass",
|
|
129
|
+
"tableExtraRender",
|
|
130
|
+
"tableLayout",
|
|
131
|
+
"tableRender",
|
|
132
|
+
"tableStyle",
|
|
133
|
+
"tableViewRender",
|
|
134
|
+
"tailor",
|
|
135
|
+
"title",
|
|
136
|
+
"toolBarRender",
|
|
137
|
+
"toolbar",
|
|
138
|
+
"type",
|
|
139
|
+
"virtual",
|
|
140
|
+
"onItem",
|
|
141
|
+
"classes",
|
|
142
|
+
"styles",
|
|
143
|
+
"loadMore"
|
|
144
|
+
]
|
|
145
|
+
});
|
|
146
|
+
const BaseProListy = _BaseProListy;
|
|
147
|
+
BaseProListy.install = (app) => {
|
|
148
|
+
app.component(BaseProListy.name, BaseProListy);
|
|
149
|
+
};
|
|
150
|
+
//#endregion
|
|
151
|
+
export { _BaseProListy as default };
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import ListView from "./ListView.js";
|
|
2
|
+
import style_default from "./style/index.js";
|
|
3
|
+
import { computed, createVNode, defineComponent, mergeProps, shallowRef } from "vue";
|
|
4
|
+
import { ProTable, useProTableInstanceExpose } from "@antdv-vue/pro-table";
|
|
5
|
+
import { classNames } from "@v-c/util";
|
|
6
|
+
import { useConfig } from "antdv-next/config-provider/context";
|
|
7
|
+
//#region src/InternalProListy.tsx
|
|
8
|
+
/** 根据 listSlot 推导默认的 valueType */
|
|
9
|
+
const DEFAULT_VALUE_TYPE_MAP = {
|
|
10
|
+
avatar: "avatar",
|
|
11
|
+
actions: "option",
|
|
12
|
+
description: "textarea"
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 为带有 listSlot 的 columns 填充默认 valueType
|
|
16
|
+
*/
|
|
17
|
+
function enrichColumnsWithDefaults(columns) {
|
|
18
|
+
return columns.map((col) => {
|
|
19
|
+
const { listSlot } = col;
|
|
20
|
+
if (!listSlot) return col;
|
|
21
|
+
const valueType = col.valueType || DEFAULT_VALUE_TYPE_MAP[listSlot];
|
|
22
|
+
return valueType ? {
|
|
23
|
+
...col,
|
|
24
|
+
valueType
|
|
25
|
+
} : col;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const InternalProListy = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose }) => {
|
|
29
|
+
const config = useConfig();
|
|
30
|
+
const tableRef = shallowRef(null);
|
|
31
|
+
const prefixCls = computed(() => props.prefixCls || config.value.getPrefixCls("pro"));
|
|
32
|
+
const baseClassName = computed(() => `${prefixCls.value}-listy`);
|
|
33
|
+
const [hashId, cssVarCls] = style_default(baseClassName);
|
|
34
|
+
/**
|
|
35
|
+
* - 如果传入了 columns(且含有 listSlot),直接使用 columns
|
|
36
|
+
*/
|
|
37
|
+
const proTableColumns = computed(() => {
|
|
38
|
+
if (props.columns && props.columns.length > 0) return enrichColumnsWithDefaults(props.columns);
|
|
39
|
+
return [];
|
|
40
|
+
});
|
|
41
|
+
expose(useProTableInstanceExpose(tableRef));
|
|
42
|
+
return () => {
|
|
43
|
+
const { columns: propsColumns, split, variant, rowKey, tooltip, grid, itemLayout, options = false, search = false, expandable, rowSelection: propRowSelection = false, pagination: propsPagination = false, itemRender, itemCardProps, onRow, rowClassName, locale, group, height, virtual, onScroll, onChange, classes, styles, sticky, onItem, size: propsSize, loadMore, ...rest } = props;
|
|
44
|
+
return createVNode(ProTable, mergeProps({ "ref": tableRef }, rest, {
|
|
45
|
+
"tooltip": tooltip,
|
|
46
|
+
"pagination": propsPagination,
|
|
47
|
+
"type": "listy",
|
|
48
|
+
"size": propsSize === "default" ? "medium" : propsSize,
|
|
49
|
+
"rowSelection": propRowSelection,
|
|
50
|
+
"search": search,
|
|
51
|
+
"options": options,
|
|
52
|
+
"class": classNames(baseClassName.value, attrs.class, hashId.value, cssVarCls.value, {
|
|
53
|
+
[`${baseClassName.value}-no-split`]: !split,
|
|
54
|
+
[`${baseClassName.value}-${variant}`]: variant
|
|
55
|
+
}),
|
|
56
|
+
"columns": proTableColumns.value,
|
|
57
|
+
"rowKey": rowKey,
|
|
58
|
+
"tableViewRender": ({ columns, size, pagination, rowSelection, dataSource, loading }) => createVNode(ListView, {
|
|
59
|
+
"columns": columns,
|
|
60
|
+
"size": size === "medium" || size === "middle" ? "default" : size,
|
|
61
|
+
"grid": grid,
|
|
62
|
+
"itemRender": itemRender,
|
|
63
|
+
"prefixCls": baseClassName.value,
|
|
64
|
+
"class": classNames(`${baseClassName.value}-container`, hashId.value, cssVarCls.value),
|
|
65
|
+
"itemLayout": itemLayout,
|
|
66
|
+
"sticky": sticky,
|
|
67
|
+
"ghost": rest.ghost,
|
|
68
|
+
"action": { isEditable: (row) => tableRef.value?.isEditable?.(row) },
|
|
69
|
+
"virtual": virtual,
|
|
70
|
+
"height": height,
|
|
71
|
+
"onScroll": onScroll,
|
|
72
|
+
"group": group,
|
|
73
|
+
"expandable": expandable,
|
|
74
|
+
"loadMore": loadMore,
|
|
75
|
+
"rowHoverable": rest.rowHoverable,
|
|
76
|
+
"pagination": pagination,
|
|
77
|
+
"rowSelection": propRowSelection === false ? void 0 : rowSelection,
|
|
78
|
+
"dataSource": dataSource || [],
|
|
79
|
+
"split": split,
|
|
80
|
+
"locale": locale,
|
|
81
|
+
"variant": variant,
|
|
82
|
+
"onRow": onRow,
|
|
83
|
+
"itemCardProps": itemCardProps,
|
|
84
|
+
"rowClassName": rowClassName,
|
|
85
|
+
"rowKey": rowKey,
|
|
86
|
+
"onItem": onItem,
|
|
87
|
+
"loading": loading,
|
|
88
|
+
"hashId": hashId.value,
|
|
89
|
+
"cssVarCls": cssVarCls.value
|
|
90
|
+
}, null)
|
|
91
|
+
}), slots);
|
|
92
|
+
};
|
|
93
|
+
}, {
|
|
94
|
+
name: "InternalProListy",
|
|
95
|
+
inheritAttrs: false,
|
|
96
|
+
props: [
|
|
97
|
+
"grid",
|
|
98
|
+
"itemLayout",
|
|
99
|
+
"onItem",
|
|
100
|
+
"onRow",
|
|
101
|
+
"variant",
|
|
102
|
+
"split",
|
|
103
|
+
"beforeSearchSubmit",
|
|
104
|
+
"bodyCell",
|
|
105
|
+
"bordered",
|
|
106
|
+
"caption",
|
|
107
|
+
"cardBordered",
|
|
108
|
+
"cardProps",
|
|
109
|
+
"childrenColumnName",
|
|
110
|
+
"classes",
|
|
111
|
+
"columnEmptyText",
|
|
112
|
+
"columns",
|
|
113
|
+
"columnsState",
|
|
114
|
+
"components",
|
|
115
|
+
"dataSource",
|
|
116
|
+
"dateFormatter",
|
|
117
|
+
"debounceTime",
|
|
118
|
+
"defaultData",
|
|
119
|
+
"defaultExpandAllRows",
|
|
120
|
+
"defaultExpandedRowKeys",
|
|
121
|
+
"defaultSize",
|
|
122
|
+
"direction",
|
|
123
|
+
"dropdownPrefixCls",
|
|
124
|
+
"editable",
|
|
125
|
+
"errorBoundaryRender",
|
|
126
|
+
"expandIcon",
|
|
127
|
+
"expandIconColumnIndex",
|
|
128
|
+
"expandRowByClick",
|
|
129
|
+
"expandable",
|
|
130
|
+
"expandedRowClassName",
|
|
131
|
+
"expandedRowKeys",
|
|
132
|
+
"expandedRowRender",
|
|
133
|
+
"form",
|
|
134
|
+
"getContainerWidth",
|
|
135
|
+
"getPopupContainer",
|
|
136
|
+
"ghost",
|
|
137
|
+
"group",
|
|
138
|
+
"headerCell",
|
|
139
|
+
"headerTitle",
|
|
140
|
+
"height",
|
|
141
|
+
"id",
|
|
142
|
+
"indentSize",
|
|
143
|
+
"itemCardProps",
|
|
144
|
+
"itemRender",
|
|
145
|
+
"loading",
|
|
146
|
+
"locale",
|
|
147
|
+
"manualRequest",
|
|
148
|
+
"measureRowRender",
|
|
149
|
+
"name",
|
|
150
|
+
"onChange",
|
|
151
|
+
"onDataSourceChange",
|
|
152
|
+
"onExpand",
|
|
153
|
+
"onExpandedRowsChange",
|
|
154
|
+
"onHeaderRow",
|
|
155
|
+
"onLoad",
|
|
156
|
+
"onLoadingChange",
|
|
157
|
+
"onRequestError",
|
|
158
|
+
"onReset",
|
|
159
|
+
"onRow",
|
|
160
|
+
"onScroll",
|
|
161
|
+
"onSizeChange",
|
|
162
|
+
"onSubmit",
|
|
163
|
+
"options",
|
|
164
|
+
"optionsRender",
|
|
165
|
+
"pagination",
|
|
166
|
+
"params",
|
|
167
|
+
"polling",
|
|
168
|
+
"postData",
|
|
169
|
+
"prefixCls",
|
|
170
|
+
"request",
|
|
171
|
+
"revalidateOnFocus",
|
|
172
|
+
"rootClass",
|
|
173
|
+
"rowClassName",
|
|
174
|
+
"rowHoverable",
|
|
175
|
+
"rowKey",
|
|
176
|
+
"rowSelection",
|
|
177
|
+
"scroll",
|
|
178
|
+
"search",
|
|
179
|
+
"searchFormRender",
|
|
180
|
+
"showHeader",
|
|
181
|
+
"showSorterTooltip",
|
|
182
|
+
"sortDirections",
|
|
183
|
+
"tooltip",
|
|
184
|
+
"sticky",
|
|
185
|
+
"styles",
|
|
186
|
+
"summary",
|
|
187
|
+
"tableAlertOptionRender",
|
|
188
|
+
"tableAlertRender",
|
|
189
|
+
"tableClass",
|
|
190
|
+
"tableExtraRender",
|
|
191
|
+
"tableLayout",
|
|
192
|
+
"tableRender",
|
|
193
|
+
"tableStyle",
|
|
194
|
+
"tableViewRender",
|
|
195
|
+
"tailor",
|
|
196
|
+
"title",
|
|
197
|
+
"toolBarRender",
|
|
198
|
+
"toolbar",
|
|
199
|
+
"type",
|
|
200
|
+
"virtual",
|
|
201
|
+
"onItem",
|
|
202
|
+
"size",
|
|
203
|
+
"classes",
|
|
204
|
+
"styles",
|
|
205
|
+
"loadMore"
|
|
206
|
+
]
|
|
207
|
+
});
|
|
208
|
+
//#endregion
|
|
209
|
+
export { InternalProListy as default };
|