assui 2.0.131 → 2.0.134

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.
@@ -8,7 +8,7 @@ export interface ButtonModalProps extends ModalProps {
8
8
  onClose?: () => void;
9
9
  onOpen?: () => void;
10
10
  trigger?: React.ReactElement;
11
- children: React.ReactElement;
11
+ children: ((v: ModalAction) => React.ReactElement) | React.ReactElement;
12
12
  }
13
13
  declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<ButtonModalProps & React.RefAttributes<unknown>>;
14
14
  export default ForwardRefButtonModal;
@@ -55,6 +55,7 @@ var __read = this && this.__read || function (o, n) {
55
55
  };
56
56
 
57
57
  import * as React from 'react';
58
+ import isFunction from 'lodash/isFunction';
58
59
  import Modal from 'antd/lib/modal';
59
60
 
60
61
  var ButtonModal = function ButtonModal(props, ref) {
@@ -120,7 +121,7 @@ var ButtonModal = function ButtonModal(props, ref) {
120
121
  onCancel: handleModalCancel,
121
122
  centered: true,
122
123
  maskClosable: false
123
- }, restModalProps), /*#__PURE__*/React.cloneElement(children, {
124
+ }, restModalProps), isFunction(children) ? children(modalActionRef.current) : /*#__PURE__*/React.cloneElement(children, {
124
125
  modalAction: modalActionRef.current
125
126
  })));
126
127
  };
@@ -44,7 +44,7 @@ var __read = this && this.__read || function (o, n) {
44
44
  import React from 'react';
45
45
  import useControllableValue from 'ahooks/lib/useControllableValue';
46
46
  import Select from 'antd/lib/select';
47
- import isUndefined from 'lodash/isUndefined';
47
+ import { isUndefined, isNull } from 'lodash';
48
48
  import classNames from 'classnames';
49
49
  import ArrowDropDownFilled from 'a-icons/lib/ArrowDropDownFilled';
50
50
  import omit from 'lodash/omit';
@@ -88,7 +88,7 @@ var LabelSelect = function LabelSelect(props) {
88
88
  return /*#__PURE__*/React.createElement("div", {
89
89
  className: classNames({
90
90
  'label-select': true,
91
- 'label-select-label-scale': open || !isUndefined(value)
91
+ 'label-select-label-scale': open || !isUndefined(value) && !isNull(value)
92
92
  }, className)
93
93
  }, /*#__PURE__*/React.createElement(Select, __assign({}, omit(props, ['open', 'onChange', 'className', 'label']), {
94
94
  open: open,
@@ -8,7 +8,7 @@ export interface ButtonModalProps extends ModalProps {
8
8
  onClose?: () => void;
9
9
  onOpen?: () => void;
10
10
  trigger?: React.ReactElement;
11
- children: React.ReactElement;
11
+ children: ((v: ModalAction) => React.ReactElement) | React.ReactElement;
12
12
  }
13
13
  declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<ButtonModalProps & React.RefAttributes<unknown>>;
14
14
  export default ForwardRefButtonModal;
@@ -102,6 +102,8 @@ Object.defineProperty(exports, "__esModule", {
102
102
 
103
103
  var React = __importStar(require("react"));
104
104
 
105
+ var isFunction_1 = __importDefault(require("lodash/isFunction"));
106
+
105
107
  var modal_1 = __importDefault(require("antd/lib/modal"));
106
108
 
107
109
  var ButtonModal = function ButtonModal(props, ref) {
@@ -167,7 +169,7 @@ var ButtonModal = function ButtonModal(props, ref) {
167
169
  onCancel: handleModalCancel,
168
170
  centered: true,
169
171
  maskClosable: false
170
- }, restModalProps), React.cloneElement(children, {
172
+ }, restModalProps), isFunction_1["default"](children) ? children(modalActionRef.current) : React.cloneElement(children, {
171
173
  modalAction: modalActionRef.current
172
174
  })));
173
175
  };
@@ -60,7 +60,7 @@ var useControllableValue_1 = __importDefault(require("ahooks/lib/useControllable
60
60
 
61
61
  var select_1 = __importDefault(require("antd/lib/select"));
62
62
 
63
- var isUndefined_1 = __importDefault(require("lodash/isUndefined"));
63
+ var lodash_1 = require("lodash");
64
64
 
65
65
  var classnames_1 = __importDefault(require("classnames"));
66
66
 
@@ -108,7 +108,7 @@ var LabelSelect = function LabelSelect(props) {
108
108
  return react_1["default"].createElement("div", {
109
109
  className: classnames_1["default"]({
110
110
  'label-select': true,
111
- 'label-select-label-scale': open || !isUndefined_1["default"](value)
111
+ 'label-select-label-scale': open || !lodash_1.isUndefined(value) && !lodash_1.isNull(value)
112
112
  }, className)
113
113
  }, react_1["default"].createElement(select_1["default"], __assign({}, omit_1["default"](props, ['open', 'onChange', 'className', 'label']), {
114
114
  open: open,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "2.0.131",
3
+ "version": "2.0.134",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -69,5 +69,5 @@
69
69
  "node": ">=10.0.0"
70
70
  },
71
71
  "license": "MIT",
72
- "gitHead": "24278cb26a1eec3b033e3fa024b730ca954b4eb3"
72
+ "gitHead": "21adc6130fe9c1d23370896f7b10f1c54a9baf22"
73
73
  }