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