@proximus/lavender-drawer 2.0.0-alpha.202 → 2.0.0-alpha.204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Drawer.d.ts +1 -1
- package/dist/custom-elements.json +7 -9
- package/dist/index.es.js +14 -11
- package/dist/web-types.json +1 -3
- package/package.json +1 -1
package/dist/Drawer.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ import '@proximus/lavender-heading';
|
|
|
6
6
|
import { type Icon } from '@proximus/lavender-icon';
|
|
7
7
|
export declare const HIDE_EVENT = "px.lavender.drawer.hide";
|
|
8
8
|
export declare class Drawer extends HTMLElement {
|
|
9
|
+
protected static readonly template: HTMLTemplateElement;
|
|
9
10
|
observer: MutationObserver | null;
|
|
10
11
|
private previousFocusedElement;
|
|
11
|
-
template: string;
|
|
12
12
|
constructor();
|
|
13
13
|
connectedCallback(): void;
|
|
14
14
|
static get observedAttributes(): string[];
|
|
@@ -19,6 +19,13 @@
|
|
|
19
19
|
"description": "",
|
|
20
20
|
"name": "Drawer",
|
|
21
21
|
"members": [
|
|
22
|
+
{
|
|
23
|
+
"kind": "field",
|
|
24
|
+
"name": "template",
|
|
25
|
+
"privacy": "protected",
|
|
26
|
+
"static": true,
|
|
27
|
+
"readonly": true
|
|
28
|
+
},
|
|
22
29
|
{
|
|
23
30
|
"kind": "field",
|
|
24
31
|
"name": "observer",
|
|
@@ -36,11 +43,6 @@
|
|
|
36
43
|
"privacy": "private",
|
|
37
44
|
"default": "null"
|
|
38
45
|
},
|
|
39
|
-
{
|
|
40
|
-
"kind": "field",
|
|
41
|
-
"name": "template",
|
|
42
|
-
"default": "`<dialog popover role=\"dialog\" aria-modal=\"true\" > <div id=\"container\"> <px-vstack gap=\"heading-to-subtitle\" id=\"header\"> <px-h1 variant=\"title-2xl\"> <slot name=\"title\"></slot> </px-h1> <px-h2 variant=\"subtitle\" color=\"neutral\"> <slot name=\"subtitle\"></slot> </px-h2> </px-vstack> <div id=\"content\"> <slot></slot> </div> <px-vstack gap=\"l\" id=\"footer\"> <px-separator size=\"m\"></px-separator> <px-stack gap=\"s\" justify-content=\"flex-end\" align-items=\"center\" align-items--mobile=\"stretch\" direction=\"row\" direction--mobile=\"column-reverse\" > <slot name=\"footer\"></slot> </px-stack> </px-vstack> <px-button-icon variant=\"secondary\" size=\"small\" id=\"close\"> <px-icon name=\"cross\" from=\"lavender\"></px-icon> </px-button-icon> </div> </dialog>`"
|
|
43
|
-
},
|
|
44
46
|
{
|
|
45
47
|
"kind": "method",
|
|
46
48
|
"name": "show"
|
|
@@ -132,10 +134,6 @@
|
|
|
132
134
|
"kind": "field",
|
|
133
135
|
"name": "fullscreenDesktop"
|
|
134
136
|
},
|
|
135
|
-
{
|
|
136
|
-
"kind": "field",
|
|
137
|
-
"name": "innerHTML"
|
|
138
|
-
},
|
|
139
137
|
{
|
|
140
138
|
"kind": "field",
|
|
141
139
|
"name": "adoptedStyleSheets",
|
package/dist/index.es.js
CHANGED
|
@@ -3,13 +3,16 @@ import "@proximus/lavender-layout";
|
|
|
3
3
|
import "@proximus/lavender-button-icon";
|
|
4
4
|
import "@proximus/lavender-icon";
|
|
5
5
|
import "@proximus/lavender-heading";
|
|
6
|
-
import { booleanPropertyToAttributeSetter as e,
|
|
6
|
+
import { booleanPropertyToAttributeSetter as e, createTemplate as t, propertyToAttributeSetter as n, renderTemplate as r } from "@proximus/lavender-common";
|
|
7
7
|
//#region src/drawer.css?inline
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
8
|
+
var i = ":host *{box-sizing:border-box}::backdrop{-webkit-backdrop-filter:saturate(180%)blur(15px);backdrop-filter:saturate(180%)blur(15px);background:#0000004d}dialog{box-shadow:none;border-radius:var(--px-radius-main) var(--px-radius-main) 0 0;background-color:var(--px-color-background-surface-light);border:0;width:100%;margin:auto 0 0;padding:0;animation:.3s dialog-fade-in-bottom}#container{column-gap:var(--px-spacing-l-mobile);padding:var(--px-padding-l-mobile);grid-template:\"header close\"\"content content\"1fr\"footer footer\"/1fr auto;max-height:90dvh;display:grid}#header{margin-bottom:var(--px-spacing-l-mobile);grid-area:header}#close{grid-area:close}#content{grid-area:content;overflow:hidden auto}#footer{margin-top:var(--px-spacing-l-mobile);grid-area:footer}:host([fullscreen]) #container{height:90dvh}@media screen and (width<=47.938rem){:host([fullscreen--mobile]) #container{height:90dvh}}@media screen and (width>=48rem) and (width<=64rem){:host([fullscreen--tablet]) #container{height:90dvh}}@media screen and (width>=48rem){#container{column-gap:var(--px-spacing-l-tablet);padding:var(--px-padding-l-tablet)}#header{margin-bottom:var(--px-spacing-l-tablet)}#footer{margin-top:var(--px-spacing-l-tablet)}}@media screen and (width>=64.0625rem) and (width<=90rem){:host([fullscreen--laptop]:not([showfrom=left]):not([showfrom=right])) #container{height:90dvh}}@media screen and (width>=64.0625rem){#container{column-gap:var(--px-spacing-l-laptop);padding:var(--px-padding-l-laptop);max-width:var(--px-content-wrapper-max-width-laptop);margin:0 auto}#header{margin-bottom:var(--px-spacing-l-laptop)}#footer{margin-top:var(--px-spacing-l-laptop)}:is(:host([showfrom=right]),:host([showfrom=left])) dialog{width:75%;height:100%}:is(:host([showfrom=right]),:host([showfrom=left])) #container{height:100%;max-height:100%}:host([showfrom=right]) dialog{border-radius:var(--px-radius-main) 0 0 var(--px-radius-main);margin:0 0 0 auto;animation:.3s dialog-fade-in-right}:host([showfrom=right]) #container{margin:0 auto 0 0}:host([showfrom=left]) dialog{border-radius:0 var(--px-radius-main) var(--px-radius-main) 0;margin:0 auto 0 0;animation:.3s dialog-fade-in-left}:host([showfrom=left]) #container{margin:0 0 0 auto}:is(:host([showfrom=right][fullscreen]),:host([showfrom=left][fullscreen])) #container{height:100%}}@media screen and (width>=90.0625rem){#container{column-gap:var(--px-spacing-l-desktop);padding:var(--px-padding-l-desktop)}#header{margin-bottom:var(--px-spacing-l-desktop)}#footer{margin-top:var(--px-spacing-l-desktop)}:host([fullscreen--desktop]:not([showfrom=left]):not([showfrom=right])) #container{height:90dvh}}@keyframes dialog-fade-in-right{0%{margin-right:-1080px}to{margin-right:0}}@keyframes dialog-fade-in-left{0%{margin-left:-1080px}to{margin-left:0}}@keyframes dialog-fade-in-bottom{0%{margin-bottom:-200px}to{margin-bottom:0}}", a = new CSSStyleSheet();
|
|
9
|
+
a.replaceSync(i);
|
|
10
|
+
var o = "px.lavender.drawer.hide", s = class i extends HTMLElement {
|
|
11
|
+
static {
|
|
12
|
+
this.template = t("<dialog popover role=\"dialog\" aria-modal=\"true\" ><div id=\"container\"><px-vstack gap=\"heading-to-subtitle\" id=\"header\"><px-h1 variant=\"title-2xl\"><slot name=\"title\"></slot></px-h1><px-h2 variant=\"subtitle\" color=\"neutral\"><slot name=\"subtitle\"></slot></px-h2></px-vstack><div id=\"content\"><slot></slot></div><px-vstack gap=\"l\" id=\"footer\"><px-separator size=\"m\"></px-separator><px-stack\n gap=\"s\"\n justify-content=\"flex-end\"\n align-items=\"center\"\n align-items--mobile=\"stretch\"\n direction=\"row\"\n direction--mobile=\"column-reverse\"\n ><slot name=\"footer\"></slot></px-stack></px-vstack><px-button-icon variant=\"secondary\" size=\"small\" id=\"close\"><px-icon name=\"cross\" from=\"lavender\"></px-icon></px-button-icon></div></dialog>");
|
|
13
|
+
}
|
|
11
14
|
constructor() {
|
|
12
|
-
super(), this.observer = null, this.previousFocusedElement = null, this.
|
|
15
|
+
super(), this.observer = null, this.previousFocusedElement = null, this.attachShadow({ mode: "open" }), r(this.shadowRoot, i.template), this.shadowRoot.adoptedStyleSheets = [a];
|
|
13
16
|
}
|
|
14
17
|
connectedCallback() {
|
|
15
18
|
this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.$opener && this.addOpenListener(), this.$closer && this.addCloseListener(), this.hasAttribute("showfrom") || this.setAttribute("showfrom", "bottom"), this.$closeButton.addEventListener("click", () => {
|
|
@@ -53,7 +56,7 @@ var i = "px.lavender.drawer.hide", a = class extends HTMLElement {
|
|
|
53
56
|
this.previousFocusedElement = e?.shadowRoot?.activeElement ?? e, this.$dialog.showPopover?.(), document.body.style.overflow = "hidden";
|
|
54
57
|
}
|
|
55
58
|
hide() {
|
|
56
|
-
this.$dialog.hidePopover?.(), document.body.style.overflow = "", this.previousFocusedElement?.focus(), this.previousFocusedElement = null, this.dispatchEvent(new Event(
|
|
59
|
+
this.$dialog.hidePopover?.(), document.body.style.overflow = "", this.previousFocusedElement?.focus(), this.previousFocusedElement = null, this.dispatchEvent(new Event(o, {
|
|
57
60
|
bubbles: !0,
|
|
58
61
|
composed: !0
|
|
59
62
|
}));
|
|
@@ -105,19 +108,19 @@ var i = "px.lavender.drawer.hide", a = class extends HTMLElement {
|
|
|
105
108
|
return this.getAttribute("close-button-aria-label");
|
|
106
109
|
}
|
|
107
110
|
set closeButtonAriaLabel(e) {
|
|
108
|
-
|
|
111
|
+
n(this, "close-button-aria-label", e);
|
|
109
112
|
}
|
|
110
113
|
get openedby() {
|
|
111
114
|
return this.getAttribute("openedby");
|
|
112
115
|
}
|
|
113
116
|
set openedby(e) {
|
|
114
|
-
|
|
117
|
+
n(this, "openedby", e);
|
|
115
118
|
}
|
|
116
119
|
get closedby() {
|
|
117
120
|
return this.getAttribute("closedby");
|
|
118
121
|
}
|
|
119
122
|
set closedby(e) {
|
|
120
|
-
|
|
123
|
+
n(this, "closedby", e);
|
|
121
124
|
}
|
|
122
125
|
get fullscreen() {
|
|
123
126
|
return this.hasAttribute("fullscreen");
|
|
@@ -150,6 +153,6 @@ var i = "px.lavender.drawer.hide", a = class extends HTMLElement {
|
|
|
150
153
|
e(this, "fullscreen--desktop", t);
|
|
151
154
|
}
|
|
152
155
|
};
|
|
153
|
-
customElements.get("px-drawer") || customElements.define("px-drawer",
|
|
156
|
+
customElements.get("px-drawer") || customElements.define("px-drawer", s);
|
|
154
157
|
//#endregion
|
|
155
|
-
export {
|
|
158
|
+
export { s as Drawer, o as HIDE_EVENT };
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@proximus/lavender-drawer",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.204",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"js": {
|
|
29
29
|
"properties": [
|
|
30
30
|
{ "name": "observer", "type": "MutationObserver | null" },
|
|
31
|
-
{ "name": "template" },
|
|
32
31
|
{ "name": "$opener" },
|
|
33
32
|
{ "name": "$closer" },
|
|
34
33
|
{ "name": "$closeButton" },
|
|
@@ -45,7 +44,6 @@
|
|
|
45
44
|
{ "name": "fullscreenTablet" },
|
|
46
45
|
{ "name": "fullscreenLaptop" },
|
|
47
46
|
{ "name": "fullscreenDesktop" },
|
|
48
|
-
{ "name": "innerHTML" },
|
|
49
47
|
{ "name": "adoptedStyleSheets", "type": "array" }
|
|
50
48
|
],
|
|
51
49
|
"events": [{ "name": "HIDE_EVENT", "type": "Event" }]
|