yootd 0.2.13 → 0.2.14

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.
@@ -142,6 +142,9 @@ var SortableItem = function SortableItem(_ref) {
142
142
  style: {
143
143
  display: switchBtnIcon ? 'block' : 'none',
144
144
  marginLeft: switchBtnIcon ? '12px' : '0'
145
+ },
146
+ onClick: function onClick(e) {
147
+ return e.stopPropagation();
145
148
  }
146
149
  }, /*#__PURE__*/React.createElement(Switch, {
147
150
  size: "small",
@@ -160,7 +163,8 @@ var SortableItem = function SortableItem(_ref) {
160
163
  return /*#__PURE__*/React.createElement("div", {
161
164
  style: {
162
165
  height: id === activeKey ? '100%' : 0,
163
- padding: id === activeKey ? '12px 16px 12px 32px' : 0
166
+ padding: id === activeKey ? '12px 16px 12px 32px' : 0,
167
+ overflow: id === activeKey ? 'hidden' : ''
164
168
  },
165
169
  key: index,
166
170
  className: "".concat(mb.b('sub-content'), " ").concat(id === activeKey && subId === item.key ? "".concat(mb.e('sub-content-active')) : '', " ").concat(mb.b(statusColor[status !== null && status !== void 0 ? status : ''])),
@@ -68,13 +68,13 @@ export var Aside = function Aside(_ref) {
68
68
  coordinateGetter: sortableKeyboardCoordinates
69
69
  }));
70
70
  // 切换选中项
71
- var handleClick = function handleClick(key, e) {
71
+ var handleClick = function handleClick(firstKey, e) {
72
72
  console.log(key, e);
73
- if (key != null) {
73
+ if (firstKey != null && key !== firstKey) {
74
74
  var _e$children$0$key, _e$children;
75
- setKey(key);
75
+ setKey(firstKey);
76
76
  setSubKey((_e$children$0$key = e === null || e === void 0 || (_e$children = e.children) === null || _e$children === void 0 || (_e$children = _e$children[0]) === null || _e$children === void 0 ? void 0 : _e$children.key) !== null && _e$children$0$key !== void 0 ? _e$children$0$key : '');
77
- onClick === null || onClick === void 0 || onClick(key, e);
77
+ onClick === null || onClick === void 0 || onClick(firstKey, e);
78
78
  }
79
79
  };
80
80
  // 切换选中项
@@ -39,7 +39,7 @@ export type AsideProps = {
39
39
  onDragEnd?: (data: IdataItem[]) => void;
40
40
  onScrollBottom?: () => void;
41
41
  bottomThreshold?: number;
42
- isSubNode: boolean;
42
+ isSubNode?: boolean;
43
43
  onSubClick?: (key: string, subKey: string, e: IdataItem) => void;
44
44
  };
45
45
  export type AsideItemProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yootd",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "基于 Antd 二次开发的组件库",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",