@aplus-frontend/ui 0.4.6 → 0.4.7

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 (41) hide show
  1. package/es/src/ap-field/date-range/index.vue.mjs +46 -42
  2. package/es/src/ap-field/hooks/use-default-presets.d.ts +11 -0
  3. package/es/src/ap-field/hooks/use-default-presets.mjs +15 -0
  4. package/es/src/ap-field/interface.d.ts +2 -1
  5. package/es/src/ap-table/ap-table.vue2.mjs +87 -85
  6. package/es/src/ap-table/components/dynamic-component/diff.d.ts +2 -0
  7. package/es/src/ap-table/components/dynamic-component/index.vue.d.ts +4 -0
  8. package/es/src/ap-table/components/dynamic-component/index.vue.mjs +4 -0
  9. package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +14 -0
  10. package/es/src/ap-table/components/interface.d.ts +3 -0
  11. package/es/src/ap-table/utils.d.ts +1549 -1539
  12. package/es/src/ap-table/utils.mjs +115 -104
  13. package/es/src/ap-upload/components/Picture.vue2.mjs +59 -55
  14. package/es/src/business/batch-input-group/form-item.vue.d.ts +0 -1
  15. package/es/src/business/batch-input-group/form-item.vue.mjs +43 -39
  16. package/es/src/business/hooks/usePageListApTable.d.ts +2 -2
  17. package/es/src/locale/lang/en.mjs +10 -1
  18. package/es/src/locale/lang/zh-cn.mjs +10 -1
  19. package/es/src/utils/data-range-persets.d.ts +87 -0
  20. package/es/src/utils/data-range-persets.mjs +107 -0
  21. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  22. package/lib/src/ap-field/hooks/use-default-presets.d.ts +11 -0
  23. package/lib/src/ap-field/hooks/use-default-presets.js +1 -0
  24. package/lib/src/ap-field/interface.d.ts +2 -1
  25. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  26. package/lib/src/ap-table/components/dynamic-component/diff.d.ts +2 -0
  27. package/lib/src/ap-table/components/dynamic-component/index.vue.d.ts +4 -0
  28. package/lib/src/ap-table/components/dynamic-component/index.vue.js +1 -0
  29. package/lib/src/ap-table/components/dynamic-component/index.vue2.js +1 -0
  30. package/lib/src/ap-table/components/interface.d.ts +3 -0
  31. package/lib/src/ap-table/utils.d.ts +1549 -1539
  32. package/lib/src/ap-table/utils.js +1 -1
  33. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  34. package/lib/src/business/batch-input-group/form-item.vue.d.ts +0 -1
  35. package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
  36. package/lib/src/business/hooks/usePageListApTable.d.ts +2 -2
  37. package/lib/src/locale/lang/en.js +1 -1
  38. package/lib/src/locale/lang/zh-cn.js +1 -1
  39. package/lib/src/utils/data-range-persets.d.ts +87 -0
  40. package/lib/src/utils/data-range-persets.js +1 -0
  41. package/package.json +3 -3
@@ -1,16 +1,17 @@
1
- import { defineComponent as U, useSlots as H, computed as m, unref as n, isVNode as K, createVNode as T, Fragment as h, openBlock as g, createElementBlock as v, createTextVNode as B, toDisplayString as P, createBlock as O, resolveDynamicComponent as $, mergeProps as L, createSlots as W, renderList as Y, withCtx as Z, renderSlot as q, normalizeProps as G, guardReactiveProps as J } from "vue";
2
- import { ApFieldDatePresetFormats as Q, PRESET_FORMAT_MAP as X, PRESET_FORMAT_PICK_MAP as ee, PRESET_FORMAT_TIME_MAP as oe } from "../date/constant.mjs";
1
+ import { defineComponent as H, useSlots as K, computed as m, unref as n, isVNode as $, createVNode as T, Fragment as h, openBlock as g, createElementBlock as v, createTextVNode as B, toDisplayString as P, createBlock as O, resolveDynamicComponent as L, mergeProps as W, createSlots as Y, renderList as Z, withCtx as q, renderSlot as G, normalizeProps as J, guardReactiveProps as Q } from "vue";
2
+ import { ApFieldDatePresetFormats as X, PRESET_FORMAT_MAP as ee, PRESET_FORMAT_PICK_MAP as oe, PRESET_FORMAT_TIME_MAP as ne } from "../date/constant.mjs";
3
3
  import "../../hooks/index.mjs";
4
- import { isNil as b, omit as R, isString as c, isFunction as ne } from "lodash-unified";
4
+ import { isNil as b, omit as R, isString as c, isFunction as te } from "lodash-unified";
5
5
  import u from "dayjs";
6
- import { DatePicker as te } from "@aplus-frontend/antdv";
7
- import { formatDayWithTimezone as ae } from "../date/helper.mjs";
8
- import { SwapRightOutlined as re } from "@ant-design/icons-vue";
9
- import { omitUndefined as le } from "../../utils/index.mjs";
6
+ import { DatePicker as ae } from "@aplus-frontend/antdv";
7
+ import { formatDayWithTimezone as re } from "../date/helper.mjs";
8
+ import { SwapRightOutlined as le } from "@ant-design/icons-vue";
9
+ import { omitUndefined as ue } from "../../utils/index.mjs";
10
10
  import { getTimeFormatToZone as w } from "@aplus-frontend/utils";
11
- import { useDefaultPlaceholder as ue } from "../hooks/use-default-placeholder.mjs";
12
- import { useControllableValue as de } from "../../hooks/useControllableValue.mjs";
13
- const Be = /* @__PURE__ */ U({
11
+ import { useDefaultPlaceholder as de } from "../hooks/use-default-placeholder.mjs";
12
+ import { useDefaultPresets as ie } from "../hooks/use-default-presets.mjs";
13
+ import { useControllableValue as se } from "../../hooks/useControllableValue.mjs";
14
+ const De = /* @__PURE__ */ H({
14
15
  __name: "index",
15
16
  props: {
16
17
  mode: {
@@ -26,7 +27,6 @@ const Be = /* @__PURE__ */ U({
26
27
  default: void 0
27
28
  },
28
29
  disabledTime: {},
29
- presets: {},
30
30
  ranges: {},
31
31
  separator: {
32
32
  type: [Object, String, Number, Boolean, null, Array],
@@ -147,60 +147,64 @@ const Be = /* @__PURE__ */ U({
147
147
  default: "Y-D"
148
148
  },
149
149
  timezone: {},
150
- readModeSeparator: {}
150
+ readModeSeparator: {},
151
+ presets: {
152
+ type: [Array, Boolean]
153
+ }
151
154
  },
152
155
  emits: ["update:value"],
153
156
  setup(_, {
154
157
  emit: A
155
158
  }) {
156
- const o = _, F = A, k = H(), d = m(() => Q.indexOf(o.format) > -1), i = m(() => d.value ? X[o.format] : o.format), {
159
+ const o = _, F = A, k = K(), d = m(() => X.indexOf(o.format) > -1), i = m(() => d.value ? ee[o.format] : o.format), {
157
160
  value: y,
158
161
  updateValue: C
159
- } = de(o, F), N = ue("DateRange", o), f = ae(o.timezone), S = m(() => {
162
+ } = se(o, F), N = de("DateRange", o), x = ie(o), s = re(o.timezone), S = m(() => {
160
163
  var a, l;
161
164
  const e = n(y);
162
165
  if (b(e) || !(e != null && e.length))
163
166
  return e;
164
167
  const r = o.timezone ? w(n(y)[0], o.timezone) : (a = n(y)) == null ? void 0 : a[0], t = o.timezone ? w(n(y)[1], o.timezone) : (l = n(y)) == null ? void 0 : l[1];
165
168
  return [u(r), u(t)];
166
- }), x = m(() => n(d) ? o.picker ?? ee[o.format] : o.picker), z = m(() => {
167
- const e = n(d) ? oe[o.format] : {};
169
+ }), z = m(() => n(d) ? o.picker ?? oe[o.format] : o.picker), E = m(() => {
170
+ const e = n(d) ? ne[o.format] : {};
168
171
  return {
169
- ...le(R(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode"])),
172
+ ...ue(R(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
170
173
  placeholder: n(N),
174
+ presets: n(x),
171
175
  ...e
172
176
  };
173
177
  });
174
- function E(e) {
178
+ function V(e) {
175
179
  if (!e) {
176
180
  C(e);
177
181
  return;
178
182
  }
179
183
  let r = c(e[0]) ? u(e[0]) : e[0], t = c(e[1]) ? u(e[1]) : e[1];
180
184
  const a = n(d) ? n(i) : void 0;
181
- C([f(r, a), f(t, a, !1)]);
185
+ C([s(r, a), s(t, a, !1)]);
182
186
  }
183
- function V(e) {
187
+ function I(e) {
184
188
  var p;
185
- const r = c(e[0]) ? u(e[0]) : e[0], t = c(e[1]) ? u(e[1]) : e[1], a = n(d) ? n(i) : void 0, l = e[0] ? f(r, a) : null, s = e[1] ? f(t, a, !1) : null;
186
- (p = o.onOk) == null || p.call(o, [l, s]);
189
+ const r = c(e[0]) ? u(e[0]) : e[0], t = c(e[1]) ? u(e[1]) : e[1], a = n(d) ? n(i) : void 0, l = e[0] ? s(r, a) : null, f = e[1] ? s(t, a, !1) : null;
190
+ (p = o.onOk) == null || p.call(o, [l, f]);
187
191
  }
188
- function I(e, r) {
189
- var M, D;
192
+ function j(e, r) {
193
+ var D, M;
190
194
  if (b(e)) {
191
- (M = o.onChange) == null || M.call(o, e, r);
195
+ (D = o.onChange) == null || D.call(o, e, r);
192
196
  return;
193
197
  }
194
- const t = c(e[0]) ? u(e[0]) : e[0], a = c(e[1]) ? u(e[1]) : e[1], l = n(d) ? n(i) : void 0, s = e[0] ? f(t, l) : null, p = e[1] ? f(a, l, !1) : null;
195
- (D = o.onChange) == null || D.call(o, [s, p], r);
198
+ const t = c(e[0]) ? u(e[0]) : e[0], a = c(e[1]) ? u(e[1]) : e[1], l = n(d) ? n(i) : void 0, f = e[0] ? s(t, l) : null, p = e[1] ? s(a, l, !1) : null;
199
+ (M = o.onChange) == null || M.call(o, [f, p], r);
196
200
  }
197
- const j = m(() => {
201
+ const U = m(() => {
198
202
  var t;
199
203
  const e = o.readModeSeparator;
200
204
  if (e)
201
- return K(e) || ne(e) ? o.readModeSeparator : T(h, null, [o.readModeSeparator]);
205
+ return $(e) || te(e) ? o.readModeSeparator : T(h, null, [o.readModeSeparator]);
202
206
  const r = (t = k.readModeSeparator) == null ? void 0 : t.call(k);
203
- return r ? T(h, null, [r]) : re;
207
+ return r ? T(h, null, [r]) : le;
204
208
  });
205
209
  return (e, r) => {
206
210
  var t, a;
@@ -208,26 +212,26 @@ const Be = /* @__PURE__ */ U({
208
212
  key: 0
209
213
  }, [S.value ? (g(), v(h, {
210
214
  key: 0
211
- }, [B(P((t = S.value[0]) == null ? void 0 : t.format(i.value)) + " ", 1), (g(), O($(j.value))), B(" " + P((a = S.value[1]) == null ? void 0 : a.format(i.value)), 1)], 64)) : (g(), v(h, {
215
+ }, [B(P((t = S.value[0]) == null ? void 0 : t.format(i.value)) + " ", 1), (g(), O(L(U.value))), B(" " + P((a = S.value[1]) == null ? void 0 : a.format(i.value)), 1)], 64)) : (g(), v(h, {
212
216
  key: 1
213
- }, [B(P(e.emptyText), 1)], 64))], 64)) : (g(), O(n(te).RangePicker, L({
217
+ }, [B(P(e.emptyText), 1)], 64))], 64)) : (g(), O(n(ae).RangePicker, W({
214
218
  key: 1
215
- }, z.value, {
219
+ }, E.value, {
216
220
  value: S.value,
217
- picker: x.value,
221
+ picker: z.value,
218
222
  format: i.value,
219
- "onUpdate:value": E,
220
- onChange: I,
221
- onOk: V
222
- }), W({
223
+ "onUpdate:value": V,
224
+ onChange: j,
225
+ onOk: I
226
+ }), Y({
223
227
  _: 2
224
- }, [Y(n(R)(e.$slots, "readModeSeparator"), (l, s) => ({
225
- name: s,
226
- fn: Z((p) => [q(e.$slots, s, G(J(p || {})))])
228
+ }, [Z(n(R)(e.$slots, "readModeSeparator"), (l, f) => ({
229
+ name: f,
230
+ fn: q((p) => [G(e.$slots, f, J(Q(p || {})))])
227
231
  }))]), 1040, ["value", "picker", "format"]));
228
232
  };
229
233
  }
230
234
  });
231
235
  export {
232
- Be as default
236
+ De as default
233
237
  };
@@ -0,0 +1,11 @@
1
+ import { ApFieldDateRangeProps, BasicApFieldProps } from '../interface';
2
+ import { Dayjs } from 'dayjs';
3
+ import { ComputedRef } from 'vue';
4
+ import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
5
+ export declare const useDefaultPresets: (props: BasicApFieldProps<{
6
+ presets?: ApFieldDateRangeProps["presets"];
7
+ timezone?: ApFieldDateRangeProps["timezone"];
8
+ }>) => ComputedRef<{
9
+ label: VueNode;
10
+ value: Dayjs[];
11
+ }[] | undefined>;
@@ -0,0 +1,15 @@
1
+ import { computed as r } from "vue";
2
+ import { presetsDefault as f } from "../../utils/data-range-persets.mjs";
3
+ const b = (e) => r(() => {
4
+ var t, u;
5
+ return e.presets === !0 ? f(e == null ? void 0 : e.timezone) : (u = (t = e == null ? void 0 : e.presets) == null ? void 0 : t.map) == null ? void 0 : u.call(t, (l) => {
6
+ var a;
7
+ return {
8
+ label: l.label,
9
+ value: (a = l == null ? void 0 : l.value) == null ? void 0 : a.filter((m) => m !== null)
10
+ };
11
+ });
12
+ });
13
+ export {
14
+ b as useDefaultPresets
15
+ };
@@ -89,7 +89,7 @@ export type ApFieldTextAreaExpose = {
89
89
  blur: () => void;
90
90
  resizableTextArea: any;
91
91
  };
92
- export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'value' | 'onChange' | 'onPanelChange' | 'defaultValue' | 'onOk' | 'renderExtraFooter' | 'onUpdate:value' | 'mode' | 'format'>> & {
92
+ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'value' | 'onChange' | 'onPanelChange' | 'defaultValue' | 'onOk' | 'renderExtraFooter' | 'onUpdate:value' | 'mode' | 'format' | 'presets'>> & {
93
93
  emptyText?: string;
94
94
  value?: RangeValue<number> | null;
95
95
  defaultValue?: RangeValue<number>;
@@ -104,6 +104,7 @@ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'va
104
104
  * 只读模式下的分隔符(比插槽优先级更高)
105
105
  */
106
106
  readModeSeparator?: any;
107
+ presets?: RangePickerProps['presets'] | true;
107
108
  };
108
109
  export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
109
110
  emptyText?: string;
@@ -1,12 +1,12 @@
1
- import { defineComponent as Te, useSlots as Fe, ref as P, computed as s, unref as t, createVNode as w, Fragment as q, watchEffect as xe, watch as G, openBlock as p, createElementBlock as T, normalizeClass as f, normalizeStyle as M, mergeProps as S, createSlots as _, withCtx as F, renderList as J, createBlock as Q, resolveDynamicComponent as Be, renderSlot as b, createCommentVNode as X, createElementVNode as I, normalizeProps as ke, guardReactiveProps as ze } from "vue";
2
- import { Divider as Pe, Table as Ie } from "@aplus-frontend/antdv";
3
- import { useToken as Ne } from "@aplus-frontend/antdv/es/theme/internal";
1
+ import { defineComponent as Te, useSlots as Fe, ref as P, computed as s, unref as t, createVNode as w, Fragment as q, watchEffect as xe, watch as G, openBlock as p, createElementBlock as T, normalizeClass as f, normalizeStyle as M, mergeProps as S, createSlots as _, withCtx as F, renderList as J, createBlock as Q, resolveDynamicComponent as Be, renderSlot as b, createCommentVNode as X, createElementVNode as N, normalizeProps as ke, guardReactiveProps as ze } from "vue";
2
+ import { Divider as Pe, Table as Ne } from "@aplus-frontend/antdv";
3
+ import { useToken as Ie } from "@aplus-frontend/antdv/es/theme/internal";
4
4
  import { ApForm as Ee } from "../ap-form/index.mjs";
5
5
  import { noRenderAsFormItemValueList as Y } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
7
  import { useTablePaging as Ke } from "./hooks/use-table-paging-ng.mjs";
8
8
  import { isUndefined as m, omit as Z, isBoolean as Oe } from "lodash-unified";
9
- import { getColumnOrder as ee, updateFormProps as Le, getFieldProps as Ve, getSearchFormItemRenderNode as Ae, recursionApColumns as ae, apColumnToColumn as De, getTableTitle as je, getTableRenderType as $e, getTableRenderProps as We, getTableCellRenderNode as He, falseToUndefined as Ue } from "./utils.mjs";
9
+ import { getColumnOrder as ee, updateFormProps as Le, getFieldProps as Ve, getSearchFormItemRenderNode as Ae, recursionApColumns as oe, apColumnToColumn as De, getTableTitle as je, getTableRenderType as $e, getTableRenderProps as We, getTableCellRenderNode as He, falseToUndefined as Ue } from "./utils.mjs";
10
10
  import qe from "./hooks/use-table-content-height.mjs";
11
11
  import Ge from "./hooks/use-table-row-selection.mjs";
12
12
  import { isDef as Me } from "../utils/index.mjs";
@@ -17,7 +17,7 @@ import { useNamespace as Je } from "../config-provider/hooks/use-namespace.mjs";
17
17
  import { useGlobalConfig as Qe } from "../config-provider/hooks/use-global-config.mjs";
18
18
  import Xe from "./components/paragraph-ellipsis/index.vue2.mjs";
19
19
  import Ye from "./components/setting/modal/index.vue2.mjs";
20
- const Sa = /* @__PURE__ */ Te({
20
+ const bo = /* @__PURE__ */ Te({
21
21
  name: "ApTable",
22
22
  __name: "ap-table",
23
23
  props: {
@@ -141,19 +141,19 @@ const Sa = /* @__PURE__ */ Te({
141
141
  default: void 0
142
142
  }
143
143
  },
144
- setup(oe, {
144
+ setup(ae, {
145
145
  expose: re
146
146
  }) {
147
- const a = oe;
148
- let N = 0;
149
- const h = Fe(), [, te] = Ne(), {
147
+ const o = ae;
148
+ let I = 0;
149
+ const h = Fe(), [, te] = Ie(), {
150
150
  e: x,
151
151
  b: i,
152
152
  be: E
153
153
  } = Je("ap-table"), K = Qe("valueTypeMap"), {
154
154
  height: le,
155
155
  contentRef: ne
156
- } = qe(), B = P(a.size), u = P([]), O = P([]);
156
+ } = qe(), B = P(o.size), u = P([]), O = P([]);
157
157
  _e({
158
158
  columns: s(() => u.value),
159
159
  columnsBackup: s(() => O.value),
@@ -167,37 +167,37 @@ const Sa = /* @__PURE__ */ Te({
167
167
  dataSource: s(() => t(y).records)
168
168
  });
169
169
  const L = s(() => {
170
- var e, r, o;
171
- return N++, ((o = (r = (e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !Y.includes(l.valueType))) == null ? void 0 : r.sort((l, d) => {
170
+ var e, r, a;
171
+ return I++, ((a = (r = (e = o.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !Y.includes(l.valueType))) == null ? void 0 : r.sort((l, d) => {
172
172
  let n = ee(l.order);
173
173
  return ee(d.order) - n;
174
- })) == null ? void 0 : o.map((l) => {
174
+ })) == null ? void 0 : a.map((l) => {
175
175
  const d = Le(l, Ve(l.fieldProps, {})), n = {
176
176
  ...l,
177
177
  fieldProps: {
178
178
  label: l.title,
179
179
  name: l.dataIndex,
180
180
  ...d || {},
181
- _signal: N
181
+ _signal: I
182
182
  },
183
183
  renderNode: void 0
184
184
  };
185
185
  return n.renderNode = Ae(n, t(K)), n;
186
186
  })) || [];
187
- }), se = s(() => ae(t(u), (e) => {
187
+ }), se = s(() => oe(t(u), (e) => {
188
188
  if (e.sorter === !0)
189
189
  return e.key || e.dataIndex;
190
- }).filter(Boolean)), de = s(() => ae(t(u), (e) => {
190
+ }).filter(Boolean)), de = s(() => oe(t(u), (e) => {
191
191
  if (e.filters && !e.onFilter)
192
192
  return e.key || e.dataIndex;
193
- }).filter(Boolean)), ue = s(() => m(a.dataSource) ? y.records : a.dataSource), {
194
- rowSelection: R,
195
- selectedRows: C,
193
+ }).filter(Boolean)), ue = s(() => m(o.dataSource) ? y.records : o.dataSource), {
194
+ rowSelection: C,
195
+ selectedRows: R,
196
196
  ...v
197
197
  } = Ge({
198
198
  fixed: !0,
199
- ...a.rowSelection === !0 ? {} : a.rowSelection,
200
- rowKey: a.rowKey,
199
+ ...o.rowSelection === !0 ? {} : o.rowSelection,
200
+ rowKey: o.rowKey,
201
201
  dataSource: ue
202
202
  }), {
203
203
  formRef: k,
@@ -210,31 +210,31 @@ const Sa = /* @__PURE__ */ Te({
210
210
  getColumnSFConfig: pe
211
211
  } = Ke({
212
212
  async request(e) {
213
- var o, l;
214
- if (!R.value.preserveSelectedRowKeys && m(a.dataSource) && v.clearAll(), !m(a.dataSource))
213
+ var a, l;
214
+ if (!C.value.preserveSelectedRowKeys && m(o.dataSource) && v.clearAll(), !m(o.dataSource))
215
215
  return {
216
- data: a.dataSource || [],
217
- total: a.dataSource.length || 0
216
+ data: o.dataSource || [],
217
+ total: o.dataSource.length || 0
218
218
  };
219
- const r = await ((o = a.request) == null ? void 0 : o.call(a, e));
220
- return (l = a.onLoad) == null || l.call(a, (r == null ? void 0 : r.data) || []), {
219
+ const r = await ((a = o.request) == null ? void 0 : a.call(o, e));
220
+ return (l = o.onLoad) == null || l.call(o, (r == null ? void 0 : r.data) || []), {
221
221
  data: (r == null ? void 0 : r.data) || [],
222
222
  total: (r == null ? void 0 : r.total) || 0
223
223
  };
224
224
  },
225
225
  filterFields: de,
226
226
  sortFields: se,
227
- defaultParams: a.params,
228
- defaultData: a.defaultData,
229
- manual: a.manual,
230
- formatParams: a.beforeSearchSubmit,
231
- pagination: a.pagination
227
+ defaultParams: o.params,
228
+ defaultData: o.defaultData,
229
+ manual: o.manual,
230
+ formatParams: o.beforeSearchSubmit,
231
+ pagination: o.pagination
232
232
  }), fe = () => {
233
- var o;
234
- let e = ((o = a.columns) == null ? void 0 : o.filter((l) => !l.hideInTable)) || [];
233
+ var a;
234
+ let e = ((a = o.columns) == null ? void 0 : a.filter((l) => !l.hideInTable)) || [];
235
235
  function r(l, d) {
236
236
  return l.map((n) => ({
237
- resizable: Me(n.resizable) ? n.resizable : a.columnResizable,
237
+ resizable: Me(n.resizable) ? n.resizable : o.columnResizable,
238
238
  ...Z(De(n), ["ellipsis"]),
239
239
  ...pe(n),
240
240
  fixed: d ? d.fixed : n.fixed,
@@ -244,19 +244,19 @@ const Sa = /* @__PURE__ */ Te({
244
244
  ...g
245
245
  }) {
246
246
  var H, U;
247
- const $ = $e(n), Re = We({
247
+ const $ = $e(n), Ce = We({
248
248
  ...n,
249
249
  valueType: $
250
250
  }, {
251
251
  value: c,
252
252
  ...g
253
- }), Ce = He($, Re, g.record, t(K)), W = ((H = n.renderText) == null ? void 0 : H.call(n, {
253
+ }), Re = He($, Ce, g.record, t(K)), W = ((H = n.renderText) == null ? void 0 : H.call(n, {
254
254
  value: c,
255
255
  ...g
256
256
  })) || c, ve = n.renderText ? w(q, null, [(U = n.renderText) == null ? void 0 : U.call(n, {
257
257
  value: c,
258
258
  ...g
259
- })]) : Ce;
259
+ })]) : Re;
260
260
  let z = we(n, W, ve);
261
261
  return n.customRender && (z = n.customRender({
262
262
  value: c,
@@ -276,65 +276,65 @@ const Sa = /* @__PURE__ */ Te({
276
276
  u.value = e, O.value = e;
277
277
  });
278
278
  const me = s(() => {
279
- var r, o;
280
- if (a.adaptive && (y.total > 0 || ((r = a.dataSource) == null ? void 0 : r.length)))
279
+ var r, a;
280
+ if (o.adaptive && (y.total > 0 || ((r = o.dataSource) == null ? void 0 : r.length)))
281
281
  return {
282
282
  y: t(le),
283
- x: ((o = a.scroll) == null ? void 0 : o.x) || "100%"
283
+ x: ((a = o.scroll) == null ? void 0 : a.x) || "100%"
284
284
  };
285
- if (a.scroll)
286
- return a.scroll;
285
+ if (o.scroll)
286
+ return o.scroll;
287
287
  }), ye = s(() => {
288
288
  var e;
289
- if (a.tableLayout)
290
- return a.tableLayout;
291
- if ((e = a.columns) != null && e.some((r) => r.ellipsis))
289
+ if (o.tableLayout)
290
+ return o.tableLayout;
291
+ if ((e = o.columns) != null && e.some((r) => r.ellipsis))
292
292
  return "fixed";
293
293
  }), j = s(() => {
294
- var o;
295
- const e = t(D), r = t(R);
294
+ var a;
295
+ const e = t(D), r = t(C);
296
296
  return {
297
- ...a,
297
+ ...o,
298
298
  ...e,
299
- rowSelection: a.rowSelection === !0 || ((o = a.rowSelection) == null ? void 0 : o.mode) === "internal" ? {
299
+ rowSelection: o.rowSelection === !0 || ((a = o.rowSelection) == null ? void 0 : a.mode) === "internal" ? {
300
300
  ...r,
301
301
  // tips 如果是前端分页,则默认会走缓存
302
- preserveSelectedRowKeys: m(a.dataSource) ? r.preserveSelectedRowKeys : !0
303
- } : Ue(a.rowSelection),
304
- loading: m(a.loading) ? e.loading : a.loading,
305
- pagination: a.pagination === !1 ? !1 : e.pagination,
302
+ preserveSelectedRowKeys: m(o.dataSource) ? r.preserveSelectedRowKeys : !0
303
+ } : Ue(o.rowSelection),
304
+ loading: m(o.loading) ? e.loading : o.loading,
305
+ pagination: o.pagination === !1 ? !1 : e.pagination,
306
306
  scroll: t(me)
307
307
  };
308
- }), ge = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
309
- function we(e, r, o) {
310
- return Y.includes(e.valueType) ? o : e.copyable || e.ellipsis ? w(Xe, {
308
+ }), ge = s(() => [i(), o.card ? null : i("wrapper"), o.adaptive ? i("adaptive") : null].filter(Boolean));
309
+ function we(e, r, a) {
310
+ return Y.includes(e.valueType) ? a : e.copyable || e.ellipsis ? w(Xe, {
311
311
  copyable: e.copyable,
312
312
  ellipsis: e.ellipsis ? Oe(e.ellipsis) ? {
313
- tooltip: o,
313
+ tooltip: a,
314
314
  rows: 1
315
315
  } : {
316
316
  ...e.ellipsis,
317
- tooltip: o
317
+ tooltip: a
318
318
  } : !1,
319
- content: o
320
- }, null) : o;
319
+ content: a
320
+ }, null) : a;
321
321
  }
322
322
  G(() => t(y).loading, (e) => {
323
323
  var r;
324
- (r = a.onLoadingChange) == null || r.call(a, e);
325
- }), G(() => a.dataSource, (e) => {
324
+ (r = o.onLoadingChange) == null || r.call(o, e);
325
+ }), G(() => o.dataSource, (e) => {
326
326
  ce(e);
327
327
  }, {
328
328
  immediate: !0
329
329
  });
330
330
  function Se(e) {
331
- var r, o, l;
332
- (l = (o = (r = k.value) == null ? void 0 : r.apForm) == null ? void 0 : o.setFieldsValue) == null || l.call(o, e);
331
+ var r, a, l;
332
+ (l = (a = (r = k.value) == null ? void 0 : r.apForm) == null ? void 0 : a.setFieldsValue) == null || l.call(a, e);
333
333
  }
334
334
  function be(e = !1) {
335
- var o, l, d;
335
+ var a, l, d;
336
336
  const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
337
- return (d = (l = (o = k.value) == null ? void 0 : o.apForm) == null ? void 0 : l[r]) == null ? void 0 : d.call(l, !0);
337
+ return (d = (l = (a = k.value) == null ? void 0 : a.apForm) == null ? void 0 : l[r]) == null ? void 0 : d.call(l, !0);
338
338
  }
339
339
  function he() {
340
340
  return t(u);
@@ -348,7 +348,7 @@ const Sa = /* @__PURE__ */ Te({
348
348
  getShownColumns: he,
349
349
  dataSource: s(() => t(y).records),
350
350
  rowSelection: {
351
- selectedRows: s(() => t(C)),
351
+ selectedRows: s(() => t(R)),
352
352
  ...v
353
353
  }
354
354
  }), (e, r) => (p(), T("div", {
@@ -365,32 +365,34 @@ const Sa = /* @__PURE__ */ Te({
365
365
  onSubmit: t(V),
366
366
  onReset: t(A)
367
367
  }), _({
368
- default: F(() => [(p(!0), T(q, null, J(L.value, (o) => (p(), Q(Be(o.renderNode), S({
369
- key: o.dataIndex,
368
+ default: F(() => [(p(!0), T(q, null, J(L.value, (a) => (p(), Q(Be(a.renderNode.Comp), S({
369
+ key: a.dataIndex,
370
+ item: a,
370
371
  ref_for: !0
371
- }, o.fieldProps || {}, {
372
- span: o.span
373
- }), null, 16, ["span"]))), 128))]),
372
+ }, a.fieldProps || {}, {
373
+ span: a.span,
374
+ "custom-render": a.renderNode.render
375
+ }), null, 16, ["item", "span", "custom-render"]))), 128))]),
374
376
  _: 2
375
377
  }, [h.searchFormExtra ? {
376
378
  name: "extra",
377
379
  fn: F(() => [b(e.$slots, "searchFormExtra")]),
378
380
  key: "0"
379
- } : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : X("", !0), I("div", {
381
+ } : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : X("", !0), N("div", {
380
382
  ref_key: "contentRef",
381
383
  ref: ne,
382
384
  class: f([t(x)("table-wrapper"), e.card ? t(x)("table-wrapper-card") : null]),
383
385
  style: M(e.tableWrapperStyle)
384
- }, [I("div", {
386
+ }, [N("div", {
385
387
  class: f(t(i)("header-wrapper"))
386
388
  }, [e.settings ? (p(), T("div", {
387
389
  key: 0,
388
390
  class: f(t(i)("header"))
389
- }, [I("div", {
391
+ }, [N("div", {
390
392
  class: f(t(E)("header", "title"))
391
393
  }, [b(e.$slots, "title", S({
392
- selectedRows: t(C),
393
- selectedRowKeys: t(R).selectedRowKeys,
394
+ selectedRows: t(R),
395
+ selectedRowKeys: t(C).selectedRowKeys,
394
396
  shownColumns: u.value
395
397
  }, v))], 2), h.title ? (p(), Q(t(Pe), {
396
398
  key: 0,
@@ -399,29 +401,29 @@ const Sa = /* @__PURE__ */ Te({
399
401
  config: e.settings === !0 ? {} : e.settings
400
402
  }, null, 8, ["config"])], 2)) : b(e.$slots, "title", S({
401
403
  key: 1,
402
- selectedRows: t(C),
403
- selectedRowKeys: t(R).selectedRowKeys,
404
+ selectedRows: t(R),
405
+ selectedRowKeys: t(C).selectedRowKeys,
404
406
  shownColumns: u.value
405
- }, v))], 2), w(t(Ie), S({
407
+ }, v))], 2), w(t(Ne), S({
406
408
  class: t(i)("table")
407
409
  }, j.value, {
408
410
  size: B.value,
409
411
  "table-layout": ye.value,
410
412
  columns: u.value,
411
- onResizeColumn: r[0] || (r[0] = (o, l) => l.width = o)
413
+ onResizeColumn: r[0] || (r[0] = (a, l) => l.width = a)
412
414
  }), _({
413
415
  summary: F(() => [b(e.$slots, "summary", {
414
416
  columns: u.value,
415
417
  records: j.value.dataSource,
416
- selectedRows: t(C)
418
+ selectedRows: t(R)
417
419
  })]),
418
420
  _: 2
419
- }, [J(t(Z)(h, ["title", "searchFormExtra", "headerCell", "summary"]), (o, l) => ({
421
+ }, [J(t(Z)(h, ["title", "searchFormExtra", "headerCell", "summary"]), (a, l) => ({
420
422
  name: l,
421
423
  fn: F((d) => [b(e.$slots, l, ke(ze(d || {})))])
422
424
  }))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 2));
423
425
  }
424
426
  });
425
427
  export {
426
- Sa as default
428
+ bo as default
427
429
  };
@@ -0,0 +1,2 @@
1
+ declare function areVNodesEqual(prevNode: any, currNode: any): boolean;
2
+ export { areVNodesEqual };
@@ -0,0 +1,4 @@
1
+ import { ApTableDynamicCompProps } from '../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare const _default: DefineComponent<ApTableDynamicCompProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApTableDynamicCompProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,14 @@
1
+ import { defineComponent as n, openBlock as o, createBlock as t, resolveDynamicComponent as r } from "vue";
2
+ const c = /* @__PURE__ */ n({
3
+ name: "ApTableDynamicComponent",
4
+ __name: "index",
5
+ props: {
6
+ customRender: { type: Function }
7
+ },
8
+ setup(p) {
9
+ return (e, m) => (o(), t(r(e.customRender(e.$attrs))));
10
+ }
11
+ });
12
+ export {
13
+ c as default
14
+ };
@@ -61,3 +61,6 @@ export type SortableItemMetaProps = {
61
61
  level?: 1 | 2;
62
62
  open?: boolean;
63
63
  };
64
+ export interface ApTableDynamicCompProps {
65
+ customRender: (params: any) => any;
66
+ }