@aplus-frontend/ui 0.5.13 → 0.5.14

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.
@@ -13,6 +13,6 @@ export type ApButtonSlots = {
13
13
  };
14
14
  export type ApConfirButtonProps = ApButtonProps & {
15
15
  title: ModalFuncProps['title'];
16
- content: ModalFuncProps['content'];
16
+ content?: ModalFuncProps['content'];
17
17
  confirmProps?: ModalFuncProps;
18
18
  };
@@ -3,7 +3,7 @@ import { InputFocusOptions } from '@aplus-frontend/antdv/es/vc-input/utils/commo
3
3
  import { ApFormatPresetType } from './date/interface';
4
4
  import { RangeValue } from '@aplus-frontend/antdv/es/vc-picker/interface';
5
5
  import { RangePickerProps } from '@aplus-frontend/antdv/es/date-picker/dayjs';
6
- import { LiteralUnion } from '../type';
6
+ import { LiteralUnion, Recordable } from '../type';
7
7
  import { InputPasswordProps } from './text/input-password-props';
8
8
  import { ZoneAlias } from '@aplus-frontend/utils';
9
9
  export type FieldMode = 'read' | 'edit';
@@ -114,7 +114,7 @@ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'va
114
114
  };
115
115
  export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
116
116
  emptyText?: string;
117
- request?: (value?: string) => Promise<SelectProps['options']>;
117
+ request?: (value?: string, extraParams?: Recordable) => Promise<SelectProps['options']>;
118
118
  multiple?: boolean;
119
119
  value?: SelectProps['value'];
120
120
  'onUpdate:value'?: SelectProps['onUpdate:value'];
@@ -134,6 +134,14 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
134
134
  * 添加一个名为全部的节点(只在多选的情况下有效)
135
135
  */
136
136
  addAll?: boolean | number;
137
+ /**
138
+ * 发起request额外的请求,变更后会自动重新发器请求
139
+ */
140
+ params?: Recordable;
141
+ /**
142
+ * 发起搜索的时间间隔默认300ms
143
+ */
144
+ searchDelay?: number;
137
145
  };
138
146
  export type ApFieldSelectExpose = {
139
147
  focus: () => void;
@@ -464,6 +464,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
464
464
  emptyText: string;
465
465
  searchMode: "filter" | "request";
466
466
  refetchOnFocus: boolean;
467
+ searchDelay: number;
467
468
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
468
469
  selectRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
469
470
  value: {
@@ -1,12 +1,11 @@
1
- import { defineComponent as z, ref as B, onMounted as D, computed as f, unref as n, createElementBlock as E, createBlock as K, openBlock as C, toDisplayString as H, mergeProps as $, createSlots as j, renderList as W, withCtx as F, renderSlot as Y, normalizeProps as G, guardReactiveProps as J, createVNode as Q } from "vue";
2
- import { debounce as X, isFunction as b, isArray as Z, isNil as ee, omit as te } from "lodash-unified";
3
- import { Select as oe, Spin as le } from "@aplus-frontend/antdv";
1
+ import { defineComponent as z, ref as B, onMounted as E, watch as U, computed as p, unref as a, createElementBlock as K, createBlock as H, openBlock as C, toDisplayString as $, mergeProps as j, createSlots as W, renderList as Y, withCtx as F, renderSlot as G, normalizeProps as J, guardReactiveProps as Q, createVNode as X } from "vue";
2
+ import { debounce as Z, isFunction as b, isArray as ee, isNil as te, omit as oe } from "lodash-unified";
3
+ import { Select as le, Spin as ae } from "@aplus-frontend/antdv";
4
4
  import "../../hooks/index.mjs";
5
- import { omitUndefined as ne } from "../../utils/index.mjs";
6
- import { useDefaultPlaceholder as ae } from "../hooks/use-default-placeholder.mjs";
7
- import { useSelectOptions as re, SELECT_ALL_VALUE_KEY as p } from "./use-select-options.mjs";
5
+ import { useDefaultPlaceholder as ne } from "../hooks/use-default-placeholder.mjs";
6
+ import { useSelectOptions as re, SELECT_ALL_VALUE_KEY as m } from "./use-select-options.mjs";
8
7
  import { useControllableValue as ue } from "../../hooks/useControllableValue.mjs";
9
- const ie = { key: 0 }, ye = /* @__PURE__ */ z({
8
+ const ie = { key: 0 }, he = /* @__PURE__ */ z({
10
9
  name: "ApFieldSelect",
11
10
  __name: "index",
12
11
  props: {
@@ -93,34 +92,34 @@ const ie = { key: 0 }, ye = /* @__PURE__ */ z({
93
92
  searchMode: { default: "filter" },
94
93
  refetchOnFocus: { type: Boolean, default: !1 },
95
94
  lazy: { type: Boolean, default: !1 },
96
- addAll: { type: [Boolean, Number] }
95
+ addAll: { type: [Boolean, Number] },
96
+ params: {},
97
+ searchDelay: { default: 300 }
97
98
  },
98
99
  emits: ["update:value"],
99
100
  setup(N, { expose: O, emit: A }) {
100
101
  let u = 0;
101
- const V = X((e) => {
102
- if (!b(t.request))
102
+ const e = N, V = Z((t) => {
103
+ if (!b(e.request))
103
104
  return;
104
105
  u += 1;
105
106
  const o = u;
106
- s([]), r.value = !0, t.request(e).then((l) => {
107
- u === o && s(l);
108
- }).finally(() => {
109
- r.value = !1;
107
+ s([]), r.value = !0, e.request(t).then((l) => {
108
+ u === o && (s(l), r.value = !1);
110
109
  });
111
- }, 300), t = N, x = (e, o) => {
112
- var a;
113
- const l = ((a = t.fieldNames) == null ? void 0 : a.label) || "label";
114
- return typeof (o == null ? void 0 : o[l]) == "string" && o[l].toLowerCase().indexOf(e.toLowerCase()) > -1;
115
- }, { options: i, updateOptions: s } = re(t), m = B(), r = B((t == null ? void 0 : t.loading) || !1), I = A;
116
- async function v(e = !0) {
117
- if (!b(t.request))
110
+ }, e.searchDelay), x = (t, o) => {
111
+ var n;
112
+ const l = ((n = e.fieldNames) == null ? void 0 : n.label) || "label";
113
+ return typeof (o == null ? void 0 : o[l]) == "string" && o[l].toLowerCase().indexOf(t.toLowerCase()) > -1;
114
+ }, { options: i, updateOptions: s } = re(e), v = B(), r = B((e == null ? void 0 : e.loading) || !1), I = A;
115
+ async function d(t = !0) {
116
+ if (!b(e.request))
118
117
  return;
119
118
  r.value = !0, u += 1;
120
119
  const o = u;
121
120
  try {
122
- e && s([]);
123
- const l = await t.request();
121
+ t && s([]);
122
+ const l = await e.request(void 0, e.params);
124
123
  if (o !== u)
125
124
  return;
126
125
  s(l);
@@ -128,115 +127,121 @@ const ie = { key: 0 }, ye = /* @__PURE__ */ z({
128
127
  r.value = !1;
129
128
  }
130
129
  }
131
- function P(e) {
130
+ function P(t) {
132
131
  var o;
133
- (o = t.onFocus) == null || o.call(t, e), t.refetchOnFocus && u > 0 && !r.value && v(!0);
132
+ (o = e.onFocus) == null || o.call(e, t), e.refetchOnFocus && u > 0 && !r.value && d(!0);
134
133
  }
135
- D(() => {
136
- t.lazy || v();
137
- });
138
- const { value: d, updateValue: h } = ue(t, I), k = ae("Select", t), L = f(() => {
139
- var c, g;
140
- const e = n(d);
141
- if (!e)
142
- return t.emptyText;
143
- const o = ((c = t.fieldNames) == null ? void 0 : c.label) || "label", l = ((g = t.fieldNames) == null ? void 0 : g.value) || "value";
144
- if (Z(e))
145
- return e.map(
134
+ E(() => {
135
+ e.lazy || d();
136
+ }), U(
137
+ () => e.params,
138
+ () => {
139
+ d();
140
+ },
141
+ {
142
+ deep: !0
143
+ }
144
+ );
145
+ const { value: c, updateValue: h } = ue(e, I), k = ne("Select", e), L = p(() => {
146
+ var f, g;
147
+ const t = a(c);
148
+ if (!t)
149
+ return e.emptyText;
150
+ const o = ((f = e.fieldNames) == null ? void 0 : f.label) || "label", l = ((g = e.fieldNames) == null ? void 0 : g.value) || "value";
151
+ if (ee(t))
152
+ return t.map(
146
153
  (y) => {
147
154
  var w;
148
- return (w = n(i).find((U) => U[l] === y)) == null ? void 0 : w[o];
155
+ return (w = a(i).find((R) => R[l] === y)) == null ? void 0 : w[o];
149
156
  }
150
- ).filter(Boolean).join("、") || t.emptyText;
151
- const a = n(i).find(
152
- (y) => y[l] === e
157
+ ).filter(Boolean).join("、") || e.emptyText;
158
+ const n = a(i).find(
159
+ (y) => y[l] === t
153
160
  );
154
- return (a == null ? void 0 : a[o]) || t.emptyText;
155
- }), T = f(() => {
156
- const e = !!(t != null && t.showSearch), o = t.searchMode;
161
+ return (n == null ? void 0 : n[o]) || e.emptyText;
162
+ }), T = p(() => {
163
+ const t = !!(e != null && e.showSearch), o = e.searchMode;
157
164
  let l = {};
158
- return e && (l = o === "request" ? {
165
+ return t && (l = o === "request" ? {
159
166
  showArrow: !1,
160
167
  defaultActiveFirstOption: !1,
161
168
  onSearch: V,
162
169
  notFoundContent: r.value ? void 0 : null
163
170
  } : {
164
171
  showArrow: !0,
165
- filterOption: ee(t == null ? void 0 : t.filterOption) ? x : t == null ? void 0 : t.filterOption
172
+ filterOption: te(e == null ? void 0 : e.filterOption) ? x : e == null ? void 0 : e.filterOption
166
173
  }), {
167
- ...ne(
168
- te(t, [
169
- "mode",
170
- "value",
171
- "onUpdate:value",
172
- "onSearch",
173
- "request",
174
- "searchMode",
175
- "onFocus",
176
- "onBeforeSelect"
177
- ])
178
- ),
179
- placeholder: n(k),
174
+ ...oe(e, [
175
+ "mode",
176
+ "value",
177
+ "onUpdate:value",
178
+ "onSearch",
179
+ "request",
180
+ "searchMode",
181
+ "onFocus",
182
+ "onBeforeSelect"
183
+ ]),
184
+ placeholder: a(k),
180
185
  ...l
181
186
  };
182
- }), S = f(
183
- () => i.value.map((e) => {
187
+ }), S = p(
188
+ () => i.value.map((t) => {
184
189
  var o;
185
- return e[((o = t.fieldNames) == null ? void 0 : o.value) || "value"];
186
- }).filter((e) => e !== p)
187
- ), _ = f(() => {
188
- if (!t.multiple || !t.addAll)
189
- return n(d);
190
+ return t[((o = e.fieldNames) == null ? void 0 : o.value) || "value"];
191
+ }).filter((t) => t !== m)
192
+ ), _ = p(() => {
193
+ if (!e.multiple || !e.addAll)
194
+ return a(c);
190
195
  if (i.value.some(
191
- (e) => {
196
+ (t) => {
192
197
  var o;
193
- return e[((o = t.fieldNames) == null ? void 0 : o.value) || "value"] === p;
198
+ return t[((o = e.fieldNames) == null ? void 0 : o.value) || "value"] === m;
194
199
  }
195
200
  )) {
196
- const e = n(S), o = n(d) || [];
197
- if (e.length && e.every((l) => o == null ? void 0 : o.includes(l)))
198
- return [p];
201
+ const t = a(S), o = a(c) || [];
202
+ if (t.length && t.every((l) => o == null ? void 0 : o.includes(l)))
203
+ return [m];
199
204
  }
200
- return n(d);
205
+ return a(c);
201
206
  });
202
- function q(e) {
203
- return t.multiple && e.includes(p) ? h(n(S)) : h(e);
207
+ function q(t) {
208
+ return e.multiple && t.includes(m) ? h(a(S)) : h(t);
204
209
  }
205
210
  function M() {
206
- var e;
207
- (e = m.value) == null || e.focus();
211
+ var t;
212
+ (t = v.value) == null || t.focus();
208
213
  }
209
- function R() {
210
- var e;
211
- (e = m.value) == null || e.blur();
214
+ function D() {
215
+ var t;
216
+ (t = v.value) == null || t.blur();
212
217
  }
213
218
  return O({
214
219
  focus: M,
215
- blur: R,
216
- request: v
217
- }), (e, o) => e.mode === "read" ? (C(), E("span", ie, H(L.value), 1)) : (C(), K(n(oe), $({
220
+ blur: D,
221
+ request: d
222
+ }), (t, o) => t.mode === "read" ? (C(), K("span", ie, $(L.value), 1)) : (C(), H(a(le), j({
218
223
  key: 1,
219
224
  ref_key: "selectRef",
220
- ref: m,
225
+ ref: v,
221
226
  "allow-clear": ""
222
227
  }, T.value, {
223
- mode: e.multiple ? "multiple" : void 0,
228
+ mode: t.multiple ? "multiple" : void 0,
224
229
  value: _.value,
225
- options: n(i),
230
+ options: a(i),
226
231
  loading: r.value,
227
232
  "onUpdate:value": q,
228
233
  onFocus: P
229
- }), j({ _: 2 }, [
230
- W(e.$slots, (l, a) => ({
231
- name: a,
232
- fn: F((c) => [
233
- Y(e.$slots, a, G(J(c || {})))
234
+ }), W({ _: 2 }, [
235
+ Y(t.$slots, (l, n) => ({
236
+ name: n,
237
+ fn: F((f) => [
238
+ G(t.$slots, n, J(Q(f || {})))
234
239
  ])
235
240
  })),
236
241
  r.value ? {
237
242
  name: "notFoundContent",
238
243
  fn: F(() => [
239
- Q(n(le), { size: "small" })
244
+ X(a(ae), { size: "small" })
240
245
  ]),
241
246
  key: "0"
242
247
  } : void 0
@@ -244,5 +249,5 @@ const ie = { key: 0 }, ye = /* @__PURE__ */ z({
244
249
  }
245
250
  });
246
251
  export {
247
- ye as default
252
+ he as default
248
253
  };
@@ -1,11 +1,12 @@
1
- import { Modal as a } from "@aplus-frontend/antdv";
1
+ import { Modal as c } from "@aplus-frontend/antdv";
2
2
  import "./utils/index.mjs";
3
3
  import { omit as m } from "lodash-unified";
4
+ import t, { withWarn as f, withInfo as a, withSuccess as s, withError as l, withConfirm as u } from "./utils/confirm.mjs";
5
+ import i from "./utils/destroyFns.mjs";
4
6
  import "./interface.mjs";
5
- import { createModal as e } from "./utils/createModal.mjs";
6
- import { createModalStream as n } from "./utils/createModalStream.mjs";
7
- import { methodsFn as o } from "./utils/methods.mjs";
8
- const r = m(a, [
7
+ import { createModal as p } from "./utils/createModal.mjs";
8
+ import { createModalStream as d } from "./utils/createModalStream.mjs";
9
+ const o = m(c, [
9
10
  "confirm",
10
11
  "warning",
11
12
  "warn",
@@ -13,15 +14,32 @@ const r = m(a, [
13
14
  "success",
14
15
  "info"
15
16
  ]);
16
- r.createModal = e;
17
- r.createModalStream = n;
18
- r.confirm = o("confirm");
19
- r.warning = o("warning");
20
- r.warn = o("warning");
21
- r.error = o("error");
22
- r.success = o("success");
23
- r.info = o("info");
24
- r.name = "ApModal";
17
+ o.createModal = p;
18
+ o.createModalStream = d;
19
+ function e(n) {
20
+ return t(f(n));
21
+ }
22
+ o.info = function(r) {
23
+ return t(a(r));
24
+ };
25
+ o.success = function(r) {
26
+ return t(s(r));
27
+ };
28
+ o.error = function(r) {
29
+ return t(l(r));
30
+ };
31
+ o.warning = e;
32
+ o.warn = e;
33
+ o.confirm = function(r) {
34
+ return t(u(r));
35
+ };
36
+ o.destroyAll = function() {
37
+ for (; i.length; ) {
38
+ const r = i.pop();
39
+ r && r();
40
+ }
41
+ };
42
+ o.name = "ApModal";
25
43
  export {
26
- r as ApModal
44
+ o as ApModal
27
45
  };
@@ -0,0 +1,17 @@
1
+ import { ModalFuncProps } from '@aplus-frontend/antdv';
2
+ type ConfigUpdate = ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps);
3
+ export type ModalStaticFunctions<T = ModalFunc> = Record<NonNullable<ModalFuncProps['type']>, T>;
4
+ export type ModalFunc = (props: ModalFuncProps) => {
5
+ destroy: () => void;
6
+ update: (configUpdate: ConfigUpdate) => void;
7
+ };
8
+ declare const confirm: (config: ModalFuncProps) => {
9
+ destroy: (this: /*elided*/ any, ...args: any[]) => void;
10
+ update: (configUpdate: ConfigUpdate) => void;
11
+ };
12
+ export default confirm;
13
+ export declare function withWarn(props: ModalFuncProps): ModalFuncProps;
14
+ export declare function withInfo(props: ModalFuncProps): ModalFuncProps;
15
+ export declare function withSuccess(props: ModalFuncProps): ModalFuncProps;
16
+ export declare function withError(props: ModalFuncProps): ModalFuncProps;
17
+ export declare function withConfirm(props: ModalFuncProps): ModalFuncProps;
@@ -0,0 +1,110 @@
1
+ import { render as s, cloneVNode as h, createVNode as a, mergeProps as m } from "vue";
2
+ import P from "@aplus-frontend/antdv/es/modal/ConfirmDialog";
3
+ import { omit as b } from "lodash-unified";
4
+ import "../../config-provider/index.mjs";
5
+ import { getConfirmLocale as w } from "@aplus-frontend/antdv/es/modal/locale";
6
+ import { globalConfigForApi as v } from "@aplus-frontend/antdv/es/config-provider";
7
+ import c from "./destroyFns.mjs";
8
+ import { globalConfigCached as D, ConfigProvider as F } from "../../config-provider/config-provider.mjs";
9
+ const A = (e) => {
10
+ const f = document.createDocumentFragment();
11
+ let n = {
12
+ ...b(e, ["parentContext", "appContext"]),
13
+ close: l,
14
+ open: !0,
15
+ centered: !0
16
+ }, i = null;
17
+ function x(...t) {
18
+ i && (s(null, f), i = null);
19
+ const r = t.some((o) => o && o.triggerCancel);
20
+ e.onCancel && r && e.onCancel(() => {
21
+ }, ...t.slice(1));
22
+ for (let o = 0; o < c.length; o++)
23
+ if (c[o] === l) {
24
+ c.splice(o, 1);
25
+ break;
26
+ }
27
+ }
28
+ function l(...t) {
29
+ n = {
30
+ ...n,
31
+ open: !1,
32
+ afterClose: () => {
33
+ typeof e.afterClose == "function" && e.afterClose(), x.apply(this, t);
34
+ }
35
+ }, n.visible && delete n.visible, p(n);
36
+ }
37
+ function p(t) {
38
+ typeof t == "function" ? n = t(n) : n = {
39
+ ...n,
40
+ ...t
41
+ }, i && s(h(i, {
42
+ ...n
43
+ }), f);
44
+ }
45
+ const d = (t) => {
46
+ const r = {
47
+ ...v,
48
+ ...D.value
49
+ }, o = r.prefixCls, u = t.prefixCls || `${o}-modal`, g = r.iconPrefixCls, C = w();
50
+ return a(F, m(r, {
51
+ prefixCls: o
52
+ }), {
53
+ default: () => [a(P, m(t, {
54
+ rootPrefixCls: o,
55
+ prefixCls: u,
56
+ iconPrefixCls: g,
57
+ locale: C,
58
+ cancelText: t.cancelText || C.cancelText
59
+ }), null)]
60
+ });
61
+ };
62
+ function y(t) {
63
+ const r = a(d, {
64
+ ...t
65
+ });
66
+ return r.appContext = e.parentContext || e.appContext || r.appContext, s(r, f), r;
67
+ }
68
+ return i = y(n), c.push(l), {
69
+ destroy: l,
70
+ update: p
71
+ };
72
+ };
73
+ function E(e) {
74
+ return {
75
+ ...e,
76
+ type: "warning"
77
+ };
78
+ }
79
+ function S(e) {
80
+ return {
81
+ ...e,
82
+ type: "info"
83
+ };
84
+ }
85
+ function j(e) {
86
+ return {
87
+ ...e,
88
+ type: "success"
89
+ };
90
+ }
91
+ function q(e) {
92
+ return {
93
+ ...e,
94
+ type: "error"
95
+ };
96
+ }
97
+ function z(e) {
98
+ return {
99
+ ...e,
100
+ type: "confirm"
101
+ };
102
+ }
103
+ export {
104
+ A as default,
105
+ z as withConfirm,
106
+ q as withError,
107
+ S as withInfo,
108
+ j as withSuccess,
109
+ E as withWarn
110
+ };
@@ -86,7 +86,8 @@ const J = (c) => {
86
86
  },
87
87
  open: this.open,
88
88
  onCancel: this.handleCancel,
89
- onOk: this.handleOk
89
+ onOk: this.handleOk,
90
+ centered: !0
90
91
  }, e), {
91
92
  default: () => {
92
93
  var o;
@@ -0,0 +1,2 @@
1
+ declare const destroyFns: Array<() => void>;
2
+ export default destroyFns;
@@ -0,0 +1,4 @@
1
+ const s = [];
2
+ export {
3
+ s as default
4
+ };
@@ -2616,6 +2616,7 @@ export declare const apTableRenderItemMap: {
2616
2616
  emptyText: string;
2617
2617
  searchMode: "filter" | "request";
2618
2618
  refetchOnFocus: boolean;
2619
+ searchDelay: number;
2619
2620
  }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
2620
2621
  selectRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
2621
2622
  value: {
@@ -3053,6 +3054,7 @@ export declare const apTableRenderItemMap: {
3053
3054
  emptyText: string;
3054
3055
  searchMode: "filter" | "request";
3055
3056
  refetchOnFocus: boolean;
3057
+ searchDelay: number;
3056
3058
  }>;
3057
3059
  __isFragment?: never;
3058
3060
  __isTeleport?: never;
@@ -3085,6 +3087,7 @@ export declare const apTableRenderItemMap: {
3085
3087
  emptyText: string;
3086
3088
  searchMode: "filter" | "request";
3087
3089
  refetchOnFocus: boolean;
3090
+ searchDelay: number;
3088
3091
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
3089
3092
  $slots: Readonly<{
3090
3093
  notFoundContent: any;
@@ -13,6 +13,6 @@ export type ApButtonSlots = {
13
13
  };
14
14
  export type ApConfirButtonProps = ApButtonProps & {
15
15
  title: ModalFuncProps['title'];
16
- content: ModalFuncProps['content'];
16
+ content?: ModalFuncProps['content'];
17
17
  confirmProps?: ModalFuncProps;
18
18
  };
@@ -3,7 +3,7 @@ import { InputFocusOptions } from '@aplus-frontend/antdv/es/vc-input/utils/commo
3
3
  import { ApFormatPresetType } from './date/interface';
4
4
  import { RangeValue } from '@aplus-frontend/antdv/es/vc-picker/interface';
5
5
  import { RangePickerProps } from '@aplus-frontend/antdv/es/date-picker/dayjs';
6
- import { LiteralUnion } from '../type';
6
+ import { LiteralUnion, Recordable } from '../type';
7
7
  import { InputPasswordProps } from './text/input-password-props';
8
8
  import { ZoneAlias } from '@aplus-frontend/utils';
9
9
  export type FieldMode = 'read' | 'edit';
@@ -114,7 +114,7 @@ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'va
114
114
  };
115
115
  export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
116
116
  emptyText?: string;
117
- request?: (value?: string) => Promise<SelectProps['options']>;
117
+ request?: (value?: string, extraParams?: Recordable) => Promise<SelectProps['options']>;
118
118
  multiple?: boolean;
119
119
  value?: SelectProps['value'];
120
120
  'onUpdate:value'?: SelectProps['onUpdate:value'];
@@ -134,6 +134,14 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
134
134
  * 添加一个名为全部的节点(只在多选的情况下有效)
135
135
  */
136
136
  addAll?: boolean | number;
137
+ /**
138
+ * 发起request额外的请求,变更后会自动重新发器请求
139
+ */
140
+ params?: Recordable;
141
+ /**
142
+ * 发起搜索的时间间隔默认300ms
143
+ */
144
+ searchDelay?: number;
137
145
  };
138
146
  export type ApFieldSelectExpose = {
139
147
  focus: () => void;
@@ -464,6 +464,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
464
464
  emptyText: string;
465
465
  searchMode: "filter" | "request";
466
466
  refetchOnFocus: boolean;
467
+ searchDelay: number;
467
468
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
468
469
  selectRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
469
470
  value: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),i=require("lodash-unified"),w=require("@aplus-frontend/antdv");require("../../hooks/index.js");const k=require("../../utils/index.js"),M=require("../hooks/use-default-placeholder.js"),d=require("./use-select-options.js"),U=require("../../hooks/useControllableValue.js"),K={key:0},D=o.defineComponent({name:"ApFieldSelect",__name:"index",props:{mode:{default:"edit"},class:{},style:{},defaultValue:{},notFoundContent:{},suffixIcon:{},itemIcon:{},size:{},bordered:{type:Boolean,default:void 0},transitionName:{},choiceTransitionName:{},popupClassName:{},dropdownClassName:{},placement:{},status:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean,default:void 0},animation:{},direction:{},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean,default:void 0},getPopupContainer:{},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{},options:{},showAction:{},onDeselect:{},loading:{type:Boolean,default:void 0},placeholder:{},clearIcon:{},allowClear:{type:Boolean,default:!0},fieldNames:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showSearch:{type:Boolean,default:void 0},searchValue:{},onInputKeyDown:{},removeIcon:{},maxTagCount:{},maxTagTextLength:{},maxTagPlaceholder:{},tokenSeparators:{},tagRender:{},optionLabelRender:{},onClear:{},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{},showArrow:{type:Boolean,default:void 0},onPopupScroll:{},menuItemSelectedIcon:{},listItemHeight:{},inputValue:{},autoClearSearchValue:{type:Boolean,default:void 0},filterOption:{},filterSort:{},optionFilterProp:{},optionLabelProp:{},defaultActiveFirstOption:{type:Boolean,default:void 0},onClickOption:{},labelInValue:{type:Boolean,default:void 0},emptyText:{default:"--"},request:{},multiple:{type:Boolean,default:void 0},value:{},"onUpdate:value":{},searchMode:{default:"filter"},refetchOnFocus:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},addAll:{type:[Boolean,Number]}},emits:["update:value"],setup(B,{expose:L,emit:b}){let r=0;const _=i.debounce(e=>{if(!i.isFunction(t.request))return;r+=1;const n=r;c([]),u.value=!0,t.request(e).then(l=>{r===n&&c(l)}).finally(()=>{u.value=!1})},300),t=B,A=(e,n)=>{var a;const l=((a=t.fieldNames)==null?void 0:a.label)||"label";return typeof(n==null?void 0:n[l])=="string"&&n[l].toLowerCase().indexOf(e.toLowerCase())>-1},{options:s,updateOptions:c}=d.useSelectOptions(t),m=o.ref(),u=o.ref((t==null?void 0:t.loading)||!1),F=b;async function v(e=!0){if(!i.isFunction(t.request))return;u.value=!0,r+=1;const n=r;try{e&&c([]);const l=await t.request();if(n!==r)return;c(l)}finally{u.value=!1}}function O(e){var n;(n=t.onFocus)==null||n.call(t,e),t.refetchOnFocus&&r>0&&!u.value&&v(!0)}o.onMounted(()=>{t.lazy||v()});const{value:f,updateValue:h}=U.useControllableValue(t,F),V=M.useDefaultPlaceholder("Select",t),q=o.computed(()=>{var p,g;const e=o.unref(f);if(!e)return t.emptyText;const n=((p=t.fieldNames)==null?void 0:p.label)||"label",l=((g=t.fieldNames)==null?void 0:g.value)||"value";if(i.isArray(e))return e.map(y=>{var C;return(C=o.unref(s).find(P=>P[l]===y))==null?void 0:C[n]}).filter(Boolean).join("、")||t.emptyText;const a=o.unref(s).find(y=>y[l]===e);return(a==null?void 0:a[n])||t.emptyText}),E=o.computed(()=>{const e=!!(t!=null&&t.showSearch),n=t.searchMode;let l={};return e&&(l=n==="request"?{showArrow:!1,defaultActiveFirstOption:!1,onSearch:_,notFoundContent:u.value?void 0:null}:{showArrow:!0,filterOption:i.isNil(t==null?void 0:t.filterOption)?A:t==null?void 0:t.filterOption}),{...k.omitUndefined(i.omit(t,["mode","value","onUpdate:value","onSearch","request","searchMode","onFocus","onBeforeSelect"])),placeholder:o.unref(V),...l}}),S=o.computed(()=>s.value.map(e=>{var n;return e[((n=t.fieldNames)==null?void 0:n.value)||"value"]}).filter(e=>e!==d.SELECT_ALL_VALUE_KEY)),N=o.computed(()=>{if(!t.multiple||!t.addAll)return o.unref(f);if(s.value.some(e=>{var n;return e[((n=t.fieldNames)==null?void 0:n.value)||"value"]===d.SELECT_ALL_VALUE_KEY})){const e=o.unref(S),n=o.unref(f)||[];if(e.length&&e.every(l=>n==null?void 0:n.includes(l)))return[d.SELECT_ALL_VALUE_KEY]}return o.unref(f)});function x(e){return t.multiple&&e.includes(d.SELECT_ALL_VALUE_KEY)?h(o.unref(S)):h(e)}function T(){var e;(e=m.value)==null||e.focus()}function I(){var e;(e=m.value)==null||e.blur()}return L({focus:T,blur:I,request:v}),(e,n)=>e.mode==="read"?(o.openBlock(),o.createElementBlock("span",K,o.toDisplayString(q.value),1)):(o.openBlock(),o.createBlock(o.unref(w.Select),o.mergeProps({key:1,ref_key:"selectRef",ref:m,"allow-clear":""},E.value,{mode:e.multiple?"multiple":void 0,value:N.value,options:o.unref(s),loading:u.value,"onUpdate:value":x,onFocus:O}),o.createSlots({_:2},[o.renderList(e.$slots,(l,a)=>({name:a,fn:o.withCtx(p=>[o.renderSlot(e.$slots,a,o.normalizeProps(o.guardReactiveProps(p||{})))])})),u.value?{name:"notFoundContent",fn:o.withCtx(()=>[o.createVNode(o.unref(w.Spin),{size:"small"})]),key:"0"}:void 0]),1040,["mode","value","options","loading"]))}});exports.default=D;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),i=require("lodash-unified"),w=require("@aplus-frontend/antdv");require("../../hooks/index.js");const k=require("../hooks/use-default-placeholder.js"),d=require("./use-select-options.js"),M=require("../../hooks/useControllableValue.js"),U={key:0},D=o.defineComponent({name:"ApFieldSelect",__name:"index",props:{mode:{default:"edit"},class:{},style:{},defaultValue:{},notFoundContent:{},suffixIcon:{},itemIcon:{},size:{},bordered:{type:Boolean,default:void 0},transitionName:{},choiceTransitionName:{},popupClassName:{},dropdownClassName:{},placement:{},status:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean,default:void 0},animation:{},direction:{},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean,default:void 0},getPopupContainer:{},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{},options:{},showAction:{},onDeselect:{},loading:{type:Boolean,default:void 0},placeholder:{},clearIcon:{},allowClear:{type:Boolean,default:!0},fieldNames:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showSearch:{type:Boolean,default:void 0},searchValue:{},onInputKeyDown:{},removeIcon:{},maxTagCount:{},maxTagTextLength:{},maxTagPlaceholder:{},tokenSeparators:{},tagRender:{},optionLabelRender:{},onClear:{},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{},showArrow:{type:Boolean,default:void 0},onPopupScroll:{},menuItemSelectedIcon:{},listItemHeight:{},inputValue:{},autoClearSearchValue:{type:Boolean,default:void 0},filterOption:{},filterSort:{},optionFilterProp:{},optionLabelProp:{},defaultActiveFirstOption:{type:Boolean,default:void 0},onClickOption:{},labelInValue:{type:Boolean,default:void 0},emptyText:{default:"--"},request:{},multiple:{type:Boolean,default:void 0},value:{},"onUpdate:value":{},searchMode:{default:"filter"},refetchOnFocus:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},addAll:{type:[Boolean,Number]},params:{},searchDelay:{default:300}},emits:["update:value"],setup(B,{expose:L,emit:b}){let r=0;const e=B,_=i.debounce(t=>{if(!i.isFunction(e.request))return;r+=1;const l=r;c([]),u.value=!0,e.request(t).then(n=>{r===l&&(c(n),u.value=!1)})},e.searchDelay),A=(t,l)=>{var a;const n=((a=e.fieldNames)==null?void 0:a.label)||"label";return typeof(l==null?void 0:l[n])=="string"&&l[n].toLowerCase().indexOf(t.toLowerCase())>-1},{options:s,updateOptions:c}=d.useSelectOptions(e),v=o.ref(),u=o.ref((e==null?void 0:e.loading)||!1),F=b;async function f(t=!0){if(!i.isFunction(e.request))return;u.value=!0,r+=1;const l=r;try{t&&c([]);const n=await e.request(void 0,e.params);if(l!==r)return;c(n)}finally{u.value=!1}}function O(t){var l;(l=e.onFocus)==null||l.call(e,t),e.refetchOnFocus&&r>0&&!u.value&&f(!0)}o.onMounted(()=>{e.lazy||f()}),o.watch(()=>e.params,()=>{f()},{deep:!0});const{value:p,updateValue:h}=M.useControllableValue(e,F),V=k.useDefaultPlaceholder("Select",e),E=o.computed(()=>{var m,g;const t=o.unref(p);if(!t)return e.emptyText;const l=((m=e.fieldNames)==null?void 0:m.label)||"label",n=((g=e.fieldNames)==null?void 0:g.value)||"value";if(i.isArray(t))return t.map(y=>{var C;return(C=o.unref(s).find(P=>P[n]===y))==null?void 0:C[l]}).filter(Boolean).join("、")||e.emptyText;const a=o.unref(s).find(y=>y[n]===t);return(a==null?void 0:a[l])||e.emptyText}),N=o.computed(()=>{const t=!!(e!=null&&e.showSearch),l=e.searchMode;let n={};return t&&(n=l==="request"?{showArrow:!1,defaultActiveFirstOption:!1,onSearch:_,notFoundContent:u.value?void 0:null}:{showArrow:!0,filterOption:i.isNil(e==null?void 0:e.filterOption)?A:e==null?void 0:e.filterOption}),{...i.omit(e,["mode","value","onUpdate:value","onSearch","request","searchMode","onFocus","onBeforeSelect"]),placeholder:o.unref(V),...n}}),S=o.computed(()=>s.value.map(t=>{var l;return t[((l=e.fieldNames)==null?void 0:l.value)||"value"]}).filter(t=>t!==d.SELECT_ALL_VALUE_KEY)),q=o.computed(()=>{if(!e.multiple||!e.addAll)return o.unref(p);if(s.value.some(t=>{var l;return t[((l=e.fieldNames)==null?void 0:l.value)||"value"]===d.SELECT_ALL_VALUE_KEY})){const t=o.unref(S),l=o.unref(p)||[];if(t.length&&t.every(n=>l==null?void 0:l.includes(n)))return[d.SELECT_ALL_VALUE_KEY]}return o.unref(p)});function T(t){return e.multiple&&t.includes(d.SELECT_ALL_VALUE_KEY)?h(o.unref(S)):h(t)}function x(){var t;(t=v.value)==null||t.focus()}function I(){var t;(t=v.value)==null||t.blur()}return L({focus:x,blur:I,request:f}),(t,l)=>t.mode==="read"?(o.openBlock(),o.createElementBlock("span",U,o.toDisplayString(E.value),1)):(o.openBlock(),o.createBlock(o.unref(w.Select),o.mergeProps({key:1,ref_key:"selectRef",ref:v,"allow-clear":""},N.value,{mode:t.multiple?"multiple":void 0,value:q.value,options:o.unref(s),loading:u.value,"onUpdate:value":T,onFocus:O}),o.createSlots({_:2},[o.renderList(t.$slots,(n,a)=>({name:a,fn:o.withCtx(m=>[o.renderSlot(t.$slots,a,o.normalizeProps(o.guardReactiveProps(m||{})))])})),u.value?{name:"notFoundContent",fn:o.withCtx(()=>[o.createVNode(o.unref(w.Spin),{size:"small"})]),key:"0"}:void 0]),1040,["mode","value","options","loading"]))}});exports.default=D;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@aplus-frontend/antdv");require("./utils/index.js");const n=require("lodash-unified");require("./interface.js");const a=require("./utils/createModal.js"),t=require("./utils/createModalStream.js"),r=require("./utils/methods.js"),e=n.omit(o.Modal,["confirm","warning","warn","error","success","info"]);e.createModal=a.createModal;e.createModalStream=t.createModalStream;e.confirm=r.methodsFn("confirm");e.warning=r.methodsFn("warning");e.warn=r.methodsFn("warning");e.error=r.methodsFn("error");e.success=r.methodsFn("success");e.info=r.methodsFn("info");e.name="ApModal";exports.ApModal=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@aplus-frontend/antdv");require("./utils/index.js");const c=require("lodash-unified"),n=require("./utils/confirm.js"),o=require("./utils/destroyFns.js");require("./interface.js");const u=require("./utils/createModal.js"),l=require("./utils/createModalStream.js"),e=c.omit(i.Modal,["confirm","warning","warn","error","success","info"]);e.createModal=u.createModal;e.createModalStream=l.createModalStream;function a(t){return n.default(n.withWarn(t))}e.info=function(r){return n.default(n.withInfo(r))};e.success=function(r){return n.default(n.withSuccess(r))};e.error=function(r){return n.default(n.withError(r))};e.warning=a;e.warn=a;e.confirm=function(r){return n.default(n.withConfirm(r))};e.destroyAll=function(){for(;o.default.length;){const r=o.default.pop();r&&r()}};e.name="ApModal";exports.ApModal=e;
@@ -0,0 +1,17 @@
1
+ import { ModalFuncProps } from '@aplus-frontend/antdv';
2
+ type ConfigUpdate = ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps);
3
+ export type ModalStaticFunctions<T = ModalFunc> = Record<NonNullable<ModalFuncProps['type']>, T>;
4
+ export type ModalFunc = (props: ModalFuncProps) => {
5
+ destroy: () => void;
6
+ update: (configUpdate: ConfigUpdate) => void;
7
+ };
8
+ declare const confirm: (config: ModalFuncProps) => {
9
+ destroy: (this: /*elided*/ any, ...args: any[]) => void;
10
+ update: (configUpdate: ConfigUpdate) => void;
11
+ };
12
+ export default confirm;
13
+ export declare function withWarn(props: ModalFuncProps): ModalFuncProps;
14
+ export declare function withInfo(props: ModalFuncProps): ModalFuncProps;
15
+ export declare function withSuccess(props: ModalFuncProps): ModalFuncProps;
16
+ export declare function withError(props: ModalFuncProps): ModalFuncProps;
17
+ export declare function withConfirm(props: ModalFuncProps): ModalFuncProps;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),g=require("@aplus-frontend/antdv/es/modal/ConfirmDialog"),y=require("lodash-unified");require("../../config-provider/index.js");const w=require("@aplus-frontend/antdv/es/modal/locale"),P=require("@aplus-frontend/antdv/es/config-provider"),s=require("./destroyFns.js"),p=require("../../config-provider/config-provider.js"),v=e=>{const u=document.createDocumentFragment();let r={...y.omit(e,["parentContext","appContext"]),close:c,open:!0,centered:!0},l=null;function d(...t){l&&(i.render(null,u),l=null);const o=t.some(n=>n&&n.triggerCancel);e.onCancel&&o&&e.onCancel(()=>{},...t.slice(1));for(let n=0;n<s.default.length;n++)if(s.default[n]===c){s.default.splice(n,1);break}}function c(...t){r={...r,open:!1,afterClose:()=>{typeof e.afterClose=="function"&&e.afterClose(),d.apply(this,t)}},r.visible&&delete r.visible,f(r)}function f(t){typeof t=="function"?r=t(r):r={...r,...t},l&&i.render(i.cloneVNode(l,{...r}),u)}const x=t=>{const o={...P.globalConfigForApi,...p.globalConfigCached.value},n=o.prefixCls,a=t.prefixCls||`${n}-modal`,h=o.iconPrefixCls,C=w.getConfirmLocale();return i.createVNode(p.ConfigProvider,i.mergeProps(o,{prefixCls:n}),{default:()=>[i.createVNode(g,i.mergeProps(t,{rootPrefixCls:n,prefixCls:a,iconPrefixCls:h,locale:C,cancelText:t.cancelText||C.cancelText}),null)]})};function m(t){const o=i.createVNode(x,{...t});return o.appContext=e.parentContext||e.appContext||o.appContext,i.render(o,u),o}return l=m(r),s.default.push(c),{destroy:c,update:f}};function b(e){return{...e,type:"warning"}}function q(e){return{...e,type:"info"}}function N(e){return{...e,type:"success"}}function S(e){return{...e,type:"error"}}function T(e){return{...e,type:"confirm"}}exports.default=v;exports.withConfirm=T;exports.withError=S;exports.withInfo=q;exports.withSuccess=N;exports.withWarn=b;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),N=require("@aplus-frontend/antdv"),m=require("../../config-provider/config-provider.js"),k=require("lodash-unified"),M=require("@aplus-frontend/utils");require("../../config-provider/index.js");const v=require("./util.js"),L=require("../../utils/index.js"),T=require("../../config-provider/hooks/use-namespace.js"),V=p=>{var C,g;let t,r;const{destroyOnClose:l=!0,wrapperOffset:s=!1}=p,{b:u}=T.useNamespace("ap-modal");function f(){t&&t(!1),setTimeout(()=>{var e;o.render(null,a),(e=a.parentElement)==null||e.removeChild(a)},500)}function y(){t&&t(!0)}function h(){t&&t(!1)}function O(e){r&&r(e)}const q=o.defineComponent({data(){return{open:l,props:p}},created(){t=e=>{this.open=e},r=e=>{this.props={...this.props,...e}}},methods:{async handleCancel(){var e,n,i,c,d;if((e=this.props)!=null&&e.onCancel){const x=((c=(i=(n=this.props)==null?void 0:n.content)==null?void 0:i.component)==null?void 0:c.exposed)??void 0;await((d=this.props)==null?void 0:d.onCancel(x))}l?f():h()},async handleOk(){var e,n,i,c;try{if(r({confirmLoading:!0}),(e=this.props)!=null&&e.onOk){const d=((c=(i=(n=this.props)==null?void 0:n.content)==null?void 0:i.component)==null?void 0:c.exposed)??void 0;await this.props.onOk(d)}r({confirmLoading:!1}),l?f():h()}catch{r({confirmLoading:!1})}}},render(){const e=k.omit(this.props,["onCancel","onOk","open","onUpdate:open","getContainer","icon"]);return o.createVNode(m.ConfigProvider,m.globalConfigCached.value,{default:()=>[o.createVNode(N.Modal,o.mergeProps({class:{[u()]:!0,[u("wrapper")]:s},open:this.open,onCancel:this.handleCancel,onOk:this.handleOk},e),{default:()=>{var n;return[o.createVNode("div",{class:{[u("body-wrapper")]:s},style:s===!1?{}:{maxHeight:`${window.innerHeight-(s===!0?100:M.isNumeric(s)?Number(s):100)*2}px`}},[(n=this.props)==null?void 0:n.content])]}})]})}}),b=v.getContainerDom((g=(C=m.globalConfigCached)==null?void 0:C.value)==null?void 0:g.getPopupContainer),w=v.getContainerDom(p.getContainer),P=b||w||L.getTopWindow().document.body,a=document.createElement("div");return P.appendChild(a),o.render(o.h(q),a),{destroy:f,update:O,open:y,close:h}};exports.createModal=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),N=require("@aplus-frontend/antdv"),m=require("../../config-provider/config-provider.js"),k=require("lodash-unified"),M=require("@aplus-frontend/utils");require("../../config-provider/index.js");const v=require("./util.js"),L=require("../../utils/index.js"),T=require("../../config-provider/hooks/use-namespace.js"),V=p=>{var C,g;let t,r;const{destroyOnClose:l=!0,wrapperOffset:s=!1}=p,{b:u}=T.useNamespace("ap-modal");function f(){t&&t(!1),setTimeout(()=>{var e;o.render(null,a),(e=a.parentElement)==null||e.removeChild(a)},500)}function y(){t&&t(!0)}function h(){t&&t(!1)}function O(e){r&&r(e)}const q=o.defineComponent({data(){return{open:l,props:p}},created(){t=e=>{this.open=e},r=e=>{this.props={...this.props,...e}}},methods:{async handleCancel(){var e,n,i,c,d;if((e=this.props)!=null&&e.onCancel){const x=((c=(i=(n=this.props)==null?void 0:n.content)==null?void 0:i.component)==null?void 0:c.exposed)??void 0;await((d=this.props)==null?void 0:d.onCancel(x))}l?f():h()},async handleOk(){var e,n,i,c;try{if(r({confirmLoading:!0}),(e=this.props)!=null&&e.onOk){const d=((c=(i=(n=this.props)==null?void 0:n.content)==null?void 0:i.component)==null?void 0:c.exposed)??void 0;await this.props.onOk(d)}r({confirmLoading:!1}),l?f():h()}catch{r({confirmLoading:!1})}}},render(){const e=k.omit(this.props,["onCancel","onOk","open","onUpdate:open","getContainer","icon"]);return o.createVNode(m.ConfigProvider,m.globalConfigCached.value,{default:()=>[o.createVNode(N.Modal,o.mergeProps({class:{[u()]:!0,[u("wrapper")]:s},open:this.open,onCancel:this.handleCancel,onOk:this.handleOk,centered:!0},e),{default:()=>{var n;return[o.createVNode("div",{class:{[u("body-wrapper")]:s},style:s===!1?{}:{maxHeight:`${window.innerHeight-(s===!0?100:M.isNumeric(s)?Number(s):100)*2}px`}},[(n=this.props)==null?void 0:n.content])]}})]})}}),b=v.getContainerDom((g=(C=m.globalConfigCached)==null?void 0:C.value)==null?void 0:g.getPopupContainer),w=v.getContainerDom(p.getContainer),P=b||w||L.getTopWindow().document.body,a=document.createElement("div");return P.appendChild(a),o.render(o.h(q),a),{destroy:f,update:O,open:y,close:h}};exports.createModal=V;
@@ -0,0 +1,2 @@
1
+ declare const destroyFns: Array<() => void>;
2
+ export default destroyFns;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=[];exports.default=e;
@@ -2616,6 +2616,7 @@ export declare const apTableRenderItemMap: {
2616
2616
  emptyText: string;
2617
2617
  searchMode: "filter" | "request";
2618
2618
  refetchOnFocus: boolean;
2619
+ searchDelay: number;
2619
2620
  }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
2620
2621
  selectRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
2621
2622
  value: {
@@ -3053,6 +3054,7 @@ export declare const apTableRenderItemMap: {
3053
3054
  emptyText: string;
3054
3055
  searchMode: "filter" | "request";
3055
3056
  refetchOnFocus: boolean;
3057
+ searchDelay: number;
3056
3058
  }>;
3057
3059
  __isFragment?: never;
3058
3060
  __isTeleport?: never;
@@ -3085,6 +3087,7 @@ export declare const apTableRenderItemMap: {
3085
3087
  emptyText: string;
3086
3088
  searchMode: "filter" | "request";
3087
3089
  refetchOnFocus: boolean;
3090
+ searchDelay: number;
3088
3091
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
3089
3092
  $slots: Readonly<{
3090
3093
  notFoundContent: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.5.13",
3
+ "version": "0.5.14",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -68,7 +68,7 @@
68
68
  "vxe-pc-ui": "4.4.4",
69
69
  "vxe-table": "4.11.18",
70
70
  "@aplus-frontend/hooks": "1.0.7",
71
- "@aplus-frontend/utils": "1.0.52"
71
+ "@aplus-frontend/utils": "1.0.54"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "@aplus-frontend/antdv": "^1.1.0",