wargerm 0.5.27 → 0.5.28
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/components/WForm/example/demo1.d.ts +3 -0
- package/dist/components/WForm/example/demo2.d.ts +3 -0
- package/dist/components/WForm/example/demo3.d.ts +3 -0
- package/dist/components/WForm/index.d.ts +1 -0
- package/dist/index.esm.js +15 -10
- package/dist/index.js +15 -10
- package/package.json +2 -2
@@ -54,6 +54,7 @@ export interface WFormProps extends FormProps {
|
|
54
54
|
columns: ColumnProps[];
|
55
55
|
extraColumns?: ColumnProps[];
|
56
56
|
disabled?: boolean;
|
57
|
+
deps?: any;
|
57
58
|
disabledHideInSearch?: boolean;
|
58
59
|
setForm?: (form: any) => void;
|
59
60
|
onSubmit?: (params: Record<string, any>) => void;
|
package/dist/index.esm.js
CHANGED
@@ -7192,7 +7192,7 @@ var WCascader = function WCascader(props) {
|
|
7192
7192
|
}, extraProps));
|
7193
7193
|
};
|
7194
7194
|
|
7195
|
-
var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm"];
|
7195
|
+
var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm", "deps"];
|
7196
7196
|
var RangePicker$2 = Index$6.RangePicker;
|
7197
7197
|
|
7198
7198
|
var WForm = function WForm(props, ref) {
|
@@ -7208,6 +7208,7 @@ var WForm = function WForm(props, ref) {
|
|
7208
7208
|
onSubmit = props.onSubmit,
|
7209
7209
|
onReset = props.onReset,
|
7210
7210
|
setForm = props.setForm,
|
7211
|
+
deps = props.deps,
|
7211
7212
|
extraProps = _objectWithoutProperties(props, _excluded$7);
|
7212
7213
|
|
7213
7214
|
var _Form$useForm = _Form.useForm(),
|
@@ -7746,8 +7747,8 @@ var WForm = function WForm(props, ref) {
|
|
7746
7747
|
return renderItemForm(c);
|
7747
7748
|
}
|
7748
7749
|
});
|
7749
|
-
}, [changedValues, columns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue()) // 依赖值改变,需要重新渲染
|
7750
|
-
]);
|
7750
|
+
}, [changedValues, columns, disabled].concat(_toConsumableArray(deps ? [deps] : []), [JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue()) // 依赖值改变,需要重新渲染
|
7751
|
+
]));
|
7751
7752
|
var filterExtraColumnsForm = useMemo(function () {
|
7752
7753
|
return filterExtraFormColumns.map(function (c) {
|
7753
7754
|
if (c.type == 'group') {
|
@@ -7758,7 +7759,7 @@ var WForm = function WForm(props, ref) {
|
|
7758
7759
|
return renderItemForm(c);
|
7759
7760
|
}
|
7760
7761
|
});
|
7761
|
-
}, [changedValues, extraColumns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]);
|
7762
|
+
}, [changedValues, extraColumns, disabled].concat(_toConsumableArray(deps ? [deps] : []), [JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]));
|
7762
7763
|
|
7763
7764
|
var handleSearch = function handleSearch(v) {
|
7764
7765
|
var searchForm = form.getFieldsValue();
|
@@ -10499,7 +10500,7 @@ function DragBox(_ref) {
|
|
10499
10500
|
}, children)) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
10500
10501
|
}
|
10501
10502
|
|
10502
|
-
var _excluded$h = ["columns", "extraColumns", "search", "visible", "setVisible", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel"];
|
10503
|
+
var _excluded$h = ["columns", "extraColumns", "search", "visible", "setVisible", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSolt", "modalFooterSolt", "formProps"];
|
10503
10504
|
|
10504
10505
|
var ModalForm = function ModalForm(props, ref) {
|
10505
10506
|
var columns = props.columns,
|
@@ -10516,6 +10517,9 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10516
10517
|
onFormChange = props.onFormChange,
|
10517
10518
|
formItemChild = props.formItemChild,
|
10518
10519
|
onCancel = props.onCancel,
|
10520
|
+
modalHeaderSolt = props.modalHeaderSolt,
|
10521
|
+
modalFooterSolt = props.modalFooterSolt,
|
10522
|
+
formProps = props.formProps,
|
10519
10523
|
extraProps = _objectWithoutProperties(props, _excluded$h);
|
10520
10524
|
|
10521
10525
|
var formRef = useRef(null);
|
@@ -10646,7 +10650,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10646
10650
|
onOk: handleOk,
|
10647
10651
|
confirmLoading: confirmLoading,
|
10648
10652
|
onCancel: handleCancel
|
10649
|
-
}, extraProps), /*#__PURE__*/React.createElement(WForm$1, {
|
10653
|
+
}, extraProps), modalHeaderSolt, /*#__PURE__*/React.createElement(WForm$1, _objectSpread2({
|
10650
10654
|
ref: formRef,
|
10651
10655
|
disabled: disabled,
|
10652
10656
|
onSubmit: onSubmit,
|
@@ -10656,12 +10660,12 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10656
10660
|
search: search,
|
10657
10661
|
columns: columns,
|
10658
10662
|
extraColumns: extraColumns
|
10659
|
-
}), title == '查看' && formItemChild ? formItemChild() : null);
|
10663
|
+
}, formProps || {})), title == '查看' && formItemChild ? formItemChild() : null, modalFooterSolt);
|
10660
10664
|
};
|
10661
10665
|
|
10662
10666
|
var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
|
10663
10667
|
|
10664
|
-
var _excluded$i = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination", "noBordered"];
|
10668
|
+
var _excluded$i = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered"];
|
10665
10669
|
|
10666
10670
|
var TabelCard = function TabelCard(props, ref) {
|
10667
10671
|
var columns = props.columns,
|
@@ -10676,6 +10680,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10676
10680
|
style = props.style,
|
10677
10681
|
onFormChange = props.onFormChange,
|
10678
10682
|
modalConfig = props.modalConfig,
|
10683
|
+
searchFormConfig = props.searchFormConfig,
|
10679
10684
|
optionColumnConfig = props.optionColumnConfig,
|
10680
10685
|
pagination = props.pagination,
|
10681
10686
|
noBordered = props.noBordered,
|
@@ -11122,7 +11127,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
11122
11127
|
|
11123
11128
|
return true;
|
11124
11129
|
})
|
11125
|
-
})), /*#__PURE__*/React.createElement(WForm$1, {
|
11130
|
+
})), /*#__PURE__*/React.createElement(WForm$1, _objectSpread2({
|
11126
11131
|
ref: searchFormRef,
|
11127
11132
|
disabledRuler: true,
|
11128
11133
|
search: search == false ? {
|
@@ -11146,7 +11151,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
11146
11151
|
return [].concat(_toConsumableArray(pre), [column]);
|
11147
11152
|
}
|
11148
11153
|
}, [])
|
11149
|
-
}), /*#__PURE__*/React.createElement(ProTable, _objectSpread2(_objectSpread2({
|
11154
|
+
}, searchFormConfig || {})), /*#__PURE__*/React.createElement(ProTable, _objectSpread2(_objectSpread2({
|
11150
11155
|
actionRef: actionRef,
|
11151
11156
|
rowKey: "id",
|
11152
11157
|
bordered: !noBordered,
|
package/dist/index.js
CHANGED
@@ -7253,7 +7253,7 @@ var WCascader = function WCascader(props) {
|
|
7253
7253
|
}, extraProps));
|
7254
7254
|
};
|
7255
7255
|
|
7256
|
-
var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm"];
|
7256
|
+
var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm", "deps"];
|
7257
7257
|
var RangePicker$2 = Index$6.RangePicker;
|
7258
7258
|
|
7259
7259
|
var WForm = function WForm(props, ref) {
|
@@ -7269,6 +7269,7 @@ var WForm = function WForm(props, ref) {
|
|
7269
7269
|
onSubmit = props.onSubmit,
|
7270
7270
|
onReset = props.onReset,
|
7271
7271
|
setForm = props.setForm,
|
7272
|
+
deps = props.deps,
|
7272
7273
|
extraProps = _objectWithoutProperties(props, _excluded$7);
|
7273
7274
|
|
7274
7275
|
var _Form$useForm = _Form__default['default'].useForm(),
|
@@ -7807,8 +7808,8 @@ var WForm = function WForm(props, ref) {
|
|
7807
7808
|
return renderItemForm(c);
|
7808
7809
|
}
|
7809
7810
|
});
|
7810
|
-
}, [changedValues, columns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue()) // 依赖值改变,需要重新渲染
|
7811
|
-
]);
|
7811
|
+
}, [changedValues, columns, disabled].concat(_toConsumableArray(deps ? [deps] : []), [JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue()) // 依赖值改变,需要重新渲染
|
7812
|
+
]));
|
7812
7813
|
var filterExtraColumnsForm = React.useMemo(function () {
|
7813
7814
|
return filterExtraFormColumns.map(function (c) {
|
7814
7815
|
if (c.type == 'group') {
|
@@ -7819,7 +7820,7 @@ var WForm = function WForm(props, ref) {
|
|
7819
7820
|
return renderItemForm(c);
|
7820
7821
|
}
|
7821
7822
|
});
|
7822
|
-
}, [changedValues, extraColumns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]);
|
7823
|
+
}, [changedValues, extraColumns, disabled].concat(_toConsumableArray(deps ? [deps] : []), [JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]));
|
7823
7824
|
|
7824
7825
|
var handleSearch = function handleSearch(v) {
|
7825
7826
|
var searchForm = form.getFieldsValue();
|
@@ -10560,7 +10561,7 @@ function DragBox(_ref) {
|
|
10560
10561
|
}, children)) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
10561
10562
|
}
|
10562
10563
|
|
10563
|
-
var _excluded$h = ["columns", "extraColumns", "search", "visible", "setVisible", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel"];
|
10564
|
+
var _excluded$h = ["columns", "extraColumns", "search", "visible", "setVisible", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSolt", "modalFooterSolt", "formProps"];
|
10564
10565
|
|
10565
10566
|
var ModalForm = function ModalForm(props, ref) {
|
10566
10567
|
var columns = props.columns,
|
@@ -10577,6 +10578,9 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10577
10578
|
onFormChange = props.onFormChange,
|
10578
10579
|
formItemChild = props.formItemChild,
|
10579
10580
|
onCancel = props.onCancel,
|
10581
|
+
modalHeaderSolt = props.modalHeaderSolt,
|
10582
|
+
modalFooterSolt = props.modalFooterSolt,
|
10583
|
+
formProps = props.formProps,
|
10580
10584
|
extraProps = _objectWithoutProperties(props, _excluded$h);
|
10581
10585
|
|
10582
10586
|
var formRef = React.useRef(null);
|
@@ -10707,7 +10711,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10707
10711
|
onOk: handleOk,
|
10708
10712
|
confirmLoading: confirmLoading,
|
10709
10713
|
onCancel: handleCancel
|
10710
|
-
}, extraProps), /*#__PURE__*/React__default['default'].createElement(WForm$1, {
|
10714
|
+
}, extraProps), modalHeaderSolt, /*#__PURE__*/React__default['default'].createElement(WForm$1, _objectSpread2({
|
10711
10715
|
ref: formRef,
|
10712
10716
|
disabled: disabled,
|
10713
10717
|
onSubmit: onSubmit,
|
@@ -10717,12 +10721,12 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10717
10721
|
search: search,
|
10718
10722
|
columns: columns,
|
10719
10723
|
extraColumns: extraColumns
|
10720
|
-
}), title == '查看' && formItemChild ? formItemChild() : null);
|
10724
|
+
}, formProps || {})), title == '查看' && formItemChild ? formItemChild() : null, modalFooterSolt);
|
10721
10725
|
};
|
10722
10726
|
|
10723
10727
|
var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
|
10724
10728
|
|
10725
|
-
var _excluded$i = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination", "noBordered"];
|
10729
|
+
var _excluded$i = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered"];
|
10726
10730
|
|
10727
10731
|
var TabelCard = function TabelCard(props, ref) {
|
10728
10732
|
var columns = props.columns,
|
@@ -10737,6 +10741,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10737
10741
|
style = props.style,
|
10738
10742
|
onFormChange = props.onFormChange,
|
10739
10743
|
modalConfig = props.modalConfig,
|
10744
|
+
searchFormConfig = props.searchFormConfig,
|
10740
10745
|
optionColumnConfig = props.optionColumnConfig,
|
10741
10746
|
pagination = props.pagination,
|
10742
10747
|
noBordered = props.noBordered,
|
@@ -11183,7 +11188,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
11183
11188
|
|
11184
11189
|
return true;
|
11185
11190
|
})
|
11186
|
-
})), /*#__PURE__*/React__default['default'].createElement(WForm$1, {
|
11191
|
+
})), /*#__PURE__*/React__default['default'].createElement(WForm$1, _objectSpread2({
|
11187
11192
|
ref: searchFormRef,
|
11188
11193
|
disabledRuler: true,
|
11189
11194
|
search: search == false ? {
|
@@ -11207,7 +11212,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
11207
11212
|
return [].concat(_toConsumableArray(pre), [column]);
|
11208
11213
|
}
|
11209
11214
|
}, [])
|
11210
|
-
}), /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2(_objectSpread2({
|
11215
|
+
}, searchFormConfig || {})), /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2(_objectSpread2({
|
11211
11216
|
actionRef: actionRef,
|
11212
11217
|
rowKey: "id",
|
11213
11218
|
bordered: !noBordered,
|
package/package.json
CHANGED