@xplortech/apollo-core 2.6.0 → 2.7.1
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 +626 -35
- package/build/style.css +5949 -3070
- package/dist/apollo-core/apollo-core.css +29 -19
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-0bf50890.entry.js +1 -0
- package/dist/apollo-core/p-1947e7a8.entry.js +1 -0
- package/dist/apollo-core/p-27928cb0.entry.js +1 -0
- package/dist/apollo-core/{p-5549756c.entry.js → p-34438721.entry.js} +1 -1
- package/dist/apollo-core/p-35c2f72d.entry.js +1 -0
- package/dist/apollo-core/p-368c81f1.entry.js +1 -0
- package/dist/apollo-core/{p-f5af9539.entry.js → p-36ba29da.entry.js} +1 -1
- package/dist/apollo-core/p-406b27a8.entry.js +1 -0
- package/dist/apollo-core/p-5d63b4ce.entry.js +1 -0
- package/dist/apollo-core/{p-02167464.entry.js → p-6a15f1e0.entry.js} +1 -1
- package/dist/apollo-core/p-8d692d05.entry.js +1 -0
- package/dist/apollo-core/{p-C_Z2nG0p.js → p-C7bgJs6C.js} +2 -2
- package/dist/apollo-core/{p-42016063.entry.js → p-b61d7952.entry.js} +1 -1
- package/dist/apollo-core/{p-8a1affce.entry.js → p-ca127ee8.entry.js} +1 -1
- package/dist/apollo-core/p-d1c9c233.entry.js +1 -0
- package/dist/apollo-core/p-dc205893.entry.js +1 -0
- package/dist/apollo-core/p-e2a5d41c.entry.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +3 -3
- package/dist/cjs/{index-DH6pgWru.js → index-BQ97-AWw.js} +18 -7
- package/dist/cjs/loader.cjs.js +2 -2
- 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_47.cjs.entry.js → xpl-avatar_54.cjs.entry.js} +3726 -536
- package/dist/cjs/xpl-button-row.cjs.entry.js +2 -2
- package/dist/cjs/xpl-calendar.cjs.entry.js +2 -2
- 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 +4 -4
- package/dist/cjs/xpl-toolbar.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +11 -5
- 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-avatar/avatar.stories.js +122 -107
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +249 -15
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
- package/dist/collection/components/xpl-badge/badge.stories.js +1 -33
- package/dist/collection/components/xpl-badge/xpl-badge.js +1 -1
- package/dist/collection/components/xpl-banner/xpl-banner.js +4 -3
- 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/xpl-button.js +21 -3
- 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 +25 -3
- 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 +77 -7
- 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 +96 -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 +5 -5
- package/dist/collection/components/xpl-input/xpl-input-search/xpl-input-search.js +485 -0
- package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +2 -2
- package/dist/collection/components/xpl-input/xpl-input.js +130 -18
- package/dist/collection/components/xpl-large-card/xpl-large-card.js +1 -1
- package/dist/collection/components/xpl-list/list.stories.js +300 -63
- package/dist/collection/components/xpl-list/xpl-list-item/xpl-list-item.js +818 -0
- package/dist/collection/components/xpl-list/xpl-list.js +579 -21
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +1 -1
- package/dist/collection/components/xpl-modal/xpl-modal.js +1 -1
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +2 -2
- package/dist/collection/components/xpl-pagination/pagination.stories.js +18 -0
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +7 -3
- package/dist/collection/components/xpl-panel/panel.stories.js +5 -3
- package/dist/collection/components/xpl-panel/xpl-panel.js +3 -3
- 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/progress-indicator.stories.js +118 -0
- package/dist/collection/components/xpl-progress-indicator/xpl-progress-indicator.js +171 -0
- 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 +58 -6
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +2 -2
- package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +2 -2
- 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/spotlight.stories.js +385 -0
- package/dist/collection/components/xpl-spotlight/xpl-spotlight.js +1085 -0
- package/dist/collection/components/xpl-tab/xpl-tab.js +261 -8
- package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +22 -15
- package/dist/collection/components/xpl-table/xpl-table.js +5 -5
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +1 -1
- package/dist/collection/components/xpl-tabs/segment-control.stories.js +31 -0
- package/dist/collection/components/xpl-tabs/tabs.shared.js +156 -0
- package/dist/collection/components/xpl-tabs/tabs.stories.js +10 -60
- package/dist/collection/components/xpl-tabs/xpl-tabs.js +338 -62
- package/dist/collection/components/xpl-tag/tag.stories.js +153 -0
- package/dist/collection/components/xpl-tag/xpl-tag.js +312 -9
- 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/xpl-tooltip.js +1 -1
- package/dist/collection/components/xpl-top-nav/top-nav.stories.js +625 -0
- package/dist/collection/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.js +122 -0
- package/dist/collection/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.js +481 -0
- package/dist/collection/components/xpl-top-nav/xpl-top-nav.js +433 -0
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +1 -1
- package/dist/collection/utils/lifecycle.js +79 -0
- package/dist/collection/utils/tab-a11y-ids.js +22 -0
- package/dist/components/floating-ui.dom.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/tab-a11y-ids.js +1 -0
- package/dist/components/xpl-accordion.js +1 -1
- package/dist/components/xpl-application-shell.js +1 -1
- package/dist/components/xpl-avatar2.js +1 -1
- package/dist/components/xpl-backdrop2.js +1 -1
- package/dist/components/xpl-badge2.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-button2.js +1 -1
- package/dist/components/xpl-calendar.js +1 -1
- package/dist/components/xpl-checkbox2.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-divider2.js +1 -1
- package/dist/components/xpl-dropdown-group2.js +1 -1
- package/dist/components/xpl-dropdown-heading2.js +1 -1
- package/dist/components/xpl-dropdown-option2.js +1 -1
- package/dist/components/xpl-dropdown2.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-icon2.js +1 -1
- package/dist/components/xpl-input-date2.js +1 -1
- package/dist/components/xpl-input-file2.js +1 -1
- package/dist/components/xpl-input-search.d.ts +11 -0
- package/dist/components/xpl-input-search.js +1 -0
- package/dist/components/xpl-input-search2.js +1 -0
- package/dist/components/xpl-input2.js +1 -1
- package/dist/components/xpl-large-card.js +1 -1
- package/dist/components/{xpl-progress.d.ts → xpl-list-item.d.ts} +4 -4
- package/dist/components/xpl-list-item.js +1 -0
- package/dist/components/xpl-list-item2.js +1 -0
- 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.d.ts +11 -0
- package/dist/components/xpl-nav-header-menu.js +1 -0
- 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-popover2.js +1 -1
- package/dist/components/xpl-progress-bar.js +1 -1
- package/dist/components/xpl-progress-indicator.d.ts +11 -0
- package/dist/components/xpl-progress-indicator.js +1 -0
- package/dist/components/xpl-radio2.js +1 -1
- package/dist/components/xpl-secondary-nav.js +1 -1
- package/dist/components/xpl-select2.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.d.ts +11 -0
- package/dist/components/xpl-spotlight.js +1 -0
- package/dist/components/xpl-tab-panel.js +1 -1
- package/dist/components/xpl-tab.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-tag2.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-tooltip2.js +1 -1
- package/dist/components/xpl-top-nav-item.d.ts +11 -0
- package/dist/components/xpl-top-nav-item.js +1 -0
- package/dist/components/xpl-top-nav-item2.js +1 -0
- package/dist/components/xpl-top-nav.d.ts +11 -0
- package/dist/components/xpl-top-nav.js +1 -0
- package/dist/components/xpl-utility-bar.js +1 -1
- package/dist/docs/xpl-avatar/readme.md +289 -15
- package/dist/docs/xpl-badge/readme.md +14 -9
- package/dist/docs/xpl-banner/readme.md +48 -11
- package/dist/docs/xpl-button/readme.md +28 -18
- package/dist/docs/xpl-calendar/readme.md +1 -1
- package/dist/docs/xpl-checkbox/readme.md +12 -11
- package/dist/docs/xpl-divider/readme.md +6 -4
- package/dist/docs/xpl-dropdown/readme.md +14 -12
- package/dist/docs/xpl-icon/readme.md +14 -2
- package/dist/docs/xpl-input/readme.md +66 -41
- package/dist/docs/xpl-input/xpl-input-color/readme.md +1 -0
- package/dist/docs/xpl-input/xpl-input-phone/readme.md +1 -0
- package/dist/docs/xpl-input/xpl-input-search/readme.md +175 -0
- package/dist/docs/xpl-input/xpl-input-time/readme.md +1 -0
- package/dist/docs/xpl-list/readme.md +320 -10
- package/dist/docs/xpl-list/xpl-list-item/readme.md +99 -0
- package/dist/docs/xpl-pagination/readme.md +1 -0
- package/dist/docs/xpl-panel/readme.md +108 -17
- package/dist/docs/xpl-popover/readme.md +2 -0
- package/dist/docs/xpl-progress-indicator/readme.md +234 -0
- package/dist/docs/xpl-radio/readme.md +6 -4
- package/dist/docs/xpl-select/readme.md +19 -16
- package/dist/docs/xpl-side-nav/readme.md +2 -2
- package/dist/docs/xpl-slideout/readme.md +1 -1
- package/dist/docs/xpl-spotlight/readme.md +235 -0
- package/dist/docs/xpl-tab/readme.md +43 -7
- package/dist/docs/xpl-tab-panel/readme.md +42 -0
- package/dist/docs/xpl-tabs/readme.md +62 -8
- package/dist/docs/xpl-tag/readme.md +379 -4
- package/dist/docs/xpl-toast/readme.md +1 -1
- package/dist/docs/xpl-top-nav/readme.md +179 -0
- package/dist/docs/xpl-top-nav/xpl-nav-header-menu/readme.md +81 -0
- package/dist/docs/xpl-top-nav/xpl-top-nav-item/readme.md +87 -0
- package/dist/esm/apollo-core.js +4 -4
- package/dist/esm/{index-C_Z2nG0p.js → index-C7bgJs6C.js} +18 -8
- package/dist/esm/loader.js +3 -3
- package/dist/esm/xpl-accordion.entry.js +3 -3
- package/dist/esm/xpl-application-shell.entry.js +2 -2
- package/dist/esm/{xpl-avatar_47.entry.js → xpl-avatar_54.entry.js} +3719 -536
- package/dist/esm/xpl-button-row.entry.js +2 -2
- package/dist/esm/xpl-calendar.entry.js +2 -2
- 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 +4 -4
- package/dist/esm/xpl-toolbar.entry.js +3 -3
- package/dist/types/components/xpl-avatar/avatar.stories.d.ts +88 -29
- package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +29 -2
- package/dist/types/components/xpl-badge/badge.stories.d.ts +0 -19
- package/dist/types/components/xpl-button/xpl-button.d.ts +7 -0
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +2 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +5 -0
- package/dist/types/components/xpl-input/input.stories.d.ts +1 -0
- package/dist/types/components/xpl-input/xpl-input-search/xpl-input-search.d.ts +39 -0
- package/dist/types/components/xpl-input/xpl-input.d.ts +13 -5
- package/dist/types/components/xpl-list/list.stories.d.ts +299 -13
- package/dist/types/components/xpl-list/listitem.d.ts +13 -0
- package/dist/types/components/xpl-list/xpl-list-item/xpl-list-item.d.ts +71 -0
- package/dist/types/components/xpl-list/xpl-list.d.ts +55 -2
- package/dist/types/components/xpl-pagination/pagination.stories.d.ts +13 -0
- package/dist/types/components/xpl-panel/panel.stories.d.ts +2 -0
- package/dist/types/components/xpl-progress-indicator/progress-indicator.stories.d.ts +62 -0
- package/dist/types/components/xpl-progress-indicator/xpl-progress-indicator.d.ts +11 -0
- package/dist/types/components/xpl-select/xpl-select.d.ts +3 -0
- package/dist/types/components/xpl-spotlight/spotlight.stories.d.ts +197 -0
- package/dist/types/components/xpl-spotlight/xpl-spotlight.d.ts +101 -0
- package/dist/types/components/xpl-tab/xpl-tab.d.ts +14 -1
- package/dist/types/components/xpl-tab-panel/xpl-tab-panel.d.ts +2 -1
- package/dist/types/components/xpl-tabs/segment-control.stories.d.ts +112 -0
- package/dist/types/components/xpl-tabs/tabs.shared.d.ts +156 -0
- package/dist/types/components/xpl-tabs/tabs.stories.d.ts +65 -12
- package/dist/types/components/xpl-tabs/xpl-tabs.d.ts +37 -18
- package/dist/types/components/xpl-tag/tag.stories.d.ts +65 -0
- package/dist/types/components/xpl-tag/xpl-tag.d.ts +36 -1
- package/dist/types/components/xpl-top-nav/top-nav.stories.d.ts +471 -0
- package/dist/types/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.d.ts +18 -0
- package/dist/types/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.d.ts +48 -0
- package/dist/types/components/xpl-top-nav/xpl-top-nav.d.ts +51 -0
- package/dist/types/components.d.ts +1521 -83
- package/dist/types/utils/lifecycle.d.ts +16 -0
- package/dist/types/utils/tab-a11y-ids.d.ts +4 -0
- package/package.json +12 -3
- package/dist/apollo-core/p-0bce3874.entry.js +0 -1
- package/dist/apollo-core/p-1fd3dc87.entry.js +0 -1
- package/dist/apollo-core/p-56fa4941.entry.js +0 -1
- package/dist/apollo-core/p-76c324da.entry.js +0 -1
- package/dist/apollo-core/p-7a3224b4.entry.js +0 -1
- package/dist/apollo-core/p-7e924697.entry.js +0 -1
- package/dist/apollo-core/p-9efca9e1.entry.js +0 -1
- package/dist/apollo-core/p-b252b380.entry.js +0 -1
- package/dist/apollo-core/p-c91daac1.entry.js +0 -1
- package/dist/apollo-core/p-d9b62508.entry.js +0 -1
- package/dist/apollo-core/p-eaea16d1.entry.js +0 -1
- package/dist/apollo-core/p-eed13bca.entry.js +0 -1
- package/dist/cjs/xpl-list.cjs.entry.js +0 -32
- package/dist/collection/components/xpl-progress/progress.stories.js +0 -106
- package/dist/collection/components/xpl-progress/xpl-progress.js +0 -60
- package/dist/components/xpl-progress.js +0 -1
- package/dist/docs/xpl-progress/readme.md +0 -22
- package/dist/esm/xpl-list.entry.js +0 -30
- package/dist/types/components/xpl-progress/progress.stories.d.ts +0 -38
- package/dist/types/components/xpl-progress/xpl-progress.d.ts +0 -6
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
|
+
export class TopNav {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.userPopoverDrawerSyncHost = null;
|
|
5
|
+
this.brandLogoSlotPresent = false;
|
|
6
|
+
this.open = false;
|
|
7
|
+
this.userMenuSlotPresent = false;
|
|
8
|
+
this.userMenuTriggerSlotPresent = false;
|
|
9
|
+
this.focusNavControlAfterClose = () => {
|
|
10
|
+
if (this.navControlFocusTimeoutId !== undefined) {
|
|
11
|
+
clearTimeout(this.navControlFocusTimeoutId);
|
|
12
|
+
}
|
|
13
|
+
this.navControlFocusTimeoutId = setTimeout(() => {
|
|
14
|
+
var _a;
|
|
15
|
+
this.navControlFocusTimeoutId = undefined;
|
|
16
|
+
(_a = this.el.querySelector('.xpl-top-nav__nav-control')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
17
|
+
}, 0);
|
|
18
|
+
};
|
|
19
|
+
this.handleUserPopoverIsOpenChange = (e) => {
|
|
20
|
+
const { detail } = e;
|
|
21
|
+
if (detail === true) {
|
|
22
|
+
this.closeMobileDrawerWhenAccountMenuOpens();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
this.onBrandNavItemClick = (e) => {
|
|
26
|
+
if (this.brandHref != null) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.brandClick.emit(e.detail);
|
|
30
|
+
};
|
|
31
|
+
this.onDocKeyDownEscape = (e) => {
|
|
32
|
+
if (!this.navControl || !this.open || e.key !== 'Escape') {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (this.anyDescendantPopoverIsOpen()) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (this.el.querySelector('xpl-top-nav-item.xpl-top-nav-item--dropdown-open')) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
this.open = false;
|
|
44
|
+
this.navOpen.emit(false);
|
|
45
|
+
this.focusNavControlAfterClose();
|
|
46
|
+
};
|
|
47
|
+
this.onNavToggle = () => {
|
|
48
|
+
const wasOpen = this.open;
|
|
49
|
+
this.open = !this.open;
|
|
50
|
+
this.navOpen.emit(this.open);
|
|
51
|
+
if (wasOpen && !this.open) {
|
|
52
|
+
this.focusNavControlAfterClose();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
this.onUserPopoverInnerOpenClassChange = () => {
|
|
56
|
+
const host = this.userPopoverDrawerSyncHost;
|
|
57
|
+
if (!host) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const inner = host.querySelector('.xpl-popover');
|
|
61
|
+
if (inner === null || inner === void 0 ? void 0 : inner.classList.contains('xpl-popover--is-open')) {
|
|
62
|
+
this.closeMobileDrawerWhenAccountMenuOpens();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
this.syncBrandLogoSlot = () => {
|
|
66
|
+
const next = this.el.querySelector('[slot="brand-logo"]') != null;
|
|
67
|
+
if (next !== this.brandLogoSlotPresent) {
|
|
68
|
+
this.brandLogoSlotPresent = next;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
this.syncUserMenuSlots = () => {
|
|
72
|
+
const panel = this.el.querySelector('[slot="user-menu"]') != null;
|
|
73
|
+
const triggerSlot = this.el.querySelector('[slot="user-menu-trigger"]') != null;
|
|
74
|
+
if (panel !== this.userMenuSlotPresent) {
|
|
75
|
+
this.userMenuSlotPresent = panel;
|
|
76
|
+
}
|
|
77
|
+
if (triggerSlot !== this.userMenuTriggerSlotPresent) {
|
|
78
|
+
this.userMenuTriggerSlotPresent = triggerSlot;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
onNavControlChanged() {
|
|
83
|
+
this.syncOpenFromNavControl();
|
|
84
|
+
this.syncDocEscapeListener();
|
|
85
|
+
}
|
|
86
|
+
connectedCallback() {
|
|
87
|
+
this.syncOpenFromNavControl();
|
|
88
|
+
this.syncDocEscapeListener();
|
|
89
|
+
this.syncBrandLogoSlot();
|
|
90
|
+
this.syncUserMenuSlots();
|
|
91
|
+
this.connectSlotContentObserver();
|
|
92
|
+
}
|
|
93
|
+
disconnectedCallback() {
|
|
94
|
+
if (this.navControlFocusTimeoutId !== undefined) {
|
|
95
|
+
clearTimeout(this.navControlFocusTimeoutId);
|
|
96
|
+
this.navControlFocusTimeoutId = undefined;
|
|
97
|
+
}
|
|
98
|
+
if (this.deferredSlotContentObserverSyncTimeoutId !== undefined) {
|
|
99
|
+
clearTimeout(this.deferredSlotContentObserverSyncTimeoutId);
|
|
100
|
+
this.deferredSlotContentObserverSyncTimeoutId = undefined;
|
|
101
|
+
}
|
|
102
|
+
this.removeDocEscapeListener();
|
|
103
|
+
this.disconnectSlotContentObserver();
|
|
104
|
+
this.disconnectUserPopoverDrawerSync();
|
|
105
|
+
}
|
|
106
|
+
componentWillLoad() {
|
|
107
|
+
this.syncOpenFromNavControl();
|
|
108
|
+
this.syncBrandLogoSlot();
|
|
109
|
+
this.syncUserMenuSlots();
|
|
110
|
+
}
|
|
111
|
+
componentWillRender() {
|
|
112
|
+
this.disconnectSlotContentObserver();
|
|
113
|
+
}
|
|
114
|
+
componentDidRender() {
|
|
115
|
+
this.connectSlotContentObserver();
|
|
116
|
+
this.connectUserPopoverDrawerSync();
|
|
117
|
+
}
|
|
118
|
+
get childAccountLabelText() {
|
|
119
|
+
var _a, _b;
|
|
120
|
+
return (_b = (_a = this.childAccountLabel) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
|
|
121
|
+
}
|
|
122
|
+
get hasBrand() {
|
|
123
|
+
var _a, _b, _c, _d;
|
|
124
|
+
const name = (_b = (_a = this.brandName) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
|
|
125
|
+
const logo = (_d = (_c = this.brandLogo) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '';
|
|
126
|
+
return name.length > 0 || logo.length > 0 || this.brandLogoSlotPresent;
|
|
127
|
+
}
|
|
128
|
+
get hasUserMenu() {
|
|
129
|
+
return this.userMenuSlotPresent;
|
|
130
|
+
}
|
|
131
|
+
get needsUserMenuSlotStash() {
|
|
132
|
+
return !this.userMenuSlotPresent && this.userMenuTriggerSlotPresent;
|
|
133
|
+
}
|
|
134
|
+
get usesBuiltInChildAccountTrigger() {
|
|
135
|
+
return this.hasUserMenu && !this.userMenuTriggerSlotPresent;
|
|
136
|
+
}
|
|
137
|
+
anyDescendantPopoverIsOpen() {
|
|
138
|
+
const hosts = this.el.querySelectorAll('xpl-popover');
|
|
139
|
+
for (let i = 0; i < hosts.length; i += 1) {
|
|
140
|
+
const inner = hosts[i].querySelector('.xpl-popover');
|
|
141
|
+
if (inner === null || inner === void 0 ? void 0 : inner.classList.contains('xpl-popover--is-open')) {
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
closeMobileDrawerWhenAccountMenuOpens() {
|
|
148
|
+
if (!this.navControl || !this.open) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.open = false;
|
|
152
|
+
this.navOpen.emit(false);
|
|
153
|
+
}
|
|
154
|
+
connectSlotContentObserver() {
|
|
155
|
+
this.disconnectSlotContentObserver();
|
|
156
|
+
if (typeof MutationObserver === 'undefined') {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.slotContentObserver = new MutationObserver(() => {
|
|
160
|
+
this.scheduleSlotContentSyncFromObserver();
|
|
161
|
+
});
|
|
162
|
+
this.slotContentObserver.observe(this.el, {
|
|
163
|
+
childList: true,
|
|
164
|
+
subtree: true,
|
|
165
|
+
attributes: true,
|
|
166
|
+
attributeFilter: ['slot'],
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
connectUserPopoverDrawerSync() {
|
|
170
|
+
const pop = this.hasUserMenu
|
|
171
|
+
? this.el.querySelector('xpl-popover.xpl-top-nav__user-popover')
|
|
172
|
+
: null;
|
|
173
|
+
if (pop === this.userPopoverDrawerSyncHost) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
this.disconnectUserPopoverDrawerSync();
|
|
177
|
+
if (!pop) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
this.userPopoverDrawerSyncHost = pop;
|
|
181
|
+
pop.addEventListener('isOpenChange', this.handleUserPopoverIsOpenChange);
|
|
182
|
+
const inner = pop.querySelector('.xpl-popover');
|
|
183
|
+
if (inner && typeof MutationObserver !== 'undefined') {
|
|
184
|
+
this.userPopoverDrawerOpenObserver = new MutationObserver(() => {
|
|
185
|
+
this.onUserPopoverInnerOpenClassChange();
|
|
186
|
+
});
|
|
187
|
+
this.userPopoverDrawerOpenObserver.observe(inner, {
|
|
188
|
+
attributes: true,
|
|
189
|
+
attributeFilter: ['class'],
|
|
190
|
+
});
|
|
191
|
+
this.onUserPopoverInnerOpenClassChange();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
disconnectSlotContentObserver() {
|
|
195
|
+
var _a;
|
|
196
|
+
(_a = this.slotContentObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
197
|
+
this.slotContentObserver = undefined;
|
|
198
|
+
}
|
|
199
|
+
disconnectUserPopoverDrawerSync() {
|
|
200
|
+
var _a;
|
|
201
|
+
if (this.userPopoverDrawerSyncHost) {
|
|
202
|
+
this.userPopoverDrawerSyncHost.removeEventListener('isOpenChange', this.handleUserPopoverIsOpenChange);
|
|
203
|
+
this.userPopoverDrawerSyncHost = null;
|
|
204
|
+
}
|
|
205
|
+
(_a = this.userPopoverDrawerOpenObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
206
|
+
this.userPopoverDrawerOpenObserver = undefined;
|
|
207
|
+
}
|
|
208
|
+
removeDocEscapeListener() {
|
|
209
|
+
this.el.ownerDocument.removeEventListener('keydown', this.onDocKeyDownEscape, false);
|
|
210
|
+
}
|
|
211
|
+
scheduleSlotContentSyncFromObserver() {
|
|
212
|
+
if (this.deferredSlotContentObserverSyncTimeoutId !== undefined) {
|
|
213
|
+
clearTimeout(this.deferredSlotContentObserverSyncTimeoutId);
|
|
214
|
+
}
|
|
215
|
+
this.deferredSlotContentObserverSyncTimeoutId = setTimeout(() => {
|
|
216
|
+
this.deferredSlotContentObserverSyncTimeoutId = undefined;
|
|
217
|
+
if (!this.el.isConnected) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
this.syncBrandLogoSlot();
|
|
221
|
+
this.syncUserMenuSlots();
|
|
222
|
+
}, 0);
|
|
223
|
+
}
|
|
224
|
+
syncDocEscapeListener() {
|
|
225
|
+
this.removeDocEscapeListener();
|
|
226
|
+
if (this.navControl) {
|
|
227
|
+
this.el.ownerDocument.addEventListener('keydown', this.onDocKeyDownEscape, false);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
syncOpenFromNavControl() {
|
|
231
|
+
const wasOpen = this.open;
|
|
232
|
+
this.open = false;
|
|
233
|
+
if (wasOpen && !this.navControl) {
|
|
234
|
+
this.navOpen.emit(false);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
render() {
|
|
238
|
+
var _a, _b, _c, _d;
|
|
239
|
+
return (h(Host, { key: '9f65d609c6b4cf08b2899216fe8bc70fe0e12db9', class: {
|
|
240
|
+
'xpl-top-nav': true,
|
|
241
|
+
'xpl-top-nav--nav-control': Boolean(this.navControl),
|
|
242
|
+
'xpl-top-nav--open': this.open,
|
|
243
|
+
'xpl-top-nav--has-child-account-label': this.childAccountLabelText.length > 0,
|
|
244
|
+
'xpl-top-nav--has-brand': this.hasBrand,
|
|
245
|
+
'xpl-top-nav--has-user-menu': this.hasUserMenu,
|
|
246
|
+
dark: true,
|
|
247
|
+
} }, h("nav", { key: 'a3d613acbe13866886bca363372127e8e869ec2c', "aria-label": (_a = this.label) !== null && _a !== void 0 ? _a : 'top-navigation-bar', class: "xpl-top-nav__bar" }, h("div", { key: 'b7057ef80f36e98def53bbfc2a39bd30bacd9b4c', class: "xpl-top-nav__inner-left" }, this.navControl && (h("button", { key: '3c4091842c7e4c1a62fea5446f6e29486617b11a', type: "button", class: "xpl-top-nav__nav-control", "aria-expanded": this.open ? 'true' : 'false', "aria-label": this.open ? 'Close navigation menu' : 'Open navigation menu', onClick: this.onNavToggle }, h("xpl-icon", { key: 'cd5fd2cd1cf1dae5c765b63678e14cb87588c3b2', class: "xpl-top-nav__control-icon", icon: "menu", size: 20 }))), this.hasBrand && (h("div", { key: '3cabfe3ce8ff58d9aed0ed9b4adccd896f6cad08', class: "xpl-top-nav__brand-bar" }, h("xpl-top-nav-item", { key: 'bca3924f36affd16b6c17d0d8cc1ccc57c488ef6', class: "xpl-top-nav__brand", href: this.brandHref, onNavItemClick: this.onBrandNavItemClick }, ((_b = this.brandLogo) === null || _b === void 0 ? void 0 : _b.trim()) ? (h("img", { class: "xpl-top-nav__brand-logo", src: this.brandLogo, alt: ((_c = this.brandName) === null || _c === void 0 ? void 0 : _c.trim())
|
|
248
|
+
? this.brandName.trim()
|
|
249
|
+
: 'Brand' })) : this.brandLogoSlotPresent ? (h("span", { class: "xpl-top-nav__brand-logo-slot" }, h("slot", { name: "brand-logo" }))) : null, ((_d = this.brandName) === null || _d === void 0 ? void 0 : _d.trim()) ? (h("span", { class: "xpl-top-nav__brand-name" }, this.brandName.trim())) : null))), h("div", { key: '1e9a1af5fbeca22c0f440556c121c38b8528d9ba', class: {
|
|
250
|
+
'xpl-top-nav__aside': true,
|
|
251
|
+
'xpl-nav-left': true,
|
|
252
|
+
} }, h("div", { key: 'b5d67e1adf5bc6a751be3d8bfa448bdb682039bc', class: "xpl-top-nav__left-primary", role: "list" }, h("slot", { key: 'c738eb6fbda41c8320fa2645fb88f43ef11731b6', name: "left-aside" })))), h("div", { key: '8573832a3922746b2301f9bc8b4fa6ab7e1ac441', class: {
|
|
253
|
+
'xpl-top-nav__aside': true,
|
|
254
|
+
'xpl-nav-right': true,
|
|
255
|
+
} }, h("div", { key: 'a21b318496a47000cde7a0346d3376999e7893ea', class: "xpl-nav-right__list" }, h("div", { key: '5934e7d3976b13abba77b4361b4fe1c6f49bcc2e', class: "xpl-top-nav__right-rail" }, h("div", { key: '49b44ea3d59eec32d6859978754e81ce6acc1bec', class: "xpl-top-nav__right-lead" }, h("slot", { key: '054671b75354700b873a85f08998a14d7fc7073b', name: "right-aside" })), this.hasUserMenu ? (h("div", { class: "xpl-top-nav__right-user" }, h("xpl-popover", { class: "xpl-top-nav__user-popover dark", position: "bottom-end", display: "menu" }, this.userMenuTriggerSlotPresent ? (h("slot", { name: "user-menu-trigger", slot: "trigger" })) : this.usesBuiltInChildAccountTrigger ? (h("xpl-button", { slot: "trigger", class: "xpl-top-nav__child-account-trigger", type: "button", variant: "tertiary", icon: "chevron-down", iconPosition: "end", iconOnly: this.childAccountLabelText.length === 0, "aria-haspopup": "dialog", "aria-label": this.childAccountLabelText.length > 0
|
|
256
|
+
? undefined
|
|
257
|
+
: 'Open account menu' }, this.childAccountLabelText.length > 0
|
|
258
|
+
? this.childAccountLabelText
|
|
259
|
+
: null)) : null, h("div", { class: "xpl-top-nav__user-menu-panel" }, h("slot", { name: "user-menu" }))))) : null, this.needsUserMenuSlotStash ? (h("div", { class: "xpl-top-nav__user-menu-stash", hidden: true, "aria-hidden": "true" }, h("slot", { name: "user-menu-trigger" }), h("slot", { name: "user-menu" }))) : null))))));
|
|
260
|
+
}
|
|
261
|
+
static get is() { return "xpl-top-nav"; }
|
|
262
|
+
static get properties() {
|
|
263
|
+
return {
|
|
264
|
+
"brandHref": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"mutable": false,
|
|
267
|
+
"complexType": {
|
|
268
|
+
"original": "string",
|
|
269
|
+
"resolved": "string",
|
|
270
|
+
"references": {}
|
|
271
|
+
},
|
|
272
|
+
"required": false,
|
|
273
|
+
"optional": true,
|
|
274
|
+
"docs": {
|
|
275
|
+
"tags": [],
|
|
276
|
+
"text": "Destination URL for the brand control when using native navigation (**`<a href>`**). When unset, the brand is a\n**`role=\"button\"`** control and **`brandClick`** fires on activation instead."
|
|
277
|
+
},
|
|
278
|
+
"getter": false,
|
|
279
|
+
"setter": false,
|
|
280
|
+
"reflect": false,
|
|
281
|
+
"attribute": "brand-href"
|
|
282
|
+
},
|
|
283
|
+
"brandLogo": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"mutable": false,
|
|
286
|
+
"complexType": {
|
|
287
|
+
"original": "string",
|
|
288
|
+
"resolved": "string",
|
|
289
|
+
"references": {}
|
|
290
|
+
},
|
|
291
|
+
"required": false,
|
|
292
|
+
"optional": true,
|
|
293
|
+
"docs": {
|
|
294
|
+
"tags": [],
|
|
295
|
+
"text": "Optional image URL for the brand mark (leading the brand row, before **`brand-name`** text). When set, renders\n**`<img class=\"xpl-top-nav__brand-logo\">`** and ignores **`slot=\"brand-logo\"`** for the mark. When unset, use\n**`slot=\"brand-logo\"`** for custom logo content."
|
|
296
|
+
},
|
|
297
|
+
"getter": false,
|
|
298
|
+
"setter": false,
|
|
299
|
+
"reflect": false,
|
|
300
|
+
"attribute": "brand-logo"
|
|
301
|
+
},
|
|
302
|
+
"brandName": {
|
|
303
|
+
"type": "string",
|
|
304
|
+
"mutable": false,
|
|
305
|
+
"complexType": {
|
|
306
|
+
"original": "string",
|
|
307
|
+
"resolved": "string",
|
|
308
|
+
"references": {}
|
|
309
|
+
},
|
|
310
|
+
"required": false,
|
|
311
|
+
"optional": true,
|
|
312
|
+
"docs": {
|
|
313
|
+
"tags": [],
|
|
314
|
+
"text": "Visible product / app name next to **`brand-logo`**. Omit for logo-only; provide **`brand-logo`** and/or this\nstring to show the built-in brand row (**`left-aside`** is then primary nav links only)."
|
|
315
|
+
},
|
|
316
|
+
"getter": false,
|
|
317
|
+
"setter": false,
|
|
318
|
+
"reflect": false,
|
|
319
|
+
"attribute": "brand-name"
|
|
320
|
+
},
|
|
321
|
+
"childAccountLabel": {
|
|
322
|
+
"type": "string",
|
|
323
|
+
"mutable": false,
|
|
324
|
+
"complexType": {
|
|
325
|
+
"original": "string",
|
|
326
|
+
"resolved": "string",
|
|
327
|
+
"references": {}
|
|
328
|
+
},
|
|
329
|
+
"required": false,
|
|
330
|
+
"optional": true,
|
|
331
|
+
"docs": {
|
|
332
|
+
"tags": [],
|
|
333
|
+
"text": "Label text for the built-in account menu trigger (shown **before** the **`chevron-down`** icon) when **`slot=\"user-menu\"`**\nis present and **`slot=\"user-menu-trigger\"`** is not used. When empty or whitespace-only, the trigger shows only the\nchevron and uses **`aria-label=\"Open account menu\"`** on the button."
|
|
334
|
+
},
|
|
335
|
+
"getter": false,
|
|
336
|
+
"setter": false,
|
|
337
|
+
"reflect": false,
|
|
338
|
+
"attribute": "child-account-label"
|
|
339
|
+
},
|
|
340
|
+
"label": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"mutable": false,
|
|
343
|
+
"complexType": {
|
|
344
|
+
"original": "string",
|
|
345
|
+
"resolved": "string",
|
|
346
|
+
"references": {}
|
|
347
|
+
},
|
|
348
|
+
"required": false,
|
|
349
|
+
"optional": true,
|
|
350
|
+
"docs": {
|
|
351
|
+
"tags": [],
|
|
352
|
+
"text": "Accessible name for the `<nav>` landmark (maps to `aria-label`).\nUse a unique label when the page has multiple navigation regions (e.g. side nav + top nav).\nWhen unset, defaults to `top-navigation-bar`."
|
|
353
|
+
},
|
|
354
|
+
"getter": false,
|
|
355
|
+
"setter": false,
|
|
356
|
+
"reflect": false,
|
|
357
|
+
"attribute": "label"
|
|
358
|
+
},
|
|
359
|
+
"navControl": {
|
|
360
|
+
"type": "boolean",
|
|
361
|
+
"mutable": false,
|
|
362
|
+
"complexType": {
|
|
363
|
+
"original": "boolean",
|
|
364
|
+
"resolved": "boolean",
|
|
365
|
+
"references": {}
|
|
366
|
+
},
|
|
367
|
+
"required": false,
|
|
368
|
+
"optional": true,
|
|
369
|
+
"docs": {
|
|
370
|
+
"tags": [],
|
|
371
|
+
"text": "When true, renders the navigation control (hamburger) for toggling the left slot on small viewports.\nThe control is **hidden from the Tailwind `md` breakpoint up**; collapse/show for **`left-aside`** uses **`max-width: calc(theme('screens.md') - 1px)`** in **`top-nav.css`** (Figma\u2019s 767px at a 16px root and default **`screens.md`**).\nReflected to the **`nav-control`** attribute so host updates (framework props) re-run **`@Watch`**: drawer state and\ndocument **Escape** handling stay in sync, the host **`xpl-top-nav--nav-control`** class toggles for **`top-nav.css`**, and\n**`navOpen(false)`** is emitted if **`nav-control`** is cleared while the drawer was open."
|
|
372
|
+
},
|
|
373
|
+
"getter": false,
|
|
374
|
+
"setter": false,
|
|
375
|
+
"reflect": true,
|
|
376
|
+
"attribute": "nav-control"
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
static get states() {
|
|
381
|
+
return {
|
|
382
|
+
"brandLogoSlotPresent": {},
|
|
383
|
+
"open": {},
|
|
384
|
+
"userMenuSlotPresent": {},
|
|
385
|
+
"userMenuTriggerSlotPresent": {}
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
static get events() {
|
|
389
|
+
return [{
|
|
390
|
+
"method": "brandClick",
|
|
391
|
+
"name": "brandClick",
|
|
392
|
+
"bubbles": true,
|
|
393
|
+
"cancelable": true,
|
|
394
|
+
"composed": true,
|
|
395
|
+
"docs": {
|
|
396
|
+
"tags": [],
|
|
397
|
+
"text": "Emitted when the brand control is activated and **`brandHref`** is **not** set (SPA / in-app navigation).\n**`detail`** is the **`MouseEvent`** from **`xpl-top-nav-item`** **`navItemClick`**. Not emitted when **`brandHref`**\nis set (use native link navigation)."
|
|
398
|
+
},
|
|
399
|
+
"complexType": {
|
|
400
|
+
"original": "MouseEvent",
|
|
401
|
+
"resolved": "MouseEvent",
|
|
402
|
+
"references": {
|
|
403
|
+
"MouseEvent": {
|
|
404
|
+
"location": "global",
|
|
405
|
+
"id": "global::MouseEvent"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}, {
|
|
410
|
+
"method": "navOpen",
|
|
411
|
+
"name": "navOpen",
|
|
412
|
+
"bubbles": true,
|
|
413
|
+
"cancelable": true,
|
|
414
|
+
"composed": true,
|
|
415
|
+
"docs": {
|
|
416
|
+
"tags": [],
|
|
417
|
+
"text": "Emitted when the mobile nav open state changes: hamburger toggle, or **Escape** closing the drawer\n(when **`nav-control`** is set and the bar was open). Detail is the new open state (**`true`** = open, **`false`** = closed)."
|
|
418
|
+
},
|
|
419
|
+
"complexType": {
|
|
420
|
+
"original": "boolean",
|
|
421
|
+
"resolved": "boolean",
|
|
422
|
+
"references": {}
|
|
423
|
+
}
|
|
424
|
+
}];
|
|
425
|
+
}
|
|
426
|
+
static get elementRef() { return "el"; }
|
|
427
|
+
static get watchers() {
|
|
428
|
+
return [{
|
|
429
|
+
"propName": "navControl",
|
|
430
|
+
"methodName": "onNavControlChanged"
|
|
431
|
+
}];
|
|
432
|
+
}
|
|
433
|
+
}
|
|
@@ -11,7 +11,7 @@ export class UtilityBar {
|
|
|
11
11
|
this.open = this.isNavOpenAtStartup !== undefined ? this.isNavOpenAtStartup : this.open;
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: '2af96247c611b67255b7f285dfb2b8b1dada47cc' }, h("nav", { key: '135186097dd0d8f308a1a08b5fbf4a5537c10f25', "aria-label": "utility navigation bar", class: "xpl-utility-bar" }, this.navControl ? (h("div", null, h("button", { class: "xpl-utility-bar__nav-control", onClick: () => this.onNavToggle() }, h("xpl-icon", { class: "xpl-utility-nav__bars", icon: "three-bars" })), h("slot", { name: "aside" }))) : (h("slot", { name: "aside" })), h("slot", { key: '3346444f9813b20d8c4ed13b5a0784205dcfbbb1', name: "main" }))));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "xpl-utility-bar"; }
|
|
17
17
|
static get properties() {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export class TimerManager {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.timeouts = new Set();
|
|
4
|
+
this.intervals = new Set();
|
|
5
|
+
this.rafs = new Set();
|
|
6
|
+
}
|
|
7
|
+
setTimeout(callback, delay) {
|
|
8
|
+
const id = setTimeout(() => {
|
|
9
|
+
this.timeouts.delete(id);
|
|
10
|
+
callback();
|
|
11
|
+
}, delay);
|
|
12
|
+
this.timeouts.add(id);
|
|
13
|
+
return id;
|
|
14
|
+
}
|
|
15
|
+
clearTimeout(id) {
|
|
16
|
+
clearTimeout(id);
|
|
17
|
+
this.timeouts.delete(id);
|
|
18
|
+
}
|
|
19
|
+
setInterval(callback, delay) {
|
|
20
|
+
const id = setInterval(callback, delay);
|
|
21
|
+
this.intervals.add(id);
|
|
22
|
+
return id;
|
|
23
|
+
}
|
|
24
|
+
clearInterval(id) {
|
|
25
|
+
clearInterval(id);
|
|
26
|
+
this.intervals.delete(id);
|
|
27
|
+
}
|
|
28
|
+
requestAnimationFrame(callback) {
|
|
29
|
+
const id = requestAnimationFrame((time) => {
|
|
30
|
+
this.rafs.delete(id);
|
|
31
|
+
callback(time);
|
|
32
|
+
});
|
|
33
|
+
this.rafs.add(id);
|
|
34
|
+
return id;
|
|
35
|
+
}
|
|
36
|
+
cancelAnimationFrame(id) {
|
|
37
|
+
cancelAnimationFrame(id);
|
|
38
|
+
this.rafs.delete(id);
|
|
39
|
+
}
|
|
40
|
+
dispose() {
|
|
41
|
+
this.timeouts.forEach((id) => clearTimeout(id));
|
|
42
|
+
this.timeouts.clear();
|
|
43
|
+
this.intervals.forEach((id) => clearInterval(id));
|
|
44
|
+
this.intervals.clear();
|
|
45
|
+
this.rafs.forEach((id) => cancelAnimationFrame(id));
|
|
46
|
+
this.rafs.clear();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function waitForElement(selector, root = document, options) {
|
|
50
|
+
const existing = root.querySelector(selector);
|
|
51
|
+
if (existing) {
|
|
52
|
+
return Promise.resolve(existing);
|
|
53
|
+
}
|
|
54
|
+
return new Promise((resolve) => {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
57
|
+
resolve(null);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const observer = new MutationObserver(() => {
|
|
61
|
+
const el = root.querySelector(selector);
|
|
62
|
+
if (el) {
|
|
63
|
+
observer.disconnect();
|
|
64
|
+
resolve(el);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
observer.observe(root instanceof Node ? root : document, {
|
|
68
|
+
childList: true,
|
|
69
|
+
subtree: true,
|
|
70
|
+
});
|
|
71
|
+
(_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.addEventListener('abort', () => {
|
|
72
|
+
observer.disconnect();
|
|
73
|
+
resolve(null);
|
|
74
|
+
}, { once: true });
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export function isBrowser() {
|
|
78
|
+
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
79
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function sanitizeForHtmlId(value) {
|
|
2
|
+
const trimmed = value.trim();
|
|
3
|
+
if (!trimmed) {
|
|
4
|
+
return 'unnamed';
|
|
5
|
+
}
|
|
6
|
+
let s = trimmed.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-');
|
|
7
|
+
if (/^[0-9-]/.test(s)) {
|
|
8
|
+
s = `t-${s}`;
|
|
9
|
+
}
|
|
10
|
+
return s;
|
|
11
|
+
}
|
|
12
|
+
export function getTabGroupInstanceId(hostEl) {
|
|
13
|
+
var _a;
|
|
14
|
+
const root = hostEl.closest('xpl-tabs');
|
|
15
|
+
return (_a = root === null || root === void 0 ? void 0 : root.getAttribute('data-tabs-instance-id')) !== null && _a !== void 0 ? _a : 'xpl-tg-orphan';
|
|
16
|
+
}
|
|
17
|
+
export function tabTriggerId(groupInstanceId, target) {
|
|
18
|
+
return `${groupInstanceId}-tab-${sanitizeForHtmlId(target)}`;
|
|
19
|
+
}
|
|
20
|
+
export function tabPanelDomId(groupInstanceId, target) {
|
|
21
|
+
return `${groupInstanceId}-panel-${sanitizeForHtmlId(target)}`;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=["top","right","bottom","left"],n=Math.min,e=Math.max,o=Math.round,r=Math.floor,i=t=>({x:t,y:t}),c={left:"right",right:"left",bottom:"top",top:"bottom"};function a(t,o,r){return e(t,n(o,r))}function l(t,n){return"function"==typeof t?t(n):t}function s(t){return t.split("-")[0]}function u(t){return t.split("-")[1]}function f(t){return"x"===t?"y":"x"}function d(t){return"y"===t?"height":"width"}function m(t){const n=t[0];return"t"===n||"b"===n?"y":"x"}function h(t){return f(m(t))}function y(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const p=["left","right"],w=["right","left"],g=["top","bottom"],x=["bottom","top"];function v(t){const n=s(t);return c[n]+t.slice(n.length)}function b(t){const{x:n,y:e,width:o,height:r}=t;return{width:o,height:r,top:e,left:n,right:n+o,bottom:e+r,x:n,y:e}}function A(t,n,e){let{reference:o,floating:r}=t;const i=m(n),c=h(n),a=d(c),l=s(n),f="y"===i,y=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,w=o[a]/2-r[a]/2;let g;switch(l){case"top":g={x:y,y:o.y-r.height};break;case"bottom":g={x:y,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:p};break;case"left":g={x:o.x-r.width,y:p};break;default:g={x:o.x,y:o.y}}switch(u(n)){case"start":g[c]-=w*(e&&f?-1:1);break;case"end":g[c]+=w*(e&&f?-1:1)}return g}async function S(t,n){var e;void 0===n&&(n={});const{x:o,y:r,platform:i,rects:c,elements:a,strategy:s}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:h=0}=l(n,t),y=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(h),p=a[m?"floating"===d?"reference":"floating":d],w=b(await i.getClippingRect({element:null==(e=await(null==i.isElement?void 0:i.isElement(p)))||e?p:p.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:s})),g="floating"===d?{x:o,y:r,width:c.floating.width,height:c.floating.height}:c.reference,x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),v=await(null==i.isElement?void 0:i.isElement(x))&&await(null==i.getScale?void 0:i.getScale(x))||{x:1,y:1},A=b(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:x,strategy:s}):g);return{top:(w.top-A.top+y.top)/v.y,bottom:(A.bottom-w.bottom+y.bottom)/v.y,left:(w.left-A.left+y.left)/v.x,right:(A.right-w.right+y.right)/v.x}}function R(t,n){return{top:t.top-n.height,right:t.right-n.width,bottom:t.bottom-n.height,left:t.left-n.width}}function F(n){return t.some((t=>n[t]>=0))}const k=new Set(["left","top"]);function O(){return"undefined"!=typeof window}function C(t){return P(t)?(t.nodeName||"").toLowerCase():"#document"}function T(t){var n;return(null==t||null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function M(t){var n;return null==(n=(P(t)?t.ownerDocument:t.document)||window.document)?void 0:n.documentElement}function P(t){return!!O()&&(t instanceof Node||t instanceof T(t).Node)}function z(t){return!!O()&&(t instanceof Element||t instanceof T(t).Element)}function D(t){return!!O()&&(t instanceof HTMLElement||t instanceof T(t).HTMLElement)}function H(t){return!(!O()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof T(t).ShadowRoot)}function L(t){const{overflow:n,overflowX:e,overflowY:o,display:r}=X(t);return/auto|scroll|overlay|hidden|clip/.test(n+o+e)&&"inline"!==r&&"contents"!==r}function B(t){return/^(table|td|th)$/.test(C(t))}function E(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const $=/transform|translate|scale|rotate|perspective|filter/,I=/paint|layout|strict|content/,N=t=>!!t&&"none"!==t;let j;function q(t){const n=z(t)?X(t):t;return N(n.transform)||N(n.translate)||N(n.scale)||N(n.rotate)||N(n.perspective)||!V()&&(N(n.backdropFilter)||N(n.filter))||$.test(n.willChange||"")||I.test(n.contain||"")}function V(){return null==j&&(j="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),j}function W(t){return/^(html|body|#document)$/.test(C(t))}function X(t){return T(t).getComputedStyle(t)}function Y(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function _(t){if("html"===C(t))return t;const n=t.assignedSlot||t.parentNode||H(t)&&t.host||M(t);return H(n)?n.host:n}function G(t){const n=_(t);return W(n)?t.ownerDocument?t.ownerDocument.body:t.body:D(n)&&L(n)?n:G(n)}function J(t,n,e){var o;void 0===n&&(n=[]),void 0===e&&(e=!0);const r=G(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),c=T(r);if(i){const t=K(c);return n.concat(c,c.visualViewport||[],L(r)?r:[],t&&e?J(t):[])}return n.concat(r,J(r,[],e))}function K(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Q(t){const n=X(t);let e=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const i=D(t),c=i?t.offsetWidth:e,a=i?t.offsetHeight:r,l=o(e)!==c||o(r)!==a;return l&&(e=c,r=a),{width:e,height:r,$:l}}function U(t){return z(t)?t:t.contextElement}function Z(t){const n=U(t);if(!D(n))return i(1);const e=n.getBoundingClientRect(),{width:r,height:c,$:a}=Q(n);let l=(a?o(e.width):e.width)/r,s=(a?o(e.height):e.height)/c;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const tt=i(0);function nt(t){const n=T(t);return V()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:tt}function et(t,n,e,o){void 0===n&&(n=!1),void 0===e&&(e=!1);const r=t.getBoundingClientRect(),c=U(t);let a=i(1);n&&(o?z(o)&&(a=Z(o)):a=Z(t));const l=function(t,n,e){return void 0===n&&(n=!1),!(!e||n&&e!==T(t))&&n}(c,e,o)?nt(c):i(0);let s=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,f=r.width/a.x,d=r.height/a.y;if(c){const t=T(c),n=o&&z(o)?T(o):o;let e=t,r=K(e);for(;r&&o&&n!==e;){const t=Z(r),n=r.getBoundingClientRect(),o=X(r),i=n.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,c=n.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;s*=t.x,u*=t.y,f*=t.x,d*=t.y,s+=i,u+=c,e=T(r),r=K(e)}}return b({width:f,height:d,x:s,y:u})}function ot(t,n){const e=Y(t).scrollLeft;return n?n.left+e:et(M(t)).left+e}function rt(t,n){const e=t.getBoundingClientRect();return{x:e.left+n.scrollLeft-ot(t,e),y:e.top+n.scrollTop}}function it(t,n,o){let r;if("viewport"===n)r=function(t,n){const e=T(t),o=M(t),r=e.visualViewport;let i=o.clientWidth,c=o.clientHeight,a=0,l=0;if(r){i=r.width,c=r.height;const t=V();(!t||t&&"fixed"===n)&&(a=r.offsetLeft,l=r.offsetTop)}const s=ot(o);if(s<=0){const t=o.ownerDocument,n=t.body,e=getComputedStyle(n),r="CSS1Compat"===t.compatMode&&parseFloat(e.marginLeft)+parseFloat(e.marginRight)||0,c=Math.abs(o.clientWidth-n.clientWidth-r);c<=25&&(i-=c)}else s<=25&&(i+=s);return{width:i,height:c,x:a,y:l}}(t,o);else if("document"===n)r=function(t){const n=M(t),o=Y(t),r=t.ownerDocument.body,i=e(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),c=e(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let a=-o.scrollLeft+ot(t);const l=-o.scrollTop;return"rtl"===X(r).direction&&(a+=e(n.clientWidth,r.clientWidth)-i),{width:i,height:c,x:a,y:l}}(M(t));else if(z(n))r=function(t,n){const e=et(t,!0,"fixed"===n),o=e.top+t.clientTop,r=e.left+t.clientLeft,c=D(t)?Z(t):i(1);return{width:t.clientWidth*c.x,height:t.clientHeight*c.y,x:r*c.x,y:o*c.y}}(n,o);else{const e=nt(t);r={x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}}return b(r)}function ct(t,n){const e=_(t);return!(e===n||!z(e)||W(e))&&("fixed"===X(e).position||ct(e,n))}function at(t,n,e){const o=D(n),r=M(n),c="fixed"===e,a=et(t,!0,c,n);let l={scrollLeft:0,scrollTop:0};const s=i(0);function u(){s.x=ot(r)}if(o||!o&&!c)if(("body"!==C(n)||L(r))&&(l=Y(n)),o){const t=et(n,!0,c,n);s.x=t.x+n.clientLeft,s.y=t.y+n.clientTop}else r&&u();c&&!o&&r&&u();const f=!r||o||c?i(0):rt(r,l);return{x:a.left+l.scrollLeft-s.x-f.x,y:a.top+l.scrollTop-s.y-f.y,width:a.width,height:a.height}}function lt(t){return"static"===X(t).position}function st(t,n){if(!D(t)||"fixed"===X(t).position)return null;if(n)return n(t);let e=t.offsetParent;return M(t)===e&&(e=e.ownerDocument.body),e}function ut(t,n){const e=T(t);if(E(t))return e;if(!D(t)){let n=_(t);for(;n&&!W(n);){if(z(n)&&!lt(n))return n;n=_(n)}return e}let o=st(t,n);for(;o&&B(o)&<(o);)o=st(o,n);return o&&W(o)&<(o)&&!q(o)?e:o||function(t){let n=_(t);for(;D(n)&&!W(n);){if(q(n))return n;if(E(n))return null;n=_(n)}return null}(t)||e}const ft={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:n,rect:e,offsetParent:o,strategy:r}=t;const c="fixed"===r,a=M(o),l=!!n&&E(n.floating);if(o===a||l&&c)return e;let s={scrollLeft:0,scrollTop:0},u=i(1);const f=i(0),d=D(o);if((d||!d&&!c)&&(("body"!==C(o)||L(a))&&(s=Y(o)),d)){const t=et(o);u=Z(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const m=!a||d||c?i(0):rt(a,s);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-s.scrollLeft*u.x+f.x+m.x,y:e.y*u.y-s.scrollTop*u.y+f.y+m.y}},getDocumentElement:M,getClippingRect:function(t){let{element:o,boundary:r,rootBoundary:i,strategy:c}=t;const a=[..."clippingAncestors"===r?E(o)?[]:function(t,n){const e=n.get(t);if(e)return e;let o=J(t,[],!1).filter((t=>z(t)&&"body"!==C(t))),r=null;const i="fixed"===X(t).position;let c=i?_(t):t;for(;z(c)&&!W(c);){const n=X(c),e=q(c);e||"fixed"!==n.position||(r=null),(i?!e&&!r:!e&&"static"===n.position&&r&&("absolute"===r.position||"fixed"===r.position)||L(c)&&!e&&ct(t,c))?o=o.filter((t=>t!==c)):r=n,c=_(c)}return n.set(t,o),o}(o,this._c):[].concat(r),i],l=it(o,a[0],c);let s=l.top,u=l.right,f=l.bottom,d=l.left;for(let t=1;t<a.length;t++){const r=it(o,a[t],c);s=e(r.top,s),u=n(r.right,u),f=n(r.bottom,f),d=e(r.left,d)}return{width:u-d,height:f-s,x:d,y:s}},getOffsetParent:ut,getElementRects:async function(t){const n=this.getOffsetParent||ut,e=this.getDimensions,o=await e(t.floating);return{reference:at(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:n,height:e}=Q(t);return{width:n,height:e}},getScale:Z,isElement:z,isRTL:function(t){return"rtl"===X(t).direction}};function dt(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function mt(t,o,i,c){void 0===c&&(c={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:f=!1}=c,d=U(t),m=a||l?[...d?J(d):[],...o?J(o):[]]:[];m.forEach((t=>{a&&t.addEventListener("scroll",i,{passive:!0}),l&&t.addEventListener("resize",i)}));const h=d&&u?function(t,o){let i,c=null;const a=M(t);function l(){var t;clearTimeout(i),null==(t=c)||t.disconnect(),c=null}return function s(u,f){void 0===u&&(u=!1),void 0===f&&(f=1),l();const d=t.getBoundingClientRect(),{left:m,top:h,width:y,height:p}=d;if(u||o(),!y||!p)return;const w={rootMargin:-r(h)+"px "+-r(a.clientWidth-(m+y))+"px "+-r(a.clientHeight-(h+p))+"px "+-r(m)+"px",threshold:e(0,n(1,f))||1};let g=!0;function x(n){const e=n[0].intersectionRatio;if(e!==f){if(!g)return s();e?s(!1,e):i=setTimeout((()=>{s(!1,1e-7)}),1e3)}1!==e||dt(d,t.getBoundingClientRect())||s(),g=!1}try{c=new IntersectionObserver(x,{...w,root:a.ownerDocument})}catch(t){c=new IntersectionObserver(x,w)}c.observe(t)}(!0),l}(d,i):null;let y,p=-1,w=null;s&&(w=new ResizeObserver((t=>{let[n]=t;n&&n.target===d&&w&&o&&(w.unobserve(o),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var t;null==(t=w)||t.observe(o)}))),i()})),d&&!f&&w.observe(d),o&&w.observe(o));let g=f?et(t):null;return f&&function n(){const e=et(t);g&&!dt(g,e)&&i(),g=e,y=requestAnimationFrame(n)}(),i(),()=>{var t;m.forEach((t=>{a&&t.removeEventListener("scroll",i),l&&t.removeEventListener("resize",i)})),null==h||h(),null==(t=w)||t.disconnect(),w=null,f&&cancelAnimationFrame(y)}}const ht=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(n){var e,o;const{x:r,y:i,placement:c,middlewareData:a}=n,f=await async function(t,n){const{placement:e,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),c=s(e),a=u(e),f="y"===m(e),d=k.has(c)?-1:1,h=i&&f?-1:1,y=l(n,t);let{mainAxis:p,crossAxis:w,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return a&&"number"==typeof g&&(w="end"===a?-1*g:g),f?{x:w*h,y:p*d}:{x:p*d,y:w*h}}(n,t);return c===(null==(e=a.offset)?void 0:e.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:r+f.x,y:i+f.y,data:{...f,placement:c}}}}},yt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(n){const{x:e,y:o,placement:r,platform:i}=n,{mainAxis:c=!0,crossAxis:u=!1,limiter:d={fn:t=>{let{x:n,y:e}=t;return{x:n,y:e}}},...h}=l(t,n),y={x:e,y:o},p=await i.detectOverflow(n,h),w=m(s(r)),g=f(w);let x=y[g],v=y[w];c&&(x=a(x+p["y"===g?"top":"left"],x,x-p["y"===g?"bottom":"right"])),u&&(v=a(v+p["y"===w?"top":"left"],v,v-p["y"===w?"bottom":"right"]));const b=d.fn({...n,[g]:x,[w]:v});return{...b,data:{x:b.x-e,y:b.y-o,enabled:{[g]:c,[w]:u}}}}}},pt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(n){var e,o;const{placement:r,middlewareData:i,rects:c,initialPlacement:a,platform:f,elements:b}=n,{mainAxis:A=!0,crossAxis:S=!0,fallbackPlacements:R,fallbackStrategy:F="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:O=!0,...C}=l(t,n);if(null!=(e=i.arrow)&&e.alignmentOffset)return{};const T=s(r),M=m(a),P=s(a)===a,z=await(null==f.isRTL?void 0:f.isRTL(b.floating)),D=R||(P||!O?[v(a)]:function(t){const n=v(t);return[y(t),n,y(n)]}(a)),H="none"!==k;!R&&H&&D.push(...function(t,n,e,o){const r=u(t);let i=function(t,n,e){switch(t){case"top":case"bottom":return e?n?w:p:n?p:w;case"left":case"right":return n?g:x;default:return[]}}(s(t),"start"===e,o);return r&&(i=i.map((t=>t+"-"+r)),n&&(i=i.concat(i.map(y)))),i}(a,O,k,z));const L=[a,...D],B=await f.detectOverflow(n,C),E=[];let $=(null==(o=i.flip)?void 0:o.overflows)||[];if(A&&E.push(B[T]),S){const t=function(t,n,e){void 0===e&&(e=!1);const o=u(t),r=h(t),i=d(r);let c="x"===r?o===(e?"end":"start")?"right":"left":"start"===o?"bottom":"top";return n.reference[i]>n.floating[i]&&(c=v(c)),[c,v(c)]}(r,c,z);E.push(B[t[0]],B[t[1]])}if($=[...$,{placement:r,overflows:E}],!E.every((t=>t<=0))){var I,N;const t=((null==(I=i.flip)?void 0:I.index)||0)+1,n=L[t];if(n&&("alignment"!==S||M===m(n)||$.every((t=>m(t.placement)!==M||t.overflows[0]>0))))return{data:{index:t,overflows:$},reset:{placement:n}};let e=null==(N=$.filter((t=>t.overflows[0]<=0)).sort(((t,n)=>t.overflows[1]-n.overflows[1]))[0])?void 0:N.placement;if(!e)switch(F){case"bestFit":{var j;const t=null==(j=$.filter((t=>{if(H){const n=m(t.placement);return n===M||"y"===n}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,n)=>t+n),0)])).sort(((t,n)=>t[1]-n[1]))[0])?void 0:j[0];t&&(e=t);break}case"initialPlacement":e=a}if(r!==e)return{reset:{placement:e}}}return{}}}},wt=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(o){var r,i;const{placement:c,rects:a,platform:f,elements:d}=o,{apply:h=()=>{},...y}=l(t,o),p=await f.detectOverflow(o,y),w=s(c),g=u(c),x="y"===m(c),{width:v,height:b}=a.floating;let A,S;"top"===w||"bottom"===w?(A=w,S=g===(await(null==f.isRTL?void 0:f.isRTL(d.floating))?"start":"end")?"left":"right"):(S=w,A="end"===g?"top":"bottom");const R=b-p.top-p.bottom,F=v-p.left-p.right;let k=n(b-p[A],R),O=n(v-p[S],F);if(null!=(r=o.middlewareData.shift)&&r.enabled.x&&(O=F),null!=(i=o.middlewareData.shift)&&i.enabled.y&&(k=R),!o.middlewareData.shift&&!g){const t=e(p.left,0),n=e(p.right,0),o=e(p.top,0),r=e(p.bottom,0);x?O=v-2*(0!==t||0!==n?t+n:e(p.left,p.right)):k=b-2*(0!==o||0!==r?o+r:e(p.top,p.bottom))}await h({...o,availableWidth:O,availableHeight:k});const C=await f.getDimensions(d.floating);return v!==C.width||b!==C.height?{reset:{rects:!0}}:{}}}},gt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(n){const{rects:e,platform:o}=n,{strategy:r="referenceHidden",...i}=l(t,n);switch(r){case"referenceHidden":{const t=R(await o.detectOverflow(n,{...i,elementContext:"reference"}),e.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:F(t)}}}case"escaped":{const t=R(await o.detectOverflow(n,{...i,altBoundary:!0}),e.floating);return{data:{escapedOffsets:t,escaped:F(t)}}}default:return{}}}}},xt=(t,n,e)=>{const o=new Map,r={platform:ft,...e},i={...r.platform,_c:o};return(async(t,n,e)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:c}=e,a=c.detectOverflow?c:{...c,detectOverflow:S},l=await(null==c.isRTL?void 0:c.isRTL(n));let s=await c.getElementRects({reference:t,floating:n,strategy:r}),{x:u,y:f}=A(s,o,l),d=o,m=0;const h={};for(let e=0;e<i.length;e++){const y=i[e];if(!y)continue;const{name:p,fn:w}=y,{x:g,y:x,data:v,reset:b}=await w({x:u,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:h,rects:s,platform:a,elements:{reference:t,floating:n}});u=null!=g?g:u,f=null!=x?x:f,h[p]={...h[p],...v},b&&m<50&&(m++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(s=!0===b.rects?await c.getElementRects({reference:t,floating:n,strategy:r}):b.rects),({x:u,y:f}=A(s,d,l))),e=-1)}return{x:u,y:f,placement:d,strategy:r,middlewareData:h}})(t,n,{...r,platform:i})};export{mt as a,wt as b,xt as c,pt as f,gt as h,ht as o,yt as s}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformTag as o}from"@stencil/core/internal/client";export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";import{XplAccordion as r}from"./xpl-accordion.js";import{XplApplicationShell as p}from"./xpl-application-shell.js";import{XplAvatar as m}from"./xpl-avatar.js";import{XplBackdrop as t}from"./xpl-backdrop.js";import{XplBadge as i}from"./xpl-badge.js";import{XplBanner as l}from"./xpl-banner.js";import{XplBreadcrumbItem as s}from"./xpl-breadcrumb-item.js";import{XplBreadcrumbs as e}from"./xpl-breadcrumbs.js";import{XplButton as f}from"./xpl-button.js";import{XplButtonRow as x}from"./xpl-button-row.js";import{XplCalendar as a}from"./xpl-calendar.js";import{XplCheckbox as j}from"./xpl-checkbox.js";import{XplChoicelist as n}from"./xpl-choicelist.js";import{XplContentArea as d}from"./xpl-content-area.js";import{XplDashboard as c}from"./xpl-dashboard.js";import{XplDataCard as b}from"./xpl-data-card.js";import{XplDivider as u}from"./xpl-divider.js";import{XplDropdown as g}from"./xpl-dropdown.js";import{XplDropdownGroup as h}from"./xpl-dropdown-group.js";import{XplDropdownHeading as v}from"./xpl-dropdown-heading.js";import{XplDropdownOption as w}from"./xpl-dropdown-option.js";import{XplDynamicTable as y}from"./xpl-dynamic-table.js";import{XplDynamicTableCell as k}from"./xpl-dynamic-table-cell.js";import{XplDynamicTableRow as E}from"./xpl-dynamic-table-row.js";import{XplGrid as P}from"./xpl-grid.js";import{XplGridItem as A}from"./xpl-grid-item.js";import{XplHeaderAccordion as N}from"./xpl-header-accordion.js";import{XplIcon as O}from"./xpl-icon.js";import{XplInput as q}from"./xpl-input.js";import{XplInputColor as z}from"./xpl-input-color.js";import{XplInputDate as B}from"./xpl-input-date.js";import{XplInputFile as C}from"./xpl-input-file.js";import{XplInputPhone as D}from"./xpl-input-phone.js";import{
|
|
1
|
+
import{transformTag as o}from"@stencil/core/internal/client";export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";import{XplAccordion as r}from"./xpl-accordion.js";import{XplApplicationShell as p}from"./xpl-application-shell.js";import{XplAvatar as m}from"./xpl-avatar.js";import{XplBackdrop as t}from"./xpl-backdrop.js";import{XplBadge as i}from"./xpl-badge.js";import{XplBanner as l}from"./xpl-banner.js";import{XplBreadcrumbItem as s}from"./xpl-breadcrumb-item.js";import{XplBreadcrumbs as e}from"./xpl-breadcrumbs.js";import{XplButton as f}from"./xpl-button.js";import{XplButtonRow as x}from"./xpl-button-row.js";import{XplCalendar as a}from"./xpl-calendar.js";import{XplCheckbox as j}from"./xpl-checkbox.js";import{XplChoicelist as n}from"./xpl-choicelist.js";import{XplContentArea as d}from"./xpl-content-area.js";import{XplDashboard as c}from"./xpl-dashboard.js";import{XplDataCard as b}from"./xpl-data-card.js";import{XplDivider as u}from"./xpl-divider.js";import{XplDropdown as g}from"./xpl-dropdown.js";import{XplDropdownGroup as h}from"./xpl-dropdown-group.js";import{XplDropdownHeading as v}from"./xpl-dropdown-heading.js";import{XplDropdownOption as w}from"./xpl-dropdown-option.js";import{XplDynamicTable as y}from"./xpl-dynamic-table.js";import{XplDynamicTableCell as k}from"./xpl-dynamic-table-cell.js";import{XplDynamicTableRow as E}from"./xpl-dynamic-table-row.js";import{XplGrid as P}from"./xpl-grid.js";import{XplGridItem as A}from"./xpl-grid-item.js";import{XplHeaderAccordion as N}from"./xpl-header-accordion.js";import{XplIcon as O}from"./xpl-icon.js";import{XplInput as q}from"./xpl-input.js";import{XplInputColor as z}from"./xpl-input-color.js";import{XplInputDate as B}from"./xpl-input-date.js";import{XplInputFile as C}from"./xpl-input-file.js";import{XplInputPhone as D}from"./xpl-input-phone.js";import{XplInputSearch as F}from"./xpl-input-search.js";import{XplInputTime as G}from"./xpl-input-time.js";import{XplLargeCard as H}from"./xpl-large-card.js";import{XplList as I}from"./xpl-list.js";import{XplListItem as J}from"./xpl-list-item.js";import{XplMainNav as K}from"./xpl-main-nav.js";import{XplModal as L}from"./xpl-modal.js";import{XplNavHeaderMenu as M}from"./xpl-nav-header-menu.js";import{XplNavItem as Q}from"./xpl-nav-item.js";import{XplPagination as R}from"./xpl-pagination.js";import{XplPanel as S}from"./xpl-panel.js";import{XplPopover as T}from"./xpl-popover.js";import{XplProgressBar as U}from"./xpl-progress-bar.js";import{XplProgressIndicator as V}from"./xpl-progress-indicator.js";import{XplRadio as W}from"./xpl-radio.js";import{XplSecondaryNav as X}from"./xpl-secondary-nav.js";import{XplSelect as Y}from"./xpl-select.js";import{XplSideNav as Z}from"./xpl-side-nav.js";import{XplSideNavItem as $}from"./xpl-side-nav-item.js";import{XplSkeleton as _}from"./xpl-skeleton.js";import{XplSlideout as oo}from"./xpl-slideout.js";import{XplSpotlight as ro}from"./xpl-spotlight.js";import{XplTab as po}from"./xpl-tab.js";import{XplTabPanel as mo}from"./xpl-tab-panel.js";import{XplTable as to}from"./xpl-table.js";import{XplTableHeader as io}from"./xpl-table-header.js";import{XplTableHeaderCell as lo}from"./xpl-table-header-cell.js";import{XplTabs as so}from"./xpl-tabs.js";import{XplTag as eo}from"./xpl-tag.js";import{XplToast as fo}from"./xpl-toast.js";import{XplToggle as xo}from"./xpl-toggle.js";import{XplToolbar as ao}from"./xpl-toolbar.js";import{XplTooltip as jo}from"./xpl-tooltip.js";import{XplTopNav as no}from"./xpl-top-nav.js";import{XplTopNavItem as co}from"./xpl-top-nav-item.js";import{XplUtilityBar as bo}from"./xpl-utility-bar.js";const uo=uo=>{"undefined"!=typeof customElements&&[r,p,m,t,i,l,s,e,f,x,a,j,n,d,c,b,u,g,h,v,w,y,k,E,P,A,N,O,q,z,B,C,D,F,G,H,I,J,K,L,M,Q,R,S,T,U,V,W,X,Y,Z,$,_,oo,ro,po,mo,to,io,lo,so,eo,fo,xo,ao,jo,no,co,bo].forEach((r=>{customElements.get(o(r.is))||customElements.define(o(r.is),r,uo)}))};export{uo as defineCustomElements}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n){const t=n.trim();if(!t)return"unnamed";let a=t.replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-");return/^[0-9-]/.test(a)&&(a=`t-${a}`),a}function t(n){var t;const a=n.closest("xpl-tabs");return null!==(t=null==a?void 0:a.getAttribute("data-tabs-instance-id"))&&void 0!==t?t:"xpl-tg-orphan"}function a(t,a){return`${t}-tab-${n(a)}`}function r(t,a){return`${t}-panel-${n(a)}`}export{r as a,t as g,a as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as c,h as n,Host as o,transformTag as t}from"@stencil/core/internal/client";import{d as a}from"./xpl-icon2.js";const i=e(class extends c{constructor(e){super(),!1!==e&&this.__registerHost(),this.initialExpanded=!1,this.size="3",this.borderType="none",this.expanded=this.initialExpanded,this.toggleAccordion=e=>{e.stopPropagation(),this.expanded=!this.expanded}}watchInitialExpanded(){this.expanded=this.initialExpanded}async parentCheckboxChange(e){return this.el.querySelectorAll(".xpl-accordion-content .xpl-checkbox:not([disabled])").forEach((c=>{c.checked=e})),null}handleChildCheckboxChange(){const e=this.el.querySelectorAll(".xpl-accordion-content .xpl-checkbox:not([disabled])"),c=Array.from(e).filter((e=>e.checked)).length,n=this.el.querySelector(".xpl-accordion-header xpl-checkbox")||this.el.querySelector(".xpl-accordion-header input");if(n)switch(c){case 0:n.checked=!1,n.indeterminate=!1;break;case e.length:n.checked=!0,n.indeterminate=!1;break;default:n.checked=!1,n.indeterminate=!0}}listenToChangeEvent(){this.handleChildCheckboxChange()}render(){return n(o,{key:"bd94adc64eebb9b2b37b899700457a88fa00bdf0",class:"xpl-accordion "+{none:"",bordered:"xpl-accordion--border-bordered"+(this.expanded?"--expanded":""),bottom:"xpl-accordion--border-bottom"+(this.expanded?"--expanded":"")}[this.borderType]},n("button",{key:"3801db3bfa5c3a8c6ac0c21c20f60a1519ca4168","aria-expanded":this.expanded,"aria-controls":this.contentId,class:"xpl-accordion-toggle-area",onClick:this.toggleAccordion,type:"button"},n("header",{key:"80cdadc37c28fea139f8ec21c770760bf3e25050",class:"xpl-accordion-header xpl-accordion-header--size-"+this.size},n("slot",{key:"28341a76482e2ddb2b8c1f277e48816a6f8d83d4",name:"heading"},this.header),n("xpl-icon",{key:"9b0cde7d7927677dcd545783accace4a9cdcce03",size:16,icon:"chevron-down",class:"xpl-accordion-icon-chevron "+(this.expanded?"xpl-accordion-icon-chevron--rotate":"")})),n("div",{key:"1d2be2ffce23d2cfc017da95634d046dc66e5121",class:"xpl-accordion-description"},n("slot",{key:"e993274ea2f6963290a2015b3849bda8ee7f1f3d",name:"description"},this.description))),n("section",{key:"6054b44f3b027feca7567f1bf13b06e78a78fe1a",id:this.contentId,role:"region",class:`xpl-accordion-content xpl-accordion-content--${this.expanded?"shown":"hidden"} ${this.expanded?{none:"",bordered:"xpl-accordion-content--shown-bordered",bottom:"xpl-accordion-content--shown-border-bottom"}[this.borderType]:""}`},n("slot",{key:"53e22f8fcd1c3ebb2354bbc3d01e30ec5cfa804c",name:"content"})))}get el(){return this}static get watchers(){return{initialExpanded:[{watchInitialExpanded:0}]}}},[260,"xpl-accordion",{contentId:[1,"content-id"],header:[1],description:[1],initialExpanded:[4,"initial-expanded"],size:[1],borderType:[1,"border-type"],expanded:[32],parentCheckboxChange:[64]},[[0,"checkboxChange","listenToChangeEvent"]],{initialExpanded:[{watchInitialExpanded:0}]}]),d=i,s=function(){"undefined"!=typeof customElements&&["xpl-accordion","xpl-icon"].forEach((e=>{switch(e){case"xpl-accordion":customElements.get(t(e))||customElements.define(t(e),i);break;case"xpl-icon":customElements.get(t(e))||a()}}))};export{d as XplAccordion,s as defineCustomElement}
|