@ebay/ui-core-react 5.6.2 → 5.7.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/README.md +5 -32
- package/common/component-utils/forwardRef.js +9 -4
- package/common/component-utils/index.js +6 -2
- package/common/component-utils/usePrevious.js +2 -2
- package/common/debounce.js +9 -7
- package/common/event-utils/index.d.ts +2 -2
- package/common/event-utils/index.d.ts.map +1 -1
- package/common/event-utils/types.d.ts +10 -10
- package/common/event-utils/types.d.ts.map +1 -1
- package/common/event-utils/use-key-press.js +3 -3
- package/common/event-utils/use-roving-index.d.ts.map +1 -1
- package/common/event-utils/use-roving-index.js +12 -10
- package/common/floating-label-utils/hooks.d.ts +3 -3
- package/common/floating-label-utils/hooks.d.ts.map +1 -1
- package/common/floating-label-utils/hooks.js +22 -18
- package/common/notice-utils/notice-content.d.ts +1 -1
- package/common/notice-utils/notice-content.d.ts.map +1 -1
- package/common/notice-utils/notice-content.js +1 -1
- package/common/notice-utils/notice-cta.d.ts +1 -1
- package/common/notice-utils/notice-cta.d.ts.map +1 -1
- package/common/notice-utils/notice-cta.js +1 -1
- package/common/notice-utils/notice-footer.d.ts +1 -1
- package/common/notice-utils/notice-footer.d.ts.map +1 -1
- package/common/notice-utils/notice-footer.js +1 -1
- package/common/notice-utils/notice-title.d.ts +1 -1
- package/common/notice-utils/notice-title.d.ts.map +1 -1
- package/common/notice-utils/notice-title.js +1 -1
- package/common/random-id.js +2 -1
- package/common/range.js +2 -1
- package/common/tooltip-utils/index.js +8 -4
- package/common/tooltip-utils/tooltip-content.d.ts +1 -1
- package/common/tooltip-utils/tooltip-content.d.ts.map +1 -1
- package/common/tooltip-utils/tooltip-content.js +9 -9
- package/common/tooltip-utils/tooltip-footer.d.ts +1 -1
- package/common/tooltip-utils/tooltip-footer.d.ts.map +1 -1
- package/common/tooltip-utils/tooltip-footer.js +1 -1
- package/common/tooltip-utils/tooltip-host.d.ts +1 -1
- package/common/tooltip-utils/tooltip-host.d.ts.map +1 -1
- package/common/tooltip-utils/tooltip-host.js +1 -1
- package/common/tooltip-utils/tooltip.d.ts +2 -2
- package/common/tooltip-utils/tooltip.d.ts.map +1 -1
- package/common/tooltip-utils/tooltip.js +12 -8
- package/common/tooltip-utils/types.d.ts +2 -2
- package/common/tooltip-utils/types.d.ts.map +1 -1
- package/common/tooltip-utils/use-tooltip.d.ts +2 -2
- package/common/tooltip-utils/use-tooltip.d.ts.map +1 -1
- package/common/tooltip-utils/use-tooltip.js +3 -2
- package/ebay-alert-dialog/alert-dialog.js +8 -4
- package/ebay-alert-dialog/index.js +5 -1
- package/ebay-badge/badge.d.ts +2 -2
- package/ebay-badge/badge.d.ts.map +1 -1
- package/ebay-badge/badge.js +1 -1
- package/ebay-badge/index.js +5 -1
- package/ebay-breadcrumbs/breadcrumb-item.d.ts +2 -2
- package/ebay-breadcrumbs/breadcrumb-item.d.ts.map +1 -1
- package/ebay-breadcrumbs/breadcrumbs.d.ts +1 -1
- package/ebay-breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/ebay-breadcrumbs/breadcrumbs.js +9 -5
- package/ebay-breadcrumbs/index.js +6 -2
- package/ebay-button/button-cell.d.ts +2 -2
- package/ebay-button/button-cell.d.ts.map +1 -1
- package/ebay-button/button-cell.js +1 -1
- package/ebay-button/button-text.d.ts +1 -1
- package/ebay-button/button-text.d.ts.map +1 -1
- package/ebay-button/button-text.js +1 -1
- package/ebay-button/button.d.ts +3 -3
- package/ebay-button/button.d.ts.map +1 -1
- package/ebay-button/button.js +14 -10
- package/ebay-button/index.js +6 -2
- package/ebay-button/types.d.ts +5 -5
- package/ebay-button/types.d.ts.map +1 -1
- package/ebay-carousel/carousel-control-button.d.ts +1 -1
- package/ebay-carousel/carousel-control-button.d.ts.map +1 -1
- package/ebay-carousel/carousel-control-button.js +2 -2
- package/ebay-carousel/carousel-item.d.ts +3 -3
- package/ebay-carousel/carousel-item.d.ts.map +1 -1
- package/ebay-carousel/carousel-item.js +11 -7
- package/ebay-carousel/carousel-list.d.ts +1 -1
- package/ebay-carousel/carousel-list.d.ts.map +1 -1
- package/ebay-carousel/carousel-list.js +18 -14
- package/ebay-carousel/carousel.d.ts +1 -1
- package/ebay-carousel/carousel.d.ts.map +1 -1
- package/ebay-carousel/carousel.js +23 -19
- package/ebay-carousel/helpers.d.ts.map +1 -1
- package/ebay-carousel/helpers.js +19 -13
- package/ebay-carousel/index.js +6 -2
- package/ebay-carousel/scroll-to-transition.d.ts +1 -1
- package/ebay-carousel/scroll-to-transition.d.ts.map +1 -1
- package/ebay-carousel/types.d.ts +4 -4
- package/ebay-carousel/types.d.ts.map +1 -1
- package/ebay-checkbox/checkbox.d.ts +3 -3
- package/ebay-checkbox/checkbox.d.ts.map +1 -1
- package/ebay-checkbox/checkbox.js +10 -6
- package/ebay-checkbox/index.js +5 -1
- package/ebay-confirm-dialog/confirm-dialog.js +8 -4
- package/ebay-confirm-dialog/index.js +5 -1
- package/ebay-cta-button/cta-button.d.ts +3 -3
- package/ebay-cta-button/cta-button.d.ts.map +1 -1
- package/ebay-cta-button/cta-button.js +2 -2
- package/ebay-cta-button/index.js +5 -1
- package/ebay-dialog-base/components/animation.d.ts +1 -1
- package/ebay-dialog-base/components/animation.d.ts.map +1 -1
- package/ebay-dialog-base/components/animation.js +5 -5
- package/ebay-dialog-base/components/dialog-actions.d.ts +1 -1
- package/ebay-dialog-base/components/dialog-actions.d.ts.map +1 -1
- package/ebay-dialog-base/components/dialog-footer.d.ts +1 -1
- package/ebay-dialog-base/components/dialog-footer.d.ts.map +1 -1
- package/ebay-dialog-base/components/dialog-header.d.ts +1 -1
- package/ebay-dialog-base/components/dialog-header.d.ts.map +1 -1
- package/ebay-dialog-base/components/dialog-previous-button.d.ts +1 -1
- package/ebay-dialog-base/components/dialog-previous-button.d.ts.map +1 -1
- package/ebay-dialog-base/components/dialog-previous-button.js +1 -1
- package/ebay-dialog-base/components/dialogBase.d.ts +3 -3
- package/ebay-dialog-base/components/dialogBase.d.ts.map +1 -1
- package/ebay-dialog-base/components/dialogBase.js +28 -23
- package/ebay-dialog-base/dialog-base-with-state.d.ts.map +1 -1
- package/ebay-dialog-base/dialog-base-with-state.js +8 -3
- package/ebay-dialog-base/index.js +10 -6
- package/ebay-drawer-dialog/components/drawer.js +11 -7
- package/ebay-drawer-dialog/index.js +5 -1
- package/ebay-eek/eek-rating.d.ts +1 -1
- package/ebay-eek/eek-rating.d.ts.map +1 -1
- package/ebay-eek/eek-rating.js +3 -3
- package/ebay-eek/index.js +5 -1
- package/ebay-fake-menu/index.js +7 -3
- package/ebay-fake-menu/menu-item-separator.d.ts +1 -1
- package/ebay-fake-menu/menu-item-separator.d.ts.map +1 -1
- package/ebay-fake-menu/menu-item-separator.js +1 -1
- package/ebay-fake-menu/menu-item.d.ts +1 -1
- package/ebay-fake-menu/menu-item.d.ts.map +1 -1
- package/ebay-fake-menu/menu-item.js +9 -5
- package/ebay-fake-menu/menu.d.ts +2 -2
- package/ebay-fake-menu/menu.d.ts.map +1 -1
- package/ebay-fake-menu/menu.js +8 -4
- package/ebay-fake-menu-button/index.js +8 -4
- package/ebay-fake-menu-button/menu-button-separator.d.ts +1 -1
- package/ebay-fake-menu-button/menu-button-separator.d.ts.map +1 -1
- package/ebay-fake-menu-button/menu-button-separator.js +1 -1
- package/ebay-fake-menu-button/menu-button.d.ts +4 -4
- package/ebay-fake-menu-button/menu-button.d.ts.map +1 -1
- package/ebay-fake-menu-button/menu-button.js +20 -16
- package/ebay-fake-tabs/fake-tabs.d.ts +1 -1
- package/ebay-fake-tabs/fake-tabs.d.ts.map +1 -1
- package/ebay-fake-tabs/fake-tabs.js +10 -6
- package/ebay-fake-tabs/index.js +6 -2
- package/ebay-fake-tabs/tab.d.ts +1 -1
- package/ebay-fake-tabs/tab.d.ts.map +1 -1
- package/ebay-fake-tabs/tab.js +1 -1
- package/ebay-field/description.d.ts +1 -1
- package/ebay-field/description.d.ts.map +1 -1
- package/ebay-field/description.js +1 -1
- package/ebay-field/field.d.ts +1 -1
- package/ebay-field/field.d.ts.map +1 -1
- package/ebay-field/field.js +1 -1
- package/ebay-field/index.js +7 -3
- package/ebay-field/label.d.ts +1 -1
- package/ebay-field/label.d.ts.map +1 -1
- package/ebay-field/label.js +1 -1
- package/ebay-field/types.d.ts +4 -4
- package/ebay-field/types.d.ts.map +1 -1
- package/ebay-fullscreen-dialog/fullscreen-dialog.js +1 -1
- package/ebay-fullscreen-dialog/index.js +5 -1
- package/ebay-icon/icon.d.ts +3 -3
- package/ebay-icon/icon.d.ts.map +1 -1
- package/ebay-icon/icon.js +15 -11
- package/ebay-icon/index.js +5 -1
- package/ebay-icon/types.d.ts +1 -1
- package/ebay-icon/types.d.ts.map +1 -1
- package/ebay-icon-button/icon-button.d.ts +5 -5
- package/ebay-icon-button/icon-button.d.ts.map +1 -1
- package/ebay-icon-button/icon-button.js +4 -4
- package/ebay-icon-button/index.js +5 -1
- package/ebay-infotip/ebay-infotip-heading.d.ts +1 -1
- package/ebay-infotip/ebay-infotip-heading.d.ts.map +1 -1
- package/ebay-infotip/ebay-infotip-heading.js +1 -1
- package/ebay-infotip/ebay-infotip-host.d.ts +2 -2
- package/ebay-infotip/ebay-infotip-host.d.ts.map +1 -1
- package/ebay-infotip/ebay-infotip-host.js +2 -2
- package/ebay-infotip/ebay-infotip.d.ts +1 -1
- package/ebay-infotip/ebay-infotip.d.ts.map +1 -1
- package/ebay-infotip/ebay-infotip.js +14 -11
- package/ebay-infotip/index.js +8 -4
- package/ebay-infotip/types.d.ts +1 -1
- package/ebay-infotip/types.d.ts.map +1 -1
- package/ebay-inline-notice/index.js +5 -1
- package/ebay-inline-notice/inline-notice.d.ts +1 -1
- package/ebay-inline-notice/inline-notice.d.ts.map +1 -1
- package/ebay-inline-notice/inline-notice.js +10 -6
- package/ebay-inline-notice/types.d.ts +1 -1
- package/ebay-inline-notice/types.d.ts.map +1 -1
- package/ebay-lightbox-dialog/index.js +5 -1
- package/ebay-lightbox-dialog/lightbox-dialog.d.ts +1 -1
- package/ebay-lightbox-dialog/lightbox-dialog.d.ts.map +1 -1
- package/ebay-lightbox-dialog/lightbox-dialog.js +2 -2
- package/ebay-listbox-button/index.js +6 -2
- package/ebay-listbox-button/listbox-button-option.d.ts +1 -1
- package/ebay-listbox-button/listbox-button-option.d.ts.map +1 -1
- package/ebay-listbox-button/listbox-button-option.js +2 -2
- package/ebay-listbox-button/listbox-button.d.ts +2 -2
- package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
- package/ebay-listbox-button/listbox-button.js +22 -18
- package/ebay-menu/index.js +13 -5
- package/ebay-menu/menu-item-separator.d.ts +1 -1
- package/ebay-menu/menu-item-separator.d.ts.map +1 -1
- package/ebay-menu/menu-item-separator.js +1 -1
- package/ebay-menu/menu-item.d.ts +1 -1
- package/ebay-menu/menu-item.d.ts.map +1 -1
- package/ebay-menu/menu-item.js +9 -5
- package/ebay-menu/menu.d.ts +1 -1
- package/ebay-menu/menu.js +23 -17
- package/ebay-menu/types.d.ts +10 -10
- package/ebay-menu/types.d.ts.map +1 -1
- package/ebay-menu-button/index.js +14 -6
- package/ebay-menu-button/menu-button-separator.d.ts +1 -1
- package/ebay-menu-button/menu-button-separator.d.ts.map +1 -1
- package/ebay-menu-button/menu-button-separator.js +1 -1
- package/ebay-menu-button/menu-button.d.ts +3 -3
- package/ebay-menu-button/menu-button.d.ts.map +1 -1
- package/ebay-menu-button/menu-button.js +21 -17
- package/ebay-menu-button/types.d.ts +1 -1
- package/ebay-menu-button/types.d.ts.map +1 -1
- package/ebay-notice-base/components/ebay-notice-content/index.js +5 -1
- package/ebay-notice-base/components/ebay-notice-content/notice-content.d.ts +1 -1
- package/ebay-notice-base/components/ebay-notice-content/notice-content.d.ts.map +1 -1
- package/ebay-notice-base/components/ebay-notice-title/index.js +5 -1
- package/ebay-notice-base/index.js +1 -0
- package/ebay-page-notice/index.js +8 -4
- package/ebay-page-notice/page-notice-cta.d.ts +1 -1
- package/ebay-page-notice/page-notice-cta.d.ts.map +1 -1
- package/ebay-page-notice/page-notice-footer.d.ts +1 -1
- package/ebay-page-notice/page-notice-footer.d.ts.map +1 -1
- package/ebay-page-notice/page-notice-title.d.ts +1 -1
- package/ebay-page-notice/page-notice-title.d.ts.map +1 -1
- package/ebay-page-notice/page-notice.d.ts +2 -2
- package/ebay-page-notice/page-notice.d.ts.map +1 -1
- package/ebay-page-notice/page-notice.js +10 -6
- package/ebay-pagination/index.js +6 -2
- package/ebay-pagination/pagination-item.d.ts +4 -4
- package/ebay-pagination/pagination-item.d.ts.map +1 -1
- package/ebay-pagination/pagination-item.js +3 -3
- package/ebay-pagination/pagination.d.ts +1 -1
- package/ebay-pagination/pagination.d.ts.map +1 -1
- package/ebay-pagination/pagination.js +38 -26
- package/ebay-pagination/types.d.ts +2 -2
- package/ebay-pagination/types.d.ts.map +1 -1
- package/ebay-panel-dialog/index.js +5 -1
- package/ebay-panel-dialog/panel-dialog.d.ts +1 -1
- package/ebay-panel-dialog/panel-dialog.d.ts.map +1 -1
- package/ebay-panel-dialog/panel-dialog.js +2 -2
- package/ebay-progress-bar/index.js +5 -1
- package/ebay-progress-bar/progress-bar.d.ts +1 -1
- package/ebay-progress-bar/progress-bar.d.ts.map +1 -1
- package/ebay-progress-bar/progress-bar.js +1 -1
- package/ebay-progress-spinner/index.js +5 -1
- package/ebay-progress-spinner/progress-spinner.d.ts +3 -3
- package/ebay-progress-spinner/progress-spinner.d.ts.map +1 -1
- package/ebay-progress-spinner/progress-spinner.js +1 -1
- package/ebay-progress-stepper/ebay-progress-step.d.ts +1 -1
- package/ebay-progress-stepper/ebay-progress-step.d.ts.map +1 -1
- package/ebay-progress-stepper/ebay-progress-step.js +7 -3
- package/ebay-progress-stepper/ebay-progress-stepper.d.ts +1 -1
- package/ebay-progress-stepper/ebay-progress-stepper.d.ts.map +1 -1
- package/ebay-progress-stepper/ebay-progress-stepper.js +8 -4
- package/ebay-progress-stepper/ebay-progress-title.d.ts +1 -1
- package/ebay-progress-stepper/ebay-progress-title.d.ts.map +1 -1
- package/ebay-progress-stepper/ebay-progress-title.js +1 -1
- package/ebay-progress-stepper/index.js +7 -3
- package/ebay-progress-stepper/types.d.ts +2 -2
- package/ebay-progress-stepper/types.d.ts.map +1 -1
- package/ebay-radio/index.js +5 -1
- package/ebay-radio/radio.d.ts +3 -3
- package/ebay-radio/radio.d.ts.map +1 -1
- package/ebay-radio/radio.js +8 -4
- package/ebay-section-notice/index.js +7 -3
- package/ebay-section-notice/section-notice-footer.d.ts +1 -1
- package/ebay-section-notice/section-notice-footer.d.ts.map +1 -1
- package/ebay-section-notice/section-notice-title.d.ts +1 -1
- package/ebay-section-notice/section-notice-title.d.ts.map +1 -1
- package/ebay-section-notice/section-notice.d.ts +2 -2
- package/ebay-section-notice/section-notice.d.ts.map +1 -1
- package/ebay-section-notice/section-notice.js +12 -8
- package/ebay-section-title/cta.d.ts +1 -1
- package/ebay-section-title/cta.d.ts.map +1 -1
- package/ebay-section-title/cta.js +1 -1
- package/ebay-section-title/index.js +9 -5
- package/ebay-section-title/info.d.ts +1 -1
- package/ebay-section-title/info.d.ts.map +1 -1
- package/ebay-section-title/info.js +1 -1
- package/ebay-section-title/overflow.d.ts +1 -1
- package/ebay-section-title/overflow.d.ts.map +1 -1
- package/ebay-section-title/overflow.js +1 -1
- package/ebay-section-title/section-title.d.ts +1 -1
- package/ebay-section-title/section-title.d.ts.map +1 -1
- package/ebay-section-title/section-title.js +5 -5
- package/ebay-section-title/subtitle.d.ts +1 -1
- package/ebay-section-title/subtitle.d.ts.map +1 -1
- package/ebay-section-title/subtitle.js +1 -1
- package/ebay-section-title/title.d.ts +1 -1
- package/ebay-section-title/title.d.ts.map +1 -1
- package/ebay-section-title/title.js +1 -1
- package/ebay-select/ebay-select-option.d.ts +1 -1
- package/ebay-select/ebay-select-option.d.ts.map +1 -1
- package/ebay-select/ebay-select.d.ts +3 -3
- package/ebay-select/ebay-select.d.ts.map +1 -1
- package/ebay-select/ebay-select.js +12 -8
- package/ebay-select/index.js +6 -2
- package/ebay-signal/index.js +5 -1
- package/ebay-signal/signal.d.ts +2 -2
- package/ebay-signal/signal.d.ts.map +1 -1
- package/ebay-signal/signal.js +1 -1
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog-action.d.ts.map +1 -1
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog-action.js +3 -2
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.d.ts +1 -1
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.d.ts.map +1 -1
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.js +14 -9
- package/ebay-snackbar-dialog/index.js +1 -0
- package/ebay-split-button/index.js +11 -3
- package/ebay-split-button/split-button.js +2 -2
- package/ebay-split-button/types.d.ts +3 -3
- package/ebay-split-button/types.d.ts.map +1 -1
- package/ebay-star-rating/index.js +11 -3
- package/ebay-star-rating/star-rating.d.ts +1 -1
- package/ebay-star-rating/star-rating.d.ts.map +1 -1
- package/ebay-star-rating/star-rating.js +2 -2
- package/ebay-star-rating-select/index.js +11 -3
- package/ebay-star-rating-select/star-rating-select.d.ts +2 -2
- package/ebay-star-rating-select/star-rating-select.d.ts.map +1 -1
- package/ebay-star-rating-select/star-rating-select.js +12 -8
- package/ebay-svg/index.js +5 -1
- package/ebay-switch/ebay-switch.d.ts +1 -1
- package/ebay-switch/ebay-switch.d.ts.map +1 -1
- package/ebay-switch/ebay-switch.js +9 -5
- package/ebay-switch/index.js +5 -1
- package/ebay-tabs/index.d.ts +1 -1
- package/ebay-tabs/index.d.ts.map +1 -1
- package/ebay-tabs/index.js +7 -3
- package/ebay-tabs/tab-panel.d.ts +1 -1
- package/ebay-tabs/tab-panel.d.ts.map +1 -1
- package/ebay-tabs/tab-panel.js +1 -1
- package/ebay-tabs/tab.d.ts +1 -1
- package/ebay-tabs/tab.d.ts.map +1 -1
- package/ebay-tabs/tab.js +1 -1
- package/ebay-tabs/tabs.d.ts +2 -14
- package/ebay-tabs/tabs.d.ts.map +1 -1
- package/ebay-tabs/tabs.js +18 -14
- package/ebay-tabs/types.d.ts +16 -2
- package/ebay-tabs/types.d.ts.map +1 -1
- package/ebay-textbox/index.js +7 -3
- package/ebay-textbox/textbox.d.ts +4 -4
- package/ebay-textbox/textbox.d.ts.map +1 -1
- package/ebay-textbox/textbox.js +16 -12
- package/ebay-textbox/types.d.ts +2 -2
- package/ebay-textbox/types.d.ts.map +1 -1
- package/ebay-toast-dialog/components/toast.d.ts +1 -1
- package/ebay-toast-dialog/components/toast.d.ts.map +1 -1
- package/ebay-toast-dialog/components/toast.js +3 -2
- package/ebay-toast-dialog/index.js +5 -1
- package/ebay-tooltip/ebay-tooltip.d.ts +1 -1
- package/ebay-tooltip/ebay-tooltip.d.ts.map +1 -1
- package/ebay-tooltip/ebay-tooltip.js +10 -6
- package/ebay-tooltip/index.js +7 -3
- package/ebay-tourtip/ebay-tourtip-footer.d.ts +1 -1
- package/ebay-tourtip/ebay-tourtip-footer.d.ts.map +1 -1
- package/ebay-tourtip/ebay-tourtip-heading.d.ts +1 -1
- package/ebay-tourtip/ebay-tourtip-heading.d.ts.map +1 -1
- package/ebay-tourtip/ebay-tourtip-heading.js +1 -1
- package/ebay-tourtip/ebay-tourtip.d.ts +1 -1
- package/ebay-tourtip/ebay-tourtip.d.ts.map +1 -1
- package/ebay-tourtip/ebay-tourtip.js +13 -9
- package/ebay-tourtip/index.js +9 -5
- package/ebay-video/controls.js +3 -1
- package/ebay-video/index.js +12 -4
- package/ebay-video/reportButton.js +2 -1
- package/ebay-video/source.d.ts +1 -1
- package/ebay-video/source.d.ts.map +1 -1
- package/ebay-video/types.d.ts +5 -5
- package/ebay-video/types.d.ts.map +1 -1
- package/ebay-video/video.d.ts +3 -3
- package/ebay-video/video.d.ts.map +1 -1
- package/ebay-video/video.js +32 -26
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ComponentProps, FC } from 'react';
|
|
2
2
|
import { EbayChangeEventHandler } from '../common/event-utils/types';
|
|
3
|
-
export
|
|
3
|
+
export type ChangeEventProps = {
|
|
4
4
|
index: number;
|
|
5
5
|
selected: string[];
|
|
6
6
|
wasClicked: boolean;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type EbayListboxButtonProps = Omit<ComponentProps<'input'>, 'onChange'> & {
|
|
9
9
|
selected?: number;
|
|
10
10
|
borderless?: boolean;
|
|
11
11
|
fluid?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox-button.d.ts","sourceRoot":"","sources":["../../src/ebay-listbox-button/listbox-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEV,cAAc,EAAE,EAAE,EACrB,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,sBAAsB,EAAO,MAAM,6BAA6B,CAAA;AAIzE,
|
|
1
|
+
{"version":3,"file":"listbox-button.d.ts","sourceRoot":"","sources":["../../src/ebay-listbox-button/listbox-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEV,cAAc,EAAE,EAAE,EACrB,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,sBAAsB,EAAO,MAAM,6BAA6B,CAAA;AAIzE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IACvE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,sBAAsB,CA8R7C,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -25,7 +29,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
25
29
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
30
|
if (mod && mod.__esModule) return mod;
|
|
27
31
|
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
33
|
__setModuleDefault(result, mod);
|
|
30
34
|
return result;
|
|
31
35
|
};
|
|
@@ -51,11 +55,11 @@ var component_utils_1 = require("../common/component-utils");
|
|
|
51
55
|
var listbox_button_option_1 = __importDefault(require("./listbox-button-option"));
|
|
52
56
|
var ListboxButton = function (_a) {
|
|
53
57
|
var children = _a.children, name = _a.name, value = _a.value, selected = _a.selected, borderless = _a.borderless, fluid = _a.fluid, className = _a.className, maxHeight = _a.maxHeight, prefixId = _a.prefixId, prefixLabel = _a.prefixLabel, floatingLabel = _a.floatingLabel, _b = _a.unselectedText, unselectedText = _b === void 0 ? '-' : _b, _c = _a.onChange, onChange = _c === void 0 ? function () { } : _c, _d = _a.onCollapse, onCollapse = _d === void 0 ? function () { } : _d, _e = _a.onExpand, onExpand = _e === void 0 ? function () { } : _e, rest = __rest(_a, ["children", "name", "value", "selected", "borderless", "fluid", "className", "maxHeight", "prefixId", "prefixLabel", "floatingLabel", "unselectedText", "onChange", "onCollapse", "onExpand"]);
|
|
54
|
-
var optionsContainerRef = react_1.useRef(null);
|
|
55
|
-
var optionsParentContainerRef = react_1.useRef();
|
|
56
|
-
var optionsByIndexRef = react_1.useRef(new Map());
|
|
57
|
-
var buttonRef = react_1.useRef();
|
|
58
|
-
var listBoxButtonOptions = component_utils_1.filterByType(children, listbox_button_option_1.default);
|
|
58
|
+
var optionsContainerRef = (0, react_1.useRef)(null);
|
|
59
|
+
var optionsParentContainerRef = (0, react_1.useRef)();
|
|
60
|
+
var optionsByIndexRef = (0, react_1.useRef)(new Map());
|
|
61
|
+
var buttonRef = (0, react_1.useRef)();
|
|
62
|
+
var listBoxButtonOptions = (0, component_utils_1.filterByType)(children, listbox_button_option_1.default);
|
|
59
63
|
if (!listBoxButtonOptions.length) {
|
|
60
64
|
throw new Error("EbayListboxButton: Please use a\n EbayListboxButtonOption that defines the options of the listbox");
|
|
61
65
|
}
|
|
@@ -73,19 +77,19 @@ var ListboxButton = function (_a) {
|
|
|
73
77
|
// Get the default Selected value and set it in the state
|
|
74
78
|
var _f = getInitialSelectedOption(), selectedOptionFromValue = _f.option, initialSelectedOptionIndex = _f.index;
|
|
75
79
|
// Update the selected option to the state
|
|
76
|
-
var _g = react_1.useState(selectedOptionFromValue), selectedOption = _g[0], setSelectedOption = _g[1];
|
|
77
|
-
var _h = react_1.useState(initialSelectedOptionIndex), selectedIndex = _h[0], setSelectedIndex = _h[1];
|
|
80
|
+
var _g = (0, react_1.useState)(selectedOptionFromValue), selectedOption = _g[0], setSelectedOption = _g[1];
|
|
81
|
+
var _h = (0, react_1.useState)(initialSelectedOptionIndex), selectedIndex = _h[0], setSelectedIndex = _h[1];
|
|
78
82
|
// Update the expanded status to the state
|
|
79
|
-
var _j = react_1.useState(), expanded = _j[0], setExpanded = _j[1];
|
|
83
|
+
var _j = (0, react_1.useState)(), expanded = _j[0], setExpanded = _j[1];
|
|
80
84
|
// Additional flag to avoid multiple re-render when users tries to open and close
|
|
81
|
-
var _k = react_1.useState(false), optionsOpened = _k[0], setOptionsOpened = _k[1];
|
|
82
|
-
var _l = react_1.useState(), wasClicked = _l[0], setWasClicked = _l[1];
|
|
83
|
-
react_1.useEffect(function () {
|
|
85
|
+
var _k = (0, react_1.useState)(false), optionsOpened = _k[0], setOptionsOpened = _k[1];
|
|
86
|
+
var _l = (0, react_1.useState)(), wasClicked = _l[0], setWasClicked = _l[1];
|
|
87
|
+
(0, react_1.useEffect)(function () {
|
|
84
88
|
setSelectedOption(selectedOptionFromValue);
|
|
85
89
|
}, [value]);
|
|
86
90
|
var childrenArray = react_1.Children.toArray(children);
|
|
87
91
|
var getSelectedValueByIndex = function (index) { return childrenArray[index].props.value; };
|
|
88
|
-
var getIndexByValue = react_1.useCallback(function (selectedValue) {
|
|
92
|
+
var getIndexByValue = (0, react_1.useCallback)(function (selectedValue) {
|
|
89
93
|
return childrenArray.findIndex(function (_a) {
|
|
90
94
|
var props = _a.props;
|
|
91
95
|
return props.value === selectedValue;
|
|
@@ -224,7 +228,7 @@ var ListboxButton = function (_a) {
|
|
|
224
228
|
// We want to mimic the select box behavior, so we take the onSelect that passed
|
|
225
229
|
// at the parent level and use it for the OnClick on the list box since it is a fake dropdown
|
|
226
230
|
var updateListBoxButtonOptions = listBoxButtonOptions
|
|
227
|
-
.map(function (child, index) { return react_1.cloneElement(child, {
|
|
231
|
+
.map(function (child, index) { return (0, react_1.cloneElement)(child, {
|
|
228
232
|
index: index,
|
|
229
233
|
key: index,
|
|
230
234
|
selected: selectedOption && child.props.value === selectedOption.props.value,
|
|
@@ -233,8 +237,8 @@ var ListboxButton = function (_a) {
|
|
|
233
237
|
? optionsByIndexRef.current.delete(index)
|
|
234
238
|
: optionsByIndexRef.current.set(index, optionNode); }
|
|
235
239
|
}); });
|
|
236
|
-
var wrapperClassName = classnames_1.default('listbox-button', className, { 'listbox-button--fluid': fluid });
|
|
237
|
-
var buttonClassName = classnames_1.default('btn btn--form', {
|
|
240
|
+
var wrapperClassName = (0, classnames_1.default)('listbox-button', className, { 'listbox-button--fluid': fluid });
|
|
241
|
+
var buttonClassName = (0, classnames_1.default)('btn btn--form', {
|
|
238
242
|
'btn--borderless': borderless,
|
|
239
243
|
'btn--floating-label': floatingLabel && selectedOption
|
|
240
244
|
});
|
|
@@ -244,7 +248,7 @@ var ListboxButton = function (_a) {
|
|
|
244
248
|
prefixLabel && react_1.default.createElement("span", { className: "btn__label" }, prefixLabel),
|
|
245
249
|
react_1.default.createElement("span", { className: "btn__text", id: expandBtnTextId }, (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.props.children) || unselectedText)));
|
|
246
250
|
return (react_1.default.createElement("span", { className: wrapperClassName },
|
|
247
|
-
react_1.default.createElement("button", __assign({}, rest, { type: "button", className: buttonClassName, "aria-expanded": !!expanded, "aria-haspopup": "listbox", "aria-labelledby": prefixId && prefixId
|
|
251
|
+
react_1.default.createElement("button", __assign({}, rest, { type: "button", className: buttonClassName, "aria-expanded": !!expanded, "aria-haspopup": "listbox", "aria-labelledby": prefixId && "".concat(prefixId, " ").concat(expandBtnTextId), onClick: onButtonClick,
|
|
248
252
|
// https://stackoverflow.com/questions/17769005/onclick-and-onblur-ordering-issue
|
|
249
253
|
onMouseDown: function (e) { return e.preventDefault(); }, onKeyUp: onButtonKeyup, ref: buttonRef }),
|
|
250
254
|
react_1.default.createElement("span", { className: "btn__cell" },
|
package/ebay-menu/index.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
18
|
};
|
|
12
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.EbayMenuSeparator = exports.EbayMenuItem = exports.EbayMenu = void 0;
|
|
13
21
|
var menu_1 = require("./menu");
|
|
14
|
-
Object.defineProperty(exports, "EbayMenu", { enumerable: true, get: function () { return menu_1.default; } });
|
|
22
|
+
Object.defineProperty(exports, "EbayMenu", { enumerable: true, get: function () { return __importDefault(menu_1).default; } });
|
|
15
23
|
var menu_item_1 = require("./menu-item");
|
|
16
|
-
Object.defineProperty(exports, "EbayMenuItem", { enumerable: true, get: function () { return menu_item_1.default; } });
|
|
24
|
+
Object.defineProperty(exports, "EbayMenuItem", { enumerable: true, get: function () { return __importDefault(menu_item_1).default; } });
|
|
17
25
|
var menu_item_separator_1 = require("./menu-item-separator");
|
|
18
|
-
Object.defineProperty(exports, "EbayMenuSeparator", { enumerable: true, get: function () { return menu_item_separator_1.default; } });
|
|
26
|
+
Object.defineProperty(exports, "EbayMenuSeparator", { enumerable: true, get: function () { return __importDefault(menu_item_separator_1).default; } });
|
|
19
27
|
__exportStar(require("./types"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item-separator.d.ts","sourceRoot":"","sources":["../../src/ebay-menu/menu-item-separator.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAGjD,
|
|
1
|
+
{"version":3,"file":"menu-item-separator.d.ts","sourceRoot":"","sources":["../../src/ebay-menu/menu-item-separator.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAGjD,KAAK,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;AAEjC,QAAA,MAAM,qBAAqB,EAAE,EAAE,CAAC,KAAK,CASpC,CAAA;AAED,eAAe,qBAAqB,CAAA"}
|
|
@@ -29,6 +29,6 @@ var react_1 = __importDefault(require("react"));
|
|
|
29
29
|
var classnames_1 = __importDefault(require("classnames"));
|
|
30
30
|
var EbayMenuItemSeparator = function (_a) {
|
|
31
31
|
var className = _a.className, rest = __rest(_a, ["className"]);
|
|
32
|
-
return (react_1.default.createElement("hr", __assign({}, rest, { className: classnames_1.default(className, 'menu__separator'), role: "separator" })));
|
|
32
|
+
return (react_1.default.createElement("hr", __assign({}, rest, { className: (0, classnames_1.default)(className, 'menu__separator'), role: "separator" })));
|
|
33
33
|
};
|
|
34
34
|
exports.default = EbayMenuItemSeparator;
|
package/ebay-menu/menu-item.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, FC } from 'react';
|
|
2
2
|
import { EbayMenuType } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type MenuItemProps = ComponentProps<'div'> & {
|
|
4
4
|
type?: EbayMenuType;
|
|
5
5
|
focused?: boolean;
|
|
6
6
|
tabIndex?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../src/ebay-menu/menu-item.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAA;AAIpE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,
|
|
1
|
+
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../src/ebay-menu/menu-item.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAA;AAIpE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAChD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,aAAa,CAyCnC,CAAA;AAUD,eAAe,YAAY,CAAA"}
|
package/ebay-menu/menu-item.js
CHANGED
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -25,7 +29,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
25
29
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
30
|
if (mod && mod.__esModule) return mod;
|
|
27
31
|
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
33
|
__setModuleDefault(result, mod);
|
|
30
34
|
return result;
|
|
31
35
|
};
|
|
@@ -50,15 +54,15 @@ var ebay_badge_1 = require("../ebay-badge");
|
|
|
50
54
|
var ebay_icon_1 = require("../ebay-icon");
|
|
51
55
|
var EbayMenuItem = function (_a) {
|
|
52
56
|
var className = _a.className, checked = _a.checked, type = _a.type, _b = _a.focused, focused = _b === void 0 ? false : _b, tabIndex = _a.tabIndex, disabled = _a.disabled, badgeNumber = _a.badgeNumber, badgeAriaLabel = _a.badgeAriaLabel, children = _a.children, rest = __rest(_a, ["className", "checked", "type", "focused", "tabIndex", "disabled", "badgeNumber", "badgeAriaLabel", "children"]);
|
|
53
|
-
var ref = react_1.useRef(null);
|
|
57
|
+
var ref = (0, react_1.useRef)(null);
|
|
54
58
|
var hasBadge = badgeNumber !== undefined;
|
|
55
|
-
react_1.useEffect(function () {
|
|
59
|
+
(0, react_1.useEffect)(function () {
|
|
56
60
|
if (ref.current && focused) {
|
|
57
61
|
ref.current.focus();
|
|
58
62
|
}
|
|
59
63
|
}, [ref, focused]);
|
|
60
64
|
var checkable = ['radio', 'checkbox'];
|
|
61
|
-
return (react_1.default.createElement("div", __assign({ "aria-label": badgeAriaLabel }, rest, { ref: ref, className: classnames_1.default(className, 'menu__item', hasBadge && 'menu__item--badged'), role: roleFromType(type), "aria-checked": checkable.includes(type) ? checked : undefined, "aria-disabled": disabled, tabIndex: focused ? 0 : tabIndex }),
|
|
65
|
+
return (react_1.default.createElement("div", __assign({ "aria-label": badgeAriaLabel }, rest, { ref: ref, className: (0, classnames_1.default)(className, 'menu__item', hasBadge && 'menu__item--badged'), role: roleFromType(type), "aria-checked": checkable.includes(type) ? checked : undefined, "aria-disabled": disabled, tabIndex: focused ? 0 : tabIndex }),
|
|
62
66
|
react_1.default.createElement("span", { "aria-hidden": hasBadge },
|
|
63
67
|
children,
|
|
64
68
|
hasBadge && react_1.default.createElement(ebay_badge_1.EbayBadge, { type: "menu", number: badgeNumber })),
|
package/ebay-menu/menu.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EbayMenuProps } from './index';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<EbayMenuProps, "slot" | "style" | "title" | "type" | "key" | "className" | "placeholder" | "children" | "
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<EbayMenuProps, "slot" | "style" | "title" | "forwardedRef" | "type" | "key" | "className" | "placeholder" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "checked" | "baseEl" | "priority" | "autofocus"> & React.RefAttributes<React.FC<EbayMenuProps>>>;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=menu.d.ts.map
|
package/ebay-menu/menu.js
CHANGED
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -25,7 +29,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
25
29
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
30
|
if (mod && mod.__esModule) return mod;
|
|
27
31
|
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
33
|
__setModuleDefault(result, mod);
|
|
30
34
|
return result;
|
|
31
35
|
};
|
|
@@ -40,12 +44,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
40
44
|
}
|
|
41
45
|
return t;
|
|
42
46
|
};
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
48
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
49
|
+
if (ar || !(i in from)) {
|
|
50
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
51
|
+
ar[i] = from[i];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
49
55
|
};
|
|
50
56
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
57
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -60,15 +66,15 @@ var index_1 = require("./index");
|
|
|
60
66
|
var EbayMenu = function (_a) {
|
|
61
67
|
var _b = _a.baseEl, Container = _b === void 0 ? 'span' : _b, type = _a.type, _c = _a.priority, priority = _c === void 0 ? 'secondary' : _c, checked = _a.checked, className = _a.className, autofocus = _a.autofocus, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.onKeyDown, onKeyDown = _e === void 0 ? function () { } : _e, _f = _a.onChange, onChange = _f === void 0 ? function () { } : _f, _g = _a.onSelect, onSelect = _g === void 0 ? function () { } : _g, forwardedRef = _a.forwardedRef, children = _a.children, rest = __rest(_a, ["baseEl", "type", "priority", "checked", "className", "autofocus", "onClick", "onKeyDown", "onChange", "onSelect", "forwardedRef", "children"]);
|
|
62
68
|
var childrenArray = react_1.Children.toArray(children);
|
|
63
|
-
var _h = use_roving_index_1.default(children, index_1.EbayMenuItem, autofocus === true ? 0 : undefined), focusedIndex = _h[0], setFocusedIndex = _h[1];
|
|
64
|
-
var _j = react_1.useState(childrenArray.map(function () { return false; })), checkedIndexes = _j[0], setCheckedIndexes = _j[1];
|
|
69
|
+
var _h = (0, use_roving_index_1.default)(children, index_1.EbayMenuItem, autofocus === true ? 0 : undefined), focusedIndex = _h[0], setFocusedIndex = _h[1];
|
|
70
|
+
var _j = (0, react_1.useState)(childrenArray.map(function () { return false; })), checkedIndexes = _j[0], setCheckedIndexes = _j[1];
|
|
65
71
|
var valuesFromChecked = function (indexes) {
|
|
66
72
|
return childrenArray.reduce(function (values, item, i) {
|
|
67
|
-
return indexes[i] ?
|
|
73
|
+
return indexes[i] ? __spreadArray(__spreadArray([], values, true), [item.props.value], false) : values;
|
|
68
74
|
}, []);
|
|
69
75
|
};
|
|
70
76
|
var indexesFromChecked = function (indexes) {
|
|
71
|
-
return indexes.reduce(function (all, value, i) { return value ?
|
|
77
|
+
return indexes.reduce(function (all, value, i) { return value ? __spreadArray(__spreadArray([], all, true), [i], false) : all; }, []);
|
|
72
78
|
};
|
|
73
79
|
var eventProps = function (index, indexes) { return ({
|
|
74
80
|
index: index,
|
|
@@ -103,7 +109,7 @@ var EbayMenu = function (_a) {
|
|
|
103
109
|
return checkedIndexes.map(function (_, i) { return i === index; });
|
|
104
110
|
}
|
|
105
111
|
};
|
|
106
|
-
react_1.useEffect(function () {
|
|
112
|
+
(0, react_1.useEffect)(function () {
|
|
107
113
|
if (type === 'radio') {
|
|
108
114
|
if (checked === undefined) {
|
|
109
115
|
var checkedIndex = childrenArray.findIndex(function (child) { return child.props.checked; });
|
|
@@ -130,7 +136,7 @@ var EbayMenu = function (_a) {
|
|
|
130
136
|
};
|
|
131
137
|
var handleKeyDown = function (e, index) {
|
|
132
138
|
var newValues;
|
|
133
|
-
if (event_utils_1.isActionKey(e.key)) {
|
|
139
|
+
if ((0, event_utils_1.isActionKey)(e.key)) {
|
|
134
140
|
newValues = selectIndex(index);
|
|
135
141
|
if (newValues) {
|
|
136
142
|
handleChange(e, index, newValues);
|
|
@@ -151,10 +157,10 @@ var EbayMenu = function (_a) {
|
|
|
151
157
|
handleChange(e, index, newValues);
|
|
152
158
|
}
|
|
153
159
|
};
|
|
154
|
-
return (react_1.default.createElement(Container, __assign({}, rest, { className: classnames_1.default(className, 'menu') }),
|
|
160
|
+
return (react_1.default.createElement(Container, __assign({}, rest, { className: (0, classnames_1.default)(className, 'menu') }),
|
|
155
161
|
react_1.default.createElement("div", { className: "menu__items", role: "menu", ref: forwardedRef }, childrenArray.map(function (child, i) {
|
|
156
162
|
var _a = child.props, _b = _a.onClick, onItemClick = _b === void 0 ? function () { } : _b, _c = _a.onFocus, onItemFocus = _c === void 0 ? function () { } : _c, _d = _a.onKeyDown, onItemKeyDown = _d === void 0 ? function () { } : _d, itemRest = __rest(_a, ["onClick", "onFocus", "onKeyDown"]);
|
|
157
|
-
return react_1.cloneElement(child, __assign(__assign({}, itemRest), { type: type, focused: i === focusedIndex, tabIndex: focusedIndex === undefined ? 0 : -1, checked: checkedIndexes[i], onFocus: function (e) {
|
|
163
|
+
return (0, react_1.cloneElement)(child, __assign(__assign({}, itemRest), { type: type, focused: i === focusedIndex, tabIndex: focusedIndex === undefined ? 0 : -1, checked: checkedIndexes[i], onFocus: function (e) {
|
|
158
164
|
setFocusedIndex(i);
|
|
159
165
|
onItemFocus(e);
|
|
160
166
|
}, onClick: function (e) {
|
|
@@ -167,4 +173,4 @@ var EbayMenu = function (_a) {
|
|
|
167
173
|
} }));
|
|
168
174
|
}))));
|
|
169
175
|
};
|
|
170
|
-
exports.default = component_utils_1.withForwardRef(EbayMenu);
|
|
176
|
+
exports.default = (0, component_utils_1.withForwardRef)(EbayMenu);
|
package/ebay-menu/types.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ComponentProps, Ref } from 'react';
|
|
2
2
|
import { EbayEventHandler, EbayKeyboardEventHandler } from '../common/event-utils/types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export type EbayMenuType = 'radio' | 'checkbox';
|
|
4
|
+
export type EbayMenuPriority = 'primary' | 'secondary' | 'none';
|
|
5
|
+
type ContainerDivProps = Omit<ComponentProps<'div'>, 'onKeyDown' | 'onChange' | 'onSelect'>;
|
|
6
|
+
type ContainerSpanProps = Omit<ComponentProps<'span'>, 'onKeyDown' | 'onChange' | 'onSelect'>;
|
|
7
|
+
type SelectProps = {
|
|
8
8
|
index: number;
|
|
9
9
|
checked: number[];
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type ChangeProps = SelectProps & {
|
|
12
12
|
indexes: number[];
|
|
13
13
|
checkedValues: string[];
|
|
14
14
|
};
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
15
|
+
export type EbayMenuKeyDownEventHandler = EbayKeyboardEventHandler<HTMLElement, SelectProps | ChangeProps>;
|
|
16
|
+
export type EbayMenuChangeEventHandler = EbayEventHandler<HTMLElement, ChangeProps>;
|
|
17
|
+
export type EbayMenuSelectEventHandler = EbayEventHandler<HTMLElement, SelectProps>;
|
|
18
|
+
export type EbayMenuProps = ContainerDivProps & ContainerSpanProps & {
|
|
19
19
|
type?: EbayMenuType;
|
|
20
20
|
priority?: EbayMenuPriority;
|
|
21
21
|
checked?: number;
|
package/ebay-menu/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAExF,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAExF,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAA;AAC/C,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAA;AAE/D,KAAK,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC,CAAA;AAC3F,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC,CAAA;AAC7F,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAA;AACD,KAAK,WAAW,GAAG,WAAW,GAAG;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAAC,CAAA;AAC1G,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;AACnF,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;AACnF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,kBAAkB,GAAG;IACjE,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,2BAA2B,CAAC;IACxC,QAAQ,CAAC,EAAE,0BAA0B,CAAC;IACtC,QAAQ,CAAC,EAAE,0BAA0B,CAAC;IACtC,YAAY,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CACtC,CAAA"}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
18
|
};
|
|
12
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.EbayMenuButtonLabel = exports.EbayMenuButtonSeparator = exports.EbayMenuButtonItem = exports.EbayMenuButton = void 0;
|
|
13
21
|
var menu_button_1 = require("./menu-button");
|
|
14
|
-
Object.defineProperty(exports, "EbayMenuButton", { enumerable: true, get: function () { return menu_button_1.default; } });
|
|
22
|
+
Object.defineProperty(exports, "EbayMenuButton", { enumerable: true, get: function () { return __importDefault(menu_button_1).default; } });
|
|
15
23
|
var menu_button_item_1 = require("./menu-button-item");
|
|
16
|
-
Object.defineProperty(exports, "EbayMenuButtonItem", { enumerable: true, get: function () { return menu_button_item_1.default; } });
|
|
24
|
+
Object.defineProperty(exports, "EbayMenuButtonItem", { enumerable: true, get: function () { return __importDefault(menu_button_item_1).default; } });
|
|
17
25
|
var menu_button_separator_1 = require("./menu-button-separator");
|
|
18
|
-
Object.defineProperty(exports, "EbayMenuButtonSeparator", { enumerable: true, get: function () { return menu_button_separator_1.default; } });
|
|
26
|
+
Object.defineProperty(exports, "EbayMenuButtonSeparator", { enumerable: true, get: function () { return __importDefault(menu_button_separator_1).default; } });
|
|
19
27
|
var menu_button_label_1 = require("./menu-button-label");
|
|
20
|
-
Object.defineProperty(exports, "EbayMenuButtonLabel", { enumerable: true, get: function () { return menu_button_label_1.default; } });
|
|
28
|
+
Object.defineProperty(exports, "EbayMenuButtonLabel", { enumerable: true, get: function () { return __importDefault(menu_button_label_1).default; } });
|
|
21
29
|
__exportStar(require("./types"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, FC } from 'react';
|
|
2
|
-
|
|
2
|
+
type Props = ComponentProps<'hr'>;
|
|
3
3
|
declare const EbayMenuButtonSeparator: FC<Props>;
|
|
4
4
|
export default EbayMenuButtonSeparator;
|
|
5
5
|
//# sourceMappingURL=menu-button-separator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-button-separator.d.ts","sourceRoot":"","sources":["../../src/ebay-menu-button/menu-button-separator.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAGjD,
|
|
1
|
+
{"version":3,"file":"menu-button-separator.d.ts","sourceRoot":"","sources":["../../src/ebay-menu-button/menu-button-separator.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAGjD,KAAK,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;AAEjC,QAAA,MAAM,uBAAuB,EAAE,EAAE,CAAC,KAAK,CAStC,CAAA;AAED,eAAe,uBAAuB,CAAA"}
|
|
@@ -29,6 +29,6 @@ var react_1 = __importDefault(require("react"));
|
|
|
29
29
|
var classnames_1 = __importDefault(require("classnames"));
|
|
30
30
|
var EbayMenuButtonSeparator = function (_a) {
|
|
31
31
|
var className = _a.className, rest = __rest(_a, ["className"]);
|
|
32
|
-
return (react_1.default.createElement("hr", __assign({}, rest, { className: classnames_1.default(className, 'menu-button__separator'), role: "separator" })));
|
|
32
|
+
return (react_1.default.createElement("hr", __assign({}, rest, { className: (0, classnames_1.default)(className, 'menu-button__separator'), role: "separator" })));
|
|
33
33
|
};
|
|
34
34
|
exports.default = EbayMenuButtonSeparator;
|
|
@@ -2,7 +2,7 @@ import { ComponentProps, FC } from 'react';
|
|
|
2
2
|
import { EbayMenuChangeEventHandler, EbayMenuSelectEventHandler, EbayMenuType } from '../ebay-menu';
|
|
3
3
|
import { EbayButtonProps } from '../ebay-button';
|
|
4
4
|
import { EbayMenuButtonVariant } from './index';
|
|
5
|
-
export
|
|
5
|
+
export type EbayMenuButtonProps = {
|
|
6
6
|
a11yText?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
fixWidth?: boolean;
|
|
@@ -21,8 +21,8 @@ export declare type EbayMenuButtonProps = {
|
|
|
21
21
|
prefixId?: string;
|
|
22
22
|
prefixLabel?: string;
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
type MenuEvents = 'onSelect' | 'onChange';
|
|
25
|
+
type Props = Omit<EbayButtonProps, 'type' | 'variant' | 'onKeyDown'> & Omit<ComponentProps<'button'>, 'type' | MenuEvents> & Omit<ComponentProps<'a'>, MenuEvents> & EbayMenuButtonProps;
|
|
26
26
|
declare const EbayMenuButton: FC<Props>;
|
|
27
27
|
export default EbayMenuButton;
|
|
28
28
|
//# sourceMappingURL=menu-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-button.d.ts","sourceRoot":"","sources":["../../src/ebay-menu-button/menu-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,cAAc,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAA;AAM5F,OAAO,EAAY,0BAA0B,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC7G,OAAO,EAAc,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAG5D,OAAO,EAAoE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEjH,
|
|
1
|
+
{"version":3,"file":"menu-button.d.ts","sourceRoot":"","sources":["../../src/ebay-menu-button/menu-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,cAAc,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAA;AAM5F,OAAO,EAAY,0BAA0B,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC7G,OAAO,EAAc,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAG5D,OAAO,EAAoE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEjH,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,0BAA0B,CAAC;IACtC,QAAQ,CAAC,EAAE,0BAA0B,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAA;AAED,KAAK,UAAU,GAAG,UAAU,GAAG,UAAU,CAAA;AACzC,KAAK,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC,GAChE,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,GACnD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,GACrC,mBAAmB,CAAA;AAEvB,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,CA6I7B,CAAA;AAaD,eAAe,cAAc,CAAA"}
|
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -25,7 +29,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
25
29
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
30
|
if (mod && mod.__esModule) return mod;
|
|
27
31
|
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
33
|
__setModuleDefault(result, mod);
|
|
30
34
|
return result;
|
|
31
35
|
};
|
|
@@ -56,23 +60,23 @@ var ebay_icon_1 = require("../ebay-icon");
|
|
|
56
60
|
var index_1 = require("./index");
|
|
57
61
|
var EbayMenuButton = function (_a) {
|
|
58
62
|
var type = _a.type, _b = _a.variant, variant = _b === void 0 ? 'button' : _b, className = _a.className, _c = _a.text, text = _c === void 0 ? '' : _c, fixWidth = _a.fixWidth, reverse = _a.reverse, defaultExpanded = _a.expanded, noToggleIcon = _a.noToggleIcon, checked = _a.checked, collapseOnSelect = _a.collapseOnSelect, a11yText = _a.a11yText, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.onExpand, onExpand = _e === void 0 ? function () { } : _e, _f = _a.onCollapse, onCollapse = _f === void 0 ? function () { } : _f, _g = _a.onChange, onChange = _g === void 0 ? function () { } : _g, _h = _a.onSelect, onSelect = _h === void 0 ? function () { } : _h, children = _a.children, rest = __rest(_a, ["type", "variant", "className", "text", "fixWidth", "reverse", "expanded", "noToggleIcon", "checked", "collapseOnSelect", "a11yText", "onClick", "onExpand", "onCollapse", "onChange", "onSelect", "children"]);
|
|
59
|
-
var _j = react_1.useState(defaultExpanded), expanded = _j[0], setExpanded = _j[1];
|
|
60
|
-
var _k = react_1.useState(), menuId = _k[0], setMenuId = _k[1];
|
|
61
|
-
var buttonRef = react_1.useRef(null);
|
|
62
|
-
var menuRef = react_1.useRef();
|
|
63
|
-
var menuItems = component_utils_1.filterByType(children, [index_1.EbayMenuButtonItem, index_1.EbayMenuButtonSeparator]);
|
|
63
|
+
var _j = (0, react_1.useState)(defaultExpanded), expanded = _j[0], setExpanded = _j[1];
|
|
64
|
+
var _k = (0, react_1.useState)(), menuId = _k[0], setMenuId = _k[1];
|
|
65
|
+
var buttonRef = (0, react_1.useRef)(null);
|
|
66
|
+
var menuRef = (0, react_1.useRef)();
|
|
67
|
+
var menuItems = (0, component_utils_1.filterByType)(children, [index_1.EbayMenuButtonItem, index_1.EbayMenuButtonSeparator]);
|
|
64
68
|
var defaultIndexes = menuItems.map(function (item) { return Boolean(item.props.checked); });
|
|
65
|
-
var _l = react_1.useState(defaultIndexes), checkedIndexes = _l[0], setCheckedIndexes = _l[1];
|
|
66
|
-
var menuButtonLabel = component_utils_1.findComponent(children, index_1.EbayMenuButtonLabel);
|
|
67
|
-
var icon = component_utils_1.findComponent(children, ebay_icon_1.EbayIcon);
|
|
69
|
+
var _l = (0, react_1.useState)(defaultIndexes), checkedIndexes = _l[0], setCheckedIndexes = _l[1];
|
|
70
|
+
var menuButtonLabel = (0, component_utils_1.findComponent)(children, index_1.EbayMenuButtonLabel);
|
|
71
|
+
var icon = (0, component_utils_1.findComponent)(children, ebay_icon_1.EbayIcon);
|
|
68
72
|
var textLabel = text ? react_1.default.createElement("span", null, text) : null;
|
|
69
73
|
var label = labelWithIcon(menuButtonLabel || textLabel, icon);
|
|
70
|
-
var wrapperClasses = classnames_1.default('menu-button', className);
|
|
71
|
-
var menuClasses = classnames_1.default('menu-button__menu', {
|
|
74
|
+
var wrapperClasses = (0, classnames_1.default)('menu-button', className);
|
|
75
|
+
var menuClasses = (0, classnames_1.default)('menu-button__menu', {
|
|
72
76
|
'menu-button__menu--fix-width': fixWidth,
|
|
73
77
|
'menu-button__menu--reverse': reverse
|
|
74
78
|
});
|
|
75
|
-
react_1.useEffect(function () {
|
|
79
|
+
(0, react_1.useEffect)(function () {
|
|
76
80
|
var handleBackgroundClick = function (e) {
|
|
77
81
|
var menuEl = menuRef.current;
|
|
78
82
|
var menuClicked = menuEl && menuEl.contains(e.target);
|
|
@@ -95,11 +99,11 @@ var EbayMenuButton = function (_a) {
|
|
|
95
99
|
}
|
|
96
100
|
return function () { return document.removeEventListener('click', handleBackgroundClick, false); };
|
|
97
101
|
}, [expanded]);
|
|
98
|
-
react_1.useEffect(function () {
|
|
99
|
-
setMenuId(random_id_1.randomId());
|
|
102
|
+
(0, react_1.useEffect)(function () {
|
|
103
|
+
setMenuId((0, random_id_1.randomId)());
|
|
100
104
|
}, []);
|
|
101
105
|
var handleMenuKeydown = function (e) {
|
|
102
|
-
event_utils_1.handleEscapeKeydown(e, function () {
|
|
106
|
+
(0, event_utils_1.handleEscapeKeydown)(e, function () {
|
|
103
107
|
var _a;
|
|
104
108
|
setExpanded(false);
|
|
105
109
|
(_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -126,7 +130,7 @@ var EbayMenuButton = function (_a) {
|
|
|
126
130
|
react_1.default.createElement(ebay_button_1.EbayButton, __assign({ variant: variant === 'form' ? 'form' : undefined, bodyState: noToggleIcon ? undefined : 'expand' }, buttonProps), label),
|
|
127
131
|
expanded &&
|
|
128
132
|
react_1.default.createElement(ebay_menu_1.EbayMenu, { baseEl: "div", ref: menuRef, type: type, className: menuClasses, tabIndex: -1, id: menuId, autofocus: true, checked: checkedIndex(), onKeyDown: handleMenuKeydown, onChange: handleOnChange, onSelect: onSelect }, menuItems.map(function (item, i) {
|
|
129
|
-
return react_1.cloneElement(item, __assign(__assign({}, item.props), { className: classnames_1.default(item.props.className, 'menu-button__item'), key: i, checked: checkedIndexes[i] }));
|
|
133
|
+
return (0, react_1.cloneElement)(item, __assign(__assign({}, item.props), { className: (0, classnames_1.default)(item.props.className, 'menu-button__item'), key: i, checked: checkedIndexes[i] }));
|
|
130
134
|
}))));
|
|
131
135
|
};
|
|
132
136
|
function labelWithIcon(label, icon) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type EbayMenuButtonVariant = 'overflow' | 'form' | 'button';
|
|
2
2
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-menu-button/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-menu-button/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAA"}
|