@aplus-frontend/ui 0.2.0 → 0.2.2

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 (99) hide show
  1. package/es/index.mjs +1 -1
  2. package/es/src/ap-button/ap-action-button.vue.mjs +1 -0
  3. package/es/src/ap-button/ap-button.vue.d.ts +3 -0
  4. package/es/src/ap-button/ap-button.vue.mjs +47 -66
  5. package/es/src/ap-button/interface.d.ts +1 -0
  6. package/es/src/ap-button/utils/index.d.ts +3 -0
  7. package/es/src/ap-button/utils/index.mjs +33 -0
  8. package/es/src/ap-descriptions/help-message/index.vue.d.ts +2 -2
  9. package/es/src/ap-descriptions/interface.d.ts +1 -1
  10. package/es/src/ap-field/checkbox/index.vue.mjs +23 -22
  11. package/es/src/ap-field/hooks/use-options.d.ts +8 -0
  12. package/es/src/ap-field/hooks/use-options.mjs +22 -0
  13. package/es/src/ap-field/radio/index.vue.mjs +25 -24
  14. package/es/src/ap-field/segmented/index.vue.mjs +37 -33
  15. package/es/src/ap-field/select/index.vue.mjs +74 -73
  16. package/es/src/ap-table/ap-table.vue.mjs +2 -428
  17. package/es/src/ap-table/ap-table.vue2.mjs +428 -2
  18. package/es/src/ap-table/components/setting/modal/index.vue.d.ts +16 -1
  19. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +22 -20
  20. package/es/src/ap-table/hooks/use-table-column-state.mjs +72 -69
  21. package/es/src/ap-table/index.d.ts +6 -1
  22. package/es/src/ap-table/index.mjs +9 -3
  23. package/es/src/ap-upload/apUpload.vue.d.ts +2 -2
  24. package/es/src/ap-upload/components/Picture.vue2.mjs +10 -10
  25. package/es/src/business/ap-batch-action/ApBatchAction.vue.d.ts +8 -3
  26. package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +42 -29
  27. package/es/src/business/ap-batch-action/index.d.ts +8 -3
  28. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +14 -13
  29. package/es/src/business/ap-batch-action-group/index.d.ts +4 -0
  30. package/es/src/business/ap-button-group/index.d.ts +8 -0
  31. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +42 -40
  32. package/es/src/business/ap-summary/style/css.js +1 -1
  33. package/es/src/business/ap-table-modal/index.d.ts +38 -1
  34. package/es/src/business/ap-table-modal/interface.d.ts +17 -2
  35. package/es/src/business/ap-table-modal/style/css.js +1 -1
  36. package/es/src/business/ap-table-modal/style/index.js +1 -1
  37. package/es/src/business/ap-table-modal/table-layout/index.vue.d.ts +57 -0
  38. package/es/src/business/ap-table-modal/table-layout/index.vue.mjs +4 -0
  39. package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +74 -0
  40. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +134 -79
  41. package/es/src/config-provider/config-provider.d.ts +1 -0
  42. package/es/src/config-provider/css-var.d.ts +1 -0
  43. package/es/src/config-provider/css-var.mjs +7 -5
  44. package/es/src/config-provider/index.d.ts +6 -0
  45. package/es/src/editable-table/interface.d.ts +2 -2
  46. package/es/src/index.mjs +201 -202
  47. package/es/src/locale/lang/en.mjs +3 -1
  48. package/es/src/locale/lang/zh-cn.mjs +3 -1
  49. package/es/src/path-map.mjs +2 -0
  50. package/lib/index.js +1 -1
  51. package/lib/src/ap-button/ap-action-button.vue.js +1 -1
  52. package/lib/src/ap-button/ap-button.vue.d.ts +3 -0
  53. package/lib/src/ap-button/ap-button.vue.js +1 -1
  54. package/lib/src/ap-button/interface.d.ts +1 -0
  55. package/lib/src/ap-button/utils/index.d.ts +3 -0
  56. package/lib/src/ap-button/utils/index.js +1 -0
  57. package/lib/src/ap-descriptions/help-message/index.vue.d.ts +2 -2
  58. package/lib/src/ap-descriptions/interface.d.ts +1 -1
  59. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  60. package/lib/src/ap-field/hooks/use-options.d.ts +8 -0
  61. package/lib/src/ap-field/hooks/use-options.js +1 -0
  62. package/lib/src/ap-field/radio/index.vue.js +1 -1
  63. package/lib/src/ap-field/segmented/index.vue.js +1 -1
  64. package/lib/src/ap-field/select/index.vue.js +1 -1
  65. package/lib/src/ap-table/ap-table.vue.js +1 -1
  66. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  67. package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +16 -1
  68. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  69. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  70. package/lib/src/ap-table/index.d.ts +6 -1
  71. package/lib/src/ap-table/index.js +1 -1
  72. package/lib/src/ap-upload/apUpload.vue.d.ts +2 -2
  73. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  74. package/lib/src/business/ap-batch-action/ApBatchAction.vue.d.ts +8 -3
  75. package/lib/src/business/ap-batch-action/ApBatchAction.vue2.js +1 -1
  76. package/lib/src/business/ap-batch-action/index.d.ts +8 -3
  77. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
  78. package/lib/src/business/ap-batch-action-group/index.d.ts +4 -0
  79. package/lib/src/business/ap-button-group/index.d.ts +8 -0
  80. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  81. package/lib/src/business/ap-summary/style/css.js +1 -1
  82. package/lib/src/business/ap-table-modal/index.d.ts +38 -1
  83. package/lib/src/business/ap-table-modal/interface.d.ts +17 -2
  84. package/lib/src/business/ap-table-modal/style/css.js +1 -1
  85. package/lib/src/business/ap-table-modal/style/index.js +1 -1
  86. package/lib/src/business/ap-table-modal/table-layout/index.vue.d.ts +57 -0
  87. package/lib/src/business/ap-table-modal/table-layout/index.vue.js +1 -0
  88. package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -0
  89. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  90. package/lib/src/config-provider/config-provider.d.ts +1 -0
  91. package/lib/src/config-provider/css-var.d.ts +1 -0
  92. package/lib/src/config-provider/css-var.js +1 -1
  93. package/lib/src/config-provider/index.d.ts +6 -0
  94. package/lib/src/editable-table/interface.d.ts +2 -2
  95. package/lib/src/index.js +1 -1
  96. package/lib/src/locale/lang/en.js +1 -1
  97. package/lib/src/locale/lang/zh-cn.js +1 -1
  98. package/lib/src/path-map.js +1 -1
  99. package/package.json +2 -2
@@ -1,11 +1,12 @@
1
- import { defineComponent as T, ref as p, onMounted as _, computed as y, unref as u, openBlock as S, createElementBlock as R, toDisplayString as U, createBlock as z, mergeProps as D, createSlots as L, renderList as K, withCtx as w, renderSlot as H, normalizeProps as $, guardReactiveProps as j, createVNode as E } from "vue";
2
- import { debounce as W, isFunction as B, isArray as G, isNil as J, omit as Q } from "lodash-unified";
3
- import { Select as X, Spin as Y } from "@aplus-frontend/antdv";
1
+ import { defineComponent as _, ref as y, onMounted as R, computed as S, unref as a, openBlock as w, createElementBlock as U, toDisplayString as z, createBlock as D, mergeProps as L, createSlots as K, renderList as H, withCtx as B, renderSlot as $, normalizeProps as j, guardReactiveProps as E, createVNode as W } from "vue";
2
+ import { debounce as G, isFunction as g, isArray as J, isNil as Q, omit as X } from "lodash-unified";
3
+ import { Select as Y, Spin as Z } from "@aplus-frontend/antdv";
4
4
  import "../../hooks/index.mjs";
5
- import { omitUndefined as Z } from "../../utils/index.mjs";
6
- import { useDefaultPlaceholder as ee } from "../hooks/use-default-placeholder.mjs";
7
- import { useControllableValue as oe } from "../../hooks/useControllableValue.mjs";
8
- const te = { key: 0 }, se = /* @__PURE__ */ T({
5
+ import { omitUndefined as ee } from "../../utils/index.mjs";
6
+ import { useDefaultPlaceholder as oe } from "../hooks/use-default-placeholder.mjs";
7
+ import te from "../hooks/use-options.mjs";
8
+ import { useControllableValue as le } from "../../hooks/useControllableValue.mjs";
9
+ const ne = { key: 0 }, pe = /* @__PURE__ */ _({
9
10
  name: "ApFieldSelect",
10
11
  __name: "index",
11
12
  props: {
@@ -94,80 +95,80 @@ const te = { key: 0 }, se = /* @__PURE__ */ T({
94
95
  onBeforeSelect: {}
95
96
  },
96
97
  emits: ["update:value"],
97
- setup(g, { expose: F, emit: b }) {
98
- let n = 0;
99
- const C = W((o) => {
100
- if (!B(e.request))
98
+ setup(F, { expose: b, emit: C }) {
99
+ let r = 0;
100
+ const N = G((o) => {
101
+ if (!g(e.request))
101
102
  return;
102
- n += 1;
103
- const t = n;
104
- i.value = [], r.value = !0, e.request(o).then((l) => {
105
- n === t && (i.value = l);
103
+ r += 1;
104
+ const t = r;
105
+ i([]), u.value = !0, e.request(o).then((l) => {
106
+ r === t && i(l);
106
107
  }).finally(() => {
107
- r.value = !1;
108
+ u.value = !1;
108
109
  });
109
- }, 300), e = g, N = (o, t) => {
110
- var a;
111
- const l = ((a = e.fieldNames) == null ? void 0 : a.label) || "label";
110
+ }, 300), e = F, x = (o, t) => {
111
+ var n;
112
+ const l = ((n = e.fieldNames) == null ? void 0 : n.label) || "label";
112
113
  return typeof (t == null ? void 0 : t[l]) == "string" && t[l].indexOf(o) > -1;
113
- }, i = p((e == null ? void 0 : e.options) || []), s = p(), r = p((e == null ? void 0 : e.loading) || !1), x = b;
114
- async function c(o = !0) {
115
- if (!B(e.request))
114
+ }, { options: s, updateOptions: i } = te(e), c = y(), u = y((e == null ? void 0 : e.loading) || !1), I = C;
115
+ async function f(o = !0) {
116
+ if (!g(e.request))
116
117
  return;
117
- r.value = !0, n += 1;
118
- const t = n;
118
+ u.value = !0, r += 1;
119
+ const t = r;
119
120
  try {
120
- o && (i.value = []);
121
+ o && i([]);
121
122
  const l = await e.request();
122
- if (t !== n)
123
+ if (t !== r)
123
124
  return;
124
- i.value = l;
125
+ i(l);
125
126
  } finally {
126
- r.value = !1;
127
+ u.value = !1;
127
128
  }
128
129
  }
129
- function I(o) {
130
+ function O(o) {
130
131
  var t;
131
- (t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && n > 0 && !r.value && c(!0);
132
+ (t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && r > 0 && !u.value && f(!0);
132
133
  }
133
- _(() => {
134
+ R(() => {
134
135
  if (e.lazy) {
135
- n += 1;
136
+ r += 1;
136
137
  return;
137
138
  }
138
- c();
139
+ f();
139
140
  });
140
- const { value: m, updateValue: V } = oe(e, x, { beforeUpdateValue: e.onBeforeSelect }), O = ee("Select", e), P = y(() => {
141
+ const { value: m, updateValue: V } = le(e, I, { beforeUpdateValue: e.onBeforeSelect }), P = oe("Select", e), k = S(() => {
141
142
  var d, v;
142
- const o = u(m);
143
+ const o = a(m);
143
144
  if (!o)
144
145
  return e.emptyText;
145
146
  const t = ((d = e.fieldNames) == null ? void 0 : d.label) || "label", l = ((v = e.fieldNames) == null ? void 0 : v.value) || "value";
146
- if (G(o))
147
+ if (J(o))
147
148
  return o.map(
148
- (f) => {
149
+ (p) => {
149
150
  var h;
150
- return (h = u(i).find((M) => M[l] === f)) == null ? void 0 : h[t];
151
+ return (h = a(s).find((T) => T[l] === p)) == null ? void 0 : h[t];
151
152
  }
152
153
  ).filter(Boolean).join("、") || e.emptyText;
153
- const a = u(i).find(
154
- (f) => f[l] === o
154
+ const n = a(s).find(
155
+ (p) => p[l] === o
155
156
  );
156
- return (a == null ? void 0 : a[t]) || e.emptyText;
157
- }), k = y(() => {
157
+ return (n == null ? void 0 : n[t]) || e.emptyText;
158
+ }), q = S(() => {
158
159
  const o = !!(e != null && e.showSearch), t = e.searchMode;
159
160
  let l = {};
160
161
  return o && (l = t === "request" ? {
161
162
  showArrow: !1,
162
163
  defaultActiveFirstOption: !1,
163
- onSearch: C,
164
- notFoundContent: r.value ? void 0 : null
164
+ onSearch: N,
165
+ notFoundContent: u.value ? void 0 : null
165
166
  } : {
166
167
  showArrow: !0,
167
- filterOption: J(e == null ? void 0 : e.filterOption) ? N : e == null ? void 0 : e.filterOption
168
+ filterOption: Q(e == null ? void 0 : e.filterOption) ? x : e == null ? void 0 : e.filterOption
168
169
  }), {
169
- ...Z(
170
- Q(e, [
170
+ ...ee(
171
+ X(e, [
171
172
  "mode",
172
173
  "value",
173
174
  "onUpdate:value",
@@ -177,45 +178,45 @@ const te = { key: 0 }, se = /* @__PURE__ */ T({
177
178
  "onFocus"
178
179
  ])
179
180
  ),
180
- placeholder: u(O),
181
+ placeholder: a(P),
181
182
  ...l
182
183
  };
183
184
  });
184
- function q() {
185
+ function A() {
185
186
  var o;
186
- (o = s.value) == null || o.focus();
187
+ (o = c.value) == null || o.focus();
187
188
  }
188
- function A() {
189
+ function M() {
189
190
  var o;
190
- (o = s.value) == null || o.blur();
191
+ (o = c.value) == null || o.blur();
191
192
  }
192
- return F({
193
- focus: q,
194
- blur: A,
195
- request: c
196
- }), (o, t) => o.mode === "read" ? (S(), R("span", te, U(P.value), 1)) : (S(), z(u(X), D({
193
+ return b({
194
+ focus: A,
195
+ blur: M,
196
+ request: f
197
+ }), (o, t) => o.mode === "read" ? (w(), U("span", ne, z(k.value), 1)) : (w(), D(a(Y), L({
197
198
  key: 1,
198
199
  "allow-clear": "",
199
200
  ref_key: "selectRef",
200
- ref: s
201
- }, k.value, {
201
+ ref: c
202
+ }, q.value, {
202
203
  mode: o.multiple ? "multiple" : void 0,
203
- value: u(m),
204
- "onUpdate:value": u(V),
205
- options: i.value,
206
- loading: r.value,
207
- onFocus: I
208
- }), L({ _: 2 }, [
209
- K(o.$slots, (l, a) => ({
210
- name: a,
211
- fn: w((d) => [
212
- H(o.$slots, a, $(j(d || {})))
204
+ value: a(m),
205
+ "onUpdate:value": a(V),
206
+ options: a(s),
207
+ loading: u.value,
208
+ onFocus: O
209
+ }), K({ _: 2 }, [
210
+ H(o.$slots, (l, n) => ({
211
+ name: n,
212
+ fn: B((d) => [
213
+ $(o.$slots, n, j(E(d || {})))
213
214
  ])
214
215
  })),
215
- r.value ? {
216
+ u.value ? {
216
217
  name: "notFoundContent",
217
- fn: w(() => [
218
- E(u(Y), { size: "small" })
218
+ fn: B(() => [
219
+ W(a(Z), { size: "small" })
219
220
  ]),
220
221
  key: "0"
221
222
  } : void 0
@@ -223,5 +224,5 @@ const te = { key: 0 }, se = /* @__PURE__ */ T({
223
224
  }
224
225
  });
225
226
  export {
226
- se as default
227
+ pe as default
227
228
  };
@@ -1,430 +1,4 @@
1
- import { defineComponent as Ce, useSlots as ve, ref as z, computed as s, unref as t, createVNode as f, Fragment as U, watchEffect as Te, watch as G, openBlock as m, createElementBlock as F, normalizeClass as c, normalizeStyle as M, mergeProps as h, createSlots as J, withCtx as w, renderList as Q, createBlock as X, resolveDynamicComponent as Fe, renderSlot as S, createCommentVNode as Y, createElementVNode as I, h as xe, normalizeProps as Be, guardReactiveProps as Pe } from "vue";
2
- import { Typography as ke, Divider as ze, Button as Ie, Table as Ne } from "@aplus-frontend/antdv";
3
- import { useToken as Ee } from "@aplus-frontend/antdv/es/theme/internal";
4
- import { ApForm as Ke } from "../ap-form/index.mjs";
5
- import { noRenderAsFormItemValueList as Z } from "./constants.mjs";
6
- import "../config-provider/index.mjs";
7
- import { useTablePaging as Le } from "./hooks/use-table-paging.mjs";
8
- import { omit as _, isUndefined as g, isBoolean as Oe } from "lodash-unified";
9
- import { apColumnToColumn as Ve, getTableTitle as De, getTableRenderType as je, getTableRenderProps as Ae, getTableCellRenderNode as We, getColumnOrder as ee, updateFormProps as $e, getFieldProps as He, getSearchFormItemRenderNode as qe, objectToString as Ue } from "./utils.mjs";
10
- import Ge from "./hooks/use-table-content-height.mjs";
11
- import { getRawDisplayValue as Me } from "../editable-table/utils.mjs";
12
- import Je from "./hooks/use-table-row-selection.mjs";
13
- import { isDef as Qe } from "../utils/index.mjs";
14
- import { SettingOutlined as Xe } from "@ant-design/icons-vue";
15
- import "./components/setting/modal/index.vue.mjs";
16
- import { useProvideApTable as Ye } from "./context.mjs";
17
- import { useNamespace as Ze } from "../config-provider/hooks/use-namespace.mjs";
18
- import { useGlobalConfig as _e } from "../config-provider/hooks/use-global-config.mjs";
19
- import ea from "./components/setting/modal/index.vue2.mjs";
20
- const ba = /* @__PURE__ */ Ce({
21
- name: "ApTable",
22
- __name: "ap-table",
23
- props: {
24
- dropdownPrefixCls: {},
25
- loading: {
26
- type: [Boolean, Object],
27
- default: void 0
28
- },
29
- bordered: {
30
- type: Boolean,
31
- default: !1
32
- },
33
- locale: {},
34
- onChange: {},
35
- onResizeColumn: {},
36
- getPopupContainer: {},
37
- scroll: {},
38
- sortDirections: {
39
- default: () => ["ascend", "descend"]
40
- },
41
- showSorterTooltip: {
42
- type: [Boolean, Object],
43
- default: !0
44
- },
45
- prefixCls: {},
46
- rowKey: {
47
- default: "key"
48
- },
49
- tableLayout: {},
50
- rowClassName: {},
51
- title: {},
52
- footer: {},
53
- id: {},
54
- showHeader: {
55
- type: Boolean,
56
- default: !0
57
- },
58
- components: {},
59
- customRow: {},
60
- customHeaderRow: {},
61
- direction: {},
62
- expandFixed: {
63
- type: [String, Boolean],
64
- default: !1
65
- },
66
- expandColumnWidth: {},
67
- expandedRowKeys: {},
68
- defaultExpandedRowKeys: {},
69
- expandedRowRender: {},
70
- expandRowByClick: {
71
- type: Boolean,
72
- default: !1
73
- },
74
- expandIcon: {},
75
- onExpand: {},
76
- onExpandedRowsChange: {},
77
- defaultExpandAllRows: {
78
- type: Boolean,
79
- default: !1
80
- },
81
- indentSize: {
82
- default: 15
83
- },
84
- expandIconColumnIndex: {},
85
- showExpandColumn: {
86
- type: Boolean,
87
- default: !0
88
- },
89
- expandedRowClassName: {},
90
- childrenColumnName: {
91
- default: "children"
92
- },
93
- rowExpandable: {},
94
- sticky: {
95
- type: [Boolean, Object]
96
- },
97
- transformCellText: {},
98
- columns: {},
99
- rowSelection: {
100
- type: [Boolean, Object]
101
- },
102
- card: {
103
- type: Boolean,
104
- default: !1
105
- },
106
- params: {},
107
- searchFormRender: {},
108
- request: {},
109
- onLoad: {},
110
- defaultData: {},
111
- dataSource: {},
112
- onLoadingChange: {},
113
- searchForm: {
114
- type: [Boolean, Object],
115
- default: void 0
116
- },
117
- beforeSearchSubmit: {},
118
- pagination: {
119
- type: [Boolean, Object],
120
- default: void 0
121
- },
122
- searchFormWrapperStyle: {},
123
- tableWrapperStyle: {},
124
- manual: {
125
- type: Boolean,
126
- default: !1
127
- },
128
- size: {
129
- default: "middle"
130
- },
131
- adaptive: {
132
- type: Boolean,
133
- default: !1
134
- },
135
- columnResizable: {
136
- type: Boolean,
137
- default: !1
138
- },
139
- settings: {
140
- type: [Boolean, Object],
141
- default: void 0
142
- }
143
- },
144
- setup(ae, {
145
- expose: oe
146
- }) {
147
- const a = ae;
148
- let N = 0;
149
- const b = ve(), [, te] = Ee(), {
150
- e: x,
151
- b: i,
152
- be: E
153
- } = Ze("ap-table"), K = _e("valueTypeMap"), {
154
- height: re,
155
- contentRef: le
156
- } = Ge(), B = z(a.size), d = z([]), L = z([]);
157
- Ye({
158
- columns: s(() => d.value),
159
- columnsBackup: s(() => L.value),
160
- size: s(() => B.value),
161
- updateColumns(e) {
162
- d.value = e;
163
- },
164
- updateSize(e) {
165
- B.value = e;
166
- }
167
- });
168
- const ne = () => {
169
- var r;
170
- let e = ((r = a.columns) == null ? void 0 : r.filter((l) => !l.hideInTable)) || [];
171
- function o(l, u) {
172
- return l.map((n) => ({
173
- resizable: Qe(n.resizable) ? n.resizable : a.columnResizable,
174
- ..._(Ve(n), ["ellipsis"]),
175
- fixed: u ? u.fixed : n.fixed,
176
- title: De(n, E("table-header", "title"), b.headerCell, t(te).colorPrimary),
177
- customRender({
178
- value: p,
179
- ...y
180
- }) {
181
- var H, q;
182
- const W = je(n), Se = Ae({
183
- ...n,
184
- valueType: W
185
- }, {
186
- value: p,
187
- ...y
188
- }), be = We(W, Se, y.record, t(K)), $ = ((H = n.renderText) == null ? void 0 : H.call(n, {
189
- value: p,
190
- ...y
191
- })) || p, Re = n.renderText ? f(U, null, [(q = n.renderText) == null ? void 0 : q.call(n, {
192
- value: p,
193
- ...y
194
- })]) : be;
195
- let k = ge(n, $, Re);
196
- return n.customRender && (k = n.customRender({
197
- value: p,
198
- ...y,
199
- column: n,
200
- originalNode: k,
201
- originalText: $
202
- })), k;
203
- },
204
- children: o(n.children || [], u || n)
205
- }));
206
- }
207
- return o(e);
208
- };
209
- Te(() => {
210
- const e = ne();
211
- d.value = e, L.value = e;
212
- });
213
- const O = s(() => {
214
- var e, o, r;
215
- return N++, ((r = (o = (e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !Z.includes(l.valueType))) == null ? void 0 : o.sort((l, u) => {
216
- let n = ee(l.order);
217
- return ee(u.order) - n;
218
- })) == null ? void 0 : r.map((l) => {
219
- const u = $e(l, He(l.fieldProps, {})), n = {
220
- ...l,
221
- fieldProps: {
222
- label: l.title,
223
- name: l.dataIndex,
224
- ...u || {},
225
- _signal: N
226
- },
227
- renderNode: void 0
228
- };
229
- return n.renderNode = qe(n, t(K)), n;
230
- })) || [];
231
- }), se = s(() => t(d).filter((e) => e.sorter === !0).map((e) => e.dataIndex).filter(Boolean)), de = s(() => t(d).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex).filter(Boolean)), ue = s(() => g(a.dataSource) ? T.value.records : a.dataSource), {
232
- rowSelection: R,
233
- selectedRows: C,
234
- ...v
235
- } = Je({
236
- ...a.rowSelection === !0 ? {} : a.rowSelection,
237
- rowKey: a.rowKey,
238
- dataSource: ue
239
- }), {
240
- formRef: P,
241
- submit: V,
242
- reset: D,
243
- tableProps: j,
244
- refresh: ie,
245
- data: T,
246
- setDataSource: ce
247
- } = Le({
248
- async request(e) {
249
- var r, l;
250
- if (!R.value.preserveSelectedRowKeys && g(a.dataSource) && v.clearAll(), !g(a.dataSource))
251
- return {
252
- data: a.dataSource || [],
253
- total: a.dataSource.length || 0
254
- };
255
- const o = await ((r = a.request) == null ? void 0 : r.call(a, e));
256
- return (l = a.onLoad) == null || l.call(a, (o == null ? void 0 : o.data) || []), {
257
- data: (o == null ? void 0 : o.data) || [],
258
- total: (o == null ? void 0 : o.total) || 0
259
- };
260
- },
261
- filterFields: de,
262
- sortFields: se,
263
- defaultParams: a.params,
264
- defaultData: a.defaultData,
265
- manual: a.manual,
266
- defaultCurrent: a.pagination ? a.pagination.defaultCurrent : void 0,
267
- defaultPageSize: a.pagination ? a.pagination.defaultPageSize : void 0,
268
- formatParams: a.beforeSearchSubmit,
269
- showLessItems: a.pagination ? a.pagination.showLessItems : void 0,
270
- showTotal: a.pagination ? a.pagination.showTotal : void 0
271
- }), pe = s(() => {
272
- var o, r;
273
- if (a.adaptive && (T.value.total > 0 || ((o = a.dataSource) == null ? void 0 : o.length)))
274
- return {
275
- y: t(re),
276
- x: ((r = a.scroll) == null ? void 0 : r.x) || "100%"
277
- };
278
- if (a.scroll)
279
- return a.scroll;
280
- }), fe = s(() => {
281
- var e;
282
- if (a.tableLayout)
283
- return a.tableLayout;
284
- if ((e = a.columns) != null && e.some((o) => o.ellipsis))
285
- return "fixed";
286
- }), A = s(() => {
287
- var r;
288
- const e = t(j), o = t(R);
289
- return {
290
- ...a,
291
- ...e,
292
- rowSelection: a.rowSelection === !0 || ((r = a.rowSelection) == null ? void 0 : r.mode) === "internal" ? {
293
- ...o,
294
- // tips 如果是前端分页,则默认会走缓存
295
- preserveSelectedRowKeys: g(a.dataSource) ? o.preserveSelectedRowKeys : !0
296
- } : a.rowSelection,
297
- loading: g(a.loading) ? e.loading : a.loading,
298
- pagination: a.pagination === !1 ? !1 : e.pagination,
299
- scroll: t(pe)
300
- };
301
- }), me = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
302
- function ge(e, o, r) {
303
- if (Z.includes(e.valueType))
304
- return r;
305
- const l = Ue(o);
306
- return e.copyable || e.ellipsis ? f(ke.Paragraph, {
307
- copyable: e.copyable ? {
308
- text: l,
309
- tooltip: !1
310
- } : !1,
311
- ellipsis: e.ellipsis ? Oe(e.ellipsis) ? {
312
- tooltip: l
313
- } : {
314
- ...e.ellipsis,
315
- tooltip: l
316
- } : !1,
317
- content: e.ellipsis ? Me(e, o) : r
318
- }, null) : r;
319
- }
320
- G(() => t(T).loading, (e) => {
321
- var o;
322
- (o = a.onLoadingChange) == null || o.call(a, e);
323
- }), G(() => a.dataSource, (e) => {
324
- ce(e);
325
- }, {
326
- immediate: !0
327
- });
328
- function ye(e) {
329
- var o, r, l;
330
- (l = (r = (o = P.value) == null ? void 0 : o.apForm) == null ? void 0 : r.setFieldsValue) == null || l.call(r, e);
331
- }
332
- function he() {
333
- var e, o, r;
334
- return (r = (o = (e = P.value) == null ? void 0 : e.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : r.call(o, !0);
335
- }
336
- function we() {
337
- return t(d);
338
- }
339
- return oe({
340
- submit: () => V(),
341
- reset: () => D(),
342
- refresh: () => ie(),
343
- setSearchFormValues: ye,
344
- getSearchFormValues: he,
345
- getShownColumns: we,
346
- dataSource: s(() => t(T).records),
347
- rowSelection: {
348
- selectedRows: s(() => t(C)),
349
- ...v
350
- }
351
- }), (e, o) => (m(), F("div", {
352
- class: c(me.value)
353
- }, [t(g)(e.dataSource) && e.searchForm !== !1 && O.value.length > 0 ? (m(), F("div", {
354
- key: 0,
355
- class: c(e.card ? t(x)("search-wrapper") : null),
356
- style: M(e.searchFormWrapperStyle)
357
- }, [f(t(Ke).SearchForm, h(e.searchForm || {}, {
358
- ref_key: "formRef",
359
- ref: P,
360
- "custom-reset": "",
361
- onSubmit: t(V),
362
- onReset: t(D),
363
- "submit-loading": t(j).loading
364
- }), J({
365
- default: w(() => [(m(!0), F(U, null, Q(O.value, (r) => (m(), X(Fe(r.renderNode), h({
366
- key: r.dataIndex,
367
- ref_for: !0
368
- }, r.fieldProps || {}, {
369
- span: r.span
370
- }), null, 16, ["span"]))), 128))]),
371
- _: 2
372
- }, [b.searchFormExtra ? {
373
- name: "extra",
374
- fn: w(() => [S(e.$slots, "searchFormExtra")]),
375
- key: "0"
376
- } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : Y("", !0), I("div", {
377
- ref_key: "contentRef",
378
- ref: le,
379
- class: c([t(x)("table-wrapper"), e.card ? t(x)("table-wrapper-card") : null]),
380
- style: M(e.tableWrapperStyle)
381
- }, [I("div", {
382
- class: c(t(i)("header-wrapper"))
383
- }, [e.settings ? (m(), F("div", {
384
- key: 0,
385
- class: c(t(i)("header"))
386
- }, [I("div", {
387
- class: c(t(E)("header", "title"))
388
- }, [S(e.$slots, "title", h({
389
- selectedRows: t(C),
390
- selectedRowKeys: t(R).selectedRowKeys,
391
- shownColumns: d.value
392
- }, v))], 2), b.title ? (m(), X(t(ze), {
393
- key: 0,
394
- type: "vertical"
395
- })) : Y("", !0), f(ea, {
396
- config: e.settings === !0 ? {} : e.settings
397
- }, {
398
- trigger: w(() => [f(t(Ie), {
399
- class: c(t(i)("setting-trigger-button")),
400
- icon: xe(t(Xe))
401
- }, null, 8, ["class", "icon"])]),
402
- _: 1
403
- }, 8, ["config"])], 2)) : S(e.$slots, "title", h({
404
- key: 1,
405
- selectedRows: t(C),
406
- selectedRowKeys: t(R).selectedRowKeys,
407
- shownColumns: d.value
408
- }, v))], 2), f(t(Ne), h({
409
- class: t(i)("table")
410
- }, A.value, {
411
- size: B.value,
412
- "table-layout": fe.value,
413
- columns: d.value,
414
- onResizeColumn: o[0] || (o[0] = (r, l) => l.width = r)
415
- }), J({
416
- summary: w(() => [S(e.$slots, "summary", {
417
- columns: d.value,
418
- records: A.value.dataSource,
419
- selectedRows: t(C)
420
- })]),
421
- _: 2
422
- }, [Q(t(_)(b, ["title", "searchFormExtra", "headerCell", "summary"]), (r, l) => ({
423
- name: l,
424
- fn: w((u) => [S(e.$slots, l, Be(Pe(u || {})))])
425
- }))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 2));
426
- }
427
- });
1
+ import f from "./ap-table.vue2.mjs";
428
2
  export {
429
- ba as default
3
+ f as default
430
4
  };