@swisspost/design-system-components 2.0.1 → 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-0645dd08.js → package-628f6e9c.js} +1 -1
- package/dist/cjs/{post-accordion-64aa88cf.js → post-accordion-da546aa2.js} +1 -1
- package/dist/cjs/{post-accordion-item-51df1dfa.js → post-accordion-item-33d5593a.js} +3 -3
- 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-26c1bcda.js +98 -0
- package/dist/cjs/post-alert.cjs.entry.js +2 -2
- package/dist/cjs/{post-collapsible-84416953.js → post-collapsible-278b2a71.js} +1 -1
- package/dist/cjs/post-collapsible.cjs.entry.js +2 -2
- package/dist/cjs/{post-icon-5fc20211.js → post-icon-fd09bc54.js} +2 -2
- 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-cc5fa030.js → post-popovercontainer-5e355de3.js} +26 -11
- package/dist/cjs/post-popovercontainer.cjs.entry.js +2 -2
- package/dist/cjs/post-tab-header-5c8b9a0d.js +32 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-panel-1143ea40.js → post-tab-panel-67ba226d.js} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-7ef36ff6.js → post-tabs-71510ced.js} +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tooltip-45784e17.js → post-tooltip-b6bbb3e4.js} +124 -42
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -2
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- 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-icon/post-icon.css +1 -1
- 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 -10
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +120 -42
- 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 +2 -2
- package/dist/components/post-alert2.js +1 -1
- package/dist/components/post-icon2.js +1 -1
- package/dist/components/post-popover2.js +51 -64
- package/dist/components/post-popovercontainer2.js +25 -10
- package/dist/components/post-tab-header2.js +1 -1
- package/dist/components/post-tooltip2.js +123 -41
- package/dist/docs.json +5 -25
- package/dist/esm/attribute-observer-37fa950a.js +25 -0
- package/dist/esm/index.js +13 -12
- package/dist/esm/{package-37a68f71.js → package-15929f57.js} +1 -1
- package/dist/esm/{post-accordion-8872dc1b.js → post-accordion-be080240.js} +1 -1
- package/dist/esm/{post-accordion-item-02b9f01c.js → post-accordion-item-7b3c726b.js} +3 -3
- package/dist/esm/post-accordion-item.entry.js +2 -2
- package/dist/esm/post-accordion.entry.js +2 -2
- package/dist/esm/post-alert-37f853eb.js +96 -0
- package/dist/esm/post-alert.entry.js +2 -2
- package/dist/esm/{post-collapsible-1f23fe7d.js → post-collapsible-967bb191.js} +1 -1
- package/dist/esm/post-collapsible.entry.js +2 -2
- package/dist/esm/{post-icon-2ec2127e.js → post-icon-ba163099.js} +2 -2
- 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-4a48161f.js → post-popovercontainer-da870ff0.js} +26 -11
- package/dist/esm/post-popovercontainer.entry.js +2 -2
- package/dist/esm/post-tab-header-14ed99cd.js +30 -0
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/{post-tab-panel-da24046f.js → post-tab-panel-d89c4c50.js} +1 -1
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-21a5dfeb.js → post-tabs-e995886a.js} +1 -1
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tooltip-4f4f87b4.js → post-tooltip-0ec6a388.js} +124 -42
- 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-e836df41.js → p-1f284e66.js} +1 -1
- package/dist/post-components/p-209e33a5.js +1 -0
- 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-73a7d4f9.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-61d98756.js +1 -0
- package/dist/post-components/p-6adeaa6c.js +1 -0
- package/dist/post-components/{p-aee1750c.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-c1c8f2ec.js → p-a9d59b04.js} +1 -1
- package/dist/post-components/p-ac7b779e.js +1 -0
- package/dist/post-components/p-d9c9ed63.js +1 -0
- 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/components/post-tooltip/post-tooltip.d.ts +14 -9
- package/dist/types/utils/attribute-observer.d.ts +1 -0
- package/package.json +4 -3
- package/dist/cjs/post-alert-ac59385a.js +0 -98
- package/dist/cjs/post-popover-be868244.js +0 -117
- package/dist/cjs/post-tab-header-5a7070e9.js +0 -32
- package/dist/esm/post-alert-1a766c15.js +0 -96
- package/dist/esm/post-popover-f6029c96.js +0 -115
- package/dist/esm/post-tab-header-63676360.js +0 -30
- package/dist/post-components/p-0b46c9ba.entry.js +0 -1
- package/dist/post-components/p-21557c34.js +0 -15
- package/dist/post-components/p-2b67b933.js +0 -1
- package/dist/post-components/p-47fd6eb0.js +0 -1
- package/dist/post-components/p-548ee455.entry.js +0 -1
- package/dist/post-components/p-63b6c589.entry.js +0 -1
- package/dist/post-components/p-66f346fb.entry.js +0 -1
- package/dist/post-components/p-7973e3e4.js +0 -1
- package/dist/post-components/p-829f9eaf.entry.js +0 -1
- package/dist/post-components/p-82facb04.js +0 -1
- package/dist/post-components/p-8aa01298.js +0 -1
- package/dist/post-components/p-9170d84d.entry.js +0 -1
- package/dist/post-components/p-959f83c0.entry.js +0 -1
- package/dist/post-components/p-9bc7ed9e.entry.js +0 -1
- package/dist/post-components/p-a3fc7eaf.js +0 -1
- package/dist/post-components/p-a762b512.entry.js +0 -1
- package/dist/post-components/p-ccd827a1.js +0 -1
- package/dist/post-components/p-d25e401c.entry.js +0 -1
- package/dist/post-components/p-f655856d.entry.js +0 -1
|
@@ -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 : {};
|
|
@@ -4770,9 +4771,82 @@ const isFocusable = /*@__PURE__*/getDefaultExportFromCjs(focusable.exports);
|
|
|
4770
4771
|
|
|
4771
4772
|
}(window, document));
|
|
4772
4773
|
|
|
4773
|
-
const postTooltipCss = ":host{--post-contrast-color:#fff;--post-bg-rgb:51, 51, 51}post-popovercontainer::part(popover){padding:.25rem .5rem;max-width:13.5rem;min-height:1rem}";
|
|
4774
|
+
const postTooltipCss = ":host{--post-contrast-color:#fff;--post-bg-rgb:51, 51, 51}post-popovercontainer::part(popover){padding:.25rem .5rem;max-width:13.5rem;min-height:1rem}post-popovercontainer.has-arrow::part(popover)::after{position:absolute;content:\"\";inset:-13px;z-index:-1}";
|
|
4774
4775
|
const PostTooltipStyle0 = postTooltipCss;
|
|
4775
4776
|
|
|
4777
|
+
/**
|
|
4778
|
+
* @slot default - Slot for the content of the tooltip.
|
|
4779
|
+
*/
|
|
4780
|
+
/**
|
|
4781
|
+
* Track how many instances remain on the page. Used for removing global event listeners
|
|
4782
|
+
*/
|
|
4783
|
+
let tooltipInstances = 0;
|
|
4784
|
+
let hideTooltipTimeout = null;
|
|
4785
|
+
const tooltipTargetAttribute = 'data-tooltip-target';
|
|
4786
|
+
/**
|
|
4787
|
+
* Global event listener to show tooltips. This is globalized so that triggers that are rendered
|
|
4788
|
+
* async will still work without the need to set listeners on the element itself
|
|
4789
|
+
* @param e Event
|
|
4790
|
+
* @returns
|
|
4791
|
+
*/
|
|
4792
|
+
const globalInterestHandler = (e) => {
|
|
4793
|
+
const target = e.target;
|
|
4794
|
+
if (!target || !('getAttribute' in target))
|
|
4795
|
+
return;
|
|
4796
|
+
const tooltipTarget = target.getAttribute(tooltipTargetAttribute);
|
|
4797
|
+
if (!tooltipTarget || tooltipTarget === '')
|
|
4798
|
+
return;
|
|
4799
|
+
const tooltip = document.getElementById(tooltipTarget);
|
|
4800
|
+
tooltip === null || tooltip === void 0 ? void 0 : tooltip.show(target);
|
|
4801
|
+
if (hideTooltipTimeout) {
|
|
4802
|
+
window.clearTimeout(hideTooltipTimeout);
|
|
4803
|
+
hideTooltipTimeout = null;
|
|
4804
|
+
}
|
|
4805
|
+
};
|
|
4806
|
+
/**
|
|
4807
|
+
* Global event listener to hide tooltips. This is globalized so that triggers that are rendered
|
|
4808
|
+
* async will still work without the need to set listeners on the element itself
|
|
4809
|
+
* @param e Event
|
|
4810
|
+
* @returns
|
|
4811
|
+
*/
|
|
4812
|
+
const globalInterestLostHandler = (e) => {
|
|
4813
|
+
const target = e.target;
|
|
4814
|
+
const tooltipTarget = target.getAttribute(tooltipTargetAttribute);
|
|
4815
|
+
if (!tooltipTarget || tooltipTarget === '')
|
|
4816
|
+
return;
|
|
4817
|
+
const tooltip = document.getElementById(tooltipTarget);
|
|
4818
|
+
globalHideTooltip(tooltip);
|
|
4819
|
+
};
|
|
4820
|
+
/**
|
|
4821
|
+
* Start the hiding process through a timeout to give other interest events a chance to
|
|
4822
|
+
* intervene and cancel the hide event.
|
|
4823
|
+
* @param {HTMLPostTooltipElement} tooltip
|
|
4824
|
+
*/
|
|
4825
|
+
const globalHideTooltip = (tooltip) => {
|
|
4826
|
+
hideTooltipTimeout = window.setTimeout(() => {
|
|
4827
|
+
tooltip.hide();
|
|
4828
|
+
hideTooltipTimeout = null;
|
|
4829
|
+
}, 42);
|
|
4830
|
+
};
|
|
4831
|
+
/**
|
|
4832
|
+
* Patch some accessibility features that are hard to remember or understand
|
|
4833
|
+
* @param {HTMLElement} trigger
|
|
4834
|
+
*/
|
|
4835
|
+
const patchAccessibilityFeatures = (trigger) => {
|
|
4836
|
+
const describedBy = trigger.getAttribute('aria-describedby');
|
|
4837
|
+
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
4838
|
+
// Add tooltip to aria-describedby
|
|
4839
|
+
if (!(describedBy === null || describedBy === void 0 ? void 0 : describedBy.includes(id))) {
|
|
4840
|
+
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
4841
|
+
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
4842
|
+
}
|
|
4843
|
+
// Make element focusable
|
|
4844
|
+
if (!isFocusable(trigger)) {
|
|
4845
|
+
trigger.setAttribute('tabindex', '0');
|
|
4846
|
+
}
|
|
4847
|
+
};
|
|
4848
|
+
// Initialize a mutation observer for patching accessibility features
|
|
4849
|
+
const triggerObserver = getAttributeObserver(tooltipTargetAttribute, patchAccessibilityFeatures);
|
|
4776
4850
|
const PostTooltip = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends HTMLElement$1 {
|
|
4777
4851
|
constructor() {
|
|
4778
4852
|
super();
|
|
@@ -4780,10 +4854,6 @@ const PostTooltip = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends H
|
|
|
4780
4854
|
this.__attachShadow();
|
|
4781
4855
|
this.placement = 'top';
|
|
4782
4856
|
this.arrow = true;
|
|
4783
|
-
// Create local versions of event handlers for de-registration
|
|
4784
|
-
// https://stackoverflow.com/questions/33859113/javascript-removeeventlistener-not-working-inside-a-class
|
|
4785
|
-
this.localShowTooltip = e => this.show(e.target);
|
|
4786
|
-
this.localHideTooltip = this.hide.bind(this);
|
|
4787
4857
|
}
|
|
4788
4858
|
connectedCallback() {
|
|
4789
4859
|
if (!this.host.id) {
|
|
@@ -4791,29 +4861,45 @@ const PostTooltip = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends H
|
|
|
4791
4861
|
/*prettier-ignore*/
|
|
4792
4862
|
'No id set: <post-tooltip> must have an id, linking it to it\'s target element using the data-tooltip-target attribute.');
|
|
4793
4863
|
}
|
|
4794
|
-
|
|
4795
|
-
|
|
4864
|
+
}
|
|
4865
|
+
/**
|
|
4866
|
+
* Add interest event listeners, but only once, and start
|
|
4867
|
+
* the accessibility patcher
|
|
4868
|
+
*/
|
|
4869
|
+
componentWillLoad() {
|
|
4870
|
+
if (tooltipInstances === 0) {
|
|
4871
|
+
// This is the first tooltip on the page, add event listeners
|
|
4872
|
+
document.addEventListener('pointerover', globalInterestHandler);
|
|
4873
|
+
document.addEventListener('pointerout', globalInterestLostHandler);
|
|
4874
|
+
document.addEventListener('focusin', globalInterestHandler);
|
|
4875
|
+
document.addEventListener('focusout', globalInterestLostHandler);
|
|
4876
|
+
document.addEventListener('long-press', globalInterestHandler);
|
|
4877
|
+
// Initially run the accessibility patcher on all triggers
|
|
4878
|
+
document.querySelectorAll('[data-tooltip-target]').forEach(patchAccessibilityFeatures);
|
|
4879
|
+
// Start watching for future triggers
|
|
4880
|
+
triggerObserver.observe(document.body, {
|
|
4881
|
+
subtree: true,
|
|
4882
|
+
childList: true,
|
|
4883
|
+
attributeFilter: [tooltipTargetAttribute],
|
|
4884
|
+
});
|
|
4796
4885
|
}
|
|
4797
|
-
|
|
4798
|
-
// https://github.com/openui/open-ui/issues/767#issuecomment-1654177227
|
|
4799
|
-
this.triggers.forEach(trigger => this.patchPopoverTargetActionInterest(trigger));
|
|
4886
|
+
tooltipInstances++;
|
|
4800
4887
|
}
|
|
4801
4888
|
/**
|
|
4802
4889
|
* Remove a bunch of event listeners if the tooltip gets removed from the DOM
|
|
4890
|
+
* and disconnect the accessibility patcher
|
|
4803
4891
|
*/
|
|
4804
4892
|
disconnectedCallback() {
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
// for browsers that don't support popover yet
|
|
4816
|
-
document.body.appendChild(this.host);
|
|
4893
|
+
tooltipInstances--;
|
|
4894
|
+
if (tooltipInstances <= 0) {
|
|
4895
|
+
// The last tooltip has been removed, stop listening for these kind of events
|
|
4896
|
+
document.removeEventListener('pointerover', globalInterestHandler);
|
|
4897
|
+
document.removeEventListener('pointerout', globalInterestLostHandler);
|
|
4898
|
+
document.removeEventListener('focusin', globalInterestHandler);
|
|
4899
|
+
document.removeEventListener('focusout', globalInterestLostHandler);
|
|
4900
|
+
document.removeEventListener('long-press', globalInterestHandler);
|
|
4901
|
+
triggerObserver.disconnect();
|
|
4902
|
+
}
|
|
4817
4903
|
}
|
|
4818
4904
|
/**
|
|
4819
4905
|
* Programmatically display the tooltip
|
|
@@ -4836,28 +4922,24 @@ const PostTooltip = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends H
|
|
|
4836
4922
|
async toggle(target, force) {
|
|
4837
4923
|
this.popoverRef.toggle(target, force);
|
|
4838
4924
|
}
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
trigger.addEventListener('blur', this.localHideTooltip);
|
|
4847
|
-
trigger.addEventListener('long-press', this.localShowTooltip);
|
|
4848
|
-
// Patch missing aria-describedby attribute on the trigger without overriding existing values
|
|
4849
|
-
const describedBy = trigger.getAttribute('aria-describedby');
|
|
4850
|
-
if (!(describedBy === null || describedBy === void 0 ? void 0 : describedBy.includes(this.host.id))) {
|
|
4851
|
-
const newDescribedBy = describedBy ? `${describedBy} ${this.host.id}` : this.host.id;
|
|
4852
|
-
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
4853
|
-
}
|
|
4854
|
-
// Patch missing focus ability on the trigger element
|
|
4855
|
-
if (!isFocusable(trigger)) {
|
|
4856
|
-
trigger.setAttribute('tabindex', '0');
|
|
4925
|
+
/**
|
|
4926
|
+
* Pointer or focus is on the tooltip, stop the tooltip from disappearing
|
|
4927
|
+
*/
|
|
4928
|
+
handleInterest() {
|
|
4929
|
+
if (hideTooltipTimeout) {
|
|
4930
|
+
window.clearTimeout(hideTooltipTimeout);
|
|
4931
|
+
hideTooltipTimeout = null;
|
|
4857
4932
|
}
|
|
4858
4933
|
}
|
|
4934
|
+
/**
|
|
4935
|
+
* Pointer or focus left the tooltip, initiate the hiding process
|
|
4936
|
+
*/
|
|
4937
|
+
handleInterestLost() {
|
|
4938
|
+
globalHideTooltip(this);
|
|
4939
|
+
}
|
|
4859
4940
|
render() {
|
|
4860
|
-
|
|
4941
|
+
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
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' }))));
|
|
4861
4943
|
}
|
|
4862
4944
|
get host() { return this; }
|
|
4863
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": [
|
|
@@ -1636,12 +1626,7 @@
|
|
|
1636
1626
|
"tag": "post-tooltip",
|
|
1637
1627
|
"readme": "# post-tooltip\n\n\n",
|
|
1638
1628
|
"docs": "",
|
|
1639
|
-
"docsTags": [
|
|
1640
|
-
{
|
|
1641
|
-
"name": "slot",
|
|
1642
|
-
"text": "default - Slot for the content of the tooltip."
|
|
1643
|
-
}
|
|
1644
|
-
],
|
|
1629
|
+
"docsTags": [],
|
|
1645
1630
|
"usage": {},
|
|
1646
1631
|
"props": [
|
|
1647
1632
|
{
|
|
@@ -1867,12 +1852,7 @@
|
|
|
1867
1852
|
"events": [],
|
|
1868
1853
|
"listeners": [],
|
|
1869
1854
|
"styles": [],
|
|
1870
|
-
"slots": [
|
|
1871
|
-
{
|
|
1872
|
-
"name": "default",
|
|
1873
|
-
"docs": "Slot for the content of the tooltip."
|
|
1874
|
-
}
|
|
1875
|
-
],
|
|
1855
|
+
"slots": [],
|
|
1876
1856
|
"parts": [],
|
|
1877
1857
|
"dependents": [],
|
|
1878
1858
|
"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;
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
import { c as checkEmptyOrOneOf } from './index-b444db27.js';
|
|
4
4
|
|
|
5
5
|
const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
|
|
6
6
|
|
|
7
|
-
const postAccordionItemCss = "post-accordion-item::part(accordion-item),.bg-yellow post-accordion-item::part(accordion-item),.bg-light post-accordion-item::part(accordion-item),.bg-gray post-accordion-item::part(accordion-item),.bg-dark post-accordion-item::part(accordion-item),.bg-primary post-accordion-item::part(accordion-item),.bg-white post-accordion-item::part(accordion-item),.bg-black post-accordion-item::part(accordion-item),.bg-info post-accordion-item::part(accordion-item),.bg-success post-accordion-item::part(accordion-item),.bg-warning post-accordion-item::part(accordion-item),.bg-danger post-accordion-item::part(accordion-item),.bg-nightblue post-accordion-item::part(accordion-item),.bg-nightblue-bright post-accordion-item::part(accordion-item),.bg-petrol post-accordion-item::part(accordion-item),.bg-petrol-bright post-accordion-item::part(accordion-item),.bg-coral post-accordion-item::part(accordion-item),.bg-coral-bright post-accordion-item::part(accordion-item),.bg-olive post-accordion-item::part(accordion-item),.bg-olive-bright post-accordion-item::part(accordion-item),.bg-purple post-accordion-item::part(accordion-item),.bg-purple-bright post-accordion-item::part(accordion-item),.bg-aubergine post-accordion-item::part(accordion-item),.bg-aubergine-bright post-accordion-item::part(accordion-item),.bg-success-green post-accordion-item::part(accordion-item),.bg-error-red post-accordion-item::part(accordion-item),.bg-warning-orange post-accordion-item::part(accordion-item),.bg-success-background post-accordion-item::part(accordion-item),.bg-error-background post-accordion-item::part(accordion-item),.bg-warning-background post-accordion-item::part(accordion-item),.accordion-item,.bg-yellow .accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item,.bg-dark .accordion-item,.bg-primary .accordion-item,.bg-white .accordion-item,.bg-black .accordion-item,.bg-info .accordion-item,.bg-success .accordion-item,.bg-warning .accordion-item,.bg-danger .accordion-item,.bg-nightblue .accordion-item,.bg-nightblue-bright .accordion-item,.bg-petrol .accordion-item,.bg-petrol-bright .accordion-item,.bg-coral .accordion-item,.bg-coral-bright .accordion-item,.bg-olive .accordion-item,.bg-olive-bright .accordion-item,.bg-purple .accordion-item,.bg-purple-bright .accordion-item,.bg-aubergine .accordion-item,.bg-aubergine-bright .accordion-item,.bg-success-green .accordion-item,.bg-error-red .accordion-item,.bg-warning-orange .accordion-item,.bg-success-background .accordion-item,.bg-error-background .accordion-item,.bg-warning-background .accordion-item{--post-bg-opacity:1;background-color:rgba(var(--post-bg-rgb), var(--post-bg-opacity)) !important;color:var(--post-contrast-color) !important}post-accordion-item::part(accordion-item),.bg-yellow post-accordion-item::part(accordion-item),.bg-light post-accordion-item::part(accordion-item),.bg-gray post-accordion-item::part(accordion-item),.bg-dark post-accordion-item::part(accordion-item),.bg-primary post-accordion-item::part(accordion-item),.bg-white post-accordion-item::part(accordion-item),.bg-black post-accordion-item::part(accordion-item),.bg-info post-accordion-item::part(accordion-item),.bg-success post-accordion-item::part(accordion-item),.bg-warning post-accordion-item::part(accordion-item),.bg-danger post-accordion-item::part(accordion-item),.bg-nightblue post-accordion-item::part(accordion-item),.bg-nightblue-bright post-accordion-item::part(accordion-item),.bg-petrol post-accordion-item::part(accordion-item),.bg-petrol-bright post-accordion-item::part(accordion-item),.bg-coral post-accordion-item::part(accordion-item),.bg-coral-bright post-accordion-item::part(accordion-item),.bg-olive post-accordion-item::part(accordion-item),.bg-olive-bright post-accordion-item::part(accordion-item),.bg-purple post-accordion-item::part(accordion-item),.bg-purple-bright post-accordion-item::part(accordion-item),.bg-aubergine post-accordion-item::part(accordion-item),.bg-aubergine-bright post-accordion-item::part(accordion-item),.bg-success-green post-accordion-item::part(accordion-item),.bg-error-red post-accordion-item::part(accordion-item),.bg-warning-orange post-accordion-item::part(accordion-item),.bg-success-background post-accordion-item::part(accordion-item),.bg-error-background post-accordion-item::part(accordion-item),.bg-warning-background post-accordion-item::part(accordion-item),.accordion-item,.bg-yellow .accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item,.bg-dark .accordion-item,.bg-primary .accordion-item,.bg-white .accordion-item,.bg-black .accordion-item,.bg-info .accordion-item,.bg-success .accordion-item,.bg-warning .accordion-item,.bg-danger .accordion-item,.bg-nightblue .accordion-item,.bg-nightblue-bright .accordion-item,.bg-petrol .accordion-item,.bg-petrol-bright .accordion-item,.bg-coral .accordion-item,.bg-coral-bright .accordion-item,.bg-olive .accordion-item,.bg-olive-bright .accordion-item,.bg-purple .accordion-item,.bg-purple-bright .accordion-item,.bg-aubergine .accordion-item,.bg-aubergine-bright .accordion-item,.bg-success-green .accordion-item,.bg-error-red .accordion-item,.bg-warning-orange .accordion-item,.bg-success-background .accordion-item,.bg-error-background .accordion-item,.bg-warning-background .accordion-item{--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}.accordion-item{--post-bg-rgb:244, 243, 241;border-block:2px solid #666}.bg-yellow .accordion-item{--post-bg-rgb:255, 255, 255}.bg-light .accordion-item{--post-bg-rgb:255, 255, 255}.bg-gray .accordion-item{--post-bg-rgb:255, 255, 255}.bg-dark .accordion-item{--post-bg-rgb:255, 255, 255}.bg-primary .accordion-item{--post-bg-rgb:255, 255, 255}.bg-white .accordion-item{--post-bg-rgb:244, 243, 241}.bg-black .accordion-item{--post-bg-rgb:255, 255, 255}.bg-info .accordion-item{--post-bg-rgb:255, 255, 255}.bg-success .accordion-item{--post-bg-rgb:255, 255, 255}.bg-warning .accordion-item{--post-bg-rgb:255, 255, 255}.bg-danger .accordion-item{--post-bg-rgb:255, 255, 255}.bg-nightblue .accordion-item{--post-bg-rgb:255, 255, 255}.bg-nightblue-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-petrol .accordion-item{--post-bg-rgb:255, 255, 255}.bg-petrol-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-coral .accordion-item{--post-bg-rgb:255, 255, 255}.bg-coral-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-olive .accordion-item{--post-bg-rgb:255, 255, 255}.bg-olive-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-purple .accordion-item{--post-bg-rgb:255, 255, 255}.bg-purple-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-aubergine .accordion-item{--post-bg-rgb:255, 255, 255}.bg-aubergine-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-success-green .accordion-item{--post-bg-rgb:255, 255, 255}.bg-error-red .accordion-item{--post-bg-rgb:255, 255, 255}.bg-warning-orange .accordion-item{--post-bg-rgb:255, 255, 255}.bg-success-background .accordion-item{--post-bg-rgb:255, 255, 255}.bg-error-background .accordion-item{--post-bg-rgb:255, 255, 255}.bg-warning-background .accordion-item{--post-bg-rgb:255, 255, 255}.accordion-item+.accordion-item{border-block-start:0}.accordion-header{color:#333;font-size:1rem;font-weight:700;line-height:1.5;margin:0}.accordion-button{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;width:100%;position:relative;padding-block:1rem;padding-inline-start:1rem;padding-inline-end:3rem;text-align:start;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms}.accordion-button:focus-visible{outline:2px solid #1976c8}.accordion-button:hover{color:#000;background-color:#e6e6e6}.accordion-button:disabled{opacity:.4;pointer-events:none}.accordion-button::after{-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='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6z'/%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='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6z'/%3E%3C/g%3E%3C/svg%3E\");background-color:currentColor;content:\"\";display:block;height:1.5rem;width:1.5rem;position:absolute;inset-inline-end:1rem;inset-block-start:50%;transform:translateY(-50%);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed::after{transform:translateY(-50%) rotate(-180deg)}.accordion-button>.text-truncate{display:block}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover:not(:disabled),.accordion-button:focus-visible:not(:disabled){outline:2px solid Highlight}.accordion-button:disabled{opacity:1 !important}}.accordion-body{padding:.5rem 1rem 1rem;font-weight:300}.accordion-button>*,.accordion-body>:first-child{margin-block-start:0 !important}.accordion-button>*,.accordion-body>:last-child{margin-block-end:0 !important}:host{display:block}.accordion-button{cursor:pointer}.accordion-button>::slotted(.text-truncate){display:block}post-accordion-item::part(accordion-item){--post-bg-rgb:244, 243, 241}.bg-yellow post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-light post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-gray post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-dark post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-primary post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-white post-accordion-item::part(accordion-item){--post-bg-rgb:244, 243, 241}.bg-black post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-info post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-success post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-warning post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-danger post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-nightblue post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-nightblue-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-petrol post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-petrol-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-coral post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-coral-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-olive post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-olive-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-purple post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-purple-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-aubergine post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-aubergine-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-success-green post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-error-red post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-warning-orange post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-success-background post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-error-background post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-warning-background post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}post-accordion-item+post-accordion-item::part(accordion-item){border-block-start:0 !important}";
|
|
7
|
+
const postAccordionItemCss = "post-accordion-item::part(accordion-item),.bg-yellow post-accordion-item::part(accordion-item),.bg-light post-accordion-item::part(accordion-item),.bg-gray post-accordion-item::part(accordion-item),.bg-dark post-accordion-item::part(accordion-item),.bg-primary post-accordion-item::part(accordion-item),.bg-white post-accordion-item::part(accordion-item),.bg-black post-accordion-item::part(accordion-item),.bg-info post-accordion-item::part(accordion-item),.bg-success post-accordion-item::part(accordion-item),.bg-warning post-accordion-item::part(accordion-item),.bg-danger post-accordion-item::part(accordion-item),.bg-nightblue post-accordion-item::part(accordion-item),.bg-nightblue-bright post-accordion-item::part(accordion-item),.bg-petrol post-accordion-item::part(accordion-item),.bg-petrol-bright post-accordion-item::part(accordion-item),.bg-coral post-accordion-item::part(accordion-item),.bg-coral-bright post-accordion-item::part(accordion-item),.bg-olive post-accordion-item::part(accordion-item),.bg-olive-bright post-accordion-item::part(accordion-item),.bg-purple post-accordion-item::part(accordion-item),.bg-purple-bright post-accordion-item::part(accordion-item),.bg-aubergine post-accordion-item::part(accordion-item),.bg-aubergine-bright post-accordion-item::part(accordion-item),.bg-success-green post-accordion-item::part(accordion-item),.bg-error-red post-accordion-item::part(accordion-item),.bg-warning-orange post-accordion-item::part(accordion-item),.bg-success-background post-accordion-item::part(accordion-item),.bg-error-background post-accordion-item::part(accordion-item),.bg-warning-background post-accordion-item::part(accordion-item),.accordion-item,.bg-yellow .accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item,.bg-dark .accordion-item,.bg-primary .accordion-item,.bg-white .accordion-item,.bg-black .accordion-item,.bg-info .accordion-item,.bg-success .accordion-item,.bg-warning .accordion-item,.bg-danger .accordion-item,.bg-nightblue .accordion-item,.bg-nightblue-bright .accordion-item,.bg-petrol .accordion-item,.bg-petrol-bright .accordion-item,.bg-coral .accordion-item,.bg-coral-bright .accordion-item,.bg-olive .accordion-item,.bg-olive-bright .accordion-item,.bg-purple .accordion-item,.bg-purple-bright .accordion-item,.bg-aubergine .accordion-item,.bg-aubergine-bright .accordion-item,.bg-success-green .accordion-item,.bg-error-red .accordion-item,.bg-warning-orange .accordion-item,.bg-success-background .accordion-item,.bg-error-background .accordion-item,.bg-warning-background .accordion-item{--post-bg-opacity:1;background-color:rgba(var(--post-bg-rgb), var(--post-bg-opacity)) !important;color:var(--post-contrast-color) !important}post-accordion-item::part(accordion-item),.bg-yellow post-accordion-item::part(accordion-item),.bg-light post-accordion-item::part(accordion-item),.bg-gray post-accordion-item::part(accordion-item),.bg-dark post-accordion-item::part(accordion-item),.bg-primary post-accordion-item::part(accordion-item),.bg-white post-accordion-item::part(accordion-item),.bg-black post-accordion-item::part(accordion-item),.bg-info post-accordion-item::part(accordion-item),.bg-success post-accordion-item::part(accordion-item),.bg-warning post-accordion-item::part(accordion-item),.bg-danger post-accordion-item::part(accordion-item),.bg-nightblue post-accordion-item::part(accordion-item),.bg-nightblue-bright post-accordion-item::part(accordion-item),.bg-petrol post-accordion-item::part(accordion-item),.bg-petrol-bright post-accordion-item::part(accordion-item),.bg-coral post-accordion-item::part(accordion-item),.bg-coral-bright post-accordion-item::part(accordion-item),.bg-olive post-accordion-item::part(accordion-item),.bg-olive-bright post-accordion-item::part(accordion-item),.bg-purple post-accordion-item::part(accordion-item),.bg-purple-bright post-accordion-item::part(accordion-item),.bg-aubergine post-accordion-item::part(accordion-item),.bg-aubergine-bright post-accordion-item::part(accordion-item),.bg-success-green post-accordion-item::part(accordion-item),.bg-error-red post-accordion-item::part(accordion-item),.bg-warning-orange post-accordion-item::part(accordion-item),.bg-success-background post-accordion-item::part(accordion-item),.bg-error-background post-accordion-item::part(accordion-item),.bg-warning-background post-accordion-item::part(accordion-item),.accordion-item,.bg-yellow .accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item,.bg-dark .accordion-item,.bg-primary .accordion-item,.bg-white .accordion-item,.bg-black .accordion-item,.bg-info .accordion-item,.bg-success .accordion-item,.bg-warning .accordion-item,.bg-danger .accordion-item,.bg-nightblue .accordion-item,.bg-nightblue-bright .accordion-item,.bg-petrol .accordion-item,.bg-petrol-bright .accordion-item,.bg-coral .accordion-item,.bg-coral-bright .accordion-item,.bg-olive .accordion-item,.bg-olive-bright .accordion-item,.bg-purple .accordion-item,.bg-purple-bright .accordion-item,.bg-aubergine .accordion-item,.bg-aubergine-bright .accordion-item,.bg-success-green .accordion-item,.bg-error-red .accordion-item,.bg-warning-orange .accordion-item,.bg-success-background .accordion-item,.bg-error-background .accordion-item,.bg-warning-background .accordion-item{--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}.accordion-item{--post-bg-rgb:244, 243, 241;border-block:2px solid #666}.bg-yellow .accordion-item{--post-bg-rgb:255, 255, 255}.bg-light .accordion-item{--post-bg-rgb:255, 255, 255}.bg-gray .accordion-item{--post-bg-rgb:255, 255, 255}.bg-dark .accordion-item{--post-bg-rgb:255, 255, 255}.bg-primary .accordion-item{--post-bg-rgb:255, 255, 255}.bg-white .accordion-item{--post-bg-rgb:244, 243, 241}.bg-black .accordion-item{--post-bg-rgb:255, 255, 255}.bg-info .accordion-item{--post-bg-rgb:255, 255, 255}.bg-success .accordion-item{--post-bg-rgb:255, 255, 255}.bg-warning .accordion-item{--post-bg-rgb:255, 255, 255}.bg-danger .accordion-item{--post-bg-rgb:255, 255, 255}.bg-nightblue .accordion-item{--post-bg-rgb:255, 255, 255}.bg-nightblue-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-petrol .accordion-item{--post-bg-rgb:255, 255, 255}.bg-petrol-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-coral .accordion-item{--post-bg-rgb:255, 255, 255}.bg-coral-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-olive .accordion-item{--post-bg-rgb:255, 255, 255}.bg-olive-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-purple .accordion-item{--post-bg-rgb:255, 255, 255}.bg-purple-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-aubergine .accordion-item{--post-bg-rgb:255, 255, 255}.bg-aubergine-bright .accordion-item{--post-bg-rgb:255, 255, 255}.bg-success-green .accordion-item{--post-bg-rgb:255, 255, 255}.bg-error-red .accordion-item{--post-bg-rgb:255, 255, 255}.bg-warning-orange .accordion-item{--post-bg-rgb:255, 255, 255}.bg-success-background .accordion-item{--post-bg-rgb:255, 255, 255}.bg-error-background .accordion-item{--post-bg-rgb:255, 255, 255}.bg-warning-background .accordion-item{--post-bg-rgb:255, 255, 255}.accordion-item+.accordion-item{border-block-start:0}.accordion-header{color:#333;font-size:1rem;font-weight:700;line-height:1.5;margin:0}.accordion-button{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;width:100%;position:relative;padding-block:1rem;padding-inline-start:1rem;padding-inline-end:3rem;text-align:start;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms}.accordion-button:focus-visible{outline:2px solid #1976c8}.accordion-button:hover{color:#000;background-color:#e6e6e6}.accordion-button:disabled{opacity:.4;pointer-events:none}.accordion-button::after{-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='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6z'/%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='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6z'/%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;position:absolute;inset-inline-end:1rem;inset-block-start:50%;transform:translateY(-50%);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed::after{transform:translateY(-50%) rotate(-180deg)}.accordion-button>.text-truncate{display:block}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover:not(:disabled),.accordion-button:focus-visible:not(:disabled){outline:2px solid Highlight}.accordion-button:disabled{opacity:1 !important}}.accordion-body{padding:.5rem 1rem 1rem;font-weight:300}.accordion-button>*,.accordion-body>:first-child{margin-block-start:0 !important}.accordion-button>*,.accordion-body>:last-child{margin-block-end:0 !important}:host{display:block}.accordion-button{cursor:pointer}.accordion-button>::slotted(.text-truncate){display:block}post-accordion-item::part(accordion-item){--post-bg-rgb:244, 243, 241}.bg-yellow post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-light post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-gray post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-dark post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-primary post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-white post-accordion-item::part(accordion-item){--post-bg-rgb:244, 243, 241}.bg-black post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-info post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-success post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-warning post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-danger post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-nightblue post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-nightblue-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-petrol post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-petrol-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-coral post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-coral-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-olive post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-olive-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-purple post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-purple-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-aubergine post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-aubergine-bright post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-success-green post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-error-red post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-warning-orange post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-success-background post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-error-background post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}.bg-warning-background post-accordion-item::part(accordion-item){--post-bg-rgb:255, 255, 255}:host(:not(:first-of-type)) .accordion-item{border-block-start:0}";
|
|
8
8
|
const PostAccordionItemStyle0 = postAccordionItemCss;
|
|
9
9
|
|
|
10
10
|
const PostAccordionItem = class {
|
|
@@ -37,7 +37,7 @@ const PostAccordionItem = class {
|
|
|
37
37
|
render() {
|
|
38
38
|
var _a;
|
|
39
39
|
const HeadingTag = `h${(_a = this.headingLevel) !== null && _a !== void 0 ? _a : 2}`;
|
|
40
|
-
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: '
|
|
40
|
+
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' }))))));
|
|
41
41
|
}
|
|
42
42
|
get host() { return getElement(this); }
|
|
43
43
|
static get watchers() { return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { P as post_accordion_item } from './post-accordion-item-
|
|
1
|
+
export { P as post_accordion_item } from './post-accordion-item-7b3c726b.js';
|
|
2
2
|
import './index-1708db56.js';
|
|
3
|
-
import './package-
|
|
3
|
+
import './package-15929f57.js';
|
|
4
4
|
import './index-b444db27.js';
|
|
5
5
|
import './constants-8d548297.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { P as post_accordion } from './post-accordion-
|
|
1
|
+
export { P as post_accordion } from './post-accordion-be080240.js';
|
|
2
2
|
import './index-1708db56.js';
|
|
3
|
-
import './package-
|
|
3
|
+
import './package-15929f57.js';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-1708db56.js';
|
|
2
|
+
import { v as version } from './package-15929f57.js';
|
|
3
|
+
import { f as fadeOut } from './fade-7fd71785.js';
|
|
4
|
+
import { a as checkType, b as checkEmptyOrPattern, c as checkEmptyOrOneOf } from './index-b444db27.js';
|
|
5
|
+
import { c as checkNonEmpty } from './check-non-empty-58bd6b17.js';
|
|
6
|
+
|
|
7
|
+
const ALERT_TYPES = ['primary', 'success', 'danger', 'warning', 'info', 'gray'];
|
|
8
|
+
|
|
9
|
+
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}";
|
|
10
|
+
const PostAlertStyle0 = postAlertCss;
|
|
11
|
+
|
|
12
|
+
const PostAlert = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
registerInstance(this, hostRef);
|
|
15
|
+
this.dismissed = createEvent(this, "dismissed", 7);
|
|
16
|
+
this.alertId = crypto.randomUUID();
|
|
17
|
+
this.classes = undefined;
|
|
18
|
+
this.hasActions = undefined;
|
|
19
|
+
this.hasHeading = undefined;
|
|
20
|
+
this.onDismissButtonClick = () => this.dismiss();
|
|
21
|
+
this.dismissible = false;
|
|
22
|
+
this.dismissLabel = undefined;
|
|
23
|
+
this.fixed = false;
|
|
24
|
+
this.icon = undefined;
|
|
25
|
+
this.type = 'primary';
|
|
26
|
+
}
|
|
27
|
+
validateDismissible(isDismissible = this.dismissible) {
|
|
28
|
+
checkType(isDismissible, 'boolean', 'The post-alert "dismissible" prop should be a boolean.');
|
|
29
|
+
setTimeout(() => this.validateDismissLabel());
|
|
30
|
+
}
|
|
31
|
+
validateDismissLabel(dismissLabel = this.dismissLabel) {
|
|
32
|
+
if (this.dismissible) {
|
|
33
|
+
checkNonEmpty(dismissLabel, 'Dismissible post-alert\'s require a "dismiss-label" prop.');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
validateFixed(isFixed = this.fixed) {
|
|
37
|
+
checkType(isFixed, 'boolean', 'The post-alert "fixed" prop should be a boolean.');
|
|
38
|
+
}
|
|
39
|
+
validateIcon(icon = this.icon) {
|
|
40
|
+
checkEmptyOrPattern(icon, /\d{4}|none/, 'The post-alert "icon" prop should be a 4-digits string.');
|
|
41
|
+
}
|
|
42
|
+
validateType(type = this.type) {
|
|
43
|
+
checkEmptyOrOneOf(type, ALERT_TYPES, `The post-alert requires a type form: ${ALERT_TYPES.join(', ')}`);
|
|
44
|
+
}
|
|
45
|
+
connectedCallback() {
|
|
46
|
+
this.validateDismissible();
|
|
47
|
+
this.validateFixed();
|
|
48
|
+
this.validateIcon();
|
|
49
|
+
this.validateType();
|
|
50
|
+
}
|
|
51
|
+
componentWillRender() {
|
|
52
|
+
var _a;
|
|
53
|
+
this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;
|
|
54
|
+
this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;
|
|
55
|
+
this.classes = `alert alert-${(_a = this.type) !== null && _a !== void 0 ? _a : 'primary'}`;
|
|
56
|
+
if (this.dismissible)
|
|
57
|
+
this.classes += ' alert-dismissible';
|
|
58
|
+
if (this.hasActions)
|
|
59
|
+
this.classes += ' alert-action';
|
|
60
|
+
if (this.fixed)
|
|
61
|
+
this.classes += ' alert-fixed-bottom';
|
|
62
|
+
if (this.icon === 'none')
|
|
63
|
+
this.classes += ' no-icon';
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Triggers alert dismissal programmatically (same as clicking on the close button (×)).
|
|
67
|
+
*/
|
|
68
|
+
async dismiss() {
|
|
69
|
+
const dismissal = fadeOut(this.host);
|
|
70
|
+
await dismissal.finished;
|
|
71
|
+
this.host.remove();
|
|
72
|
+
this.dismissed.emit();
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
const defaultAlertContent = [
|
|
76
|
+
this.hasHeading && (h("div", { key: `${this.alertId}-heading`, class: "alert-heading" }, h("slot", { key: 'b151a1b8d49d08bd15b4a6661f7ecd25660971f8', name: "heading" }))),
|
|
77
|
+
h("slot", { key: `${this.alertId}-message` }),
|
|
78
|
+
];
|
|
79
|
+
const actionAlertContent = [
|
|
80
|
+
h("div", { key: `${this.alertId}-content`, class: "alert-content" }, defaultAlertContent),
|
|
81
|
+
h("div", { key: `${this.alertId}-buttons`, class: "alert-buttons" }, h("slot", { key: '6855a0e7c42527b628f3d76aeb13c86a1f708f38', name: "actions" })),
|
|
82
|
+
];
|
|
83
|
+
return (h(Host, { key: '959f326cf08711d6639678bfba195b8089b5cf6f', "data-version": version }, h("div", { key: '011f13e08ebc25fcec404c316b3b74d0f588e0fc', role: "alert", class: this.classes }, this.dismissible && (h("button", { class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.alertId}-icon`, name: this.icon })), this.hasActions ? actionAlertContent : defaultAlertContent)));
|
|
84
|
+
}
|
|
85
|
+
get host() { return getElement(this); }
|
|
86
|
+
static get watchers() { return {
|
|
87
|
+
"dismissible": ["validateDismissible"],
|
|
88
|
+
"dismissLabel": ["validateDismissLabel"],
|
|
89
|
+
"fixed": ["validateFixed"],
|
|
90
|
+
"icon": ["validateIcon"],
|
|
91
|
+
"type": ["validateType"]
|
|
92
|
+
}; }
|
|
93
|
+
};
|
|
94
|
+
PostAlert.style = PostAlertStyle0;
|
|
95
|
+
|
|
96
|
+
export { PostAlert as P };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { P as post_alert } from './post-alert-
|
|
1
|
+
export { P as post_alert } from './post-alert-37f853eb.js';
|
|
2
2
|
import './index-1708db56.js';
|
|
3
|
-
import './package-
|
|
3
|
+
import './package-15929f57.js';
|
|
4
4
|
import './fade-7fd71785.js';
|
|
5
5
|
import './index-b444db27.js';
|
|
6
6
|
import './constants-8d548297.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, 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
|
import { d as checkEmptyOrType } from './index-b444db27.js';
|
|
4
4
|
|
|
5
5
|
function isMotionReduced() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { P as post_collapsible } from './post-collapsible-
|
|
1
|
+
export { P as post_collapsible } from './post-collapsible-967bb191.js';
|
|
2
2
|
import './index-1708db56.js';
|
|
3
|
-
import './package-
|
|
3
|
+
import './package-15929f57.js';
|
|
4
4
|
import './index-b444db27.js';
|
|
5
5
|
import './constants-8d548297.js';
|