@fabric-msft/fabric-web 7.2.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dts/components/accordion/accordion.definition.d.ts.map +1 -1
- package/dts/components/accordion/accordion.styles.d.ts +2 -0
- package/dts/components/accordion/accordion.styles.d.ts.map +1 -0
- package/dts/components/accordion-item/accordion-item.definition.d.ts.map +1 -1
- package/dts/components/accordion-item/accordion-item.styles.d.ts +2 -0
- package/dts/components/accordion-item/accordion-item.styles.d.ts.map +1 -0
- package/dts/components/accordion-menu/accordion-menu.styles.d.ts.map +1 -1
- package/dts/components/accordion-menu-panel/accordion-menu-panel.styles.d.ts.map +1 -1
- package/dts/components/anchor-button/anchor-button.definition.d.ts.map +1 -1
- package/dts/components/anchor-button/anchor-button.styles.d.ts +2 -0
- package/dts/components/anchor-button/anchor-button.styles.d.ts.map +1 -0
- package/dts/components/avatar/avatar.definition.d.ts.map +1 -1
- package/dts/components/avatar/avatar.styles.d.ts +2 -0
- package/dts/components/avatar/avatar.styles.d.ts.map +1 -0
- package/dts/components/badge/badge.definition.d.ts.map +1 -1
- package/dts/components/badge/badge.styles.d.ts +2 -0
- package/dts/components/badge/badge.styles.d.ts.map +1 -0
- package/dts/components/button/button.styles.d.ts.map +1 -1
- package/dts/components/card/card.styles.d.ts.map +1 -1
- package/dts/components/card-carousel/card-carousel.styles.d.ts.map +1 -1
- package/dts/components/card-footer/card-footer.styles.d.ts.map +1 -1
- package/dts/components/card-header/card-header.styles.d.ts.map +1 -1
- package/dts/components/card-preview/card-preview.styles.d.ts.map +1 -1
- package/dts/components/carousel/carousel.d.ts +6 -42
- package/dts/components/carousel/carousel.d.ts.map +1 -1
- package/dts/components/carousel/carousel.definition.d.ts +15 -0
- package/dts/components/carousel/carousel.definition.d.ts.map +1 -1
- package/dts/components/carousel/carousel.styles.d.ts.map +1 -1
- package/dts/components/carousel/carousel.template.d.ts.map +1 -1
- package/dts/components/carousel/define.d.ts +1 -15
- package/dts/components/carousel/define.d.ts.map +1 -1
- package/dts/components/carousel/index.d.ts +1 -2
- package/dts/components/carousel/index.d.ts.map +1 -1
- package/dts/components/carousel-item/carousel-item.styles.d.ts.map +1 -1
- package/dts/components/carousel-nav/carousel-nav.d.ts +10 -0
- package/dts/components/carousel-nav/carousel-nav.d.ts.map +1 -1
- package/dts/components/carousel-nav/carousel-nav.styles.d.ts.map +1 -1
- package/dts/components/carousel-nav/carousel-nav.template.d.ts.map +1 -1
- package/dts/components/carousel-nav-item/carousel-nav-item.styles.d.ts.map +1 -1
- package/dts/components/carousel-viewport/carousel-viewport.d.ts +34 -0
- package/dts/components/carousel-viewport/carousel-viewport.d.ts.map +1 -0
- package/dts/components/carousel-viewport/carousel-viewport.definition.d.ts +9 -0
- package/dts/components/carousel-viewport/carousel-viewport.definition.d.ts.map +1 -0
- package/dts/components/carousel-viewport/carousel-viewport.styles.d.ts +7 -0
- package/dts/components/carousel-viewport/carousel-viewport.styles.d.ts.map +1 -0
- package/dts/components/carousel-viewport/carousel-viewport.template.d.ts +9 -0
- package/dts/components/carousel-viewport/carousel-viewport.template.d.ts.map +1 -0
- package/dts/components/carousel-viewport/define.d.ts +2 -0
- package/dts/components/carousel-viewport/define.d.ts.map +1 -0
- package/dts/components/carousel-viewport/index.d.ts +5 -0
- package/dts/components/carousel-viewport/index.d.ts.map +1 -0
- package/dts/components/checkbox/checkbox.definition.d.ts.map +1 -1
- package/dts/components/checkbox/checkbox.styles.d.ts +2 -0
- package/dts/components/checkbox/checkbox.styles.d.ts.map +1 -0
- package/dts/components/compound-button/compound-button.styles.d.ts.map +1 -1
- package/dts/components/counter-badge/counter-badge.definition.d.ts.map +1 -1
- package/dts/components/counter-badge/counter-badge.styles.d.ts +2 -0
- package/dts/components/counter-badge/counter-badge.styles.d.ts.map +1 -0
- package/dts/components/dialog/dialog.styles.d.ts.map +1 -1
- package/dts/components/dialog-body/dialog-body.definition.d.ts +1 -1
- package/dts/components/dialog-body/dialog-body.definition.d.ts.map +1 -1
- package/dts/components/dialog-body/dialog-body.styles.d.ts +2 -0
- package/dts/components/dialog-body/dialog-body.styles.d.ts.map +1 -0
- package/dts/components/divider/divider.styles.d.ts.map +1 -1
- package/dts/components/drawer/drawer.definition.d.ts.map +1 -1
- package/dts/components/drawer/drawer.styles.d.ts +2 -0
- package/dts/components/drawer/drawer.styles.d.ts.map +1 -0
- package/dts/components/drawer-body/drawer-body.definition.d.ts.map +1 -1
- package/dts/components/drawer-body/drawer-body.styles.d.ts +2 -0
- package/dts/components/drawer-body/drawer-body.styles.d.ts.map +1 -0
- package/dts/components/dropdown/dropdown.styles.d.ts.map +1 -1
- package/dts/components/dynamic-tab/define.d.ts +2 -0
- package/dts/components/dynamic-tab/define.d.ts.map +1 -0
- package/dts/components/dynamic-tab/dynamic-tab.d.ts +142 -0
- package/dts/components/dynamic-tab/dynamic-tab.d.ts.map +1 -0
- package/dts/components/dynamic-tab/dynamic-tab.definition.d.ts +10 -0
- package/dts/components/dynamic-tab/dynamic-tab.definition.d.ts.map +1 -0
- package/dts/components/dynamic-tab/dynamic-tab.options.d.ts +10 -0
- package/dts/components/dynamic-tab/dynamic-tab.options.d.ts.map +1 -0
- package/dts/components/dynamic-tab/dynamic-tab.styles.d.ts +6 -0
- package/dts/components/dynamic-tab/dynamic-tab.styles.d.ts.map +1 -0
- package/dts/components/dynamic-tab/dynamic-tab.template.d.ts +13 -0
- package/dts/components/dynamic-tab/dynamic-tab.template.d.ts.map +1 -0
- package/dts/components/dynamic-tab/index.d.ts +6 -0
- package/dts/components/dynamic-tab/index.d.ts.map +1 -0
- package/dts/components/dynamic-tab-list/define.d.ts +2 -0
- package/dts/components/dynamic-tab-list/define.d.ts.map +1 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.d.ts +360 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.d.ts.map +1 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.definition.d.ts +7 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.definition.d.ts.map +1 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.options.d.ts +24 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.options.d.ts.map +1 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.styles.d.ts +6 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.styles.d.ts.map +1 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.template.d.ts +13 -0
- package/dts/components/dynamic-tab-list/dynamic-tab-list.template.d.ts.map +1 -0
- package/dts/components/dynamic-tab-list/index.d.ts +7 -0
- package/dts/components/dynamic-tab-list/index.d.ts.map +1 -0
- package/dts/components/empty-state/define.d.ts +2 -0
- package/dts/components/empty-state/define.d.ts.map +1 -0
- package/dts/components/empty-state/empty-state.d.ts +32 -0
- package/dts/components/empty-state/empty-state.d.ts.map +1 -0
- package/dts/components/empty-state/empty-state.definition.d.ts +10 -0
- package/dts/components/empty-state/empty-state.definition.d.ts.map +1 -0
- package/dts/components/empty-state/empty-state.styles.d.ts +6 -0
- package/dts/components/empty-state/empty-state.styles.d.ts.map +1 -0
- package/dts/components/empty-state/empty-state.template.d.ts +9 -0
- package/dts/components/empty-state/empty-state.template.d.ts.map +1 -0
- package/dts/components/empty-state/index.d.ts +5 -0
- package/dts/components/empty-state/index.d.ts.map +1 -0
- package/dts/components/field/field.styles.d.ts.map +1 -1
- package/dts/components/filter-pill/filter-pill.styles.d.ts.map +1 -1
- package/dts/components/image/image.definition.d.ts.map +1 -1
- package/dts/components/image/image.styles.d.ts +2 -0
- package/dts/components/image/image.styles.d.ts.map +1 -0
- package/dts/components/label/label.definition.d.ts.map +1 -1
- package/dts/components/label/label.styles.d.ts +2 -0
- package/dts/components/label/label.styles.d.ts.map +1 -0
- package/dts/components/link/link.styles.d.ts +2 -0
- package/dts/components/link/link.styles.d.ts.map +1 -0
- package/dts/components/listbox/listbox.styles.d.ts.map +1 -1
- package/dts/components/loading-button/loading-button.styles.d.ts.map +1 -1
- package/dts/components/menu/menu.styles.d.ts.map +1 -1
- package/dts/components/menu-button/menu-button.d.ts +2 -2
- package/dts/components/menu-button/menu-button.definition.d.ts.map +1 -1
- package/dts/components/menu-button/menu-button.styles.d.ts +11 -0
- package/dts/components/menu-button/menu-button.styles.d.ts.map +1 -0
- package/dts/components/menu-item/menu-item.styles.d.ts.map +1 -1
- package/dts/components/menu-list/menu-list.d.ts.map +1 -1
- package/dts/components/menu-list/menu-list.styles.d.ts.map +1 -1
- package/dts/components/message-bar/message-bar.definition.d.ts.map +1 -1
- package/dts/components/message-bar/message-bar.styles.d.ts +2 -0
- package/dts/components/message-bar/message-bar.styles.d.ts.map +1 -0
- package/dts/components/modal/define.d.ts +4 -0
- package/dts/components/modal/define.d.ts.map +1 -0
- package/dts/components/modal/index.d.ts +9 -0
- package/dts/components/modal/index.d.ts.map +1 -0
- package/dts/components/modal/modal.d.ts +209 -0
- package/dts/components/modal/modal.d.ts.map +1 -0
- package/dts/components/modal/modal.definition.d.ts +9 -0
- package/dts/components/modal/modal.definition.d.ts.map +1 -0
- package/dts/components/modal/modal.events.d.ts +26 -0
- package/dts/components/modal/modal.events.d.ts.map +1 -0
- package/dts/components/modal/modal.options.d.ts +15 -0
- package/dts/components/modal/modal.options.d.ts.map +1 -0
- package/dts/components/modal/modal.styles.d.ts +10 -0
- package/dts/components/modal/modal.styles.d.ts.map +1 -0
- package/dts/components/modal/modal.template.d.ts +12 -0
- package/dts/components/modal/modal.template.d.ts.map +1 -0
- package/dts/components/modal-fre-item/define.d.ts +2 -0
- package/dts/components/modal-fre-item/define.d.ts.map +1 -0
- package/dts/components/modal-fre-item/index.d.ts +3 -0
- package/dts/components/modal-fre-item/index.d.ts.map +1 -0
- package/dts/components/modal-fre-item/modal-fre-item.d.ts +65 -0
- package/dts/components/modal-fre-item/modal-fre-item.d.ts.map +1 -0
- package/dts/components/modal-fre-item/modal-fre-item.definition.d.ts +10 -0
- package/dts/components/modal-fre-item/modal-fre-item.definition.d.ts.map +1 -0
- package/dts/components/modal-fre-item/modal-fre-item.styles.d.ts +7 -0
- package/dts/components/modal-fre-item/modal-fre-item.styles.d.ts.map +1 -0
- package/dts/components/modal-fre-item/modal-fre-item.template.d.ts +11 -0
- package/dts/components/modal-fre-item/modal-fre-item.template.d.ts.map +1 -0
- package/dts/components/multi-view/multi-view.styles.d.ts.map +1 -1
- package/dts/components/multi-view-controller/multi-view-controller.styles.d.ts.map +1 -1
- package/dts/components/multi-view-group/multi-view-group.styles.d.ts.map +1 -1
- package/dts/components/option/option.definition.d.ts.map +1 -1
- package/dts/components/option/option.styles.d.ts +2 -0
- package/dts/components/option/option.styles.d.ts.map +1 -0
- package/dts/components/option-group/option-group.styles.d.ts.map +1 -1
- package/dts/components/overflow/overflow.styles.d.ts.map +1 -1
- package/dts/components/overflow-divider/overflow-divider.styles.d.ts.map +1 -1
- package/dts/components/overflow-item/overflow-item.styles.d.ts.map +1 -1
- package/dts/components/pagination/pagination.styles.d.ts.map +1 -1
- package/dts/components/popover/popover.styles.d.ts.map +1 -1
- package/dts/components/progress-bar/progress-bar.definition.d.ts.map +1 -1
- package/dts/components/progress-bar/progress-bar.styles.d.ts +2 -0
- package/dts/components/progress-bar/progress-bar.styles.d.ts.map +1 -0
- package/dts/components/radio/radio.definition.d.ts.map +1 -1
- package/dts/components/radio/radio.styles.d.ts +2 -0
- package/dts/components/radio/radio.styles.d.ts.map +1 -0
- package/dts/components/radio-group/radio-group.definition.d.ts.map +1 -1
- package/dts/components/radio-group/radio-group.styles.d.ts +2 -0
- package/dts/components/radio-group/radio-group.styles.d.ts.map +1 -0
- package/dts/components/rating-display/rating-display.definition.d.ts.map +1 -1
- package/dts/components/rating-display/rating-display.styles.d.ts +2 -0
- package/dts/components/rating-display/rating-display.styles.d.ts.map +1 -0
- package/dts/components/search-box/search-box.styles.d.ts.map +1 -1
- package/dts/components/simple-table/simple-table.styles.d.ts.map +1 -1
- package/dts/components/slider/slider.styles.d.ts.map +1 -1
- package/dts/components/spin-button/spin-button.styles.d.ts.map +1 -1
- package/dts/components/spinner/spinner.definition.d.ts.map +1 -1
- package/dts/components/spinner/spinner.styles.d.ts +2 -0
- package/dts/components/spinner/spinner.styles.d.ts.map +1 -0
- package/dts/components/styles/patterns/patterns.d.ts +8 -0
- package/dts/components/styles/patterns/patterns.d.ts.map +1 -0
- package/dts/components/svg-icon/svg-icon.styles.d.ts.map +1 -1
- package/dts/components/switch/switch.definition.d.ts.map +1 -1
- package/dts/components/switch/switch.styles.d.ts +2 -0
- package/dts/components/switch/switch.styles.d.ts.map +1 -0
- package/dts/components/tab/tab.definition.d.ts.map +1 -1
- package/dts/components/tab/tab.styles.d.ts +2 -0
- package/dts/components/tab/tab.styles.d.ts.map +1 -0
- package/dts/components/table/table.styles.d.ts.map +1 -1
- package/dts/components/table-cell/table-cell.styles.d.ts.map +1 -1
- package/dts/components/tablist/tablist.definition.d.ts.map +1 -1
- package/dts/components/tablist/tablist.styles.d.ts +2 -0
- package/dts/components/tablist/tablist.styles.d.ts.map +1 -0
- package/dts/components/tag/tag.styles.d.ts.map +1 -1
- package/dts/components/teaching-bubble/teaching-bubble.styles.d.ts.map +1 -1
- package/dts/components/text/text.definition.d.ts.map +1 -1
- package/dts/components/text/text.styles.d.ts +2 -0
- package/dts/components/text/text.styles.d.ts.map +1 -0
- package/dts/components/text-input/text-input.styles.d.ts.map +1 -1
- package/dts/components/textarea/textarea.definition.d.ts +1 -1
- package/dts/components/textarea/textarea.definition.d.ts.map +1 -1
- package/dts/components/textarea/textarea.styles.d.ts +2 -0
- package/dts/components/textarea/textarea.styles.d.ts.map +1 -0
- package/dts/components/toggle-button/toggle-button.definition.d.ts.map +1 -1
- package/dts/components/toggle-button/toggle-button.styles.d.ts +2 -0
- package/dts/components/toggle-button/toggle-button.styles.d.ts.map +1 -0
- package/dts/components/tooltip/tooltip.definition.d.ts.map +1 -1
- package/dts/components/tooltip/tooltip.styles.d.ts +2 -0
- package/dts/components/tooltip/tooltip.styles.d.ts.map +1 -0
- package/dts/components/tree/tree.definition.d.ts +1 -1
- package/dts/components/tree/tree.definition.d.ts.map +1 -1
- package/dts/components/tree/tree.styles.d.ts +2 -0
- package/dts/components/tree/tree.styles.d.ts.map +1 -0
- package/dts/components/tree-item/tree-item.styles.d.ts.map +1 -1
- package/dts/components/wizard/wizard.styles.d.ts.map +1 -1
- package/dts/components/wizard-panel/wizard-panel.styles.d.ts.map +1 -1
- package/dts/components/wizard-step/wizard-step.styles.d.ts.map +1 -1
- package/dts/index.d.ts +7 -0
- package/dts/index.d.ts.map +1 -1
- package/dts/util/a11y-playwright-utils.d.ts +10 -0
- package/dts/util/a11y-playwright-utils.d.ts.map +1 -0
- package/dts/util/carousel-controller.d.ts +120 -0
- package/dts/util/carousel-controller.d.ts.map +1 -0
- package/dts/util/icons.d.ts +15 -0
- package/dts/util/icons.d.ts.map +1 -1
- package/dts/util/index.d.ts +1 -0
- package/dts/util/index.d.ts.map +1 -1
- package/esm/components/accordion/accordion.definition.js +3 -2
- package/esm/components/accordion/accordion.definition.js.map +1 -1
- package/esm/components/accordion/accordion.styles.js +10 -0
- package/esm/components/accordion/accordion.styles.js.map +1 -0
- package/esm/components/accordion-item/accordion-item.definition.js +3 -2
- package/esm/components/accordion-item/accordion-item.definition.js.map +1 -1
- package/esm/components/accordion-item/accordion-item.styles.js +10 -0
- package/esm/components/accordion-item/accordion-item.styles.js.map +1 -0
- package/esm/components/accordion-menu/accordion-menu.styles.js +1 -1
- package/esm/components/accordion-menu/accordion-menu.styles.js.map +1 -1
- package/esm/components/accordion-menu-panel/accordion-menu-panel.styles.js +2 -2
- package/esm/components/accordion-menu-panel/accordion-menu-panel.styles.js.map +1 -1
- package/esm/components/anchor-button/anchor-button.definition.js +3 -2
- package/esm/components/anchor-button/anchor-button.definition.js.map +1 -1
- package/esm/components/anchor-button/anchor-button.styles.js +10 -0
- package/esm/components/anchor-button/anchor-button.styles.js.map +1 -0
- package/esm/components/avatar/avatar.definition.js +3 -2
- package/esm/components/avatar/avatar.definition.js.map +1 -1
- package/esm/components/avatar/avatar.styles.js +10 -0
- package/esm/components/avatar/avatar.styles.js.map +1 -0
- package/esm/components/badge/badge.definition.js +3 -2
- package/esm/components/badge/badge.definition.js.map +1 -1
- package/esm/components/badge/badge.styles.js +10 -0
- package/esm/components/badge/badge.styles.js.map +1 -0
- package/esm/components/button/button.styles.js +3 -1
- package/esm/components/button/button.styles.js.map +1 -1
- package/esm/components/card/card.styles.js +1 -1
- package/esm/components/card/card.styles.js.map +1 -1
- package/esm/components/card-carousel/card-carousel.styles.js +1 -1
- package/esm/components/card-carousel/card-carousel.styles.js.map +1 -1
- package/esm/components/card-footer/card-footer.styles.js +1 -1
- package/esm/components/card-footer/card-footer.styles.js.map +1 -1
- package/esm/components/card-header/card-header.styles.js +1 -1
- package/esm/components/card-header/card-header.styles.js.map +1 -1
- package/esm/components/card-preview/card-preview.styles.js +1 -1
- package/esm/components/card-preview/card-preview.styles.js.map +1 -1
- package/esm/components/carousel/carousel.definition.js +25 -2
- package/esm/components/carousel/carousel.definition.js.map +1 -1
- package/esm/components/carousel/carousel.js +30 -98
- package/esm/components/carousel/carousel.js.map +1 -1
- package/esm/components/carousel/carousel.styles.js +2 -2
- package/esm/components/carousel/carousel.styles.js.map +1 -1
- package/esm/components/carousel/carousel.template.js +3 -3
- package/esm/components/carousel/carousel.template.js.map +1 -1
- package/esm/components/carousel/define.js +3 -26
- package/esm/components/carousel/define.js.map +1 -1
- package/esm/components/carousel/index.js +1 -2
- package/esm/components/carousel/index.js.map +1 -1
- package/esm/components/carousel-item/carousel-item.styles.js +1 -1
- package/esm/components/carousel-item/carousel-item.styles.js.map +1 -1
- package/esm/components/carousel-item/carousel-item.template.js +1 -1
- package/esm/components/carousel-item/carousel-item.template.js.map +1 -1
- package/esm/components/carousel-nav/carousel-nav.js +12 -0
- package/esm/components/carousel-nav/carousel-nav.js.map +1 -1
- package/esm/components/carousel-nav/carousel-nav.styles.js +2 -1
- package/esm/components/carousel-nav/carousel-nav.styles.js.map +1 -1
- package/esm/components/carousel-nav/carousel-nav.template.js +4 -3
- package/esm/components/carousel-nav/carousel-nav.template.js.map +1 -1
- package/esm/components/carousel-nav-item/carousel-nav-item.styles.js +2 -1
- package/esm/components/carousel-nav-item/carousel-nav-item.styles.js.map +1 -1
- package/esm/components/carousel-viewport/carousel-viewport.definition.js +21 -0
- package/esm/components/carousel-viewport/carousel-viewport.definition.js.map +1 -0
- package/esm/components/carousel-viewport/carousel-viewport.js +37 -0
- package/esm/components/carousel-viewport/carousel-viewport.js.map +1 -0
- package/esm/components/carousel-viewport/carousel-viewport.styles.js +11 -0
- package/esm/components/carousel-viewport/carousel-viewport.styles.js.map +1 -0
- package/esm/components/carousel-viewport/carousel-viewport.template.js +15 -0
- package/esm/components/carousel-viewport/carousel-viewport.template.js.map +1 -0
- package/esm/components/carousel-viewport/define.js +4 -0
- package/esm/components/carousel-viewport/define.js.map +1 -0
- package/esm/components/carousel-viewport/index.js +5 -0
- package/esm/components/carousel-viewport/index.js.map +1 -0
- package/esm/components/checkbox/checkbox.definition.js +3 -2
- package/esm/components/checkbox/checkbox.definition.js.map +1 -1
- package/esm/components/checkbox/checkbox.styles.js +10 -0
- package/esm/components/checkbox/checkbox.styles.js.map +1 -0
- package/esm/components/compound-button/compound-button.styles.js +2 -1
- package/esm/components/compound-button/compound-button.styles.js.map +1 -1
- package/esm/components/counter-badge/counter-badge.definition.js +3 -2
- package/esm/components/counter-badge/counter-badge.definition.js.map +1 -1
- package/esm/components/counter-badge/counter-badge.styles.js +10 -0
- package/esm/components/counter-badge/counter-badge.styles.js.map +1 -0
- package/esm/components/dialog/dialog.styles.js +2 -1
- package/esm/components/dialog/dialog.styles.js.map +1 -1
- package/esm/components/dialog-body/dialog-body.definition.js +3 -2
- package/esm/components/dialog-body/dialog-body.definition.js.map +1 -1
- package/esm/components/dialog-body/dialog-body.styles.js +9 -0
- package/esm/components/dialog-body/dialog-body.styles.js.map +1 -0
- package/esm/components/divider/divider.styles.js +2 -1
- package/esm/components/divider/divider.styles.js.map +1 -1
- package/esm/components/drawer/drawer.definition.js +3 -2
- package/esm/components/drawer/drawer.definition.js.map +1 -1
- package/esm/components/drawer/drawer.styles.js +9 -0
- package/esm/components/drawer/drawer.styles.js.map +1 -0
- package/esm/components/drawer-body/drawer-body.definition.js +3 -2
- package/esm/components/drawer-body/drawer-body.definition.js.map +1 -1
- package/esm/components/drawer-body/drawer-body.styles.js +9 -0
- package/esm/components/drawer-body/drawer-body.styles.js.map +1 -0
- package/esm/components/dropdown/dropdown.styles.js +1 -1
- package/esm/components/dropdown/dropdown.styles.js.map +1 -1
- package/esm/components/dynamic-tab/define.js +4 -0
- package/esm/components/dynamic-tab/define.js.map +1 -0
- package/esm/components/dynamic-tab/dynamic-tab.definition.js +27 -0
- package/esm/components/dynamic-tab/dynamic-tab.definition.js.map +1 -0
- package/esm/components/dynamic-tab/dynamic-tab.js +232 -0
- package/esm/components/dynamic-tab/dynamic-tab.js.map +1 -0
- package/esm/components/dynamic-tab/dynamic-tab.options.js +11 -0
- package/esm/components/dynamic-tab/dynamic-tab.options.js.map +1 -0
- package/esm/components/dynamic-tab/dynamic-tab.styles.js +13 -0
- package/esm/components/dynamic-tab/dynamic-tab.styles.js.map +1 -0
- package/esm/components/dynamic-tab/dynamic-tab.template.js +18 -0
- package/esm/components/dynamic-tab/dynamic-tab.template.js.map +1 -0
- package/esm/components/dynamic-tab/index.js +6 -0
- package/esm/components/dynamic-tab/index.js.map +1 -0
- package/esm/components/dynamic-tab-list/define.js +12 -0
- package/esm/components/dynamic-tab-list/define.js.map +1 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.definition.js +19 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.definition.js.map +1 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.js +788 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.js.map +1 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.options.js +19 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.options.js.map +1 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.styles.js +11 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.styles.js.map +1 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.template.js +41 -0
- package/esm/components/dynamic-tab-list/dynamic-tab-list.template.js.map +1 -0
- package/esm/components/dynamic-tab-list/index.js +6 -0
- package/esm/components/dynamic-tab-list/index.js.map +1 -0
- package/esm/components/empty-state/define.js +4 -0
- package/esm/components/empty-state/define.js.map +1 -0
- package/esm/components/empty-state/empty-state.definition.js +22 -0
- package/esm/components/empty-state/empty-state.definition.js.map +1 -0
- package/esm/components/empty-state/empty-state.js +33 -0
- package/esm/components/empty-state/empty-state.js.map +1 -0
- package/esm/components/empty-state/empty-state.styles.js +11 -0
- package/esm/components/empty-state/empty-state.styles.js.map +1 -0
- package/esm/components/empty-state/empty-state.template.js +12 -0
- package/esm/components/empty-state/empty-state.template.js.map +1 -0
- package/esm/components/empty-state/index.js +5 -0
- package/esm/components/empty-state/index.js.map +1 -0
- package/esm/components/field/field.styles.js +2 -1
- package/esm/components/field/field.styles.js.map +1 -1
- package/esm/components/filter-pill/filter-pill.styles.js +2 -1
- package/esm/components/filter-pill/filter-pill.styles.js.map +1 -1
- package/esm/components/image/image.definition.js +3 -2
- package/esm/components/image/image.definition.js.map +1 -1
- package/esm/components/image/image.styles.js +9 -0
- package/esm/components/image/image.styles.js.map +1 -0
- package/esm/components/label/label.definition.js +3 -2
- package/esm/components/label/label.definition.js.map +1 -1
- package/esm/components/label/label.styles.js +9 -0
- package/esm/components/label/label.styles.js.map +1 -0
- package/esm/components/link/link.definition.js +2 -2
- package/esm/components/link/link.definition.js.map +1 -1
- package/esm/components/link/link.styles.js +9 -0
- package/esm/components/link/link.styles.js.map +1 -0
- package/esm/components/listbox/listbox.styles.js +6 -1
- package/esm/components/listbox/listbox.styles.js.map +1 -1
- package/esm/components/loading-button/loading-button.styles.js +3 -1
- package/esm/components/loading-button/loading-button.styles.js.map +1 -1
- package/esm/components/menu/menu.styles.js +1 -1
- package/esm/components/menu/menu.styles.js.map +1 -1
- package/esm/components/menu-button/menu-button.definition.js +5 -2
- package/esm/components/menu-button/menu-button.definition.js.map +1 -1
- package/esm/components/menu-button/menu-button.js +2 -2
- package/esm/components/menu-button/menu-button.styles.js +18 -0
- package/esm/components/menu-button/menu-button.styles.js.map +1 -0
- package/esm/components/menu-item/menu-item.styles.js +4 -4
- package/esm/components/menu-item/menu-item.styles.js.map +1 -1
- package/esm/components/menu-list/menu-list.js +3 -3
- package/esm/components/menu-list/menu-list.js.map +1 -1
- package/esm/components/menu-list/menu-list.styles.js +2 -2
- package/esm/components/menu-list/menu-list.styles.js.map +1 -1
- package/esm/components/menu-list/menu-list.template.js +1 -1
- package/esm/components/menu-list/menu-list.template.js.map +1 -1
- package/esm/components/message-bar/message-bar.definition.js +3 -2
- package/esm/components/message-bar/message-bar.definition.js.map +1 -1
- package/esm/components/message-bar/message-bar.styles.js +9 -0
- package/esm/components/message-bar/message-bar.styles.js.map +1 -0
- package/esm/components/modal/define.js +9 -0
- package/esm/components/modal/define.js.map +1 -0
- package/esm/components/modal/index.js +7 -0
- package/esm/components/modal/index.js.map +1 -0
- package/esm/components/modal/modal.definition.js +29 -0
- package/esm/components/modal/modal.definition.js.map +1 -0
- package/esm/components/modal/modal.events.js +11 -0
- package/esm/components/modal/modal.events.js.map +1 -0
- package/esm/components/modal/modal.js +369 -0
- package/esm/components/modal/modal.js.map +1 -0
- package/esm/components/modal/modal.options.js +10 -0
- package/esm/components/modal/modal.options.js.map +1 -0
- package/esm/components/modal/modal.styles.js +14 -0
- package/esm/components/modal/modal.styles.js.map +1 -0
- package/esm/components/modal/modal.template.js +23 -0
- package/esm/components/modal/modal.template.js.map +1 -0
- package/esm/components/modal-fre-item/define.js +4 -0
- package/esm/components/modal-fre-item/define.js.map +1 -0
- package/esm/components/modal-fre-item/index.js +3 -0
- package/esm/components/modal-fre-item/index.js.map +1 -0
- package/esm/components/modal-fre-item/modal-fre-item.definition.js +27 -0
- package/esm/components/modal-fre-item/modal-fre-item.definition.js.map +1 -0
- package/esm/components/modal-fre-item/modal-fre-item.js +72 -0
- package/esm/components/modal-fre-item/modal-fre-item.js.map +1 -0
- package/esm/components/modal-fre-item/modal-fre-item.styles.js +11 -0
- package/esm/components/modal-fre-item/modal-fre-item.styles.js.map +1 -0
- package/esm/components/modal-fre-item/modal-fre-item.template.js +16 -0
- package/esm/components/modal-fre-item/modal-fre-item.template.js.map +1 -0
- package/esm/components/multi-view/multi-view.styles.js +1 -1
- package/esm/components/multi-view/multi-view.styles.js.map +1 -1
- package/esm/components/multi-view-controller/multi-view-controller.styles.js +1 -1
- package/esm/components/multi-view-controller/multi-view-controller.styles.js.map +1 -1
- package/esm/components/multi-view-group/multi-view-group.styles.js +1 -1
- package/esm/components/multi-view-group/multi-view-group.styles.js.map +1 -1
- package/esm/components/option/option.definition.js +3 -2
- package/esm/components/option/option.definition.js.map +1 -1
- package/esm/components/option/option.styles.js +9 -0
- package/esm/components/option/option.styles.js.map +1 -0
- package/esm/components/option-group/option-group.styles.js +1 -1
- package/esm/components/option-group/option-group.styles.js.map +1 -1
- package/esm/components/overflow/overflow.styles.js +1 -1
- package/esm/components/overflow/overflow.styles.js.map +1 -1
- package/esm/components/overflow-divider/overflow-divider.styles.js +1 -1
- package/esm/components/overflow-divider/overflow-divider.styles.js.map +1 -1
- package/esm/components/overflow-item/overflow-item.styles.js +1 -1
- package/esm/components/overflow-item/overflow-item.styles.js.map +1 -1
- package/esm/components/pagination/pagination.styles.js +1 -1
- package/esm/components/pagination/pagination.styles.js.map +1 -1
- package/esm/components/popover/popover.styles.js +1 -1
- package/esm/components/popover/popover.styles.js.map +1 -1
- package/esm/components/progress-bar/progress-bar.definition.js +3 -2
- package/esm/components/progress-bar/progress-bar.definition.js.map +1 -1
- package/esm/components/progress-bar/progress-bar.styles.js +9 -0
- package/esm/components/progress-bar/progress-bar.styles.js.map +1 -0
- package/esm/components/radio/radio.definition.js +3 -2
- package/esm/components/radio/radio.definition.js.map +1 -1
- package/esm/components/radio/radio.styles.js +9 -0
- package/esm/components/radio/radio.styles.js.map +1 -0
- package/esm/components/radio-group/radio-group.definition.js +3 -2
- package/esm/components/radio-group/radio-group.definition.js.map +1 -1
- package/esm/components/radio-group/radio-group.styles.js +9 -0
- package/esm/components/radio-group/radio-group.styles.js.map +1 -0
- package/esm/components/rating-display/rating-display.definition.js +3 -2
- package/esm/components/rating-display/rating-display.definition.js.map +1 -1
- package/esm/components/rating-display/rating-display.styles.js +9 -0
- package/esm/components/rating-display/rating-display.styles.js.map +1 -0
- package/esm/components/search-box/search-box.styles.js +1 -1
- package/esm/components/search-box/search-box.styles.js.map +1 -1
- package/esm/components/simple-table/simple-table.styles.js +2 -1
- package/esm/components/simple-table/simple-table.styles.js.map +1 -1
- package/esm/components/slider/slider.styles.js +1 -1
- package/esm/components/slider/slider.styles.js.map +1 -1
- package/esm/components/spin-button/spin-button.styles.js +1 -1
- package/esm/components/spin-button/spin-button.styles.js.map +1 -1
- package/esm/components/spinner/spinner.definition.js +3 -2
- package/esm/components/spinner/spinner.definition.js.map +1 -1
- package/esm/components/spinner/spinner.styles.js +9 -0
- package/esm/components/spinner/spinner.styles.js.map +1 -0
- package/esm/components/styles/patterns/patterns.js +11 -0
- package/esm/components/styles/patterns/patterns.js.map +1 -0
- package/esm/components/svg-icon/svg-icon.styles.js +1 -1
- package/esm/components/svg-icon/svg-icon.styles.js.map +1 -1
- package/esm/components/switch/switch.definition.js +3 -2
- package/esm/components/switch/switch.definition.js.map +1 -1
- package/esm/components/switch/switch.styles.js +9 -0
- package/esm/components/switch/switch.styles.js.map +1 -0
- package/esm/components/tab/tab.definition.js +3 -2
- package/esm/components/tab/tab.definition.js.map +1 -1
- package/esm/components/tab/tab.styles.js +9 -0
- package/esm/components/tab/tab.styles.js.map +1 -0
- package/esm/components/table/table.styles.js +1 -1
- package/esm/components/table/table.styles.js.map +1 -1
- package/esm/components/table-cell/table-cell.styles.js +1 -1
- package/esm/components/table-cell/table-cell.styles.js.map +1 -1
- package/esm/components/tablist/tablist.definition.js +3 -2
- package/esm/components/tablist/tablist.definition.js.map +1 -1
- package/esm/components/tablist/tablist.styles.js +9 -0
- package/esm/components/tablist/tablist.styles.js.map +1 -0
- package/esm/components/tag/tag.styles.js +1 -1
- package/esm/components/tag/tag.styles.js.map +1 -1
- package/esm/components/teaching-bubble/teaching-bubble.styles.js +1 -1
- package/esm/components/teaching-bubble/teaching-bubble.styles.js.map +1 -1
- package/esm/components/text/text.definition.js +4 -3
- package/esm/components/text/text.definition.js.map +1 -1
- package/esm/components/text/text.styles.js +9 -0
- package/esm/components/text/text.styles.js.map +1 -0
- package/esm/components/text-input/text-input.styles.js +1 -1
- package/esm/components/text-input/text-input.styles.js.map +1 -1
- package/esm/components/textarea/textarea.definition.js +3 -2
- package/esm/components/textarea/textarea.definition.js.map +1 -1
- package/esm/components/textarea/textarea.styles.js +9 -0
- package/esm/components/textarea/textarea.styles.js.map +1 -0
- package/esm/components/toggle-button/toggle-button.definition.js +3 -2
- package/esm/components/toggle-button/toggle-button.definition.js.map +1 -1
- package/esm/components/toggle-button/toggle-button.styles.js +9 -0
- package/esm/components/toggle-button/toggle-button.styles.js.map +1 -0
- package/esm/components/tooltip/tooltip.definition.js +3 -2
- package/esm/components/tooltip/tooltip.definition.js.map +1 -1
- package/esm/components/tooltip/tooltip.styles.js +9 -0
- package/esm/components/tooltip/tooltip.styles.js.map +1 -0
- package/esm/components/tree/tree.definition.js +4 -3
- package/esm/components/tree/tree.definition.js.map +1 -1
- package/esm/components/tree/tree.styles.js +9 -0
- package/esm/components/tree/tree.styles.js.map +1 -0
- package/esm/components/tree-item/tree-item.styles.js +1 -1
- package/esm/components/tree-item/tree-item.styles.js.map +1 -1
- package/esm/components/wizard/wizard.styles.js +1 -1
- package/esm/components/wizard/wizard.styles.js.map +1 -1
- package/esm/components/wizard-panel/wizard-panel.styles.js +1 -1
- package/esm/components/wizard-panel/wizard-panel.styles.js.map +1 -1
- package/esm/components/wizard-step/wizard-step.styles.js +1 -1
- package/esm/components/wizard-step/wizard-step.styles.js.map +1 -1
- package/esm/index.js +26 -2
- package/esm/index.js.map +1 -1
- package/esm/util/a11y-playwright-utils.js +93 -0
- package/esm/util/a11y-playwright-utils.js.map +1 -0
- package/esm/util/carousel-controller.js +153 -0
- package/esm/util/carousel-controller.js.map +1 -0
- package/esm/util/icons.js +16 -1
- package/esm/util/icons.js.map +1 -1
- package/esm/util/index.js +1 -0
- package/esm/util/index.js.map +1 -1
- package/index.d.ts +1504 -421
- package/index.d.ts.map +1 -1
- package/index.js +4522 -2432
- package/index.js.map +1 -1
- package/index.min.js +195 -93
- package/index.min.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,788 @@
|
|
|
1
|
+
import { attr, observable, FASTElement, Updates } from '@microsoft/fast-element';
|
|
2
|
+
import { createRovingFocusController } from '../../util/focus-management.js';
|
|
3
|
+
import { DynamicTabListOrientations, DynamicTabListEventNames } from './dynamic-tab-list.options.js';
|
|
4
|
+
|
|
5
|
+
var __decorate = globalThis && globalThis.__decorate || function (decorators, target, key, desc) {
|
|
6
|
+
var c = arguments.length,
|
|
7
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
8
|
+
d;
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Dynamic Tab List
|
|
14
|
+
* @summary A structural container for dynamic tabs with public methods for tab management.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* This component provides structure, emits events, and offers public helper methods
|
|
18
|
+
* for common tab operations (close, closeOthers, closeToRight, etc.).
|
|
19
|
+
* Context menus should be implemented by the consumer using the native Popover API,
|
|
20
|
+
* listening to the `context-menu` event for positioning coordinates.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```html
|
|
24
|
+
* <fabric-dynamic-tab-list activeid="tab-1" show-managed-tabs>
|
|
25
|
+
* <fabric-dynamic-tab id="tab-1" selected>Document.docx</fabric-dynamic-tab>
|
|
26
|
+
* <fabric-dynamic-tab id="tab-2">Photo.png</fabric-dynamic-tab>
|
|
27
|
+
* <button slot="actions">+</button>
|
|
28
|
+
* <button slot="manage-tabs">☰</button>
|
|
29
|
+
* </fabric-dynamic-tab-list>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @attr {string} activeid - The id of the currently active/selected tab.
|
|
33
|
+
* @attr {DynamicTabListOrientation} orientation - The layout orientation.
|
|
34
|
+
* @attr {boolean} show-managed-tabs - When true, renders built-in manage tabs menu.
|
|
35
|
+
* @attr {string} close-unmodified-label - Label for "Close unmodified tabs" menu item (i18n).
|
|
36
|
+
* @attr {string} close-all-label - Label for "Close all tabs" menu item (i18n).
|
|
37
|
+
*
|
|
38
|
+
* @slot - Container for fabric-dynamic-tab elements.
|
|
39
|
+
* @slot actions - Optional action buttons between tabs and manage-tabs button.
|
|
40
|
+
* @slot manage-tabs - Trigger button for manage tabs menu (used when show-managed-tabs is true).
|
|
41
|
+
*
|
|
42
|
+
* @csspart tabs-container - The scrollable container for tab elements.
|
|
43
|
+
* @csspart actions-container - The container for action buttons and manage-tabs.
|
|
44
|
+
*
|
|
45
|
+
* @fires tab-dismiss - Fires when a tab's dismiss button is clicked or closeTab() is called.
|
|
46
|
+
* @fires tab-select - Fires when a tab is selected.
|
|
47
|
+
* @fires context-menu - Fires when a tab is right-clicked. Detail includes { id, clientX, clientY }.
|
|
48
|
+
*
|
|
49
|
+
* @extends FASTElement
|
|
50
|
+
* @tagname fabric-dynamic-tab-list
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
class DynamicTabList extends FASTElement {
|
|
54
|
+
constructor() {
|
|
55
|
+
super(...arguments);
|
|
56
|
+
/**
|
|
57
|
+
* The layout orientation of the tab list.
|
|
58
|
+
* @public
|
|
59
|
+
* @remarks
|
|
60
|
+
* HTML Attribute: `orientation`
|
|
61
|
+
*/
|
|
62
|
+
this.orientation = DynamicTabListOrientations.horizontal;
|
|
63
|
+
/**
|
|
64
|
+
* When true, renders a built-in manage tabs menu with "Close unmodified tabs",
|
|
65
|
+
* "Close all tabs" actions, and a list of all open tabs.
|
|
66
|
+
* @public
|
|
67
|
+
* @remarks
|
|
68
|
+
* HTML Attribute: `show-managed-tabs`
|
|
69
|
+
*/
|
|
70
|
+
this.showManagedTabs = false;
|
|
71
|
+
/**
|
|
72
|
+
* Label for the "Close unmodified tabs" menu item.
|
|
73
|
+
* Override for i18n/localization.
|
|
74
|
+
* @public
|
|
75
|
+
* @remarks
|
|
76
|
+
* HTML Attribute: `close-unmodified-label`
|
|
77
|
+
*/
|
|
78
|
+
this.closeUnmodifiedLabel = "";
|
|
79
|
+
/**
|
|
80
|
+
* Label for the "Close all tabs" menu item.
|
|
81
|
+
* Override for i18n/localization.
|
|
82
|
+
* @public
|
|
83
|
+
* @remarks
|
|
84
|
+
* HTML Attribute: `close-all-label`
|
|
85
|
+
*/
|
|
86
|
+
this.closeAllLabel = "";
|
|
87
|
+
/**
|
|
88
|
+
* Label for the manage tabs button (accessibility).
|
|
89
|
+
* Override for i18n/localization.
|
|
90
|
+
* @public
|
|
91
|
+
* @remarks
|
|
92
|
+
* HTML Attribute: `manage-tabs-label`
|
|
93
|
+
*/
|
|
94
|
+
this.manageTabsLabel = "";
|
|
95
|
+
/**
|
|
96
|
+
* The slotted tab elements.
|
|
97
|
+
* Exposed as public so consumers can access the tab list for their menu rendering.
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
this.tabs = [];
|
|
101
|
+
/**
|
|
102
|
+
* The ID of the tab that triggered the context menu.
|
|
103
|
+
* Exposed as public so consumers can access it for conditional menu rendering.
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
this.contextMenuTargetId = null;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the context menu is currently open.
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
111
|
+
this.contextMenuOpen = false;
|
|
112
|
+
/**
|
|
113
|
+
* The X coordinate where the context menu was triggered.
|
|
114
|
+
* @public
|
|
115
|
+
*/
|
|
116
|
+
this.contextMenuX = 0;
|
|
117
|
+
/**
|
|
118
|
+
* The Y coordinate where the context menu was triggered.
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
this.contextMenuY = 0;
|
|
122
|
+
/**
|
|
123
|
+
* Slotted manage-tabs trigger element(s).
|
|
124
|
+
* @internal
|
|
125
|
+
*/
|
|
126
|
+
this.slottedManageTabsTrigger = [];
|
|
127
|
+
/**
|
|
128
|
+
* Whether the manage tabs menu is currently open.
|
|
129
|
+
* Used for aria-expanded on the trigger.
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
this.manageTabsMenuOpen = false;
|
|
133
|
+
/**
|
|
134
|
+
* Reference to the manage-tabs-menu popover element.
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
this.manageTabsMenuEl = null;
|
|
138
|
+
/**
|
|
139
|
+
* Roving focus controller for keyboard navigation.
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
this.focusController = null;
|
|
143
|
+
/**
|
|
144
|
+
* Flag to track if activeid change is from user gesture.
|
|
145
|
+
* Used to prevent emitting tab-select on programmatic changes.
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
this.isUserSelection = false;
|
|
149
|
+
/**
|
|
150
|
+
* Bound handler for manage tabs menu light dismiss.
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
this.handleManageTabsLightDismiss = event => {
|
|
154
|
+
var _a, _b, _c, _d;
|
|
155
|
+
if (!this.manageTabsMenuEl) return;
|
|
156
|
+
const popover = this.manageTabsMenuEl;
|
|
157
|
+
// Check if popover is open
|
|
158
|
+
if (!((_a = popover.matches) === null || _a === void 0 ? void 0 : _a.call(popover, ":popover-open"))) return;
|
|
159
|
+
// Check if click is outside the menu
|
|
160
|
+
const target = event.target;
|
|
161
|
+
const clickedInMenu = this.manageTabsMenuEl.contains(target);
|
|
162
|
+
const clickedOnTrigger = (_c = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(".manage-tabs-trigger")) === null || _c === void 0 ? void 0 : _c.contains(target);
|
|
163
|
+
if (!clickedInMenu && !clickedOnTrigger) {
|
|
164
|
+
(_d = popover.hidePopover) === null || _d === void 0 ? void 0 : _d.call(popover);
|
|
165
|
+
this.removeManageTabsMenuListeners();
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Bound handler for manage tabs menu Escape key.
|
|
170
|
+
* @internal
|
|
171
|
+
*/
|
|
172
|
+
this.handleManageTabsEscape = event => {
|
|
173
|
+
var _a, _b;
|
|
174
|
+
if (event.key === "Escape" && this.manageTabsMenuEl) {
|
|
175
|
+
const popover = this.manageTabsMenuEl;
|
|
176
|
+
if ((_a = popover.matches) === null || _a === void 0 ? void 0 : _a.call(popover, ":popover-open")) {
|
|
177
|
+
(_b = popover.hidePopover) === null || _b === void 0 ? void 0 : _b.call(popover);
|
|
178
|
+
this.removeManageTabsMenuListeners(true);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Whether the manage-tabs trigger should be interactive.
|
|
185
|
+
* True when the built-in menu is enabled or a custom trigger is slotted.
|
|
186
|
+
* @internal
|
|
187
|
+
*/
|
|
188
|
+
get hasTrigger() {
|
|
189
|
+
return this.showManagedTabs || this.slottedManageTabsTrigger.length > 0;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Lifecycle callback - initialize focus controller.
|
|
193
|
+
* @internal
|
|
194
|
+
*/
|
|
195
|
+
connectedCallback() {
|
|
196
|
+
var _a;
|
|
197
|
+
super.connectedCallback();
|
|
198
|
+
this.initializeFocusController();
|
|
199
|
+
// Get reference to manage-tabs-menu popover after DOM is ready
|
|
200
|
+
Updates.enqueue(() => {
|
|
201
|
+
var _a;
|
|
202
|
+
this.manageTabsMenuEl = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".manage-tabs-menu");
|
|
203
|
+
});
|
|
204
|
+
// Apply tabindex if tabs are already slotted
|
|
205
|
+
const tabElements = this.tabs.filter(node => node instanceof HTMLElement && node.tagName === "FABRIC-DYNAMIC-TAB");
|
|
206
|
+
if (tabElements.length > 0) {
|
|
207
|
+
(_a = this.focusController) === null || _a === void 0 ? void 0 : _a.applyTabindex();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Lifecycle callback - cleanup.
|
|
212
|
+
* @internal
|
|
213
|
+
*/
|
|
214
|
+
disconnectedCallback() {
|
|
215
|
+
var _a;
|
|
216
|
+
super.disconnectedCallback();
|
|
217
|
+
(_a = this.focusController) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
218
|
+
this.focusController = null;
|
|
219
|
+
this.removeManageTabsMenuListeners();
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Set up light dismiss listeners for manage tabs menu.
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
225
|
+
setupManageTabsMenuListeners() {
|
|
226
|
+
document.addEventListener("click", this.handleManageTabsLightDismiss);
|
|
227
|
+
document.addEventListener("keydown", this.handleManageTabsEscape);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Remove light dismiss listeners for manage tabs menu.
|
|
231
|
+
* Optionally returns focus to the trigger button.
|
|
232
|
+
* @internal
|
|
233
|
+
*/
|
|
234
|
+
removeManageTabsMenuListeners(restoreFocus = false) {
|
|
235
|
+
var _a;
|
|
236
|
+
this.manageTabsMenuOpen = false;
|
|
237
|
+
document.removeEventListener("click", this.handleManageTabsLightDismiss);
|
|
238
|
+
document.removeEventListener("keydown", this.handleManageTabsEscape);
|
|
239
|
+
if (restoreFocus) {
|
|
240
|
+
const trigger = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".manage-tabs-trigger");
|
|
241
|
+
trigger === null || trigger === void 0 ? void 0 : trigger.focus();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Initialize the roving focus controller.
|
|
246
|
+
* @internal
|
|
247
|
+
*/
|
|
248
|
+
initializeFocusController() {
|
|
249
|
+
this.focusController = createRovingFocusController({
|
|
250
|
+
// Filter to only actual DynamicTab elements (slot captures text nodes too)
|
|
251
|
+
items: () => this.tabs.filter(node => node instanceof HTMLElement && node.tagName === "FABRIC-DYNAMIC-TAB"),
|
|
252
|
+
isDisabled: el => {
|
|
253
|
+
const tab = el;
|
|
254
|
+
return tab.disabled === true;
|
|
255
|
+
},
|
|
256
|
+
orientation: this.orientation === DynamicTabListOrientations.vertical ? "vertical" : "horizontal",
|
|
257
|
+
enableHomeEnd: true,
|
|
258
|
+
wrap: false,
|
|
259
|
+
isRtl: () => this.matches(":dir(rtl)")
|
|
260
|
+
// Note: No onFocusChange callback - selection only happens via Enter/Space/Click
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Called when tabs change.
|
|
265
|
+
* Filters to only DynamicTab elements (excludes text nodes and other elements).
|
|
266
|
+
* Reconciles activeid if the active tab was removed externally.
|
|
267
|
+
* @internal
|
|
268
|
+
*/
|
|
269
|
+
tabsChanged() {
|
|
270
|
+
// Filter to only actual DynamicTab elements (slot captures text nodes too)
|
|
271
|
+
const tabElements = this.getTabElements();
|
|
272
|
+
// Reconcile activeid if active tab no longer exists
|
|
273
|
+
if (this.activeid) {
|
|
274
|
+
const activeTabExists = tabElements.some(tab => tab.id === this.activeid);
|
|
275
|
+
if (!activeTabExists && tabElements.length > 0) {
|
|
276
|
+
// Active tab was removed - select first available
|
|
277
|
+
this.activeid = tabElements[0].id;
|
|
278
|
+
} else if (!activeTabExists && tabElements.length === 0) {
|
|
279
|
+
this.activeid = undefined;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
this.updateTabStates();
|
|
283
|
+
// Apply tabindex if we have valid tab elements and controller is ready
|
|
284
|
+
if (tabElements.length > 0 && this.focusController) {
|
|
285
|
+
this.focusController.applyTabindex();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Called when activeid changes.
|
|
290
|
+
* @internal
|
|
291
|
+
*/
|
|
292
|
+
activeidChanged(oldValue, newValue) {
|
|
293
|
+
this.updateTabStates();
|
|
294
|
+
// Only emit tab-select for user-initiated changes, not programmatic ones
|
|
295
|
+
if (this.isUserSelection && oldValue !== newValue && newValue) {
|
|
296
|
+
this.emitTabSelect(newValue, oldValue !== null && oldValue !== void 0 ? oldValue : null);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Called when orientation changes - reinitialize focus controller.
|
|
301
|
+
* @internal
|
|
302
|
+
*/
|
|
303
|
+
orientationChanged() {
|
|
304
|
+
if (this.focusController) {
|
|
305
|
+
this.focusController.destroy();
|
|
306
|
+
this.initializeFocusController();
|
|
307
|
+
this.focusController.applyTabindex();
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Updates the selected state on all child tabs.
|
|
312
|
+
* @internal
|
|
313
|
+
*/
|
|
314
|
+
updateTabStates() {
|
|
315
|
+
const tabElements = this.getTabElements();
|
|
316
|
+
const total = tabElements.length;
|
|
317
|
+
tabElements.forEach((tab, index) => {
|
|
318
|
+
tab.selected = tab.id === this.activeid;
|
|
319
|
+
// Set position attributes for screen readers
|
|
320
|
+
tab.setAttribute("aria-posinset", String(index + 1));
|
|
321
|
+
tab.setAttribute("aria-setsize", String(total));
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Handles tab dismiss events from child tabs.
|
|
326
|
+
* Manages focus transfer and re-emits the event with index for consumer handling.
|
|
327
|
+
* @internal
|
|
328
|
+
*/
|
|
329
|
+
handleTabDismiss(event) {
|
|
330
|
+
var _a, _b;
|
|
331
|
+
// Verify event came from a dynamic tab
|
|
332
|
+
const sourceTab = event.composedPath().find(el => el instanceof HTMLElement && el.tagName === "FABRIC-DYNAMIC-TAB");
|
|
333
|
+
if (!sourceTab) return;
|
|
334
|
+
const {
|
|
335
|
+
id
|
|
336
|
+
} = event.detail;
|
|
337
|
+
const tabElements = this.getTabElements();
|
|
338
|
+
const index = tabElements.findIndex(tab => tab.id === id);
|
|
339
|
+
if (index === -1) return;
|
|
340
|
+
const tab = tabElements[index];
|
|
341
|
+
const hadFocus = tab.matches(":focus") || tab.contains(document.activeElement);
|
|
342
|
+
// If the tab had focus, move focus to next tab BEFORE consumer removes it
|
|
343
|
+
if (hadFocus) {
|
|
344
|
+
const remainingTabs = tabElements.filter(t => t.id !== id);
|
|
345
|
+
if (remainingTabs.length > 0) {
|
|
346
|
+
const focusIndex = Math.min(index, remainingTabs.length - 1);
|
|
347
|
+
(_a = remainingTabs[focusIndex]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
348
|
+
(_b = this.focusController) === null || _b === void 0 ? void 0 : _b.sync(remainingTabs[focusIndex]);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
this.dispatchEvent(new CustomEvent(DynamicTabListEventNames["tab-dismiss"], {
|
|
352
|
+
detail: {
|
|
353
|
+
id,
|
|
354
|
+
index
|
|
355
|
+
},
|
|
356
|
+
bubbles: true,
|
|
357
|
+
composed: true
|
|
358
|
+
}));
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Handles tab select events from child tabs.
|
|
362
|
+
* @internal
|
|
363
|
+
*/
|
|
364
|
+
handleTabSelect(event) {
|
|
365
|
+
var _a;
|
|
366
|
+
// Verify event came from a dynamic tab
|
|
367
|
+
const tab = event.composedPath().find(el => el instanceof HTMLElement && el.tagName === "FABRIC-DYNAMIC-TAB");
|
|
368
|
+
if (!tab) return;
|
|
369
|
+
const {
|
|
370
|
+
id
|
|
371
|
+
} = event.detail;
|
|
372
|
+
if (id !== this.activeid) {
|
|
373
|
+
// Mark this as a user-initiated change
|
|
374
|
+
this.isUserSelection = true;
|
|
375
|
+
this.activeid = id;
|
|
376
|
+
this.isUserSelection = false;
|
|
377
|
+
}
|
|
378
|
+
// Sync focus controller to the actual tab element
|
|
379
|
+
(_a = this.focusController) === null || _a === void 0 ? void 0 : _a.sync(tab);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Handles right-click on tabs.
|
|
383
|
+
* Emits context-menu event with tab ID and cursor coordinates.
|
|
384
|
+
* Consumer implements their own context menu using native Popover API.
|
|
385
|
+
* @internal
|
|
386
|
+
*/
|
|
387
|
+
handleTabContextMenu(event) {
|
|
388
|
+
const target = event.target;
|
|
389
|
+
const tab = target.closest("fabric-dynamic-tab");
|
|
390
|
+
// Not on a tab - let native context menu work
|
|
391
|
+
if (!tab) return true;
|
|
392
|
+
// Prevent native context menu
|
|
393
|
+
event.preventDefault();
|
|
394
|
+
// Store target and position for getContextMenuTab()
|
|
395
|
+
this.contextMenuTargetId = tab.id;
|
|
396
|
+
this.contextMenuOpen = true;
|
|
397
|
+
this.contextMenuX = event.clientX;
|
|
398
|
+
this.contextMenuY = event.clientY;
|
|
399
|
+
// Emit event with coordinates so consumer can position their menu
|
|
400
|
+
this.dispatchEvent(new CustomEvent(DynamicTabListEventNames["context-menu"], {
|
|
401
|
+
detail: {
|
|
402
|
+
id: tab.id,
|
|
403
|
+
clientX: event.clientX,
|
|
404
|
+
clientY: event.clientY
|
|
405
|
+
},
|
|
406
|
+
bubbles: true,
|
|
407
|
+
composed: true
|
|
408
|
+
}));
|
|
409
|
+
return false; // We handled it
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Handles keyboard navigation using roving focus controller.
|
|
413
|
+
* @internal
|
|
414
|
+
*/
|
|
415
|
+
handleKeydown(event) {
|
|
416
|
+
var _a;
|
|
417
|
+
// Let the focus controller handle arrow keys, Home, End
|
|
418
|
+
if ((_a = this.focusController) === null || _a === void 0 ? void 0 : _a.handleKeydown(event)) {
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
return true; // Let unhandled events (like Tab) continue
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Handles focusin events to sync the focus controller.
|
|
425
|
+
* @internal
|
|
426
|
+
*/
|
|
427
|
+
handleFocusin(event) {
|
|
428
|
+
var _a;
|
|
429
|
+
// Find the actual tab element from composedPath
|
|
430
|
+
const tab = event.composedPath().find(el => el instanceof HTMLElement && el.tagName === "FABRIC-DYNAMIC-TAB");
|
|
431
|
+
if (tab) {
|
|
432
|
+
(_a = this.focusController) === null || _a === void 0 ? void 0 : _a.sync(tab);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Emits the tab-select event.
|
|
437
|
+
* @internal
|
|
438
|
+
*/
|
|
439
|
+
emitTabSelect(id, previousId) {
|
|
440
|
+
this.dispatchEvent(new CustomEvent(DynamicTabListEventNames["tab-select"], {
|
|
441
|
+
detail: {
|
|
442
|
+
id,
|
|
443
|
+
previousId
|
|
444
|
+
},
|
|
445
|
+
bubbles: true,
|
|
446
|
+
composed: true
|
|
447
|
+
}));
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Gets the tab that triggered the context menu.
|
|
451
|
+
* Useful for consumers to render menu items based on tab state.
|
|
452
|
+
* @public
|
|
453
|
+
*/
|
|
454
|
+
getContextMenuTab() {
|
|
455
|
+
var _a;
|
|
456
|
+
if (!this.contextMenuTargetId) return null;
|
|
457
|
+
return (_a = this.tabs.find(tab => tab.id === this.contextMenuTargetId)) !== null && _a !== void 0 ? _a : null;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Clears the context menu target ID and state.
|
|
461
|
+
* Call this when closing your context menu to reset state.
|
|
462
|
+
* @public
|
|
463
|
+
*/
|
|
464
|
+
clearContextMenuTarget() {
|
|
465
|
+
this.contextMenuTargetId = null;
|
|
466
|
+
this.contextMenuOpen = false;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Closes the context menu and resets all context menu state.
|
|
470
|
+
* @public
|
|
471
|
+
*/
|
|
472
|
+
closeContextMenu() {
|
|
473
|
+
this.contextMenuOpen = false;
|
|
474
|
+
this.contextMenuTargetId = null;
|
|
475
|
+
this.contextMenuX = 0;
|
|
476
|
+
this.contextMenuY = 0;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Toggles the manage tabs menu popover.
|
|
480
|
+
* @public
|
|
481
|
+
*/
|
|
482
|
+
toggleManageTabsMenu() {
|
|
483
|
+
var _a, _b, _c;
|
|
484
|
+
if (!this.manageTabsMenuEl) {
|
|
485
|
+
// No popover element - just toggle the state directly
|
|
486
|
+
this.manageTabsMenuOpen = !this.manageTabsMenuOpen;
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
const popover = this.manageTabsMenuEl;
|
|
490
|
+
if ((_a = popover.matches) === null || _a === void 0 ? void 0 : _a.call(popover, ":popover-open")) {
|
|
491
|
+
(_b = popover.hidePopover) === null || _b === void 0 ? void 0 : _b.call(popover);
|
|
492
|
+
this.manageTabsMenuOpen = false;
|
|
493
|
+
this.removeManageTabsMenuListeners(true);
|
|
494
|
+
} else {
|
|
495
|
+
(_c = popover.showPopover) === null || _c === void 0 ? void 0 : _c.call(popover);
|
|
496
|
+
this.manageTabsMenuOpen = true;
|
|
497
|
+
// Delay adding listeners to avoid immediately closing from current click
|
|
498
|
+
requestAnimationFrame(() => {
|
|
499
|
+
var _a;
|
|
500
|
+
this.setupManageTabsMenuListeners();
|
|
501
|
+
// Move focus into the first menu item for keyboard accessibility
|
|
502
|
+
const firstItem = (_a = this.manageTabsMenuEl) === null || _a === void 0 ? void 0 : _a.querySelector("fabric-menu-item");
|
|
503
|
+
firstItem === null || firstItem === void 0 ? void 0 : firstItem.focus();
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Closes the manage tabs menu.
|
|
509
|
+
* @public
|
|
510
|
+
*/
|
|
511
|
+
closeManageTabsMenu() {
|
|
512
|
+
this.manageTabsMenuOpen = false;
|
|
513
|
+
this.closeManageTabsMenuInternal();
|
|
514
|
+
}
|
|
515
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
516
|
+
// Public Tab Management Methods
|
|
517
|
+
// These methods emit events for the consumer to handle DOM removal.
|
|
518
|
+
// The component does NOT mutate light DOM directly.
|
|
519
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
520
|
+
/**
|
|
521
|
+
* Requests closing a tab by ID.
|
|
522
|
+
* Emits `tab-dismiss` event for the consumer to handle DOM removal.
|
|
523
|
+
* If the tab had focus, moves focus to an adjacent tab.
|
|
524
|
+
* @param id - The ID of the tab to close
|
|
525
|
+
* @public
|
|
526
|
+
*/
|
|
527
|
+
closeTab(id) {
|
|
528
|
+
var _a, _b;
|
|
529
|
+
const tabElements = this.getTabElements();
|
|
530
|
+
const tabIndex = tabElements.findIndex(tab => tab.id === id);
|
|
531
|
+
if (tabIndex === -1) return;
|
|
532
|
+
const tab = tabElements[tabIndex];
|
|
533
|
+
const hadFocus = tab.matches(":focus") || tab.contains(document.activeElement);
|
|
534
|
+
// If the tab had focus, move focus to next tab
|
|
535
|
+
if (hadFocus) {
|
|
536
|
+
const remainingTabs = tabElements.filter(t => t.id !== id);
|
|
537
|
+
if (remainingTabs.length > 0) {
|
|
538
|
+
const focusIndex = Math.min(tabIndex, remainingTabs.length - 1);
|
|
539
|
+
(_a = remainingTabs[focusIndex]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
540
|
+
(_b = this.focusController) === null || _b === void 0 ? void 0 : _b.sync(remainingTabs[focusIndex]);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
// Emit tab-dismiss event for consumer to handle removal
|
|
544
|
+
this.dispatchEvent(new CustomEvent(DynamicTabListEventNames["tab-dismiss"], {
|
|
545
|
+
detail: {
|
|
546
|
+
id,
|
|
547
|
+
index: tabIndex
|
|
548
|
+
},
|
|
549
|
+
bubbles: true,
|
|
550
|
+
composed: true
|
|
551
|
+
}));
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Requests closing all tabs except the specified one.
|
|
555
|
+
* Emits `tab-dismiss` events for each tab to close.
|
|
556
|
+
* @param id - The ID of the tab to keep open
|
|
557
|
+
* @public
|
|
558
|
+
*/
|
|
559
|
+
closeOtherTabs(id) {
|
|
560
|
+
const tabElements = this.getTabElements();
|
|
561
|
+
const tabsToClose = tabElements.filter(tab => tab.id !== id);
|
|
562
|
+
// Emit dismiss event for each tab
|
|
563
|
+
tabsToClose.forEach(tab => {
|
|
564
|
+
const originalIndex = tabElements.findIndex(t => t.id === tab.id);
|
|
565
|
+
this.dispatchEvent(new CustomEvent(DynamicTabListEventNames["tab-dismiss"], {
|
|
566
|
+
detail: {
|
|
567
|
+
id: tab.id,
|
|
568
|
+
index: originalIndex
|
|
569
|
+
},
|
|
570
|
+
bubbles: true,
|
|
571
|
+
composed: true
|
|
572
|
+
}));
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Requests closing all tabs to the right of the specified tab.
|
|
577
|
+
* Emits `tab-dismiss` events for each tab to close.
|
|
578
|
+
* @param id - The ID of the anchor tab
|
|
579
|
+
* @public
|
|
580
|
+
*/
|
|
581
|
+
closeTabsToRight(id) {
|
|
582
|
+
const tabElements = this.getTabElements();
|
|
583
|
+
const tabIndex = tabElements.findIndex(tab => tab.id === id);
|
|
584
|
+
if (tabIndex === -1) return;
|
|
585
|
+
const tabsToClose = tabElements.slice(tabIndex + 1);
|
|
586
|
+
// Emit dismiss event for each tab (in reverse order for stable indices)
|
|
587
|
+
[...tabsToClose].reverse().forEach(tab => {
|
|
588
|
+
const originalIndex = tabElements.findIndex(t => t.id === tab.id);
|
|
589
|
+
this.dispatchEvent(new CustomEvent(DynamicTabListEventNames["tab-dismiss"], {
|
|
590
|
+
detail: {
|
|
591
|
+
id: tab.id,
|
|
592
|
+
index: originalIndex
|
|
593
|
+
},
|
|
594
|
+
bubbles: true,
|
|
595
|
+
composed: true
|
|
596
|
+
}));
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Requests closing all tabs to the left of the specified tab.
|
|
601
|
+
* Emits `tab-dismiss` events for each tab to close.
|
|
602
|
+
* @param id - The ID of the anchor tab
|
|
603
|
+
* @public
|
|
604
|
+
*/
|
|
605
|
+
closeTabsToLeft(id) {
|
|
606
|
+
const tabElements = this.getTabElements();
|
|
607
|
+
const tabIndex = tabElements.findIndex(tab => tab.id === id);
|
|
608
|
+
if (tabIndex === -1) return;
|
|
609
|
+
const tabsToClose = tabElements.slice(0, tabIndex);
|
|
610
|
+
// Emit dismiss event for each tab (in reverse order for stable indices)
|
|
611
|
+
[...tabsToClose].reverse().forEach(tab => {
|
|
612
|
+
const originalIndex = tabElements.findIndex(t => t.id === tab.id);
|
|
613
|
+
this.dispatchEvent(new CustomEvent(DynamicTabListEventNames["tab-dismiss"], {
|
|
614
|
+
detail: {
|
|
615
|
+
id: tab.id,
|
|
616
|
+
index: originalIndex
|
|
617
|
+
},
|
|
618
|
+
bubbles: true,
|
|
619
|
+
composed: true
|
|
620
|
+
}));
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Requests closing all tabs.
|
|
625
|
+
* Emits `tab-dismiss` events for each tab.
|
|
626
|
+
* @public
|
|
627
|
+
*/
|
|
628
|
+
closeAllTabs() {
|
|
629
|
+
const tabElements = this.getTabElements();
|
|
630
|
+
// Emit dismiss event for each tab (in reverse order for stable indices)
|
|
631
|
+
[...tabElements].reverse().forEach(tab => {
|
|
632
|
+
const originalIndex = tabElements.findIndex(t => t.id === tab.id);
|
|
633
|
+
this.dispatchEvent(new CustomEvent(DynamicTabListEventNames["tab-dismiss"], {
|
|
634
|
+
detail: {
|
|
635
|
+
id: tab.id,
|
|
636
|
+
index: originalIndex
|
|
637
|
+
},
|
|
638
|
+
bubbles: true,
|
|
639
|
+
composed: true
|
|
640
|
+
}));
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Selects the next available tab after a tab is closed.
|
|
645
|
+
* Prefers the tab at the same index, then previous tabs.
|
|
646
|
+
* @param closedIndex - The index of the tab that was closed
|
|
647
|
+
* @internal
|
|
648
|
+
*/
|
|
649
|
+
selectNextAvailableTab(closedIndex) {
|
|
650
|
+
// tabs array will be updated after DOM mutation, but we need to calculate now
|
|
651
|
+
// Get remaining tabs (excluding the one being removed)
|
|
652
|
+
const remainingTabs = this.tabs.filter((_, i) => i !== closedIndex);
|
|
653
|
+
if (remainingTabs.length === 0) {
|
|
654
|
+
this.activeid = undefined;
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
// Try to select tab at same position, or previous if at end
|
|
658
|
+
const newIndex = Math.min(closedIndex, remainingTabs.length - 1);
|
|
659
|
+
const newActiveTab = remainingTabs[newIndex];
|
|
660
|
+
if (newActiveTab) {
|
|
661
|
+
this.activeid = newActiveTab.id;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
665
|
+
// Built-in Manage Tabs Menu Methods
|
|
666
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
667
|
+
/**
|
|
668
|
+
* Requests closing all tabs that are not marked as modified.
|
|
669
|
+
* Emits `tab-dismiss` events for each unmodified tab.
|
|
670
|
+
* Tabs with `modified === true` are preserved.
|
|
671
|
+
* @public
|
|
672
|
+
*/
|
|
673
|
+
closeUnmodifiedTabs() {
|
|
674
|
+
const tabElements = this.getTabElements();
|
|
675
|
+
const unmodifiedTabs = tabElements.filter(tab => !tab.modified);
|
|
676
|
+
// Emit dismiss event for each unmodified tab (in reverse order for stable indices)
|
|
677
|
+
[...unmodifiedTabs].reverse().forEach(tab => {
|
|
678
|
+
const originalIndex = tabElements.findIndex(t => t.id === tab.id);
|
|
679
|
+
this.dispatchEvent(new CustomEvent(DynamicTabListEventNames["tab-dismiss"], {
|
|
680
|
+
detail: {
|
|
681
|
+
id: tab.id,
|
|
682
|
+
index: originalIndex
|
|
683
|
+
},
|
|
684
|
+
bubbles: true,
|
|
685
|
+
composed: true
|
|
686
|
+
}));
|
|
687
|
+
});
|
|
688
|
+
// Close the menu after action
|
|
689
|
+
this.closeManageTabsMenuInternal();
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Selects a tab from the manage tabs menu, focuses it, and closes the menu.
|
|
693
|
+
* @param tab - The tab to select
|
|
694
|
+
* @internal
|
|
695
|
+
*/
|
|
696
|
+
selectTabFromManageMenu(tab) {
|
|
697
|
+
var _a;
|
|
698
|
+
// Mark as user selection to emit tab-select event
|
|
699
|
+
this.isUserSelection = true;
|
|
700
|
+
this.activeid = tab.id;
|
|
701
|
+
this.isUserSelection = false;
|
|
702
|
+
// Focus the tab and sync roving focus controller
|
|
703
|
+
tab.focus();
|
|
704
|
+
(_a = this.focusController) === null || _a === void 0 ? void 0 : _a.sync(tab);
|
|
705
|
+
// Close the menu without restoring focus to trigger (focus goes to the tab)
|
|
706
|
+
this.closeManageTabsMenuInternal(false);
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Closes the manage tabs menu popover and cleans up listeners.
|
|
710
|
+
* Used internally by built-in menu actions.
|
|
711
|
+
* @param restoreFocus - When true, returns focus to the trigger button.
|
|
712
|
+
* @internal
|
|
713
|
+
*/
|
|
714
|
+
closeManageTabsMenuInternal(restoreFocus = true) {
|
|
715
|
+
var _a;
|
|
716
|
+
if (!this.manageTabsMenuEl) return;
|
|
717
|
+
const popover = this.manageTabsMenuEl;
|
|
718
|
+
(_a = popover.hidePopover) === null || _a === void 0 ? void 0 : _a.call(popover);
|
|
719
|
+
this.removeManageTabsMenuListeners(restoreFocus);
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Gets the display label for a tab in the manage tabs menu.
|
|
723
|
+
* Reads only the default slot's assigned content for a clean label,
|
|
724
|
+
* excluding named-slot content (icons, dismiss-icon) and shadow DOM text (hint spans).
|
|
725
|
+
* Falls back through: default slot text → aria-label → id
|
|
726
|
+
* @param tab - The tab to get the label for
|
|
727
|
+
* @returns The display label string
|
|
728
|
+
* @internal
|
|
729
|
+
*/
|
|
730
|
+
getTabDisplayLabel(tab) {
|
|
731
|
+
var _a;
|
|
732
|
+
const defaultSlot = (_a = tab.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("slot:not([name])");
|
|
733
|
+
if (defaultSlot) {
|
|
734
|
+
const slotText = defaultSlot.assignedNodes({
|
|
735
|
+
flatten: true
|
|
736
|
+
}).map(node => {
|
|
737
|
+
var _a;
|
|
738
|
+
return (_a = node.textContent) !== null && _a !== void 0 ? _a : "";
|
|
739
|
+
}).join("").trim();
|
|
740
|
+
if (slotText) return slotText;
|
|
741
|
+
}
|
|
742
|
+
const ariaLabel = tab.getAttribute("aria-label");
|
|
743
|
+
if (ariaLabel) return ariaLabel;
|
|
744
|
+
return tab.id;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Gets the filtered array of DynamicTab elements from the tabs slot.
|
|
748
|
+
* Filters out text nodes and non-tab elements.
|
|
749
|
+
* @returns Array of DynamicTab elements
|
|
750
|
+
* @public
|
|
751
|
+
*/
|
|
752
|
+
getTabElements() {
|
|
753
|
+
return this.tabs.filter(node => node instanceof HTMLElement && node.tagName === "FABRIC-DYNAMIC-TAB");
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Handles "Close all tabs" action from the built-in menu.
|
|
757
|
+
* Closes all tabs and then closes the menu.
|
|
758
|
+
* @internal
|
|
759
|
+
*/
|
|
760
|
+
handleCloseAllFromMenu() {
|
|
761
|
+
this.closeAllTabs();
|
|
762
|
+
this.closeManageTabsMenuInternal();
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
__decorate([attr], DynamicTabList.prototype, "activeid", void 0);
|
|
766
|
+
__decorate([attr], DynamicTabList.prototype, "orientation", void 0);
|
|
767
|
+
__decorate([attr({
|
|
768
|
+
mode: "boolean",
|
|
769
|
+
attribute: "show-managed-tabs"
|
|
770
|
+
})], DynamicTabList.prototype, "showManagedTabs", void 0);
|
|
771
|
+
__decorate([attr({
|
|
772
|
+
attribute: "close-unmodified-label"
|
|
773
|
+
})], DynamicTabList.prototype, "closeUnmodifiedLabel", void 0);
|
|
774
|
+
__decorate([attr({
|
|
775
|
+
attribute: "close-all-label"
|
|
776
|
+
})], DynamicTabList.prototype, "closeAllLabel", void 0);
|
|
777
|
+
__decorate([attr({
|
|
778
|
+
attribute: "manage-tabs-label"
|
|
779
|
+
})], DynamicTabList.prototype, "manageTabsLabel", void 0);
|
|
780
|
+
__decorate([observable], DynamicTabList.prototype, "tabs", void 0);
|
|
781
|
+
__decorate([observable], DynamicTabList.prototype, "contextMenuTargetId", void 0);
|
|
782
|
+
__decorate([observable], DynamicTabList.prototype, "contextMenuOpen", void 0);
|
|
783
|
+
__decorate([observable], DynamicTabList.prototype, "contextMenuX", void 0);
|
|
784
|
+
__decorate([observable], DynamicTabList.prototype, "contextMenuY", void 0);
|
|
785
|
+
__decorate([observable], DynamicTabList.prototype, "slottedManageTabsTrigger", void 0);
|
|
786
|
+
__decorate([observable], DynamicTabList.prototype, "manageTabsMenuOpen", void 0);
|
|
787
|
+
|
|
788
|
+
export { DynamicTabList };
|