tiddy 2.3.1 → 2.3.2

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,5 +1,5 @@
1
- import * as vue37 from "vue";
2
- import { AllowedComponentProps, CSSProperties, Component, DefineComponent, ExtractPublicPropTypes, PropType, Raw, Ref as Ref$1, Slot } from "vue";
1
+ import * as vue56 from "vue";
2
+ import { AllowedComponentProps, CSSProperties, Component, ComputedRef, DefineComponent, ExtractPublicPropTypes, PropType, Raw, Ref as Ref$1, 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
 
@@ -252,7 +252,7 @@ declare function isValidateError(prop: string): boolean;
252
252
  declare const expose$1: {
253
253
  reValidateErrorFields: typeof reValidateErrorFields;
254
254
  isValidateError: typeof isValidateError;
255
- model: vue37.ComputedRef<unknown>;
255
+ model: vue56.ComputedRef<unknown>;
256
256
  };
257
257
  type __TdFormExpose = typeof expose$1 & FormInstance;
258
258
  declare var __VLS_11$2: {}, __VLS_13$1: {}, __VLS_19$1: {};
@@ -263,24 +263,24 @@ type __VLS_Slots$4 = {} & {
263
263
  } & {
264
264
  suffix?: (props: typeof __VLS_19$1) => any;
265
265
  };
266
- declare const __VLS_base$4: vue37.DefineComponent<vue37.ExtractPropTypes<{
266
+ declare const __VLS_base$4: vue56.DefineComponent<vue56.ExtractPropTypes<{
267
267
  fields: {
268
- type: vue37.PropType<TdFormFieldProps[]>;
268
+ type: vue56.PropType<TdFormFieldProps[]>;
269
269
  default: () => never[];
270
270
  };
271
271
  item: {
272
- type: vue37.PropType<element_plus0.FormItemProps>;
272
+ type: vue56.PropType<element_plus0.FormItemProps>;
273
273
  default: () => {};
274
274
  };
275
- }>, __TdFormExpose, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {
275
+ }>, __TdFormExpose, {}, {}, {}, vue56.ComponentOptionsMixin, vue56.ComponentOptionsMixin, {
276
276
  submit: (data: any) => any;
277
- }, string, vue37.PublicProps, Readonly<vue37.ExtractPropTypes<{
277
+ }, string, vue56.PublicProps, Readonly<vue56.ExtractPropTypes<{
278
278
  fields: {
279
- type: vue37.PropType<TdFormFieldProps[]>;
279
+ type: vue56.PropType<TdFormFieldProps[]>;
280
280
  default: () => never[];
281
281
  };
282
282
  item: {
283
- type: vue37.PropType<element_plus0.FormItemProps>;
283
+ type: vue56.PropType<element_plus0.FormItemProps>;
284
284
  default: () => {};
285
285
  };
286
286
  }>> & Readonly<{
@@ -288,7 +288,7 @@ declare const __VLS_base$4: vue37.DefineComponent<vue37.ExtractPropTypes<{
288
288
  }>, {
289
289
  fields: TdFormFieldProps[];
290
290
  item: element_plus0.FormItemProps;
291
- }, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
291
+ }, {}, {}, {}, string, vue56.ComponentProvideOptions, true, {}, any>;
292
292
  declare const __VLS_export$6: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
293
293
  declare const _default$2: typeof __VLS_export$6;
294
294
  type __VLS_WithSlots$4<T, S> = T & {
@@ -300,37 +300,37 @@ type __VLS_WithSlots$4<T, S> = T & {
300
300
  //#region src/form/form-item.vue.d.ts
301
301
  declare var __VLS_10$1: string | number, __VLS_11$1: any;
302
302
  type __VLS_Slots$3 = {} & { [K in NonNullable<typeof __VLS_10$1>]?: (props: typeof __VLS_11$1) => any };
303
- declare const __VLS_base$3: vue37.DefineComponent<vue37.ExtractPropTypes<{
303
+ declare const __VLS_base$3: vue56.DefineComponent<vue56.ExtractPropTypes<{
304
304
  messageLabel: {
305
- type: vue37.PropType<OrRef<string>>;
305
+ type: vue56.PropType<OrRef<string>>;
306
306
  default: string;
307
307
  };
308
308
  formatMessage: {
309
- type: vue37.PropType<AnyFunction>;
309
+ type: vue56.PropType<AnyFunction>;
310
310
  default: null;
311
311
  };
312
312
  hideRequiredAsterisk: {
313
- type: vue37.PropType<boolean>;
313
+ type: vue56.PropType<boolean>;
314
314
  default: boolean;
315
315
  };
316
- }>, {}, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<vue37.ExtractPropTypes<{
316
+ }>, {}, {}, {}, {}, vue56.ComponentOptionsMixin, vue56.ComponentOptionsMixin, {}, string, vue56.PublicProps, Readonly<vue56.ExtractPropTypes<{
317
317
  messageLabel: {
318
- type: vue37.PropType<OrRef<string>>;
318
+ type: vue56.PropType<OrRef<string>>;
319
319
  default: string;
320
320
  };
321
321
  formatMessage: {
322
- type: vue37.PropType<AnyFunction>;
322
+ type: vue56.PropType<AnyFunction>;
323
323
  default: null;
324
324
  };
325
325
  hideRequiredAsterisk: {
326
- type: vue37.PropType<boolean>;
326
+ type: vue56.PropType<boolean>;
327
327
  default: boolean;
328
328
  };
329
329
  }>> & Readonly<{}>, {
330
330
  hideRequiredAsterisk: boolean;
331
331
  messageLabel: any;
332
332
  formatMessage: AnyFunction;
333
- }, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
333
+ }, {}, {}, {}, string, vue56.ComponentProvideOptions, true, {}, any>;
334
334
  declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
335
335
  declare const _default$4: typeof __VLS_export$5;
336
336
  type __VLS_WithSlots$3<T, S> = T & {
@@ -340,7 +340,7 @@ type __VLS_WithSlots$3<T, S> = T & {
340
340
  };
341
341
  //#endregion
342
342
  //#region src/form/form-field.vue.d.ts
343
- declare const __VLS_export$4: vue37.DefineComponent<{}, {}, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
343
+ declare const __VLS_export$4: vue56.DefineComponent<{}, {}, {}, {}, {}, vue56.ComponentOptionsMixin, vue56.ComponentOptionsMixin, {}, string, vue56.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue56.ComponentProvideOptions, true, {}, any>;
344
344
  declare const _default$3: typeof __VLS_export$4;
345
345
  //#endregion
346
346
  //#region src/form/index.d.ts
@@ -388,19 +388,19 @@ type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof
388
388
  } & {
389
389
  after?: (props: typeof __VLS_19) => any;
390
390
  };
391
- declare const __VLS_base$2: vue37.DefineComponent<vue37.ExtractPropTypes<{
391
+ declare const __VLS_base$2: vue56.DefineComponent<vue56.ExtractPropTypes<{
392
392
  columns: {
393
- type: vue37.PropType<TdTableColumnProps[]>;
393
+ type: vue56.PropType<TdTableColumnProps[]>;
394
394
  default: () => never[];
395
395
  };
396
- }>, TableInstance, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<vue37.ExtractPropTypes<{
396
+ }>, TableInstance, {}, {}, {}, vue56.ComponentOptionsMixin, vue56.ComponentOptionsMixin, {}, string, vue56.PublicProps, Readonly<vue56.ExtractPropTypes<{
397
397
  columns: {
398
- type: vue37.PropType<TdTableColumnProps[]>;
398
+ type: vue56.PropType<TdTableColumnProps[]>;
399
399
  default: () => never[];
400
400
  };
401
401
  }>> & Readonly<{}>, {
402
402
  columns: TdTableColumnProps[];
403
- }, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
403
+ }, {}, {}, {}, string, vue56.ComponentProvideOptions, true, {}, any>;
404
404
  declare const __VLS_export$3: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
405
405
  declare const _default$5: typeof __VLS_export$3;
406
406
  type __VLS_WithSlots$2<T, S> = T & {
@@ -410,55 +410,55 @@ type __VLS_WithSlots$2<T, S> = T & {
410
410
  };
411
411
  //#endregion
412
412
  //#region src/table/table-col.vue.d.ts
413
- declare const __VLS_export$2: vue37.DefineComponent<vue37.ExtractPropTypes<{
413
+ declare const __VLS_export$2: vue56.DefineComponent<vue56.ExtractPropTypes<{
414
414
  slots: {
415
- type: vue37.PropType<OrArray<SlotDef>>;
415
+ type: vue56.PropType<OrArray<SlotDef>>;
416
416
  default: null;
417
417
  };
418
418
  columns: {
419
- type: vue37.PropType<TdTableColumnProps[]>;
419
+ type: vue56.PropType<TdTableColumnProps[]>;
420
420
  default: () => never[];
421
421
  };
422
422
  transform: {
423
- type: vue37.PropType<AnyFunction[]>;
423
+ type: vue56.PropType<AnyFunction[]>;
424
424
  default: () => never[];
425
425
  };
426
426
  hide: {
427
- type: vue37.PropType<boolean | vue37.Ref<boolean>>;
427
+ type: vue56.PropType<boolean | vue56.Ref<boolean>>;
428
428
  default: false;
429
429
  };
430
430
  dangerouslyUseHTMLString: {
431
- type: vue37.PropType<boolean | vue37.Ref<boolean>>;
431
+ type: vue56.PropType<boolean | vue56.Ref<boolean>>;
432
432
  default: false;
433
433
  };
434
- }>, {}, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<vue37.ExtractPropTypes<{
434
+ }>, {}, {}, {}, {}, vue56.ComponentOptionsMixin, vue56.ComponentOptionsMixin, {}, string, vue56.PublicProps, Readonly<vue56.ExtractPropTypes<{
435
435
  slots: {
436
- type: vue37.PropType<OrArray<SlotDef>>;
436
+ type: vue56.PropType<OrArray<SlotDef>>;
437
437
  default: null;
438
438
  };
439
439
  columns: {
440
- type: vue37.PropType<TdTableColumnProps[]>;
440
+ type: vue56.PropType<TdTableColumnProps[]>;
441
441
  default: () => never[];
442
442
  };
443
443
  transform: {
444
- type: vue37.PropType<AnyFunction[]>;
444
+ type: vue56.PropType<AnyFunction[]>;
445
445
  default: () => never[];
446
446
  };
447
447
  hide: {
448
- type: vue37.PropType<boolean | vue37.Ref<boolean>>;
448
+ type: vue56.PropType<boolean | vue56.Ref<boolean>>;
449
449
  default: false;
450
450
  };
451
451
  dangerouslyUseHTMLString: {
452
- type: vue37.PropType<boolean | vue37.Ref<boolean>>;
452
+ type: vue56.PropType<boolean | vue56.Ref<boolean>>;
453
453
  default: false;
454
454
  };
455
455
  }>> & Readonly<{}>, {
456
- hide: boolean | vue37.Ref<boolean, boolean>;
457
456
  slots: OrArray<SlotDef>;
458
457
  columns: TdTableColumnProps[];
459
458
  transform: AnyFunction[];
460
- dangerouslyUseHTMLString: boolean | vue37.Ref<boolean, boolean>;
461
- }, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
459
+ hide: boolean | vue56.Ref<boolean, boolean>;
460
+ dangerouslyUseHTMLString: boolean | vue56.Ref<boolean, boolean>;
461
+ }, {}, {}, {}, string, vue56.ComponentProvideOptions, true, {}, any>;
462
462
  declare const _default$6: typeof __VLS_export$2;
463
463
  //#endregion
464
464
  //#region src/table/index.d.ts
@@ -491,7 +491,7 @@ declare var __VLS_13: "default" | "title" | "header" | "footer", __VLS_14: {
491
491
  titleClass?: string | undefined;
492
492
  };
493
493
  type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
494
- declare const __VLS_base$1: vue37.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
494
+ declare const __VLS_base$1: vue56.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue56.ComponentOptionsMixin, vue56.ComponentOptionsMixin, {}, string, vue56.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue56.ComponentProvideOptions, true, {}, any>;
495
495
  declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
496
496
  declare const _default: typeof __VLS_export$1;
497
497
  type __VLS_WithSlots$1<T, S> = T & {
@@ -505,33 +505,29 @@ type Instance = InstanceType<typeof _default>;
505
505
  type TdDialogInstance = Instance & Omit<DialogInstance, keyof Instance & string>;
506
506
  //#endregion
507
507
  //#region src/enum-select/store.d.ts
508
- type DataOption = {
508
+ type OptionItem<T> = {
509
+ label: string;
510
+ value: T;
511
+ };
512
+ type DataOption<T> = {
509
513
  loading: boolean;
510
- options: Array<{
511
- label: string;
512
- value: string;
513
- }>;
514
- fetch?: (code: string) => Promise<Array<{
515
- label: string;
516
- value: string;
517
- }>>;
514
+ options: Array<OptionItem<T>>;
515
+ fetch?: (code: string) => Promise<OptionItem<T>[]>;
518
516
  };
519
517
  declare function clearEnum(code: string): void;
520
- declare function getEnum(code: string, value: string, fetch?: DataOption['fetch']): vue37.ComputedRef<{
521
- label: string;
522
- value: string;
523
- } | undefined>;
518
+ declare function getEnum<T>(code: string, fetch?: DataOption<T>['fetch']): ComputedRef<OptionItem<T>[]>;
519
+ declare function getEnum<T>(code: string, value: T, fetch?: DataOption<T>['fetch']): ComputedRef<OptionItem<T> | undefined>;
524
520
  declare function resetEnum(code: string): void;
525
- declare function setDefaultEnumFetch(fetch: Exclude<DataOption['fetch'], undefined>): void;
521
+ declare function setDefaultEnumFetch(fetch: Exclude<DataOption<any>['fetch'], undefined>): void;
526
522
  //#endregion
527
523
  //#region src/enum-select/enum-select.vue.d.ts
528
524
  type __VLS_Props = {
529
525
  code: string;
530
- fetch?: DataOption['fetch'];
526
+ fetch?: DataOption<any>['fetch'];
531
527
  };
532
528
  declare var __VLS_10: string | number, __VLS_11: any;
533
529
  type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
534
- declare const __VLS_base: vue37.DefineComponent<__VLS_Props, SelectInstance, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, false, {}, any>;
530
+ declare const __VLS_base: vue56.DefineComponent<__VLS_Props, SelectInstance, {}, {}, {}, vue56.ComponentOptionsMixin, vue56.ComponentOptionsMixin, {}, string, vue56.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue56.ComponentProvideOptions, false, {}, any>;
535
531
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
536
532
  declare const _default$1: typeof __VLS_export;
537
533
  type __VLS_WithSlots<T, S> = T & {
@@ -544,10 +540,10 @@ type __VLS_WithSlots<T, S> = T & {
544
540
  type TdEnumSelectInstance = InstanceType<typeof _default$1>;
545
541
  //#endregion
546
542
  //#region src/hooks/use-reuse.d.ts
547
- declare function useReuse(): (vue37.DefineComponent<{}, () => null, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any> | vue37.DefineComponent<{}, () => vue37.VNode<vue37.RendererNode, vue37.RendererElement, {
543
+ declare function useReuse(): (vue56.DefineComponent<{}, () => null, {}, {}, {}, vue56.ComponentOptionsMixin, vue56.ComponentOptionsMixin, {}, string, vue56.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue56.ComponentProvideOptions, true, {}, any> | vue56.DefineComponent<{}, () => vue56.VNode<vue56.RendererNode, vue56.RendererElement, {
548
544
  [key: string]: any;
549
- }>[] | undefined, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any> | vue37.ComputedRef<Readonly<{
550
- [name: string]: vue37.Slot<any> | undefined;
545
+ }>[] | undefined, {}, {}, {}, vue56.ComponentOptionsMixin, vue56.ComponentOptionsMixin, {}, string, vue56.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue56.ComponentProvideOptions, true, {}, any> | vue56.ComputedRef<Readonly<{
546
+ [name: string]: vue56.Slot<any> | undefined;
551
547
  }>>)[];
552
548
  //#endregion
553
549
  //#region src/utils/index.d.ts
package/dist/index.js CHANGED
@@ -1015,9 +1015,12 @@ function clearEnum(code) {
1015
1015
  if (!data) return;
1016
1016
  data.options = [];
1017
1017
  }
1018
- function getEnum(code, value, fetch) {
1018
+ function getEnum(code, valueOrFetch, fetch) {
1019
+ const value = isFunction(valueOrFetch) ? void 0 : valueOrFetch;
1020
+ const fetchArg = isFunction(valueOrFetch) ? valueOrFetch : fetch;
1021
+ if (isNullOrUndef(value)) return getOptions(code, fetchArg);
1019
1022
  return computed(() => {
1020
- return getOptions(code, fetch).value.find((item) => item.value === value);
1023
+ return getOptions(code, fetchArg).value.find((item) => item.value === value);
1021
1024
  });
1022
1025
  }
1023
1026
  function resetEnum(code) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiddy",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "packageManager": "pnpm@10.11.0",
5
5
  "description": "A set of Vue 3 components based on element-plus",
6
6
  "type": "module",