From bc21948ea6e56435b92c5c5335b43bf76096316c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Lehe=C4=8Dka?= Date: Fri, 1 Sep 2023 16:16:32 +0200 Subject: [PATCH] rendition of disabled navigation control --- src/pb-navigation.js | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/pb-navigation.js b/src/pb-navigation.js index c1f5f097..6283333b 100644 --- a/src/pb-navigation.js +++ b/src/pb-navigation.js @@ -27,6 +27,16 @@ export class PbNavigation extends pbHotkeys(pbMixin(LitElement)) { */ keyboard: { type: String + }, + /** + * Rendition of the navigation element if it's disabled + * Possible values: + * - hidden (default if not set; control is removed from the document layout) + * - invisible (controll is hidden, but keeped in the document layout) + * - visible (control is visible) + */ + rendition : { + type: String } }; } @@ -79,13 +89,20 @@ export class PbNavigation extends pbHotkeys(pbMixin(LitElement)) { static get styles() { return css` - :host { - display: inline; - } - :host([disabled]) { - display: none; - } - `; + :host { + display: inline; + } + :host([disabled]):host(:not([rendition])), :host([disabled]):host([rendition="hidden"]) { + display: none; + } + :host([disabled]):host([rendition="invisible"]) { + visibility: hidden; + } + :host([disabled]):host([rendition="visible"]) { + visibility: visible; + cursor: not-allowed; + } + `; } }