@aplus-frontend/ui 7.17.3 → 7.18.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/ag-grid/hooks/use-editable-form-item-api.mjs +1 -1
- package/es/src/ag-grid/index.vue.mjs +183 -180
- package/es/src/ap-field/cascader/index.vue.mjs +9 -8
- package/es/src/ap-field/cascader/read.vue2.mjs +3 -2
- package/es/src/ap-field/checkbox/index.vue.mjs +12 -11
- package/es/src/ap-field/checkbox/read.vue2.mjs +5 -4
- package/es/src/ap-field/date/index.vue.mjs +83 -73
- package/es/src/ap-field/date/read.vue2.mjs +1 -0
- package/es/src/ap-field/date-range/index.vue.mjs +80 -70
- package/es/src/ap-field/date-range/read.vue2.mjs +3 -2
- package/es/src/ap-field/hooks/use-read-mode-render.d.ts +9 -0
- package/es/src/ap-field/hooks/use-read-mode-render.mjs +6 -0
- package/es/src/ap-field/interface.d.ts +8 -0
- package/es/src/ap-field/number/index.vue.mjs +57 -46
- package/es/src/ap-field/number/read.vue2.mjs +1 -0
- package/es/src/ap-field/radio/index.vue.mjs +17 -16
- package/es/src/ap-field/radio/read.vue2.mjs +1 -0
- package/es/src/ap-field/rate/index.vue.mjs +6 -5
- package/es/src/ap-field/second/index.vue.mjs +35 -20
- package/es/src/ap-field/second/read.vue2.mjs +1 -0
- package/es/src/ap-field/segmented/index.vue.mjs +15 -14
- package/es/src/ap-field/select/index.vue.mjs +53 -52
- package/es/src/ap-field/select/read.vue2.mjs +1 -0
- package/es/src/ap-field/slider/index.vue.mjs +11 -10
- package/es/src/ap-field/switch/index.vue.mjs +20 -19
- package/es/src/ap-field/switch/read.vue2.mjs +5 -4
- package/es/src/ap-field/text/index.vue2.mjs +35 -31
- package/es/src/ap-field/text/password.vue.d.ts +4 -4
- package/es/src/ap-field/text/password.vue.mjs +57 -48
- package/es/src/ap-field/text/read-password.vue2.mjs +6 -5
- package/es/src/ap-field/text/read.vue2.mjs +3 -2
- package/es/src/ap-field/text-area/index.vue.mjs +46 -36
- package/es/src/ap-field/text-area/read.vue2.mjs +1 -0
- package/es/src/ap-field/tree-select/index.vue.mjs +9 -8
- package/es/src/ap-field/tree-select/read.vue2.mjs +1 -0
- package/es/src/ap-form/items/cascader/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/checkbox/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/date/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/date-range/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/number/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/select/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/switch/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/text/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/text/password.vue.d.ts +3 -1
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +3 -1
- package/es/src/ap-table/constants.d.ts +11 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +109 -98
- package/es/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/es/src/business/batch-input-group/index.vue.mjs +11 -10
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-field/cascader/index.vue.js +1 -1
- package/lib/src/ap-field/cascader/read.vue2.js +1 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date/read.vue2.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/read.vue2.js +1 -1
- package/lib/src/ap-field/hooks/use-read-mode-render.d.ts +9 -0
- package/lib/src/ap-field/hooks/use-read-mode-render.js +1 -0
- package/lib/src/ap-field/interface.d.ts +8 -0
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/number/read.vue2.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/radio/read.vue2.js +1 -1
- package/lib/src/ap-field/rate/index.vue.js +1 -1
- package/lib/src/ap-field/second/index.vue.js +1 -1
- package/lib/src/ap-field/second/read.vue2.js +1 -1
- package/lib/src/ap-field/segmented/index.vue.js +1 -1
- 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.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/switch/read.vue2.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.d.ts +4 -4
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text/read-password.vue2.js +1 -1
- package/lib/src/ap-field/text/read.vue2.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/text-area/read.vue2.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
- package/lib/src/ap-form/items/cascader/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/checkbox/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/date/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/select/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/switch/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/text/password.vue.d.ts +3 -1
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +3 -1
- package/lib/src/ap-table/constants.d.ts +11 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ const ee = { key: 0 }, pe = /* @__PURE__ */ A({
|
|
|
13
13
|
class: {},
|
|
14
14
|
style: {},
|
|
15
15
|
emptyText: { default: "--" },
|
|
16
|
+
customReadMode: {},
|
|
16
17
|
multiple: { type: Boolean, default: void 0 },
|
|
17
18
|
size: {},
|
|
18
19
|
bordered: { type: Boolean, default: !0 },
|
|
@@ -97,7 +98,7 @@ const ee = { key: 0 }, pe = /* @__PURE__ */ A({
|
|
|
97
98
|
setup(N, { expose: k, emit: P }) {
|
|
98
99
|
const n = N, T = b(
|
|
99
100
|
() => J(n, ["onUpdate:value", "value", "options", "loadData"])
|
|
100
|
-
), I = L(),
|
|
101
|
+
), I = L(), R = P, i = O(), { value: f, updateValue: V } = Z(n, R), D = X("Cascader", n), { options: h, request: g, loading: y } = Y(n), v = b(() => {
|
|
101
102
|
const o = e(f);
|
|
102
103
|
if (!o?.length) return [];
|
|
103
104
|
const C = n.fieldNames?.label || "label", s = n.fieldNames?.value || "value";
|
|
@@ -105,15 +106,15 @@ const ee = { key: 0 }, pe = /* @__PURE__ */ A({
|
|
|
105
106
|
const r = [];
|
|
106
107
|
for (const p of c || []) {
|
|
107
108
|
if (t.find(
|
|
108
|
-
(
|
|
109
|
+
(F) => F === p[s]
|
|
109
110
|
) && r.push(p[C]), r.length === t.length)
|
|
110
111
|
return r;
|
|
111
112
|
p.children?.length && r.push(...a(p.children, t));
|
|
112
113
|
}
|
|
113
114
|
return r;
|
|
114
115
|
}
|
|
115
|
-
const d = [],
|
|
116
|
-
for (const c of
|
|
116
|
+
const d = [], z = Q(o[0]) ? o : [o];
|
|
117
|
+
for (const c of z) {
|
|
117
118
|
const t = a(h.value, c);
|
|
118
119
|
t.length && d.push(t);
|
|
119
120
|
}
|
|
@@ -122,12 +123,12 @@ const ee = { key: 0 }, pe = /* @__PURE__ */ A({
|
|
|
122
123
|
function _() {
|
|
123
124
|
i.value?.focus?.();
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
+
function M() {
|
|
126
127
|
i.value?.blur?.();
|
|
127
128
|
}
|
|
128
129
|
return k({
|
|
129
130
|
focus: _,
|
|
130
|
-
blur:
|
|
131
|
+
blur: M,
|
|
131
132
|
request: g
|
|
132
133
|
}), (o, C) => o.mode === "read" ? (l(), u(B, { key: 0 }, [
|
|
133
134
|
v.value.length ? (l(), w(e(W), {
|
|
@@ -144,9 +145,9 @@ const ee = { key: 0 }, pe = /* @__PURE__ */ A({
|
|
|
144
145
|
value: e(f),
|
|
145
146
|
loading: e(y),
|
|
146
147
|
options: e(h),
|
|
147
|
-
placeholder: e(
|
|
148
|
+
placeholder: e(D),
|
|
148
149
|
"load-data": o.loadData ? e(g) : void 0,
|
|
149
|
-
"onUpdate:value": e(
|
|
150
|
+
"onUpdate:value": e(V)
|
|
150
151
|
}), E({ _: 2 }, [
|
|
151
152
|
S(I, (s, a) => ({
|
|
152
153
|
name: a,
|
|
@@ -3,7 +3,7 @@ import { Space as N } from "@aplus-frontend/antdv";
|
|
|
3
3
|
import { isArray as S } from "lodash-unified";
|
|
4
4
|
const T = {
|
|
5
5
|
key: 0
|
|
6
|
-
},
|
|
6
|
+
}, M = /* @__PURE__ */ C({
|
|
7
7
|
name: "ApFieldCascaderRead",
|
|
8
8
|
__name: "read",
|
|
9
9
|
props: {
|
|
@@ -15,6 +15,7 @@ const T = {
|
|
|
15
15
|
emptyText: {
|
|
16
16
|
default: "--"
|
|
17
17
|
},
|
|
18
|
+
customReadMode: {},
|
|
18
19
|
multiple: {
|
|
19
20
|
type: Boolean
|
|
20
21
|
},
|
|
@@ -156,5 +157,5 @@ const T = {
|
|
|
156
157
|
}
|
|
157
158
|
});
|
|
158
159
|
export {
|
|
159
|
-
|
|
160
|
+
M as default
|
|
160
161
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as O, computed as T, useSlots as _, ref as P, onMounted as U, createElementBlock as r, openBlock as o, Fragment as s, unref as e, createTextVNode as d, toDisplayString as c, createBlock as f, mergeProps as F, createSlots as N, renderList as z, withCtx as A, renderSlot as L, normalizeProps as
|
|
2
|
-
import { Spin as
|
|
3
|
-
import { omit as
|
|
1
|
+
import { defineComponent as O, computed as T, useSlots as _, ref as P, onMounted as U, createElementBlock as r, openBlock as o, Fragment as s, unref as e, createTextVNode as d, toDisplayString as c, createBlock as f, mergeProps as F, createSlots as N, renderList as z, withCtx as A, renderSlot as L, normalizeProps as M, guardReactiveProps as R } from "vue";
|
|
2
|
+
import { Spin as j, CheckboxGroup as w } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as D, isFunction as E, isNil as G } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import
|
|
6
|
+
import I from "../hooks/use-options.mjs";
|
|
7
7
|
import $ from "../style/index.mjs";
|
|
8
8
|
import { getOptionValue as H, getOptionLabel as J } from "./helper.mjs";
|
|
9
9
|
import { useNamespace as K } from "../../config-provider/hooks/use-namespace.mjs";
|
|
@@ -17,6 +17,7 @@ const ne = /* @__PURE__ */ O({
|
|
|
17
17
|
class: {},
|
|
18
18
|
style: {},
|
|
19
19
|
emptyText: { default: "--" },
|
|
20
|
+
customReadMode: {},
|
|
20
21
|
defaultValue: {},
|
|
21
22
|
value: {},
|
|
22
23
|
onChange: {},
|
|
@@ -32,10 +33,10 @@ const ne = /* @__PURE__ */ O({
|
|
|
32
33
|
emits: ["update:value"],
|
|
33
34
|
setup(v, { expose: y, emit: k }) {
|
|
34
35
|
const x = k, t = v, h = T(
|
|
35
|
-
() =>
|
|
36
|
-
), g = _(), { options: u, updateOptions: b } =
|
|
36
|
+
() => D(t, ["onUpdate:value", "value", "request", "vertical", "emptyText"])
|
|
37
|
+
), g = _(), { options: u, updateOptions: b } = I(t), { b: C, m: S } = K("field-checkbox"), V = $("field"), n = P(!1);
|
|
37
38
|
async function p() {
|
|
38
|
-
if (
|
|
39
|
+
if (E(t.request))
|
|
39
40
|
return n.value = !0, t.request().then((a) => b(a)).finally(() => {
|
|
40
41
|
n.value = !1;
|
|
41
42
|
});
|
|
@@ -53,16 +54,16 @@ const ne = /* @__PURE__ */ O({
|
|
|
53
54
|
return y({
|
|
54
55
|
request: p
|
|
55
56
|
}), (a, W) => a.mode === "read" ? (o(), r(s, { key: 0 }, [
|
|
56
|
-
e(
|
|
57
|
+
e(G)(e(i)) ? (o(), r(s, { key: 0 }, [
|
|
57
58
|
d(c(t.emptyText), 1)
|
|
58
59
|
], 64)) : (o(), r(s, { key: 1 }, [
|
|
59
60
|
d(c(e(u)?.filter((l) => e(i).indexOf(e(H)(l)) > -1).map((l) => e(J)(l)).join("、") || t.emptyText), 1)
|
|
60
61
|
], 64))
|
|
61
62
|
], 64)) : (o(), r(s, { key: 1 }, [
|
|
62
|
-
n.value ? (o(), f(e(
|
|
63
|
+
n.value ? (o(), f(e(j), {
|
|
63
64
|
key: 0,
|
|
64
65
|
size: "small"
|
|
65
|
-
})) : (o(), f(e(
|
|
66
|
+
})) : (o(), f(e(w), F({ key: 1 }, h.value, {
|
|
66
67
|
options: e(u),
|
|
67
68
|
value: e(i),
|
|
68
69
|
class: [e(C)(), a.vertical ? e(S)("vertical") : null, e(V)],
|
|
@@ -71,7 +72,7 @@ const ne = /* @__PURE__ */ O({
|
|
|
71
72
|
z(g, (l, m) => ({
|
|
72
73
|
name: m,
|
|
73
74
|
fn: A((B) => [
|
|
74
|
-
L(a.$slots, m,
|
|
75
|
+
L(a.$slots, m, M(R(B || {})))
|
|
75
76
|
])
|
|
76
77
|
}))
|
|
77
78
|
]), 1040, ["options", "value", "class", "onUpdate:value"]))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as r, createElementBlock as
|
|
1
|
+
import { defineComponent as r, createElementBlock as a, unref as o, openBlock as l, Fragment as n, createTextVNode as p, toDisplayString as i } from "vue";
|
|
2
2
|
import { isNil as d } from "lodash-unified";
|
|
3
3
|
import { getOptionValue as m, getOptionLabel as u } from "./helper.mjs";
|
|
4
4
|
const g = /* @__PURE__ */ r({
|
|
@@ -9,6 +9,7 @@ const g = /* @__PURE__ */ r({
|
|
|
9
9
|
class: {},
|
|
10
10
|
style: {},
|
|
11
11
|
emptyText: { default: "--" },
|
|
12
|
+
customReadMode: {},
|
|
12
13
|
defaultValue: {},
|
|
13
14
|
value: {},
|
|
14
15
|
onChange: {},
|
|
@@ -22,10 +23,10 @@ const g = /* @__PURE__ */ r({
|
|
|
22
23
|
vertical: { type: Boolean }
|
|
23
24
|
},
|
|
24
25
|
setup(s) {
|
|
25
|
-
return (e, f) =>
|
|
26
|
+
return (e, f) => o(d)(e.value) ? (l(), a(n, { key: 0 }, [
|
|
26
27
|
p(i(e.emptyText), 1)
|
|
27
|
-
], 64)) : (l(),
|
|
28
|
-
p(i(e.options?.filter((t) => e.value.indexOf(
|
|
28
|
+
], 64)) : (l(), a(n, { key: 1 }, [
|
|
29
|
+
p(i(e.options?.filter((t) => e.value.indexOf(o(m)(t)) > -1).map((t) => o(u)(t)).join("、") || e.emptyText), 1)
|
|
29
30
|
], 64));
|
|
30
31
|
}
|
|
31
32
|
});
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { InputGroup as
|
|
3
|
-
import { getTimeFormatToZone as
|
|
1
|
+
import { defineComponent as N, useSlots as j, ref as I, computed as r, unref as o, createBlock as c, openBlock as s, withCtx as d, createElementVNode as U, toDisplayString as B, normalizeStyle as H, createVNode as g, createCommentVNode as K, isRef as W, createElementBlock as G, Fragment as L, renderList as b, createTextVNode as Y, mergeProps as Z, createSlots as $, renderSlot as q, normalizeProps as J, guardReactiveProps as Q } from "vue";
|
|
2
|
+
import { InputGroup as X, FormItemRest as ee, Select as oe, SelectOption as te, DatePicker as ae } from "@aplus-frontend/antdv";
|
|
3
|
+
import { getTimeFormatToZone as ne } from "@aplus-frontend/utils";
|
|
4
4
|
import u from "dayjs";
|
|
5
|
-
import { isNil as
|
|
5
|
+
import { isNil as P, omit as le } from "lodash-unified";
|
|
6
6
|
import "../../hooks/index.mjs";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
7
|
+
import "../../render/index.mjs";
|
|
8
|
+
import { useDateTimezone as re } from "../hooks/use-date-timezone.mjs";
|
|
9
|
+
import { useDefaultPlaceholder as de } from "../hooks/use-default-placeholder.mjs";
|
|
10
|
+
import { useReadModeRender as ue } from "../hooks/use-read-mode-render.mjs";
|
|
11
|
+
import { ApFieldDatePresetFormats as ie, PRESET_FORMAT_MAP as w, PRESET_FORMAT_PICK_MAP as se, PRESET_FORMAT_TIME_MAP as me } from "./constant.mjs";
|
|
12
|
+
import { formatDayWithTimezone as pe } from "./helper.mjs";
|
|
13
|
+
import { useControllableValue as fe } from "../../hooks/useControllableValue.mjs";
|
|
14
|
+
import ce from "../../render/render.mjs";
|
|
15
|
+
const Te = /* @__PURE__ */ N({
|
|
13
16
|
name: "ApFieldDate",
|
|
14
17
|
__name: "index",
|
|
15
18
|
props: {
|
|
@@ -17,6 +20,7 @@ const Pe = /* @__PURE__ */ I({
|
|
|
17
20
|
class: {},
|
|
18
21
|
style: {},
|
|
19
22
|
emptyText: { default: "--" },
|
|
23
|
+
customReadMode: {},
|
|
20
24
|
dropdownClassName: {},
|
|
21
25
|
dropdownAlign: {},
|
|
22
26
|
popupStyle: {},
|
|
@@ -92,23 +96,23 @@ const Pe = /* @__PURE__ */ I({
|
|
|
92
96
|
timezone: {}
|
|
93
97
|
},
|
|
94
98
|
emits: ["update:value"],
|
|
95
|
-
setup(
|
|
96
|
-
const
|
|
99
|
+
setup(R, { expose: C, emit: S }) {
|
|
100
|
+
const _ = j(), e = R, O = S, v = I(), { value: y, updateValue: k } = fe(
|
|
97
101
|
e,
|
|
98
|
-
|
|
99
|
-
),
|
|
100
|
-
() =>
|
|
101
|
-
),
|
|
102
|
-
() => l.value ?
|
|
103
|
-
),
|
|
104
|
-
if (
|
|
102
|
+
O
|
|
103
|
+
), T = de("Date", e), { currentTimezone: i } = re(e), l = r(
|
|
104
|
+
() => ie.indexOf(e.format) > -1
|
|
105
|
+
), F = r(() => e.shownFormat ? e.shownFormat : l.value ? w[e.format] : e.format), m = r(
|
|
106
|
+
() => l.value ? w[e.format] : e.format
|
|
107
|
+
), p = r(() => {
|
|
108
|
+
if (P(o(y)))
|
|
105
109
|
return;
|
|
106
|
-
let
|
|
107
|
-
return e.timezone && (
|
|
108
|
-
}),
|
|
109
|
-
const
|
|
110
|
+
let t = u(o(y));
|
|
111
|
+
return e.timezone && (t = u(ne(o(y), i.value))), t;
|
|
112
|
+
}), { renderer: A } = ue(e, p), M = r(() => o(l) ? e.picker ?? se[e.format] : e.picker), x = r(() => {
|
|
113
|
+
const t = o(l) ? me[e.format] : {};
|
|
110
114
|
return {
|
|
111
|
-
...
|
|
115
|
+
...le(e, [
|
|
112
116
|
"value",
|
|
113
117
|
"defaultValue",
|
|
114
118
|
"onChange",
|
|
@@ -117,95 +121,101 @@ const Pe = /* @__PURE__ */ I({
|
|
|
117
121
|
"onUpdate:value",
|
|
118
122
|
"mode"
|
|
119
123
|
]),
|
|
120
|
-
placeholder:
|
|
121
|
-
...
|
|
124
|
+
placeholder: o(T),
|
|
125
|
+
...t
|
|
122
126
|
};
|
|
123
|
-
}),
|
|
124
|
-
function
|
|
125
|
-
if (
|
|
127
|
+
}), h = (t, n, a = !0) => pe(i.value)(t, n, a);
|
|
128
|
+
function D(t) {
|
|
129
|
+
if (P(t)) {
|
|
126
130
|
k(null);
|
|
127
131
|
return;
|
|
128
132
|
}
|
|
129
|
-
const n = u(
|
|
133
|
+
const n = u(t);
|
|
130
134
|
k(
|
|
131
|
-
|
|
135
|
+
h(
|
|
132
136
|
n,
|
|
133
|
-
|
|
137
|
+
o(l) ? o(m) : void 0,
|
|
134
138
|
e.formatBegins
|
|
135
139
|
)
|
|
136
140
|
);
|
|
137
141
|
}
|
|
138
|
-
function
|
|
139
|
-
const a = u(
|
|
142
|
+
function V(t, n) {
|
|
143
|
+
const a = u(t), f = t ? h(
|
|
140
144
|
a,
|
|
141
|
-
|
|
145
|
+
o(l) ? o(m) : void 0,
|
|
142
146
|
e.formatBegins
|
|
143
147
|
) : null;
|
|
144
|
-
e.onChange?.(
|
|
148
|
+
e.onChange?.(f, n);
|
|
145
149
|
}
|
|
146
|
-
function
|
|
147
|
-
const n = u(
|
|
150
|
+
function z(t) {
|
|
151
|
+
const n = u(t), a = t ? h(
|
|
148
152
|
n,
|
|
149
|
-
|
|
153
|
+
o(l) ? o(m) : void 0,
|
|
150
154
|
e.formatBegins
|
|
151
155
|
) : null;
|
|
152
156
|
e.onOk?.(a);
|
|
153
157
|
}
|
|
154
|
-
return
|
|
155
|
-
focus: () =>
|
|
156
|
-
blur: () =>
|
|
157
|
-
}), (
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
return C({
|
|
159
|
+
focus: () => v.value?.focus(),
|
|
160
|
+
blur: () => v.value?.blur()
|
|
161
|
+
}), (t, n) => t.mode === "read" ? (s(), c(o(ce), {
|
|
162
|
+
key: 0,
|
|
163
|
+
renderer: o(A)
|
|
164
|
+
}, {
|
|
165
|
+
default: d(() => [
|
|
166
|
+
U("span", null, B(p.value ? o(u)(p.value).format(m.value) : t.emptyText), 1)
|
|
167
|
+
]),
|
|
168
|
+
_: 1
|
|
169
|
+
}, 8, ["renderer"])) : (s(), c(o(X), {
|
|
160
170
|
key: 1,
|
|
161
171
|
compact: "",
|
|
162
|
-
style:
|
|
172
|
+
style: H({
|
|
163
173
|
display: Array.isArray(e.timezone) && e.timezone.length ? "flex" : "block"
|
|
164
174
|
})
|
|
165
175
|
}, {
|
|
166
|
-
default:
|
|
167
|
-
|
|
168
|
-
default:
|
|
169
|
-
Array.isArray(e.timezone) && e.timezone.length ? (
|
|
176
|
+
default: d(() => [
|
|
177
|
+
g(o(ee), null, {
|
|
178
|
+
default: d(() => [
|
|
179
|
+
Array.isArray(e.timezone) && e.timezone.length ? (s(), c(o(oe), {
|
|
170
180
|
key: 0,
|
|
171
|
-
value:
|
|
172
|
-
"onUpdate:value": n[0] || (n[0] = (a) =>
|
|
181
|
+
value: o(i),
|
|
182
|
+
"onUpdate:value": n[0] || (n[0] = (a) => W(i) ? i.value = a : null),
|
|
173
183
|
"default-active-first-option": "",
|
|
174
184
|
"dropdown-match-select-width": !1,
|
|
175
185
|
style: { "max-width": "50%" },
|
|
176
|
-
disabled:
|
|
186
|
+
disabled: t.disabled
|
|
177
187
|
}, {
|
|
178
|
-
default:
|
|
179
|
-
(
|
|
188
|
+
default: d(() => [
|
|
189
|
+
(s(!0), G(L, null, b(e.timezone, (a) => (s(), c(o(te), {
|
|
180
190
|
key: a?.value,
|
|
181
191
|
value: a?.value
|
|
182
192
|
}, {
|
|
183
|
-
default:
|
|
184
|
-
|
|
193
|
+
default: d(() => [
|
|
194
|
+
Y(B(a?.label ?? a?.value), 1)
|
|
185
195
|
]),
|
|
186
196
|
_: 2
|
|
187
197
|
}, 1032, ["value"]))), 128))
|
|
188
198
|
]),
|
|
189
199
|
_: 1
|
|
190
|
-
}, 8, ["value", "disabled"])) :
|
|
200
|
+
}, 8, ["value", "disabled"])) : K("", !0)
|
|
191
201
|
]),
|
|
192
202
|
_: 1
|
|
193
203
|
}),
|
|
194
|
-
|
|
204
|
+
g(o(ae), Z({
|
|
195
205
|
ref_key: "datePickerRef",
|
|
196
|
-
ref:
|
|
197
|
-
},
|
|
198
|
-
value:
|
|
199
|
-
format:
|
|
200
|
-
picker:
|
|
201
|
-
"onUpdate:value":
|
|
202
|
-
onChange:
|
|
203
|
-
onOk:
|
|
204
|
-
}),
|
|
205
|
-
|
|
206
|
-
name:
|
|
207
|
-
fn:
|
|
208
|
-
|
|
206
|
+
ref: v
|
|
207
|
+
}, x.value, {
|
|
208
|
+
value: p.value,
|
|
209
|
+
format: F.value,
|
|
210
|
+
picker: M.value,
|
|
211
|
+
"onUpdate:value": D,
|
|
212
|
+
onChange: V,
|
|
213
|
+
onOk: z
|
|
214
|
+
}), $({ _: 2 }, [
|
|
215
|
+
b(_, (a, f) => ({
|
|
216
|
+
name: f,
|
|
217
|
+
fn: d((E) => [
|
|
218
|
+
q(t.$slots, f, J(Q(E || {})))
|
|
209
219
|
])
|
|
210
220
|
}))
|
|
211
221
|
]), 1040, ["value", "format", "picker"])
|
|
@@ -215,5 +225,5 @@ const Pe = /* @__PURE__ */ I({
|
|
|
215
225
|
}
|
|
216
226
|
});
|
|
217
227
|
export {
|
|
218
|
-
|
|
228
|
+
Te as default
|
|
219
229
|
};
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { SwapRightOutlined as
|
|
3
|
-
import { InputGroup as
|
|
4
|
-
import { getTimeFormatToZone as
|
|
1
|
+
import { defineComponent as q, useSlots as J, ref as Q, computed as s, unref as t, isVNode as X, createVNode as O, Fragment as k, createBlock as h, openBlock as u, withCtx as g, createElementBlock as R, createTextVNode as S, toDisplayString as C, resolveDynamicComponent as ee, normalizeStyle as oe, createCommentVNode as te, isRef as ne, renderList as M, mergeProps as ae, createSlots as re, renderSlot as le, normalizeProps as ue, guardReactiveProps as de } from "vue";
|
|
2
|
+
import { SwapRightOutlined as ie } from "@ant-design/icons-vue";
|
|
3
|
+
import { InputGroup as se, Select as fe, SelectOption as pe, DatePicker as me } from "@aplus-frontend/antdv";
|
|
4
|
+
import { getTimeFormatToZone as w } from "@aplus-frontend/utils";
|
|
5
5
|
import d from "dayjs";
|
|
6
|
-
import { isNil as
|
|
6
|
+
import { isNil as T, omit as _, isString as m, isFunction as ce } from "lodash-unified";
|
|
7
|
+
import "../../render/index.mjs";
|
|
7
8
|
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 {
|
|
15
|
-
|
|
9
|
+
import { omitUndefined as ye } from "../../utils/index.mjs";
|
|
10
|
+
import { ApFieldDatePresetFormats as ve, PRESET_FORMAT_MAP as A, PRESET_FORMAT_PICK_MAP as he, PRESET_FORMAT_TIME_MAP as ge } from "../date/constant.mjs";
|
|
11
|
+
import { formatDayWithTimezone as ke } from "../date/helper.mjs";
|
|
12
|
+
import { useDateTimezone as Se } from "../hooks/use-date-timezone.mjs";
|
|
13
|
+
import { useDefaultPlaceholder as Ce } from "../hooks/use-default-placeholder.mjs";
|
|
14
|
+
import { useDefaultPresets as Pe } from "../hooks/use-default-presets.mjs";
|
|
15
|
+
import { useReadModeRender as Be } from "../hooks/use-read-mode-render.mjs";
|
|
16
|
+
import { useControllableValue as Oe } from "../../hooks/useControllableValue.mjs";
|
|
17
|
+
import Re from "../../render/render.mjs";
|
|
18
|
+
const De = {
|
|
19
|
+
key: 0
|
|
20
|
+
}, We = /* @__PURE__ */ q({
|
|
16
21
|
name: "ApFieldDateRange",
|
|
17
22
|
__name: "index",
|
|
18
23
|
props: {
|
|
@@ -24,6 +29,7 @@ const Ee = /* @__PURE__ */ $({
|
|
|
24
29
|
emptyText: {
|
|
25
30
|
default: "--"
|
|
26
31
|
},
|
|
32
|
+
customReadMode: {},
|
|
27
33
|
id: {},
|
|
28
34
|
defaultPickerValue: {},
|
|
29
35
|
placeholder: {},
|
|
@@ -165,115 +171,119 @@ const Ee = /* @__PURE__ */ $({
|
|
|
165
171
|
expose: x,
|
|
166
172
|
emit: z
|
|
167
173
|
}) {
|
|
168
|
-
const o = F, N = z,
|
|
169
|
-
value:
|
|
170
|
-
updateValue:
|
|
171
|
-
} =
|
|
174
|
+
const o = F, N = z, D = J(), P = Q(), i = s(() => ve.indexOf(o.format) > -1), c = s(() => i.value ? A[o.format] : o.format), {
|
|
175
|
+
value: y,
|
|
176
|
+
updateValue: b
|
|
177
|
+
} = Oe(o, N), E = s(() => o.shownFormat ? o.shownFormat : i.value ? A[o.format] : o.format), V = Ce("DateRange", o), {
|
|
172
178
|
currentTimezone: l
|
|
173
|
-
} =
|
|
179
|
+
} = Se(o), {
|
|
174
180
|
presets: j,
|
|
175
181
|
changeCurrentDate: I
|
|
176
|
-
} =
|
|
182
|
+
} = Pe({
|
|
177
183
|
...o,
|
|
178
184
|
timezone: l
|
|
179
|
-
}), f = (e, a, n = !0) =>
|
|
180
|
-
const e = t(
|
|
181
|
-
if (
|
|
185
|
+
}), f = (e, a, n = !0) => ke(l.value)(e, a, n), v = s(() => {
|
|
186
|
+
const e = t(y);
|
|
187
|
+
if (T(e) || !e?.length)
|
|
182
188
|
return e;
|
|
183
|
-
const a = l.value ?
|
|
189
|
+
const a = l.value ? w(t(y)[0], l.value) : t(y)?.[0], n = o.timezone ? w(t(y)[1], l.value) : t(y)?.[1];
|
|
184
190
|
return [d(a), d(n)];
|
|
185
|
-
}),
|
|
186
|
-
|
|
191
|
+
}), {
|
|
192
|
+
renderer: U
|
|
193
|
+
} = Be(o, v), H = s(() => t(i) ? o.picker ?? he[o.format] : o.picker), K = s(() => {
|
|
194
|
+
const e = t(i) ? ge[o.format] : {};
|
|
187
195
|
return {
|
|
188
|
-
...
|
|
196
|
+
...ye(_(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
|
|
189
197
|
placeholder: t(V),
|
|
190
198
|
presets: t(j),
|
|
191
199
|
...e
|
|
192
200
|
};
|
|
193
201
|
});
|
|
194
|
-
function
|
|
202
|
+
function W(e) {
|
|
195
203
|
if (!e) {
|
|
196
|
-
|
|
204
|
+
b(e);
|
|
197
205
|
return;
|
|
198
206
|
}
|
|
199
|
-
let a =
|
|
200
|
-
const r = t(i) ? t(
|
|
201
|
-
|
|
202
|
-
}
|
|
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]);
|
|
207
|
+
let a = m(e[0]) ? d(e[0]) : e[0], n = m(e[1]) ? d(e[1]) : e[1];
|
|
208
|
+
const r = t(i) ? t(c) : void 0;
|
|
209
|
+
b([f(a, r), f(n, r, !1)]);
|
|
206
210
|
}
|
|
207
211
|
function G(e) {
|
|
212
|
+
const a = m(e[0]) ? d(e[0]) : e[0], n = m(e[1]) ? d(e[1]) : e[1], r = t(i) ? t(c) : void 0, p = e[0] ? f(a, r) : null, B = e[1] ? f(n, r, !1) : null;
|
|
213
|
+
o.onOk?.([p, B]);
|
|
214
|
+
}
|
|
215
|
+
function L(e) {
|
|
208
216
|
e && I(), o.onOpenChange?.(e);
|
|
209
217
|
}
|
|
210
|
-
function
|
|
211
|
-
if (
|
|
218
|
+
function Y(e, a) {
|
|
219
|
+
if (T(e)) {
|
|
212
220
|
o.onChange?.(e, a);
|
|
213
221
|
return;
|
|
214
222
|
}
|
|
215
|
-
const n =
|
|
216
|
-
o.onChange?.([
|
|
223
|
+
const n = m(e[0]) ? d(e[0]) : e[0], r = m(e[1]) ? d(e[1]) : e[1], p = t(i) ? t(c) : void 0, B = e[0] ? f(n, p) : null, $ = e[1] ? f(r, p, !1) : null;
|
|
224
|
+
o.onChange?.([B, $], a);
|
|
217
225
|
}
|
|
218
|
-
const
|
|
226
|
+
const Z = s(() => {
|
|
219
227
|
const e = o.readModeSeparator;
|
|
220
228
|
if (e)
|
|
221
|
-
return
|
|
222
|
-
const a =
|
|
223
|
-
return a ?
|
|
229
|
+
return X(e) || ce(e) ? o.readModeSeparator : O(k, null, [o.readModeSeparator]);
|
|
230
|
+
const a = D.readModeSeparator?.();
|
|
231
|
+
return a ? O(k, null, [a]) : ie;
|
|
224
232
|
});
|
|
225
233
|
return x({
|
|
226
|
-
focus:
|
|
227
|
-
blur:
|
|
228
|
-
}), (e, a) => e.mode === "read" ? (u(),
|
|
229
|
-
key: 0
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
focus: P.value?.focus(),
|
|
235
|
+
blur: P.value?.blur()
|
|
236
|
+
}), (e, a) => e.mode === "read" ? (u(), h(t(Re), {
|
|
237
|
+
key: 0,
|
|
238
|
+
renderer: t(U)
|
|
239
|
+
}, {
|
|
240
|
+
default: g(() => [v.value ? (u(), R("span", De, [S(C(v.value[0]?.format(c.value)) + " ", 1), (u(), h(ee(Z.value))), S(" " + C(v.value[1]?.format(c.value)), 1)])) : (u(), R(k, {
|
|
241
|
+
key: 1
|
|
242
|
+
}, [S(C(e.emptyText), 1)], 64))]),
|
|
243
|
+
_: 1
|
|
244
|
+
}, 8, ["renderer"])) : (u(), h(t(se), {
|
|
235
245
|
key: 1,
|
|
236
246
|
compact: "",
|
|
237
|
-
style:
|
|
247
|
+
style: oe({
|
|
238
248
|
display: Array.isArray(o.timezone) && o.timezone.length ? "flex" : "block"
|
|
239
249
|
})
|
|
240
250
|
}, {
|
|
241
|
-
default:
|
|
251
|
+
default: g(() => [Array.isArray(o.timezone) && o.timezone.length ? (u(), h(t(fe), {
|
|
242
252
|
key: 0,
|
|
243
253
|
value: t(l),
|
|
244
|
-
"onUpdate:value": a[0] || (a[0] = (n) =>
|
|
254
|
+
"onUpdate:value": a[0] || (a[0] = (n) => ne(l) ? l.value = n : null),
|
|
245
255
|
"default-active-first-option": "",
|
|
246
256
|
"dropdown-match-select-width": !1
|
|
247
257
|
}, {
|
|
248
|
-
default:
|
|
258
|
+
default: g(() => [(u(!0), R(k, null, M(o.timezone, (n) => (u(), h(t(pe), {
|
|
249
259
|
key: n?.value,
|
|
250
260
|
value: n?.value
|
|
251
261
|
}, {
|
|
252
|
-
default:
|
|
262
|
+
default: g(() => [S(C(n?.label ?? n?.value), 1)]),
|
|
253
263
|
_: 2
|
|
254
264
|
}, 1032, ["value"]))), 128))]),
|
|
255
265
|
_: 1
|
|
256
|
-
}, 8, ["value"])) :
|
|
266
|
+
}, 8, ["value"])) : te("", !0), O(t(me).RangePicker, ae({
|
|
257
267
|
ref_key: "rangePickerRef",
|
|
258
|
-
ref:
|
|
259
|
-
},
|
|
260
|
-
value:
|
|
261
|
-
picker:
|
|
268
|
+
ref: P
|
|
269
|
+
}, K.value, {
|
|
270
|
+
value: v.value,
|
|
271
|
+
picker: H.value,
|
|
262
272
|
format: E.value,
|
|
263
|
-
"onUpdate:value":
|
|
264
|
-
onChange:
|
|
265
|
-
onOk:
|
|
266
|
-
onOpenChange:
|
|
267
|
-
}),
|
|
273
|
+
"onUpdate:value": W,
|
|
274
|
+
onChange: Y,
|
|
275
|
+
onOk: G,
|
|
276
|
+
onOpenChange: L
|
|
277
|
+
}), re({
|
|
268
278
|
_: 2
|
|
269
|
-
}, [
|
|
279
|
+
}, [M(t(_)(D, "readModeSeparator"), (n, r) => ({
|
|
270
280
|
name: r,
|
|
271
|
-
fn:
|
|
281
|
+
fn: g((p) => [le(e.$slots, r, ue(de(p || {})))])
|
|
272
282
|
}))]), 1040, ["value", "picker", "format"])]),
|
|
273
283
|
_: 3
|
|
274
284
|
}, 8, ["style"]));
|
|
275
285
|
}
|
|
276
286
|
});
|
|
277
287
|
export {
|
|
278
|
-
|
|
288
|
+
We as default
|
|
279
289
|
};
|