@carefrees/form-utils-vue 0.0.8 → 0.0.9
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/esm/form/form.vue2.mjs +4 -0
- package/esm/form/index.mjs +1 -1
- package/esm/formItem/form.Item.base.vue.mjs +1 -1
- package/esm/formItem/form.hide.item.vue.mjs +1 -1
- package/esm/formItem/formItem.vue.mjs +1 -1
- package/esm/hooks/attr/attr.FormItem.d.ts +5 -4
- package/esm/hooks/attr/attr.FormItem.mjs +7 -7
- package/esm/hooks/register/register.FormHideItem.mjs +5 -5
- package/esm/hooks/register/register.FormItem.mjs +10 -10
- package/esm/hooks/register/register.FormList.mjs +5 -5
- package/esm/hooks/useAttrs.mjs +7 -9
- package/esm/interface/index.d.ts +2 -2
- package/lib/form/form.vue2.js +4 -0
- package/lib/form/index.js +2 -2
- package/lib/formItem/form.Item.base.vue.js +1 -1
- package/lib/formItem/form.hide.item.vue.js +1 -1
- package/lib/formItem/formItem.vue.js +1 -1
- package/lib/hooks/attr/attr.FormItem.d.ts +5 -4
- package/lib/hooks/attr/attr.FormItem.js +7 -7
- package/lib/hooks/register/register.FormHideItem.js +4 -4
- package/lib/hooks/register/register.FormItem.js +10 -10
- package/lib/hooks/register/register.FormList.js +5 -5
- package/lib/hooks/useAttrs.js +6 -8
- package/lib/interface/index.d.ts +2 -2
- package/package.json +3 -3
- package/src/form/{index.vue → form.vue} +1 -1
- package/src/form/index.ts +1 -1
- package/src/hooks/attr/attr.FormItem.tsx +13 -9
- package/src/hooks/register/register.FormHideItem.ts +5 -5
- package/src/hooks/register/register.FormItem.ts +10 -10
- package/src/hooks/register/register.FormList.ts +5 -5
- package/src/hooks/useAttrs.ts +6 -8
- package/src/interface/index.ts +2 -2
- package/src/layout/layout.formItem.vue +1 -1
- package/esm/form/index.vue2.mjs +0 -4
- package/lib/form/index.vue2.js +0 -4
- /package/esm/form/{index.vue.d.ts → form.vue.d.ts} +0 -0
- /package/esm/form/{index.vue.mjs → form.vue.mjs} +0 -0
- /package/lib/form/{index.vue.d.ts → form.vue.d.ts} +0 -0
- /package/lib/form/{index.vue.js → form.vue.js} +0 -0
package/esm/form/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
11
|
...__default__,
|
|
12
12
|
props: {
|
|
13
13
|
noStyle: { type: Boolean },
|
|
14
|
-
input: {
|
|
14
|
+
input: {},
|
|
15
15
|
dependencies: {},
|
|
16
16
|
noticeOnlyRuleDataField: {},
|
|
17
17
|
isNoticeParentField: { type: Boolean },
|
|
@@ -10,7 +10,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
10
|
...__default__,
|
|
11
11
|
props: {
|
|
12
12
|
noStyle: { type: Boolean },
|
|
13
|
-
input: {
|
|
13
|
+
input: {},
|
|
14
14
|
dependencies: {},
|
|
15
15
|
noticeOnlyRuleDataField: {},
|
|
16
16
|
isNoticeParentField: { type: Boolean },
|
|
@@ -10,7 +10,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
10
|
...__default__,
|
|
11
11
|
props: {
|
|
12
12
|
noStyle: { type: Boolean },
|
|
13
|
-
input: {
|
|
13
|
+
input: {},
|
|
14
14
|
dependencies: {},
|
|
15
15
|
noticeOnlyRuleDataField: {},
|
|
16
16
|
isNoticeParentField: { type: Boolean },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormInstanceBase, FormItemInstanceBase } from '@carefrees/form-utils';
|
|
2
2
|
import { RegisterFormItemOptions } from './../register/register.FormItem';
|
|
3
|
+
import { Ref } from 'vue';
|
|
3
4
|
import { RuleInstanceBase2 } from '../../instance/ruleIntsnace';
|
|
4
5
|
export interface FormItemAttrOptions extends RegisterFormItemOptions {
|
|
5
6
|
/**依赖更新项*/
|
|
@@ -13,7 +14,7 @@ export interface FormItemAttrOptions extends RegisterFormItemOptions {
|
|
|
13
14
|
/**是否保护值(不进行表单项组件卸载重置初始值)*/
|
|
14
15
|
preserve?: boolean;
|
|
15
16
|
/**重写规则*/
|
|
16
|
-
useRules?: (ruleInstance: RuleInstanceBase2
|
|
17
|
+
useRules?: (ruleInstance: Ref<RuleInstanceBase2>, form: FormInstanceBase, formItemInstance: FormItemInstanceBase) => void;
|
|
17
18
|
/**输入框属性重写*/
|
|
18
19
|
useAttrs?: (attrs: any, form: FormInstanceBase, formItemInstance: FormItemInstanceBase) => any;
|
|
19
20
|
/**输入框属性*/
|
|
@@ -38,7 +39,7 @@ export declare const useFormItemAttr: (options: FormItemAttrOptions) => {
|
|
|
38
39
|
onChange: (event: any) => void;
|
|
39
40
|
formItemInstance: FormItemInstanceBase;
|
|
40
41
|
form: FormInstanceBase<any>;
|
|
41
|
-
ruleInstance:
|
|
42
|
+
ruleInstance: Ref<{
|
|
42
43
|
sort?: string | undefined;
|
|
43
44
|
instance?: {
|
|
44
45
|
formData: Partial<any>;
|
|
@@ -830,7 +831,7 @@ export declare const useFormItemAttr: (options: FormItemAttrOptions) => {
|
|
|
830
831
|
isPrototypeOf(v: Object): boolean;
|
|
831
832
|
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
832
833
|
}>;
|
|
833
|
-
attrsLastData:
|
|
834
|
+
attrsLastData: Ref<{
|
|
834
835
|
name: string;
|
|
835
836
|
id: string;
|
|
836
837
|
constructor: Function;
|
|
@@ -861,7 +862,7 @@ export declare const useFormItemAttr: (options: FormItemAttrOptions) => {
|
|
|
861
862
|
isPrototypeOf: (v: Object) => boolean;
|
|
862
863
|
propertyIsEnumerable: (v: PropertyKey) => boolean;
|
|
863
864
|
}>;
|
|
864
|
-
validateResult:
|
|
865
|
+
validateResult: Ref<{
|
|
865
866
|
tip: string | (string | undefined)[];
|
|
866
867
|
isInvalid: boolean;
|
|
867
868
|
}, {
|
|
@@ -38,7 +38,7 @@ const useFormItemAttr = (options) => {
|
|
|
38
38
|
formItemInstance.preserve = preserve;
|
|
39
39
|
const oldValue = ref(get(form.formData, toValue(newName)));
|
|
40
40
|
watch(() => [get(form.formData, toValue(newName)), toValue(newName)], () => {
|
|
41
|
-
oldValue.value = form.getFieldValue(newName
|
|
41
|
+
oldValue.value = form.getFieldValue(toValue(newName));
|
|
42
42
|
}, {
|
|
43
43
|
immediate: true
|
|
44
44
|
});
|
|
@@ -55,7 +55,7 @@ const useFormItemAttr = (options) => {
|
|
|
55
55
|
value = formatValue(value, form, formItemInstance, event);
|
|
56
56
|
}
|
|
57
57
|
if (oldValue.value !== value) {
|
|
58
|
-
form.updatedFieldValue(newName
|
|
58
|
+
form.updatedFieldValue(toValue(newName), value, "validate");
|
|
59
59
|
(_a = formItemInstance.onAfterUpdate) == null ? void 0 : _a.call(formItemInstance, value, form, formItemInstance, event);
|
|
60
60
|
if (Array.isArray(formItemInstance.noticeWatchField) && formItemInstance.noticeWatchField.length) {
|
|
61
61
|
form.noticeWatch(formItemInstance.noticeWatchField);
|
|
@@ -90,16 +90,16 @@ const useFormItemAttr = (options) => {
|
|
|
90
90
|
});
|
|
91
91
|
const attrsLastData = ref(toValue(newAttrs));
|
|
92
92
|
watch(() => [toValue(newAttrs), toValue(deepRefData), toValue(oldValue)], () => {
|
|
93
|
-
attrsLastData.value = (useAttrs == null ? void 0 : useAttrs(newAttrs
|
|
93
|
+
attrsLastData.value = (useAttrs == null ? void 0 : useAttrs(toValue(newAttrs), form, formItemInstance)) || toValue(newAttrs);
|
|
94
94
|
}, {
|
|
95
95
|
immediate: true
|
|
96
96
|
});
|
|
97
|
-
const validateResult = ref(ruleInstance.
|
|
97
|
+
const validateResult = ref(toValue(ruleInstance).getValidateResult());
|
|
98
98
|
watch(() => [toValue(deepRefData), toValue(oldValue)], () => {
|
|
99
|
-
useRules == null ? void 0 : useRules(ruleInstance
|
|
99
|
+
useRules == null ? void 0 : useRules(ruleInstance, form, formItemInstance);
|
|
100
100
|
});
|
|
101
|
-
watch(() => [ruleInstance.
|
|
102
|
-
validateResult.value = ruleInstance.
|
|
101
|
+
watch(() => [toValue(ruleInstance).messages, toValue(ruleInstance).rules, toValue(oldValue)], () => {
|
|
102
|
+
validateResult.value = toValue(ruleInstance).getValidateResult();
|
|
103
103
|
});
|
|
104
104
|
return {
|
|
105
105
|
valuePropName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, watch } from "vue";
|
|
1
|
+
import { ref, watch, toValue } from "vue";
|
|
2
2
|
import { FormHideItemInstanceBase } from "@carefrees/form-utils";
|
|
3
3
|
import { useFormItemParentNameInject } from "../useFormItemParentName.mjs";
|
|
4
4
|
import { useFormInject } from "../useForm.mjs";
|
|
@@ -10,7 +10,7 @@ const useRegisterFormHideItem = (options) => {
|
|
|
10
10
|
const hideItemInstance = ref(new FormHideItemInstanceBase().ctor(newName.value));
|
|
11
11
|
const isHide = ref(form.getFieldHideValue(newName.value));
|
|
12
12
|
watch(
|
|
13
|
-
[isHide
|
|
13
|
+
() => [toValue(isHide)],
|
|
14
14
|
() => {
|
|
15
15
|
hideItemInstance.value.preHideValue = isHide.value;
|
|
16
16
|
},
|
|
@@ -21,15 +21,15 @@ const useRegisterFormHideItem = (options) => {
|
|
|
21
21
|
};
|
|
22
22
|
hideItemInstance.value.updatedItem = setValue;
|
|
23
23
|
watch(
|
|
24
|
-
[form, newSort
|
|
24
|
+
() => [form, toValue(newSort)],
|
|
25
25
|
() => {
|
|
26
26
|
hideItemInstance.value.instance = form;
|
|
27
|
-
hideItemInstance.value.sort = newSort
|
|
27
|
+
hideItemInstance.value.sort = toValue(newSort);
|
|
28
28
|
},
|
|
29
29
|
{ immediate: true }
|
|
30
30
|
);
|
|
31
31
|
useEffect(() => {
|
|
32
|
-
return form.registerFormHideItem(hideItemInstance
|
|
32
|
+
return form.registerFormHideItem(toValue(hideItemInstance));
|
|
33
33
|
});
|
|
34
34
|
return { form, isHide };
|
|
35
35
|
};
|
|
@@ -12,7 +12,7 @@ const useRegisterFormItem = (options) => {
|
|
|
12
12
|
const ruleInstance = ref(new RuleInstanceBase2());
|
|
13
13
|
const formItemInstance = useFormItem();
|
|
14
14
|
watch(
|
|
15
|
-
[form],
|
|
15
|
+
() => [form],
|
|
16
16
|
() => {
|
|
17
17
|
ruleInstance.value.instance = form;
|
|
18
18
|
formItemInstance.instance = form;
|
|
@@ -20,30 +20,30 @@ const useRegisterFormItem = (options) => {
|
|
|
20
20
|
{ immediate: true }
|
|
21
21
|
);
|
|
22
22
|
watch(
|
|
23
|
-
[newName
|
|
23
|
+
() => [toValue(newName)],
|
|
24
24
|
() => {
|
|
25
|
-
ruleInstance.value.ctor(newName
|
|
26
|
-
formItemInstance.ctor(newName
|
|
25
|
+
ruleInstance.value.ctor(toValue(newName), rules || []);
|
|
26
|
+
formItemInstance.ctor(toValue(newName), toValue(ruleInstance));
|
|
27
27
|
},
|
|
28
28
|
{ immediate: true }
|
|
29
29
|
);
|
|
30
30
|
watch(
|
|
31
|
-
[newSort
|
|
31
|
+
() => [toValue(newSort)],
|
|
32
32
|
() => {
|
|
33
|
-
ruleInstance.value.sort = newSort
|
|
34
|
-
formItemInstance.sort = newSort
|
|
33
|
+
ruleInstance.value.sort = toValue(newSort);
|
|
34
|
+
formItemInstance.sort = toValue(newSort);
|
|
35
35
|
},
|
|
36
36
|
{ immediate: true }
|
|
37
37
|
);
|
|
38
38
|
watch(
|
|
39
|
-
[parentItem
|
|
39
|
+
() => [toValue(parentItem)],
|
|
40
40
|
() => {
|
|
41
|
-
formItemInstance.parentDataField = toValue(parentItem.
|
|
41
|
+
formItemInstance.parentDataField = toValue(toValue(parentItem).name);
|
|
42
42
|
},
|
|
43
43
|
{ immediate: true }
|
|
44
44
|
);
|
|
45
45
|
const updated = () => {
|
|
46
|
-
deepRefData.value = {
|
|
46
|
+
deepRefData.value = { __temp: (/* @__PURE__ */ new Date()).valueOf() };
|
|
47
47
|
};
|
|
48
48
|
formItemInstance.updated = updated;
|
|
49
49
|
ruleInstance.value.updated = updated;
|
|
@@ -6,23 +6,23 @@ const useRegisterFormList = (options) => {
|
|
|
6
6
|
const { ruleInstance, formItemInstance, form, newName, parentItem } = useRegisterFormItem(options);
|
|
7
7
|
const formListInstance = useFormList();
|
|
8
8
|
watch(
|
|
9
|
-
[newName
|
|
9
|
+
() => [toValue(newName)],
|
|
10
10
|
() => {
|
|
11
|
-
formListInstance.ctor(newName
|
|
11
|
+
formListInstance.ctor(toValue(newName));
|
|
12
12
|
},
|
|
13
13
|
{ immediate: true }
|
|
14
14
|
);
|
|
15
15
|
watch(
|
|
16
|
-
[form, formItemInstance, ruleInstance
|
|
16
|
+
() => [form, formItemInstance, toValue(ruleInstance)],
|
|
17
17
|
() => {
|
|
18
18
|
formListInstance.instance = form;
|
|
19
19
|
formListInstance.formItemInstance = formItemInstance;
|
|
20
|
-
formListInstance.rule = ruleInstance
|
|
20
|
+
formListInstance.rule = toValue(ruleInstance);
|
|
21
21
|
},
|
|
22
22
|
{ immediate: true }
|
|
23
23
|
);
|
|
24
24
|
watch(
|
|
25
|
-
[options.sort, parentItem
|
|
25
|
+
() => [options.sort, toValue(parentItem)],
|
|
26
26
|
() => {
|
|
27
27
|
formListInstance.sort = toValue(parentItem.value.sort);
|
|
28
28
|
formListInstance.parentDataField = toValue(parentItem.value.name);
|
package/esm/hooks/useAttrs.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, computed,
|
|
1
|
+
import { inject, computed, ref, provide, reactive } from "vue";
|
|
2
2
|
const attrsProvideSymbol = Symbol("carefrees-attrs");
|
|
3
3
|
function useAttrsProvide(options) {
|
|
4
4
|
const {
|
|
@@ -28,14 +28,12 @@ function useAttrsProvide(options) {
|
|
|
28
28
|
function useAttrsInject() {
|
|
29
29
|
const attrs = inject(
|
|
30
30
|
attrsProvideSymbol,
|
|
31
|
-
computed(
|
|
32
|
-
()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
)
|
|
31
|
+
computed(() => ({
|
|
32
|
+
colCount: ref(4),
|
|
33
|
+
errorLayout: ref("left-bottom"),
|
|
34
|
+
labelMode: ref("top"),
|
|
35
|
+
showColon: ref(true)
|
|
36
|
+
}))
|
|
39
37
|
);
|
|
40
38
|
return attrs;
|
|
41
39
|
}
|
package/esm/interface/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef, Ref,
|
|
1
|
+
import { ComputedRef, Ref, Component, StyleValue, UnwrapNestedRefs } from 'vue';
|
|
2
2
|
import { FormItemAttrOptions } from '../hooks/attr/attr.FormItem';
|
|
3
3
|
import { LayoutFormItemProps } from './layout.formItem';
|
|
4
4
|
import { FormLayoutProps } from './layout';
|
|
@@ -11,7 +11,7 @@ export interface FormItemProps extends FormItemAttrOptions, LayoutFormItemProps
|
|
|
11
11
|
/**不进行样式渲染*/
|
|
12
12
|
noStyle?: boolean;
|
|
13
13
|
/**输入框组件*/
|
|
14
|
-
input?:
|
|
14
|
+
input?: Component | string;
|
|
15
15
|
}
|
|
16
16
|
export interface FormProps<T = any> extends FormLayoutProps {
|
|
17
17
|
form?: FormInstanceBase;
|
package/lib/form/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const form_vue_vue_type_script_setup_true_lang = require("./form.vue.js");
|
|
4
4
|
const withInstall = require("../utils/withInstall.js");
|
|
5
|
-
const Form = withInstall.withInstall(
|
|
5
|
+
const Form = withInstall.withInstall(form_vue_vue_type_script_setup_true_lang.default);
|
|
6
6
|
exports.Form = Form;
|
|
@@ -13,7 +13,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
13
13
|
...__default__,
|
|
14
14
|
props: {
|
|
15
15
|
noStyle: { type: Boolean },
|
|
16
|
-
input: {
|
|
16
|
+
input: {},
|
|
17
17
|
dependencies: {},
|
|
18
18
|
noticeOnlyRuleDataField: {},
|
|
19
19
|
isNoticeParentField: { type: Boolean },
|
|
@@ -12,7 +12,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
12
12
|
...__default__,
|
|
13
13
|
props: {
|
|
14
14
|
noStyle: { type: Boolean },
|
|
15
|
-
input: {
|
|
15
|
+
input: {},
|
|
16
16
|
dependencies: {},
|
|
17
17
|
noticeOnlyRuleDataField: {},
|
|
18
18
|
isNoticeParentField: { type: Boolean },
|
|
@@ -12,7 +12,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
12
12
|
...__default__,
|
|
13
13
|
props: {
|
|
14
14
|
noStyle: { type: Boolean },
|
|
15
|
-
input: {
|
|
15
|
+
input: {},
|
|
16
16
|
dependencies: {},
|
|
17
17
|
noticeOnlyRuleDataField: {},
|
|
18
18
|
isNoticeParentField: { type: Boolean },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormInstanceBase, FormItemInstanceBase } from '@carefrees/form-utils';
|
|
2
2
|
import { RegisterFormItemOptions } from './../register/register.FormItem';
|
|
3
|
+
import { Ref } from 'vue';
|
|
3
4
|
import { RuleInstanceBase2 } from '../../instance/ruleIntsnace';
|
|
4
5
|
export interface FormItemAttrOptions extends RegisterFormItemOptions {
|
|
5
6
|
/**依赖更新项*/
|
|
@@ -13,7 +14,7 @@ export interface FormItemAttrOptions extends RegisterFormItemOptions {
|
|
|
13
14
|
/**是否保护值(不进行表单项组件卸载重置初始值)*/
|
|
14
15
|
preserve?: boolean;
|
|
15
16
|
/**重写规则*/
|
|
16
|
-
useRules?: (ruleInstance: RuleInstanceBase2
|
|
17
|
+
useRules?: (ruleInstance: Ref<RuleInstanceBase2>, form: FormInstanceBase, formItemInstance: FormItemInstanceBase) => void;
|
|
17
18
|
/**输入框属性重写*/
|
|
18
19
|
useAttrs?: (attrs: any, form: FormInstanceBase, formItemInstance: FormItemInstanceBase) => any;
|
|
19
20
|
/**输入框属性*/
|
|
@@ -38,7 +39,7 @@ export declare const useFormItemAttr: (options: FormItemAttrOptions) => {
|
|
|
38
39
|
onChange: (event: any) => void;
|
|
39
40
|
formItemInstance: FormItemInstanceBase;
|
|
40
41
|
form: FormInstanceBase<any>;
|
|
41
|
-
ruleInstance:
|
|
42
|
+
ruleInstance: Ref<{
|
|
42
43
|
sort?: string | undefined;
|
|
43
44
|
instance?: {
|
|
44
45
|
formData: Partial<any>;
|
|
@@ -830,7 +831,7 @@ export declare const useFormItemAttr: (options: FormItemAttrOptions) => {
|
|
|
830
831
|
isPrototypeOf(v: Object): boolean;
|
|
831
832
|
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
832
833
|
}>;
|
|
833
|
-
attrsLastData:
|
|
834
|
+
attrsLastData: Ref<{
|
|
834
835
|
name: string;
|
|
835
836
|
id: string;
|
|
836
837
|
constructor: Function;
|
|
@@ -861,7 +862,7 @@ export declare const useFormItemAttr: (options: FormItemAttrOptions) => {
|
|
|
861
862
|
isPrototypeOf: (v: Object) => boolean;
|
|
862
863
|
propertyIsEnumerable: (v: PropertyKey) => boolean;
|
|
863
864
|
}>;
|
|
864
|
-
validateResult:
|
|
865
|
+
validateResult: Ref<{
|
|
865
866
|
tip: string | (string | undefined)[];
|
|
866
867
|
isInvalid: boolean;
|
|
867
868
|
}, {
|
|
@@ -40,7 +40,7 @@ const useFormItemAttr = (options) => {
|
|
|
40
40
|
formItemInstance.preserve = preserve;
|
|
41
41
|
const oldValue = vue.ref(formUtils.get(form.formData, vue.toValue(newName)));
|
|
42
42
|
vue.watch(() => [formUtils.get(form.formData, vue.toValue(newName)), vue.toValue(newName)], () => {
|
|
43
|
-
oldValue.value = form.getFieldValue(newName
|
|
43
|
+
oldValue.value = form.getFieldValue(vue.toValue(newName));
|
|
44
44
|
}, {
|
|
45
45
|
immediate: true
|
|
46
46
|
});
|
|
@@ -57,7 +57,7 @@ const useFormItemAttr = (options) => {
|
|
|
57
57
|
value = formatValue(value, form, formItemInstance, event);
|
|
58
58
|
}
|
|
59
59
|
if (oldValue.value !== value) {
|
|
60
|
-
form.updatedFieldValue(newName
|
|
60
|
+
form.updatedFieldValue(vue.toValue(newName), value, "validate");
|
|
61
61
|
(_a = formItemInstance.onAfterUpdate) == null ? void 0 : _a.call(formItemInstance, value, form, formItemInstance, event);
|
|
62
62
|
if (Array.isArray(formItemInstance.noticeWatchField) && formItemInstance.noticeWatchField.length) {
|
|
63
63
|
form.noticeWatch(formItemInstance.noticeWatchField);
|
|
@@ -92,16 +92,16 @@ const useFormItemAttr = (options) => {
|
|
|
92
92
|
});
|
|
93
93
|
const attrsLastData = vue.ref(vue.toValue(newAttrs));
|
|
94
94
|
vue.watch(() => [vue.toValue(newAttrs), vue.toValue(deepRefData), vue.toValue(oldValue)], () => {
|
|
95
|
-
attrsLastData.value = (useAttrs == null ? void 0 : useAttrs(newAttrs
|
|
95
|
+
attrsLastData.value = (useAttrs == null ? void 0 : useAttrs(vue.toValue(newAttrs), form, formItemInstance)) || vue.toValue(newAttrs);
|
|
96
96
|
}, {
|
|
97
97
|
immediate: true
|
|
98
98
|
});
|
|
99
|
-
const validateResult = vue.ref(ruleInstance.
|
|
99
|
+
const validateResult = vue.ref(vue.toValue(ruleInstance).getValidateResult());
|
|
100
100
|
vue.watch(() => [vue.toValue(deepRefData), vue.toValue(oldValue)], () => {
|
|
101
|
-
useRules == null ? void 0 : useRules(ruleInstance
|
|
101
|
+
useRules == null ? void 0 : useRules(ruleInstance, form, formItemInstance);
|
|
102
102
|
});
|
|
103
|
-
vue.watch(() => [ruleInstance.
|
|
104
|
-
validateResult.value = ruleInstance.
|
|
103
|
+
vue.watch(() => [vue.toValue(ruleInstance).messages, vue.toValue(ruleInstance).rules, vue.toValue(oldValue)], () => {
|
|
104
|
+
validateResult.value = vue.toValue(ruleInstance).getValidateResult();
|
|
105
105
|
});
|
|
106
106
|
return {
|
|
107
107
|
valuePropName,
|
|
@@ -12,7 +12,7 @@ const useRegisterFormHideItem = (options) => {
|
|
|
12
12
|
const hideItemInstance = vue.ref(new formUtils.FormHideItemInstanceBase().ctor(newName.value));
|
|
13
13
|
const isHide = vue.ref(form.getFieldHideValue(newName.value));
|
|
14
14
|
vue.watch(
|
|
15
|
-
[isHide
|
|
15
|
+
() => [vue.toValue(isHide)],
|
|
16
16
|
() => {
|
|
17
17
|
hideItemInstance.value.preHideValue = isHide.value;
|
|
18
18
|
},
|
|
@@ -23,15 +23,15 @@ const useRegisterFormHideItem = (options) => {
|
|
|
23
23
|
};
|
|
24
24
|
hideItemInstance.value.updatedItem = setValue;
|
|
25
25
|
vue.watch(
|
|
26
|
-
[form, newSort
|
|
26
|
+
() => [form, vue.toValue(newSort)],
|
|
27
27
|
() => {
|
|
28
28
|
hideItemInstance.value.instance = form;
|
|
29
|
-
hideItemInstance.value.sort = newSort
|
|
29
|
+
hideItemInstance.value.sort = vue.toValue(newSort);
|
|
30
30
|
},
|
|
31
31
|
{ immediate: true }
|
|
32
32
|
);
|
|
33
33
|
useEffect.useEffect(() => {
|
|
34
|
-
return form.registerFormHideItem(hideItemInstance
|
|
34
|
+
return form.registerFormHideItem(vue.toValue(hideItemInstance));
|
|
35
35
|
});
|
|
36
36
|
return { form, isHide };
|
|
37
37
|
};
|
|
@@ -14,7 +14,7 @@ const useRegisterFormItem = (options) => {
|
|
|
14
14
|
const ruleInstance = vue.ref(new ruleIntsnace.RuleInstanceBase2());
|
|
15
15
|
const formItemInstance = useFormItem.useFormItem();
|
|
16
16
|
vue.watch(
|
|
17
|
-
[form],
|
|
17
|
+
() => [form],
|
|
18
18
|
() => {
|
|
19
19
|
ruleInstance.value.instance = form;
|
|
20
20
|
formItemInstance.instance = form;
|
|
@@ -22,30 +22,30 @@ const useRegisterFormItem = (options) => {
|
|
|
22
22
|
{ immediate: true }
|
|
23
23
|
);
|
|
24
24
|
vue.watch(
|
|
25
|
-
[newName
|
|
25
|
+
() => [vue.toValue(newName)],
|
|
26
26
|
() => {
|
|
27
|
-
ruleInstance.value.ctor(newName
|
|
28
|
-
formItemInstance.ctor(newName
|
|
27
|
+
ruleInstance.value.ctor(vue.toValue(newName), rules || []);
|
|
28
|
+
formItemInstance.ctor(vue.toValue(newName), vue.toValue(ruleInstance));
|
|
29
29
|
},
|
|
30
30
|
{ immediate: true }
|
|
31
31
|
);
|
|
32
32
|
vue.watch(
|
|
33
|
-
[newSort
|
|
33
|
+
() => [vue.toValue(newSort)],
|
|
34
34
|
() => {
|
|
35
|
-
ruleInstance.value.sort = newSort
|
|
36
|
-
formItemInstance.sort = newSort
|
|
35
|
+
ruleInstance.value.sort = vue.toValue(newSort);
|
|
36
|
+
formItemInstance.sort = vue.toValue(newSort);
|
|
37
37
|
},
|
|
38
38
|
{ immediate: true }
|
|
39
39
|
);
|
|
40
40
|
vue.watch(
|
|
41
|
-
[parentItem
|
|
41
|
+
() => [vue.toValue(parentItem)],
|
|
42
42
|
() => {
|
|
43
|
-
formItemInstance.parentDataField = vue.toValue(parentItem.
|
|
43
|
+
formItemInstance.parentDataField = vue.toValue(vue.toValue(parentItem).name);
|
|
44
44
|
},
|
|
45
45
|
{ immediate: true }
|
|
46
46
|
);
|
|
47
47
|
const updated = () => {
|
|
48
|
-
deepRefData.value = {
|
|
48
|
+
deepRefData.value = { __temp: (/* @__PURE__ */ new Date()).valueOf() };
|
|
49
49
|
};
|
|
50
50
|
formItemInstance.updated = updated;
|
|
51
51
|
ruleInstance.value.updated = updated;
|
|
@@ -8,23 +8,23 @@ const useRegisterFormList = (options) => {
|
|
|
8
8
|
const { ruleInstance, formItemInstance, form, newName, parentItem } = register_FormItem.useRegisterFormItem(options);
|
|
9
9
|
const formListInstance = useFormList.useFormList();
|
|
10
10
|
vue.watch(
|
|
11
|
-
[newName
|
|
11
|
+
() => [vue.toValue(newName)],
|
|
12
12
|
() => {
|
|
13
|
-
formListInstance.ctor(newName
|
|
13
|
+
formListInstance.ctor(vue.toValue(newName));
|
|
14
14
|
},
|
|
15
15
|
{ immediate: true }
|
|
16
16
|
);
|
|
17
17
|
vue.watch(
|
|
18
|
-
[form, formItemInstance, ruleInstance
|
|
18
|
+
() => [form, formItemInstance, vue.toValue(ruleInstance)],
|
|
19
19
|
() => {
|
|
20
20
|
formListInstance.instance = form;
|
|
21
21
|
formListInstance.formItemInstance = formItemInstance;
|
|
22
|
-
formListInstance.rule = ruleInstance
|
|
22
|
+
formListInstance.rule = vue.toValue(ruleInstance);
|
|
23
23
|
},
|
|
24
24
|
{ immediate: true }
|
|
25
25
|
);
|
|
26
26
|
vue.watch(
|
|
27
|
-
[options.sort, parentItem
|
|
27
|
+
() => [options.sort, vue.toValue(parentItem)],
|
|
28
28
|
() => {
|
|
29
29
|
formListInstance.sort = vue.toValue(parentItem.value.sort);
|
|
30
30
|
formListInstance.parentDataField = vue.toValue(parentItem.value.name);
|
package/lib/hooks/useAttrs.js
CHANGED
|
@@ -30,14 +30,12 @@ function useAttrsProvide(options) {
|
|
|
30
30
|
function useAttrsInject() {
|
|
31
31
|
const attrs = vue.inject(
|
|
32
32
|
attrsProvideSymbol,
|
|
33
|
-
vue.computed(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})
|
|
40
|
-
)
|
|
33
|
+
vue.computed(() => ({
|
|
34
|
+
colCount: vue.ref(4),
|
|
35
|
+
errorLayout: vue.ref("left-bottom"),
|
|
36
|
+
labelMode: vue.ref("top"),
|
|
37
|
+
showColon: vue.ref(true)
|
|
38
|
+
}))
|
|
41
39
|
);
|
|
42
40
|
return attrs;
|
|
43
41
|
}
|
package/lib/interface/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef, Ref,
|
|
1
|
+
import { ComputedRef, Ref, Component, StyleValue, UnwrapNestedRefs } from 'vue';
|
|
2
2
|
import { FormItemAttrOptions } from '../hooks/attr/attr.FormItem';
|
|
3
3
|
import { LayoutFormItemProps } from './layout.formItem';
|
|
4
4
|
import { FormLayoutProps } from './layout';
|
|
@@ -11,7 +11,7 @@ export interface FormItemProps extends FormItemAttrOptions, LayoutFormItemProps
|
|
|
11
11
|
/**不进行样式渲染*/
|
|
12
12
|
noStyle?: boolean;
|
|
13
13
|
/**输入框组件*/
|
|
14
|
-
input?:
|
|
14
|
+
input?: Component | string;
|
|
15
15
|
}
|
|
16
16
|
export interface FormProps<T = any> extends FormLayoutProps {
|
|
17
17
|
form?: FormInstanceBase;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carefrees/form-utils-vue",
|
|
3
3
|
"author": "SunLxy <1011771396@qq.com>",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "esm/index.mjs",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"vue": "^3.5.13"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
+
"@carefrees/form-utils": "^0.0.9",
|
|
29
30
|
"async-validator": "~4.2.5",
|
|
30
|
-
"@carefrees/form-utils": "^0.0.8",
|
|
31
31
|
"classnames": "2.5.1"
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { computed, defineProps, withDefaults, reactive, defineEmits } from "vue"
|
|
12
12
|
import type { FormProps } from "../interface/index"
|
|
13
13
|
import { useRegisterForm } from "../hooks/register/register.form"
|
|
14
|
-
import { useForm, useFormProvide } from "
|
|
14
|
+
import { useForm, useFormProvide } from "../hooks/useForm"
|
|
15
15
|
import FormLayout from "../layout/layout.vue"
|
|
16
16
|
import clx from 'classnames';
|
|
17
17
|
|
package/src/form/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormInstanceBase, FormItemInstanceBase, get } from '@carefrees/form-utils';
|
|
2
2
|
import { useHtmlFor } from './../useHtmlFor';
|
|
3
3
|
import { useRegisterFormItem, RegisterFormItemOptions } from './../register/register.FormItem';
|
|
4
|
-
import { computed, ref, toValue, watch } from 'vue';
|
|
4
|
+
import { computed, Ref, ref, toValue, watch } from 'vue';
|
|
5
5
|
import type { RuleInstanceBase2 } from '../../instance/ruleIntsnace';
|
|
6
6
|
|
|
7
7
|
export interface FormItemAttrOptions extends RegisterFormItemOptions {
|
|
@@ -16,7 +16,11 @@ export interface FormItemAttrOptions extends RegisterFormItemOptions {
|
|
|
16
16
|
/**是否保护值(不进行表单项组件卸载重置初始值)*/
|
|
17
17
|
preserve?: boolean;
|
|
18
18
|
/**重写规则*/
|
|
19
|
-
useRules?: (
|
|
19
|
+
useRules?: (
|
|
20
|
+
ruleInstance: Ref<RuleInstanceBase2>,
|
|
21
|
+
form: FormInstanceBase,
|
|
22
|
+
formItemInstance: FormItemInstanceBase,
|
|
23
|
+
) => void;
|
|
20
24
|
/**输入框属性重写*/
|
|
21
25
|
useAttrs?: (attrs: any, form: FormInstanceBase, formItemInstance: FormItemInstanceBase) => any;
|
|
22
26
|
/**输入框属性*/
|
|
@@ -67,7 +71,7 @@ export const useFormItemAttr = (options: FormItemAttrOptions) => {
|
|
|
67
71
|
watch(
|
|
68
72
|
() => [get(form.formData, toValue(newName)), toValue(newName)],
|
|
69
73
|
() => {
|
|
70
|
-
oldValue.value = form.getFieldValue(newName
|
|
74
|
+
oldValue.value = form.getFieldValue(toValue(newName));
|
|
71
75
|
},
|
|
72
76
|
{ immediate: true },
|
|
73
77
|
);
|
|
@@ -84,7 +88,7 @@ export const useFormItemAttr = (options: FormItemAttrOptions) => {
|
|
|
84
88
|
value = formatValue(value, form, formItemInstance, event);
|
|
85
89
|
}
|
|
86
90
|
if (oldValue.value !== value) {
|
|
87
|
-
form.updatedFieldValue(newName
|
|
91
|
+
form.updatedFieldValue(toValue(newName), value, 'validate');
|
|
88
92
|
formItemInstance.onAfterUpdate?.(value, form, formItemInstance, event);
|
|
89
93
|
if (Array.isArray(formItemInstance.noticeWatchField) && formItemInstance.noticeWatchField.length) {
|
|
90
94
|
form.noticeWatch(formItemInstance.noticeWatchField);
|
|
@@ -132,25 +136,25 @@ export const useFormItemAttr = (options: FormItemAttrOptions) => {
|
|
|
132
136
|
watch(
|
|
133
137
|
() => [toValue(newAttrs), toValue(deepRefData), toValue(oldValue)],
|
|
134
138
|
() => {
|
|
135
|
-
attrsLastData.value = useAttrs?.(newAttrs
|
|
139
|
+
attrsLastData.value = useAttrs?.(toValue(newAttrs), form, formItemInstance) || toValue(newAttrs);
|
|
136
140
|
},
|
|
137
141
|
{ immediate: true },
|
|
138
142
|
);
|
|
139
143
|
|
|
140
144
|
/**规则处理**/
|
|
141
|
-
const validateResult = ref(ruleInstance.
|
|
145
|
+
const validateResult = ref(toValue(ruleInstance).getValidateResult());
|
|
142
146
|
|
|
143
147
|
watch(
|
|
144
148
|
() => [toValue(deepRefData), toValue(oldValue)],
|
|
145
149
|
() => {
|
|
146
|
-
useRules?.(ruleInstance
|
|
150
|
+
useRules?.(ruleInstance as any, form, formItemInstance);
|
|
147
151
|
},
|
|
148
152
|
);
|
|
149
153
|
|
|
150
154
|
watch(
|
|
151
|
-
() => [ruleInstance.
|
|
155
|
+
() => [toValue(ruleInstance).messages, toValue(ruleInstance).rules, toValue(oldValue)],
|
|
152
156
|
() => {
|
|
153
|
-
validateResult.value = ruleInstance.
|
|
157
|
+
validateResult.value = toValue(ruleInstance).getValidateResult();
|
|
154
158
|
},
|
|
155
159
|
);
|
|
156
160
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, watch } from 'vue';
|
|
1
|
+
import { ref, toValue, watch } from 'vue';
|
|
2
2
|
import { RegisterFormItemOptions } from './register.FormItem';
|
|
3
3
|
import { FormHideItemInstanceBase } from '@carefrees/form-utils';
|
|
4
4
|
import { useFormItemParentNameInject } from '../useFormItemParentName';
|
|
@@ -15,7 +15,7 @@ export const useRegisterFormHideItem = (options: RegisterFormHideItemOptions) =>
|
|
|
15
15
|
const hideItemInstance = ref<FormHideItemInstanceBase>(new FormHideItemInstanceBase().ctor(newName.value));
|
|
16
16
|
const isHide = ref(form.getFieldHideValue(newName.value));
|
|
17
17
|
watch(
|
|
18
|
-
[isHide
|
|
18
|
+
() => [toValue(isHide)],
|
|
19
19
|
() => {
|
|
20
20
|
hideItemInstance.value.preHideValue = isHide.value;
|
|
21
21
|
},
|
|
@@ -29,16 +29,16 @@ export const useRegisterFormHideItem = (options: RegisterFormHideItemOptions) =>
|
|
|
29
29
|
hideItemInstance.value.updatedItem = setValue;
|
|
30
30
|
|
|
31
31
|
watch(
|
|
32
|
-
[form, newSort
|
|
32
|
+
() => [form, toValue(newSort)],
|
|
33
33
|
() => {
|
|
34
34
|
hideItemInstance.value.instance = form;
|
|
35
|
-
hideItemInstance.value.sort = newSort
|
|
35
|
+
hideItemInstance.value.sort = toValue(newSort);
|
|
36
36
|
},
|
|
37
37
|
{ immediate: true },
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
useEffect(() => {
|
|
41
|
-
return form.registerFormHideItem(hideItemInstance
|
|
41
|
+
return form.registerFormHideItem(toValue(hideItemInstance) as FormHideItemInstanceBase);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
return { form, isHide };
|
|
@@ -33,7 +33,7 @@ export const useRegisterFormItem = (options: RegisterFormItemOptions) => {
|
|
|
33
33
|
const formItemInstance = useFormItem();
|
|
34
34
|
|
|
35
35
|
watch(
|
|
36
|
-
[form],
|
|
36
|
+
() => [form],
|
|
37
37
|
() => {
|
|
38
38
|
ruleInstance.value.instance = form;
|
|
39
39
|
formItemInstance.instance = form;
|
|
@@ -42,33 +42,33 @@ export const useRegisterFormItem = (options: RegisterFormItemOptions) => {
|
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
watch(
|
|
45
|
-
[newName
|
|
45
|
+
() => [toValue(newName)],
|
|
46
46
|
() => {
|
|
47
|
-
ruleInstance.value.ctor(newName
|
|
48
|
-
formItemInstance.ctor(newName
|
|
47
|
+
ruleInstance.value.ctor(toValue(newName), rules || []);
|
|
48
|
+
formItemInstance.ctor(toValue(newName), toValue(ruleInstance) as any);
|
|
49
49
|
},
|
|
50
50
|
{ immediate: true },
|
|
51
51
|
);
|
|
52
52
|
|
|
53
53
|
watch(
|
|
54
|
-
[newSort
|
|
54
|
+
() => [toValue(newSort)],
|
|
55
55
|
() => {
|
|
56
|
-
ruleInstance.value.sort = newSort
|
|
57
|
-
formItemInstance.sort = newSort
|
|
56
|
+
ruleInstance.value.sort = toValue(newSort);
|
|
57
|
+
formItemInstance.sort = toValue(newSort);
|
|
58
58
|
},
|
|
59
59
|
{ immediate: true },
|
|
60
60
|
);
|
|
61
61
|
|
|
62
62
|
watch(
|
|
63
|
-
[parentItem
|
|
63
|
+
() => [toValue(parentItem)],
|
|
64
64
|
() => {
|
|
65
|
-
formItemInstance.parentDataField = toValue(parentItem.
|
|
65
|
+
formItemInstance.parentDataField = toValue(toValue(parentItem).name);
|
|
66
66
|
},
|
|
67
67
|
{ immediate: true },
|
|
68
68
|
);
|
|
69
69
|
|
|
70
70
|
const updated = () => {
|
|
71
|
-
deepRefData.value = {
|
|
71
|
+
deepRefData.value = { __temp: new Date().valueOf() };
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
formItemInstance.updated = updated;
|
|
@@ -11,25 +11,25 @@ export const useRegisterFormList = (options: RegisterFormListOptions) => {
|
|
|
11
11
|
const formListInstance = useFormList();
|
|
12
12
|
|
|
13
13
|
watch(
|
|
14
|
-
[newName
|
|
14
|
+
() => [toValue(newName)],
|
|
15
15
|
() => {
|
|
16
|
-
formListInstance.ctor(newName
|
|
16
|
+
formListInstance.ctor(toValue(newName));
|
|
17
17
|
},
|
|
18
18
|
{ immediate: true },
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
watch(
|
|
22
|
-
[form, formItemInstance, ruleInstance
|
|
22
|
+
() => [form, formItemInstance, toValue(ruleInstance)],
|
|
23
23
|
() => {
|
|
24
24
|
formListInstance.instance = form;
|
|
25
25
|
formListInstance.formItemInstance = formItemInstance;
|
|
26
|
-
formListInstance.rule = ruleInstance
|
|
26
|
+
formListInstance.rule = toValue(ruleInstance) as any;
|
|
27
27
|
},
|
|
28
28
|
{ immediate: true },
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
watch(
|
|
32
|
-
[options.sort, parentItem
|
|
32
|
+
() => [options.sort, toValue(parentItem)],
|
|
33
33
|
() => {
|
|
34
34
|
formListInstance.sort = toValue(parentItem.value.sort);
|
|
35
35
|
formListInstance.parentDataField = toValue(parentItem.value.name);
|
package/src/hooks/useAttrs.ts
CHANGED
|
@@ -53,14 +53,12 @@ export function useAttrsProvide(options: AttrsOptions) {
|
|
|
53
53
|
export function useAttrsInject() {
|
|
54
54
|
const attrs = inject<ComputedRef<AttrsOptions>>(
|
|
55
55
|
attrsProvideSymbol,
|
|
56
|
-
computed(() =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}),
|
|
63
|
-
),
|
|
56
|
+
computed(() => ({
|
|
57
|
+
colCount: ref(4),
|
|
58
|
+
errorLayout: ref('left-bottom'),
|
|
59
|
+
labelMode: ref('top'),
|
|
60
|
+
showColon: ref(true),
|
|
61
|
+
})),
|
|
64
62
|
);
|
|
65
63
|
return attrs;
|
|
66
64
|
}
|
package/src/interface/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef, Ref,
|
|
1
|
+
import { ComputedRef, Ref, VNode, Component, StyleValue, UnwrapNestedRefs } from 'vue';
|
|
2
2
|
import { FormItemAttrOptions } from '../hooks/attr/attr.FormItem';
|
|
3
3
|
import { LayoutFormItemProps } from './layout.formItem';
|
|
4
4
|
import { FormLayoutProps } from './layout';
|
|
@@ -14,7 +14,7 @@ export interface FormItemProps extends FormItemAttrOptions, LayoutFormItemProps
|
|
|
14
14
|
/**不进行样式渲染*/
|
|
15
15
|
noStyle?: boolean;
|
|
16
16
|
/**输入框组件*/
|
|
17
|
-
input?:
|
|
17
|
+
input?: Component | string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface FormProps<T = any> extends FormLayoutProps {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
<script lang="ts" setup>
|
|
49
49
|
import clx from 'classnames';
|
|
50
|
-
import { defineProps, withDefaults, toValue, computed, StyleValue
|
|
50
|
+
import { defineProps, withDefaults, toValue, computed, StyleValue } from "vue"
|
|
51
51
|
import type { LayoutFormItemProps } from "../interface/layout.formItem"
|
|
52
52
|
import { useAttrsInject } from "../hooks/useAttrs"
|
|
53
53
|
const preCls = 'carefrees-form-item';
|
package/esm/form/index.vue2.mjs
DELETED
package/lib/form/index.vue2.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const index_vue_vue_type_script_setup_true_lang = require("./index.vue.js");
|
|
4
|
-
exports.default = index_vue_vue_type_script_setup_true_lang.default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|