@aplus-frontend/ui 0.2.10 → 0.2.11

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 (65) hide show
  1. package/es/src/ap-form/ap-form.vue.d.ts +4 -0
  2. package/es/src/ap-form/ap-form.vue2.mjs +131 -108
  3. package/es/src/ap-form/drawer-form/index.vue.d.ts +27 -2
  4. package/es/src/ap-form/drawer-form/index.vue.mjs +43 -37
  5. package/es/src/ap-form/interface.d.ts +8 -0
  6. package/es/src/ap-form/modal-form/index.vue.d.ts +27 -2
  7. package/es/src/ap-form/modal-form/index.vue.mjs +26 -20
  8. package/es/src/ap-form/search-form/index.vue.d.ts +27 -2
  9. package/es/src/ap-form/search-form/index.vue.mjs +37 -31
  10. package/es/src/ap-form/utils/params.d.ts +17 -0
  11. package/es/src/ap-form/utils/params.mjs +19 -0
  12. package/es/src/ap-table/interface.d.ts +1 -0
  13. package/es/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
  14. package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +80 -70
  15. package/es/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
  16. package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +44 -34
  17. package/es/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
  18. package/es/src/business/ap-group-search/extension-select/style/css.js +1 -0
  19. package/es/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
  20. package/es/src/business/ap-group-search/extension-select/style/index.js +1 -0
  21. package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +9 -9
  22. package/es/src/business/ap-group-search/index.d.ts +28 -0
  23. package/es/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
  24. package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +50 -50
  25. package/es/src/business/ap-group-search/popover-select/style/css.js +1 -1
  26. package/es/src/business/ap-group-search/popover-select/style/index.js +1 -1
  27. package/es/src/business/ap-summary/ap-summary.vue2.mjs +58 -38
  28. package/es/src/locale/lang/en.mjs +1 -1
  29. package/es/src/locale/lang/zh-cn.mjs +1 -1
  30. package/es/src/path-map.mjs +2 -1
  31. package/es/src/utils/index.d.ts +12 -0
  32. package/es/src/utils/index.mjs +27 -18
  33. package/lib/src/ap-form/ap-form.vue.d.ts +4 -0
  34. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  35. package/lib/src/ap-form/drawer-form/index.vue.d.ts +27 -2
  36. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  37. package/lib/src/ap-form/interface.d.ts +8 -0
  38. package/lib/src/ap-form/modal-form/index.vue.d.ts +27 -2
  39. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  40. package/lib/src/ap-form/search-form/index.vue.d.ts +27 -2
  41. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  42. package/lib/src/ap-form/utils/params.d.ts +17 -0
  43. package/lib/src/ap-form/utils/params.js +1 -0
  44. package/lib/src/ap-table/interface.d.ts +1 -0
  45. package/lib/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
  46. package/lib/src/business/ap-group-search/ap-group-search.vue2.js +1 -1
  47. package/lib/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
  48. package/lib/src/business/ap-group-search/extension-select/index.vue2.js +1 -1
  49. package/lib/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
  50. package/lib/src/business/ap-group-search/extension-select/style/css.js +1 -0
  51. package/lib/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
  52. package/lib/src/business/ap-group-search/extension-select/style/index.js +1 -0
  53. package/lib/src/business/ap-group-search/images/icon-line-select.vue.js +1 -1
  54. package/lib/src/business/ap-group-search/index.d.ts +28 -0
  55. package/lib/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
  56. package/lib/src/business/ap-group-search/popover-select/index.vue2.js +2 -2
  57. package/lib/src/business/ap-group-search/popover-select/style/css.js +1 -1
  58. package/lib/src/business/ap-group-search/popover-select/style/index.js +1 -1
  59. package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
  60. package/lib/src/locale/lang/en.js +1 -1
  61. package/lib/src/locale/lang/zh-cn.js +1 -1
  62. package/lib/src/path-map.js +1 -1
  63. package/lib/src/utils/index.d.ts +12 -0
  64. package/lib/src/utils/index.js +1 -1
  65. package/package.json +4 -4
@@ -1,11 +1,11 @@
1
1
  import { ApFormModalFormProps } from '../interface';
2
2
  import { VNode, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, PublicProps, CSSProperties } from 'vue';
3
3
  import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
4
+ import { Recordable } from '../../type';
4
5
  import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
5
6
  import { ColSize } from '@aplus-frontend/antdv/es/grid';
6
7
  import { RuleObject } from '@aplus-frontend/antdv/es/form';
7
8
  import { Options } from '../../../node_modules/scroll-into-view-if-needed';
8
- import { Recordable } from '../../type';
9
9
  import { WatchFunc, RegistedFieldType, ApFormInternalInstance, ApFormSubmitterConfig } from '..';
10
10
  import { VueTypeValidableDef } from '../../../node_modules/vue-types';
11
11
  import { LegacyButtonType, ButtonHTMLType } from '@aplus-frontend/antdv/es/button/buttonTypes';
@@ -31,6 +31,7 @@ declare function __VLS_template(): {
31
31
  validateTrigger: string | string[];
32
32
  hideRequiredMark: boolean;
33
33
  validateOnRuleChange: boolean;
34
+ syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
34
35
  }> & Omit<{
35
36
  readonly layout: string;
36
37
  readonly colon: boolean;
@@ -38,6 +39,7 @@ declare function __VLS_template(): {
38
39
  readonly validateTrigger: string | string[];
39
40
  readonly hideRequiredMark: boolean;
40
41
  readonly validateOnRuleChange: boolean;
42
+ readonly syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
41
43
  readonly size?: "small" | "large" | "middle" | undefined;
42
44
  readonly onSubmit?: ((e: Event) => void) | undefined;
43
45
  readonly disabled?: boolean | undefined;
@@ -122,6 +124,7 @@ declare function __VLS_template(): {
122
124
  readonly onFinishFailed?: ((errorInfo: ValidateErrorEntity<any>) => void) | undefined;
123
125
  readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
124
126
  readonly initialValues?: Recordable | undefined;
127
+ readonly syncToUrlPriority?: boolean | undefined;
125
128
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
126
129
  size: {
127
130
  type: PropType<"small" | "large" | "middle">;
@@ -267,7 +270,14 @@ declare function __VLS_template(): {
267
270
  initialValues: {
268
271
  type: PropType<Recordable>;
269
272
  };
270
- }>>, "layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange">;
273
+ syncToUrl: {
274
+ type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
275
+ default: boolean;
276
+ };
277
+ syncToUrlPriority: {
278
+ type: PropType<boolean>;
279
+ };
280
+ }>>, "layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl">;
271
281
  $attrs: {
272
282
  [x: string]: unknown;
273
283
  };
@@ -426,6 +436,13 @@ declare function __VLS_template(): {
426
436
  initialValues: {
427
437
  type: PropType<Recordable>;
428
438
  };
439
+ syncToUrl: {
440
+ type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
441
+ default: boolean;
442
+ };
443
+ syncToUrlPriority: {
444
+ type: PropType<boolean>;
445
+ };
429
446
  }>>, {
430
447
  resetFields: () => Promise<void>;
431
448
  clearValidate: (name?: NamePath | NamePath[]) => void;
@@ -455,6 +472,7 @@ declare function __VLS_template(): {
455
472
  validateTrigger: string | string[];
456
473
  hideRequiredMark: boolean;
457
474
  validateOnRuleChange: boolean;
475
+ syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
458
476
  }, {}, string, {}> & {
459
477
  beforeCreate?: (() => void) | (() => void)[];
460
478
  created?: (() => void) | (() => void)[];
@@ -620,6 +638,13 @@ declare function __VLS_template(): {
620
638
  initialValues: {
621
639
  type: PropType<Recordable>;
622
640
  };
641
+ syncToUrl: {
642
+ type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
643
+ default: boolean;
644
+ };
645
+ syncToUrlPriority: {
646
+ type: PropType<boolean>;
647
+ };
623
648
  }>>, "validate" | "setFieldValue" | "setFieldsValue" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | "registerWatch"> & ShallowUnwrapRef<{
624
649
  resetFields: () => Promise<void>;
625
650
  clearValidate: (name?: NamePath | NamePath[]) => void;
@@ -1,4 +1,4 @@
1
- import { isVNode as q, defineComponent as D, useSlots as L, ref as h, watch as A, cloneVNode as G, computed as I, createVNode as u, mergeProps as p, unref as n, openBlock as F, createElementBlock as W, Fragment as H, withCtx as y, renderSlot as w, createTextVNode as J, toDisplayString as K, createElementVNode as Q, normalizeClass as X, createBlock as x, resolveDynamicComponent as N, createCommentVNode as Y } from "vue";
1
+ import { isVNode as q, defineComponent as D, useSlots as L, ref as g, watch as A, cloneVNode as G, computed as I, createVNode as u, mergeProps as p, unref as n, openBlock as F, createElementBlock as W, Fragment as H, withCtx as h, renderSlot as w, createTextVNode as J, toDisplayString as K, createElementVNode as Q, normalizeClass as X, createBlock as x, resolveDynamicComponent as P, createCommentVNode as Y } from "vue";
2
2
  import { Button as V, Flex as Z, Space as ee, Modal as te } from "@aplus-frontend/antdv";
3
3
  import "../ap-form.vue.mjs";
4
4
  import "../../hooks/index.mjs";
@@ -11,7 +11,7 @@ import { useLocale as ne } from "../../config-provider/hooks/use-locale.mjs";
11
11
  import { useGlobalConfig as se } from "../../config-provider/hooks/use-global-config.mjs";
12
12
  import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
13
13
  import ue from "../ap-form.vue2.mjs";
14
- function P(d) {
14
+ function N(d) {
15
15
  return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !q(d);
16
16
  }
17
17
  const Me = /* @__PURE__ */ D({
@@ -59,6 +59,12 @@ const Me = /* @__PURE__ */ D({
59
59
  onFinishFailed: {},
60
60
  onValidate: {},
61
61
  initialValues: {},
62
+ syncToUrl: {
63
+ type: [Boolean, Function]
64
+ },
65
+ syncToUrlPriority: {
66
+ type: Boolean
67
+ },
62
68
  open: {
63
69
  type: Boolean,
64
70
  default: void 0
@@ -89,7 +95,7 @@ const Me = /* @__PURE__ */ D({
89
95
  expose: S,
90
96
  emit: _
91
97
  }) {
92
- const a = d, b = L(), R = _, o = h(), c = h(), s = h(!1), {
98
+ const a = d, b = L(), R = _, o = g(), c = g(), s = g(!1), {
93
99
  value: M,
94
100
  updateValue: m
95
101
  } = ie(a, R, {
@@ -97,7 +103,7 @@ const Me = /* @__PURE__ */ D({
97
103
  defaultValue: !1
98
104
  }), {
99
105
  t: v
100
- } = ne(), g = se("uiMode", "aplus"), {
106
+ } = ne(), y = se("uiMode", "aplus"), {
101
107
  b: j,
102
108
  e: C
103
109
  } = re("ap-form-modal-form");
@@ -119,14 +125,14 @@ const Me = /* @__PURE__ */ D({
119
125
  e.push(u(V, {
120
126
  onClick: k,
121
127
  disabled: s.value
122
- }, P(i = v("ap.common.cancelText")) ? i : {
128
+ }, N(i = v("ap.common.cancelText")) ? i : {
123
129
  default: () => [i]
124
130
  }));
125
131
  }
126
132
  return ((t = a.submitter) == null ? void 0 : t.resetButtonProps) !== !1 && e.push(u(V, p(((l = a.submitter) == null ? void 0 : l.resetButtonProps) || {}, {
127
133
  key: "submit",
128
134
  disabled: s.value,
129
- onClick: z
135
+ onClick: U
130
136
  }), {
131
137
  default: () => {
132
138
  var i;
@@ -137,7 +143,7 @@ const Me = /* @__PURE__ */ D({
137
143
  key: "submit"
138
144
  }, ((f = a.submitter) == null ? void 0 : f.submitButtonProps) || {}, {
139
145
  loading: s.value,
140
- onClick: E
146
+ onClick: z
141
147
  }), {
142
148
  default: () => {
143
149
  var i;
@@ -145,18 +151,18 @@ const Me = /* @__PURE__ */ D({
145
151
  }
146
152
  })), u(Z, {
147
153
  justify: "flex-end",
148
- class: C(n(g) === "admin" ? "footer-admin" : "footer")
154
+ class: C(n(y) === "admin" ? "footer-admin" : "footer")
149
155
  }, {
150
- default: () => [b.submitter ? b.submitter(e) : u(ee, null, P(e) ? e : {
156
+ default: () => [b.submitter ? b.submitter(e) : u(ee, null, N(e) ? e : {
151
157
  default: () => [e]
152
158
  })]
153
159
  });
154
160
  });
155
- function z() {
161
+ function U() {
156
162
  var e, t, l;
157
163
  a.submitter !== !1 && ((e = o.value) == null || e.resetFields(), (l = (t = a.submitter) == null ? void 0 : t.onReset) == null || l.call(t));
158
164
  }
159
- async function E() {
165
+ async function z() {
160
166
  var e, t, l, r;
161
167
  if (a.submitter !== !1)
162
168
  try {
@@ -177,7 +183,7 @@ const Me = /* @__PURE__ */ D({
177
183
  function k() {
178
184
  n(s) || m(!1);
179
185
  }
180
- function U(e) {
186
+ function E(e) {
181
187
  !e && n(s) || m(e);
182
188
  }
183
189
  return S({
@@ -223,29 +229,29 @@ const Me = /* @__PURE__ */ D({
223
229
  }
224
230
  }), (e, t) => (F(), W(H, null, [u(n(te), p(e.modalProps, {
225
231
  open: n(M),
226
- "onUpdate:open": U,
232
+ "onUpdate:open": E,
227
233
  onCancel: k,
228
234
  footer: null,
229
235
  width: e.width,
230
236
  class: n(j)(),
231
237
  "body-style": {
232
- padding: n(g) === "admin" ? "0px !important" : "20px !important"
238
+ padding: n(y) === "admin" ? "0px !important" : "20px !important"
233
239
  // 这里使用内联样式目的是为了使用最高优先级覆盖设置的全局样式
234
240
  // 使用ModalForm你可能无法再自定义body的样式
235
241
  }
236
242
  }), {
237
- title: y(() => [w(e.$slots, "title", {}, () => [J(K(a.title), 1)])]),
238
- default: y(() => [Q("div", {
239
- class: X(n(C)(n(g) === "admin" ? "content-admin" : "content"))
243
+ title: h(() => [w(e.$slots, "title", {}, () => [J(K(a.title), 1)])]),
244
+ default: h(() => [Q("div", {
245
+ class: X(n(C)(n(y) === "admin" ? "content-admin" : "content"))
240
246
  }, [u(ue, p({
241
247
  ref_key: "formRef",
242
248
  ref: o
243
249
  }, n(ae)(a, ["modalProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
244
- default: y(() => [w(e.$slots, "default")]),
250
+ default: h(() => [w(e.$slots, "default")]),
245
251
  _: 3
246
- }, 16)], 2), (F(), x(N(O.value)))]),
252
+ }, 16)], 2), (F(), x(P(O.value)))]),
247
253
  _: 3
248
- }, 16, ["open", "width", "class", "body-style"]), n(T) ? (F(), x(N(n(T)), {
254
+ }, 16, ["open", "width", "class", "body-style"]), n(T) ? (F(), x(P(n(T)), {
249
255
  key: 0
250
256
  })) : Y("", !0)], 64));
251
257
  }
@@ -1,11 +1,11 @@
1
1
  import { ApFormExpose, ApFormSearchFormProps } from '../interface';
2
2
  import { ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, ComputedRef, PublicProps } from 'vue';
3
3
  import { FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity, NamePath, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
4
+ import { Recordable } from '../../type';
4
5
  import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
5
6
  import { ColSize } from '@aplus-frontend/antdv/es/grid';
6
7
  import { RuleObject } from '@aplus-frontend/antdv/es/form';
7
8
  import { Options } from '../../../node_modules/scroll-into-view-if-needed';
8
- import { Recordable } from '../../type';
9
9
  import { WatchFunc, RegistedFieldType } from '..';
10
10
  declare function __VLS_template(): {
11
11
  slots: Readonly<{
@@ -26,6 +26,7 @@ declare function __VLS_template(): {
26
26
  validateTrigger: string | string[];
27
27
  hideRequiredMark: boolean;
28
28
  validateOnRuleChange: boolean;
29
+ syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
29
30
  }> & Omit<{
30
31
  readonly layout: string;
31
32
  readonly colon: boolean;
@@ -33,6 +34,7 @@ declare function __VLS_template(): {
33
34
  readonly validateTrigger: string | string[];
34
35
  readonly hideRequiredMark: boolean;
35
36
  readonly validateOnRuleChange: boolean;
37
+ readonly syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
36
38
  readonly size?: "small" | "large" | "middle" | undefined;
37
39
  readonly onSubmit?: ((e: Event) => void) | undefined;
38
40
  readonly disabled?: boolean | undefined;
@@ -117,6 +119,7 @@ declare function __VLS_template(): {
117
119
  readonly onFinishFailed?: ((errorInfo: ValidateErrorEntity<any>) => void) | undefined;
118
120
  readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
119
121
  readonly initialValues?: Recordable | undefined;
122
+ readonly syncToUrlPriority?: boolean | undefined;
120
123
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
121
124
  size: {
122
125
  type: PropType<"small" | "large" | "middle">;
@@ -262,7 +265,14 @@ declare function __VLS_template(): {
262
265
  initialValues: {
263
266
  type: PropType<Recordable>;
264
267
  };
265
- }>>, "layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange">;
268
+ syncToUrl: {
269
+ type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
270
+ default: boolean;
271
+ };
272
+ syncToUrlPriority: {
273
+ type: PropType<boolean>;
274
+ };
275
+ }>>, "layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl">;
266
276
  $attrs: {
267
277
  [x: string]: unknown;
268
278
  };
@@ -421,6 +431,13 @@ declare function __VLS_template(): {
421
431
  initialValues: {
422
432
  type: PropType<Recordable>;
423
433
  };
434
+ syncToUrl: {
435
+ type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
436
+ default: boolean;
437
+ };
438
+ syncToUrlPriority: {
439
+ type: PropType<boolean>;
440
+ };
424
441
  }>>, {
425
442
  resetFields: () => Promise<void>;
426
443
  clearValidate: (name?: NamePath | NamePath[]) => void;
@@ -450,6 +467,7 @@ declare function __VLS_template(): {
450
467
  validateTrigger: string | string[];
451
468
  hideRequiredMark: boolean;
452
469
  validateOnRuleChange: boolean;
470
+ syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
453
471
  }, {}, string, {}> & {
454
472
  beforeCreate?: (() => void) | (() => void)[];
455
473
  created?: (() => void) | (() => void)[];
@@ -615,6 +633,13 @@ declare function __VLS_template(): {
615
633
  initialValues: {
616
634
  type: PropType<Recordable>;
617
635
  };
636
+ syncToUrl: {
637
+ type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
638
+ default: boolean;
639
+ };
640
+ syncToUrlPriority: {
641
+ type: PropType<boolean>;
642
+ };
618
643
  }>>, "validate" | "setFieldValue" | "setFieldsValue" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | "registerWatch"> & ShallowUnwrapRef<{
619
644
  resetFields: () => Promise<void>;
620
645
  clearValidate: (name?: NamePath | NamePath[]) => void;
@@ -1,5 +1,5 @@
1
- import { isVNode as ne, defineComponent as le, useSlots as re, ref as se, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ie, createVNode as n, Fragment as _, openBlock as m, createBlock as y, mergeProps as ue, withCtx as B, resolveDynamicComponent as A, createElementBlock as ce, renderList as pe } from "vue";
2
- import { Col as R, Flex as M, Space as de, Button as E, Row as fe } from "@aplus-frontend/antdv";
1
+ import { isVNode as ne, defineComponent as le, useSlots as re, ref as se, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ie, createVNode as n, Fragment as _, openBlock as m, createBlock as y, mergeProps as ue, withCtx as S, resolveDynamicComponent as A, createElementBlock as ce, renderList as pe } from "vue";
2
+ import { Col as B, Flex as M, Space as de, Button as E, Row as fe } from "@aplus-frontend/antdv";
3
3
  import "../ap-form.vue.mjs";
4
4
  import "../item/index.vue2.mjs";
5
5
  import "../../hooks/index.mjs";
@@ -11,14 +11,14 @@ import { isDef as $ } from "../../utils/index.mjs";
11
11
  import { diffFormItem as Ce } from "./utils.mjs";
12
12
  import { useControllableValue as ge } from "../../hooks/useControllableValue.mjs";
13
13
  import { useNamespace as _e } from "../../config-provider/hooks/use-namespace.mjs";
14
- import { useGlobalConfig as Re } from "../../config-provider/hooks/use-global-config.mjs";
15
- import { useLocale as Se } from "../../config-provider/hooks/use-locale.mjs";
14
+ import { useGlobalConfig as Be } from "../../config-provider/hooks/use-global-config.mjs";
15
+ import { useLocale as Fe } from "../../config-provider/hooks/use-locale.mjs";
16
16
  import L from "../item/index.vue.mjs";
17
- import Fe from "../ap-form.vue2.mjs";
18
- function Be(h) {
17
+ import Re from "../ap-form.vue2.mjs";
18
+ function Se(h) {
19
19
  return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !ne(h);
20
20
  }
21
- const i = 24, qe = /* @__PURE__ */ le({
21
+ const i = 24, We = /* @__PURE__ */ le({
22
22
  name: "ApFormSearchForm",
23
23
  __name: "index",
24
24
  props: {
@@ -65,6 +65,12 @@ const i = 24, qe = /* @__PURE__ */ le({
65
65
  onFinishFailed: {},
66
66
  onValidate: {},
67
67
  initialValues: {},
68
+ syncToUrl: {
69
+ type: [Boolean, Function]
70
+ },
71
+ syncToUrlPriority: {
72
+ type: Boolean
73
+ },
68
74
  collapse: {
69
75
  type: Boolean,
70
76
  default: void 0
@@ -98,23 +104,23 @@ const i = 24, qe = /* @__PURE__ */ le({
98
104
  },
99
105
  emits: ["update:collapse"],
100
106
  setup(h, {
101
- expose: W,
102
- emit: q
107
+ expose: U,
108
+ emit: W
103
109
  }) {
104
110
  var N;
105
- const s = re(), a = h, z = q, {
111
+ const s = re(), a = h, q = W, {
106
112
  value: u,
107
- updateValue: H
108
- } = ge(a, z, {
113
+ updateValue: z
114
+ } = ge(a, q, {
109
115
  valuePropName: "collapse",
110
116
  defaultValuePropName: "defaultCollapse"
111
117
  }), {
112
- b: U
113
- } = _e("ap-form-search-form"), G = Re("uiMode"), {
118
+ b: H
119
+ } = _e("ap-form-search-form"), G = Be("uiMode"), {
114
120
  t: b
115
- } = Se(), C = se();
121
+ } = Fe(), C = se();
116
122
  function J() {
117
- H(!o(u));
123
+ z(!o(u));
118
124
  }
119
125
  function K() {
120
126
  var e, t;
@@ -125,17 +131,17 @@ const i = 24, qe = /* @__PURE__ */ le({
125
131
  a.customReset || (t = (e = C.value) == null ? void 0 : e.resetFields) == null || t.call(e), (l = a.onReset) == null || l.call(a);
126
132
  }
127
133
  let v = [];
128
- const S = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / a.countPerRow));
134
+ const F = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / a.countPerRow));
129
135
  j(() => s.default(), (e) => {
130
- v = S.value, S.value = Ce(v, D(e));
136
+ v = F.value, F.value = Ce(v, D(e));
131
137
  }), j(() => {
132
138
  var e;
133
139
  return (e = s.extra) == null ? void 0 : e.call(s);
134
140
  }, (e) => {
135
141
  p.value = e;
136
142
  });
137
- const X = (e) => $(e) ? (he(e) ? e : [e]).join("") : Date.now(), F = g(() => {
138
- const e = S.value, t = [], l = [], r = o(w);
143
+ const X = (e) => $(e) ? (he(e) ? e : [e]).join("") : Date.now(), R = g(() => {
144
+ const e = F.value, t = [], l = [], r = o(w);
139
145
  let d = 0;
140
146
  e.forEach((c) => {
141
147
  const f = c.props;
@@ -168,7 +174,7 @@ const i = 24, qe = /* @__PURE__ */ le({
168
174
  };
169
175
  }), Y = g(() => {
170
176
  let e;
171
- const t = o(F), l = n(R, {
177
+ const t = o(R), l = n(B, {
172
178
  span: o(w),
173
179
  key: "actionWrapper"
174
180
  }, {
@@ -198,37 +204,37 @@ const i = 24, qe = /* @__PURE__ */ le({
198
204
  }), a.extraInAction ? o(p) : null]
199
205
  })]
200
206
  })]
201
- }), r = !a.extraInAction && o(p) ? n(R, {
207
+ }), r = !a.extraInAction && o(p) ? n(B, {
202
208
  span: o(u) ? t.actualExtraSpan : t.defaultExtraSpan,
203
209
  key: "extraNode"
204
210
  }, {
205
211
  default: () => [n(L, null, {
206
212
  default: () => [n(M, {
207
213
  justify: !o(u) && (t.defaultExtraSpan === i || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
208
- }, Be(e = o(p)) ? e : {
214
+ }, Se(e = o(p)) ? e : {
209
215
  default: () => [e]
210
216
  })]
211
217
  })]
212
- }) : null, d = n(R, {
218
+ }) : null, d = n(B, {
213
219
  span: t.defaultExtraSpan
214
220
  }, null);
215
221
  return !o(u) && t.lastRowOnlyIncludeActionAndExtra ? n(_, null, [r || d, l]) : n(_, null, [l, r]);
216
222
  });
217
- return W({
223
+ return U({
218
224
  apForm: g(() => o(C))
219
- }), (e, t) => (m(), y(Fe, ue({
220
- class: o(U)(),
225
+ }), (e, t) => (m(), y(Re, ue({
226
+ class: o(H)(),
221
227
  ref_key: "apForm",
222
228
  ref: C
223
229
  }, o(ye)(a, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
224
- default: B(() => [(m(), y(A(F.value.hideNode))), n(o(fe), {
230
+ default: S(() => [(m(), y(A(R.value.hideNode))), n(o(fe), {
225
231
  gutter: 16
226
232
  }, {
227
- default: B(() => [(m(!0), ce(_, null, pe(F.value.nodes, (l) => (m(), y(o(R), {
233
+ default: S(() => [(m(!0), ce(_, null, pe(R.value.nodes, (l) => (m(), y(o(B), {
228
234
  key: l.key,
229
235
  span: l.span
230
236
  }, {
231
- default: B(() => [(m(), y(A(l.node)))]),
237
+ default: S(() => [(m(), y(A(l.node)))]),
232
238
  _: 2
233
239
  }, 1032, ["span"]))), 128)), (m(), y(A(Y.value)))]),
234
240
  _: 1
@@ -238,5 +244,5 @@ const i = 24, qe = /* @__PURE__ */ le({
238
244
  }
239
245
  });
240
246
  export {
241
- qe as default
247
+ We as default
242
248
  };
@@ -0,0 +1,17 @@
1
+ import { Recordable } from '../../type';
2
+ import { ApFormProps } from '../interface';
3
+ import { UrlParams } from '@vueuse/core';
4
+ /**
5
+ * 获取查询参数
6
+ * @param syncToUrl
7
+ * @param params
8
+ * @param type
9
+ * @returns
10
+ */
11
+ export declare function genParams(syncToUrl: ApFormProps['syncToUrl'], params: Recordable, type: 'get' | 'set'): any;
12
+ /**
13
+ * 设置表单数据到url查询参数(覆盖模式)
14
+ * @param ins
15
+ * @param params
16
+ */
17
+ export declare function setToParams(ins: UrlParams, params: Recordable): void;
@@ -0,0 +1,19 @@
1
+ import { runFunction as r } from "../../utils/index.mjs";
2
+ function u(o, t, e) {
3
+ return o === !0 ? t : r(o, t, e);
4
+ }
5
+ function c(o) {
6
+ const t = Object.keys(o);
7
+ for (const e of t)
8
+ o[e] = null;
9
+ }
10
+ function i(o, t) {
11
+ c(o);
12
+ const e = Object.keys(t);
13
+ for (const n of e)
14
+ t[n] != null && (o[n] = t[n]);
15
+ }
16
+ export {
17
+ u as genParams,
18
+ i as setToParams
19
+ };
@@ -336,6 +336,7 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
336
336
  reset: () => void;
337
337
  /**
338
338
  * 刷新表格数据
339
+ * @description 请注意,此方法会缓存查询参数,也就意味着表单项异步初始值可能不会生效
339
340
  * @returns
340
341
  */
341
342
  refresh: () => void;
@@ -9,7 +9,9 @@ declare function __VLS_template(): {
9
9
  key: SelectValue;
10
10
  }): any;
11
11
  };
12
- refs: {};
12
+ refs: {
13
+ containerRef: HTMLDivElement;
14
+ };
13
15
  attrs: Partial<{}>;
14
16
  };
15
17
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;