primereact 10.5.1 → 10.5.3
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/api/api.cjs.js +94 -92
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +229 -11
- package/api/api.esm.js +94 -92
- package/api/api.esm.min.js +1 -1
- package/api/api.js +94 -92
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +89 -45
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +6 -1
- package/autocomplete/autocomplete.esm.js +89 -45
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +89 -45
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/blockui.cjs.js +13 -13
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +13 -13
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +13 -13
- package/blockui/blockui.min.js +1 -1
- package/calendar/calendar.cjs.js +30 -11
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +9 -0
- package/calendar/calendar.esm.js +30 -11
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +30 -11
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +17 -15
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +4 -2
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +17 -15
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +28 -14
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +5 -0
- package/cascadeselect/cascadeselect.esm.js +28 -14
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +28 -14
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/checkbox.cjs.js +70 -153
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +10 -34
- package/checkbox/checkbox.esm.js +70 -153
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +70 -153
- package/checkbox/checkbox.min.js +1 -1
- package/chips/chips.cjs.js +23 -9
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +6 -1
- package/chips/chips.esm.js +23 -9
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +23 -9
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +3 -2
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +2 -1
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +3 -2
- package/colorpicker/colorpicker.min.js +1 -1
- package/componentbase/componentbase.cjs.js +4 -6
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +5 -7
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +4 -6
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +1 -0
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +1 -0
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +1 -0
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +5 -5
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +5 -5
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +5 -5
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/core/core.js +647 -610
- package/core/core.min.js +13 -13
- package/datatable/datatable.cjs.js +128 -110
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +1 -1
- package/datatable/datatable.esm.js +128 -110
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +128 -110
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +16 -13
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +4 -1
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +17 -15
- package/dataview/dataview.min.js +1 -1
- package/dialog/dialog.cjs.js +6 -6
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +6 -6
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +6 -6
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +98 -29
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +41 -0
- package/dropdown/dropdown.esm.js +98 -29
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +98 -31
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +125 -54
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +125 -54
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +125 -54
- package/editor/editor.min.js +1 -1
- package/galleria/galleria.cjs.js +22 -19
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +4 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +23 -20
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +115 -72
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +116 -73
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +115 -72
- package/hooks/hooks.min.js +1 -1
- package/image/image.cjs.js +11 -9
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +11 -9
- package/image/image.esm.min.js +1 -1
- package/image/image.js +11 -9
- package/image/image.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +20 -36
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +5 -5
- package/inputnumber/inputnumber.esm.js +20 -36
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +20 -36
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +18 -93
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.d.ts +9 -20
- package/inputswitch/inputswitch.esm.js +18 -93
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +18 -93
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +5 -3
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +5 -0
- package/inputtext/inputtext.esm.js +5 -3
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +5 -3
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +3 -1
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +5 -0
- package/inputtextarea/inputtextarea.esm.js +3 -1
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +3 -1
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -10
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +15 -0
- package/listbox/listbox.esm.js +15 -11
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +14 -10
- package/listbox/listbox.min.js +1 -1
- package/mention/mention.cjs.js +3 -1
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +3 -1
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +3 -1
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +3 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +3 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +3 -2
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +1 -1
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +1 -1
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +2 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +1 -1
- package/message/message.esm.js +2 -8
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -8
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +9 -8
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +1 -1
- package/messages/messages.esm.js +4 -3
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +9 -8
- package/messages/messages.min.js +1 -1
- package/metergroup/metergroup.cjs.js +237 -0
- package/metergroup/metergroup.cjs.min.js +1 -0
- package/metergroup/metergroup.d.ts +183 -0
- package/metergroup/metergroup.esm.js +233 -0
- package/metergroup/metergroup.esm.min.js +1 -0
- package/metergroup/metergroup.js +236 -0
- package/metergroup/metergroup.min.js +1 -0
- package/multiselect/multiselect.cjs.js +94 -123
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +25 -1
- package/multiselect/multiselect.esm.js +94 -123
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +94 -123
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +1 -1
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +35 -11
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +5 -0
- package/orderlist/orderlist.esm.js +35 -11
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +35 -11
- package/orderlist/orderlist.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +3 -2
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +3 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +3 -2
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +125 -108
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.d.ts +88 -0
- package/paginator/paginator.esm.js +125 -108
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +125 -108
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +13 -5
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +13 -5
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +13 -5
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/index.d.ts +12 -0
- package/passthrough/tailwind/index.cjs.js +268 -172
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +268 -172
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +268 -172
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +70 -39
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +5 -0
- package/password/password.esm.js +72 -41
- package/password/password.esm.min.js +1 -1
- package/password/password.js +70 -39
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +126 -101
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.d.ts +5 -0
- package/picklist/picklist.esm.js +126 -101
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +126 -101
- package/picklist/picklist.min.js +1 -1
- package/primereact.all.cjs.js +1775 -1431
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1776 -1431
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1775 -1431
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +67 -142
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.d.ts +17 -35
- package/radiobutton/radiobutton.esm.js +68 -143
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +67 -142
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +344 -67
- package/resources/themes/arya-green/theme.css +344 -67
- package/resources/themes/arya-orange/theme.css +344 -67
- package/resources/themes/bootstrap4-dark-blue/theme.css +389 -64
- package/resources/themes/bootstrap4-light-blue/theme.css +389 -64
- package/resources/themes/fluent-light/theme.css +341 -64
- package/resources/themes/lara-dark-amber/theme.css +470 -67
- package/resources/themes/lara-dark-blue/theme.css +470 -67
- package/resources/themes/lara-dark-cyan/theme.css +470 -67
- package/resources/themes/lara-dark-green/theme.css +470 -67
- package/resources/themes/lara-dark-indigo/theme.css +470 -67
- package/resources/themes/lara-dark-pink/theme.css +470 -67
- package/resources/themes/lara-dark-teal/theme.css +470 -67
- package/resources/themes/lara-light-amber/theme.css +470 -67
- package/resources/themes/lara-light-blue/theme.css +470 -67
- package/resources/themes/lara-light-cyan/theme.css +470 -67
- package/resources/themes/lara-light-green/theme.css +470 -67
- package/resources/themes/lara-light-indigo/theme.css +470 -67
- package/resources/themes/lara-light-pink/theme.css +470 -67
- package/resources/themes/lara-light-teal/theme.css +470 -67
- package/resources/themes/luna-amber/theme.css +344 -67
- package/resources/themes/luna-blue/theme.css +344 -67
- package/resources/themes/luna-green/theme.css +344 -67
- package/resources/themes/luna-pink/theme.css +344 -67
- package/resources/themes/md-dark-deeppurple/theme.css +995 -289
- package/resources/themes/md-dark-indigo/theme.css +684 -232
- package/resources/themes/md-light-deeppurple/theme.css +868 -162
- package/resources/themes/md-light-indigo/theme.css +566 -101
- package/resources/themes/mdc-dark-deeppurple/theme.css +995 -289
- package/resources/themes/mdc-dark-indigo/theme.css +697 -232
- package/resources/themes/mdc-light-deeppurple/theme.css +868 -162
- package/resources/themes/mdc-light-indigo/theme.css +566 -101
- package/resources/themes/mira/theme.css +344 -67
- package/resources/themes/nano/theme.css +344 -67
- package/resources/themes/nova/theme.css +344 -67
- package/resources/themes/nova-accent/theme.css +344 -67
- package/resources/themes/nova-alt/theme.css +344 -67
- package/resources/themes/rhea/theme.css +343 -66
- package/resources/themes/saga-blue/theme.css +344 -67
- package/resources/themes/saga-green/theme.css +344 -67
- package/resources/themes/saga-orange/theme.css +344 -67
- package/resources/themes/soho-dark/theme.css +413 -88
- package/resources/themes/soho-light/theme.css +392 -67
- package/resources/themes/tailwind-light/theme.css +344 -67
- package/resources/themes/vela-blue/theme.css +344 -67
- package/resources/themes/vela-green/theme.css +344 -67
- package/resources/themes/vela-orange/theme.css +344 -67
- package/resources/themes/viva-dark/theme.css +392 -67
- package/resources/themes/viva-light/theme.css +392 -67
- package/selectbutton/selectbutton.cjs.js +12 -4
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.d.ts +5 -0
- package/selectbutton/selectbutton.esm.js +12 -4
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +13 -5
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/sidebar.cjs.js +4 -3
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +4 -4
- package/sidebar/sidebar.esm.js +4 -3
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +4 -3
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +3 -2
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +3 -2
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +3 -2
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +18 -2
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +18 -2
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +18 -2
- package/slider/slider.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +2 -2
- package/splitter/splitter.cjs.js +7 -7
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.d.ts +5 -5
- package/splitter/splitter.esm.js +7 -7
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +7 -7
- package/splitter/splitter.min.js +1 -1
- package/styleclass/styleclass.cjs.js +21 -1
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.d.ts +10 -0
- package/styleclass/styleclass.esm.js +21 -1
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +22 -2
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +1 -1
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +1 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +1 -1
- package/tabmenu/tabmenu.min.js +1 -1
- package/toast/toast.cjs.js +93 -92
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +1 -1
- package/toast/toast.esm.js +93 -92
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +93 -92
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +54 -92
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +24 -0
- package/togglebutton/togglebutton.esm.js +53 -91
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +54 -92
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.d.ts +3 -3
- package/tooltip/tooltipoptions.d.ts +5 -0
- package/tree/tree.cjs.js +20 -8
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +20 -8
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +20 -8
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +2 -0
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +5 -0
- package/treeselect/treeselect.esm.js +2 -0
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +2 -0
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +17 -14
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +17 -14
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +17 -14
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +33 -90
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.d.ts +12 -13
- package/tristatecheckbox/tristatecheckbox.esm.js +34 -91
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +33 -90
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +64 -72
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +11 -2
- package/utils/utils.esm.js +65 -72
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +64 -72
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +17 -15
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +14 -12
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +17 -15
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +455 -39
package/hooks/hooks.js
CHANGED
|
@@ -81,10 +81,13 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
var usePrevious = function usePrevious(newValue) {
|
|
84
|
-
var ref = React__namespace.useRef(
|
|
84
|
+
var ref = React__namespace.useRef(null);
|
|
85
85
|
React__namespace.useEffect(function () {
|
|
86
86
|
ref.current = newValue;
|
|
87
|
-
|
|
87
|
+
return function () {
|
|
88
|
+
ref.current = null;
|
|
89
|
+
};
|
|
90
|
+
}, [newValue]);
|
|
88
91
|
return ref.current;
|
|
89
92
|
};
|
|
90
93
|
|
|
@@ -96,7 +99,6 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
96
99
|
};
|
|
97
100
|
/* eslint-enable */
|
|
98
101
|
|
|
99
|
-
/* eslint-disable */
|
|
100
102
|
var useEventListener = function useEventListener(_ref) {
|
|
101
103
|
var _ref$target = _ref.target,
|
|
102
104
|
target = _ref$target === void 0 ? 'document' : _ref$target,
|
|
@@ -111,9 +113,10 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
111
113
|
var prevOptions = usePrevious(options);
|
|
112
114
|
var bind = function bind() {
|
|
113
115
|
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
114
|
-
|
|
116
|
+
var bindTarget = bindOptions.target;
|
|
117
|
+
if (utils.ObjectUtils.isNotEmpty(bindTarget)) {
|
|
115
118
|
unbind();
|
|
116
|
-
(bindOptions.when || when) && (targetRef.current = utils.DomHandler.getTargetElement(
|
|
119
|
+
(bindOptions.when || when) && (targetRef.current = utils.DomHandler.getTargetElement(bindTarget));
|
|
117
120
|
}
|
|
118
121
|
if (!listenerRef.current && targetRef.current) {
|
|
119
122
|
listenerRef.current = function (event) {
|
|
@@ -128,27 +131,41 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
128
131
|
listenerRef.current = null;
|
|
129
132
|
}
|
|
130
133
|
};
|
|
131
|
-
|
|
134
|
+
var dispose = function dispose() {
|
|
135
|
+
unbind();
|
|
136
|
+
// Prevent memory leak by releasing
|
|
137
|
+
prevListener = null;
|
|
138
|
+
prevOptions = null;
|
|
139
|
+
};
|
|
140
|
+
var updateTarget = React__namespace.useCallback(function () {
|
|
132
141
|
if (when) {
|
|
133
142
|
targetRef.current = utils.DomHandler.getTargetElement(target);
|
|
134
143
|
} else {
|
|
135
144
|
unbind();
|
|
136
145
|
targetRef.current = null;
|
|
137
146
|
}
|
|
147
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
138
148
|
}, [target, when]);
|
|
139
149
|
React__namespace.useEffect(function () {
|
|
140
|
-
|
|
141
|
-
|
|
150
|
+
updateTarget();
|
|
151
|
+
}, [updateTarget]);
|
|
152
|
+
React__namespace.useEffect(function () {
|
|
153
|
+
var listenerChanged = "".concat(prevListener) !== "".concat(listener);
|
|
154
|
+
var optionsChanged = prevOptions !== options;
|
|
155
|
+
var listenerExists = listenerRef.current;
|
|
156
|
+
if (listenerExists && (listenerChanged || optionsChanged)) {
|
|
142
157
|
unbind();
|
|
143
158
|
when && bind();
|
|
159
|
+
} else if (!listenerExists) {
|
|
160
|
+
dispose();
|
|
144
161
|
}
|
|
162
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
145
163
|
}, [listener, options, when]);
|
|
146
164
|
useUnmountEffect(function () {
|
|
147
|
-
|
|
165
|
+
dispose();
|
|
148
166
|
});
|
|
149
167
|
return [bind, unbind];
|
|
150
168
|
};
|
|
151
|
-
/* eslint-enable */
|
|
152
169
|
|
|
153
170
|
var useClickOutside = function useClickOutside(ref, callback) {
|
|
154
171
|
var isOutsideClicked = function isOutsideClicked(event) {
|
|
@@ -263,20 +280,20 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
263
280
|
setDisplayOrder = _React$useState4[1];
|
|
264
281
|
React__namespace.useEffect(function () {
|
|
265
282
|
if (isVisible) {
|
|
266
|
-
if (!
|
|
283
|
+
if (!groupToDisplayedElements[group]) {
|
|
267
284
|
groupToDisplayedElements[group] = [];
|
|
268
285
|
}
|
|
269
|
-
var newDisplayOrder = groupToDisplayedElements[group].
|
|
270
|
-
groupToDisplayedElements[group].push(uid);
|
|
286
|
+
var newDisplayOrder = groupToDisplayedElements[group].push(uid);
|
|
271
287
|
setDisplayOrder(newDisplayOrder);
|
|
272
288
|
return function () {
|
|
273
|
-
delete groupToDisplayedElements[group][newDisplayOrder];
|
|
274
|
-
var lastOrder = groupToDisplayedElements[group].findLastIndex(function (el) {
|
|
275
|
-
return el !== undefined;
|
|
276
|
-
});
|
|
289
|
+
delete groupToDisplayedElements[group][newDisplayOrder - 1];
|
|
277
290
|
|
|
278
291
|
// Reduce array length, by removing undefined elements at the end of array:
|
|
279
|
-
groupToDisplayedElements[group].
|
|
292
|
+
var lastIndex = groupToDisplayedElements[group].length - 1;
|
|
293
|
+
var lastOrder = utils.ObjectUtils.findLastIndex(groupToDisplayedElements[group], function (el) {
|
|
294
|
+
return el !== undefined;
|
|
295
|
+
});
|
|
296
|
+
if (lastOrder !== lastIndex) groupToDisplayedElements[group].splice(lastOrder + 1);
|
|
280
297
|
setDisplayOrder(undefined);
|
|
281
298
|
};
|
|
282
299
|
}
|
|
@@ -502,6 +519,37 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
502
519
|
};
|
|
503
520
|
/* eslint-enable */
|
|
504
521
|
|
|
522
|
+
/**
|
|
523
|
+
* Hook to merge properties including custom merge function for things like Tailwind merge.
|
|
524
|
+
*/
|
|
525
|
+
var useMergeProps = function useMergeProps() {
|
|
526
|
+
var context = React.useContext(PrimeReact.PrimeReactContext);
|
|
527
|
+
return function () {
|
|
528
|
+
for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
529
|
+
props[_key] = arguments[_key];
|
|
530
|
+
}
|
|
531
|
+
return utils.mergeProps(props, context === null || context === void 0 ? void 0 : context.ptOptions);
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
/* eslint-disable */
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Custom hook to run a mount effect only once.
|
|
539
|
+
* @param {*} fn the callback function
|
|
540
|
+
* @returns the hook
|
|
541
|
+
*/
|
|
542
|
+
var useMountEffect = function useMountEffect(fn) {
|
|
543
|
+
var mounted = React__namespace.useRef(false);
|
|
544
|
+
return React__namespace.useEffect(function () {
|
|
545
|
+
if (!mounted.current) {
|
|
546
|
+
mounted.current = true;
|
|
547
|
+
return fn && fn();
|
|
548
|
+
}
|
|
549
|
+
}, []);
|
|
550
|
+
};
|
|
551
|
+
/* eslint-enable */
|
|
552
|
+
|
|
505
553
|
function _typeof(o) {
|
|
506
554
|
"@babel/helpers - typeof";
|
|
507
555
|
|
|
@@ -543,44 +591,6 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
543
591
|
return obj;
|
|
544
592
|
}
|
|
545
593
|
|
|
546
|
-
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
547
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* Hook to merge properties including custom merge function for things like Tailwind merge.
|
|
551
|
-
*/
|
|
552
|
-
var useMergeProps = function useMergeProps() {
|
|
553
|
-
var context = React.useContext(PrimeReact.PrimeReactContext);
|
|
554
|
-
return function () {
|
|
555
|
-
var _context$ptOptions;
|
|
556
|
-
var options = _objectSpread$2({}, (context === null || context === void 0 || (_context$ptOptions = context.ptOptions) === null || _context$ptOptions === void 0 ? void 0 : _context$ptOptions.classNameMergeFunction) && {
|
|
557
|
-
classNameMergeFunction: context.classNameMergeFunction
|
|
558
|
-
});
|
|
559
|
-
for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
560
|
-
props[_key] = arguments[_key];
|
|
561
|
-
}
|
|
562
|
-
return utils._mergeProps(props, options);
|
|
563
|
-
};
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
/* eslint-disable */
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* Custom hook to run a mount effect only once.
|
|
570
|
-
* @param {*} fn the callback function
|
|
571
|
-
* @returns the hook
|
|
572
|
-
*/
|
|
573
|
-
var useMountEffect = function useMountEffect(fn) {
|
|
574
|
-
var mounted = React__namespace.useRef(false);
|
|
575
|
-
return React__namespace.useEffect(function () {
|
|
576
|
-
if (!mounted.current) {
|
|
577
|
-
mounted.current = true;
|
|
578
|
-
return fn && fn();
|
|
579
|
-
}
|
|
580
|
-
}, []);
|
|
581
|
-
};
|
|
582
|
-
/* eslint-enable */
|
|
583
|
-
|
|
584
594
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
585
595
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
586
596
|
var useMouse = function useMouse() {
|
|
@@ -842,18 +852,18 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
842
852
|
});
|
|
843
853
|
}
|
|
844
854
|
|
|
845
|
-
/* eslint-disable */
|
|
846
855
|
var useOverlayScrollListener = function useOverlayScrollListener(_ref) {
|
|
847
856
|
var target = _ref.target,
|
|
848
857
|
listener = _ref.listener,
|
|
849
858
|
options = _ref.options,
|
|
850
859
|
_ref$when = _ref.when,
|
|
851
860
|
when = _ref$when === void 0 ? true : _ref$when;
|
|
861
|
+
var context = React__namespace.useContext(PrimeReact.PrimeReactContext);
|
|
852
862
|
var targetRef = React__namespace.useRef(null);
|
|
853
863
|
var listenerRef = React__namespace.useRef(null);
|
|
854
|
-
var
|
|
864
|
+
var scrollableParentsRef = React__namespace.useRef([]);
|
|
865
|
+
var prevListener = usePrevious(listener);
|
|
855
866
|
var prevOptions = usePrevious(options);
|
|
856
|
-
var context = React__namespace.useContext(PrimeReact.PrimeReactContext);
|
|
857
867
|
var bind = function bind() {
|
|
858
868
|
var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
859
869
|
if (utils.ObjectUtils.isNotEmpty(bindOptions.target)) {
|
|
@@ -862,7 +872,7 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
862
872
|
}
|
|
863
873
|
if (!listenerRef.current && targetRef.current) {
|
|
864
874
|
var hideOnScroll = context ? context.hideOverlaysOnDocumentScrolling : PrimeReact__default["default"].hideOverlaysOnDocumentScrolling;
|
|
865
|
-
var nodes =
|
|
875
|
+
var nodes = scrollableParentsRef.current = utils.DomHandler.getScrollableParents(targetRef.current, hideOnScroll);
|
|
866
876
|
listenerRef.current = function (event) {
|
|
867
877
|
return listener && listener(event);
|
|
868
878
|
};
|
|
@@ -873,33 +883,49 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
873
883
|
};
|
|
874
884
|
var unbind = function unbind() {
|
|
875
885
|
if (listenerRef.current) {
|
|
876
|
-
var nodes =
|
|
886
|
+
var nodes = scrollableParentsRef.current;
|
|
877
887
|
nodes.forEach(function (node) {
|
|
878
888
|
return node.removeEventListener('scroll', listenerRef.current, options);
|
|
879
889
|
});
|
|
880
890
|
listenerRef.current = null;
|
|
881
891
|
}
|
|
882
892
|
};
|
|
883
|
-
|
|
893
|
+
var dispose = function dispose() {
|
|
894
|
+
unbind();
|
|
895
|
+
// #5927 prevent memory leak by releasing
|
|
896
|
+
scrollableParentsRef.current = null;
|
|
897
|
+
prevListener = null;
|
|
898
|
+
prevOptions = null;
|
|
899
|
+
};
|
|
900
|
+
var updateTarget = React__namespace.useCallback(function () {
|
|
884
901
|
if (when) {
|
|
885
902
|
targetRef.current = utils.DomHandler.getTargetElement(target);
|
|
886
903
|
} else {
|
|
887
904
|
unbind();
|
|
888
905
|
targetRef.current = null;
|
|
889
906
|
}
|
|
907
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
890
908
|
}, [target, when]);
|
|
891
909
|
React__namespace.useEffect(function () {
|
|
892
|
-
|
|
910
|
+
updateTarget();
|
|
911
|
+
}, [updateTarget]);
|
|
912
|
+
React__namespace.useEffect(function () {
|
|
913
|
+
var listenerChanged = "".concat(prevListener) !== "".concat(listener);
|
|
914
|
+
var optionsChanged = prevOptions !== options;
|
|
915
|
+
var listenerExists = listenerRef.current;
|
|
916
|
+
if (listenerExists && (listenerChanged || optionsChanged)) {
|
|
893
917
|
unbind();
|
|
894
918
|
when && bind();
|
|
919
|
+
} else if (!listenerExists) {
|
|
920
|
+
dispose();
|
|
895
921
|
}
|
|
896
|
-
|
|
922
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
923
|
+
}, [listener, options, when]);
|
|
897
924
|
useUnmountEffect(function () {
|
|
898
|
-
|
|
925
|
+
dispose();
|
|
899
926
|
});
|
|
900
927
|
return [bind, unbind];
|
|
901
928
|
};
|
|
902
|
-
/* eslint-enable */
|
|
903
929
|
|
|
904
930
|
var useResizeListener = function useResizeListener(_ref) {
|
|
905
931
|
var listener = _ref.listener,
|
|
@@ -918,7 +944,9 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
918
944
|
overlay = _ref.overlay,
|
|
919
945
|
_listener = _ref.listener,
|
|
920
946
|
_ref$when = _ref.when,
|
|
921
|
-
when = _ref$when === void 0 ? true : _ref$when
|
|
947
|
+
when = _ref$when === void 0 ? true : _ref$when,
|
|
948
|
+
_ref$type = _ref.type,
|
|
949
|
+
type = _ref$type === void 0 ? 'click' : _ref$type;
|
|
922
950
|
var targetRef = React__namespace.useRef(null);
|
|
923
951
|
var overlayRef = React__namespace.useRef(null);
|
|
924
952
|
|
|
@@ -930,7 +958,7 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
930
958
|
*/
|
|
931
959
|
var _useEventListener = useEventListener({
|
|
932
960
|
target: 'window',
|
|
933
|
-
type:
|
|
961
|
+
type: type,
|
|
934
962
|
listener: function listener(event) {
|
|
935
963
|
_listener && _listener(event, {
|
|
936
964
|
type: 'outside',
|
|
@@ -1121,20 +1149,35 @@ this.primereact.hooks = (function (exports, React, utils, PrimeReact) {
|
|
|
1121
1149
|
id = _options$id === void 0 ? undefined : _options$id,
|
|
1122
1150
|
_options$media = options.media,
|
|
1123
1151
|
media = _options$media === void 0 ? undefined : _options$media;
|
|
1152
|
+
var getCurrentStyleRef = function getCurrentStyleRef(styleContainer) {
|
|
1153
|
+
var existingStyle = styleContainer.querySelector("style[data-primereact-style-id=\"".concat(name, "\"]"));
|
|
1154
|
+
if (existingStyle) {
|
|
1155
|
+
return existingStyle;
|
|
1156
|
+
}
|
|
1157
|
+
if (id !== undefined) {
|
|
1158
|
+
var existingElement = document.getElementById(id);
|
|
1159
|
+
if (existingElement) {
|
|
1160
|
+
return existingElement;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// finally if not found create the new style
|
|
1165
|
+
return document.createElement('style');
|
|
1166
|
+
};
|
|
1124
1167
|
var update = function update(newCSS) {
|
|
1125
1168
|
isLoaded && css !== newCSS && (styleRef.current.textContent = newCSS);
|
|
1126
1169
|
};
|
|
1127
1170
|
var load = function load() {
|
|
1128
1171
|
if (!document || isLoaded) return;
|
|
1129
1172
|
var styleContainer = (context === null || context === void 0 ? void 0 : context.styleContainer) || document.head;
|
|
1130
|
-
styleRef.current = styleContainer
|
|
1173
|
+
styleRef.current = getCurrentStyleRef(styleContainer);
|
|
1131
1174
|
if (!styleRef.current.isConnected) {
|
|
1132
1175
|
styleRef.current.type = 'text/css';
|
|
1133
|
-
id
|
|
1134
|
-
media
|
|
1176
|
+
if (id) styleRef.current.id = id;
|
|
1177
|
+
if (media) styleRef.current.media = media;
|
|
1135
1178
|
utils.DomHandler.addNonce(styleRef.current, context && context.nonce || PrimeReact__default["default"].nonce);
|
|
1136
1179
|
styleContainer.appendChild(styleRef.current);
|
|
1137
|
-
name
|
|
1180
|
+
if (name) styleRef.current.setAttribute('data-primereact-style-id', name);
|
|
1138
1181
|
}
|
|
1139
1182
|
styleRef.current.textContent = css;
|
|
1140
1183
|
setIsLoaded(true);
|
package/hooks/hooks.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.hooks=function(e,t,n,r){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=o(t),i=u(r);function a(e){if(Array.isArray(e))return e}function l(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,o,c,i=[],a=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(i.push(r.value),i.length!==t);a=!0);}catch(e){l=!0,u=e}finally{try{if(!a&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(l)throw u}}return i}}function s(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 f(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e,t){return a(e)||l(e,t)||f(e,t)||d()}var p=function(e){var t=c.useRef(void 0);return c.useEffect((function(){t.current=e})),t.current},y=function(e){return c.useEffect((function(){return e}),[])},m=function(e){var t=e.target,r=void 0===t?"document":t,u=e.type,o=e.listener,i=e.options,a=e.when,l=void 0===a||a,s=c.useRef(null),f=c.useRef(null),d=p(o),v=p(i),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.ObjectUtils.isNotEmpty(e.target)&&(g(),(e.when||l)&&(s.current=n.DomHandler.getTargetElement(e.target))),!f.current&&s.current&&(f.current=function(e){return o&&o(e)},s.current.addEventListener(u,f.current,i))},g=function(){f.current&&(s.current.removeEventListener(u,f.current,i),f.current=null)};return c.useEffect((function(){l?s.current=n.DomHandler.getTargetElement(r):(g(),s.current=null)}),[r,l]),c.useEffect((function(){!f.current||""+d==""+o&&v===i||(g(),l&&m())}),[o,i,l]),y((function(){g()})),[m,g]},g={},h={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"};function b(e){if(Array.isArray(e))return s(e)}function w(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function O(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e){return b(e)||w(e)||f(e)||O()}var S={escKeyListeners:new Map,onGlobalKeyDown:function(e){if("Escape"===e.code){var t=S.escKeyListeners,n=Math.max.apply(Math,E(t.keys())),r=t.get(n),u=Math.max.apply(Math,E(r.keys()));r.get(u)(e)}},refreshGlobalKeyDownListener:function(){var e=n.DomHandler.getTargetElement("document");this.escKeyListeners.size>0?e.addEventListener("keydown",this.onGlobalKeyDown):e.removeEventListener("keydown",this.onGlobalKeyDown)},addListener:function(e,t){var n=this,r=v(t,2),u=r[0],o=r[1],c=this.escKeyListeners;c.has(u)||c.set(u,new Map);var i=c.get(u);if(i.has(o))throw new Error("Unexpected: global esc key listener with priority [".concat(u,", ").concat(o,"] already exists."));return i.set(o,e),this.refreshGlobalKeyDownListener(),function(){i.delete(o),0===i.size&&c.delete(u),n.refreshGlobalKeyDownListener()}}};function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function D(e,t){if("object"!==j(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==j(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function P(e){var t=D(e,"string");return"symbol"===j(t)?t:String(t)}function R(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(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 L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var I=function(e){var t=c.useRef(!1);return c.useEffect((function(){if(!t.current)return t.current=!0,e&&e()}),[])};function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function A(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 T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k=function(e){var t=e.target,u=e.listener,o=e.options,a=e.when,l=void 0===a||a,s=c.useRef(null),f=c.useRef(null),d=c.useRef([]),v=p(o),m=c.useContext(r.PrimeReactContext),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.ObjectUtils.isNotEmpty(e.target)&&(h(),(e.when||l)&&(s.current=n.DomHandler.getTargetElement(e.target))),!f.current&&s.current){var t=d.current=n.DomHandler.getScrollableParents(s.current,m?m.hideOverlaysOnDocumentScrolling:i.default.hideOverlaysOnDocumentScrolling);f.current=function(e){return u&&u(e)},t.forEach((function(e){return e.addEventListener("scroll",f.current,o)}))}},h=function(){f.current&&(d.current.forEach((function(e){return e.removeEventListener("scroll",f.current,o)})),f.current=null)};return c.useEffect((function(){l?s.current=n.DomHandler.getTargetElement(t):(h(),s.current=null)}),[t,l]),c.useEffect((function(){!f.current||f.current===u&&v===o||(h(),l&&g())}),[u,o]),y((function(){h()})),[g,h]},N=function(e){var t=e.when;return m({target:"window",type:"resize",listener:e.listener,when:void 0===t||t})},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",r="undefined"!=typeof window,u=v(m({target:"window",type:"storage",listener:function(e){var r="local"===n?window.localStorage:window.sessionStorage;if(e.storageArea===r&&e.key===t){var u=e.newValue?JSON.parse(e.newValue):void 0;s(u)}}}),2),o=u[0],i=u[1],a=v(c.useState(e),2),l=a[0],s=a[1];return c.useEffect((function(){r||s(e);try{var u="local"===n?window.localStorage.getItem(t):window.sessionStorage.getItem(t);s(u?JSON.parse(u):e)}catch(t){s(e)}return o(),function(){return i()}}),[]),[l,function(e){try{var u=e instanceof Function?e(l):e;if(s(u),r){var o=JSON.stringify(u);"local"===n?window.localStorage.setItem(t,o):window.sessionStorage.setItem(t,o)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(t))}}]},H=0;return e.ESC_KEY_HANDLING_PRIORITIES={SIDEBAR:100,SLIDE_MENU:200,DIALOG:300,IMAGE:400,MENU:500,OVERLAY_PANEL:600,PASSWORD:700,CASCADE_SELECT:800,SPLIT_BUTTON:900,SPEED_DIAL:1e3},e.useClickOutside=function(e,t){var n=function(n){e.current&&!e.current.contains(n.target)&&t(n)},r=v(m({type:"mousedown",listener:n}),2),u=r[0],o=r[1],i=v(m({type:"touchstart",listener:n}),2),a=i[0],l=i[1];return c.useEffect((function(){if(e.current)return u(),a(),function(){o(),l()}})),[e,t]},e.useCounter=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{step:1},t=v(c.useState(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0),2),n=t[0],r=t[1];return{count:n,increment:function(){e.max&&n>=e.max||r(n+e.step)},decrement:function(){if(e.min||0===e.min&&n<=e.min)return null;r(n-e.step)},reset:function(){r(0)}}},e.useDebounce=function(e,t){var n=v(c.useState(e),2),r=n[0],u=n[1],o=v(c.useState(e),2),i=o[0],a=o[1],l=c.useRef(!1),s=c.useRef(null),f=function(){return window.clearTimeout(s.current)};return I((function(){l.current=!0})),y((function(){f()})),c.useEffect((function(){l.current&&(f(),s.current=window.setTimeout((function(){a(r)}),t))}),[r,t]),[r,i,u]},e.useDisplayOrder=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=v(c.useState((function(){return n.UniqueComponentId()})),1)[0],u=v(c.useState(0),2),o=u[0],i=u[1];return c.useEffect((function(){if(t){e in g||(g[e]=[]);var n=g[e].length+1;return g[e].push(r),i(n),function(){delete g[e][n];var t=g[e].findLastIndex((function(e){return void 0!==e}));g[e].splice(t+1),i(void 0)}}}),[e,r,t]),o},e.useEventListener=m,e.useFavicon=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"shortcut icon";c.useLayoutEffect((function(){if(e){document.querySelectorAll("link[rel*='icon']").forEach((function(e){document.head.removeChild(e)}));var n=document.createElement("link");n.setAttribute("type",h[e.split(".").pop()]),n.setAttribute("rel",t),n.setAttribute("href",e),document.head.appendChild(n)}}),[e,t])},e.useGlobalOnEscapeKey=function(e){var n=e.callback,r=e.when,u=e.priority;t.useEffect((function(){if(r)return S.addListener(n,u)}),[n,r,u])},e.useIntersectionObserver=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=v(c.useState(!1),2),r=n[0],u=n[1];return c.useEffect((function(){if(e.current){var n=new IntersectionObserver((function(e){var t=v(e,1);u(t[0].isIntersecting)}),t);return n.observe(e.current),function(){n.disconnect()}}}),[t,e]),r},e.useInterval=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=c.useRef(null),u=c.useRef(null),o=c.useCallback((function(){return clearInterval(r.current)}),[r.current]);return c.useEffect((function(){u.current=e})),c.useEffect((function(){if(n)return r.current=setInterval((function(){u.current()}),t),o;o()}),[t,n]),y((function(){o()})),[o]},e.useLocalStorage=function(e,t){return _(e,t,"local")},e.useMatchMedia=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=v(c.useState(!1),2),r=n[0],u=n[1],o=c.useRef(null),i=function(e){return u(e.matches)},a=function(){return o.current&&o.current.removeEventListener("change",i)&&(o.current=null)};return c.useEffect((function(){return t&&(o.current=window.matchMedia(e),u(o.current.matches),o.current&&o.current.addEventListener("change",i)),a}),[e,t]),r},e.useMergeProps=function(){var e=t.useContext(r.PrimeReactContext);return function(){for(var t,r=L({},(null==e||null===(t=e.ptOptions)||void 0===t?void 0:t.classNameMergeFunction)&&{classNameMergeFunction:e.classNameMergeFunction}),u=arguments.length,o=new Array(u),c=0;c<u;c++)o[c]=arguments[c];return n._mergeProps(o,r)}},e.useMountEffect=I,e.useMouse=function(){var e=v(c.useState({x:0,y:0}),2),t=e[0],n=e[1],r=c.useRef(null),u=c.useCallback((function(e){var t,u;if(r.current){var o=e.currentTarget.getBoundingClientRect();t=e.pageX-o.left-(window.pageXOffset||window.scrollX),u=e.pageY-o.top-(window.pageYOffset||window.scrollY)}else t=e.clientX,u=e.clientY;n({x:Math.max(0,Math.round(t)),y:Math.max(0,Math.round(u))})}),[]),o=v(m({target:r,type:"mousemove",listener:u}),2),i=o[0],a=o[1],l=v(m({type:"mousemove",listener:u}),2),s=l[0],f=l[1];return c.useEffect((function(){return i(),r.current||s(),function(){a(),r.current||f()}}),[s,i,f,a]),C(C({ref:r},t),{},{reset:function(){return n({x:0,y:0})}})},e.useMove=function(e){var t=e.mode,n=void 0===t?"both":t,r=e.initialValue,u=void 0===r?{x:0,y:0}:r,o=v(c.useState(u),2),i=o[0],a=o[1],l=v(c.useState(!1),2),s=l[0],f=l[1],d=c.useRef(!1),p=c.useRef(!1),y=c.useRef(null),g=function(e){return z({x:e.clientX,y:e.clientY})},h=function(e){var t=e.clampedX,r=e.clampedY;"vertical"===n?a({y:1-r}):"horizontal"===n?a({x:t}):"both"===n&&a({x:t,y:r})},b=function(){p.current&&d.current&&(p.current=!1,f(!1),U())},w=function(e){e.cancelable&&e.preventDefault(),z({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})},O=v(m({type:"mousemove",listener:g}),2),E=O[0],S=O[1],j=v(m({type:"mouseup",listener:b}),2),D=j[0],P=j[1],R=v(m({type:"touchmove",listener:w}),2),x=R[0],L=R[1],I=v(m({type:"touchend",listener:b}),2),M=I[0],C=I[1],A=v(m({target:y,type:"mousedown",listener:function(e){X(),e.preventDefault(),g(e)}}),2),k=A[0],N=A[1],_=v(m({target:y,type:"touchstart",listener:function(e){e.cancelable&&e.preventDefault(),X(),w(e)},options:{passive:!1}}),2),H=_[0],K=_[1],Y=function(e,t,n){return Math.min(Math.max(e,t),n)},G=function(e){var t=e.y;return{clampedX:Y(e.x,0,1),clampedY:Y(t,0,1)}},U=function(){S(),P(),L(),C()};c.useEffect((function(){d.current=!0}),[]);var X=function(){!p.current&&d.current&&(p.current=!0,f(!0),E(),D(),x(),M())},z=function(e){var t=e.x,n=e.y;if(p.current){var r=y.current.getBoundingClientRect(),u=G({x:(t-r.left)/r.width,y:(n-r.top)/r.height});h({clampedX:u.clampedX,clampedY:u.clampedY})}};return c.useEffect((function(){return y.current&&(k(),H()),function(){y.current&&(N(),K())}}),[k,H,i,N,K]),T(T({ref:y},i),{},{active:s,reset:function(){a(u)}})},e.useOverlayListener=function(e){var t=e.target,r=e.overlay,u=e.listener,o=e.when,i=void 0===o||o,a=c.useRef(null),l=c.useRef(null),s=v(m({target:"window",type:"click",listener:function(e){u&&u(e,{type:"outside",valid:3!==e.which&&D(e)})}}),2),f=s[0],d=s[1],p=v(N({target:"window",listener:function(e){u&&u(e,{type:"resize",valid:!n.DomHandler.isTouchDevice()})}}),2),g=p[0],h=p[1],b=v(m({target:"window",type:"orientationchange",listener:function(e){u&&u(e,{type:"orientationchange",valid:!0})}}),2),w=b[0],O=b[1],E=v(k({target:t,listener:function(e){u&&u(e,{type:"scroll",valid:!0})}}),2),S=E[0],j=E[1],D=function(e){return a.current&&!(a.current.isSameNode(e.target)||a.current.contains(e.target)||l.current&&l.current.contains(e.target))},P=function(){d(),h(),O(),j()};return c.useEffect((function(){i?(a.current=n.DomHandler.getTargetElement(t),l.current=n.DomHandler.getTargetElement(r)):(P(),a.current=l.current=null)}),[t,r,i]),c.useEffect((function(){P()}),[i]),y((function(){P()})),[function(){f(),g(),w(),S()},P]},e.useOverlayScrollListener=k,e.usePrevious=p,e.useResizeListener=N,e.useSessionStorage=function(e,t){return _(e,t,"session")},e.useStorage=_,e.useStyle=function(e){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=v(t.useState(!1),2),c=o[0],a=o[1],l=t.useRef(null),s=t.useContext(r.PrimeReactContext),f=n.DomHandler.isClient()?window.document:void 0,d=u.document,p=void 0===d?f:d,y=u.manual,m=void 0!==y&&y,g=u.name,h=void 0===g?"style_".concat(++H):g,b=u.id,w=void 0===b?void 0:b,O=u.media,E=void 0===O?void 0:O,S=function(){if(p&&!c){var t=(null==s?void 0:s.styleContainer)||p.head;l.current=t.querySelector('style[data-primereact-style-id="'.concat(h,'"]'))||p.getElementById(w)||p.createElement("style"),l.current.isConnected||(l.current.type="text/css",w&&(l.current.id=w),E&&(l.current.media=E),n.DomHandler.addNonce(l.current,s&&s.nonce||i.default.nonce),t.appendChild(l.current),h&&l.current.setAttribute("data-primereact-style-id",h)),l.current.textContent=e,a(!0)}};return t.useEffect((function(){m||S()}),[m]),{id:w,name:h,update:function(t){c&&e!==t&&(l.current.textContent=t)},unload:function(){p&&l.current&&(n.DomHandler.removeInlineStyle(l.current),a(!1))},load:S,isLoaded:c}},e.useTimeout=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=c.useRef(null),u=c.useRef(null),o=c.useCallback((function(){return clearTimeout(r.current)}),[r.current]);return c.useEffect((function(){u.current=e})),c.useEffect((function(){if(n)return r.current=setTimeout((function(){u.current()}),t),o;o()}),[t,n]),y((function(){o()})),[o]},e.useUnmountEffect=y,e.useUpdateEffect=function(e,t){var n=c.useRef(!1);return c.useEffect((function(){if(n.current)return e&&e();n.current=!0}),t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.api);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.hooks=function(e,t,n,r){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=o(t),i=u(r);function a(e){if(Array.isArray(e))return e}function l(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,o,c,i=[],a=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(i.push(r.value),i.length!==t);a=!0);}catch(e){l=!0,u=e}finally{try{if(!a&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(l)throw u}}return i}}function f(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 s(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e,t){return a(e)||l(e,t)||s(e,t)||d()}var y=function(e){var t=c.useRef(null);return c.useEffect((function(){return t.current=e,function(){t.current=null}}),[e]),t.current},m=function(e){return c.useEffect((function(){return e}),[])},p=function(e){var t=e.target,r=void 0===t?"document":t,u=e.type,o=e.listener,i=e.options,a=e.when,l=void 0===a||a,f=c.useRef(null),s=c.useRef(null),d=y(o),v=y(i),p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target;n.ObjectUtils.isNotEmpty(t)&&(g(),(e.when||l)&&(f.current=n.DomHandler.getTargetElement(t))),!s.current&&f.current&&(s.current=function(e){return o&&o(e)},f.current.addEventListener(u,s.current,i))},g=function(){s.current&&(f.current.removeEventListener(u,s.current,i),s.current=null)},h=function(){g(),d=null,v=null},b=c.useCallback((function(){l?f.current=n.DomHandler.getTargetElement(r):(g(),f.current=null)}),[r,l]);return c.useEffect((function(){b()}),[b]),c.useEffect((function(){var e="".concat(d)!=="".concat(o),t=s.current;t&&(e||v!==i)?(g(),l&&p()):t||h()}),[o,i,l]),m((function(){h()})),[p,g]},g={},h={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"};function b(e){if(Array.isArray(e))return f(e)}function w(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function E(){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 O(e){return b(e)||w(e)||s(e)||E()}var S={escKeyListeners:new Map,onGlobalKeyDown:function(e){if("Escape"===e.code){var t=S.escKeyListeners,n=Math.max.apply(Math,O(t.keys())),r=t.get(n),u=Math.max.apply(Math,O(r.keys()));r.get(u)(e)}},refreshGlobalKeyDownListener:function(){var e=n.DomHandler.getTargetElement("document");this.escKeyListeners.size>0?e.addEventListener("keydown",this.onGlobalKeyDown):e.removeEventListener("keydown",this.onGlobalKeyDown)},addListener:function(e,t){var n=this,r=v(t,2),u=r[0],o=r[1],c=this.escKeyListeners;c.has(u)||c.set(u,new Map);var i=c.get(u);if(i.has(o))throw new Error("Unexpected: global esc key listener with priority [".concat(u,", ").concat(o,"] already exists."));return i.set(o,e),this.refreshGlobalKeyDownListener(),function(){i.delete(o),0===i.size&&c.delete(u),n.refreshGlobalKeyDownListener()}}},D=function(e){var t=c.useRef(!1);return c.useEffect((function(){if(!t.current)return t.current=!0,e&&e()}),[])};function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function P(e,t){if("object"!==j(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==j(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function R(e){var t=P(e,"string");return"symbol"===j(t)?t:String(t)}function x(e,t,n){return(t=R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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 C(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){x(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}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var M=function(e){var t=e.target,u=e.listener,o=e.options,a=e.when,l=void 0===a||a,f=c.useContext(r.PrimeReactContext),s=c.useRef(null),d=c.useRef(null),v=c.useRef([]),p=y(u),g=y(o),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.ObjectUtils.isNotEmpty(e.target)&&(b(),(e.when||l)&&(s.current=n.DomHandler.getTargetElement(e.target))),!d.current&&s.current){var t=v.current=n.DomHandler.getScrollableParents(s.current,f?f.hideOverlaysOnDocumentScrolling:i.default.hideOverlaysOnDocumentScrolling);d.current=function(e){return u&&u(e)},t.forEach((function(e){return e.addEventListener("scroll",d.current,o)}))}},b=function(){d.current&&(v.current.forEach((function(e){return e.removeEventListener("scroll",d.current,o)})),d.current=null)},w=function(){b(),v.current=null,p=null,g=null},E=c.useCallback((function(){l?s.current=n.DomHandler.getTargetElement(t):(b(),s.current=null)}),[t,l]);return c.useEffect((function(){E()}),[E]),c.useEffect((function(){var e="".concat(p)!=="".concat(u),t=d.current;t&&(e||g!==o)?(b(),l&&h()):t||w()}),[u,o,l]),m((function(){w()})),[h,b]},T=function(e){var t=e.when;return p({target:"window",type:"resize",listener:e.listener,when:void 0===t||t})},k=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",r="undefined"!=typeof window,u=v(p({target:"window",type:"storage",listener:function(e){var r="local"===n?window.localStorage:window.sessionStorage;if(e.storageArea===r&&e.key===t){var u=e.newValue?JSON.parse(e.newValue):void 0;f(u)}}}),2),o=u[0],i=u[1],a=v(c.useState(e),2),l=a[0],f=a[1];return c.useEffect((function(){r||f(e);try{var u="local"===n?window.localStorage.getItem(t):window.sessionStorage.getItem(t);f(u?JSON.parse(u):e)}catch(t){f(e)}return o(),function(){return i()}}),[]),[l,function(e){try{var u=e instanceof Function?e(l):e;if(f(u),r){var o=JSON.stringify(u);"local"===n?window.localStorage.setItem(t,o):window.sessionStorage.setItem(t,o)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(t))}}]},N=0;return e.ESC_KEY_HANDLING_PRIORITIES={SIDEBAR:100,SLIDE_MENU:200,DIALOG:300,IMAGE:400,MENU:500,OVERLAY_PANEL:600,PASSWORD:700,CASCADE_SELECT:800,SPLIT_BUTTON:900,SPEED_DIAL:1e3},e.useClickOutside=function(e,t){var n=function(n){e.current&&!e.current.contains(n.target)&&t(n)},r=v(p({type:"mousedown",listener:n}),2),u=r[0],o=r[1],i=v(p({type:"touchstart",listener:n}),2),a=i[0],l=i[1];return c.useEffect((function(){if(e.current)return u(),a(),function(){o(),l()}})),[e,t]},e.useCounter=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{step:1},t=v(c.useState(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0),2),n=t[0],r=t[1];return{count:n,increment:function(){e.max&&n>=e.max||r(n+e.step)},decrement:function(){if(e.min||0===e.min&&n<=e.min)return null;r(n-e.step)},reset:function(){r(0)}}},e.useDebounce=function(e,t){var n=v(c.useState(e),2),r=n[0],u=n[1],o=v(c.useState(e),2),i=o[0],a=o[1],l=c.useRef(!1),f=c.useRef(null),s=function(){return window.clearTimeout(f.current)};return D((function(){l.current=!0})),m((function(){s()})),c.useEffect((function(){l.current&&(s(),f.current=window.setTimeout((function(){a(r)}),t))}),[r,t]),[r,i,u]},e.useDisplayOrder=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=v(c.useState((function(){return n.UniqueComponentId()})),1)[0],u=v(c.useState(0),2),o=u[0],i=u[1];return c.useEffect((function(){if(t){g[e]||(g[e]=[]);var u=g[e].push(r);return i(u),function(){delete g[e][u-1];var t=g[e].length-1,r=n.ObjectUtils.findLastIndex(g[e],(function(e){return void 0!==e}));r!==t&&g[e].splice(r+1),i(void 0)}}}),[e,r,t]),o},e.useEventListener=p,e.useFavicon=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"shortcut icon";c.useLayoutEffect((function(){if(e){document.querySelectorAll("link[rel*='icon']").forEach((function(e){document.head.removeChild(e)}));var n=document.createElement("link");n.setAttribute("type",h[e.split(".").pop()]),n.setAttribute("rel",t),n.setAttribute("href",e),document.head.appendChild(n)}}),[e,t])},e.useGlobalOnEscapeKey=function(e){var n=e.callback,r=e.when,u=e.priority;t.useEffect((function(){if(r)return S.addListener(n,u)}),[n,r,u])},e.useIntersectionObserver=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=v(c.useState(!1),2),r=n[0],u=n[1];return c.useEffect((function(){if(e.current){var n=new IntersectionObserver((function(e){var t=v(e,1);u(t[0].isIntersecting)}),t);return n.observe(e.current),function(){n.disconnect()}}}),[t,e]),r},e.useInterval=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=c.useRef(null),u=c.useRef(null),o=c.useCallback((function(){return clearInterval(r.current)}),[r.current]);return c.useEffect((function(){u.current=e})),c.useEffect((function(){if(n)return r.current=setInterval((function(){u.current()}),t),o;o()}),[t,n]),m((function(){o()})),[o]},e.useLocalStorage=function(e,t){return k(e,t,"local")},e.useMatchMedia=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=v(c.useState(!1),2),r=n[0],u=n[1],o=c.useRef(null),i=function(e){return u(e.matches)},a=function(){return o.current&&o.current.removeEventListener("change",i)&&(o.current=null)};return c.useEffect((function(){return t&&(o.current=window.matchMedia(e),u(o.current.matches),o.current&&o.current.addEventListener("change",i)),a}),[e,t]),r},e.useMergeProps=function(){var e=t.useContext(r.PrimeReactContext);return function(){for(var t=arguments.length,r=new Array(t),u=0;u<t;u++)r[u]=arguments[u];return n.mergeProps(r,null==e?void 0:e.ptOptions)}},e.useMountEffect=D,e.useMouse=function(){var e=v(c.useState({x:0,y:0}),2),t=e[0],n=e[1],r=c.useRef(null),u=c.useCallback((function(e){var t,u;if(r.current){var o=e.currentTarget.getBoundingClientRect();t=e.pageX-o.left-(window.pageXOffset||window.scrollX),u=e.pageY-o.top-(window.pageYOffset||window.scrollY)}else t=e.clientX,u=e.clientY;n({x:Math.max(0,Math.round(t)),y:Math.max(0,Math.round(u))})}),[]),o=v(p({target:r,type:"mousemove",listener:u}),2),i=o[0],a=o[1],l=v(p({type:"mousemove",listener:u}),2),f=l[0],s=l[1];return c.useEffect((function(){return i(),r.current||f(),function(){a(),r.current||s()}}),[f,i,s,a]),C(C({ref:r},t),{},{reset:function(){return n({x:0,y:0})}})},e.useMove=function(e){var t=e.mode,n=void 0===t?"both":t,r=e.initialValue,u=void 0===r?{x:0,y:0}:r,o=v(c.useState(u),2),i=o[0],a=o[1],l=v(c.useState(!1),2),f=l[0],s=l[1],d=c.useRef(!1),y=c.useRef(!1),m=c.useRef(null),g=function(e){return z({x:e.clientX,y:e.clientY})},h=function(e){var t=e.clampedX,r=e.clampedY;"vertical"===n?a({y:1-r}):"horizontal"===n?a({x:t}):"both"===n&&a({x:t,y:r})},b=function(){y.current&&d.current&&(y.current=!1,s(!1),G())},w=function(e){e.cancelable&&e.preventDefault(),z({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})},E=v(p({type:"mousemove",listener:g}),2),O=E[0],S=E[1],D=v(p({type:"mouseup",listener:b}),2),j=D[0],P=D[1],R=v(p({type:"touchmove",listener:w}),2),x=R[0],L=R[1],C=v(p({type:"touchend",listener:b}),2),I=C[0],M=C[1],T=v(p({target:m,type:"mousedown",listener:function(e){X(),e.preventDefault(),g(e)}}),2),k=T[0],N=T[1],H=v(p({target:m,type:"touchstart",listener:function(e){e.cancelable&&e.preventDefault(),X(),w(e)},options:{passive:!1}}),2),_=H[0],K=H[1],Y=function(e,t,n){return Math.min(Math.max(e,t),n)},U=function(e){var t=e.y;return{clampedX:Y(e.x,0,1),clampedY:Y(t,0,1)}},G=function(){S(),P(),L(),M()};c.useEffect((function(){d.current=!0}),[]);var X=function(){!y.current&&d.current&&(y.current=!0,s(!0),O(),j(),x(),I())},z=function(e){var t=e.x,n=e.y;if(y.current){var r=m.current.getBoundingClientRect(),u=U({x:(t-r.left)/r.width,y:(n-r.top)/r.height});h({clampedX:u.clampedX,clampedY:u.clampedY})}};return c.useEffect((function(){return m.current&&(k(),_()),function(){m.current&&(N(),K())}}),[k,_,i,N,K]),A(A({ref:m},i),{},{active:f,reset:function(){a(u)}})},e.useOverlayListener=function(e){var t=e.target,r=e.overlay,u=e.listener,o=e.when,i=void 0===o||o,a=e.type,l=void 0===a?"click":a,f=c.useRef(null),s=c.useRef(null),d=v(p({target:"window",type:l,listener:function(e){u&&u(e,{type:"outside",valid:3!==e.which&&R(e)})}}),2),y=d[0],g=d[1],h=v(T({target:"window",listener:function(e){u&&u(e,{type:"resize",valid:!n.DomHandler.isTouchDevice()})}}),2),b=h[0],w=h[1],E=v(p({target:"window",type:"orientationchange",listener:function(e){u&&u(e,{type:"orientationchange",valid:!0})}}),2),O=E[0],S=E[1],D=v(M({target:t,listener:function(e){u&&u(e,{type:"scroll",valid:!0})}}),2),j=D[0],P=D[1],R=function(e){return f.current&&!(f.current.isSameNode(e.target)||f.current.contains(e.target)||s.current&&s.current.contains(e.target))},x=function(){g(),w(),S(),P()};return c.useEffect((function(){i?(f.current=n.DomHandler.getTargetElement(t),s.current=n.DomHandler.getTargetElement(r)):(x(),f.current=s.current=null)}),[t,r,i]),c.useEffect((function(){x()}),[i]),m((function(){x()})),[function(){y(),b(),O(),j()},x]},e.useOverlayScrollListener=M,e.usePrevious=y,e.useResizeListener=T,e.useSessionStorage=function(e,t){return k(e,t,"session")},e.useStorage=k,e.useStyle=function(e){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=v(t.useState(!1),2),c=o[0],a=o[1],l=t.useRef(null),f=t.useContext(r.PrimeReactContext),s=n.DomHandler.isClient()?window.document:void 0,d=u.document,y=void 0===d?s:d,m=u.manual,p=void 0!==m&&m,g=u.name,h=void 0===g?"style_".concat(++N):g,b=u.id,w=void 0===b?void 0:b,E=u.media,O=void 0===E?void 0:E,S=function(e){var t=e.querySelector('style[data-primereact-style-id="'.concat(h,'"]'));if(t)return t;if(void 0!==w){var n=y.getElementById(w);if(n)return n}return y.createElement("style")},D=function(){if(y&&!c){var t=(null==f?void 0:f.styleContainer)||y.head;l.current=S(t),l.current.isConnected||(l.current.type="text/css",w&&(l.current.id=w),O&&(l.current.media=O),n.DomHandler.addNonce(l.current,f&&f.nonce||i.default.nonce),t.appendChild(l.current),h&&l.current.setAttribute("data-primereact-style-id",h)),l.current.textContent=e,a(!0)}};return t.useEffect((function(){p||D()}),[p]),{id:w,name:h,update:function(t){c&&e!==t&&(l.current.textContent=t)},unload:function(){y&&l.current&&(n.DomHandler.removeInlineStyle(l.current),a(!1))},load:D,isLoaded:c}},e.useTimeout=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=c.useRef(null),u=c.useRef(null),o=c.useCallback((function(){return clearTimeout(r.current)}),[r.current]);return c.useEffect((function(){u.current=e})),c.useEffect((function(){if(n)return r.current=setTimeout((function(){u.current()}),t),o;o()}),[t,n]),m((function(){o()})),[o]},e.useUnmountEffect=m,e.useUpdateEffect=function(e,t){var n=c.useRef(!1);return c.useEffect((function(){if(n.current)return e&&e();n.current=!0}),t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.api);
|
package/image/image.cjs.js
CHANGED
|
@@ -283,11 +283,9 @@ var Image = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
283
283
|
isUnstyled = _ImageBase$setMetaDat.isUnstyled;
|
|
284
284
|
hooks.useGlobalOnEscapeKey({
|
|
285
285
|
callback: function callback() {
|
|
286
|
-
|
|
287
|
-
hide();
|
|
288
|
-
}
|
|
286
|
+
hide();
|
|
289
287
|
},
|
|
290
|
-
when: maskVisibleState,
|
|
288
|
+
when: props.closeOnEscape && maskVisibleState,
|
|
291
289
|
priority: [hooks.ESC_KEY_HANDLING_PRIORITIES.IMAGE,
|
|
292
290
|
// Assume that there could be only one image mask activated, so it's safe
|
|
293
291
|
// to provide one and the same priority all the time:
|
|
@@ -337,23 +335,27 @@ var Image = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
337
335
|
src: src
|
|
338
336
|
});
|
|
339
337
|
};
|
|
340
|
-
var rotateRight = function rotateRight() {
|
|
338
|
+
var rotateRight = function rotateRight(event) {
|
|
339
|
+
event.stopPropagation();
|
|
341
340
|
setRotateState(function (prevRotate) {
|
|
342
341
|
return prevRotate + 90;
|
|
343
342
|
});
|
|
344
343
|
};
|
|
345
|
-
var rotateLeft = function rotateLeft() {
|
|
344
|
+
var rotateLeft = function rotateLeft(event) {
|
|
345
|
+
event.stopPropagation();
|
|
346
346
|
setRotateState(function (prevRotate) {
|
|
347
347
|
return prevRotate - 90;
|
|
348
348
|
});
|
|
349
349
|
};
|
|
350
|
-
var zoomIn = function zoomIn() {
|
|
350
|
+
var zoomIn = function zoomIn(event) {
|
|
351
|
+
event.stopPropagation();
|
|
351
352
|
setScaleState(function (prevScale) {
|
|
352
353
|
if (zoomInDisabled) return prevScale;
|
|
353
354
|
return prevScale + 0.1;
|
|
354
355
|
});
|
|
355
356
|
};
|
|
356
|
-
var zoomOut = function zoomOut() {
|
|
357
|
+
var zoomOut = function zoomOut(event) {
|
|
358
|
+
event.stopPropagation();
|
|
357
359
|
setScaleState(function (prevScale) {
|
|
358
360
|
if (zoomOutDisabled) return prevScale;
|
|
359
361
|
return prevScale - 0.1;
|
|
@@ -366,7 +368,7 @@ var Image = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
366
368
|
props.onShow && props.onShow();
|
|
367
369
|
};
|
|
368
370
|
var onExit = function onExit() {
|
|
369
|
-
utils.DomHandler.addClass(maskRef.current, 'p-component-overlay-leave');
|
|
371
|
+
!isUnstyled() && utils.DomHandler.addClass(maskRef.current, 'p-component-overlay-leave');
|
|
370
372
|
};
|
|
371
373
|
var onExiting = function onExiting() {
|
|
372
374
|
props.onHide && props.onHide();
|
package/image/image.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/componentbase"),o=require("primereact/csstransition"),r=require("primereact/hooks"),i=require("primereact/iconbase"),a=require("primereact/icons/eye"),l=require("primereact/icons/refresh"),c=require("primereact/icons/searchminus"),s=require("primereact/icons/searchplus"),u=require("primereact/icons/times"),p=require("primereact/icons/undo"),m=require("primereact/portal"),f=require("primereact/utils");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function g(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var b=g(e),y=d(t);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},v.apply(this,arguments)}function w(e){return w="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},w(e)}function I(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==w(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e){var t=I(e,"string");return"symbol"===w(t)?t:String(t)}function O(e){if(Array.isArray(e))return e}function C(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw r}}return l}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function S(e,t){if(e){if("string"==typeof e)return E(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)?E(e,t):void 0}}function j(){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 x(e,t){return O(e)||C(e,t)||S(e,t)||j()}var P=b.memo(b.forwardRef((function(e,t){var n=i.IconBase.getPTI(e);return b.createElement("svg",v({ref:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.0118 10C6.93296 10.0003 6.85484 9.98495 6.78202 9.95477C6.7091 9.92454 6.64297 9.88008 6.58749 9.82399L3.38288 6.62399C3.27675 6.51025 3.21897 6.35982 3.22171 6.20438C3.22446 6.04893 3.28752 5.90063 3.39761 5.7907C3.5077 5.68077 3.65622 5.6178 3.81188 5.61505C3.96755 5.61231 4.1182 5.67001 4.23211 5.77599L6.41125 7.95201V0.6C6.41125 0.44087 6.47456 0.288258 6.58724 0.175736C6.69993 0.063214 6.85276 0 7.01212 0C7.17148 0 7.32431 0.063214 7.43699 0.175736C7.54968 0.288258 7.61298 0.44087 7.61298 0.6V7.95198L9.7921 5.77599C9.90601 5.67001 10.0567 5.61231 10.2123 5.61505C10.368 5.6178 10.5165 5.68077 10.6266 5.7907C10.7367 5.90063 10.7997 6.04893 10.8025 6.20438C10.8052 6.35982 10.7475 6.51025 10.6413 6.62399L7.43671 9.82399C7.38124 9.88008 7.3151 9.92454 7.24219 9.95477C7.16938 9.98495 7.09127 10.0003 7.01244 10C7.01233 10 7.01223 10 7.01212 10C7.01201 10 7.0119 10 7.0118 10ZM13.45 13.3115C13.0749 13.7235 12.5521 13.971 11.9952 14H2.02889C1.75106 13.9887 1.47819 13.9228 1.2259 13.806C0.973606 13.6893 0.74684 13.524 0.558578 13.3197C0.370316 13.1153 0.224251 12.8759 0.128742 12.6152C0.0332333 12.3544 -0.00984502 12.0774 0.00197194 11.8V9.39999C0.00197194 9.24086 0.065277 9.08825 0.177961 8.97572C0.290645 8.8632 0.443477 8.79999 0.602836 8.79999C0.762195 8.79999 0.915027 8.8632 1.02771 8.97572C1.1404 9.08825 1.2037 9.24086 1.2037 9.39999V11.8C1.18301 12.0375 1.25469 12.2739 1.40385 12.4601C1.55302 12.6463 1.76823 12.768 2.00485 12.8H11.9952C12.2318 12.768 12.4471 12.6463 12.5962 12.4601C12.7454 12.2739 12.8171 12.0375 12.7964 11.8V9.39999C12.7964 9.24086 12.8597 9.08825 12.9724 8.97572C13.085 8.8632 13.2379 8.79999 13.3972 8.79999C13.5566 8.79999 13.7094 8.8632 13.8221 8.97572C13.9348 9.08825 13.9981 9.24086 13.9981 9.39999V11.8C14.0221 12.3563 13.8251 12.8995 13.45 13.3115Z",fill:"currentColor"}))})));P.displayName="DownloadIcon";var k=n.ComponentBase.extend({defaultProps:{__TYPE:"Image",alt:null,className:null,closeIcon:null,crossOrigin:null,decoding:null,downloadIcon:null,downloadable:!1,height:null,imageClassName:null,imageStyle:null,indicatorIcon:null,loading:null,onError:null,onHide:null,onShow:null,preview:!1,referrerPolicy:null,rotateLeftIcon:null,rotateRightIcon:null,src:null,template:null,useMap:null,width:null,zoomInIcon:null,zoomOutIcon:null,zoomSrc:null,children:void 0,closeOnEscape:!0},css:{classes:{button:"p-image-preview-indicator",mask:"p-image-mask p-component-overlay p-component-overlay-enter",toolbar:"p-image-toolbar",downloadButton:"p-image-action p-link",rotateRightButton:"p-image-action p-link",rotateLeftButton:"p-image-action p-link",zoomOutButton:"p-image-action p-link",zoomInButton:"p-image-action p-link",closeButton:"p-image-action p-link",preview:"p-image-preview",icon:"p-image-preview-icon",root:function(e){var t=e.props;return f.classNames("p-image p-component",t.className,{"p-image-preview-container":t.preview})},transition:"p-image-preview"},styles:"\n@layer primereact {\n .p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .p-image-preview-container {\n position: relative;\n display: inline-block;\n line-height: 0;\n }\n \n .p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity .3s;\n border: none;\n padding: 0;\n }\n \n .p-image-preview-icon {\n font-size: 1.5rem;\n }\n \n .p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n }\n \n .p-image-preview-container > img {\n cursor: pointer;\n }\n \n .p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n z-index: 1;\n }\n \n .p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .p-image-preview {\n transition: transform .15s;\n max-width: 100vw;\n max-height: 100vh;\n width: 100%;\n height: 100%;\n }\n \n .p-image-preview-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-image-preview-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-image-preview-enter-done {\n transform: none;\n }\n \n .p-image-preview-exit {\n opacity: 1;\n }\n \n .p-image-preview-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0.0, 0.2, 1);\n }\n}\n",inlineStyles:{preview:function(e){return{transform:"rotate("+e.rotateState+"deg) scale("+e.scaleState+")"}}}}});function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){var o,r,i;o=e,i=n[t],(r=h(r=t))in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=b.memo(b.forwardRef((function(e,i){var d=r.useMergeProps(),g=b.useContext(t.PrimeReactContext),w=k.getProps(e,g),I=x(b.useState(!1),2),h=I[0],O=I[1],C=x(b.useState(!1),2),E=C[0],S=C[1],j=x(b.useState(0),2),N=j[0],B=j[1],R=x(b.useState(1),2),U=R[0],D=R[1],q=b.useRef(null),M=b.useRef(null),H=b.useRef(null),L=b.useRef(null),T=b.useRef(null),A=U<=.5,_=U>=1.5,J=k.setMetaData({props:w,state:{maskVisible:h,previewVisible:E,rotate:N,scale:U}}),V=J.ptm,X=J.cx,Z=J.sx,G=J.isUnstyled;r.useGlobalOnEscapeKey({callback:function(){w.closeOnEscape&&Y()},when:h,priority:[r.ESC_KEY_HANDLING_PRIORITIES.IMAGE,0]}),n.useHandleStyle(k.css.styles,G,{name:"image"});var K=function(){w.preview&&(O(!0),f.DomHandler.blockBodyScroll(),setTimeout((function(){S(!0)}),25))},Y=function(){S(!1),f.DomHandler.unblockBodyScroll(),B(0),D(1)},F=function(e){[e.target.classList].includes("p-image-action")||e.target.closest(".p-image-action")||Y()},$=function(e){if("Escape"===e.code)Y(),setTimeout((function(){f.DomHandler.focus(T.current)}),200),e.preventDefault()},Q=function(){f.DomHandler.saveAs({name:w.alt,src:w.src})},W=function(){B((function(e){return e+90}))},ee=function(){B((function(e){return e-90}))},te=function(){D((function(e){return _?e:e+.1}))},ne=function(){D((function(e){return A?e:e-.1}))},oe=function(){f.ZIndexUtils.set("modal",H.current,g&&g.autoZIndex||y.default.autoZIndex,g&&g.zIndex.modal||y.default.zIndex.modal)},re=function(){w.onShow&&w.onShow()},ie=function(){f.DomHandler.addClass(H.current,"p-component-overlay-leave")},ae=function(){w.onHide&&w.onHide()},le=function(){f.ZIndexUtils.clear(H.current),O(!1)};r.useUnmountEffect((function(){H.current&&f.ZIndexUtils.clear(H.current)}));b.useImperativeHandle(i,(function(){return{props:w,show:K,hide:Y,getElement:function(){return q.current},getImage:function(){return M.current}}}));var ce,se,ue=w.src,pe=w.alt,me=w.width,fe=w.height,de=w.crossOrigin,ge=w.referrerPolicy,be=w.useMap,ye=w.loading,ve=function(){var e=w.downloadable,n=w.alt,r=w.crossOrigin,i=w.referrerPolicy,a=w.useMap,m=w.loading,g=d(V("downloadIcon")),y=d(V("rotateRightIcon")),I=d(V("rotateLeftIcon")),O=d(V("zoomOutIcon")),C=d(V("zoomInIcon")),S=d(V("closeIcon")),j=f.IconUtils.getJSXIcon(w.downloadIcon||b.createElement(P,null),z({},g),{props:w}),x=f.IconUtils.getJSXIcon(w.rotateRightIcon||b.createElement(l.RefreshIcon,null),z({},y),{props:w}),k=f.IconUtils.getJSXIcon(w.rotateLeftIcon||b.createElement(p.UndoIcon,null),z({},I),{props:w}),B=f.IconUtils.getJSXIcon(w.zoomOutIcon||b.createElement(c.SearchMinusIcon,null),z({},O),{props:w}),R=f.IconUtils.getJSXIcon(w.zoomInIcon||b.createElement(s.SearchPlusIcon,null),z({},C),{props:w}),D=f.IconUtils.getJSXIcon(w.closeIcon||b.createElement(u.TimesIcon,null),z({},S),{props:w}),q=d({ref:H,role:"dialog",className:X("mask"),"aria-modal":h,onClick:F,onKeyDown:$},V("mask")),M=d({className:X("toolbar")},V("toolbar")),T=d({className:X("downloadButton"),onPointerUp:Q,type:"button"},V("downloadButton")),J=d({className:X("rotateRightButton"),onClick:W,type:"button","aria-label":t.localeOption("aria")?t.localeOption("aria").rotateRight:void 0,"data-pc-group-section":"action"},V("rotateRightButton")),G=d({className:X("rotateLeftButton"),onClick:ee,type:"button","aria-label":t.localeOption("aria")?t.localeOption("aria").rotateLeft:void 0,"data-pc-group-section":"action"},V("rotateLeftButton")),K=d({className:f.classNames(X("zoomOutButton"),{"p-disabled":A}),style:{pointerEvents:"auto"},onClick:ne,type:"button",disabled:A,"aria-label":t.localeOption("aria")?t.localeOption("aria").zoomOut:void 0,"data-pc-group-section":"action"},V("zoomOutButton")),ce=d({className:f.classNames(X("zoomInButton"),{"p-disabled":_}),style:{pointerEvents:"auto"},onClick:te,type:"button",disabled:_,"aria-label":t.localeOption("aria")?t.localeOption("aria").zoomIn:void 0,"data-pc-group-section":"action"},V("zoomInButton")),se=d({className:X("closeButton"),type:"button",onClick:Y,"aria-label":t.localeOption("aria")?t.localeOption("aria").close:void 0,autoFocus:!0,"data-pc-group-section":"action"},V("closeButton")),ue=d({src:w.zoomSrc||w.src,className:X("preview"),style:Z("preview",{rotateState:N,scaleState:U}),crossOrigin:r,referrerPolicy:i,useMap:a,loading:m},V("preview")),pe=d({ref:L},V("previewContainer")),me=d({classNames:X("transition"),in:E,timeout:{enter:150,exit:150},unmountOnExit:!0,onEntering:oe,onEntered:re,onExit:ie,onExiting:ae,onExited:le},V("transition"));return b.createElement("div",q,b.createElement("div",M,e&&b.createElement("button",T,j),b.createElement("button",J,x),b.createElement("button",G,k),b.createElement("button",K,B),b.createElement("button",ce,R),b.createElement("button",se,D)),b.createElement(o.CSSTransition,v({nodeRef:L},me),b.createElement("div",pe,b.createElement("img",v({alt:n},ue)))))}(),we=d({className:X("icon")},V("icon")),Ie=f.IconUtils.getJSXIcon(w.indicatorIcon||b.createElement(a.EyeIcon,we),z({},we),{props:w}),he=w.template?f.ObjectUtils.getJSXElement(w.template,w):Ie,Oe=(ce=t.localeOption("aria")?t.localeOption("aria").zoomImage:void 0,se=d({ref:T,className:X("button"),onClick:K,type:"button","aria-label":ce},V("button")),w.preview?b.createElement("button",se,he):null),Ce=d({ref:M,src:ue,className:w.imageClassName,width:me,height:fe,crossOrigin:de,referrerPolicy:ge,useMap:be,loading:ye,style:w.imageStyle,onError:w.onError},V("image")),Ee=w.src&&b.createElement("img",v({},Ce,{alt:pe})),Se=d({ref:q,className:X("root")},k.getOtherProps(w),V("root"));return b.createElement("span",Se,Ee,Oe,h&&b.createElement(m.Portal,{element:ve,appendTo:document.body}))})));B.displayName="Image",exports.Image=B;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/componentbase"),o=require("primereact/csstransition"),r=require("primereact/hooks"),a=require("primereact/iconbase"),i=require("primereact/icons/eye"),l=require("primereact/icons/refresh"),c=require("primereact/icons/searchminus"),s=require("primereact/icons/searchplus"),u=require("primereact/icons/times"),p=require("primereact/icons/undo"),m=require("primereact/portal"),f=require("primereact/utils");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function g(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var b=g(e),y=d(t);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},v.apply(this,arguments)}function w(e){return w="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},w(e)}function I(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==w(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e){var t=I(e,"string");return"symbol"===w(t)?t:String(t)}function O(e){if(Array.isArray(e))return e}function C(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,a,i,l=[],c=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=a.call(n)).done)&&(l.push(o.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw r}}return l}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function S(e,t){if(e){if("string"==typeof e)return E(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)?E(e,t):void 0}}function P(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e,t){return O(e)||C(e,t)||S(e,t)||P()}var x=b.memo(b.forwardRef((function(e,t){var n=a.IconBase.getPTI(e);return b.createElement("svg",v({ref:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.0118 10C6.93296 10.0003 6.85484 9.98495 6.78202 9.95477C6.7091 9.92454 6.64297 9.88008 6.58749 9.82399L3.38288 6.62399C3.27675 6.51025 3.21897 6.35982 3.22171 6.20438C3.22446 6.04893 3.28752 5.90063 3.39761 5.7907C3.5077 5.68077 3.65622 5.6178 3.81188 5.61505C3.96755 5.61231 4.1182 5.67001 4.23211 5.77599L6.41125 7.95201V0.6C6.41125 0.44087 6.47456 0.288258 6.58724 0.175736C6.69993 0.063214 6.85276 0 7.01212 0C7.17148 0 7.32431 0.063214 7.43699 0.175736C7.54968 0.288258 7.61298 0.44087 7.61298 0.6V7.95198L9.7921 5.77599C9.90601 5.67001 10.0567 5.61231 10.2123 5.61505C10.368 5.6178 10.5165 5.68077 10.6266 5.7907C10.7367 5.90063 10.7997 6.04893 10.8025 6.20438C10.8052 6.35982 10.7475 6.51025 10.6413 6.62399L7.43671 9.82399C7.38124 9.88008 7.3151 9.92454 7.24219 9.95477C7.16938 9.98495 7.09127 10.0003 7.01244 10C7.01233 10 7.01223 10 7.01212 10C7.01201 10 7.0119 10 7.0118 10ZM13.45 13.3115C13.0749 13.7235 12.5521 13.971 11.9952 14H2.02889C1.75106 13.9887 1.47819 13.9228 1.2259 13.806C0.973606 13.6893 0.74684 13.524 0.558578 13.3197C0.370316 13.1153 0.224251 12.8759 0.128742 12.6152C0.0332333 12.3544 -0.00984502 12.0774 0.00197194 11.8V9.39999C0.00197194 9.24086 0.065277 9.08825 0.177961 8.97572C0.290645 8.8632 0.443477 8.79999 0.602836 8.79999C0.762195 8.79999 0.915027 8.8632 1.02771 8.97572C1.1404 9.08825 1.2037 9.24086 1.2037 9.39999V11.8C1.18301 12.0375 1.25469 12.2739 1.40385 12.4601C1.55302 12.6463 1.76823 12.768 2.00485 12.8H11.9952C12.2318 12.768 12.4471 12.6463 12.5962 12.4601C12.7454 12.2739 12.8171 12.0375 12.7964 11.8V9.39999C12.7964 9.24086 12.8597 9.08825 12.9724 8.97572C13.085 8.8632 13.2379 8.79999 13.3972 8.79999C13.5566 8.79999 13.7094 8.8632 13.8221 8.97572C13.9348 9.08825 13.9981 9.24086 13.9981 9.39999V11.8C14.0221 12.3563 13.8251 12.8995 13.45 13.3115Z",fill:"currentColor"}))})));x.displayName="DownloadIcon";var k=n.ComponentBase.extend({defaultProps:{__TYPE:"Image",alt:null,className:null,closeIcon:null,crossOrigin:null,decoding:null,downloadIcon:null,downloadable:!1,height:null,imageClassName:null,imageStyle:null,indicatorIcon:null,loading:null,onError:null,onHide:null,onShow:null,preview:!1,referrerPolicy:null,rotateLeftIcon:null,rotateRightIcon:null,src:null,template:null,useMap:null,width:null,zoomInIcon:null,zoomOutIcon:null,zoomSrc:null,children:void 0,closeOnEscape:!0},css:{classes:{button:"p-image-preview-indicator",mask:"p-image-mask p-component-overlay p-component-overlay-enter",toolbar:"p-image-toolbar",downloadButton:"p-image-action p-link",rotateRightButton:"p-image-action p-link",rotateLeftButton:"p-image-action p-link",zoomOutButton:"p-image-action p-link",zoomInButton:"p-image-action p-link",closeButton:"p-image-action p-link",preview:"p-image-preview",icon:"p-image-preview-icon",root:function(e){var t=e.props;return f.classNames("p-image p-component",t.className,{"p-image-preview-container":t.preview})},transition:"p-image-preview"},styles:"\n@layer primereact {\n .p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .p-image-preview-container {\n position: relative;\n display: inline-block;\n line-height: 0;\n }\n \n .p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity .3s;\n border: none;\n padding: 0;\n }\n \n .p-image-preview-icon {\n font-size: 1.5rem;\n }\n \n .p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n }\n \n .p-image-preview-container > img {\n cursor: pointer;\n }\n \n .p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n z-index: 1;\n }\n \n .p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .p-image-preview {\n transition: transform .15s;\n max-width: 100vw;\n max-height: 100vh;\n width: 100%;\n height: 100%;\n }\n \n .p-image-preview-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-image-preview-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-image-preview-enter-done {\n transform: none;\n }\n \n .p-image-preview-exit {\n opacity: 1;\n }\n \n .p-image-preview-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0.0, 0.2, 1);\n }\n}\n",inlineStyles:{preview:function(e){return{transform:"rotate("+e.rotateState+"deg) scale("+e.scaleState+")"}}}}});function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){var o,r,a;o=e,a=n[t],(r=h(r=t))in o?Object.defineProperty(o,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[r]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=b.memo(b.forwardRef((function(e,a){var d=r.useMergeProps(),g=b.useContext(t.PrimeReactContext),w=k.getProps(e,g),I=j(b.useState(!1),2),h=I[0],O=I[1],C=j(b.useState(!1),2),E=C[0],S=C[1],P=j(b.useState(0),2),N=P[0],B=P[1],R=j(b.useState(1),2),U=R[0],D=R[1],q=b.useRef(null),M=b.useRef(null),H=b.useRef(null),L=b.useRef(null),T=b.useRef(null),A=U<=.5,_=U>=1.5,J=k.setMetaData({props:w,state:{maskVisible:h,previewVisible:E,rotate:N,scale:U}}),V=J.ptm,X=J.cx,Z=J.sx,G=J.isUnstyled;r.useGlobalOnEscapeKey({callback:function(){Y()},when:w.closeOnEscape&&h,priority:[r.ESC_KEY_HANDLING_PRIORITIES.IMAGE,0]}),n.useHandleStyle(k.css.styles,G,{name:"image"});var K=function(){w.preview&&(O(!0),f.DomHandler.blockBodyScroll(),setTimeout((function(){S(!0)}),25))},Y=function(){S(!1),f.DomHandler.unblockBodyScroll(),B(0),D(1)},F=function(e){[e.target.classList].includes("p-image-action")||e.target.closest(".p-image-action")||Y()},$=function(e){if("Escape"===e.code)Y(),setTimeout((function(){f.DomHandler.focus(T.current)}),200),e.preventDefault()},Q=function(){f.DomHandler.saveAs({name:w.alt,src:w.src})},W=function(e){e.stopPropagation(),B((function(e){return e+90}))},ee=function(e){e.stopPropagation(),B((function(e){return e-90}))},te=function(e){e.stopPropagation(),D((function(e){return _?e:e+.1}))},ne=function(e){e.stopPropagation(),D((function(e){return A?e:e-.1}))},oe=function(){f.ZIndexUtils.set("modal",H.current,g&&g.autoZIndex||y.default.autoZIndex,g&&g.zIndex.modal||y.default.zIndex.modal)},re=function(){w.onShow&&w.onShow()},ae=function(){!G()&&f.DomHandler.addClass(H.current,"p-component-overlay-leave")},ie=function(){w.onHide&&w.onHide()},le=function(){f.ZIndexUtils.clear(H.current),O(!1)};r.useUnmountEffect((function(){H.current&&f.ZIndexUtils.clear(H.current)}));b.useImperativeHandle(a,(function(){return{props:w,show:K,hide:Y,getElement:function(){return q.current},getImage:function(){return M.current}}}));var ce,se,ue=w.src,pe=w.alt,me=w.width,fe=w.height,de=w.crossOrigin,ge=w.referrerPolicy,be=w.useMap,ye=w.loading,ve=function(){var e=w.downloadable,n=w.alt,r=w.crossOrigin,a=w.referrerPolicy,i=w.useMap,m=w.loading,g=d(V("downloadIcon")),y=d(V("rotateRightIcon")),I=d(V("rotateLeftIcon")),O=d(V("zoomOutIcon")),C=d(V("zoomInIcon")),S=d(V("closeIcon")),P=f.IconUtils.getJSXIcon(w.downloadIcon||b.createElement(x,null),z({},g),{props:w}),j=f.IconUtils.getJSXIcon(w.rotateRightIcon||b.createElement(l.RefreshIcon,null),z({},y),{props:w}),k=f.IconUtils.getJSXIcon(w.rotateLeftIcon||b.createElement(p.UndoIcon,null),z({},I),{props:w}),B=f.IconUtils.getJSXIcon(w.zoomOutIcon||b.createElement(c.SearchMinusIcon,null),z({},O),{props:w}),R=f.IconUtils.getJSXIcon(w.zoomInIcon||b.createElement(s.SearchPlusIcon,null),z({},C),{props:w}),D=f.IconUtils.getJSXIcon(w.closeIcon||b.createElement(u.TimesIcon,null),z({},S),{props:w}),q=d({ref:H,role:"dialog",className:X("mask"),"aria-modal":h,onClick:F,onKeyDown:$},V("mask")),M=d({className:X("toolbar")},V("toolbar")),T=d({className:X("downloadButton"),onPointerUp:Q,type:"button"},V("downloadButton")),J=d({className:X("rotateRightButton"),onClick:W,type:"button","aria-label":t.localeOption("aria")?t.localeOption("aria").rotateRight:void 0,"data-pc-group-section":"action"},V("rotateRightButton")),G=d({className:X("rotateLeftButton"),onClick:ee,type:"button","aria-label":t.localeOption("aria")?t.localeOption("aria").rotateLeft:void 0,"data-pc-group-section":"action"},V("rotateLeftButton")),K=d({className:f.classNames(X("zoomOutButton"),{"p-disabled":A}),style:{pointerEvents:"auto"},onClick:ne,type:"button",disabled:A,"aria-label":t.localeOption("aria")?t.localeOption("aria").zoomOut:void 0,"data-pc-group-section":"action"},V("zoomOutButton")),ce=d({className:f.classNames(X("zoomInButton"),{"p-disabled":_}),style:{pointerEvents:"auto"},onClick:te,type:"button",disabled:_,"aria-label":t.localeOption("aria")?t.localeOption("aria").zoomIn:void 0,"data-pc-group-section":"action"},V("zoomInButton")),se=d({className:X("closeButton"),type:"button",onClick:Y,"aria-label":t.localeOption("aria")?t.localeOption("aria").close:void 0,autoFocus:!0,"data-pc-group-section":"action"},V("closeButton")),ue=d({src:w.zoomSrc||w.src,className:X("preview"),style:Z("preview",{rotateState:N,scaleState:U}),crossOrigin:r,referrerPolicy:a,useMap:i,loading:m},V("preview")),pe=d({ref:L},V("previewContainer")),me=d({classNames:X("transition"),in:E,timeout:{enter:150,exit:150},unmountOnExit:!0,onEntering:oe,onEntered:re,onExit:ae,onExiting:ie,onExited:le},V("transition"));return b.createElement("div",q,b.createElement("div",M,e&&b.createElement("button",T,P),b.createElement("button",J,j),b.createElement("button",G,k),b.createElement("button",K,B),b.createElement("button",ce,R),b.createElement("button",se,D)),b.createElement(o.CSSTransition,v({nodeRef:L},me),b.createElement("div",pe,b.createElement("img",v({alt:n},ue)))))}(),we=d({className:X("icon")},V("icon")),Ie=f.IconUtils.getJSXIcon(w.indicatorIcon||b.createElement(i.EyeIcon,we),z({},we),{props:w}),he=w.template?f.ObjectUtils.getJSXElement(w.template,w):Ie,Oe=(ce=t.localeOption("aria")?t.localeOption("aria").zoomImage:void 0,se=d({ref:T,className:X("button"),onClick:K,type:"button","aria-label":ce},V("button")),w.preview?b.createElement("button",se,he):null),Ce=d({ref:M,src:ue,className:w.imageClassName,width:me,height:fe,crossOrigin:de,referrerPolicy:ge,useMap:be,loading:ye,style:w.imageStyle,onError:w.onError},V("image")),Ee=w.src&&b.createElement("img",v({},Ce,{alt:pe})),Se=d({ref:q,className:X("root")},k.getOtherProps(w),V("root"));return b.createElement("span",Se,Ee,Oe,h&&b.createElement(m.Portal,{element:ve,appendTo:document.body}))})));B.displayName="Image",exports.Image=B;
|
package/image/image.esm.js
CHANGED
|
@@ -256,11 +256,9 @@ var Image = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
256
256
|
isUnstyled = _ImageBase$setMetaDat.isUnstyled;
|
|
257
257
|
useGlobalOnEscapeKey({
|
|
258
258
|
callback: function callback() {
|
|
259
|
-
|
|
260
|
-
hide();
|
|
261
|
-
}
|
|
259
|
+
hide();
|
|
262
260
|
},
|
|
263
|
-
when: maskVisibleState,
|
|
261
|
+
when: props.closeOnEscape && maskVisibleState,
|
|
264
262
|
priority: [ESC_KEY_HANDLING_PRIORITIES.IMAGE,
|
|
265
263
|
// Assume that there could be only one image mask activated, so it's safe
|
|
266
264
|
// to provide one and the same priority all the time:
|
|
@@ -310,23 +308,27 @@ var Image = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
310
308
|
src: src
|
|
311
309
|
});
|
|
312
310
|
};
|
|
313
|
-
var rotateRight = function rotateRight() {
|
|
311
|
+
var rotateRight = function rotateRight(event) {
|
|
312
|
+
event.stopPropagation();
|
|
314
313
|
setRotateState(function (prevRotate) {
|
|
315
314
|
return prevRotate + 90;
|
|
316
315
|
});
|
|
317
316
|
};
|
|
318
|
-
var rotateLeft = function rotateLeft() {
|
|
317
|
+
var rotateLeft = function rotateLeft(event) {
|
|
318
|
+
event.stopPropagation();
|
|
319
319
|
setRotateState(function (prevRotate) {
|
|
320
320
|
return prevRotate - 90;
|
|
321
321
|
});
|
|
322
322
|
};
|
|
323
|
-
var zoomIn = function zoomIn() {
|
|
323
|
+
var zoomIn = function zoomIn(event) {
|
|
324
|
+
event.stopPropagation();
|
|
324
325
|
setScaleState(function (prevScale) {
|
|
325
326
|
if (zoomInDisabled) return prevScale;
|
|
326
327
|
return prevScale + 0.1;
|
|
327
328
|
});
|
|
328
329
|
};
|
|
329
|
-
var zoomOut = function zoomOut() {
|
|
330
|
+
var zoomOut = function zoomOut(event) {
|
|
331
|
+
event.stopPropagation();
|
|
330
332
|
setScaleState(function (prevScale) {
|
|
331
333
|
if (zoomOutDisabled) return prevScale;
|
|
332
334
|
return prevScale - 0.1;
|
|
@@ -339,7 +341,7 @@ var Image = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
339
341
|
props.onShow && props.onShow();
|
|
340
342
|
};
|
|
341
343
|
var onExit = function onExit() {
|
|
342
|
-
DomHandler.addClass(maskRef.current, 'p-component-overlay-leave');
|
|
344
|
+
!isUnstyled() && DomHandler.addClass(maskRef.current, 'p-component-overlay-leave');
|
|
343
345
|
};
|
|
344
346
|
var onExiting = function onExiting() {
|
|
345
347
|
props.onHide && props.onHide();
|