primereact 10.2.1 → 10.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.cjs.js +83 -8
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +35 -0
- package/accordion/accordion.esm.js +85 -10
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +83 -8
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +63 -33
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +24 -246
- package/api/api.esm.js +63 -33
- package/api/api.esm.min.js +1 -1
- package/api/api.js +63 -33
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +3 -2
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +6 -1
- package/autocomplete/autocomplete.esm.js +3 -2
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +3 -2
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/blockui.cjs.js +8 -5
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +8 -5
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +8 -5
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +12 -6
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +12 -6
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +12 -6
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/calendar/calendar.cjs.js +71 -37
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +3 -5
- package/calendar/calendar.esm.js +71 -37
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +71 -37
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +103 -9
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +104 -10
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +103 -9
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +64 -23
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +27 -4
- package/cascadeselect/cascadeselect.esm.js +65 -24
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +65 -25
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/checkbox.cjs.js +25 -25
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +25 -25
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +26 -26
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +5 -2
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +17 -2
- package/chip/chip.esm.js +5 -2
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +5 -2
- package/chip/chip.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +1 -1
- package/componentbase/componentbase.cjs.js +49 -8
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +50 -9
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +49 -8
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +30 -22
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +19 -3
- package/confirmdialog/confirmdialog.esm.js +30 -22
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +30 -22
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +85 -152
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +40 -1
- package/confirmpopup/confirmpopup.esm.js +88 -155
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +85 -152
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +641 -99
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +23 -1
- package/contextmenu/contextmenu.esm.js +641 -99
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +641 -99
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +1217 -484
- package/core/core.min.js +40 -40
- package/datatable/datatable.cjs.js +30 -26
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +5 -4
- package/datatable/datatable.esm.js +30 -26
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +30 -26
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.d.ts +1 -1
- package/dialog/dialog.cjs.js +108 -151
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +60 -1
- package/dialog/dialog.esm.js +115 -158
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +109 -152
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +1 -0
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +1 -0
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +1 -0
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +169 -33
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +15 -0
- package/dock/dock.esm.js +170 -34
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +169 -33
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +29 -4
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +1 -1
- package/dropdown/dropdown.esm.js +29 -4
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +30 -6
- package/dropdown/dropdown.min.js +1 -1
- package/fieldset/fieldset.cjs.js +12 -5
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +12 -5
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +12 -5
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +14 -6
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +17 -1
- package/fileupload/fileupload.esm.js +14 -6
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +14 -6
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +223 -43
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +225 -45
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +223 -43
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +219 -78
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +8 -4
- package/hooks/hooks.esm.js +219 -80
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +219 -78
- package/hooks/hooks.min.js +1 -1
- package/icons/arrowdown/index.cjs.js +13 -2
- package/icons/arrowdown/index.cjs.min.js +1 -1
- package/icons/arrowdown/index.esm.js +13 -2
- package/icons/arrowdown/index.esm.min.js +1 -1
- package/icons/arrowdown/index.js +13 -2
- package/icons/arrowdown/index.min.js +1 -1
- package/icons/arrowup/index.cjs.js +13 -2
- package/icons/arrowup/index.cjs.min.js +1 -1
- package/icons/arrowup/index.esm.js +13 -2
- package/icons/arrowup/index.esm.min.js +1 -1
- package/icons/arrowup/index.js +13 -2
- package/icons/arrowup/index.min.js +1 -1
- package/icons/ban/index.cjs.js +13 -2
- package/icons/ban/index.cjs.min.js +1 -1
- package/icons/ban/index.esm.js +13 -2
- package/icons/ban/index.esm.min.js +1 -1
- package/icons/ban/index.js +13 -2
- package/icons/ban/index.min.js +1 -1
- package/icons/download/index.cjs.js +13 -2
- package/icons/download/index.cjs.min.js +1 -1
- package/icons/download/index.esm.js +13 -2
- package/icons/download/index.esm.min.js +1 -1
- package/icons/download/index.js +13 -2
- package/icons/download/index.min.js +1 -1
- package/icons/exclamationtriangle/index.cjs.js +13 -2
- package/icons/exclamationtriangle/index.cjs.min.js +1 -1
- package/icons/exclamationtriangle/index.esm.js +13 -2
- package/icons/exclamationtriangle/index.esm.min.js +1 -1
- package/icons/exclamationtriangle/index.js +13 -2
- package/icons/exclamationtriangle/index.min.js +1 -1
- package/icons/eyeslash/index.cjs.js +13 -2
- package/icons/eyeslash/index.cjs.min.js +1 -1
- package/icons/eyeslash/index.esm.js +13 -2
- package/icons/eyeslash/index.esm.min.js +1 -1
- package/icons/eyeslash/index.js +13 -2
- package/icons/eyeslash/index.min.js +1 -1
- package/icons/filter/index.cjs.js +13 -2
- package/icons/filter/index.cjs.min.js +1 -1
- package/icons/filter/index.esm.js +13 -2
- package/icons/filter/index.esm.min.js +1 -1
- package/icons/filter/index.js +13 -2
- package/icons/filter/index.min.js +1 -1
- package/icons/filterslash/index.cjs.js +13 -2
- package/icons/filterslash/index.cjs.min.js +1 -1
- package/icons/filterslash/index.esm.js +13 -2
- package/icons/filterslash/index.esm.min.js +1 -1
- package/icons/filterslash/index.js +13 -2
- package/icons/filterslash/index.min.js +1 -1
- package/icons/infocircle/index.cjs.js +13 -2
- package/icons/infocircle/index.cjs.min.js +1 -1
- package/icons/infocircle/index.esm.js +13 -2
- package/icons/infocircle/index.esm.min.js +1 -1
- package/icons/infocircle/index.js +13 -2
- package/icons/infocircle/index.min.js +1 -1
- package/icons/pencil/index.cjs.js +13 -2
- package/icons/pencil/index.cjs.min.js +1 -1
- package/icons/pencil/index.esm.js +13 -2
- package/icons/pencil/index.esm.min.js +1 -1
- package/icons/pencil/index.js +13 -2
- package/icons/pencil/index.min.js +1 -1
- package/icons/plus/index.cjs.js +13 -2
- package/icons/plus/index.cjs.min.js +1 -1
- package/icons/plus/index.esm.js +13 -2
- package/icons/plus/index.esm.min.js +1 -1
- package/icons/plus/index.js +13 -2
- package/icons/plus/index.min.js +1 -1
- package/icons/refresh/index.cjs.js +13 -2
- package/icons/refresh/index.cjs.min.js +1 -1
- package/icons/refresh/index.esm.js +13 -2
- package/icons/refresh/index.esm.min.js +1 -1
- package/icons/refresh/index.js +13 -2
- package/icons/refresh/index.min.js +1 -1
- package/icons/search/index.cjs.js +13 -2
- package/icons/search/index.cjs.min.js +1 -1
- package/icons/search/index.esm.js +13 -2
- package/icons/search/index.esm.min.js +1 -1
- package/icons/search/index.js +13 -2
- package/icons/search/index.min.js +1 -1
- package/icons/searchminus/index.cjs.js +13 -2
- package/icons/searchminus/index.cjs.min.js +1 -1
- package/icons/searchminus/index.esm.js +13 -2
- package/icons/searchminus/index.esm.min.js +1 -1
- package/icons/searchminus/index.js +13 -2
- package/icons/searchminus/index.min.js +1 -1
- package/icons/searchplus/index.cjs.js +13 -2
- package/icons/searchplus/index.cjs.min.js +1 -1
- package/icons/searchplus/index.esm.js +13 -2
- package/icons/searchplus/index.esm.min.js +1 -1
- package/icons/searchplus/index.js +13 -2
- package/icons/searchplus/index.min.js +1 -1
- package/icons/sortalt/index.cjs.js +13 -2
- package/icons/sortalt/index.cjs.min.js +1 -1
- package/icons/sortalt/index.esm.js +13 -2
- package/icons/sortalt/index.esm.min.js +1 -1
- package/icons/sortalt/index.js +13 -2
- package/icons/sortalt/index.min.js +1 -1
- package/icons/sortamountdown/index.cjs.js +13 -2
- package/icons/sortamountdown/index.cjs.min.js +1 -1
- package/icons/sortamountdown/index.esm.js +13 -2
- package/icons/sortamountdown/index.esm.min.js +1 -1
- package/icons/sortamountdown/index.js +13 -2
- package/icons/sortamountdown/index.min.js +1 -1
- package/icons/sortamountupalt/index.cjs.js +13 -2
- package/icons/sortamountupalt/index.cjs.min.js +1 -1
- package/icons/sortamountupalt/index.esm.js +13 -2
- package/icons/sortamountupalt/index.esm.min.js +1 -1
- package/icons/sortamountupalt/index.js +13 -2
- package/icons/sortamountupalt/index.min.js +1 -1
- package/icons/spinner/index.cjs.js +13 -2
- package/icons/spinner/index.cjs.min.js +1 -1
- package/icons/spinner/index.esm.js +13 -2
- package/icons/spinner/index.esm.min.js +1 -1
- package/icons/spinner/index.js +13 -2
- package/icons/spinner/index.min.js +1 -1
- package/icons/star/index.cjs.js +13 -2
- package/icons/star/index.cjs.min.js +1 -1
- package/icons/star/index.esm.js +13 -2
- package/icons/star/index.esm.min.js +1 -1
- package/icons/star/index.js +13 -2
- package/icons/star/index.min.js +1 -1
- package/icons/starfill/index.cjs.js +13 -2
- package/icons/starfill/index.cjs.min.js +1 -1
- package/icons/starfill/index.esm.js +13 -2
- package/icons/starfill/index.esm.min.js +1 -1
- package/icons/starfill/index.js +13 -2
- package/icons/starfill/index.min.js +1 -1
- package/icons/thlarge/index.cjs.js +13 -2
- package/icons/thlarge/index.cjs.min.js +1 -1
- package/icons/thlarge/index.esm.js +13 -2
- package/icons/thlarge/index.esm.min.js +1 -1
- package/icons/thlarge/index.js +13 -2
- package/icons/thlarge/index.min.js +1 -1
- package/icons/timescircle/index.cjs.js +13 -2
- package/icons/timescircle/index.cjs.min.js +1 -1
- package/icons/timescircle/index.esm.js +13 -2
- package/icons/timescircle/index.esm.min.js +1 -1
- package/icons/timescircle/index.js +13 -2
- package/icons/timescircle/index.min.js +1 -1
- package/icons/trash/index.cjs.js +13 -2
- package/icons/trash/index.cjs.min.js +1 -1
- package/icons/trash/index.esm.js +13 -2
- package/icons/trash/index.esm.min.js +1 -1
- package/icons/trash/index.js +13 -2
- package/icons/trash/index.min.js +1 -1
- package/icons/undo/index.cjs.js +13 -2
- package/icons/undo/index.cjs.min.js +1 -1
- package/icons/undo/index.esm.js +13 -2
- package/icons/undo/index.esm.min.js +1 -1
- package/icons/undo/index.js +13 -2
- package/icons/undo/index.min.js +1 -1
- package/icons/upload/index.cjs.js +13 -2
- package/icons/upload/index.cjs.min.js +1 -1
- package/icons/upload/index.esm.js +13 -2
- package/icons/upload/index.esm.min.js +1 -1
- package/icons/upload/index.js +13 -2
- package/icons/upload/index.min.js +1 -1
- package/icons/windowmaximize/index.cjs.js +13 -2
- package/icons/windowmaximize/index.cjs.min.js +1 -1
- package/icons/windowmaximize/index.esm.js +13 -2
- package/icons/windowmaximize/index.esm.min.js +1 -1
- package/icons/windowmaximize/index.js +13 -2
- package/icons/windowmaximize/index.min.js +1 -1
- package/icons/windowminimize/index.cjs.js +13 -2
- package/icons/windowminimize/index.cjs.min.js +1 -1
- package/icons/windowminimize/index.esm.js +13 -2
- package/icons/windowminimize/index.esm.min.js +1 -1
- package/icons/windowminimize/index.js +13 -2
- package/icons/windowminimize/index.min.js +1 -1
- package/image/image.cjs.js +85 -119
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +87 -121
- package/image/image.esm.min.js +1 -1
- package/image/image.js +86 -120
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +7 -0
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +7 -0
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +8 -2
- package/inplace/inplace.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +63 -19
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +7 -0
- package/inputnumber/inputnumber.esm.js +63 -19
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +63 -19
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +3 -3
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +3 -3
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +3 -3
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +7 -6
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +7 -6
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +7 -6
- package/inputtext/inputtext.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -1
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +8 -3
- package/listbox/listbox.esm.js +14 -1
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +14 -1
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +799 -179
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.d.ts +14 -0
- package/megamenu/megamenu.esm.js +801 -181
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +799 -179
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +7 -9
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +7 -9
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +7 -9
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +217 -166
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +15 -1
- package/menu/menu.esm.js +220 -169
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +217 -166
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +714 -179
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.d.ts +18 -0
- package/menubar/menubar.esm.js +717 -182
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +714 -179
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +2 -1
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +2 -1
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -1
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +5 -3
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +5 -3
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +5 -3
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +58 -35
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -1
- package/multiselect/multiselect.esm.js +58 -35
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +59 -37
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/orderlist.cjs.js +260 -105
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +18 -0
- package/orderlist/orderlist.esm.js +261 -106
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +260 -105
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +10 -0
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +10 -0
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +10 -0
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +9 -102
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +1 -1
- package/overlaypanel/overlaypanel.esm.js +11 -104
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +10 -103
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.d.ts +2 -2
- package/panel/panel.cjs.js +22 -19
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +22 -19
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +22 -19
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +774 -195
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +15 -0
- package/panelmenu/panelmenu.esm.js +775 -196
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +774 -195
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +163 -159
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +163 -159
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +163 -159
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +7 -2
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +1 -1
- package/password/password.esm.js +8 -3
- package/password/password.esm.min.js +1 -1
- package/password/password.js +7 -2
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +709 -181
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.d.ts +10 -0
- package/picklist/picklist.esm.js +708 -180
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +709 -181
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +7 -1
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +7 -1
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +7 -1
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +8352 -3145
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +8351 -3146
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +8352 -3145
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +27 -26
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +27 -26
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +28 -27
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +854 -790
- package/resources/themes/arya-green/theme.css +854 -790
- package/resources/themes/arya-orange/theme.css +854 -790
- package/resources/themes/arya-purple/theme.css +854 -790
- package/resources/themes/bootstrap4-dark-blue/theme.css +678 -615
- package/resources/themes/bootstrap4-dark-purple/theme.css +678 -615
- package/resources/themes/bootstrap4-light-blue/theme.css +679 -616
- package/resources/themes/bootstrap4-light-purple/theme.css +679 -616
- package/resources/themes/fluent-light/theme.css +686 -638
- package/resources/themes/lara-dark-amber/theme.css +679 -630
- package/resources/themes/lara-dark-blue/theme.css +679 -630
- package/resources/themes/lara-dark-cyan/theme.css +679 -630
- package/resources/themes/lara-dark-green/theme.css +679 -630
- package/resources/themes/lara-dark-indigo/theme.css +679 -630
- package/resources/themes/lara-dark-pink/theme.css +679 -630
- package/resources/themes/lara-dark-purple/theme.css +679 -630
- package/resources/themes/lara-dark-teal/theme.css +679 -630
- package/resources/themes/lara-light-amber/theme.css +776 -725
- package/resources/themes/lara-light-blue/theme.css +1011 -960
- package/resources/themes/lara-light-cyan/theme.css +776 -725
- package/resources/themes/lara-light-green/theme.css +820 -769
- package/resources/themes/lara-light-indigo/theme.css +1016 -965
- package/resources/themes/lara-light-pink/theme.css +776 -725
- package/resources/themes/lara-light-purple/theme.css +1016 -965
- package/resources/themes/lara-light-teal/theme.css +776 -725
- package/resources/themes/luna-amber/theme.css +950 -887
- package/resources/themes/luna-blue/theme.css +950 -887
- package/resources/themes/luna-green/theme.css +950 -887
- package/resources/themes/luna-pink/theme.css +950 -887
- package/resources/themes/md-dark-deeppurple/theme.css +918 -950
- package/resources/themes/md-dark-indigo/theme.css +918 -950
- package/resources/themes/md-light-deeppurple/theme.css +878 -910
- package/resources/themes/md-light-indigo/theme.css +878 -910
- package/resources/themes/mdc-dark-deeppurple/theme.css +918 -950
- package/resources/themes/mdc-dark-indigo/theme.css +918 -950
- package/resources/themes/mdc-light-deeppurple/theme.css +878 -910
- package/resources/themes/mdc-light-indigo/theme.css +878 -910
- package/resources/themes/mira/theme.css +1562 -1532
- package/resources/themes/nano/theme.css +707 -641
- package/resources/themes/nova/theme.css +705 -643
- package/resources/themes/nova-accent/theme.css +701 -636
- package/resources/themes/nova-alt/theme.css +705 -643
- package/resources/themes/rhea/theme.css +876 -811
- package/resources/themes/saga-blue/theme.css +896 -832
- package/resources/themes/saga-green/theme.css +896 -832
- package/resources/themes/saga-orange/theme.css +896 -832
- package/resources/themes/saga-purple/theme.css +896 -832
- package/resources/themes/soho-dark/theme.css +701 -643
- package/resources/themes/soho-light/theme.css +690 -634
- package/resources/themes/tailwind-light/theme.css +1370 -1306
- package/resources/themes/vela-blue/theme.css +862 -798
- package/resources/themes/vela-green/theme.css +862 -798
- package/resources/themes/vela-orange/theme.css +862 -798
- package/resources/themes/vela-purple/theme.css +862 -798
- package/resources/themes/viva-dark/theme.css +655 -612
- package/resources/themes/viva-light/theme.css +737 -694
- package/ripple/ripple.cjs.js +71 -5
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +71 -5
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +71 -5
- package/ripple/ripple.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +183 -3
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +184 -4
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +183 -3
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/sidebar/sidebar.cjs.js +62 -146
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +25 -3
- package/sidebar/sidebar.esm.js +65 -149
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +63 -147
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +7 -100
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +1 -1
- package/slidemenu/slidemenu.esm.js +10 -103
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +7 -100
- package/slidemenu/slidemenu.min.js +1 -1
- package/speeddial/speeddial.cjs.js +275 -32
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +277 -34
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +275 -32
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +1098 -309
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +5 -5
- package/splitbutton/splitbutton.esm.js +1100 -311
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +1096 -309
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +103 -15
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.d.ts +5 -0
- package/splitter/splitter.esm.js +103 -15
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +103 -15
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +99 -13
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +100 -14
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +99 -13
- package/steps/steps.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +113 -17
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +113 -17
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +113 -17
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +128 -20
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +35 -0
- package/tabview/tabview.esm.js +128 -20
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +128 -20
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +753 -275
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +11 -1
- package/tieredmenu/tieredmenu.esm.js +755 -277
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +753 -275
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/toast.cjs.js +6 -1
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +36 -2
- package/toast/toast.esm.js +6 -1
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +6 -1
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +74 -4
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +74 -4
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +75 -5
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.d.ts +27 -0
- package/tooltip/tooltipoptions.d.ts +1 -1
- package/tree/tree.cjs.js +198 -88
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +8 -0
- package/tree/tree.esm.js +199 -89
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +198 -88
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +185 -49
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +26 -1
- package/treeselect/treeselect.esm.js +186 -50
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +186 -51
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +59 -53
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +3 -3
- package/treetable/treetable.esm.js +59 -53
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +59 -53
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +19 -5
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +1 -1
- package/utils/utils.esm.js +19 -5
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +19 -5
- package/utils/utils.min.js +1 -1
- package/web-types.json +402 -33
package/menu/menu.cjs.js
CHANGED
|
@@ -91,6 +91,37 @@ function _defineProperty(obj, key, value) {
|
|
|
91
91
|
return obj;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
function _arrayLikeToArray(arr, len) {
|
|
95
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
96
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
97
|
+
return arr2;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function _arrayWithoutHoles(arr) {
|
|
101
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function _iterableToArray(iter) {
|
|
105
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
109
|
+
if (!o) return;
|
|
110
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
111
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
112
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
113
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
114
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function _nonIterableSpread() {
|
|
118
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function _toConsumableArray(arr) {
|
|
122
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
123
|
+
}
|
|
124
|
+
|
|
94
125
|
function _arrayWithHoles(arr) {
|
|
95
126
|
if (Array.isArray(arr)) return arr;
|
|
96
127
|
}
|
|
@@ -123,21 +154,6 @@ function _iterableToArrayLimit(r, l) {
|
|
|
123
154
|
}
|
|
124
155
|
}
|
|
125
156
|
|
|
126
|
-
function _arrayLikeToArray(arr, len) {
|
|
127
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
128
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
129
|
-
return arr2;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
133
|
-
if (!o) return;
|
|
134
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
135
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
136
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
137
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
138
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
157
|
function _nonIterableRest() {
|
|
142
158
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
143
159
|
}
|
|
@@ -146,7 +162,7 @@ function _slicedToArray(arr, i) {
|
|
|
146
162
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
147
163
|
}
|
|
148
164
|
|
|
149
|
-
var styles = "\n@layer primereact {\n .p-menu-overlay {\n position: absolute;\n /* Github #3122: Prevent animation flickering */\n top: -9999px;\n left: -9999px;\n }\n
|
|
165
|
+
var styles = "\n@layer primereact {\n .p-menu-overlay {\n position: absolute;\n /* Github #3122: Prevent animation flickering */\n top: -9999px;\n left: -9999px;\n }\n\n .p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menu .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menu .p-menuitem-text {\n line-height: 1;\n }\n}\n";
|
|
150
166
|
var classes = {
|
|
151
167
|
root: function root(_ref) {
|
|
152
168
|
var props = _ref.props,
|
|
@@ -158,15 +174,21 @@ var classes = {
|
|
|
158
174
|
});
|
|
159
175
|
},
|
|
160
176
|
menu: 'p-menu-list p-reset',
|
|
177
|
+
content: 'p-menuitem-content',
|
|
161
178
|
action: function action(_ref2) {
|
|
162
179
|
var item = _ref2.item;
|
|
163
180
|
return utils.classNames('p-menuitem-link', {
|
|
164
181
|
'p-disabled': item.disabled
|
|
165
182
|
});
|
|
166
183
|
},
|
|
167
|
-
menuitem:
|
|
168
|
-
|
|
169
|
-
|
|
184
|
+
menuitem: function menuitem(_ref3) {
|
|
185
|
+
var focused = _ref3.focused;
|
|
186
|
+
return utils.classNames('p-menuitem', {
|
|
187
|
+
'p-focus': focused
|
|
188
|
+
});
|
|
189
|
+
},
|
|
190
|
+
submenuHeader: function submenuHeader(_ref4) {
|
|
191
|
+
var submenu = _ref4.submenu;
|
|
170
192
|
return utils.classNames('p-submenu-header', {
|
|
171
193
|
'p-disabled': submenu.disabled
|
|
172
194
|
});
|
|
@@ -177,12 +199,12 @@ var classes = {
|
|
|
177
199
|
transition: 'p-connected-overlay'
|
|
178
200
|
};
|
|
179
201
|
var inlineStyles = {
|
|
180
|
-
submenuHeader: function submenuHeader(
|
|
181
|
-
var submenu =
|
|
202
|
+
submenuHeader: function submenuHeader(_ref5) {
|
|
203
|
+
var submenu = _ref5.submenu;
|
|
182
204
|
return submenu.style;
|
|
183
205
|
},
|
|
184
|
-
menuitem: function menuitem(
|
|
185
|
-
var item =
|
|
206
|
+
menuitem: function menuitem(_ref6) {
|
|
207
|
+
var item = _ref6.item;
|
|
186
208
|
return item.style;
|
|
187
209
|
}
|
|
188
210
|
};
|
|
@@ -190,6 +212,9 @@ var MenuBase = componentbase.ComponentBase.extend({
|
|
|
190
212
|
defaultProps: {
|
|
191
213
|
__TYPE: 'Menu',
|
|
192
214
|
id: null,
|
|
215
|
+
ariaLabel: null,
|
|
216
|
+
ariaLabelledBy: null,
|
|
217
|
+
tabIndex: 0,
|
|
193
218
|
model: null,
|
|
194
219
|
popup: false,
|
|
195
220
|
popupAlignment: 'left',
|
|
@@ -198,6 +223,8 @@ var MenuBase = componentbase.ComponentBase.extend({
|
|
|
198
223
|
autoZIndex: true,
|
|
199
224
|
baseZIndex: 0,
|
|
200
225
|
appendTo: null,
|
|
226
|
+
onFocus: null,
|
|
227
|
+
onBlur: null,
|
|
201
228
|
transitionOptions: null,
|
|
202
229
|
onShow: null,
|
|
203
230
|
onHide: null,
|
|
@@ -211,104 +238,6 @@ var MenuBase = componentbase.ComponentBase.extend({
|
|
|
211
238
|
}
|
|
212
239
|
});
|
|
213
240
|
|
|
214
|
-
var usePrevious = function usePrevious(newValue) {
|
|
215
|
-
var ref = React__namespace.useRef(undefined);
|
|
216
|
-
React__namespace.useEffect(function () {
|
|
217
|
-
ref.current = newValue;
|
|
218
|
-
});
|
|
219
|
-
return ref.current;
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
/* eslint-disable */
|
|
223
|
-
var useUnmountEffect = function useUnmountEffect(fn) {
|
|
224
|
-
return React__namespace.useEffect(function () {
|
|
225
|
-
return fn;
|
|
226
|
-
}, []);
|
|
227
|
-
};
|
|
228
|
-
/* eslint-enable */
|
|
229
|
-
|
|
230
|
-
/* eslint-disable */
|
|
231
|
-
var useEventListener = function useEventListener(_ref) {
|
|
232
|
-
var _ref$target = _ref.target,
|
|
233
|
-
target = _ref$target === void 0 ? 'document' : _ref$target,
|
|
234
|
-
type = _ref.type,
|
|
235
|
-
listener = _ref.listener,
|
|
236
|
-
options = _ref.options,
|
|
237
|
-
_ref$when = _ref.when,
|
|
238
|
-
when = _ref$when === void 0 ? true : _ref$when;
|
|
239
|
-
var targetRef = React__namespace.useRef(null);
|
|
240
|
-
var listenerRef = React__namespace.useRef(null);
|
|
241
|
-
var prevOptions = usePrevious(options);
|
|
242
|
-
var bind = function bind() {
|
|
243
|
-
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
244
|
-
if (utils.ObjectUtils.isNotEmpty(bindOptions.target)) {
|
|
245
|
-
unbind();
|
|
246
|
-
(bindOptions.when || when) && (targetRef.current = utils.DomHandler.getTargetElement(bindOptions.target));
|
|
247
|
-
}
|
|
248
|
-
if (!listenerRef.current && targetRef.current) {
|
|
249
|
-
listenerRef.current = function (event) {
|
|
250
|
-
return listener && listener(event);
|
|
251
|
-
};
|
|
252
|
-
targetRef.current.addEventListener(type, listenerRef.current, options);
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
var unbind = function unbind() {
|
|
256
|
-
if (listenerRef.current) {
|
|
257
|
-
targetRef.current.removeEventListener(type, listenerRef.current, options);
|
|
258
|
-
listenerRef.current = null;
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
React__namespace.useEffect(function () {
|
|
262
|
-
if (when) {
|
|
263
|
-
targetRef.current = utils.DomHandler.getTargetElement(target);
|
|
264
|
-
} else {
|
|
265
|
-
unbind();
|
|
266
|
-
targetRef.current = null;
|
|
267
|
-
}
|
|
268
|
-
}, [target, when]);
|
|
269
|
-
React__namespace.useEffect(function () {
|
|
270
|
-
if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {
|
|
271
|
-
unbind();
|
|
272
|
-
when && bind();
|
|
273
|
-
}
|
|
274
|
-
}, [listener, options]);
|
|
275
|
-
useUnmountEffect(function () {
|
|
276
|
-
unbind();
|
|
277
|
-
});
|
|
278
|
-
return [bind, unbind];
|
|
279
|
-
};
|
|
280
|
-
/* eslint-enable */
|
|
281
|
-
|
|
282
|
-
var useOnEscapeKey = function useOnEscapeKey(ref, condition, callback) {
|
|
283
|
-
var handleEsc = function handleEsc(event) {
|
|
284
|
-
if (event.key === 'Esc' || event.key === 'Escape') {
|
|
285
|
-
event.stopImmediatePropagation();
|
|
286
|
-
callback(event);
|
|
287
|
-
}
|
|
288
|
-
return;
|
|
289
|
-
};
|
|
290
|
-
var _useEventListener = useEventListener({
|
|
291
|
-
type: 'keydown',
|
|
292
|
-
listener: handleEsc
|
|
293
|
-
}),
|
|
294
|
-
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
295
|
-
bindKeyDownListener = _useEventListener2[0],
|
|
296
|
-
unbindKeyDownListener = _useEventListener2[1];
|
|
297
|
-
React__namespace.useEffect(function () {
|
|
298
|
-
if (!condition) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
if (!ref.current) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
bindKeyDownListener();
|
|
305
|
-
return function () {
|
|
306
|
-
unbindKeyDownListener();
|
|
307
|
-
};
|
|
308
|
-
});
|
|
309
|
-
return [ref, callback];
|
|
310
|
-
};
|
|
311
|
-
|
|
312
241
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
313
242
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
314
243
|
var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
@@ -322,6 +251,18 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
322
251
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
323
252
|
visibleState = _React$useState4[0],
|
|
324
253
|
setVisibleState = _React$useState4[1];
|
|
254
|
+
var _React$useState5 = React__namespace.useState(-1),
|
|
255
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
256
|
+
focusedOptionIndex = _React$useState6[0],
|
|
257
|
+
setFocusedOptionIndex = _React$useState6[1];
|
|
258
|
+
var _React$useState7 = React__namespace.useState(-1),
|
|
259
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
260
|
+
selectedOptionIndex = _React$useState8[0],
|
|
261
|
+
setSelectedOptionIndex = _React$useState8[1];
|
|
262
|
+
var _React$useState9 = React__namespace.useState(false),
|
|
263
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
264
|
+
focused = _React$useState10[0],
|
|
265
|
+
setFocused = _React$useState10[1];
|
|
325
266
|
var _MenuBase$setMetaData = MenuBase.setMetaData({
|
|
326
267
|
props: props,
|
|
327
268
|
state: {
|
|
@@ -337,16 +278,25 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
337
278
|
name: 'menu'
|
|
338
279
|
});
|
|
339
280
|
var menuRef = React__namespace.useRef(null);
|
|
281
|
+
var listRef = React__namespace.useRef(null);
|
|
340
282
|
var targetRef = React__namespace.useRef(null);
|
|
341
|
-
|
|
342
|
-
|
|
283
|
+
var popupMenuDisplayOrder = hooks.useDisplayOrder('menu', !!(visibleState && props.popup));
|
|
284
|
+
hooks.useGlobalOnEscapeKey({
|
|
285
|
+
callback: function callback(event) {
|
|
286
|
+
hide(event);
|
|
287
|
+
},
|
|
288
|
+
when: visibleState && props.popup && props.closeOnEscape,
|
|
289
|
+
priority: [hooks.ESC_KEY_HANDLING_PRIORITIES.MENU, popupMenuDisplayOrder]
|
|
343
290
|
});
|
|
344
291
|
var _useOverlayListener = hooks.useOverlayListener({
|
|
345
292
|
target: targetRef,
|
|
346
293
|
overlay: menuRef,
|
|
347
294
|
listener: function listener(event, _ref) {
|
|
348
295
|
var valid = _ref.valid;
|
|
349
|
-
|
|
296
|
+
if (valid) {
|
|
297
|
+
hide(event);
|
|
298
|
+
setFocusedOptionIndex(-1);
|
|
299
|
+
}
|
|
350
300
|
},
|
|
351
301
|
when: visibleState
|
|
352
302
|
}),
|
|
@@ -361,7 +311,7 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
361
311
|
});
|
|
362
312
|
}
|
|
363
313
|
};
|
|
364
|
-
var onItemClick = function onItemClick(event, item) {
|
|
314
|
+
var onItemClick = function onItemClick(event, item, key) {
|
|
365
315
|
if (item.disabled) {
|
|
366
316
|
event.preventDefault();
|
|
367
317
|
return;
|
|
@@ -378,32 +328,112 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
378
328
|
if (props.popup) {
|
|
379
329
|
hide(event);
|
|
380
330
|
}
|
|
331
|
+
if (!props.popup && focusedOptionIndex !== key) {
|
|
332
|
+
setFocusedOptionIndex(key);
|
|
333
|
+
}
|
|
334
|
+
event.preventDefault();
|
|
335
|
+
event.stopPropagation();
|
|
336
|
+
};
|
|
337
|
+
var onListFocus = function onListFocus(event) {
|
|
338
|
+
setFocused(true);
|
|
339
|
+
if (!props.popup) {
|
|
340
|
+
if (selectedOptionIndex !== -1) {
|
|
341
|
+
changeFocusedOptionIndex(selectedOptionIndex);
|
|
342
|
+
setSelectedOptionIndex(-1);
|
|
343
|
+
} else changeFocusedOptionIndex(0);
|
|
344
|
+
}
|
|
345
|
+
props.onFocus && props.onFocus(event);
|
|
381
346
|
};
|
|
382
|
-
var
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
347
|
+
var onListBlur = function onListBlur(event) {
|
|
348
|
+
setFocused(false);
|
|
349
|
+
setFocusedOptionIndex(-1);
|
|
350
|
+
props.onBlur && props.onBlur(event);
|
|
351
|
+
};
|
|
352
|
+
var onListKeyDown = function onListKeyDown(event) {
|
|
353
|
+
switch (event.code) {
|
|
354
|
+
case 'ArrowDown':
|
|
355
|
+
onArrowDownKey(event);
|
|
390
356
|
break;
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
event.preventDefault();
|
|
357
|
+
case 'ArrowUp':
|
|
358
|
+
onArrowUpKey(event);
|
|
359
|
+
break;
|
|
360
|
+
case 'Home':
|
|
361
|
+
onHomeKey(event);
|
|
397
362
|
break;
|
|
363
|
+
case 'End':
|
|
364
|
+
onEndKey(event);
|
|
365
|
+
break;
|
|
366
|
+
case 'Enter':
|
|
367
|
+
onEnterKey(event);
|
|
368
|
+
break;
|
|
369
|
+
case 'Space':
|
|
370
|
+
onSpaceKey(event);
|
|
371
|
+
break;
|
|
372
|
+
case 'Escape':
|
|
373
|
+
if (props.popup) {
|
|
374
|
+
utils.DomHandler.focus(targetRef.current);
|
|
375
|
+
hide(event);
|
|
376
|
+
}
|
|
377
|
+
case 'Tab':
|
|
378
|
+
props.popup && visibleState && hide(event);
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
var onArrowDownKey = function onArrowDownKey(event) {
|
|
383
|
+
var optionIndex = findNextOptionIndex(focusedOptionIndex);
|
|
384
|
+
changeFocusedOptionIndex(optionIndex);
|
|
385
|
+
event.preventDefault();
|
|
386
|
+
};
|
|
387
|
+
var onArrowUpKey = function onArrowUpKey(event) {
|
|
388
|
+
if (event.altKey && props.popup) {
|
|
389
|
+
utils.DomHandler.focus(targetRef.current);
|
|
390
|
+
hide(event);
|
|
391
|
+
event.preventDefault();
|
|
392
|
+
} else {
|
|
393
|
+
var optionIndex = findPrevOptionIndex(focusedOptionIndex);
|
|
394
|
+
changeFocusedOptionIndex(optionIndex);
|
|
395
|
+
event.preventDefault();
|
|
398
396
|
}
|
|
399
397
|
};
|
|
400
|
-
var
|
|
401
|
-
|
|
402
|
-
|
|
398
|
+
var onHomeKey = function onHomeKey(event) {
|
|
399
|
+
changeFocusedOptionIndex(0);
|
|
400
|
+
event.preventDefault();
|
|
401
|
+
};
|
|
402
|
+
var onEndKey = function onEndKey(event) {
|
|
403
|
+
changeFocusedOptionIndex(utils.DomHandler.find(menuRef.current, 'li[data-pc-section="menuitem"][data-p-disabled="false"]').length - 1);
|
|
404
|
+
event.preventDefault();
|
|
403
405
|
};
|
|
404
|
-
var
|
|
405
|
-
var
|
|
406
|
-
|
|
406
|
+
var onEnterKey = function onEnterKey(event) {
|
|
407
|
+
var element = utils.DomHandler.findSingle(menuRef.current, "li[id=\"".concat("".concat(focusedOptionIndex), "\"]"));
|
|
408
|
+
var anchorElement = element && utils.DomHandler.findSingle(element, 'a[data-pc-section="action"]');
|
|
409
|
+
props.popup && utils.DomHandler.focus(targetRef.current);
|
|
410
|
+
anchorElement ? anchorElement.click() : element && element.click();
|
|
411
|
+
event.preventDefault();
|
|
412
|
+
};
|
|
413
|
+
var onSpaceKey = function onSpaceKey(event) {
|
|
414
|
+
onEnterKey(event);
|
|
415
|
+
};
|
|
416
|
+
var findNextOptionIndex = function findNextOptionIndex(index) {
|
|
417
|
+
var links = utils.DomHandler.find(menuRef.current, 'li[data-pc-section="menuitem"][data-p-disabled="false"]');
|
|
418
|
+
var matchedOptionIndex = _toConsumableArray(links).findIndex(function (link) {
|
|
419
|
+
return link.id === index;
|
|
420
|
+
});
|
|
421
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex + 1 : 0;
|
|
422
|
+
};
|
|
423
|
+
var findPrevOptionIndex = function findPrevOptionIndex(index) {
|
|
424
|
+
var links = utils.DomHandler.find(menuRef.current, 'li[data-pc-section="menuitem"][data-p-disabled="false"]');
|
|
425
|
+
var matchedOptionIndex = _toConsumableArray(links).findIndex(function (link) {
|
|
426
|
+
return link.id === index;
|
|
427
|
+
});
|
|
428
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex - 1 : 0;
|
|
429
|
+
};
|
|
430
|
+
var changeFocusedOptionIndex = function changeFocusedOptionIndex(index) {
|
|
431
|
+
var links = utils.DomHandler.find(menuRef.current, 'li[data-pc-section="menuitem"][data-p-disabled="false"]');
|
|
432
|
+
var order = index >= links.length ? links.length - 1 : index < 0 ? 0 : index;
|
|
433
|
+
order > -1 && setFocusedOptionIndex(links[order].getAttribute('id'));
|
|
434
|
+
};
|
|
435
|
+
var focusedOptionId = function focusedOptionId() {
|
|
436
|
+
return focusedOptionIndex !== -1 ? focusedOptionIndex : null;
|
|
407
437
|
};
|
|
408
438
|
var toggle = function toggle(event) {
|
|
409
439
|
if (props.popup) {
|
|
@@ -428,6 +458,10 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
428
458
|
});
|
|
429
459
|
utils.ZIndexUtils.set('menu', menuRef.current, context && context.autoZIndex || PrimeReact__default["default"].autoZIndex, props.baseZIndex || context && context.zIndex['menu'] || PrimeReact__default["default"].zIndex['menu']);
|
|
430
460
|
utils.DomHandler.absolutePosition(menuRef.current, targetRef.current, props.popupAlignment);
|
|
461
|
+
if (props.popup) {
|
|
462
|
+
utils.DomHandler.focus(listRef.current);
|
|
463
|
+
changeFocusedOptionIndex(0);
|
|
464
|
+
}
|
|
431
465
|
};
|
|
432
466
|
var onEntered = function onEntered() {
|
|
433
467
|
bindOverlayListener();
|
|
@@ -463,11 +497,13 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
463
497
|
});
|
|
464
498
|
var createSubmenu = function createSubmenu(submenu, index) {
|
|
465
499
|
var key = idState + '_sub_' + index;
|
|
466
|
-
var items = submenu.items.map(
|
|
500
|
+
var items = submenu.items.map(function (item, index) {
|
|
501
|
+
return createMenuItem(item, index, key);
|
|
502
|
+
});
|
|
467
503
|
var submenuHeaderProps = utils.mergeProps({
|
|
468
504
|
id: key,
|
|
469
505
|
key: key,
|
|
470
|
-
role: '
|
|
506
|
+
role: 'none',
|
|
471
507
|
className: utils.classNames(submenu.className, cx('submenuHeader', {
|
|
472
508
|
submenu: submenu
|
|
473
509
|
})),
|
|
@@ -491,6 +527,7 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
491
527
|
return /*#__PURE__*/React__namespace.createElement("li", separatorProps);
|
|
492
528
|
};
|
|
493
529
|
var createMenuItem = function createMenuItem(item, index) {
|
|
530
|
+
var parentId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
494
531
|
if (item.visible === false) {
|
|
495
532
|
return null;
|
|
496
533
|
}
|
|
@@ -508,36 +545,36 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
508
545
|
className: cx('label')
|
|
509
546
|
}, ptm('label'));
|
|
510
547
|
var label = item.label && /*#__PURE__*/React__namespace.createElement("span", labelProps, item.label);
|
|
511
|
-
var
|
|
512
|
-
var
|
|
548
|
+
var key = item.id || (parentId || idState) + '_' + index;
|
|
549
|
+
var contentProps = utils.mergeProps({
|
|
550
|
+
onClick: function onClick(event) {
|
|
551
|
+
return onItemClick(event, item, key);
|
|
552
|
+
},
|
|
553
|
+
className: cx('content')
|
|
554
|
+
}, ptm('content'));
|
|
513
555
|
var actionProps = utils.mergeProps({
|
|
514
556
|
href: item.url || '#',
|
|
515
557
|
className: cx('action', {
|
|
516
558
|
item: item
|
|
517
559
|
}),
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
onClick: function onClick(event) {
|
|
521
|
-
return onItemClick(event, item);
|
|
560
|
+
onFocus: function onFocus(event) {
|
|
561
|
+
return event.stopPropagation();
|
|
522
562
|
},
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
563
|
+
target: item.target,
|
|
564
|
+
tabIndex: '-1',
|
|
565
|
+
'aria-label': item.label,
|
|
566
|
+
'aria-hidden': true,
|
|
527
567
|
'aria-disabled': item.disabled,
|
|
528
568
|
'data-p-disabled': item.disabled
|
|
529
569
|
}, ptm('action'));
|
|
530
|
-
var content = /*#__PURE__*/React__namespace.createElement("a", actionProps, icon, label);
|
|
570
|
+
var content = /*#__PURE__*/React__namespace.createElement("div", contentProps, /*#__PURE__*/React__namespace.createElement("a", actionProps, icon, label));
|
|
531
571
|
if (item.template) {
|
|
532
572
|
var defaultContentOptions = {
|
|
533
573
|
onClick: function onClick(event) {
|
|
534
|
-
return onItemClick(event, item);
|
|
535
|
-
},
|
|
536
|
-
onKeyDown: function onKeyDown(event) {
|
|
537
|
-
return onItemKeyDown(event);
|
|
574
|
+
return onItemClick(event, item, key);
|
|
538
575
|
},
|
|
539
576
|
className: linkClassName,
|
|
540
|
-
tabIndex:
|
|
577
|
+
tabIndex: '-1',
|
|
541
578
|
labelClassName: 'p-menuitem-text',
|
|
542
579
|
iconClassName: iconClassName,
|
|
543
580
|
element: content,
|
|
@@ -548,11 +585,16 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
548
585
|
var menuitemProps = utils.mergeProps({
|
|
549
586
|
id: key,
|
|
550
587
|
key: key,
|
|
551
|
-
className: utils.classNames(item.className, cx('menuitem'
|
|
588
|
+
className: utils.classNames(item.className, cx('menuitem', {
|
|
589
|
+
focused: focusedOptionIndex === key
|
|
590
|
+
})),
|
|
552
591
|
style: sx('menuitem', {
|
|
553
592
|
item: item
|
|
554
593
|
}),
|
|
555
|
-
role: '
|
|
594
|
+
role: 'menuitem',
|
|
595
|
+
'aria-label': item.label,
|
|
596
|
+
'aria-disabled': item.disabled,
|
|
597
|
+
'data-p-focused': focusedOptionId() === key,
|
|
556
598
|
'data-p-disabled': item.disabled || false
|
|
557
599
|
}, ptm('menuitem'));
|
|
558
600
|
return /*#__PURE__*/React__namespace.createElement("li", menuitemProps, content);
|
|
@@ -576,8 +618,17 @@ var Menu = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
576
618
|
}
|
|
577
619
|
}, MenuBase.getOtherProps(props), ptm('root'));
|
|
578
620
|
var menuProps = utils.mergeProps({
|
|
621
|
+
ref: listRef,
|
|
579
622
|
className: cx('menu'),
|
|
580
|
-
|
|
623
|
+
id: idState + '_list',
|
|
624
|
+
tabIndex: props.tabIndex || '0',
|
|
625
|
+
role: 'menu',
|
|
626
|
+
'aria-label': props.ariaLabel,
|
|
627
|
+
'aria-labelledby': props.ariaLabelledBy,
|
|
628
|
+
'aria-activedescendant': focused ? focusedOptionId() : undefined,
|
|
629
|
+
onFocus: onListFocus,
|
|
630
|
+
onKeyDown: onListKeyDown,
|
|
631
|
+
onBlur: onListBlur
|
|
581
632
|
}, ptm('menu'));
|
|
582
633
|
var transitionProps = utils.mergeProps({
|
|
583
634
|
classNames: cx('transition'),
|
package/menu/menu.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/componentbase"),r=require("primereact/csstransition"),i=require("primereact/hooks"),o=require("primereact/overlayservice"),u=require("primereact/portal"),a=require("primereact/utils");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=s(e),p=l(t);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(e,t){if("object"!==f(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function b(e){var t=d(e,"string");return"symbol"===f(t)?t:String(t)}function y(e){if(Array.isArray(e))return e}function v(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,u,a=[],l=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(s)throw i}}return a}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){return y(e)||v(e,t)||E(e,t)||O()}var x=n.ComponentBase.extend({defaultProps:{__TYPE:"Menu",id:null,model:null,popup:!1,popupAlignment:"left",style:null,className:null,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null,children:void 0,closeOnEscape:!0},css:{classes:{root:function(e){var t=e.context;return a.classNames("p-menu p-component",{"p-menu-overlay":e.props.popup,"p-input-filled":t&&"filled"===t.inputStyle||"filled"===p.default.inputStyle,"p-ripple-disabled":t&&!1===t.ripple||!1===p.default.ripple})},menu:"p-menu-list p-reset",action:function(e){return a.classNames("p-menuitem-link",{"p-disabled":e.item.disabled})},menuitem:"p-menuitem",submenuHeader:function(e){return a.classNames("p-submenu-header",{"p-disabled":e.submenu.disabled})},separator:"p-menu-separator",label:"p-menuitem-text",icon:"p-menuitem-icon",transition:"p-connected-overlay"},styles:"\n@layer primereact {\n .p-menu-overlay {\n position: absolute;\n /* Github #3122: Prevent animation flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n \n .p-menu .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n \n .p-menu .p-menuitem-text {\n line-height: 1;\n }\n}\n",inlineStyles:{submenuHeader:function(e){return e.submenu.style},menuitem:function(e){return e.item.style}}}}),P=function(e){var t,n,r,i=e.target,o=void 0===i?"document":i,u=e.type,l=e.listener,s=e.options,p=e.when,m=void 0===p||p,f=c.useRef(null),d=c.useRef(null),b=(t=s,n=c.useRef(void 0),c.useEffect((function(){n.current=t})),n.current),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a.ObjectUtils.isNotEmpty(e.target)&&(v(),(e.when||m)&&(f.current=a.DomHandler.getTargetElement(e.target))),!d.current&&f.current&&(d.current=function(e){return l&&l(e)},f.current.addEventListener(u,d.current,s))},v=function(){d.current&&(f.current.removeEventListener(u,d.current,s),d.current=null)};return c.useEffect((function(){m?f.current=a.DomHandler.getTargetElement(o):(v(),f.current=null)}),[o,m]),c.useEffect((function(){!d.current||d.current===l&&b===s||(v(),m&&y())}),[l,s]),r=function(){v()},c.useEffect((function(){return r}),[]),[y,v]},S=function(e,t,n){var r=h(P({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),n(e))}}),2),i=r[0],o=r[1];return c.useEffect((function(){if(t&&e.current)return i(),function(){o()}})),[e,n]};function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){var r,i,o;r=e,o=n[t],(i=b(i=t))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=c.memo(c.forwardRef((function(e,l){var s=c.useContext(t.PrimeReactContext),f=x.getProps(e,s),d=h(c.useState(f.id),2),b=d[0],y=d[1],v=h(c.useState(!f.popup),2),g=v[0],E=v[1],O=x.setMetaData({props:f,state:{id:b,visible:g}}),P=O.ptm,j=O.cx,N=O.sx;n.useHandleStyle(x.css.styles,O.isUnstyled,{name:"menu"});var D=c.useRef(null),I=c.useRef(null);S(I,f.popup&&f.closeOnEscape,(function(e){R(e)}));var k=h(i.useOverlayListener({target:I,overlay:D,listener:function(e,t){t.valid&&R(e)},when:g}),2),H=k[0],T=k[1],A=function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),f.popup&&R(e))},C=function(e,t){var n=e.currentTarget.parentElement;switch(e.which){case 40:var r=_(n);r&&r.children[0].focus(),e.preventDefault();break;case 38:var i=U(n);i&&i.children[0].focus(),e.preventDefault()}},_=function e(t){var n=t.nextElementSibling;return n?a.DomHandler.getAttribute(n,'[data-p-disabled="true"]')||!a.DomHandler.getAttribute(n,'[data-pc-section="menuitem"]')?e(n):n:null},U=function e(t){var n=t.previousElementSibling;return n?a.DomHandler.getAttribute(n,'[data-p-disabled="true"]')||!a.DomHandler.getAttribute(n,'[data-pc-section="menuitem"]')?e(n):n:null},q=function(e){f.popup&&(g?R(e):M(e))},M=function(e){I.current=e.currentTarget,E(!0),f.onShow&&f.onShow(e)},R=function(e){I.current=e.currentTarget,E(!1),f.onHide&&f.onHide(e)},Z=function(){a.DomHandler.addStyles(D.current,{position:"absolute",top:"0",left:"0"}),a.ZIndexUtils.set("menu",D.current,s&&s.autoZIndex||p.default.autoZIndex,f.baseZIndex||s&&s.zIndex.menu||p.default.zIndex.menu),a.DomHandler.absolutePosition(D.current,I.current,f.popupAlignment)},z=function(){H()},L=function(){I.current=null,T()},J=function(){a.ZIndexUtils.clear(D.current)};i.useMountEffect((function(){b||y(a.UniqueComponentId())})),i.useUnmountEffect((function(){a.ZIndexUtils.clear(D.current)})),c.useImperativeHandle(l,(function(){return{props:f,toggle:q,show:M,hide:R,getElement:function(){return D.current},getTarget:function(){return I.current}}}));var K=function(e,t){var n=b+"_sub_"+t,r=e.items.map(B),i=a.mergeProps({id:n,key:n,role:"presentation",className:a.classNames(e.className,j("submenuHeader",{submenu:e})),style:N("submenuHeader",{submenu:e}),"data-p-disabled":e.disabled},P("submenuHeader"));return c.createElement(c.Fragment,{key:n},c.createElement("li",i,e.label),r)},X=function(e){var t=b+"_separator_"+e,n=a.mergeProps({id:t,key:t,className:j("separator"),role:"separator"},P("separator"));return c.createElement("li",n)},B=function(e,t){if(!1===e.visible)return null;var n=a.classNames("p-menuitem-link",{"p-disabled":e.disabled}),r=a.classNames("p-menuitem-icon",e.icon),i=a.mergeProps({className:j("icon")},P("icon")),o=a.IconUtils.getJSXIcon(e.icon,w({},i),{props:f}),u=a.mergeProps({className:j("label")},P("label")),l=e.label&&c.createElement("span",u,e.label),s=e.disabled?null:0,p=e.id||b+"_"+t,m=a.mergeProps({href:e.url||"#",className:j("action",{item:e}),role:"menuitem",target:e.target,onClick:function(t){return A(t,e)},onKeyDown:function(e){return C(e)},tabIndex:s,"aria-disabled":e.disabled,"data-p-disabled":e.disabled},P("action")),d=c.createElement("a",m,o,l);e.template&&(d=a.ObjectUtils.getJSXElement(e.template,e,{onClick:function(t){return A(t,e)},onKeyDown:function(e){return C(e)},className:n,tabIndex:s,labelClassName:"p-menuitem-text",iconClassName:r,element:d,props:f}));var y=a.mergeProps({id:p,key:p,className:a.classNames(e.className,j("menuitem")),style:N("menuitem",{item:e}),role:"none","data-p-disabled":e.disabled||!1},P("menuitem"));return c.createElement("li",y,d)},F=function(e,t){return e.separator?X(t):e.items?K(e,t):B(e,t)},G=function(){if(f.model){var e=f.model.map(F),t=a.mergeProps({className:a.classNames(f.className,j("root",{context:s})),style:f.style,onClick:function(e){return t=e,void(f.popup&&o.OverlayService.emit("overlay-click",{originalEvent:t,target:I.current}));var t}},x.getOtherProps(f),P("root")),n=a.mergeProps({className:j("menu"),role:"menu"},P("menu")),i=a.mergeProps({classNames:j("transition"),in:g,timeout:{enter:120,exit:100},options:f.transitionOptions,unmountOnExit:!0,onEnter:Z,onEntered:z,onExit:L,onExited:J},P("transition"));return c.createElement(r.CSSTransition,m({nodeRef:D},i),c.createElement("div",m({id:f.id,ref:D},t),c.createElement("ul",n,e)))}return null}();return f.popup?c.createElement(u.Portal,{element:G,appendTo:f.appendTo}):G})));N.displayName="Menu",exports.Menu=N;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("primereact/api"),t=require("primereact/componentbase"),r=require("primereact/csstransition"),a=require("primereact/hooks"),o=require("primereact/overlayservice"),i=require("primereact/portal"),l=require("primereact/utils");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var c=s(e),p=u(n);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},m.apply(this,arguments)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(e,n){if("object"!==d(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}function b(e){var n=f(e,"string");return"symbol"===d(n)?n:String(n)}function y(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function v(e){if(Array.isArray(e))return y(e)}function g(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function O(e,n){if(e){if("string"==typeof e)return y(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(e,n):void 0}}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(e){return v(e)||g(e)||O(e)||h()}function E(e){if(Array.isArray(e))return e}function x(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,a,o,i,l=[],u=!0,s=!1;try{if(o=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;u=!1}else for(;!(u=(r=o.call(t)).done)&&(l.push(r.value),l.length!==n);u=!0);}catch(e){s=!0,a=e}finally{try{if(!u&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(s)throw a}}return l}}function P(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e,n){return E(e)||x(e,n)||O(e,n)||P()}var D=t.ComponentBase.extend({defaultProps:{__TYPE:"Menu",id:null,ariaLabel:null,ariaLabelledBy:null,tabIndex:0,model:null,popup:!1,popupAlignment:"left",style:null,className:null,autoZIndex:!0,baseZIndex:0,appendTo:null,onFocus:null,onBlur:null,transitionOptions:null,onShow:null,onHide:null,children:void 0,closeOnEscape:!0},css:{classes:{root:function(e){var n=e.context;return l.classNames("p-menu p-component",{"p-menu-overlay":e.props.popup,"p-input-filled":n&&"filled"===n.inputStyle||"filled"===p.default.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===p.default.ripple})},menu:"p-menu-list p-reset",content:"p-menuitem-content",action:function(e){return l.classNames("p-menuitem-link",{"p-disabled":e.item.disabled})},menuitem:function(e){return l.classNames("p-menuitem",{"p-focus":e.focused})},submenuHeader:function(e){return l.classNames("p-submenu-header",{"p-disabled":e.submenu.disabled})},separator:"p-menu-separator",label:"p-menuitem-text",icon:"p-menuitem-icon",transition:"p-connected-overlay"},styles:"\n@layer primereact {\n .p-menu-overlay {\n position: absolute;\n /* Github #3122: Prevent animation flickering */\n top: -9999px;\n left: -9999px;\n }\n\n .p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menu .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menu .p-menuitem-text {\n line-height: 1;\n }\n}\n",inlineStyles:{submenuHeader:function(e){return e.submenu.style},menuitem:function(e){return e.item.style}}}});function N(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function w(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?N(Object(t),!0).forEach((function(n){var r,a,o;r=e,o=t[n],(a=b(a=n))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):N(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var I=c.memo(c.forwardRef((function(e,u){var s=c.useContext(n.PrimeReactContext),d=D.getProps(e,s),f=j(c.useState(d.id),2),b=f[0],y=f[1],v=j(c.useState(!d.popup),2),g=v[0],O=v[1],h=j(c.useState(-1),2),E=h[0],x=h[1],P=j(c.useState(-1),2),N=P[0],I=P[1],k=j(c.useState(!1),2),H=k[0],A=k[1],_=D.setMetaData({props:d,state:{id:b,visible:g}}),T=_.ptm,C=_.cx,U=_.sx;t.useHandleStyle(D.css.styles,_.isUnstyled,{name:"menu"});var q=c.useRef(null),M=c.useRef(null),R=c.useRef(null),Z=a.useDisplayOrder("menu",!(!g||!d.popup));a.useGlobalOnEscapeKey({callback:function(e){ie(e)},when:g&&d.popup&&d.closeOnEscape,priority:[a.ESC_KEY_HANDLING_PRIORITIES.MENU,Z]});var B=j(a.useOverlayListener({target:R,overlay:q,listener:function(e,n){n.valid&&(ie(e),x(-1))},when:g}),2),F=B[0],L=B[1],K=function(e,n,t){n.disabled?e.preventDefault():(n.url||e.preventDefault(),n.command&&n.command({originalEvent:e,item:n}),d.popup&&ie(e),d.popup||E===t||x(t),e.preventDefault(),e.stopPropagation())},z=function(e){A(!0),d.popup||(-1!==N?(te(N),I(-1)):te(0)),d.onFocus&&d.onFocus(e)},G=function(e){A(!1),x(-1),d.onBlur&&d.onBlur(e)},J=function(e){switch(e.code){case"ArrowDown":X(e);break;case"ArrowUp":Y(e);break;case"Home":$(e);break;case"End":Q(e);break;case"Enter":V(e);break;case"Space":W(e);break;case"Escape":d.popup&&(l.DomHandler.focus(R.current),ie(e));case"Tab":d.popup&&g&&ie(e)}},X=function(e){var n=ee(E);te(n),e.preventDefault()},Y=function(e){if(e.altKey&&d.popup)l.DomHandler.focus(R.current),ie(e),e.preventDefault();else{var n=ne(E);te(n),e.preventDefault()}},$=function(e){te(0),e.preventDefault()},Q=function(e){te(l.DomHandler.find(q.current,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1),e.preventDefault()},V=function(e){var n=l.DomHandler.findSingle(q.current,'li[id="'.concat("".concat(E),'"]')),t=n&&l.DomHandler.findSingle(n,'a[data-pc-section="action"]');d.popup&&l.DomHandler.focus(R.current),t?t.click():n&&n.click(),e.preventDefault()},W=function(e){V(e)},ee=function(e){var n=S(l.DomHandler.find(q.current,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(n){return n.id===e}));return n>-1?n+1:0},ne=function(e){var n=S(l.DomHandler.find(q.current,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(n){return n.id===e}));return n>-1?n-1:0},te=function(e){var n=l.DomHandler.find(q.current,'li[data-pc-section="menuitem"][data-p-disabled="false"]'),t=e>=n.length?n.length-1:e<0?0:e;t>-1&&x(n[t].getAttribute("id"))},re=function(){return-1!==E?E:null},ae=function(e){d.popup&&(g?ie(e):oe(e))},oe=function(e){R.current=e.currentTarget,O(!0),d.onShow&&d.onShow(e)},ie=function(e){R.current=e.currentTarget,O(!1),d.onHide&&d.onHide(e)},le=function(){l.DomHandler.addStyles(q.current,{position:"absolute",top:"0",left:"0"}),l.ZIndexUtils.set("menu",q.current,s&&s.autoZIndex||p.default.autoZIndex,d.baseZIndex||s&&s.zIndex.menu||p.default.zIndex.menu),l.DomHandler.absolutePosition(q.current,R.current,d.popupAlignment),d.popup&&(l.DomHandler.focus(M.current),te(0))},ue=function(){F()},se=function(){R.current=null,L()},ce=function(){l.ZIndexUtils.clear(q.current)};a.useMountEffect((function(){b||y(l.UniqueComponentId())})),a.useUnmountEffect((function(){l.ZIndexUtils.clear(q.current)})),c.useImperativeHandle(u,(function(){return{props:d,toggle:ae,show:oe,hide:ie,getElement:function(){return q.current},getTarget:function(){return R.current}}}));var pe=function(e,n){var t=b+"_sub_"+n,r=e.items.map((function(e,n){return de(e,n,t)})),a=l.mergeProps({id:t,key:t,role:"none",className:l.classNames(e.className,C("submenuHeader",{submenu:e})),style:U("submenuHeader",{submenu:e}),"data-p-disabled":e.disabled},T("submenuHeader"));return c.createElement(c.Fragment,{key:t},c.createElement("li",a,e.label),r)},me=function(e){var n=b+"_separator_"+e,t=l.mergeProps({id:n,key:n,className:C("separator"),role:"separator"},T("separator"));return c.createElement("li",t)},de=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!1===e.visible)return null;var r=l.classNames("p-menuitem-link",{"p-disabled":e.disabled}),a=l.classNames("p-menuitem-icon",e.icon),o=l.mergeProps({className:C("icon")},T("icon")),i=l.IconUtils.getJSXIcon(e.icon,w({},o),{props:d}),u=l.mergeProps({className:C("label")},T("label")),s=e.label&&c.createElement("span",u,e.label),p=e.id||(t||b)+"_"+n,m=l.mergeProps({onClick:function(n){return K(n,e,p)},className:C("content")},T("content")),f=l.mergeProps({href:e.url||"#",className:C("action",{item:e}),onFocus:function(e){return e.stopPropagation()},target:e.target,tabIndex:"-1","aria-label":e.label,"aria-hidden":!0,"aria-disabled":e.disabled,"data-p-disabled":e.disabled},T("action")),y=c.createElement("div",m,c.createElement("a",f,i,s));e.template&&(y=l.ObjectUtils.getJSXElement(e.template,e,{onClick:function(n){return K(n,e,p)},className:r,tabIndex:"-1",labelClassName:"p-menuitem-text",iconClassName:a,element:y,props:d}));var v=l.mergeProps({id:p,key:p,className:l.classNames(e.className,C("menuitem",{focused:E===p})),style:U("menuitem",{item:e}),role:"menuitem","aria-label":e.label,"aria-disabled":e.disabled,"data-p-focused":re()===p,"data-p-disabled":e.disabled||!1},T("menuitem"));return c.createElement("li",v,y)},fe=function(e,n){return e.separator?me(n):e.items?pe(e,n):de(e,n)},be=function(){if(d.model){var e=d.model.map(fe),n=l.mergeProps({className:l.classNames(d.className,C("root",{context:s})),style:d.style,onClick:function(e){return n=e,void(d.popup&&o.OverlayService.emit("overlay-click",{originalEvent:n,target:R.current}));var n}},D.getOtherProps(d),T("root")),t=l.mergeProps({ref:M,className:C("menu"),id:b+"_list",tabIndex:d.tabIndex||"0",role:"menu","aria-label":d.ariaLabel,"aria-labelledby":d.ariaLabelledBy,"aria-activedescendant":H?re():void 0,onFocus:z,onKeyDown:J,onBlur:G},T("menu")),a=l.mergeProps({classNames:C("transition"),in:g,timeout:{enter:120,exit:100},options:d.transitionOptions,unmountOnExit:!0,onEnter:le,onEntered:ue,onExit:se,onExited:ce},T("transition"));return c.createElement(r.CSSTransition,m({nodeRef:q},a),c.createElement("div",m({id:d.id,ref:q},n),c.createElement("ul",t,e)))}return null}();return d.popup?c.createElement(i.Portal,{element:be,appendTo:d.appendTo}):be})));I.displayName="Menu",exports.Menu=I;
|
package/menu/menu.d.ts
CHANGED
|
@@ -118,12 +118,16 @@ export interface MenuProps extends Omit<React.DetailedHTMLProps<React.HTMLAttrib
|
|
|
118
118
|
* DOM element instance where the overlay panel should be mounted. Valid values are any DOM Element and 'self'. The self value is used to render a component where it is located.
|
|
119
119
|
* @defaultValue document.body
|
|
120
120
|
*/
|
|
121
|
-
appendTo?: 'self' | HTMLElement | null |
|
|
121
|
+
appendTo?: 'self' | HTMLElement | undefined | null | (() => HTMLElement);
|
|
122
122
|
/**
|
|
123
123
|
* The properties of CSSTransition can be customized, except for "nodeRef" and "in" properties.
|
|
124
124
|
* @type {CSSTransitionProps}
|
|
125
125
|
*/
|
|
126
126
|
transitionOptions?: CSSTransitionProps | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Index of the element in tabbing order.
|
|
129
|
+
*/
|
|
130
|
+
tabIndex?: number | undefined;
|
|
127
131
|
/**
|
|
128
132
|
* Callback to invoke when a popup menu is shown.
|
|
129
133
|
* @param {React.SyntheticEvent} event - Browser event.
|
|
@@ -134,6 +138,16 @@ export interface MenuProps extends Omit<React.DetailedHTMLProps<React.HTMLAttrib
|
|
|
134
138
|
* @param {React.SyntheticEvent} event - Browser event.
|
|
135
139
|
*/
|
|
136
140
|
onHide?(event: React.SyntheticEvent): void;
|
|
141
|
+
/**
|
|
142
|
+
* Callback to invoke when menu receives focus.
|
|
143
|
+
* @param {React.SyntheticEvent} event - Browser event.
|
|
144
|
+
*/
|
|
145
|
+
onFocus?(event: React.SyntheticEvent): void;
|
|
146
|
+
/**
|
|
147
|
+
* Callback to invoke when menu loses focus.
|
|
148
|
+
* @param {React.SyntheticEvent} event - Browser event.
|
|
149
|
+
*/
|
|
150
|
+
onBlur?(event: React.SyntheticEvent): void;
|
|
137
151
|
/**
|
|
138
152
|
* Used to get the child elements of the component.
|
|
139
153
|
* @readonly
|