antd-mobile 5.42.0-alpha.2 → 5.42.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.
Files changed (34) hide show
  1. package/2x/bundle/antd-mobile.cjs.development.js +7 -4
  2. package/2x/bundle/antd-mobile.cjs.js +5 -5
  3. package/2x/bundle/antd-mobile.es.development.js +7 -4
  4. package/2x/bundle/antd-mobile.es.js +537 -533
  5. package/2x/bundle/antd-mobile.umd.development.js +7 -4
  6. package/2x/bundle/antd-mobile.umd.js +5 -5
  7. package/2x/bundle/style.css +1 -1
  8. package/2x/cjs/components/image-uploader/image-uploader.js +2 -2
  9. package/2x/cjs/components/number-keyboard/number-keyboard.js +5 -1
  10. package/2x/cjs/components/virtual-input/virtual-input.css +1 -1
  11. package/2x/cjs/components/virtual-input/virtual-input.js +1 -1
  12. package/2x/es/components/image-uploader/image-uploader.js +2 -2
  13. package/2x/es/components/number-keyboard/number-keyboard.js +5 -1
  14. package/2x/es/components/virtual-input/virtual-input.css +1 -1
  15. package/2x/es/components/virtual-input/virtual-input.js +1 -1
  16. package/2x/package.json +1 -1
  17. package/bundle/antd-mobile.cjs.development.js +7 -4
  18. package/bundle/antd-mobile.cjs.js +5 -5
  19. package/bundle/antd-mobile.compatible.umd.js +1 -1
  20. package/bundle/antd-mobile.es.development.js +7 -4
  21. package/bundle/antd-mobile.es.js +537 -533
  22. package/bundle/antd-mobile.umd.development.js +7 -4
  23. package/bundle/antd-mobile.umd.js +5 -5
  24. package/bundle/style.css +1 -1
  25. package/cjs/components/image-uploader/image-uploader.js +2 -2
  26. package/cjs/components/number-keyboard/number-keyboard.js +5 -1
  27. package/cjs/components/virtual-input/virtual-input.css +1 -1
  28. package/cjs/components/virtual-input/virtual-input.js +1 -1
  29. package/es/components/image-uploader/image-uploader.js +2 -2
  30. package/es/components/number-keyboard/number-keyboard.js +5 -1
  31. package/es/components/virtual-input/virtual-input.css +1 -1
  32. package/es/components/virtual-input/virtual-input.js +1 -1
  33. package/package.json +1 -1
  34. package/umd/antd-mobile.js +1 -1
@@ -5706,7 +5706,6 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
5706
5706
  z-index: 1;
5707
5707
  width: 100%;
5708
5708
  max-width: 100%;
5709
- min-height: 1.5em;
5710
5709
  overflow-y: hidden;
5711
5710
  overflow-x: scroll;
5712
5711
  letter-spacing: 2px;
@@ -5723,6 +5722,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
5723
5722
  height: 20px;
5724
5723
  position: absolute;
5725
5724
  opacity: 0;
5725
+ left: 0;
5726
5726
  }
5727
5727
 
5728
5728
  .adm-virtual-input-placeholder {
@@ -94,6 +94,7 @@ const ImageUploader = (0, _react.forwardRef)((p, ref) => {
94
94
  function getFinalTasks(tasks) {
95
95
  return props.showFailed ? tasks : tasks.filter(task => task.status !== 'fail');
96
96
  }
97
+ const finalTasks = getFinalTasks(tasks);
97
98
  function onChange(e) {
98
99
  var _a;
99
100
  return (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
@@ -114,7 +115,7 @@ const ImageUploader = (0, _react.forwardRef)((p, ref) => {
114
115
  return;
115
116
  }
116
117
  if (maxCount > 0) {
117
- const exceed = value.length + files.length - maxCount;
118
+ const exceed = value.length + files.length + finalTasks.length - maxCount;
118
119
  if (exceed > 0) {
119
120
  files = files.slice(0, files.length - exceed);
120
121
  (_a = props.onCountExceed) === null || _a === void 0 ? void 0 : _a.call(props, exceed);
@@ -173,7 +174,6 @@ const ImageUploader = (0, _react.forwardRef)((p, ref) => {
173
174
  var _a;
174
175
  (_a = imageViewerHandlerRef.current) === null || _a === void 0 ? void 0 : _a.close();
175
176
  });
176
- const finalTasks = getFinalTasks(tasks);
177
177
  const showUpload = props.showUpload && (maxCount === 0 || value.length + finalTasks.length < maxCount);
178
178
  const renderImages = () => {
179
179
  return value.map((fileItem, index) => {
@@ -172,7 +172,11 @@ const NumberKeyboard = p => {
172
172
  forceRender: props.forceRender
173
173
  }, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
174
174
  ref: keyboardRef,
175
- className: classPrefix
175
+ className: classPrefix,
176
+ onMouseDown: e => {
177
+ // 点击键盘时,不会触发页面已聚焦元素(如输入框)的 blur 事件
178
+ e.preventDefault();
179
+ }
176
180
  }, renderHeader(), _react.default.createElement("div", {
177
181
  className: `${classPrefix}-wrapper`
178
182
  }, _react.default.createElement("div", {
@@ -28,7 +28,6 @@
28
28
  z-index: 1;
29
29
  width: 100%;
30
30
  max-width: 100%;
31
- min-height: 1.5em;
32
31
  overflow-y: hidden;
33
32
  overflow-x: scroll;
34
33
  letter-spacing: 2px;
@@ -45,6 +44,7 @@
45
44
  height: 20px;
46
45
  position: absolute;
47
46
  opacity: 0;
47
+ left: 0;
48
48
  }
49
49
 
50
50
  .adm-virtual-input-placeholder {
@@ -142,7 +142,7 @@ const VirtualInput = (0, _react.forwardRef)((props, ref) => {
142
142
  (_b = (_a = mergedProps.cursor) === null || _a === void 0 ? void 0 : _a.onMove) === null || _b === void 0 ? void 0 : _b.call(_a, value.length);
143
143
  }
144
144
  (_c = mergedProps.onClick) === null || _c === void 0 ? void 0 : _c.call(mergedProps, e);
145
- setHasFocus(true);
145
+ setFocus();
146
146
  };
147
147
  // 点击单个字符时,根据点击位置置于字符前或后
148
148
  const changeCaretPosition = index => e => {
@@ -85,6 +85,7 @@ export const ImageUploader = forwardRef((p, ref) => {
85
85
  function getFinalTasks(tasks) {
86
86
  return props.showFailed ? tasks : tasks.filter(task => task.status !== 'fail');
87
87
  }
88
+ const finalTasks = getFinalTasks(tasks);
88
89
  function onChange(e) {
89
90
  var _a;
90
91
  return __awaiter(this, void 0, void 0, function* () {
@@ -105,7 +106,7 @@ export const ImageUploader = forwardRef((p, ref) => {
105
106
  return;
106
107
  }
107
108
  if (maxCount > 0) {
108
- const exceed = value.length + files.length - maxCount;
109
+ const exceed = value.length + files.length + finalTasks.length - maxCount;
109
110
  if (exceed > 0) {
110
111
  files = files.slice(0, files.length - exceed);
111
112
  (_a = props.onCountExceed) === null || _a === void 0 ? void 0 : _a.call(props, exceed);
@@ -164,7 +165,6 @@ export const ImageUploader = forwardRef((p, ref) => {
164
165
  var _a;
165
166
  (_a = imageViewerHandlerRef.current) === null || _a === void 0 ? void 0 : _a.close();
166
167
  });
167
- const finalTasks = getFinalTasks(tasks);
168
168
  const showUpload = props.showUpload && (maxCount === 0 || value.length + finalTasks.length < maxCount);
169
169
  const renderImages = () => {
170
170
  return value.map((fileItem, index) => {
@@ -163,7 +163,11 @@ export const NumberKeyboard = p => {
163
163
  forceRender: props.forceRender
164
164
  }, withNativeProps(props, React.createElement("div", {
165
165
  ref: keyboardRef,
166
- className: classPrefix
166
+ className: classPrefix,
167
+ onMouseDown: e => {
168
+ // 点击键盘时,不会触发页面已聚焦元素(如输入框)的 blur 事件
169
+ e.preventDefault();
170
+ }
167
171
  }, renderHeader(), React.createElement("div", {
168
172
  className: `${classPrefix}-wrapper`
169
173
  }, React.createElement("div", {
@@ -28,7 +28,6 @@
28
28
  z-index: 1;
29
29
  width: 100%;
30
30
  max-width: 100%;
31
- min-height: 1.5em;
32
31
  overflow-y: hidden;
33
32
  overflow-x: scroll;
34
33
  letter-spacing: 2px;
@@ -45,6 +44,7 @@
45
44
  height: 20px;
46
45
  position: absolute;
47
46
  opacity: 0;
47
+ left: 0;
48
48
  }
49
49
 
50
50
  .adm-virtual-input-placeholder {
@@ -133,7 +133,7 @@ export const VirtualInput = forwardRef((props, ref) => {
133
133
  (_b = (_a = mergedProps.cursor) === null || _a === void 0 ? void 0 : _a.onMove) === null || _b === void 0 ? void 0 : _b.call(_a, value.length);
134
134
  }
135
135
  (_c = mergedProps.onClick) === null || _c === void 0 ? void 0 : _c.call(mergedProps, e);
136
- setHasFocus(true);
136
+ setFocus();
137
137
  };
138
138
  // 点击单个字符时,根据点击位置置于字符前或后
139
139
  const changeCaretPosition = index => e => {
package/2x/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.42.0-alpha.2",
3
+ "version": "5.42.1",
4
4
  "homepage": "https://github.com/ant-design/ant-design-mobile#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/ant-design/ant-design-mobile/issues"
@@ -22169,6 +22169,7 @@ const ImageUploader = React$3.forwardRef((p, ref2) => {
22169
22169
  function getFinalTasks(tasks2) {
22170
22170
  return props.showFailed ? tasks2 : tasks2.filter((task) => task.status !== "fail");
22171
22171
  }
22172
+ const finalTasks = getFinalTasks(tasks);
22172
22173
  function onChange(e2) {
22173
22174
  var _a;
22174
22175
  return __awaiter(this, void 0, void 0, function* () {
@@ -22190,7 +22191,7 @@ const ImageUploader = React$3.forwardRef((p, ref2) => {
22190
22191
  return;
22191
22192
  }
22192
22193
  if (maxCount > 0) {
22193
- const exceed = value.length + files.length - maxCount;
22194
+ const exceed = value.length + files.length + finalTasks.length - maxCount;
22194
22195
  if (exceed > 0) {
22195
22196
  files = files.slice(0, files.length - exceed);
22196
22197
  (_a = props.onCountExceed) === null || _a === void 0 ? void 0 : _a.call(props, exceed);
@@ -22249,7 +22250,6 @@ const ImageUploader = React$3.forwardRef((p, ref2) => {
22249
22250
  var _a;
22250
22251
  (_a = imageViewerHandlerRef.current) === null || _a === void 0 ? void 0 : _a.close();
22251
22252
  });
22252
- const finalTasks = getFinalTasks(tasks);
22253
22253
  const showUpload = props.showUpload && (maxCount === 0 || value.length + finalTasks.length < maxCount);
22254
22254
  const renderImages = () => {
22255
22255
  return value.map((fileItem, index2) => {
@@ -23304,7 +23304,10 @@ const NumberKeyboard = (p) => {
23304
23304
  forceRender: props.forceRender
23305
23305
  }, withNativeProps(props, React$3.createElement("div", {
23306
23306
  ref: keyboardRef,
23307
- className: classPrefix$x
23307
+ className: classPrefix$x,
23308
+ onMouseDown: (e2) => {
23309
+ e2.preventDefault();
23310
+ }
23308
23311
  }, renderHeader(), React$3.createElement("div", {
23309
23312
  className: `${classPrefix$x}-wrapper`
23310
23313
  }, React$3.createElement("div", {
@@ -27739,7 +27742,7 @@ const VirtualInput = React$3.forwardRef((props, ref2) => {
27739
27742
  (_b = (_a = mergedProps.cursor) === null || _a === void 0 ? void 0 : _a.onMove) === null || _b === void 0 ? void 0 : _b.call(_a, value.length);
27740
27743
  }
27741
27744
  (_c = mergedProps.onClick) === null || _c === void 0 ? void 0 : _c.call(mergedProps, e2);
27742
- setHasFocus(true);
27745
+ setFocus();
27743
27746
  };
27744
27747
  const changeCaretPosition = (index2) => (e2) => {
27745
27748
  var _a, _b, _c;