@genesislcap/foundation-layout 9.0.1-alpha-b5c5eb7.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 +916 -0
- package/dist/1.0.0.remoteEntry.js +1 -0
- package/dist/191.191.106ece7a41ded6731029.js +2 -0
- package/dist/191.9a61143c2afb6057ad1bae886d5d1a6e.js.map +1 -0
- package/dist/259.09c601e5288d875caab4df1e2354c0ea.js.map +1 -0
- package/dist/259.259.216fcad43e9a38888e08.js +2 -0
- package/dist/415.415.094780a1a1162c7e5f1c.js +3 -0
- package/dist/415.415.094780a1a1162c7e5f1c.js.LICENSE.txt +4 -0
- package/dist/415.fcfb4f02eaecbfa31fc322639f244245.js.map +1 -0
- package/dist/459.459.c9f0bb440eb1f041c99e.js +515 -0
- package/dist/459.cb5f5b49b4e8881992c420f3b1ca863d.js.map +1 -0
- package/dist/623.623.0e7e8f23454ee96ed9c8.js +3 -0
- package/dist/623.623.0e7e8f23454ee96ed9c8.js.LICENSE.txt +4 -0
- package/dist/623.e8f211473f9034c4157d362efb017821.js.map +1 -0
- package/dist/755.718e14af7194fb741f98580b24b2bb8f.js.map +1 -0
- package/dist/755.755.f93ee58c2b836a669ec4.js +2 -0
- package/dist/dashboard.json +1 -0
- package/dist/dts/index.d.ts +3 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.federated.d.ts +1 -0
- package/dist/dts/index.federated.d.ts.map +1 -0
- package/dist/dts/main/index.d.ts +6 -0
- package/dist/dts/main/index.d.ts.map +1 -0
- package/dist/dts/main/layout-components.d.ts +42 -0
- package/dist/dts/main/layout-components.d.ts.map +1 -0
- package/dist/dts/main/layout-item.d.ts +70 -0
- package/dist/dts/main/layout-item.d.ts.map +1 -0
- package/dist/dts/main/layout-main.d.ts +186 -0
- package/dist/dts/main/layout-main.d.ts.map +1 -0
- package/dist/dts/main/layout-region.d.ts +70 -0
- package/dist/dts/main/layout-region.d.ts.map +1 -0
- package/dist/dts/styles/constants.d.ts +7 -0
- package/dist/dts/styles/constants.d.ts.map +1 -0
- package/dist/dts/styles/dragging.styles.d.ts +7 -0
- package/dist/dts/styles/dragging.styles.d.ts.map +1 -0
- package/dist/dts/styles/index.d.ts +4 -0
- package/dist/dts/styles/index.d.ts.map +1 -0
- package/dist/dts/styles/layout.styles.d.ts +8 -0
- package/dist/dts/styles/layout.styles.d.ts.map +1 -0
- package/dist/dts/utils/constants.d.ts +14 -0
- package/dist/dts/utils/constants.d.ts.map +1 -0
- package/dist/dts/utils/error.d.ts +13 -0
- package/dist/dts/utils/error.d.ts.map +1 -0
- package/dist/dts/utils/events.d.ts +38 -0
- package/dist/dts/utils/events.d.ts.map +1 -0
- package/dist/dts/utils/index.d.ts +7 -0
- package/dist/dts/utils/index.d.ts.map +1 -0
- package/dist/dts/utils/logger.d.ts +2 -0
- package/dist/dts/utils/logger.d.ts.map +1 -0
- package/dist/dts/utils/misc.d.ts +10 -0
- package/dist/dts/utils/misc.d.ts.map +1 -0
- package/dist/dts/utils/templates.d.ts +6 -0
- package/dist/dts/utils/templates.d.ts.map +1 -0
- package/dist/dts/utils/types.d.ts +63 -0
- package/dist/dts/utils/types.d.ts.map +1 -0
- package/dist/esm/index.federated.js +2 -0
- package/dist/esm/index.federated.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/main/index.js +6 -0
- package/dist/esm/main/index.js.map +1 -0
- package/dist/esm/main/layout-components.js +36 -0
- package/dist/esm/main/layout-components.js.map +1 -0
- package/dist/esm/main/layout-item.js +86 -0
- package/dist/esm/main/layout-item.js.map +1 -0
- package/dist/esm/main/layout-main.js +391 -0
- package/dist/esm/main/layout-main.js.map +1 -0
- package/dist/esm/main/layout-region.js +98 -0
- package/dist/esm/main/layout-region.js.map +1 -0
- package/dist/esm/main/main.css +17 -0
- package/dist/esm/styles/constants.js +16 -0
- package/dist/esm/styles/constants.js.map +1 -0
- package/dist/esm/styles/dragging.styles.js +116 -0
- package/dist/esm/styles/dragging.styles.js.map +1 -0
- package/dist/esm/styles/index.js +4 -0
- package/dist/esm/styles/index.js.map +1 -0
- package/dist/esm/styles/layout.styles.js +530 -0
- package/dist/esm/styles/layout.styles.js.map +1 -0
- package/dist/esm/utils/constants.js +14 -0
- package/dist/esm/utils/constants.js.map +1 -0
- package/dist/esm/utils/error.js +17 -0
- package/dist/esm/utils/error.js.map +1 -0
- package/dist/esm/utils/events.js +26 -0
- package/dist/esm/utils/events.js.map +1 -0
- package/dist/esm/utils/index.js +7 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/logger.js +3 -0
- package/dist/esm/utils/logger.js.map +1 -0
- package/dist/esm/utils/misc.js +24 -0
- package/dist/esm/utils/misc.js.map +1 -0
- package/dist/esm/utils/templates.js +11 -0
- package/dist/esm/utils/templates.js.map +1 -0
- package/dist/esm/utils/types.js +4 -0
- package/dist/esm/utils/types.js.map +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/foundation-layout.api.json +1574 -0
- package/dist/foundation-layout.d.ts +478 -0
- package/dist/foundationLayout.8b94161c9f0d0d475d026a05513893c1.js.map +1 -0
- package/dist/index.ejs +23 -0
- package/dist/index.html +15 -0
- package/dist/info.ejs +13 -0
- package/dist/main.40c13c1585eb6fa5761a17ab29a7851e.js.map +1 -0
- package/dist/main.94f8a6853d484ec34632.js +2 -0
- package/dist/npm.consola.713.b1e4073e73c71572987a.js +2 -0
- package/dist/npm.consola.a0d3324d3e61dcc430c3029da5f4dcc7.js.map +1 -0
- package/dist/npm.genesis-community.248.9c9900001dbc5ba9c3ed.js +2 -0
- package/dist/npm.genesis-community.2e0cc159dabe113d6fb29bb505c1a0d4.js.map +1 -0
- package/dist/npm.microsoft.127.00f16f24d8da8fd89263.js +1469 -0
- package/dist/npm.microsoft.127.00f16f24d8da8fd89263.js.LICENSE.txt +14 -0
- package/dist/npm.microsoft.be43958facd28231e770c1307660f64d.js.map +1 -0
- package/dist/remoteEntry.js +2 -0
- package/dist/serve.json +3 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/docs/.gitattributes +2 -0
- package/docs/api/foundation-layout.default_reload_buffer.md +18 -0
- package/docs/api/foundation-layout.foundationlayout.additem.md +38 -0
- package/docs/api/foundation-layout.foundationlayout.dragging.md +16 -0
- package/docs/api/foundation-layout.foundationlayout.getlayout.md +22 -0
- package/docs/api/foundation-layout.foundationlayout.layoutrequiredregistrations.md +37 -0
- package/docs/api/foundation-layout.foundationlayout.loadlayout.md +37 -0
- package/docs/api/foundation-layout.foundationlayout.md +44 -0
- package/docs/api/foundation-layout.foundationlayout.registereditems.md +26 -0
- package/docs/api/foundation-layout.foundationlayout.registeritem.md +42 -0
- package/docs/api/foundation-layout.foundationlayout.reloadbuffer.md +16 -0
- package/docs/api/foundation-layout.foundationlayoutcomponents.md +50 -0
- package/docs/api/foundation-layout.foundationlayoutitem.closable.md +16 -0
- package/docs/api/foundation-layout.foundationlayoutitem.md +35 -0
- package/docs/api/foundation-layout.foundationlayoutitem.registration.md +21 -0
- package/docs/api/foundation-layout.foundationlayoutitem.size.md +16 -0
- package/docs/api/foundation-layout.foundationlayoutitem.title.md +21 -0
- package/docs/api/foundation-layout.foundationlayoutregion.md +33 -0
- package/docs/api/foundation-layout.foundationlayoutregion.size.md +16 -0
- package/docs/api/foundation-layout.foundationlayoutregion.type.md +16 -0
- package/docs/api/foundation-layout.layoutemitevents.md +22 -0
- package/docs/api/foundation-layout.layoutreceiveevents.md +20 -0
- package/docs/api/foundation-layout.layoutreceiveeventsdetail.md +23 -0
- package/docs/api/foundation-layout.layoutregiontype.md +16 -0
- package/docs/api/foundation-layout.layoutregistrationerror._constructor_.md +23 -0
- package/docs/api/foundation-layout.layoutregistrationerror.md +23 -0
- package/docs/api/foundation-layout.layoutstyles.md +21 -0
- package/docs/api/foundation-layout.layouttemplate.md +21 -0
- package/docs/api/foundation-layout.layoutusageerror._constructor_.md +23 -0
- package/docs/api/foundation-layout.layoutusageerror.md +23 -0
- package/docs/api/foundation-layout.md +42 -0
- package/docs/api/foundation-layout.placement.md +18 -0
- package/docs/api/foundation-layout.registeredelementconfig.closable.md +14 -0
- package/docs/api/foundation-layout.registeredelementconfig.md +30 -0
- package/docs/api/foundation-layout.registeredelementconfig.registration.md +14 -0
- package/docs/api/foundation-layout.registeredelementconfig.size.md +14 -0
- package/docs/api/foundation-layout.registeredelementconfig.title.md +14 -0
- package/docs/api/foundation-layout.serialisedlayout.md +26 -0
- package/docs/api/index.md +12 -0
- package/docs/api-report.md +235 -0
- package/docs/img/foundation-layout-example.png +0 -0
- package/license.txt +46 -0
- package/package.json +80 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { __decorate } from "tslib";
|
|
3
|
+
import { html, attr, observable, when, ref } from '@microsoft/fast-element';
|
|
4
|
+
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
5
|
+
import { logger } from '../utils/logger';
|
|
6
|
+
import { GoldenLayout, LayoutConfig, ResolvedLayoutConfig, } from '@genesis-community/golden-layout';
|
|
7
|
+
import { DEFAULT_RELOAD_BUFFER, LayoutEmitEvents, LayoutReceiveEvents, componentType, } from '../utils/';
|
|
8
|
+
import { LayoutRegistrationError, LayoutUsageError } from '../utils/error';
|
|
9
|
+
import { getMissingArrayItems } from '../utils/';
|
|
10
|
+
import { globalDraggingStyles, glVisualConfig, layoutStyles } from '../styles';
|
|
11
|
+
export { layoutStyles } from '../styles';
|
|
12
|
+
/*
|
|
13
|
+
* We only want to apply the global stylesheet required for golden layout
|
|
14
|
+
* to work once, and only apply it if we actually use an instance of the
|
|
15
|
+
* layout that requires it
|
|
16
|
+
*/
|
|
17
|
+
let appliedGlobalStyles = false;
|
|
18
|
+
/**
|
|
19
|
+
* @beta
|
|
20
|
+
* Top level web component which is used to initialise a custom layout
|
|
21
|
+
* @remarks
|
|
22
|
+
* Can be used in a composition to customise the styles of the layout.
|
|
23
|
+
*/
|
|
24
|
+
export class FoundationLayout extends FoundationElement {
|
|
25
|
+
/** @internal */
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
this.layoutConfig = { root: undefined };
|
|
29
|
+
/** @internal */
|
|
30
|
+
this[_a] = 'root';
|
|
31
|
+
/**
|
|
32
|
+
* Number describing how long to wait in ms before reloading the config when adding items
|
|
33
|
+
* declaratively by the html API. Default 500 (ms).
|
|
34
|
+
* @beta
|
|
35
|
+
*/
|
|
36
|
+
this.reloadBuffer = DEFAULT_RELOAD_BUFFER;
|
|
37
|
+
this.reloadPending = false;
|
|
38
|
+
this.registeredComponents = 0;
|
|
39
|
+
/** @internal */
|
|
40
|
+
this.hasFirstLoaded = false;
|
|
41
|
+
/** @internal */
|
|
42
|
+
this.usingDeclerativeAPI = false;
|
|
43
|
+
/**
|
|
44
|
+
* @beta
|
|
45
|
+
* Set to true when the user is currently dragging the panes inside of the layout
|
|
46
|
+
*/
|
|
47
|
+
this.dragging = false;
|
|
48
|
+
this.onDragStart = this.onDragStart.bind(this);
|
|
49
|
+
this.onDragStop = this.onDragStop.bind(this);
|
|
50
|
+
this.cacheLayout = this.cacheLayout.bind(this);
|
|
51
|
+
this.onItemRemoved = this.onItemRemoved.bind(this);
|
|
52
|
+
}
|
|
53
|
+
/** @internal */
|
|
54
|
+
connectedCallback() {
|
|
55
|
+
super.connectedCallback();
|
|
56
|
+
logger.debug(`FoundationLayout connected to the DOM`);
|
|
57
|
+
this.layout = new GoldenLayout(this.layoutElement);
|
|
58
|
+
this.layout.resizeWithContainerAutomatically = true;
|
|
59
|
+
if (!appliedGlobalStyles) {
|
|
60
|
+
new CSSStyleSheet()
|
|
61
|
+
.replace(globalDraggingStyles)
|
|
62
|
+
.then((x) => document.adoptedStyleSheets.push(x))
|
|
63
|
+
.catch((e) => console.error('Failed to replace styles:', e));
|
|
64
|
+
appliedGlobalStyles = true;
|
|
65
|
+
}
|
|
66
|
+
this.shadowRoot.addEventListener('dragStart', this.onDragStart, true);
|
|
67
|
+
this.shadowRoot.addEventListener('dragStop', this.onDragStop, true);
|
|
68
|
+
this.shadowRoot.addEventListener('itemDestroyed', this.onItemRemoved, true);
|
|
69
|
+
this.shadowRoot.addEventListener('closeButtonPressed', this.onItemRemoved, true);
|
|
70
|
+
}
|
|
71
|
+
/** @internal */
|
|
72
|
+
disconnectedCallback() {
|
|
73
|
+
this.shadowRoot.removeEventListener('dragStart', this.onDragStart);
|
|
74
|
+
this.shadowRoot.removeEventListener('dragStop', this.onDragStop);
|
|
75
|
+
this.shadowRoot.removeEventListener('itemDestroyed', this.onItemRemoved);
|
|
76
|
+
this.shadowRoot.removeEventListener('closeButtonPressed', this.onItemRemoved);
|
|
77
|
+
}
|
|
78
|
+
/** @internal */
|
|
79
|
+
onDragStart() {
|
|
80
|
+
this.dragging = true;
|
|
81
|
+
}
|
|
82
|
+
/** @internal */
|
|
83
|
+
onDragStop() {
|
|
84
|
+
this.dragging = false;
|
|
85
|
+
}
|
|
86
|
+
/** @internal */
|
|
87
|
+
onItemAdded() {
|
|
88
|
+
this.$emit(LayoutEmitEvents.itemAdded);
|
|
89
|
+
}
|
|
90
|
+
/** @internal */
|
|
91
|
+
onItemRemoved() {
|
|
92
|
+
this.$emit(LayoutEmitEvents.itemRemoved);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* JS API, public
|
|
96
|
+
*/
|
|
97
|
+
/**
|
|
98
|
+
* @beta
|
|
99
|
+
* Gets all of the required registration function names for a set of config
|
|
100
|
+
* @remarks
|
|
101
|
+
* You can use this with {@link FoundationLayout.registeredItems | registeredItems} to work out what items you need to register with {@link FoundationLayout.registerItem | registerItem()}
|
|
102
|
+
* before loading the layout with {@link FoundationLayout.loadLayout | loadLayout()}
|
|
103
|
+
*
|
|
104
|
+
* @param layout - any version of {@link SerialisedLayout} object describing the layout
|
|
105
|
+
* @returns string[] - an item for each registered element in the config. These must all be added before {@link FoundationLayout.loadLayout | function}
|
|
106
|
+
* @throws - various errors if the layout parameter cannot be parsed
|
|
107
|
+
*/
|
|
108
|
+
static layoutRequiredRegistrations(layout) {
|
|
109
|
+
const { c: config } = layout;
|
|
110
|
+
const layoutConfig = LayoutConfig.fromResolved(ResolvedLayoutConfig.unminifyConfig(config));
|
|
111
|
+
const names = [];
|
|
112
|
+
JSON.stringify(layoutConfig, (k, v) => {
|
|
113
|
+
if (k === 'componentType') {
|
|
114
|
+
names.push(v);
|
|
115
|
+
}
|
|
116
|
+
return v;
|
|
117
|
+
});
|
|
118
|
+
return names.sort();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* @beta
|
|
122
|
+
* Gets all of the currently registered names
|
|
123
|
+
* @remarks
|
|
124
|
+
* You can use this with {@link FoundationLayout.layoutRequiredRegistrations | layoutRequiredRegistrations} to work out what items you need to register with {@link FoundationLayout.registerItem | registerItem()}
|
|
125
|
+
* before loading the layout with {@link FoundationLayout.loadLayout | loadLayout()}
|
|
126
|
+
*
|
|
127
|
+
* @returns string[] - an item for each registered element currently registered with the layout system
|
|
128
|
+
*/
|
|
129
|
+
registeredItems() {
|
|
130
|
+
return this.layout.getRegisteredComponentTypeNames();
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @beta
|
|
134
|
+
* Gets a minified string containing the config describing the current layout of the layout object to later restore in {@link FoundationLayout.loadLayout | function}
|
|
135
|
+
* @returns - latest version of {@link SerialisedLayout} describing the layout
|
|
136
|
+
*/
|
|
137
|
+
getLayout() {
|
|
138
|
+
return { v: '1', c: ResolvedLayoutConfig.minifyConfig(this.layout.saveLayout()) };
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @beta
|
|
142
|
+
* Restores a layout described in the config from {@link FoundationLayout.getLayout | getLayout()}
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* In order to restore a layout you must have registered all of the required panes with the layout system before restoring it. If you are just setting the layout using the declarative API then all of the same components will be registered. <br/ >If you have added any elements using {@link FoundationLayout.registerItem} then you must ensure all of the same items have been added again. To make tracking what items are registered easier it is recommended in this case you explicitly name your registrations using the `id` parameter available on the {@link RegisteredElementConfig} and `foundation-layout-item` APIs. <br/> You can use {@link FoundationLayout.layoutRequiredRegistrations} to check which items are registered in a current layout in order to dynamically add any missing items before you can restore the layout
|
|
146
|
+
*
|
|
147
|
+
* @param layout - any version of {@link SerialisedLayout} object describing the layout
|
|
148
|
+
* @throws {@link LayoutUsageError} if you attempt to load a layout with registered items that are not currently registered with the layout system
|
|
149
|
+
* @throws various errors if the layout string is malformed and cannot be parsed
|
|
150
|
+
*/
|
|
151
|
+
loadLayout(layout) {
|
|
152
|
+
const alreadyRegistered = this.registeredItems();
|
|
153
|
+
const wantedRegistered = FoundationLayout.layoutRequiredRegistrations(layout);
|
|
154
|
+
const missingRegisteredItems = getMissingArrayItems(wantedRegistered, alreadyRegistered);
|
|
155
|
+
if (missingRegisteredItems.length !== 0) {
|
|
156
|
+
throw new LayoutUsageError(`Trying to load layout with extra components. The component(s) not currently loaded are "${[
|
|
157
|
+
...new Set(missingRegisteredItems),
|
|
158
|
+
]}"`);
|
|
159
|
+
}
|
|
160
|
+
this.layout.loadLayout(Object.assign(Object.assign({}, LayoutConfig.fromResolved(ResolvedLayoutConfig.unminifyConfig(layout.c))), glVisualConfig));
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @beta
|
|
164
|
+
* Dynamically add a new item to the layout. The user can move the new plane to whenever they want once it has been added.
|
|
165
|
+
* @remarks
|
|
166
|
+
* Adding a new item invokes the registration previously made explicitly via {@link FoundationLayout.registerItem | registerItem()} or implicitly via the html declerative API.
|
|
167
|
+
*
|
|
168
|
+
* The elements added onto the new pane are copies using `element.cloneNode()` of the original element references used during registration.
|
|
169
|
+
*
|
|
170
|
+
* @param config - {@link RegisteredElementConfig} configuration items for the new pane
|
|
171
|
+
* @param placement - where to add the new pane on the layout (defaults to the right hand side)
|
|
172
|
+
* @throws {@link LayoutRegistrationError} if you attempt to add an item before it has been registered
|
|
173
|
+
*/
|
|
174
|
+
addItem(config, placement = { area: 'right' }) {
|
|
175
|
+
const { registration, title, size, closable } = config;
|
|
176
|
+
if (!this.layout.getRegisteredComponentTypeNames().includes(registration)) {
|
|
177
|
+
throw new LayoutRegistrationError(`Cannot add item '${registration}' which is not registered with the layout system.`);
|
|
178
|
+
}
|
|
179
|
+
const itemConfig = {
|
|
180
|
+
type: 'component',
|
|
181
|
+
componentType: registration,
|
|
182
|
+
title: title !== null && title !== void 0 ? title : `Item ${registration}`,
|
|
183
|
+
reorderEnabled: true,
|
|
184
|
+
isClosable: closable || false,
|
|
185
|
+
size,
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* If no root is added (no items via declerative API) then
|
|
189
|
+
* this new item is the root so set it and return
|
|
190
|
+
*/
|
|
191
|
+
if (typeof this.layoutConfig.root === 'undefined') {
|
|
192
|
+
this.layoutConfig = Object.assign({ root: itemConfig }, glVisualConfig);
|
|
193
|
+
this.layout.loadLayout(this.layoutConfig);
|
|
194
|
+
this.onItemAdded();
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
// Else we add the item relative to existing items
|
|
198
|
+
this.cacheLayout();
|
|
199
|
+
const { area } = placement;
|
|
200
|
+
this.layoutConfig = Object.assign({ root: {
|
|
201
|
+
type: area === 'top' || area === 'bottom' ? 'column' : 'row',
|
|
202
|
+
content: area === 'right' || area === 'bottom'
|
|
203
|
+
? [this.layoutConfig.root, itemConfig]
|
|
204
|
+
: [itemConfig, this.layoutConfig.root],
|
|
205
|
+
} }, glVisualConfig);
|
|
206
|
+
this.layout.loadLayout(this.layoutConfig);
|
|
207
|
+
this.onItemAdded();
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* @beta
|
|
211
|
+
* Register a collection of `Element` and associate them with an `ID` with the layout system for later use.
|
|
212
|
+
* @remarks
|
|
213
|
+
* You would use this to register elements that you later want to load when using {@link FoundationLayout.loadLayout}.
|
|
214
|
+
* Use {@link FoundationLayout.layoutRequiredRegistrations} to see what components need to be registered for a certain config
|
|
215
|
+
* and then register them using this function before calling {@link FoundationLayout.loadLayout}.
|
|
216
|
+
*
|
|
217
|
+
* When registering an element it is moved by reference into the internals of the layout, so if you pass elements already in the DOM then they will disappear. If you want to avoid this you can pass copies using `element.cloneNode(true)`.
|
|
218
|
+
*
|
|
219
|
+
* @param registration - string of the registration ID
|
|
220
|
+
* @param elements - Elements[] containing the reference to the elements to register for later usage
|
|
221
|
+
* @throws {@link LayoutUsageError} if you attempt to add an item before the layout has been initialised.
|
|
222
|
+
* @throws {@link LayoutRegistrationError} if you attempt to use a `registration` name which is already in use (declarative html API and JavaScript API registrations use the same "pool" of registration names).
|
|
223
|
+
* @returns - string defining the name of the registered item with the layout system (config.id if set).
|
|
224
|
+
*/
|
|
225
|
+
registerItem(registration, elements) {
|
|
226
|
+
if (!this.layout.isInitialised) {
|
|
227
|
+
throw new LayoutUsageError('Cannot add item via JS API until initialised');
|
|
228
|
+
}
|
|
229
|
+
return this.cacheElementsAndRegister({
|
|
230
|
+
elements: elements,
|
|
231
|
+
id: registration,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Internal APIs
|
|
236
|
+
*/
|
|
237
|
+
/**
|
|
238
|
+
* Request to reload the layout using the private member config. Debounced using the time set
|
|
239
|
+
* in this.reloadBuffer
|
|
240
|
+
* @internal
|
|
241
|
+
*/
|
|
242
|
+
requestLayoutReload() {
|
|
243
|
+
if (this.reloadPending)
|
|
244
|
+
return;
|
|
245
|
+
this.reloadPending = true;
|
|
246
|
+
setTimeout(() => {
|
|
247
|
+
this.layout.loadLayout(this.layoutConfig);
|
|
248
|
+
this.reloadPending = false;
|
|
249
|
+
if (!this.hasFirstLoaded) {
|
|
250
|
+
this.$emit(LayoutEmitEvents.firstLoaded);
|
|
251
|
+
this.hasFirstLoaded = true;
|
|
252
|
+
}
|
|
253
|
+
}, this.reloadBuffer);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Adds a config item into the root config and returns a link to the new config in the tree
|
|
257
|
+
* @typeParam T - RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig;
|
|
258
|
+
* @param item - T to add as the root element of the layout
|
|
259
|
+
* @returns T the reference to the added item in the whole item config
|
|
260
|
+
* @throws {@link LayoutUsageError} if you try and add an item when a root has already been set (this happens if you have multiple direct children of this html element which is an incorrect usage)
|
|
261
|
+
* @internal
|
|
262
|
+
*/
|
|
263
|
+
addItemFromChild(item) {
|
|
264
|
+
if (typeof this.layoutConfig.root !== 'undefined') {
|
|
265
|
+
throw new LayoutUsageError('Cannot have multiple layout items as direct descendants of the layout root. You need to put the layout items within a layout region.');
|
|
266
|
+
}
|
|
267
|
+
this.usingDeclerativeAPI = true;
|
|
268
|
+
this.layoutConfig = Object.assign({ root: item }, glVisualConfig);
|
|
269
|
+
return this.layoutConfig.root;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Registers a function with golden layout to create a pane
|
|
273
|
+
* @param elements - Elements[] to add to new new pane
|
|
274
|
+
* @param id - optional string which is used to register the new function with golden layout. Defaults to sequentially setting the IDs for default items
|
|
275
|
+
* @returns - string which is the registered ID
|
|
276
|
+
* @throws - {@link LayoutRegistrationError} if the id is already in use
|
|
277
|
+
* @internal
|
|
278
|
+
*/
|
|
279
|
+
cacheElementsAndRegister({ elements, id }) {
|
|
280
|
+
const reg = id || `${(this.registeredComponents += 1)}`;
|
|
281
|
+
if (this.layout.getRegisteredComponentTypeNames().includes(reg)) {
|
|
282
|
+
throw new LayoutRegistrationError(`Cannot register item with already registered name: '${reg}'`);
|
|
283
|
+
}
|
|
284
|
+
const setupEvents = this.setupLayoutReceiveEvents.bind(this);
|
|
285
|
+
/**
|
|
286
|
+
* What we need the registration function to do:
|
|
287
|
+
* "Consume" the registered elements initially, so we don't have duplicate items from the declarative API
|
|
288
|
+
* We need to hold a master copy of the registered items
|
|
289
|
+
* When an item is created at first, it is copied from the master copy so it behaves as expected
|
|
290
|
+
* When a copy is created it becomes its own instance for the lifetime of the layout in the DOM
|
|
291
|
+
*
|
|
292
|
+
* This has the effect of allowing us to create multiple instances of the same registered item, and each
|
|
293
|
+
* created instance is separate allowing it to implement its own serialise and cache of data.
|
|
294
|
+
*/
|
|
295
|
+
const registrationFunction = (function () {
|
|
296
|
+
// Use appendChild to consume the elements and save them in the master copy
|
|
297
|
+
const masterCopy = document.createDocumentFragment();
|
|
298
|
+
elements.forEach((e) => masterCopy.appendChild(e));
|
|
299
|
+
let instanceCount = 0;
|
|
300
|
+
const instances = new Map();
|
|
301
|
+
return (container, state) => {
|
|
302
|
+
var _b;
|
|
303
|
+
// If this is a new instance then assign it an instanceCount
|
|
304
|
+
if (!(state === null || state === void 0 ? void 0 : state['instance'])) {
|
|
305
|
+
instanceCount += 1;
|
|
306
|
+
state['instance'] = instanceCount;
|
|
307
|
+
}
|
|
308
|
+
container.state['instance'] = state['instance'];
|
|
309
|
+
container.state['originalTitle'] = (_b = state['originalTitle']) !== null && _b !== void 0 ? _b : container.title;
|
|
310
|
+
// If this is a new instance then copy the master copy into the instances map
|
|
311
|
+
// this is then the instance that is recalled for this version each time
|
|
312
|
+
// the key point is "cloneNode" which makes a copy at this point
|
|
313
|
+
if (!instances.has(state === null || state === void 0 ? void 0 : state['instance'])) {
|
|
314
|
+
const instanceCopy = document.createDocumentFragment();
|
|
315
|
+
Array.from(masterCopy.children).forEach((e) => instanceCopy.appendChild(e.cloneNode(true)));
|
|
316
|
+
instances.set(state['instance'], [...instanceCopy.children]);
|
|
317
|
+
}
|
|
318
|
+
// get the instance from the map and append it to the container
|
|
319
|
+
instances.get(state['instance']).forEach((e) => container.element.appendChild(e));
|
|
320
|
+
setupEvents(container, state);
|
|
321
|
+
};
|
|
322
|
+
})();
|
|
323
|
+
this.layout.registerComponentFactoryFunction(reg, registrationFunction);
|
|
324
|
+
return reg;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Sets up the event listeners for the layout receive events
|
|
328
|
+
* @internal
|
|
329
|
+
*/
|
|
330
|
+
setupLayoutReceiveEvents(container, state) {
|
|
331
|
+
const originalTitle = container.state['originalTitle'];
|
|
332
|
+
container.element.addEventListener(LayoutReceiveEvents.changeTitle, (e) => {
|
|
333
|
+
const maybeDetail = e === null || e === void 0 ? void 0 : e.detail;
|
|
334
|
+
if (!((maybeDetail === null || maybeDetail === void 0 ? void 0 : maybeDetail.title) && (maybeDetail === null || maybeDetail === void 0 ? void 0 : maybeDetail.mode))) {
|
|
335
|
+
logger.error('Invalid change-title event.detail:', e === null || e === void 0 ? void 0 : e.detail);
|
|
336
|
+
}
|
|
337
|
+
container.setTitle(`${maybeDetail.mode === 'suffix' ? originalTitle + ' ' : ''}${maybeDetail.title}`);
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Saves the stored layout config according to the Golden Layout provider.
|
|
342
|
+
* Needs to be called when the layout is updated outside of using addItemFromChild.
|
|
343
|
+
* @internal
|
|
344
|
+
* */
|
|
345
|
+
cacheLayout() {
|
|
346
|
+
this.layoutConfig = LayoutConfig.fromResolved(this.layout.saveLayout());
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
_a = componentType;
|
|
350
|
+
__decorate([
|
|
351
|
+
attr({ attribute: 'reload-buffer' })
|
|
352
|
+
], FoundationLayout.prototype, "reloadBuffer", void 0);
|
|
353
|
+
__decorate([
|
|
354
|
+
observable
|
|
355
|
+
], FoundationLayout.prototype, "hasFirstLoaded", void 0);
|
|
356
|
+
__decorate([
|
|
357
|
+
observable
|
|
358
|
+
], FoundationLayout.prototype, "usingDeclerativeAPI", void 0);
|
|
359
|
+
__decorate([
|
|
360
|
+
observable
|
|
361
|
+
], FoundationLayout.prototype, "dragging", void 0);
|
|
362
|
+
const loadingTemplate = html `
|
|
363
|
+
<div class="html-spinner"></div>
|
|
364
|
+
`;
|
|
365
|
+
/**
|
|
366
|
+
* `ViewTemplate` which defines the html for {@link FoundationLayout}.
|
|
367
|
+
* @remarks
|
|
368
|
+
* Can be used in a composition to customise the styles of the layout.
|
|
369
|
+
* @beta
|
|
370
|
+
*/
|
|
371
|
+
export const layoutTemplate = html `
|
|
372
|
+
<template>
|
|
373
|
+
${when((x) => !x.hasFirstLoaded && x.usingDeclerativeAPI, loadingTemplate)}
|
|
374
|
+
<div class="layout-container" ${ref('layoutElement')}></div>
|
|
375
|
+
</template>
|
|
376
|
+
`;
|
|
377
|
+
/**
|
|
378
|
+
* The Foundation Layout Composed element
|
|
379
|
+
*
|
|
380
|
+
* @internal
|
|
381
|
+
* @remarks
|
|
382
|
+
* Can be registered with the design system via {@link foundationlayoutComponents}.
|
|
383
|
+
*
|
|
384
|
+
* Tag Name: <{prefix}-layout>
|
|
385
|
+
*/
|
|
386
|
+
export const foundationLayout = FoundationLayout.compose({
|
|
387
|
+
baseName: 'layout',
|
|
388
|
+
styles: layoutStyles,
|
|
389
|
+
template: layoutTemplate,
|
|
390
|
+
});
|
|
391
|
+
//# sourceMappingURL=layout-main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-main.js","sourceRoot":"","sources":["../../../src/main/layout-main.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAGL,YAAY,EAEZ,YAAY,EACZ,oBAAoB,GAErB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,qBAAqB,EAErB,gBAAgB,EAChB,mBAAmB,EAKnB,aAAa,GAEd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,oBAAo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eAAe,GAAG,IAAI,CAAA;;CAE3B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAkB;;MAE9C,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,mBAAmB,EAAE,eAAe,CAAC;oCAC1C,GAAG,CAAC,eAAe,CAAC;;CAEvD,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,OAAO,CAAC;IACvD,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,cAAc;CACzB,CAAC,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { __decorate } from "tslib";
|
|
3
|
+
import { attr } from '@microsoft/fast-element';
|
|
4
|
+
import { logger } from '../utils/logger';
|
|
5
|
+
import { componentType, getParentLayoutComponent, layoutRegionValue, wrapperTemplate, } from '../utils';
|
|
6
|
+
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
7
|
+
const defaultLayoutType = layoutRegionValue[0];
|
|
8
|
+
const regionConveter = (x) => {
|
|
9
|
+
const t = {
|
|
10
|
+
horizontal: 'column',
|
|
11
|
+
vertical: 'row',
|
|
12
|
+
tabs: 'stack',
|
|
13
|
+
};
|
|
14
|
+
return t[x];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @beta
|
|
18
|
+
* `FoundationLayoutRegion` is a custom element that represents a region in the layout.
|
|
19
|
+
* @remarks
|
|
20
|
+
* This element is used to create a region in the layout. It can be used to create a horizontal or vertical split, or a tabbed region.
|
|
21
|
+
*
|
|
22
|
+
* This is a simple component which is only used to define the layout splits; any JavaScript API interactions or custom styling is used via {@link FoundationLayout}.
|
|
23
|
+
*/
|
|
24
|
+
export class FoundationLayoutRegion extends FoundationElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
/** @internal */
|
|
28
|
+
this[_a] = 'horizontal';
|
|
29
|
+
}
|
|
30
|
+
/** @internal */
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
super.connectedCallback();
|
|
33
|
+
if (!layoutRegionValue.includes(this.type)) {
|
|
34
|
+
this.type = defaultLayoutType;
|
|
35
|
+
logger.warn(`Using invalid attribute "type", defaulting to ${defaultLayoutType}`);
|
|
36
|
+
}
|
|
37
|
+
this[componentType] = this.type;
|
|
38
|
+
this.setupLayoutRegion();
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Gets the layout config for this region using {@link FoundationLayoutRegion.constructLayoutConfig} and adds it into the main config tree via the parents. It saves a reference to the this config so a child can add its config in later.
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
setupLayoutRegion() {
|
|
45
|
+
this.layoutConfig = this.getParentLayoutComponent().addItemFromChild(this.constructLayoutConfig());
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Creates a golden layout config for this object.
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
constructLayoutConfig() {
|
|
52
|
+
const glRegion = regionConveter(this[componentType]);
|
|
53
|
+
return {
|
|
54
|
+
type: glRegion,
|
|
55
|
+
content: [],
|
|
56
|
+
size: this.size,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** @internal */
|
|
60
|
+
getParentLayoutComponent() {
|
|
61
|
+
return getParentLayoutComponent.apply(this);
|
|
62
|
+
}
|
|
63
|
+
/** @internal */
|
|
64
|
+
addItemFromChild(item) {
|
|
65
|
+
this.layoutConfig.content.push(item);
|
|
66
|
+
return this.layoutConfig.content[this.layoutConfig.content.length - 1];
|
|
67
|
+
}
|
|
68
|
+
/** @internal */
|
|
69
|
+
requestLayoutReload() {
|
|
70
|
+
this.getParentLayoutComponent().requestLayoutReload();
|
|
71
|
+
}
|
|
72
|
+
/** @internal */
|
|
73
|
+
cacheElementsAndRegister(config) {
|
|
74
|
+
return this.getParentLayoutComponent().cacheElementsAndRegister(config);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
_a = componentType;
|
|
78
|
+
__decorate([
|
|
79
|
+
attr
|
|
80
|
+
], FoundationLayoutRegion.prototype, "size", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
attr
|
|
83
|
+
], FoundationLayoutRegion.prototype, "type", void 0);
|
|
84
|
+
/**
|
|
85
|
+
* The FoundationLayoutRegion Composed element
|
|
86
|
+
*
|
|
87
|
+
* @internal
|
|
88
|
+
* @remarks
|
|
89
|
+
* Can be registered with the design system via {@link foundationlayoutComponents}.
|
|
90
|
+
* You do not need to compose your own version of this to update the styles of the layout.
|
|
91
|
+
*
|
|
92
|
+
* Tag Name: <{prefix}-layout-region>
|
|
93
|
+
*/
|
|
94
|
+
export const foundationLayoutRegion = FoundationLayoutRegion.compose({
|
|
95
|
+
baseName: 'layout-region',
|
|
96
|
+
template: wrapperTemplate,
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=layout-region.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-region.js","sourceRoot":"","sources":["../../../src/main/layout-region.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAM/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EACL,aAAa,EACb,wBAAwB,EAGxB,iBAAiB,EAEjB,eAAe,GAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAG/C,MAAM,cAAc,GAAG,CAAC,CAAmB,EAAuB,EAAE;IAClE,MAAM,CAAC,GAAqD;QAC1D,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,OAAO;KACd,CAAC;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AM,GAAG,CAAC,CAAM,CAAC;IAC9E,CAAC;IAED,gBAAgB;IAChB,mBAAmB;QACjB,IAAI,CAAC,wBAAwB,EAAE,CAAC,mBAAmB,EAAE,CAAC;IACxD,CAAC;IAED,gBAAgB;IAChB,wBAAwB,CAAC,MAA0B;QACjD,OAAO,IAAI,CAAC,wBAAwB,EAAE,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAC1E,CAAC;CACF;KA/DE,aAAa;AAVR;IAAL,IAAI;oDAAc;AAOb;IAAL,IAAI;oDAAwB;AAoE/B;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,OAAO,CAAC;IACnE,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,eAAe;CAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const glVisualConfig = {
|
|
2
|
+
dimensions: {
|
|
3
|
+
headerHeight: 38,
|
|
4
|
+
borderWidth: 12,
|
|
5
|
+
},
|
|
6
|
+
header: {
|
|
7
|
+
maximise: 'maximise',
|
|
8
|
+
minimise: 'minimise',
|
|
9
|
+
popout: false,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export const maximisSVG = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMTQ0IDMyaC0xMjhDNy4xNTYgMzIgMCAzOS4xNiAwIDQ4djEyOEMwIDE4NC44IDcuMTU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vc3ZnPg==';
|
|
15
|
+
export const tabDropdownSVG = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNNC4yNTEgMTgxLjFDNy4zOTIgMTc3LjcgMTEuNjkgMTc1LjEgMTYgMTc1LjFjMy44OTEgMCA3Ljc4MSAxLjQwNiAxMC44NiA0LjI1bDE5Ny4xIDE4MS4xbDE5Ny4xLTE4MS4xYzYuNS02IDE2LjY0LTUuNjI1IDIyLjYxIC45MDYyYzYgNi41IDUuNTk0IDE2LjU5LS44OTA2IDIyLjU5bC0yMDggMTkyYy02LjE1NiA1LjY4OC0xNS41NiA1LjY4OC0yMS43MiAwbC0yMDgtMTkyQy0xLjM0MyAxOTcuNy0xLjc0OSAxODcuNiA0LjI1MSAxODEuMXoiIGZpbGw9IiM4NzliYTYiLz48L3N2Zz4=';
|
|
16
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/styles/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAA+B;IACxD,UAAU,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,EAAE;KAChB;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,KAAK;KACd;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GACrB,olCAAolC,CAAC;AAEvlC,MAAM,CAAC,MAAM,WAAW,GACtB,4hBAA4hB,CAAC;AAE/hB,MAAM,CAAC,MAAM,QAAQ,GACnB,o2BAAo2B,CAAC;AAEv2B,MAAM,CAAC,MAAM,cAAc,GACzB,wsBAAwsB,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { neutralFillStealthRest } from '@microsoft/fast-components';
|
|
2
|
+
/**
|
|
3
|
+
* This is defined as a string rather than a css template
|
|
4
|
+
* because it is applied to a CSSStyleSheet object rather than
|
|
5
|
+
* used as a FAST template
|
|
6
|
+
*/
|
|
7
|
+
export const globalDraggingStyles = `
|
|
8
|
+
.lm_dragProxy .lm_content {
|
|
9
|
+
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
|
|
10
|
+
}
|
|
11
|
+
.lm_dropTargetIndicator {
|
|
12
|
+
box-shadow: inset 0 0 30px #000000;
|
|
13
|
+
outline: 1px dashed #cccccc;
|
|
14
|
+
transition: all 200ms ease;
|
|
15
|
+
}
|
|
16
|
+
.lm_dropTargetIndicator .lm_inner {
|
|
17
|
+
background: var(${neutralFillStealthRest.cssCustomProperty});
|
|
18
|
+
opacity: 0.2;
|
|
19
|
+
}
|
|
20
|
+
.lm_dragProxy.lm_left .lm_header,
|
|
21
|
+
.lm_dragProxy.lm_right .lm_header {
|
|
22
|
+
width: 20px;
|
|
23
|
+
float: left;
|
|
24
|
+
vertical-align: top;
|
|
25
|
+
}
|
|
26
|
+
.lm_dragProxy.lm_left .lm_header .lm_tabs,
|
|
27
|
+
.lm_dragProxy.lm_right .lm_header .lm_tabs {
|
|
28
|
+
transform-origin: left top;
|
|
29
|
+
top: 0;
|
|
30
|
+
width: 1000px;
|
|
31
|
+
}
|
|
32
|
+
.lm_dragProxy.lm_left .lm_header .lm_controls,
|
|
33
|
+
.lm_dragProxy.lm_right .lm_header .lm_controls {
|
|
34
|
+
bottom: 0;
|
|
35
|
+
}
|
|
36
|
+
.lm_dragProxy.lm_left .lm_items,
|
|
37
|
+
.lm_dragProxy.lm_right .lm_items {
|
|
38
|
+
float: left;
|
|
39
|
+
}
|
|
40
|
+
.lm_dragProxy.lm_left .lm_header .lm_tabs {
|
|
41
|
+
transform: rotate(-90deg) scaleX(-1);
|
|
42
|
+
left: 0;
|
|
43
|
+
}
|
|
44
|
+
.lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab {
|
|
45
|
+
transform: scaleX(-1);
|
|
46
|
+
margin-top: 1px;
|
|
47
|
+
}
|
|
48
|
+
.lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list {
|
|
49
|
+
top: initial;
|
|
50
|
+
right: initial;
|
|
51
|
+
left: 20px;
|
|
52
|
+
}
|
|
53
|
+
.lm_dragProxy.lm_right .lm_content {
|
|
54
|
+
float: left;
|
|
55
|
+
}
|
|
56
|
+
.lm_dragProxy.lm_right .lm_header .lm_tabs {
|
|
57
|
+
transform: rotate(90deg) scaleX(1);
|
|
58
|
+
left: 100%;
|
|
59
|
+
margin-left: 0;
|
|
60
|
+
}
|
|
61
|
+
.lm_dragProxy.lm_right .lm_header .lm_controls {
|
|
62
|
+
left: 3px;
|
|
63
|
+
}
|
|
64
|
+
.lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list {
|
|
65
|
+
top: initial;
|
|
66
|
+
right: 20px;
|
|
67
|
+
}
|
|
68
|
+
.lm_dragProxy.lm_bottom .lm_header .lm_tab {
|
|
69
|
+
margin-top: 0;
|
|
70
|
+
border-top: none;
|
|
71
|
+
}
|
|
72
|
+
.lm_dragProxy.lm_bottom .lm_header .lm_controls,
|
|
73
|
+
.lm_stack.lm_bottom .lm_header .lm_controls {
|
|
74
|
+
top: 3px;
|
|
75
|
+
}
|
|
76
|
+
.lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,
|
|
77
|
+
.lm_stack.lm_bottom .lm_header .lm_tabdropdown_list {
|
|
78
|
+
top: initial;
|
|
79
|
+
bottom: 20px;
|
|
80
|
+
}
|
|
81
|
+
.lm_dragProxy {
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: 0;
|
|
84
|
+
left: 0;
|
|
85
|
+
z-index: 30;
|
|
86
|
+
}
|
|
87
|
+
.lm_dragProxy .lm_header {
|
|
88
|
+
background: transparent;
|
|
89
|
+
}
|
|
90
|
+
.lm_dragProxy .lm_content {
|
|
91
|
+
border-top: none;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
}
|
|
94
|
+
.lm_dropTargetIndicator {
|
|
95
|
+
display: none;
|
|
96
|
+
position: absolute;
|
|
97
|
+
z-index: 20;
|
|
98
|
+
}
|
|
99
|
+
.lm_dropTargetIndicator .lm_inner {
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 100%;
|
|
102
|
+
position: relative;
|
|
103
|
+
top: 0;
|
|
104
|
+
left: 0;
|
|
105
|
+
}
|
|
106
|
+
.lm_transition_indicator {
|
|
107
|
+
display: none;
|
|
108
|
+
width: 20px;
|
|
109
|
+
height: 20px;
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: 0;
|
|
112
|
+
left: 0;
|
|
113
|
+
z-index: 20;
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
//# sourceMappingURL=dragging.styles.js.map
|