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
|
@@ -8,18 +8,20 @@
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
import * as React from 'react';
|
|
11
|
+
import { CSSTransitionProps as ReactCSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
11
12
|
import { ButtonPassThroughOptions } from '../button/button';
|
|
12
13
|
import { ComponentHooks } from '../componentbase/componentbase';
|
|
13
14
|
import { DialogProps } from '../dialog';
|
|
14
15
|
import { PassThroughOptions } from '../passthrough';
|
|
15
16
|
import { IconType, PassThroughType } from '../utils';
|
|
16
17
|
|
|
17
|
-
export declare type ConfirmDialogPassThroughType<T> = PassThroughType<T,
|
|
18
|
+
export declare type ConfirmDialogPassThroughType<T> = PassThroughType<T, ConfirmDialogPassThroughMethodOptions>;
|
|
19
|
+
export declare type ConfirmDialogPassThroughTransitionType = ReactCSSTransitionProps | ((options: ConfirmDialogPassThroughMethodOptions) => ReactCSSTransitionProps) | undefined;
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* Custom passthrough(pt) option method.
|
|
21
23
|
*/
|
|
22
|
-
export interface
|
|
24
|
+
export interface ConfirmDialogPassThroughMethodOptions {
|
|
23
25
|
props: ConfirmDialogProps;
|
|
24
26
|
state: ConfirmDialogState;
|
|
25
27
|
}
|
|
@@ -84,6 +86,10 @@ export interface ConfirmDialogPassThroughOptions {
|
|
|
84
86
|
* @see {@link ComponentHooks}
|
|
85
87
|
*/
|
|
86
88
|
hooks?: ComponentHooks;
|
|
89
|
+
/**
|
|
90
|
+
* Used to control React Transition API.
|
|
91
|
+
*/
|
|
92
|
+
transition?: ConfirmDialogPassThroughTransitionType;
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
/**
|
|
@@ -131,6 +137,11 @@ interface ConfirmDialogOptions {
|
|
|
131
137
|
* @defaultValue No
|
|
132
138
|
*/
|
|
133
139
|
rejectLabel: string;
|
|
140
|
+
/**
|
|
141
|
+
* Element to receive the focus when the dialog gets visible, valid values are "accept" and "reject".
|
|
142
|
+
* @defaultValue accept
|
|
143
|
+
*/
|
|
144
|
+
defaultFocus: string;
|
|
134
145
|
/**
|
|
135
146
|
* Default element created by the component.
|
|
136
147
|
*/
|
|
@@ -194,11 +205,16 @@ export interface ConfirmDialogProps extends Omit<DialogProps, 'onHide' | 'footer
|
|
|
194
205
|
* Style class of the accept button.
|
|
195
206
|
*/
|
|
196
207
|
acceptClassName?: string | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* Element to receive the focus when the dialog gets visible, valid values are "accept" and "reject".
|
|
210
|
+
* @defaultValue accept
|
|
211
|
+
*/
|
|
212
|
+
defaultFocus?: string | undefined;
|
|
197
213
|
/**
|
|
198
214
|
* DOM element instance where the overlay panel should be mounted. Valid values are any DOM Element and "self". The "self" value is used to render a component where it is located.
|
|
199
215
|
* @defaultValue document.body
|
|
200
216
|
*/
|
|
201
|
-
appendTo?: 'self' | HTMLElement | undefined | null;
|
|
217
|
+
appendTo?: 'self' | HTMLElement | undefined | null | (() => HTMLElement);
|
|
202
218
|
/**
|
|
203
219
|
* Style class of the element.
|
|
204
220
|
*/
|
|
@@ -135,24 +135,25 @@ var classes = {
|
|
|
135
135
|
var ConfirmDialogBase = ComponentBase.extend({
|
|
136
136
|
defaultProps: {
|
|
137
137
|
__TYPE: 'ConfirmDialog',
|
|
138
|
-
|
|
139
|
-
visible: undefined,
|
|
140
|
-
message: null,
|
|
141
|
-
rejectLabel: null,
|
|
142
|
-
acceptLabel: null,
|
|
143
|
-
icon: null,
|
|
144
|
-
rejectIcon: null,
|
|
145
|
-
acceptIcon: null,
|
|
146
|
-
rejectClassName: null,
|
|
138
|
+
accept: null,
|
|
147
139
|
acceptClassName: null,
|
|
148
|
-
|
|
140
|
+
acceptIcon: null,
|
|
141
|
+
acceptLabel: null,
|
|
149
142
|
appendTo: null,
|
|
150
|
-
footer: null,
|
|
151
143
|
breakpoints: null,
|
|
144
|
+
children: undefined,
|
|
145
|
+
className: null,
|
|
146
|
+
defaultFocus: 'accept',
|
|
147
|
+
footer: null,
|
|
148
|
+
icon: null,
|
|
149
|
+
message: null,
|
|
152
150
|
onHide: null,
|
|
153
|
-
accept: null,
|
|
154
151
|
reject: null,
|
|
155
|
-
|
|
152
|
+
rejectClassName: null,
|
|
153
|
+
rejectIcon: null,
|
|
154
|
+
rejectLabel: null,
|
|
155
|
+
tagKey: undefined,
|
|
156
|
+
visible: undefined
|
|
156
157
|
},
|
|
157
158
|
css: {
|
|
158
159
|
classes: classes
|
|
@@ -198,10 +199,10 @@ var ConfirmDialog = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(funct
|
|
|
198
199
|
var isCallbackExecuting = React.useRef(false);
|
|
199
200
|
var focusElementOnHide = React.useRef(null);
|
|
200
201
|
var getCurrentProps = function getCurrentProps() {
|
|
201
|
-
return
|
|
202
|
+
return confirmProps.current || props;
|
|
202
203
|
};
|
|
203
204
|
var getPropValue = function getPropValue(key) {
|
|
204
|
-
return
|
|
205
|
+
return (confirmProps.current || props)[key];
|
|
205
206
|
};
|
|
206
207
|
var callbackFromProp = function callbackFromProp(key) {
|
|
207
208
|
for (var _len = arguments.length, param = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -294,12 +295,14 @@ var ConfirmDialog = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(funct
|
|
|
294
295
|
};
|
|
295
296
|
});
|
|
296
297
|
var createFooter = function createFooter() {
|
|
298
|
+
var defaultFocus = getPropValue('defaultFocus');
|
|
297
299
|
var acceptClassName = classNames('p-confirm-dialog-accept', getPropValue('acceptClassName'));
|
|
298
300
|
var rejectClassName = classNames('p-confirm-dialog-reject', {
|
|
299
301
|
'p-button-text': !getPropValue('rejectClassName')
|
|
300
302
|
}, getPropValue('rejectClassName'));
|
|
301
303
|
var rejectButtonProps = {
|
|
302
304
|
label: rejectLabel,
|
|
305
|
+
autoFocus: defaultFocus === 'reject',
|
|
303
306
|
icon: getPropValue('rejectIcon'),
|
|
304
307
|
className: classNames(getPropValue('rejectClassName'), cx('rejectButton', {
|
|
305
308
|
getPropValue: getPropValue
|
|
@@ -313,17 +316,17 @@ var ConfirmDialog = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(funct
|
|
|
313
316
|
};
|
|
314
317
|
var acceptButtonProps = mergeProps({
|
|
315
318
|
label: acceptLabel,
|
|
319
|
+
autoFocus: defaultFocus === undefined || defaultFocus === 'accept',
|
|
316
320
|
icon: getPropValue('acceptIcon'),
|
|
317
321
|
className: classNames(getPropValue('acceptClassName'), cx('acceptButton')),
|
|
318
322
|
onClick: accept,
|
|
323
|
+
pt: ptm('acceptButton'),
|
|
319
324
|
unstyled: props.unstyled,
|
|
320
325
|
__parentMetadata: {
|
|
321
326
|
parent: metaData
|
|
322
327
|
}
|
|
323
328
|
}, ptm('acceptButton'));
|
|
324
|
-
var content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, rejectButtonProps), /*#__PURE__*/React.createElement(Button,
|
|
325
|
-
autoFocus: true
|
|
326
|
-
})));
|
|
329
|
+
var content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, rejectButtonProps), /*#__PURE__*/React.createElement(Button, acceptButtonProps));
|
|
327
330
|
if (getPropValue('footer')) {
|
|
328
331
|
var defaultContentOptions = {
|
|
329
332
|
accept: accept,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as t,localeOption as r}from"primereact/api";import{Button as n}from"primereact/button";import{Dialog as o}from"primereact/dialog";import{useUpdateEffect as a,useUnmountEffect as c}from"primereact/hooks";import{OverlayService as i}from"primereact/overlayservice";import{Portal as l}from"primereact/portal";import{classNames as u,DomHandler as s,ObjectUtils as p,mergeProps as f,IconUtils as m}from"primereact/utils";import{ComponentBase as b}from"primereact/componentbase";function g(){return g=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},g.apply(this,arguments)}function d(e){if(Array.isArray(e))return e}function v(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,c,i=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw o}}return i}}function y(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 j(e,t){if(e){if("string"==typeof e)return y(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)?y(e,t):void 0}}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){return d(e)||v(e,t)||j(e,t)||O()}function S(e){return S="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},S(e)}function N(e,t){if("object"!==S(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function P(e){var t=N(e,"string");return"symbol"===S(t)?t:String(t)}var w=b.extend({defaultProps:{__TYPE:"ConfirmDialog",
|
|
1
|
+
import*as e from"react";import{PrimeReactContext as t,localeOption as r}from"primereact/api";import{Button as n}from"primereact/button";import{Dialog as o}from"primereact/dialog";import{useUpdateEffect as a,useUnmountEffect as c}from"primereact/hooks";import{OverlayService as i}from"primereact/overlayservice";import{Portal as l}from"primereact/portal";import{classNames as u,DomHandler as s,ObjectUtils as p,mergeProps as f,IconUtils as m}from"primereact/utils";import{ComponentBase as b}from"primereact/componentbase";function g(){return g=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},g.apply(this,arguments)}function d(e){if(Array.isArray(e))return e}function v(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,c,i=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw o}}return i}}function y(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 j(e,t){if(e){if("string"==typeof e)return y(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)?y(e,t):void 0}}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){return d(e)||v(e,t)||j(e,t)||O()}function S(e){return S="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},S(e)}function N(e,t){if("object"!==S(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function P(e){var t=N(e,"string");return"symbol"===S(t)?t:String(t)}var w=b.extend({defaultProps:{__TYPE:"ConfirmDialog",accept:null,acceptClassName:null,acceptIcon:null,acceptLabel:null,appendTo:null,breakpoints:null,children:void 0,className:null,defaultFocus:"accept",footer:null,icon:null,message:null,onHide:null,reject:null,rejectClassName:null,rejectIcon:null,rejectLabel:null,tagKey:void 0,visible:void 0},css:{classes:{root:"p-confirm-dialog",message:"p-confirm-dialog-message",icon:"p-confirm-dialog-icon",acceptButton:"p-confirm-dialog-accept",rejectButton:function(e){return u("p-confirm-dialog-reject",{"p-button-text":!(0,e.getPropValue)("rejectClassName")})}}}});function C(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 E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){var n,o,a;n=e,a=r[t],(o=P(o=t))in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=E(E({},e),{visible:void 0===e.visible||e.visible})).visible&&i.emit("confirm-dialog",e);return{show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.emit("confirm-dialog",E(E(E({},e),t),{visible:!0}))},hide:function(){i.emit("confirm-dialog",{visible:!1})}}},T=e.memo(e.forwardRef((function(b,d){var v=e.useContext(t),y=w.getProps(b,v),j=h(e.useState(y.visible),2),O=j[0],S=j[1],N=h(e.useState(!1),2),P=N[0],C=N[1],I=e.useRef(null),T=e.useRef(!1),_=e.useRef(null),k=function(){return I.current||y},x=function(e){return(I.current||y)[e]},A=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 p.getPropValue(x(e),r)},B=x("acceptLabel")||r("accept"),D=x("rejectLabel")||r("reject"),L={props:y,state:{visible:O}},F=w.setMetaData(L),M=F.ptm,H=F.cx,R=function(){T.current||(T.current=!0,A("accept"),V("accept"))},J=function(){T.current||(T.current=!0,A("reject"),V("reject"))},K=function(){k().group===y.group&&(S(!0),T.current=!1,_.current=document.activeElement)},V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cancel";S(!1),A("onHide",{result:e}),s.focus(_.current),_.current=null},X=function(e){if(e.tagKey===y.tagKey){var t=O!==e.visible;x("target")!==e.target&&!y.target?(V(),I.current=e,C(!0)):t&&(I.current=e,e.visible?K():V())}};e.useEffect((function(){y.visible?K():V()}),[y.visible]),e.useEffect((function(){return y.target||y.message||i.on("confirm-dialog",X),function(){i.off("confirm-dialog",X)}}),[y.target]),a((function(){P&&K()}),[P]),c((function(){i.off("confirm-dialog",X)})),e.useImperativeHandle(d,(function(){return{props:y,confirm:X}}));var U,Y,$,q,z,G,Q,W=function(){var t=x("defaultFocus"),r=u("p-confirm-dialog-accept",x("acceptClassName")),o=u("p-confirm-dialog-reject",{"p-button-text":!x("rejectClassName")},x("rejectClassName")),a={label:D,autoFocus:"reject"===t,icon:x("rejectIcon"),className:u(x("rejectClassName"),H("rejectButton",{getPropValue:x})),onClick:J,pt:M("rejectButton"),unstyled:y.unstyled,__parentMetadata:{parent:L}},c=f({label:B,autoFocus:void 0===t||"accept"===t,icon:x("acceptIcon"),className:u(x("acceptClassName"),H("acceptButton")),onClick:R,pt:M("acceptButton"),unstyled:y.unstyled,__parentMetadata:{parent:L}},M("acceptButton")),i=e.createElement(e.Fragment,null,e.createElement(n,a),e.createElement(n,c));if(x("footer")){var l={accept:R,reject:J,acceptClassName:r,rejectClassName:o,acceptLabel:B,rejectLabel:D,element:i,props:k()};return p.getJSXElement(x("footer"),l)}return i},Z=(U=k(),Y=p.getJSXElement(x("message"),U),$=f({className:H("icon")},M("icon")),q=m.getJSXIcon(x("icon"),E({},$),{props:U}),z=W(),G=f({className:H("message")},M("message")),Q=f({visible:O,className:u(x("className"),H("root")),footer:z,onHide:V,breakpoints:x("breakpoints"),pt:U.pt,unstyled:y.unstyled,appendTo:x("appendTo"),__parentMetadata:{parent:L}},w.getOtherProps(U)),e.createElement(o,g({},Q,{content:null==b?void 0:b.content}),q,e.createElement("span",G,Y)));return e.createElement(l,{element:Z,appendTo:x("appendTo")})})));T.displayName="ConfirmDialog";export{T as ConfirmDialog,I as confirmDialog};
|
|
@@ -148,24 +148,25 @@ this.primereact.confirmdialog = (function (exports, React, api, button, dialog,
|
|
|
148
148
|
var ConfirmDialogBase = componentbase.ComponentBase.extend({
|
|
149
149
|
defaultProps: {
|
|
150
150
|
__TYPE: 'ConfirmDialog',
|
|
151
|
-
|
|
152
|
-
visible: undefined,
|
|
153
|
-
message: null,
|
|
154
|
-
rejectLabel: null,
|
|
155
|
-
acceptLabel: null,
|
|
156
|
-
icon: null,
|
|
157
|
-
rejectIcon: null,
|
|
158
|
-
acceptIcon: null,
|
|
159
|
-
rejectClassName: null,
|
|
151
|
+
accept: null,
|
|
160
152
|
acceptClassName: null,
|
|
161
|
-
|
|
153
|
+
acceptIcon: null,
|
|
154
|
+
acceptLabel: null,
|
|
162
155
|
appendTo: null,
|
|
163
|
-
footer: null,
|
|
164
156
|
breakpoints: null,
|
|
157
|
+
children: undefined,
|
|
158
|
+
className: null,
|
|
159
|
+
defaultFocus: 'accept',
|
|
160
|
+
footer: null,
|
|
161
|
+
icon: null,
|
|
162
|
+
message: null,
|
|
165
163
|
onHide: null,
|
|
166
|
-
accept: null,
|
|
167
164
|
reject: null,
|
|
168
|
-
|
|
165
|
+
rejectClassName: null,
|
|
166
|
+
rejectIcon: null,
|
|
167
|
+
rejectLabel: null,
|
|
168
|
+
tagKey: undefined,
|
|
169
|
+
visible: undefined
|
|
169
170
|
},
|
|
170
171
|
css: {
|
|
171
172
|
classes: classes
|
|
@@ -211,10 +212,10 @@ this.primereact.confirmdialog = (function (exports, React, api, button, dialog,
|
|
|
211
212
|
var isCallbackExecuting = React__namespace.useRef(false);
|
|
212
213
|
var focusElementOnHide = React__namespace.useRef(null);
|
|
213
214
|
var getCurrentProps = function getCurrentProps() {
|
|
214
|
-
return
|
|
215
|
+
return confirmProps.current || props;
|
|
215
216
|
};
|
|
216
217
|
var getPropValue = function getPropValue(key) {
|
|
217
|
-
return
|
|
218
|
+
return (confirmProps.current || props)[key];
|
|
218
219
|
};
|
|
219
220
|
var callbackFromProp = function callbackFromProp(key) {
|
|
220
221
|
for (var _len = arguments.length, param = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -307,12 +308,14 @@ this.primereact.confirmdialog = (function (exports, React, api, button, dialog,
|
|
|
307
308
|
};
|
|
308
309
|
});
|
|
309
310
|
var createFooter = function createFooter() {
|
|
311
|
+
var defaultFocus = getPropValue('defaultFocus');
|
|
310
312
|
var acceptClassName = utils.classNames('p-confirm-dialog-accept', getPropValue('acceptClassName'));
|
|
311
313
|
var rejectClassName = utils.classNames('p-confirm-dialog-reject', {
|
|
312
314
|
'p-button-text': !getPropValue('rejectClassName')
|
|
313
315
|
}, getPropValue('rejectClassName'));
|
|
314
316
|
var rejectButtonProps = {
|
|
315
317
|
label: rejectLabel,
|
|
318
|
+
autoFocus: defaultFocus === 'reject',
|
|
316
319
|
icon: getPropValue('rejectIcon'),
|
|
317
320
|
className: utils.classNames(getPropValue('rejectClassName'), cx('rejectButton', {
|
|
318
321
|
getPropValue: getPropValue
|
|
@@ -326,17 +329,17 @@ this.primereact.confirmdialog = (function (exports, React, api, button, dialog,
|
|
|
326
329
|
};
|
|
327
330
|
var acceptButtonProps = utils.mergeProps({
|
|
328
331
|
label: acceptLabel,
|
|
332
|
+
autoFocus: defaultFocus === undefined || defaultFocus === 'accept',
|
|
329
333
|
icon: getPropValue('acceptIcon'),
|
|
330
334
|
className: utils.classNames(getPropValue('acceptClassName'), cx('acceptButton')),
|
|
331
335
|
onClick: accept,
|
|
336
|
+
pt: ptm('acceptButton'),
|
|
332
337
|
unstyled: props.unstyled,
|
|
333
338
|
__parentMetadata: {
|
|
334
339
|
parent: metaData
|
|
335
340
|
}
|
|
336
341
|
}, ptm('acceptButton'));
|
|
337
|
-
var content = /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(button.Button, rejectButtonProps), /*#__PURE__*/React__namespace.createElement(button.Button,
|
|
338
|
-
autoFocus: true
|
|
339
|
-
})));
|
|
342
|
+
var content = /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(button.Button, rejectButtonProps), /*#__PURE__*/React__namespace.createElement(button.Button, acceptButtonProps));
|
|
340
343
|
if (getPropValue('footer')) {
|
|
341
344
|
var defaultContentOptions = {
|
|
342
345
|
accept: accept,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.confirmdialog=function(e,t,r,n,o,a,c,i,l,u){"use strict";function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var p=s(t);function f(){return f=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},f.apply(this,arguments)}function m(e){if(Array.isArray(e))return e}function b(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,c,i=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw o}}return i}}function
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.confirmdialog=function(e,t,r,n,o,a,c,i,l,u){"use strict";function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var p=s(t);function f(){return f=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},f.apply(this,arguments)}function m(e){if(Array.isArray(e))return e}function b(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,c,i=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw o}}return i}}function v(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 g(e,t){if(e){if("string"==typeof e)return v(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)?v(e,t):void 0}}function d(){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 y(e,t){return m(e)||b(e,t)||g(e,t)||d()}function j(e){return j="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},j(e)}function O(e,t){if("object"!==j(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e){var t=O(e,"string");return"symbol"===j(t)?t:String(t)}var P=u.ComponentBase.extend({defaultProps:{__TYPE:"ConfirmDialog",accept:null,acceptClassName:null,acceptIcon:null,acceptLabel:null,appendTo:null,breakpoints:null,children:void 0,className:null,defaultFocus:"accept",footer:null,icon:null,message:null,onHide:null,reject:null,rejectClassName:null,rejectIcon:null,rejectLabel:null,tagKey:void 0,visible:void 0},css:{classes:{root:"p-confirm-dialog",message:"p-confirm-dialog-message",icon:"p-confirm-dialog-icon",acceptButton:"p-confirm-dialog-accept",rejectButton:function(e){return l.classNames("p-confirm-dialog-reject",{"p-button-text":!(0,e.getPropValue)("rejectClassName")})}}}});function S(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 N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){var n,o,a;n=e,a=r[t],(o=h(o=t))in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var C=p.memo(p.forwardRef((function(e,t){var u=p.useContext(r.PrimeReactContext),s=P.getProps(e,u),m=y(p.useState(s.visible),2),b=m[0],v=m[1],g=y(p.useState(!1),2),d=g[0],j=g[1],O=p.useRef(null),h=p.useRef(!1),S=p.useRef(null),C=function(){return O.current||s},E=function(e){return(O.current||s)[e]},w=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 l.ObjectUtils.getPropValue(E(e),r)},D=E("acceptLabel")||r.localeOption("accept"),_=E("rejectLabel")||r.localeOption("reject"),B={props:s,state:{visible:b}},I=P.setMetaData(B),k=I.ptm,T=I.cx,x=function(){h.current||(h.current=!0,w("accept"),U("accept"))},A=function(){h.current||(h.current=!0,w("reject"),U("reject"))},M=function(){C().group===s.group&&(v(!0),h.current=!1,S.current=document.activeElement)},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cancel";v(!1),w("onHide",{result:e}),l.DomHandler.focus(S.current),S.current=null},L=function(e){if(e.tagKey===s.tagKey){var t=b!==e.visible;E("target")!==e.target&&!s.target?(U(),O.current=e,j(!0)):t&&(O.current=e,e.visible?M():U())}};p.useEffect((function(){s.visible?M():U()}),[s.visible]),p.useEffect((function(){return s.target||s.message||c.OverlayService.on("confirm-dialog",L),function(){c.OverlayService.off("confirm-dialog",L)}}),[s.target]),a.useUpdateEffect((function(){d&&M()}),[d]),a.useUnmountEffect((function(){c.OverlayService.off("confirm-dialog",L)})),p.useImperativeHandle(t,(function(){return{props:s,confirm:L}}));var R,F,H,J,K,V,X,z=function(){var e=E("defaultFocus"),t=l.classNames("p-confirm-dialog-accept",E("acceptClassName")),r=l.classNames("p-confirm-dialog-reject",{"p-button-text":!E("rejectClassName")},E("rejectClassName")),o={label:_,autoFocus:"reject"===e,icon:E("rejectIcon"),className:l.classNames(E("rejectClassName"),T("rejectButton",{getPropValue:E})),onClick:A,pt:k("rejectButton"),unstyled:s.unstyled,__parentMetadata:{parent:B}},a=l.mergeProps({label:D,autoFocus:void 0===e||"accept"===e,icon:E("acceptIcon"),className:l.classNames(E("acceptClassName"),T("acceptButton")),onClick:x,pt:k("acceptButton"),unstyled:s.unstyled,__parentMetadata:{parent:B}},k("acceptButton")),c=p.createElement(p.Fragment,null,p.createElement(n.Button,o),p.createElement(n.Button,a));if(E("footer")){var i={accept:x,reject:A,acceptClassName:t,rejectClassName:r,acceptLabel:D,rejectLabel:_,element:c,props:C()};return l.ObjectUtils.getJSXElement(E("footer"),i)}return c},Y=(R=C(),F=l.ObjectUtils.getJSXElement(E("message"),R),H=l.mergeProps({className:T("icon")},k("icon")),J=l.IconUtils.getJSXIcon(E("icon"),N({},H),{props:R}),K=z(),V=l.mergeProps({className:T("message")},k("message")),X=l.mergeProps({visible:b,className:l.classNames(E("className"),T("root")),footer:K,onHide:U,breakpoints:E("breakpoints"),pt:R.pt,unstyled:s.unstyled,appendTo:E("appendTo"),__parentMetadata:{parent:B}},P.getOtherProps(R)),p.createElement(o.Dialog,f({},X,{content:null==e?void 0:e.content}),J,p.createElement("span",V,F)));return p.createElement(i.Portal,{element:Y,appendTo:E("appendTo")})})));return C.displayName="ConfirmDialog",e.ConfirmDialog=C,e.confirmDialog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=N(N({},e),{visible:void 0===e.visible||e.visible})).visible&&c.OverlayService.emit("confirm-dialog",e);return{show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c.OverlayService.emit("confirm-dialog",N(N(N({},e),t),{visible:!0}))},hide:function(){c.OverlayService.emit("confirm-dialog",{visible:!1})}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.button,primereact.dialog,primereact.hooks,primereact.overlayservice,primereact.portal,primereact.utils,primereact.componentbase);
|
|
@@ -176,29 +176,30 @@ var classes = {
|
|
|
176
176
|
var ConfirmPopupBase = componentbase.ComponentBase.extend({
|
|
177
177
|
defaultProps: {
|
|
178
178
|
__TYPE: 'ConfirmPopup',
|
|
179
|
-
|
|
180
|
-
target: null,
|
|
181
|
-
visible: false,
|
|
182
|
-
message: null,
|
|
183
|
-
rejectLabel: null,
|
|
184
|
-
acceptLabel: null,
|
|
185
|
-
icon: null,
|
|
186
|
-
rejectIcon: null,
|
|
187
|
-
acceptIcon: null,
|
|
188
|
-
rejectClassName: null,
|
|
179
|
+
accept: null,
|
|
189
180
|
acceptClassName: null,
|
|
190
|
-
|
|
191
|
-
|
|
181
|
+
acceptIcon: null,
|
|
182
|
+
acceptLabel: null,
|
|
192
183
|
appendTo: null,
|
|
184
|
+
children: undefined,
|
|
185
|
+
className: null,
|
|
186
|
+
closeOnEscape: true,
|
|
187
|
+
defaultFocus: 'accept',
|
|
193
188
|
dismissable: true,
|
|
194
189
|
footer: null,
|
|
195
|
-
|
|
190
|
+
icon: null,
|
|
191
|
+
message: null,
|
|
196
192
|
onHide: null,
|
|
197
|
-
|
|
193
|
+
onShow: null,
|
|
198
194
|
reject: null,
|
|
195
|
+
rejectClassName: null,
|
|
196
|
+
rejectIcon: null,
|
|
197
|
+
rejectLabel: null,
|
|
198
|
+
style: null,
|
|
199
|
+
tagKey: undefined,
|
|
200
|
+
target: null,
|
|
199
201
|
transitionOptions: null,
|
|
200
|
-
|
|
201
|
-
closeOnEscape: true
|
|
202
|
+
visible: false
|
|
202
203
|
},
|
|
203
204
|
css: {
|
|
204
205
|
classes: classes,
|
|
@@ -206,106 +207,6 @@ var ConfirmPopupBase = componentbase.ComponentBase.extend({
|
|
|
206
207
|
}
|
|
207
208
|
});
|
|
208
209
|
|
|
209
|
-
var usePrevious = function usePrevious(newValue) {
|
|
210
|
-
var ref = React__namespace.useRef(undefined);
|
|
211
|
-
React__namespace.useEffect(function () {
|
|
212
|
-
ref.current = newValue;
|
|
213
|
-
});
|
|
214
|
-
return ref.current;
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
/* eslint-disable */
|
|
218
|
-
var useUnmountEffect = function useUnmountEffect(fn) {
|
|
219
|
-
return React__namespace.useEffect(function () {
|
|
220
|
-
return fn;
|
|
221
|
-
}, []);
|
|
222
|
-
};
|
|
223
|
-
/* eslint-enable */
|
|
224
|
-
|
|
225
|
-
/* eslint-disable */
|
|
226
|
-
var useEventListener = function useEventListener(_ref) {
|
|
227
|
-
var _ref$target = _ref.target,
|
|
228
|
-
target = _ref$target === void 0 ? 'document' : _ref$target,
|
|
229
|
-
type = _ref.type,
|
|
230
|
-
listener = _ref.listener,
|
|
231
|
-
options = _ref.options,
|
|
232
|
-
_ref$when = _ref.when,
|
|
233
|
-
when = _ref$when === void 0 ? true : _ref$when;
|
|
234
|
-
var targetRef = React__namespace.useRef(null);
|
|
235
|
-
var listenerRef = React__namespace.useRef(null);
|
|
236
|
-
var prevListener = usePrevious(listener);
|
|
237
|
-
var prevOptions = usePrevious(options);
|
|
238
|
-
var bind = function bind() {
|
|
239
|
-
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
240
|
-
if (utils.ObjectUtils.isNotEmpty(bindOptions.target)) {
|
|
241
|
-
unbind();
|
|
242
|
-
(bindOptions.when || when) && (targetRef.current = utils.DomHandler.getTargetElement(bindOptions.target));
|
|
243
|
-
}
|
|
244
|
-
if (!listenerRef.current && targetRef.current) {
|
|
245
|
-
listenerRef.current = function (event) {
|
|
246
|
-
return listener && listener(event);
|
|
247
|
-
};
|
|
248
|
-
targetRef.current.addEventListener(type, listenerRef.current, options);
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
var unbind = function unbind() {
|
|
252
|
-
if (listenerRef.current) {
|
|
253
|
-
targetRef.current.removeEventListener(type, listenerRef.current, options);
|
|
254
|
-
listenerRef.current = null;
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
React__namespace.useEffect(function () {
|
|
258
|
-
if (when) {
|
|
259
|
-
targetRef.current = utils.DomHandler.getTargetElement(target);
|
|
260
|
-
} else {
|
|
261
|
-
unbind();
|
|
262
|
-
targetRef.current = null;
|
|
263
|
-
}
|
|
264
|
-
}, [target, when]);
|
|
265
|
-
React__namespace.useEffect(function () {
|
|
266
|
-
// to properly compare functions we can implicitly converting the function to it's body's text as a String
|
|
267
|
-
if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
|
|
268
|
-
unbind();
|
|
269
|
-
when && bind();
|
|
270
|
-
}
|
|
271
|
-
}, [listener, options, when]);
|
|
272
|
-
useUnmountEffect(function () {
|
|
273
|
-
unbind();
|
|
274
|
-
});
|
|
275
|
-
return [bind, unbind];
|
|
276
|
-
};
|
|
277
|
-
/* eslint-enable */
|
|
278
|
-
|
|
279
|
-
var useOnEscapeKey = function useOnEscapeKey(ref, condition, callback) {
|
|
280
|
-
var handleEsc = function handleEsc(event) {
|
|
281
|
-
if (event.key === 'Esc' || event.key === 'Escape') {
|
|
282
|
-
event.stopImmediatePropagation();
|
|
283
|
-
callback(event);
|
|
284
|
-
}
|
|
285
|
-
return;
|
|
286
|
-
};
|
|
287
|
-
var _useEventListener = useEventListener({
|
|
288
|
-
type: 'keydown',
|
|
289
|
-
listener: handleEsc
|
|
290
|
-
}),
|
|
291
|
-
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
292
|
-
bindKeyDownListener = _useEventListener2[0],
|
|
293
|
-
unbindKeyDownListener = _useEventListener2[1];
|
|
294
|
-
React__namespace.useEffect(function () {
|
|
295
|
-
if (!condition) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
if (!ref.current) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
bindKeyDownListener();
|
|
302
|
-
return function () {
|
|
303
|
-
unbindKeyDownListener();
|
|
304
|
-
};
|
|
305
|
-
});
|
|
306
|
-
return [ref, callback];
|
|
307
|
-
};
|
|
308
|
-
|
|
309
210
|
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; }
|
|
310
211
|
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; }
|
|
311
212
|
var confirmPopup = function confirmPopup() {
|
|
@@ -377,8 +278,15 @@ var ConfirmPopup = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__names
|
|
|
377
278
|
};
|
|
378
279
|
var acceptLabel = getPropValue('acceptLabel') || PrimeReact.localeOption('accept');
|
|
379
280
|
var rejectLabel = getPropValue('rejectLabel') || PrimeReact.localeOption('reject');
|
|
380
|
-
|
|
381
|
-
|
|
281
|
+
var displayOrder = hooks.useDisplayOrder('dialog', visibleState);
|
|
282
|
+
hooks.useGlobalOnEscapeKey({
|
|
283
|
+
callback: function callback() {
|
|
284
|
+
if (props.dismissable && props.closeOnEscape) {
|
|
285
|
+
hide('hide');
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
when: visibleState,
|
|
289
|
+
priority: [hooks.ESC_KEY_HANDLING_PRIORITIES.DIALOG, displayOrder]
|
|
382
290
|
});
|
|
383
291
|
var _useOverlayListener = hooks.useOverlayListener({
|
|
384
292
|
target: getPropValue('target'),
|
|
@@ -455,8 +363,12 @@ var ConfirmPopup = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__names
|
|
|
455
363
|
};
|
|
456
364
|
var onEntered = function onEntered() {
|
|
457
365
|
bindOverlayListener();
|
|
458
|
-
|
|
459
|
-
|
|
366
|
+
var defaultFocus = getPropValue('defaultFocus');
|
|
367
|
+
if (defaultFocus === undefined || defaultFocus === 'accept') {
|
|
368
|
+
acceptBtnRef.current && acceptBtnRef.current.focus();
|
|
369
|
+
}
|
|
370
|
+
if (defaultFocus === 'reject') {
|
|
371
|
+
rejectBtnRef.current && rejectBtnRef.current.focus();
|
|
460
372
|
}
|
|
461
373
|
callbackFromProp('onShow');
|
|
462
374
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),r=require("primereact/button"),n=require("primereact/componentbase"),o=require("primereact/csstransition"),c=require("primereact/hooks"),i=require("primereact/overlayservice"),u=require("primereact/portal"),a=require("primereact/utils");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function p(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=p(e),f=l(t);function m(){return m=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},m.apply(this,arguments)}function d(e){if(Array.isArray(e))return e}function v(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c,i,u=[],a=!0,l=!1;try{if(c=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=c.call(r)).done)&&(u.push(n.value),u.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{if(!a&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return u}}function b(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 y(e,t){if(e){if("string"==typeof e)return b(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)?b(e,t):void 0}}function g(){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 O(e,t){return d(e)||v(e,t)||y(e,t)||g()}function j(e){return j="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},j(e)}function E(e,t){if("object"!==j(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function P(e){var t=E(e,"string");return"symbol"===j(t)?t:String(t)}var S=n.ComponentBase.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 t=e.context;return a.classNames("p-confirm-popup p-component",(0,e.getPropValue)("className"),{"p-input-filled":t&&"filled"===t.inputStyle||"filled"===f.default.inputStyle,"p-ripple-disabled":t&&!1===t.ripple||!1===f.default.ripple})},acceptButton:function(e){return a.classNames("p-confirm-popup-accept p-button-sm",(0,e.getPropValue)("acceptClassName"))},rejectButton:function(e){var t=e.getPropValue;return a.classNames("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'}}),h=function(e){var t=s.useRef(void 0);return s.useEffect((function(){t.current=e})),t.current},x=function(e,t,r){var n,o,c,i,u,l,p,f,m,d,v,b,y,g,j,E=(i=void 0===(c=(n={type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),r(e))}}).target)?"document":c,u=n.type,l=n.listener,p=n.options,m=void 0===(f=n.when)||f,d=s.useRef(null),v=s.useRef(null),b=h(l),y=h(p),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a.ObjectUtils.isNotEmpty(e.target)&&(j(),(e.when||m)&&(d.current=a.DomHandler.getTargetElement(e.target))),!v.current&&d.current&&(v.current=function(e){return l&&l(e)},d.current.addEventListener(u,v.current,p))},j=function(){v.current&&(d.current.removeEventListener(u,v.current,p),v.current=null)},s.useEffect((function(){m?d.current=a.DomHandler.getTargetElement(i):(j(),d.current=null)}),[i,m]),s.useEffect((function(){!v.current||""+b==""+l&&y===p||(j(),m&&g())}),[l,p,m]),o=function(){j()},s.useEffect((function(){return o}),[]),[g,j]),P=O(E,2),S=P[0],x=P[1];return s.useEffect((function(){if(t&&e.current)return S(),function(){x()}})),[e,r]};function w(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 N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){var n,o,c;n=e,c=r[t],(o=P(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)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var C=s.memo(s.forwardRef((function(e,l){var p=s.useContext(t.PrimeReactContext),d=S.getProps(e,p),v=O(s.useState(d.visible),2),b=v[0],y=v[1],g=O(s.useState(!1),2),j=g[0],E=g[1],P={props:d,state:{visible:b,reshow:j}},h=S.setMetaData(P),w=h.ptm,C=h.cx,I=h.isUnstyled;n.useHandleStyle(S.css.styles,I,{name:"confirmpopup"});var R=s.useRef(null),D=s.useRef(null),U=s.useRef(null),k=s.useRef(!1),H=s.useRef(null),B=s.useRef(null),L=s.useRef(null),T=s.useRef(!1),_=function(){return B.current||d},q=function(e){return(B.current||d)[e]},A=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 a.ObjectUtils.getPropValue(q(e),r)},V=q("acceptLabel")||t.localeOption("accept"),M=q("rejectLabel")||t.localeOption("reject");x(R,d.dismissable&&d.closeOnEscape,(function(e){$("hide")}));var J=O(c.useOverlayListener({target:q("target"),overlay:R,listener:function(e,t){t.valid&&("outside"===t.type?d.dismissable&&!k.current&&$("hide"):$("hide")),k.current=!1},when:b}),2),X=J[0],Z=J[1],z=function(){T.current||(T.current=!0,A("accept"),$("accept"))},K=function(){T.current||(T.current=!0,A("reject"),$("reject"))},Y=function(){var e=_();E(!1),e.group===d.group&&(y(!0),T.current=!1,H.current=function(e){!G(e.target)&&(k.current=!0)},i.OverlayService.on("overlay-click",H.current),L.current=document.activeElement)},$=function(e){y(!1),i.OverlayService.off("overlay-click",H.current),H.current=null,e&&A("onHide",e),a.DomHandler.focus(L.current),L.current=null},F=function(){if(q("target")){a.DomHandler.absolutePosition(R.current,q("target"));var e=a.DomHandler.getOffset(R.current),t=a.DomHandler.getOffset(q("target")),r=0;e.left<t.left&&(r=t.left-e.left),R.current.style.setProperty("--overlayArrowLeft","".concat(r,"px")),e.top<t.top&&!I()&&a.DomHandler.addClass(R.current,"p-confirm-popup-flipped")}},G=function(e){return R&&R.current&&!(R.current.isSameNode(e)||R.current.contains(e))},Q=function(e){if(e.tagKey===d.tagKey){var t=b!==e.visible;q("target")!==e.target&&!d.target?($(),B.current=e,E(!0)):t&&(B.current=e,e.visible?Y():$())}};s.useEffect((function(){d.visible?Y():$()}),[d.visible]),s.useEffect((function(){return d.target||d.message||i.OverlayService.on("confirm-popup",Q),function(){i.OverlayService.off("confirm-popup",Q)}}),[d.target]),c.useUpdateEffect((function(){j&&Y()}),[j]),c.useUnmountEffect((function(){H.current&&(i.OverlayService.off("overlay-click",H.current),H.current=null),i.OverlayService.off("confirm-popup",Q),a.ZIndexUtils.clear(R.current)})),s.useImperativeHandle(l,(function(){return{props:d,confirm:Q}}));var W,ee,te=function(){var e=a.classNames("p-confirm-popup-accept p-button-sm",q("acceptClassName")),t=a.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!q("rejectClassName")},q("rejectClassName")),n=a.mergeProps({className:C("footer")},w("footer")),o=a.mergeProps({ref:U,label:M,icon:q("rejectIcon"),className:C("rejectButton",{getPropValue:q}),onClick:K,pt:w("rejectButton"),unstyled:d.unstyled,__parentMetadata:{parent:P}}),c=a.mergeProps({ref:D,label:V,icon:q("acceptIcon"),className:C("acceptButton",{getPropValue:q}),onClick:z,pt:w("acceptButton"),unstyled:d.unstyled,__parentMetadata:{parent:P}}),i=s.createElement("div",n,s.createElement(r.Button,o),s.createElement(r.Button,c));if(q("footer")){var u={accept:z,reject:K,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:V,rejectLabel:M,element:i,props:_()};return a.ObjectUtils.getJSXElement(q("footer"),u)}return i},re=a.mergeProps({ref:R,id:q("id"),className:C("root",{context:p,getPropValue:q}),style:q("style"),onClick:function(e){k.current=!0,i.OverlayService.emit("overlay-click",{originalEvent:e,target:q("target")})}},S.getOtherProps(d),w("root")),ne=a.mergeProps({classNames:C("transition"),in:b,timeout:{enter:120,exit:100},options:q("transitionOptions"),unmountOnExit:!0,onEnter:function(){a.ZIndexUtils.set("overlay",R.current,p&&p.autoZIndex||f.default.autoZIndex,p&&p.zIndex.overlay||f.default.zIndex.overlay),a.DomHandler.addStyles(R.current,{position:"absolute",top:"50%",left:"50%",marginTop:"10px"}),F()},onEntered:function(){X(),D.current&&D.current.focus(),A("onShow")},onExit:function(){Z()},onExited:function(){a.ZIndexUtils.clear(R.current),k.current=!1}},w("transition")),oe=null!=e&&e.content?(W=_(),ee={message:a.ObjectUtils.getJSXElement(q("message"),W),acceptBtnRef:D,rejectBtnRef:U,hide:$},s.createElement(o.CSSTransition,m({nodeRef:R},ne),s.createElement("div",re,a.ObjectUtils.getJSXElement(e.content,ee)))):function(){var e,t,r,n,c,i,u=(e=_(),t=a.ObjectUtils.getJSXElement(q("message"),e),r=a.mergeProps({className:C("icon")},w("icon")),n=a.IconUtils.getJSXIcon(q("icon"),N({},r),{props:e}),c=a.mergeProps({className:C("message")},w("message")),i=a.mergeProps({className:C("content")},w("content")),s.createElement("div",i,n,s.createElement("span",c,t))),l=te();return s.createElement(o.CSSTransition,m({nodeRef:R},ne),s.createElement("div",re,u,l))}();return s.createElement(u.Portal,{element:oe,appendTo:q("appendTo"),visible:q("visible")})})));C.displayName="ConfirmPopup",exports.ConfirmPopup=C,exports.confirmPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=N(N({},e),{visible:void 0===e.visible||e.visible})).visible&&i.OverlayService.emit("confirm-popup",e);return{show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.OverlayService.emit("confirm-popup",N(N(N({},e),t),{visible:!0}))},hide:function(){i.OverlayService.emit("confirm-popup",{visible:!1})}}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),r=require("primereact/button"),n=require("primereact/componentbase"),o=require("primereact/csstransition"),c=require("primereact/hooks"),i=require("primereact/overlayservice"),a=require("primereact/portal"),l=require("primereact/utils");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function p(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=p(e),f=u(t);function m(){return m=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},m.apply(this,arguments)}function d(e){if(Array.isArray(e))return e}function v(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c,i,a=[],l=!0,u=!1;try{if(c=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=c.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return a}}function b(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 y(e,t){if(e){if("string"==typeof e)return b(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)?b(e,t):void 0}}function g(){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 O(e,t){return d(e)||v(e,t)||y(e,t)||g()}function j(e){return j="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},j(e)}function S(e,t){if("object"!==j(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function P(e){var t=S(e,"string");return"symbol"===j(t)?t:String(t)}var h=n.ComponentBase.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 t=e.context;return l.classNames("p-confirm-popup p-component",(0,e.getPropValue)("className"),{"p-input-filled":t&&"filled"===t.inputStyle||"filled"===f.default.inputStyle,"p-ripple-disabled":t&&!1===t.ripple||!1===f.default.ripple})},acceptButton:function(e){return l.classNames("p-confirm-popup-accept p-button-sm",(0,e.getPropValue)("acceptClassName"))},rejectButton:function(e){var t=e.getPropValue;return l.classNames("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 E(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 x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){var n,o,c;n=e,c=r[t],(o=P(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)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=s.memo(s.forwardRef((function(e,u){var p=s.useContext(t.PrimeReactContext),d=h.getProps(e,p),v=O(s.useState(d.visible),2),b=v[0],y=v[1],g=O(s.useState(!1),2),j=g[0],S=g[1],P={props:d,state:{visible:b,reshow:j}},E=h.setMetaData(P),N=E.ptm,w=E.cx,C=E.isUnstyled;n.useHandleStyle(h.css.styles,C,{name:"confirmpopup"});var I=s.useRef(null),R=s.useRef(null),D=s.useRef(null),U=s.useRef(!1),_=s.useRef(null),k=s.useRef(null),A=s.useRef(null),B=s.useRef(!1),H=function(){return k.current||d},L=function(e){return(k.current||d)[e]},T=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 l.ObjectUtils.getPropValue(L(e),r)},q=L("acceptLabel")||t.localeOption("accept"),V=L("rejectLabel")||t.localeOption("reject"),M=c.useDisplayOrder("dialog",b);c.useGlobalOnEscapeKey({callback:function(){d.dismissable&&d.closeOnEscape&&F("hide")},when:b,priority:[c.ESC_KEY_HANDLING_PRIORITIES.DIALOG,M]});var J=O(c.useOverlayListener({target:L("target"),overlay:I,listener:function(e,t){t.valid&&("outside"===t.type?d.dismissable&&!U.current&&F("hide"):F("hide")),U.current=!1},when:b}),2),K=J[0],X=J[1],Z=function(){B.current||(B.current=!0,T("accept"),F("accept"))},z=function(){B.current||(B.current=!0,T("reject"),F("reject"))},G=function(){var e=H();S(!1),e.group===d.group&&(y(!0),B.current=!1,_.current=function(e){!$(e.target)&&(U.current=!0)},i.OverlayService.on("overlay-click",_.current),A.current=document.activeElement)},F=function(e){y(!1),i.OverlayService.off("overlay-click",_.current),_.current=null,e&&T("onHide",e),l.DomHandler.focus(A.current),A.current=null},Y=function(){if(L("target")){l.DomHandler.absolutePosition(I.current,L("target"));var e=l.DomHandler.getOffset(I.current),t=l.DomHandler.getOffset(L("target")),r=0;e.left<t.left&&(r=t.left-e.left),I.current.style.setProperty("--overlayArrowLeft","".concat(r,"px")),e.top<t.top&&!C()&&l.DomHandler.addClass(I.current,"p-confirm-popup-flipped")}},$=function(e){return I&&I.current&&!(I.current.isSameNode(e)||I.current.contains(e))},Q=function(e){if(e.tagKey===d.tagKey){var t=b!==e.visible;L("target")!==e.target&&!d.target?(F(),k.current=e,S(!0)):t&&(k.current=e,e.visible?G():F())}};s.useEffect((function(){d.visible?G():F()}),[d.visible]),s.useEffect((function(){return d.target||d.message||i.OverlayService.on("confirm-popup",Q),function(){i.OverlayService.off("confirm-popup",Q)}}),[d.target]),c.useUpdateEffect((function(){j&&G()}),[j]),c.useUnmountEffect((function(){_.current&&(i.OverlayService.off("overlay-click",_.current),_.current=null),i.OverlayService.off("confirm-popup",Q),l.ZIndexUtils.clear(I.current)})),s.useImperativeHandle(u,(function(){return{props:d,confirm:Q}}));var W,ee,te=function(){var e=l.classNames("p-confirm-popup-accept p-button-sm",L("acceptClassName")),t=l.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!L("rejectClassName")},L("rejectClassName")),n=l.mergeProps({className:w("footer")},N("footer")),o=l.mergeProps({ref:D,label:V,icon:L("rejectIcon"),className:w("rejectButton",{getPropValue:L}),onClick:z,pt:N("rejectButton"),unstyled:d.unstyled,__parentMetadata:{parent:P}}),c=l.mergeProps({ref:R,label:q,icon:L("acceptIcon"),className:w("acceptButton",{getPropValue:L}),onClick:Z,pt:N("acceptButton"),unstyled:d.unstyled,__parentMetadata:{parent:P}}),i=s.createElement("div",n,s.createElement(r.Button,o),s.createElement(r.Button,c));if(L("footer")){var a={accept:Z,reject:z,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:q,rejectLabel:V,element:i,props:H()};return l.ObjectUtils.getJSXElement(L("footer"),a)}return i},re=l.mergeProps({ref:I,id:L("id"),className:w("root",{context:p,getPropValue:L}),style:L("style"),onClick:function(e){U.current=!0,i.OverlayService.emit("overlay-click",{originalEvent:e,target:L("target")})}},h.getOtherProps(d),N("root")),ne=l.mergeProps({classNames:w("transition"),in:b,timeout:{enter:120,exit:100},options:L("transitionOptions"),unmountOnExit:!0,onEnter:function(){l.ZIndexUtils.set("overlay",I.current,p&&p.autoZIndex||f.default.autoZIndex,p&&p.zIndex.overlay||f.default.zIndex.overlay),l.DomHandler.addStyles(I.current,{position:"absolute",top:"50%",left:"50%",marginTop:"10px"}),Y()},onEntered:function(){K();var e=L("defaultFocus");void 0!==e&&"accept"!==e||R.current&&R.current.focus(),"reject"===e&&D.current&&D.current.focus(),T("onShow")},onExit:function(){X()},onExited:function(){l.ZIndexUtils.clear(I.current),U.current=!1}},N("transition")),oe=null!=e&&e.content?(W=H(),ee={message:l.ObjectUtils.getJSXElement(L("message"),W),acceptBtnRef:R,rejectBtnRef:D,hide:F},s.createElement(o.CSSTransition,m({nodeRef:I},ne),s.createElement("div",re,l.ObjectUtils.getJSXElement(e.content,ee)))):function(){var e,t,r,n,c,i,a=(e=H(),t=l.ObjectUtils.getJSXElement(L("message"),e),r=l.mergeProps({className:w("icon")},N("icon")),n=l.IconUtils.getJSXIcon(L("icon"),x({},r),{props:e}),c=l.mergeProps({className:w("message")},N("message")),i=l.mergeProps({className:w("content")},N("content")),s.createElement("div",i,n,s.createElement("span",c,t))),u=te();return s.createElement(o.CSSTransition,m({nodeRef:I},ne),s.createElement("div",re,a,u))}();return s.createElement(a.Portal,{element:oe,appendTo:L("appendTo"),visible:L("visible")})})));N.displayName="ConfirmPopup",exports.ConfirmPopup=N,exports.confirmPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=x(x({},e),{visible:void 0===e.visible||e.visible})).visible&&i.OverlayService.emit("confirm-popup",e);return{show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.OverlayService.emit("confirm-popup",x(x(x({},e),t),{visible:!0}))},hide:function(){i.OverlayService.emit("confirm-popup",{visible:!1})}}};
|
|
@@ -122,6 +122,11 @@ interface ConfirmPopupOptions {
|
|
|
122
122
|
* @defaultValue No
|
|
123
123
|
*/
|
|
124
124
|
rejectLabel: string;
|
|
125
|
+
/**
|
|
126
|
+
* Element to receive the focus when the dialog gets visible, valid values are "accept" and "reject".
|
|
127
|
+
* @defaultValue accept
|
|
128
|
+
*/
|
|
129
|
+
defaultFocus: string;
|
|
125
130
|
/**
|
|
126
131
|
* Default element created by the component.
|
|
127
132
|
*/
|
|
@@ -178,6 +183,11 @@ export interface ConfirmPopupProps {
|
|
|
178
183
|
* @defaultValue false
|
|
179
184
|
*/
|
|
180
185
|
visible?: boolean | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Element to receive the focus when the dialog gets visible, valid values are "accept" and "reject".
|
|
188
|
+
* @defaultValue accept
|
|
189
|
+
*/
|
|
190
|
+
defaultFocus?: string | undefined;
|
|
181
191
|
/**
|
|
182
192
|
* Message of the confirmation.
|
|
183
193
|
*/
|
|
@@ -224,7 +234,7 @@ export interface ConfirmPopupProps {
|
|
|
224
234
|
* DOM element instance where the overlay panel should be mounted. Valid values are any DOM Element and 'self'. The self value is used to render a component where it is located.
|
|
225
235
|
* @defaultValue document.body
|
|
226
236
|
*/
|
|
227
|
-
appendTo?: 'self' | HTMLElement | undefined | null;
|
|
237
|
+
appendTo?: 'self' | HTMLElement | undefined | null | (() => HTMLElement);
|
|
228
238
|
/**
|
|
229
239
|
* Enables to hide the popup when outside is clicked.
|
|
230
240
|
* @defaultValue true
|
|
@@ -284,7 +294,7 @@ export interface ConfirmPopupProps {
|
|
|
284
294
|
* @param {ContentProps} props - The values of dialog.
|
|
285
295
|
* @return {React.ReactNode}
|
|
286
296
|
*/
|
|
287
|
-
content
|
|
297
|
+
content?: React.ReactNode | ((props: ContentProps) => React.ReactNode);
|
|
288
298
|
}
|
|
289
299
|
|
|
290
300
|
/**
|