@kdcloudjs/kdesign 1.7.27 → 1.7.29

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.
@@ -166,6 +166,7 @@
166
166
  opacity: 0;
167
167
  z-index: 1;
168
168
  position: absolute;
169
+ top: 0;
169
170
  background: #fff;
170
171
  -webkit-transition: opacity 0.15s ease;
171
172
  transition: opacity 0.15s ease;
@@ -181,6 +182,14 @@
181
182
  text-overflow: ellipsis;
182
183
  right: 24px;
183
184
  left: 0;
185
+ top: 0;
186
+ bottom: 0;
187
+ display: -webkit-box;
188
+ display: -ms-flexbox;
189
+ display: flex;
190
+ -webkit-box-align: center;
191
+ -ms-flex-align: center;
192
+ align-items: center;
184
193
  }
185
194
  .kd-city-picker-borderless {
186
195
  border: none;
@@ -387,6 +396,8 @@
387
396
  }
388
397
  .kd-city-picker-suffix {
389
398
  right: 0;
399
+ top: 0;
400
+ bottom: 0;
390
401
  position: absolute;
391
402
  display: -webkit-box;
392
403
  display: -ms-flexbox;
@@ -58,6 +58,7 @@
58
58
  opacity: 0;
59
59
  z-index: 1;
60
60
  position: absolute;
61
+ top: 0;
61
62
  background: #fff;
62
63
  transition: opacity 0.15s ease;
63
64
  &:hover {
@@ -74,6 +75,10 @@
74
75
  text-overflow: ellipsis;
75
76
  right: 24px;
76
77
  left: 0;
78
+ top: 0;
79
+ bottom: 0;
80
+ display: flex;
81
+ align-items: center;
77
82
  }
78
83
 
79
84
  &-borderless {
@@ -277,6 +282,8 @@
277
282
 
278
283
  &-suffix {
279
284
  right: 0;
285
+ top: 0;
286
+ bottom: 0;
280
287
  position: absolute;
281
288
  display: flex;
282
289
  flex: 0;
package/lib/grid/col.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  interface ColBase {
3
3
  span?: number;
4
4
  pull?: number;
package/lib/grid/col.js CHANGED
@@ -8,40 +8,57 @@ Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
10
  exports.default = void 0;
11
- var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
12
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
13
- var React = _interopRequireWildcard(require("react"));
12
+ var _getOwnPropertySymbols = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols"));
13
+ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
14
+ var _react = _interopRequireWildcard(require("react"));
14
15
  var _classnames = _interopRequireDefault(require("classnames"));
15
16
  var _utils = require("../_utils");
16
17
  var _configProvider = require("../config-provider");
17
18
  var _testBrowserType = require("../_utils/testBrowserType");
19
+ var _row = require("./row");
18
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
23
+ var t = {};
24
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
25
+ if (s != null && typeof _getOwnPropertySymbols.default === "function") for (var i = 0, p = (0, _getOwnPropertySymbols.default)(s); i < p.length; i++) {
26
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
27
+ }
28
+ return t;
29
+ };
20
30
  var Col = function Col(props) {
21
- var _React$useContext = React.useContext(_configProvider.ConfigContext),
31
+ var _React$useContext = _react.default.useContext(_configProvider.ConfigContext),
22
32
  getPrefixCls = _React$useContext.getPrefixCls,
23
33
  pkgPrefixCls = _React$useContext.prefixCls,
24
34
  userDefaultProps = _React$useContext.compDefaultProps;
25
35
  // 属性需要合并一遍用户定义的默认属性
26
- var _getCompProps = (0, _utils.getCompProps)('Col', userDefaultProps, props),
27
- xs = _getCompProps.xs,
28
- sm = _getCompProps.sm,
29
- md = _getCompProps.md,
30
- lg = _getCompProps.lg,
31
- xl = _getCompProps.xl,
32
- flex = _getCompProps.flex,
33
- span = _getCompProps.span,
34
- pull = _getCompProps.pull,
35
- push = _getCompProps.push,
36
- style = _getCompProps.style,
37
- order = _getCompProps.order,
38
- offset = _getCompProps.offset,
39
- winWidth = _getCompProps.winWidth,
40
- children = _getCompProps.children,
41
- className = _getCompProps.className,
42
- customPrefixcls = _getCompProps.prefixCls;
36
+ var _a = (0, _utils.getCompProps)('Col', userDefaultProps, props),
37
+ xs = _a.xs,
38
+ sm = _a.sm,
39
+ md = _a.md,
40
+ lg = _a.lg,
41
+ xl = _a.xl,
42
+ flex = _a.flex,
43
+ span = _a.span,
44
+ pull = _a.pull,
45
+ push = _a.push,
46
+ style = _a.style,
47
+ order = _a.order,
48
+ offset = _a.offset,
49
+ children = _a.children,
50
+ className = _a.className,
51
+ customPrefixcls = _a.prefixCls,
52
+ others = __rest(_a, ["xs", "sm", "md", "lg", "xl", "flex", "span", "pull", "push", "style", "order", "offset", "children", "className", "prefixCls"]);
53
+ var rowGroup = (0, _react.useContext)(_row.GapContext);
54
+ var mergedWinWidth = rowGroup.winWidth;
55
+ var gap = rowGroup.gap;
43
56
  // 浏览器名称
44
- var isSogou = (0, _testBrowserType.testBrowserType)(/^sogou/i, 0);
57
+ var isSogouOrIE = (0, _testBrowserType.testBrowserType)(/^sogou/i, 0) || /Trident|MSIE/.test(navigator.userAgent);
58
+ var colGapStyle = {
59
+ padding: "0 ".concat(gap.h / 2, "px")
60
+ };
61
+ if (isSogouOrIE && gap.v) colGapStyle.marginBottom = gap.v;
45
62
  // className前缀
46
63
  var prefixCls = getPrefixCls(pkgPrefixCls, 'col', customPrefixcls);
47
64
  var columns = 24;
@@ -52,23 +69,23 @@ var Col = function Col(props) {
52
69
  offset: offset,
53
70
  order: order
54
71
  };
55
- if (xs && winWidth > 0) {
72
+ if (xs && mergedWinWidth > 0) {
56
73
  if (xs.constructor === Number) base.span = xs;
57
74
  if (xs.constructor === Object) base = (0, _extends2.default)((0, _extends2.default)({}, base), xs);
58
75
  }
59
- if (sm && winWidth >= 600) {
76
+ if (sm && mergedWinWidth >= 600) {
60
77
  if (sm.constructor === Number) base.span = sm;
61
78
  if (sm.constructor === Object) base = (0, _extends2.default)((0, _extends2.default)({}, base), sm);
62
79
  }
63
- if (md && winWidth >= 1024) {
80
+ if (md && mergedWinWidth >= 1024) {
64
81
  if (md.constructor === Number) base.span = md;
65
82
  if (md.constructor === Object) base = (0, _extends2.default)((0, _extends2.default)({}, base), md);
66
83
  }
67
- if (lg && winWidth >= 1280) {
84
+ if (lg && mergedWinWidth >= 1280) {
68
85
  if (lg.constructor === Number) base.span = lg;
69
86
  if (lg.constructor === Object) base = (0, _extends2.default)((0, _extends2.default)({}, base), lg);
70
87
  }
71
- if (xl && winWidth >= 1920) {
88
+ if (xl && mergedWinWidth >= 1920) {
72
89
  if (xl.constructor === Number) base.span = xl;
73
90
  if (xl.constructor === Object) base = (0, _extends2.default)((0, _extends2.default)({}, base), xl);
74
91
  }
@@ -88,20 +105,18 @@ var Col = function Col(props) {
88
105
  }
89
106
  }
90
107
  }
91
- var styleString = (0, _extends2.default)({
108
+ var styleString = (0, _extends2.default)((0, _extends2.default)({
92
109
  flex: flexstr,
93
110
  maxWidth: width,
94
111
  order: base.order,
95
112
  left: base.push && base.push / columns * 100 + '%',
96
113
  right: base.pull && base.pull / columns * 100 + '%',
97
114
  marginLeft: base.offset && base.offset / columns * 100 + '%'
98
- }, style);
99
- return /*#__PURE__*/React.createElement("div", {
100
- className: (0, _classnames.default)(prefixCls, className, {
101
- 'sogou-col': isSogou
102
- }),
115
+ }, colGapStyle), style);
116
+ return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
117
+ className: (0, _classnames.default)(prefixCls, className),
103
118
  style: styleString
104
- }, children);
119
+ }, others), children);
105
120
  };
106
121
  Col.displayName = 'Col';
107
122
  var _default = Col;
package/lib/grid/row.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  declare type Align = 'top' | 'middle' | 'bottom' | 'stretch';
3
3
  declare type Justify = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
4
4
  interface gutterObject {
@@ -17,5 +17,13 @@ export interface RowProps {
17
17
  style?: React.CSSProperties;
18
18
  gutter?: number | gutterObject | Array<number | gutterObject>;
19
19
  }
20
+ export interface GridContext {
21
+ gap: {
22
+ v: number;
23
+ h: number;
24
+ };
25
+ winWidth: number;
26
+ }
27
+ export declare const GapContext: React.Context<GridContext>;
20
28
  declare const Row: React.FC<RowProps>;
21
29
  export default Row;
package/lib/grid/row.js CHANGED
@@ -7,11 +7,10 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports.default = void 0;
11
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
10
+ exports.default = exports.GapContext = void 0;
12
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
13
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
14
- var React = _interopRequireWildcard(require("react"));
13
+ var _react = _interopRequireWildcard(require("react"));
15
14
  var _classnames = _interopRequireDefault(require("classnames"));
16
15
  var _utils = require("../_utils");
17
16
  var _configProvider = require("../config-provider");
@@ -33,9 +32,16 @@ function getGap(gutter, width) {
33
32
  if (xl && width >= 1920) gap = xl;
34
33
  return gap;
35
34
  }
35
+ var GapContext = /*#__PURE__*/(0, _react.createContext)({
36
+ gap: {
37
+ h: 0,
38
+ v: 0
39
+ },
40
+ winWidth: window.innerWidth
41
+ });
42
+ exports.GapContext = GapContext;
36
43
  var Row = function Row(props) {
37
- var _context;
38
- var _React$useContext = React.useContext(_configProvider.ConfigContext),
44
+ var _React$useContext = _react.default.useContext(_configProvider.ConfigContext),
39
45
  getPrefixCls = _React$useContext.getPrefixCls,
40
46
  pkgPrefixCls = _React$useContext.prefixCls,
41
47
  userDefaultProps = _React$useContext.compDefaultProps;
@@ -50,10 +56,10 @@ var Row = function Row(props) {
50
56
  justify = _getCompProps.justify,
51
57
  customPrefixcls = _getCompProps.prefixCls;
52
58
  // 浏览器名称
53
- var isSogou = (0, _testBrowserType.testBrowserType)(/^sogou/i, 0);
59
+ var isSogouOrIe = (0, _testBrowserType.testBrowserType)(/^sogou/i, 0) || /Trident|MSIE/.test(navigator.userAgent);
54
60
  // className前缀
55
61
  var prefixCls = getPrefixCls(pkgPrefixCls, 'row', customPrefixcls);
56
- var _React$useState = React.useState(window.innerWidth),
62
+ var _React$useState = _react.default.useState(window.innerWidth),
57
63
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
58
64
  winWidth = _React$useState2[0],
59
65
  setWinWidth = _React$useState2[1];
@@ -82,9 +88,10 @@ var Row = function Row(props) {
82
88
  }
83
89
  }
84
90
  var rowStyle = {
85
- '--cgap': "".concat(gap.h, "px")
91
+ 'row-gap': "".concat(gap.v, "px"),
92
+ margin: "0 ".concat(-1 * gap.h, "px")
86
93
  };
87
- if (gap.v) rowStyle['--rgap'] = "".concat(gap.v, "px");
94
+ if (gap.v && isSogouOrIe) rowStyle['margin-bottom'] = "".concat(-1 * gap.v / 2, "px");
88
95
  var toalign = {
89
96
  top: 'flex-start',
90
97
  middle: 'center',
@@ -94,22 +101,21 @@ var Row = function Row(props) {
94
101
  start: 'flex-start',
95
102
  end: 'flex-end'
96
103
  };
97
- var styleString = (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({}, style), rowStyle), {
104
+ var styleString = (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({}, rowStyle), style), {
98
105
  alignItems: toalign[align] || align,
99
106
  justifyContent: tojustify[justify] || justify
100
107
  });
101
- return /*#__PURE__*/React.createElement("div", {
108
+ return /*#__PURE__*/_react.default.createElement(GapContext.Provider, {
109
+ value: {
110
+ gap: gap,
111
+ winWidth: winWidth
112
+ }
113
+ }, /*#__PURE__*/_react.default.createElement("div", {
102
114
  className: (0, _classnames.default)(prefixCls, className, {
103
115
  nowrap: !wrap
104
- }, {
105
- 'sogou-row': isSogou
106
116
  }),
107
117
  style: styleString
108
- }, (0, _map.default)(_context = React.Children).call(_context, children, function (child) {
109
- return /*#__PURE__*/React.cloneElement(child, {
110
- winWidth: winWidth
111
- });
112
- }));
118
+ }, children));
113
119
  };
114
120
  Row.displayName = 'Row';
115
121
  var _default = Row;
@@ -641,9 +641,9 @@ var InternalSelect = function InternalSelect(props, ref) {
641
641
  onFocus: handleFocus,
642
642
  onBlur: handleBlur,
643
643
  readOnly: !isShowSearch || !!disabled
644
- })), singleVal && !searchValue && /*#__PURE__*/_react.default.createElement("span", {
644
+ })), singleVal && !searchValue ? /*#__PURE__*/_react.default.createElement("span", {
645
645
  className: "".concat(selectPrefixCls, "-selection-item")
646
- }, singleVal), /*#__PURE__*/_react.default.createElement("span", {
646
+ }, singleVal) : null, /*#__PURE__*/_react.default.createElement("span", {
647
647
  className: "".concat(selectPrefixCls, "-placeholder"),
648
648
  style: hiddenStyle
649
649
  }, placeholder), /*#__PURE__*/_react.default.createElement("span", {
@@ -280,6 +280,14 @@
280
280
  .kd-select-icon-clear {
281
281
  opacity: 0;
282
282
  z-index: 1;
283
+ top: 0;
284
+ bottom: 0;
285
+ display: -webkit-box;
286
+ display: -ms-flexbox;
287
+ display: flex;
288
+ -webkit-box-align: center;
289
+ -ms-flex-align: center;
290
+ align-items: center;
283
291
  position: absolute;
284
292
  background: #fff;
285
293
  -webkit-transition: opacity 0.15s ease;
@@ -299,6 +307,15 @@
299
307
  text-overflow: ellipsis;
300
308
  right: 28px;
301
309
  left: 0;
310
+ top: 0;
311
+ bottom: 0;
312
+ z-index: -1;
313
+ display: -webkit-box;
314
+ display: -ms-flexbox;
315
+ display: flex;
316
+ -webkit-box-align: center;
317
+ -ms-flex-align: center;
318
+ align-items: center;
302
319
  }
303
320
  .kd-select-borderless {
304
321
  border: none;
@@ -433,18 +450,32 @@
433
450
  max-height: calc(var(--kd-c-select-sizing-height-small, 24px) * 3 - 10px);
434
451
  font-size: var(--kd-c-select-font-size-small, 12px);
435
452
  }
453
+ .kd-select-size-small .kd-select-selection-item {
454
+ min-height: calc(var(--kd-c-select-sizing-height-small, 24px) - 4px);
455
+ line-height: calc(var(--kd-c-select-sizing-height-small, 24px) - 4px);
456
+ }
436
457
  .kd-select-size-middle {
437
458
  min-height: var(--kd-c-select-sizing-height-middle, 30px);
438
459
  max-height: calc(var(--kd-c-select-sizing-height-middle, 30px) * 3 - 10px);
439
460
  font-size: var(--kd-c-select-font-size-middle, 14px);
440
461
  }
462
+ .kd-select-size-middle .kd-select-selection-item {
463
+ min-height: calc(var(--kd-c-select-sizing-height-middle, 30px) - 4px);
464
+ line-height: calc(var(--kd-c-select-sizing-height-middle, 30px) - 4px);
465
+ }
441
466
  .kd-select-size-large {
442
467
  min-height: var(--kd-c-select-sizing-height-large, 36px);
443
468
  max-height: calc(var(--kd-c-select-sizing-height-large, 36px) * 3 - 10px);
444
469
  font-size: var(--kd-c-select-font-size-large, 16px);
445
470
  }
471
+ .kd-select-size-large .kd-select-selection-item {
472
+ min-height: calc(var(--kd-c-select-sizing-height-large, 36px) - 4px);
473
+ line-height: calc(var(--kd-c-select-sizing-height-large, 36px) - 4px);
474
+ }
446
475
  .kd-select-suffix {
447
476
  right: 0;
477
+ top: 0;
478
+ bottom: 0;
448
479
  position: absolute;
449
480
  display: -webkit-box;
450
481
  display: -ms-flexbox;
@@ -467,6 +498,14 @@
467
498
  right: 28px;
468
499
  left: 0;
469
500
  height: 100%;
501
+ top: 0;
502
+ bottom: 0;
503
+ display: -webkit-box;
504
+ display: -ms-flexbox;
505
+ display: flex;
506
+ -webkit-box-align: center;
507
+ -ms-flex-align: center;
508
+ align-items: center;
470
509
  }
471
510
  .kd-select .kd-select-single .kd-select-selection-search-input {
472
511
  outline: 0;
@@ -525,9 +564,6 @@
525
564
  align-items: center;
526
565
  vertical-align: middle;
527
566
  max-width: 100%;
528
- height: 20px;
529
- line-height: 20px;
530
- margin: 2px 8px 2px 0;
531
567
  cursor: default;
532
568
  -webkit-user-select: none;
533
569
  -moz-user-select: none;
@@ -46,6 +46,10 @@
46
46
  &-clear {
47
47
  opacity: 0;
48
48
  z-index: 1;
49
+ top: 0;
50
+ bottom: 0;
51
+ display: flex;
52
+ align-items: center;
49
53
  position: absolute;
50
54
  background: #fff;
51
55
  transition: opacity 0.15s ease;
@@ -66,6 +70,11 @@
66
70
  text-overflow: ellipsis;
67
71
  right: 28px;
68
72
  left: 0;
73
+ top: 0;
74
+ bottom: 0;
75
+ z-index: -1;
76
+ display: flex;
77
+ align-items: center;
69
78
  }
70
79
 
71
80
  &-borderless {
@@ -220,6 +229,8 @@
220
229
 
221
230
  &-suffix {
222
231
  right: 0;
232
+ top: 0;
233
+ bottom: 0;
223
234
  position: absolute;
224
235
  display: flex;
225
236
  flex: 0;
@@ -235,6 +246,10 @@
235
246
  right: 28px;
236
247
  left: 0;
237
248
  height: 100%;
249
+ top: 0;
250
+ bottom: 0;
251
+ display: flex;
252
+ align-items: center;
238
253
  &-input {
239
254
  outline: 0;
240
255
  border-radius: 0;
@@ -289,9 +304,6 @@
289
304
  align-items: center;
290
305
  vertical-align: middle;
291
306
  max-width: 100%;
292
- height: 20px;
293
- line-height: 20px;
294
- margin: 2px 8px 2px 0;
295
307
  cursor: default;
296
308
  user-select: none;
297
309
  &-small {
@@ -19,6 +19,11 @@
19
19
  min-height: @height;
20
20
  max-height: calc(@maxHeight * 3 - 10px);
21
21
  font-size: @fontSize;
22
+
23
+ .@{select-prefix-cls}-selection-item {
24
+ min-height: calc(@height - 4px);
25
+ line-height: calc(@height - 4px);
26
+ }
22
27
  }
23
28
 
24
29
  .over() {
@@ -52,7 +57,6 @@
52
57
  }
53
58
  }
54
59
 
55
-
56
60
  @keyframes SlideUpIn {
57
61
  0% {
58
62
  transform: scaleY(0.8);
@@ -77,4 +81,4 @@
77
81
  transform-origin: 100% 100%;
78
82
  opacity: 0;
79
83
  }
80
- }
84
+ }
@@ -282,7 +282,7 @@
282
282
  @radio-border-width: 1px;
283
283
  @radio-margin-right: 8px;
284
284
  @radio-transition-fn: cubic-bezier(0.075, 0.82, 0.165, 1);
285
- @radio-circle-size: 13px;
285
+ @radio-circle-size: 14px;
286
286
  @radio-square-height: 32px;
287
287
  @radio-square-padding: 0 20px;
288
288
  @radio-button-height: 24px;
@@ -706,4 +706,4 @@
706
706
  @advancedSelector-dropdown-options-height: 32px;
707
707
  @advancedSelector-hover-bg: @hover-color;
708
708
 
709
- /* ----------- AdvancedSelector ——————---- end */
709
+ /* ----------- AdvancedSelector ——————---- end */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.7.27",
3
+ "version": "1.7.29",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [