@leankylin-sheet/react 7.0.20 → 7.0.22
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.
- package/dist/index.css +44 -5
- package/dist/index.esm.css +44 -5
- package/dist/index.esm.js +44 -9
- package/dist/index.js +44 -9
- package/dist/index.umd.css +44 -5
- package/dist/index.umd.js +44 -9
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +3 -3
package/dist/index.css
CHANGED
|
@@ -4033,9 +4033,10 @@ label {
|
|
|
4033
4033
|
}
|
|
4034
4034
|
|
|
4035
4035
|
.leankylin-sheet-list {
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4036
|
+
display: flex;
|
|
4037
|
+
flex-direction: column;
|
|
4038
|
+
overflow: hidden;
|
|
4039
|
+
min-width: 160px;
|
|
4039
4040
|
position: absolute;
|
|
4040
4041
|
z-index: 10002;
|
|
4041
4042
|
bottom: 53px;
|
|
@@ -4043,6 +4044,41 @@ label {
|
|
|
4043
4044
|
max-height: 60%;
|
|
4044
4045
|
}
|
|
4045
4046
|
|
|
4047
|
+
.leankylin-sheet-list-search {
|
|
4048
|
+
flex-shrink: 0;
|
|
4049
|
+
padding: 6px 8px;
|
|
4050
|
+
border-bottom: 1px solid #efefef;
|
|
4051
|
+
}
|
|
4052
|
+
|
|
4053
|
+
.leankylin-sheet-list-search input {
|
|
4054
|
+
display: block;
|
|
4055
|
+
width: 100%;
|
|
4056
|
+
box-sizing: border-box;
|
|
4057
|
+
height: 26px;
|
|
4058
|
+
padding: 0 8px;
|
|
4059
|
+
font-size: 12px;
|
|
4060
|
+
color: #333;
|
|
4061
|
+
border: 1px solid #d9d9d9;
|
|
4062
|
+
border-radius: 4px;
|
|
4063
|
+
outline: none;
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
.leankylin-sheet-list-search input:focus {
|
|
4067
|
+
border-color: #68b198;
|
|
4068
|
+
}
|
|
4069
|
+
|
|
4070
|
+
.leankylin-sheet-list-content {
|
|
4071
|
+
flex: 1;
|
|
4072
|
+
overflow-y: auto;
|
|
4073
|
+
overflow-x: hidden;
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
.leankylin-sheet-list-empty {
|
|
4077
|
+
padding: 8px 15px;
|
|
4078
|
+
font-size: 12px;
|
|
4079
|
+
color: #999;
|
|
4080
|
+
}
|
|
4081
|
+
|
|
4046
4082
|
.leankylin-sheet-list-item {
|
|
4047
4083
|
display:flex;
|
|
4048
4084
|
word-break: break-all;
|
|
@@ -4050,7 +4086,10 @@ label {
|
|
|
4050
4086
|
padding-top: 6px;
|
|
4051
4087
|
padding-bottom: 6px;
|
|
4052
4088
|
width: 100%;
|
|
4089
|
+
margin-top: 2px;
|
|
4090
|
+
margin-bottom: 2px;
|
|
4053
4091
|
margin-right: 46px;
|
|
4092
|
+
border-radius: 4px;
|
|
4054
4093
|
cursor: pointer;
|
|
4055
4094
|
}
|
|
4056
4095
|
|
|
@@ -4060,14 +4099,14 @@ label {
|
|
|
4060
4099
|
}
|
|
4061
4100
|
|
|
4062
4101
|
.leankylin-sheet-list-item-name .luckysheet-sheets-list-item-color {
|
|
4063
|
-
width:
|
|
4102
|
+
width: 4px;
|
|
4064
4103
|
height: 100%;
|
|
4065
4104
|
position: absolute;
|
|
4066
4105
|
bottom: 0;
|
|
4067
4106
|
left: -6px;
|
|
4068
4107
|
}
|
|
4069
4108
|
|
|
4070
|
-
.leankylin-sheet-list
|
|
4109
|
+
.leankylin-sheet-list-item:hover {
|
|
4071
4110
|
background-color: #EFEFEF;
|
|
4072
4111
|
}
|
|
4073
4112
|
|
package/dist/index.esm.css
CHANGED
|
@@ -4033,9 +4033,10 @@ label {
|
|
|
4033
4033
|
}
|
|
4034
4034
|
|
|
4035
4035
|
.leankylin-sheet-list {
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4036
|
+
display: flex;
|
|
4037
|
+
flex-direction: column;
|
|
4038
|
+
overflow: hidden;
|
|
4039
|
+
min-width: 160px;
|
|
4039
4040
|
position: absolute;
|
|
4040
4041
|
z-index: 10002;
|
|
4041
4042
|
bottom: 53px;
|
|
@@ -4043,6 +4044,41 @@ label {
|
|
|
4043
4044
|
max-height: 60%;
|
|
4044
4045
|
}
|
|
4045
4046
|
|
|
4047
|
+
.leankylin-sheet-list-search {
|
|
4048
|
+
flex-shrink: 0;
|
|
4049
|
+
padding: 6px 8px;
|
|
4050
|
+
border-bottom: 1px solid #efefef;
|
|
4051
|
+
}
|
|
4052
|
+
|
|
4053
|
+
.leankylin-sheet-list-search input {
|
|
4054
|
+
display: block;
|
|
4055
|
+
width: 100%;
|
|
4056
|
+
box-sizing: border-box;
|
|
4057
|
+
height: 26px;
|
|
4058
|
+
padding: 0 8px;
|
|
4059
|
+
font-size: 12px;
|
|
4060
|
+
color: #333;
|
|
4061
|
+
border: 1px solid #d9d9d9;
|
|
4062
|
+
border-radius: 4px;
|
|
4063
|
+
outline: none;
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
.leankylin-sheet-list-search input:focus {
|
|
4067
|
+
border-color: #68b198;
|
|
4068
|
+
}
|
|
4069
|
+
|
|
4070
|
+
.leankylin-sheet-list-content {
|
|
4071
|
+
flex: 1;
|
|
4072
|
+
overflow-y: auto;
|
|
4073
|
+
overflow-x: hidden;
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
.leankylin-sheet-list-empty {
|
|
4077
|
+
padding: 8px 15px;
|
|
4078
|
+
font-size: 12px;
|
|
4079
|
+
color: #999;
|
|
4080
|
+
}
|
|
4081
|
+
|
|
4046
4082
|
.leankylin-sheet-list-item {
|
|
4047
4083
|
display:flex;
|
|
4048
4084
|
word-break: break-all;
|
|
@@ -4050,7 +4086,10 @@ label {
|
|
|
4050
4086
|
padding-top: 6px;
|
|
4051
4087
|
padding-bottom: 6px;
|
|
4052
4088
|
width: 100%;
|
|
4089
|
+
margin-top: 2px;
|
|
4090
|
+
margin-bottom: 2px;
|
|
4053
4091
|
margin-right: 46px;
|
|
4092
|
+
border-radius: 4px;
|
|
4054
4093
|
cursor: pointer;
|
|
4055
4094
|
}
|
|
4056
4095
|
|
|
@@ -4060,14 +4099,14 @@ label {
|
|
|
4060
4099
|
}
|
|
4061
4100
|
|
|
4062
4101
|
.leankylin-sheet-list-item-name .luckysheet-sheets-list-item-color {
|
|
4063
|
-
width:
|
|
4102
|
+
width: 4px;
|
|
4064
4103
|
height: 100%;
|
|
4065
4104
|
position: absolute;
|
|
4066
4105
|
bottom: 0;
|
|
4067
4106
|
left: -6px;
|
|
4068
4107
|
}
|
|
4069
4108
|
|
|
4070
|
-
.leankylin-sheet-list
|
|
4109
|
+
.leankylin-sheet-list-item:hover {
|
|
4071
4110
|
background-color: #EFEFEF;
|
|
4072
4111
|
}
|
|
4073
4112
|
|
package/dist/index.esm.js
CHANGED
|
@@ -8178,6 +8178,7 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
8178
8178
|
setNextSheet(draftCtx, sheet.id, refs);
|
|
8179
8179
|
});
|
|
8180
8180
|
});
|
|
8181
|
+
var isActive = context.currentSheetId === sheet.id;
|
|
8181
8182
|
return /*#__PURE__*/React.createElement("div", {
|
|
8182
8183
|
onDragOver: function onDragOver(e) {
|
|
8183
8184
|
e.preventDefault();
|
|
@@ -8200,7 +8201,7 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
8200
8201
|
draggable: context.allowEdit && !settings.disabledMoveSheet && !editing,
|
|
8201
8202
|
key: sheet.id,
|
|
8202
8203
|
ref: containerRef,
|
|
8203
|
-
className: isDropPlaceholder ? "leankylin-sheettab-placeholder" : "luckysheet-sheets-item".concat(
|
|
8204
|
+
className: isDropPlaceholder ? "leankylin-sheettab-placeholder" : "luckysheet-sheets-item".concat(isActive ? " luckysheet-sheets-item-active" : ""),
|
|
8204
8205
|
onClick: onChangeSheet,
|
|
8205
8206
|
onContextMenu: function onContextMenu(e) {
|
|
8206
8207
|
if (isDropPlaceholder) return;
|
|
@@ -8223,7 +8224,9 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
8223
8224
|
},
|
|
8224
8225
|
style: {
|
|
8225
8226
|
borderLeft: dragOver ? "2px solid #0188fb" : "",
|
|
8226
|
-
display: sheet.hide === 1 ? "none" : ""
|
|
8227
|
+
display: sheet.hide === 1 ? "none" : "",
|
|
8228
|
+
background: isActive ? "#f5f5f5" : sheet.color || "",
|
|
8229
|
+
color: isActive ? "#2E8B6E" : ""
|
|
8227
8230
|
}
|
|
8228
8231
|
}, /*#__PURE__*/React.createElement("span", {
|
|
8229
8232
|
className: "luckysheet-sheets-item-name",
|
|
@@ -8270,7 +8273,7 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
8270
8273
|
style: {
|
|
8271
8274
|
fill: svgColor
|
|
8272
8275
|
}
|
|
8273
|
-
})), !!sheet.color && ( /*#__PURE__*/React.createElement("div", {
|
|
8276
|
+
})), !!sheet.color && isActive && ( /*#__PURE__*/React.createElement("div", {
|
|
8274
8277
|
className: "luckysheet-sheets-item-color",
|
|
8275
8278
|
style: {
|
|
8276
8279
|
background: sheet.color
|
|
@@ -12024,10 +12027,15 @@ var SheetListItem = function SheetListItem(_ref) {
|
|
|
12024
12027
|
draftCtx.luckysheet_selection_range = [];
|
|
12025
12028
|
});
|
|
12026
12029
|
}, [context.currentSheetId, context.sheetScrollRecord, setContext]);
|
|
12030
|
+
var isActive = sheet.id === context.currentSheetId;
|
|
12027
12031
|
return /*#__PURE__*/React.createElement("div", {
|
|
12028
12032
|
className: "leankylin-sheet-list-item",
|
|
12029
12033
|
key: sheet.id,
|
|
12030
12034
|
ref: containerRef,
|
|
12035
|
+
style: {
|
|
12036
|
+
background: isActive ? "#f5f5f5" : sheet.color || "",
|
|
12037
|
+
color: isActive ? "#2E8B6E" : ""
|
|
12038
|
+
},
|
|
12031
12039
|
onClick: function onClick() {
|
|
12032
12040
|
if (isDropPlaceholder) return;
|
|
12033
12041
|
setContext(function (draftCtx) {
|
|
@@ -12046,7 +12054,7 @@ var SheetListItem = function SheetListItem(_ref) {
|
|
|
12046
12054
|
}
|
|
12047
12055
|
}, /*#__PURE__*/React.createElement("span", {
|
|
12048
12056
|
className: "leankylin-sheet-selected-check-sapce"
|
|
12049
|
-
},
|
|
12057
|
+
}, isActive && ( /*#__PURE__*/React.createElement(SVGIcon, {
|
|
12050
12058
|
name: "check",
|
|
12051
12059
|
width: 16,
|
|
12052
12060
|
height: 16,
|
|
@@ -12057,7 +12065,7 @@ var SheetListItem = function SheetListItem(_ref) {
|
|
|
12057
12065
|
}))), /*#__PURE__*/React.createElement("span", {
|
|
12058
12066
|
className: "luckysheet-sheets-item-name leankylin-sheet-list-item-name",
|
|
12059
12067
|
spellCheck: "false"
|
|
12060
|
-
}, !!sheet.color && ( /*#__PURE__*/React.createElement("div", {
|
|
12068
|
+
}, !!sheet.color && isActive && ( /*#__PURE__*/React.createElement("div", {
|
|
12061
12069
|
className: "luckysheet-sheets-list-item-color",
|
|
12062
12070
|
style: {
|
|
12063
12071
|
background: sheet.color
|
|
@@ -12072,23 +12080,50 @@ var SheetList = function SheetList() {
|
|
|
12072
12080
|
context = _useContext.context,
|
|
12073
12081
|
setContext = _useContext.setContext;
|
|
12074
12082
|
var containerRef = useRef(null);
|
|
12083
|
+
var _useState = useState(""),
|
|
12084
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12085
|
+
searchText = _useState2[0],
|
|
12086
|
+
setSearchText = _useState2[1];
|
|
12075
12087
|
var close = useCallback(function () {
|
|
12076
12088
|
setContext(function (ctx) {
|
|
12077
12089
|
ctx.showSheetList = false;
|
|
12078
12090
|
});
|
|
12079
12091
|
}, [setContext]);
|
|
12080
12092
|
useOutsideClick(containerRef, close, [close]);
|
|
12093
|
+
var sheetList = _.sortBy(context.luckysheetfile, function (s) {
|
|
12094
|
+
return Number(s.order);
|
|
12095
|
+
});
|
|
12096
|
+
var keyword = searchText.trim();
|
|
12097
|
+
var lowerKeyword = keyword.toLowerCase();
|
|
12098
|
+
var filteredList = keyword ? sheetList.filter(function (s) {
|
|
12099
|
+
var _s$name;
|
|
12100
|
+
return ((_s$name = s.name) !== null && _s$name !== void 0 ? _s$name : "").toLowerCase().includes(lowerKeyword);
|
|
12101
|
+
}) : sheetList;
|
|
12081
12102
|
return /*#__PURE__*/React.createElement("div", {
|
|
12082
12103
|
className: "leankylin-context-menu luckysheet-cols-menu leankylin-sheet-list",
|
|
12083
12104
|
ref: containerRef
|
|
12084
|
-
},
|
|
12085
|
-
|
|
12086
|
-
}
|
|
12105
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
12106
|
+
className: "leankylin-sheet-list-search"
|
|
12107
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
12108
|
+
value: searchText,
|
|
12109
|
+
placeholder: "\u641C\u7D22\u5DE5\u4F5C\u8868",
|
|
12110
|
+
onChange: function onChange(e) {
|
|
12111
|
+
return setSearchText(e.target.value);
|
|
12112
|
+
},
|
|
12113
|
+
onKeyDown: function onKeyDown(e) {
|
|
12114
|
+
e.stopPropagation();
|
|
12115
|
+
if (e.key === "Escape") close();
|
|
12116
|
+
}
|
|
12117
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
12118
|
+
className: "leankylin-sheet-list-content"
|
|
12119
|
+
}, filteredList.length === 0 && ( /*#__PURE__*/React.createElement("div", {
|
|
12120
|
+
className: "leankylin-sheet-list-empty"
|
|
12121
|
+
}, "\u672A\u627E\u5230\u5339\u914D\u7684\u5DE5\u4F5C\u8868")), filteredList.map(function (singleSheet) {
|
|
12087
12122
|
return /*#__PURE__*/React.createElement(SheetListItem, {
|
|
12088
12123
|
sheet: singleSheet,
|
|
12089
12124
|
key: singleSheet.id
|
|
12090
12125
|
});
|
|
12091
|
-
}));
|
|
12126
|
+
})));
|
|
12092
12127
|
};
|
|
12093
12128
|
|
|
12094
12129
|
var _excluded = ["onChange", "onOp", "data"];
|
package/dist/index.js
CHANGED
|
@@ -8188,6 +8188,7 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
8188
8188
|
core.setNextSheet(draftCtx, sheet.id, refs);
|
|
8189
8189
|
});
|
|
8190
8190
|
});
|
|
8191
|
+
var isActive = context.currentSheetId === sheet.id;
|
|
8191
8192
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
8192
8193
|
onDragOver: function onDragOver(e) {
|
|
8193
8194
|
e.preventDefault();
|
|
@@ -8210,7 +8211,7 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
8210
8211
|
draggable: context.allowEdit && !settings.disabledMoveSheet && !editing,
|
|
8211
8212
|
key: sheet.id,
|
|
8212
8213
|
ref: containerRef,
|
|
8213
|
-
className: isDropPlaceholder ? "leankylin-sheettab-placeholder" : "luckysheet-sheets-item".concat(
|
|
8214
|
+
className: isDropPlaceholder ? "leankylin-sheettab-placeholder" : "luckysheet-sheets-item".concat(isActive ? " luckysheet-sheets-item-active" : ""),
|
|
8214
8215
|
onClick: onChangeSheet,
|
|
8215
8216
|
onContextMenu: function onContextMenu(e) {
|
|
8216
8217
|
if (isDropPlaceholder) return;
|
|
@@ -8233,7 +8234,9 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
8233
8234
|
},
|
|
8234
8235
|
style: {
|
|
8235
8236
|
borderLeft: dragOver ? "2px solid #0188fb" : "",
|
|
8236
|
-
display: sheet.hide === 1 ? "none" : ""
|
|
8237
|
+
display: sheet.hide === 1 ? "none" : "",
|
|
8238
|
+
background: isActive ? "#f5f5f5" : sheet.color || "",
|
|
8239
|
+
color: isActive ? "#2E8B6E" : ""
|
|
8237
8240
|
}
|
|
8238
8241
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
8239
8242
|
className: "luckysheet-sheets-item-name",
|
|
@@ -8280,7 +8283,7 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
8280
8283
|
style: {
|
|
8281
8284
|
fill: svgColor
|
|
8282
8285
|
}
|
|
8283
|
-
})), !!sheet.color && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
8286
|
+
})), !!sheet.color && isActive && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
8284
8287
|
className: "luckysheet-sheets-item-color",
|
|
8285
8288
|
style: {
|
|
8286
8289
|
background: sheet.color
|
|
@@ -12034,10 +12037,15 @@ var SheetListItem = function SheetListItem(_ref) {
|
|
|
12034
12037
|
draftCtx.luckysheet_selection_range = [];
|
|
12035
12038
|
});
|
|
12036
12039
|
}, [context.currentSheetId, context.sheetScrollRecord, setContext]);
|
|
12040
|
+
var isActive = sheet.id === context.currentSheetId;
|
|
12037
12041
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12038
12042
|
className: "leankylin-sheet-list-item",
|
|
12039
12043
|
key: sheet.id,
|
|
12040
12044
|
ref: containerRef,
|
|
12045
|
+
style: {
|
|
12046
|
+
background: isActive ? "#f5f5f5" : sheet.color || "",
|
|
12047
|
+
color: isActive ? "#2E8B6E" : ""
|
|
12048
|
+
},
|
|
12041
12049
|
onClick: function onClick() {
|
|
12042
12050
|
if (isDropPlaceholder) return;
|
|
12043
12051
|
setContext(function (draftCtx) {
|
|
@@ -12056,7 +12064,7 @@ var SheetListItem = function SheetListItem(_ref) {
|
|
|
12056
12064
|
}
|
|
12057
12065
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
12058
12066
|
className: "leankylin-sheet-selected-check-sapce"
|
|
12059
|
-
},
|
|
12067
|
+
}, isActive && ( /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
12060
12068
|
name: "check",
|
|
12061
12069
|
width: 16,
|
|
12062
12070
|
height: 16,
|
|
@@ -12067,7 +12075,7 @@ var SheetListItem = function SheetListItem(_ref) {
|
|
|
12067
12075
|
}))), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
12068
12076
|
className: "luckysheet-sheets-item-name leankylin-sheet-list-item-name",
|
|
12069
12077
|
spellCheck: "false"
|
|
12070
|
-
}, !!sheet.color && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12078
|
+
}, !!sheet.color && isActive && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12071
12079
|
className: "luckysheet-sheets-list-item-color",
|
|
12072
12080
|
style: {
|
|
12073
12081
|
background: sheet.color
|
|
@@ -12082,23 +12090,50 @@ var SheetList = function SheetList() {
|
|
|
12082
12090
|
context = _useContext.context,
|
|
12083
12091
|
setContext = _useContext.setContext;
|
|
12084
12092
|
var containerRef = React.useRef(null);
|
|
12093
|
+
var _useState = React.useState(""),
|
|
12094
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12095
|
+
searchText = _useState2[0],
|
|
12096
|
+
setSearchText = _useState2[1];
|
|
12085
12097
|
var close = React.useCallback(function () {
|
|
12086
12098
|
setContext(function (ctx) {
|
|
12087
12099
|
ctx.showSheetList = false;
|
|
12088
12100
|
});
|
|
12089
12101
|
}, [setContext]);
|
|
12090
12102
|
useOutsideClick(containerRef, close, [close]);
|
|
12103
|
+
var sheetList = ___default['default'].sortBy(context.luckysheetfile, function (s) {
|
|
12104
|
+
return Number(s.order);
|
|
12105
|
+
});
|
|
12106
|
+
var keyword = searchText.trim();
|
|
12107
|
+
var lowerKeyword = keyword.toLowerCase();
|
|
12108
|
+
var filteredList = keyword ? sheetList.filter(function (s) {
|
|
12109
|
+
var _s$name;
|
|
12110
|
+
return ((_s$name = s.name) !== null && _s$name !== void 0 ? _s$name : "").toLowerCase().includes(lowerKeyword);
|
|
12111
|
+
}) : sheetList;
|
|
12091
12112
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12092
12113
|
className: "leankylin-context-menu luckysheet-cols-menu leankylin-sheet-list",
|
|
12093
12114
|
ref: containerRef
|
|
12094
|
-
},
|
|
12095
|
-
|
|
12096
|
-
}
|
|
12115
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12116
|
+
className: "leankylin-sheet-list-search"
|
|
12117
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
12118
|
+
value: searchText,
|
|
12119
|
+
placeholder: "\u641C\u7D22\u5DE5\u4F5C\u8868",
|
|
12120
|
+
onChange: function onChange(e) {
|
|
12121
|
+
return setSearchText(e.target.value);
|
|
12122
|
+
},
|
|
12123
|
+
onKeyDown: function onKeyDown(e) {
|
|
12124
|
+
e.stopPropagation();
|
|
12125
|
+
if (e.key === "Escape") close();
|
|
12126
|
+
}
|
|
12127
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12128
|
+
className: "leankylin-sheet-list-content"
|
|
12129
|
+
}, filteredList.length === 0 && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12130
|
+
className: "leankylin-sheet-list-empty"
|
|
12131
|
+
}, "\u672A\u627E\u5230\u5339\u914D\u7684\u5DE5\u4F5C\u8868")), filteredList.map(function (singleSheet) {
|
|
12097
12132
|
return /*#__PURE__*/React__default['default'].createElement(SheetListItem, {
|
|
12098
12133
|
sheet: singleSheet,
|
|
12099
12134
|
key: singleSheet.id
|
|
12100
12135
|
});
|
|
12101
|
-
}));
|
|
12136
|
+
})));
|
|
12102
12137
|
};
|
|
12103
12138
|
|
|
12104
12139
|
var _excluded = ["onChange", "onOp", "data"];
|
package/dist/index.umd.css
CHANGED
|
@@ -4033,9 +4033,10 @@ label {
|
|
|
4033
4033
|
}
|
|
4034
4034
|
|
|
4035
4035
|
.leankylin-sheet-list {
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4036
|
+
display: flex;
|
|
4037
|
+
flex-direction: column;
|
|
4038
|
+
overflow: hidden;
|
|
4039
|
+
min-width: 160px;
|
|
4039
4040
|
position: absolute;
|
|
4040
4041
|
z-index: 10002;
|
|
4041
4042
|
bottom: 53px;
|
|
@@ -4043,6 +4044,41 @@ label {
|
|
|
4043
4044
|
max-height: 60%;
|
|
4044
4045
|
}
|
|
4045
4046
|
|
|
4047
|
+
.leankylin-sheet-list-search {
|
|
4048
|
+
flex-shrink: 0;
|
|
4049
|
+
padding: 6px 8px;
|
|
4050
|
+
border-bottom: 1px solid #efefef;
|
|
4051
|
+
}
|
|
4052
|
+
|
|
4053
|
+
.leankylin-sheet-list-search input {
|
|
4054
|
+
display: block;
|
|
4055
|
+
width: 100%;
|
|
4056
|
+
box-sizing: border-box;
|
|
4057
|
+
height: 26px;
|
|
4058
|
+
padding: 0 8px;
|
|
4059
|
+
font-size: 12px;
|
|
4060
|
+
color: #333;
|
|
4061
|
+
border: 1px solid #d9d9d9;
|
|
4062
|
+
border-radius: 4px;
|
|
4063
|
+
outline: none;
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
.leankylin-sheet-list-search input:focus {
|
|
4067
|
+
border-color: #68b198;
|
|
4068
|
+
}
|
|
4069
|
+
|
|
4070
|
+
.leankylin-sheet-list-content {
|
|
4071
|
+
flex: 1;
|
|
4072
|
+
overflow-y: auto;
|
|
4073
|
+
overflow-x: hidden;
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
.leankylin-sheet-list-empty {
|
|
4077
|
+
padding: 8px 15px;
|
|
4078
|
+
font-size: 12px;
|
|
4079
|
+
color: #999;
|
|
4080
|
+
}
|
|
4081
|
+
|
|
4046
4082
|
.leankylin-sheet-list-item {
|
|
4047
4083
|
display:flex;
|
|
4048
4084
|
word-break: break-all;
|
|
@@ -4050,7 +4086,10 @@ label {
|
|
|
4050
4086
|
padding-top: 6px;
|
|
4051
4087
|
padding-bottom: 6px;
|
|
4052
4088
|
width: 100%;
|
|
4089
|
+
margin-top: 2px;
|
|
4090
|
+
margin-bottom: 2px;
|
|
4053
4091
|
margin-right: 46px;
|
|
4092
|
+
border-radius: 4px;
|
|
4054
4093
|
cursor: pointer;
|
|
4055
4094
|
}
|
|
4056
4095
|
|
|
@@ -4060,14 +4099,14 @@ label {
|
|
|
4060
4099
|
}
|
|
4061
4100
|
|
|
4062
4101
|
.leankylin-sheet-list-item-name .luckysheet-sheets-list-item-color {
|
|
4063
|
-
width:
|
|
4102
|
+
width: 4px;
|
|
4064
4103
|
height: 100%;
|
|
4065
4104
|
position: absolute;
|
|
4066
4105
|
bottom: 0;
|
|
4067
4106
|
left: -6px;
|
|
4068
4107
|
}
|
|
4069
4108
|
|
|
4070
|
-
.leankylin-sheet-list
|
|
4109
|
+
.leankylin-sheet-list-item:hover {
|
|
4071
4110
|
background-color: #EFEFEF;
|
|
4072
4111
|
}
|
|
4073
4112
|
|
package/dist/index.umd.js
CHANGED
|
@@ -27262,6 +27262,7 @@
|
|
|
27262
27262
|
core.setNextSheet(draftCtx, sheet.id, refs);
|
|
27263
27263
|
});
|
|
27264
27264
|
});
|
|
27265
|
+
var isActive = context.currentSheetId === sheet.id;
|
|
27265
27266
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27266
27267
|
onDragOver: function onDragOver(e) {
|
|
27267
27268
|
e.preventDefault();
|
|
@@ -27284,7 +27285,7 @@
|
|
|
27284
27285
|
draggable: context.allowEdit && !settings.disabledMoveSheet && !editing,
|
|
27285
27286
|
key: sheet.id,
|
|
27286
27287
|
ref: containerRef,
|
|
27287
|
-
className: isDropPlaceholder ? "leankylin-sheettab-placeholder" : "luckysheet-sheets-item".concat(
|
|
27288
|
+
className: isDropPlaceholder ? "leankylin-sheettab-placeholder" : "luckysheet-sheets-item".concat(isActive ? " luckysheet-sheets-item-active" : ""),
|
|
27288
27289
|
onClick: onChangeSheet,
|
|
27289
27290
|
onContextMenu: function onContextMenu(e) {
|
|
27290
27291
|
if (isDropPlaceholder) return;
|
|
@@ -27307,7 +27308,9 @@
|
|
|
27307
27308
|
},
|
|
27308
27309
|
style: {
|
|
27309
27310
|
borderLeft: dragOver ? "2px solid #0188fb" : "",
|
|
27310
|
-
display: sheet.hide === 1 ? "none" : ""
|
|
27311
|
+
display: sheet.hide === 1 ? "none" : "",
|
|
27312
|
+
background: isActive ? "#f5f5f5" : sheet.color || "",
|
|
27313
|
+
color: isActive ? "#2E8B6E" : ""
|
|
27311
27314
|
}
|
|
27312
27315
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
27313
27316
|
className: "luckysheet-sheets-item-name",
|
|
@@ -27354,7 +27357,7 @@
|
|
|
27354
27357
|
style: {
|
|
27355
27358
|
fill: svgColor
|
|
27356
27359
|
}
|
|
27357
|
-
})), !!sheet.color && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27360
|
+
})), !!sheet.color && isActive && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27358
27361
|
className: "luckysheet-sheets-item-color",
|
|
27359
27362
|
style: {
|
|
27360
27363
|
background: sheet.color
|
|
@@ -31108,10 +31111,15 @@
|
|
|
31108
31111
|
draftCtx.luckysheet_selection_range = [];
|
|
31109
31112
|
});
|
|
31110
31113
|
}, [context.currentSheetId, context.sheetScrollRecord, setContext]);
|
|
31114
|
+
var isActive = sheet.id === context.currentSheetId;
|
|
31111
31115
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31112
31116
|
className: "leankylin-sheet-list-item",
|
|
31113
31117
|
key: sheet.id,
|
|
31114
31118
|
ref: containerRef,
|
|
31119
|
+
style: {
|
|
31120
|
+
background: isActive ? "#f5f5f5" : sheet.color || "",
|
|
31121
|
+
color: isActive ? "#2E8B6E" : ""
|
|
31122
|
+
},
|
|
31115
31123
|
onClick: function onClick() {
|
|
31116
31124
|
if (isDropPlaceholder) return;
|
|
31117
31125
|
setContext(function (draftCtx) {
|
|
@@ -31130,7 +31138,7 @@
|
|
|
31130
31138
|
}
|
|
31131
31139
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
31132
31140
|
className: "leankylin-sheet-selected-check-sapce"
|
|
31133
|
-
},
|
|
31141
|
+
}, isActive && ( /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
31134
31142
|
name: "check",
|
|
31135
31143
|
width: 16,
|
|
31136
31144
|
height: 16,
|
|
@@ -31141,7 +31149,7 @@
|
|
|
31141
31149
|
}))), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
31142
31150
|
className: "luckysheet-sheets-item-name leankylin-sheet-list-item-name",
|
|
31143
31151
|
spellCheck: "false"
|
|
31144
|
-
}, !!sheet.color && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31152
|
+
}, !!sheet.color && isActive && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31145
31153
|
className: "luckysheet-sheets-list-item-color",
|
|
31146
31154
|
style: {
|
|
31147
31155
|
background: sheet.color
|
|
@@ -31156,23 +31164,50 @@
|
|
|
31156
31164
|
context = _useContext.context,
|
|
31157
31165
|
setContext = _useContext.setContext;
|
|
31158
31166
|
var containerRef = React.useRef(null);
|
|
31167
|
+
var _useState = React.useState(""),
|
|
31168
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31169
|
+
searchText = _useState2[0],
|
|
31170
|
+
setSearchText = _useState2[1];
|
|
31159
31171
|
var close = React.useCallback(function () {
|
|
31160
31172
|
setContext(function (ctx) {
|
|
31161
31173
|
ctx.showSheetList = false;
|
|
31162
31174
|
});
|
|
31163
31175
|
}, [setContext]);
|
|
31164
31176
|
useOutsideClick(containerRef, close, [close]);
|
|
31177
|
+
var sheetList = lodash.sortBy(context.luckysheetfile, function (s) {
|
|
31178
|
+
return Number(s.order);
|
|
31179
|
+
});
|
|
31180
|
+
var keyword = searchText.trim();
|
|
31181
|
+
var lowerKeyword = keyword.toLowerCase();
|
|
31182
|
+
var filteredList = keyword ? sheetList.filter(function (s) {
|
|
31183
|
+
var _s$name;
|
|
31184
|
+
return ((_s$name = s.name) !== null && _s$name !== void 0 ? _s$name : "").toLowerCase().includes(lowerKeyword);
|
|
31185
|
+
}) : sheetList;
|
|
31165
31186
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31166
31187
|
className: "leankylin-context-menu luckysheet-cols-menu leankylin-sheet-list",
|
|
31167
31188
|
ref: containerRef
|
|
31168
|
-
},
|
|
31169
|
-
|
|
31170
|
-
}
|
|
31189
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31190
|
+
className: "leankylin-sheet-list-search"
|
|
31191
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
31192
|
+
value: searchText,
|
|
31193
|
+
placeholder: "\u641C\u7D22\u5DE5\u4F5C\u8868",
|
|
31194
|
+
onChange: function onChange(e) {
|
|
31195
|
+
return setSearchText(e.target.value);
|
|
31196
|
+
},
|
|
31197
|
+
onKeyDown: function onKeyDown(e) {
|
|
31198
|
+
e.stopPropagation();
|
|
31199
|
+
if (e.key === "Escape") close();
|
|
31200
|
+
}
|
|
31201
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31202
|
+
className: "leankylin-sheet-list-content"
|
|
31203
|
+
}, filteredList.length === 0 && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31204
|
+
className: "leankylin-sheet-list-empty"
|
|
31205
|
+
}, "\u672A\u627E\u5230\u5339\u914D\u7684\u5DE5\u4F5C\u8868")), filteredList.map(function (singleSheet) {
|
|
31171
31206
|
return /*#__PURE__*/React__default['default'].createElement(SheetListItem, {
|
|
31172
31207
|
sheet: singleSheet,
|
|
31173
31208
|
key: singleSheet.id
|
|
31174
31209
|
});
|
|
31175
|
-
}));
|
|
31210
|
+
})));
|
|
31176
31211
|
};
|
|
31177
31212
|
|
|
31178
31213
|
var _excluded = ["onChange", "onOp", "data"];
|