@swisspost/design-system-components 10.0.0-next.47 → 10.0.0-next.49
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-CR0YynRY.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +6 -6
- package/dist/cjs/post-avatar.cjs.entry.js +107 -80
- package/dist/cjs/post-back-to-top.cjs.entry.js +2 -2
- package/dist/cjs/post-banner.cjs.entry.js +3 -3
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +3 -3
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +4 -4
- package/dist/cjs/post-card-control.cjs.entry.js +4 -4
- package/dist/cjs/post-closebutton_15.cjs.entry.js +133 -74
- package/dist/cjs/post-collapsible_2.cjs.entry.js +4 -4
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/post-footer.cjs.entry.js +3 -3
- package/dist/cjs/post-linkarea.cjs.entry.js +19 -8
- package/dist/cjs/post-popover.cjs.entry.js +3 -3
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -3
- package/dist/collection/animations/pop-in.js +14 -0
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +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.css +1 -1
- package/dist/collection/components/post-avatar/post-avatar.js +119 -82
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +1 -1
- package/dist/collection/components/post-banner/post-banner.js +2 -2
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +2 -2
- package/dist/collection/components/post-card-control/post-card-control.css +1 -1
- package/dist/collection/components/post-card-control/post-card-control.js +2 -2
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -19
- package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +1 -1
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +11 -2
- package/dist/collection/components/post-icon/post-icon.js +39 -33
- package/dist/collection/components/post-language-option/post-language-option.css +1 -1
- package/dist/collection/components/post-language-option/post-language-option.js +1 -2
- package/dist/collection/components/post-language-switch/post-language-switch.js +1 -2
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +24 -6
- package/dist/collection/components/post-list/post-list.css +1 -1
- package/dist/collection/components/post-list/post-list.js +1 -1
- package/dist/collection/components/post-list-item/post-list-item.js +1 -1
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +12 -2
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +41 -5
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +18 -7
- package/dist/collection/components/post-rating/post-rating.css +1 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +3 -3
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +2 -2
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +1 -1
- package/dist/collection/utils/event-from.js +2 -2
- package/dist/component-names.json +39 -0
- 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 +117 -88
- package/dist/components/post-back-to-top.js +7 -8
- 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 +16 -17
- package/dist/components/post-card-control.js +11 -12
- 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 +12 -13
- package/dist/components/post-header.js +18 -10
- package/dist/components/post-icon.js +1 -1
- package/dist/components/post-icon2.js +159 -0
- package/dist/components/post-language-option.js +10 -12
- package/dist/components/post-language-switch.js +13 -15
- package/dist/components/post-linkarea.js +24 -12
- package/dist/components/post-list-item.js +4 -5
- package/dist/components/post-list.js +6 -7
- package/dist/components/post-logo.js +6 -7
- package/dist/components/post-mainnavigation.js +6 -7
- package/dist/components/post-megadropdown-trigger.js +7 -8
- package/dist/components/post-megadropdown.js +20 -11
- 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 +237 -0
- package/dist/components/post-popover.js +8 -9
- package/dist/components/post-popovercontainer.js +1 -1
- package/dist/components/post-popovercontainer2.js +3043 -0
- package/dist/components/post-rating.js +10 -11
- package/dist/components/post-tab-header.js +8 -9
- package/dist/components/post-tab-panel.js +7 -8
- package/dist/components/post-tabs.js +7 -8
- package/dist/components/post-togglebutton.js +4 -5
- package/dist/components/post-tooltip-trigger.js +7 -8
- package/dist/components/post-tooltip.js +8 -9
- package/dist/components/react/index.d.ts +33 -0
- package/dist/components/react/index.js +2315 -0
- package/dist/components/{p-Cxrx7SXz.js → react/p-Amg0f2Yo.js} +40 -34
- package/dist/components/{p-C0H2ohSv.js → react/p-B6vPT8S3.js} +3 -3
- package/dist/components/{p-336Lbkey.js → react/p-BDs0pvkX.js} +2 -2
- package/dist/components/react/p-BLchVpF6.js +14 -0
- package/dist/components/{p-BM8mtEfS.js → react/p-BMdFdJWl.js} +2 -2
- package/dist/components/{p-DP5pj8mq.js → react/p-BS0ZqwA-.js} +31 -6
- package/dist/components/react/p-C35MCWIp.js +35 -0
- 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-DVGX_JCp.js → react/p-D1oOccKr.js} +3 -3
- package/dist/components/{p-pHxypsHK.js → react/p-D50E7y6E.js} +24 -9
- package/dist/components/react/p-DO48NanC.js +3 -0
- package/dist/components/{p-i0-mizzM.js → react/p-DOo9tmN-.js} +2 -2
- package/dist/components/{p-DEi5TIMq.js → react/p-Do9awHW7.js} +3 -3
- package/dist/components/react/p-SbIC4aZX.js +11 -0
- package/dist/components/{p-8U5GFtQP.js → react/p-kraHE1r3.js} +2 -2
- package/dist/components/react/p-r4txK0AC.js +3 -0
- package/dist/components/{p-BSvy4uym.js → react/p-xelWyg_P.js} +8 -8
- 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 +218 -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 +342 -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 +100 -0
- package/dist/components/react/post-language-switch.d.ts +11 -0
- package/dist/components/react/post-language-switch.js +158 -0
- package/dist/components/react/post-linkarea.d.ts +11 -0
- package/dist/components/react/post-linkarea.js +59 -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 +207 -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 +71 -35
- 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-DO48NanC.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +7 -7
- package/dist/esm/post-avatar.entry.js +108 -81
- package/dist/esm/post-back-to-top.entry.js +3 -3
- package/dist/esm/post-banner.entry.js +4 -4
- package/dist/esm/post-breadcrumb-item_2.entry.js +4 -4
- package/dist/esm/post-breadcrumbs.entry.js +5 -5
- package/dist/esm/post-card-control.entry.js +5 -5
- package/dist/esm/post-closebutton_15.entry.js +135 -76
- package/dist/esm/post-collapsible_2.entry.js +5 -5
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/post-footer.entry.js +4 -4
- package/dist/esm/post-linkarea.entry.js +19 -8
- package/dist/esm/post-popover.entry.js +4 -4
- package/dist/esm/post-rating.entry.js +4 -4
- package/dist/esm/post-tab-header.entry.js +4 -4
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/post-tooltip-trigger.entry.js +3 -3
- package/dist/esm/post-tooltip.entry.js +4 -4
- 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-01bc39c2.entry.js +1 -0
- package/dist/post-components/p-0dc1e940.entry.js +1 -0
- package/dist/post-components/p-16da91bc.entry.js +1 -0
- package/dist/post-components/p-26a04741.entry.js +1 -0
- package/dist/post-components/p-2f2f9b22.entry.js +1 -0
- package/dist/post-components/{p-45007aac.entry.js → p-33008981.entry.js} +1 -1
- package/dist/post-components/p-36358cd4.entry.js +1 -0
- package/dist/post-components/p-71c48d48.entry.js +1 -0
- package/dist/post-components/{p-e9802b56.entry.js → p-84395e1d.entry.js} +1 -1
- package/dist/post-components/p-848c10ac.entry.js +1 -0
- package/dist/post-components/{p-ab8017bb.entry.js → p-8d2e5814.entry.js} +1 -1
- package/dist/post-components/{p-a2fa5ce4.entry.js → p-9dbe6595.entry.js} +1 -1
- package/dist/post-components/p-DO48NanC.js +1 -0
- package/dist/post-components/{p-BWC0gtGU.js → p-VmK3ABCB.js} +1 -1
- package/dist/post-components/p-a982458f.entry.js +1 -0
- package/dist/post-components/{p-f67b616a.entry.js → p-b0aaa058.entry.js} +1 -1
- package/dist/post-components/{p-bbe02ba3.entry.js → p-bdeef760.entry.js} +1 -1
- package/dist/post-components/{p-2f698af4.entry.js → p-d221395c.entry.js} +1 -1
- package/dist/post-components/{p-57703aee.entry.js → p-e49aa78e.entry.js} +1 -1
- package/dist/post-components/p-eb405167.entry.js +1 -0
- package/dist/post-components/p-kraHE1r3.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/animations/pop-in.d.ts +1 -0
- 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 +17 -13
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -6
- package/dist/types/components/post-header/post-header.d.ts +2 -0
- package/dist/types/components/post-icon/post-icon.d.ts +11 -0
- package/dist/types/components/post-linkarea/post-linkarea.d.ts +6 -0
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +2 -1
- package/dist/types/components/post-menu/post-menu.d.ts +7 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +6 -2
- package/dist/types/components/post-tabs/post-tabs.d.ts +2 -2
- package/dist/types/components.d.ts +19 -22
- package/dist/types/utils/component-on-ready.d.ts +2 -2
- package/hydrate/index.js +308 -201
- package/hydrate/index.mjs +308 -201
- package/package.json +24 -12
- package/dist/components/p-Z01QMrov.js +0 -3
- package/dist/esm/package-Z01QMrov.js +0 -3
- package/dist/post-components/p-031f7489.entry.js +0 -1
- package/dist/post-components/p-1e6a068a.entry.js +0 -1
- package/dist/post-components/p-2ca196d6.entry.js +0 -1
- package/dist/post-components/p-3adbdda7.entry.js +0 -1
- package/dist/post-components/p-7b8ab026.entry.js +0 -1
- package/dist/post-components/p-8U5GFtQP.js +0 -1
- package/dist/post-components/p-9428231b.entry.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-c1cf39cb.entry.js +0 -1
- package/dist/post-components/p-d0d92071.entry.js +0 -1
- package/dist/post-components/p-e96239c4.entry.js +0 -1
- package/dist/prebuild.js +0 -26
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostTooltip extends Components.PostTooltip, HTMLElement {}
|
|
4
|
+
export const PostTooltip: {
|
|
5
|
+
prototype: PostTooltip;
|
|
6
|
+
new (): PostTooltip;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { v as version } from './p-DO48NanC.js';
|
|
3
|
+
import { d as checkEmptyOrOneOf } from './p-CV7fm1rW.js';
|
|
4
|
+
import './p-CJ80BZ06.js';
|
|
5
|
+
import { d as defineCustomElement$2, a as PLACEMENT_TYPES } from './p-BS0ZqwA-.js';
|
|
6
|
+
|
|
7
|
+
const postTooltipCss = ":host{display:none}:host([open]){display:contents}post-popovercontainer[arrow]::after{position:absolute;content:\"\";inset:-13px;z-index:-1}post-popovercontainer>div{color:var(--post-current-fg);background-color:var(--post-current-bg);padding:var(--post-core-dimension-4) var(--post-core-dimension-8);max-width:280px;min-height:32px;word-wrap:break-word;white-space:normal}";
|
|
8
|
+
|
|
9
|
+
const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends H {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
/**
|
|
15
|
+
* Defines the position of the tooltip relative to its trigger.
|
|
16
|
+
* Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted towards the viewport if they would overlap edge boundaries.
|
|
17
|
+
* For supported values and behavior details, see the [Floating UI placement documentation](https://floating-ui.com/docs/computePosition#placement).
|
|
18
|
+
*/
|
|
19
|
+
this.placement = 'top';
|
|
20
|
+
/**
|
|
21
|
+
* Whether or not to display a little pointer arrow
|
|
22
|
+
*/
|
|
23
|
+
this.arrow = false;
|
|
24
|
+
/**
|
|
25
|
+
* Indicates the open state of the tooltip
|
|
26
|
+
*/
|
|
27
|
+
this.open = false;
|
|
28
|
+
}
|
|
29
|
+
validatePlacement() {
|
|
30
|
+
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
31
|
+
}
|
|
32
|
+
componentWillLoad() {
|
|
33
|
+
this.validatePlacement();
|
|
34
|
+
}
|
|
35
|
+
componentDidLoad() {
|
|
36
|
+
if (!this.host.id) {
|
|
37
|
+
console.error(
|
|
38
|
+
/*prettier-ignore*/
|
|
39
|
+
'No id set: <post-tooltip> must have an id, linking it to it\'s target element with a <post-tooltip-trigger> element.');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Programmatically display the tooltip.
|
|
44
|
+
* @param target An element where the tooltip should be shown
|
|
45
|
+
*/
|
|
46
|
+
async show(target) {
|
|
47
|
+
if (this.open)
|
|
48
|
+
return;
|
|
49
|
+
this.popoverRef.show(target);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Programmatically hide this tooltip.
|
|
53
|
+
*/
|
|
54
|
+
async hide() {
|
|
55
|
+
this.popoverRef.hide();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Toggle tooltip display.
|
|
59
|
+
* @param target An element where the tooltip should be shown
|
|
60
|
+
* @param [force] Pass true to always show or false to always hide
|
|
61
|
+
*/
|
|
62
|
+
async toggle(target, force) {
|
|
63
|
+
this.popoverRef.toggle(target, force);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Set the open state based on the toggle event.
|
|
67
|
+
* @param e Popovercontainer toggle event
|
|
68
|
+
*/
|
|
69
|
+
handleToggle(e) {
|
|
70
|
+
this.open = e.detail.isOpen;
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
|
|
74
|
+
return (h(Host, { key: 'b2e72e54ae7c21cc8d47749269dea98cd5cd4fdf', "data-version": version }, h("post-popovercontainer", { key: '4280b99b2b919d07b40f6112ee514907eeff7211', safeSpace: "trapezoid", class: popoverClass, role: "tooltip", arrow: this.arrow, animation: this.animation, placement: this.placement, onPostToggle: e => this.handleToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: 'da25daf633dc82191f0002c54f29b35731e35082' }))));
|
|
75
|
+
}
|
|
76
|
+
get host() { return this; }
|
|
77
|
+
static get watchers() { return {
|
|
78
|
+
"placement": ["validatePlacement"]
|
|
79
|
+
}; }
|
|
80
|
+
static get style() { return postTooltipCss; }
|
|
81
|
+
}, [1, "post-tooltip", {
|
|
82
|
+
"placement": [1],
|
|
83
|
+
"arrow": [4],
|
|
84
|
+
"animation": [1],
|
|
85
|
+
"open": [1540],
|
|
86
|
+
"show": [64],
|
|
87
|
+
"hide": [64],
|
|
88
|
+
"toggle": [64]
|
|
89
|
+
}, undefined, {
|
|
90
|
+
"placement": ["validatePlacement"]
|
|
91
|
+
}]);
|
|
92
|
+
function defineCustomElement$1() {
|
|
93
|
+
if (typeof customElements === "undefined") {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const components = ["post-tooltip", "post-popovercontainer"];
|
|
97
|
+
components.forEach(tagName => { switch (tagName) {
|
|
98
|
+
case "post-tooltip":
|
|
99
|
+
if (!customElements.get(tagName)) {
|
|
100
|
+
customElements.define(tagName, PostTooltip$1);
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
case "post-popovercontainer":
|
|
104
|
+
if (!customElements.get(tagName)) {
|
|
105
|
+
defineCustomElement$2();
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
} });
|
|
109
|
+
}
|
|
110
|
+
defineCustomElement$1();
|
|
111
|
+
|
|
112
|
+
const PostTooltip = PostTooltip$1;
|
|
113
|
+
const defineCustomElement = defineCustomElement$1;
|
|
114
|
+
|
|
115
|
+
export { PostTooltip, defineCustomElement };
|
package/dist/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2025-
|
|
2
|
+
"timestamp": "2025-10-09T11:17:04",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.35.0",
|
|
@@ -215,15 +215,15 @@
|
|
|
215
215
|
"docsTags": [
|
|
216
216
|
{
|
|
217
217
|
"name": "part",
|
|
218
|
-
"text": "button - The
|
|
218
|
+
"text": "button - The element that toggles the accordion item (header button)."
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
221
|
"name": "part",
|
|
222
|
-
"text": "body - The
|
|
222
|
+
"text": "body - The container element that holds the accordion item's content."
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"name": "slot",
|
|
226
|
-
"text": "logo - Slot for
|
|
226
|
+
"text": "logo - Slot for placing a logo in the accordion item’s header, before the content."
|
|
227
227
|
},
|
|
228
228
|
{
|
|
229
229
|
"name": "slot",
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
},
|
|
379
379
|
{
|
|
380
380
|
"name": "logo",
|
|
381
|
-
"docs": "Slot for
|
|
381
|
+
"docs": "Slot for placing a logo in the accordion item’s header, before the content."
|
|
382
382
|
}
|
|
383
383
|
],
|
|
384
384
|
"parts": [
|
|
@@ -388,11 +388,11 @@
|
|
|
388
388
|
},
|
|
389
389
|
{
|
|
390
390
|
"name": "body",
|
|
391
|
-
"docs": "The
|
|
391
|
+
"docs": "The container element that holds the accordion item's content."
|
|
392
392
|
},
|
|
393
393
|
{
|
|
394
394
|
"name": "button",
|
|
395
|
-
"docs": "The
|
|
395
|
+
"docs": "The element that toggles the accordion item (header button)."
|
|
396
396
|
}
|
|
397
397
|
],
|
|
398
398
|
"dependents": [
|
|
@@ -418,7 +418,7 @@
|
|
|
418
418
|
"filePath": "src/components/post-avatar/post-avatar.tsx",
|
|
419
419
|
"encapsulation": "shadow",
|
|
420
420
|
"tag": "post-avatar",
|
|
421
|
-
"readme": "# post-avatar\n
|
|
421
|
+
"readme": "# post-avatar\n",
|
|
422
422
|
"docs": "",
|
|
423
423
|
"docsTags": [
|
|
424
424
|
{
|
|
@@ -428,6 +428,29 @@
|
|
|
428
428
|
],
|
|
429
429
|
"usage": {},
|
|
430
430
|
"props": [
|
|
431
|
+
{
|
|
432
|
+
"name": "description",
|
|
433
|
+
"type": "string",
|
|
434
|
+
"complexType": {
|
|
435
|
+
"original": "string",
|
|
436
|
+
"resolved": "string",
|
|
437
|
+
"references": {}
|
|
438
|
+
},
|
|
439
|
+
"mutable": false,
|
|
440
|
+
"attr": "description",
|
|
441
|
+
"reflectToAttr": false,
|
|
442
|
+
"docs": "Provides a custom description for the avatar, used for accessibility purposes.",
|
|
443
|
+
"docsTags": [],
|
|
444
|
+
"values": [
|
|
445
|
+
{
|
|
446
|
+
"type": "string"
|
|
447
|
+
}
|
|
448
|
+
],
|
|
449
|
+
"optional": true,
|
|
450
|
+
"required": false,
|
|
451
|
+
"getter": false,
|
|
452
|
+
"setter": false
|
|
453
|
+
},
|
|
431
454
|
{
|
|
432
455
|
"name": "email",
|
|
433
456
|
"type": "string",
|
|
@@ -702,7 +725,7 @@
|
|
|
702
725
|
],
|
|
703
726
|
"listeners": [
|
|
704
727
|
{
|
|
705
|
-
"event": "
|
|
728
|
+
"event": "click",
|
|
706
729
|
"capture": false,
|
|
707
730
|
"passive": false
|
|
708
731
|
}
|
|
@@ -1256,22 +1279,7 @@
|
|
|
1256
1279
|
"usage": {},
|
|
1257
1280
|
"props": [],
|
|
1258
1281
|
"methods": [],
|
|
1259
|
-
"events": [
|
|
1260
|
-
{
|
|
1261
|
-
"event": "postClick",
|
|
1262
|
-
"detail": "void",
|
|
1263
|
-
"bubbles": true,
|
|
1264
|
-
"complexType": {
|
|
1265
|
-
"original": "void",
|
|
1266
|
-
"resolved": "void",
|
|
1267
|
-
"references": {}
|
|
1268
|
-
},
|
|
1269
|
-
"cancelable": true,
|
|
1270
|
-
"composed": true,
|
|
1271
|
-
"docs": "An event emitted when the close button is clicked.\nIt has no payload.",
|
|
1272
|
-
"docsTags": []
|
|
1273
|
-
}
|
|
1274
|
-
],
|
|
1282
|
+
"events": [],
|
|
1275
1283
|
"listeners": [],
|
|
1276
1284
|
"styles": [],
|
|
1277
1285
|
"slots": [
|
|
@@ -2753,9 +2761,37 @@
|
|
|
2753
2761
|
"tag": "post-menu",
|
|
2754
2762
|
"readme": "# post-menu\n\n\n",
|
|
2755
2763
|
"docs": "",
|
|
2756
|
-
"docsTags": [
|
|
2764
|
+
"docsTags": [
|
|
2765
|
+
{
|
|
2766
|
+
"name": "part",
|
|
2767
|
+
"text": "menu - The container element that holds the list of menu items."
|
|
2768
|
+
}
|
|
2769
|
+
],
|
|
2757
2770
|
"usage": {},
|
|
2758
2771
|
"props": [
|
|
2772
|
+
{
|
|
2773
|
+
"name": "label",
|
|
2774
|
+
"type": "string",
|
|
2775
|
+
"complexType": {
|
|
2776
|
+
"original": "string",
|
|
2777
|
+
"resolved": "string",
|
|
2778
|
+
"references": {}
|
|
2779
|
+
},
|
|
2780
|
+
"mutable": false,
|
|
2781
|
+
"attr": "label",
|
|
2782
|
+
"reflectToAttr": false,
|
|
2783
|
+
"docs": "An accessible name for the menu.",
|
|
2784
|
+
"docsTags": [],
|
|
2785
|
+
"values": [
|
|
2786
|
+
{
|
|
2787
|
+
"type": "string"
|
|
2788
|
+
}
|
|
2789
|
+
],
|
|
2790
|
+
"optional": true,
|
|
2791
|
+
"required": false,
|
|
2792
|
+
"getter": false,
|
|
2793
|
+
"setter": false
|
|
2794
|
+
},
|
|
2759
2795
|
{
|
|
2760
2796
|
"name": "placement",
|
|
2761
2797
|
"type": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
@@ -2964,7 +3000,7 @@
|
|
|
2964
3000
|
"parts": [
|
|
2965
3001
|
{
|
|
2966
3002
|
"name": "menu",
|
|
2967
|
-
"docs": ""
|
|
3003
|
+
"docs": "The container element that holds the list of menu items."
|
|
2968
3004
|
}
|
|
2969
3005
|
],
|
|
2970
3006
|
"dependents": [
|
|
@@ -3712,16 +3748,16 @@
|
|
|
3712
3748
|
"events": [
|
|
3713
3749
|
{
|
|
3714
3750
|
"event": "postToggle",
|
|
3715
|
-
"detail": "boolean",
|
|
3751
|
+
"detail": "{ isOpen: boolean; first?: boolean; }",
|
|
3716
3752
|
"bubbles": true,
|
|
3717
3753
|
"complexType": {
|
|
3718
|
-
"original": "boolean",
|
|
3719
|
-
"resolved": "boolean",
|
|
3754
|
+
"original": "{ isOpen: boolean; first?: boolean }",
|
|
3755
|
+
"resolved": "{ isOpen: boolean; first?: boolean; }",
|
|
3720
3756
|
"references": {}
|
|
3721
3757
|
},
|
|
3722
3758
|
"cancelable": true,
|
|
3723
3759
|
"composed": true,
|
|
3724
|
-
"docs": "Fires whenever the popovercontainer gets shown or hidden, passing the
|
|
3760
|
+
"docs": "Fires whenever the popovercontainer gets shown or hidden, passing in event.detail an object containing two booleans: `isOpen`, which is true if the popovercontainer was opened and false if it was closed, and `first`, which is true if it was opened for the first time.",
|
|
3725
3761
|
"docsTags": []
|
|
3726
3762
|
}
|
|
3727
3763
|
],
|
|
@@ -4046,11 +4082,11 @@
|
|
|
4046
4082
|
},
|
|
4047
4083
|
{
|
|
4048
4084
|
"name": "part",
|
|
4049
|
-
"text": "tabs -
|
|
4085
|
+
"text": "tabs - The container element that holds the set of tabs."
|
|
4050
4086
|
},
|
|
4051
4087
|
{
|
|
4052
4088
|
"name": "part",
|
|
4053
|
-
"text": "content -
|
|
4089
|
+
"text": "content - The container element that displays the content of the currently active tab."
|
|
4054
4090
|
}
|
|
4055
4091
|
],
|
|
4056
4092
|
"usage": {},
|
|
@@ -4184,11 +4220,11 @@
|
|
|
4184
4220
|
"parts": [
|
|
4185
4221
|
{
|
|
4186
4222
|
"name": "content",
|
|
4187
|
-
"docs": "
|
|
4223
|
+
"docs": "The container element that displays the content of the currently active tab."
|
|
4188
4224
|
},
|
|
4189
4225
|
{
|
|
4190
4226
|
"name": "tabs",
|
|
4191
|
-
"docs": "
|
|
4227
|
+
"docs": "The container element that holds the set of tabs."
|
|
4192
4228
|
}
|
|
4193
4229
|
],
|
|
4194
4230
|
"dependents": [],
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates if an event should be processed based on target and nesting criteria
|
|
3
|
+
* @param event - The event to validate
|
|
4
|
+
* @param tag - The expected local name of the event target
|
|
5
|
+
* @param host - The host element for nested component checking
|
|
6
|
+
* @param ignoreNestedComponents - Whether to ignore events from nested components
|
|
7
|
+
* @returns true if the event should be processed, false otherwise
|
|
8
|
+
*/
|
|
9
|
+
function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
|
|
10
|
+
if (!(event instanceof Event && event.target instanceof HTMLElement))
|
|
11
|
+
return false;
|
|
12
|
+
const eventTarget = event.target;
|
|
13
|
+
if (eventTarget.localName !== tag)
|
|
14
|
+
return false;
|
|
15
|
+
if (ignoreNestedComponents) {
|
|
16
|
+
// Find the closest parent with the same tag as the host
|
|
17
|
+
const closestParentWithSameTag = findClosestParentWithTag(eventTarget, host.localName);
|
|
18
|
+
if (closestParentWithSameTag !== host)
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Decorator that guards event handlers to only execute when the event meets certain criteria.
|
|
25
|
+
* @param tag - The local name of the element that should be the target of the event
|
|
26
|
+
* @param option - Configuration options for the event guard
|
|
27
|
+
* @param option.ignoreNestedComponents - Whether to ignore events from nested components
|
|
28
|
+
*/
|
|
29
|
+
function EventFrom(tag, option = { ignoreNestedComponents: true }) {
|
|
30
|
+
return function (target, propertyKey, descriptor) {
|
|
31
|
+
if (descriptor) {
|
|
32
|
+
const originalMethod = descriptor.value;
|
|
33
|
+
descriptor.value = function (event) {
|
|
34
|
+
if (!shouldProcessEvent(event, tag, this.host, option.ignoreNestedComponents)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
return originalMethod.call(this, event);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// Creates a hidden storage property for the original method using a
|
|
42
|
+
// modified key format (__[property]_original) to avoid naming conflicts
|
|
43
|
+
const privateKey = `__${propertyKey}_original`;
|
|
44
|
+
// Create hidden storage for original method
|
|
45
|
+
Object.defineProperty(target, privateKey, {
|
|
46
|
+
writable: true,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
// Replace property with getter/setter
|
|
50
|
+
Object.defineProperty(target, propertyKey, {
|
|
51
|
+
// Getter returns original method
|
|
52
|
+
get() {
|
|
53
|
+
return this[privateKey];
|
|
54
|
+
},
|
|
55
|
+
// Setter wraps original method with extra code
|
|
56
|
+
set(originalFunction) {
|
|
57
|
+
if (typeof originalFunction === 'function') {
|
|
58
|
+
// Store original and add new behavior
|
|
59
|
+
this[privateKey] = (event) => {
|
|
60
|
+
if (!shouldProcessEvent(event, tag, this.host, option.ignoreNestedComponents)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
return originalFunction.call(this, event);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
this[privateKey] = originalFunction;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
configurable: true,
|
|
71
|
+
enumerable: true
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Traverses up the DOM (including crossing shadow DOM boundaries) to find the closest ancestor
|
|
78
|
+
* that matches the specified tag name.
|
|
79
|
+
* @param element - The starting element
|
|
80
|
+
* @param tagName - The tag name to match (e.g., 'post-accordion')
|
|
81
|
+
* @returns The closest matching ancestor or null if none found
|
|
82
|
+
*/
|
|
83
|
+
function findClosestParentWithTag(element, tagName) {
|
|
84
|
+
let current = element;
|
|
85
|
+
while (current) {
|
|
86
|
+
if (current.localName === tagName) {
|
|
87
|
+
return current;
|
|
88
|
+
}
|
|
89
|
+
// Check regular parent first
|
|
90
|
+
if (current.parentElement) {
|
|
91
|
+
current = current.parentElement;
|
|
92
|
+
}
|
|
93
|
+
// If no parentElement, check if we're in a shadow root
|
|
94
|
+
else if (current.parentNode instanceof ShadowRoot) {
|
|
95
|
+
current = current.parentNode.host;
|
|
96
|
+
}
|
|
97
|
+
// No more parents to check
|
|
98
|
+
else {
|
|
99
|
+
current = null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { EventFrom as E };
|
|
@@ -94,10 +94,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
94
94
|
}
|
|
95
95
|
switch(bundleId) {
|
|
96
96
|
|
|
97
|
-
case 'post-avatar':
|
|
98
|
-
return import(
|
|
99
|
-
/* webpackMode: "lazy" */
|
|
100
|
-
'./post-avatar.entry.js').then(processMod, consoleError);
|
|
101
97
|
case 'post-card-control':
|
|
102
98
|
return import(
|
|
103
99
|
/* webpackMode: "lazy" */
|
|
@@ -126,6 +122,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
126
122
|
return import(
|
|
127
123
|
/* webpackMode: "lazy" */
|
|
128
124
|
'./post-tooltip.entry.js').then(processMod, consoleError);
|
|
125
|
+
case 'post-avatar':
|
|
126
|
+
return import(
|
|
127
|
+
/* webpackMode: "lazy" */
|
|
128
|
+
'./post-avatar.entry.js').then(processMod, consoleError);
|
|
129
129
|
case 'post-back-to-top':
|
|
130
130
|
return import(
|
|
131
131
|
/* webpackMode: "lazy" */
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const EMPTY_VALUES = [undefined, null, '', NaN];
|
|
2
|
+
|
|
3
|
+
function isValueEmpty(value) {
|
|
4
|
+
return EMPTY_VALUES.some(v => v === value);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function requiredAnd(check) {
|
|
8
|
+
return (component, prop, ...extraArgs) => {
|
|
9
|
+
const componentName = component.host.localName;
|
|
10
|
+
const value = component[prop];
|
|
11
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component is not defined.`;
|
|
12
|
+
if (isValueEmpty(value)) {
|
|
13
|
+
throw new Error(message);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
check(component, prop, ...extraArgs);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function checkOneOf(component, prop, possibleValues) {
|
|
22
|
+
const componentName = component.host.localName;
|
|
23
|
+
const value = component[prop];
|
|
24
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
|
|
25
|
+
if (!possibleValues.includes(value)) {
|
|
26
|
+
console.error(message);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function checkPattern(component, prop, pattern) {
|
|
31
|
+
const componentName = component.host.localName;
|
|
32
|
+
const value = component[prop];
|
|
33
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must follow the format \`${pattern}\`.`;
|
|
34
|
+
if (typeof value !== 'string' || !pattern.test(value)) {
|
|
35
|
+
console.error(message);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function checkType(component, prop, type) {
|
|
40
|
+
const componentName = component.host.localName;
|
|
41
|
+
const value = component[prop];
|
|
42
|
+
const typeIsArray = type === 'array';
|
|
43
|
+
const valueIsArray = Array.isArray(value);
|
|
44
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`${type}\`.`;
|
|
45
|
+
if (typeIsArray || valueIsArray) {
|
|
46
|
+
if (valueIsArray !== typeIsArray) {
|
|
47
|
+
console.error(message);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else if (typeof value !== type) {
|
|
51
|
+
console.error(message);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function checkUrl(component, prop) {
|
|
56
|
+
const componentName = component.host.localName;
|
|
57
|
+
const value = component[prop];
|
|
58
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
|
|
59
|
+
if (typeof value !== 'string' && !(value instanceof URL)) {
|
|
60
|
+
console.error(message);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
new URL(value, 'https://www.post.ch');
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
console.error(message);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function emptyOr(check) {
|
|
72
|
+
return (component, prop, ...extraArgs) => {
|
|
73
|
+
const value = component[prop];
|
|
74
|
+
if (!isValueEmpty(value)) {
|
|
75
|
+
check(component, prop, ...extraArgs);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const checkEmptyOrOneOf = emptyOr(checkOneOf);
|
|
81
|
+
const checkEmptyOrPattern = emptyOr(checkPattern);
|
|
82
|
+
const checkEmptyOrType = emptyOr(checkType);
|
|
83
|
+
const checkEmptyOrUrl = emptyOr(checkUrl);
|
|
84
|
+
const checkRequiredAndOneOf = requiredAnd(checkOneOf);
|
|
85
|
+
const checkRequiredAndType = requiredAnd(checkType);
|
|
86
|
+
const checkRequiredAndUrl = requiredAnd(checkUrl);
|
|
87
|
+
|
|
88
|
+
export { checkEmptyOrType as a, checkRequiredAndOneOf as b, checkRequiredAndType as c, checkEmptyOrOneOf as d, checkEmptyOrPattern as e, checkRequiredAndUrl as f, checkEmptyOrUrl as g };
|
package/dist/esm/loader.js
CHANGED
|
@@ -4,7 +4,7 @@ export { s as setNonce } from './index-C8a0ddDa.js';
|
|
|
4
4
|
const defineCustomElements = async (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
6
|
await globalScripts();
|
|
7
|
-
return bootstrapLazy([["post-breadcrumbs",[[1,"post-breadcrumbs",{"homeUrl":[1,"home-url"],"homeText":[1,"home-text"],"breadcrumbItems":[32],"isConcatenated":[32],"lastWindowWidth":[32]},null,{"homeUrl":["validateHomeUrl"],"homeText":["validateHomeText"]}]]],["post-footer",[[1,"post-footer",{"label":[1],"device":[32],"gridSlotDisplayed":[32]},null,{"label":["validateLabel"]}]]],["post-back-to-top",[[1,"post-back-to-top",{"label":[513],"belowFold":[32]},null,{"label":["validateLabel"],"belowFold":["watchBelowFold"]}]]],["post-card-control",[[65,"post-card-control",{"label":[513],"description":[1],"type":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[1028],"validity":[1028],"icon":[1],"focused":[32],"reset":[64],"groupReset":[64]},null,{"label":["validateControlLabel"],"description":["validateControlDescription"],"type":["validateControlType"],"name":["validateControlName"],"value":["validateControlValue"],"icon":["validateControlIcon"],"checked":["updateControlChecked"],"disabled":["updateControlDisabled"]}]]],["post-popover",[[1,"post-popover",{"placement":[1],"closeButtonCaption":[1,"close-button-caption"],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"],"closeButtonCaption":["validateCloseButtonCaption"]}]]],["post-rating",[[1,"post-rating",{"label":[1],"stars":[2],"currentRating":[1026,"current-rating"],"readonly":[4],"hoveredIndex":[32]},null,{"label":["validateLabel"],"stars":["validateStars"],"currentRating":["validateCurrentRating"]}]]],["post-tooltip",[[1,"post-tooltip",{"placement":[1],"arrow":[4],"animation":[1],"open":[1540],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"]}]]],["post-avatar",[[1,"post-avatar",{"firstname":[513],"lastname":[1],"userid":[1],"email":[1],"slottedImage":[32],"avatarType":[32],"imageUrl":[32],"imageAlt":[32],"initials":[32]},null,{"firstname":["validateFirstname"],"lastname":["validateLastname"],"userid":["
|
|
7
|
+
return bootstrapLazy([["post-breadcrumbs",[[1,"post-breadcrumbs",{"homeUrl":[1,"home-url"],"homeText":[1,"home-text"],"breadcrumbItems":[32],"isConcatenated":[32],"lastWindowWidth":[32]},null,{"homeUrl":["validateHomeUrl"],"homeText":["validateHomeText"]}]]],["post-footer",[[1,"post-footer",{"label":[1],"device":[32],"gridSlotDisplayed":[32]},null,{"label":["validateLabel"]}]]],["post-back-to-top",[[1,"post-back-to-top",{"label":[513],"belowFold":[32]},null,{"label":["validateLabel"],"belowFold":["watchBelowFold"]}]]],["post-card-control",[[65,"post-card-control",{"label":[513],"description":[1],"type":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[1028],"validity":[1028],"icon":[1],"focused":[32],"reset":[64],"groupReset":[64]},null,{"label":["validateControlLabel"],"description":["validateControlDescription"],"type":["validateControlType"],"name":["validateControlName"],"value":["validateControlValue"],"icon":["validateControlIcon"],"checked":["updateControlChecked"],"disabled":["updateControlDisabled"]}]]],["post-popover",[[1,"post-popover",{"placement":[1],"closeButtonCaption":[1,"close-button-caption"],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"],"closeButtonCaption":["validateCloseButtonCaption"]}]]],["post-rating",[[1,"post-rating",{"label":[1],"stars":[2],"currentRating":[1026,"current-rating"],"readonly":[4],"hoveredIndex":[32]},null,{"label":["validateLabel"],"stars":["validateStars"],"currentRating":["validateCurrentRating"]}]]],["post-tooltip",[[1,"post-tooltip",{"placement":[1],"arrow":[4],"animation":[1],"open":[1540],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"]}]]],["post-avatar",[[1,"post-avatar",{"firstname":[513],"lastname":[1],"userid":[1],"email":[1],"description":[1],"slottedImage":[32],"avatarType":[32],"imageUrl":[32],"imageAlt":[32],"initials":[32],"storageKey":[32]},null,{"firstname":["validateFirstname"],"lastname":["validateLastname"],"userid":["updateUserid"],"email":["updateEmail"],"description":["validateDescription"]}]]],["post-banner",[[1,"post-banner",{"type":[513],"hasActions":[32],"dismiss":[64]},[[0,"click","onCloseButtonClick"]],{"type":["validateType"]}]]],["post-linkarea",[[1,"post-linkarea",{"interactiveElements":[32]}]]],["post-tab-header",[[1,"post-tab-header",{"panel":[513],"tabId":[32]},null,{"panel":["validateFor"]}]]],["post-tab-panel",[[1,"post-tab-panel",{"name":[513],"panelId":[32]},null,{"name":["validateName"]}]]],["post-tabs",[[1,"post-tabs",{"activePanel":[1,"active-panel"],"fullWidth":[516,"full-width"],"show":[64]}]]],["post-tooltip-trigger",[[1,"post-tooltip-trigger",{"for":[513],"delay":[2]},null,{"for":["validateControlFor"]}]]],["post-collapsible_2",[[1,"post-collapsible",{"collapsed":[1028],"toggle":[64]},null,{"collapsed":["collapsedChange"]}],[1,"post-collapsible-trigger",{"for":[513],"update":[64]},null,{"for":["validateAriaAttributes"]}]]],["post-closebutton_15",[[1,"post-language-switch",{"caption":[1],"description":[1],"variant":[1],"activeLang":[32]},[[0,"postChange","handlePostChange"],[0,"postLanguageOptionInitiallyActive","handleInitiallyActive"]],{"caption":["validateCaption"],"description":["validateDescription"],"variant":["validateVariant"]}],[1,"post-closebutton"],[4,"post-mainnavigation",{"canScrollLeft":[32],"canScrollRight":[32]},[[9,"mouseup","stopScrolling"],[9,"mouseleave","stopScrolling"]]],[1,"post-header",{"device":[32],"hasNavigation":[32],"hasTitle":[32],"mobileMenuExtended":[32],"megadropdownOpen":[32],"toggleMobileMenu":[64]},null,{"device":["lockBody"],"mobileMenuExtended":["lockBody"]}],[4,"post-language-option",{"code":[1],"active":[1540],"variant":[1],"name":[1],"url":[1],"select":[64]},null,{"code":["validateCode"],"variant":["validateVariant"],"name":["validateName"],"url":["validateUrl"]}],[4,"post-list",{"titleHidden":[4,"title-hidden"],"horizontal":[516],"titleId":[32]}],[1,"post-list-item"],[1,"post-logo",{"url":[1]},null,{"url":["validateUrl"]}],[4,"post-megadropdown",{"device":[32],"isVisible":[32],"trigger":[32],"animationClass":[32],"toggle":[64],"show":[64],"hide":[64],"focusFirst":[64]}],[4,"post-megadropdown-trigger",{"for":[1],"ariaExpanded":[32]},null,{"for":["validateControlFor"]}],[1,"post-togglebutton",{"toggled":[1028]}],[1,"post-menu",{"placement":[1],"label":[1],"isVisible":[32],"toggle":[64],"show":[64],"hide":[64]},null,{"placement":["validatePlacement"]}],[4,"post-menu-trigger",{"for":[513],"ariaExpanded":[32]},null,{"for":["validateControlFor"]}],[4,"post-popovercontainer",{"placement":[1],"edgeGap":[2,"edge-gap"],"animation":[1],"arrow":[4],"manualClose":[4,"manual-close"],"safeSpace":[513,"safe-space"],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"],"edgeGap":["validateEdgeGap"],"safeSpace":["validateSafeSpace"]}],[1,"post-icon",{"animation":[1],"base":[1],"flipH":[4,"flip-h"],"flipV":[4,"flip-v"],"name":[513],"rotate":[2],"scale":[2]},null,{"animation":["validateAnimation"],"base":["validateBase"],"name":["validateName"],"rotate":["validateRotate"],"scale":["validateScale"]}]]],["post-accordion_2",[[1,"post-accordion-item",{"collapsed":[1028],"headingLevel":[2,"heading-level"],"id":[32],"slottedLogo":[32],"toggle":[64]},[[2,"postToggle","onCollapseToggle"]],{"headingLevel":["validateHeadingLevel"]}],[1,"post-accordion",{"headingLevel":[2,"heading-level"],"multiple":[4],"toggle":[64],"expandAll":[64],"collapseAll":[64]},[[0,"postToggle","collapseToggleHandler"]],{"headingLevel":["validateHeadingLevel"]}]]],["post-breadcrumb-item_2",[[1,"post-breadcrumb-item",{"url":[1],"fullUrl":[32]},null,{"url":["validateUrl"]}],[4,"post-menu-item"]]]], options);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { defineCustomElements };
|