@omegagrid/tabs 0.2.5
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/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +20 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/tabContainer.d.ts +48 -0
- package/dist/components/tabContainer.d.ts.map +1 -0
- package/dist/components/tabContainer.js +219 -0
- package/dist/components/tabContainer.js.map +1 -0
- package/dist/components/tabContainer.style.d.ts +2 -0
- package/dist/components/tabContainer.style.d.ts.map +1 -0
- package/dist/components/tabContainer.style.js +33 -0
- package/dist/components/tabContainer.style.js.map +1 -0
- package/dist/components/tabSplitContainer.d.ts +41 -0
- package/dist/components/tabSplitContainer.d.ts.map +1 -0
- package/dist/components/tabSplitContainer.js +281 -0
- package/dist/components/tabSplitContainer.js.map +1 -0
- package/dist/components/tabs.d.ts +55 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +287 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tabs.style.d.ts +2 -0
- package/dist/components/tabs.style.d.ts.map +1 -0
- package/dist/components/tabs.style.js +152 -0
- package/dist/components/tabs.style.js.map +1 -0
- package/dist/constants.d.ts +44 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/model/index.d.ts +25 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +96 -0
- package/dist/model/index.js.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./tabs"), exports);
|
|
18
|
+
__exportStar(require("./tabContainer"), exports);
|
|
19
|
+
__exportStar(require("./tabSplitContainer"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,iDAA+B;AAC/B,sDAAoC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { TabItem } from '../types';
|
|
3
|
+
import { ComponentFactory, actions, Layout, ComponentId, DirectionalPosition, VerticalPosition } from "@omegagrid/core";
|
|
4
|
+
import { TabEvent, Tabs } from "./tabs";
|
|
5
|
+
export type TabsActionArgs = {
|
|
6
|
+
index: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class TabContainer extends LitElement implements Layout {
|
|
9
|
+
static dropPosition: DirectionalPosition;
|
|
10
|
+
static dragParent: TabContainer;
|
|
11
|
+
static dropTarget: TabContainer;
|
|
12
|
+
static styles: import("lit").CSSResult[];
|
|
13
|
+
inactive: boolean;
|
|
14
|
+
topLevelComponent: HTMLElement;
|
|
15
|
+
items: TabItem[];
|
|
16
|
+
closable: boolean;
|
|
17
|
+
createComponent: ComponentFactory;
|
|
18
|
+
tabs: Tabs;
|
|
19
|
+
actions: actions.Action[];
|
|
20
|
+
addButton: boolean;
|
|
21
|
+
selectedIndex: number;
|
|
22
|
+
tabPosition: VerticalPosition;
|
|
23
|
+
cacheComponents: boolean;
|
|
24
|
+
container: HTMLDivElement;
|
|
25
|
+
overlay: HTMLDivElement;
|
|
26
|
+
readonly components: Map<ComponentId, HTMLElement>;
|
|
27
|
+
private currentComponent;
|
|
28
|
+
get component(): HTMLElement;
|
|
29
|
+
layout(): void;
|
|
30
|
+
updateTabs(): void;
|
|
31
|
+
getComponent(componentId: ComponentId): Promise<HTMLElement>;
|
|
32
|
+
loadComponent(componentId: ComponentId): Promise<void>;
|
|
33
|
+
_onSelect: () => Promise<void>;
|
|
34
|
+
_onRemove: (e: TabEvent) => void;
|
|
35
|
+
open(item: TabItem): void;
|
|
36
|
+
willUpdate(): void;
|
|
37
|
+
firstUpdated(): void;
|
|
38
|
+
positionOverlay(pos: DirectionalPosition): HTMLElement;
|
|
39
|
+
hideOverlay: () => void;
|
|
40
|
+
calculateOverlayPosition(x: number, y: number): DirectionalPosition;
|
|
41
|
+
_onDragover: (e: DragEvent) => void;
|
|
42
|
+
_onDrop: () => void;
|
|
43
|
+
_onDragStart: (_e: DragEvent) => void;
|
|
44
|
+
_onDragStop: () => void;
|
|
45
|
+
_onTabDrop: (e: DragEvent) => void;
|
|
46
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
47
|
+
}
|
|
48
|
+
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aAAa,CAAC,WAAW,EAAE,WAAW;IAa5C,SAAS,sBAAwD;IAEjE,SAAS,MAAO,QAAQ,UAEtB;IAEF,IAAI,CAAC,IAAI,EAAE,OAAO;IAUlB,UAAU;IAOV,YAAY;IAOZ,eAAe,CAAC,GAAG,EAAE,mBAAmB;IAkBxC,WAAW,aAGV;IAED,wBAAwB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAQ7C,WAAW,MAAO,SAAS,UAO1B;IAED,OAAO,aAIN;IAED,YAAY,OAAQ,SAAS,UAE5B;IAED,WAAW,aAEV;IAED,UAAU,MAAO,SAAS,UAGzB;IAED,MAAM,6CAgCJ;CAEF"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var TabContainer_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TabContainer = void 0;
|
|
11
|
+
const lit_1 = require("lit");
|
|
12
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
13
|
+
const tabContainer_style_1 = require("./tabContainer.style");
|
|
14
|
+
const core_1 = require("@omegagrid/core");
|
|
15
|
+
const tabs_1 = require("./tabs");
|
|
16
|
+
let TabContainer = TabContainer_1 = class TabContainer extends lit_1.LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.inactive = false;
|
|
20
|
+
this.closable = false;
|
|
21
|
+
this.addButton = false;
|
|
22
|
+
this.selectedIndex = -1;
|
|
23
|
+
this.tabPosition = 'top';
|
|
24
|
+
this.cacheComponents = false;
|
|
25
|
+
this.components = new Map();
|
|
26
|
+
this._onSelect = () => { var _a; return this.loadComponent((_a = this.tabs.selectedItem) === null || _a === void 0 ? void 0 : _a.id); };
|
|
27
|
+
this._onRemove = (e) => {
|
|
28
|
+
this.components.delete(e.tab.id);
|
|
29
|
+
};
|
|
30
|
+
this.hideOverlay = () => {
|
|
31
|
+
core_1.dom.hideElement(this.overlay);
|
|
32
|
+
this.tabs.hideOverlay();
|
|
33
|
+
};
|
|
34
|
+
this._onDragover = (e) => {
|
|
35
|
+
if (!TabContainer_1.dragParent && !tabs_1.Tabs.dragParent)
|
|
36
|
+
return;
|
|
37
|
+
if (TabContainer_1.dragParent.topLevelComponent != this.topLevelComponent && tabs_1.Tabs.dragParent.topLevelComponent != this.topLevelComponent)
|
|
38
|
+
return;
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
e.dataTransfer.dropEffect = 'move';
|
|
42
|
+
this.positionOverlay(this.calculateOverlayPosition(e.offsetX, e.offsetY));
|
|
43
|
+
};
|
|
44
|
+
this._onDrop = () => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
if (((_a = TabContainer_1.dragParent) === null || _a === void 0 ? void 0 : _a.topLevelComponent) != this.topLevelComponent && ((_b = tabs_1.Tabs.dragParent) === null || _b === void 0 ? void 0 : _b.topLevelComponent) != this.topLevelComponent)
|
|
47
|
+
return;
|
|
48
|
+
TabContainer_1.dropTarget = this;
|
|
49
|
+
this.hideOverlay();
|
|
50
|
+
};
|
|
51
|
+
this._onDragStart = (_e) => {
|
|
52
|
+
TabContainer_1.dragParent = this;
|
|
53
|
+
};
|
|
54
|
+
this._onDragStop = () => {
|
|
55
|
+
TabContainer_1.dragParent = null;
|
|
56
|
+
};
|
|
57
|
+
this._onTabDrop = (e) => {
|
|
58
|
+
TabContainer_1.dragParent = null;
|
|
59
|
+
e.stopPropagation();
|
|
60
|
+
};
|
|
61
|
+
this.render = () => {
|
|
62
|
+
const tabs = (0, lit_1.html) `
|
|
63
|
+
<og-tabs
|
|
64
|
+
class="${this.inactive ? 'inactive' : ''}"
|
|
65
|
+
.topLevelComponent="${this.topLevelComponent}"
|
|
66
|
+
.items="${this.items}"
|
|
67
|
+
.actions="${this.actions}"
|
|
68
|
+
.selectedIndex="${this.selectedIndex}"
|
|
69
|
+
.position="${this.tabPosition}"
|
|
70
|
+
?closable="${this.closable}"
|
|
71
|
+
?addButton="${this.addButton}"
|
|
72
|
+
@tab.select="${this._onSelect}"
|
|
73
|
+
@tab.remove="${this._onRemove}"
|
|
74
|
+
@dragstart="${this._onDragStart}"
|
|
75
|
+
@dragstop="${this._onDragStop}"
|
|
76
|
+
@drop="${this._onTabDrop}">
|
|
77
|
+
</og-tabs>
|
|
78
|
+
`;
|
|
79
|
+
const container = (0, lit_1.html) `
|
|
80
|
+
<div
|
|
81
|
+
id="container"
|
|
82
|
+
@drop="${this._onDrop}"
|
|
83
|
+
@dragover="${this._onDragover}"
|
|
84
|
+
@dragleave="${() => this.hideOverlay()}">
|
|
85
|
+
</div>
|
|
86
|
+
`;
|
|
87
|
+
return (0, lit_1.html) `
|
|
88
|
+
${this.tabPosition == 'top' ? tabs : container}
|
|
89
|
+
${this.tabPosition == 'bottom' ? tabs : container}
|
|
90
|
+
<div id="overlay" style="display: none"></div>
|
|
91
|
+
`;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
get component() { return this.currentComponent; }
|
|
95
|
+
layout() {
|
|
96
|
+
var _a;
|
|
97
|
+
if ((_a = this.currentComponent) === null || _a === void 0 ? void 0 : _a.layout)
|
|
98
|
+
this.currentComponent.layout();
|
|
99
|
+
}
|
|
100
|
+
updateTabs() { this.tabs.requestUpdate(); }
|
|
101
|
+
async getComponent(componentId) {
|
|
102
|
+
if (!this.createComponent)
|
|
103
|
+
return null;
|
|
104
|
+
if (!this.cacheComponents || !this.components.has(componentId)) {
|
|
105
|
+
const component = await this.createComponent(componentId);
|
|
106
|
+
if (!this.cacheComponents)
|
|
107
|
+
return component;
|
|
108
|
+
this.components.set(componentId, component);
|
|
109
|
+
}
|
|
110
|
+
return this.components.get(componentId);
|
|
111
|
+
}
|
|
112
|
+
async loadComponent(componentId) {
|
|
113
|
+
if (componentId != null) {
|
|
114
|
+
this.currentComponent = await this.getComponent(componentId);
|
|
115
|
+
core_1.dom.empty(this.container);
|
|
116
|
+
if (this.currentComponent) {
|
|
117
|
+
core_1.dom.appendElement(this.container, this.currentComponent);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
core_1.dom.empty(this.container);
|
|
122
|
+
this.currentComponent = null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
open(item) {
|
|
126
|
+
const tabIndex = this.tabs.getIndexById(item.id);
|
|
127
|
+
if (tabIndex > -1) {
|
|
128
|
+
this.tabs.selectTab(tabIndex, true);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
this.tabs.addTab(item);
|
|
132
|
+
this.tabs.selectTabById(item.id, true);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
willUpdate() {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
if (!this.topLevelComponent)
|
|
138
|
+
this.topLevelComponent = this;
|
|
139
|
+
this.selectedIndex = ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
140
|
+
? Math.max(0, Math.min((_b = this.selectedIndex) !== null && _b !== void 0 ? _b : -1, this.items.length - 1))
|
|
141
|
+
: -1;
|
|
142
|
+
}
|
|
143
|
+
firstUpdated() {
|
|
144
|
+
if (this.selectedIndex > -1)
|
|
145
|
+
this.open(this.items[this.selectedIndex]);
|
|
146
|
+
// this.addEventListener('dragover', e => {
|
|
147
|
+
// if (TabContainer.dragParent || Tabs.dragParent) e.stopPropagation();
|
|
148
|
+
// });
|
|
149
|
+
}
|
|
150
|
+
positionOverlay(pos) {
|
|
151
|
+
TabContainer_1.dropPosition = pos;
|
|
152
|
+
this.tabs.hideOverlay();
|
|
153
|
+
if (pos == null) {
|
|
154
|
+
this.tabs.positionOverlay(this.tabs.empty);
|
|
155
|
+
return core_1.dom.hideElement(this.overlay);
|
|
156
|
+
}
|
|
157
|
+
core_1.dom.showElement(this.overlay);
|
|
158
|
+
core_1.dom.setPosition(this.overlay, {
|
|
159
|
+
t: (pos == 'bottom' ? this.container.clientHeight / 2 : 0) + this.container.offsetTop,
|
|
160
|
+
l: pos == 'right' ? this.container.clientWidth / 2 : 0,
|
|
161
|
+
b: pos == 'top' ? this.container.clientHeight / 2 : 0,
|
|
162
|
+
r: pos == 'left' ? this.container.clientWidth / 2 : 0,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
calculateOverlayPosition(x, y) {
|
|
166
|
+
const [w, h] = [this.container.clientWidth, this.container.clientHeight];
|
|
167
|
+
const margin = 0.3;
|
|
168
|
+
if (x > w * margin && x < w - (w * margin) && y > h * margin && y < h - (h * margin))
|
|
169
|
+
return null;
|
|
170
|
+
const [q1, q2] = [w / h > x / y, w / h > x / (h - y)];
|
|
171
|
+
return (q1 ? (q2 ? 'left' : 'bottom') : (q2 ? 'top' : 'right'));
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
exports.TabContainer = TabContainer;
|
|
175
|
+
TabContainer.styles = [tabContainer_style_1.style];
|
|
176
|
+
__decorate([
|
|
177
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
178
|
+
], TabContainer.prototype, "inactive", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
(0, decorators_js_1.property)({ type: Object })
|
|
181
|
+
], TabContainer.prototype, "topLevelComponent", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
(0, decorators_js_1.property)({ type: Array })
|
|
184
|
+
], TabContainer.prototype, "items", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
187
|
+
], TabContainer.prototype, "closable", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
(0, decorators_js_1.property)({ type: Object })
|
|
190
|
+
], TabContainer.prototype, "createComponent", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
(0, decorators_js_1.query)('og-tabs')
|
|
193
|
+
], TabContainer.prototype, "tabs", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
(0, decorators_js_1.property)({ type: Array })
|
|
196
|
+
], TabContainer.prototype, "actions", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
199
|
+
], TabContainer.prototype, "addButton", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
(0, decorators_js_1.property)({ type: Number, reflect: true })
|
|
202
|
+
], TabContainer.prototype, "selectedIndex", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
(0, decorators_js_1.property)({ type: String, reflect: true })
|
|
205
|
+
], TabContainer.prototype, "tabPosition", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
208
|
+
], TabContainer.prototype, "cacheComponents", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
(0, decorators_js_1.query)('#container')
|
|
211
|
+
], TabContainer.prototype, "container", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, decorators_js_1.query)('#overlay')
|
|
214
|
+
], TabContainer.prototype, "overlay", void 0);
|
|
215
|
+
exports.TabContainer = TabContainer = TabContainer_1 = __decorate([
|
|
216
|
+
(0, decorators_js_1.customElement)('og-tabcontainer'),
|
|
217
|
+
(0, core_1.stylable)({ vars: ['background-*', 'tab-*'] })
|
|
218
|
+
], TabContainer);
|
|
219
|
+
//# sourceMappingURL=tabContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabContainer.js","sourceRoot":"","sources":["../../src/components/tabContainer.ts"],"names":[],"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ACT;AAGjB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;qDACS;AAGlC;IADC,IAAA,qBAAK,EAAC,SAAS,CAAC;0CACN;AAGX;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;6CACE;AAG1B;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+CACR;AAGlB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;mDACrB;AAGnB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;iDACF;AAGtC;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;qDACF;AAGxB;IADC,IAAA,qBAAK,EAAC,YAAY,CAAC;+CACM;AAG1B;IADC,IAAA,qBAAK,EAAC,UAAU,CAAC;6CACM;uBA7CZ,YAAY;IAFxB,IAAA,6BAAa,EAAC,iBAAiB,CAAC;IAChC,IAAA,eAAQ,EAAC,EAAC,IAAI,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,EAAC,CAAC;GAC/B,YAAY,CA4MxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabContainer.style.d.ts","sourceRoot":"","sources":["../../src/components/tabContainer.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBA2BjB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.style = void 0;
|
|
4
|
+
const lit_1 = require("lit");
|
|
5
|
+
exports.style = (0, lit_1.css) `
|
|
6
|
+
* {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
og-tabs {
|
|
17
|
+
flex: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#container {
|
|
21
|
+
flex: 1;
|
|
22
|
+
position: relative;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
background: var(--background-color-2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#overlay {
|
|
28
|
+
background-color: var(--accent-color);
|
|
29
|
+
opacity: 0.5;
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
//# sourceMappingURL=tabContainer.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabContainer.style.js","sourceRoot":"","sources":["../../src/components/tabContainer.style.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAEb,QAAA,KAAK,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BvB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { TabItem } from '../types';
|
|
3
|
+
import { ComponentFactory, SplitContainer, Layout, ComponentId, VerticalPosition } from "@omegagrid/core";
|
|
4
|
+
import { TabContainer } from "./tabContainer";
|
|
5
|
+
import { TabSplitContainerModel } from "../model";
|
|
6
|
+
type TabSplitContainerTabContainer = TabContainer & {
|
|
7
|
+
index: number;
|
|
8
|
+
parentContainer: TabSplitContainer;
|
|
9
|
+
};
|
|
10
|
+
export declare class TabSplitContainer extends LitElement implements Layout {
|
|
11
|
+
static styles: import("lit").CSSResult;
|
|
12
|
+
topLevelComponent: HTMLElement;
|
|
13
|
+
model: TabSplitContainerModel;
|
|
14
|
+
addButton: boolean;
|
|
15
|
+
closable: boolean;
|
|
16
|
+
singleActive: boolean;
|
|
17
|
+
tabPosition: VerticalPosition;
|
|
18
|
+
createComponent: ComponentFactory;
|
|
19
|
+
splitContainer: SplitContainer;
|
|
20
|
+
tabContainers: Set<TabSplitContainer | TabSplitContainerTabContainer>;
|
|
21
|
+
private _activeTabContainer;
|
|
22
|
+
get activeTabContainer(): TabContainer;
|
|
23
|
+
private _activeTab;
|
|
24
|
+
get activeTab(): TabItem;
|
|
25
|
+
walk(cb: (splitContainer: TabSplitContainer, tabContainer: TabSplitContainerTabContainer) => boolean | void): void;
|
|
26
|
+
willUpdate(): void;
|
|
27
|
+
updateTabs(): void;
|
|
28
|
+
updateTab(id: ComponentId, tab: Partial<TabItem>): void;
|
|
29
|
+
removeEmptyContainers(): Promise<void>;
|
|
30
|
+
updateActiveTab(): void;
|
|
31
|
+
_createTabContainer: (containerIndex: number) => TabSplitContainerTabContainer;
|
|
32
|
+
_createSplitContainer: (containerIndex: number) => TabSplitContainer;
|
|
33
|
+
_createSplitContainerComponent: (id: ComponentId) => Promise<TabContainer | TabSplitContainer>;
|
|
34
|
+
_onDrop: (e: DragEvent) => void;
|
|
35
|
+
activate(id: ComponentId): void;
|
|
36
|
+
open(item: TabItem, containerIndex?: number): void;
|
|
37
|
+
render: () => import("lit-html").TemplateResult<1> | "";
|
|
38
|
+
layout(): void;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=tabSplitContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabSplitContainer.d.ts","sourceRoot":"","sources":["../../src/components/tabSplitContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAO,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAe,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5H,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,sBAAsB,E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