mirror of
https://github.com/mathuo/dockview
synced 2025-01-22 17:35:57 +00:00
chore: align api with existing components
This commit is contained in:
parent
c14b66e5e5
commit
0ca56eaa8a
@ -40,7 +40,7 @@ import {
|
|||||||
} from '../dockview/dockviewGroupPanel';
|
} from '../dockview/dockviewGroupPanel';
|
||||||
import { Emitter, Event } from '../events';
|
import { Emitter, Event } from '../events';
|
||||||
import { IDockviewPanel } from '../dockview/dockviewPanel';
|
import { IDockviewPanel } from '../dockview/dockviewPanel';
|
||||||
import { PaneviewDropEvent } from '../paneview/draggablePaneviewPanel';
|
import { PaneviewDidDropEvent } from '../paneview/draggablePaneviewPanel';
|
||||||
import {
|
import {
|
||||||
GroupDragEvent,
|
GroupDragEvent,
|
||||||
TabDragEvent,
|
TabDragEvent,
|
||||||
@ -51,7 +51,10 @@ import {
|
|||||||
DockviewWillDropEvent,
|
DockviewWillDropEvent,
|
||||||
WillShowOverlayLocationEvent,
|
WillShowOverlayLocationEvent,
|
||||||
} from '../dockview/dockviewGroupPanelModel';
|
} from '../dockview/dockviewGroupPanelModel';
|
||||||
import { PaneviewComponentOptions } from '../paneview/options';
|
import {
|
||||||
|
PaneviewComponentOptions,
|
||||||
|
PaneviewDndOverlayEvent,
|
||||||
|
} from '../paneview/options';
|
||||||
import { SplitviewComponentOptions } from '../splitview/options';
|
import { SplitviewComponentOptions } from '../splitview/options';
|
||||||
import { GridviewComponentOptions } from '../gridview/options';
|
import { GridviewComponentOptions } from '../gridview/options';
|
||||||
|
|
||||||
@ -294,19 +297,12 @@ export class PaneviewApi implements CommonApi<SerializedPaneview> {
|
|||||||
/**
|
/**
|
||||||
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
||||||
*/
|
*/
|
||||||
get onDidDrop(): Event<PaneviewDropEvent> {
|
get onDidDrop(): Event<PaneviewDidDropEvent> {
|
||||||
const emitter = new Emitter<PaneviewDropEvent>();
|
return this.component.onDidDrop;
|
||||||
|
}
|
||||||
|
|
||||||
const disposable = this.component.onDidDrop((e) => {
|
get onUnhandledDragOverEvent(): Event<PaneviewDndOverlayEvent> {
|
||||||
emitter.fire({ ...e, api: this });
|
return this.component.onUnhandledDragOverEvent;
|
||||||
});
|
|
||||||
|
|
||||||
emitter.dispose = () => {
|
|
||||||
disposable.dispose();
|
|
||||||
emitter.dispose();
|
|
||||||
};
|
|
||||||
|
|
||||||
return emitter.event;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private readonly component: IPaneviewComponent) {}
|
constructor(private readonly component: IPaneviewComponent) {}
|
||||||
|
@ -16,6 +16,7 @@ import { DockviewPanelRenderer } from '../overlay/overlayRenderContainer';
|
|||||||
import { IGroupHeaderProps } from './framework';
|
import { IGroupHeaderProps } from './framework';
|
||||||
import { FloatingGroupOptions } from './dockviewComponent';
|
import { FloatingGroupOptions } from './dockviewComponent';
|
||||||
import { Contraints } from '../gridview/gridviewPanel';
|
import { Contraints } from '../gridview/gridviewPanel';
|
||||||
|
import { AcceptableEvent, IAcceptableEvent } from '../events';
|
||||||
|
|
||||||
export interface IHeaderActionsRenderer extends IDisposable {
|
export interface IHeaderActionsRenderer extends IDisposable {
|
||||||
readonly element: HTMLElement;
|
readonly element: HTMLElement;
|
||||||
@ -65,34 +66,26 @@ export interface DockviewOptions {
|
|||||||
noPanelsOverlay?: 'emptyGroup' | 'watermark';
|
noPanelsOverlay?: 'emptyGroup' | 'watermark';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DockviewDndOverlayEvent {
|
export interface DockviewDndOverlayEvent extends IAcceptableEvent {
|
||||||
nativeEvent: DragEvent;
|
nativeEvent: DragEvent;
|
||||||
target: DockviewGroupDropLocation;
|
target: DockviewGroupDropLocation;
|
||||||
position: Position;
|
position: Position;
|
||||||
group?: DockviewGroupPanel;
|
group?: DockviewGroupPanel;
|
||||||
getData: () => PanelTransfer | undefined;
|
getData: () => PanelTransfer | undefined;
|
||||||
//
|
|
||||||
isAccepted: boolean;
|
|
||||||
accept(): void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DockviewUnhandledDragOverEvent implements DockviewDndOverlayEvent {
|
export class DockviewUnhandledDragOverEvent
|
||||||
private _isAccepted = false;
|
extends AcceptableEvent
|
||||||
|
implements DockviewDndOverlayEvent
|
||||||
get isAccepted(): boolean {
|
{
|
||||||
return this._isAccepted;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly nativeEvent: DragEvent,
|
readonly nativeEvent: DragEvent,
|
||||||
readonly target: DockviewGroupDropLocation,
|
readonly target: DockviewGroupDropLocation,
|
||||||
readonly position: Position,
|
readonly position: Position,
|
||||||
readonly getData: () => PanelTransfer | undefined,
|
readonly getData: () => PanelTransfer | undefined,
|
||||||
readonly group?: DockviewGroupPanel
|
readonly group?: DockviewGroupPanel
|
||||||
) {}
|
) {
|
||||||
|
super();
|
||||||
accept(): void {
|
|
||||||
this._isAccepted = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,23 @@ export class DockviewEvent implements IDockviewEvent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IAcceptableEvent {
|
||||||
|
readonly isAccepted: boolean;
|
||||||
|
accept(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AcceptableEvent implements IAcceptableEvent {
|
||||||
|
private _isAccepted = false;
|
||||||
|
|
||||||
|
get isAccepted(): boolean {
|
||||||
|
return this._isAccepted;
|
||||||
|
}
|
||||||
|
|
||||||
|
accept(): void {
|
||||||
|
this._isAccepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class LeakageMonitor {
|
class LeakageMonitor {
|
||||||
readonly events = new Map<Event<any>, Stacktrace>();
|
readonly events = new Map<Event<any>, Stacktrace>();
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ export * from './gridview/baseComponentGridview';
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
DraggablePaneviewPanel,
|
DraggablePaneviewPanel,
|
||||||
PaneviewDropEvent,
|
PaneviewDidDropEvent as PaneviewDropEvent,
|
||||||
} from './paneview/draggablePaneviewPanel';
|
} from './paneview/draggablePaneviewPanel';
|
||||||
|
|
||||||
export * from './dockview/components/panel/content';
|
export * from './dockview/components/panel/content';
|
||||||
@ -80,6 +80,8 @@ export {
|
|||||||
PaneviewOptions,
|
PaneviewOptions,
|
||||||
PaneviewFrameworkOptions,
|
PaneviewFrameworkOptions,
|
||||||
PROPERTY_KEYS_PANEVIEW,
|
PROPERTY_KEYS_PANEVIEW,
|
||||||
|
PaneviewUnhandledDragOverEvent,
|
||||||
|
PaneviewDndOverlayEvent,
|
||||||
} from './paneview/options';
|
} from './paneview/options';
|
||||||
|
|
||||||
export * from './gridview/gridviewPanel';
|
export * from './gridview/gridviewPanel';
|
||||||
|
@ -6,9 +6,13 @@ import {
|
|||||||
PaneTransfer,
|
PaneTransfer,
|
||||||
} from '../dnd/dataTransfer';
|
} from '../dnd/dataTransfer';
|
||||||
import { Droptarget, DroptargetEvent } from '../dnd/droptarget';
|
import { Droptarget, DroptargetEvent } from '../dnd/droptarget';
|
||||||
import { Emitter } from '../events';
|
import { Emitter, Event } from '../events';
|
||||||
import { IDisposable } from '../lifecycle';
|
import { IDisposable } from '../lifecycle';
|
||||||
import { Orientation } from '../splitview/splitview';
|
import { Orientation } from '../splitview/splitview';
|
||||||
|
import {
|
||||||
|
PaneviewDndOverlayEvent,
|
||||||
|
PaneviewUnhandledDragOverEvent,
|
||||||
|
} from './options';
|
||||||
import { IPaneviewComponent } from './paneviewComponent';
|
import { IPaneviewComponent } from './paneviewComponent';
|
||||||
import {
|
import {
|
||||||
IPaneviewPanel,
|
IPaneviewPanel,
|
||||||
@ -16,7 +20,7 @@ import {
|
|||||||
PaneviewPanel,
|
PaneviewPanel,
|
||||||
} from './paneviewPanel';
|
} from './paneviewPanel';
|
||||||
|
|
||||||
export interface PaneviewDropEvent extends DroptargetEvent {
|
export interface PaneviewDidDropEvent extends DroptargetEvent {
|
||||||
panel: IPaneviewPanel;
|
panel: IPaneviewPanel;
|
||||||
getData: () => PaneTransfer | undefined;
|
getData: () => PaneTransfer | undefined;
|
||||||
api: PaneviewApi;
|
api: PaneviewApi;
|
||||||
@ -26,9 +30,14 @@ export abstract class DraggablePaneviewPanel extends PaneviewPanel {
|
|||||||
private handler: DragHandler | undefined;
|
private handler: DragHandler | undefined;
|
||||||
private target: Droptarget | undefined;
|
private target: Droptarget | undefined;
|
||||||
|
|
||||||
private readonly _onDidDrop = new Emitter<PaneviewDropEvent>();
|
private readonly _onDidDrop = new Emitter<PaneviewDidDropEvent>();
|
||||||
readonly onDidDrop = this._onDidDrop.event;
|
readonly onDidDrop = this._onDidDrop.event;
|
||||||
|
|
||||||
|
private readonly _onUnhandledDragOverEvent =
|
||||||
|
new Emitter<PaneviewDndOverlayEvent>();
|
||||||
|
readonly onUnhandledDragOverEvent: Event<PaneviewDndOverlayEvent> =
|
||||||
|
this._onUnhandledDragOverEvent.event;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly accessor: IPaneviewComponent,
|
private readonly accessor: IPaneviewComponent,
|
||||||
id: string,
|
id: string,
|
||||||
@ -40,6 +49,8 @@ export abstract class DraggablePaneviewPanel extends PaneviewPanel {
|
|||||||
) {
|
) {
|
||||||
super(id, component, headerComponent, orientation, isExpanded, true);
|
super(id, component, headerComponent, orientation, isExpanded, true);
|
||||||
|
|
||||||
|
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
||||||
|
|
||||||
if (!disableDnd) {
|
if (!disableDnd) {
|
||||||
this.initDragFeatures();
|
this.initDragFeatures();
|
||||||
}
|
}
|
||||||
@ -76,7 +87,7 @@ export abstract class DraggablePaneviewPanel extends PaneviewPanel {
|
|||||||
overlayModel: {
|
overlayModel: {
|
||||||
activationSize: { type: 'percentage', value: 50 },
|
activationSize: { type: 'percentage', value: 50 },
|
||||||
},
|
},
|
||||||
canDisplayOverlay: (event) => {
|
canDisplayOverlay: (event, position) => {
|
||||||
const data = getPaneData();
|
const data = getPaneData();
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -88,15 +99,16 @@ export abstract class DraggablePaneviewPanel extends PaneviewPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.accessor.options.showDndOverlay) {
|
const firedEvent = new PaneviewUnhandledDragOverEvent(
|
||||||
return this.accessor.options.showDndOverlay({
|
event,
|
||||||
nativeEvent: event,
|
position,
|
||||||
getData: getPaneData,
|
getPaneData,
|
||||||
panel: this,
|
this
|
||||||
});
|
);
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
this._onUnhandledDragOverEvent.fire(firedEvent);
|
||||||
|
|
||||||
|
return firedEvent.isAccepted;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
|
import { PaneTransfer } from '../dnd/dataTransfer';
|
||||||
|
import { Position } from '../dnd/droptarget';
|
||||||
import { CreateComponentOptions } from '../dockview/options';
|
import { CreateComponentOptions } from '../dockview/options';
|
||||||
import { PaneviewDndOverlayEvent } from './paneviewComponent';
|
import { AcceptableEvent, IAcceptableEvent } from '../events';
|
||||||
import { IPanePart } from './paneviewPanel';
|
import { IPanePart, IPaneviewPanel } from './paneviewPanel';
|
||||||
|
|
||||||
export interface PaneviewOptions {
|
export interface PaneviewOptions {
|
||||||
disableAutoResizing?: boolean;
|
disableAutoResizing?: boolean;
|
||||||
disableDnd?: boolean;
|
disableDnd?: boolean;
|
||||||
showDndOverlay?: (event: PaneviewDndOverlayEvent) => boolean;
|
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,9 +28,29 @@ export const PROPERTY_KEYS_PANEVIEW: (keyof PaneviewOptions)[] = (() => {
|
|||||||
const properties: Record<keyof PaneviewOptions, undefined> = {
|
const properties: Record<keyof PaneviewOptions, undefined> = {
|
||||||
disableAutoResizing: undefined,
|
disableAutoResizing: undefined,
|
||||||
disableDnd: undefined,
|
disableDnd: undefined,
|
||||||
showDndOverlay: undefined,
|
|
||||||
className: undefined,
|
className: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
return Object.keys(properties) as (keyof PaneviewOptions)[];
|
return Object.keys(properties) as (keyof PaneviewOptions)[];
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
export interface PaneviewDndOverlayEvent extends IAcceptableEvent {
|
||||||
|
nativeEvent: DragEvent;
|
||||||
|
position: Position;
|
||||||
|
panel: IPaneviewPanel;
|
||||||
|
getData: () => PaneTransfer | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PaneviewUnhandledDragOverEvent
|
||||||
|
extends AcceptableEvent
|
||||||
|
implements PaneviewDndOverlayEvent
|
||||||
|
{
|
||||||
|
constructor(
|
||||||
|
readonly nativeEvent: DragEvent,
|
||||||
|
readonly position: Position,
|
||||||
|
readonly getData: () => PaneTransfer | undefined,
|
||||||
|
readonly panel: IPaneviewPanel
|
||||||
|
) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -6,12 +6,12 @@ import {
|
|||||||
MutableDisposable,
|
MutableDisposable,
|
||||||
} from '../lifecycle';
|
} from '../lifecycle';
|
||||||
import { LayoutPriority, Orientation, Sizing } from '../splitview/splitview';
|
import { LayoutPriority, Orientation, Sizing } from '../splitview/splitview';
|
||||||
import { PaneviewComponentOptions } from './options';
|
import { PaneviewComponentOptions, PaneviewDndOverlayEvent } from './options';
|
||||||
import { Paneview } from './paneview';
|
import { Paneview } from './paneview';
|
||||||
import { IPanePart, PaneviewPanel, IPaneviewPanel } from './paneviewPanel';
|
import { IPanePart, PaneviewPanel, IPaneviewPanel } from './paneviewPanel';
|
||||||
import {
|
import {
|
||||||
DraggablePaneviewPanel,
|
DraggablePaneviewPanel,
|
||||||
PaneviewDropEvent,
|
PaneviewDidDropEvent,
|
||||||
} from './draggablePaneviewPanel';
|
} from './draggablePaneviewPanel';
|
||||||
import { DefaultHeader } from './defaultPaneviewHeader';
|
import { DefaultHeader } from './defaultPaneviewHeader';
|
||||||
import { sequentialNumberGenerator } from '../math';
|
import { sequentialNumberGenerator } from '../math';
|
||||||
@ -22,12 +22,6 @@ import { Classnames } from '../dom';
|
|||||||
|
|
||||||
const nextLayoutId = sequentialNumberGenerator();
|
const nextLayoutId = sequentialNumberGenerator();
|
||||||
|
|
||||||
export interface PaneviewDndOverlayEvent {
|
|
||||||
nativeEvent: DragEvent;
|
|
||||||
panel: IPaneviewPanel;
|
|
||||||
getData: () => PaneTransfer | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SerializedPaneviewPanel {
|
export interface SerializedPaneviewPanel {
|
||||||
snap?: boolean;
|
snap?: boolean;
|
||||||
priority?: LayoutPriority;
|
priority?: LayoutPriority;
|
||||||
@ -106,9 +100,10 @@ export interface IPaneviewComponent extends IDisposable {
|
|||||||
readonly options: PaneviewComponentOptions;
|
readonly options: PaneviewComponentOptions;
|
||||||
readonly onDidAddView: Event<PaneviewPanel>;
|
readonly onDidAddView: Event<PaneviewPanel>;
|
||||||
readonly onDidRemoveView: Event<PaneviewPanel>;
|
readonly onDidRemoveView: Event<PaneviewPanel>;
|
||||||
readonly onDidDrop: Event<PaneviewDropEvent>;
|
readonly onDidDrop: Event<PaneviewDidDropEvent>;
|
||||||
readonly onDidLayoutChange: Event<void>;
|
readonly onDidLayoutChange: Event<void>;
|
||||||
readonly onDidLayoutFromJSON: Event<void>;
|
readonly onDidLayoutFromJSON: Event<void>;
|
||||||
|
readonly onUnhandledDragOverEvent: Event<PaneviewDndOverlayEvent>;
|
||||||
addPanel<T extends object = Parameters>(
|
addPanel<T extends object = Parameters>(
|
||||||
options: AddPaneviewComponentOptions<T>
|
options: AddPaneviewComponentOptions<T>
|
||||||
): IPaneviewPanel;
|
): IPaneviewPanel;
|
||||||
@ -137,8 +132,8 @@ export class PaneviewComponent extends Resizable implements IPaneviewComponent {
|
|||||||
private readonly _onDidLayoutChange = new Emitter<void>();
|
private readonly _onDidLayoutChange = new Emitter<void>();
|
||||||
readonly onDidLayoutChange: Event<void> = this._onDidLayoutChange.event;
|
readonly onDidLayoutChange: Event<void> = this._onDidLayoutChange.event;
|
||||||
|
|
||||||
private readonly _onDidDrop = new Emitter<PaneviewDropEvent>();
|
private readonly _onDidDrop = new Emitter<PaneviewDidDropEvent>();
|
||||||
readonly onDidDrop: Event<PaneviewDropEvent> = this._onDidDrop.event;
|
readonly onDidDrop: Event<PaneviewDidDropEvent> = this._onDidDrop.event;
|
||||||
|
|
||||||
private readonly _onDidAddView = new Emitter<PaneviewPanel>();
|
private readonly _onDidAddView = new Emitter<PaneviewPanel>();
|
||||||
readonly onDidAddView = this._onDidAddView.event;
|
readonly onDidAddView = this._onDidAddView.event;
|
||||||
@ -146,6 +141,11 @@ export class PaneviewComponent extends Resizable implements IPaneviewComponent {
|
|||||||
private readonly _onDidRemoveView = new Emitter<PaneviewPanel>();
|
private readonly _onDidRemoveView = new Emitter<PaneviewPanel>();
|
||||||
readonly onDidRemoveView = this._onDidRemoveView.event;
|
readonly onDidRemoveView = this._onDidRemoveView.event;
|
||||||
|
|
||||||
|
private readonly _onUnhandledDragOverEvent =
|
||||||
|
new Emitter<PaneviewDndOverlayEvent>();
|
||||||
|
readonly onUnhandledDragOverEvent: Event<PaneviewDndOverlayEvent> =
|
||||||
|
this._onUnhandledDragOverEvent.event;
|
||||||
|
|
||||||
private readonly _classNames: Classnames;
|
private readonly _classNames: Classnames;
|
||||||
|
|
||||||
get id(): string {
|
get id(): string {
|
||||||
@ -204,7 +204,8 @@ export class PaneviewComponent extends Resizable implements IPaneviewComponent {
|
|||||||
this._onDidLayoutfromJSON,
|
this._onDidLayoutfromJSON,
|
||||||
this._onDidDrop,
|
this._onDidDrop,
|
||||||
this._onDidAddView,
|
this._onDidAddView,
|
||||||
this._onDidRemoveView
|
this._onDidRemoveView,
|
||||||
|
this._onUnhandledDragOverEvent
|
||||||
);
|
);
|
||||||
|
|
||||||
this._classNames = new Classnames(this.element);
|
this._classNames = new Classnames(this.element);
|
||||||
@ -442,9 +443,14 @@ export class PaneviewComponent extends Resizable implements IPaneviewComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private doAddPanel(panel: PaneFramework): void {
|
private doAddPanel(panel: PaneFramework): void {
|
||||||
const disposable = panel.onDidDrop((event) => {
|
const disposable = new CompositeDisposable(
|
||||||
this._onDidDrop.fire(event);
|
panel.onDidDrop((event) => {
|
||||||
});
|
this._onDidDrop.fire(event);
|
||||||
|
}),
|
||||||
|
panel.onUnhandledDragOverEvent((event) => {
|
||||||
|
this._onUnhandledDragOverEvent.fire(event);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
this._viewDisposables.set(panel.id, disposable);
|
this._viewDisposables.set(panel.id, disposable);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
PaneviewPanelApi,
|
PaneviewPanelApi,
|
||||||
PaneviewDndOverlayEvent,
|
|
||||||
PaneviewApi,
|
PaneviewApi,
|
||||||
PaneviewDropEvent,
|
PaneviewDropEvent,
|
||||||
createPaneview,
|
createPaneview,
|
||||||
@ -32,7 +31,6 @@ export interface IPaneviewReactProps extends PaneviewOptions {
|
|||||||
string,
|
string,
|
||||||
React.FunctionComponent<IPaneviewPanelProps>
|
React.FunctionComponent<IPaneviewPanelProps>
|
||||||
>;
|
>;
|
||||||
showDndOverlay?: (event: PaneviewDndOverlayEvent) => boolean;
|
|
||||||
onDidDrop?(event: PaneviewDropEvent): void;
|
onDidDrop?(event: PaneviewDropEvent): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,15 +175,6 @@ export const PaneviewReact = React.forwardRef(
|
|||||||
};
|
};
|
||||||
}, [props.onDidDrop]);
|
}, [props.onDidDrop]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
if (!paneviewRef.current) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
paneviewRef.current.updateOptions({
|
|
||||||
showDndOverlay: props.showDndOverlay,
|
|
||||||
});
|
|
||||||
}, [props.showDndOverlay]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={props.className}
|
className={props.className}
|
||||||
|
@ -2509,7 +2509,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked before a group is dragged.\r\n\r\nCalling "
|
"text": "Invoked before a group is dragged.\n\nCalling "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -2540,7 +2540,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked before a group is dragged.\r\n\r\nCalling "
|
"text": "Invoked before a group is dragged.\n\nCalling "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -2563,7 +2563,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked before a panel is dragged.\r\n\r\nCalling "
|
"text": "Invoked before a panel is dragged.\n\nCalling "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -2594,7 +2594,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked before a panel is dragged.\r\n\r\nCalling "
|
"text": "Invoked before a panel is dragged.\n\nCalling "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -2617,7 +2617,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked when a Drag'n'Drop event occurs but before dockview handles it giving the user an opportunity to intecept and\r\nprevent the event from occuring using the standard "
|
"text": "Invoked when a Drag'n'Drop event occurs but before dockview handles it giving the user an opportunity to intecept and\nprevent the event from occuring using the standard "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -2625,7 +2625,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": " syntax.\r\n\r\nPreventing certain events may causes unexpected behaviours, use carefully."
|
"text": " syntax.\n\nPreventing certain events may causes unexpected behaviours, use carefully."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -2648,7 +2648,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked when a Drag'n'Drop event occurs but before dockview handles it giving the user an opportunity to intecept and\r\nprevent the event from occuring using the standard "
|
"text": "Invoked when a Drag'n'Drop event occurs but before dockview handles it giving the user an opportunity to intecept and\nprevent the event from occuring using the standard "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -2656,7 +2656,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": " syntax.\r\n\r\nPreventing certain events may causes unexpected behaviours, use carefully."
|
"text": " syntax.\n\nPreventing certain events may causes unexpected behaviours, use carefully."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -2671,7 +2671,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked before an overlay is shown indicating a drop target.\r\n\r\nCalling "
|
"text": "Invoked before an overlay is shown indicating a drop target.\n\nCalling "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -2679,7 +2679,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": " will prevent the overlay being shown and prevent\r\nthe any subsequent drop event."
|
"text": " will prevent the overlay being shown and prevent\nthe any subsequent drop event."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -2702,7 +2702,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked before an overlay is shown indicating a drop target.\r\n\r\nCalling "
|
"text": "Invoked before an overlay is shown indicating a drop target.\n\nCalling "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -2710,7 +2710,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": " will prevent the overlay being shown and prevent\r\nthe any subsequent drop event."
|
"text": " will prevent the overlay being shown and prevent\nthe any subsequent drop event."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -9548,7 +9548,9 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"extends": []
|
"extends": [
|
||||||
|
"AcceptableEvent"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"DockviewWillDropEvent": {
|
"DockviewWillDropEvent": {
|
||||||
"kind": "class",
|
"kind": "class",
|
||||||
@ -9909,6 +9911,26 @@
|
|||||||
"isReadonly": true
|
"isReadonly": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "onUnhandledDragOverEvent",
|
||||||
|
"code": "Event<PaneviewDndOverlayEvent>",
|
||||||
|
"kind": "property",
|
||||||
|
"type": {
|
||||||
|
"type": "reference",
|
||||||
|
"value": "Event",
|
||||||
|
"source": "dockview-core",
|
||||||
|
"typeArguments": [
|
||||||
|
{
|
||||||
|
"type": "reference",
|
||||||
|
"value": "PaneviewDndOverlayEvent",
|
||||||
|
"source": "dockview-core"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"flags": {
|
||||||
|
"isReadonly": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "part",
|
"name": "part",
|
||||||
"code": "IFrameworkPart",
|
"code": "IFrameworkPart",
|
||||||
@ -15115,6 +15137,26 @@
|
|||||||
"isReadonly": true
|
"isReadonly": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "onUnhandledDragOverEvent",
|
||||||
|
"code": "Event<PaneviewDndOverlayEvent>",
|
||||||
|
"kind": "property",
|
||||||
|
"type": {
|
||||||
|
"type": "reference",
|
||||||
|
"value": "Event",
|
||||||
|
"source": "dockview-core",
|
||||||
|
"typeArguments": [
|
||||||
|
{
|
||||||
|
"type": "reference",
|
||||||
|
"value": "PaneviewDndOverlayEvent",
|
||||||
|
"source": "dockview-core"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"flags": {
|
||||||
|
"isReadonly": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "part",
|
"name": "part",
|
||||||
"code": "IFrameworkPart",
|
"code": "IFrameworkPart",
|
||||||
@ -16584,6 +16626,28 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "onUnhandledDragOverEvent",
|
||||||
|
"code": "Event<PaneviewDndOverlayEvent>",
|
||||||
|
"kind": "accessor",
|
||||||
|
"value": {
|
||||||
|
"name": "onUnhandledDragOverEvent",
|
||||||
|
"code": "Event<PaneviewDndOverlayEvent>",
|
||||||
|
"kind": "getSignature",
|
||||||
|
"returnType": {
|
||||||
|
"type": "reference",
|
||||||
|
"value": "Event",
|
||||||
|
"source": "dockview-core",
|
||||||
|
"typeArguments": [
|
||||||
|
{
|
||||||
|
"type": "reference",
|
||||||
|
"value": "PaneviewDndOverlayEvent",
|
||||||
|
"source": "dockview-core"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "panels",
|
"name": "panels",
|
||||||
"code": "IPaneviewPanel[]",
|
"code": "IPaneviewPanel[]",
|
||||||
@ -17292,6 +17356,26 @@
|
|||||||
"isReadonly": true
|
"isReadonly": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "onUnhandledDragOverEvent",
|
||||||
|
"code": "Event<PaneviewDndOverlayEvent>",
|
||||||
|
"kind": "property",
|
||||||
|
"type": {
|
||||||
|
"type": "reference",
|
||||||
|
"value": "Event",
|
||||||
|
"source": "dockview-core",
|
||||||
|
"typeArguments": [
|
||||||
|
{
|
||||||
|
"type": "reference",
|
||||||
|
"value": "PaneviewDndOverlayEvent",
|
||||||
|
"source": "dockview-core"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"flags": {
|
||||||
|
"isReadonly": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "disableResizing",
|
"name": "disableResizing",
|
||||||
"code": "boolean",
|
"code": "boolean",
|
||||||
@ -19487,7 +19571,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked whenever any aspect of the layout changes.\r\nIf listening to this event it may be worth debouncing ouputs."
|
"text": "Invoked whenever any aspect of the layout changes.\nIf listening to this event it may be worth debouncing ouputs."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -19509,7 +19593,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "Invoked whenever any aspect of the layout changes.\r\nIf listening to this event it may be worth debouncing ouputs."
|
"text": "Invoked whenever any aspect of the layout changes.\nIf listening to this event it may be worth debouncing ouputs."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -20105,7 +20189,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": " method\r\nfor the subsequent resize."
|
"text": " method\nfor the subsequent resize."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -20167,7 +20251,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": " method\r\nfor the subsequent resize."
|
"text": " method\nfor the subsequent resize."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -23092,7 +23176,9 @@
|
|||||||
"type": "intrinsic",
|
"type": "intrinsic",
|
||||||
"value": "boolean"
|
"value": "boolean"
|
||||||
},
|
},
|
||||||
"flags": {}
|
"flags": {
|
||||||
|
"isReadonly": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nativeEvent",
|
"name": "nativeEvent",
|
||||||
@ -23146,7 +23232,9 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"extends": []
|
"extends": [
|
||||||
|
"IAcceptableEvent"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"DockviewFrameworkOptions": {
|
"DockviewFrameworkOptions": {
|
||||||
"kind": "interface",
|
"kind": "interface",
|
||||||
@ -24288,7 +24376,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": ".\r\nCall "
|
"text": ".\nCall "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -35161,6 +35249,26 @@
|
|||||||
"isReadonly": true
|
"isReadonly": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "onUnhandledDragOverEvent",
|
||||||
|
"code": "Event<PaneviewDndOverlayEvent>",
|
||||||
|
"kind": "property",
|
||||||
|
"type": {
|
||||||
|
"type": "reference",
|
||||||
|
"value": "Event",
|
||||||
|
"source": "dockview-core",
|
||||||
|
"typeArguments": [
|
||||||
|
{
|
||||||
|
"type": "reference",
|
||||||
|
"value": "PaneviewDndOverlayEvent",
|
||||||
|
"source": "dockview-core"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"flags": {
|
||||||
|
"isReadonly": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "options",
|
"name": "options",
|
||||||
"code": "PaneviewComponentOptions",
|
"code": "PaneviewComponentOptions",
|
||||||
@ -38650,72 +38758,6 @@
|
|||||||
"PanelInitParameters"
|
"PanelInitParameters"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"PaneviewDndOverlayEvent": {
|
|
||||||
"kind": "interface",
|
|
||||||
"name": "PaneviewDndOverlayEvent",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"name": "getData",
|
|
||||||
"code": "(): PaneTransfer | undefined",
|
|
||||||
"kind": "property",
|
|
||||||
"type": {
|
|
||||||
"type": "reflection",
|
|
||||||
"value": {
|
|
||||||
"name": "__type",
|
|
||||||
"code": "(): PaneTransfer | undefined",
|
|
||||||
"kind": "typeLiteral",
|
|
||||||
"signatures": [
|
|
||||||
{
|
|
||||||
"name": "__type",
|
|
||||||
"typeParameters": [],
|
|
||||||
"parameters": [],
|
|
||||||
"returnType": {
|
|
||||||
"type": "or",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"type": "reference",
|
|
||||||
"value": "PaneTransfer",
|
|
||||||
"source": "dockview-core"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "intrinsic",
|
|
||||||
"value": "undefined"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"code": "(): PaneTransfer | undefined",
|
|
||||||
"kind": "callSignature"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flags": {}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nativeEvent",
|
|
||||||
"code": "DragEvent",
|
|
||||||
"kind": "property",
|
|
||||||
"type": {
|
|
||||||
"type": "reference",
|
|
||||||
"value": "DragEvent",
|
|
||||||
"source": "typescript"
|
|
||||||
},
|
|
||||||
"flags": {}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "panel",
|
|
||||||
"code": "IPaneviewPanel",
|
|
||||||
"kind": "property",
|
|
||||||
"type": {
|
|
||||||
"type": "reference",
|
|
||||||
"value": "IPaneviewPanel",
|
|
||||||
"source": "dockview-core"
|
|
||||||
},
|
|
||||||
"flags": {}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"extends": []
|
|
||||||
},
|
|
||||||
"PaneviewDropEvent": {
|
"PaneviewDropEvent": {
|
||||||
"kind": "interface",
|
"kind": "interface",
|
||||||
"name": "PaneviewDropEvent",
|
"name": "PaneviewDropEvent",
|
||||||
@ -38945,46 +38987,6 @@
|
|||||||
"flags": {
|
"flags": {
|
||||||
"isOptional": true
|
"isOptional": true
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "showDndOverlay",
|
|
||||||
"code": "(event: PaneviewDndOverlayEvent): boolean",
|
|
||||||
"kind": "property",
|
|
||||||
"type": {
|
|
||||||
"type": "reflection",
|
|
||||||
"value": {
|
|
||||||
"name": "__type",
|
|
||||||
"code": "(event: PaneviewDndOverlayEvent): boolean",
|
|
||||||
"kind": "typeLiteral",
|
|
||||||
"signatures": [
|
|
||||||
{
|
|
||||||
"name": "__type",
|
|
||||||
"typeParameters": [],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "event",
|
|
||||||
"code": "event: PaneviewDndOverlayEvent",
|
|
||||||
"type": {
|
|
||||||
"type": "reference",
|
|
||||||
"value": "PaneviewDndOverlayEvent",
|
|
||||||
"source": "dockview-core"
|
|
||||||
},
|
|
||||||
"kind": "parameter"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"returnType": {
|
|
||||||
"type": "intrinsic",
|
|
||||||
"value": "boolean"
|
|
||||||
},
|
|
||||||
"code": "(event: PaneviewDndOverlayEvent): boolean",
|
|
||||||
"kind": "callSignature"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flags": {
|
|
||||||
"isOptional": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"extends": []
|
"extends": []
|
||||||
@ -41389,7 +41391,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "If true then add the panel without setting it as the active panel.\r\n\r\nDefaults to "
|
"text": "If true then add the panel without setting it as the active panel.\n\nDefaults to "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "code",
|
"kind": "code",
|
||||||
@ -41456,7 +41458,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "The rendering mode of the panel.\r\n\r\nThis dictates what happens to the HTML of the panel when it is hidden."
|
"text": "The rendering mode of the panel.\n\nThis dictates what happens to the HTML of the panel when it is hidden."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -41496,7 +41498,7 @@
|
|||||||
"summary": [
|
"summary": [
|
||||||
{
|
{
|
||||||
"kind": "text",
|
"kind": "text",
|
||||||
"text": "The title for the panel which can be accessed within both the tab and component.\r\n\r\nIf using the default tab renderer this title will be displayed in the tab."
|
"text": "The title for the panel which can be accessed within both the tab and component.\n\nIf using the default tab renderer this title will be displayed in the tab."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -43524,46 +43526,6 @@
|
|||||||
},
|
},
|
||||||
"flags": {}
|
"flags": {}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "showDndOverlay",
|
|
||||||
"code": "(event: PaneviewDndOverlayEvent): boolean",
|
|
||||||
"kind": "property",
|
|
||||||
"type": {
|
|
||||||
"type": "reflection",
|
|
||||||
"value": {
|
|
||||||
"name": "__type",
|
|
||||||
"code": "(event: PaneviewDndOverlayEvent): boolean",
|
|
||||||
"kind": "typeLiteral",
|
|
||||||
"signatures": [
|
|
||||||
{
|
|
||||||
"name": "__type",
|
|
||||||
"typeParameters": [],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "event",
|
|
||||||
"code": "event: PaneviewDndOverlayEvent",
|
|
||||||
"type": {
|
|
||||||
"type": "reference",
|
|
||||||
"value": "PaneviewDndOverlayEvent",
|
|
||||||
"source": "dockview-core"
|
|
||||||
},
|
|
||||||
"kind": "parameter"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"returnType": {
|
|
||||||
"type": "intrinsic",
|
|
||||||
"value": "boolean"
|
|
||||||
},
|
|
||||||
"code": "(event: PaneviewDndOverlayEvent): boolean",
|
|
||||||
"kind": "callSignature"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flags": {
|
|
||||||
"isOptional": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "onDidDrop",
|
"name": "onDidDrop",
|
||||||
"code": "(event: PaneviewDropEvent): void",
|
"code": "(event: PaneviewDropEvent): void",
|
||||||
|
Loading…
Reference in New Issue
Block a user