@deot/vc 1.0.48 → 1.0.49
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/dist/index.d.ts +24 -0
- package/dist/index.iife.js +39 -39
- package/dist/index.umd.cjs +39 -39
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -3609,6 +3609,12 @@ export declare const Components: {
|
|
|
3609
3609
|
labelClass: (ObjectConstructor | StringConstructor)[];
|
|
3610
3610
|
errorStyle: (ObjectConstructor | StringConstructor)[];
|
|
3611
3611
|
errorClass: (ObjectConstructor | StringConstructor)[];
|
|
3612
|
+
nestedContentStyle: (ObjectConstructor | StringConstructor)[];
|
|
3613
|
+
nestedContentClass: (ObjectConstructor | StringConstructor)[];
|
|
3614
|
+
nestedLabelStyle: (ObjectConstructor | StringConstructor)[];
|
|
3615
|
+
nestedLabelClass: (ObjectConstructor | StringConstructor)[];
|
|
3616
|
+
nestedErrorStyle: (ObjectConstructor | StringConstructor)[];
|
|
3617
|
+
nestedErrorClass: (ObjectConstructor | StringConstructor)[];
|
|
3612
3618
|
}>, () => VNode<RendererNode, RendererElement, {
|
|
3613
3619
|
[key: string]: any;
|
|
3614
3620
|
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
@@ -3651,6 +3657,12 @@ export declare const Components: {
|
|
|
3651
3657
|
labelClass: (ObjectConstructor | StringConstructor)[];
|
|
3652
3658
|
errorStyle: (ObjectConstructor | StringConstructor)[];
|
|
3653
3659
|
errorClass: (ObjectConstructor | StringConstructor)[];
|
|
3660
|
+
nestedContentStyle: (ObjectConstructor | StringConstructor)[];
|
|
3661
|
+
nestedContentClass: (ObjectConstructor | StringConstructor)[];
|
|
3662
|
+
nestedLabelStyle: (ObjectConstructor | StringConstructor)[];
|
|
3663
|
+
nestedLabelClass: (ObjectConstructor | StringConstructor)[];
|
|
3664
|
+
nestedErrorStyle: (ObjectConstructor | StringConstructor)[];
|
|
3665
|
+
nestedErrorClass: (ObjectConstructor | StringConstructor)[];
|
|
3654
3666
|
}>> & Readonly<{}>, {
|
|
3655
3667
|
tag: string;
|
|
3656
3668
|
styleless: boolean;
|
|
@@ -3707,6 +3719,12 @@ export declare const Components: {
|
|
|
3707
3719
|
labelClass: (ObjectConstructor | StringConstructor)[];
|
|
3708
3720
|
errorStyle: (ObjectConstructor | StringConstructor)[];
|
|
3709
3721
|
errorClass: (ObjectConstructor | StringConstructor)[];
|
|
3722
|
+
nestedContentStyle: (ObjectConstructor | StringConstructor)[];
|
|
3723
|
+
nestedContentClass: (ObjectConstructor | StringConstructor)[];
|
|
3724
|
+
nestedLabelStyle: (ObjectConstructor | StringConstructor)[];
|
|
3725
|
+
nestedLabelClass: (ObjectConstructor | StringConstructor)[];
|
|
3726
|
+
nestedErrorStyle: (ObjectConstructor | StringConstructor)[];
|
|
3727
|
+
nestedErrorClass: (ObjectConstructor | StringConstructor)[];
|
|
3710
3728
|
}>, () => VNode<RendererNode, RendererElement, {
|
|
3711
3729
|
[key: string]: any;
|
|
3712
3730
|
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
@@ -3757,6 +3775,12 @@ export declare const Components: {
|
|
|
3757
3775
|
labelClass: (ObjectConstructor | StringConstructor)[];
|
|
3758
3776
|
errorStyle: (ObjectConstructor | StringConstructor)[];
|
|
3759
3777
|
errorClass: (ObjectConstructor | StringConstructor)[];
|
|
3778
|
+
nestedContentStyle: (ObjectConstructor | StringConstructor)[];
|
|
3779
|
+
nestedContentClass: (ObjectConstructor | StringConstructor)[];
|
|
3780
|
+
nestedLabelStyle: (ObjectConstructor | StringConstructor)[];
|
|
3781
|
+
nestedLabelClass: (ObjectConstructor | StringConstructor)[];
|
|
3782
|
+
nestedErrorStyle: (ObjectConstructor | StringConstructor)[];
|
|
3783
|
+
nestedErrorClass: (ObjectConstructor | StringConstructor)[];
|
|
3760
3784
|
}>> & Readonly<{}>, {
|
|
3761
3785
|
tag: string;
|
|
3762
3786
|
border: boolean;
|
package/dist/index.iife.js
CHANGED
|
@@ -19929,7 +19929,14 @@ var Vc = (function (exports, vue) {
|
|
|
19929
19929
|
labelStyle: [Object, String],
|
|
19930
19930
|
labelClass: [Object, String],
|
|
19931
19931
|
errorStyle: [Object, String],
|
|
19932
|
-
errorClass: [Object, String]
|
|
19932
|
+
errorClass: [Object, String],
|
|
19933
|
+
// 给nestFormItem统一注入
|
|
19934
|
+
nestedContentStyle: [Object, String],
|
|
19935
|
+
nestedContentClass: [Object, String],
|
|
19936
|
+
nestedLabelStyle: [Object, String],
|
|
19937
|
+
nestedLabelClass: [Object, String],
|
|
19938
|
+
nestedErrorStyle: [Object, String],
|
|
19939
|
+
nestedErrorClass: [Object, String]
|
|
19933
19940
|
};
|
|
19934
19941
|
const useForm = (expose, options = {}) => {
|
|
19935
19942
|
const instance = vue.getCurrentInstance();
|
|
@@ -20145,31 +20152,32 @@ var Vc = (function (exports, vue) {
|
|
|
20145
20152
|
});
|
|
20146
20153
|
const classes = vue.computed(() => {
|
|
20147
20154
|
return {
|
|
20148
|
-
"is-
|
|
20155
|
+
"is-required": isRequired.value && props2.asterisk,
|
|
20149
20156
|
"is-error": validateState.value === "error",
|
|
20150
20157
|
"is-validating": validateState.value === "validating",
|
|
20151
20158
|
"is-inline": form.props.inline,
|
|
20152
|
-
"is-
|
|
20159
|
+
"is-nested": isNested.value,
|
|
20153
20160
|
"is-alone": !props2.showMessage,
|
|
20154
20161
|
// 用于单独去除form-item的默认margin_bottom
|
|
20155
20162
|
[`is-${labelPosition.value}`]: true
|
|
20156
20163
|
};
|
|
20157
20164
|
});
|
|
20158
|
-
const
|
|
20165
|
+
const isNested = vue.computed(() => {
|
|
20159
20166
|
return !!formItem.change;
|
|
20160
20167
|
});
|
|
20161
|
-
const
|
|
20168
|
+
const isNestedLast = vue.ref(false);
|
|
20162
20169
|
const hasLabel = vue.computed(() => {
|
|
20163
20170
|
return !!props2.label || slots.label;
|
|
20164
20171
|
});
|
|
20165
20172
|
const labelStyle = vue.computed(() => {
|
|
20166
|
-
const labelWidth = props2.labelWidth === 0 || props2.labelWidth ? props2.labelWidth :
|
|
20173
|
+
const labelWidth = props2.labelWidth === 0 || props2.labelWidth ? props2.labelWidth : isNested.value ? 0 : form.props.labelWidth;
|
|
20167
20174
|
return [
|
|
20168
20175
|
{
|
|
20169
20176
|
width: labelPosition.value !== "top" && labelWidth && labelWidth > 0 ? `${labelWidth}px` : "auto",
|
|
20170
20177
|
textAlign: labelPosition.value === "top" ? "left" : labelPosition.value
|
|
20171
20178
|
},
|
|
20172
20179
|
form.props.labelStyle,
|
|
20180
|
+
isNested.value && form.props.nestedLabelStyle,
|
|
20173
20181
|
props2.labelStyle
|
|
20174
20182
|
];
|
|
20175
20183
|
});
|
|
@@ -20177,24 +20185,25 @@ var Vc = (function (exports, vue) {
|
|
|
20177
20185
|
const labelWidth = props2.labelWidth === 0 || props2.labelWidth ? props2.labelWidth : form.props.labelWidth;
|
|
20178
20186
|
return [
|
|
20179
20187
|
{
|
|
20180
|
-
marginLeft: !hasLabel.value &&
|
|
20181
|
-
marginBottom:
|
|
20188
|
+
marginLeft: labelPosition.value === "top" || !hasLabel.value && isNested.value ? 0 : labelWidth && labelWidth > 0 ? `${labelWidth}px` : "unset",
|
|
20189
|
+
marginBottom: isNested.value && !isNestedLast.value ? `20px` : 0
|
|
20182
20190
|
},
|
|
20183
20191
|
form.props.contentStyle,
|
|
20192
|
+
isNested.value && form.props.nestedContentStyle,
|
|
20184
20193
|
props2.contentStyle
|
|
20185
20194
|
];
|
|
20186
20195
|
});
|
|
20187
20196
|
const errorStyle = vue.computed(() => {
|
|
20188
|
-
return [form.props.errorStyle, props2.errorStyle];
|
|
20197
|
+
return [form.props.errorStyle, isNested.value && form.props.nestedErrorStyle, props2.errorStyle];
|
|
20189
20198
|
});
|
|
20190
20199
|
const labelClass = vue.computed(() => {
|
|
20191
|
-
return [form.props.labelClass, props2.labelClass];
|
|
20200
|
+
return [form.props.labelClass, isNested.value && form.props.nestedLabelClass, props2.labelClass];
|
|
20192
20201
|
});
|
|
20193
20202
|
const contentClass = vue.computed(() => {
|
|
20194
|
-
return [form.props.contentClass, props2.contentClass];
|
|
20203
|
+
return [form.props.contentClass, isNested.value && form.props.nestedContentClass, props2.contentClass];
|
|
20195
20204
|
});
|
|
20196
20205
|
const errorClass = vue.computed(() => {
|
|
20197
|
-
return [form.props.errorClass, props2.errorClass];
|
|
20206
|
+
return [form.props.errorClass, isNested.value && form.props.nestedErrorClass, props2.errorClass];
|
|
20198
20207
|
});
|
|
20199
20208
|
const isStyleless = vue.computed(() => {
|
|
20200
20209
|
return props2.styleless || form.props.styleless;
|
|
@@ -20331,7 +20340,7 @@ var Vc = (function (exports, vue) {
|
|
|
20331
20340
|
vue.watch(
|
|
20332
20341
|
() => formItem.fields?.length,
|
|
20333
20342
|
async (v) => {
|
|
20334
|
-
if (!
|
|
20343
|
+
if (!isNested.value || !v) return isNestedLast.value = false;
|
|
20335
20344
|
const fields$ = [...vue.toRaw(formItem.fields)];
|
|
20336
20345
|
const positions = await Promise.all(fields$.map((item) => item.exposed.getPosition()));
|
|
20337
20346
|
const sortFields = fields$.toSorted((a, b) => {
|
|
@@ -20342,7 +20351,7 @@ var Vc = (function (exports, vue) {
|
|
|
20342
20351
|
if (aPosition.top != bPosition.top) return aPosition.top - bPosition.top;
|
|
20343
20352
|
return aPosition.left - bPosition.left;
|
|
20344
20353
|
});
|
|
20345
|
-
|
|
20354
|
+
isNestedLast.value = sortFields[sortFields.length - 1] === instance;
|
|
20346
20355
|
}
|
|
20347
20356
|
);
|
|
20348
20357
|
expose({
|
|
@@ -20351,9 +20360,9 @@ var Vc = (function (exports, vue) {
|
|
|
20351
20360
|
getPosition
|
|
20352
20361
|
});
|
|
20353
20362
|
return {
|
|
20354
|
-
|
|
20363
|
+
isNested,
|
|
20355
20364
|
isStyleless,
|
|
20356
|
-
|
|
20365
|
+
isNestedLast,
|
|
20357
20366
|
validateMessage,
|
|
20358
20367
|
classes,
|
|
20359
20368
|
labelStyle,
|
|
@@ -20377,7 +20386,7 @@ var Vc = (function (exports, vue) {
|
|
|
20377
20386
|
const it = useFormItem(expose);
|
|
20378
20387
|
const {
|
|
20379
20388
|
isStyleless,
|
|
20380
|
-
|
|
20389
|
+
isNested,
|
|
20381
20390
|
classes,
|
|
20382
20391
|
labelStyle,
|
|
20383
20392
|
contentStyle,
|
|
@@ -20388,39 +20397,35 @@ var Vc = (function (exports, vue) {
|
|
|
20388
20397
|
showError,
|
|
20389
20398
|
validateMessage
|
|
20390
20399
|
} = it;
|
|
20391
|
-
const {
|
|
20392
|
-
label,
|
|
20393
|
-
labelFor
|
|
20394
|
-
} = props2;
|
|
20395
20400
|
const errorColorClass = "vc-form-item__error";
|
|
20396
20401
|
return () => {
|
|
20397
20402
|
if (isStyleless.value) return [slots.default?.(), slots.error?.({
|
|
20398
20403
|
show: showError.value,
|
|
20399
|
-
|
|
20404
|
+
nested: isNested.value,
|
|
20400
20405
|
message: validateMessage.value,
|
|
20401
20406
|
class: [errorColorClass, ...errorClass.value],
|
|
20402
20407
|
style: errorStyle.value
|
|
20403
20408
|
})];
|
|
20404
20409
|
return vue.createVNode("div", {
|
|
20405
20410
|
"class": ["vc-form-item", classes.value]
|
|
20406
|
-
}, [(label || slots.label) && vue.createVNode("div", {
|
|
20411
|
+
}, [(props2.label || slots.label) && vue.createVNode("div", {
|
|
20407
20412
|
"style": labelStyle.value,
|
|
20408
20413
|
"class": ["vc-form-item__label", ...labelClass.value],
|
|
20409
|
-
"for": labelFor
|
|
20410
|
-
}, [vue.createVNode("label", null, [label || slots.label?.()])]), vue.createVNode("div", {
|
|
20414
|
+
"for": props2.labelFor
|
|
20415
|
+
}, [vue.createVNode("label", null, [props2.label || slots.label?.()])]), vue.createVNode("div", {
|
|
20411
20416
|
"class": "vc-form-item__wrapper"
|
|
20412
20417
|
}, [vue.createVNode("div", {
|
|
20413
20418
|
"class": ["vc-form-item__content", ...contentClass.value],
|
|
20414
20419
|
"style": contentStyle.value
|
|
20415
20420
|
}, [slots.default?.(), slots.error ? slots.error({
|
|
20416
20421
|
show: showError.value,
|
|
20417
|
-
nest:
|
|
20422
|
+
nest: isNested.value,
|
|
20418
20423
|
message: validateMessage.value,
|
|
20419
20424
|
class: [errorColorClass, ...errorClass.value],
|
|
20420
20425
|
style: errorStyle.value
|
|
20421
20426
|
}) : vue.createVNode(TransitionFade, null, {
|
|
20422
20427
|
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
20423
|
-
"class": ["vc-form-item__tip",
|
|
20428
|
+
"class": ["vc-form-item__tip", isNested.value ? "is-nested" : "", errorColorClass, ...errorClass.value],
|
|
20424
20429
|
"style": [errorStyle.value]
|
|
20425
20430
|
}, [validateMessage.value]), [[vue.vShow, showError.value]])]
|
|
20426
20431
|
})])])]);
|
|
@@ -20485,41 +20490,36 @@ var Vc = (function (exports, vue) {
|
|
|
20485
20490
|
labelClass,
|
|
20486
20491
|
contentClass,
|
|
20487
20492
|
errorClass,
|
|
20488
|
-
|
|
20493
|
+
isNested,
|
|
20489
20494
|
showError,
|
|
20490
20495
|
validateMessage
|
|
20491
20496
|
} = it;
|
|
20492
|
-
const {
|
|
20493
|
-
label,
|
|
20494
|
-
labelFor,
|
|
20495
|
-
showMessage
|
|
20496
|
-
} = props2;
|
|
20497
20497
|
const errorColorClass = "vcm-form-item__error";
|
|
20498
20498
|
return () => {
|
|
20499
20499
|
if (isStyleless.value) return [slots.default?.(), slots.error?.({
|
|
20500
20500
|
show: showError.value,
|
|
20501
|
-
|
|
20501
|
+
nested: isNested.value,
|
|
20502
20502
|
message: validateMessage.value,
|
|
20503
20503
|
class: [errorColorClass, ...errorClass.value],
|
|
20504
20504
|
style: errorStyle.value
|
|
20505
20505
|
})];
|
|
20506
20506
|
return vue.createVNode("div", {
|
|
20507
20507
|
"style": {
|
|
20508
|
-
paddingLeft: `${
|
|
20508
|
+
paddingLeft: `${isNested.value ? 0 : props2.indent}px`
|
|
20509
20509
|
},
|
|
20510
20510
|
"class": [classes.value, "vcm-form-item"]
|
|
20511
20511
|
}, [vue.createVNode("div", {
|
|
20512
20512
|
"class": "vcm-form-item__wrapper"
|
|
20513
20513
|
}, [(props2.label || slots.label) && vue.createVNode("label", {
|
|
20514
|
-
"for": labelFor,
|
|
20514
|
+
"for": props2.labelFor,
|
|
20515
20515
|
"style": labelStyle.value,
|
|
20516
20516
|
"class": ["vcm-form-item__label", ...labelClass.value]
|
|
20517
|
-
}, [label || slots.label?.()]), vue.createVNode("div", {
|
|
20517
|
+
}, [props2.label || slots.label?.()]), vue.createVNode("div", {
|
|
20518
20518
|
"style": contentStyle.value,
|
|
20519
20519
|
"class": ["vcm-form-item__content", ...contentClass.value]
|
|
20520
|
-
}, [slots.default?.(), showMessage && showError.value && vue.createVNode("div", {
|
|
20520
|
+
}, [slots.default?.(), props2.showMessage && showError.value && vue.createVNode("div", {
|
|
20521
20521
|
"class": [{
|
|
20522
|
-
"is-
|
|
20522
|
+
"is-nested": isNested.value
|
|
20523
20523
|
}, errorColorClass, ...errorClass.value],
|
|
20524
20524
|
"style": errorStyle.value
|
|
20525
20525
|
}, [slots.error ? slots.error({
|
package/dist/index.umd.cjs
CHANGED
|
@@ -19932,7 +19932,14 @@
|
|
|
19932
19932
|
labelStyle: [Object, String],
|
|
19933
19933
|
labelClass: [Object, String],
|
|
19934
19934
|
errorStyle: [Object, String],
|
|
19935
|
-
errorClass: [Object, String]
|
|
19935
|
+
errorClass: [Object, String],
|
|
19936
|
+
// 给nestFormItem统一注入
|
|
19937
|
+
nestedContentStyle: [Object, String],
|
|
19938
|
+
nestedContentClass: [Object, String],
|
|
19939
|
+
nestedLabelStyle: [Object, String],
|
|
19940
|
+
nestedLabelClass: [Object, String],
|
|
19941
|
+
nestedErrorStyle: [Object, String],
|
|
19942
|
+
nestedErrorClass: [Object, String]
|
|
19936
19943
|
};
|
|
19937
19944
|
const useForm = (expose, options = {}) => {
|
|
19938
19945
|
const instance = vue.getCurrentInstance();
|
|
@@ -20148,31 +20155,32 @@
|
|
|
20148
20155
|
});
|
|
20149
20156
|
const classes = vue.computed(() => {
|
|
20150
20157
|
return {
|
|
20151
|
-
"is-
|
|
20158
|
+
"is-required": isRequired.value && props2.asterisk,
|
|
20152
20159
|
"is-error": validateState.value === "error",
|
|
20153
20160
|
"is-validating": validateState.value === "validating",
|
|
20154
20161
|
"is-inline": form.props.inline,
|
|
20155
|
-
"is-
|
|
20162
|
+
"is-nested": isNested.value,
|
|
20156
20163
|
"is-alone": !props2.showMessage,
|
|
20157
20164
|
// 用于单独去除form-item的默认margin_bottom
|
|
20158
20165
|
[`is-${labelPosition.value}`]: true
|
|
20159
20166
|
};
|
|
20160
20167
|
});
|
|
20161
|
-
const
|
|
20168
|
+
const isNested = vue.computed(() => {
|
|
20162
20169
|
return !!formItem.change;
|
|
20163
20170
|
});
|
|
20164
|
-
const
|
|
20171
|
+
const isNestedLast = vue.ref(false);
|
|
20165
20172
|
const hasLabel = vue.computed(() => {
|
|
20166
20173
|
return !!props2.label || slots.label;
|
|
20167
20174
|
});
|
|
20168
20175
|
const labelStyle = vue.computed(() => {
|
|
20169
|
-
const labelWidth = props2.labelWidth === 0 || props2.labelWidth ? props2.labelWidth :
|
|
20176
|
+
const labelWidth = props2.labelWidth === 0 || props2.labelWidth ? props2.labelWidth : isNested.value ? 0 : form.props.labelWidth;
|
|
20170
20177
|
return [
|
|
20171
20178
|
{
|
|
20172
20179
|
width: labelPosition.value !== "top" && labelWidth && labelWidth > 0 ? `${labelWidth}px` : "auto",
|
|
20173
20180
|
textAlign: labelPosition.value === "top" ? "left" : labelPosition.value
|
|
20174
20181
|
},
|
|
20175
20182
|
form.props.labelStyle,
|
|
20183
|
+
isNested.value && form.props.nestedLabelStyle,
|
|
20176
20184
|
props2.labelStyle
|
|
20177
20185
|
];
|
|
20178
20186
|
});
|
|
@@ -20180,24 +20188,25 @@
|
|
|
20180
20188
|
const labelWidth = props2.labelWidth === 0 || props2.labelWidth ? props2.labelWidth : form.props.labelWidth;
|
|
20181
20189
|
return [
|
|
20182
20190
|
{
|
|
20183
|
-
marginLeft: !hasLabel.value &&
|
|
20184
|
-
marginBottom:
|
|
20191
|
+
marginLeft: labelPosition.value === "top" || !hasLabel.value && isNested.value ? 0 : labelWidth && labelWidth > 0 ? `${labelWidth}px` : "unset",
|
|
20192
|
+
marginBottom: isNested.value && !isNestedLast.value ? `20px` : 0
|
|
20185
20193
|
},
|
|
20186
20194
|
form.props.contentStyle,
|
|
20195
|
+
isNested.value && form.props.nestedContentStyle,
|
|
20187
20196
|
props2.contentStyle
|
|
20188
20197
|
];
|
|
20189
20198
|
});
|
|
20190
20199
|
const errorStyle = vue.computed(() => {
|
|
20191
|
-
return [form.props.errorStyle, props2.errorStyle];
|
|
20200
|
+
return [form.props.errorStyle, isNested.value && form.props.nestedErrorStyle, props2.errorStyle];
|
|
20192
20201
|
});
|
|
20193
20202
|
const labelClass = vue.computed(() => {
|
|
20194
|
-
return [form.props.labelClass, props2.labelClass];
|
|
20203
|
+
return [form.props.labelClass, isNested.value && form.props.nestedLabelClass, props2.labelClass];
|
|
20195
20204
|
});
|
|
20196
20205
|
const contentClass = vue.computed(() => {
|
|
20197
|
-
return [form.props.contentClass, props2.contentClass];
|
|
20206
|
+
return [form.props.contentClass, isNested.value && form.props.nestedContentClass, props2.contentClass];
|
|
20198
20207
|
});
|
|
20199
20208
|
const errorClass = vue.computed(() => {
|
|
20200
|
-
return [form.props.errorClass, props2.errorClass];
|
|
20209
|
+
return [form.props.errorClass, isNested.value && form.props.nestedErrorClass, props2.errorClass];
|
|
20201
20210
|
});
|
|
20202
20211
|
const isStyleless = vue.computed(() => {
|
|
20203
20212
|
return props2.styleless || form.props.styleless;
|
|
@@ -20334,7 +20343,7 @@
|
|
|
20334
20343
|
vue.watch(
|
|
20335
20344
|
() => formItem.fields?.length,
|
|
20336
20345
|
async (v) => {
|
|
20337
|
-
if (!
|
|
20346
|
+
if (!isNested.value || !v) return isNestedLast.value = false;
|
|
20338
20347
|
const fields$ = [...vue.toRaw(formItem.fields)];
|
|
20339
20348
|
const positions = await Promise.all(fields$.map((item) => item.exposed.getPosition()));
|
|
20340
20349
|
const sortFields = fields$.toSorted((a, b) => {
|
|
@@ -20345,7 +20354,7 @@
|
|
|
20345
20354
|
if (aPosition.top != bPosition.top) return aPosition.top - bPosition.top;
|
|
20346
20355
|
return aPosition.left - bPosition.left;
|
|
20347
20356
|
});
|
|
20348
|
-
|
|
20357
|
+
isNestedLast.value = sortFields[sortFields.length - 1] === instance;
|
|
20349
20358
|
}
|
|
20350
20359
|
);
|
|
20351
20360
|
expose({
|
|
@@ -20354,9 +20363,9 @@
|
|
|
20354
20363
|
getPosition
|
|
20355
20364
|
});
|
|
20356
20365
|
return {
|
|
20357
|
-
|
|
20366
|
+
isNested,
|
|
20358
20367
|
isStyleless,
|
|
20359
|
-
|
|
20368
|
+
isNestedLast,
|
|
20360
20369
|
validateMessage,
|
|
20361
20370
|
classes,
|
|
20362
20371
|
labelStyle,
|
|
@@ -20380,7 +20389,7 @@
|
|
|
20380
20389
|
const it = useFormItem(expose);
|
|
20381
20390
|
const {
|
|
20382
20391
|
isStyleless,
|
|
20383
|
-
|
|
20392
|
+
isNested,
|
|
20384
20393
|
classes,
|
|
20385
20394
|
labelStyle,
|
|
20386
20395
|
contentStyle,
|
|
@@ -20391,39 +20400,35 @@
|
|
|
20391
20400
|
showError,
|
|
20392
20401
|
validateMessage
|
|
20393
20402
|
} = it;
|
|
20394
|
-
const {
|
|
20395
|
-
label,
|
|
20396
|
-
labelFor
|
|
20397
|
-
} = props2;
|
|
20398
20403
|
const errorColorClass = "vc-form-item__error";
|
|
20399
20404
|
return () => {
|
|
20400
20405
|
if (isStyleless.value) return [slots.default?.(), slots.error?.({
|
|
20401
20406
|
show: showError.value,
|
|
20402
|
-
|
|
20407
|
+
nested: isNested.value,
|
|
20403
20408
|
message: validateMessage.value,
|
|
20404
20409
|
class: [errorColorClass, ...errorClass.value],
|
|
20405
20410
|
style: errorStyle.value
|
|
20406
20411
|
})];
|
|
20407
20412
|
return vue.createVNode("div", {
|
|
20408
20413
|
"class": ["vc-form-item", classes.value]
|
|
20409
|
-
}, [(label || slots.label) && vue.createVNode("div", {
|
|
20414
|
+
}, [(props2.label || slots.label) && vue.createVNode("div", {
|
|
20410
20415
|
"style": labelStyle.value,
|
|
20411
20416
|
"class": ["vc-form-item__label", ...labelClass.value],
|
|
20412
|
-
"for": labelFor
|
|
20413
|
-
}, [vue.createVNode("label", null, [label || slots.label?.()])]), vue.createVNode("div", {
|
|
20417
|
+
"for": props2.labelFor
|
|
20418
|
+
}, [vue.createVNode("label", null, [props2.label || slots.label?.()])]), vue.createVNode("div", {
|
|
20414
20419
|
"class": "vc-form-item__wrapper"
|
|
20415
20420
|
}, [vue.createVNode("div", {
|
|
20416
20421
|
"class": ["vc-form-item__content", ...contentClass.value],
|
|
20417
20422
|
"style": contentStyle.value
|
|
20418
20423
|
}, [slots.default?.(), slots.error ? slots.error({
|
|
20419
20424
|
show: showError.value,
|
|
20420
|
-
nest:
|
|
20425
|
+
nest: isNested.value,
|
|
20421
20426
|
message: validateMessage.value,
|
|
20422
20427
|
class: [errorColorClass, ...errorClass.value],
|
|
20423
20428
|
style: errorStyle.value
|
|
20424
20429
|
}) : vue.createVNode(TransitionFade, null, {
|
|
20425
20430
|
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
20426
|
-
"class": ["vc-form-item__tip",
|
|
20431
|
+
"class": ["vc-form-item__tip", isNested.value ? "is-nested" : "", errorColorClass, ...errorClass.value],
|
|
20427
20432
|
"style": [errorStyle.value]
|
|
20428
20433
|
}, [validateMessage.value]), [[vue.vShow, showError.value]])]
|
|
20429
20434
|
})])])]);
|
|
@@ -20488,41 +20493,36 @@
|
|
|
20488
20493
|
labelClass,
|
|
20489
20494
|
contentClass,
|
|
20490
20495
|
errorClass,
|
|
20491
|
-
|
|
20496
|
+
isNested,
|
|
20492
20497
|
showError,
|
|
20493
20498
|
validateMessage
|
|
20494
20499
|
} = it;
|
|
20495
|
-
const {
|
|
20496
|
-
label,
|
|
20497
|
-
labelFor,
|
|
20498
|
-
showMessage
|
|
20499
|
-
} = props2;
|
|
20500
20500
|
const errorColorClass = "vcm-form-item__error";
|
|
20501
20501
|
return () => {
|
|
20502
20502
|
if (isStyleless.value) return [slots.default?.(), slots.error?.({
|
|
20503
20503
|
show: showError.value,
|
|
20504
|
-
|
|
20504
|
+
nested: isNested.value,
|
|
20505
20505
|
message: validateMessage.value,
|
|
20506
20506
|
class: [errorColorClass, ...errorClass.value],
|
|
20507
20507
|
style: errorStyle.value
|
|
20508
20508
|
})];
|
|
20509
20509
|
return vue.createVNode("div", {
|
|
20510
20510
|
"style": {
|
|
20511
|
-
paddingLeft: `${
|
|
20511
|
+
paddingLeft: `${isNested.value ? 0 : props2.indent}px`
|
|
20512
20512
|
},
|
|
20513
20513
|
"class": [classes.value, "vcm-form-item"]
|
|
20514
20514
|
}, [vue.createVNode("div", {
|
|
20515
20515
|
"class": "vcm-form-item__wrapper"
|
|
20516
20516
|
}, [(props2.label || slots.label) && vue.createVNode("label", {
|
|
20517
|
-
"for": labelFor,
|
|
20517
|
+
"for": props2.labelFor,
|
|
20518
20518
|
"style": labelStyle.value,
|
|
20519
20519
|
"class": ["vcm-form-item__label", ...labelClass.value]
|
|
20520
|
-
}, [label || slots.label?.()]), vue.createVNode("div", {
|
|
20520
|
+
}, [props2.label || slots.label?.()]), vue.createVNode("div", {
|
|
20521
20521
|
"style": contentStyle.value,
|
|
20522
20522
|
"class": ["vcm-form-item__content", ...contentClass.value]
|
|
20523
|
-
}, [slots.default?.(), showMessage && showError.value && vue.createVNode("div", {
|
|
20523
|
+
}, [slots.default?.(), props2.showMessage && showError.value && vue.createVNode("div", {
|
|
20524
20524
|
"class": [{
|
|
20525
|
-
"is-
|
|
20525
|
+
"is-nested": isNested.value
|
|
20526
20526
|
}, errorColorClass, ...errorClass.value],
|
|
20527
20527
|
"style": errorStyle.value
|
|
20528
20528
|
}, [slots.error ? slots.error({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deot/vc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@deot/vc-components": "^1.0.
|
|
23
|
-
"@deot/vc-hooks": "^1.0.
|
|
24
|
-
"@deot/vc-shared": "^1.0.
|
|
22
|
+
"@deot/vc-components": "^1.0.49",
|
|
23
|
+
"@deot/vc-hooks": "^1.0.49",
|
|
24
|
+
"@deot/vc-shared": "^1.0.49"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"vue": "*"
|