dockview-react 7.0.4 → 8.1.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/LICENCE.md +21 -0
- package/README.md +21 -16
- package/dist/cjs/dockview/reactContextMenuItemPart.d.ts +10 -3
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/svg.d.ts +1 -0
- package/dist/dockview-react.js +19294 -21736
- package/dist/dockview-react.min.js +4142 -22
- package/dist/package/main.cjs.js +960 -986
- package/dist/package/main.cjs.min.js +6 -6
- package/dist/package/main.esm.min.mjs +6 -6
- package/dist/package/main.esm.mjs +926 -977
- package/dist/styles/dockview.css +3098 -2400
- package/package.json +91 -85
- package/dist/cjs/dockview/defaultTab.js +0 -99
- package/dist/cjs/dockview/dockview.js +0 -285
- package/dist/cjs/dockview/headerActionsRenderer.js +0 -86
- package/dist/cjs/dockview/reactContentPart.js +0 -52
- package/dist/cjs/dockview/reactContextMenuItemPart.js +0 -31
- package/dist/cjs/dockview/reactGroupDragGhostPart.js +0 -32
- package/dist/cjs/dockview/reactHeaderPart.js +0 -46
- package/dist/cjs/dockview/reactTabGroupChipPart.js +0 -36
- package/dist/cjs/dockview/reactWatermarkPart.js +0 -47
- package/dist/cjs/gridview/gridview.js +0 -105
- package/dist/cjs/gridview/view.js +0 -41
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/paneview/paneview.js +0 -137
- package/dist/cjs/paneview/view.js +0 -44
- package/dist/cjs/react.js +0 -183
- package/dist/cjs/splitview/splitview.js +0 -105
- package/dist/cjs/splitview/view.js +0 -39
- package/dist/cjs/svg.js +0 -15
- package/dist/cjs/types.js +0 -2
- package/dist/dockview-react.min.js.map +0 -1
- package/dist/esm/dockview/defaultTab.d.ts +0 -7
- package/dist/esm/dockview/defaultTab.js +0 -65
- package/dist/esm/dockview/dockview.d.ts +0 -33
- package/dist/esm/dockview/dockview.js +0 -252
- package/dist/esm/dockview/headerActionsRenderer.d.ts +0 -24
- package/dist/esm/dockview/headerActionsRenderer.js +0 -72
- package/dist/esm/dockview/reactContentPart.d.ts +0 -21
- package/dist/esm/dockview/reactContentPart.js +0 -43
- package/dist/esm/dockview/reactContextMenuItemPart.d.ts +0 -14
- package/dist/esm/dockview/reactContextMenuItemPart.js +0 -22
- package/dist/esm/dockview/reactGroupDragGhostPart.d.ts +0 -20
- package/dist/esm/dockview/reactGroupDragGhostPart.js +0 -23
- package/dist/esm/dockview/reactHeaderPart.d.ts +0 -17
- package/dist/esm/dockview/reactHeaderPart.js +0 -37
- package/dist/esm/dockview/reactTabGroupChipPart.d.ts +0 -23
- package/dist/esm/dockview/reactTabGroupChipPart.js +0 -27
- package/dist/esm/dockview/reactWatermarkPart.d.ts +0 -18
- package/dist/esm/dockview/reactWatermarkPart.js +0 -38
- package/dist/esm/gridview/gridview.d.ts +0 -17
- package/dist/esm/gridview/gridview.js +0 -72
- package/dist/esm/gridview/view.d.ts +0 -9
- package/dist/esm/gridview/view.js +0 -19
- package/dist/esm/index.d.ts +0 -10
- package/dist/esm/index.js +0 -8
- package/dist/esm/paneview/paneview.d.ts +0 -20
- package/dist/esm/paneview/paneview.js +0 -104
- package/dist/esm/paneview/view.d.ts +0 -19
- package/dist/esm/paneview/view.js +0 -35
- package/dist/esm/react.d.ts +0 -35
- package/dist/esm/react.js +0 -134
- package/dist/esm/splitview/splitview.d.ts +0 -17
- package/dist/esm/splitview/splitview.js +0 -72
- package/dist/esm/splitview/view.d.ts +0 -9
- package/dist/esm/splitview/view.js +0 -17
- package/dist/esm/svg.d.ts +0 -3
- package/dist/esm/svg.js +0 -7
- package/dist/esm/types.d.ts +0 -4
- package/dist/esm/types.js +0 -1
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactPanelContentPart = void 0;
|
|
4
|
-
var react_1 = require("../react");
|
|
5
|
-
var dockview_1 = require("dockview");
|
|
6
|
-
var ReactPanelContentPart = /** @class */ (function () {
|
|
7
|
-
function ReactPanelContentPart(id, component, reactPortalStore) {
|
|
8
|
-
this.id = id;
|
|
9
|
-
this.component = component;
|
|
10
|
-
this.reactPortalStore = reactPortalStore;
|
|
11
|
-
this._onDidFocus = new dockview_1.DockviewEmitter();
|
|
12
|
-
this.onDidFocus = this._onDidFocus.event;
|
|
13
|
-
this._onDidBlur = new dockview_1.DockviewEmitter();
|
|
14
|
-
this.onDidBlur = this._onDidBlur.event;
|
|
15
|
-
this._element = document.createElement('div');
|
|
16
|
-
this._element.className = 'dv-react-part';
|
|
17
|
-
this._element.style.height = '100%';
|
|
18
|
-
this._element.style.width = '100%';
|
|
19
|
-
}
|
|
20
|
-
Object.defineProperty(ReactPanelContentPart.prototype, "element", {
|
|
21
|
-
get: function () {
|
|
22
|
-
return this._element;
|
|
23
|
-
},
|
|
24
|
-
enumerable: false,
|
|
25
|
-
configurable: true
|
|
26
|
-
});
|
|
27
|
-
ReactPanelContentPart.prototype.focus = function () {
|
|
28
|
-
// TODO
|
|
29
|
-
};
|
|
30
|
-
ReactPanelContentPart.prototype.init = function (parameters) {
|
|
31
|
-
this.part = new react_1.ReactPart(this.element, this.reactPortalStore, this.component, {
|
|
32
|
-
params: parameters.params,
|
|
33
|
-
api: parameters.api,
|
|
34
|
-
containerApi: parameters.containerApi,
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
ReactPanelContentPart.prototype.update = function (event) {
|
|
38
|
-
var _a;
|
|
39
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ params: event.params });
|
|
40
|
-
};
|
|
41
|
-
ReactPanelContentPart.prototype.layout = function (_width, _height) {
|
|
42
|
-
// noop
|
|
43
|
-
};
|
|
44
|
-
ReactPanelContentPart.prototype.dispose = function () {
|
|
45
|
-
var _a;
|
|
46
|
-
this._onDidFocus.dispose();
|
|
47
|
-
this._onDidBlur.dispose();
|
|
48
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
49
|
-
};
|
|
50
|
-
return ReactPanelContentPart;
|
|
51
|
-
}());
|
|
52
|
-
exports.ReactPanelContentPart = ReactPanelContentPart;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactContextMenuItemPart = void 0;
|
|
4
|
-
var react_1 = require("../react");
|
|
5
|
-
var ReactContextMenuItemPart = /** @class */ (function () {
|
|
6
|
-
function ReactContextMenuItemPart(id, component, reactPortalStore) {
|
|
7
|
-
this.id = id;
|
|
8
|
-
this.component = component;
|
|
9
|
-
this.reactPortalStore = reactPortalStore;
|
|
10
|
-
this._element = document.createElement('div');
|
|
11
|
-
this._element.className = 'dv-react-part';
|
|
12
|
-
this._element.style.height = '100%';
|
|
13
|
-
this._element.style.width = '100%';
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(ReactContextMenuItemPart.prototype, "element", {
|
|
16
|
-
get: function () {
|
|
17
|
-
return this._element;
|
|
18
|
-
},
|
|
19
|
-
enumerable: false,
|
|
20
|
-
configurable: true
|
|
21
|
-
});
|
|
22
|
-
ReactContextMenuItemPart.prototype.init = function (props) {
|
|
23
|
-
this.part = new react_1.ReactPart(this._element, this.reactPortalStore, this.component, props);
|
|
24
|
-
};
|
|
25
|
-
ReactContextMenuItemPart.prototype.dispose = function () {
|
|
26
|
-
var _a;
|
|
27
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
28
|
-
};
|
|
29
|
-
return ReactContextMenuItemPart;
|
|
30
|
-
}());
|
|
31
|
-
exports.ReactContextMenuItemPart = ReactContextMenuItemPart;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactGroupDragGhostPart = void 0;
|
|
4
|
-
var react_1 = require("../react");
|
|
5
|
-
var ReactGroupDragGhostPart = /** @class */ (function () {
|
|
6
|
-
function ReactGroupDragGhostPart(component, reactPortalStore) {
|
|
7
|
-
this.component = component;
|
|
8
|
-
this.reactPortalStore = reactPortalStore;
|
|
9
|
-
this._element = document.createElement('div');
|
|
10
|
-
this._element.className = 'dv-react-part';
|
|
11
|
-
this._element.style.display = 'inline-flex';
|
|
12
|
-
}
|
|
13
|
-
Object.defineProperty(ReactGroupDragGhostPart.prototype, "element", {
|
|
14
|
-
get: function () {
|
|
15
|
-
return this._element;
|
|
16
|
-
},
|
|
17
|
-
enumerable: false,
|
|
18
|
-
configurable: true
|
|
19
|
-
});
|
|
20
|
-
ReactGroupDragGhostPart.prototype.init = function (params) {
|
|
21
|
-
this.part = new react_1.ReactPart(this._element, this.reactPortalStore, this.component, {
|
|
22
|
-
group: params.group,
|
|
23
|
-
api: params.api,
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
ReactGroupDragGhostPart.prototype.dispose = function () {
|
|
27
|
-
var _a;
|
|
28
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
29
|
-
};
|
|
30
|
-
return ReactGroupDragGhostPart;
|
|
31
|
-
}());
|
|
32
|
-
exports.ReactGroupDragGhostPart = ReactGroupDragGhostPart;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactPanelHeaderPart = void 0;
|
|
4
|
-
var react_1 = require("../react");
|
|
5
|
-
var ReactPanelHeaderPart = /** @class */ (function () {
|
|
6
|
-
function ReactPanelHeaderPart(id, component, reactPortalStore) {
|
|
7
|
-
this.id = id;
|
|
8
|
-
this.component = component;
|
|
9
|
-
this.reactPortalStore = reactPortalStore;
|
|
10
|
-
this._element = document.createElement('div');
|
|
11
|
-
this._element.className = 'dv-react-part';
|
|
12
|
-
this._element.style.height = '100%';
|
|
13
|
-
this._element.style.width = '100%';
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(ReactPanelHeaderPart.prototype, "element", {
|
|
16
|
-
get: function () {
|
|
17
|
-
return this._element;
|
|
18
|
-
},
|
|
19
|
-
enumerable: false,
|
|
20
|
-
configurable: true
|
|
21
|
-
});
|
|
22
|
-
ReactPanelHeaderPart.prototype.focus = function () {
|
|
23
|
-
//noop
|
|
24
|
-
};
|
|
25
|
-
ReactPanelHeaderPart.prototype.init = function (parameters) {
|
|
26
|
-
this.part = new react_1.ReactPart(this.element, this.reactPortalStore, this.component, {
|
|
27
|
-
params: parameters.params,
|
|
28
|
-
api: parameters.api,
|
|
29
|
-
containerApi: parameters.containerApi,
|
|
30
|
-
tabLocation: parameters.tabLocation,
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
ReactPanelHeaderPart.prototype.update = function (event) {
|
|
34
|
-
var _a;
|
|
35
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ params: event.params });
|
|
36
|
-
};
|
|
37
|
-
ReactPanelHeaderPart.prototype.layout = function (_width, _height) {
|
|
38
|
-
// noop - retrieval from api
|
|
39
|
-
};
|
|
40
|
-
ReactPanelHeaderPart.prototype.dispose = function () {
|
|
41
|
-
var _a;
|
|
42
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
43
|
-
};
|
|
44
|
-
return ReactPanelHeaderPart;
|
|
45
|
-
}());
|
|
46
|
-
exports.ReactPanelHeaderPart = ReactPanelHeaderPart;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactTabGroupChipPart = void 0;
|
|
4
|
-
var react_1 = require("../react");
|
|
5
|
-
var ReactTabGroupChipPart = /** @class */ (function () {
|
|
6
|
-
function ReactTabGroupChipPart(component, reactPortalStore) {
|
|
7
|
-
this.component = component;
|
|
8
|
-
this.reactPortalStore = reactPortalStore;
|
|
9
|
-
this._element = document.createElement('div');
|
|
10
|
-
this._element.className = 'dv-react-part';
|
|
11
|
-
this._element.style.display = 'inline-flex';
|
|
12
|
-
}
|
|
13
|
-
Object.defineProperty(ReactTabGroupChipPart.prototype, "element", {
|
|
14
|
-
get: function () {
|
|
15
|
-
return this._element;
|
|
16
|
-
},
|
|
17
|
-
enumerable: false,
|
|
18
|
-
configurable: true
|
|
19
|
-
});
|
|
20
|
-
ReactTabGroupChipPart.prototype.init = function (params) {
|
|
21
|
-
this.part = new react_1.ReactPart(this._element, this.reactPortalStore, this.component, {
|
|
22
|
-
tabGroup: params.tabGroup,
|
|
23
|
-
api: params.api,
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
ReactTabGroupChipPart.prototype.update = function (params) {
|
|
27
|
-
var _a;
|
|
28
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ tabGroup: params.tabGroup });
|
|
29
|
-
};
|
|
30
|
-
ReactTabGroupChipPart.prototype.dispose = function () {
|
|
31
|
-
var _a;
|
|
32
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
33
|
-
};
|
|
34
|
-
return ReactTabGroupChipPart;
|
|
35
|
-
}());
|
|
36
|
-
exports.ReactTabGroupChipPart = ReactTabGroupChipPart;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactWatermarkPart = void 0;
|
|
4
|
-
var react_1 = require("../react");
|
|
5
|
-
var ReactWatermarkPart = /** @class */ (function () {
|
|
6
|
-
function ReactWatermarkPart(id, component, reactPortalStore) {
|
|
7
|
-
this.id = id;
|
|
8
|
-
this.component = component;
|
|
9
|
-
this.reactPortalStore = reactPortalStore;
|
|
10
|
-
this._element = document.createElement('div');
|
|
11
|
-
this._element.className = 'dv-react-part';
|
|
12
|
-
this._element.style.height = '100%';
|
|
13
|
-
this._element.style.width = '100%';
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(ReactWatermarkPart.prototype, "element", {
|
|
16
|
-
get: function () {
|
|
17
|
-
return this._element;
|
|
18
|
-
},
|
|
19
|
-
enumerable: false,
|
|
20
|
-
configurable: true
|
|
21
|
-
});
|
|
22
|
-
ReactWatermarkPart.prototype.init = function (parameters) {
|
|
23
|
-
this.part = new react_1.ReactPart(this.element, this.reactPortalStore, this.component, {
|
|
24
|
-
group: parameters.group,
|
|
25
|
-
containerApi: parameters.containerApi,
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
ReactWatermarkPart.prototype.focus = function () {
|
|
29
|
-
// noop
|
|
30
|
-
};
|
|
31
|
-
ReactWatermarkPart.prototype.update = function (params) {
|
|
32
|
-
var _a, _b, _c;
|
|
33
|
-
if (this.parameters) {
|
|
34
|
-
this.parameters.params = params.params;
|
|
35
|
-
}
|
|
36
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ params: (_c = (_b = this.parameters) === null || _b === void 0 ? void 0 : _b.params) !== null && _c !== void 0 ? _c : {} });
|
|
37
|
-
};
|
|
38
|
-
ReactWatermarkPart.prototype.layout = function (_width, _height) {
|
|
39
|
-
// noop - retrieval from api
|
|
40
|
-
};
|
|
41
|
-
ReactWatermarkPart.prototype.dispose = function () {
|
|
42
|
-
var _a;
|
|
43
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
44
|
-
};
|
|
45
|
-
return ReactWatermarkPart;
|
|
46
|
-
}());
|
|
47
|
-
exports.ReactWatermarkPart = ReactWatermarkPart;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
-
if (!m) return o;
|
|
16
|
-
var i = m.call(o), r, ar = [], e;
|
|
17
|
-
try {
|
|
18
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
-
}
|
|
20
|
-
catch (error) { e = { error: error }; }
|
|
21
|
-
finally {
|
|
22
|
-
try {
|
|
23
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
-
}
|
|
25
|
-
finally { if (e) throw e.error; }
|
|
26
|
-
}
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.GridviewReact = void 0;
|
|
34
|
-
var react_1 = __importDefault(require("react"));
|
|
35
|
-
var dockview_1 = require("dockview");
|
|
36
|
-
var view_1 = require("./view");
|
|
37
|
-
var react_2 = require("../react");
|
|
38
|
-
function extractCoreOptions(props) {
|
|
39
|
-
var coreOptions = dockview_1.PROPERTY_KEYS_GRIDVIEW.reduce(function (obj, key) {
|
|
40
|
-
if (key in props) {
|
|
41
|
-
obj[key] = props[key];
|
|
42
|
-
}
|
|
43
|
-
return obj;
|
|
44
|
-
}, {});
|
|
45
|
-
return coreOptions;
|
|
46
|
-
}
|
|
47
|
-
exports.GridviewReact = react_1.default.forwardRef(function (props, ref) {
|
|
48
|
-
var domRef = react_1.default.useRef(null);
|
|
49
|
-
var gridviewRef = react_1.default.useRef(undefined);
|
|
50
|
-
var _a = __read((0, react_2.usePortalsLifecycle)(), 2), portals = _a[0], addPortal = _a[1];
|
|
51
|
-
react_1.default.useImperativeHandle(ref, function () { return domRef.current; }, []);
|
|
52
|
-
var prevProps = react_1.default.useRef({});
|
|
53
|
-
react_1.default.useEffect(function () {
|
|
54
|
-
var changes = {};
|
|
55
|
-
dockview_1.PROPERTY_KEYS_GRIDVIEW.forEach(function (propKey) {
|
|
56
|
-
var key = propKey;
|
|
57
|
-
var propValue = props[key];
|
|
58
|
-
if (key in props && propValue !== prevProps.current[key]) {
|
|
59
|
-
changes[key] = propValue;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
if (gridviewRef.current) {
|
|
63
|
-
gridviewRef.current.updateOptions(changes);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
// not yet fully initialized
|
|
67
|
-
}
|
|
68
|
-
prevProps.current = props;
|
|
69
|
-
}, dockview_1.PROPERTY_KEYS_GRIDVIEW.map(function (key) { return props[key]; }));
|
|
70
|
-
react_1.default.useEffect(function () {
|
|
71
|
-
if (!domRef.current) {
|
|
72
|
-
return function () {
|
|
73
|
-
// noop
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
var frameworkOptions = {
|
|
77
|
-
createComponent: function (options) {
|
|
78
|
-
return new view_1.ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal: addPortal });
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
var api = (0, dockview_1.createGridview)(domRef.current, __assign(__assign({}, extractCoreOptions(props)), frameworkOptions));
|
|
82
|
-
var _a = domRef.current, clientWidth = _a.clientWidth, clientHeight = _a.clientHeight;
|
|
83
|
-
api.layout(clientWidth, clientHeight);
|
|
84
|
-
if (props.onReady) {
|
|
85
|
-
props.onReady({ api: api });
|
|
86
|
-
}
|
|
87
|
-
gridviewRef.current = api;
|
|
88
|
-
return function () {
|
|
89
|
-
gridviewRef.current = undefined;
|
|
90
|
-
api.dispose();
|
|
91
|
-
};
|
|
92
|
-
}, []);
|
|
93
|
-
react_1.default.useEffect(function () {
|
|
94
|
-
if (!gridviewRef.current) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
gridviewRef.current.updateOptions({
|
|
98
|
-
createComponent: function (options) {
|
|
99
|
-
return new view_1.ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal: addPortal });
|
|
100
|
-
},
|
|
101
|
-
});
|
|
102
|
-
}, [props.components]);
|
|
103
|
-
return (react_1.default.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
104
|
-
});
|
|
105
|
-
exports.GridviewReact.displayName = 'GridviewComponent';
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ReactGridPanelView = void 0;
|
|
19
|
-
var dockview_1 = require("dockview");
|
|
20
|
-
var react_1 = require("../react");
|
|
21
|
-
var ReactGridPanelView = /** @class */ (function (_super) {
|
|
22
|
-
__extends(ReactGridPanelView, _super);
|
|
23
|
-
function ReactGridPanelView(id, component, reactComponent, reactPortalStore) {
|
|
24
|
-
var _this = _super.call(this, id, component) || this;
|
|
25
|
-
_this.reactComponent = reactComponent;
|
|
26
|
-
_this.reactPortalStore = reactPortalStore;
|
|
27
|
-
return _this;
|
|
28
|
-
}
|
|
29
|
-
ReactGridPanelView.prototype.getComponent = function () {
|
|
30
|
-
var _a, _b;
|
|
31
|
-
return new react_1.ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
32
|
-
params: (_b = (_a = this._params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {},
|
|
33
|
-
api: this.api,
|
|
34
|
-
// TODO: fix casting hack
|
|
35
|
-
containerApi: new dockview_1.GridviewApi(this._params
|
|
36
|
-
.accessor),
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
return ReactGridPanelView;
|
|
40
|
-
}(dockview_1.GridviewPanel));
|
|
41
|
-
exports.ReactGridPanelView = ReactGridPanelView;
|
package/dist/cjs/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("dockview"), exports);
|
|
18
|
-
__exportStar(require("./dockview/dockview"), exports);
|
|
19
|
-
__exportStar(require("./dockview/defaultTab"), exports);
|
|
20
|
-
__exportStar(require("./splitview/splitview"), exports);
|
|
21
|
-
__exportStar(require("./gridview/gridview"), exports);
|
|
22
|
-
__exportStar(require("./paneview/paneview"), exports);
|
|
23
|
-
__exportStar(require("./types"), exports);
|
|
24
|
-
__exportStar(require("./react"), exports);
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
-
if (!m) return o;
|
|
16
|
-
var i = m.call(o), r, ar = [], e;
|
|
17
|
-
try {
|
|
18
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
-
}
|
|
20
|
-
catch (error) { e = { error: error }; }
|
|
21
|
-
finally {
|
|
22
|
-
try {
|
|
23
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
-
}
|
|
25
|
-
finally { if (e) throw e.error; }
|
|
26
|
-
}
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.PaneviewReact = void 0;
|
|
34
|
-
var react_1 = __importDefault(require("react"));
|
|
35
|
-
var dockview_1 = require("dockview");
|
|
36
|
-
var react_2 = require("../react");
|
|
37
|
-
var view_1 = require("./view");
|
|
38
|
-
function extractCoreOptions(props) {
|
|
39
|
-
var coreOptions = dockview_1.PROPERTY_KEYS_PANEVIEW.reduce(function (obj, key) {
|
|
40
|
-
if (key in props) {
|
|
41
|
-
obj[key] = props[key];
|
|
42
|
-
}
|
|
43
|
-
return obj;
|
|
44
|
-
}, {});
|
|
45
|
-
return coreOptions;
|
|
46
|
-
}
|
|
47
|
-
exports.PaneviewReact = react_1.default.forwardRef(function (props, ref) {
|
|
48
|
-
var domRef = react_1.default.useRef(null);
|
|
49
|
-
var paneviewRef = react_1.default.useRef(undefined);
|
|
50
|
-
var _a = __read((0, react_2.usePortalsLifecycle)(), 2), portals = _a[0], addPortal = _a[1];
|
|
51
|
-
react_1.default.useImperativeHandle(ref, function () { return domRef.current; }, []);
|
|
52
|
-
var prevProps = react_1.default.useRef({});
|
|
53
|
-
react_1.default.useEffect(function () {
|
|
54
|
-
var changes = {};
|
|
55
|
-
dockview_1.PROPERTY_KEYS_PANEVIEW.forEach(function (propKey) {
|
|
56
|
-
var key = propKey;
|
|
57
|
-
var propValue = props[key];
|
|
58
|
-
if (key in props && propValue !== prevProps.current[key]) {
|
|
59
|
-
changes[key] = propValue;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
if (paneviewRef.current) {
|
|
63
|
-
paneviewRef.current.updateOptions(changes);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
// not yet fully initialized
|
|
67
|
-
}
|
|
68
|
-
prevProps.current = props;
|
|
69
|
-
}, dockview_1.PROPERTY_KEYS_PANEVIEW.map(function (key) { return props[key]; }));
|
|
70
|
-
react_1.default.useEffect(function () {
|
|
71
|
-
var _a;
|
|
72
|
-
if (!domRef.current) {
|
|
73
|
-
return function () {
|
|
74
|
-
// noop
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
var headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
|
|
78
|
-
var frameworkOptions = {
|
|
79
|
-
createComponent: function (options) {
|
|
80
|
-
return new view_1.PanePanelSection(options.id, props.components[options.name], { addPortal: addPortal });
|
|
81
|
-
},
|
|
82
|
-
createHeaderComponent: function (options) {
|
|
83
|
-
return new view_1.PanePanelSection(options.id, headerComponents[options.name], { addPortal: addPortal });
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
var api = (0, dockview_1.createPaneview)(domRef.current, __assign(__assign({}, extractCoreOptions(props)), frameworkOptions));
|
|
87
|
-
var _b = domRef.current, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;
|
|
88
|
-
api.layout(clientWidth, clientHeight);
|
|
89
|
-
if (props.onReady) {
|
|
90
|
-
props.onReady({ api: api });
|
|
91
|
-
}
|
|
92
|
-
paneviewRef.current = api;
|
|
93
|
-
return function () {
|
|
94
|
-
paneviewRef.current = undefined;
|
|
95
|
-
api.dispose();
|
|
96
|
-
};
|
|
97
|
-
}, []);
|
|
98
|
-
react_1.default.useEffect(function () {
|
|
99
|
-
if (!paneviewRef.current) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
paneviewRef.current.updateOptions({
|
|
103
|
-
createComponent: function (options) {
|
|
104
|
-
return new view_1.PanePanelSection(options.id, props.components[options.name], { addPortal: addPortal });
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
}, [props.components]);
|
|
108
|
-
react_1.default.useEffect(function () {
|
|
109
|
-
var _a;
|
|
110
|
-
if (!paneviewRef.current) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
var headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
|
|
114
|
-
paneviewRef.current.updateOptions({
|
|
115
|
-
createHeaderComponent: function (options) {
|
|
116
|
-
return new view_1.PanePanelSection(options.id, headerComponents[options.name], { addPortal: addPortal });
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
}, [props.headerComponents]);
|
|
120
|
-
react_1.default.useEffect(function () {
|
|
121
|
-
if (!paneviewRef.current) {
|
|
122
|
-
return function () {
|
|
123
|
-
// noop
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
var disposable = paneviewRef.current.onDidDrop(function (event) {
|
|
127
|
-
if (props.onDidDrop) {
|
|
128
|
-
props.onDidDrop(event);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
return function () {
|
|
132
|
-
disposable.dispose();
|
|
133
|
-
};
|
|
134
|
-
}, [props.onDidDrop]);
|
|
135
|
-
return (react_1.default.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
136
|
-
});
|
|
137
|
-
exports.PaneviewReact.displayName = 'PaneviewComponent';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PanePanelSection = void 0;
|
|
4
|
-
var react_1 = require("../react");
|
|
5
|
-
var PanePanelSection = /** @class */ (function () {
|
|
6
|
-
function PanePanelSection(id, component, reactPortalStore) {
|
|
7
|
-
this.id = id;
|
|
8
|
-
this.component = component;
|
|
9
|
-
this.reactPortalStore = reactPortalStore;
|
|
10
|
-
this._element = document.createElement('div');
|
|
11
|
-
this._element.style.height = '100%';
|
|
12
|
-
this._element.style.width = '100%';
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(PanePanelSection.prototype, "element", {
|
|
15
|
-
get: function () {
|
|
16
|
-
return this._element;
|
|
17
|
-
},
|
|
18
|
-
enumerable: false,
|
|
19
|
-
configurable: true
|
|
20
|
-
});
|
|
21
|
-
PanePanelSection.prototype.init = function (parameters) {
|
|
22
|
-
this.part = new react_1.ReactPart(this.element, this.reactPortalStore, this.component, {
|
|
23
|
-
params: parameters.params,
|
|
24
|
-
api: parameters.api,
|
|
25
|
-
title: parameters.title,
|
|
26
|
-
containerApi: parameters.containerApi,
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
PanePanelSection.prototype.toJSON = function () {
|
|
30
|
-
return {
|
|
31
|
-
id: this.id,
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
PanePanelSection.prototype.update = function (params) {
|
|
35
|
-
var _a;
|
|
36
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(params.params);
|
|
37
|
-
};
|
|
38
|
-
PanePanelSection.prototype.dispose = function () {
|
|
39
|
-
var _a;
|
|
40
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
41
|
-
};
|
|
42
|
-
return PanePanelSection;
|
|
43
|
-
}());
|
|
44
|
-
exports.PanePanelSection = PanePanelSection;
|