@deephaven/golden-layout 0.17.1-beta.2 → 0.17.1-beta.4
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/LayoutManager.js +1140 -0
- package/dist/LayoutManager.js.map +1 -0
- package/dist/base.js +16 -0
- package/dist/base.js.map +1 -0
- package/dist/config/ItemDefaultConfig.js +8 -0
- package/dist/config/ItemDefaultConfig.js.map +1 -0
- package/dist/config/defaultConfig.js +42 -0
- package/dist/config/defaultConfig.js.map +1 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/container/ItemContainer.js +192 -0
- package/dist/container/ItemContainer.js.map +1 -0
- package/dist/container/index.js +5 -0
- package/dist/container/index.js.map +1 -0
- package/dist/controls/BrowserPopout.js +260 -0
- package/dist/controls/BrowserPopout.js.map +1 -0
- package/dist/controls/DragProxy.js +236 -0
- package/dist/controls/DragProxy.js.map +1 -0
- package/dist/controls/DragSource.js +60 -0
- package/dist/controls/DragSource.js.map +1 -0
- package/dist/controls/DragSourceFromEvent.js +75 -0
- package/dist/controls/DragSourceFromEvent.js.map +1 -0
- package/dist/controls/DropTargetIndicator.js +28 -0
- package/dist/controls/DropTargetIndicator.js.map +1 -0
- package/dist/controls/Header.js +698 -0
- package/dist/controls/Header.js.map +1 -0
- package/dist/controls/HeaderButton.js +23 -0
- package/dist/controls/HeaderButton.js.map +1 -0
- package/dist/controls/Splitter.js +45 -0
- package/dist/controls/Splitter.js.map +1 -0
- package/dist/controls/Tab.js +259 -0
- package/dist/controls/Tab.js.map +1 -0
- package/dist/controls/TransitionIndicator.js +64 -0
- package/dist/controls/TransitionIndicator.js.map +1 -0
- package/dist/controls/index.js +23 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/errors/ConfigurationError.js +10 -0
- package/dist/errors/ConfigurationError.js.map +1 -0
- package/dist/errors/index.js +5 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/items/AbstractContentItem.js +617 -0
- package/dist/items/AbstractContentItem.js.map +1 -0
- package/dist/items/Component.js +84 -0
- package/dist/items/Component.js.map +1 -0
- package/dist/items/Root.js +93 -0
- package/dist/items/Root.js.map +1 -0
- package/dist/items/RowOrColumn.js +550 -0
- package/dist/items/RowOrColumn.js.map +1 -0
- package/dist/items/Stack.js +498 -0
- package/dist/items/Stack.js.map +1 -0
- package/dist/items/index.js +13 -0
- package/dist/items/index.js.map +1 -0
- package/dist/utils/BubblingEvent.js +12 -0
- package/dist/utils/BubblingEvent.js.map +1 -0
- package/dist/utils/ConfigMinifier.js +160 -0
- package/dist/utils/ConfigMinifier.js.map +1 -0
- package/dist/utils/DragListener.js +128 -0
- package/dist/utils/DragListener.js.map +1 -0
- package/dist/utils/EventEmitter.js +133 -0
- package/dist/utils/EventEmitter.js.map +1 -0
- package/dist/utils/EventHub.js +147 -0
- package/dist/utils/EventHub.js.map +1 -0
- package/dist/utils/ReactComponentHandler.js +135 -0
- package/dist/utils/ReactComponentHandler.js.map +1 -0
- package/dist/utils/index.js +22 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/utils.js +195 -0
- package/dist/utils/utils.js.map +1 -0
- package/package.json +20 -47
- package/dist/goldenlayout.js +0 -6314
- package/dist/goldenlayout.min.js +0 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import $ from 'jquery';
|
|
4
|
+
import utils from './utils.js';
|
|
5
|
+
/**
|
|
6
|
+
* A specialised GoldenLayout component that binds GoldenLayout container
|
|
7
|
+
* lifecycle events to react components
|
|
8
|
+
*
|
|
9
|
+
* @constructor
|
|
10
|
+
*
|
|
11
|
+
* @param {lm.container.ItemContainer} container
|
|
12
|
+
* @param {Object} state state is not required for react components
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var ReactComponentHandler = function ReactComponentHandler(container, state) {
|
|
16
|
+
this._reactComponent = null;
|
|
17
|
+
this._originalComponentWillUpdate = null;
|
|
18
|
+
this._container = container;
|
|
19
|
+
this._initialState = state;
|
|
20
|
+
this._reactClass = this._getReactClass();
|
|
21
|
+
|
|
22
|
+
this._container.on('open', this._render, this);
|
|
23
|
+
|
|
24
|
+
this._container.on('destroy', this._destroy, this);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
utils.copy(ReactComponentHandler.prototype, {
|
|
28
|
+
/**
|
|
29
|
+
* Creates the react class and component and hydrates it with
|
|
30
|
+
* the initial state - if one is present
|
|
31
|
+
*
|
|
32
|
+
* By default, react's getInitialState will be used
|
|
33
|
+
*
|
|
34
|
+
* @private
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
_render: function _render() {
|
|
38
|
+
ReactDOM.render(this._getReactComponent(), this._container.getElement()[0]);
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Fired by react when the component is created.
|
|
43
|
+
* <p>
|
|
44
|
+
* Note: This callback is used instead of the return from `ReactDOM.render` because
|
|
45
|
+
* of https://github.com/facebook/react/issues/10309.
|
|
46
|
+
* </p>
|
|
47
|
+
*
|
|
48
|
+
* @private
|
|
49
|
+
* @arg {React.Ref} component The component instance created by the `ReactDOM.render` call in the `_render` method.
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
_gotReactComponent: function _gotReactComponent(component) {
|
|
53
|
+
if (!component) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
this._reactComponent = component;
|
|
58
|
+
|
|
59
|
+
this._originalComponentWillUpdate = this._reactComponent.componentWillUpdate || function () {};
|
|
60
|
+
|
|
61
|
+
this._reactComponent.componentWillUpdate = this._onUpdate.bind(this);
|
|
62
|
+
|
|
63
|
+
if (this._container.getState()) {
|
|
64
|
+
this._reactComponent.setState(this._container.getState());
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Removes the component from the DOM and thus invokes React's unmount lifecycle
|
|
70
|
+
*
|
|
71
|
+
* @private
|
|
72
|
+
* @returns {void}
|
|
73
|
+
*/
|
|
74
|
+
_destroy: function _destroy() {
|
|
75
|
+
ReactDOM.unmountComponentAtNode(this._container.getElement()[0]);
|
|
76
|
+
|
|
77
|
+
this._container.off('open', this._render, this);
|
|
78
|
+
|
|
79
|
+
this._container.off('destroy', this._destroy, this);
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Hooks into React's state management and applies the componentstate
|
|
84
|
+
* to GoldenLayout
|
|
85
|
+
*
|
|
86
|
+
* @private
|
|
87
|
+
* @returns {void}
|
|
88
|
+
*/
|
|
89
|
+
_onUpdate: function _onUpdate(nextProps, nextState) {
|
|
90
|
+
this._container.setState(nextState);
|
|
91
|
+
|
|
92
|
+
this._originalComponentWillUpdate.call(this._reactComponent, nextProps, nextState);
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Retrieves the react class from GoldenLayout's registry
|
|
97
|
+
*
|
|
98
|
+
* @private
|
|
99
|
+
* @returns {React.Class}
|
|
100
|
+
*/
|
|
101
|
+
_getReactClass: function _getReactClass() {
|
|
102
|
+
var componentName = this._container._config.component;
|
|
103
|
+
var reactClass;
|
|
104
|
+
|
|
105
|
+
if (!componentName) {
|
|
106
|
+
throw new Error('No react component name. type: react-component needs a field `component`');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
reactClass = this._container.layoutManager.getComponent(componentName) || this._container.layoutManager.getFallbackComponent();
|
|
110
|
+
|
|
111
|
+
if (!reactClass) {
|
|
112
|
+
throw new Error('React component "' + componentName + '" not found. ' + 'Please register all components with GoldenLayout using `registerComponent(name, component)`');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return reactClass;
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Copies and extends the properties array and returns the React element
|
|
120
|
+
*
|
|
121
|
+
* @private
|
|
122
|
+
* @returns {React.Element}
|
|
123
|
+
*/
|
|
124
|
+
_getReactComponent: function _getReactComponent() {
|
|
125
|
+
var defaultProps = {
|
|
126
|
+
glEventHub: this._container.layoutManager.eventHub,
|
|
127
|
+
glContainer: this._container,
|
|
128
|
+
ref: this._gotReactComponent.bind(this)
|
|
129
|
+
};
|
|
130
|
+
var props = $.extend(defaultProps, this._container._config.props);
|
|
131
|
+
return /*#__PURE__*/React.createElement(this._reactClass, props);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
export default ReactComponentHandler;
|
|
135
|
+
//# sourceMappingURL=ReactComponentHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactComponentHandler.js","names":["React","ReactDOM","$","utils","ReactComponentHandler","container","state","_reactComponent","_originalComponentWillUpdate","_container","_initialState","_reactClass","_getReactClass","on","_render","_destroy","copy","prototype","render","_getReactComponent","getElement","_gotReactComponent","component","componentWillUpdate","_onUpdate","bind","getState","setState","unmountComponentAtNode","off","nextProps","nextState","call","componentName","_config","reactClass","Error","layoutManager","getComponent","getFallbackComponent","defaultProps","glEventHub","eventHub","glContainer","ref","props","extend","createElement"],"sources":["../../src/utils/ReactComponentHandler.js"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport $ from 'jquery';\nimport utils from './utils.js';\n\n/**\n * A specialised GoldenLayout component that binds GoldenLayout container\n * lifecycle events to react components\n *\n * @constructor\n *\n * @param {lm.container.ItemContainer} container\n * @param {Object} state state is not required for react components\n */\nconst ReactComponentHandler = function (container, state) {\n this._reactComponent = null;\n this._originalComponentWillUpdate = null;\n this._container = container;\n this._initialState = state;\n this._reactClass = this._getReactClass();\n this._container.on('open', this._render, this);\n this._container.on('destroy', this._destroy, this);\n};\n\nutils.copy(ReactComponentHandler.prototype, {\n /**\n * Creates the react class and component and hydrates it with\n * the initial state - if one is present\n *\n * By default, react's getInitialState will be used\n *\n * @private\n * @returns {void}\n */\n _render: function () {\n ReactDOM.render(this._getReactComponent(), this._container.getElement()[0]);\n },\n\n /**\n * Fired by react when the component is created.\n * <p>\n * Note: This callback is used instead of the return from `ReactDOM.render` because\n *\t of https://github.com/facebook/react/issues/10309.\n * </p>\n *\n * @private\n * @arg {React.Ref} component The component instance created by the `ReactDOM.render` call in the `_render` method.\n * @returns {void}\n */\n _gotReactComponent: function (component) {\n if (!component) {\n return;\n }\n\n this._reactComponent = component;\n this._originalComponentWillUpdate =\n this._reactComponent.componentWillUpdate || function () {};\n this._reactComponent.componentWillUpdate = this._onUpdate.bind(this);\n if (this._container.getState()) {\n this._reactComponent.setState(this._container.getState());\n }\n },\n\n /**\n * Removes the component from the DOM and thus invokes React's unmount lifecycle\n *\n * @private\n * @returns {void}\n */\n _destroy: function () {\n ReactDOM.unmountComponentAtNode(this._container.getElement()[0]);\n this._container.off('open', this._render, this);\n this._container.off('destroy', this._destroy, this);\n },\n\n /**\n * Hooks into React's state management and applies the componentstate\n * to GoldenLayout\n *\n * @private\n * @returns {void}\n */\n _onUpdate: function (nextProps, nextState) {\n this._container.setState(nextState);\n this._originalComponentWillUpdate.call(\n this._reactComponent,\n nextProps,\n nextState\n );\n },\n\n /**\n * Retrieves the react class from GoldenLayout's registry\n *\n * @private\n * @returns {React.Class}\n */\n _getReactClass: function () {\n var componentName = this._container._config.component;\n var reactClass;\n\n if (!componentName) {\n throw new Error(\n 'No react component name. type: react-component needs a field `component`'\n );\n }\n\n reactClass =\n this._container.layoutManager.getComponent(componentName) ||\n this._container.layoutManager.getFallbackComponent();\n\n if (!reactClass) {\n throw new Error(\n 'React component \"' +\n componentName +\n '\" not found. ' +\n 'Please register all components with GoldenLayout using `registerComponent(name, component)`'\n );\n }\n\n return reactClass;\n },\n\n /**\n * Copies and extends the properties array and returns the React element\n *\n * @private\n * @returns {React.Element}\n */\n _getReactComponent: function () {\n var defaultProps = {\n glEventHub: this._container.layoutManager.eventHub,\n glContainer: this._container,\n ref: this._gotReactComponent.bind(this),\n };\n var props = $.extend(defaultProps, this._container._config.props);\n return React.createElement(this._reactClass, props);\n },\n});\n\nexport default ReactComponentHandler;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,QAAP,MAAqB,WAArB;AACA,OAAOC,CAAP,MAAc,QAAd;AACA,OAAOC,KAAP,MAAkB,YAAlB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAwB,CAAUC,SAAV,EAAqBC,KAArB,EAA4B;EACxD,KAAKC,eAAL,GAAuB,IAAvB;EACA,KAAKC,4BAAL,GAAoC,IAApC;EACA,KAAKC,UAAL,GAAkBJ,SAAlB;EACA,KAAKK,aAAL,GAAqBJ,KAArB;EACA,KAAKK,WAAL,GAAmB,KAAKC,cAAL,EAAnB;;EACA,KAAKH,UAAL,CAAgBI,EAAhB,CAAmB,MAAnB,EAA2B,KAAKC,OAAhC,EAAyC,IAAzC;;EACA,KAAKL,UAAL,CAAgBI,EAAhB,CAAmB,SAAnB,EAA8B,KAAKE,QAAnC,EAA6C,IAA7C;AACD,CARD;;AAUAZ,KAAK,CAACa,IAAN,CAAWZ,qBAAqB,CAACa,SAAjC,EAA4C;EAC1C;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEH,OAAO,EAAE,mBAAY;IACnBb,QAAQ,CAACiB,MAAT,CAAgB,KAAKC,kBAAL,EAAhB,EAA2C,KAAKV,UAAL,CAAgBW,UAAhB,GAA6B,CAA7B,CAA3C;EACD,CAZyC;;EAc1C;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,kBAAkB,EAAE,4BAAUC,SAAV,EAAqB;IACvC,IAAI,CAACA,SAAL,EAAgB;MACd;IACD;;IAED,KAAKf,eAAL,GAAuBe,SAAvB;;IACA,KAAKd,4BAAL,GACE,KAAKD,eAAL,CAAqBgB,mBAArB,IAA4C,YAAY,CAA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,UAAL,EAAiB;MACf,MAAM,IAAIC,KAAJ,CACJ,sBACEH,aADF,GAEE,eAFF,GAGE,6FAJE,CAAN;IAMD;;IAED,OAAOE,UAAP;EACD,CAjGyC;;EAmG1C;AACF;AACA;AACA;AACA;AACA;EACEhB,kBAAkB,EAAE,8BAAY;IAC9B,IAAIqB,YAAY,GAAG;MACjBC,UAAU,EAAE,KAAKhC,UAAL,CAAgB4B,aAAhB,CAA8BK,QADzB;MAEjBC,WAAW,EAAE,KAAKlC,UAFD;MAGjBmC,GAAG,EAAE,KAAKvB,kBAAL,CAAwBI,IAAxB,CAA6B,IAA7B;IAHY,CAAnB;IAKA,IAAIoB,KAAK,GAAG3C,CAAC,CAAC4C,MAAF,CAASN,YAAT,EAAuB,KAAK/B,UAAL,CAAgByB,OAAhB,CAAwBW,KAA/C,CAAZ;IACA,oBAAO7C,KAAK,CAAC+C,aAAN,CAAoB,KAAKpC,WAAzB,EAAsCkC,KAAtC,CAAP;EACD;AAjHyC,CAA5C;AAoHA,eAAezC,qBAAf"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
import utils from './utils.js';
|
|
8
|
+
import EventEmitter from './EventEmitter.js';
|
|
9
|
+
import DragListener from './DragListener.js';
|
|
10
|
+
import ReactComponentHandler from './ReactComponentHandler.js';
|
|
11
|
+
import ConfigMinifier from './ConfigMinifier.js';
|
|
12
|
+
import BubblingEvent from './BubblingEvent.js';
|
|
13
|
+
import EventHub from './EventHub.js';
|
|
14
|
+
export default _objectSpread(_objectSpread({}, utils), {}, {
|
|
15
|
+
EventEmitter,
|
|
16
|
+
DragListener,
|
|
17
|
+
ReactComponentHandler,
|
|
18
|
+
ConfigMinifier,
|
|
19
|
+
BubblingEvent,
|
|
20
|
+
EventHub
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["utils","EventEmitter","DragListener","ReactComponentHandler","ConfigMinifier","BubblingEvent","EventHub"],"sources":["../../src/utils/index.js"],"sourcesContent":["import utils from './utils.js';\nimport EventEmitter from './EventEmitter.js';\nimport DragListener from './DragListener.js';\nimport ReactComponentHandler from './ReactComponentHandler.js';\nimport ConfigMinifier from './ConfigMinifier.js';\nimport BubblingEvent from './BubblingEvent.js';\nimport EventHub from './EventHub.js';\n\nexport default {\n ...utils,\n EventEmitter,\n DragListener,\n ReactComponentHandler,\n ConfigMinifier,\n BubblingEvent,\n EventHub,\n};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,YAAlB;AACA,OAAOC,YAAP,MAAyB,mBAAzB;AACA,OAAOC,YAAP,MAAyB,mBAAzB;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,OAAOC,aAAP,MAA0B,oBAA1B;AACA,OAAOC,QAAP,MAAqB,eAArB;AAEA,+CACKN,KADL;EAEEC,YAFF;EAGEC,YAHF;EAIEC,qBAJF;EAKEC,cALF;EAMEC,aANF;EAOEC;AAPF"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import $ from 'jquery';
|
|
2
|
+
var utils = {};
|
|
3
|
+
|
|
4
|
+
utils.F = function () {};
|
|
5
|
+
|
|
6
|
+
utils.extend = function (subClass, superClass) {
|
|
7
|
+
subClass.prototype = utils.createObject(superClass.prototype);
|
|
8
|
+
subClass.prototype.contructor = subClass;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
utils.createObject = function (prototype) {
|
|
12
|
+
if (typeof Object.create === 'function') {
|
|
13
|
+
return Object.create(prototype);
|
|
14
|
+
} else {
|
|
15
|
+
utils.F.prototype = prototype;
|
|
16
|
+
return new utils.F();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
utils.objectKeys = function (object) {
|
|
21
|
+
var keys, key;
|
|
22
|
+
|
|
23
|
+
if (typeof Object.keys === 'function') {
|
|
24
|
+
return Object.keys(object);
|
|
25
|
+
} else {
|
|
26
|
+
keys = [];
|
|
27
|
+
|
|
28
|
+
for (key in object) {
|
|
29
|
+
keys.push(key);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return keys;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
utils.getHashValue = function (key) {
|
|
37
|
+
var matches = location.hash.match(new RegExp(key + '=([^&]*)'));
|
|
38
|
+
return matches ? matches[1] : null;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
utils.getQueryStringParam = function (param) {
|
|
42
|
+
if (window.location.hash) {
|
|
43
|
+
return utils.getHashValue(param);
|
|
44
|
+
} else if (!window.location.search) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var keyValuePairs = window.location.search.substr(1).split('&'),
|
|
49
|
+
params = {},
|
|
50
|
+
pair,
|
|
51
|
+
i;
|
|
52
|
+
|
|
53
|
+
for (i = 0; i < keyValuePairs.length; i++) {
|
|
54
|
+
pair = keyValuePairs[i].split('=');
|
|
55
|
+
params[pair[0]] = pair[1];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return params[param] || null;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
utils.copy = function (target, source) {
|
|
62
|
+
for (var key in source) {
|
|
63
|
+
target[key] = source[key];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return target;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* This is based on Paul Irish's shim, but looks quite odd in comparison. Why?
|
|
70
|
+
* Because
|
|
71
|
+
* a) it shouldn't affect the global requestAnimationFrame function
|
|
72
|
+
* b) it shouldn't pass on the time that has passed
|
|
73
|
+
*
|
|
74
|
+
* @param {Function} fn
|
|
75
|
+
*
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
utils.animFrame = function (fn) {
|
|
81
|
+
return (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback) {
|
|
82
|
+
window.setTimeout(callback, 1000 / 60);
|
|
83
|
+
})(function () {
|
|
84
|
+
fn();
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
utils.indexOf = function (needle, haystack) {
|
|
89
|
+
if (!(haystack instanceof Array)) {
|
|
90
|
+
throw new Error('Haystack is not an Array');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (haystack.indexOf) {
|
|
94
|
+
return haystack.indexOf(needle);
|
|
95
|
+
} else {
|
|
96
|
+
for (var i = 0; i < haystack.length; i++) {
|
|
97
|
+
if (haystack[i] === needle) {
|
|
98
|
+
return i;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return -1;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
if (typeof /./ != 'function' && typeof Int8Array != 'object') {
|
|
107
|
+
utils.isFunction = function (obj) {
|
|
108
|
+
return typeof obj == 'function' || false;
|
|
109
|
+
};
|
|
110
|
+
} else {
|
|
111
|
+
utils.isFunction = function (obj) {
|
|
112
|
+
return toString.call(obj) === '[object Function]';
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
utils.fnBind = function (fn, context, boundArgs) {
|
|
117
|
+
if (Function.prototype.bind !== undefined) {
|
|
118
|
+
return Function.prototype.bind.apply(fn, [context].concat(boundArgs || []));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var bound = function bound() {
|
|
122
|
+
// Join the already applied arguments to the now called ones (after converting to an array again).
|
|
123
|
+
var args = (boundArgs || []).concat(Array.prototype.slice.call(arguments, 0)); // If not being called as a constructor
|
|
124
|
+
|
|
125
|
+
if (!(this instanceof bound)) {
|
|
126
|
+
// return the result of the function called bound to target and partially applied.
|
|
127
|
+
return fn.apply(context, args);
|
|
128
|
+
} // If being called as a constructor, apply the function bound to self.
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
fn.apply(this, args);
|
|
132
|
+
}; // Attach the prototype of the function to our newly created function.
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
bound.prototype = fn.prototype;
|
|
136
|
+
return bound;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
utils.removeFromArray = function (item, array) {
|
|
140
|
+
var index = utils.indexOf(item, array);
|
|
141
|
+
|
|
142
|
+
if (index === -1) {
|
|
143
|
+
throw new Error("Can't remove item from array. Item is not in the array");
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
array.splice(index, 1);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
utils.now = function () {
|
|
150
|
+
if (typeof Date.now === 'function') {
|
|
151
|
+
return Date.now();
|
|
152
|
+
} else {
|
|
153
|
+
return new Date().getTime();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
utils.getUniqueId = function () {
|
|
158
|
+
return (Math.random() * 1000000000000000).toString(36).replace('.', '');
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* A basic XSS filter. It is ultimately up to the
|
|
162
|
+
* implementing developer to make sure their particular
|
|
163
|
+
* applications and usecases are save from cross site scripting attacks
|
|
164
|
+
*
|
|
165
|
+
* @param {String} input
|
|
166
|
+
* @param {Boolean} keepTags
|
|
167
|
+
*
|
|
168
|
+
* @returns {String} filtered input
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
utils.filterXss = function (input, keepTags) {
|
|
173
|
+
var output = input.replace(/javascript/gi, 'javascript').replace(/expression/gi, 'expression').replace(/onload/gi, 'onload').replace(/script/gi, 'script').replace(/onerror/gi, 'onerror');
|
|
174
|
+
|
|
175
|
+
if (keepTags === true) {
|
|
176
|
+
return output;
|
|
177
|
+
} else {
|
|
178
|
+
return output.replace(/>/g, '>').replace(/</g, '<');
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Removes html tags from a string
|
|
183
|
+
*
|
|
184
|
+
* @param {String} input
|
|
185
|
+
*
|
|
186
|
+
* @returns {String} input without tags
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
utils.stripTags = function (input) {
|
|
191
|
+
return $.trim(input.replace(/(<([^>]+)>)/gi, ''));
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export default utils;
|
|
195
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["$","utils","F","extend","subClass","superClass","prototype","createObject","contructor","Object","create","objectKeys","object","keys","key","push","getHashValue","matches","location","hash","match","RegExp","getQueryStringParam","param","window","search","keyValuePairs","substr","split","params","pair","i","length","copy","target","source","animFrame","fn","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","callback","setTimeout","indexOf","needle","haystack","Array","Error","Int8Array","isFunction","obj","toString","call","fnBind","context","boundArgs","Function","bind","undefined","apply","concat","bound","args","slice","arguments","removeFromArray","item","array","index","splice","now","Date","getTime","getUniqueId","Math","random","replace","filterXss","input","keepTags","output","stripTags","trim"],"sources":["../../src/utils/utils.js"],"sourcesContent":["import $ from 'jquery';\n\nconst utils = {};\n\nutils.F = function () {};\n\nutils.extend = function (subClass, superClass) {\n subClass.prototype = utils.createObject(superClass.prototype);\n subClass.prototype.contructor = subClass;\n};\n\nutils.createObject = function (prototype) {\n if (typeof Object.create === 'function') {\n return Object.create(prototype);\n } else {\n utils.F.prototype = prototype;\n return new utils.F();\n }\n};\n\nutils.objectKeys = function (object) {\n var keys, key;\n\n if (typeof Object.keys === 'function') {\n return Object.keys(object);\n } else {\n keys = [];\n for (key in object) {\n keys.push(key);\n }\n return keys;\n }\n};\n\nutils.getHashValue = function (key) {\n var matches = location.hash.match(new RegExp(key + '=([^&]*)'));\n return matches ? matches[1] : null;\n};\n\nutils.getQueryStringParam = function (param) {\n if (window.location.hash) {\n return utils.getHashValue(param);\n } else if (!window.location.search) {\n return null;\n }\n\n var keyValuePairs = window.location.search.substr(1).split('&'),\n params = {},\n pair,\n i;\n\n for (i = 0; i < keyValuePairs.length; i++) {\n pair = keyValuePairs[i].split('=');\n params[pair[0]] = pair[1];\n }\n\n return params[param] || null;\n};\n\nutils.copy = function (target, source) {\n for (var key in source) {\n target[key] = source[key];\n }\n return target;\n};\n\n/**\n * This is based on Paul Irish's shim, but looks quite odd in comparison. Why?\n * Because\n * a) it shouldn't affect the global requestAnimationFrame function\n * b) it shouldn't pass on the time that has passed\n *\n * @param {Function} fn\n *\n * @returns {void}\n */\nutils.animFrame = function (fn) {\n return (\n window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n function (callback) {\n window.setTimeout(callback, 1000 / 60);\n }\n )(function () {\n fn();\n });\n};\n\nutils.indexOf = function (needle, haystack) {\n if (!(haystack instanceof Array)) {\n throw new Error('Haystack is not an Array');\n }\n\n if (haystack.indexOf) {\n return haystack.indexOf(needle);\n } else {\n for (var i = 0; i < haystack.length; i++) {\n if (haystack[i] === needle) {\n return i;\n }\n }\n return -1;\n }\n};\n\nif (typeof /./ != 'function' && typeof Int8Array != 'object') {\n utils.isFunction = function (obj) {\n return typeof obj == 'function' || false;\n };\n} else {\n utils.isFunction = function (obj) {\n return toString.call(obj) === '[object Function]';\n };\n}\n\nutils.fnBind = function (fn, context, boundArgs) {\n if (Function.prototype.bind !== undefined) {\n return Function.prototype.bind.apply(fn, [context].concat(boundArgs || []));\n }\n\n var bound = function () {\n // Join the already applied arguments to the now called ones (after converting to an array again).\n var args = (boundArgs || []).concat(\n Array.prototype.slice.call(arguments, 0)\n );\n\n // If not being called as a constructor\n if (!(this instanceof bound)) {\n // return the result of the function called bound to target and partially applied.\n return fn.apply(context, args);\n }\n // If being called as a constructor, apply the function bound to self.\n fn.apply(this, args);\n };\n // Attach the prototype of the function to our newly created function.\n bound.prototype = fn.prototype;\n return bound;\n};\n\nutils.removeFromArray = function (item, array) {\n var index = utils.indexOf(item, array);\n\n if (index === -1) {\n throw new Error(\"Can't remove item from array. Item is not in the array\");\n }\n\n array.splice(index, 1);\n};\n\nutils.now = function () {\n if (typeof Date.now === 'function') {\n return Date.now();\n } else {\n return new Date().getTime();\n }\n};\n\nutils.getUniqueId = function () {\n return (Math.random() * 1000000000000000).toString(36).replace('.', '');\n};\n\n/**\n * A basic XSS filter. It is ultimately up to the\n * implementing developer to make sure their particular\n * applications and usecases are save from cross site scripting attacks\n *\n * @param {String} input\n * @param {Boolean} keepTags\n *\n * @returns {String} filtered input\n */\nutils.filterXss = function (input, keepTags) {\n var output = input\n .replace(/javascript/gi, 'javascript')\n .replace(/expression/gi, 'expression')\n .replace(/onload/gi, 'onload')\n .replace(/script/gi, 'script')\n .replace(/onerror/gi, 'onerror');\n\n if (keepTags === true) {\n return output;\n } else {\n return output.replace(/>/g, '>').replace(/</g, '<');\n }\n};\n\n/**\n * Removes html tags from a string\n *\n * @param {String} input\n *\n * @returns {String} input without tags\n */\nutils.stripTags = function (input) {\n return $.trim(input.replace(/(<([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E,WAAN,GAAoB,YAAY;EAC9B,OAAO,CAACC,IAAI,CAACC,MAAL,KAAgB,gBAAjB,EAAmCxB,QAAnC,CAA4C,EAA5C,EAAgDyB,OAAhD,CAAwD,GAAxD,EAA6D,EAA7D,CAAP;AACD,CAFD;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA3E,KAAK,CAAC4E,SAAN,GAAkB,UAAUC,KAAV,EAAiBC,QAAjB,EAA2B;EAC3C,IAAIC,MAAM,GAAGF,KAAK,CACfF,OADU,CACF,cADE,EACc,gBADd,EAEVA,OAFU,CAEF,cAFE,EAEc,iBAFd,EAGVA,OAHU,CAGF,UAHE,EAGU,YAHV,EAIVA,OAJU,CAIF,UAJE,EAIU,aAJV,EAKVA,OALU,CAKF,WALE,EAKW,cALX,CAAb;;EAOA,IAAIG,QAAQ,KAAK,IAAjB,EAAuB;IACrB,OAAOC,MAAP;EACD,CAFD,MAEO;IACL,OAAOA,MAAM,CAACJ,OAAP,CAAe,IAAf,EAAqB,MAArB,EAA6BA,OAA7B,CAAqC,IAArC,EAA2C,MAA3C,CAAP;EACD;AACF,CAbD;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA3E,KAAK,CAACgF,SAAN,GAAkB,UAAUH,KAAV,EAAiB;EACjC,OAAO9E,CAAC,CAACkF,IAAF,CAAOJ,KAAK,CAACF,OAAN,CAAc,eAAd,EAA+B,EAA/B,CAAP,CAAP;AACD,CAFD;;AAIA,eAAe3E,KAAf"}
|
package/package.json
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/golden-layout",
|
|
3
|
-
"version": "0.17.1-beta.
|
|
3
|
+
"version": "0.17.1-beta.4+1995291",
|
|
4
4
|
"author": "Deephaven Data Labs LLC",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "A multi-screen javascript Layout manager",
|
|
7
|
-
"main": "./dist/
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
|
-
"
|
|
10
|
-
"test": "test"
|
|
11
|
-
},
|
|
9
|
+
"type": "module",
|
|
12
10
|
"dependencies": {
|
|
13
11
|
"jquery": "^3.6.0"
|
|
14
12
|
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"react": "^17.x",
|
|
15
|
+
"react-dom": "^17.x"
|
|
16
|
+
},
|
|
15
17
|
"scripts": {
|
|
16
18
|
"build": "cross-env NODE_ENV=production run-p build:*",
|
|
17
19
|
"build-dev": "cross-env NODE_ENV=development run-p build:*",
|
|
18
20
|
"sass": "sass ./src/scss:./dist/css -s compressed",
|
|
19
|
-
"build:
|
|
21
|
+
"build:babel": "npm run babel",
|
|
20
22
|
"build:sass": "npm run sass",
|
|
23
|
+
"babel": "babel ./src --out-dir ./dist --extensions \".js\" --source-maps --root-mode upward",
|
|
21
24
|
"watch": "run-p watch:*",
|
|
22
|
-
"watch:
|
|
25
|
+
"watch:babel": "npm run babel -- -w --skip-initial-build",
|
|
23
26
|
"watch:sass": "npm run sass -- --watch --update",
|
|
24
|
-
"clean": "rimraf ./dist
|
|
27
|
+
"clean": "rimraf ./dist",
|
|
25
28
|
"start": "cross-env NODE_ENV=development npm run watch",
|
|
26
29
|
"prestart": "npm run build-dev",
|
|
27
|
-
"test": "karma start karma.conf.
|
|
28
|
-
"test:ci": "karma start karma.conf.
|
|
30
|
+
"test": "karma start karma.conf.cjs",
|
|
31
|
+
"test:ci": "karma start karma.conf.cjs --single-run"
|
|
29
32
|
},
|
|
30
33
|
"repository": {
|
|
31
34
|
"type": "git",
|
|
@@ -42,44 +45,14 @@
|
|
|
42
45
|
"files": [
|
|
43
46
|
"dist"
|
|
44
47
|
],
|
|
45
|
-
"npmFileMap": [
|
|
46
|
-
{
|
|
47
|
-
"basePath": "/dist/",
|
|
48
|
-
"files": [
|
|
49
|
-
"goldenlayout.js",
|
|
50
|
-
"goldenlayout.min.js"
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"basePath": "/src/css/",
|
|
55
|
-
"files": [
|
|
56
|
-
"goldenlayout.base.css",
|
|
57
|
-
"goldenlayout-dark-theme.css",
|
|
58
|
-
"goldenlayout-light-theme.css"
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"basePath": "/",
|
|
63
|
-
"files": [
|
|
64
|
-
"typings.json"
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"jspm": {
|
|
69
|
-
"main": "dist/goldenlayout",
|
|
70
|
-
"format": "global",
|
|
71
|
-
"registry": "jspm",
|
|
72
|
-
"dependencies": {
|
|
73
|
-
"jquery": "^2.1.0"
|
|
74
|
-
},
|
|
75
|
-
"shim": {
|
|
76
|
-
"dist/goldenlayout": [
|
|
77
|
-
"jquery"
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
48
|
"publishConfig": {
|
|
82
49
|
"access": "public"
|
|
83
50
|
},
|
|
84
|
-
"
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"browserify": "^17.0.0",
|
|
53
|
+
"esmify": "^2.1.1",
|
|
54
|
+
"karma-browserify": "^8.1.0",
|
|
55
|
+
"watchify": "^4.0.0"
|
|
56
|
+
},
|
|
57
|
+
"gitHead": "1995291c1352e7571fa62963606a1108a6e8b3ea"
|
|
85
58
|
}
|