wargerm 0.4.27 → 0.4.30
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.
@@ -53,6 +53,7 @@ export interface WFormProps extends FormProps {
|
|
53
53
|
extraColumns?: ColumnProps[];
|
54
54
|
disabled?: boolean;
|
55
55
|
disabledHideInSearch?: boolean;
|
56
|
+
setForm?: (form: any) => void;
|
56
57
|
onSubmit?: (params: Record<string, any>) => void;
|
57
58
|
onFormChange?: (changedValues: Record<string, any>, allValues: Record<string, any>, form: any) => void;
|
58
59
|
onReset?: () => void;
|
package/dist/index.esm.js
CHANGED
@@ -6759,7 +6759,7 @@ var WCascader = function WCascader(props) {
|
|
6759
6759
|
}, extraProps));
|
6760
6760
|
};
|
6761
6761
|
|
6762
|
-
var _excluded$6 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset"];
|
6762
|
+
var _excluded$6 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm"];
|
6763
6763
|
var RangePicker$2 = Index$5.RangePicker;
|
6764
6764
|
|
6765
6765
|
var WForm = function WForm(props, ref) {
|
@@ -6774,6 +6774,7 @@ var WForm = function WForm(props, ref) {
|
|
6774
6774
|
onFormChange = props.onFormChange,
|
6775
6775
|
onSubmit = props.onSubmit,
|
6776
6776
|
onReset = props.onReset,
|
6777
|
+
setForm = props.setForm,
|
6777
6778
|
extraProps = _objectWithoutProperties(props, _excluded$6);
|
6778
6779
|
|
6779
6780
|
var _Form$useForm = _Form.useForm(),
|
@@ -7907,6 +7908,17 @@ var WForm = function WForm(props, ref) {
|
|
7907
7908
|
setFieldsValue: setFieldsValue
|
7908
7909
|
};
|
7909
7910
|
});
|
7911
|
+
useEffect(function () {
|
7912
|
+
if (form) {
|
7913
|
+
setForm && setForm(form);
|
7914
|
+
}
|
7915
|
+
|
7916
|
+
return function () {
|
7917
|
+
if (form) {
|
7918
|
+
setForm && setForm(null);
|
7919
|
+
}
|
7920
|
+
};
|
7921
|
+
}, []);
|
7910
7922
|
return /*#__PURE__*/React.createElement(_Form, _objectSpread2({
|
7911
7923
|
style: {
|
7912
7924
|
marginBottom: '20px',
|
@@ -9594,7 +9606,7 @@ var Index$b = function Index(_ref) {
|
|
9594
9606
|
var _excluded$d = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
|
9595
9607
|
|
9596
9608
|
var Index$c = function Index(_ref, ref) {
|
9597
|
-
var _classNames;
|
9609
|
+
var _classNames, _sliderTabs$component;
|
9598
9610
|
|
9599
9611
|
var title = _ref.title,
|
9600
9612
|
_ref$className = _ref.className,
|
@@ -9629,14 +9641,15 @@ var Index$c = function Index(_ref, ref) {
|
|
9629
9641
|
className: "dot"
|
9630
9642
|
}), title), headerCenter, headerTail) : null, /*#__PURE__*/React.createElement("div", {
|
9631
9643
|
className: "body"
|
9632
|
-
}, sliderTabs ? sliderTabs.components[activeTab]
|
9644
|
+
}, (sliderTabs === null || sliderTabs === void 0 ? void 0 : (_sliderTabs$component = sliderTabs.components) === null || _sliderTabs$component === void 0 ? void 0 : _sliderTabs$component[activeTab]) || props.children)), sliderTabs && /*#__PURE__*/React.createElement("div", {
|
9633
9645
|
className: "sliderTabs ".concat(sliderTabs.direction == 'left' ? "left ".concat(sliderTabs.className || '') : "right ".concat(sliderTabs.className || ''))
|
9634
9646
|
}, sliderTabs.tabs.map(function (item, index) {
|
9635
9647
|
return /*#__PURE__*/React.createElement("div", {
|
9636
9648
|
className: "tab ".concat(index == activeTab ? 'active' : '', " ").concat(sliderTabs.tabClassName || '', " ").concat(sliderTabs.activeTabClassName || '')
|
9637
9649
|
}, /*#__PURE__*/React.createElement("span", {
|
9638
9650
|
onClick: function onClick() {
|
9639
|
-
|
9651
|
+
setActiveTab(index);
|
9652
|
+
sliderTabs.onChange && (sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.onChange(index));
|
9640
9653
|
}
|
9641
9654
|
}, item));
|
9642
9655
|
}))));
|
@@ -10308,7 +10321,7 @@ Modal$1.hidden = function () {
|
|
10308
10321
|
ModalContainer[modelSysbol] && ModalContainer[modelSysbol].hidden();
|
10309
10322
|
};
|
10310
10323
|
|
10311
|
-
var _excluded$g = ["columns", "extraColumns", "search", "visible", "setVisible", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange"];
|
10324
|
+
var _excluded$g = ["columns", "extraColumns", "search", "visible", "setVisible", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild"];
|
10312
10325
|
|
10313
10326
|
var ModalForm = function ModalForm(props, ref) {
|
10314
10327
|
var columns = props.columns,
|
@@ -10322,6 +10335,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10322
10335
|
title = props.title,
|
10323
10336
|
record = props.record,
|
10324
10337
|
onFormChange = props.onFormChange,
|
10338
|
+
formItemChild = props.formItemChild,
|
10325
10339
|
extraProps = _objectWithoutProperties(props, _excluded$g);
|
10326
10340
|
|
10327
10341
|
var formRef = useRef(null);
|
@@ -10448,7 +10462,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10448
10462
|
search: search,
|
10449
10463
|
columns: columns,
|
10450
10464
|
extraColumns: extraColumns
|
10451
|
-
}));
|
10465
|
+
}), title == '查看' && formItemChild ? formItemChild() : null);
|
10452
10466
|
};
|
10453
10467
|
|
10454
10468
|
var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
|
@@ -10528,7 +10542,12 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10528
10542
|
|
10529
10543
|
return modalOnOk;
|
10530
10544
|
}(),
|
10531
|
-
index: index
|
10545
|
+
index: index,
|
10546
|
+
formItemChild: function formItemChild() {
|
10547
|
+
var _item$formItemChild;
|
10548
|
+
|
10549
|
+
return item === null || item === void 0 ? void 0 : (_item$formItemChild = item.formItemChild) === null || _item$formItemChild === void 0 ? void 0 : _item$formItemChild.call(item, record, actionRef, index);
|
10550
|
+
}
|
10532
10551
|
});
|
10533
10552
|
},
|
10534
10553
|
edit: function edit(item, record, index) {
|
@@ -10840,6 +10859,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10840
10859
|
title: modalFormConfig.type || '新增',
|
10841
10860
|
visible: visible,
|
10842
10861
|
record: modalFormConfig.record,
|
10862
|
+
formItemChild: modalFormConfig.formItemChild,
|
10843
10863
|
disabled: modalFormConfig.type == '查看',
|
10844
10864
|
setVisible: setVisible,
|
10845
10865
|
submitMethod: function () {
|
package/dist/index.js
CHANGED
@@ -6818,7 +6818,7 @@ var WCascader = function WCascader(props) {
|
|
6818
6818
|
}, extraProps));
|
6819
6819
|
};
|
6820
6820
|
|
6821
|
-
var _excluded$6 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset"];
|
6821
|
+
var _excluded$6 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm"];
|
6822
6822
|
var RangePicker$2 = Index$5.RangePicker;
|
6823
6823
|
|
6824
6824
|
var WForm = function WForm(props, ref) {
|
@@ -6833,6 +6833,7 @@ var WForm = function WForm(props, ref) {
|
|
6833
6833
|
onFormChange = props.onFormChange,
|
6834
6834
|
onSubmit = props.onSubmit,
|
6835
6835
|
onReset = props.onReset,
|
6836
|
+
setForm = props.setForm,
|
6836
6837
|
extraProps = _objectWithoutProperties(props, _excluded$6);
|
6837
6838
|
|
6838
6839
|
var _Form$useForm = _Form__default['default'].useForm(),
|
@@ -7966,6 +7967,17 @@ var WForm = function WForm(props, ref) {
|
|
7966
7967
|
setFieldsValue: setFieldsValue
|
7967
7968
|
};
|
7968
7969
|
});
|
7970
|
+
React.useEffect(function () {
|
7971
|
+
if (form) {
|
7972
|
+
setForm && setForm(form);
|
7973
|
+
}
|
7974
|
+
|
7975
|
+
return function () {
|
7976
|
+
if (form) {
|
7977
|
+
setForm && setForm(null);
|
7978
|
+
}
|
7979
|
+
};
|
7980
|
+
}, []);
|
7969
7981
|
return /*#__PURE__*/React__default['default'].createElement(_Form__default['default'], _objectSpread2({
|
7970
7982
|
style: {
|
7971
7983
|
marginBottom: '20px',
|
@@ -9653,7 +9665,7 @@ var Index$b = function Index(_ref) {
|
|
9653
9665
|
var _excluded$d = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
|
9654
9666
|
|
9655
9667
|
var Index$c = function Index(_ref, ref) {
|
9656
|
-
var _classNames;
|
9668
|
+
var _classNames, _sliderTabs$component;
|
9657
9669
|
|
9658
9670
|
var title = _ref.title,
|
9659
9671
|
_ref$className = _ref.className,
|
@@ -9688,14 +9700,15 @@ var Index$c = function Index(_ref, ref) {
|
|
9688
9700
|
className: "dot"
|
9689
9701
|
}), title), headerCenter, headerTail) : null, /*#__PURE__*/React__default['default'].createElement("div", {
|
9690
9702
|
className: "body"
|
9691
|
-
}, sliderTabs ? sliderTabs.components[activeTab]
|
9703
|
+
}, (sliderTabs === null || sliderTabs === void 0 ? void 0 : (_sliderTabs$component = sliderTabs.components) === null || _sliderTabs$component === void 0 ? void 0 : _sliderTabs$component[activeTab]) || props.children)), sliderTabs && /*#__PURE__*/React__default['default'].createElement("div", {
|
9692
9704
|
className: "sliderTabs ".concat(sliderTabs.direction == 'left' ? "left ".concat(sliderTabs.className || '') : "right ".concat(sliderTabs.className || ''))
|
9693
9705
|
}, sliderTabs.tabs.map(function (item, index) {
|
9694
9706
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
9695
9707
|
className: "tab ".concat(index == activeTab ? 'active' : '', " ").concat(sliderTabs.tabClassName || '', " ").concat(sliderTabs.activeTabClassName || '')
|
9696
9708
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
9697
9709
|
onClick: function onClick() {
|
9698
|
-
|
9710
|
+
setActiveTab(index);
|
9711
|
+
sliderTabs.onChange && (sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.onChange(index));
|
9699
9712
|
}
|
9700
9713
|
}, item));
|
9701
9714
|
}))));
|
@@ -10367,7 +10380,7 @@ Modal$1.hidden = function () {
|
|
10367
10380
|
ModalContainer[modelSysbol] && ModalContainer[modelSysbol].hidden();
|
10368
10381
|
};
|
10369
10382
|
|
10370
|
-
var _excluded$g = ["columns", "extraColumns", "search", "visible", "setVisible", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange"];
|
10383
|
+
var _excluded$g = ["columns", "extraColumns", "search", "visible", "setVisible", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild"];
|
10371
10384
|
|
10372
10385
|
var ModalForm = function ModalForm(props, ref) {
|
10373
10386
|
var columns = props.columns,
|
@@ -10381,6 +10394,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10381
10394
|
title = props.title,
|
10382
10395
|
record = props.record,
|
10383
10396
|
onFormChange = props.onFormChange,
|
10397
|
+
formItemChild = props.formItemChild,
|
10384
10398
|
extraProps = _objectWithoutProperties(props, _excluded$g);
|
10385
10399
|
|
10386
10400
|
var formRef = React.useRef(null);
|
@@ -10507,7 +10521,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10507
10521
|
search: search,
|
10508
10522
|
columns: columns,
|
10509
10523
|
extraColumns: extraColumns
|
10510
|
-
}));
|
10524
|
+
}), title == '查看' && formItemChild ? formItemChild() : null);
|
10511
10525
|
};
|
10512
10526
|
|
10513
10527
|
var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
|
@@ -10587,7 +10601,12 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10587
10601
|
|
10588
10602
|
return modalOnOk;
|
10589
10603
|
}(),
|
10590
|
-
index: index
|
10604
|
+
index: index,
|
10605
|
+
formItemChild: function formItemChild() {
|
10606
|
+
var _item$formItemChild;
|
10607
|
+
|
10608
|
+
return item === null || item === void 0 ? void 0 : (_item$formItemChild = item.formItemChild) === null || _item$formItemChild === void 0 ? void 0 : _item$formItemChild.call(item, record, actionRef, index);
|
10609
|
+
}
|
10591
10610
|
});
|
10592
10611
|
},
|
10593
10612
|
edit: function edit(item, record, index) {
|
@@ -10899,6 +10918,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10899
10918
|
title: modalFormConfig.type || '新增',
|
10900
10919
|
visible: visible,
|
10901
10920
|
record: modalFormConfig.record,
|
10921
|
+
formItemChild: modalFormConfig.formItemChild,
|
10902
10922
|
disabled: modalFormConfig.type == '查看',
|
10903
10923
|
setVisible: setVisible,
|
10904
10924
|
submitMethod: function () {
|