dockview-core 4.5.0 → 4.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.
Files changed (50) hide show
  1. package/dist/cjs/api/component.api.d.ts +2 -1
  2. package/dist/cjs/dockview/components/titlebar/tabs.d.ts +1 -1
  3. package/dist/cjs/dockview/components/titlebar/tabs.js +2 -2
  4. package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +1 -1
  5. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +6 -3
  6. package/dist/cjs/dockview/components/titlebar/voidContainer.js +3 -0
  7. package/dist/cjs/dockview/dockviewComponent.d.ts +2 -1
  8. package/dist/cjs/dockview/dockviewComponent.js +2 -1
  9. package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +3 -24
  10. package/dist/cjs/dockview/dockviewGroupPanelModel.js +3 -65
  11. package/dist/cjs/dockview/events.d.ts +28 -0
  12. package/dist/cjs/dockview/events.js +66 -0
  13. package/dist/cjs/dockview/options.d.ts +2 -1
  14. package/dist/dockview-core.amd.js +42 -37
  15. package/dist/dockview-core.amd.js.map +1 -1
  16. package/dist/dockview-core.amd.min.js +2 -2
  17. package/dist/dockview-core.amd.min.js.map +1 -1
  18. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  19. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  20. package/dist/dockview-core.amd.noStyle.js +41 -36
  21. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  22. package/dist/dockview-core.cjs.js +42 -37
  23. package/dist/dockview-core.cjs.js.map +1 -1
  24. package/dist/dockview-core.esm.js +43 -37
  25. package/dist/dockview-core.esm.js.map +1 -1
  26. package/dist/dockview-core.esm.min.js +2 -2
  27. package/dist/dockview-core.esm.min.js.map +1 -1
  28. package/dist/dockview-core.js +42 -37
  29. package/dist/dockview-core.js.map +1 -1
  30. package/dist/dockview-core.min.js +2 -2
  31. package/dist/dockview-core.min.js.map +1 -1
  32. package/dist/dockview-core.min.noStyle.js +2 -2
  33. package/dist/dockview-core.min.noStyle.js.map +1 -1
  34. package/dist/dockview-core.noStyle.js +41 -36
  35. package/dist/dockview-core.noStyle.js.map +1 -1
  36. package/dist/esm/api/component.api.d.ts +2 -1
  37. package/dist/esm/dockview/components/titlebar/tabs.d.ts +1 -1
  38. package/dist/esm/dockview/components/titlebar/tabs.js +1 -1
  39. package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +1 -1
  40. package/dist/esm/dockview/components/titlebar/tabsContainer.js +5 -2
  41. package/dist/esm/dockview/components/titlebar/voidContainer.js +3 -0
  42. package/dist/esm/dockview/dockviewComponent.d.ts +2 -1
  43. package/dist/esm/dockview/dockviewComponent.js +2 -1
  44. package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +3 -24
  45. package/dist/esm/dockview/dockviewGroupPanelModel.js +1 -33
  46. package/dist/esm/dockview/events.d.ts +28 -0
  47. package/dist/esm/dockview/events.js +33 -0
  48. package/dist/esm/dockview/options.d.ts +2 -1
  49. package/dist/styles/dockview.css +5 -0
  50. package/package.json +4 -5
@@ -15,7 +15,8 @@ import { IDockviewPanel } from '../dockview/dockviewPanel';
15
15
  import { PaneviewDidDropEvent } from '../paneview/draggablePaneviewPanel';
16
16
  import { GroupDragEvent, TabDragEvent } from '../dockview/components/titlebar/tabsContainer';
17
17
  import { Box } from '../types';
18
- import { DockviewDidDropEvent, DockviewWillDropEvent, WillShowOverlayLocationEvent } from '../dockview/dockviewGroupPanelModel';
18
+ import { DockviewDidDropEvent, DockviewWillDropEvent } from '../dockview/dockviewGroupPanelModel';
19
+ import { WillShowOverlayLocationEvent } from '../dockview/events';
19
20
  import { PaneviewComponentOptions, PaneviewDndOverlayEvent } from '../paneview/options';
20
21
  import { SplitviewComponentOptions } from '../splitview/options';
21
22
  import { GridviewComponentOptions } from '../gridview/options';
@@ -2,7 +2,7 @@ import { Event } from '../../../events';
2
2
  import { CompositeDisposable } from '../../../lifecycle';
3
3
  import { DockviewComponent } from '../../dockviewComponent';
4
4
  import { DockviewGroupPanel } from '../../dockviewGroupPanel';
5
- import { WillShowOverlayLocationEvent } from '../../dockviewGroupPanelModel';
5
+ import { WillShowOverlayLocationEvent } from '../../events';
6
6
  import { IDockviewPanel } from '../../dockviewPanel';
7
7
  import { Tab } from '../tab/tab';
8
8
  import { TabDragEvent, TabDropIndexEvent } from './tabsContainer';
@@ -57,7 +57,7 @@ var dom_1 = require("../../../dom");
57
57
  var events_1 = require("../../../events");
58
58
  var lifecycle_1 = require("../../../lifecycle");
59
59
  var scrollbar_1 = require("../../../scrollbar");
60
- var dockviewGroupPanelModel_1 = require("../../dockviewGroupPanelModel");
60
+ var events_2 = require("../../events");
61
61
  var tab_1 = require("../tab/tab");
62
62
  var Tabs = /** @class */ (function (_super) {
63
63
  __extends(Tabs, _super);
@@ -246,7 +246,7 @@ var Tabs = /** @class */ (function (_super) {
246
246
  index: _this._tabs.findIndex(function (x) { return x.value === tab; }),
247
247
  });
248
248
  }), tab.onWillShowOverlay(function (event) {
249
- _this._onWillShowOverlay.fire(new dockviewGroupPanelModel_1.WillShowOverlayLocationEvent(event, {
249
+ _this._onWillShowOverlay.fire(new events_2.WillShowOverlayLocationEvent(event, {
250
250
  kind: 'tab',
251
251
  panel: _this.group.activePanel,
252
252
  api: _this.accessor.api,
@@ -4,7 +4,7 @@ import { Tab } from '../tab/tab';
4
4
  import { DockviewGroupPanel } from '../../dockviewGroupPanel';
5
5
  import { IDockviewPanel } from '../../dockviewPanel';
6
6
  import { DockviewComponent } from '../../dockviewComponent';
7
- import { WillShowOverlayLocationEvent } from '../../dockviewGroupPanelModel';
7
+ import { WillShowOverlayLocationEvent } from '../../events';
8
8
  export interface TabDropIndexEvent {
9
9
  readonly event: DragEvent;
10
10
  readonly index: number;
@@ -31,7 +31,7 @@ var lifecycle_1 = require("../../../lifecycle");
31
31
  var events_1 = require("../../../events");
32
32
  var voidContainer_1 = require("./voidContainer");
33
33
  var dom_1 = require("../../../dom");
34
- var dockviewGroupPanelModel_1 = require("../../dockviewGroupPanelModel");
34
+ var events_2 = require("../../events");
35
35
  var dataTransfer_1 = require("../../../dnd/dataTransfer");
36
36
  var tabs_1 = require("./tabs");
37
37
  var tabOverflowControl_1 = require("./tabOverflowControl");
@@ -85,7 +85,7 @@ var TabsContainer = /** @class */ (function (_super) {
85
85
  index: _this.tabs.size,
86
86
  });
87
87
  }), _this.voidContainer.onWillShowOverlay(function (event) {
88
- _this._onWillShowOverlay.fire(new dockviewGroupPanelModel_1.WillShowOverlayLocationEvent(event, {
88
+ _this._onWillShowOverlay.fire(new events_2.WillShowOverlayLocationEvent(event, {
89
89
  kind: 'header_space',
90
90
  panel: _this.group.activePanel,
91
91
  api: _this.accessor.api,
@@ -264,8 +264,11 @@ var TabsContainer = /** @class */ (function (_super) {
264
264
  (0, dom_1.toggleClass)(wrapper, 'dv-tab', true);
265
265
  (0, dom_1.toggleClass)(wrapper, 'dv-active-tab', panelObject.api.isActive);
266
266
  (0, dom_1.toggleClass)(wrapper, 'dv-inactive-tab', !panelObject.api.isActive);
267
- wrapper.addEventListener('pointerdown', function () {
267
+ wrapper.addEventListener('click', function (event) {
268
268
  _this.accessor.popupService.close();
269
+ if (event.defaultPrevented) {
270
+ return;
271
+ }
269
272
  tab.element.scrollIntoView();
270
273
  tab.panel.api.setActive();
271
274
  });
@@ -21,6 +21,7 @@ var droptarget_1 = require("../../../dnd/droptarget");
21
21
  var groupDragHandler_1 = require("../../../dnd/groupDragHandler");
22
22
  var events_1 = require("../../../events");
23
23
  var lifecycle_1 = require("../../../lifecycle");
24
+ var dom_1 = require("../../../dom");
24
25
  var VoidContainer = /** @class */ (function (_super) {
25
26
  __extends(VoidContainer, _super);
26
27
  function VoidContainer(accessor, group) {
@@ -34,6 +35,7 @@ var VoidContainer = /** @class */ (function (_super) {
34
35
  _this._element = document.createElement('div');
35
36
  _this._element.className = 'dv-void-container';
36
37
  _this._element.draggable = !_this.accessor.options.disableDnd;
38
+ (0, dom_1.toggleClass)(_this._element, 'dv-draggable', !_this.accessor.options.disableDnd);
37
39
  _this.addDisposables(_this._onDrop, _this._onDragStart, (0, events_1.addDisposableListener)(_this._element, 'pointerdown', function () {
38
40
  _this.accessor.doSetGroupActive(_this.group);
39
41
  }));
@@ -66,6 +68,7 @@ var VoidContainer = /** @class */ (function (_super) {
66
68
  });
67
69
  VoidContainer.prototype.updateDragAndDropState = function () {
68
70
  this._element.draggable = !this.accessor.options.disableDnd;
71
+ (0, dom_1.toggleClass)(this._element, 'dv-draggable', !this.accessor.options.disableDnd);
69
72
  };
70
73
  return VoidContainer;
71
74
  }(lifecycle_1.CompositeDisposable));
@@ -7,7 +7,8 @@ import { AddGroupOptions, AddPanelOptions, DockviewComponentOptions, DockviewDnd
7
7
  import { BaseGrid, IBaseGrid } from '../gridview/baseComponentGridview';
8
8
  import { DockviewApi } from '../api/component.api';
9
9
  import { Orientation } from '../splitview/splitview';
10
- import { GroupOptions, GroupPanelViewState, DockviewDidDropEvent, DockviewWillDropEvent, WillShowOverlayLocationEvent } from './dockviewGroupPanelModel';
10
+ import { GroupOptions, GroupPanelViewState, DockviewDidDropEvent, DockviewWillDropEvent } from './dockviewGroupPanelModel';
11
+ import { WillShowOverlayLocationEvent } from './events';
11
12
  import { DockviewGroupPanel } from './dockviewGroupPanel';
12
13
  import { Parameters } from '../panel/types';
13
14
  import { DockviewFloatingGroupPanel } from './dockviewFloatingGroupPanel';
@@ -77,6 +77,7 @@ var baseComponentGridview_1 = require("../gridview/baseComponentGridview");
77
77
  var component_api_1 = require("../api/component.api");
78
78
  var splitview_1 = require("../splitview/splitview");
79
79
  var dockviewGroupPanelModel_1 = require("./dockviewGroupPanelModel");
80
+ var events_2 = require("./events");
80
81
  var dockviewGroupPanel_1 = require("./dockviewGroupPanel");
81
82
  var dockviewPanelModel_1 = require("./dockviewPanelModel");
82
83
  var dataTransfer_1 = require("../dnd/dataTransfer");
@@ -270,7 +271,7 @@ var DockviewComponent = /** @class */ (function (_super) {
270
271
  // option only available when no panels in primary grid
271
272
  return;
272
273
  }
273
- _this._onWillShowOverlay.fire(new dockviewGroupPanelModel_1.WillShowOverlayLocationEvent(event, {
274
+ _this._onWillShowOverlay.fire(new events_2.WillShowOverlayLocationEvent(event, {
274
275
  kind: 'edge',
275
276
  panel: undefined,
276
277
  api: _this._api,
@@ -1,8 +1,9 @@
1
1
  import { DockviewApi } from '../api/component.api';
2
2
  import { PanelTransfer } from '../dnd/dataTransfer';
3
- import { Position, WillShowOverlayEvent } from '../dnd/droptarget';
3
+ import { Position } from '../dnd/droptarget';
4
4
  import { DockviewComponent } from './dockviewComponent';
5
- import { DockviewEvent, Event, IDockviewEvent } from '../events';
5
+ import { DockviewEvent, Event } from '../events';
6
+ import { DockviewGroupDropLocation, WillShowOverlayLocationEvent } from './events';
6
7
  import { IViewSize } from '../gridview/gridview';
7
8
  import { CompositeDisposable } from '../lifecycle';
8
9
  import { IPanel, PanelInitParameters, PanelUpdateEvent, Parameters } from '../panel/types';
@@ -75,7 +76,6 @@ export interface IHeader {
75
76
  hidden: boolean;
76
77
  }
77
78
  export type DockviewGroupPanelLocked = boolean | 'no-drop-target';
78
- export type DockviewGroupDropLocation = 'tab' | 'header_space' | 'content' | 'edge';
79
79
  export interface IDockviewGroupPanelModel extends IPanel {
80
80
  readonly isActive: boolean;
81
81
  readonly size: number;
@@ -123,27 +123,6 @@ export type DockviewGroupLocation = {
123
123
  getWindow: () => Window;
124
124
  popoutUrl?: string;
125
125
  };
126
- export interface WillShowOverlayLocationEventOptions {
127
- readonly kind: DockviewGroupDropLocation;
128
- readonly panel: IDockviewPanel | undefined;
129
- readonly api: DockviewApi;
130
- readonly group: DockviewGroupPanel | undefined;
131
- getData: () => PanelTransfer | undefined;
132
- }
133
- export declare class WillShowOverlayLocationEvent implements IDockviewEvent {
134
- private readonly event;
135
- readonly options: WillShowOverlayLocationEventOptions;
136
- get kind(): DockviewGroupDropLocation;
137
- get nativeEvent(): DragEvent;
138
- get position(): Position;
139
- get defaultPrevented(): boolean;
140
- get panel(): IDockviewPanel | undefined;
141
- get api(): DockviewApi;
142
- get group(): DockviewGroupPanel | undefined;
143
- preventDefault(): void;
144
- getData(): PanelTransfer | undefined;
145
- constructor(event: WillShowOverlayEvent, options: WillShowOverlayLocationEventOptions);
146
- }
147
126
  export declare class DockviewGroupPanelModel extends CompositeDisposable implements IDockviewGroupPanelModel {
148
127
  private readonly container;
149
128
  private readonly accessor;
@@ -51,11 +51,12 @@ var __values = (this && this.__values) || function(o) {
51
51
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
52
52
  };
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.DockviewGroupPanelModel = exports.WillShowOverlayLocationEvent = exports.DockviewWillDropEvent = exports.DockviewDidDropEvent = void 0;
54
+ exports.DockviewGroupPanelModel = exports.DockviewWillDropEvent = exports.DockviewDidDropEvent = void 0;
55
55
  var component_api_1 = require("../api/component.api");
56
56
  var dataTransfer_1 = require("../dnd/dataTransfer");
57
57
  var dom_1 = require("../dom");
58
58
  var events_1 = require("../events");
59
+ var events_2 = require("./events");
59
60
  var lifecycle_1 = require("../lifecycle");
60
61
  var content_1 = require("./components/panel/content");
61
62
  var tabsContainer_1 = require("./components/titlebar/tabsContainer");
@@ -125,69 +126,6 @@ var DockviewWillDropEvent = /** @class */ (function (_super) {
125
126
  return DockviewWillDropEvent;
126
127
  }(DockviewDidDropEvent));
127
128
  exports.DockviewWillDropEvent = DockviewWillDropEvent;
128
- var WillShowOverlayLocationEvent = /** @class */ (function () {
129
- function WillShowOverlayLocationEvent(event, options) {
130
- this.event = event;
131
- this.options = options;
132
- }
133
- Object.defineProperty(WillShowOverlayLocationEvent.prototype, "kind", {
134
- get: function () {
135
- return this.options.kind;
136
- },
137
- enumerable: false,
138
- configurable: true
139
- });
140
- Object.defineProperty(WillShowOverlayLocationEvent.prototype, "nativeEvent", {
141
- get: function () {
142
- return this.event.nativeEvent;
143
- },
144
- enumerable: false,
145
- configurable: true
146
- });
147
- Object.defineProperty(WillShowOverlayLocationEvent.prototype, "position", {
148
- get: function () {
149
- return this.event.position;
150
- },
151
- enumerable: false,
152
- configurable: true
153
- });
154
- Object.defineProperty(WillShowOverlayLocationEvent.prototype, "defaultPrevented", {
155
- get: function () {
156
- return this.event.defaultPrevented;
157
- },
158
- enumerable: false,
159
- configurable: true
160
- });
161
- Object.defineProperty(WillShowOverlayLocationEvent.prototype, "panel", {
162
- get: function () {
163
- return this.options.panel;
164
- },
165
- enumerable: false,
166
- configurable: true
167
- });
168
- Object.defineProperty(WillShowOverlayLocationEvent.prototype, "api", {
169
- get: function () {
170
- return this.options.api;
171
- },
172
- enumerable: false,
173
- configurable: true
174
- });
175
- Object.defineProperty(WillShowOverlayLocationEvent.prototype, "group", {
176
- get: function () {
177
- return this.options.group;
178
- },
179
- enumerable: false,
180
- configurable: true
181
- });
182
- WillShowOverlayLocationEvent.prototype.preventDefault = function () {
183
- this.event.preventDefault();
184
- };
185
- WillShowOverlayLocationEvent.prototype.getData = function () {
186
- return this.options.getData();
187
- };
188
- return WillShowOverlayLocationEvent;
189
- }());
190
- exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
191
129
  var DockviewGroupPanelModel = /** @class */ (function (_super) {
192
130
  __extends(DockviewGroupPanelModel, _super);
193
131
  function DockviewGroupPanelModel(container, accessor, id, options, groupPanel) {
@@ -256,7 +194,7 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
256
194
  }), _this.tabsContainer.onWillShowOverlay(function (event) {
257
195
  _this._onWillShowOverlay.fire(event);
258
196
  }), _this.contentContainer.dropTarget.onWillShowOverlay(function (event) {
259
- _this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
197
+ _this._onWillShowOverlay.fire(new events_2.WillShowOverlayLocationEvent(event, {
260
198
  kind: 'content',
261
199
  panel: _this.activePanel,
262
200
  api: _this._api,
@@ -0,0 +1,28 @@
1
+ import { Position, WillShowOverlayEvent } from '../dnd/droptarget';
2
+ import { PanelTransfer } from '../dnd/dataTransfer';
3
+ import { DockviewApi } from '../api/component.api';
4
+ import { IDockviewPanel } from './dockviewPanel';
5
+ import { DockviewGroupPanel } from './dockviewGroupPanel';
6
+ import { IDockviewEvent } from '../events';
7
+ export type DockviewGroupDropLocation = 'tab' | 'header_space' | 'content' | 'edge';
8
+ export interface WillShowOverlayLocationEventOptions {
9
+ readonly kind: DockviewGroupDropLocation;
10
+ readonly panel: IDockviewPanel | undefined;
11
+ readonly api: DockviewApi;
12
+ readonly group: DockviewGroupPanel | undefined;
13
+ getData: () => PanelTransfer | undefined;
14
+ }
15
+ export declare class WillShowOverlayLocationEvent implements IDockviewEvent {
16
+ private readonly event;
17
+ readonly options: WillShowOverlayLocationEventOptions;
18
+ get kind(): DockviewGroupDropLocation;
19
+ get nativeEvent(): DragEvent;
20
+ get position(): Position;
21
+ get defaultPrevented(): boolean;
22
+ get panel(): IDockviewPanel | undefined;
23
+ get api(): DockviewApi;
24
+ get group(): DockviewGroupPanel | undefined;
25
+ preventDefault(): void;
26
+ getData(): PanelTransfer | undefined;
27
+ constructor(event: WillShowOverlayEvent, options: WillShowOverlayLocationEventOptions);
28
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WillShowOverlayLocationEvent = void 0;
4
+ var WillShowOverlayLocationEvent = /** @class */ (function () {
5
+ function WillShowOverlayLocationEvent(event, options) {
6
+ this.event = event;
7
+ this.options = options;
8
+ }
9
+ Object.defineProperty(WillShowOverlayLocationEvent.prototype, "kind", {
10
+ get: function () {
11
+ return this.options.kind;
12
+ },
13
+ enumerable: false,
14
+ configurable: true
15
+ });
16
+ Object.defineProperty(WillShowOverlayLocationEvent.prototype, "nativeEvent", {
17
+ get: function () {
18
+ return this.event.nativeEvent;
19
+ },
20
+ enumerable: false,
21
+ configurable: true
22
+ });
23
+ Object.defineProperty(WillShowOverlayLocationEvent.prototype, "position", {
24
+ get: function () {
25
+ return this.event.position;
26
+ },
27
+ enumerable: false,
28
+ configurable: true
29
+ });
30
+ Object.defineProperty(WillShowOverlayLocationEvent.prototype, "defaultPrevented", {
31
+ get: function () {
32
+ return this.event.defaultPrevented;
33
+ },
34
+ enumerable: false,
35
+ configurable: true
36
+ });
37
+ Object.defineProperty(WillShowOverlayLocationEvent.prototype, "panel", {
38
+ get: function () {
39
+ return this.options.panel;
40
+ },
41
+ enumerable: false,
42
+ configurable: true
43
+ });
44
+ Object.defineProperty(WillShowOverlayLocationEvent.prototype, "api", {
45
+ get: function () {
46
+ return this.options.api;
47
+ },
48
+ enumerable: false,
49
+ configurable: true
50
+ });
51
+ Object.defineProperty(WillShowOverlayLocationEvent.prototype, "group", {
52
+ get: function () {
53
+ return this.options.group;
54
+ },
55
+ enumerable: false,
56
+ configurable: true
57
+ });
58
+ WillShowOverlayLocationEvent.prototype.preventDefault = function () {
59
+ this.event.preventDefault();
60
+ };
61
+ WillShowOverlayLocationEvent.prototype.getData = function () {
62
+ return this.options.getData();
63
+ };
64
+ return WillShowOverlayLocationEvent;
65
+ }());
66
+ exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
@@ -7,7 +7,8 @@ import { DockviewGroupPanel } from './dockviewGroupPanel';
7
7
  import { PanelTransfer } from '../dnd/dataTransfer';
8
8
  import { IDisposable } from '../lifecycle';
9
9
  import { DroptargetOverlayModel, Position } from '../dnd/droptarget';
10
- import { DockviewGroupDropLocation, GroupOptions } from './dockviewGroupPanelModel';
10
+ import { GroupOptions } from './dockviewGroupPanelModel';
11
+ import { DockviewGroupDropLocation } from './events';
11
12
  import { IDockviewPanel } from './dockviewPanel';
12
13
  import { DockviewPanelRenderer } from '../overlay/overlayRenderContainer';
13
14
  import { IGroupHeaderProps } from './framework';