inspector: regroup class-specific props under the same category dropdown

This commit is contained in:
bordun 2020-05-14 23:19:55 +02:00
parent 6946fbd069
commit f88c33bb03
34 changed files with 77 additions and 54 deletions

View file

@ -17,7 +17,7 @@ class Button extends Widget {
return super.defaults({
_button: 'button',
_class_specific: 'button',
label: {type: 'string|boolean', value: 'auto', help: [
'Set to `false` to hide completely',

View file

@ -15,7 +15,7 @@ class Dropdown extends MenuBase {
return super.defaults({
_dropdown:'dropdown',
_class_specific: 'dropdown',
align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'},
values: {type: 'array|object', value: {'Value 1':1,'Value 2':2}, help: [

View file

@ -14,7 +14,7 @@ module.exports = class File extends Widget {
return super.defaults({
_input:'input',
_class_specific: 'input',
align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'},
directory: {type: 'string', value: 'auto', help: 'Default browsing directory'},

View file

@ -14,7 +14,7 @@ class Input extends Canvas {
return super.defaults({
_input:'input',
_class_specific: 'input',
align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'},
unit: {type: 'string', value: '', help: 'Unit will be appended to the displayed widget\'s value (it doesn\'t affect osc messages)'},

View file

@ -16,7 +16,7 @@ class Menu extends MenuBase {
return super.defaults({
_menu:'menu',
_class_specific: 'menu',
size: {type: 'number|array', value: 200, help: [
'- If `layout` is `circular`: diameter (in px)',

View file

@ -15,7 +15,7 @@ class Switch extends MenuBase {
return super.defaults({
_switch:'switch',
_class_specific: 'switch',
layout: {type: 'string', value: 'vertical', choices: ['vertical', 'horizontal', 'grid'], help:''},
gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'},

View file

@ -47,14 +47,14 @@ class Widget extends EventEmitter {
var defaults = {
_widget:'widget',
_widget: 'widget',
type: {type: 'string', value: 'auto', help: 'Widget type'},
id: {type: 'string', value: 'auto', help: 'Widgets sharing the same `id` will act as clones and update each other\'s value(s) without sending extra osc messages.' },
visible: {type: 'boolean', value: true, help: 'Set to `false` to hide the widget.'},
interaction: {type: 'boolean', value: true, help: 'Set to `false` to disable pointer interactions.'},
_geometry:'geometry',
_geometry: 'geometry',
left: {type: 'number|string', value: 'auto', help: [
'When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).',
@ -68,7 +68,7 @@ class Widget extends EventEmitter {
height: {type: 'number|percentage', value: 'auto', help: 'Widget height'},
expand: {type: 'boolean|number', value: 'false', help: 'If parent\'s layout is `vertical` or `horizontal`, set this to `true` to stretch the widget to use available space automatically.'},
_style:'style',
_style: 'style',
colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'},

View file

@ -20,11 +20,11 @@ class Clone extends Container() {
return super.defaults({
_clone:'clone',
_class_specific: 'clone',
widgetId: {type: 'string', value: '', help: '`id` of the widget to clone'},
_overrides:'overrides',
_separator: 'overrides',
props: {type: 'object', value: {}, help: 'Cloned widget\'s properties to override'},

View file

@ -15,7 +15,7 @@ module.exports = class Keyboard extends Panel {
return Widget.defaults({
_matrix: 'matrix',
_class_specific: 'matrix',
keys: {type: 'number', value: 25, help: 'Defines the number keys'},
start: {type: 'number', value: 48, help: [

View file

@ -17,7 +17,7 @@ class Matrix extends StaticProperties(Panel, {scroll: false}) {
return Widget.defaults({
_matrix: 'matrix: widgets',
_class_specific: 'matrix: widgets',
widgetType: {type: 'string', value: 'button', help: 'Defines the type of the widgets in the matrix'},
quantity: {type: 'number', value: 4, help: 'Defines the number of widgets in the matrix'},
@ -28,7 +28,7 @@ class Matrix extends StaticProperties(Panel, {scroll: false}) {
'Note: by default, the widgets inherit from the matrix\' `id` and osc properties (`id` and `address` are appended with `/$`)'
]},
_matrixLayout: 'matrix: layout',
_separator: 'layout',
layout: {type: 'string', value: 'horizontal', choices: ['horizontal', 'vertical', 'grid'], help: 'Defines how children are laid out.'},
gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'},

View file

@ -18,7 +18,7 @@ class Modal extends Panel {
return Widget.defaults({
_modal: 'modal',
_class_specific: 'modal',
label: {type: 'string|boolean', value: 'auto', help: [
'Set to `false` to hide completely',
@ -28,7 +28,7 @@ class Modal extends Panel {
doubleTap: {type: 'boolean', value: false, help: 'Set to `true` to make the modal require a double tap to open instead of a single tap'},
variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
_modalWidgets: 'modal: popup',
_separator: 'popup',
popupLabel: {type: 'string|boolean', value: 'auto', help: 'Alternative label for the modal popup'},
popupWidth: {type: 'number|percentage', value: '80%', help: 'Modal popup\'s size'},

View file

@ -17,12 +17,12 @@ class Panel extends Container() {
return super.defaults({
_panel: 'panel',
_class_specific: 'panel',
variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'},
_panel_widgets: 'panel: widget container',
_separator1: 'widget container',
layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:'Defines how children are laid out.'},
justify: {type: 'string', value: 'start', choices: ['start', 'end', 'center', 'space-around', 'space-between'], help:'If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.'},
@ -30,7 +30,7 @@ class Panel extends Container() {
scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'},
_panel_tabs: 'panel: tab container',
_separator2: 'tab container',
verticalTabs: {type: 'boolean', value: false, help: 'Set to `true` to display for vertical tab layout'},

View file

@ -73,7 +73,7 @@ class PatchBay extends Container(Canvas) {
return super.defaults({
_patchbay:'patchbay',
_class_specific: 'patchbay',
inputs: {type: 'array|object', value: ['input_1', 'input_2'], help: [
'- `Array` of input names : `[\'input_1\', \'input_2\']`',

View file

@ -14,12 +14,12 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro
return Widget.defaults({
_panel: 'panel',
_class_specific: 'panel',
variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'},
_panel_widgets: 'panel: widget container',
_separator1: 'widget container',
layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:'Defines how children are laid out.'},
justify: {type: 'string', value: 'start', choices: ['start', 'end', 'center', 'space-around', 'space-between'], help:'If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.'},
@ -27,7 +27,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro
scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'},
_panel_tabs: 'panel: tab container',
_separator2: 'tab container',
verticalTabs: {type: 'boolean', value: false, help: 'Set to `true` to display for vertical tab layout'},
@ -37,7 +37,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro
'colorFill', 'colorStroke', 'alphaStroke', 'alphaFillOff',
], {
_children: 'children',
_children:'children',
widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously.'},
tabs: {type: 'array', value: [], help: 'Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously'},

View file

@ -16,7 +16,7 @@ class Tab extends Panel {
return Widget.defaults({
_panel: 'panel',
_class_specific: 'panel',
label: {type: 'string|boolean', value: 'auto', help: [
'Set to `false` to hide completely',
@ -27,7 +27,7 @@ class Tab extends Panel {
traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'},
// detached: {type: 'boolean', value: true, help: 'Set to `false` if the tab contains `frame` widgets that should not be reloaded when the tab opens'},
_panel_widgets: 'panel: widget container',
_separator1: 'widget container',
layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:'Defines how children are laid out.'},
justify: {type: 'string', value: 'start', choices: ['start', 'end', 'center', 'space-around', 'space-between'], help:'If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.'},
@ -35,7 +35,7 @@ class Tab extends Panel {
scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'},
_panel_tabs: 'panel: tab container',
_separator2: 'tab container',
verticalTabs: {type: 'boolean', value: false, help: 'Set to `true` to display for vertical tab layout'},
@ -44,7 +44,7 @@ class Tab extends Panel {
'colorStroke', 'alphaStroke', 'alphaFillOff', 'alphaFillOn'
], {
_children: 'children',
_children:'children',
widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously.'},
tabs: {type: 'array', value: [], help: 'Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously'},

View file

@ -25,7 +25,7 @@ class Html extends StaticProperties(Widget, {bypass: true}) {
return super.defaults({
_html:'html',
_class_specific: 'html',
html: {type: 'string', value: '', help: [
'Allowed HTML tags:',

View file

@ -15,7 +15,7 @@ module.exports = class Image extends StaticProperties(Widget, {bypass: true}) {
return super.defaults({
_image:'image',
_class_specific: 'image',
size: {type: 'string', value: 'cover', help: 'CSS background-size'},
position: {type: 'string', value: 'center', help: 'CSS background-position'},

View file

@ -16,7 +16,7 @@ class Svg extends StaticProperties(Widget, {bypass: true}) {
return super.defaults({
_svg:'svg',
_class_specific: 'svg',
svg: {type: 'string', value: '', help: [
'Svg xml definition:',

View file

@ -15,7 +15,7 @@ class Eq extends StaticProperties(Plot, {logScaleX: false, logScaleY:false, smoo
return Widget.defaults({
_eq:'eq',
_class_specific: 'eq',
filters: {type: 'array', value: '', help: [
'Each item must be an object with the following properties',

View file

@ -16,7 +16,7 @@ module.exports = class Plot extends StaticProperties(Canvas, {bypass: true, inte
return super.defaults({
_plot:'plot',
_class_specific: 'plot',
rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis'},
rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'},

View file

@ -17,7 +17,7 @@ class Visualizer extends StaticProperties(Plot, {rangeX: {min: '', max: ''}, dot
return Widget.defaults({
_visualizer:'visualizer',
_class_specific: 'visualizer',
duration: {type: 'number', value: 1, help: 'Defines visualization duration in seconds'},
framerate: {type: 'number', value: 30, help: 'Defines visualization framerate'},

View file

@ -15,7 +15,7 @@ module.exports = class Led extends StaticProperties(Widget, {bypass: true, inter
return super.defaults({
_led:'led',
_class_specific: 'led',
mode: {type: 'string', value: 'intensity', choices: ['intensity', 'color'], help: 'Defines how value is interpreted (see `value`)'},
range: {type: 'object', value: {min:0, max:1}, help: 'Value range'},

View file

@ -15,7 +15,7 @@ module.exports = class Text extends StaticProperties(Widget, {bypass: true, inte
return super.defaults({
_text: 'text',
_class_specific: 'text',
vertical: {type: 'boolean', value: false, help: 'Set to `true` to display the text vertically'},
wrap: {type: 'boolean', value: false, help: [

View file

@ -13,7 +13,7 @@ class CanvasWidget extends Canvas {
return super.defaults({
_canvas:'canvas',
_class_specific: 'canvas',
onCreate: {type: 'string', value: '', help: ' '},

View file

@ -19,7 +19,7 @@ module.exports = class MultiXy extends Pad {
return super.defaults({
_mutlixy: 'multi xy',
_class_specific: 'multi xy',
points: {type: 'integer|array', value: 2, help: [
'Defines the number of points on the pad',
@ -27,7 +27,7 @@ module.exports = class MultiXy extends Pad {
]},
_xy: 'xy',
_separator: 'xy',
pointSize: {type: 'integer', value: 20, help: 'Defines the points\' size'},
snap: {type: 'boolean', value: false, help: [

View file

@ -20,7 +20,7 @@ module.exports = class Rgb extends Widget {
return super.defaults({
_rgb:'rgb',
_class_specific: 'rgb',
snap: {type: 'boolean', value: false, help: [
'By default, the points are dragged from their initial position.',

View file

@ -17,7 +17,7 @@ module.exports = class Xy extends Pad {
return super.defaults({
_xy:'xy',
_class_specific: 'xy',
pointSize: {type: 'integer', value: 20, help: 'Defines the points\' size'},
snap: {type: 'boolean', value: false, help: [

View file

@ -18,7 +18,7 @@ class Gyroscope extends Widget {
return super.defaults({
_gyroscope: 'gyroscope',
_class_specific: 'gyroscope',
frequency: {type: 'number', value: 30, help: 'Value update frequency (updates per seconds)'},
normalize: {type: 'boolean', value: true, help: 'Normalize gravity related values'},

View file

@ -16,12 +16,12 @@ class Script extends Widget {
return super.defaults({
_script: 'script',
_class_specific: 'script',
event: {type: 'string', value: 'value', choices: ['value', 'keyboard'], help: 'Define which events trigger the script\'s execution.'},
script: {},
_eventKey: 'event: keyboard',
_separator: 'event: keyboard',
keyBinding: {type: 'string|array', value: '', help: 'Key combo `string` or `array` of strings (see <a href="https://github.com/RobertWHurst/KeyboardJS">KeyboardJS</a> documentation)'},
keyRepeat: {type: 'boolean', value: true, help: 'Set to `false` to prevent keydown repeats when holding the key combo pressed'},

View file

@ -15,7 +15,7 @@ module.exports = class Encoder extends StaticProperties(Knob, {angle: 360, range
return Widget.defaults({
_encoder: 'encoder',
_class_specific: 'encoder',
ticks: {type: 'number', value: 360, help: 'defines the granularity / verbosity of the encoder (number of step for a 360° arc)'},
back: {type: '*', value: -1, help: 'Defines which value is sent when rotating the encoder anticlockwise'},

View file

@ -13,7 +13,7 @@ module.exports = class Fader extends Slider {
return super.defaults({
_fader:'fader',
_class_specific: 'fader',
design: {type: 'string', value: 'default', choices: ['default', 'round', 'compact'], help: 'Design style'},
horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display the fader horizontally'},

View file

@ -13,7 +13,7 @@ module.exports = class Knob extends Slider {
return super.defaults({
_knob:'knob',
_class_specific: 'knob',
mode: {type: 'string', value: 'vertical', choices: ['vertical', 'circular', 'snap'], help: [
'- `circular`: relative move in circular motion',