@aplus-frontend/ui 0.5.13 → 0.5.15
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-button/interface.d.ts +1 -1
- package/es/src/ap-field/date/constant.d.ts +1 -1
- package/es/src/ap-field/date/constant.mjs +14 -2
- package/es/src/ap-field/date/index.vue.mjs +59 -58
- package/es/src/ap-field/date/interface.d.ts +1 -1
- package/es/src/ap-field/date-range/index.vue.mjs +67 -66
- package/es/src/ap-field/interface.d.ts +18 -2
- package/es/src/ap-field/select/index.vue.d.ts +1 -0
- package/es/src/ap-field/select/index.vue.mjs +98 -92
- package/es/src/ap-modal/index.mjs +33 -15
- package/es/src/ap-modal/utils/confirm.d.ts +17 -0
- package/es/src/ap-modal/utils/confirm.mjs +110 -0
- package/es/src/ap-modal/utils/createModal.mjs +2 -1
- package/es/src/ap-modal/utils/destroyFns.d.ts +2 -0
- package/es/src/ap-modal/utils/destroyFns.mjs +4 -0
- package/es/src/ap-table/constants.d.ts +3 -0
- package/lib/src/ap-button/interface.d.ts +1 -1
- package/lib/src/ap-field/date/constant.d.ts +1 -1
- package/lib/src/ap-field/date/constant.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date/interface.d.ts +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +18 -2
- package/lib/src/ap-field/select/index.vue.d.ts +1 -0
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-modal/index.js +1 -1
- package/lib/src/ap-modal/utils/confirm.d.ts +17 -0
- package/lib/src/ap-modal/utils/confirm.js +1 -0
- package/lib/src/ap-modal/utils/createModal.js +1 -1
- package/lib/src/ap-modal/utils/destroyFns.d.ts +2 -0
- package/lib/src/ap-modal/utils/destroyFns.js +1 -0
- package/lib/src/ap-table/constants.d.ts +3 -0
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PickerMode } from '@aplus-frontend/antdv/es/vc-picker/interface';
|
|
2
2
|
import { ApFormatPresetType } from './interface';
|
|
3
3
|
export declare const ApFieldDatePresetFormats: string[];
|
|
4
|
-
export declare const PRESET_FORMAT_MAP: Record<ApFormatPresetType, string>;
|
|
4
|
+
export declare const PRESET_FORMAT_MAP: Record<ApFormatPresetType, string | undefined>;
|
|
5
5
|
export declare const PRESET_FORMAT_PICK_MAP: Record<ApFormatPresetType, PickerMode>;
|
|
6
6
|
export declare const PRESET_FORMAT_TIME_MAP: Record<ApFormatPresetType, {
|
|
7
7
|
showTime: boolean;
|
|
@@ -1,31 +1,43 @@
|
|
|
1
1
|
const Y = [
|
|
2
2
|
"Y",
|
|
3
|
+
"Y-Q",
|
|
3
4
|
"Y-M",
|
|
5
|
+
"Y-W",
|
|
4
6
|
"Y-D",
|
|
5
7
|
"Y-h",
|
|
6
8
|
"Y-m",
|
|
7
9
|
"Y-s"
|
|
8
10
|
], e = {
|
|
9
11
|
Y: "YYYY",
|
|
12
|
+
"Y-Q": void 0,
|
|
10
13
|
"Y-M": "YYYY-MM",
|
|
14
|
+
"Y-W": void 0,
|
|
11
15
|
"Y-D": "YYYY-MM-DD",
|
|
12
16
|
"Y-h": "YYYY-MM-DD HH",
|
|
13
17
|
"Y-m": "YYYY-MM-DD HH:mm",
|
|
14
18
|
"Y-s": "YYYY-MM-DD HH:mm:ss"
|
|
15
19
|
}, s = {
|
|
16
20
|
Y: "year",
|
|
21
|
+
"Y-Q": "quarter",
|
|
17
22
|
"Y-M": "month",
|
|
23
|
+
"Y-W": "week",
|
|
18
24
|
"Y-D": "date",
|
|
19
25
|
"Y-h": "date",
|
|
20
26
|
"Y-m": "date",
|
|
21
27
|
"Y-s": "date"
|
|
22
|
-
},
|
|
28
|
+
}, o = {
|
|
23
29
|
Y: {
|
|
24
30
|
showTime: !1
|
|
25
31
|
},
|
|
32
|
+
"Y-Q": {
|
|
33
|
+
showTime: !1
|
|
34
|
+
},
|
|
26
35
|
"Y-M": {
|
|
27
36
|
showTime: !1
|
|
28
37
|
},
|
|
38
|
+
"Y-W": {
|
|
39
|
+
showTime: !1
|
|
40
|
+
},
|
|
29
41
|
"Y-D": {
|
|
30
42
|
showTime: !1
|
|
31
43
|
},
|
|
@@ -46,5 +58,5 @@ export {
|
|
|
46
58
|
Y as ApFieldDatePresetFormats,
|
|
47
59
|
e as PRESET_FORMAT_MAP,
|
|
48
60
|
s as PRESET_FORMAT_PICK_MAP,
|
|
49
|
-
|
|
61
|
+
o as PRESET_FORMAT_TIME_MAP
|
|
50
62
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { InputGroup as
|
|
4
|
-
import { ApFieldDatePresetFormats as
|
|
1
|
+
import { defineComponent as E, computed as u, unref as a, createElementBlock as g, createBlock as h, openBlock as s, Fragment as k, createTextVNode as w, toDisplayString as P, normalizeStyle as N, withCtx as f, createCommentVNode as j, createVNode as I, isRef as U, renderList as C, mergeProps as H, createSlots as K, renderSlot as $, normalizeProps as G, guardReactiveProps as L } from "vue";
|
|
2
|
+
import d from "dayjs";
|
|
3
|
+
import { InputGroup as W, Select as Y, SelectOption as Z, DatePicker as q } from "@aplus-frontend/antdv";
|
|
4
|
+
import { ApFieldDatePresetFormats as J, PRESET_FORMAT_MAP as S, PRESET_FORMAT_PICK_MAP as Q, PRESET_FORMAT_TIME_MAP as X } from "./constant.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { isNil as T, omit as
|
|
7
|
-
import { formatDayWithTimezone as
|
|
8
|
-
import { getTimeFormatToZone as
|
|
9
|
-
import { useDefaultPlaceholder as
|
|
10
|
-
import { useDateTimezone as
|
|
11
|
-
import { useControllableValue as
|
|
12
|
-
const
|
|
6
|
+
import { isNil as T, omit as z } from "lodash-unified";
|
|
7
|
+
import { formatDayWithTimezone as ee } from "./helper.mjs";
|
|
8
|
+
import { getTimeFormatToZone as oe } from "@aplus-frontend/utils";
|
|
9
|
+
import { useDefaultPlaceholder as te } from "../hooks/use-default-placeholder.mjs";
|
|
10
|
+
import { useDateTimezone as ae } from "../hooks/use-date-timezone.mjs";
|
|
11
|
+
import { useControllableValue as ne } from "../../hooks/useControllableValue.mjs";
|
|
12
|
+
const ye = /* @__PURE__ */ E({
|
|
13
13
|
name: "ApFieldDate",
|
|
14
14
|
__name: "index",
|
|
15
15
|
props: {
|
|
@@ -84,27 +84,28 @@ const ve = /* @__PURE__ */ x({
|
|
|
84
84
|
onChange: {},
|
|
85
85
|
onOk: {},
|
|
86
86
|
format: { default: "Y-D" },
|
|
87
|
+
shownFormat: {},
|
|
87
88
|
formatBegins: { type: Boolean, default: !0 },
|
|
88
89
|
timezone: {}
|
|
89
90
|
},
|
|
90
91
|
emits: ["update:value"],
|
|
91
92
|
setup(O, { emit: b }) {
|
|
92
|
-
const e = O,
|
|
93
|
+
const e = O, F = b, { value: c, updateValue: B } = ne(
|
|
93
94
|
e,
|
|
94
|
-
|
|
95
|
-
),
|
|
96
|
-
() =>
|
|
97
|
-
),
|
|
98
|
-
() =>
|
|
99
|
-
), v =
|
|
95
|
+
F
|
|
96
|
+
), _ = te("Date", e), { currentTimezone: i } = ae(e), l = u(
|
|
97
|
+
() => J.indexOf(e.format) > -1
|
|
98
|
+
), A = u(() => e.shownFormat ? e.shownFormat : l.value ? S[e.format] : e.format), m = u(
|
|
99
|
+
() => l.value ? S[e.format] : e.format
|
|
100
|
+
), v = u(() => {
|
|
100
101
|
if (T(a(c)))
|
|
101
102
|
return;
|
|
102
|
-
let t =
|
|
103
|
-
return e.timezone && (t =
|
|
104
|
-
}),
|
|
105
|
-
const t = a(
|
|
103
|
+
let t = d(a(c));
|
|
104
|
+
return e.timezone && (t = d(oe(a(c), i.value))), t;
|
|
105
|
+
}), R = u(() => a(l) ? e.picker ?? Q[e.format] : e.picker), M = u(() => {
|
|
106
|
+
const t = a(l) ? X[e.format] : {};
|
|
106
107
|
return {
|
|
107
|
-
...
|
|
108
|
+
...z(e, [
|
|
108
109
|
"value",
|
|
109
110
|
"defaultValue",
|
|
110
111
|
"onChange",
|
|
@@ -113,85 +114,85 @@ const ve = /* @__PURE__ */ x({
|
|
|
113
114
|
"onUpdate:value",
|
|
114
115
|
"mode"
|
|
115
116
|
]),
|
|
116
|
-
placeholder: a(
|
|
117
|
+
placeholder: a(_),
|
|
117
118
|
...t
|
|
118
119
|
};
|
|
119
|
-
}), y = (t, n, o = !0) =>
|
|
120
|
-
function
|
|
120
|
+
}), y = (t, n, o = !0) => ee(i.value)(t, n, o);
|
|
121
|
+
function D(t) {
|
|
121
122
|
if (T(t)) {
|
|
122
123
|
B(null);
|
|
123
124
|
return;
|
|
124
125
|
}
|
|
125
|
-
const n =
|
|
126
|
+
const n = d(t);
|
|
126
127
|
B(
|
|
127
128
|
y(
|
|
128
129
|
n,
|
|
129
|
-
a(
|
|
130
|
+
a(l) ? a(m) : void 0,
|
|
130
131
|
e.formatBegins
|
|
131
132
|
)
|
|
132
133
|
);
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function x(t, n) {
|
|
135
136
|
var p;
|
|
136
|
-
const o =
|
|
137
|
+
const o = d(t), r = t ? y(
|
|
137
138
|
o,
|
|
138
|
-
a(
|
|
139
|
+
a(l) ? a(m) : void 0,
|
|
139
140
|
e.formatBegins
|
|
140
141
|
) : null;
|
|
141
|
-
(p = e.onChange) == null || p.call(e,
|
|
142
|
+
(p = e.onChange) == null || p.call(e, r, n);
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
-
var
|
|
145
|
-
const n =
|
|
144
|
+
function V(t) {
|
|
145
|
+
var r;
|
|
146
|
+
const n = d(t), o = t ? y(
|
|
146
147
|
n,
|
|
147
|
-
a(
|
|
148
|
+
a(l) ? a(m) : void 0,
|
|
148
149
|
e.formatBegins
|
|
149
150
|
) : null;
|
|
150
|
-
(
|
|
151
|
+
(r = e.onOk) == null || r.call(e, o);
|
|
151
152
|
}
|
|
152
|
-
return (t, n) => t.mode === "read" ? (
|
|
153
|
-
P(
|
|
154
|
-
], 64)) : (
|
|
153
|
+
return (t, n) => t.mode === "read" ? (s(), g(k, { key: 0 }, [
|
|
154
|
+
w(P(v.value ? a(d)(v.value).format(m.value) : t.emptyText), 1)
|
|
155
|
+
], 64)) : (s(), h(a(W), {
|
|
155
156
|
key: 1,
|
|
156
157
|
compact: "",
|
|
157
|
-
style:
|
|
158
|
+
style: N({
|
|
158
159
|
display: Array.isArray(e.timezone) && e.timezone.length ? "flex" : "block"
|
|
159
160
|
})
|
|
160
161
|
}, {
|
|
161
162
|
default: f(() => [
|
|
162
|
-
Array.isArray(e.timezone) && e.timezone.length ? (
|
|
163
|
+
Array.isArray(e.timezone) && e.timezone.length ? (s(), h(a(Y), {
|
|
163
164
|
key: 0,
|
|
164
|
-
value: a(
|
|
165
|
-
"onUpdate:value": n[0] || (n[0] = (o) =>
|
|
165
|
+
value: a(i),
|
|
166
|
+
"onUpdate:value": n[0] || (n[0] = (o) => U(i) ? i.value = o : null),
|
|
166
167
|
"default-active-first-option": "",
|
|
167
168
|
"dropdown-match-select-width": !1,
|
|
168
169
|
style: { "max-width": "50%" }
|
|
169
170
|
}, {
|
|
170
171
|
default: f(() => [
|
|
171
|
-
(
|
|
172
|
+
(s(!0), g(k, null, C(e.timezone, (o) => (s(), h(a(Z), {
|
|
172
173
|
key: o == null ? void 0 : o.value,
|
|
173
174
|
value: o == null ? void 0 : o.value
|
|
174
175
|
}, {
|
|
175
176
|
default: f(() => [
|
|
176
|
-
P(
|
|
177
|
+
w(P((o == null ? void 0 : o.label) ?? (o == null ? void 0 : o.value)), 1)
|
|
177
178
|
]),
|
|
178
179
|
_: 2
|
|
179
180
|
}, 1032, ["value"]))), 128))
|
|
180
181
|
]),
|
|
181
182
|
_: 1
|
|
182
|
-
}, 8, ["value"])) :
|
|
183
|
-
|
|
183
|
+
}, 8, ["value"])) : j("", !0),
|
|
184
|
+
I(a(q), H(M.value, {
|
|
184
185
|
value: v.value,
|
|
185
|
-
format:
|
|
186
|
-
picker:
|
|
187
|
-
"onUpdate:value":
|
|
188
|
-
onChange:
|
|
189
|
-
onOk:
|
|
190
|
-
}),
|
|
191
|
-
|
|
192
|
-
name:
|
|
186
|
+
format: A.value,
|
|
187
|
+
picker: R.value,
|
|
188
|
+
"onUpdate:value": D,
|
|
189
|
+
onChange: x,
|
|
190
|
+
onOk: V
|
|
191
|
+
}), K({ _: 2 }, [
|
|
192
|
+
C(t.$slots, (o, r) => ({
|
|
193
|
+
name: r,
|
|
193
194
|
fn: f((p) => [
|
|
194
|
-
|
|
195
|
+
$(t.$slots, r, G(L(p || {})))
|
|
195
196
|
])
|
|
196
197
|
}))
|
|
197
198
|
]), 1040, ["value", "format", "picker"])
|
|
@@ -201,5 +202,5 @@ const ve = /* @__PURE__ */ x({
|
|
|
201
202
|
}
|
|
202
203
|
});
|
|
203
204
|
export {
|
|
204
|
-
|
|
205
|
+
ye as default
|
|
205
206
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type OmitValue<T> = Omit<T, 'value' | 'defaultValue' | 'onChange' | 'mode' | 'format'>;
|
|
2
|
-
export type ApFormatPresetType = 'Y' | 'Y-M' | 'Y-D' | 'Y-h' | 'Y-m' | 'Y-s';
|
|
2
|
+
export type ApFormatPresetType = 'Y' | 'Y-Q' | 'Y-M' | 'Y-W' | 'Y-D' | 'Y-h' | 'Y-m' | 'Y-s';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApFieldDatePresetFormats as
|
|
1
|
+
import { defineComponent as q, useSlots as J, computed as f, unref as t, isVNode as Q, createVNode as T, Fragment as y, createElementBlock as k, createBlock as C, openBlock as d, createTextVNode as B, toDisplayString as P, resolveDynamicComponent as X, normalizeStyle as z, withCtx as D, createCommentVNode as ee, isRef as ne, renderList as A, mergeProps as oe, createSlots as te, renderSlot as ae, normalizeProps as re, guardReactiveProps as le } from "vue";
|
|
2
|
+
import { ApFieldDatePresetFormats as ue, PRESET_FORMAT_MAP as R, PRESET_FORMAT_PICK_MAP as de, PRESET_FORMAT_TIME_MAP as ie } from "../date/constant.mjs";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { isNil as
|
|
4
|
+
import { isNil as F, omit as _, isString as h, isFunction as se } from "lodash-unified";
|
|
5
5
|
import i from "dayjs";
|
|
6
|
-
import { InputGroup as
|
|
7
|
-
import { formatDayWithTimezone as
|
|
8
|
-
import { SwapRightOutlined as
|
|
6
|
+
import { InputGroup as fe, Select as me, SelectOption as pe, DatePicker as ce } from "@aplus-frontend/antdv";
|
|
7
|
+
import { formatDayWithTimezone as ye } from "../date/helper.mjs";
|
|
8
|
+
import { SwapRightOutlined as he } from "@ant-design/icons-vue";
|
|
9
9
|
import { omitUndefined as ve } from "../../utils/index.mjs";
|
|
10
|
-
import { getTimeFormatToZone as
|
|
11
|
-
import { useDefaultPlaceholder as
|
|
12
|
-
import { useDefaultPresets as
|
|
13
|
-
import { useDateTimezone as
|
|
14
|
-
import { useControllableValue as
|
|
15
|
-
const
|
|
10
|
+
import { getTimeFormatToZone as N } from "@aplus-frontend/utils";
|
|
11
|
+
import { useDefaultPlaceholder as ge } from "../hooks/use-default-placeholder.mjs";
|
|
12
|
+
import { useDefaultPresets as Se } from "../hooks/use-default-presets.mjs";
|
|
13
|
+
import { useDateTimezone as ke } from "../hooks/use-date-timezone.mjs";
|
|
14
|
+
import { useControllableValue as Ce } from "../../hooks/useControllableValue.mjs";
|
|
15
|
+
const Ee = /* @__PURE__ */ q({
|
|
16
16
|
__name: "index",
|
|
17
17
|
props: {
|
|
18
18
|
mode: {
|
|
@@ -147,6 +147,7 @@ const xe = /* @__PURE__ */ Y({
|
|
|
147
147
|
format: {
|
|
148
148
|
default: "Y-D"
|
|
149
149
|
},
|
|
150
|
+
shownFormat: {},
|
|
150
151
|
timezone: {},
|
|
151
152
|
readModeSeparator: {},
|
|
152
153
|
presets: {
|
|
@@ -154,94 +155,94 @@ const xe = /* @__PURE__ */ Y({
|
|
|
154
155
|
}
|
|
155
156
|
},
|
|
156
157
|
emits: ["update:value"],
|
|
157
|
-
setup(
|
|
158
|
-
emit:
|
|
158
|
+
setup(x, {
|
|
159
|
+
emit: E
|
|
159
160
|
}) {
|
|
160
|
-
const n =
|
|
161
|
+
const n = x, V = E, O = J(), s = f(() => ue.indexOf(n.format) > -1), v = f(() => s.value ? R[n.format] : n.format), {
|
|
161
162
|
value: g,
|
|
162
|
-
updateValue:
|
|
163
|
-
} =
|
|
163
|
+
updateValue: w
|
|
164
|
+
} = Ce(n, V), I = f(() => n.shownFormat ? n.shownFormat : s.value ? R[n.format] : n.format), U = ge("DateRange", n), {
|
|
164
165
|
currentTimezone: u
|
|
165
|
-
} =
|
|
166
|
-
presets:
|
|
167
|
-
changeCurrentDate:
|
|
168
|
-
} =
|
|
166
|
+
} = ke(n), {
|
|
167
|
+
presets: j,
|
|
168
|
+
changeCurrentDate: H
|
|
169
|
+
} = Se({
|
|
169
170
|
...n,
|
|
170
171
|
timezone: u
|
|
171
|
-
}),
|
|
172
|
+
}), m = (e, a, r = !0) => ye(u.value)(e, a, r), S = f(() => {
|
|
172
173
|
var l, o;
|
|
173
174
|
const e = t(g);
|
|
174
|
-
if (
|
|
175
|
+
if (F(e) || !(e != null && e.length))
|
|
175
176
|
return e;
|
|
176
|
-
const a = u.value ?
|
|
177
|
+
const a = u.value ? N(t(g)[0], u.value) : (l = t(g)) == null ? void 0 : l[0], r = n.timezone ? N(t(g)[1], u.value) : (o = t(g)) == null ? void 0 : o[1];
|
|
177
178
|
return [i(a), i(r)];
|
|
178
|
-
}),
|
|
179
|
-
const e = t(s) ?
|
|
179
|
+
}), K = f(() => t(s) ? n.picker ?? de[n.format] : n.picker), $ = f(() => {
|
|
180
|
+
const e = t(s) ? ie[n.format] : {};
|
|
180
181
|
return {
|
|
181
182
|
...ve(_(n, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
|
|
182
|
-
placeholder: t(
|
|
183
|
-
presets: t(
|
|
183
|
+
placeholder: t(U),
|
|
184
|
+
presets: t(j),
|
|
184
185
|
...e
|
|
185
186
|
};
|
|
186
187
|
});
|
|
187
|
-
function
|
|
188
|
+
function G(e) {
|
|
188
189
|
if (!e) {
|
|
189
|
-
|
|
190
|
+
w(e);
|
|
190
191
|
return;
|
|
191
192
|
}
|
|
192
193
|
let a = h(e[0]) ? i(e[0]) : e[0], r = h(e[1]) ? i(e[1]) : e[1];
|
|
193
|
-
const l = t(s) ? t(
|
|
194
|
-
|
|
194
|
+
const l = t(s) ? t(v) : void 0;
|
|
195
|
+
w([m(a, l), m(r, l, !1)]);
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
+
function L(e) {
|
|
197
198
|
var c;
|
|
198
|
-
const a = h(e[0]) ? i(e[0]) : e[0], r = h(e[1]) ? i(e[1]) : e[1], l = t(s) ? t(
|
|
199
|
-
(c = n.onOk) == null || c.call(n, [o,
|
|
199
|
+
const a = h(e[0]) ? i(e[0]) : e[0], r = h(e[1]) ? i(e[1]) : e[1], l = t(s) ? t(v) : void 0, o = e[0] ? m(a, l) : null, p = e[1] ? m(r, l, !1) : null;
|
|
200
|
+
(c = n.onOk) == null || c.call(n, [o, p]);
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
+
function W(e) {
|
|
202
203
|
var a;
|
|
203
|
-
e &&
|
|
204
|
+
e && H(), (a = n.onOpenChange) == null || a.call(n, e);
|
|
204
205
|
}
|
|
205
|
-
function
|
|
206
|
-
var
|
|
207
|
-
if (
|
|
208
|
-
(
|
|
206
|
+
function Y(e, a) {
|
|
207
|
+
var M, b;
|
|
208
|
+
if (F(e)) {
|
|
209
|
+
(M = n.onChange) == null || M.call(n, e, a);
|
|
209
210
|
return;
|
|
210
211
|
}
|
|
211
|
-
const r = h(e[0]) ? i(e[0]) : e[0], l = h(e[1]) ? i(e[1]) : e[1], o = t(s) ? t(
|
|
212
|
-
(
|
|
212
|
+
const r = h(e[0]) ? i(e[0]) : e[0], l = h(e[1]) ? i(e[1]) : e[1], o = t(s) ? t(v) : void 0, p = e[0] ? m(r, o) : null, c = e[1] ? m(l, o, !1) : null;
|
|
213
|
+
(b = n.onChange) == null || b.call(n, [p, c], a);
|
|
213
214
|
}
|
|
214
|
-
const
|
|
215
|
+
const Z = f(() => {
|
|
215
216
|
var r;
|
|
216
217
|
const e = n.readModeSeparator;
|
|
217
218
|
if (e)
|
|
218
|
-
return
|
|
219
|
+
return Q(e) || se(e) ? n.readModeSeparator : T(y, null, [n.readModeSeparator]);
|
|
219
220
|
const a = (r = O.readModeSeparator) == null ? void 0 : r.call(O);
|
|
220
|
-
return a ? T(
|
|
221
|
+
return a ? T(y, null, [a]) : he;
|
|
221
222
|
});
|
|
222
223
|
return (e, a) => {
|
|
223
224
|
var r, l;
|
|
224
|
-
return e.mode === "read" ? (d(), k(
|
|
225
|
+
return e.mode === "read" ? (d(), k(y, {
|
|
225
226
|
key: 0
|
|
226
|
-
}, [S.value ? (d(), k(
|
|
227
|
+
}, [S.value ? (d(), k(y, {
|
|
227
228
|
key: 0
|
|
228
|
-
}, [B(P((r = S.value[0]) == null ? void 0 : r.format(
|
|
229
|
+
}, [B(P((r = S.value[0]) == null ? void 0 : r.format(v.value)) + " ", 1), (d(), C(X(Z.value))), B(" " + P((l = S.value[1]) == null ? void 0 : l.format(v.value)), 1)], 64)) : (d(), k(y, {
|
|
229
230
|
key: 1
|
|
230
|
-
}, [B(P(e.emptyText), 1)], 64))], 64)) : (d(), C(t(
|
|
231
|
+
}, [B(P(e.emptyText), 1)], 64))], 64)) : (d(), C(t(fe), {
|
|
231
232
|
key: 1,
|
|
232
233
|
compact: "",
|
|
233
|
-
style:
|
|
234
|
+
style: z({
|
|
234
235
|
display: Array.isArray(n.timezone) && n.timezone.length ? "flex" : "block"
|
|
235
236
|
})
|
|
236
237
|
}, {
|
|
237
|
-
default: D(() => [Array.isArray(n.timezone) && n.timezone.length ? (d(), C(t(
|
|
238
|
+
default: D(() => [Array.isArray(n.timezone) && n.timezone.length ? (d(), C(t(me), {
|
|
238
239
|
key: 0,
|
|
239
240
|
value: t(u),
|
|
240
|
-
"onUpdate:value": a[0] || (a[0] = (o) =>
|
|
241
|
+
"onUpdate:value": a[0] || (a[0] = (o) => ne(u) ? u.value = o : null),
|
|
241
242
|
"default-active-first-option": "",
|
|
242
243
|
"dropdown-match-select-width": !1
|
|
243
244
|
}, {
|
|
244
|
-
default: D(() => [(d(!0), k(
|
|
245
|
+
default: D(() => [(d(!0), k(y, null, A(n.timezone, (o) => (d(), C(t(pe), {
|
|
245
246
|
key: o == null ? void 0 : o.value,
|
|
246
247
|
value: o == null ? void 0 : o.value
|
|
247
248
|
}, {
|
|
@@ -249,19 +250,19 @@ const xe = /* @__PURE__ */ Y({
|
|
|
249
250
|
_: 2
|
|
250
251
|
}, 1032, ["value"]))), 128))]),
|
|
251
252
|
_: 1
|
|
252
|
-
}, 8, ["value"])) :
|
|
253
|
+
}, 8, ["value"])) : ee("", !0), T(t(ce).RangePicker, oe($.value, {
|
|
253
254
|
value: S.value,
|
|
254
|
-
picker:
|
|
255
|
-
format:
|
|
256
|
-
"onUpdate:value":
|
|
257
|
-
onChange:
|
|
258
|
-
onOk:
|
|
259
|
-
onOpenChange:
|
|
260
|
-
}),
|
|
255
|
+
picker: K.value,
|
|
256
|
+
format: I.value,
|
|
257
|
+
"onUpdate:value": G,
|
|
258
|
+
onChange: Y,
|
|
259
|
+
onOk: L,
|
|
260
|
+
onOpenChange: W
|
|
261
|
+
}), te({
|
|
261
262
|
_: 2
|
|
262
|
-
}, [
|
|
263
|
-
name:
|
|
264
|
-
fn: D((c) => [
|
|
263
|
+
}, [A(t(_)(e.$slots, "readModeSeparator"), (o, p) => ({
|
|
264
|
+
name: p,
|
|
265
|
+
fn: D((c) => [ae(e.$slots, p, re(le(c || {})))])
|
|
265
266
|
}))]), 1040, ["value", "picker", "format"])]),
|
|
266
267
|
_: 3
|
|
267
268
|
}, 8, ["style"]));
|
|
@@ -269,5 +270,5 @@ const xe = /* @__PURE__ */ Y({
|
|
|
269
270
|
}
|
|
270
271
|
});
|
|
271
272
|
export {
|
|
272
|
-
|
|
273
|
+
Ee as default
|
|
273
274
|
};
|
|
@@ -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';
|
|
@@ -41,6 +41,10 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
|
|
|
41
41
|
onChange?: (ts: number | null, dayStr: string) => void;
|
|
42
42
|
onOk?: (ts: number | null) => void;
|
|
43
43
|
format?: LiteralUnion<ApFormatPresetType, string>;
|
|
44
|
+
/**
|
|
45
|
+
* 只用于显示的自定义格式化
|
|
46
|
+
*/
|
|
47
|
+
shownFormat?: DatePickerProps['format'];
|
|
44
48
|
/**
|
|
45
49
|
* 格式化时间时是否以`format`的开始
|
|
46
50
|
* @default true
|
|
@@ -99,6 +103,10 @@ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'va
|
|
|
99
103
|
onChange?: (ts: RangeValue<number> | null, dayStr: [string, string]) => void;
|
|
100
104
|
onOk?: (ts: RangeValue<number>) => void;
|
|
101
105
|
format?: LiteralUnion<ApFormatPresetType, string>;
|
|
106
|
+
/**
|
|
107
|
+
* 只用于显示的format
|
|
108
|
+
*/
|
|
109
|
+
shownFormat?: RangePickerProps['format'];
|
|
102
110
|
/**
|
|
103
111
|
* 指定时区,指定后value会变为特定时区下的timestamp
|
|
104
112
|
*/
|
|
@@ -114,7 +122,7 @@ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'va
|
|
|
114
122
|
};
|
|
115
123
|
export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
|
|
116
124
|
emptyText?: string;
|
|
117
|
-
request?: (value?: string) => Promise<SelectProps['options']>;
|
|
125
|
+
request?: (value?: string, extraParams?: Recordable) => Promise<SelectProps['options']>;
|
|
118
126
|
multiple?: boolean;
|
|
119
127
|
value?: SelectProps['value'];
|
|
120
128
|
'onUpdate:value'?: SelectProps['onUpdate:value'];
|
|
@@ -134,6 +142,14 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
|
|
|
134
142
|
* 添加一个名为全部的节点(只在多选的情况下有效)
|
|
135
143
|
*/
|
|
136
144
|
addAll?: boolean | number;
|
|
145
|
+
/**
|
|
146
|
+
* 发起request额外的请求,变更后会自动重新发器请求
|
|
147
|
+
*/
|
|
148
|
+
params?: Recordable;
|
|
149
|
+
/**
|
|
150
|
+
* 发起搜索的时间间隔默认300ms
|
|
151
|
+
*/
|
|
152
|
+
searchDelay?: number;
|
|
137
153
|
};
|
|
138
154
|
export type ApFieldSelectExpose = {
|
|
139
155
|
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: {
|