@deephaven/dashboard 0.42.1-beta.2 → 0.43.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/package.json +10 -10
- package/dist/Dashboard.css +0 -5
- package/dist/Dashboard.css.map +0 -1
- package/dist/Dashboard.js +0 -93
- package/dist/Dashboard.js.map +0 -1
- package/dist/DashboardConstants.js +0 -3
- package/dist/DashboardConstants.js.map +0 -1
- package/dist/DashboardLayout.js +0 -181
- package/dist/DashboardLayout.js.map +0 -1
- package/dist/DashboardPanelWrapper.js +0 -10
- package/dist/DashboardPanelWrapper.js.map +0 -1
- package/dist/DashboardPlugin.js +0 -22
- package/dist/DashboardPlugin.js.map +0 -1
- package/dist/DashboardUtils.js +0 -62
- package/dist/DashboardUtils.js.map +0 -1
- package/dist/PanelErrorBoundary.css +0 -8
- package/dist/PanelErrorBoundary.css.map +0 -1
- package/dist/PanelErrorBoundary.js +0 -55
- package/dist/PanelErrorBoundary.js.map +0 -1
- package/dist/PanelEvent.js +0 -32
- package/dist/PanelEvent.js.map +0 -1
- package/dist/PanelManager.js +0 -255
- package/dist/PanelManager.js.map +0 -1
- package/dist/PanelPlaceholder.css +0 -15
- package/dist/PanelPlaceholder.css.map +0 -1
- package/dist/PanelPlaceholder.js +0 -18
- package/dist/PanelPlaceholder.js.map +0 -1
- package/dist/declaration.d.js +0 -2
- package/dist/declaration.d.js.map +0 -1
- package/dist/index.js +0 -15
- package/dist/index.js.map +0 -1
- package/dist/layout/GLPropTypes.js +0 -37
- package/dist/layout/GLPropTypes.js.map +0 -1
- package/dist/layout/GoldenLayout.css +0 -581
- package/dist/layout/GoldenLayout.css.map +0 -1
- package/dist/layout/LayoutUtils.js +0 -690
- package/dist/layout/LayoutUtils.js.map +0 -1
- package/dist/layout/hooks.js +0 -11
- package/dist/layout/hooks.js.map +0 -1
- package/dist/layout/index.js +0 -5
- package/dist/layout/index.js.map +0 -1
- package/dist/layout/usePanelRegistration.js +0 -23
- package/dist/layout/usePanelRegistration.js.map +0 -1
- package/dist/redux/actionTypes.js +0 -3
- package/dist/redux/actionTypes.js.map +0 -1
- package/dist/redux/actions.js +0 -27
- package/dist/redux/actions.js.map +0 -1
- package/dist/redux/index.js +0 -10
- package/dist/redux/index.js.map +0 -1
- package/dist/redux/reducers/dashboardData.js +0 -7
- package/dist/redux/reducers/dashboardData.js.map +0 -1
- package/dist/redux/reducers/index.js +0 -5
- package/dist/redux/reducers/index.js.map +0 -1
- package/dist/redux/selectors.js +0 -40
- package/dist/redux/selectors.js.map +0 -1
package/dist/PanelEvent.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Events emitted by panels and to control panels
|
|
3
|
-
*/
|
|
4
|
-
export default Object.freeze({
|
|
5
|
-
// Panel has received focus
|
|
6
|
-
FOCUS: 'PanelEvent.FOCUS',
|
|
7
|
-
// Panel has been mounted
|
|
8
|
-
MOUNT: 'PanelEvent.MOUNT',
|
|
9
|
-
// Panel has been unmounted
|
|
10
|
-
UNMOUNT: 'PanelEvent.UNMOUNT',
|
|
11
|
-
// The title of the panel has changed
|
|
12
|
-
TITLE_CHANGED: 'PanelEvent.TITLE_CHANGED',
|
|
13
|
-
// Panel was re-opened from a dehydrated state
|
|
14
|
-
REOPEN: 'PanelEvent.REOPEN',
|
|
15
|
-
// Panel was deleted
|
|
16
|
-
DELETE: 'PanelEvent.DELETE',
|
|
17
|
-
// Panel was cloned/copied
|
|
18
|
-
CLONED: 'PanelEvent.CLONED',
|
|
19
|
-
// Panel was closed
|
|
20
|
-
CLOSED: 'PanelEvent.CLOSED',
|
|
21
|
-
// Event to open a new panel
|
|
22
|
-
// Plugins will need to register to open based on this event.
|
|
23
|
-
// Multiple plugins could open panels for the same event if desired.
|
|
24
|
-
OPEN: 'PanelEvent.OPEN',
|
|
25
|
-
// Event to close a panel that's currently open
|
|
26
|
-
CLOSE: 'PanelEvent.CLOSE',
|
|
27
|
-
// Panel is being dragged
|
|
28
|
-
DRAGGING: 'PanelEvent.DRAGGING',
|
|
29
|
-
// Panel is dropped
|
|
30
|
-
DROPPED: 'PanelEvent.DROPPED'
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=PanelEvent.js.map
|
package/dist/PanelEvent.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PanelEvent.js","names":["Object","freeze","FOCUS","MOUNT","UNMOUNT","TITLE_CHANGED","REOPEN","DELETE","CLONED","CLOSED","OPEN","CLOSE","DRAGGING","DROPPED"],"sources":["../src/PanelEvent.ts"],"sourcesContent":["/**\n * Events emitted by panels and to control panels\n */\nexport default Object.freeze({\n // Panel has received focus\n FOCUS: 'PanelEvent.FOCUS',\n\n // Panel has been mounted\n MOUNT: 'PanelEvent.MOUNT',\n\n // Panel has been unmounted\n UNMOUNT: 'PanelEvent.UNMOUNT',\n\n // The title of the panel has changed\n TITLE_CHANGED: 'PanelEvent.TITLE_CHANGED',\n\n // Panel was re-opened from a dehydrated state\n REOPEN: 'PanelEvent.REOPEN',\n\n // Panel was deleted\n DELETE: 'PanelEvent.DELETE',\n\n // Panel was cloned/copied\n CLONED: 'PanelEvent.CLONED',\n\n // Panel was closed\n CLOSED: 'PanelEvent.CLOSED',\n\n // Event to open a new panel\n // Plugins will need to register to open based on this event.\n // Multiple plugins could open panels for the same event if desired.\n OPEN: 'PanelEvent.OPEN',\n\n // Event to close a panel that's currently open\n CLOSE: 'PanelEvent.CLOSE',\n\n // Panel is being dragged\n DRAGGING: 'PanelEvent.DRAGGING',\n\n // Panel is dropped\n DROPPED: 'PanelEvent.DROPPED',\n});\n"],"mappings":"AAAA;AACA;AACA;AACA,eAAeA,MAAM,CAACC,MAAM,CAAC;EAC3B;EACAC,KAAK,EAAE,kBAAkB;EAEzB;EACAC,KAAK,EAAE,kBAAkB;EAEzB;EACAC,OAAO,EAAE,oBAAoB;EAE7B;EACAC,aAAa,EAAE,0BAA0B;EAEzC;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACA;EACA;EACAC,IAAI,EAAE,iBAAiB;EAEvB;EACAC,KAAK,EAAE,kBAAkB;EAEzB;EACAC,QAAQ,EAAE,qBAAqB;EAE/B;EACAC,OAAO,EAAE;AACX,CAAC,CAAC"}
|
package/dist/PanelManager.js
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
-
import Log from '@deephaven/log';
|
|
7
|
-
import PanelEvent from "./PanelEvent.js";
|
|
8
|
-
import LayoutUtils, { isReactComponentConfig } from "./layout/LayoutUtils.js";
|
|
9
|
-
import { isWrappedComponent } from "./DashboardPlugin.js";
|
|
10
|
-
var log = Log.module('PanelManager');
|
|
11
|
-
/**
|
|
12
|
-
* Class to keep track of which panels are open, have been closed, and also events to close panels.
|
|
13
|
-
*/
|
|
14
|
-
class PanelManager {
|
|
15
|
-
/**
|
|
16
|
-
* @param layout The GoldenLayout object to attach to
|
|
17
|
-
* @param hydrateComponent Function to hydrate a panel from a dehydrated state
|
|
18
|
-
* @param dehydrateComponent Function to dehydrate a panel
|
|
19
|
-
* @param openedMap Map of opened panels
|
|
20
|
-
* @param closed Array of closed panels in a dehydrated state
|
|
21
|
-
* @param onPanelsUpdated Triggered when the panels are updated
|
|
22
|
-
*/
|
|
23
|
-
constructor(layout) {
|
|
24
|
-
var hydrateComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (name, props) => props;
|
|
25
|
-
var dehydrateComponent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (name, config) => config;
|
|
26
|
-
var openedMap = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new Map();
|
|
27
|
-
var closed = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
28
|
-
var onPanelsUpdated = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : () => undefined;
|
|
29
|
-
_defineProperty(this, "layout", void 0);
|
|
30
|
-
_defineProperty(this, "hydrateComponent", void 0);
|
|
31
|
-
_defineProperty(this, "dehydrateComponent", void 0);
|
|
32
|
-
_defineProperty(this, "onPanelsUpdated", void 0);
|
|
33
|
-
_defineProperty(this, "closed", void 0);
|
|
34
|
-
_defineProperty(this, "openedMap", void 0);
|
|
35
|
-
this.handleFocus = this.handleFocus.bind(this);
|
|
36
|
-
this.handleMount = this.handleMount.bind(this);
|
|
37
|
-
// Panel can be unmounted on error but still keep the tab until it's closed
|
|
38
|
-
// Use PanelEvent.MOUNT/UNMOUNT to track open (active) panels
|
|
39
|
-
// and PanelEvent.CLOSED for cleanup (delete links, add panel to closed panels list, etc)
|
|
40
|
-
this.handleUnmount = this.handleUnmount.bind(this);
|
|
41
|
-
this.handleReopen = this.handleReopen.bind(this);
|
|
42
|
-
this.handleDeleted = this.handleDeleted.bind(this);
|
|
43
|
-
this.handleClosed = this.handleClosed.bind(this);
|
|
44
|
-
this.handleControlClose = this.handleControlClose.bind(this);
|
|
45
|
-
this.layout = layout;
|
|
46
|
-
this.hydrateComponent = hydrateComponent;
|
|
47
|
-
this.dehydrateComponent = dehydrateComponent;
|
|
48
|
-
this.onPanelsUpdated = onPanelsUpdated;
|
|
49
|
-
|
|
50
|
-
// Store the opened and closed panels
|
|
51
|
-
this.openedMap = new Map(openedMap);
|
|
52
|
-
|
|
53
|
-
// Closed panels are stored in their dehydrated state
|
|
54
|
-
this.closed = [...closed];
|
|
55
|
-
this.startListening();
|
|
56
|
-
}
|
|
57
|
-
startListening() {
|
|
58
|
-
var {
|
|
59
|
-
eventHub
|
|
60
|
-
} = this.layout;
|
|
61
|
-
eventHub.on(PanelEvent.FOCUS, this.handleFocus);
|
|
62
|
-
eventHub.on(PanelEvent.MOUNT, this.handleMount);
|
|
63
|
-
eventHub.on(PanelEvent.UNMOUNT, this.handleUnmount);
|
|
64
|
-
eventHub.on(PanelEvent.REOPEN, this.handleReopen);
|
|
65
|
-
eventHub.on(PanelEvent.DELETE, this.handleDeleted);
|
|
66
|
-
eventHub.on(PanelEvent.CLOSED, this.handleClosed);
|
|
67
|
-
eventHub.on(PanelEvent.CLOSE, this.handleControlClose);
|
|
68
|
-
// PanelEvent.OPEN should be listened to by plugins to open a panel
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
stopListening() {
|
|
72
|
-
var {
|
|
73
|
-
eventHub
|
|
74
|
-
} = this.layout;
|
|
75
|
-
eventHub.off(PanelEvent.FOCUS, this.handleFocus);
|
|
76
|
-
eventHub.off(PanelEvent.MOUNT, this.handleMount);
|
|
77
|
-
eventHub.off(PanelEvent.UNMOUNT, this.handleUnmount);
|
|
78
|
-
eventHub.off(PanelEvent.REOPEN, this.handleReopen);
|
|
79
|
-
eventHub.off(PanelEvent.DELETE, this.handleDeleted);
|
|
80
|
-
eventHub.off(PanelEvent.CLOSED, this.handleClosed);
|
|
81
|
-
eventHub.off(PanelEvent.CLOSE, this.handleControlClose);
|
|
82
|
-
}
|
|
83
|
-
getClosedPanelConfigsOfType(typeString) {
|
|
84
|
-
return this.closed.filter(panel => panel.component === typeString);
|
|
85
|
-
}
|
|
86
|
-
getOpenedPanels() {
|
|
87
|
-
return Array.from(this.openedMap.values());
|
|
88
|
-
}
|
|
89
|
-
getOpenedPanelConfigs() {
|
|
90
|
-
return this.getOpenedPanels().map(panel => {
|
|
91
|
-
var {
|
|
92
|
-
glContainer
|
|
93
|
-
} = panel.props;
|
|
94
|
-
return LayoutUtils.getComponentConfigFromContainer(glContainer);
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
getOpenedPanelConfigsOfType(typeString) {
|
|
98
|
-
return this.getOpenedPanelConfigs().filter(config => config != null && isReactComponentConfig(config) && config.component === typeString);
|
|
99
|
-
}
|
|
100
|
-
getOpenedPanelById(panelId) {
|
|
101
|
-
return this.openedMap.get(panelId);
|
|
102
|
-
}
|
|
103
|
-
getContainerByPanelId(panelId) {
|
|
104
|
-
var _ref;
|
|
105
|
-
var stack = LayoutUtils.getStackForConfig(this.layout.root, {
|
|
106
|
-
id: panelId
|
|
107
|
-
});
|
|
108
|
-
return (_ref = stack && LayoutUtils.getContentItemInStack(stack, {
|
|
109
|
-
id: panelId
|
|
110
|
-
})) !== null && _ref !== void 0 ? _ref : null;
|
|
111
|
-
}
|
|
112
|
-
getLastUsedPanel(matcher) {
|
|
113
|
-
var opened = this.getOpenedPanels();
|
|
114
|
-
for (var i = opened.length - 1; i >= 0; i -= 1) {
|
|
115
|
-
var _panel = opened[i];
|
|
116
|
-
if (matcher == null || matcher(_panel)) {
|
|
117
|
-
return _panel;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return undefined;
|
|
121
|
-
}
|
|
122
|
-
getLastUsedPanelOfType(type) {
|
|
123
|
-
return this.getLastUsedPanelOfTypes([type]);
|
|
124
|
-
}
|
|
125
|
-
getLastUsedPanelOfTypes(types) {
|
|
126
|
-
return this.getLastUsedPanel(panel => types.some(type => isWrappedComponent(type) && panel instanceof type.WrappedComponent || !isWrappedComponent(type) && panel instanceof type));
|
|
127
|
-
}
|
|
128
|
-
updatePanel(panel) {
|
|
129
|
-
var panelId = LayoutUtils.getIdFromPanel(panel);
|
|
130
|
-
if (panelId == null) {
|
|
131
|
-
log.error('updatePanel Panel did not have an ID', panel);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
log.debug2("Updating panel ID ".concat(panelId, " in open panels map"));
|
|
135
|
-
// Delete the entry before it's set to maintain correct ordering in the open panels map.
|
|
136
|
-
// The last updated (focused) panel should be the last inserted.
|
|
137
|
-
// Deleting the entry from the map directly instead of calling this.removePanel to skip the checks.
|
|
138
|
-
this.openedMap.delete(panelId);
|
|
139
|
-
this.openedMap.set(panelId, panel);
|
|
140
|
-
}
|
|
141
|
-
removePanel(panel) {
|
|
142
|
-
var panelId = LayoutUtils.getIdFromPanel(panel);
|
|
143
|
-
if (panelId == null) {
|
|
144
|
-
log.error('removePanel Panel did not have an ID', panel);
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (!this.openedMap.has(panelId)) {
|
|
148
|
-
log.error("Missing panel ID ".concat(panelId, " in open panels map"));
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
if (this.openedMap.get(panelId) !== panel) {
|
|
152
|
-
// We mount a new panel before un-mounting the existing one
|
|
153
|
-
// when replacing existing panels in openComponent/openComponentInStack.
|
|
154
|
-
// Skip map delete if the panelId entry already refers to the new panel.
|
|
155
|
-
log.debug("Panel argument doesn't match the open panels map entry for ".concat(panelId, ", removePanel ignored"));
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
log.debug2("Removing panel ID ".concat(panelId, " from open panels map"));
|
|
159
|
-
this.openedMap.delete(panelId);
|
|
160
|
-
}
|
|
161
|
-
removeClosedPanelConfig(panelConfig) {
|
|
162
|
-
var index = this.closed.findIndex(closedConfig => closedConfig === panelConfig || closedConfig.id != null && panelConfig.id != null && closedConfig.id === panelConfig.id);
|
|
163
|
-
if (index >= 0) {
|
|
164
|
-
this.closed.splice(index, 1);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
handleFocus(panel) {
|
|
168
|
-
log.debug2('Focus: ', panel);
|
|
169
|
-
this.updatePanel(panel);
|
|
170
|
-
}
|
|
171
|
-
handleMount(panel) {
|
|
172
|
-
log.debug2('Mount: ', panel);
|
|
173
|
-
this.updatePanel(panel);
|
|
174
|
-
this.sendUpdate();
|
|
175
|
-
}
|
|
176
|
-
handleUnmount(panel) {
|
|
177
|
-
log.debug2('Unmount: ', panel);
|
|
178
|
-
this.removePanel(panel);
|
|
179
|
-
this.sendUpdate();
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
*
|
|
184
|
-
* @param panelConfig The config to hydrate and load
|
|
185
|
-
* @param replaceConfig The config to place
|
|
186
|
-
*/
|
|
187
|
-
handleReopen(panelConfig, replaceConfig) {
|
|
188
|
-
log.debug2('Reopen:', panelConfig, replaceConfig);
|
|
189
|
-
this.removeClosedPanelConfig(panelConfig);
|
|
190
|
-
// Don't need to send an update yet, it will get sent when component is mounted
|
|
191
|
-
|
|
192
|
-
// Rehydrate the panel before adding it back
|
|
193
|
-
var {
|
|
194
|
-
component
|
|
195
|
-
} = panelConfig;
|
|
196
|
-
var {
|
|
197
|
-
props
|
|
198
|
-
} = panelConfig;
|
|
199
|
-
props = this.hydrateComponent(component, props);
|
|
200
|
-
var config = _objectSpread(_objectSpread({}, panelConfig), {}, {
|
|
201
|
-
props
|
|
202
|
-
});
|
|
203
|
-
var {
|
|
204
|
-
root
|
|
205
|
-
} = this.layout;
|
|
206
|
-
LayoutUtils.openComponent({
|
|
207
|
-
root,
|
|
208
|
-
config,
|
|
209
|
-
replaceConfig
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
handleDeleted(panelConfig) {
|
|
213
|
-
log.debug2('Deleted:', panelConfig);
|
|
214
|
-
this.removeClosedPanelConfig(panelConfig);
|
|
215
|
-
this.sendUpdate();
|
|
216
|
-
}
|
|
217
|
-
handleClosed(panelId, glContainer) {
|
|
218
|
-
// Panel component should be already unmounted at this point
|
|
219
|
-
// so the emitted event sends the container object instead of the panel.
|
|
220
|
-
log.debug2('Closed: ', panelId);
|
|
221
|
-
this.addClosedPanel(glContainer);
|
|
222
|
-
this.sendUpdate();
|
|
223
|
-
}
|
|
224
|
-
handleControlClose(id) {
|
|
225
|
-
var config = {
|
|
226
|
-
id
|
|
227
|
-
};
|
|
228
|
-
var {
|
|
229
|
-
root
|
|
230
|
-
} = this.layout;
|
|
231
|
-
LayoutUtils.closeComponent(root, config);
|
|
232
|
-
}
|
|
233
|
-
addClosedPanel(glContainer) {
|
|
234
|
-
var config = LayoutUtils.getComponentConfigFromContainer(glContainer);
|
|
235
|
-
if (config && isReactComponentConfig(config)) {
|
|
236
|
-
var dehydratedConfig = this.dehydrateComponent(config.component, config);
|
|
237
|
-
if (dehydratedConfig != null) {
|
|
238
|
-
this.closed.push(dehydratedConfig);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
sendUpdate() {
|
|
243
|
-
var {
|
|
244
|
-
closed,
|
|
245
|
-
openedMap
|
|
246
|
-
} = this;
|
|
247
|
-
this.onPanelsUpdated({
|
|
248
|
-
closed: [...closed],
|
|
249
|
-
openedMap: new Map(openedMap)
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
_defineProperty(PanelManager, "MAX_CLOSED_PANEL_COUNT", 100);
|
|
254
|
-
export default PanelManager;
|
|
255
|
-
//# sourceMappingURL=PanelManager.js.map
|
package/dist/PanelManager.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PanelManager.js","names":["Log","PanelEvent","LayoutUtils","isReactComponentConfig","isWrappedComponent","log","module","PanelManager","constructor","layout","hydrateComponent","name","props","dehydrateComponent","config","openedMap","Map","closed","onPanelsUpdated","undefined","handleFocus","bind","handleMount","handleUnmount","handleReopen","handleDeleted","handleClosed","handleControlClose","startListening","eventHub","on","FOCUS","MOUNT","UNMOUNT","REOPEN","DELETE","CLOSED","CLOSE","stopListening","off","getClosedPanelConfigsOfType","typeString","filter","panel","component","getOpenedPanels","Array","from","values","getOpenedPanelConfigs","map","glContainer","getComponentConfigFromContainer","getOpenedPanelConfigsOfType","getOpenedPanelById","panelId","get","getContainerByPanelId","stack","getStackForConfig","root","id","getContentItemInStack","getLastUsedPanel","matcher","opened","i","length","getLastUsedPanelOfType","type","getLastUsedPanelOfTypes","types","some","WrappedComponent","updatePanel","getIdFromPanel","error","debug2","delete","set","removePanel","has","debug","removeClosedPanelConfig","panelConfig","index","findIndex","closedConfig","splice","sendUpdate","replaceConfig","openComponent","addClosedPanel","closeComponent","dehydratedConfig","push"],"sources":["../src/PanelManager.ts"],"sourcesContent":["import { ComponentType } from 'react';\nimport GoldenLayout from '@deephaven/golden-layout';\nimport type {\n Container,\n ContentItem,\n ItemConfigType,\n ReactComponentConfig,\n} from '@deephaven/golden-layout';\nimport Log from '@deephaven/log';\nimport PanelEvent from './PanelEvent';\nimport LayoutUtils, { isReactComponentConfig } from './layout/LayoutUtils';\nimport {\n isWrappedComponent,\n PanelComponent,\n PanelComponentType,\n PanelProps,\n} from './DashboardPlugin';\n\nconst log = Log.module('PanelManager');\n\nexport type PanelHydraterFunction = (\n name: string,\n props: PanelProps\n) => PanelProps;\n\nexport type PanelDehydraterFunction = (\n name: string,\n config: ReactComponentConfig\n) => ReactComponentConfig;\n\nexport type ClosedPanel = ReactComponentConfig;\n\nexport type ClosedPanels = ClosedPanel[];\n\nexport type OpenedPanelMap = Map<string | string[], PanelComponent>;\n\nexport type PanelsUpdateData = {\n closed: ClosedPanels;\n openedMap: OpenedPanelMap;\n};\n\nexport type PanelsUpdateCallback = (panelUpdateData: PanelsUpdateData) => void;\n\n/**\n * Class to keep track of which panels are open, have been closed, and also events to close panels.\n */\nclass PanelManager {\n static MAX_CLOSED_PANEL_COUNT = 100;\n\n layout: GoldenLayout;\n\n hydrateComponent: PanelHydraterFunction;\n\n dehydrateComponent: PanelDehydraterFunction;\n\n onPanelsUpdated: PanelsUpdateCallback;\n\n closed: ClosedPanels;\n\n openedMap: OpenedPanelMap;\n\n /**\n * @param layout The GoldenLayout object to attach to\n * @param hydrateComponent Function to hydrate a panel from a dehydrated state\n * @param dehydrateComponent Function to dehydrate a panel\n * @param openedMap Map of opened panels\n * @param closed Array of closed panels in a dehydrated state\n * @param onPanelsUpdated Triggered when the panels are updated\n */\n constructor(\n layout: GoldenLayout,\n hydrateComponent: PanelHydraterFunction = (name, props) => props,\n dehydrateComponent: PanelDehydraterFunction = (name, config) => config,\n openedMap: OpenedPanelMap = new Map(),\n closed: ClosedPanel[] = [],\n onPanelsUpdated: PanelsUpdateCallback = () => undefined\n ) {\n this.handleFocus = this.handleFocus.bind(this);\n this.handleMount = this.handleMount.bind(this);\n // Panel can be unmounted on error but still keep the tab until it's closed\n // Use PanelEvent.MOUNT/UNMOUNT to track open (active) panels\n // and PanelEvent.CLOSED for cleanup (delete links, add panel to closed panels list, etc)\n this.handleUnmount = this.handleUnmount.bind(this);\n this.handleReopen = this.handleReopen.bind(this);\n this.handleDeleted = this.handleDeleted.bind(this);\n this.handleClosed = this.handleClosed.bind(this);\n this.handleControlClose = this.handleControlClose.bind(this);\n\n this.layout = layout;\n this.hydrateComponent = hydrateComponent;\n this.dehydrateComponent = dehydrateComponent;\n this.onPanelsUpdated = onPanelsUpdated;\n\n // Store the opened and closed panels\n this.openedMap = new Map(openedMap);\n\n // Closed panels are stored in their dehydrated state\n this.closed = [...closed];\n\n this.startListening();\n }\n\n startListening(): void {\n const { eventHub } = this.layout;\n eventHub.on(PanelEvent.FOCUS, this.handleFocus);\n eventHub.on(PanelEvent.MOUNT, this.handleMount);\n eventHub.on(PanelEvent.UNMOUNT, this.handleUnmount);\n eventHub.on(PanelEvent.REOPEN, this.handleReopen);\n eventHub.on(PanelEvent.DELETE, this.handleDeleted);\n eventHub.on(PanelEvent.CLOSED, this.handleClosed);\n eventHub.on(PanelEvent.CLOSE, this.handleControlClose);\n // PanelEvent.OPEN should be listened to by plugins to open a panel\n }\n\n stopListening(): void {\n const { eventHub } = this.layout;\n eventHub.off(PanelEvent.FOCUS, this.handleFocus);\n eventHub.off(PanelEvent.MOUNT, this.handleMount);\n eventHub.off(PanelEvent.UNMOUNT, this.handleUnmount);\n eventHub.off(PanelEvent.REOPEN, this.handleReopen);\n eventHub.off(PanelEvent.DELETE, this.handleDeleted);\n eventHub.off(PanelEvent.CLOSED, this.handleClosed);\n eventHub.off(PanelEvent.CLOSE, this.handleControlClose);\n }\n\n getClosedPanelConfigsOfType(typeString: string): ClosedPanels {\n return this.closed.filter(panel => panel.component === typeString);\n }\n\n getOpenedPanels(): PanelComponent[] {\n return Array.from(this.openedMap.values());\n }\n\n getOpenedPanelConfigs(): (ItemConfigType | null)[] {\n return this.getOpenedPanels().map(panel => {\n const { glContainer } = panel.props;\n return LayoutUtils.getComponentConfigFromContainer(glContainer);\n });\n }\n\n getOpenedPanelConfigsOfType(typeString: string): ReactComponentConfig[] {\n return this.getOpenedPanelConfigs().filter(\n config =>\n config != null &&\n isReactComponentConfig(config) &&\n config.component === typeString\n ) as ReactComponentConfig[];\n }\n\n getOpenedPanelById(panelId: string | string[]): PanelComponent | undefined {\n return this.openedMap.get(panelId);\n }\n\n getContainerByPanelId(panelId: string | string[]): ContentItem | null {\n const stack = LayoutUtils.getStackForConfig(this.layout.root, {\n id: panelId,\n });\n return (\n (stack && LayoutUtils.getContentItemInStack(stack, { id: panelId })) ??\n null\n );\n }\n\n getLastUsedPanel<T extends PanelComponent = PanelComponent>(\n matcher: (panel: PanelComponent) => boolean\n ): T | undefined {\n const opened = this.getOpenedPanels();\n for (let i = opened.length - 1; i >= 0; i -= 1) {\n const panel = opened[i];\n if (matcher == null || matcher(panel)) {\n return panel as T;\n }\n }\n\n return undefined;\n }\n\n getLastUsedPanelOfType<\n P extends PanelProps = PanelProps,\n C extends ComponentType<P> = ComponentType<P>\n >(type: PanelComponentType<P, C>): PanelComponent<P> | undefined {\n return this.getLastUsedPanelOfTypes([type]);\n }\n\n getLastUsedPanelOfTypes<\n P extends PanelProps = PanelProps,\n C extends ComponentType<P> = ComponentType<P>\n >(types: PanelComponentType<P, C>[]): PanelComponent<P> | undefined {\n return this.getLastUsedPanel(panel =>\n types.some(\n type =>\n (isWrappedComponent(type) &&\n panel instanceof type.WrappedComponent) ||\n (!isWrappedComponent(type) && panel instanceof type)\n )\n );\n }\n\n updatePanel(panel: PanelComponent): void {\n const panelId = LayoutUtils.getIdFromPanel(panel);\n if (panelId == null) {\n log.error('updatePanel Panel did not have an ID', panel);\n return;\n }\n log.debug2(`Updating panel ID ${panelId} in open panels map`);\n // Delete the entry before it's set to maintain correct ordering in the open panels map.\n // The last updated (focused) panel should be the last inserted.\n // Deleting the entry from the map directly instead of calling this.removePanel to skip the checks.\n this.openedMap.delete(panelId);\n this.openedMap.set(panelId, panel);\n }\n\n removePanel(panel: PanelComponent): void {\n const panelId = LayoutUtils.getIdFromPanel(panel);\n if (panelId == null) {\n log.error('removePanel Panel did not have an ID', panel);\n return;\n }\n if (!this.openedMap.has(panelId)) {\n log.error(`Missing panel ID ${panelId} in open panels map`);\n return;\n }\n if (this.openedMap.get(panelId) !== panel) {\n // We mount a new panel before un-mounting the existing one\n // when replacing existing panels in openComponent/openComponentInStack.\n // Skip map delete if the panelId entry already refers to the new panel.\n log.debug(\n `Panel argument doesn't match the open panels map entry for ${panelId}, removePanel ignored`\n );\n return;\n }\n log.debug2(`Removing panel ID ${panelId} from open panels map`);\n this.openedMap.delete(panelId);\n }\n\n removeClosedPanelConfig(panelConfig: ClosedPanel): void {\n const index = this.closed.findIndex(\n closedConfig =>\n closedConfig === panelConfig ||\n (closedConfig.id != null &&\n panelConfig.id != null &&\n closedConfig.id === panelConfig.id)\n );\n if (index >= 0) {\n this.closed.splice(index, 1);\n }\n }\n\n handleFocus(panel: PanelComponent): void {\n log.debug2('Focus: ', panel);\n this.updatePanel(panel);\n }\n\n handleMount(panel: PanelComponent): void {\n log.debug2('Mount: ', panel);\n this.updatePanel(panel);\n this.sendUpdate();\n }\n\n handleUnmount(panel: PanelComponent): void {\n log.debug2('Unmount: ', panel);\n this.removePanel(panel);\n this.sendUpdate();\n }\n\n /**\n *\n * @param panelConfig The config to hydrate and load\n * @param replaceConfig The config to place\n */\n handleReopen(\n panelConfig: ClosedPanel,\n replaceConfig?: Partial<ItemConfigType>\n ): void {\n log.debug2('Reopen:', panelConfig, replaceConfig);\n\n this.removeClosedPanelConfig(panelConfig);\n // Don't need to send an update yet, it will get sent when component is mounted\n\n // Rehydrate the panel before adding it back\n const { component } = panelConfig;\n let { props } = panelConfig;\n props = this.hydrateComponent(component, props);\n\n const config = {\n ...panelConfig,\n props,\n };\n\n const { root } = this.layout;\n LayoutUtils.openComponent({ root, config, replaceConfig });\n }\n\n handleDeleted(panelConfig: ClosedPanel): void {\n log.debug2('Deleted:', panelConfig);\n\n this.removeClosedPanelConfig(panelConfig);\n\n this.sendUpdate();\n }\n\n handleClosed(panelId: string, glContainer: Container): void {\n // Panel component should be already unmounted at this point\n // so the emitted event sends the container object instead of the panel.\n log.debug2('Closed: ', panelId);\n this.addClosedPanel(glContainer);\n this.sendUpdate();\n }\n\n handleControlClose(id: string): void {\n const config = { id };\n const { root } = this.layout;\n LayoutUtils.closeComponent(root, config);\n }\n\n addClosedPanel(glContainer: Container): void {\n const config = LayoutUtils.getComponentConfigFromContainer(glContainer);\n if (config && isReactComponentConfig(config)) {\n const dehydratedConfig = this.dehydrateComponent(\n config.component,\n config\n );\n if (dehydratedConfig != null) {\n this.closed.push(dehydratedConfig);\n }\n }\n }\n\n sendUpdate(): void {\n const { closed, openedMap } = this;\n this.onPanelsUpdated({\n closed: [...closed],\n openedMap: new Map(openedMap),\n });\n }\n}\n\nexport default PanelManager;\n"],"mappings":";;;;;AAQA,OAAOA,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,UAAU;AAAA,OACVC,WAAW,IAAIC,sBAAsB;AAAA,SAE1CC,kBAAkB;AAMpB,IAAMC,GAAG,GAAGL,GAAG,CAACM,MAAM,CAAC,cAAc,CAAC;AAyBtC;AACA;AACA;AACA,MAAMC,YAAY,CAAC;EAejB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAW,CACTC,MAAoB,EAMpB;IAAA,IALAC,gBAAuC,uEAAG,CAACC,IAAI,EAAEC,KAAK,KAAKA,KAAK;IAAA,IAChEC,kBAA2C,uEAAG,CAACF,IAAI,EAAEG,MAAM,KAAKA,MAAM;IAAA,IACtEC,SAAyB,uEAAG,IAAIC,GAAG,EAAE;IAAA,IACrCC,MAAqB,uEAAG,EAAE;IAAA,IAC1BC,eAAqC,uEAAG,MAAMC,SAAS;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAEvD,IAAI,CAACC,WAAW,GAAG,IAAI,CAACA,WAAW,CAACC,IAAI,CAAC,IAAI,CAAC;IAC9C,IAAI,CAACC,WAAW,GAAG,IAAI,CAACA,WAAW,CAACD,IAAI,CAAC,IAAI,CAAC;IAC9C;IACA;IACA;IACA,IAAI,CAACE,aAAa,GAAG,IAAI,CAACA,aAAa,CAACF,IAAI,CAAC,IAAI,CAAC;IAClD,IAAI,CAACG,YAAY,GAAG,IAAI,CAACA,YAAY,CAACH,IAAI,CAAC,IAAI,CAAC;IAChD,IAAI,CAACI,aAAa,GAAG,IAAI,CAACA,aAAa,CAACJ,IAAI,CAAC,IAAI,CAAC;IAClD,IAAI,CAACK,YAAY,GAAG,IAAI,CAACA,YAAY,CAACL,IA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;AACF;AAAC,gBAjSKR,YAAY,4BACgB,GAAG;AAkSrC,eAAeA,YAAY"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* stylelint-disable scss/at-import-no-partial-leading-underscore */
|
|
2
|
-
.panel-placeholder {
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
min-height: 100%;
|
|
7
|
-
max-height: 100%;
|
|
8
|
-
text-align: center;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
}
|
|
11
|
-
.panel-placeholder div {
|
|
12
|
-
padding: 1rem;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/*# sourceMappingURL=PanelPlaceholder.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../src/PanelPlaceholder.scss","../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;ACEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE,SCTO","file":"PanelPlaceholder.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","@import '@deephaven/components/scss/custom.scss';\n\n.panel-placeholder {\n display: flex;\n flex-direction: column;\n justify-content: center;\n min-height: 100%;\n max-height: 100%;\n text-align: center;\n overflow: hidden;\n\n // add padding on an inner wrapper so it is included in max height of parent\n div {\n padding: $spacer-3;\n }\n}\n","//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size: $ant-size $ant-thickness, $ant-size $ant-thickness,\n $ant-thickness $ant-size, $ant-thickness $ant-size;\n background-position: 0 top, 0 bottom, left 0, right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 0.12;\n$hover-bg-transparency: 0.14;\n$active-bg-transparency: 0.28;\n$exception-transparency: 0.13;\n"]}
|
package/dist/PanelPlaceholder.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import "./PanelPlaceholder.css";
|
|
3
|
-
import LayoutUtils from "./layout/LayoutUtils.js";
|
|
4
|
-
/**
|
|
5
|
-
* Displays a placeholder for unregistered panel types.
|
|
6
|
-
*/
|
|
7
|
-
var PanelPlaceholder = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
8
|
-
var component = LayoutUtils.getComponentNameFromPanel({
|
|
9
|
-
props
|
|
10
|
-
});
|
|
11
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
ref: ref,
|
|
13
|
-
className: "panel-placeholder"
|
|
14
|
-
}, /*#__PURE__*/React.createElement("div", null, "Component \"", component, "\" is not registered."));
|
|
15
|
-
});
|
|
16
|
-
PanelPlaceholder.displayName = 'PanelPlaceholder';
|
|
17
|
-
export default PanelPlaceholder;
|
|
18
|
-
//# sourceMappingURL=PanelPlaceholder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PanelPlaceholder.js","names":["React","LayoutUtils","PanelPlaceholder","forwardRef","props","ref","component","getComponentNameFromPanel","displayName"],"sources":["../src/PanelPlaceholder.tsx"],"sourcesContent":["import React, { ForwardedRef } from 'react';\nimport './PanelPlaceholder.scss';\nimport LayoutUtils from './layout/LayoutUtils';\nimport { PanelProps } from './DashboardPlugin';\n\n/**\n * Displays a placeholder for unregistered panel types.\n */\nconst PanelPlaceholder = React.forwardRef(\n (props: PanelProps, ref: ForwardedRef<HTMLDivElement>) => {\n const component = LayoutUtils.getComponentNameFromPanel({ props });\n return (\n <div ref={ref} className=\"panel-placeholder\">\n <div>Component "{component}" is not registered.</div>\n </div>\n );\n }\n);\n\nPanelPlaceholder.displayName = 'PanelPlaceholder';\n\nexport default PanelPlaceholder;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAwB,OAAO;AAAC;AAAA,OAErCC,WAAW;AAGlB;AACA;AACA;AACA,IAAMC,gBAAgB,gBAAGF,KAAK,CAACG,UAAU,CACvC,CAACC,KAAiB,EAAEC,GAAiC,KAAK;EACxD,IAAMC,SAAS,GAAGL,WAAW,CAACM,yBAAyB,CAAC;IAAEH;EAAM,CAAC,CAAC;EAClE,oBACE;IAAK,GAAG,EAAEC,GAAI;IAAC,SAAS,EAAC;EAAmB,gBAC1C,iCAAK,cAAgB,EAACC,SAAS,EAAC,uBAAyB,CAAM,CAC3D;AAEV,CAAC,CACF;AAEDJ,gBAAgB,CAACM,WAAW,GAAG,kBAAkB;AAEjD,eAAeN,gBAAgB"}
|
package/dist/declaration.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"declaration.d.js","names":[],"sources":["../src/declaration.d.ts"],"sourcesContent":["declare module '*.module.scss' {\n const content: Record<string, string>;\n export default content;\n}\n\ndeclare module '*.scss';\n"],"mappings":""}
|
package/dist/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import Dashboard from "./Dashboard.js";
|
|
2
|
-
export default Dashboard;
|
|
3
|
-
export * from "./Dashboard.js";
|
|
4
|
-
export * from "./DashboardConstants.js";
|
|
5
|
-
export * from "./DashboardPlugin.js";
|
|
6
|
-
export * from "./DashboardLayout.js";
|
|
7
|
-
export * from "./DashboardUtils.js";
|
|
8
|
-
export { default as DashboardUtils } from "./DashboardUtils.js";
|
|
9
|
-
export * from "./layout/index.js";
|
|
10
|
-
export * from "./redux/index.js";
|
|
11
|
-
export * from "./PanelManager.js";
|
|
12
|
-
export { default as PanelEvent } from "./PanelEvent.js";
|
|
13
|
-
export { default as PanelErrorBoundary } from "./PanelErrorBoundary.js";
|
|
14
|
-
export { default as PanelManager } from "./PanelManager.js";
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Dashboard","default","DashboardUtils","PanelEvent","PanelErrorBoundary","PanelManager"],"sources":["../src/index.ts"],"sourcesContent":["import Dashboard from './Dashboard';\n\nexport default Dashboard;\n\nexport * from './Dashboard';\nexport * from './DashboardConstants';\nexport * from './DashboardPlugin';\nexport * from './DashboardLayout';\nexport * from './DashboardUtils';\nexport { default as DashboardUtils } from './DashboardUtils';\nexport * from './layout';\nexport * from './redux';\nexport * from './PanelManager';\nexport { default as PanelEvent } from './PanelEvent';\nexport { default as PanelErrorBoundary } from './PanelErrorBoundary';\nexport { default as PanelManager } from './PanelManager';\n"],"mappings":"OAAOA,SAAS;AAEhB,eAAeA,SAAS;AAAC;AAAA;AAAA;AAAA;AAAA;AAAA,SAOhBC,OAAO,IAAIC,cAAc;AAAA;AAAA;AAAA;AAAA,SAIzBD,OAAO,IAAIE,UAAU;AAAA,SACrBF,OAAO,IAAIG,kBAAkB;AAAA,SAC7BH,OAAO,IAAII,YAAY"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
var Container = PropTypes.shape({
|
|
3
|
-
on: PropTypes.func,
|
|
4
|
-
off: PropTypes.func,
|
|
5
|
-
isHidden: PropTypes.bool,
|
|
6
|
-
tab: PropTypes.shape({
|
|
7
|
-
header: PropTypes.shape({
|
|
8
|
-
tabs: PropTypes.arrayOf(PropTypes.shape({
|
|
9
|
-
contentItem: PropTypes.shape({})
|
|
10
|
-
}))
|
|
11
|
-
})
|
|
12
|
-
}),
|
|
13
|
-
title: PropTypes.string,
|
|
14
|
-
setTitle: PropTypes.func,
|
|
15
|
-
close: PropTypes.func
|
|
16
|
-
});
|
|
17
|
-
var EventHub = PropTypes.shape({
|
|
18
|
-
on: PropTypes.func,
|
|
19
|
-
off: PropTypes.func,
|
|
20
|
-
emit: PropTypes.func
|
|
21
|
-
});
|
|
22
|
-
var Layout = PropTypes.shape({
|
|
23
|
-
registerComponent: PropTypes.func,
|
|
24
|
-
root: PropTypes.shape({
|
|
25
|
-
addChild: PropTypes.func
|
|
26
|
-
}),
|
|
27
|
-
on: PropTypes.func,
|
|
28
|
-
off: PropTypes.func,
|
|
29
|
-
eventHub: EventHub
|
|
30
|
-
});
|
|
31
|
-
var GLPropTypes = Object.freeze({
|
|
32
|
-
Container,
|
|
33
|
-
EventHub,
|
|
34
|
-
Layout
|
|
35
|
-
});
|
|
36
|
-
export default GLPropTypes;
|
|
37
|
-
//# sourceMappingURL=GLPropTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GLPropTypes.js","names":["PropTypes","Container","shape","on","func","off","isHidden","bool","tab","header","tabs","arrayOf","contentItem","title","string","setTitle","close","EventHub","emit","Layout","registerComponent","root","addChild","eventHub","GLPropTypes","Object","freeze"],"sources":["../../src/layout/GLPropTypes.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst Container = PropTypes.shape({\n on: PropTypes.func,\n off: PropTypes.func,\n isHidden: PropTypes.bool,\n tab: PropTypes.shape({\n header: PropTypes.shape({\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n contentItem: PropTypes.shape({}),\n })\n ),\n }),\n }),\n title: PropTypes.string,\n setTitle: PropTypes.func,\n close: PropTypes.func,\n});\n\nconst EventHub = PropTypes.shape({\n on: PropTypes.func,\n off: PropTypes.func,\n emit: PropTypes.func,\n});\n\nconst Layout = PropTypes.shape({\n registerComponent: PropTypes.func,\n root: PropTypes.shape({ addChild: PropTypes.func }),\n on: PropTypes.func,\n off: PropTypes.func,\n eventHub: EventHub,\n});\n\nconst GLPropTypes = Object.freeze({ Container, EventHub, Layout });\n\nexport default GLPropTypes;\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,IAAMC,SAAS,GAAGD,SAAS,CAACE,KAAK,CAAC;EAChCC,EAAE,EAAEH,SAAS,CAACI,IAAI;EAClBC,GAAG,EAAEL,SAAS,CAACI,IAAI;EACnBE,QAAQ,EAAEN,SAAS,CAACO,IAAI;EACxBC,GAAG,EAAER,SAAS,CAACE,KAAK,CAAC;IACnBO,MAAM,EAAET,SAAS,CAACE,KAAK,CAAC;MACtBQ,IAAI,EAAEV,SAAS,CAACW,OAAO,CACrBX,SAAS,CAACE,KAAK,CAAC;QACdU,WAAW,EAAEZ,SAAS,CAACE,KAAK,CAAC,CAAC,CAAC;MACjC,CAAC,CAAC;IAEN,CAAC;EACH,CAAC,CAAC;EACFW,KAAK,EAAEb,SAAS,CAACc,MAAM;EACvBC,QAAQ,EAAEf,SAAS,CAACI,IAAI;EACxBY,KAAK,EAAEhB,SAA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