@aplus-frontend/ui 0.0.27 → 0.0.28
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-action/group/index.vue.mjs +27 -31
- package/es/src/ap-action/item-dropdown/index.vue.mjs +14 -15
- package/es/src/ap-action/style/item-dropdown.css +2 -0
- package/es/src/ap-form/ap-form-item-group/index.vue.mjs +21 -21
- package/es/src/ap-form/ap-form-item.vue.mjs +72 -64
- package/es/src/ap-form/ap-form.vue.d.ts +13 -3
- package/es/src/ap-form/ap-form.vue2.mjs +91 -70
- package/es/src/ap-form/constant.d.ts +1 -0
- package/es/src/ap-form/constant.mjs +2 -1
- package/es/src/ap-form/context.d.ts +4 -3
- package/es/src/ap-form/hooks/use-watch.mjs +20 -16
- package/es/src/ap-form/interface.d.ts +35 -4
- package/es/src/ap-form/items/checkbox/index.vue.mjs +11 -10
- package/es/src/ap-form/items/date/index.vue.mjs +14 -13
- package/es/src/ap-form/items/date-range/index.vue.mjs +12 -11
- package/es/src/ap-form/items/number/index.vue.mjs +13 -12
- package/es/src/ap-form/items/radio/index.vue.mjs +4 -3
- package/es/src/ap-form/items/select/index.vue.mjs +3 -2
- package/es/src/ap-form/items/switch/index.vue.mjs +9 -8
- package/es/src/ap-form/items/text/index.vue2.mjs +15 -14
- package/es/src/ap-form/items/text/password.vue.mjs +1 -0
- package/es/src/ap-form/items/text-area/index.vue.mjs +7 -6
- package/es/src/ap-form/modal-form/index.vue.d.ts +1 -1
- package/es/src/ap-form/modal-form/index.vue.mjs +3 -3
- package/es/src/ap-table/constants.d.ts +132 -0
- package/es/src/business/expandAlert/ApExpandAlert.vue.d.ts +19 -1
- package/es/src/business/expandAlert/ApExpandAlert.vue2.mjs +53 -47
- package/es/src/business/expandAlert/interface.d.ts +4 -0
- package/es/src/business/index.d.ts +38 -7
- package/es/src/business/index.mjs +1 -1
- package/es/src/editable-table/form-item.vue.mjs +72 -74
- package/es/src/locale/lang/en.mjs +2 -1
- package/es/src/locale/lang/zh-cn.mjs +2 -1
- package/es/src/theme/ap-action/item-dropdown.css +2 -0
- package/lib/src/ap-action/group/index.vue.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-action/style/item-dropdown.css +2 -0
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +13 -3
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/constant.d.ts +1 -0
- package/lib/src/ap-form/constant.js +1 -1
- package/lib/src/ap-form/context.d.ts +4 -3
- package/lib/src/ap-form/hooks/use-watch.js +1 -1
- package/lib/src/ap-form/interface.d.ts +35 -4
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +1 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +132 -0
- package/lib/src/business/expandAlert/ApExpandAlert.vue.d.ts +19 -1
- package/lib/src/business/expandAlert/ApExpandAlert.vue2.js +1 -1
- package/lib/src/business/expandAlert/interface.d.ts +4 -0
- package/lib/src/business/index.d.ts +38 -7
- package/lib/src/business/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-action/item-dropdown.css +2 -0
- package/package.json +4 -3
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useProvideForm as
|
|
4
|
-
import { isArray as
|
|
5
|
-
|
|
1
|
+
import { defineComponent as x, ref as A, reactive as E, nextTick as N, toRaw as m, computed as O, openBlock as w, createBlock as j, unref as y, mergeProps as S, withCtx as W, renderSlot as q } from "vue";
|
|
2
|
+
import { Form as z } from "ant-design-vue";
|
|
3
|
+
import { useProvideForm as D } from "./context.mjs";
|
|
4
|
+
import { isArray as g, cloneDeep as L, omit as P } from "lodash-unified";
|
|
5
|
+
import { INTERNAL_FORM_INSTANCE_MARK as K } from "./constant.mjs";
|
|
6
|
+
import { isDef as $ } from "../utils/index.mjs";
|
|
7
|
+
const Y = /* @__PURE__ */ x({
|
|
6
8
|
__name: "ap-form",
|
|
7
9
|
props: {
|
|
8
10
|
layout: { default: "horizontal" },
|
|
@@ -30,93 +32,112 @@ const N = /* @__PURE__ */ R({
|
|
|
30
32
|
onValidate: {},
|
|
31
33
|
initialValues: {}
|
|
32
34
|
},
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
35
|
-
function
|
|
36
|
-
var
|
|
37
|
-
if (
|
|
38
|
-
let
|
|
39
|
-
for (let
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
setup(C, { expose: _ }) {
|
|
36
|
+
const a = C;
|
|
37
|
+
function p(e, t, l = !0) {
|
|
38
|
+
var v;
|
|
39
|
+
if (g(e)) {
|
|
40
|
+
let f = o;
|
|
41
|
+
for (let c = 0; c < e.length - 1; c++)
|
|
42
|
+
f = f[e[c]];
|
|
43
|
+
f[e[e.length - 1]] = t;
|
|
42
44
|
} else
|
|
43
45
|
o[e] = t;
|
|
44
|
-
let
|
|
45
|
-
(
|
|
46
|
+
let i = g(e) ? e[0] : e;
|
|
47
|
+
l && ((v = a.onValuesChange) == null || v.call(a, { [i]: o[i] }, o)), u();
|
|
46
48
|
}
|
|
47
|
-
const
|
|
48
|
-
let
|
|
49
|
-
const
|
|
49
|
+
const r = A();
|
|
50
|
+
let s = a.initialValues || {};
|
|
51
|
+
const o = E(a.initialValues || {});
|
|
52
|
+
let n = [];
|
|
53
|
+
const V = () => {
|
|
54
|
+
var e;
|
|
55
|
+
(e = r.value) == null || e.resetFields(), N(() => {
|
|
56
|
+
Object.keys(o).forEach((t) => delete o[t]), Object.assign(o, s), u();
|
|
57
|
+
});
|
|
58
|
+
}, R = (e) => {
|
|
50
59
|
var t;
|
|
51
|
-
(t =
|
|
52
|
-
},
|
|
53
|
-
var t;
|
|
54
|
-
(t = a.value) == null || t.clearValidate(e);
|
|
55
|
-
}, c = (e, t) => {
|
|
60
|
+
(t = r.value) == null || t.clearValidate(e);
|
|
61
|
+
}, B = (e, t) => {
|
|
56
62
|
var l;
|
|
57
|
-
return (l =
|
|
58
|
-
},
|
|
63
|
+
return (l = r.value) == null ? void 0 : l.validateFields(e, t);
|
|
64
|
+
}, I = (e) => {
|
|
59
65
|
var t;
|
|
60
|
-
return (t =
|
|
61
|
-
},
|
|
66
|
+
return (t = r.value) == null ? void 0 : t.getFieldsValue(e);
|
|
67
|
+
}, M = (e, t) => {
|
|
62
68
|
var l;
|
|
63
|
-
return (l =
|
|
64
|
-
},
|
|
69
|
+
return (l = r.value) == null ? void 0 : l.validate(e, t);
|
|
70
|
+
}, T = (e, t = {}) => {
|
|
65
71
|
var l;
|
|
66
|
-
(l =
|
|
67
|
-
},
|
|
68
|
-
Object.assign(o, e),
|
|
69
|
-
},
|
|
70
|
-
o[e] = t,
|
|
72
|
+
(l = r.value) == null || l.scrollToField(e, t);
|
|
73
|
+
}, b = (e) => {
|
|
74
|
+
Object.assign(o, e), u();
|
|
75
|
+
}, h = (e, t) => {
|
|
76
|
+
o[e] = t, u();
|
|
71
77
|
};
|
|
72
|
-
function
|
|
73
|
-
return
|
|
74
|
-
|
|
78
|
+
function d(e, t) {
|
|
79
|
+
return t || e(m(o)), n.push(e), () => {
|
|
80
|
+
n = n.filter((l) => l !== e);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function F({ initialValue: e, name: t }) {
|
|
84
|
+
if ($(e))
|
|
85
|
+
if (p(t, e, !1), g(t)) {
|
|
86
|
+
let l = L(s);
|
|
87
|
+
for (let i = 0; i < t.length - 1; i++)
|
|
88
|
+
l[t[i]] && (l[t[i]] = {});
|
|
89
|
+
l[t[t.length - 1]] = e, s = l;
|
|
90
|
+
} else
|
|
91
|
+
s[t] = e;
|
|
92
|
+
}
|
|
93
|
+
function k(e) {
|
|
94
|
+
if (e !== K) {
|
|
95
|
+
console.warn("getInternalInstance should only used at internal");
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
registerField: F,
|
|
100
|
+
registerWatch: d
|
|
75
101
|
};
|
|
76
102
|
}
|
|
77
|
-
function
|
|
78
|
-
if (
|
|
79
|
-
const e =
|
|
80
|
-
|
|
103
|
+
function u() {
|
|
104
|
+
if (n.length) {
|
|
105
|
+
const e = m(o);
|
|
106
|
+
n.forEach((t) => {
|
|
81
107
|
t(e);
|
|
82
108
|
});
|
|
83
109
|
}
|
|
84
110
|
}
|
|
85
|
-
return
|
|
86
|
-
model:
|
|
87
|
-
updateModel:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
getFieldsValue: p,
|
|
93
|
-
validate: h,
|
|
94
|
-
scrollToField: g,
|
|
95
|
-
setFieldsValue: m,
|
|
96
|
-
setFieldValue: F,
|
|
97
|
-
registerWatch: v
|
|
111
|
+
return D({
|
|
112
|
+
model: O(() => o),
|
|
113
|
+
updateModel: p,
|
|
114
|
+
internalInstance: {
|
|
115
|
+
registerWatch: d,
|
|
116
|
+
registerField: F,
|
|
117
|
+
setFieldValue: h
|
|
98
118
|
}
|
|
99
119
|
}), _({
|
|
100
|
-
resetFields:
|
|
101
|
-
clearValidate:
|
|
102
|
-
validateFields:
|
|
103
|
-
getFieldsValue:
|
|
104
|
-
validate:
|
|
105
|
-
scrollToField:
|
|
106
|
-
setFieldsValue:
|
|
107
|
-
setFieldValue:
|
|
108
|
-
registerWatch:
|
|
109
|
-
|
|
120
|
+
resetFields: V,
|
|
121
|
+
clearValidate: R,
|
|
122
|
+
validateFields: B,
|
|
123
|
+
getFieldsValue: I,
|
|
124
|
+
validate: M,
|
|
125
|
+
scrollToField: T,
|
|
126
|
+
setFieldsValue: b,
|
|
127
|
+
setFieldValue: h,
|
|
128
|
+
registerWatch: d,
|
|
129
|
+
getInternalInstance: k
|
|
130
|
+
}), (e, t) => (w(), j(y(z), S({
|
|
110
131
|
ref_key: "formRef",
|
|
111
|
-
ref:
|
|
112
|
-
}, y(P)(
|
|
113
|
-
default:
|
|
114
|
-
|
|
132
|
+
ref: r
|
|
133
|
+
}, y(P)(a, ["initialValues"]), { model: o }), {
|
|
134
|
+
default: W(() => [
|
|
135
|
+
q(e.$slots, "default")
|
|
115
136
|
]),
|
|
116
137
|
_: 3
|
|
117
138
|
}, 16, ["model"]));
|
|
118
139
|
}
|
|
119
140
|
});
|
|
120
141
|
export {
|
|
121
|
-
|
|
142
|
+
Y as default
|
|
122
143
|
};
|
|
@@ -11,8 +11,9 @@ const e = [
|
|
|
11
11
|
"xl",
|
|
12
12
|
"xs",
|
|
13
13
|
"xxl"
|
|
14
|
-
], l = ["extra", "help", "label"];
|
|
14
|
+
], l = ["extra", "help", "label"], o = "_INTERNAL_FORM_INSTANCE_MARK";
|
|
15
15
|
export {
|
|
16
|
+
o as INTERNAL_FORM_INSTANCE_MARK,
|
|
16
17
|
e as apFormItemColPropKeys,
|
|
17
18
|
l as apFormItemSlotNames
|
|
18
19
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NamePath } from 'ant-design-vue/es/form/interface';
|
|
2
2
|
import { ComputedRef, InjectionKey } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { ApFormInternalInstance } from './interface';
|
|
4
4
|
|
|
5
5
|
type ApFormContextProps<ModelType> = {
|
|
6
6
|
/**
|
|
@@ -11,13 +11,14 @@ type ApFormContextProps<ModelType> = {
|
|
|
11
11
|
* 更新数据源的方法
|
|
12
12
|
* @param name
|
|
13
13
|
* @param value
|
|
14
|
+
* @param triggerChange 是否触发外部的`onValuesChange`函数
|
|
14
15
|
* @returns
|
|
15
16
|
*/
|
|
16
|
-
updateModel?: (name: NamePath, value: any) => void;
|
|
17
|
+
updateModel?: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
17
18
|
/**
|
|
18
19
|
* ApForm内部实例
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
internalInstance?: ApFormInternalInstance;
|
|
21
22
|
};
|
|
22
23
|
export declare const ApFormContextKey: InjectionKey<ApFormContextProps<any>>;
|
|
23
24
|
export declare function useProvideForm<ModelType>(state: ApFormContextProps<ModelType>): void;
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import { useInjectForm as
|
|
2
|
-
import { ref as
|
|
1
|
+
import { useInjectForm as I } from "../context.mjs";
|
|
2
|
+
import { ref as h, watchEffect as N } from "vue";
|
|
3
3
|
import { isArray as S } from "lodash-unified";
|
|
4
|
-
|
|
4
|
+
import { INTERNAL_FORM_INSTANCE_MARK as A } from "../constant.mjs";
|
|
5
|
+
function M(t, r) {
|
|
5
6
|
return S(r) ? r.reduce((e, n) => e == null ? void 0 : e[n], t) : t == null ? void 0 : t[r];
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
+
function R(t) {
|
|
8
9
|
try {
|
|
9
10
|
return JSON.stringify(t);
|
|
10
11
|
} catch {
|
|
11
12
|
return Math.random();
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
const
|
|
15
|
-
const {
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const _ = (t, r) => {
|
|
16
|
+
const { internalInstance: e } = I(), n = h();
|
|
17
|
+
let a = "", c = !0;
|
|
18
|
+
return N((f) => {
|
|
19
|
+
var i;
|
|
20
|
+
const u = ((i = r == null ? void 0 : r.value) == null ? void 0 : i.getInternalInstance(A)) || e;
|
|
21
|
+
if (!u) {
|
|
22
|
+
c = !1;
|
|
20
23
|
return;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
}
|
|
25
|
+
const l = u.registerWatch((g) => {
|
|
26
|
+
const s = M(g, t), o = R(s);
|
|
27
|
+
o !== a && (n.value = s, a = o);
|
|
28
|
+
}, c);
|
|
29
|
+
f(l);
|
|
26
30
|
}), n;
|
|
27
31
|
};
|
|
28
32
|
export {
|
|
29
|
-
|
|
33
|
+
_ as default
|
|
30
34
|
};
|
|
@@ -11,6 +11,10 @@ export type ApFormItemProps = FormItemProps & Partial<ApFormColProps> & {
|
|
|
11
11
|
*/
|
|
12
12
|
bordered?: boolean;
|
|
13
13
|
valuePropName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 表单项的默认值(只生效一次)
|
|
16
|
+
*/
|
|
17
|
+
initialValue?: any;
|
|
14
18
|
};
|
|
15
19
|
export type ApFormItemGroupProps = RowProps & {
|
|
16
20
|
countPerRow?: number;
|
|
@@ -27,16 +31,43 @@ export type ApFormProps = Omit<FormProps, 'model'> & {
|
|
|
27
31
|
};
|
|
28
32
|
export type WatchFunc = (values?: Recordable) => void;
|
|
29
33
|
export type ApFormExpose<ModelType = any> = {
|
|
30
|
-
setFieldsValue
|
|
31
|
-
setFieldValue
|
|
32
|
-
resetFields: (
|
|
34
|
+
setFieldsValue: (fields: Partial<ModelType>) => void;
|
|
35
|
+
setFieldValue: (key: keyof ModelType, value: any) => void;
|
|
36
|
+
resetFields: () => void;
|
|
33
37
|
clearValidate: (name?: NamePath) => void;
|
|
34
38
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<ModelType>> | undefined;
|
|
35
39
|
getFieldsValue: (nameList?: true | InternalNamePath[]) => Partial<ModelType> | undefined;
|
|
36
40
|
validate: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<ModelType>> | undefined;
|
|
37
41
|
scrollToField: (name: NamePath, options?: any) => void;
|
|
38
|
-
|
|
42
|
+
/**
|
|
43
|
+
* 内部使用,请勿在外部通过Form实例调用
|
|
44
|
+
* @param mark 内部使用的标记
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
getInternalInstance: (mark: string) => ApFormInternalInstance;
|
|
39
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* 被注册的表单项
|
|
51
|
+
*/
|
|
52
|
+
export type RegistedFieldType = {
|
|
53
|
+
name: FormItemProps['name'];
|
|
54
|
+
initialValue?: any;
|
|
55
|
+
};
|
|
56
|
+
export type ApFormInternalInstance = {
|
|
57
|
+
/**
|
|
58
|
+
* 注册字段watch
|
|
59
|
+
* @param callback
|
|
60
|
+
* @param inner
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
|
|
64
|
+
/**
|
|
65
|
+
* 注册表单项
|
|
66
|
+
* @param field
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
registerField: (field: RegistedFieldType) => void;
|
|
70
|
+
} & Pick<ApFormExpose, 'setFieldValue'>;
|
|
40
71
|
export type ApFormItemExpose = FormItemExpose & {
|
|
41
72
|
getFieldValue: () => any;
|
|
42
73
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as f, useSlots as m, openBlock as u, createBlock as c, normalizeProps as a, guardReactiveProps as t, unref as
|
|
1
|
+
import { defineComponent as f, useSlots as m, openBlock as u, createBlock as c, normalizeProps as a, guardReactiveProps as t, unref as l, createSlots as b, withCtx as r, createVNode as B, mergeProps as x, renderList as y, renderSlot as _ } from "vue";
|
|
2
2
|
import "../../ap-form-item.vue2.mjs";
|
|
3
3
|
import "../../../ap-field/index.mjs";
|
|
4
4
|
import { omit as d } from "lodash-unified";
|
|
5
5
|
import h from "../../ap-form-item.vue.mjs";
|
|
6
6
|
import v from "../../../ap-field/checkbox/index.vue.mjs";
|
|
7
|
-
const
|
|
7
|
+
const w = /* @__PURE__ */ f({
|
|
8
8
|
name: "ApFormItemCheckbox",
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
@@ -43,26 +43,27 @@ const A = /* @__PURE__ */ f({
|
|
|
43
43
|
xxl: {},
|
|
44
44
|
flex: {},
|
|
45
45
|
valuePropName: {},
|
|
46
|
+
initialValue: {},
|
|
46
47
|
field: { default: () => ({}) },
|
|
47
48
|
disabled: { type: Boolean, default: !1 }
|
|
48
49
|
},
|
|
49
|
-
setup(
|
|
50
|
-
const
|
|
51
|
-
return (e, g) => (u(), c(h, a(t(
|
|
50
|
+
setup(i) {
|
|
51
|
+
const s = i, n = m();
|
|
52
|
+
return (e, g) => (u(), c(h, a(t(l(d)(s, ["field", "disabled"]))), b({
|
|
52
53
|
default: r(() => [
|
|
53
|
-
B(
|
|
54
|
+
B(l(v), x({ disabled: e.disabled }, e.field), null, 16, ["disabled"])
|
|
54
55
|
]),
|
|
55
56
|
_: 2
|
|
56
57
|
}, [
|
|
57
|
-
y(
|
|
58
|
-
name:
|
|
58
|
+
y(l(d)(n, "default"), (C, o) => ({
|
|
59
|
+
name: o,
|
|
59
60
|
fn: r((p) => [
|
|
60
|
-
_(e.$slots,
|
|
61
|
+
_(e.$slots, o, a(t(p || {})))
|
|
61
62
|
])
|
|
62
63
|
}))
|
|
63
64
|
]), 1040));
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
+
w as default
|
|
68
69
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as h, useSlots as B, computed as y, openBlock as v, createBlock as x, normalizeProps as
|
|
1
|
+
import { defineComponent as h, useSlots as B, computed as y, openBlock as v, createBlock as x, normalizeProps as r, guardReactiveProps as t, unref as a, createSlots as p, withCtx as i, createVNode as g, renderList as s, renderSlot as f } from "vue";
|
|
2
2
|
import "../../ap-form-item.vue2.mjs";
|
|
3
3
|
import "../../../ap-field/date/index.vue2.mjs";
|
|
4
4
|
import { isUndefined as F, omit as m, pick as S } from "lodash-unified";
|
|
5
5
|
import { apFormItemSlotNames as u } from "../../constant.mjs";
|
|
6
6
|
import k from "../../ap-form-item.vue.mjs";
|
|
7
7
|
import C from "../../../ap-field/date/index.vue.mjs";
|
|
8
|
-
const
|
|
8
|
+
const L = /* @__PURE__ */ h({
|
|
9
9
|
name: "ApFormItemDate",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
@@ -45,12 +45,13 @@ const V = /* @__PURE__ */ h({
|
|
|
45
45
|
flex: {},
|
|
46
46
|
bordered: { type: Boolean },
|
|
47
47
|
valuePropName: {},
|
|
48
|
+
initialValue: {},
|
|
48
49
|
field: { default: () => ({}) },
|
|
49
50
|
placeholder: {},
|
|
50
51
|
disabled: { type: Boolean, default: !1 }
|
|
51
52
|
},
|
|
52
53
|
setup(c) {
|
|
53
|
-
const e = c,
|
|
54
|
+
const e = c, n = B(), b = y(() => {
|
|
54
55
|
var o;
|
|
55
56
|
return {
|
|
56
57
|
placeholder: e.placeholder,
|
|
@@ -59,28 +60,28 @@ const V = /* @__PURE__ */ h({
|
|
|
59
60
|
bordered: e.bordered ? !1 : F((o = e.field) == null ? void 0 : o.bordered) ? !0 : e.field.bordered
|
|
60
61
|
};
|
|
61
62
|
});
|
|
62
|
-
return (o, P) => (v(), x(k,
|
|
63
|
-
default:
|
|
64
|
-
g(C,
|
|
65
|
-
|
|
63
|
+
return (o, P) => (v(), x(k, r(t(a(m)(e, ["field", "placeholder", "disabled"]))), p({
|
|
64
|
+
default: i(() => [
|
|
65
|
+
g(C, r(t(b.value)), p({ _: 2 }, [
|
|
66
|
+
s(a(m)(n, a(u)), (_, l) => ({
|
|
66
67
|
name: l,
|
|
67
|
-
fn:
|
|
68
|
-
f(o.$slots, l,
|
|
68
|
+
fn: i((d) => [
|
|
69
|
+
f(o.$slots, l, r(t(d || {})))
|
|
69
70
|
])
|
|
70
71
|
}))
|
|
71
72
|
]), 1040)
|
|
72
73
|
]),
|
|
73
74
|
_: 2
|
|
74
75
|
}, [
|
|
75
|
-
|
|
76
|
+
s(a(S)(n, a(u)), (_, l) => ({
|
|
76
77
|
name: l,
|
|
77
|
-
fn:
|
|
78
|
-
f(o.$slots, l,
|
|
78
|
+
fn: i((d) => [
|
|
79
|
+
f(o.$slots, l, r(t(d || {})))
|
|
79
80
|
])
|
|
80
81
|
}))
|
|
81
82
|
]), 1040));
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
L as default
|
|
86
87
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as y, computed as g, openBlock as v, createBlock as x, normalizeProps as r, guardReactiveProps as t, unref as o, createSlots as
|
|
1
|
+
import { defineComponent as B, useSlots as y, computed as g, openBlock as v, createBlock as x, normalizeProps as r, guardReactiveProps as t, unref as o, createSlots as s, withCtx as i, createVNode as F, renderList as f, renderSlot as m } from "vue";
|
|
2
2
|
import "../../ap-form-item.vue2.mjs";
|
|
3
3
|
import "../../../ap-field/index.mjs";
|
|
4
4
|
import { isUndefined as S, omit as u, pick as k } from "lodash-unified";
|
|
5
5
|
import { apFormItemSlotNames as c } from "../../constant.mjs";
|
|
6
6
|
import C from "../../ap-form-item.vue.mjs";
|
|
7
7
|
import P from "../../../ap-field/date-range/index.vue.mjs";
|
|
8
|
-
const
|
|
8
|
+
const I = /* @__PURE__ */ B({
|
|
9
9
|
name: "ApFormItemDateRange",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
@@ -45,12 +45,13 @@ const L = /* @__PURE__ */ B({
|
|
|
45
45
|
flex: {},
|
|
46
46
|
bordered: { type: Boolean },
|
|
47
47
|
valuePropName: {},
|
|
48
|
+
initialValue: {},
|
|
48
49
|
field: { default: () => ({}) },
|
|
49
50
|
placeholder: {},
|
|
50
51
|
disabled: { type: Boolean, default: !1 }
|
|
51
52
|
},
|
|
52
53
|
setup(b) {
|
|
53
|
-
const e = b,
|
|
54
|
+
const e = b, p = y(), _ = g(() => {
|
|
54
55
|
var l, d;
|
|
55
56
|
return {
|
|
56
57
|
placeholder: e.placeholder,
|
|
@@ -59,12 +60,12 @@ const L = /* @__PURE__ */ B({
|
|
|
59
60
|
bordered: e.bordered ? !1 : S((l = e.field) == null ? void 0 : l.bordered) ? !0 : (d = e.field) == null ? void 0 : d.bordered
|
|
60
61
|
};
|
|
61
62
|
});
|
|
62
|
-
return (l, d) => (v(), x(C, r(t(o(u)(e, ["field", "placeholder", "disabled"]))),
|
|
63
|
-
default:
|
|
64
|
-
F(o(P), r(t(_.value)),
|
|
65
|
-
f(o(u)(
|
|
63
|
+
return (l, d) => (v(), x(C, r(t(o(u)(e, ["field", "placeholder", "disabled"]))), s({
|
|
64
|
+
default: i(() => [
|
|
65
|
+
F(o(P), r(t(_.value)), s({ _: 2 }, [
|
|
66
|
+
f(o(u)(p, o(c)), (h, a) => ({
|
|
66
67
|
name: a,
|
|
67
|
-
fn:
|
|
68
|
+
fn: i((n) => [
|
|
68
69
|
m(l.$slots, a, r(t(n || {})))
|
|
69
70
|
])
|
|
70
71
|
}))
|
|
@@ -72,9 +73,9 @@ const L = /* @__PURE__ */ B({
|
|
|
72
73
|
]),
|
|
73
74
|
_: 2
|
|
74
75
|
}, [
|
|
75
|
-
f(o(k)(
|
|
76
|
+
f(o(k)(p, o(c)), (h, a) => ({
|
|
76
77
|
name: a,
|
|
77
|
-
fn:
|
|
78
|
+
fn: i((n) => [
|
|
78
79
|
m(l.$slots, a, r(t(n || {})))
|
|
79
80
|
])
|
|
80
81
|
}))
|
|
@@ -82,5 +83,5 @@ const L = /* @__PURE__ */ B({
|
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
I as default
|
|
86
87
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as v, ref as _, openBlock as g, createBlock as x, normalizeProps as t, guardReactiveProps as s, unref as l, createSlots as n, withCtx as p, createVNode as k, mergeProps as N, renderList as i, renderSlot as
|
|
1
|
+
import { defineComponent as B, useSlots as v, ref as _, openBlock as g, createBlock as x, normalizeProps as t, guardReactiveProps as s, unref as l, createSlots as n, withCtx as p, createVNode as k, mergeProps as N, renderList as i, renderSlot as u } from "vue";
|
|
2
2
|
import "../../ap-form-item.vue2.mjs";
|
|
3
3
|
import "../../../ap-field/number/index.vue2.mjs";
|
|
4
|
-
import { omit as
|
|
4
|
+
import { omit as f, pick as S } from "lodash-unified";
|
|
5
5
|
import { apFormItemSlotNames as m } from "../../constant.mjs";
|
|
6
6
|
import C from "../../ap-form-item.vue.mjs";
|
|
7
7
|
import F from "../../../ap-field/number/index.vue.mjs";
|
|
@@ -45,33 +45,34 @@ const T = /* @__PURE__ */ B({
|
|
|
45
45
|
flex: {},
|
|
46
46
|
bordered: { type: Boolean },
|
|
47
47
|
valuePropName: {},
|
|
48
|
+
initialValue: {},
|
|
48
49
|
field: { default: () => ({}) },
|
|
49
50
|
placeholder: {},
|
|
50
51
|
disabled: { type: Boolean, default: !1 }
|
|
51
52
|
},
|
|
52
53
|
setup(c, { expose: b }) {
|
|
53
|
-
const h = c, d = v(),
|
|
54
|
+
const h = c, d = v(), a = _();
|
|
54
55
|
return b({
|
|
55
56
|
focus: () => {
|
|
56
57
|
var e;
|
|
57
|
-
(e =
|
|
58
|
+
(e = a.value) == null || e.focus();
|
|
58
59
|
},
|
|
59
60
|
blur: () => {
|
|
60
61
|
var e;
|
|
61
|
-
(e =
|
|
62
|
+
(e = a.value) == null || e.blur();
|
|
62
63
|
}
|
|
63
|
-
}), (e, R) => (g(), x(C, t(s(l(
|
|
64
|
+
}), (e, R) => (g(), x(C, t(s(l(f)(h, ["field", "placeholder", "disabled"]))), n({
|
|
64
65
|
default: p(() => [
|
|
65
66
|
k(F, N({
|
|
66
67
|
ref_key: "inputNumberRef",
|
|
67
|
-
ref:
|
|
68
|
+
ref: a,
|
|
68
69
|
placeholder: e.placeholder,
|
|
69
70
|
disabled: e.disabled
|
|
70
71
|
}, e.field), n({ _: 2 }, [
|
|
71
|
-
i(l(
|
|
72
|
+
i(l(f)(d, l(m)), (y, o) => ({
|
|
72
73
|
name: o,
|
|
73
|
-
fn: p((
|
|
74
|
-
|
|
74
|
+
fn: p((r) => [
|
|
75
|
+
u(e.$slots, o, t(s(r || {})))
|
|
75
76
|
])
|
|
76
77
|
}))
|
|
77
78
|
]), 1040, ["placeholder", "disabled"])
|
|
@@ -80,8 +81,8 @@ const T = /* @__PURE__ */ B({
|
|
|
80
81
|
}, [
|
|
81
82
|
i(l(S)(d, l(m)), (y, o) => ({
|
|
82
83
|
name: o,
|
|
83
|
-
fn: p((
|
|
84
|
-
|
|
84
|
+
fn: p((r) => [
|
|
85
|
+
u(e.$slots, o, t(s(r || {})))
|
|
85
86
|
])
|
|
86
87
|
}))
|
|
87
88
|
]), 1040));
|
|
@@ -43,12 +43,13 @@ const q = /* @__PURE__ */ u({
|
|
|
43
43
|
xxl: {},
|
|
44
44
|
flex: {},
|
|
45
45
|
valuePropName: {},
|
|
46
|
+
initialValue: {},
|
|
46
47
|
field: { default: () => ({}) },
|
|
47
48
|
disabled: { type: Boolean, default: !1 }
|
|
48
49
|
},
|
|
49
|
-
setup(
|
|
50
|
-
const n =
|
|
51
|
-
return
|
|
50
|
+
setup(i, { expose: d }) {
|
|
51
|
+
const n = i, p = m(), o = c();
|
|
52
|
+
return d({
|
|
52
53
|
focus: () => {
|
|
53
54
|
var e;
|
|
54
55
|
(e = o.value) == null || e.focus();
|
|
@@ -4,7 +4,7 @@ import "../../../ap-field/index.mjs";
|
|
|
4
4
|
import { isUndefined as P, omit as c, pick as $ } from "lodash-unified";
|
|
5
5
|
import { apFormItemSlotNames as b } from "../../constant.mjs";
|
|
6
6
|
import N from "../../ap-form-item.vue.mjs";
|
|
7
|
-
import
|
|
7
|
+
import V from "../../../ap-field/select/index.vue.mjs";
|
|
8
8
|
const j = /* @__PURE__ */ x({
|
|
9
9
|
name: "ApFormItemSelect",
|
|
10
10
|
__name: "index",
|
|
@@ -45,6 +45,7 @@ const j = /* @__PURE__ */ x({
|
|
|
45
45
|
flex: {},
|
|
46
46
|
bordered: { type: Boolean },
|
|
47
47
|
valuePropName: {},
|
|
48
|
+
initialValue: {},
|
|
48
49
|
field: { default: () => ({}) },
|
|
49
50
|
placeholder: {},
|
|
50
51
|
disabled: { type: Boolean, default: !1 }
|
|
@@ -72,7 +73,7 @@ const j = /* @__PURE__ */ x({
|
|
|
72
73
|
});
|
|
73
74
|
return (e, d) => (F(), k(N, t(a(l(c)(o, ["field", "placeholder", "disabled"]))), f({
|
|
74
75
|
default: n(() => [
|
|
75
|
-
C(l(
|
|
76
|
+
C(l(V), t(a(v.value)), f({ _: 2 }, [
|
|
76
77
|
u(l(c)(i, l(b)), (B, r) => ({
|
|
77
78
|
name: r,
|
|
78
79
|
fn: n((s) => [
|