@proximus/lavender-modal 1.0.0-alpha.21 → 1.0.0-alpha.23
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 +56 -59
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -25,27 +25,27 @@ const q = ["", "default", "small"], M = ["", "default", "secondary", "naked"], b
|
|
|
25
25
|
super.connectedCallback();
|
|
26
26
|
const t = this.querySelector("px-icon");
|
|
27
27
|
if (t) {
|
|
28
|
-
const e = t.getAttribute("size"),
|
|
28
|
+
const e = t.getAttribute("size"), i = t.getAttribute("color");
|
|
29
29
|
t.addEventListener("click", () => {
|
|
30
30
|
this.$el.focus();
|
|
31
|
-
}), e || t.setAttribute("size", "s"), this.size === "small" && t.setAttribute("size", "
|
|
31
|
+
}), e || t.setAttribute("size", "s"), this.size === "small" && t.setAttribute("size", "xs"), i || t.setAttribute("color", "inherit");
|
|
32
32
|
}
|
|
33
33
|
L(this, this.$el);
|
|
34
34
|
}
|
|
35
|
-
attributeChangedCallback(t, e,
|
|
36
|
-
if (e !==
|
|
35
|
+
attributeChangedCallback(t, e, i) {
|
|
36
|
+
if (e !== i)
|
|
37
37
|
switch (t) {
|
|
38
38
|
case "loading":
|
|
39
39
|
this.updateLoading();
|
|
40
40
|
break;
|
|
41
41
|
case "size":
|
|
42
|
-
this.updateSize(e,
|
|
42
|
+
this.updateSize(e, i, q);
|
|
43
43
|
break;
|
|
44
44
|
case "variant":
|
|
45
|
-
this.updateVariant(e,
|
|
45
|
+
this.updateVariant(e, i, M);
|
|
46
46
|
break;
|
|
47
47
|
default:
|
|
48
|
-
super.attributeChangedCallback(t, e,
|
|
48
|
+
super.attributeChangedCallback(t, e, i);
|
|
49
49
|
break;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -58,11 +58,11 @@ const q = ["", "default", "small"], M = ["", "default", "secondary", "naked"], b
|
|
|
58
58
|
updateLoading() {
|
|
59
59
|
this.$el.classList.toggle("btn-icon--state-loading");
|
|
60
60
|
}
|
|
61
|
-
updateSize(t, e,
|
|
62
|
-
this.checkName(
|
|
61
|
+
updateSize(t, e, i) {
|
|
62
|
+
this.checkName(i, e) ? (t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`btn-icon--size-${t}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`btn-icon--size-${e}`)) : console.error(`${e} is not a valid size value`);
|
|
63
63
|
}
|
|
64
|
-
updateVariant(t, e,
|
|
65
|
-
this.checkName(
|
|
64
|
+
updateVariant(t, e, i) {
|
|
65
|
+
this.checkName(i, e) ? (t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`btn-icon--variant-${t}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`btn-icon--variant-${e}`)) : console.error(`${e} is not a valid variant value`);
|
|
66
66
|
}
|
|
67
67
|
get inverted() {
|
|
68
68
|
return this.getAttribute("inverted");
|
|
@@ -92,16 +92,16 @@ const q = ["", "default", "small"], M = ["", "default", "secondary", "naked"], b
|
|
|
92
92
|
b.nativeName = "button";
|
|
93
93
|
let a = b;
|
|
94
94
|
customElements.get("px-button-icon") || customElements.define("px-button-icon", a);
|
|
95
|
-
const R = "h1,.style-title-4xl,::slotted(h1),h2,.style-title-3xl,::slotted(h2),h3,.style-title-2xl,::slotted(h3),h4,.style-title-xl,::slotted(h4),h5,.style-title-l,::slotted(h5),h6,.style-title-m,::slotted(h6),.style-title-s,.style-subtitle{margin:0;font-family:var(--px-font-family);color:var(
|
|
95
|
+
const R = "h1,.style-title-4xl,::slotted(h1),h2,.style-title-3xl,::slotted(h2),h3,.style-title-2xl,::slotted(h3),h4,.style-title-xl,::slotted(h4),h5,.style-title-l,::slotted(h5),h6,.style-title-m,::slotted(h6),.style-title-s,.style-subtitle{margin:0;font-family:var(--px-font-family);color:var(--heading-color-default, var(--px-color-text-brand-default));text-align:var(--heading-text-align--mobile, left);font-size:var(--px-text-size-heading-s-mobile);line-height:var(--px-font-line-height-m);font-weight:var(--px-font-weight-title)}:host([inverted]) h1,:host([inverted]) .style-title-4xl,:host([inverted]) ::slotted(h1),:host([inverted]) h2,:host([inverted]) .style-title-3xl,:host([inverted]) ::slotted(h2),:host([inverted]) h3,:host([inverted]) .style-title-2xl,:host([inverted]) ::slotted(h3),:host([inverted]) h4,:host([inverted]) .style-title-xl,:host([inverted]) ::slotted(h4),:host([inverted]) h5,:host([inverted]) .style-title-l,:host([inverted]) ::slotted(h5),:host([inverted]) h6,:host([inverted]) .style-title-m,:host([inverted]) ::slotted(h6),:host([inverted]) .style-title-s,:host([inverted]) .style-subtitle{color:var(--heading-color-inverted, var(--px-color-text-brand-inverted))}h1,.style-title-4xl,::slotted(h1){font-size:var(--px-text-size-heading-5xl-mobile);line-height:var(--px-font-line-height-s);font-weight:var(--px-font-weight-title-large)}h2,.style-title-3xl,::slotted(h2){font-size:var(--px-text-size-heading-4xl-mobile);line-height:var(--px-font-line-height-s);font-weight:var(--px-font-weight-title-large)}h3,.style-title-2xl,::slotted(h3){font-size:var(--px-text-size-heading-3xl-mobile);line-height:var(--px-font-line-height-s)}h4,.style-title-xl,::slotted(h4){font-size:var(--px-text-size-heading-2xl-mobile)}h5,.style-title-l,::slotted(h5){font-size:var(--px-text-size-heading-l-mobile)}h6,.style-title-m,::slotted(h6){font-size:var(--px-text-size-heading-m-mobile)}.style-subtitle{font-size:var(--px-text-size-heading-xl-mobile);font-weight:var(--px-font-weight-subtitle)}.style-title-s{font-size:var(--px-text-size-heading-s-mobile)}@media only screen and (min-width: 768px){h1,.style-title-4xl,::slotted(h1),h2,.style-title-3xl,::slotted(h2),h3,.style-title-2xl,::slotted(h3),h4,.style-title-xl,::slotted(h4),h5,.style-title-l,::slotted(h5),h6,.style-title-m,::slotted(h6),.style-title-s,.style-subtitle{text-align:var(--heading-text-align--tablet, left)}h1,.style-title-4xl,::slotted(h1){font-size:var(--px-text-size-heading-5xl-desktop)}h2,.style-title-3xl,::slotted(h2){font-size:var(--px-text-size-heading-4xl-desktop)}h3,.style-title-2xl,::slotted(h3){font-size:var(--px-text-size-heading-3xl-desktop)}h4,.style-title-xl,::slotted(h4){font-size:var(--px-text-size-heading-2xl-desktop)}h5,.style-title-l,::slotted(h5){font-size:var(--px-text-size-heading-l-desktop)}h6,.style-title-m,::slotted(h6){font-size:var(--px-text-size-heading-m-desktop)}.style-title-s{font-size:var(--px-text-size-heading-s-desktop)}.style-subtitle{font-size:var(--px-text-size-heading-xl-desktop)}}@media only screen and (min-width: 1025px){h1,.style-title-4xl,::slotted(h1),h2,.style-title-3xl,::slotted(h2),h3,.style-title-2xl,::slotted(h3),h4,.style-title-xl,::slotted(h4),h5,.style-title-l,::slotted(h5),h6,.style-title-m,::slotted(h6),.style-title-s,.style-subtitle{text-align:var(--heading-text-align--laptop, left)}h1,.style-title-4xl,::slotted(h1){font-size:var(--px-text-size-heading-5xl-desktop)}h2,.style-title-3xl,::slotted(h2){font-size:var(--px-text-size-heading-4xl-desktop)}h3,.style-title-2xl,::slotted(h3){font-size:var(--px-text-size-heading-3xl-desktop)}h4,.style-title-xl,::slotted(h4){font-size:var(--px-text-size-heading-2xl-desktop)}h5,.style-title-l,::slotted(h5){font-size:var(--px-text-size-heading-l-desktop)}h6,.style-title-m,::slotted(h6){font-size:var(--px-text-size-heading-m-desktop)}.style-title-s{font-size:var(--px-text-size-heading-s-desktop)}.style-subtitle{font-size:var(--px-text-size-heading-xl-desktop)}}@media screen and (min-width: 1441px){h1,.style-title-4xl,::slotted(h1),h2,.style-title-3xl,::slotted(h2),h3,.style-title-2xl,::slotted(h3),h4,.style-title-xl,::slotted(h4),h5,.style-title-l,::slotted(h5),h6,.style-title-m,::slotted(h6),.style-title-s,.style-subtitle{text-align:var(--heading-text-align--desktop, left)}}", P = ".color-inherit{color:inherit}.color-brand{color:var(--px-color-text-brand-default)}.color-neutral{color:var(--px-color-text-neutral-default)}.color-dimmed{color:var(--px-color-text-dimmed-default)}.color-purpose-success{color:var(--px-color-text-purpose-success-default)}.color-purpose-warning{color:var(--px-color-text-purpose-warning-default)}.color-purpose-error{color:var(--px-color-text-purpose-error-default)}.color-purpose-unlimited{color:var(--px-color-text-purpose-unlimited-default)}.color-purpose-promo{color:var(--px-color-text-purpose-promo-default)}.color-state-hover{color:var(--px-color-text-state-hover-default)}.color-state-active{color:var(--px-color-text-state-active-default)}.color-state-disabled{color:var(--px-color-text-state-disabled-default)}:host([inverted]) .color-inherit{color:inherit}:host([inverted]) .color-brand{color:var(--px-color-text-brand-inverted)}:host([inverted]) .color-neutral{color:var(--px-color-text-neutral-inverted)}:host([inverted]) .color-dimmed{color:var(--px-color-text-dimmed-inverted)}:host([inverted]) .color-purpose-success{color:var(--px-color-text-purpose-success-inverted)}:host([inverted]) .color-purpose-warning{color:var(--px-color-text-purpose-warning-inverted)}:host([inverted]) .color-purpose-error{color:var(--px-color-text-purpose-error-inverted)}:host([inverted]) .color-purpose-unlimited{color:var(--px-color-text-purpose-unlimited-inverted)}:host([inverted]) .color-purpose-promo{color:var(--px-color-text-purpose-promo-inverted)}:host([inverted]) .color-state-hover{color:var(--px-color-text-state-hover-inverted)}:host([inverted]) .color-state-active{color:var(--px-color-text-state-active-inverted)}:host([inverted]) .color-state-disabled{color:var(--px-color-text-state-disabled-inverted)}.font-size-inherit{font-size:inherit;line-height:inherit}.font-size-body-l{font-size:var(--px-text-size-body-l-mobile)}.font-size-body-m{font-size:var(--px-text-size-body-m-mobile)}.font-size-body-s{font-size:var(--px-text-size-body-s-mobile)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-mobile)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-mobile)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-mobile)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-mobile)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-mobile)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-mobile)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-mobile)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-mobile)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-mobile)}@media only screen and (min-width: 48em){.font-size-body-l{font-size:var(--px-text-size-body-l-desktop)}.font-size-body-m{font-size:var(--px-text-size-body-m-desktop)}.font-size-body-s{font-size:var(--px-text-size-body-s-desktop)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-desktop)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-desktop)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-desktop)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-desktop)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-desktop)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-desktop)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-desktop)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-desktop)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-desktop)}}@media only screen and (min-width: 64.0625em){.font-size-body-l{font-size:var(--px-text-size-body-l-desktop)}.font-size-body-m{font-size:var(--px-text-size-body-m-desktop)}.font-size-body-s{font-size:var(--px-text-size-body-s-desktop)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-desktop)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-desktop)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-desktop)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-desktop)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-desktop)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-desktop)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-desktop)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-desktop)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-desktop)}}.font-weight-inherit{font-weight:inherit}.font-weight-body{font-weight:var(--px-font-weight-body)}.font-weight-title{font-weight:var(--px-font-weight-title)}.font-weight-title-large{font-weight:var(--px-font-weight-title-large)}.font-weight-subtitle{font-weight:var(--px-font-weight-subtitle)}", $ = new CSSStyleSheet();
|
|
96
96
|
$.replaceSync(R);
|
|
97
|
-
const
|
|
98
|
-
|
|
97
|
+
const C = new CSSStyleSheet();
|
|
98
|
+
C.replaceSync(P);
|
|
99
99
|
class n extends k {
|
|
100
100
|
template() {
|
|
101
101
|
return "<slot></slot>";
|
|
102
102
|
}
|
|
103
103
|
constructor(t) {
|
|
104
|
-
super($,
|
|
104
|
+
super($, C);
|
|
105
105
|
const e = document.createElement(t);
|
|
106
106
|
e.innerHTML = this.template(), this.shadowRoot.appendChild(e);
|
|
107
107
|
}
|
|
@@ -118,24 +118,24 @@ class n extends k {
|
|
|
118
118
|
"inverted"
|
|
119
119
|
];
|
|
120
120
|
}
|
|
121
|
-
attributeChangedCallback(t, e,
|
|
122
|
-
if (e !==
|
|
121
|
+
attributeChangedCallback(t, e, i) {
|
|
122
|
+
if (e !== i)
|
|
123
123
|
switch (t) {
|
|
124
124
|
case "variant":
|
|
125
|
-
this.updateAttribute(t, e,
|
|
125
|
+
this.updateAttribute(t, e, i, N);
|
|
126
126
|
break;
|
|
127
127
|
case "color":
|
|
128
|
-
this.updateColor(e,
|
|
128
|
+
this.updateColor(e, i, I);
|
|
129
129
|
break;
|
|
130
130
|
case "text-align":
|
|
131
131
|
case "text-align--mobile":
|
|
132
132
|
case "text-align--tablet":
|
|
133
133
|
case "text-align--laptop":
|
|
134
134
|
case "text-align--desktop":
|
|
135
|
-
this.updateTextAlign(t, e,
|
|
135
|
+
this.updateTextAlign(t, e, i, E);
|
|
136
136
|
break;
|
|
137
137
|
default:
|
|
138
|
-
super.attributeChangedCallback(t, e,
|
|
138
|
+
super.attributeChangedCallback(t, e, i);
|
|
139
139
|
break;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -145,34 +145,31 @@ class n extends k {
|
|
|
145
145
|
checkName(t, e) {
|
|
146
146
|
return t.includes(e);
|
|
147
147
|
}
|
|
148
|
-
updateAttribute(t, e,
|
|
149
|
-
this.checkName(r,
|
|
150
|
-
`${o} is not an allowed "${t}" value for`,
|
|
151
|
-
this.$el
|
|
152
|
-
);
|
|
148
|
+
updateAttribute(t, e, i, r) {
|
|
149
|
+
this.checkName(r, i) ? this.toggleClass(e, i) : console.error(`${i} is not an allowed "${t}" value`);
|
|
153
150
|
}
|
|
154
|
-
updateColor(t, e,
|
|
155
|
-
if (!this.checkName(
|
|
156
|
-
console.error(
|
|
151
|
+
updateColor(t, e, i) {
|
|
152
|
+
if (!this.checkName(i, e)) {
|
|
153
|
+
console.error(`${e} is not a valid color value`);
|
|
157
154
|
return;
|
|
158
155
|
}
|
|
159
|
-
const r = (
|
|
160
|
-
|
|
156
|
+
const r = (o) => {
|
|
157
|
+
o !== null && o !== "" && o !== "default" && (this.$el.style.setProperty(
|
|
161
158
|
"--heading-color-default",
|
|
162
|
-
`var(--px-text
|
|
159
|
+
`var(--px-color-text-${o}-default)`
|
|
163
160
|
), this.$el.style.setProperty(
|
|
164
161
|
"--heading-color-inverted",
|
|
165
|
-
`var(--px-text
|
|
162
|
+
`var(--px-color-text-${o}-inverted)`
|
|
166
163
|
));
|
|
167
164
|
};
|
|
168
165
|
r(t), r(e);
|
|
169
166
|
}
|
|
170
|
-
updateTextAlign(t, e,
|
|
171
|
-
if (!this.checkName(r,
|
|
172
|
-
console.error(
|
|
167
|
+
updateTextAlign(t, e, i, r) {
|
|
168
|
+
if (!this.checkName(r, i)) {
|
|
169
|
+
console.error(`${i} is not a valid value for ${t}`);
|
|
173
170
|
return;
|
|
174
171
|
}
|
|
175
|
-
const
|
|
172
|
+
const o = (s, l) => {
|
|
176
173
|
l !== null && l !== "" && l !== "default" && this.$el.style.setProperty(
|
|
177
174
|
`--heading-text-align--${s}`,
|
|
178
175
|
l
|
|
@@ -180,11 +177,11 @@ class n extends k {
|
|
|
180
177
|
};
|
|
181
178
|
if (t === "text-align")
|
|
182
179
|
["mobile", "tablet", "laptop", "desktop"].forEach((s) => {
|
|
183
|
-
|
|
180
|
+
o(s, e), o(s, i);
|
|
184
181
|
});
|
|
185
182
|
else {
|
|
186
183
|
const s = t.split("--")[1];
|
|
187
|
-
|
|
184
|
+
o(s, e), o(s, i);
|
|
188
185
|
}
|
|
189
186
|
}
|
|
190
187
|
get variant() {
|
|
@@ -236,21 +233,21 @@ class n extends k {
|
|
|
236
233
|
this.setAttribute("inverted", t);
|
|
237
234
|
}
|
|
238
235
|
}
|
|
239
|
-
const
|
|
236
|
+
const v = class v extends n {
|
|
240
237
|
constructor() {
|
|
241
238
|
super("h1");
|
|
242
239
|
}
|
|
243
240
|
};
|
|
244
|
-
|
|
245
|
-
let d =
|
|
241
|
+
v.nativeName = "h1";
|
|
242
|
+
let d = v;
|
|
246
243
|
customElements.define("px-h1", d);
|
|
247
|
-
const
|
|
244
|
+
const u = class u extends n {
|
|
248
245
|
constructor() {
|
|
249
246
|
super("h2");
|
|
250
247
|
}
|
|
251
248
|
};
|
|
252
|
-
|
|
253
|
-
let c =
|
|
249
|
+
u.nativeName = "h2";
|
|
250
|
+
let c = u;
|
|
254
251
|
customElements.define("px-h2", c);
|
|
255
252
|
const f = class f extends n {
|
|
256
253
|
constructor() {
|
|
@@ -284,10 +281,10 @@ const y = class y extends n {
|
|
|
284
281
|
y.nativeName = "h6";
|
|
285
282
|
let g = y;
|
|
286
283
|
customElements.define("px-h6", g);
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
class
|
|
284
|
+
const O = "#container{width:1080px;display:block;border:0;border-radius:var(--px-radius-main);padding:var(--px-padding-m-desktop);background-color:var(--px-color-background-surface-default)}#container.success{border-left:5px var(--px-color-icon-purpose-success-default) solid}#container.warning{border-left:5px var(--px-color-icon-purpose-warning-default) solid}#container.error{border-left:5px var(--px-color-icon-purpose-error-default) solid}px-button-icon{position:absolute;top:var(--px-padding-m-desktop);right:var(--px-padding-m-desktop)}dialog{background:transparent;border-radius:0;box-shadow:none;padding:0;border:0;box-sizing:border-box;transform:scale(.95);animation:modalIn .3s ease-out forwards}::backdrop{background:#0000004d;-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px)}#content{max-height:90vh;overflow:auto;padding:var(--px-padding-m-desktop)}@media screen and (max-width: 1081px){#container{width:inherit;padding:var(--px-padding-m-mobile)}px-button-icon{top:var(--px-padding-m-mobile);right:var(--px-padding-m-mobile)}#content{padding:var(--px-padding-m-mobile)}}@keyframes modalIn{0%{transform:scale(.95);opacity:0}to{transform:scale(1);opacity:1}}", w = new CSSStyleSheet();
|
|
285
|
+
w.replaceSync(O);
|
|
286
|
+
const j = "px.lavender.modal.close";
|
|
287
|
+
class D extends HTMLElement {
|
|
291
288
|
constructor() {
|
|
292
289
|
super(), this.template = ` <dialog>
|
|
293
290
|
<div id="container">
|
|
@@ -299,7 +296,7 @@ class j extends HTMLElement {
|
|
|
299
296
|
<px-h1 variant="title-l">
|
|
300
297
|
<slot name="title"></slot>
|
|
301
298
|
</px-h1>
|
|
302
|
-
<px-p font-weight="
|
|
299
|
+
<px-p font-weight="title">
|
|
303
300
|
<slot name="description"></slot>
|
|
304
301
|
</px-p>
|
|
305
302
|
</px-vstack>
|
|
@@ -322,7 +319,7 @@ class j extends HTMLElement {
|
|
|
322
319
|
<px-icon name="cross" from="lavender"></px-icon>
|
|
323
320
|
</px-button-icon>
|
|
324
321
|
</div>
|
|
325
|
-
</dialog>`, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template, this.shadowRoot.adoptedStyleSheets = [
|
|
322
|
+
</dialog>`, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template, this.shadowRoot.adoptedStyleSheets = [w];
|
|
326
323
|
}
|
|
327
324
|
connectedCallback() {
|
|
328
325
|
if (this.hasAttribute("open") && this.show(), this.handleStatusChange("notnull", this.getAttribute("status")), this.hasAttribute("closedby")) {
|
|
@@ -348,13 +345,13 @@ class j extends HTMLElement {
|
|
|
348
345
|
static get observedAttributes() {
|
|
349
346
|
return ["open", "status"];
|
|
350
347
|
}
|
|
351
|
-
attributeChangedCallback(t, e,
|
|
348
|
+
attributeChangedCallback(t, e, i) {
|
|
352
349
|
switch (t) {
|
|
353
350
|
case "open":
|
|
354
351
|
this.handleOpenChange();
|
|
355
352
|
break;
|
|
356
353
|
case "status":
|
|
357
|
-
this.handleStatusChange(e,
|
|
354
|
+
this.handleStatusChange(e, i);
|
|
358
355
|
break;
|
|
359
356
|
}
|
|
360
357
|
}
|
|
@@ -362,14 +359,14 @@ class j extends HTMLElement {
|
|
|
362
359
|
this.hasAttribute("open") ? this.show() : this.close();
|
|
363
360
|
}
|
|
364
361
|
handleStatusChange(t, e) {
|
|
365
|
-
var
|
|
362
|
+
var i, r, o;
|
|
366
363
|
if (e === "success" ? this.$container.classList.add("success") : this.$container.classList.remove("success"), e === "error" ? this.$container.classList.add("error") : this.$container.classList.remove("error"), e === "warning" ? this.$container.classList.add("warning") : this.$container.classList.remove("warning"), e === null)
|
|
367
|
-
(
|
|
364
|
+
(i = this.$statusIcon) == null || i.remove();
|
|
368
365
|
else if (t === null && e && !this.$statusIcon) {
|
|
369
366
|
const s = document.createElement("px-icon");
|
|
370
367
|
s.setAttribute("name", this.getIcon(e)), s.setAttribute("from", "lavender"), s.setAttribute("color", `purpose-${e}`), this.$iconContainer.appendChild(s);
|
|
371
368
|
} else
|
|
372
|
-
(r = this.$statusIcon) == null || r.setAttribute("name", this.getIcon(e)), (
|
|
369
|
+
(r = this.$statusIcon) == null || r.setAttribute("name", this.getIcon(e)), (o = this.$statusIcon) == null || o.setAttribute("color", `purpose-${e}`);
|
|
373
370
|
}
|
|
374
371
|
getIcon(t) {
|
|
375
372
|
return t === "success" ? "checkmark_fill" : t === "warning" ? "exclamation_mark_fill" : "minus_fill";
|
|
@@ -379,7 +376,7 @@ class j extends HTMLElement {
|
|
|
379
376
|
}
|
|
380
377
|
close() {
|
|
381
378
|
this.$dialog.close(), this.dispatchEvent(
|
|
382
|
-
new CustomEvent(
|
|
379
|
+
new CustomEvent(j, {
|
|
383
380
|
bubbles: !0,
|
|
384
381
|
composed: !0
|
|
385
382
|
})
|
|
@@ -406,7 +403,7 @@ class j extends HTMLElement {
|
|
|
406
403
|
return this.$dialog.open;
|
|
407
404
|
}
|
|
408
405
|
}
|
|
409
|
-
customElements.get("px-modal") || customElements.define("px-modal",
|
|
406
|
+
customElements.get("px-modal") || customElements.define("px-modal", D);
|
|
410
407
|
export {
|
|
411
|
-
|
|
408
|
+
D as Modal
|
|
412
409
|
};
|