tiddy 2.0.6 → 2.0.7

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 vue41 from "vue";
1
+ import * as vue32 from "vue";
2
2
  import { AllowedComponentProps, CSSProperties, Component, DefineComponent, ExtractPublicPropTypes, PropType, Raw, Slot } from "vue";
3
3
  import * as element_plus0 from "element-plus";
4
4
  import { DialogInstance, DialogProps, FormInstance, FormItemProp, FormItemProps, FormItemRule, FormProps, TableColumnInstance, TableInstance } from "element-plus";
@@ -10,7 +10,7 @@ type AnyFunction<A extends any[] = any[], R = any> = (...args: A) => R;
10
10
  type MakeOptional<T, K$1 extends keyof T> = Omit<T, K$1> & Partial<Pick<T, K$1>>;
11
11
  interface ComponentSlot {
12
12
  name: string;
13
- component?: Component | Slot;
13
+ component?: Component | Slot | string;
14
14
  props?: (scope: any) => Record<string, any>;
15
15
  text?: OrFunction<string>;
16
16
  slots?: SlotDef[] | string;
@@ -248,9 +248,11 @@ declare function widget<T>(c: T | Raw<T>, props?: OrRef<PropsOf<T>>): {
248
248
  //#endregion
249
249
  //#region src/form/form.vue.d.ts
250
250
  declare function reValidateErrorFields(props?: FormItemProp): void;
251
+ declare function isValidateError(prop: string): boolean;
251
252
  declare const expose$1: {
252
253
  reValidateErrorFields: typeof reValidateErrorFields;
253
- model: vue41.ComputedRef<unknown>;
254
+ isValidateError: typeof isValidateError;
255
+ model: vue32.ComputedRef<unknown>;
254
256
  };
255
257
  type __TdFormExpose = typeof expose$1 & FormInstance;
256
258
  declare var __VLS_11$1: {}, __VLS_13$1: {}, __VLS_19$1: {};
@@ -261,24 +263,24 @@ type __VLS_Slots$3 = {} & {
261
263
  } & {
262
264
  suffix?: (props: typeof __VLS_19$1) => any;
263
265
  };
264
- declare const __VLS_base$3: vue41.DefineComponent<vue41.ExtractPropTypes<{
266
+ declare const __VLS_base$3: vue32.DefineComponent<vue32.ExtractPropTypes<{
265
267
  fields: {
266
- type: vue41.PropType<TdFormFieldProps[]>;
268
+ type: vue32.PropType<TdFormFieldProps[]>;
267
269
  default: () => never[];
268
270
  };
269
271
  item: {
270
- type: vue41.PropType<element_plus0.FormItemProps>;
272
+ type: vue32.PropType<element_plus0.FormItemProps>;
271
273
  default: () => {};
272
274
  };
273
- }>, __TdFormExpose, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {
275
+ }>, __TdFormExpose, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {
274
276
  submit: (data: any) => any;
275
- }, string, vue41.PublicProps, Readonly<vue41.ExtractPropTypes<{
277
+ }, string, vue32.PublicProps, Readonly<vue32.ExtractPropTypes<{
276
278
  fields: {
277
- type: vue41.PropType<TdFormFieldProps[]>;
279
+ type: vue32.PropType<TdFormFieldProps[]>;
278
280
  default: () => never[];
279
281
  };
280
282
  item: {
281
- type: vue41.PropType<element_plus0.FormItemProps>;
283
+ type: vue32.PropType<element_plus0.FormItemProps>;
282
284
  default: () => {};
283
285
  };
284
286
  }>> & Readonly<{
@@ -286,7 +288,7 @@ declare const __VLS_base$3: vue41.DefineComponent<vue41.ExtractPropTypes<{
286
288
  }>, {
287
289
  fields: TdFormFieldProps[];
288
290
  item: element_plus0.FormItemProps;
289
- }, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
291
+ }, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
290
292
  declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
291
293
  declare const _default$1: typeof __VLS_export$5;
292
294
  type __VLS_WithSlots$3<T, S> = T & {
@@ -298,37 +300,37 @@ type __VLS_WithSlots$3<T, S> = T & {
298
300
  //#region src/form/form-item.vue.d.ts
299
301
  declare var __VLS_10: string | number, __VLS_11: any;
300
302
  type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
301
- declare const __VLS_base$2: vue41.DefineComponent<vue41.ExtractPropTypes<{
303
+ declare const __VLS_base$2: vue32.DefineComponent<vue32.ExtractPropTypes<{
302
304
  messageLabel: {
303
- type: vue41.PropType<OrRef<string>>;
305
+ type: vue32.PropType<OrRef<string>>;
304
306
  default: string;
305
307
  };
306
308
  formatMessage: {
307
- type: vue41.PropType<AnyFunction>;
309
+ type: vue32.PropType<AnyFunction>;
308
310
  default: null;
309
311
  };
310
312
  hideRequiredAsterisk: {
311
- type: vue41.PropType<boolean>;
313
+ type: vue32.PropType<boolean>;
312
314
  default: boolean;
313
315
  };
314
- }>, {}, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<vue41.ExtractPropTypes<{
316
+ }>, {}, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<vue32.ExtractPropTypes<{
315
317
  messageLabel: {
316
- type: vue41.PropType<OrRef<string>>;
318
+ type: vue32.PropType<OrRef<string>>;
317
319
  default: string;
318
320
  };
319
321
  formatMessage: {
320
- type: vue41.PropType<AnyFunction>;
322
+ type: vue32.PropType<AnyFunction>;
321
323
  default: null;
322
324
  };
323
325
  hideRequiredAsterisk: {
324
- type: vue41.PropType<boolean>;
326
+ type: vue32.PropType<boolean>;
325
327
  default: boolean;
326
328
  };
327
329
  }>> & Readonly<{}>, {
328
330
  messageLabel: any;
329
331
  formatMessage: AnyFunction;
330
332
  hideRequiredAsterisk: boolean;
331
- }, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
333
+ }, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
332
334
  declare const __VLS_export$4: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
333
335
  declare const _default$3: typeof __VLS_export$4;
334
336
  type __VLS_WithSlots$2<T, S> = T & {
@@ -338,7 +340,7 @@ type __VLS_WithSlots$2<T, S> = T & {
338
340
  };
339
341
  //#endregion
340
342
  //#region src/form/form-field.vue.d.ts
341
- declare const __VLS_export$3: vue41.DefineComponent<{}, {}, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
343
+ declare const __VLS_export$3: vue32.DefineComponent<{}, {}, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
342
344
  declare const _default$2: typeof __VLS_export$3;
343
345
  //#endregion
344
346
  //#region src/form/index.d.ts
@@ -378,19 +380,19 @@ type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof
378
380
  } & {
379
381
  after?: (props: typeof __VLS_19) => any;
380
382
  };
381
- declare const __VLS_base$1: vue41.DefineComponent<vue41.ExtractPropTypes<{
383
+ declare const __VLS_base$1: vue32.DefineComponent<vue32.ExtractPropTypes<{
382
384
  columns: {
383
- type: vue41.PropType<TdTableColumnProps[]>;
385
+ type: vue32.PropType<TdTableColumnProps[]>;
384
386
  default: () => never[];
385
387
  };
386
- }>, TableInstance, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<vue41.ExtractPropTypes<{
388
+ }>, TableInstance, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<vue32.ExtractPropTypes<{
387
389
  columns: {
388
- type: vue41.PropType<TdTableColumnProps[]>;
390
+ type: vue32.PropType<TdTableColumnProps[]>;
389
391
  default: () => never[];
390
392
  };
391
393
  }>> & Readonly<{}>, {
392
394
  columns: TdTableColumnProps[];
393
- }, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
395
+ }, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
394
396
  declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
395
397
  declare const _default$4: typeof __VLS_export$2;
396
398
  type __VLS_WithSlots$1<T, S> = T & {
@@ -400,37 +402,37 @@ type __VLS_WithSlots$1<T, S> = T & {
400
402
  };
401
403
  //#endregion
402
404
  //#region src/table/table-col.vue.d.ts
403
- declare const __VLS_export$1: vue41.DefineComponent<vue41.ExtractPropTypes<{
405
+ declare const __VLS_export$1: vue32.DefineComponent<vue32.ExtractPropTypes<{
404
406
  slots: {
405
- type: vue41.PropType<OrArray<SlotDef>>;
407
+ type: vue32.PropType<OrArray<SlotDef>>;
406
408
  default: () => null;
407
409
  };
408
410
  columns: {
409
- type: vue41.PropType<any[]>;
411
+ type: vue32.PropType<any[]>;
410
412
  default: () => never[];
411
413
  };
412
414
  transform: {
413
- type: vue41.PropType<AnyFunction[]>;
415
+ type: vue32.PropType<AnyFunction[]>;
414
416
  default: () => never[];
415
417
  };
416
- }>, {}, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<vue41.ExtractPropTypes<{
418
+ }>, {}, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<vue32.ExtractPropTypes<{
417
419
  slots: {
418
- type: vue41.PropType<OrArray<SlotDef>>;
420
+ type: vue32.PropType<OrArray<SlotDef>>;
419
421
  default: () => null;
420
422
  };
421
423
  columns: {
422
- type: vue41.PropType<any[]>;
424
+ type: vue32.PropType<any[]>;
423
425
  default: () => never[];
424
426
  };
425
427
  transform: {
426
- type: vue41.PropType<AnyFunction[]>;
428
+ type: vue32.PropType<AnyFunction[]>;
427
429
  default: () => never[];
428
430
  };
429
431
  }>> & Readonly<{}>, {
430
432
  slots: OrArray<SlotDef>;
431
433
  columns: any[];
432
434
  transform: AnyFunction[];
433
- }, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
435
+ }, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
434
436
  declare const _default$5: typeof __VLS_export$1;
435
437
  //#endregion
436
438
  //#region src/table/index.d.ts
@@ -463,7 +465,7 @@ declare var __VLS_13: "default" | "title" | "header" | "footer", __VLS_14: {
463
465
  titleClass?: string | undefined;
464
466
  };
465
467
  type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
466
- declare const __VLS_base: vue41.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
468
+ declare const __VLS_base: vue32.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
467
469
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
468
470
  declare const _default: typeof __VLS_export;
469
471
  type __VLS_WithSlots<T, S> = T & {
@@ -477,10 +479,10 @@ type Instance = InstanceType<typeof _default>;
477
479
  type TdDialogInstance = Instance & Omit<DialogInstance, keyof Instance & string>;
478
480
  //#endregion
479
481
  //#region src/hooks/use-reuse.d.ts
480
- declare function useReuse(): (vue41.DefineComponent<{}, () => null, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any> | vue41.DefineComponent<{}, () => vue41.VNode<vue41.RendererNode, vue41.RendererElement, {
482
+ declare function useReuse(): (vue32.DefineComponent<{}, () => null, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any> | vue32.DefineComponent<{}, () => vue32.VNode<vue32.RendererNode, vue32.RendererElement, {
481
483
  [key: string]: any;
482
- }>[] | undefined, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any> | vue41.ComputedRef<Readonly<{
483
- [name: string]: vue41.Slot<any> | undefined;
484
+ }>[] | undefined, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any> | vue32.ComputedRef<Readonly<{
485
+ [name: string]: vue32.Slot<any> | undefined;
484
486
  }>>)[];
485
487
  //#endregion
486
488
  //#region src/utils/index.d.ts
package/dist/index.js CHANGED
@@ -253,7 +253,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
253
253
  const attrs = useAttrs();
254
254
  const itemAttr = computed(() => {
255
255
  const res = { ...formCtx?.itemOption };
256
- for (const [k, v] of Object.entries(attrs)) Reflect.set(res, k, isRef(v) ? v.value : v);
256
+ for (const [k, v] of Object.entries(attrs)) Reflect.set(res, k, unref(v));
257
257
  return res;
258
258
  });
259
259
  const formItemRef = useTemplateRef("formItem");
@@ -452,7 +452,7 @@ var widget_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
452
452
  from: /^widget/,
453
453
  to: (k) => toCamelCase(k.slice(6))
454
454
  }]),
455
- ...props.widget
455
+ ...unref(props.widget)
456
456
  };
457
457
  });
458
458
  const widgetSlots = formCtx.getParentSlots(resolveSlotNames(props.slots, props.prop));
@@ -747,8 +747,12 @@ var form_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
747
747
  });
748
748
  for (const field of fields) if (field.validateState === "error") field.validate("");
749
749
  }
750
+ function isValidateError(prop) {
751
+ return formRef.value?.getField(prop)?.validateState === "error";
752
+ }
750
753
  const expose = {
751
754
  reValidateErrorFields,
755
+ isValidateError,
752
756
  model: computed(() => attrs.model)
753
757
  };
754
758
  __expose(new Proxy(expose, {
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "tiddy",
3
- "version": "2.0.6",
4
- "packageManager": "pnpm@10.11.0",
3
+ "version": "2.0.7",
5
4
  "description": "A set of Vue 3 components based on element-plus",
6
5
  "type": "module",
7
6
  "license": "MIT",
@@ -14,7 +13,9 @@
14
13
  "url": "git+https://github.com/leemotive/tiddy.git"
15
14
  },
16
15
  "author": "leemotive <wstation@163.com>",
17
- "files": ["dist"],
16
+ "files": [
17
+ "dist"
18
+ ],
18
19
  "main": "./dist/index.js",
19
20
  "module": "./dist/index.js",
20
21
  "types": "./dist/index.d.ts",
@@ -23,19 +24,6 @@
23
24
  "./package.json": "./package.json",
24
25
  "./*": "./dist/*"
25
26
  },
26
- "scripts": {
27
- "lint": "biome lint .",
28
- "build": "tsdown",
29
- "dev": "tsdown --watch",
30
- "play": "vite",
31
- "test": "vitest",
32
- "type": "vue-tsc --noEmit",
33
- "format": "biome format --write .",
34
- "prepublishOnly": "pnpm run build",
35
- "docs:dev": "vitepress dev docs",
36
- "docs:build": "vitepress build docs",
37
- "docs:preview": "vitepress preview docs"
38
- },
39
27
  "peerDependencies": {
40
28
  "element-plus": "^2.11.7",
41
29
  "vue": "^3.0.0"
@@ -63,5 +51,17 @@
63
51
  },
64
52
  "dependencies": {
65
53
  "yatter": "^3.0.0"
54
+ },
55
+ "scripts": {
56
+ "lint": "biome lint .",
57
+ "build": "tsdown",
58
+ "dev": "tsdown --watch",
59
+ "play": "vite",
60
+ "test": "vitest",
61
+ "type": "vue-tsc --noEmit",
62
+ "format": "biome format --write .",
63
+ "docs:dev": "vitepress dev docs",
64
+ "docs:build": "vitepress build docs",
65
+ "docs:preview": "vitepress preview docs"
66
66
  }
67
- }
67
+ }