@aplus-frontend/ui 7.14.5 → 7.15.1
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/editable/form-item.vue.mjs +8 -7
- package/es/src/ag-grid/editable/index.vue.mjs +19 -18
- package/es/src/ag-grid/index.vue.mjs +110 -105
- package/es/src/ag-grid/interface.d.ts +7 -0
- package/es/src/ap-field/checkbox/index.vue.d.ts +1 -1
- 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 -29
- package/es/src/ap-field/number/index.vue.d.ts +1 -1
- package/es/src/ap-field/radio/index.vue.d.ts +1 -1
- 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 +3 -2
- package/es/src/ap-field/select/index.vue.mjs +116 -104
- 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/drawer-form/index.vue.d.ts +1 -0
- package/es/src/ap-form/drawer-form/index.vue.mjs +107 -116
- package/es/src/ap-form/interface.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 -5
- package/es/src/ap-form/items/radio/index.vue.mjs +2 -3
- 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/components/setting/template/item.vue2.mjs +27 -26
- package/es/src/ap-table/constants.d.ts +1923 -107
- package/es/src/time-ago/index.vue.mjs +21 -17
- package/es/src/time-ago/interface.d.ts +8 -0
- package/es/src/time-ago/useTimeAgo.d.ts +21 -0
- package/es/src/time-ago/useTimeAgo.mjs +36 -34
- package/es/src/time-ago/utils.d.ts +11 -0
- package/es/src/time-ago/utils.mjs +41 -9
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.mjs +18 -14
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +7 -0
- package/lib/src/ap-field/checkbox/index.vue.d.ts +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 -29
- package/lib/src/ap-field/number/index.vue.d.ts +1 -1
- package/lib/src/ap-field/radio/index.vue.d.ts +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 +3 -2
- 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/drawer-form/index.vue.d.ts +1 -0
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/interface.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 -5
- 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/components/setting/template/item.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +1923 -107
- package/lib/src/time-ago/index.vue.js +1 -1
- package/lib/src/time-ago/interface.d.ts +8 -0
- package/lib/src/time-ago/useTimeAgo.d.ts +21 -0
- package/lib/src/time-ago/useTimeAgo.js +1 -1
- package/lib/src/time-ago/utils.d.ts +11 -0
- package/lib/src/time-ago/utils.js +1 -1
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Switch as
|
|
3
|
-
import { isNil as
|
|
1
|
+
import { defineComponent as z, useSlots as D, ref as v, unref as o, computed as V, createVNode as a, Fragment as s, createBlock as p, createElementBlock as E, openBlock as f, resolveDynamicComponent as K, mergeProps as k, createSlots as b, renderList as w, withCtx as C, renderSlot as B, normalizeProps as A, guardReactiveProps as P } from "vue";
|
|
2
|
+
import { Switch as _, Popconfirm as L } from "@aplus-frontend/antdv";
|
|
3
|
+
import { isNil as M, isFunction as j, omit as S } from "lodash-unified";
|
|
4
4
|
import "../../utils/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { useControllableValue as
|
|
7
|
-
import { isDef as
|
|
8
|
-
const
|
|
6
|
+
import { useControllableValue as q } from "../../hooks/useControllableValue.mjs";
|
|
7
|
+
import { isDef as r } from "../../utils/is.mjs";
|
|
8
|
+
const X = /* @__PURE__ */ z({
|
|
9
9
|
name: "ApFieldSwitch",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
@@ -51,76 +51,82 @@ const Q = /* @__PURE__ */ U({
|
|
|
51
51
|
confirm: {}
|
|
52
52
|
},
|
|
53
53
|
emits: ["update:checked"],
|
|
54
|
-
setup(
|
|
55
|
-
|
|
54
|
+
setup(F, {
|
|
55
|
+
expose: N,
|
|
56
|
+
emit: T
|
|
56
57
|
}) {
|
|
57
|
-
const
|
|
58
|
+
const d = D(), e = F, $ = T, h = v(), {
|
|
58
59
|
value: t,
|
|
59
|
-
updateValue:
|
|
60
|
-
} =
|
|
60
|
+
updateValue: i
|
|
61
|
+
} = q(e, $, {
|
|
61
62
|
valuePropName: "checked"
|
|
62
|
-
}), c =
|
|
63
|
-
async function
|
|
64
|
-
if (!
|
|
65
|
-
if (!
|
|
66
|
-
|
|
63
|
+
}), c = v(!1);
|
|
64
|
+
async function y(n, u) {
|
|
65
|
+
if (!r(e.confirm)) {
|
|
66
|
+
if (!r(e.onAction)) {
|
|
67
|
+
i(n);
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
70
|
c.value = !0;
|
|
70
71
|
try {
|
|
71
|
-
await e.onAction(n,
|
|
72
|
+
await e.onAction(n, u) && i(n);
|
|
72
73
|
} finally {
|
|
73
74
|
c.value = !1;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
async function
|
|
78
|
+
async function x() {
|
|
78
79
|
const n = o(t) === e.checkedValue ? e.unCheckedValue : e.checkedValue;
|
|
79
|
-
if (!
|
|
80
|
-
|
|
80
|
+
if (!r(e.onAction)) {
|
|
81
|
+
i(n);
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
83
|
-
await e.onAction(n) &&
|
|
84
|
+
await e.onAction(n) && i(n);
|
|
84
85
|
}
|
|
85
|
-
const
|
|
86
|
+
const R = V(() => {
|
|
86
87
|
const n = o(t);
|
|
87
|
-
return
|
|
88
|
-
}),
|
|
89
|
-
return (
|
|
88
|
+
return M(n) ? a(s, null, [e.emptyText]) : n === e.checkedValue ? a(s, null, [e.checkedChildren || d.checkedChildren?.() || `${e.checkedValue}`]) : a(s, null, [e.unCheckedChildren || d.unCheckedChildren?.() || `${e.unCheckedValue}`]);
|
|
89
|
+
}), U = V(() => r(e.confirm) ? j(e.confirm) ? e.confirm(o(t)) : e.confirm : {});
|
|
90
|
+
return N({
|
|
91
|
+
focus: () => h.value?.focus(),
|
|
92
|
+
blur: () => h.value?.blur()
|
|
93
|
+
}), (n, u) => n.mode === "read" ? (f(), p(K(R.value), {
|
|
90
94
|
key: 0
|
|
91
|
-
})) : (f(),
|
|
95
|
+
})) : (f(), E(s, {
|
|
92
96
|
key: 1
|
|
93
|
-
}, [!o(
|
|
94
|
-
key: 0
|
|
95
|
-
|
|
97
|
+
}, [!o(r)(n.confirm) || n.disabled ? (f(), p(o(_), k({
|
|
98
|
+
key: 0,
|
|
99
|
+
ref_key: "switchRef",
|
|
100
|
+
ref: h
|
|
101
|
+
}, o(S)(e, ["onUpdate:checked", "emptyText"]), {
|
|
96
102
|
checked: o(t),
|
|
97
103
|
loading: n.loading ?? c.value,
|
|
98
|
-
onClick:
|
|
99
|
-
}),
|
|
104
|
+
onClick: y
|
|
105
|
+
}), b({
|
|
100
106
|
_: 2
|
|
101
|
-
}, [
|
|
107
|
+
}, [w(d, (g, l) => ({
|
|
102
108
|
name: l,
|
|
103
|
-
fn:
|
|
104
|
-
}))]), 1040, ["checked", "loading"])) : (f(),
|
|
109
|
+
fn: C((m) => [B(n.$slots, l, A(P(m || {})))])
|
|
110
|
+
}))]), 1040, ["checked", "loading"])) : (f(), p(o(L), k({
|
|
105
111
|
key: 1,
|
|
106
112
|
disabled: c.value
|
|
107
|
-
},
|
|
108
|
-
onConfirm:
|
|
113
|
+
}, U.value, {
|
|
114
|
+
onConfirm: x
|
|
109
115
|
}), {
|
|
110
|
-
default:
|
|
116
|
+
default: C(() => [a(o(_), k(o(S)(e, ["onUpdate:checked", "emptyText"]), {
|
|
111
117
|
checked: o(t),
|
|
112
118
|
loading: n.loading ?? c.value,
|
|
113
|
-
onClick:
|
|
114
|
-
}),
|
|
119
|
+
onClick: y
|
|
120
|
+
}), b({
|
|
115
121
|
_: 2
|
|
116
|
-
}, [
|
|
122
|
+
}, [w(d, (g, l) => ({
|
|
117
123
|
name: l,
|
|
118
|
-
fn:
|
|
124
|
+
fn: C((m) => [B(n.$slots, l, A(P(m || {})))])
|
|
119
125
|
}))]), 1040, ["checked", "loading"])]),
|
|
120
126
|
_: 3
|
|
121
127
|
}, 16, ["disabled"]))], 64));
|
|
122
128
|
}
|
|
123
129
|
});
|
|
124
130
|
export {
|
|
125
|
-
|
|
131
|
+
X as default
|
|
126
132
|
};
|
|
@@ -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<ApFieldTextPasswordProps, {
|
|
20
|
-
focus: () => void;
|
|
21
20
|
blur: () => void;
|
|
21
|
+
focus: () => void;
|
|
22
22
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
23
23
|
"update:value": (...args: any[]) => void;
|
|
24
24
|
"update:visible": (...args: any[]) => void;
|
|
@@ -9,8 +9,8 @@ import { ShowCountProps } from '@aplus-frontend/antdv/es/vc-input/inputProps';
|
|
|
9
9
|
import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
10
10
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
11
11
|
declare const _default: DefineComponent<ApFieldTextAreaProps, {
|
|
12
|
-
focus: (options?: InputFocusOptions) => void;
|
|
13
12
|
blur: () => void;
|
|
13
|
+
focus: (options?: InputFocusOptions) => void;
|
|
14
14
|
resizableTextArea: any;
|
|
15
15
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
16
|
"update:value": (...args: any[]) => void;
|
|
@@ -926,6 +926,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
926
926
|
type: PropType<sizeType>;
|
|
927
927
|
};
|
|
928
928
|
maxSize: NumberConstructor;
|
|
929
|
+
minSize: NumberConstructor;
|
|
929
930
|
drawerStyle: {
|
|
930
931
|
type: PropType<CSSProperties>;
|
|
931
932
|
default: CSSProperties;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Button as
|
|
3
|
-
import { isBoolean as
|
|
1
|
+
import { isVNode as q, defineComponent as A, useSlots as E, shallowRef as L, ref as v, watch as G, computed as T, unref as l, cloneVNode as H, createVNode as o, mergeProps as m, createElementBlock as J, openBlock as h, Fragment as K, createBlock as w, createCommentVNode as Q, withCtx as c, renderSlot as B, resolveDynamicComponent as R, createTextVNode as X, toDisplayString as Y } from "vue";
|
|
2
|
+
import { Button as b, Flex as Z, Space as ee, Drawer as te } from "@aplus-frontend/antdv";
|
|
3
|
+
import { isBoolean as ie, isUndefined as ae, omit as le } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { convertReactiveToRaw as
|
|
7
|
-
import { getSingleVNode as
|
|
6
|
+
import { getNumberPx as F, convertReactiveToRaw as ne } from "../../utils/index.mjs";
|
|
7
|
+
import { getSingleVNode as oe } from "../../utils/slot.mjs";
|
|
8
8
|
import "../ap-form.vue.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { useControllableValue as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
import
|
|
14
|
-
function
|
|
15
|
-
return typeof
|
|
9
|
+
import se from "../style/drawer-form.mjs";
|
|
10
|
+
import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
import { useLocale as ue } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import me from "../ap-form.vue2.mjs";
|
|
14
|
+
function x(s) {
|
|
15
|
+
return typeof s == "function" || Object.prototype.toString.call(s) === "[object Object]" && !q(s);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const Se = /* @__PURE__ */ A({
|
|
18
18
|
name: "ApFormDrawerForm",
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
@@ -100,17 +100,25 @@ const De = /* @__PURE__ */ Y({
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
emits: ["update:open"],
|
|
103
|
-
setup(
|
|
104
|
-
expose:
|
|
105
|
-
emit:
|
|
103
|
+
setup(s, {
|
|
104
|
+
expose: O,
|
|
105
|
+
emit: k
|
|
106
106
|
}) {
|
|
107
|
-
const t =
|
|
108
|
-
value:
|
|
109
|
-
updateValue:
|
|
110
|
-
} =
|
|
107
|
+
const t = s, f = E(), W = k, a = L(), r = v(), n = v(!1), {
|
|
108
|
+
value: P,
|
|
109
|
+
updateValue: u
|
|
110
|
+
} = re(t, W, {
|
|
111
111
|
valuePropName: "open",
|
|
112
112
|
defaultValue: !1
|
|
113
|
-
}),
|
|
113
|
+
}), {
|
|
114
|
+
t: p
|
|
115
|
+
} = ue(), N = se("ap-form-drawer-form"), {
|
|
116
|
+
b: S
|
|
117
|
+
} = de("ap-form-drawer-form");
|
|
118
|
+
G(() => a.value, (e) => {
|
|
119
|
+
e && r.value && (e.setFieldsValue?.(r.value), r.value = void 0);
|
|
120
|
+
});
|
|
121
|
+
const d = T(() => {
|
|
114
122
|
const e = {
|
|
115
123
|
onResize: () => {
|
|
116
124
|
},
|
|
@@ -118,160 +126,143 @@ const De = /* @__PURE__ */ Y({
|
|
|
118
126
|
maxWidth: window.innerWidth * 0.8,
|
|
119
127
|
resizeOnOpen: !0
|
|
120
128
|
};
|
|
121
|
-
return
|
|
129
|
+
return ie(t.resize) ? t.resize ? e : {} : {
|
|
122
130
|
minWidth: t.resize?.minWidth ?? e.minWidth,
|
|
123
131
|
maxWidth: t.resize?.maxWidth ?? e.maxWidth,
|
|
124
132
|
onResize: t.resize?.onResize ?? e.onResize,
|
|
125
|
-
resizeOnOpen:
|
|
133
|
+
resizeOnOpen: ae(t.resize?.resizeOnOpen) ? e.resizeOnOpen : t.resize.resizeOnOpen
|
|
126
134
|
};
|
|
127
|
-
}), u = y(T()), {
|
|
128
|
-
t: F
|
|
129
|
-
} = be(), D = he("ap-form-drawer-form"), {
|
|
130
|
-
b: $,
|
|
131
|
-
e: q,
|
|
132
|
-
em: V
|
|
133
|
-
} = Fe("ap-form-drawer-form"), A = w(() => [q("resize-bar"), {
|
|
134
|
-
[V("resize-bar", "min-disabled")]: n(u) === n(l).minWidth
|
|
135
|
-
}, {
|
|
136
|
-
[V("resize-bar", "max-disabled")]: n(u) === n(l).maxWidth
|
|
137
|
-
}]);
|
|
138
|
-
P(() => o.value, (e) => {
|
|
139
|
-
e && d.value && (e.setFieldsValue?.(d.value), d.value = void 0);
|
|
140
|
-
}), P(() => n(C), (e) => {
|
|
141
|
-
e && n(l)?.resizeOnOpen && (u.value = T());
|
|
142
135
|
});
|
|
143
|
-
function
|
|
144
|
-
const e =
|
|
136
|
+
function _() {
|
|
137
|
+
const e = l(d)?.minWidth;
|
|
145
138
|
return !e || e && e < t.width ? t.width : e;
|
|
146
139
|
}
|
|
147
|
-
const
|
|
140
|
+
const g = v(F(_()));
|
|
141
|
+
function I(e) {
|
|
142
|
+
const {
|
|
143
|
+
resizeOnOpen: i,
|
|
144
|
+
onResize: C
|
|
145
|
+
} = d.value;
|
|
146
|
+
i && (g.value = e, C?.(e));
|
|
147
|
+
}
|
|
148
|
+
const y = oe(f.trigger), z = y ? H(y, {
|
|
148
149
|
onClick: () => {
|
|
149
|
-
|
|
150
|
+
u(!0);
|
|
150
151
|
}
|
|
151
|
-
}) : null,
|
|
152
|
+
}) : null, j = T(() => {
|
|
152
153
|
const e = [];
|
|
153
154
|
if (t.submitter === !1)
|
|
154
155
|
return null;
|
|
155
156
|
if (t.showCancel) {
|
|
156
157
|
let i;
|
|
157
|
-
e.push(
|
|
158
|
-
onClick:
|
|
159
|
-
disabled:
|
|
160
|
-
},
|
|
158
|
+
e.push(o(b, {
|
|
159
|
+
onClick: V,
|
|
160
|
+
disabled: n.value
|
|
161
|
+
}, x(i = p("ap.common.cancelText")) ? i : {
|
|
161
162
|
default: () => [i]
|
|
162
163
|
}));
|
|
163
164
|
}
|
|
164
|
-
return t.submitter?.resetButtonProps !== !1 && e.push(
|
|
165
|
+
return t.submitter?.resetButtonProps !== !1 && e.push(o(b, m(t.submitter?.resetButtonProps || {}, {
|
|
165
166
|
key: "submit",
|
|
166
|
-
disabled:
|
|
167
|
-
onClick:
|
|
167
|
+
disabled: n.value,
|
|
168
|
+
onClick: U
|
|
168
169
|
}), {
|
|
169
|
-
default: () => [t.submitter?.resetText ||
|
|
170
|
-
})), t.submitter?.submitButtonProps !== !1 && e.push(
|
|
170
|
+
default: () => [t.submitter?.resetText || p("ap.common.resetText")]
|
|
171
|
+
})), t.submitter?.submitButtonProps !== !1 && e.push(o(b, m({
|
|
171
172
|
type: "primary",
|
|
172
173
|
key: "submit"
|
|
173
174
|
}, t.submitter?.submitButtonProps || {}, {
|
|
174
|
-
loading:
|
|
175
|
-
onClick:
|
|
175
|
+
loading: n.value,
|
|
176
|
+
onClick: D
|
|
176
177
|
}), {
|
|
177
|
-
default: () => [t.submitter?.submitText ||
|
|
178
|
-
})),
|
|
178
|
+
default: () => [t.submitter?.submitText || p("ap.common.okText")]
|
|
179
|
+
})), o(Z, {
|
|
179
180
|
justify: "flex-end"
|
|
180
181
|
}, {
|
|
181
|
-
default: () => [
|
|
182
|
+
default: () => [f.submitter ? f.submitter(e) : o(ee, null, x(e) ? e : {
|
|
182
183
|
default: () => [e]
|
|
183
184
|
})]
|
|
184
185
|
});
|
|
185
186
|
});
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
function B(e) {
|
|
190
|
-
const i = n(l), c = (document.body.offsetWidth || 1e3) - (e.clientX - document.body.offsetLeft), f = i?.minWidth ?? (t.width || 800), O = i?.maxWidth ?? window.innerWidth * 0.8;
|
|
191
|
-
let g = c;
|
|
192
|
-
c < f && (g = f), c > O && (g = O), u.value = g;
|
|
187
|
+
function U() {
|
|
188
|
+
t.submitter !== !1 && (a.value?.resetFields(), t.submitter?.onReset?.());
|
|
193
189
|
}
|
|
194
|
-
function
|
|
195
|
-
document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", x);
|
|
196
|
-
}
|
|
197
|
-
function H() {
|
|
198
|
-
t.submitter !== !1 && (o.value?.resetFields(), t.submitter?.onReset?.());
|
|
199
|
-
}
|
|
200
|
-
async function J() {
|
|
190
|
+
async function D() {
|
|
201
191
|
if (t.submitter !== !1)
|
|
202
192
|
try {
|
|
203
|
-
const e = await
|
|
204
|
-
t.submitter?.onSubmit?.(),
|
|
205
|
-
const i = t.onFinish?.(
|
|
193
|
+
const e = await a.value?.validateFieldsReturnTransformed();
|
|
194
|
+
t.submitter?.onSubmit?.(), n.value = !0;
|
|
195
|
+
const i = t.onFinish?.(ne(e));
|
|
206
196
|
if (t.submitTimeout && i instanceof Promise) {
|
|
207
|
-
const
|
|
197
|
+
const $ = setTimeout(() => n.value = !1, t.submitTimeout);
|
|
208
198
|
i.finally(() => {
|
|
209
|
-
clearTimeout(
|
|
199
|
+
clearTimeout($), n.value = !1;
|
|
210
200
|
});
|
|
211
201
|
}
|
|
212
|
-
await i &&
|
|
202
|
+
await i && u(!1);
|
|
213
203
|
} finally {
|
|
214
|
-
|
|
204
|
+
n.value = !1;
|
|
215
205
|
}
|
|
216
206
|
}
|
|
217
|
-
function
|
|
218
|
-
n
|
|
207
|
+
function V() {
|
|
208
|
+
l(n) || u(!1);
|
|
219
209
|
}
|
|
220
|
-
function
|
|
221
|
-
!e && n
|
|
210
|
+
function M(e) {
|
|
211
|
+
!e && l(n) || u(e);
|
|
222
212
|
}
|
|
223
|
-
return
|
|
213
|
+
return O({
|
|
224
214
|
resetFields: async () => {
|
|
225
|
-
|
|
215
|
+
a.value?.resetFields();
|
|
226
216
|
},
|
|
227
217
|
clearValidate: (e) => {
|
|
228
|
-
|
|
218
|
+
a.value?.clearValidate(e);
|
|
229
219
|
},
|
|
230
|
-
validateFields: (e, i) =>
|
|
231
|
-
getFieldsValue: (e) =>
|
|
232
|
-
validate: (e, i) =>
|
|
220
|
+
validateFields: (e, i) => a.value?.validateFields(e, i),
|
|
221
|
+
getFieldsValue: (e) => a.value?.getFieldsValue(e),
|
|
222
|
+
validate: (e, i) => a.value?.validate(e, i),
|
|
233
223
|
scrollToField: (e, i = {}) => {
|
|
234
|
-
|
|
224
|
+
a.value?.scrollToField(e, i);
|
|
235
225
|
},
|
|
236
226
|
setFieldValue: (e, i) => {
|
|
237
|
-
|
|
227
|
+
a.value?.setFieldValue?.(e, i);
|
|
238
228
|
},
|
|
239
229
|
setFieldsValue: (e) => {
|
|
240
|
-
if (!
|
|
241
|
-
|
|
230
|
+
if (!a.value) {
|
|
231
|
+
r.value = e;
|
|
242
232
|
return;
|
|
243
233
|
}
|
|
244
|
-
|
|
234
|
+
a.value?.setFieldsValue?.(e);
|
|
235
|
+
},
|
|
236
|
+
getInternalInstance: (e) => a.value?.getInternalInstance(e),
|
|
237
|
+
getFieldsValueTransformed: (e) => a.value?.getFieldsValueTransformed(e),
|
|
238
|
+
validateFieldsReturnTransformed: (e) => a.value?.validateFieldsReturnTransformed(e)
|
|
239
|
+
}), (e, i) => (h(), J(K, null, [o(l(te), m(e.drawerProps, {
|
|
240
|
+
open: l(P),
|
|
241
|
+
size: g.value,
|
|
242
|
+
"max-size": l(F)(d.value.maxWidth),
|
|
243
|
+
"min-size": l(F)(d.value.minWidth),
|
|
244
|
+
resizable: {
|
|
245
|
+
onResize: I
|
|
245
246
|
},
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}), (e, i) => (h(), N(ie, null, [s(n(ue), p(e.drawerProps, {
|
|
250
|
-
open: n(C),
|
|
251
|
-
width: u.value,
|
|
252
|
-
class: [n($)(), n(D)],
|
|
253
|
-
"onUpdate:open": K,
|
|
254
|
-
onCancel: k
|
|
247
|
+
class: [l(S)(), l(N)],
|
|
248
|
+
"onUpdate:open": M,
|
|
249
|
+
onCancel: V
|
|
255
250
|
}), {
|
|
256
|
-
title:
|
|
257
|
-
footer:
|
|
258
|
-
default:
|
|
251
|
+
title: c(() => [B(e.$slots, "title", {}, () => [X(Y(t.title), 1)])]),
|
|
252
|
+
footer: c(() => [(h(), w(R(j.value)))]),
|
|
253
|
+
default: c(() => [o(me, m({
|
|
259
254
|
ref_key: "formRef",
|
|
260
|
-
ref:
|
|
261
|
-
},
|
|
262
|
-
default:
|
|
255
|
+
ref: a
|
|
256
|
+
}, l(le)(t, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
|
|
257
|
+
default: c(() => [B(e.$slots, "default")]),
|
|
263
258
|
_: 3
|
|
264
|
-
}, 16)
|
|
265
|
-
key: 0,
|
|
266
|
-
class: oe(A.value),
|
|
267
|
-
onMousedown: ne(G, ["stop", "prevent"])
|
|
268
|
-
}, null, 34)) : M("", !0)]),
|
|
259
|
+
}, 16)]),
|
|
269
260
|
_: 3
|
|
270
|
-
}, 16, ["open", "
|
|
261
|
+
}, 16, ["open", "size", "max-size", "min-size", "resizable", "class"]), l(z) ? (h(), w(R(l(z)), {
|
|
271
262
|
key: 0
|
|
272
|
-
})) :
|
|
263
|
+
})) : Q("", !0)], 64));
|
|
273
264
|
}
|
|
274
265
|
});
|
|
275
266
|
export {
|
|
276
|
-
|
|
267
|
+
Se as default
|
|
277
268
|
};
|
|
@@ -278,7 +278,7 @@ export type ApFormModalFormProps = Omit<ApFormProps, 'onFinish'> & {
|
|
|
278
278
|
submitTimeout?: number;
|
|
279
279
|
};
|
|
280
280
|
export type CustomizeResizeType = {
|
|
281
|
-
onResize?: () => void;
|
|
281
|
+
onResize?: (_size: number) => void;
|
|
282
282
|
maxWidth?: DrawerProps['width'];
|
|
283
283
|
minWidth?: DrawerProps['width'];
|
|
284
284
|
resizeOnOpen?: boolean;
|
|
@@ -4,10 +4,8 @@ import { Breakpoint } from '@aplus-frontend/antdv/es/_util/responsiveObserve';
|
|
|
4
4
|
import { Gutter } from '@aplus-frontend/antdv/es/grid/Row';
|
|
5
5
|
declare function __VLS_template(): {
|
|
6
6
|
attrs: Partial<{}>;
|
|
7
|
-
slots:
|
|
8
|
-
default(): any
|
|
9
|
-
}> & {
|
|
10
|
-
default(): any[];
|
|
7
|
+
slots: {
|
|
8
|
+
default?(_: {}): any;
|
|
11
9
|
};
|
|
12
10
|
refs: {};
|
|
13
11
|
rootEl: any;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Col as
|
|
3
|
-
import { pick as
|
|
1
|
+
import { isVNode as _, defineComponent as P, unref as o, createVNode as s, mergeProps as a, createBlock as y, openBlock as S, withCtx as c, renderSlot as h } from "vue";
|
|
2
|
+
import { Col as w, Row as C } from "@aplus-frontend/antdv";
|
|
3
|
+
import { pick as R, isBoolean as b, omit as N } from "lodash-unified";
|
|
4
|
+
import "../../render/index.mjs";
|
|
4
5
|
import "../../config-provider/index.mjs";
|
|
5
6
|
import "../../utils/index.mjs";
|
|
6
|
-
import { apFormItemColPropKeys as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { isDef as
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { apFormItemColPropKeys as j } from "../constant.mjs";
|
|
8
|
+
import k from "../style/item-group.mjs";
|
|
9
|
+
import { buildColSpan as x, getStringName as B } from "./helper.mjs";
|
|
10
|
+
import { useNamespace as I } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { isDef as $ } from "../../utils/is.mjs";
|
|
12
|
+
import F from "../../render/render.mjs";
|
|
13
|
+
function O(e) {
|
|
14
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !_(e);
|
|
13
15
|
}
|
|
14
|
-
const
|
|
16
|
+
const M = /* @__PURE__ */ P({
|
|
15
17
|
name: "ApFormItemGroup",
|
|
16
18
|
__name: "index",
|
|
17
19
|
props: {
|
|
@@ -29,41 +31,34 @@ const ee = /* @__PURE__ */ P({
|
|
|
29
31
|
default: 3
|
|
30
32
|
}
|
|
31
33
|
},
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
34
|
-
b:
|
|
35
|
-
} =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return r(l).map((e, y) => {
|
|
46
|
-
const t = e.props, u = D(t, $), _ = u?.span ? {} : G(a.countPerRow), h = O(t.hidden) ? !!t.hidden : L(t.hidden);
|
|
47
|
-
return {
|
|
48
|
-
key: `${y}-${H(t.name)}`,
|
|
49
|
-
node: N(F, d(_, u, {
|
|
50
|
-
class: h ? i("col-hidden") : ""
|
|
51
|
-
}), U(e) ? e : {
|
|
52
|
-
default: () => [e]
|
|
53
|
-
})
|
|
54
|
-
};
|
|
34
|
+
setup(e) {
|
|
35
|
+
const p = e, {
|
|
36
|
+
b: m
|
|
37
|
+
} = I("ap-form-item-group"), f = k("ap-form-item-group");
|
|
38
|
+
function u(n) {
|
|
39
|
+
return o(n).map((t, d) => {
|
|
40
|
+
const r = t.props, i = R(r, j), l = i?.span ? {} : x(p.countPerRow), g = b(r.hidden) ? !!r.hidden : $(r.hidden);
|
|
41
|
+
return s(w, a(l, i, {
|
|
42
|
+
key: `${d}-${B(r.name)}`,
|
|
43
|
+
class: g ? m("col-hidden") : ""
|
|
44
|
+
}), O(t) ? t : {
|
|
45
|
+
default: () => [t]
|
|
46
|
+
});
|
|
55
47
|
});
|
|
56
48
|
}
|
|
57
|
-
return (n,
|
|
58
|
-
class: [
|
|
59
|
-
},
|
|
60
|
-
default:
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
49
|
+
return (n, t) => (S(), y(o(C), a({
|
|
50
|
+
class: [o(m)(), o(f)]
|
|
51
|
+
}, o(N)(p, ["countPerRow"])), {
|
|
52
|
+
default: c(() => [s(o(F), {
|
|
53
|
+
renderer: u
|
|
54
|
+
}, {
|
|
55
|
+
default: c(() => [h(n.$slots, "default")]),
|
|
56
|
+
_: 3
|
|
57
|
+
})]),
|
|
58
|
+
_: 3
|
|
64
59
|
}, 16, ["class"]));
|
|
65
60
|
}
|
|
66
61
|
});
|
|
67
62
|
export {
|
|
68
|
-
|
|
63
|
+
M as default
|
|
69
64
|
};
|