assui 2.0.31 → 2.0.35
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/es/button-modal/index.d.ts +3 -3
- package/es/button-modal/index.js +4 -4
- package/es/number-input/index.d.ts +5 -9
- package/es/number-input/index.js +9 -10
- package/lib/button-modal/index.d.ts +3 -3
- package/lib/button-modal/index.js +4 -4
- package/lib/number-input/index.d.ts +5 -9
- package/lib/number-input/index.js +11 -9
- package/package.json +3 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { ModalProps } from 'antd/es/modal';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ModalAction {
|
|
4
4
|
open: () => void;
|
|
5
5
|
close: () => void;
|
|
6
6
|
}
|
|
7
7
|
export interface ButtonModalProps extends ModalProps {
|
|
8
|
-
content: React.ReactElement;
|
|
9
|
-
children: React.ReactElement;
|
|
10
8
|
onClose?: () => void;
|
|
11
9
|
onOpen?: () => void;
|
|
10
|
+
trigger: React.ReactElement;
|
|
11
|
+
children: React.ReactElement;
|
|
12
12
|
}
|
|
13
13
|
declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<ButtonModalProps & React.RefAttributes<unknown>>;
|
|
14
14
|
export default ForwardRefButtonModal;
|
package/es/button-modal/index.js
CHANGED
|
@@ -63,12 +63,12 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
63
63
|
setModalVisible = _a[1];
|
|
64
64
|
|
|
65
65
|
var children = props.children,
|
|
66
|
-
|
|
66
|
+
trigger = props.trigger,
|
|
67
67
|
onOpen = props.onOpen,
|
|
68
68
|
onClose = props.onClose,
|
|
69
69
|
onOk = props.onOk,
|
|
70
70
|
onCancel = props.onCancel,
|
|
71
|
-
restModalProps = __rest(props, ["children", "
|
|
71
|
+
restModalProps = __rest(props, ["children", "trigger", "onOpen", "onClose", "onOk", "onCancel"]);
|
|
72
72
|
|
|
73
73
|
var openModal = function openModal() {
|
|
74
74
|
if (onOpen) {
|
|
@@ -111,7 +111,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
111
111
|
closeModal();
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
var buttonNode =
|
|
114
|
+
var buttonNode = trigger && /*#__PURE__*/React.cloneElement(trigger, {
|
|
115
115
|
onClick: openModal
|
|
116
116
|
});
|
|
117
117
|
return /*#__PURE__*/React.createElement(React.Fragment, null, buttonNode, /*#__PURE__*/React.createElement(Modal, __assign({
|
|
@@ -120,7 +120,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
120
120
|
onCancel: handleModalCancel,
|
|
121
121
|
centered: true,
|
|
122
122
|
maskClosable: false
|
|
123
|
-
}, restModalProps), /*#__PURE__*/React.cloneElement(
|
|
123
|
+
}, restModalProps), /*#__PURE__*/React.cloneElement(children, {
|
|
124
124
|
modalAction: modalActionRef.current
|
|
125
125
|
})));
|
|
126
126
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { InputProps } from 'antd/es/input';
|
|
3
|
+
import Input from 'antd/es/input';
|
|
2
4
|
import * as numberTypeEnum from './const/numberType';
|
|
3
|
-
export interface NumberInputProps {
|
|
5
|
+
export interface NumberInputProps extends Omit<InputProps, 'onChange' | 'onBlur'> {
|
|
4
6
|
/** 输入框的内容 */
|
|
5
7
|
value?: string | number;
|
|
6
8
|
/** 输入数据的类型 */
|
|
@@ -32,12 +34,6 @@ export interface NumberInputProps {
|
|
|
32
34
|
/** 可以点击清除图标删除内容 */
|
|
33
35
|
allowClear?: boolean;
|
|
34
36
|
}
|
|
35
|
-
declare const NumberInput:
|
|
36
|
-
|
|
37
|
-
defaultProps: {
|
|
38
|
-
numberType: string;
|
|
39
|
-
enableMinus: boolean;
|
|
40
|
-
};
|
|
41
|
-
numberType: typeof numberTypeEnum;
|
|
42
|
-
};
|
|
37
|
+
declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<Input | null>>;
|
|
38
|
+
export { numberTypeEnum };
|
|
43
39
|
export default NumberInput;
|
package/es/number-input/index.js
CHANGED
|
@@ -59,11 +59,11 @@ import Input from 'antd/es/input';
|
|
|
59
59
|
import isUndefined from 'lodash/isUndefined';
|
|
60
60
|
import * as numberTypeEnum from './const/numberType';
|
|
61
61
|
import { filterInt, filterFloat } from './utils';
|
|
62
|
-
|
|
63
|
-
var NumberInput = function NumberInput(props) {
|
|
62
|
+
var NumberInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
64
63
|
var value = props.value,
|
|
65
64
|
onChange = props.onChange,
|
|
66
|
-
|
|
65
|
+
_a = props.numberType,
|
|
66
|
+
numberType = _a === void 0 ? numberTypeEnum.INT : _a,
|
|
67
67
|
precision = props.precision,
|
|
68
68
|
formatter = props.formatter,
|
|
69
69
|
parser = props.parser,
|
|
@@ -72,9 +72,9 @@ var NumberInput = function NumberInput(props) {
|
|
|
72
72
|
maxLength = props.maxLength,
|
|
73
73
|
restProps = __rest(props, ["value", "onChange", "numberType", "precision", "formatter", "parser", "enableMinus", "onBlur", "maxLength"]);
|
|
74
74
|
|
|
75
|
-
var
|
|
76
|
-
inputValue =
|
|
77
|
-
setInputValue =
|
|
75
|
+
var _b = __read(React.useState(''), 2),
|
|
76
|
+
inputValue = _b[0],
|
|
77
|
+
setInputValue = _b[1];
|
|
78
78
|
|
|
79
79
|
var resultValue = isUndefined(value) ? inputValue : value;
|
|
80
80
|
|
|
@@ -131,16 +131,15 @@ var NumberInput = function NumberInput(props) {
|
|
|
131
131
|
var finallyValue = formatter ? formatter("" + resultValue) : resultValue;
|
|
132
132
|
return /*#__PURE__*/React.createElement(Input, __assign({
|
|
133
133
|
type: "text",
|
|
134
|
+
ref: ref,
|
|
134
135
|
value: finallyValue,
|
|
135
136
|
onBlur: onNumberBlur,
|
|
136
137
|
onChange: onNumberChange,
|
|
137
138
|
maxLength: maxLength
|
|
138
139
|
}, restProps));
|
|
139
|
-
};
|
|
140
|
-
|
|
140
|
+
});
|
|
141
141
|
NumberInput.defaultProps = {
|
|
142
|
-
numberType: numberTypeEnum.INT,
|
|
143
142
|
enableMinus: false
|
|
144
143
|
};
|
|
145
|
-
|
|
144
|
+
export { numberTypeEnum };
|
|
146
145
|
export default NumberInput;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { ModalProps } from 'antd/es/modal';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ModalAction {
|
|
4
4
|
open: () => void;
|
|
5
5
|
close: () => void;
|
|
6
6
|
}
|
|
7
7
|
export interface ButtonModalProps extends ModalProps {
|
|
8
|
-
content: React.ReactElement;
|
|
9
|
-
children: React.ReactElement;
|
|
10
8
|
onClose?: () => void;
|
|
11
9
|
onOpen?: () => void;
|
|
10
|
+
trigger: React.ReactElement;
|
|
11
|
+
children: React.ReactElement;
|
|
12
12
|
}
|
|
13
13
|
declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<ButtonModalProps & React.RefAttributes<unknown>>;
|
|
14
14
|
export default ForwardRefButtonModal;
|
|
@@ -110,12 +110,12 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
110
110
|
setModalVisible = _a[1];
|
|
111
111
|
|
|
112
112
|
var children = props.children,
|
|
113
|
-
|
|
113
|
+
trigger = props.trigger,
|
|
114
114
|
onOpen = props.onOpen,
|
|
115
115
|
onClose = props.onClose,
|
|
116
116
|
onOk = props.onOk,
|
|
117
117
|
onCancel = props.onCancel,
|
|
118
|
-
restModalProps = __rest(props, ["children", "
|
|
118
|
+
restModalProps = __rest(props, ["children", "trigger", "onOpen", "onClose", "onOk", "onCancel"]);
|
|
119
119
|
|
|
120
120
|
var openModal = function openModal() {
|
|
121
121
|
if (onOpen) {
|
|
@@ -158,7 +158,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
158
158
|
closeModal();
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
var buttonNode =
|
|
161
|
+
var buttonNode = trigger && React.cloneElement(trigger, {
|
|
162
162
|
onClick: openModal
|
|
163
163
|
});
|
|
164
164
|
return React.createElement(React.Fragment, null, buttonNode, React.createElement(modal_1["default"], __assign({
|
|
@@ -167,7 +167,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
167
167
|
onCancel: handleModalCancel,
|
|
168
168
|
centered: true,
|
|
169
169
|
maskClosable: false
|
|
170
|
-
}, restModalProps), React.cloneElement(
|
|
170
|
+
}, restModalProps), React.cloneElement(children, {
|
|
171
171
|
modalAction: modalActionRef.current
|
|
172
172
|
})));
|
|
173
173
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { InputProps } from 'antd/es/input';
|
|
3
|
+
import Input from 'antd/es/input';
|
|
2
4
|
import * as numberTypeEnum from './const/numberType';
|
|
3
|
-
export interface NumberInputProps {
|
|
5
|
+
export interface NumberInputProps extends Omit<InputProps, 'onChange' | 'onBlur'> {
|
|
4
6
|
/** 输入框的内容 */
|
|
5
7
|
value?: string | number;
|
|
6
8
|
/** 输入数据的类型 */
|
|
@@ -32,12 +34,6 @@ export interface NumberInputProps {
|
|
|
32
34
|
/** 可以点击清除图标删除内容 */
|
|
33
35
|
allowClear?: boolean;
|
|
34
36
|
}
|
|
35
|
-
declare const NumberInput:
|
|
36
|
-
|
|
37
|
-
defaultProps: {
|
|
38
|
-
numberType: string;
|
|
39
|
-
enableMinus: boolean;
|
|
40
|
-
};
|
|
41
|
-
numberType: typeof numberTypeEnum;
|
|
42
|
-
};
|
|
37
|
+
declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<Input | null>>;
|
|
38
|
+
export { numberTypeEnum };
|
|
43
39
|
export default NumberInput;
|
|
@@ -99,6 +99,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
|
|
|
99
99
|
Object.defineProperty(exports, "__esModule", {
|
|
100
100
|
value: true
|
|
101
101
|
});
|
|
102
|
+
exports.numberTypeEnum = void 0;
|
|
102
103
|
|
|
103
104
|
var React = __importStar(require("react"));
|
|
104
105
|
|
|
@@ -108,12 +109,15 @@ var isUndefined_1 = __importDefault(require("lodash/isUndefined"));
|
|
|
108
109
|
|
|
109
110
|
var numberTypeEnum = __importStar(require("./const/numberType"));
|
|
110
111
|
|
|
112
|
+
exports.numberTypeEnum = numberTypeEnum;
|
|
113
|
+
|
|
111
114
|
var utils_1 = require("./utils");
|
|
112
115
|
|
|
113
|
-
var NumberInput = function
|
|
116
|
+
var NumberInput = React.forwardRef(function (props, ref) {
|
|
114
117
|
var value = props.value,
|
|
115
118
|
onChange = props.onChange,
|
|
116
|
-
|
|
119
|
+
_a = props.numberType,
|
|
120
|
+
numberType = _a === void 0 ? numberTypeEnum.INT : _a,
|
|
117
121
|
precision = props.precision,
|
|
118
122
|
formatter = props.formatter,
|
|
119
123
|
parser = props.parser,
|
|
@@ -122,9 +126,9 @@ var NumberInput = function NumberInput(props) {
|
|
|
122
126
|
maxLength = props.maxLength,
|
|
123
127
|
restProps = __rest(props, ["value", "onChange", "numberType", "precision", "formatter", "parser", "enableMinus", "onBlur", "maxLength"]);
|
|
124
128
|
|
|
125
|
-
var
|
|
126
|
-
inputValue =
|
|
127
|
-
setInputValue =
|
|
129
|
+
var _b = __read(React.useState(''), 2),
|
|
130
|
+
inputValue = _b[0],
|
|
131
|
+
setInputValue = _b[1];
|
|
128
132
|
|
|
129
133
|
var resultValue = isUndefined_1["default"](value) ? inputValue : value;
|
|
130
134
|
|
|
@@ -181,16 +185,14 @@ var NumberInput = function NumberInput(props) {
|
|
|
181
185
|
var finallyValue = formatter ? formatter("" + resultValue) : resultValue;
|
|
182
186
|
return React.createElement(input_1["default"], __assign({
|
|
183
187
|
type: "text",
|
|
188
|
+
ref: ref,
|
|
184
189
|
value: finallyValue,
|
|
185
190
|
onBlur: onNumberBlur,
|
|
186
191
|
onChange: onNumberChange,
|
|
187
192
|
maxLength: maxLength
|
|
188
193
|
}, restProps));
|
|
189
|
-
};
|
|
190
|
-
|
|
194
|
+
});
|
|
191
195
|
NumberInput.defaultProps = {
|
|
192
|
-
numberType: numberTypeEnum.INT,
|
|
193
196
|
enableMinus: false
|
|
194
197
|
};
|
|
195
|
-
NumberInput.numberType = numberTypeEnum;
|
|
196
198
|
exports["default"] = NumberInput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.35",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@ahooksjs/use-url-state": "^2.5.8",
|
|
34
34
|
"@tinymce/tinymce-react": "^3.13.0",
|
|
35
35
|
"@types/react-beautiful-dnd": "^13.1.2",
|
|
36
|
-
"a-icons": "^1.0.
|
|
36
|
+
"a-icons": "^1.0.21",
|
|
37
37
|
"ahooks": "^2.10.9",
|
|
38
38
|
"bignumber.js": "^9.0.1",
|
|
39
39
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"node": ">=10.0.0"
|
|
70
70
|
},
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "6eb441eccabca51e9bd9c3c04cae5a3c5e30d8e2"
|
|
73
73
|
}
|