@proximus/lavender-image 1.0.0-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.js +50 -0
- package/package.json +40 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PxElement as n } from "@proximus/lavender-common";
|
|
2
|
+
const a = "img{display:inline-block;vertical-align:middle;max-width:100%;height:auto;border-style:none}@media only screen and (max-width: 40em){.mo,.m,.l{display:none}}@media only screen and (min-width: 40.0625em) and (max-width: 64em){.l{display:none}}@media only screen and (min-width: 40.0625em){.so{display:none}}@media only screen and (min-width: 64.0625em){.so,.mo{display:none}}", r = new CSSStyleSheet();
|
|
3
|
+
r.replaceSync(a);
|
|
4
|
+
class h extends n {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(r);
|
|
7
|
+
}
|
|
8
|
+
static get observedAttributes() {
|
|
9
|
+
return [...super.observedAttributes, "showfor"];
|
|
10
|
+
}
|
|
11
|
+
get showfor() {
|
|
12
|
+
return this.getAttribute("showfor");
|
|
13
|
+
}
|
|
14
|
+
set showfor(e) {
|
|
15
|
+
this.setAttribute("showfor", e);
|
|
16
|
+
}
|
|
17
|
+
attributeChangedCallback(e, t, s) {
|
|
18
|
+
if (t !== s)
|
|
19
|
+
switch (e) {
|
|
20
|
+
case "showfor":
|
|
21
|
+
this.updateShowFor(t, s);
|
|
22
|
+
break;
|
|
23
|
+
default:
|
|
24
|
+
super.attributeChangedCallback(e, t, s);
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
toggleClass(e, t) {
|
|
29
|
+
e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(e), t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(t);
|
|
30
|
+
}
|
|
31
|
+
checkName(e) {
|
|
32
|
+
return ["", "s", "so", "mo", "m", "l"].includes(e);
|
|
33
|
+
}
|
|
34
|
+
updateShowFor(e, t) {
|
|
35
|
+
this.checkName(t) ? this.toggleClass(e, t) : console.error('Bad "showfor" value for', this);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const o = class o extends h {
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
const e = document.createElement(this.nativeName);
|
|
42
|
+
this.shadowRoot.appendChild(e);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
o.nativeName = "img";
|
|
46
|
+
let i = o;
|
|
47
|
+
customElements.define("px-image", i);
|
|
48
|
+
export {
|
|
49
|
+
i as Image
|
|
50
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proximus/lavender-image",
|
|
3
|
+
"version": "1.0.0-alpha.10",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./src/index.ts",
|
|
9
|
+
"development": "./src/index.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./src/*.css": {
|
|
13
|
+
"development": "src/*.css"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/*"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "rm -rf dist;tsc; vite build",
|
|
22
|
+
"test": "vitest run --coverage"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"gitHead": "3bf7639ce5c999b5c8e5b0b12b9e2a5913b9c76b",
|
|
28
|
+
"lerna": {
|
|
29
|
+
"command": {
|
|
30
|
+
"publish": {
|
|
31
|
+
"assets": [
|
|
32
|
+
"CHANGELOG.md",
|
|
33
|
+
"package.json",
|
|
34
|
+
"dist/*.js",
|
|
35
|
+
"dist/css/**/*.css"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|