primereact 10.3.0 → 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 +11 -8
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +36 -1
- package/accordion/accordion.esm.js +11 -8
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +9 -6
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +39 -33
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +13 -2
- package/api/api.esm.js +39 -33
- package/api/api.esm.min.js +1 -1
- package/api/api.js +39 -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/calendar/calendar.cjs.js +80 -43
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +3 -5
- package/calendar/calendar.esm.js +80 -43
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +80 -43
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +1 -1
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +1 -1
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +1 -1
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +42 -20
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +27 -4
- package/cascadeselect/cascadeselect.esm.js +43 -21
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +43 -21
- 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 -1
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +17 -2
- package/chip/chip.esm.js +5 -1
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +5 -1
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +2 -1
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -1
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -1
- package/chips/chips.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 +21 -18
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +19 -3
- package/confirmdialog/confirmdialog.esm.js +21 -18
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +21 -18
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +32 -120
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +12 -2
- package/confirmpopup/confirmpopup.esm.js +35 -123
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +32 -120
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +1 -1
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +1 -1
- package/contextmenu/contextmenu.esm.js +1 -1
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +1 -1
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +725 -458
- package/core/core.min.js +40 -40
- package/datatable/datatable.cjs.js +31 -24
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +4 -3
- package/datatable/datatable.esm.js +31 -24
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +31 -24
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.d.ts +1 -1
- package/dialog/dialog.cjs.js +27 -118
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +2 -2
- package/dialog/dialog.esm.js +34 -125
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +28 -119
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +5 -3
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +1 -1
- package/dropdown/dropdown.esm.js +5 -3
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +6 -4
- package/dropdown/dropdown.min.js +1 -1
- package/galleria/galleria.cjs.js +1 -1
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +1 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +1 -1
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +215 -76
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +8 -4
- package/hooks/hooks.esm.js +215 -78
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +215 -76
- package/hooks/hooks.min.js +1 -1
- package/icons/arrowdown/index.cjs.js +1 -1
- package/icons/arrowdown/index.cjs.min.js +1 -1
- package/icons/arrowdown/index.esm.js +1 -1
- package/icons/arrowdown/index.esm.min.js +1 -1
- package/icons/arrowdown/index.js +1 -1
- package/icons/arrowdown/index.min.js +1 -1
- package/icons/arrowup/index.cjs.js +1 -1
- package/icons/arrowup/index.cjs.min.js +1 -1
- package/icons/arrowup/index.esm.js +1 -1
- package/icons/arrowup/index.esm.min.js +1 -1
- package/icons/arrowup/index.js +1 -1
- package/icons/arrowup/index.min.js +1 -1
- package/icons/ban/index.cjs.js +1 -1
- package/icons/ban/index.cjs.min.js +1 -1
- package/icons/ban/index.esm.js +1 -1
- package/icons/ban/index.esm.min.js +1 -1
- package/icons/ban/index.js +1 -1
- package/icons/ban/index.min.js +1 -1
- package/icons/download/index.cjs.js +1 -1
- package/icons/download/index.cjs.min.js +1 -1
- package/icons/download/index.esm.js +1 -1
- package/icons/download/index.esm.min.js +1 -1
- package/icons/download/index.js +1 -1
- package/icons/download/index.min.js +1 -1
- package/icons/exclamationtriangle/index.cjs.js +1 -1
- package/icons/exclamationtriangle/index.cjs.min.js +1 -1
- package/icons/exclamationtriangle/index.esm.js +1 -1
- package/icons/exclamationtriangle/index.esm.min.js +1 -1
- package/icons/exclamationtriangle/index.js +1 -1
- package/icons/exclamationtriangle/index.min.js +1 -1
- package/icons/eyeslash/index.cjs.js +1 -1
- package/icons/eyeslash/index.cjs.min.js +1 -1
- package/icons/eyeslash/index.esm.js +1 -1
- package/icons/eyeslash/index.esm.min.js +1 -1
- package/icons/eyeslash/index.js +1 -1
- package/icons/eyeslash/index.min.js +1 -1
- package/icons/filter/index.cjs.js +1 -1
- package/icons/filter/index.cjs.min.js +1 -1
- package/icons/filter/index.esm.js +1 -1
- package/icons/filter/index.esm.min.js +1 -1
- package/icons/filter/index.js +1 -1
- package/icons/filter/index.min.js +1 -1
- package/icons/filterslash/index.cjs.js +1 -1
- package/icons/filterslash/index.cjs.min.js +1 -1
- package/icons/filterslash/index.esm.js +1 -1
- package/icons/filterslash/index.esm.min.js +1 -1
- package/icons/filterslash/index.js +1 -1
- package/icons/filterslash/index.min.js +1 -1
- package/icons/infocircle/index.cjs.js +1 -1
- package/icons/infocircle/index.cjs.min.js +1 -1
- package/icons/infocircle/index.esm.js +1 -1
- package/icons/infocircle/index.esm.min.js +1 -1
- package/icons/infocircle/index.js +1 -1
- package/icons/infocircle/index.min.js +1 -1
- package/icons/pencil/index.cjs.js +1 -1
- package/icons/pencil/index.cjs.min.js +1 -1
- package/icons/pencil/index.esm.js +1 -1
- package/icons/pencil/index.esm.min.js +1 -1
- package/icons/pencil/index.js +1 -1
- package/icons/pencil/index.min.js +1 -1
- package/icons/plus/index.cjs.js +1 -1
- package/icons/plus/index.cjs.min.js +1 -1
- package/icons/plus/index.esm.js +1 -1
- package/icons/plus/index.esm.min.js +1 -1
- package/icons/plus/index.js +1 -1
- package/icons/plus/index.min.js +1 -1
- package/icons/refresh/index.cjs.js +1 -1
- package/icons/refresh/index.cjs.min.js +1 -1
- package/icons/refresh/index.esm.js +1 -1
- package/icons/refresh/index.esm.min.js +1 -1
- package/icons/refresh/index.js +1 -1
- package/icons/refresh/index.min.js +1 -1
- package/icons/search/index.cjs.js +1 -1
- package/icons/search/index.cjs.min.js +1 -1
- package/icons/search/index.esm.js +1 -1
- package/icons/search/index.esm.min.js +1 -1
- package/icons/search/index.js +1 -1
- package/icons/search/index.min.js +1 -1
- package/icons/searchminus/index.cjs.js +1 -1
- package/icons/searchminus/index.cjs.min.js +1 -1
- package/icons/searchminus/index.esm.js +1 -1
- package/icons/searchminus/index.esm.min.js +1 -1
- package/icons/searchminus/index.js +1 -1
- package/icons/searchminus/index.min.js +1 -1
- package/icons/searchplus/index.cjs.js +1 -1
- package/icons/searchplus/index.cjs.min.js +1 -1
- package/icons/searchplus/index.esm.js +1 -1
- package/icons/searchplus/index.esm.min.js +1 -1
- package/icons/searchplus/index.js +1 -1
- package/icons/searchplus/index.min.js +1 -1
- package/icons/sortalt/index.cjs.js +1 -1
- package/icons/sortalt/index.cjs.min.js +1 -1
- package/icons/sortalt/index.esm.js +1 -1
- package/icons/sortalt/index.esm.min.js +1 -1
- package/icons/sortalt/index.js +1 -1
- package/icons/sortalt/index.min.js +1 -1
- package/icons/sortamountdown/index.cjs.js +1 -1
- package/icons/sortamountdown/index.cjs.min.js +1 -1
- package/icons/sortamountdown/index.esm.js +1 -1
- package/icons/sortamountdown/index.esm.min.js +1 -1
- package/icons/sortamountdown/index.js +1 -1
- package/icons/sortamountdown/index.min.js +1 -1
- package/icons/sortamountupalt/index.cjs.js +1 -1
- package/icons/sortamountupalt/index.cjs.min.js +1 -1
- package/icons/sortamountupalt/index.esm.js +1 -1
- package/icons/sortamountupalt/index.esm.min.js +1 -1
- package/icons/sortamountupalt/index.js +1 -1
- package/icons/sortamountupalt/index.min.js +1 -1
- package/icons/spinner/index.cjs.js +1 -1
- package/icons/spinner/index.cjs.min.js +1 -1
- package/icons/spinner/index.esm.js +1 -1
- package/icons/spinner/index.esm.min.js +1 -1
- package/icons/spinner/index.js +1 -1
- package/icons/spinner/index.min.js +1 -1
- package/icons/star/index.cjs.js +1 -1
- package/icons/star/index.cjs.min.js +1 -1
- package/icons/star/index.esm.js +1 -1
- package/icons/star/index.esm.min.js +1 -1
- package/icons/star/index.js +1 -1
- package/icons/star/index.min.js +1 -1
- package/icons/starfill/index.cjs.js +1 -1
- package/icons/starfill/index.cjs.min.js +1 -1
- package/icons/starfill/index.esm.js +1 -1
- package/icons/starfill/index.esm.min.js +1 -1
- package/icons/starfill/index.js +1 -1
- package/icons/starfill/index.min.js +1 -1
- package/icons/thlarge/index.cjs.js +1 -1
- package/icons/thlarge/index.cjs.min.js +1 -1
- package/icons/thlarge/index.esm.js +1 -1
- package/icons/thlarge/index.esm.min.js +1 -1
- package/icons/thlarge/index.js +1 -1
- package/icons/thlarge/index.min.js +1 -1
- package/icons/timescircle/index.cjs.js +1 -1
- package/icons/timescircle/index.cjs.min.js +1 -1
- package/icons/timescircle/index.esm.js +1 -1
- package/icons/timescircle/index.esm.min.js +1 -1
- package/icons/timescircle/index.js +1 -1
- package/icons/timescircle/index.min.js +1 -1
- package/icons/trash/index.cjs.js +1 -1
- package/icons/trash/index.cjs.min.js +1 -1
- package/icons/trash/index.esm.js +1 -1
- package/icons/trash/index.esm.min.js +1 -1
- package/icons/trash/index.js +1 -1
- package/icons/trash/index.min.js +1 -1
- package/icons/undo/index.cjs.js +1 -1
- package/icons/undo/index.cjs.min.js +1 -1
- package/icons/undo/index.esm.js +1 -1
- package/icons/undo/index.esm.min.js +1 -1
- package/icons/undo/index.js +1 -1
- package/icons/undo/index.min.js +1 -1
- package/icons/upload/index.cjs.js +1 -1
- package/icons/upload/index.cjs.min.js +1 -1
- package/icons/upload/index.esm.js +1 -1
- package/icons/upload/index.esm.min.js +1 -1
- package/icons/upload/index.js +1 -1
- package/icons/upload/index.min.js +1 -1
- package/icons/windowmaximize/index.cjs.js +1 -1
- package/icons/windowmaximize/index.cjs.min.js +1 -1
- package/icons/windowmaximize/index.esm.js +1 -1
- package/icons/windowmaximize/index.esm.min.js +1 -1
- package/icons/windowmaximize/index.js +1 -1
- package/icons/windowmaximize/index.min.js +1 -1
- package/icons/windowminimize/index.cjs.js +1 -1
- package/icons/windowminimize/index.cjs.min.js +1 -1
- package/icons/windowminimize/index.esm.js +1 -1
- package/icons/windowminimize/index.esm.min.js +1 -1
- package/icons/windowminimize/index.js +1 -1
- package/icons/windowminimize/index.min.js +1 -1
- package/image/image.cjs.js +20 -109
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +22 -111
- package/image/image.esm.min.js +1 -1
- package/image/image.js +21 -110
- 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 +67 -66
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +69 -68
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +67 -66
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +0 -3
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +1 -4
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +0 -3
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +7 -102
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +1 -1
- package/menu/menu.esm.js +10 -105
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +7 -102
- package/menu/menu.min.js +1 -1
- package/messages/messages.cjs.js +1 -1
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +1 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +1 -1
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +47 -30
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -1
- package/multiselect/multiselect.esm.js +47 -30
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +47 -30
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/orderlist.cjs.js +1 -1
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +10 -0
- package/orderlist/orderlist.esm.js +1 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +1 -1
- 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 -104
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +1 -1
- package/overlaypanel/overlaypanel.esm.js +11 -106
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +10 -105
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.d.ts +2 -2
- package/panelmenu/panelmenu.cjs.js +1 -1
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +1 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +1 -1
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +158 -155
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +158 -155
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +158 -155
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +8 -3
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +1 -1
- package/password/password.esm.js +9 -4
- package/password/password.esm.min.js +1 -1
- package/password/password.js +8 -3
- 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 +3391 -2429
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +3390 -2430
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +3391 -2429
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +26 -26
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +26 -26
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +27 -27
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +18 -9
- package/resources/themes/arya-green/theme.css +18 -9
- package/resources/themes/arya-orange/theme.css +18 -9
- package/resources/themes/arya-purple/theme.css +18 -9
- package/resources/themes/bootstrap4-dark-blue/theme.css +18 -9
- package/resources/themes/bootstrap4-dark-purple/theme.css +18 -9
- package/resources/themes/bootstrap4-light-blue/theme.css +18 -9
- package/resources/themes/bootstrap4-light-purple/theme.css +18 -9
- package/resources/themes/fluent-light/theme.css +18 -9
- package/resources/themes/lara-dark-amber/theme.css +18 -9
- package/resources/themes/lara-dark-blue/theme.css +18 -9
- package/resources/themes/lara-dark-cyan/theme.css +18 -9
- package/resources/themes/lara-dark-green/theme.css +18 -9
- package/resources/themes/lara-dark-indigo/theme.css +18 -9
- package/resources/themes/lara-dark-pink/theme.css +18 -9
- package/resources/themes/lara-dark-purple/theme.css +18 -9
- package/resources/themes/lara-dark-teal/theme.css +18 -9
- package/resources/themes/lara-light-amber/theme.css +18 -9
- package/resources/themes/lara-light-blue/theme.css +18 -9
- package/resources/themes/lara-light-cyan/theme.css +18 -9
- package/resources/themes/lara-light-green/theme.css +18 -9
- package/resources/themes/lara-light-indigo/theme.css +18 -9
- package/resources/themes/lara-light-pink/theme.css +18 -9
- package/resources/themes/lara-light-purple/theme.css +18 -9
- package/resources/themes/lara-light-teal/theme.css +18 -9
- package/resources/themes/luna-amber/theme.css +18 -9
- package/resources/themes/luna-blue/theme.css +18 -9
- package/resources/themes/luna-green/theme.css +18 -9
- package/resources/themes/luna-pink/theme.css +18 -9
- package/resources/themes/md-dark-deeppurple/theme.css +18 -9
- package/resources/themes/md-dark-indigo/theme.css +18 -9
- package/resources/themes/md-light-deeppurple/theme.css +18 -9
- package/resources/themes/md-light-indigo/theme.css +18 -9
- package/resources/themes/mdc-dark-deeppurple/theme.css +18 -9
- package/resources/themes/mdc-dark-indigo/theme.css +18 -9
- package/resources/themes/mdc-light-deeppurple/theme.css +18 -9
- package/resources/themes/mdc-light-indigo/theme.css +18 -9
- package/resources/themes/mira/theme.css +18 -9
- package/resources/themes/nano/theme.css +18 -9
- package/resources/themes/nova/theme.css +18 -9
- package/resources/themes/nova-accent/theme.css +18 -9
- package/resources/themes/nova-alt/theme.css +18 -9
- package/resources/themes/rhea/theme.css +18 -9
- package/resources/themes/saga-blue/theme.css +18 -9
- package/resources/themes/saga-green/theme.css +18 -9
- package/resources/themes/saga-orange/theme.css +18 -9
- package/resources/themes/saga-purple/theme.css +18 -9
- package/resources/themes/soho-dark/theme.css +18 -9
- package/resources/themes/soho-light/theme.css +18 -9
- package/resources/themes/tailwind-light/theme.css +18 -9
- package/resources/themes/vela-blue/theme.css +18 -9
- package/resources/themes/vela-green/theme.css +18 -9
- package/resources/themes/vela-orange/theme.css +18 -9
- package/resources/themes/vela-purple/theme.css +18 -9
- package/resources/themes/viva-dark/theme.css +18 -9
- package/resources/themes/viva-light/theme.css +18 -9
- package/ripple/ripple.cjs.js +6 -3
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +6 -3
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +6 -3
- package/ripple/ripple.min.js +1 -1
- package/sidebar/sidebar.cjs.js +8 -105
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +3 -3
- package/sidebar/sidebar.esm.js +11 -108
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +9 -106
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +7 -102
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +1 -1
- package/slidemenu/slidemenu.esm.js +10 -105
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +7 -102
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +1 -1
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +1 -1
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +1 -1
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +11 -3
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +12 -4
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +11 -3
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +89 -81
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +1 -1
- package/splitbutton/splitbutton.esm.js +90 -82
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +89 -81
- package/splitbutton/splitbutton.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +9 -7
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +9 -7
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +9 -7
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +22 -8
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +35 -0
- package/tabview/tabview.esm.js +22 -8
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +22 -8
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +1 -1
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +1 -1
- package/tieredmenu/tieredmenu.esm.js +1 -1
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +1 -1
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/toast.d.ts +2 -2
- 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 +244 -131
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +8 -0
- package/tree/tree.esm.js +245 -132
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +244 -131
- 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 +67 -44
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +3 -3
- package/treetable/treetable.esm.js +67 -44
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +67 -44
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +7 -4
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +1 -1
- package/utils/utils.esm.js +7 -4
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +7 -4
- package/utils/utils.min.js +1 -1
- package/web-types.json +136 -29
package/hooks/hooks.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useState, useRef, useContext
|
|
4
|
-
import { DomHandler, ObjectUtils } from 'primereact/utils';
|
|
3
|
+
import { useEffect, useState, useRef, useContext } from 'react';
|
|
4
|
+
import { DomHandler, ObjectUtils, UniqueComponentId } from 'primereact/utils';
|
|
5
5
|
import PrimeReact, { PrimeReactContext } from 'primereact/api';
|
|
6
6
|
|
|
7
7
|
function _arrayWithHoles(arr) {
|
|
@@ -196,36 +196,6 @@ var useCounter = function useCounter() {
|
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
-
/* eslint-disable */
|
|
200
|
-
var useTimeout = function useTimeout(fn) {
|
|
201
|
-
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
202
|
-
var when = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
203
|
-
var timeout = React.useRef(null);
|
|
204
|
-
var savedCallback = React.useRef(null);
|
|
205
|
-
var clear = React.useCallback(function () {
|
|
206
|
-
return clearTimeout(timeout.current);
|
|
207
|
-
}, [timeout.current]);
|
|
208
|
-
React.useEffect(function () {
|
|
209
|
-
savedCallback.current = fn;
|
|
210
|
-
});
|
|
211
|
-
React.useEffect(function () {
|
|
212
|
-
function callback() {
|
|
213
|
-
savedCallback.current();
|
|
214
|
-
}
|
|
215
|
-
if (when) {
|
|
216
|
-
timeout.current = setTimeout(callback, delay);
|
|
217
|
-
return clear;
|
|
218
|
-
} else {
|
|
219
|
-
clear();
|
|
220
|
-
}
|
|
221
|
-
}, [delay, when]);
|
|
222
|
-
useUnmountEffect(function () {
|
|
223
|
-
clear();
|
|
224
|
-
});
|
|
225
|
-
return [clear];
|
|
226
|
-
};
|
|
227
|
-
/* eslint-enable */
|
|
228
|
-
|
|
229
199
|
var useDebounce = function useDebounce(initialValue, delay) {
|
|
230
200
|
var _React$useState = React.useState(initialValue),
|
|
231
201
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -235,12 +205,64 @@ var useDebounce = function useDebounce(initialValue, delay) {
|
|
|
235
205
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
236
206
|
debouncedValue = _React$useState4[0],
|
|
237
207
|
setDebouncedValue = _React$useState4[1];
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
208
|
+
var mountedRef = React.useRef(false);
|
|
209
|
+
var timeoutRef = React.useRef(null);
|
|
210
|
+
var cancelTimer = function cancelTimer() {
|
|
211
|
+
return window.clearTimeout(timeoutRef.current);
|
|
212
|
+
};
|
|
213
|
+
useMountEffect(function () {
|
|
214
|
+
mountedRef.current = true;
|
|
215
|
+
});
|
|
216
|
+
useUnmountEffect(function () {
|
|
217
|
+
cancelTimer();
|
|
218
|
+
});
|
|
219
|
+
React.useEffect(function () {
|
|
220
|
+
if (!mountedRef.current) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
cancelTimer();
|
|
224
|
+
timeoutRef.current = window.setTimeout(function () {
|
|
225
|
+
setDebouncedValue(inputValue);
|
|
226
|
+
}, delay);
|
|
227
|
+
}, [inputValue, delay]);
|
|
241
228
|
return [inputValue, debouncedValue, setInputValue];
|
|
242
229
|
};
|
|
243
230
|
|
|
231
|
+
var groupToDisplayedElements = {};
|
|
232
|
+
var useDisplayOrder = function useDisplayOrder(group) {
|
|
233
|
+
var isVisible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
234
|
+
var _React$useState = React.useState(function () {
|
|
235
|
+
return UniqueComponentId();
|
|
236
|
+
}),
|
|
237
|
+
_React$useState2 = _slicedToArray(_React$useState, 1),
|
|
238
|
+
uid = _React$useState2[0];
|
|
239
|
+
var _React$useState3 = React.useState(),
|
|
240
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
241
|
+
displayOrder = _React$useState4[0],
|
|
242
|
+
setDisplayOrder = _React$useState4[1];
|
|
243
|
+
React.useEffect(function () {
|
|
244
|
+
if (isVisible) {
|
|
245
|
+
if (!(group in groupToDisplayedElements)) {
|
|
246
|
+
groupToDisplayedElements[group] = [];
|
|
247
|
+
}
|
|
248
|
+
var newDisplayOrder = groupToDisplayedElements[group].length;
|
|
249
|
+
groupToDisplayedElements[group].push(uid);
|
|
250
|
+
setDisplayOrder(newDisplayOrder);
|
|
251
|
+
return function () {
|
|
252
|
+
delete groupToDisplayedElements[group][newDisplayOrder];
|
|
253
|
+
var lastOrder = groupToDisplayedElements[group].findLastIndex(function (el) {
|
|
254
|
+
return el !== undefined;
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// Reduce array length, by removing undefined elements at the end of array:
|
|
258
|
+
groupToDisplayedElements[group].splice(lastOrder + 1);
|
|
259
|
+
setDisplayOrder(undefined);
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}, [group, uid, isVisible]);
|
|
263
|
+
return displayOrder;
|
|
264
|
+
};
|
|
265
|
+
|
|
244
266
|
var TYPE_MAP = {
|
|
245
267
|
ico: 'image/x-icon',
|
|
246
268
|
png: 'image/png',
|
|
@@ -265,6 +287,121 @@ var useFavicon = function useFavicon() {
|
|
|
265
287
|
}, [newIcon, rel]);
|
|
266
288
|
};
|
|
267
289
|
|
|
290
|
+
function _arrayWithoutHoles(arr) {
|
|
291
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function _iterableToArray(iter) {
|
|
295
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function _nonIterableSpread() {
|
|
299
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function _toConsumableArray(arr) {
|
|
303
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Priorities of different components (bigger number handled first)
|
|
308
|
+
*/
|
|
309
|
+
var ESC_KEY_HANDLING_PRIORITIES = {
|
|
310
|
+
SIDEBAR: 100,
|
|
311
|
+
SLIDE_MENU: 200,
|
|
312
|
+
DIALOG: 300,
|
|
313
|
+
IMAGE: 400,
|
|
314
|
+
MENU: 500,
|
|
315
|
+
OVERLAY_PANEL: 600,
|
|
316
|
+
PASSWORD: 700,
|
|
317
|
+
CASCADE_SELECT: 800,
|
|
318
|
+
SPLIT_BUTTON: 900,
|
|
319
|
+
SPEED_DIAL: 1000
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Object, that manages global escape key handling logic
|
|
324
|
+
*/
|
|
325
|
+
var globalEscKeyHandlingLogic = {
|
|
326
|
+
/**
|
|
327
|
+
* Mapping from ESC_KEY_HANDLING_PRIORITY to array of related listeners, grouped by priority
|
|
328
|
+
* @example
|
|
329
|
+
* Map<{
|
|
330
|
+
* [ESC_KEY_HANDLING_PRIORITIES.SIDEBAR]: Map<{
|
|
331
|
+
* 1: () => {...},
|
|
332
|
+
* 2: () => {...}
|
|
333
|
+
* }>,
|
|
334
|
+
* [ESC_KEY_HANDLING_PRIORITIES.DIALOG]: Map<{
|
|
335
|
+
* 1: () => {...},
|
|
336
|
+
* 2: () => {...}
|
|
337
|
+
* }>
|
|
338
|
+
* }>;
|
|
339
|
+
*/
|
|
340
|
+
escKeyListeners: new Map(),
|
|
341
|
+
/**
|
|
342
|
+
* Keydown handler (attached to any keydown)
|
|
343
|
+
*/
|
|
344
|
+
onGlobalKeyDown: function onGlobalKeyDown(event) {
|
|
345
|
+
// Do nothing if not an "esc" key is pressed:
|
|
346
|
+
if (event.key !== 'Esc' && event.key !== 'Escape') return;
|
|
347
|
+
var escKeyListeners = globalEscKeyHandlingLogic.escKeyListeners;
|
|
348
|
+
var maxPrimaryPriority = Math.max.apply(Math, _toConsumableArray(escKeyListeners.keys()));
|
|
349
|
+
var theMostImportantEscHandlersSet = escKeyListeners.get(maxPrimaryPriority);
|
|
350
|
+
var maxSecondaryPriority = Math.max.apply(Math, _toConsumableArray(theMostImportantEscHandlersSet.keys()));
|
|
351
|
+
var theMostImportantEscHandler = theMostImportantEscHandlersSet.get(maxSecondaryPriority);
|
|
352
|
+
theMostImportantEscHandler(event);
|
|
353
|
+
},
|
|
354
|
+
/**
|
|
355
|
+
* Attach global keydown listener if there are any "esc" key handlers assigned,
|
|
356
|
+
* otherwise detach.
|
|
357
|
+
*/
|
|
358
|
+
refreshGlobalKeyDownListener: function refreshGlobalKeyDownListener() {
|
|
359
|
+
var document = DomHandler.getTargetElement('document');
|
|
360
|
+
if (this.escKeyListeners.size > 0) {
|
|
361
|
+
document.addEventListener('keydown', this.onGlobalKeyDown);
|
|
362
|
+
} else {
|
|
363
|
+
document.removeEventListener('keydown', this.onGlobalKeyDown);
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
/**
|
|
367
|
+
* Add "Esc" key handler
|
|
368
|
+
*/
|
|
369
|
+
addListener: function addListener(callback, _ref) {
|
|
370
|
+
var _this = this;
|
|
371
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
372
|
+
primaryPriority = _ref2[0],
|
|
373
|
+
secondaryPriority = _ref2[1];
|
|
374
|
+
var escKeyListeners = this.escKeyListeners;
|
|
375
|
+
if (!escKeyListeners.has(primaryPriority)) {
|
|
376
|
+
escKeyListeners.set(primaryPriority, new Map());
|
|
377
|
+
}
|
|
378
|
+
var primaryPriorityListeners = escKeyListeners.get(primaryPriority);
|
|
379
|
+
|
|
380
|
+
// To prevent unexpected override of callback:
|
|
381
|
+
if (primaryPriorityListeners.has(secondaryPriority)) {
|
|
382
|
+
throw new Error("Unexpected: global esc key listener with priority [".concat(primaryPriority, ", ").concat(secondaryPriority, "] already exists."));
|
|
383
|
+
}
|
|
384
|
+
primaryPriorityListeners.set(secondaryPriority, callback);
|
|
385
|
+
this.refreshGlobalKeyDownListener();
|
|
386
|
+
return function () {
|
|
387
|
+
primaryPriorityListeners["delete"](secondaryPriority);
|
|
388
|
+
if (primaryPriorityListeners.size === 0) {
|
|
389
|
+
escKeyListeners["delete"](primaryPriority);
|
|
390
|
+
}
|
|
391
|
+
_this.refreshGlobalKeyDownListener();
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
var useGlobalOnEscapeKey = function useGlobalOnEscapeKey(_ref3) {
|
|
396
|
+
var callback = _ref3.callback,
|
|
397
|
+
when = _ref3.when,
|
|
398
|
+
priority = _ref3.priority;
|
|
399
|
+
useEffect(function () {
|
|
400
|
+
if (!when) return;
|
|
401
|
+
return globalEscKeyHandlingLogic.addListener(callback, priority);
|
|
402
|
+
}, [when, callback, priority]);
|
|
403
|
+
};
|
|
404
|
+
|
|
268
405
|
var useIntersectionObserver = function useIntersectionObserver(ref) {
|
|
269
406
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
270
407
|
var _React$useState = React.useState(false),
|
|
@@ -923,19 +1060,6 @@ var useSessionStorage = function useSessionStorage(initialValue, key) {
|
|
|
923
1060
|
};
|
|
924
1061
|
/* eslint-enable */
|
|
925
1062
|
|
|
926
|
-
/* eslint-disable */
|
|
927
|
-
var useUpdateEffect = function useUpdateEffect(fn, deps) {
|
|
928
|
-
var mounted = React.useRef(false);
|
|
929
|
-
return React.useEffect(function () {
|
|
930
|
-
if (!mounted.current) {
|
|
931
|
-
mounted.current = true;
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
return fn && fn();
|
|
935
|
-
}, deps);
|
|
936
|
-
};
|
|
937
|
-
/* eslint-enable */
|
|
938
|
-
|
|
939
1063
|
var _id = 0;
|
|
940
1064
|
var useStyle = function useStyle(css) {
|
|
941
1065
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -960,17 +1084,17 @@ var useStyle = function useStyle(css) {
|
|
|
960
1084
|
isLoaded && css !== newCSS && (styleRef.current.textContent = newCSS);
|
|
961
1085
|
};
|
|
962
1086
|
var load = function load() {
|
|
963
|
-
if (!document) return;
|
|
964
|
-
|
|
1087
|
+
if (!document || isLoaded) return;
|
|
1088
|
+
var styleContainer = (context === null || context === void 0 ? void 0 : context.styleContainer) || document.head;
|
|
1089
|
+
styleRef.current = styleContainer.querySelector("style[data-primereact-style-id=\"".concat(name, "\"]")) || document.getElementById(id) || document.createElement('style');
|
|
965
1090
|
if (!styleRef.current.isConnected) {
|
|
966
1091
|
styleRef.current.type = 'text/css';
|
|
967
1092
|
id && (styleRef.current.id = id);
|
|
968
1093
|
media && (styleRef.current.media = media);
|
|
969
1094
|
DomHandler.addNonce(styleRef.current, context && context.nonce || PrimeReact.nonce);
|
|
970
|
-
|
|
1095
|
+
styleContainer.appendChild(styleRef.current);
|
|
971
1096
|
name && styleRef.current.setAttribute('data-primereact-style-id', name);
|
|
972
1097
|
}
|
|
973
|
-
if (isLoaded) return;
|
|
974
1098
|
styleRef.current.textContent = css;
|
|
975
1099
|
setIsLoaded(true);
|
|
976
1100
|
};
|
|
@@ -984,7 +1108,7 @@ var useStyle = function useStyle(css) {
|
|
|
984
1108
|
|
|
985
1109
|
// return () => {if (!manual) unload()}; /* @todo */
|
|
986
1110
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
987
|
-
}, []);
|
|
1111
|
+
}, [manual]);
|
|
988
1112
|
return {
|
|
989
1113
|
id: id,
|
|
990
1114
|
name: name,
|
|
@@ -995,34 +1119,47 @@ var useStyle = function useStyle(css) {
|
|
|
995
1119
|
};
|
|
996
1120
|
};
|
|
997
1121
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
type: 'keydown',
|
|
1008
|
-
listener: handleEsc
|
|
1009
|
-
}),
|
|
1010
|
-
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
1011
|
-
bindKeyDownListener = _useEventListener2[0],
|
|
1012
|
-
unbindKeyDownListener = _useEventListener2[1];
|
|
1122
|
+
/* eslint-disable */
|
|
1123
|
+
var useTimeout = function useTimeout(fn) {
|
|
1124
|
+
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1125
|
+
var when = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
1126
|
+
var timeout = React.useRef(null);
|
|
1127
|
+
var savedCallback = React.useRef(null);
|
|
1128
|
+
var clear = React.useCallback(function () {
|
|
1129
|
+
return clearTimeout(timeout.current);
|
|
1130
|
+
}, [timeout.current]);
|
|
1013
1131
|
React.useEffect(function () {
|
|
1014
|
-
|
|
1015
|
-
|
|
1132
|
+
savedCallback.current = fn;
|
|
1133
|
+
});
|
|
1134
|
+
React.useEffect(function () {
|
|
1135
|
+
function callback() {
|
|
1136
|
+
savedCallback.current();
|
|
1016
1137
|
}
|
|
1017
|
-
if (
|
|
1018
|
-
|
|
1138
|
+
if (when) {
|
|
1139
|
+
timeout.current = setTimeout(callback, delay);
|
|
1140
|
+
return clear;
|
|
1141
|
+
} else {
|
|
1142
|
+
clear();
|
|
1019
1143
|
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
};
|
|
1144
|
+
}, [delay, when]);
|
|
1145
|
+
useUnmountEffect(function () {
|
|
1146
|
+
clear();
|
|
1024
1147
|
});
|
|
1025
|
-
return [
|
|
1148
|
+
return [clear];
|
|
1149
|
+
};
|
|
1150
|
+
/* eslint-enable */
|
|
1151
|
+
|
|
1152
|
+
/* eslint-disable */
|
|
1153
|
+
var useUpdateEffect = function useUpdateEffect(fn, deps) {
|
|
1154
|
+
var mounted = React.useRef(false);
|
|
1155
|
+
return React.useEffect(function () {
|
|
1156
|
+
if (!mounted.current) {
|
|
1157
|
+
mounted.current = true;
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
return fn && fn();
|
|
1161
|
+
}, deps);
|
|
1026
1162
|
};
|
|
1163
|
+
/* eslint-enable */
|
|
1027
1164
|
|
|
1028
|
-
export { useClickOutside, useCounter, useDebounce, useEventListener, useFavicon, useIntersectionObserver, useInterval, useLocalStorage, useMatchMedia, useMountEffect, useMouse, useMove,
|
|
1165
|
+
export { ESC_KEY_HANDLING_PRIORITIES, useClickOutside, useCounter, useDebounce, useDisplayOrder, useEventListener, useFavicon, useGlobalOnEscapeKey, useIntersectionObserver, useInterval, useLocalStorage, useMatchMedia, useMountEffect, useMouse, useMove, useOverlayListener, useOverlayScrollListener, usePrevious, useResizeListener, useSessionStorage, useStorage, useStyle, useTimeout, useUnmountEffect, useUpdateEffect };
|
package/hooks/hooks.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useState as t,useRef as n,useContext as r,useEffect as u}from"react";import{DomHandler as c,ObjectUtils as o}from"primereact/utils";import i,{PrimeReactContext as a}from"primereact/api";function f(e){if(Array.isArray(e))return e}function l(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,c,o,i=[],a=!0,f=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=c.call(n)).done)&&(i.push(r.value),i.length!==t);a=!0);}catch(e){f=!0,u=e}finally{try{if(!a&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw u}}return i}}function s(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 d(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function v(){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 p(e,t){return f(e)||l(e,t)||d(e,t)||v()}var m=function(t){var n=e.useRef(void 0);return e.useEffect((function(){n.current=t})),n.current},g=function(t){return e.useEffect((function(){return t}),[])},y=function(t){var n=t.target,r=void 0===n?"document":n,u=t.type,i=t.listener,a=t.options,f=t.when,l=void 0===f||f,s=e.useRef(null),d=e.useRef(null),v=m(i),p=m(a),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o.isNotEmpty(e.target)&&(h(),(e.when||l)&&(s.current=c.getTargetElement(e.target))),!d.current&&s.current&&(d.current=function(e){return i&&i(e)},s.current.addEventListener(u,d.current,a))},h=function(){d.current&&(s.current.removeEventListener(u,d.current,a),d.current=null)};return e.useEffect((function(){l?s.current=c.getTargetElement(r):(h(),s.current=null)}),[r,l]),e.useEffect((function(){!d.current||""+v==""+i&&p===a||(h(),l&&y())}),[i,a,l]),g((function(){h()})),[y,h]},h=function(t,n){var r=function(e){t.current&&!t.current.contains(e.target)&&n(e)},u=p(y({type:"mousedown",listener:r}),2),c=u[0],o=u[1],i=p(y({type:"touchstart",listener:r}),2),a=i[0],f=i[1];return e.useEffect((function(){if(t.current)return c(),a(),function(){o(),f()}})),[t,n]},w=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{step:1},n=p(e.useState(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0),2),r=n[0],u=n[1];return{count:r,increment:function(){t.max&&r>=t.max||u(r+t.step)},decrement:function(){if(t.min||0===t.min&&r<=t.min)return null;u(r-t.step)},reset:function(){u(0)}}},b=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=e.useRef(null),c=e.useRef(null),o=e.useCallback((function(){return clearTimeout(u.current)}),[u.current]);return e.useEffect((function(){c.current=t})),e.useEffect((function(){if(r)return u.current=setTimeout((function(){c.current()}),n),o;o()}),[n,r]),g((function(){o()})),[o]},E=function(t,n){var r=p(e.useState(t),2),u=r[0],c=r[1],o=p(e.useState(t),2),i=o[0],a=o[1];return b((function(){a(u)}),n,u!==i),[u,i,c]},O={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"},S=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"shortcut icon";e.useLayoutEffect((function(){if(t){document.querySelectorAll("link[rel*='icon']").forEach((function(e){document.head.removeChild(e)}));var e=document.createElement("link");e.setAttribute("type",O[t.split(".").pop()]),e.setAttribute("rel",n),e.setAttribute("href",t),document.head.appendChild(e)}}),[t,n])},j=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=p(e.useState(!1),2),u=r[0],c=r[1];return e.useEffect((function(){if(t.current){var e=new IntersectionObserver((function(e){var t=p(e,1);c(t[0].isIntersecting)}),n);return e.observe(t.current),function(){e.disconnect()}}}),[n,t]),u},x=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=e.useRef(null),c=e.useRef(null),o=e.useCallback((function(){return clearInterval(u.current)}),[u.current]);return e.useEffect((function(){c.current=t})),e.useEffect((function(){if(r)return u.current=setInterval((function(){c.current()}),n),o;o()}),[n,r]),g((function(){o()})),[o]},P=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=p(e.useState(!1),2),u=r[0],c=r[1],o=e.useRef(null),i=function(e){return c(e.matches)},a=function(){return o.current&&o.current.removeEventListener("change",i)&&(o.current=null)};return e.useEffect((function(){return n&&(o.current=window.matchMedia(t),c(o.current.matches),o.current&&o.current.addEventListener("change",i)),a}),[t,n]),u},R=function(t){var n=e.useRef(!1);return e.useEffect((function(){if(!n.current)return n.current=!0,t&&t()}),[])};function C(e){return C="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},C(e)}function D(e,t){if("object"!==C(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==C(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function I(e){var t=D(e,"string");return"symbol"===C(t)?t:String(t)}function T(e,t,n){return(t=I(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(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 A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var X=function(){var t=p(e.useState({x:0,y:0}),2),n=t[0],r=t[1],u=e.useRef(null),c=e.useCallback((function(e){var t,n;if(u.current){var c=e.currentTarget.getBoundingClientRect();t=e.pageX-c.left-(window.pageXOffset||window.scrollX),n=e.pageY-c.top-(window.pageYOffset||window.scrollY)}else t=e.clientX,n=e.clientY;r({x:Math.max(0,Math.round(t)),y:Math.max(0,Math.round(n))})}),[]),o=p(y({target:u,type:"mousemove",listener:c}),2),i=o[0],a=o[1],f=p(y({type:"mousemove",listener:c}),2),l=f[0],s=f[1];return e.useEffect((function(){return i(),u.current||l(),function(){a(),u.current||s()}}),[l,i,s,a]),A(A({ref:u},n),{},{reset:function(){return r({x:0,y:0})}})};function Y(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 L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(t){var n=t.mode,r=void 0===n?"both":n,u=t.initialValue,c=void 0===u?{x:0,y:0}:u,o=p(e.useState(c),2),i=o[0],a=o[1],f=p(e.useState(!1),2),l=f[0],s=f[1],d=e.useRef(!1),v=e.useRef(!1),m=e.useRef(null),g=function(e){return F({x:e.clientX,y:e.clientY})},h=function(e){var t=e.clampedX,n=e.clampedY;"vertical"===r?a({y:1-n}):"horizontal"===r?a({x:t}):"both"===r&&a({x:t,y:n})},w=function(){v.current&&d.current&&(v.current=!1,s(!1),V())},b=function(e){e.cancelable&&e.preventDefault(),F({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})},E=p(y({type:"mousemove",listener:g}),2),O=E[0],S=E[1],j=p(y({type:"mouseup",listener:w}),2),x=j[0],P=j[1],R=p(y({type:"touchmove",listener:b}),2),C=R[0],D=R[1],I=p(y({type:"touchend",listener:w}),2),T=I[0],k=I[1],A=p(y({target:m,type:"mousedown",listener:function(e){q(),e.preventDefault(),g(e)}}),2),X=A[0],Y=A[1],M=p(y({target:m,type:"touchstart",listener:function(e){e.cancelable&&e.preventDefault(),q(),b(e)},options:{passive:!1}}),2),N=M[0],z=M[1],B=function(e,t,n){return Math.min(Math.max(e,t),n)},J=function(e){var t=e.y;return{clampedX:B(e.x,0,1),clampedY:B(t,0,1)}},V=function(){S(),P(),D(),k()};e.useEffect((function(){d.current=!0}),[]);var q=function(){!v.current&&d.current&&(v.current=!0,s(!0),O(),x(),C(),T())},F=function(e){var t=e.x,n=e.y;if(v.current){var r=m.current.getBoundingClientRect(),u=J({x:(t-r.left)/r.width,y:(n-r.top)/r.height});h({clampedX:u.clampedX,clampedY:u.clampedY})}};return e.useEffect((function(){return m.current&&(X(),N()),function(){m.current&&(Y(),z())}}),[X,N,i,Y,z]),L(L({ref:m},i),{},{active:l,reset:function(){a(c)}})}var N=function(t){var n=t.target,r=t.listener,u=t.options,f=t.when,l=void 0===f||f,s=e.useRef(null),d=e.useRef(null),v=e.useRef([]),p=m(u),y=e.useContext(a),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o.isNotEmpty(e.target)&&(w(),(e.when||l)&&(s.current=c.getTargetElement(e.target))),!d.current&&s.current){var t=v.current=c.getScrollableParents(s.current,y?y.hideOverlaysOnDocumentScrolling:i.hideOverlaysOnDocumentScrolling);d.current=function(e){return r&&r(e)},t.forEach((function(e){return e.addEventListener("scroll",d.current,u)}))}},w=function(){d.current&&(v.current.forEach((function(e){return e.removeEventListener("scroll",d.current,u)})),d.current=null)};return e.useEffect((function(){l?s.current=c.getTargetElement(n):(w(),s.current=null)}),[n,l]),e.useEffect((function(){!d.current||d.current===r&&p===u||(w(),l&&h())}),[r,u]),g((function(){w()})),[h,w]},z=function(e){var t=e.when;return y({target:"window",type:"resize",listener:e.listener,when:void 0===t||t})},B=function(t){var n=t.target,r=t.overlay,u=t.listener,o=t.when,i=void 0===o||o,a=e.useRef(null),f=e.useRef(null),l=p(y({target:"window",type:"click",listener:function(e){u&&u(e,{type:"outside",valid:3!==e.which&&x(e)})}}),2),s=l[0],d=l[1],v=p(z({target:"window",listener:function(e){u&&u(e,{type:"resize",valid:!c.isTouchDevice()})}}),2),m=v[0],h=v[1],w=p(y({target:"window",type:"orientationchange",listener:function(e){u&&u(e,{type:"orientationchange",valid:!0})}}),2),b=w[0],E=w[1],O=p(N({target:n,listener:function(e){u&&u(e,{type:"scroll",valid:!0})}}),2),S=O[0],j=O[1],x=function(e){return a.current&&!(a.current.isSameNode(e.target)||a.current.contains(e.target)||f.current&&f.current.contains(e.target))},P=function(){d(),h(),E(),j()};return e.useEffect((function(){i?(a.current=c.getTargetElement(n),f.current=c.getTargetElement(r)):(P(),a.current=f.current=null)}),[n,r,i]),e.useEffect((function(){P()}),[i]),g((function(){P()})),[function(){s(),m(),b(),S()},P]},J=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",u="undefined"!=typeof window,c=p(y({target:"window",type:"storage",listener:function(e){var t="local"===r?window.localStorage:window.sessionStorage;if(e.storageArea===t&&e.key===n){var u=e.newValue?JSON.parse(e.newValue):void 0;l(u)}}}),2),o=c[0],i=c[1],a=p(e.useState(t),2),f=a[0],l=a[1];return e.useEffect((function(){u||l(t);try{var e="local"===r?window.localStorage.getItem(n):window.sessionStorage.getItem(n);l(e?JSON.parse(e):t)}catch(e){l(t)}return o(),function(){return i()}}),[]),[f,function(e){try{var t=e instanceof Function?e(f):e;if(l(t),u){var c=JSON.stringify(t);"local"===r?window.localStorage.setItem(n,c):window.sessionStorage.setItem(n,c)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(n))}}]},V=function(e,t){return J(e,t,"local")},q=function(e,t){return J(e,t,"session")},F=function(t,n){var r=e.useRef(!1);return e.useEffect((function(){if(r.current)return t&&t();r.current=!0}),n)},U=0,$=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=p(t(!1),2),l=f[0],s=f[1],d=n(null),v=r(a),m=c.isClient()?window.document:void 0,g=o.document,y=void 0===g?m:g,h=o.manual,w=void 0!==h&&h,b=o.name,E=void 0===b?"style_".concat(++U):b,O=o.id,S=void 0===O?void 0:O,j=o.media,x=void 0===j?void 0:j,P=function(){y&&(d.current=y.querySelector('style[data-primereact-style-id="'.concat(E,'"]'))||y.getElementById(S)||y.createElement("style"),d.current.isConnected||(d.current.type="text/css",S&&(d.current.id=S),x&&(d.current.media=x),c.addNonce(d.current,v&&v.nonce||i.nonce),y.head.appendChild(d.current),E&&d.current.setAttribute("data-primereact-style-id",E)),l||(d.current.textContent=e,s(!0)))};return u((function(){w||P()}),[]),{id:S,name:E,update:function(t){l&&e!==t&&(d.current.textContent=t)},unload:function(){y&&d.current&&(c.removeInlineStyle(d.current),s(!1))},load:P,isLoaded:l}},_=function(t,n,r){var u=p(y({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),r(e))}}),2),c=u[0],o=u[1];return e.useEffect((function(){if(n&&t.current)return c(),function(){o()}})),[t,r]};export{h as useClickOutside,w as useCounter,E as useDebounce,y as useEventListener,S as useFavicon,j as useIntersectionObserver,x as useInterval,V as useLocalStorage,P as useMatchMedia,R as useMountEffect,X as useMouse,M as useMove,_ as useOnEscapeKey,B as useOverlayListener,N as useOverlayScrollListener,m as usePrevious,z as useResizeListener,q as useSessionStorage,J as useStorage,$ as useStyle,b as useTimeout,g as useUnmountEffect,F as useUpdateEffect};
|
|
1
|
+
import*as e from"react";import{useEffect as t,useState as n,useRef as r,useContext as u}from"react";import{DomHandler as o,ObjectUtils as i,UniqueComponentId as c}from"primereact/utils";import a,{PrimeReactContext as f}from"primereact/api";function l(e){if(Array.isArray(e))return e}function s(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,o,i,c=[],a=!0,f=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);a=!0);}catch(e){f=!0,u=e}finally{try{if(!a&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw u}}return c}}function d(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 v(e,t){if(e){if("string"==typeof e)return d(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)?d(e,t):void 0}}function y(){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 p(e,t){return l(e)||s(e,t)||v(e,t)||y()}var m=function(t){var n=e.useRef(void 0);return e.useEffect((function(){n.current=t})),n.current},g=function(t){return e.useEffect((function(){return t}),[])},h=function(t){var n=t.target,r=void 0===n?"document":n,u=t.type,c=t.listener,a=t.options,f=t.when,l=void 0===f||f,s=e.useRef(null),d=e.useRef(null),v=m(c),y=m(a),p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.isNotEmpty(e.target)&&(h(),(e.when||l)&&(s.current=o.getTargetElement(e.target))),!d.current&&s.current&&(d.current=function(e){return c&&c(e)},s.current.addEventListener(u,d.current,a))},h=function(){d.current&&(s.current.removeEventListener(u,d.current,a),d.current=null)};return e.useEffect((function(){l?s.current=o.getTargetElement(r):(h(),s.current=null)}),[r,l]),e.useEffect((function(){!d.current||""+v==""+c&&y===a||(h(),l&&p())}),[c,a,l]),g((function(){h()})),[p,h]},w=function(t,n){var r=function(e){t.current&&!t.current.contains(e.target)&&n(e)},u=p(h({type:"mousedown",listener:r}),2),o=u[0],i=u[1],c=p(h({type:"touchstart",listener:r}),2),a=c[0],f=c[1];return e.useEffect((function(){if(t.current)return o(),a(),function(){i(),f()}})),[t,n]},b=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{step:1},n=p(e.useState(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0),2),r=n[0],u=n[1];return{count:r,increment:function(){t.max&&r>=t.max||u(r+t.step)},decrement:function(){if(t.min||0===t.min&&r<=t.min)return null;u(r-t.step)},reset:function(){u(0)}}},E=function(t,n){var r=p(e.useState(t),2),u=r[0],o=r[1],i=p(e.useState(t),2),c=i[0],a=i[1],f=e.useRef(!1),l=e.useRef(null),s=function(){return window.clearTimeout(l.current)};return N((function(){f.current=!0})),g((function(){s()})),e.useEffect((function(){f.current&&(s(),l.current=window.setTimeout((function(){a(u)}),n))}),[u,n]),[u,c,o]},S={},O=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=p(e.useState((function(){return c()})),1)[0],u=p(e.useState(),2),o=u[0],i=u[1];return e.useEffect((function(){if(n){t in S||(S[t]=[]);var e=S[t].length;return S[t].push(r),i(e),function(){delete S[t][e];var n=S[t].findLastIndex((function(e){return void 0!==e}));S[t].splice(n+1),i(void 0)}}}),[t,r,n]),o},j={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"},x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"shortcut icon";e.useLayoutEffect((function(){if(t){document.querySelectorAll("link[rel*='icon']").forEach((function(e){document.head.removeChild(e)}));var e=document.createElement("link");e.setAttribute("type",j[t.split(".").pop()]),e.setAttribute("rel",n),e.setAttribute("href",t),document.head.appendChild(e)}}),[t,n])};function D(e){if(Array.isArray(e))return d(e)}function L(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function R(){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 P(e){return D(e)||L(e)||v(e)||R()}var A={SIDEBAR:100,SLIDE_MENU:200,DIALOG:300,IMAGE:400,MENU:500,OVERLAY_PANEL:600,PASSWORD:700,CASCADE_SELECT:800,SPLIT_BUTTON:900,SPEED_DIAL:1e3},I={escKeyListeners:new Map,onGlobalKeyDown:function(e){if("Esc"===e.key||"Escape"===e.key){var t=I.escKeyListeners,n=Math.max.apply(Math,P(t.keys())),r=t.get(n),u=Math.max.apply(Math,P(r.keys()));r.get(u)(e)}},refreshGlobalKeyDownListener:function(){var e=o.getTargetElement("document");this.escKeyListeners.size>0?e.addEventListener("keydown",this.onGlobalKeyDown):e.removeEventListener("keydown",this.onGlobalKeyDown)},addListener:function(e,t){var n=this,r=p(t,2),u=r[0],o=r[1],i=this.escKeyListeners;i.has(u)||i.set(u,new Map);var c=i.get(u);if(c.has(o))throw new Error("Unexpected: global esc key listener with priority [".concat(u,", ").concat(o,"] already exists."));return c.set(o,e),this.refreshGlobalKeyDownListener(),function(){c.delete(o),0===c.size&&i.delete(u),n.refreshGlobalKeyDownListener()}}},T=function(e){var n=e.callback,r=e.when,u=e.priority;t((function(){if(r)return I.addListener(n,u)}),[r,n,u])},k=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=p(e.useState(!1),2),u=r[0],o=r[1];return e.useEffect((function(){if(t.current){var e=new IntersectionObserver((function(e){var t=p(e,1);o(t[0].isIntersecting)}),n);return e.observe(t.current),function(){e.disconnect()}}}),[n,t]),u},C=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=e.useRef(null),o=e.useRef(null),i=e.useCallback((function(){return clearInterval(u.current)}),[u.current]);return e.useEffect((function(){o.current=t})),e.useEffect((function(){if(r)return u.current=setInterval((function(){o.current()}),n),i;i()}),[n,r]),g((function(){i()})),[i]},M=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=p(e.useState(!1),2),u=r[0],o=r[1],i=e.useRef(null),c=function(e){return o(e.matches)},a=function(){return i.current&&i.current.removeEventListener("change",c)&&(i.current=null)};return e.useEffect((function(){return n&&(i.current=window.matchMedia(t),o(i.current.matches),i.current&&i.current.addEventListener("change",c)),a}),[t,n]),u},N=function(t){var n=e.useRef(!1);return e.useEffect((function(){if(!n.current)return n.current=!0,t&&t()}),[])};function Y(e){return Y="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},Y(e)}function K(e,t){if("object"!==Y(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function X(e){var t=K(e,"string");return"symbol"===Y(t)?t:String(t)}function G(e,t,n){return(t=X(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(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 _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){G(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(){var t=p(e.useState({x:0,y:0}),2),n=t[0],r=t[1],u=e.useRef(null),o=e.useCallback((function(e){var t,n;if(u.current){var o=e.currentTarget.getBoundingClientRect();t=e.pageX-o.left-(window.pageXOffset||window.scrollX),n=e.pageY-o.top-(window.pageYOffset||window.scrollY)}else t=e.clientX,n=e.clientY;r({x:Math.max(0,Math.round(t)),y:Math.max(0,Math.round(n))})}),[]),i=p(h({target:u,type:"mousemove",listener:o}),2),c=i[0],a=i[1],f=p(h({type:"mousemove",listener:o}),2),l=f[0],s=f[1];return e.useEffect((function(){return c(),u.current||l(),function(){a(),u.current||s()}}),[l,c,s,a]),_(_({ref:u},n),{},{reset:function(){return r({x:0,y:0})}})};function U(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 V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach((function(t){G(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(t){var n=t.mode,r=void 0===n?"both":n,u=t.initialValue,o=void 0===u?{x:0,y:0}:u,i=p(e.useState(o),2),c=i[0],a=i[1],f=p(e.useState(!1),2),l=f[0],s=f[1],d=e.useRef(!1),v=e.useRef(!1),y=e.useRef(null),m=function(e){return B({x:e.clientX,y:e.clientY})},g=function(e){var t=e.clampedX,n=e.clampedY;"vertical"===r?a({y:1-n}):"horizontal"===r?a({x:t}):"both"===r&&a({x:t,y:n})},w=function(){v.current&&d.current&&(v.current=!1,s(!1),z())},b=function(e){e.cancelable&&e.preventDefault(),B({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})},E=p(h({type:"mousemove",listener:m}),2),S=E[0],O=E[1],j=p(h({type:"mouseup",listener:w}),2),x=j[0],D=j[1],L=p(h({type:"touchmove",listener:b}),2),R=L[0],P=L[1],A=p(h({type:"touchend",listener:w}),2),I=A[0],T=A[1],k=p(h({target:y,type:"mousedown",listener:function(e){_(),e.preventDefault(),m(e)}}),2),C=k[0],M=k[1],N=p(h({target:y,type:"touchstart",listener:function(e){e.cancelable&&e.preventDefault(),_(),b(e)},options:{passive:!1}}),2),Y=N[0],K=N[1],X=function(e,t,n){return Math.min(Math.max(e,t),n)},G=function(e){var t=e.y;return{clampedX:X(e.x,0,1),clampedY:X(t,0,1)}},z=function(){O(),D(),P(),T()};e.useEffect((function(){d.current=!0}),[]);var _=function(){!v.current&&d.current&&(v.current=!0,s(!0),S(),x(),R(),I())},B=function(e){var t=e.x,n=e.y;if(v.current){var r=y.current.getBoundingClientRect(),u=G({x:(t-r.left)/r.width,y:(n-r.top)/r.height});g({clampedX:u.clampedX,clampedY:u.clampedY})}};return e.useEffect((function(){return y.current&&(C(),Y()),function(){y.current&&(M(),K())}}),[C,Y,c,M,K]),V(V({ref:y},c),{},{active:l,reset:function(){a(o)}})}var q=function(t){var n=t.target,r=t.listener,u=t.options,c=t.when,l=void 0===c||c,s=e.useRef(null),d=e.useRef(null),v=e.useRef([]),y=m(u),p=e.useContext(f),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(i.isNotEmpty(e.target)&&(w(),(e.when||l)&&(s.current=o.getTargetElement(e.target))),!d.current&&s.current){var t=v.current=o.getScrollableParents(s.current,p?p.hideOverlaysOnDocumentScrolling:a.hideOverlaysOnDocumentScrolling);d.current=function(e){return r&&r(e)},t.forEach((function(e){return e.addEventListener("scroll",d.current,u)}))}},w=function(){d.current&&(v.current.forEach((function(e){return e.removeEventListener("scroll",d.current,u)})),d.current=null)};return e.useEffect((function(){l?s.current=o.getTargetElement(n):(w(),s.current=null)}),[n,l]),e.useEffect((function(){!d.current||d.current===r&&y===u||(w(),l&&h())}),[r,u]),g((function(){w()})),[h,w]},F=function(e){var t=e.when;return h({target:"window",type:"resize",listener:e.listener,when:void 0===t||t})},W=function(t){var n=t.target,r=t.overlay,u=t.listener,i=t.when,c=void 0===i||i,a=e.useRef(null),f=e.useRef(null),l=p(h({target:"window",type:"click",listener:function(e){u&&u(e,{type:"outside",valid:3!==e.which&&x(e)})}}),2),s=l[0],d=l[1],v=p(F({target:"window",listener:function(e){u&&u(e,{type:"resize",valid:!o.isTouchDevice()})}}),2),y=v[0],m=v[1],w=p(h({target:"window",type:"orientationchange",listener:function(e){u&&u(e,{type:"orientationchange",valid:!0})}}),2),b=w[0],E=w[1],S=p(q({target:n,listener:function(e){u&&u(e,{type:"scroll",valid:!0})}}),2),O=S[0],j=S[1],x=function(e){return a.current&&!(a.current.isSameNode(e.target)||a.current.contains(e.target)||f.current&&f.current.contains(e.target))},D=function(){d(),m(),E(),j()};return e.useEffect((function(){c?(a.current=o.getTargetElement(n),f.current=o.getTargetElement(r)):(D(),a.current=f.current=null)}),[n,r,c]),e.useEffect((function(){D()}),[c]),g((function(){D()})),[function(){s(),y(),b(),O()},D]},$=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",u="undefined"!=typeof window,o=p(h({target:"window",type:"storage",listener:function(e){var t="local"===r?window.localStorage:window.sessionStorage;if(e.storageArea===t&&e.key===n){var u=e.newValue?JSON.parse(e.newValue):void 0;l(u)}}}),2),i=o[0],c=o[1],a=p(e.useState(t),2),f=a[0],l=a[1];return e.useEffect((function(){u||l(t);try{var e="local"===r?window.localStorage.getItem(n):window.sessionStorage.getItem(n);l(e?JSON.parse(e):t)}catch(e){l(t)}return i(),function(){return c()}}),[]),[f,function(e){try{var t=e instanceof Function?e(f):e;if(l(t),u){var o=JSON.stringify(t);"local"===r?window.localStorage.setItem(n,o):window.sessionStorage.setItem(n,o)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(n))}}]},H=function(e,t){return $(e,t,"local")},Q=function(e,t){return $(e,t,"session")},Z=0,ee=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=p(n(!1),2),l=c[0],s=c[1],d=r(null),v=u(f),y=o.isClient()?window.document:void 0,m=i.document,g=void 0===m?y:m,h=i.manual,w=void 0!==h&&h,b=i.name,E=void 0===b?"style_".concat(++Z):b,S=i.id,O=void 0===S?void 0:S,j=i.media,x=void 0===j?void 0:j,D=function(){if(g&&!l){var t=(null==v?void 0:v.styleContainer)||g.head;d.current=t.querySelector('style[data-primereact-style-id="'.concat(E,'"]'))||g.getElementById(O)||g.createElement("style"),d.current.isConnected||(d.current.type="text/css",O&&(d.current.id=O),x&&(d.current.media=x),o.addNonce(d.current,v&&v.nonce||a.nonce),t.appendChild(d.current),E&&d.current.setAttribute("data-primereact-style-id",E)),d.current.textContent=e,s(!0)}};return t((function(){w||D()}),[w]),{id:O,name:E,update:function(t){l&&e!==t&&(d.current.textContent=t)},unload:function(){g&&d.current&&(o.removeInlineStyle(d.current),s(!1))},load:D,isLoaded:l}},te=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=e.useRef(null),o=e.useRef(null),i=e.useCallback((function(){return clearTimeout(u.current)}),[u.current]);return e.useEffect((function(){o.current=t})),e.useEffect((function(){if(r)return u.current=setTimeout((function(){o.current()}),n),i;i()}),[n,r]),g((function(){i()})),[i]},ne=function(t,n){var r=e.useRef(!1);return e.useEffect((function(){if(r.current)return t&&t();r.current=!0}),n)};export{A as ESC_KEY_HANDLING_PRIORITIES,w as useClickOutside,b as useCounter,E as useDebounce,O as useDisplayOrder,h as useEventListener,x as useFavicon,T as useGlobalOnEscapeKey,k as useIntersectionObserver,C as useInterval,H as useLocalStorage,M as useMatchMedia,N as useMountEffect,B as useMouse,J as useMove,W as useOverlayListener,q as useOverlayScrollListener,m as usePrevious,F as useResizeListener,Q as useSessionStorage,$ as useStorage,ee as useStyle,te as useTimeout,g as useUnmountEffect,ne as useUpdateEffect};
|