vue-golden-layout
Version:
Integration of the golden-layout to Vue
1,296 lines (1,295 loc) • 58.7 kB
JavaScript
// NOTE: Should match syntheticDefaultExportPolyfill in LoaderAPI.ts
function syntheticDefaultExportPolyfill(input) {
if( input === null ||
['function', 'object', 'array'].indexOf(typeof input) === -1 ||
input.hasOwnProperty("default") // use hasOwnProperty to avoid triggering usage warnings from libraries like mobx
) {
return
}
// to get around frozen input
if (Object.isFrozen(input) ) {
input.default = input;
return;
}
// free to define properties
Object.defineProperty(input, "default", {
value: input,
writable: true,
enumerable: false
});
}
var _1b62 = {};
_1b62.f = {}
// cached modules
_1b62.m = {};
_1b62.r = function(id) {
var cached = _1b62.m[id];
// resolve if in cache
if (cached) {
return cached.m.exports;
}
var file = _1b62.f[id];
if (!file)
return;
cached = _1b62.m[id] = {};
cached.exports = {};
cached.m = { exports: cached.exports };
file.call(cached.exports, cached.m, cached.exports);
syntheticDefaultExportPolyfill(cached.m.exports);
return cached.m.exports;
};
// vue-golden-layout/index.js
_1b62.f[0] = function(module,exports){
Object.defineProperty(exports, '__esModule', { value: true });
require('golden-layout/src/css/goldenlayout-base.css');
var golden_vue_1 = _1b62.r(1);
exports.goldenLayout = golden_vue_1.default;
var gl_component_vue_1 = _1b62.r(4);
exports.glComponent = gl_component_vue_1.default;
var gl_group_1 = _1b62.r(5);
exports.glRow = gl_group_1.glRow;
exports.glCol = gl_group_1.glCol;
exports.glStack = gl_group_1.glStack;
var gl_router_1 = _1b62.r(7);
exports.glRouter = gl_router_1.default;
var components = {
layoutGolden: golden_vue_1.default,
goldenLayout: golden_vue_1.default,
glComponent: gl_component_vue_1.default,
glRow: gl_group_1.glRow,
glCol: gl_group_1.glCol,
glStack: gl_group_1.glStack,
glRouter: gl_router_1.default
};
exports.default = {
install: function (Vue, options) {
for (var i in components)
Vue.component(i, components[i]);
}
};
}
// vue-golden-layout/golden.vue
_1b62.f[1] = function(module,exports){
var _options = { _vueModuleId: 'data-v-2a02b91d' };
Object.assign(_options, {
_scopeId: null,
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('div', {
directives: [{
name: 'resize',
rawName: 'v-resize',
value: _vm.onResize,
expression: 'onResize'
}],
ref: 'layoutRoot'
}, [_vm._t('default')], 2);
},
staticRenderFns: []
});
var __extends = this && this.__extends || function () {
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p];
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = this && this.__metadata || function (k, v) {
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
return Reflect.metadata(k, v);
};
Object.defineProperty(exports, '__esModule', { value: true });
var imports_1 = _1b62.r(2);
var vue_property_decorator_1 = require('vue-property-decorator');
var GoldenLayout = require('golden-layout');
var gl_roles_1 = _1b62.r(3);
var resize = require('vue-resize-directive');
var globalComponents = {};
var goldenLayout = function (_super) {
__extends(goldenLayout, _super);
function goldenLayout() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.tplCount = 0;
_this.tplPreload = {};
return _this;
}
goldenLayout.registerGlobalComponent = function (name, comp) {
console.assert(!globalComponents[name], 'Component name "' + name + '" unused');
globalComponents[name] = comp;
};
goldenLayout.prototype.settingsChanged = function () {
};
goldenLayout.prototype.dimensionsChanged = function () {
};
goldenLayout.prototype.gotState = function (state) {
};
goldenLayout.prototype.registerComponent = function (component, name) {
if (!name)
name = 'tpl' + ++this.tplCount;
var tplData = 'function' === typeof component ? component : function (container, state) {
container.getElement().append(component.childEl);
forwardEvt(container, component, component.events);
component.container = container;
};
if (this.gl) {
this.gl.registerComponent(name, tplData);
console.warn('Dynamic golden-layout components should be named templates instead.');
} else
this.tplPreload[name] = tplData;
return name;
};
goldenLayout.prototype.onGlInitialise = function (cb) {
if (this.glObject)
cb(this.gl);
else
(this.initialisedCB || (this.initialisedCB = [])).push(cb);
};
goldenLayout.prototype.mounted = function () {
var _this = this;
var me = this, layoutRoot = this.$refs.layoutRoot, gl;
if (this.state) {
this.config = this.state;
} else {
this.config.settings = {
hasHeaders: this.hasHeaders,
reorderEnabled: this.reorderEnabled,
selectionEnabled: this.selectionEnabled,
popoutWholeStack: this.popoutWholeStack,
blockedPopoutsThrowError: this.blockedPopoutsThrowError,
closePopoutsOnUnload: this.closePopoutsOnUnload,
showPopoutIcon: this.showPopoutIcon,
showMaximiseIcon: this.showMaximiseIcon,
showCloseIcon: this.showCloseIcon
};
this.config.dimensions = {
borderWidth: this.borderWidth,
minItemHeight: this.minItemHeight,
minItemWidth: this.minItemWidth,
headerHeight: this.headerHeight,
dragProxyWidth: this.dragProxyWidth,
dragProxyHeight: this.dragProxyHeight
};
}
this.gl = gl = new GoldenLayout(this.config, layoutRoot);
for (var tpl in this.tplPreload)
gl.registerComponent(tpl, this.tplPreload[tpl]);
delete this.tplPreload;
function appendVNodes(container, vNodes) {
var el = document.createElement('div');
container.getElement().append(el);
renderVNodes(me, el, vNodes, { class: 'glComponent' });
}
var slots = this.$slots;
for (var tpl in slots)
if ('default' !== tpl)
(function (tpl) {
gl.registerComponent(tpl, function (container) {
appendVNodes(container, slots[tpl]);
});
}(tpl));
var scopedSlots = this.$scopedSlots;
for (var tpl in scopedSlots)
(function (tpl) {
gl.registerComponent(tpl, function (container, state) {
appendVNodes(container, scopedSlots[tpl](state));
});
}(tpl));
for (var tpl in globalComponents)
(function (tpl) {
gl.registerComponent(tpl, globalComponents[tpl](_this));
}(tpl));
var raiseStateChanged = function () {
setTimeout(function () {
try {
_this.gotState(gl.toConfig());
} catch (e) {
raiseStateChanged();
}
}, 500);
};
gl.on('stateChanged', raiseStateChanged);
gl.on('initialised', function () {
if (_this.initialisedCB)
for (var _i = 0, _a = _this.initialisedCB; _i < _a.length; _i++) {
var cb = _a[_i];
cb(gl);
}
delete _this.initialisedCB;
});
gl.on('itemCreated', function (itm) {
itm.vueObject = itm === gl.root ? _this : itm.config.vue ? _this.getChild(itm.config.vue) : {};
itm.vueObject.glObject = itm;
if (itm.config.vue) {
itm.config.__defineGetter__('vue', function () {
return itm.vueObject.nodePath();
});
}
});
gl.on('itemDestroyed', function (itm) {
itm.vueObject.glObject = null;
if ('stack' === itm.parent.type && itm.parent.contentItems.indexOf(itm) < itm.parent.config.activeItemIndex)
setTimeout(function () {
--itm.parent.config.activeItemIndex;
});
});
forwardEvt(gl, this, [
'itemCreated',
'stackCreated',
'rowCreated',
'tabCreated',
'columnCreated',
'componentCreated',
'selectionChanged',
'windowOpened',
'windowClosed',
'itemDestroyed',
'initialised',
'activeContentItemChanged'
]);
gl.init();
};
goldenLayout.prototype.onResize = function () {
this.gl && this.gl.updateSize();
};
__decorate([
vue_property_decorator_1.Prop({ default: true }),
__metadata('design:type', Boolean)
], goldenLayout.prototype, 'hasHeaders', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: true }),
__metadata('design:type', Boolean)
], goldenLayout.prototype, 'reorderEnabled', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: false }),
__metadata('design:type', Boolean)
], goldenLayout.prototype, 'selectionEnabled', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: true }),
__metadata('design:type', Boolean)
], goldenLayout.prototype, 'popoutWholeStack', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: true }),
__metadata('design:type', Boolean)
], goldenLayout.prototype, 'blockedPopoutsThrowError', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: true }),
__metadata('design:type', Boolean)
], goldenLayout.prototype, 'closePopoutsOnUnload', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: true }),
__metadata('design:type', Boolean)
], goldenLayout.prototype, 'showPopoutIcon', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: true }),
__metadata('design:type', Boolean)
], goldenLayout.prototype, 'showMaximiseIcon', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: true }),
__metadata('design:type', Boolean)
], goldenLayout.prototype, 'showCloseIcon', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: null }),
__metadata('design:type', Object)
], goldenLayout.prototype, 'state', void 0);
__decorate([
vue_property_decorator_1.Watch('hasHeaders'),
vue_property_decorator_1.Watch('reorderEnabled'),
vue_property_decorator_1.Watch('selectionEnabled'),
vue_property_decorator_1.Watch('popoutWholeStack'),
vue_property_decorator_1.Watch('blockedPopoutsThrowError'),
vue_property_decorator_1.Watch('closePopoutsOnUnload'),
vue_property_decorator_1.Watch('showPopoutIcon'),
vue_property_decorator_1.Watch('showMaximiseIcon'),
vue_property_decorator_1.Watch('showCloseIcon'),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], goldenLayout.prototype, 'settingsChanged', null);
__decorate([
vue_property_decorator_1.Prop({ default: 5 }),
__metadata('design:type', Number)
], goldenLayout.prototype, 'borderWidth', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: 10 }),
__metadata('design:type', Number)
], goldenLayout.prototype, 'minItemHeight', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: 10 }),
__metadata('design:type', Number)
], goldenLayout.prototype, 'minItemWidth', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: 20 }),
__metadata('design:type', Number)
], goldenLayout.prototype, 'headerHeight', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: 300 }),
__metadata('design:type', Number)
], goldenLayout.prototype, 'dragProxyWidth', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: 200 }),
__metadata('design:type', Number)
], goldenLayout.prototype, 'dragProxyHeight', void 0);
__decorate([
vue_property_decorator_1.Watch('borderWidth'),
vue_property_decorator_1.Watch('minItemHeight'),
vue_property_decorator_1.Watch('minItemWidth'),
vue_property_decorator_1.Watch('headerHeight'),
vue_property_decorator_1.Watch('dragProxyWidth'),
vue_property_decorator_1.Watch('dragProxyHeight'),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], goldenLayout.prototype, 'dimensionsChanged', null);
__decorate([
vue_property_decorator_1.Emit('state'),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], goldenLayout.prototype, 'gotState', null);
goldenLayout = __decorate([vue_property_decorator_1.Component({ directives: { resize: resize } })], goldenLayout);
return goldenLayout;
}(gl_roles_1.goldenContainer);
exports.default = goldenLayout;
function renderVNodes(parent, el, vNodes, options) {
return new imports_1.Vue({
render: function (ce) {
return vNodes instanceof Array ? ce('div', options, vNodes) : vNodes;
},
parent: parent,
el: el
});
}
exports.renderVNodes = renderVNodes;
function forwardEvt(from, toward, events) {
var _loop_1 = function (event) {
from.on(event, function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return 'object' === typeof event ? toward.$emit(event.type, event) : toward.$emit.apply(toward, [event].concat(args));
});
};
for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
var event = events_1[_i];
_loop_1(event);
}
}
Object.assign(exports.default.options || exports.default, _options);
_1b62.r(8)('vue-golden-layout/golden.vue.css', '\r\n.lm_goldenlayout .lm_content {\r\n\toverflow-y: auto;\r\n}\r\n');
}
// vue-golden-layout/imports.js
_1b62.f[2] = function(module,exports){
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
exports.Vue = vue.default || vue;
}
// vue-golden-layout/gl-roles.js
_1b62.f[3] = function(module,exports){
var __extends = this && this.__extends || function () {
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p];
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __assign = this && this.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = this && this.__metadata || function (k, v) {
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
return Reflect.metadata(k, v);
};
Object.defineProperty(exports, '__esModule', { value: true });
var imports_1 = _1b62.r(2);
var vue_property_decorator_1 = require('vue-property-decorator');
var goldenContainer = function (_super) {
__extends(goldenContainer, _super);
function goldenContainer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.config = { content: [] };
_this.glObject = null;
_this.events = [
'open',
'resize',
'destroy',
'close',
'tab',
'hide',
'show'
];
return _this;
}
goldenContainer.prototype.registerComponent = function (component, name) {
throw 'unimplemented';
};
goldenContainer.prototype.childPath = function (comp) {
var rv = this.nodePath ? this.nodePath() + '.' : '';
var ndx = this.$children.indexOf(comp);
console.assert(~ndx, 'Children exists');
return rv + ndx;
};
goldenContainer.prototype.getChild = function (path) {
var nrs = path.split('.');
var ndx = nrs.shift();
var next = this.$children[ndx];
console.assert(next, 'Vue structure correspond to loaded GL configuration');
return nrs.length ? next.getChild(nrs.join('.')) : next;
};
goldenContainer.prototype.addGlChild = function (child, comp, index) {
if (comp && 'component' === child.type) {
if (!child.componentName)
child.componentName = this.registerComponent(comp);
if (!child.componentState)
child.componentState = {};
}
var ci = this.glObject;
if (ci)
ci.addChild(child, index);
else if (undefined === index)
this.config.content.push(child);
else
this.config.content.splice(index, 0, child);
};
goldenContainer.prototype.removeGlChild = function (index) {
var ci = this.glObject;
if (ci) {
ci.removeChild(ci.contentItems[index]);
for (; index < ci.contentItems.length; ++index)
ci.contentItems[index].index = index;
} else {
this.config.content.splice(index, 1);
for (; index < this.config.content.length; ++index)
this.config.content[index].index = index;
}
};
Object.defineProperty(goldenContainer.prototype, 'glChildren', {
get: function () {
return this.glObject.contentItems.map(function (x) {
return x.vueObject;
});
},
enumerable: true,
configurable: true
});
goldenContainer.prototype.onGlInitialise = function (cb) {
throw 'Not implemented';
};
goldenContainer = __decorate([vue_property_decorator_1.Component], goldenContainer);
return goldenContainer;
}(imports_1.Vue);
exports.goldenContainer = goldenContainer;
var goldenChild = function (_super) {
__extends(goldenChild, _super);
function goldenChild() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.glObject = null;
_this.container = null;
_this.events = [
'stateChanged',
'titleChanged',
'activeContentItemChanged',
'itemDestroyed',
'itemCreated',
'componentCreated',
'rowCreated',
'columnCreated',
'stackCreated',
'destroy',
'destroyed'
];
return _this;
}
goldenChild.prototype.reWidth = function (w) {
this.container && this.container.setSize(w, false);
};
goldenChild.prototype.reHeight = function (h) {
this.container && this.container.setSize(false, h);
};
Object.defineProperty(goldenChild.prototype, 'childConfig', {
get: function () {
return null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(goldenChild.prototype, 'childEl', {
get: function () {
return null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(goldenChild.prototype, 'glParent', {
get: function () {
return this.glObject.parent.vueObject;
},
enumerable: true,
configurable: true
});
goldenChild.prototype.hide = function () {
this.container && this.container.hide();
};
goldenChild.prototype.show = function () {
this.container && this.container.show();
};
goldenChild.prototype.setContainer = function (c) {
this.container && this.container[this.hidden ? 'hide' : 'show']();
};
goldenChild.prototype.close = function () {
this.container && this.container.close();
};
goldenChild.prototype.created = function () {
if (!this.$parent instanceof goldenContainer)
throw new Error('gl-component can only appear directly in a golden-layout container');
};
goldenChild.prototype.nodePath = function () {
return this.$parent.childPath(this);
};
goldenChild.prototype.mounted = function () {
var dimensions = {};
if (undefined !== this.width)
dimensions.width = this.width;
if (undefined !== this.height)
dimensions.height = this.height;
this.$parent.addGlChild(__assign({}, dimensions, this.childConfig, { vue: this.nodePath() }), this, this.$parent.$children.indexOf(this));
};
goldenChild.prototype.beforeDestroy = function () {
if (this.glObject)
this.$parent.removeGlChild(this.glParent.glChildren.indexOf(this));
};
goldenChild.prototype.destroy = function (v) {
return !v;
};
__decorate([
vue_property_decorator_1.Prop(),
__metadata('design:type', Number)
], goldenChild.prototype, 'width', void 0);
__decorate([
vue_property_decorator_1.Prop(),
__metadata('design:type', Number)
], goldenChild.prototype, 'height', void 0);
__decorate([
vue_property_decorator_1.Watch('width'),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], goldenChild.prototype, 'reWidth', null);
__decorate([
vue_property_decorator_1.Watch('height'),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], goldenChild.prototype, 'reHeight', null);
__decorate([
vue_property_decorator_1.Prop(),
__metadata('design:type', String)
], goldenChild.prototype, 'tabId', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: false }),
__metadata('design:type', Boolean)
], goldenChild.prototype, 'hidden', void 0);
__decorate([
vue_property_decorator_1.Watch('container'),
vue_property_decorator_1.Watch('hidden'),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], goldenChild.prototype, 'setContainer', null);
__decorate([
vue_property_decorator_1.Prop({ default: true }),
__metadata('design:type', Boolean)
], goldenChild.prototype, 'closable', void 0);
__decorate([
vue_property_decorator_1.Watch('glObject'),
vue_property_decorator_1.Emit(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], goldenChild.prototype, 'destroy', null);
goldenChild = __decorate([vue_property_decorator_1.Component], goldenChild);
return goldenChild;
}(imports_1.Vue);
exports.goldenChild = goldenChild;
}
// vue-golden-layout/gl-component.vue
_1b62.f[4] = function(module,exports){
var _options = { _vueModuleId: 'data-v-58cb2d7f' };
Object.assign(_options, {
_scopeId: null,
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('div', { ref: 'glSource' }, [_c('div', {
ref: 'glCompRoot',
staticClass: 'glComponent'
}, [_vm._t('default')], 2)]);
},
staticRenderFns: []
});
var __extends = this && this.__extends || function () {
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p];
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = this && this.__metadata || function (k, v) {
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
return Reflect.metadata(k, v);
};
Object.defineProperty(exports, '__esModule', { value: true });
var vue_property_decorator_1 = require('vue-property-decorator');
var gl_roles_1 = _1b62.r(3);
var glComponent = function (_super) {
__extends(glComponent, _super);
function glComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
glComponent.prototype.setTitle = function (title) {
if (this.container)
this.container.setTitle(title);
};
Object.defineProperty(glComponent.prototype, 'childEl', {
get: function () {
return this.$refs.glCompRoot;
},
enumerable: true,
configurable: true
});
glComponent.prototype.toggleMaximise = function () {
this.container && this.container.toggleMaximise();
};
Object.defineProperty(glComponent.prototype, 'childConfig', {
get: function () {
return {
type: 'component',
title: this.title,
isClosable: this.closable,
componentName: this.template,
componentState: this.state
};
},
enumerable: true,
configurable: true
});
__decorate([
vue_property_decorator_1.Prop(),
__metadata('design:type', String)
], glComponent.prototype, 'title', void 0);
__decorate([
vue_property_decorator_1.Prop(),
__metadata('design:type', String)
], glComponent.prototype, 'template', void 0);
__decorate([
vue_property_decorator_1.Prop(),
__metadata('design:type', Object)
], glComponent.prototype, 'state', void 0);
__decorate([
vue_property_decorator_1.Watch('title'),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], glComponent.prototype, 'setTitle', null);
glComponent = __decorate([vue_property_decorator_1.Component], glComponent);
return glComponent;
}(gl_roles_1.goldenChild);
exports.default = glComponent;
Object.assign(exports.default.options || exports.default, _options);
_1b62.r(8)('vue-golden-layout/gl-component.vue.css', '\r\n.glComponent {\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\toverflow: auto;\r\n}\r\n');
}
// vue-golden-layout/gl-group.js
_1b62.f[5] = function(module,exports){
var __extends = this && this.__extends || function () {
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p];
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __assign = this && this.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = this && this.__metadata || function (k, v) {
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
return Reflect.metadata(k, v);
};
Object.defineProperty(exports, '__esModule', { value: true });
var vue_property_decorator_1 = require('vue-property-decorator');
var gl_group_vue_1 = _1b62.r(6);
var glGroup = function (_super) {
__extends(glGroup, _super);
function glGroup() {
return _super !== null && _super.apply(this, arguments) || this;
}
return glGroup;
}(gl_group_vue_1.default);
var glRow = function (_super) {
__extends(glRow, _super);
function glRow() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(glRow.prototype, 'childConfig', {
get: function () {
return __assign({
isClosable: this.closable,
type: 'row'
}, this.config);
},
enumerable: true,
configurable: true
});
glRow = __decorate([vue_property_decorator_1.Component], glRow);
return glRow;
}(glGroup);
exports.glRow = glRow;
var glCol = function (_super) {
__extends(glCol, _super);
function glCol() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(glCol.prototype, 'childConfig', {
get: function () {
return __assign({
isClosable: this.closable,
type: 'column'
}, this.config);
},
enumerable: true,
configurable: true
});
glCol = __decorate([vue_property_decorator_1.Component], glCol);
return glCol;
}(glGroup);
exports.glCol = glCol;
var glStack = function (_super) {
__extends(glStack, _super);
function glStack() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = 'stack';
return _this;
}
glStack.prototype.tabChange = function (tabId) {
};
glStack.prototype.progTabChange = function (tabId) {
for (var _i = 0, _a = this.glChildren; _i < _a.length; _i++) {
var child = _a[_i];
if (child.tabId === tabId)
this.glObject.setActiveContentItem(child.container.parent);
}
};
Object.defineProperty(glStack.prototype, 'childConfig', {
get: function () {
var _this = this;
this.onGlInitialise(function () {
_this.$watch(function () {
var ci = _this.glObject;
return ci && ci.config.activeItemIndex;
}, function (v) {
if ('number' === typeof v)
_this.tabChange(_this.glChildren[v].tabId);
});
});
return __assign({
activeItemIndex: Math.max(0, this.$children.findIndex(function (c) {
return c.tabId === _this.activeTab;
})),
isClosable: this.closable,
type: 'stack'
}, this.config);
},
enumerable: true,
configurable: true
});
__decorate([
vue_property_decorator_1.Model('tab-change'),
__metadata('design:type', String)
], glStack.prototype, 'activeTab', void 0);
__decorate([
vue_property_decorator_1.Emit(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], glStack.prototype, 'tabChange', null);
__decorate([
vue_property_decorator_1.Watch('activeTab'),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], glStack.prototype, 'progTabChange', null);
glStack = __decorate([vue_property_decorator_1.Component], glStack);
return glStack;
}(glGroup);
exports.glStack = glStack;
}
// vue-golden-layout/gl-group.vue
_1b62.f[6] = function(module,exports){
var _options = { _vueModuleId: 'data-v-44da5af' };
Object.assign(_options, {
_scopeId: null,
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('div', { staticStyle: { 'display': 'none' } }, [_vm._t('default')], 2);
},
staticRenderFns: []
});
var __extends = this && this.__extends || function () {
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p];
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = this && this.__metadata || function (k, v) {
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
return Reflect.metadata(k, v);
};
Object.defineProperty(exports, '__esModule', { value: true });
var vue_property_decorator_1 = require('vue-property-decorator');
var gl_roles_1 = _1b62.r(3);
var glGroup = function (_super) {
__extends(glGroup, _super);
function glGroup() {
return _super !== null && _super.apply(this, arguments) || this;
}
glGroup.prototype.registerComponent = function (component, name) {
return this.$parent.registerComponent(component, name);
};
glGroup.prototype.onGlInitialise = function (cb) {
this.$parent.onGlInitialise(cb);
};
__decorate([
vue_property_decorator_1.Prop({ default: false }),
__metadata('design:type', Boolean)
], glGroup.prototype, 'closable', void 0);
glGroup = __decorate([vue_property_decorator_1.Component({ mixins: [gl_roles_1.goldenChild] })], glGroup);
return glGroup;
}(gl_roles_1.goldenContainer);
exports.default = glGroup;
Object.assign(exports.default.options || exports.default, _options);
}
// vue-golden-layout/gl-router.js
_1b62.f[7] = function(module,exports){
var __extends = this && this.__extends || function () {
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p];
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = this && this.__metadata || function (k, v) {
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
return Reflect.metadata(k, v);
};
Object.defineProperty(exports, '__esModule', { value: true });
var vue_property_decorator_1 = require('vue-property-decorator');
var gl_group_1 = _1b62.r(5);
var imports_1 = _1b62.r(2);
var golden_vue_1 = _1b62.r(1);
function defaultTitle(route) {
return route.meta && route.meta.title || 'set $route.meta.title';
}
var RouteComponentName = '$router-route';
golden_vue_1.default.registerGlobalComponent(RouteComponentName, function (gl) {
return function (container, state) {
gl.onGlInitialise(function () {
var comp = gl.$router.getMatchedComponents(state)[0], route = gl.$router.resolve(state).route;
if ('object' === typeof comp)
comp = imports_1.Vue.extend(comp);
var div, template = gl.$scopedSlots.route ? gl.$scopedSlots.route(route) : gl.$slots.route;
if (template) {
div = golden_vue_1.renderVNodes(gl, container.getElement()[0], template).$el.querySelector('main');
} else {
div = document.createElement('main');
container.getElement().append(div);
}
var parent = container.parent.parent;
while (!parent.vueObject || !parent.vueObject._isVue)
parent = parent.parent;
if (div)
new comp({
el: div,
parent: parent.vueObject
});
else
console.error('Missing <main /> tag in route-page design');
});
};
});
var glRouter = function (_super) {
__extends(glRouter, _super);
function glRouter() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(glRouter.prototype, 'stack', {
get: function () {
var ci = this.glObject, rv;
if (!ci)
return null;
rv = ci.contentItems.find(function (x) {
return 'stack' === x.type;
});
if (!rv) {
ci.addChild({
type: 'stack',
content: []
}, 0);
rv = ci.contentItems[0];
}
return rv;
},
enumerable: true,
configurable: true
});
glRouter.prototype.setPath = function (v) {
var path;
if (v && 'object' === typeof v) {
var config = v.config, aii = config.activeItemIndex;
delete config.activeItemIndex;
this.$set(config, 'activeItemIndex', aii);
}
var aci = this.stack.getActiveContentItem();
if (aci && RouteComponentName === aci.config.componentName) {
path = aci.config.componentState;
} else
path = this.emptyRoute;
if (path != this.$route.fullPath)
this.$router.replace(path);
};
glRouter.prototype.change = function (route) {
var _this = this;
if (route && route.matched.length)
this.onGlInitialise(function () {
var ci = _this.glObject;
if (ci) {
var stack = _this.stack;
var already = stack.contentItems.find(function (x) {
return x.config.componentState.path == route.fullPath;
});
if (already)
stack.setActiveContentItem(already);
else
stack.addChild({
type: 'component',
componentName: RouteComponentName,
componentState: { path: route.fullPath },
title: _this.titler(route)
});
}
});
};
glRouter.prototype.mounted = function () {
this.change(this.$route);
};
__decorate([
vue_property_decorator_1.Prop({ default: defaultTitle }),
__metadata('design:type', Function)
], glRouter.prototype, 'titler', void 0);
__decorate([
vue_property_decorator_1.Prop({ default: '/' }),
__metadata('design:type', String)
], glRouter.prototype, 'emptyRoute', void 0);
__decorate([
vue_property_decorator_1.Watch('stack.vueObject.glObject'),
vue_property_decorator_1.Watch('stack.config.activeItemIndex'),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], glRouter.prototype, 'setPath', null);
__decorate([
vue_property_decorator_1.Watch('$route'),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], glRouter.prototype, 'change', null);
glRouter = __decorate([vue_property_decorator_1.Component()], glRouter);
return glRouter;
}(gl_group_1.glRow);
exports.default = glRouter;
}
// fuse-box-css/index.js
_1b62.f[8] = function(module,exports){
var __filename = "index.js";
var runningInBrowser = false || 'npm' === 'electron';
var cssHandler = function (__filename, contents) {
if (runningInBrowser) {
var styleId = __filename.replace(/[\.\/]+/g, '-');
if (styleId.charAt(0) === '-')
styleId = styleId.substring(1);
var exists = document.getElementById(styleId);
if (!exists) {
var s = document.createElement(contents ? 'style' : 'link');
s.id = styleId;
s.type = 'text/css';
if (contents) {
s.innerHTML = contents;
} else {
s.rel = 'stylesheet';
s.href = __filename;
}
document.getElementsByTagName('head')[0].appendChild(s);
} else {
if (contents) {
exists.innerHTML = contents;
}
}
}
};
if (typeof FuseBox !== 'undefined' && runningInBrowser) {
FuseBox.on('async', function (name) {
if (/\.css$/.test(name)) {
cssHandler(name);
return false;
}
});
}
module.exports = cssHandler;
}
// tslib/tslib.js
_1b62.f[9] = function(module,exports){
var __extends;
var __assign;
var __rest;
var __decorate;
var __param;
var __metadata;
var __awaiter;
var __generator;
var __exportStar;
var __values;
var __read;
var __spread;
var __await;
var __asyncGenerator;
var __asyncDelegator;
var __asyncValues;
var __makeTemplateObject;
var __importStar;
var __importDefault;
(function (factory) {
var root = 'object' === 'object' ? global : typeof self === 'object' ? self : typeof this === 'object' ? this : {};
if ('undefined' === 'function' && define.amd) {
define('tslib', ['exports'], function (exports) {
factory(createExporter(root, createExporter(exports)));
});
} else if ('object' === 'object' && typeof module.exports === 'object') {
factory(createExporter(root, createExporter(module.exports)));
} else {
factory(createExporter(root));
}
function createExporter(exports, previous) {
if (exports !== root) {
if (typeof Object.create === 'function') {
Object.defineProperty(exports, '__esModule', { value: true });
} else {
exports.__esModule = true;
}
}
return function (id, v) {
return exports[id] = previous ? previous(id, v) : v;
};
}
}(function (exporter) {
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p];
};
__extends = function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
__assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
__rest = function (s, e) {
var t = {};
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === 'function')
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
__decorate = function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
__param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
__metadata = function (metadataKey, metadataValue) {
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
return Reflect.metadata(metadataKey, metadataValue);
};
__awaiter = function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator['throw'](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : new P(function (resolve) {
resolve(result.value);