widgets: folder container
This commit is contained in:
parent
4868ef77d9
commit
d68c0f6c0a
5 changed files with 94 additions and 7 deletions
61
src/client/widgets/containers/folder.js
Normal file
61
src/client/widgets/containers/folder.js
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
var Panel = require('./panel'),
|
||||
StaticProperties = require('../mixins/static_properties')
|
||||
|
||||
class Folder extends Panel {
|
||||
|
||||
static description() {
|
||||
|
||||
return 'Generic matrix for creating rows/columns of widgets.'
|
||||
|
||||
}
|
||||
|
||||
static defaults() {
|
||||
|
||||
var defaults = super.defaults().extend({
|
||||
class_specific: {
|
||||
traversing: null
|
||||
},
|
||||
style: {
|
||||
|
||||
},
|
||||
geometry: null,
|
||||
osc: null,
|
||||
scripting: null,
|
||||
value: null,
|
||||
children: {
|
||||
widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously.'},
|
||||
}
|
||||
})
|
||||
|
||||
defaults.style = {
|
||||
colorText: defaults.style.colorText,
|
||||
colorWidget: defaults.style.colorWidget,
|
||||
css: defaults.style.css,
|
||||
}
|
||||
|
||||
return defaults
|
||||
|
||||
}
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super(options)
|
||||
|
||||
}
|
||||
|
||||
getProp(propName) {
|
||||
|
||||
if (propName === 'layout') {
|
||||
return this.parent.getProp('layout')
|
||||
} else {
|
||||
return super.getProp(propName)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = Folder
|
||||
|
|
@ -11,6 +11,7 @@ module.exports.widgets = {
|
|||
|
||||
// containers
|
||||
panel: require('./containers/panel'),
|
||||
folder: require('./containers/folder'),
|
||||
root: require('./containers/root'),
|
||||
tab: require('./containers/tab'),
|
||||
modal: require('./containers/modal'),
|
||||
|
|
@ -56,7 +57,7 @@ module.exports.widgets = {
|
|||
|
||||
module.exports.categories = {
|
||||
'Basics':['button', 'switch', 'dropdown', 'menu', 'input', 'textarea', 'file'],
|
||||
'Containers':['panel', 'modal', 'clone', 'fragment', 'matrix', 'keyboard', 'patchbay'],
|
||||
'Containers':['panel', 'modal', 'clone', 'fragment', 'matrix', 'keyboard', 'patchbay', 'folder'],
|
||||
'Frames':['frame', 'svg', 'html', 'image'],
|
||||
'Graphs':['plot','eq','visualizer'],
|
||||
'Indicators':['led', 'text'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue