diff --git a/bundles/org.openhab.ui/web/package.json b/bundles/org.openhab.ui/web/package.json index 99cca105d3..480d47c32b 100644 --- a/bundles/org.openhab.ui/web/package.json +++ b/bundles/org.openhab.ui/web/package.json @@ -88,6 +88,7 @@ "vue": "^2.6.12", "vue-async-computed": "^3.9.0", "vue-codemirror": "^4.0.6", + "vue-draggable-resizable": "^2.3.0", "vue-echarts": "^4.1.0", "vue-fragment": "^1.5.1", "vue-fullscreen": "^2.2.0", diff --git a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/layout/index.js b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/layout/index.js index 992c16d3d0..0b21a03c1f 100644 --- a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/layout/index.js +++ b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/layout/index.js @@ -67,3 +67,31 @@ export function OhGridLayoutDefinition () { pb('showFullscreenIcon', 'Show Fullscreen Icon', 'Show a fullscreen icon on the top right corner (default false)') ]) } + +export function OhPlanItemDefinition () { + return new WidgetDefinition('oh-plan-item', 'Plan Item', 'Specific attributes to display widgets on a plan.') + .paramGroup(pg('appearance', 'Layout Settings'), [ + pb('notStyled', 'Preserve classic style', 'Preserve classic appearance of widgets as in standard layout pages.'), + pb('noPlanShadow', 'No elements shadow', 'Do not shadow inner elements of standard widgets') + .v((value, configuration, configDescription, parameters) => { return configuration.notStyled !== true }) + ]) +} + +export function OhPlanLayoutDefinition () { + return new WidgetDefinition('oh-plan-layout', 'Plan Layout', 'Position widgets on a plan layout with arbitrary position and size down to pixel resolution') + .paramGroup(pg('layout', 'Layout Settings'), [ + pn('grid', 'Grid size', 'Grid size in pixels used to snap content (default 5)') + ]) + .paramGroup(pg('screenSettings', 'Screen Settings'), [ + pn('screenWidth', 'Screen Width', 'Screen width in pixels (default 1280)'), + pn('screenHeight', 'Screen Height', 'Screen width in pixels (default 720)'), + pb('scale', 'Scaling', 'Scale content to screen width (can lead to unexpected styling issues) (default false)'), + pt('imageUrl', 'Image URL', 'The URL of the image to display as background').c('url'), + pt('imageSrcSet', 'Image Source Set', 'The src-set attribute of background image element to take into account mulitple device resolutions. For example: "/static/floorplans/floor-0.jpg, /static/floorplans/floor-0@2x.jpg 2x"') + ]) + .paramGroup(pg('shadow', 'Plan items shadow'), [ + pt('boxShadow', 'Box shadow', 'Shadow applied to box elements (box-shadow CSS syntax).').a(), + pt('textShadow', 'Text shadow', 'Shadow applied to text elements or font icons (text-shadow CSS syntax)').a(), + pt('filterShadow', 'Fitler Shadow', 'Shadow applied to raster or SVG image elements (filter: drop-shadow() CSS syntax)').a() + ]) +} diff --git a/bundles/org.openhab.ui/web/src/components/widgets/layout/index.js b/bundles/org.openhab.ui/web/src/components/widgets/layout/index.js index 2bb41c8df0..e5fd5ff0b3 100644 --- a/bundles/org.openhab.ui/web/src/components/widgets/layout/index.js +++ b/bundles/org.openhab.ui/web/src/components/widgets/layout/index.js @@ -6,3 +6,5 @@ export { default as OhGridCol } from './oh-grid-col.vue' export { default as OhGridCells } from './oh-grid-cells.vue' export { default as OhMasonry } from './oh-masonry.vue' export { default as OhGridLayout } from './oh-grid-layout.vue' +export { default as OhPlanLayout } from './oh-plan-layout.vue' +export { default as OhPlanItem } from './oh-plan-item.vue' diff --git a/bundles/org.openhab.ui/web/src/components/widgets/layout/oh-layout-page.vue b/bundles/org.openhab.ui/web/src/components/widgets/layout/oh-layout-page.vue index b6e8e52072..802cd9168c 100644 --- a/bundles/org.openhab.ui/web/src/components/widgets/layout/oh-layout-page.vue +++ b/bundles/org.openhab.ui/web/src/components/widgets/layout/oh-layout-page.vue @@ -1,6 +1,6 @@