tiddy 2.7.0 → 2.8.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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as vue27 from "vue";
1
+ import * as vue47 from "vue";
2
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";
@@ -162,6 +162,10 @@ declare const arrayFieldPropsDef: {
162
162
  rawValue: {
163
163
  type: PropType<AnyFunction>;
164
164
  };
165
+ slotProp: {
166
+ type: StringConstructor;
167
+ required: false;
168
+ };
165
169
  outerEmptyAction: {
166
170
  type: PropType<OrArray<SlotDef>>;
167
171
  default: null;
@@ -287,7 +291,7 @@ declare function isValidateError(prop: string): boolean;
287
291
  declare const expose$1: {
288
292
  reValidateErrorFields: typeof reValidateErrorFields;
289
293
  isValidateError: typeof isValidateError;
290
- model: vue27.ComputedRef<unknown>;
294
+ model: vue47.ComputedRef<unknown>;
291
295
  };
292
296
  type __TdFormExpose = typeof expose$1 & FormInstance;
293
297
  declare var __VLS_11$2: {}, __VLS_13$1: {}, __VLS_19$1: {};
@@ -298,24 +302,24 @@ type __VLS_Slots$4 = {} & {
298
302
  } & {
299
303
  suffix?: (props: typeof __VLS_19$1) => any;
300
304
  };
301
- declare const __VLS_base$4: vue27.DefineComponent<vue27.ExtractPropTypes<{
305
+ declare const __VLS_base$4: vue47.DefineComponent<vue47.ExtractPropTypes<{
302
306
  fields: {
303
- type: vue27.PropType<TdFormFieldProps[]>;
307
+ type: vue47.PropType<TdFormFieldProps[]>;
304
308
  default: () => never[];
305
309
  };
306
310
  item: {
307
- type: vue27.PropType<element_plus0.FormItemProps>;
311
+ type: vue47.PropType<element_plus0.FormItemProps>;
308
312
  default: () => {};
309
313
  };
310
- }>, __TdFormExpose, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {
314
+ }>, __TdFormExpose, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {
311
315
  submit: (data: any) => any;
312
- }, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
316
+ }, string, vue47.PublicProps, Readonly<vue47.ExtractPropTypes<{
313
317
  fields: {
314
- type: vue27.PropType<TdFormFieldProps[]>;
318
+ type: vue47.PropType<TdFormFieldProps[]>;
315
319
  default: () => never[];
316
320
  };
317
321
  item: {
318
- type: vue27.PropType<element_plus0.FormItemProps>;
322
+ type: vue47.PropType<element_plus0.FormItemProps>;
319
323
  default: () => {};
320
324
  };
321
325
  }>> & Readonly<{
@@ -323,7 +327,7 @@ declare const __VLS_base$4: vue27.DefineComponent<vue27.ExtractPropTypes<{
323
327
  }>, {
324
328
  fields: TdFormFieldProps[];
325
329
  item: element_plus0.FormItemProps;
326
- }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
330
+ }, {}, {}, {}, string, vue47.ComponentProvideOptions, true, {}, any>;
327
331
  declare const __VLS_export$6: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
328
332
  declare const _default$3: typeof __VLS_export$6;
329
333
  type __VLS_WithSlots$4<T, S> = T & {
@@ -335,46 +339,46 @@ type __VLS_WithSlots$4<T, S> = T & {
335
339
  //#region src/form/form-item.vue.d.ts
336
340
  declare var __VLS_10$1: string | number, __VLS_11$1: any;
337
341
  type __VLS_Slots$3 = {} & { [K in NonNullable<typeof __VLS_10$1>]?: (props: typeof __VLS_11$1) => any };
338
- declare const __VLS_base$3: vue27.DefineComponent<vue27.ExtractPropTypes<{
342
+ declare const __VLS_base$3: vue47.DefineComponent<vue47.ExtractPropTypes<{
339
343
  messageLabel: {
340
- type: vue27.PropType<OrRef<string>>;
344
+ type: vue47.PropType<OrRef<string>>;
341
345
  default: string;
342
346
  };
343
347
  formatMessage: {
344
- type: vue27.PropType<AnyFunction>;
348
+ type: vue47.PropType<AnyFunction>;
345
349
  default: null;
346
350
  };
347
351
  hideRequiredAsterisk: {
348
- type: vue27.PropType<boolean>;
352
+ type: vue47.PropType<boolean>;
349
353
  default: boolean;
350
354
  };
351
355
  errorLayout: {
352
- type: vue27.PropType<"nowrap" | "wrap" | "expand">;
356
+ type: vue47.PropType<"nowrap" | "wrap" | "expand">;
353
357
  default: string;
354
358
  };
355
- }>, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
359
+ }>, {}, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<vue47.ExtractPropTypes<{
356
360
  messageLabel: {
357
- type: vue27.PropType<OrRef<string>>;
361
+ type: vue47.PropType<OrRef<string>>;
358
362
  default: string;
359
363
  };
360
364
  formatMessage: {
361
- type: vue27.PropType<AnyFunction>;
365
+ type: vue47.PropType<AnyFunction>;
362
366
  default: null;
363
367
  };
364
368
  hideRequiredAsterisk: {
365
- type: vue27.PropType<boolean>;
369
+ type: vue47.PropType<boolean>;
366
370
  default: boolean;
367
371
  };
368
372
  errorLayout: {
369
- type: vue27.PropType<"nowrap" | "wrap" | "expand">;
373
+ type: vue47.PropType<"nowrap" | "wrap" | "expand">;
370
374
  default: string;
371
375
  };
372
376
  }>> & Readonly<{}>, {
373
- hideRequiredAsterisk: boolean;
374
377
  messageLabel: OrRef<string>;
375
378
  formatMessage: AnyFunction;
379
+ hideRequiredAsterisk: boolean;
376
380
  errorLayout: "wrap" | "nowrap" | "expand";
377
- }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
381
+ }, {}, {}, {}, string, vue47.ComponentProvideOptions, true, {}, any>;
378
382
  declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
379
383
  declare const _default$5: typeof __VLS_export$5;
380
384
  type __VLS_WithSlots$3<T, S> = T & {
@@ -384,7 +388,7 @@ type __VLS_WithSlots$3<T, S> = T & {
384
388
  };
385
389
  //#endregion
386
390
  //#region src/form/form-field.vue.d.ts
387
- declare const __VLS_export$4: vue27.DefineComponent<{}, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
391
+ declare const __VLS_export$4: vue47.DefineComponent<{}, {}, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue47.ComponentProvideOptions, true, {}, any>;
388
392
  declare const _default$4: typeof __VLS_export$4;
389
393
  //#endregion
390
394
  //#region src/form/index.d.ts
@@ -432,19 +436,19 @@ type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof
432
436
  } & {
433
437
  after?: (props: typeof __VLS_19) => any;
434
438
  };
435
- declare const __VLS_base$2: vue27.DefineComponent<vue27.ExtractPropTypes<{
439
+ declare const __VLS_base$2: vue47.DefineComponent<vue47.ExtractPropTypes<{
436
440
  columns: {
437
- type: vue27.PropType<TdTableColumnProps[]>;
441
+ type: vue47.PropType<TdTableColumnProps[]>;
438
442
  default: () => never[];
439
443
  };
440
- }>, TableInstance, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
444
+ }>, TableInstance, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<vue47.ExtractPropTypes<{
441
445
  columns: {
442
- type: vue27.PropType<TdTableColumnProps[]>;
446
+ type: vue47.PropType<TdTableColumnProps[]>;
443
447
  default: () => never[];
444
448
  };
445
449
  }>> & Readonly<{}>, {
446
450
  columns: TdTableColumnProps[];
447
- }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
451
+ }, {}, {}, {}, string, vue47.ComponentProvideOptions, true, {}, any>;
448
452
  declare const __VLS_export$3: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
449
453
  declare const _default$6: typeof __VLS_export$3;
450
454
  type __VLS_WithSlots$2<T, S> = T & {
@@ -454,55 +458,55 @@ type __VLS_WithSlots$2<T, S> = T & {
454
458
  };
455
459
  //#endregion
456
460
  //#region src/table/table-col.vue.d.ts
457
- declare const __VLS_export$2: vue27.DefineComponent<vue27.ExtractPropTypes<{
461
+ declare const __VLS_export$2: vue47.DefineComponent<vue47.ExtractPropTypes<{
458
462
  slots: {
459
- type: vue27.PropType<OrArray<SlotDef>>;
463
+ type: vue47.PropType<OrArray<SlotDef>>;
460
464
  default: null;
461
465
  };
462
466
  columns: {
463
- type: vue27.PropType<TdTableColumnProps[]>;
467
+ type: vue47.PropType<TdTableColumnProps[]>;
464
468
  default: () => never[];
465
469
  };
466
470
  transform: {
467
- type: vue27.PropType<AnyFunction[]>;
471
+ type: vue47.PropType<AnyFunction[]>;
468
472
  default: () => never[];
469
473
  };
470
474
  hide: {
471
- type: vue27.PropType<boolean | vue27.Ref<boolean>>;
475
+ type: vue47.PropType<boolean | vue47.Ref<boolean>>;
472
476
  default: false;
473
477
  };
474
478
  dangerouslyUseHTMLString: {
475
- type: vue27.PropType<boolean | vue27.Ref<boolean>>;
479
+ type: vue47.PropType<boolean | vue47.Ref<boolean>>;
476
480
  default: false;
477
481
  };
478
- }>, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
482
+ }>, {}, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<vue47.ExtractPropTypes<{
479
483
  slots: {
480
- type: vue27.PropType<OrArray<SlotDef>>;
484
+ type: vue47.PropType<OrArray<SlotDef>>;
481
485
  default: null;
482
486
  };
483
487
  columns: {
484
- type: vue27.PropType<TdTableColumnProps[]>;
488
+ type: vue47.PropType<TdTableColumnProps[]>;
485
489
  default: () => never[];
486
490
  };
487
491
  transform: {
488
- type: vue27.PropType<AnyFunction[]>;
492
+ type: vue47.PropType<AnyFunction[]>;
489
493
  default: () => never[];
490
494
  };
491
495
  hide: {
492
- type: vue27.PropType<boolean | vue27.Ref<boolean>>;
496
+ type: vue47.PropType<boolean | vue47.Ref<boolean>>;
493
497
  default: false;
494
498
  };
495
499
  dangerouslyUseHTMLString: {
496
- type: vue27.PropType<boolean | vue27.Ref<boolean>>;
500
+ type: vue47.PropType<boolean | vue47.Ref<boolean>>;
497
501
  default: false;
498
502
  };
499
503
  }>> & Readonly<{}>, {
500
504
  slots: OrArray<SlotDef>;
501
- hide: boolean | vue27.Ref<boolean, boolean>;
505
+ hide: boolean | vue47.Ref<boolean, boolean>;
502
506
  columns: TdTableColumnProps[];
503
507
  transform: AnyFunction[];
504
- dangerouslyUseHTMLString: boolean | vue27.Ref<boolean, boolean>;
505
- }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
508
+ dangerouslyUseHTMLString: boolean | vue47.Ref<boolean, boolean>;
509
+ }, {}, {}, {}, string, vue47.ComponentProvideOptions, true, {}, any>;
506
510
  declare const _default$7: typeof __VLS_export$2;
507
511
  //#endregion
508
512
  //#region src/table/index.d.ts
@@ -535,7 +539,7 @@ declare var __VLS_13: "default" | "footer" | "header" | "title", __VLS_14: {
535
539
  titleClass?: string | undefined;
536
540
  };
537
541
  type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
538
- declare const __VLS_base$1: vue27.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
542
+ declare const __VLS_base$1: vue47.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue47.ComponentProvideOptions, true, {}, any>;
539
543
  declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
540
544
  declare const _default: typeof __VLS_export$1;
541
545
  type __VLS_WithSlots$1<T, S> = T & {
@@ -574,7 +578,7 @@ type __VLS_Props = {
574
578
  };
575
579
  declare var __VLS_10: string | number, __VLS_11: any;
576
580
  type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
577
- 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>;
581
+ declare const __VLS_base: vue47.DefineComponent<__VLS_Props, SelectInstance, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue47.ComponentProvideOptions, false, {}, any>;
578
582
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
579
583
  declare const _default$2: typeof __VLS_export;
580
584
  type __VLS_WithSlots<T, S> = T & {
@@ -594,7 +598,7 @@ interface DirectiveConfig {
594
598
  modifiers?: Record<string, boolean>;
595
599
  enable?: boolean;
596
600
  }
597
- declare const _default$1: vue27.DefineComponent<vue27.ExtractPropTypes<{
601
+ declare const _default$1: vue47.DefineComponent<vue47.ExtractPropTypes<{
598
602
  directives: {
599
603
  type: () => DirectiveConfig[];
600
604
  default: () => never[];
@@ -607,11 +611,11 @@ declare const _default$1: vue27.DefineComponent<vue27.ExtractPropTypes<{
607
611
  type: StringConstructor;
608
612
  default: string;
609
613
  };
610
- }>, () => vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
614
+ }>, () => vue47.VNode<vue47.RendererNode, vue47.RendererElement, {
611
615
  [key: string]: any;
612
- }> | vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
616
+ }> | vue47.VNode<vue47.RendererNode, vue47.RendererElement, {
613
617
  [key: string]: any;
614
- }>[], {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
618
+ }>[], {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<vue47.ExtractPropTypes<{
615
619
  directives: {
616
620
  type: () => DirectiveConfig[];
617
621
  default: () => never[];
@@ -628,13 +632,13 @@ declare const _default$1: vue27.DefineComponent<vue27.ExtractPropTypes<{
628
632
  directives: DirectiveConfig[];
629
633
  wrap: boolean;
630
634
  tag: string;
631
- }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
635
+ }, {}, {}, {}, string, vue47.ComponentProvideOptions, true, {}, any>;
632
636
  //#endregion
633
637
  //#region src/hooks/use-reuse.d.ts
634
- 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, {
638
+ declare function useReuse(): (vue47.DefineComponent<{}, () => null, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue47.ComponentProvideOptions, true, {}, any> | vue47.DefineComponent<{}, () => vue47.VNode<vue47.RendererNode, vue47.RendererElement, {
635
639
  [key: string]: any;
636
- }>[] | undefined, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any> | vue27.ComputedRef<Readonly<{
637
- [name: string]: vue27.Slot<any> | undefined;
640
+ }>[] | undefined, {}, {}, {}, vue47.ComponentOptionsMixin, vue47.ComponentOptionsMixin, {}, string, vue47.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue47.ComponentProvideOptions, true, {}, any> | vue47.ComputedRef<Readonly<{
641
+ [name: string]: vue47.Slot<any> | undefined;
638
642
  }>>)[];
639
643
  //#endregion
640
644
  //#region src/utils/index.d.ts
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ function getSlotsFactory(slots) {
8
8
  if (typeof name === "string") {
9
9
  const slot = slots[name];
10
10
  if (slot) return [{
11
- name: name.replace(/[\w-]+?_/, ""),
11
+ name: name.replace(/[\w-]+?_?/, ""),
12
12
  component: slot,
13
13
  slot: true
14
14
  }];
@@ -16,7 +16,7 @@ function getSlotsFactory(slots) {
16
16
  }
17
17
  if (name instanceof RegExp) return Object.keys(slots).flatMap((slotName) => {
18
18
  if (name.test(slotName)) return [{
19
- name: slotName.replace(/[\w-]+?_/, ""),
19
+ name: slotName.replace(/[\w-]+?_?/, ""),
20
20
  component: slots[slotName],
21
21
  slot: true
22
22
  }];
@@ -26,7 +26,7 @@ function getSlotsFactory(slots) {
26
26
  });
27
27
  }
28
28
  function resolveSlotNames(names, prop, type) {
29
- const propReg = prop ? /* @__PURE__ */ new RegExp(`^${toKebabCase([prop, type].filter(Boolean).join("-"))}_`) : void 0;
29
+ const propReg = prop ? /* @__PURE__ */ new RegExp(`^${toKebabCase([prop, type].filter(Boolean).join("-"))}(_|$)`) : void 0;
30
30
  return ensureArray(names ?? propReg);
31
31
  }
32
32
  const keys = /* @__PURE__ */ new WeakMap();
@@ -172,6 +172,10 @@ const arrayFieldPropsDef = {
172
172
  required: true
173
173
  },
174
174
  rawValue: { type: Function },
175
+ slotProp: {
176
+ type: String,
177
+ required: false
178
+ },
175
179
  outerEmptyAction: {
176
180
  type: [
177
181
  Array,
@@ -635,9 +639,9 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
635
639
  };
636
640
  });
637
641
  const formCtx = inject(formCtxKey);
638
- const OuterEmptySlot = formCtx.getParentSlots(resolveSlotNames(props.outerEmptyAction, `${props.prop}-action_outer`))[0];
639
- const EmptySlot = formCtx.getParentSlots(resolveSlotNames(props.emptyAction, `${props.prop}-action_empty`))[0];
640
- const RowSlot = formCtx.getParentSlots(resolveSlotNames(props.rowAction, `${props.prop}-action_row`))[0];
642
+ const OuterEmptySlot = formCtx.getParentSlots(resolveSlotNames(props.outerEmptyAction, `${props.prop || props.slotProp}-action-outer`))[0];
643
+ const EmptySlot = formCtx.getParentSlots(resolveSlotNames(props.emptyAction, `${props.prop || props.slotProp}-action-empty`))[0];
644
+ const RowSlot = formCtx.getParentSlots(resolveSlotNames(props.rowAction, `${props.prop || props.slotProp}-action-row`))[0];
641
645
  const parentFullProp = computed(() => attrs["full-prop"] || "");
642
646
  const values = computed(() => {
643
647
  return getDeepValue(formCtx.model, parentFullProp.value, { fallback: [] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiddy",
3
- "version": "2.7.0",
3
+ "version": "2.8.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",