assui 2.3.9 → 3.0.1
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/a-select/index.js +7 -22
- package/es/a-select/style/index.css +195 -743
- package/es/area-text/index.js +1 -3
- package/es/button-drawer/index.js +12 -30
- package/es/button-modal/index.js +12 -33
- package/es/color-select/index.js +10 -23
- package/es/color-select/style/index.css +195 -743
- package/es/condition-input/index.js +8 -26
- package/es/condition-input/parse2RegexOption.js +0 -11
- package/es/config-provider/index.js +1 -3
- package/es/copy-to-clipboard/index.js +11 -27
- package/es/copy-to-clipboard/style/index.css +0 -1
- package/es/highlight-textarea/HighlighedContents.js +1 -3
- package/es/highlight-textarea/extractSpansOfClasses.d.ts +1 -0
- package/es/highlight-textarea/extractSpansOfClasses.js +7 -29
- package/es/highlight-textarea/getRanges.js +3 -35
- package/es/highlight-textarea/getType.js +0 -6
- package/es/highlight-textarea/index.js +11 -30
- package/es/highlight-textarea/style/index.css +7 -21
- package/es/img-crop/EasyCrop.js +18 -34
- package/es/img-crop/getCroppedImg.js +15 -50
- package/es/img-crop/index.js +56 -145
- package/es/img-crop/style/index.css +195 -743
- package/es/json-editor/index.js +6 -20
- package/es/keep-tab/index.d.ts +7 -4
- package/es/keep-tab/index.js +34 -59
- package/es/keep-tab/style/index.css +39 -99
- package/es/label-auto-complete/index.js +14 -32
- package/es/label-auto-complete/style/index.css +195 -743
- package/es/label-condition-input/index.js +13 -29
- package/es/label-customize-range-picker/defaultRadioList.js +0 -3
- package/es/label-customize-range-picker/index.js +36 -78
- package/es/label-customize-range-picker/style/index.css +195 -743
- package/es/label-customize-range-picker/utils/index.js +5 -14
- package/es/label-date-picker/index.js +11 -28
- package/es/label-date-picker/style/index.css +195 -743
- package/es/label-input/index.js +23 -37
- package/es/label-number-input/index.js +13 -28
- package/es/label-range-picker/index.js +11 -28
- package/es/label-range-picker/style/index.css +195 -743
- package/es/label-select/index.js +11 -27
- package/es/label-select/style/index.css +195 -743
- package/es/label-text-area/index.js +13 -35
- package/es/label-tree-select/index.js +15 -32
- package/es/label-tree-select/style/index.css +195 -743
- package/es/number-format-input/index.js +1 -11
- package/es/number-input/index.js +18 -37
- package/es/number-input/utils.js +7 -15
- package/es/rc-echart/core.js +15 -27
- package/es/rc-echart/index.js +0 -6
- package/es/rc-qrcode/index.js +2 -12
- package/es/rc-qrcode/useQrcode.js +5 -12
- package/es/rich-text-editor/index.js +5 -16
- package/es/rich-text-editor/plugins/code/index.js +0 -8
- package/es/rich-text-editor/style/index.css +195 -743
- package/es/single-img-upload/index.js +36 -110
- package/es/single-img-upload/style/index.css +195 -743
- package/es/split-pane/index.js +0 -4
- package/es/step-number-input/index.js +14 -39
- package/es/step-number-input/style/index.css +195 -743
- package/es/table-col/index.js +2 -4
- package/es/text-area/index.js +8 -27
- package/es/text-input/index.js +4 -18
- package/es/text-input/style/index.css +7 -21
- package/lib/a-select/index.js +7 -27
- package/lib/a-select/style/index.css +195 -743
- package/lib/a-select/style/index.js +0 -2
- package/lib/area-text/index.js +1 -6
- package/lib/area-text/style/index.js +0 -1
- package/lib/beautiful-dnd/index.js +0 -9
- package/lib/button-drawer/index.js +12 -42
- package/lib/button-drawer/style/index.js +0 -1
- package/lib/button-modal/index.js +12 -44
- package/lib/button-modal/style/index.js +0 -1
- package/lib/color-select/index.js +10 -39
- package/lib/color-select/style/index.css +195 -743
- package/lib/color-select/style/index.js +0 -2
- package/lib/condition-input/index.js +8 -41
- package/lib/condition-input/parse2RegexOption.js +0 -16
- package/lib/condition-input/style/index.js +0 -1
- package/lib/config-provider/context.js +0 -4
- package/lib/config-provider/index.js +1 -28
- package/lib/copy-to-clipboard/index.js +11 -38
- package/lib/copy-to-clipboard/style/index.css +0 -1
- package/lib/copy-to-clipboard/style/index.js +0 -1
- package/lib/highlight-textarea/HighlighedContents.js +1 -7
- package/lib/highlight-textarea/extractSpansOfClasses.d.ts +1 -0
- package/lib/highlight-textarea/extractSpansOfClasses.js +7 -31
- package/lib/highlight-textarea/getRanges.js +3 -38
- package/lib/highlight-textarea/getType.js +0 -8
- package/lib/highlight-textarea/index.js +11 -44
- package/lib/highlight-textarea/style/index.css +7 -21
- package/lib/highlight-textarea/style/index.js +0 -1
- package/lib/highlight-words/index.js +0 -3
- package/lib/img-crop/EasyCrop.js +18 -44
- package/lib/img-crop/getCroppedImg.js +15 -51
- package/lib/img-crop/index.js +56 -159
- package/lib/img-crop/style/index.css +195 -743
- package/lib/img-crop/style/index.js +0 -3
- package/lib/index.js +0 -77
- package/lib/json-editor/index.js +6 -35
- package/lib/json-editor/style/index.js +0 -2
- package/lib/keep-tab/index.d.ts +7 -4
- package/lib/keep-tab/index.js +34 -76
- package/lib/keep-tab/style/index.css +39 -99
- package/lib/keep-tab/style/index.js +0 -2
- package/lib/label-auto-complete/index.js +14 -39
- package/lib/label-auto-complete/style/index.css +195 -743
- package/lib/label-auto-complete/style/index.js +0 -2
- package/lib/label-condition-input/index.js +13 -36
- package/lib/label-condition-input/style/index.js +0 -1
- package/lib/label-customize-range-picker/defaultRadioList.js +0 -7
- package/lib/label-customize-range-picker/index.js +36 -99
- package/lib/label-customize-range-picker/style/index.css +195 -743
- package/lib/label-customize-range-picker/style/index.js +0 -5
- package/lib/label-customize-range-picker/utils/index.js +5 -19
- package/lib/label-date-picker/index.js +11 -34
- package/lib/label-date-picker/style/index.css +195 -743
- package/lib/label-date-picker/style/index.js +0 -2
- package/lib/label-input/index.js +23 -46
- package/lib/label-input/style/index.js +0 -1
- package/lib/label-number-input/index.js +13 -36
- package/lib/label-number-input/style/index.js +0 -1
- package/lib/label-range-picker/index.js +11 -36
- package/lib/label-range-picker/style/index.css +195 -743
- package/lib/label-range-picker/style/index.js +0 -2
- package/lib/label-select/index.js +11 -36
- package/lib/label-select/style/index.css +195 -743
- package/lib/label-select/style/index.js +0 -2
- package/lib/label-text-area/index.js +13 -40
- package/lib/label-text-area/style/index.js +0 -1
- package/lib/label-tree-select/index.js +15 -38
- package/lib/label-tree-select/style/index.css +195 -743
- package/lib/label-tree-select/style/index.js +0 -2
- package/lib/messages/index.js +0 -2
- package/lib/number-format-input/index.js +1 -15
- package/lib/number-format-input/style/index.js +0 -1
- package/lib/number-input/index.js +18 -55
- package/lib/number-input/style/index.js +0 -1
- package/lib/number-input/utils.js +8 -20
- package/lib/rc-echart/core.js +15 -40
- package/lib/rc-echart/index.js +0 -17
- package/lib/rc-motion/index.js +0 -3
- package/lib/rc-qrcode/index.js +2 -25
- package/lib/rc-qrcode/useQrcode.js +5 -17
- package/lib/rc-transition-group/index.js +0 -9
- package/lib/resizable/index.js +0 -2
- package/lib/resizable/style/index.js +0 -1
- package/lib/rich-text-editor/index.js +5 -53
- package/lib/rich-text-editor/plugins/code/index.js +2 -12
- package/lib/rich-text-editor/style/index.css +195 -743
- package/lib/rich-text-editor/style/index.js +0 -1
- package/lib/single-img-upload/index.js +36 -125
- package/lib/single-img-upload/style/index.css +195 -743
- package/lib/single-img-upload/style/index.js +0 -3
- package/lib/sortable-hoc/index.js +0 -9
- package/lib/split-pane/index.js +0 -15
- package/lib/split-pane/style/index.js +0 -1
- package/lib/step-number-input/index.js +14 -55
- package/lib/step-number-input/style/index.css +195 -743
- package/lib/step-number-input/style/index.js +0 -2
- package/lib/table-col/index.js +2 -6
- package/lib/text-area/index.js +8 -38
- package/lib/text-area/style/index.js +0 -1
- package/lib/text-input/index.js +4 -23
- package/lib/text-input/style/index.css +7 -21
- package/lib/text-input/style/index.js +0 -1
- package/package.json +6 -6
package/lib/messages/index.js
CHANGED
|
@@ -4,54 +4,40 @@ var __assign = this && this.__assign || function () {
|
|
|
4
4
|
__assign = Object.assign || function (t) {
|
|
5
5
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
6
|
s = arguments[i];
|
|
7
|
-
|
|
8
7
|
for (var p in s) {
|
|
9
8
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
return t;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
return __assign.apply(this, arguments);
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
var __rest = this && this.__rest || function (s, e) {
|
|
20
16
|
var t = {};
|
|
21
|
-
|
|
22
17
|
for (var p in s) {
|
|
23
18
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
21
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
28
22
|
}
|
|
29
23
|
return t;
|
|
30
24
|
};
|
|
31
|
-
|
|
32
25
|
var __importDefault = this && this.__importDefault || function (mod) {
|
|
33
26
|
return mod && mod.__esModule ? mod : {
|
|
34
27
|
"default": mod
|
|
35
28
|
};
|
|
36
29
|
};
|
|
37
|
-
|
|
38
30
|
Object.defineProperty(exports, "__esModule", {
|
|
39
31
|
value: true
|
|
40
32
|
});
|
|
41
|
-
|
|
42
33
|
var react_1 = __importDefault(require("react"));
|
|
43
|
-
|
|
44
34
|
var react_number_format_1 = __importDefault(require("react-number-format"));
|
|
45
|
-
|
|
46
35
|
var classnames_1 = __importDefault(require("classnames"));
|
|
47
|
-
|
|
48
36
|
var NumberFormatInput = function NumberFormatInput(_a) {
|
|
49
37
|
var className = _a.className,
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
restProps = __rest(_a, ["className"]);
|
|
52
39
|
return react_1["default"].createElement(react_number_format_1["default"], __assign({}, restProps, {
|
|
53
40
|
className: (0, classnames_1["default"])('rc-number-format-input', className)
|
|
54
41
|
}));
|
|
55
42
|
};
|
|
56
|
-
|
|
57
43
|
exports["default"] = NumberFormatInput;
|
|
@@ -4,22 +4,17 @@ var __assign = this && this.__assign || function () {
|
|
|
4
4
|
__assign = Object.assign || function (t) {
|
|
5
5
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
6
|
s = arguments[i];
|
|
7
|
-
|
|
8
7
|
for (var p in s) {
|
|
9
8
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
return t;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
return __assign.apply(this, arguments);
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
20
16
|
if (k2 === undefined) k2 = k;
|
|
21
17
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
22
|
-
|
|
23
18
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
19
|
desc = {
|
|
25
20
|
enumerable: true,
|
|
@@ -28,13 +23,11 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
28
23
|
}
|
|
29
24
|
};
|
|
30
25
|
}
|
|
31
|
-
|
|
32
26
|
Object.defineProperty(o, k2, desc);
|
|
33
27
|
} : function (o, m, k, k2) {
|
|
34
28
|
if (k2 === undefined) k2 = k;
|
|
35
29
|
o[k2] = m[k];
|
|
36
30
|
});
|
|
37
|
-
|
|
38
31
|
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
39
32
|
Object.defineProperty(o, "default", {
|
|
40
33
|
enumerable: true,
|
|
@@ -43,40 +36,32 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun
|
|
|
43
36
|
} : function (o, v) {
|
|
44
37
|
o["default"] = v;
|
|
45
38
|
});
|
|
46
|
-
|
|
47
39
|
var __importStar = this && this.__importStar || function (mod) {
|
|
48
40
|
if (mod && mod.__esModule) return mod;
|
|
49
41
|
var result = {};
|
|
50
42
|
if (mod != null) for (var k in mod) {
|
|
51
43
|
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
52
44
|
}
|
|
53
|
-
|
|
54
45
|
__setModuleDefault(result, mod);
|
|
55
|
-
|
|
56
46
|
return result;
|
|
57
47
|
};
|
|
58
|
-
|
|
59
48
|
var __rest = this && this.__rest || function (s, e) {
|
|
60
49
|
var t = {};
|
|
61
|
-
|
|
62
50
|
for (var p in s) {
|
|
63
51
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
64
52
|
}
|
|
65
|
-
|
|
66
53
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
67
54
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
68
55
|
}
|
|
69
56
|
return t;
|
|
70
57
|
};
|
|
71
|
-
|
|
72
58
|
var __read = this && this.__read || function (o, n) {
|
|
73
59
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
74
60
|
if (!m) return o;
|
|
75
61
|
var i = m.call(o),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
62
|
+
r,
|
|
63
|
+
ar = [],
|
|
64
|
+
e;
|
|
80
65
|
try {
|
|
81
66
|
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
82
67
|
ar.push(r.value);
|
|
@@ -92,63 +77,47 @@ var __read = this && this.__read || function (o, n) {
|
|
|
92
77
|
if (e) throw e.error;
|
|
93
78
|
}
|
|
94
79
|
}
|
|
95
|
-
|
|
96
80
|
return ar;
|
|
97
81
|
};
|
|
98
|
-
|
|
99
82
|
var __importDefault = this && this.__importDefault || function (mod) {
|
|
100
83
|
return mod && mod.__esModule ? mod : {
|
|
101
84
|
"default": mod
|
|
102
85
|
};
|
|
103
86
|
};
|
|
104
|
-
|
|
105
87
|
Object.defineProperty(exports, "__esModule", {
|
|
106
88
|
value: true
|
|
107
89
|
});
|
|
108
90
|
exports.dataTypeEnum = exports.numberTypeEnum = void 0;
|
|
109
|
-
|
|
110
91
|
var React = __importStar(require("react"));
|
|
111
|
-
|
|
112
92
|
var input_1 = __importDefault(require("antd/lib/input"));
|
|
113
|
-
|
|
114
93
|
var useControllableValue_1 = __importDefault(require("ahooks/lib/useControllableValue"));
|
|
115
|
-
|
|
116
94
|
var omit_1 = __importDefault(require("lodash/omit"));
|
|
117
|
-
|
|
118
95
|
var dataTypeEnum = __importStar(require("./const/dataTypeEnum"));
|
|
119
|
-
|
|
120
96
|
exports.dataTypeEnum = dataTypeEnum;
|
|
121
|
-
|
|
122
97
|
var numberTypeEnum = __importStar(require("./const/numberType"));
|
|
123
|
-
|
|
124
98
|
exports.numberTypeEnum = numberTypeEnum;
|
|
125
|
-
|
|
126
99
|
var utils_1 = require("./utils");
|
|
127
|
-
|
|
128
100
|
var NumberInput = React.forwardRef(function (props, ref) {
|
|
129
101
|
var _a = __read((0, useControllableValue_1["default"])(props, {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
102
|
+
defaultValue: ''
|
|
103
|
+
}), 2),
|
|
104
|
+
value = _a[0],
|
|
105
|
+
setValue = _a[1];
|
|
135
106
|
var onChange = props.onChange,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
107
|
+
_b = props.numberType,
|
|
108
|
+
numberType = _b === void 0 ? numberTypeEnum.INT : _b,
|
|
109
|
+
_c = props.dataType,
|
|
110
|
+
dataType = _c === void 0 ? dataTypeEnum.NUMBER : _c,
|
|
111
|
+
precision = props.precision,
|
|
112
|
+
formatter = props.formatter,
|
|
113
|
+
parser = props.parser,
|
|
114
|
+
enableMinus = props.enableMinus,
|
|
115
|
+
onBlur = props.onBlur,
|
|
116
|
+
maxLength = props.maxLength,
|
|
117
|
+
restProps = __rest(props, ["onChange", "numberType", "dataType", "precision", "formatter", "parser", "enableMinus", "onBlur", "maxLength"]);
|
|
148
118
|
var onNumberChange = function onNumberChange(e) {
|
|
149
119
|
var newNumber;
|
|
150
120
|
var newValue = e.target.value;
|
|
151
|
-
|
|
152
121
|
if (numberType === numberTypeEnum.INT) {
|
|
153
122
|
newNumber = (0, utils_1.filterInt)({
|
|
154
123
|
value: newValue,
|
|
@@ -163,19 +132,15 @@ var NumberInput = React.forwardRef(function (props, ref) {
|
|
|
163
132
|
enableMinus: enableMinus
|
|
164
133
|
});
|
|
165
134
|
}
|
|
166
|
-
|
|
167
135
|
if (parser) {
|
|
168
136
|
newNumber = parser(newNumber);
|
|
169
137
|
}
|
|
170
|
-
|
|
171
138
|
if (value !== newNumber) {
|
|
172
139
|
setValue(newNumber);
|
|
173
140
|
}
|
|
174
141
|
};
|
|
175
|
-
|
|
176
142
|
var onNumberBlur = function onNumberBlur() {
|
|
177
143
|
var resultValue = value;
|
|
178
|
-
|
|
179
144
|
if (value === '-' || value === '.') {
|
|
180
145
|
resultValue = '';
|
|
181
146
|
} else if (value && dataType === dataTypeEnum.NUMBER) {
|
|
@@ -185,11 +150,9 @@ var NumberInput = React.forwardRef(function (props, ref) {
|
|
|
185
150
|
resultValue = parseInt("".concat(value), 10);
|
|
186
151
|
}
|
|
187
152
|
}
|
|
188
|
-
|
|
189
153
|
setValue(resultValue);
|
|
190
154
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(resultValue);
|
|
191
155
|
};
|
|
192
|
-
|
|
193
156
|
var finallyValue = formatter ? formatter("".concat(value)) : value;
|
|
194
157
|
return React.createElement(input_1["default"], __assign({
|
|
195
158
|
type: "text",
|
|
@@ -1,57 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable no-useless-escape */
|
|
3
2
|
|
|
3
|
+
/* eslint-disable no-useless-escape */
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.filterFloat = exports.filterInt = void 0;
|
|
8
8
|
var intNumberReg = /^-?\d+$/;
|
|
9
|
-
|
|
10
9
|
var filterInt = function filterInt(_a) {
|
|
11
10
|
var value = _a.value,
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
enableMinus = _a.enableMinus,
|
|
12
|
+
preValue = _a.preValue;
|
|
14
13
|
var nextValue = value.replace(/[^\d\-]/g, '');
|
|
15
|
-
|
|
16
14
|
if (!enableMinus) {
|
|
17
15
|
nextValue = value.replace(/\D/g, '');
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
if (nextValue && nextValue.length > 1 && !intNumberReg.test(nextValue)) {
|
|
21
18
|
return preValue !== null && preValue !== void 0 ? preValue : '';
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
return nextValue;
|
|
25
21
|
};
|
|
26
|
-
|
|
27
22
|
exports.filterInt = filterInt;
|
|
28
|
-
|
|
29
23
|
var filterFloat = function filterFloat(_a) {
|
|
30
24
|
var value = _a.value,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
_b = _a.preValue,
|
|
26
|
+
preValue = _b === void 0 ? '' : _b,
|
|
27
|
+
_c = _a.precision,
|
|
28
|
+
precision = _c === void 0 ? 2 : _c,
|
|
29
|
+
enableMinus = _a.enableMinus;
|
|
36
30
|
var nextValue = value.replace(/[^\d.\-]/g, '');
|
|
37
31
|
var matchDecimalPoint = nextValue.match(/\./g) || [];
|
|
38
|
-
|
|
39
32
|
if (matchDecimalPoint.length > 1) {
|
|
40
33
|
return preValue;
|
|
41
34
|
}
|
|
42
|
-
|
|
43
35
|
if (!enableMinus) {
|
|
44
36
|
nextValue = value.replace(/[^\d.]/g, '');
|
|
45
37
|
}
|
|
46
|
-
|
|
47
38
|
var floatNumberReg = /^-?\d+\.?\d*$/;
|
|
48
|
-
|
|
49
39
|
if (nextValue && nextValue.length > 1 && !floatNumberReg.test(nextValue)) {
|
|
50
40
|
return preValue;
|
|
51
41
|
}
|
|
52
|
-
|
|
53
42
|
var twoDecimalNumReg = new RegExp("^(\\-)*(\\d+)\\.(\\d{".concat(precision, "}).*$"));
|
|
54
43
|
return nextValue.replace(twoDecimalNumReg, '$1$2.$3');
|
|
55
44
|
};
|
|
56
|
-
|
|
57
45
|
exports.filterFloat = filterFloat;
|
package/lib/rc-echart/core.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
|
|
7
6
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
7
|
desc = {
|
|
9
8
|
enumerable: true,
|
|
@@ -12,13 +11,11 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
Object.defineProperty(o, k2, desc);
|
|
17
15
|
} : function (o, m, k, k2) {
|
|
18
16
|
if (k2 === undefined) k2 = k;
|
|
19
17
|
o[k2] = m[k];
|
|
20
18
|
});
|
|
21
|
-
|
|
22
19
|
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
23
20
|
Object.defineProperty(o, "default", {
|
|
24
21
|
enumerable: true,
|
|
@@ -27,54 +24,41 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun
|
|
|
27
24
|
} : function (o, v) {
|
|
28
25
|
o["default"] = v;
|
|
29
26
|
});
|
|
30
|
-
|
|
31
27
|
var __importStar = this && this.__importStar || function (mod) {
|
|
32
28
|
if (mod && mod.__esModule) return mod;
|
|
33
29
|
var result = {};
|
|
34
30
|
if (mod != null) for (var k in mod) {
|
|
35
31
|
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
__setModuleDefault(result, mod);
|
|
39
|
-
|
|
40
34
|
return result;
|
|
41
35
|
};
|
|
42
|
-
|
|
43
36
|
var __importDefault = this && this.__importDefault || function (mod) {
|
|
44
37
|
return mod && mod.__esModule ? mod : {
|
|
45
38
|
"default": mod
|
|
46
39
|
};
|
|
47
40
|
};
|
|
48
|
-
|
|
49
41
|
Object.defineProperty(exports, "__esModule", {
|
|
50
42
|
value: true
|
|
51
43
|
});
|
|
52
44
|
/* eslint-disable no-unused-expressions */
|
|
53
|
-
|
|
54
45
|
/* eslint-disable no-restricted-syntax */
|
|
55
|
-
|
|
56
46
|
var react_1 = __importStar(require("react"));
|
|
57
|
-
|
|
58
47
|
var useMount_1 = __importDefault(require("ahooks/lib/useMount"));
|
|
59
|
-
|
|
60
48
|
var useUpdateEffect_1 = __importDefault(require("ahooks/lib/useUpdateEffect"));
|
|
61
|
-
|
|
62
49
|
var classnames_1 = __importDefault(require("classnames"));
|
|
63
|
-
|
|
64
50
|
var resize_observer_polyfill_1 = __importDefault(require("resize-observer-polyfill"));
|
|
65
|
-
|
|
66
51
|
var ReactEchartCore = function ReactEchartCore(props) {
|
|
67
52
|
var className = props.className,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
53
|
+
option = props.option,
|
|
54
|
+
echarts = props.echarts,
|
|
55
|
+
notMerge = props.notMerge,
|
|
56
|
+
lazyUpdate = props.lazyUpdate,
|
|
57
|
+
onEvents = props.onEvents,
|
|
58
|
+
opts = props.opts,
|
|
59
|
+
theme = props.theme;
|
|
75
60
|
var chartDomRef = (0, react_1.useRef)();
|
|
76
61
|
var chartRef = (0, react_1.useRef)();
|
|
77
|
-
|
|
78
62
|
var bindEvents = function bindEvents() {
|
|
79
63
|
var bindEventFunc = function bindEventFunc(eventName, func) {
|
|
80
64
|
if (typeof eventName === 'string' && typeof func === 'function') {
|
|
@@ -85,62 +69,54 @@ var ReactEchartCore = function ReactEchartCore(props) {
|
|
|
85
69
|
}
|
|
86
70
|
}
|
|
87
71
|
};
|
|
88
|
-
|
|
89
72
|
for (var eventName in onEvents) {
|
|
90
73
|
if (Object.prototype.hasOwnProperty.call(onEvents, eventName)) {
|
|
91
74
|
bindEventFunc(eventName, onEvents[eventName]);
|
|
92
75
|
}
|
|
93
76
|
}
|
|
94
77
|
};
|
|
95
|
-
|
|
96
78
|
var initEcharts = function initEcharts() {
|
|
97
79
|
chartRef.current = echarts.init(chartDomRef.current, theme, opts);
|
|
98
80
|
};
|
|
99
|
-
|
|
100
81
|
var renderEchartDom = function renderEchartDom() {
|
|
101
82
|
if (chartRef.current) {
|
|
102
83
|
chartRef.current.setOption(option, notMerge, lazyUpdate);
|
|
103
84
|
}
|
|
104
85
|
};
|
|
105
|
-
|
|
106
86
|
var dispose = function dispose() {
|
|
107
87
|
if (chartRef.current) {
|
|
108
88
|
chartRef.current.dispose();
|
|
109
89
|
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
|
|
90
|
+
};
|
|
91
|
+
// first add
|
|
113
92
|
(0, useMount_1["default"])(function () {
|
|
114
93
|
initEcharts();
|
|
115
94
|
renderEchartDom();
|
|
116
95
|
bindEvents();
|
|
117
|
-
});
|
|
118
|
-
|
|
96
|
+
});
|
|
97
|
+
// need reBuild
|
|
119
98
|
(0, useUpdateEffect_1["default"])(function () {
|
|
120
99
|
dispose();
|
|
121
100
|
renderEchartDom();
|
|
122
101
|
bindEvents();
|
|
123
|
-
}, [theme, opts, onEvents]);
|
|
124
|
-
|
|
102
|
+
}, [theme, opts, onEvents]);
|
|
103
|
+
// need setOption
|
|
125
104
|
(0, useUpdateEffect_1["default"])(function () {
|
|
126
105
|
renderEchartDom();
|
|
127
|
-
}, [option, notMerge, lazyUpdate]);
|
|
128
|
-
|
|
106
|
+
}, [option, notMerge, lazyUpdate]);
|
|
107
|
+
// need resize
|
|
129
108
|
var resizeChart = function resizeChart() {
|
|
130
109
|
if (chartRef.current) {
|
|
131
110
|
chartRef.current.resize();
|
|
132
111
|
}
|
|
133
112
|
};
|
|
134
|
-
|
|
135
113
|
(0, react_1.useLayoutEffect)(function () {
|
|
136
114
|
var resizeObserver = new resize_observer_polyfill_1["default"](function () {
|
|
137
115
|
resizeChart();
|
|
138
116
|
});
|
|
139
|
-
|
|
140
117
|
if (chartDomRef.current) {
|
|
141
118
|
resizeObserver.observe(chartDomRef.current);
|
|
142
119
|
}
|
|
143
|
-
|
|
144
120
|
return function () {
|
|
145
121
|
resizeObserver.disconnect();
|
|
146
122
|
};
|
|
@@ -160,7 +136,6 @@ var ReactEchartCore = function ReactEchartCore(props) {
|
|
|
160
136
|
className: (0, classnames_1["default"])('react-echart', className)
|
|
161
137
|
});
|
|
162
138
|
};
|
|
163
|
-
|
|
164
139
|
ReactEchartCore.defaultProps = {
|
|
165
140
|
notMerge: false,
|
|
166
141
|
lazyUpdate: false,
|
package/lib/rc-echart/index.js
CHANGED
|
@@ -4,22 +4,17 @@ var __assign = this && this.__assign || function () {
|
|
|
4
4
|
__assign = Object.assign || function (t) {
|
|
5
5
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
6
|
s = arguments[i];
|
|
7
|
-
|
|
8
7
|
for (var p in s) {
|
|
9
8
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
return t;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
return __assign.apply(this, arguments);
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
20
16
|
if (k2 === undefined) k2 = k;
|
|
21
17
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
22
|
-
|
|
23
18
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
19
|
desc = {
|
|
25
20
|
enumerable: true,
|
|
@@ -28,13 +23,11 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
28
23
|
}
|
|
29
24
|
};
|
|
30
25
|
}
|
|
31
|
-
|
|
32
26
|
Object.defineProperty(o, k2, desc);
|
|
33
27
|
} : function (o, m, k, k2) {
|
|
34
28
|
if (k2 === undefined) k2 = k;
|
|
35
29
|
o[k2] = m[k];
|
|
36
30
|
});
|
|
37
|
-
|
|
38
31
|
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
39
32
|
Object.defineProperty(o, "default", {
|
|
40
33
|
enumerable: true,
|
|
@@ -43,39 +36,29 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun
|
|
|
43
36
|
} : function (o, v) {
|
|
44
37
|
o["default"] = v;
|
|
45
38
|
});
|
|
46
|
-
|
|
47
39
|
var __importStar = this && this.__importStar || function (mod) {
|
|
48
40
|
if (mod && mod.__esModule) return mod;
|
|
49
41
|
var result = {};
|
|
50
42
|
if (mod != null) for (var k in mod) {
|
|
51
43
|
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
52
44
|
}
|
|
53
|
-
|
|
54
45
|
__setModuleDefault(result, mod);
|
|
55
|
-
|
|
56
46
|
return result;
|
|
57
47
|
};
|
|
58
|
-
|
|
59
48
|
var __importDefault = this && this.__importDefault || function (mod) {
|
|
60
49
|
return mod && mod.__esModule ? mod : {
|
|
61
50
|
"default": mod
|
|
62
51
|
};
|
|
63
52
|
};
|
|
64
|
-
|
|
65
53
|
Object.defineProperty(exports, "__esModule", {
|
|
66
54
|
value: true
|
|
67
55
|
});
|
|
68
|
-
|
|
69
56
|
var react_1 = __importDefault(require("react"));
|
|
70
|
-
|
|
71
57
|
var echarts = __importStar(require("echarts"));
|
|
72
|
-
|
|
73
58
|
var core_1 = __importDefault(require("./core"));
|
|
74
|
-
|
|
75
59
|
var RcEcharts = function RcEcharts(props) {
|
|
76
60
|
return react_1["default"].createElement(core_1["default"], __assign({
|
|
77
61
|
echarts: echarts
|
|
78
62
|
}, props));
|
|
79
63
|
};
|
|
80
|
-
|
|
81
64
|
exports["default"] = RcEcharts;
|
package/lib/rc-motion/index.js
CHANGED
|
@@ -5,11 +5,8 @@ var __importDefault = this && this.__importDefault || function (mod) {
|
|
|
5
5
|
"default": mod
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
-
|
|
9
8
|
Object.defineProperty(exports, "__esModule", {
|
|
10
9
|
value: true
|
|
11
10
|
});
|
|
12
|
-
|
|
13
11
|
var rc_motion_1 = __importDefault(require("rc-motion"));
|
|
14
|
-
|
|
15
12
|
exports["default"] = rc_motion_1["default"];
|