@aplus-frontend/ui 0.0.20 → 0.0.22

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 (53) hide show
  1. package/es/index.mjs +34 -32
  2. package/es/src/ap-form/hooks/use-watch.d.ts +2 -2
  3. package/es/src/ap-form/modal-form/index.vue.mjs +41 -39
  4. package/es/src/ap-list/hooks/use-offline-list.d.ts +21 -0
  5. package/es/src/ap-list/hooks/use-offline-list.mjs +32 -0
  6. package/es/src/ap-list/index.d.ts +4 -0
  7. package/es/src/ap-list/index.mjs +2 -0
  8. package/es/src/ap-list/index.vue.d.ts +153 -0
  9. package/es/src/ap-list/index.vue.mjs +137 -0
  10. package/es/src/ap-list/index.vue2.mjs +4 -0
  11. package/es/src/ap-list/interface.d.ts +100 -0
  12. package/es/src/ap-list/interface.mjs +1 -0
  13. package/es/src/ap-list/style/index.css +11 -0
  14. package/es/src/ap-table/ap-table.vue.mjs +123 -113
  15. package/es/src/ap-table/interface.d.ts +8 -6
  16. package/es/src/ap-table/style/ap-table.css +19 -0
  17. package/es/src/ap-table/utils.d.ts +826 -670
  18. package/es/src/editable-table/hooks/use-get-columns.d.ts +3 -25
  19. package/es/src/editable-table/hooks/use-get-columns.mjs +47 -45
  20. package/es/src/editable-table/interface.d.ts +6 -1
  21. package/es/src/editable-table/style/index.css +3 -0
  22. package/es/src/index.d.ts +1 -0
  23. package/es/src/index.mjs +230 -227
  24. package/es/src/theme/ap-list/index.css +11 -0
  25. package/es/src/theme/ap-table/ap-table.css +19 -0
  26. package/es/src/theme/editable-table/index.css +3 -0
  27. package/lib/index.js +1 -1
  28. package/lib/src/ap-form/hooks/use-watch.d.ts +2 -2
  29. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  30. package/lib/src/ap-list/hooks/use-offline-list.d.ts +21 -0
  31. package/lib/src/ap-list/hooks/use-offline-list.js +1 -0
  32. package/lib/src/ap-list/index.d.ts +4 -0
  33. package/lib/src/ap-list/index.js +1 -0
  34. package/lib/src/ap-list/index.vue.d.ts +153 -0
  35. package/lib/src/ap-list/index.vue.js +1 -0
  36. package/lib/src/ap-list/index.vue2.js +1 -0
  37. package/lib/src/ap-list/interface.d.ts +100 -0
  38. package/lib/src/ap-list/interface.js +1 -0
  39. package/lib/src/ap-list/style/index.css +11 -0
  40. package/lib/src/ap-table/ap-table.vue.js +1 -1
  41. package/lib/src/ap-table/interface.d.ts +8 -6
  42. package/lib/src/ap-table/style/ap-table.css +19 -0
  43. package/lib/src/ap-table/utils.d.ts +826 -670
  44. package/lib/src/editable-table/hooks/use-get-columns.d.ts +3 -25
  45. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  46. package/lib/src/editable-table/interface.d.ts +6 -1
  47. package/lib/src/editable-table/style/index.css +3 -0
  48. package/lib/src/index.d.ts +1 -0
  49. package/lib/src/index.js +1 -1
  50. package/lib/src/theme/ap-list/index.css +11 -0
  51. package/lib/src/theme/ap-table/ap-table.css +19 -0
  52. package/lib/src/theme/editable-table/index.css +3 -0
  53. package/package.json +1 -1
@@ -0,0 +1,137 @@
1
+ import { defineComponent as F, ref as M, unref as e, computed as l, watch as W, openBlock as r, createBlock as C, normalizeClass as s, withCtx as j, createElementVNode as A, normalizeStyle as P, renderSlot as c, createElementBlock as m, Fragment as G, renderList as U, createVNode as x, mergeProps as H, createCommentVNode as J } from "vue";
2
+ import { Empty as D, Spin as K, Pagination as Q } from "ant-design-vue";
3
+ import "../ap-table/index.mjs";
4
+ import "../config-provider/index.mjs";
5
+ import { isUndefined as k, omit as X } from "lodash-unified";
6
+ import { useOfflineList as Y } from "./hooks/use-offline-list.mjs";
7
+ import "./style/index.css";
8
+ import { useNamespace as Z } from "../config-provider/hooks/use-namespace.mjs";
9
+ import { useTablePaging as ee } from "../ap-table/hooks/use-table-paging.mjs";
10
+ const fe = /* @__PURE__ */ F({
11
+ __name: "index",
12
+ props: {
13
+ dataSource: {},
14
+ loading: { type: Boolean, default: void 0 },
15
+ onItem: {},
16
+ params: {},
17
+ request: {},
18
+ defaultData: {},
19
+ onLoadingChange: {},
20
+ beforeSearchSubmit: {},
21
+ pagination: { type: [Boolean, Object], default: void 0 },
22
+ manual: { type: Boolean },
23
+ containerStyle: {},
24
+ footerWarpperStyle: {}
25
+ },
26
+ setup(B, { expose: E }) {
27
+ const w = D.PRESENTED_IMAGE_SIMPLE, t = B, { b: d, e: g } = Z("ap-list"), p = M(), {
28
+ formRef: I,
29
+ submit: S,
30
+ reset: h,
31
+ handleTableChange: L,
32
+ data: u,
33
+ refresh: z,
34
+ refreshByDelete: N,
35
+ tableProps: y
36
+ } = ee({
37
+ async request(a) {
38
+ var o;
39
+ const n = await ((o = t.request) == null ? void 0 : o.call(t, a));
40
+ return {
41
+ data: (n == null ? void 0 : n.data) || [],
42
+ total: (n == null ? void 0 : n.total) || 0
43
+ };
44
+ },
45
+ defaultParams: t.params,
46
+ defaultData: t.defaultData,
47
+ manual: t.manual,
48
+ defaultCurrent: t.pagination ? t.pagination.defaultCurrent : void 0,
49
+ defaultPageSize: t.pagination ? t.pagination.defaultPageSize : void 0,
50
+ formatParams: t.beforeSearchSubmit
51
+ }), R = { form: I }, {
52
+ pagination: v,
53
+ dataSource: T,
54
+ onChange: _
55
+ } = Y(t);
56
+ function q(a, n) {
57
+ if (e(i)) {
58
+ _(a, n);
59
+ return;
60
+ }
61
+ L(
62
+ { current: a, pageSize: n },
63
+ {},
64
+ {},
65
+ { currentDataSource: [], action: "paginate" }
66
+ );
67
+ }
68
+ const f = l(() => e(i) ? e(T) : e(u).records), b = l(() => k(t.loading) ? e(u).loading : t.loading), O = l(() => {
69
+ var a, n;
70
+ return t.pagination === !1 ? !1 : ((a = t.pagination) == null ? void 0 : a.hideOnSinglePage) !== !0 ? !0 : e(i) ? (((n = t.dataSource) == null ? void 0 : n.length) || 0) > e(v).pageSize : e(u).total > e(y).pagination.pageSize;
71
+ }), i = l(() => !k(t.dataSource));
72
+ W(
73
+ () => e(b),
74
+ (a) => {
75
+ var n;
76
+ (n = t.onLoadingChange) == null || n.call(t, a);
77
+ }
78
+ );
79
+ function V(a) {
80
+ var n, o;
81
+ (o = (n = p.value) == null ? void 0 : n.querySelector(a || ":first-child")) == null || o.scrollIntoView({ behavior: "smooth", block: "center" });
82
+ }
83
+ return E({
84
+ submit: () => S(),
85
+ reset: () => h(),
86
+ refresh: () => z(),
87
+ refreshByDelete: (a) => N(a),
88
+ scrollToFirstRow: V
89
+ }), (a, n) => (r(), C(e(K), {
90
+ spinning: b.value,
91
+ class: s(e(d)("spin"))
92
+ }, {
93
+ default: j(() => [
94
+ A("div", {
95
+ class: s(e(d)()),
96
+ style: P(a.containerStyle)
97
+ }, [
98
+ c(a.$slots, "header", {
99
+ formIns: R,
100
+ submit: e(S),
101
+ reset: e(h)
102
+ }),
103
+ f.value.length === 0 ? (r(), C(e(D), {
104
+ key: 0,
105
+ image: e(w)
106
+ }, null, 8, ["image"])) : (r(), m("div", {
107
+ key: 1,
108
+ ref_key: "contentRef",
109
+ ref: p,
110
+ class: s(e(g)("content"))
111
+ }, [
112
+ c(a.$slots, "renderContent", { dataSource: f.value }, () => [
113
+ (r(!0), m(G, null, U(f.value, (o, $) => c(a.$slots, "renderItem", {
114
+ item: o,
115
+ index: $
116
+ })), 256))
117
+ ])
118
+ ], 2)),
119
+ O.value ? (r(), m("div", {
120
+ key: 2,
121
+ class: s(e(g)("footer")),
122
+ style: P(a.footerWarpperStyle)
123
+ }, [
124
+ x(e(Q), H(
125
+ i.value ? e(v) : e(X)(e(y).pagination, ["showTotal"]),
126
+ { onChange: q }
127
+ ), null, 16)
128
+ ], 6)) : J("", !0)
129
+ ], 6)
130
+ ]),
131
+ _: 3
132
+ }, 8, ["spinning", "class"]));
133
+ }
134
+ });
135
+ export {
136
+ fe as default
137
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,100 @@
1
+ import { CSSProperties } from 'vue';
2
+ import { RequestData } from '../ap-table';
3
+ import { Recordable } from '../type';
4
+
5
+ export type ApListProps<RecordType = any, ParamsType = Recordable> = {
6
+ /**
7
+ * 列表数据源,传入后`request`和`defaultData`都将失效
8
+ */
9
+ dataSource?: RecordType[];
10
+ /**
11
+ * 是否是加载中
12
+ */
13
+ loading?: boolean;
14
+ /**
15
+ * 当点击列表项时触发
16
+ * @deprecated 暂未实现
17
+ */
18
+ onItem?: (record: RecordType, index: number) => void;
19
+ /**
20
+ * 依赖的额外的参数(该参数变更不会触发网络请求)
21
+ */
22
+ params?: ParamsType;
23
+ /**
24
+ * 请求数据
25
+ * @param params
26
+ * @returns
27
+ */
28
+ request?: (params: Partial<ParamsType> & {
29
+ pageSize: number;
30
+ current: number;
31
+ }) => Promise<Partial<RequestData<RecordType>>>;
32
+ /**
33
+ * 表格的默认数据源,这些数据源将会在第一次请求后被替换
34
+ */
35
+ defaultData?: RecordType[];
36
+ /**
37
+ * 表格loading状态变更后触发
38
+ * @param loading
39
+ * @returns
40
+ */
41
+ onLoadingChange?: (loading: boolean) => void;
42
+ /**
43
+ * 查询表单提交之前,一般用于自定义对查询数据进行变更
44
+ * @param params
45
+ * @returns
46
+ */
47
+ beforeSearchSubmit?: (params: Partial<ParamsType>) => any;
48
+ /**
49
+ * 是否显示分页器(特定的分页器)或者指定默认的当前页和pageSize
50
+ */
51
+ pagination?: false | {
52
+ defaultCurrent?: number;
53
+ defaultPageSize?: number;
54
+ /**
55
+ * 只有一页时隐藏分页
56
+ */
57
+ hideOnSinglePage?: boolean;
58
+ };
59
+ /**
60
+ * 是否手动发起第一次网络请求
61
+ */
62
+ manual?: boolean;
63
+ /**
64
+ * List容器的自定义样式
65
+ */
66
+ containerStyle?: CSSProperties;
67
+ /**
68
+ * 底部分页器容器的样式
69
+ */
70
+ footerWarpperStyle?: CSSProperties;
71
+ };
72
+ export type ApListExpose = {
73
+ /**
74
+ * 重置页码并发起网络请求
75
+ * @returns
76
+ */
77
+ submit: () => void;
78
+ /**
79
+ * 重设查询表单(如果有的话)并发起网络请求
80
+ * @returns
81
+ */
82
+ reset: () => void;
83
+ /**
84
+ * 刷新当前页
85
+ * @returns
86
+ */
87
+ refresh: () => void;
88
+ /**
89
+ * 删除N条数据后刷新某一页(具体页面会计算)
90
+ * @param n 删除的n条数据
91
+ * @returns
92
+ */
93
+ refreshByDelete: (n: number) => void;
94
+ /**
95
+ * 滚动到第一行(如果无效需要你传入相对于div.ap-list__content的查询参数)
96
+ * @param selector
97
+ * @returns
98
+ */
99
+ scrollToFirstRow: (selector?: string) => void;
100
+ };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,11 @@
1
+ .aplus-ap-list {
2
+ padding: 16px 24px;
3
+ }
4
+ .aplus-ap-list__footer {
5
+ margin-top: 16px;
6
+ display: flex;
7
+ justify-content: flex-end;
8
+ }
9
+ .aplus-ap-list-spin {
10
+ max-height: unset !important;
11
+ }
@@ -1,21 +1,21 @@
1
- import { defineComponent as Z, useSlots as ee, computed as d, createVNode as s, mergeProps as m, unref as n, watch as ae, openBlock as i, createElementBlock as f, normalizeClass as F, normalizeStyle as R, createSlots as k, withCtx as p, Fragment as te, renderList as E, createBlock as oe, resolveDynamicComponent as re, renderSlot as x, createCommentVNode as O, createElementVNode as L, toDisplayString as ne, normalizeProps as le, guardReactiveProps as de } from "vue";
2
- import { Typography as se, Table as ue, Tooltip as ie } from "ant-design-vue";
3
- import { useToken as pe } from "ant-design-vue/es/theme/internal";
4
- import { ApForm as ce } from "../ap-form/index.mjs";
5
- import { apTableRenderItemMap as me, noRenderAsFormItemValueList as z, apTableFormItemMap as fe } from "./constants.mjs";
1
+ import { defineComponent as ae, useSlots as te, computed as s, createVNode as d, mergeProps as f, unref as l, watch as oe, openBlock as i, createElementBlock as m, normalizeClass as F, normalizeStyle as R, createSlots as k, withCtx as p, Fragment as re, renderList as L, createBlock as le, resolveDynamicComponent as ne, renderSlot as x, createCommentVNode as E, createElementVNode as O, toDisplayString as se, normalizeProps as de, guardReactiveProps as ue } from "vue";
2
+ import { Typography as ie, Table as pe, Tooltip as ce } from "ant-design-vue";
3
+ import { useToken as fe } from "ant-design-vue/es/theme/internal";
4
+ import { ApForm as me } from "../ap-form/index.mjs";
5
+ import { apTableRenderItemMap as ge, noRenderAsFormItemValueList as z, apTableFormItemMap as ye } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
- import { useTablePaging as ge } from "./hooks/use-table-paging.mjs";
8
- import { isUndefined as T, omit as ye } from "lodash-unified";
7
+ import { useTablePaging as be } from "./hooks/use-table-paging.mjs";
8
+ import { omit as N, isUndefined as T, isBoolean as he } from "lodash-unified";
9
9
  import "./style/ap-table.css";
10
- import { QuestionCircleOutlined as he } from "@ant-design/icons-vue";
11
- import { apColumnToColumn as be, getTableRenderType as Ce, getTableRenderProps as Se, getColumnOrder as N, updateFormProps as Fe, getFieldProps as Re, getPlaceholder as xe } from "./utils.mjs";
12
- import Te from "./hooks/use-table-content-height.mjs";
13
- import { useLocale as we } from "../config-provider/hooks/use-locale.mjs";
14
- import { useNamespace as Be } from "../config-provider/hooks/use-namespace.mjs";
15
- import { useGlobalConfig as Pe } from "../config-provider/hooks/use-global-config.mjs";
16
- const ve = {
10
+ import { QuestionCircleOutlined as Ce } from "@ant-design/icons-vue";
11
+ import { apColumnToColumn as Se, getTableRenderType as Fe, getTableRenderProps as Re, getColumnOrder as V, updateFormProps as xe, getFieldProps as Te, getPlaceholder as we } from "./utils.mjs";
12
+ import Be from "./hooks/use-table-content-height.mjs";
13
+ import { useLocale as Pe } from "../config-provider/hooks/use-locale.mjs";
14
+ import { useNamespace as ve } from "../config-provider/hooks/use-namespace.mjs";
15
+ import { useGlobalConfig as Ie } from "../config-provider/hooks/use-global-config.mjs";
16
+ const ke = {
17
17
  key: 0
18
- }, He = /* @__PURE__ */ Z({
18
+ }, $e = /* @__PURE__ */ ae({
19
19
  name: "ApTable",
20
20
  __name: "ap-table",
21
21
  props: {
@@ -129,150 +129,159 @@ const ve = {
129
129
  default: !1
130
130
  }
131
131
  },
132
- setup(V, {
133
- expose: D
132
+ setup(D, {
133
+ expose: W
134
134
  }) {
135
- const t = V, w = ee(), [, W] = pe(), {
136
- t: j
137
- } = we(), {
135
+ const o = D, w = te(), [, j] = fe(), {
136
+ t: _
137
+ } = Pe(), {
138
138
  e: g,
139
139
  b: u
140
- } = Be("ap-table"), _ = Pe("uiMode", "aplus"), {
141
- height: A,
142
- contentRef: M
143
- } = Te(), y = d(() => {
144
- var o;
145
- let e = ((o = t.columns) == null ? void 0 : o.filter((a) => !a.hideInTable)) || [];
140
+ } = ve("ap-table"), A = Ie("uiMode", "aplus"), {
141
+ height: M,
142
+ contentRef: q
143
+ } = Be(), y = s(() => {
144
+ var t;
145
+ let e = ((t = o.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
146
146
  return e = e.map((a) => ({
147
- ...be(a),
147
+ ...N(Se(a), ["ellipsis"]),
148
148
  customRender({
149
149
  value: r,
150
- ...l
150
+ ...n
151
151
  }) {
152
- const C = Ce(a), I = me[C], Y = Se(a, {
152
+ const C = Fe(a), I = ge[C], ee = Re(a, {
153
153
  value: r,
154
- ...l
154
+ ...n
155
155
  });
156
- let S = U(a, r, s(I, m(Y, {
156
+ let S = X(a, r, d(I, f(ee, {
157
157
  mode: "read"
158
158
  }), null));
159
159
  return a.customRender && (S = a.customRender({
160
160
  value: r,
161
- ...l,
161
+ ...n,
162
162
  column: a,
163
163
  originalNode: S
164
164
  })), S;
165
165
  }
166
166
  })), e;
167
- }), B = d(() => {
168
- var e, o, a;
169
- return ((a = (o = (e = t.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !z.includes(r.valueType))) == null ? void 0 : o.sort((r, l) => {
170
- let C = N(r.order);
171
- return N(l.order) - C;
167
+ }), B = s(() => {
168
+ var e, t, a;
169
+ return ((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) => {
170
+ let C = V(r.order);
171
+ return V(n.order) - C;
172
172
  })) == null ? void 0 : a.map((r) => {
173
- const l = Fe(r, Re(r.fieldProps, {}));
173
+ const n = xe(r, Te(r.fieldProps, {}));
174
174
  return {
175
175
  ...r,
176
176
  fieldProps: {
177
177
  label: r.title,
178
178
  name: r.dataIndex,
179
- ...l || {},
179
+ ...n || {},
180
180
  // 格式化placeholder
181
- placeholder: xe(j, r.valueType, l == null ? void 0 : l.placeholder)
181
+ placeholder: we(_, r.valueType, n == null ? void 0 : n.placeholder)
182
182
  }
183
183
  };
184
184
  })) || [];
185
- }), q = d(() => n(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), H = d(() => n(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
186
- formRef: h,
185
+ }), H = s(() => l(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), K = s(() => l(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
186
+ formRef: b,
187
187
  submit: P,
188
188
  reset: v,
189
189
  tableProps: c,
190
- handleTableChange: K,
191
- data: b
192
- } = ge({
190
+ handleTableChange: $,
191
+ data: h
192
+ } = be({
193
193
  async request(e) {
194
194
  var a, r;
195
- const o = await ((a = t.request) == null ? void 0 : a.call(t, e));
196
- return (r = t.onLoad) == null || r.call(t, (o == null ? void 0 : o.data) || []), {
197
- data: (o == null ? void 0 : o.data) || [],
198
- total: (o == null ? void 0 : o.total) || 0
195
+ const t = await ((a = o.request) == null ? void 0 : a.call(o, e));
196
+ return (r = o.onLoad) == null || r.call(o, (t == null ? void 0 : t.data) || []), {
197
+ data: (t == null ? void 0 : t.data) || [],
198
+ total: (t == null ? void 0 : t.total) || 0
199
199
  };
200
200
  },
201
- filterFields: n(H),
202
- sortFields: n(q),
203
- defaultParams: t.params,
204
- defaultData: t.defaultData,
205
- manual: t.manual,
206
- defaultCurrent: t.pagination ? t.pagination.defaultCurrent : void 0,
207
- defaultPageSize: t.pagination ? t.pagination.defaultPageSize : void 0,
208
- formatParams: t.beforeSearchSubmit
209
- }), $ = d(() => {
201
+ filterFields: l(K),
202
+ sortFields: l(H),
203
+ defaultParams: o.params,
204
+ defaultData: o.defaultData,
205
+ manual: o.manual,
206
+ defaultCurrent: o.pagination ? o.pagination.defaultCurrent : void 0,
207
+ defaultPageSize: o.pagination ? o.pagination.defaultPageSize : void 0,
208
+ formatParams: o.beforeSearchSubmit
209
+ }), G = s(() => {
210
210
  var e;
211
- return t.scroll ? t.scroll : t.adaptive && (b.value.total > 0 || (e = t.dataSource) != null && e.length) ? {
212
- y: n(A),
211
+ return o.scroll ? o.scroll : o.adaptive && (h.value.total > 0 || (e = o.dataSource) != null && e.length) ? {
212
+ y: l(M),
213
213
  x: "100%"
214
214
  } : {
215
215
  x: !0
216
216
  };
217
- }), G = d(() => {
218
- const e = n(c), o = T(t.dataSource) ? e : {
217
+ }), Q = s(() => {
218
+ var e;
219
+ if (o.tableLayout)
220
+ return o.tableLayout;
221
+ if ((e = o.columns) != null && e.some((t) => t.ellipsis))
222
+ return "fixed";
223
+ }), U = s(() => {
224
+ const e = l(c), t = T(o.dataSource) ? e : {
219
225
  ...e,
220
- dataSource: t.dataSource,
221
- onChange: t.onChange
226
+ dataSource: o.dataSource,
227
+ onChange: o.onChange
222
228
  };
223
229
  return {
224
- ...t,
225
230
  ...o,
226
- loading: T(t.loading) ? n(c).loading : t.loading,
227
- pagination: t.pagination === !1 ? !1 : n(c).pagination,
228
- scroll: n($)
231
+ ...t,
232
+ loading: T(o.loading) ? l(c).loading : o.loading,
233
+ pagination: o.pagination === !1 ? !1 : l(c).pagination,
234
+ scroll: l(G)
229
235
  };
230
- }), Q = d(() => [u(), t.card ? null : u("wrapper"), t.adaptive ? u("adaptive") : null].filter(Boolean));
231
- function U(e, o, a) {
232
- return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? s(se.Text, {
236
+ }), J = s(() => [u(), o.card ? null : u("wrapper"), o.adaptive ? u("adaptive") : null].filter(Boolean));
237
+ function X(e, t, a) {
238
+ return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ie.Paragraph, {
233
239
  copyable: e.copyable ? {
234
- text: o,
240
+ text: t,
235
241
  tooltip: !1
236
242
  } : !1,
237
- ellipsis: e.ellipsis ? {
238
- tooltip: o
243
+ ellipsis: e.ellipsis ? he(e.ellipsis) ? {
244
+ tooltip: t
245
+ } : {
246
+ ...e.ellipsis,
247
+ tooltip: t
239
248
  } : !1,
240
- content: a
249
+ content: e.ellipsis ? t : a
241
250
  }, null) : a;
242
251
  }
243
- ae(() => n(b).loading, (e) => {
244
- var o;
245
- (o = t.onLoadingChange) == null || o.call(t, e);
252
+ oe(() => l(h).loading, (e) => {
253
+ var t;
254
+ (t = o.onLoadingChange) == null || t.call(o, e);
246
255
  });
247
- function J(e) {
248
- var o, a, r;
249
- (r = (a = (o = h.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
256
+ function Y(e) {
257
+ var t, a, r;
258
+ (r = (a = (t = b.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
250
259
  }
251
- function X() {
252
- var e, o, a;
253
- return (a = (o = (e = h.value) == null ? void 0 : e.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : a.call(o, !0);
260
+ function Z() {
261
+ var e, t, a;
262
+ return (a = (t = (e = b.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
254
263
  }
255
- return D({
264
+ return W({
256
265
  submit: () => P(),
257
266
  reset: () => v(),
258
- setSearchFormValues: J,
259
- getSearchFormValues: X,
260
- dataSource: d(() => n(b).records)
261
- }), (e, o) => (i(), f("div", {
262
- class: F(Q.value)
263
- }, [n(T)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), f("div", {
267
+ setSearchFormValues: Y,
268
+ getSearchFormValues: Z,
269
+ dataSource: s(() => l(h).records)
270
+ }), (e, t) => (i(), m("div", {
271
+ class: F(J.value)
272
+ }, [l(T)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), m("div", {
264
273
  key: 0,
265
- class: F(e.card ? n(g)("search-wrapper") : null),
274
+ class: F(e.card ? l(g)("search-wrapper") : null),
266
275
  style: R(e.searchFormWrapperStyle)
267
- }, [s(n(ce).SearchForm, m(e.searchForm || {}, {
276
+ }, [d(l(me).SearchForm, f(e.searchForm || {}, {
268
277
  ref_key: "formRef",
269
- ref: h,
278
+ ref: b,
270
279
  "custom-reset": "",
271
- onSubmit: n(P),
272
- onReset: n(v),
273
- "submit-loading": n(c).loading
280
+ onSubmit: l(P),
281
+ onReset: l(v),
282
+ "submit-loading": l(c).loading
274
283
  }), k({
275
- default: p(() => [(i(!0), f(te, null, E(B.value, (a) => (i(), oe(re(a.customRenderFormItem ? a.customRenderFormItem(a) : n(fe)[a.valueType || "text"]), m({
284
+ default: p(() => [(i(!0), m(re, null, L(B.value, (a) => (i(), le(ne(a.customRenderFormItem ? a.customRenderFormItem(a) : l(ye)[a.valueType || "text"]), f({
276
285
  key: a.dataIndex,
277
286
  ref_for: !0
278
287
  }, a.fieldProps || {}, {
@@ -283,39 +292,40 @@ const ve = {
283
292
  name: "extra",
284
293
  fn: p(() => [x(e.$slots, "searchFormExtra")]),
285
294
  key: "0"
286
- } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : O("", !0), L("div", {
295
+ } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : E("", !0), O("div", {
287
296
  ref_key: "contentRef",
288
- ref: M,
289
- class: F([n(g)("table-wrapper"), e.card ? n(g)("table-wrapper-card") : null]),
297
+ ref: q,
298
+ class: F([l(g)("table-wrapper"), e.card ? l(g)("table-wrapper-card") : null]),
290
299
  style: R(e.tableWrapperStyle)
291
- }, [x(e.$slots, "title"), s(n(ue), m({
292
- class: n(_) === "admin" ? n(u)("table-admin") : n(u)("table")
293
- }, G.value, {
294
- onChange: n(K),
300
+ }, [x(e.$slots, "title"), d(l(pe), f({
301
+ class: l(A) === "admin" ? l(u)("table-admin") : l(u)("table")
302
+ }, U.value, {
303
+ "table-layout": Q.value,
304
+ onChange: l($),
295
305
  columns: y.value
296
306
  }), k({
297
307
  headerCell: p(({
298
308
  column: a,
299
309
  title: r
300
- }) => [a.tooltip ? (i(), f("span", ve, [L("span", null, ne(r), 1), s(n(ie), {
310
+ }) => [a.tooltip ? (i(), m("span", ke, [O("span", null, se(r), 1), d(l(ce), {
301
311
  title: a.tooltip,
302
312
  placement: "bottom"
303
313
  }, {
304
- default: p(() => [s(n(he), {
314
+ default: p(() => [d(l(Ce), {
305
315
  style: R({
306
316
  paddingLeft: "4px",
307
- color: n(W).colorPrimary
317
+ color: l(j).colorPrimary
308
318
  })
309
319
  }, null, 8, ["style"])]),
310
320
  _: 2
311
- }, 1032, ["title"])])) : O("", !0)]),
321
+ }, 1032, ["title"])])) : E("", !0)]),
312
322
  _: 2
313
- }, [E(n(ye)(w, ["title", "searchFormExtra"]), (a, r) => ({
323
+ }, [L(l(N)(w, ["title", "searchFormExtra"]), (a, r) => ({
314
324
  name: r,
315
- fn: p((l) => [x(e.$slots, r, le(de(l || {})))])
316
- }))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
325
+ fn: p((n) => [x(e.$slots, r, de(ue(n || {})))])
326
+ }))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
317
327
  }
318
328
  });
319
329
  export {
320
- He as default
330
+ $e as default
321
331
  };
@@ -6,6 +6,7 @@ import { Recordable } from '../type';
6
6
  import { ComputedRef, CSSProperties, VNode } from 'vue';
7
7
  import { ApActionGroupProps } from '../ap-action';
8
8
  import { ApTableIndexProps } from './components/interface';
9
+ import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
9
10
 
10
11
  export type ValueEnumType = {
11
12
  text: string;
@@ -56,7 +57,7 @@ export type ApTableValueFields = {
56
57
  };
57
58
  export type ApTableValueTypes = keyof ApTableValueFields;
58
59
  export type ValueEnum = Record<string, ValueEnumType>;
59
- export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' | 'customRender'> & {
60
+ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' | 'customRender' | 'ellipsis'> & {
60
61
  sorter?: string | boolean | CompareFn<T> | {
61
62
  compare?: CompareFn<T>;
62
63
  /** Config multiple sorter order priority */
@@ -77,6 +78,10 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
77
78
  * 是否可以复制
78
79
  */
79
80
  copyable?: boolean;
81
+ /**
82
+ * 是否省略自动溢出,自动溢出省略,为对象时可设置省略行数、是否可展开、添加后缀等
83
+ */
84
+ ellipsis?: boolean | EllipsisConfig;
80
85
  /**
81
86
  * 是否搜索表单中隐藏
82
87
  */
@@ -160,8 +165,8 @@ export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<R
160
165
  * @returns
161
166
  */
162
167
  request?: (params: Partial<ParamsType> & {
163
- pageSize?: number;
164
- current?: number;
168
+ pageSize: number;
169
+ current: number;
165
170
  sort?: Record<string, SortOrder>;
166
171
  filter?: Recordable<any>;
167
172
  }) => Promise<Partial<RequestData<RecordType>>>;
@@ -248,6 +253,3 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
248
253
  */
249
254
  dataSource: ComputedRef<RecordType>;
250
255
  };
251
- export type FixedApColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = Omit<ApColumnType<RecordType, ValueType>, 'filters'> & {
252
- filters?: ColumnType<RecordType>['filters'];
253
- };
@@ -85,3 +85,22 @@
85
85
  .aplus-ap-table .ant-table-small .ant-table-placeholder .ant-table-cell {
86
86
  padding: 0 !important;
87
87
  }
88
+ .aplus-ap-table .ant-table-column-sorters {
89
+ justify-content: unset;
90
+ }
91
+ .aplus-ap-table .ant-table-column-sorters .ant-table-column-title {
92
+ flex: unset;
93
+ }
94
+ .aplus-ap-table .ant-table-filter-column {
95
+ justify-content: unset;
96
+ }
97
+ .aplus-ap-table .ant-table-filter-column .ant-table-column-title {
98
+ flex: unset;
99
+ }
100
+ .aplus-ap-table .ant-table-filter-column .ant-table-filter-trigger {
101
+ margin-left: 2px;
102
+ padding-left: 2px;
103
+ }
104
+ .aplus-ap-table .ant-table-cell .ant-typography {
105
+ margin-bottom: 0;
106
+ }