@xplortech/apollo-core 2.9.0 → 2.10.0
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/.typings/apollo-components.html-data.json +20 -12
- package/build/style.css +2086 -1875
- package/dist/apollo-core/apollo-core.css +20 -18
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-0e45f332.entry.js +1 -0
- package/dist/apollo-core/p-0f251f98.entry.js +1 -0
- package/dist/apollo-core/p-1691c4f3.entry.js +1 -0
- package/dist/apollo-core/p-172ac720.entry.js +1 -0
- package/dist/apollo-core/p-23870463.entry.js +1 -0
- package/dist/apollo-core/{p-36ba29da.entry.js → p-3b8639b7.entry.js} +1 -1
- package/dist/apollo-core/p-44a16751.entry.js +1 -0
- package/dist/apollo-core/p-4efecab2.entry.js +1 -0
- package/dist/apollo-core/p-5094dd97.entry.js +1 -0
- package/dist/apollo-core/p-70e7facc.entry.js +1 -0
- package/dist/apollo-core/{p-6a15f1e0.entry.js → p-728341d2.entry.js} +1 -1
- package/dist/apollo-core/p-910be81f.entry.js +1 -0
- package/dist/apollo-core/{p-b61d7952.entry.js → p-9adf3694.entry.js} +1 -1
- package/dist/apollo-core/p-CK3_k8jD.js +1 -0
- package/dist/apollo-core/p-CXkZUm1c.js +2 -0
- package/dist/apollo-core/p-c17b6351.entry.js +1 -0
- package/dist/apollo-core/p-e08b434c.entry.js +1 -0
- package/dist/apollo-core/{p-ca127ee8.entry.js → p-e9e7577f.entry.js} +1 -1
- package/dist/cjs/apollo-core.cjs.js +3 -3
- package/dist/cjs/{index-BQ97-AWw.js → index-BaXVr8ux.js} +36 -9
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/v4-_2BfiRUa.js +52 -0
- package/dist/cjs/xpl-accordion.cjs.entry.js +3 -3
- package/dist/cjs/xpl-application-shell.cjs.entry.js +2 -2
- package/dist/cjs/xpl-avatar_54.cjs.entry.js +700 -176
- package/dist/cjs/xpl-button-row.cjs.entry.js +2 -2
- package/dist/cjs/xpl-calendar.cjs.entry.js +3 -3
- package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +3 -3
- package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +3 -3
- package/dist/cjs/xpl-dynamic-table.cjs.entry.js +2 -2
- package/dist/cjs/xpl-grid-item.cjs.entry.js +2 -2
- package/dist/cjs/xpl-grid.cjs.entry.js +2 -2
- package/dist/cjs/xpl-large-card.cjs.entry.js +2 -2
- package/dist/cjs/xpl-main-nav.cjs.entry.js +2 -2
- package/dist/cjs/xpl-table-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/xpl-table-header.cjs.entry.js +2 -2
- package/dist/cjs/xpl-toggle.cjs.entry.js +5 -5
- package/dist/cjs/xpl-toolbar.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/xpl-accordion/xpl-accordion.js +2 -2
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +1 -1
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
- package/dist/collection/components/xpl-badge/xpl-badge.js +1 -1
- package/dist/collection/components/xpl-banner/banner.stories.js +5 -0
- package/dist/collection/components/xpl-banner/xpl-banner.js +2 -2
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +1 -1
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +1 -1
- package/dist/collection/components/xpl-button/button.stories.js +5 -0
- package/dist/collection/components/xpl-button/xpl-button.js +1 -1
- package/dist/collection/components/xpl-button-row/button-row.stories.js +1 -11
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +1 -1
- package/dist/collection/components/xpl-calendar/xpl-calendar.js +1 -1
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +4 -4
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +1 -1
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +1 -1
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +1 -1
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +2 -2
- package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +208 -31
- package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +1 -1
- package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +2 -2
- package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +2 -2
- package/dist/collection/components/xpl-grid/xpl-grid.js +1 -1
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
- package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +1 -1
- package/dist/collection/components/xpl-icon/xpl-icon.js +2 -2
- package/dist/collection/components/xpl-input/input.stories.js +1 -1
- package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +8 -8
- package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +3 -3
- package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +4 -4
- package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +25 -6
- package/dist/collection/components/xpl-input/xpl-input-search/xpl-input-search.js +1 -1
- package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +2 -2
- package/dist/collection/components/xpl-input/xpl-input.js +3 -3
- package/dist/collection/components/xpl-large-card/xpl-large-card.js +1 -1
- package/dist/collection/components/xpl-list/xpl-list.js +2 -2
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +1 -1
- package/dist/collection/components/xpl-modal/xpl-modal.js +4 -1
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +2 -2
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +26 -8
- package/dist/collection/components/xpl-panel/xpl-panel.js +2 -2
- package/dist/collection/components/xpl-popover/popover.stories.js +3 -7
- package/dist/collection/components/xpl-popover/xpl-popover.js +4 -4
- package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +2 -2
- package/dist/collection/components/xpl-progress-indicator/xpl-progress-indicator.js +1 -1
- package/dist/collection/components/xpl-radio/radio.stories.js +19 -17
- package/dist/collection/components/xpl-radio/xpl-radio.js +3 -3
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +1 -1
- package/dist/collection/components/xpl-select/xpl-select.js +16 -11
- package/dist/collection/components/xpl-side-nav/side-nav-constants.js +2 -0
- package/dist/collection/components/xpl-side-nav/side-nav.stories.js +301 -186
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +80 -14
- package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +284 -3
- package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +1 -1
- package/dist/collection/components/xpl-slideout/xpl-slideout.js +1 -1
- package/dist/collection/components/xpl-spotlight/xpl-spotlight.js +14 -4
- package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +2 -2
- package/dist/collection/components/xpl-table/xpl-table.js +13 -22
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +1 -1
- package/dist/collection/components/xpl-tabs/xpl-tabs.js +5 -5
- package/dist/collection/components/xpl-tag/xpl-tag.js +2 -2
- package/dist/collection/components/xpl-toast/xpl-toast.js +2 -2
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +3 -3
- package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +2 -2
- package/dist/collection/components/xpl-tooltip/tooltip-arrow.js +1 -1
- package/dist/collection/components/xpl-tooltip/tooltip.stories.js +6 -37
- package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +1 -1
- package/dist/collection/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.js +2 -2
- package/dist/collection/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.js +2 -2
- package/dist/collection/components/xpl-top-nav/xpl-top-nav.js +5 -5
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +1 -1
- package/dist/components/index.d.ts +141 -12
- package/dist/components/index.js +1 -1
- package/dist/components/p-3qMYyqTe.js +1 -0
- package/dist/components/p-B1PBAEzg.js +1 -0
- package/dist/components/p-BG0-6Xek.js +1 -0
- package/dist/components/p-BT_Lq3Vd.js +1 -0
- package/dist/components/p-BWyAzrwu.js +1 -0
- package/dist/components/p-B_Wi--Ov.js +1 -0
- package/dist/components/p-Bd6JweBt.js +1 -0
- package/dist/components/p-Bn-27-xj.js +1 -0
- package/dist/components/{xpl-top-nav-item2.js → p-Bs6vq0C6.js} +1 -1
- package/dist/components/{xpl-input-file2.js → p-C9BO2vL-.js} +1 -1
- package/dist/components/p-CFW_w5Wj.js +1 -0
- package/dist/components/{floating-ui.dom.js → p-CFpsSZyr.js} +1 -1
- package/dist/components/p-CGNq3DyC.js +1 -0
- package/dist/components/p-CK3_k8jD.js +1 -0
- package/dist/components/p-CVqbA9op.js +1 -0
- package/dist/components/p-CtIUusUL.js +1 -0
- package/dist/components/p-CzwViN3U.js +1 -0
- package/dist/components/p-D97c0GjM.js +1 -0
- package/dist/components/p-DBWV65V-.js +1 -0
- package/dist/components/{xpl-tag2.js → p-DEl4Rvzs.js} +1 -1
- package/dist/components/p-DPTHmitJ.js +1 -0
- package/dist/components/{xpl-input-search2.js → p-DllC7F-H.js} +1 -1
- package/dist/components/p-Ds28UyUR.js +1 -0
- package/dist/components/p-U5dPMCXE.js +1 -0
- package/dist/components/p-hPUzON4O.js +1 -0
- package/dist/components/p-kPHfCq1d.js +1 -0
- package/dist/components/xpl-accordion.js +1 -1
- package/dist/components/xpl-application-shell.js +1 -1
- package/dist/components/xpl-avatar.js +1 -1
- package/dist/components/xpl-backdrop.js +1 -1
- package/dist/components/xpl-badge.js +1 -1
- package/dist/components/xpl-banner.js +1 -1
- package/dist/components/xpl-breadcrumb-item.js +1 -1
- package/dist/components/xpl-breadcrumbs.js +1 -1
- package/dist/components/xpl-button-row.js +1 -1
- package/dist/components/xpl-button.js +1 -1
- package/dist/components/xpl-calendar.js +1 -1
- package/dist/components/xpl-checkbox.js +1 -1
- package/dist/components/xpl-choicelist.js +1 -1
- package/dist/components/xpl-content-area.js +1 -1
- package/dist/components/xpl-dashboard.js +1 -1
- package/dist/components/xpl-data-card.js +1 -1
- package/dist/components/xpl-divider.js +1 -1
- package/dist/components/xpl-dropdown-group.js +1 -1
- package/dist/components/xpl-dropdown-heading.js +1 -1
- package/dist/components/xpl-dropdown-option.js +1 -1
- package/dist/components/xpl-dropdown.js +1 -1
- package/dist/components/xpl-dynamic-table-cell.js +1 -1
- package/dist/components/xpl-dynamic-table-row.js +1 -1
- package/dist/components/xpl-dynamic-table.js +1 -1
- package/dist/components/xpl-grid-item.js +1 -1
- package/dist/components/xpl-grid.js +1 -1
- package/dist/components/xpl-header-accordion.js +1 -1
- package/dist/components/xpl-icon.js +1 -1
- package/dist/components/xpl-input-color.js +1 -1
- package/dist/components/xpl-input-date.js +1 -1
- package/dist/components/xpl-input-file.js +1 -1
- package/dist/components/xpl-input-phone.js +1 -1
- package/dist/components/xpl-input-search.js +1 -1
- package/dist/components/xpl-input-time.js +1 -1
- package/dist/components/xpl-input.js +1 -1
- package/dist/components/xpl-large-card.js +1 -1
- package/dist/components/xpl-list-item.js +1 -1
- package/dist/components/xpl-list.js +1 -1
- package/dist/components/xpl-main-nav.js +1 -1
- package/dist/components/xpl-modal.js +1 -1
- package/dist/components/xpl-nav-header-menu.js +1 -1
- package/dist/components/xpl-nav-item.js +1 -1
- package/dist/components/xpl-pagination.js +1 -1
- package/dist/components/xpl-panel.js +1 -1
- package/dist/components/xpl-popover.js +1 -1
- package/dist/components/xpl-progress-bar.js +1 -1
- package/dist/components/xpl-progress-indicator.js +1 -1
- package/dist/components/xpl-radio.js +1 -1
- package/dist/components/xpl-secondary-nav.js +1 -1
- package/dist/components/xpl-select.js +1 -1
- package/dist/components/xpl-side-nav-item.js +1 -1
- package/dist/components/xpl-side-nav.js +1 -1
- package/dist/components/xpl-skeleton.js +1 -1
- package/dist/components/xpl-slideout.js +1 -1
- package/dist/components/xpl-spotlight.js +1 -1
- package/dist/components/xpl-tab-panel.js +1 -1
- package/dist/components/xpl-tab.js +1 -1
- package/dist/components/xpl-table-header-cell.js +1 -1
- package/dist/components/xpl-table-header.js +1 -1
- package/dist/components/xpl-table.js +1 -1
- package/dist/components/xpl-tabs.js +1 -1
- package/dist/components/xpl-tag.js +1 -1
- package/dist/components/xpl-toast.js +1 -1
- package/dist/components/xpl-toggle.js +1 -1
- package/dist/components/xpl-toolbar.js +1 -1
- package/dist/components/xpl-tooltip.js +1 -1
- package/dist/components/xpl-top-nav-item.js +1 -1
- package/dist/components/xpl-top-nav.js +1 -1
- package/dist/components/xpl-utility-bar.js +1 -1
- package/dist/docs/xpl-backdrop/readme.md +2 -0
- package/dist/docs/xpl-badge/readme.md +34 -0
- package/dist/docs/xpl-button/readme.md +2 -0
- package/dist/docs/xpl-button-row/readme.md +13 -0
- package/dist/docs/xpl-checkbox/readme.md +23 -1
- package/dist/docs/xpl-divider/readme.md +22 -4
- package/dist/docs/xpl-input/readme.md +51 -0
- package/dist/docs/xpl-input/xpl-input-date/readme.md +7 -0
- package/dist/docs/xpl-input/xpl-input-phone/readme.md +21 -0
- package/dist/docs/xpl-popover/readme.md +24 -0
- package/dist/docs/xpl-radio/readme.md +21 -4
- package/dist/docs/xpl-side-nav/readme.md +153 -5
- package/dist/docs/xpl-side-nav/xpl-side-nav-item/readme.md +165 -32
- package/dist/docs/xpl-table/readme.md +2 -0
- package/dist/docs/xpl-tooltip/readme.md +29 -1
- package/dist/esm/apollo-core.js +4 -4
- package/dist/esm/{index-C7bgJs6C.js → index-CXkZUm1c.js} +36 -9
- package/dist/esm/loader.js +3 -3
- package/dist/esm/v4-CK3_k8jD.js +50 -0
- package/dist/esm/xpl-accordion.entry.js +3 -3
- package/dist/esm/xpl-application-shell.entry.js +2 -2
- package/dist/esm/xpl-avatar_54.entry.js +700 -176
- package/dist/esm/xpl-button-row.entry.js +2 -2
- package/dist/esm/xpl-calendar.entry.js +3 -3
- package/dist/esm/xpl-dynamic-table-cell.entry.js +3 -3
- package/dist/esm/xpl-dynamic-table-row.entry.js +3 -3
- package/dist/esm/xpl-dynamic-table.entry.js +2 -2
- package/dist/esm/xpl-grid-item.entry.js +2 -2
- package/dist/esm/xpl-grid.entry.js +2 -2
- package/dist/esm/xpl-large-card.entry.js +2 -2
- package/dist/esm/xpl-main-nav.entry.js +2 -2
- package/dist/esm/xpl-table-header-cell.entry.js +1 -1
- package/dist/esm/xpl-table-header.entry.js +2 -2
- package/dist/esm/xpl-toggle.entry.js +5 -5
- package/dist/esm/xpl-toolbar.entry.js +3 -3
- package/dist/types/components/xpl-banner/banner.stories.d.ts +2 -0
- package/dist/types/components/xpl-button/button.stories.d.ts +2 -0
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +16 -0
- package/dist/types/components/xpl-input/xpl-input-phone/xpl-input-phone.d.ts +1 -0
- package/dist/types/components/xpl-pagination/xpl-pagination.d.ts +4 -0
- package/dist/types/components/xpl-radio/radio.stories.d.ts +11 -10
- package/dist/types/components/xpl-side-nav/side-nav-constants.d.ts +2 -0
- package/dist/types/components/xpl-side-nav/side-nav.stories.d.ts +53 -32
- package/dist/types/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.d.ts +10 -0
- package/dist/types/components/xpl-side-nav/xpl-side-nav.d.ts +31 -0
- package/dist/types/components/xpl-spotlight/xpl-spotlight.d.ts +1 -0
- package/dist/types/components.d.ts +223 -20
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/package.json +33 -24
- package/dist/apollo-core/p-0bf50890.entry.js +0 -1
- package/dist/apollo-core/p-1947e7a8.entry.js +0 -1
- package/dist/apollo-core/p-27928cb0.entry.js +0 -1
- package/dist/apollo-core/p-34438721.entry.js +0 -1
- package/dist/apollo-core/p-35c2f72d.entry.js +0 -1
- package/dist/apollo-core/p-368c81f1.entry.js +0 -1
- package/dist/apollo-core/p-3bb14840.entry.js +0 -1
- package/dist/apollo-core/p-406b27a8.entry.js +0 -1
- package/dist/apollo-core/p-5d63b4ce.entry.js +0 -1
- package/dist/apollo-core/p-8d692d05.entry.js +0 -1
- package/dist/apollo-core/p-C7bgJs6C.js +0 -2
- package/dist/apollo-core/p-Cqlsd6nf.js +0 -1
- package/dist/apollo-core/p-cd56a3d5.entry.js +0 -1
- package/dist/apollo-core/p-dc205893.entry.js +0 -1
- package/dist/cjs/v4-D4KzFnn8.js +0 -67
- package/dist/components/index3.js +0 -1
- package/dist/components/v4.js +0 -1
- package/dist/components/xpl-avatar2.js +0 -1
- package/dist/components/xpl-backdrop2.js +0 -1
- package/dist/components/xpl-badge2.js +0 -1
- package/dist/components/xpl-button2.js +0 -1
- package/dist/components/xpl-checkbox2.js +0 -1
- package/dist/components/xpl-divider2.js +0 -1
- package/dist/components/xpl-dropdown-group2.js +0 -1
- package/dist/components/xpl-dropdown-heading2.js +0 -1
- package/dist/components/xpl-dropdown-option2.js +0 -1
- package/dist/components/xpl-dropdown2.js +0 -1
- package/dist/components/xpl-icon2.js +0 -1
- package/dist/components/xpl-input-date2.js +0 -1
- package/dist/components/xpl-input2.js +0 -1
- package/dist/components/xpl-list-item2.js +0 -1
- package/dist/components/xpl-popover2.js +0 -1
- package/dist/components/xpl-radio2.js +0 -1
- package/dist/components/xpl-select2.js +0 -1
- package/dist/components/xpl-tooltip2.js +0 -1
- package/dist/esm/v4-Cqlsd6nf.js +0 -65
- /package/dist/components/{_commonjsHelpers.js → p-BFTU3MAI.js} +0 -0
- /package/dist/components/{index2.js → p-CH4yJ6Qx.js} +0 -0
- /package/dist/components/{tab-a11y-ids.js → p-Yj_QFaRn.js} +0 -0
- /package/dist/{index.cjs.js → index.cjs} +0 -0
- /package/loader/{cdn.js → cdn.cjs} +0 -0
- /package/loader/{index.cjs.js → index.cjs} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
2
|
export class SideNavItem {
|
|
3
3
|
constructor() {
|
|
4
|
+
this.hasTrailingSlot = false;
|
|
4
5
|
this.disabled = false;
|
|
5
6
|
this.expanded = false;
|
|
6
7
|
this.hasChildren = false;
|
|
@@ -22,11 +23,66 @@ export class SideNavItem {
|
|
|
22
23
|
syncLinkHasChildrenExclusivity() {
|
|
23
24
|
this.enforceLinkExcludesHasChildren();
|
|
24
25
|
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
this.syncTrailingSlot();
|
|
28
|
+
this.connectTrailingSlotObserver();
|
|
29
|
+
}
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
if (this.trailingSlotSyncTimeoutId !== undefined) {
|
|
32
|
+
clearTimeout(this.trailingSlotSyncTimeoutId);
|
|
33
|
+
this.trailingSlotSyncTimeoutId = undefined;
|
|
34
|
+
}
|
|
35
|
+
this.disconnectTrailingSlotObserver();
|
|
36
|
+
}
|
|
25
37
|
componentWillLoad() {
|
|
26
38
|
this.syncLinkHasChildrenExclusivity();
|
|
39
|
+
this.syncTrailingSlot();
|
|
27
40
|
}
|
|
28
41
|
componentWillRender() {
|
|
29
42
|
this.syncLinkHasChildrenExclusivity();
|
|
43
|
+
this.disconnectTrailingSlotObserver();
|
|
44
|
+
}
|
|
45
|
+
componentDidRender() {
|
|
46
|
+
this.scheduleTrailingSlotSync();
|
|
47
|
+
}
|
|
48
|
+
connectTrailingSlotObserver() {
|
|
49
|
+
this.disconnectTrailingSlotObserver();
|
|
50
|
+
if (typeof MutationObserver === 'undefined') {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.trailingSlotObserver = new MutationObserver(() => {
|
|
54
|
+
this.scheduleTrailingSlotSync();
|
|
55
|
+
});
|
|
56
|
+
this.trailingSlotObserver.observe(this.el, {
|
|
57
|
+
childList: true,
|
|
58
|
+
subtree: true,
|
|
59
|
+
attributes: true,
|
|
60
|
+
attributeFilter: ['slot'],
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
disconnectTrailingSlotObserver() {
|
|
64
|
+
var _a;
|
|
65
|
+
(_a = this.trailingSlotObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
66
|
+
this.trailingSlotObserver = undefined;
|
|
67
|
+
}
|
|
68
|
+
scheduleTrailingSlotSync() {
|
|
69
|
+
if (this.trailingSlotSyncTimeoutId !== undefined) {
|
|
70
|
+
clearTimeout(this.trailingSlotSyncTimeoutId);
|
|
71
|
+
}
|
|
72
|
+
this.trailingSlotSyncTimeoutId = setTimeout(() => {
|
|
73
|
+
this.trailingSlotSyncTimeoutId = undefined;
|
|
74
|
+
if (!this.el.isConnected) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.syncTrailingSlot();
|
|
78
|
+
this.connectTrailingSlotObserver();
|
|
79
|
+
}, 0);
|
|
80
|
+
}
|
|
81
|
+
syncTrailingSlot() {
|
|
82
|
+
const next = Array.from(this.el.querySelectorAll('[slot="trailing"]')).some((node) => node.closest('xpl-side-nav-item') === this.el);
|
|
83
|
+
if (next !== this.hasTrailingSlot) {
|
|
84
|
+
this.hasTrailingSlot = next;
|
|
85
|
+
}
|
|
30
86
|
}
|
|
31
87
|
enforceLinkExcludesHasChildren() {
|
|
32
88
|
if (!this.link)
|
|
@@ -40,15 +96,20 @@ export class SideNavItem {
|
|
|
40
96
|
}
|
|
41
97
|
render() {
|
|
42
98
|
var _a;
|
|
43
|
-
const
|
|
99
|
+
const showAutoChevron = this.hasChildren && !this.hasTrailingSlot;
|
|
100
|
+
const buttonClass = {
|
|
44
101
|
'xpl-side-nav-item__link': true,
|
|
45
102
|
expanded: this.expanded,
|
|
46
103
|
selected: this.selected,
|
|
47
104
|
};
|
|
48
|
-
return (h(Host, { key: '
|
|
105
|
+
return (h(Host, { key: 'd20950311a1dd97fff43eac3908a64a43aa2a332', class: {
|
|
49
106
|
'xpl-side-nav-item': true,
|
|
50
107
|
'xpl-side-nav-item--link-disabled': this.link && this.disabled,
|
|
51
|
-
} }, this.link ? (h("slot", null)) : (h("button", { type: "button", class:
|
|
108
|
+
} }, this.link ? (h("slot", null)) : (h("button", { type: "button", class: buttonClass, "aria-current": this.selected ? 'page' : undefined, "aria-expanded": this.hasChildren ? (this.expanded ? 'true' : 'false') : undefined, onClick: this.handleClick, disabled: this.disabled }, h("span", { class: "xpl-side-nav-item__leading" }, h("slot", { name: "leading" }, this.icon ? (h("xpl-icon", { icon: this.icon, size: 16 })) : null)), h("span", { class: "xpl-side-nav-item__label" }, (_a = this.label) !== null && _a !== void 0 ? _a : ''), (this.hasTrailingSlot || this.hasChildren) && (h("span", { class: {
|
|
109
|
+
'xpl-side-nav-item__trailing': true,
|
|
110
|
+
'xpl-side-nav-item__trailing--chevron': showAutoChevron,
|
|
111
|
+
expanded: showAutoChevron && this.expanded,
|
|
112
|
+
}, "aria-hidden": showAutoChevron ? 'true' : undefined }, h("slot", { name: "trailing" }, showAutoChevron ? (h("xpl-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down', size: 16 })) : null))))), this.hasChildren && !this.link && (h("div", { key: 'b3aa86bdacae535dae31b93fa6f5013614f682bc', class: `xpl-side-nav-item__children ${this.expanded ? 'expanded' : ''}`, inert: !this.expanded ? true : undefined }, h("div", { key: '91be28afd11a250696e003d0a8abf70f6e8b35c6', class: "xpl-side-nav-item__children-inner" }, h("slot", { key: '1536a898b39fd1f30c26d9d71f79726e377ee8f2' }))))));
|
|
52
113
|
}
|
|
53
114
|
static get is() { return "xpl-side-nav-item"; }
|
|
54
115
|
static get properties() {
|
|
@@ -65,7 +126,7 @@ export class SideNavItem {
|
|
|
65
126
|
"optional": false,
|
|
66
127
|
"docs": {
|
|
67
128
|
"tags": [],
|
|
68
|
-
"text": "Whether the
|
|
129
|
+
"text": "Whether the item is currently disabled."
|
|
69
130
|
},
|
|
70
131
|
"getter": false,
|
|
71
132
|
"setter": false,
|
|
@@ -85,7 +146,7 @@ export class SideNavItem {
|
|
|
85
146
|
"optional": false,
|
|
86
147
|
"docs": {
|
|
87
148
|
"tags": [],
|
|
88
|
-
"text": "Whether the item is currently expanded (only applies when
|
|
149
|
+
"text": "Whether the item is currently expanded (only applies when `has-children` is true)."
|
|
89
150
|
},
|
|
90
151
|
"getter": false,
|
|
91
152
|
"setter": false,
|
|
@@ -105,7 +166,7 @@ export class SideNavItem {
|
|
|
105
166
|
"optional": false,
|
|
106
167
|
"docs": {
|
|
107
168
|
"tags": [],
|
|
108
|
-
"text": "Whether the item has child items; when true, shows expand/collapse and a default slot for nested items.\nMutually exclusive with
|
|
169
|
+
"text": "Whether the item has child items; when true, shows expand/collapse and a default slot for nested items.\nMutually exclusive with `link`. If `link` is already true, setting `has-children` is reverted."
|
|
109
170
|
},
|
|
110
171
|
"getter": false,
|
|
111
172
|
"setter": false,
|
|
@@ -125,7 +186,7 @@ export class SideNavItem {
|
|
|
125
186
|
"optional": false,
|
|
126
187
|
"docs": {
|
|
127
188
|
"tags": [],
|
|
128
|
-
"text": "Whether the component is hidden"
|
|
189
|
+
"text": "Whether the component is hidden."
|
|
129
190
|
},
|
|
130
191
|
"getter": false,
|
|
131
192
|
"setter": false,
|
|
@@ -145,7 +206,7 @@ export class SideNavItem {
|
|
|
145
206
|
"optional": true,
|
|
146
207
|
"docs": {
|
|
147
208
|
"tags": [],
|
|
148
|
-
"text": "Optional icon name; default content for
|
|
209
|
+
"text": "Optional icon name; renders as the default content for `slot=\"leading\"`.\nWhen `slot=\"leading\"` content is present, this prop is ignored.\nIn v2, this prop applies to all item types including parent rows (`has-children`)."
|
|
149
210
|
},
|
|
150
211
|
"getter": false,
|
|
151
212
|
"setter": false,
|
|
@@ -164,7 +225,7 @@ export class SideNavItem {
|
|
|
164
225
|
"optional": true,
|
|
165
226
|
"docs": {
|
|
166
227
|
"tags": [],
|
|
167
|
-
"text": "The display label for the navigation item (button / expandable rows; omit in
|
|
228
|
+
"text": "The display label for the navigation item (button / expandable rows; omit in `link` mode)."
|
|
168
229
|
},
|
|
169
230
|
"getter": false,
|
|
170
231
|
"setter": false,
|
|
@@ -183,7 +244,7 @@ export class SideNavItem {
|
|
|
183
244
|
"optional": false,
|
|
184
245
|
"docs": {
|
|
185
246
|
"tags": [],
|
|
186
|
-
"text": "When true, the row becomes a slot-only container for consumer-provided links.\nThe consumer provides the full anchor element (or router link) via the default slot.\nIn link mode,
|
|
247
|
+
"text": "When true, the row becomes a slot-only container for consumer-provided links.\nThe consumer provides the full anchor element (or router link) via the default slot.\nIn link mode, `label` and `icon` props should not be used.\nLink mode does not support `has-children`; use the default button mode for expandable items.\nWhen `link` is true, `hasChildren` is always false."
|
|
187
248
|
},
|
|
188
249
|
"getter": false,
|
|
189
250
|
"setter": false,
|
|
@@ -203,7 +264,7 @@ export class SideNavItem {
|
|
|
203
264
|
"optional": false,
|
|
204
265
|
"docs": {
|
|
205
266
|
"tags": [],
|
|
206
|
-
"text": "Whether the item is currently in a selected state"
|
|
267
|
+
"text": "Whether the item is currently in a selected state."
|
|
207
268
|
},
|
|
208
269
|
"getter": false,
|
|
209
270
|
"setter": false,
|
|
@@ -213,6 +274,11 @@ export class SideNavItem {
|
|
|
213
274
|
}
|
|
214
275
|
};
|
|
215
276
|
}
|
|
277
|
+
static get states() {
|
|
278
|
+
return {
|
|
279
|
+
"hasTrailingSlot": {}
|
|
280
|
+
};
|
|
281
|
+
}
|
|
216
282
|
static get events() {
|
|
217
283
|
return [{
|
|
218
284
|
"method": "expandedChange",
|
|
@@ -222,7 +288,7 @@ export class SideNavItem {
|
|
|
222
288
|
"composed": true,
|
|
223
289
|
"docs": {
|
|
224
290
|
"tags": [],
|
|
225
|
-
"text": "Emitted when the expanded state changes (
|
|
291
|
+
"text": "Emitted when the expanded state changes (`has-children` items only). Detail is the new expanded value."
|
|
226
292
|
},
|
|
227
293
|
"complexType": {
|
|
228
294
|
"original": "boolean",
|
|
@@ -237,7 +303,7 @@ export class SideNavItem {
|
|
|
237
303
|
"composed": true,
|
|
238
304
|
"docs": {
|
|
239
305
|
"tags": [],
|
|
240
|
-
"text": "Emitted when a leaf item is clicked. Expandable parents use expandedChange instead."
|
|
306
|
+
"text": "Emitted when a leaf item is clicked. Expandable parents use `expandedChange` instead."
|
|
241
307
|
},
|
|
242
308
|
"complexType": {
|
|
243
309
|
"original": "void",
|
|
@@ -1,9 +1,203 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
|
+
import { SIDE_NAV_CLOSE_ANIMATION_MS, SIDE_NAV_MOBILE_MQ } from "./side-nav-constants";
|
|
2
3
|
export class SideNav {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.drawerClosing = false;
|
|
6
|
+
this.open = false;
|
|
7
|
+
this.onViewportChange = () => {
|
|
8
|
+
this.clearCloseTransition();
|
|
9
|
+
this.syncDocKeyDownListener();
|
|
10
|
+
};
|
|
11
|
+
this.focusToggleAfterClose = () => {
|
|
12
|
+
if (!this.isBelowMdBreakpoint())
|
|
13
|
+
return;
|
|
14
|
+
if (this.toggleFocusTimeoutId !== undefined) {
|
|
15
|
+
clearTimeout(this.toggleFocusTimeoutId);
|
|
16
|
+
}
|
|
17
|
+
this.toggleFocusTimeoutId = setTimeout(() => {
|
|
18
|
+
var _a;
|
|
19
|
+
this.toggleFocusTimeoutId = undefined;
|
|
20
|
+
(_a = this.el.querySelector('.xpl-side-nav__toggle button')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
21
|
+
}, 0);
|
|
22
|
+
};
|
|
23
|
+
this.focusDrawerOnOpen = () => {
|
|
24
|
+
if (!this.isBelowMdBreakpoint())
|
|
25
|
+
return;
|
|
26
|
+
if (this.drawerFocusTimeoutId !== undefined) {
|
|
27
|
+
clearTimeout(this.drawerFocusTimeoutId);
|
|
28
|
+
}
|
|
29
|
+
this.drawerFocusTimeoutId = setTimeout(() => {
|
|
30
|
+
var _a;
|
|
31
|
+
this.drawerFocusTimeoutId = undefined;
|
|
32
|
+
const wrapper = this.el.querySelector('.xpl-side-nav__wrapper');
|
|
33
|
+
const first = wrapper
|
|
34
|
+
? this.getFocusableElements().find((el) => wrapper.contains(el))
|
|
35
|
+
: undefined;
|
|
36
|
+
const fallback = this.el.querySelector('.xpl-side-nav__toggle button');
|
|
37
|
+
(_a = (first !== null && first !== void 0 ? first : fallback)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
38
|
+
}, 0);
|
|
39
|
+
};
|
|
40
|
+
this.onBackdropClick = () => this.setOpenState(false);
|
|
41
|
+
this.onDocKeyDown = (e) => {
|
|
42
|
+
if (!this.isMobileDrawerActive())
|
|
43
|
+
return;
|
|
44
|
+
if (this.shouldYieldFocusToExternalModal())
|
|
45
|
+
return;
|
|
46
|
+
switch (e.key.toLowerCase()) {
|
|
47
|
+
case 'escape': {
|
|
48
|
+
if (!this.open)
|
|
49
|
+
return;
|
|
50
|
+
if (this.anyDescendantPopoverIsOpen())
|
|
51
|
+
return;
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
this.setOpenState(false);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
case 'tab': {
|
|
58
|
+
this.trapTabKey(e);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
default: {
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
this.onToggleClick = () => this.setOpenState(!this.open);
|
|
67
|
+
}
|
|
68
|
+
onOpenChanged(newValue, oldValue) {
|
|
69
|
+
if (oldValue && !newValue && this.isBelowMdBreakpoint()) {
|
|
70
|
+
this.drawerClosing = true;
|
|
71
|
+
if (this.closeTransitionTimeoutId !== undefined) {
|
|
72
|
+
clearTimeout(this.closeTransitionTimeoutId);
|
|
73
|
+
}
|
|
74
|
+
this.closeTransitionTimeoutId = setTimeout(() => {
|
|
75
|
+
this.closeTransitionTimeoutId = undefined;
|
|
76
|
+
this.drawerClosing = false;
|
|
77
|
+
this.syncDocKeyDownListener();
|
|
78
|
+
}, SIDE_NAV_CLOSE_ANIMATION_MS);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.clearCloseTransition();
|
|
82
|
+
}
|
|
83
|
+
this.syncDocKeyDownListener();
|
|
84
|
+
if (oldValue && !newValue)
|
|
85
|
+
this.focusToggleAfterClose();
|
|
86
|
+
if (!oldValue && newValue)
|
|
87
|
+
this.focusDrawerOnOpen();
|
|
88
|
+
}
|
|
89
|
+
connectedCallback() {
|
|
90
|
+
if (typeof window !== 'undefined') {
|
|
91
|
+
this.mobileMq = window.matchMedia(SIDE_NAV_MOBILE_MQ);
|
|
92
|
+
this.mobileMq.addEventListener('change', this.onViewportChange);
|
|
93
|
+
}
|
|
94
|
+
this.syncDocKeyDownListener();
|
|
95
|
+
}
|
|
96
|
+
componentDidLoad() {
|
|
97
|
+
if (this.open) {
|
|
98
|
+
this.syncDocKeyDownListener();
|
|
99
|
+
this.focusDrawerOnOpen();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
disconnectedCallback() {
|
|
103
|
+
var _a;
|
|
104
|
+
if (this.toggleFocusTimeoutId !== undefined) {
|
|
105
|
+
clearTimeout(this.toggleFocusTimeoutId);
|
|
106
|
+
this.toggleFocusTimeoutId = undefined;
|
|
107
|
+
}
|
|
108
|
+
if (this.drawerFocusTimeoutId !== undefined) {
|
|
109
|
+
clearTimeout(this.drawerFocusTimeoutId);
|
|
110
|
+
this.drawerFocusTimeoutId = undefined;
|
|
111
|
+
}
|
|
112
|
+
this.clearCloseTransition();
|
|
113
|
+
(_a = this.mobileMq) === null || _a === void 0 ? void 0 : _a.removeEventListener('change', this.onViewportChange);
|
|
114
|
+
this.mobileMq = undefined;
|
|
115
|
+
this.removeDocKeyDownListener();
|
|
116
|
+
}
|
|
117
|
+
async toggle() {
|
|
118
|
+
this.setOpenState(!this.open);
|
|
119
|
+
}
|
|
120
|
+
async setOpen(open) {
|
|
121
|
+
this.setOpenState(open);
|
|
122
|
+
}
|
|
123
|
+
removeDocKeyDownListener() {
|
|
124
|
+
this.el.ownerDocument.removeEventListener('keydown', this.onDocKeyDown, false);
|
|
125
|
+
}
|
|
126
|
+
syncDocKeyDownListener() {
|
|
127
|
+
this.removeDocKeyDownListener();
|
|
128
|
+
if (this.isMobileDrawerActive()) {
|
|
129
|
+
this.el.ownerDocument.addEventListener('keydown', this.onDocKeyDown, false);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
isBelowMdBreakpoint() {
|
|
133
|
+
var _a, _b;
|
|
134
|
+
return (_b = (_a = this.mobileMq) === null || _a === void 0 ? void 0 : _a.matches) !== null && _b !== void 0 ? _b : false;
|
|
135
|
+
}
|
|
136
|
+
isMobileDrawerActive() {
|
|
137
|
+
return (this.open || this.drawerClosing) && this.isBelowMdBreakpoint();
|
|
138
|
+
}
|
|
139
|
+
clearCloseTransition() {
|
|
140
|
+
if (this.closeTransitionTimeoutId !== undefined) {
|
|
141
|
+
clearTimeout(this.closeTransitionTimeoutId);
|
|
142
|
+
this.closeTransitionTimeoutId = undefined;
|
|
143
|
+
}
|
|
144
|
+
this.drawerClosing = false;
|
|
145
|
+
}
|
|
146
|
+
shouldYieldFocusToExternalModal() {
|
|
147
|
+
const active = this.el.ownerDocument.activeElement;
|
|
148
|
+
if (!active || this.el.contains(active))
|
|
149
|
+
return false;
|
|
150
|
+
return active.closest('[aria-modal="true"]') !== null;
|
|
151
|
+
}
|
|
152
|
+
anyDescendantPopoverIsOpen() {
|
|
153
|
+
const hosts = this.el.querySelectorAll('xpl-popover');
|
|
154
|
+
for (let i = 0; i < hosts.length; i += 1) {
|
|
155
|
+
const inner = hosts[i].querySelector('.xpl-popover');
|
|
156
|
+
if (inner === null || inner === void 0 ? void 0 : inner.classList.contains('xpl-popover--is-open')) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
setOpenState(open) {
|
|
163
|
+
const wasOpen = this.open;
|
|
164
|
+
if (open === wasOpen)
|
|
165
|
+
return;
|
|
166
|
+
this.open = open;
|
|
167
|
+
this.openChange.emit(open);
|
|
168
|
+
if (wasOpen && !open)
|
|
169
|
+
this.focusToggleAfterClose();
|
|
170
|
+
}
|
|
171
|
+
getFocusableElements() {
|
|
172
|
+
const selector = 'button:not([disabled]), a[href]:not([tabindex="-1"]), input:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
173
|
+
const active = this.el.ownerDocument.activeElement;
|
|
174
|
+
return Array.from(this.el.querySelectorAll(selector)).filter((node) => !node.closest('[inert]') && (node.offsetParent !== null || node === active));
|
|
175
|
+
}
|
|
176
|
+
trapTabKey(e) {
|
|
177
|
+
if (this.shouldYieldFocusToExternalModal())
|
|
178
|
+
return;
|
|
179
|
+
const focusable = this.getFocusableElements();
|
|
180
|
+
if (focusable.length === 0)
|
|
181
|
+
return;
|
|
182
|
+
const first = focusable[0];
|
|
183
|
+
const last = focusable[focusable.length - 1];
|
|
184
|
+
const active = this.el.ownerDocument.activeElement;
|
|
185
|
+
if (e.shiftKey) {
|
|
186
|
+
if (active === first || !this.el.contains(active)) {
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
last.focus();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else if (active === last || !this.el.contains(active)) {
|
|
192
|
+
e.preventDefault();
|
|
193
|
+
first.focus();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
3
196
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
197
|
+
return (h(Host, { key: 'fe3b0b9e5f9facf3f7fa469a8928d7ed8971e6f5', class: {
|
|
5
198
|
'xpl-side-nav': true,
|
|
6
|
-
|
|
199
|
+
'xpl-side-nav--open': this.open,
|
|
200
|
+
} }, h("xpl-button", { key: '09d0de65b9a40446a4801087e91c1bf3e1d3989a', class: "xpl-side-nav__toggle", variant: "tertiary", iconOnly: true, icon: this.open ? 'sidebar-left-hide' : 'sidebar-left-show', "aria-expanded": this.open ? 'true' : 'false', "aria-label": this.open ? 'Close navigation menu' : 'Open navigation menu', onClick: this.onToggleClick }), h("div", { key: '3274980b1cb4867d163e83c80520e44bcc8d0121', class: "xpl-side-nav__wrapper" }, h("nav", { key: '06ce207917af66ff8f238c6cc85e8a8d5f47efbc', class: "xpl-side-nav__content", "aria-label": this.label }, h("div", { key: 'ce08165951c7b40fc21e846f6dfe7ca44b57326d', class: "xpl-side-nav__section" }, h("slot", { key: 'da65836d8006756b3a0d408d343b445a3bccb271', name: "section" })), h("div", { key: '93b522d531086a914d2cd53fe859da2436df9552', class: "xpl-side-nav__footer" }, h("slot", { key: 'a2cce3bec1d5269316388ede23934d2cfb835cf9', name: "nav-footer" })))), h("xpl-backdrop", { key: 'e98662f2e022d9d9edfa16b2c62d3ca40755b829', class: "xpl-side-nav__backdrop", onClick: this.onBackdropClick })));
|
|
7
201
|
}
|
|
8
202
|
static get is() { return "xpl-side-nav"; }
|
|
9
203
|
static get properties() {
|
|
@@ -26,7 +220,94 @@ export class SideNav {
|
|
|
26
220
|
"setter": false,
|
|
27
221
|
"reflect": false,
|
|
28
222
|
"attribute": "label"
|
|
223
|
+
},
|
|
224
|
+
"open": {
|
|
225
|
+
"type": "boolean",
|
|
226
|
+
"mutable": true,
|
|
227
|
+
"complexType": {
|
|
228
|
+
"original": "boolean",
|
|
229
|
+
"resolved": "boolean",
|
|
230
|
+
"references": {}
|
|
231
|
+
},
|
|
232
|
+
"required": false,
|
|
233
|
+
"optional": false,
|
|
234
|
+
"docs": {
|
|
235
|
+
"tags": [],
|
|
236
|
+
"text": "Whether the mobile drawer is open. Reflected to the `open` attribute so CSS and\nhost state stay in sync. Controlled (consumer owns `open`) or uncontrolled\n(built-in toggle flips it). Has no visible effect above the `md` breakpoint,\nwhere the sidebar always renders inline."
|
|
237
|
+
},
|
|
238
|
+
"getter": false,
|
|
239
|
+
"setter": false,
|
|
240
|
+
"reflect": true,
|
|
241
|
+
"attribute": "open",
|
|
242
|
+
"defaultValue": "false"
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
static get events() {
|
|
247
|
+
return [{
|
|
248
|
+
"method": "openChange",
|
|
249
|
+
"name": "openChange",
|
|
250
|
+
"bubbles": true,
|
|
251
|
+
"cancelable": true,
|
|
252
|
+
"composed": true,
|
|
253
|
+
"docs": {
|
|
254
|
+
"tags": [],
|
|
255
|
+
"text": "Emitted when the mobile drawer open state changes: toggle activation, Escape,\nor a backdrop click. Detail is the new open state (`true` = open, `false` = closed)."
|
|
256
|
+
},
|
|
257
|
+
"complexType": {
|
|
258
|
+
"original": "boolean",
|
|
259
|
+
"resolved": "boolean",
|
|
260
|
+
"references": {}
|
|
261
|
+
}
|
|
262
|
+
}];
|
|
263
|
+
}
|
|
264
|
+
static get methods() {
|
|
265
|
+
return {
|
|
266
|
+
"toggle": {
|
|
267
|
+
"complexType": {
|
|
268
|
+
"signature": "() => Promise<void>",
|
|
269
|
+
"parameters": [],
|
|
270
|
+
"references": {
|
|
271
|
+
"Promise": {
|
|
272
|
+
"location": "global",
|
|
273
|
+
"id": "global::Promise"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"return": "Promise<void>"
|
|
277
|
+
},
|
|
278
|
+
"docs": {
|
|
279
|
+
"text": "Programmatically toggle the mobile drawer open/closed. Emits `openChange`.",
|
|
280
|
+
"tags": []
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"setOpen": {
|
|
284
|
+
"complexType": {
|
|
285
|
+
"signature": "(open: boolean) => Promise<void>",
|
|
286
|
+
"parameters": [{
|
|
287
|
+
"name": "open",
|
|
288
|
+
"type": "boolean",
|
|
289
|
+
"docs": ""
|
|
290
|
+
}],
|
|
291
|
+
"references": {
|
|
292
|
+
"Promise": {
|
|
293
|
+
"location": "global",
|
|
294
|
+
"id": "global::Promise"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"return": "Promise<void>"
|
|
298
|
+
},
|
|
299
|
+
"docs": {
|
|
300
|
+
"text": "Programmatically set the mobile drawer open state. Emits `openChange` when it changes.",
|
|
301
|
+
"tags": []
|
|
302
|
+
}
|
|
29
303
|
}
|
|
30
304
|
};
|
|
31
305
|
}
|
|
306
|
+
static get elementRef() { return "el"; }
|
|
307
|
+
static get watchers() {
|
|
308
|
+
return [{
|
|
309
|
+
"propName": "open",
|
|
310
|
+
"methodName": "onOpenChanged"
|
|
311
|
+
}];
|
|
312
|
+
}
|
|
32
313
|
}
|
|
@@ -5,7 +5,7 @@ export class Skeleton {
|
|
|
5
5
|
this.size = 'custom';
|
|
6
6
|
}
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: '2cb86d68bd14f87ab1a6467716ec456cc1bfd6a2', class: {
|
|
9
9
|
'xpl-skeleton': true,
|
|
10
10
|
[`xpl-skeleton--shape-${this.shape}`]: true,
|
|
11
11
|
[`xpl-skeleton--size-${this.size}`]: true,
|
|
@@ -26,7 +26,7 @@ export class Slideout {
|
|
|
26
26
|
this.handleScroll();
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h(Host, { key: '
|
|
29
|
+
return (h(Host, { key: 'f42f8f576d4e8387511d0cd5e5a24913606dce5e', class: "xpl-slideout" }, this.backdrop && this.isOpen && (h("xpl-backdrop", { key: '5e80a7f340487ee653d266edc8d7cbd7a1ae5a52', onClick: this.handleClose })), h("aside", { key: 'beb647a98119f53d01a911af9df5ea97babad7c1', class: `slideout slideout--${!this.isOpen && 'closed'}` }, h("header", { key: 'ef3ba3c61fd5542696c271d0d3d3d40214a2605e', class: "header" }, h("div", { key: 'ed343a1553fb5da4d5db9f6a746f89eadf258f68', class: "title" }, h("slot", { key: '0793234025cb9ed92e45805f74ad85928c71f585', name: "title" }), h("xpl-button", { key: 'b9049478a5ac330b6439fc5a71440db634d51b5e', class: "close-button", "icon-only": true, size: "sm", variant: "tertiary", onClick: this.handleClose }, h("xpl-icon", { key: '1dad5a0fc6d0b1888a450639b9f40d694b9942db', icon: "x" }))), h("div", { key: 'c5f3f124e81ce4b916af4dd114c8ce9b45d567c7', class: "subtitle" }, h("slot", { key: '41d10f0742562a8dc824b45b2987d45dda76abb4', name: "subtitle" })), h("div", { key: '5a60f3f9e9c5fd86d8262f47eea7b83f64e149a2', class: "search" }, h("slot", { key: '80f950ece315afe975aed51ac8a10804670eb8fe', name: "search" }))), h("xpl-divider", { key: '02e53e01c2f148c8bbd54b086bac669ee65014ba', tier: 0, class: "divider top" }), h("article", { key: '5425462fe1ef6104c5d8c7d5c4c892cf77349d38', class: "content", tabIndex: 0 }, h("slot", { key: '370dd088e84a33112f7f3e1c46341f521430485a', name: "content" })), this.showFooter && (h("footer", { key: 'becd0aea10f8a35af12cedae53814b1c9db92669' }, h("xpl-divider", { key: '5f53e23fbd9330d1b28ba705a7b9438ba098a6a7', tier: 0, class: "divider bottom" }), h("div", { key: '00c0c39b04999a12b47d5fe35bceae2ac8dc1def', class: "footer" }, h("slot", { key: '024d1c72ac7ab44b93608020ef20619b504d6725', name: "tertiary" }), h("slot", { key: '199910e96905946e393fcd600ddc7878701be5fb', name: "secondary" }), h("slot", { key: '55f351a5bb4c18833c5db4408ce01b01c1853fe3', name: "primary" })))))));
|
|
30
30
|
}
|
|
31
31
|
static get is() { return "xpl-slideout"; }
|
|
32
32
|
static get properties() {
|
|
@@ -150,6 +150,7 @@ export class Spotlight {
|
|
|
150
150
|
this.hasFloatingPosition = false;
|
|
151
151
|
this.hasImageSlotContent = false;
|
|
152
152
|
this.hasTitleSlotContent = false;
|
|
153
|
+
this.dialogLabelId = undefined;
|
|
153
154
|
this.isVisible = false;
|
|
154
155
|
this.resolvedAnchorPosition = 'top-left';
|
|
155
156
|
this.actionLayout = 'default';
|
|
@@ -326,6 +327,7 @@ export class Spotlight {
|
|
|
326
327
|
this.hasBodySlotContent = this.hasSlottedContent('body');
|
|
327
328
|
this.hasImageSlotContent = this.hasSlottedContent('image');
|
|
328
329
|
this.hasTitleSlotContent = this.hasSlottedContent('title');
|
|
330
|
+
this.dialogLabelId = this.getDialogLabelId();
|
|
329
331
|
if (this.isOpenEnabled) {
|
|
330
332
|
this.previousFocus =
|
|
331
333
|
document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
@@ -356,6 +358,10 @@ export class Spotlight {
|
|
|
356
358
|
if (this.isOpenEnabled) {
|
|
357
359
|
this.syncTitleSlotIds();
|
|
358
360
|
}
|
|
361
|
+
const nextLabelId = this.getDialogLabelId();
|
|
362
|
+
if (this.dialogLabelId !== nextLabelId) {
|
|
363
|
+
this.dialogLabelId = nextLabelId;
|
|
364
|
+
}
|
|
359
365
|
if (this.pendingEnterVisible && this.isOpenEnabled) {
|
|
360
366
|
this.pendingEnterVisible = false;
|
|
361
367
|
this.enterVisibleFrameId = requestAnimationFrame(() => {
|
|
@@ -524,10 +530,13 @@ export class Spotlight {
|
|
|
524
530
|
return fromHost;
|
|
525
531
|
}
|
|
526
532
|
const slot = this.el.querySelector('slot[name="title"]');
|
|
527
|
-
if (
|
|
528
|
-
|
|
533
|
+
if (slot && typeof slot.assignedNodes === 'function') {
|
|
534
|
+
const assigned = Array.from(slot.assignedNodes({ flatten: true })).find((node) => node.nodeType === Node.ELEMENT_NODE);
|
|
535
|
+
if (assigned) {
|
|
536
|
+
return assigned;
|
|
537
|
+
}
|
|
529
538
|
}
|
|
530
|
-
return (
|
|
539
|
+
return (_a = this.el.querySelector('[slot="title"]')) !== null && _a !== void 0 ? _a : null;
|
|
531
540
|
}
|
|
532
541
|
getDialogLabelId() {
|
|
533
542
|
if (this.hasTitleSlotContent) {
|
|
@@ -680,7 +689,7 @@ export class Spotlight {
|
|
|
680
689
|
'xpl-spotlight--only-primary-action': showActions && showPrimaryAction && !showSecondaryAction,
|
|
681
690
|
'xpl-spotlight--only-secondary-action': showActions && showSecondaryAction && !showPrimaryAction,
|
|
682
691
|
'xpl-spotlight--visible': this.isVisible,
|
|
683
|
-
}, role: "dialog", "aria-modal": "false", "aria-label": this.
|
|
692
|
+
}, role: "dialog", "aria-modal": "false", "aria-label": this.dialogLabelId ? undefined : 'Tour step', "aria-labelledby": this.dialogLabelId, tabindex: -1 }, h("button", { type: "button", class: "xpl-spotlight__target", "aria-label": "Spotlight indicator", onClick: this.handleTargetClick }, h("div", { class: "xpl-spotlight__target-outer" }), h("div", { class: "xpl-spotlight__target-inner" })), this.isDismissibleEnabled && (h("div", { class: "xpl-spotlight__dismiss" }, h("xpl-button", { variant: "secondary", size: "sm", iconOnly: true, "aria-label": "Dismiss tour step", onClick: this.handleDismissClick }, h("xpl-icon", { icon: "xmark", size: 16 })))), h("div", { class: "xpl-spotlight__frame" }, h("div", { class: {
|
|
684
693
|
'xpl-spotlight__image-container': true,
|
|
685
694
|
'xpl-spotlight__image-container--empty': !this.hasImageSlotContent,
|
|
686
695
|
'xpl-spotlight__image-container--hidden': !showImage,
|
|
@@ -993,6 +1002,7 @@ export class Spotlight {
|
|
|
993
1002
|
"hasFloatingPosition": {},
|
|
994
1003
|
"hasImageSlotContent": {},
|
|
995
1004
|
"hasTitleSlotContent": {},
|
|
1005
|
+
"dialogLabelId": {},
|
|
996
1006
|
"isVisible": {},
|
|
997
1007
|
"resolvedAnchorPosition": {}
|
|
998
1008
|
};
|
|
@@ -10,10 +10,10 @@ export class TabPanel {
|
|
|
10
10
|
const t = (_a = this.target) !== null && _a !== void 0 ? _a : '';
|
|
11
11
|
const panelId = tabPanelDomId(groupId, t);
|
|
12
12
|
const labelledBy = tabTriggerId(groupId, t);
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: '90f81b56f9d1d482ebe9bfb3e11a9b796bdbc5d2', "aria-labelledby": labelledBy, class: {
|
|
14
14
|
'xpl-tab-panel': true,
|
|
15
15
|
'xpl-tab-panel--selected': this.selected,
|
|
16
|
-
}, id: panelId, role: "tabpanel" }, h("slot", { key: '
|
|
16
|
+
}, id: panelId, role: "tabpanel" }, h("slot", { key: 'b2de2e79c06bde4bde5c99cc3d91045b1e73b72e' })));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "xpl-tab-panel"; }
|
|
19
19
|
static get properties() {
|