@tmagic/tdesign-vue-next-adapter 1.3.0-alpha.2 → 1.3.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tmagic-tdesign-vue-next-adapter.js +77 -74
- package/dist/tmagic-tdesign-vue-next-adapter.js.map +1 -1
- package/dist/tmagic-tdesign-vue-next-adapter.umd.cjs +77 -74
- package/dist/tmagic-tdesign-vue-next-adapter.umd.cjs.map +1 -1
- package/package.json +10 -8
- package/src/DatePicker.vue +7 -16
- package/src/Input.vue +7 -8
- package/src/Tree.vue +3 -26
- package/src/index.ts +84 -42
package/src/index.ts
CHANGED
|
@@ -42,6 +42,48 @@ import {
|
|
|
42
42
|
Upload as TUpload,
|
|
43
43
|
} from 'tdesign-vue-next';
|
|
44
44
|
|
|
45
|
+
import type {
|
|
46
|
+
BadgeProps,
|
|
47
|
+
ButtonProps,
|
|
48
|
+
CardProps,
|
|
49
|
+
CascaderProps,
|
|
50
|
+
CheckboxGroupProps,
|
|
51
|
+
CheckboxProps,
|
|
52
|
+
CollapseItemProps,
|
|
53
|
+
CollapseProps,
|
|
54
|
+
ColorPickerProps,
|
|
55
|
+
ColProps,
|
|
56
|
+
DatePickerProps,
|
|
57
|
+
DialogProps,
|
|
58
|
+
DrawerProps,
|
|
59
|
+
DropdownItemProps,
|
|
60
|
+
DropdownProps,
|
|
61
|
+
FormItemProps,
|
|
62
|
+
FormProps,
|
|
63
|
+
InputNumberProps,
|
|
64
|
+
InputProps,
|
|
65
|
+
OptionGroupProps,
|
|
66
|
+
OptionProps,
|
|
67
|
+
PaginationProps,
|
|
68
|
+
PopoverProps,
|
|
69
|
+
RadioButtonProps,
|
|
70
|
+
RadioGroupProps,
|
|
71
|
+
RadioProps,
|
|
72
|
+
SelectProps,
|
|
73
|
+
StepProps,
|
|
74
|
+
StepsProps,
|
|
75
|
+
SwitchProps,
|
|
76
|
+
TableColumnProps,
|
|
77
|
+
TableProps,
|
|
78
|
+
TabPaneProps,
|
|
79
|
+
TabsProps,
|
|
80
|
+
TagProps,
|
|
81
|
+
TimePickerProps,
|
|
82
|
+
TooltipProps,
|
|
83
|
+
TreeProps,
|
|
84
|
+
UploadProps,
|
|
85
|
+
} from '@tmagic/design';
|
|
86
|
+
|
|
45
87
|
import DatePicker from './DatePicker.vue';
|
|
46
88
|
import Icon from './Icon.vue';
|
|
47
89
|
import Input from './Input.vue';
|
|
@@ -71,7 +113,7 @@ const adapter: any = {
|
|
|
71
113
|
components: {
|
|
72
114
|
badge: {
|
|
73
115
|
component: TBadge,
|
|
74
|
-
props: (props:
|
|
116
|
+
props: (props: BadgeProps) => ({
|
|
75
117
|
count: props.value,
|
|
76
118
|
dot: props.isDot,
|
|
77
119
|
maxCount: props.max,
|
|
@@ -80,7 +122,7 @@ const adapter: any = {
|
|
|
80
122
|
|
|
81
123
|
button: {
|
|
82
124
|
component: TButton,
|
|
83
|
-
props: (props:
|
|
125
|
+
props: (props: ButtonProps) => ({
|
|
84
126
|
theme: props.type,
|
|
85
127
|
size: props.size === 'default' ? 'medium' : props.size,
|
|
86
128
|
icon: () => (props.icon ? h(props.icon) : null),
|
|
@@ -90,7 +132,7 @@ const adapter: any = {
|
|
|
90
132
|
|
|
91
133
|
card: {
|
|
92
134
|
component: TCard,
|
|
93
|
-
props: (props:
|
|
135
|
+
props: (props: CardProps) => ({
|
|
94
136
|
shadow: props.shadow !== 'never',
|
|
95
137
|
hoverShadow: props.shadow === 'hover',
|
|
96
138
|
header: props.header,
|
|
@@ -99,7 +141,7 @@ const adapter: any = {
|
|
|
99
141
|
|
|
100
142
|
cascader: {
|
|
101
143
|
component: TCascader,
|
|
102
|
-
props: (props:
|
|
144
|
+
props: (props: CascaderProps) => ({
|
|
103
145
|
modelValue: props.modelValue,
|
|
104
146
|
placeholder: props.placeholder,
|
|
105
147
|
disabled: props.disabled,
|
|
@@ -117,7 +159,7 @@ const adapter: any = {
|
|
|
117
159
|
|
|
118
160
|
checkbox: {
|
|
119
161
|
component: TCheckbox,
|
|
120
|
-
props: (props:
|
|
162
|
+
props: (props: CheckboxProps) => ({
|
|
121
163
|
modelValue: props.modelValue,
|
|
122
164
|
label: props.label,
|
|
123
165
|
value: props.value,
|
|
@@ -127,7 +169,7 @@ const adapter: any = {
|
|
|
127
169
|
|
|
128
170
|
checkboxGroup: {
|
|
129
171
|
component: TCheckboxGroup,
|
|
130
|
-
props: (props:
|
|
172
|
+
props: (props: CheckboxGroupProps) => ({
|
|
131
173
|
modelValue: props.modelValue,
|
|
132
174
|
label: props.label,
|
|
133
175
|
disabled: props.disabled,
|
|
@@ -136,14 +178,14 @@ const adapter: any = {
|
|
|
136
178
|
|
|
137
179
|
col: {
|
|
138
180
|
component: TCol,
|
|
139
|
-
props: (props:
|
|
181
|
+
props: (props: ColProps) => ({
|
|
140
182
|
span: props.span,
|
|
141
183
|
}),
|
|
142
184
|
},
|
|
143
185
|
|
|
144
186
|
collapse: {
|
|
145
187
|
component: TCollapse,
|
|
146
|
-
props: (props:
|
|
188
|
+
props: (props: CollapseProps) => ({
|
|
147
189
|
value: props.modelValue,
|
|
148
190
|
expandIconPlacement: 'right',
|
|
149
191
|
}),
|
|
@@ -151,7 +193,7 @@ const adapter: any = {
|
|
|
151
193
|
|
|
152
194
|
collapseItem: {
|
|
153
195
|
component: TCollapsePanel,
|
|
154
|
-
props: (props:
|
|
196
|
+
props: (props: CollapseItemProps) => ({
|
|
155
197
|
value: props.name,
|
|
156
198
|
header: props.title,
|
|
157
199
|
disabled: props.disabled,
|
|
@@ -160,7 +202,7 @@ const adapter: any = {
|
|
|
160
202
|
|
|
161
203
|
colorPicker: {
|
|
162
204
|
component: TColorPicker,
|
|
163
|
-
props: (props:
|
|
205
|
+
props: (props: ColorPickerProps) => ({
|
|
164
206
|
modelValue: props.modelValue,
|
|
165
207
|
disabled: props.disabled,
|
|
166
208
|
size: props.size === 'default' ? 'medium' : props.size,
|
|
@@ -171,12 +213,12 @@ const adapter: any = {
|
|
|
171
213
|
|
|
172
214
|
datePicker: {
|
|
173
215
|
component: DatePicker,
|
|
174
|
-
props: (props:
|
|
216
|
+
props: (props: DatePickerProps) => props,
|
|
175
217
|
},
|
|
176
218
|
|
|
177
219
|
dialog: {
|
|
178
220
|
component: TDialog,
|
|
179
|
-
props: (props:
|
|
221
|
+
props: (props: DialogProps) => ({
|
|
180
222
|
visible: props.modelValue,
|
|
181
223
|
attach: props.appendToBody ? 'body' : '',
|
|
182
224
|
header: props.title,
|
|
@@ -196,7 +238,7 @@ const adapter: any = {
|
|
|
196
238
|
|
|
197
239
|
drawer: {
|
|
198
240
|
component: TDrawer,
|
|
199
|
-
props: (props:
|
|
241
|
+
props: (props: DrawerProps) => ({
|
|
200
242
|
visible: props.modelValue,
|
|
201
243
|
size: props.size,
|
|
202
244
|
closeOnEscKeydown: props.closeOnPressEscape,
|
|
@@ -213,7 +255,7 @@ const adapter: any = {
|
|
|
213
255
|
|
|
214
256
|
dropdown: {
|
|
215
257
|
component: TDropdown,
|
|
216
|
-
props: (props:
|
|
258
|
+
props: (props: DropdownProps) => ({
|
|
217
259
|
maxHeight: props.maxHeight,
|
|
218
260
|
disabled: props.disable,
|
|
219
261
|
direction: props.placement,
|
|
@@ -228,7 +270,7 @@ const adapter: any = {
|
|
|
228
270
|
|
|
229
271
|
dropdownItem: {
|
|
230
272
|
component: TDropdownItem,
|
|
231
|
-
props: (props:
|
|
273
|
+
props: (props: DropdownItemProps) => ({
|
|
232
274
|
disabled: props.disabled,
|
|
233
275
|
divider: props.divided,
|
|
234
276
|
prefixIcon: props.icon && (() => h(props.icon)),
|
|
@@ -238,12 +280,12 @@ const adapter: any = {
|
|
|
238
280
|
|
|
239
281
|
dropdownMenu: {
|
|
240
282
|
component: TDropdown,
|
|
241
|
-
props: (
|
|
283
|
+
props: () => ({}),
|
|
242
284
|
},
|
|
243
285
|
|
|
244
286
|
form: {
|
|
245
287
|
component: TForm,
|
|
246
|
-
props: (props:
|
|
288
|
+
props: (props: FormProps) => ({
|
|
247
289
|
data: props.model,
|
|
248
290
|
labelWidth: props.labelWidth,
|
|
249
291
|
disabled: props.disabled,
|
|
@@ -254,7 +296,7 @@ const adapter: any = {
|
|
|
254
296
|
|
|
255
297
|
formItem: {
|
|
256
298
|
component: TFormItem,
|
|
257
|
-
props: (props:
|
|
299
|
+
props: (props: FormItemProps) => ({
|
|
258
300
|
labelWidth: props.labelWidth,
|
|
259
301
|
name: props.prop,
|
|
260
302
|
rules: props.rules,
|
|
@@ -263,17 +305,17 @@ const adapter: any = {
|
|
|
263
305
|
|
|
264
306
|
icon: {
|
|
265
307
|
component: Icon,
|
|
266
|
-
props: (
|
|
308
|
+
props: () => ({}),
|
|
267
309
|
},
|
|
268
310
|
|
|
269
311
|
input: {
|
|
270
312
|
component: Input,
|
|
271
|
-
props: (props:
|
|
313
|
+
props: (props: InputProps) => props,
|
|
272
314
|
},
|
|
273
315
|
|
|
274
316
|
inputNumber: {
|
|
275
317
|
component: TInputNumber,
|
|
276
|
-
props: (props:
|
|
318
|
+
props: (props: InputNumberProps) => ({
|
|
277
319
|
modelValue: props.modelValue,
|
|
278
320
|
align: props.controlsPosition,
|
|
279
321
|
disabled: props.disabled,
|
|
@@ -287,7 +329,7 @@ const adapter: any = {
|
|
|
287
329
|
|
|
288
330
|
option: {
|
|
289
331
|
component: TOption,
|
|
290
|
-
props: (props:
|
|
332
|
+
props: (props: OptionProps) => ({
|
|
291
333
|
value: props.value,
|
|
292
334
|
label: props.label,
|
|
293
335
|
disabled: props.disabled,
|
|
@@ -296,12 +338,12 @@ const adapter: any = {
|
|
|
296
338
|
|
|
297
339
|
optionGroup: {
|
|
298
340
|
component: TOptionGroup,
|
|
299
|
-
props: (props:
|
|
341
|
+
props: (props: OptionGroupProps) => props,
|
|
300
342
|
},
|
|
301
343
|
|
|
302
344
|
pagination: {
|
|
303
345
|
component: TPagination,
|
|
304
|
-
props: (props:
|
|
346
|
+
props: (props: PaginationProps) => ({
|
|
305
347
|
current: props.curPage,
|
|
306
348
|
pageSizeOptions: props.pageSizes,
|
|
307
349
|
pageSize: props.pagesize,
|
|
@@ -311,7 +353,7 @@ const adapter: any = {
|
|
|
311
353
|
|
|
312
354
|
popover: {
|
|
313
355
|
component: TPopup,
|
|
314
|
-
props: (props:
|
|
356
|
+
props: (props: PopoverProps) => ({
|
|
315
357
|
placement: props.placement,
|
|
316
358
|
trigger: props.trigger,
|
|
317
359
|
content: props.content,
|
|
@@ -322,21 +364,21 @@ const adapter: any = {
|
|
|
322
364
|
|
|
323
365
|
radio: {
|
|
324
366
|
component: TRadio,
|
|
325
|
-
props: (props:
|
|
367
|
+
props: (props: RadioProps) => ({
|
|
326
368
|
label: props.label,
|
|
327
369
|
}),
|
|
328
370
|
},
|
|
329
371
|
|
|
330
372
|
radioButton: {
|
|
331
373
|
component: TRadioButton,
|
|
332
|
-
props: (props:
|
|
374
|
+
props: (props: RadioButtonProps) => ({
|
|
333
375
|
label: props.label,
|
|
334
376
|
}),
|
|
335
377
|
},
|
|
336
378
|
|
|
337
379
|
radioGroup: {
|
|
338
380
|
component: TRadioGroup,
|
|
339
|
-
props: (props:
|
|
381
|
+
props: (props: RadioGroupProps) => ({
|
|
340
382
|
modelValue: props.modelValue,
|
|
341
383
|
disabled: props.disabled,
|
|
342
384
|
size: props.size === 'default' ? 'medium' : props.size,
|
|
@@ -349,12 +391,12 @@ const adapter: any = {
|
|
|
349
391
|
|
|
350
392
|
scrollbar: {
|
|
351
393
|
component: Scrollbar,
|
|
352
|
-
props: (
|
|
394
|
+
props: () => ({}),
|
|
353
395
|
},
|
|
354
396
|
|
|
355
397
|
select: {
|
|
356
398
|
component: TSelect,
|
|
357
|
-
props: (props:
|
|
399
|
+
props: (props: SelectProps) => ({
|
|
358
400
|
modelValue: props.modelValue,
|
|
359
401
|
clearable: props.clearable,
|
|
360
402
|
filterable: props.filterable,
|
|
@@ -372,7 +414,7 @@ const adapter: any = {
|
|
|
372
414
|
|
|
373
415
|
step: {
|
|
374
416
|
component: TStepItem,
|
|
375
|
-
props: (props:
|
|
417
|
+
props: (props: StepProps) => ({
|
|
376
418
|
title: props.props,
|
|
377
419
|
value: props.status,
|
|
378
420
|
}),
|
|
@@ -380,14 +422,14 @@ const adapter: any = {
|
|
|
380
422
|
|
|
381
423
|
steps: {
|
|
382
424
|
component: TSteps,
|
|
383
|
-
props: (props:
|
|
425
|
+
props: (props: StepsProps) => ({
|
|
384
426
|
current: props.active,
|
|
385
427
|
}),
|
|
386
428
|
},
|
|
387
429
|
|
|
388
430
|
switch: {
|
|
389
431
|
component: TSwitch,
|
|
390
|
-
props: (props:
|
|
432
|
+
props: (props: SwitchProps) => ({
|
|
391
433
|
modelValue: props.modelValue,
|
|
392
434
|
disabled: props.disabled,
|
|
393
435
|
label: props.label,
|
|
@@ -398,17 +440,17 @@ const adapter: any = {
|
|
|
398
440
|
|
|
399
441
|
table: {
|
|
400
442
|
component: TTable,
|
|
401
|
-
props: (props:
|
|
443
|
+
props: (props: TableProps) => props,
|
|
402
444
|
},
|
|
403
445
|
|
|
404
446
|
tableColumn: {
|
|
405
447
|
component: TableColumn,
|
|
406
|
-
props: (props:
|
|
448
|
+
props: (props: TableColumnProps) => props,
|
|
407
449
|
},
|
|
408
450
|
|
|
409
451
|
tabPane: {
|
|
410
452
|
component: TTabPanel,
|
|
411
|
-
props: (props:
|
|
453
|
+
props: (props: TabPaneProps) => ({
|
|
412
454
|
label: props.label,
|
|
413
455
|
value: props.name,
|
|
414
456
|
}),
|
|
@@ -416,7 +458,7 @@ const adapter: any = {
|
|
|
416
458
|
|
|
417
459
|
tabs: {
|
|
418
460
|
component: TTabs,
|
|
419
|
-
props: (props:
|
|
461
|
+
props: (props: TabsProps) => ({
|
|
420
462
|
addable: props.editable,
|
|
421
463
|
theme: props.type === 'card' ? 'card' : 'normal',
|
|
422
464
|
placement: props.tabPosition,
|
|
@@ -426,14 +468,14 @@ const adapter: any = {
|
|
|
426
468
|
|
|
427
469
|
tag: {
|
|
428
470
|
component: TTag,
|
|
429
|
-
props: (props:
|
|
471
|
+
props: (props: TagProps) => ({
|
|
430
472
|
theme: props.type ? props.type : 'default',
|
|
431
473
|
}),
|
|
432
474
|
},
|
|
433
475
|
|
|
434
476
|
timePicker: {
|
|
435
477
|
component: TTimePicker,
|
|
436
|
-
props: (props:
|
|
478
|
+
props: (props: TimePickerProps) => ({
|
|
437
479
|
modelValue: props.modelValue,
|
|
438
480
|
disabled: props.disabled,
|
|
439
481
|
size: props.size === 'default' ? 'medium' : props.size,
|
|
@@ -443,7 +485,7 @@ const adapter: any = {
|
|
|
443
485
|
|
|
444
486
|
tooltip: {
|
|
445
487
|
component: TTooltip,
|
|
446
|
-
props: (props:
|
|
488
|
+
props: (props: TooltipProps) => ({
|
|
447
489
|
placement: props.placement,
|
|
448
490
|
content: props.content,
|
|
449
491
|
}),
|
|
@@ -451,7 +493,7 @@ const adapter: any = {
|
|
|
451
493
|
|
|
452
494
|
tree: {
|
|
453
495
|
component: Tree,
|
|
454
|
-
props: (props:
|
|
496
|
+
props: (props: TreeProps) => ({
|
|
455
497
|
...props,
|
|
456
498
|
data: props.data,
|
|
457
499
|
draggable: props.draggable,
|
|
@@ -477,7 +519,7 @@ const adapter: any = {
|
|
|
477
519
|
|
|
478
520
|
upload: {
|
|
479
521
|
component: TUpload,
|
|
480
|
-
props: (props:
|
|
522
|
+
props: (props: UploadProps) => ({
|
|
481
523
|
action: props.action,
|
|
482
524
|
disabled: props.disabled,
|
|
483
525
|
autoUpload: props.autoUpload,
|