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
|
@@ -4,10 +4,10 @@ import PrimeReact, { PrimeReactContext, localeOption } from 'primereact/api';
|
|
|
4
4
|
import { Button } from 'primereact/button';
|
|
5
5
|
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
6
6
|
import { CSSTransition } from 'primereact/csstransition';
|
|
7
|
-
import { useOverlayListener, useUpdateEffect, useUnmountEffect
|
|
7
|
+
import { useDisplayOrder, useGlobalOnEscapeKey, ESC_KEY_HANDLING_PRIORITIES, useOverlayListener, useUpdateEffect, useUnmountEffect } from 'primereact/hooks';
|
|
8
8
|
import { OverlayService } from 'primereact/overlayservice';
|
|
9
9
|
import { Portal } from 'primereact/portal';
|
|
10
|
-
import { classNames, DomHandler,
|
|
10
|
+
import { classNames, DomHandler, ZIndexUtils, mergeProps, ObjectUtils, IconUtils } from 'primereact/utils';
|
|
11
11
|
|
|
12
12
|
function _extends() {
|
|
13
13
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -149,29 +149,30 @@ var classes = {
|
|
|
149
149
|
var ConfirmPopupBase = ComponentBase.extend({
|
|
150
150
|
defaultProps: {
|
|
151
151
|
__TYPE: 'ConfirmPopup',
|
|
152
|
-
|
|
153
|
-
target: null,
|
|
154
|
-
visible: false,
|
|
155
|
-
message: null,
|
|
156
|
-
rejectLabel: null,
|
|
157
|
-
acceptLabel: null,
|
|
158
|
-
icon: null,
|
|
159
|
-
rejectIcon: null,
|
|
160
|
-
acceptIcon: null,
|
|
161
|
-
rejectClassName: null,
|
|
152
|
+
accept: null,
|
|
162
153
|
acceptClassName: null,
|
|
163
|
-
|
|
164
|
-
|
|
154
|
+
acceptIcon: null,
|
|
155
|
+
acceptLabel: null,
|
|
165
156
|
appendTo: null,
|
|
157
|
+
children: undefined,
|
|
158
|
+
className: null,
|
|
159
|
+
closeOnEscape: true,
|
|
160
|
+
defaultFocus: 'accept',
|
|
166
161
|
dismissable: true,
|
|
167
162
|
footer: null,
|
|
168
|
-
|
|
163
|
+
icon: null,
|
|
164
|
+
message: null,
|
|
169
165
|
onHide: null,
|
|
170
|
-
|
|
166
|
+
onShow: null,
|
|
171
167
|
reject: null,
|
|
168
|
+
rejectClassName: null,
|
|
169
|
+
rejectIcon: null,
|
|
170
|
+
rejectLabel: null,
|
|
171
|
+
style: null,
|
|
172
|
+
tagKey: undefined,
|
|
173
|
+
target: null,
|
|
172
174
|
transitionOptions: null,
|
|
173
|
-
|
|
174
|
-
closeOnEscape: true
|
|
175
|
+
visible: false
|
|
175
176
|
},
|
|
176
177
|
css: {
|
|
177
178
|
classes: classes,
|
|
@@ -179,104 +180,6 @@ var ConfirmPopupBase = ComponentBase.extend({
|
|
|
179
180
|
}
|
|
180
181
|
});
|
|
181
182
|
|
|
182
|
-
var usePrevious = function usePrevious(newValue) {
|
|
183
|
-
var ref = React.useRef(undefined);
|
|
184
|
-
React.useEffect(function () {
|
|
185
|
-
ref.current = newValue;
|
|
186
|
-
});
|
|
187
|
-
return ref.current;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
/* eslint-disable */
|
|
191
|
-
var useUnmountEffect = function useUnmountEffect(fn) {
|
|
192
|
-
return React.useEffect(function () {
|
|
193
|
-
return fn;
|
|
194
|
-
}, []);
|
|
195
|
-
};
|
|
196
|
-
/* eslint-enable */
|
|
197
|
-
|
|
198
|
-
/* eslint-disable */
|
|
199
|
-
var useEventListener = function useEventListener(_ref) {
|
|
200
|
-
var _ref$target = _ref.target,
|
|
201
|
-
target = _ref$target === void 0 ? 'document' : _ref$target,
|
|
202
|
-
type = _ref.type,
|
|
203
|
-
listener = _ref.listener,
|
|
204
|
-
options = _ref.options,
|
|
205
|
-
_ref$when = _ref.when,
|
|
206
|
-
when = _ref$when === void 0 ? true : _ref$when;
|
|
207
|
-
var targetRef = React.useRef(null);
|
|
208
|
-
var listenerRef = React.useRef(null);
|
|
209
|
-
var prevOptions = usePrevious(options);
|
|
210
|
-
var bind = function bind() {
|
|
211
|
-
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
212
|
-
if (ObjectUtils.isNotEmpty(bindOptions.target)) {
|
|
213
|
-
unbind();
|
|
214
|
-
(bindOptions.when || when) && (targetRef.current = DomHandler.getTargetElement(bindOptions.target));
|
|
215
|
-
}
|
|
216
|
-
if (!listenerRef.current && targetRef.current) {
|
|
217
|
-
listenerRef.current = function (event) {
|
|
218
|
-
return listener && listener(event);
|
|
219
|
-
};
|
|
220
|
-
targetRef.current.addEventListener(type, listenerRef.current, options);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
var unbind = function unbind() {
|
|
224
|
-
if (listenerRef.current) {
|
|
225
|
-
targetRef.current.removeEventListener(type, listenerRef.current, options);
|
|
226
|
-
listenerRef.current = null;
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
React.useEffect(function () {
|
|
230
|
-
if (when) {
|
|
231
|
-
targetRef.current = DomHandler.getTargetElement(target);
|
|
232
|
-
} else {
|
|
233
|
-
unbind();
|
|
234
|
-
targetRef.current = null;
|
|
235
|
-
}
|
|
236
|
-
}, [target, when]);
|
|
237
|
-
React.useEffect(function () {
|
|
238
|
-
if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {
|
|
239
|
-
unbind();
|
|
240
|
-
when && bind();
|
|
241
|
-
}
|
|
242
|
-
}, [listener, options]);
|
|
243
|
-
useUnmountEffect(function () {
|
|
244
|
-
unbind();
|
|
245
|
-
});
|
|
246
|
-
return [bind, unbind];
|
|
247
|
-
};
|
|
248
|
-
/* eslint-enable */
|
|
249
|
-
|
|
250
|
-
var useOnEscapeKey = function useOnEscapeKey(ref, condition, callback) {
|
|
251
|
-
var handleEsc = function handleEsc(event) {
|
|
252
|
-
if (event.key === 'Esc' || event.key === 'Escape') {
|
|
253
|
-
event.stopImmediatePropagation();
|
|
254
|
-
callback(event);
|
|
255
|
-
}
|
|
256
|
-
return;
|
|
257
|
-
};
|
|
258
|
-
var _useEventListener = useEventListener({
|
|
259
|
-
type: 'keydown',
|
|
260
|
-
listener: handleEsc
|
|
261
|
-
}),
|
|
262
|
-
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
263
|
-
bindKeyDownListener = _useEventListener2[0],
|
|
264
|
-
unbindKeyDownListener = _useEventListener2[1];
|
|
265
|
-
React.useEffect(function () {
|
|
266
|
-
if (!condition) {
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
if (!ref.current) {
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
bindKeyDownListener();
|
|
273
|
-
return function () {
|
|
274
|
-
unbindKeyDownListener();
|
|
275
|
-
};
|
|
276
|
-
});
|
|
277
|
-
return [ref, callback];
|
|
278
|
-
};
|
|
279
|
-
|
|
280
183
|
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; }
|
|
281
184
|
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; }
|
|
282
185
|
var confirmPopup = function confirmPopup() {
|
|
@@ -328,6 +231,7 @@ var ConfirmPopup = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
328
231
|
});
|
|
329
232
|
var overlayRef = React.useRef(null);
|
|
330
233
|
var acceptBtnRef = React.useRef(null);
|
|
234
|
+
var rejectBtnRef = React.useRef(null);
|
|
331
235
|
var isPanelClicked = React.useRef(false);
|
|
332
236
|
var overlayEventListener = React.useRef(null);
|
|
333
237
|
var confirmProps = React.useRef(null);
|
|
@@ -347,8 +251,15 @@ var ConfirmPopup = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
347
251
|
};
|
|
348
252
|
var acceptLabel = getPropValue('acceptLabel') || localeOption('accept');
|
|
349
253
|
var rejectLabel = getPropValue('rejectLabel') || localeOption('reject');
|
|
350
|
-
|
|
351
|
-
|
|
254
|
+
var displayOrder = useDisplayOrder('dialog', visibleState);
|
|
255
|
+
useGlobalOnEscapeKey({
|
|
256
|
+
callback: function callback() {
|
|
257
|
+
if (props.dismissable && props.closeOnEscape) {
|
|
258
|
+
hide('hide');
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
when: visibleState,
|
|
262
|
+
priority: [ESC_KEY_HANDLING_PRIORITIES.DIALOG, displayOrder]
|
|
352
263
|
});
|
|
353
264
|
var _useOverlayListener = useOverlayListener({
|
|
354
265
|
target: getPropValue('target'),
|
|
@@ -388,16 +299,20 @@ var ConfirmPopup = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
388
299
|
}
|
|
389
300
|
};
|
|
390
301
|
var show = function show() {
|
|
391
|
-
|
|
392
|
-
// so we can return focus to it once we close the dialog.
|
|
393
|
-
focusElementOnHide.current = document.activeElement;
|
|
394
|
-
setVisibleState(true);
|
|
302
|
+
var currentProps = getCurrentProps();
|
|
395
303
|
setReshowState(false);
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
304
|
+
if (currentProps.group === props.group) {
|
|
305
|
+
setVisibleState(true);
|
|
306
|
+
isCallbackExecuting.current = false;
|
|
307
|
+
overlayEventListener.current = function (e) {
|
|
308
|
+
!isOutsideClicked(e.target) && (isPanelClicked.current = true);
|
|
309
|
+
};
|
|
310
|
+
OverlayService.on('overlay-click', overlayEventListener.current);
|
|
311
|
+
|
|
312
|
+
// Remember the focused element before we opened the dialog
|
|
313
|
+
// so we can return focus to it once we close the dialog.
|
|
314
|
+
focusElementOnHide.current = document.activeElement;
|
|
315
|
+
}
|
|
401
316
|
};
|
|
402
317
|
var hide = function hide(result) {
|
|
403
318
|
setVisibleState(false);
|
|
@@ -421,8 +336,12 @@ var ConfirmPopup = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
421
336
|
};
|
|
422
337
|
var onEntered = function onEntered() {
|
|
423
338
|
bindOverlayListener();
|
|
424
|
-
|
|
425
|
-
|
|
339
|
+
var defaultFocus = getPropValue('defaultFocus');
|
|
340
|
+
if (defaultFocus === undefined || defaultFocus === 'accept') {
|
|
341
|
+
acceptBtnRef.current && acceptBtnRef.current.focus();
|
|
342
|
+
}
|
|
343
|
+
if (defaultFocus === 'reject') {
|
|
344
|
+
rejectBtnRef.current && rejectBtnRef.current.focus();
|
|
426
345
|
}
|
|
427
346
|
callbackFromProp('onShow');
|
|
428
347
|
};
|
|
@@ -481,7 +400,7 @@ var ConfirmPopup = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
481
400
|
useUpdateEffect(function () {
|
|
482
401
|
reshowState && show();
|
|
483
402
|
}, [reshowState]);
|
|
484
|
-
useUnmountEffect
|
|
403
|
+
useUnmountEffect(function () {
|
|
485
404
|
if (overlayEventListener.current) {
|
|
486
405
|
OverlayService.off('overlay-click', overlayEventListener.current);
|
|
487
406
|
overlayEventListener.current = null;
|
|
@@ -521,6 +440,7 @@ var ConfirmPopup = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
521
440
|
className: cx('footer')
|
|
522
441
|
}, ptm('footer'));
|
|
523
442
|
var rejectButtonProps = mergeProps({
|
|
443
|
+
ref: rejectBtnRef,
|
|
524
444
|
label: rejectLabel,
|
|
525
445
|
icon: getPropValue('rejectIcon'),
|
|
526
446
|
className: cx('rejectButton', {
|
|
@@ -564,38 +484,51 @@ var ConfirmPopup = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
564
484
|
}
|
|
565
485
|
return content;
|
|
566
486
|
};
|
|
487
|
+
var rootProps = mergeProps({
|
|
488
|
+
ref: overlayRef,
|
|
489
|
+
id: getPropValue('id'),
|
|
490
|
+
className: cx('root', {
|
|
491
|
+
context: context,
|
|
492
|
+
getPropValue: getPropValue
|
|
493
|
+
}),
|
|
494
|
+
style: getPropValue('style'),
|
|
495
|
+
onClick: onPanelClick
|
|
496
|
+
}, ConfirmPopupBase.getOtherProps(props), ptm('root'));
|
|
497
|
+
var transitionProps = mergeProps({
|
|
498
|
+
classNames: cx('transition'),
|
|
499
|
+
"in": visibleState,
|
|
500
|
+
timeout: {
|
|
501
|
+
enter: 120,
|
|
502
|
+
exit: 100
|
|
503
|
+
},
|
|
504
|
+
options: getPropValue('transitionOptions'),
|
|
505
|
+
unmountOnExit: true,
|
|
506
|
+
onEnter: onEnter,
|
|
507
|
+
onEntered: onEntered,
|
|
508
|
+
onExit: onExit,
|
|
509
|
+
onExited: onExited
|
|
510
|
+
}, ptm('transition'));
|
|
511
|
+
var createTemplateElement = function createTemplateElement() {
|
|
512
|
+
var currentProps = getCurrentProps();
|
|
513
|
+
var message = ObjectUtils.getJSXElement(getPropValue('message'), currentProps);
|
|
514
|
+
var templateElementProps = {
|
|
515
|
+
message: message,
|
|
516
|
+
acceptBtnRef: acceptBtnRef,
|
|
517
|
+
rejectBtnRef: rejectBtnRef,
|
|
518
|
+
hide: hide
|
|
519
|
+
};
|
|
520
|
+
return /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
521
|
+
nodeRef: overlayRef
|
|
522
|
+
}, transitionProps), /*#__PURE__*/React.createElement("div", rootProps, ObjectUtils.getJSXElement(inProps.content, templateElementProps)));
|
|
523
|
+
};
|
|
567
524
|
var createElement = function createElement() {
|
|
568
525
|
var content = createContent();
|
|
569
526
|
var footer = createFooter();
|
|
570
|
-
var rootProps = mergeProps({
|
|
571
|
-
ref: overlayRef,
|
|
572
|
-
id: getPropValue('id'),
|
|
573
|
-
className: cx('root', {
|
|
574
|
-
context: context,
|
|
575
|
-
getPropValue: getPropValue
|
|
576
|
-
}),
|
|
577
|
-
style: getPropValue('style'),
|
|
578
|
-
onClick: onPanelClick
|
|
579
|
-
}, ConfirmPopupBase.getOtherProps(props), ptm('root'));
|
|
580
|
-
var transitionProps = mergeProps({
|
|
581
|
-
classNames: cx('transition'),
|
|
582
|
-
"in": visibleState,
|
|
583
|
-
timeout: {
|
|
584
|
-
enter: 120,
|
|
585
|
-
exit: 100
|
|
586
|
-
},
|
|
587
|
-
options: getPropValue('transitionOptions'),
|
|
588
|
-
unmountOnExit: true,
|
|
589
|
-
onEnter: onEnter,
|
|
590
|
-
onEntered: onEntered,
|
|
591
|
-
onExit: onExit,
|
|
592
|
-
onExited: onExited
|
|
593
|
-
}, ptm('transition'));
|
|
594
527
|
return /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
595
528
|
nodeRef: overlayRef
|
|
596
529
|
}, transitionProps), /*#__PURE__*/React.createElement("div", rootProps, content, footer));
|
|
597
530
|
};
|
|
598
|
-
var element = createElement();
|
|
531
|
+
var element = inProps !== null && inProps !== void 0 && inProps.content ? createTemplateElement() : createElement();
|
|
599
532
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
600
533
|
element: element,
|
|
601
534
|
appendTo: getPropValue('appendTo'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import t,{PrimeReactContext as n,localeOption as r}from"primereact/api";import{Button as o}from"primereact/button";import{ComponentBase as c,useHandleStyle as i}from"primereact/componentbase";import{CSSTransition as u}from"primereact/csstransition";import{useOverlayListener as p,useUpdateEffect as a,useUnmountEffect as l}from"primereact/hooks";import{OverlayService as s}from"primereact/overlayservice";import{Portal as f}from"primereact/portal";import{classNames as m,DomHandler as b,ObjectUtils as d,ZIndexUtils as v,mergeProps as y,IconUtils as g}from"primereact/utils";function j(){return j=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},j.apply(this,arguments)}function h(e){if(Array.isArray(e))return e}function E(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c,i,u=[],p=!0,a=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;p=!1}else for(;!(p=(r=c.call(n)).done)&&(u.push(r.value),u.length!==t);p=!0);}catch(e){a=!0,o=e}finally{try{if(!p&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(a)throw o}}return u}}function O(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 w(e,t){if(e){if("string"==typeof e)return O(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)?O(e,t):void 0}}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 S(e,t){return h(e)||E(e,t)||w(e,t)||P()}function x(e){return x="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},x(e)}function N(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function C(e){var t=N(e,"string");return"symbol"===x(t)?t:String(t)}var I=c.extend({defaultProps:{__TYPE:"ConfirmPopup",tagKey:void 0,target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null,children:void 0,closeOnEscape:!0},css:{classes:{root:function(e){var n=e.context;return m("p-confirm-popup p-component",(0,e.getPropValue)("className"),{"p-input-filled":n&&"filled"===n.inputStyle||"filled"===t.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===t.ripple})},acceptButton:function(e){return m("p-confirm-popup-accept p-button-sm",(0,e.getPropValue)("acceptClassName"))},rejectButton:function(e){var t=e.getPropValue;return m("p-confirm-popup-reject p-button-sm",{"p-button-text":!t("rejectClassName")},t("rejectClassName"))},content:"p-confirm-popup-content",icon:"p-confirm-popup-icon",message:"p-confirm-popup-message",footer:"p-confirm-popup-footer",transition:"p-connected-overlay"},styles:'\n@layer primereact {\n .p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n }\n \n .p-confirm-popup:after, .p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n }\n \n .p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n }\n \n .p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n }\n \n .p-confirm-popup-flipped:after, .p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n }\n \n .p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n }\n \n .p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent\n }\n \n .p-confirm-popup .p-confirm-popup-content {\n display: flex;\n align-items: center;\n }\n}\n'}}),k=function(t){var n,r,o,c=t.target,i=void 0===c?"document":c,u=t.type,p=t.listener,a=t.options,l=t.when,s=void 0===l||l,f=e.useRef(null),m=e.useRef(null),v=(n=a,r=e.useRef(void 0),e.useEffect((function(){r.current=n})),r.current),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.isNotEmpty(e.target)&&(g(),(e.when||s)&&(f.current=b.getTargetElement(e.target))),!m.current&&f.current&&(m.current=function(e){return p&&p(e)},f.current.addEventListener(u,m.current,a))},g=function(){m.current&&(f.current.removeEventListener(u,m.current,a),m.current=null)};return e.useEffect((function(){s?f.current=b.getTargetElement(i):(g(),f.current=null)}),[i,s]),e.useEffect((function(){!m.current||m.current===p&&v===a||(g(),s&&y())}),[p,a]),o=function(){g()},e.useEffect((function(){return o}),[]),[y,g]},R=function(t,n,r){var o=S(k({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),r(e))}}),2),c=o[0],i=o[1];return e.useEffect((function(){if(n&&t.current)return c(),function(){i()}})),[t,r]};function L(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?L(Object(n),!0).forEach((function(t){var r,o,c;r=e,c=n[t],(o=C(o=t))in r?Object.defineProperty(r,o,{value:c,enumerable:!0,configurable:!0,writable:!0}):r[o]=c})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=A(A({},e),{visible:void 0===e.visible||e.visible})).visible&&s.emit("confirm-popup",e);return{show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s.emit("confirm-popup",A(A(A({},e),t),{visible:!0}))},hide:function(){s.emit("confirm-popup",{visible:!1})}}},V=e.memo(e.forwardRef((function(c,h){var E=e.useContext(n),O=I.getProps(c,E),w=S(e.useState(O.visible),2),P=w[0],x=w[1],N=S(e.useState(!1),2),C=N[0],k=N[1],L={props:O,state:{visible:P,reshow:C}},T=I.setMetaData(L),V=T.ptm,B=T.cx,_=T.isUnstyled;i(I.css.styles,_,{name:"confirmpopup"});var D=e.useRef(null),M=e.useRef(null),H=e.useRef(!1),J=e.useRef(null),K=e.useRef(null),U=e.useRef(null),X=e.useRef(!1),z=function(){return K.current||O},Z=function(e){return(K.current||O)[e]},Y=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return d.getPropValue(Z(e),n)},$=Z("acceptLabel")||r("accept"),q=Z("rejectLabel")||r("reject");R(D,O.dismissable&&O.closeOnEscape,(function(e){re("hide")}));var F=S(p({target:Z("target"),overlay:D,listener:function(e,t){t.valid&&("outside"===t.type?O.dismissable&&!H.current&&re("hide"):re("hide")),H.current=!1},when:P}),2),G=F[0],Q=F[1],W=function(e){H.current=!0,s.emit("overlay-click",{originalEvent:e,target:Z("target")})},ee=function(){X.current||(X.current=!0,Y("accept"),re("accept"))},te=function(){X.current||(X.current=!0,Y("reject"),re("reject"))},ne=function(){U.current=document.activeElement,x(!0),k(!1),X.current=!1,J.current=function(e){!ae(e.target)&&(H.current=!0)},s.on("overlay-click",J.current)},re=function(e){x(!1),s.off("overlay-click",J.current),J.current=null,e&&Y("onHide",e),b.focus(U.current),U.current=null},oe=function(){v.set("overlay",D.current,E&&E.autoZIndex||t.autoZIndex,E&&E.zIndex.overlay||t.zIndex.overlay),b.addStyles(D.current,{position:"absolute",top:"50%",left:"50%",marginTop:"10px"}),pe()},ce=function(){G(),M.current&&M.current.focus(),Y("onShow")},ie=function(){Q()},ue=function(){v.clear(D.current),H.current=!1},pe=function(){if(Z("target")){b.absolutePosition(D.current,Z("target"));var e=b.getOffset(D.current),t=b.getOffset(Z("target")),n=0;e.left<t.left&&(n=t.left-e.left),D.current.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&!_()&&b.addClass(D.current,"p-confirm-popup-flipped")}},ae=function(e){return D&&D.current&&!(D.current.isSameNode(e)||D.current.contains(e))},le=function(e){if(e.tagKey===O.tagKey){var t=P!==e.visible;Z("target")!==e.target&&!O.target?(re(),K.current=e,k(!0)):t&&(K.current=e,e.visible?ne():re())}};e.useEffect((function(){O.visible?ne():re()}),[O.visible]),e.useEffect((function(){return O.target||O.message||s.on("confirm-popup",le),function(){s.off("confirm-popup",le)}}),[O.target]),a((function(){C&&ne()}),[C]),l((function(){J.current&&(s.off("overlay-click",J.current),J.current=null),s.off("confirm-popup",le),v.clear(D.current)})),e.useImperativeHandle(h,(function(){return{props:O,confirm:le}}));var se,fe,me,be,de,ve,ye,ge,je,he,Ee=function(){var t=m("p-confirm-popup-accept p-button-sm",Z("acceptClassName")),n=m("p-confirm-popup-reject p-button-sm",{"p-button-text":!Z("rejectClassName")},Z("rejectClassName")),r=y({className:B("footer")},V("footer")),c=y({label:q,icon:Z("rejectIcon"),className:B("rejectButton",{getPropValue:Z}),onClick:te,pt:V("rejectButton"),unstyled:O.unstyled,__parentMetadata:{parent:L}}),i=y({ref:M,label:$,icon:Z("acceptIcon"),className:B("acceptButton",{getPropValue:Z}),onClick:ee,pt:V("acceptButton"),unstyled:O.unstyled,__parentMetadata:{parent:L}}),u=e.createElement("div",r,e.createElement(o,c),e.createElement(o,i));if(Z("footer")){var p={accept:ee,reject:te,className:"p-confirm-popup-footer",acceptClassName:t,rejectClassName:n,acceptLabel:$,rejectLabel:q,element:u,props:z()};return d.getJSXElement(Z("footer"),p)}return u},Oe=(se=z(),fe=d.getJSXElement(Z("message"),se),me=y({className:B("icon")},V("icon")),be=g.getJSXIcon(Z("icon"),A({},me),{props:se}),de=y({className:B("message")},V("message")),ve=y({className:B("content")},V("content")),ye=e.createElement("div",ve,be,e.createElement("span",de,fe)),ge=Ee(),je=y({ref:D,id:Z("id"),className:B("root",{context:E,getPropValue:Z}),style:Z("style"),onClick:W},I.getOtherProps(O),V("root")),he=y({classNames:B("transition"),in:P,timeout:{enter:120,exit:100},options:Z("transitionOptions"),unmountOnExit:!0,onEnter:oe,onEntered:ce,onExit:ie,onExited:ue},V("transition")),e.createElement(u,j({nodeRef:D},he),e.createElement("div",je,ye,ge)));return e.createElement(f,{element:Oe,appendTo:Z("appendTo"),visible:Z("visible")})})));V.displayName="ConfirmPopup";export{V as ConfirmPopup,T as confirmPopup};
|
|
1
|
+
import*as e from"react";import t,{PrimeReactContext as r,localeOption as n}from"primereact/api";import{Button as o}from"primereact/button";import{ComponentBase as c,useHandleStyle as i}from"primereact/componentbase";import{CSSTransition as a}from"primereact/csstransition";import{useDisplayOrder as p,useGlobalOnEscapeKey as l,ESC_KEY_HANDLING_PRIORITIES as u,useOverlayListener as s,useUpdateEffect as f,useUnmountEffect as m}from"primereact/hooks";import{OverlayService as b}from"primereact/overlayservice";import{Portal as d}from"primereact/portal";import{classNames as v,DomHandler as y,ZIndexUtils as g,mergeProps as j,ObjectUtils as h,IconUtils as O}from"primereact/utils";function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E.apply(this,arguments)}function S(e){if(Array.isArray(e))return e}function w(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c,i,a=[],p=!0,l=!1;try{if(c=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;p=!1}else for(;!(p=(n=c.call(r)).done)&&(a.push(n.value),a.length!==t);p=!0);}catch(e){l=!0,o=e}finally{try{if(!p&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return a}}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t){if(e){if("string"==typeof e)return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}function N(){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 C(e,t){return S(e)||w(e,t)||x(e,t)||N()}function I(e){return I="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},I(e)}function R(e,t){if("object"!==I(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function k(e){var t=R(e,"string");return"symbol"===I(t)?t:String(t)}var A=c.extend({defaultProps:{__TYPE:"ConfirmPopup",accept:null,acceptClassName:null,acceptIcon:null,acceptLabel:null,appendTo:null,children:void 0,className:null,closeOnEscape:!0,defaultFocus:"accept",dismissable:!0,footer:null,icon:null,message:null,onHide:null,onShow:null,reject:null,rejectClassName:null,rejectIcon:null,rejectLabel:null,style:null,tagKey:void 0,target:null,transitionOptions:null,visible:!1},css:{classes:{root:function(e){var r=e.context;return v("p-confirm-popup p-component",(0,e.getPropValue)("className"),{"p-input-filled":r&&"filled"===r.inputStyle||"filled"===t.inputStyle,"p-ripple-disabled":r&&!1===r.ripple||!1===t.ripple})},acceptButton:function(e){return v("p-confirm-popup-accept p-button-sm",(0,e.getPropValue)("acceptClassName"))},rejectButton:function(e){var t=e.getPropValue;return v("p-confirm-popup-reject p-button-sm",{"p-button-text":!t("rejectClassName")},t("rejectClassName"))},content:"p-confirm-popup-content",icon:"p-confirm-popup-icon",message:"p-confirm-popup-message",footer:"p-confirm-popup-footer",transition:"p-connected-overlay"},styles:'\n@layer primereact {\n .p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n }\n \n .p-confirm-popup:after, .p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n }\n \n .p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n }\n \n .p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n }\n \n .p-confirm-popup-flipped:after, .p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n }\n \n .p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n }\n \n .p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent\n }\n \n .p-confirm-popup .p-confirm-popup-content {\n display: flex;\n align-items: center;\n }\n}\n'}});function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){var n,o,c;n=e,c=r[t],(o=k(o=t))in n?Object.defineProperty(n,o,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[o]=c})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=B(B({},e),{visible:void 0===e.visible||e.visible})).visible&&b.emit("confirm-popup",e);return{show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b.emit("confirm-popup",B(B(B({},e),t),{visible:!0}))},hide:function(){b.emit("confirm-popup",{visible:!1})}}},V=e.memo(e.forwardRef((function(c,S){var w=e.useContext(r),P=A.getProps(c,w),x=C(e.useState(P.visible),2),N=x[0],I=x[1],R=C(e.useState(!1),2),k=R[0],L=R[1],T={props:P,state:{visible:N,reshow:k}},V=A.setMetaData(T),D=V.ptm,_=V.cx,J=V.isUnstyled;i(A.css.styles,J,{name:"confirmpopup"});var X=e.useRef(null),M=e.useRef(null),H=e.useRef(null),K=e.useRef(!1),z=e.useRef(null),F=e.useRef(null),U=e.useRef(null),Z=e.useRef(!1),G=function(){return F.current||P},Y=function(e){return(F.current||P)[e]},$=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return h.getPropValue(Y(e),r)},q=Y("acceptLabel")||n("accept"),Q=Y("rejectLabel")||n("reject"),W=p("dialog",N);l({callback:function(){P.dismissable&&P.closeOnEscape&&ie("hide")},when:N,priority:[u.DIALOG,W]});var ee=C(s({target:Y("target"),overlay:X,listener:function(e,t){t.valid&&("outside"===t.type?P.dismissable&&!K.current&&ie("hide"):ie("hide")),K.current=!1},when:N}),2),te=ee[0],re=ee[1],ne=function(){Z.current||(Z.current=!0,$("accept"),ie("accept"))},oe=function(){Z.current||(Z.current=!0,$("reject"),ie("reject"))},ce=function(){var e=G();L(!1),e.group===P.group&&(I(!0),Z.current=!1,z.current=function(e){!pe(e.target)&&(K.current=!0)},b.on("overlay-click",z.current),U.current=document.activeElement)},ie=function(e){I(!1),b.off("overlay-click",z.current),z.current=null,e&&$("onHide",e),y.focus(U.current),U.current=null},ae=function(){if(Y("target")){y.absolutePosition(X.current,Y("target"));var e=y.getOffset(X.current),t=y.getOffset(Y("target")),r=0;e.left<t.left&&(r=t.left-e.left),X.current.style.setProperty("--overlayArrowLeft","".concat(r,"px")),e.top<t.top&&!J()&&y.addClass(X.current,"p-confirm-popup-flipped")}},pe=function(e){return X&&X.current&&!(X.current.isSameNode(e)||X.current.contains(e))},le=function(e){if(e.tagKey===P.tagKey){var t=N!==e.visible;Y("target")!==e.target&&!P.target?(ie(),F.current=e,L(!0)):t&&(F.current=e,e.visible?ce():ie())}};e.useEffect((function(){P.visible?ce():ie()}),[P.visible]),e.useEffect((function(){return P.target||P.message||b.on("confirm-popup",le),function(){b.off("confirm-popup",le)}}),[P.target]),f((function(){k&&ce()}),[k]),m((function(){z.current&&(b.off("overlay-click",z.current),z.current=null),b.off("confirm-popup",le),g.clear(X.current)})),e.useImperativeHandle(S,(function(){return{props:P,confirm:le}}));var ue,se,fe=function(){var t=v("p-confirm-popup-accept p-button-sm",Y("acceptClassName")),r=v("p-confirm-popup-reject p-button-sm",{"p-button-text":!Y("rejectClassName")},Y("rejectClassName")),n=j({className:_("footer")},D("footer")),c=j({ref:H,label:Q,icon:Y("rejectIcon"),className:_("rejectButton",{getPropValue:Y}),onClick:oe,pt:D("rejectButton"),unstyled:P.unstyled,__parentMetadata:{parent:T}}),i=j({ref:M,label:q,icon:Y("acceptIcon"),className:_("acceptButton",{getPropValue:Y}),onClick:ne,pt:D("acceptButton"),unstyled:P.unstyled,__parentMetadata:{parent:T}}),a=e.createElement("div",n,e.createElement(o,c),e.createElement(o,i));if(Y("footer")){var p={accept:ne,reject:oe,className:"p-confirm-popup-footer",acceptClassName:t,rejectClassName:r,acceptLabel:q,rejectLabel:Q,element:a,props:G()};return h.getJSXElement(Y("footer"),p)}return a},me=j({ref:X,id:Y("id"),className:_("root",{context:w,getPropValue:Y}),style:Y("style"),onClick:function(e){K.current=!0,b.emit("overlay-click",{originalEvent:e,target:Y("target")})}},A.getOtherProps(P),D("root")),be=j({classNames:_("transition"),in:N,timeout:{enter:120,exit:100},options:Y("transitionOptions"),unmountOnExit:!0,onEnter:function(){g.set("overlay",X.current,w&&w.autoZIndex||t.autoZIndex,w&&w.zIndex.overlay||t.zIndex.overlay),y.addStyles(X.current,{position:"absolute",top:"50%",left:"50%",marginTop:"10px"}),ae()},onEntered:function(){te();var e=Y("defaultFocus");void 0!==e&&"accept"!==e||M.current&&M.current.focus(),"reject"===e&&H.current&&H.current.focus(),$("onShow")},onExit:function(){re()},onExited:function(){g.clear(X.current),K.current=!1}},D("transition")),de=null!=c&&c.content?(ue=G(),se={message:h.getJSXElement(Y("message"),ue),acceptBtnRef:M,rejectBtnRef:H,hide:ie},e.createElement(a,E({nodeRef:X},be),e.createElement("div",me,h.getJSXElement(c.content,se)))):function(){var t,r,n,o,c,i,p=(t=G(),r=h.getJSXElement(Y("message"),t),n=j({className:_("icon")},D("icon")),o=O.getJSXIcon(Y("icon"),B({},n),{props:t}),c=j({className:_("message")},D("message")),i=j({className:_("content")},D("content")),e.createElement("div",i,o,e.createElement("span",c,r))),l=fe();return e.createElement(a,E({nodeRef:X},be),e.createElement("div",me,p,l))}();return e.createElement(d,{element:de,appendTo:Y("appendTo"),visible:Y("visible")})})));V.displayName="ConfirmPopup";export{V as ConfirmPopup,T as confirmPopup};
|