dockview-core 4.1.0 → 4.2.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.
@@ -55,9 +55,15 @@ export class Tabs extends CompositeDisposable {
55
55
  this._tabsList = document.createElement('div');
56
56
  this._tabsList.className = 'dv-tabs-container dv-horizontal';
57
57
  this.showTabsOverflowControl = options.showTabsOverflowControl;
58
- const scrollbar = new Scrollbar(this._tabsList);
59
- this._element = scrollbar.element;
60
- this.addDisposables(this._onOverflowTabsChange, this._observerDisposable, scrollbar, this._onWillShowOverlay, this._onDrop, this._onTabDragStart, addDisposableListener(this.element, 'pointerdown', (event) => {
58
+ if (accessor.options.scrollbars === 'native') {
59
+ this._element = this._tabsList;
60
+ }
61
+ else {
62
+ const scrollbar = new Scrollbar(this._tabsList);
63
+ this._element = scrollbar.element;
64
+ this.addDisposables(scrollbar);
65
+ }
66
+ this.addDisposables(this._onOverflowTabsChange, this._observerDisposable, this._onWillShowOverlay, this._onDrop, this._onTabDragStart, addDisposableListener(this.element, 'pointerdown', (event) => {
61
67
  if (event.defaultPrevented) {
62
68
  return;
63
69
  }
@@ -58,6 +58,13 @@ export interface DockviewOptions {
58
58
  noPanelsOverlay?: 'emptyGroup' | 'watermark';
59
59
  theme?: DockviewTheme;
60
60
  disableTabsOverflowList?: boolean;
61
+ /**
62
+ * Select `native` to use built-in scrollbar behaviours and `custom` to use an internal implementation
63
+ * that allows for improved scrollbar overlay UX.
64
+ *
65
+ * This is only applied to the tab header section. Defaults to `custom`.
66
+ */
67
+ scrollbars?: 'native' | 'custom';
61
68
  }
62
69
  export interface DockviewDndOverlayEvent extends IAcceptableEvent {
63
70
  nativeEvent: DragEvent;
@@ -31,6 +31,7 @@ export const PROPERTY_KEYS_DOCKVIEW = (() => {
31
31
  dndEdges: undefined,
32
32
  theme: undefined,
33
33
  disableTabsOverflowList: undefined,
34
+ scrollbars: undefined,
34
35
  };
35
36
  return Object.keys(properties);
36
37
  })();
@@ -1,7 +1,6 @@
1
1
  .dv-scrollable {
2
2
  position: relative;
3
3
  overflow: hidden;
4
- width: 100%;
5
4
  }
6
5
  .dv-scrollable .dv-scrollbar-horizontal {
7
6
  position: absolute;
@@ -1100,7 +1099,7 @@
1100
1099
  .dv-tabs-container {
1101
1100
  display: flex;
1102
1101
  height: 100%;
1103
- overflow: hidden;
1102
+ overflow: auto;
1104
1103
  scrollbar-width: thin;
1105
1104
  /* Track */
1106
1105
  /* Handle */
@@ -1126,6 +1125,10 @@
1126
1125
  background: var(--dv-tabs-container-scrollbar-color);
1127
1126
  }
1128
1127
 
1128
+ .dv-scrollable > .dv-tabs-container {
1129
+ overflow: hidden;
1130
+ }
1131
+
1129
1132
  .dv-tab {
1130
1133
  -webkit-user-drag: element;
1131
1134
  outline: none;
@@ -1162,6 +1165,9 @@
1162
1165
  height: var(--dv-tabs-and-actions-container-height);
1163
1166
  font-size: var(--dv-tabs-and-actions-container-font-size);
1164
1167
  }
1168
+ .dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-scrollable {
1169
+ flex-grow: 1;
1170
+ }
1165
1171
  .dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-tabs-container {
1166
1172
  flex-grow: 1;
1167
1173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dockview-core",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "Zero dependency layout manager supporting tabs, grids and splitviews",
5
5
  "keywords": [
6
6
  "splitview",