@swisspost/design-system-components 8.9.2 → 8.9.4
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/{package-68da28a9.js → package-f1f08053.js} +1 -1
- package/dist/cjs/{post-accordion-6f69678c.js → post-accordion-6ca16bf7.js} +1 -1
- package/dist/cjs/{post-accordion-item-03f57226.js → post-accordion-item-0522baa7.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-6a934a61.js → post-alert-26d74b13.js} +1 -1
- package/dist/cjs/post-alert.cjs.entry.js +2 -2
- package/dist/cjs/{post-card-control-30174f52.js → post-card-control-03d6a479.js} +1 -1
- package/dist/cjs/post-card-control.cjs.entry.js +2 -2
- package/dist/cjs/{post-collapsible-trigger-98a022d0.js → post-collapsible-trigger-60f14b3a.js} +1 -1
- package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
- package/dist/cjs/{post-icon-a2f70583.js → post-icon-e4a8a48f.js} +3 -3
- package/dist/cjs/post-icon.cjs.entry.js +2 -2
- package/dist/cjs/{post-logo-e2aba41b.js → post-logo-197159e1.js} +1 -1
- package/dist/cjs/post-logo.cjs.entry.js +2 -2
- package/dist/cjs/{post-popover-11c122c1.js → post-popover-6e518e5d.js} +1 -1
- package/dist/cjs/post-popover.cjs.entry.js +2 -2
- package/dist/cjs/{post-popovercontainer-54fdb96a.js → post-popovercontainer-04b48ae7.js} +1 -1
- package/dist/cjs/post-popovercontainer.cjs.entry.js +2 -2
- package/dist/cjs/{post-rating-40fd0022.js → post-rating-6d08d116.js} +1 -1
- package/dist/cjs/post-rating.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-header-7afd6666.js → post-tab-header-ac6eac1d.js} +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-panel-09f63fbe.js → post-tab-panel-82e261ac.js} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-eb67e3ba.js → post-tabs-fb7c183a.js} +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tag-0a4c4803.js → post-tag-ee3abaa5.js} +1 -1
- package/dist/cjs/post-tag.cjs.entry.js +2 -2
- package/dist/cjs/{post-tooltip-0848ddad.js → post-tooltip-ff3ac87c.js} +4 -3
- package/dist/cjs/post-tooltip.cjs.entry.js +2 -2
- package/dist/collection/components/post-icon/post-icon.js +2 -2
- package/dist/collection/components/post-tooltip/post-tooltip.js +3 -2
- package/dist/components/package.js +1 -1
- package/dist/components/post-icon2.js +2 -2
- package/dist/components/post-tooltip2.js +3 -2
- package/dist/docs.json +1 -1
- package/dist/esm/index.js +16 -16
- package/dist/esm/{package-113efb04.js → package-d29e070b.js} +1 -1
- package/dist/esm/{post-accordion-f05f48bf.js → post-accordion-c7e579aa.js} +1 -1
- package/dist/esm/{post-accordion-item-ba81994d.js → post-accordion-item-f9a065e7.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-bf19637d.js → post-alert-f7767e7b.js} +1 -1
- package/dist/esm/post-alert.entry.js +2 -2
- package/dist/esm/{post-card-control-e23fa67c.js → post-card-control-1f3589ae.js} +1 -1
- package/dist/esm/post-card-control.entry.js +2 -2
- package/dist/esm/{post-collapsible-trigger-42029af6.js → post-collapsible-trigger-e4421b76.js} +1 -1
- package/dist/esm/post-collapsible_2.entry.js +2 -2
- package/dist/esm/{post-icon-46fcfb37.js → post-icon-ad578880.js} +3 -3
- package/dist/esm/post-icon.entry.js +2 -2
- package/dist/esm/{post-logo-69b0aa13.js → post-logo-0a5be6f2.js} +1 -1
- package/dist/esm/post-logo.entry.js +2 -2
- package/dist/esm/{post-popover-cae4749e.js → post-popover-0e66ad0c.js} +1 -1
- package/dist/esm/post-popover.entry.js +2 -2
- package/dist/esm/{post-popovercontainer-9f80e270.js → post-popovercontainer-41ae4794.js} +1 -1
- package/dist/esm/post-popovercontainer.entry.js +2 -2
- package/dist/esm/{post-rating-b089afb0.js → post-rating-94bf66dc.js} +1 -1
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/{post-tab-header-56260756.js → post-tab-header-8bce04c1.js} +1 -1
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/{post-tab-panel-d87976fd.js → post-tab-panel-ea2cda9a.js} +1 -1
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-d0545497.js → post-tabs-9dbdd74a.js} +1 -1
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tag-7de9b6b2.js → post-tag-60e18017.js} +1 -1
- package/dist/esm/post-tag.entry.js +2 -2
- package/dist/esm/{post-tooltip-e58df069.js → post-tooltip-4a1b10cd.js} +4 -3
- package/dist/esm/post-tooltip.entry.js +2 -2
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/{p-4138d67d.js → p-001133e8.js} +1 -1
- package/dist/post-components/{p-80f585c6.js → p-02770d4a.js} +1 -1
- package/dist/post-components/p-09519094.entry.js +1 -0
- package/dist/post-components/{p-c7555df8.js → p-0de6a729.js} +1 -1
- package/dist/post-components/{p-3fcc974a.js → p-10a09c4b.js} +1 -1
- package/dist/post-components/p-2897cd07.entry.js +1 -0
- package/dist/post-components/{p-a0362ea8.js → p-2bf17a69.js} +2 -2
- package/dist/post-components/p-3b52ddf2.entry.js +1 -0
- package/dist/post-components/{p-3461b4e0.js → p-44169e46.js} +1 -1
- package/dist/post-components/{p-f2f0c975.entry.js → p-4ab11d6c.entry.js} +1 -1
- package/dist/post-components/{p-09d2401b.js → p-4ee16350.js} +1 -1
- package/dist/post-components/p-553a781a.entry.js +1 -0
- package/dist/post-components/p-57107054.entry.js +1 -0
- package/dist/post-components/p-60079f09.entry.js +1 -0
- package/dist/post-components/p-63887429.entry.js +1 -0
- package/dist/post-components/p-74d32a31.js +1 -0
- package/dist/post-components/{p-d63706c6.js → p-78c8a5ab.js} +1 -1
- package/dist/post-components/{p-d1cb574f.js → p-78f51161.js} +1 -1
- package/dist/post-components/p-891e8d73.entry.js +1 -0
- package/dist/post-components/{p-7ca7332d.js → p-896a1999.js} +1 -1
- package/dist/post-components/{p-3f46eaf6.js → p-8ca93cd2.js} +1 -1
- package/dist/post-components/p-91c91d6c.js +1 -0
- package/dist/post-components/p-b2204a72.entry.js +1 -0
- package/dist/post-components/p-c21977d3.entry.js +1 -0
- package/dist/post-components/p-cdbab0b8.entry.js +1 -0
- package/dist/post-components/p-d20176b4.entry.js +1 -0
- package/dist/post-components/{p-3fa3ac56.js → p-d34e4bc9.js} +1 -1
- package/dist/post-components/p-e755ccab.entry.js +1 -0
- package/dist/post-components/p-eac7818e.entry.js +1 -0
- package/dist/post-components/{p-9bf946a0.js → p-ee5cf01d.js} +1 -1
- package/dist/post-components/{p-040b2da6.js → p-f9a2b975.js} +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/loaders/package.js +1 -1
- package/loaders/post-icon2.js +2 -2
- package/loaders/post-tooltip.js +3 -2
- package/package.json +2 -2
- package/dist/post-components/p-0851ad56.entry.js +0 -1
- package/dist/post-components/p-3ca685b3.entry.js +0 -1
- package/dist/post-components/p-4697a4ab.entry.js +0 -1
- package/dist/post-components/p-52c6cdf4.entry.js +0 -1
- package/dist/post-components/p-5c070b32.entry.js +0 -1
- package/dist/post-components/p-68965ee0.entry.js +0 -1
- package/dist/post-components/p-6c180694.entry.js +0 -1
- package/dist/post-components/p-75f69b10.entry.js +0 -1
- package/dist/post-components/p-83157726.entry.js +0 -1
- package/dist/post-components/p-b0a6adcb.entry.js +0 -1
- package/dist/post-components/p-c6025b2b.js +0 -1
- package/dist/post-components/p-c7d9278c.entry.js +0 -1
- package/dist/post-components/p-dc827271.entry.js +0 -1
- package/dist/post-components/p-dcb9e9dc.entry.js +0 -1
- package/dist/post-components/p-ee99d7f5.entry.js +0 -1
- package/dist/post-components/p-efddc749.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-343f6de1.js";export{s as setNonce}from"./p-343f6de1.js";import{g as l}from"./p-e1255160.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-343f6de1.js";export{s as setNonce}from"./p-343f6de1.js";import{g as l}from"./p-e1255160.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["p-3b52ddf2",[[1,"post-accordion-item",{collapsed:[1028],headingLevel:[2,"heading-level"],id:[32],toggle:[64]},[[2,"postToggle","onCollapseToggle"]],{headingLevel:["validateHeadingLevel"]}]]],["p-891e8d73",[[1,"post-alert",{dismissible:[4],dismissLabel:[1,"dismiss-label"],fixed:[4],icon:[1],type:[1],alertId:[32],classes:[32],hasActions:[32],hasHeading:[32],onDismissButtonClick:[32],dismiss:[64]},null,{dismissible:["validateDismissible"],dismissLabel:["validateDismissLabel"],fixed:["validateFixed"],icon:["validateIcon"],type:["validateType"]}]]],["p-e755ccab",[[65,"post-card-control",{label:[1],description:[1],type:[1],name:[1],value:[1],checked:[1028],disabled:[1028],validity:[1025],icon:[1],focused:[32],reset:[64],groupReset:[64]},null,{label:["validateControlLabel"],type:["validateControlType"],checked:["updateControlChecked"],disabled:["updateControlDisabled"]}]]],["p-d20176b4",[[4,"post-popovercontainer",{placement:[1],arrow:[4],show:[64],hide:[64],toggle:[64]}]]],["p-cdbab0b8",[[1,"post-popover",{placement:[1],closeButtonCaption:[1,"close-button-caption"],arrow:[4],show:[64],hide:[64],toggle:[64]}]]],["p-553a781a",[[1,"post-rating",{label:[1],stars:[2],currentRating:[1026,"current-rating"],readonly:[4],hoveredIndex:[32]}]]],["p-63887429",[[1,"post-tag",{variant:[1],size:[1],icon:[1],classes:[32]},null,{variant:["variantChanged"],size:["sizeChanged"]}]]],["p-57107054",[[1,"post-tooltip",{placement:[1],arrow:[4],delayed:[4],show:[64],hide:[64],toggle:[64]},null,{delayed:["validateDelayed"]}]]],["p-c21977d3",[[1,"post-accordion",{headingLevel:[2,"heading-level"],multiple:[4],toggle:[64],expandAll:[64],collapseAll:[64]},[[0,"postToggle","collapseToggleHandler"]],{headingLevel:["validateHeadingLevel"]}]]],["p-2897cd07",[[1,"post-logo",{url:[1]},null,{url:["validateUrl"]}]]],["p-60079f09",[[1,"post-tab-header",{panel:[1],tabId:[32]},null,{panel:["validateFor"]}]]],["p-eac7818e",[[1,"post-tab-panel",{name:[1],panelId:[32]}]]],["p-b2204a72",[[1,"post-tabs",{activePanel:[1,"active-panel"],show:[64]}]]],["p-4ab11d6c",[[1,"post-collapsible",{collapsed:[1028],toggle:[64]},null,{collapsed:["collapsedChange"]}],[0,"post-collapsible-trigger",{for:[1],update:[64]},null,{for:["setAriaAttributes"]}]]],["p-09519094",[[1,"post-icon",{animation:[1],base:[1],flipH:[4,"flip-h"],flipV:[4,"flip-v"],name:[1],rotate:[2],scale:[2]},null,{animation:["validateAnimation"],base:["validateBase"],flipH:["validateFlipH"],flipV:["validateFlipV"],name:["validateName"],rotate:["validateRotate"],scale:["validateScale"]}]]]],e))));
|
package/loaders/package.js
CHANGED
package/loaders/post-icon2.js
CHANGED
|
@@ -7,7 +7,7 @@ import { c as checkType } from './check-type.js';
|
|
|
7
7
|
const postIconCss = ":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)}}";
|
|
8
8
|
const PostIconStyle0 = postIconCss;
|
|
9
9
|
|
|
10
|
-
const CDN_URL =
|
|
10
|
+
const CDN_URL = `https://unpkg.com/@swisspost/design-system-icons@${version}/public/post-icons`;
|
|
11
11
|
const ANIMATION_NAMES = [
|
|
12
12
|
'cylon',
|
|
13
13
|
'cylon-vertical',
|
|
@@ -121,7 +121,7 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends HTMLEle
|
|
|
121
121
|
this.validateAnimation();
|
|
122
122
|
}
|
|
123
123
|
render() {
|
|
124
|
-
return (h(Host, { key: '
|
|
124
|
+
return (h(Host, { key: '01c59dae4b2d4277f9230534080924359d64542a', "data-version": version }, h("span", { key: '639ccb1dde3fef32e2678abaaf549ac830838158', style: this.getStyles() })));
|
|
125
125
|
}
|
|
126
126
|
get host() { return this; }
|
|
127
127
|
static get watchers() { return {
|
package/loaders/post-tooltip.js
CHANGED
|
@@ -4933,8 +4933,9 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
4933
4933
|
*/
|
|
4934
4934
|
async show(target, triggeredByFocus = false) {
|
|
4935
4935
|
const showTooltip = () => {
|
|
4936
|
+
// The method might have been called after a delay and the host might not be defined anymore
|
|
4936
4937
|
// If focus or pointer event is not on the button anymore, don't show the tooltip
|
|
4937
|
-
if (globalCurrentTarget !== target)
|
|
4938
|
+
if (!this.host || globalCurrentTarget !== target)
|
|
4938
4939
|
return;
|
|
4939
4940
|
// Determine if the tooltip was opened by a focus event
|
|
4940
4941
|
this.wasOpenedByFocus = triggeredByFocus;
|
|
@@ -4987,7 +4988,7 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
4987
4988
|
}
|
|
4988
4989
|
render() {
|
|
4989
4990
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
4990
|
-
return (h(Host, { key: '
|
|
4991
|
+
return (h(Host, { key: '10847be18d01410e3fa1fe24a2e35ef2f81a8f81', "data-version": version$1, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '763de18194e370c0c567c6b402a1a06ef80cb3fb', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '8336b83ef7e6323408579e252b12fd65d979fe5c' }))));
|
|
4991
4992
|
}
|
|
4992
4993
|
get host() { return this; }
|
|
4993
4994
|
static get watchers() { return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "8.9.
|
|
3
|
+
"version": "8.9.4",
|
|
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.9.
|
|
29
|
+
"@swisspost/design-system-styles": "8.9.4",
|
|
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_tab_panel}from"./p-4138d67d.js";import"./p-343f6de1.js";import"./p-c6025b2b.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_rating}from"./p-c7555df8.js";import"./p-343f6de1.js";import"./p-c6025b2b.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_tab_header}from"./p-3fcc974a.js";import"./p-343f6de1.js";import"./p-c6025b2b.js";import"./p-b095519d.js";import"./p-440193f4.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_popover}from"./p-d63706c6.js";import"./p-343f6de1.js";import"./p-c6025b2b.js";import"./p-6adeaa6c.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_icon}from"./p-efddc749.js";import"./p-343f6de1.js";import"./p-deb4131c.js";import"./p-440193f4.js";import"./p-611b3c41.js";import"./p-c6025b2b.js";import"./p-b095519d.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_accordion_item}from"./p-09d2401b.js";import"./p-343f6de1.js";import"./p-c6025b2b.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_popovercontainer}from"./p-3f46eaf6.js";import"./p-343f6de1.js";import"./p-c6025b2b.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_tooltip}from"./p-a0362ea8.js";import"./p-343f6de1.js";import"./p-c6025b2b.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_alert}from"./p-80f585c6.js";import"./p-343f6de1.js";import"./p-c6025b2b.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_accordion}from"./p-040b2da6.js";import"./p-343f6de1.js";import"./p-c6025b2b.js";import"./p-247a1668.js";import"./p-611b3c41.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const o="8.9.2";export{o as v}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_logo}from"./p-7ca7332d.js";import"./p-343f6de1.js";import"./p-c6025b2b.js";import"./p-deb4131c.js";import"./p-440193f4.js";import"./p-611b3c41.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_tag}from"./p-3fa3ac56.js";import"./p-343f6de1.js";import"./p-c6025b2b.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_card_control}from"./p-d1cb574f.js";import"./p-343f6de1.js";import"./p-611b3c41.js";import"./p-b095519d.js";import"./p-440193f4.js";import"./p-c6025b2b.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as post_tabs}from"./p-9bf946a0.js";import"./p-343f6de1.js";import"./p-c6025b2b.js";import"./p-2737eaf5.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,H as e,g as a}from"./p-343f6de1.js";import{c as n,d as o,a as s}from"./p-deb4131c.js";import{v as r}from"./p-c6025b2b.js";import{c as l}from"./p-b095519d.js";const c=["cylon","cylon-vertical","spin","spin-reverse","fade","throb"],m=class{constructor(t){i(this,t),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&&n(i,c,`The post-icon "animation" prop requires one of the following values: ${c.join(", ")}.`)}validateBase(i=this.base){o(i,"string",'The post-icon "base" prop should be a string.')}validateFlipH(i=this.flipH){o(i,"boolean",'The post-icon "flipH" prop should be a boolean.')}validateFlipV(i=this.flipV){o(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){o(i,"number",'The post-icon "rotate" prop should be a number.')}validateScale(i=this.scale){o(i,"number",'The post-icon "scale" prop should be a number.')}getUrl(){var i,t,e,a,n,o,s;const r=[p(this.base,"both"),p(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"),"relative"),p(null===(t=document.querySelector("base[href]"))||void 0===t?void 0:t.getAttribute("href"),"both")],l=null!==(n=null===(a=null===(e=r.find((i=>i.definesDomain)))||void 0===e?void 0:e.url)||void 0===a?void 0:a.origin)&&void 0!==n?n:window.location.origin,c=null===(s=null===(o=r.find((i=>i.definesSlug)))||void 0===o?void 0:o.url)||void 0===s?void 0:s.pathname,m=`${this.name}.svg`;let h;return h=c?new URL(`${l}${c}/${m}`).toString():new URL(`https://unpkg.com/@swisspost/design-system-icons/public/post-icons/${m}`).toString(),h;function p(i,t){return{url:e(i),definesDomain:"relative"!==t&&a(i),definesSlug:"absolute"!==t&&function(i){const t=e(i);return Boolean(/^\/.+/.test(null==t?void 0:t.pathname))}(i)};function e(i){return i?a(i)?new URL(i):new URL(i,window.location.origin):null}function a(i){return!!i&&/^https?:\/\//.test(i)}}}getStyles(){const i=this.getUrl();return Object.entries({"-webkit-mask-image":`url(${i})`,"mask-image":`url('${i}')`,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,e])=>Object.assign(i,{[t]:e})),{})}componentDidLoad(){this.validateBase(),this.validateName(),this.validateFlipH(),this.validateFlipV(),this.validateScale(),this.validateRotate(),this.validateAnimation()}render(){return t(e,{key:"77740745eb170076301edb3ff96b846e48c7f2f4","data-version":r},t("span",{key:"573f2acd8e92ec5f2f8853b5cb05386bcaee693d",style:this.getStyles()}))}get host(){return a(this)}static get watchers(){return{animation:["validateAnimation"],base:["validateBase"],flipH:["validateFlipH"],flipV:["validateFlipV"],name:["validateName"],rotate:["validateRotate"],scale:["validateScale"]}}};m.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{m as P}
|