@swisspost/design-system-components 2.1.0 → 7.1.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/README.md +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/check-one-of-f4f5d0c0.js +8 -0
- package/dist/cjs/heading-levels-608d432e.js +5 -0
- package/dist/cjs/{index-8c288b1a.js → index-a1440961.js} +2 -6
- package/dist/cjs/index-de783b23.js +1394 -0
- package/dist/cjs/index.cjs.js +21 -15
- package/dist/cjs/loader.cjs.js +5 -3
- package/dist/cjs/{package-96a46572.js → package-dacf5ec2.js} +1 -1
- package/dist/cjs/{post-accordion-9d27458a.js → post-accordion-225de951.js} +40 -23
- package/dist/cjs/post-accordion-item-935e122a.js +52 -0
- package/dist/cjs/post-accordion-item.cjs.entry.js +6 -4
- package/dist/cjs/post-accordion.cjs.entry.js +5 -3
- package/dist/cjs/post-alert-6041a34c.js +98 -0
- package/dist/cjs/post-alert.cjs.entry.js +5 -4
- package/dist/cjs/post-card-control-3c089d8e.js +314 -0
- package/dist/cjs/post-card-control.cjs.entry.js +14 -0
- package/dist/cjs/{post-collapsible-1867015c.js → post-collapsible-562268e9.js} +7 -7
- package/dist/cjs/post-collapsible.cjs.entry.js +5 -4
- package/dist/cjs/post-components.cjs.js +13 -11
- package/dist/cjs/{post-icon-07a67b83.js → post-icon-973d5c46.js} +5 -5
- package/dist/cjs/post-icon.cjs.entry.js +5 -4
- package/dist/cjs/post-popover-b0844e71.js +104 -0
- package/dist/cjs/post-popover.cjs.entry.js +3 -3
- package/dist/cjs/{post-popovercontainer-003c0819.js → post-popovercontainer-5bb6a804.js} +254 -55
- package/dist/cjs/post-popovercontainer.cjs.entry.js +3 -3
- package/dist/cjs/post-rating-d2845096.js +88 -0
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-header-6496a51b.js +32 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-panel-6a9c4a4f.js → post-tab-panel-25bd8c74.js} +3 -3
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-2eb6f376.js → post-tabs-4e4ee252.js} +23 -21
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/post-tag-cbc458ed.js +47 -0
- package/dist/cjs/post-tag.cjs.entry.js +11 -0
- package/dist/cjs/{post-tooltip-260d0627.js → post-tooltip-805bc0c0.js} +13 -9
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/post-accordion/post-accordion.js +68 -25
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +17 -12
- package/dist/collection/components/post-alert/alert-types.js +1 -1
- package/dist/collection/components/post-alert/post-alert.css +2 -2
- package/dist/collection/components/post-alert/post-alert.js +9 -9
- package/dist/collection/components/post-card-control/post-card-control.css +31 -0
- package/dist/collection/components/post-card-control/post-card-control.js +523 -0
- package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +6 -6
- package/dist/collection/components/post-icon/post-icon.js +4 -4
- package/dist/collection/components/post-popover/post-popover.css +29 -1
- package/dist/collection/components/post-popover/post-popover.js +3 -3
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +7 -7
- package/dist/collection/components/post-rating/post-rating.css +28 -0
- package/dist/collection/components/post-rating/post-rating.js +8 -8
- package/dist/collection/components/post-tab-header/post-tab-header.css +30 -2
- package/dist/collection/components/post-tab-header/post-tab-header.js +3 -3
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -2
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +23 -21
- package/dist/collection/components/post-tag/post-tag.css +31 -0
- package/dist/collection/components/post-tag/post-tag.js +119 -0
- package/dist/collection/components/post-tooltip/post-tooltip.js +12 -9
- package/dist/collection/index.js +2 -0
- package/dist/collection/types/heading-levels.js +1 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/sass-export.js +16 -0
- package/dist/components/check-one-of.js +6 -0
- package/dist/components/heading-levels.js +3 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index2.js +1 -5
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +9 -8
- package/dist/components/post-accordion2.js +42 -22
- package/dist/components/post-alert2.js +7 -7
- package/dist/components/post-card-control.d.ts +11 -0
- package/dist/components/post-card-control.js +6 -0
- package/dist/components/post-card-control2.js +345 -0
- package/dist/components/post-collapsible2.js +4 -4
- package/dist/components/post-icon2.js +2 -2
- package/dist/components/post-popover2.js +2 -2
- package/dist/components/post-popovercontainer2.js +252 -53
- package/dist/components/post-rating2.js +6 -6
- package/dist/components/post-tab-header2.js +2 -2
- package/dist/components/post-tab-panel2.js +1 -1
- package/dist/components/post-tabs2.js +21 -19
- package/dist/components/post-tag.d.ts +11 -0
- package/dist/components/post-tag.js +6 -0
- package/dist/components/post-tag2.js +74 -0
- package/dist/components/post-tooltip2.js +11 -7
- package/dist/docs.d.ts +34 -0
- package/dist/docs.json +538 -25
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/check-one-of-6b3ef8eb.js +6 -0
- package/dist/esm/heading-levels-5b7b4349.js +3 -0
- package/dist/esm/index-cf1d5611.js +1365 -0
- package/dist/esm/{index-b444db27.js → index-d1eba94c.js} +1 -5
- package/dist/esm/index.js +19 -15
- package/dist/esm/loader.js +6 -4
- package/dist/esm/{package-50a9c0c3.js → package-a837c1ad.js} +1 -1
- package/dist/esm/{post-accordion-33fe4f0e.js → post-accordion-fdd22c1d.js} +40 -23
- package/dist/esm/post-accordion-item-336f568c.js +50 -0
- package/dist/esm/post-accordion-item.entry.js +6 -4
- package/dist/esm/post-accordion.entry.js +5 -3
- package/dist/esm/post-alert-f48527d8.js +96 -0
- package/dist/esm/post-alert.entry.js +5 -4
- package/dist/esm/post-card-control-3e6a5855.js +312 -0
- package/dist/esm/post-card-control.entry.js +6 -0
- package/dist/esm/{post-collapsible-50dc361b.js → post-collapsible-486ab980.js} +7 -7
- package/dist/esm/post-collapsible.entry.js +5 -4
- package/dist/esm/post-components.js +14 -12
- package/dist/esm/{post-icon-00f314ae.js → post-icon-19fdfc4d.js} +5 -5
- package/dist/esm/post-icon.entry.js +5 -4
- package/dist/esm/post-popover-17164186.js +102 -0
- package/dist/esm/post-popover.entry.js +3 -3
- package/dist/esm/{post-popovercontainer-62e1fd82.js → post-popovercontainer-d19f9646.js} +254 -55
- package/dist/esm/post-popovercontainer.entry.js +3 -3
- package/dist/esm/post-rating-ea204778.js +86 -0
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/post-tab-header-a97cdef2.js +30 -0
- package/dist/esm/post-tab-header.entry.js +3 -3
- package/dist/esm/{post-tab-panel-37a1331f.js → post-tab-panel-e6999395.js} +3 -3
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-c4e65a45.js → post-tabs-524c699a.js} +23 -21
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/post-tag-e2035a81.js +45 -0
- package/dist/esm/post-tag.entry.js +3 -0
- package/dist/esm/{post-tooltip-033f63fa.js → post-tooltip-e4fc9c0c.js} +13 -9
- package/dist/esm/post-tooltip.entry.js +3 -3
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-07cc4853.entry.js +1 -0
- package/dist/post-components/p-0e410cec.entry.js +1 -0
- package/dist/post-components/p-14e22434.entry.js +1 -0
- package/dist/post-components/p-18a2ef27.js +1 -0
- package/dist/post-components/p-18b571e3.js +2 -0
- package/dist/post-components/p-247a1668.js +1 -0
- package/dist/post-components/p-2f4c40ee.js +1 -0
- package/dist/post-components/p-39a1dcb8.entry.js +1 -0
- package/dist/post-components/p-3b0988a1.js +1 -0
- package/dist/post-components/p-3ee18d14.entry.js +1 -0
- package/dist/post-components/p-4575a570.js +1 -0
- package/dist/post-components/p-59da0b80.js +1 -0
- package/dist/post-components/p-611b3c41.js +1 -0
- package/dist/post-components/p-63277771.entry.js +1 -0
- package/dist/post-components/p-67df1075.js +1 -0
- package/dist/post-components/p-74db9b35.entry.js +1 -0
- package/dist/post-components/p-7bb79254.entry.js +1 -0
- package/dist/post-components/p-8398de7b.entry.js +1 -0
- package/dist/post-components/p-9a59f2c7.js +1 -0
- package/dist/post-components/p-c4a7208a.js +1 -0
- package/dist/post-components/{p-7e7833f7.js → p-c85913ed.js} +3 -3
- package/dist/post-components/p-caaa5b4c.entry.js +1 -0
- package/dist/post-components/p-cf10d355.js +1 -0
- package/dist/post-components/p-d1f516dd.js +1 -0
- package/dist/post-components/p-d2eb0f0b.js +1 -0
- package/dist/post-components/p-d70f33cd.js +1 -0
- package/dist/post-components/p-da049db2.entry.js +1 -0
- package/dist/post-components/p-db114d1d.entry.js +1 -0
- package/dist/post-components/p-e1255160.js +1 -0
- package/dist/post-components/p-e929ddbc.js +1 -0
- package/dist/post-components/p-ebb54756.entry.js +1 -0
- package/dist/post-components/p-ed22dec0.js +1 -0
- package/dist/post-components/p-f5d8f3fe.entry.js +1 -0
- package/dist/post-components/p-f91c0e1b.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion/post-accordion.d.ts +8 -2
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +3 -2
- package/dist/types/components/post-alert/alert-types.d.ts +2 -2
- package/dist/types/components/post-alert/post-alert.d.ts +2 -2
- package/dist/types/components/post-card-control/post-card-control.d.ts +112 -0
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +1 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -1
- package/dist/types/components/post-rating/post-rating.d.ts +2 -2
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +27 -0
- package/dist/types/components.d.ts +191 -15
- package/dist/types/css-modules.js +0 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/types/css-modules.d.ts +6 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/types/heading-levels.d.ts +2 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/sass-export.d.ts +2 -0
- package/package.json +22 -22
- package/dist/cjs/index-f243643b.js +0 -2051
- package/dist/cjs/post-accordion-item-61fb55fa.js +0 -51
- package/dist/cjs/post-alert-a810f5b9.js +0 -98
- package/dist/cjs/post-popover-9610b64c.js +0 -104
- package/dist/cjs/post-rating-75574abd.js +0 -88
- package/dist/cjs/post-tab-header-85424e32.js +0 -32
- package/dist/esm/index-1708db56.js +0 -2022
- package/dist/esm/post-accordion-item-1fd95c9f.js +0 -49
- package/dist/esm/post-alert-65d67f69.js +0 -96
- package/dist/esm/post-popover-40bfd1b7.js +0 -102
- package/dist/esm/post-rating-f7a79ed4.js +0 -86
- package/dist/esm/post-tab-header-0683252a.js +0 -30
- package/dist/post-components/p-00dcad55.js +0 -1
- package/dist/post-components/p-01e57281.entry.js +0 -1
- package/dist/post-components/p-06c989fb.entry.js +0 -1
- package/dist/post-components/p-07ffb6de.entry.js +0 -1
- package/dist/post-components/p-10b4cf7a.js +0 -2
- package/dist/post-components/p-26c658c1.entry.js +0 -1
- package/dist/post-components/p-2a964700.js +0 -1
- package/dist/post-components/p-35f14000.js +0 -1
- package/dist/post-components/p-3fb09ecd.js +0 -1
- package/dist/post-components/p-4b0a45d8.entry.js +0 -1
- package/dist/post-components/p-53e8e4e7.entry.js +0 -1
- package/dist/post-components/p-598b11b6.js +0 -1
- package/dist/post-components/p-5b6ee52a.entry.js +0 -1
- package/dist/post-components/p-8139faa4.entry.js +0 -1
- package/dist/post-components/p-8cd6d7c2.js +0 -1
- package/dist/post-components/p-99a9602e.js +0 -1
- package/dist/post-components/p-a2775477.entry.js +0 -1
- package/dist/post-components/p-a905b16b.entry.js +0 -1
- package/dist/post-components/p-aa02111b.js +0 -1
- package/dist/post-components/p-b135d3e2.js +0 -1
- package/dist/post-components/p-b81e61ed.entry.js +0 -1
- package/dist/post-components/p-d6bc34ff.js +0 -1
- package/dist/post-components/p-da2b8e26.entry.js +0 -1
- package/dist/post-components/p-f0476913.js +0 -1
- package/dist/post-components/p-f0e82e63.js +0 -1
- package/dist/post-components/p-ff0e1564.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { v as version } from './package-
|
|
3
|
-
import { d as checkEmptyOrType } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-cf1d5611.js';
|
|
2
|
+
import { v as version } from './package-a837c1ad.js';
|
|
3
|
+
import { d as checkEmptyOrType } from './index-d1eba94c.js';
|
|
4
4
|
|
|
5
5
|
function isMotionReduced() {
|
|
6
6
|
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
@@ -24,13 +24,13 @@ const expand = (el) => {
|
|
|
24
24
|
return el.animate([collapsedKeyframe, expandedKeyframe, finalKeyframe], animationOptions);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const postCollapsibleCss = ":host{display:block}";
|
|
27
|
+
const postCollapsibleCss = ":host{display:block}.collapse{overflow:hidden}";
|
|
28
28
|
const PostCollapsibleStyle0 = postCollapsibleCss;
|
|
29
29
|
|
|
30
30
|
const PostCollapsible = class {
|
|
31
31
|
constructor(hostRef) {
|
|
32
32
|
registerInstance(this, hostRef);
|
|
33
|
-
this.
|
|
33
|
+
this.postToggle = createEvent(this, "postToggle", 7);
|
|
34
34
|
this.isLoaded = false;
|
|
35
35
|
this.id = undefined;
|
|
36
36
|
this.isOpen = true;
|
|
@@ -60,7 +60,7 @@ const PostCollapsible = class {
|
|
|
60
60
|
return open;
|
|
61
61
|
this.isOpen = !this.isOpen;
|
|
62
62
|
if (this.isLoaded)
|
|
63
|
-
this.
|
|
63
|
+
this.postToggle.emit(this.isOpen);
|
|
64
64
|
const animation = open ? expand(this.collapsible) : collapse(this.collapsible);
|
|
65
65
|
if (!this.isLoaded || isMotionReduced())
|
|
66
66
|
animation.finish();
|
|
@@ -69,7 +69,7 @@ const PostCollapsible = class {
|
|
|
69
69
|
return this.isOpen;
|
|
70
70
|
}
|
|
71
71
|
render() {
|
|
72
|
-
return (h(Host, { key: '
|
|
72
|
+
return (h(Host, { key: 'ae26c034e446105728047e8636d9cc2b81ce56f8', id: this.id, "data-version": version }, h("div", { key: 'ed041dbf2c64e15863edeba34e524d3eb685f562', class: "collapse", id: `${this.id}--collapse`, ref: el => (this.collapsible = el) }, h("slot", { key: 'd579a77be3d99d52a15bc9da00669d8be27a92cf' }))));
|
|
73
73
|
}
|
|
74
74
|
get host() { return getElement(this); }
|
|
75
75
|
static get watchers() { return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { P as post_collapsible } from './post-collapsible-
|
|
2
|
-
import './index-
|
|
3
|
-
import './package-
|
|
4
|
-
import './index-
|
|
1
|
+
export { P as post_collapsible } from './post-collapsible-486ab980.js';
|
|
2
|
+
import './index-cf1d5611.js';
|
|
3
|
+
import './package-a837c1ad.js';
|
|
4
|
+
import './index-d1eba94c.js';
|
|
5
5
|
import './constants-8d548297.js';
|
|
6
|
+
import './check-one-of-6b3ef8eb.js';
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-cf1d5611.js';
|
|
2
|
+
export { s as setNonce } from './index-cf1d5611.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
3
4
|
|
|
4
5
|
/*
|
|
5
|
-
Stencil Client Patch Browser v4.
|
|
6
|
+
Stencil Client Patch Browser v4.18.0 | MIT Licensed | https://stenciljs.com
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
var patchBrowser = () => {
|
|
9
|
+
const importMeta = import.meta.url;
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== "") {
|
|
12
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return promiseResolve(opts);
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
patchBrowser().then(options => {
|
|
17
|
-
|
|
17
|
+
patchBrowser().then(async (options) => {
|
|
18
|
+
await globalScripts();
|
|
19
|
+
return bootstrapLazy([["post-accordion-item",[[1,"post-accordion-item",{"collapsed":[4],"headingLevel":[2,"heading-level"],"id":[32],"isOpen":[32],"toggle":[64]},[[0,"postToggle","onCollapseToggle"]],{"headingLevel":["validateHeadingLevel"]}]]],["post-alert",[[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"]}]]],["post-card-control",[[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":["updateControlDisbled"]}]]],["post-popovercontainer",[[1,"post-popovercontainer",{"placement":[1],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]}]]],["post-popover",[[1,"post-popover",{"placement":[1],"closeButtonCaption":[1,"close-button-caption"],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]}]]],["post-icon",[[1,"post-icon",{"animation":[1],"base":[1],"flipH":[4,"flip-h"],"flipV":[4,"flip-v"],"name":[1],"rotate":[2],"scale":[2],"svgStyles":[32],"svgOutput":[32]},null,{"animation":["validateAnimation"],"base":["validateBase"],"flipH":["validateFlipH"],"flipV":["validateFlipV"],"name":["validateName"],"rotate":["validateRotate"],"scale":["validateScale"]}]]],["post-rating",[[1,"post-rating",{"label":[1],"stars":[2],"currentRating":[1026,"current-rating"],"readonly":[4],"hoveredIndex":[32]}]]],["post-tag",[[1,"post-tag",{"variant":[1],"size":[1],"icon":[1],"classes":[32]},null,{"variant":["variantChanged"],"size":["sizeChanged"]}]]],["post-tooltip",[[1,"post-tooltip",{"placement":[1],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]}]]],["post-accordion",[[1,"post-accordion",{"headingLevel":[2,"heading-level"],"multiple":[4],"toggle":[64],"expandAll":[64],"collapseAll":[64]},[[0,"postToggle","collapseToggleHandler"]],{"headingLevel":["validateHeadingLevel"]}]]],["post-tab-header",[[1,"post-tab-header",{"panel":[1],"tabId":[32]},null,{"panel":["validateFor"]}]]],["post-tab-panel",[[1,"post-tab-panel",{"name":[1],"panelId":[32]}]]],["post-tabs",[[1,"post-tabs",{"activePanel":[1,"active-panel"],"show":[64]}]]],["post-collapsible",[[1,"post-collapsible",{"collapsed":[4],"id":[32],"isOpen":[32],"toggle":[64]},null,{"collapsed":["validateCollapsed"]}]]]], options);
|
|
18
20
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { c as checkEmptyOrOneOf, d as checkEmptyOrType, a as checkType } from './index-
|
|
3
|
-
import { v as version } from './package-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-cf1d5611.js';
|
|
2
|
+
import { c as checkEmptyOrOneOf, d as checkEmptyOrType, a as checkType } from './index-d1eba94c.js';
|
|
3
|
+
import { v as version } from './package-a837c1ad.js';
|
|
4
4
|
import { c as checkNonEmpty } from './check-non-empty-58bd6b17.js';
|
|
5
5
|
|
|
6
6
|
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)}}";
|
|
@@ -70,7 +70,7 @@ const PostIcon = class {
|
|
|
70
70
|
const metaBase = (_b = (_a = document.head
|
|
71
71
|
.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;
|
|
72
72
|
const fileBase = `${(_d = (_c = this.base) !== null && _c !== void 0 ? _c : metaBase) !== null && _d !== void 0 ? _d : CDN_URL}/`.replace(/\/\/$/, '/');
|
|
73
|
-
const fileName = `${this.name}.svg
|
|
73
|
+
const fileName = `${this.name}.svg`;
|
|
74
74
|
const filePath = `${fileBase}${fileName}`;
|
|
75
75
|
this.path = new URL(filePath, window.location.origin).toString();
|
|
76
76
|
}
|
|
@@ -84,7 +84,7 @@ const PostIcon = class {
|
|
|
84
84
|
})
|
|
85
85
|
.filter(([_key, value]) => value !== null)
|
|
86
86
|
.reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
|
|
87
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: '95fa0f7a09d3430bb5d621e01b57188742920eb4', "data-version": version }, h("span", { key: 'c824e3705dc83665bb6f7649381654e6d1e07dfb', style: svgStyles })));
|
|
88
88
|
}
|
|
89
89
|
get host() { return getElement(this); }
|
|
90
90
|
static get watchers() { return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { P as post_icon } from './post-icon-
|
|
2
|
-
import './index-
|
|
3
|
-
import './index-
|
|
1
|
+
export { P as post_icon } from './post-icon-19fdfc4d.js';
|
|
2
|
+
import './index-cf1d5611.js';
|
|
3
|
+
import './index-d1eba94c.js';
|
|
4
4
|
import './constants-8d548297.js';
|
|
5
|
-
import './
|
|
5
|
+
import './check-one-of-6b3ef8eb.js';
|
|
6
|
+
import './package-a837c1ad.js';
|
|
6
7
|
import './check-non-empty-58bd6b17.js';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-cf1d5611.js';
|
|
2
|
+
import { v as version } from './package-a837c1ad.js';
|
|
3
|
+
import { g as getAttributeObserver } from './attribute-observer-37fa950a.js';
|
|
4
|
+
|
|
5
|
+
const postPopoverCss = "/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close{outline-style:none !important;outline-offset:2px !important;outline-width:2px !important;outline-color:var(--post-focus-color) !important}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:solid !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:solid !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:1.5rem;width:1.5rem}:is(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.alert-primary,post-alert[type=primary],.alert-success,post-alert[type=success],.alert-danger,post-alert[type=danger],.alert-notification,post-alert[type=notification],.alert-error,post-alert[type=error]) .btn-close{color:var(--post-contrast-color)}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:var(--post-contrast-color)}.btn-close:disabled{color:var(--post-gray-40)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:Highlight}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}*{box-sizing:border-box}:host{--post-contrast-color:#fff;--post-bg-rgb:51, 51, 51;display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{display:flex;align-items:self-start;padding:.5em;min-width:160px;max-width:280px}@media (max-width: 599.98px){.popover-container{max-width:100%}}.popover-content{padding:.5em;flex-grow:1}";
|
|
6
|
+
const PostPopoverStyle0 = postPopoverCss;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @slot default - Slot for placing content inside the popover.
|
|
10
|
+
*/
|
|
11
|
+
let popoverInstances = 0;
|
|
12
|
+
const popoverTargetAttribute = 'data-popover-target';
|
|
13
|
+
const globalToggleHandler = (e) => {
|
|
14
|
+
const target = e.target;
|
|
15
|
+
if (!target || !('getAttribute' in target))
|
|
16
|
+
return;
|
|
17
|
+
const popoverTarget = target.getAttribute(popoverTargetAttribute);
|
|
18
|
+
if (!popoverTarget || ('key' in e && e.key !== 'Enter'))
|
|
19
|
+
return;
|
|
20
|
+
const popover = document.getElementById(popoverTarget);
|
|
21
|
+
popover === null || popover === void 0 ? void 0 : popover.toggle(target);
|
|
22
|
+
};
|
|
23
|
+
// Initialize a mutation observer for patching accessibility features
|
|
24
|
+
const triggerObserver = getAttributeObserver(popoverTargetAttribute, trigger => {
|
|
25
|
+
const force = trigger.hasAttribute(popoverTargetAttribute);
|
|
26
|
+
trigger.setAttribute('aria-expanded', force ? 'false' : null);
|
|
27
|
+
});
|
|
28
|
+
const PostPopover = class {
|
|
29
|
+
constructor(hostRef) {
|
|
30
|
+
registerInstance(this, hostRef);
|
|
31
|
+
this.placement = 'top';
|
|
32
|
+
this.closeButtonCaption = undefined;
|
|
33
|
+
this.arrow = true;
|
|
34
|
+
this.localBeforeToggleHandler = this.beforeToggleHandler.bind(this);
|
|
35
|
+
}
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
// Set up accessibility patcher and event listeners for the first component
|
|
38
|
+
if (popoverInstances === 0) {
|
|
39
|
+
window.addEventListener('pointerup', globalToggleHandler);
|
|
40
|
+
window.addEventListener('keydown', globalToggleHandler);
|
|
41
|
+
triggerObserver.observe(document.body, {
|
|
42
|
+
subtree: true,
|
|
43
|
+
childList: true,
|
|
44
|
+
attributeFilter: [popoverTargetAttribute],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
popoverInstances++;
|
|
48
|
+
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
49
|
+
}
|
|
50
|
+
componentDidLoad() {
|
|
51
|
+
this.popoverRef.addEventListener('beforetoggle', this.localBeforeToggleHandler);
|
|
52
|
+
}
|
|
53
|
+
disconnectedCallback() {
|
|
54
|
+
popoverInstances--;
|
|
55
|
+
// Remove listeners and observer after the last popover has been destructed
|
|
56
|
+
if (popoverInstances === 0) {
|
|
57
|
+
window.removeEventListener('click', globalToggleHandler);
|
|
58
|
+
window.removeEventListener('keydown', globalToggleHandler);
|
|
59
|
+
triggerObserver.disconnect();
|
|
60
|
+
}
|
|
61
|
+
this.popoverRef.removeEventListener('beforetoggle', this.localBeforeToggleHandler);
|
|
62
|
+
this.triggers.forEach(trigger => trigger.removeAttribute('aria-expanded'));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Programmatically display the popover
|
|
66
|
+
* @param target An element with [data-popover-target="id"] where the popover should be shown
|
|
67
|
+
*/
|
|
68
|
+
async show(target) {
|
|
69
|
+
this.popoverRef.show(target);
|
|
70
|
+
target.setAttribute('aria-expanded', 'true');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Programmatically hide this popover
|
|
74
|
+
*/
|
|
75
|
+
async hide() {
|
|
76
|
+
this.popoverRef.hide();
|
|
77
|
+
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Toggle popover display
|
|
81
|
+
* @param target An element with [data-popover-target="id"] where the popover should be anchored to
|
|
82
|
+
* @param force Pass true to always show or false to always hide
|
|
83
|
+
*/
|
|
84
|
+
async toggle(target, force) {
|
|
85
|
+
const newState = await this.popoverRef.toggle(target, force);
|
|
86
|
+
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
87
|
+
target.setAttribute('aria-expanded', `${newState}`);
|
|
88
|
+
}
|
|
89
|
+
get triggers() {
|
|
90
|
+
return document.querySelectorAll(`[${popoverTargetAttribute}="${this.host.id}"]`);
|
|
91
|
+
}
|
|
92
|
+
beforeToggleHandler() {
|
|
93
|
+
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
94
|
+
}
|
|
95
|
+
render() {
|
|
96
|
+
return (h(Host, { key: '97db4a92db81f3a84ca272af8f79981cf181024d', "data-version": version }, h("post-popovercontainer", { key: '291247845dc11572a5722aa949c1dfa74e521edd', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '92137bf8c92633c8578c89c7b0c8252b0b59e2fa', class: "popover-container" }, h("div", { key: '06f79f59e90ca439b552380af0e151084adadf03', class: "popover-content" }, h("slot", { key: 'c37c742ac7cf24f9440ac3b862761fcd937f7658' })), h("button", { key: '0e6f316574720e0f901af56e0dbb99f86e36c5b4', class: "btn-close", onClick: () => this.hide() }, h("span", { key: '77c41e8e8df74649ce9ca21740c77e78336905e6', class: "visually-hidden" }, this.closeButtonCaption))))));
|
|
97
|
+
}
|
|
98
|
+
get host() { return getElement(this); }
|
|
99
|
+
};
|
|
100
|
+
PostPopover.style = PostPopoverStyle0;
|
|
101
|
+
|
|
102
|
+
export { PostPopover as P };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { P as post_popover } from './post-popover-
|
|
2
|
-
import './index-
|
|
3
|
-
import './package-
|
|
1
|
+
export { P as post_popover } from './post-popover-17164186.js';
|
|
2
|
+
import './index-cf1d5611.js';
|
|
3
|
+
import './package-a837c1ad.js';
|
|
4
4
|
import './attribute-observer-37fa950a.js';
|