@aplus-frontend/ui 0.1.26 → 0.1.27

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 (131) hide show
  1. package/es/src/ap-download/ap-download.vue.d.ts +7 -3
  2. package/es/src/ap-download/ap-download.vue.mjs +50 -35
  3. package/es/src/ap-download/interface.d.ts +3 -11
  4. package/es/src/ap-download/style/ap-download.css +3 -0
  5. package/es/src/ap-table/ap-table.vue.mjs +231 -183
  6. package/es/src/ap-table/components/interface.d.ts +33 -1
  7. package/es/src/ap-table/components/setting/images/icon_carst_down.svg.mjs +4 -0
  8. package/es/src/ap-table/components/setting/images/icon_fill_right.svg.mjs +4 -0
  9. package/es/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
  10. package/es/src/ap-table/components/setting/modal/index.vue.mjs +4 -0
  11. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +152 -0
  12. package/es/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
  13. package/es/src/ap-table/components/setting/select-group/index.vue.mjs +4 -0
  14. package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +96 -0
  15. package/es/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
  16. package/es/src/ap-table/components/setting/sortable/index.vue.mjs +4 -0
  17. package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +51 -0
  18. package/es/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
  19. package/es/src/ap-table/components/setting/sortable/item.vue.mjs +4 -0
  20. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +140 -0
  21. package/es/src/ap-table/components/setting/sorter/context.d.ts +11 -0
  22. package/es/src/ap-table/components/setting/sorter/context.mjs +20 -0
  23. package/es/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
  24. package/es/src/ap-table/components/setting/sorter/index.vue.mjs +4 -0
  25. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +199 -0
  26. package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
  27. package/es/src/ap-table/components/setting/tree-select/index.vue.mjs +4 -0
  28. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +75 -0
  29. package/es/src/ap-table/components/setting/utils.d.ts +17 -0
  30. package/es/src/ap-table/components/setting/utils.mjs +48 -0
  31. package/es/src/ap-table/components/style/setting/modal.css +39 -0
  32. package/es/src/ap-table/components/style/setting/select-group.css +7 -0
  33. package/es/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
  34. package/es/src/ap-table/components/style/setting/sortable-item.css +3 -0
  35. package/es/src/ap-table/components/style/setting/sorter.css +26 -0
  36. package/es/src/ap-table/constants.d.ts +31 -8
  37. package/es/src/ap-table/constants.mjs +41 -53
  38. package/es/src/ap-table/context.d.ts +31 -0
  39. package/es/src/ap-table/context.mjs +20 -0
  40. package/es/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
  41. package/es/src/ap-table/hooks/use-table-column-state.mjs +46 -0
  42. package/es/src/ap-table/hooks/use-table-content-height.mjs +19 -19
  43. package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  44. package/es/src/ap-table/hooks/use-table-paging.mjs +87 -82
  45. package/es/src/ap-table/interface.d.ts +51 -1
  46. package/es/src/ap-table/style/ap-table.css +29 -1
  47. package/es/src/ap-table/utils.d.ts +1 -1
  48. package/es/src/ap-table/utils.mjs +82 -82
  49. package/es/src/business/ap-attachment/ApAttachment.d.ts +1 -1
  50. package/es/src/business/ap-attachment/ApAttachment.mjs +45 -42
  51. package/es/src/business/ap-attachment/style.css +2 -0
  52. package/es/src/business/hooks/usePageListApTable.d.ts +2 -2
  53. package/es/src/business/index.d.ts +1 -1
  54. package/es/src/editable-table/interface.d.ts +1 -1
  55. package/es/src/locale/lang/en.mjs +14 -0
  56. package/es/src/locale/lang/zh-cn.mjs +14 -0
  57. package/es/src/theme/ap-attachment/ap-attachment.css +2 -0
  58. package/es/src/theme/ap-download/ap-download.css +3 -0
  59. package/es/src/theme/ap-table/ap-table.css +29 -1
  60. package/es/src/theme/ap-table/setting/modal.css +39 -0
  61. package/es/src/theme/ap-table/setting/select-group.css +7 -0
  62. package/es/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
  63. package/es/src/theme/ap-table/setting/sortable-item.css +3 -0
  64. package/es/src/theme/ap-table/setting/sorter.css +26 -0
  65. package/es/src/theme/css-var/index.mjs +22 -12
  66. package/lib/src/ap-download/ap-download.vue.d.ts +7 -3
  67. package/lib/src/ap-download/ap-download.vue.js +1 -1
  68. package/lib/src/ap-download/interface.d.ts +3 -11
  69. package/lib/src/ap-download/style/ap-download.css +3 -0
  70. package/lib/src/ap-table/ap-table.vue.js +1 -1
  71. package/lib/src/ap-table/components/interface.d.ts +33 -1
  72. package/lib/src/ap-table/components/setting/images/icon_carst_down.svg.js +1 -0
  73. package/lib/src/ap-table/components/setting/images/icon_fill_right.svg.js +1 -0
  74. package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
  75. package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -0
  76. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -0
  77. package/lib/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
  78. package/lib/src/ap-table/components/setting/select-group/index.vue.js +1 -0
  79. package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -0
  80. package/lib/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
  81. package/lib/src/ap-table/components/setting/sortable/index.vue.js +1 -0
  82. package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -0
  83. package/lib/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
  84. package/lib/src/ap-table/components/setting/sortable/item.vue.js +1 -0
  85. package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -0
  86. package/lib/src/ap-table/components/setting/sorter/context.d.ts +11 -0
  87. package/lib/src/ap-table/components/setting/sorter/context.js +1 -0
  88. package/lib/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
  89. package/lib/src/ap-table/components/setting/sorter/index.vue.js +1 -0
  90. package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -0
  91. package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
  92. package/lib/src/ap-table/components/setting/tree-select/index.vue.js +1 -0
  93. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -0
  94. package/lib/src/ap-table/components/setting/utils.d.ts +17 -0
  95. package/lib/src/ap-table/components/setting/utils.js +1 -0
  96. package/lib/src/ap-table/components/style/setting/modal.css +39 -0
  97. package/lib/src/ap-table/components/style/setting/select-group.css +7 -0
  98. package/lib/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
  99. package/lib/src/ap-table/components/style/setting/sortable-item.css +3 -0
  100. package/lib/src/ap-table/components/style/setting/sorter.css +26 -0
  101. package/lib/src/ap-table/constants.d.ts +31 -8
  102. package/lib/src/ap-table/constants.js +1 -1
  103. package/lib/src/ap-table/context.d.ts +31 -0
  104. package/lib/src/ap-table/context.js +1 -0
  105. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
  106. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -0
  107. package/lib/src/ap-table/hooks/use-table-content-height.js +1 -1
  108. package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  109. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  110. package/lib/src/ap-table/interface.d.ts +51 -1
  111. package/lib/src/ap-table/style/ap-table.css +29 -1
  112. package/lib/src/ap-table/utils.d.ts +1 -1
  113. package/lib/src/ap-table/utils.js +1 -1
  114. package/lib/src/business/ap-attachment/ApAttachment.d.ts +1 -1
  115. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  116. package/lib/src/business/ap-attachment/style.css +2 -0
  117. package/lib/src/business/hooks/usePageListApTable.d.ts +2 -2
  118. package/lib/src/business/index.d.ts +1 -1
  119. package/lib/src/editable-table/interface.d.ts +1 -1
  120. package/lib/src/locale/lang/en.js +1 -1
  121. package/lib/src/locale/lang/zh-cn.js +1 -1
  122. package/lib/src/theme/ap-attachment/ap-attachment.css +2 -0
  123. package/lib/src/theme/ap-download/ap-download.css +3 -0
  124. package/lib/src/theme/ap-table/ap-table.css +29 -1
  125. package/lib/src/theme/ap-table/setting/modal.css +39 -0
  126. package/lib/src/theme/ap-table/setting/select-group.css +7 -0
  127. package/lib/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
  128. package/lib/src/theme/ap-table/setting/sortable-item.css +3 -0
  129. package/lib/src/theme/ap-table/setting/sorter.css +26 -0
  130. package/lib/src/theme/css-var/index.js +1 -1
  131. package/package.json +3 -2
@@ -1,21 +1,25 @@
1
- import { defineComponent as pe, useSlots as fe, ref as me, unref as l, createVNode as g, Fragment as j, watchEffect as ge, computed as d, watch as ye, openBlock as y, createElementBlock as v, normalizeClass as B, normalizeStyle as A, mergeProps as h, createSlots as W, withCtx as b, renderList as H, createBlock as he, resolveDynamicComponent as be, renderSlot as S, createCommentVNode as Se, createElementVNode as we, normalizeProps as Re, guardReactiveProps as Ce } from "vue";
2
- import { Typography as Te, Table as Fe } from "ant-design-vue";
3
- import { useToken as xe } from "ant-design-vue/es/theme/internal";
4
- import { ApForm as ve } from "../ap-form/index.mjs";
5
- import { noRenderAsFormItemValueList as $ } from "./constants.mjs";
1
+ import { defineComponent as Re, useSlots as ve, ref as P, computed as s, unref as l, createVNode as p, Fragment as U, watchEffect as Ce, watch as G, openBlock as f, createElementBlock as T, normalizeClass as m, normalizeStyle as M, mergeProps as h, createSlots as J, withCtx as b, renderList as Q, createBlock as X, resolveDynamicComponent as Te, renderSlot as w, createCommentVNode as Y, createElementVNode as I, h as Fe, normalizeProps as Be, guardReactiveProps as xe } from "vue";
2
+ import { Typography as ke, Divider as ze, Button as Pe, Table as Ie } from "ant-design-vue";
3
+ import { useToken as Ne } from "ant-design-vue/es/theme/internal";
4
+ import { ApForm as Le } from "../ap-form/index.mjs";
5
+ import { noRenderAsFormItemValueList as Z } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
- import { useTablePaging as Be } from "./hooks/use-table-paging.mjs";
8
- import { omit as q, isUndefined as i, isBoolean as Pe } from "lodash-unified";
7
+ import { useTablePaging as Ee } from "./hooks/use-table-paging.mjs";
8
+ import { omit as _, isUndefined as g, isBoolean as Ke } from "lodash-unified";
9
9
  import "./style/ap-table.css";
10
- import { apColumnToColumn as Ie, getTableTitle as ke, getTableRenderType as ze, getTableRenderProps as Ne, getTableCellRenderNode as Le, getColumnOrder as U, updateFormProps as Ee, getFieldProps as Ve, getPlaceholder as Ke, getSearchFormItemRenderNode as Oe, objectToString as De } from "./utils.mjs";
11
- import je from "./hooks/use-table-content-height.mjs";
12
- import { getRawDisplayValue as Ae } from "../editable-table/utils.mjs";
13
- import We from "./hooks/use-table-row-selection.mjs";
14
- import { isDef as He } from "../utils/index.mjs";
15
- import { useLocale as $e } from "../config-provider/hooks/use-locale.mjs";
16
- import { useNamespace as qe } from "../config-provider/hooks/use-namespace.mjs";
17
- import { useGlobalConfig as Ue } from "../config-provider/hooks/use-global-config.mjs";
18
- const ua = /* @__PURE__ */ pe({
10
+ import { apColumnToColumn as Oe, getTableTitle as Ve, getTableRenderType as je, getTableRenderProps as Ae, getTableCellRenderNode as We, getColumnOrder as ee, updateFormProps as $e, getFieldProps as De, getPlaceholder as He, getSearchFormItemRenderNode as qe, objectToString as Ue } from "./utils.mjs";
11
+ import Ge from "./hooks/use-table-content-height.mjs";
12
+ import { getRawDisplayValue as Me } from "../editable-table/utils.mjs";
13
+ import Je from "./hooks/use-table-row-selection.mjs";
14
+ import { isDef as Qe } from "../utils/index.mjs";
15
+ import { SettingOutlined as Xe } from "@ant-design/icons-vue";
16
+ import "./components/setting/modal/index.vue.mjs";
17
+ import { useProvideApTable as Ye } from "./context.mjs";
18
+ import { useLocale as Ze } from "../config-provider/hooks/use-locale.mjs";
19
+ import { useNamespace as _e } from "../config-provider/hooks/use-namespace.mjs";
20
+ import { useGlobalConfig as ea } from "../config-provider/hooks/use-global-config.mjs";
21
+ import aa from "./components/setting/modal/index.vue2.mjs";
22
+ const Ca = /* @__PURE__ */ Re({
19
23
  name: "ApTable",
20
24
  __name: "ap-table",
21
25
  props: {
@@ -133,246 +137,290 @@ const ua = /* @__PURE__ */ pe({
133
137
  columnResizable: {
134
138
  type: Boolean,
135
139
  default: !1
140
+ },
141
+ settings: {
142
+ type: [Boolean, Object],
143
+ default: void 0
136
144
  }
137
145
  },
138
- setup(G, {
139
- expose: M
146
+ setup(ae, {
147
+ expose: oe
140
148
  }) {
141
- const e = G;
142
- let P = 0;
143
- const w = fe(), [, J] = xe(), {
144
- t: Q
145
- } = $e(), {
146
- e: R,
147
- b: p
148
- } = qe("ap-table"), I = Ue("valueTypeMap"), {
149
- height: X,
150
- contentRef: Y
151
- } = je(), c = me([]), Z = () => {
149
+ const a = ae;
150
+ let N = 0;
151
+ const S = ve(), [, te] = Ne(), {
152
+ t: re
153
+ } = Ze(), {
154
+ e: F,
155
+ b: i,
156
+ be: L
157
+ } = _e("ap-table"), E = ea("valueTypeMap"), {
158
+ height: le,
159
+ contentRef: ne
160
+ } = Ge(), B = P(a.size), u = P([]), K = P([]);
161
+ Ye({
162
+ columns: s(() => u.value),
163
+ columnsBackup: s(() => K.value),
164
+ size: s(() => B.value),
165
+ updateColumns(e) {
166
+ u.value = e;
167
+ },
168
+ updateSize(e) {
169
+ B.value = e;
170
+ }
171
+ });
172
+ const se = () => {
152
173
  var t;
153
- let a = ((t = e.columns) == null ? void 0 : t.filter((r) => !r.hideInTable)) || [];
154
- function o(r) {
174
+ let e = ((t = a.columns) == null ? void 0 : t.filter((r) => !r.hideInTable)) || [];
175
+ function o(r, d) {
155
176
  return r.map((n) => ({
156
- resizable: He(n.resizable) ? n.resizable : e.columnResizable,
157
- ...q(Ie(n), ["ellipsis"]),
158
- title: ke(n, w.headerCell, l(J).colorPrimary),
177
+ resizable: Qe(n.resizable) ? n.resizable : a.columnResizable,
178
+ ..._(Oe(n), ["ellipsis"]),
179
+ fixed: d ? d.fixed : n.fixed,
180
+ title: Ve(n, L("table-header", "title"), S.headerCell, l(te).colorPrimary),
159
181
  customRender({
160
- value: s,
161
- ...u
182
+ value: c,
183
+ ...y
162
184
  }) {
163
- var O, D;
164
- const V = ze(n), ue = Ne({
185
+ var H, q;
186
+ const $ = je(n), be = Ae({
165
187
  ...n,
166
- valueType: V
188
+ valueType: $
167
189
  }, {
168
- value: s,
169
- ...u
170
- }), ie = Le(V, ue, u.record, l(I)), K = ((O = n.renderText) == null ? void 0 : O.call(n, {
171
- value: s,
172
- ...u
173
- })) || s, ce = n.renderText ? g(j, null, [(D = n.renderText) == null ? void 0 : D.call(n, {
174
- value: s,
175
- ...u
176
- })]) : ie;
177
- let x = ne(n, K, ce);
178
- return n.customRender && (x = n.customRender({
179
- value: s,
180
- ...u,
190
+ value: c,
191
+ ...y
192
+ }), we = We($, be, y.record, l(E)), D = ((H = n.renderText) == null ? void 0 : H.call(n, {
193
+ value: c,
194
+ ...y
195
+ })) || c, Se = n.renderText ? p(U, null, [(q = n.renderText) == null ? void 0 : q.call(n, {
196
+ value: c,
197
+ ...y
198
+ })]) : we;
199
+ let z = ge(n, D, Se);
200
+ return n.customRender && (z = n.customRender({
201
+ value: c,
202
+ ...y,
181
203
  column: n,
182
- originalNode: x,
183
- originalText: K
184
- })), x;
204
+ originalNode: z,
205
+ originalText: D
206
+ })), z;
185
207
  },
186
- children: o(n.children || [])
208
+ children: o(n.children || [], d || n)
187
209
  }));
188
210
  }
189
- return o(a);
211
+ return o(e);
190
212
  };
191
- ge(() => {
192
- c.value = Z();
213
+ Ce(() => {
214
+ const e = se();
215
+ u.value = e, K.value = e;
193
216
  });
194
- const k = d(() => {
195
- var a, o, t;
196
- return P++, ((t = (o = (a = e.columns) == null ? void 0 : a.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !$.includes(r.valueType))) == null ? void 0 : o.sort((r, n) => {
197
- let s = U(r.order);
198
- return U(n.order) - s;
217
+ const O = s(() => {
218
+ var e, o, t;
219
+ return N++, ((t = (o = (e = a.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, d) => {
220
+ let n = ee(r.order);
221
+ return ee(d.order) - n;
199
222
  })) == null ? void 0 : t.map((r) => {
200
- const n = Ee(r, Ve(r.fieldProps, {})), s = {
223
+ const d = $e(r, De(r.fieldProps, {})), n = {
201
224
  ...r,
202
225
  fieldProps: {
203
226
  label: r.title,
204
227
  name: r.dataIndex,
205
- ...n || {},
228
+ ...d || {},
206
229
  // 格式化placeholder
207
- placeholder: Ke(Q, r.valueType, n == null ? void 0 : n.placeholder),
208
- _signal: P
230
+ placeholder: He(re, r.valueType, d == null ? void 0 : d.placeholder),
231
+ _signal: N
209
232
  },
210
233
  renderNode: void 0
211
234
  };
212
- return s.renderNode = Oe(s, l(I)), s;
235
+ return n.renderNode = qe(n, l(E)), n;
213
236
  })) || [];
214
- }), _ = d(() => l(c).filter((a) => a.sorter === !0).map((a) => a.dataIndex).filter(Boolean)), ee = d(() => l(c).filter((a) => a.filters && !a.onFilter).map((a) => a.dataIndex).filter(Boolean)), ae = d(() => i(e.dataSource) ? m.value.records : e.dataSource), {
215
- rowSelection: C,
216
- selectedRows: z,
217
- ...T
218
- } = We({
219
- ...e.rowSelection === !0 ? {} : e.rowSelection,
220
- rowKey: e.rowKey,
221
- dataSource: ae
237
+ }), de = s(() => l(u).filter((e) => e.sorter === !0).map((e) => e.dataIndex).filter(Boolean)), ue = s(() => l(u).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex).filter(Boolean)), ie = s(() => g(a.dataSource) ? C.value.records : a.dataSource), {
238
+ rowSelection: R,
239
+ selectedRows: x,
240
+ ...v
241
+ } = Je({
242
+ ...a.rowSelection === !0 ? {} : a.rowSelection,
243
+ rowKey: a.rowKey,
244
+ dataSource: ie
222
245
  }), {
223
- formRef: F,
224
- submit: N,
225
- reset: L,
226
- tableProps: f,
227
- handleTableChange: oe,
228
- data: m
229
- } = Be({
230
- async request(a) {
246
+ formRef: k,
247
+ submit: V,
248
+ reset: j,
249
+ tableProps: A,
250
+ data: C,
251
+ setDataSource: ce
252
+ } = Ee({
253
+ async request(e) {
231
254
  var t, r;
232
- !C.value.preserveSelectedRowKeys && i(e.dataSource) && T.clearAll();
233
- const o = await ((t = e.request) == null ? void 0 : t.call(e, a));
234
- return (r = e.onLoad) == null || r.call(e, (o == null ? void 0 : o.data) || []), {
255
+ if (!R.value.preserveSelectedRowKeys && g(a.dataSource) && v.clearAll(), !g(a.dataSource))
256
+ return {
257
+ data: a.dataSource || [],
258
+ total: a.dataSource.length || 0
259
+ };
260
+ const o = await ((t = a.request) == null ? void 0 : t.call(a, e));
261
+ return (r = a.onLoad) == null || r.call(a, (o == null ? void 0 : o.data) || []), {
235
262
  data: (o == null ? void 0 : o.data) || [],
236
263
  total: (o == null ? void 0 : o.total) || 0
237
264
  };
238
265
  },
239
- filterFields: ee,
240
- sortFields: _,
241
- defaultParams: e.params,
242
- defaultData: e.defaultData,
243
- manual: e.manual,
244
- defaultCurrent: e.pagination ? e.pagination.defaultCurrent : void 0,
245
- defaultPageSize: e.pagination ? e.pagination.defaultPageSize : void 0,
246
- formatParams: e.beforeSearchSubmit,
247
- showLessItems: e.pagination ? e.pagination.showLessItems : void 0,
248
- showTotal: e.pagination ? e.pagination.showTotal : void 0
249
- }), re = d(() => {
266
+ filterFields: ue,
267
+ sortFields: de,
268
+ defaultParams: a.params,
269
+ defaultData: a.defaultData,
270
+ manual: a.manual,
271
+ defaultCurrent: a.pagination ? a.pagination.defaultCurrent : void 0,
272
+ defaultPageSize: a.pagination ? a.pagination.defaultPageSize : void 0,
273
+ formatParams: a.beforeSearchSubmit,
274
+ showLessItems: a.pagination ? a.pagination.showLessItems : void 0,
275
+ showTotal: a.pagination ? a.pagination.showTotal : void 0
276
+ }), pe = s(() => {
250
277
  var o, t;
251
- if (e.adaptive && (m.value.total > 0 || ((o = e.dataSource) == null ? void 0 : o.length)))
278
+ if (a.adaptive && (C.value.total > 0 || ((o = a.dataSource) == null ? void 0 : o.length)))
252
279
  return {
253
- y: l(X),
254
- x: ((t = e.scroll) == null ? void 0 : t.x) || "100%"
280
+ y: l(le),
281
+ x: ((t = a.scroll) == null ? void 0 : t.x) || "100%"
255
282
  };
256
- if (e.scroll)
257
- return e.scroll;
258
- }), te = d(() => {
259
- var a;
260
- if (e.tableLayout)
261
- return e.tableLayout;
262
- if ((a = e.columns) != null && a.some((o) => o.ellipsis))
283
+ if (a.scroll)
284
+ return a.scroll;
285
+ }), fe = s(() => {
286
+ var e;
287
+ if (a.tableLayout)
288
+ return a.tableLayout;
289
+ if ((e = a.columns) != null && e.some((o) => o.ellipsis))
263
290
  return "fixed";
264
- }), E = d(() => {
265
- var r;
266
- const a = l(f), o = i(e.dataSource) ? a : {
267
- ...a,
268
- dataSource: e.dataSource,
269
- onChange: e.onChange
270
- }, t = l(C);
291
+ }), W = s(() => {
292
+ var t;
293
+ const e = l(A), o = l(R);
271
294
  return {
295
+ ...a,
272
296
  ...e,
273
- ...o,
274
- rowSelection: e.rowSelection === !0 || ((r = e.rowSelection) == null ? void 0 : r.mode) === "internal" ? {
275
- ...t,
297
+ rowSelection: a.rowSelection === !0 || ((t = a.rowSelection) == null ? void 0 : t.mode) === "internal" ? {
298
+ ...o,
276
299
  // tips 如果是前端分页,则默认会走缓存
277
- preserveSelectedRowKeys: i(e.dataSource) ? t.preserveSelectedRowKeys : !0
278
- } : e.rowSelection,
279
- loading: i(e.loading) ? l(f).loading : e.loading,
280
- pagination: e.pagination === !1 ? !1 : l(f).pagination,
281
- scroll: l(re)
300
+ preserveSelectedRowKeys: g(a.dataSource) ? o.preserveSelectedRowKeys : !0
301
+ } : a.rowSelection,
302
+ loading: g(a.loading) ? e.loading : a.loading,
303
+ pagination: a.pagination === !1 ? !1 : e.pagination,
304
+ scroll: l(pe)
282
305
  };
283
- }), le = d(() => [p(), e.card ? null : p("wrapper"), e.adaptive ? p("adaptive") : null].filter(Boolean));
284
- function ne(a, o, t) {
285
- if ($.includes(a.valueType))
306
+ }), me = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
307
+ function ge(e, o, t) {
308
+ if (Z.includes(e.valueType))
286
309
  return t;
287
- const r = De(o);
288
- return a.copyable || a.ellipsis ? g(Te.Paragraph, {
289
- copyable: a.copyable ? {
310
+ const r = Ue(o);
311
+ return e.copyable || e.ellipsis ? p(ke.Paragraph, {
312
+ copyable: e.copyable ? {
290
313
  text: r,
291
314
  tooltip: !1
292
315
  } : !1,
293
- ellipsis: a.ellipsis ? Pe(a.ellipsis) ? {
316
+ ellipsis: e.ellipsis ? Ke(e.ellipsis) ? {
294
317
  tooltip: r
295
318
  } : {
296
- ...a.ellipsis,
319
+ ...e.ellipsis,
297
320
  tooltip: r
298
321
  } : !1,
299
- content: a.ellipsis ? Ae(a, o) : t
322
+ content: e.ellipsis ? Me(e, o) : t
300
323
  }, null) : t;
301
324
  }
302
- ye(() => l(m).loading, (a) => {
325
+ G(() => l(C).loading, (e) => {
303
326
  var o;
304
- (o = e.onLoadingChange) == null || o.call(e, a);
327
+ (o = a.onLoadingChange) == null || o.call(a, e);
328
+ }), G(() => a.dataSource, (e) => {
329
+ e != null && e.length && ce(e);
330
+ }, {
331
+ immediate: !0
305
332
  });
306
- function se(a) {
333
+ function ye(e) {
307
334
  var o, t, r;
308
- (r = (t = (o = F.value) == null ? void 0 : o.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, a);
335
+ (r = (t = (o = k.value) == null ? void 0 : o.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, e);
309
336
  }
310
- function de() {
311
- var a, o, t;
312
- return (t = (o = (a = F.value) == null ? void 0 : a.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : t.call(o, !0);
337
+ function he() {
338
+ var e, o, t;
339
+ return (t = (o = (e = k.value) == null ? void 0 : e.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : t.call(o, !0);
313
340
  }
314
- return M({
315
- submit: () => N(),
316
- reset: () => L(),
317
- setSearchFormValues: se,
318
- getSearchFormValues: de,
319
- dataSource: d(() => l(m).records),
341
+ return oe({
342
+ submit: () => V(),
343
+ reset: () => j(),
344
+ setSearchFormValues: ye,
345
+ getSearchFormValues: he,
346
+ dataSource: s(() => l(C).records),
320
347
  rowSelection: {
321
- selectedRows: d(() => l(z)),
322
- ...T
348
+ selectedRows: s(() => l(x)),
349
+ ...v
323
350
  }
324
- }), (a, o) => (y(), v("div", {
325
- class: B(le.value)
326
- }, [l(i)(a.dataSource) && a.searchForm !== !1 && k.value.length > 0 ? (y(), v("div", {
351
+ }), (e, o) => (f(), T("div", {
352
+ class: m(me.value)
353
+ }, [l(g)(e.dataSource) && e.searchForm !== !1 && O.value.length > 0 ? (f(), T("div", {
327
354
  key: 0,
328
- class: B(a.card ? l(R)("search-wrapper") : null),
329
- style: A(a.searchFormWrapperStyle)
330
- }, [g(l(ve).SearchForm, h(a.searchForm || {}, {
355
+ class: m(e.card ? l(F)("search-wrapper") : null),
356
+ style: M(e.searchFormWrapperStyle)
357
+ }, [p(l(Le).SearchForm, h(e.searchForm || {}, {
331
358
  ref_key: "formRef",
332
- ref: F,
359
+ ref: k,
333
360
  "custom-reset": "",
334
- onSubmit: l(N),
335
- onReset: l(L),
336
- "submit-loading": l(f).loading
337
- }), W({
338
- default: b(() => [(y(!0), v(j, null, H(k.value, (t) => (y(), he(be(t.renderNode), h({
361
+ onSubmit: l(V),
362
+ onReset: l(j),
363
+ "submit-loading": l(A).loading
364
+ }), J({
365
+ default: b(() => [(f(!0), T(U, null, Q(O.value, (t) => (f(), X(Te(t.renderNode), h({
339
366
  key: t.dataIndex,
340
367
  ref_for: !0
341
368
  }, t.fieldProps || {}, {
342
369
  span: t.span
343
370
  }), null, 16, ["span"]))), 128))]),
344
371
  _: 2
345
- }, [w.searchFormExtra ? {
372
+ }, [S.searchFormExtra ? {
346
373
  name: "extra",
347
- fn: b(() => [S(a.$slots, "searchFormExtra")]),
374
+ fn: b(() => [w(e.$slots, "searchFormExtra")]),
348
375
  key: "0"
349
- } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : Se("", !0), we("div", {
376
+ } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : Y("", !0), I("div", {
350
377
  ref_key: "contentRef",
351
- ref: Y,
352
- class: B([l(R)("table-wrapper"), a.card ? l(R)("table-wrapper-card") : null]),
353
- style: A(a.tableWrapperStyle)
354
- }, [S(a.$slots, "title", h({
355
- selectedRows: l(z),
356
- selectedRowKeys: l(C).selectedRowKeys
357
- }, T)), g(l(Fe), h({
358
- class: l(p)("table")
359
- }, E.value, {
360
- "table-layout": te.value,
361
- onChange: l(oe),
362
- columns: c.value,
378
+ ref: ne,
379
+ class: m([l(F)("table-wrapper"), e.card ? l(F)("table-wrapper-card") : null]),
380
+ style: M(e.tableWrapperStyle)
381
+ }, [I("div", {
382
+ class: m(l(i)("header-wrapper"))
383
+ }, [e.settings ? (f(), T("div", {
384
+ key: 0,
385
+ class: m(l(i)("header"))
386
+ }, [I("div", {
387
+ class: m(l(L)("header", "title"))
388
+ }, [w(e.$slots, "title", h({
389
+ selectedRows: l(x),
390
+ selectedRowKeys: l(R).selectedRowKeys
391
+ }, v))], 2), S.title ? (f(), X(l(ze), {
392
+ key: 0,
393
+ type: "vertical"
394
+ })) : Y("", !0), p(aa, {
395
+ config: e.settings === !0 ? {} : e.settings
396
+ }, {
397
+ trigger: b(() => [p(l(Pe), {
398
+ icon: Fe(l(Xe))
399
+ }, null, 8, ["icon"])]),
400
+ _: 1
401
+ }, 8, ["config"])], 2)) : w(e.$slots, "title", h({
402
+ key: 1,
403
+ selectedRows: l(x),
404
+ selectedRowKeys: l(R).selectedRowKeys
405
+ }, v))], 2), p(l(Ie), h({
406
+ class: l(i)("table")
407
+ }, W.value, {
408
+ size: B.value,
409
+ "table-layout": fe.value,
410
+ columns: u.value,
363
411
  onResizeColumn: o[0] || (o[0] = (t, r) => r.width = t)
364
- }), W({
365
- summary: b(() => [S(a.$slots, "summary", {
366
- columns: c.value,
367
- records: E.value.dataSource
412
+ }), J({
413
+ summary: b(() => [w(e.$slots, "summary", {
414
+ columns: u.value,
415
+ records: W.value.dataSource
368
416
  })]),
369
417
  _: 2
370
- }, [H(l(q)(w, ["title", "searchFormExtra", "headerCell"]), (t, r) => ({
418
+ }, [Q(l(_)(S, ["title", "searchFormExtra", "headerCell"]), (t, r) => ({
371
419
  name: r,
372
- fn: b((n) => [S(a.$slots, r, Re(Ce(n || {})))])
373
- }))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
420
+ fn: b((d) => [w(e.$slots, r, Be(xe(d || {})))])
421
+ }))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 2));
374
422
  }
375
423
  });
376
424
  export {
377
- ua as default
425
+ Ca as default
378
426
  };
@@ -1,4 +1,4 @@
1
- import { ValueEnum } from '../interface';
1
+ import { ApColumnState, ApTableSettingType, ValueEnum } from '../interface';
2
2
  export type ApTablePaginationProps = {
3
3
  /** dataSource的总数量 */
4
4
  total?: number;
@@ -29,3 +29,35 @@ export type ApTableStatusProps = {
29
29
  */
30
30
  value?: any;
31
31
  };
32
+ export type ApTableSettingModalProps = {
33
+ /**
34
+ * 表格列配置
35
+ */
36
+ config?: ApTableSettingType;
37
+ };
38
+ export type Key = string | number;
39
+ export type ApTableSettingTreeSelectProps = {
40
+ /**
41
+ * 表格状态
42
+ */
43
+ value: ApColumnState[];
44
+ };
45
+ export type ApTableSettingSelectGroupProps = {
46
+ /**
47
+ * 二级选中状态(v-model)
48
+ */
49
+ value: ApColumnState;
50
+ };
51
+ export type ApTableSettingSorterProps = ApTableSettingTreeSelectProps & {
52
+ onReset: () => void;
53
+ };
54
+ export type SortableItemProps = {
55
+ value: ApColumnState;
56
+ 'onUpdate:value'?: (nextVal: ApColumnState) => void;
57
+ };
58
+ export type SortableItemMetaProps = {
59
+ value: ApColumnState;
60
+ 'onUpdate:value'?: (nextVal: ApColumnState) => void;
61
+ level?: 1 | 2;
62
+ open?: boolean;
63
+ };
@@ -0,0 +1,4 @@
1
+ const e = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cg%3e%3cg%3e%3cpath%20d='M5.2485869375,6C4.7454835375,6,4.4657799375,6.581959,4.7800659375,6.974817L7.5316909375000005,10.414349999999999C7.7718909375,10.714590000000001,8.2285409375,10.714590000000001,8.4687309375,10.414349999999999L11.2203609375,6.974817C11.5346409375,6.581959,11.254940937499999,6,10.751840937499999,6L5.2485869375,6Z'%20fill='%23182948'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
2
+ export {
3
+ e as default
4
+ };
@@ -0,0 +1,4 @@
1
+ const t = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cg%20transform='matrix(0,1,-1,0,16,-16)'%3e%3cg%20transform='matrix(1,0,0,-1,0,20)'%3e%3cpath%20d='M21.2485869375,10C20.7454835375,10,20.4657799375,10.581959,20.7800659375,10.974817L23.5316909375,14.414349999999999C23.7718909375,14.714590000000001,24.2285409375,14.714590000000001,24.4687309375,14.414349999999999L27.2203609375,10.974817C27.5346409375,10.581959,27.2549409375,10,26.7518409375,10L21.2485869375,10Z'%20fill='%23182948'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
2
+ export {
3
+ t as default
4
+ };
@@ -0,0 +1,28 @@
1
+ import { ApTableSettingModalProps } from '../../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+ type TableSettingModalSlots = {
4
+ trigger: any;
5
+ };
6
+ declare function __VLS_template(): {
7
+ slots: Readonly<TableSettingModalSlots> & TableSettingModalSlots;
8
+ refs: {};
9
+ attrs: Partial<{}>;
10
+ };
11
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
+ declare const __VLS_component: DefineComponent<__VLS_TypePropsToOption<ApTableSettingModalProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<ApTableSettingModalProps>>>, {}, {}>;
13
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
14
+ export default _default;
15
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
+ type __VLS_TypePropsToOption<T> = {
17
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
18
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
19
+ } : {
20
+ type: PropType<T[K]>;
21
+ required: true;
22
+ };
23
+ };
24
+ type __VLS_WithTemplateSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };