Skip to content

Commit

Permalink
Support configuring Input element for sitemaps (#1735)
Browse files Browse the repository at this point in the history
openhab/openhab-core#3398 added an Input element
to sitemaps.
This adds support for configuring this element to MainUI.
A PR for BasicUI to support input elements is in progress
(#1729).

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
  • Loading branch information
mherwege authored Feb 28, 2023
1 parent 27eeefc commit a028d1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bundles/org.openhab.ui/web/src/assets/sitemap-lexer.nearley
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
widgetvisiattr: 'visibility=',
widgetcolorattr: ['labelcolor=', 'valuecolor=', 'iconcolor='],
widgetswitchattr: 'switchSupport',
nlwidget: ['Switch ', 'Selection ', 'Slider ', 'List ', 'Setpoint ', 'Video ', 'Chart ', 'Webview ', 'Colorpicker ', 'Mapview ', 'Default '],
nlwidget: ['Switch ', 'Selection ', 'Slider ', 'List ', 'Setpoint ', 'Input ', 'Video ', 'Chart ', 'Webview ', 'Colorpicker ', 'Mapview ', 'Default '],
lwidget: ['Text ', 'Group ', 'Image ', 'Frame '],
identifier: /[A-Za-z0-9_]+/,
lparen: '(',
Expand All @@ -37,7 +37,7 @@
comma: ',',
NL: { match: /\n/, lineBreaks: true }
})
const requiresItem = ['Group', 'Chart', 'Switch', 'Mapview', 'Slider', 'Selection', 'List', 'Setpoint', 'Colorpicker', 'Default']
const requiresItem = ['Group', 'Chart', 'Switch', 'Mapview', 'Slider', 'Selection', 'List', 'Setpoint', 'Input ', 'Colorpicker', 'Default']

function getSitemap(d) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export default {
return 'f7:square_list'
case 'Setpoint':
return 'f7:plus_slash_minus'
case 'Input':
return 'f7:text_cursor'
case 'Video':
return 'f7:videocam'
case 'Chart':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ export default {
{ type: 'Slider', icon: 'slider_horizontal_3' },
{ type: 'Frame', icon: 'macwindow' },
{ type: 'Setpoint', icon: 'plus_slash_minus' },
{ type: 'Input', icon: 'text_cursor' },
{ type: 'Default', icon: 'rectangle' },
{ type: 'Group', icon: 'square_stack_3d_down_right' },
{ type: 'Chart', icon: 'chart_bar_square' },
Expand All @@ -253,7 +254,7 @@ export default {
{ type: 'Video', icon: 'videocam' }
],
linkableWidgetTypes: ['Sitemap', 'Text', 'Frame', 'Group', 'Image'],
widgetTypesRequiringItem: ['Group', 'Chart', 'Switch', 'Mapview', 'Slider', 'Selection', 'List', 'Setpoint', 'Colorpicker', 'Default']
widgetTypesRequiringItem: ['Group', 'Chart', 'Switch', 'Mapview', 'Slider', 'Selection', 'List', 'Setpoint', 'Input', 'Colorpicker', 'Default']
}
},
created () {
Expand Down

0 comments on commit a028d1c

Please sign in to comment.