@hw-component/form 1.9.55 → 1.9.57
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/hooks/useHForm.js +2 -1
- package/es/Form/modal.d.ts +1 -1
- package/lib/Form/hooks/useHForm.js +2 -1
- package/lib/Form/modal.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Form/hooks/useHForm.ts +2 -1
- package/src/components/Form/modal.ts +1 -1
- package/src/pages/Form/index.tsx +3 -0
- package/src/pages/ModalForm/index.tsx +6 -0
|
@@ -188,13 +188,14 @@ var useHForm = (function () {
|
|
|
188
188
|
});
|
|
189
189
|
},
|
|
190
190
|
resetFieldsInitValue: function resetFieldsInitValue() {
|
|
191
|
+
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
191
192
|
var oldValue = form.getFieldsValue();
|
|
192
193
|
var keys = Object.keys(oldValue);
|
|
193
194
|
var newVale = {};
|
|
194
195
|
keys.forEach(function (key) {
|
|
195
196
|
newVale[key] = undefined;
|
|
196
197
|
});
|
|
197
|
-
form.setFieldsValue(_objectSpread(_objectSpread({}, newVale), initSaveValue));
|
|
198
|
+
form.setFieldsValue(_objectSpread(_objectSpread(_objectSpread({}, newVale), initSaveValue), values));
|
|
198
199
|
},
|
|
199
200
|
clear: function clear() {
|
|
200
201
|
form.resetFields();
|
package/es/Form/modal.d.ts
CHANGED
|
@@ -141,7 +141,7 @@ export interface HFormInstance extends FormInstance {
|
|
|
141
141
|
removeDispatchListener: (action?: ActionModal, fn?: argsFn) => void;
|
|
142
142
|
reload: PromiseFnResult;
|
|
143
143
|
clear: VoidFunction;
|
|
144
|
-
resetFieldsInitValue:
|
|
144
|
+
resetFieldsInitValue: (values?: Record<string, any>) => void;
|
|
145
145
|
clearFormat: (name: string) => void;
|
|
146
146
|
}
|
|
147
147
|
export interface ConnectConfigModal {
|
|
@@ -191,13 +191,14 @@ var useHForm = (function () {
|
|
|
191
191
|
});
|
|
192
192
|
},
|
|
193
193
|
resetFieldsInitValue: function resetFieldsInitValue() {
|
|
194
|
+
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
194
195
|
var oldValue = form.getFieldsValue();
|
|
195
196
|
var keys = Object.keys(oldValue);
|
|
196
197
|
var newVale = {};
|
|
197
198
|
keys.forEach(function (key) {
|
|
198
199
|
newVale[key] = undefined;
|
|
199
200
|
});
|
|
200
|
-
form.setFieldsValue(_objectSpread(_objectSpread({}, newVale), initSaveValue));
|
|
201
|
+
form.setFieldsValue(_objectSpread(_objectSpread(_objectSpread({}, newVale), initSaveValue), values));
|
|
201
202
|
},
|
|
202
203
|
clear: function clear() {
|
|
203
204
|
form.resetFields();
|
package/lib/Form/modal.d.ts
CHANGED
|
@@ -141,7 +141,7 @@ export interface HFormInstance extends FormInstance {
|
|
|
141
141
|
removeDispatchListener: (action?: ActionModal, fn?: argsFn) => void;
|
|
142
142
|
reload: PromiseFnResult;
|
|
143
143
|
clear: VoidFunction;
|
|
144
|
-
resetFieldsInitValue:
|
|
144
|
+
resetFieldsInitValue: (values?: Record<string, any>) => void;
|
|
145
145
|
clearFormat: (name: string) => void;
|
|
146
146
|
}
|
|
147
147
|
export interface ConnectConfigModal {
|
package/package.json
CHANGED
|
@@ -173,7 +173,7 @@ export default () => {
|
|
|
173
173
|
});
|
|
174
174
|
});
|
|
175
175
|
},
|
|
176
|
-
resetFieldsInitValue: () => {
|
|
176
|
+
resetFieldsInitValue: (values={}) => {
|
|
177
177
|
const oldValue = form.getFieldsValue();
|
|
178
178
|
const keys = Object.keys(oldValue);
|
|
179
179
|
const newVale = {};
|
|
@@ -183,6 +183,7 @@ export default () => {
|
|
|
183
183
|
form.setFieldsValue({
|
|
184
184
|
...newVale,
|
|
185
185
|
...initSaveValue,
|
|
186
|
+
...values
|
|
186
187
|
});
|
|
187
188
|
},
|
|
188
189
|
clear: () => {
|
|
@@ -199,7 +199,7 @@ export interface HFormInstance extends FormInstance {
|
|
|
199
199
|
removeDispatchListener: (action?: ActionModal, fn?: argsFn) => void;
|
|
200
200
|
reload: PromiseFnResult;
|
|
201
201
|
clear: VoidFunction;
|
|
202
|
-
resetFieldsInitValue:
|
|
202
|
+
resetFieldsInitValue:( values?: Record<string, any>)=>void;
|
|
203
203
|
clearFormat: (name: string) => void;
|
|
204
204
|
}
|
|
205
205
|
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -117,6 +117,9 @@ const data = [
|
|
|
117
117
|
label: "文字",
|
|
118
118
|
type: "text",
|
|
119
119
|
name: "text",
|
|
120
|
+
itemProps:{
|
|
121
|
+
addonBefore:"元"
|
|
122
|
+
}
|
|
120
123
|
},
|
|
121
124
|
// {
|
|
122
125
|
// label: "下拉框",
|
|
@@ -196,6 +199,9 @@ export default () => {
|
|
|
196
199
|
>
|
|
197
200
|
<HModalForm
|
|
198
201
|
configData={data}
|
|
202
|
+
formItemStyle={{
|
|
203
|
+
marginBottom:100
|
|
204
|
+
}}
|
|
199
205
|
onOk={()=>{
|
|
200
206
|
return false;
|
|
201
207
|
}}
|