@proximus/lavender-separator 1.4.9-beta.2 → 1.4.9
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 +24 -24
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PxElement as h, log as c } from "@proximus/lavender-common";
|
|
2
|
-
const b = ".separator{--separator-size: var(--px-size-border-m);--separator-direction--mobile-border-width: var(--separator-size) 0 0;--separator-direction--mobile-width: initial;--separator-direction--mobile-height: initial;clear:both;margin:0;border-style:solid;border-color:var( --separator-color-default, var(--px-color-border-main-default) );border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-horizontal--mobile{border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-vertical--mobile{width:var(--separator-size);height:100%;border-width:0 var(--separator-size) 0 0}:host([inverted]) .separator{border-color:var( --separator-color-inverted, var(--px-color-border-main-inverted) )}@media screen and (min-width:
|
|
2
|
+
const b = ".separator{--separator-size: var(--px-size-border-m);--separator-direction--mobile-border-width: var(--separator-size) 0 0;--separator-direction--mobile-width: initial;--separator-direction--mobile-height: initial;clear:both;margin:0;border-style:solid;border-color:var( --separator-color-default, var(--px-color-border-main-default) );border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-horizontal--mobile{border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-vertical--mobile{width:var(--separator-size);height:100%;border-width:0 var(--separator-size) 0 0}:host([inverted]) .separator{border-color:var( --separator-color-inverted, var(--px-color-border-main-inverted) )}@media only screen and (min-width: 768px){.separator-direction-horizontal--tablet{border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-vertical--tablet{width:var(--separator-size);height:100%;border-width:0 var(--separator-size) 0 0}}@media only screen and (min-width: 1025px){.separator-direction-horizontal--laptop{border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-vertical--laptop{width:var(--separator-size);height:100%;border-width:0 var(--separator-size) 0 0}}@media only screen and (min-width: 1441px){.separator-direction-horizontal--desktop{border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-vertical--desktop{width:var(--separator-size);height:100%;border-width:0 var(--separator-size) 0 0}}", p = new CSSStyleSheet();
|
|
3
3
|
p.replaceSync(b);
|
|
4
4
|
const u = [
|
|
5
5
|
"",
|
|
6
6
|
"default",
|
|
7
7
|
"horizontal",
|
|
8
8
|
"vertical"
|
|
9
|
-
],
|
|
9
|
+
], g = ["", "default", "none", "s", "m", "l"], v = [
|
|
10
10
|
"",
|
|
11
11
|
"main",
|
|
12
12
|
"brand",
|
|
@@ -54,29 +54,29 @@ const u = [
|
|
|
54
54
|
);
|
|
55
55
|
break;
|
|
56
56
|
case "size":
|
|
57
|
-
this.updateSize(t, r, e,
|
|
57
|
+
this.updateSize(t, r, e, g);
|
|
58
58
|
break;
|
|
59
59
|
case "color":
|
|
60
|
-
this.updateColor(t, r, e,
|
|
60
|
+
this.updateColor(t, r, e, v);
|
|
61
61
|
break;
|
|
62
62
|
default:
|
|
63
63
|
super.attributeChangedCallback(t, r, e);
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
updateSize(t, r, e,
|
|
68
|
-
const
|
|
67
|
+
updateSize(t, r, e, a) {
|
|
68
|
+
const o = (i) => {
|
|
69
69
|
i !== null && i !== "" && i !== "default" && this.$el.style.setProperty(
|
|
70
70
|
"--separator-size",
|
|
71
71
|
`var(--px-size-border-${i})`
|
|
72
72
|
);
|
|
73
73
|
};
|
|
74
|
-
this.checkName(
|
|
75
|
-
|
|
74
|
+
this.checkName(a, e) ? (o(r), o(e)) : c(
|
|
75
|
+
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
|
-
updateColor(t, r, e,
|
|
79
|
-
const
|
|
78
|
+
updateColor(t, r, e, a) {
|
|
79
|
+
const o = (i) => {
|
|
80
80
|
i !== null && i !== "" && i !== "default" && (this.$el.style.setProperty(
|
|
81
81
|
"--separator-color-default",
|
|
82
82
|
`var(--px-color-border-${i}-default)`
|
|
@@ -85,32 +85,32 @@ const u = [
|
|
|
85
85
|
`var(--px-color-border-${i}-inverted)`
|
|
86
86
|
));
|
|
87
87
|
};
|
|
88
|
-
this.checkName(
|
|
89
|
-
|
|
88
|
+
this.checkName(a, e) ? (o(r), o(e)) : c(
|
|
89
|
+
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
|
-
updateDirection(t, r, e,
|
|
93
|
-
const
|
|
94
|
-
|
|
92
|
+
updateDirection(t, r, e, a) {
|
|
93
|
+
const o = (i, s) => {
|
|
94
|
+
s !== null && s !== "" && s !== "default" && this.$el.classList.add(`separator-direction-${s}--${i}`);
|
|
95
95
|
};
|
|
96
|
-
if (!this.checkName(
|
|
96
|
+
if (!this.checkName(a, e))
|
|
97
97
|
c(
|
|
98
|
-
|
|
98
|
+
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
99
99
|
);
|
|
100
100
|
else if (t === "direction")
|
|
101
101
|
["mobile", "tablet", "laptop", "desktop"].forEach((i) => {
|
|
102
102
|
Array.from(this.$el.classList).find(
|
|
103
103
|
(d) => d.startsWith("separator-direction-") && d.endsWith(`--${i}`)
|
|
104
|
-
) ||
|
|
104
|
+
) || o(i, e);
|
|
105
105
|
});
|
|
106
106
|
else {
|
|
107
|
-
const i = t.split("--")[1],
|
|
107
|
+
const i = t.split("--")[1], s = Array.from(this.$el.classList).find(
|
|
108
108
|
(d) => d.startsWith("separator-direction-") && d.endsWith(`--${i}`)
|
|
109
109
|
);
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
s ? this.$el.classList.replace(
|
|
111
|
+
s,
|
|
112
112
|
`separator-direction-${e}--${i}`
|
|
113
|
-
) :
|
|
113
|
+
) : o(i, e);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
get direction() {
|
|
@@ -167,7 +167,7 @@ let l = n;
|
|
|
167
167
|
customElements.get("px-separator") || customElements.define("px-separator", l);
|
|
168
168
|
export {
|
|
169
169
|
l as Separator,
|
|
170
|
-
|
|
170
|
+
v as separatorColorValues,
|
|
171
171
|
u as separatorDirectionValues,
|
|
172
|
-
|
|
172
|
+
g as separatorSizeValues
|
|
173
173
|
};
|