@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
package/hydrate/index.js
CHANGED
|
@@ -3229,7 +3229,7 @@ var registerHost = (elm, cmpMeta) => {
|
|
|
3229
3229
|
};
|
|
3230
3230
|
var styles = /* @__PURE__ */ new Map();
|
|
3231
3231
|
|
|
3232
|
-
const version$1 = "10.0.0-next.
|
|
3232
|
+
const version$1 = "10.0.0-next.48";
|
|
3233
3233
|
|
|
3234
3234
|
const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
|
|
3235
3235
|
|
|
@@ -3610,7 +3610,7 @@ function debounce(callback, timeout = 200) {
|
|
|
3610
3610
|
* @returns true if the event should be processed, false otherwise
|
|
3611
3611
|
*/
|
|
3612
3612
|
function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
|
|
3613
|
-
if (!(event instanceof
|
|
3613
|
+
if (!(event instanceof Event && event.target instanceof HTMLElement))
|
|
3614
3614
|
return false;
|
|
3615
3615
|
const eventTarget = event.target;
|
|
3616
3616
|
if (eventTarget.localName !== tag)
|
|
@@ -3641,7 +3641,7 @@ function EventFrom(tag, option = { ignoreNestedComponents: true }) {
|
|
|
3641
3641
|
};
|
|
3642
3642
|
}
|
|
3643
3643
|
else {
|
|
3644
|
-
// Creates a hidden storage property for the original method using a
|
|
3644
|
+
// Creates a hidden storage property for the original method using a
|
|
3645
3645
|
// modified key format (__[property]_original) to avoid naming conflicts
|
|
3646
3646
|
const privateKey = `__${propertyKey}_original`;
|
|
3647
3647
|
// Create hidden storage for original method
|
|
@@ -3883,9 +3883,9 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
3883
3883
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3884
3884
|
};
|
|
3885
3885
|
/**
|
|
3886
|
-
* @part button - The
|
|
3887
|
-
* @part body - The
|
|
3888
|
-
* @slot logo - Slot for
|
|
3886
|
+
* @part button - The element that toggles the accordion item (header button).
|
|
3887
|
+
* @part body - The container element that holds the accordion item's content.
|
|
3888
|
+
* @slot logo - Slot for placing a logo in the accordion item’s header, before the content.
|
|
3889
3889
|
* @slot header - Slot for placing custom content within the accordion item's header.
|
|
3890
3890
|
* @slot default - Slot for placing content within the accordion item's body.
|
|
3891
3891
|
*/
|
|
@@ -3925,10 +3925,10 @@ class PostAccordionItem {
|
|
|
3925
3925
|
render() {
|
|
3926
3926
|
const headingLevel = this.host.closest('post-accordion')?.getAttribute('heading-level');
|
|
3927
3927
|
const HeadingTag = `h${headingLevel ?? this.headingLevel ?? 2}`;
|
|
3928
|
-
return (hAsync(Host, { key: '
|
|
3928
|
+
return (hAsync(Host, { key: 'b98847d19894430b6f65130aebf8673a45afd1e6', id: this.id, "data-version": version$1 }, hAsync("div", { key: 'f26f9d3a4a1f59db23b4698b321e28e112c3eed0', part: "accordion-item", class: "accordion-item" }, hAsync("post-collapsible-trigger", { key: '14bdacce04d67a03655f600feeaeec065e0fc198', for: `${this.id}--collapse` }, hAsync(HeadingTag, { key: '7a07a70d172306ce37f8bd0143b21ed7ec0cab8a', class: "accordion-header", id: `${this.id}--header` }, hAsync("button", { key: '5ad0698a62df5c4b2c0a77ff622090b20f348e9c', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}`, part: "button" }, hAsync("span", { key: '6e5fcb0c9efa8a57e05fd162c72b9c170a8210c6', class: {
|
|
3929
3929
|
'logo-container': true,
|
|
3930
3930
|
'has-image': !!this.slottedLogo,
|
|
3931
|
-
} }, hAsync("slot", { key: '
|
|
3931
|
+
} }, hAsync("slot", { key: '41a1409f723bf52de893324ce45d4e7f31eb8908', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), hAsync("slot", { key: '7186adfe4a4fe67f4dbaeb7569820d0d06c18428', name: "header" }), hAsync("post-icon", { key: 'fbfcbdc9947a8c7cf80d861aba3a77be0dff91d1', name: "2051" })))), hAsync("post-collapsible", { key: '5de19aab5eb0134b7c3e7f43e5c2da0cb8413908', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, hAsync("div", { key: '5112ba8604ea177af4d88033f682c2a4cc6c4ffd', class: "accordion-body", part: "body" }, hAsync("slot", { key: 'd70ab76842fced3f7dec812471685071e377bc61' }))))));
|
|
3932
3932
|
}
|
|
3933
3933
|
get host() { return getElement(this); }
|
|
3934
3934
|
static get watchers() { return {
|
|
@@ -3954,13 +3954,14 @@ __decorate$6([
|
|
|
3954
3954
|
EventFrom('post-accordion-item')
|
|
3955
3955
|
], PostAccordionItem.prototype, "onCollapseToggle", null);
|
|
3956
3956
|
|
|
3957
|
-
const postAvatarCss = "@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{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:\"\";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
3958
|
-
|
|
3959
3957
|
// https://docs.gravatar.com/api/avatars/images/
|
|
3960
3958
|
const GRAVATAR_DEFAULT = '404';
|
|
3961
3959
|
const GRAVATAR_RATING = 'g';
|
|
3962
3960
|
const GRAVATAR_SIZE = 80;
|
|
3963
3961
|
const GRAVATAR_BASE_URL = `https://www.gravatar.com/avatar/{email}?s=${GRAVATAR_SIZE}&d=${GRAVATAR_DEFAULT}&r=${GRAVATAR_RATING}`;
|
|
3962
|
+
|
|
3963
|
+
const postAvatarCss = "@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{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:\"\";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
3964
|
+
|
|
3964
3965
|
const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
3965
3966
|
var AvatarType;
|
|
3966
3967
|
(function (AvatarType) {
|
|
@@ -3979,6 +3980,8 @@ class PostAvatar {
|
|
|
3979
3980
|
this.imageUrl = '';
|
|
3980
3981
|
this.imageAlt = '';
|
|
3981
3982
|
this.initials = '';
|
|
3983
|
+
// To handle email or userid updates and reset the storage item
|
|
3984
|
+
this.storageKey = '';
|
|
3982
3985
|
}
|
|
3983
3986
|
validateFirstname() {
|
|
3984
3987
|
checkRequiredAndType(this, 'firstname', 'string');
|
|
@@ -3986,47 +3989,67 @@ class PostAvatar {
|
|
|
3986
3989
|
validateLastname() {
|
|
3987
3990
|
checkEmptyOrType(this, 'lastname', 'string');
|
|
3988
3991
|
}
|
|
3989
|
-
|
|
3992
|
+
updateUserid() {
|
|
3993
|
+
this.validateUserId();
|
|
3994
|
+
this.getAvatarImage();
|
|
3995
|
+
}
|
|
3996
|
+
updateEmail() {
|
|
3997
|
+
this.validateEmail();
|
|
3998
|
+
this.getAvatarImage();
|
|
3999
|
+
}
|
|
4000
|
+
validateUserId() {
|
|
3990
4001
|
checkEmptyOrType(this, 'userid', 'string');
|
|
3991
4002
|
}
|
|
3992
4003
|
validateEmail() {
|
|
3993
4004
|
if (this.email)
|
|
3994
4005
|
checkEmptyOrPattern(this, 'email', emailPattern);
|
|
3995
4006
|
}
|
|
3996
|
-
async
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
if (!imageLoaded && this.userid)
|
|
4007
|
+
async getAvatarImage() {
|
|
4008
|
+
let imageLoaded = false;
|
|
4009
|
+
this.slottedImage = this.host.querySelector('img');
|
|
4010
|
+
const imageUrl = this.slottedImage?.getAttribute('src');
|
|
4011
|
+
if (!imageUrl) {
|
|
4012
|
+
if (this.userid) {
|
|
4003
4013
|
imageLoaded = await this.getImageByProp(this.userid, this.fetchImageByUserId.bind(this));
|
|
4004
|
-
|
|
4014
|
+
}
|
|
4015
|
+
if (!imageLoaded && this.email?.match(emailPattern)) {
|
|
4005
4016
|
imageLoaded = await this.getImageByProp(this.email, this.fetchImageByEmail.bind(this));
|
|
4006
|
-
|
|
4007
|
-
|
|
4017
|
+
}
|
|
4018
|
+
if (!imageLoaded) {
|
|
4019
|
+
this.getAvatarInitials();
|
|
4020
|
+
}
|
|
4021
|
+
}
|
|
4022
|
+
else {
|
|
4023
|
+
const slottedImageLoaded = await this.getImageByProp(imageUrl, this.fetchSlottedImage.bind(this));
|
|
4024
|
+
if (!slottedImageLoaded) {
|
|
4025
|
+
this.slottedImage.style.display = 'none';
|
|
4026
|
+
this.getAvatarInitials();
|
|
4027
|
+
}
|
|
4028
|
+
else {
|
|
4029
|
+
this.slottedImage.style.display = 'block';
|
|
4030
|
+
}
|
|
4008
4031
|
}
|
|
4009
4032
|
}
|
|
4010
4033
|
async getImageByProp(prop, fetchImage) {
|
|
4011
4034
|
if (!prop)
|
|
4012
4035
|
return false;
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4036
|
+
let imageResponse;
|
|
4037
|
+
try {
|
|
4038
|
+
imageResponse = await fetchImage(prop);
|
|
4039
|
+
}
|
|
4040
|
+
catch (error) {
|
|
4041
|
+
console.info('Loading avatar image failed.', error);
|
|
4042
|
+
return false;
|
|
4043
|
+
}
|
|
4044
|
+
if (!imageResponse?.ok) {
|
|
4045
|
+
return false;
|
|
4046
|
+
}
|
|
4047
|
+
else {
|
|
4048
|
+
this.imageUrl = imageResponse.url;
|
|
4049
|
+
this.imageAlt = `${this.firstname} ${this.lastname} avatar`;
|
|
4050
|
+
this.avatarType = AvatarType.Image;
|
|
4051
|
+
return true;
|
|
4028
4052
|
}
|
|
4029
|
-
return imageResponse.ok;
|
|
4030
4053
|
}
|
|
4031
4054
|
async fetchImageByUserId() {
|
|
4032
4055
|
return await fetch(PostAvatar.INTERNAL_USERID_IMAGE_SRC.replace('{userid}', encodeURIComponent(this.userid)));
|
|
@@ -4036,7 +4059,10 @@ class PostAvatar {
|
|
|
4036
4059
|
const imageUrl = GRAVATAR_BASE_URL.replace('{email}', email);
|
|
4037
4060
|
return await fetch(imageUrl);
|
|
4038
4061
|
}
|
|
4039
|
-
|
|
4062
|
+
async fetchSlottedImage(imageUrl) {
|
|
4063
|
+
return await fetch(imageUrl, { method: 'HEAD' });
|
|
4064
|
+
}
|
|
4065
|
+
getAvatarInitials() {
|
|
4040
4066
|
this.initials = this.getInitials();
|
|
4041
4067
|
this.avatarType = AvatarType.Initials;
|
|
4042
4068
|
}
|
|
@@ -4049,19 +4075,6 @@ class PostAvatar {
|
|
|
4049
4075
|
.join('')
|
|
4050
4076
|
.trim();
|
|
4051
4077
|
}
|
|
4052
|
-
async getStorageItem(keyToken) {
|
|
4053
|
-
const key = await this.cryptify(keyToken);
|
|
4054
|
-
const value = window?.sessionStorage?.getItem(key);
|
|
4055
|
-
return value ? JSON.parse(value) : null;
|
|
4056
|
-
}
|
|
4057
|
-
async setStorageItem(keyToken, value) {
|
|
4058
|
-
const key = await this.cryptify(keyToken);
|
|
4059
|
-
window?.sessionStorage?.setItem(key, value);
|
|
4060
|
-
}
|
|
4061
|
-
async removeStorageItem(keyToken) {
|
|
4062
|
-
const key = await this.cryptify(keyToken);
|
|
4063
|
-
window?.sessionStorage?.removeItem(key);
|
|
4064
|
-
}
|
|
4065
4078
|
async cryptify(key) {
|
|
4066
4079
|
return await crypto.subtle.digest('SHA-256', new TextEncoder().encode(key)).then(buffer => {
|
|
4067
4080
|
return Array.from(new Uint8Array(buffer))
|
|
@@ -4069,18 +4082,42 @@ class PostAvatar {
|
|
|
4069
4082
|
.join('');
|
|
4070
4083
|
});
|
|
4071
4084
|
}
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4085
|
+
slotChanged() {
|
|
4086
|
+
const slot = this.host.shadowRoot.querySelector('slot');
|
|
4087
|
+
const assignedNodes = slot?.assignedNodes({ flatten: true }) || [];
|
|
4088
|
+
assignedNodes.forEach(node => {
|
|
4089
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
4090
|
+
const el = node;
|
|
4091
|
+
if (el.tagName === 'IMG') {
|
|
4092
|
+
this.observeImageSrcChanges(el);
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
});
|
|
4096
|
+
this.getAvatarImage();
|
|
4075
4097
|
}
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
this.
|
|
4098
|
+
// Observe the Slotted image src attribute and update the image
|
|
4099
|
+
observeImageSrcChanges(img) {
|
|
4100
|
+
if (this.slottedImageObserver) {
|
|
4101
|
+
this.slottedImageObserver.disconnect();
|
|
4102
|
+
}
|
|
4103
|
+
this.slottedImageObserver = new MutationObserver(mutations => {
|
|
4104
|
+
mutations.forEach(mutation => {
|
|
4105
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'src') {
|
|
4106
|
+
this.getAvatarImage();
|
|
4107
|
+
}
|
|
4108
|
+
});
|
|
4109
|
+
});
|
|
4110
|
+
this.slottedImageObserver.observe(img, { attributes: true, attributeFilter: ['src'] });
|
|
4111
|
+
}
|
|
4112
|
+
connectedCallback() {
|
|
4113
|
+
//This provides a fallback by showing the initials while the image is still loading or delayed.
|
|
4114
|
+
this.getAvatarInitials();
|
|
4115
|
+
this.getAvatarImage();
|
|
4079
4116
|
}
|
|
4080
4117
|
componentDidLoad() {
|
|
4081
4118
|
this.validateFirstname();
|
|
4082
4119
|
this.validateLastname();
|
|
4083
|
-
this.
|
|
4120
|
+
this.validateUserId();
|
|
4084
4121
|
this.validateEmail();
|
|
4085
4122
|
}
|
|
4086
4123
|
render() {
|
|
@@ -4092,14 +4129,14 @@ class PostAvatar {
|
|
|
4092
4129
|
// eslint-disable-next-line @stencil-community/render-returns-host
|
|
4093
4130
|
return acc;
|
|
4094
4131
|
}, []);
|
|
4095
|
-
return (hAsync(Host, { "data-version": version$1 }, hAsync("slot", { onSlotchange: this.
|
|
4132
|
+
return (hAsync(Host, { "data-version": version$1 }, hAsync("span", { class: this.avatarType === 'slotted' ? '' : 'd-none' }, hAsync("slot", { onSlotchange: this.slotChanged.bind(this) })), this.avatarType === 'image' && hAsync("img", { src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && hAsync("div", { class: "initials" }, initials)));
|
|
4096
4133
|
}
|
|
4097
4134
|
get host() { return getElement(this); }
|
|
4098
4135
|
static get watchers() { return {
|
|
4099
4136
|
"firstname": ["validateFirstname"],
|
|
4100
4137
|
"lastname": ["validateLastname"],
|
|
4101
|
-
"userid": ["
|
|
4102
|
-
"email": ["
|
|
4138
|
+
"userid": ["updateUserid"],
|
|
4139
|
+
"email": ["updateEmail"]
|
|
4103
4140
|
}; }
|
|
4104
4141
|
static get style() { return postAvatarCss; }
|
|
4105
4142
|
static get cmpMeta() { return {
|
|
@@ -4114,7 +4151,8 @@ class PostAvatar {
|
|
|
4114
4151
|
"avatarType": [32],
|
|
4115
4152
|
"imageUrl": [32],
|
|
4116
4153
|
"imageAlt": [32],
|
|
4117
|
-
"initials": [32]
|
|
4154
|
+
"initials": [32],
|
|
4155
|
+
"storageKey": [32]
|
|
4118
4156
|
},
|
|
4119
4157
|
"$listeners$": undefined,
|
|
4120
4158
|
"$lazyBundleId$": "-",
|
|
@@ -4312,7 +4350,7 @@ class PostBanner {
|
|
|
4312
4350
|
this.hasActions = this.host.querySelectorAll('[slot="actions"]').length > 0;
|
|
4313
4351
|
}
|
|
4314
4352
|
render() {
|
|
4315
|
-
return (hAsync(Host, { key: '
|
|
4353
|
+
return (hAsync(Host, { key: 'e15185f83fd0da3aa39b2b5272e4326ecd77ee9d', "data-version": version$1, role: "alert" }, hAsync("slot", { key: '328dd1643a38643593ef79b5416b6f4b49e4eeef', name: "close-button" }), hAsync("slot", { key: '37ba09740a254eb559e5035dc2611849c1d01993', name: "heading" }), hAsync("slot", { key: '705fe8a24b3d31cce0637bea745128393aeee121' }), this.hasActions && (hAsync("div", { key: '296f89787a5f497fc835d88931b0784ab9c7ace9', class: "actions" }, hAsync("slot", { key: '7a3c6c574ef61890ebd8d038d491b56e65a22129', name: "actions" })))));
|
|
4316
4354
|
}
|
|
4317
4355
|
get host() { return getElement(this); }
|
|
4318
4356
|
static get watchers() { return {
|
|
@@ -4327,7 +4365,7 @@ class PostBanner {
|
|
|
4327
4365
|
"hasActions": [32],
|
|
4328
4366
|
"dismiss": [64]
|
|
4329
4367
|
},
|
|
4330
|
-
"$listeners$": [[0, "
|
|
4368
|
+
"$listeners$": [[0, "click", "onCloseButtonClick"]],
|
|
4331
4369
|
"$lazyBundleId$": "-",
|
|
4332
4370
|
"$attrsToReflect$": [["type", "type"]]
|
|
4333
4371
|
}; }
|
|
@@ -4833,7 +4871,6 @@ const postClosebuttonCss = ".btn-icon-close{padding:0;border:unset;min-height:un
|
|
|
4833
4871
|
class PostClosebutton {
|
|
4834
4872
|
constructor(hostRef) {
|
|
4835
4873
|
registerInstance(this, hostRef);
|
|
4836
|
-
this.postClick = createEvent(this, "postClick");
|
|
4837
4874
|
}
|
|
4838
4875
|
componentDidLoad() {
|
|
4839
4876
|
this.checkHiddenLabel();
|
|
@@ -4844,7 +4881,7 @@ class PostClosebutton {
|
|
|
4844
4881
|
}
|
|
4845
4882
|
}
|
|
4846
4883
|
render() {
|
|
4847
|
-
return (hAsync(Host, { key: '
|
|
4884
|
+
return (hAsync(Host, { key: 'a8db3ecbefea609234c4c8c29dbf085637592c2c', "data-version": version$1 }, hAsync("button", { key: '58cef7f32f6ec89d46a1ea57b5497089a96aebf3', class: "btn btn-icon-close", type: "button" }, hAsync("post-icon", { key: '023a67437b69bb9966d08b027cc5f10d68baac40', "aria-hidden": "true", name: "closex" }), hAsync("span", { key: 'b1a21810b6179ddd8d66b426a3149966c1972f59', class: "visually-hidden" }, hAsync("slot", { key: '2a2417bedbcb57c75993722d3267342c7df7381d', onSlotchange: () => this.checkHiddenLabel() })))));
|
|
4848
4885
|
}
|
|
4849
4886
|
get host() { return getElement(this); }
|
|
4850
4887
|
static get style() { return postClosebuttonCss; }
|
|
@@ -6425,6 +6462,9 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
6425
6462
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6426
6463
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6427
6464
|
};
|
|
6465
|
+
/**
|
|
6466
|
+
* @part menu - The container element that holds the list of menu items.
|
|
6467
|
+
*/
|
|
6428
6468
|
class PostMenu {
|
|
6429
6469
|
constructor(hostRef) {
|
|
6430
6470
|
registerInstance(this, hostRef);
|
|
@@ -6585,7 +6625,7 @@ class PostMenu {
|
|
|
6585
6625
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
6586
6626
|
}
|
|
6587
6627
|
render() {
|
|
6588
|
-
return (hAsync(Host, { key: '
|
|
6628
|
+
return (hAsync(Host, { key: 'ee365a30646247563fccd55556f7667cb1591d02', "data-version": version$1, role: "menu" }, hAsync("post-popovercontainer", { key: 'c649841d408d3f35dfed959cdc6b041163ff80d3', placement: this.placement, ref: e => (this.popoverRef = e) }, hAsync("div", { key: '9f4f145b80c716d27dc51f4bcb0d269b2b2678a8', part: "menu" }, hAsync("slot", { key: '72b53c8f154a4a91541799a789e8618a8d1a9c2c' })))));
|
|
6589
6629
|
}
|
|
6590
6630
|
get host() { return getElement(this); }
|
|
6591
6631
|
static get watchers() { return {
|
|
@@ -10060,8 +10100,8 @@ const postTabsCss = ".tabs-wrapper{position:relative;padding-top:1rem;border:0;b
|
|
|
10060
10100
|
/**
|
|
10061
10101
|
* @slot tabs - Slot for placing tab headers. Each tab header should be a <post-tab-header> element.
|
|
10062
10102
|
* @slot default - Slot for placing tab panels. Each tab panel should be a <post-tab-panel> element.
|
|
10063
|
-
* @part tabs -
|
|
10064
|
-
* @part content -
|
|
10103
|
+
* @part tabs - The container element that holds the set of tabs.
|
|
10104
|
+
* @part content - The container element that displays the content of the currently active tab.
|
|
10065
10105
|
*/
|
|
10066
10106
|
class PostTabs {
|
|
10067
10107
|
constructor(hostRef) {
|
|
@@ -10202,7 +10242,7 @@ class PostTabs {
|
|
|
10202
10242
|
nextTab.focus();
|
|
10203
10243
|
}
|
|
10204
10244
|
render() {
|
|
10205
|
-
return (hAsync(Host, { key: '
|
|
10245
|
+
return (hAsync(Host, { key: 'dc7228c840d65e3546e0d13e5bcaa78819b5aeb9', "data-version": version$1 }, hAsync("div", { key: '377d592f7c00f3ec0c7aba2a4a8ca2b88cd37927', class: "tabs-wrapper", part: "tabs" }, hAsync("div", { key: '6e79f33d6cd82d55ba9fad2f09f6163ce7e0a372', class: "tabs", role: "tablist" }, hAsync("slot", { key: '65fbf3cb6525f2f2ae97eb60dad313811db4c585', name: "tabs", onSlotchange: () => this.enableTabs() }))), hAsync("div", { key: '675a59a27e79bad06ea2b70c4fc7b0a6f4b020ff', class: "tab-content", part: "content" }, hAsync("slot", { key: 'b559af0fa652e352673fbabb6829a62a5630e809', onSlotchange: () => this.moveMisplacedTabs() }))));
|
|
10206
10246
|
}
|
|
10207
10247
|
get host() { return getElement(this); }
|
|
10208
10248
|
static get style() { return postTabsCss; }
|