tiddy 2.0.8 → 2.1.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,5 +1,5 @@
1
- import * as vue27 from "vue";
2
- import { AllowedComponentProps, CSSProperties, Component, DefineComponent, ExtractPublicPropTypes, PropType, Raw, Slot } from "vue";
1
+ import * as vue54 from "vue";
2
+ import { AllowedComponentProps, CSSProperties, Component, 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, TableColumnInstance, TableInstance } from "element-plus";
5
5
 
@@ -39,7 +39,7 @@ declare const objectFieldPropsDef: {
39
39
  type: PropType<OrFunction<string | number>>;
40
40
  };
41
41
  labelPosition: {
42
- type: PropType<"left" | "right" | "auto">;
42
+ type: PropType<FormProps["labelPosition"]>;
43
43
  };
44
44
  fields: {
45
45
  type: PropType<any[]>;
@@ -67,7 +67,7 @@ declare const widgetFieldPropsDef: {
67
67
  type: PropType<OrFunction<string | number>>;
68
68
  };
69
69
  labelPosition: {
70
- type: PropType<"left" | "right" | "auto">;
70
+ type: PropType<FormProps["labelPosition"]>;
71
71
  };
72
72
  type: {
73
73
  type: PropType<"widget">;
@@ -145,7 +145,7 @@ declare const arrayFieldPropsDef: {
145
145
  type: PropType<OrFunction<string | number>>;
146
146
  };
147
147
  labelPosition: {
148
- type: PropType<"left" | "right" | "auto">;
148
+ type: PropType<FormProps["labelPosition"]>;
149
149
  };
150
150
  fields: {
151
151
  type: PropType<any[]>;
@@ -197,7 +197,7 @@ declare const layoutFieldPropsDef: {
197
197
  type: PropType<OrFunction<string | number>>;
198
198
  };
199
199
  labelPosition: {
200
- type: PropType<"left" | "right" | "auto">;
200
+ type: PropType<FormProps["labelPosition"]>;
201
201
  };
202
202
  fields: {
203
203
  type: PropType<any[]>;
@@ -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: vue27.ComputedRef<unknown>;
255
+ model: vue54.ComputedRef<unknown>;
256
256
  };
257
257
  type __TdFormExpose = typeof expose$1 & FormInstance;
258
258
  declare var __VLS_11$1: {}, __VLS_13$1: {}, __VLS_19$1: {};
@@ -263,24 +263,24 @@ type __VLS_Slots$3 = {} & {
263
263
  } & {
264
264
  suffix?: (props: typeof __VLS_19$1) => any;
265
265
  };
266
- declare const __VLS_base$3: vue27.DefineComponent<vue27.ExtractPropTypes<{
266
+ declare const __VLS_base$3: vue54.DefineComponent<vue54.ExtractPropTypes<{
267
267
  fields: {
268
- type: vue27.PropType<TdFormFieldProps[]>;
268
+ type: vue54.PropType<TdFormFieldProps[]>;
269
269
  default: () => never[];
270
270
  };
271
271
  item: {
272
- type: vue27.PropType<element_plus0.FormItemProps>;
272
+ type: vue54.PropType<element_plus0.FormItemProps>;
273
273
  default: () => {};
274
274
  };
275
- }>, __TdFormExpose, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {
275
+ }>, __TdFormExpose, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {
276
276
  submit: (data: any) => any;
277
- }, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
277
+ }, string, vue54.PublicProps, Readonly<vue54.ExtractPropTypes<{
278
278
  fields: {
279
- type: vue27.PropType<TdFormFieldProps[]>;
279
+ type: vue54.PropType<TdFormFieldProps[]>;
280
280
  default: () => never[];
281
281
  };
282
282
  item: {
283
- type: vue27.PropType<element_plus0.FormItemProps>;
283
+ type: vue54.PropType<element_plus0.FormItemProps>;
284
284
  default: () => {};
285
285
  };
286
286
  }>> & Readonly<{
@@ -288,7 +288,7 @@ declare const __VLS_base$3: vue27.DefineComponent<vue27.ExtractPropTypes<{
288
288
  }>, {
289
289
  fields: TdFormFieldProps[];
290
290
  item: element_plus0.FormItemProps;
291
- }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
291
+ }, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
292
292
  declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
293
293
  declare const _default$1: typeof __VLS_export$5;
294
294
  type __VLS_WithSlots$3<T, S> = T & {
@@ -300,37 +300,37 @@ type __VLS_WithSlots$3<T, S> = T & {
300
300
  //#region src/form/form-item.vue.d.ts
301
301
  declare var __VLS_10: string | number, __VLS_11: any;
302
302
  type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
303
- declare const __VLS_base$2: vue27.DefineComponent<vue27.ExtractPropTypes<{
303
+ declare const __VLS_base$2: vue54.DefineComponent<vue54.ExtractPropTypes<{
304
304
  messageLabel: {
305
- type: vue27.PropType<OrRef<string>>;
305
+ type: vue54.PropType<OrRef<string>>;
306
306
  default: string;
307
307
  };
308
308
  formatMessage: {
309
- type: vue27.PropType<AnyFunction>;
309
+ type: vue54.PropType<AnyFunction>;
310
310
  default: null;
311
311
  };
312
312
  hideRequiredAsterisk: {
313
- type: vue27.PropType<boolean>;
313
+ type: vue54.PropType<boolean>;
314
314
  default: boolean;
315
315
  };
316
- }>, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
316
+ }>, {}, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<vue54.ExtractPropTypes<{
317
317
  messageLabel: {
318
- type: vue27.PropType<OrRef<string>>;
318
+ type: vue54.PropType<OrRef<string>>;
319
319
  default: string;
320
320
  };
321
321
  formatMessage: {
322
- type: vue27.PropType<AnyFunction>;
322
+ type: vue54.PropType<AnyFunction>;
323
323
  default: null;
324
324
  };
325
325
  hideRequiredAsterisk: {
326
- type: vue27.PropType<boolean>;
326
+ type: vue54.PropType<boolean>;
327
327
  default: boolean;
328
328
  };
329
329
  }>> & Readonly<{}>, {
330
+ hideRequiredAsterisk: boolean;
330
331
  messageLabel: any;
331
332
  formatMessage: AnyFunction;
332
- hideRequiredAsterisk: boolean;
333
- }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
333
+ }, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
334
334
  declare const __VLS_export$4: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
335
335
  declare const _default$3: typeof __VLS_export$4;
336
336
  type __VLS_WithSlots$2<T, S> = T & {
@@ -340,7 +340,7 @@ type __VLS_WithSlots$2<T, S> = T & {
340
340
  };
341
341
  //#endregion
342
342
  //#region src/form/form-field.vue.d.ts
343
- declare const __VLS_export$3: vue27.DefineComponent<{}, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
343
+ declare const __VLS_export$3: vue54.DefineComponent<{}, {}, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
344
344
  declare const _default$2: typeof __VLS_export$3;
345
345
  //#endregion
346
346
  //#region src/form/index.d.ts
@@ -352,16 +352,20 @@ type TdFormItemInstance = InstanceType<typeof _default$3>;
352
352
  type TableColumnProp = {
353
353
  slots: {
354
354
  type: PropType<OrArray<SlotDef>>;
355
- default: () => null;
355
+ default: null;
356
356
  };
357
357
  columns: {
358
- type: PropType<any[]>;
358
+ type: PropType<TdTableColumnProps[]>;
359
359
  default: () => never[];
360
360
  };
361
361
  transform: {
362
362
  type: PropType<AnyFunction[]>;
363
363
  default: () => never[];
364
364
  };
365
+ hide: {
366
+ type: PropType<boolean | Ref$1<boolean>>;
367
+ default: false;
368
+ };
365
369
  };
366
370
  type TdTableColumnProps = ExtractPublicPropTypes<TableColumnProp> & TableColumnInstance["$props"];
367
371
  declare const tableColumnPropsDef: TableColumnProp;
@@ -380,19 +384,19 @@ type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof
380
384
  } & {
381
385
  after?: (props: typeof __VLS_19) => any;
382
386
  };
383
- declare const __VLS_base$1: vue27.DefineComponent<vue27.ExtractPropTypes<{
387
+ declare const __VLS_base$1: vue54.DefineComponent<vue54.ExtractPropTypes<{
384
388
  columns: {
385
- type: vue27.PropType<TdTableColumnProps[]>;
389
+ type: vue54.PropType<TdTableColumnProps[]>;
386
390
  default: () => never[];
387
391
  };
388
- }>, TableInstance, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
392
+ }>, TableInstance, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<vue54.ExtractPropTypes<{
389
393
  columns: {
390
- type: vue27.PropType<TdTableColumnProps[]>;
394
+ type: vue54.PropType<TdTableColumnProps[]>;
391
395
  default: () => never[];
392
396
  };
393
397
  }>> & Readonly<{}>, {
394
398
  columns: TdTableColumnProps[];
395
- }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
399
+ }, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
396
400
  declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
397
401
  declare const _default$4: typeof __VLS_export$2;
398
402
  type __VLS_WithSlots$1<T, S> = T & {
@@ -402,37 +406,46 @@ type __VLS_WithSlots$1<T, S> = T & {
402
406
  };
403
407
  //#endregion
404
408
  //#region src/table/table-col.vue.d.ts
405
- declare const __VLS_export$1: vue27.DefineComponent<vue27.ExtractPropTypes<{
409
+ declare const __VLS_export$1: vue54.DefineComponent<vue54.ExtractPropTypes<{
406
410
  slots: {
407
- type: vue27.PropType<OrArray<SlotDef>>;
408
- default: () => null;
411
+ type: vue54.PropType<OrArray<SlotDef>>;
412
+ default: null;
409
413
  };
410
414
  columns: {
411
- type: vue27.PropType<any[]>;
415
+ type: vue54.PropType<TdTableColumnProps[]>;
412
416
  default: () => never[];
413
417
  };
414
418
  transform: {
415
- type: vue27.PropType<AnyFunction[]>;
419
+ type: vue54.PropType<AnyFunction[]>;
416
420
  default: () => never[];
417
421
  };
418
- }>, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
422
+ hide: {
423
+ type: vue54.PropType<boolean | vue54.Ref<boolean>>;
424
+ default: false;
425
+ };
426
+ }>, {}, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<vue54.ExtractPropTypes<{
419
427
  slots: {
420
- type: vue27.PropType<OrArray<SlotDef>>;
421
- default: () => null;
428
+ type: vue54.PropType<OrArray<SlotDef>>;
429
+ default: null;
422
430
  };
423
431
  columns: {
424
- type: vue27.PropType<any[]>;
432
+ type: vue54.PropType<TdTableColumnProps[]>;
425
433
  default: () => never[];
426
434
  };
427
435
  transform: {
428
- type: vue27.PropType<AnyFunction[]>;
436
+ type: vue54.PropType<AnyFunction[]>;
429
437
  default: () => never[];
430
438
  };
439
+ hide: {
440
+ type: vue54.PropType<boolean | vue54.Ref<boolean>>;
441
+ default: false;
442
+ };
431
443
  }>> & Readonly<{}>, {
432
444
  slots: OrArray<SlotDef>;
433
- columns: any[];
445
+ columns: TdTableColumnProps[];
434
446
  transform: AnyFunction[];
435
- }, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
447
+ hide: boolean | vue54.Ref<boolean, boolean>;
448
+ }, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
436
449
  declare const _default$5: typeof __VLS_export$1;
437
450
  //#endregion
438
451
  //#region src/table/index.d.ts
@@ -465,7 +478,7 @@ declare var __VLS_13: "default" | "title" | "header" | "footer", __VLS_14: {
465
478
  titleClass?: string | undefined;
466
479
  };
467
480
  type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
468
- declare const __VLS_base: vue27.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
481
+ declare const __VLS_base: vue54.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
469
482
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
470
483
  declare const _default: typeof __VLS_export;
471
484
  type __VLS_WithSlots<T, S> = T & {
@@ -479,10 +492,10 @@ type Instance = InstanceType<typeof _default>;
479
492
  type TdDialogInstance = Instance & Omit<DialogInstance, keyof Instance & string>;
480
493
  //#endregion
481
494
  //#region src/hooks/use-reuse.d.ts
482
- 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, {
495
+ declare function useReuse(): (vue54.DefineComponent<{}, () => null, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any> | vue54.DefineComponent<{}, () => vue54.VNode<vue54.RendererNode, vue54.RendererElement, {
483
496
  [key: string]: any;
484
- }>[] | undefined, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any> | vue27.ComputedRef<Readonly<{
485
- [name: string]: vue27.Slot<any> | undefined;
497
+ }>[] | undefined, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any> | vue54.ComputedRef<Readonly<{
498
+ [name: string]: vue54.Slot<any> | undefined;
486
499
  }>>)[];
487
500
  //#endregion
488
501
  //#region src/utils/index.d.ts
package/dist/index.js CHANGED
@@ -413,15 +413,14 @@ var widget_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
413
413
  const props = __props;
414
414
  const attrs = useAttrs();
415
415
  const formCtx = inject(formCtxKey);
416
- const tempValue = shallowRef(props.formatter(getDeepValue(formCtx.model, attrs["full-prop"])));
416
+ const modelModifiers = computed(() => Object.fromEntries(props.modifiers.map((m) => [m, true])));
417
417
  const widgetModel = computed({
418
418
  get() {
419
- if (props.modifiers.includes("lazy")) return tempValue.value;
420
419
  return props.formatter(getDeepValue(formCtx.model, attrs["full-prop"]));
421
420
  },
422
421
  set(v) {
423
- if (props.modifiers.includes("lazy")) tempValue.value = v;
424
- else updateModelValue(v);
422
+ const parsed = props.parser(v);
423
+ setDeepValue(formCtx.model, attrs["full-prop"], parsed);
425
424
  }
426
425
  });
427
426
  if (!isNullOrUndef(props.default)) widgetModel.value = props.default;
@@ -435,15 +434,6 @@ var widget_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
435
434
  ...pick(props, ["rules", /^label/])
436
435
  };
437
436
  });
438
- function onModelChange() {
439
- if (props.modifiers.includes("lazy")) updateModelValue(tempValue.value);
440
- }
441
- function updateModelValue(v) {
442
- const parsed = props.parser(v);
443
- if (props.modifiers.includes("trim")) setDeepValue(formCtx.model, attrs["full-prop"], parsed.trim());
444
- else if (props.modifiers.includes("number")) setDeepValue(formCtx.model, attrs["full-prop"], Number(parsed));
445
- else setDeepValue(formCtx.model, attrs["full-prop"], parsed);
446
- }
447
437
  const Widget = resolveWidget(props.component);
448
438
  const widgetAttrs = computed(() => {
449
439
  return {
@@ -467,9 +457,10 @@ var widget_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
467
457
  "ctx-key": unref(formCtxKey)
468
458
  }), null, 16, ["scope", "ctx-key"]);
469
459
  }), 128)),
470
- !!unref(Widget) ? (openBlock(), createBlock(unref(Widget), mergeProps({ key: 0 }, widgetAttrs.value, { onBlur: onModelChange }, toHandlers(_ctx.on), {
460
+ !!unref(Widget) ? (openBlock(), createBlock(unref(Widget), mergeProps({ key: 0 }, widgetAttrs.value, toHandlers(_ctx.on), {
471
461
  modelValue: widgetModel.value,
472
462
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => widgetModel.value = $event),
463
+ modelModifiers: modelModifiers.value,
473
464
  class: "widget-component"
474
465
  }), createSlots({ _: 2 }, [renderList(unref(widgetSlots), (sc) => {
475
466
  return {
@@ -479,7 +470,7 @@ var widget_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
479
470
  "ctx-key": unref(formCtxKey)
480
471
  }), null, 16, ["scope", "ctx-key"])])
481
472
  };
482
- })]), 1040, ["modelValue"])) : createCommentVNode("v-if", true),
473
+ })]), 1040, ["modelValue", "modelModifiers"])) : createCommentVNode("v-if", true),
483
474
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(afterSlots), (ssc) => {
484
475
  return openBlock(), createBlock(deep_slot_default, mergeProps({ key: ssc.name }, { ref_for: true }, ssc, {
485
476
  scope: { value: widgetModel.value },
@@ -557,9 +548,9 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
557
548
  temp.splice(index + 1, 0, current);
558
549
  updateValue(temp);
559
550
  },
560
- add(index) {
551
+ add(index, newValue) {
561
552
  const temp = values.value.slice();
562
- const rawValue = props.rawValue?.() || {};
553
+ const rawValue = newValue instanceof Event || isNullOrUndef(newValue) ? props.rawValue?.() || {} : newValue;
563
554
  temp.splice(index + 1, 0, rawValue);
564
555
  updateValue(temp);
565
556
  },
@@ -613,7 +604,9 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
613
604
  first: !vi,
614
605
  last: vi === values.value.length - 1,
615
606
  empty: false,
616
- single: values.value.length === 1
607
+ single: values.value.length === 1,
608
+ row: v,
609
+ "full-prop": parentFullProp.value
617
610
  }, null, 8, [
618
611
  "up",
619
612
  "down",
@@ -622,7 +615,9 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
622
615
  "index",
623
616
  "first",
624
617
  "last",
625
- "single"
618
+ "single",
619
+ "row",
620
+ "full-prop"
626
621
  ])) : createCommentVNode("v-if", true)])], 4);
627
622
  }), 128))]),
628
623
  _: 1
@@ -790,7 +785,7 @@ const tableColumnPropsDef = {
790
785
  Object,
791
786
  String
792
787
  ],
793
- default: () => null
788
+ default: null
794
789
  },
795
790
  columns: {
796
791
  type: Array,
@@ -799,6 +794,10 @@ const tableColumnPropsDef = {
799
794
  transform: {
800
795
  type: Array,
801
796
  default: () => []
797
+ },
798
+ hide: {
799
+ type: [Boolean, Object],
800
+ default: false
802
801
  }
803
802
  };
804
803
  const tablePropsDef = { columns: {
@@ -816,6 +815,7 @@ var table_col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
816
815
  setup(__props) {
817
816
  const props = __props;
818
817
  const attrs = useAttrs();
818
+ const visibleColumns = computed(() => props.columns.filter((col) => !unref(col.hide)));
819
819
  function filtered(scope) {
820
820
  const { row, column } = scope;
821
821
  return props.transform.reduce((res, filter) => filter(res, row, column), getDeepValue(row, column.property));
@@ -824,7 +824,7 @@ var table_col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
824
824
  return (_ctx, _cache) => {
825
825
  const _component_TdTableCol = resolveComponent("TdTableCol");
826
826
  return openBlock(), createBlock(unref(ElTableColumn), normalizeProps(guardReactiveProps(_ctx.$attrs)), createSlots({
827
- default: withCtx(() => [_ctx.columns.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.columns, (col) => {
827
+ default: withCtx(() => [visibleColumns.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(visibleColumns.value, (col) => {
828
828
  return openBlock(), createBlock(_component_TdTableCol, mergeProps({ key: col.label }, { ref_for: true }, col), null, 16);
829
829
  }), 128)) : createCommentVNode("v-if", true)]),
830
830
  _: 2
@@ -857,6 +857,8 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
857
857
  __name: "table",
858
858
  props: tablePropsDef,
859
859
  setup(__props, { expose: __expose }) {
860
+ const props = __props;
861
+ const visibleColumns = computed(() => props.columns.filter((col) => !unref(col.hide)));
860
862
  const slots = useSlots();
861
863
  const tableRef = ref(null);
862
864
  const slotNames = computed(() => Object.keys(slots));
@@ -876,7 +878,7 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
876
878
  ref_key: "tableRef",
877
879
  ref: tableRef
878
880
  }, _ctx.$attrs), createSlots({
879
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (col) => {
881
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (col) => {
880
882
  return openBlock(), createBlock(table_col_default, mergeProps({ key: col.label }, { ref_for: true }, col), null, 16);
881
883
  }), 128))]),
882
884
  _: 2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiddy",
3
- "version": "2.0.8",
3
+ "version": "2.1.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",