@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
|
@@ -24,7 +24,7 @@ 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 = /*@__PURE__*/ proxyCustomElement(class PostCollapsible extends HTMLElement {
|
|
@@ -32,7 +32,7 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
32
32
|
super();
|
|
33
33
|
this.__registerHost();
|
|
34
34
|
this.__attachShadow();
|
|
35
|
-
this.
|
|
35
|
+
this.postToggle = createEvent(this, "postToggle", 7);
|
|
36
36
|
this.isLoaded = false;
|
|
37
37
|
this.id = undefined;
|
|
38
38
|
this.isOpen = true;
|
|
@@ -62,7 +62,7 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
62
62
|
return open;
|
|
63
63
|
this.isOpen = !this.isOpen;
|
|
64
64
|
if (this.isLoaded)
|
|
65
|
-
this.
|
|
65
|
+
this.postToggle.emit(this.isOpen);
|
|
66
66
|
const animation = open ? expand(this.collapsible) : collapse(this.collapsible);
|
|
67
67
|
if (!this.isLoaded || isMotionReduced())
|
|
68
68
|
animation.finish();
|
|
@@ -71,7 +71,7 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
71
71
|
return this.isOpen;
|
|
72
72
|
}
|
|
73
73
|
render() {
|
|
74
|
-
return (h(Host, { key: '
|
|
74
|
+
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' }))));
|
|
75
75
|
}
|
|
76
76
|
get host() { return this; }
|
|
77
77
|
static get watchers() { return {
|
|
@@ -72,7 +72,7 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends HTMLEle
|
|
|
72
72
|
const metaBase = (_b = (_a = document.head
|
|
73
73
|
.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;
|
|
74
74
|
const fileBase = `${(_d = (_c = this.base) !== null && _c !== void 0 ? _c : metaBase) !== null && _d !== void 0 ? _d : CDN_URL}/`.replace(/\/\/$/, '/');
|
|
75
|
-
const fileName = `${this.name}.svg
|
|
75
|
+
const fileName = `${this.name}.svg`;
|
|
76
76
|
const filePath = `${fileBase}${fileName}`;
|
|
77
77
|
this.path = new URL(filePath, window.location.origin).toString();
|
|
78
78
|
}
|
|
@@ -86,7 +86,7 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends HTMLEle
|
|
|
86
86
|
})
|
|
87
87
|
.filter(([_key, value]) => value !== null)
|
|
88
88
|
.reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
|
|
89
|
-
return (h(Host, { key: '
|
|
89
|
+
return (h(Host, { key: '95fa0f7a09d3430bb5d621e01b57188742920eb4', "data-version": version }, h("span", { key: 'c824e3705dc83665bb6f7649381654e6d1e07dfb', style: svgStyles })));
|
|
90
90
|
}
|
|
91
91
|
get host() { return this; }
|
|
92
92
|
static get watchers() { return {
|
|
@@ -3,7 +3,7 @@ import { v as version } from './package.js';
|
|
|
3
3
|
import { g as getAttributeObserver } from './attribute-observer.js';
|
|
4
4
|
import { d as defineCustomElement$1 } from './post-popovercontainer2.js';
|
|
5
5
|
|
|
6
|
-
const postPopoverCss = "/*!\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
|
|
6
|
+
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}";
|
|
7
7
|
const PostPopoverStyle0 = postPopoverCss;
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -96,7 +96,7 @@ const PostPopover = /*@__PURE__*/ proxyCustomElement(class PostPopover extends H
|
|
|
96
96
|
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
97
97
|
}
|
|
98
98
|
render() {
|
|
99
|
-
return (h(Host, { key: '
|
|
99
|
+
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))))));
|
|
100
100
|
}
|
|
101
101
|
get host() { return this; }
|
|
102
102
|
static get style() { return PostPopoverStyle0; }
|
|
@@ -5,6 +5,10 @@ import { v as version } from './package.js';
|
|
|
5
5
|
* Custom positioning reference element.
|
|
6
6
|
* @see https://floating-ui.com/docs/virtual-elements
|
|
7
7
|
*/
|
|
8
|
+
|
|
9
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
10
|
+
const alignments = ['start', 'end'];
|
|
11
|
+
const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
8
12
|
const min = Math.min;
|
|
9
13
|
const max = Math.max;
|
|
10
14
|
const round = Math.round;
|
|
@@ -418,6 +422,109 @@ const arrow$1 = options => ({
|
|
|
418
422
|
}
|
|
419
423
|
});
|
|
420
424
|
|
|
425
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
426
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
427
|
+
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
428
|
+
if (alignment) {
|
|
429
|
+
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
430
|
+
}
|
|
431
|
+
return true;
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
436
|
+
* that has the most space available automatically, without needing to specify a
|
|
437
|
+
* preferred placement. Alternative to `flip`.
|
|
438
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
439
|
+
*/
|
|
440
|
+
const autoPlacement = function (options) {
|
|
441
|
+
if (options === void 0) {
|
|
442
|
+
options = {};
|
|
443
|
+
}
|
|
444
|
+
return {
|
|
445
|
+
name: 'autoPlacement',
|
|
446
|
+
options,
|
|
447
|
+
async fn(state) {
|
|
448
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
|
449
|
+
const {
|
|
450
|
+
rects,
|
|
451
|
+
middlewareData,
|
|
452
|
+
placement,
|
|
453
|
+
platform,
|
|
454
|
+
elements
|
|
455
|
+
} = state;
|
|
456
|
+
const {
|
|
457
|
+
crossAxis = false,
|
|
458
|
+
alignment,
|
|
459
|
+
allowedPlacements = placements,
|
|
460
|
+
autoAlignment = true,
|
|
461
|
+
...detectOverflowOptions
|
|
462
|
+
} = evaluate(options, state);
|
|
463
|
+
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
464
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
465
|
+
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
466
|
+
const currentPlacement = placements$1[currentIndex];
|
|
467
|
+
if (currentPlacement == null) {
|
|
468
|
+
return {};
|
|
469
|
+
}
|
|
470
|
+
const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
471
|
+
|
|
472
|
+
// Make `computeCoords` start from the right place.
|
|
473
|
+
if (placement !== currentPlacement) {
|
|
474
|
+
return {
|
|
475
|
+
reset: {
|
|
476
|
+
placement: placements$1[0]
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
|
|
481
|
+
const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
|
|
482
|
+
placement: currentPlacement,
|
|
483
|
+
overflows: currentOverflows
|
|
484
|
+
}];
|
|
485
|
+
const nextPlacement = placements$1[currentIndex + 1];
|
|
486
|
+
|
|
487
|
+
// There are more placements to check.
|
|
488
|
+
if (nextPlacement) {
|
|
489
|
+
return {
|
|
490
|
+
data: {
|
|
491
|
+
index: currentIndex + 1,
|
|
492
|
+
overflows: allOverflows
|
|
493
|
+
},
|
|
494
|
+
reset: {
|
|
495
|
+
placement: nextPlacement
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
const placementsSortedByMostSpace = allOverflows.map(d => {
|
|
500
|
+
const alignment = getAlignment(d.placement);
|
|
501
|
+
return [d.placement, alignment && crossAxis ?
|
|
502
|
+
// Check along the mainAxis and main crossAxis side.
|
|
503
|
+
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
|
|
504
|
+
// Check only the mainAxis.
|
|
505
|
+
d.overflows[0], d.overflows];
|
|
506
|
+
}).sort((a, b) => a[1] - b[1]);
|
|
507
|
+
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
|
|
508
|
+
// Aligned placements should not check their opposite crossAxis
|
|
509
|
+
// side.
|
|
510
|
+
getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
|
|
511
|
+
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
512
|
+
if (resetPlacement !== placement) {
|
|
513
|
+
return {
|
|
514
|
+
data: {
|
|
515
|
+
index: currentIndex + 1,
|
|
516
|
+
overflows: allOverflows
|
|
517
|
+
},
|
|
518
|
+
reset: {
|
|
519
|
+
placement: resetPlacement
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
return {};
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
|
|
421
528
|
/**
|
|
422
529
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
423
530
|
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
@@ -533,6 +640,75 @@ const flip$1 = function (options) {
|
|
|
533
640
|
};
|
|
534
641
|
};
|
|
535
642
|
|
|
643
|
+
function getSideOffsets(overflow, rect) {
|
|
644
|
+
return {
|
|
645
|
+
top: overflow.top - rect.height,
|
|
646
|
+
right: overflow.right - rect.width,
|
|
647
|
+
bottom: overflow.bottom - rect.height,
|
|
648
|
+
left: overflow.left - rect.width
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
function isAnySideFullyClipped(overflow) {
|
|
652
|
+
return sides.some(side => overflow[side] >= 0);
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
656
|
+
* when it is not in the same clipping context as the reference element.
|
|
657
|
+
* @see https://floating-ui.com/docs/hide
|
|
658
|
+
*/
|
|
659
|
+
const hide = function (options) {
|
|
660
|
+
if (options === void 0) {
|
|
661
|
+
options = {};
|
|
662
|
+
}
|
|
663
|
+
return {
|
|
664
|
+
name: 'hide',
|
|
665
|
+
options,
|
|
666
|
+
async fn(state) {
|
|
667
|
+
const {
|
|
668
|
+
rects
|
|
669
|
+
} = state;
|
|
670
|
+
const {
|
|
671
|
+
strategy = 'referenceHidden',
|
|
672
|
+
...detectOverflowOptions
|
|
673
|
+
} = evaluate(options, state);
|
|
674
|
+
switch (strategy) {
|
|
675
|
+
case 'referenceHidden':
|
|
676
|
+
{
|
|
677
|
+
const overflow = await detectOverflow(state, {
|
|
678
|
+
...detectOverflowOptions,
|
|
679
|
+
elementContext: 'reference'
|
|
680
|
+
});
|
|
681
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
682
|
+
return {
|
|
683
|
+
data: {
|
|
684
|
+
referenceHiddenOffsets: offsets,
|
|
685
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
case 'escaped':
|
|
690
|
+
{
|
|
691
|
+
const overflow = await detectOverflow(state, {
|
|
692
|
+
...detectOverflowOptions,
|
|
693
|
+
altBoundary: true
|
|
694
|
+
});
|
|
695
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
696
|
+
return {
|
|
697
|
+
data: {
|
|
698
|
+
escapedOffsets: offsets,
|
|
699
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
default:
|
|
704
|
+
{
|
|
705
|
+
return {};
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
};
|
|
711
|
+
|
|
536
712
|
function getBoundingRect(rects) {
|
|
537
713
|
const minX = min(...rects.map(rect => rect.left));
|
|
538
714
|
const minY = min(...rects.map(rect => rect.top));
|
|
@@ -713,7 +889,7 @@ async function convertValueToCoords(state, options) {
|
|
|
713
889
|
* object may be passed.
|
|
714
890
|
* @see https://floating-ui.com/docs/offset
|
|
715
891
|
*/
|
|
716
|
-
const offset = function (options) {
|
|
892
|
+
const offset$1 = function (options) {
|
|
717
893
|
if (options === void 0) {
|
|
718
894
|
options = 0;
|
|
719
895
|
}
|
|
@@ -1199,8 +1375,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1199
1375
|
if (domElement) {
|
|
1200
1376
|
const win = getWindow(domElement);
|
|
1201
1377
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1202
|
-
let
|
|
1203
|
-
|
|
1378
|
+
let currentWin = win;
|
|
1379
|
+
let currentIFrame = currentWin.frameElement;
|
|
1380
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1204
1381
|
const iframeScale = getScale(currentIFrame);
|
|
1205
1382
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1206
1383
|
const css = getComputedStyle(currentIFrame);
|
|
@@ -1212,7 +1389,8 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1212
1389
|
height *= iframeScale.y;
|
|
1213
1390
|
x += left;
|
|
1214
1391
|
y += top;
|
|
1215
|
-
|
|
1392
|
+
currentWin = getWindow(currentIFrame);
|
|
1393
|
+
currentIFrame = currentWin.frameElement;
|
|
1216
1394
|
}
|
|
1217
1395
|
}
|
|
1218
1396
|
return rectToClientRect({
|
|
@@ -1224,27 +1402,14 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1224
1402
|
}
|
|
1225
1403
|
|
|
1226
1404
|
const topLayerSelectors = [':popover-open', ':modal'];
|
|
1227
|
-
function
|
|
1228
|
-
|
|
1229
|
-
let x = 0;
|
|
1230
|
-
let y = 0;
|
|
1231
|
-
function setIsTopLayer(selector) {
|
|
1405
|
+
function isTopLayer(element) {
|
|
1406
|
+
return topLayerSelectors.some(selector => {
|
|
1232
1407
|
try {
|
|
1233
|
-
|
|
1234
|
-
} catch (e) {
|
|
1235
|
-
|
|
1236
|
-
topLayerSelectors.forEach(selector => {
|
|
1237
|
-
setIsTopLayer(selector);
|
|
1238
|
-
});
|
|
1239
|
-
if (isTopLayer) {
|
|
1240
|
-
const containingBlock = getContainingBlock(floating);
|
|
1241
|
-
if (containingBlock) {
|
|
1242
|
-
const rect = containingBlock.getBoundingClientRect();
|
|
1243
|
-
x = rect.x;
|
|
1244
|
-
y = rect.y;
|
|
1408
|
+
return element.matches(selector);
|
|
1409
|
+
} catch (e) {
|
|
1410
|
+
return false;
|
|
1245
1411
|
}
|
|
1246
|
-
}
|
|
1247
|
-
return [isTopLayer, x, y];
|
|
1412
|
+
});
|
|
1248
1413
|
}
|
|
1249
1414
|
|
|
1250
1415
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
@@ -1254,9 +1419,10 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1254
1419
|
offsetParent,
|
|
1255
1420
|
strategy
|
|
1256
1421
|
} = _ref;
|
|
1422
|
+
const isFixed = strategy === 'fixed';
|
|
1257
1423
|
const documentElement = getDocumentElement(offsetParent);
|
|
1258
|
-
const
|
|
1259
|
-
if (offsetParent === documentElement ||
|
|
1424
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1425
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1260
1426
|
return rect;
|
|
1261
1427
|
}
|
|
1262
1428
|
let scroll = {
|
|
@@ -1266,7 +1432,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1266
1432
|
let scale = createCoords(1);
|
|
1267
1433
|
const offsets = createCoords(0);
|
|
1268
1434
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1269
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement &&
|
|
1435
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1270
1436
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1271
1437
|
scroll = getNodeScroll(offsetParent);
|
|
1272
1438
|
}
|
|
@@ -1427,7 +1593,7 @@ function getClippingRect(_ref) {
|
|
|
1427
1593
|
rootBoundary,
|
|
1428
1594
|
strategy
|
|
1429
1595
|
} = _ref;
|
|
1430
|
-
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1596
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1431
1597
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1432
1598
|
const firstClippingAncestor = clippingAncestors[0];
|
|
1433
1599
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
@@ -1457,7 +1623,7 @@ function getDimensions(element) {
|
|
|
1457
1623
|
};
|
|
1458
1624
|
}
|
|
1459
1625
|
|
|
1460
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy
|
|
1626
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1461
1627
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1462
1628
|
const documentElement = getDocumentElement(offsetParent);
|
|
1463
1629
|
const isFixed = strategy === 'fixed';
|
|
@@ -1479,17 +1645,8 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy, floating
|
|
|
1479
1645
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
1480
1646
|
}
|
|
1481
1647
|
}
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
const [isTopLayer, topLayerX, topLayerY] = topLayer(floating);
|
|
1485
|
-
if (isTopLayer) {
|
|
1486
|
-
x += topLayerX;
|
|
1487
|
-
y += topLayerY;
|
|
1488
|
-
if (isOffsetParentAnElement) {
|
|
1489
|
-
x += offsetParent.clientLeft;
|
|
1490
|
-
y += offsetParent.clientTop;
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1648
|
+
const x = rect.left + scroll.scrollLeft - offsets.x;
|
|
1649
|
+
const y = rect.top + scroll.scrollTop - offsets.y;
|
|
1493
1650
|
return {
|
|
1494
1651
|
x,
|
|
1495
1652
|
y,
|
|
@@ -1498,6 +1655,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy, floating
|
|
|
1498
1655
|
};
|
|
1499
1656
|
}
|
|
1500
1657
|
|
|
1658
|
+
function isStaticPositioned(element) {
|
|
1659
|
+
return getComputedStyle(element).position === 'static';
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1501
1662
|
function getTrueOffsetParent(element, polyfill) {
|
|
1502
1663
|
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1503
1664
|
return null;
|
|
@@ -1511,29 +1672,41 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
1511
1672
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1512
1673
|
// such as table ancestors and cross browser bugs.
|
|
1513
1674
|
function getOffsetParent(element, polyfill) {
|
|
1514
|
-
const
|
|
1675
|
+
const win = getWindow(element);
|
|
1676
|
+
if (isTopLayer(element)) {
|
|
1677
|
+
return win;
|
|
1678
|
+
}
|
|
1515
1679
|
if (!isHTMLElement(element)) {
|
|
1516
|
-
|
|
1680
|
+
let svgOffsetParent = getParentNode(element);
|
|
1681
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
1682
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
1683
|
+
return svgOffsetParent;
|
|
1684
|
+
}
|
|
1685
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
1686
|
+
}
|
|
1687
|
+
return win;
|
|
1517
1688
|
}
|
|
1518
1689
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1519
|
-
while (offsetParent && isTableElement(offsetParent) &&
|
|
1690
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
1520
1691
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1521
1692
|
}
|
|
1522
|
-
if (offsetParent && (
|
|
1523
|
-
return
|
|
1693
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
1694
|
+
return win;
|
|
1524
1695
|
}
|
|
1525
|
-
return offsetParent || getContainingBlock(element) ||
|
|
1696
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
1526
1697
|
}
|
|
1527
1698
|
|
|
1528
1699
|
const getElementRects = async function (data) {
|
|
1529
1700
|
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1530
1701
|
const getDimensionsFn = this.getDimensions;
|
|
1702
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1531
1703
|
return {
|
|
1532
|
-
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy
|
|
1704
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1533
1705
|
floating: {
|
|
1534
1706
|
x: 0,
|
|
1535
1707
|
y: 0,
|
|
1536
|
-
|
|
1708
|
+
width: floatingDimensions.width,
|
|
1709
|
+
height: floatingDimensions.height
|
|
1537
1710
|
}
|
|
1538
1711
|
};
|
|
1539
1712
|
};
|
|
@@ -1603,9 +1776,11 @@ function observeMove(element, onMove) {
|
|
|
1603
1776
|
return refresh();
|
|
1604
1777
|
}
|
|
1605
1778
|
if (!ratio) {
|
|
1779
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
1780
|
+
// to prevent an infinite loop of updates.
|
|
1606
1781
|
timeoutId = setTimeout(() => {
|
|
1607
1782
|
refresh(false, 1e-7);
|
|
1608
|
-
},
|
|
1783
|
+
}, 1000);
|
|
1609
1784
|
} else {
|
|
1610
1785
|
refresh(false, ratio);
|
|
1611
1786
|
}
|
|
@@ -1709,6 +1884,23 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1709
1884
|
};
|
|
1710
1885
|
}
|
|
1711
1886
|
|
|
1887
|
+
/**
|
|
1888
|
+
* Modifies the placement by translating the floating element along the
|
|
1889
|
+
* specified axes.
|
|
1890
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1891
|
+
* object may be passed.
|
|
1892
|
+
* @see https://floating-ui.com/docs/offset
|
|
1893
|
+
*/
|
|
1894
|
+
const offset = offset$1;
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
1898
|
+
* that has the most space available automatically, without needing to specify a
|
|
1899
|
+
* preferred placement. Alternative to `flip`.
|
|
1900
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
1901
|
+
*/
|
|
1902
|
+
autoPlacement;
|
|
1903
|
+
|
|
1712
1904
|
/**
|
|
1713
1905
|
* Optimizes the visibility of the floating element by shifting it in order to
|
|
1714
1906
|
* keep it in view when it will overflow the clipping boundary.
|
|
@@ -1732,6 +1924,13 @@ const flip = flip$1;
|
|
|
1732
1924
|
*/
|
|
1733
1925
|
const size = size$1;
|
|
1734
1926
|
|
|
1927
|
+
/**
|
|
1928
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
1929
|
+
* when it is not in the same clipping context as the reference element.
|
|
1930
|
+
* @see https://floating-ui.com/docs/hide
|
|
1931
|
+
*/
|
|
1932
|
+
hide;
|
|
1933
|
+
|
|
1735
1934
|
/**
|
|
1736
1935
|
* Provides data to position an inner element of the floating element so that it
|
|
1737
1936
|
* appears centered to the reference element.
|
|
@@ -1832,7 +2031,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
1832
2031
|
}
|
|
1833
2032
|
`,E=null;function I(e){if(E===null)try{E=new CSSStyleSheet,E.replaceSync(C);}catch{E=!1;}if(E===!1){let t=document.createElement("style");t.textContent=C,e instanceof Document?e.head.prepend(t):e.prepend(t);}else e.adoptedStyleSheets=[E,...e.adoptedStyleSheets];}function K(){window.ToggleEvent=window.ToggleEvent||c;function e(n){return n?.includes(":popover-open")&&(n=n.replace(J,"$1.\\:popover-open")),n}f(Document.prototype,"querySelector",e),f(Document.prototype,"querySelectorAll",e),f(Element.prototype,"querySelector",e),f(Element.prototype,"querySelectorAll",e),f(Element.prototype,"matches",e),f(Element.prototype,"closest",e),f(DocumentFragment.prototype,"querySelectorAll",e),f(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let n=(this.getAttribute("popover")||"").toLowerCase();return n===""||n=="auto"?"auto":"manual"},set(n){this.setAttribute("popover",n);}},showPopover:{enumerable:!0,configurable:!0,value(){S(this);}},hidePopover:{enumerable:!0,configurable:!0,value(){m(this,!0,!0);}},togglePopover:{enumerable:!0,configurable:!0,value(n){h.get(this)==="showing"&&n===void 0||n===!1?m(this,!0,!0):(n===void 0||n===!0)&&S(this);}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(n){let s=t.call(this,n);return I(s),s}}});let o=HTMLElement.prototype.attachInternals;o&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let n=o.call(this);return n.shadowRoot&&I(n.shadowRoot),n}}});let r=new WeakMap;function i(n){Object.defineProperties(n.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(s){if(s===null)this.removeAttribute("popovertarget"),r.delete(this);else if(s instanceof Element)this.setAttribute("popovertarget",""),r.set(this,s);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let s=r.get(this);if(s&&s.isConnected)return s;if(s&&!s.isConnected)return r.delete(this),null;let u=v(this),w=this.getAttribute("popovertarget");return (u instanceof Document||u instanceof B)&&w&&u.getElementById(w)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let s=(this.getAttribute("popovertargetaction")||"").toLowerCase();return s==="show"||s==="hide"?s:"toggle"},set(s){this.setAttribute("popovertargetaction",s);}}});}i(HTMLButtonElement),i(HTMLInputElement);let l=n=>{if(!n.isTrusted)return;let s=n.composedPath()[0];if(!(s instanceof Element)||s?.shadowRoot)return;let u=v(s);if(!(u instanceof B||u instanceof Document))return;let w=s.closest("[popovertargetaction],[popovertarget]");if(w){O(w),n.preventDefault();return}},a=n=>{let s=n.key,u=n.target;!n.defaultPrevented&&u&&(s==="Escape"||s==="Esc")&&T(u.ownerDocument,!0,!0);};(n=>{n.addEventListener("click",l),n.addEventListener("keydown",a),n.addEventListener("pointerdown",x),n.addEventListener("pointerup",x);})(document),I(document);}j()||K();})();
|
|
1834
2033
|
|
|
1835
|
-
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}.popover{box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;color:var(--post-contrast-color);background-color:rgb(var(--post-bg-rgb));border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}.arrow{position:absolute;width:.
|
|
2034
|
+
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}.popover{box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;color:var(--post-contrast-color);background-color:rgb(var(--post-bg-rgb));border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}.arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}.arrow.top{border-left:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}.arrow.right{border-right:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}.arrow.left{border-left:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}.arrow.bottom{border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}";
|
|
1836
2035
|
const PostPopovercontainerStyle0 = postPopovercontainerCss;
|
|
1837
2036
|
|
|
1838
2037
|
const SIDE_MAP = {
|
|
@@ -1846,7 +2045,7 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1846
2045
|
super();
|
|
1847
2046
|
this.__registerHost();
|
|
1848
2047
|
this.__attachShadow();
|
|
1849
|
-
this.
|
|
2048
|
+
this.postToggle = createEvent(this, "postToggle", 7);
|
|
1850
2049
|
this.placement = 'top';
|
|
1851
2050
|
this.arrow = false;
|
|
1852
2051
|
}
|
|
@@ -1911,7 +2110,7 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1911
2110
|
if (typeof this.clearAutoUpdate === 'function')
|
|
1912
2111
|
this.clearAutoUpdate();
|
|
1913
2112
|
}
|
|
1914
|
-
this.
|
|
2113
|
+
this.postToggle.emit(isOpen);
|
|
1915
2114
|
}
|
|
1916
2115
|
/**
|
|
1917
2116
|
* Start listening for DOM updates, scroll events etc. that have
|
|
@@ -1970,9 +2169,9 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1970
2169
|
}
|
|
1971
2170
|
}
|
|
1972
2171
|
render() {
|
|
1973
|
-
return (h(Host, { key: '
|
|
2172
|
+
return (h(Host, { key: '1707db71258eef7c95c13d738561d9d55df540fc', "data-version": version }, h("div", { key: 'd1d89bfc31529c803b04f2395509fe96b38d7d7a', class: "popover", part: "popover", ref: (el) => (this.popoverRef = el) }, this.arrow && (h("span", { key: 'd85fc5f68be0ff8060b3be823e22744873395775', class: "arrow", ref: el => {
|
|
1974
2173
|
this.arrowRef = el;
|
|
1975
|
-
} })), h("slot", { key: '
|
|
2174
|
+
} })), h("slot", { key: '7bd455d61d270b9d6cdc132ffb7a00f0259164e7' }))));
|
|
1976
2175
|
}
|
|
1977
2176
|
get host() { return this; }
|
|
1978
2177
|
static get style() { return PostPopovercontainerStyle0; }
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
4
4
|
|
|
5
|
-
const postRatingCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 -0.25rem;border-radius:4px}.rating .star{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.active{--post-rating-star-stroke:hsl(0, 0%, 20%);--post-rating-star-fill:#fc0}.rating .star.hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.after-active{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:2px;outline:2px solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:#fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:hsl(0, 0%, 90%)}";
|
|
5
|
+
const postRatingCss = "/*!\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 */:host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 -0.25rem;border-radius:4px}.rating .star{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.active{--post-rating-star-stroke:hsl(0, 0%, 20%);--post-rating-star-fill:#fc0}.rating .star.hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.after-active{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:2px;outline:2px solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:#fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:hsl(0, 0%, 90%)}";
|
|
6
6
|
const PostRatingStyle0 = postRatingCss;
|
|
7
7
|
|
|
8
8
|
const PostRating = /*@__PURE__*/ proxyCustomElement(class PostRating extends HTMLElement {
|
|
@@ -10,8 +10,8 @@ const PostRating = /*@__PURE__*/ proxyCustomElement(class PostRating extends HTM
|
|
|
10
10
|
super();
|
|
11
11
|
this.__registerHost();
|
|
12
12
|
this.__attachShadow();
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
13
|
+
this.postInput = createEvent(this, "postInput", 7);
|
|
14
|
+
this.postChange = createEvent(this, "postChange", 7);
|
|
15
15
|
this.hasChanged = false;
|
|
16
16
|
this.hoveredIndex = undefined;
|
|
17
17
|
this.label = 'Rating';
|
|
@@ -26,7 +26,7 @@ const PostRating = /*@__PURE__*/ proxyCustomElement(class PostRating extends HTM
|
|
|
26
26
|
if (this.readonly || value < 0 || value > this.stars)
|
|
27
27
|
return;
|
|
28
28
|
this.currentRating = this.currentRating !== value ? value : 0; // If a star is clicked the second time, the rating gets set to 0.
|
|
29
|
-
this.
|
|
29
|
+
this.postInput.emit({ value: this.currentRating });
|
|
30
30
|
this.hasChanged = true;
|
|
31
31
|
}
|
|
32
32
|
keydownHandler(e) {
|
|
@@ -59,7 +59,7 @@ const PostRating = /*@__PURE__*/ proxyCustomElement(class PostRating extends HTM
|
|
|
59
59
|
}
|
|
60
60
|
blurHandler() {
|
|
61
61
|
if (this.hasChanged) {
|
|
62
|
-
this.
|
|
62
|
+
this.postChange.emit({ value: this.currentRating });
|
|
63
63
|
this.hasChanged = false;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -74,7 +74,7 @@ const PostRating = /*@__PURE__*/ proxyCustomElement(class PostRating extends HTM
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
render() {
|
|
77
|
-
return (h(Host, { key: '
|
|
77
|
+
return (h(Host, { key: '64081561d0b0819ed5fbe31c0bc7974b996ec582', "data-version": version }, h("div", { key: 'eaed95cef70f1dfa815a77e3d630ac933d2c1eff', role: "slider", class: "rating", tabindex: "0", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": this.stars, "aria-valuenow": this.currentRating, "aria-valuetext": `${this.currentRating} out of ${this.stars}`, "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.keydownHandler, onBlur: this.blurHandler }, Array.from({ length: this.stars }).map((v, i) => (h("div", { key: `star-${v}`, "aria-hidden": "true", class: {
|
|
78
78
|
'star': true,
|
|
79
79
|
'before-hover': i < this.hoveredIndex,
|
|
80
80
|
'active': i < Math.round(this.currentRating),
|