@proximus/lavender-image 1.4.1 → 1.4.2
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/AbstractImage.d.ts +2 -4
- package/dist/index.es.js +25 -33
- package/package.json +1 -1
package/dist/AbstractImage.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { PxElement
|
|
1
|
+
import { PxElement } from '@proximus/lavender-common';
|
|
2
2
|
export declare const styleSheet: CSSStyleSheet;
|
|
3
|
-
export declare const breakpointsValues: string[];
|
|
4
3
|
export declare const imageWidthValues: string[];
|
|
5
4
|
export declare const imageHeightValues: string[];
|
|
6
5
|
export declare abstract class AbstractImage<IMAGE_ELEMENT extends HTMLImageElement | HTMLPictureElement> extends PxElement<IMAGE_ELEMENT> {
|
|
7
|
-
heightAttributeDelegate: AttributeBreakpointHandlerDelegate;
|
|
8
6
|
static accessorExclusions: string[];
|
|
9
|
-
constructor();
|
|
7
|
+
protected constructor();
|
|
10
8
|
static get observedAttributes(): string[];
|
|
11
9
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
12
10
|
updateWidth(attrName: string, oldValue: string, newValue: string, attrValues: string[]): void;
|
package/dist/index.es.js
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cssTokenBreakpoints as f, PxElement as x, noBorderRadiusValues as v, borderRadiusValues as A } from "@proximus/lavender-common";
|
|
2
2
|
const k = ":host{display:inline-block;line-height:0}:host([cover]) img{width:100%;height:100%;object-fit:cover}picture{display:inline-block}img{display:inline-block;border-style:none;width:var(--img-width--mobile, auto);max-width:100%}.border-radius-main,.border-radius-main img{border-radius:var(--px-radius-main)}.border-radius-pill,.border-radius-pill img{border-radius:var(--px-radius-pill)}.no-border-radius-top,.no-border-radius-top img{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right,.no-border-radius-right img{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom,.no-border-radius-bottom img{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left,.no-border-radius-left img{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all,.no-border-radius-all img{border-radius:var(--px-radius-none)}:host([disabled]) img{filter:opacity(.2) grayscale(100%)}@media only screen and (max-width: 767px){.no-border-radius-top--mobile,.no-border-radius-top--mobile img{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right--mobile,.no-border-radius-right--mobile img{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom--mobile,.no-border-radius-bottom--mobile img{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left--mobile,.no-border-radius-left--mobile img{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all--mobile,.no-border-radius-all--mobile img{border-radius:var(--px-radius-none)}}@media only screen and (min-width: 768px) and (max-width: 1024px){img{width:var(--img-width--tablet, auto)}.no-border-radius-top--tablet,.no-border-radius-top--tablet img{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right--tablet,.no-border-radius-right--tablet img{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom--tablet,.no-border-radius-bottom--tablet img{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left--tablet,.no-border-radius-left--tablet img{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all--tablet,.no-border-radius-all--tablet img{border-radius:var(--px-radius-none)}}@media only screen and (min-width: 1025px){img{width:var(--img-width--laptop, auto)}.no-border-radius-top--laptop,.no-border-radius-top--laptop img{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right--laptop,.no-border-radius-right--laptop img{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom--laptop,.no-border-radius-bottom--laptop img{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left--laptop,.no-border-radius-left--laptop img{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all--laptop,.no-border-radius-all--laptop img{border-radius:var(--px-radius-none)}}@media only screen and (min-width: 1441px){img{width:var(--img-width--desktop, auto)}}", g = new CSSStyleSheet();
|
|
3
3
|
g.replaceSync(k);
|
|
4
|
-
const
|
|
4
|
+
const w = ["", "xs", "s", "m", "l", "xl"], $ = ["", "xs", "s", "m", "l", "xl"], y = (m, t, r) => `:host([${m}${r ? `--${r}` : ""}='${t}']) img`, E = "px-image", S = f(
|
|
5
|
+
"height",
|
|
6
|
+
y,
|
|
7
|
+
$,
|
|
8
|
+
E,
|
|
9
|
+
"--img-height"
|
|
10
|
+
), p = class p extends x {
|
|
5
11
|
constructor() {
|
|
6
|
-
super(
|
|
7
|
-
g,
|
|
8
|
-
x(
|
|
9
|
-
"height",
|
|
10
|
-
E,
|
|
11
|
-
y,
|
|
12
|
-
S,
|
|
13
|
-
"--img-height"
|
|
14
|
-
)
|
|
15
|
-
), this.heightAttributeDelegate = new A(
|
|
16
|
-
this,
|
|
17
|
-
"height",
|
|
18
|
-
(t) => t,
|
|
19
|
-
"--img-height"
|
|
20
|
-
);
|
|
12
|
+
super(g, S);
|
|
21
13
|
}
|
|
22
14
|
static get observedAttributes() {
|
|
23
15
|
return [
|
|
@@ -44,7 +36,7 @@ const $ = ["", "xs", "s", "m", "l", "xl"], y = ["", "xs", "s", "m", "l", "xl"],
|
|
|
44
36
|
t,
|
|
45
37
|
r,
|
|
46
38
|
e,
|
|
47
|
-
|
|
39
|
+
A
|
|
48
40
|
);
|
|
49
41
|
break;
|
|
50
42
|
case "no-border-radius":
|
|
@@ -63,7 +55,7 @@ const $ = ["", "xs", "s", "m", "l", "xl"], y = ["", "xs", "s", "m", "l", "xl"],
|
|
|
63
55
|
case "width--tablet":
|
|
64
56
|
case "width--laptop":
|
|
65
57
|
case "width--desktop":
|
|
66
|
-
this.updateWidth(t, r, e,
|
|
58
|
+
this.updateWidth(t, r, e, w);
|
|
67
59
|
break;
|
|
68
60
|
case "disabled":
|
|
69
61
|
e !== null ? this.$el.setAttribute("aria-disabled", "true") : this.$el.removeAttribute("aria-disabled");
|
|
@@ -220,19 +212,19 @@ const $ = ["", "xs", "s", "m", "l", "xl"], y = ["", "xs", "s", "m", "l", "xl"],
|
|
|
220
212
|
t ? this.setAttribute("cover", "") : this.removeAttribute("cover");
|
|
221
213
|
}
|
|
222
214
|
};
|
|
223
|
-
|
|
224
|
-
let n =
|
|
225
|
-
const
|
|
215
|
+
p.accessorExclusions = ["height", "width"];
|
|
216
|
+
let n = p;
|
|
217
|
+
const b = class b extends n {
|
|
226
218
|
constructor() {
|
|
227
219
|
super();
|
|
228
|
-
const t = document.createElement(
|
|
220
|
+
const t = document.createElement(b.nativeName);
|
|
229
221
|
this.shadowRoot.appendChild(t);
|
|
230
222
|
}
|
|
231
223
|
};
|
|
232
|
-
|
|
233
|
-
let
|
|
234
|
-
customElements.get("px-image") || customElements.define("px-img",
|
|
235
|
-
const
|
|
224
|
+
b.nativeName = "img";
|
|
225
|
+
let u = b;
|
|
226
|
+
customElements.get("px-image") || customElements.define("px-img", u);
|
|
227
|
+
const h = class h extends n {
|
|
236
228
|
constructor() {
|
|
237
229
|
super(), this.possibleImgExtension = [
|
|
238
230
|
"webp",
|
|
@@ -252,7 +244,7 @@ const p = class p extends n {
|
|
|
252
244
|
"tif",
|
|
253
245
|
"tiff"
|
|
254
246
|
];
|
|
255
|
-
const t = document.createElement(
|
|
247
|
+
const t = document.createElement(h.nativeName);
|
|
256
248
|
this.shadowRoot.appendChild(t);
|
|
257
249
|
}
|
|
258
250
|
static get observedAttributes() {
|
|
@@ -349,10 +341,10 @@ const p = class p extends n {
|
|
|
349
341
|
!this.$imgEl || !this.src || (this.$imgEl.alt = t || "");
|
|
350
342
|
}
|
|
351
343
|
};
|
|
352
|
-
|
|
353
|
-
let
|
|
354
|
-
customElements.get("px-picture") || customElements.define("px-picture",
|
|
344
|
+
h.nativeName = "picture";
|
|
345
|
+
let l = h;
|
|
346
|
+
customElements.get("px-picture") || customElements.define("px-picture", l);
|
|
355
347
|
export {
|
|
356
|
-
|
|
357
|
-
|
|
348
|
+
u as Image,
|
|
349
|
+
l as Picture
|
|
358
350
|
};
|