pro-design-vue 1.0.0-rc.1 → 1.0.0-rc.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/dist/index.full.js +325 -137
- package/dist/index.full.min.js +8 -8
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +326 -138
- package/es/components/counter/src/counter.vue.d.ts +2 -4
- package/es/components/counter/src/counter.vue2.mjs +2 -4
- package/es/components/counter/src/counter.vue2.mjs.map +1 -1
- package/es/components/form/src/base/BaseForm.mjs +19 -12
- package/es/components/form/src/base/BaseForm.mjs.map +1 -1
- package/es/components/form/src/components/FormColWrapper.d.ts +9 -0
- package/es/components/form/src/components/FormColWrapper.mjs +9 -1
- package/es/components/form/src/components/FormColWrapper.mjs.map +1 -1
- package/es/components/form/src/components/FormGroup.d.ts +12 -12
- package/es/components/form/src/components/FormGroup.mjs.map +1 -1
- package/es/components/form/src/components/FormItem.d.ts +9 -0
- package/es/components/form/src/components/FormItem.mjs +13 -3
- package/es/components/form/src/components/FormItem.mjs.map +1 -1
- package/es/components/form/src/components/FormItems.mjs +2 -1
- package/es/components/form/src/components/FormItems.mjs.map +1 -1
- package/es/components/form/src/components/FormList.d.ts +12 -12
- package/es/components/form/src/components/FormListContainer.d.ts +12 -12
- package/es/components/form/src/components/FormListItem.d.ts +12 -12
- package/es/components/form/src/components/FormRowWrapper.d.ts +12 -12
- package/es/components/form/src/components/FormSet.d.ts +12 -12
- package/es/components/form/src/hooks/useAction.d.ts +5 -2
- package/es/components/form/src/hooks/useAction.mjs +137 -12
- package/es/components/form/src/hooks/useAction.mjs.map +1 -1
- package/es/components/form/src/hooks/useFieldValue.d.ts +1 -1
- package/es/components/form/src/hooks/useFieldValue.mjs +11 -15
- package/es/components/form/src/hooks/useFieldValue.mjs.map +1 -1
- package/es/components/form/src/layouts/DrawerForm.mjs +8 -12
- package/es/components/form/src/layouts/DrawerForm.mjs.map +1 -1
- package/es/components/form/src/layouts/ModalForm.mjs +8 -12
- package/es/components/form/src/layouts/ModalForm.mjs.map +1 -1
- package/es/components/form/src/layouts/QueryFilter.mjs +2 -2
- package/es/components/form/src/layouts/QueryFilter.mjs.map +1 -1
- package/es/components/form/src/layouts/StepsForm.mjs +5 -1
- package/es/components/form/src/layouts/StepsForm.mjs.map +1 -1
- package/es/components/form/src/type.d.ts +11 -7
- package/es/components/form/src/utils/transformer.d.ts +3 -0
- package/es/components/form/src/utils/transformer.mjs +24 -0
- package/es/components/form/src/utils/transformer.mjs.map +1 -0
- package/es/components/layout/src/components/layout-sidebar.vue.d.ts +5 -0
- package/es/components/layout/src/components/layout-sidebar.vue2.mjs +4 -3
- package/es/components/layout/src/components/layout-sidebar.vue2.mjs.map +1 -1
- package/es/components/layout/src/layout.vue.d.ts +1 -0
- package/es/components/layout/src/layout.vue2.mjs +3 -1
- package/es/components/layout/src/layout.vue2.mjs.map +1 -1
- package/es/components/layout/src/typing.d.ts +5 -0
- package/es/components/table/src/components/Body/Body.vue.d.ts +1 -0
- package/es/components/table/src/components/Body/Body.vue.mjs +14 -18
- package/es/components/table/src/components/Body/Body.vue.mjs.map +1 -1
- package/es/components/table/src/components/Body/Body.vue2.mjs +11 -2
- package/es/components/table/src/components/Body/Body.vue2.mjs.map +1 -1
- package/es/components/table/src/components/Body/BodyCell.mjs +10 -1
- package/es/components/table/src/components/Body/BodyCell.mjs.map +1 -1
- package/es/components/table/src/components/Form/Form.d.ts +10 -7
- package/es/components/table/src/components/Form/Form.mjs +8 -40
- package/es/components/table/src/components/Form/Form.mjs.map +1 -1
- package/es/components/table/src/components/InteralTable.vue.d.ts +1 -0
- package/es/components/table/src/components/InteralTable.vue.mjs.map +1 -1
- package/es/components/table/src/components/InteralTable.vue2.mjs +3 -0
- package/es/components/table/src/components/InteralTable.vue2.mjs.map +1 -1
- package/es/components/table/src/components/Table.mjs +29 -4
- package/es/components/table/src/components/Table.mjs.map +1 -1
- package/es/components/table/src/components/interface.d.ts +1 -0
- package/es/components/table/src/components/interface.mjs.map +1 -1
- package/es/components/table/src/utils/flatColumnsHandle.d.ts +2 -0
- package/es/components/table/src/utils/flatColumnsHandle.mjs +18 -0
- package/es/components/table/src/utils/flatColumnsHandle.mjs.map +1 -0
- package/es/index.d.ts +20 -11
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/counter/src/counter.vue.d.ts +2 -4
- package/lib/components/counter/src/counter.vue2.js +2 -4
- package/lib/components/counter/src/counter.vue2.js.map +1 -1
- package/lib/components/form/src/base/BaseForm.js +17 -10
- package/lib/components/form/src/base/BaseForm.js.map +1 -1
- package/lib/components/form/src/components/FormColWrapper.d.ts +9 -0
- package/lib/components/form/src/components/FormColWrapper.js +9 -1
- package/lib/components/form/src/components/FormColWrapper.js.map +1 -1
- package/lib/components/form/src/components/FormGroup.d.ts +12 -12
- package/lib/components/form/src/components/FormGroup.js.map +1 -1
- package/lib/components/form/src/components/FormItem.d.ts +9 -0
- package/lib/components/form/src/components/FormItem.js +13 -3
- package/lib/components/form/src/components/FormItem.js.map +1 -1
- package/lib/components/form/src/components/FormItems.js +2 -1
- package/lib/components/form/src/components/FormItems.js.map +1 -1
- package/lib/components/form/src/components/FormList.d.ts +12 -12
- package/lib/components/form/src/components/FormListContainer.d.ts +12 -12
- package/lib/components/form/src/components/FormListItem.d.ts +12 -12
- package/lib/components/form/src/components/FormRowWrapper.d.ts +12 -12
- package/lib/components/form/src/components/FormSet.d.ts +12 -12
- package/lib/components/form/src/hooks/useAction.d.ts +5 -2
- package/lib/components/form/src/hooks/useAction.js +137 -10
- package/lib/components/form/src/hooks/useAction.js.map +1 -1
- package/lib/components/form/src/hooks/useFieldValue.d.ts +1 -1
- package/lib/components/form/src/hooks/useFieldValue.js +11 -15
- package/lib/components/form/src/hooks/useFieldValue.js.map +1 -1
- package/lib/components/form/src/layouts/DrawerForm.js +8 -12
- package/lib/components/form/src/layouts/DrawerForm.js.map +1 -1
- package/lib/components/form/src/layouts/ModalForm.js +8 -12
- package/lib/components/form/src/layouts/ModalForm.js.map +1 -1
- package/lib/components/form/src/layouts/QueryFilter.js +2 -2
- package/lib/components/form/src/layouts/QueryFilter.js.map +1 -1
- package/lib/components/form/src/layouts/StepsForm.js +5 -1
- package/lib/components/form/src/layouts/StepsForm.js.map +1 -1
- package/lib/components/form/src/type.d.ts +11 -7
- package/lib/components/form/src/utils/transformer.d.ts +3 -0
- package/lib/components/form/src/utils/transformer.js +28 -0
- package/lib/components/form/src/utils/transformer.js.map +1 -0
- package/lib/components/layout/src/components/layout-sidebar.vue.d.ts +5 -0
- package/lib/components/layout/src/components/layout-sidebar.vue2.js +4 -3
- package/lib/components/layout/src/components/layout-sidebar.vue2.js.map +1 -1
- package/lib/components/layout/src/layout.vue.d.ts +1 -0
- package/lib/components/layout/src/layout.vue2.js +3 -1
- package/lib/components/layout/src/layout.vue2.js.map +1 -1
- package/lib/components/layout/src/typing.d.ts +5 -0
- package/lib/components/table/src/components/Body/Body.vue.d.ts +1 -0
- package/lib/components/table/src/components/Body/Body.vue.js +13 -17
- package/lib/components/table/src/components/Body/Body.vue.js.map +1 -1
- package/lib/components/table/src/components/Body/Body.vue2.js +11 -2
- package/lib/components/table/src/components/Body/Body.vue2.js.map +1 -1
- package/lib/components/table/src/components/Body/BodyCell.js +9 -0
- package/lib/components/table/src/components/Body/BodyCell.js.map +1 -1
- package/lib/components/table/src/components/Form/Form.d.ts +10 -7
- package/lib/components/table/src/components/Form/Form.js +8 -40
- package/lib/components/table/src/components/Form/Form.js.map +1 -1
- package/lib/components/table/src/components/InteralTable.vue.d.ts +1 -0
- package/lib/components/table/src/components/InteralTable.vue.js.map +1 -1
- package/lib/components/table/src/components/InteralTable.vue2.js +3 -0
- package/lib/components/table/src/components/InteralTable.vue2.js.map +1 -1
- package/lib/components/table/src/components/Table.js +29 -4
- package/lib/components/table/src/components/Table.js.map +1 -1
- package/lib/components/table/src/components/interface.d.ts +1 -0
- package/lib/components/table/src/components/interface.js.map +1 -1
- package/lib/components/table/src/utils/flatColumnsHandle.d.ts +2 -0
- package/lib/components/table/src/utils/flatColumnsHandle.js +20 -0
- package/lib/components/table/src/utils/flatColumnsHandle.js.map +1 -0
- package/lib/index.d.ts +20 -11
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/theme-chalk/src/index.less +1 -1
- package/theme-chalk/pro-table.css +0 -1
- package/theme-chalk/src/table.less +0 -1
package/dist/index.full.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Pro Design Vue v1.0.0-rc.
|
1
|
+
/*! Pro Design Vue v1.0.0-rc.10 */
|
2
2
|
|
3
3
|
(function (global, factory) {
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('ant-design-vue'), require('vue')) :
|
@@ -16,7 +16,7 @@
|
|
16
16
|
const SCROLL_FIXED_CLASS = `_scroll__fixed_`;
|
17
17
|
const DEFAULT_NAMESPACE = "pro";
|
18
18
|
|
19
|
-
const version$1 = "1.0.0-rc.
|
19
|
+
const version$1 = "1.0.0-rc.10";
|
20
20
|
|
21
21
|
const makeInstaller = (components = []) => {
|
22
22
|
const install = (app) => {
|
@@ -8815,7 +8815,7 @@
|
|
8815
8815
|
transition: { type: null, required: false, default: "linear" },
|
8816
8816
|
useEasing: { type: Boolean, required: false, default: true }
|
8817
8817
|
},
|
8818
|
-
emits: ["finished", "
|
8818
|
+
emits: ["finished", "started"],
|
8819
8819
|
setup(__props, { expose: __expose, emit: __emit }) {
|
8820
8820
|
const props = __props;
|
8821
8821
|
const emit = __emit;
|
@@ -8848,11 +8848,9 @@
|
|
8848
8848
|
duration: props.duration,
|
8849
8849
|
onFinished: () => {
|
8850
8850
|
emit("finished");
|
8851
|
-
emit("onFinished");
|
8852
8851
|
},
|
8853
8852
|
onStarted: () => {
|
8854
8853
|
emit("started");
|
8855
|
-
emit("onStarted");
|
8856
8854
|
},
|
8857
8855
|
...props.useEasing ? { transition: TransitionPresets[props.transition] } : {}
|
8858
8856
|
});
|
@@ -8875,7 +8873,7 @@
|
|
8875
8873
|
}
|
8876
8874
|
return prefix + x1 + x2 + suffix;
|
8877
8875
|
}
|
8878
|
-
__expose({ reset });
|
8876
|
+
__expose({ start, reset });
|
8879
8877
|
return (_ctx, _cache) => {
|
8880
8878
|
return vue.openBlock(), vue.createElementBlock(
|
8881
8879
|
"span",
|
@@ -15756,10 +15754,133 @@
|
|
15756
15754
|
return isString$1(namePath) ? namePath.indexOf(".") > -1 ? namePath.split(".") : [namePath] : namePath;
|
15757
15755
|
};
|
15758
15756
|
|
15759
|
-
|
15760
|
-
|
15761
|
-
|
15762
|
-
return
|
15757
|
+
function isPlainObj(itemValue) {
|
15758
|
+
if (typeof itemValue !== "object") return false;
|
15759
|
+
if (itemValue === null) return true;
|
15760
|
+
if (isValidElement$1(itemValue)) return false;
|
15761
|
+
if (itemValue.constructor === RegExp) return false;
|
15762
|
+
if (itemValue instanceof Map) return false;
|
15763
|
+
if (itemValue instanceof Set) return false;
|
15764
|
+
if (itemValue instanceof HTMLElement) return false;
|
15765
|
+
if (itemValue instanceof Blob) return false;
|
15766
|
+
if (itemValue instanceof File) return false;
|
15767
|
+
if (Array.isArray(itemValue)) return false;
|
15768
|
+
return true;
|
15769
|
+
}
|
15770
|
+
const transformKeySubmitValue = (values, transformerMap, paramsOmitNil) => {
|
15771
|
+
if (Object.keys(values).length < 1) {
|
15772
|
+
return values;
|
15773
|
+
}
|
15774
|
+
if (typeof window === "undefined") return values;
|
15775
|
+
if (typeof values !== "object" || isNil(values) || values instanceof Blob) {
|
15776
|
+
return values;
|
15777
|
+
}
|
15778
|
+
let finalValues = Array.isArray(values) ? [] : {};
|
15779
|
+
const gen = (tempValues, parentsKey) => {
|
15780
|
+
const isArrayValues = Array.isArray(tempValues);
|
15781
|
+
let result = isArrayValues ? [] : {};
|
15782
|
+
if (tempValues == null || tempValues === void 0) {
|
15783
|
+
return result;
|
15784
|
+
}
|
15785
|
+
Object.keys(tempValues).forEach((entityKey) => {
|
15786
|
+
var _a;
|
15787
|
+
const transformForArray = (transformList, subItemValue) => {
|
15788
|
+
if (!Array.isArray(transformList)) return entityKey;
|
15789
|
+
transformList.forEach((transform2, idx) => {
|
15790
|
+
if (!transform2) return;
|
15791
|
+
const subTransformItem = subItemValue == null ? void 0 : subItemValue[idx];
|
15792
|
+
if (typeof transform2 === "function") {
|
15793
|
+
subItemValue[idx] = transform2(subItemValue, entityKey, tempValues);
|
15794
|
+
}
|
15795
|
+
if (typeof transform2 === "object" && !Array.isArray(transform2)) {
|
15796
|
+
Object.keys(transform2).forEach((transformArrayItem) => {
|
15797
|
+
const subTransformItemValue = subTransformItem == null ? void 0 : subTransformItem[transformArrayItem];
|
15798
|
+
if (typeof transform2[transformArrayItem] === "function" && subTransformItemValue) {
|
15799
|
+
const res = transform2[transformArrayItem](
|
15800
|
+
subTransformItem[transformArrayItem],
|
15801
|
+
entityKey,
|
15802
|
+
tempValues
|
15803
|
+
);
|
15804
|
+
subTransformItem[transformArrayItem] = typeof res === "object" ? res[transformArrayItem] : res;
|
15805
|
+
} else if (typeof transform2[transformArrayItem] === "object" && Array.isArray(transform2[transformArrayItem]) && subTransformItemValue) {
|
15806
|
+
transformForArray(transform2[transformArrayItem], subTransformItemValue);
|
15807
|
+
}
|
15808
|
+
});
|
15809
|
+
}
|
15810
|
+
if (typeof transform2 === "object" && Array.isArray(transform2) && subTransformItem) {
|
15811
|
+
transformForArray(transform2, subTransformItem);
|
15812
|
+
}
|
15813
|
+
});
|
15814
|
+
return entityKey;
|
15815
|
+
};
|
15816
|
+
const itemValue = tempValues[entityKey];
|
15817
|
+
const transformFunction = (_a = transformerMap.get(entityKey)) == null ? void 0 : _a.transform;
|
15818
|
+
const transform = () => {
|
15819
|
+
let tempKey, transformedResult, isTransformedResultPrimitive = false;
|
15820
|
+
if (typeof transformFunction === "function") {
|
15821
|
+
transformedResult = transformFunction == null ? void 0 : transformFunction(itemValue, entityKey, tempValues);
|
15822
|
+
const typeOfResult = typeof transformedResult;
|
15823
|
+
if (typeOfResult !== "object" && typeOfResult !== "undefined") {
|
15824
|
+
tempKey = entityKey;
|
15825
|
+
isTransformedResultPrimitive = true;
|
15826
|
+
} else {
|
15827
|
+
tempKey = transformedResult;
|
15828
|
+
}
|
15829
|
+
} else {
|
15830
|
+
tempKey = transformForArray(transformFunction, itemValue);
|
15831
|
+
}
|
15832
|
+
if (Array.isArray(tempKey)) {
|
15833
|
+
result = set(result, tempKey, itemValue);
|
15834
|
+
return;
|
15835
|
+
}
|
15836
|
+
if (typeof tempKey === "object" && !Array.isArray(finalValues)) {
|
15837
|
+
finalValues = merge(finalValues, tempKey);
|
15838
|
+
} else if (typeof tempKey === "object" && Array.isArray(finalValues)) {
|
15839
|
+
result = { ...result, ...tempKey };
|
15840
|
+
} else if (tempKey !== null || tempKey !== void 0) {
|
15841
|
+
result = set(
|
15842
|
+
result,
|
15843
|
+
[tempKey],
|
15844
|
+
isTransformedResultPrimitive ? transformedResult : itemValue
|
15845
|
+
);
|
15846
|
+
}
|
15847
|
+
};
|
15848
|
+
if (transformFunction && typeof transformFunction === "function") {
|
15849
|
+
transform();
|
15850
|
+
}
|
15851
|
+
if (typeof window === "undefined") return;
|
15852
|
+
if (isPlainObj(itemValue)) {
|
15853
|
+
const genValues = gen(itemValue);
|
15854
|
+
if (Object.keys(genValues).length < 1) {
|
15855
|
+
return;
|
15856
|
+
}
|
15857
|
+
result = set(result, [entityKey], genValues);
|
15858
|
+
return;
|
15859
|
+
}
|
15860
|
+
transform();
|
15861
|
+
});
|
15862
|
+
return paramsOmitNil ? result : tempValues;
|
15863
|
+
};
|
15864
|
+
finalValues = Array.isArray(values) && Array.isArray(finalValues) ? [...gen(values)] : merge({}, gen(values), finalValues);
|
15865
|
+
return finalValues;
|
15866
|
+
};
|
15867
|
+
const convertKeyInitialValue = (values, transformerMap) => {
|
15868
|
+
if (Object.keys(values).length < 1) {
|
15869
|
+
return values;
|
15870
|
+
}
|
15871
|
+
const finalValues = {};
|
15872
|
+
Object.keys(values).forEach((entityKey) => {
|
15873
|
+
var _a;
|
15874
|
+
const itemValue = values[entityKey];
|
15875
|
+
const convertValueFunction = (_a = transformerMap.get(entityKey)) == null ? void 0 : _a.convertValue;
|
15876
|
+
if (typeof convertValueFunction === "function") {
|
15877
|
+
const convertResult = convertValueFunction == null ? void 0 : convertValueFunction(itemValue, entityKey);
|
15878
|
+
finalValues[entityKey] = convertResult;
|
15879
|
+
} else {
|
15880
|
+
finalValues[entityKey] = itemValue;
|
15881
|
+
}
|
15882
|
+
});
|
15883
|
+
return finalValues;
|
15763
15884
|
};
|
15764
15885
|
function useAction({
|
15765
15886
|
props,
|
@@ -15767,6 +15888,7 @@
|
|
15767
15888
|
formData,
|
15768
15889
|
initialValues,
|
15769
15890
|
hasInitial,
|
15891
|
+
transformerMap,
|
15770
15892
|
onFinish,
|
15771
15893
|
onReset,
|
15772
15894
|
onFinishFailed
|
@@ -15795,20 +15917,20 @@
|
|
15795
15917
|
if (!namePath) throw new Error("name is require");
|
15796
15918
|
const value = get(formData.value, namePath);
|
15797
15919
|
const obj = set({}, namePath, value);
|
15798
|
-
return get(
|
15920
|
+
return get(transformKeySubmitValue(obj, transformerMap.value, props.omitNil), namePath);
|
15799
15921
|
};
|
15800
15922
|
const getFieldFormatValueObject = (name) => {
|
15801
15923
|
const namePath = covertFormName(name);
|
15802
15924
|
if (!namePath) throw new Error("name is require");
|
15803
15925
|
const value = get(formData.value, namePath);
|
15804
15926
|
const obj = set({}, namePath, value);
|
15805
|
-
return
|
15927
|
+
return transformKeySubmitValue(obj, transformerMap.value, props.omitNil);
|
15806
15928
|
};
|
15807
15929
|
const validateFieldsReturnFormatValue = async (nameList) => {
|
15808
15930
|
var _a;
|
15809
15931
|
if (!Array.isArray(nameList) && nameList) throw new Error("nameList must be array");
|
15810
15932
|
const values = await ((_a = formRef.value) == null ? void 0 : _a.validateFields(nameList));
|
15811
|
-
const transformedKey =
|
15933
|
+
const transformedKey = transformKeySubmitValue(values, transformerMap.value, props.omitNil);
|
15812
15934
|
return transformedKey != null ? transformedKey : {};
|
15813
15935
|
};
|
15814
15936
|
const setFieldValue = (name, value) => {
|
@@ -15834,10 +15956,10 @@
|
|
15834
15956
|
var _a;
|
15835
15957
|
hasInitial.value = true;
|
15836
15958
|
(_a = formRef.value) == null ? void 0 : _a.clearValidate();
|
15837
|
-
formData.value = cloneDeep(initialValues.value);
|
15959
|
+
formData.value = cloneDeep(convertKeyInitialValue(initialValues.value, transformerMap.value));
|
15838
15960
|
Promise.resolve().then(() => {
|
15839
15961
|
hasInitial.value = false;
|
15840
|
-
onReset == null ? void 0 : onReset(formData.value);
|
15962
|
+
onReset == null ? void 0 : onReset(transformKeySubmitValue(formData.value, transformerMap.value, props.omitNil));
|
15841
15963
|
});
|
15842
15964
|
};
|
15843
15965
|
const resetField = (name) => {
|
@@ -16047,7 +16169,8 @@
|
|
16047
16169
|
}
|
16048
16170
|
return vue.createVNode(FormItem$2, {
|
16049
16171
|
"key": item.key,
|
16050
|
-
"item": item
|
16172
|
+
"item": item,
|
16173
|
+
"grid": mergeGrid.value
|
16051
16174
|
}, null);
|
16052
16175
|
});
|
16053
16176
|
});
|
@@ -16201,6 +16324,26 @@
|
|
16201
16324
|
}
|
16202
16325
|
});
|
16203
16326
|
|
16327
|
+
function transformer(items) {
|
16328
|
+
const transformerMap = /* @__PURE__ */ new Map();
|
16329
|
+
const handler = (items2) => {
|
16330
|
+
items2.forEach((item) => {
|
16331
|
+
var _a;
|
16332
|
+
if (item.name && (item.transform || item.convertValue)) {
|
16333
|
+
transformerMap.set(item.name, {
|
16334
|
+
transform: item.transform,
|
16335
|
+
convertValue: item.convertValue
|
16336
|
+
});
|
16337
|
+
} else if (item.children) {
|
16338
|
+
const children = (_a = runFunction(item.children)) != null ? _a : [];
|
16339
|
+
handler(children);
|
16340
|
+
}
|
16341
|
+
});
|
16342
|
+
};
|
16343
|
+
handler(items);
|
16344
|
+
return transformerMap;
|
16345
|
+
}
|
16346
|
+
|
16204
16347
|
function _isSlot$5(s) {
|
16205
16348
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
16206
16349
|
}
|
@@ -16217,6 +16360,7 @@
|
|
16217
16360
|
attrs
|
16218
16361
|
}) {
|
16219
16362
|
const mountedRef = vue.ref(false);
|
16363
|
+
const transformerMap = vue.shallowRef(/* @__PURE__ */ new Map());
|
16220
16364
|
const formRef = vue.ref();
|
16221
16365
|
const prefixCls = usePrefixCls("form");
|
16222
16366
|
const formData = vue.ref({});
|
@@ -16270,8 +16414,9 @@
|
|
16270
16414
|
});
|
16271
16415
|
};
|
16272
16416
|
vue.watch(() => props.items, () => {
|
16273
|
-
var _a;
|
16274
|
-
|
16417
|
+
var _a, _b;
|
16418
|
+
transformerMap.value = transformer((_a = props.items) != null ? _a : []);
|
16419
|
+
formItems.value = formatItems((_b = props.items) != null ? _b : []);
|
16275
16420
|
}, {
|
16276
16421
|
immediate: true
|
16277
16422
|
});
|
@@ -16282,7 +16427,7 @@
|
|
16282
16427
|
} = useInitialValues(props);
|
16283
16428
|
vue.watch(initialValues, (newValues, oldValues) => {
|
16284
16429
|
if (!isEqual(newValues, oldValues)) {
|
16285
|
-
formData.value = cloneDeep(newValues);
|
16430
|
+
formData.value = cloneDeep(convertKeyInitialValue(newValues, transformerMap.value));
|
16286
16431
|
if (!props.request || props.requestAbort) {
|
16287
16432
|
Promise.resolve().then(() => {
|
16288
16433
|
hasInitial.value = false;
|
@@ -16294,21 +16439,21 @@
|
|
16294
16439
|
});
|
16295
16440
|
const onValuesChange = debounce(() => {
|
16296
16441
|
var _a;
|
16297
|
-
(_a = props.onValuesChange) == null ? void 0 : _a.call(props, cloneDeep(formData.value));
|
16442
|
+
(_a = props.onValuesChange) == null ? void 0 : _a.call(props, transformKeySubmitValue(cloneDeep(formData.value), transformerMap.value, props.omitNil));
|
16298
16443
|
}, 200);
|
16299
16444
|
const onFinish = async () => {
|
16300
16445
|
if (!props.onFinish) return;
|
16301
|
-
if (props.
|
16446
|
+
if (props.submitOnLoading) {
|
16302
16447
|
if (loading.value) return;
|
16303
16448
|
setloading(true);
|
16304
16449
|
}
|
16305
16450
|
try {
|
16306
|
-
const finalValues = cloneDeep(formData.value);
|
16451
|
+
const finalValues = transformKeySubmitValue(cloneDeep(formData.value), transformerMap.value, props.omitNil);
|
16307
16452
|
await props.onFinish(finalValues);
|
16308
16453
|
} catch (error) {
|
16309
16454
|
console.log("\u{1F680} ~ onFinish ~ error:", error);
|
16310
16455
|
} finally {
|
16311
|
-
if (props.
|
16456
|
+
if (props.submitOnLoading) {
|
16312
16457
|
setloading(false);
|
16313
16458
|
}
|
16314
16459
|
}
|
@@ -16327,6 +16472,7 @@
|
|
16327
16472
|
formData,
|
16328
16473
|
initialValues,
|
16329
16474
|
hasInitial,
|
16475
|
+
transformerMap,
|
16330
16476
|
onFinish,
|
16331
16477
|
onReset: props.onReset,
|
16332
16478
|
onFinishFailed: props.onFinishFailed
|
@@ -16374,8 +16520,11 @@
|
|
16374
16520
|
var _a, _b, _c;
|
16375
16521
|
mountedRef.value = true;
|
16376
16522
|
requestFormCacheId += 1;
|
16377
|
-
const finalValues = (_b = (_a = formRef.value) == null ? void 0 : _a.getFieldsValue) == null ? void 0 : _b.call(_a, true);
|
16378
|
-
(
|
16523
|
+
const finalValues = (_c = (_b = (_a = formRef.value) == null ? void 0 : _a.getFieldsValue) == null ? void 0 : _b.call(_a, true)) != null ? _c : {};
|
16524
|
+
Promise.resolve().then(() => {
|
16525
|
+
var _a2;
|
16526
|
+
(_a2 = props.onInit) == null ? void 0 : _a2.call(props, transformKeySubmitValue(finalValues, transformerMap.value, props.omitNil), action);
|
16527
|
+
});
|
16379
16528
|
});
|
16380
16529
|
useProvideForm({
|
16381
16530
|
...linkage,
|
@@ -16422,7 +16571,7 @@
|
|
16422
16571
|
"style": attrs.style
|
16423
16572
|
}), {
|
16424
16573
|
default: () => [vue.createVNode(antDesignVue.Spin, {
|
16425
|
-
"spinning": requestLoading.value ||
|
16574
|
+
"spinning": props.showLoading && (requestLoading.value || loading.value)
|
16426
16575
|
}, {
|
16427
16576
|
default: () => [vue.createVNode(FormRowWrapper, null, {
|
16428
16577
|
default: () => [vue.createVNode(FormItems, {
|
@@ -16456,8 +16605,7 @@
|
|
16456
16605
|
emits: ["update:open"],
|
16457
16606
|
setup(props, {
|
16458
16607
|
slots,
|
16459
|
-
emit
|
16460
|
-
expose
|
16608
|
+
emit
|
16461
16609
|
}) {
|
16462
16610
|
const _open = vue.ref(false);
|
16463
16611
|
const loading = vue.ref(false);
|
@@ -16465,7 +16613,6 @@
|
|
16465
16613
|
const intl = useIntl();
|
16466
16614
|
const formRef = vue.ref();
|
16467
16615
|
const footerRef = vue.ref(null);
|
16468
|
-
const formExpose = useFormExpose(formRef);
|
16469
16616
|
const open = vue.computed({
|
16470
16617
|
get: () => {
|
16471
16618
|
var _a;
|
@@ -16485,7 +16632,7 @@
|
|
16485
16632
|
});
|
16486
16633
|
const formProps = vue.computed(() => {
|
16487
16634
|
return {
|
16488
|
-
...omitUndefined(omit(props, ["onOpenChange", "closeOnFinish", "drawerProps", "title", "width", "confirmOnValuesChange", "submitTimeout", "onFinish", "submitter"])),
|
16635
|
+
...omitUndefined(omit(props, ["onOpenChange", "closeOnFinish", "drawerProps", "title", "width", "onInit", "confirmOnValuesChange", "submitTimeout", "onFinish", "submitter"])),
|
16489
16636
|
layout: "vertical"
|
16490
16637
|
};
|
16491
16638
|
});
|
@@ -16591,10 +16738,6 @@
|
|
16591
16738
|
}
|
16592
16739
|
return result;
|
16593
16740
|
};
|
16594
|
-
expose({
|
16595
|
-
formRef,
|
16596
|
-
...formExpose
|
16597
|
-
});
|
16598
16741
|
return () => vue.createVNode(vue.Fragment, null, [vue.createVNode(ProDrawer, vue.mergeProps(drawerProps.value, {
|
16599
16742
|
"open": open.value,
|
16600
16743
|
"onAfterOpenChange": (e) => {
|
@@ -16608,9 +16751,7 @@
|
|
16608
16751
|
closeConfirm(e);
|
16609
16752
|
}
|
16610
16753
|
}), {
|
16611
|
-
default: () => [vue.createVNode(BaseForm, vue.mergeProps({
|
16612
|
-
"ref": formRef
|
16613
|
-
}, formProps.value, {
|
16754
|
+
default: () => [vue.createVNode(BaseForm, vue.mergeProps(formProps.value, {
|
16614
16755
|
"submitter": submitterConfig.value,
|
16615
16756
|
"onFinish": async (values) => {
|
16616
16757
|
const result = await onFinishHandle(values);
|
@@ -16629,6 +16770,11 @@
|
|
16629
16770
|
valuesChanged.value = false;
|
16630
16771
|
}
|
16631
16772
|
(_a = props.onReset) == null ? void 0 : _a.call(props);
|
16773
|
+
},
|
16774
|
+
"onInit": (values, action) => {
|
16775
|
+
var _a;
|
16776
|
+
formRef.value = action;
|
16777
|
+
(_a = props.onInit) == null ? void 0 : _a.call(props, values, action);
|
16632
16778
|
}
|
16633
16779
|
}), formSlots.value)],
|
16634
16780
|
...drawerSlots.value,
|
@@ -16653,8 +16799,7 @@
|
|
16653
16799
|
emits: ["update:open"],
|
16654
16800
|
setup(props, {
|
16655
16801
|
slots,
|
16656
|
-
emit
|
16657
|
-
expose
|
16802
|
+
emit
|
16658
16803
|
}) {
|
16659
16804
|
const _open = vue.ref(false);
|
16660
16805
|
const loading = vue.ref(false);
|
@@ -16662,7 +16807,6 @@
|
|
16662
16807
|
const intl = useIntl();
|
16663
16808
|
const formRef = vue.ref();
|
16664
16809
|
const footerRef = vue.ref(null);
|
16665
|
-
const formExpose = useFormExpose(formRef);
|
16666
16810
|
const open = vue.computed({
|
16667
16811
|
get: () => {
|
16668
16812
|
var _a;
|
@@ -16683,7 +16827,7 @@
|
|
16683
16827
|
const formProps = vue.computed(() => {
|
16684
16828
|
var _a;
|
16685
16829
|
return {
|
16686
|
-
...omitUndefined(omit(props, ["onOpenChange", "closeOnFinish", "modalProps", "title", "width", "confirmOnValuesChange", "submitTimeout", "onFinish", "submitter"])),
|
16830
|
+
...omitUndefined(omit(props, ["onInit", "onOpenChange", "closeOnFinish", "modalProps", "title", "width", "confirmOnValuesChange", "submitTimeout", "onFinish", "submitter"])),
|
16687
16831
|
layout: (_a = props.layout) != null ? _a : "vertical"
|
16688
16832
|
};
|
16689
16833
|
});
|
@@ -16790,10 +16934,6 @@
|
|
16790
16934
|
}
|
16791
16935
|
return result;
|
16792
16936
|
};
|
16793
|
-
expose({
|
16794
|
-
formRef,
|
16795
|
-
...formExpose
|
16796
|
-
});
|
16797
16937
|
return () => vue.createVNode(vue.Fragment, null, [vue.createVNode(ProModal, vue.mergeProps(modalProps.value, {
|
16798
16938
|
"open": open.value,
|
16799
16939
|
"afterClose": () => {
|
@@ -16807,9 +16947,7 @@
|
|
16807
16947
|
closeConfirm(e);
|
16808
16948
|
}
|
16809
16949
|
}), {
|
16810
|
-
default: () => [vue.createVNode(BaseForm, vue.mergeProps({
|
16811
|
-
"ref": formRef
|
16812
|
-
}, formProps.value, {
|
16950
|
+
default: () => [vue.createVNode(BaseForm, vue.mergeProps(formProps.value, {
|
16813
16951
|
"submitter": submitterConfig.value,
|
16814
16952
|
"onFinish": async (values) => {
|
16815
16953
|
const result = await onFinishHandle(values);
|
@@ -16828,6 +16966,11 @@
|
|
16828
16966
|
valuesChanged.value = false;
|
16829
16967
|
}
|
16830
16968
|
(_a = props.onReset) == null ? void 0 : _a.call(props);
|
16969
|
+
},
|
16970
|
+
"onInit": (values, action) => {
|
16971
|
+
var _a;
|
16972
|
+
formRef.value = action;
|
16973
|
+
(_a = props.onInit) == null ? void 0 : _a.call(props, values, action);
|
16831
16974
|
}
|
16832
16975
|
}), formSlots.value)],
|
16833
16976
|
...modalSlots.value,
|
@@ -17048,7 +17191,7 @@
|
|
17048
17191
|
firstRowFull = colSpan === 24 && !item.hidden;
|
17049
17192
|
}
|
17050
17193
|
const hidden = item.hidden || // 如果收起了
|
17051
|
-
collapsed.value && (firstRowFull || // 如果 超过显示长度 且 总长度超过了 24
|
17194
|
+
props.submitter !== false && collapsed.value && (firstRowFull || // 如果 超过显示长度 且 总长度超过了 24
|
17052
17195
|
totalSize.value > showLength.value) && !!index;
|
17053
17196
|
if (hidden) {
|
17054
17197
|
if (!props.preserve) {
|
@@ -17106,7 +17249,7 @@
|
|
17106
17249
|
justify: "start",
|
17107
17250
|
class: `${prefixCls}-row`
|
17108
17251
|
},
|
17109
|
-
"
|
17252
|
+
"showLoading": false,
|
17110
17253
|
"submitter": submitterConfig.value,
|
17111
17254
|
"items": processedList.value,
|
17112
17255
|
"layout": spanSize.value.layout,
|
@@ -17283,7 +17426,8 @@
|
|
17283
17426
|
},
|
17284
17427
|
emits: [],
|
17285
17428
|
setup(props, {
|
17286
|
-
slots
|
17429
|
+
slots,
|
17430
|
+
expose
|
17287
17431
|
}) {
|
17288
17432
|
const intl = useIntl();
|
17289
17433
|
const prefixCls = usePrefixCls("steps-form");
|
@@ -17449,6 +17593,9 @@
|
|
17449
17593
|
regForm,
|
17450
17594
|
onFormFinish
|
17451
17595
|
});
|
17596
|
+
expose({
|
17597
|
+
formArrayRef
|
17598
|
+
});
|
17452
17599
|
return () => vue.createVNode("div", {
|
17453
17600
|
"class": prefixCls
|
17454
17601
|
}, [stepsFormDom.value]);
|
@@ -18162,7 +18309,8 @@
|
|
18162
18309
|
showFixedButton: { type: Boolean, required: false, default: true },
|
18163
18310
|
theme: { type: String, required: true },
|
18164
18311
|
width: { type: Number, required: true },
|
18165
|
-
zIndex: { type: Number, required: false, default: 0 }
|
18312
|
+
zIndex: { type: Number, required: false, default: 0 },
|
18313
|
+
fixed: { type: Boolean, required: false, default: true }
|
18166
18314
|
}, {
|
18167
18315
|
"collapse": { type: Boolean },
|
18168
18316
|
"collapseModifiers": {},
|
@@ -18299,7 +18447,7 @@
|
|
18299
18447
|
vue.Fragment,
|
18300
18448
|
null,
|
18301
18449
|
[
|
18302
|
-
_ctx.domVisible ? (vue.openBlock(), vue.createElementBlock(
|
18450
|
+
_ctx.domVisible && _ctx.fixed ? (vue.openBlock(), vue.createElementBlock(
|
18303
18451
|
"div",
|
18304
18452
|
{
|
18305
18453
|
key: 0,
|
@@ -18315,9 +18463,9 @@
|
|
18315
18463
|
{
|
18316
18464
|
class: vue.normalizeClass([
|
18317
18465
|
vue.unref(prefixCls),
|
18318
|
-
`${vue.unref(prefixCls)}--fixed`,
|
18319
18466
|
_ctx.theme,
|
18320
18467
|
{
|
18468
|
+
[`${vue.unref(prefixCls)}--fixed`]: _ctx.fixed,
|
18321
18469
|
[`${vue.unref(prefixCls)}--mixed`]: _ctx.isSidebarMixed,
|
18322
18470
|
[`${vue.unref(prefixCls)}--no-mixed`]: !_ctx.isSidebarMixed
|
18323
18471
|
}
|
@@ -18549,6 +18697,7 @@
|
|
18549
18697
|
sidebarTheme: { type: String, required: false, default: "light" },
|
18550
18698
|
sidebarWidth: { type: Number, required: false, default: 200 },
|
18551
18699
|
sideCollapseWidth: { type: Number, required: false, default: 60 },
|
18700
|
+
sidebarFixed: { type: Boolean, required: false, default: true },
|
18552
18701
|
tabbarEnable: { type: Boolean, required: false, default: true },
|
18553
18702
|
tabbarHeight: { type: Number, required: false, default: 40 },
|
18554
18703
|
zIndex: { type: Number, required: false, default: 200 }
|
@@ -18884,6 +19033,7 @@
|
|
18884
19033
|
"margin-top": sidebarMarginTop.value,
|
18885
19034
|
"mixed-width": _ctx.sidebarMixedWidth,
|
18886
19035
|
show: showSidebar.value,
|
19036
|
+
fixed: _ctx.sidebarFixed,
|
18887
19037
|
theme: _ctx.sidebarTheme,
|
18888
19038
|
width: getSidebarWidth.value,
|
18889
19039
|
"z-index": sidebarZIndex.value,
|
@@ -18908,7 +19058,7 @@
|
|
18908
19058
|
]),
|
18909
19059
|
key: "0"
|
18910
19060
|
} : void 0
|
18911
|
-
]), 1032, ["collapse", "expand-on-hover", "expand-on-hovering", "extra-collapse", "extra-visible", "show-collapse-button", "show-fixed-button", "collapse-width", "dom-visible", "extra-width", "fixed-extra", "header-height", "is-sidebar-mixed", "margin-top", "mixed-width", "show", "theme", "width", "z-index"])) : vue.createCommentVNode("v-if", true),
|
19061
|
+
]), 1032, ["collapse", "expand-on-hover", "expand-on-hovering", "extra-collapse", "extra-visible", "show-collapse-button", "show-fixed-button", "collapse-width", "dom-visible", "extra-width", "fixed-extra", "header-height", "is-sidebar-mixed", "margin-top", "mixed-width", "show", "fixed", "theme", "width", "z-index"])) : vue.createCommentVNode("v-if", true),
|
18912
19062
|
vue.createElementVNode(
|
18913
19063
|
"div",
|
18914
19064
|
{
|
@@ -20786,6 +20936,22 @@
|
|
20786
20936
|
return (a.index || 0) - (b.index || 0);
|
20787
20937
|
};
|
20788
20938
|
|
20939
|
+
const flatColumnsHandle = (columns) => {
|
20940
|
+
const flatColumns = [];
|
20941
|
+
const loopColumns = (columns2) => {
|
20942
|
+
columns2.forEach((column) => {
|
20943
|
+
var _a;
|
20944
|
+
if ((_a = column == null ? void 0 : column.children) == null ? void 0 : _a.length) {
|
20945
|
+
loopColumns(column == null ? void 0 : column.children);
|
20946
|
+
} else {
|
20947
|
+
flatColumns.push(column);
|
20948
|
+
}
|
20949
|
+
});
|
20950
|
+
};
|
20951
|
+
loopColumns(columns);
|
20952
|
+
return flatColumns;
|
20953
|
+
};
|
20954
|
+
|
20789
20955
|
function useMergedState(defaultStateValue, option) {
|
20790
20956
|
const { defaultValue, value = vue.ref() } = option || {};
|
20791
20957
|
let initValue = typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue;
|
@@ -29000,6 +29166,15 @@
|
|
29000
29166
|
status: option.status,
|
29001
29167
|
text: option.text
|
29002
29168
|
});
|
29169
|
+
} else if (option.color) {
|
29170
|
+
cellValue = vue.createVNode(
|
29171
|
+
antDesignVue.Tag,
|
29172
|
+
{
|
29173
|
+
color: option.color,
|
29174
|
+
bordered: false
|
29175
|
+
},
|
29176
|
+
() => option.text
|
29177
|
+
);
|
29003
29178
|
} else {
|
29004
29179
|
cellValue = option.text || emptyText;
|
29005
29180
|
}
|
@@ -30274,6 +30449,7 @@
|
|
30274
30449
|
const tableSlotsContext = useInjectSlots();
|
30275
30450
|
const dragRowPlaceholderRef = vue.ref();
|
30276
30451
|
const bodyRef = vue.ref();
|
30452
|
+
const measureDomRef = vue.ref();
|
30277
30453
|
const bodyInnerRef = vue.ref();
|
30278
30454
|
const scrollLayerRef = vue.ref();
|
30279
30455
|
const viewportRef = vue.ref();
|
@@ -30455,8 +30631,8 @@
|
|
30455
30631
|
};
|
30456
30632
|
});
|
30457
30633
|
const bodyViewportStyle = vue.computed(() => ({
|
30458
|
-
|
30459
|
-
width: `calc(100% + 0px)`,
|
30634
|
+
width: `calc(100% + ${tableContext.showVerticalScrollbar.value ? tableContext.scrollBarSize.value || 15 : 0}px)`,
|
30635
|
+
// width: `calc(100% + 0px)`,
|
30460
30636
|
overflowX: "hidden",
|
30461
30637
|
overflowY: "auto",
|
30462
30638
|
height: "100%"
|
@@ -30584,6 +30760,12 @@
|
|
30584
30760
|
return summaryStyle.value;
|
30585
30761
|
});
|
30586
30762
|
const emptyStyle = vue.computed(() => ({ width: `${props.bodyWidth}px` }));
|
30763
|
+
useResizeObserver(measureDomRef, (entries) => {
|
30764
|
+
var _a;
|
30765
|
+
const contentRect = (_a = entries[0]) == null ? void 0 : _a.contentRect;
|
30766
|
+
emit("update:bodyWidth", (contentRect == null ? void 0 : contentRect.width) || 0);
|
30767
|
+
emit("update:bodyHeight", (contentRect == null ? void 0 : contentRect.height) || 0);
|
30768
|
+
});
|
30587
30769
|
return {
|
30588
30770
|
bodyContainerStyle,
|
30589
30771
|
measureDomStyle: vue.computed(() => ({
|
@@ -30634,6 +30816,7 @@
|
|
30634
30816
|
emit("update:bodyScrollWidth", e.detail.width);
|
30635
30817
|
},
|
30636
30818
|
bodyRef,
|
30819
|
+
measureDomRef,
|
30637
30820
|
bodyInnerRef,
|
30638
30821
|
viewportRef,
|
30639
30822
|
summaryViewportRef,
|
@@ -30790,15 +30973,15 @@
|
|
30790
30973
|
_: 1
|
30791
30974
|
/* STABLE */
|
30792
30975
|
}),
|
30793
|
-
vue.
|
30976
|
+
vue.createElementVNode(
|
30794
30977
|
"div",
|
30795
30978
|
{
|
30796
30979
|
key: "body",
|
30797
30980
|
ref: "bodyRef",
|
30798
30981
|
class: vue.normalizeClass(_ctx.bodyClass),
|
30799
30982
|
style: vue.normalizeStyle(_ctx.bodyStyle),
|
30800
|
-
onDragstart: _cache[
|
30801
|
-
onKeydown: _cache[
|
30983
|
+
onDragstart: _cache[8] || (_cache[8] = (...args) => _ctx.handleDragStart && _ctx.handleDragStart(...args)),
|
30984
|
+
onKeydown: _cache[9] || (_cache[9] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args))
|
30802
30985
|
},
|
30803
30986
|
[
|
30804
30987
|
vue.createElementVNode("div", _hoisted_1$3, [
|
@@ -31108,24 +31291,22 @@
|
|
31108
31291
|
6
|
31109
31292
|
/* CLASS, STYLE */
|
31110
31293
|
),
|
31111
|
-
vue.
|
31294
|
+
vue.createElementVNode(
|
31112
31295
|
"div",
|
31113
31296
|
{
|
31114
|
-
|
31115
|
-
|
31297
|
+
ref: "measureDomRef",
|
31298
|
+
style: vue.normalizeStyle(_ctx.measureDomStyle)
|
31116
31299
|
},
|
31117
31300
|
null,
|
31118
|
-
|
31119
|
-
/* STYLE
|
31120
|
-
),
|
31121
|
-
[_directive_resize]
|
31122
|
-
]),
|
31301
|
+
4
|
31302
|
+
/* STYLE */
|
31303
|
+
),
|
31123
31304
|
vue.withDirectives(vue.createElementVNode(
|
31124
31305
|
"div",
|
31125
31306
|
{
|
31126
31307
|
class: vue.normalizeClass(`${_ctx.prefixCls}-body-scroll-measure`),
|
31127
31308
|
style: vue.normalizeStyle(`min-width: ${_ctx.bodyInnerWidth}px`),
|
31128
|
-
onResizewidth: _cache[
|
31309
|
+
onResizewidth: _cache[6] || (_cache[6] = (...args) => _ctx.handleBodyScrollResize && _ctx.handleBodyScrollResize(...args))
|
31129
31310
|
},
|
31130
31311
|
null,
|
31131
31312
|
38
|
@@ -31138,7 +31319,7 @@
|
|
31138
31319
|
{
|
31139
31320
|
class: vue.normalizeClass(`${_ctx.prefixCls}-body-inner-measure`),
|
31140
31321
|
style: vue.normalizeStyle(`min-width: ${_ctx.scrollX}px`),
|
31141
|
-
onResizewidth: _cache[
|
31322
|
+
onResizewidth: _cache[7] || (_cache[7] = (...args) => _ctx.handleBodyInnerResize && _ctx.handleBodyInnerResize(...args))
|
31142
31323
|
},
|
31143
31324
|
null,
|
31144
31325
|
38
|
@@ -31153,9 +31334,7 @@
|
|
31153
31334
|
],
|
31154
31335
|
38
|
31155
31336
|
/* CLASS, STYLE, NEED_HYDRATION */
|
31156
|
-
)
|
31157
|
-
[_directive_resize, void 0, "height"]
|
31158
|
-
]),
|
31337
|
+
),
|
31159
31338
|
vue.createVNode(_component_RenderSlot, null, {
|
31160
31339
|
default: vue.withCtx(() => [
|
31161
31340
|
_ctx.summary && _ctx.summaryFixed === "bottom" ? (vue.openBlock(), vue.createElementBlock(
|
@@ -31184,7 +31363,7 @@
|
|
31184
31363
|
vue.withDirectives((vue.openBlock(), vue.createElementBlock(
|
31185
31364
|
"div",
|
31186
31365
|
{
|
31187
|
-
onResizeheight: _cache[
|
31366
|
+
onResizeheight: _cache[10] || (_cache[10] = (...args) => _ctx.handleResize && _ctx.handleResize(...args))
|
31188
31367
|
},
|
31189
31368
|
[
|
31190
31369
|
vue.createVNode(_component_RenderVNode, { vnode: _ctx.summary }, null, 8, ["vnode"])
|
@@ -31637,6 +31816,9 @@
|
|
31637
31816
|
const showHorizontalScrollbar = vue.ref(false);
|
31638
31817
|
const debounceFn = debounce(() => {
|
31639
31818
|
showHorizontalScrollbar.value = bodyMaxWidth.value > bodyWidth.value;
|
31819
|
+
if (bodyWidth.value > bodyScrollWidth.value) {
|
31820
|
+
bodyScrollWidth.value = bodyWidth.value;
|
31821
|
+
}
|
31640
31822
|
}, 100);
|
31641
31823
|
vue.watch([bodyMaxWidth, bodyWidth], () => {
|
31642
31824
|
debounceFn();
|
@@ -33356,25 +33538,10 @@
|
|
33356
33538
|
function _isSlot$3(s) {
|
33357
33539
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
33358
33540
|
}
|
33359
|
-
const flatColumnsHandle = (columns) => {
|
33360
|
-
const flatColumns = [];
|
33361
|
-
const loopColumns = (columns2) => {
|
33362
|
-
columns2.forEach((column) => {
|
33363
|
-
var _a;
|
33364
|
-
if ((_a = column == null ? void 0 : column.children) == null ? void 0 : _a.length) {
|
33365
|
-
loopColumns(column == null ? void 0 : column.children);
|
33366
|
-
} else {
|
33367
|
-
flatColumns.push(column);
|
33368
|
-
}
|
33369
|
-
});
|
33370
|
-
};
|
33371
|
-
loopColumns(columns);
|
33372
|
-
return flatColumns;
|
33373
|
-
};
|
33374
33541
|
var FormRender = /* @__PURE__ */ vue.defineComponent({
|
33375
33542
|
props: {
|
33376
33543
|
prefixCls: String,
|
33377
|
-
|
33544
|
+
items: {
|
33378
33545
|
type: Array,
|
33379
33546
|
default: () => []
|
33380
33547
|
},
|
@@ -33388,6 +33555,7 @@
|
|
33388
33555
|
},
|
33389
33556
|
loading: Boolean,
|
33390
33557
|
manual: Boolean,
|
33558
|
+
tableShowCard: Boolean,
|
33391
33559
|
beforeSearchSubmit: {
|
33392
33560
|
type: Function,
|
33393
33561
|
default: (searchParams) => searchParams
|
@@ -33412,25 +33580,6 @@
|
|
33412
33580
|
setup: (props) => {
|
33413
33581
|
var _a, _b, _c;
|
33414
33582
|
const activeTabKey = vue.ref(((_a = props.search) == null ? void 0 : _a.cardProps) !== false ? (_c = (_b = props.search) == null ? void 0 : _b.cardProps) == null ? void 0 : _c.activeTabKey : "");
|
33415
|
-
const formItems = vue.computed(() => {
|
33416
|
-
var _a2, _b2, _c2;
|
33417
|
-
if ((_b2 = (_a2 = props.search) == null ? void 0 : _a2.items) == null ? void 0 : _b2.length) {
|
33418
|
-
return (_c2 = props.search) == null ? void 0 : _c2.items;
|
33419
|
-
}
|
33420
|
-
return flatColumnsHandle(props.columns).filter((item) => {
|
33421
|
-
if (item.hideInSearch) {
|
33422
|
-
return false;
|
33423
|
-
}
|
33424
|
-
return true;
|
33425
|
-
}).map((item) => {
|
33426
|
-
return {
|
33427
|
-
...item,
|
33428
|
-
width: void 0,
|
33429
|
-
tooltip: item.headerTooltip,
|
33430
|
-
name: item.dataIndex
|
33431
|
-
};
|
33432
|
-
});
|
33433
|
-
});
|
33434
33583
|
const cardProps = vue.computed(() => {
|
33435
33584
|
var _a2, _b2;
|
33436
33585
|
if (!((_a2 = props.search) == null ? void 0 : _a2.cardProps)) {
|
@@ -33461,14 +33610,15 @@
|
|
33461
33610
|
(_e = (_d = cardProps.value) == null ? void 0 : _d.onTabChange) == null ? void 0 : _e.call(_d, key);
|
33462
33611
|
};
|
33463
33612
|
return () => {
|
33464
|
-
var _a2, _b2, _c2;
|
33613
|
+
var _a2, _b2, _c2, _d;
|
33465
33614
|
const searchDom = vue.createVNode(ProQueryFilter, vue.mergeProps({
|
33466
33615
|
"class": `${props.prefixCls}-form`
|
33467
33616
|
}, omit(props.search || {}, ["cardProps", "tabName"]), {
|
33468
|
-
"items":
|
33617
|
+
"items": props.items,
|
33469
33618
|
"loading": props.loading,
|
33470
33619
|
"style": {
|
33471
|
-
marginBlockEnd: ((_a2 = props.search) == null ? void 0 : _a2.cardProps) !== false ? 0 : "
|
33620
|
+
marginBlockEnd: ((_a2 = props.search) == null ? void 0 : _a2.cardProps) !== false && props.tableShowCard ? 0 : "30px",
|
33621
|
+
...(_b2 = props.search) == null ? void 0 : _b2.style
|
33472
33622
|
},
|
33473
33623
|
"onReset": props.onReset,
|
33474
33624
|
"onFinish": (values) => {
|
@@ -33485,7 +33635,7 @@
|
|
33485
33635
|
submit(values, true);
|
33486
33636
|
}
|
33487
33637
|
}), null);
|
33488
|
-
if (((
|
33638
|
+
if (((_c2 = props.search) == null ? void 0 : _c2.cardProps) !== false && props.tableShowCard) {
|
33489
33639
|
return vue.createVNode(antDesignVue.Card, vue.mergeProps({
|
33490
33640
|
"class": `${props.prefixCls}-search`,
|
33491
33641
|
"activeTabKey": activeTabKey.value,
|
@@ -33493,7 +33643,7 @@
|
|
33493
33643
|
"style": {
|
33494
33644
|
marginBlockEnd: "16px"
|
33495
33645
|
}
|
33496
|
-
}, omit((
|
33646
|
+
}, omit((_d = cardProps.value) != null ? _d : {}, ["onTabChange", "activeTabKey"]), {
|
33497
33647
|
"onTabChange": onTabChange
|
33498
33648
|
}), _isSlot$3(searchDom) ? searchDom : {
|
33499
33649
|
default: () => [searchDom]
|
@@ -33635,6 +33785,28 @@
|
|
33635
33785
|
};
|
33636
33786
|
return loopFilter(tableColumn.value);
|
33637
33787
|
});
|
33788
|
+
const formItems = vue.computed(() => {
|
33789
|
+
var _a2, _b, _c;
|
33790
|
+
if (!props.search) {
|
33791
|
+
return [];
|
33792
|
+
}
|
33793
|
+
if ((_b = (_a2 = props.search) == null ? void 0 : _a2.items) == null ? void 0 : _b.length) {
|
33794
|
+
return (_c = props.search) == null ? void 0 : _c.items;
|
33795
|
+
}
|
33796
|
+
return flatColumnsHandle(props.columns).filter((item) => {
|
33797
|
+
if (item.hideInSearch) {
|
33798
|
+
return false;
|
33799
|
+
}
|
33800
|
+
return true;
|
33801
|
+
}).map((item) => {
|
33802
|
+
return {
|
33803
|
+
...item,
|
33804
|
+
width: void 0,
|
33805
|
+
tooltip: item.headerTooltip,
|
33806
|
+
name: item.dataIndex
|
33807
|
+
};
|
33808
|
+
});
|
33809
|
+
});
|
33638
33810
|
const preserveRecordsRef = vue.ref(/* @__PURE__ */ new Map());
|
33639
33811
|
const getRowKey = vue.computed(() => typeof props.rowKey == "function" ? props.rowKey : (record) => {
|
33640
33812
|
return record == null ? void 0 : record[props.rowKey || "id"];
|
@@ -33682,7 +33854,8 @@
|
|
33682
33854
|
};
|
33683
33855
|
const hideToolbar = vue.computed(() => props.options === false && !props.title && !slots.title && !slots.toolbar && !slots.searchExtra && !slots.toolbarActions);
|
33684
33856
|
const notNeedCardDom = vue.computed(() => {
|
33685
|
-
|
33857
|
+
var _a2;
|
33858
|
+
if ((props.search === false || !((_a2 = formItems.value) == null ? void 0 : _a2.length)) && props.toolBar === false) {
|
33686
33859
|
return true;
|
33687
33860
|
}
|
33688
33861
|
return false;
|
@@ -33749,7 +33922,7 @@
|
|
33749
33922
|
reset
|
33750
33923
|
});
|
33751
33924
|
return () => {
|
33752
|
-
var _a2, _b;
|
33925
|
+
var _a2, _b, _c;
|
33753
33926
|
const {
|
33754
33927
|
expandIcon = slots.expandIcon,
|
33755
33928
|
expandedRowRender = slots.expandedRowRender
|
@@ -33818,11 +33991,12 @@
|
|
33818
33991
|
}, attrs, {
|
33819
33992
|
"class": [`${mergedPrefixCls.value}-wrapper ${props.bordered ? mergedPrefixCls.value + "-wrapper-bordered" : ""} ${"dark" === theme.value ? mergedPrefixCls.value + "-wrapper-dark" : ""} ${pollingLoading.value ? mergedPrefixCls.value + "-wrapper-polling" : ""}`, attrs.class],
|
33820
33993
|
"onKeydown": onKeydown
|
33821
|
-
}), [props.search !== false && vue.createVNode(FormRender, {
|
33994
|
+
}), [props.search !== false && !!((_c = formItems.value) == null ? void 0 : _c.length) && vue.createVNode(FormRender, {
|
33822
33995
|
"prefixCls": mergedPrefixCls.value,
|
33823
|
-
"
|
33996
|
+
"items": formItems.value,
|
33824
33997
|
"cardBordered": props.cardBordered,
|
33825
33998
|
"search": props.search,
|
33999
|
+
"tableShowCard": props.cardProps !== false,
|
33826
34000
|
"loading": formSubmitLoading.value,
|
33827
34001
|
"beforeSearchSubmit": props.beforeSearchSubmit,
|
33828
34002
|
"manual": props.manual,
|
@@ -34666,6 +34840,10 @@
|
|
34666
34840
|
colProps: {
|
34667
34841
|
type: Object,
|
34668
34842
|
default: void 0
|
34843
|
+
},
|
34844
|
+
grid: {
|
34845
|
+
type: Boolean,
|
34846
|
+
default: void 0
|
34669
34847
|
}
|
34670
34848
|
},
|
34671
34849
|
setup(props, {
|
@@ -34679,9 +34857,13 @@
|
|
34679
34857
|
var _a;
|
34680
34858
|
return (_a = props.colProps) != null ? _a : colProps == null ? void 0 : colProps.value;
|
34681
34859
|
});
|
34860
|
+
const mergeGrid = vue.computed(() => {
|
34861
|
+
var _a;
|
34862
|
+
return (_a = props.grid) != null ? _a : grid == null ? void 0 : grid.value;
|
34863
|
+
});
|
34682
34864
|
return () => {
|
34683
34865
|
var _a;
|
34684
|
-
if (
|
34866
|
+
if (mergeGrid.value) {
|
34685
34867
|
return vue.createVNode(antDesignVue.Col, mergeColProps.value, {
|
34686
34868
|
default: () => {
|
34687
34869
|
var _a2;
|
@@ -34847,25 +35029,18 @@
|
|
34847
35029
|
function useFieldValue({
|
34848
35030
|
namePath,
|
34849
35031
|
initialValue,
|
34850
|
-
convertValue
|
34851
|
-
transform
|
35032
|
+
convertValue
|
34852
35033
|
}) {
|
34853
35034
|
const fieldValue = vue.shallowRef();
|
34854
|
-
const { formData, initialValues
|
35035
|
+
const { formData, initialValues } = useInjectForm();
|
34855
35036
|
const modelValue = vue.computed(() => get(formData.value, namePath.value));
|
34856
35037
|
const onValueChange = (value) => {
|
34857
|
-
set(
|
34858
|
-
formData.value,
|
34859
|
-
namePath.value,
|
34860
|
-
transform ? transform(value, namePath.value, formData.value) : value
|
34861
|
-
);
|
35038
|
+
set(formData.value, namePath.value, value);
|
34862
35039
|
};
|
34863
35040
|
vue.watch(
|
34864
35041
|
modelValue,
|
34865
35042
|
(newValue) => {
|
34866
|
-
fieldValue.value = cloneDeep(
|
34867
|
-
convertValue ? convertValue(newValue, namePath.value) : newValue
|
34868
|
-
);
|
35043
|
+
fieldValue.value = cloneDeep(newValue);
|
34869
35044
|
},
|
34870
35045
|
{
|
34871
35046
|
immediate: true,
|
@@ -34874,11 +35049,14 @@
|
|
34874
35049
|
);
|
34875
35050
|
const initFieldInitialValue = () => {
|
34876
35051
|
var _a;
|
34877
|
-
if (
|
34878
|
-
|
35052
|
+
if (
|
35053
|
+
// !mountedRef.value &&
|
35054
|
+
typeof modelValue.value === "undefined" && typeof initialValue !== "undefined"
|
35055
|
+
) {
|
35056
|
+
const value = convertValue ? convertValue(initialValue, namePath.value) : initialValue;
|
34879
35057
|
set(formData.value, namePath.value, cloneDeep(value));
|
34880
|
-
set((_a = initialValues == null ? void 0 : initialValues.value) != null ? _a : {}, namePath.value, cloneDeep(
|
34881
|
-
fieldValue.value =
|
35058
|
+
set((_a = initialValues == null ? void 0 : initialValues.value) != null ? _a : {}, namePath.value, cloneDeep(initialValue));
|
35059
|
+
fieldValue.value = value;
|
34882
35060
|
}
|
34883
35061
|
};
|
34884
35062
|
initFieldInitialValue();
|
@@ -36418,6 +36596,10 @@
|
|
36418
36596
|
item: {
|
36419
36597
|
type: Object,
|
36420
36598
|
default: () => ({})
|
36599
|
+
},
|
36600
|
+
grid: {
|
36601
|
+
type: Boolean,
|
36602
|
+
default: void 0
|
36421
36603
|
}
|
36422
36604
|
},
|
36423
36605
|
setup(props) {
|
@@ -36452,6 +36634,10 @@
|
|
36452
36634
|
transform: props.item.transform
|
36453
36635
|
});
|
36454
36636
|
const fieldRef = vue.ref();
|
36637
|
+
const mergeGrid = vue.computed(() => {
|
36638
|
+
var _a;
|
36639
|
+
return (_a = props.grid) != null ? _a : grid == null ? void 0 : grid.value;
|
36640
|
+
});
|
36455
36641
|
const fieldType = vue.computed(() => {
|
36456
36642
|
var _a;
|
36457
36643
|
return (_a = props.item.fieldType) != null ? _a : "text";
|
@@ -36534,7 +36720,7 @@
|
|
36534
36720
|
};
|
36535
36721
|
if (props.item.width && !fieldWidthSizeMap[props.item.width]) {
|
36536
36722
|
newStyle.width = isNumber$2(props.item.width) ? props.item.width + "px" : props.item.width;
|
36537
|
-
} else if (
|
36723
|
+
} else if (mergeGrid == null ? void 0 : mergeGrid.value) {
|
36538
36724
|
newStyle.maxWidth = "100%";
|
36539
36725
|
newStyle.width = "100%";
|
36540
36726
|
}
|
@@ -36629,7 +36815,8 @@
|
|
36629
36815
|
const render = getSlot(props.item.render, formSlotsContext);
|
36630
36816
|
if (render) {
|
36631
36817
|
return vue.createVNode(FormColWrapper, {
|
36632
|
-
"colProps": props.item.colProps
|
36818
|
+
"colProps": props.item.colProps,
|
36819
|
+
"grid": mergeGrid.value
|
36633
36820
|
}, {
|
36634
36821
|
default: () => [vue.createVNode(RenderVNode$1, {
|
36635
36822
|
"vnode": render,
|
@@ -36676,7 +36863,8 @@
|
|
36676
36863
|
}, null)]);
|
36677
36864
|
}
|
36678
36865
|
return vue.createVNode(FormColWrapper, {
|
36679
|
-
"colProps": props.item.colProps
|
36866
|
+
"colProps": props.item.colProps,
|
36867
|
+
"grid": mergeGrid.value
|
36680
36868
|
}, {
|
36681
36869
|
default: () => [vue.createVNode(antDesignVue.Form.Item, restItemProps.value, {
|
36682
36870
|
default: () => [defaultDom],
|