@cqsjjb/jjb-react-admin-component 3.1.2 → 3.1.4

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.
@@ -119,6 +119,7 @@ function ItemRender(props) {
119
119
  : /*#__PURE__*/React.createElement(RenderText, {
120
120
  name: data.name,
121
121
  value: data.value,
122
+ maxTagCount: props.maxTagCount,
122
123
  renderItemText: props.renderItemText
123
124
  }), /*#__PURE__*/React.createElement(Modal, {
124
125
  destroyOnClose: true,
@@ -140,7 +141,8 @@ function ItemRender(props) {
140
141
  }
141
142
  function RenderText(props) {
142
143
  const {
143
- value
144
+ value,
145
+ maxTagCount = 1
144
146
  } = props;
145
147
  const [text, setText] = React.useState();
146
148
  const [options, setOptions] = React.useState([]);
@@ -181,7 +183,7 @@ function RenderText(props) {
181
183
  variant: "borderless",
182
184
  treeData: options,
183
185
  showSearch: false,
184
- maxTagCount: 1
186
+ maxTagCount: maxTagCount
185
187
  }))) : props.renderItemText ? props.renderItemText({
186
188
  text,
187
189
  name: props.name
@@ -43,6 +43,11 @@ interface SearchFormProps extends ComponentProps {
43
43
  * @description 重置 按钮触发
44
44
  */
45
45
  onReset?: (values: { [ p: string ]: any }) => void;
46
+ /**
47
+ * @description 展开/收起事件
48
+ * @param open 展开/收起状态
49
+ */
50
+ onExpand?: (open: boolean) => void;
46
51
  }
47
52
 
48
53
  interface SearchFormFc extends React.FC<SearchFormProps> {
@@ -15,7 +15,8 @@ class searchForm extends React.Component {
15
15
  formLine,
16
16
  colSize,
17
17
  loading,
18
- onReset
18
+ onReset,
19
+ onExpand
19
20
  } = this.props;
20
21
  return /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
21
22
  type: "primary",
@@ -35,9 +36,14 @@ class searchForm extends React.Component {
35
36
  transform: this.state.isOpen ? 'rotate(-90deg)' : 'rotate(90deg)'
36
37
  }
37
38
  }),
38
- onClick: () => this.setState({
39
- isOpen: !this.state.isOpen
40
- })
39
+ onClick: () => {
40
+ const open = !this.state.isOpen;
41
+ this.setState({
42
+ isOpen: open
43
+ }, () => {
44
+ onExpand && onExpand(open);
45
+ });
46
+ }
41
47
  }, this.state.isOpen ? '收起' : '展开'));
42
48
  }
43
49
  groupsList() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqsjjb/jjb-react-admin-component",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "jjb-react-admin-组件库@new",
5
5
  "main": "index.js",
6
6
  "author": "jjb-front-team",