primereact 10.2.1 → 10.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.cjs.js +83 -8
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +35 -0
- package/accordion/accordion.esm.js +85 -10
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +83 -8
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +63 -33
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +24 -246
- package/api/api.esm.js +63 -33
- package/api/api.esm.min.js +1 -1
- package/api/api.js +63 -33
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +3 -2
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +6 -1
- package/autocomplete/autocomplete.esm.js +3 -2
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +3 -2
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/blockui.cjs.js +8 -5
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +8 -5
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +8 -5
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +12 -6
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +12 -6
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +12 -6
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/calendar/calendar.cjs.js +71 -37
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +3 -5
- package/calendar/calendar.esm.js +71 -37
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +71 -37
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +103 -9
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +104 -10
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +103 -9
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +64 -23
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +27 -4
- package/cascadeselect/cascadeselect.esm.js +65 -24
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +65 -25
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/checkbox.cjs.js +25 -25
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +25 -25
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +26 -26
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +5 -2
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +17 -2
- package/chip/chip.esm.js +5 -2
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +5 -2
- package/chip/chip.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +1 -1
- package/componentbase/componentbase.cjs.js +49 -8
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +50 -9
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +49 -8
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +30 -22
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +19 -3
- package/confirmdialog/confirmdialog.esm.js +30 -22
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +30 -22
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +85 -152
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +40 -1
- package/confirmpopup/confirmpopup.esm.js +88 -155
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +85 -152
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +641 -99
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +23 -1
- package/contextmenu/contextmenu.esm.js +641 -99
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +641 -99
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +1217 -484
- package/core/core.min.js +40 -40
- package/datatable/datatable.cjs.js +30 -26
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +5 -4
- package/datatable/datatable.esm.js +30 -26
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +30 -26
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.d.ts +1 -1
- package/dialog/dialog.cjs.js +108 -151
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +60 -1
- package/dialog/dialog.esm.js +115 -158
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +109 -152
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +1 -0
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +1 -0
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +1 -0
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +169 -33
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +15 -0
- package/dock/dock.esm.js +170 -34
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +169 -33
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +29 -4
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +1 -1
- package/dropdown/dropdown.esm.js +29 -4
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +30 -6
- package/dropdown/dropdown.min.js +1 -1
- package/fieldset/fieldset.cjs.js +12 -5
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +12 -5
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +12 -5
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +14 -6
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +17 -1
- package/fileupload/fileupload.esm.js +14 -6
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +14 -6
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +223 -43
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +225 -45
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +223 -43
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +219 -78
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +8 -4
- package/hooks/hooks.esm.js +219 -80
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +219 -78
- package/hooks/hooks.min.js +1 -1
- package/icons/arrowdown/index.cjs.js +13 -2
- package/icons/arrowdown/index.cjs.min.js +1 -1
- package/icons/arrowdown/index.esm.js +13 -2
- package/icons/arrowdown/index.esm.min.js +1 -1
- package/icons/arrowdown/index.js +13 -2
- package/icons/arrowdown/index.min.js +1 -1
- package/icons/arrowup/index.cjs.js +13 -2
- package/icons/arrowup/index.cjs.min.js +1 -1
- package/icons/arrowup/index.esm.js +13 -2
- package/icons/arrowup/index.esm.min.js +1 -1
- package/icons/arrowup/index.js +13 -2
- package/icons/arrowup/index.min.js +1 -1
- package/icons/ban/index.cjs.js +13 -2
- package/icons/ban/index.cjs.min.js +1 -1
- package/icons/ban/index.esm.js +13 -2
- package/icons/ban/index.esm.min.js +1 -1
- package/icons/ban/index.js +13 -2
- package/icons/ban/index.min.js +1 -1
- package/icons/download/index.cjs.js +13 -2
- package/icons/download/index.cjs.min.js +1 -1
- package/icons/download/index.esm.js +13 -2
- package/icons/download/index.esm.min.js +1 -1
- package/icons/download/index.js +13 -2
- package/icons/download/index.min.js +1 -1
- package/icons/exclamationtriangle/index.cjs.js +13 -2
- package/icons/exclamationtriangle/index.cjs.min.js +1 -1
- package/icons/exclamationtriangle/index.esm.js +13 -2
- package/icons/exclamationtriangle/index.esm.min.js +1 -1
- package/icons/exclamationtriangle/index.js +13 -2
- package/icons/exclamationtriangle/index.min.js +1 -1
- package/icons/eyeslash/index.cjs.js +13 -2
- package/icons/eyeslash/index.cjs.min.js +1 -1
- package/icons/eyeslash/index.esm.js +13 -2
- package/icons/eyeslash/index.esm.min.js +1 -1
- package/icons/eyeslash/index.js +13 -2
- package/icons/eyeslash/index.min.js +1 -1
- package/icons/filter/index.cjs.js +13 -2
- package/icons/filter/index.cjs.min.js +1 -1
- package/icons/filter/index.esm.js +13 -2
- package/icons/filter/index.esm.min.js +1 -1
- package/icons/filter/index.js +13 -2
- package/icons/filter/index.min.js +1 -1
- package/icons/filterslash/index.cjs.js +13 -2
- package/icons/filterslash/index.cjs.min.js +1 -1
- package/icons/filterslash/index.esm.js +13 -2
- package/icons/filterslash/index.esm.min.js +1 -1
- package/icons/filterslash/index.js +13 -2
- package/icons/filterslash/index.min.js +1 -1
- package/icons/infocircle/index.cjs.js +13 -2
- package/icons/infocircle/index.cjs.min.js +1 -1
- package/icons/infocircle/index.esm.js +13 -2
- package/icons/infocircle/index.esm.min.js +1 -1
- package/icons/infocircle/index.js +13 -2
- package/icons/infocircle/index.min.js +1 -1
- package/icons/pencil/index.cjs.js +13 -2
- package/icons/pencil/index.cjs.min.js +1 -1
- package/icons/pencil/index.esm.js +13 -2
- package/icons/pencil/index.esm.min.js +1 -1
- package/icons/pencil/index.js +13 -2
- package/icons/pencil/index.min.js +1 -1
- package/icons/plus/index.cjs.js +13 -2
- package/icons/plus/index.cjs.min.js +1 -1
- package/icons/plus/index.esm.js +13 -2
- package/icons/plus/index.esm.min.js +1 -1
- package/icons/plus/index.js +13 -2
- package/icons/plus/index.min.js +1 -1
- package/icons/refresh/index.cjs.js +13 -2
- package/icons/refresh/index.cjs.min.js +1 -1
- package/icons/refresh/index.esm.js +13 -2
- package/icons/refresh/index.esm.min.js +1 -1
- package/icons/refresh/index.js +13 -2
- package/icons/refresh/index.min.js +1 -1
- package/icons/search/index.cjs.js +13 -2
- package/icons/search/index.cjs.min.js +1 -1
- package/icons/search/index.esm.js +13 -2
- package/icons/search/index.esm.min.js +1 -1
- package/icons/search/index.js +13 -2
- package/icons/search/index.min.js +1 -1
- package/icons/searchminus/index.cjs.js +13 -2
- package/icons/searchminus/index.cjs.min.js +1 -1
- package/icons/searchminus/index.esm.js +13 -2
- package/icons/searchminus/index.esm.min.js +1 -1
- package/icons/searchminus/index.js +13 -2
- package/icons/searchminus/index.min.js +1 -1
- package/icons/searchplus/index.cjs.js +13 -2
- package/icons/searchplus/index.cjs.min.js +1 -1
- package/icons/searchplus/index.esm.js +13 -2
- package/icons/searchplus/index.esm.min.js +1 -1
- package/icons/searchplus/index.js +13 -2
- package/icons/searchplus/index.min.js +1 -1
- package/icons/sortalt/index.cjs.js +13 -2
- package/icons/sortalt/index.cjs.min.js +1 -1
- package/icons/sortalt/index.esm.js +13 -2
- package/icons/sortalt/index.esm.min.js +1 -1
- package/icons/sortalt/index.js +13 -2
- package/icons/sortalt/index.min.js +1 -1
- package/icons/sortamountdown/index.cjs.js +13 -2
- package/icons/sortamountdown/index.cjs.min.js +1 -1
- package/icons/sortamountdown/index.esm.js +13 -2
- package/icons/sortamountdown/index.esm.min.js +1 -1
- package/icons/sortamountdown/index.js +13 -2
- package/icons/sortamountdown/index.min.js +1 -1
- package/icons/sortamountupalt/index.cjs.js +13 -2
- package/icons/sortamountupalt/index.cjs.min.js +1 -1
- package/icons/sortamountupalt/index.esm.js +13 -2
- package/icons/sortamountupalt/index.esm.min.js +1 -1
- package/icons/sortamountupalt/index.js +13 -2
- package/icons/sortamountupalt/index.min.js +1 -1
- package/icons/spinner/index.cjs.js +13 -2
- package/icons/spinner/index.cjs.min.js +1 -1
- package/icons/spinner/index.esm.js +13 -2
- package/icons/spinner/index.esm.min.js +1 -1
- package/icons/spinner/index.js +13 -2
- package/icons/spinner/index.min.js +1 -1
- package/icons/star/index.cjs.js +13 -2
- package/icons/star/index.cjs.min.js +1 -1
- package/icons/star/index.esm.js +13 -2
- package/icons/star/index.esm.min.js +1 -1
- package/icons/star/index.js +13 -2
- package/icons/star/index.min.js +1 -1
- package/icons/starfill/index.cjs.js +13 -2
- package/icons/starfill/index.cjs.min.js +1 -1
- package/icons/starfill/index.esm.js +13 -2
- package/icons/starfill/index.esm.min.js +1 -1
- package/icons/starfill/index.js +13 -2
- package/icons/starfill/index.min.js +1 -1
- package/icons/thlarge/index.cjs.js +13 -2
- package/icons/thlarge/index.cjs.min.js +1 -1
- package/icons/thlarge/index.esm.js +13 -2
- package/icons/thlarge/index.esm.min.js +1 -1
- package/icons/thlarge/index.js +13 -2
- package/icons/thlarge/index.min.js +1 -1
- package/icons/timescircle/index.cjs.js +13 -2
- package/icons/timescircle/index.cjs.min.js +1 -1
- package/icons/timescircle/index.esm.js +13 -2
- package/icons/timescircle/index.esm.min.js +1 -1
- package/icons/timescircle/index.js +13 -2
- package/icons/timescircle/index.min.js +1 -1
- package/icons/trash/index.cjs.js +13 -2
- package/icons/trash/index.cjs.min.js +1 -1
- package/icons/trash/index.esm.js +13 -2
- package/icons/trash/index.esm.min.js +1 -1
- package/icons/trash/index.js +13 -2
- package/icons/trash/index.min.js +1 -1
- package/icons/undo/index.cjs.js +13 -2
- package/icons/undo/index.cjs.min.js +1 -1
- package/icons/undo/index.esm.js +13 -2
- package/icons/undo/index.esm.min.js +1 -1
- package/icons/undo/index.js +13 -2
- package/icons/undo/index.min.js +1 -1
- package/icons/upload/index.cjs.js +13 -2
- package/icons/upload/index.cjs.min.js +1 -1
- package/icons/upload/index.esm.js +13 -2
- package/icons/upload/index.esm.min.js +1 -1
- package/icons/upload/index.js +13 -2
- package/icons/upload/index.min.js +1 -1
- package/icons/windowmaximize/index.cjs.js +13 -2
- package/icons/windowmaximize/index.cjs.min.js +1 -1
- package/icons/windowmaximize/index.esm.js +13 -2
- package/icons/windowmaximize/index.esm.min.js +1 -1
- package/icons/windowmaximize/index.js +13 -2
- package/icons/windowmaximize/index.min.js +1 -1
- package/icons/windowminimize/index.cjs.js +13 -2
- package/icons/windowminimize/index.cjs.min.js +1 -1
- package/icons/windowminimize/index.esm.js +13 -2
- package/icons/windowminimize/index.esm.min.js +1 -1
- package/icons/windowminimize/index.js +13 -2
- package/icons/windowminimize/index.min.js +1 -1
- package/image/image.cjs.js +85 -119
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +87 -121
- package/image/image.esm.min.js +1 -1
- package/image/image.js +86 -120
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +7 -0
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +7 -0
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +8 -2
- package/inplace/inplace.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +63 -19
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +7 -0
- package/inputnumber/inputnumber.esm.js +63 -19
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +63 -19
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +3 -3
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +3 -3
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +3 -3
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +7 -6
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +7 -6
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +7 -6
- package/inputtext/inputtext.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -1
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +8 -3
- package/listbox/listbox.esm.js +14 -1
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +14 -1
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +799 -179
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.d.ts +14 -0
- package/megamenu/megamenu.esm.js +801 -181
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +799 -179
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +7 -9
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +7 -9
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +7 -9
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +217 -166
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +15 -1
- package/menu/menu.esm.js +220 -169
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +217 -166
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +714 -179
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.d.ts +18 -0
- package/menubar/menubar.esm.js +717 -182
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +714 -179
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +2 -1
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +2 -1
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -1
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +5 -3
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +5 -3
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +5 -3
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +58 -35
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -1
- package/multiselect/multiselect.esm.js +58 -35
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +59 -37
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/orderlist.cjs.js +260 -105
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +18 -0
- package/orderlist/orderlist.esm.js +261 -106
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +260 -105
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +10 -0
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +10 -0
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +10 -0
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +9 -102
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +1 -1
- package/overlaypanel/overlaypanel.esm.js +11 -104
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +10 -103
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.d.ts +2 -2
- package/panel/panel.cjs.js +22 -19
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +22 -19
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +22 -19
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +774 -195
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +15 -0
- package/panelmenu/panelmenu.esm.js +775 -196
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +774 -195
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +163 -159
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +163 -159
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +163 -159
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +7 -2
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +1 -1
- package/password/password.esm.js +8 -3
- package/password/password.esm.min.js +1 -1
- package/password/password.js +7 -2
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +709 -181
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.d.ts +10 -0
- package/picklist/picklist.esm.js +708 -180
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +709 -181
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +7 -1
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +7 -1
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +7 -1
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +8352 -3145
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +8351 -3146
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +8352 -3145
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +27 -26
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +27 -26
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +28 -27
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +854 -790
- package/resources/themes/arya-green/theme.css +854 -790
- package/resources/themes/arya-orange/theme.css +854 -790
- package/resources/themes/arya-purple/theme.css +854 -790
- package/resources/themes/bootstrap4-dark-blue/theme.css +678 -615
- package/resources/themes/bootstrap4-dark-purple/theme.css +678 -615
- package/resources/themes/bootstrap4-light-blue/theme.css +679 -616
- package/resources/themes/bootstrap4-light-purple/theme.css +679 -616
- package/resources/themes/fluent-light/theme.css +686 -638
- package/resources/themes/lara-dark-amber/theme.css +679 -630
- package/resources/themes/lara-dark-blue/theme.css +679 -630
- package/resources/themes/lara-dark-cyan/theme.css +679 -630
- package/resources/themes/lara-dark-green/theme.css +679 -630
- package/resources/themes/lara-dark-indigo/theme.css +679 -630
- package/resources/themes/lara-dark-pink/theme.css +679 -630
- package/resources/themes/lara-dark-purple/theme.css +679 -630
- package/resources/themes/lara-dark-teal/theme.css +679 -630
- package/resources/themes/lara-light-amber/theme.css +776 -725
- package/resources/themes/lara-light-blue/theme.css +1011 -960
- package/resources/themes/lara-light-cyan/theme.css +776 -725
- package/resources/themes/lara-light-green/theme.css +820 -769
- package/resources/themes/lara-light-indigo/theme.css +1016 -965
- package/resources/themes/lara-light-pink/theme.css +776 -725
- package/resources/themes/lara-light-purple/theme.css +1016 -965
- package/resources/themes/lara-light-teal/theme.css +776 -725
- package/resources/themes/luna-amber/theme.css +950 -887
- package/resources/themes/luna-blue/theme.css +950 -887
- package/resources/themes/luna-green/theme.css +950 -887
- package/resources/themes/luna-pink/theme.css +950 -887
- package/resources/themes/md-dark-deeppurple/theme.css +918 -950
- package/resources/themes/md-dark-indigo/theme.css +918 -950
- package/resources/themes/md-light-deeppurple/theme.css +878 -910
- package/resources/themes/md-light-indigo/theme.css +878 -910
- package/resources/themes/mdc-dark-deeppurple/theme.css +918 -950
- package/resources/themes/mdc-dark-indigo/theme.css +918 -950
- package/resources/themes/mdc-light-deeppurple/theme.css +878 -910
- package/resources/themes/mdc-light-indigo/theme.css +878 -910
- package/resources/themes/mira/theme.css +1562 -1532
- package/resources/themes/nano/theme.css +707 -641
- package/resources/themes/nova/theme.css +705 -643
- package/resources/themes/nova-accent/theme.css +701 -636
- package/resources/themes/nova-alt/theme.css +705 -643
- package/resources/themes/rhea/theme.css +876 -811
- package/resources/themes/saga-blue/theme.css +896 -832
- package/resources/themes/saga-green/theme.css +896 -832
- package/resources/themes/saga-orange/theme.css +896 -832
- package/resources/themes/saga-purple/theme.css +896 -832
- package/resources/themes/soho-dark/theme.css +701 -643
- package/resources/themes/soho-light/theme.css +690 -634
- package/resources/themes/tailwind-light/theme.css +1370 -1306
- package/resources/themes/vela-blue/theme.css +862 -798
- package/resources/themes/vela-green/theme.css +862 -798
- package/resources/themes/vela-orange/theme.css +862 -798
- package/resources/themes/vela-purple/theme.css +862 -798
- package/resources/themes/viva-dark/theme.css +655 -612
- package/resources/themes/viva-light/theme.css +737 -694
- package/ripple/ripple.cjs.js +71 -5
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +71 -5
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +71 -5
- package/ripple/ripple.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +183 -3
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +184 -4
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +183 -3
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/sidebar/sidebar.cjs.js +62 -146
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +25 -3
- package/sidebar/sidebar.esm.js +65 -149
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +63 -147
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +7 -100
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +1 -1
- package/slidemenu/slidemenu.esm.js +10 -103
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +7 -100
- package/slidemenu/slidemenu.min.js +1 -1
- package/speeddial/speeddial.cjs.js +275 -32
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +277 -34
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +275 -32
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +1098 -309
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +5 -5
- package/splitbutton/splitbutton.esm.js +1100 -311
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +1096 -309
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +103 -15
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.d.ts +5 -0
- package/splitter/splitter.esm.js +103 -15
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +103 -15
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +99 -13
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +100 -14
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +99 -13
- package/steps/steps.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +113 -17
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +113 -17
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +113 -17
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +128 -20
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +35 -0
- package/tabview/tabview.esm.js +128 -20
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +128 -20
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +753 -275
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +11 -1
- package/tieredmenu/tieredmenu.esm.js +755 -277
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +753 -275
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/toast.cjs.js +6 -1
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +36 -2
- package/toast/toast.esm.js +6 -1
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +6 -1
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +74 -4
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +74 -4
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +75 -5
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.d.ts +27 -0
- package/tooltip/tooltipoptions.d.ts +1 -1
- package/tree/tree.cjs.js +198 -88
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +8 -0
- package/tree/tree.esm.js +199 -89
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +198 -88
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +185 -49
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +26 -1
- package/treeselect/treeselect.esm.js +186 -50
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +186 -51
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +59 -53
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +3 -3
- package/treetable/treetable.esm.js +59 -53
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +59 -53
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +19 -5
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +1 -1
- package/utils/utils.esm.js +19 -5
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +19 -5
- package/utils/utils.min.js +1 -1
- package/web-types.json +402 -33
package/dialog/dialog.esm.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { DomHandler, ObjectUtils, classNames, UniqueComponentId, ZIndexUtils, mergeProps, IconUtils } from 'primereact/utils';
|
|
4
3
|
import PrimeReact, { PrimeReactContext, localeOption } from 'primereact/api';
|
|
5
4
|
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
6
5
|
import { CSSTransition } from 'primereact/csstransition';
|
|
7
|
-
import {
|
|
6
|
+
import { useDisplayOrder, useGlobalOnEscapeKey, ESC_KEY_HANDLING_PRIORITIES, useEventListener, useMountEffect, useUpdateEffect, useUnmountEffect } from 'primereact/hooks';
|
|
8
7
|
import { TimesIcon } from 'primereact/icons/times';
|
|
9
8
|
import { WindowMaximizeIcon } from 'primereact/icons/windowmaximize';
|
|
10
9
|
import { WindowMinimizeIcon } from 'primereact/icons/windowminimize';
|
|
11
10
|
import { Portal } from 'primereact/portal';
|
|
12
11
|
import { Ripple } from 'primereact/ripple';
|
|
12
|
+
import { classNames, UniqueComponentId, DomHandler, ZIndexUtils, mergeProps, ObjectUtils, IconUtils } from 'primereact/utils';
|
|
13
13
|
|
|
14
14
|
function _extends() {
|
|
15
15
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -26,6 +26,16 @@ function _extends() {
|
|
|
26
26
|
return _extends.apply(this, arguments);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
function _typeof(o) {
|
|
30
|
+
"@babel/helpers - typeof";
|
|
31
|
+
|
|
32
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
33
|
+
return typeof o;
|
|
34
|
+
} : function (o) {
|
|
35
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
36
|
+
}, _typeof(o);
|
|
37
|
+
}
|
|
38
|
+
|
|
29
39
|
function _arrayLikeToArray(arr, len) {
|
|
30
40
|
if (len == null || len > arr.length) len = arr.length;
|
|
31
41
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
@@ -57,16 +67,6 @@ function _toConsumableArray(arr) {
|
|
|
57
67
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
58
68
|
}
|
|
59
69
|
|
|
60
|
-
function _typeof(o) {
|
|
61
|
-
"@babel/helpers - typeof";
|
|
62
|
-
|
|
63
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
64
|
-
return typeof o;
|
|
65
|
-
} : function (o) {
|
|
66
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
67
|
-
}, _typeof(o);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
70
|
function _toPrimitive(input, hint) {
|
|
71
71
|
if (_typeof(input) !== "object" || input === null) return input;
|
|
72
72
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -138,104 +138,6 @@ function _slicedToArray(arr, i) {
|
|
|
138
138
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
var usePrevious = function usePrevious(newValue) {
|
|
142
|
-
var ref = React.useRef(undefined);
|
|
143
|
-
React.useEffect(function () {
|
|
144
|
-
ref.current = newValue;
|
|
145
|
-
});
|
|
146
|
-
return ref.current;
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
/* eslint-disable */
|
|
150
|
-
var useUnmountEffect = function useUnmountEffect(fn) {
|
|
151
|
-
return React.useEffect(function () {
|
|
152
|
-
return fn;
|
|
153
|
-
}, []);
|
|
154
|
-
};
|
|
155
|
-
/* eslint-enable */
|
|
156
|
-
|
|
157
|
-
/* eslint-disable */
|
|
158
|
-
var useEventListener = function useEventListener(_ref) {
|
|
159
|
-
var _ref$target = _ref.target,
|
|
160
|
-
target = _ref$target === void 0 ? 'document' : _ref$target,
|
|
161
|
-
type = _ref.type,
|
|
162
|
-
listener = _ref.listener,
|
|
163
|
-
options = _ref.options,
|
|
164
|
-
_ref$when = _ref.when,
|
|
165
|
-
when = _ref$when === void 0 ? true : _ref$when;
|
|
166
|
-
var targetRef = React.useRef(null);
|
|
167
|
-
var listenerRef = React.useRef(null);
|
|
168
|
-
var prevOptions = usePrevious(options);
|
|
169
|
-
var bind = function bind() {
|
|
170
|
-
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
171
|
-
if (ObjectUtils.isNotEmpty(bindOptions.target)) {
|
|
172
|
-
unbind();
|
|
173
|
-
(bindOptions.when || when) && (targetRef.current = DomHandler.getTargetElement(bindOptions.target));
|
|
174
|
-
}
|
|
175
|
-
if (!listenerRef.current && targetRef.current) {
|
|
176
|
-
listenerRef.current = function (event) {
|
|
177
|
-
return listener && listener(event);
|
|
178
|
-
};
|
|
179
|
-
targetRef.current.addEventListener(type, listenerRef.current, options);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
var unbind = function unbind() {
|
|
183
|
-
if (listenerRef.current) {
|
|
184
|
-
targetRef.current.removeEventListener(type, listenerRef.current, options);
|
|
185
|
-
listenerRef.current = null;
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
React.useEffect(function () {
|
|
189
|
-
if (when) {
|
|
190
|
-
targetRef.current = DomHandler.getTargetElement(target);
|
|
191
|
-
} else {
|
|
192
|
-
unbind();
|
|
193
|
-
targetRef.current = null;
|
|
194
|
-
}
|
|
195
|
-
}, [target, when]);
|
|
196
|
-
React.useEffect(function () {
|
|
197
|
-
if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {
|
|
198
|
-
unbind();
|
|
199
|
-
when && bind();
|
|
200
|
-
}
|
|
201
|
-
}, [listener, options]);
|
|
202
|
-
useUnmountEffect(function () {
|
|
203
|
-
unbind();
|
|
204
|
-
});
|
|
205
|
-
return [bind, unbind];
|
|
206
|
-
};
|
|
207
|
-
/* eslint-enable */
|
|
208
|
-
|
|
209
|
-
var useOnEscapeKey = function useOnEscapeKey(ref, condition, callback) {
|
|
210
|
-
var handleEsc = function handleEsc(event) {
|
|
211
|
-
if (event.key === 'Esc' || event.key === 'Escape') {
|
|
212
|
-
event.stopImmediatePropagation();
|
|
213
|
-
callback(event);
|
|
214
|
-
}
|
|
215
|
-
return;
|
|
216
|
-
};
|
|
217
|
-
var _useEventListener = useEventListener({
|
|
218
|
-
type: 'keydown',
|
|
219
|
-
listener: handleEsc
|
|
220
|
-
}),
|
|
221
|
-
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
222
|
-
bindKeyDownListener = _useEventListener2[0],
|
|
223
|
-
unbindKeyDownListener = _useEventListener2[1];
|
|
224
|
-
React.useEffect(function () {
|
|
225
|
-
if (!condition) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
if (!ref.current) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
bindKeyDownListener();
|
|
232
|
-
return function () {
|
|
233
|
-
unbindKeyDownListener();
|
|
234
|
-
};
|
|
235
|
-
});
|
|
236
|
-
return [ref, callback];
|
|
237
|
-
};
|
|
238
|
-
|
|
239
141
|
function ownKeys$1(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; }
|
|
240
142
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
241
143
|
var classes = {
|
|
@@ -253,10 +155,13 @@ var classes = {
|
|
|
253
155
|
var props = _ref2.props;
|
|
254
156
|
return classNames('p-dialog-content', props.contentClassName);
|
|
255
157
|
},
|
|
256
|
-
footer:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
158
|
+
footer: function footer(_ref3) {
|
|
159
|
+
var props = _ref3.props;
|
|
160
|
+
return classNames('p-dialog-footer', props.footerClassName);
|
|
161
|
+
},
|
|
162
|
+
mask: function mask(_ref4) {
|
|
163
|
+
var props = _ref4.props,
|
|
164
|
+
maskVisibleState = _ref4.maskVisibleState;
|
|
260
165
|
var positions = ['center', 'left', 'right', 'top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right'];
|
|
261
166
|
var pos = positions.find(function (item) {
|
|
262
167
|
return item === props.position || item.replace('-', '') === props.position;
|
|
@@ -268,10 +173,10 @@ var classes = {
|
|
|
268
173
|
'p-dialog-resizable': props.resizable
|
|
269
174
|
}, props.maskClassName);
|
|
270
175
|
},
|
|
271
|
-
root: function root(
|
|
272
|
-
var props =
|
|
273
|
-
maximized =
|
|
274
|
-
context =
|
|
176
|
+
root: function root(_ref5) {
|
|
177
|
+
var props = _ref5.props,
|
|
178
|
+
maximized = _ref5.maximized,
|
|
179
|
+
context = _ref5.context;
|
|
275
180
|
return classNames('p-dialog p-component', props.className, {
|
|
276
181
|
'p-dialog-rtl': props.rtl,
|
|
277
182
|
'p-dialog-maximized': maximized,
|
|
@@ -282,10 +187,10 @@ var classes = {
|
|
|
282
187
|
},
|
|
283
188
|
transition: 'p-dialog'
|
|
284
189
|
};
|
|
285
|
-
var styles = "\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n";
|
|
190
|
+
var styles = "\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n";
|
|
286
191
|
var inlineStyles = {
|
|
287
|
-
mask: function mask(
|
|
288
|
-
var props =
|
|
192
|
+
mask: function mask(_ref6) {
|
|
193
|
+
var props = _ref6.props;
|
|
289
194
|
return _objectSpread$1({
|
|
290
195
|
position: 'fixed',
|
|
291
196
|
height: '100%',
|
|
@@ -318,6 +223,7 @@ var DialogBase = ComponentBase.extend({
|
|
|
318
223
|
draggable: true,
|
|
319
224
|
focusOnShow: true,
|
|
320
225
|
footer: null,
|
|
226
|
+
footerClassName: null,
|
|
321
227
|
header: null,
|
|
322
228
|
headerClassName: null,
|
|
323
229
|
headerStyle: null,
|
|
@@ -398,6 +304,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
398
304
|
var focusElementOnHide = React.useRef(null);
|
|
399
305
|
var maximized = props.onMaximize ? props.maximized : maximizedState;
|
|
400
306
|
var shouldBlockScroll = visibleState && (props.blockScroll || props.maximizable && maximized);
|
|
307
|
+
var displayOrder = useDisplayOrder('dialog', visibleState);
|
|
401
308
|
var _DialogBase$setMetaDa = DialogBase.setMetaData(_objectSpread(_objectSpread({
|
|
402
309
|
props: props
|
|
403
310
|
}, props.__parentMetadata), {}, {
|
|
@@ -414,17 +321,16 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
414
321
|
useHandleStyle(DialogBase.css.styles, isUnstyled, {
|
|
415
322
|
name: 'dialog'
|
|
416
323
|
});
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
params.splice(paramLength - 1, 1);
|
|
324
|
+
useGlobalOnEscapeKey({
|
|
325
|
+
callback: function callback(event) {
|
|
326
|
+
if (props.closable && props.closeOnEscape) {
|
|
327
|
+
onClose(event);
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
when: visibleState,
|
|
331
|
+
priority: [ESC_KEY_HANDLING_PRIORITIES.DIALOG, displayOrder]
|
|
426
332
|
});
|
|
427
|
-
var _useEventListener = useEventListener
|
|
333
|
+
var _useEventListener = useEventListener({
|
|
428
334
|
type: 'keydown',
|
|
429
335
|
listener: function listener(event) {
|
|
430
336
|
return onKeyDown(event);
|
|
@@ -433,7 +339,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
433
339
|
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
434
340
|
bindDocumentKeyDownListener = _useEventListener2[0],
|
|
435
341
|
unbindDocumentKeyDownListener = _useEventListener2[1];
|
|
436
|
-
var _useEventListener3 = useEventListener
|
|
342
|
+
var _useEventListener3 = useEventListener({
|
|
437
343
|
type: 'mousemove',
|
|
438
344
|
target: function target() {
|
|
439
345
|
return window.document;
|
|
@@ -445,7 +351,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
445
351
|
_useEventListener4 = _slicedToArray(_useEventListener3, 2),
|
|
446
352
|
bindDocumentResizeListener = _useEventListener4[0],
|
|
447
353
|
unbindDocumentResizeListener = _useEventListener4[1];
|
|
448
|
-
var _useEventListener5 = useEventListener
|
|
354
|
+
var _useEventListener5 = useEventListener({
|
|
449
355
|
type: 'mouseup',
|
|
450
356
|
target: function target() {
|
|
451
357
|
return window.document;
|
|
@@ -457,7 +363,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
457
363
|
_useEventListener6 = _slicedToArray(_useEventListener5, 2),
|
|
458
364
|
bindDocumentResizeEndListener = _useEventListener6[0],
|
|
459
365
|
unbindDocumentResizEndListener = _useEventListener6[1];
|
|
460
|
-
var _useEventListener7 = useEventListener
|
|
366
|
+
var _useEventListener7 = useEventListener({
|
|
461
367
|
type: 'mousemove',
|
|
462
368
|
target: function target() {
|
|
463
369
|
return window.document;
|
|
@@ -469,7 +375,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
469
375
|
_useEventListener8 = _slicedToArray(_useEventListener7, 2),
|
|
470
376
|
bindDocumentDragListener = _useEventListener8[0],
|
|
471
377
|
unbindDocumentDragListener = _useEventListener8[1];
|
|
472
|
-
var _useEventListener9 = useEventListener
|
|
378
|
+
var _useEventListener9 = useEventListener({
|
|
473
379
|
type: 'mouseup',
|
|
474
380
|
target: function target() {
|
|
475
381
|
return window.document;
|
|
@@ -488,7 +394,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
488
394
|
var focus = function focus() {
|
|
489
395
|
var activeElement = document.activeElement;
|
|
490
396
|
var isActiveElementInDialog = activeElement && dialogRef.current && dialogRef.current.contains(activeElement);
|
|
491
|
-
if (!isActiveElementInDialog && props.closable && props.showHeader) {
|
|
397
|
+
if (!isActiveElementInDialog && props.closable && props.showHeader && closeRef.current) {
|
|
492
398
|
closeRef.current.focus();
|
|
493
399
|
}
|
|
494
400
|
};
|
|
@@ -682,11 +588,9 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
682
588
|
};
|
|
683
589
|
var enableDocumentSettings = function enableDocumentSettings() {
|
|
684
590
|
bindGlobalListeners();
|
|
685
|
-
updateGlobalDialogsRegistry(true);
|
|
686
591
|
};
|
|
687
592
|
var disableDocumentSettings = function disableDocumentSettings() {
|
|
688
593
|
unbindGlobalListeners();
|
|
689
|
-
updateGlobalDialogsRegistry(false);
|
|
690
594
|
};
|
|
691
595
|
var updateScrollBlocker = function updateScrollBlocker() {
|
|
692
596
|
// Scroll should be unblocked if there is at least one dialog that blocks scrolling:
|
|
@@ -700,8 +604,8 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
700
604
|
}
|
|
701
605
|
};
|
|
702
606
|
var updateGlobalDialogsRegistry = function updateGlobalDialogsRegistry(isMounted) {
|
|
703
|
-
// Update current dialog info in global registry if it is mounted:
|
|
704
|
-
if (isMounted) {
|
|
607
|
+
// Update current dialog info in global registry if it is mounted and visible:
|
|
608
|
+
if (isMounted && visibleState) {
|
|
705
609
|
var newParam = {
|
|
706
610
|
id: idState,
|
|
707
611
|
hasBlockScroll: shouldBlockScroll
|
|
@@ -720,7 +624,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
720
624
|
document.primeDialogParams = document.primeDialogParams.toSpliced(currentDialogIndexInRegistry, 1, newParam);
|
|
721
625
|
}
|
|
722
626
|
}
|
|
723
|
-
// Or remove it from global registry if unmounted:
|
|
627
|
+
// Or remove it from global registry if unmounted or invisible:
|
|
724
628
|
else {
|
|
725
629
|
document.primeDialogParams = document.primeDialogParams && document.primeDialogParams.filter(function (param) {
|
|
726
630
|
return param.id !== idState;
|
|
@@ -750,21 +654,31 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
750
654
|
unbindDocumentKeyDownListener();
|
|
751
655
|
};
|
|
752
656
|
var createStyle = function createStyle() {
|
|
753
|
-
styleElement.current = DomHandler.createInlineStyle(context && context.nonce || PrimeReact.nonce);
|
|
657
|
+
styleElement.current = DomHandler.createInlineStyle(context && context.nonce || PrimeReact.nonce, context && context.styleContainer);
|
|
754
658
|
var innerHTML = '';
|
|
755
659
|
for (var breakpoint in props.breakpoints) {
|
|
756
|
-
innerHTML += "\n @media screen and (max-width: ".concat(breakpoint, ") {\n
|
|
660
|
+
innerHTML += "\n @media screen and (max-width: ".concat(breakpoint, ") {\n [data-pc-name=\"dialog\"][").concat(attributeSelector.current, "] {\n width: ").concat(props.breakpoints[breakpoint], " !important;\n }\n }\n ");
|
|
757
661
|
}
|
|
758
662
|
styleElement.current.innerHTML = innerHTML;
|
|
759
663
|
};
|
|
664
|
+
var destroyStyle = function destroyStyle() {
|
|
665
|
+
styleElement.current = DomHandler.removeInlineStyle(styleElement.current);
|
|
666
|
+
};
|
|
760
667
|
useMountEffect(function () {
|
|
668
|
+
updateGlobalDialogsRegistry(true);
|
|
761
669
|
if (props.visible) {
|
|
762
670
|
setMaskVisibleState(true);
|
|
763
671
|
}
|
|
672
|
+
});
|
|
673
|
+
React.useEffect(function () {
|
|
764
674
|
if (props.breakpoints) {
|
|
765
675
|
createStyle();
|
|
766
676
|
}
|
|
767
|
-
|
|
677
|
+
return function () {
|
|
678
|
+
destroyStyle();
|
|
679
|
+
};
|
|
680
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
681
|
+
}, [props.breakpoints]);
|
|
768
682
|
useUpdateEffect(function () {
|
|
769
683
|
if (props.visible && !maskVisibleState) {
|
|
770
684
|
setMaskVisibleState(true);
|
|
@@ -786,9 +700,10 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
786
700
|
}, [maskVisibleState]);
|
|
787
701
|
useUpdateEffect(function () {
|
|
788
702
|
updateGlobalDialogsRegistry(true);
|
|
789
|
-
}, [shouldBlockScroll]);
|
|
790
|
-
useUnmountEffect
|
|
703
|
+
}, [shouldBlockScroll, visibleState]);
|
|
704
|
+
useUnmountEffect(function () {
|
|
791
705
|
disableDocumentSettings();
|
|
706
|
+
updateGlobalDialogsRegistry(false);
|
|
792
707
|
DomHandler.removeInlineStyle(styleElement.current);
|
|
793
708
|
ZIndexUtils.clear(maskRef.current);
|
|
794
709
|
});
|
|
@@ -915,11 +830,41 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
915
830
|
}
|
|
916
831
|
return null;
|
|
917
832
|
};
|
|
918
|
-
var
|
|
833
|
+
var createTemplateElement = function createTemplateElement(_ref) {
|
|
834
|
+
var _props$children;
|
|
835
|
+
var maskProps = _ref.maskProps,
|
|
836
|
+
rootProps = _ref.rootProps,
|
|
837
|
+
transitionProps = _ref.transitionProps;
|
|
838
|
+
var messageProps = {
|
|
839
|
+
header: props.header,
|
|
840
|
+
content: props.message,
|
|
841
|
+
message: props === null || props === void 0 || (_props$children = props.children) === null || _props$children === void 0 || (_props$children = _props$children[1]) === null || _props$children === void 0 || (_props$children = _props$children.props) === null || _props$children === void 0 ? void 0 : _props$children.children
|
|
842
|
+
};
|
|
843
|
+
var templateElementProps = {
|
|
844
|
+
headerRef: headerRef,
|
|
845
|
+
contentRef: contentRef,
|
|
846
|
+
footerRef: footerRef,
|
|
847
|
+
closeRef: closeRef,
|
|
848
|
+
hide: onClose,
|
|
849
|
+
message: messageProps
|
|
850
|
+
};
|
|
851
|
+
return /*#__PURE__*/React.createElement("div", maskProps, /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
852
|
+
nodeRef: dialogRef
|
|
853
|
+
}, transitionProps), /*#__PURE__*/React.createElement("div", rootProps, ObjectUtils.getJSXElement(inProps.content, templateElementProps))));
|
|
854
|
+
};
|
|
855
|
+
var createElement = function createElement(_ref2) {
|
|
856
|
+
var maskProps = _ref2.maskProps,
|
|
857
|
+
rootProps = _ref2.rootProps,
|
|
858
|
+
transitionProps = _ref2.transitionProps;
|
|
919
859
|
var header = createHeader();
|
|
920
860
|
var content = createContent();
|
|
921
861
|
var footer = createFooter();
|
|
922
862
|
var resizer = createResizer();
|
|
863
|
+
return /*#__PURE__*/React.createElement("div", maskProps, /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
864
|
+
nodeRef: dialogRef
|
|
865
|
+
}, transitionProps), /*#__PURE__*/React.createElement("div", rootProps, header, content, footer, resizer)));
|
|
866
|
+
};
|
|
867
|
+
var createDialog = function createDialog() {
|
|
923
868
|
var headerId = idState + '_header';
|
|
924
869
|
var contentId = idState + '_content';
|
|
925
870
|
var transitionTimeout = {
|
|
@@ -959,17 +904,29 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
959
904
|
onExiting: onExiting,
|
|
960
905
|
onExited: onExited
|
|
961
906
|
}, ptm('transition'));
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
907
|
+
if (inProps !== null && inProps !== void 0 && inProps.content) {
|
|
908
|
+
var templateElement = createTemplateElement({
|
|
909
|
+
maskProps: maskProps,
|
|
910
|
+
rootProps: rootProps,
|
|
911
|
+
transitionProps: transitionProps
|
|
912
|
+
});
|
|
913
|
+
return /*#__PURE__*/React.createElement(Portal, {
|
|
914
|
+
element: templateElement,
|
|
915
|
+
appendTo: props.appendTo,
|
|
916
|
+
visible: true
|
|
917
|
+
});
|
|
918
|
+
} else {
|
|
919
|
+
var element = createElement({
|
|
920
|
+
maskProps: maskProps,
|
|
921
|
+
rootProps: rootProps,
|
|
922
|
+
transitionProps: transitionProps
|
|
923
|
+
});
|
|
924
|
+
return /*#__PURE__*/React.createElement(Portal, {
|
|
925
|
+
element: element,
|
|
926
|
+
appendTo: props.appendTo,
|
|
927
|
+
visible: true
|
|
928
|
+
});
|
|
929
|
+
}
|
|
973
930
|
};
|
|
974
931
|
return maskVisibleState && createDialog();
|
|
975
932
|
});
|
package/dialog/dialog.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{DomHandler as t,ObjectUtils as n,classNames as r,UniqueComponentId as o,ZIndexUtils as i,mergeProps as a,IconUtils as l}from"primereact/utils";import c,{PrimeReactContext as u,localeOption as s}from"primereact/api";import{ComponentBase as p,useHandleStyle as d}from"primereact/componentbase";import{CSSTransition as m}from"primereact/csstransition";import{useEventListener as g,useMountEffect as f,useUpdateEffect as b,useUnmountEffect as y}from"primereact/hooks";import{TimesIcon as h}from"primereact/icons/times";import{WindowMaximizeIcon as v}from"primereact/icons/windowmaximize";import{WindowMinimizeIcon as x}from"primereact/icons/windowminimize";import{Portal as w}from"primereact/portal";import{Ripple as E}from"primereact/ripple";function S(){return S=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},S.apply(this,arguments)}function z(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 O(e){if(Array.isArray(e))return z(e)}function k(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function P(e,t){if(e){if("string"==typeof e)return z(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)?z(e,t):void 0}}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function 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 j(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function C(e){var t=j(e,"string");return"symbol"===I(t)?t:String(t)}function R(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){if(Array.isArray(e))return e}function B(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function T(){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 M(e,t){return N(e)||B(e,t)||P(e,t)||T()}var X=function(r){var o,i,a,l=r.target,c=void 0===l?"document":l,u=r.type,s=r.listener,p=r.options,d=r.when,m=void 0===d||d,g=e.useRef(null),f=e.useRef(null),b=(o=p,i=e.useRef(void 0),e.useEffect((function(){i.current=o})),i.current),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.isNotEmpty(e.target)&&(h(),(e.when||m)&&(g.current=t.getTargetElement(e.target))),!f.current&&g.current&&(f.current=function(e){return s&&s(e)},g.current.addEventListener(u,f.current,p))},h=function(){f.current&&(g.current.removeEventListener(u,f.current,p),f.current=null)};return e.useEffect((function(){m?g.current=t.getTargetElement(c):(h(),g.current=null)}),[c,m]),e.useEffect((function(){!f.current||f.current===s&&b===p||(h(),m&&y())}),[s,p]),a=function(){h()},e.useEffect((function(){return a}),[]),[y,h]},A=function(t,n,r){var o=M(X({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),r(e))}}),2),i=o[0],a=o[1];return e.useEffect((function(){if(n&&t.current)return i(),function(){a()}})),[t,r]};function H(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 Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _=p.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return r("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return r("p-dialog-content",e.props.contentClassName)},footer:"p-dialog-footer",mask:function(e){var t=e.props,n=e.maskVisibleState,o=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return r("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.props,n=e.maximized,o=e.context;return r("p-dialog p-component",t.className,{"p-dialog-rtl":t.rtl,"p-dialog-maximized":n,"p-dialog-default":!n,"p-input-filled":o&&"filled"===o.inputStyle||"filled"===c.inputStyle,"p-ripple-disabled":o&&!1===o.ripple||!1===c.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return Y({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});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 V(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){R(e,t,n[t])})):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 F=e.forwardRef((function(r,p){var z=e.useContext(u),I=_.getProps(r,z),j=I.id?I.id:o(),C=M(e.useState(j),2),R=C[0],N=M(e.useState(!1),2),B=N[0],T=N[1],X=M(e.useState(!1),2),H=X[0],Y=X[1],L=M(e.useState(I.maximized),2),F=L[0],J=L[1],U=e.useRef(null),Z=e.useRef(null),W=e.useRef(null),$=e.useRef(null),K=e.useRef(null),q=e.useRef(null),G=e.useRef(null),Q=e.useRef(!1),ee=e.useRef(!1),te=e.useRef(null),ne=e.useRef(null),re=e.useRef(null),oe=e.useRef(j),ie=e.useRef(null),ae=I.onMaximize?I.maximized:F,le=H&&(I.blockScroll||I.maximizable&&ae),ce=_.setMetaData(V(V({props:I},I.__parentMetadata),{},{state:{id:R,maximized:ae,containerVisible:B}})),ue=ce.ptm,se=ce.cx,pe=ce.sx;d(_.css.styles,ce.isUnstyled,{name:"dialog"}),A(Z,I.closable&&I.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;Pe(e),n.splice(r-1,1)}}));var de=M(g({type:"keydown",listener:function(e){return Ce(e)}}),2),me=de[0],ge=de[1],fe=M(g({type:"mousemove",target:function(){return window.document},listener:function(e){return Xe(e)}}),2),be=fe[0],ye=fe[1],he=M(g({type:"mouseup",target:function(){return window.document},listener:function(e){return Ae(e)}}),2),ve=he[0],xe=he[1],we=M(g({type:"mousemove",target:function(){return window.document},listener:function(e){return Ne(e)}}),2),Ee=we[0],Se=we[1],ze=M(g({type:"mouseup",target:function(){return window.document},listener:function(e){return Be(e)}}),2),Oe=ze[0],ke=ze[1],Pe=function(e){I.onHide(),e.preventDefault()},De=function(e){W.current=e.target,I.onPointerDown&&I.onPointerDown(e)},Ie=function(e){I.dismissableMask&&I.modal&&Z.current===e.target&&!W.current&&Pe(e),I.onMaskClick&&I.onMaskClick(e),W.current=null},je=function(e){I.onMaximize?I.onMaximize({originalEvent:e,maximized:!ae}):J((function(e){return!e})),e.preventDefault()},Ce=function(e){var n=e.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,o=r.length,i=r[o-1]?r[o-1].id:void 0;if(i===R){var a=document.getElementById(i);if("Tab"===e.key){e.preventDefault();var l=t.getFocusableElements(a);if(l&&l.length>0)if(document.activeElement){var c=l.indexOf(document.activeElement);e.shiftKey?-1===c||0===c?l[l.length-1].focus():l[c-1].focus():-1===c||c===l.length-1?l[0].focus():l[c+1].focus()}else l[0].focus()}}}},Re=function(e){t.hasClass(e.target,"p-dialog-header-icon")||t.hasClass(e.target.parentElement,"p-dialog-header-icon")||I.draggable&&(Q.current=!0,te.current=e.pageX,ne.current=e.pageY,U.current.style.margin="0",t.addClass(document.body,"p-unselectable-text"),I.onDragStart&&I.onDragStart(e))},Ne=function(e){if(Q.current){var n=t.getOuterWidth(U.current),r=t.getOuterHeight(U.current),o=e.pageX-te.current,i=e.pageY-ne.current,a=U.current.getBoundingClientRect(),l=a.left+o,c=a.top+i,u=t.getViewport(),s=getComputedStyle(U.current),p=parseFloat(s.marginLeft),d=parseFloat(s.marginTop);U.current.style.position="fixed",I.keepInViewport?(l>=I.minX&&l+n<u.width&&(te.current=e.pageX,U.current.style.left=l-p+"px"),c>=I.minY&&c+r<u.height&&(ne.current=e.pageY,U.current.style.top=c-d+"px")):(te.current=e.pageX,U.current.style.left=l-p+"px",ne.current=e.pageY,U.current.style.top=c-d+"px"),I.onDrag&&I.onDrag(e)}},Be=function(e){Q.current&&(Q.current=!1,t.removeClass(document.body,"p-unselectable-text"),I.onDragEnd&&I.onDragEnd(e))},Te=function(e){I.resizable&&(ee.current=!0,te.current=e.pageX,ne.current=e.pageY,t.addClass(document.body,"p-unselectable-text"),I.onResizeStart&&I.onResizeStart(e))},Me=function(e,n,r){!r&&(r=t.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(r[n]/100):o},Xe=function(e){if(ee.current){var n=e.pageX-te.current,r=e.pageY-ne.current,o=t.getOuterWidth(U.current),i=t.getOuterHeight(U.current),a=U.current.getBoundingClientRect(),l=t.getViewport(),c=!parseInt(U.current.style.top)||!parseInt(U.current.style.left),u=Me(U.current.style.minWidth,"width",l),s=Me(U.current.style.minHeight,"height",l),p=o+n,d=i+r;c&&(p+=n,d+=r),(!u||p>u)&&a.left+p<l.width&&(U.current.style.width=p+"px"),(!s||d>s)&&a.top+d<l.height&&(U.current.style.height=d+"px"),te.current=e.pageX,ne.current=e.pageY,I.onResize&&I.onResize(e)}},Ae=function(e){ee.current&&(ee.current=!1,t.removeClass(document.body,"p-unselectable-text"),I.onResizeEnd&&I.onResizeEnd(e))},He=function(){U.current.style.position="",U.current.style.left="",U.current.style.top="",U.current.style.margin=""},Ye=function(){U.current.setAttribute(oe.current,"")},_e=function(){var e;I.onShow&&I.onShow(),I.focusOnShow&&!((e=document.activeElement)&&U.current&&U.current.contains(e))&&I.closable&&I.showHeader&&G.current.focus(),Fe()},Le=function(){I.modal&&t.addClass(Z.current,"p-component-overlay-leave")},Ve=function(){Q.current=!1,i.clear(Z.current),T(!1),Je(),t.focus(ie.current),ie.current=null},Fe=function(){Ze(),Ue(!0)},Je=function(){We(),Ue(!1)},Ue=function(e){if(e){var n={id:R,hasBlockScroll:le};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===R}));document.primeDialogParams=-1===r?[].concat(O(o=document.primeDialogParams)||k(o)||P(o)||D(),[n]):document.primeDialogParams.toSpliced(r,1,n)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==R}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?t.blockBodyScroll():t.unblockBodyScroll()},Ze=function(){I.draggable&&(Ee(),Oe()),I.resizable&&(be(),ve()),me()},We=function(){Se(),ke(),ye(),xe(),ge()},$e=function(){re.current=t.createInlineStyle(z&&z.nonce||c.nonce);var e="";for(var n in I.breakpoints)e+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(oe.current,"] {\n width: ").concat(I.breakpoints[n],";\n }\n }\n ");re.current.innerHTML=e};f((function(){I.visible&&T(!0),I.breakpoints&&$e()})),b((function(){I.visible&&!B&&T(!0),I.visible!==H&&B&&Y(I.visible),I.visible&&(ie.current=document.activeElement)}),[I.visible,B]),b((function(){B&&(i.set("modal",Z.current,z&&z.autoZIndex||c.autoZIndex,I.baseZIndex||z&&z.zIndex.modal||c.zIndex.modal),Y(!0))}),[B]),b((function(){Ue(!0)}),[le]),y((function(){Je(),t.removeInlineStyle(re.current),i.clear(Z.current)})),e.useImperativeHandle(p,(function(){return{props:I,resetPosition:He,getElement:function(){return U.current},getMask:function(){return Z.current},getContent:function(){return $.current},getHeader:function(){return K.current},getFooter:function(){return q.current},getCloseButton:function(){return G.current}}}));var Ke,qe,Ge,Qe,et,tt,nt,rt,ot,it,at,lt,ct=function(){if(I.closable){var t=I.ariaCloseIconLabel||s("close"),n=a({className:se("closeButtonIcon"),"aria-hidden":!0},ue("closeButtonIcon")),r=l.getJSXIcon(I.closeIcon||e.createElement(h,n),V({},n),{props:I}),o=a({ref:G,type:"button",className:se("closeButton"),"aria-label":t,onClick:Pe},ue("closeButton"));return e.createElement("button",o,r,e.createElement(E,null))}return null},ut=function(){var t=a({className:se("maximizableIcon")},ue("maximizableIcon")),n=l.getJSXIcon(ae?I.minimizeIcon||e.createElement(x,t):I.maximizeIcon||e.createElement(v,t),t,{props:I});if(I.maximizable){var r=a({type:"button",className:se("maximizableButton"),onClick:je},ue("maximizableButton"));return e.createElement("button",r,n,e.createElement(E,null))}return null},st=function(){if(I.showHeader){var t=ct(),r=ut(),o=n.getJSXElement(I.icons,I),i=n.getJSXElement(I.header,I),l=R+"_header",c=a({ref:K,style:I.headerStyle,className:se("header"),onMouseDown:Re},ue("header")),u=a({id:l,className:se("headerTitle")},ue("headerTitle")),s=a({className:se("headerIcons")},ue("headerIcons"));return e.createElement("div",c,e.createElement("div",u,i),e.createElement("div",s,o,r,t))}return null},pt=function(){var t=n.getJSXElement(I.footer,I),r=a({ref:q,className:se("footer")},ue("footer"));return t&&e.createElement("div",r,t)};return B&&(qe=st(),Ke=a({id:R+"_content",ref:$,style:I.contentStyle,className:se("content")},ue("content")),Ge=e.createElement("div",Ke,I.children),Qe=pt(),et=I.resizable?e.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Te}):null,tt=R+"_header",nt=R+"_content",rt={enter:"center"===I.position?150:300,exit:"center"===I.position?150:300},ot=a({ref:Z,style:pe("mask"),className:se("mask"),onPointerUp:Ie},ue("mask")),it=a({ref:U,id:R,className:se("root",{props:I,maximized:ae,context:z}),style:I.style,onClick:I.onClick,role:"dialog","aria-labelledby":tt,"aria-describedby":nt,"aria-modal":I.modal,onPointerDown:De},_.getOtherProps(I),ue("root")),at=a({classNames:se("transition"),timeout:rt,in:H,options:I.transitionOptions,unmountOnExit:!0,onEnter:Ye,onEntered:_e,onExiting:Le,onExited:Ve},ue("transition")),lt=e.createElement("div",ot,e.createElement(m,S({nodeRef:U},at),e.createElement("div",it,qe,Ge,Qe,et))),e.createElement(w,{element:lt,appendTo:I.appendTo,visible:!0}))}));F.displayName="Dialog";export{F as Dialog};
|
|
1
|
+
import*as e from"react";import t,{PrimeReactContext as n,localeOption as o}from"primereact/api";import{ComponentBase as r,useHandleStyle as i}from"primereact/componentbase";import{CSSTransition as a}from"primereact/csstransition";import{useDisplayOrder as l,useGlobalOnEscapeKey as c,ESC_KEY_HANDLING_PRIORITIES as s,useEventListener as p,useMountEffect as u,useUpdateEffect as d,useUnmountEffect as m}from"primereact/hooks";import{TimesIcon as g}from"primereact/icons/times";import{WindowMaximizeIcon as f}from"primereact/icons/windowmaximize";import{WindowMinimizeIcon as b}from"primereact/icons/windowminimize";import{Portal as h}from"primereact/portal";import{Ripple as y}from"primereact/ripple";import{classNames as v,UniqueComponentId as x,DomHandler as w,ZIndexUtils as S,mergeProps as k,ObjectUtils as z,IconUtils as E}from"primereact/utils";function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},O.apply(this,arguments)}function P(e){return P="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},P(e)}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function D(e){if(Array.isArray(e))return I(e)}function j(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function C(e,t){if(e){if("string"==typeof e)return I(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)?I(e,t):void 0}}function R(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(e,t){if("object"!==P(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==P(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function B(e){var t=N(e,"string");return"symbol"===P(t)?t:String(t)}function M(e,t,n){return(t=B(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){if(Array.isArray(e))return e}function X(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw r}}return l}}function A(){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 T(e)||X(e,t)||C(e,t)||A()}function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){M(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var V=r.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,footerClassName:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return v("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return v("p-dialog-content",e.props.contentClassName)},footer:function(e){return v("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,o=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return v("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var n=e.props,o=e.maximized,r=e.context;return v("p-dialog p-component",n.className,{"p-dialog-rtl":n.rtl,"p-dialog-maximized":o,"p-dialog-default":!o,"p-input-filled":r&&"filled"===r.inputStyle||"filled"===t.inputStyle,"p-ripple-disabled":r&&!1===r.ripple||!1===t.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return _({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){M(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=e.forwardRef((function(r,v){var P=e.useContext(n),I=V.getProps(r,P),N=I.id?I.id:x(),B=H(e.useState(N),2),M=B[0],T=H(e.useState(!1),2),X=T[0],A=T[1],Y=H(e.useState(!1),2),_=Y[0],J=Y[1],F=H(e.useState(I.maximized),2),Z=F[0],U=F[1],W=e.useRef(null),$=e.useRef(null),G=e.useRef(null),K=e.useRef(null),q=e.useRef(null),Q=e.useRef(null),ee=e.useRef(null),te=e.useRef(!1),ne=e.useRef(!1),oe=e.useRef(null),re=e.useRef(null),ie=e.useRef(null),ae=e.useRef(N),le=e.useRef(null),ce=I.onMaximize?I.maximized:Z,se=_&&(I.blockScroll||I.maximizable&&ce),pe=l("dialog",_),ue=V.setMetaData(L(L({props:I},I.__parentMetadata),{},{state:{id:M,maximized:ce,containerVisible:X}})),de=ue.ptm,me=ue.cx,ge=ue.sx;i(V.css.styles,ue.isUnstyled,{name:"dialog"}),c({callback:function(e){I.closable&&I.closeOnEscape&&je(e)},when:_,priority:[s.DIALOG,pe]});var fe=H(p({type:"keydown",listener:function(e){return Be(e)}}),2),be=fe[0],he=fe[1],ye=H(p({type:"mousemove",target:function(){return window.document},listener:function(e){return Ye(e)}}),2),ve=ye[0],xe=ye[1],we=H(p({type:"mouseup",target:function(){return window.document},listener:function(e){return _e(e)}}),2),Se=we[0],ke=we[1],ze=H(p({type:"mousemove",target:function(){return window.document},listener:function(e){return Te(e)}}),2),Ee=ze[0],Oe=ze[1],Pe=H(p({type:"mouseup",target:function(){return window.document},listener:function(e){return Xe(e)}}),2),Ie=Pe[0],De=Pe[1],je=function(e){I.onHide(),e.preventDefault()},Ce=function(e){G.current=e.target,I.onPointerDown&&I.onPointerDown(e)},Re=function(e){I.dismissableMask&&I.modal&&$.current===e.target&&!G.current&&je(e),I.onMaskClick&&I.onMaskClick(e),G.current=null},Ne=function(e){I.onMaximize?I.onMaximize({originalEvent:e,maximized:!ce}):U((function(e){return!e})),e.preventDefault()},Be=function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,o=n.length,r=n[o-1]?n[o-1].id:void 0;if(r===M){var i=document.getElementById(r);if("Tab"===e.key){e.preventDefault();var a=w.getFocusableElements(i);if(a&&a.length>0)if(document.activeElement){var l=a.indexOf(document.activeElement);e.shiftKey?-1===l||0===l?a[a.length-1].focus():a[l-1].focus():-1===l||l===a.length-1?a[0].focus():a[l+1].focus()}else a[0].focus()}}}},Me=function(e){w.hasClass(e.target,"p-dialog-header-icon")||w.hasClass(e.target.parentElement,"p-dialog-header-icon")||I.draggable&&(te.current=!0,oe.current=e.pageX,re.current=e.pageY,W.current.style.margin="0",w.addClass(document.body,"p-unselectable-text"),I.onDragStart&&I.onDragStart(e))},Te=function(e){if(te.current){var t=w.getOuterWidth(W.current),n=w.getOuterHeight(W.current),o=e.pageX-oe.current,r=e.pageY-re.current,i=W.current.getBoundingClientRect(),a=i.left+o,l=i.top+r,c=w.getViewport(),s=getComputedStyle(W.current),p=parseFloat(s.marginLeft),u=parseFloat(s.marginTop);W.current.style.position="fixed",I.keepInViewport?(a>=I.minX&&a+t<c.width&&(oe.current=e.pageX,W.current.style.left=a-p+"px"),l>=I.minY&&l+n<c.height&&(re.current=e.pageY,W.current.style.top=l-u+"px")):(oe.current=e.pageX,W.current.style.left=a-p+"px",re.current=e.pageY,W.current.style.top=l-u+"px"),I.onDrag&&I.onDrag(e)}},Xe=function(e){te.current&&(te.current=!1,w.removeClass(document.body,"p-unselectable-text"),I.onDragEnd&&I.onDragEnd(e))},Ae=function(e){I.resizable&&(ne.current=!0,oe.current=e.pageX,re.current=e.pageY,w.addClass(document.body,"p-unselectable-text"),I.onResizeStart&&I.onResizeStart(e))},He=function(e,t,n){!n&&(n=w.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(n[t]/100):o},Ye=function(e){if(ne.current){var t=e.pageX-oe.current,n=e.pageY-re.current,o=w.getOuterWidth(W.current),r=w.getOuterHeight(W.current),i=W.current.getBoundingClientRect(),a=w.getViewport(),l=!parseInt(W.current.style.top)||!parseInt(W.current.style.left),c=He(W.current.style.minWidth,"width",a),s=He(W.current.style.minHeight,"height",a),p=o+t,u=r+n;l&&(p+=t,u+=n),(!c||p>c)&&i.left+p<a.width&&(W.current.style.width=p+"px"),(!s||u>s)&&i.top+u<a.height&&(W.current.style.height=u+"px"),oe.current=e.pageX,re.current=e.pageY,I.onResize&&I.onResize(e)}},_e=function(e){ne.current&&(ne.current=!1,w.removeClass(document.body,"p-unselectable-text"),I.onResizeEnd&&I.onResizeEnd(e))},Ve=function(){W.current.style.position="",W.current.style.left="",W.current.style.top="",W.current.style.margin=""},Je=function(){W.current.setAttribute(ae.current,"")},Le=function(){var e;I.onShow&&I.onShow(),I.focusOnShow&&!((e=document.activeElement)&&W.current&&W.current.contains(e))&&I.closable&&I.showHeader&&ee.current&&ee.current.focus(),Ue()},Fe=function(){I.modal&&w.addClass($.current,"p-component-overlay-leave")},Ze=function(){te.current=!1,S.clear($.current),A(!1),We(),w.focus(le.current),le.current=null},Ue=function(){Ge()},We=function(){Ke()},$e=function(e){if(e&&_){var t={id:M,hasBlockScroll:se};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===M}));document.primeDialogParams=-1===n?[].concat(D(o=document.primeDialogParams)||j(o)||C(o)||R(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==M}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?w.blockBodyScroll():w.unblockBodyScroll()},Ge=function(){I.draggable&&(Ee(),Ie()),I.resizable&&(ve(),Se()),be()},Ke=function(){Oe(),De(),xe(),ke(),he()},qe=function(){ie.current=w.createInlineStyle(P&&P.nonce||t.nonce,P&&P.styleContainer);var e="";for(var n in I.breakpoints)e+="\n @media screen and (max-width: ".concat(n,') {\n [data-pc-name="dialog"][').concat(ae.current,"] {\n width: ").concat(I.breakpoints[n]," !important;\n }\n }\n ");ie.current.innerHTML=e};u((function(){$e(!0),I.visible&&A(!0)})),e.useEffect((function(){return I.breakpoints&&qe(),function(){ie.current=w.removeInlineStyle(ie.current)}}),[I.breakpoints]),d((function(){I.visible&&!X&&A(!0),I.visible!==_&&X&&J(I.visible),I.visible&&(le.current=document.activeElement)}),[I.visible,X]),d((function(){X&&(S.set("modal",$.current,P&&P.autoZIndex||t.autoZIndex,I.baseZIndex||P&&P.zIndex.modal||t.zIndex.modal),J(!0))}),[X]),d((function(){$e(!0)}),[se,_]),m((function(){We(),$e(!1),w.removeInlineStyle(ie.current),S.clear($.current)})),e.useImperativeHandle(v,(function(){return{props:I,resetPosition:Ve,getElement:function(){return W.current},getMask:function(){return $.current},getContent:function(){return K.current},getHeader:function(){return q.current},getFooter:function(){return Q.current},getCloseButton:function(){return ee.current}}}));var Qe=function(){if(I.closable){var t=I.ariaCloseIconLabel||o("close"),n=k({className:me("closeButtonIcon"),"aria-hidden":!0},de("closeButtonIcon")),r=E.getJSXIcon(I.closeIcon||e.createElement(g,n),L({},n),{props:I}),i=k({ref:ee,type:"button",className:me("closeButton"),"aria-label":t,onClick:je},de("closeButton"));return e.createElement("button",i,r,e.createElement(y,null))}return null},et=function(){var t=k({className:me("maximizableIcon")},de("maximizableIcon")),n=E.getJSXIcon(ce?I.minimizeIcon||e.createElement(b,t):I.maximizeIcon||e.createElement(f,t),t,{props:I});if(I.maximizable){var o=k({type:"button",className:me("maximizableButton"),onClick:Ne},de("maximizableButton"));return e.createElement("button",o,n,e.createElement(y,null))}return null},tt=function(){if(I.showHeader){var t=Qe(),n=et(),o=z.getJSXElement(I.icons,I),r=z.getJSXElement(I.header,I),i=M+"_header",a=k({ref:q,style:I.headerStyle,className:me("header"),onMouseDown:Me},de("header")),l=k({id:i,className:me("headerTitle")},de("headerTitle")),c=k({className:me("headerIcons")},de("headerIcons"));return e.createElement("div",a,e.createElement("div",l,r),e.createElement("div",c,o,n,t))}return null},nt=function(){var t=z.getJSXElement(I.footer,I),n=k({ref:Q,className:me("footer")},de("footer"));return t&&e.createElement("div",n,t)},ot=function(t){var n,o=t.rootProps,i={header:I.header,content:I.message,message:null==I||null===(n=I.children)||void 0===n||null===(n=n[1])||void 0===n||null===(n=n.props)||void 0===n?void 0:n.children},l={headerRef:q,contentRef:K,footerRef:Q,closeRef:ee,hide:je,message:i};return e.createElement("div",t.maskProps,e.createElement(a,O({nodeRef:W},t.transitionProps),e.createElement("div",o,z.getJSXElement(r.content,l))))},rt=function(t){var n,o=t.maskProps,r=t.rootProps,i=t.transitionProps,l=tt(),c=(n=k({id:M+"_content",ref:K,style:I.contentStyle,className:me("content")},de("content")),e.createElement("div",n,I.children)),s=nt(),p=I.resizable?e.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Ae}):null;return e.createElement("div",o,e.createElement(a,O({nodeRef:W},i),e.createElement("div",r,l,c,s,p)))};return X&&function(){var t=M+"_header",n=M+"_content",o={enter:"center"===I.position?150:300,exit:"center"===I.position?150:300},i=k({ref:$,style:ge("mask"),className:me("mask"),onPointerUp:Re},de("mask")),a=k({ref:W,id:M,className:me("root",{props:I,maximized:ce,context:P}),style:I.style,onClick:I.onClick,role:"dialog","aria-labelledby":t,"aria-describedby":n,"aria-modal":I.modal,onPointerDown:Ce},V.getOtherProps(I),de("root")),l=k({classNames:me("transition"),timeout:o,in:_,options:I.transitionOptions,unmountOnExit:!0,onEnter:Je,onEntered:Le,onExiting:Fe,onExited:Ze},de("transition"));if(null!=r&&r.content){var c=ot({maskProps:i,rootProps:a,transitionProps:l});return e.createElement(h,{element:c,appendTo:I.appendTo,visible:!0})}var s=rt({maskProps:i,rootProps:a,transitionProps:l});return e.createElement(h,{element:s,appendTo:I.appendTo,visible:!0})}()}));F.displayName="Dialog";export{F as Dialog};
|