dockview-vue 5.1.0 → 6.0.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.
- package/README.md +3 -1
- package/dist/dockview-vue.cjs.js +198 -14
- package/dist/dockview-vue.es.js +196 -11
- package/dist/dockview-vue.umd.js +198 -14
- package/dist/styles/dockview.css +1968 -195
- package/dist/types/composables/useViewComponent.d.ts +2 -2
- package/dist/types/dockview/dockview.vue.d.ts +4 -13
- package/dist/types/dockview/types.d.ts +1 -0
- package/dist/types/gridview/gridview.vue.d.ts +4 -13
- package/dist/types/paneview/paneview.vue.d.ts +4 -13
- package/dist/types/splitview/splitview.vue.d.ts +4 -13
- package/dist/types/utils.d.ts +20 -1
- package/package.json +11 -7
package/dist/dockview-vue.umd.js
CHANGED
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
})(this, function(exports2, dockviewCore, vue) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __publicField = (obj, key, value) =>
|
|
7
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
-
return value;
|
|
9
|
-
};
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
7
|
|
|
11
8
|
function findComponent(parent, name) {
|
|
12
9
|
var _a, _b;
|
|
@@ -157,6 +154,9 @@ var __publicField = (obj, key, value) => {
|
|
|
157
154
|
}),
|
|
158
155
|
props.api.onDidActiveChange(() => {
|
|
159
156
|
this.updateProps();
|
|
157
|
+
}),
|
|
158
|
+
props.api.onDidLocationChange((event) => {
|
|
159
|
+
this.updateLocation(event.location);
|
|
160
160
|
})
|
|
161
161
|
);
|
|
162
162
|
(_a = this._renderDisposable) == null ? void 0 : _a.dispose();
|
|
@@ -179,13 +179,75 @@ var __publicField = (obj, key, value) => {
|
|
|
179
179
|
activePanel: this.group.model.activePanel,
|
|
180
180
|
isGroupActive: this.group.api.isActive,
|
|
181
181
|
group: this.group,
|
|
182
|
-
headerPosition: this.group.model.headerPosition
|
|
182
|
+
headerPosition: this.group.model.headerPosition,
|
|
183
|
+
location: this.group.api.location
|
|
183
184
|
};
|
|
184
185
|
}
|
|
185
186
|
updateProps() {
|
|
186
187
|
var _a;
|
|
187
188
|
(_a = this._renderDisposable) == null ? void 0 : _a.update({ params: this.buildEnrichedProps() });
|
|
188
189
|
}
|
|
190
|
+
updateLocation(location) {
|
|
191
|
+
var _a;
|
|
192
|
+
(_a = this._renderDisposable) == null ? void 0 : _a.update({ params: { location } });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
class VueContextMenuItemRenderer extends AbstractVueRenderer {
|
|
196
|
+
constructor() {
|
|
197
|
+
super(...arguments);
|
|
198
|
+
__publicField(this, "_renderDisposable");
|
|
199
|
+
}
|
|
200
|
+
init(props) {
|
|
201
|
+
var _a;
|
|
202
|
+
(_a = this._renderDisposable) == null ? void 0 : _a.dispose();
|
|
203
|
+
this._renderDisposable = mountVueComponent(
|
|
204
|
+
this.component,
|
|
205
|
+
this.parent,
|
|
206
|
+
{ params: props },
|
|
207
|
+
this.element
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
dispose() {
|
|
211
|
+
var _a;
|
|
212
|
+
(_a = this._renderDisposable) == null ? void 0 : _a.dispose();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
class VueTabGroupChipRenderer extends AbstractVueRenderer {
|
|
216
|
+
constructor(component, parent) {
|
|
217
|
+
super(component, parent);
|
|
218
|
+
__publicField(this, "_renderDisposable");
|
|
219
|
+
this.element.style.height = "";
|
|
220
|
+
this.element.style.width = "";
|
|
221
|
+
this.element.style.display = "inline-flex";
|
|
222
|
+
}
|
|
223
|
+
get element() {
|
|
224
|
+
return this._element;
|
|
225
|
+
}
|
|
226
|
+
init(params) {
|
|
227
|
+
var _a;
|
|
228
|
+
(_a = this._renderDisposable) == null ? void 0 : _a.dispose();
|
|
229
|
+
this._renderDisposable = mountVueComponent(
|
|
230
|
+
this.component,
|
|
231
|
+
this.parent,
|
|
232
|
+
{
|
|
233
|
+
params: {
|
|
234
|
+
tabGroup: params.tabGroup,
|
|
235
|
+
api: params.api
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
this.element
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
update(params) {
|
|
242
|
+
var _a;
|
|
243
|
+
(_a = this._renderDisposable) == null ? void 0 : _a.update({
|
|
244
|
+
params: { tabGroup: params.tabGroup }
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
dispose() {
|
|
248
|
+
var _a;
|
|
249
|
+
(_a = this._renderDisposable) == null ? void 0 : _a.dispose();
|
|
250
|
+
}
|
|
189
251
|
}
|
|
190
252
|
class VuePart {
|
|
191
253
|
constructor(element, vueComponent, parent, props) {
|
|
@@ -236,11 +298,17 @@ var __publicField = (obj, key, value) => {
|
|
|
236
298
|
theme: {},
|
|
237
299
|
disableTabsOverflowList: { type: Boolean },
|
|
238
300
|
scrollbars: {},
|
|
301
|
+
getTabContextMenuItems: { type: Function },
|
|
302
|
+
getTabGroupChipContextMenuItems: { type: Function },
|
|
303
|
+
createTabGroupChipComponent: { type: Function },
|
|
304
|
+
tabGroupColors: {},
|
|
305
|
+
tabGroupAccent: {},
|
|
239
306
|
watermarkComponent: {},
|
|
240
307
|
defaultTabComponent: {},
|
|
241
308
|
rightHeaderActionsComponent: {},
|
|
242
309
|
leftHeaderActionsComponent: {},
|
|
243
|
-
prefixHeaderActionsComponent: {}
|
|
310
|
+
prefixHeaderActionsComponent: {},
|
|
311
|
+
tabGroupChipComponent: {}
|
|
244
312
|
},
|
|
245
313
|
emits: ["ready"],
|
|
246
314
|
setup(__props, { emit: __emit }) {
|
|
@@ -265,11 +333,108 @@ var __publicField = (obj, key, value) => {
|
|
|
265
333
|
}
|
|
266
334
|
);
|
|
267
335
|
});
|
|
336
|
+
const inst = vue.getCurrentInstance();
|
|
337
|
+
vue.watch(
|
|
338
|
+
() => props.tabGroupChipComponent,
|
|
339
|
+
(newValue) => {
|
|
340
|
+
if (instance.value) {
|
|
341
|
+
instance.value.updateOptions({
|
|
342
|
+
createTabGroupChipComponent: newValue ? () => {
|
|
343
|
+
const component = findComponent(inst, newValue);
|
|
344
|
+
return new VueTabGroupChipRenderer(component, inst);
|
|
345
|
+
} : void 0
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
vue.watch(
|
|
351
|
+
() => props.defaultTabComponent,
|
|
352
|
+
(newValue) => {
|
|
353
|
+
if (instance.value) {
|
|
354
|
+
instance.value.updateOptions({
|
|
355
|
+
defaultTabComponent: newValue,
|
|
356
|
+
createTabComponent(options) {
|
|
357
|
+
let component = findComponent(inst, options.name);
|
|
358
|
+
if (!component && newValue) {
|
|
359
|
+
component = findComponent(inst, newValue);
|
|
360
|
+
}
|
|
361
|
+
if (component) {
|
|
362
|
+
return new VueRenderer(component, inst);
|
|
363
|
+
}
|
|
364
|
+
return void 0;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
vue.watch(
|
|
371
|
+
() => props.watermarkComponent,
|
|
372
|
+
(newValue) => {
|
|
373
|
+
if (instance.value) {
|
|
374
|
+
instance.value.updateOptions({
|
|
375
|
+
createWatermarkComponent: newValue ? () => {
|
|
376
|
+
const component = findComponent(inst, newValue);
|
|
377
|
+
return new VueWatermarkRenderer(component, inst);
|
|
378
|
+
} : void 0
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
vue.watch(
|
|
384
|
+
() => props.rightHeaderActionsComponent,
|
|
385
|
+
(newValue) => {
|
|
386
|
+
if (instance.value) {
|
|
387
|
+
instance.value.updateOptions({
|
|
388
|
+
createRightHeaderActionComponent: newValue ? (group) => {
|
|
389
|
+
const component = findComponent(inst, newValue);
|
|
390
|
+
return new VueHeaderActionsRenderer(
|
|
391
|
+
component,
|
|
392
|
+
inst,
|
|
393
|
+
group
|
|
394
|
+
);
|
|
395
|
+
} : void 0
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
);
|
|
400
|
+
vue.watch(
|
|
401
|
+
() => props.leftHeaderActionsComponent,
|
|
402
|
+
(newValue) => {
|
|
403
|
+
if (instance.value) {
|
|
404
|
+
instance.value.updateOptions({
|
|
405
|
+
createLeftHeaderActionComponent: newValue ? (group) => {
|
|
406
|
+
const component = findComponent(inst, newValue);
|
|
407
|
+
return new VueHeaderActionsRenderer(
|
|
408
|
+
component,
|
|
409
|
+
inst,
|
|
410
|
+
group
|
|
411
|
+
);
|
|
412
|
+
} : void 0
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
vue.watch(
|
|
418
|
+
() => props.prefixHeaderActionsComponent,
|
|
419
|
+
(newValue) => {
|
|
420
|
+
if (instance.value) {
|
|
421
|
+
instance.value.updateOptions({
|
|
422
|
+
createPrefixHeaderActionComponent: newValue ? (group) => {
|
|
423
|
+
const component = findComponent(inst, newValue);
|
|
424
|
+
return new VueHeaderActionsRenderer(
|
|
425
|
+
component,
|
|
426
|
+
inst,
|
|
427
|
+
group
|
|
428
|
+
);
|
|
429
|
+
} : void 0
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
);
|
|
268
434
|
vue.onMounted(() => {
|
|
269
435
|
if (!el.value) {
|
|
270
436
|
throw new Error("dockview-vue: element is not mounted");
|
|
271
437
|
}
|
|
272
|
-
const inst = vue.getCurrentInstance();
|
|
273
438
|
if (!inst) {
|
|
274
439
|
throw new Error("dockview-vue: getCurrentInstance() returned null");
|
|
275
440
|
}
|
|
@@ -315,10 +480,28 @@ var __publicField = (obj, key, value) => {
|
|
|
315
480
|
props.rightHeaderActionsComponent
|
|
316
481
|
);
|
|
317
482
|
return new VueHeaderActionsRenderer(component, inst, group);
|
|
318
|
-
} : void 0
|
|
483
|
+
} : void 0,
|
|
484
|
+
createContextMenuItemComponent: (options) => {
|
|
485
|
+
if (!options.component) {
|
|
486
|
+
return void 0;
|
|
487
|
+
}
|
|
488
|
+
const component = findComponent(inst, options.component);
|
|
489
|
+
return new VueContextMenuItemRenderer(component, inst);
|
|
490
|
+
}
|
|
319
491
|
};
|
|
492
|
+
const coreOptions = extractCoreOptions(props);
|
|
493
|
+
if (props.defaultTabComponent) {
|
|
494
|
+
frameworkOptions.defaultTabComponent = props.defaultTabComponent;
|
|
495
|
+
}
|
|
496
|
+
if (props.tabGroupChipComponent) {
|
|
497
|
+
const chipComponentName = props.tabGroupChipComponent;
|
|
498
|
+
coreOptions.createTabGroupChipComponent = () => {
|
|
499
|
+
const component = findComponent(inst, chipComponentName);
|
|
500
|
+
return new VueTabGroupChipRenderer(component, inst);
|
|
501
|
+
};
|
|
502
|
+
}
|
|
320
503
|
const api = dockviewCore.createDockview(el.value, {
|
|
321
|
-
...
|
|
504
|
+
...coreOptions,
|
|
322
505
|
...frameworkOptions
|
|
323
506
|
});
|
|
324
507
|
const { clientWidth, clientHeight } = el.value;
|
|
@@ -616,18 +799,19 @@ var __publicField = (obj, key, value) => {
|
|
|
616
799
|
exports2.GridviewVue = _sfc_main$1;
|
|
617
800
|
exports2.PaneviewVue = _sfc_main;
|
|
618
801
|
exports2.SplitviewVue = _sfc_main$2;
|
|
802
|
+
exports2.VueContextMenuItemRenderer = VueContextMenuItemRenderer;
|
|
619
803
|
exports2.VueHeaderActionsRenderer = VueHeaderActionsRenderer;
|
|
620
804
|
exports2.VuePart = VuePart;
|
|
621
805
|
exports2.VueRenderer = VueRenderer;
|
|
806
|
+
exports2.VueTabGroupChipRenderer = VueTabGroupChipRenderer;
|
|
622
807
|
exports2.VueWatermarkRenderer = VueWatermarkRenderer;
|
|
623
808
|
exports2.findComponent = findComponent;
|
|
624
809
|
exports2.mountVueComponent = mountVueComponent;
|
|
625
810
|
Object.keys(dockviewCore).forEach((k) => {
|
|
626
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k))
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
});
|
|
811
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k)) Object.defineProperty(exports2, k, {
|
|
812
|
+
enumerable: true,
|
|
813
|
+
get: () => dockviewCore[k]
|
|
814
|
+
});
|
|
631
815
|
});
|
|
632
816
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
633
817
|
});
|