dockview-vue 6.2.1 → 6.3.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.
@@ -225,6 +225,32 @@ class VueTabGroupChipRenderer extends AbstractVueRenderer {
225
225
  this._renderDisposable?.dispose();
226
226
  }
227
227
  }
228
+ class VueGroupDragGhostRenderer extends AbstractVueRenderer {
229
+ _renderDisposable;
230
+ constructor(component, parent) {
231
+ super(component, parent);
232
+ this.element.style.height = "";
233
+ this.element.style.width = "";
234
+ this.element.style.display = "inline-flex";
235
+ }
236
+ init(params) {
237
+ this._renderDisposable?.dispose();
238
+ this._renderDisposable = mountVueComponent(
239
+ this.component,
240
+ this.parent,
241
+ {
242
+ params: {
243
+ group: params.group,
244
+ api: params.api
245
+ }
246
+ },
247
+ this.element
248
+ );
249
+ }
250
+ dispose() {
251
+ this._renderDisposable?.dispose();
252
+ }
253
+ }
228
254
  class VuePart {
229
255
  constructor(element, vueComponent, parent, props) {
230
256
  this.element = element;
@@ -263,6 +289,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
263
289
  disableFloatingGroups: { type: Boolean },
264
290
  floatingGroupBounds: {},
265
291
  popoutUrl: {},
292
+ nonce: { type: [String, Function] },
266
293
  defaultRenderer: {},
267
294
  defaultHeaderPosition: {},
268
295
  debug: { type: Boolean },
@@ -278,6 +305,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
278
305
  getTabContextMenuItems: { type: Function },
279
306
  getTabGroupChipContextMenuItems: { type: Function },
280
307
  createTabGroupChipComponent: { type: Function },
308
+ createGroupDragGhostComponent: { type: Function },
281
309
  tabGroupColors: {},
282
310
  tabGroupAccent: {},
283
311
  watermarkComponent: {},
@@ -285,7 +313,8 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
285
313
  rightHeaderActionsComponent: {},
286
314
  leftHeaderActionsComponent: {},
287
315
  prefixHeaderActionsComponent: {},
288
- tabGroupChipComponent: {}
316
+ tabGroupChipComponent: {},
317
+ groupDragGhostComponent: {}
289
318
  },
290
319
  emits: ["ready", "didDrop", "willDrop"],
291
320
  setup(__props, { emit: __emit }) {
@@ -325,6 +354,22 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
325
354
  }
326
355
  }
327
356
  );
357
+ vue.watch(
358
+ () => props.groupDragGhostComponent,
359
+ (newValue) => {
360
+ if (instance.value) {
361
+ instance.value.updateOptions({
362
+ createGroupDragGhostComponent: newValue ? () => {
363
+ const component = findComponent(inst, newValue);
364
+ return new VueGroupDragGhostRenderer(
365
+ component,
366
+ inst
367
+ );
368
+ } : void 0
369
+ });
370
+ }
371
+ }
372
+ );
328
373
  vue.watch(
329
374
  () => props.defaultTabComponent,
330
375
  (newValue) => {
@@ -478,6 +523,13 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
478
523
  return new VueTabGroupChipRenderer(component, inst);
479
524
  };
480
525
  }
526
+ if (props.groupDragGhostComponent) {
527
+ const ghostComponentName = props.groupDragGhostComponent;
528
+ coreOptions.createGroupDragGhostComponent = () => {
529
+ const component = findComponent(inst, ghostComponentName);
530
+ return new VueGroupDragGhostRenderer(component, inst);
531
+ };
532
+ }
481
533
  const api = dockviewCore.createDockview(el.value, {
482
534
  ...coreOptions,
483
535
  ...frameworkOptions
@@ -796,6 +848,7 @@ exports.GridviewVue = _sfc_main$1;
796
848
  exports.PaneviewVue = _sfc_main;
797
849
  exports.SplitviewVue = _sfc_main$2;
798
850
  exports.VueContextMenuItemRenderer = VueContextMenuItemRenderer;
851
+ exports.VueGroupDragGhostRenderer = VueGroupDragGhostRenderer;
799
852
  exports.VueHeaderActionsRenderer = VueHeaderActionsRenderer;
800
853
  exports.VuePart = VuePart;
801
854
  exports.VueRenderer = VueRenderer;
@@ -224,6 +224,32 @@ class VueTabGroupChipRenderer extends AbstractVueRenderer {
224
224
  this._renderDisposable?.dispose();
225
225
  }
226
226
  }
227
+ class VueGroupDragGhostRenderer extends AbstractVueRenderer {
228
+ _renderDisposable;
229
+ constructor(component, parent) {
230
+ super(component, parent);
231
+ this.element.style.height = "";
232
+ this.element.style.width = "";
233
+ this.element.style.display = "inline-flex";
234
+ }
235
+ init(params) {
236
+ this._renderDisposable?.dispose();
237
+ this._renderDisposable = mountVueComponent(
238
+ this.component,
239
+ this.parent,
240
+ {
241
+ params: {
242
+ group: params.group,
243
+ api: params.api
244
+ }
245
+ },
246
+ this.element
247
+ );
248
+ }
249
+ dispose() {
250
+ this._renderDisposable?.dispose();
251
+ }
252
+ }
227
253
  class VuePart {
228
254
  constructor(element, vueComponent, parent, props) {
229
255
  this.element = element;
@@ -262,6 +288,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
262
288
  disableFloatingGroups: { type: Boolean },
263
289
  floatingGroupBounds: {},
264
290
  popoutUrl: {},
291
+ nonce: { type: [String, Function] },
265
292
  defaultRenderer: {},
266
293
  defaultHeaderPosition: {},
267
294
  debug: { type: Boolean },
@@ -277,6 +304,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
277
304
  getTabContextMenuItems: { type: Function },
278
305
  getTabGroupChipContextMenuItems: { type: Function },
279
306
  createTabGroupChipComponent: { type: Function },
307
+ createGroupDragGhostComponent: { type: Function },
280
308
  tabGroupColors: {},
281
309
  tabGroupAccent: {},
282
310
  watermarkComponent: {},
@@ -284,7 +312,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
284
312
  rightHeaderActionsComponent: {},
285
313
  leftHeaderActionsComponent: {},
286
314
  prefixHeaderActionsComponent: {},
287
- tabGroupChipComponent: {}
315
+ tabGroupChipComponent: {},
316
+ groupDragGhostComponent: {}
288
317
  },
289
318
  emits: ["ready", "didDrop", "willDrop"],
290
319
  setup(__props, { emit: __emit }) {
@@ -324,6 +353,22 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
324
353
  }
325
354
  }
326
355
  );
356
+ watch(
357
+ () => props.groupDragGhostComponent,
358
+ (newValue) => {
359
+ if (instance.value) {
360
+ instance.value.updateOptions({
361
+ createGroupDragGhostComponent: newValue ? () => {
362
+ const component = findComponent(inst, newValue);
363
+ return new VueGroupDragGhostRenderer(
364
+ component,
365
+ inst
366
+ );
367
+ } : void 0
368
+ });
369
+ }
370
+ }
371
+ );
327
372
  watch(
328
373
  () => props.defaultTabComponent,
329
374
  (newValue) => {
@@ -477,6 +522,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
477
522
  return new VueTabGroupChipRenderer(component, inst);
478
523
  };
479
524
  }
525
+ if (props.groupDragGhostComponent) {
526
+ const ghostComponentName = props.groupDragGhostComponent;
527
+ coreOptions.createGroupDragGhostComponent = () => {
528
+ const component = findComponent(inst, ghostComponentName);
529
+ return new VueGroupDragGhostRenderer(component, inst);
530
+ };
531
+ }
480
532
  const api = createDockview(el.value, {
481
533
  ...coreOptions,
482
534
  ...frameworkOptions
@@ -796,6 +848,7 @@ export {
796
848
  _sfc_main as PaneviewVue,
797
849
  _sfc_main$2 as SplitviewVue,
798
850
  VueContextMenuItemRenderer,
851
+ VueGroupDragGhostRenderer,
799
852
  VueHeaderActionsRenderer,
800
853
  VuePart,
801
854
  VueRenderer,
@@ -225,6 +225,32 @@
225
225
  this._renderDisposable?.dispose();
226
226
  }
227
227
  }
228
+ class VueGroupDragGhostRenderer extends AbstractVueRenderer {
229
+ _renderDisposable;
230
+ constructor(component, parent) {
231
+ super(component, parent);
232
+ this.element.style.height = "";
233
+ this.element.style.width = "";
234
+ this.element.style.display = "inline-flex";
235
+ }
236
+ init(params) {
237
+ this._renderDisposable?.dispose();
238
+ this._renderDisposable = mountVueComponent(
239
+ this.component,
240
+ this.parent,
241
+ {
242
+ params: {
243
+ group: params.group,
244
+ api: params.api
245
+ }
246
+ },
247
+ this.element
248
+ );
249
+ }
250
+ dispose() {
251
+ this._renderDisposable?.dispose();
252
+ }
253
+ }
228
254
  class VuePart {
229
255
  constructor(element, vueComponent, parent, props) {
230
256
  this.element = element;
@@ -263,6 +289,7 @@
263
289
  disableFloatingGroups: { type: Boolean },
264
290
  floatingGroupBounds: {},
265
291
  popoutUrl: {},
292
+ nonce: { type: [String, Function] },
266
293
  defaultRenderer: {},
267
294
  defaultHeaderPosition: {},
268
295
  debug: { type: Boolean },
@@ -278,6 +305,7 @@
278
305
  getTabContextMenuItems: { type: Function },
279
306
  getTabGroupChipContextMenuItems: { type: Function },
280
307
  createTabGroupChipComponent: { type: Function },
308
+ createGroupDragGhostComponent: { type: Function },
281
309
  tabGroupColors: {},
282
310
  tabGroupAccent: {},
283
311
  watermarkComponent: {},
@@ -285,7 +313,8 @@
285
313
  rightHeaderActionsComponent: {},
286
314
  leftHeaderActionsComponent: {},
287
315
  prefixHeaderActionsComponent: {},
288
- tabGroupChipComponent: {}
316
+ tabGroupChipComponent: {},
317
+ groupDragGhostComponent: {}
289
318
  },
290
319
  emits: ["ready", "didDrop", "willDrop"],
291
320
  setup(__props, { emit: __emit }) {
@@ -325,6 +354,22 @@
325
354
  }
326
355
  }
327
356
  );
357
+ vue.watch(
358
+ () => props.groupDragGhostComponent,
359
+ (newValue) => {
360
+ if (instance.value) {
361
+ instance.value.updateOptions({
362
+ createGroupDragGhostComponent: newValue ? () => {
363
+ const component = findComponent(inst, newValue);
364
+ return new VueGroupDragGhostRenderer(
365
+ component,
366
+ inst
367
+ );
368
+ } : void 0
369
+ });
370
+ }
371
+ }
372
+ );
328
373
  vue.watch(
329
374
  () => props.defaultTabComponent,
330
375
  (newValue) => {
@@ -478,6 +523,13 @@
478
523
  return new VueTabGroupChipRenderer(component, inst);
479
524
  };
480
525
  }
526
+ if (props.groupDragGhostComponent) {
527
+ const ghostComponentName = props.groupDragGhostComponent;
528
+ coreOptions.createGroupDragGhostComponent = () => {
529
+ const component = findComponent(inst, ghostComponentName);
530
+ return new VueGroupDragGhostRenderer(component, inst);
531
+ };
532
+ }
481
533
  const api = dockviewCore.createDockview(el.value, {
482
534
  ...coreOptions,
483
535
  ...frameworkOptions
@@ -796,6 +848,7 @@
796
848
  exports2.PaneviewVue = _sfc_main;
797
849
  exports2.SplitviewVue = _sfc_main$2;
798
850
  exports2.VueContextMenuItemRenderer = VueContextMenuItemRenderer;
851
+ exports2.VueGroupDragGhostRenderer = VueGroupDragGhostRenderer;
799
852
  exports2.VueHeaderActionsRenderer = VueHeaderActionsRenderer;
800
853
  exports2.VuePart = VuePart;
801
854
  exports2.VueRenderer = VueRenderer;
@@ -6,6 +6,7 @@ export interface VueProps {
6
6
  leftHeaderActionsComponent?: string;
7
7
  prefixHeaderActionsComponent?: string;
8
8
  tabGroupChipComponent?: string;
9
+ groupDragGhostComponent?: string;
9
10
  }
10
11
  export type VueEvents = {
11
12
  ready: [event: DockviewReadyEvent];
@@ -1,4 +1,4 @@
1
- import type { DockviewApi, DockviewGroupPanel, IContentRenderer, IGroupHeaderProps, IHeaderActionsRenderer, ITabGroupChipRenderer, ITabGroup, ITabRenderer, IWatermarkRenderer, IContextMenuItemRenderer, IContextMenuItemComponentProps, PanelUpdateEvent, Parameters, TabPartInitParameters, WatermarkRendererInitParameters } from 'dockview-core';
1
+ import type { DockviewApi, DockviewGroupPanel, IContentRenderer, IDockviewGroupPanel, IGroupDragGhostRenderer, IGroupHeaderProps, IHeaderActionsRenderer, ITabGroupChipRenderer, ITabGroup, ITabRenderer, IWatermarkRenderer, IContextMenuItemRenderer, IContextMenuItemComponentProps, PanelUpdateEvent, Parameters, TabPartInitParameters, WatermarkRendererInitParameters } from 'dockview-core';
2
2
  import { type ComponentOptionsBase, type DefineComponent, type ComponentInternalInstance } from 'vue';
3
3
  export type ComponentInterface = ComponentOptionsBase<any, any, any, any, any, any, any, any>;
4
4
  export type VueComponent<T = any> = DefineComponent<T>;
@@ -64,6 +64,15 @@ export declare class VueTabGroupChipRenderer extends AbstractVueRenderer impleme
64
64
  }): void;
65
65
  dispose(): void;
66
66
  }
67
+ export declare class VueGroupDragGhostRenderer extends AbstractVueRenderer implements IGroupDragGhostRenderer {
68
+ private _renderDisposable;
69
+ constructor(component: VueComponent, parent: ComponentInternalInstance);
70
+ init(params: {
71
+ group: IDockviewGroupPanel;
72
+ api: DockviewApi;
73
+ }): void;
74
+ dispose(): void;
75
+ }
67
76
  export declare class VuePart<T extends Record<string, any> = any> {
68
77
  private readonly element;
69
78
  private readonly vueComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dockview-vue",
3
- "version": "6.2.1",
3
+ "version": "6.3.0",
4
4
  "description": "Vue 3 docking layout manager — tabs, groups, grids, splitviews, drag and drop, floating panels",
5
5
  "keywords": [
6
6
  "splitview",
@@ -67,7 +67,7 @@
67
67
  "format:check": "prettier --check 'src/**/*.{ts,tsx,js,jsx,vue}'"
68
68
  },
69
69
  "dependencies": {
70
- "dockview-core": "^6.2.1"
70
+ "dockview-core": "^6.3.0"
71
71
  },
72
72
  "peerDependencies": {
73
73
  "vue": "^3.4.0"