From 0e7fb0044e92d93f508fd4b118874efcca39b553 Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Mon, 24 Jun 2024 23:55:28 +0200 Subject: [PATCH] feat: new comprehensive options display #213 --- source/components/form/context-error.mjs | 2 ++ source/components/form/context-help.mjs | 1 + source/dom/customelement.mjs | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/source/components/form/context-error.mjs b/source/components/form/context-error.mjs index bd213577b..94c1abc82 100644 --- a/source/components/form/context-error.mjs +++ b/source/components/form/context-error.mjs @@ -118,6 +118,8 @@ class ContextError extends Popper { classes: { button: "monster-theme-error-2", }, + + display: "inline-block" }); } diff --git a/source/components/form/context-help.mjs b/source/components/form/context-help.mjs index 82479607b..550f06ada 100644 --- a/source/components/form/context-help.mjs +++ b/source/components/form/context-help.mjs @@ -88,6 +88,7 @@ class ContextHelp extends Popper { main: getTemplate(), }, mode: "auto", + display: "inline-block" }); } diff --git a/source/dom/customelement.mjs b/source/dom/customelement.mjs index d15d1e028..d505c69cf 100644 --- a/source/dom/customelement.mjs +++ b/source/dom/customelement.mjs @@ -327,6 +327,7 @@ class CustomElement extends HTMLElement { * @property {Object} templates Specifies the templates used by the control. * @property {string} templates.main=undefined Specifies the main template used by the control. * @property {Object} templateMapping Specifies the mapping of templates. + * @property {string} display=block Specifies the display mode of the control. * @since 1.8.0 */ get defaults() { @@ -338,6 +339,7 @@ class CustomElement extends HTMLElement { main: undefined, }, templateMapping: {}, + display: "block" }; } @@ -595,6 +597,8 @@ class CustomElement extends HTMLElement { let elements; let nodeList; + this.style.setProperty("display", this.getOption("display")); + // Extract options from attributes and set them const AttributeOptions = getOptionsFromAttributes.call(this); if ( -- GitLab