gxxc-ui 1.0.9 → 1.0.11

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.
@@ -11,12 +11,14 @@ var IconUI = function IconUI(props) {
11
11
  var otherProps = Object.assign({}, (_objectDestructuringEmpty(props), props));
12
12
 
13
13
  /// 拦截点击事添加 disabled 使其禁止点击
14
- var onClick = otherProps.onClick;
15
- otherProps.onClick = function (e) {
16
- if (!props.disabled) {
17
- onClick(e);
18
- }
19
- };
14
+ if (otherProps.onClick) {
15
+ var onClick = otherProps.onClick;
16
+ otherProps.onClick = function (e) {
17
+ if (!props.disabled) {
18
+ onClick(e);
19
+ }
20
+ };
21
+ }
20
22
 
21
23
  // 直接从 iconMap 获取图标,避免每次都遍历数组
22
24
  var current = iconMap[name];
@@ -19,7 +19,9 @@ var SearchNumberUI = function SearchNumberUI(props) {
19
19
  searchValue = _useState2[0],
20
20
  setSearchValue = _useState2[1];
21
21
  useEffect(function () {
22
- var ee = value === null || value === void 0 ? void 0 : value.replace(/[^0-9]/g, '');
22
+ var _ee;
23
+ var ee = String(value);
24
+ ee = (_ee = ee) === null || _ee === void 0 ? void 0 : _ee.replace(/[^0-9]/g, '');
23
25
  setSearchValue(ee);
24
26
  return function () {
25
27
  clearTimeout(timer);
@@ -27,7 +29,8 @@ var SearchNumberUI = function SearchNumberUI(props) {
27
29
  }, [value]);
28
30
  var valueChange = function valueChange(e) {
29
31
  if ((e === null || e === void 0 ? void 0 : e.type) === 'change' || (e === null || e === void 0 ? void 0 : e.type) === 'compositionend') {
30
- var ee = e.target.value.replace(/[^0-9]/g, '');
32
+ var _e$target$value$repla;
33
+ var ee = (_e$target$value$repla = e.target.value.replace(/(\d+)/g, '')) !== null && _e$target$value$repla !== void 0 ? _e$target$value$repla : "";
31
34
  setSearchValue(ee);
32
35
  clearTimeout(timer);
33
36
  timer = setTimeout(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gxxc-ui",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",