@proximus/lavender-separator 2.0.0-alpha.100 → 2.0.0-alpha.102
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 +23 -23
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -6,7 +6,7 @@ const u = [
|
|
|
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
|
};
|