primereact 10.2.0 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.cjs.js +83 -11
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +1 -1
- package/accordion/accordion.esm.js +83 -11
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +81 -9
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +24 -0
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +13 -246
- package/api/api.esm.js +24 -0
- package/api/api.esm.min.js +1 -1
- package/api/api.js +24 -0
- package/api/api.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +12 -6
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +12 -6
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +12 -6
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/calendar/calendar.cjs.js +6 -9
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +6 -9
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +6 -9
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +102 -8
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +103 -9
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +102 -8
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +24 -5
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +25 -6
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +25 -7
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chip/chip.cjs.js +0 -1
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.esm.js +0 -1
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +0 -1
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +1 -2
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +1 -2
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +1 -2
- package/chips/chips.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +13 -8
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +13 -8
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +13 -8
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +57 -36
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +29 -0
- package/confirmpopup/confirmpopup.esm.js +57 -36
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +57 -36
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +640 -98
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +22 -0
- package/contextmenu/contextmenu.esm.js +640 -98
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +640 -98
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +596 -130
- package/core/core.min.js +35 -35
- package/datatable/datatable.cjs.js +4 -7
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +1 -1
- package/datatable/datatable.esm.js +4 -7
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +4 -7
- package/datatable/datatable.min.js +1 -1
- package/dialog/dialog.cjs.js +86 -38
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +59 -0
- package/dialog/dialog.esm.js +86 -38
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +86 -38
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +1 -0
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +1 -0
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +1 -0
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +169 -33
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +15 -0
- package/dock/dock.esm.js +170 -34
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +169 -33
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +25 -2
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +25 -2
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +26 -4
- package/dropdown/dropdown.min.js +1 -1
- package/fieldset/fieldset.cjs.js +12 -5
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +12 -5
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +12 -5
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +14 -6
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +17 -1
- package/fileupload/fileupload.esm.js +14 -6
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +14 -6
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +222 -42
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +224 -44
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +222 -42
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +4 -2
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +4 -2
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +4 -2
- package/hooks/hooks.min.js +1 -1
- package/icons/arrowdown/index.cjs.js +12 -1
- package/icons/arrowdown/index.cjs.min.js +1 -1
- package/icons/arrowdown/index.esm.js +12 -1
- package/icons/arrowdown/index.esm.min.js +1 -1
- package/icons/arrowdown/index.js +12 -1
- package/icons/arrowdown/index.min.js +1 -1
- package/icons/arrowup/index.cjs.js +12 -1
- package/icons/arrowup/index.cjs.min.js +1 -1
- package/icons/arrowup/index.esm.js +12 -1
- package/icons/arrowup/index.esm.min.js +1 -1
- package/icons/arrowup/index.js +12 -1
- package/icons/arrowup/index.min.js +1 -1
- package/icons/ban/index.cjs.js +12 -1
- package/icons/ban/index.cjs.min.js +1 -1
- package/icons/ban/index.esm.js +12 -1
- package/icons/ban/index.esm.min.js +1 -1
- package/icons/ban/index.js +12 -1
- package/icons/ban/index.min.js +1 -1
- package/icons/download/index.cjs.js +12 -1
- package/icons/download/index.cjs.min.js +1 -1
- package/icons/download/index.esm.js +12 -1
- package/icons/download/index.esm.min.js +1 -1
- package/icons/download/index.js +12 -1
- package/icons/download/index.min.js +1 -1
- package/icons/exclamationtriangle/index.cjs.js +12 -1
- package/icons/exclamationtriangle/index.cjs.min.js +1 -1
- package/icons/exclamationtriangle/index.esm.js +12 -1
- package/icons/exclamationtriangle/index.esm.min.js +1 -1
- package/icons/exclamationtriangle/index.js +12 -1
- package/icons/exclamationtriangle/index.min.js +1 -1
- package/icons/eyeslash/index.cjs.js +12 -1
- package/icons/eyeslash/index.cjs.min.js +1 -1
- package/icons/eyeslash/index.esm.js +12 -1
- package/icons/eyeslash/index.esm.min.js +1 -1
- package/icons/eyeslash/index.js +12 -1
- package/icons/eyeslash/index.min.js +1 -1
- package/icons/filter/index.cjs.js +12 -1
- package/icons/filter/index.cjs.min.js +1 -1
- package/icons/filter/index.esm.js +12 -1
- package/icons/filter/index.esm.min.js +1 -1
- package/icons/filter/index.js +12 -1
- package/icons/filter/index.min.js +1 -1
- package/icons/filterslash/index.cjs.js +12 -1
- package/icons/filterslash/index.cjs.min.js +1 -1
- package/icons/filterslash/index.esm.js +12 -1
- package/icons/filterslash/index.esm.min.js +1 -1
- package/icons/filterslash/index.js +12 -1
- package/icons/filterslash/index.min.js +1 -1
- package/icons/infocircle/index.cjs.js +12 -1
- package/icons/infocircle/index.cjs.min.js +1 -1
- package/icons/infocircle/index.esm.js +12 -1
- package/icons/infocircle/index.esm.min.js +1 -1
- package/icons/infocircle/index.js +12 -1
- package/icons/infocircle/index.min.js +1 -1
- package/icons/pencil/index.cjs.js +12 -1
- package/icons/pencil/index.cjs.min.js +1 -1
- package/icons/pencil/index.esm.js +12 -1
- package/icons/pencil/index.esm.min.js +1 -1
- package/icons/pencil/index.js +12 -1
- package/icons/pencil/index.min.js +1 -1
- package/icons/plus/index.cjs.js +12 -1
- package/icons/plus/index.cjs.min.js +1 -1
- package/icons/plus/index.esm.js +12 -1
- package/icons/plus/index.esm.min.js +1 -1
- package/icons/plus/index.js +12 -1
- package/icons/plus/index.min.js +1 -1
- package/icons/refresh/index.cjs.js +12 -1
- package/icons/refresh/index.cjs.min.js +1 -1
- package/icons/refresh/index.esm.js +12 -1
- package/icons/refresh/index.esm.min.js +1 -1
- package/icons/refresh/index.js +12 -1
- package/icons/refresh/index.min.js +1 -1
- package/icons/search/index.cjs.js +12 -1
- package/icons/search/index.cjs.min.js +1 -1
- package/icons/search/index.esm.js +12 -1
- package/icons/search/index.esm.min.js +1 -1
- package/icons/search/index.js +12 -1
- package/icons/search/index.min.js +1 -1
- package/icons/searchminus/index.cjs.js +12 -1
- package/icons/searchminus/index.cjs.min.js +1 -1
- package/icons/searchminus/index.esm.js +12 -1
- package/icons/searchminus/index.esm.min.js +1 -1
- package/icons/searchminus/index.js +12 -1
- package/icons/searchminus/index.min.js +1 -1
- package/icons/searchplus/index.cjs.js +12 -1
- package/icons/searchplus/index.cjs.min.js +1 -1
- package/icons/searchplus/index.esm.js +12 -1
- package/icons/searchplus/index.esm.min.js +1 -1
- package/icons/searchplus/index.js +12 -1
- package/icons/searchplus/index.min.js +1 -1
- package/icons/sortalt/index.cjs.js +12 -1
- package/icons/sortalt/index.cjs.min.js +1 -1
- package/icons/sortalt/index.esm.js +12 -1
- package/icons/sortalt/index.esm.min.js +1 -1
- package/icons/sortalt/index.js +12 -1
- package/icons/sortalt/index.min.js +1 -1
- package/icons/sortamountdown/index.cjs.js +12 -1
- package/icons/sortamountdown/index.cjs.min.js +1 -1
- package/icons/sortamountdown/index.esm.js +12 -1
- package/icons/sortamountdown/index.esm.min.js +1 -1
- package/icons/sortamountdown/index.js +12 -1
- package/icons/sortamountdown/index.min.js +1 -1
- package/icons/sortamountupalt/index.cjs.js +12 -1
- package/icons/sortamountupalt/index.cjs.min.js +1 -1
- package/icons/sortamountupalt/index.esm.js +12 -1
- package/icons/sortamountupalt/index.esm.min.js +1 -1
- package/icons/sortamountupalt/index.js +12 -1
- package/icons/sortamountupalt/index.min.js +1 -1
- package/icons/spinner/index.cjs.js +12 -1
- package/icons/spinner/index.cjs.min.js +1 -1
- package/icons/spinner/index.esm.js +12 -1
- package/icons/spinner/index.esm.min.js +1 -1
- package/icons/spinner/index.js +12 -1
- package/icons/spinner/index.min.js +1 -1
- package/icons/star/index.cjs.js +12 -1
- package/icons/star/index.cjs.min.js +1 -1
- package/icons/star/index.esm.js +12 -1
- package/icons/star/index.esm.min.js +1 -1
- package/icons/star/index.js +12 -1
- package/icons/star/index.min.js +1 -1
- package/icons/starfill/index.cjs.js +12 -1
- package/icons/starfill/index.cjs.min.js +1 -1
- package/icons/starfill/index.esm.js +12 -1
- package/icons/starfill/index.esm.min.js +1 -1
- package/icons/starfill/index.js +12 -1
- package/icons/starfill/index.min.js +1 -1
- package/icons/thlarge/index.cjs.js +12 -1
- package/icons/thlarge/index.cjs.min.js +1 -1
- package/icons/thlarge/index.esm.js +12 -1
- package/icons/thlarge/index.esm.min.js +1 -1
- package/icons/thlarge/index.js +12 -1
- package/icons/thlarge/index.min.js +1 -1
- package/icons/timescircle/index.cjs.js +12 -1
- package/icons/timescircle/index.cjs.min.js +1 -1
- package/icons/timescircle/index.esm.js +12 -1
- package/icons/timescircle/index.esm.min.js +1 -1
- package/icons/timescircle/index.js +12 -1
- package/icons/timescircle/index.min.js +1 -1
- package/icons/trash/index.cjs.js +12 -1
- package/icons/trash/index.cjs.min.js +1 -1
- package/icons/trash/index.esm.js +12 -1
- package/icons/trash/index.esm.min.js +1 -1
- package/icons/trash/index.js +12 -1
- package/icons/trash/index.min.js +1 -1
- package/icons/undo/index.cjs.js +12 -1
- package/icons/undo/index.cjs.min.js +1 -1
- package/icons/undo/index.esm.js +12 -1
- package/icons/undo/index.esm.min.js +1 -1
- package/icons/undo/index.js +12 -1
- package/icons/undo/index.min.js +1 -1
- package/icons/upload/index.cjs.js +12 -1
- package/icons/upload/index.cjs.min.js +1 -1
- package/icons/upload/index.esm.js +12 -1
- package/icons/upload/index.esm.min.js +1 -1
- package/icons/upload/index.js +12 -1
- package/icons/upload/index.min.js +1 -1
- package/icons/windowmaximize/index.cjs.js +12 -1
- package/icons/windowmaximize/index.cjs.min.js +1 -1
- package/icons/windowmaximize/index.esm.js +12 -1
- package/icons/windowmaximize/index.esm.min.js +1 -1
- package/icons/windowmaximize/index.js +12 -1
- package/icons/windowmaximize/index.min.js +1 -1
- package/icons/windowminimize/index.cjs.js +12 -1
- package/icons/windowminimize/index.cjs.min.js +1 -1
- package/icons/windowminimize/index.esm.js +12 -1
- package/icons/windowminimize/index.esm.min.js +1 -1
- package/icons/windowminimize/index.js +12 -1
- package/icons/windowminimize/index.min.js +1 -1
- package/image/image.cjs.js +71 -16
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +71 -16
- package/image/image.esm.min.js +1 -1
- package/image/image.js +71 -16
- package/image/image.min.js +1 -1
- package/megamenu/megamenu.cjs.js +787 -168
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.d.ts +14 -0
- package/megamenu/megamenu.esm.js +790 -171
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +787 -168
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +10 -9
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +11 -10
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +10 -9
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +214 -68
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +14 -0
- package/menu/menu.esm.js +214 -68
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +214 -68
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +714 -179
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.d.ts +18 -0
- package/menubar/menubar.esm.js +717 -182
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +714 -179
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +2 -1
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +2 -1
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -1
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +4 -2
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +4 -2
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +4 -2
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +11 -5
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +11 -5
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +12 -7
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/orderlist.cjs.js +259 -104
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +8 -0
- package/orderlist/orderlist.esm.js +260 -105
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +259 -104
- package/orderlist/orderlist.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +4 -2
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +4 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +4 -2
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/panel/panel.cjs.js +22 -19
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +22 -19
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +22 -19
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +775 -196
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +15 -0
- package/panelmenu/panelmenu.esm.js +776 -197
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +775 -196
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +5 -4
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +5 -4
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +5 -4
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +1 -1
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +1 -1
- package/password/password.esm.min.js +1 -1
- package/password/password.js +1 -1
- package/password/password.min.js +1 -1
- package/primereact.all.cjs.js +9489 -5244
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +9489 -5244
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +9489 -5244
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +3 -2
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +3 -2
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +3 -2
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +844 -789
- package/resources/themes/arya-green/theme.css +844 -789
- package/resources/themes/arya-orange/theme.css +844 -789
- package/resources/themes/arya-purple/theme.css +844 -789
- package/resources/themes/bootstrap4-dark-blue/theme.css +654 -600
- package/resources/themes/bootstrap4-dark-purple/theme.css +654 -600
- package/resources/themes/bootstrap4-light-blue/theme.css +658 -604
- package/resources/themes/bootstrap4-light-purple/theme.css +658 -604
- package/resources/themes/fluent-light/theme.css +661 -622
- package/resources/themes/lara-dark-amber/theme.css +665 -625
- package/resources/themes/lara-dark-blue/theme.css +665 -625
- package/resources/themes/lara-dark-cyan/theme.css +665 -625
- package/resources/themes/lara-dark-green/theme.css +665 -625
- package/resources/themes/lara-dark-indigo/theme.css +665 -625
- package/resources/themes/lara-dark-pink/theme.css +665 -625
- package/resources/themes/lara-dark-purple/theme.css +665 -625
- package/resources/themes/lara-dark-teal/theme.css +665 -625
- package/resources/themes/lara-light-amber/theme.css +758 -716
- package/resources/themes/lara-light-blue/theme.css +992 -950
- package/resources/themes/lara-light-cyan/theme.css +758 -716
- package/resources/themes/lara-light-green/theme.css +797 -755
- package/resources/themes/lara-light-indigo/theme.css +1008 -966
- package/resources/themes/lara-light-pink/theme.css +758 -716
- package/resources/themes/lara-light-purple/theme.css +1008 -966
- package/resources/themes/lara-light-teal/theme.css +758 -716
- package/resources/themes/luna-amber/theme.css +931 -877
- package/resources/themes/luna-blue/theme.css +931 -877
- package/resources/themes/luna-green/theme.css +931 -877
- package/resources/themes/luna-pink/theme.css +931 -877
- package/resources/themes/md-dark-deeppurple/theme.css +900 -941
- package/resources/themes/md-dark-indigo/theme.css +905 -946
- package/resources/themes/md-light-deeppurple/theme.css +862 -903
- package/resources/themes/md-light-indigo/theme.css +862 -903
- package/resources/themes/mdc-dark-deeppurple/theme.css +900 -941
- package/resources/themes/mdc-dark-indigo/theme.css +905 -946
- package/resources/themes/mdc-light-deeppurple/theme.css +862 -903
- package/resources/themes/mdc-light-indigo/theme.css +862 -903
- package/resources/themes/mira/theme.css +1546 -1525
- package/resources/themes/nano/theme.css +696 -639
- package/resources/themes/nova/theme.css +690 -637
- package/resources/themes/nova-accent/theme.css +692 -636
- package/resources/themes/nova-alt/theme.css +690 -637
- package/resources/themes/rhea/theme.css +865 -809
- package/resources/themes/saga-blue/theme.css +883 -828
- package/resources/themes/saga-green/theme.css +883 -828
- package/resources/themes/saga-orange/theme.css +883 -828
- package/resources/themes/saga-purple/theme.css +883 -828
- package/resources/themes/soho-dark/theme.css +684 -635
- package/resources/themes/soho-light/theme.css +672 -625
- package/resources/themes/tailwind-light/theme.css +1354 -1299
- package/resources/themes/vela-blue/theme.css +852 -797
- package/resources/themes/vela-green/theme.css +852 -797
- package/resources/themes/vela-orange/theme.css +852 -797
- package/resources/themes/vela-purple/theme.css +852 -797
- package/resources/themes/viva-dark/theme.css +647 -613
- package/resources/themes/viva-light/theme.css +728 -694
- package/ripple/ripple.cjs.js +65 -2
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +65 -2
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +65 -2
- package/ripple/ripple.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +183 -3
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +184 -4
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +183 -3
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/sidebar/sidebar.cjs.js +58 -45
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +23 -1
- package/sidebar/sidebar.esm.js +58 -45
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +58 -45
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +4 -2
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +4 -2
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +4 -2
- 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 +264 -29
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +266 -31
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +264 -29
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +1048 -267
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +4 -4
- package/splitbutton/splitbutton.esm.js +1049 -268
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +1048 -269
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +103 -15
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.d.ts +5 -0
- package/splitter/splitter.esm.js +103 -15
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +103 -15
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +99 -13
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +100 -14
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +99 -13
- package/steps/steps.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +104 -10
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +104 -10
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +104 -10
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +106 -12
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +106 -12
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +106 -12
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +752 -274
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +10 -0
- package/tieredmenu/tieredmenu.esm.js +754 -276
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +752 -274
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/toast.cjs.js +6 -1
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +35 -1
- package/toast/toast.esm.js +6 -1
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +6 -1
- package/toast/toast.min.js +1 -1
- package/tree/tree.cjs.js +51 -54
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +51 -54
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +51 -54
- package/tree/tree.min.js +1 -1
- package/treetable/treetable.cjs.js +11 -28
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +11 -28
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +11 -28
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +12 -1
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +12 -1
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +12 -1
- package/utils/utils.min.js +1 -1
- package/web-types.json +267 -5
package/dialog/dialog.esm.js
CHANGED
|
@@ -26,6 +26,16 @@ function _extends() {
|
|
|
26
26
|
return _extends.apply(this, arguments);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
function _typeof(o) {
|
|
30
|
+
"@babel/helpers - typeof";
|
|
31
|
+
|
|
32
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
33
|
+
return typeof o;
|
|
34
|
+
} : function (o) {
|
|
35
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
36
|
+
}, _typeof(o);
|
|
37
|
+
}
|
|
38
|
+
|
|
29
39
|
function _arrayLikeToArray(arr, len) {
|
|
30
40
|
if (len == null || len > arr.length) len = arr.length;
|
|
31
41
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
@@ -57,16 +67,6 @@ function _toConsumableArray(arr) {
|
|
|
57
67
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
58
68
|
}
|
|
59
69
|
|
|
60
|
-
function _typeof(o) {
|
|
61
|
-
"@babel/helpers - typeof";
|
|
62
|
-
|
|
63
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
64
|
-
return typeof o;
|
|
65
|
-
} : function (o) {
|
|
66
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
67
|
-
}, _typeof(o);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
70
|
function _toPrimitive(input, hint) {
|
|
71
71
|
if (_typeof(input) !== "object" || input === null) return input;
|
|
72
72
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -165,6 +165,7 @@ var useEventListener = function useEventListener(_ref) {
|
|
|
165
165
|
when = _ref$when === void 0 ? true : _ref$when;
|
|
166
166
|
var targetRef = React.useRef(null);
|
|
167
167
|
var listenerRef = React.useRef(null);
|
|
168
|
+
var prevListener = usePrevious(listener);
|
|
168
169
|
var prevOptions = usePrevious(options);
|
|
169
170
|
var bind = function bind() {
|
|
170
171
|
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -194,11 +195,12 @@ var useEventListener = function useEventListener(_ref) {
|
|
|
194
195
|
}
|
|
195
196
|
}, [target, when]);
|
|
196
197
|
React.useEffect(function () {
|
|
197
|
-
|
|
198
|
+
// to properly compare functions we can implicitly converting the function to it's body's text as a String
|
|
199
|
+
if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
|
|
198
200
|
unbind();
|
|
199
201
|
when && bind();
|
|
200
202
|
}
|
|
201
|
-
}, [listener, options]);
|
|
203
|
+
}, [listener, options, when]);
|
|
202
204
|
useUnmountEffect(function () {
|
|
203
205
|
unbind();
|
|
204
206
|
});
|
|
@@ -253,10 +255,13 @@ var classes = {
|
|
|
253
255
|
var props = _ref2.props;
|
|
254
256
|
return classNames('p-dialog-content', props.contentClassName);
|
|
255
257
|
},
|
|
256
|
-
footer:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
footer: function footer(_ref3) {
|
|
259
|
+
var props = _ref3.props;
|
|
260
|
+
return classNames('p-dialog-footer', props.footerClassName);
|
|
261
|
+
},
|
|
262
|
+
mask: function mask(_ref4) {
|
|
263
|
+
var props = _ref4.props,
|
|
264
|
+
maskVisibleState = _ref4.maskVisibleState;
|
|
260
265
|
var positions = ['center', 'left', 'right', 'top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right'];
|
|
261
266
|
var pos = positions.find(function (item) {
|
|
262
267
|
return item === props.position || item.replace('-', '') === props.position;
|
|
@@ -268,10 +273,10 @@ var classes = {
|
|
|
268
273
|
'p-dialog-resizable': props.resizable
|
|
269
274
|
}, props.maskClassName);
|
|
270
275
|
},
|
|
271
|
-
root: function root(
|
|
272
|
-
var props =
|
|
273
|
-
maximized =
|
|
274
|
-
context =
|
|
276
|
+
root: function root(_ref5) {
|
|
277
|
+
var props = _ref5.props,
|
|
278
|
+
maximized = _ref5.maximized,
|
|
279
|
+
context = _ref5.context;
|
|
275
280
|
return classNames('p-dialog p-component', props.className, {
|
|
276
281
|
'p-dialog-rtl': props.rtl,
|
|
277
282
|
'p-dialog-maximized': maximized,
|
|
@@ -282,10 +287,10 @@ var classes = {
|
|
|
282
287
|
},
|
|
283
288
|
transition: 'p-dialog'
|
|
284
289
|
};
|
|
285
|
-
var styles = "\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n";
|
|
290
|
+
var styles = "\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n";
|
|
286
291
|
var inlineStyles = {
|
|
287
|
-
mask: function mask(
|
|
288
|
-
var props =
|
|
292
|
+
mask: function mask(_ref6) {
|
|
293
|
+
var props = _ref6.props;
|
|
289
294
|
return _objectSpread$1({
|
|
290
295
|
position: 'fixed',
|
|
291
296
|
height: '100%',
|
|
@@ -318,6 +323,7 @@ var DialogBase = ComponentBase.extend({
|
|
|
318
323
|
draggable: true,
|
|
319
324
|
focusOnShow: true,
|
|
320
325
|
footer: null,
|
|
326
|
+
footerClassName: null,
|
|
321
327
|
header: null,
|
|
322
328
|
headerClassName: null,
|
|
323
329
|
headerStyle: null,
|
|
@@ -488,7 +494,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
488
494
|
var focus = function focus() {
|
|
489
495
|
var activeElement = document.activeElement;
|
|
490
496
|
var isActiveElementInDialog = activeElement && dialogRef.current && dialogRef.current.contains(activeElement);
|
|
491
|
-
if (!isActiveElementInDialog && props.closable && props.showHeader) {
|
|
497
|
+
if (!isActiveElementInDialog && props.closable && props.showHeader && closeRef.current) {
|
|
492
498
|
closeRef.current.focus();
|
|
493
499
|
}
|
|
494
500
|
};
|
|
@@ -700,8 +706,8 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
700
706
|
}
|
|
701
707
|
};
|
|
702
708
|
var updateGlobalDialogsRegistry = function updateGlobalDialogsRegistry(isMounted) {
|
|
703
|
-
// Update current dialog info in global registry if it is mounted:
|
|
704
|
-
if (isMounted) {
|
|
709
|
+
// Update current dialog info in global registry if it is mounted :
|
|
710
|
+
if (isMounted && visibleState) {
|
|
705
711
|
var newParam = {
|
|
706
712
|
id: idState,
|
|
707
713
|
hasBlockScroll: shouldBlockScroll
|
|
@@ -915,11 +921,41 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
915
921
|
}
|
|
916
922
|
return null;
|
|
917
923
|
};
|
|
918
|
-
var
|
|
924
|
+
var createTemplateElement = function createTemplateElement(_ref) {
|
|
925
|
+
var _props$children;
|
|
926
|
+
var maskProps = _ref.maskProps,
|
|
927
|
+
rootProps = _ref.rootProps,
|
|
928
|
+
transitionProps = _ref.transitionProps;
|
|
929
|
+
var messageProps = {
|
|
930
|
+
header: props.header,
|
|
931
|
+
content: props.message,
|
|
932
|
+
message: props === null || props === void 0 || (_props$children = props.children) === null || _props$children === void 0 || (_props$children = _props$children[1]) === null || _props$children === void 0 || (_props$children = _props$children.props) === null || _props$children === void 0 ? void 0 : _props$children.children
|
|
933
|
+
};
|
|
934
|
+
var templateElementProps = {
|
|
935
|
+
headerRef: headerRef,
|
|
936
|
+
contentRef: contentRef,
|
|
937
|
+
footerRef: footerRef,
|
|
938
|
+
closeRef: closeRef,
|
|
939
|
+
hide: onClose,
|
|
940
|
+
message: messageProps
|
|
941
|
+
};
|
|
942
|
+
return /*#__PURE__*/React.createElement("div", maskProps, /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
943
|
+
nodeRef: dialogRef
|
|
944
|
+
}, transitionProps), /*#__PURE__*/React.createElement("div", rootProps, ObjectUtils.getJSXElement(inProps.content, templateElementProps))));
|
|
945
|
+
};
|
|
946
|
+
var createElement = function createElement(_ref2) {
|
|
947
|
+
var maskProps = _ref2.maskProps,
|
|
948
|
+
rootProps = _ref2.rootProps,
|
|
949
|
+
transitionProps = _ref2.transitionProps;
|
|
919
950
|
var header = createHeader();
|
|
920
951
|
var content = createContent();
|
|
921
952
|
var footer = createFooter();
|
|
922
953
|
var resizer = createResizer();
|
|
954
|
+
return /*#__PURE__*/React.createElement("div", maskProps, /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
955
|
+
nodeRef: dialogRef
|
|
956
|
+
}, transitionProps), /*#__PURE__*/React.createElement("div", rootProps, header, content, footer, resizer)));
|
|
957
|
+
};
|
|
958
|
+
var createDialog = function createDialog() {
|
|
923
959
|
var headerId = idState + '_header';
|
|
924
960
|
var contentId = idState + '_content';
|
|
925
961
|
var transitionTimeout = {
|
|
@@ -959,17 +995,29 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
959
995
|
onExiting: onExiting,
|
|
960
996
|
onExited: onExited
|
|
961
997
|
}, ptm('transition'));
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
998
|
+
if (inProps !== null && inProps !== void 0 && inProps.content) {
|
|
999
|
+
var templateElement = createTemplateElement({
|
|
1000
|
+
maskProps: maskProps,
|
|
1001
|
+
rootProps: rootProps,
|
|
1002
|
+
transitionProps: transitionProps
|
|
1003
|
+
});
|
|
1004
|
+
return /*#__PURE__*/React.createElement(Portal, {
|
|
1005
|
+
element: templateElement,
|
|
1006
|
+
appendTo: props.appendTo,
|
|
1007
|
+
visible: true
|
|
1008
|
+
});
|
|
1009
|
+
} else {
|
|
1010
|
+
var element = createElement({
|
|
1011
|
+
maskProps: maskProps,
|
|
1012
|
+
rootProps: rootProps,
|
|
1013
|
+
transitionProps: transitionProps
|
|
1014
|
+
});
|
|
1015
|
+
return /*#__PURE__*/React.createElement(Portal, {
|
|
1016
|
+
element: element,
|
|
1017
|
+
appendTo: props.appendTo,
|
|
1018
|
+
visible: true
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
973
1021
|
};
|
|
974
1022
|
return maskVisibleState && createDialog();
|
|
975
1023
|
});
|
package/dialog/dialog.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{DomHandler as t,ObjectUtils as n,classNames as r,UniqueComponentId as o,ZIndexUtils as i,mergeProps as a,IconUtils as l}from"primereact/utils";import c,{PrimeReactContext as u,localeOption as s}from"primereact/api";import{ComponentBase as p,useHandleStyle as d}from"primereact/componentbase";import{CSSTransition as m}from"primereact/csstransition";import{useEventListener as g,useMountEffect as f,useUpdateEffect as b,useUnmountEffect as y}from"primereact/hooks";import{TimesIcon as h}from"primereact/icons/times";import{WindowMaximizeIcon as v}from"primereact/icons/windowmaximize";import{WindowMinimizeIcon as x}from"primereact/icons/windowminimize";import{Portal as w}from"primereact/portal";import{Ripple as E}from"primereact/ripple";function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e){if(Array.isArray(e))return z(e)}function k(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function P(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function j(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function C(e){var t=j(e,"string");return"symbol"===I(t)?t:String(t)}function R(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){if(Array.isArray(e))return e}function B(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(e,t){return N(e)||B(e,t)||P(e,t)||T()}var X=function(r){var o,i,a,l=r.target,c=void 0===l?"document":l,u=r.type,s=r.listener,p=r.options,d=r.when,m=void 0===d||d,g=e.useRef(null),f=e.useRef(null),b=(o=p,i=e.useRef(void 0),e.useEffect((function(){i.current=o})),i.current),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.isNotEmpty(e.target)&&(h(),(e.when||m)&&(g.current=t.getTargetElement(e.target))),!f.current&&g.current&&(f.current=function(e){return s&&s(e)},g.current.addEventListener(u,f.current,p))},h=function(){f.current&&(g.current.removeEventListener(u,f.current,p),f.current=null)};return e.useEffect((function(){m?g.current=t.getTargetElement(c):(h(),g.current=null)}),[c,m]),e.useEffect((function(){!f.current||f.current===s&&b===p||(h(),m&&y())}),[s,p]),a=function(){h()},e.useEffect((function(){return a}),[]),[y,h]},A=function(t,n,r){var o=M(X({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),r(e))}}),2),i=o[0],a=o[1];return e.useEffect((function(){if(n&&t.current)return i(),function(){a()}})),[t,r]};function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _=p.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return r("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return r("p-dialog-content",e.props.contentClassName)},footer:"p-dialog-footer",mask:function(e){var t=e.props,n=e.maskVisibleState,o=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return r("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.props,n=e.maximized,o=e.context;return r("p-dialog p-component",t.className,{"p-dialog-rtl":t.rtl,"p-dialog-maximized":n,"p-dialog-default":!n,"p-input-filled":o&&"filled"===o.inputStyle||"filled"===c.inputStyle,"p-ripple-disabled":o&&!1===o.ripple||!1===c.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return Y({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=e.forwardRef((function(r,p){var z=e.useContext(u),I=_.getProps(r,z),j=I.id?I.id:o(),C=M(e.useState(j),2),R=C[0],N=M(e.useState(!1),2),B=N[0],T=N[1],X=M(e.useState(!1),2),H=X[0],Y=X[1],L=M(e.useState(I.maximized),2),F=L[0],J=L[1],U=e.useRef(null),Z=e.useRef(null),W=e.useRef(null),$=e.useRef(null),K=e.useRef(null),q=e.useRef(null),G=e.useRef(null),Q=e.useRef(!1),ee=e.useRef(!1),te=e.useRef(null),ne=e.useRef(null),re=e.useRef(null),oe=e.useRef(j),ie=e.useRef(null),ae=I.onMaximize?I.maximized:F,le=H&&(I.blockScroll||I.maximizable&&ae),ce=_.setMetaData(V(V({props:I},I.__parentMetadata),{},{state:{id:R,maximized:ae,containerVisible:B}})),ue=ce.ptm,se=ce.cx,pe=ce.sx;d(_.css.styles,ce.isUnstyled,{name:"dialog"}),A(Z,I.closable&&I.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;Pe(e),n.splice(r-1,1)}}));var de=M(g({type:"keydown",listener:function(e){return Ce(e)}}),2),me=de[0],ge=de[1],fe=M(g({type:"mousemove",target:function(){return window.document},listener:function(e){return Xe(e)}}),2),be=fe[0],ye=fe[1],he=M(g({type:"mouseup",target:function(){return window.document},listener:function(e){return Ae(e)}}),2),ve=he[0],xe=he[1],we=M(g({type:"mousemove",target:function(){return window.document},listener:function(e){return Ne(e)}}),2),Ee=we[0],Se=we[1],ze=M(g({type:"mouseup",target:function(){return window.document},listener:function(e){return Be(e)}}),2),Oe=ze[0],ke=ze[1],Pe=function(e){I.onHide(),e.preventDefault()},De=function(e){W.current=e.target,I.onPointerDown&&I.onPointerDown(e)},Ie=function(e){I.dismissableMask&&I.modal&&Z.current===e.target&&!W.current&&Pe(e),I.onMaskClick&&I.onMaskClick(e),W.current=null},je=function(e){I.onMaximize?I.onMaximize({originalEvent:e,maximized:!ae}):J((function(e){return!e})),e.preventDefault()},Ce=function(e){var n=e.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,o=r.length,i=r[o-1]?r[o-1].id:void 0;if(i===R){var a=document.getElementById(i);if("Tab"===e.key){e.preventDefault();var l=t.getFocusableElements(a);if(l&&l.length>0)if(document.activeElement){var c=l.indexOf(document.activeElement);e.shiftKey?-1===c||0===c?l[l.length-1].focus():l[c-1].focus():-1===c||c===l.length-1?l[0].focus():l[c+1].focus()}else l[0].focus()}}}},Re=function(e){t.hasClass(e.target,"p-dialog-header-icon")||t.hasClass(e.target.parentElement,"p-dialog-header-icon")||I.draggable&&(Q.current=!0,te.current=e.pageX,ne.current=e.pageY,U.current.style.margin="0",t.addClass(document.body,"p-unselectable-text"),I.onDragStart&&I.onDragStart(e))},Ne=function(e){if(Q.current){var n=t.getOuterWidth(U.current),r=t.getOuterHeight(U.current),o=e.pageX-te.current,i=e.pageY-ne.current,a=U.current.getBoundingClientRect(),l=a.left+o,c=a.top+i,u=t.getViewport(),s=getComputedStyle(U.current),p=parseFloat(s.marginLeft),d=parseFloat(s.marginTop);U.current.style.position="fixed",I.keepInViewport?(l>=I.minX&&l+n<u.width&&(te.current=e.pageX,U.current.style.left=l-p+"px"),c>=I.minY&&c+r<u.height&&(ne.current=e.pageY,U.current.style.top=c-d+"px")):(te.current=e.pageX,U.current.style.left=l-p+"px",ne.current=e.pageY,U.current.style.top=c-d+"px"),I.onDrag&&I.onDrag(e)}},Be=function(e){Q.current&&(Q.current=!1,t.removeClass(document.body,"p-unselectable-text"),I.onDragEnd&&I.onDragEnd(e))},Te=function(e){I.resizable&&(ee.current=!0,te.current=e.pageX,ne.current=e.pageY,t.addClass(document.body,"p-unselectable-text"),I.onResizeStart&&I.onResizeStart(e))},Me=function(e,n,r){!r&&(r=t.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(r[n]/100):o},Xe=function(e){if(ee.current){var n=e.pageX-te.current,r=e.pageY-ne.current,o=t.getOuterWidth(U.current),i=t.getOuterHeight(U.current),a=U.current.getBoundingClientRect(),l=t.getViewport(),c=!parseInt(U.current.style.top)||!parseInt(U.current.style.left),u=Me(U.current.style.minWidth,"width",l),s=Me(U.current.style.minHeight,"height",l),p=o+n,d=i+r;c&&(p+=n,d+=r),(!u||p>u)&&a.left+p<l.width&&(U.current.style.width=p+"px"),(!s||d>s)&&a.top+d<l.height&&(U.current.style.height=d+"px"),te.current=e.pageX,ne.current=e.pageY,I.onResize&&I.onResize(e)}},Ae=function(e){ee.current&&(ee.current=!1,t.removeClass(document.body,"p-unselectable-text"),I.onResizeEnd&&I.onResizeEnd(e))},He=function(){U.current.style.position="",U.current.style.left="",U.current.style.top="",U.current.style.margin=""},Ye=function(){U.current.setAttribute(oe.current,"")},_e=function(){var e;I.onShow&&I.onShow(),I.focusOnShow&&!((e=document.activeElement)&&U.current&&U.current.contains(e))&&I.closable&&I.showHeader&&G.current.focus(),Fe()},Le=function(){I.modal&&t.addClass(Z.current,"p-component-overlay-leave")},Ve=function(){Q.current=!1,i.clear(Z.current),T(!1),Je(),t.focus(ie.current),ie.current=null},Fe=function(){Ze(),Ue(!0)},Je=function(){We(),Ue(!1)},Ue=function(e){if(e){var n={id:R,hasBlockScroll:le};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===R}));document.primeDialogParams=-1===r?[].concat(O(o=document.primeDialogParams)||k(o)||P(o)||D(),[n]):document.primeDialogParams.toSpliced(r,1,n)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==R}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?t.blockBodyScroll():t.unblockBodyScroll()},Ze=function(){I.draggable&&(Ee(),Oe()),I.resizable&&(be(),ve()),me()},We=function(){Se(),ke(),ye(),xe(),ge()},$e=function(){re.current=t.createInlineStyle(z&&z.nonce||c.nonce);var e="";for(var n in I.breakpoints)e+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(oe.current,"] {\n width: ").concat(I.breakpoints[n],";\n }\n }\n ");re.current.innerHTML=e};f((function(){I.visible&&T(!0),I.breakpoints&&$e()})),b((function(){I.visible&&!B&&T(!0),I.visible!==H&&B&&Y(I.visible),I.visible&&(ie.current=document.activeElement)}),[I.visible,B]),b((function(){B&&(i.set("modal",Z.current,z&&z.autoZIndex||c.autoZIndex,I.baseZIndex||z&&z.zIndex.modal||c.zIndex.modal),Y(!0))}),[B]),b((function(){Ue(!0)}),[le]),y((function(){Je(),t.removeInlineStyle(re.current),i.clear(Z.current)})),e.useImperativeHandle(p,(function(){return{props:I,resetPosition:He,getElement:function(){return U.current},getMask:function(){return Z.current},getContent:function(){return $.current},getHeader:function(){return K.current},getFooter:function(){return q.current},getCloseButton:function(){return G.current}}}));var Ke,qe,Ge,Qe,et,tt,nt,rt,ot,it,at,lt,ct=function(){if(I.closable){var t=I.ariaCloseIconLabel||s("close"),n=a({className:se("closeButtonIcon"),"aria-hidden":!0},ue("closeButtonIcon")),r=l.getJSXIcon(I.closeIcon||e.createElement(h,n),V({},n),{props:I}),o=a({ref:G,type:"button",className:se("closeButton"),"aria-label":t,onClick:Pe},ue("closeButton"));return e.createElement("button",o,r,e.createElement(E,null))}return null},ut=function(){var t=a({className:se("maximizableIcon")},ue("maximizableIcon")),n=l.getJSXIcon(ae?I.minimizeIcon||e.createElement(x,t):I.maximizeIcon||e.createElement(v,t),t,{props:I});if(I.maximizable){var r=a({type:"button",className:se("maximizableButton"),onClick:je},ue("maximizableButton"));return e.createElement("button",r,n,e.createElement(E,null))}return null},st=function(){if(I.showHeader){var t=ct(),r=ut(),o=n.getJSXElement(I.icons,I),i=n.getJSXElement(I.header,I),l=R+"_header",c=a({ref:K,style:I.headerStyle,className:se("header"),onMouseDown:Re},ue("header")),u=a({id:l,className:se("headerTitle")},ue("headerTitle")),s=a({className:se("headerIcons")},ue("headerIcons"));return e.createElement("div",c,e.createElement("div",u,i),e.createElement("div",s,o,r,t))}return null},pt=function(){var t=n.getJSXElement(I.footer,I),r=a({ref:q,className:se("footer")},ue("footer"));return t&&e.createElement("div",r,t)};return B&&(qe=st(),Ke=a({id:R+"_content",ref:$,style:I.contentStyle,className:se("content")},ue("content")),Ge=e.createElement("div",Ke,I.children),Qe=pt(),et=I.resizable?e.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Te}):null,tt=R+"_header",nt=R+"_content",rt={enter:"center"===I.position?150:300,exit:"center"===I.position?150:300},ot=a({ref:Z,style:pe("mask"),className:se("mask"),onPointerUp:Ie},ue("mask")),it=a({ref:U,id:R,className:se("root",{props:I,maximized:ae,context:z}),style:I.style,onClick:I.onClick,role:"dialog","aria-labelledby":tt,"aria-describedby":nt,"aria-modal":I.modal,onPointerDown:De},_.getOtherProps(I),ue("root")),at=a({classNames:se("transition"),timeout:rt,in:H,options:I.transitionOptions,unmountOnExit:!0,onEnter:Ye,onEntered:_e,onExiting:Le,onExited:Ve},ue("transition")),lt=e.createElement("div",ot,e.createElement(m,S({nodeRef:U},at),e.createElement("div",it,qe,Ge,Qe,et))),e.createElement(w,{element:lt,appendTo:I.appendTo,visible:!0}))}));F.displayName="Dialog";export{F as Dialog};
|
|
1
|
+
import*as e from"react";import{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};
|
package/dialog/dialog.js
CHANGED
|
@@ -40,6 +40,16 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
40
40
|
return _extends.apply(this, arguments);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
function _typeof(o) {
|
|
44
|
+
"@babel/helpers - typeof";
|
|
45
|
+
|
|
46
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
47
|
+
return typeof o;
|
|
48
|
+
} : function (o) {
|
|
49
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
50
|
+
}, _typeof(o);
|
|
51
|
+
}
|
|
52
|
+
|
|
43
53
|
function _arrayLikeToArray(arr, len) {
|
|
44
54
|
if (len == null || len > arr.length) len = arr.length;
|
|
45
55
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
@@ -71,16 +81,6 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
71
81
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
72
82
|
}
|
|
73
83
|
|
|
74
|
-
function _typeof(o) {
|
|
75
|
-
"@babel/helpers - typeof";
|
|
76
|
-
|
|
77
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
78
|
-
return typeof o;
|
|
79
|
-
} : function (o) {
|
|
80
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
81
|
-
}, _typeof(o);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
84
|
function _toPrimitive(input, hint) {
|
|
85
85
|
if (_typeof(input) !== "object" || input === null) return input;
|
|
86
86
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -179,6 +179,7 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
179
179
|
when = _ref$when === void 0 ? true : _ref$when;
|
|
180
180
|
var targetRef = React__namespace.useRef(null);
|
|
181
181
|
var listenerRef = React__namespace.useRef(null);
|
|
182
|
+
var prevListener = usePrevious(listener);
|
|
182
183
|
var prevOptions = usePrevious(options);
|
|
183
184
|
var bind = function bind() {
|
|
184
185
|
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -208,11 +209,12 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
208
209
|
}
|
|
209
210
|
}, [target, when]);
|
|
210
211
|
React__namespace.useEffect(function () {
|
|
211
|
-
|
|
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)) {
|
|
212
214
|
unbind();
|
|
213
215
|
when && bind();
|
|
214
216
|
}
|
|
215
|
-
}, [listener, options]);
|
|
217
|
+
}, [listener, options, when]);
|
|
216
218
|
useUnmountEffect(function () {
|
|
217
219
|
unbind();
|
|
218
220
|
});
|
|
@@ -267,10 +269,13 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
267
269
|
var props = _ref2.props;
|
|
268
270
|
return utils.classNames('p-dialog-content', props.contentClassName);
|
|
269
271
|
},
|
|
270
|
-
footer:
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
footer: function footer(_ref3) {
|
|
273
|
+
var props = _ref3.props;
|
|
274
|
+
return utils.classNames('p-dialog-footer', props.footerClassName);
|
|
275
|
+
},
|
|
276
|
+
mask: function mask(_ref4) {
|
|
277
|
+
var props = _ref4.props,
|
|
278
|
+
maskVisibleState = _ref4.maskVisibleState;
|
|
274
279
|
var positions = ['center', 'left', 'right', 'top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right'];
|
|
275
280
|
var pos = positions.find(function (item) {
|
|
276
281
|
return item === props.position || item.replace('-', '') === props.position;
|
|
@@ -282,10 +287,10 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
282
287
|
'p-dialog-resizable': props.resizable
|
|
283
288
|
}, props.maskClassName);
|
|
284
289
|
},
|
|
285
|
-
root: function root(
|
|
286
|
-
var props =
|
|
287
|
-
maximized =
|
|
288
|
-
context =
|
|
290
|
+
root: function root(_ref5) {
|
|
291
|
+
var props = _ref5.props,
|
|
292
|
+
maximized = _ref5.maximized,
|
|
293
|
+
context = _ref5.context;
|
|
289
294
|
return utils.classNames('p-dialog p-component', props.className, {
|
|
290
295
|
'p-dialog-rtl': props.rtl,
|
|
291
296
|
'p-dialog-maximized': maximized,
|
|
@@ -296,10 +301,10 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
296
301
|
},
|
|
297
302
|
transition: 'p-dialog'
|
|
298
303
|
};
|
|
299
|
-
var styles = "\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n";
|
|
304
|
+
var styles = "\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n";
|
|
300
305
|
var inlineStyles = {
|
|
301
|
-
mask: function mask(
|
|
302
|
-
var props =
|
|
306
|
+
mask: function mask(_ref6) {
|
|
307
|
+
var props = _ref6.props;
|
|
303
308
|
return _objectSpread$1({
|
|
304
309
|
position: 'fixed',
|
|
305
310
|
height: '100%',
|
|
@@ -332,6 +337,7 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
332
337
|
draggable: true,
|
|
333
338
|
focusOnShow: true,
|
|
334
339
|
footer: null,
|
|
340
|
+
footerClassName: null,
|
|
335
341
|
header: null,
|
|
336
342
|
headerClassName: null,
|
|
337
343
|
headerStyle: null,
|
|
@@ -502,7 +508,7 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
502
508
|
var focus = function focus() {
|
|
503
509
|
var activeElement = document.activeElement;
|
|
504
510
|
var isActiveElementInDialog = activeElement && dialogRef.current && dialogRef.current.contains(activeElement);
|
|
505
|
-
if (!isActiveElementInDialog && props.closable && props.showHeader) {
|
|
511
|
+
if (!isActiveElementInDialog && props.closable && props.showHeader && closeRef.current) {
|
|
506
512
|
closeRef.current.focus();
|
|
507
513
|
}
|
|
508
514
|
};
|
|
@@ -714,8 +720,8 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
714
720
|
}
|
|
715
721
|
};
|
|
716
722
|
var updateGlobalDialogsRegistry = function updateGlobalDialogsRegistry(isMounted) {
|
|
717
|
-
// Update current dialog info in global registry if it is mounted:
|
|
718
|
-
if (isMounted) {
|
|
723
|
+
// Update current dialog info in global registry if it is mounted :
|
|
724
|
+
if (isMounted && visibleState) {
|
|
719
725
|
var newParam = {
|
|
720
726
|
id: idState,
|
|
721
727
|
hasBlockScroll: shouldBlockScroll
|
|
@@ -929,11 +935,41 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
929
935
|
}
|
|
930
936
|
return null;
|
|
931
937
|
};
|
|
932
|
-
var
|
|
938
|
+
var createTemplateElement = function createTemplateElement(_ref) {
|
|
939
|
+
var _props$children;
|
|
940
|
+
var maskProps = _ref.maskProps,
|
|
941
|
+
rootProps = _ref.rootProps,
|
|
942
|
+
transitionProps = _ref.transitionProps;
|
|
943
|
+
var messageProps = {
|
|
944
|
+
header: props.header,
|
|
945
|
+
content: props.message,
|
|
946
|
+
message: props === null || props === void 0 || (_props$children = props.children) === null || _props$children === void 0 || (_props$children = _props$children[1]) === null || _props$children === void 0 || (_props$children = _props$children.props) === null || _props$children === void 0 ? void 0 : _props$children.children
|
|
947
|
+
};
|
|
948
|
+
var templateElementProps = {
|
|
949
|
+
headerRef: headerRef,
|
|
950
|
+
contentRef: contentRef,
|
|
951
|
+
footerRef: footerRef,
|
|
952
|
+
closeRef: closeRef,
|
|
953
|
+
hide: onClose,
|
|
954
|
+
message: messageProps
|
|
955
|
+
};
|
|
956
|
+
return /*#__PURE__*/React__namespace.createElement("div", maskProps, /*#__PURE__*/React__namespace.createElement(csstransition.CSSTransition, _extends({
|
|
957
|
+
nodeRef: dialogRef
|
|
958
|
+
}, transitionProps), /*#__PURE__*/React__namespace.createElement("div", rootProps, utils.ObjectUtils.getJSXElement(inProps.content, templateElementProps))));
|
|
959
|
+
};
|
|
960
|
+
var createElement = function createElement(_ref2) {
|
|
961
|
+
var maskProps = _ref2.maskProps,
|
|
962
|
+
rootProps = _ref2.rootProps,
|
|
963
|
+
transitionProps = _ref2.transitionProps;
|
|
933
964
|
var header = createHeader();
|
|
934
965
|
var content = createContent();
|
|
935
966
|
var footer = createFooter();
|
|
936
967
|
var resizer = createResizer();
|
|
968
|
+
return /*#__PURE__*/React__namespace.createElement("div", maskProps, /*#__PURE__*/React__namespace.createElement(csstransition.CSSTransition, _extends({
|
|
969
|
+
nodeRef: dialogRef
|
|
970
|
+
}, transitionProps), /*#__PURE__*/React__namespace.createElement("div", rootProps, header, content, footer, resizer)));
|
|
971
|
+
};
|
|
972
|
+
var createDialog = function createDialog() {
|
|
937
973
|
var headerId = idState + '_header';
|
|
938
974
|
var contentId = idState + '_content';
|
|
939
975
|
var transitionTimeout = {
|
|
@@ -973,17 +1009,29 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
|
|
|
973
1009
|
onExiting: onExiting,
|
|
974
1010
|
onExited: onExited
|
|
975
1011
|
}, ptm('transition'));
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1012
|
+
if (inProps !== null && inProps !== void 0 && inProps.content) {
|
|
1013
|
+
var templateElement = createTemplateElement({
|
|
1014
|
+
maskProps: maskProps,
|
|
1015
|
+
rootProps: rootProps,
|
|
1016
|
+
transitionProps: transitionProps
|
|
1017
|
+
});
|
|
1018
|
+
return /*#__PURE__*/React__namespace.createElement(portal.Portal, {
|
|
1019
|
+
element: templateElement,
|
|
1020
|
+
appendTo: props.appendTo,
|
|
1021
|
+
visible: true
|
|
1022
|
+
});
|
|
1023
|
+
} else {
|
|
1024
|
+
var element = createElement({
|
|
1025
|
+
maskProps: maskProps,
|
|
1026
|
+
rootProps: rootProps,
|
|
1027
|
+
transitionProps: transitionProps
|
|
1028
|
+
});
|
|
1029
|
+
return /*#__PURE__*/React__namespace.createElement(portal.Portal, {
|
|
1030
|
+
element: element,
|
|
1031
|
+
appendTo: props.appendTo,
|
|
1032
|
+
visible: true
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
987
1035
|
};
|
|
988
1036
|
return maskVisibleState && createDialog();
|
|
989
1037
|
});
|