kts-component-invoice-operate 3.2.141 → 3.2.142

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.
@@ -12,6 +12,8 @@ export interface IStakeholder {
12
12
  isVatNormal?: boolean;
13
13
  /** 是否可以选择自然人 */
14
14
  isNaturalPerson?: boolean;
15
+ /** 是否展开 */
16
+ isExpand?: boolean;
15
17
  }
16
18
  /** 干系人 */
17
19
  declare const _default: React.FunctionComponent<IStakeholder>;
package/dist/index.esm.js CHANGED
@@ -16913,7 +16913,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
16913
16913
  _props$isVatNormal = props.isVatNormal,
16914
16914
  isVatNormal = _props$isVatNormal === void 0 ? false : _props$isVatNormal;
16915
16915
 
16916
- var _React$useState = React.useState(true),
16916
+ var _React$useState = React.useState(typeof props.isExpand === 'boolean' ? props.isExpand : true),
16917
16917
  _React$useState2 = _slicedToArray(_React$useState, 2),
16918
16918
  isExpand = _React$useState2[0],
16919
16919
  setExpand = _React$useState2[1];
@@ -16946,7 +16946,11 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
16946
16946
  if (isReadOnly(field)) return [];
16947
16947
  return rulesMap[field] || defaultRules;
16948
16948
  }, [rulesMap, isReadOnly, isReadOnly]);
16949
- controller.useForm('stakeholder', form);
16949
+ controller.useForm('stakeholder', form); // props.isExpand 变化的时候更新
16950
+
16951
+ React.useEffect(function () {
16952
+ setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
16953
+ }, [props.isExpand]);
16950
16954
  return /*#__PURE__*/React.createElement("div", {
16951
16955
  className: classNames("kts-invoice-operate-invoice-digtal-stakeholder", {
16952
16956
  readOnly: readOnly
package/dist/index.js CHANGED
@@ -16923,7 +16923,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
16923
16923
  _props$isVatNormal = props.isVatNormal,
16924
16924
  isVatNormal = _props$isVatNormal === void 0 ? false : _props$isVatNormal;
16925
16925
 
16926
- var _React$useState = React__default['default'].useState(true),
16926
+ var _React$useState = React__default['default'].useState(typeof props.isExpand === 'boolean' ? props.isExpand : true),
16927
16927
  _React$useState2 = _slicedToArray(_React$useState, 2),
16928
16928
  isExpand = _React$useState2[0],
16929
16929
  setExpand = _React$useState2[1];
@@ -16956,7 +16956,11 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
16956
16956
  if (isReadOnly(field)) return [];
16957
16957
  return rulesMap[field] || defaultRules;
16958
16958
  }, [rulesMap, isReadOnly, isReadOnly]);
16959
- controller.useForm('stakeholder', form);
16959
+ controller.useForm('stakeholder', form); // props.isExpand 变化的时候更新
16960
+
16961
+ React__default['default'].useEffect(function () {
16962
+ setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
16963
+ }, [props.isExpand]);
16960
16964
  return /*#__PURE__*/React__default['default'].createElement("div", {
16961
16965
  className: classNames__default['default']("kts-invoice-operate-invoice-digtal-stakeholder", {
16962
16966
  readOnly: readOnly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.141",
3
+ "version": "3.2.142",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -8,6 +8,7 @@ export default () => {
8
8
  invoiceType='digtal'
9
9
  stakeholder={
10
10
  <Invoice.Stakeholder
11
+ isExpand={false}
11
12
  isShowImportButton={true}
12
13
  onClickImportButton={e => { console.log(e) }}
13
14
  />
@@ -65,6 +65,9 @@ export interface IStakeholder {
65
65
 
66
66
  /** 是否可以选择自然人 */
67
67
  isNaturalPerson?: boolean;
68
+
69
+ /** 是否展开 */
70
+ isExpand?: boolean;
68
71
  }
69
72
 
70
73
  /** 干系人 */
@@ -72,7 +75,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
72
75
 
73
76
  const { form, isShowImportButton, onClickImportButton, isVatNormal = false } = props;
74
77
 
75
- const [isExpand, setExpand] = React.useState(true);
78
+ const [isExpand, setExpand] = React.useState(typeof props.isExpand === 'boolean' ? props.isExpand : true);
76
79
 
77
80
  const { getFieldDecorator } = form;
78
81
 
@@ -101,6 +104,11 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
101
104
 
102
105
  controller.useForm('stakeholder', form);
103
106
 
107
+ // props.isExpand 变化的时候更新
108
+ React.useEffect(() => {
109
+ setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
110
+ }, [props.isExpand])
111
+
104
112
  return (
105
113
  <div className={classNames("kts-invoice-operate-invoice-digtal-stakeholder", { readOnly: readOnly })} >
106
114
  <div>