Add editor support for max-height and min-height .

This commit is contained in:
Dermot Duffy
2023-04-11 20:02:46 -07:00
parent 1da7510c3a
commit 9476fd96af
5 changed files with 16 additions and 4 deletions
+2
View File
@@ -239,6 +239,8 @@ const CONF_DIMENSIONS = 'dimensions' as const;
export const CONF_DIMENSIONS_ASPECT_RATIO = `${CONF_DIMENSIONS}.aspect_ratio` as const; export const CONF_DIMENSIONS_ASPECT_RATIO = `${CONF_DIMENSIONS}.aspect_ratio` as const;
export const CONF_DIMENSIONS_ASPECT_RATIO_MODE = export const CONF_DIMENSIONS_ASPECT_RATIO_MODE =
`${CONF_DIMENSIONS}.aspect_ratio_mode` as const; `${CONF_DIMENSIONS}.aspect_ratio_mode` as const;
export const CONF_DIMENSIONS_MAX_HEIGHT = `${CONF_DIMENSIONS}.max_height` as const;
export const CONF_DIMENSIONS_MIN_HEIGHT = `${CONF_DIMENSIONS}.min_height` as const;
export const CONF_OVERRIDES = 'overrides' as const; export const CONF_OVERRIDES = 'overrides' as const;
+4
View File
@@ -142,6 +142,8 @@ import {
CONF_VIEW_UPDATE_FORCE, CONF_VIEW_UPDATE_FORCE,
CONF_VIEW_UPDATE_SECONDS, CONF_VIEW_UPDATE_SECONDS,
MEDIA_CHUNK_SIZE_MAX, MEDIA_CHUNK_SIZE_MAX,
CONF_DIMENSIONS_MAX_HEIGHT,
CONF_DIMENSIONS_MIN_HEIGHT,
} from './const.js'; } from './const.js';
import { localize } from './localize/localize.js'; import { localize } from './localize/localize.js';
import frigate_card_editor_style from './scss/editor.scss'; import frigate_card_editor_style from './scss/editor.scss';
@@ -1978,6 +1980,8 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
this._aspectRatioModes, this._aspectRatioModes,
)} )}
${this._renderStringInput(CONF_DIMENSIONS_ASPECT_RATIO)} ${this._renderStringInput(CONF_DIMENSIONS_ASPECT_RATIO)}
${this._renderStringInput(CONF_DIMENSIONS_MAX_HEIGHT)}
${this._renderStringInput(CONF_DIMENSIONS_MIN_HEIGHT)}
</div>` </div>`
: ''} : ''}
${this._renderOptionSetHeader( ${this._renderOptionSetHeader(
+3 -1
View File
@@ -186,7 +186,9 @@
"dynamic": "Aspect ratio adjusts to media", "dynamic": "Aspect ratio adjusts to media",
"static": "Static aspect ratio", "static": "Static aspect ratio",
"unconstrained": "Unconstrained aspect ratio" "unconstrained": "Unconstrained aspect ratio"
} },
"max_height": "Maximum card height in CSS units (e.g. '100vh')",
"min_height": "Minimum card height in CSS units (e.g. '100px')"
}, },
"image": { "image": {
"layout": "Image Layout", "layout": "Image Layout",
+3 -1
View File
@@ -186,7 +186,9 @@
"dynamic": "Le proporzioni si adattano ai media", "dynamic": "Le proporzioni si adattano ai media",
"static": "Proporzioni statiche", "static": "Proporzioni statiche",
"unconstrained": "Proporzioni non vincolate" "unconstrained": "Proporzioni non vincolate"
} },
"max_height": "",
"min_height": ""
}, },
"image": { "image": {
"layout": "Disposizione dell'immagine", "layout": "Disposizione dell'immagine",
+3 -1
View File
@@ -186,7 +186,9 @@
"dynamic": "A proporção se ajusta à mídia", "dynamic": "A proporção se ajusta à mídia",
"static": "Proporção estática", "static": "Proporção estática",
"unconstrained": "Proporção irrestrita" "unconstrained": "Proporção irrestrita"
} },
"max_height": "",
"min_height": ""
}, },
"image": { "image": {
"layout": "Layout da imagem", "layout": "Layout da imagem",