@proximus/lavender-separator 1.4.9-beta.1 → 1.4.10-alpha.10
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
|
|
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: 48rem){.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 screen and (min-width: 64.0625rem){.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 screen and (min-width: 90.0625rem){.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
|
+
], v = ["", "default", "none", "s", "m", "l"], g = [
|
|
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, v);
|
|
58
58
|
break;
|
|
59
59
|
case "color":
|
|
60
|
-
this.updateColor(t, r, e,
|
|
60
|
+
this.updateColor(t, r, e, g);
|
|
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, o) {
|
|
68
|
+
const s = (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(o, e) ? (s(r), s(e)) : c(
|
|
75
|
+
`"${e}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
|
-
updateColor(t, r, e,
|
|
79
|
-
const
|
|
78
|
+
updateColor(t, r, e, o) {
|
|
79
|
+
const s = (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(o, e) ? (s(r), s(e)) : c(
|
|
89
|
+
`"${e}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
|
-
updateDirection(t, r, e,
|
|
93
|
-
const
|
|
94
|
-
|
|
92
|
+
updateDirection(t, r, e, o) {
|
|
93
|
+
const s = (i, a) => {
|
|
94
|
+
a !== null && a !== "" && a !== "default" && this.$el.classList.add(`separator-direction-${a}--${i}`);
|
|
95
95
|
};
|
|
96
|
-
if (!this.checkName(
|
|
96
|
+
if (!this.checkName(o, e))
|
|
97
97
|
c(
|
|
98
|
-
|
|
98
|
+
`"${e}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
|
|
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
|
+
) || s(i, e);
|
|
105
105
|
});
|
|
106
106
|
else {
|
|
107
|
-
const i = t.split("--")[1],
|
|
107
|
+
const i = t.split("--")[1], a = Array.from(this.$el.classList).find(
|
|
108
108
|
(d) => d.startsWith("separator-direction-") && d.endsWith(`--${i}`)
|
|
109
109
|
);
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
a ? this.$el.classList.replace(
|
|
111
|
+
a,
|
|
112
112
|
`separator-direction-${e}--${i}`
|
|
113
|
-
) :
|
|
113
|
+
) : s(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
|
+
g as separatorColorValues,
|
|
171
171
|
u as separatorDirectionValues,
|
|
172
|
-
|
|
172
|
+
v as separatorSizeValues
|
|
173
173
|
};
|