widgets: folder container

This commit is contained in:
jean-emmanuel 2022-10-26 10:31:45 +02:00
parent 4868ef77d9
commit d68c0f6c0a
5 changed files with 94 additions and 7 deletions

View 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

View file

@ -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'],