@lvce-editor/settings-view 2.5.0 → 2.6.0
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.
|
@@ -4936,9 +4936,6 @@ const getCss = (sideBarWidth, scrollBarThumbHeight, scrollBarThumbTop) => {
|
|
|
4936
4936
|
--ScrollBarThumbHeight: ${scrollBarThumbHeight}px;
|
|
4937
4937
|
--ScrollBarThumbTop: ${scrollBarThumbTop}px;
|
|
4938
4938
|
}
|
|
4939
|
-
.SettingsResizer {
|
|
4940
|
-
background: yellow;
|
|
4941
|
-
}
|
|
4942
4939
|
|
|
4943
4940
|
.SettingsSideBar{
|
|
4944
4941
|
width: var(--SettingsSideBarWidth);
|
|
@@ -5140,7 +5137,10 @@ const parentNode$1 = {
|
|
|
5140
5137
|
className: mergeClassNames(SettingsScrollBar, SettingsScrollBarSmall),
|
|
5141
5138
|
type: Div
|
|
5142
5139
|
};
|
|
5143
|
-
const getScrollBarDom =
|
|
5140
|
+
const getScrollBarDom = visible => {
|
|
5141
|
+
if (!visible) {
|
|
5142
|
+
return [];
|
|
5143
|
+
}
|
|
5144
5144
|
return [parentNode$1, {
|
|
5145
5145
|
childCount: 0,
|
|
5146
5146
|
className: SettingsScrollBarThumb,
|
|
@@ -5454,7 +5454,7 @@ const getSettingsItemsDom = (items, searchValue) => {
|
|
|
5454
5454
|
}, ...items.flatMap(getItemVirtualDom)];
|
|
5455
5455
|
};
|
|
5456
5456
|
|
|
5457
|
-
const getSettingsContentDom = (visibleItems, tabs, searchValue) => {
|
|
5457
|
+
const getSettingsContentDom = (visibleItems, tabs, searchValue, showScrollBar) => {
|
|
5458
5458
|
const selectedTab = tabs.find(tab => tab.selected);
|
|
5459
5459
|
const headerText = selectedTab ? selectedTab.label : settingsContent();
|
|
5460
5460
|
return [{
|
|
@@ -5466,7 +5466,7 @@ const getSettingsContentDom = (visibleItems, tabs, searchValue) => {
|
|
|
5466
5466
|
childCount: 2,
|
|
5467
5467
|
className: SettingsItemWrapper,
|
|
5468
5468
|
type: Div
|
|
5469
|
-
}, ...getSettingsItemsDom(visibleItems, searchValue), ...getScrollBarDom()];
|
|
5469
|
+
}, ...getSettingsItemsDom(visibleItems, searchValue), ...getScrollBarDom(showScrollBar)];
|
|
5470
5470
|
};
|
|
5471
5471
|
|
|
5472
5472
|
const getTabClassName = tab => {
|
|
@@ -5504,12 +5504,14 @@ const getSettingsSideBarDom = tabs => {
|
|
|
5504
5504
|
}, ...getSettingsTabsDom(tabs)];
|
|
5505
5505
|
};
|
|
5506
5506
|
|
|
5507
|
-
const getSettingsMainDom = (tabs, visibleItems, totalItemCount, searchValue) => {
|
|
5507
|
+
const getSettingsMainDom = (tabs, visibleItems, totalItemCount, searchValue, height, itemHeight) => {
|
|
5508
|
+
const totalHeight = totalItemCount * itemHeight;
|
|
5509
|
+
const showScrollBar = totalHeight > height;
|
|
5508
5510
|
return [{
|
|
5509
5511
|
childCount: 3,
|
|
5510
5512
|
className: SettingsMain,
|
|
5511
5513
|
type: Div
|
|
5512
|
-
}, ...getSettingsSideBarDom(tabs), ...getResizerVirtualDom(), ...getSettingsContentDom(visibleItems, tabs, searchValue)];
|
|
5514
|
+
}, ...getSettingsSideBarDom(tabs), ...getResizerVirtualDom(), ...getSettingsContentDom(visibleItems, tabs, searchValue, showScrollBar)];
|
|
5513
5515
|
};
|
|
5514
5516
|
|
|
5515
5517
|
const parentNode = {
|
|
@@ -5520,13 +5522,15 @@ const parentNode = {
|
|
|
5520
5522
|
const getSettingsDom = state => {
|
|
5521
5523
|
const {
|
|
5522
5524
|
filteredItems,
|
|
5525
|
+
height,
|
|
5526
|
+
itemHeight,
|
|
5523
5527
|
searchValue,
|
|
5524
5528
|
tabs,
|
|
5525
5529
|
visibleItems
|
|
5526
5530
|
} = state;
|
|
5527
5531
|
const hasSearchValue = searchValue.trim().length > 0;
|
|
5528
5532
|
const filteredItemsCount = filteredItems.length;
|
|
5529
|
-
return [parentNode, ...getSettingsHeaderDom(filteredItemsCount, hasSearchValue), ...getSettingsMainDom(tabs, visibleItems, filteredItemsCount, searchValue)];
|
|
5533
|
+
return [parentNode, ...getSettingsHeaderDom(filteredItemsCount, hasSearchValue), ...getSettingsMainDom(tabs, visibleItems, filteredItemsCount, searchValue, height, itemHeight)];
|
|
5530
5534
|
};
|
|
5531
5535
|
|
|
5532
5536
|
const renderItems = (oldState, newState) => {
|