@kdcloudjs/kdesign 1.7.16 → 1.7.17

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 (40) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/kdesign-complete.less +12 -3
  3. package/dist/kdesign.css +10 -3
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +75 -52
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +2 -2
  8. package/dist/kdesign.min.js +6 -6
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/card/card.js +27 -17
  11. package/es/carousel/carousel.js +3 -2
  12. package/es/carousel/slideList.d.ts +1 -0
  13. package/es/carousel/slideList.js +5 -2
  14. package/es/color-picker/color-picker-panel.js +4 -3
  15. package/es/color-picker/color-picker.js +4 -2
  16. package/es/color-picker/interface.d.ts +1 -0
  17. package/es/color-picker/style/index.css +4 -1
  18. package/es/color-picker/style/index.less +5 -1
  19. package/es/dropdown/dropdown.js +7 -4
  20. package/es/dropdown/style/index.css +3 -0
  21. package/es/dropdown/style/index.less +4 -0
  22. package/es/filter/scheme.js +2 -1
  23. package/es/filter/style/index.css +2 -1
  24. package/es/filter/style/index.less +3 -2
  25. package/lib/card/card.js +27 -17
  26. package/lib/carousel/carousel.js +3 -2
  27. package/lib/carousel/slideList.d.ts +1 -0
  28. package/lib/carousel/slideList.js +5 -2
  29. package/lib/color-picker/color-picker-panel.js +4 -3
  30. package/lib/color-picker/color-picker.js +4 -2
  31. package/lib/color-picker/interface.d.ts +1 -0
  32. package/lib/color-picker/style/index.css +4 -1
  33. package/lib/color-picker/style/index.less +5 -1
  34. package/lib/dropdown/dropdown.js +7 -4
  35. package/lib/dropdown/style/index.css +3 -0
  36. package/lib/dropdown/style/index.less +4 -0
  37. package/lib/filter/scheme.js +2 -1
  38. package/lib/filter/style/index.css +2 -1
  39. package/lib/filter/style/index.less +3 -2
  40. package/package.json +1 -1
package/es/card/card.js CHANGED
@@ -1,4 +1,13 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/extends";
2
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
+ var __rest = this && this.__rest || function (s, e) {
4
+ var t = {};
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
6
+ if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
8
+ }
9
+ return t;
10
+ };
2
11
  import * as React from 'react';
3
12
  import classNames from 'classnames';
4
13
  import Checkbox from '../checkbox';
@@ -10,31 +19,32 @@ var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
19
  pkgPrefixCls = _React$useContext.prefixCls,
11
20
  userDefaultProps = _React$useContext.compDefaultProps;
12
21
  // 属性需要合并一遍用户定义的默认属性
13
- var _getCompProps = getCompProps('Card', userDefaultProps, props),
14
- tags = _getCompProps.tags,
15
- style = _getCompProps.style,
16
- title = _getCompProps.title,
17
- avatar = _getCompProps.avatar,
18
- actions = _getCompProps.actions,
19
- extra = _getCompProps.extra,
20
- children = _getCompProps.children,
21
- className = _getCompProps.className,
22
- hoverable = _getCompProps.hoverable,
23
- headStyle = _getCompProps.headStyle,
24
- bodyStyle = _getCompProps.bodyStyle,
25
- selectable = _getCompProps.selectable,
26
- checkboxProps = _getCompProps.checkboxProps,
27
- customPrefixcls = _getCompProps.prefixCls;
22
+ var _a = getCompProps('Card', userDefaultProps, props),
23
+ tags = _a.tags,
24
+ style = _a.style,
25
+ title = _a.title,
26
+ avatar = _a.avatar,
27
+ actions = _a.actions,
28
+ extra = _a.extra,
29
+ children = _a.children,
30
+ className = _a.className,
31
+ hoverable = _a.hoverable,
32
+ headStyle = _a.headStyle,
33
+ bodyStyle = _a.bodyStyle,
34
+ selectable = _a.selectable,
35
+ checkboxProps = _a.checkboxProps,
36
+ customPrefixcls = _a.prefixCls,
37
+ others = __rest(_a, ["tags", "style", "title", "avatar", "actions", "extra", "children", "className", "hoverable", "headStyle", "bodyStyle", "selectable", "checkboxProps", "prefixCls"]);
28
38
  // className前缀
29
39
  var prefixCls = getPrefixCls(pkgPrefixCls, 'card', customPrefixcls);
30
40
  var cardClassName = classNames(prefixCls, {
31
41
  hoverable: hoverable
32
42
  }, className);
33
- return /*#__PURE__*/React.createElement("div", {
43
+ return /*#__PURE__*/React.createElement("div", _extends({
34
44
  ref: ref,
35
45
  className: cardClassName,
36
46
  style: style
37
- }, title && !avatar && /*#__PURE__*/React.createElement("header", {
47
+ }, others), title && !avatar && /*#__PURE__*/React.createElement("header", {
38
48
  className: "".concat(prefixCls, "-header"),
39
49
  style: headStyle
40
50
  }, title), avatar && /*#__PURE__*/React.createElement("header", {
@@ -74,8 +74,8 @@ var InternalCarousel = function InternalCarousel(props, ref) {
74
74
  var setScrollXEffectStyle = React.useCallback(function () {
75
75
  var _context;
76
76
  if (!listRef.current) return;
77
- listRef.current.style.cssText = needAnimation ? _concatInstanceProperty(_context = "transform: translateX(".concat(posX, "px); transition:all 0.3s ")).call(_context, easing) : "transform: translateX(".concat(posX, "px); transition:'none'");
78
- }, [needAnimation, easing, posX]);
77
+ listRef.current.style.cssText = needAnimation ? _concatInstanceProperty(_context = "transform: translateX(".concat(posX, "px); transition:all 0.3s ")).call(_context, easing) : "transform: translateX(".concat(posX, "px); transition:none");
78
+ }, [children === null || children === void 0 ? void 0 : children.length, needAnimation, easing, posX]);
79
79
  var jumpTo = React.useCallback(function (index, needAnimation) {
80
80
  if (isFadeEffect) {
81
81
  if (index === -1 || index === children.length) index = 0;
@@ -213,6 +213,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
213
213
  content = /*#__PURE__*/React.createElement(SlideList, {
214
214
  items: children,
215
215
  parentPrefixCls: carouselPrefixCls,
216
+ currentIndex: currentIndex,
216
217
  ref: listRef
217
218
  });
218
219
  }
@@ -6,6 +6,7 @@ declare type ItemType = {
6
6
  export interface SlideListProps {
7
7
  parentPrefixCls: string;
8
8
  items: ItemType[];
9
+ currentIndex: number;
9
10
  }
10
11
  export declare const SlideList: React.ForwardRefExoticComponent<SlideListProps & React.RefAttributes<unknown>>;
11
12
  export {};
@@ -1,11 +1,14 @@
1
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
1
2
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
2
3
  import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
3
4
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
5
+ import classNames from 'classnames';
4
6
  import React from 'react';
5
7
  export var SlideList = /*#__PURE__*/React.forwardRef(function (props, ref) {
6
8
  var _context2;
7
9
  var items = props.items,
8
- parentPrefixCls = props.parentPrefixCls;
10
+ parentPrefixCls = props.parentPrefixCls,
11
+ currentIndex = props.currentIndex;
9
12
  var slideListPrefixCls = "".concat(parentPrefixCls, "-list-slide");
10
13
  var listPrefixCls = "".concat(parentPrefixCls, "-list");
11
14
  var renderItems = function renderItems() {
@@ -13,7 +16,7 @@ export var SlideList = /*#__PURE__*/React.forwardRef(function (props, ref) {
13
16
  var _items = _concatInstanceProperty(_context = _sliceInstanceProperty(items).call(items, -1)).call(_context, items, _sliceInstanceProperty(items).call(items, 0, 1)); // 首位分别添加一项
14
17
  return _mapInstanceProperty(_items).call(_items, function (item, index) {
15
18
  return /*#__PURE__*/React.createElement("li", {
16
- className: "".concat(listPrefixCls, "-item"),
19
+ className: classNames("".concat(listPrefixCls, "-item"), _defineProperty({}, "".concat(listPrefixCls, "-item-active"), currentIndex === index - 1)),
17
20
  key: index
18
21
  }, item);
19
22
  });
@@ -42,6 +42,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
42
42
  showColorTransfer = props.showColorTransfer,
43
43
  showPresetColor = props.showPresetColor,
44
44
  showColorPickerBox = props.showColorPickerBox,
45
+ showColorPickerPanel = props.showColorPickerPanel,
45
46
  value = props.value;
46
47
  var panelInputRef = useRef(null);
47
48
  var panelClsRef = useRef(null);
@@ -56,7 +57,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
56
57
  var panelFollowThemeCls = classNames("".concat(colorPickerPrefixCls, "-panel-switch"));
57
58
  var panelInputCls = classNames("".concat(colorPickerPrefixCls, "-panel-input"), _defineProperty({}, "".concat(colorPickerPrefixCls, "-panel-input-no-recommend"), !showPresetColor));
58
59
  var transparentCls = classNames("".concat(colorPickerPrefixCls, "-panel-transparent"));
59
- var colorDivContainerCls = classNames("".concat(colorPickerPrefixCls, "-panel-colorDivContainer"));
60
+ var colorDivContainerCls = classNames("".concat(colorPickerPrefixCls, "-panel-colorDivContainer"), _defineProperty({}, "".concat(colorPickerPrefixCls, "-panel-colorDivContainer-unset-color"), (presetColor === null || presetColor === void 0 ? void 0 : presetColor.length) === 0));
60
61
  var colorLiClick = function colorLiClick(index, colorValue) {
61
62
  var formatArr = colorFormat(colorValue, alpha);
62
63
  var formatValue = toLowerCase(formatArr[valOfCorrespondingType(currentColorType)].value);
@@ -172,7 +173,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
172
173
  useOnClickOutside([panelClsRef, inputRef], function () {
173
174
  setShowPanel(false);
174
175
  });
175
- return /*#__PURE__*/React.createElement("div", {
176
+ return /*#__PURE__*/React.createElement(React.Fragment, null, showColorPickerPanel && /*#__PURE__*/React.createElement("div", {
176
177
  className: panelCls,
177
178
  ref: panelClsRef
178
179
  }, /*#__PURE__*/React.createElement(ChromePicker, {
@@ -229,7 +230,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
229
230
  'square-click': clickedColorIndex === i
230
231
  })
231
232
  }));
232
- })));
233
+ }))));
233
234
  };
234
235
  ColorPickerPanel.displayName = 'ColorPickerPanel';
235
236
  export default ColorPickerPanel;
@@ -79,6 +79,7 @@ var ColorPicker = function ColorPicker(props) {
79
79
  var containerCls = classNames("".concat(colorPickerPrefixCls, "-container"));
80
80
  var inputCls = classNames("".concat(colorPickerPrefixCls, "-input"), className);
81
81
  var inputRef = useRef(null);
82
+ var showColorPickerPanel = showColorTransfer || typeof showPresetColor === 'boolean' && showPresetColor && (presetColor === null || presetColor === void 0 ? void 0 : presetColor.length) || typeof showPresetColor === 'undefined' || (functionalColor === null || functionalColor === void 0 ? void 0 : functionalColor.length) && showSwitch || (showColorPickerBox === null || showColorPickerBox === void 0 ? void 0 : showColorPickerBox.showBox) || (showColorPickerBox === null || showColorPickerBox === void 0 ? void 0 : showColorPickerBox.showHue) || (showColorPickerBox === null || showColorPickerBox === void 0 ? void 0 : showColorPickerBox.showOpacity);
82
83
  var setIconColor = function setIconColor(value) {
83
84
  value === functionalColorName ? setIsFollow(true) : setIsFollow(false);
84
85
  var inpValue = value === functionalColorName ? functionalColor : value;
@@ -136,7 +137,7 @@ var ColorPicker = function ColorPicker(props) {
136
137
  style: {
137
138
  backgroundColor: "".concat(colTypeArr[2].value || defaultSystemColor)
138
139
  }
139
- }, /*#__PURE__*/React.createElement(Icon, {
140
+ }, showColorPickerPanel && /*#__PURE__*/React.createElement(Icon, {
140
141
  type: "arrow-down"
141
142
  }));
142
143
  };
@@ -186,7 +187,8 @@ var ColorPicker = function ColorPicker(props) {
186
187
  colTypeArr: colTypeArr,
187
188
  setColTypeArr: setColTypeArr,
188
189
  currentColorType: currentColorType,
189
- setCurrentColorType: setCurrentColorType
190
+ setCurrentColorType: setCurrentColorType,
191
+ showColorPickerPanel: showColorPickerPanel
190
192
  });
191
193
  var popperProps = _extends(_extends({}, colorPickerProps), {
192
194
  popperClassName: popUpLayer,
@@ -58,6 +58,7 @@ export interface IColorPickerPanelProps {
58
58
  showHue?: boolean;
59
59
  showOpacity?: boolean;
60
60
  };
61
+ showColorPickerPanel: boolean;
61
62
  value: string;
62
63
  setCurrentColorType: (currentColorType: IColorTypesObj['type']) => void;
63
64
  setColTypeArr: (colTypeArr: Array<IColorTypesObj>) => void;
@@ -262,7 +262,7 @@
262
262
  font-size: var(--kd-c-color-picker-panel-select-font-size, var(--kd-g-font-size-middle, 14px));
263
263
  }
264
264
  .kd-color-picker-pop .kd-color-picker-panel-input-no-recommend {
265
- margin-bottom: 8px;
265
+ margin-bottom: 0;
266
266
  }
267
267
  .kd-color-picker-pop .kd-color-picker-panel-input .kd-select.bottomLeft,
268
268
  .kd-color-picker-pop .kd-color-picker-panel-input .kd-select.topLeft {
@@ -311,6 +311,9 @@
311
311
  grid-row-gap: 8px;
312
312
  margin-top: 12px;
313
313
  }
314
+ .kd-color-picker-pop .kd-color-picker-panel-colorDivContainer-unset-color {
315
+ margin-top: 0;
316
+ }
314
317
  .kd-color-picker-pop .kd-color-picker-panel-colorDivContainer li {
315
318
  position: relative;
316
319
  -webkit-box-sizing: border-box;
@@ -209,7 +209,7 @@
209
209
  font-size: @color-picker-panel-select-font-size;
210
210
 
211
211
  &-no-recommend {
212
- margin-bottom: 8px;
212
+ margin-bottom: 0;
213
213
  }
214
214
 
215
215
  .@{kd-prefix}-select {
@@ -266,6 +266,10 @@
266
266
  grid-row-gap: 8px;
267
267
  margin-top: 12px;
268
268
 
269
+ &-unset-color {
270
+ margin-top: 0;
271
+ }
272
+
269
273
  li {
270
274
  position: relative;
271
275
  box-sizing: border-box;
@@ -16,7 +16,7 @@ var findItem = function findItem(element) {
16
16
  }
17
17
  };
18
18
  var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
19
- var _a, _b, _c;
19
+ var _a, _b, _c, _d;
20
20
  var _React$useContext = React.useContext(ConfigContext),
21
21
  getPrefixCls = _React$useContext.getPrefixCls,
22
22
  pkgPrefixCls = _React$useContext.prefixCls,
@@ -40,14 +40,17 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
40
40
  React.useEffect(function () {
41
41
  setVisible(!!props.visible);
42
42
  }, [props.visible]);
43
- var child = /*#__PURE__*/React.cloneElement(React.Children.only(children), {
43
+ var child = children && ((_a = children === null || children === void 0 ? void 0 : children.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'Input' ? /*#__PURE__*/React.createElement("span", {
44
+ className: classNames("".concat(prefixCls, "-trigger"), "".concat(prefixCls, "-trigger-container")),
45
+ ref: ref
46
+ }, children) : /*#__PURE__*/React.cloneElement(React.Children.only(children), {
44
47
  ref: children.ref || ref,
45
48
  className: classNames("".concat(prefixCls, "-trigger"), children.props.className, {
46
49
  disabled: disabled
47
50
  })
48
51
  });
49
52
  var isMenu = menu.type === Menu;
50
- var _React$useState3 = React.useState(props.selectedKey || ((_a = menu.props) === null || _a === void 0 ? void 0 : _a.defaultKey) || props.defaultKey || ''),
53
+ var _React$useState3 = React.useState(props.selectedKey || ((_b = menu.props) === null || _b === void 0 ? void 0 : _b.defaultKey) || props.defaultKey || ''),
51
54
  _React$useState4 = _slicedToArray(_React$useState3, 2),
52
55
  selectedKey = _React$useState4[0],
53
56
  setSelectedKey = _React$useState4[1];
@@ -56,7 +59,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
56
59
  setSelectedKey(props.selectedKey);
57
60
  }
58
61
  }, [props.selectedKey]);
59
- var menuSelectable = ((_b = menu.props) === null || _b === void 0 ? void 0 : _b.selectable) === undefined ? selectable : (_c = menu.props) === null || _c === void 0 ? void 0 : _c.selectable;
62
+ var menuSelectable = ((_c = menu.props) === null || _c === void 0 ? void 0 : _c.selectable) === undefined ? selectable : (_d = menu.props) === null || _d === void 0 ? void 0 : _d.selectable;
60
63
  var handleItemClick = function handleItemClick(e) {
61
64
  var _a;
62
65
  var item = findItem(e.target);
@@ -109,6 +109,9 @@
109
109
  .kd-dropdown-trigger {
110
110
  outline: none;
111
111
  }
112
+ .kd-dropdown-trigger-container {
113
+ display: inline-block;
114
+ }
112
115
  .kd-dropdown {
113
116
  -webkit-box-sizing: border-box;
114
117
  box-sizing: border-box;
@@ -9,6 +9,10 @@
9
9
 
10
10
  .@{dropdown-trigger-prefix-cls} {
11
11
  outline: none;
12
+
13
+ &-container {
14
+ display: inline-block;
15
+ }
12
16
  }
13
17
 
14
18
  .@{dropdown-prefix-cls} {
@@ -153,8 +153,9 @@ var SchemeFilter = function SchemeFilter(props) {
153
153
  };
154
154
  var handleChangeOption = function handleChangeOption(index, value) {
155
155
  var nextScheme = cloneDeep(scheme);
156
+ var realValue = value.target !== undefined ? value.target.value : value;
156
157
  nextScheme.items[index] = _extends(_extends({}, nextScheme.items[index]), {
157
- value: value
158
+ value: realValue
158
159
  });
159
160
  setScheme(nextScheme);
160
161
  };
@@ -327,7 +327,8 @@
327
327
  list-style: none;
328
328
  }
329
329
  .kd-filter .kd-filter-body-scheme-detail > li {
330
- line-height: 40px;
330
+ line-height: normal;
331
+ padding: 7px 0 5px 0;
331
332
  color: var(--kd-g-color-text-primary, #212121);
332
333
  font-size: var(--kd-g-font-size-small, 12px);
333
334
  }
@@ -117,7 +117,7 @@
117
117
  display: block;
118
118
  }
119
119
  }
120
-
120
+
121
121
  &-condition {
122
122
  display: flex;
123
123
  font-size: @font-size-small;
@@ -221,7 +221,8 @@
221
221
  &-detail {
222
222
  list-style: none;
223
223
  > li {
224
- line-height: 40px;
224
+ line-height: normal;
225
+ padding: 7px 0 5px 0;
225
226
  color: @color-text-primary;
226
227
  font-size: @font-size-small;
227
228
 
package/lib/card/card.js CHANGED
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.default = void 0;
11
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
12
+ var _getOwnPropertySymbols = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols"));
12
13
  var React = _interopRequireWildcard(require("react"));
13
14
  var _classnames = _interopRequireDefault(require("classnames"));
14
15
  var _checkbox = _interopRequireDefault(require("../checkbox"));
@@ -16,37 +17,46 @@ var _utils = require("../_utils");
16
17
  var _configProvider = require("../config-provider");
17
18
  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); }
18
19
  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; }
20
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
21
+ var t = {};
22
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
23
+ if (s != null && typeof _getOwnPropertySymbols.default === "function") for (var i = 0, p = (0, _getOwnPropertySymbols.default)(s); i < p.length; i++) {
24
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
25
+ }
26
+ return t;
27
+ };
19
28
  var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
20
29
  var _React$useContext = React.useContext(_configProvider.ConfigContext),
21
30
  getPrefixCls = _React$useContext.getPrefixCls,
22
31
  pkgPrefixCls = _React$useContext.prefixCls,
23
32
  userDefaultProps = _React$useContext.compDefaultProps;
24
33
  // 属性需要合并一遍用户定义的默认属性
25
- var _getCompProps = (0, _utils.getCompProps)('Card', userDefaultProps, props),
26
- tags = _getCompProps.tags,
27
- style = _getCompProps.style,
28
- title = _getCompProps.title,
29
- avatar = _getCompProps.avatar,
30
- actions = _getCompProps.actions,
31
- extra = _getCompProps.extra,
32
- children = _getCompProps.children,
33
- className = _getCompProps.className,
34
- hoverable = _getCompProps.hoverable,
35
- headStyle = _getCompProps.headStyle,
36
- bodyStyle = _getCompProps.bodyStyle,
37
- selectable = _getCompProps.selectable,
38
- checkboxProps = _getCompProps.checkboxProps,
39
- customPrefixcls = _getCompProps.prefixCls;
34
+ var _a = (0, _utils.getCompProps)('Card', userDefaultProps, props),
35
+ tags = _a.tags,
36
+ style = _a.style,
37
+ title = _a.title,
38
+ avatar = _a.avatar,
39
+ actions = _a.actions,
40
+ extra = _a.extra,
41
+ children = _a.children,
42
+ className = _a.className,
43
+ hoverable = _a.hoverable,
44
+ headStyle = _a.headStyle,
45
+ bodyStyle = _a.bodyStyle,
46
+ selectable = _a.selectable,
47
+ checkboxProps = _a.checkboxProps,
48
+ customPrefixcls = _a.prefixCls,
49
+ others = __rest(_a, ["tags", "style", "title", "avatar", "actions", "extra", "children", "className", "hoverable", "headStyle", "bodyStyle", "selectable", "checkboxProps", "prefixCls"]);
40
50
  // className前缀
41
51
  var prefixCls = getPrefixCls(pkgPrefixCls, 'card', customPrefixcls);
42
52
  var cardClassName = (0, _classnames.default)(prefixCls, {
43
53
  hoverable: hoverable
44
54
  }, className);
45
- return /*#__PURE__*/React.createElement("div", {
55
+ return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
46
56
  ref: ref,
47
57
  className: cardClassName,
48
58
  style: style
49
- }, title && !avatar && /*#__PURE__*/React.createElement("header", {
59
+ }, others), title && !avatar && /*#__PURE__*/React.createElement("header", {
50
60
  className: "".concat(prefixCls, "-header"),
51
61
  style: headStyle
52
62
  }, title), avatar && /*#__PURE__*/React.createElement("header", {
@@ -88,8 +88,8 @@ var InternalCarousel = function InternalCarousel(props, ref) {
88
88
  var setScrollXEffectStyle = _react.default.useCallback(function () {
89
89
  var _context;
90
90
  if (!listRef.current) return;
91
- listRef.current.style.cssText = needAnimation ? (0, _concat.default)(_context = "transform: translateX(".concat(posX, "px); transition:all 0.3s ")).call(_context, easing) : "transform: translateX(".concat(posX, "px); transition:'none'");
92
- }, [needAnimation, easing, posX]);
91
+ listRef.current.style.cssText = needAnimation ? (0, _concat.default)(_context = "transform: translateX(".concat(posX, "px); transition:all 0.3s ")).call(_context, easing) : "transform: translateX(".concat(posX, "px); transition:none");
92
+ }, [children === null || children === void 0 ? void 0 : children.length, needAnimation, easing, posX]);
93
93
  var jumpTo = _react.default.useCallback(function (index, needAnimation) {
94
94
  if (isFadeEffect) {
95
95
  if (index === -1 || index === children.length) index = 0;
@@ -227,6 +227,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
227
227
  content = /*#__PURE__*/_react.default.createElement(_slideList.SlideList, {
228
228
  items: children,
229
229
  parentPrefixCls: carouselPrefixCls,
230
+ currentIndex: currentIndex,
230
231
  ref: listRef
231
232
  });
232
233
  }
@@ -6,6 +6,7 @@ declare type ItemType = {
6
6
  export interface SlideListProps {
7
7
  parentPrefixCls: string;
8
8
  items: ItemType[];
9
+ currentIndex: number;
9
10
  }
10
11
  export declare const SlideList: React.ForwardRefExoticComponent<SlideListProps & React.RefAttributes<unknown>>;
11
12
  export {};
@@ -5,14 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.SlideList = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
9
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
9
10
  var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
10
11
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
12
+ var _classnames = _interopRequireDefault(require("classnames"));
11
13
  var _react = _interopRequireDefault(require("react"));
12
14
  var SlideList = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
13
15
  var _context2;
14
16
  var items = props.items,
15
- parentPrefixCls = props.parentPrefixCls;
17
+ parentPrefixCls = props.parentPrefixCls,
18
+ currentIndex = props.currentIndex;
16
19
  var slideListPrefixCls = "".concat(parentPrefixCls, "-list-slide");
17
20
  var listPrefixCls = "".concat(parentPrefixCls, "-list");
18
21
  var renderItems = function renderItems() {
@@ -20,7 +23,7 @@ var SlideList = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
20
23
  var _items = (0, _concat.default)(_context = (0, _slice.default)(items).call(items, -1)).call(_context, items, (0, _slice.default)(items).call(items, 0, 1)); // 首位分别添加一项
21
24
  return (0, _map.default)(_items).call(_items, function (item, index) {
22
25
  return /*#__PURE__*/_react.default.createElement("li", {
23
- className: "".concat(listPrefixCls, "-item"),
26
+ className: (0, _classnames.default)("".concat(listPrefixCls, "-item"), (0, _defineProperty2.default)({}, "".concat(listPrefixCls, "-item-active"), currentIndex === index - 1)),
24
27
  key: index
25
28
  }, item);
26
29
  });
@@ -55,6 +55,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
55
55
  showColorTransfer = props.showColorTransfer,
56
56
  showPresetColor = props.showPresetColor,
57
57
  showColorPickerBox = props.showColorPickerBox,
58
+ showColorPickerPanel = props.showColorPickerPanel,
58
59
  value = props.value;
59
60
  var panelInputRef = (0, _react.useRef)(null);
60
61
  var panelClsRef = (0, _react.useRef)(null);
@@ -69,7 +70,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
69
70
  var panelFollowThemeCls = (0, _classnames.default)("".concat(colorPickerPrefixCls, "-panel-switch"));
70
71
  var panelInputCls = (0, _classnames.default)("".concat(colorPickerPrefixCls, "-panel-input"), (0, _defineProperty2.default)({}, "".concat(colorPickerPrefixCls, "-panel-input-no-recommend"), !showPresetColor));
71
72
  var transparentCls = (0, _classnames.default)("".concat(colorPickerPrefixCls, "-panel-transparent"));
72
- var colorDivContainerCls = (0, _classnames.default)("".concat(colorPickerPrefixCls, "-panel-colorDivContainer"));
73
+ var colorDivContainerCls = (0, _classnames.default)("".concat(colorPickerPrefixCls, "-panel-colorDivContainer"), (0, _defineProperty2.default)({}, "".concat(colorPickerPrefixCls, "-panel-colorDivContainer-unset-color"), (presetColor === null || presetColor === void 0 ? void 0 : presetColor.length) === 0));
73
74
  var colorLiClick = function colorLiClick(index, colorValue) {
74
75
  var formatArr = (0, _colorFormat.colorFormat)(colorValue, alpha);
75
76
  var formatValue = (0, _convertLetters.toLowerCase)(formatArr[(0, _colorFormat.valOfCorrespondingType)(currentColorType)].value);
@@ -185,7 +186,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
185
186
  (0, _useOnClickOutside.default)([panelClsRef, inputRef], function () {
186
187
  setShowPanel(false);
187
188
  });
188
- return /*#__PURE__*/_react.default.createElement("div", {
189
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showColorPickerPanel && /*#__PURE__*/_react.default.createElement("div", {
189
190
  className: panelCls,
190
191
  ref: panelClsRef
191
192
  }, /*#__PURE__*/_react.default.createElement(_reactColor.ChromePicker, {
@@ -242,7 +243,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
242
243
  'square-click': clickedColorIndex === i
243
244
  })
244
245
  }));
245
- })));
246
+ }))));
246
247
  };
247
248
  ColorPickerPanel.displayName = 'ColorPickerPanel';
248
249
  var _default = ColorPickerPanel;
@@ -91,6 +91,7 @@ var ColorPicker = function ColorPicker(props) {
91
91
  var containerCls = (0, _classnames.default)("".concat(colorPickerPrefixCls, "-container"));
92
92
  var inputCls = (0, _classnames.default)("".concat(colorPickerPrefixCls, "-input"), className);
93
93
  var inputRef = (0, _react.useRef)(null);
94
+ var showColorPickerPanel = showColorTransfer || typeof showPresetColor === 'boolean' && showPresetColor && (presetColor === null || presetColor === void 0 ? void 0 : presetColor.length) || typeof showPresetColor === 'undefined' || (functionalColor === null || functionalColor === void 0 ? void 0 : functionalColor.length) && showSwitch || (showColorPickerBox === null || showColorPickerBox === void 0 ? void 0 : showColorPickerBox.showBox) || (showColorPickerBox === null || showColorPickerBox === void 0 ? void 0 : showColorPickerBox.showHue) || (showColorPickerBox === null || showColorPickerBox === void 0 ? void 0 : showColorPickerBox.showOpacity);
94
95
  var setIconColor = function setIconColor(value) {
95
96
  value === functionalColorName ? setIsFollow(true) : setIsFollow(false);
96
97
  var inpValue = value === functionalColorName ? functionalColor : value;
@@ -148,7 +149,7 @@ var ColorPicker = function ColorPicker(props) {
148
149
  style: {
149
150
  backgroundColor: "".concat(colTypeArr[2].value || _defaultColor.defaultSystemColor)
150
151
  }
151
- }, /*#__PURE__*/_react.default.createElement(_index.Icon, {
152
+ }, showColorPickerPanel && /*#__PURE__*/_react.default.createElement(_index.Icon, {
152
153
  type: "arrow-down"
153
154
  }));
154
155
  };
@@ -198,7 +199,8 @@ var ColorPicker = function ColorPicker(props) {
198
199
  colTypeArr: colTypeArr,
199
200
  setColTypeArr: setColTypeArr,
200
201
  currentColorType: currentColorType,
201
- setCurrentColorType: setCurrentColorType
202
+ setCurrentColorType: setCurrentColorType,
203
+ showColorPickerPanel: showColorPickerPanel
202
204
  });
203
205
  var popperProps = (0, _extends2.default)((0, _extends2.default)({}, colorPickerProps), {
204
206
  popperClassName: popUpLayer,
@@ -58,6 +58,7 @@ export interface IColorPickerPanelProps {
58
58
  showHue?: boolean;
59
59
  showOpacity?: boolean;
60
60
  };
61
+ showColorPickerPanel: boolean;
61
62
  value: string;
62
63
  setCurrentColorType: (currentColorType: IColorTypesObj['type']) => void;
63
64
  setColTypeArr: (colTypeArr: Array<IColorTypesObj>) => void;
@@ -262,7 +262,7 @@
262
262
  font-size: var(--kd-c-color-picker-panel-select-font-size, var(--kd-g-font-size-middle, 14px));
263
263
  }
264
264
  .kd-color-picker-pop .kd-color-picker-panel-input-no-recommend {
265
- margin-bottom: 8px;
265
+ margin-bottom: 0;
266
266
  }
267
267
  .kd-color-picker-pop .kd-color-picker-panel-input .kd-select.bottomLeft,
268
268
  .kd-color-picker-pop .kd-color-picker-panel-input .kd-select.topLeft {
@@ -311,6 +311,9 @@
311
311
  grid-row-gap: 8px;
312
312
  margin-top: 12px;
313
313
  }
314
+ .kd-color-picker-pop .kd-color-picker-panel-colorDivContainer-unset-color {
315
+ margin-top: 0;
316
+ }
314
317
  .kd-color-picker-pop .kd-color-picker-panel-colorDivContainer li {
315
318
  position: relative;
316
319
  -webkit-box-sizing: border-box;
@@ -209,7 +209,7 @@
209
209
  font-size: @color-picker-panel-select-font-size;
210
210
 
211
211
  &-no-recommend {
212
- margin-bottom: 8px;
212
+ margin-bottom: 0;
213
213
  }
214
214
 
215
215
  .@{kd-prefix}-select {
@@ -266,6 +266,10 @@
266
266
  grid-row-gap: 8px;
267
267
  margin-top: 12px;
268
268
 
269
+ &-unset-color {
270
+ margin-top: 0;
271
+ }
272
+
269
273
  li {
270
274
  position: relative;
271
275
  box-sizing: border-box;
@@ -28,7 +28,7 @@ var findItem = function findItem(element) {
28
28
  }
29
29
  };
30
30
  var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
31
- var _a, _b, _c;
31
+ var _a, _b, _c, _d;
32
32
  var _React$useContext = React.useContext(_ConfigContext.default),
33
33
  getPrefixCls = _React$useContext.getPrefixCls,
34
34
  pkgPrefixCls = _React$useContext.prefixCls,
@@ -52,14 +52,17 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
52
52
  React.useEffect(function () {
53
53
  setVisible(!!props.visible);
54
54
  }, [props.visible]);
55
- var child = /*#__PURE__*/React.cloneElement(React.Children.only(children), {
55
+ var child = children && ((_a = children === null || children === void 0 ? void 0 : children.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'Input' ? /*#__PURE__*/React.createElement("span", {
56
+ className: (0, _classnames.default)("".concat(prefixCls, "-trigger"), "".concat(prefixCls, "-trigger-container")),
57
+ ref: ref
58
+ }, children) : /*#__PURE__*/React.cloneElement(React.Children.only(children), {
56
59
  ref: children.ref || ref,
57
60
  className: (0, _classnames.default)("".concat(prefixCls, "-trigger"), children.props.className, {
58
61
  disabled: disabled
59
62
  })
60
63
  });
61
64
  var isMenu = menu.type === _menu.Menu;
62
- var _React$useState3 = React.useState(props.selectedKey || ((_a = menu.props) === null || _a === void 0 ? void 0 : _a.defaultKey) || props.defaultKey || ''),
65
+ var _React$useState3 = React.useState(props.selectedKey || ((_b = menu.props) === null || _b === void 0 ? void 0 : _b.defaultKey) || props.defaultKey || ''),
63
66
  _React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
64
67
  selectedKey = _React$useState4[0],
65
68
  setSelectedKey = _React$useState4[1];
@@ -68,7 +71,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
68
71
  setSelectedKey(props.selectedKey);
69
72
  }
70
73
  }, [props.selectedKey]);
71
- var menuSelectable = ((_b = menu.props) === null || _b === void 0 ? void 0 : _b.selectable) === undefined ? selectable : (_c = menu.props) === null || _c === void 0 ? void 0 : _c.selectable;
74
+ var menuSelectable = ((_c = menu.props) === null || _c === void 0 ? void 0 : _c.selectable) === undefined ? selectable : (_d = menu.props) === null || _d === void 0 ? void 0 : _d.selectable;
72
75
  var handleItemClick = function handleItemClick(e) {
73
76
  var _a;
74
77
  var item = findItem(e.target);
@@ -109,6 +109,9 @@
109
109
  .kd-dropdown-trigger {
110
110
  outline: none;
111
111
  }
112
+ .kd-dropdown-trigger-container {
113
+ display: inline-block;
114
+ }
112
115
  .kd-dropdown {
113
116
  -webkit-box-sizing: border-box;
114
117
  box-sizing: border-box;
@@ -9,6 +9,10 @@
9
9
 
10
10
  .@{dropdown-trigger-prefix-cls} {
11
11
  outline: none;
12
+
13
+ &-container {
14
+ display: inline-block;
15
+ }
12
16
  }
13
17
 
14
18
  .@{dropdown-prefix-cls} {