yootd 0.2.50 → 0.2.51
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.
|
@@ -38,7 +38,10 @@ var SortableItem = function SortableItem(_ref) {
|
|
|
38
38
|
_ref$showEditBtn = _ref.showEditBtn,
|
|
39
39
|
showEditBtn = _ref$showEditBtn === void 0 ? true : _ref$showEditBtn,
|
|
40
40
|
_ref$showDelBtn = _ref.showDelBtn,
|
|
41
|
-
showDelBtn = _ref$showDelBtn === void 0 ? true : _ref$showDelBtn
|
|
41
|
+
showDelBtn = _ref$showDelBtn === void 0 ? true : _ref$showDelBtn,
|
|
42
|
+
customBtn = _ref.customBtn,
|
|
43
|
+
customTitle = _ref.customTitle;
|
|
44
|
+
console.log('customBtn', customBtn);
|
|
42
45
|
var _useSortable = useSortable({
|
|
43
46
|
id: id
|
|
44
47
|
}),
|
|
@@ -88,13 +91,13 @@ var SortableItem = function SortableItem(_ref) {
|
|
|
88
91
|
className: "".concat(top.b('top-left').b('top-drag-btn-icon').e('drag-btn-icon-svg'))
|
|
89
92
|
})), /*#__PURE__*/React.createElement("div", {
|
|
90
93
|
className: "".concat(top.b('top-left').b('top-title-wrap'))
|
|
91
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
94
|
+
}, customTitle ? customTitle : /*#__PURE__*/React.createElement("span", {
|
|
92
95
|
className: "".concat(top.b('top-left').b('top-title-wrap').e('top-title'), " ").concat(id === activeKey ? "".concat(top.b('top-left').b('top-title-wrap').e('top-title-active')) : ''),
|
|
93
96
|
style: {
|
|
94
97
|
marginRight: editBtnIcon || delBtnIcon ? '12px' : '0',
|
|
95
98
|
marginLeft: dragBtnIcon ? '6px' : '0'
|
|
96
99
|
}
|
|
97
|
-
}, title))), /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
}, title))), customBtn ? customBtn : /*#__PURE__*/React.createElement("div", {
|
|
98
101
|
className: "".concat(top.b('top-right'))
|
|
99
102
|
}, /*#__PURE__*/React.createElement("div", {
|
|
100
103
|
className: "".concat(top.b('top-middle')),
|
|
@@ -174,21 +177,16 @@ var SortableItem = function SortableItem(_ref) {
|
|
|
174
177
|
key: index,
|
|
175
178
|
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 : ''])),
|
|
176
179
|
onClick: function onClick() {
|
|
177
|
-
console.log(id, item.key, _objectSpread({}, item));
|
|
178
180
|
onSubClick === null || onSubClick === void 0 || onSubClick(id, item.key, _objectSpread({}, item));
|
|
179
181
|
}
|
|
180
182
|
}, /*#__PURE__*/React.createElement("div", {
|
|
181
183
|
className: "".concat(subTop)
|
|
182
184
|
}, /*#__PURE__*/React.createElement("div", {
|
|
183
185
|
className: "".concat(subTop.b('top-left'))
|
|
184
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
186
|
+
}, item.customTitle ? item.customTitle : /*#__PURE__*/React.createElement("div", {
|
|
185
187
|
className: "".concat(subTop.b('top-left').b('top-title-wrap'))
|
|
186
188
|
}, /*#__PURE__*/React.createElement("span", {
|
|
187
|
-
className: "".concat(subTop.b('top-left').b('top-title-wrap').e('top-title')
|
|
188
|
-
style: {
|
|
189
|
-
marginRight: editBtnIcon || delBtnIcon ? '12px' : '0',
|
|
190
|
-
marginLeft: dragBtnIcon ? '6px' : '0'
|
|
191
|
-
}
|
|
189
|
+
className: "".concat(subTop.b('top-left').b('top-title-wrap').e('top-title'))
|
|
192
190
|
}, item.title))), item.customBtn), /*#__PURE__*/React.createElement("div", {
|
|
193
191
|
className: "".concat(mb.b('content').b('bottom')),
|
|
194
192
|
style: {
|
package/dist/aside/index.js
CHANGED
|
@@ -236,7 +236,9 @@ export var Aside = function Aside(_ref) {
|
|
|
236
236
|
isSubNode: isSubNode,
|
|
237
237
|
subNode: item.children,
|
|
238
238
|
showDelBtn: item.showDelBtn,
|
|
239
|
-
showEditBtn: item.showEditBtn
|
|
239
|
+
showEditBtn: item.showEditBtn,
|
|
240
|
+
customBtn: item.customBtn,
|
|
241
|
+
customTitle: item.customTitle
|
|
240
242
|
});
|
|
241
243
|
})))));
|
|
242
244
|
};
|
|
@@ -2,23 +2,15 @@ import { React } from 'react';
|
|
|
2
2
|
type IdataItem = {
|
|
3
3
|
key: string;
|
|
4
4
|
title: string;
|
|
5
|
+
customTitle?: React.ReactNode;
|
|
5
6
|
extra?: string;
|
|
6
7
|
checked?: boolean;
|
|
7
8
|
status?: string;
|
|
8
9
|
data?: any;
|
|
9
10
|
showEditBtn?: boolean;
|
|
10
11
|
showDelBtn?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
title: string;
|
|
14
|
-
extra?: string;
|
|
15
|
-
checked?: boolean;
|
|
16
|
-
status?: string;
|
|
17
|
-
data?: any;
|
|
18
|
-
showEditBtn?: boolean;
|
|
19
|
-
showDelBtn?: boolean;
|
|
20
|
-
customBtn?: React.ReactNode; // 自定义按钮
|
|
21
|
-
}>;
|
|
12
|
+
customBtn?: React.ReactNode; // 自定义按钮
|
|
13
|
+
children?: IdataItem[];
|
|
22
14
|
};
|
|
23
15
|
export type AsideProps = {
|
|
24
16
|
width?: number;
|
|
@@ -53,6 +45,7 @@ export type AsideItemProps = {
|
|
|
53
45
|
activeKey: string;
|
|
54
46
|
id: string;
|
|
55
47
|
title: string;
|
|
48
|
+
customTitle?: React.ReactNode;
|
|
56
49
|
editBtnIcon?: boolean;
|
|
57
50
|
delBtnIcon?: boolean;
|
|
58
51
|
switchBtnIcon?: boolean;
|
|
@@ -61,6 +54,7 @@ export type AsideItemProps = {
|
|
|
61
54
|
extra?: string;
|
|
62
55
|
status?: string;
|
|
63
56
|
data?: any;
|
|
57
|
+
customBtn?: React.ReactNode;
|
|
64
58
|
showEditBtn?: boolean;
|
|
65
59
|
showDelBtn?: boolean;
|
|
66
60
|
onClick?: (key: string | undefined, e: IdataItem) => void;
|
|
@@ -72,6 +66,7 @@ export type AsideItemProps = {
|
|
|
72
66
|
subNode?: Array<{
|
|
73
67
|
key: string;
|
|
74
68
|
title: string;
|
|
69
|
+
customTitle?: React.ReactNode;
|
|
75
70
|
extra?: string;
|
|
76
71
|
checked?: boolean;
|
|
77
72
|
status?: string;
|