tiddy 2.5.0 → 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 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 vue69 from "vue";
2
- import { AllowedComponentProps, CSSProperties, Component, ComputedRef, DefineComponent, ExtractPublicPropTypes, HTMLAttributes, PropType, Raw, Ref as Ref$1, 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
 
@@ -128,7 +128,7 @@ declare const widgetFieldPropsDef: {
128
128
  default: undefined;
129
129
  };
130
130
  };
131
- type PropsOf<C> = C extends DefineComponent<infer P, any, any, any, any> ? P : C extends (new (...args: any) => any) ? InstanceType<C> extends {
131
+ type PropsOf<C> = C extends (new (...args: any[]) => any) ? InstanceType<C>['$props'] : C extends DefineComponent<any, any, any, any, any, any, any, any> ? InstanceType<C> extends {
132
132
  $props: infer P;
133
133
  } ? P : Record<string, any> : Record<string, any>;
134
134
  type TdWidgetFieldProps = ExtractPublicPropTypes<typeof widgetFieldPropsDef> & AllowedComponentProps & Record<PropertyKey, any>;
@@ -242,9 +242,13 @@ 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
- type PropsOrRef<T> = { [K in keyof T]?: OrRef<T[K]> } | Ref$1<T>;
251
+ type PropsOrRef<T> = { [K in keyof T]?: OrRef<T[K]> } | Ref<T>;
248
252
  declare function widget<T>(c: T | Raw<T>, props?: PropsOrRef<PropsOf<T> & HTMLAttributes>): {
249
253
  component: T | Raw<T>;
250
254
  widget: PropsOrRef<PropsOf<T> & HTMLAttributes> | undefined;
@@ -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: vue69.ComputedRef<unknown>;
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: vue69.DefineComponent<vue69.ExtractPropTypes<{
274
+ declare const __VLS_base$4: vue27.DefineComponent<vue27.ExtractPropTypes<{
271
275
  fields: {
272
- type: vue69.PropType<TdFormFieldProps[]>;
276
+ type: vue27.PropType<TdFormFieldProps[]>;
273
277
  default: () => never[];
274
278
  };
275
279
  item: {
276
- type: vue69.PropType<element_plus0.FormItemProps>;
280
+ type: vue27.PropType<element_plus0.FormItemProps>;
277
281
  default: () => {};
278
282
  };
279
- }>, __TdFormExpose, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {
283
+ }>, __TdFormExpose, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {
280
284
  submit: (data: any) => any;
281
- }, string, vue69.PublicProps, Readonly<vue69.ExtractPropTypes<{
285
+ }, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
282
286
  fields: {
283
- type: vue69.PropType<TdFormFieldProps[]>;
287
+ type: vue27.PropType<TdFormFieldProps[]>;
284
288
  default: () => never[];
285
289
  };
286
290
  item: {
287
- type: vue69.PropType<element_plus0.FormItemProps>;
291
+ type: vue27.PropType<element_plus0.FormItemProps>;
288
292
  default: () => {};
289
293
  };
290
294
  }>> & Readonly<{
@@ -292,9 +296,9 @@ declare const __VLS_base$4: vue69.DefineComponent<vue69.ExtractPropTypes<{
292
296
  }>, {
293
297
  fields: TdFormFieldProps[];
294
298
  item: element_plus0.FormItemProps;
295
- }, {}, {}, {}, string, vue69.ComponentProvideOptions, true, {}, any>;
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$2: typeof __VLS_export$6;
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: vue69.DefineComponent<vue69.ExtractPropTypes<{
311
+ declare const __VLS_base$3: vue27.DefineComponent<vue27.ExtractPropTypes<{
308
312
  messageLabel: {
309
- type: vue69.PropType<OrRef<string>>;
313
+ type: vue27.PropType<OrRef<string>>;
310
314
  default: string;
311
315
  };
312
316
  formatMessage: {
313
- type: vue69.PropType<AnyFunction>;
317
+ type: vue27.PropType<AnyFunction>;
314
318
  default: null;
315
319
  };
316
320
  hideRequiredAsterisk: {
317
- type: vue69.PropType<boolean>;
321
+ type: vue27.PropType<boolean>;
318
322
  default: boolean;
319
323
  };
320
- }>, {}, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {}, string, vue69.PublicProps, Readonly<vue69.ExtractPropTypes<{
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: vue69.PropType<OrRef<string>>;
330
+ type: vue27.PropType<OrRef<string>>;
323
331
  default: string;
324
332
  };
325
333
  formatMessage: {
326
- type: vue69.PropType<AnyFunction>;
334
+ type: vue27.PropType<AnyFunction>;
327
335
  default: null;
328
336
  };
329
337
  hideRequiredAsterisk: {
330
- type: vue69.PropType<boolean>;
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
- messageLabel: any;
347
+ messageLabel: OrRef<string>;
336
348
  formatMessage: AnyFunction;
337
- }, {}, {}, {}, string, vue69.ComponentProvideOptions, true, {}, any>;
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$4: typeof __VLS_export$5;
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: vue69.DefineComponent<{}, {}, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {}, string, vue69.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue69.ComponentProvideOptions, true, {}, any>;
348
- declare const _default$3: typeof __VLS_export$4;
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$2>;
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$4>;
366
+ type TdFormItemInstance = InstanceType<typeof _default$5>;
354
367
  //#endregion
355
368
  //#region src/table/utils.d.ts
356
369
  type TableColumnProp = {
@@ -367,11 +380,11 @@ type TableColumnProp = {
367
380
  default: () => never[];
368
381
  };
369
382
  hide: {
370
- type: PropType<boolean | Ref$1<boolean>>;
383
+ type: PropType<boolean | Ref<boolean>>;
371
384
  default: false;
372
385
  };
373
386
  dangerouslyUseHTMLString: {
374
- type: PropType<boolean | Ref$1<boolean>>;
387
+ type: PropType<boolean | Ref<boolean>>;
375
388
  default: false;
376
389
  };
377
390
  };
@@ -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: vue69.DefineComponent<vue69.ExtractPropTypes<{
408
+ declare const __VLS_base$2: vue27.DefineComponent<vue27.ExtractPropTypes<{
396
409
  columns: {
397
- type: vue69.PropType<TdTableColumnProps[]>;
410
+ type: vue27.PropType<TdTableColumnProps[]>;
398
411
  default: () => never[];
399
412
  };
400
- }>, TableInstance, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {}, string, vue69.PublicProps, Readonly<vue69.ExtractPropTypes<{
413
+ }>, TableInstance, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
401
414
  columns: {
402
- type: vue69.PropType<TdTableColumnProps[]>;
415
+ type: vue27.PropType<TdTableColumnProps[]>;
403
416
  default: () => never[];
404
417
  };
405
418
  }>> & Readonly<{}>, {
406
419
  columns: TdTableColumnProps[];
407
- }, {}, {}, {}, string, vue69.ComponentProvideOptions, true, {}, any>;
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$5: typeof __VLS_export$3;
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: vue69.DefineComponent<vue69.ExtractPropTypes<{
430
+ declare const __VLS_export$2: vue27.DefineComponent<vue27.ExtractPropTypes<{
418
431
  slots: {
419
- type: vue69.PropType<OrArray<SlotDef>>;
432
+ type: vue27.PropType<OrArray<SlotDef>>;
420
433
  default: null;
421
434
  };
422
435
  columns: {
423
- type: vue69.PropType<TdTableColumnProps[]>;
436
+ type: vue27.PropType<TdTableColumnProps[]>;
424
437
  default: () => never[];
425
438
  };
426
439
  transform: {
427
- type: vue69.PropType<AnyFunction[]>;
440
+ type: vue27.PropType<AnyFunction[]>;
428
441
  default: () => never[];
429
442
  };
430
443
  hide: {
431
- type: vue69.PropType<boolean | vue69.Ref<boolean>>;
444
+ type: vue27.PropType<boolean | vue27.Ref<boolean>>;
432
445
  default: false;
433
446
  };
434
447
  dangerouslyUseHTMLString: {
435
- type: vue69.PropType<boolean | vue69.Ref<boolean>>;
448
+ type: vue27.PropType<boolean | vue27.Ref<boolean>>;
436
449
  default: false;
437
450
  };
438
- }>, {}, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {}, string, vue69.PublicProps, Readonly<vue69.ExtractPropTypes<{
451
+ }>, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
439
452
  slots: {
440
- type: vue69.PropType<OrArray<SlotDef>>;
453
+ type: vue27.PropType<OrArray<SlotDef>>;
441
454
  default: null;
442
455
  };
443
456
  columns: {
444
- type: vue69.PropType<TdTableColumnProps[]>;
457
+ type: vue27.PropType<TdTableColumnProps[]>;
445
458
  default: () => never[];
446
459
  };
447
460
  transform: {
448
- type: vue69.PropType<AnyFunction[]>;
461
+ type: vue27.PropType<AnyFunction[]>;
449
462
  default: () => never[];
450
463
  };
451
464
  hide: {
452
- type: vue69.PropType<boolean | vue69.Ref<boolean>>;
465
+ type: vue27.PropType<boolean | vue27.Ref<boolean>>;
453
466
  default: false;
454
467
  };
455
468
  dangerouslyUseHTMLString: {
456
- type: vue69.PropType<boolean | vue69.Ref<boolean>>;
469
+ type: vue27.PropType<boolean | vue27.Ref<boolean>>;
457
470
  default: false;
458
471
  };
459
472
  }>> & Readonly<{}>, {
460
473
  slots: OrArray<SlotDef>;
474
+ hide: boolean | vue27.Ref<boolean, boolean>;
461
475
  columns: TdTableColumnProps[];
462
476
  transform: AnyFunction[];
463
- hide: boolean | vue69.Ref<boolean, boolean>;
464
- dangerouslyUseHTMLString: boolean | vue69.Ref<boolean, boolean>;
465
- }, {}, {}, {}, string, vue69.ComponentProvideOptions, true, {}, any>;
466
- declare const _default$6: typeof __VLS_export$2;
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$5>;
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" | "title" | "header" | "footer", __VLS_14: {
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: vue69.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {}, string, vue69.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue69.ComponentProvideOptions, true, {}, any>;
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: vue69.DefineComponent<__VLS_Props, SelectInstance, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {}, string, vue69.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue69.ComponentProvideOptions, false, {}, any>;
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$1: typeof __VLS_export;
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$1>;
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(): (vue69.DefineComponent<{}, () => null, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {}, string, vue69.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue69.ComponentProvideOptions, true, {}, any> | vue69.DefineComponent<{}, () => vue69.VNode<vue69.RendererNode, vue69.RendererElement, {
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, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {}, string, vue69.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue69.ComponentProvideOptions, true, {}, any> | vue69.ComputedRef<Readonly<{
553
- [name: string]: vue69.Slot<any> | undefined;
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$2 as TdForm, _default$3 as TdFormField, type TdFormFieldProps, TdFormInstance, _default$4 as TdFormItem, TdFormItemInstance, type TdFormProps, _default$5 as TdTable, _default$6 as TdTableCol, type TdTableColumnProps, TdTableInstance, type TdTableProps, clearEnum, formPropsDef, getEnum, getKey, resetEnum, setDefaultEnumFetch, tableColumnPropsDef, tablePropsDef, useReuse, widget };
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) => [createElementVNode("div", { class: normalizeClass(unref(validateClass)) }, toDisplayString(innerFormatMessage(scope.error)), 3)]),
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiddy",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "packageManager": "pnpm@10.11.0",
5
5
  "description": "A set of Vue 3 components based on element-plus",
6
6
  "type": "module",
@@ -30,6 +30,7 @@
30
30
  "play": "vite",
31
31
  "test": "vitest",
32
32
  "type": "vue-tsc --noEmit",
33
+ "pretype": "pnpm run build",
33
34
  "format": "biome format --write .",
34
35
  "prepublishOnly": "pnpm run build",
35
36
  "docs:dev": "vitepress dev docs",