@kdcloudjs/kdesign 1.3.6 → 1.3.9

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 (58) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/kdesign-complete.less +132 -127
  3. package/dist/kdesign.css +168 -121
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +55 -28
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +3 -3
  8. package/dist/kdesign.min.js +2 -2
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/anchor/anchor.js +3 -3
  11. package/es/anchor/style/index.css +7 -7
  12. package/es/anchor/style/index.less +5 -5
  13. package/es/anchor/style/token.less +1 -1
  14. package/es/button/style/index.css +36 -0
  15. package/es/button/style/index.less +14 -2
  16. package/es/checkbox/checkbox.js +7 -3
  17. package/es/config-provider/compDefaultProps.d.ts +1 -0
  18. package/es/config-provider/compDefaultProps.js +2 -1
  19. package/es/menu/menu.js +22 -8
  20. package/es/menu/style/index.css +122 -110
  21. package/es/menu/style/index.less +51 -73
  22. package/es/menu/style/mixin.less +59 -42
  23. package/es/menu/subMenu.js +5 -4
  24. package/es/radio/radio.js +7 -3
  25. package/es/select/select.js +6 -4
  26. package/es/switch/style/index.css +1 -1
  27. package/es/switch/style/token.less +1 -1
  28. package/es/table/table.js +2 -0
  29. package/es/tree/style/index.css +1 -2
  30. package/es/tree/style/index.less +1 -2
  31. package/es/tree/style/token.less +0 -1
  32. package/es/tree/tree.js +1 -2
  33. package/es/tree/treeNode.js +1 -1
  34. package/lib/anchor/anchor.js +3 -3
  35. package/lib/anchor/style/index.css +7 -7
  36. package/lib/anchor/style/index.less +5 -5
  37. package/lib/anchor/style/token.less +1 -1
  38. package/lib/button/style/index.css +36 -0
  39. package/lib/button/style/index.less +14 -2
  40. package/lib/checkbox/checkbox.js +7 -3
  41. package/lib/config-provider/compDefaultProps.d.ts +1 -0
  42. package/lib/config-provider/compDefaultProps.js +2 -1
  43. package/lib/menu/menu.js +22 -8
  44. package/lib/menu/style/index.css +122 -110
  45. package/lib/menu/style/index.less +51 -73
  46. package/lib/menu/style/mixin.less +59 -42
  47. package/lib/menu/subMenu.js +5 -4
  48. package/lib/radio/radio.js +7 -3
  49. package/lib/select/select.js +6 -4
  50. package/lib/switch/style/index.css +1 -1
  51. package/lib/switch/style/token.less +1 -1
  52. package/lib/table/table.js +2 -0
  53. package/lib/tree/style/index.css +1 -2
  54. package/lib/tree/style/index.less +1 -2
  55. package/lib/tree/style/token.less +0 -1
  56. package/lib/tree/tree.js +1 -2
  57. package/lib/tree/treeNode.js +1 -1
  58. package/package.json +1 -1
@@ -20,12 +20,15 @@
20
20
  cursor: pointer;
21
21
 
22
22
  &-title {
23
- .menuItemTitle();
24
- }
25
-
26
- &-title > span {
27
- opacity: 1;
28
- transition: opacity calc(@menu-motion-duration - 0.1s) cubic-bezier(0,.4,.4,1);
23
+ display: flex;
24
+ align-items: center;
25
+ height: 50px;
26
+ .ellipsis();
27
+ & > span {
28
+ .ellipsis();
29
+ opacity: 1;
30
+ transition: opacity calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1);
31
+ }
29
32
  }
30
33
 
31
34
  &-collapsed {
@@ -42,7 +45,7 @@
42
45
 
43
46
  & > span {
44
47
  opacity: 0;
45
- transition: opacity calc(@menu-motion-duration - 0.1s) cubic-bezier(0,.4,.4,1);
48
+ transition: opacity calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1);
46
49
  }
47
50
  }
48
51
  }
@@ -54,76 +57,90 @@
54
57
 
55
58
  &-disabled {
56
59
  cursor: not-allowed;
57
- color: @menu-color-disabled;
58
- }
59
-
60
- &-active {
61
- .hover();
60
+ color: @menu-color-disabled !important;
61
+ background-color: @menu-color-background !important;
62
62
  }
63
63
 
64
64
  &-arrow {
65
65
  margin-left: auto;
66
66
  font-size: 16px;
67
+
67
68
  &-up {
68
69
  transform: rotate(180deg);
69
- transition: transform calc(@menu-motion-duration - 0.1s) cubic-bezier(0,.4,.4,1);
70
+ transition: transform calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1);
70
71
  }
71
72
 
72
73
  &-down {
73
74
  transform: rotate(0deg);
74
- transition: transform calc(@menu-motion-duration - 0.1s) cubic-bezier(0.4,0,0.6,1);
75
+ transition: transform calc(@menu-motion-duration - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
75
76
  }
76
77
  }
77
78
  }
78
79
 
80
+
79
81
  .hover {
80
82
  background-color: @menu-sub-color-background;
81
83
  color: @menu-sub-color-hover;
82
84
  }
83
85
 
84
- .light-hover {
85
- background-color: @menu-light-color-background-hover;
86
- color: @menu-light-color-hover;
87
- }
88
-
89
- .light-active {
90
- background-color: @menu-light-color-background-active;
91
- color: @menu-light-color-active;
92
- }
93
-
94
- .light-default {
95
- color: @menu-light-color;
96
- background: #ffffff;
86
+ .active {
87
+ background-color: @menu-sub-color-background;
88
+ color: @menu-sub-color-hover;
97
89
  }
98
90
 
99
- .menuItemTitle() {
100
- display: flex;
101
- align-items: center;
102
- height: 50px;
103
- .ellipsis();
104
- & > span {
105
- .ellipsis();
106
- }
91
+ .active-inline-title {
92
+ color: @menu-sub-color-hover !important;
93
+ background: @menu-color-background !important;
94
+ border: none;
107
95
  }
108
96
 
109
97
 
110
98
  .light {
111
99
  .light-default();
112
100
 
113
- .@{submenu-prefix-cls}-hover,
114
- .@{submenu-prefix-cls}-sub {
115
- .light-default();
101
+ .@{menuitem-prefix-cls}-disabled, .@{submenu-prefix-cls}-disabled {
102
+ background-color: #fff !important;
116
103
  }
117
104
 
118
- .@{submenu-prefix-cls}-title:hover {
119
- color: @menu-light-color-hover;
105
+ .@{submenu-prefix-cls}-sub {
106
+ color: @menu-light-color;
107
+ background: #FAFAFA;
120
108
  }
121
109
 
122
- .@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover {
110
+ .@{menuitem-prefix-cls}:hover {
123
111
  .light-hover();
124
112
  }
125
113
 
126
- .@{menuitem-prefix-cls}:not(.@{menuitem-prefix-cls}-disabled):hover {
114
+ .@{menuitem-prefix-cls}-hover, .@{submenu-prefix-cls}-hover {
127
115
  .light-hover();
128
116
  }
117
+
118
+ .@{menuitem-prefix-cls}-active, .@{submenu-prefix-cls}-active {
119
+ .light-active();
120
+ }
121
+ }
122
+
123
+ .light-default {
124
+ color: @menu-light-color;
125
+ background: #ffffff;
126
+ }
127
+
128
+ .light-hover {
129
+ background-color: @menu-light-color-background-hover;
130
+ color: @menu-light-color-hover;
131
+ border: none;
129
132
  }
133
+
134
+ .light-active {
135
+ background-color: @menu-light-color-background-active !important;
136
+ color: @menu-light-color-active !important;
137
+ border: none;
138
+ }
139
+
140
+ .light-active-inline-title {
141
+ color: @menu-light-color-active !important;
142
+ background: #ffffff !important;
143
+ border: none;
144
+ }
145
+
146
+
@@ -74,6 +74,7 @@ var SubMenu = function SubMenu(props) {
74
74
  collapsed = _a.collapsed,
75
75
  keyValue = _a.keyValue,
76
76
  selectedKey = _a.selectedKey,
77
+ selectedKeyPath = _a.selectedKeyPath,
77
78
  openKeys = _a.openKeys,
78
79
  triggerSubMenuAction = _a.triggerSubMenuAction,
79
80
  forceSubMenuRender = _a.forceSubMenuRender,
@@ -83,7 +84,7 @@ var SubMenu = function SubMenu(props) {
83
84
  handleOnOpenChange = _a.handleOnOpenChange,
84
85
  _a$paddingLeft = _a.paddingLeft,
85
86
  paddingLeft = _a$paddingLeft === void 0 ? 0 : _a$paddingLeft,
86
- restProps = __rest(_a, ["prefixCls", "theme", "mode", "title", "icon", "disabled", "children", "collapsed", "keyValue", "selectedKey", "openKeys", "triggerSubMenuAction", "forceSubMenuRender", "inlineIndent", "className", "style", "handleOnOpenChange", "paddingLeft"]);
87
+ restProps = __rest(_a, ["prefixCls", "theme", "mode", "title", "icon", "disabled", "children", "collapsed", "keyValue", "selectedKey", "selectedKeyPath", "openKeys", "triggerSubMenuAction", "forceSubMenuRender", "inlineIndent", "className", "style", "handleOnOpenChange", "paddingLeft"]);
87
88
 
88
89
  var isVertical = mode === 'vertical'; // 初始化level
89
90
 
@@ -317,7 +318,7 @@ var SubMenu = function SubMenu(props) {
317
318
  }; // eslint-disable-next-line react-hooks/rules-of-hooks
318
319
 
319
320
  var verticalView = (0, _usePopper.default)( /*#__PURE__*/_react.default.createElement("li", (0, _extends2.default)({
320
- className: (0, _classnames.default)(prefixCls, className, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "light", theme === 'light'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-collapsed"), collapsed), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-hover"), !disabled && visible), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-active"), Array.isArray(openKeys) && (0, _includes.default)(openKeys).call(openKeys, keyValue)), _classNames2)),
321
+ className: (0, _classnames.default)(prefixCls, className, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "light", theme === 'light'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-collapsed"), collapsed), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-hover"), !disabled && Array.isArray(openKeys) && (0, _includes.default)(openKeys).call(openKeys, keyValue)), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-active"), Array.isArray(selectedKeyPath) && (0, _includes.default)(selectedKeyPath).call(selectedKeyPath, keyValue)), _classNames2)),
321
322
  ref: subMenuVerticalRef,
322
323
  key: keyValue
323
324
  }, {
@@ -361,7 +362,7 @@ var SubMenu = function SubMenu(props) {
361
362
  arrow: false,
362
363
  placement: 'rightTop',
363
364
  gap: 0,
364
- visible: isVertical ? visible : false,
365
+ visible: isVertical && !disabled ? visible : false,
365
366
  disabled: isVertical ? undefined : true,
366
367
  prefixCls: 'kd-menu-popper',
367
368
  popperClassName: theme === 'light' ? 'light' : ''
@@ -374,7 +375,7 @@ var SubMenu = function SubMenu(props) {
374
375
 
375
376
  return /*#__PURE__*/_react.default.createElement("li", (0, _extends2.default)({
376
377
  ref: subMenuRef,
377
- className: (0, _classnames.default)(prefixCls, className, (_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-collapsed"), collapsed), (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-disabled"), disabled), _classNames4)),
378
+ className: (0, _classnames.default)(prefixCls, className, (_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-collapsed"), collapsed), (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-active"), Array.isArray(selectedKeyPath) && (0, _includes.default)(selectedKeyPath).call(selectedKeyPath, keyValue)), _classNames4)),
378
379
  key: keyValue
379
380
  }, mouseEvent, {
380
381
  style: style
@@ -113,6 +113,8 @@ var InternalRadio = function InternalRadio(props, ref) {
113
113
  var classString = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls), true), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-disabled"), radioProps.disabled), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-checked"), context ? radioProps.checked : isChecked), _classNames), className); // 单选包裹元素class名称
114
114
 
115
115
  (0, _react.useEffect)(function () {
116
+ var _a;
117
+
116
118
  var handleRepeatClick = function handleRepeatClick(e) {
117
119
  var element = e.target;
118
120
 
@@ -122,10 +124,12 @@ var InternalRadio = function InternalRadio(props, ref) {
122
124
  };
123
125
 
124
126
  var radioRef = mergedRef;
125
- radioRef.current.addEventListener('click', handleRepeatClick);
127
+ (_a = radioRef === null || radioRef === void 0 ? void 0 : radioRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('click', handleRepeatClick);
126
128
  return function () {
127
- // eslint-disable-next-line react-hooks/exhaustive-deps
128
- radioRef.current.removeEventListener('click', handleRepeatClick);
129
+ var _a; // eslint-disable-next-line react-hooks/exhaustive-deps
130
+
131
+
132
+ (_a = radioRef === null || radioRef === void 0 ? void 0 : radioRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', handleRepeatClick);
129
133
  };
130
134
  }, []);
131
135
  return (
@@ -91,7 +91,9 @@ var InternalSelect = function InternalSelect(props, ref) {
91
91
  placeholder = selectProps.placeholder,
92
92
  dropdownStyle = selectProps.dropdownStyle,
93
93
  style = selectProps.style,
94
- clearIcon = selectProps.clearIcon;
94
+ clearIcon = selectProps.clearIcon,
95
+ _selectProps$popperSt = selectProps.popperStyle,
96
+ popperStyle = _selectProps$popperSt === void 0 ? {} : _selectProps$popperSt;
95
97
  var isMultiple = mode === 'multiple'; // 是否多选
96
98
 
97
99
  var _useMergedState = (0, _hooks.useMergedState)(undefined, {
@@ -153,7 +155,7 @@ var InternalSelect = function InternalSelect(props, ref) {
153
155
 
154
156
  var searchCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-dropdown-search"), true)); // 下拉子项列表样式
155
157
 
156
- var dropContentCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-dropdown-scroll"), isMultiple ? (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 8 : (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 10)); // 多选底部样式
158
+ var dropContentCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-dropdown-scroll"), (isMultiple ? (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 8 : (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 10) || selectProps.dropdownRender)); // 多选底部样式
157
159
 
158
160
  var multipleFooterCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-multiple-footer"), true)); // 多选,单选公共样式
159
161
 
@@ -695,10 +697,10 @@ var InternalSelect = function InternalSelect(props, ref) {
695
697
  var _ref2 = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(),
696
698
  width = _ref2.width;
697
699
 
698
- return {
700
+ return (0, _extends2.default)({
699
701
  width: (dropdownStyle === null || dropdownStyle === void 0 ? void 0 : dropdownStyle.width) || (width > 75 ? width : 75),
700
702
  zIndex: 1050
701
- };
703
+ }, popperStyle);
702
704
  }
703
705
  };
704
706
 
@@ -185,7 +185,7 @@
185
185
  .kd-switch-size-small {
186
186
  height: var(--kd-c-switch-small-sizing-height, 16px);
187
187
  min-width: var(--kd-c-switch-small-sizing-width, 32px);
188
- line-height: var(--kd-c-switch-small-line-height, 14px);
188
+ line-height: var(--kd-c-switch-small-line-height, 16px);
189
189
  font-size: var(--kd-c-switch-small-font-size, var(--kd-g-font-size-small, 12px));
190
190
  border-radius: var(--kd-c-switch-small-radius-border, 8px);
191
191
  }
@@ -17,7 +17,7 @@
17
17
 
18
18
  // line-height
19
19
  @switch-large-line-height: var(~'@{switch-prefix}-large-line-height', 20px);
20
- @switch-small-line-height: var(~'@{switch-prefix}-small-line-height', 14px);
20
+ @switch-small-line-height: var(~'@{switch-prefix}-small-line-height', 16px);
21
21
 
22
22
  //radius
23
23
  @switch-small-border-radius: var(~'@{switch-prefix}-small-radius-border', 8px);
@@ -106,6 +106,8 @@ function Table(props) {
106
106
  });
107
107
 
108
108
  if (footerDataSource) {
109
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
110
+ // @ts-ignore
109
111
  pipeline.footerDataSource(footerDataSource);
110
112
  }
111
113
  /* -------------------------------------------------------------------------- */
@@ -140,7 +140,6 @@
140
140
  pointer-events: none;
141
141
  }
142
142
  .kd-tree-node-item {
143
- height: var(--kd-c-tree-node-sizing-height, 32px);
144
143
  display: -webkit-box;
145
144
  display: -ms-flexbox;
146
145
  display: flex;
@@ -167,7 +166,7 @@
167
166
  border-right: 10px;
168
167
  border-color: white;
169
168
  border-style: solid;
170
- height: var(--kd-c-tree-node-sizing-height, 32px);
169
+ height: 100%;
171
170
  cursor: default;
172
171
  opacity: 0;
173
172
  }
@@ -33,7 +33,6 @@
33
33
  pointer-events: none;
34
34
  }
35
35
  &-item {
36
- height: @tree-node-height;
37
36
  display: flex;
38
37
  align-items: center;
39
38
  }
@@ -54,7 +53,7 @@
54
53
  border-right: 10px;
55
54
  border-color: white;
56
55
  border-style: solid;
57
- height: @tree-node-height;
56
+ height: 100%;
58
57
  cursor: default;
59
58
  opacity: 0;
60
59
  }
@@ -13,7 +13,6 @@
13
13
  @tree-node-icon-color-text: var(~'@{tree-prefix}-node-icon-color-text', #666666);
14
14
 
15
15
  // sizing
16
- @tree-node-height: var(~'@{tree-prefix}-node-sizing-height', 32px);
17
16
  @tree-expand-icon-height: var(~'@{tree-prefix}-expand-icon-sizing-height', 22px);
18
17
  @tree-expand-icon-width: var(~'@{tree-prefix}-expand-icon-sizing-width', 22px);
19
18
  @tree-node-icon-height: var(~'@{tree-prefix}-node-icon-sizing-height', 20px);
package/lib/tree/tree.js CHANGED
@@ -89,8 +89,7 @@ var InternalTree = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
89
89
  setTreeNodeClassName = _TreeProps$setTreeNod2 === void 0 ? function () {
90
90
  return '';
91
91
  } : _TreeProps$setTreeNod2,
92
- _TreeProps$estimatedI = TreeProps.estimatedItemSize,
93
- innerEstimatedItemSize = _TreeProps$estimatedI === void 0 ? 28 : _TreeProps$estimatedI,
92
+ innerEstimatedItemSize = TreeProps.estimatedItemSize,
94
93
  style = TreeProps.style;
95
94
  var treePrefixCls = getPrefixCls(prefixCls, 'tree', customPrefixcls); // 树样式前缀
96
95
 
@@ -363,7 +363,7 @@ var TreeNode = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
363
363
  return /*#__PURE__*/_react.default.createElement("div", {
364
364
  className: (0, _classnames.default)("".concat(treeNodePrefixCls, "-item"), (0, _defineProperty2.default)({}, "".concat(treeNodePrefixCls, "-item-hover"), !disabled && selectable), (0, _defineProperty2.default)({}, "".concat(treeNodePrefixCls, "-selected"), selected && selectable && !disabled), (0, _defineProperty2.default)({}, "".concat(treeNodePrefixCls, "-disabled"), disabled), (0, _defineProperty2.default)({}, "".concat(treeNodePrefixCls, "-opened"), expandState), (0, _concat.default)(_context = "".concat(treeNodePrefixCls, "-item-")).call(_context, nodeKey), className),
365
365
  style: (0, _extends2.default)({
366
- height: "".concat(estimatedItemSize)
366
+ height: "".concat(estimatedItemSize, "px")
367
367
  }, style),
368
368
  onClick: handleClick
369
369
  }, renderNode());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.3.6",
3
+ "version": "1.3.9",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [