tiddy 2.0.2 → 2.0.4

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 vue30 from "vue";
1
+ import * as vue41 from "vue";
2
2
  import { AllowedComponentProps, CSSProperties, Component, ComputedRef, DefineComponent, ExtractPublicPropTypes, PropType, Raw, Slot } from "vue";
3
3
  import * as element_plus0 from "element-plus";
4
4
  import { DialogInstance, DialogProps, FormInstance, FormItemProps, FormItemRule, FormProps, TableColumnInstance, TableInstance } from "element-plus";
@@ -240,19 +240,16 @@ declare const tdformItemProps: {
240
240
  };
241
241
  };
242
242
  type TdFormItemProps = ExtractPublicPropTypes<typeof tdformItemProps> & Partial<FormItemProps>;
243
- declare function widget<T>(p: {
243
+ declare function widget<T>(c: T, props?: PropsOf<T>): {
244
244
  component: T;
245
- widget?: PropsOf<T>;
246
- }): {
247
- component: T;
248
- widget?: PropsOf<T>;
245
+ widget: PropsOf<T> | undefined;
249
246
  };
250
247
  //#endregion
251
248
  //#region src/form/form.vue.d.ts
252
249
  declare function reValidateErrorFields(): void;
253
250
  declare const expose$1: {
254
251
  reValidateErrorFields: typeof reValidateErrorFields;
255
- model: vue30.ComputedRef<unknown>;
252
+ model: vue41.ComputedRef<unknown>;
256
253
  };
257
254
  type __TdFormExpose = typeof expose$1 & FormInstance;
258
255
  declare var __VLS_11$1: {}, __VLS_13$1: {}, __VLS_19$1: {};
@@ -263,34 +260,32 @@ type __VLS_Slots$3 = {} & {
263
260
  } & {
264
261
  suffix?: (props: typeof __VLS_19$1) => any;
265
262
  };
266
- declare const __VLS_base$3: vue30.DefineComponent<vue30.ExtractPropTypes<{
263
+ declare const __VLS_base$3: vue41.DefineComponent<vue41.ExtractPropTypes<{
267
264
  fields: {
268
- type: vue30.PropType<TdFormFieldProps[]>;
265
+ type: vue41.PropType<TdFormFieldProps[]>;
269
266
  default: () => never[];
270
267
  };
271
268
  item: {
272
- type: vue30.PropType<element_plus0.FormItemProps>;
269
+ type: vue41.PropType<element_plus0.FormItemProps>;
273
270
  default: () => {};
274
271
  };
275
- }>, __TdFormExpose, {}, {}, {}, vue30.ComponentOptionsMixin, vue30.ComponentOptionsMixin, {
276
- validate: () => any;
272
+ }>, __TdFormExpose, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {
277
273
  submit: (data: any) => any;
278
- }, string, vue30.PublicProps, Readonly<vue30.ExtractPropTypes<{
274
+ }, string, vue41.PublicProps, Readonly<vue41.ExtractPropTypes<{
279
275
  fields: {
280
- type: vue30.PropType<TdFormFieldProps[]>;
276
+ type: vue41.PropType<TdFormFieldProps[]>;
281
277
  default: () => never[];
282
278
  };
283
279
  item: {
284
- type: vue30.PropType<element_plus0.FormItemProps>;
280
+ type: vue41.PropType<element_plus0.FormItemProps>;
285
281
  default: () => {};
286
282
  };
287
283
  }>> & Readonly<{
288
- onValidate?: (() => any) | undefined;
289
284
  onSubmit?: ((data: any) => any) | undefined;
290
285
  }>, {
291
286
  fields: TdFormFieldProps[];
292
287
  item: element_plus0.FormItemProps;
293
- }, {}, {}, {}, string, vue30.ComponentProvideOptions, true, {}, any>;
288
+ }, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
294
289
  declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
295
290
  declare const _default$1: typeof __VLS_export$5;
296
291
  type __VLS_WithSlots$3<T, S> = T & {
@@ -302,37 +297,37 @@ type __VLS_WithSlots$3<T, S> = T & {
302
297
  //#region src/form/form-item.vue.d.ts
303
298
  declare var __VLS_10: string | number, __VLS_11: any;
304
299
  type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
305
- declare const __VLS_base$2: vue30.DefineComponent<vue30.ExtractPropTypes<{
300
+ declare const __VLS_base$2: vue41.DefineComponent<vue41.ExtractPropTypes<{
306
301
  messageLabel: {
307
- type: vue30.PropType<string | vue30.ComputedRef<string>>;
302
+ type: vue41.PropType<string | vue41.ComputedRef<string>>;
308
303
  default: string;
309
304
  };
310
305
  formatMessage: {
311
- type: vue30.PropType<AnyFunction>;
306
+ type: vue41.PropType<AnyFunction>;
312
307
  default: null;
313
308
  };
314
309
  hideRequiredAsterisk: {
315
- type: vue30.PropType<boolean>;
310
+ type: vue41.PropType<boolean>;
316
311
  default: boolean;
317
312
  };
318
- }>, {}, {}, {}, {}, vue30.ComponentOptionsMixin, vue30.ComponentOptionsMixin, {}, string, vue30.PublicProps, Readonly<vue30.ExtractPropTypes<{
313
+ }>, {}, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<vue41.ExtractPropTypes<{
319
314
  messageLabel: {
320
- type: vue30.PropType<string | vue30.ComputedRef<string>>;
315
+ type: vue41.PropType<string | vue41.ComputedRef<string>>;
321
316
  default: string;
322
317
  };
323
318
  formatMessage: {
324
- type: vue30.PropType<AnyFunction>;
319
+ type: vue41.PropType<AnyFunction>;
325
320
  default: null;
326
321
  };
327
322
  hideRequiredAsterisk: {
328
- type: vue30.PropType<boolean>;
323
+ type: vue41.PropType<boolean>;
329
324
  default: boolean;
330
325
  };
331
326
  }>> & Readonly<{}>, {
332
- messageLabel: string | vue30.ComputedRef<string>;
327
+ messageLabel: string | vue41.ComputedRef<string>;
333
328
  formatMessage: AnyFunction;
334
329
  hideRequiredAsterisk: boolean;
335
- }, {}, {}, {}, string, vue30.ComponentProvideOptions, true, {}, any>;
330
+ }, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
336
331
  declare const __VLS_export$4: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
337
332
  declare const _default$3: typeof __VLS_export$4;
338
333
  type __VLS_WithSlots$2<T, S> = T & {
@@ -342,7 +337,7 @@ type __VLS_WithSlots$2<T, S> = T & {
342
337
  };
343
338
  //#endregion
344
339
  //#region src/form/form-field.vue.d.ts
345
- declare const __VLS_export$3: vue30.DefineComponent<{}, {}, {}, {}, {}, vue30.ComponentOptionsMixin, vue30.ComponentOptionsMixin, {}, string, vue30.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue30.ComponentProvideOptions, true, {}, any>;
340
+ declare const __VLS_export$3: vue41.DefineComponent<{}, {}, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
346
341
  declare const _default$2: typeof __VLS_export$3;
347
342
  //#endregion
348
343
  //#region src/form/index.d.ts
@@ -382,19 +377,19 @@ type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof
382
377
  } & {
383
378
  after?: (props: typeof __VLS_19) => any;
384
379
  };
385
- declare const __VLS_base$1: vue30.DefineComponent<vue30.ExtractPropTypes<{
380
+ declare const __VLS_base$1: vue41.DefineComponent<vue41.ExtractPropTypes<{
386
381
  columns: {
387
- type: vue30.PropType<TdTableColumnProps[]>;
382
+ type: vue41.PropType<TdTableColumnProps[]>;
388
383
  default: () => never[];
389
384
  };
390
- }>, TableInstance, {}, {}, {}, vue30.ComponentOptionsMixin, vue30.ComponentOptionsMixin, {}, string, vue30.PublicProps, Readonly<vue30.ExtractPropTypes<{
385
+ }>, TableInstance, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<vue41.ExtractPropTypes<{
391
386
  columns: {
392
- type: vue30.PropType<TdTableColumnProps[]>;
387
+ type: vue41.PropType<TdTableColumnProps[]>;
393
388
  default: () => never[];
394
389
  };
395
390
  }>> & Readonly<{}>, {
396
391
  columns: TdTableColumnProps[];
397
- }, {}, {}, {}, string, vue30.ComponentProvideOptions, true, {}, any>;
392
+ }, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
398
393
  declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
399
394
  declare const _default$4: typeof __VLS_export$2;
400
395
  type __VLS_WithSlots$1<T, S> = T & {
@@ -404,37 +399,37 @@ type __VLS_WithSlots$1<T, S> = T & {
404
399
  };
405
400
  //#endregion
406
401
  //#region src/table/table-col.vue.d.ts
407
- declare const __VLS_export$1: vue30.DefineComponent<vue30.ExtractPropTypes<{
402
+ declare const __VLS_export$1: vue41.DefineComponent<vue41.ExtractPropTypes<{
408
403
  slots: {
409
- type: vue30.PropType<OrArray<SlotDef>>;
404
+ type: vue41.PropType<OrArray<SlotDef>>;
410
405
  default: () => null;
411
406
  };
412
407
  columns: {
413
- type: vue30.PropType<any[]>;
408
+ type: vue41.PropType<any[]>;
414
409
  default: () => never[];
415
410
  };
416
411
  transform: {
417
- type: vue30.PropType<AnyFunction[]>;
412
+ type: vue41.PropType<AnyFunction[]>;
418
413
  default: () => never[];
419
414
  };
420
- }>, {}, {}, {}, {}, vue30.ComponentOptionsMixin, vue30.ComponentOptionsMixin, {}, string, vue30.PublicProps, Readonly<vue30.ExtractPropTypes<{
415
+ }>, {}, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<vue41.ExtractPropTypes<{
421
416
  slots: {
422
- type: vue30.PropType<OrArray<SlotDef>>;
417
+ type: vue41.PropType<OrArray<SlotDef>>;
423
418
  default: () => null;
424
419
  };
425
420
  columns: {
426
- type: vue30.PropType<any[]>;
421
+ type: vue41.PropType<any[]>;
427
422
  default: () => never[];
428
423
  };
429
424
  transform: {
430
- type: vue30.PropType<AnyFunction[]>;
425
+ type: vue41.PropType<AnyFunction[]>;
431
426
  default: () => never[];
432
427
  };
433
428
  }>> & Readonly<{}>, {
434
429
  slots: OrArray<SlotDef>;
435
430
  columns: any[];
436
431
  transform: AnyFunction[];
437
- }, {}, {}, {}, string, vue30.ComponentProvideOptions, true, {}, any>;
432
+ }, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
438
433
  declare const _default$5: typeof __VLS_export$1;
439
434
  //#endregion
440
435
  //#region src/table/index.d.ts
@@ -467,7 +462,7 @@ declare var __VLS_13: "default" | "title" | "header" | "footer", __VLS_14: {
467
462
  titleClass?: string | undefined;
468
463
  };
469
464
  type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
470
- declare const __VLS_base: vue30.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue30.ComponentOptionsMixin, vue30.ComponentOptionsMixin, {}, string, vue30.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue30.ComponentProvideOptions, true, {}, any>;
465
+ declare const __VLS_base: vue41.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any>;
471
466
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
472
467
  declare const _default: typeof __VLS_export;
473
468
  type __VLS_WithSlots<T, S> = T & {
@@ -481,10 +476,10 @@ type Instance = InstanceType<typeof _default>;
481
476
  type TdDialogInstance = Instance & Omit<DialogInstance, keyof Instance & string>;
482
477
  //#endregion
483
478
  //#region src/hooks/use-reuse.d.ts
484
- declare function useReuse(): (vue30.DefineComponent<{}, () => null, {}, {}, {}, vue30.ComponentOptionsMixin, vue30.ComponentOptionsMixin, {}, string, vue30.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue30.ComponentProvideOptions, true, {}, any> | vue30.DefineComponent<{}, () => vue30.VNode<vue30.RendererNode, vue30.RendererElement, {
479
+ 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, {
485
480
  [key: string]: any;
486
- }>[] | undefined, {}, {}, {}, vue30.ComponentOptionsMixin, vue30.ComponentOptionsMixin, {}, string, vue30.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue30.ComponentProvideOptions, true, {}, any> | vue30.ComputedRef<Readonly<{
487
- [name: string]: vue30.Slot<any> | undefined;
481
+ }>[] | undefined, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue41.ComponentProvideOptions, true, {}, any> | vue41.ComputedRef<Readonly<{
482
+ [name: string]: vue41.Slot<any> | undefined;
488
483
  }>>)[];
489
484
  //#endregion
490
485
  //#region src/utils/index.d.ts
package/dist/index.js CHANGED
@@ -118,19 +118,35 @@ const widgetFieldPropsDef = {
118
118
  default: () => []
119
119
  },
120
120
  slots: {
121
- type: [Array, Object],
121
+ type: [
122
+ Array,
123
+ Object,
124
+ String
125
+ ],
122
126
  default: () => null
123
127
  },
124
128
  prependSlots: {
125
- type: [Array, Object],
129
+ type: [
130
+ Array,
131
+ Object,
132
+ String
133
+ ],
126
134
  default: () => null
127
135
  },
128
136
  appendSlots: {
129
- type: [Array, Object],
137
+ type: [
138
+ Array,
139
+ Object,
140
+ String
141
+ ],
130
142
  default: () => null
131
143
  },
132
144
  itemSlots: {
133
- type: [Array, Object],
145
+ type: [
146
+ Array,
147
+ Object,
148
+ String
149
+ ],
134
150
  default: () => null
135
151
  },
136
152
  default: {
@@ -182,7 +198,11 @@ const layoutFieldPropsDef = {
182
198
  required: true
183
199
  },
184
200
  slots: {
185
- type: [Array, Object],
201
+ type: [
202
+ Array,
203
+ Object,
204
+ String
205
+ ],
186
206
  default: () => []
187
207
  },
188
208
  ...fieldsPropsDef,
@@ -213,8 +233,11 @@ const tdformItemProps = {
213
233
  default: false
214
234
  }
215
235
  };
216
- function widget(p) {
217
- return p;
236
+ function widget(c, props) {
237
+ return {
238
+ component: c,
239
+ widget: props
240
+ };
218
241
  }
219
242
 
220
243
  //#endregion
@@ -699,7 +722,7 @@ var form_field_default = form_field_vue_vue_type_script_setup_true_lang_default;
699
722
  var form_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
700
723
  __name: "form",
701
724
  props: formPropsDef,
702
- emits: ["validate", "submit"],
725
+ emits: ["submit"],
703
726
  setup(__props, { expose: __expose, emit: __emit }) {
704
727
  const formRef = useTemplateRef("form");
705
728
  const props = __props;
@@ -754,7 +777,11 @@ var form_default = form_vue_vue_type_script_setup_true_lang_default;
754
777
  const tableCtxKey = Symbol("tableCtxKey");
755
778
  const tableColumnPropsDef = {
756
779
  slots: {
757
- type: [Array, Object],
780
+ type: [
781
+ Array,
782
+ Object,
783
+ String
784
+ ],
758
785
  default: () => null
759
786
  },
760
787
  columns: {
@@ -823,7 +850,7 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
823
850
  props: tablePropsDef,
824
851
  setup(__props, { expose: __expose }) {
825
852
  const slots = useSlots();
826
- const tableRef = useTemplateRef("tableRef");
853
+ const tableRef = ref(null);
827
854
  const slotNames = computed(() => Object.keys(slots));
828
855
  provide(tableCtxKey, { getParentSlots: getSlotsFactory(slots) });
829
856
  __expose(new Proxy({}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiddy",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "packageManager": "pnpm@10.11.0",
5
5
  "description": "A set of Vue 3 components based on element-plus",
6
6
  "type": "module",