@swisspost/design-system-components 10.0.0-next.47 → 10.0.0-next.48
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/{event-from-AKK8RQrn.js → event-from-C6kpQwhw.js} +2 -2
- package/dist/cjs/index-CpDyH7Ww.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-wsZ6ig4j.js → package-CZyXYkIN.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +4 -4
- package/dist/cjs/post-avatar.cjs.entry.js +91 -54
- package/dist/cjs/post-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/post-banner.cjs.entry.js +3 -3
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +1 -1
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/post-card-control.cjs.entry.js +1 -1
- package/dist/cjs/post-closebutton_15.cjs.entry.js +4 -5
- package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/post-footer.cjs.entry.js +1 -1
- package/dist/cjs/post-linkarea.cjs.entry.js +1 -1
- package/dist/cjs/post-popover.cjs.entry.js +1 -1
- package/dist/cjs/post-rating.cjs.entry.js +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +1 -1
- package/dist/cjs/post-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -5
- package/dist/collection/components/post-avatar/avatar-utils.js +16 -0
- package/dist/collection/components/post-avatar/post-avatar.js +90 -57
- package/dist/collection/components/post-banner/post-banner.js +2 -2
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -19
- package/dist/collection/components/post-menu/post-menu.js +4 -1
- package/dist/collection/components/post-tabs/post-tabs.js +3 -3
- package/dist/collection/utils/event-from.js +2 -2
- package/dist/{esm/event-from-8U5GFtQP.js → components/event-from.js} +2 -2
- package/dist/components/get-root.js +15 -0
- package/dist/components/index.d.ts +73 -0
- package/dist/components/index.js +36 -2315
- package/dist/components/package.js +3 -0
- package/dist/components/post-accordion-item.js +1 -1
- package/dist/components/post-accordion-item2.js +113 -0
- package/dist/components/post-accordion.js +1 -1
- package/dist/components/post-accordion2.js +138 -0
- package/dist/components/post-avatar.js +99 -62
- package/dist/components/post-back-to-top.js +6 -7
- package/dist/components/post-banner.js +10 -11
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumb-item2.js +79 -0
- package/dist/components/post-breadcrumbs.js +13 -14
- package/dist/components/post-card-control.js +8 -9
- package/dist/components/post-closebutton.js +5 -7
- package/dist/components/post-collapsible-trigger.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +135 -0
- package/dist/components/post-collapsible.js +1 -1
- package/dist/components/post-collapsible2.js +110 -0
- package/dist/components/post-footer.js +10 -11
- package/dist/components/post-header.js +6 -7
- package/dist/components/post-icon.js +1 -1
- package/dist/components/post-icon2.js +153 -0
- package/dist/components/post-language-option.js +8 -9
- package/dist/components/post-language-switch.js +12 -13
- package/dist/components/post-linkarea.js +3 -4
- package/dist/components/post-list-item.js +3 -4
- package/dist/components/post-list.js +4 -5
- package/dist/components/post-logo.js +5 -6
- package/dist/components/post-mainnavigation.js +4 -5
- package/dist/components/post-megadropdown-trigger.js +6 -7
- package/dist/components/post-megadropdown.js +7 -8
- package/dist/components/post-menu-item.js +1 -1
- package/dist/components/post-menu-item2.js +30 -0
- package/dist/components/post-menu-trigger.js +1 -1
- package/dist/components/post-menu-trigger2.js +110 -0
- package/dist/components/post-menu.js +1 -1
- package/dist/components/post-menu2.js +222 -0
- package/dist/components/post-popover.js +6 -7
- package/dist/components/post-popovercontainer.js +1 -1
- package/dist/components/post-popovercontainer2.js +3018 -0
- package/dist/components/post-rating.js +8 -9
- package/dist/components/post-tab-header.js +6 -7
- package/dist/components/post-tab-panel.js +6 -7
- package/dist/components/post-tabs.js +7 -8
- package/dist/components/post-togglebutton.js +3 -4
- package/dist/components/post-tooltip-trigger.js +6 -7
- package/dist/components/post-tooltip.js +6 -7
- package/dist/components/react/index.d.ts +33 -0
- package/dist/components/react/index.js +2315 -0
- package/dist/components/react/p-0Ltezq5O.js +3 -0
- package/dist/components/{p-i0-mizzM.js → react/p-38PqL5iD.js} +1 -1
- package/dist/components/react/p-BLchVpF6.js +14 -0
- package/dist/components/react/p-C35MCWIp.js +35 -0
- package/dist/components/{p-336Lbkey.js → react/p-CGsAj6ij.js} +1 -1
- package/dist/components/react/p-CJ80BZ06.js +178 -0
- package/dist/{esm/index-BWC0gtGU.js → components/react/p-CV7fm1rW.js} +1 -1
- package/dist/components/react/p-C_2k3G1c.js +264 -0
- package/dist/components/{p-DP5pj8mq.js → react/p-Ce7jgYmK.js} +1 -1
- package/dist/components/{p-BSvy4uym.js → react/p-CiYSngKM.js} +7 -7
- package/dist/components/{p-Cxrx7SXz.js → react/p-Da5wbVP8.js} +1 -1
- package/dist/components/{p-DVGX_JCp.js → react/p-Dq9F2i7n.js} +2 -2
- package/dist/components/{p-DEi5TIMq.js → react/p-DzYquz3e.js} +2 -2
- package/dist/components/{p-pHxypsHK.js → react/p-JHuJA2Lv.js} +4 -4
- package/dist/components/react/p-SbIC4aZX.js +11 -0
- package/dist/components/{p-C0H2ohSv.js → react/p-Tg0GNTZM.js} +2 -2
- package/dist/components/{p-8U5GFtQP.js → react/p-kraHE1r3.js} +2 -2
- package/dist/components/{p-BM8mtEfS.js → react/p-q8Fvf8A0.js} +1 -1
- package/dist/components/react/p-r4txK0AC.js +3 -0
- package/dist/components/react/post-accordion-item.d.ts +11 -0
- package/dist/components/react/post-accordion-item.js +6 -0
- package/dist/components/react/post-accordion.d.ts +11 -0
- package/dist/components/react/post-accordion.js +6 -0
- package/dist/components/react/post-avatar.d.ts +11 -0
- package/dist/components/react/post-avatar.js +226 -0
- package/dist/components/react/post-back-to-top.d.ts +11 -0
- package/dist/components/react/post-back-to-top.js +145 -0
- package/dist/components/react/post-banner.d.ts +11 -0
- package/dist/components/react/post-banner.js +99 -0
- package/dist/components/react/post-breadcrumb-item.d.ts +11 -0
- package/dist/components/react/post-breadcrumb-item.js +6 -0
- package/dist/components/react/post-breadcrumbs.d.ts +11 -0
- package/dist/components/react/post-breadcrumbs.js +187 -0
- package/dist/components/react/post-card-control.d.ts +11 -0
- package/dist/components/react/post-card-control.js +327 -0
- package/dist/components/react/post-closebutton.d.ts +11 -0
- package/dist/components/react/post-closebutton.js +50 -0
- package/dist/components/react/post-collapsible-trigger.d.ts +11 -0
- package/dist/components/react/post-collapsible-trigger.js +6 -0
- package/dist/components/react/post-collapsible.d.ts +11 -0
- package/dist/components/react/post-collapsible.js +6 -0
- package/dist/components/react/post-footer.d.ts +11 -0
- package/dist/components/react/post-footer.js +117 -0
- package/dist/components/react/post-header.d.ts +11 -0
- package/dist/components/react/post-header.js +333 -0
- package/dist/components/react/post-icon.d.ts +11 -0
- package/dist/components/react/post-icon.js +6 -0
- package/dist/components/react/post-language-option.d.ts +11 -0
- package/dist/components/react/post-language-option.js +101 -0
- package/dist/components/react/post-language-switch.d.ts +11 -0
- package/dist/components/react/post-language-switch.js +159 -0
- package/dist/components/react/post-linkarea.d.ts +11 -0
- package/dist/components/react/post-linkarea.js +46 -0
- package/dist/components/react/post-list-item.d.ts +11 -0
- package/dist/components/react/post-list-item.js +39 -0
- package/dist/components/react/post-list.d.ts +11 -0
- package/dist/components/react/post-list.js +62 -0
- package/dist/components/react/post-logo.d.ts +11 -0
- package/dist/components/react/post-logo.js +59 -0
- package/dist/components/react/post-mainnavigation.d.ts +11 -0
- package/dist/components/react/post-mainnavigation.js +181 -0
- package/dist/components/react/post-megadropdown-trigger.d.ts +11 -0
- package/dist/components/react/post-megadropdown-trigger.js +137 -0
- package/dist/components/react/post-megadropdown.d.ts +11 -0
- package/dist/components/react/post-megadropdown.js +197 -0
- package/dist/components/react/post-menu-item.d.ts +11 -0
- package/dist/components/react/post-menu-item.js +6 -0
- package/dist/components/react/post-menu-trigger.d.ts +11 -0
- package/dist/components/react/post-menu-trigger.js +6 -0
- package/dist/components/react/post-menu.d.ts +11 -0
- package/dist/components/react/post-menu.js +6 -0
- package/dist/components/react/post-popover.d.ts +11 -0
- package/dist/components/react/post-popover.js +189 -0
- package/dist/components/react/post-popovercontainer.d.ts +11 -0
- package/dist/components/react/post-popovercontainer.js +6 -0
- package/dist/components/react/post-rating.d.ts +11 -0
- package/dist/components/react/post-rating.js +153 -0
- package/dist/components/react/post-tab-header.d.ts +11 -0
- package/dist/components/react/post-tab-header.js +53 -0
- package/dist/components/react/post-tab-panel.d.ts +11 -0
- package/dist/components/react/post-tab-panel.js +55 -0
- package/dist/components/react/post-tabs.d.ts +11 -0
- package/dist/components/react/post-tabs.js +197 -0
- package/dist/components/react/post-togglebutton.d.ts +11 -0
- package/dist/components/react/post-togglebutton.js +57 -0
- package/dist/components/react/post-tooltip-trigger.d.ts +11 -0
- package/dist/components/react/post-tooltip-trigger.js +5223 -0
- package/dist/components/react/post-tooltip.d.ts +11 -0
- package/dist/components/react/post-tooltip.js +115 -0
- package/dist/components/switch-variants.js +3 -0
- package/dist/docs.json +20 -30
- package/dist/esm/event-from-kraHE1r3.js +105 -0
- package/dist/esm/index-C8a0ddDa.js +4 -4
- package/dist/esm/index-VmK3ABCB.js +88 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-0Ltezq5O.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +5 -5
- package/dist/esm/post-avatar.entry.js +92 -55
- package/dist/esm/post-back-to-top.entry.js +2 -2
- package/dist/esm/post-banner.entry.js +4 -4
- package/dist/esm/post-breadcrumb-item_2.entry.js +2 -2
- package/dist/esm/post-breadcrumbs.entry.js +2 -2
- package/dist/esm/post-card-control.entry.js +2 -2
- package/dist/esm/post-closebutton_15.entry.js +6 -7
- package/dist/esm/post-collapsible_2.entry.js +3 -3
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/post-footer.entry.js +2 -2
- package/dist/esm/post-linkarea.entry.js +1 -1
- package/dist/esm/post-popover.entry.js +2 -2
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/post-tooltip-trigger.entry.js +2 -2
- package/dist/esm/post-tooltip.entry.js +2 -2
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/{loader → dist/loader}/index.d.ts +1 -1
- package/dist/loader/index.es2017.js +1 -0
- package/{loader → dist/loader}/index.js +1 -1
- package/dist/post-components/p-0Ltezq5O.js +1 -0
- package/dist/post-components/{p-bbe02ba3.entry.js → p-16772417.entry.js} +1 -1
- package/dist/post-components/{p-45007aac.entry.js → p-38d3d441.entry.js} +1 -1
- package/dist/post-components/{p-f67b616a.entry.js → p-3c71f590.entry.js} +1 -1
- package/dist/post-components/{p-a2fa5ce4.entry.js → p-40f21542.entry.js} +1 -1
- package/dist/post-components/{p-031f7489.entry.js → p-4243cdd1.entry.js} +1 -1
- package/dist/post-components/p-4c18cb8c.entry.js +1 -0
- package/dist/post-components/{p-c1cf39cb.entry.js → p-51dc7647.entry.js} +1 -1
- package/dist/post-components/{p-e9802b56.entry.js → p-6777e505.entry.js} +1 -1
- package/dist/post-components/{p-2f698af4.entry.js → p-6add880f.entry.js} +1 -1
- package/dist/post-components/{p-2ca196d6.entry.js → p-8363fedb.entry.js} +1 -1
- package/dist/post-components/p-83998038.entry.js +1 -0
- package/dist/post-components/{p-d0d92071.entry.js → p-85bb1b5e.entry.js} +1 -1
- package/dist/post-components/{p-3adbdda7.entry.js → p-8f4d8685.entry.js} +1 -1
- package/dist/post-components/{p-1e6a068a.entry.js → p-95ad536d.entry.js} +1 -1
- package/dist/post-components/{p-9428231b.entry.js → p-9d806e89.entry.js} +1 -1
- package/dist/post-components/{p-BWC0gtGU.js → p-VmK3ABCB.js} +1 -1
- package/dist/post-components/{p-57703aee.entry.js → p-aad86320.entry.js} +1 -1
- package/dist/post-components/p-c3e38acf.entry.js +1 -0
- package/dist/post-components/{p-ab8017bb.entry.js → p-d61bb2ff.entry.js} +1 -1
- package/dist/post-components/p-kraHE1r3.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +3 -3
- package/dist/types/components/post-avatar/avatar-utils.d.ts +3 -0
- package/dist/types/components/post-avatar/post-avatar.d.ts +13 -10
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -6
- package/dist/types/components/post-menu/post-menu.d.ts +3 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +2 -2
- package/dist/types/components.d.ts +0 -19
- package/dist/types/utils/component-on-ready.d.ts +2 -2
- package/hydrate/index.js +110 -70
- package/hydrate/index.mjs +110 -70
- package/package.json +19 -9
- package/dist/components/p-Z01QMrov.js +0 -3
- package/dist/esm/package-Z01QMrov.js +0 -3
- package/dist/post-components/p-7b8ab026.entry.js +0 -1
- package/dist/post-components/p-8U5GFtQP.js +0 -1
- package/dist/post-components/p-Z01QMrov.js +0 -1
- package/dist/post-components/p-ac73ab00.entry.js +0 -1
- package/dist/post-components/p-e96239c4.entry.js +0 -1
- package/loader/cdn.js +0 -1
- package/loader/index.cjs.js +0 -1
- package/loader/index.es2017.js +0 -1
- /package/dist/components/{p-CJ80BZ06.js → breakpoints.js} +0 -0
- /package/dist/components/{p-SbIC4aZX.js → fade.js} +0 -0
- /package/dist/components/{p-C35MCWIp.js → get-focusable-children.js} +0 -0
- /package/dist/components/{p-r4txK0AC.js → heading-levels.js} +0 -0
- /package/dist/components/{p-BLchVpF6.js → index.browser.js} +0 -0
- /package/dist/components/{p-CV7fm1rW.js → index2.js} +0 -0
- /package/dist/components/{p-C_2k3G1c.js → long-press-event.js} +0 -0
- /package/dist/components/{p-CBFgkSgY.js → react/p-CBFgkSgY.js} +0 -0
- /package/dist/components/{p-DjIHLduJ.js → react/p-DjIHLduJ.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
3
|
|
|
4
4
|
const postMenuItemCss = "post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{position:relative;display:flex;width:100%;align-items:center;padding:.5rem 1rem;gap:.5rem;font-size:1rem;color:#050400;transition:color 250ms cubic-bezier(0.4, 0, 0.2, 1);outline-offset:0;padding-block:.75rem}post-menu-item button:has(post-icon:last-child),post-menu-item a:has(post-icon:last-child){padding-inline-end:.75rem}@media screen and (min-width: 1024px){post-menu-item button,post-menu-item a{font-size:1.25rem}}post-menu-item button>post-icon:last-child,post-menu-item a>post-icon:last-child{margin-inline-start:.5rem}post-menu-item button:focus-visible,post-menu-item a:focus-visible{outline-offset:-2px !important;border-radius:4px}post-menu-item button::after,post-menu-item a::after{content:\"\";display:block;position:absolute;inset-block-end:0;inset-inline:0;height:3px;background-color:rgba(0,0,0,0);transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-menu-item button:hover,post-menu-item a:hover{color:#504f4b}post-menu-item button:hover::after,post-menu-item a:hover::after{background-color:currentColor}";
|
|
5
5
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const urlAlphabet =
|
|
2
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
3
|
+
|
|
4
|
+
/* @ts-self-types="./index.d.ts" */
|
|
5
|
+
let nanoid = (size = 21) => {
|
|
6
|
+
let id = '';
|
|
7
|
+
let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)));
|
|
8
|
+
while (size--) {
|
|
9
|
+
id += urlAlphabet[bytes[size] & 63];
|
|
10
|
+
}
|
|
11
|
+
return id
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { nanoid as n };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const focusableSelector = `:where(${[
|
|
2
|
+
'button',
|
|
3
|
+
'input:not([type="hidden"])',
|
|
4
|
+
'[tabindex]',
|
|
5
|
+
'select',
|
|
6
|
+
'textarea',
|
|
7
|
+
'[contenteditable]',
|
|
8
|
+
'a[href]',
|
|
9
|
+
'iframe',
|
|
10
|
+
'audio[controls]',
|
|
11
|
+
'video[controls]',
|
|
12
|
+
'area[href]',
|
|
13
|
+
'details > summary:first-of-type',
|
|
14
|
+
].join(',')})`;
|
|
15
|
+
const focusDisablingSelector = `:where(${[
|
|
16
|
+
'[inert]',
|
|
17
|
+
'[inert] *',
|
|
18
|
+
':disabled',
|
|
19
|
+
'dialog:not([open]) *',
|
|
20
|
+
'[popover]:not(:popover-open) *',
|
|
21
|
+
'details:not([open]) > *:not(details > summary:first-of-type)',
|
|
22
|
+
'details:not([open]) > *:not(details > summary:first-of-type) *',
|
|
23
|
+
'[tabindex^="-"]',
|
|
24
|
+
'[hidden]:not([hidden="false"])',
|
|
25
|
+
].join(',')})`;
|
|
26
|
+
function getFocusableChildren(element) {
|
|
27
|
+
const focusableChildren = element.querySelectorAll(`${focusableSelector}:not(${focusDisablingSelector})`);
|
|
28
|
+
const visibleFocusableChildren = Array.from(focusableChildren).filter(child => {
|
|
29
|
+
const style = window.getComputedStyle(child.parentElement);
|
|
30
|
+
return style.display !== 'none' && style.visibility !== 'hidden';
|
|
31
|
+
});
|
|
32
|
+
return visibleFocusableChildren;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { getFocusableChildren as g };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
3
|
import { c as checkRequiredAndType } from './p-CV7fm1rW.js';
|
|
4
4
|
import './p-CJ80BZ06.js';
|
|
5
5
|
import { g as getRoot } from './p-CBFgkSgY.js';
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
const IS_SERVER = typeof window === 'undefined';
|
|
2
|
+
const IS_BROWSER = !IS_SERVER;
|
|
3
|
+
|
|
4
|
+
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Throttle execution of a function. Especially useful for rate limiting
|
|
8
|
+
* execution of handlers on events like resize and scroll.
|
|
9
|
+
*
|
|
10
|
+
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
|
|
11
|
+
* are most useful.
|
|
12
|
+
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
|
|
13
|
+
* as-is, to `callback` when the throttled-function is executed.
|
|
14
|
+
* @param {object} [options] - An object to configure options.
|
|
15
|
+
* @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
|
|
16
|
+
* while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
|
|
17
|
+
* one final time after the last throttled-function call. (After the throttled-function has not been called for
|
|
18
|
+
* `delay` milliseconds, the internal counter is reset).
|
|
19
|
+
* @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
|
|
20
|
+
* immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
|
|
21
|
+
* callback will never executed if both noLeading = true and noTrailing = true.
|
|
22
|
+
* @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
|
|
23
|
+
* false (at end), schedule `callback` to execute after `delay` ms.
|
|
24
|
+
*
|
|
25
|
+
* @returns {Function} A new, throttled, function.
|
|
26
|
+
*/
|
|
27
|
+
function throttle (delay, callback, options) {
|
|
28
|
+
var _ref = {},
|
|
29
|
+
_ref$noTrailing = _ref.noTrailing,
|
|
30
|
+
noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
|
|
31
|
+
_ref$noLeading = _ref.noLeading,
|
|
32
|
+
noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
|
|
33
|
+
_ref$debounceMode = _ref.debounceMode,
|
|
34
|
+
debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
|
|
35
|
+
/*
|
|
36
|
+
* After wrapper has stopped being called, this timeout ensures that
|
|
37
|
+
* `callback` is executed at the proper times in `throttle` and `end`
|
|
38
|
+
* debounce modes.
|
|
39
|
+
*/
|
|
40
|
+
var timeoutID;
|
|
41
|
+
var cancelled = false;
|
|
42
|
+
|
|
43
|
+
// Keep track of the last time `callback` was executed.
|
|
44
|
+
var lastExec = 0;
|
|
45
|
+
|
|
46
|
+
// Function to clear existing timeout
|
|
47
|
+
function clearExistingTimeout() {
|
|
48
|
+
if (timeoutID) {
|
|
49
|
+
clearTimeout(timeoutID);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Function to cancel next exec
|
|
54
|
+
function cancel(options) {
|
|
55
|
+
var _ref2 = options || {},
|
|
56
|
+
_ref2$upcomingOnly = _ref2.upcomingOnly,
|
|
57
|
+
upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
|
|
58
|
+
clearExistingTimeout();
|
|
59
|
+
cancelled = !upcomingOnly;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/*
|
|
63
|
+
* The `wrapper` function encapsulates all of the throttling / debouncing
|
|
64
|
+
* functionality and when executed will limit the rate at which `callback`
|
|
65
|
+
* is executed.
|
|
66
|
+
*/
|
|
67
|
+
function wrapper() {
|
|
68
|
+
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
69
|
+
arguments_[_key] = arguments[_key];
|
|
70
|
+
}
|
|
71
|
+
var self = this;
|
|
72
|
+
var elapsed = Date.now() - lastExec;
|
|
73
|
+
if (cancelled) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Execute `callback` and update the `lastExec` timestamp.
|
|
78
|
+
function exec() {
|
|
79
|
+
lastExec = Date.now();
|
|
80
|
+
callback.apply(self, arguments_);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
* If `debounceMode` is true (at begin) this is used to clear the flag
|
|
85
|
+
* to allow future `callback` executions.
|
|
86
|
+
*/
|
|
87
|
+
function clear() {
|
|
88
|
+
timeoutID = undefined;
|
|
89
|
+
}
|
|
90
|
+
if (!noLeading && debounceMode && !timeoutID) {
|
|
91
|
+
/*
|
|
92
|
+
* Since `wrapper` is being called for the first time and
|
|
93
|
+
* `debounceMode` is true (at begin), execute `callback`
|
|
94
|
+
* and noLeading != true.
|
|
95
|
+
*/
|
|
96
|
+
exec();
|
|
97
|
+
}
|
|
98
|
+
clearExistingTimeout();
|
|
99
|
+
if (debounceMode === undefined && elapsed > delay) {
|
|
100
|
+
if (noLeading) {
|
|
101
|
+
/*
|
|
102
|
+
* In throttle mode with noLeading, if `delay` time has
|
|
103
|
+
* been exceeded, update `lastExec` and schedule `callback`
|
|
104
|
+
* to execute after `delay` ms.
|
|
105
|
+
*/
|
|
106
|
+
lastExec = Date.now();
|
|
107
|
+
if (!noTrailing) {
|
|
108
|
+
timeoutID = setTimeout(debounceMode ? clear : exec, delay);
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
/*
|
|
112
|
+
* In throttle mode without noLeading, if `delay` time has been exceeded, execute
|
|
113
|
+
* `callback`.
|
|
114
|
+
*/
|
|
115
|
+
exec();
|
|
116
|
+
}
|
|
117
|
+
} else if (noTrailing !== true) {
|
|
118
|
+
/*
|
|
119
|
+
* In trailing throttle mode, since `delay` time has not been
|
|
120
|
+
* exceeded, schedule `callback` to execute `delay` ms after most
|
|
121
|
+
* recent execution.
|
|
122
|
+
*
|
|
123
|
+
* If `debounceMode` is true (at begin), schedule `clear` to execute
|
|
124
|
+
* after `delay` ms.
|
|
125
|
+
*
|
|
126
|
+
* If `debounceMode` is false (at end), schedule `callback` to
|
|
127
|
+
* execute after `delay` ms.
|
|
128
|
+
*/
|
|
129
|
+
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
wrapper.cancel = cancel;
|
|
133
|
+
|
|
134
|
+
// Return the wrapper function.
|
|
135
|
+
return wrapper;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
class Breakpoint {
|
|
139
|
+
constructor() {
|
|
140
|
+
this.breakpoints = [
|
|
141
|
+
{ key: 'xl', device: 'desktop', minWidth: 1280 },
|
|
142
|
+
{ key: 'lg', device: 'desktop', minWidth: 1024 },
|
|
143
|
+
{ key: 'md', device: 'tablet', minWidth: 780 },
|
|
144
|
+
{ key: 'sm', device: 'tablet', minWidth: 600 },
|
|
145
|
+
{ key: 'xs', device: 'mobile', minWidth: 0 },
|
|
146
|
+
];
|
|
147
|
+
this.updateCurrentBreakpoint = throttle(50, (options = { emitEvents: true }) => {
|
|
148
|
+
const previousBreakpoint = this.currentBreakpoint;
|
|
149
|
+
const newBreakpoint = this.breakpoints.find(breakpoint => {
|
|
150
|
+
return breakpoint.minWidth <= innerWidth;
|
|
151
|
+
});
|
|
152
|
+
if (!newBreakpoint)
|
|
153
|
+
return;
|
|
154
|
+
this.currentBreakpoint = newBreakpoint;
|
|
155
|
+
if (!options.emitEvents)
|
|
156
|
+
return;
|
|
157
|
+
Object.keys(this.currentBreakpoint)
|
|
158
|
+
.filter(key => !previousBreakpoint || this.currentBreakpoint[key] !== previousBreakpoint[key])
|
|
159
|
+
.forEach((key) => this.dispatchEvent(key));
|
|
160
|
+
});
|
|
161
|
+
if (IS_SERVER)
|
|
162
|
+
return;
|
|
163
|
+
this.updateCurrentBreakpoint({ emitEvents: false });
|
|
164
|
+
window.addEventListener('resize', () => this.updateCurrentBreakpoint(), { passive: true });
|
|
165
|
+
}
|
|
166
|
+
dispatchEvent(property) {
|
|
167
|
+
if (IS_SERVER)
|
|
168
|
+
return;
|
|
169
|
+
window.dispatchEvent(new CustomEvent(`postBreakpoint:${property}`, { detail: this.currentBreakpoint[property] }));
|
|
170
|
+
}
|
|
171
|
+
get(property) {
|
|
172
|
+
this.updateCurrentBreakpoint({ emitEvents: false });
|
|
173
|
+
return this.currentBreakpoint[property];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const breakpoint = new Breakpoint();
|
|
177
|
+
|
|
178
|
+
export { IS_BROWSER as I, breakpoint as b, throttle as t };
|
|
@@ -85,4 +85,4 @@ const checkRequiredAndOneOf = requiredAnd(checkOneOf);
|
|
|
85
85
|
const checkRequiredAndType = requiredAnd(checkType);
|
|
86
86
|
const checkRequiredAndUrl = requiredAnd(checkUrl);
|
|
87
87
|
|
|
88
|
-
export {
|
|
88
|
+
export { checkEmptyOrUrl as a, checkRequiredAndOneOf as b, checkRequiredAndType as c, checkEmptyOrOneOf as d, checkEmptyOrType as e, checkEmptyOrPattern as f, checkRequiredAndUrl as g };
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* long-press-event - v@version@
|
|
3
|
+
* Pure JavaScript long-press-event
|
|
4
|
+
* https://github.com/john-doherty/long-press-event
|
|
5
|
+
* @author John Doherty <www.johndoherty.info>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/
|
|
8
|
+
(function (window, document) {
|
|
9
|
+
|
|
10
|
+
// local timer object based on rAF
|
|
11
|
+
var timer = null;
|
|
12
|
+
|
|
13
|
+
// check if we're using a touch screen
|
|
14
|
+
var hasPointerEvents = (('PointerEvent' in window) || (window.navigator && 'msPointerEnabled' in window.navigator));
|
|
15
|
+
var isTouch = (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
|
|
16
|
+
|
|
17
|
+
// switch to pointer events or touch events if using a touch screen
|
|
18
|
+
var mouseDown = hasPointerEvents ? 'pointerdown' : isTouch ? 'touchstart' : 'mousedown';
|
|
19
|
+
var mouseUp = hasPointerEvents ? 'pointerup' : isTouch ? 'touchend' : 'mouseup';
|
|
20
|
+
var mouseMove = hasPointerEvents ? 'pointermove' : isTouch ? 'touchmove' : 'mousemove';
|
|
21
|
+
var mouseLeave = hasPointerEvents ? 'pointerleave' : isTouch ? 'touchleave' : 'mouseleave';
|
|
22
|
+
|
|
23
|
+
// track number of pixels the mouse moves during long press
|
|
24
|
+
var startX = 0; // mouse x position when timer started
|
|
25
|
+
var startY = 0; // mouse y position when timer started
|
|
26
|
+
var maxDiffX = 10; // max number of X pixels the mouse can move during long press before it is canceled
|
|
27
|
+
var maxDiffY = 10; // max number of Y pixels the mouse can move during long press before it is canceled
|
|
28
|
+
|
|
29
|
+
// patch CustomEvent to allow constructor creation (IE/Chrome)
|
|
30
|
+
if (typeof window.CustomEvent !== 'function') {
|
|
31
|
+
|
|
32
|
+
window.CustomEvent = function (event, params) {
|
|
33
|
+
|
|
34
|
+
params = params || { bubbles: false, cancelable: false, detail: undefined };
|
|
35
|
+
|
|
36
|
+
var evt = document.createEvent('CustomEvent');
|
|
37
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
38
|
+
return evt;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
window.CustomEvent.prototype = window.Event.prototype;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// requestAnimationFrame() shim by Paul Irish
|
|
45
|
+
window.requestAnimFrame = (function () {
|
|
46
|
+
return window.requestAnimationFrame ||
|
|
47
|
+
window.webkitRequestAnimationFrame ||
|
|
48
|
+
window.mozRequestAnimationFrame ||
|
|
49
|
+
window.oRequestAnimationFrame ||
|
|
50
|
+
window.msRequestAnimationFrame || function (callback) {
|
|
51
|
+
window.setTimeout(callback, 1000 / 60);
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Behaves the same as setTimeout except uses requestAnimationFrame() where possible for better performance
|
|
57
|
+
* @param {function} fn The callback function
|
|
58
|
+
* @param {int} delay The delay in milliseconds
|
|
59
|
+
* @returns {object} handle to the timeout object
|
|
60
|
+
*/
|
|
61
|
+
function requestTimeout(fn, delay) {
|
|
62
|
+
|
|
63
|
+
if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame &&
|
|
64
|
+
!(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support
|
|
65
|
+
!window.oRequestAnimationFrame && !window.msRequestAnimationFrame) return window.setTimeout(fn, delay);
|
|
66
|
+
|
|
67
|
+
var start = new Date().getTime();
|
|
68
|
+
var handle = {};
|
|
69
|
+
|
|
70
|
+
var loop = function () {
|
|
71
|
+
var current = new Date().getTime();
|
|
72
|
+
var delta = current - start;
|
|
73
|
+
|
|
74
|
+
if (delta >= delay) {
|
|
75
|
+
fn.call();
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
handle.value = requestAnimFrame(loop);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
handle.value = requestAnimFrame(loop);
|
|
83
|
+
|
|
84
|
+
return handle;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Behaves the same as clearTimeout except uses cancelRequestAnimationFrame() where possible for better performance
|
|
89
|
+
* @param {object} handle The callback function
|
|
90
|
+
* @returns {void}
|
|
91
|
+
*/
|
|
92
|
+
function clearRequestTimeout(handle) {
|
|
93
|
+
if (handle) {
|
|
94
|
+
window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) :
|
|
95
|
+
window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) :
|
|
96
|
+
window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */
|
|
97
|
+
window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) :
|
|
98
|
+
window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) :
|
|
99
|
+
window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) :
|
|
100
|
+
clearTimeout(handle);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Fires the 'long-press' event on element
|
|
106
|
+
* @param {MouseEvent|PointerEvent|TouchEvent} originalEvent The original event being fired
|
|
107
|
+
* @returns {void}
|
|
108
|
+
*/
|
|
109
|
+
function fireLongPressEvent(originalEvent) {
|
|
110
|
+
|
|
111
|
+
clearLongPressTimer();
|
|
112
|
+
|
|
113
|
+
originalEvent = unifyEvent(originalEvent);
|
|
114
|
+
|
|
115
|
+
// fire the long-press event
|
|
116
|
+
var allowClickEvent = this.dispatchEvent(new CustomEvent('long-press', {
|
|
117
|
+
bubbles: true,
|
|
118
|
+
cancelable: true,
|
|
119
|
+
|
|
120
|
+
// custom event data (legacy)
|
|
121
|
+
detail: {
|
|
122
|
+
clientX: originalEvent.clientX,
|
|
123
|
+
clientY: originalEvent.clientY,
|
|
124
|
+
offsetX: originalEvent.offsetX,
|
|
125
|
+
offsetY: originalEvent.offsetY,
|
|
126
|
+
pageX: originalEvent.pageX,
|
|
127
|
+
pageY: originalEvent.pageY
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
// add coordinate data that would typically acompany a touch/click event
|
|
131
|
+
clientX: originalEvent.clientX,
|
|
132
|
+
clientY: originalEvent.clientY,
|
|
133
|
+
offsetX: originalEvent.offsetX,
|
|
134
|
+
offsetY: originalEvent.offsetY,
|
|
135
|
+
pageX: originalEvent.pageX,
|
|
136
|
+
pageY: originalEvent.pageY,
|
|
137
|
+
screenX: originalEvent.screenX,
|
|
138
|
+
screenY: originalEvent.screenY
|
|
139
|
+
}));
|
|
140
|
+
|
|
141
|
+
if (!allowClickEvent) {
|
|
142
|
+
// suppress the next click event if e.preventDefault() was called in long-press handler
|
|
143
|
+
document.addEventListener('click', function suppressEvent(e) {
|
|
144
|
+
document.removeEventListener('click', suppressEvent, true);
|
|
145
|
+
cancelEvent(e);
|
|
146
|
+
}, true);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* consolidates mouse, touch, and Pointer events
|
|
152
|
+
* @param {MouseEvent|PointerEvent|TouchEvent} e The original event being fired
|
|
153
|
+
* @returns {MouseEvent|PointerEvent|Touch}
|
|
154
|
+
*/
|
|
155
|
+
function unifyEvent(e) {
|
|
156
|
+
if (e.changedTouches !== undefined) {
|
|
157
|
+
return e.changedTouches[0];
|
|
158
|
+
}
|
|
159
|
+
return e;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* method responsible for starting the long press timer
|
|
164
|
+
* @param {event} e - event object
|
|
165
|
+
* @returns {void}
|
|
166
|
+
*/
|
|
167
|
+
function startLongPressTimer(e) {
|
|
168
|
+
|
|
169
|
+
clearLongPressTimer();
|
|
170
|
+
|
|
171
|
+
var el = e.target;
|
|
172
|
+
|
|
173
|
+
// get delay from html attribute if it exists, otherwise default to 1500
|
|
174
|
+
var longPressDelayInMs = parseInt(getNearestAttribute(el, 'data-long-press-delay', '1500'), 10); // default 1500
|
|
175
|
+
|
|
176
|
+
// start the timer
|
|
177
|
+
timer = requestTimeout(fireLongPressEvent.bind(el, e), longPressDelayInMs);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* method responsible for clearing a pending long press timer
|
|
182
|
+
* @param {event} e - event object
|
|
183
|
+
* @returns {void}
|
|
184
|
+
*/
|
|
185
|
+
function clearLongPressTimer(e) {
|
|
186
|
+
clearRequestTimeout(timer);
|
|
187
|
+
timer = null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Cancels the current event
|
|
192
|
+
* @param {object} e - browser event object
|
|
193
|
+
* @returns {void}
|
|
194
|
+
*/
|
|
195
|
+
function cancelEvent(e) {
|
|
196
|
+
e.stopImmediatePropagation();
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
e.stopPropagation();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Starts the timer on mouse down and logs current position
|
|
203
|
+
* @param {object} e - browser event object
|
|
204
|
+
* @returns {void}
|
|
205
|
+
*/
|
|
206
|
+
function mouseDownHandler(e) {
|
|
207
|
+
startX = e.clientX;
|
|
208
|
+
startY = e.clientY;
|
|
209
|
+
startLongPressTimer(e);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* If the mouse moves n pixels during long-press, cancel the timer
|
|
214
|
+
* @param {object} e - browser event object
|
|
215
|
+
* @returns {void}
|
|
216
|
+
*/
|
|
217
|
+
function mouseMoveHandler(e) {
|
|
218
|
+
|
|
219
|
+
// calculate total number of pixels the pointer has moved
|
|
220
|
+
var diffX = Math.abs(startX - e.clientX);
|
|
221
|
+
var diffY = Math.abs(startY - e.clientY);
|
|
222
|
+
|
|
223
|
+
// if pointer has moved more than allowed, cancel the long-press timer and therefore the event
|
|
224
|
+
if (diffX >= maxDiffX || diffY >= maxDiffY) {
|
|
225
|
+
clearLongPressTimer();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Gets attribute off HTML element or nearest parent
|
|
231
|
+
* @param {object} el - HTML element to retrieve attribute from
|
|
232
|
+
* @param {string} attributeName - name of the attribute
|
|
233
|
+
* @param {any} defaultValue - default value to return if no match found
|
|
234
|
+
* @returns {any} attribute value or defaultValue
|
|
235
|
+
*/
|
|
236
|
+
function getNearestAttribute(el, attributeName, defaultValue) {
|
|
237
|
+
|
|
238
|
+
// walk up the dom tree looking for data-action and data-trigger
|
|
239
|
+
while (el && el !== document.documentElement) {
|
|
240
|
+
|
|
241
|
+
var attributeValue = el.getAttribute(attributeName);
|
|
242
|
+
|
|
243
|
+
if (attributeValue) {
|
|
244
|
+
return attributeValue;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
el = el.parentNode;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return defaultValue;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// hook events that clear a pending long press event
|
|
254
|
+
document.addEventListener(mouseUp, clearLongPressTimer, true);
|
|
255
|
+
document.addEventListener(mouseLeave, clearLongPressTimer, true);
|
|
256
|
+
document.addEventListener(mouseMove, mouseMoveHandler, true);
|
|
257
|
+
document.addEventListener('wheel', clearLongPressTimer, true);
|
|
258
|
+
document.addEventListener('scroll', clearLongPressTimer, true);
|
|
259
|
+
document.addEventListener('contextmenu', clearLongPressTimer, true);
|
|
260
|
+
|
|
261
|
+
// hook events that can trigger a long press event
|
|
262
|
+
document.addEventListener(mouseDown, mouseDownHandler, true); // <- start
|
|
263
|
+
|
|
264
|
+
}(window, document));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
2
|
import { I as IS_BROWSER } from './p-CJ80BZ06.js';
|
|
3
3
|
import { d as checkEmptyOrOneOf, e as checkEmptyOrType } from './p-CV7fm1rW.js';
|
|
4
|
-
import { v as version } from './p-
|
|
4
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
5
5
|
|
|
6
6
|
const PLACEMENT_TYPES = [
|
|
7
7
|
'top',
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
3
|
import { H as HEADING_LEVELS } from './p-r4txK0AC.js';
|
|
4
4
|
import { d as checkEmptyOrOneOf } from './p-CV7fm1rW.js';
|
|
5
5
|
import './p-CJ80BZ06.js';
|
|
6
|
-
import { E as EventFrom } from './p-
|
|
6
|
+
import { E as EventFrom } from './p-kraHE1r3.js';
|
|
7
7
|
import { n as nanoid } from './p-BLchVpF6.js';
|
|
8
|
-
import { d as defineCustomElement$3 } from './p-
|
|
9
|
-
import { d as defineCustomElement$2 } from './p-
|
|
10
|
-
import { d as defineCustomElement$1 } from './p-
|
|
8
|
+
import { d as defineCustomElement$3 } from './p-q8Fvf8A0.js';
|
|
9
|
+
import { d as defineCustomElement$2 } from './p-Tg0GNTZM.js';
|
|
10
|
+
import { d as defineCustomElement$1 } from './p-Da5wbVP8.js';
|
|
11
11
|
|
|
12
12
|
const postAccordionItemCss = ".accordion-item::after{display:block;content:\"\";margin-block-start:calc(var(--post-device-border-width-default)*-1);border-block-end:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-item:has(.accordion-button:hover)::after{border-color:var(--post-scheme-color-interactive-primary-hover-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-item:has(.accordion-button:hover)::after{border-color:Highlight}}.accordion-header{color:var(--post-scheme-color-interactive-primary-enabled-fg1);font-size:var(--post-device-font-size-5);margin:0;line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-extra-black)}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;display:flex;position:relative;width:100%;align-items:center;text-align:start;gap:var(--post-device-spacing-gap-7);padding:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default)) calc(var(--post-device-spacing-padding-5) + var(--post-device-border-width-default));cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button{background-color:ButtonFace !important}.accordion-button:hover{background-color:Highlight !important}}.accordion-button::before{display:block;position:absolute;content:\"\";inset:0;inset-block-end:auto;border-block-start-width:var(--post-accordion-button-border-top-width, var(--post-device-border-width-default));border-block-start-style:var(--post-core-border-style-solid);border-block-start-color:var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.accordion-button slot::slotted(span[slot=header]){flex-grow:1}.accordion-button post-icon{flex:none;width:var(--post-core-dimension-24);aspect-ratio:1;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed{padding-block-start:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default));padding-block-end:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default))}.accordion-button.collapsed post-icon{transform:rotate(-180deg)}.accordion-button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}.accordion-button>::slotted(.text-truncate){display:block}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover,.accordion-button:focus-visible{color:Highlight}}.accordion-body{padding-block-start:var(--post-device-spacing-padding-15);padding-block-end:calc(var(--post-device-spacing-padding-block-25) + var(--post-device-border-width-default));padding-inline:var(--post-device-spacing-padding-5)}.logo-container{display:none;width:var(--post-device-sizing-logo-1);aspect-ratio:1}.logo-container.has-image{display:block}.logo-container slot::slotted(img){display:block;width:100%;height:100%;object-fit:cover}.accordion-button>::slotted(:first-child),.accordion-body>::slotted(:first-child){margin-block-start:0 !important}.accordion-button>::slotted(:last-child),.accordion-body>::slotted(:last-child){margin-block-end:0 !important}";
|
|
13
13
|
|
|
@@ -59,10 +59,10 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
59
59
|
render() {
|
|
60
60
|
const headingLevel = this.host.closest('post-accordion')?.getAttribute('heading-level');
|
|
61
61
|
const HeadingTag = `h${headingLevel ?? this.headingLevel ?? 2}`;
|
|
62
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: 'b98847d19894430b6f65130aebf8673a45afd1e6', id: this.id, "data-version": version }, h("div", { key: 'f26f9d3a4a1f59db23b4698b321e28e112c3eed0', part: "accordion-item", class: "accordion-item" }, h("post-collapsible-trigger", { key: '14bdacce04d67a03655f600feeaeec065e0fc198', for: `${this.id}--collapse` }, h(HeadingTag, { key: '7a07a70d172306ce37f8bd0143b21ed7ec0cab8a', class: "accordion-header", id: `${this.id}--header` }, h("button", { key: '5ad0698a62df5c4b2c0a77ff622090b20f348e9c', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}`, part: "button" }, h("span", { key: '6e5fcb0c9efa8a57e05fd162c72b9c170a8210c6', class: {
|
|
63
63
|
'logo-container': true,
|
|
64
64
|
'has-image': !!this.slottedLogo,
|
|
65
|
-
} }, h("slot", { key: '
|
|
65
|
+
} }, h("slot", { key: '41a1409f723bf52de893324ce45d4e7f31eb8908', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), h("slot", { key: '7186adfe4a4fe67f4dbaeb7569820d0d06c18428', name: "header" }), h("post-icon", { key: 'fbfcbdc9947a8c7cf80d861aba3a77be0dff91d1', name: "2051" })))), h("post-collapsible", { key: '5de19aab5eb0134b7c3e7f43e5c2da0cb8413908', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, h("div", { key: '5112ba8604ea177af4d88033f682c2a4cc6c4ffd', class: "accordion-body", part: "body" }, h("slot", { key: 'd70ab76842fced3f7dec812471685071e377bc61' }))))));
|
|
66
66
|
}
|
|
67
67
|
get host() { return this; }
|
|
68
68
|
static get watchers() { return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
2
|
import { I as IS_BROWSER } from './p-CJ80BZ06.js';
|
|
3
3
|
import { d as checkEmptyOrOneOf, e as checkEmptyOrType, c as checkRequiredAndType } from './p-CV7fm1rW.js';
|
|
4
|
-
import { v as version } from './p-
|
|
4
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
5
5
|
|
|
6
6
|
const postIconCss = ":host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;forced-color-adjust:preserve-parent-color;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}";
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
3
|
import { H as HEADING_LEVELS } from './p-r4txK0AC.js';
|
|
4
4
|
import { b as checkRequiredAndOneOf } from './p-CV7fm1rW.js';
|
|
5
5
|
import './p-CJ80BZ06.js';
|
|
6
|
-
import { E as EventFrom } from './p-
|
|
6
|
+
import { E as EventFrom } from './p-kraHE1r3.js';
|
|
7
7
|
|
|
8
8
|
const postAccordionCss = ":host{display:block}::slotted(post-accordion-item){display:block}::slotted(post-accordion-item:not(:only-of-type:first-of-type)){margin-block-start:calc(var(--post-device-border-width-default)*-1)}::slotted(post-accordion-item:where(:only-of-type,:not(:first-of-type))){--post-accordion-button-border-top-width:0}";
|
|
9
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
3
|
import { a as checkEmptyOrUrl } from './p-CV7fm1rW.js';
|
|
4
4
|
import './p-CJ80BZ06.js';
|
|
5
|
-
import { d as defineCustomElement$1 } from './p-
|
|
5
|
+
import { d as defineCustomElement$1 } from './p-Da5wbVP8.js';
|
|
6
6
|
|
|
7
7
|
const postBreadcrumbItemCss = ":host{display:flex;align-items:center;justify-content:start;gap:var(--post-device-spacing-gap-inline-5)}:host post-icon{box-sizing:border-box;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);padding-block:var(--post-core-dimension-4);padding-inline:var(--post-core-dimension-4)}.breadcrumb-item{white-space:nowrap;line-height:150%;padding-block:var(--post-device-spacing-padding-block-7);color:var(--post-scheme-color-interactive-primary-enabled-fg1);text-decoration:var(--post-core-text-decoration-none)}.breadcrumb-item{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.breadcrumb-item:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.breadcrumb-item:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.breadcrumb-item:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}.breadcrumb-item:focus-visible{border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item,.breadcrumb-item:focus,.breadcrumb-item:hover{color:LinkText !important}.breadcrumb-item:visited{color:VisitedText !important}}";
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { a as PLACEMENT_TYPES, d as defineCustomElement$1 } from './p-
|
|
3
|
-
import { v as version } from './p-
|
|
2
|
+
import { a as PLACEMENT_TYPES, d as defineCustomElement$1 } from './p-Ce7jgYmK.js';
|
|
3
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
4
4
|
import { g as getFocusableChildren } from './p-C35MCWIp.js';
|
|
5
5
|
import { d as checkEmptyOrOneOf } from './p-CV7fm1rW.js';
|
|
6
6
|
import './p-CJ80BZ06.js';
|
|
7
|
-
import { E as EventFrom } from './p-
|
|
7
|
+
import { E as EventFrom } from './p-kraHE1r3.js';
|
|
8
8
|
import { g as getRoot } from './p-CBFgkSgY.js';
|
|
9
9
|
|
|
10
10
|
const postMenuCss = "@keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}:host{display:block}:where([part=menu]){display:flex;flex-direction:column;padding-block:.5rem}";
|
|
@@ -181,7 +181,7 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends H {
|
|
|
181
181
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
182
182
|
}
|
|
183
183
|
render() {
|
|
184
|
-
return (h(Host, { key: '
|
|
184
|
+
return (h(Host, { key: 'ee365a30646247563fccd55556f7667cb1591d02', "data-version": version, role: "menu" }, h("post-popovercontainer", { key: 'c649841d408d3f35dfed959cdc6b041163ff80d3', placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '9f4f145b80c716d27dc51f4bcb0d269b2b2678a8', part: "menu" }, h("slot", { key: '72b53c8f154a4a91541799a789e8618a8d1a9c2c' })))));
|
|
185
185
|
}
|
|
186
186
|
get host() { return this; }
|
|
187
187
|
static get watchers() { return {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const fadeDuration = 200;
|
|
2
|
+
const fadedOutKeyframe = { opacity: '0' };
|
|
3
|
+
const fadedInKeyframe = { opacity: '1' };
|
|
4
|
+
function fadeIn(el) {
|
|
5
|
+
return el.animate([fadedOutKeyframe, fadedInKeyframe], { duration: fadeDuration });
|
|
6
|
+
}
|
|
7
|
+
function fadeOut(el) {
|
|
8
|
+
return el.animate([fadedInKeyframe, fadedOutKeyframe], { duration: fadeDuration });
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { fadeIn as a, fadeOut as f };
|