@aplus-frontend/ui 7.14.4 → 7.15.0
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.
- package/es/src/ap-field/checkbox/index.vue.d.ts +3 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +37 -31
- package/es/src/ap-field/date/index.vue.d.ts +1086 -6
- package/es/src/ap-field/date/index.vue.mjs +63 -57
- package/es/src/ap-field/date-range/index.vue.d.ts +1155 -4
- package/es/src/ap-field/date-range/index.vue.mjs +70 -63
- package/es/src/ap-field/interface.d.ts +25 -27
- package/es/src/ap-field/number/index.vue.d.ts +1 -1
- package/es/src/ap-field/radio/index.vue.d.ts +1 -2
- package/es/src/ap-field/radio/index.vue.mjs +36 -41
- package/es/src/ap-field/rate/index.vue.d.ts +1 -1
- package/es/src/ap-field/second/index.vue.d.ts +1 -1
- package/es/src/ap-field/select/index.vue.d.ts +5 -4
- package/es/src/ap-field/select/index.vue.mjs +126 -112
- package/es/src/ap-field/select/read.vue2.mjs +4 -3
- package/es/src/ap-field/slider/index.vue.d.ts +1 -1
- package/es/src/ap-field/switch/index.vue.d.ts +232 -4
- package/es/src/ap-field/switch/index.vue.mjs +48 -42
- package/es/src/ap-field/text/password.vue.d.ts +1 -1
- package/es/src/ap-field/text-area/index.vue.d.ts +1 -1
- package/es/src/ap-form/item-group/index.vue.d.ts +2 -4
- package/es/src/ap-form/item-group/index.vue.mjs +37 -42
- package/es/src/ap-form/items/checkbox/index.vue.d.ts +66 -5
- package/es/src/ap-form/items/checkbox/index.vue.mjs +20 -14
- package/es/src/ap-form/items/date/index.vue.d.ts +1497 -5
- package/es/src/ap-form/items/date/index.vue.mjs +25 -19
- package/es/src/ap-form/items/date-range/index.vue.d.ts +1607 -5
- package/es/src/ap-form/items/date-range/index.vue.mjs +25 -19
- package/es/src/ap-form/items/number/index.vue.d.ts +4 -4
- package/es/src/ap-form/items/radio/index.vue.d.ts +5 -10
- package/es/src/ap-form/items/radio/index.vue.mjs +14 -20
- package/es/src/ap-form/items/select/index.vue.d.ts +18 -12
- package/es/src/ap-form/items/switch/index.vue.d.ts +436 -5
- package/es/src/ap-form/items/switch/index.vue.mjs +24 -17
- package/es/src/ap-form/items/text/password.vue.d.ts +5 -5
- package/es/src/ap-form/items/text-area/index.vue.d.ts +5 -5
- package/es/src/ap-table/constants.d.ts +1923 -112
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +36 -36
- package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +28 -27
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +78 -81
- package/es/src/config-provider/config-provider-props.d.ts +3 -1
- package/es/src/config-provider/config-provider.d.ts +7 -28
- package/es/src/config-provider/hooks/use-global-config.d.ts +3 -10
- package/es/src/config-provider/index.d.ts +13 -55
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-field/checkbox/index.vue.d.ts +3 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/date/index.vue.d.ts +1086 -6
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.d.ts +1155 -4
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +25 -27
- package/lib/src/ap-field/number/index.vue.d.ts +1 -1
- package/lib/src/ap-field/radio/index.vue.d.ts +1 -2
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/rate/index.vue.d.ts +1 -1
- package/lib/src/ap-field/second/index.vue.d.ts +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +5 -4
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/select/read.vue2.js +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +1 -1
- package/lib/src/ap-field/switch/index.vue.d.ts +232 -4
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/text/password.vue.d.ts +1 -1
- package/lib/src/ap-field/text-area/index.vue.d.ts +1 -1
- package/lib/src/ap-form/item-group/index.vue.d.ts +2 -4
- package/lib/src/ap-form/item-group/index.vue.js +1 -1
- package/lib/src/ap-form/items/checkbox/index.vue.d.ts +66 -5
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.d.ts +1497 -5
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +1607 -5
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +4 -4
- package/lib/src/ap-form/items/radio/index.vue.d.ts +5 -10
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.d.ts +18 -12
- package/lib/src/ap-form/items/switch/index.vue.d.ts +436 -5
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.d.ts +5 -5
- package/lib/src/ap-form/items/text-area/index.vue.d.ts +5 -5
- package/lib/src/ap-table/constants.d.ts +1923 -112
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
- package/lib/src/business/ap-button-group/ApButtonGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +3 -1
- package/lib/src/config-provider/config-provider.d.ts +7 -28
- package/lib/src/config-provider/hooks/use-global-config.d.ts +3 -10
- package/lib/src/config-provider/index.d.ts +13 -55
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { SwapRightOutlined as
|
|
3
|
-
import { InputGroup as
|
|
1
|
+
import { defineComponent as Z, useSlots as q, ref as J, computed as s, unref as t, isVNode as Q, createVNode as D, Fragment as m, createElementBlock as g, createBlock as k, openBlock as u, createTextVNode as S, toDisplayString as C, resolveDynamicComponent as X, normalizeStyle as ee, withCtx as P, createCommentVNode as oe, isRef as te, renderList as w, mergeProps as ne, createSlots as ae, renderSlot as re, normalizeProps as le, guardReactiveProps as ue } from "vue";
|
|
2
|
+
import { SwapRightOutlined as de } from "@ant-design/icons-vue";
|
|
3
|
+
import { InputGroup as ie, Select as se, SelectOption as fe, DatePicker as pe } from "@aplus-frontend/antdv";
|
|
4
4
|
import { getTimeFormatToZone as T } from "@aplus-frontend/utils";
|
|
5
5
|
import d from "dayjs";
|
|
6
|
-
import { isNil as
|
|
6
|
+
import { isNil as M, omit as R, isString as c, isFunction as me } from "lodash-unified";
|
|
7
7
|
import "../../hooks/index.mjs";
|
|
8
|
-
import { omitUndefined as
|
|
9
|
-
import { ApFieldDatePresetFormats as
|
|
10
|
-
import { formatDayWithTimezone as
|
|
11
|
-
import { useDateTimezone as
|
|
12
|
-
import { useDefaultPlaceholder as
|
|
13
|
-
import { useDefaultPresets as
|
|
14
|
-
import { useControllableValue as
|
|
15
|
-
const
|
|
8
|
+
import { omitUndefined as ce } from "../../utils/index.mjs";
|
|
9
|
+
import { ApFieldDatePresetFormats as ye, PRESET_FORMAT_MAP as A, PRESET_FORMAT_PICK_MAP as ve, PRESET_FORMAT_TIME_MAP as he } from "../date/constant.mjs";
|
|
10
|
+
import { formatDayWithTimezone as ge } from "../date/helper.mjs";
|
|
11
|
+
import { useDateTimezone as ke } from "../hooks/use-date-timezone.mjs";
|
|
12
|
+
import { useDefaultPlaceholder as Se } from "../hooks/use-default-placeholder.mjs";
|
|
13
|
+
import { useDefaultPresets as Ce } from "../hooks/use-default-presets.mjs";
|
|
14
|
+
import { useControllableValue as Pe } from "../../hooks/useControllableValue.mjs";
|
|
15
|
+
const Ee = /* @__PURE__ */ Z({
|
|
16
16
|
name: "ApFieldDateRange",
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: {
|
|
@@ -161,112 +161,119 @@ const ze = /* @__PURE__ */ L({
|
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
163
|
emits: ["update:value"],
|
|
164
|
-
setup(
|
|
165
|
-
|
|
164
|
+
setup(F, {
|
|
165
|
+
expose: _,
|
|
166
|
+
emit: x
|
|
166
167
|
}) {
|
|
167
|
-
const o =
|
|
168
|
+
const o = F, z = x, N = q(), B = J(), i = s(() => ye.indexOf(o.format) > -1), y = s(() => i.value ? A[o.format] : o.format), {
|
|
168
169
|
value: v,
|
|
169
|
-
updateValue:
|
|
170
|
-
} =
|
|
170
|
+
updateValue: b
|
|
171
|
+
} = Pe(o, z), E = s(() => o.shownFormat ? o.shownFormat : i.value ? A[o.format] : o.format), V = Se("DateRange", o), {
|
|
171
172
|
currentTimezone: l
|
|
172
|
-
} =
|
|
173
|
-
presets:
|
|
174
|
-
changeCurrentDate:
|
|
175
|
-
} =
|
|
173
|
+
} = ke(o), {
|
|
174
|
+
presets: j,
|
|
175
|
+
changeCurrentDate: I
|
|
176
|
+
} = Ce({
|
|
176
177
|
...o,
|
|
177
178
|
timezone: l
|
|
178
|
-
}),
|
|
179
|
+
}), f = (e, a, n = !0) => ge(l.value)(e, a, n), h = s(() => {
|
|
179
180
|
const e = t(v);
|
|
180
|
-
if (
|
|
181
|
+
if (M(e) || !e?.length)
|
|
181
182
|
return e;
|
|
182
183
|
const a = l.value ? T(t(v)[0], l.value) : t(v)?.[0], n = o.timezone ? T(t(v)[1], l.value) : t(v)?.[1];
|
|
183
184
|
return [d(a), d(n)];
|
|
184
|
-
}),
|
|
185
|
-
const e = t(i) ?
|
|
185
|
+
}), U = s(() => t(i) ? o.picker ?? ve[o.format] : o.picker), H = s(() => {
|
|
186
|
+
const e = t(i) ? he[o.format] : {};
|
|
186
187
|
return {
|
|
187
|
-
...
|
|
188
|
-
placeholder: t(
|
|
189
|
-
presets: t(
|
|
188
|
+
...ce(R(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
|
|
189
|
+
placeholder: t(V),
|
|
190
|
+
presets: t(j),
|
|
190
191
|
...e
|
|
191
192
|
};
|
|
192
193
|
});
|
|
193
|
-
function
|
|
194
|
+
function K(e) {
|
|
194
195
|
if (!e) {
|
|
195
|
-
|
|
196
|
+
b(e);
|
|
196
197
|
return;
|
|
197
198
|
}
|
|
198
199
|
let a = c(e[0]) ? d(e[0]) : e[0], n = c(e[1]) ? d(e[1]) : e[1];
|
|
199
200
|
const r = t(i) ? t(y) : void 0;
|
|
200
|
-
|
|
201
|
+
b([f(a, r), f(n, r, !1)]);
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
-
const a = c(e[0]) ? d(e[0]) : e[0], n = c(e[1]) ? d(e[1]) : e[1], r = t(i) ? t(y) : void 0,
|
|
204
|
-
o.onOk?.([
|
|
203
|
+
function W(e) {
|
|
204
|
+
const a = c(e[0]) ? d(e[0]) : e[0], n = c(e[1]) ? d(e[1]) : e[1], r = t(i) ? t(y) : void 0, p = e[0] ? f(a, r) : null, O = e[1] ? f(n, r, !1) : null;
|
|
205
|
+
o.onOk?.([p, O]);
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
-
e &&
|
|
207
|
+
function $(e) {
|
|
208
|
+
e && I(), o.onOpenChange?.(e);
|
|
208
209
|
}
|
|
209
|
-
function
|
|
210
|
-
if (
|
|
210
|
+
function G(e, a) {
|
|
211
|
+
if (M(e)) {
|
|
211
212
|
o.onChange?.(e, a);
|
|
212
213
|
return;
|
|
213
214
|
}
|
|
214
|
-
const n = c(e[0]) ? d(e[0]) : e[0], r = c(e[1]) ? d(e[1]) : e[1],
|
|
215
|
-
o.onChange?.([O,
|
|
215
|
+
const n = c(e[0]) ? d(e[0]) : e[0], r = c(e[1]) ? d(e[1]) : e[1], p = t(i) ? t(y) : void 0, O = e[0] ? f(n, p) : null, Y = e[1] ? f(r, p, !1) : null;
|
|
216
|
+
o.onChange?.([O, Y], a);
|
|
216
217
|
}
|
|
217
|
-
const
|
|
218
|
+
const L = s(() => {
|
|
218
219
|
const e = o.readModeSeparator;
|
|
219
220
|
if (e)
|
|
220
|
-
return
|
|
221
|
-
const a =
|
|
222
|
-
return a ? D(m, null, [a]) :
|
|
221
|
+
return Q(e) || me(e) ? o.readModeSeparator : D(m, null, [o.readModeSeparator]);
|
|
222
|
+
const a = N.readModeSeparator?.();
|
|
223
|
+
return a ? D(m, null, [a]) : de;
|
|
223
224
|
});
|
|
224
|
-
return (
|
|
225
|
+
return _({
|
|
226
|
+
focus: B.value?.focus(),
|
|
227
|
+
blur: B.value?.blur()
|
|
228
|
+
}), (e, a) => e.mode === "read" ? (u(), g(m, {
|
|
225
229
|
key: 0
|
|
226
230
|
}, [h.value ? (u(), g(m, {
|
|
227
231
|
key: 0
|
|
228
|
-
}, [S(C(h.value[0]?.format(y.value)) + " ", 1), (u(), k(
|
|
232
|
+
}, [S(C(h.value[0]?.format(y.value)) + " ", 1), (u(), k(X(L.value))), S(" " + C(h.value[1]?.format(y.value)), 1)], 64)) : (u(), g(m, {
|
|
229
233
|
key: 1
|
|
230
|
-
}, [S(C(e.emptyText), 1)], 64))], 64)) : (u(), k(t(
|
|
234
|
+
}, [S(C(e.emptyText), 1)], 64))], 64)) : (u(), k(t(ie), {
|
|
231
235
|
key: 1,
|
|
232
236
|
compact: "",
|
|
233
|
-
style:
|
|
237
|
+
style: ee({
|
|
234
238
|
display: Array.isArray(o.timezone) && o.timezone.length ? "flex" : "block"
|
|
235
239
|
})
|
|
236
240
|
}, {
|
|
237
|
-
default:
|
|
241
|
+
default: P(() => [Array.isArray(o.timezone) && o.timezone.length ? (u(), k(t(se), {
|
|
238
242
|
key: 0,
|
|
239
243
|
value: t(l),
|
|
240
|
-
"onUpdate:value": a[0] || (a[0] = (n) =>
|
|
244
|
+
"onUpdate:value": a[0] || (a[0] = (n) => te(l) ? l.value = n : null),
|
|
241
245
|
"default-active-first-option": "",
|
|
242
246
|
"dropdown-match-select-width": !1
|
|
243
247
|
}, {
|
|
244
|
-
default:
|
|
248
|
+
default: P(() => [(u(!0), g(m, null, w(o.timezone, (n) => (u(), k(t(fe), {
|
|
245
249
|
key: n?.value,
|
|
246
250
|
value: n?.value
|
|
247
251
|
}, {
|
|
248
|
-
default:
|
|
252
|
+
default: P(() => [S(C(n?.label ?? n?.value), 1)]),
|
|
249
253
|
_: 2
|
|
250
254
|
}, 1032, ["value"]))), 128))]),
|
|
251
255
|
_: 1
|
|
252
|
-
}, 8, ["value"])) :
|
|
256
|
+
}, 8, ["value"])) : oe("", !0), D(t(pe).RangePicker, ne({
|
|
257
|
+
ref_key: "rangePickerRef",
|
|
258
|
+
ref: B
|
|
259
|
+
}, H.value, {
|
|
253
260
|
value: h.value,
|
|
254
|
-
picker:
|
|
255
|
-
format:
|
|
256
|
-
"onUpdate:value":
|
|
257
|
-
onChange:
|
|
258
|
-
onOk:
|
|
259
|
-
onOpenChange:
|
|
260
|
-
}),
|
|
261
|
+
picker: U.value,
|
|
262
|
+
format: E.value,
|
|
263
|
+
"onUpdate:value": K,
|
|
264
|
+
onChange: G,
|
|
265
|
+
onOk: W,
|
|
266
|
+
onOpenChange: $
|
|
267
|
+
}), ae({
|
|
261
268
|
_: 2
|
|
262
|
-
}, [w(t(
|
|
269
|
+
}, [w(t(R)(e.$slots, "readModeSeparator"), (n, r) => ({
|
|
263
270
|
name: r,
|
|
264
|
-
fn:
|
|
271
|
+
fn: P((p) => [re(e.$slots, r, le(ue(p || {})))])
|
|
265
272
|
}))]), 1040, ["value", "picker", "format"])]),
|
|
266
273
|
_: 3
|
|
267
274
|
}, 8, ["style"]));
|
|
268
275
|
}
|
|
269
276
|
});
|
|
270
277
|
export {
|
|
271
|
-
|
|
278
|
+
Ee as default
|
|
272
279
|
};
|
|
@@ -10,6 +10,11 @@ import { LiteralUnion, Recordable } from '../type';
|
|
|
10
10
|
import { ApFormatPresetType } from './date/interface';
|
|
11
11
|
import { InputPasswordProps } from './text/input-password-props';
|
|
12
12
|
export type FieldMode = 'read' | 'edit';
|
|
13
|
+
type CommonApFieldExpose = {
|
|
14
|
+
focus: () => void;
|
|
15
|
+
blur: () => void;
|
|
16
|
+
request: () => void;
|
|
17
|
+
};
|
|
13
18
|
export type BasicApFieldProps<FieldPropsType = any> = {
|
|
14
19
|
mode?: FieldMode;
|
|
15
20
|
class?: unknown;
|
|
@@ -27,10 +32,7 @@ export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
|
|
|
27
32
|
export type ApFieldTextPasswordProps = BasicApFieldProps<InputPasswordProps> & {
|
|
28
33
|
emptyText?: string;
|
|
29
34
|
};
|
|
30
|
-
export type ApFieldTextPasswordExpose =
|
|
31
|
-
focus: () => void;
|
|
32
|
-
blur: () => void;
|
|
33
|
-
};
|
|
35
|
+
export type ApFieldTextPasswordExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
34
36
|
export type ApFieldTextExpose = {
|
|
35
37
|
focus: (options?: InputFocusOptions) => void;
|
|
36
38
|
blur: () => void;
|
|
@@ -43,6 +45,7 @@ export type ApFieldCheckboxProps = BasicApFieldProps<CheckboxGroupProps> & {
|
|
|
43
45
|
request?: () => Promise<CheckboxGroupProps['options']>;
|
|
44
46
|
vertical?: boolean;
|
|
45
47
|
};
|
|
48
|
+
export type ApFieldCheckboxExpose = Pick<CommonApFieldExpose, 'request'>;
|
|
46
49
|
export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' | 'value' | 'defaultValue' | 'onChange' | 'onOk' | 'format' | 'onUpdate:value'>> & {
|
|
47
50
|
emptyText?: string;
|
|
48
51
|
value?: number | null;
|
|
@@ -69,6 +72,7 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
|
|
|
69
72
|
}[];
|
|
70
73
|
disabledTime?: SharedTimeProps<Dayjs>['disabledTime'];
|
|
71
74
|
};
|
|
75
|
+
export type ApFieldDateExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
72
76
|
export type ApFieldNumberProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'>> & {
|
|
73
77
|
/**
|
|
74
78
|
* 输入框的显示模式(输入框/数字轮播)
|
|
@@ -84,25 +88,20 @@ export type ApFieldNumberProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'
|
|
|
84
88
|
*/
|
|
85
89
|
limitDecimalsRetain?: boolean;
|
|
86
90
|
};
|
|
87
|
-
export type ApiFieldNumberExpose =
|
|
88
|
-
focus: () => void;
|
|
89
|
-
blur: () => void;
|
|
90
|
-
};
|
|
91
|
+
export type ApiFieldNumberExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
91
92
|
export type ApFieldRadioProps = BasicApFieldProps<RadioGroupProps> & {
|
|
92
93
|
emptyText?: string;
|
|
93
94
|
request?: () => Promise<RadioGroupProps['options']>;
|
|
94
95
|
vertical?: boolean;
|
|
95
96
|
};
|
|
96
|
-
export type
|
|
97
|
-
focus: () => void;
|
|
98
|
-
blur: () => void;
|
|
99
|
-
};
|
|
97
|
+
export type ApFieldRadioExpose = Pick<CommonApFieldExpose, 'request'>;
|
|
100
98
|
export type ApFieldSwitchConfirmConfig = Pick<PopconfirmProps, 'title' | 'okText' | 'cancelText' | 'description' | 'showCancel' | 'icon' | 'okType' | 'onCancel' | 'okButtonProps' | 'cancelButtonProps'>;
|
|
101
99
|
export type ApFieldSwitchProps = BasicApFieldProps<Omit<SwitchProps, 'onClick'>> & {
|
|
102
100
|
emptyText?: string;
|
|
103
101
|
onAction?: (checked: string | boolean | number, e?: Event) => boolean | Promise<boolean>;
|
|
104
102
|
confirm?: ApFieldSwitchConfirmConfig | ((checked: string | number | boolean) => ApFieldSwitchConfirmConfig);
|
|
105
103
|
};
|
|
104
|
+
export type ApFieldSwitchExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
106
105
|
export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosize'>> & {
|
|
107
106
|
emptyText?: string;
|
|
108
107
|
/**
|
|
@@ -118,9 +117,8 @@ export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosi
|
|
|
118
117
|
language?: 'text' | 'json';
|
|
119
118
|
};
|
|
120
119
|
};
|
|
121
|
-
export type ApFieldTextAreaExpose = {
|
|
120
|
+
export type ApFieldTextAreaExpose = Pick<CommonApFieldExpose, 'blur'> & {
|
|
122
121
|
focus: (options?: InputFocusOptions) => void;
|
|
123
|
-
blur: () => void;
|
|
124
122
|
resizableTextArea: any;
|
|
125
123
|
};
|
|
126
124
|
export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'value' | 'onChange' | 'onPanelChange' | 'defaultValue' | 'onOk' | 'renderExtraFooter' | 'onUpdate:value' | 'mode' | 'format' | 'presets'>> & {
|
|
@@ -193,6 +191,7 @@ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'va
|
|
|
193
191
|
lastYear?: boolean;
|
|
194
192
|
};
|
|
195
193
|
};
|
|
194
|
+
export type ApFieldDateRangeExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
196
195
|
export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
|
|
197
196
|
emptyText?: string;
|
|
198
197
|
request?: (value?: string, extraParams?: Recordable) => Promise<SelectProps['options']>;
|
|
@@ -205,12 +204,18 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
|
|
|
205
204
|
searchMode?: 'filter' | 'request';
|
|
206
205
|
/**
|
|
207
206
|
* 是否在Select框聚焦时再次触发选项请求
|
|
207
|
+
* @deprecated 有歧义,请使用fetchOnFocus
|
|
208
208
|
*/
|
|
209
209
|
refetchOnFocus?: boolean;
|
|
210
210
|
/**
|
|
211
|
-
*
|
|
211
|
+
* 是否在聚焦时触发网络请求
|
|
212
|
+
* @since 7.15.0
|
|
212
213
|
*/
|
|
213
|
-
|
|
214
|
+
fetchOnFocus?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* 是否延迟请求选项列表 true: 不请求选项; 'first-focus': 首次聚焦时触发网络请求
|
|
217
|
+
*/
|
|
218
|
+
lazy?: boolean | 'first-focus';
|
|
214
219
|
/**
|
|
215
220
|
* 添加一个名为全部的节点(只在多选的情况下有效)
|
|
216
221
|
*/
|
|
@@ -251,9 +256,7 @@ export type ApFieldTreeSelectProps = BasicApFieldProps<Omit<TreeSelectProps, 'lo
|
|
|
251
256
|
*/
|
|
252
257
|
loadData?: boolean;
|
|
253
258
|
};
|
|
254
|
-
export type ApFieldSelectExpose = {
|
|
255
|
-
focus: () => void;
|
|
256
|
-
blur: () => void;
|
|
259
|
+
export type ApFieldSelectExpose = Omit<CommonApFieldExpose, 'request'> & {
|
|
257
260
|
request: (clear?: boolean) => Promise<void>;
|
|
258
261
|
};
|
|
259
262
|
export type ApFieldTreeSelectExpose = Omit<ApFieldSelectExpose, 'request'> & {
|
|
@@ -269,10 +272,7 @@ export type ApFieldSliderProps = BasicApFieldProps<Partial<SliderProps>> & {
|
|
|
269
272
|
emptyText?: string;
|
|
270
273
|
defaultValue?: number | [number, number];
|
|
271
274
|
};
|
|
272
|
-
export type ApFieldSliderExpose =
|
|
273
|
-
focus: () => void;
|
|
274
|
-
blur: () => void;
|
|
275
|
-
};
|
|
275
|
+
export type ApFieldSliderExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
276
276
|
export type ApFieldSegmentedProps = BasicApFieldProps<SegmentedProps> & {
|
|
277
277
|
emptyText?: string;
|
|
278
278
|
defaultValue?: string | number;
|
|
@@ -281,12 +281,10 @@ export type ApFieldSegmentedProps = BasicApFieldProps<SegmentedProps> & {
|
|
|
281
281
|
export type ApFieldRateProps = BasicApFieldProps<RateProps> & {
|
|
282
282
|
defaultValue?: number;
|
|
283
283
|
};
|
|
284
|
-
export type ApFieldRateExpose =
|
|
285
|
-
focus: () => void;
|
|
286
|
-
blur: () => void;
|
|
287
|
-
};
|
|
284
|
+
export type ApFieldRateExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
288
285
|
export type ApFieldSecondProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'>> & {
|
|
289
286
|
placeholder?: string;
|
|
290
287
|
emptyText?: string;
|
|
291
288
|
};
|
|
292
289
|
export type ApFieldSecondExpose = ApiFieldNumberExpose;
|
|
290
|
+
export {};
|
|
@@ -382,8 +382,8 @@ declare function __VLS_template(): {
|
|
|
382
382
|
};
|
|
383
383
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
384
384
|
declare const __VLS_component: DefineComponent<ApFieldNumberProps, {
|
|
385
|
-
focus: () => void;
|
|
386
385
|
blur: () => void;
|
|
386
|
+
focus: () => void;
|
|
387
387
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
388
388
|
"update:value": (...args: any[]) => void;
|
|
389
389
|
}, string, PublicProps, Readonly<ApFieldNumberProps> & Readonly<{
|
|
@@ -7,8 +7,7 @@ import { RadioGroupButtonStyle, RadioGroupOptionType } from '@aplus-frontend/ant
|
|
|
7
7
|
import { RadioChangeEvent } from '@aplus-frontend/antdv';
|
|
8
8
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
9
9
|
declare const _default: DefineComponent<ApFieldRadioProps, {
|
|
10
|
-
|
|
11
|
-
blur: () => void;
|
|
10
|
+
request: () => void;
|
|
12
11
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
13
12
|
"update:value": (...args: any[]) => void;
|
|
14
13
|
}, string, PublicProps, Readonly<ApFieldRadioProps> & Readonly<{
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Spin as
|
|
3
|
-
import { isNil as
|
|
1
|
+
import { defineComponent as h, ref as q, onMounted as V, computed as C, unref as e, createElementBlock as p, openBlock as a, Fragment as u, createTextVNode as O, toDisplayString as S, createBlock as m, mergeProps as U } from "vue";
|
|
2
|
+
import { Spin as _, RadioGroup as N } from "@aplus-frontend/antdv";
|
|
3
|
+
import { isNil as R, omit as z } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getOptionValue as
|
|
9
|
-
import { useControllableValue as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
const
|
|
6
|
+
import F from "../hooks/use-options.mjs";
|
|
7
|
+
import G from "../style/index.mjs";
|
|
8
|
+
import { getOptionValue as A, getOptionLabel as D } from "./helper.mjs";
|
|
9
|
+
import { useControllableValue as E } from "../../hooks/useControllableValue.mjs";
|
|
10
|
+
import { useNamespace as I } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
const X = /* @__PURE__ */ h({
|
|
12
12
|
name: "ApFieldRadio",
|
|
13
13
|
__name: "index",
|
|
14
14
|
props: {
|
|
@@ -32,40 +32,36 @@ const $ = /* @__PURE__ */ V({
|
|
|
32
32
|
request: {}
|
|
33
33
|
},
|
|
34
34
|
emits: ["update:value"],
|
|
35
|
-
setup(d, { expose:
|
|
36
|
-
const t = d, v =
|
|
37
|
-
|
|
38
|
-
t.request && (
|
|
39
|
-
|
|
35
|
+
setup(d, { expose: c, emit: f }) {
|
|
36
|
+
const t = d, v = f, { options: n, updateOptions: y } = F(t), { value: r, updateValue: g } = E(t, v), { b: k, m: x } = I("field-radio"), b = G("field"), l = q(!1);
|
|
37
|
+
async function i() {
|
|
38
|
+
t.request && (l.value = !0, t.request?.().then((o) => y(o)).finally(() => {
|
|
39
|
+
l.value = !1;
|
|
40
40
|
}));
|
|
41
|
+
}
|
|
42
|
+
V(() => {
|
|
43
|
+
i();
|
|
41
44
|
});
|
|
42
|
-
const
|
|
43
|
-
const o = e(
|
|
44
|
-
if (
|
|
45
|
+
const B = C(() => {
|
|
46
|
+
const o = e(r);
|
|
47
|
+
if (R(o))
|
|
45
48
|
return t.emptyText;
|
|
46
|
-
const
|
|
47
|
-
(
|
|
49
|
+
const s = n.value?.find(
|
|
50
|
+
(T) => o === A(T)
|
|
48
51
|
);
|
|
49
|
-
return
|
|
52
|
+
return D(s) || t.emptyText;
|
|
50
53
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return f({
|
|
58
|
-
focus: B,
|
|
59
|
-
blur: T
|
|
60
|
-
}), (o, i) => o.mode === "read" ? (a(), s(p, { key: 0 }, [
|
|
61
|
-
S(U(h.value), 1)
|
|
62
|
-
], 64)) : (a(), s(p, { key: 1 }, [
|
|
63
|
-
n.value ? (a(), m(e(N), {
|
|
54
|
+
return c({
|
|
55
|
+
request: i
|
|
56
|
+
}), (o, s) => o.mode === "read" ? (a(), p(u, { key: 0 }, [
|
|
57
|
+
O(S(B.value), 1)
|
|
58
|
+
], 64)) : (a(), p(u, { key: 1 }, [
|
|
59
|
+
l.value ? (a(), m(e(_), {
|
|
64
60
|
key: 0,
|
|
65
61
|
size: "small"
|
|
66
|
-
})) : (a(), m(e(
|
|
62
|
+
})) : (a(), m(e(N), U(
|
|
67
63
|
{ key: 1 },
|
|
68
|
-
e(
|
|
64
|
+
e(z)(t, [
|
|
69
65
|
"value",
|
|
70
66
|
"onUpdate:value",
|
|
71
67
|
"options",
|
|
@@ -73,11 +69,10 @@ const $ = /* @__PURE__ */ V({
|
|
|
73
69
|
"vertical"
|
|
74
70
|
]),
|
|
75
71
|
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
class: [e(k)(), o.vertical ? e(b)("vertical") : null, e(x)],
|
|
72
|
+
ref: "radioGroupRef",
|
|
73
|
+
value: e(r),
|
|
74
|
+
options: e(n),
|
|
75
|
+
class: [e(k)(), o.vertical ? e(x)("vertical") : null, e(b)],
|
|
81
76
|
"onUpdate:value": e(g)
|
|
82
77
|
}
|
|
83
78
|
), null, 16, ["value", "options", "class", "onUpdate:value"]))
|
|
@@ -85,5 +80,5 @@ const $ = /* @__PURE__ */ V({
|
|
|
85
80
|
}
|
|
86
81
|
});
|
|
87
82
|
export {
|
|
88
|
-
|
|
83
|
+
X as default
|
|
89
84
|
};
|
|
@@ -270,8 +270,8 @@ declare function __VLS_template(): {
|
|
|
270
270
|
};
|
|
271
271
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
272
272
|
declare const __VLS_component: DefineComponent<ApFieldRateProps, {
|
|
273
|
-
focus: () => void;
|
|
274
273
|
blur: () => void;
|
|
274
|
+
focus: () => void;
|
|
275
275
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
276
276
|
"update:value": (...args: any[]) => void;
|
|
277
277
|
}, string, PublicProps, Readonly<ApFieldRateProps> & Readonly<{
|
|
@@ -17,8 +17,8 @@ declare function __VLS_template(): {
|
|
|
17
17
|
};
|
|
18
18
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
19
|
declare const __VLS_component: DefineComponent<ApFieldSecondProps, {
|
|
20
|
-
focus: () => void;
|
|
21
20
|
blur: () => void;
|
|
21
|
+
focus: () => void;
|
|
22
22
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
23
23
|
"update:value": (...args: any[]) => void;
|
|
24
24
|
}, string, PublicProps, Readonly<ApFieldSecondProps> & Readonly<{
|
|
@@ -322,7 +322,7 @@ declare function __VLS_template(): {
|
|
|
322
322
|
};
|
|
323
323
|
animation: StringConstructor;
|
|
324
324
|
direction: {
|
|
325
|
-
type:
|
|
325
|
+
type: PropType<"rtl" | "ltr">;
|
|
326
326
|
};
|
|
327
327
|
disabled: {
|
|
328
328
|
type: BooleanConstructor;
|
|
@@ -454,8 +454,8 @@ declare function __VLS_template(): {
|
|
|
454
454
|
};
|
|
455
455
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
456
456
|
declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
|
|
457
|
-
focus: () => void;
|
|
458
457
|
blur: () => void;
|
|
458
|
+
focus: () => void;
|
|
459
459
|
request: (clear?: boolean) => Promise<void>;
|
|
460
460
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
461
461
|
"update:value": (...args: any[]) => void;
|
|
@@ -468,7 +468,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
|
|
|
468
468
|
disabled: boolean;
|
|
469
469
|
virtual: boolean;
|
|
470
470
|
autofocus: boolean;
|
|
471
|
-
lazy: boolean;
|
|
471
|
+
lazy: boolean | "first-focus";
|
|
472
472
|
loading: boolean;
|
|
473
473
|
bordered: boolean;
|
|
474
474
|
allowClear: boolean;
|
|
@@ -481,6 +481,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
|
|
|
481
481
|
emptyText: string;
|
|
482
482
|
searchMode: "filter" | "request";
|
|
483
483
|
refetchOnFocus: boolean;
|
|
484
|
+
fetchOnFocus: boolean;
|
|
484
485
|
addAll: boolean | number;
|
|
485
486
|
searchDelay: number;
|
|
486
487
|
allowOnlySelect: boolean;
|
|
@@ -782,7 +783,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
|
|
|
782
783
|
};
|
|
783
784
|
animation: StringConstructor;
|
|
784
785
|
direction: {
|
|
785
|
-
type:
|
|
786
|
+
type: PropType<"rtl" | "ltr">;
|
|
786
787
|
};
|
|
787
788
|
disabled: {
|
|
788
789
|
type: BooleanConstructor;
|