@swisspost/design-system-components 8.8.1 → 8.9.0
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/cjs/index.cjs.js +16 -16
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-7cd94cc1.js → package-47e2b57d.js} +1 -1
- package/dist/cjs/{post-accordion-209311b2.js → post-accordion-20974b9a.js} +1 -1
- package/dist/cjs/{post-accordion-item-30e8de69.js → post-accordion-item-eabef3b1.js} +1 -1
- package/dist/cjs/post-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/post-accordion.cjs.entry.js +2 -2
- package/dist/cjs/{post-alert-42f38d0e.js → post-alert-3949513d.js} +1 -1
- package/dist/cjs/post-alert.cjs.entry.js +2 -2
- package/dist/cjs/{post-card-control-2a0c2b0e.js → post-card-control-2d5007b3.js} +1 -1
- package/dist/cjs/post-card-control.cjs.entry.js +2 -2
- package/dist/cjs/{post-collapsible-trigger-a9b648df.js → post-collapsible-trigger-fdbbc054.js} +1 -1
- package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/{post-icon-bf7f72ea.js → post-icon-f21b03b4.js} +60 -41
- package/dist/cjs/post-icon.cjs.entry.js +2 -2
- package/dist/cjs/{post-logo-83e587ec.js → post-logo-5e71df9f.js} +1 -1
- package/dist/cjs/post-logo.cjs.entry.js +2 -2
- package/dist/cjs/{post-popover-10479850.js → post-popover-2ad73bd3.js} +1 -1
- package/dist/cjs/post-popover.cjs.entry.js +2 -2
- package/dist/cjs/{post-popovercontainer-fc148d89.js → post-popovercontainer-33d2561e.js} +1 -1
- package/dist/cjs/post-popovercontainer.cjs.entry.js +2 -2
- package/dist/cjs/{post-rating-4260a089.js → post-rating-45cfe0cf.js} +1 -1
- package/dist/cjs/post-rating.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-header-ffda553c.js → post-tab-header-fb539597.js} +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-panel-06d573ec.js → post-tab-panel-b9df8047.js} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-c1d050d2.js → post-tabs-315fdf6c.js} +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tag-ba9f59d1.js → post-tag-b7789a57.js} +1 -1
- package/dist/cjs/post-tag.cjs.entry.js +2 -2
- package/dist/cjs/{post-tooltip-a98bdf98.js → post-tooltip-f5d7c6f1.js} +1 -1
- package/dist/cjs/post-tooltip.cjs.entry.js +2 -2
- package/dist/collection/components/post-icon/post-icon.js +59 -46
- package/dist/components/package.js +1 -1
- package/dist/components/post-icon2.js +60 -43
- package/dist/docs.json +1 -1
- package/dist/esm/index.js +16 -16
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-23a37332.js → package-08fde6c9.js} +1 -1
- package/dist/esm/{post-accordion-dbcdd859.js → post-accordion-fc082a6d.js} +1 -1
- package/dist/esm/{post-accordion-item-bfedb160.js → post-accordion-item-2266baf9.js} +1 -1
- package/dist/esm/post-accordion-item.entry.js +2 -2
- package/dist/esm/post-accordion.entry.js +2 -2
- package/dist/esm/{post-alert-93078740.js → post-alert-5f56513e.js} +1 -1
- package/dist/esm/post-alert.entry.js +2 -2
- package/dist/esm/{post-card-control-41b0a1fe.js → post-card-control-8692a4b3.js} +1 -1
- package/dist/esm/post-card-control.entry.js +2 -2
- package/dist/esm/{post-collapsible-trigger-e6a0ade2.js → post-collapsible-trigger-df2fda7a.js} +1 -1
- package/dist/esm/post-collapsible_2.entry.js +2 -2
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/{post-icon-4569eb21.js → post-icon-f23e7246.js} +60 -41
- package/dist/esm/post-icon.entry.js +2 -2
- package/dist/esm/{post-logo-6d90082f.js → post-logo-39493c51.js} +1 -1
- package/dist/esm/post-logo.entry.js +2 -2
- package/dist/esm/{post-popover-8e0233b3.js → post-popover-e46db9d7.js} +1 -1
- package/dist/esm/post-popover.entry.js +2 -2
- package/dist/esm/{post-popovercontainer-84b97b76.js → post-popovercontainer-f2bd3608.js} +1 -1
- package/dist/esm/post-popovercontainer.entry.js +2 -2
- package/dist/esm/{post-rating-3d01cdbb.js → post-rating-2a35545e.js} +1 -1
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/{post-tab-header-7f03e707.js → post-tab-header-ba8f0dde.js} +1 -1
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/{post-tab-panel-441f13aa.js → post-tab-panel-03f0c4e7.js} +1 -1
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-3b1ca219.js → post-tabs-75e64d21.js} +1 -1
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tag-cc6b1316.js → post-tag-64b158d7.js} +1 -1
- package/dist/esm/post-tag.entry.js +2 -2
- package/dist/esm/{post-tooltip-6dffcef3.js → post-tooltip-78458f2e.js} +1 -1
- package/dist/esm/post-tooltip.entry.js +2 -2
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/{p-df113888.js → p-0f230d9d.js} +1 -1
- package/dist/post-components/p-228f6fff.entry.js +1 -0
- package/dist/post-components/{p-d7b94e9a.entry.js → p-26a75af8.entry.js} +1 -1
- package/dist/post-components/{p-98a2eebf.js → p-27466c43.js} +1 -1
- package/dist/post-components/{p-3a9ea683.js → p-29f3b024.js} +1 -1
- package/dist/post-components/p-3a7e0eb0.entry.js +1 -0
- package/dist/post-components/{p-6442b545.js → p-41a6ed2e.js} +1 -1
- package/dist/post-components/p-43919169.entry.js +1 -0
- package/dist/post-components/{p-3e67d7b3.js → p-4f4e3ca3.js} +1 -1
- package/dist/post-components/{p-5ccdb402.js → p-606f6944.js} +1 -1
- package/dist/post-components/p-6364af05.entry.js +1 -0
- package/dist/post-components/{p-0469b617.js → p-740936e8.js} +1 -1
- package/dist/post-components/{p-fbe0c51a.js → p-76f71540.js} +1 -1
- package/dist/post-components/p-786ab630.entry.js +1 -0
- package/dist/post-components/p-80b34a10.entry.js +1 -0
- package/dist/post-components/{p-f7478b7d.js → p-82a37955.js} +1 -1
- package/dist/post-components/p-880141d1.entry.js +1 -0
- package/dist/post-components/p-9cf80f04.entry.js +1 -0
- package/dist/post-components/p-af7f9325.entry.js +1 -0
- package/dist/post-components/{p-0642e538.js → p-b562ef6b.js} +1 -1
- package/dist/post-components/p-b5a5a368.entry.js +1 -0
- package/dist/post-components/{p-e14579cb.js → p-b7435c96.js} +1 -1
- package/dist/post-components/{p-a2020cf0.js → p-c172368e.js} +1 -1
- package/dist/post-components/p-c2b10c80.entry.js +1 -0
- package/dist/post-components/p-d6c0790c.entry.js +1 -0
- package/dist/post-components/{p-85b9b6ec.js → p-dec7d50c.js} +1 -1
- package/dist/post-components/{p-bfbc2d0f.js → p-e15f7eb6.js} +1 -1
- package/dist/post-components/p-ec6b827c.entry.js +1 -0
- package/dist/post-components/p-ed057108.js +1 -0
- package/dist/post-components/p-f16cf914.entry.js +1 -0
- package/dist/post-components/p-f5251062.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-icon/post-icon.d.ts +2 -5
- package/loaders/package.js +1 -1
- package/loaders/post-icon2.js +60 -43
- package/package.json +2 -2
- package/dist/post-components/p-18a1b6aa.entry.js +0 -1
- package/dist/post-components/p-31b1c158.entry.js +0 -1
- package/dist/post-components/p-326ddd97.entry.js +0 -1
- package/dist/post-components/p-36e197f4.js +0 -1
- package/dist/post-components/p-453d2b59.entry.js +0 -1
- package/dist/post-components/p-51f07a27.entry.js +0 -1
- package/dist/post-components/p-53b727b2.entry.js +0 -1
- package/dist/post-components/p-56dfc056.entry.js +0 -1
- package/dist/post-components/p-7be9ddcb.entry.js +0 -1
- package/dist/post-components/p-8479b48c.entry.js +0 -1
- package/dist/post-components/p-949984b1.entry.js +0 -1
- package/dist/post-components/p-950c543c.entry.js +0 -1
- package/dist/post-components/p-ad17494f.entry.js +0 -1
- package/dist/post-components/p-b5b33d21.js +0 -1
- package/dist/post-components/p-dbf4049e.entry.js +0 -1
- package/dist/post-components/p-f4d3207d.entry.js +0 -1
package/loaders/post-icon2.js
CHANGED
|
@@ -22,8 +22,6 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends HTMLEle
|
|
|
22
22
|
super();
|
|
23
23
|
this.__registerHost();
|
|
24
24
|
this.__attachShadow();
|
|
25
|
-
this.svgStyles = undefined;
|
|
26
|
-
this.svgOutput = undefined;
|
|
27
25
|
this.animation = null;
|
|
28
26
|
this.base = null;
|
|
29
27
|
this.flipH = false;
|
|
@@ -55,6 +53,64 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends HTMLEle
|
|
|
55
53
|
validateScale(newValue = this.scale) {
|
|
56
54
|
checkEmptyOrType(newValue, 'number', 'The post-icon "scale" prop should be a number.');
|
|
57
55
|
}
|
|
56
|
+
// Construct the icon url from different possible sources
|
|
57
|
+
getUrl() {
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
59
|
+
// the first definition object which defines a domain, will be used to set the domain of the file url
|
|
60
|
+
// the first definition object which defines a slug, will be used to set the slug of the file url
|
|
61
|
+
const urlDefinitions = [
|
|
62
|
+
getUrlDefinition(this.base, 'both'),
|
|
63
|
+
getUrlDefinition((_a = document.head
|
|
64
|
+
.querySelector('meta[name="design-system-settings"][data-post-icon-base]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-post-icon-base'), 'relative'),
|
|
65
|
+
getUrlDefinition((_b = document.querySelector('base[href]')) === null || _b === void 0 ? void 0 : _b.getAttribute('href'), 'both'),
|
|
66
|
+
];
|
|
67
|
+
// in case no other definition defines a domain, the current origin is used as a fallback
|
|
68
|
+
const origin = (_e = (_d = (_c = urlDefinitions.find(d => d.definesDomain)) === null || _c === void 0 ? void 0 : _c.url) === null || _d === void 0 ? void 0 : _d.origin) !== null && _e !== void 0 ? _e : window.location.origin;
|
|
69
|
+
// in case no other definition defines a slug, the cdn url is used as a fallback
|
|
70
|
+
const slug = (_g = (_f = urlDefinitions.find(d => d.definesSlug)) === null || _f === void 0 ? void 0 : _f.url) === null || _g === void 0 ? void 0 : _g.pathname;
|
|
71
|
+
const file = `${this.name}.svg`;
|
|
72
|
+
let url;
|
|
73
|
+
if (slug) {
|
|
74
|
+
url = new URL(`${origin}${slug}/${file}`).toString();
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
url = new URL(`${CDN_URL}/${file}`).toString();
|
|
78
|
+
}
|
|
79
|
+
return url;
|
|
80
|
+
function getUrlDefinition(url, allow) {
|
|
81
|
+
return {
|
|
82
|
+
url: getUrlObject(url),
|
|
83
|
+
definesDomain: allow !== 'relative' ? definesDomain(url) : false,
|
|
84
|
+
definesSlug: allow !== 'absolute' ? definesSlug(url) : false,
|
|
85
|
+
};
|
|
86
|
+
function getUrlObject(url) {
|
|
87
|
+
if (url) {
|
|
88
|
+
return definesDomain(url) ? new URL(url) : new URL(url, window.location.origin);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function definesDomain(url) {
|
|
95
|
+
return url ? /^https?:\/\//.test(url) : false;
|
|
96
|
+
}
|
|
97
|
+
function definesSlug(url) {
|
|
98
|
+
const urlObject = getUrlObject(url);
|
|
99
|
+
return Boolean(/^\/.+/.test(urlObject === null || urlObject === void 0 ? void 0 : urlObject.pathname));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
getStyles() {
|
|
104
|
+
const url = this.getUrl();
|
|
105
|
+
return Object.entries({
|
|
106
|
+
'-webkit-mask-image': `url(${url})`,
|
|
107
|
+
'mask-image': `url('${url}')`,
|
|
108
|
+
'transform': (this.scale && !isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
|
|
109
|
+
(this.rotate && !isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),
|
|
110
|
+
})
|
|
111
|
+
.filter(([_key, value]) => value !== null)
|
|
112
|
+
.reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
|
|
113
|
+
}
|
|
58
114
|
componentDidLoad() {
|
|
59
115
|
this.validateBase();
|
|
60
116
|
this.validateName();
|
|
@@ -64,45 +120,8 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends HTMLEle
|
|
|
64
120
|
this.validateRotate();
|
|
65
121
|
this.validateAnimation();
|
|
66
122
|
}
|
|
67
|
-
componentWillRender() {
|
|
68
|
-
this.setPath();
|
|
69
|
-
}
|
|
70
|
-
setPath() {
|
|
71
|
-
var _a, _b, _c, _d, _e;
|
|
72
|
-
// Construct icon path from different possible sources
|
|
73
|
-
const metaBase = (_b = (_a = document.head
|
|
74
|
-
.querySelector('meta[name="design-system-settings"][data-post-icon-base]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-post-icon-base')) !== null && _b !== void 0 ? _b : null;
|
|
75
|
-
const baseHref = (_c = document.getElementsByTagName('base')[0]) === null || _c === void 0 ? void 0 : _c.href;
|
|
76
|
-
let calculatedBase;
|
|
77
|
-
// If this.base or metaBase are relative, prefix them with the baseHref if it exists
|
|
78
|
-
const absolutePathReg = /^(?:[a-z+]+:)?\/\//i;
|
|
79
|
-
if (baseHref) {
|
|
80
|
-
if (this.base && !absolutePathReg.test(this.base)) {
|
|
81
|
-
calculatedBase = baseHref + this.base;
|
|
82
|
-
}
|
|
83
|
-
else if (metaBase && !absolutePathReg.test(metaBase)) {
|
|
84
|
-
calculatedBase = baseHref + metaBase;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
calculatedBase = (_d = this.base) !== null && _d !== void 0 ? _d : metaBase;
|
|
89
|
-
}
|
|
90
|
-
const fileBase = `${(_e = calculatedBase !== null && calculatedBase !== void 0 ? calculatedBase : baseHref) !== null && _e !== void 0 ? _e : CDN_URL}/`.replace(/\/\/$/, '/');
|
|
91
|
-
const fileName = `${this.name}.svg`;
|
|
92
|
-
const filePath = `${fileBase}${fileName}`;
|
|
93
|
-
this.path = new URL(filePath, window.location.origin).toString();
|
|
94
|
-
}
|
|
95
123
|
render() {
|
|
96
|
-
|
|
97
|
-
const svgStyles = Object.entries({
|
|
98
|
-
'-webkit-mask-image': `url('${this.path}')`,
|
|
99
|
-
'mask-image': `url('${this.path}')`,
|
|
100
|
-
'transform': (this.scale && !isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
|
|
101
|
-
(this.rotate && !isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),
|
|
102
|
-
})
|
|
103
|
-
.filter(([_key, value]) => value !== null)
|
|
104
|
-
.reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
|
|
105
|
-
return (h(Host, { key: '5703c51eda06d34af250a182b100a6bb85ce1dfb', "data-version": version }, h("span", { key: '918921da2a4ef82154d27d4a988c524deecb627b', style: svgStyles })));
|
|
124
|
+
return (h(Host, { key: '77740745eb170076301edb3ff96b846e48c7f2f4', "data-version": version }, h("span", { key: '573f2acd8e92ec5f2f8853b5cb05386bcaee693d', style: this.getStyles() })));
|
|
106
125
|
}
|
|
107
126
|
get host() { return this; }
|
|
108
127
|
static get watchers() { return {
|
|
@@ -122,9 +141,7 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends HTMLEle
|
|
|
122
141
|
"flipV": [4, "flip-v"],
|
|
123
142
|
"name": [1],
|
|
124
143
|
"rotate": [2],
|
|
125
|
-
"scale": [2]
|
|
126
|
-
"svgStyles": [32],
|
|
127
|
-
"svgOutput": [32]
|
|
144
|
+
"scale": [2]
|
|
128
145
|
}, undefined, {
|
|
129
146
|
"animation": ["validateAnimation"],
|
|
130
147
|
"base": ["validateBase"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@floating-ui/dom": "1.6.8",
|
|
28
28
|
"@oddbird/popover-polyfill": "0.3.7",
|
|
29
|
-
"@swisspost/design-system-styles": "8.
|
|
29
|
+
"@swisspost/design-system-styles": "8.9.0",
|
|
30
30
|
"ally.js": "1.4.1",
|
|
31
31
|
"long-press-event": "2.5.0"
|
|
32
32
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_alert}from"./p-fbe0c51a.js";import"./p-343f6de1.js";import"./p-36e197f4.js";import"./p-2737eaf5.js";import"./p-deb4131c.js";import"./p-440193f4.js";import"./p-611b3c41.js";import"./p-b095519d.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_tag}from"./p-98a2eebf.js";import"./p-343f6de1.js";import"./p-36e197f4.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_tab_panel}from"./p-0642e538.js";import"./p-343f6de1.js";import"./p-36e197f4.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const o="8.8.1";export{o as v}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_tabs}from"./p-df113888.js";import"./p-343f6de1.js";import"./p-36e197f4.js";import"./p-2737eaf5.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_logo}from"./p-85b9b6ec.js";import"./p-343f6de1.js";import"./p-36e197f4.js";import"./p-deb4131c.js";import"./p-440193f4.js";import"./p-611b3c41.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_popover}from"./p-3a9ea683.js";import"./p-343f6de1.js";import"./p-36e197f4.js";import"./p-6adeaa6c.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_accordion}from"./p-3e67d7b3.js";import"./p-343f6de1.js";import"./p-36e197f4.js";import"./p-247a1668.js";import"./p-611b3c41.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_rating}from"./p-e14579cb.js";import"./p-343f6de1.js";import"./p-36e197f4.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_tab_header}from"./p-5ccdb402.js";import"./p-343f6de1.js";import"./p-36e197f4.js";import"./p-b095519d.js";import"./p-440193f4.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_accordion_item}from"./p-6442b545.js";import"./p-343f6de1.js";import"./p-36e197f4.js";import"./p-247a1668.js";import"./p-deb4131c.js";import"./p-440193f4.js";import"./p-611b3c41.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_tooltip}from"./p-a2020cf0.js";import"./p-343f6de1.js";import"./p-36e197f4.js";import"./p-6adeaa6c.js";import"./p-deb4131c.js";import"./p-440193f4.js";import"./p-611b3c41.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_icon}from"./p-b5b33d21.js";import"./p-343f6de1.js";import"./p-deb4131c.js";import"./p-440193f4.js";import"./p-611b3c41.js";import"./p-36e197f4.js";import"./p-b095519d.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,H as a,g as e}from"./p-343f6de1.js";import{c as o,d as n,a as s}from"./p-deb4131c.js";import{v as r}from"./p-36e197f4.js";import{c as l}from"./p-b095519d.js";const m=["cylon","cylon-vertical","spin","spin-reverse","fade","throb"],c=class{constructor(t){i(this,t),this.svgStyles=void 0,this.svgOutput=void 0,this.animation=null,this.base=null,this.flipH=!1,this.flipV=!1,this.name=void 0,this.rotate=null,this.scale=null}validateAnimation(i=this.animation){void 0!==i&&o(i,m,`The post-icon "animation" prop requires one of the following values: ${m.join(", ")}.`)}validateBase(i=this.base){n(i,"string",'The post-icon "base" prop should be a string.')}validateFlipH(i=this.flipH){n(i,"boolean",'The post-icon "flipH" prop should be a boolean.')}validateFlipV(i=this.flipV){n(i,"boolean",'The post-icon "flipV" prop should be a boolean.')}validateName(i=this.name){l(i,'The post-icon "name" prop is required!.'),s(i,"string",'The post-icon "name" prop should be a string.')}validateRotate(i=this.rotate){n(i,"number",'The post-icon "rotate" prop should be a number.')}validateScale(i=this.scale){n(i,"number",'The post-icon "scale" prop should be a number.')}componentDidLoad(){this.validateBase(),this.validateName(),this.validateFlipH(),this.validateFlipV(),this.validateScale(),this.validateRotate(),this.validateAnimation()}componentWillRender(){this.setPath()}setPath(){var i,t,a,e,o;const n=null!==(t=null===(i=document.head.querySelector('meta[name="design-system-settings"][data-post-icon-base]'))||void 0===i?void 0:i.getAttribute("data-post-icon-base"))&&void 0!==t?t:null,s=null===(a=document.getElementsByTagName("base")[0])||void 0===a?void 0:a.href;let r;const l=/^(?:[a-z+]+:)?\/\//i;s?this.base&&!l.test(this.base)?r=s+this.base:n&&!l.test(n)&&(r=s+n):r=null!==(e=this.base)&&void 0!==e?e:n;const m=`${null!==(o=null!=r?r:s)&&void 0!==o?o:"https://unpkg.com/@swisspost/design-system-icons/public/post-icons"}/`.replace(/\/\/$/,"/");this.path=new URL(`${m}${this.name}.svg`,window.location.origin).toString()}render(){const i=Object.entries({"-webkit-mask-image":`url('${this.path}')`,"mask-image":`url('${this.path}')`,transform:(this.scale&&!isNaN(Number(this.scale))?"scale("+this.scale+")":"")+(this.rotate&&!isNaN(Number(this.rotate))?" rotate("+this.rotate+"deg)":"")}).filter((([i,t])=>null!==t)).reduce(((i,[t,a])=>Object.assign(i,{[t]:a})),{});return t(a,{key:"5703c51eda06d34af250a182b100a6bb85ce1dfb","data-version":r},t("span",{key:"918921da2a4ef82154d27d4a988c524deecb627b",style:i}))}get host(){return e(this)}static get watchers(){return{animation:["validateAnimation"],base:["validateBase"],flipH:["validateFlipH"],flipV:["validateFlipV"],name:["validateName"],rotate:["validateRotate"],scale:["validateScale"]}}};c.style=":host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;forced-color-adjust:preserve-parent-color;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}";export{c as P}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_card_control}from"./p-0469b617.js";import"./p-343f6de1.js";import"./p-611b3c41.js";import"./p-b095519d.js";import"./p-440193f4.js";import"./p-36e197f4.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_popovercontainer}from"./p-bfbc2d0f.js";import"./p-343f6de1.js";import"./p-36e197f4.js";
|