@kdcloudjs/kdesign 1.7.33-stable.12-hotfix.2 → 1.7.33-stable.12-hotfix.4

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.
@@ -29,7 +29,8 @@ var InternalSelect = function InternalSelect(props, ref) {
29
29
  getPrefixCls = _useContext.getPrefixCls,
30
30
  prefixCls = _useContext.prefixCls,
31
31
  userDefaultProps = _useContext.compDefaultProps,
32
- locale = _useContext.locale;
32
+ locale = _useContext.locale,
33
+ isMobile = _useContext.isMobile;
33
34
  var selectProps = getCompProps('CityPicker', userDefaultProps, props);
34
35
  var cityPickerLangMsg = locale.getCompLangMsg({
35
36
  componentName: 'CityPicker'
@@ -229,11 +230,15 @@ var InternalSelect = function InternalSelect(props, ref) {
229
230
  }));
230
231
  };
231
232
  var handleOption = function handleOption(city) {
232
- var _a;
233
+ var _a, _b;
233
234
  handleVisibleChange(false);
234
235
  city.type = tabsValue === 'domestic' ? 'domestic' : 'foreign';
235
236
  (city === null || city === void 0 ? void 0 : city.id) !== initValue && (onChange === null || onChange === void 0 ? void 0 : onChange(city === null || city === void 0 ? void 0 : city.id, city));
236
- (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
237
+ if (isMobile) {
238
+ (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.blur();
239
+ } else {
240
+ (_b = searchRef.current) === null || _b === void 0 ? void 0 : _b.focus();
241
+ }
237
242
  setAfterChangeFocus(true);
238
243
  if (typeof value === 'undefined') {
239
244
  setSeletedCity(city);
package/es/tabs/tabs.js CHANGED
@@ -119,7 +119,14 @@ var Tabs = function Tabs(props) {
119
119
  isDragging.current = true;
120
120
  };
121
121
  var handleTouchMove = function handleTouchMove(e) {
122
+ var _a, _b;
122
123
  if (!isDragging.current || ListWidth <= boxWidth) return;
124
+ var path = ((_b = (_a = e.nativeEvent).composedPath) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
125
+ var isFromTabList = path.some(function (el) {
126
+ var _a, _b, _c;
127
+ return (_c = (_b = (_a = el) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.contains) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(tabsPrefixCls, "-tab-list"));
128
+ });
129
+ if (!isFromTabList) return; // 阻止非 tab 区域触发移动逻辑
123
130
  var currentX = e.touches[0].clientX;
124
131
  var deltaX = currentX - touchStartX.current;
125
132
  var newPosition = lastListPosition.current + deltaX;
@@ -40,7 +40,8 @@ var InternalSelect = function InternalSelect(props, ref) {
40
40
  getPrefixCls = _useContext.getPrefixCls,
41
41
  prefixCls = _useContext.prefixCls,
42
42
  userDefaultProps = _useContext.compDefaultProps,
43
- locale = _useContext.locale;
43
+ locale = _useContext.locale,
44
+ isMobile = _useContext.isMobile;
44
45
  var selectProps = (0, _utils.getCompProps)('CityPicker', userDefaultProps, props);
45
46
  var cityPickerLangMsg = locale.getCompLangMsg({
46
47
  componentName: 'CityPicker'
@@ -240,11 +241,15 @@ var InternalSelect = function InternalSelect(props, ref) {
240
241
  }));
241
242
  };
242
243
  var handleOption = function handleOption(city) {
243
- var _a;
244
+ var _a, _b;
244
245
  handleVisibleChange(false);
245
246
  city.type = tabsValue === 'domestic' ? 'domestic' : 'foreign';
246
247
  (city === null || city === void 0 ? void 0 : city.id) !== initValue && (onChange === null || onChange === void 0 ? void 0 : onChange(city === null || city === void 0 ? void 0 : city.id, city));
247
- (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
248
+ if (isMobile) {
249
+ (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.blur();
250
+ } else {
251
+ (_b = searchRef.current) === null || _b === void 0 ? void 0 : _b.focus();
252
+ }
248
253
  setAfterChangeFocus(true);
249
254
  if (typeof value === 'undefined') {
250
255
  setSeletedCity(city);
package/lib/tabs/tabs.js CHANGED
@@ -130,7 +130,14 @@ var Tabs = function Tabs(props) {
130
130
  isDragging.current = true;
131
131
  };
132
132
  var handleTouchMove = function handleTouchMove(e) {
133
+ var _a, _b;
133
134
  if (!isDragging.current || ListWidth <= boxWidth) return;
135
+ var path = ((_b = (_a = e.nativeEvent).composedPath) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
136
+ var isFromTabList = path.some(function (el) {
137
+ var _a, _b, _c;
138
+ return (_c = (_b = (_a = el) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.contains) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(tabsPrefixCls, "-tab-list"));
139
+ });
140
+ if (!isFromTabList) return; // 阻止非 tab 区域触发移动逻辑
134
141
  var currentX = e.touches[0].clientX;
135
142
  var deltaX = currentX - touchStartX.current;
136
143
  var newPosition = lastListPosition.current + deltaX;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.7.33-stable.12-hotfix.2",
3
+ "version": "1.7.33-stable.12-hotfix.4",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [