@swisspost/design-system-components 2.0.2 → 2.0.3
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/attribute-observer-10f08c04.js +27 -0
- package/dist/cjs/index.cjs.js +13 -12
- package/dist/cjs/{package-e8091039.js → package-628f6e9c.js} +1 -1
- package/dist/cjs/{post-accordion-eebf7827.js → post-accordion-da546aa2.js} +1 -1
- package/dist/cjs/{post-accordion-item-b2977ca5.js → post-accordion-item-33d5593a.js} +2 -2
- 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-af7728e6.js → post-alert-26c1bcda.js} +2 -2
- package/dist/cjs/post-alert.cjs.entry.js +2 -2
- package/dist/cjs/{post-collapsible-15f79667.js → post-collapsible-278b2a71.js} +1 -1
- package/dist/cjs/post-collapsible.cjs.entry.js +2 -2
- package/dist/cjs/{post-icon-b80d7e24.js → post-icon-fd09bc54.js} +1 -1
- package/dist/cjs/post-icon.cjs.entry.js +2 -2
- package/dist/cjs/post-popover-1e454296.js +104 -0
- package/dist/cjs/post-popover.cjs.entry.js +3 -2
- package/dist/cjs/{post-popovercontainer-130193cf.js → post-popovercontainer-5e355de3.js} +26 -13
- package/dist/cjs/post-popovercontainer.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-header-454cc178.js → post-tab-header-5c8b9a0d.js} +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-panel-fc0bfcbe.js → post-tab-panel-67ba226d.js} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-3f909e1c.js → post-tabs-71510ced.js} +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tooltip-e5b22230.js → post-tooltip-b6bbb3e4.js} +10 -27
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -2
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +1 -1
- package/dist/collection/components/post-alert/post-alert.css +5 -5
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +47 -63
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +25 -12
- package/dist/collection/components/post-tooltip/post-tooltip.js +9 -26
- package/dist/collection/utils/attribute-observer.js +23 -0
- package/dist/components/attribute-observer.js +25 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +1 -1
- package/dist/components/post-alert2.js +1 -1
- package/dist/components/post-popover2.js +51 -64
- package/dist/components/post-popovercontainer2.js +25 -12
- package/dist/components/post-tooltip2.js +9 -26
- package/dist/docs.json +3 -13
- package/dist/esm/attribute-observer-37fa950a.js +25 -0
- package/dist/esm/index.js +13 -12
- package/dist/esm/{package-aa903c40.js → package-15929f57.js} +1 -1
- package/dist/esm/{post-accordion-82b49f7b.js → post-accordion-be080240.js} +1 -1
- package/dist/esm/{post-accordion-item-3deff76a.js → post-accordion-item-7b3c726b.js} +2 -2
- package/dist/esm/post-accordion-item.entry.js +2 -2
- package/dist/esm/post-accordion.entry.js +2 -2
- package/dist/esm/{post-alert-c88451ba.js → post-alert-37f853eb.js} +2 -2
- package/dist/esm/post-alert.entry.js +2 -2
- package/dist/esm/{post-collapsible-87ce4e6e.js → post-collapsible-967bb191.js} +1 -1
- package/dist/esm/post-collapsible.entry.js +2 -2
- package/dist/esm/{post-icon-e0536000.js → post-icon-ba163099.js} +1 -1
- package/dist/esm/post-icon.entry.js +2 -2
- package/dist/esm/post-popover-69694fa6.js +102 -0
- package/dist/esm/post-popover.entry.js +3 -2
- package/dist/esm/{post-popovercontainer-6d1d7f76.js → post-popovercontainer-da870ff0.js} +26 -13
- package/dist/esm/post-popovercontainer.entry.js +2 -2
- package/dist/esm/{post-tab-header-0f7866f9.js → post-tab-header-14ed99cd.js} +1 -1
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/{post-tab-panel-b41d5d0f.js → post-tab-panel-d89c4c50.js} +1 -1
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-97868e9c.js → post-tabs-e995886a.js} +1 -1
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tooltip-531b569d.js → post-tooltip-0ec6a388.js} +10 -27
- package/dist/esm/post-tooltip.entry.js +3 -2
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-00ab91d9.entry.js +1 -0
- package/dist/post-components/p-04f47e54.entry.js +1 -0
- package/dist/post-components/{p-bf1293e1.js → p-1f284e66.js} +1 -1
- package/dist/post-components/{p-b111a381.js → p-209e33a5.js} +1 -1
- package/dist/post-components/p-282e21c2.entry.js +1 -0
- package/dist/post-components/p-34a772e3.entry.js +1 -0
- package/dist/post-components/p-46c47aa4.entry.js +1 -0
- package/dist/post-components/{p-dc9ffe1d.js → p-51fe19e0.js} +1 -1
- package/dist/post-components/p-557f0f10.entry.js +1 -0
- package/dist/post-components/p-5ecceba0.js +1 -0
- package/dist/post-components/{p-ba40e160.js → p-61d98756.js} +1 -1
- package/dist/post-components/p-6adeaa6c.js +1 -0
- package/dist/post-components/{p-284ca5da.js → p-6b3ba10a.js} +1 -1
- package/dist/post-components/p-82f4f464.entry.js +1 -0
- package/dist/post-components/p-94256868.js +15 -0
- package/dist/post-components/p-98cb0bbd.entry.js +1 -0
- package/dist/post-components/p-9ee95668.entry.js +1 -0
- package/dist/post-components/p-a0d342e4.entry.js +1 -0
- package/dist/post-components/{p-25766de1.js → p-a9d59b04.js} +1 -1
- package/dist/post-components/{p-202a23d3.js → p-ac7b779e.js} +1 -1
- package/dist/post-components/{p-d8ac8ae9.js → p-d9c9ed63.js} +1 -1
- package/dist/post-components/p-e1bf894f.entry.js +1 -0
- package/dist/post-components/p-e8d17225.js +1 -0
- package/dist/post-components/p-f47b0207.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-popover/post-popover.d.ts +3 -17
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -0
- package/dist/types/utils/attribute-observer.d.ts +1 -0
- package/package.json +3 -2
- package/dist/cjs/post-popover-392b0554.js +0 -117
- package/dist/esm/post-popover-00b006b4.js +0 -115
- package/dist/post-components/p-0ef425cd.entry.js +0 -1
- package/dist/post-components/p-23d55894.entry.js +0 -1
- package/dist/post-components/p-2b5a940c.entry.js +0 -1
- package/dist/post-components/p-31c06741.entry.js +0 -1
- package/dist/post-components/p-320a90d8.entry.js +0 -1
- package/dist/post-components/p-3b8a1f9d.entry.js +0 -1
- package/dist/post-components/p-61ad6181.entry.js +0 -1
- package/dist/post-components/p-71a57911.js +0 -1
- package/dist/post-components/p-be08f39f.entry.js +0 -1
- package/dist/post-components/p-c3dd84af.js +0 -1
- package/dist/post-components/p-c9ecada7.entry.js +0 -1
- package/dist/post-components/p-cdd7ad0a.js +0 -15
- package/dist/post-components/p-d7863a77.js +0 -1
- package/dist/post-components/p-fbf645c4.entry.js +0 -1
- package/dist/post-components/p-ff9016ce.entry.js +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const getAttributeObserver = (attribute, handler) => {
|
|
2
|
+
/**
|
|
3
|
+
* Handle attribute changes and childList changes from the observer
|
|
4
|
+
* @param {MutationRecord[]} mutationList
|
|
5
|
+
*/
|
|
6
|
+
const observerHandler = (mutationList) => {
|
|
7
|
+
mutationList.forEach(mutation => {
|
|
8
|
+
if (mutation.type === 'attributes' && mutation.attributeName === attribute) {
|
|
9
|
+
handler(mutation.target);
|
|
10
|
+
}
|
|
11
|
+
if (mutation.type === 'childList') {
|
|
12
|
+
mutation.addedNodes.forEach(node => {
|
|
13
|
+
if (node.nodeType === Node.ELEMENT_NODE &&
|
|
14
|
+
node.hasAttribute(attribute)) {
|
|
15
|
+
handler(node);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
// Initialize a mutation observer for patching accessibility features
|
|
22
|
+
return new MutationObserver(observerHandler);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { getAttributeObserver as g };
|
|
@@ -40,7 +40,7 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
40
40
|
render() {
|
|
41
41
|
var _a;
|
|
42
42
|
const HeadingTag = `h${(_a = this.headingLevel) !== null && _a !== void 0 ? _a : 2}`;
|
|
43
|
-
return (h(Host, { key: '795ccef5a57e07755df60f651712dff5eb3fcfaf', id: this.id, "data-version": version }, h("div", { key: '529feda41150180001d5535d0d79007e312b0d39', part: "accordion-item", class: "accordion-item" }, h(HeadingTag, { key: '4ddcc8f6ab703625ab072541b65ed0dcb7392129', class: "accordion-header", id: `${this.id}--header` }, h("button", { key: '09dcd22dc3382fe442018649b392ba95ed3918f9', "aria-controls": `${this.id}--collapse`, "aria-expanded": `${this.isOpen}`, class: `accordion-button${this.isOpen ? '' : ' collapsed'}`, onClick: () => this.toggle(), type: "button" }, h("slot", { key: '8e4026adc26445aa84cce3587bf4cc82b816641a', name: "header" }))), h("post-collapsible", { key: '
|
|
43
|
+
return (h(Host, { key: '795ccef5a57e07755df60f651712dff5eb3fcfaf', id: this.id, "data-version": version }, h("div", { key: '529feda41150180001d5535d0d79007e312b0d39', part: "accordion-item", class: "accordion-item" }, h(HeadingTag, { key: '4ddcc8f6ab703625ab072541b65ed0dcb7392129', class: "accordion-header", id: `${this.id}--header` }, h("button", { key: '09dcd22dc3382fe442018649b392ba95ed3918f9', "aria-controls": `${this.id}--collapse`, "aria-expanded": `${this.isOpen}`, class: `accordion-button${this.isOpen ? '' : ' collapsed'}`, onClick: () => this.toggle(), type: "button" }, h("slot", { key: '8e4026adc26445aa84cce3587bf4cc82b816641a', name: "header" }))), h("post-collapsible", { key: 'c7a4078dd9b2f38651370bfa215361bdc3aaaf5c', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, h("div", { key: '9841b925e1d9d1dc394762b51bd2da35a4ec02c6', class: "accordion-body" }, h("slot", { key: '6474e69b6e8d26b7d22c3ab86c0a472fddaffdb1' }))))));
|
|
44
44
|
}
|
|
45
45
|
get host() { return this; }
|
|
46
46
|
static get watchers() { return {
|
|
@@ -7,7 +7,7 @@ import { c as checkNonEmpty } from './check-non-empty.js';
|
|
|
7
7
|
|
|
8
8
|
const ALERT_TYPES = ['primary', 'success', 'danger', 'warning', 'info', 'gray'];
|
|
9
9
|
|
|
10
|
-
const postAlertCss = "/*!\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 */.alert-primary,.alert-success,.alert-danger,.alert-warning,.alert-info,.alert-gray,.alert-notification,.alert-error{background-color:rgb(var(--post-bg-rgb)) !important;color:var(--post-contrast-color) !important}.alert-success,.alert-warning,.alert-info,.alert-gray{--post-contrast-color:#000;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-primary:hsl(0, 0%, 20%);--post-white:#fff;--post-black:#000;--post-info:#cce4ee;--post-success:#2c911c;--post-warning:#f49e00;--post-danger:#a51728;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-success-green:#2c871d;--post-error-red:#a51728;--post-warning-orange:#f49e00;--post-success-background:#c0debb;--post-error-background:#ffdade;--post-warning-background:#fce2b2;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-yellow-rgb:255, 204, 0;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-primary-rgb:51, 51, 51;--post-white-rgb:255, 255, 255;--post-black-rgb:0, 0, 0;--post-info-rgb:204, 228, 238;--post-success-rgb:44, 145, 28;--post-warning-rgb:244, 158, 0;--post-danger-rgb:165, 23, 40;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160;--post-success-green-rgb:44, 135, 29;--post-error-red-rgb:165, 23, 40;--post-warning-orange-rgb:244, 158, 0;--post-success-background-rgb:192, 222, 187;--post-error-background-rgb:255, 218, 222;--post-warning-background-rgb:252, 226, 178}.alert-primary,.alert-danger,.alert-notification,.alert-error{--post-contrast-color:#fff;--post-contrast-color-inverted:#000;--post-dark:#faf9f8;--post-light:hsl(0, 0%, 20%);--post-gray-80:hsl(0, 0%, 90%);--post-gray-60:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-20:hsl(0, 0%, 40%);--post-gray-10:hsl(0, 0%, 20%);--post-contrast-color-rgb:255, 255, 255;--post-contrast-color-inverted-rgb:0, 0, 0;--post-dark-rgb:250, 249, 248;--post-light-rgb:51, 51, 51;--post-gray-80-rgb:230, 230, 230;--post-gray-60-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-20-rgb:102, 102, 102;--post-gray-10-rgb:51, 51, 51}.alert{position:relative;box-sizing:border-box;min-height:5rem;box-shadow:0 2px 4px 0 rgba(0,0,0,.2);border-radius:4px;padding:1rem 1.25rem;padding-inline-start:5.5rem;margin-block-end:1rem;font-size:1rem;font-weight:300}.alert.no-icon{min-height:3.5rem;padding-inline-start:1.25rem}.alert[class^=pi-],.alert[class*=\" pi-\"]{background-size:3rem;background-position:1.25rem 1rem;background-repeat:no-repeat}.alert[class^=pi-].no-icon,.alert[class*=\" pi-\"].no-icon{background-image:none}.alert::before{content:\"\";display:block}.alert::before,.alert>post-icon{position:absolute;height:3rem;width:3rem;left:1.25rem;top:1rem}.alert.no-icon::before,.alert[class^=pi-]::before,.alert[class*=\" pi-\"]::before{content:unset}.alert.no-icon>post-icon,.alert[class^=pi-]>post-icon,.alert[class*=\" pi-\"]>post-icon{display:none}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.alert{filter:none !important;border:2px solid CanvasText}}.alert:not(.alert-action){display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert:not(.alert-action) a{font-weight:400}.alert:not(.alert-action) hr{margin-block:.5rem .75rem !important}.alert:not(.alert-action)>:only-child,.alert:not(.alert-action)>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert:not(.alert-action)>*{margin:0}.alert-heading{font-size:1.0625rem;font-weight:700}.alert-dismissible{pointer-events:auto;position:relative;padding-inline-end:4rem}.alert-dismissible>.btn-close{position:absolute;inset-block-start:1rem;inset-inline-end:1.25rem}.alert-dismissible>.btn-close:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action{display:flex;flex-direction:row;align-items:center;gap:1.25rem}.alert-action>.alert-content{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert-action>.alert-content a{font-weight:400}.alert-action>.alert-content hr{margin-block:.5rem .75rem !important}.alert-action>.alert-content>:only-child,.alert-action>.alert-content>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action>.alert-content>*{margin:0}.alert-action>.alert-buttons{flex:0 0 auto;display:flex;align-items:center;gap:.5rem}@media (min-width: 780px){.alert-action.alert-dismissible>.btn-close{inset-block-start:calc(50% - 0.75rem)}}@media (max-width: 779.98px){.alert-action{flex-direction:column;align-items:stretch;padding-inline:1.25rem}.alert-action>.alert-content{padding-inline-start:4.25rem;padding-inline-end:2.75rem}.alert-action>.alert-buttons{display:flex}.alert-action>.alert-buttons>.btn{flex:1 0 0;width:100%}.alert-action>.alert-buttons>.btn:first-child{margin-inline-start:0}}.alert-fixed-bottom{position:fixed;inset-block-end:0;inset-inline-start:0;inset-inline-end:0;margin-bottom:0;border-radius:0;z-index:1030}@media (min-width: 1441px){.alert-fixed-bottom{padding-inline-end:calc((100% - 1440px) / 2 + 120px + 1.25rem);padding-inline-start:calc(\n (100% - 1440px) / 2 + 120px + 1.25rem + 3rem + 1.25rem\n );background-position-x:calc((100% - 1440px) / 2 + 120px + 1.25rem + 1.5rem)}.alert-fixed-bottom::before{left:calc((100% - 1440px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.no-icon{padding-inline-start:calc((100% - 1440px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.alert-dismissible{padding-inline-end:calc(\n (100% - 1440px) / 2 + 120px + 1.25rem + 1.25rem + 1.5rem\n )}.alert-fixed-bottom.alert-dismissible>.btn-close{inset-inline-end:calc((100% - 1440px) / 2 + 120px + 1.25rem)}}.alert-primary{--post-bg-rgb:51, 51, 51}.alert-primary:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-primary:has(>post-icon)::before{content:none}.alert-primary>post-icon{background-color:#333}.alert-success{--post-bg-rgb:44, 145, 28}.alert-success:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-success:has(>post-icon)::before{content:none}.alert-success>post-icon{background-color:#2c911c}.alert-danger{--post-bg-rgb:165, 23, 40}.alert-danger:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-danger:has(>post-icon)::before{content:none}.alert-danger>post-icon{background-color:#a51728}.alert-warning{--post-bg-rgb:244, 158, 0}.alert-warning:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-warning:has(>post-icon)::before{content:none}.alert-warning>post-icon{background-color:#f49e00}.alert-info{--post-bg-rgb:204, 228, 238}.alert-info:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-info:has(>post-icon)::before{content:none}.alert-info>post-icon{background-color:#cce4ee}.alert-gray{--post-bg-rgb:244, 243, 241}.alert-gray:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-gray:has(>post-icon)::before{content:none}.alert-gray>post-icon{background-color:#f4f3f1}.alert-notification{--post-bg-rgb:51, 51, 51}.alert-notification:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-notification:has(>post-icon)::before{content:none}.alert-notification>post-icon{background-color:#333}.alert-error{--post-bg-rgb:165, 23, 40}.alert-error:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-error:has(>post-icon)::before{content:none}.alert-error>post-icon{background-color:#a51728}.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.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%3Cg id='icon'%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/g%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%3Cg id='icon'%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/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:1.5rem;width:1.5rem}.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-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}/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}:host ::slotted(*){margin:0 !important}.visually-hidden{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption){position:absolute !important}.alert-heading>::slotted(h1){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h2){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h3){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h4){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h5){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h6){font-size:inherit !important;font-weight:inherit !important}";
|
|
10
|
+
const postAlertCss = "/*!\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 */.alert-primary,.alert-success,.alert-danger,.alert-warning,.alert-info,.alert-gray,.alert-notification,.alert-error{background-color:rgb(var(--post-bg-rgb)) !important;color:var(--post-contrast-color) !important}.alert-warning,.alert-info,.alert-gray{--post-contrast-color:#000;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-primary:hsl(0, 0%, 20%);--post-white:#fff;--post-black:#000;--post-info:#cce4ee;--post-success:#2c911c;--post-warning:#f49e00;--post-danger:#a51728;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-success-green:#2c871d;--post-error-red:#a51728;--post-warning-orange:#f49e00;--post-success-background:#c0debb;--post-error-background:#ffdade;--post-warning-background:#fce2b2;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-yellow-rgb:255, 204, 0;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-primary-rgb:51, 51, 51;--post-white-rgb:255, 255, 255;--post-black-rgb:0, 0, 0;--post-info-rgb:204, 228, 238;--post-success-rgb:44, 145, 28;--post-warning-rgb:244, 158, 0;--post-danger-rgb:165, 23, 40;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160;--post-success-green-rgb:44, 135, 29;--post-error-red-rgb:165, 23, 40;--post-warning-orange-rgb:244, 158, 0;--post-success-background-rgb:192, 222, 187;--post-error-background-rgb:255, 218, 222;--post-warning-background-rgb:252, 226, 178}.alert-primary,.alert-success,.alert-danger,.alert-notification,.alert-error{--post-contrast-color:#fff;--post-contrast-color-inverted:#000;--post-dark:#faf9f8;--post-light:hsl(0, 0%, 20%);--post-gray-80:hsl(0, 0%, 90%);--post-gray-60:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-20:hsl(0, 0%, 40%);--post-gray-10:hsl(0, 0%, 20%);--post-contrast-color-rgb:255, 255, 255;--post-contrast-color-inverted-rgb:0, 0, 0;--post-dark-rgb:250, 249, 248;--post-light-rgb:51, 51, 51;--post-gray-80-rgb:230, 230, 230;--post-gray-60-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-20-rgb:102, 102, 102;--post-gray-10-rgb:51, 51, 51}.alert{position:relative;box-sizing:border-box;min-height:5rem;box-shadow:0 2px 4px 0 rgba(0,0,0,.2);border-radius:4px;padding:1rem 1.25rem;padding-inline-start:5.5rem;margin-block-end:1rem;font-size:1rem;font-weight:300}.alert.no-icon{min-height:3.5rem;padding-inline-start:1.25rem}.alert[class^=pi-],.alert[class*=\" pi-\"]{background-size:3rem;background-position:1.25rem 1rem;background-repeat:no-repeat}.alert[class^=pi-].no-icon,.alert[class*=\" pi-\"].no-icon{background-image:none}.alert::before{content:\"\";display:block}.alert::before,.alert>post-icon{position:absolute;height:3rem;width:3rem;left:1.25rem;top:1rem}.alert.no-icon::before,.alert[class^=pi-]::before,.alert[class*=\" pi-\"]::before{content:unset}.alert.no-icon>post-icon,.alert[class^=pi-]>post-icon,.alert[class*=\" pi-\"]>post-icon{display:none}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.alert{filter:none !important;border:2px solid CanvasText}}.alert:not(.alert-action){display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert:not(.alert-action) a{font-weight:400}.alert:not(.alert-action) hr{margin-block:.5rem .75rem !important}.alert:not(.alert-action)>:only-child,.alert:not(.alert-action)>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert:not(.alert-action)>*{margin:0}.alert-heading{font-size:1.0625rem;font-weight:700}.alert-dismissible{pointer-events:auto;position:relative;padding-inline-end:4rem}.alert-dismissible>.btn-close{position:absolute;inset-block-start:1rem;inset-inline-end:1.25rem}.alert-dismissible>.btn-close:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action{display:flex;flex-direction:row;align-items:center;gap:1.25rem}.alert-action>.alert-content{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert-action>.alert-content a{font-weight:400}.alert-action>.alert-content hr{margin-block:.5rem .75rem !important}.alert-action>.alert-content>:only-child,.alert-action>.alert-content>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action>.alert-content>*{margin:0}.alert-action>.alert-buttons{flex:0 0 auto;display:flex;align-items:center;gap:.5rem}@media (min-width: 780px){.alert-action.alert-dismissible>.btn-close{inset-block-start:calc(50% - 0.75rem)}}@media (max-width: 779.98px){.alert-action{flex-direction:column;align-items:stretch;padding-inline:1.25rem}.alert-action>.alert-content{padding-inline-start:4.25rem;padding-inline-end:2.75rem}.alert-action>.alert-buttons{display:flex}.alert-action>.alert-buttons>.btn{flex:1 0 0;width:100%}.alert-action>.alert-buttons>.btn:first-child{margin-inline-start:0}}.alert-fixed-bottom{position:fixed;inset-block-end:0;inset-inline-start:0;inset-inline-end:0;margin-bottom:0;border-radius:0;z-index:1030}@media (min-width: 1440px){.alert-fixed-bottom{padding-inline-end:calc((100% - 1439px) / 2 + 120px + 1.25rem);padding-inline-start:calc(\n (100% - 1439px) / 2 + 120px + 1.25rem + 3rem + 1.25rem\n );background-position-x:calc((100% - 1439px) / 2 + 120px + 1.25rem + 1.5rem)}.alert-fixed-bottom::before{left:calc((100% - 1439px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.no-icon{padding-inline-start:calc((100% - 1439px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.alert-dismissible{padding-inline-end:calc(\n (100% - 1439px) / 2 + 120px + 1.25rem + 1.25rem + 1.5rem\n )}.alert-fixed-bottom.alert-dismissible>.btn-close{inset-inline-end:calc((100% - 1439px) / 2 + 120px + 1.25rem)}}.alert-primary{--post-bg-rgb:51, 51, 51}.alert-primary:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-primary:has(>post-icon)::before{content:none}.alert-primary>post-icon{background-color:#333}.alert-success{--post-bg-rgb:44, 135, 29}.alert-success:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-success:has(>post-icon)::before{content:none}.alert-success>post-icon{background-color:#2c871d}.alert-danger{--post-bg-rgb:165, 23, 40}.alert-danger:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-danger:has(>post-icon)::before{content:none}.alert-danger>post-icon{background-color:#a51728}.alert-warning{--post-bg-rgb:244, 158, 0}.alert-warning:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-warning:has(>post-icon)::before{content:none}.alert-warning>post-icon{background-color:#f49e00}.alert-info{--post-bg-rgb:204, 228, 238}.alert-info:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-info:has(>post-icon)::before{content:none}.alert-info>post-icon{background-color:#cce4ee}.alert-gray{--post-bg-rgb:244, 243, 241}.alert-gray:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-gray:has(>post-icon)::before{content:none}.alert-gray>post-icon{background-color:#f4f3f1}.alert-notification{--post-bg-rgb:51, 51, 51}.alert-notification:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-notification:has(>post-icon)::before{content:none}.alert-notification>post-icon{background-color:#333}.alert-error{--post-bg-rgb:165, 23, 40}.alert-error:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%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%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-error:has(>post-icon)::before{content:none}.alert-error>post-icon{background-color:#a51728}.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.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%3Cg id='icon'%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/g%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%3Cg id='icon'%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/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:1.5rem;width:1.5rem}.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}/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}:host ::slotted(*){margin:0 !important}.visually-hidden{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption){position:absolute !important}.alert-heading>::slotted(h1){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h2){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h3){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h4){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h5){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h6){font-size:inherit !important;font-weight:inherit !important}";
|
|
11
11
|
const PostAlertStyle0 = postAlertCss;
|
|
12
12
|
|
|
13
13
|
const PostAlert = /*@__PURE__*/ proxyCustomElement(class PostAlert extends HTMLElement {
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
|
+
import { g as getAttributeObserver } from './attribute-observer.js';
|
|
3
4
|
import { d as defineCustomElement$1 } from './post-popovercontainer2.js';
|
|
4
5
|
|
|
5
|
-
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;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.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%3Cg id='icon'%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/g%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%3Cg id='icon'%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/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:1.5rem;width:1.5rem}.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-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;max-width:min(66vw,60rem)}@media (max-width: 599.98px){.popover-container{max-width:100%}}.popover-content{padding:.5em}";
|
|
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;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.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%3Cg id='icon'%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/g%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%3Cg id='icon'%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/g%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:1.5rem;width:1.5rem}.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;max-width:min(66vw,60rem)}@media (max-width: 599.98px){.popover-container{max-width:100%}}.popover-content{padding:.5em}";
|
|
6
7
|
const PostPopoverStyle0 = postPopoverCss;
|
|
7
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @slot default - Slot for placing content inside the popover.
|
|
11
|
+
*/
|
|
12
|
+
let popoverInstances = 0;
|
|
13
|
+
const popoverTargetAttribute = 'data-popover-target';
|
|
14
|
+
const globalToggleHandler = (e) => {
|
|
15
|
+
const target = e.target;
|
|
16
|
+
if (!target || !('getAttribute' in target))
|
|
17
|
+
return;
|
|
18
|
+
const popoverTarget = target.getAttribute(popoverTargetAttribute);
|
|
19
|
+
if (!popoverTarget || ('key' in e && e.key !== 'Enter'))
|
|
20
|
+
return;
|
|
21
|
+
const popover = document.getElementById(popoverTarget);
|
|
22
|
+
popover === null || popover === void 0 ? void 0 : popover.toggle(target);
|
|
23
|
+
};
|
|
24
|
+
// Initialize a mutation observer for patching accessibility features
|
|
25
|
+
const triggerObserver = getAttributeObserver(popoverTargetAttribute, trigger => {
|
|
26
|
+
const force = trigger.hasAttribute(popoverTargetAttribute);
|
|
27
|
+
trigger.setAttribute('aria-expanded', force ? 'false' : null);
|
|
28
|
+
});
|
|
8
29
|
const PostPopover = /*@__PURE__*/ proxyCustomElement(class PostPopover extends HTMLElement {
|
|
9
30
|
constructor() {
|
|
10
31
|
super();
|
|
@@ -13,47 +34,41 @@ const PostPopover = /*@__PURE__*/ proxyCustomElement(class PostPopover extends H
|
|
|
13
34
|
this.placement = 'top';
|
|
14
35
|
this.closeButtonCaption = undefined;
|
|
15
36
|
this.arrow = true;
|
|
16
|
-
this.
|
|
17
|
-
this.localEnterTogglePopover = e => {
|
|
18
|
-
if (e.key === 'Enter')
|
|
19
|
-
this.toggle(e.target);
|
|
20
|
-
};
|
|
21
|
-
this.localTouchTogglePopover = e => {
|
|
22
|
-
e.preventDefault();
|
|
23
|
-
this.toggle(e.target);
|
|
24
|
-
};
|
|
37
|
+
this.localBeforeToggleHandler = this.beforeToggleHandler.bind(this);
|
|
25
38
|
}
|
|
26
39
|
connectedCallback() {
|
|
27
|
-
|
|
28
|
-
|
|
40
|
+
// Set up accessibility patcher and event listeners for the first component
|
|
41
|
+
if (popoverInstances === 0) {
|
|
42
|
+
window.addEventListener('pointerup', globalToggleHandler);
|
|
43
|
+
window.addEventListener('keydown', globalToggleHandler);
|
|
44
|
+
triggerObserver.observe(document.body, {
|
|
45
|
+
subtree: true,
|
|
46
|
+
childList: true,
|
|
47
|
+
attributeFilter: [popoverTargetAttribute],
|
|
48
|
+
});
|
|
29
49
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.triggers.forEach(trigger => {
|
|
36
|
-
// See this.onToggle for one time mouse event listener
|
|
37
|
-
trigger.addEventListener('mouseup', this.localTogglePopover, { once: true });
|
|
38
|
-
trigger.addEventListener('keypress', this.localEnterTogglePopover);
|
|
39
|
-
trigger.addEventListener('touch', this.localTouchTogglePopover, { once: true });
|
|
40
|
-
trigger.setAttribute('aria-expanded', 'false');
|
|
41
|
-
});
|
|
50
|
+
popoverInstances++;
|
|
51
|
+
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
52
|
+
}
|
|
53
|
+
componentDidLoad() {
|
|
54
|
+
this.popoverRef.addEventListener('beforetoggle', this.localBeforeToggleHandler);
|
|
42
55
|
}
|
|
43
56
|
disconnectedCallback() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
popoverInstances--;
|
|
58
|
+
// Remove listeners and observer after the last popover has been destructed
|
|
59
|
+
if (popoverInstances === 0) {
|
|
60
|
+
window.removeEventListener('click', globalToggleHandler);
|
|
61
|
+
window.removeEventListener('keydown', globalToggleHandler);
|
|
62
|
+
triggerObserver.disconnect();
|
|
63
|
+
}
|
|
64
|
+
this.popoverRef.removeEventListener('beforetoggle', this.localBeforeToggleHandler);
|
|
65
|
+
this.triggers.forEach(trigger => trigger.removeAttribute('aria-expanded'));
|
|
50
66
|
}
|
|
51
67
|
/**
|
|
52
68
|
* Programmatically display the popover
|
|
53
69
|
* @param target An element with [data-popover-target="id"] where the popover should be shown
|
|
54
70
|
*/
|
|
55
71
|
async show(target) {
|
|
56
|
-
this.currentTarget = target;
|
|
57
72
|
this.popoverRef.show(target);
|
|
58
73
|
target.setAttribute('aria-expanded', 'true');
|
|
59
74
|
}
|
|
@@ -70,46 +85,18 @@ const PostPopover = /*@__PURE__*/ proxyCustomElement(class PostPopover extends H
|
|
|
70
85
|
* @param force Pass true to always show or false to always hide
|
|
71
86
|
*/
|
|
72
87
|
async toggle(target, force) {
|
|
73
|
-
this.currentTarget = target;
|
|
74
88
|
const newState = await this.popoverRef.toggle(target, force);
|
|
89
|
+
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
75
90
|
target.setAttribute('aria-expanded', `${newState}`);
|
|
76
91
|
}
|
|
77
92
|
get triggers() {
|
|
78
|
-
return document.querySelectorAll(`[
|
|
93
|
+
return document.querySelectorAll(`[${popoverTargetAttribute}="${this.host.id}"]`);
|
|
79
94
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
* A permanent event listener would prevent a toggle button from working properly:
|
|
83
|
-
* A click opens the popover, a second click first closes it (due to light dismiss), then directly
|
|
84
|
-
* opens it again because of the click listener on the button. Registering a new
|
|
85
|
-
* one time listener after a small timeout solves this issue.
|
|
86
|
-
* @param e toggle event from post-popovercontainer
|
|
87
|
-
*/
|
|
88
|
-
onToggle(e) {
|
|
89
|
-
if (this.currentTarget) {
|
|
90
|
-
this.currentTarget.setAttribute('aria-expanded', `${e.detail}`);
|
|
91
|
-
}
|
|
92
|
-
if (!e.detail) {
|
|
93
|
-
window.requestAnimationFrame(() => {
|
|
94
|
-
this.triggers.forEach(trigger => {
|
|
95
|
-
trigger.addEventListener('mouseup', this.localTogglePopover, { once: true });
|
|
96
|
-
trigger.addEventListener('touch', this.localTouchTogglePopover, { once: true });
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
// Handle missing re-focusing logic after close. Can be removed as soon as popovertarget works correctly
|
|
100
|
-
if (this.currentTarget) {
|
|
101
|
-
this.currentTarget.focus();
|
|
102
|
-
this.currentTarget = null;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// Fix for firefox to prevent the following lines from triggering
|
|
107
|
-
// https://github.com/oddbird/popover-polyfill/blob/main/src/popover.ts#L338
|
|
108
|
-
stopImmediatePropagation(e) {
|
|
109
|
-
e.stopImmediatePropagation();
|
|
95
|
+
beforeToggleHandler() {
|
|
96
|
+
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
110
97
|
}
|
|
111
98
|
render() {
|
|
112
|
-
return (h(Host, { key: '
|
|
99
|
+
return (h(Host, { key: '90cd97eedfdecb6666c5825cd09bb323cf857cbb', "data-version": version }, h("post-popovercontainer", { key: 'fe555322454124f4b9a618c634f2ae504ec89c07', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: 'd6e30229dd8d38c95e165d1fc55b1c7af5c7b5e2', class: "popover-container" }, h("div", { key: 'c43c1347bb6bfe3532387693b1761b53533584ec', class: "popover-content" }, h("slot", { key: '24a4aa1df86497a4fe4b72adaac76f6e69db9d9e' })), h("button", { key: '3a5e52f480ddd1ef41d068e476d2a8c5f7d77c4a', class: "btn-close", onClick: () => this.hide() }, h("span", { key: '493310100d3f76dfe5bf6cf1d64250b7551be43c', class: "visually-hidden" }, this.closeButtonCaption))))));
|
|
113
100
|
}
|
|
114
101
|
get host() { return this; }
|
|
115
102
|
static get style() { return PostPopoverStyle0; }
|
|
@@ -1832,7 +1832,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
`,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
1834
|
|
|
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:
|
|
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:.7071067812rem;height:.7071067812rem;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
1836
|
const PostPopovercontainerStyle0 = postPopovercontainerCss;
|
|
1837
1837
|
|
|
1838
1838
|
const SIDE_MAP = {
|
|
@@ -1865,16 +1865,20 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1865
1865
|
* @param target An element with [data-tooltip-target="id"] where the tooltip should be shown
|
|
1866
1866
|
*/
|
|
1867
1867
|
async show(target) {
|
|
1868
|
-
this.
|
|
1869
|
-
|
|
1870
|
-
|
|
1868
|
+
if (!this.toggleTimeoutId) {
|
|
1869
|
+
this.eventTarget = target;
|
|
1870
|
+
this.calculatePosition();
|
|
1871
|
+
this.popoverRef.showPopover();
|
|
1872
|
+
}
|
|
1871
1873
|
}
|
|
1872
1874
|
/**
|
|
1873
1875
|
* Programmatically hide this tooltip
|
|
1874
1876
|
*/
|
|
1875
1877
|
async hide() {
|
|
1876
|
-
this.
|
|
1877
|
-
|
|
1878
|
+
if (!this.toggleTimeoutId) {
|
|
1879
|
+
this.eventTarget = null;
|
|
1880
|
+
this.popoverRef.hidePopover();
|
|
1881
|
+
}
|
|
1878
1882
|
}
|
|
1879
1883
|
/**
|
|
1880
1884
|
* Toggle tooltip display
|
|
@@ -1882,9 +1886,13 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1882
1886
|
* @param force Pass true to always show or false to always hide
|
|
1883
1887
|
*/
|
|
1884
1888
|
async toggle(target, force) {
|
|
1885
|
-
|
|
1886
|
-
this.
|
|
1887
|
-
|
|
1889
|
+
// Prevent instant double toggle
|
|
1890
|
+
if (!this.toggleTimeoutId) {
|
|
1891
|
+
this.eventTarget = target;
|
|
1892
|
+
this.calculatePosition();
|
|
1893
|
+
this.popoverRef.togglePopover(force);
|
|
1894
|
+
this.toggleTimeoutId = null;
|
|
1895
|
+
}
|
|
1888
1896
|
return this.popoverRef.matches(':popover-open');
|
|
1889
1897
|
}
|
|
1890
1898
|
/**
|
|
@@ -1894,6 +1902,7 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1894
1902
|
* @param e ToggleEvent
|
|
1895
1903
|
*/
|
|
1896
1904
|
handleToggle(e) {
|
|
1905
|
+
this.toggleTimeoutId = window.setTimeout(() => (this.toggleTimeoutId = null), 10);
|
|
1897
1906
|
const isOpen = e.newState === 'open';
|
|
1898
1907
|
if (isOpen) {
|
|
1899
1908
|
this.startAutoupdates();
|
|
@@ -1949,17 +1958,21 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
1949
1958
|
const side = currentPlacement.split('-')[0];
|
|
1950
1959
|
const { x: arrowX, y: arrowY } = middlewareData.arrow;
|
|
1951
1960
|
const staticSide = SIDE_MAP[side];
|
|
1961
|
+
const offsetBorderLineJoin = 2;
|
|
1952
1962
|
Object.assign(this.arrowRef.style, {
|
|
1953
1963
|
top: arrowY ? `${arrowY}px` : '',
|
|
1954
1964
|
left: arrowX ? `${arrowX}px` : '',
|
|
1955
|
-
[staticSide]: `${-this.arrowRef.offsetWidth / 2}px`,
|
|
1965
|
+
[staticSide]: `${-this.arrowRef.offsetWidth / 2 - offsetBorderLineJoin}px`,
|
|
1956
1966
|
});
|
|
1967
|
+
// Add position as a class to be able to style arrow for HCM
|
|
1968
|
+
this.arrowRef.classList.remove(...Object.values(SIDE_MAP));
|
|
1969
|
+
this.arrowRef.classList.add(staticSide);
|
|
1957
1970
|
}
|
|
1958
1971
|
}
|
|
1959
1972
|
render() {
|
|
1960
|
-
return (h(Host, { key: '
|
|
1973
|
+
return (h(Host, { key: '8049387a5ba6eefb3165e84c098ba4ae5b8f443f', "data-version": version }, h("div", { key: '63d3095a7992baf46fbc74b5c595654cbdeaba66', class: "popover", part: "popover", ref: (el) => (this.popoverRef = el) }, this.arrow && (h("span", { class: "arrow", ref: el => {
|
|
1961
1974
|
this.arrowRef = el;
|
|
1962
|
-
} })), h("slot", { key: '
|
|
1975
|
+
} })), h("slot", { key: '74b1746bf48f8aa915c443721c1c2af1c1a3df5d' }))));
|
|
1963
1976
|
}
|
|
1964
1977
|
get host() { return this; }
|
|
1965
1978
|
static get style() { return PostPopovercontainerStyle0; }
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement as HTMLElement$1, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version$1 } from './package.js';
|
|
3
|
+
import { g as getAttributeObserver } from './attribute-observer.js';
|
|
3
4
|
import { d as defineCustomElement$1 } from './post-popovercontainer2.js';
|
|
4
5
|
|
|
5
6
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -4781,6 +4782,7 @@ const PostTooltipStyle0 = postTooltipCss;
|
|
|
4781
4782
|
*/
|
|
4782
4783
|
let tooltipInstances = 0;
|
|
4783
4784
|
let hideTooltipTimeout = null;
|
|
4785
|
+
const tooltipTargetAttribute = 'data-tooltip-target';
|
|
4784
4786
|
/**
|
|
4785
4787
|
* Global event listener to show tooltips. This is globalized so that triggers that are rendered
|
|
4786
4788
|
* async will still work without the need to set listeners on the element itself
|
|
@@ -4789,9 +4791,9 @@ let hideTooltipTimeout = null;
|
|
|
4789
4791
|
*/
|
|
4790
4792
|
const globalInterestHandler = (e) => {
|
|
4791
4793
|
const target = e.target;
|
|
4792
|
-
if (!
|
|
4794
|
+
if (!target || !('getAttribute' in target))
|
|
4793
4795
|
return;
|
|
4794
|
-
const tooltipTarget = target.getAttribute(
|
|
4796
|
+
const tooltipTarget = target.getAttribute(tooltipTargetAttribute);
|
|
4795
4797
|
if (!tooltipTarget || tooltipTarget === '')
|
|
4796
4798
|
return;
|
|
4797
4799
|
const tooltip = document.getElementById(tooltipTarget);
|
|
@@ -4809,7 +4811,7 @@ const globalInterestHandler = (e) => {
|
|
|
4809
4811
|
*/
|
|
4810
4812
|
const globalInterestLostHandler = (e) => {
|
|
4811
4813
|
const target = e.target;
|
|
4812
|
-
const tooltipTarget = target.getAttribute(
|
|
4814
|
+
const tooltipTarget = target.getAttribute(tooltipTargetAttribute);
|
|
4813
4815
|
if (!tooltipTarget || tooltipTarget === '')
|
|
4814
4816
|
return;
|
|
4815
4817
|
const tooltip = document.getElementById(tooltipTarget);
|
|
@@ -4832,7 +4834,7 @@ const globalHideTooltip = (tooltip) => {
|
|
|
4832
4834
|
*/
|
|
4833
4835
|
const patchAccessibilityFeatures = (trigger) => {
|
|
4834
4836
|
const describedBy = trigger.getAttribute('aria-describedby');
|
|
4835
|
-
const id = trigger.getAttribute(
|
|
4837
|
+
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
4836
4838
|
// Add tooltip to aria-describedby
|
|
4837
4839
|
if (!(describedBy === null || describedBy === void 0 ? void 0 : describedBy.includes(id))) {
|
|
4838
4840
|
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
@@ -4843,27 +4845,8 @@ const patchAccessibilityFeatures = (trigger) => {
|
|
|
4843
4845
|
trigger.setAttribute('tabindex', '0');
|
|
4844
4846
|
}
|
|
4845
4847
|
};
|
|
4846
|
-
/**
|
|
4847
|
-
* Handle attribute changes and childList changes from the observer
|
|
4848
|
-
* @param {MutationRecord[]} mutationList
|
|
4849
|
-
*/
|
|
4850
|
-
const triggerObserverHandler = mutationList => {
|
|
4851
|
-
mutationList.forEach(mutation => {
|
|
4852
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'data-tooltip-target') {
|
|
4853
|
-
patchAccessibilityFeatures(mutation.target);
|
|
4854
|
-
}
|
|
4855
|
-
if (mutation.type === 'childList') {
|
|
4856
|
-
mutation.addedNodes.forEach(node => {
|
|
4857
|
-
if (node.nodeType === Node.ELEMENT_NODE &&
|
|
4858
|
-
node.hasAttribute('data-tooltip-target')) {
|
|
4859
|
-
patchAccessibilityFeatures(node);
|
|
4860
|
-
}
|
|
4861
|
-
});
|
|
4862
|
-
}
|
|
4863
|
-
});
|
|
4864
|
-
};
|
|
4865
4848
|
// Initialize a mutation observer for patching accessibility features
|
|
4866
|
-
const triggerObserver =
|
|
4849
|
+
const triggerObserver = getAttributeObserver(tooltipTargetAttribute, patchAccessibilityFeatures);
|
|
4867
4850
|
const PostTooltip = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends HTMLElement$1 {
|
|
4868
4851
|
constructor() {
|
|
4869
4852
|
super();
|
|
@@ -4897,7 +4880,7 @@ const PostTooltip = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends H
|
|
|
4897
4880
|
triggerObserver.observe(document.body, {
|
|
4898
4881
|
subtree: true,
|
|
4899
4882
|
childList: true,
|
|
4900
|
-
attributeFilter: [
|
|
4883
|
+
attributeFilter: [tooltipTargetAttribute],
|
|
4901
4884
|
});
|
|
4902
4885
|
}
|
|
4903
4886
|
tooltipInstances++;
|
|
@@ -4956,7 +4939,7 @@ const PostTooltip = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends H
|
|
|
4956
4939
|
}
|
|
4957
4940
|
render() {
|
|
4958
4941
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
4959
|
-
return (h(Host, { key: '
|
|
4942
|
+
return (h(Host, { key: 'cf89d38b05fbb49ecfcfd339baf325a4fb850f3a', "data-version": version$1, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '2f6f473007ae8d4fc7ef3bcec38a8f19222eaf5d', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '84bfd25818068ce1fb644b3b0e6858f9cb1bd605' }))));
|
|
4960
4943
|
}
|
|
4961
4944
|
get host() { return this; }
|
|
4962
4945
|
static get style() { return PostTooltipStyle0; }
|
package/dist/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2024-02-
|
|
2
|
+
"timestamp": "2024-02-29T16:11:29",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.12.0",
|
|
@@ -853,12 +853,7 @@
|
|
|
853
853
|
"tag": "post-popover",
|
|
854
854
|
"readme": "# post-popup\n\n\n",
|
|
855
855
|
"docs": "",
|
|
856
|
-
"docsTags": [
|
|
857
|
-
{
|
|
858
|
-
"name": "slot",
|
|
859
|
-
"text": "default - Slot for placing content inside the popover."
|
|
860
|
-
}
|
|
861
|
-
],
|
|
856
|
+
"docsTags": [],
|
|
862
857
|
"usage": {},
|
|
863
858
|
"props": [
|
|
864
859
|
{
|
|
@@ -1105,12 +1100,7 @@
|
|
|
1105
1100
|
"events": [],
|
|
1106
1101
|
"listeners": [],
|
|
1107
1102
|
"styles": [],
|
|
1108
|
-
"slots": [
|
|
1109
|
-
{
|
|
1110
|
-
"name": "default",
|
|
1111
|
-
"docs": "Slot for placing content inside the popover."
|
|
1112
|
-
}
|
|
1113
|
-
],
|
|
1103
|
+
"slots": [],
|
|
1114
1104
|
"parts": [],
|
|
1115
1105
|
"dependents": [],
|
|
1116
1106
|
"dependencies": [
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const getAttributeObserver = (attribute, handler) => {
|
|
2
|
+
/**
|
|
3
|
+
* Handle attribute changes and childList changes from the observer
|
|
4
|
+
* @param {MutationRecord[]} mutationList
|
|
5
|
+
*/
|
|
6
|
+
const observerHandler = (mutationList) => {
|
|
7
|
+
mutationList.forEach(mutation => {
|
|
8
|
+
if (mutation.type === 'attributes' && mutation.attributeName === attribute) {
|
|
9
|
+
handler(mutation.target);
|
|
10
|
+
}
|
|
11
|
+
if (mutation.type === 'childList') {
|
|
12
|
+
mutation.addedNodes.forEach(node => {
|
|
13
|
+
if (node.nodeType === Node.ELEMENT_NODE &&
|
|
14
|
+
node.hasAttribute(attribute)) {
|
|
15
|
+
handler(node);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
// Initialize a mutation observer for patching accessibility features
|
|
22
|
+
return new MutationObserver(observerHandler);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { getAttributeObserver as g };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
export { P as PostAccordion } from './post-accordion-
|
|
2
|
-
export { P as PostAccordionItem } from './post-accordion-item-
|
|
3
|
-
export { P as PostAlert } from './post-alert-
|
|
4
|
-
export { P as PostCollapsible } from './post-collapsible-
|
|
5
|
-
export { P as PostIcon } from './post-icon-
|
|
6
|
-
export { P as PostPopover } from './post-popover-
|
|
7
|
-
export { P as PostPopovercontainer } from './post-popovercontainer-
|
|
8
|
-
export { P as PostTabs } from './post-tabs-
|
|
9
|
-
export { P as PostTabHeader } from './post-tab-header-
|
|
10
|
-
export { P as PostTabPanel } from './post-tab-panel-
|
|
11
|
-
export { P as PostTooltip } from './post-tooltip-
|
|
1
|
+
export { P as PostAccordion } from './post-accordion-be080240.js';
|
|
2
|
+
export { P as PostAccordionItem } from './post-accordion-item-7b3c726b.js';
|
|
3
|
+
export { P as PostAlert } from './post-alert-37f853eb.js';
|
|
4
|
+
export { P as PostCollapsible } from './post-collapsible-967bb191.js';
|
|
5
|
+
export { P as PostIcon } from './post-icon-ba163099.js';
|
|
6
|
+
export { P as PostPopover } from './post-popover-69694fa6.js';
|
|
7
|
+
export { P as PostPopovercontainer } from './post-popovercontainer-da870ff0.js';
|
|
8
|
+
export { P as PostTabs } from './post-tabs-e995886a.js';
|
|
9
|
+
export { P as PostTabHeader } from './post-tab-header-14ed99cd.js';
|
|
10
|
+
export { P as PostTabPanel } from './post-tab-panel-d89c4c50.js';
|
|
11
|
+
export { P as PostTooltip } from './post-tooltip-0ec6a388.js';
|
|
12
12
|
import './index-1708db56.js';
|
|
13
|
-
import './package-
|
|
13
|
+
import './package-15929f57.js';
|
|
14
14
|
import './index-b444db27.js';
|
|
15
15
|
import './constants-8d548297.js';
|
|
16
16
|
import './fade-7fd71785.js';
|
|
17
17
|
import './check-non-empty-58bd6b17.js';
|
|
18
|
+
import './attribute-observer-37fa950a.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-1708db56.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-15929f57.js';
|
|
3
3
|
|
|
4
4
|
const postAccordionCss = ":host{display:block}";
|
|
5
5
|
const PostAccordionStyle0 = postAccordionCss;
|