@momentum-design/components 0.134.20 → 0.134.22
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/dist/browser/index.js +481 -458
- package/dist/browser/index.js.map +4 -4
- package/dist/components/accordion/accordion.component.d.ts +15 -5
- package/dist/components/accordionbutton/accordionbutton.component.d.ts +14 -26
- package/dist/components/accordionbutton/accordionbutton.component.js +0 -22
- package/dist/components/accordiongroup/accordiongroup.component.d.ts +12 -16
- package/dist/components/accordiongroup/accordiongroup.component.js +0 -14
- package/dist/components/alertchip/alertchip.component.d.ts +15 -11
- package/dist/components/alertchip/alertchip.component.js +0 -7
- package/dist/components/animation/animation.component.d.ts +14 -6
- package/dist/components/animation/animation.component.js +0 -5
- package/dist/components/announcementdialog/announcementdialog.component.d.ts +18 -25
- package/dist/components/announcementdialog/announcementdialog.component.js +1 -20
- package/dist/components/appheader/appheader.component.d.ts +13 -12
- package/dist/components/appheader/appheader.component.js +0 -9
- package/dist/components/avatar/avatar.component.d.ts +14 -34
- package/dist/components/avatar/avatar.component.js +1 -31
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +15 -14
- package/dist/components/avatarbutton/avatarbutton.component.js +1 -10
- package/dist/components/badge/badge.component.d.ts +16 -20
- package/dist/components/badge/badge.component.js +1 -17
- package/dist/components/banner/banner.component.d.ts +17 -17
- package/dist/components/banner/banner.component.js +1 -13
- package/dist/components/brandvisual/brandvisual.component.d.ts +15 -12
- package/dist/components/brandvisual/brandvisual.component.js +0 -10
- package/dist/components/bullet/bullet.component.d.ts +15 -16
- package/dist/components/bullet/bullet.component.js +0 -15
- package/dist/components/button/button.component.d.ts +21 -52
- package/dist/components/button/button.component.js +1 -47
- package/dist/components/buttongroup/buttongroup.component.d.ts +17 -20
- package/dist/components/buttongroup/buttongroup.component.js +0 -17
- package/dist/components/buttonlink/buttonlink.component.d.ts +19 -16
- package/dist/components/buttonlink/buttonlink.component.js +1 -11
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +16 -25
- package/dist/components/buttonsimple/buttonsimple.component.js +0 -22
- package/dist/components/calendar/calendar.component.d.ts +17 -11
- package/dist/components/calendar/calendar.component.js +0 -8
- package/dist/components/card/card.component.d.ts +18 -17
- package/dist/components/card/card.component.js +0 -13
- package/dist/components/cardbutton/cardbutton.component.d.ts +20 -14
- package/dist/components/cardbutton/cardbutton.component.js +0 -9
- package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +20 -19
- package/dist/components/cardcheckbox/cardcheckbox.component.js +0 -14
- package/dist/components/cardradio/cardradio.component.d.ts +20 -20
- package/dist/components/cardradio/cardradio.component.js +0 -15
- package/dist/components/checkbox/checkbox.component.d.ts +22 -26
- package/dist/components/checkbox/checkbox.component.js +1 -22
- package/dist/components/chip/chip.component.d.ts +20 -13
- package/dist/components/chip/chip.component.js +0 -9
- package/dist/components/coachmark/coachmark.component.d.ts +22 -22
- package/dist/components/coachmark/coachmark.component.js +1 -18
- package/dist/components/combobox/combobox.component.d.ts +27 -37
- package/dist/components/combobox/combobox.component.js +1 -32
- package/dist/components/controltypeprovider/controltypeprovider.component.d.ts +19 -11
- package/dist/components/controltypeprovider/controltypeprovider.component.js +0 -10
- package/dist/components/datepicker/datepicker.component.d.ts +25 -14
- package/dist/components/datepicker/datepicker.component.js +96 -35
- package/dist/components/dialog/dialog.component.d.ts +25 -40
- package/dist/components/dialog/dialog.component.js +1 -35
- package/dist/components/divider/divider.component.d.ts +23 -25
- package/dist/components/divider/divider.component.js +0 -23
- package/dist/components/filterchip/filterchip.component.d.ts +20 -9
- package/dist/components/filterchip/filterchip.component.js +0 -5
- package/dist/components/formfieldgroup/formfieldgroup.component.d.ts +18 -19
- package/dist/components/formfieldgroup/formfieldgroup.component.js +0 -15
- package/dist/components/formfieldwrapper/formfieldwrapper.component.d.ts +16 -8
- package/dist/components/formfieldwrapper/formfieldwrapper.component.js +0 -4
- package/dist/components/icon/icon.component.d.ts +16 -41
- package/dist/components/icon/icon.component.js +0 -39
- package/dist/components/iconprovider/iconprovider.component.d.ts +14 -24
- package/dist/components/iconprovider/iconprovider.component.js +0 -23
- package/dist/components/illustration/illustration.component.d.ts +16 -32
- package/dist/components/illustration/illustration.component.js +0 -30
- package/dist/components/illustrationprovider/illustrationprovider.component.d.ts +14 -24
- package/dist/components/illustrationprovider/illustrationprovider.component.js +0 -23
- package/dist/components/input/input.component.d.ts +21 -16
- package/dist/components/input/input.component.js +0 -11
- package/dist/components/inputchip/inputchip.component.d.ts +19 -13
- package/dist/components/inputchip/inputchip.component.js +0 -7
- package/dist/components/link/link.component.d.ts +18 -12
- package/dist/components/link/link.component.js +1 -9
- package/dist/components/linkbutton/linkbutton.component.d.ts +19 -12
- package/dist/components/linkbutton/linkbutton.component.js +1 -8
- package/dist/components/linksimple/linksimple.component.d.ts +17 -10
- package/dist/components/linksimple/linksimple.component.js +0 -7
- package/dist/components/list/list.component.d.ts +17 -7
- package/dist/components/list/list.component.js +0 -5
- package/dist/components/listbox/listbox.component.d.ts +21 -16
- package/dist/components/listbox/listbox.component.js +1 -11
- package/dist/components/listheader/listheader.component.d.ts +14 -6
- package/dist/components/listheader/listheader.component.js +0 -3
- package/dist/components/listitem/listitem.component.d.ts +20 -18
- package/dist/components/listitem/listitem.component.js +0 -13
- package/dist/components/marker/marker.component.d.ts +15 -16
- package/dist/components/marker/marker.component.js +0 -15
- package/dist/components/menubar/menubar.component.d.ts +12 -19
- package/dist/components/menubar/menubar.component.js +2 -20
- package/dist/components/menuitem/menuitem.component.d.ts +18 -19
- package/dist/components/menuitem/menuitem.component.js +1 -15
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +19 -30
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +1 -25
- package/dist/components/menuitemradio/menuitemradio.component.d.ts +18 -31
- package/dist/components/menuitemradio/menuitemradio.component.js +1 -26
- package/dist/components/menupopover/menupopover.component.d.ts +17 -39
- package/dist/components/menupopover/menupopover.component.js +4 -38
- package/dist/components/menusection/menusection.component.d.ts +16 -12
- package/dist/components/menusection/menusection.component.js +0 -8
- package/dist/components/navmenuitem/navmenuitem.component.d.ts +47 -16
- package/dist/components/navmenuitem/navmenuitem.component.js +146 -20
- package/dist/components/navmenuitem/navmenuitem.constants.d.ts +1 -0
- package/dist/components/navmenuitem/navmenuitem.constants.js +1 -0
- package/dist/components/navmenuitem/navmenuitem.styles.js +16 -5
- package/dist/components/optgroup/optgroup.component.d.ts +17 -7
- package/dist/components/optgroup/optgroup.component.js +1 -3
- package/dist/components/option/option.component.d.ts +17 -19
- package/dist/components/option/option.component.js +1 -15
- package/dist/components/password/password.component.d.ts +18 -17
- package/dist/components/password/password.component.js +0 -11
- package/dist/components/popover/popover.component.d.ts +20 -52
- package/dist/components/popover/popover.component.js +1 -47
- package/dist/components/presence/presence.component.d.ts +17 -10
- package/dist/components/presence/presence.component.js +1 -7
- package/dist/components/progressbar/progressbar.component.d.ts +17 -13
- package/dist/components/progressbar/progressbar.component.js +0 -9
- package/dist/components/progressspinner/progressspinner.component.d.ts +14 -19
- package/dist/components/progressspinner/progressspinner.component.js +0 -17
- package/dist/components/radio/radio.component.d.ts +19 -41
- package/dist/components/radio/radio.component.js +1 -37
- package/dist/components/radiogroup/radiogroup.component.d.ts +12 -5
- package/dist/components/radiogroup/radiogroup.component.js +0 -4
- package/dist/components/responsivesettingsprovider/responsivesettingsprovider.component.d.ts +11 -29
- package/dist/components/responsivesettingsprovider/responsivesettingsprovider.component.js +0 -29
- package/dist/components/screenreaderannouncer/screenreaderannouncer.component.d.ts +12 -51
- package/dist/components/screenreaderannouncer/screenreaderannouncer.component.js +0 -51
- package/dist/components/searchfield/searchfield.component.d.ts +16 -24
- package/dist/components/searchfield/searchfield.component.js +0 -20
- package/dist/components/searchpopover/searchpopover.component.d.ts +16 -20
- package/dist/components/searchpopover/searchpopover.component.js +0 -16
- package/dist/components/select/select.component.d.ts +23 -19
- package/dist/components/select/select.component.js +1 -14
- package/dist/components/selectlistbox/selectlistbox.component.d.ts +12 -8
- package/dist/components/selectlistbox/selectlistbox.component.js +0 -7
- package/dist/components/sidenavigation/sidenavigation.component.d.ts +64 -44
- package/dist/components/sidenavigation/sidenavigation.component.js +241 -43
- package/dist/components/sidenavigation/sidenavigation.constants.d.ts +6 -1
- package/dist/components/sidenavigation/sidenavigation.constants.js +6 -1
- package/dist/components/sidenavigation/sidenavigation.context.d.ts +6 -1
- package/dist/components/sidenavigation/sidenavigation.context.js +36 -11
- package/dist/components/sidenavigation/sidenavigation.types.d.ts +3 -2
- package/dist/components/sidenavigation/sidenavigationbase.d.ts +8 -0
- package/dist/components/sidenavigation/sidenavigationbase.js +7 -0
- package/dist/components/skeleton/skeleton.component.d.ts +14 -15
- package/dist/components/skeleton/skeleton.component.js +0 -13
- package/dist/components/slider/slider.component.d.ts +17 -15
- package/dist/components/slider/slider.component.js +0 -11
- package/dist/components/spatialnavigationprovider/spatialnavigationprovider.component.d.ts +15 -215
- package/dist/components/spatialnavigationprovider/spatialnavigationprovider.component.js +1 -215
- package/dist/components/spinner/spinner.component.d.ts +15 -27
- package/dist/components/spinner/spinner.component.js +0 -25
- package/dist/components/staticcheckbox/staticcheckbox.component.d.ts +16 -21
- package/dist/components/staticcheckbox/staticcheckbox.component.js +0 -17
- package/dist/components/staticchip/staticchip.component.d.ts +17 -8
- package/dist/components/staticchip/staticchip.component.js +0 -5
- package/dist/components/staticradio/staticradio.component.d.ts +15 -19
- package/dist/components/staticradio/staticradio.component.js +0 -16
- package/dist/components/statictoggle/statictoggle.component.d.ts +16 -21
- package/dist/components/statictoggle/statictoggle.component.js +0 -17
- package/dist/components/stepper/stepper.component.d.ts +13 -5
- package/dist/components/stepper/stepper.component.js +0 -3
- package/dist/components/stepperconnector/stepperconnector.component.d.ts +13 -6
- package/dist/components/stepperconnector/stepperconnector.component.js +0 -4
- package/dist/components/stepperitem/stepperitem.component.d.ts +16 -14
- package/dist/components/stepperitem/stepperitem.component.js +1 -10
- package/dist/components/tab/tab.component.d.ts +20 -23
- package/dist/components/tab/tab.component.js +1 -16
- package/dist/components/tablist/tablist.component.d.ts +18 -30
- package/dist/components/tablist/tablist.component.js +0 -24
- package/dist/components/text/text.component.d.ts +12 -13
- package/dist/components/text/text.component.js +0 -12
- package/dist/components/textarea/textarea.component.d.ts +17 -39
- package/dist/components/textarea/textarea.component.js +0 -34
- package/dist/components/themeprovider/themeprovider.component.d.ts +13 -27
- package/dist/components/themeprovider/themeprovider.component.js +0 -25
- package/dist/components/timepicker/timepicker.component.d.ts +17 -19
- package/dist/components/timepicker/timepicker.component.js +0 -14
- package/dist/components/toast/toast.component.d.ts +20 -12
- package/dist/components/toast/toast.component.js +1 -7
- package/dist/components/toggle/toggle.component.d.ts +18 -24
- package/dist/components/toggle/toggle.component.js +1 -21
- package/dist/components/toggletip/toggletip.component.d.ts +18 -28
- package/dist/components/toggletip/toggletip.component.js +1 -24
- package/dist/components/tooltip/tooltip.component.d.ts +16 -16
- package/dist/components/tooltip/tooltip.component.js +0 -13
- package/dist/components/typewriter/typewriter.component.d.ts +18 -34
- package/dist/components/typewriter/typewriter.component.js +1 -31
- package/dist/components/verticaltablist/verticaltablist.component.d.ts +17 -30
- package/dist/components/verticaltablist/verticaltablist.component.js +0 -26
- package/dist/components/virtualizedlist/virtualizedlist.component.d.ts +16 -58
- package/dist/components/virtualizedlist/virtualizedlist.component.js +0 -55
- package/dist/custom-elements.json +334 -191
- package/dist/models/provider/provider.component.d.ts +2 -2
- package/dist/models/provider/provider.component.js +13 -0
- package/dist/react/accordion/index.d.ts +15 -5
- package/dist/react/accordionbutton/index.d.ts +14 -26
- package/dist/react/accordionbutton/index.js +0 -22
- package/dist/react/accordiongroup/index.d.ts +12 -16
- package/dist/react/accordiongroup/index.js +0 -14
- package/dist/react/alertchip/index.d.ts +15 -11
- package/dist/react/alertchip/index.js +0 -7
- package/dist/react/animation/index.d.ts +14 -6
- package/dist/react/animation/index.js +0 -5
- package/dist/react/announcementdialog/index.d.ts +18 -25
- package/dist/react/announcementdialog/index.js +1 -20
- package/dist/react/appheader/index.d.ts +13 -12
- package/dist/react/appheader/index.js +0 -9
- package/dist/react/avatar/index.d.ts +14 -34
- package/dist/react/avatar/index.js +1 -31
- package/dist/react/avatarbutton/index.d.ts +15 -14
- package/dist/react/avatarbutton/index.js +1 -10
- package/dist/react/badge/index.d.ts +16 -20
- package/dist/react/badge/index.js +1 -17
- package/dist/react/banner/index.d.ts +17 -17
- package/dist/react/banner/index.js +1 -13
- package/dist/react/brandvisual/index.d.ts +15 -12
- package/dist/react/brandvisual/index.js +0 -10
- package/dist/react/bullet/index.d.ts +15 -16
- package/dist/react/bullet/index.js +0 -15
- package/dist/react/button/index.d.ts +21 -52
- package/dist/react/button/index.js +1 -47
- package/dist/react/buttongroup/index.d.ts +17 -20
- package/dist/react/buttongroup/index.js +0 -17
- package/dist/react/buttonlink/index.d.ts +19 -16
- package/dist/react/buttonlink/index.js +1 -11
- package/dist/react/buttonsimple/index.d.ts +16 -25
- package/dist/react/buttonsimple/index.js +0 -22
- package/dist/react/calendar/index.d.ts +17 -11
- package/dist/react/calendar/index.js +0 -8
- package/dist/react/card/index.d.ts +18 -17
- package/dist/react/card/index.js +0 -13
- package/dist/react/cardbutton/index.d.ts +20 -14
- package/dist/react/cardbutton/index.js +0 -9
- package/dist/react/cardcheckbox/index.d.ts +20 -19
- package/dist/react/cardcheckbox/index.js +0 -14
- package/dist/react/cardradio/index.d.ts +20 -20
- package/dist/react/cardradio/index.js +0 -15
- package/dist/react/checkbox/index.d.ts +22 -26
- package/dist/react/checkbox/index.js +1 -22
- package/dist/react/chip/index.d.ts +20 -13
- package/dist/react/chip/index.js +0 -9
- package/dist/react/coachmark/index.d.ts +22 -22
- package/dist/react/coachmark/index.js +1 -18
- package/dist/react/combobox/index.d.ts +27 -37
- package/dist/react/combobox/index.js +1 -32
- package/dist/react/controltypeprovider/index.d.ts +19 -11
- package/dist/react/controltypeprovider/index.js +0 -10
- package/dist/react/datepicker/index.d.ts +20 -14
- package/dist/react/datepicker/index.js +0 -9
- package/dist/react/dialog/index.d.ts +25 -40
- package/dist/react/dialog/index.js +1 -35
- package/dist/react/divider/index.d.ts +23 -25
- package/dist/react/divider/index.js +0 -23
- package/dist/react/filterchip/index.d.ts +20 -9
- package/dist/react/filterchip/index.js +0 -5
- package/dist/react/formfieldgroup/index.d.ts +18 -19
- package/dist/react/formfieldgroup/index.js +0 -15
- package/dist/react/formfieldwrapper/index.d.ts +16 -8
- package/dist/react/formfieldwrapper/index.js +0 -4
- package/dist/react/icon/index.d.ts +16 -41
- package/dist/react/icon/index.js +0 -39
- package/dist/react/iconprovider/index.d.ts +14 -24
- package/dist/react/iconprovider/index.js +0 -23
- package/dist/react/illustration/index.d.ts +16 -32
- package/dist/react/illustration/index.js +0 -30
- package/dist/react/illustrationprovider/index.d.ts +14 -24
- package/dist/react/illustrationprovider/index.js +0 -23
- package/dist/react/input/index.d.ts +21 -16
- package/dist/react/input/index.js +0 -11
- package/dist/react/inputchip/index.d.ts +19 -13
- package/dist/react/inputchip/index.js +0 -7
- package/dist/react/link/index.d.ts +18 -12
- package/dist/react/link/index.js +1 -9
- package/dist/react/linkbutton/index.d.ts +19 -12
- package/dist/react/linkbutton/index.js +1 -8
- package/dist/react/linksimple/index.d.ts +17 -10
- package/dist/react/linksimple/index.js +0 -7
- package/dist/react/list/index.d.ts +17 -7
- package/dist/react/list/index.js +0 -5
- package/dist/react/listbox/index.d.ts +21 -16
- package/dist/react/listbox/index.js +1 -11
- package/dist/react/listheader/index.d.ts +14 -6
- package/dist/react/listheader/index.js +0 -3
- package/dist/react/listitem/index.d.ts +20 -18
- package/dist/react/listitem/index.js +0 -13
- package/dist/react/marker/index.d.ts +15 -16
- package/dist/react/marker/index.js +0 -15
- package/dist/react/menubar/index.d.ts +12 -19
- package/dist/react/menubar/index.js +0 -19
- package/dist/react/menuitem/index.d.ts +18 -19
- package/dist/react/menuitem/index.js +1 -15
- package/dist/react/menuitemcheckbox/index.d.ts +19 -30
- package/dist/react/menuitemcheckbox/index.js +1 -25
- package/dist/react/menuitemradio/index.d.ts +18 -31
- package/dist/react/menuitemradio/index.js +1 -26
- package/dist/react/menupopover/index.d.ts +16 -38
- package/dist/react/menupopover/index.js +0 -34
- package/dist/react/menusection/index.d.ts +16 -12
- package/dist/react/menusection/index.js +0 -8
- package/dist/react/navmenuitem/index.d.ts +19 -16
- package/dist/react/navmenuitem/index.js +3 -12
- package/dist/react/optgroup/index.d.ts +17 -7
- package/dist/react/optgroup/index.js +1 -3
- package/dist/react/option/index.d.ts +17 -19
- package/dist/react/option/index.js +1 -15
- package/dist/react/password/index.d.ts +18 -17
- package/dist/react/password/index.js +0 -11
- package/dist/react/popover/index.d.ts +20 -52
- package/dist/react/popover/index.js +1 -47
- package/dist/react/presence/index.d.ts +17 -10
- package/dist/react/presence/index.js +1 -7
- package/dist/react/progressbar/index.d.ts +17 -13
- package/dist/react/progressbar/index.js +0 -9
- package/dist/react/progressspinner/index.d.ts +14 -19
- package/dist/react/progressspinner/index.js +0 -17
- package/dist/react/radio/index.d.ts +19 -41
- package/dist/react/radio/index.js +1 -37
- package/dist/react/radiogroup/index.d.ts +12 -5
- package/dist/react/radiogroup/index.js +0 -4
- package/dist/react/responsivesettingsprovider/index.d.ts +11 -29
- package/dist/react/responsivesettingsprovider/index.js +0 -29
- package/dist/react/screenreaderannouncer/index.d.ts +12 -51
- package/dist/react/screenreaderannouncer/index.js +0 -51
- package/dist/react/searchfield/index.d.ts +16 -24
- package/dist/react/searchfield/index.js +0 -20
- package/dist/react/searchpopover/index.d.ts +16 -20
- package/dist/react/searchpopover/index.js +0 -16
- package/dist/react/select/index.d.ts +23 -19
- package/dist/react/select/index.js +1 -14
- package/dist/react/selectlistbox/index.d.ts +12 -8
- package/dist/react/selectlistbox/index.js +0 -7
- package/dist/react/sidenavigation/index.d.ts +21 -41
- package/dist/react/sidenavigation/index.js +1 -35
- package/dist/react/skeleton/index.d.ts +14 -15
- package/dist/react/skeleton/index.js +0 -13
- package/dist/react/slider/index.d.ts +17 -15
- package/dist/react/slider/index.js +0 -11
- package/dist/react/spatialnavigationprovider/index.d.ts +15 -215
- package/dist/react/spatialnavigationprovider/index.js +1 -214
- package/dist/react/spinner/index.d.ts +15 -27
- package/dist/react/spinner/index.js +0 -25
- package/dist/react/staticcheckbox/index.d.ts +16 -21
- package/dist/react/staticcheckbox/index.js +0 -17
- package/dist/react/staticchip/index.d.ts +17 -8
- package/dist/react/staticchip/index.js +0 -5
- package/dist/react/staticradio/index.d.ts +15 -19
- package/dist/react/staticradio/index.js +0 -16
- package/dist/react/statictoggle/index.d.ts +16 -21
- package/dist/react/statictoggle/index.js +0 -17
- package/dist/react/stepper/index.d.ts +13 -5
- package/dist/react/stepper/index.js +0 -3
- package/dist/react/stepperconnector/index.d.ts +13 -6
- package/dist/react/stepperconnector/index.js +0 -4
- package/dist/react/stepperitem/index.d.ts +16 -14
- package/dist/react/stepperitem/index.js +1 -10
- package/dist/react/tab/index.d.ts +20 -23
- package/dist/react/tab/index.js +1 -16
- package/dist/react/tablist/index.d.ts +18 -30
- package/dist/react/tablist/index.js +0 -24
- package/dist/react/text/index.d.ts +12 -13
- package/dist/react/text/index.js +0 -12
- package/dist/react/textarea/index.d.ts +17 -39
- package/dist/react/textarea/index.js +0 -34
- package/dist/react/themeprovider/index.d.ts +13 -27
- package/dist/react/themeprovider/index.js +0 -25
- package/dist/react/timepicker/index.d.ts +17 -19
- package/dist/react/timepicker/index.js +0 -14
- package/dist/react/toast/index.d.ts +20 -12
- package/dist/react/toast/index.js +1 -7
- package/dist/react/toggle/index.d.ts +18 -24
- package/dist/react/toggle/index.js +1 -21
- package/dist/react/toggletip/index.d.ts +18 -28
- package/dist/react/toggletip/index.js +1 -24
- package/dist/react/tooltip/index.d.ts +16 -16
- package/dist/react/tooltip/index.js +0 -13
- package/dist/react/typewriter/index.d.ts +18 -34
- package/dist/react/typewriter/index.js +1 -31
- package/dist/react/verticaltablist/index.d.ts +17 -30
- package/dist/react/verticaltablist/index.js +0 -26
- package/dist/react/virtualizedlist/index.d.ts +16 -58
- package/dist/react/virtualizedlist/index.js +0 -55
- package/package.json +1 -1
|
@@ -9,49 +9,19 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { html, nothing } from 'lit';
|
|
11
11
|
import { property } from 'lit/decorators.js';
|
|
12
|
-
import { Component
|
|
12
|
+
import { Component } from '../../models';
|
|
13
13
|
import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
|
|
14
14
|
import { TAG_NAME as NAVMENUITEM_TAGNAME } from '../navmenuitem/navmenuitem.constants';
|
|
15
|
+
import { TAG_NAME as MENUPOPOVER_TAGNAME } from '../menupopover/menupopover.constants';
|
|
15
16
|
import { DIRECTIONS, DIVIDER_VARIANT, DIVIDER_ORIENTATION } from '../divider/divider.constants';
|
|
16
17
|
import { ROLE } from '../../utils/roles';
|
|
17
|
-
import {
|
|
18
|
-
import { DEFAULTS, VARIANTS } from './sidenavigation.constants';
|
|
18
|
+
import { ACTIONS, KeyToActionMixin } from '../../utils/mixins/KeyToActionMixin';
|
|
19
|
+
import { DEFAULTS, SUBMENU_TYPES, VARIANTS } from './sidenavigation.constants';
|
|
19
20
|
import SideNavigationContext from './sidenavigation.context';
|
|
20
21
|
import styles from './sidenavigation.styles';
|
|
22
|
+
import SideNavigationBase from './sidenavigationbase';
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
* typically used in layouts with persistent or collapsible sidebars.
|
|
24
|
-
*
|
|
25
|
-
* ## Features:
|
|
26
|
-
* - Supports five layout variants: `fixed-collapsed`, `fixed-expanded`, `flexible`, `flexible-on-hover`, and `hidden`
|
|
27
|
-
* - Toggleable expand/collapse behavior
|
|
28
|
-
* - Displays brand logo and customer name
|
|
29
|
-
* - Serves as a context provider for descendant components - `mdc-menubar` and `mdc-navmenuitem`
|
|
30
|
-
*
|
|
31
|
-
* ### Usage:
|
|
32
|
-
* In a sidenavigation, navmenuitems can be used in the following ways:
|
|
33
|
-
*
|
|
34
|
-
* 1. **Simple navmenuitem** – No submenu or interaction beyond selection.
|
|
35
|
-
*
|
|
36
|
-
* 2. **NavMenuItem with submenu**:
|
|
37
|
-
* - Provide an `id` on the `mdc-navmenuitem`
|
|
38
|
-
* - Set the `triggerId` on the corresponding `mdc-menupopover` to match the navmenuitem's `id`
|
|
39
|
-
* - Set `parent-nav-tooltip-text` with appropriate text that will display when a child menu item
|
|
40
|
-
* inside the nested menupopover is active, conveying which submenu item is currently selected
|
|
41
|
-
*
|
|
42
|
-
* 3. **Actionable navmenuitem (no submenu)**:
|
|
43
|
-
* - Performs an action such as navigation or alert trigger
|
|
44
|
-
* - Set `disable-aria-current="true"` to maintain visual active state without navigation behavior
|
|
45
|
-
*
|
|
46
|
-
* ### Recommendations:
|
|
47
|
-
* - Use `mdc-text` for section headers
|
|
48
|
-
* - Use `mdc-divider` with the attribute `variant="gradient"` for section dividers
|
|
49
|
-
* - For the brand logo, use an informative icon. Refer to `Momentum Informative Icons`
|
|
50
|
-
*
|
|
51
|
-
* #### Accessibility Notes:
|
|
52
|
-
* - Always provide meaningful `aria-label` attributes for both `mdc-navmenuitem` and `mdc-menubar`
|
|
53
|
-
* to ensure screen reader support
|
|
54
|
-
* - Set `grabber-btn-aria-label` to provide accessible labels for the expand/collapse grabber button
|
|
24
|
+
* @tagname mdc-sidenavigation
|
|
55
25
|
*
|
|
56
26
|
* @dependency mdc-text
|
|
57
27
|
* @dependency mdc-button
|
|
@@ -60,8 +30,6 @@ import styles from './sidenavigation.styles';
|
|
|
60
30
|
*
|
|
61
31
|
* @event activechange - (React: onActiveChange) Dispatched when the active state of the navmenuitem changes.
|
|
62
32
|
*
|
|
63
|
-
* @tagname mdc-sidenavigation
|
|
64
|
-
*
|
|
65
33
|
* @slot scrollable-section - Slot for the scrollable content area of the side navigation.
|
|
66
34
|
* @slot scrollable-menubar - Slot for the menubar inside the scrollable section.
|
|
67
35
|
* @slot fixed-section - Slot for the fixed content area of the side navigation.
|
|
@@ -92,11 +60,11 @@ import styles from './sidenavigation.styles';
|
|
|
92
60
|
* @cssproperty --mdc-sidenavigation-bottom-padding - padding for the bottom of the scrollable section
|
|
93
61
|
* @cssproperty --mdc-sidenavigation-vertical-divider-button-z-index - z-index of the vertical divider button
|
|
94
62
|
*/
|
|
95
|
-
class SideNavigation extends
|
|
63
|
+
class SideNavigation extends KeyToActionMixin(SideNavigationBase) {
|
|
96
64
|
constructor() {
|
|
97
65
|
super({
|
|
98
66
|
context: SideNavigationContext.context,
|
|
99
|
-
initialValue: new SideNavigationContext(DEFAULTS.VARIANT, true),
|
|
67
|
+
initialValue: new SideNavigationContext(DEFAULTS.VARIANT, true, DEFAULTS.SUBMENU_TYPE),
|
|
100
68
|
});
|
|
101
69
|
/**
|
|
102
70
|
* Five variants of the sideNavigation
|
|
@@ -120,6 +88,17 @@ class SideNavigation extends Provider {
|
|
|
120
88
|
* @default false
|
|
121
89
|
*/
|
|
122
90
|
this.hideFixedSectionDivider = false;
|
|
91
|
+
/**
|
|
92
|
+
* Determines how sibling submenus are displayed. There are 2 types of submenus supported:
|
|
93
|
+
*
|
|
94
|
+
* - `flyout`: Submenus are shown with `mdc-menupopover`.
|
|
95
|
+
* - `dropdown`: A parent `mdc-navmenuitem` can render its submenu inside a sibling
|
|
96
|
+
* `div[data-trigger="<navmenuitem-id>"]` while the sidenavigation is expanded. In collapsed mode,
|
|
97
|
+
* dropdown submenus are converted to flyout menus.
|
|
98
|
+
*
|
|
99
|
+
* @default flyout
|
|
100
|
+
*/
|
|
101
|
+
this.submenuType = DEFAULTS.SUBMENU_TYPE;
|
|
123
102
|
this.isHovered = false;
|
|
124
103
|
this.isFocused = false;
|
|
125
104
|
/** @internal */
|
|
@@ -201,6 +180,7 @@ class SideNavigation extends Provider {
|
|
|
201
180
|
*/
|
|
202
181
|
this.findNav = (navs, navId) => navs.find(nav => nav.navId === navId);
|
|
203
182
|
this.addEventListener('activechange', this.handleNestedNavMenuItemActiveChange.bind(this));
|
|
183
|
+
this.addEventListener('keydown', this.handleDropdownKeyDown.bind(this));
|
|
204
184
|
}
|
|
205
185
|
connectedCallback() {
|
|
206
186
|
super.connectedCallback();
|
|
@@ -240,9 +220,28 @@ class SideNavigation extends Provider {
|
|
|
240
220
|
default:
|
|
241
221
|
}
|
|
242
222
|
}
|
|
243
|
-
if (changedProperties.has('variant') || changedProperties.has('expanded')) {
|
|
223
|
+
if (changedProperties.has('variant') || changedProperties.has('expanded') || changedProperties.has('submenuType')) {
|
|
244
224
|
this.updateContext();
|
|
245
225
|
}
|
|
226
|
+
// When collapsing or when dropdown submenus are turned off, close all dropdown containers
|
|
227
|
+
if (changedProperties.has('expanded') || changedProperties.has('submenuType')) {
|
|
228
|
+
if (!this.expanded || this.submenuType !== SUBMENU_TYPES.DROPDOWN) {
|
|
229
|
+
this.closeAllDropdowns();
|
|
230
|
+
}
|
|
231
|
+
// Handle dropdown-to-flyout conversion
|
|
232
|
+
if (this.submenuType === SUBMENU_TYPES.DROPDOWN) {
|
|
233
|
+
if (!this.expanded) {
|
|
234
|
+
this.convertDropdownsToFlyouts();
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
this.convertFlyoutsToDropdowns();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
// If dropdown submenus are turned off, clean up any dynamic menupopover elements
|
|
242
|
+
this.convertFlyoutsToDropdowns();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
246
245
|
}
|
|
247
246
|
firstUpdated(changedProperties) {
|
|
248
247
|
super.firstUpdated(changedProperties);
|
|
@@ -251,6 +250,12 @@ class SideNavigation extends Provider {
|
|
|
251
250
|
this.expanded = true;
|
|
252
251
|
this.updateContext();
|
|
253
252
|
}
|
|
253
|
+
// Hide all dropdown containers by default
|
|
254
|
+
this.hideAllDropdownContainers();
|
|
255
|
+
// If initially collapsed with dropdown submenus, convert to flyouts
|
|
256
|
+
if (this.submenuType === SUBMENU_TYPES.DROPDOWN && !this.expanded) {
|
|
257
|
+
this.convertDropdownsToFlyouts();
|
|
258
|
+
}
|
|
254
259
|
}
|
|
255
260
|
/**
|
|
256
261
|
* Update all observing components of this
|
|
@@ -259,9 +264,12 @@ class SideNavigation extends Provider {
|
|
|
259
264
|
* Is called on every re-render, see Provider class
|
|
260
265
|
*/
|
|
261
266
|
updateContext() {
|
|
262
|
-
if (this.context.value.variant !== this.variant ||
|
|
267
|
+
if (this.context.value.variant !== this.variant ||
|
|
268
|
+
this.context.value.expanded !== this.expanded ||
|
|
269
|
+
this.context.value.submenuType !== this.submenuType) {
|
|
263
270
|
this.context.value.variant = this.variant;
|
|
264
271
|
this.context.value.expanded = this.expanded;
|
|
272
|
+
this.context.value.submenuType = this.submenuType;
|
|
265
273
|
this.context.updateObservers();
|
|
266
274
|
}
|
|
267
275
|
}
|
|
@@ -272,6 +280,192 @@ class SideNavigation extends Provider {
|
|
|
272
280
|
get navMenuItems() {
|
|
273
281
|
return Array.from(this.querySelectorAll(`${NAVMENUITEM_TAGNAME}:not([disabled])`));
|
|
274
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Closes all open dropdown containers and resets their parent navmenuitems.
|
|
285
|
+
* @internal
|
|
286
|
+
*/
|
|
287
|
+
closeAllDropdowns() {
|
|
288
|
+
this.navMenuItems.filter(item => this.context.value.isDropDownParent(item)).forEach(item => item.closeDropdown());
|
|
289
|
+
// Also hide all dropdown containers
|
|
290
|
+
this.hideAllDropdownContainers();
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Hides all div[data-trigger] elements within the sidenavigation.
|
|
294
|
+
* @internal
|
|
295
|
+
*/
|
|
296
|
+
hideAllDropdownContainers() {
|
|
297
|
+
const containers = this.querySelectorAll('div[data-trigger]');
|
|
298
|
+
containers.forEach(container => {
|
|
299
|
+
Object.assign(container.style, {
|
|
300
|
+
display: 'none',
|
|
301
|
+
flexDirection: 'column',
|
|
302
|
+
gap: '0.25rem',
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* When collapsed with dropdown submenus, converts div[data-trigger] children into dynamically
|
|
308
|
+
* created menupopover elements for flyout behavior.
|
|
309
|
+
* @internal
|
|
310
|
+
*/
|
|
311
|
+
convertDropdownsToFlyouts() {
|
|
312
|
+
const containers = this.querySelectorAll('div[data-trigger]');
|
|
313
|
+
containers.forEach(container => {
|
|
314
|
+
var _a;
|
|
315
|
+
const triggerId = container.getAttribute('data-trigger');
|
|
316
|
+
if (!triggerId)
|
|
317
|
+
return;
|
|
318
|
+
// Check if a dynamic menupopover already exists for this trigger
|
|
319
|
+
const existingPopover = (_a = container.parentElement) === null || _a === void 0 ? void 0 : _a.querySelector(`${MENUPOPOVER_TAGNAME}[triggerid="${CSS.escape(triggerId)}"][data-dynamic-popover]`);
|
|
320
|
+
if (existingPopover)
|
|
321
|
+
return;
|
|
322
|
+
// Create menupopover
|
|
323
|
+
const popover = document.createElement(MENUPOPOVER_TAGNAME);
|
|
324
|
+
popover.setAttribute('triggerid', triggerId);
|
|
325
|
+
popover.setAttribute('data-dynamic-popover', '');
|
|
326
|
+
popover.setAttribute('placement', 'right-start');
|
|
327
|
+
// Move children from div to menupopover
|
|
328
|
+
while (container.firstChild) {
|
|
329
|
+
popover.appendChild(container.firstChild);
|
|
330
|
+
}
|
|
331
|
+
// Insert menupopover after the div
|
|
332
|
+
container.after(popover);
|
|
333
|
+
// Hide the empty div
|
|
334
|
+
Object.assign(container.style, { display: 'none' });
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* When expanding with dropdown submenus, converts dynamically created menupopover elements
|
|
339
|
+
* back to div[data-trigger] containers.
|
|
340
|
+
* @internal
|
|
341
|
+
*/
|
|
342
|
+
convertFlyoutsToDropdowns() {
|
|
343
|
+
const dynamicPopovers = this.querySelectorAll(`${MENUPOPOVER_TAGNAME}[data-dynamic-popover]`);
|
|
344
|
+
dynamicPopovers.forEach(popover => {
|
|
345
|
+
const triggerId = popover.getAttribute('triggerid');
|
|
346
|
+
if (!triggerId)
|
|
347
|
+
return;
|
|
348
|
+
// Find the corresponding div[data-trigger]
|
|
349
|
+
const container = this.querySelector(`div[data-trigger="${CSS.escape(triggerId)}"]`);
|
|
350
|
+
if (!container)
|
|
351
|
+
return;
|
|
352
|
+
// Move children back from menupopover to div
|
|
353
|
+
while (popover.firstChild) {
|
|
354
|
+
container.appendChild(popover.firstChild);
|
|
355
|
+
}
|
|
356
|
+
// Remove the dynamic menupopover
|
|
357
|
+
popover.remove();
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Handles Escape key inside dropdown containers to close the dropdown
|
|
362
|
+
* and return focus to the parent trigger navmenuitem.
|
|
363
|
+
* @internal
|
|
364
|
+
*/
|
|
365
|
+
handleDropdownKeyDown(event) {
|
|
366
|
+
var _a, _b;
|
|
367
|
+
if (this.submenuType !== SUBMENU_TYPES.DROPDOWN || !this.expanded)
|
|
368
|
+
return;
|
|
369
|
+
const target = event.target;
|
|
370
|
+
const isNavMenuItem = target.tagName.toLowerCase() === NAVMENUITEM_TAGNAME;
|
|
371
|
+
if (!isNavMenuItem)
|
|
372
|
+
return;
|
|
373
|
+
const targetItem = target;
|
|
374
|
+
const action = this.getActionForKeyEvent(event);
|
|
375
|
+
if (action === ACTIONS.ESCAPE) {
|
|
376
|
+
const dropdownContainer = target.closest('div[data-trigger]');
|
|
377
|
+
if (!dropdownContainer)
|
|
378
|
+
return;
|
|
379
|
+
const triggerId = dropdownContainer.getAttribute('data-trigger');
|
|
380
|
+
if (!triggerId)
|
|
381
|
+
return;
|
|
382
|
+
const triggerItem = this.querySelector(`${NAVMENUITEM_TAGNAME}#${CSS.escape(triggerId)}`);
|
|
383
|
+
if (triggerItem) {
|
|
384
|
+
triggerItem.closeDropdown();
|
|
385
|
+
triggerItem.focus();
|
|
386
|
+
event.stopPropagation();
|
|
387
|
+
}
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
const context = this.context.value;
|
|
391
|
+
const isInsideDropdown = targetItem.hasAttribute('in-dropdown-container');
|
|
392
|
+
const isOpen = targetItem.getAttribute('aria-expanded') === 'true';
|
|
393
|
+
const getDropdownContainer = (item) => { var _a, _b; return (_b = (_a = item.parentElement) === null || _a === void 0 ? void 0 : _a.querySelector(`div[data-trigger="${item.id}"]`)) !== null && _b !== void 0 ? _b : null; };
|
|
394
|
+
const getFirstDropdownItem = (container) => container === null || container === void 0 ? void 0 : container.querySelector(`${NAVMENUITEM_TAGNAME}:not([disabled])`);
|
|
395
|
+
if (isInsideDropdown) {
|
|
396
|
+
const dropdownContainer = target.closest('div[data-trigger]');
|
|
397
|
+
if (!dropdownContainer)
|
|
398
|
+
return;
|
|
399
|
+
const children = Array.from(dropdownContainer.querySelectorAll(`${NAVMENUITEM_TAGNAME}:not([disabled])`));
|
|
400
|
+
const currentIndex = children.indexOf(targetItem);
|
|
401
|
+
if (currentIndex === -1)
|
|
402
|
+
return;
|
|
403
|
+
switch (action) {
|
|
404
|
+
case ACTIONS.DOWN: {
|
|
405
|
+
// Arrow Down: move focus to the next child navmenuitem in the dropdown container, if exists. If on the last child, move focus back to the first child.
|
|
406
|
+
const idx = currentIndex + 1 < children.length ? currentIndex + 1 : 0;
|
|
407
|
+
children[idx].focus();
|
|
408
|
+
event.preventDefault();
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
case ACTIONS.UP: {
|
|
412
|
+
// Arrow Up: move focus to the previous child navmenuitem in the dropdown container, if exists. If on the first child, move focus to the last child.
|
|
413
|
+
const idx = currentIndex > 0 ? currentIndex - 1 : children.length - 1;
|
|
414
|
+
children[idx].focus();
|
|
415
|
+
event.preventDefault();
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
case ACTIONS.RIGHT: {
|
|
419
|
+
// Arrow Right: move focus to the next parent-level navmenuitem in the main list (if exists). If this parent-level navmenuitem has a dropdown, then open the dropdown and move focus to the first child navmenuitem in the dropdown container.
|
|
420
|
+
const outerItems = this.navMenuItems.filter(item => !item.hasAttribute('in-dropdown-container'));
|
|
421
|
+
const triggerId = dropdownContainer.getAttribute('data-trigger');
|
|
422
|
+
const triggerIndex = outerItems.findIndex(item => item.id === triggerId);
|
|
423
|
+
if (triggerIndex !== -1 && triggerIndex + 1 < outerItems.length) {
|
|
424
|
+
const nextItem = outerItems[triggerIndex + 1];
|
|
425
|
+
nextItem.focus();
|
|
426
|
+
if (context.isDropDownParent(nextItem)) {
|
|
427
|
+
nextItem.openDropdown();
|
|
428
|
+
const nextDropdownContainer = getDropdownContainer(nextItem);
|
|
429
|
+
(_a = getFirstDropdownItem(nextDropdownContainer)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
case ACTIONS.LEFT: {
|
|
435
|
+
// Arrow Left: move focus to the previous parent-level navmenuitem in the main list (if exists). If this parent-level navmenuitem has a dropdown, then open the dropdown and move focus to the first child navmenuitem in the dropdown container.
|
|
436
|
+
const outerItems = this.navMenuItems.filter(item => !item.hasAttribute('in-dropdown-container'));
|
|
437
|
+
const triggerId = dropdownContainer.getAttribute('data-trigger');
|
|
438
|
+
const triggerIndex = outerItems.findIndex(item => item.id === triggerId);
|
|
439
|
+
if (triggerIndex > 0) {
|
|
440
|
+
const previousItem = outerItems[triggerIndex - 1];
|
|
441
|
+
previousItem.focus();
|
|
442
|
+
if (context.isDropDownParent(previousItem)) {
|
|
443
|
+
previousItem.openDropdown();
|
|
444
|
+
const previousDropdownContainer = getDropdownContainer(previousItem);
|
|
445
|
+
(_b = getFirstDropdownItem(previousDropdownContainer)) === null || _b === void 0 ? void 0 : _b.focus();
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
default:
|
|
451
|
+
event.preventDefault();
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
// if the dropdown is closed and ArrowRight is pressed on the parent navmenuitem, open the dropdown and move focus to the first child navmenuitem in the dropdown container
|
|
455
|
+
if (action === ACTIONS.RIGHT) {
|
|
456
|
+
const dropdownContainer = getDropdownContainer(targetItem);
|
|
457
|
+
if (dropdownContainer) {
|
|
458
|
+
if (!isOpen) {
|
|
459
|
+
targetItem.openDropdown();
|
|
460
|
+
}
|
|
461
|
+
const firstChild = getFirstDropdownItem(dropdownContainer);
|
|
462
|
+
if (firstChild) {
|
|
463
|
+
firstChild.focus();
|
|
464
|
+
event.preventDefault();
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
275
469
|
/**
|
|
276
470
|
* Sets the variant attribute for the sideNavigation component.
|
|
277
471
|
* If the provided variant is not included in the variant,
|
|
@@ -301,7 +495,7 @@ class SideNavigation extends Provider {
|
|
|
301
495
|
}
|
|
302
496
|
preventScrollOnSpace(event) {
|
|
303
497
|
// Prevent default space key behavior to avoid scrolling the page
|
|
304
|
-
if (event
|
|
498
|
+
if (this.getActionForKeyEvent(event) === ACTIONS.SPACE) {
|
|
305
499
|
event.preventDefault();
|
|
306
500
|
}
|
|
307
501
|
}
|
|
@@ -386,4 +580,8 @@ __decorate([
|
|
|
386
580
|
property({ type: Boolean, reflect: true, attribute: 'hide-fixed-section-divider' }),
|
|
387
581
|
__metadata("design:type", Boolean)
|
|
388
582
|
], SideNavigation.prototype, "hideFixedSectionDivider", void 0);
|
|
583
|
+
__decorate([
|
|
584
|
+
property({ type: String, reflect: true, attribute: 'submenu-type' }),
|
|
585
|
+
__metadata("design:type", String)
|
|
586
|
+
], SideNavigation.prototype, "submenuType", void 0);
|
|
389
587
|
export default SideNavigation;
|
|
@@ -6,7 +6,12 @@ declare const VARIANTS: {
|
|
|
6
6
|
FLEXIBLE_ON_HOVER: string;
|
|
7
7
|
HIDDEN: string;
|
|
8
8
|
};
|
|
9
|
+
declare const SUBMENU_TYPES: {
|
|
10
|
+
FLYOUT: string;
|
|
11
|
+
DROPDOWN: string;
|
|
12
|
+
};
|
|
9
13
|
declare const DEFAULTS: {
|
|
10
14
|
readonly VARIANT: string;
|
|
15
|
+
readonly SUBMENU_TYPE: string;
|
|
11
16
|
};
|
|
12
|
-
export { DEFAULTS, VARIANTS, TAG_NAME };
|
|
17
|
+
export { DEFAULTS, VARIANTS, SUBMENU_TYPES, TAG_NAME };
|
|
@@ -7,7 +7,12 @@ const VARIANTS = {
|
|
|
7
7
|
FLEXIBLE_ON_HOVER: 'flexible-on-hover',
|
|
8
8
|
HIDDEN: 'hidden',
|
|
9
9
|
};
|
|
10
|
+
const SUBMENU_TYPES = {
|
|
11
|
+
FLYOUT: 'flyout',
|
|
12
|
+
DROPDOWN: 'dropdown',
|
|
13
|
+
};
|
|
10
14
|
const DEFAULTS = {
|
|
11
15
|
VARIANT: VARIANTS.FLEXIBLE,
|
|
16
|
+
SUBMENU_TYPE: SUBMENU_TYPES.FLYOUT,
|
|
12
17
|
};
|
|
13
|
-
export { DEFAULTS, VARIANTS, TAG_NAME };
|
|
18
|
+
export { DEFAULTS, VARIANTS, SUBMENU_TYPES, TAG_NAME };
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type NavMenuItem from '../navmenuitem/navmenuitem.component';
|
|
2
|
+
import type { SideNavigationSubmenuType } from './sidenavigation.types';
|
|
2
3
|
declare class SideNavigationContext {
|
|
3
4
|
variant?: string;
|
|
4
5
|
expanded?: boolean;
|
|
6
|
+
submenuType?: SideNavigationSubmenuType;
|
|
5
7
|
private currentActiveNavMenuItem?;
|
|
6
8
|
static context: {
|
|
7
9
|
__context__: SideNavigationContext;
|
|
8
10
|
};
|
|
9
|
-
constructor(defaultVariant?: string, defaultExpanded?: boolean);
|
|
11
|
+
constructor(defaultVariant?: string, defaultExpanded?: boolean, defaultSubmenuType?: SideNavigationSubmenuType);
|
|
12
|
+
get isDropdownSubmenuType(): boolean;
|
|
10
13
|
hasSiblingWithTriggerId(navMenuItem: NavMenuItem | undefined): boolean;
|
|
14
|
+
isDropDownParent(navMenuItem: NavMenuItem | undefined): boolean;
|
|
11
15
|
private getParentNavMenuItems;
|
|
16
|
+
private getTriggerElement;
|
|
12
17
|
setCurrentActiveNavMenuItem(navMenuItem: NavMenuItem | undefined): void;
|
|
13
18
|
}
|
|
14
19
|
export default SideNavigationContext;
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
import { createContext } from '@lit/context';
|
|
3
3
|
import { TAG_NAME as MENUPOPOVER_TAGNAME } from '../menupopover/menupopover.constants';
|
|
4
4
|
import { TAG_NAME as NAVMENUITEM_TAGNAME } from '../navmenuitem/navmenuitem.constants';
|
|
5
|
-
import { TAG_NAME } from './sidenavigation.constants';
|
|
5
|
+
import { SUBMENU_TYPES, TAG_NAME } from './sidenavigation.constants';
|
|
6
6
|
class SideNavigationContext {
|
|
7
|
-
constructor(defaultVariant, defaultExpanded) {
|
|
7
|
+
constructor(defaultVariant, defaultExpanded, defaultSubmenuType) {
|
|
8
8
|
this.variant = defaultVariant;
|
|
9
9
|
this.expanded = defaultExpanded;
|
|
10
|
+
this.submenuType = defaultSubmenuType;
|
|
11
|
+
}
|
|
12
|
+
get isDropdownSubmenuType() {
|
|
13
|
+
return this.submenuType === SUBMENU_TYPES.DROPDOWN;
|
|
10
14
|
}
|
|
11
15
|
hasSiblingWithTriggerId(navMenuItem) {
|
|
12
16
|
var _a, _b;
|
|
@@ -18,21 +22,33 @@ class SideNavigationContext {
|
|
|
18
22
|
sibling.tagName.toLowerCase() === MENUPOPOVER_TAGNAME &&
|
|
19
23
|
sibling.getAttribute('triggerid') === id);
|
|
20
24
|
}
|
|
25
|
+
isDropDownParent(navMenuItem) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const id = navMenuItem === null || navMenuItem === void 0 ? void 0 : navMenuItem.getAttribute('id');
|
|
28
|
+
if (!id)
|
|
29
|
+
return false;
|
|
30
|
+
const siblings = Array.from((_b = (_a = navMenuItem === null || navMenuItem === void 0 ? void 0 : navMenuItem.parentElement) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
|
|
31
|
+
return siblings.some(sibling => sibling !== navMenuItem && sibling.matches(`div[data-trigger="${id}"]`));
|
|
32
|
+
}
|
|
21
33
|
getParentNavMenuItems(navMenuItem) {
|
|
34
|
+
var _a;
|
|
22
35
|
if (!navMenuItem)
|
|
23
36
|
return [];
|
|
24
37
|
const parents = [];
|
|
25
38
|
let current = navMenuItem;
|
|
26
39
|
while (current) {
|
|
27
|
-
|
|
40
|
+
let triggeringNavMenuItem = null;
|
|
41
|
+
// A navmenuitem is either inside a menupopover (flyout) or a div[data-trigger] (dropdown), never both.
|
|
28
42
|
const popover = current === null || current === void 0 ? void 0 : current.closest(MENUPOPOVER_TAGNAME);
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
if (popover) {
|
|
44
|
+
triggeringNavMenuItem = this.getTriggerElement(popover, 'triggerid');
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const dropdownContainer = (_a = current === null || current === void 0 ? void 0 : current.parentElement) === null || _a === void 0 ? void 0 : _a.closest('div[data-trigger]');
|
|
48
|
+
if (dropdownContainer) {
|
|
49
|
+
triggeringNavMenuItem = this.getTriggerElement(dropdownContainer, 'data-trigger');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
36
52
|
if (triggeringNavMenuItem && triggeringNavMenuItem.tagName.toLowerCase() === NAVMENUITEM_TAGNAME) {
|
|
37
53
|
parents.push(triggeringNavMenuItem);
|
|
38
54
|
current = triggeringNavMenuItem;
|
|
@@ -43,10 +59,19 @@ class SideNavigationContext {
|
|
|
43
59
|
}
|
|
44
60
|
return parents;
|
|
45
61
|
}
|
|
62
|
+
getTriggerElement(container, attribute) {
|
|
63
|
+
const triggerId = container.getAttribute(attribute);
|
|
64
|
+
if (!triggerId)
|
|
65
|
+
return null;
|
|
66
|
+
return document.getElementById(triggerId);
|
|
67
|
+
}
|
|
46
68
|
setCurrentActiveNavMenuItem(navMenuItem) {
|
|
47
69
|
var _a;
|
|
48
70
|
const isSameItem = ((_a = this.currentActiveNavMenuItem) === null || _a === void 0 ? void 0 : _a.navId) === (navMenuItem === null || navMenuItem === void 0 ? void 0 : navMenuItem.navId);
|
|
49
|
-
const shouldSkip = (navMenuItem === null || navMenuItem === void 0 ? void 0 : navMenuItem.cannotActivate) ||
|
|
71
|
+
const shouldSkip = (navMenuItem === null || navMenuItem === void 0 ? void 0 : navMenuItem.cannotActivate) ||
|
|
72
|
+
this.hasSiblingWithTriggerId(navMenuItem) ||
|
|
73
|
+
(this.isDropdownSubmenuType && this.expanded && this.isDropDownParent(navMenuItem)) ||
|
|
74
|
+
(navMenuItem === null || navMenuItem === void 0 ? void 0 : navMenuItem.softDisabled);
|
|
50
75
|
if (isSameItem || shouldSkip)
|
|
51
76
|
return;
|
|
52
77
|
// Clean up previous active item
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { TypedCustomEvent, ValueOf } from '../../utils/types';
|
|
2
2
|
import type SideNavigation from './sidenavigation.component';
|
|
3
|
-
import { VARIANTS } from './sidenavigation.constants';
|
|
3
|
+
import { SUBMENU_TYPES, VARIANTS } from './sidenavigation.constants';
|
|
4
4
|
type SideNavigationVariant = ValueOf<typeof VARIANTS>;
|
|
5
|
+
type SideNavigationSubmenuType = ValueOf<typeof SUBMENU_TYPES>;
|
|
5
6
|
type SideNavigationActiveChangeEvent = TypedCustomEvent<SideNavigation, {
|
|
6
7
|
navId: string;
|
|
7
8
|
active: boolean;
|
|
@@ -13,4 +14,4 @@ interface Events {
|
|
|
13
14
|
onActiveChangeEvent: SideNavigationActiveChangeEvent;
|
|
14
15
|
onToggleEvent: SideNavigationToggleEvent;
|
|
15
16
|
}
|
|
16
|
-
export type { SideNavigationVariant, Events };
|
|
17
|
+
export type { SideNavigationVariant, SideNavigationSubmenuType, Events };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Provider } from '../../models';
|
|
2
|
+
import SideNavigationContext from './sidenavigation.context';
|
|
3
|
+
/**
|
|
4
|
+
* The `SideNavigationBase` class serves as a foundational component for the side navigation feature. It extends the `Provider` class, which allows it to manage and provide the `SideNavigationContext` to its child components. Since `KeyToActionMixin` cannot be directly applied to a `Provider` with context, this base class is created as an intermediate layer. The `SideNavigation` component then extends this class and wraps it with `KeyToActionMixin` to gain mixin functionality while maintaining context management.
|
|
5
|
+
*/
|
|
6
|
+
declare class SideNavigationBase extends Provider<SideNavigationContext> {
|
|
7
|
+
}
|
|
8
|
+
export default SideNavigationBase;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Provider } from '../../models';
|
|
2
|
+
/**
|
|
3
|
+
* The `SideNavigationBase` class serves as a foundational component for the side navigation feature. It extends the `Provider` class, which allows it to manage and provide the `SideNavigationContext` to its child components. Since `KeyToActionMixin` cannot be directly applied to a `Provider` with context, this base class is created as an intermediate layer. The `SideNavigation` component then extends this class and wraps it with `KeyToActionMixin` to gain mixin functionality while maintaining context management.
|
|
4
|
+
*/
|
|
5
|
+
class SideNavigationBase extends Provider {
|
|
6
|
+
}
|
|
7
|
+
export default SideNavigationBase;
|
|
@@ -3,23 +3,22 @@ import { CSSResult } from 'lit';
|
|
|
3
3
|
import { Component } from '../../models';
|
|
4
4
|
import type { SkeletonVariant } from './skeleton.types';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
6
|
+
* The skeleton is a grey placeholder block that signals to users that real content is being loaded. It can wrap a child element to take that element's dimensions, or stretch to fill its parent when used standalone.
|
|
7
|
+
*
|
|
8
|
+
* **When to use**
|
|
9
|
+
*
|
|
10
|
+
* - Use `mdc-skeleton` to indicate that content is loading, in place of the real content while it is being fetched or rendered.
|
|
11
|
+
* - Use it to wrap a known-shape child (button, avatar, paragraph) so the placeholder matches the eventual layout.
|
|
12
|
+
*
|
|
13
|
+
* **When not to use**
|
|
14
|
+
*
|
|
15
|
+
* - Use `mdc-spinner` when the loading duration is short or you only need a single inline indicator rather than a layout-matching placeholder.
|
|
16
|
+
* - Use `mdc-progressbar` when there is a known, measurable progress value to communicate.
|
|
17
|
+
*
|
|
19
18
|
* @tagname mdc-skeleton
|
|
20
|
-
*
|
|
19
|
+
*
|
|
21
20
|
* @slot - Content to wrap (optional). When provided, skeleton takes dimensions of this content.
|
|
22
|
-
*
|
|
21
|
+
*
|
|
23
22
|
* @cssproperty --mdc-skeleton-background-color - background color of the skeleton
|
|
24
23
|
* @cssproperty --mdc-skeleton-height - height of the skeleton
|
|
25
24
|
* @cssproperty --mdc-skeleton-width - width of the skeleton
|
|
@@ -13,19 +13,6 @@ import { Component } from '../../models';
|
|
|
13
13
|
import { DEFAULTS } from './skeleton.constants';
|
|
14
14
|
import styles from './skeleton.styles';
|
|
15
15
|
/**
|
|
16
|
-
* `mdc-skeleton` is a component that shows a grey placeholder area.
|
|
17
|
-
* It provides visual feedback to users that content is being loaded.
|
|
18
|
-
*
|
|
19
|
-
* **Skeleton Variants:**
|
|
20
|
-
* - **rectangular**: Default variant with 0.25rem border radius
|
|
21
|
-
* - **rounded**: Has 0.5rem border radius
|
|
22
|
-
* - **circular**: Has 50% border radius for circular shapes
|
|
23
|
-
* - **button**: Optimized for button placeholders with 1.25rem border radius
|
|
24
|
-
*
|
|
25
|
-
* **Sizing Behavior:**
|
|
26
|
-
* 1. If wrapping content, takes dimensions of wrapped content
|
|
27
|
-
* 2. Otherwise grows to fill parent container
|
|
28
|
-
*
|
|
29
16
|
* @tagname mdc-skeleton
|
|
30
17
|
*
|
|
31
18
|
* @slot - Content to wrap (optional). When provided, skeleton takes dimensions of this content.
|
|
@@ -2,21 +2,23 @@ import type { CSSResult, PropertyValueMap } from 'lit';
|
|
|
2
2
|
import { Component } from '../../models';
|
|
3
3
|
declare const Slider_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/KeyDownHandledMixin").KeyDownHandledMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/KeyToActionMixin").KeyToActionInterface> & typeof Component;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
5
|
+
* The slider lets users pick a value, or a range of values, from a defined numeric range by dragging one or two thumbs along a track. When the step is greater than 1, the slider also renders tick marks and snaps to the nearest tick.
|
|
6
|
+
*
|
|
7
|
+
* **When to use**
|
|
8
|
+
*
|
|
9
|
+
* - Use `mdc-slider` when the user needs to pick a numeric value from a continuous (or stepped) range, and the relative position matters (volume, brightness, zoom, etc.).
|
|
10
|
+
* - Use `range` when the user needs to pick both ends of a numeric interval (price range, time window).
|
|
11
|
+
*
|
|
12
|
+
* **When not to use**
|
|
13
|
+
*
|
|
14
|
+
* - Use `mdc-stepper` when only discrete numeric increments are meaningful and precise typing is important.
|
|
15
|
+
* - Use `mdc-input type="number"` when the user needs to type an exact value.
|
|
16
|
+
* - Use `mdc-toggle` for binary on/off choices.
|
|
17
|
+
*
|
|
16
18
|
* @tagname mdc-slider
|
|
17
|
-
*
|
|
19
|
+
*
|
|
18
20
|
* @dependency mdc-icon
|
|
19
|
-
*
|
|
21
|
+
*
|
|
20
22
|
* @csspart slider-tooltip - The tooltip of the slider
|
|
21
23
|
* @csspart slider-track - The track of the slider
|
|
22
24
|
* @csspart slider-wrapper - The wrapper around the slider input(s)
|
|
@@ -24,10 +26,10 @@ declare const Slider_base: import("../../utils/mixins/index.types").Constructor<
|
|
|
24
26
|
* @csspart slider-tick - The individual tick marks
|
|
25
27
|
* @csspart slider-input - The input element of the slider
|
|
26
28
|
* @csspart slider-label - The label of the slider
|
|
27
|
-
*
|
|
29
|
+
*
|
|
28
30
|
* @event input - Fired when the slider value changes
|
|
29
31
|
* @event change - Fired when the slider value is committed
|
|
30
|
-
*
|
|
32
|
+
*
|
|
31
33
|
* @cssproperty --mdc-slider-thumb-color - The color of the slider thumb
|
|
32
34
|
* @cssproperty --mdc-slider-thumb-border-color - The color of the slider thumb border
|
|
33
35
|
* @cssproperty --mdc-slider-thumb-size - The size of the slider thumb
|