primereact 10.3.0 → 10.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.cjs.js +11 -8
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +36 -1
- package/accordion/accordion.esm.js +11 -8
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +9 -6
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +39 -33
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +13 -2
- package/api/api.esm.js +39 -33
- package/api/api.esm.min.js +1 -1
- package/api/api.js +39 -33
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +3 -2
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +6 -1
- package/autocomplete/autocomplete.esm.js +3 -2
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +3 -2
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/blockui.cjs.js +8 -5
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +8 -5
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +8 -5
- package/blockui/blockui.min.js +1 -1
- package/calendar/calendar.cjs.js +80 -43
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +3 -5
- package/calendar/calendar.esm.js +80 -43
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +80 -43
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +1 -1
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +1 -1
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +1 -1
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +42 -20
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +27 -4
- package/cascadeselect/cascadeselect.esm.js +43 -21
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +43 -21
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/checkbox.cjs.js +25 -25
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +25 -25
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +26 -26
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +5 -1
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +17 -2
- package/chip/chip.esm.js +5 -1
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +5 -1
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +2 -1
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -1
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -1
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +1 -1
- package/componentbase/componentbase.cjs.js +49 -8
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +50 -9
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +49 -8
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +21 -18
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +19 -3
- package/confirmdialog/confirmdialog.esm.js +21 -18
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +21 -18
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +32 -120
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +12 -2
- package/confirmpopup/confirmpopup.esm.js +35 -123
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +32 -120
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +1 -1
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +1 -1
- package/contextmenu/contextmenu.esm.js +1 -1
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +1 -1
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +725 -458
- package/core/core.min.js +40 -40
- package/datatable/datatable.cjs.js +31 -24
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +4 -3
- package/datatable/datatable.esm.js +31 -24
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +31 -24
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.d.ts +1 -1
- package/dialog/dialog.cjs.js +27 -118
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +2 -2
- package/dialog/dialog.esm.js +34 -125
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +28 -119
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +5 -3
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +1 -1
- package/dropdown/dropdown.esm.js +5 -3
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +6 -4
- package/dropdown/dropdown.min.js +1 -1
- package/galleria/galleria.cjs.js +1 -1
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +1 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +1 -1
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +215 -76
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +8 -4
- package/hooks/hooks.esm.js +215 -78
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +215 -76
- package/hooks/hooks.min.js +1 -1
- package/icons/arrowdown/index.cjs.js +1 -1
- package/icons/arrowdown/index.cjs.min.js +1 -1
- package/icons/arrowdown/index.esm.js +1 -1
- package/icons/arrowdown/index.esm.min.js +1 -1
- package/icons/arrowdown/index.js +1 -1
- package/icons/arrowdown/index.min.js +1 -1
- package/icons/arrowup/index.cjs.js +1 -1
- package/icons/arrowup/index.cjs.min.js +1 -1
- package/icons/arrowup/index.esm.js +1 -1
- package/icons/arrowup/index.esm.min.js +1 -1
- package/icons/arrowup/index.js +1 -1
- package/icons/arrowup/index.min.js +1 -1
- package/icons/ban/index.cjs.js +1 -1
- package/icons/ban/index.cjs.min.js +1 -1
- package/icons/ban/index.esm.js +1 -1
- package/icons/ban/index.esm.min.js +1 -1
- package/icons/ban/index.js +1 -1
- package/icons/ban/index.min.js +1 -1
- package/icons/download/index.cjs.js +1 -1
- package/icons/download/index.cjs.min.js +1 -1
- package/icons/download/index.esm.js +1 -1
- package/icons/download/index.esm.min.js +1 -1
- package/icons/download/index.js +1 -1
- package/icons/download/index.min.js +1 -1
- package/icons/exclamationtriangle/index.cjs.js +1 -1
- package/icons/exclamationtriangle/index.cjs.min.js +1 -1
- package/icons/exclamationtriangle/index.esm.js +1 -1
- package/icons/exclamationtriangle/index.esm.min.js +1 -1
- package/icons/exclamationtriangle/index.js +1 -1
- package/icons/exclamationtriangle/index.min.js +1 -1
- package/icons/eyeslash/index.cjs.js +1 -1
- package/icons/eyeslash/index.cjs.min.js +1 -1
- package/icons/eyeslash/index.esm.js +1 -1
- package/icons/eyeslash/index.esm.min.js +1 -1
- package/icons/eyeslash/index.js +1 -1
- package/icons/eyeslash/index.min.js +1 -1
- package/icons/filter/index.cjs.js +1 -1
- package/icons/filter/index.cjs.min.js +1 -1
- package/icons/filter/index.esm.js +1 -1
- package/icons/filter/index.esm.min.js +1 -1
- package/icons/filter/index.js +1 -1
- package/icons/filter/index.min.js +1 -1
- package/icons/filterslash/index.cjs.js +1 -1
- package/icons/filterslash/index.cjs.min.js +1 -1
- package/icons/filterslash/index.esm.js +1 -1
- package/icons/filterslash/index.esm.min.js +1 -1
- package/icons/filterslash/index.js +1 -1
- package/icons/filterslash/index.min.js +1 -1
- package/icons/infocircle/index.cjs.js +1 -1
- package/icons/infocircle/index.cjs.min.js +1 -1
- package/icons/infocircle/index.esm.js +1 -1
- package/icons/infocircle/index.esm.min.js +1 -1
- package/icons/infocircle/index.js +1 -1
- package/icons/infocircle/index.min.js +1 -1
- package/icons/pencil/index.cjs.js +1 -1
- package/icons/pencil/index.cjs.min.js +1 -1
- package/icons/pencil/index.esm.js +1 -1
- package/icons/pencil/index.esm.min.js +1 -1
- package/icons/pencil/index.js +1 -1
- package/icons/pencil/index.min.js +1 -1
- package/icons/plus/index.cjs.js +1 -1
- package/icons/plus/index.cjs.min.js +1 -1
- package/icons/plus/index.esm.js +1 -1
- package/icons/plus/index.esm.min.js +1 -1
- package/icons/plus/index.js +1 -1
- package/icons/plus/index.min.js +1 -1
- package/icons/refresh/index.cjs.js +1 -1
- package/icons/refresh/index.cjs.min.js +1 -1
- package/icons/refresh/index.esm.js +1 -1
- package/icons/refresh/index.esm.min.js +1 -1
- package/icons/refresh/index.js +1 -1
- package/icons/refresh/index.min.js +1 -1
- package/icons/search/index.cjs.js +1 -1
- package/icons/search/index.cjs.min.js +1 -1
- package/icons/search/index.esm.js +1 -1
- package/icons/search/index.esm.min.js +1 -1
- package/icons/search/index.js +1 -1
- package/icons/search/index.min.js +1 -1
- package/icons/searchminus/index.cjs.js +1 -1
- package/icons/searchminus/index.cjs.min.js +1 -1
- package/icons/searchminus/index.esm.js +1 -1
- package/icons/searchminus/index.esm.min.js +1 -1
- package/icons/searchminus/index.js +1 -1
- package/icons/searchminus/index.min.js +1 -1
- package/icons/searchplus/index.cjs.js +1 -1
- package/icons/searchplus/index.cjs.min.js +1 -1
- package/icons/searchplus/index.esm.js +1 -1
- package/icons/searchplus/index.esm.min.js +1 -1
- package/icons/searchplus/index.js +1 -1
- package/icons/searchplus/index.min.js +1 -1
- package/icons/sortalt/index.cjs.js +1 -1
- package/icons/sortalt/index.cjs.min.js +1 -1
- package/icons/sortalt/index.esm.js +1 -1
- package/icons/sortalt/index.esm.min.js +1 -1
- package/icons/sortalt/index.js +1 -1
- package/icons/sortalt/index.min.js +1 -1
- package/icons/sortamountdown/index.cjs.js +1 -1
- package/icons/sortamountdown/index.cjs.min.js +1 -1
- package/icons/sortamountdown/index.esm.js +1 -1
- package/icons/sortamountdown/index.esm.min.js +1 -1
- package/icons/sortamountdown/index.js +1 -1
- package/icons/sortamountdown/index.min.js +1 -1
- package/icons/sortamountupalt/index.cjs.js +1 -1
- package/icons/sortamountupalt/index.cjs.min.js +1 -1
- package/icons/sortamountupalt/index.esm.js +1 -1
- package/icons/sortamountupalt/index.esm.min.js +1 -1
- package/icons/sortamountupalt/index.js +1 -1
- package/icons/sortamountupalt/index.min.js +1 -1
- package/icons/spinner/index.cjs.js +1 -1
- package/icons/spinner/index.cjs.min.js +1 -1
- package/icons/spinner/index.esm.js +1 -1
- package/icons/spinner/index.esm.min.js +1 -1
- package/icons/spinner/index.js +1 -1
- package/icons/spinner/index.min.js +1 -1
- package/icons/star/index.cjs.js +1 -1
- package/icons/star/index.cjs.min.js +1 -1
- package/icons/star/index.esm.js +1 -1
- package/icons/star/index.esm.min.js +1 -1
- package/icons/star/index.js +1 -1
- package/icons/star/index.min.js +1 -1
- package/icons/starfill/index.cjs.js +1 -1
- package/icons/starfill/index.cjs.min.js +1 -1
- package/icons/starfill/index.esm.js +1 -1
- package/icons/starfill/index.esm.min.js +1 -1
- package/icons/starfill/index.js +1 -1
- package/icons/starfill/index.min.js +1 -1
- package/icons/thlarge/index.cjs.js +1 -1
- package/icons/thlarge/index.cjs.min.js +1 -1
- package/icons/thlarge/index.esm.js +1 -1
- package/icons/thlarge/index.esm.min.js +1 -1
- package/icons/thlarge/index.js +1 -1
- package/icons/thlarge/index.min.js +1 -1
- package/icons/timescircle/index.cjs.js +1 -1
- package/icons/timescircle/index.cjs.min.js +1 -1
- package/icons/timescircle/index.esm.js +1 -1
- package/icons/timescircle/index.esm.min.js +1 -1
- package/icons/timescircle/index.js +1 -1
- package/icons/timescircle/index.min.js +1 -1
- package/icons/trash/index.cjs.js +1 -1
- package/icons/trash/index.cjs.min.js +1 -1
- package/icons/trash/index.esm.js +1 -1
- package/icons/trash/index.esm.min.js +1 -1
- package/icons/trash/index.js +1 -1
- package/icons/trash/index.min.js +1 -1
- package/icons/undo/index.cjs.js +1 -1
- package/icons/undo/index.cjs.min.js +1 -1
- package/icons/undo/index.esm.js +1 -1
- package/icons/undo/index.esm.min.js +1 -1
- package/icons/undo/index.js +1 -1
- package/icons/undo/index.min.js +1 -1
- package/icons/upload/index.cjs.js +1 -1
- package/icons/upload/index.cjs.min.js +1 -1
- package/icons/upload/index.esm.js +1 -1
- package/icons/upload/index.esm.min.js +1 -1
- package/icons/upload/index.js +1 -1
- package/icons/upload/index.min.js +1 -1
- package/icons/windowmaximize/index.cjs.js +1 -1
- package/icons/windowmaximize/index.cjs.min.js +1 -1
- package/icons/windowmaximize/index.esm.js +1 -1
- package/icons/windowmaximize/index.esm.min.js +1 -1
- package/icons/windowmaximize/index.js +1 -1
- package/icons/windowmaximize/index.min.js +1 -1
- package/icons/windowminimize/index.cjs.js +1 -1
- package/icons/windowminimize/index.cjs.min.js +1 -1
- package/icons/windowminimize/index.esm.js +1 -1
- package/icons/windowminimize/index.esm.min.js +1 -1
- package/icons/windowminimize/index.js +1 -1
- package/icons/windowminimize/index.min.js +1 -1
- package/image/image.cjs.js +20 -109
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +22 -111
- package/image/image.esm.min.js +1 -1
- package/image/image.js +21 -110
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +7 -0
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +7 -0
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +8 -2
- package/inplace/inplace.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +63 -19
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +7 -0
- package/inputnumber/inputnumber.esm.js +63 -19
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +63 -19
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +3 -3
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +3 -3
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +3 -3
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +7 -6
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +7 -6
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +7 -6
- package/inputtext/inputtext.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -1
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +8 -3
- package/listbox/listbox.esm.js +14 -1
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +14 -1
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +67 -66
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +69 -68
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +67 -66
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +0 -3
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +1 -4
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +0 -3
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +7 -102
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +1 -1
- package/menu/menu.esm.js +10 -105
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +7 -102
- package/menu/menu.min.js +1 -1
- package/messages/messages.cjs.js +1 -1
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +1 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +1 -1
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +47 -30
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -1
- package/multiselect/multiselect.esm.js +47 -30
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +47 -30
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/orderlist.cjs.js +1 -1
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +10 -0
- package/orderlist/orderlist.esm.js +1 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +1 -1
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +10 -0
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +10 -0
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +10 -0
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +9 -104
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +1 -1
- package/overlaypanel/overlaypanel.esm.js +11 -106
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +10 -105
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.d.ts +2 -2
- package/panelmenu/panelmenu.cjs.js +1 -1
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +1 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +1 -1
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +158 -155
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +158 -155
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +158 -155
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +8 -3
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +1 -1
- package/password/password.esm.js +9 -4
- package/password/password.esm.min.js +1 -1
- package/password/password.js +8 -3
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +709 -181
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.d.ts +10 -0
- package/picklist/picklist.esm.js +708 -180
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +709 -181
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +7 -1
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +7 -1
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +7 -1
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +3391 -2429
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +3390 -2430
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +3391 -2429
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +26 -26
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +26 -26
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +27 -27
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +18 -9
- package/resources/themes/arya-green/theme.css +18 -9
- package/resources/themes/arya-orange/theme.css +18 -9
- package/resources/themes/arya-purple/theme.css +18 -9
- package/resources/themes/bootstrap4-dark-blue/theme.css +18 -9
- package/resources/themes/bootstrap4-dark-purple/theme.css +18 -9
- package/resources/themes/bootstrap4-light-blue/theme.css +18 -9
- package/resources/themes/bootstrap4-light-purple/theme.css +18 -9
- package/resources/themes/fluent-light/theme.css +18 -9
- package/resources/themes/lara-dark-amber/theme.css +18 -9
- package/resources/themes/lara-dark-blue/theme.css +18 -9
- package/resources/themes/lara-dark-cyan/theme.css +18 -9
- package/resources/themes/lara-dark-green/theme.css +18 -9
- package/resources/themes/lara-dark-indigo/theme.css +18 -9
- package/resources/themes/lara-dark-pink/theme.css +18 -9
- package/resources/themes/lara-dark-purple/theme.css +18 -9
- package/resources/themes/lara-dark-teal/theme.css +18 -9
- package/resources/themes/lara-light-amber/theme.css +18 -9
- package/resources/themes/lara-light-blue/theme.css +18 -9
- package/resources/themes/lara-light-cyan/theme.css +18 -9
- package/resources/themes/lara-light-green/theme.css +18 -9
- package/resources/themes/lara-light-indigo/theme.css +18 -9
- package/resources/themes/lara-light-pink/theme.css +18 -9
- package/resources/themes/lara-light-purple/theme.css +18 -9
- package/resources/themes/lara-light-teal/theme.css +18 -9
- package/resources/themes/luna-amber/theme.css +18 -9
- package/resources/themes/luna-blue/theme.css +18 -9
- package/resources/themes/luna-green/theme.css +18 -9
- package/resources/themes/luna-pink/theme.css +18 -9
- package/resources/themes/md-dark-deeppurple/theme.css +18 -9
- package/resources/themes/md-dark-indigo/theme.css +18 -9
- package/resources/themes/md-light-deeppurple/theme.css +18 -9
- package/resources/themes/md-light-indigo/theme.css +18 -9
- package/resources/themes/mdc-dark-deeppurple/theme.css +18 -9
- package/resources/themes/mdc-dark-indigo/theme.css +18 -9
- package/resources/themes/mdc-light-deeppurple/theme.css +18 -9
- package/resources/themes/mdc-light-indigo/theme.css +18 -9
- package/resources/themes/mira/theme.css +18 -9
- package/resources/themes/nano/theme.css +18 -9
- package/resources/themes/nova/theme.css +18 -9
- package/resources/themes/nova-accent/theme.css +18 -9
- package/resources/themes/nova-alt/theme.css +18 -9
- package/resources/themes/rhea/theme.css +18 -9
- package/resources/themes/saga-blue/theme.css +18 -9
- package/resources/themes/saga-green/theme.css +18 -9
- package/resources/themes/saga-orange/theme.css +18 -9
- package/resources/themes/saga-purple/theme.css +18 -9
- package/resources/themes/soho-dark/theme.css +18 -9
- package/resources/themes/soho-light/theme.css +18 -9
- package/resources/themes/tailwind-light/theme.css +18 -9
- package/resources/themes/vela-blue/theme.css +18 -9
- package/resources/themes/vela-green/theme.css +18 -9
- package/resources/themes/vela-orange/theme.css +18 -9
- package/resources/themes/vela-purple/theme.css +18 -9
- package/resources/themes/viva-dark/theme.css +18 -9
- package/resources/themes/viva-light/theme.css +18 -9
- package/ripple/ripple.cjs.js +6 -3
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +6 -3
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +6 -3
- package/ripple/ripple.min.js +1 -1
- package/sidebar/sidebar.cjs.js +8 -105
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +3 -3
- package/sidebar/sidebar.esm.js +11 -108
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +9 -106
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +7 -102
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +1 -1
- package/slidemenu/slidemenu.esm.js +10 -105
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +7 -102
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +1 -1
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +1 -1
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +1 -1
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +11 -3
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +12 -4
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +11 -3
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +89 -81
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +1 -1
- package/splitbutton/splitbutton.esm.js +90 -82
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +89 -81
- package/splitbutton/splitbutton.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +9 -7
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +9 -7
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +9 -7
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +22 -8
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +35 -0
- package/tabview/tabview.esm.js +22 -8
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +22 -8
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +1 -1
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +1 -1
- package/tieredmenu/tieredmenu.esm.js +1 -1
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +1 -1
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/toast.d.ts +2 -2
- package/togglebutton/togglebutton.cjs.js +74 -4
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +74 -4
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +75 -5
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.d.ts +27 -0
- package/tooltip/tooltipoptions.d.ts +1 -1
- package/tree/tree.cjs.js +244 -131
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +8 -0
- package/tree/tree.esm.js +245 -132
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +244 -131
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +185 -49
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +26 -1
- package/treeselect/treeselect.esm.js +186 -50
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +186 -51
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +67 -44
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +3 -3
- package/treetable/treetable.esm.js +67 -44
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +67 -44
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +7 -4
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +1 -1
- package/utils/utils.esm.js +7 -4
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +7 -4
- package/utils/utils.min.js +1 -1
- package/web-types.json +136 -29
package/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 s,localeOption as u}from"primereact/api";import{ComponentBase as p,useHandleStyle as d}from"primereact/componentbase";import{CSSTransition as m}from"primereact/csstransition";import{useEventListener as f,useMountEffect as g,useUpdateEffect as b,useUnmountEffect as v}from"primereact/hooks";import{TimesIcon as h}from"primereact/icons/times";import{WindowMaximizeIcon as y}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 k(e){return k="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},k(e)}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 P(e){if(Array.isArray(e))return z(e)}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function D(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 I(){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 R(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==k(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function j(e){var t=R(e,"string");return"symbol"===k(t)?t:String(t)}function C(e,t,n){return(t=j(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 T(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,s=!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){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}function B(){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)||T(e,t)||D(e,t)||B()}var X=function(t){var n=e.useRef(void 0);return e.useEffect((function(){n.current=t})),n.current},A=function(r,o,i){var a,l,c,s,u,p,d,m,f,g,b,v,h,y,x,w=(s=void 0===(c=(a={type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),i(e))}}).target)?"document":c,u=a.type,p=a.listener,d=a.options,f=void 0===(m=a.when)||m,g=e.useRef(null),b=e.useRef(null),v=X(p),h=X(d),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.isNotEmpty(e.target)&&(x(),(e.when||f)&&(g.current=t.getTargetElement(e.target))),!b.current&&g.current&&(b.current=function(e){return p&&p(e)},g.current.addEventListener(u,b.current,d))},x=function(){b.current&&(g.current.removeEventListener(u,b.current,d),b.current=null)},e.useEffect((function(){f?g.current=t.getTargetElement(s):(x(),g.current=null)}),[s,f]),e.useEffect((function(){!b.current||""+v==""+p&&h===d||(x(),f&&y())}),[p,d,f]),l=function(){x()},e.useEffect((function(){return l}),[]),[y,x]),E=M(w,2),S=E[0],k=E[1];return e.useEffect((function(){if(o&&r.current)return S(),function(){k()}})),[r,i]};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){C(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,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 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:function(e){return r("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 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 !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 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){C(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 J=e.forwardRef((function(r,p){var k=e.useContext(s),z=_.getProps(r,k),R=z.id?z.id:o(),j=M(e.useState(R),2),C=j[0],N=M(e.useState(!1),2),T=N[0],B=N[1],X=M(e.useState(!1),2),H=X[0],Y=X[1],L=M(e.useState(z.maximized),2),J=L[0],F=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(R),ie=e.useRef(null),ae=z.onMaximize?z.maximized:J,le=H&&(z.blockScroll||z.maximizable&&ae),ce=_.setMetaData(V(V({props:z},z.__parentMetadata),{},{state:{id:C,maximized:ae,containerVisible:T}})),se=ce.ptm,ue=ce.cx,pe=ce.sx;d(_.css.styles,ce.isUnstyled,{name:"dialog"}),A(Z,z.closable&&z.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;Oe(e),n.splice(r-1,1)}}));var de=M(f({type:"keydown",listener:function(e){return je(e)}}),2),me=de[0],fe=de[1],ge=M(f({type:"mousemove",target:function(){return window.document},listener:function(e){return Xe(e)}}),2),be=ge[0],ve=ge[1],he=M(f({type:"mouseup",target:function(){return window.document},listener:function(e){return Ae(e)}}),2),ye=he[0],xe=he[1],we=M(f({type:"mousemove",target:function(){return window.document},listener:function(e){return Ne(e)}}),2),Ee=we[0],Se=we[1],ke=M(f({type:"mouseup",target:function(){return window.document},listener:function(e){return Te(e)}}),2),ze=ke[0],Pe=ke[1],Oe=function(e){z.onHide(),e.preventDefault()},De=function(e){W.current=e.target,z.onPointerDown&&z.onPointerDown(e)},Ie=function(e){z.dismissableMask&&z.modal&&Z.current===e.target&&!W.current&&Oe(e),z.onMaskClick&&z.onMaskClick(e),W.current=null},Re=function(e){z.onMaximize?z.onMaximize({originalEvent:e,maximized:!ae}):F((function(e){return!e})),e.preventDefault()},je=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===C){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()}}}},Ce=function(e){t.hasClass(e.target,"p-dialog-header-icon")||t.hasClass(e.target.parentElement,"p-dialog-header-icon")||z.draggable&&(Q.current=!0,te.current=e.pageX,ne.current=e.pageY,U.current.style.margin="0",t.addClass(document.body,"p-unselectable-text"),z.onDragStart&&z.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,s=t.getViewport(),u=getComputedStyle(U.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);U.current.style.position="fixed",z.keepInViewport?(l>=z.minX&&l+n<s.width&&(te.current=e.pageX,U.current.style.left=l-p+"px"),c>=z.minY&&c+r<s.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"),z.onDrag&&z.onDrag(e)}},Te=function(e){Q.current&&(Q.current=!1,t.removeClass(document.body,"p-unselectable-text"),z.onDragEnd&&z.onDragEnd(e))},Be=function(e){z.resizable&&(ee.current=!0,te.current=e.pageX,ne.current=e.pageY,t.addClass(document.body,"p-unselectable-text"),z.onResizeStart&&z.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),s=Me(U.current.style.minWidth,"width",l),u=Me(U.current.style.minHeight,"height",l),p=o+n,d=i+r;c&&(p+=n,d+=r),(!s||p>s)&&a.left+p<l.width&&(U.current.style.width=p+"px"),(!u||d>u)&&a.top+d<l.height&&(U.current.style.height=d+"px"),te.current=e.pageX,ne.current=e.pageY,z.onResize&&z.onResize(e)}},Ae=function(e){ee.current&&(ee.current=!1,t.removeClass(document.body,"p-unselectable-text"),z.onResizeEnd&&z.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;z.onShow&&z.onShow(),z.focusOnShow&&!((e=document.activeElement)&&U.current&&U.current.contains(e))&&z.closable&&z.showHeader&&G.current&&G.current.focus(),Je()},Le=function(){z.modal&&t.addClass(Z.current,"p-component-overlay-leave")},Ve=function(){Q.current=!1,i.clear(Z.current),B(!1),Fe(),t.focus(ie.current),ie.current=null},Je=function(){Ze(),Ue(!0)},Fe=function(){We(),Ue(!1)},Ue=function(e){if(e&&H){var n={id:C,hasBlockScroll:le};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===C}));document.primeDialogParams=-1===r?[].concat(P(o=document.primeDialogParams)||O(o)||D(o)||I(),[n]):document.primeDialogParams.toSpliced(r,1,n)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==C}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?t.blockBodyScroll():t.unblockBodyScroll()},Ze=function(){z.draggable&&(Ee(),ze()),z.resizable&&(be(),ye()),me()},We=function(){Se(),Pe(),ve(),xe(),fe()},$e=function(){re.current=t.createInlineStyle(k&&k.nonce||c.nonce);var e="";for(var n in z.breakpoints)e+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(oe.current,"] {\n width: ").concat(z.breakpoints[n],";\n }\n }\n ");re.current.innerHTML=e};g((function(){z.visible&&B(!0),z.breakpoints&&$e()})),b((function(){z.visible&&!T&&B(!0),z.visible!==H&&T&&Y(z.visible),z.visible&&(ie.current=document.activeElement)}),[z.visible,T]),b((function(){T&&(i.set("modal",Z.current,k&&k.autoZIndex||c.autoZIndex,z.baseZIndex||k&&k.zIndex.modal||c.zIndex.modal),Y(!0))}),[T]),b((function(){Ue(!0)}),[le]),v((function(){Fe(),t.removeInlineStyle(re.current),i.clear(Z.current)})),e.useImperativeHandle(p,(function(){return{props:z,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=function(){if(z.closable){var t=z.ariaCloseIconLabel||u("close"),n=a({className:ue("closeButtonIcon"),"aria-hidden":!0},se("closeButtonIcon")),r=l.getJSXIcon(z.closeIcon||e.createElement(h,n),V({},n),{props:z}),o=a({ref:G,type:"button",className:ue("closeButton"),"aria-label":t,onClick:Oe},se("closeButton"));return e.createElement("button",o,r,e.createElement(E,null))}return null},qe=function(){var t=a({className:ue("maximizableIcon")},se("maximizableIcon")),n=l.getJSXIcon(ae?z.minimizeIcon||e.createElement(x,t):z.maximizeIcon||e.createElement(y,t),t,{props:z});if(z.maximizable){var r=a({type:"button",className:ue("maximizableButton"),onClick:Re},se("maximizableButton"));return e.createElement("button",r,n,e.createElement(E,null))}return null},Ge=function(){if(z.showHeader){var t=Ke(),r=qe(),o=n.getJSXElement(z.icons,z),i=n.getJSXElement(z.header,z),l=C+"_header",c=a({ref:K,style:z.headerStyle,className:ue("header"),onMouseDown:Ce},se("header")),s=a({id:l,className:ue("headerTitle")},se("headerTitle")),u=a({className:ue("headerIcons")},se("headerIcons"));return e.createElement("div",c,e.createElement("div",s,i),e.createElement("div",u,o,r,t))}return null},Qe=function(){var t=n.getJSXElement(z.footer,z),r=a({ref:q,className:ue("footer")},se("footer"));return t&&e.createElement("div",r,t)},et=function(t){var o,i=t.rootProps,a={header:z.header,content:z.message,message:null==z||null===(o=z.children)||void 0===o||null===(o=o[1])||void 0===o||null===(o=o.props)||void 0===o?void 0:o.children},l={headerRef:K,contentRef:$,footerRef:q,closeRef:G,hide:Oe,message:a};return e.createElement("div",t.maskProps,e.createElement(m,S({nodeRef:U},t.transitionProps),e.createElement("div",i,n.getJSXElement(r.content,l))))},tt=function(t){var n,r=t.maskProps,o=t.rootProps,i=t.transitionProps,l=Ge(),c=(n=a({id:C+"_content",ref:$,style:z.contentStyle,className:ue("content")},se("content")),e.createElement("div",n,z.children)),s=Qe(),u=z.resizable?e.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Be}):null;return e.createElement("div",r,e.createElement(m,S({nodeRef:U},i),e.createElement("div",o,l,c,s,u)))};return T&&function(){var t=C+"_header",n=C+"_content",o={enter:"center"===z.position?150:300,exit:"center"===z.position?150:300},i=a({ref:Z,style:pe("mask"),className:ue("mask"),onPointerUp:Ie},se("mask")),l=a({ref:U,id:C,className:ue("root",{props:z,maximized:ae,context:k}),style:z.style,onClick:z.onClick,role:"dialog","aria-labelledby":t,"aria-describedby":n,"aria-modal":z.modal,onPointerDown:De},_.getOtherProps(z),se("root")),c=a({classNames:ue("transition"),timeout:o,in:H,options:z.transitionOptions,unmountOnExit:!0,onEnter:Ye,onEntered:_e,onExiting:Le,onExited:Ve},se("transition"));if(null!=r&&r.content){var s=et({maskProps:i,rootProps:l,transitionProps:c});return e.createElement(w,{element:s,appendTo:z.appendTo,visible:!0})}var u=tt({maskProps:i,rootProps:l,transitionProps:c});return e.createElement(w,{element:u,appendTo:z.appendTo,visible:!0})}()}));J.displayName="Dialog";export{J 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};
|
package/dialog/dialog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
this.primereact = this.primereact || {};
|
|
2
|
-
this.primereact.dialog = (function (exports, React,
|
|
2
|
+
this.primereact.dialog = (function (exports, React, PrimeReact, componentbase, csstransition, hooks, times, windowmaximize, windowminimize, portal, ripple, utils) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -152,106 +152,6 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
152
152
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
var usePrevious = function usePrevious(newValue) {
|
|
156
|
-
var ref = React__namespace.useRef(undefined);
|
|
157
|
-
React__namespace.useEffect(function () {
|
|
158
|
-
ref.current = newValue;
|
|
159
|
-
});
|
|
160
|
-
return ref.current;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
/* eslint-disable */
|
|
164
|
-
var useUnmountEffect = function useUnmountEffect(fn) {
|
|
165
|
-
return React__namespace.useEffect(function () {
|
|
166
|
-
return fn;
|
|
167
|
-
}, []);
|
|
168
|
-
};
|
|
169
|
-
/* eslint-enable */
|
|
170
|
-
|
|
171
|
-
/* eslint-disable */
|
|
172
|
-
var useEventListener = function useEventListener(_ref) {
|
|
173
|
-
var _ref$target = _ref.target,
|
|
174
|
-
target = _ref$target === void 0 ? 'document' : _ref$target,
|
|
175
|
-
type = _ref.type,
|
|
176
|
-
listener = _ref.listener,
|
|
177
|
-
options = _ref.options,
|
|
178
|
-
_ref$when = _ref.when,
|
|
179
|
-
when = _ref$when === void 0 ? true : _ref$when;
|
|
180
|
-
var targetRef = React__namespace.useRef(null);
|
|
181
|
-
var listenerRef = React__namespace.useRef(null);
|
|
182
|
-
var prevListener = usePrevious(listener);
|
|
183
|
-
var prevOptions = usePrevious(options);
|
|
184
|
-
var bind = function bind() {
|
|
185
|
-
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
186
|
-
if (utils.ObjectUtils.isNotEmpty(bindOptions.target)) {
|
|
187
|
-
unbind();
|
|
188
|
-
(bindOptions.when || when) && (targetRef.current = utils.DomHandler.getTargetElement(bindOptions.target));
|
|
189
|
-
}
|
|
190
|
-
if (!listenerRef.current && targetRef.current) {
|
|
191
|
-
listenerRef.current = function (event) {
|
|
192
|
-
return listener && listener(event);
|
|
193
|
-
};
|
|
194
|
-
targetRef.current.addEventListener(type, listenerRef.current, options);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
var unbind = function unbind() {
|
|
198
|
-
if (listenerRef.current) {
|
|
199
|
-
targetRef.current.removeEventListener(type, listenerRef.current, options);
|
|
200
|
-
listenerRef.current = null;
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
React__namespace.useEffect(function () {
|
|
204
|
-
if (when) {
|
|
205
|
-
targetRef.current = utils.DomHandler.getTargetElement(target);
|
|
206
|
-
} else {
|
|
207
|
-
unbind();
|
|
208
|
-
targetRef.current = null;
|
|
209
|
-
}
|
|
210
|
-
}, [target, when]);
|
|
211
|
-
React__namespace.useEffect(function () {
|
|
212
|
-
// to properly compare functions we can implicitly converting the function to it's body's text as a String
|
|
213
|
-
if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
|
|
214
|
-
unbind();
|
|
215
|
-
when && bind();
|
|
216
|
-
}
|
|
217
|
-
}, [listener, options, when]);
|
|
218
|
-
useUnmountEffect(function () {
|
|
219
|
-
unbind();
|
|
220
|
-
});
|
|
221
|
-
return [bind, unbind];
|
|
222
|
-
};
|
|
223
|
-
/* eslint-enable */
|
|
224
|
-
|
|
225
|
-
var useOnEscapeKey = function useOnEscapeKey(ref, condition, callback) {
|
|
226
|
-
var handleEsc = function handleEsc(event) {
|
|
227
|
-
if (event.key === 'Esc' || event.key === 'Escape') {
|
|
228
|
-
event.stopImmediatePropagation();
|
|
229
|
-
callback(event);
|
|
230
|
-
}
|
|
231
|
-
return;
|
|
232
|
-
};
|
|
233
|
-
var _useEventListener = useEventListener({
|
|
234
|
-
type: 'keydown',
|
|
235
|
-
listener: handleEsc
|
|
236
|
-
}),
|
|
237
|
-
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
238
|
-
bindKeyDownListener = _useEventListener2[0],
|
|
239
|
-
unbindKeyDownListener = _useEventListener2[1];
|
|
240
|
-
React__namespace.useEffect(function () {
|
|
241
|
-
if (!condition) {
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
if (!ref.current) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
bindKeyDownListener();
|
|
248
|
-
return function () {
|
|
249
|
-
unbindKeyDownListener();
|
|
250
|
-
};
|
|
251
|
-
});
|
|
252
|
-
return [ref, callback];
|
|
253
|
-
};
|
|
254
|
-
|
|
255
155
|
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; }
|
|
256
156
|
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; }
|
|
257
157
|
var classes = {
|
|
@@ -418,6 +318,7 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
418
318
|
var focusElementOnHide = React__namespace.useRef(null);
|
|
419
319
|
var maximized = props.onMaximize ? props.maximized : maximizedState;
|
|
420
320
|
var shouldBlockScroll = visibleState && (props.blockScroll || props.maximizable && maximized);
|
|
321
|
+
var displayOrder = hooks.useDisplayOrder('dialog', visibleState);
|
|
421
322
|
var _DialogBase$setMetaDa = DialogBase.setMetaData(_objectSpread(_objectSpread({
|
|
422
323
|
props: props
|
|
423
324
|
}, props.__parentMetadata), {}, {
|
|
@@ -434,15 +335,14 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
434
335
|
componentbase.useHandleStyle(DialogBase.css.styles, isUnstyled, {
|
|
435
336
|
name: 'dialog'
|
|
436
337
|
});
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
params.splice(paramLength - 1, 1);
|
|
338
|
+
hooks.useGlobalOnEscapeKey({
|
|
339
|
+
callback: function callback(event) {
|
|
340
|
+
if (props.closable && props.closeOnEscape) {
|
|
341
|
+
onClose(event);
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
when: visibleState,
|
|
345
|
+
priority: [hooks.ESC_KEY_HANDLING_PRIORITIES.DIALOG, displayOrder]
|
|
446
346
|
});
|
|
447
347
|
var _useEventListener = hooks.useEventListener({
|
|
448
348
|
type: 'keydown',
|
|
@@ -702,11 +602,9 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
702
602
|
};
|
|
703
603
|
var enableDocumentSettings = function enableDocumentSettings() {
|
|
704
604
|
bindGlobalListeners();
|
|
705
|
-
updateGlobalDialogsRegistry(true);
|
|
706
605
|
};
|
|
707
606
|
var disableDocumentSettings = function disableDocumentSettings() {
|
|
708
607
|
unbindGlobalListeners();
|
|
709
|
-
updateGlobalDialogsRegistry(false);
|
|
710
608
|
};
|
|
711
609
|
var updateScrollBlocker = function updateScrollBlocker() {
|
|
712
610
|
// Scroll should be unblocked if there is at least one dialog that blocks scrolling:
|
|
@@ -720,7 +618,7 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
720
618
|
}
|
|
721
619
|
};
|
|
722
620
|
var updateGlobalDialogsRegistry = function updateGlobalDialogsRegistry(isMounted) {
|
|
723
|
-
// Update current dialog info in global registry if it is mounted :
|
|
621
|
+
// Update current dialog info in global registry if it is mounted and visible:
|
|
724
622
|
if (isMounted && visibleState) {
|
|
725
623
|
var newParam = {
|
|
726
624
|
id: idState,
|
|
@@ -740,7 +638,7 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
740
638
|
document.primeDialogParams = document.primeDialogParams.toSpliced(currentDialogIndexInRegistry, 1, newParam);
|
|
741
639
|
}
|
|
742
640
|
}
|
|
743
|
-
// Or remove it from global registry if unmounted:
|
|
641
|
+
// Or remove it from global registry if unmounted or invisible:
|
|
744
642
|
else {
|
|
745
643
|
document.primeDialogParams = document.primeDialogParams && document.primeDialogParams.filter(function (param) {
|
|
746
644
|
return param.id !== idState;
|
|
@@ -770,21 +668,31 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
770
668
|
unbindDocumentKeyDownListener();
|
|
771
669
|
};
|
|
772
670
|
var createStyle = function createStyle() {
|
|
773
|
-
styleElement.current = utils.DomHandler.createInlineStyle(context && context.nonce || PrimeReact__default["default"].nonce);
|
|
671
|
+
styleElement.current = utils.DomHandler.createInlineStyle(context && context.nonce || PrimeReact__default["default"].nonce, context && context.styleContainer);
|
|
774
672
|
var innerHTML = '';
|
|
775
673
|
for (var breakpoint in props.breakpoints) {
|
|
776
|
-
innerHTML += "\n @media screen and (max-width: ".concat(breakpoint, ") {\n
|
|
674
|
+
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 ");
|
|
777
675
|
}
|
|
778
676
|
styleElement.current.innerHTML = innerHTML;
|
|
779
677
|
};
|
|
678
|
+
var destroyStyle = function destroyStyle() {
|
|
679
|
+
styleElement.current = utils.DomHandler.removeInlineStyle(styleElement.current);
|
|
680
|
+
};
|
|
780
681
|
hooks.useMountEffect(function () {
|
|
682
|
+
updateGlobalDialogsRegistry(true);
|
|
781
683
|
if (props.visible) {
|
|
782
684
|
setMaskVisibleState(true);
|
|
783
685
|
}
|
|
686
|
+
});
|
|
687
|
+
React__namespace.useEffect(function () {
|
|
784
688
|
if (props.breakpoints) {
|
|
785
689
|
createStyle();
|
|
786
690
|
}
|
|
787
|
-
|
|
691
|
+
return function () {
|
|
692
|
+
destroyStyle();
|
|
693
|
+
};
|
|
694
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
695
|
+
}, [props.breakpoints]);
|
|
788
696
|
hooks.useUpdateEffect(function () {
|
|
789
697
|
if (props.visible && !maskVisibleState) {
|
|
790
698
|
setMaskVisibleState(true);
|
|
@@ -806,9 +714,10 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
806
714
|
}, [maskVisibleState]);
|
|
807
715
|
hooks.useUpdateEffect(function () {
|
|
808
716
|
updateGlobalDialogsRegistry(true);
|
|
809
|
-
}, [shouldBlockScroll]);
|
|
717
|
+
}, [shouldBlockScroll, visibleState]);
|
|
810
718
|
hooks.useUnmountEffect(function () {
|
|
811
719
|
disableDocumentSettings();
|
|
720
|
+
updateGlobalDialogsRegistry(false);
|
|
812
721
|
utils.DomHandler.removeInlineStyle(styleElement.current);
|
|
813
722
|
utils.ZIndexUtils.clear(maskRef.current);
|
|
814
723
|
});
|
|
@@ -1043,4 +952,4 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
1043
952
|
|
|
1044
953
|
return exports;
|
|
1045
954
|
|
|
1046
|
-
})({}, React, primereact.
|
|
955
|
+
})({}, React, primereact.api, primereact.componentbase, primereact.csstransition, primereact.hooks, primereact.icons.times, primereact.icons.windowmaximize, primereact.icons.windowminimize, primereact.portal, primereact.ripple, primereact.utils);
|
package/dialog/dialog.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,o,i,a,l,c,s,u,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var f=m(t),g=d(r);function b(){return b=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},b.apply(this,arguments)}function v(e){return v="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},v(e)}function y(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 h(e){if(Array.isArray(e))return y(e)}function x(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function E(e,t){if(e){if("string"==typeof e)return y(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)?y(e,t):void 0}}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function O(e){var t=P(e,"string");return"symbol"===v(t)?t:String(t)}function D(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){if(Array.isArray(e))return e}function k(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,s=!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){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}function z(){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 I(e,t){return S(e)||k(e,t)||E(e,t)||z()}var j=function(e){var t=f.useRef(void 0);return f.useEffect((function(){t.current=e})),t.current},R=function(e,t,r){var o,i,a,l,c,s,u,p,d,m,g,b,v,y,h,x=(l=void 0===(a=(o={type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),r(e))}}).target)?"document":a,c=o.type,s=o.listener,u=o.options,d=void 0===(p=o.when)||p,m=f.useRef(null),g=f.useRef(null),b=j(s),v=j(u),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.ObjectUtils.isNotEmpty(e.target)&&(h(),(e.when||d)&&(m.current=n.DomHandler.getTargetElement(e.target))),!g.current&&m.current&&(g.current=function(e){return s&&s(e)},m.current.addEventListener(c,g.current,u))},h=function(){g.current&&(m.current.removeEventListener(c,g.current,u),g.current=null)},f.useEffect((function(){d?m.current=n.DomHandler.getTargetElement(l):(h(),m.current=null)}),[l,d]),f.useEffect((function(){!g.current||""+b==""+s&&v===u||(h(),d&&y())}),[s,u,d]),i=function(){h()},f.useEffect((function(){return i}),[]),[y,h]),E=I(x,2),w=E[0],P=E[1];return f.useEffect((function(){if(t&&e.current)return w(),function(){P()}})),[e,r]};function C(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 H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=o.ComponentBase.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 n.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return n.classNames("p-dialog-content",e.props.contentClassName)},footer:function(e){return n.classNames("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,r=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 n.classNames("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":r,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.props,r=e.maximized,o=e.context;return n.classNames("p-dialog p-component",t.className,{"p-dialog-rtl":t.rtl,"p-dialog-maximized":r,"p-dialog-default":!r,"p-input-filled":o&&"filled"===o.inputStyle||"filled"===g.default.inputStyle,"p-ripple-disabled":o&&!1===o.ripple||!1===g.default.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 H({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 T(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 M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=f.forwardRef((function(e,t){var d=f.useContext(r.PrimeReactContext),m=N.getProps(e,d),v=m.id?m.id:n.UniqueComponentId(),y=I(f.useState(v),2),P=y[0],O=I(f.useState(!1),2),D=O[0],S=O[1],k=I(f.useState(!1),2),z=k[0],j=k[1],C=I(f.useState(m.maximized),2),H=C[0],T=C[1],B=f.useRef(null),U=f.useRef(null),X=f.useRef(null),_=f.useRef(null),L=f.useRef(null),A=f.useRef(null),Y=f.useRef(null),V=f.useRef(!1),Z=f.useRef(!1),J=f.useRef(null),F=f.useRef(null),W=f.useRef(null),$=f.useRef(v),q=f.useRef(null),K=m.onMaximize?m.maximized:H,G=z&&(m.blockScroll||m.maximizable&&K),Q=N.setMetaData(M(M({props:m},m.__parentMetadata),{},{state:{id:P,maximized:K,containerVisible:D}})),ee=Q.ptm,te=Q.cx,ne=Q.sx;o.useHandleStyle(N.css.styles,Q.isUnstyled,{name:"dialog"}),R(U,m.closable&&m.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;ye(e),n.splice(r-1,1)}}));var re=I(a.useEventListener({type:"keydown",listener:function(e){return we(e)}}),2),oe=re[0],ie=re[1],ae=I(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ze(e)}}),2),le=ae[0],ce=ae[1],se=I(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),ue=se[0],pe=se[1],de=I(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return Oe(e)}}),2),me=de[0],fe=de[1],ge=I(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return De(e)}}),2),be=ge[0],ve=ge[1],ye=function(e){m.onHide(),e.preventDefault()},he=function(e){X.current=e.target,m.onPointerDown&&m.onPointerDown(e)},xe=function(e){m.dismissableMask&&m.modal&&U.current===e.target&&!X.current&&ye(e),m.onMaskClick&&m.onMaskClick(e),X.current=null},Ee=function(e){m.onMaximize?m.onMaximize({originalEvent:e,maximized:!K}):T((function(e){return!e})),e.preventDefault()},we=function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var r=t.primeDialogParams,o=r.length,i=r[o-1]?r[o-1].id:void 0;if(i===P){var a=document.getElementById(i);if("Tab"===e.key){e.preventDefault();var l=n.DomHandler.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()}}}},Pe=function(e){n.DomHandler.hasClass(e.target,"p-dialog-header-icon")||n.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||m.draggable&&(V.current=!0,J.current=e.pageX,F.current=e.pageY,B.current.style.margin="0",n.DomHandler.addClass(document.body,"p-unselectable-text"),m.onDragStart&&m.onDragStart(e))},Oe=function(e){if(V.current){var t=n.DomHandler.getOuterWidth(B.current),r=n.DomHandler.getOuterHeight(B.current),o=e.pageX-J.current,i=e.pageY-F.current,a=B.current.getBoundingClientRect(),l=a.left+o,c=a.top+i,s=n.DomHandler.getViewport(),u=getComputedStyle(B.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);B.current.style.position="fixed",m.keepInViewport?(l>=m.minX&&l+t<s.width&&(J.current=e.pageX,B.current.style.left=l-p+"px"),c>=m.minY&&c+r<s.height&&(F.current=e.pageY,B.current.style.top=c-d+"px")):(J.current=e.pageX,B.current.style.left=l-p+"px",F.current=e.pageY,B.current.style.top=c-d+"px"),m.onDrag&&m.onDrag(e)}},De=function(e){V.current&&(V.current=!1,n.DomHandler.removeClass(document.body,"p-unselectable-text"),m.onDragEnd&&m.onDragEnd(e))},Se=function(e){m.resizable&&(Z.current=!0,J.current=e.pageX,F.current=e.pageY,n.DomHandler.addClass(document.body,"p-unselectable-text"),m.onResizeStart&&m.onResizeStart(e))},ke=function(e,t,r){!r&&(r=n.DomHandler.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(r[t]/100):o},ze=function(e){if(Z.current){var t=e.pageX-J.current,r=e.pageY-F.current,o=n.DomHandler.getOuterWidth(B.current),i=n.DomHandler.getOuterHeight(B.current),a=B.current.getBoundingClientRect(),l=n.DomHandler.getViewport(),c=!parseInt(B.current.style.top)||!parseInt(B.current.style.left),s=ke(B.current.style.minWidth,"width",l),u=ke(B.current.style.minHeight,"height",l),p=o+t,d=i+r;c&&(p+=t,d+=r),(!s||p>s)&&a.left+p<l.width&&(B.current.style.width=p+"px"),(!u||d>u)&&a.top+d<l.height&&(B.current.style.height=d+"px"),J.current=e.pageX,F.current=e.pageY,m.onResize&&m.onResize(e)}},Ie=function(e){Z.current&&(Z.current=!1,n.DomHandler.removeClass(document.body,"p-unselectable-text"),m.onResizeEnd&&m.onResizeEnd(e))},je=function(){B.current.style.position="",B.current.style.left="",B.current.style.top="",B.current.style.margin=""},Re=function(){B.current.setAttribute($.current,"")},Ce=function(){var e;m.onShow&&m.onShow(),m.focusOnShow&&!((e=document.activeElement)&&B.current&&B.current.contains(e))&&m.closable&&m.showHeader&&Y.current&&Y.current.focus(),Te()},He=function(){m.modal&&n.DomHandler.addClass(U.current,"p-component-overlay-leave")},Ne=function(){V.current=!1,n.ZIndexUtils.clear(U.current),S(!1),Me(),n.DomHandler.focus(q.current),q.current=null},Te=function(){Ue(),Be(!0)},Me=function(){Xe(),Be(!1)},Be=function(e){if(e&&z){var t={id:P,hasBlockScroll:G};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===P}));document.primeDialogParams=-1===r?[].concat(h(o=document.primeDialogParams)||x(o)||E(o)||w(),[t]):document.primeDialogParams.toSpliced(r,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==P}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?n.DomHandler.blockBodyScroll():n.DomHandler.unblockBodyScroll()},Ue=function(){m.draggable&&(me(),be()),m.resizable&&(le(),ue()),oe()},Xe=function(){fe(),ve(),ce(),pe(),ie()},_e=function(){W.current=n.DomHandler.createInlineStyle(d&&d.nonce||g.default.nonce);var e="";for(var t in m.breakpoints)e+="\n @media screen and (max-width: ".concat(t,") {\n .p-dialog[").concat($.current,"] {\n width: ").concat(m.breakpoints[t],";\n }\n }\n ");W.current.innerHTML=e};a.useMountEffect((function(){m.visible&&S(!0),m.breakpoints&&_e()})),a.useUpdateEffect((function(){m.visible&&!D&&S(!0),m.visible!==z&&D&&j(m.visible),m.visible&&(q.current=document.activeElement)}),[m.visible,D]),a.useUpdateEffect((function(){D&&(n.ZIndexUtils.set("modal",U.current,d&&d.autoZIndex||g.default.autoZIndex,m.baseZIndex||d&&d.zIndex.modal||g.default.zIndex.modal),j(!0))}),[D]),a.useUpdateEffect((function(){Be(!0)}),[G]),a.useUnmountEffect((function(){Me(),n.DomHandler.removeInlineStyle(W.current),n.ZIndexUtils.clear(U.current)})),f.useImperativeHandle(t,(function(){return{props:m,resetPosition:je,getElement:function(){return B.current},getMask:function(){return U.current},getContent:function(){return _.current},getHeader:function(){return L.current},getFooter:function(){return A.current},getCloseButton:function(){return Y.current}}}));var Le=function(){if(m.closable){var e=m.ariaCloseIconLabel||r.localeOption("close"),t=n.mergeProps({className:te("closeButtonIcon"),"aria-hidden":!0},ee("closeButtonIcon")),o=n.IconUtils.getJSXIcon(m.closeIcon||f.createElement(l.TimesIcon,t),M({},t),{props:m}),i=n.mergeProps({ref:Y,type:"button",className:te("closeButton"),"aria-label":e,onClick:ye},ee("closeButton"));return f.createElement("button",i,o,f.createElement(p.Ripple,null))}return null},Ae=function(){var e=n.mergeProps({className:te("maximizableIcon")},ee("maximizableIcon")),t=n.IconUtils.getJSXIcon(K?m.minimizeIcon||f.createElement(s.WindowMinimizeIcon,e):m.maximizeIcon||f.createElement(c.WindowMaximizeIcon,e),e,{props:m});if(m.maximizable){var r=n.mergeProps({type:"button",className:te("maximizableButton"),onClick:Ee},ee("maximizableButton"));return f.createElement("button",r,t,f.createElement(p.Ripple,null))}return null},Ye=function(){if(m.showHeader){var e=Le(),t=Ae(),r=n.ObjectUtils.getJSXElement(m.icons,m),o=n.ObjectUtils.getJSXElement(m.header,m),i=P+"_header",a=n.mergeProps({ref:L,style:m.headerStyle,className:te("header"),onMouseDown:Pe},ee("header")),l=n.mergeProps({id:i,className:te("headerTitle")},ee("headerTitle")),c=n.mergeProps({className:te("headerIcons")},ee("headerIcons"));return f.createElement("div",a,f.createElement("div",l,o),f.createElement("div",c,r,t,e))}return null},Ve=function(){var e=n.ObjectUtils.getJSXElement(m.footer,m),t=n.mergeProps({ref:A,className:te("footer")},ee("footer"));return e&&f.createElement("div",t,e)},Ze=function(t){var r,o=t.rootProps,a={header:m.header,content:m.message,message:null==m||null===(r=m.children)||void 0===r||null===(r=r[1])||void 0===r||null===(r=r.props)||void 0===r?void 0:r.children},l={headerRef:L,contentRef:_,footerRef:A,closeRef:Y,hide:ye,message:a};return f.createElement("div",t.maskProps,f.createElement(i.CSSTransition,b({nodeRef:B},t.transitionProps),f.createElement("div",o,n.ObjectUtils.getJSXElement(e.content,l))))},Je=function(e){var t,r=e.maskProps,o=e.rootProps,a=e.transitionProps,l=Ye(),c=(t=n.mergeProps({id:P+"_content",ref:_,style:m.contentStyle,className:te("content")},ee("content")),f.createElement("div",t,m.children)),s=Ve(),u=m.resizable?f.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Se}):null;return f.createElement("div",r,f.createElement(i.CSSTransition,b({nodeRef:B},a),f.createElement("div",o,l,c,s,u)))};return D&&function(){var t=P+"_header",r=P+"_content",o={enter:"center"===m.position?150:300,exit:"center"===m.position?150:300},i=n.mergeProps({ref:U,style:ne("mask"),className:te("mask"),onPointerUp:xe},ee("mask")),a=n.mergeProps({ref:B,id:P,className:te("root",{props:m,maximized:K,context:d}),style:m.style,onClick:m.onClick,role:"dialog","aria-labelledby":t,"aria-describedby":r,"aria-modal":m.modal,onPointerDown:he},N.getOtherProps(m),ee("root")),l=n.mergeProps({classNames:te("transition"),timeout:o,in:z,options:m.transitionOptions,unmountOnExit:!0,onEnter:Re,onEntered:Ce,onExiting:He,onExited:Ne},ee("transition"));if(null!=e&&e.content){var c=Ze({maskProps:i,rootProps:a,transitionProps:l});return f.createElement(u.Portal,{element:c,appendTo:m.appendTo,visible:!0})}var s=Je({maskProps:i,rootProps:a,transitionProps:l});return f.createElement(u.Portal,{element:s,appendTo:m.appendTo,visible:!0})}()}));return B.displayName="Dialog",e.Dialog=B,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.api,primereact.componentbase,primereact.csstransition,primereact.hooks,primereact.icons.times,primereact.icons.windowmaximize,primereact.icons.windowminimize,primereact.portal,primereact.ripple);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,o,i,a,l,c,s,u,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var g=m(t),f=d(n);function b(){return b=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},b.apply(this,arguments)}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e){if(Array.isArray(e))return h(e)}function x(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function w(e,t){if(e){if("string"==typeof e)return h(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)?h(e,t):void 0}}function P(){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 E(e,t){if("object"!==y(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function O(e){var t=E(e,"string");return"symbol"===y(t)?t:String(t)}function S(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){if(Array.isArray(e))return e}function z(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,s=!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){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}function k(){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 I(e,t){return D(e)||z(e,t)||w(e,t)||k()}function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(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){S(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 R=r.ComponentBase.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 p.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return p.classNames("p-dialog-content",e.props.contentClassName)},footer:function(e){return p.classNames("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,r=["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 p.classNames("p-dialog-mask",r?"p-dialog-".concat(r):"",{"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,r=e.context;return p.classNames("p-dialog p-component",t.className,{"p-dialog-rtl":t.rtl,"p-dialog-maximized":n,"p-dialog-default":!n,"p-input-filled":r&&"filled"===r.inputStyle||"filled"===f.default.inputStyle,"p-ripple-disabled":r&&!1===r.ripple||!1===f.default.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 C({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 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 N(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){S(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 M=g.forwardRef((function(e,t){var d=g.useContext(n.PrimeReactContext),m=R.getProps(e,d),y=m.id?m.id:p.UniqueComponentId(),h=I(g.useState(y),2),E=h[0],O=I(g.useState(!1),2),S=O[0],D=O[1],z=I(g.useState(!1),2),k=z[0],j=z[1],C=I(g.useState(m.maximized),2),H=C[0],M=C[1],T=g.useRef(null),B=g.useRef(null),U=g.useRef(null),_=g.useRef(null),X=g.useRef(null),A=g.useRef(null),L=g.useRef(null),Y=g.useRef(!1),V=g.useRef(!1),Z=g.useRef(null),J=g.useRef(null),F=g.useRef(null),W=g.useRef(y),G=g.useRef(null),K=m.onMaximize?m.maximized:H,$=k&&(m.blockScroll||m.maximizable&&K),q=i.useDisplayOrder("dialog",k),Q=R.setMetaData(N(N({props:m},m.__parentMetadata),{},{state:{id:E,maximized:K,containerVisible:S}})),ee=Q.ptm,te=Q.cx,ne=Q.sx;r.useHandleStyle(R.css.styles,Q.isUnstyled,{name:"dialog"}),i.useGlobalOnEscapeKey({callback:function(e){m.closable&&m.closeOnEscape&&he(e)},when:k,priority:[i.ESC_KEY_HANDLING_PRIORITIES.DIALOG,q]});var re=I(i.useEventListener({type:"keydown",listener:function(e){return Pe(e)}}),2),oe=re[0],ie=re[1],ae=I(i.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ke(e)}}),2),le=ae[0],ce=ae[1],se=I(i.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),ue=se[0],pe=se[1],de=I(i.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return Oe(e)}}),2),me=de[0],ge=de[1],fe=I(i.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),be=fe[0],ye=fe[1],he=function(e){m.onHide(),e.preventDefault()},ve=function(e){U.current=e.target,m.onPointerDown&&m.onPointerDown(e)},xe=function(e){m.dismissableMask&&m.modal&&B.current===e.target&&!U.current&&he(e),m.onMaskClick&&m.onMaskClick(e),U.current=null},we=function(e){m.onMaximize?m.onMaximize({originalEvent:e,maximized:!K}):M((function(e){return!e})),e.preventDefault()},Pe=function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length,o=n[r-1]?n[r-1].id:void 0;if(o===E){var i=document.getElementById(o);if("Tab"===e.key){e.preventDefault();var a=p.DomHandler.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()}}}},Ee=function(e){p.DomHandler.hasClass(e.target,"p-dialog-header-icon")||p.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||m.draggable&&(Y.current=!0,Z.current=e.pageX,J.current=e.pageY,T.current.style.margin="0",p.DomHandler.addClass(document.body,"p-unselectable-text"),m.onDragStart&&m.onDragStart(e))},Oe=function(e){if(Y.current){var t=p.DomHandler.getOuterWidth(T.current),n=p.DomHandler.getOuterHeight(T.current),r=e.pageX-Z.current,o=e.pageY-J.current,i=T.current.getBoundingClientRect(),a=i.left+r,l=i.top+o,c=p.DomHandler.getViewport(),s=getComputedStyle(T.current),u=parseFloat(s.marginLeft),d=parseFloat(s.marginTop);T.current.style.position="fixed",m.keepInViewport?(a>=m.minX&&a+t<c.width&&(Z.current=e.pageX,T.current.style.left=a-u+"px"),l>=m.minY&&l+n<c.height&&(J.current=e.pageY,T.current.style.top=l-d+"px")):(Z.current=e.pageX,T.current.style.left=a-u+"px",J.current=e.pageY,T.current.style.top=l-d+"px"),m.onDrag&&m.onDrag(e)}},Se=function(e){Y.current&&(Y.current=!1,p.DomHandler.removeClass(document.body,"p-unselectable-text"),m.onDragEnd&&m.onDragEnd(e))},De=function(e){m.resizable&&(V.current=!0,Z.current=e.pageX,J.current=e.pageY,p.DomHandler.addClass(document.body,"p-unselectable-text"),m.onResizeStart&&m.onResizeStart(e))},ze=function(e,t,n){!n&&(n=p.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},ke=function(e){if(V.current){var t=e.pageX-Z.current,n=e.pageY-J.current,r=p.DomHandler.getOuterWidth(T.current),o=p.DomHandler.getOuterHeight(T.current),i=T.current.getBoundingClientRect(),a=p.DomHandler.getViewport(),l=!parseInt(T.current.style.top)||!parseInt(T.current.style.left),c=ze(T.current.style.minWidth,"width",a),s=ze(T.current.style.minHeight,"height",a),u=r+t,d=o+n;l&&(u+=t,d+=n),(!c||u>c)&&i.left+u<a.width&&(T.current.style.width=u+"px"),(!s||d>s)&&i.top+d<a.height&&(T.current.style.height=d+"px"),Z.current=e.pageX,J.current=e.pageY,m.onResize&&m.onResize(e)}},Ie=function(e){V.current&&(V.current=!1,p.DomHandler.removeClass(document.body,"p-unselectable-text"),m.onResizeEnd&&m.onResizeEnd(e))},je=function(){T.current.style.position="",T.current.style.left="",T.current.style.top="",T.current.style.margin=""},Ce=function(){T.current.setAttribute(W.current,"")},Re=function(){var e;m.onShow&&m.onShow(),m.focusOnShow&&!((e=document.activeElement)&&T.current&&T.current.contains(e))&&m.closable&&m.showHeader&&L.current&&L.current.focus(),Me()},He=function(){m.modal&&p.DomHandler.addClass(B.current,"p-component-overlay-leave")},Ne=function(){Y.current=!1,p.ZIndexUtils.clear(B.current),D(!1),Te(),p.DomHandler.focus(G.current),G.current=null},Me=function(){Ue()},Te=function(){_e()},Be=function(e){if(e&&k){var t={id:E,hasBlockScroll:$};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===E}));document.primeDialogParams=-1===n?[].concat(v(r=document.primeDialogParams)||x(r)||w(r)||P(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==E}));var r;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?p.DomHandler.blockBodyScroll():p.DomHandler.unblockBodyScroll()},Ue=function(){m.draggable&&(me(),be()),m.resizable&&(le(),ue()),oe()},_e=function(){ge(),ye(),ce(),pe(),ie()},Xe=function(){F.current=p.DomHandler.createInlineStyle(d&&d.nonce||f.default.nonce,d&&d.styleContainer);var e="";for(var t in m.breakpoints)e+="\n @media screen and (max-width: ".concat(t,') {\n [data-pc-name="dialog"][').concat(W.current,"] {\n width: ").concat(m.breakpoints[t]," !important;\n }\n }\n ");F.current.innerHTML=e};i.useMountEffect((function(){Be(!0),m.visible&&D(!0)})),g.useEffect((function(){return m.breakpoints&&Xe(),function(){F.current=p.DomHandler.removeInlineStyle(F.current)}}),[m.breakpoints]),i.useUpdateEffect((function(){m.visible&&!S&&D(!0),m.visible!==k&&S&&j(m.visible),m.visible&&(G.current=document.activeElement)}),[m.visible,S]),i.useUpdateEffect((function(){S&&(p.ZIndexUtils.set("modal",B.current,d&&d.autoZIndex||f.default.autoZIndex,m.baseZIndex||d&&d.zIndex.modal||f.default.zIndex.modal),j(!0))}),[S]),i.useUpdateEffect((function(){Be(!0)}),[$,k]),i.useUnmountEffect((function(){Te(),Be(!1),p.DomHandler.removeInlineStyle(F.current),p.ZIndexUtils.clear(B.current)})),g.useImperativeHandle(t,(function(){return{props:m,resetPosition:je,getElement:function(){return T.current},getMask:function(){return B.current},getContent:function(){return _.current},getHeader:function(){return X.current},getFooter:function(){return A.current},getCloseButton:function(){return L.current}}}));var Ae=function(){if(m.closable){var e=m.ariaCloseIconLabel||n.localeOption("close"),t=p.mergeProps({className:te("closeButtonIcon"),"aria-hidden":!0},ee("closeButtonIcon")),r=p.IconUtils.getJSXIcon(m.closeIcon||g.createElement(a.TimesIcon,t),N({},t),{props:m}),o=p.mergeProps({ref:L,type:"button",className:te("closeButton"),"aria-label":e,onClick:he},ee("closeButton"));return g.createElement("button",o,r,g.createElement(u.Ripple,null))}return null},Le=function(){var e=p.mergeProps({className:te("maximizableIcon")},ee("maximizableIcon")),t=p.IconUtils.getJSXIcon(K?m.minimizeIcon||g.createElement(c.WindowMinimizeIcon,e):m.maximizeIcon||g.createElement(l.WindowMaximizeIcon,e),e,{props:m});if(m.maximizable){var n=p.mergeProps({type:"button",className:te("maximizableButton"),onClick:we},ee("maximizableButton"));return g.createElement("button",n,t,g.createElement(u.Ripple,null))}return null},Ye=function(){if(m.showHeader){var e=Ae(),t=Le(),n=p.ObjectUtils.getJSXElement(m.icons,m),r=p.ObjectUtils.getJSXElement(m.header,m),o=E+"_header",i=p.mergeProps({ref:X,style:m.headerStyle,className:te("header"),onMouseDown:Ee},ee("header")),a=p.mergeProps({id:o,className:te("headerTitle")},ee("headerTitle")),l=p.mergeProps({className:te("headerIcons")},ee("headerIcons"));return g.createElement("div",i,g.createElement("div",a,r),g.createElement("div",l,n,t,e))}return null},Ve=function(){var e=p.ObjectUtils.getJSXElement(m.footer,m),t=p.mergeProps({ref:A,className:te("footer")},ee("footer"));return e&&g.createElement("div",t,e)},Ze=function(t){var n,r=t.rootProps,i={header:m.header,content:m.message,message:null==m||null===(n=m.children)||void 0===n||null===(n=n[1])||void 0===n||null===(n=n.props)||void 0===n?void 0:n.children},a={headerRef:X,contentRef:_,footerRef:A,closeRef:L,hide:he,message:i};return g.createElement("div",t.maskProps,g.createElement(o.CSSTransition,b({nodeRef:T},t.transitionProps),g.createElement("div",r,p.ObjectUtils.getJSXElement(e.content,a))))},Je=function(e){var t,n=e.maskProps,r=e.rootProps,i=e.transitionProps,a=Ye(),l=(t=p.mergeProps({id:E+"_content",ref:_,style:m.contentStyle,className:te("content")},ee("content")),g.createElement("div",t,m.children)),c=Ve(),s=m.resizable?g.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:De}):null;return g.createElement("div",n,g.createElement(o.CSSTransition,b({nodeRef:T},i),g.createElement("div",r,a,l,c,s)))};return S&&function(){var t=E+"_header",n=E+"_content",r={enter:"center"===m.position?150:300,exit:"center"===m.position?150:300},o=p.mergeProps({ref:B,style:ne("mask"),className:te("mask"),onPointerUp:xe},ee("mask")),i=p.mergeProps({ref:T,id:E,className:te("root",{props:m,maximized:K,context:d}),style:m.style,onClick:m.onClick,role:"dialog","aria-labelledby":t,"aria-describedby":n,"aria-modal":m.modal,onPointerDown:ve},R.getOtherProps(m),ee("root")),a=p.mergeProps({classNames:te("transition"),timeout:r,in:k,options:m.transitionOptions,unmountOnExit:!0,onEnter:Ce,onEntered:Re,onExiting:He,onExited:Ne},ee("transition"));if(null!=e&&e.content){var l=Ze({maskProps:o,rootProps:i,transitionProps:a});return g.createElement(s.Portal,{element:l,appendTo:m.appendTo,visible:!0})}var c=Je({maskProps:o,rootProps:i,transitionProps:a});return g.createElement(s.Portal,{element:c,appendTo:m.appendTo,visible:!0})}()}));return M.displayName="Dialog",e.Dialog=M,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.csstransition,primereact.hooks,primereact.icons.times,primereact.icons.windowmaximize,primereact.icons.windowminimize,primereact.portal,primereact.ripple,primereact.utils);
|
package/dropdown/dropdown.cjs.js
CHANGED
|
@@ -8,6 +8,7 @@ var PrimeReact = require('primereact/api');
|
|
|
8
8
|
var componentbase = require('primereact/componentbase');
|
|
9
9
|
var hooks = require('primereact/hooks');
|
|
10
10
|
var chevrondown = require('primereact/icons/chevrondown');
|
|
11
|
+
var spinner = require('primereact/icons/spinner');
|
|
11
12
|
var times = require('primereact/icons/times');
|
|
12
13
|
var overlayservice = require('primereact/overlayservice');
|
|
13
14
|
var tooltip = require('primereact/tooltip');
|
|
@@ -17,7 +18,6 @@ var search = require('primereact/icons/search');
|
|
|
17
18
|
var portal = require('primereact/portal');
|
|
18
19
|
var virtualscroller = require('primereact/virtualscroller');
|
|
19
20
|
var ripple = require('primereact/ripple');
|
|
20
|
-
var spinner = require('primereact/icons/spinner');
|
|
21
21
|
|
|
22
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
23
|
|
|
@@ -1286,7 +1286,7 @@ var Dropdown = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
1286
1286
|
onBlur: onInputBlur,
|
|
1287
1287
|
onKeyDown: onInputKeyDown,
|
|
1288
1288
|
disabled: props.disabled,
|
|
1289
|
-
tabIndex: props.tabIndex
|
|
1289
|
+
tabIndex: props.tabIndex || 0
|
|
1290
1290
|
}, ariaProps), ptm('input'));
|
|
1291
1291
|
return /*#__PURE__*/React__namespace.createElement("div", hiddenSelectedMessageProps, /*#__PURE__*/React__namespace.createElement("input", inputProps));
|
|
1292
1292
|
};
|
|
@@ -1307,6 +1307,7 @@ var Dropdown = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
1307
1307
|
onInput: onEditableInputChange,
|
|
1308
1308
|
onFocus: onEditableInputFocus,
|
|
1309
1309
|
onBlur: onInputBlur,
|
|
1310
|
+
tabIndex: props.tabIndex || 0,
|
|
1310
1311
|
'aria-haspopup': 'listbox'
|
|
1311
1312
|
}, ariaProps), ptm('input'));
|
|
1312
1313
|
return /*#__PURE__*/React__namespace.createElement("input", inputProps);
|
|
@@ -1316,7 +1317,8 @@ var Dropdown = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
1316
1317
|
ref: inputRef,
|
|
1317
1318
|
className: cx('input', {
|
|
1318
1319
|
label: label
|
|
1319
|
-
})
|
|
1320
|
+
}),
|
|
1321
|
+
tabIndex: '-1'
|
|
1320
1322
|
}, ptm('input'));
|
|
1321
1323
|
return /*#__PURE__*/React__namespace.createElement("span", _inputProps, content);
|
|
1322
1324
|
}
|