@kdcloudjs/kdesign 1.8.50 → 1.8.52

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.
@@ -7,5 +7,6 @@ declare const defaultConfig: {
7
7
  getCompLangMsg: (compLangMsgParams: import("../locale").CompLangMsgParams, customGetLangMsg?: ((componentName: string, labelName: string, params: any) => any) | undefined, localeDate?: any) => any;
8
8
  };
9
9
  direction: "ltr" | "rtl";
10
+ isMobile: boolean;
10
11
  };
11
12
  export default defaultConfig;
@@ -13,6 +13,7 @@ var defaultConfig = {
13
13
  getLangMsg: getLangMsg,
14
14
  getCompLangMsg: getCompLangMsg
15
15
  },
16
- direction: 'ltr'
16
+ direction: 'ltr',
17
+ isMobile: false
17
18
  };
18
19
  export default defaultConfig;
@@ -386,7 +386,7 @@
386
386
  max-width: var(--kd-c-tabs-pane-text-sizing-max-width);
387
387
  }
388
388
  .kd-tab-pane-text-active,
389
- .kd-tab-pane-text:hover {
389
+ .kd-tab-pane-text-notMobile:hover {
390
390
  color: var(--kd-c-tabs-color-text-active, var(--kd-g-color-theme, #5582f3));
391
391
  }
392
392
  .kd-tab-pane-text-disabled:hover {
@@ -473,12 +473,16 @@
473
473
  -ms-flex-align: center;
474
474
  align-items: center;
475
475
  }
476
- .kd-tab-pane-type-dynamic:not(.kd-tab-pane-disabled):hover .kd-tab-pane-operations span:first-child {
476
+ .kd-tab-pane-type-dynamic .kd-tab-pane-operations .kdicon {
477
+ font-size: 16px;
478
+ }
479
+ .kd-tab-pane-type-dynamic.kd-tab-pane-box-active.kd-tab-pane-isMobile:not(.kd-tab-pane-disabled):hover .kd-tab-pane-operations span:first-child {
477
480
  opacity: 1;
478
481
  cursor: pointer;
479
482
  }
480
- .kd-tab-pane-type-dynamic .kd-tab-pane-operations .kdicon {
481
- font-size: 16px;
483
+ .kd-tab-pane-type-dynamic-notMobile:not(.kd-tab-pane-disabled):hover .kd-tab-pane-operations span:first-child {
484
+ opacity: 1;
485
+ cursor: pointer;
482
486
  }
483
487
  .kd-tab-pane-type-grid {
484
488
  height: 24px;
@@ -507,7 +511,7 @@
507
511
  .kd-tab-pane-type-grid.kd-tab-pane-disabled {
508
512
  background-color: var(--kd-c-tabs-color-background-disabled, transparent);
509
513
  }
510
- .kd-tab-pane-type-grid:hover {
514
+ .kd-tab-pane-notMobile:hover {
511
515
  color: var(--kd-c-tabs-color-text-active, var(--kd-g-color-theme, #5582f3));
512
516
  }
513
517
  .kd-tab-pane-operations {
@@ -221,7 +221,7 @@
221
221
  text-overflow: ellipsis;
222
222
  max-width: @tab-pane-text-max-width;
223
223
  &-active,
224
- &:hover {
224
+ &-notMobile:hover {
225
225
  color: @tabPane-font-color-active;
226
226
  }
227
227
  &-disabled {
@@ -230,6 +230,7 @@
230
230
  }
231
231
  }
232
232
  }
233
+
233
234
  &-disabled {
234
235
  color: @tabPane-font-color-disabled;
235
236
  cursor: not-allowed;
@@ -304,6 +305,21 @@
304
305
  margin: 0 0 0 4px;
305
306
  display: inline-flex;
306
307
  align-items: center;
308
+ .@{tabPane-prefix-cls}-operations .@{icon-prefix-cls} {
309
+ font-size: 16px;
310
+ }
311
+ &.@{tabPane-prefix-cls}-box-active {
312
+ &.@{tabPane-prefix-cls}-isMobile:not(.@{tabPane-prefix-cls}-disabled):hover {
313
+ .@{tabPane-prefix-cls}-operations {
314
+ span:first-child {
315
+ opacity: 1;
316
+ cursor: pointer;
317
+ }
318
+ }
319
+ }
320
+ }
321
+ }
322
+ &-type-dynamic-notMobile {
307
323
  &:not(.@{tabPane-prefix-cls}-disabled):hover {
308
324
  .@{tabPane-prefix-cls}-operations {
309
325
  span:first-child {
@@ -312,9 +328,6 @@
312
328
  }
313
329
  }
314
330
  }
315
- .@{tabPane-prefix-cls}-operations .@{icon-prefix-cls} {
316
- font-size: 16px;
317
- }
318
331
  }
319
332
  &-type-grid {
320
333
  height: 24px;
@@ -341,6 +354,8 @@
341
354
  &.@{tabPane-prefix-cls}-disabled {
342
355
  background-color: @tab-disabled-bg;
343
356
  }
357
+ }
358
+ &-notMobile {
344
359
  &:hover {
345
360
  color: @tabPane-font-color-active;
346
361
  }
@@ -14,7 +14,8 @@ var TabPane = function TabPane(props) {
14
14
  var tabPaneRef = useRef(null);
15
15
  var _useContext = useContext(ConfigContext),
16
16
  getPrefixCls = _useContext.getPrefixCls,
17
- prefixCls = _useContext.prefixCls;
17
+ prefixCls = _useContext.prefixCls,
18
+ isMobile = _useContext.isMobile;
18
19
  var tab = props.tab,
19
20
  id = props.id,
20
21
  className = props.className,
@@ -30,8 +31,8 @@ var TabPane = function TabPane(props) {
30
31
  tabPaneProps.disabled = context.disabled || disabled;
31
32
  }
32
33
  var tabPanePrefixCls = getPrefixCls(prefixCls, 'tab-pane');
33
- var tabPaneBoxClasses = classNames(tabPanePrefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(tabPanePrefixCls, "-box-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(tabPanePrefixCls, "-type-")).call(_context, tabPaneProps.type), tabPaneProps.type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(tabPanePrefixCls, "-")).call(_context2, tabPaneProps.position), tabPaneProps.position), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(tabPanePrefixCls, "-")).call(_context3, tabPaneProps.size), tabPaneProps.size), _defineProperty(_classNames, "".concat(tabPanePrefixCls, "-disabled"), tabPaneProps.disabled), _classNames));
34
- var tabPaneTextClasses = classNames("".concat(tabPanePrefixCls, "-text"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(tabPanePrefixCls, "-text-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled), _defineProperty(_classNames2, "".concat(tabPanePrefixCls, "-text-disabled"), tabPaneProps.disabled), _classNames2));
34
+ var tabPaneBoxClasses = classNames(tabPanePrefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(tabPanePrefixCls, "-box-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled), _defineProperty(_classNames, "".concat(tabPanePrefixCls, "-type-dynamic-notMobile"), !isMobile), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(tabPanePrefixCls, "-type-")).call(_context, tabPaneProps.type), tabPaneProps.type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(tabPanePrefixCls, "-")).call(_context2, tabPaneProps.position), tabPaneProps.position), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(tabPanePrefixCls, "-")).call(_context3, tabPaneProps.size), tabPaneProps.size), _defineProperty(_classNames, "".concat(tabPanePrefixCls, "-disabled"), tabPaneProps.disabled), _defineProperty(_classNames, "".concat(tabPanePrefixCls, "-notMobile"), !isMobile), _defineProperty(_classNames, "".concat(tabPanePrefixCls, "-isMobile"), isMobile), _classNames));
35
+ var tabPaneTextClasses = classNames("".concat(tabPanePrefixCls, "-text"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(tabPanePrefixCls, "-text-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled), _defineProperty(_classNames2, "".concat(tabPanePrefixCls, "-text-disabled"), tabPaneProps.disabled), _defineProperty(_classNames2, "".concat(tabPanePrefixCls, "-text-notMobile"), !isMobile), _classNames2));
35
36
  var operationsClasses = classNames("".concat(tabPanePrefixCls, "-operations"), _defineProperty({}, "".concat(tabPanePrefixCls, "-operations-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled));
36
37
  var handleClick = function handleClick(e) {
37
38
  if (tabPaneProps.disabled) return;
package/es/tabs/tabs.js CHANGED
@@ -121,7 +121,14 @@ var Tabs = function Tabs(props) {
121
121
  isDragging.current = true;
122
122
  };
123
123
  var handleTouchMove = function handleTouchMove(e) {
124
+ var _a, _b;
124
125
  if (!isDragging.current || ListWidth <= boxWidth) return;
126
+ var path = ((_b = (_a = e.nativeEvent).composedPath) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
127
+ var isFromTabList = path.some(function (el) {
128
+ var _a, _b, _c;
129
+ 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"));
130
+ });
131
+ if (!isFromTabList) return;
125
132
  var currentX = e.touches[0].clientX;
126
133
  var deltaX = currentX - touchStartX.current;
127
134
  var newPosition = lastListPosition.current + deltaX;
@@ -7,5 +7,6 @@ declare const defaultConfig: {
7
7
  getCompLangMsg: (compLangMsgParams: import("../locale").CompLangMsgParams, customGetLangMsg?: ((componentName: string, labelName: string, params: any) => any) | undefined, localeDate?: any) => any;
8
8
  };
9
9
  direction: "ltr" | "rtl";
10
+ isMobile: boolean;
10
11
  };
11
12
  export default defaultConfig;
@@ -20,7 +20,8 @@ var defaultConfig = {
20
20
  getLangMsg: _locale.getLangMsg,
21
21
  getCompLangMsg: _locale.getCompLangMsg
22
22
  },
23
- direction: 'ltr'
23
+ direction: 'ltr',
24
+ isMobile: false
24
25
  };
25
26
  var _default = defaultConfig;
26
27
  exports.default = _default;
@@ -386,7 +386,7 @@
386
386
  max-width: var(--kd-c-tabs-pane-text-sizing-max-width);
387
387
  }
388
388
  .kd-tab-pane-text-active,
389
- .kd-tab-pane-text:hover {
389
+ .kd-tab-pane-text-notMobile:hover {
390
390
  color: var(--kd-c-tabs-color-text-active, var(--kd-g-color-theme, #5582f3));
391
391
  }
392
392
  .kd-tab-pane-text-disabled:hover {
@@ -473,12 +473,16 @@
473
473
  -ms-flex-align: center;
474
474
  align-items: center;
475
475
  }
476
- .kd-tab-pane-type-dynamic:not(.kd-tab-pane-disabled):hover .kd-tab-pane-operations span:first-child {
476
+ .kd-tab-pane-type-dynamic .kd-tab-pane-operations .kdicon {
477
+ font-size: 16px;
478
+ }
479
+ .kd-tab-pane-type-dynamic.kd-tab-pane-box-active.kd-tab-pane-isMobile:not(.kd-tab-pane-disabled):hover .kd-tab-pane-operations span:first-child {
477
480
  opacity: 1;
478
481
  cursor: pointer;
479
482
  }
480
- .kd-tab-pane-type-dynamic .kd-tab-pane-operations .kdicon {
481
- font-size: 16px;
483
+ .kd-tab-pane-type-dynamic-notMobile:not(.kd-tab-pane-disabled):hover .kd-tab-pane-operations span:first-child {
484
+ opacity: 1;
485
+ cursor: pointer;
482
486
  }
483
487
  .kd-tab-pane-type-grid {
484
488
  height: 24px;
@@ -507,7 +511,7 @@
507
511
  .kd-tab-pane-type-grid.kd-tab-pane-disabled {
508
512
  background-color: var(--kd-c-tabs-color-background-disabled, transparent);
509
513
  }
510
- .kd-tab-pane-type-grid:hover {
514
+ .kd-tab-pane-notMobile:hover {
511
515
  color: var(--kd-c-tabs-color-text-active, var(--kd-g-color-theme, #5582f3));
512
516
  }
513
517
  .kd-tab-pane-operations {
@@ -221,7 +221,7 @@
221
221
  text-overflow: ellipsis;
222
222
  max-width: @tab-pane-text-max-width;
223
223
  &-active,
224
- &:hover {
224
+ &-notMobile:hover {
225
225
  color: @tabPane-font-color-active;
226
226
  }
227
227
  &-disabled {
@@ -230,6 +230,7 @@
230
230
  }
231
231
  }
232
232
  }
233
+
233
234
  &-disabled {
234
235
  color: @tabPane-font-color-disabled;
235
236
  cursor: not-allowed;
@@ -304,6 +305,21 @@
304
305
  margin: 0 0 0 4px;
305
306
  display: inline-flex;
306
307
  align-items: center;
308
+ .@{tabPane-prefix-cls}-operations .@{icon-prefix-cls} {
309
+ font-size: 16px;
310
+ }
311
+ &.@{tabPane-prefix-cls}-box-active {
312
+ &.@{tabPane-prefix-cls}-isMobile:not(.@{tabPane-prefix-cls}-disabled):hover {
313
+ .@{tabPane-prefix-cls}-operations {
314
+ span:first-child {
315
+ opacity: 1;
316
+ cursor: pointer;
317
+ }
318
+ }
319
+ }
320
+ }
321
+ }
322
+ &-type-dynamic-notMobile {
307
323
  &:not(.@{tabPane-prefix-cls}-disabled):hover {
308
324
  .@{tabPane-prefix-cls}-operations {
309
325
  span:first-child {
@@ -312,9 +328,6 @@
312
328
  }
313
329
  }
314
330
  }
315
- .@{tabPane-prefix-cls}-operations .@{icon-prefix-cls} {
316
- font-size: 16px;
317
- }
318
331
  }
319
332
  &-type-grid {
320
333
  height: 24px;
@@ -341,6 +354,8 @@
341
354
  &.@{tabPane-prefix-cls}-disabled {
342
355
  background-color: @tab-disabled-bg;
343
356
  }
357
+ }
358
+ &-notMobile {
344
359
  &:hover {
345
360
  color: @tabPane-font-color-active;
346
361
  }
@@ -27,7 +27,8 @@ var TabPane = function TabPane(props) {
27
27
  var tabPaneRef = (0, _react.useRef)(null);
28
28
  var _useContext = (0, _react.useContext)(_ConfigContext.default),
29
29
  getPrefixCls = _useContext.getPrefixCls,
30
- prefixCls = _useContext.prefixCls;
30
+ prefixCls = _useContext.prefixCls,
31
+ isMobile = _useContext.isMobile;
31
32
  var tab = props.tab,
32
33
  id = props.id,
33
34
  className = props.className,
@@ -43,8 +44,8 @@ var TabPane = function TabPane(props) {
43
44
  tabPaneProps.disabled = context.disabled || disabled;
44
45
  }
45
46
  var tabPanePrefixCls = getPrefixCls(prefixCls, 'tab-pane');
46
- var tabPaneBoxClasses = (0, _classnames.default)(tabPanePrefixCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(tabPanePrefixCls, "-box-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(tabPanePrefixCls, "-type-")).call(_context, tabPaneProps.type), tabPaneProps.type), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context2 = "".concat(tabPanePrefixCls, "-")).call(_context2, tabPaneProps.position), tabPaneProps.position), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context3 = "".concat(tabPanePrefixCls, "-")).call(_context3, tabPaneProps.size), tabPaneProps.size), (0, _defineProperty2.default)(_classNames, "".concat(tabPanePrefixCls, "-disabled"), tabPaneProps.disabled), _classNames));
47
- var tabPaneTextClasses = (0, _classnames.default)("".concat(tabPanePrefixCls, "-text"), (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "".concat(tabPanePrefixCls, "-text-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled), (0, _defineProperty2.default)(_classNames2, "".concat(tabPanePrefixCls, "-text-disabled"), tabPaneProps.disabled), _classNames2));
47
+ var tabPaneBoxClasses = (0, _classnames.default)(tabPanePrefixCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(tabPanePrefixCls, "-box-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled), (0, _defineProperty2.default)(_classNames, "".concat(tabPanePrefixCls, "-type-dynamic-notMobile"), !isMobile), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(tabPanePrefixCls, "-type-")).call(_context, tabPaneProps.type), tabPaneProps.type), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context2 = "".concat(tabPanePrefixCls, "-")).call(_context2, tabPaneProps.position), tabPaneProps.position), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context3 = "".concat(tabPanePrefixCls, "-")).call(_context3, tabPaneProps.size), tabPaneProps.size), (0, _defineProperty2.default)(_classNames, "".concat(tabPanePrefixCls, "-disabled"), tabPaneProps.disabled), (0, _defineProperty2.default)(_classNames, "".concat(tabPanePrefixCls, "-notMobile"), !isMobile), (0, _defineProperty2.default)(_classNames, "".concat(tabPanePrefixCls, "-isMobile"), isMobile), _classNames));
48
+ var tabPaneTextClasses = (0, _classnames.default)("".concat(tabPanePrefixCls, "-text"), (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "".concat(tabPanePrefixCls, "-text-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled), (0, _defineProperty2.default)(_classNames2, "".concat(tabPanePrefixCls, "-text-disabled"), tabPaneProps.disabled), (0, _defineProperty2.default)(_classNames2, "".concat(tabPanePrefixCls, "-text-notMobile"), !isMobile), _classNames2));
48
49
  var operationsClasses = (0, _classnames.default)("".concat(tabPanePrefixCls, "-operations"), (0, _defineProperty2.default)({}, "".concat(tabPanePrefixCls, "-operations-active"), String(tabPaneProps.activeKey) === String(id) && !tabPaneProps.disabled));
49
50
  var handleClick = function handleClick(e) {
50
51
  if (tabPaneProps.disabled) return;
package/lib/tabs/tabs.js CHANGED
@@ -137,7 +137,14 @@ var Tabs = function Tabs(props) {
137
137
  isDragging.current = true;
138
138
  };
139
139
  var handleTouchMove = function handleTouchMove(e) {
140
+ var _a, _b;
140
141
  if (!isDragging.current || ListWidth <= boxWidth) return;
142
+ var path = ((_b = (_a = e.nativeEvent).composedPath) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
143
+ var isFromTabList = path.some(function (el) {
144
+ var _a, _b, _c;
145
+ 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"));
146
+ });
147
+ if (!isFromTabList) return;
141
148
  var currentX = e.touches[0].clientX;
142
149
  var deltaX = currentX - touchStartX.current;
143
150
  var newPosition = lastListPosition.current + deltaX;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.8.50",
3
+ "version": "1.8.52",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [