@pisell/materials 1.0.380 → 1.0.381

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.
@@ -38,6 +38,11 @@ var DatePickerInput = function DatePickerInput(props) {
38
38
  var handleChange = function handleChange(e) {
39
39
  var inputValue = e.target.value;
40
40
 
41
+ // 禁止特殊字符时
42
+ if (!/^[\d/]*$/.test(inputValue)) {
43
+ return;
44
+ }
45
+
41
46
  // 根据 format 字符串,将字母部分分离开来
42
47
  var parts = format.split(/[^a-zA-Z]/);
43
48
 
@@ -131,6 +136,7 @@ var DatePickerInput = function DatePickerInput(props) {
131
136
  eventChange === null || eventChange === void 0 ? void 0 : eventChange(result);
132
137
  };
133
138
  return /*#__PURE__*/React.createElement(Input, _extends({}, others, {
139
+ type: "tel",
134
140
  value: value,
135
141
  onChange: handleChange
136
142
  }));
@@ -52,6 +52,9 @@ var DatePickerInput = (props) => {
52
52
  };
53
53
  const handleChange = (e) => {
54
54
  let inputValue = e.target.value;
55
+ if (!/^[\d/]*$/.test(inputValue)) {
56
+ return;
57
+ }
55
58
  let parts = format.split(/[^a-zA-Z]/);
56
59
  let separators = format.match(/[^a-zA-Z]+/g) || [];
57
60
  if (inputValue.length < value.length) {
@@ -109,7 +112,7 @@ var DatePickerInput = (props) => {
109
112
  }
110
113
  eventChange == null ? void 0 : eventChange(result);
111
114
  };
112
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Input, { ...others, value, onChange: handleChange });
115
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Input, { ...others, type: "tel", value, onChange: handleChange });
113
116
  };
114
117
  var DatePickerCpt = (props) => {
115
118
  const { format, type, onChange, size, picker } = props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.380",
3
+ "version": "1.0.381",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -63,9 +63,9 @@
63
63
  "react-virtualized-auto-sizer": "^1.0.20",
64
64
  "crypto-js": "^4.2.0",
65
65
  "@zxing/library": "0.21.2",
66
+ "@pisell/utils": "1.0.33",
66
67
  "@pisell/date-picker": "1.0.95",
67
- "@pisell/icon": "0.0.10",
68
- "@pisell/utils": "1.0.33"
68
+ "@pisell/icon": "0.0.10"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "react": "^18.0.0",