@swisspost/design-system-components 10.0.0-next.50 → 10.0.0-next.52
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/focusable-D6snQLqS.js +5020 -0
- package/dist/cjs/get-focusable-children-Bx63XUQg.js +67 -0
- package/dist/cjs/{index-CpDyH7Ww.js → index-Cb8CTrOz.js} +13 -9
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-qtH-QrKv.js → package-B7Ni5Tuu.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +3 -3
- package/dist/cjs/post-avatar.cjs.entry.js +2 -2
- package/dist/cjs/post-back-to-top.cjs.entry.js +3 -3
- package/dist/cjs/post-banner.cjs.entry.js +2 -2
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +5 -5
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +12 -11
- package/dist/cjs/post-card-control.cjs.entry.js +2 -2
- package/dist/cjs/post-closebutton_15.cjs.entry.js +128 -110
- package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-footer.cjs.entry.js +2 -2
- package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
- package/dist/cjs/post-popover-trigger.cjs.entry.js +109 -0
- package/dist/cjs/post-popover.cjs.entry.js +22 -104
- package/dist/cjs/post-rating.cjs.entry.js +4 -8
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +6 -5022
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +1 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +34 -13
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +9 -2
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.js +29 -33
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
- 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.js +21 -77
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.css +1 -0
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +145 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +153 -32
- package/dist/collection/components/post-rating/post-rating.js +4 -9
- 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 +1 -1
- 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.css +1 -1
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +1 -1
- package/dist/collection/utils/get-focusable-children.js +34 -5
- package/dist/component-names.json +1 -0
- package/dist/components/focusable.js +5018 -0
- package/dist/components/get-focusable-children.js +35 -6
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +1 -1
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-breadcrumb-item2.js +1 -1
- package/dist/components/post-breadcrumbs.js +14 -11
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-mainnavigation.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +10 -3
- package/dist/components/post-menu-item2.js +2 -2
- package/dist/components/post-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +27 -31
- package/dist/components/post-popover-trigger.d.ts +11 -0
- package/dist/components/post-popover-trigger.js +132 -0
- package/dist/components/post-popover.js +17 -99
- package/dist/components/post-popovercontainer2.js +82 -32
- package/dist/components/post-rating.js +2 -6
- package/dist/components/post-tab-header.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton.js +1 -1
- package/dist/components/post-tooltip-trigger.js +6 -5022
- package/dist/components/post-tooltip.js +1 -1
- package/dist/components/react/index.js +1 -1
- package/dist/components/react/{p-CDsgZHvX.js → p-B35HsBxh.js} +83 -33
- package/dist/components/react/{p-BuKAaKXE.js → p-BL8WEb6K.js} +3 -3
- package/dist/components/react/p-BVXiQdHq.js +64 -0
- package/dist/components/react/{p-BmpB1vs4.js → p-By7jk8fL.js} +1 -1
- package/dist/components/react/{p-BXPcgIqO.js → p-C4zJkcAb.js} +3 -3
- package/dist/components/react/{p-U9MTjvRU.js → p-CQhnMei5.js} +2 -2
- package/dist/components/react/{p-BlOv-NDA.js → p-CrEdcwed.js} +5 -5
- package/dist/components/react/{p-DnHwlsBi.js → p-Dl8clYLV.js} +3 -3
- package/dist/components/react/{p-B9Y7UQKI.js → p-DnhWNGb-.js} +1 -1
- package/dist/components/react/{p-BcVKzjda.js → p-DnqwBx5e.js} +1 -1
- package/dist/components/react/{p-Bw6vnK1I.js → p-Due3yZDR.js} +30 -34
- package/dist/components/react/p-HygIVKXC.js +5018 -0
- package/dist/components/react/p-kxuZ8mOU.js +3 -0
- package/dist/components/react/{p-B392lG2N.js → p-lC8Sp5tg.js} +1 -1
- package/dist/components/react/post-accordion-item.js +1 -1
- package/dist/components/react/post-accordion.js +1 -1
- package/dist/components/react/post-avatar.js +1 -1
- package/dist/components/react/post-back-to-top.js +3 -3
- package/dist/components/react/post-banner.js +1 -1
- package/dist/components/react/post-breadcrumb-item.js +1 -1
- package/dist/components/react/post-breadcrumbs.js +21 -18
- package/dist/components/react/post-card-control.js +2 -2
- package/dist/components/react/post-closebutton.js +1 -1
- package/dist/components/react/post-collapsible-trigger.js +1 -1
- package/dist/components/react/post-collapsible.js +1 -1
- package/dist/components/react/post-footer.js +6 -6
- package/dist/components/react/post-header.js +2 -2
- package/dist/components/react/post-icon.js +1 -1
- package/dist/components/react/post-language-option.js +1 -1
- package/dist/components/react/post-language-switch.js +5 -5
- package/dist/components/react/post-linkarea.js +1 -1
- package/dist/components/react/post-list-item.js +1 -1
- package/dist/components/react/post-list.js +1 -1
- package/dist/components/react/post-logo.js +1 -1
- package/dist/components/react/post-mainnavigation.js +3 -3
- package/dist/components/react/post-megadropdown-trigger.js +2 -2
- package/dist/components/react/post-megadropdown.js +12 -5
- package/dist/components/react/post-menu-item.js +1 -1
- package/dist/components/react/post-menu-trigger.js +1 -1
- package/dist/components/react/post-menu.js +1 -1
- package/dist/components/react/post-popover-trigger.d.ts +11 -0
- package/dist/components/react/post-popover-trigger.js +133 -0
- package/dist/components/react/post-popover.js +21 -103
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-rating.js +4 -8
- package/dist/components/react/post-tab-header.js +2 -2
- package/dist/components/react/post-tab-panel.js +2 -2
- package/dist/components/react/post-tabs.js +2 -2
- package/dist/components/react/post-togglebutton.js +2 -2
- package/dist/components/react/post-tooltip-trigger.js +4 -5020
- package/dist/components/react/post-tooltip.js +3 -3
- package/dist/docs.json +206 -42
- package/dist/esm/focusable-HygIVKXC.js +5018 -0
- package/dist/esm/get-focusable-children-D9ZHp2FP.js +64 -0
- package/dist/esm/{index-C8a0ddDa.js → index-CFNKgUjL.js} +13 -9
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-kxuZ8mOU.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +3 -3
- package/dist/esm/post-avatar.entry.js +2 -2
- package/dist/esm/post-back-to-top.entry.js +3 -3
- package/dist/esm/post-banner.entry.js +2 -2
- package/dist/esm/post-breadcrumb-item_2.entry.js +5 -5
- package/dist/esm/post-breadcrumbs.entry.js +13 -12
- package/dist/esm/post-card-control.entry.js +2 -2
- package/dist/esm/post-closebutton_15.entry.js +125 -107
- package/dist/esm/post-collapsible_2.entry.js +2 -2
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-footer.entry.js +2 -2
- package/dist/esm/post-linkarea.entry.js +2 -2
- package/dist/esm/post-popover-trigger.entry.js +107 -0
- package/dist/esm/post-popover.entry.js +19 -101
- package/dist/esm/post-rating.entry.js +4 -8
- package/dist/esm/post-tab-header.entry.js +3 -3
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/post-tooltip-trigger.entry.js +5 -5021
- package/dist/esm/post-tooltip.entry.js +3 -3
- package/dist/post-components/{p-1253185c.entry.js → p-1096ed89.entry.js} +1 -1
- package/dist/post-components/{p-0a4d9f33.entry.js → p-12183522.entry.js} +1 -1
- package/dist/post-components/{p-b82e7cbe.entry.js → p-173dcaab.entry.js} +1 -1
- package/dist/post-components/p-1d7418ce.entry.js +1 -0
- package/dist/post-components/p-244a47db.entry.js +1 -0
- package/dist/post-components/p-264c5f97.entry.js +1 -0
- package/dist/post-components/{p-e7fbb03d.entry.js → p-290ea78f.entry.js} +1 -1
- package/dist/post-components/p-2f8cad6c.entry.js +1 -0
- package/dist/post-components/p-47e43863.entry.js +1 -0
- package/dist/post-components/{p-5ddde390.entry.js → p-50a5c57f.entry.js} +1 -1
- package/dist/post-components/p-6d8f95de.entry.js +1 -0
- package/dist/post-components/p-72e56701.entry.js +1 -0
- package/dist/post-components/p-81d78878.entry.js +1 -0
- package/dist/post-components/p-8a6467b4.entry.js +1 -0
- package/dist/post-components/{p-15e0d4b8.entry.js → p-9e461598.entry.js} +1 -1
- package/dist/post-components/p-CFNKgUjL.js +2 -0
- package/dist/post-components/p-D9ZHp2FP.js +1 -0
- package/dist/post-components/p-HygIVKXC.js +1 -0
- package/dist/post-components/p-a92b241a.entry.js +1 -0
- package/dist/post-components/{p-f9d044a3.entry.js → p-c84e7f02.entry.js} +1 -1
- package/dist/post-components/{p-048d2c1a.entry.js → p-e37d9a31.entry.js} +1 -1
- package/dist/post-components/p-f62f52d7.entry.js +1 -0
- package/dist/post-components/p-kxuZ8mOU.js +1 -0
- package/dist/post-components/post-components.css +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +6 -1
- package/dist/types/components/post-menu/post-menu.d.ts +4 -3
- package/dist/types/components/post-popover/post-popover.d.ts +5 -10
- package/dist/types/components/post-popover-trigger/post-popover-trigger.d.ts +37 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +34 -5
- package/dist/types/components.d.ts +66 -13
- package/dist/types/utils/get-focusable-children.d.ts +1 -0
- package/hydrate/index.js +6708 -6595
- package/hydrate/index.mjs +6708 -6595
- package/package.json +7 -7
- package/dist/components/react/p-C35MCWIp.js +0 -35
- package/dist/components/react/p-DimG3b3P.js +0 -3
- package/dist/esm/package-DimG3b3P.js +0 -3
- package/dist/post-components/p-11abb64f.entry.js +0 -1
- package/dist/post-components/p-1d4252ba.entry.js +0 -1
- package/dist/post-components/p-3d30eafa.entry.js +0 -1
- package/dist/post-components/p-4114fc83.entry.js +0 -1
- package/dist/post-components/p-89411986.entry.js +0 -1
- package/dist/post-components/p-9bbf7271.entry.js +0 -1
- package/dist/post-components/p-C8a0ddDa.js +0 -2
- package/dist/post-components/p-DimG3b3P.js +0 -1
- package/dist/post-components/p-b034d196.entry.js +0 -1
- package/dist/post-components/p-b36c129a.entry.js +0 -1
- package/dist/post-components/p-f1d53256.entry.js +0 -1
- package/dist/post-components/p-f97f3a19.entry.js +0 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { v as version } from './package.js';
|
|
3
|
+
import { i as isFocusable } from './focusable.js';
|
|
4
|
+
import { c as checkRequiredAndType } from './index2.js';
|
|
5
|
+
import './breakpoints.js';
|
|
6
|
+
|
|
7
|
+
const postPopoverTriggerCss = ":host{cursor:pointer}";
|
|
8
|
+
|
|
9
|
+
const PostPopoverTrigger$1 = /*@__PURE__*/ proxyCustomElement(class PostPopoverTrigger extends HTMLElement {
|
|
10
|
+
syncAriaExpanded(newValue) {
|
|
11
|
+
this.ariaExpanded = newValue;
|
|
12
|
+
if (this.trigger) {
|
|
13
|
+
this.trigger.setAttribute('aria-expanded', String(newValue));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
18
|
+
* @param forValue - The new value of the `for` property.
|
|
19
|
+
*/
|
|
20
|
+
validateFor() {
|
|
21
|
+
checkRequiredAndType(this, 'for', 'string');
|
|
22
|
+
}
|
|
23
|
+
// Gets the associated popover element to the trigger based on 'for'
|
|
24
|
+
get popover() {
|
|
25
|
+
const ref = document.getElementById(this.for);
|
|
26
|
+
return ref?.localName === 'post-popover' ? ref : null;
|
|
27
|
+
}
|
|
28
|
+
setupTrigger() {
|
|
29
|
+
this.trigger = this.host.querySelector('*');
|
|
30
|
+
if (this.trigger) {
|
|
31
|
+
this.trigger.setAttribute('aria-expanded', this.ariaExpanded.toString());
|
|
32
|
+
// check if its not focusable and add aria role and tabindex
|
|
33
|
+
if (!isFocusable(this.trigger)) {
|
|
34
|
+
this.trigger.setAttribute('tabindex', '0');
|
|
35
|
+
this.trigger.setAttribute('role', 'button');
|
|
36
|
+
}
|
|
37
|
+
// Set aria attributes
|
|
38
|
+
this.trigger.setAttribute('aria-haspopup', 'true');
|
|
39
|
+
this.trigger.setAttribute('aria-controls', this.for);
|
|
40
|
+
this.trigger.addEventListener('click', this.boundHandleToggle);
|
|
41
|
+
this.trigger.addEventListener('keydown', this.boundHandleKeyDown);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
console.error('No content found in the post-popover-trigger slot. Please insert a focusable element or content that can receive focus.');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
handleToggle() {
|
|
48
|
+
const popoverEl = this.popover;
|
|
49
|
+
if (popoverEl) {
|
|
50
|
+
popoverEl.toggle(this.trigger);
|
|
51
|
+
this.focusTrigger();
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
console.warn(`No post-popover found with ID: ${this.for}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
focusTrigger() {
|
|
58
|
+
// Restores focus to the trigger
|
|
59
|
+
if (!this.popoverOpen && this.trigger) {
|
|
60
|
+
this.trigger.focus();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
constructor() {
|
|
64
|
+
super();
|
|
65
|
+
this.__registerHost();
|
|
66
|
+
this.__attachShadow();
|
|
67
|
+
/**
|
|
68
|
+
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated popover is expanded or collapsed.
|
|
69
|
+
*/
|
|
70
|
+
this.ariaExpanded = false;
|
|
71
|
+
/**
|
|
72
|
+
* Holds the state of the popover toggle
|
|
73
|
+
*/
|
|
74
|
+
this.popoverOpen = false;
|
|
75
|
+
this.handleKeyDown = (e) => {
|
|
76
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
this.handleToggle();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
this.boundHandleToggle = this.handleToggle.bind(this);
|
|
82
|
+
this.boundHandleKeyDown = this.handleKeyDown.bind(this);
|
|
83
|
+
this.boundHandlePostToggle = (event) => {
|
|
84
|
+
this.popoverOpen = event.detail.isOpen;
|
|
85
|
+
this.focusTrigger();
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
componentDidLoad() {
|
|
89
|
+
this.validateFor();
|
|
90
|
+
this.setupTrigger();
|
|
91
|
+
this.popover?.addEventListener('postToggle', this.boundHandlePostToggle);
|
|
92
|
+
}
|
|
93
|
+
disconnectedCallback() {
|
|
94
|
+
this.trigger.removeEventListener('click', this.boundHandleToggle);
|
|
95
|
+
this.trigger.removeEventListener('keydown', this.boundHandleKeyDown);
|
|
96
|
+
this.popover?.removeEventListener('postToggle', this.boundHandlePostToggle);
|
|
97
|
+
}
|
|
98
|
+
render() {
|
|
99
|
+
return (h(Host, { key: 'd7467aa400f407d76df06e8bbc84210e5f016073', "data-version": version }, h("slot", { key: '618f3d14fb89b3ad3c101a58f8519c337d9f1721', onSlotchange: () => this.setupTrigger() })));
|
|
100
|
+
}
|
|
101
|
+
get host() { return this; }
|
|
102
|
+
static get watchers() { return {
|
|
103
|
+
"popoverOpen": ["syncAriaExpanded"],
|
|
104
|
+
"for": ["validateFor"]
|
|
105
|
+
}; }
|
|
106
|
+
static get style() { return postPopoverTriggerCss; }
|
|
107
|
+
}, [1, "post-popover-trigger", {
|
|
108
|
+
"for": [513],
|
|
109
|
+
"ariaExpanded": [32],
|
|
110
|
+
"popoverOpen": [32]
|
|
111
|
+
}, undefined, {
|
|
112
|
+
"popoverOpen": ["syncAriaExpanded"],
|
|
113
|
+
"for": ["validateFor"]
|
|
114
|
+
}]);
|
|
115
|
+
function defineCustomElement$1() {
|
|
116
|
+
if (typeof customElements === "undefined") {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const components = ["post-popover-trigger"];
|
|
120
|
+
components.forEach(tagName => { switch (tagName) {
|
|
121
|
+
case "post-popover-trigger":
|
|
122
|
+
if (!customElements.get(tagName)) {
|
|
123
|
+
customElements.define(tagName, PostPopoverTrigger$1);
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
} });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const PostPopoverTrigger = PostPopoverTrigger$1;
|
|
130
|
+
const defineCustomElement = defineCustomElement$1;
|
|
131
|
+
|
|
132
|
+
export { PostPopoverTrigger, defineCustomElement };
|
|
@@ -1,71 +1,19 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { a as PLACEMENT_TYPES, d as defineCustomElement$2 } from './post-popovercontainer2.js';
|
|
3
3
|
import { v as version } from './package.js';
|
|
4
|
-
import {
|
|
4
|
+
import { a as getDeepFocusableChildren } from './get-focusable-children.js';
|
|
5
5
|
import { d as checkEmptyOrOneOf, c as checkRequiredAndType } from './index2.js';
|
|
6
|
+
import './breakpoints.js';
|
|
6
7
|
import { d as defineCustomElement$4 } from './post-closebutton2.js';
|
|
7
8
|
import { d as defineCustomElement$3 } from './post-icon2.js';
|
|
8
9
|
|
|
9
|
-
function getAttributeObserver(attribute, handler) {
|
|
10
|
-
/**
|
|
11
|
-
* Handle attribute changes and childList changes from the observer
|
|
12
|
-
* @param {MutationRecord[]} mutationList
|
|
13
|
-
*/
|
|
14
|
-
function observerHandler(mutationList) {
|
|
15
|
-
mutationList.forEach(mutation => {
|
|
16
|
-
if (mutation.type === 'attributes' && mutation.attributeName === attribute) {
|
|
17
|
-
handler(mutation.target);
|
|
18
|
-
}
|
|
19
|
-
if (mutation.type === 'childList') {
|
|
20
|
-
mutation.addedNodes.forEach(node => {
|
|
21
|
-
if (node.nodeType === Node.ELEMENT_NODE &&
|
|
22
|
-
node.hasAttribute(attribute)) {
|
|
23
|
-
handler(node);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
// Initialize a mutation observer for patching accessibility features
|
|
30
|
-
return IS_BROWSER ? new MutationObserver(observerHandler) : null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
10
|
const postPopoverCss = "*{box-sizing:border-box}:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:.5em;min-width:160px;max-width:min(var(--post-popover-max-width, 280px),100vw)}.popover-content{padding:.5em;flex-grow:1}";
|
|
34
11
|
|
|
35
|
-
/**
|
|
36
|
-
* @slot default - Slot for placing content inside the popover.
|
|
37
|
-
*/
|
|
38
|
-
let popoverInstances = 0;
|
|
39
|
-
const popoverTargetAttribute = 'data-popover-target';
|
|
40
|
-
const globalToggleHandler = (e) => {
|
|
41
|
-
let currentElement = e.target;
|
|
42
|
-
// Traverse up the DOM tree to find if any parent has the popover target attribute
|
|
43
|
-
while (currentElement && !currentElement.getAttribute(popoverTargetAttribute)) {
|
|
44
|
-
if (currentElement === document.body || !currentElement.parentElement)
|
|
45
|
-
break;
|
|
46
|
-
currentElement = currentElement.parentElement;
|
|
47
|
-
}
|
|
48
|
-
const popoverTarget = currentElement?.getAttribute(popoverTargetAttribute);
|
|
49
|
-
if (!popoverTarget || ('key' in e && e.key !== 'Enter'))
|
|
50
|
-
return;
|
|
51
|
-
const popover = document.getElementById(popoverTarget);
|
|
52
|
-
popover?.toggle(currentElement);
|
|
53
|
-
};
|
|
54
12
|
const PostPopover$1 = /*@__PURE__*/ proxyCustomElement(class PostPopover extends HTMLElement {
|
|
55
|
-
validatePlacement() {
|
|
56
|
-
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
57
|
-
}
|
|
58
|
-
validateCloseButtonCaption() {
|
|
59
|
-
checkRequiredAndType(this, 'closeButtonCaption', 'string');
|
|
60
|
-
}
|
|
61
13
|
constructor() {
|
|
62
14
|
super();
|
|
63
15
|
this.__registerHost();
|
|
64
16
|
this.__attachShadow();
|
|
65
|
-
// Initialize a mutation observer for patching accessibility features
|
|
66
|
-
this.triggerObserver = IS_BROWSER
|
|
67
|
-
? getAttributeObserver(popoverTargetAttribute, this.patchAccessibilityFeatures)
|
|
68
|
-
: null;
|
|
69
17
|
/**
|
|
70
18
|
* Defines the position of the popover relative to its trigger.
|
|
71
19
|
* Popovers 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.
|
|
@@ -77,76 +25,46 @@ const PostPopover$1 = /*@__PURE__*/ proxyCustomElement(class PostPopover extends
|
|
|
77
25
|
*/
|
|
78
26
|
// eslint-disable-next-line @stencil-community/ban-default-true
|
|
79
27
|
this.arrow = true;
|
|
80
|
-
this.localBeforeToggleHandler = this.beforeToggleHandler.bind(this);
|
|
81
28
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.triggerObserver?.observe(document.body, {
|
|
88
|
-
subtree: true,
|
|
89
|
-
childList: true,
|
|
90
|
-
attributeFilter: [popoverTargetAttribute],
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
popoverInstances++;
|
|
94
|
-
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
29
|
+
validatePlacement() {
|
|
30
|
+
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
31
|
+
}
|
|
32
|
+
validateCloseButtonCaption() {
|
|
33
|
+
checkRequiredAndType(this, 'closeButtonCaption', 'string');
|
|
95
34
|
}
|
|
96
35
|
componentDidLoad() {
|
|
97
36
|
this.validatePlacement();
|
|
98
37
|
this.validateCloseButtonCaption();
|
|
99
|
-
this.popoverRef.addEventListener('beforetoggle', this.localBeforeToggleHandler);
|
|
100
|
-
}
|
|
101
|
-
disconnectedCallback() {
|
|
102
|
-
popoverInstances--;
|
|
103
|
-
// Remove listeners and observer after the last popover has been destructed
|
|
104
|
-
if (popoverInstances === 0) {
|
|
105
|
-
window.removeEventListener('click', globalToggleHandler);
|
|
106
|
-
window.removeEventListener('keydown', globalToggleHandler);
|
|
107
|
-
this.triggerObserver?.disconnect();
|
|
108
|
-
}
|
|
109
|
-
this.popoverRef.removeEventListener('beforetoggle', this.localBeforeToggleHandler);
|
|
110
|
-
this.triggers.forEach(trigger => trigger.removeAttribute('aria-expanded'));
|
|
111
38
|
}
|
|
112
39
|
/**
|
|
113
40
|
* Programmatically display the popover
|
|
114
|
-
* @param target
|
|
41
|
+
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
115
42
|
*/
|
|
116
43
|
async show(target) {
|
|
117
44
|
this.popoverRef.show(target);
|
|
118
|
-
console.log(this.popoverRef);
|
|
119
|
-
target.setAttribute('aria-expanded', 'true');
|
|
120
45
|
}
|
|
121
46
|
/**
|
|
122
47
|
* Programmatically hide this popover
|
|
123
48
|
*/
|
|
124
49
|
async hide() {
|
|
125
50
|
this.popoverRef.hide();
|
|
126
|
-
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
127
51
|
}
|
|
128
52
|
/**
|
|
129
53
|
* Toggle popover display
|
|
130
|
-
* @param target
|
|
54
|
+
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
131
55
|
* @param force Pass true to always show or false to always hide
|
|
132
56
|
*/
|
|
133
57
|
async toggle(target, force) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
beforeToggleHandler() {
|
|
142
|
-
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
143
|
-
}
|
|
144
|
-
patchAccessibilityFeatures(trigger) {
|
|
145
|
-
const force = trigger.hasAttribute(popoverTargetAttribute);
|
|
146
|
-
trigger.setAttribute('aria-expanded', force ? 'false' : null);
|
|
58
|
+
await this.popoverRef.toggle(target, force);
|
|
59
|
+
const focusableChildren = getDeepFocusableChildren(this.host);
|
|
60
|
+
// find first focusable element
|
|
61
|
+
const firstFocusable = focusableChildren[0];
|
|
62
|
+
if (firstFocusable) {
|
|
63
|
+
firstFocusable.focus();
|
|
64
|
+
}
|
|
147
65
|
}
|
|
148
66
|
render() {
|
|
149
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: '82f8d89013b8ddb37fb924c9608ba394c669f35a', "data-version": version }, h("post-popovercontainer", { key: 'cf276e5faf65ae27bc0d8e51779de5470a1e49a3', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '9ab455b2ee7d7f082dc6fc588d519d7a362cad8c', class: "popover-container" }, h("div", { key: 'b3b468da2ff7ccb2a47d69a1841488359763e927', class: "popover-content" }, h("slot", { key: 'a32099475baaca02ce41350e36d363614a6f83ef' })), h("post-closebutton", { key: 'eac806bd1e6652cacce58fb7e915d66e82c24980', onClick: () => this.hide() }, this.closeButtonCaption)))));
|
|
150
68
|
}
|
|
151
69
|
get host() { return this; }
|
|
152
70
|
static get watchers() { return {
|
|
@@ -1323,14 +1323,9 @@ function getWindowScrollBarX(element, rect) {
|
|
|
1323
1323
|
return rect.left + leftScroll;
|
|
1324
1324
|
}
|
|
1325
1325
|
|
|
1326
|
-
function getHTMLOffset(documentElement, scroll
|
|
1327
|
-
if (ignoreScrollbarX === void 0) {
|
|
1328
|
-
ignoreScrollbarX = false;
|
|
1329
|
-
}
|
|
1326
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
1330
1327
|
const htmlRect = documentElement.getBoundingClientRect();
|
|
1331
|
-
const x = htmlRect.left + scroll.scrollLeft - (
|
|
1332
|
-
// RTL <body> scrollbar.
|
|
1333
|
-
getWindowScrollBarX(documentElement, htmlRect));
|
|
1328
|
+
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
1334
1329
|
const y = htmlRect.top + scroll.scrollTop;
|
|
1335
1330
|
return {
|
|
1336
1331
|
x,
|
|
@@ -1369,7 +1364,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1369
1364
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1370
1365
|
}
|
|
1371
1366
|
}
|
|
1372
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll
|
|
1367
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1373
1368
|
return {
|
|
1374
1369
|
width: rect.width * scale.x,
|
|
1375
1370
|
height: rect.height * scale.y,
|
|
@@ -1403,6 +1398,10 @@ function getDocumentRect(element) {
|
|
|
1403
1398
|
};
|
|
1404
1399
|
}
|
|
1405
1400
|
|
|
1401
|
+
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
1402
|
+
// calculation is affected by unusual styles.
|
|
1403
|
+
// Most scrollbars leave 15-18px of space.
|
|
1404
|
+
const SCROLLBAR_MAX = 25;
|
|
1406
1405
|
function getViewportRect(element, strategy) {
|
|
1407
1406
|
const win = getWindow(element);
|
|
1408
1407
|
const html = getDocumentElement(element);
|
|
@@ -1420,6 +1419,24 @@ function getViewportRect(element, strategy) {
|
|
|
1420
1419
|
y = visualViewport.offsetTop;
|
|
1421
1420
|
}
|
|
1422
1421
|
}
|
|
1422
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1423
|
+
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
1424
|
+
// visual width of the <html> but this is not considered in the size
|
|
1425
|
+
// of `html.clientWidth`.
|
|
1426
|
+
if (windowScrollbarX <= 0) {
|
|
1427
|
+
const doc = html.ownerDocument;
|
|
1428
|
+
const body = doc.body;
|
|
1429
|
+
const bodyStyles = getComputedStyle(body);
|
|
1430
|
+
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1431
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1432
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
1433
|
+
width -= clippingStableScrollbarWidth;
|
|
1434
|
+
}
|
|
1435
|
+
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
1436
|
+
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
1437
|
+
// by the scrollbar amount so there isn't extra space on the right.
|
|
1438
|
+
width += windowScrollbarX;
|
|
1439
|
+
}
|
|
1423
1440
|
return {
|
|
1424
1441
|
width,
|
|
1425
1442
|
height,
|
|
@@ -2728,8 +2745,12 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2728
2745
|
constructor() {
|
|
2729
2746
|
super();
|
|
2730
2747
|
this.__registerHost();
|
|
2748
|
+
this.postBeforeShow = createEvent(this, "postBeforeShow", 7);
|
|
2749
|
+
this.postShow = createEvent(this, "postShow", 7);
|
|
2750
|
+
this.postHide = createEvent(this, "postHide", 7);
|
|
2751
|
+
this.postBeforeToggle = createEvent(this, "postBeforeToggle", 7);
|
|
2731
2752
|
this.postToggle = createEvent(this, "postToggle", 7);
|
|
2732
|
-
this.
|
|
2753
|
+
this.hasOpenedOnce = true;
|
|
2733
2754
|
/**
|
|
2734
2755
|
* Defines the placement of the popovercontainer according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
2735
2756
|
* Popovercontainers are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
@@ -2783,36 +2804,79 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2783
2804
|
if (typeof this.clearAutoUpdate === 'function') {
|
|
2784
2805
|
this.clearAutoUpdate();
|
|
2785
2806
|
}
|
|
2807
|
+
this.host.removeEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
2786
2808
|
}
|
|
2787
2809
|
/**
|
|
2788
2810
|
* Programmatically display the popovercontainer
|
|
2789
|
-
* @param target
|
|
2811
|
+
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
2790
2812
|
*/
|
|
2791
2813
|
async show(target) {
|
|
2792
2814
|
if (this.toggleTimeoutId)
|
|
2793
2815
|
return;
|
|
2794
2816
|
this.eventTarget = target;
|
|
2817
|
+
if (this.toggleTimeoutId)
|
|
2818
|
+
return;
|
|
2795
2819
|
this.calculatePosition();
|
|
2796
2820
|
this.host.showPopover();
|
|
2797
2821
|
}
|
|
2822
|
+
/**
|
|
2823
|
+
* Handles the popover opening process and emits related events.
|
|
2824
|
+
*/
|
|
2825
|
+
async open() {
|
|
2826
|
+
const content = this.host.querySelector('.popover-content');
|
|
2827
|
+
this.startAutoupdates();
|
|
2828
|
+
if (content) {
|
|
2829
|
+
const animation = popIn(content);
|
|
2830
|
+
if (animation?.playState === 'running') {
|
|
2831
|
+
this.postBeforeToggle.emit({ willOpen: true });
|
|
2832
|
+
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
2833
|
+
}
|
|
2834
|
+
animation?.finished.then(() => {
|
|
2835
|
+
this.postToggle.emit({ isOpen: true });
|
|
2836
|
+
this.postShow.emit({ first: this.hasOpenedOnce });
|
|
2837
|
+
if (this.hasOpenedOnce)
|
|
2838
|
+
this.hasOpenedOnce = false;
|
|
2839
|
+
});
|
|
2840
|
+
}
|
|
2841
|
+
if (this.safeSpace) {
|
|
2842
|
+
window.addEventListener('mousemove', this.mouseTrackingHandler.bind(this));
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
/**
|
|
2846
|
+
* Handles the popover closing process and emits related events.
|
|
2847
|
+
*/
|
|
2848
|
+
async close() {
|
|
2849
|
+
if (typeof this.clearAutoUpdate === 'function') {
|
|
2850
|
+
this.clearAutoUpdate();
|
|
2851
|
+
}
|
|
2852
|
+
if (this.safeSpace) {
|
|
2853
|
+
window.removeEventListener('mousemove', this.mouseTrackingHandler.bind(this));
|
|
2854
|
+
}
|
|
2855
|
+
this.postToggle.emit({ isOpen: false });
|
|
2856
|
+
this.postHide.emit();
|
|
2857
|
+
}
|
|
2798
2858
|
/**
|
|
2799
2859
|
* Programmatically hide the popovercontainer
|
|
2800
2860
|
*/
|
|
2801
2861
|
async hide() {
|
|
2802
2862
|
if (!this.toggleTimeoutId) {
|
|
2863
|
+
if (this.eventTarget && this.eventTarget instanceof HTMLElement$1) {
|
|
2864
|
+
this.eventTarget.focus();
|
|
2865
|
+
}
|
|
2803
2866
|
this.eventTarget = null;
|
|
2804
2867
|
this.host.hidePopover();
|
|
2868
|
+
this.postHide.emit();
|
|
2805
2869
|
}
|
|
2806
2870
|
}
|
|
2807
2871
|
/**
|
|
2808
2872
|
* Toggle popovercontainer display
|
|
2809
|
-
* @param target
|
|
2873
|
+
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
2810
2874
|
* @param force Pass true to always show or false to always hide
|
|
2811
2875
|
*/
|
|
2812
2876
|
async toggle(target, force) {
|
|
2877
|
+
this.eventTarget = target;
|
|
2813
2878
|
// Prevent instant double toggle
|
|
2814
2879
|
if (!this.toggleTimeoutId) {
|
|
2815
|
-
this.eventTarget = target;
|
|
2816
2880
|
this.calculatePosition();
|
|
2817
2881
|
this.host.togglePopover(force);
|
|
2818
2882
|
this.toggleTimeoutId = null;
|
|
@@ -2829,27 +2893,11 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2829
2893
|
this.toggleTimeoutId = window.setTimeout(() => (this.toggleTimeoutId = null), 10);
|
|
2830
2894
|
const isOpen = e.newState === 'open';
|
|
2831
2895
|
if (isOpen) {
|
|
2832
|
-
|
|
2833
|
-
this.startAutoupdates();
|
|
2834
|
-
if (content && this.animation === 'pop-in') {
|
|
2835
|
-
popIn(content);
|
|
2836
|
-
}
|
|
2837
|
-
if (this.safeSpace)
|
|
2838
|
-
window.addEventListener('mousemove', this.mouseTrackingHandler.bind(this));
|
|
2839
|
-
// Emit event with `first` flag only true on the first open
|
|
2840
|
-
if (this.firstOpen) {
|
|
2841
|
-
this.postToggle.emit({ isOpen, first: this.firstOpen });
|
|
2842
|
-
this.firstOpen = false;
|
|
2843
|
-
return;
|
|
2844
|
-
}
|
|
2896
|
+
this.open();
|
|
2845
2897
|
}
|
|
2846
2898
|
else {
|
|
2847
|
-
|
|
2848
|
-
this.clearAutoUpdate();
|
|
2849
|
-
if (this.safeSpace)
|
|
2850
|
-
window.removeEventListener('mousemove', this.mouseTrackingHandler.bind(this));
|
|
2899
|
+
this.close();
|
|
2851
2900
|
}
|
|
2852
|
-
this.postToggle.emit({ isOpen: isOpen, first: false });
|
|
2853
2901
|
}
|
|
2854
2902
|
/**
|
|
2855
2903
|
* Start listening for DOM updates, scroll events etc. that have
|
|
@@ -2980,9 +3028,9 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2980
3028
|
}
|
|
2981
3029
|
}
|
|
2982
3030
|
render() {
|
|
2983
|
-
return (h(Host, { key: '
|
|
3031
|
+
return (h(Host, { key: 'cdb25a25fbd5e411e380175a8d3789cec83e2755', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, h("div", { key: 'e99bcc4d5123b335b4b8be7044a80b2913ab6fce', class: "popover-content" }, this.arrow && (h("span", { key: '3c228829cc7e5bd83d7f1759ef163407ebcd10c5', class: "arrow", ref: el => {
|
|
2984
3032
|
this.arrowRef = el;
|
|
2985
|
-
} })), h("slot", { key: '
|
|
3033
|
+
} })), h("slot", { key: '6a213deed5ccfec47d4dee903c7544d30a3f5748' }))));
|
|
2986
3034
|
}
|
|
2987
3035
|
get host() { return this; }
|
|
2988
3036
|
static get watchers() { return {
|
|
@@ -2999,6 +3047,8 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2999
3047
|
"manualClose": [4, "manual-close"],
|
|
3000
3048
|
"safeSpace": [513, "safe-space"],
|
|
3001
3049
|
"show": [64],
|
|
3050
|
+
"open": [64],
|
|
3051
|
+
"close": [64],
|
|
3002
3052
|
"hide": [64],
|
|
3003
3053
|
"toggle": [64]
|
|
3004
3054
|
}, undefined, {
|
|
@@ -28,10 +28,6 @@ const PostRating$1 = /*@__PURE__*/ proxyCustomElement(class PostRating extends H
|
|
|
28
28
|
this.postInput = createEvent(this, "postInput", 7);
|
|
29
29
|
this.postChange = createEvent(this, "postChange", 7);
|
|
30
30
|
this.hasChanged = false;
|
|
31
|
-
/**
|
|
32
|
-
* Defines a hidden label for the component.
|
|
33
|
-
*/
|
|
34
|
-
this.label = 'Rating';
|
|
35
31
|
/**
|
|
36
32
|
* Defines the total amount of stars rendered in the component.
|
|
37
33
|
*/
|
|
@@ -101,13 +97,13 @@ const PostRating$1 = /*@__PURE__*/ proxyCustomElement(class PostRating extends H
|
|
|
101
97
|
}
|
|
102
98
|
}
|
|
103
99
|
render() {
|
|
104
|
-
return (h(Host, { key: '
|
|
100
|
+
return (h(Host, { key: '9089061145d80c4791a56580d107d6fab88f1d6d', "data-version": version }, h("div", { key: '81f0ba286541aecf6ddfd2e2fa113526a02abdcd', role: "slider", class: "rating", tabindex: "0", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": this.stars, "aria-valuenow": this.currentRating, "aria-valuetext": `${this.currentRating} / ${this.stars}`, "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.keydownHandler, onBlur: this.blurHandler }, Array.from({ length: this.stars }).map((v, i) => (h("div", { key: `star-${v}`, "aria-hidden": "true", class: {
|
|
105
101
|
'star': true,
|
|
106
102
|
'before-hover': i < this.hoveredIndex,
|
|
107
103
|
'active': i < Math.round(this.currentRating),
|
|
108
104
|
'hover': i === this.hoveredIndex,
|
|
109
105
|
'after-active': i > this.hoveredIndex && i < this.currentRating,
|
|
110
|
-
}, onClick: () => this.update(i + 1), onMouseEnter: e => this.hoverHandler(i, e), onMouseLeave: e => this.hoverHandler(i, e) }, h("post-icon", { name: "
|
|
106
|
+
}, onClick: () => this.update(i + 1), onMouseEnter: e => this.hoverHandler(i, e), onMouseLeave: e => this.hoverHandler(i, e) }, h("post-icon", { name: "favoritestar", class: "stroke" }), h("post-icon", { name: "favoritestar-solid", class: "fill" })))))));
|
|
111
107
|
}
|
|
112
108
|
get host() { return this; }
|
|
113
109
|
static get watchers() { return {
|
|
@@ -19,7 +19,7 @@ const PostTabHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostTabHeader ext
|
|
|
19
19
|
this.tabId = `tab-${this.host.id || nanoid(6)}`;
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: '5d9cfad4e62285e8b64a5f597e3d38d451dd493f', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '679874586fb55510af17838ef73403c8b7a33ddc' })));
|
|
23
23
|
}
|
|
24
24
|
get host() { return this; }
|
|
25
25
|
static get watchers() { return {
|
|
@@ -21,7 +21,7 @@ const PostTabPanel$1 = /*@__PURE__*/ proxyCustomElement(class PostTabPanel exten
|
|
|
21
21
|
this.panelId = `panel-${this.host.id || nanoid(6)}`;
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '5d6c56e41ac61b10dd2560482bc5e4edab394742', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: 'ec7be772a0d3f883388742460c825dce0f0e44e8' })));
|
|
25
25
|
}
|
|
26
26
|
get host() { return this; }
|
|
27
27
|
static get watchers() { return {
|
|
@@ -167,7 +167,7 @@ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLE
|
|
|
167
167
|
nextTab.focus();
|
|
168
168
|
}
|
|
169
169
|
render() {
|
|
170
|
-
return (h(Host, { key: '
|
|
170
|
+
return (h(Host, { key: '3e352bc059be99242f612a49bdea71fd065d67b0', "data-version": version }, h("div", { key: '34d608d7af834fd4fb3106ac3fb90100a9b73138', class: "tabs-wrapper", part: "tabs" }, h("div", { key: '102e75b53d3e485a185d391f84755142d8690de6', class: "tabs", role: "tablist" }, h("slot", { key: '03624f2944dfd37d3eb3403772d430a6e053e676', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '8c7c956b831ef19fb093122ca35c14b5a015dad3', class: "tab-content", part: "content" }, h("slot", { key: '8fad35a2a6d26814f513c422b4fcbe98aae7bd22', onSlotchange: () => this.moveMisplacedTabs() }))));
|
|
171
171
|
}
|
|
172
172
|
get host() { return this; }
|
|
173
173
|
static get style() { return postTabsCss; }
|
|
@@ -29,7 +29,7 @@ const PostTogglebutton$1 = /*@__PURE__*/ proxyCustomElement(class PostTogglebutt
|
|
|
29
29
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: 'f56832bfbfacc23923ac06d8455fffcdafa8a7ec', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '7adc9ed579b6badeb08c7599ceb95892d68f027f' })));
|
|
33
33
|
}
|
|
34
34
|
get host() { return this; }
|
|
35
35
|
static get style() { return postTogglebuttonCss; }
|