mirror of
https://github.com/mathuo/dockview
synced 2025-02-02 14:35:46 +00:00
chore: sonarcloud requests
This commit is contained in:
parent
35630e4f1c
commit
c4ab6ac562
@ -204,13 +204,14 @@ export class DockviewPanelApiImpl
|
||||
|
||||
this.groupEventsDisposable.value = new CompositeDisposable(
|
||||
this.group.api.onDidVisibilityChange((event) => {
|
||||
if (!event.isVisible && this.isVisible) {
|
||||
this._onDidVisibilityChange.fire(event);
|
||||
} else if (
|
||||
event.isVisible &&
|
||||
!this.isVisible &&
|
||||
this.group.model.isPanelActive(this.panel)
|
||||
) {
|
||||
const hasBecomeHidden = !event.isVisible && this.isVisible;
|
||||
const hasBecomeVisible = event.isVisible && !this.isVisible;
|
||||
|
||||
const isActivePanel = this.group.model.isPanelActive(
|
||||
this.panel
|
||||
);
|
||||
|
||||
if (hasBecomeHidden || (hasBecomeVisible && isActivePanel)) {
|
||||
this._onDidVisibilityChange.fire(event);
|
||||
}
|
||||
}),
|
||||
|
@ -1,4 +1,8 @@
|
||||
class TransferObject {}
|
||||
class TransferObject {
|
||||
constructor() {
|
||||
// intentionally empty class
|
||||
}
|
||||
}
|
||||
|
||||
export class PanelTransfer extends TransferObject {
|
||||
constructor(
|
||||
|
@ -652,7 +652,7 @@ export class DockviewComponent
|
||||
const box: Box = getBox();
|
||||
|
||||
const groupId =
|
||||
options?.overridePopoutGroup?.id ?? this.getNextGroupId(); //item.id;
|
||||
options?.overridePopoutGroup?.id ?? this.getNextGroupId();
|
||||
|
||||
if (itemToPopout.api.location.type === 'grid') {
|
||||
itemToPopout.api.setVisible(false);
|
||||
@ -811,17 +811,15 @@ export class DockviewComponent
|
||||
skipPopoutAssociated: true,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (this.getPanel(group.id)) {
|
||||
const removedGroup = this.doRemoveGroup(group, {
|
||||
skipDispose: true,
|
||||
skipActive: true,
|
||||
});
|
||||
removedGroup.model.renderContainer =
|
||||
this.overlayRenderContainer;
|
||||
removedGroup.model.location = { type: 'grid' };
|
||||
returnedGroup = removedGroup;
|
||||
}
|
||||
} else if (this.getPanel(group.id)) {
|
||||
const removedGroup = this.doRemoveGroup(group, {
|
||||
skipDispose: true,
|
||||
skipActive: true,
|
||||
});
|
||||
removedGroup.model.renderContainer =
|
||||
this.overlayRenderContainer;
|
||||
removedGroup.model.location = { type: 'grid' };
|
||||
returnedGroup = removedGroup;
|
||||
}
|
||||
})
|
||||
);
|
||||
@ -894,7 +892,7 @@ export class DockviewComponent
|
||||
this.doRemoveGroup(item, {
|
||||
skipDispose: true,
|
||||
skipPopoutReturn: true,
|
||||
skipPopoutAssociated: !!popoutReferenceGroup,
|
||||
skipPopoutAssociated: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1372,7 +1370,6 @@ export class DockviewComponent
|
||||
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
||||
|
||||
const hasActiveGroup = !!this.activeGroup;
|
||||
const hasActivePanel = !!this.activePanel;
|
||||
|
||||
for (const group of groups) {
|
||||
// remove the group will automatically remove the panels
|
||||
|
@ -993,7 +993,7 @@ export class DockviewGroupPanelModel
|
||||
target,
|
||||
position,
|
||||
getPanelData,
|
||||
this.accessor.getPanel(this.id)!
|
||||
this.accessor.getPanel(this.id)
|
||||
);
|
||||
|
||||
this._onUnhandledDragOverEvent.fire(firedEvent);
|
||||
|
@ -63,15 +63,12 @@ export interface IDockviewReactProps extends DockviewOptions {
|
||||
}
|
||||
|
||||
function extractCoreOptions(props: IDockviewReactProps): DockviewOptions {
|
||||
const coreOptions = (PROPERTY_KEYS as (keyof DockviewOptions)[]).reduce(
|
||||
(obj, key) => {
|
||||
if (key in props) {
|
||||
obj[key] = props[key] as any;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
{} as Partial<DockviewComponentOptions>
|
||||
);
|
||||
const coreOptions = PROPERTY_KEYS.reduce((obj, key) => {
|
||||
if (key in props) {
|
||||
obj[key] = props[key] as any;
|
||||
}
|
||||
return obj;
|
||||
}, {} as Partial<DockviewComponentOptions>);
|
||||
|
||||
return coreOptions as DockviewOptions;
|
||||
}
|
||||
@ -91,7 +88,7 @@ export const DockviewReact = React.forwardRef(
|
||||
const changes: Partial<DockviewOptions> = {};
|
||||
|
||||
PROPERTY_KEYS.forEach((propKey) => {
|
||||
const key = propKey as keyof DockviewOptions;
|
||||
const key = propKey;
|
||||
const propValue = props[key];
|
||||
|
||||
if (key in props && propValue !== prevProps.current[key]) {
|
||||
|
Loading…
Reference in New Issue
Block a user