@proximus/lavender-dropdown 2.0.0-alpha.91 → 2.0.0-alpha.93
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/index.es.js +10 -10
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,9 +2,9 @@ var x = (o) => {
|
|
|
2
2
|
throw TypeError(o);
|
|
3
3
|
};
|
|
4
4
|
var b = (o, t, e) => t.has(o) || x("Cannot " + e);
|
|
5
|
-
var s = (o, t, e) => (b(o, t, "read from private field"), e ? e.call(o) : t.get(o)), c = (o, t, e) => t.has(o) ? x("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(o) : t.set(o, e),
|
|
5
|
+
var s = (o, t, e) => (b(o, t, "read from private field"), e ? e.call(o) : t.get(o)), c = (o, t, e) => t.has(o) ? x("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(o) : t.set(o, e), m = (o, t, e, i) => (b(o, t, "write to private field"), i ? i.call(o, e) : t.set(o, e), e), f = (o, t, e) => (b(o, t, "access private method"), e);
|
|
6
6
|
import { WithExtraAttributes as C, log as P } from "@proximus/lavender-common";
|
|
7
|
-
const S = ':host{position:relative}::slotted([slot="popover"]){position:absolute;border-radius:var(--px-radius-main, 8px);background:var(--px-color-background-container-light-default, #fff);box-shadow:0 20px 25px -5px #25252514;margin:0;padding:var(--px-padding-xs-mobile) 0;border:0;right:0;width:auto}:host([grow]) ::slotted([slot="trigger"]):after{right:0;padding-right:var(--px-padding-xs-mobile)}:host([anchoralignment="top-left"]) ::slotted([slot="popover"]){top:auto}:host([anchoralignment="top-right"]) ::slotted([slot="popover"]){top:auto}:host([anchoralignment="bottom-right"]) ::slotted([slot="popover"]){left:auto}@media screen and (max-width:
|
|
7
|
+
const S = ':host{position:relative}::slotted([slot="popover"]){position:absolute;border-radius:var(--px-radius-main, 8px);background:var(--px-color-background-container-light-default, #fff);box-shadow:0 20px 25px -5px #25252514;margin:0;padding:var(--px-padding-xs-mobile) 0;border:0;right:0;width:auto}:host([grow]) ::slotted([slot="trigger"]):after{right:0;padding-right:var(--px-padding-xs-mobile)}:host([anchoralignment="top-left"]) ::slotted([slot="popover"]){top:auto}:host([anchoralignment="top-right"]) ::slotted([slot="popover"]){top:auto}:host([anchoralignment="bottom-right"]) ::slotted([slot="popover"]){left:auto}@media screen and (max-width: 47.938rem){::slotted([slot="trigger"]){display:block;width:100%}:host([anchoralignment="top-left"]) ::slotted([slot="popover"]){left:var(--px-padding-s-mobile)}:host([anchoralignment="top-right"]) ::slotted([slot="popover"]){left:var(--px-padding-s-mobile)}}@media screen and (min-width: 48rem){::slotted([slot="popover"]){padding-block:var(--px-padding-s-desktop);right:auto;width:auto}}', T = [
|
|
8
8
|
"top-left",
|
|
9
9
|
"top-right",
|
|
10
10
|
"bottom-left",
|
|
@@ -23,7 +23,7 @@ function y(o, t, e = "bottom-left", i, d = !1) {
|
|
|
23
23
|
}
|
|
24
24
|
const w = new CSSStyleSheet();
|
|
25
25
|
w.replaceSync(S);
|
|
26
|
-
const
|
|
26
|
+
const u = "bottom-left";
|
|
27
27
|
var p, A, l, a, h, E;
|
|
28
28
|
class L extends C {
|
|
29
29
|
constructor() {
|
|
@@ -35,11 +35,11 @@ class L extends C {
|
|
|
35
35
|
this.template = () => `
|
|
36
36
|
<style>${this.css}</style>
|
|
37
37
|
<slot name="trigger"></slot>
|
|
38
|
-
<slot name="popover"></slot>`, this.isAboutToClose = !1,
|
|
38
|
+
<slot name="popover"></slot>`, this.isAboutToClose = !1, m(this, l, () => {
|
|
39
39
|
this.isAboutToClose || (this.$popoverElement.togglePopover({ source: this.$trigger }), this.$trigger.ariaExpanded = "true");
|
|
40
|
-
}),
|
|
40
|
+
}), m(this, a, () => {
|
|
41
41
|
this.$popoverElement.matches(":popover-open") && (this.isAboutToClose = !0, this.$trigger.ariaExpanded = "false");
|
|
42
|
-
}),
|
|
42
|
+
}), m(this, h, () => {
|
|
43
43
|
this.$popoverElement.matches(":popover-open") || setTimeout(() => {
|
|
44
44
|
this.isAboutToClose = !1;
|
|
45
45
|
});
|
|
@@ -95,7 +95,7 @@ class L extends C {
|
|
|
95
95
|
this.getAttribute("id") || this.setAttribute(
|
|
96
96
|
"id",
|
|
97
97
|
`px-dropdown-${Math.random().toString(36).substring(2, 15)}`
|
|
98
|
-
), this.getAttribute("anchoralignment") || this.setAttribute("anchoralignment",
|
|
98
|
+
), this.getAttribute("anchoralignment") || this.setAttribute("anchoralignment", u), y(
|
|
99
99
|
this.$trigger,
|
|
100
100
|
this.$popoverElement,
|
|
101
101
|
this.anchorAlignment,
|
|
@@ -142,12 +142,12 @@ class L extends C {
|
|
|
142
142
|
return this.querySelector('[slot="popover"]');
|
|
143
143
|
}
|
|
144
144
|
get anchorAlignment() {
|
|
145
|
-
return this.getAttribute("anchoralignment") ||
|
|
145
|
+
return this.getAttribute("anchoralignment") || u;
|
|
146
146
|
}
|
|
147
147
|
set anchorAlignment(e) {
|
|
148
148
|
T.includes(e) ? this.setAttribute("anchoralignment", e) : (P(
|
|
149
|
-
`Invalid anchor alignment value: ${e}. Using default ${
|
|
150
|
-
), this.setAttribute("anchoralignment",
|
|
149
|
+
`Invalid anchor alignment value: ${e}. Using default ${u}.`
|
|
150
|
+
), this.setAttribute("anchoralignment", u));
|
|
151
151
|
}
|
|
152
152
|
get usePolyfill() {
|
|
153
153
|
return this.hasAttribute("use-polyfill");
|