@qin-ui/antd-vue-pro 1.0.35 → 1.0.37

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/es/index.d.ts CHANGED
@@ -491,7 +491,7 @@ declare const _default_3: <D extends Record<string, any>>(__VLS_props: {
491
491
  table?: ({
492
492
  dataSource: Ref<D[]>;
493
493
  columns: Ref<Columns<D>>;
494
- checkedColumns: Ref<(keyof D & string)[]>;
494
+ showColumnKeys: Ref<(keyof D & string)[]>;
495
495
  searchParam: Ref<Partial<D & Record<string, any>>>;
496
496
  searchFields: Ref<Fields<Partial<D>>>;
497
497
  pagination: Ref<Partial<ExtractPropTypes<{
@@ -587,7 +587,7 @@ declare const _default_3: <D extends Record<string, any>>(__VLS_props: {
587
587
  } & {
588
588
  setSearchParam: SetFormData;
589
589
  setSearchField: SetField;
590
- setCheckedColumns: (val: string[]) => void;
590
+ setShowColumnKeys: (val: string[]) => void;
591
591
  setPagination: (val: Partial<ExtractPropTypes<{
592
592
  total: NumberConstructor;
593
593
  defaultCurrent: NumberConstructor;
@@ -717,8 +717,7 @@ declare const _default_3: <D extends Record<string, any>>(__VLS_props: {
717
717
  searchContainer?: ContainerComponent | any;
718
718
  controlContainer?: ContainerComponent | any;
719
719
  tableContainer?: ContainerComponent | any;
720
- paramCache?: ParamCache | undefined;
721
- disabledParamCache?: boolean | undefined;
720
+ paramCache?: ParamCache | null | undefined;
722
721
  immediateSearch?: boolean | undefined;
723
722
  onResizeColumn?: ((w: number, col: ColumnType_2<any>) => void) | undefined;
724
723
  rowSelection?: TableRowSelection<any> | undefined;
@@ -935,7 +934,7 @@ declare const _default_3: <D extends Record<string, any>>(__VLS_props: {
935
934
  table?: ({
936
935
  dataSource: Ref<D[]>;
937
936
  columns: Ref<Columns<D>>;
938
- checkedColumns: Ref<(keyof D & string)[]>;
937
+ showColumnKeys: Ref<(keyof D & string)[]>;
939
938
  searchParam: Ref<Partial<D & Record<string, any>>>;
940
939
  searchFields: Ref<Fields<Partial<D>>>;
941
940
  pagination: Ref<Partial<ExtractPropTypes<{
@@ -1031,7 +1030,7 @@ declare const _default_3: <D extends Record<string, any>>(__VLS_props: {
1031
1030
  } & {
1032
1031
  setSearchParam: SetFormData;
1033
1032
  setSearchField: SetField;
1034
- setCheckedColumns: (val: string[]) => void;
1033
+ setShowColumnKeys: (val: string[]) => void;
1035
1034
  setPagination: (val: Partial<ExtractPropTypes<{
1036
1035
  total: NumberConstructor;
1037
1036
  defaultCurrent: NumberConstructor;
@@ -1161,8 +1160,7 @@ declare const _default_3: <D extends Record<string, any>>(__VLS_props: {
1161
1160
  searchContainer?: ContainerComponent | any;
1162
1161
  controlContainer?: ContainerComponent | any;
1163
1162
  tableContainer?: ContainerComponent | any;
1164
- paramCache?: ParamCache | undefined;
1165
- disabledParamCache?: boolean | undefined;
1163
+ paramCache?: ParamCache | null | undefined;
1166
1164
  immediateSearch?: boolean | undefined;
1167
1165
  onResizeColumn?: ((w: number, col: ColumnType_2<any>) => void) | undefined;
1168
1166
  rowSelection?: TableRowSelection<any> | undefined;
@@ -1383,7 +1381,7 @@ declare const _default_3: <D extends Record<string, any>>(__VLS_props: {
1383
1381
  table?: ({
1384
1382
  dataSource: Ref<D[]>;
1385
1383
  columns: Ref<Columns<D>>;
1386
- checkedColumns: Ref<(keyof D & string)[]>;
1384
+ showColumnKeys: Ref<(keyof D & string)[]>;
1387
1385
  searchParam: Ref<Partial<D & Record<string, any>>>;
1388
1386
  searchFields: Ref<Fields<Partial<D>>>;
1389
1387
  pagination: Ref<Partial<ExtractPropTypes<{
@@ -1479,7 +1477,7 @@ declare const _default_3: <D extends Record<string, any>>(__VLS_props: {
1479
1477
  } & {
1480
1478
  setSearchParam: SetFormData;
1481
1479
  setSearchField: SetField;
1482
- setCheckedColumns: (val: string[]) => void;
1480
+ setShowColumnKeys: (val: string[]) => void;
1483
1481
  setPagination: (val: Partial<ExtractPropTypes<{
1484
1482
  total: NumberConstructor;
1485
1483
  defaultCurrent: NumberConstructor;
@@ -1609,8 +1607,7 @@ declare const _default_3: <D extends Record<string, any>>(__VLS_props: {
1609
1607
  searchContainer?: ContainerComponent | any;
1610
1608
  controlContainer?: ContainerComponent | any;
1611
1609
  tableContainer?: ContainerComponent | any;
1612
- paramCache?: ParamCache | undefined;
1613
- disabledParamCache?: boolean | undefined;
1610
+ paramCache?: ParamCache | null | undefined;
1614
1611
  immediateSearch?: boolean | undefined;
1615
1612
  onResizeColumn?: ((w: number, col: ColumnType_2<any>) => void) | undefined;
1616
1613
  rowSelection?: TableRowSelection<any> | undefined;
@@ -3102,7 +3099,7 @@ export declare const ProTable: SFCWithInstall<(<D extends Record<string, any>>(_
3102
3099
  table?: ({
3103
3100
  dataSource: Ref<D[]>;
3104
3101
  columns: Ref<Columns<D>>;
3105
- checkedColumns: Ref<(keyof D & string)[]>;
3102
+ showColumnKeys: Ref<(keyof D & string)[]>;
3106
3103
  searchParam: Ref<Partial<D & Record<string, any>>>;
3107
3104
  searchFields: Ref<Fields<Partial<D>>>;
3108
3105
  pagination: Ref<Partial<ExtractPropTypes<{
@@ -3198,7 +3195,7 @@ export declare const ProTable: SFCWithInstall<(<D extends Record<string, any>>(_
3198
3195
  } & {
3199
3196
  setSearchParam: SetFormData;
3200
3197
  setSearchField: SetField;
3201
- setCheckedColumns: (val: string[]) => void;
3198
+ setShowColumnKeys: (val: string[]) => void;
3202
3199
  setPagination: (val: Partial<ExtractPropTypes<{
3203
3200
  total: NumberConstructor;
3204
3201
  defaultCurrent: NumberConstructor;
@@ -3328,8 +3325,7 @@ export declare const ProTable: SFCWithInstall<(<D extends Record<string, any>>(_
3328
3325
  searchContainer?: any;
3329
3326
  controlContainer?: any;
3330
3327
  tableContainer?: any;
3331
- paramCache?: ParamCache | undefined;
3332
- disabledParamCache?: boolean | undefined;
3328
+ paramCache?: ParamCache | null | undefined;
3333
3329
  immediateSearch?: boolean | undefined;
3334
3330
  onResizeColumn?: ((w: number, col: TableColumnType<any>) => void) | undefined;
3335
3331
  rowSelection?: TableRowSelection<any> | undefined;
@@ -3546,7 +3542,7 @@ export declare const ProTable: SFCWithInstall<(<D extends Record<string, any>>(_
3546
3542
  table?: ({
3547
3543
  dataSource: Ref<D[]>;
3548
3544
  columns: Ref<Columns<D>>;
3549
- checkedColumns: Ref<(keyof D & string)[]>;
3545
+ showColumnKeys: Ref<(keyof D & string)[]>;
3550
3546
  searchParam: Ref<Partial<D & Record<string, any>>>;
3551
3547
  searchFields: Ref<Fields<Partial<D>>>;
3552
3548
  pagination: Ref<Partial<ExtractPropTypes<{
@@ -3642,7 +3638,7 @@ export declare const ProTable: SFCWithInstall<(<D extends Record<string, any>>(_
3642
3638
  } & {
3643
3639
  setSearchParam: SetFormData;
3644
3640
  setSearchField: SetField;
3645
- setCheckedColumns: (val: string[]) => void;
3641
+ setShowColumnKeys: (val: string[]) => void;
3646
3642
  setPagination: (val: Partial<ExtractPropTypes<{
3647
3643
  total: NumberConstructor;
3648
3644
  defaultCurrent: NumberConstructor;
@@ -3772,8 +3768,7 @@ export declare const ProTable: SFCWithInstall<(<D extends Record<string, any>>(_
3772
3768
  searchContainer?: any;
3773
3769
  controlContainer?: any;
3774
3770
  tableContainer?: any;
3775
- paramCache?: ParamCache | undefined;
3776
- disabledParamCache?: boolean | undefined;
3771
+ paramCache?: ParamCache | null | undefined;
3777
3772
  immediateSearch?: boolean | undefined;
3778
3773
  onResizeColumn?: ((w: number, col: TableColumnType<any>) => void) | undefined;
3779
3774
  rowSelection?: TableRowSelection<any> | undefined;
@@ -3994,7 +3989,7 @@ export declare const ProTable: SFCWithInstall<(<D extends Record<string, any>>(_
3994
3989
  table?: ({
3995
3990
  dataSource: Ref<D[]>;
3996
3991
  columns: Ref<Columns<D>>;
3997
- checkedColumns: Ref<(keyof D & string)[]>;
3992
+ showColumnKeys: Ref<(keyof D & string)[]>;
3998
3993
  searchParam: Ref<Partial<D & Record<string, any>>>;
3999
3994
  searchFields: Ref<Fields<Partial<D>>>;
4000
3995
  pagination: Ref<Partial<ExtractPropTypes<{
@@ -4090,7 +4085,7 @@ export declare const ProTable: SFCWithInstall<(<D extends Record<string, any>>(_
4090
4085
  } & {
4091
4086
  setSearchParam: SetFormData;
4092
4087
  setSearchField: SetField;
4093
- setCheckedColumns: (val: string[]) => void;
4088
+ setShowColumnKeys: (val: string[]) => void;
4094
4089
  setPagination: (val: Partial<ExtractPropTypes<{
4095
4090
  total: NumberConstructor;
4096
4091
  defaultCurrent: NumberConstructor;
@@ -4220,8 +4215,7 @@ export declare const ProTable: SFCWithInstall<(<D extends Record<string, any>>(_
4220
4215
  searchContainer?: any;
4221
4216
  controlContainer?: any;
4222
4217
  tableContainer?: any;
4223
- paramCache?: ParamCache | undefined;
4224
- disabledParamCache?: boolean | undefined;
4218
+ paramCache?: ParamCache | null | undefined;
4225
4219
  immediateSearch?: boolean | undefined;
4226
4220
  onResizeColumn?: ((w: number, col: TableColumnType<any>) => void) | undefined;
4227
4221
  rowSelection?: TableRowSelection<any> | undefined;
@@ -4399,7 +4393,7 @@ declare type SwitchSlots = FieldSlot<'checkedChildren' | 'unCheckedChildren'>;
4399
4393
  export declare type Table<D extends Data = Data> = {
4400
4394
  dataSource: Array<D>;
4401
4395
  columns: Columns<D>;
4402
- checkedColumns: Array<keyof D & string>;
4396
+ showColumnKeys: Array<keyof D & string>;
4403
4397
  searchParam: Partial<D & Record<string, any>>;
4404
4398
  searchFields: Fields<Partial<D>>;
4405
4399
  pagination: PaginationProps;
@@ -4487,7 +4481,7 @@ export declare type UseTable<T extends Data = Data> = <D extends T = T>(init: Pa
4487
4481
  } & {
4488
4482
  setSearchParam: SetFormData;
4489
4483
  setSearchField: SetField;
4490
- setCheckedColumns: (val: Array<string>) => void;
4484
+ setShowColumnKeys: (val: Array<string>) => void;
4491
4485
  setPagination: (val: PaginationProps) => void;
4492
4486
  resetQueryParams: () => void;
4493
4487
  };
package/es/style.css CHANGED
@@ -19,10 +19,10 @@
19
19
  .search .expand-transition[data-v-41c82259] {
20
20
  transition: all 0.25s;
21
21
  }
22
- .control-icon[data-v-104a603d] {
22
+ .control-icon[data-v-2776fca6] {
23
23
  cursor: pointer;
24
24
  }
25
- .control-icon[data-v-104a603d] :hover {
25
+ .control-icon[data-v-2776fca6] :hover {
26
26
  color: #1677ff;
27
27
  }
28
28
  .search-container[data-v-c00ace37] {
@@ -41,11 +41,11 @@
41
41
  padding: 24px 24px 16px;
42
42
  background-color: #fff;
43
43
  }
44
- .pro-table[data-v-1a65329a] {
44
+ .pro-table[data-v-864e5a75] {
45
45
  display: flex;
46
46
  flex-direction: column;
47
47
  min-width: 800px;
48
48
  }
49
- .pro-table[data-v-1a65329a] .ant-pagination .ant-pagination-total-text {
49
+ .pro-table[data-v-864e5a75] .ant-pagination .ant-pagination-total-text {
50
50
  flex: 1;
51
51
  }
package/es/table/index.js CHANGED
@@ -221,11 +221,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
221
221
  const checkedColumns = computed({
222
222
  get() {
223
223
  var _a;
224
- return ((_a = props.table) == null ? void 0 : _a.checkedColumns.value) || [];
224
+ return ((_a = props.table) == null ? void 0 : _a.showColumnKeys.value) || [];
225
225
  },
226
226
  set(val) {
227
227
  var _a;
228
- (_a = props.table) == null ? void 0 : _a.setCheckedColumns(val || []);
228
+ (_a = props.table) == null ? void 0 : _a.setShowColumnKeys(val || []);
229
229
  }
230
230
  });
231
231
  const onCheckAllChange = (e) => {
@@ -341,8 +341,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
341
341
  };
342
342
  }
343
343
  });
344
- const Control_vue_vue_type_style_index_0_scoped_104a603d_lang = "";
345
- const Control = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-104a603d"]]);
344
+ const Control_vue_vue_type_style_index_0_scoped_2776fca6_lang = "";
345
+ const Control = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-2776fca6"]]);
346
346
  const DefaultSearchContainer_vue_vue_type_style_index_0_scoped_c00ace37_lang = "";
347
347
  const _sfc_main$3 = {};
348
348
  const _hoisted_1$3 = { class: "search-container" };
@@ -400,7 +400,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
400
400
  controlContainer: { default: DefaultControlContainer },
401
401
  tableContainer: { default: DefaultTableContainer },
402
402
  paramCache: { default: void 0 },
403
- disabledParamCache: { type: Boolean, default: false },
404
403
  immediateSearch: { type: Boolean, default: false }
405
404
  },
406
405
  emits: ["search"],
@@ -410,7 +409,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
410
409
  const injectProps = inject(
411
410
  PRO_TABLE_INJECT_COMPONENT_PROPS_KEYS.table
412
411
  );
413
- const cache = props.disabledParamCache ? void 0 : props.paramCache ?? (injectProps == null ? void 0 : injectProps.paramCache);
412
+ const cache = props.paramCache === void 0 ? injectProps == null ? void 0 : injectProps.paramCache : props.paramCache;
414
413
  const size = ref(unref(props.size));
415
414
  const attrs = useAttrs();
416
415
  const { table = {} } = props;
@@ -419,7 +418,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
419
418
  dataSource,
420
419
  pagination,
421
420
  setPagination,
422
- checkedColumns,
421
+ showColumnKeys,
423
422
  searchParam,
424
423
  setSearchParam
425
424
  } = table;
@@ -513,7 +512,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
513
512
  list = (mergeTableProps == null ? void 0 : mergeTableProps.value.columns) || [];
514
513
  } else {
515
514
  list = ((_a2 = mergeTableProps.value.columns) == null ? void 0 : _a2.filter(
516
- (item) => item.key && checkedColumns.value.includes(item.key)
515
+ (item) => item.key && showColumnKeys.value.includes(item.key)
517
516
  )) || [];
518
517
  }
519
518
  if (props.addIndexColumn) {
@@ -587,13 +586,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
587
586
  };
588
587
  }
589
588
  });
590
- const Table_vue_vue_type_style_index_0_scoped_1a65329a_lang = "";
591
- const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1a65329a"]]);
589
+ const Table_vue_vue_type_style_index_0_scoped_864e5a75_lang = "";
590
+ const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-864e5a75"]]);
592
591
  const getDefaultPagination = () => ({ current: 1, pageSize: 10, total: 0 });
593
592
  const useTable = ({
594
593
  columns: initColumns = [],
595
594
  dataSource: initDataSource = [],
596
- checkedColumns: initCheckedColumns = void 0,
595
+ showColumnKeys: initShowColumnKeys = void 0,
597
596
  pagination: initPagination = getDefaultPagination(),
598
597
  searchParam: initSearchParam = {},
599
598
  searchFields: initSearchFields = []
@@ -601,16 +600,24 @@ const useTable = ({
601
600
  const _initSearchParam = cloneDeep(unref(initSearchParam));
602
601
  const columns = ref(initColumns);
603
602
  const dataSource = ref(initDataSource);
604
- const checkedColumns = ref(
605
- initCheckedColumns ?? columns.value.map(
603
+ const showColumnKeys = ref(
604
+ initShowColumnKeys ?? columns.value.map(
606
605
  (item, index) => {
607
606
  var _a;
608
607
  return item.key ?? ((_a = item.dataIndex) == null ? void 0 : _a.toString()) ?? index;
609
608
  }
610
609
  )
611
610
  );
612
- const setCheckedColumns = (val) => {
613
- checkedColumns.value = val;
611
+ watch(columns, (val) => {
612
+ showColumnKeys.value = val.map(
613
+ (item, index) => {
614
+ var _a;
615
+ return item.key ?? ((_a = item.dataIndex) == null ? void 0 : _a.toString()) ?? index;
616
+ }
617
+ );
618
+ });
619
+ const setShowColumnKeys = (val) => {
620
+ showColumnKeys.value = val;
614
621
  };
615
622
  const pagination = ref(initPagination);
616
623
  const setPagination = (val) => {
@@ -632,12 +639,12 @@ const useTable = ({
632
639
  columns,
633
640
  dataSource,
634
641
  pagination,
635
- checkedColumns,
642
+ showColumnKeys,
636
643
  searchParam,
637
644
  setSearchParam,
638
645
  searchFields,
639
646
  setSearchField,
640
- setCheckedColumns,
647
+ setShowColumnKeys,
641
648
  setPagination,
642
649
  resetQueryParams
643
650
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/antd-vue-pro",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "description": "二次封装antd vue组件",
5
5
  "type": "module",
6
6
  "main": "",