@aplus-frontend/ui 0.5.21 → 0.5.23

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.
@@ -97,6 +97,12 @@ export type ApFieldSwitchProps = BasicApFieldProps<Omit<SwitchProps, 'onClick'>>
97
97
  };
98
98
  export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosize'>> & {
99
99
  emptyText?: string;
100
+ /**
101
+ * 输入生效前的事件,受控输入拦截
102
+ * @param nextVal
103
+ * @returns
104
+ */
105
+ beforeInput?: (nextVal: string) => string;
100
106
  };
101
107
  export type ApFieldTextAreaExpose = {
102
108
  focus: (options?: InputFocusOptions) => void;
@@ -122,18 +122,18 @@ const G = /* @__PURE__ */ I({
122
122
  const x = y, o = a, {
123
123
  value: i,
124
124
  updateValue: v
125
- } = F(o, x), B = z("Text", o);
126
- function b(e) {
125
+ } = F(o, x), b = z("Text", o);
126
+ function B(e) {
127
127
  var c, d, f;
128
128
  const n = e.target.value || "", r = o.beforeInput ? (c = o.beforeInput) == null ? void 0 : c.call(o, n) : n, l = (f = (d = u.value) == null ? void 0 : d.$el) == null ? void 0 : f.querySelector("input");
129
129
  l && (l.value = r), v(r);
130
130
  }
131
131
  function h() {
132
132
  var e, n;
133
- return o.mode === "edit" ? s(j, R(U(o, ["mode", "emptyText", "value", "onUpdate:value"]), {
134
- placeholder: p(B),
133
+ return o.mode === "edit" ? s(j, R(U(o, ["mode", "emptyText", "value", "onUpdate:value", "beforeInput"]), {
134
+ placeholder: p(b),
135
135
  value: p(i),
136
- onInput: b,
136
+ onInput: B,
137
137
  ref: u
138
138
  }), M(t) ? t : {
139
139
  default: () => [t]
@@ -1,12 +1,12 @@
1
- import { defineComponent as f, ref as y, computed as v, createElementBlock as x, createBlock as B, openBlock as r, normalizeClass as h, unref as o, toDisplayString as b, mergeProps as C } from "vue";
2
- import { isNil as z, omit as A } from "lodash-unified";
1
+ import { defineComponent as h, ref as I, computed as A, createElementBlock as C, createBlock as g, openBlock as d, normalizeClass as z, unref as t, toDisplayString as T, mergeProps as k } from "vue";
2
+ import { isNil as w, omit as R } from "lodash-unified";
3
3
  import "../../hooks/index.mjs";
4
4
  import "../../config-provider/index.mjs";
5
- import { Input as g } from "@aplus-frontend/antdv";
6
- import { useDefaultPlaceholder as T } from "../hooks/use-default-placeholder.mjs";
7
- import { useControllableValue as k } from "../../hooks/useControllableValue.mjs";
8
- import { useNamespace as w } from "../../config-provider/hooks/use-namespace.mjs";
9
- const S = /* @__PURE__ */ f({
5
+ import { Input as _ } from "@aplus-frontend/antdv";
6
+ import { useDefaultPlaceholder as S } from "../hooks/use-default-placeholder.mjs";
7
+ import { useControllableValue as U } from "../../hooks/useControllableValue.mjs";
8
+ import { useNamespace as V } from "../../config-provider/hooks/use-namespace.mjs";
9
+ const O = /* @__PURE__ */ h({
10
10
  name: "ApFieldTextArea",
11
11
  __name: "index",
12
12
  props: {
@@ -56,36 +56,42 @@ const S = /* @__PURE__ */ f({
56
56
  handleReset: {},
57
57
  clearIcon: {},
58
58
  allowClear: { type: Boolean, default: !0 },
59
- emptyText: { default: "--" }
59
+ emptyText: { default: "--" },
60
+ beforeInput: {}
60
61
  },
61
62
  emits: ["update:value"],
62
- setup(u, { expose: p, emit: s }) {
63
- const t = y(), l = u, d = s, { value: a, updateValue: i } = k(l, d), { b: m } = w("field-text-area"), c = T("TextArea", l);
64
- return p({
63
+ setup(c, { expose: f, emit: m }) {
64
+ const l = I(), o = c, y = m, { value: n, updateValue: x } = U(o, y), { b: v } = V("field-text-area"), B = S("TextArea", o);
65
+ function b(e) {
66
+ var p, s, i;
67
+ const a = e.target.value || "", r = o.beforeInput ? (p = o.beforeInput) == null ? void 0 : p.call(o, a) : a, u = (i = (s = l.value) == null ? void 0 : s.$el) == null ? void 0 : i.querySelector("textarea");
68
+ u && (u.value = r), x(r);
69
+ }
70
+ return f({
65
71
  focus: (e) => {
66
- var n;
67
- (n = t.value) == null || n.focus(e);
72
+ var a;
73
+ (a = l.value) == null || a.focus(e);
68
74
  },
69
75
  blur: () => {
70
76
  var e;
71
- (e = t.value) == null || e.blur();
77
+ (e = l.value) == null || e.blur();
72
78
  },
73
- resizableTextArea: v(() => {
79
+ resizableTextArea: A(() => {
74
80
  var e;
75
- return (e = t.value) == null ? void 0 : e.resizableTextArea;
81
+ return (e = l.value) == null ? void 0 : e.resizableTextArea;
76
82
  })
77
- }), (e, n) => e.mode === "read" ? (r(), x("span", {
83
+ }), (e, a) => e.mode === "read" ? (d(), C("span", {
78
84
  key: 0,
79
- class: h(o(m)())
80
- }, b(o(z)(o(a)) || o(a) === "" ? e.emptyText : o(a)), 3)) : (r(), B(o(g).TextArea, C({ key: 1 }, o(A)(l, ["onUpdate:value", "value"]), {
85
+ class: z(t(v)())
86
+ }, T(t(w)(t(n)) || t(n) === "" ? e.emptyText : t(n)), 3)) : (d(), g(t(_).TextArea, k({ key: 1 }, t(R)(o, ["onUpdate:value", "value", "beforeInput"]), {
81
87
  ref_key: "textAreaRef",
82
- ref: t,
83
- placeholder: o(c),
84
- value: o(a),
85
- "onUpdate:value": o(i)
86
- }), null, 16, ["placeholder", "value", "onUpdate:value"]));
88
+ ref: l,
89
+ placeholder: t(B),
90
+ value: t(n),
91
+ onInput: b
92
+ }), null, 16, ["placeholder", "value"]));
87
93
  }
88
94
  });
89
95
  export {
90
- S as default
96
+ O as default
91
97
  };
@@ -705,8 +705,7 @@ declare function __VLS_template(): {
705
705
  }>, {
706
706
  blur: () => void;
707
707
  focus: () => void;
708
- request: (currentNode
709
- /** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
708
+ request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
710
709
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
711
710
  "update:value": (...args: any[]) => void;
712
711
  }, string, {
@@ -774,8 +773,7 @@ declare function __VLS_template(): {
774
773
  }>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
775
774
  blur: () => void;
776
775
  focus: () => void;
777
- request: (currentNode
778
- /** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
776
+ request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
779
777
  }> & {} & ComponentCustomProperties & {} & {
780
778
  $slots: Readonly<{
781
779
  title?: any;
@@ -1481,8 +1479,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
1481
1479
  }>, {
1482
1480
  blur: () => void;
1483
1481
  focus: () => void;
1484
- request: (currentNode
1485
- /** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
1482
+ request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
1486
1483
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1487
1484
  "update:value": (...args: any[]) => void;
1488
1485
  }, string, {
@@ -1550,8 +1547,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
1550
1547
  }>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
1551
1548
  blur: () => void;
1552
1549
  focus: () => void;
1553
- request: (currentNode
1554
- /** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
1550
+ request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
1555
1551
  }> & {} & ComponentCustomProperties & {} & {
1556
1552
  $slots: Readonly<{
1557
1553
  title?: any;
@@ -6,7 +6,7 @@ import { DataIndex } from '@aplus-frontend/antdv/es/vc-table/interface';
6
6
  import { EditableTableExpose } from '../../editable-table';
7
7
  import { NamePath } from '@aplus-frontend/antdv/es/form/interface';
8
8
  import { ApFormItemProps } from '../../ap-form';
9
- export type EditableGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ApGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>, 'children' | 'customRender' | 'hideInSearch' | 'hideInTable' | 'tooltip' | 'customRenderFormItem' | 'fieldProps'> & {
9
+ export type EditableGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ApGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>, 'children' | 'customRender' | 'hideInSearch' | 'tooltip' | 'customRenderFormItem' | 'fieldProps'> & {
10
10
  children?: EditableGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
11
11
  /**
12
12
  * 在title之后展示一个icon并触发tooltip
@@ -81,6 +81,7 @@ export declare const useTablePaging: <DataType = any, ParamsType = Record<string
81
81
  showQuickJumper: boolean;
82
82
  showLessItems: boolean | undefined;
83
83
  size: "default" | "small";
84
+ pageSizeOptions: (string | number)[];
84
85
  showTotal: ((total: number) => import("vue/jsx-runtime").JSX.Element) | undefined;
85
86
  };
86
87
  onChange: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<any> | SorterResult<any>[], extra: TableCurrentDataSource<any>) => void;
@@ -1,138 +1,138 @@
1
- import { ref as ne, reactive as J, unref as S, nextTick as ae, onMounted as se, watch as ie, computed as D, createVNode as b } from "vue";
1
+ import { ref as ne, reactive as j, unref as h, nextTick as ae, onMounted as se, watch as ie, computed as A, createVNode as x } from "vue";
2
2
  import { useTableSortedAndFiltered as ce } from "./use-sorted-filtered.mjs";
3
3
  import "../../config-provider/index.mjs";
4
4
  import { parseFieldValue as le, dataIndexToStr as ue, isEqualCustom as fe } from "../utils.mjs";
5
- import { isArray as N, isEqualWith as ge } from "lodash-unified";
6
- import { isDef as Q } from "../../utils/index.mjs";
7
- import { useLocale as pe } from "../../config-provider/hooks/use-locale.mjs";
8
- import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
9
- const z = 1, L = 10;
10
- function me(g) {
11
- const l = {};
12
- return g && (g === !0 ? (l.current = z, l.pageSize = L) : (l.current = g.defaultCurrent || z, l.pageSize = g.defaultPageSize || L)), l;
5
+ import { isArray as q, isEqualWith as ge, isUndefined as pe } from "lodash-unified";
6
+ import { isDef as N } from "../../utils/index.mjs";
7
+ import { useLocale as de } from "../../config-provider/hooks/use-locale.mjs";
8
+ import { useNamespace as me } from "../../config-provider/hooks/use-namespace.mjs";
9
+ const S = 1, D = 10;
10
+ function he(g) {
11
+ const u = {};
12
+ return g && (g === !0 ? (u.current = S, u.pageSize = D) : (u.current = g.defaultCurrent || S, u.pageSize = g.defaultPageSize || D)), u;
13
13
  }
14
- const xe = ({
14
+ const be = ({
15
15
  manual: g = !1,
16
- request: l,
17
- defaultParams: v = {},
18
- defaultData: y = [],
19
- formatParams: R,
20
- paramsValueTypeMap: I,
21
- resetFieldsIgnores: V,
22
- filterFields: U,
23
- sortFields: B,
16
+ request: u,
17
+ defaultParams: L = {},
18
+ defaultData: v = [],
19
+ formatParams: y,
20
+ paramsValueTypeMap: O,
21
+ resetFieldsIgnores: R,
22
+ filterFields: B,
23
+ sortFields: J,
24
24
  namespace: K = "ap-table",
25
25
  pagination: p = {
26
- defaultCurrent: z,
27
- defaultPageSize: L,
26
+ defaultCurrent: S,
27
+ defaultPageSize: D,
28
28
  showLessItems: !1,
29
29
  showTotal: !0
30
30
  }
31
31
  }) => {
32
- let E = 0, s = {};
33
- const d = p ?? {}, M = (e) => R ? R(e) : e, T = ne(), i = J(me(p)), {
32
+ let b = 0, s = {};
33
+ const M = p ?? {}, Q = (e) => y ? y(e) : e, z = ne(), i = j(he(p)), {
34
34
  getColumnSFConfig: $,
35
35
  setSF: G,
36
36
  clearAll: W,
37
37
  sortedInfo: Z,
38
38
  filteredInfo: H
39
39
  } = ce(), {
40
- t: w
41
- } = pe(), {
40
+ t: T
41
+ } = de(), {
42
42
  b: P
43
- } = de(K), o = J({
44
- total: y.length,
45
- records: y,
43
+ } = me(K), a = j({
44
+ total: v.length,
45
+ records: v,
46
46
  loading: !1
47
- }), C = () => {
47
+ }), w = () => {
48
48
  var e, t;
49
- return ((t = (e = T.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
50
- }, O = async (e) => {
51
- var n;
52
- const t = M(e), r = Date.now();
53
- E = r, o.loading = !0;
49
+ return ((t = (e = z.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
50
+ }, I = async (e) => {
51
+ var o;
52
+ const t = Q(e), r = Date.now();
53
+ b = r, a.loading = !0;
54
54
  try {
55
- const a = await l({
56
- ...S(v),
55
+ const n = await u({
56
+ ...h(L),
57
57
  ...t
58
58
  });
59
- E === r && (o.total = a.total || ((n = a.data) == null ? void 0 : n.length) || 0, o.records = [...a.data || []]);
59
+ b === r && (a.total = n.total || ((o = n.data) == null ? void 0 : o.length) || 0, a.records = [...n.data || []]);
60
60
  } catch {
61
- E === r && (o.records = [], o.total = 0);
61
+ b === r && (a.records = [], a.total = 0);
62
62
  } finally {
63
- o.loading = !1;
63
+ a.loading = !1;
64
64
  }
65
- }, _ = (e) => {
65
+ }, V = (e) => {
66
66
  const t = {};
67
- return Object.entries(e).forEach(([r, n]) => {
68
- if (t[r] = n, I && n) {
69
- const a = I[r];
70
- a && (t[r] = le(a, n));
67
+ return Object.entries(e).forEach(([r, o]) => {
68
+ if (t[r] = o, O && o) {
69
+ const n = O[r];
70
+ n && (t[r] = le(n, o));
71
71
  }
72
72
  }), t;
73
73
  }, X = async (e) => {
74
- var n, a, u, f, m;
75
- const t = C(), r = {};
76
- Object.entries(t).forEach(([h, x]) => {
77
- V && V.indexOf(h) > -1 && (r[h] = x);
78
- }), await ((a = (n = T.value) == null ? void 0 : n.apForm) == null ? void 0 : a.resetFields()), (m = (f = (u = T.value) == null ? void 0 : u.apForm) == null ? void 0 : f.setFieldsValue) == null || m.call(f, r), ae(() => {
74
+ var o, n, l, f, d;
75
+ const t = w(), r = {};
76
+ Object.entries(t).forEach(([m, C]) => {
77
+ R && R.indexOf(m) > -1 && (r[m] = C);
78
+ }), await ((n = (o = z.value) == null ? void 0 : o.apForm) == null ? void 0 : n.resetFields()), (d = (f = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : f.setFieldsValue) == null || d.call(f, r), ae(() => {
79
79
  e == null || e();
80
80
  });
81
81
  }, F = (e) => {
82
82
  s = e;
83
- const t = _(e);
84
- O(t);
83
+ const t = V(e);
84
+ I(t);
85
85
  }, Y = (e) => {
86
86
  F({
87
87
  ...s,
88
88
  ...e
89
89
  });
90
- }, A = () => {
91
- const e = C();
92
- p && (i.current = z), F({
90
+ }, E = () => {
91
+ const e = w();
92
+ p && (i.current = S), F({
93
93
  ...e,
94
94
  filter: s.filter,
95
95
  sort: s.sort,
96
- current: p ? z : void 0,
96
+ current: p ? S : void 0,
97
97
  pageSize: p ? s.pageSize || i.pageSize : void 0
98
98
  });
99
99
  }, k = () => {
100
- W(), s.sort = {}, s.filter = {}, X(A);
101
- }, j = () => {
100
+ W(), s.sort = {}, s.filter = {}, X(E);
101
+ }, U = () => {
102
102
  F(s);
103
103
  }, ee = (e) => {
104
104
  if (!p)
105
- j();
105
+ U();
106
106
  else {
107
107
  const {
108
108
  current: t,
109
109
  pageSize: r
110
- } = i, n = o.total - e, a = Math.ceil(n / r), u = t > a ? a : t;
110
+ } = i, o = a.total - e, n = Math.ceil(o / r), l = t > n ? n : t;
111
111
  Y({
112
- current: u > 0 ? u : 1
112
+ current: l > 0 ? l : 1
113
113
  });
114
114
  }
115
- }, q = (e, t, r) => {
116
- var h, x;
117
- const n = C();
115
+ }, _ = (e, t, r) => {
116
+ var m, C;
117
+ const o = w();
118
118
  i.current = e.current, i.pageSize = e.pageSize, G(t, r);
119
- const a = N(r) ? [...r] : [r], u = {};
120
- for (const c of a)
121
- (h = S(B)) != null && h.includes(c.columnKey || c.field) && c.order && (u[ue(c.columnKey || c.field)] = c.order);
119
+ const n = q(r) ? [...r] : [r], l = {};
120
+ for (const c of n)
121
+ (m = h(J)) != null && m.includes(c.columnKey || c.field) && c.order && (l[ue(c.columnKey || c.field)] = c.order);
122
122
  const f = {};
123
123
  for (const c of Object.keys(t))
124
- (x = S(U)) != null && x.includes(c) && t[c] && (f[c] = t[c]);
125
- const m = {
126
- ...n,
124
+ (C = h(B)) != null && C.includes(c) && t[c] && (f[c] = t[c]);
125
+ const d = {
126
+ ...o,
127
127
  filter: f,
128
- sort: u,
128
+ sort: l,
129
129
  current: e.current,
130
130
  pageSize: e.pageSize
131
131
  };
132
- ge(s, m, fe) || F(m);
132
+ ge(s, d, fe) || F(d);
133
133
  };
134
134
  se(() => {
135
- const e = C(), {
135
+ const e = w(), {
136
136
  current: t,
137
137
  pageSize: r
138
138
  } = i;
@@ -143,67 +143,71 @@ const xe = ({
143
143
  sort: {},
144
144
  ...e
145
145
  }, !g) {
146
- const n = _(s);
147
- O(n);
146
+ const o = V(s);
147
+ I(o);
148
148
  }
149
- }), ie(() => S(v), () => {
150
- A();
149
+ }), ie(() => h(L), () => {
150
+ E();
151
151
  }, {
152
152
  deep: !0
153
153
  });
154
- const te = D(() => {
155
- if (o.total === 0)
154
+ const te = A(() => {
155
+ if (a.total === 0)
156
156
  return "-";
157
157
  const {
158
158
  current: e,
159
159
  pageSize: t
160
160
  } = i;
161
- return `${e}/${Math.ceil(o.total / t)}`;
161
+ return `${e}/${Math.ceil(a.total / t)}`;
162
162
  });
163
163
  function re(e) {
164
- N(e) && (o.records = e, o.total = e.length);
164
+ q(e) && (a.records = e, a.total = e.length);
165
165
  }
166
- const oe = D(() => {
166
+ const oe = A(() => {
167
167
  const {
168
168
  showLessItems: e,
169
- showTotal: t
170
- } = d;
169
+ showTotal: t,
170
+ showQuickJumper: r,
171
+ showSizeChanger: o,
172
+ pageSizeOptions: n
173
+ } = M;
171
174
  return {
172
- loading: o.loading,
175
+ loading: a.loading,
173
176
  pagination: {
174
177
  current: i.current,
175
178
  pageSize: i.pageSize,
176
- total: o.total,
177
- showSizeChanger: Q(d.showSizeChanger) ? d.showSizeChanger : !e,
178
- showQuickJumper: Q(d.showQuickJumper) ? d.showQuickJumper : !e,
179
+ total: a.total,
180
+ showSizeChanger: N(o) ? o : !e,
181
+ showQuickJumper: N(r) ? r : !e,
179
182
  showLessItems: e,
180
183
  size: "default",
181
- showTotal: t ? (r) => b("span", {
184
+ pageSizeOptions: pe(n) ? ["10", "20", "50", "100"] : n,
185
+ showTotal: t ? (l) => x("span", {
182
186
  class: P("pagination-total-wrapper")
183
- }, [w("ap.apTable.pagination.totalLeftPrefix"), " ", b("span", {
187
+ }, [T("ap.apTable.pagination.totalLeftPrefix"), " ", x("span", {
184
188
  class: P("pagination-count-text")
185
- }, [r]), " ", w("ap.apTable.pagination.totalLeftSuffix"), b("span", {
189
+ }, [l]), " ", T("ap.apTable.pagination.totalLeftSuffix"), x("span", {
186
190
  class: P("pagination--total-right")
187
- }, [w("ap.apTable.pagination.totalRightPrefix"), " ", b("span", {
191
+ }, [T("ap.apTable.pagination.totalRightPrefix"), " ", x("span", {
188
192
  class: P("pagination-count-text")
189
- }, [S(te)]), " ", w("ap.apTable.pagination.totalRightSuffix")])]) : void 0
193
+ }, [h(te)]), " ", T("ap.apTable.pagination.totalRightSuffix")])]) : void 0
190
194
  },
191
- onChange: q,
192
- dataSource: o.records
195
+ onChange: _,
196
+ dataSource: a.records
193
197
  };
194
198
  });
195
199
  return {
196
- formRef: T,
197
- submit: A,
200
+ formRef: z,
201
+ submit: E,
198
202
  reset: k,
199
- refresh: j,
203
+ refresh: U,
200
204
  refreshByDelete: ee,
201
- data: o,
205
+ data: a,
202
206
  current: i.current,
203
207
  pageSize: i.pageSize,
204
- handleTableChange: q,
208
+ handleTableChange: _,
205
209
  tableProps: oe,
206
- dataSource: D(() => o.records),
210
+ dataSource: A(() => a.records),
207
211
  setDataSource: re,
208
212
  getColumnSFConfig: $,
209
213
  sortedInfo: Z,
@@ -211,7 +215,7 @@ const xe = ({
211
215
  };
212
216
  };
213
217
  export {
214
- z as DEFAULT_CURRENT,
215
- L as DEFAULT_PAGE_SIZE,
216
- xe as useTablePaging
218
+ S as DEFAULT_CURRENT,
219
+ D as DEFAULT_PAGE_SIZE,
220
+ be as useTablePaging
217
221
  };
@@ -8,6 +8,7 @@ import { ApActionGroupProps } from '../ap-action';
8
8
  import { ApTableIndexProps } from './components/interface';
9
9
  import { EllipsisConfig } from '@aplus-frontend/antdv/es/typography/Base';
10
10
  import { RowSelectionReturnType } from './hooks/use-table-row-selection';
11
+ import { PaginationProps } from '@aplus-frontend/antdv';
11
12
  export type ValueEnumType = {
12
13
  text: string;
13
14
  /**
@@ -238,6 +239,8 @@ export type ApTablePaginationConfig = {
238
239
  * 是否显示快速跳转
239
240
  */
240
241
  showQuickJumper?: boolean;
242
+ } & {
243
+ pageSizeOptions?: PaginationProps['pageSizeOptions'];
241
244
  };
242
245
  export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection'> & {
243
246
  /**
@@ -1,4 +1,4 @@
1
- import { defineComponent as P, isVNode as C, h as g, ref as x, createBlock as h, openBlock as r, unref as i, normalizeProps as A, guardReactiveProps as B, createSlots as w, withCtx as v, createElementVNode as d, normalizeClass as s, createElementBlock as n, Fragment as f, renderList as j, createCommentVNode as p, normalizeStyle as u, createTextVNode as O, toDisplayString as a, withModifiers as z, renderSlot as M, createVNode as R } from "vue";
1
+ import { defineComponent as P, isVNode as g, h as C, ref as x, createBlock as h, openBlock as r, unref as n, normalizeProps as A, guardReactiveProps as B, createSlots as w, withCtx as v, createElementVNode as d, normalizeClass as s, createElementBlock as i, Fragment as f, renderList as j, createCommentVNode as p, normalizeStyle as u, createTextVNode as O, toDisplayString as a, withModifiers as z, renderSlot as M, createVNode as R } from "vue";
2
2
  import { Tooltip as Y } from "@aplus-frontend/antdv";
3
3
  import "../../../config-provider/index.mjs";
4
4
  import { locales as E } from "../interface.mjs";
@@ -49,12 +49,12 @@ const T = { key: 0 }, D = ["href", "onClick"], U = ["onClick"], b = { key: 0 },
49
49
  }
50
50
  },
51
51
  emits: ["update:valueRefs", "handleClick"],
52
- setup(l, { emit: N }) {
53
- const $ = N, { e: c } = G("ap-ladder"), m = (e) => C(e) || typeof e == "function", S = (e) => {
52
+ setup(c, { emit: N }) {
53
+ const $ = N, { e: l } = G("ap-ladder"), m = (e) => g(e) || typeof e == "function", S = (e) => {
54
54
  const { value: o, style: t } = e;
55
- return C(o) ? g(o, {
55
+ return g(o) ? C(o, {
56
56
  style: t
57
- }) : typeof o == "function" ? g(o(), {
57
+ }) : typeof o == "function" ? C(o(), {
58
58
  ref: x,
59
59
  style: {
60
60
  ...t
@@ -94,62 +94,65 @@ const T = { key: 0 }, D = ["href", "onClick"], U = ["onClick"], b = { key: 0 },
94
94
  }, F = (e) => {
95
95
  $("handleClick", e);
96
96
  };
97
- return (e, o) => (r(), h(i(Y), A(B(l.tooltipProps)), w({
97
+ return (e, o) => (r(), h(n(Y), A(B(c.tooltipProps)), w({
98
98
  default: v(() => [
99
99
  d("div", {
100
- class: s(i(c)("value-group"))
100
+ class: s(n(l)("value-group"))
101
101
  }, [
102
- (r(!0), n(f, null, j(l.labelValues, (t, y) => (r(), n("div", {
102
+ (r(!0), i(f, null, j(c.labelValues, (t, y) => (r(), i("div", {
103
103
  key: y,
104
- class: s(i(c)("value-group-item"))
104
+ class: s([
105
+ n(l)("value-group-item"),
106
+ t.label === "" && n(l)("value-group-value-end")
107
+ ])
105
108
  }, [
106
- t.label ? (r(), n("div", {
109
+ t.label ? (r(), i("div", {
107
110
  key: 0,
108
111
  class: s([
109
- i(c)("value-group-label"),
110
- l.labelAlign && `label-align-${l.labelAlign}`
112
+ n(l)("value-group-label"),
113
+ c.labelAlign && n(l)(`label-align-${c.labelAlign}`)
111
114
  ]),
112
115
  style: u(t.labelStyles)
113
116
  }, [
114
117
  O(a(t.label), 1),
115
- t.label ? (r(), n("span", T, ":")) : p("", !0)
118
+ t.label ? (r(), i("span", T, ":")) : p("", !0)
116
119
  ], 6)) : p("", !0),
117
120
  d("div", {
118
- class: s(i(c)("value-group-value"))
121
+ class: s(n(l)("value-group-value"))
119
122
  }, [
120
123
  m(t.value) ? (r(), h(S, {
121
124
  key: 0,
122
125
  value: t.value,
123
126
  style: u([t.labelColor, t.valueStyles])
124
- }, null, 8, ["value", "style"])) : (r(), n(f, { key: 1 }, [
125
- t.link ? (r(), n("a", {
127
+ }, null, 8, ["value", "style"])) : (r(), i(f, { key: 1 }, [
128
+ t.link ? (r(), i("a", {
126
129
  key: 0,
127
130
  href: t.link,
128
131
  target: "_blank",
129
- class: s(i(c)("value-group-link")),
132
+ class: s(n(l)("value-group-link")),
130
133
  style: u([
131
- l.linkStyles,
134
+ c.linkStyles,
132
135
  t.linkStyles,
133
136
  t.linkColor ? { color: t.linkColor } : void 0
134
137
  ]),
135
138
  onClick: z((L) => F(t), ["prevent"])
136
- }, a(k(t.value, { ...t })), 15, D)) : (r(), n(f, { key: 1 }, [
139
+ }, a(k(t.value, { ...t })), 15, D)) : (r(), i(f, { key: 1 }, [
137
140
  d("span", {
138
141
  style: u([
139
- l.valueStyles,
142
+ c.valueStyles,
140
143
  t.valueStyles,
141
144
  t.valueColor ? { color: t.valueColor } : void 0
142
145
  ]),
143
146
  class: s(
144
- t.handleValueClick ? i(c)("value-group-link") : void 0
147
+ t.handleValueClick ? n(l)("value-group-link") : void 0
145
148
  ),
146
- onClick: (L) => t.handleValueClick && t.handleValueClick(l.labelValues)
149
+ onClick: (L) => t.handleValueClick && t.handleValueClick(c.labelValues)
147
150
  }, a(k(t.value, { ...t })), 15, U),
148
- t.unit ? (r(), n("span", {
151
+ t.unit ? (r(), i("span", {
149
152
  key: 0,
150
- class: s(i(c)("value-group-unit")),
153
+ class: s(n(l)("value-group-unit")),
151
154
  style: u([
152
- l.unitStyles,
155
+ c.unitStyles,
153
156
  t.unitStyles,
154
157
  t.unitColor ? { color: t.unitColor } : void 0
155
158
  ])
@@ -168,37 +171,37 @@ const T = { key: 0 }, D = ["href", "onClick"], U = ["onClick"], b = { key: 0 },
168
171
  M(e.$slots, "title")
169
172
  ]),
170
173
  key: "0"
171
- } : l.tooltip ? {
174
+ } : c.tooltip ? {
172
175
  name: "title",
173
176
  fn: v(() => [
174
177
  d("div", {
175
- class: s(i(c)("tooltip"))
178
+ class: s(n(l)("tooltip"))
176
179
  }, [
177
- (r(!0), n(f, null, j(l.labelValues, (t, y) => (r(), n("div", {
180
+ (r(!0), i(f, null, j(c.labelValues, (t, y) => (r(), i("div", {
178
181
  key: y,
179
- class: s(i(c)("tooltip-item"))
182
+ class: s(n(l)("tooltip-item"))
180
183
  }, [
181
184
  d("span", {
182
- class: s(i(c)("tooltip-label")),
183
- style: u(l.tooltipLabelStyles)
185
+ class: s(n(l)("tooltip-label")),
186
+ style: u(c.tooltipLabelStyles)
184
187
  }, a(t.label ? t.label : "--") + ": ", 7),
185
- m(t.value) ? (r(), n("span", {
188
+ m(t.value) ? (r(), i("span", {
186
189
  key: 0,
187
- class: s(i(c)("tooltip-value")),
188
- style: u(l.tooltipValueStyles)
190
+ class: s(n(l)("tooltip-value")),
191
+ style: u(c.tooltipValueStyles)
189
192
  }, [
190
193
  R(S, {
191
194
  value: t.value,
192
195
  style: u([t.tooltipValueStyles])
193
196
  }, null, 8, ["value", "style"]),
194
- t.unit ? (r(), n("span", b, a(t.unit), 1)) : p("", !0)
195
- ], 6)) : (r(), n("span", {
197
+ t.unit ? (r(), i("span", b, a(t.unit), 1)) : p("", !0)
198
+ ], 6)) : (r(), i("span", {
196
199
  key: 1,
197
- class: s(i(c)("tooltip-value")),
198
- style: u(l.tooltipValueStyles)
200
+ class: s(n(l)("tooltip-value")),
201
+ style: u(c.tooltipValueStyles)
199
202
  }, [
200
203
  O(a(k(t.value, { ...t })) + " ", 1),
201
- t.unit ? (r(), n("span", q, a(t.unit), 1)) : p("", !0)
204
+ t.unit ? (r(), i("span", q, a(t.unit), 1)) : p("", !0)
202
205
  ], 6))
203
206
  ], 2))), 128))
204
207
  ], 2)
@@ -97,6 +97,12 @@ export type ApFieldSwitchProps = BasicApFieldProps<Omit<SwitchProps, 'onClick'>>
97
97
  };
98
98
  export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosize'>> & {
99
99
  emptyText?: string;
100
+ /**
101
+ * 输入生效前的事件,受控输入拦截
102
+ * @param nextVal
103
+ * @returns
104
+ */
105
+ beforeInput?: (nextVal: string) => string;
100
106
  };
101
107
  export type ApFieldTextAreaExpose = {
102
108
  focus: (options?: InputFocusOptions) => void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),B=require("@aplus-frontend/antdv");require("../../hooks/index.js");const g=require("lodash-unified"),C=require("../hooks/use-default-placeholder.js"),I=require("../../hooks/useControllableValue.js");function S(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!t.isVNode(a)}const _=t.defineComponent({name:"ApFieldText",__name:"index",props:{mode:{default:"edit"},class:{},style:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onMousedown:{},onMouseUp:{},onFocus:{},onBlur:{},onChange:{},onInput:{},onRawInput:{},"onUpdate:value":{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},value:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"},beforeInput:{}},emits:["update:value"],setup(a,{expose:f,emit:m}){const l=t.ref(),o=t.useSlots();f({focus:e=>{var u;(u=l.value)==null||u.focus(e)},blur:()=>{var e;(e=l.value)==null||e.blur()},setSelectionRange:(e,u,c)=>{var r;(r=l.value)==null||r.setSelectionRange(e,u,c)},select:()=>{var e;(e=l.value)==null||e.select()},input:t.computed(()=>{var e;return(e=l.value)==null?void 0:e.input})});const y=m,n=a,{value:i,updateValue:v}=I.useControllableValue(n,y),x=C.useDefaultPlaceholder("Text",n);function b(e){var d,p,s;const u=e.target.value||"",c=n.beforeInput?(d=n.beforeInput)==null?void 0:d.call(n,u):u,r=(s=(p=l.value)==null?void 0:p.$el)==null?void 0:s.querySelector("input");r&&(r.value=c),v(c)}function h(){var e,u;return n.mode==="edit"?t.createVNode(B.Input,t.mergeProps(g.omit(n,["mode","emptyText","value","onUpdate:value"]),{placeholder:t.unref(x),value:t.unref(i),onInput:b,ref:l}),S(o)?o:{default:()=>[o]}):t.createVNode("span",null,[n.prefix||((e=o==null?void 0:o.prefix)==null?void 0:e.call(o)),t.unref(i)||n.emptyText,n.suffix||((u=o==null?void 0:o.suffix)==null?void 0:u.call(o))])}return(e,u)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(h())))}});exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),B=require("@aplus-frontend/antdv");require("../../hooks/index.js");const g=require("lodash-unified"),I=require("../hooks/use-default-placeholder.js"),C=require("../../hooks/useControllableValue.js");function S(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!t.isVNode(a)}const _=t.defineComponent({name:"ApFieldText",__name:"index",props:{mode:{default:"edit"},class:{},style:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onMousedown:{},onMouseUp:{},onFocus:{},onBlur:{},onChange:{},onInput:{},onRawInput:{},"onUpdate:value":{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},value:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"},beforeInput:{}},emits:["update:value"],setup(a,{expose:f,emit:m}){const l=t.ref(),o=t.useSlots();f({focus:e=>{var u;(u=l.value)==null||u.focus(e)},blur:()=>{var e;(e=l.value)==null||e.blur()},setSelectionRange:(e,u,c)=>{var r;(r=l.value)==null||r.setSelectionRange(e,u,c)},select:()=>{var e;(e=l.value)==null||e.select()},input:t.computed(()=>{var e;return(e=l.value)==null?void 0:e.input})});const y=m,n=a,{value:i,updateValue:v}=C.useControllableValue(n,y),b=I.useDefaultPlaceholder("Text",n);function x(e){var d,p,s;const u=e.target.value||"",c=n.beforeInput?(d=n.beforeInput)==null?void 0:d.call(n,u):u,r=(s=(p=l.value)==null?void 0:p.$el)==null?void 0:s.querySelector("input");r&&(r.value=c),v(c)}function h(){var e,u;return n.mode==="edit"?t.createVNode(B.Input,t.mergeProps(g.omit(n,["mode","emptyText","value","onUpdate:value","beforeInput"]),{placeholder:t.unref(b),value:t.unref(i),onInput:x,ref:l}),S(o)?o:{default:()=>[o]}):t.createVNode("span",null,[n.prefix||((e=o==null?void 0:o.prefix)==null?void 0:e.call(o)),t.unref(i)||n.emptyText,n.suffix||((u=o==null?void 0:o.suffix)==null?void 0:u.call(o))])}return(e,u)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(h())))}});exports.default=_;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("lodash-unified");require("../../hooks/index.js");require("../../config-provider/index.js");const m=require("@aplus-frontend/antdv"),y=require("../hooks/use-default-placeholder.js"),v=require("../../hooks/useControllableValue.js"),B=require("../../config-provider/hooks/use-namespace.js"),h=e.defineComponent({name:"ApFieldTextArea",__name:"index",props:{mode:{default:"edit"},class:{},style:{},rows:{},autoSize:{type:[Boolean,Object]},onResize:{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},size:{},value:{},name:{},type:{default:"text"},onFocus:{},onBlur:{},onChange:{},onInput:{},onKeydown:{},onKeyup:{},onMousedown:{},focused:{type:Boolean},hidden:{type:Boolean},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean},autocomplete:{},readonly:{type:Boolean},status:{},defaultValue:{},"onUpdate:value":{},loading:{type:Boolean},placeholder:{},lazy:{type:Boolean,default:!0},maxlength:{},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onMouseUp:{},onRawInput:{},inputElement:{},triggerFocus:{},handleReset:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"}},emits:["update:value"],setup(r,{expose:s,emit:d}){const t=e.ref(),l=r,p=d,{value:a,updateValue:i}=v.useControllableValue(l,p),{b:c}=B.useNamespace("field-text-area"),f=y.useDefaultPlaceholder("TextArea",l);return s({focus:o=>{var n;(n=t.value)==null||n.focus(o)},blur:()=>{var o;(o=t.value)==null||o.blur()},resizableTextArea:e.computed(()=>{var o;return(o=t.value)==null?void 0:o.resizableTextArea})}),(o,n)=>o.mode==="read"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(c)())},e.toDisplayString(e.unref(u.isNil)(e.unref(a))||e.unref(a)===""?o.emptyText:e.unref(a)),3)):(e.openBlock(),e.createBlock(e.unref(m.Input).TextArea,e.mergeProps({key:1},e.unref(u.omit)(l,["onUpdate:value","value"]),{ref_key:"textAreaRef",ref:t,placeholder:e.unref(f),value:e.unref(a),"onUpdate:value":e.unref(i)}),null,16,["placeholder","value","onUpdate:value"]))}});exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("lodash-unified");require("../../hooks/index.js");require("../../config-provider/index.js");const h=require("@aplus-frontend/antdv"),I=require("../hooks/use-default-placeholder.js"),g=require("../../hooks/useControllableValue.js"),C=require("../../config-provider/hooks/use-namespace.js"),q=e.defineComponent({name:"ApFieldTextArea",__name:"index",props:{mode:{default:"edit"},class:{},style:{},rows:{},autoSize:{type:[Boolean,Object]},onResize:{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},size:{},value:{},name:{},type:{default:"text"},onFocus:{},onBlur:{},onChange:{},onInput:{},onKeydown:{},onKeyup:{},onMousedown:{},focused:{type:Boolean},hidden:{type:Boolean},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean},autocomplete:{},readonly:{type:Boolean},status:{},defaultValue:{},"onUpdate:value":{},loading:{type:Boolean},placeholder:{},lazy:{type:Boolean,default:!0},maxlength:{},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onMouseUp:{},onRawInput:{},inputElement:{},triggerFocus:{},handleReset:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"},beforeInput:{}},emits:["update:value"],setup(c,{expose:f,emit:m}){const n=e.ref(),o=c,y=m,{value:l,updateValue:v}=g.useControllableValue(o,y),{b}=C.useNamespace("field-text-area"),x=I.useDefaultPlaceholder("TextArea",o);function B(t){var s,p,i;const a=t.target.value||"",u=o.beforeInput?(s=o.beforeInput)==null?void 0:s.call(o,a):a,r=(i=(p=n.value)==null?void 0:p.$el)==null?void 0:i.querySelector("textarea");r&&(r.value=u),v(u)}return f({focus:t=>{var a;(a=n.value)==null||a.focus(t)},blur:()=>{var t;(t=n.value)==null||t.blur()},resizableTextArea:e.computed(()=>{var t;return(t=n.value)==null?void 0:t.resizableTextArea})}),(t,a)=>t.mode==="read"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(b)())},e.toDisplayString(e.unref(d.isNil)(e.unref(l))||e.unref(l)===""?t.emptyText:e.unref(l)),3)):(e.openBlock(),e.createBlock(e.unref(h.Input).TextArea,e.mergeProps({key:1},e.unref(d.omit)(o,["onUpdate:value","value","beforeInput"]),{ref_key:"textAreaRef",ref:n,placeholder:e.unref(x),value:e.unref(l),onInput:B}),null,16,["placeholder","value"]))}});exports.default=q;
@@ -705,8 +705,7 @@ declare function __VLS_template(): {
705
705
  }>, {
706
706
  blur: () => void;
707
707
  focus: () => void;
708
- request: (currentNode
709
- /** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
708
+ request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
710
709
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
711
710
  "update:value": (...args: any[]) => void;
712
711
  }, string, {
@@ -774,8 +773,7 @@ declare function __VLS_template(): {
774
773
  }>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
775
774
  blur: () => void;
776
775
  focus: () => void;
777
- request: (currentNode
778
- /** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
776
+ request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
779
777
  }> & {} & ComponentCustomProperties & {} & {
780
778
  $slots: Readonly<{
781
779
  title?: any;
@@ -1481,8 +1479,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
1481
1479
  }>, {
1482
1480
  blur: () => void;
1483
1481
  focus: () => void;
1484
- request: (currentNode
1485
- /** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
1482
+ request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
1486
1483
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1487
1484
  "update:value": (...args: any[]) => void;
1488
1485
  }, string, {
@@ -1550,8 +1547,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
1550
1547
  }>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
1551
1548
  blur: () => void;
1552
1549
  focus: () => void;
1553
- request: (currentNode
1554
- /** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
1550
+ request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
1555
1551
  }> & {} & ComponentCustomProperties & {} & {
1556
1552
  $slots: Readonly<{
1557
1553
  title?: any;
@@ -6,7 +6,7 @@ import { DataIndex } from '@aplus-frontend/antdv/es/vc-table/interface';
6
6
  import { EditableTableExpose } from '../../editable-table';
7
7
  import { NamePath } from '@aplus-frontend/antdv/es/form/interface';
8
8
  import { ApFormItemProps } from '../../ap-form';
9
- export type EditableGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ApGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>, 'children' | 'customRender' | 'hideInSearch' | 'hideInTable' | 'tooltip' | 'customRenderFormItem' | 'fieldProps'> & {
9
+ export type EditableGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ApGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>, 'children' | 'customRender' | 'hideInSearch' | 'tooltip' | 'customRenderFormItem' | 'fieldProps'> & {
10
10
  children?: EditableGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
11
11
  /**
12
12
  * 在title之后展示一个icon并触发tooltip
@@ -81,6 +81,7 @@ export declare const useTablePaging: <DataType = any, ParamsType = Record<string
81
81
  showQuickJumper: boolean;
82
82
  showLessItems: boolean | undefined;
83
83
  size: "default" | "small";
84
+ pageSizeOptions: (string | number)[];
84
85
  showTotal: ((total: number) => import("vue/jsx-runtime").JSX.Element) | undefined;
85
86
  };
86
87
  onChange: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<any> | SorterResult<any>[], extra: TableCurrentDataSource<any>) => void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),re=require("./use-sorted-filtered.js");require("../../config-provider/index.js");const A=require("../utils.js"),D=require("lodash-unified"),O=require("../../utils/index.js"),ne=require("../../config-provider/hooks/use-locale.js"),ae=require("../../config-provider/hooks/use-namespace.js"),h=1,b=10;function oe(g){const l={};return g&&(g===!0?(l.current=h,l.pageSize=b):(l.current=g.defaultCurrent||h,l.pageSize=g.defaultPageSize||b)),l}const se=({manual:g=!1,request:l,defaultParams:L={},defaultData:v=[],formatParams:y,paramsValueTypeMap:N,resetFieldsIgnores:R,filterFields:j,sortFields:J,namespace:M="ap-table",pagination:p={defaultCurrent:h,defaultPageSize:b,showLessItems:!1,showTotal:!0}})=>{let q=0,c={};const S=p??{},Q=e=>y?y(e):e,z=n.ref(),i=n.reactive(oe(p)),{getColumnSFConfig:B,setSF:G,clearAll:K,sortedInfo:Z,filteredInfo:$}=re.useTableSortedAndFiltered(),{t:P}=ne.useLocale(),{b:w}=ae.useNamespace(M),a=n.reactive({total:v.length,records:v,loading:!1}),F=()=>{var e,t;return((t=(e=z.value)==null?void 0:e.apForm)==null?void 0:t.getFieldsValueTransformed(!0))||{}},V=async e=>{var o;const t=Q(e),r=Date.now();q=r,a.loading=!0;try{const s=await l({...n.unref(L),...t});q===r&&(a.total=s.total||((o=s.data)==null?void 0:o.length)||0,a.records=[...s.data||[]])}catch{q===r&&(a.records=[],a.total=0)}finally{a.loading=!1}},U=e=>{const t={};return Object.entries(e).forEach(([r,o])=>{if(t[r]=o,N&&o){const s=N[r];s&&(t[r]=A.parseFieldValue(s,o))}}),t},W=async e=>{var o,s,f,d,m;const t=F(),r={};Object.entries(t).forEach(([T,E])=>{R&&R.indexOf(T)>-1&&(r[T]=E)}),await((s=(o=z.value)==null?void 0:o.apForm)==null?void 0:s.resetFields()),(m=(d=(f=z.value)==null?void 0:f.apForm)==null?void 0:d.setFieldsValue)==null||m.call(d,r),n.nextTick(()=>{e==null||e()})},C=e=>{c=e;const t=U(e);V(t)},H=e=>{C({...c,...e})},x=()=>{const e=F();p&&(i.current=h),C({...e,filter:c.filter,sort:c.sort,current:p?h:void 0,pageSize:p?c.pageSize||i.pageSize:void 0})},X=()=>{K(),c.sort={},c.filter={},W(x)},_=()=>{C(c)},Y=e=>{if(!p)_();else{const{current:t,pageSize:r}=i,o=a.total-e,s=Math.ceil(o/r),f=t>s?s:t;H({current:f>0?f:1})}},I=(e,t,r)=>{var T,E;const o=F();i.current=e.current,i.pageSize=e.pageSize,G(t,r);const s=D.isArray(r)?[...r]:[r],f={};for(const u of s)(T=n.unref(J))!=null&&T.includes(u.columnKey||u.field)&&u.order&&(f[A.dataIndexToStr(u.columnKey||u.field)]=u.order);const d={};for(const u of Object.keys(t))(E=n.unref(j))!=null&&E.includes(u)&&t[u]&&(d[u]=t[u]);const m={...o,filter:d,sort:f,current:e.current,pageSize:e.pageSize};D.isEqualWith(c,m,A.isEqualCustom)||C(m)};n.onMounted(()=>{const e=F(),{current:t,pageSize:r}=i;if(c={current:t,pageSize:r,filter:{},sort:{},...e},!g){const o=U(c);V(o)}}),n.watch(()=>n.unref(L),()=>{x()},{deep:!0});const k=n.computed(()=>{if(a.total===0)return"-";const{current:e,pageSize:t}=i;return`${e}/${Math.ceil(a.total/t)}`});function ee(e){D.isArray(e)&&(a.records=e,a.total=e.length)}const te=n.computed(()=>{const{showLessItems:e,showTotal:t}=S;return{loading:a.loading,pagination:{current:i.current,pageSize:i.pageSize,total:a.total,showSizeChanger:O.isDef(S.showSizeChanger)?S.showSizeChanger:!e,showQuickJumper:O.isDef(S.showQuickJumper)?S.showQuickJumper:!e,showLessItems:e,size:"default",showTotal:t?r=>n.createVNode("span",{class:w("pagination-total-wrapper")},[P("ap.apTable.pagination.totalLeftPrefix")," ",n.createVNode("span",{class:w("pagination-count-text")},[r])," ",P("ap.apTable.pagination.totalLeftSuffix"),n.createVNode("span",{class:w("pagination--total-right")},[P("ap.apTable.pagination.totalRightPrefix")," ",n.createVNode("span",{class:w("pagination-count-text")},[n.unref(k)])," ",P("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:I,dataSource:a.records}});return{formRef:z,submit:x,reset:X,refresh:_,refreshByDelete:Y,data:a,current:i.current,pageSize:i.pageSize,handleTableChange:I,tableProps:te,dataSource:n.computed(()=>a.records),setDataSource:ee,getColumnSFConfig:B,sortedInfo:Z,filteredInfo:$}};exports.DEFAULT_CURRENT=h;exports.DEFAULT_PAGE_SIZE=b;exports.useTablePaging=se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),re=require("./use-sorted-filtered.js");require("../../config-provider/index.js");const A=require("../utils.js"),b=require("lodash-unified"),_=require("../../utils/index.js"),ne=require("../../config-provider/hooks/use-locale.js"),ae=require("../../config-provider/hooks/use-namespace.js"),S=1,C=10;function oe(g){const f={};return g&&(g===!0?(f.current=S,f.pageSize=C):(f.current=g.defaultCurrent||S,f.pageSize=g.defaultPageSize||C)),f}const se=({manual:g=!1,request:f,defaultParams:D={},defaultData:L=[],formatParams:v,paramsValueTypeMap:y,resetFieldsIgnores:N,filterFields:I,sortFields:j,namespace:M="ap-table",pagination:p={defaultCurrent:S,defaultPageSize:C,showLessItems:!1,showTotal:!0}})=>{let q=0,i={};const B=p??{},G=e=>v?v(e):e,T=a.ref(),c=a.reactive(oe(p)),{getColumnSFConfig:J,setSF:K,clearAll:Q,sortedInfo:Z,filteredInfo:$}=re.useTableSortedAndFiltered(),{t:z}=ne.useLocale(),{b:P}=ae.useNamespace(M),s=a.reactive({total:L.length,records:L,loading:!1}),F=()=>{var e,t;return((t=(e=T.value)==null?void 0:e.apForm)==null?void 0:t.getFieldsValueTransformed(!0))||{}},R=async e=>{var n;const t=G(e),r=Date.now();q=r,s.loading=!0;try{const o=await f({...a.unref(D),...t});q===r&&(s.total=o.total||((n=o.data)==null?void 0:n.length)||0,s.records=[...o.data||[]])}catch{q===r&&(s.records=[],s.total=0)}finally{s.loading=!1}},U=e=>{const t={};return Object.entries(e).forEach(([r,n])=>{if(t[r]=n,y&&n){const o=y[r];o&&(t[r]=A.parseFieldValue(o,n))}}),t},W=async e=>{var n,o,l,d,h;const t=F(),r={};Object.entries(t).forEach(([m,E])=>{N&&N.indexOf(m)>-1&&(r[m]=E)}),await((o=(n=T.value)==null?void 0:n.apForm)==null?void 0:o.resetFields()),(h=(d=(l=T.value)==null?void 0:l.apForm)==null?void 0:d.setFieldsValue)==null||h.call(d,r),a.nextTick(()=>{e==null||e()})},w=e=>{i=e;const t=U(e);R(t)},H=e=>{w({...i,...e})},x=()=>{const e=F();p&&(c.current=S),w({...e,filter:i.filter,sort:i.sort,current:p?S:void 0,pageSize:p?i.pageSize||c.pageSize:void 0})},X=()=>{Q(),i.sort={},i.filter={},W(x)},V=()=>{w(i)},Y=e=>{if(!p)V();else{const{current:t,pageSize:r}=c,n=s.total-e,o=Math.ceil(n/r),l=t>o?o:t;H({current:l>0?l:1})}},O=(e,t,r)=>{var m,E;const n=F();c.current=e.current,c.pageSize=e.pageSize,K(t,r);const o=b.isArray(r)?[...r]:[r],l={};for(const u of o)(m=a.unref(j))!=null&&m.includes(u.columnKey||u.field)&&u.order&&(l[A.dataIndexToStr(u.columnKey||u.field)]=u.order);const d={};for(const u of Object.keys(t))(E=a.unref(I))!=null&&E.includes(u)&&t[u]&&(d[u]=t[u]);const h={...n,filter:d,sort:l,current:e.current,pageSize:e.pageSize};b.isEqualWith(i,h,A.isEqualCustom)||w(h)};a.onMounted(()=>{const e=F(),{current:t,pageSize:r}=c;if(i={current:t,pageSize:r,filter:{},sort:{},...e},!g){const n=U(i);R(n)}}),a.watch(()=>a.unref(D),()=>{x()},{deep:!0});const k=a.computed(()=>{if(s.total===0)return"-";const{current:e,pageSize:t}=c;return`${e}/${Math.ceil(s.total/t)}`});function ee(e){b.isArray(e)&&(s.records=e,s.total=e.length)}const te=a.computed(()=>{const{showLessItems:e,showTotal:t,showQuickJumper:r,showSizeChanger:n,pageSizeOptions:o}=B;return{loading:s.loading,pagination:{current:c.current,pageSize:c.pageSize,total:s.total,showSizeChanger:_.isDef(n)?n:!e,showQuickJumper:_.isDef(r)?r:!e,showLessItems:e,size:"default",pageSizeOptions:b.isUndefined(o)?["10","20","50","100"]:o,showTotal:t?l=>a.createVNode("span",{class:P("pagination-total-wrapper")},[z("ap.apTable.pagination.totalLeftPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[l])," ",z("ap.apTable.pagination.totalLeftSuffix"),a.createVNode("span",{class:P("pagination--total-right")},[z("ap.apTable.pagination.totalRightPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[a.unref(k)])," ",z("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:O,dataSource:s.records}});return{formRef:T,submit:x,reset:X,refresh:V,refreshByDelete:Y,data:s,current:c.current,pageSize:c.pageSize,handleTableChange:O,tableProps:te,dataSource:a.computed(()=>s.records),setDataSource:ee,getColumnSFConfig:J,sortedInfo:Z,filteredInfo:$}};exports.DEFAULT_CURRENT=S;exports.DEFAULT_PAGE_SIZE=C;exports.useTablePaging=se;
@@ -8,6 +8,7 @@ import { ApActionGroupProps } from '../ap-action';
8
8
  import { ApTableIndexProps } from './components/interface';
9
9
  import { EllipsisConfig } from '@aplus-frontend/antdv/es/typography/Base';
10
10
  import { RowSelectionReturnType } from './hooks/use-table-row-selection';
11
+ import { PaginationProps } from '@aplus-frontend/antdv';
11
12
  export type ValueEnumType = {
12
13
  text: string;
13
14
  /**
@@ -238,6 +239,8 @@ export type ApTablePaginationConfig = {
238
239
  * 是否显示快速跳转
239
240
  */
240
241
  showQuickJumper?: boolean;
242
+ } & {
243
+ pageSizeOptions?: PaginationProps['pageSizeOptions'];
241
244
  };
242
245
  export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection'> & {
243
246
  /**
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv");require("../../../config-provider/index.js");const k=require("../interface.js"),f=require("../../../config-provider/hooks/use-namespace.js"),S={key:0},C=["href","onClick"],v=["onClick"],g={key:0},B={key:0},h=e.defineComponent({name:"ApLadderValueGroupMode",__name:"ValueGroupMode",props:{labelValues:{type:Array,default:()=>[]},labelAlign:{type:String,default:""},labelStyles:{type:Object,default:()=>({})},valueStyles:{type:Object,default:()=>({})},linkStyles:{type:Object,default:()=>({})},unitStyles:{type:Object,default:()=>({})},tooltipLabelStyles:{type:Object,default:()=>({})},tooltipValueStyles:{type:Object,default:()=>({})},tooltipProps:{type:Object,default:()=>({})},tooltip:{type:Boolean,default:!1}},emits:["update:valueRefs","handleClick"],setup(l,{emit:u}){const y=u,{e:r}=f.useNamespace("ap-ladder"),a=o=>e.isVNode(o)||typeof o=="function",s=o=>{const{value:n,style:t}=o;return e.isVNode(n)?e.h(n,{style:t}):typeof n=="function"?e.h(n(),{ref:e.ref,style:{...t}}):null},i=(o,n={rawValue:!0,precision:2,thousand:!0,thousandSeparator:",",currency:"CNY",percent:!1})=>{if(Object.prototype.toString.call(o)==="[object Null]"||Object.prototype.toString.call(o)==="[object Undefined]"||Object.prototype.toString.call(o)==="[object Object]"||Object.prototype.toString.call(o)==="[object Function]")return"--";if(typeof o=="number"){if(n.percent)return`${o.toFixed(n.precision)}%`;if(n.currency)return o.toLocaleString(k.locales[n.currency?n.currency:"CNY"],{style:"currency",currency:n.currency?n.currency:"CNY"});if(n.thousand){const[t,c]=o.toFixed(n.precision?n.precision:2).split(".");return`${t.replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${n.thousandSeparator?n.thousandSeparator:","}`)}.${c}`}return o.toFixed(n.precision?n.precision:2)}return o},d=o=>{y("handleClick",o)};return(o,n)=>(e.openBlock(),e.createBlock(e.unref(p.Tooltip),e.normalizeProps(e.guardReactiveProps(l.tooltipProps)),e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("value-group"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelValues,(t,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(e.unref(r)("value-group-item"))},[t.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(r)("value-group-label"),l.labelAlign&&`label-align-${l.labelAlign}`]),style:e.normalizeStyle(t.labelStyles)},[e.createTextVNode(e.toDisplayString(t.label),1),t.label?(e.openBlock(),e.createElementBlock("span",S,":")):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("value-group-value"))},[a(t.value)?(e.openBlock(),e.createBlock(s,{key:0,value:t.value,style:e.normalizeStyle([t.labelColor,t.valueStyles])},null,8,["value","style"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:t.link,target:"_blank",class:e.normalizeClass(e.unref(r)("value-group-link")),style:e.normalizeStyle([l.linkStyles,t.linkStyles,t.linkColor?{color:t.linkColor}:void 0]),onClick:e.withModifiers(m=>d(t),["prevent"])},e.toDisplayString(i(t.value,{...t})),15,C)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",{style:e.normalizeStyle([l.valueStyles,t.valueStyles,t.valueColor?{color:t.valueColor}:void 0]),class:e.normalizeClass(t.handleValueClick?e.unref(r)("value-group-link"):void 0),onClick:m=>t.handleValueClick&&t.handleValueClick(l.labelValues)},e.toDisplayString(i(t.value,{...t})),15,v),t.unit?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r)("value-group-unit")),style:e.normalizeStyle([l.unitStyles,t.unitStyles,t.unitColor?{color:t.unitColor}:void 0])},e.toDisplayString(t.unit),7)):e.createCommentVNode("",!0)],64))],64))],2)],2))),128))],2)]),_:2},[o.$slots.title?{name:"title",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"title")]),key:"0"}:l.tooltip?{name:"title",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("tooltip"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelValues,(t,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(e.unref(r)("tooltip-item"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("tooltip-label")),style:e.normalizeStyle(l.tooltipLabelStyles)},e.toDisplayString(t.label?t.label:"--")+": ",7),a(t.value)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r)("tooltip-value")),style:e.normalizeStyle(l.tooltipValueStyles)},[e.createVNode(s,{value:t.value,style:e.normalizeStyle([t.tooltipValueStyles])},null,8,["value","style"]),t.unit?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(t.unit),1)):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(r)("tooltip-value")),style:e.normalizeStyle(l.tooltipValueStyles)},[e.createTextVNode(e.toDisplayString(i(t.value,{...t}))+" ",1),t.unit?(e.openBlock(),e.createElementBlock("span",B,e.toDisplayString(t.unit),1)):e.createCommentVNode("",!0)],6))],2))),128))],2)]),key:"1"}:void 0]),1040))}});exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv");require("../../../config-provider/index.js");const k=require("../interface.js"),f=require("../../../config-provider/hooks/use-namespace.js"),S={key:0},v=["href","onClick"],C=["onClick"],g={key:0},B={key:0},h=e.defineComponent({name:"ApLadderValueGroupMode",__name:"ValueGroupMode",props:{labelValues:{type:Array,default:()=>[]},labelAlign:{type:String,default:""},labelStyles:{type:Object,default:()=>({})},valueStyles:{type:Object,default:()=>({})},linkStyles:{type:Object,default:()=>({})},unitStyles:{type:Object,default:()=>({})},tooltipLabelStyles:{type:Object,default:()=>({})},tooltipValueStyles:{type:Object,default:()=>({})},tooltipProps:{type:Object,default:()=>({})},tooltip:{type:Boolean,default:!1}},emits:["update:valueRefs","handleClick"],setup(r,{emit:u}){const y=u,{e:l}=f.useNamespace("ap-ladder"),a=n=>e.isVNode(n)||typeof n=="function",s=n=>{const{value:o,style:t}=n;return e.isVNode(o)?e.h(o,{style:t}):typeof o=="function"?e.h(o(),{ref:e.ref,style:{...t}}):null},i=(n,o={rawValue:!0,precision:2,thousand:!0,thousandSeparator:",",currency:"CNY",percent:!1})=>{if(Object.prototype.toString.call(n)==="[object Null]"||Object.prototype.toString.call(n)==="[object Undefined]"||Object.prototype.toString.call(n)==="[object Object]"||Object.prototype.toString.call(n)==="[object Function]")return"--";if(typeof n=="number"){if(o.percent)return`${n.toFixed(o.precision)}%`;if(o.currency)return n.toLocaleString(k.locales[o.currency?o.currency:"CNY"],{style:"currency",currency:o.currency?o.currency:"CNY"});if(o.thousand){const[t,c]=n.toFixed(o.precision?o.precision:2).split(".");return`${t.replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${o.thousandSeparator?o.thousandSeparator:","}`)}.${c}`}return n.toFixed(o.precision?o.precision:2)}return n},d=n=>{y("handleClick",n)};return(n,o)=>(e.openBlock(),e.createBlock(e.unref(p.Tooltip),e.normalizeProps(e.guardReactiveProps(r.tooltipProps)),e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)("value-group"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.labelValues,(t,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass([e.unref(l)("value-group-item"),t.label===""&&e.unref(l)("value-group-value-end")])},[t.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(l)("value-group-label"),r.labelAlign&&e.unref(l)(`label-align-${r.labelAlign}`)]),style:e.normalizeStyle(t.labelStyles)},[e.createTextVNode(e.toDisplayString(t.label),1),t.label?(e.openBlock(),e.createElementBlock("span",S,":")):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)("value-group-value"))},[a(t.value)?(e.openBlock(),e.createBlock(s,{key:0,value:t.value,style:e.normalizeStyle([t.labelColor,t.valueStyles])},null,8,["value","style"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:t.link,target:"_blank",class:e.normalizeClass(e.unref(l)("value-group-link")),style:e.normalizeStyle([r.linkStyles,t.linkStyles,t.linkColor?{color:t.linkColor}:void 0]),onClick:e.withModifiers(m=>d(t),["prevent"])},e.toDisplayString(i(t.value,{...t})),15,v)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",{style:e.normalizeStyle([r.valueStyles,t.valueStyles,t.valueColor?{color:t.valueColor}:void 0]),class:e.normalizeClass(t.handleValueClick?e.unref(l)("value-group-link"):void 0),onClick:m=>t.handleValueClick&&t.handleValueClick(r.labelValues)},e.toDisplayString(i(t.value,{...t})),15,C),t.unit?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l)("value-group-unit")),style:e.normalizeStyle([r.unitStyles,t.unitStyles,t.unitColor?{color:t.unitColor}:void 0])},e.toDisplayString(t.unit),7)):e.createCommentVNode("",!0)],64))],64))],2)],2))),128))],2)]),_:2},[n.$slots.title?{name:"title",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"title")]),key:"0"}:r.tooltip?{name:"title",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)("tooltip"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.labelValues,(t,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(e.unref(l)("tooltip-item"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(l)("tooltip-label")),style:e.normalizeStyle(r.tooltipLabelStyles)},e.toDisplayString(t.label?t.label:"--")+": ",7),a(t.value)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l)("tooltip-value")),style:e.normalizeStyle(r.tooltipValueStyles)},[e.createVNode(s,{value:t.value,style:e.normalizeStyle([t.tooltipValueStyles])},null,8,["value","style"]),t.unit?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(t.unit),1)):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(l)("tooltip-value")),style:e.normalizeStyle(r.tooltipValueStyles)},[e.createTextVNode(e.toDisplayString(i(t.value,{...t}))+" ",1),t.unit?(e.openBlock(),e.createElementBlock("span",B,e.toDisplayString(t.unit),1)):e.createCommentVNode("",!0)],6))],2))),128))],2)]),key:"1"}:void 0]),1040))}});exports.default=h;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.5.21",
3
+ "version": "0.5.23",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -65,19 +65,19 @@
65
65
  "sortablejs": "^1.15.2",
66
66
  "vue-virtual-scroller": "2.0.0-beta.8",
67
67
  "vuedraggable": "^4.1.0",
68
- "vxe-pc-ui": "4.4.4",
69
- "vxe-table": "4.11.18",
68
+ "vxe-pc-ui": "4.4.23",
69
+ "vxe-table": "4.11.29",
70
70
  "@aplus-frontend/hooks": "1.0.7",
71
- "@aplus-frontend/utils": "1.0.54"
71
+ "@aplus-frontend/utils": "1.0.55"
72
72
  },
73
73
  "peerDependencies": {
74
- "@aplus-frontend/antdv": "^1.1.2",
74
+ "@aplus-frontend/antdv": "^1.1.3",
75
75
  "@aplus-frontend/icon": "^1.2.1",
76
76
  "@aplus-frontend/oss": "^1.1.2",
77
77
  "vue": "^3.5.13"
78
78
  },
79
79
  "devDependencies": {
80
- "@aplus-frontend/antdv": "^1.1.2",
80
+ "@aplus-frontend/antdv": "^1.1.3",
81
81
  "@aplus-frontend/icon": "^1.2.1",
82
82
  "@aplus-frontend/oss": "^1.1.2",
83
83
  "@types/sortablejs": "^1.15.8",
@@ -13,11 +13,13 @@
13
13
  white-space: nowrap;
14
14
  min-width: 0;
15
15
  }
16
+ .aplus-ap-ladder__value-group-value-end {
17
+ justify-content: flex-end;
18
+ }
16
19
  .aplus-ap-ladder__value-group-label {
17
20
  display: inline-block;
18
21
  color: #8896B0;
19
22
  word-break: break-all;
20
- min-width: 50px;
21
23
  }
22
24
  .aplus-ap-ladder__value-group-value {
23
25
  color: #182948;
@@ -31,6 +33,12 @@
31
33
  color: #0070ff !important;
32
34
  text-decoration: none !important;
33
35
  }
36
+ .aplus-ap-ladder__label-align-left {
37
+ text-align: left;
38
+ }
39
+ .aplus-ap-ladder__label-align-right {
40
+ text-align: right;
41
+ }
34
42
  .aplus-ap-ladder-base {
35
43
  display: flex;
36
44
  }
@@ -62,7 +70,7 @@
62
70
  display: flex;
63
71
  }
64
72
  .aplus-ap-ladder__tooltip-label {
65
- min-width: 50px;
73
+ white-space: nowrap;
66
74
  word-break: break-all;
67
75
  }
68
76
  .aplus-ap-ladder__tooltip-value {
@@ -112,6 +120,12 @@
112
120
  color: #0070ff;
113
121
  text-decoration: none;
114
122
  }
123
+ .aplus-ap-ladder--admin .aplus-ap-ladder__value-group-label {
124
+ color: #999999;
125
+ }
126
+ .aplus-ap-ladder--admin .aplus-ap-ladder__value-group-value {
127
+ color: #333333;
128
+ }
115
129
  .aplus-ap-ladder--admin .aplus-ap-ladder__major {
116
130
  color: #333333;
117
131
  }
@@ -15,12 +15,14 @@
15
15
  white-space: nowrap;
16
16
  min-width: 0; // Import
17
17
  }
18
+ &__value-group-value-end{
19
+ justify-content: flex-end;
20
+ }
18
21
 
19
22
  &__value-group-label{
20
23
  display: inline-block;
21
24
  color: #8896B0;
22
25
  word-break: break-all;
23
- min-width: 50px;
24
26
  }
25
27
  &__value-group-value{
26
28
  color: #182948;
@@ -34,7 +36,12 @@
34
36
  color: @aplus-primary-color !important;
35
37
  text-decoration: none !important;
36
38
  }
37
-
39
+ &__label-align-left{
40
+ text-align: left;
41
+ }
42
+ &__label-align-right{
43
+ text-align: right;
44
+ }
38
45
  &-base{
39
46
  display: flex;
40
47
  }
@@ -66,7 +73,7 @@
66
73
  display: flex;
67
74
  }
68
75
  &__tooltip-label{
69
- min-width: 50px;
76
+ white-space: nowrap;
70
77
  word-break: break-all;
71
78
  }
72
79
  &__tooltip-value{
@@ -122,6 +129,12 @@
122
129
  /** Admin端样式 */
123
130
  &--admin {
124
131
  .@{root-cls} {
132
+ &__value-group-label{
133
+ color: #999999;
134
+ }
135
+ &__value-group-value{
136
+ color: #333333;
137
+ }
125
138
  &__major {
126
139
  color: #333333;
127
140
  }
package/theme/index.css CHANGED
@@ -601,11 +601,13 @@
601
601
  white-space: nowrap;
602
602
  min-width: 0;
603
603
  }
604
+ .aplus-ap-ladder__value-group-value-end {
605
+ justify-content: flex-end;
606
+ }
604
607
  .aplus-ap-ladder__value-group-label {
605
608
  display: inline-block;
606
609
  color: #8896B0;
607
610
  word-break: break-all;
608
- min-width: 50px;
609
611
  }
610
612
  .aplus-ap-ladder__value-group-value {
611
613
  color: #182948;
@@ -619,6 +621,12 @@
619
621
  color: #0070ff !important;
620
622
  text-decoration: none !important;
621
623
  }
624
+ .aplus-ap-ladder__label-align-left {
625
+ text-align: left;
626
+ }
627
+ .aplus-ap-ladder__label-align-right {
628
+ text-align: right;
629
+ }
622
630
  .aplus-ap-ladder-base {
623
631
  display: flex;
624
632
  }
@@ -650,7 +658,7 @@
650
658
  display: flex;
651
659
  }
652
660
  .aplus-ap-ladder__tooltip-label {
653
- min-width: 50px;
661
+ white-space: nowrap;
654
662
  word-break: break-all;
655
663
  }
656
664
  .aplus-ap-ladder__tooltip-value {
@@ -700,6 +708,12 @@
700
708
  color: #0070ff;
701
709
  text-decoration: none;
702
710
  }
711
+ .aplus-ap-ladder--admin .aplus-ap-ladder__value-group-label {
712
+ color: #999999;
713
+ }
714
+ .aplus-ap-ladder--admin .aplus-ap-ladder__value-group-value {
715
+ color: #333333;
716
+ }
703
717
  .aplus-ap-ladder--admin .aplus-ap-ladder__major {
704
718
  color: #333333;
705
719
  }