@aplus-frontend/ui 0.0.4 → 0.0.6

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 (47) hide show
  1. package/es/src/ap-field/date-range/index.vue.mjs +65 -58
  2. package/es/src/ap-field/interface.d.ts +2 -2
  3. package/es/src/ap-form/ap-form-item-group/index.vue.mjs +23 -21
  4. package/es/src/ap-form/ap-form.vue.d.ts +7 -2
  5. package/es/src/ap-form/ap-form.vue2.mjs +85 -52
  6. package/es/src/ap-form/context.d.ts +14 -0
  7. package/es/src/ap-form/hooks/use-watch.d.ts +7 -0
  8. package/es/src/ap-form/hooks/use-watch.mjs +30 -0
  9. package/es/src/ap-form/index.d.ts +2 -0
  10. package/es/src/ap-form/index.mjs +13 -11
  11. package/es/src/ap-form/interface.d.ts +17 -7
  12. package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
  13. package/es/src/ap-form/modal-form/index.vue.mjs +1 -1
  14. package/es/src/ap-form/search-form/index.vue.mjs +27 -27
  15. package/es/src/ap-table/ap-table.vue.d.ts +2 -0
  16. package/es/src/ap-table/ap-table.vue.mjs +98 -93
  17. package/es/src/ap-table/interface.d.ts +18 -1
  18. package/es/src/pro-form/helper.mjs +7 -7
  19. package/es/src/theme/antd-global-overwrite/admin/alert.css +3 -0
  20. package/es/src/theme/antd-global-overwrite/admin/index.css +3 -0
  21. package/es/src/theme/antd-global-overwrite/aplus/alert.css +3 -0
  22. package/es/src/theme/antd-global-overwrite/aplus/index.css +3 -0
  23. package/es/src/utils/index.mjs +32 -32
  24. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  25. package/lib/src/ap-field/interface.d.ts +2 -2
  26. package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
  27. package/lib/src/ap-form/ap-form.vue.d.ts +7 -2
  28. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  29. package/lib/src/ap-form/context.d.ts +14 -0
  30. package/lib/src/ap-form/hooks/use-watch.d.ts +7 -0
  31. package/lib/src/ap-form/hooks/use-watch.js +1 -0
  32. package/lib/src/ap-form/index.d.ts +2 -0
  33. package/lib/src/ap-form/index.js +1 -1
  34. package/lib/src/ap-form/interface.d.ts +17 -7
  35. package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
  36. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  37. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  38. package/lib/src/ap-table/ap-table.vue.d.ts +2 -0
  39. package/lib/src/ap-table/ap-table.vue.js +1 -1
  40. package/lib/src/ap-table/interface.d.ts +18 -1
  41. package/lib/src/pro-form/helper.js +1 -1
  42. package/lib/src/theme/antd-global-overwrite/admin/alert.css +3 -0
  43. package/lib/src/theme/antd-global-overwrite/admin/index.css +3 -0
  44. package/lib/src/theme/antd-global-overwrite/aplus/alert.css +3 -0
  45. package/lib/src/theme/antd-global-overwrite/aplus/index.css +3 -0
  46. package/lib/src/utils/index.js +1 -1
  47. package/package.json +2 -2
@@ -15,14 +15,13 @@ import { useLocale as se } from "../../config-provider/hooks/use-locale.mjs";
15
15
  import V from "../ap-form-item.vue.mjs";
16
16
  import pe from "../ap-form.vue2.mjs";
17
17
  import ce from "../ap-form-item-group/index.vue.mjs";
18
- function ie(c) {
19
- return typeof c == "function" || Object.prototype.toString.call(c) === "[object Object]" && !J(c);
18
+ function ie(i) {
19
+ return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !J(i);
20
20
  }
21
- const p = 24, Pe = /* @__PURE__ */ K({
21
+ const c = 24, Pe = /* @__PURE__ */ K({
22
22
  name: "ApFormSearchForm",
23
23
  __name: "index",
24
24
  props: {
25
- initialValues: {},
26
25
  layout: {
27
26
  default: "horizontal"
28
27
  },
@@ -65,6 +64,7 @@ const p = 24, Pe = /* @__PURE__ */ K({
65
64
  onFinish: {},
66
65
  onFinishFailed: {},
67
66
  onValidate: {},
67
+ initialValues: {},
68
68
  collapse: {
69
69
  type: Boolean,
70
70
  default: void 0
@@ -97,12 +97,12 @@ const p = 24, Pe = /* @__PURE__ */ K({
97
97
  }
98
98
  },
99
99
  emits: ["update:collapse"],
100
- setup(c, {
100
+ setup(i, {
101
101
  expose: I,
102
102
  emit: j
103
103
  }) {
104
104
  var S;
105
- const l = Q(), t = c, M = j, {
105
+ const l = Q(), t = i, M = j, {
106
106
  value: f,
107
107
  updateValue: O
108
108
  } = ne(t, M, {
@@ -117,40 +117,40 @@ const p = 24, Pe = /* @__PURE__ */ K({
117
117
  O(!o(f));
118
118
  }
119
119
  function L() {
120
- var e;
121
- (e = m.value) == null || e.validateFields().then(t.onSubmit);
120
+ var e, n;
121
+ (n = (e = m.value) == null ? void 0 : e.validateFields()) == null || n.then(t.onSubmit);
122
122
  }
123
123
  function q() {
124
- var e, u, d;
125
- t.customReset || (u = (e = m.value) == null ? void 0 : e.resetFields) == null || u.call(e), (d = t.onReset) == null || d.call(t);
124
+ var e, n, d;
125
+ t.customReset || (n = (e = m.value) == null ? void 0 : e.resetFields) == null || n.call(e), (d = t.onReset) == null || d.call(t);
126
126
  }
127
- const R = v(T(l.default())), i = v((S = l.extra) == null ? void 0 : S.call(l)), F = C(() => Math.floor(p / t.countPerRow));
127
+ const R = v(T(l.default())), u = v((S = l.extra) == null ? void 0 : S.call(l)), F = C(() => Math.floor(c / t.countPerRow));
128
128
  P(() => l.default(), (e) => {
129
129
  R.value = T(e);
130
130
  }), P(() => {
131
131
  var e;
132
132
  return (e = l.extra) == null ? void 0 : e.call(l);
133
133
  }, (e) => {
134
- i.value = e;
134
+ u.value = e;
135
135
  });
136
136
  const z = C(() => {
137
137
  let e;
138
- const u = [...o(R)], d = [], b = [], n = o(F);
138
+ const n = [...o(R)], d = [], b = [], r = o(F);
139
139
  let h = 0;
140
- u.forEach((r) => {
141
- const s = r.props;
142
- s != null && s.hidden ? d.push(r) : (h += s.span || n, b.push(r));
140
+ n.forEach((s) => {
141
+ const p = s.props;
142
+ p != null && p.hidden ? d.push(s) : (h += p.span || r, b.push(s));
143
143
  });
144
- const B = p - (h + n) % p, U = B < n ? p : B, x = p - n * (o(i) && !t.extraInAction ? 2 : 1), W = !t.forceExpand && h > x;
144
+ const B = c - (h + r) % c, U = B < r ? c : B, x = c - r * (o(u) && !t.extraInAction ? 2 : 1), W = !t.forceExpand && h > x;
145
145
  let _ = 0;
146
- const G = b.map((r, s) => {
147
- const w = r.props;
148
- return _ += w.span || n, Y(r, {
149
- span: w.span || n,
150
- key: `ApFormSearchFormItem-${s}`,
146
+ const G = b.map((s, p) => {
147
+ const w = s.props;
148
+ return _ += w.span || r, Y(s, {
149
+ span: w.span || r,
150
+ key: `ApFormSearchFormItem-${p}`,
151
151
  hidden: !t.forceExpand && o(f) && _ > x
152
152
  });
153
- }), H = p - Math.min(x, _) - n;
153
+ }), H = c - Math.min(x, _) - r;
154
154
  return a(Z, null, [G, d, a(V, {
155
155
  span: o(F)
156
156
  }, {
@@ -175,21 +175,21 @@ const p = 24, Pe = /* @__PURE__ */ K({
175
175
  rotate: o(f) ? 90 : -90
176
176
  }, null)
177
177
  }, null) : null]
178
- }), t.extraInAction ? o(i) : null]
178
+ }), t.extraInAction ? o(u) : null]
179
179
  })]
180
- }), !t.extraInAction && o(i) ? a(V, {
180
+ }), !t.extraInAction && o(u) ? a(V, {
181
181
  span: o(f) ? H : U
182
182
  }, {
183
183
  default: () => [a(N, {
184
184
  justify: "end"
185
- }, ie(e = o(i)) ? e : {
185
+ }, ie(e = o(u)) ? e : {
186
186
  default: () => [e]
187
187
  })]
188
188
  }) : null]);
189
189
  });
190
190
  return I({
191
191
  apForm: C(() => o(m))
192
- }), (e, u) => (k(), A(pe, ee({
192
+ }), (e, n) => (k(), A(pe, ee({
193
193
  class: o($)(),
194
194
  ref_key: "apForm",
195
195
  ref: m
@@ -28,6 +28,7 @@ type ApTableSlots = {
28
28
  * @param fields
29
29
  */
30
30
  declare function setSearchFormValues(fields: any): void;
31
+ declare function getSearchFormValues(): Partial<any> | undefined;
31
32
  declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any, "text">>, {
32
33
  bordered: boolean;
33
34
  childrenColumnName: string;
@@ -50,6 +51,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
50
51
  submit: () => void;
51
52
  reset: () => void;
52
53
  setSearchFormValues: typeof setSearchFormValues;
54
+ getSearchFormValues: typeof getSearchFormValues;
53
55
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any, "text">>, {
54
56
  bordered: boolean;
55
57
  childrenColumnName: string;
@@ -1,19 +1,19 @@
1
- import { defineComponent as K, computed as u, createVNode as d, mergeProps as m, unref as n, watch as $, openBlock as p, createElementBlock as c, normalizeClass as b, normalizeStyle as T, withCtx as f, Fragment as H, renderList as x, createBlock as G, resolveDynamicComponent as Q, createCommentVNode as B, createElementVNode as P, renderSlot as I, createSlots as U, toDisplayString as J, normalizeProps as X, guardReactiveProps as Y } from "vue";
2
- import { Typography as Z, Table as ee, Tooltip as ae } from "ant-design-vue";
3
- import { ApForm as te } from "../ap-form/index.mjs";
4
- import { apTableRenderItemMap as oe, noRenderAsFormItemValueList as v, apTableFormItemMap as ne } from "./constants.mjs";
1
+ import { defineComponent as $, computed as u, createVNode as d, mergeProps as m, unref as l, watch as H, openBlock as p, createElementBlock as c, normalizeClass as h, normalizeStyle as T, withCtx as f, Fragment as G, renderList as x, createBlock as Q, resolveDynamicComponent as U, createCommentVNode as B, createElementVNode as P, renderSlot as I, createSlots as J, toDisplayString as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
2
+ import { Typography as ee, Table as ae, Tooltip as te } from "ant-design-vue";
3
+ import { ApForm as oe } from "../ap-form/index.mjs";
4
+ import { apTableRenderItemMap as le, noRenderAsFormItemValueList as v, apTableFormItemMap as ne } from "./constants.mjs";
5
5
  import "../config-provider/index.mjs";
6
- import { useTablePaging as le } from "./hooks/use-table-paging.mjs";
7
- import { isUndefined as re, omit as de } from "lodash-unified";
6
+ import { useTablePaging as re } from "./hooks/use-table-paging.mjs";
7
+ import { isUndefined as de, omit as se } from "lodash-unified";
8
8
  import "./style/ap-table.css";
9
- import { QuestionCircleOutlined as se } from "@ant-design/icons-vue";
10
- import { apColumnToColumn as ue, getTableRenderType as pe, getTableRenderProps as ie, getColumnOrder as k, updateFormProps as me, getFieldProps as ce, getPlaceholder as fe } from "./utils.mjs";
11
- import { useLocale as ge } from "../config-provider/hooks/use-locale.mjs";
12
- import { useNamespace as ye } from "../config-provider/hooks/use-namespace.mjs";
13
- import { useGlobalConfig as be } from "../config-provider/hooks/use-global-config.mjs";
14
- const he = {
9
+ import { QuestionCircleOutlined as ue } from "@ant-design/icons-vue";
10
+ import { apColumnToColumn as pe, getTableRenderType as ie, getTableRenderProps as me, getColumnOrder as k, updateFormProps as ce, getFieldProps as fe, getPlaceholder as ge } from "./utils.mjs";
11
+ import { useLocale as ye } from "../config-provider/hooks/use-locale.mjs";
12
+ import { useNamespace as be } from "../config-provider/hooks/use-namespace.mjs";
13
+ import { useGlobalConfig as he } from "../config-provider/hooks/use-global-config.mjs";
14
+ const Ce = {
15
15
  key: 0
16
- }, ze = /* @__PURE__ */ K({
16
+ }, Ee = /* @__PURE__ */ $({
17
17
  name: "ApTable",
18
18
  __name: "ap-table",
19
19
  props: {
@@ -125,126 +125,131 @@ const he = {
125
125
  setup(O, {
126
126
  expose: z
127
127
  }) {
128
- const l = O, {
128
+ const n = O, {
129
129
  t: E
130
- } = ge(), {
131
- e: h,
130
+ } = ye(), {
131
+ e: C,
132
132
  b: g
133
- } = ye("ap-table"), L = be("uiMode"), y = u(() => {
134
- var o;
135
- let e = ((o = l.columns) == null ? void 0 : o.filter((a) => !a.hideInTable)) || [];
133
+ } = be("ap-table"), L = he("uiMode"), y = u(() => {
134
+ var t;
135
+ let e = ((t = n.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
136
136
  return e = e.map((a) => ({
137
- ...ue(a),
137
+ ...pe(a),
138
138
  customRender({
139
- value: t,
139
+ value: o,
140
140
  ...r
141
141
  }) {
142
142
  let s;
143
143
  if (a.customRender)
144
144
  s = a.customRender({
145
- value: t,
145
+ value: o,
146
146
  ...r,
147
147
  column: a
148
148
  });
149
149
  else {
150
- const w = pe(a), _ = oe[w], q = ie(a, {
151
- value: t,
150
+ const w = ie(a), q = le[w], K = me(a, {
151
+ value: o,
152
152
  ...r
153
153
  });
154
- s = d(_, m(q, {
154
+ s = d(q, m(K, {
155
155
  mode: "read"
156
156
  }), null);
157
157
  }
158
- return A(a, t, s);
158
+ return A(a, o, s);
159
159
  }
160
160
  })), e;
161
- }), C = u(() => {
162
- var e, o, a;
163
- return ((a = (o = (e = l.columns) == null ? void 0 : e.filter((t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !v.includes(t.valueType))) == null ? void 0 : o.sort((t, r) => {
164
- let s = k(t.order);
161
+ }), F = u(() => {
162
+ var e, t, a;
163
+ return ((a = (t = (e = n.columns) == null ? void 0 : e.filter((o) => !o.hideInSearch && o.dataIndex && (o.valueType || o.customRenderFormItem) && !v.includes(o.valueType))) == null ? void 0 : t.sort((o, r) => {
164
+ let s = k(o.order);
165
165
  return k(r.order) - s;
166
- })) == null ? void 0 : a.map((t) => {
167
- const r = me(t, ce(t.fieldProps));
166
+ })) == null ? void 0 : a.map((o) => {
167
+ const r = ce(o, fe(o.fieldProps));
168
168
  return {
169
- ...t,
169
+ ...o,
170
170
  fieldProps: {
171
- label: t.title,
172
- name: t.dataIndex,
171
+ label: o.title,
172
+ name: o.dataIndex,
173
173
  ...r || {},
174
174
  // 格式化placeholder
175
- placeholder: fe(E, t.valueType, r == null ? void 0 : r.placeholder)
175
+ placeholder: ge(E, o.valueType, r == null ? void 0 : r.placeholder)
176
176
  }
177
177
  };
178
178
  })) || [];
179
- }), N = u(() => n(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), D = u(() => n(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
180
- formRef: F,
181
- submit: R,
182
- reset: S,
179
+ }), V = u(() => l(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), N = u(() => l(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
180
+ formRef: b,
181
+ submit: S,
182
+ reset: R,
183
183
  tableProps: i,
184
- handleTableChange: V,
184
+ handleTableChange: D,
185
185
  data: j
186
- } = le({
186
+ } = re({
187
187
  async request(e) {
188
- var a, t;
189
- const o = await ((a = l.request) == null ? void 0 : a.call(l, e));
190
- return (t = l.onLoad) == null || t.call(l, (o == null ? void 0 : o.data) || []), {
191
- data: (o == null ? void 0 : o.data) || [],
192
- total: (o == null ? void 0 : o.total) || 0
188
+ var a, o;
189
+ const t = await ((a = n.request) == null ? void 0 : a.call(n, e));
190
+ return (o = n.onLoad) == null || o.call(n, (t == null ? void 0 : t.data) || []), {
191
+ data: (t == null ? void 0 : t.data) || [],
192
+ total: (t == null ? void 0 : t.total) || 0
193
193
  };
194
194
  },
195
- filterFields: n(D),
196
- sortFields: n(N),
197
- defaultParams: l.params,
198
- defaultData: l.defaultData,
199
- manual: l.manual,
200
- defaultCurrent: l.pagination ? l.pagination.defaultCurrent : void 0,
201
- defaultPageSize: l.pagination ? l.pagination.defaultPageSize : void 0,
202
- formatParams: l.beforeSearchSubmit
195
+ filterFields: l(N),
196
+ sortFields: l(V),
197
+ defaultParams: n.params,
198
+ defaultData: n.defaultData,
199
+ manual: n.manual,
200
+ defaultCurrent: n.pagination ? n.pagination.defaultCurrent : void 0,
201
+ defaultPageSize: n.pagination ? n.pagination.defaultPageSize : void 0,
202
+ formatParams: n.beforeSearchSubmit
203
203
  }), W = u(() => ({
204
- ...l,
205
- ...n(i),
206
- loading: re(l.loading) ? n(i).loading : l.loading,
207
- pagination: l.pagination === !1 ? !1 : n(i).pagination
204
+ ...n,
205
+ ...l(i),
206
+ loading: de(n.loading) ? l(i).loading : n.loading,
207
+ pagination: n.pagination === !1 ? !1 : l(i).pagination
208
208
  }));
209
- function A(e, o, a) {
210
- return v.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(Z.Text, {
209
+ function A(e, t, a) {
210
+ return v.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ee.Text, {
211
211
  copyable: e.copyable ? {
212
- text: o,
212
+ text: t,
213
213
  tooltip: !1
214
214
  } : !1,
215
215
  ellipsis: e.ellipsis ? {
216
- tooltip: o
216
+ tooltip: t
217
217
  } : !1,
218
218
  content: a
219
219
  }, null) : a;
220
220
  }
221
- $(() => n(j).loading, (e) => {
222
- var o;
223
- (o = l.onLoadingChange) == null || o.call(l, e);
221
+ H(() => l(j).loading, (e) => {
222
+ var t;
223
+ (t = n.onLoadingChange) == null || t.call(n, e);
224
224
  });
225
225
  function M(e) {
226
- var o, a, t;
227
- (t = (a = (o = F.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || t.call(a, e);
226
+ var t, a, o;
227
+ (o = (a = (t = b.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || o.call(a, e);
228
+ }
229
+ function _() {
230
+ var e, t, a;
231
+ return (a = (t = (e = b.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
228
232
  }
229
233
  return z({
230
- submit: () => R(),
231
- reset: () => S(),
232
- setSearchFormValues: M
233
- }), (e, o) => (p(), c("div", {
234
- class: b(e.card ? null : n(g)("wrapper"))
235
- }, [e.searchForm !== !1 && C.value.length > 0 ? (p(), c("div", {
234
+ submit: () => S(),
235
+ reset: () => R(),
236
+ setSearchFormValues: M,
237
+ getSearchFormValues: _
238
+ }), (e, t) => (p(), c("div", {
239
+ class: h(e.card ? null : l(g)("wrapper"))
240
+ }, [e.searchForm !== !1 && F.value.length > 0 ? (p(), c("div", {
236
241
  key: 0,
237
- class: b(e.card ? n(h)("search-wrapper") : null),
242
+ class: h(e.card ? l(C)("search-wrapper") : null),
238
243
  style: T(e.searchFormWrapperStyle)
239
- }, [d(n(te).SearchForm, m(e.searchForm || {}, {
244
+ }, [d(l(oe).SearchForm, m(e.searchForm || {}, {
240
245
  ref_key: "formRef",
241
- ref: F,
246
+ ref: b,
242
247
  "custom-reset": "",
243
- onSubmit: n(R),
244
- onReset: n(S),
245
- "submit-loading": n(i).loading
248
+ onSubmit: l(S),
249
+ onReset: l(R),
250
+ "submit-loading": l(i).loading
246
251
  }), {
247
- default: f(() => [(p(!0), c(H, null, x(C.value, (a) => (p(), G(Q(a.customRenderFormItem ? a.customRenderFormItem(a) : n(ne)[a.valueType || "text"]), m({
252
+ default: f(() => [(p(!0), c(G, null, x(F.value, (a) => (p(), Q(U(a.customRenderFormItem ? a.customRenderFormItem(a) : l(ne)[a.valueType || "text"]), m({
248
253
  key: a.dataIndex,
249
254
  ref_for: !0
250
255
  }, a.fieldProps || {}, {
@@ -252,22 +257,22 @@ const he = {
252
257
  }), null, 16, ["span"]))), 128))]),
253
258
  _: 1
254
259
  }, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : B("", !0), P("div", {
255
- class: b(e.card ? n(h)("table-wrapper") : null),
260
+ class: h(e.card ? l(C)("table-wrapper") : null),
256
261
  style: T(e.tableWrapperStyle)
257
- }, [I(e.$slots, "title"), d(n(ee), m({
258
- class: n(L) === "admin" ? n(g)("table-admin") : n(g)("table")
262
+ }, [I(e.$slots, "title"), d(l(ae), m({
263
+ class: l(L) === "admin" ? l(g)("table-admin") : l(g)("table")
259
264
  }, W.value, {
260
- onChange: n(V),
265
+ onChange: l(D),
261
266
  columns: y.value
262
- }), U({
267
+ }), J({
263
268
  headerCell: f(({
264
269
  column: a,
265
- title: t
266
- }) => [a.tooltip ? (p(), c("span", he, [P("span", null, J(t), 1), d(n(ae), {
270
+ title: o
271
+ }) => [a.tooltip ? (p(), c("span", Ce, [P("span", null, X(o), 1), d(l(te), {
267
272
  title: a.tooltip,
268
273
  placement: "bottom"
269
274
  }, {
270
- default: f(() => [d(n(se), {
275
+ default: f(() => [d(l(ue), {
271
276
  style: {
272
277
  color: "#0070ff",
273
278
  "padding-left": "4px"
@@ -276,12 +281,12 @@ const he = {
276
281
  _: 2
277
282
  }, 1032, ["title"])])) : B("", !0)]),
278
283
  _: 2
279
- }, [x(n(de)(e.$slots, "title"), (a, t) => ({
280
- name: t,
281
- fn: f((r) => [I(e.$slots, t, X(Y(r || {})))])
284
+ }, [x(l(se)(e.$slots, "title"), (a, o) => ({
285
+ name: o,
286
+ fn: f((r) => [I(e.$slots, o, Y(Z(r || {})))])
282
287
  }))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
283
288
  }
284
289
  });
285
290
  export {
286
- ze as default
291
+ Ee as default
287
292
  };
@@ -196,9 +196,26 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
196
196
  */
197
197
  size?: 'middle' | 'small';
198
198
  };
199
- export type ApTableExpose = {
199
+ export type ApTableExpose<SearchParamsType = Recordable> = {
200
+ /**
201
+ * 查询表单提交
202
+ */
200
203
  submit: () => void;
204
+ /**
205
+ * 查询表单重置
206
+ */
201
207
  reset: () => void;
208
+ /**
209
+ * 设置查询表单的值
210
+ * @param fields
211
+ * @returns
212
+ */
213
+ setSearchFormValues: (fields: Partial<SearchParamsType>) => void;
214
+ /**
215
+ * 获取查询表单值
216
+ * @returns
217
+ */
218
+ getSearchFormValues: () => Partial<SearchParamsType>;
202
219
  };
203
220
  export type FixedApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = Omit<ApColumnType<ValueType, RecordType>, 'filters'> & {
204
221
  filters?: ColumnType<RecordType>['filters'];
@@ -3,12 +3,12 @@ const n = ["Divider", "BasicTitle"];
3
3
  function p(e) {
4
4
  return n.includes(e || "");
5
5
  }
6
- function d(e, i, r) {
6
+ function a(e, i, r) {
7
7
  Reflect.has(e, "type") || (["DatePicker", "MonthPicker", "WeekPicker", "TimePicker"].includes(
8
8
  i
9
9
  ) ? e.type = r ? "string" : "object" : ["RangePicker", "Upload", "CheckboxGroup", "TimePicker"].includes(i) ? e.type = "array" : ["InputNumber"].includes(i) && (e.type = "number"));
10
10
  }
11
- const a = [
11
+ const l = [
12
12
  "ApiTransfer",
13
13
  "ApiTree",
14
14
  "ApiTreeSelect",
@@ -18,8 +18,8 @@ const a = [
18
18
  "RadioButtonGroup",
19
19
  "ApiSelect"
20
20
  ];
21
- function l(e, i = "", r) {
22
- return e.includes("Input") || e.includes("Complete") ? r("ap.common.inputText") + i : e.includes("Picker") || e.includes("Select") || e.includes("Cascader") || e.includes("Checkbox") || e.includes("Radio") || e.includes("Switch") ? r("ap.common.chooseText") + i : "";
21
+ function d(e, i = "", r) {
22
+ return e.includes("Input") || e.includes("Complete") ? r("ap.common.inputText") : e.includes("Picker") || e.includes("Select") || e.includes("Cascader") || e.includes("Checkbox") || e.includes("Radio") || e.includes("Switch") ? r("ap.common.chooseText") : "";
23
23
  }
24
24
  const u = ["DatePicker", "MonthPicker", "WeekPicker", "TimePicker"];
25
25
  function c() {
@@ -36,12 +36,12 @@ function T(e, i) {
36
36
  return e && s.includes(e) && i && t(i) ? `${i}` : i;
37
37
  }
38
38
  export {
39
- a as NO_AUTO_LINK_COMPONENTS,
40
- l as createPlaceholderMessage,
39
+ l as NO_AUTO_LINK_COMPONENTS,
40
+ d as createPlaceholderMessage,
41
41
  f as dateItemType,
42
42
  s as defaultValueComponents,
43
43
  T as handleInputNumberValue,
44
44
  p as isIncludeSimpleComponents,
45
- d as setComponentRuleType,
45
+ a as setComponentRuleType,
46
46
  n as simpleComponents
47
47
  };
@@ -4,6 +4,9 @@
4
4
  padding: 6px 12px;
5
5
  border-radius: 4px;
6
6
  }
7
+ .ant-alert .ant-alert-close-icon {
8
+ line-height: 18px;
9
+ }
7
10
  .ant-alert .ant-alert-icon {
8
11
  font-size: 16px;
9
12
  transform: translateY(1px);
@@ -4,6 +4,9 @@
4
4
  padding: 6px 12px;
5
5
  border-radius: 4px;
6
6
  }
7
+ .ant-alert .ant-alert-close-icon {
8
+ line-height: 18px;
9
+ }
7
10
  .ant-alert .ant-alert-icon {
8
11
  font-size: 16px;
9
12
  transform: translateY(1px);
@@ -4,6 +4,9 @@
4
4
  padding: 6px 12px;
5
5
  border-radius: 4px;
6
6
  }
7
+ .ant-alert .ant-alert-close-icon {
8
+ line-height: 18px;
9
+ }
7
10
  .ant-alert .ant-alert-icon {
8
11
  font-size: 16px;
9
12
  transform: translateY(1px);
@@ -4,6 +4,9 @@
4
4
  padding: 6px 12px;
5
5
  border-radius: 4px;
6
6
  }
7
+ .ant-alert .ant-alert-close-icon {
8
+ line-height: 18px;
9
+ }
7
10
  .ant-alert .ant-alert-icon {
8
11
  font-size: 16px;
9
12
  transform: translateY(1px);
@@ -1,50 +1,50 @@
1
1
  import { unref as s, markRaw as u } from "vue";
2
2
  import { isUndefined as a } from "lodash-unified";
3
- function p(e) {
4
- return (e == null ? void 0 : e.parentNode) ?? document.body;
3
+ function m(t) {
4
+ return (t == null ? void 0 : t.parentNode) ?? document.body;
5
5
  }
6
- function m(e) {
7
- return typeof e < "u";
6
+ function p(t) {
7
+ return typeof t < "u";
8
8
  }
9
- function d(e) {
10
- const t = {};
11
- return Object.keys(e).map((n) => {
12
- t[n] = s(e[n]);
13
- }), t;
9
+ function d(t) {
10
+ const e = {};
11
+ return Object.keys(t).map((n) => {
12
+ e[n] = s(t[n]);
13
+ }), e;
14
14
  }
15
- function g(e, t = [], n) {
16
- const r = Object.assign({}, e), i = Object.keys(r);
17
- for (let c = 0; c < i.length; c += 1) {
18
- const o = i[c];
19
- (t.includes(o) || n != null && n(o, r[o])) && delete r[o];
15
+ function g(t, e = [], n) {
16
+ const r = Object.assign({}, t), c = Object.keys(r);
17
+ for (let o = 0; o < c.length; o += 1) {
18
+ const i = c[o];
19
+ (e.includes(i) || n != null && n(i, r[i])) && delete r[i];
20
20
  }
21
21
  return r;
22
22
  }
23
- function k(e) {
24
- return /^[A-Z][A-Za-z]*$/.test(e);
23
+ function k(t) {
24
+ return /^[A-Z][A-Za-z]*$/.test(t);
25
25
  }
26
- function f(e) {
27
- if (Array.isArray(e))
28
- return e.map((t) => f(t));
29
- if (typeof e == "object" && e !== null) {
30
- const t = {};
31
- for (const n in e)
32
- t[n] = f(e[n]);
33
- return u(t);
26
+ function f(t) {
27
+ if (Array.isArray(t))
28
+ return t.map((e) => f(e));
29
+ if (typeof t == "object" && t !== null) {
30
+ const e = {};
31
+ for (const n in t)
32
+ e[n] = f(t[n]);
33
+ return u(e);
34
34
  }
35
- return e;
35
+ return t;
36
36
  }
37
- function O(e) {
38
- const t = { ...e };
39
- for (const n of Object.keys(t))
40
- a(t[n]) && delete t[n];
41
- return console.log("copy", t), t;
37
+ function O(t) {
38
+ const e = { ...t };
39
+ for (const n of Object.keys(e))
40
+ a(e[n]) && delete e[n];
41
+ return e;
42
42
  }
43
43
  export {
44
44
  f as convertReactiveToRaw,
45
45
  d as getDynamicProps,
46
- p as getPopupContainer,
47
- m as isDef,
46
+ m as getPopupContainer,
47
+ p as isDef,
48
48
  k as isPascalCase,
49
49
  O as omitUndefined,
50
50
  g as omitWhen
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../date/constant.js");require("../../hooks/index.js");const u=require("lodash-unified"),i=require("dayjs"),b=require("ant-design-vue"),d=require("../date/helper.js"),T=require("@ant-design/icons-vue"),_=require("../../utils/index.js"),M=require("../../hooks/useControllableValue.js"),R=e.defineComponent({__name:"index",props:{mode:{default:"edit"},id:{},defaultPickerValue:{},placeholder:{},disabled:{type:[Boolean,Array],default:void 0},disabledTime:{},presets:{},ranges:{},separator:{type:[Object,String,Number,Boolean,null,Array],default:void 0},allowEmpty:{},onCalendarChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},direction:{},autocomplete:{},activePickerIndex:{},dateRender:{},panelRender:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},allowClear:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},format:{default:"Y-D"},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},inputRender:{},onOpenChange:{},onContextmenu:{},onKeydown:{},role:{},name:{},picker:{},prefixCls:{},disabledDate:{},monthCellRender:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},order:{type:Boolean,default:void 0},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"-"},value:{},defaultValue:{},onChange:{},onOk:{}},emits:["update:value"],setup(k,{emit:B}){const t=k,S=B,l=e.computed(()=>v.ApFieldDatePresetFormats.indexOf(t.format)>-1),r=e.computed(()=>l.value?v.PRESET_FORMAT_MAP[t.format]:t.format),{value:y,updateValue:g}=M.useControllableValue(t,S),c=e.computed(()=>{var o,n;if(!u.isNil(e.unref(y)))return[i((o=e.unref(y))==null?void 0:o[0]),i((n=e.unref(y))==null?void 0:n[1])]}),h=e.computed(()=>e.unref(l)?t.picker??v.PRESET_FORMAT_PICK_MAP[t.format]:t.picker),O=e.computed(()=>{const o=e.unref(l)?v.PRESET_FORMAT_TIME_MAP[t.format]:{};return{..._.omitUndefined(u.omit(t,["value","onUpdate:value","onChange","onOk","format","mode"])),...o}});function D(o){o||g(null);const n=u.isString(o[0])?i(o[0]):o[0],a=u.isString(o[1])?i(o[1]):o[1];e.unref(l)?g([d.formatDay(n,e.unref(r)),d.formatDay(a,e.unref(r),!1)]):g([d.formatValue(n),d.formatValue(a)])}function P(o){var f;const n=u.isString(o[0])?i(o[0]):o[0],a=u.isString(o[1])?i(o[1]):o[1],s=o[0]?e.unref(l)?d.formatDay(n,e.unref(r)):n.valueOf():null,p=o[1]?e.unref(l)?d.formatDay(a,e.unref(r),!1):a.valueOf():null;(f=t.onOk)==null||f.call(t,[s,p])}function C(o,n){var m;const a=u.isString(o[0])?i(o[0]):o[0],s=u.isString(o[1])?i(o[1]):o[1],p=o[0]?e.unref(l)?d.formatDay(a,e.unref(r)):a.valueOf():null,f=o[1]?e.unref(l)?d.formatDay(s,e.unref(r),!1):s.valueOf():null;(m=t.onChange)==null||m.call(t,[p,f],n)}return(o,n)=>{var a,s;return o.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString((a=c.value[0])==null?void 0:a.format(r.value))+" ",1),e.createVNode(e.unref(T.SwapRightOutlined)),e.createTextVNode(" "+e.toDisplayString((s=c.value[1])==null?void 0:s.format(r.value)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(o.emptyText),1)],64))],64)):(e.openBlock(),e.createBlock(e.unref(b.DatePicker).RangePicker,e.mergeProps({key:1},O.value,{value:c.value,"onUpdate:value":D,onChange:C,picker:h.value,format:r.value,onOk:P}),e.createSlots({_:2},[e.renderList(o.$slots,(p,f)=>({name:f,fn:e.withCtx(m=>[e.renderSlot(o.$slots,f,e.normalizeProps(e.guardReactiveProps(m||{})))])}))]),1040,["value","picker","format"]))}}});exports.default=R;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../date/constant.js");require("../../hooks/index.js");const l=require("lodash-unified"),i=require("dayjs"),T=require("ant-design-vue"),d=require("../date/helper.js"),_=require("@ant-design/icons-vue"),M=require("../../utils/index.js"),R=require("../../hooks/useControllableValue.js"),w=e.defineComponent({__name:"index",props:{mode:{default:"edit"},id:{},defaultPickerValue:{},placeholder:{},disabled:{type:[Boolean,Array],default:void 0},disabledTime:{},presets:{},ranges:{},separator:{type:[Object,String,Number,Boolean,null,Array],default:void 0},allowEmpty:{},onCalendarChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},direction:{},autocomplete:{},activePickerIndex:{},dateRender:{},panelRender:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},allowClear:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},format:{default:"Y-D"},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},inputRender:{},onOpenChange:{},onContextmenu:{},onKeydown:{},role:{},name:{},picker:{},prefixCls:{},disabledDate:{},monthCellRender:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},order:{type:Boolean,default:void 0},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"-"},value:{},defaultValue:{},onChange:{},onOk:{}},emits:["update:value"],setup(B,{emit:h}){const t=B,S=h,u=e.computed(()=>v.ApFieldDatePresetFormats.indexOf(t.format)>-1),r=e.computed(()=>u.value?v.PRESET_FORMAT_MAP[t.format]:t.format),{value:y,updateValue:g}=R.useControllableValue(t,S),c=e.computed(()=>{var a,n;const o=e.unref(y);return l.isNil(o)||!(o!=null&&o.length)?o:[i((a=e.unref(y))==null?void 0:a[0]),i((n=e.unref(y))==null?void 0:n[1])]}),O=e.computed(()=>e.unref(u)?t.picker??v.PRESET_FORMAT_PICK_MAP[t.format]:t.picker),C=e.computed(()=>{const o=e.unref(u)?v.PRESET_FORMAT_TIME_MAP[t.format]:{};return{...M.omitUndefined(l.omit(t,["value","onUpdate:value","onChange","onOk","format","mode"])),...o}});function D(o){if(!o){g(o);return}const a=l.isString(o[0])?i(o[0]):o[0],n=l.isString(o[1])?i(o[1]):o[1];e.unref(u)?g([d.formatDay(a,e.unref(r)),d.formatDay(n,e.unref(r),!1)]):g([d.formatValue(a),d.formatValue(n)])}function P(o){var f;const a=l.isString(o[0])?i(o[0]):o[0],n=l.isString(o[1])?i(o[1]):o[1],s=o[0]?e.unref(u)?d.formatDay(a,e.unref(r)):a.valueOf():null,p=o[1]?e.unref(u)?d.formatDay(n,e.unref(r),!1):n.valueOf():null;(f=t.onOk)==null||f.call(t,[s,p])}function b(o,a){var m,k;if(l.isNil(o)){(m=t.onChange)==null||m.call(t,o,a);return}const n=l.isString(o[0])?i(o[0]):o[0],s=l.isString(o[1])?i(o[1]):o[1],p=o[0]?e.unref(u)?d.formatDay(n,e.unref(r)):n.valueOf():null,f=o[1]?e.unref(u)?d.formatDay(s,e.unref(r),!1):s.valueOf():null;(k=t.onChange)==null||k.call(t,[p,f],a)}return(o,a)=>{var n,s;return o.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString((n=c.value[0])==null?void 0:n.format(r.value))+" ",1),e.createVNode(e.unref(_.SwapRightOutlined)),e.createTextVNode(" "+e.toDisplayString((s=c.value[1])==null?void 0:s.format(r.value)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(o.emptyText),1)],64))],64)):(e.openBlock(),e.createBlock(e.unref(T.DatePicker).RangePicker,e.mergeProps({key:1},C.value,{value:c.value,"onUpdate:value":D,onChange:b,picker:O.value,format:r.value,onOk:P}),e.createSlots({_:2},[e.renderList(o.$slots,(p,f)=>({name:f,fn:e.withCtx(m=>[e.renderSlot(o.$slots,f,e.normalizeProps(e.guardReactiveProps(m||{})))])}))]),1040,["value","picker","format"]))}}});exports.default=w;