@aplus-frontend/ui 0.0.33 → 0.0.35

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.
Files changed (77) hide show
  1. package/es/index.mjs +217 -215
  2. package/es/src/ap-field/select/index.vue.mjs +36 -32
  3. package/es/src/ap-form/ap-form-item-group/index.vue.mjs +27 -26
  4. package/es/src/ap-form/ap-form.vue.d.ts +1 -1
  5. package/es/src/ap-form/ap-form.vue2.mjs +40 -40
  6. package/es/src/ap-form/interface.d.ts +1 -1
  7. package/es/src/ap-form/search-form/index.vue.mjs +79 -78
  8. package/es/src/ap-modal/utils/createModal.mjs +34 -31
  9. package/es/src/ap-table/ap-table.vue.d.ts +54 -11
  10. package/es/src/ap-table/ap-table.vue.mjs +171 -148
  11. package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  12. package/es/src/ap-table/hooks/use-table-paging.mjs +48 -47
  13. package/es/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
  14. package/es/src/ap-table/hooks/use-table-row-selection.mjs +62 -0
  15. package/es/src/ap-table/interface.d.ts +14 -2
  16. package/es/src/ap-table/style/ap-table.css +2 -0
  17. package/es/src/ap-upload/apUpload.vue.d.ts +3 -3
  18. package/es/src/ap-upload/hooks/useOss.d.ts +3 -3
  19. package/es/src/business/ap-select-layout/index.css +117 -0
  20. package/es/src/business/ap-select-layout/index.d.ts +4 -0
  21. package/es/src/business/ap-select-layout/interface.d.ts +9 -0
  22. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
  23. package/es/src/business/ap-select-layout/select-layout.vue.mjs +4 -0
  24. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +145 -0
  25. package/es/src/business/index.d.ts +76 -1
  26. package/es/src/business/index.mjs +9 -6
  27. package/es/src/config-provider/config-provider.d.ts +144 -1
  28. package/es/src/config-provider/config-provider.mjs +35 -29
  29. package/es/src/config-provider/index.mjs +22 -20
  30. package/es/src/design-token/index.mjs +1 -1
  31. package/es/src/editable-table/form-item.vue.d.ts +7 -7
  32. package/es/src/editable-table/form-item.vue.mjs +2 -2
  33. package/es/src/editable-table/index.vue.d.ts +7 -7
  34. package/es/src/editable-table/index.vue.mjs +10 -10
  35. package/es/src/editable-table/interface.d.ts +1 -1
  36. package/es/src/index.mjs +188 -186
  37. package/es/src/theme/ap-select-layout/ap-select-layout.css +117 -0
  38. package/es/src/theme/ap-table/ap-table.css +2 -0
  39. package/lib/index.js +1 -1
  40. package/lib/src/ap-field/select/index.vue.js +1 -1
  41. package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
  42. package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
  43. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  44. package/lib/src/ap-form/interface.d.ts +1 -1
  45. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  46. package/lib/src/ap-modal/utils/createModal.js +1 -1
  47. package/lib/src/ap-table/ap-table.vue.d.ts +54 -11
  48. package/lib/src/ap-table/ap-table.vue.js +1 -1
  49. package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  50. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  51. package/lib/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
  52. package/lib/src/ap-table/hooks/use-table-row-selection.js +1 -0
  53. package/lib/src/ap-table/interface.d.ts +14 -2
  54. package/lib/src/ap-table/style/ap-table.css +2 -0
  55. package/lib/src/ap-upload/apUpload.vue.d.ts +3 -3
  56. package/lib/src/ap-upload/hooks/useOss.d.ts +3 -3
  57. package/lib/src/business/ap-select-layout/index.css +117 -0
  58. package/lib/src/business/ap-select-layout/index.d.ts +4 -0
  59. package/lib/src/business/ap-select-layout/interface.d.ts +9 -0
  60. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
  61. package/lib/src/business/ap-select-layout/select-layout.vue.js +1 -0
  62. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -0
  63. package/lib/src/business/index.d.ts +76 -1
  64. package/lib/src/business/index.js +1 -1
  65. package/lib/src/config-provider/config-provider.d.ts +144 -1
  66. package/lib/src/config-provider/config-provider.js +1 -1
  67. package/lib/src/config-provider/index.js +1 -1
  68. package/lib/src/design-token/index.js +1 -1
  69. package/lib/src/editable-table/form-item.vue.d.ts +7 -7
  70. package/lib/src/editable-table/form-item.vue.js +1 -1
  71. package/lib/src/editable-table/index.vue.d.ts +7 -7
  72. package/lib/src/editable-table/index.vue.js +1 -1
  73. package/lib/src/editable-table/interface.d.ts +1 -1
  74. package/lib/src/index.js +1 -1
  75. package/lib/src/theme/ap-select-layout/ap-select-layout.css +117 -0
  76. package/lib/src/theme/ap-table/ap-table.css +2 -0
  77. package/package.json +2 -2
@@ -1,9 +1,10 @@
1
- import { ApColumnType, ApTableProps, ValueEnum, RequestData } from './interface';
1
+ import { ApColumnType, ApTableProps, ValueEnum, ApTableRowSelection, RequestData } from './interface';
2
2
  import { ComputedRef, ExtractPropTypes, PropType, VNode, RendererNode, RendererElement, CSSProperties, VNodeProps, AllowedComponentProps, ComponentCustomProps, ShallowUnwrapRef } from 'vue';
3
3
  import { ColumnType } from 'ant-design-vue/es/table';
4
+ import { RowSelectionReturnType } from './hooks/use-table-row-selection';
4
5
  import { SpinSize } from 'ant-design-vue/es/spin/Spin';
5
6
  import { VueTypeValidableDef } from '../../node_modules/vue-types';
6
- import { GetPopupContainer, FilterValue, SorterResult, TableCurrentDataSource, TableLocale, CompareFn, ColumnFilterItem, SortOrder, TableRowSelection } from 'ant-design-vue/es/table/interface';
7
+ import { GetPopupContainer, FilterValue, SorterResult, TableCurrentDataSource, TableLocale, CompareFn, ColumnFilterItem, SortOrder } from 'ant-design-vue/es/table/interface';
7
8
  import { RenderExpandIcon, PanelRender, TableComponents, TransformCellText, TableLayout, GetRowKey, TableSticky, RowClassName, GetComponentProps, ColumnType, Key, ExpandedRowRender } from 'ant-design-vue/es/vc-table/interface';
8
9
  import { TablePaginationConfig } from 'ant-design-vue';
9
10
  import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
@@ -671,6 +672,7 @@ declare const _default: <RecordType>(__VLS_props: {
671
672
  onOpenChange: PropType<(vis: boolean) => void>;
672
673
  'onUpdate:open': PropType<(vis: boolean) => void>;
673
674
  }>> | undefined;
675
+ rowSelection?: true | ApTableRowSelection<RecordType> | undefined;
674
676
  rowClassName?: string | RowClassName<RecordType> | undefined;
675
677
  showHeader?: boolean | undefined;
676
678
  customRow?: GetComponentProps<RecordType> | undefined;
@@ -690,7 +692,6 @@ declare const _default: <RecordType>(__VLS_props: {
690
692
  childrenColumnName?: string | undefined;
691
693
  rowExpandable?: ((record: RecordType) => boolean) | undefined;
692
694
  onResizeColumn?: ((w: number, col: ColumnType<any>) => void) | undefined;
693
- rowSelection?: TableRowSelection<RecordType> | undefined;
694
695
  manual?: boolean | undefined;
695
696
  request?: ((params: Partial<any> & {
696
697
  pageSize: number;
@@ -712,7 +713,9 @@ declare const _default: <RecordType>(__VLS_props: {
712
713
  default: any;
713
714
  emptyText?: any;
714
715
  expandIcon?: any;
715
- title?: any;
716
+ title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
717
+ selectedRows: RecordType[];
718
+ }) => any) | undefined;
716
719
  footer?: any;
717
720
  summary?: any;
718
721
  expandedRowRender?: any;
@@ -728,7 +731,9 @@ declare const _default: <RecordType>(__VLS_props: {
728
731
  default: any;
729
732
  emptyText?: any;
730
733
  expandIcon?: any;
731
- title?: any;
734
+ title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
735
+ selectedRows: RecordType[];
736
+ }) => any) | undefined;
732
737
  footer?: any;
733
738
  summary?: any;
734
739
  expandedRowRender?: any;
@@ -748,6 +753,16 @@ declare const _default: <RecordType>(__VLS_props: {
748
753
  setSearchFormValues: (fields: any) => void;
749
754
  getSearchFormValues: () => Partial<any> | undefined;
750
755
  dataSource: ComputedRef<RecordType[]>;
756
+ rowSelection: {
757
+ select: (item: RecordType) => void;
758
+ unSelect: (item: RecordType) => void;
759
+ isSelected: (item: RecordType) => boolean;
760
+ selectAll: () => void;
761
+ unSelectAll: () => void;
762
+ clearAll: () => void;
763
+ toggleSelect: (item: RecordType) => void;
764
+ selectedRows: ComputedRef<RecordType[]>;
765
+ };
751
766
  }>) => void) | undefined, __VLS_setup?: Promise<{
752
767
  props: {
753
768
  loading?: boolean | Partial< ExtractPropTypes<{
@@ -1402,6 +1417,7 @@ declare const _default: <RecordType>(__VLS_props: {
1402
1417
  onOpenChange: PropType<(vis: boolean) => void>;
1403
1418
  'onUpdate:open': PropType<(vis: boolean) => void>;
1404
1419
  }>> | undefined;
1420
+ rowSelection?: true | ApTableRowSelection<RecordType> | undefined;
1405
1421
  rowClassName?: string | RowClassName<RecordType> | undefined;
1406
1422
  showHeader?: boolean | undefined;
1407
1423
  customRow?: GetComponentProps<RecordType> | undefined;
@@ -1421,7 +1437,6 @@ declare const _default: <RecordType>(__VLS_props: {
1421
1437
  childrenColumnName?: string | undefined;
1422
1438
  rowExpandable?: ((record: RecordType) => boolean) | undefined;
1423
1439
  onResizeColumn?: ((w: number, col: ColumnType<any>) => void) | undefined;
1424
- rowSelection?: TableRowSelection<RecordType> | undefined;
1425
1440
  manual?: boolean | undefined;
1426
1441
  request?: ((params: Partial<any> & {
1427
1442
  pageSize: number;
@@ -1444,13 +1459,25 @@ declare const _default: <RecordType>(__VLS_props: {
1444
1459
  setSearchFormValues: (fields: any) => void;
1445
1460
  getSearchFormValues: () => Partial<any> | undefined;
1446
1461
  dataSource: ComputedRef<RecordType[]>;
1462
+ rowSelection: {
1463
+ select: (item: RecordType) => void;
1464
+ unSelect: (item: RecordType) => void;
1465
+ isSelected: (item: RecordType) => boolean;
1466
+ selectAll: () => void;
1467
+ unSelectAll: () => void;
1468
+ clearAll: () => void;
1469
+ toggleSelect: (item: RecordType) => void;
1470
+ selectedRows: ComputedRef<RecordType[]>;
1471
+ };
1447
1472
  }>): void;
1448
1473
  attrs: any;
1449
1474
  slots: Readonly<{
1450
1475
  default: any;
1451
1476
  emptyText?: any;
1452
1477
  expandIcon?: any;
1453
- title?: any;
1478
+ title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
1479
+ selectedRows: RecordType[];
1480
+ }) => any) | undefined;
1454
1481
  footer?: any;
1455
1482
  summary?: any;
1456
1483
  expandedRowRender?: any;
@@ -1466,7 +1493,9 @@ declare const _default: <RecordType>(__VLS_props: {
1466
1493
  default: any;
1467
1494
  emptyText?: any;
1468
1495
  expandIcon?: any;
1469
- title?: any;
1496
+ title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
1497
+ selectedRows: RecordType[];
1498
+ }) => any) | undefined;
1470
1499
  footer?: any;
1471
1500
  summary?: any;
1472
1501
  expandedRowRender?: any;
@@ -2137,6 +2166,7 @@ declare const _default: <RecordType>(__VLS_props: {
2137
2166
  onOpenChange: PropType<(vis: boolean) => void>;
2138
2167
  'onUpdate:open': PropType<(vis: boolean) => void>;
2139
2168
  }>> | undefined;
2169
+ rowSelection?: true | ApTableRowSelection<RecordType> | undefined;
2140
2170
  rowClassName?: string | RowClassName<RecordType> | undefined;
2141
2171
  showHeader?: boolean | undefined;
2142
2172
  customRow?: GetComponentProps<RecordType> | undefined;
@@ -2156,7 +2186,6 @@ declare const _default: <RecordType>(__VLS_props: {
2156
2186
  childrenColumnName?: string | undefined;
2157
2187
  rowExpandable?: ((record: RecordType) => boolean) | undefined;
2158
2188
  onResizeColumn?: ((w: number, col: ColumnType<any>) => void) | undefined;
2159
- rowSelection?: TableRowSelection<RecordType> | undefined;
2160
2189
  manual?: boolean | undefined;
2161
2190
  request?: ((params: Partial<any> & {
2162
2191
  pageSize: number;
@@ -2179,13 +2208,25 @@ declare const _default: <RecordType>(__VLS_props: {
2179
2208
  setSearchFormValues: (fields: any) => void;
2180
2209
  getSearchFormValues: () => Partial<any> | undefined;
2181
2210
  dataSource: ComputedRef<RecordType[]>;
2211
+ rowSelection: {
2212
+ select: (item: RecordType) => void;
2213
+ unSelect: (item: RecordType) => void;
2214
+ isSelected: (item: RecordType) => boolean;
2215
+ selectAll: () => void;
2216
+ unSelectAll: () => void;
2217
+ clearAll: () => void;
2218
+ toggleSelect: (item: RecordType) => void;
2219
+ selectedRows: ComputedRef<RecordType[]>;
2220
+ };
2182
2221
  }>): void;
2183
2222
  attrs: any;
2184
2223
  slots: Readonly<{
2185
2224
  default: any;
2186
2225
  emptyText?: any;
2187
2226
  expandIcon?: any;
2188
- title?: any;
2227
+ title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
2228
+ selectedRows: RecordType[];
2229
+ }) => any) | undefined;
2189
2230
  footer?: any;
2190
2231
  summary?: any;
2191
2232
  expandedRowRender?: any;
@@ -2201,7 +2242,9 @@ declare const _default: <RecordType>(__VLS_props: {
2201
2242
  default: any;
2202
2243
  emptyText?: any;
2203
2244
  expandIcon?: any;
2204
- title?: any;
2245
+ title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
2246
+ selectedRows: RecordType[];
2247
+ }) => any) | undefined;
2205
2248
  footer?: any;
2206
2249
  summary?: any;
2207
2250
  expandedRowRender?: any;
@@ -1,22 +1,23 @@
1
- import { defineComponent as te, useSlots as oe, computed as s, createVNode as d, mergeProps as f, unref as l, watch as re, openBlock as i, createElementBlock as m, normalizeClass as F, normalizeStyle as R, createSlots as L, withCtx as p, Fragment as le, renderList as E, createBlock as ne, resolveDynamicComponent as se, renderSlot as w, createCommentVNode as O, createElementVNode as V, toDisplayString as de, normalizeProps as ue, guardReactiveProps as ie } from "vue";
2
- import { Typography as pe, Table as ce, Tooltip as fe } from "ant-design-vue";
3
- import { useToken as me } from "ant-design-vue/es/theme/internal";
4
- import { ApForm as ge } from "../ap-form/index.mjs";
5
- import { apTableRenderItemMap as ye, noRenderAsFormItemValueList as z, apTableFormItemMap as be } from "./constants.mjs";
1
+ import { defineComponent as ne, useSlots as se, computed as s, createVNode as d, mergeProps as p, unref as r, watch as de, openBlock as c, createElementBlock as y, normalizeClass as F, normalizeStyle as T, createSlots as V, withCtx as f, Fragment as ue, renderList as z, createBlock as ie, resolveDynamicComponent as pe, renderSlot as x, createCommentVNode as D, createElementVNode as K, toDisplayString as ce, normalizeProps as fe, guardReactiveProps as me } from "vue";
2
+ import { Typography as ge, Table as ye, Tooltip as be } from "ant-design-vue";
3
+ import { useToken as Se } from "ant-design-vue/es/theme/internal";
4
+ import { ApForm as he } from "../ap-form/index.mjs";
5
+ import { apTableRenderItemMap as we, noRenderAsFormItemValueList as N, apTableFormItemMap as Ce } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
- import { useTablePaging as he } from "./hooks/use-table-paging.mjs";
8
- import { omit as N, isUndefined as x, isBoolean as Ce } from "lodash-unified";
7
+ import { useTablePaging as Re } from "./hooks/use-table-paging.mjs";
8
+ import { omit as W, isUndefined as u, isBoolean as Fe } from "lodash-unified";
9
9
  import "./style/ap-table.css";
10
- import { QuestionCircleOutlined as Se } from "@ant-design/icons-vue";
11
- import { apColumnToColumn as Fe, getTableRenderType as Re, getTableRenderProps as we, getColumnOrder as D, updateFormProps as xe, getFieldProps as Te, getPlaceholder as Be } from "./utils.mjs";
12
- import Pe from "./hooks/use-table-content-height.mjs";
13
- import { getRawDisplayValue as ve } from "../editable-table/utils.mjs";
14
- import { useLocale as Ie } from "../config-provider/hooks/use-locale.mjs";
15
- import { useNamespace as ke } from "../config-provider/hooks/use-namespace.mjs";
16
- import { useGlobalConfig as Le } from "../config-provider/hooks/use-global-config.mjs";
17
- const Ee = {
10
+ import { QuestionCircleOutlined as Te } from "@ant-design/icons-vue";
11
+ import { apColumnToColumn as xe, getTableRenderType as ve, getTableRenderProps as Be, getColumnOrder as _, updateFormProps as Pe, getFieldProps as Ie, getPlaceholder as ke } from "./utils.mjs";
12
+ import Le from "./hooks/use-table-content-height.mjs";
13
+ import { getRawDisplayValue as Ee } from "../editable-table/utils.mjs";
14
+ import Oe from "./hooks/use-table-row-selection.mjs";
15
+ import { useLocale as Ve } from "../config-provider/hooks/use-locale.mjs";
16
+ import { useNamespace as ze } from "../config-provider/hooks/use-namespace.mjs";
17
+ import { useGlobalConfig as De } from "../config-provider/hooks/use-global-config.mjs";
18
+ const Ke = {
18
19
  key: 0
19
- }, Ue = /* @__PURE__ */ te({
20
+ }, aa = /* @__PURE__ */ ne({
20
21
  name: "ApTable",
21
22
  __name: "ap-table",
22
23
  props: {
@@ -32,7 +33,6 @@ const Ee = {
32
33
  locale: {},
33
34
  onChange: {},
34
35
  onResizeColumn: {},
35
- rowSelection: {},
36
36
  getPopupContainer: {},
37
37
  scroll: {},
38
38
  sortDirections: {
@@ -96,6 +96,9 @@ const Ee = {
96
96
  },
97
97
  transformCellText: {},
98
98
  columns: {},
99
+ rowSelection: {
100
+ type: Boolean
101
+ },
99
102
  card: {
100
103
  type: Boolean,
101
104
  default: !1
@@ -130,206 +133,226 @@ const Ee = {
130
133
  default: !1
131
134
  }
132
135
  },
133
- setup(W, {
134
- expose: _
136
+ setup(j, {
137
+ expose: A
135
138
  }) {
136
- const o = W;
137
- let T = 0;
138
- const B = oe(), [, j] = me(), {
139
- t: A
140
- } = Ie(), {
141
- e: g,
142
- b: u
143
- } = ke("ap-table"), M = Le("uiMode", "aplus"), {
144
- height: q,
145
- contentRef: H
146
- } = Pe(), y = s(() => {
139
+ const a = j;
140
+ let v = 0;
141
+ const B = se(), [, M] = Se(), {
142
+ t: q
143
+ } = Ve(), {
144
+ e: b,
145
+ b: i
146
+ } = ze("ap-table"), H = De("uiMode", "aplus"), {
147
+ height: $,
148
+ contentRef: G
149
+ } = Le(), S = s(() => {
147
150
  var t;
148
- let e = ((t = o.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
149
- return e = e.map((a) => ({
150
- ...N(Fe(a), ["ellipsis"]),
151
+ let e = ((t = a.columns) == null ? void 0 : t.filter((o) => !o.hideInTable)) || [];
152
+ return e = e.map((o) => ({
153
+ ...W(xe(o), ["ellipsis"]),
151
154
  customRender({
152
- value: r,
155
+ value: l,
153
156
  ...n
154
157
  }) {
155
- const C = Re(a), k = ye[C], ae = we(a, {
156
- value: r,
158
+ const C = ve(o), O = we[C], le = Be(o, {
159
+ value: l,
157
160
  ...n
158
161
  });
159
- let S = Y(a, r, d(k, f(ae, {
162
+ let R = oe(o, l, d(O, p(le, {
160
163
  mode: "read"
161
164
  }), null));
162
- return a.customRender && (S = a.customRender({
163
- value: r,
165
+ return o.customRender && (R = o.customRender({
166
+ value: l,
164
167
  ...n,
165
- column: a,
166
- originalNode: S
167
- })), S;
168
+ column: o,
169
+ originalNode: R
170
+ })), R;
168
171
  }
169
172
  })), e;
170
173
  }), P = s(() => {
171
- var e, t, a;
172
- return T++, ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !z.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
173
- let C = D(r.order);
174
- return D(n.order) - C;
175
- })) == null ? void 0 : a.map((r) => {
176
- const n = xe(r, Te(r.fieldProps, {}));
174
+ var e, t, o;
175
+ return v++, ((o = (t = (e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !N.includes(l.valueType))) == null ? void 0 : t.sort((l, n) => {
176
+ let C = _(l.order);
177
+ return _(n.order) - C;
178
+ })) == null ? void 0 : o.map((l) => {
179
+ const n = Pe(l, Ie(l.fieldProps, {}));
177
180
  return {
178
- ...r,
181
+ ...l,
179
182
  fieldProps: {
180
- label: r.title,
181
- name: r.dataIndex,
183
+ label: l.title,
184
+ name: l.dataIndex,
182
185
  ...n || {},
183
186
  // 格式化placeholder
184
- placeholder: Be(A, r.valueType, n == null ? void 0 : n.placeholder),
185
- _signal: T
187
+ placeholder: ke(q, l.valueType, n == null ? void 0 : n.placeholder),
188
+ _signal: v
186
189
  }
187
190
  };
188
191
  })) || [];
189
- }), K = s(() => l(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), $ = s(() => l(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
190
- formRef: b,
191
- submit: v,
192
- reset: I,
193
- tableProps: c,
194
- handleTableChange: G,
195
- data: h
196
- } = he({
192
+ }), Q = s(() => r(S).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), U = s(() => r(S).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), J = s(() => u(a.dataSource) ? g.value.records : a.dataSource), {
193
+ rowSelection: I,
194
+ selectedRows: k,
195
+ ...h
196
+ } = Oe({
197
+ ...a.rowSelection === !0 ? {} : a.rowSelection,
198
+ rowKey: a.rowKey,
199
+ dataSource: J
200
+ }), {
201
+ formRef: w,
202
+ submit: L,
203
+ reset: E,
204
+ tableProps: m,
205
+ handleTableChange: X,
206
+ data: g
207
+ } = Re({
197
208
  async request(e) {
198
- var a, r;
199
- const t = await ((a = o.request) == null ? void 0 : a.call(o, e));
200
- return (r = o.onLoad) == null || r.call(o, (t == null ? void 0 : t.data) || []), {
209
+ var o, l;
210
+ !I.value.preserveSelectedRowKeys && u(a.dataSource) && h.clearAll();
211
+ const t = await ((o = a.request) == null ? void 0 : o.call(a, e));
212
+ return (l = a.onLoad) == null || l.call(a, (t == null ? void 0 : t.data) || []), {
201
213
  data: (t == null ? void 0 : t.data) || [],
202
214
  total: (t == null ? void 0 : t.total) || 0
203
215
  };
204
216
  },
205
- filterFields: l($),
206
- sortFields: l(K),
207
- defaultParams: o.params,
208
- defaultData: o.defaultData,
209
- manual: o.manual,
210
- defaultCurrent: o.pagination ? o.pagination.defaultCurrent : void 0,
211
- defaultPageSize: o.pagination ? o.pagination.defaultPageSize : void 0,
212
- formatParams: o.beforeSearchSubmit
213
- }), Q = s(() => {
217
+ filterFields: r(U),
218
+ sortFields: r(Q),
219
+ defaultParams: a.params,
220
+ defaultData: a.defaultData,
221
+ manual: a.manual,
222
+ defaultCurrent: a.pagination ? a.pagination.defaultCurrent : void 0,
223
+ defaultPageSize: a.pagination ? a.pagination.defaultPageSize : void 0,
224
+ formatParams: a.beforeSearchSubmit
225
+ }), Y = s(() => {
214
226
  var e;
215
- return o.scroll ? o.scroll : o.adaptive && (h.value.total > 0 || (e = o.dataSource) != null && e.length) ? {
216
- y: l(q),
227
+ return a.scroll ? a.scroll : a.adaptive && (g.value.total > 0 || (e = a.dataSource) != null && e.length) ? {
228
+ y: r($),
217
229
  x: "100%"
218
230
  } : {
219
231
  x: !0
220
232
  };
221
- }), U = s(() => {
233
+ }), Z = s(() => {
222
234
  var e;
223
- if (o.tableLayout)
224
- return o.tableLayout;
225
- if ((e = o.columns) != null && e.some((t) => t.ellipsis))
235
+ if (a.tableLayout)
236
+ return a.tableLayout;
237
+ if ((e = a.columns) != null && e.some((t) => t.ellipsis))
226
238
  return "fixed";
227
- }), J = s(() => {
228
- const e = l(c), t = x(o.dataSource) ? e : {
239
+ }), ee = s(() => {
240
+ const e = r(m), t = u(a.dataSource) ? e : {
229
241
  ...e,
230
- dataSource: o.dataSource,
231
- onChange: o.onChange
232
- };
242
+ dataSource: a.dataSource,
243
+ onChange: a.onChange
244
+ }, o = r(I);
233
245
  return {
234
- ...o,
246
+ ...a,
235
247
  ...t,
236
- loading: x(o.loading) ? l(c).loading : o.loading,
237
- pagination: o.pagination === !1 ? !1 : l(c).pagination,
238
- scroll: l(Q)
248
+ rowSelection: a.rowSelection ? {
249
+ ...o,
250
+ // tips 如果是前端分页,则默认会走缓存
251
+ preserveSelectedRowKeys: u(a.dataSource) ? o.preserveSelectedRowKeys : !0
252
+ } : void 0,
253
+ loading: u(a.loading) ? r(m).loading : a.loading,
254
+ pagination: a.pagination === !1 ? !1 : r(m).pagination,
255
+ scroll: r(Y)
239
256
  };
240
- }), X = s(() => [u(), o.card ? null : u("wrapper"), o.adaptive ? u("adaptive") : null].filter(Boolean));
241
- function Y(e, t, a) {
242
- return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(pe.Paragraph, {
257
+ }), ae = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
258
+ function oe(e, t, o) {
259
+ return N.includes(e.valueType) ? o : e.copyable || e.ellipsis ? d(ge.Paragraph, {
243
260
  copyable: e.copyable ? {
244
261
  text: t,
245
262
  tooltip: !1
246
263
  } : !1,
247
- ellipsis: e.ellipsis ? Ce(e.ellipsis) ? {
264
+ ellipsis: e.ellipsis ? Fe(e.ellipsis) ? {
248
265
  tooltip: t
249
266
  } : {
250
267
  ...e.ellipsis,
251
268
  tooltip: t
252
269
  } : !1,
253
- content: e.ellipsis ? ve(e, t) : a
254
- }, null) : a;
270
+ content: e.ellipsis ? Ee(e, t) : o
271
+ }, null) : o;
255
272
  }
256
- re(() => l(h).loading, (e) => {
273
+ de(() => r(g).loading, (e) => {
257
274
  var t;
258
- (t = o.onLoadingChange) == null || t.call(o, e);
275
+ (t = a.onLoadingChange) == null || t.call(a, e);
259
276
  });
260
- function Z(e) {
261
- var t, a, r;
262
- (r = (a = (t = b.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
277
+ function te(e) {
278
+ var t, o, l;
279
+ (l = (o = (t = w.value) == null ? void 0 : t.apForm) == null ? void 0 : o.setFieldsValue) == null || l.call(o, e);
263
280
  }
264
- function ee() {
265
- var e, t, a;
266
- return (a = (t = (e = b.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
281
+ function re() {
282
+ var e, t, o;
283
+ return (o = (t = (e = w.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : o.call(t, !0);
267
284
  }
268
- return _({
269
- submit: () => v(),
270
- reset: () => I(),
271
- setSearchFormValues: Z,
272
- getSearchFormValues: ee,
273
- dataSource: s(() => l(h).records)
274
- }), (e, t) => (i(), m("div", {
275
- class: F(X.value)
276
- }, [l(x)(e.dataSource) && e.searchForm !== !1 && P.value.length > 0 ? (i(), m("div", {
285
+ return A({
286
+ submit: () => L(),
287
+ reset: () => E(),
288
+ setSearchFormValues: te,
289
+ getSearchFormValues: re,
290
+ dataSource: s(() => r(g).records),
291
+ rowSelection: {
292
+ selectedRows: s(() => r(k)),
293
+ ...h
294
+ }
295
+ }), (e, t) => (c(), y("div", {
296
+ class: F(ae.value)
297
+ }, [r(u)(e.dataSource) && e.searchForm !== !1 && P.value.length > 0 ? (c(), y("div", {
277
298
  key: 0,
278
- class: F(e.card ? l(g)("search-wrapper") : null),
279
- style: R(e.searchFormWrapperStyle)
280
- }, [d(l(ge).SearchForm, f(e.searchForm || {}, {
299
+ class: F(e.card ? r(b)("search-wrapper") : null),
300
+ style: T(e.searchFormWrapperStyle)
301
+ }, [d(r(he).SearchForm, p(e.searchForm || {}, {
281
302
  ref_key: "formRef",
282
- ref: b,
303
+ ref: w,
283
304
  "custom-reset": "",
284
- onSubmit: l(v),
285
- onReset: l(I),
286
- "submit-loading": l(c).loading
287
- }), L({
288
- default: p(() => [(i(!0), m(le, null, E(P.value, (a) => (i(), ne(se(a.customRenderFormItem ? a.customRenderFormItem(a) : l(be)[a.valueType || "text"]), f({
289
- key: a.dataIndex,
305
+ onSubmit: r(L),
306
+ onReset: r(E),
307
+ "submit-loading": r(m).loading
308
+ }), V({
309
+ default: f(() => [(c(!0), y(ue, null, z(P.value, (o) => (c(), ie(pe(o.customRenderFormItem ? o.customRenderFormItem(o) : r(Ce)[o.valueType || "text"]), p({
310
+ key: o.dataIndex,
290
311
  ref_for: !0
291
- }, a.fieldProps || {}, {
292
- span: a.span
312
+ }, o.fieldProps || {}, {
313
+ span: o.span
293
314
  }), null, 16, ["span"]))), 128))]),
294
315
  _: 2
295
316
  }, [B.searchFormExtra ? {
296
317
  name: "extra",
297
- fn: p(() => [w(e.$slots, "searchFormExtra")]),
318
+ fn: f(() => [x(e.$slots, "searchFormExtra")]),
298
319
  key: "0"
299
- } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : O("", !0), V("div", {
320
+ } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : D("", !0), K("div", {
300
321
  ref_key: "contentRef",
301
- ref: H,
302
- class: F([l(g)("table-wrapper"), e.card ? l(g)("table-wrapper-card") : null]),
303
- style: R(e.tableWrapperStyle)
304
- }, [w(e.$slots, "title"), d(l(ce), f({
305
- class: l(M) === "admin" ? l(u)("table-admin") : l(u)("table")
306
- }, J.value, {
307
- "table-layout": U.value,
308
- onChange: l(G),
309
- columns: y.value
310
- }), L({
311
- headerCell: p(({
312
- column: a,
313
- title: r
314
- }) => [a.tooltip ? (i(), m("span", Ee, [V("span", null, de(r), 1), d(l(fe), {
315
- title: a.tooltip,
322
+ ref: G,
323
+ class: F([r(b)("table-wrapper"), e.card ? r(b)("table-wrapper-card") : null]),
324
+ style: T(e.tableWrapperStyle)
325
+ }, [x(e.$slots, "title", p({
326
+ selectedRows: r(k)
327
+ }, h)), d(r(ye), p({
328
+ class: r(H) === "admin" ? r(i)("table-admin") : r(i)("table")
329
+ }, ee.value, {
330
+ "table-layout": Z.value,
331
+ onChange: r(X),
332
+ columns: S.value
333
+ }), V({
334
+ headerCell: f(({
335
+ column: o,
336
+ title: l
337
+ }) => [o.tooltip ? (c(), y("span", Ke, [K("span", null, ce(l), 1), d(r(be), {
338
+ title: o.tooltip,
316
339
  placement: "bottom"
317
340
  }, {
318
- default: p(() => [d(l(Se), {
319
- style: R({
341
+ default: f(() => [d(r(Te), {
342
+ style: T({
320
343
  paddingLeft: "4px",
321
- color: l(j).colorPrimary
344
+ color: r(M).colorPrimary
322
345
  })
323
346
  }, null, 8, ["style"])]),
324
347
  _: 2
325
- }, 1032, ["title"])])) : O("", !0)]),
348
+ }, 1032, ["title"])])) : D("", !0)]),
326
349
  _: 2
327
- }, [E(l(N)(B, ["title", "searchFormExtra"]), (a, r) => ({
328
- name: r,
329
- fn: p((n) => [w(e.$slots, r, ue(ie(n || {})))])
350
+ }, [z(r(W)(B, ["title", "searchFormExtra"]), (o, l) => ({
351
+ name: l,
352
+ fn: f((n) => [x(e.$slots, l, fe(me(n || {})))])
330
353
  }))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
331
354
  }
332
355
  });
333
356
  export {
334
- Ue as default
357
+ aa as default
335
358
  };
@@ -79,4 +79,5 @@ export declare const useTablePaging: <DataType = any, ParamsType = Record<string
79
79
  onChange: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<any> | SorterResult<any>[], extra: TableCurrentDataSource<any>) => void;
80
80
  dataSource: DataType[];
81
81
  }>;
82
+ dataSource: ComputedRef<DataType[]>;
82
83
  };