@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,1085 @@
|
|
|
1
|
+
import { Host, forceUpdate, h, } from "@stencil/core";
|
|
2
|
+
import { autoUpdate, computePosition, flip, offset, shift } from "@floating-ui/dom";
|
|
3
|
+
const SPOTLIGHT_FOCUS_BUTTON_SELECTOR = '.xpl-spotlight__dismiss button, .xpl-spotlight__actions button';
|
|
4
|
+
const SPOTLIGHT_FOCUS_FALLBACK_MAX_TICKS = 120;
|
|
5
|
+
const SPOTLIGHT_FOCUS_OBSERVER_MAX_MS = 2500;
|
|
6
|
+
function waitForSpotlightFocusButtonWithoutMutationObserver(root, options) {
|
|
7
|
+
return new Promise((resolve) => {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
10
|
+
resolve(null);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
let ticks = 0;
|
|
14
|
+
let rafId;
|
|
15
|
+
let timeoutId;
|
|
16
|
+
const finish = (value) => {
|
|
17
|
+
if (rafId !== undefined && typeof cancelAnimationFrame !== 'undefined') {
|
|
18
|
+
cancelAnimationFrame(rafId);
|
|
19
|
+
}
|
|
20
|
+
if (timeoutId !== undefined) {
|
|
21
|
+
clearTimeout(timeoutId);
|
|
22
|
+
}
|
|
23
|
+
resolve(value);
|
|
24
|
+
};
|
|
25
|
+
const onAbort = () => finish(null);
|
|
26
|
+
(_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.addEventListener('abort', onAbort, { once: true });
|
|
27
|
+
const schedule = (fn) => {
|
|
28
|
+
if (typeof requestAnimationFrame !== 'undefined') {
|
|
29
|
+
rafId = requestAnimationFrame(() => {
|
|
30
|
+
rafId = undefined;
|
|
31
|
+
fn();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
timeoutId = setTimeout(() => {
|
|
36
|
+
timeoutId = undefined;
|
|
37
|
+
fn();
|
|
38
|
+
}, 0);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const tick = () => {
|
|
42
|
+
var _a, _b, _c;
|
|
43
|
+
if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
44
|
+
finish(null);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const el = root.querySelector(SPOTLIGHT_FOCUS_BUTTON_SELECTOR);
|
|
48
|
+
if (el) {
|
|
49
|
+
(_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.removeEventListener('abort', onAbort);
|
|
50
|
+
finish(el);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
ticks += 1;
|
|
54
|
+
if (ticks >= SPOTLIGHT_FOCUS_FALLBACK_MAX_TICKS) {
|
|
55
|
+
(_c = options === null || options === void 0 ? void 0 : options.signal) === null || _c === void 0 ? void 0 : _c.removeEventListener('abort', onAbort);
|
|
56
|
+
finish(null);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
schedule(tick);
|
|
60
|
+
};
|
|
61
|
+
schedule(tick);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function waitForSpotlightFocusButton(root, options) {
|
|
65
|
+
var _a;
|
|
66
|
+
const existing = root.querySelector(SPOTLIGHT_FOCUS_BUTTON_SELECTOR);
|
|
67
|
+
if (existing) {
|
|
68
|
+
return Promise.resolve(existing);
|
|
69
|
+
}
|
|
70
|
+
if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
71
|
+
return Promise.resolve(null);
|
|
72
|
+
}
|
|
73
|
+
if (typeof MutationObserver === 'undefined') {
|
|
74
|
+
return waitForSpotlightFocusButtonWithoutMutationObserver(root, options);
|
|
75
|
+
}
|
|
76
|
+
return new Promise((resolve) => {
|
|
77
|
+
var _a;
|
|
78
|
+
let settled = false;
|
|
79
|
+
let timeoutId;
|
|
80
|
+
let observer;
|
|
81
|
+
function finish(value) {
|
|
82
|
+
if (settled) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
settled = true;
|
|
86
|
+
observer.disconnect();
|
|
87
|
+
if (timeoutId !== undefined) {
|
|
88
|
+
clearTimeout(timeoutId);
|
|
89
|
+
}
|
|
90
|
+
resolve(value);
|
|
91
|
+
}
|
|
92
|
+
observer = new MutationObserver(() => {
|
|
93
|
+
const el = root.querySelector(SPOTLIGHT_FOCUS_BUTTON_SELECTOR);
|
|
94
|
+
if (el) {
|
|
95
|
+
finish(el);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
observer.observe(root instanceof Node ? root : document, {
|
|
99
|
+
childList: true,
|
|
100
|
+
subtree: true,
|
|
101
|
+
});
|
|
102
|
+
timeoutId = setTimeout(() => finish(null), SPOTLIGHT_FOCUS_OBSERVER_MAX_MS);
|
|
103
|
+
(_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.addEventListener('abort', () => {
|
|
104
|
+
finish(null);
|
|
105
|
+
}, { once: true });
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
let spotlightHeadingSeq = 0;
|
|
109
|
+
const ANCHOR_TO_PLACEMENT = {
|
|
110
|
+
'top-left': 'top-start',
|
|
111
|
+
'top-right': 'top-end',
|
|
112
|
+
'bottom-left': 'bottom-start',
|
|
113
|
+
'bottom-right': 'bottom-end',
|
|
114
|
+
};
|
|
115
|
+
const PLACEMENT_TO_CORNER = {
|
|
116
|
+
top: 'bottom-left',
|
|
117
|
+
'top-start': 'bottom-left',
|
|
118
|
+
'top-end': 'bottom-right',
|
|
119
|
+
bottom: 'top-left',
|
|
120
|
+
'bottom-start': 'top-left',
|
|
121
|
+
'bottom-end': 'top-right',
|
|
122
|
+
left: 'top-right',
|
|
123
|
+
'left-start': 'top-right',
|
|
124
|
+
'left-end': 'bottom-right',
|
|
125
|
+
right: 'top-left',
|
|
126
|
+
'right-start': 'top-left',
|
|
127
|
+
'right-end': 'bottom-left',
|
|
128
|
+
};
|
|
129
|
+
const FLOATING_UI_OFFSET_PX = 12;
|
|
130
|
+
const FLOATING_UI_SHIFT_PADDING_PX = 8;
|
|
131
|
+
export class Spotlight {
|
|
132
|
+
constructor() {
|
|
133
|
+
this.cleanupAutoUpdate = null;
|
|
134
|
+
this.enterVisibleFrameId = null;
|
|
135
|
+
this.focusFrameId = null;
|
|
136
|
+
this.hasCompletedInitialLoad = false;
|
|
137
|
+
this.headingId = (() => {
|
|
138
|
+
spotlightHeadingSeq += 1;
|
|
139
|
+
return `xpl-spotlight-heading-${spotlightHeadingSeq}`;
|
|
140
|
+
})();
|
|
141
|
+
this.pendingEnterTransitionAfterAnchor = false;
|
|
142
|
+
this.pendingEnterVisible = false;
|
|
143
|
+
this.positioningGeneration = 0;
|
|
144
|
+
this.previousFocus = null;
|
|
145
|
+
this.referenceEl = null;
|
|
146
|
+
this.shouldMoveFocusOnRender = false;
|
|
147
|
+
this.shouldReinitializeAfterReconnect = false;
|
|
148
|
+
this.slotContentObserver = null;
|
|
149
|
+
this.hasBodySlotContent = false;
|
|
150
|
+
this.hasFloatingPosition = false;
|
|
151
|
+
this.hasImageSlotContent = false;
|
|
152
|
+
this.hasTitleSlotContent = false;
|
|
153
|
+
this.isVisible = false;
|
|
154
|
+
this.resolvedAnchorPosition = 'top-left';
|
|
155
|
+
this.actionLayout = 'default';
|
|
156
|
+
this.anchorPosition = 'top-left';
|
|
157
|
+
this.currentStep = 1;
|
|
158
|
+
this.isDismissible = true;
|
|
159
|
+
this.isOpen = true;
|
|
160
|
+
this.primaryActionLabel = 'Next';
|
|
161
|
+
this.secondaryActionLabel = 'Back';
|
|
162
|
+
this.showActions = true;
|
|
163
|
+
this.showImage = true;
|
|
164
|
+
this.showSteps = true;
|
|
165
|
+
this.totalSteps = 1;
|
|
166
|
+
this.emitDismiss = () => {
|
|
167
|
+
this.dismiss.emit();
|
|
168
|
+
};
|
|
169
|
+
this.handleDismissClick = () => {
|
|
170
|
+
this.emitDismiss();
|
|
171
|
+
};
|
|
172
|
+
this.handlePrimaryClick = () => {
|
|
173
|
+
this.primaryAction.emit();
|
|
174
|
+
};
|
|
175
|
+
this.handleSecondaryClick = () => {
|
|
176
|
+
this.secondaryAction.emit();
|
|
177
|
+
};
|
|
178
|
+
this.handleTargetClick = () => {
|
|
179
|
+
this.targetClick.emit();
|
|
180
|
+
};
|
|
181
|
+
this.syncTitleSlotIds = () => {
|
|
182
|
+
const first = this.getFirstTitleSlottedElement();
|
|
183
|
+
if (first && !first.id) {
|
|
184
|
+
first.id = this.headingId;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
this.handleBodySlotChange = () => {
|
|
188
|
+
this.refreshBodySlotState();
|
|
189
|
+
};
|
|
190
|
+
this.handleTitleSlotChange = () => {
|
|
191
|
+
this.refreshTitleSlotState();
|
|
192
|
+
this.syncTitleSlotIds();
|
|
193
|
+
};
|
|
194
|
+
this.handleImageSlotChange = () => {
|
|
195
|
+
this.refreshImageSlotState();
|
|
196
|
+
};
|
|
197
|
+
this.handleSlotContentMutation = () => {
|
|
198
|
+
this.refreshBodySlotState();
|
|
199
|
+
this.refreshImageSlotState();
|
|
200
|
+
this.refreshTitleSlotState();
|
|
201
|
+
this.syncTitleSlotIds();
|
|
202
|
+
};
|
|
203
|
+
this.updatePosition = async (referenceEl) => {
|
|
204
|
+
var _a, _b, _c, _d, _e, _f;
|
|
205
|
+
const generation = this.positioningGeneration;
|
|
206
|
+
try {
|
|
207
|
+
const initialPlacement = ANCHOR_TO_PLACEMENT[this.anchorPosition];
|
|
208
|
+
const { x, y, placement, middlewareData } = await computePosition(referenceEl, this.el, {
|
|
209
|
+
strategy: 'fixed',
|
|
210
|
+
placement: initialPlacement,
|
|
211
|
+
middleware: [
|
|
212
|
+
offset(FLOATING_UI_OFFSET_PX),
|
|
213
|
+
flip({ crossAxis: false }),
|
|
214
|
+
shift({ padding: FLOATING_UI_SHIFT_PADDING_PX }),
|
|
215
|
+
],
|
|
216
|
+
});
|
|
217
|
+
if (generation !== this.positioningGeneration) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
this.el.style.left = `${x}px`;
|
|
221
|
+
this.el.style.top = `${y}px`;
|
|
222
|
+
const shiftX = (_b = (_a = middlewareData.shift) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;
|
|
223
|
+
const shiftY = (_d = (_c = middlewareData.shift) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;
|
|
224
|
+
this.el.style.setProperty('--xpl-spotlight-shift-x', `${-shiftX}px`);
|
|
225
|
+
this.el.style.setProperty('--xpl-spotlight-shift-y', `${-shiftY}px`);
|
|
226
|
+
this.hasFloatingPosition = true;
|
|
227
|
+
const corner = (_e = PLACEMENT_TO_CORNER[placement]) !== null && _e !== void 0 ? _e : PLACEMENT_TO_CORNER[(_f = placement.split('-')[0]) !== null && _f !== void 0 ? _f : ''];
|
|
228
|
+
this.resolvedAnchorPosition = corner !== null && corner !== void 0 ? corner : this.anchorPosition;
|
|
229
|
+
if (this.pendingEnterTransitionAfterAnchor) {
|
|
230
|
+
this.scheduleEnterTransition();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
catch (_g) {
|
|
234
|
+
if (generation !== this.positioningGeneration) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
this.clearFloatingHostCoordinates();
|
|
238
|
+
if (this.isOpenEnabled) {
|
|
239
|
+
this.scheduleEnterTransition({ skipAnchorWait: true });
|
|
240
|
+
await forceUpdate(this);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
onAnchorPositionChange() {
|
|
246
|
+
if (!this.target) {
|
|
247
|
+
this.resolvedAnchorPosition = this.anchorPosition;
|
|
248
|
+
}
|
|
249
|
+
else if (this.referenceEl) {
|
|
250
|
+
this.updatePosition(this.referenceEl).catch(() => { });
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this.resolvedAnchorPosition = this.anchorPosition;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
onIsOpenChange(isOpen) {
|
|
257
|
+
if (Spotlight.coerceBoolean(isOpen)) {
|
|
258
|
+
this.previousFocus =
|
|
259
|
+
document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
260
|
+
this.shouldMoveFocusOnRender = true;
|
|
261
|
+
this.isVisible = false;
|
|
262
|
+
this.refreshBodySlotState();
|
|
263
|
+
this.refreshTitleSlotState();
|
|
264
|
+
this.refreshImageSlotState();
|
|
265
|
+
if (this.target) {
|
|
266
|
+
if (this.cleanupAutoUpdate &&
|
|
267
|
+
this.referenceEl &&
|
|
268
|
+
this.el.ownerDocument.contains(this.referenceEl)) {
|
|
269
|
+
this.hasFloatingPosition = false;
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
this.startPositioning();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
this.scheduleEnterTransition();
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
this.cancelEnterTransition();
|
|
279
|
+
this.cancelPendingFocusWait();
|
|
280
|
+
this.isVisible = false;
|
|
281
|
+
if (!this.target) {
|
|
282
|
+
this.stopPositioning();
|
|
283
|
+
}
|
|
284
|
+
this.restoreFocus();
|
|
285
|
+
}
|
|
286
|
+
onTargetChange() {
|
|
287
|
+
if (!this.target) {
|
|
288
|
+
this.stopPositioning();
|
|
289
|
+
this.resolvedAnchorPosition = this.anchorPosition;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
this.startPositioning();
|
|
293
|
+
}
|
|
294
|
+
connectedCallback() {
|
|
295
|
+
if (!this.shouldReinitializeAfterReconnect) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
this.shouldReinitializeAfterReconnect = false;
|
|
299
|
+
this.startSlotContentObserver();
|
|
300
|
+
if (this.target) {
|
|
301
|
+
this.startPositioning();
|
|
302
|
+
}
|
|
303
|
+
if (!this.isOpenEnabled) {
|
|
304
|
+
this.isVisible = false;
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
this.previousFocus =
|
|
308
|
+
document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
309
|
+
this.shouldMoveFocusOnRender = true;
|
|
310
|
+
this.scheduleEnterTransition();
|
|
311
|
+
if (this.pendingEnterVisible) {
|
|
312
|
+
Promise.resolve(forceUpdate(this)).catch(() => { });
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
disconnectedCallback() {
|
|
316
|
+
this.cancelEnterTransition();
|
|
317
|
+
this.cancelPendingFocusWait();
|
|
318
|
+
this.stopSlotContentObserver();
|
|
319
|
+
this.stopPositioning();
|
|
320
|
+
if (this.hasCompletedInitialLoad) {
|
|
321
|
+
this.shouldReinitializeAfterReconnect = true;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
componentWillLoad() {
|
|
325
|
+
this.resolvedAnchorPosition = this.anchorPosition;
|
|
326
|
+
this.hasBodySlotContent = this.hasSlottedContent('body');
|
|
327
|
+
this.hasImageSlotContent = this.hasSlottedContent('image');
|
|
328
|
+
this.hasTitleSlotContent = this.hasSlottedContent('title');
|
|
329
|
+
if (this.isOpenEnabled) {
|
|
330
|
+
this.previousFocus =
|
|
331
|
+
document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
332
|
+
if (!this.target) {
|
|
333
|
+
this.pendingEnterVisible = true;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
this.shouldMoveFocusOnRender = this.isOpenEnabled;
|
|
337
|
+
}
|
|
338
|
+
componentDidLoad() {
|
|
339
|
+
this.hasCompletedInitialLoad = true;
|
|
340
|
+
this.startSlotContentObserver();
|
|
341
|
+
if (this.target) {
|
|
342
|
+
this.startPositioning();
|
|
343
|
+
}
|
|
344
|
+
if (!this.isOpenEnabled) {
|
|
345
|
+
this.isVisible = false;
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (this.target) {
|
|
349
|
+
this.scheduleEnterTransition();
|
|
350
|
+
if (this.pendingEnterVisible) {
|
|
351
|
+
Promise.resolve(forceUpdate(this)).catch(() => { });
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
componentDidRender() {
|
|
356
|
+
if (this.isOpenEnabled) {
|
|
357
|
+
this.syncTitleSlotIds();
|
|
358
|
+
}
|
|
359
|
+
if (this.pendingEnterVisible && this.isOpenEnabled) {
|
|
360
|
+
this.pendingEnterVisible = false;
|
|
361
|
+
this.enterVisibleFrameId = requestAnimationFrame(() => {
|
|
362
|
+
this.enterVisibleFrameId = null;
|
|
363
|
+
if (this.isOpenEnabled) {
|
|
364
|
+
this.isVisible = true;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
if (!this.shouldMoveFocusOnRender || !this.isOpenEnabled) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
this.shouldMoveFocusOnRender = false;
|
|
372
|
+
this.focusInitial();
|
|
373
|
+
}
|
|
374
|
+
handleKeyDown(ev) {
|
|
375
|
+
if (ev.key === 'Escape' && this.shouldHandleDismissKeyboardEvent()) {
|
|
376
|
+
ev.preventDefault();
|
|
377
|
+
this.emitDismiss();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
get effectiveTotalSteps() {
|
|
381
|
+
return Math.max(1, this.totalSteps);
|
|
382
|
+
}
|
|
383
|
+
get effectiveCurrentStep() {
|
|
384
|
+
return Math.min(this.effectiveTotalSteps, Math.max(1, this.currentStep));
|
|
385
|
+
}
|
|
386
|
+
get isDismissibleEnabled() {
|
|
387
|
+
return Spotlight.coerceBoolean(this.isDismissible);
|
|
388
|
+
}
|
|
389
|
+
get isOpenEnabled() {
|
|
390
|
+
return Spotlight.coerceBoolean(this.isOpen);
|
|
391
|
+
}
|
|
392
|
+
get isSingleActionLayout() {
|
|
393
|
+
return this.actionLayout === 'single';
|
|
394
|
+
}
|
|
395
|
+
get usesHiddenEdgeActions() {
|
|
396
|
+
return this.actionLayout === 'dual';
|
|
397
|
+
}
|
|
398
|
+
get isPrimaryStepActionDisabled() {
|
|
399
|
+
return (!this.usesHiddenEdgeActions &&
|
|
400
|
+
this.showStepsEnabled &&
|
|
401
|
+
this.effectiveCurrentStep >= this.effectiveTotalSteps);
|
|
402
|
+
}
|
|
403
|
+
get isSecondaryStepActionDisabled() {
|
|
404
|
+
return (!this.usesHiddenEdgeActions && this.showStepsEnabled && this.effectiveCurrentStep <= 1);
|
|
405
|
+
}
|
|
406
|
+
get shouldShowPrimaryAction() {
|
|
407
|
+
if (this.isSingleActionLayout) {
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
if (!this.usesHiddenEdgeActions) {
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
if (!this.showStepsEnabled) {
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
return this.effectiveCurrentStep < this.effectiveTotalSteps;
|
|
417
|
+
}
|
|
418
|
+
get shouldShowSecondaryAction() {
|
|
419
|
+
if (this.isSingleActionLayout) {
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
if (!this.usesHiddenEdgeActions) {
|
|
423
|
+
return true;
|
|
424
|
+
}
|
|
425
|
+
if (!this.showStepsEnabled) {
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
return this.effectiveCurrentStep > 1;
|
|
429
|
+
}
|
|
430
|
+
get hasRenderableFocusChrome() {
|
|
431
|
+
if (this.isDismissibleEnabled) {
|
|
432
|
+
return true;
|
|
433
|
+
}
|
|
434
|
+
if (!this.showActionsEnabled) {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
return this.shouldShowPrimaryAction || this.shouldShowSecondaryAction;
|
|
438
|
+
}
|
|
439
|
+
get showActionsEnabled() {
|
|
440
|
+
return Spotlight.coerceBoolean(this.showActions);
|
|
441
|
+
}
|
|
442
|
+
get showImageEnabled() {
|
|
443
|
+
return Spotlight.coerceBoolean(this.showImage);
|
|
444
|
+
}
|
|
445
|
+
get showStepsEnabled() {
|
|
446
|
+
return Spotlight.coerceBoolean(this.showSteps);
|
|
447
|
+
}
|
|
448
|
+
get headingPropHasText() {
|
|
449
|
+
var _a;
|
|
450
|
+
return Boolean((_a = this.heading) === null || _a === void 0 ? void 0 : _a.trim());
|
|
451
|
+
}
|
|
452
|
+
get bodyPropHasText() {
|
|
453
|
+
var _a;
|
|
454
|
+
return Boolean((_a = this.body) === null || _a === void 0 ? void 0 : _a.trim());
|
|
455
|
+
}
|
|
456
|
+
async focusInitial() {
|
|
457
|
+
var _a;
|
|
458
|
+
(_a = this.focusAbort) === null || _a === void 0 ? void 0 : _a.abort();
|
|
459
|
+
this.focusAbort = new AbortController();
|
|
460
|
+
if (!this.hasRenderableFocusChrome && this.isOpenEnabled) {
|
|
461
|
+
this.focusFrameId = requestAnimationFrame(() => {
|
|
462
|
+
this.focusFrameId = null;
|
|
463
|
+
if (!this.isOpenEnabled) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
this.el.focus();
|
|
467
|
+
});
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const target = await waitForSpotlightFocusButton(this.el, {
|
|
471
|
+
signal: this.focusAbort.signal,
|
|
472
|
+
});
|
|
473
|
+
if (target) {
|
|
474
|
+
target.focus();
|
|
475
|
+
}
|
|
476
|
+
else if (this.isOpenEnabled) {
|
|
477
|
+
this.el.focus();
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
shouldHandleDismissKeyboardEvent() {
|
|
481
|
+
if (!this.isDismissibleEnabled || !this.isOpenEnabled || !this.isVisible) {
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
const { activeElement } = document;
|
|
485
|
+
return (Boolean(activeElement) && (activeElement === this.el || this.el.contains(activeElement)));
|
|
486
|
+
}
|
|
487
|
+
restoreFocus() {
|
|
488
|
+
var _a;
|
|
489
|
+
if ((_a = this.previousFocus) === null || _a === void 0 ? void 0 : _a.isConnected) {
|
|
490
|
+
this.previousFocus.focus();
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
cancelPendingFocusWait() {
|
|
494
|
+
var _a;
|
|
495
|
+
(_a = this.focusAbort) === null || _a === void 0 ? void 0 : _a.abort();
|
|
496
|
+
if (this.focusFrameId != null) {
|
|
497
|
+
cancelAnimationFrame(this.focusFrameId);
|
|
498
|
+
this.focusFrameId = null;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
cancelEnterTransition() {
|
|
502
|
+
if (this.enterVisibleFrameId !== null) {
|
|
503
|
+
cancelAnimationFrame(this.enterVisibleFrameId);
|
|
504
|
+
this.enterVisibleFrameId = null;
|
|
505
|
+
}
|
|
506
|
+
this.pendingEnterVisible = false;
|
|
507
|
+
}
|
|
508
|
+
scheduleEnterTransition(options) {
|
|
509
|
+
this.cancelEnterTransition();
|
|
510
|
+
const shouldDeferUntilAnchored = !(options === null || options === void 0 ? void 0 : options.skipAnchorWait) &&
|
|
511
|
+
Boolean(this.target && this.referenceEl) &&
|
|
512
|
+
!this.hasFloatingPosition;
|
|
513
|
+
if (shouldDeferUntilAnchored) {
|
|
514
|
+
this.pendingEnterTransitionAfterAnchor = true;
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
this.pendingEnterTransitionAfterAnchor = false;
|
|
518
|
+
this.pendingEnterVisible = true;
|
|
519
|
+
}
|
|
520
|
+
getFirstTitleSlottedElement() {
|
|
521
|
+
var _a;
|
|
522
|
+
const fromHost = Array.from(this.el.children).find((node) => node.nodeType === Node.ELEMENT_NODE && node.getAttribute('slot') === 'title');
|
|
523
|
+
if (fromHost) {
|
|
524
|
+
return fromHost;
|
|
525
|
+
}
|
|
526
|
+
const slot = this.el.querySelector('slot[name="title"]');
|
|
527
|
+
if (!slot) {
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
return ((_a = Array.from(slot.assignedNodes({ flatten: true })).find((node) => node.nodeType === Node.ELEMENT_NODE)) !== null && _a !== void 0 ? _a : null);
|
|
531
|
+
}
|
|
532
|
+
getDialogLabelId() {
|
|
533
|
+
if (this.hasTitleSlotContent) {
|
|
534
|
+
const first = this.getFirstTitleSlottedElement();
|
|
535
|
+
if (first === null || first === void 0 ? void 0 : first.id) {
|
|
536
|
+
return first.id;
|
|
537
|
+
}
|
|
538
|
+
return this.headingId;
|
|
539
|
+
}
|
|
540
|
+
if (this.headingPropHasText) {
|
|
541
|
+
return this.headingId;
|
|
542
|
+
}
|
|
543
|
+
return undefined;
|
|
544
|
+
}
|
|
545
|
+
refreshBodySlotState() {
|
|
546
|
+
const next = this.hasSlottedContent('body');
|
|
547
|
+
if (this.hasBodySlotContent === next) {
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
this.hasBodySlotContent = next;
|
|
551
|
+
}
|
|
552
|
+
refreshTitleSlotState() {
|
|
553
|
+
const next = this.hasSlottedContent('title');
|
|
554
|
+
if (this.hasTitleSlotContent === next) {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
this.hasTitleSlotContent = next;
|
|
558
|
+
}
|
|
559
|
+
static coerceBoolean(value) {
|
|
560
|
+
if (typeof value === 'string') {
|
|
561
|
+
const normalized = value.trim().toLowerCase();
|
|
562
|
+
return normalized !== 'false';
|
|
563
|
+
}
|
|
564
|
+
return Boolean(value);
|
|
565
|
+
}
|
|
566
|
+
refreshImageSlotState() {
|
|
567
|
+
const next = this.hasSlottedContent('image');
|
|
568
|
+
if (this.hasImageSlotContent === next) {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
this.hasImageSlotContent = next;
|
|
572
|
+
}
|
|
573
|
+
startSlotContentObserver() {
|
|
574
|
+
if (typeof MutationObserver === 'undefined' || this.slotContentObserver) {
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
this.slotContentObserver = new MutationObserver(this.handleSlotContentMutation);
|
|
578
|
+
this.slotContentObserver.observe(this.el, {
|
|
579
|
+
attributes: true,
|
|
580
|
+
attributeFilter: ['slot'],
|
|
581
|
+
childList: true,
|
|
582
|
+
subtree: true,
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
stopSlotContentObserver() {
|
|
586
|
+
var _a;
|
|
587
|
+
(_a = this.slotContentObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
588
|
+
this.slotContentObserver = null;
|
|
589
|
+
}
|
|
590
|
+
hasSlottedContent(slotName) {
|
|
591
|
+
const slot = this.el.querySelector(`slot[name="${slotName}"]`);
|
|
592
|
+
const fromQuery = this.el.querySelector(`[slot="${slotName}"]`);
|
|
593
|
+
const fromHostChildren = Array.from(this.el.children).some((el) => el.getAttribute('slot') === slotName);
|
|
594
|
+
const hasAssigned = slot
|
|
595
|
+
? slot
|
|
596
|
+
.assignedNodes({ flatten: true })
|
|
597
|
+
.some((n) => {
|
|
598
|
+
var _a;
|
|
599
|
+
return n.nodeType === Node.ELEMENT_NODE ||
|
|
600
|
+
(n.nodeType === Node.TEXT_NODE && ((_a = n.textContent) === null || _a === void 0 ? void 0 : _a.trim()));
|
|
601
|
+
})
|
|
602
|
+
: false;
|
|
603
|
+
return Boolean(fromQuery || fromHostChildren) || hasAssigned;
|
|
604
|
+
}
|
|
605
|
+
startPositioning() {
|
|
606
|
+
if (!this.target) {
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
let el = null;
|
|
610
|
+
try {
|
|
611
|
+
el = this.el.ownerDocument.querySelector(this.target);
|
|
612
|
+
}
|
|
613
|
+
catch (_a) {
|
|
614
|
+
this.stopPositioning();
|
|
615
|
+
this.resolvedAnchorPosition = this.anchorPosition;
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
if (!el) {
|
|
619
|
+
this.stopPositioning();
|
|
620
|
+
this.resolvedAnchorPosition = this.anchorPosition;
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
this.detachFloatingUiListeners();
|
|
624
|
+
this.referenceEl = el;
|
|
625
|
+
this.cleanupAutoUpdate = autoUpdate(el, this.el, () => {
|
|
626
|
+
this.updatePosition(el).catch(() => { });
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
detachFloatingUiListeners() {
|
|
630
|
+
this.positioningGeneration += 1;
|
|
631
|
+
if (this.cleanupAutoUpdate) {
|
|
632
|
+
this.cleanupAutoUpdate();
|
|
633
|
+
this.cleanupAutoUpdate = null;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
resetFloatingHostPosition() {
|
|
637
|
+
this.el.style.left = '';
|
|
638
|
+
this.el.style.top = '';
|
|
639
|
+
this.el.style.removeProperty('--xpl-spotlight-shift-x');
|
|
640
|
+
this.el.style.removeProperty('--xpl-spotlight-shift-y');
|
|
641
|
+
this.hasFloatingPosition = false;
|
|
642
|
+
this.pendingEnterTransitionAfterAnchor = false;
|
|
643
|
+
this.referenceEl = null;
|
|
644
|
+
}
|
|
645
|
+
clearFloatingHostCoordinates() {
|
|
646
|
+
this.el.style.left = '';
|
|
647
|
+
this.el.style.top = '';
|
|
648
|
+
this.el.style.removeProperty('--xpl-spotlight-shift-x');
|
|
649
|
+
this.el.style.removeProperty('--xpl-spotlight-shift-y');
|
|
650
|
+
this.hasFloatingPosition = false;
|
|
651
|
+
this.pendingEnterTransitionAfterAnchor = false;
|
|
652
|
+
this.resolvedAnchorPosition = this.anchorPosition;
|
|
653
|
+
}
|
|
654
|
+
stopPositioning() {
|
|
655
|
+
this.detachFloatingUiListeners();
|
|
656
|
+
this.resetFloatingHostPosition();
|
|
657
|
+
}
|
|
658
|
+
render() {
|
|
659
|
+
if (!this.isOpenEnabled) {
|
|
660
|
+
if (this.target) {
|
|
661
|
+
return (h(Host, { class: {
|
|
662
|
+
'xpl-spotlight': true,
|
|
663
|
+
'xpl-spotlight--target-only': true,
|
|
664
|
+
[`xpl-spotlight--${this.resolvedAnchorPosition}`]: true,
|
|
665
|
+
'xpl-spotlight--anchored': this.hasFloatingPosition,
|
|
666
|
+
} }, 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" }))));
|
|
667
|
+
}
|
|
668
|
+
return (h(Host, { "aria-hidden": "true", class: {
|
|
669
|
+
'xpl-spotlight': true,
|
|
670
|
+
'xpl-spotlight--closed': true,
|
|
671
|
+
} }));
|
|
672
|
+
}
|
|
673
|
+
const { isSingleActionLayout, shouldShowPrimaryAction: showPrimaryAction, shouldShowSecondaryAction: showSecondaryAction, showActionsEnabled: showActions, showImageEnabled: showImage, showStepsEnabled: showSteps, } = this;
|
|
674
|
+
return (h(Host, { class: {
|
|
675
|
+
[`xpl-spotlight--action-layout-${this.actionLayout}`]: showActions,
|
|
676
|
+
'xpl-spotlight': true,
|
|
677
|
+
[`xpl-spotlight--${this.resolvedAnchorPosition}`]: true,
|
|
678
|
+
'xpl-spotlight--anchored': this.hasFloatingPosition,
|
|
679
|
+
'xpl-spotlight--no-image': !showImage,
|
|
680
|
+
'xpl-spotlight--only-primary-action': showActions && showPrimaryAction && !showSecondaryAction,
|
|
681
|
+
'xpl-spotlight--only-secondary-action': showActions && showSecondaryAction && !showPrimaryAction,
|
|
682
|
+
'xpl-spotlight--visible': this.isVisible,
|
|
683
|
+
}, role: "dialog", "aria-modal": "false", "aria-label": this.getDialogLabelId() ? undefined : 'Tour step', "aria-labelledby": this.getDialogLabelId(), 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
|
+
'xpl-spotlight__image-container': true,
|
|
685
|
+
'xpl-spotlight__image-container--empty': !this.hasImageSlotContent,
|
|
686
|
+
'xpl-spotlight__image-container--hidden': !showImage,
|
|
687
|
+
} }, !this.hasImageSlotContent && showImage && (h("div", { class: "xpl-spotlight__image-placeholder", "aria-hidden": "true" }, h("xpl-icon", { icon: "photo", size: 24 }), h("xpl-icon", { icon: "video", size: 24 }))), h("slot", { name: "image", onSlotchange: this.handleImageSlotChange })), h("div", { class: "xpl-spotlight__content" }, h("div", { class: "xpl-spotlight__header" }, h("slot", { name: "title", onSlotchange: this.handleTitleSlotChange }, !this.hasTitleSlotContent && this.headingPropHasText && (h("span", { class: "xpl-spotlight__title", id: this.headingId }, this.heading))), h("slot", { name: "body", onSlotchange: this.handleBodySlotChange }, !this.hasBodySlotContent && this.bodyPropHasText && (h("p", { class: "xpl-spotlight__body" }, this.body)))), showActions && (h("div", { class: {
|
|
688
|
+
'xpl-spotlight__actions': true,
|
|
689
|
+
'xpl-spotlight__actions--dual': !isSingleActionLayout,
|
|
690
|
+
'xpl-spotlight__actions--single': isSingleActionLayout,
|
|
691
|
+
'xpl-spotlight__actions--with-steps': showSteps,
|
|
692
|
+
'xpl-spotlight__actions--only-primary': showPrimaryAction && !showSecondaryAction,
|
|
693
|
+
'xpl-spotlight__actions--only-secondary': showSecondaryAction && !showPrimaryAction,
|
|
694
|
+
} }, h("div", { class: "xpl-spotlight__action-slot xpl-spotlight__action-slot--secondary" }, showSecondaryAction && (h("xpl-button", { class: "xpl-spotlight__secondary-action", variant: "secondary", size: "default", disabled: this.isSecondaryStepActionDisabled, onClick: this.handleSecondaryClick }, this.secondaryActionLabel))), showSteps && (h("span", { class: "xpl-spotlight__step-text" }, this.effectiveCurrentStep, " of ", this.effectiveTotalSteps)), h("div", { class: "xpl-spotlight__action-slot xpl-spotlight__action-slot--primary" }, showPrimaryAction && (h("xpl-button", { class: "xpl-spotlight__primary-action", variant: "primary", size: "default", disabled: this.isPrimaryStepActionDisabled, onClick: this.handlePrimaryClick }, this.primaryActionLabel)))))))));
|
|
695
|
+
}
|
|
696
|
+
static get is() { return "xpl-spotlight"; }
|
|
697
|
+
static get properties() {
|
|
698
|
+
return {
|
|
699
|
+
"actionLayout": {
|
|
700
|
+
"type": "string",
|
|
701
|
+
"mutable": false,
|
|
702
|
+
"complexType": {
|
|
703
|
+
"original": "SpotlightActionLayout",
|
|
704
|
+
"resolved": "\"default\" | \"dual\" | \"single\"",
|
|
705
|
+
"references": {
|
|
706
|
+
"SpotlightActionLayout": {
|
|
707
|
+
"location": "local",
|
|
708
|
+
"path": "/home/runner/work/apollo/apollo/packages/apollo-core/src/components/components/xpl-spotlight/xpl-spotlight.tsx",
|
|
709
|
+
"id": "src/components/components/xpl-spotlight/xpl-spotlight.tsx::SpotlightActionLayout"
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
"required": false,
|
|
714
|
+
"optional": false,
|
|
715
|
+
"docs": {
|
|
716
|
+
"tags": [],
|
|
717
|
+
"text": "Footer action layout. `default` and `dual` both render the standard Back/Next layout, while\n`single` renders a single acknowledgement CTA (e.g. \"Got it!\").\nOnly applies when `showActions` is `true`."
|
|
718
|
+
},
|
|
719
|
+
"getter": false,
|
|
720
|
+
"setter": false,
|
|
721
|
+
"reflect": false,
|
|
722
|
+
"attribute": "action-layout",
|
|
723
|
+
"defaultValue": "'default'"
|
|
724
|
+
},
|
|
725
|
+
"anchorPosition": {
|
|
726
|
+
"type": "string",
|
|
727
|
+
"mutable": false,
|
|
728
|
+
"complexType": {
|
|
729
|
+
"original": "SpotlightAnchorPosition",
|
|
730
|
+
"resolved": "\"bottom-left\" | \"bottom-right\" | \"top-left\" | \"top-right\"",
|
|
731
|
+
"references": {
|
|
732
|
+
"SpotlightAnchorPosition": {
|
|
733
|
+
"location": "local",
|
|
734
|
+
"path": "/home/runner/work/apollo/apollo/packages/apollo-core/src/components/components/xpl-spotlight/xpl-spotlight.tsx",
|
|
735
|
+
"id": "src/components/components/xpl-spotlight/xpl-spotlight.tsx::SpotlightAnchorPosition"
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
"required": false,
|
|
740
|
+
"optional": false,
|
|
741
|
+
"docs": {
|
|
742
|
+
"tags": [],
|
|
743
|
+
"text": "Which corner of the card the anchor dot uses when not using `target`, or as the preferred side for Floating UI."
|
|
744
|
+
},
|
|
745
|
+
"getter": false,
|
|
746
|
+
"setter": false,
|
|
747
|
+
"reflect": false,
|
|
748
|
+
"attribute": "anchor-position",
|
|
749
|
+
"defaultValue": "'top-left'"
|
|
750
|
+
},
|
|
751
|
+
"body": {
|
|
752
|
+
"type": "string",
|
|
753
|
+
"mutable": false,
|
|
754
|
+
"complexType": {
|
|
755
|
+
"original": "string",
|
|
756
|
+
"resolved": "string",
|
|
757
|
+
"references": {}
|
|
758
|
+
},
|
|
759
|
+
"required": false,
|
|
760
|
+
"optional": true,
|
|
761
|
+
"docs": {
|
|
762
|
+
"tags": [],
|
|
763
|
+
"text": "Body copy when the `body` slot has no slotted content. Whitespace-only values are treated as empty (no fallback paragraph)."
|
|
764
|
+
},
|
|
765
|
+
"getter": false,
|
|
766
|
+
"setter": false,
|
|
767
|
+
"reflect": false,
|
|
768
|
+
"attribute": "body"
|
|
769
|
+
},
|
|
770
|
+
"currentStep": {
|
|
771
|
+
"type": "number",
|
|
772
|
+
"mutable": false,
|
|
773
|
+
"complexType": {
|
|
774
|
+
"original": "number",
|
|
775
|
+
"resolved": "number",
|
|
776
|
+
"references": {}
|
|
777
|
+
},
|
|
778
|
+
"required": false,
|
|
779
|
+
"optional": false,
|
|
780
|
+
"docs": {
|
|
781
|
+
"tags": [],
|
|
782
|
+
"text": "Current step index (1-based). Used with `totalSteps` for the step label and for disabling\ndefault Back/Next when `showSteps` is true."
|
|
783
|
+
},
|
|
784
|
+
"getter": false,
|
|
785
|
+
"setter": false,
|
|
786
|
+
"reflect": false,
|
|
787
|
+
"attribute": "current-step",
|
|
788
|
+
"defaultValue": "1"
|
|
789
|
+
},
|
|
790
|
+
"heading": {
|
|
791
|
+
"type": "string",
|
|
792
|
+
"mutable": false,
|
|
793
|
+
"complexType": {
|
|
794
|
+
"original": "string",
|
|
795
|
+
"resolved": "string",
|
|
796
|
+
"references": {}
|
|
797
|
+
},
|
|
798
|
+
"required": false,
|
|
799
|
+
"optional": true,
|
|
800
|
+
"docs": {
|
|
801
|
+
"tags": [],
|
|
802
|
+
"text": "Heading when the `title` slot has no slotted content. Whitespace-only values are treated as empty (no fallback title span)."
|
|
803
|
+
},
|
|
804
|
+
"getter": false,
|
|
805
|
+
"setter": false,
|
|
806
|
+
"reflect": false,
|
|
807
|
+
"attribute": "heading"
|
|
808
|
+
},
|
|
809
|
+
"isDismissible": {
|
|
810
|
+
"type": "boolean",
|
|
811
|
+
"mutable": false,
|
|
812
|
+
"complexType": {
|
|
813
|
+
"original": "boolean",
|
|
814
|
+
"resolved": "boolean",
|
|
815
|
+
"references": {}
|
|
816
|
+
},
|
|
817
|
+
"required": false,
|
|
818
|
+
"optional": false,
|
|
819
|
+
"docs": {
|
|
820
|
+
"tags": [],
|
|
821
|
+
"text": "Whether to show the dismiss (close) control."
|
|
822
|
+
},
|
|
823
|
+
"getter": false,
|
|
824
|
+
"setter": false,
|
|
825
|
+
"reflect": false,
|
|
826
|
+
"attribute": "is-dismissible",
|
|
827
|
+
"defaultValue": "true"
|
|
828
|
+
},
|
|
829
|
+
"isOpen": {
|
|
830
|
+
"type": "boolean",
|
|
831
|
+
"mutable": false,
|
|
832
|
+
"complexType": {
|
|
833
|
+
"original": "boolean",
|
|
834
|
+
"resolved": "boolean",
|
|
835
|
+
"references": {}
|
|
836
|
+
},
|
|
837
|
+
"required": false,
|
|
838
|
+
"optional": false,
|
|
839
|
+
"docs": {
|
|
840
|
+
"tags": [],
|
|
841
|
+
"text": "Controls whether the spotlight is rendered. When false, the host remains in the DOM but the spotlight UI is hidden."
|
|
842
|
+
},
|
|
843
|
+
"getter": false,
|
|
844
|
+
"setter": false,
|
|
845
|
+
"reflect": false,
|
|
846
|
+
"attribute": "is-open",
|
|
847
|
+
"defaultValue": "true"
|
|
848
|
+
},
|
|
849
|
+
"primaryActionLabel": {
|
|
850
|
+
"type": "string",
|
|
851
|
+
"mutable": false,
|
|
852
|
+
"complexType": {
|
|
853
|
+
"original": "string",
|
|
854
|
+
"resolved": "string",
|
|
855
|
+
"references": {}
|
|
856
|
+
},
|
|
857
|
+
"required": false,
|
|
858
|
+
"optional": false,
|
|
859
|
+
"docs": {
|
|
860
|
+
"tags": [],
|
|
861
|
+
"text": "Label used for the default primary action button. Only applies when `showActions` is `true`."
|
|
862
|
+
},
|
|
863
|
+
"getter": false,
|
|
864
|
+
"setter": false,
|
|
865
|
+
"reflect": false,
|
|
866
|
+
"attribute": "primary-action-label",
|
|
867
|
+
"defaultValue": "'Next'"
|
|
868
|
+
},
|
|
869
|
+
"secondaryActionLabel": {
|
|
870
|
+
"type": "string",
|
|
871
|
+
"mutable": false,
|
|
872
|
+
"complexType": {
|
|
873
|
+
"original": "string",
|
|
874
|
+
"resolved": "string",
|
|
875
|
+
"references": {}
|
|
876
|
+
},
|
|
877
|
+
"required": false,
|
|
878
|
+
"optional": false,
|
|
879
|
+
"docs": {
|
|
880
|
+
"tags": [],
|
|
881
|
+
"text": "Label used for the default secondary action button. Only applies when `showActions` is `true`."
|
|
882
|
+
},
|
|
883
|
+
"getter": false,
|
|
884
|
+
"setter": false,
|
|
885
|
+
"reflect": false,
|
|
886
|
+
"attribute": "secondary-action-label",
|
|
887
|
+
"defaultValue": "'Back'"
|
|
888
|
+
},
|
|
889
|
+
"showActions": {
|
|
890
|
+
"type": "boolean",
|
|
891
|
+
"mutable": false,
|
|
892
|
+
"complexType": {
|
|
893
|
+
"original": "boolean",
|
|
894
|
+
"resolved": "boolean",
|
|
895
|
+
"references": {}
|
|
896
|
+
},
|
|
897
|
+
"required": false,
|
|
898
|
+
"optional": false,
|
|
899
|
+
"docs": {
|
|
900
|
+
"tags": [],
|
|
901
|
+
"text": "Whether to show the actions row (primary / secondary and optional step counter).\nWhen `false`, the spotlight has no action buttons \u2014 useful for single-step\ninformational callouts that rely solely on the dismiss control."
|
|
902
|
+
},
|
|
903
|
+
"getter": false,
|
|
904
|
+
"setter": false,
|
|
905
|
+
"reflect": false,
|
|
906
|
+
"attribute": "show-actions",
|
|
907
|
+
"defaultValue": "true"
|
|
908
|
+
},
|
|
909
|
+
"showImage": {
|
|
910
|
+
"type": "boolean",
|
|
911
|
+
"mutable": false,
|
|
912
|
+
"complexType": {
|
|
913
|
+
"original": "boolean",
|
|
914
|
+
"resolved": "boolean",
|
|
915
|
+
"references": {}
|
|
916
|
+
},
|
|
917
|
+
"required": false,
|
|
918
|
+
"optional": false,
|
|
919
|
+
"docs": {
|
|
920
|
+
"tags": [],
|
|
921
|
+
"text": "When true, the media region is shown. Slotted `image` content is rendered when present;\notherwise the built-in placeholder UI is shown. When false, the entire media block is hidden."
|
|
922
|
+
},
|
|
923
|
+
"getter": false,
|
|
924
|
+
"setter": false,
|
|
925
|
+
"reflect": false,
|
|
926
|
+
"attribute": "show-image",
|
|
927
|
+
"defaultValue": "true"
|
|
928
|
+
},
|
|
929
|
+
"showSteps": {
|
|
930
|
+
"type": "boolean",
|
|
931
|
+
"mutable": false,
|
|
932
|
+
"complexType": {
|
|
933
|
+
"original": "boolean",
|
|
934
|
+
"resolved": "boolean",
|
|
935
|
+
"references": {}
|
|
936
|
+
},
|
|
937
|
+
"required": false,
|
|
938
|
+
"optional": false,
|
|
939
|
+
"docs": {
|
|
940
|
+
"tags": [],
|
|
941
|
+
"text": "Whether to show the step counter between actions (`currentStep` of `totalSteps`) and whether\ndefault Back/Next use step-based disabled state."
|
|
942
|
+
},
|
|
943
|
+
"getter": false,
|
|
944
|
+
"setter": false,
|
|
945
|
+
"reflect": false,
|
|
946
|
+
"attribute": "show-steps",
|
|
947
|
+
"defaultValue": "true"
|
|
948
|
+
},
|
|
949
|
+
"target": {
|
|
950
|
+
"type": "string",
|
|
951
|
+
"mutable": false,
|
|
952
|
+
"complexType": {
|
|
953
|
+
"original": "string",
|
|
954
|
+
"resolved": "string",
|
|
955
|
+
"references": {}
|
|
956
|
+
},
|
|
957
|
+
"required": false,
|
|
958
|
+
"optional": true,
|
|
959
|
+
"docs": {
|
|
960
|
+
"tags": [],
|
|
961
|
+
"text": "CSS selector for the element this spotlight anchors to. When set, placement uses Floating UI\n(`computePosition` with `strategy: 'fixed'`, plus `flip`, `shift`, `offset`) and `autoUpdate`\nfor scroll/resize. The host receives `left` / `top` and the `xpl-spotlight--anchored` class.\nInvalid selectors are ignored; layout falls back to `anchor-position`."
|
|
962
|
+
},
|
|
963
|
+
"getter": false,
|
|
964
|
+
"setter": false,
|
|
965
|
+
"reflect": false,
|
|
966
|
+
"attribute": "target"
|
|
967
|
+
},
|
|
968
|
+
"totalSteps": {
|
|
969
|
+
"type": "number",
|
|
970
|
+
"mutable": false,
|
|
971
|
+
"complexType": {
|
|
972
|
+
"original": "number",
|
|
973
|
+
"resolved": "number",
|
|
974
|
+
"references": {}
|
|
975
|
+
},
|
|
976
|
+
"required": false,
|
|
977
|
+
"optional": false,
|
|
978
|
+
"docs": {
|
|
979
|
+
"tags": [],
|
|
980
|
+
"text": "Total number of steps (1-based upper bound). Used with `currentStep` for the step label and\nfor disabling default Back/Next when `showSteps` is true."
|
|
981
|
+
},
|
|
982
|
+
"getter": false,
|
|
983
|
+
"setter": false,
|
|
984
|
+
"reflect": false,
|
|
985
|
+
"attribute": "total-steps",
|
|
986
|
+
"defaultValue": "1"
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
static get states() {
|
|
991
|
+
return {
|
|
992
|
+
"hasBodySlotContent": {},
|
|
993
|
+
"hasFloatingPosition": {},
|
|
994
|
+
"hasImageSlotContent": {},
|
|
995
|
+
"hasTitleSlotContent": {},
|
|
996
|
+
"isVisible": {},
|
|
997
|
+
"resolvedAnchorPosition": {}
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
static get events() {
|
|
1001
|
+
return [{
|
|
1002
|
+
"method": "dismiss",
|
|
1003
|
+
"name": "dismiss",
|
|
1004
|
+
"bubbles": true,
|
|
1005
|
+
"cancelable": true,
|
|
1006
|
+
"composed": true,
|
|
1007
|
+
"docs": {
|
|
1008
|
+
"tags": [],
|
|
1009
|
+
"text": "Emitted when the dismiss control is activated or Escape is pressed (when dismissible)."
|
|
1010
|
+
},
|
|
1011
|
+
"complexType": {
|
|
1012
|
+
"original": "void",
|
|
1013
|
+
"resolved": "void",
|
|
1014
|
+
"references": {}
|
|
1015
|
+
}
|
|
1016
|
+
}, {
|
|
1017
|
+
"method": "primaryAction",
|
|
1018
|
+
"name": "primaryAction",
|
|
1019
|
+
"bubbles": true,
|
|
1020
|
+
"cancelable": true,
|
|
1021
|
+
"composed": true,
|
|
1022
|
+
"docs": {
|
|
1023
|
+
"tags": [],
|
|
1024
|
+
"text": "Emitted when the primary action control is activated (default: Next)."
|
|
1025
|
+
},
|
|
1026
|
+
"complexType": {
|
|
1027
|
+
"original": "void",
|
|
1028
|
+
"resolved": "void",
|
|
1029
|
+
"references": {}
|
|
1030
|
+
}
|
|
1031
|
+
}, {
|
|
1032
|
+
"method": "secondaryAction",
|
|
1033
|
+
"name": "secondaryAction",
|
|
1034
|
+
"bubbles": true,
|
|
1035
|
+
"cancelable": true,
|
|
1036
|
+
"composed": true,
|
|
1037
|
+
"docs": {
|
|
1038
|
+
"tags": [],
|
|
1039
|
+
"text": "Emitted when the secondary action control is activated (default: Back)."
|
|
1040
|
+
},
|
|
1041
|
+
"complexType": {
|
|
1042
|
+
"original": "void",
|
|
1043
|
+
"resolved": "void",
|
|
1044
|
+
"references": {}
|
|
1045
|
+
}
|
|
1046
|
+
}, {
|
|
1047
|
+
"method": "targetClick",
|
|
1048
|
+
"name": "targetClick",
|
|
1049
|
+
"bubbles": true,
|
|
1050
|
+
"cancelable": true,
|
|
1051
|
+
"composed": true,
|
|
1052
|
+
"docs": {
|
|
1053
|
+
"tags": [],
|
|
1054
|
+
"text": "Emitted when the target indicator is clicked. Consumers typically toggle `isOpen` in response."
|
|
1055
|
+
},
|
|
1056
|
+
"complexType": {
|
|
1057
|
+
"original": "void",
|
|
1058
|
+
"resolved": "void",
|
|
1059
|
+
"references": {}
|
|
1060
|
+
}
|
|
1061
|
+
}];
|
|
1062
|
+
}
|
|
1063
|
+
static get elementRef() { return "el"; }
|
|
1064
|
+
static get watchers() {
|
|
1065
|
+
return [{
|
|
1066
|
+
"propName": "anchorPosition",
|
|
1067
|
+
"methodName": "onAnchorPositionChange"
|
|
1068
|
+
}, {
|
|
1069
|
+
"propName": "isOpen",
|
|
1070
|
+
"methodName": "onIsOpenChange"
|
|
1071
|
+
}, {
|
|
1072
|
+
"propName": "target",
|
|
1073
|
+
"methodName": "onTargetChange"
|
|
1074
|
+
}];
|
|
1075
|
+
}
|
|
1076
|
+
static get listeners() {
|
|
1077
|
+
return [{
|
|
1078
|
+
"name": "keydown",
|
|
1079
|
+
"method": "handleKeyDown",
|
|
1080
|
+
"target": "document",
|
|
1081
|
+
"capture": false,
|
|
1082
|
+
"passive": false
|
|
1083
|
+
}];
|
|
1084
|
+
}
|
|
1085
|
+
}
|