widgets/editor: add lock property
This commit is contained in:
parent
fb223eb08c
commit
46ba4115af
10 changed files with 59 additions and 4 deletions
|
|
@ -17,7 +17,7 @@ class UiInspectorField extends UiWidget {
|
|||
this.default = options.default
|
||||
this.tabIndex = options.tabIndex
|
||||
|
||||
this.container = html`<osc-inspector-field></osc-inspector-field>`
|
||||
this.container = html`<osc-inspector-field name="${this.name}"></osc-inspector-field>`
|
||||
this.label = this.container.appendChild(html`<label>${this.name}</label>`)
|
||||
|
||||
if (this.name === 'type' || this.name === 'widgetType') this.createTypeSelect()
|
||||
|
|
|
|||
|
|
@ -117,15 +117,17 @@ class UiInspector extends UiWidget {
|
|||
this.clearTimeout = null
|
||||
}
|
||||
|
||||
var content = html`<div></div>`
|
||||
|
||||
var widget = widgets[0],
|
||||
lock = widgets.some(w=>w.getProp('lock')),
|
||||
props = defaults[widget.props.type],
|
||||
tabIndex = 1000,
|
||||
codeEditorFields = []
|
||||
|
||||
this.widget = widget
|
||||
|
||||
var content = html`<div class="${lock ? 'lock' : ''}"></div>`
|
||||
|
||||
for (let categoryName in props) {
|
||||
|
||||
if (categoryName === 'children') continue
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ class UiTree extends UiWidget {
|
|||
id = widget.getProp('id'),
|
||||
node = html`<li class="${selected ? 'editing' : ''} ${!widget.getProp('visible') ? 'invisible' : ''}"
|
||||
data-widget="${widget.hash}" data-type="${widget.getProp('type')}">
|
||||
${raw(icon(widgetIcons[widget.getProp('type')] || 'root'))}${id}</li>`
|
||||
${raw(icon(widgetIcons[widget.getProp('type')] || 'root'))}${id}${widget.getProp('lock')? raw(icon('lock')) :''}</li>`
|
||||
|
||||
|
||||
node.depth = depth
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue