tiddy 2.5.1 → 2.6.0
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/index.css +9 -1
- package/dist/index.d.ts +115 -58
- package/dist/index.js +62 -4
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
|
|
2
|
+
.td-form-item[data-v-2fcd0e45] {
|
|
3
|
+
transition: margin-bottom 0.3s;
|
|
4
|
+
}
|
|
5
|
+
.td-form-item__error-oneline[data-v-2fcd0e45] {
|
|
6
|
+
white-space: nowrap;
|
|
7
|
+
}
|
|
2
8
|
.el-form-item .el-form-item[data-v-2fcd0e45] {
|
|
3
9
|
margin-bottom: 18px;
|
|
4
10
|
}
|
|
@@ -8,6 +14,9 @@
|
|
|
8
14
|
.el-form-item.layout-form-item[data-v-2fcd0e45] {
|
|
9
15
|
margin-bottom: 0;
|
|
10
16
|
}
|
|
17
|
+
.el-form-item.layout-form-item[data-v-2fcd0e45] > .el-form-item__content {
|
|
18
|
+
align-items: flex-start;
|
|
19
|
+
}
|
|
11
20
|
.el-form-item.is-required.hide-asterisk.asterisk-left[data-v-2fcd0e45] > .el-form-item__label::before {
|
|
12
21
|
content: '';
|
|
13
22
|
}
|
|
@@ -16,7 +25,6 @@
|
|
|
16
25
|
}
|
|
17
26
|
|
|
18
27
|
|
|
19
|
-
|
|
20
28
|
.list-row[data-v-65f5c13c] {
|
|
21
29
|
display: flex;
|
|
22
30
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { AllowedComponentProps, CSSProperties, Component, ComputedRef, DefineComponent, ExtractPublicPropTypes, HTMLAttributes, PropType, Raw, Ref, Slot } from "vue";
|
|
1
|
+
import * as vue27 from "vue";
|
|
2
|
+
import { AllowedComponentProps, CSSProperties, Component, ComputedRef, DefineComponent, Directive, ExtractPublicPropTypes, HTMLAttributes, PropType, Raw, Ref, Slot } from "vue";
|
|
3
3
|
import * as element_plus0 from "element-plus";
|
|
4
4
|
import { DialogInstance, DialogProps, FormInstance, FormItemProp, FormItemProps, FormItemRule, FormProps, SelectInstance, TableColumnInstance, TableInstance } from "element-plus";
|
|
5
5
|
|
|
@@ -242,6 +242,10 @@ declare const tdformItemProps: {
|
|
|
242
242
|
type: PropType<boolean>;
|
|
243
243
|
default: boolean;
|
|
244
244
|
};
|
|
245
|
+
errorLayout: {
|
|
246
|
+
type: PropType<"nowrap" | "wrap" | "expand">;
|
|
247
|
+
default: string;
|
|
248
|
+
};
|
|
245
249
|
};
|
|
246
250
|
type TdFormItemProps = ExtractPublicPropTypes<typeof tdformItemProps> & Partial<FormItemProps>;
|
|
247
251
|
type PropsOrRef<T> = { [K in keyof T]?: OrRef<T[K]> } | Ref<T>;
|
|
@@ -256,7 +260,7 @@ declare function isValidateError(prop: string): boolean;
|
|
|
256
260
|
declare const expose$1: {
|
|
257
261
|
reValidateErrorFields: typeof reValidateErrorFields;
|
|
258
262
|
isValidateError: typeof isValidateError;
|
|
259
|
-
model:
|
|
263
|
+
model: vue27.ComputedRef<unknown>;
|
|
260
264
|
};
|
|
261
265
|
type __TdFormExpose = typeof expose$1 & FormInstance;
|
|
262
266
|
declare var __VLS_11$2: {}, __VLS_13$1: {}, __VLS_19$1: {};
|
|
@@ -267,24 +271,24 @@ type __VLS_Slots$4 = {} & {
|
|
|
267
271
|
} & {
|
|
268
272
|
suffix?: (props: typeof __VLS_19$1) => any;
|
|
269
273
|
};
|
|
270
|
-
declare const __VLS_base$4:
|
|
274
|
+
declare const __VLS_base$4: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
271
275
|
fields: {
|
|
272
|
-
type:
|
|
276
|
+
type: vue27.PropType<TdFormFieldProps[]>;
|
|
273
277
|
default: () => never[];
|
|
274
278
|
};
|
|
275
279
|
item: {
|
|
276
|
-
type:
|
|
280
|
+
type: vue27.PropType<element_plus0.FormItemProps>;
|
|
277
281
|
default: () => {};
|
|
278
282
|
};
|
|
279
|
-
}>, __TdFormExpose, {}, {}, {},
|
|
283
|
+
}>, __TdFormExpose, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {
|
|
280
284
|
submit: (data: any) => any;
|
|
281
|
-
}, string,
|
|
285
|
+
}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
282
286
|
fields: {
|
|
283
|
-
type:
|
|
287
|
+
type: vue27.PropType<TdFormFieldProps[]>;
|
|
284
288
|
default: () => never[];
|
|
285
289
|
};
|
|
286
290
|
item: {
|
|
287
|
-
type:
|
|
291
|
+
type: vue27.PropType<element_plus0.FormItemProps>;
|
|
288
292
|
default: () => {};
|
|
289
293
|
};
|
|
290
294
|
}>> & Readonly<{
|
|
@@ -292,9 +296,9 @@ declare const __VLS_base$4: vue14.DefineComponent<vue14.ExtractPropTypes<{
|
|
|
292
296
|
}>, {
|
|
293
297
|
fields: TdFormFieldProps[];
|
|
294
298
|
item: element_plus0.FormItemProps;
|
|
295
|
-
}, {}, {}, {}, string,
|
|
299
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
296
300
|
declare const __VLS_export$6: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
|
|
297
|
-
declare const _default$
|
|
301
|
+
declare const _default$3: typeof __VLS_export$6;
|
|
298
302
|
type __VLS_WithSlots$4<T, S> = T & {
|
|
299
303
|
new (): {
|
|
300
304
|
$slots: S;
|
|
@@ -304,39 +308,48 @@ type __VLS_WithSlots$4<T, S> = T & {
|
|
|
304
308
|
//#region src/form/form-item.vue.d.ts
|
|
305
309
|
declare var __VLS_10$1: string | number, __VLS_11$1: any;
|
|
306
310
|
type __VLS_Slots$3 = {} & { [K in NonNullable<typeof __VLS_10$1>]?: (props: typeof __VLS_11$1) => any };
|
|
307
|
-
declare const __VLS_base$3:
|
|
311
|
+
declare const __VLS_base$3: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
308
312
|
messageLabel: {
|
|
309
|
-
type:
|
|
313
|
+
type: vue27.PropType<OrRef<string>>;
|
|
310
314
|
default: string;
|
|
311
315
|
};
|
|
312
316
|
formatMessage: {
|
|
313
|
-
type:
|
|
317
|
+
type: vue27.PropType<AnyFunction>;
|
|
314
318
|
default: null;
|
|
315
319
|
};
|
|
316
320
|
hideRequiredAsterisk: {
|
|
317
|
-
type:
|
|
321
|
+
type: vue27.PropType<boolean>;
|
|
318
322
|
default: boolean;
|
|
319
323
|
};
|
|
320
|
-
|
|
324
|
+
errorLayout: {
|
|
325
|
+
type: vue27.PropType<"nowrap" | "wrap" | "expand">;
|
|
326
|
+
default: string;
|
|
327
|
+
};
|
|
328
|
+
}>, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
321
329
|
messageLabel: {
|
|
322
|
-
type:
|
|
330
|
+
type: vue27.PropType<OrRef<string>>;
|
|
323
331
|
default: string;
|
|
324
332
|
};
|
|
325
333
|
formatMessage: {
|
|
326
|
-
type:
|
|
334
|
+
type: vue27.PropType<AnyFunction>;
|
|
327
335
|
default: null;
|
|
328
336
|
};
|
|
329
337
|
hideRequiredAsterisk: {
|
|
330
|
-
type:
|
|
338
|
+
type: vue27.PropType<boolean>;
|
|
331
339
|
default: boolean;
|
|
332
340
|
};
|
|
341
|
+
errorLayout: {
|
|
342
|
+
type: vue27.PropType<"nowrap" | "wrap" | "expand">;
|
|
343
|
+
default: string;
|
|
344
|
+
};
|
|
333
345
|
}>> & Readonly<{}>, {
|
|
334
346
|
hideRequiredAsterisk: boolean;
|
|
335
347
|
messageLabel: OrRef<string>;
|
|
336
348
|
formatMessage: AnyFunction;
|
|
337
|
-
|
|
349
|
+
errorLayout: "wrap" | "nowrap" | "expand";
|
|
350
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
338
351
|
declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
|
|
339
|
-
declare const _default$
|
|
352
|
+
declare const _default$5: typeof __VLS_export$5;
|
|
340
353
|
type __VLS_WithSlots$3<T, S> = T & {
|
|
341
354
|
new (): {
|
|
342
355
|
$slots: S;
|
|
@@ -344,13 +357,13 @@ type __VLS_WithSlots$3<T, S> = T & {
|
|
|
344
357
|
};
|
|
345
358
|
//#endregion
|
|
346
359
|
//#region src/form/form-field.vue.d.ts
|
|
347
|
-
declare const __VLS_export$4:
|
|
348
|
-
declare const _default$
|
|
360
|
+
declare const __VLS_export$4: vue27.DefineComponent<{}, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
361
|
+
declare const _default$4: typeof __VLS_export$4;
|
|
349
362
|
//#endregion
|
|
350
363
|
//#region src/form/index.d.ts
|
|
351
|
-
type Instance$2 = InstanceType<typeof _default$
|
|
364
|
+
type Instance$2 = InstanceType<typeof _default$3>;
|
|
352
365
|
type TdFormInstance = Instance$2 & Omit<FormInstance, keyof Instance$2>;
|
|
353
|
-
type TdFormItemInstance = InstanceType<typeof _default$
|
|
366
|
+
type TdFormItemInstance = InstanceType<typeof _default$5>;
|
|
354
367
|
//#endregion
|
|
355
368
|
//#region src/table/utils.d.ts
|
|
356
369
|
type TableColumnProp = {
|
|
@@ -392,21 +405,21 @@ type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof
|
|
|
392
405
|
} & {
|
|
393
406
|
after?: (props: typeof __VLS_19) => any;
|
|
394
407
|
};
|
|
395
|
-
declare const __VLS_base$2:
|
|
408
|
+
declare const __VLS_base$2: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
396
409
|
columns: {
|
|
397
|
-
type:
|
|
410
|
+
type: vue27.PropType<TdTableColumnProps[]>;
|
|
398
411
|
default: () => never[];
|
|
399
412
|
};
|
|
400
|
-
}>, TableInstance, {}, {}, {},
|
|
413
|
+
}>, TableInstance, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
401
414
|
columns: {
|
|
402
|
-
type:
|
|
415
|
+
type: vue27.PropType<TdTableColumnProps[]>;
|
|
403
416
|
default: () => never[];
|
|
404
417
|
};
|
|
405
418
|
}>> & Readonly<{}>, {
|
|
406
419
|
columns: TdTableColumnProps[];
|
|
407
|
-
}, {}, {}, {}, string,
|
|
420
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
408
421
|
declare const __VLS_export$3: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
|
|
409
|
-
declare const _default$
|
|
422
|
+
declare const _default$6: typeof __VLS_export$3;
|
|
410
423
|
type __VLS_WithSlots$2<T, S> = T & {
|
|
411
424
|
new (): {
|
|
412
425
|
$slots: S;
|
|
@@ -414,59 +427,59 @@ type __VLS_WithSlots$2<T, S> = T & {
|
|
|
414
427
|
};
|
|
415
428
|
//#endregion
|
|
416
429
|
//#region src/table/table-col.vue.d.ts
|
|
417
|
-
declare const __VLS_export$2:
|
|
430
|
+
declare const __VLS_export$2: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
418
431
|
slots: {
|
|
419
|
-
type:
|
|
432
|
+
type: vue27.PropType<OrArray<SlotDef>>;
|
|
420
433
|
default: null;
|
|
421
434
|
};
|
|
422
435
|
columns: {
|
|
423
|
-
type:
|
|
436
|
+
type: vue27.PropType<TdTableColumnProps[]>;
|
|
424
437
|
default: () => never[];
|
|
425
438
|
};
|
|
426
439
|
transform: {
|
|
427
|
-
type:
|
|
440
|
+
type: vue27.PropType<AnyFunction[]>;
|
|
428
441
|
default: () => never[];
|
|
429
442
|
};
|
|
430
443
|
hide: {
|
|
431
|
-
type:
|
|
444
|
+
type: vue27.PropType<boolean | vue27.Ref<boolean>>;
|
|
432
445
|
default: false;
|
|
433
446
|
};
|
|
434
447
|
dangerouslyUseHTMLString: {
|
|
435
|
-
type:
|
|
448
|
+
type: vue27.PropType<boolean | vue27.Ref<boolean>>;
|
|
436
449
|
default: false;
|
|
437
450
|
};
|
|
438
|
-
}>, {}, {}, {}, {},
|
|
451
|
+
}>, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
439
452
|
slots: {
|
|
440
|
-
type:
|
|
453
|
+
type: vue27.PropType<OrArray<SlotDef>>;
|
|
441
454
|
default: null;
|
|
442
455
|
};
|
|
443
456
|
columns: {
|
|
444
|
-
type:
|
|
457
|
+
type: vue27.PropType<TdTableColumnProps[]>;
|
|
445
458
|
default: () => never[];
|
|
446
459
|
};
|
|
447
460
|
transform: {
|
|
448
|
-
type:
|
|
461
|
+
type: vue27.PropType<AnyFunction[]>;
|
|
449
462
|
default: () => never[];
|
|
450
463
|
};
|
|
451
464
|
hide: {
|
|
452
|
-
type:
|
|
465
|
+
type: vue27.PropType<boolean | vue27.Ref<boolean>>;
|
|
453
466
|
default: false;
|
|
454
467
|
};
|
|
455
468
|
dangerouslyUseHTMLString: {
|
|
456
|
-
type:
|
|
469
|
+
type: vue27.PropType<boolean | vue27.Ref<boolean>>;
|
|
457
470
|
default: false;
|
|
458
471
|
};
|
|
459
472
|
}>> & Readonly<{}>, {
|
|
460
|
-
hide: boolean | vue14.Ref<boolean, boolean>;
|
|
461
473
|
slots: OrArray<SlotDef>;
|
|
474
|
+
hide: boolean | vue27.Ref<boolean, boolean>;
|
|
462
475
|
columns: TdTableColumnProps[];
|
|
463
476
|
transform: AnyFunction[];
|
|
464
|
-
dangerouslyUseHTMLString: boolean |
|
|
465
|
-
}, {}, {}, {}, string,
|
|
466
|
-
declare const _default$
|
|
477
|
+
dangerouslyUseHTMLString: boolean | vue27.Ref<boolean, boolean>;
|
|
478
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
479
|
+
declare const _default$7: typeof __VLS_export$2;
|
|
467
480
|
//#endregion
|
|
468
481
|
//#region src/table/index.d.ts
|
|
469
|
-
type Instance$1 = InstanceType<typeof _default$
|
|
482
|
+
type Instance$1 = InstanceType<typeof _default$6>;
|
|
470
483
|
type TdTableInstance = Instance$1 & Omit<TableInstance, keyof Instance$1>;
|
|
471
484
|
//#endregion
|
|
472
485
|
//#region src/dialog/utils.d.ts
|
|
@@ -487,7 +500,7 @@ declare const expose: {
|
|
|
487
500
|
close: typeof close;
|
|
488
501
|
};
|
|
489
502
|
type __TdDialogExpose = typeof expose & DialogInstance;
|
|
490
|
-
declare var __VLS_13: "default" | "
|
|
503
|
+
declare var __VLS_13: "default" | "footer" | "header" | "title", __VLS_14: {
|
|
491
504
|
ok: typeof confirm;
|
|
492
505
|
close: typeof close;
|
|
493
506
|
step: typeof step;
|
|
@@ -495,7 +508,7 @@ declare var __VLS_13: "default" | "title" | "header" | "footer", __VLS_14: {
|
|
|
495
508
|
titleClass?: string | undefined;
|
|
496
509
|
};
|
|
497
510
|
type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
|
|
498
|
-
declare const __VLS_base$1:
|
|
511
|
+
declare const __VLS_base$1: vue27.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
499
512
|
declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
500
513
|
declare const _default: typeof __VLS_export$1;
|
|
501
514
|
type __VLS_WithSlots$1<T, S> = T & {
|
|
@@ -534,9 +547,9 @@ type __VLS_Props = {
|
|
|
534
547
|
};
|
|
535
548
|
declare var __VLS_10: string | number, __VLS_11: any;
|
|
536
549
|
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
|
|
537
|
-
declare const __VLS_base:
|
|
550
|
+
declare const __VLS_base: vue27.DefineComponent<__VLS_Props, SelectInstance, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, false, {}, any>;
|
|
538
551
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
539
|
-
declare const _default$
|
|
552
|
+
declare const _default$2: typeof __VLS_export;
|
|
540
553
|
type __VLS_WithSlots<T, S> = T & {
|
|
541
554
|
new (): {
|
|
542
555
|
$slots: S;
|
|
@@ -544,16 +557,60 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
544
557
|
};
|
|
545
558
|
//#endregion
|
|
546
559
|
//#region src/enum-select/index.d.ts
|
|
547
|
-
type TdEnumSelectInstance = InstanceType<typeof _default$
|
|
560
|
+
type TdEnumSelectInstance = InstanceType<typeof _default$2>;
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region src/dynamic-directive/dynamic-directive.d.ts
|
|
563
|
+
interface DirectiveConfig {
|
|
564
|
+
dir: Directive;
|
|
565
|
+
value?: any;
|
|
566
|
+
arg?: string;
|
|
567
|
+
modifiers?: Record<string, boolean>;
|
|
568
|
+
enable?: boolean;
|
|
569
|
+
}
|
|
570
|
+
declare const _default$1: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
571
|
+
directives: {
|
|
572
|
+
type: () => DirectiveConfig[];
|
|
573
|
+
default: () => never[];
|
|
574
|
+
};
|
|
575
|
+
wrap: {
|
|
576
|
+
type: BooleanConstructor;
|
|
577
|
+
default: boolean;
|
|
578
|
+
};
|
|
579
|
+
tag: {
|
|
580
|
+
type: StringConstructor;
|
|
581
|
+
default: string;
|
|
582
|
+
};
|
|
583
|
+
}>, () => vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
|
|
584
|
+
[key: string]: any;
|
|
585
|
+
}> | vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
|
|
586
|
+
[key: string]: any;
|
|
587
|
+
}>[], {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
588
|
+
directives: {
|
|
589
|
+
type: () => DirectiveConfig[];
|
|
590
|
+
default: () => never[];
|
|
591
|
+
};
|
|
592
|
+
wrap: {
|
|
593
|
+
type: BooleanConstructor;
|
|
594
|
+
default: boolean;
|
|
595
|
+
};
|
|
596
|
+
tag: {
|
|
597
|
+
type: StringConstructor;
|
|
598
|
+
default: string;
|
|
599
|
+
};
|
|
600
|
+
}>> & Readonly<{}>, {
|
|
601
|
+
directives: DirectiveConfig[];
|
|
602
|
+
wrap: boolean;
|
|
603
|
+
tag: string;
|
|
604
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
548
605
|
//#endregion
|
|
549
606
|
//#region src/hooks/use-reuse.d.ts
|
|
550
|
-
declare function useReuse(): (
|
|
607
|
+
declare function useReuse(): (vue27.DefineComponent<{}, () => null, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any> | vue27.DefineComponent<{}, () => vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
|
|
551
608
|
[key: string]: any;
|
|
552
|
-
}>[] | undefined, {}, {}, {},
|
|
553
|
-
[name: string]:
|
|
609
|
+
}>[] | undefined, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any> | vue27.ComputedRef<Readonly<{
|
|
610
|
+
[name: string]: vue27.Slot<any> | undefined;
|
|
554
611
|
}>>)[];
|
|
555
612
|
//#endregion
|
|
556
613
|
//#region src/utils/index.d.ts
|
|
557
614
|
declare function getKey(obj: any): string;
|
|
558
615
|
//#endregion
|
|
559
|
-
export { _default as TdDialog, TdDialogInstance, type TdDialogProps, _default$1 as TdEnumSelect, TdEnumSelectInstance, _default$
|
|
616
|
+
export { _default as TdDialog, TdDialogInstance, type TdDialogProps, _default$1 as TdDynamicDirective, _default$2 as TdEnumSelect, TdEnumSelectInstance, _default$3 as TdForm, _default$4 as TdFormField, type TdFormFieldProps, TdFormInstance, _default$5 as TdFormItem, TdFormItemInstance, type TdFormProps, _default$6 as TdTable, _default$7 as TdTableCol, type TdTableColumnProps, TdTableInstance, type TdTableProps, clearEnum, formPropsDef, getEnum, getKey, resetEnum, setDefaultEnumFetch, tableColumnPropsDef, tablePropsDef, useReuse, widget };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, isRef, markRaw, mergeProps, normalizeClass, normalizeProps, normalizeStyle, onMounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toRaw, toRef, unref, useAttrs, useSlots, useTemplateRef, withCtx, withModifiers } from "vue";
|
|
1
|
+
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeProps, normalizeClass, normalizeProps, normalizeStyle, onMounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toRaw, toRef, unref, useAttrs, useSlots, useTemplateRef, withCtx, withDirectives, withModifiers } from "vue";
|
|
2
2
|
import { ElDialog, ElForm, ElFormItem, ElSelect, ElTable, ElTableColumn, useNamespace } from "element-plus";
|
|
3
3
|
import { cut, ensureArray, getDeepValue, groupBy, isFunction, isNullOrUndef, isObject, isString, pick, setDeepValue, toCamelCase, toKebabCase, uid } from "yatter";
|
|
4
4
|
|
|
@@ -239,6 +239,10 @@ const tdformItemProps = {
|
|
|
239
239
|
hideRequiredAsterisk: {
|
|
240
240
|
type: Boolean,
|
|
241
241
|
default: false
|
|
242
|
+
},
|
|
243
|
+
errorLayout: {
|
|
244
|
+
type: String,
|
|
245
|
+
default: "wrap"
|
|
242
246
|
}
|
|
243
247
|
};
|
|
244
248
|
function widget(c, props) {
|
|
@@ -248,6 +252,44 @@ function widget(c, props) {
|
|
|
248
252
|
};
|
|
249
253
|
}
|
|
250
254
|
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/dynamic-directive/dynamic-directive.ts
|
|
257
|
+
var dynamic_directive_default = defineComponent({
|
|
258
|
+
name: "TdDynamicDirective",
|
|
259
|
+
props: {
|
|
260
|
+
directives: {
|
|
261
|
+
type: Array,
|
|
262
|
+
default: () => []
|
|
263
|
+
},
|
|
264
|
+
wrap: {
|
|
265
|
+
type: Boolean,
|
|
266
|
+
default: false
|
|
267
|
+
},
|
|
268
|
+
tag: {
|
|
269
|
+
type: String,
|
|
270
|
+
default: "div"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
setup(props, { slots }) {
|
|
274
|
+
return () => {
|
|
275
|
+
const children = slots.default?.() ?? [];
|
|
276
|
+
const validChildren = children.filter(isVNode);
|
|
277
|
+
const directives = props.directives.flatMap((d) => {
|
|
278
|
+
if (!(d.enable ?? true)) return [];
|
|
279
|
+
return [[
|
|
280
|
+
d.dir,
|
|
281
|
+
d.value,
|
|
282
|
+
d.arg,
|
|
283
|
+
d.modifiers
|
|
284
|
+
]];
|
|
285
|
+
});
|
|
286
|
+
if (validChildren.length === 1) return withDirectives(validChildren[0], directives);
|
|
287
|
+
if (validChildren.length > 1 && props.wrap) return withDirectives(h(props.tag, null, validChildren), directives);
|
|
288
|
+
return children;
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
|
|
251
293
|
//#endregion
|
|
252
294
|
//#region src/form/form-item.vue?vue&type=script&setup=true&lang.ts
|
|
253
295
|
var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -284,12 +326,28 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
284
326
|
return Reflect.has(formItemRef.value || {}, key);
|
|
285
327
|
}
|
|
286
328
|
}));
|
|
329
|
+
function setFormItemMarginBottom(el) {
|
|
330
|
+
const height = Number.parseFloat(window.getComputedStyle(el).getPropertyValue("height"), 10);
|
|
331
|
+
const marginBottom = `${Math.max(height + 6, 18)}px`;
|
|
332
|
+
el.closest(".td-form-item").style.marginBottom = marginBottom;
|
|
333
|
+
}
|
|
334
|
+
const vErrorLayout = {
|
|
335
|
+
mounted: setFormItemMarginBottom,
|
|
336
|
+
updated: setFormItemMarginBottom
|
|
337
|
+
};
|
|
338
|
+
const directives = computed(() => [{
|
|
339
|
+
dir: vErrorLayout,
|
|
340
|
+
enable: props.errorLayout === "expand"
|
|
341
|
+
}]);
|
|
287
342
|
return (_ctx, _cache) => {
|
|
288
343
|
return openBlock(), createBlock(unref(ElFormItem), mergeProps({
|
|
289
344
|
ref: "formItem",
|
|
290
|
-
class: [{ "hide-asterisk": _ctx.hideRequiredAsterisk }]
|
|
345
|
+
class: [{ "hide-asterisk": _ctx.hideRequiredAsterisk }, "td-form-item"]
|
|
291
346
|
}, itemAttr.value), createSlots({
|
|
292
|
-
error: withCtx((scope) => [
|
|
347
|
+
error: withCtx((scope) => [createVNode(unref(dynamic_directive_default), { directives: directives.value }, {
|
|
348
|
+
default: withCtx(() => [createElementVNode("div", { class: normalizeClass([unref(validateClass), { "td-form-item__error-oneline": _ctx.errorLayout === "nowrap" }]) }, toDisplayString(innerFormatMessage(scope.error)), 3)]),
|
|
349
|
+
_: 2
|
|
350
|
+
}, 1032, ["directives"])]),
|
|
293
351
|
_: 2
|
|
294
352
|
}, [renderList(unref(slots), (_, k) => {
|
|
295
353
|
return {
|
|
@@ -1119,4 +1177,4 @@ function useReuse() {
|
|
|
1119
1177
|
}
|
|
1120
1178
|
|
|
1121
1179
|
//#endregion
|
|
1122
|
-
export { dialog_default as TdDialog, enum_select_default as TdEnumSelect, form_default as TdForm, form_field_default as TdFormField, form_item_default as TdFormItem, table_default as TdTable, table_col_default as TdTableCol, clearEnum, formPropsDef, getEnum, getKey, resetEnum, setDefaultEnumFetch, tableColumnPropsDef, tablePropsDef, useReuse, widget };
|
|
1180
|
+
export { dialog_default as TdDialog, dynamic_directive_default as TdDynamicDirective, enum_select_default as TdEnumSelect, form_default as TdForm, form_field_default as TdFormField, form_item_default as TdFormItem, table_default as TdTable, table_col_default as TdTableCol, clearEnum, formPropsDef, getEnum, getKey, resetEnum, setDefaultEnumFetch, tableColumnPropsDef, tablePropsDef, useReuse, widget };
|