@qin-ui/antd-vue-pro 1.0.8 → 1.0.10
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/form/index.js +6 -3
- package/es/index.d.ts +8 -6
- package/package.json +1 -1
package/es/form/index.js
CHANGED
|
@@ -15735,7 +15735,7 @@ const INJECT_COMPONENT_PROPS_KEYS = {
|
|
|
15735
15735
|
const PROPS_KEYS = INJECT_COMPONENT_PROPS_KEYS;
|
|
15736
15736
|
const INIT_COMPONENT_PROPS_MAP = /* @__PURE__ */ new Map([
|
|
15737
15737
|
[PROPS_KEYS.input, { maxlength: 100, allowClear: true }],
|
|
15738
|
-
[PROPS_KEYS.textarea, { maxlength: 200,
|
|
15738
|
+
[PROPS_KEYS.textarea, { maxlength: 200, autoSize: { minRows: 3, maxRows: 6 }, showCount: true, allowClear: true }],
|
|
15739
15739
|
[PROPS_KEYS["input-password"], { maxlength: 100, allowClear: true }],
|
|
15740
15740
|
[PROPS_KEYS["input-number"], { max: 10 ** 15 - 1, min: -(10 ** 15 + 1), controls: false, allowClear: true }],
|
|
15741
15741
|
[PROPS_KEYS.select, { allowClear: true }],
|
|
@@ -15912,7 +15912,7 @@ const generateFieldMap = (fields, prePath = "", preFieldPath = "", fieldMap = {}
|
|
|
15912
15912
|
path = field.key || "";
|
|
15913
15913
|
}
|
|
15914
15914
|
const fieldPath = `${preFieldPath || ""}[${index2}]`;
|
|
15915
|
-
if (path) {
|
|
15915
|
+
if (path && !fieldMap[path]) {
|
|
15916
15916
|
fieldMap[path] = { field, fieldPath };
|
|
15917
15917
|
}
|
|
15918
15918
|
if (field.fields) {
|
|
@@ -16002,18 +16002,21 @@ const useFields = (initFields) => {
|
|
|
16002
16002
|
};
|
|
16003
16003
|
const useFormData = (initFormData) => {
|
|
16004
16004
|
const formData = ref(initFormData);
|
|
16005
|
+
const activePath = ref(null);
|
|
16005
16006
|
const getFormData = (path) => {
|
|
16006
16007
|
return get$1(formData.value, path);
|
|
16007
16008
|
};
|
|
16008
16009
|
const setFormData = (path, value) => {
|
|
16009
16010
|
let newValue = value;
|
|
16010
16011
|
if (path) {
|
|
16012
|
+
activePath.value = path;
|
|
16011
16013
|
if (typeof value === "function") {
|
|
16012
16014
|
const preValue = getFormData(path);
|
|
16013
16015
|
newValue = value(preValue);
|
|
16014
16016
|
}
|
|
16015
16017
|
set$1(formData.value, path, newValue);
|
|
16016
16018
|
} else {
|
|
16019
|
+
activePath.value = null;
|
|
16017
16020
|
if (typeof value === "function") {
|
|
16018
16021
|
const preValue = formData.value;
|
|
16019
16022
|
newValue = value(preValue);
|
|
@@ -16021,7 +16024,7 @@ const useFormData = (initFormData) => {
|
|
|
16021
16024
|
formData.value = newValue;
|
|
16022
16025
|
}
|
|
16023
16026
|
};
|
|
16024
|
-
return { formData, getFormData, setFormData };
|
|
16027
|
+
return { formData, getFormData, setFormData, activePath };
|
|
16025
16028
|
};
|
|
16026
16029
|
const useForm = (initFormData, initFields) => {
|
|
16027
16030
|
return {
|
package/es/index.d.ts
CHANGED
|
@@ -730,7 +730,7 @@ export declare type Grid = boolean | RowProps;
|
|
|
730
730
|
export declare const INIT_COMPONENT_PROPS_MAP: Map<symbol, {
|
|
731
731
|
maxlength: number;
|
|
732
732
|
allowClear: boolean;
|
|
733
|
-
|
|
733
|
+
autoSize?: undefined;
|
|
734
734
|
showCount?: undefined;
|
|
735
735
|
max?: undefined;
|
|
736
736
|
min?: undefined;
|
|
@@ -739,7 +739,7 @@ export declare const INIT_COMPONENT_PROPS_MAP: Map<symbol, {
|
|
|
739
739
|
valueFormat?: undefined;
|
|
740
740
|
} | {
|
|
741
741
|
maxlength: number;
|
|
742
|
-
|
|
742
|
+
autoSize: {
|
|
743
743
|
minRows: number;
|
|
744
744
|
maxRows: number;
|
|
745
745
|
};
|
|
@@ -756,14 +756,14 @@ export declare const INIT_COMPONENT_PROPS_MAP: Map<symbol, {
|
|
|
756
756
|
controls: boolean;
|
|
757
757
|
allowClear: boolean;
|
|
758
758
|
maxlength?: undefined;
|
|
759
|
-
|
|
759
|
+
autoSize?: undefined;
|
|
760
760
|
showCount?: undefined;
|
|
761
761
|
format?: undefined;
|
|
762
762
|
valueFormat?: undefined;
|
|
763
763
|
} | {
|
|
764
764
|
allowClear: boolean;
|
|
765
765
|
maxlength?: undefined;
|
|
766
|
-
|
|
766
|
+
autoSize?: undefined;
|
|
767
767
|
showCount?: undefined;
|
|
768
768
|
max?: undefined;
|
|
769
769
|
min?: undefined;
|
|
@@ -775,7 +775,7 @@ export declare const INIT_COMPONENT_PROPS_MAP: Map<symbol, {
|
|
|
775
775
|
valueFormat: string;
|
|
776
776
|
allowClear: boolean;
|
|
777
777
|
maxlength?: undefined;
|
|
778
|
-
|
|
778
|
+
autoSize?: undefined;
|
|
779
779
|
showCount?: undefined;
|
|
780
780
|
max?: undefined;
|
|
781
781
|
min?: undefined;
|
|
@@ -783,7 +783,7 @@ export declare const INIT_COMPONENT_PROPS_MAP: Map<symbol, {
|
|
|
783
783
|
} | {
|
|
784
784
|
maxlength?: undefined;
|
|
785
785
|
allowClear?: undefined;
|
|
786
|
-
|
|
786
|
+
autoSize?: undefined;
|
|
787
787
|
showCount?: undefined;
|
|
788
788
|
max?: undefined;
|
|
789
789
|
min?: undefined;
|
|
@@ -1845,6 +1845,8 @@ export declare type UseFormData = (initFormData: FormData_2) => {
|
|
|
1845
1845
|
getFormData: GetFormData;
|
|
1846
1846
|
/** 设置指定字段数据路径的值 */
|
|
1847
1847
|
setFormData: SetFormData;
|
|
1848
|
+
/** 当前正在编辑的字段path */
|
|
1849
|
+
activePath: Ref<string | null>;
|
|
1848
1850
|
};
|
|
1849
1851
|
|
|
1850
1852
|
export declare const useFormData: UseFormData;
|