primereact 7.0.1 → 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +1 -1
- package/accordion/accordion.cjs.js +27 -21
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +5 -2
- package/accordion/accordion.esm.js +27 -21
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +27 -21
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +29 -6
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +31 -30
- package/api/api.esm.js +29 -6
- package/api/api.esm.min.js +1 -1
- package/api/api.js +29 -6
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +22 -22
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +9 -4
- package/autocomplete/autocomplete.esm.js +22 -22
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +22 -22
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +11 -11
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +1 -1
- package/avatar/avatar.esm.js +11 -11
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +11 -11
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +11 -11
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +11 -11
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +11 -11
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +11 -11
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +11 -11
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +11 -11
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +23 -16
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +23 -16
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +23 -16
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +11 -11
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +11 -11
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +11 -11
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +13 -13
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +1 -1
- package/button/button.esm.js +13 -13
- package/button/button.esm.min.js +1 -1
- package/button/button.js +13 -13
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +39 -20
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +3 -2
- package/calendar/calendar.esm.js +39 -20
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +39 -20
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +11 -11
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.js +11 -11
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +11 -11
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +11 -11
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +11 -11
- package/card/card.esm.min.js +1 -1
- package/card/card.js +11 -11
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +235 -27
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +234 -27
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +236 -29
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +15 -15
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +15 -15
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +15 -15
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +13 -13
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +13 -13
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +13 -13
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +13 -13
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +1 -1
- package/checkbox/checkbox.esm.js +13 -13
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +13 -13
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +11 -11
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +1 -1
- package/chip/chip.esm.js +11 -11
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +11 -11
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +13 -13
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +13 -13
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +13 -13
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +16 -16
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +19 -5
- package/colorpicker/colorpicker.esm.js +16 -16
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +16 -16
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.js +31 -12
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +5 -1
- package/column/column.esm.js +31 -12
- package/column/column.esm.min.js +1 -1
- package/column/column.js +31 -12
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.js +28 -12
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.js +28 -12
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +28 -12
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +13 -13
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +1 -1
- package/confirmdialog/confirmdialog.esm.js +13 -13
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +13 -13
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +16 -16
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +3 -2
- package/confirmpopup/confirmpopup.esm.js +16 -16
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +16 -16
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +14 -14
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +14 -14
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +14 -14
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +521 -323
- package/core/core.min.js +18 -18
- package/csstransition/csstransition.cjs.js +62 -32
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.d.ts +8 -0
- package/csstransition/csstransition.esm.js +61 -32
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +62 -34
- package/csstransition/csstransition.min.js +1 -1
- package/csstransition/package.json +2 -1
- package/datascroller/datascroller.cjs.js +11 -11
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +11 -11
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +11 -11
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +518 -346
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +34 -11
- package/datatable/datatable.esm.js +520 -348
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +518 -346
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +12 -16
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +12 -16
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +12 -16
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +11 -11
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +11 -11
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +11 -11
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +20 -22
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +2 -1
- package/dialog/dialog.esm.js +20 -22
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +20 -22
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +11 -11
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +11 -11
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +11 -11
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +11 -11
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +11 -11
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +11 -11
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +36 -26
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +36 -26
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +36 -26
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +21 -17
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +21 -17
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +21 -17
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +14 -14
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fieldset/fieldset.esm.js +14 -14
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +14 -14
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +16 -13
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +3 -1
- package/fileupload/fileupload.esm.js +16 -13
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +16 -13
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +11 -11
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +11 -11
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +11 -11
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +228 -22
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +228 -22
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +229 -23
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +12 -12
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.js +12 -12
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +12 -12
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +39 -18
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +1 -0
- package/image/image.esm.js +40 -19
- package/image/image.esm.min.js +1 -1
- package/image/image.js +39 -18
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +11 -11
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +11 -11
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +11 -11
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +15 -15
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +15 -15
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +15 -15
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +47 -35
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +47 -35
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +47 -35
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +13 -13
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +13 -13
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +13 -13
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +13 -13
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +13 -13
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +13 -13
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +13 -13
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.esm.js +13 -13
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +13 -13
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +4 -1
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +4 -1
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +4 -1
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +12 -12
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +12 -12
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +12 -12
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -14
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +14 -14
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +14 -14
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +11 -11
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +11 -11
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +11 -11
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +17 -17
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -1
- package/mention/mention.esm.js +17 -17
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +17 -17
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +13 -13
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +2 -1
- package/menu/menu.esm.js +13 -13
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +13 -13
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +11 -11
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +11 -11
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +11 -11
- package/menubar/menubar.min.css +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +11 -11
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +11 -11
- package/message/message.esm.min.js +1 -1
- package/message/message.js +11 -11
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +11 -11
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +2 -1
- package/messages/messages.esm.js +11 -11
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +11 -11
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +23 -23
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +3 -2
- package/multiselect/multiselect.esm.js +23 -23
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +23 -23
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +13 -13
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +13 -13
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +13 -13
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +11 -11
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +11 -11
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +11 -11
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +11 -11
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +11 -11
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +11 -11
- package/organizationchart/organizationchart.min.css +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +15 -19
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +2 -1
- package/overlaypanel/overlaypanel.esm.js +15 -19
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +15 -19
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +3 -2
- package/paginator/paginator.cjs.js +13 -13
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +13 -13
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +13 -13
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +17 -16
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +18 -17
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +17 -16
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +13 -13
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/panelmenu/panelmenu.esm.js +13 -13
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +13 -13
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +15 -15
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +2 -1
- package/password/password.esm.js +15 -15
- package/password/password.esm.min.js +1 -1
- package/password/password.js +15 -15
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +11 -11
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +11 -11
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +11 -11
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +15 -18
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +15 -18
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +16 -20
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +1531 -1073
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1531 -1073
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1531 -1073
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +11 -11
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +11 -11
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +11 -11
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +11 -11
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +11 -11
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +11 -11
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +13 -13
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +13 -13
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +13 -13
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +13 -13
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +13 -13
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +13 -13
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +129 -99
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +314 -26
- package/resources/themes/arya-green/theme.css +314 -26
- package/resources/themes/arya-orange/theme.css +314 -26
- package/resources/themes/arya-purple/theme.css +314 -26
- package/resources/themes/bootstrap4-dark-blue/theme.css +291 -10
- package/resources/themes/bootstrap4-dark-purple/theme.css +291 -10
- package/resources/themes/bootstrap4-light-blue/theme.css +288 -7
- package/resources/themes/bootstrap4-light-purple/theme.css +288 -7
- package/resources/themes/fluent-light/theme.css +312 -24
- package/resources/themes/lara-dark-blue/theme.css +665 -412
- package/resources/themes/lara-dark-indigo/theme.css +665 -412
- package/resources/themes/lara-dark-purple/theme.css +665 -412
- package/resources/themes/lara-dark-teal/theme.css +665 -412
- package/resources/themes/lara-light-blue/theme.css +319 -66
- package/resources/themes/lara-light-indigo/theme.css +319 -66
- package/resources/themes/lara-light-purple/theme.css +319 -66
- package/resources/themes/lara-light-teal/theme.css +319 -66
- package/resources/themes/luna-amber/theme.css +305 -24
- package/resources/themes/luna-blue/theme.css +305 -24
- package/resources/themes/luna-green/theme.css +305 -24
- package/resources/themes/luna-pink/theme.css +305 -24
- package/resources/themes/md-dark-deeppurple/theme.css +370 -8
- package/resources/themes/md-dark-indigo/theme.css +370 -8
- package/resources/themes/md-light-deeppurple/theme.css +368 -6
- package/resources/themes/md-light-indigo/theme.css +368 -6
- package/resources/themes/mdc-dark-deeppurple/theme.css +370 -8
- package/resources/themes/mdc-dark-indigo/theme.css +370 -8
- package/resources/themes/mdc-light-deeppurple/theme.css +368 -6
- package/resources/themes/mdc-light-indigo/theme.css +368 -6
- package/resources/themes/nova/theme.css +305 -24
- package/resources/themes/nova-accent/theme.css +305 -24
- package/resources/themes/nova-alt/theme.css +305 -24
- package/resources/themes/rhea/theme.css +305 -24
- package/resources/themes/saga-blue/theme.css +295 -7
- package/resources/themes/saga-green/theme.css +295 -7
- package/resources/themes/saga-orange/theme.css +295 -7
- package/resources/themes/saga-purple/theme.css +295 -7
- package/resources/themes/tailwind-light/theme.css +315 -27
- package/resources/themes/vela-blue/theme.css +314 -26
- package/resources/themes/vela-green/theme.css +314 -26
- package/resources/themes/vela-orange/theme.css +314 -26
- package/resources/themes/vela-purple/theme.css +314 -26
- package/ripple/ripple.cjs.js +11 -11
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +11 -11
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +11 -11
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +11 -11
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.js +11 -11
- package/row/row.esm.min.js +1 -1
- package/row/row.js +11 -11
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +11 -11
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +11 -11
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +11 -11
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +12 -12
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +3 -2
- package/scrolltop/scrolltop.esm.js +12 -12
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +12 -12
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +14 -14
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +14 -14
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +14 -14
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +1 -1
- package/sidebar/sidebar.cjs.js +14 -13
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +2 -1
- package/sidebar/sidebar.esm.js +14 -13
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +14 -13
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +11 -11
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +11 -11
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +11 -11
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +13 -13
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +13 -13
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +13 -13
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +11 -11
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +11 -11
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +11 -11
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +13 -13
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +1 -1
- package/speeddial/speeddial.esm.js +13 -13
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +13 -13
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +22 -18
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +9 -3
- package/splitbutton/splitbutton.esm.js +22 -18
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +22 -18
- package/splitbutton/splitbutton.min.css +1 -1
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +12 -12
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +12 -12
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +12 -12
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +11 -11
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +11 -11
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +11 -11
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +11 -11
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +11 -11
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +11 -11
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +12 -12
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +12 -12
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +12 -12
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +57 -33
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +8 -0
- package/tabview/tabview.esm.js +57 -33
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +57 -33
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +11 -11
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +1 -1
- package/tag/tag.esm.js +11 -11
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +11 -11
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +11 -11
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +11 -11
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +11 -11
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +13 -13
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +13 -13
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +13 -13
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +11 -11
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +11 -11
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +11 -11
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +26 -15
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +5 -1
- package/toast/toast.esm.js +26 -15
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +27 -17
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +13 -13
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +1 -1
- package/togglebutton/togglebutton.esm.js +13 -13
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +13 -13
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +11 -11
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +11 -11
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +11 -11
- package/toolbar/toolbar.min.css +1 -1
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +45 -19
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +45 -19
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +45 -19
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +2 -0
- package/tree/tree.cjs.js +19 -18
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +8 -4
- package/tree/tree.esm.js +19 -18
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +19 -18
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +2 -1
- package/treeselect/treeselect.cjs.js +20 -20
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +2 -1
- package/treeselect/treeselect.esm.js +20 -20
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +20 -20
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +101 -40
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +2 -1
- package/treetable/treetable.esm.js +97 -37
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +101 -40
- package/treetable/treetable.min.css +1 -1
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +13 -13
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +13 -13
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +13 -13
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +98 -23
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +3 -0
- package/utils/utils.esm.js +98 -23
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +98 -23
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +62 -36
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +62 -36
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +62 -36
- package/virtualscroller/virtualscroller.min.css +1 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +59 -10
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/util.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-dom"),n=require("primereact/utils"),r=require("primereact/button"),i=require("primereact/csstransition"),o=require("primereact/api"),s=require("primereact/overlayservice"),l=require("primereact/portal");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e),u=c(t),p=c(o);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}function m(e){return m="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},m(e)}function b(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){E(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(t){y(C,e.Component);var c,u,v,m,E,j=(c=C,u=L(),function(){var e,t=k(c);if(u){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return b(this,e)});function C(e){var t;return f(this,C),(t=j.call(this,e)).state={visible:!1},t.reject=t.reject.bind(h(t)),t.accept=t.accept.bind(h(t)),t.hide=t.hide.bind(h(t)),t.onCloseClick=t.onCloseClick.bind(h(t)),t.onPanelClick=t.onPanelClick.bind(h(t)),t.onEnter=t.onEnter.bind(h(t)),t.onEntered=t.onEntered.bind(h(t)),t.onExit=t.onExit.bind(h(t)),t.onExited=t.onExited.bind(h(t)),t.overlayRef=a.default.createRef(),t.acceptBtnRef=a.default.createRef(),t}return v=C,(m=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||o.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||o.localeOption("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!n.DomHandler.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,s.OverlayService.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},s.OverlayService.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){s.OverlayService.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){n.ZIndexUtils.set("overlay",this.overlayRef.current,p.default.autoZIndex,p.default.zIndex.overlay),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){n.DomHandler.absolutePosition(this.overlayRef.current,this.props.target);var e=n.DomHandler.getOffset(this.overlayRef.current),t=n.DomHandler.getOffset(this.props.target),r=0;e.left<t.left&&(r=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(r,"px")),e.top<t.top&&n.DomHandler.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(s.OverlayService.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var e=n.ObjectUtils.getJSXElement(this.props.message,this.props);return a.default.createElement("div",{className:"p-confirm-popup-content"},n.IconUtils.getJSXIcon(this.props.icon,{className:"p-confirm-popup-icon"},{props:this.props}),a.default.createElement("span",{className:"p-confirm-popup-message"},e))}},{key:"renderFooter",value:function(){var e=n.classNames("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),t=n.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),i=a.default.createElement("div",{className:"p-confirm-popup-footer"},a.default.createElement(r.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),a.default.createElement(r.Button,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:i,props:this.props};return n.ObjectUtils.getJSXElement(this.props.footer,o)}return i}},{key:"renderElement",value:function(){var e=n.classNames("p-confirm-popup p-component",this.props.className),t=this.renderContent(),r=this.renderFooter();return a.default.createElement(i.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},a.default.createElement("div",{ref:this.overlayRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onPanelClick},t,r))}},{key:"render",value:function(){var e=this.renderElement();return a.default.createElement(l.Portal,{element:e,appendTo:this.props.appendTo,visible:!0})}}])&&d(v.prototype,m),E&&d(v,E),C}();E(O,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null}),exports.ConfirmPopup=O,exports.confirmPopup=function(e){var t=e.appendTo||document.body,r=document.createDocumentFragment();n.DomHandler.appendChild(r,t),e=C(C({},e),{visible:void 0===e.visible||e.visible});var i=a.default.createElement(O,e);u.default.render(i,r);var o=function(t){e=C(C({},e),t),u.default.render(a.default.cloneElement(i,e),r)};return{_destroy:function(){u.default.unmountComponentAtNode(r)},show:function(){o({visible:!0,onHide:function(){o({visible:!1})}})},hide:function(){o({visible:!1})},update:function(e){o(e)}}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-dom"),n=require("primereact/utils"),r=require("primereact/button"),i=require("primereact/csstransition"),o=require("primereact/api"),s=require("primereact/overlayservice"),l=require("primereact/portal");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e),u=c(t),p=c(o);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function b(e){return b="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},b(e)}function m(e,t){if(t&&("object"===b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){E(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var C=function(t){y(O,e.Component);var c,u,v,b,E,j=(c=O,u=L(),function(){var e,t=k(c);if(u){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function O(e){var t;return f(this,O),(t=j.call(this,e)).state={visible:!1},t.reject=t.reject.bind(h(t)),t.accept=t.accept.bind(h(t)),t.hide=t.hide.bind(h(t)),t.onCloseClick=t.onCloseClick.bind(h(t)),t.onPanelClick=t.onPanelClick.bind(h(t)),t.onEnter=t.onEnter.bind(h(t)),t.onEntered=t.onEntered.bind(h(t)),t.onExit=t.onExit.bind(h(t)),t.onExited=t.onExited.bind(h(t)),t.overlayRef=a.default.createRef(),t.acceptBtnRef=a.default.createRef(),t}return v=O,(b=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||o.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||o.localeOption("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!n.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,s.OverlayService.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},s.OverlayService.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){s.OverlayService.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){n.ZIndexUtils.set("overlay",this.overlayRef.current,p.default.autoZIndex,p.default.zIndex.overlay),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){n.DomHandler.absolutePosition(this.overlayRef.current,this.props.target);var e=n.DomHandler.getOffset(this.overlayRef.current),t=n.DomHandler.getOffset(this.props.target),r=0;e.left<t.left&&(r=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(r,"px")),e.top<t.top&&n.DomHandler.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(s.OverlayService.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var e=n.ObjectUtils.getJSXElement(this.props.message,this.props);return a.default.createElement("div",{className:"p-confirm-popup-content"},n.IconUtils.getJSXIcon(this.props.icon,{className:"p-confirm-popup-icon"},{props:this.props}),a.default.createElement("span",{className:"p-confirm-popup-message"},e))}},{key:"renderFooter",value:function(){var e=n.classNames("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),t=n.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),i=a.default.createElement("div",{className:"p-confirm-popup-footer"},a.default.createElement(r.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),a.default.createElement(r.Button,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:i,props:this.props};return n.ObjectUtils.getJSXElement(this.props.footer,o)}return i}},{key:"renderElement",value:function(){var e=n.classNames("p-confirm-popup p-component",this.props.className),t=this.renderContent(),r=this.renderFooter();return a.default.createElement(i.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},a.default.createElement("div",{ref:this.overlayRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onPanelClick},t,r))}},{key:"render",value:function(){var e=this.renderElement();return a.default.createElement(l.Portal,{element:e,appendTo:this.props.appendTo,visible:this.props.visible})}}])&&d(v.prototype,b),E&&d(v,E),Object.defineProperty(v,"prototype",{writable:!1}),O}();E(C,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null}),exports.ConfirmPopup=C,exports.confirmPopup=function(e){var t=e.appendTo||document.body,r=document.createDocumentFragment();n.DomHandler.appendChild(r,t),e=O(O({},e),{visible:void 0===e.visible||e.visible});var i=a.default.createElement(C,e);u.default.render(i,r);var o=function(t){e=O(O({},e),t),u.default.render(a.default.cloneElement(i,e),r)};return{_destroy:function(){u.default.unmountComponentAtNode(r)},show:function(){o({visible:!0,onHide:function(){o({visible:!1})}})},hide:function(){o({visible:!1})},update:function(e){o(e)}}};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSTransitionProps } from '../csstransition';
|
|
3
|
+
import { IconType } from "../utils";
|
|
3
4
|
|
|
4
5
|
type ConfirmPopupTemplateType = React.ReactNode | ((options: ConfirmPopupOptions) => React.ReactNode);
|
|
5
6
|
|
|
@@ -34,7 +35,7 @@ export interface ConfirmPopupProps {
|
|
|
34
35
|
appendTo?: ConfirmPopupAppendToType;
|
|
35
36
|
dismissable?: boolean;
|
|
36
37
|
footer?: ConfirmPopupTemplateType;
|
|
37
|
-
transitionOptions?:
|
|
38
|
+
transitionOptions?: CSSTransitionProps;
|
|
38
39
|
onShow?(): void;
|
|
39
40
|
onHide?(result: string): void;
|
|
40
41
|
accept?(): void;
|
|
@@ -26,6 +26,9 @@ function _defineProperties(target, props) {
|
|
|
26
26
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
27
27
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
28
28
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
29
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
30
|
+
writable: false
|
|
31
|
+
});
|
|
29
32
|
return Constructor;
|
|
30
33
|
}
|
|
31
34
|
|
|
@@ -58,23 +61,20 @@ function _inherits(subClass, superClass) {
|
|
|
58
61
|
configurable: true
|
|
59
62
|
}
|
|
60
63
|
});
|
|
64
|
+
Object.defineProperty(subClass, "prototype", {
|
|
65
|
+
writable: false
|
|
66
|
+
});
|
|
61
67
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
function _typeof(obj) {
|
|
65
71
|
"@babel/helpers - typeof";
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
_typeof = function _typeof(obj) {
|
|
73
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return _typeof(obj);
|
|
73
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
74
|
+
return typeof obj;
|
|
75
|
+
} : function (obj) {
|
|
76
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
77
|
+
}, _typeof(obj);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -113,9 +113,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
113
113
|
|
|
114
114
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
115
115
|
|
|
116
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
116
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
117
117
|
|
|
118
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
118
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
119
119
|
function confirmPopup(props) {
|
|
120
120
|
var appendTo = props.appendTo || document.body;
|
|
121
121
|
var confirmPopupWrapper = document.createDocumentFragment();
|
|
@@ -247,7 +247,7 @@ var ConfirmPopup = /*#__PURE__*/function (_Component) {
|
|
|
247
247
|
|
|
248
248
|
if (!this.resizeListener) {
|
|
249
249
|
this.resizeListener = function () {
|
|
250
|
-
if (_this4.state.visible && !DomHandler.
|
|
250
|
+
if (_this4.state.visible && !DomHandler.isTouchDevice()) {
|
|
251
251
|
_this4.hide();
|
|
252
252
|
}
|
|
253
253
|
};
|
|
@@ -483,7 +483,7 @@ var ConfirmPopup = /*#__PURE__*/function (_Component) {
|
|
|
483
483
|
return /*#__PURE__*/React.createElement(CSSTransition, {
|
|
484
484
|
nodeRef: this.overlayRef,
|
|
485
485
|
classNames: "p-connected-overlay",
|
|
486
|
-
in: this.state.visible,
|
|
486
|
+
"in": this.state.visible,
|
|
487
487
|
timeout: {
|
|
488
488
|
enter: 120,
|
|
489
489
|
exit: 100
|
|
@@ -509,7 +509,7 @@ var ConfirmPopup = /*#__PURE__*/function (_Component) {
|
|
|
509
509
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
510
510
|
element: element,
|
|
511
511
|
appendTo: this.props.appendTo,
|
|
512
|
-
visible:
|
|
512
|
+
visible: this.props.visible
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
515
|
}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{Component as t}from"react";import n from"react-dom";import{DomHandler as i,ConnectedOverlayScrollHandler as r,ZIndexUtils as o,ObjectUtils as s,IconUtils as c,classNames as l}from"primereact/utils";import{Button as a}from"primereact/button";import{CSSTransition as
|
|
1
|
+
import e,{Component as t}from"react";import n from"react-dom";import{DomHandler as i,ConnectedOverlayScrollHandler as r,ZIndexUtils as o,ObjectUtils as s,IconUtils as c,classNames as l}from"primereact/utils";import{Button as a}from"primereact/button";import{CSSTransition as p}from"primereact/csstransition";import u,{localeOption as f}from"primereact/api";import{OverlayService as h}from"primereact/overlayservice";import{Portal as d}from"primereact/portal";function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function E(e){return E="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},E(e)}function L(e,t){if(t&&("object"===E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(t){var r=t.appendTo||document.body,o=document.createDocumentFragment();i.appendChild(o,r),t=R(R({},t),{visible:void 0===t.visible||t.visible});var s=e.createElement(P,t);n.render(s,o);var c=function(i){t=R(R({},t),i),n.render(e.cloneElement(s,t),o)};return{_destroy:function(){n.unmountComponentAtNode(o)},show:function(){c({visible:!0,onHide:function(){c({visible:!1})}})},hide:function(){c({visible:!1})},update:function(e){c(e)}}}var P=function(n){k(P,t);var b,E,C,g,R,w=(b=P,E=O(),function(){var e,t=j(b);if(E){var n=j(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return L(this,e)});function P(t){var n;return v(this,P),(n=w.call(this,t)).state={visible:!1},n.reject=n.reject.bind(y(n)),n.accept=n.accept.bind(y(n)),n.hide=n.hide.bind(y(n)),n.onCloseClick=n.onCloseClick.bind(y(n)),n.onPanelClick=n.onPanelClick.bind(y(n)),n.onEnter=n.onEnter.bind(y(n)),n.onEntered=n.onEntered.bind(y(n)),n.onExit=n.onExit.bind(y(n)),n.onExited=n.onExited.bind(y(n)),n.overlayRef=e.createRef(),n.acceptBtnRef=e.createRef(),n}return C=P,(g=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||f("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||f("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new r(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!i.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,h.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},h.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){h.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){o.set("overlay",this.overlayRef.current,u.autoZIndex,u.zIndex.overlay),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){o.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){i.absolutePosition(this.overlayRef.current,this.props.target);var e=i.getOffset(this.overlayRef.current),t=i.getOffset(this.props.target),n=0;e.left<t.left&&(n=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&i.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(h.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),o.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var t=s.getJSXElement(this.props.message,this.props);return e.createElement("div",{className:"p-confirm-popup-content"},c.getJSXIcon(this.props.icon,{className:"p-confirm-popup-icon"},{props:this.props}),e.createElement("span",{className:"p-confirm-popup-message"},t))}},{key:"renderFooter",value:function(){var t=l("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),n=l("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),i=e.createElement("div",{className:"p-confirm-popup-footer"},e.createElement(a,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:n,onClick:this.reject}),e.createElement(a,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:t,onClick:this.accept}));if(this.props.footer){var r={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:t,rejectClassName:n,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:i,props:this.props};return s.getJSXElement(this.props.footer,r)}return i}},{key:"renderElement",value:function(){var t=l("p-confirm-popup p-component",this.props.className),n=this.renderContent(),i=this.renderFooter();return e.createElement(p,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},e.createElement("div",{ref:this.overlayRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onPanelClick},n,i))}},{key:"render",value:function(){var t=this.renderElement();return e.createElement(d,{element:t,appendTo:this.props.appendTo,visible:this.props.visible})}}])&&m(C.prototype,g),R&&m(C,R),Object.defineProperty(C,"prototype",{writable:!1}),P}();C(P,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null});export{P as ConfirmPopup,w as confirmPopup};
|
|
@@ -27,6 +27,9 @@ this.primereact.confirmpopup = (function (exports, React, ReactDOM, utils, butto
|
|
|
27
27
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
28
28
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
29
29
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
30
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
31
|
+
writable: false
|
|
32
|
+
});
|
|
30
33
|
return Constructor;
|
|
31
34
|
}
|
|
32
35
|
|
|
@@ -59,23 +62,20 @@ this.primereact.confirmpopup = (function (exports, React, ReactDOM, utils, butto
|
|
|
59
62
|
configurable: true
|
|
60
63
|
}
|
|
61
64
|
});
|
|
65
|
+
Object.defineProperty(subClass, "prototype", {
|
|
66
|
+
writable: false
|
|
67
|
+
});
|
|
62
68
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
function _typeof(obj) {
|
|
66
72
|
"@babel/helpers - typeof";
|
|
67
73
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
_typeof = function _typeof(obj) {
|
|
74
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return _typeof(obj);
|
|
74
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
75
|
+
return typeof obj;
|
|
76
|
+
} : function (obj) {
|
|
77
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
78
|
+
}, _typeof(obj);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -114,9 +114,9 @@ this.primereact.confirmpopup = (function (exports, React, ReactDOM, utils, butto
|
|
|
114
114
|
|
|
115
115
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
116
116
|
|
|
117
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
117
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
118
118
|
|
|
119
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
119
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
120
120
|
function confirmPopup(props) {
|
|
121
121
|
var appendTo = props.appendTo || document.body;
|
|
122
122
|
var confirmPopupWrapper = document.createDocumentFragment();
|
|
@@ -248,7 +248,7 @@ this.primereact.confirmpopup = (function (exports, React, ReactDOM, utils, butto
|
|
|
248
248
|
|
|
249
249
|
if (!this.resizeListener) {
|
|
250
250
|
this.resizeListener = function () {
|
|
251
|
-
if (_this4.state.visible && !utils.DomHandler.
|
|
251
|
+
if (_this4.state.visible && !utils.DomHandler.isTouchDevice()) {
|
|
252
252
|
_this4.hide();
|
|
253
253
|
}
|
|
254
254
|
};
|
|
@@ -484,7 +484,7 @@ this.primereact.confirmpopup = (function (exports, React, ReactDOM, utils, butto
|
|
|
484
484
|
return /*#__PURE__*/React__default["default"].createElement(csstransition.CSSTransition, {
|
|
485
485
|
nodeRef: this.overlayRef,
|
|
486
486
|
classNames: "p-connected-overlay",
|
|
487
|
-
in: this.state.visible,
|
|
487
|
+
"in": this.state.visible,
|
|
488
488
|
timeout: {
|
|
489
489
|
enter: 120,
|
|
490
490
|
exit: 100
|
|
@@ -510,7 +510,7 @@ this.primereact.confirmpopup = (function (exports, React, ReactDOM, utils, butto
|
|
|
510
510
|
return /*#__PURE__*/React__default["default"].createElement(portal.Portal, {
|
|
511
511
|
element: element,
|
|
512
512
|
appendTo: this.props.appendTo,
|
|
513
|
-
visible:
|
|
513
|
+
visible: this.props.visible
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.confirmpopup=function(e,t,n,i,r,o,s,c,l){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(t),p=a(n),f=a(s);function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}function b(e){return b="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},b(e)}function k(e,t){if(t&&("object"===b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(e){m(L,e);var t,n,a,p,y,b=(t=L,n=j(),function(){var e,i=E(t);if(n){var r=E(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return k(this,e)});function L(e){var t;return d(this,L),(t=b.call(this,e)).state={visible:!1},t.reject=t.reject.bind(v(t)),t.accept=t.accept.bind(v(t)),t.hide=t.hide.bind(v(t)),t.onCloseClick=t.onCloseClick.bind(v(t)),t.onPanelClick=t.onPanelClick.bind(v(t)),t.onEnter=t.onEnter.bind(v(t)),t.onEntered=t.onEntered.bind(v(t)),t.onExit=t.onExit.bind(v(t)),t.onExited=t.onExited.bind(v(t)),t.overlayRef=u.default.createRef(),t.acceptBtnRef=u.default.createRef(),t}return a=L,(p=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||s.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||s.localeOption("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!i.DomHandler.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,c.OverlayService.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},c.OverlayService.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){c.OverlayService.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){i.ZIndexUtils.set("overlay",this.overlayRef.current,f.default.autoZIndex,f.default.zIndex.overlay),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){i.ZIndexUtils.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){i.DomHandler.absolutePosition(this.overlayRef.current,this.props.target);var e=i.DomHandler.getOffset(this.overlayRef.current),t=i.DomHandler.getOffset(this.props.target),n=0;e.left<t.left&&(n=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&i.DomHandler.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(c.OverlayService.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),i.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var e=i.ObjectUtils.getJSXElement(this.props.message,this.props);return u.default.createElement("div",{className:"p-confirm-popup-content"},i.IconUtils.getJSXIcon(this.props.icon,{className:"p-confirm-popup-icon"},{props:this.props}),u.default.createElement("span",{className:"p-confirm-popup-message"},e))}},{key:"renderFooter",value:function(){var e=i.classNames("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),t=i.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),n=u.default.createElement("div",{className:"p-confirm-popup-footer"},u.default.createElement(r.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),u.default.createElement(r.Button,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:n,props:this.props};return i.ObjectUtils.getJSXElement(this.props.footer,o)}return n}},{key:"renderElement",value:function(){var e=i.classNames("p-confirm-popup p-component",this.props.className),t=this.renderContent(),n=this.renderFooter();return u.default.createElement(o.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},u.default.createElement("div",{ref:this.overlayRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onPanelClick},t,n))}},{key:"render",value:function(){var e=this.renderElement();return u.default.createElement(l.Portal,{element:e,appendTo:this.props.appendTo,visible:!0})}}])&&h(a.prototype,p),y&&h(a,y),L}(t.Component);return L(R,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null}),e.ConfirmPopup=R,e.confirmPopup=function(e){var t=e.appendTo||document.body,n=document.createDocumentFragment();i.DomHandler.appendChild(n,t),e=O(O({},e),{visible:void 0===e.visible||e.visible});var r=u.default.createElement(R,e);p.default.render(r,n);var o=function(t){e=O(O({},e),t),p.default.render(u.default.cloneElement(r,e),n)};return{_destroy:function(){p.default.unmountComponentAtNode(n)},show:function(){o({visible:!0,onHide:function(){o({visible:!1})}})},hide:function(){o({visible:!1})},update:function(e){o(e)}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,ReactDOM,primereact.utils,primereact.button,primereact.csstransition,primereact.api,primereact.overlayservice,primereact.portal);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.confirmpopup=function(e,t,n,i,r,o,s,c,l){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(t),p=a(n),f=a(s);function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}function m(e){return m="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},m(e)}function k(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(e){b(L,e);var t,n,a,p,y,m=(t=L,n=j(),function(){var e,i=E(t);if(n){var r=E(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return k(this,e)});function L(e){var t;return d(this,L),(t=m.call(this,e)).state={visible:!1},t.reject=t.reject.bind(v(t)),t.accept=t.accept.bind(v(t)),t.hide=t.hide.bind(v(t)),t.onCloseClick=t.onCloseClick.bind(v(t)),t.onPanelClick=t.onPanelClick.bind(v(t)),t.onEnter=t.onEnter.bind(v(t)),t.onEntered=t.onEntered.bind(v(t)),t.onExit=t.onExit.bind(v(t)),t.onExited=t.onExited.bind(v(t)),t.overlayRef=u.default.createRef(),t.acceptBtnRef=u.default.createRef(),t}return a=L,(p=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||s.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||s.localeOption("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!i.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,c.OverlayService.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},c.OverlayService.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){c.OverlayService.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){i.ZIndexUtils.set("overlay",this.overlayRef.current,f.default.autoZIndex,f.default.zIndex.overlay),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){i.ZIndexUtils.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){i.DomHandler.absolutePosition(this.overlayRef.current,this.props.target);var e=i.DomHandler.getOffset(this.overlayRef.current),t=i.DomHandler.getOffset(this.props.target),n=0;e.left<t.left&&(n=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&i.DomHandler.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(c.OverlayService.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),i.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var e=i.ObjectUtils.getJSXElement(this.props.message,this.props);return u.default.createElement("div",{className:"p-confirm-popup-content"},i.IconUtils.getJSXIcon(this.props.icon,{className:"p-confirm-popup-icon"},{props:this.props}),u.default.createElement("span",{className:"p-confirm-popup-message"},e))}},{key:"renderFooter",value:function(){var e=i.classNames("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),t=i.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),n=u.default.createElement("div",{className:"p-confirm-popup-footer"},u.default.createElement(r.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),u.default.createElement(r.Button,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:n,props:this.props};return i.ObjectUtils.getJSXElement(this.props.footer,o)}return n}},{key:"renderElement",value:function(){var e=i.classNames("p-confirm-popup p-component",this.props.className),t=this.renderContent(),n=this.renderFooter();return u.default.createElement(o.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},u.default.createElement("div",{ref:this.overlayRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onPanelClick},t,n))}},{key:"render",value:function(){var e=this.renderElement();return u.default.createElement(l.Portal,{element:e,appendTo:this.props.appendTo,visible:this.props.visible})}}])&&h(a.prototype,p),y&&h(a,y),Object.defineProperty(a,"prototype",{writable:!1}),L}(t.Component);return L(R,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null}),e.ConfirmPopup=R,e.confirmPopup=function(e){var t=e.appendTo||document.body,n=document.createDocumentFragment();i.DomHandler.appendChild(n,t),e=C(C({},e),{visible:void 0===e.visible||e.visible});var r=u.default.createElement(R,e);p.default.render(r,n);var o=function(t){e=C(C({},e),t),p.default.render(u.default.cloneElement(r,e),n)};return{_destroy:function(){p.default.unmountComponentAtNode(n)},show:function(){o({visible:!0,onHide:function(){o({visible:!1})}})},hide:function(){o({visible:!1})},update:function(e){o(e)}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,ReactDOM,primereact.utils,primereact.button,primereact.csstransition,primereact.api,primereact.overlayservice,primereact.portal);
|
|
@@ -33,6 +33,9 @@ function _defineProperties(target, props) {
|
|
|
33
33
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
34
34
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
35
35
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
36
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
37
|
+
writable: false
|
|
38
|
+
});
|
|
36
39
|
return Constructor;
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -65,23 +68,20 @@ function _inherits(subClass, superClass) {
|
|
|
65
68
|
configurable: true
|
|
66
69
|
}
|
|
67
70
|
});
|
|
71
|
+
Object.defineProperty(subClass, "prototype", {
|
|
72
|
+
writable: false
|
|
73
|
+
});
|
|
68
74
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
69
75
|
}
|
|
70
76
|
|
|
71
77
|
function _typeof(obj) {
|
|
72
78
|
"@babel/helpers - typeof";
|
|
73
79
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
_typeof = function _typeof(obj) {
|
|
80
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return _typeof(obj);
|
|
80
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
81
|
+
return typeof obj;
|
|
82
|
+
} : function (obj) {
|
|
83
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
84
|
+
}, _typeof(obj);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -320,7 +320,7 @@ var ContextMenuSub = /*#__PURE__*/function (_Component) {
|
|
|
320
320
|
return /*#__PURE__*/React__default["default"].createElement(csstransition.CSSTransition, {
|
|
321
321
|
nodeRef: this.submenuRef,
|
|
322
322
|
classNames: "p-contextmenusub",
|
|
323
|
-
in: isActive,
|
|
323
|
+
"in": isActive,
|
|
324
324
|
timeout: {
|
|
325
325
|
enter: 0,
|
|
326
326
|
exit: 0
|
|
@@ -566,7 +566,7 @@ var ContextMenu = /*#__PURE__*/function (_Component2) {
|
|
|
566
566
|
|
|
567
567
|
if (!this.documentResizeListener) {
|
|
568
568
|
this.documentResizeListener = function (event) {
|
|
569
|
-
if (_this9.state.visible && !utils.DomHandler.
|
|
569
|
+
if (_this9.state.visible && !utils.DomHandler.isTouchDevice()) {
|
|
570
570
|
_this9.hide(event);
|
|
571
571
|
}
|
|
572
572
|
};
|
|
@@ -636,7 +636,7 @@ var ContextMenu = /*#__PURE__*/function (_Component2) {
|
|
|
636
636
|
return /*#__PURE__*/React__default["default"].createElement(csstransition.CSSTransition, {
|
|
637
637
|
nodeRef: this.menuRef,
|
|
638
638
|
classNames: "p-contextmenu",
|
|
639
|
-
in: this.state.visible,
|
|
639
|
+
"in": this.state.visible,
|
|
640
640
|
timeout: {
|
|
641
641
|
enter: 250,
|
|
642
642
|
exit: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils"),n=require("primereact/csstransition"),i=require("primereact/ripple"),r=require("primereact/portal"),o=require("primereact/api");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=u(e),l=u(o);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function h(e){return h="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},h(e)}function v(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=k();return function(){var n,i=b(e);if(t){var r=b(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return v(this,n)}}function k(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var L=function(r){p(u,e.Component);var o=E(u);function u(e){var t;return a(this,u),(t=o.call(this,e)).state={activeItem:null},t.onEnter=t.onEnter.bind(d(t)),t.submenuRef=s.default.createRef(),t}return m(u,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,n=t.DomHandler.getOffset(this.submenuRef.current.parentElement),i=t.DomHandler.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:t.DomHandler.getHiddenElementOuterWidth(this.submenuRef.current),o=t.DomHandler.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(n.left,10)+o+r>i.width-t.DomHandler.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(e){return s.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(e){return e.items?s.default.createElement(u,{model:e.items,resetMenu:e!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(e,n){var r=this,o=this.state.activeItem===e,u=t.classNames("p-menuitem",{"p-menuitem-active":o},e.className),l=t.classNames("p-menuitem-link",{"p-disabled":e.disabled}),a=t.classNames("p-menuitem-icon",e.icon),c="p-submenu-icon pi pi-angle-right",m=e.icon&&s.default.createElement("span",{className:a}),d=e.label&&s.default.createElement("span",{className:"p-menuitem-text"},e.label),f=e.items&&s.default.createElement("span",{className:c}),p=this.renderSubmenu(e),h=s.default.createElement("a",{href:e.url||"#",className:l,target:e.target,onClick:function(t){return r.onItemClick(t,e,n)},role:"menuitem","aria-haspopup":null!=e.items,"aria-disabled":e.disabled},m,d,f,s.default.createElement(i.Ripple,null));e.template&&(h=t.ObjectUtils.getJSXElement(e.template,e,{onClick:function(t){return r.onItemClick(t,e,n)},className:l,labelClassName:"p-menuitem-text",iconClassName:a,submenuIconClassName:c,element:h,props:this.props,active:o}));return s.default.createElement("li",{key:e.label+"_"+n,role:"none",className:u,style:e.style,onMouseEnter:function(t){return r.onItemMouseEnter(t,e)}},h,p)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var e=t.classNames({"p-submenu-list":!this.props.root}),i=this.renderMenu(),r=this.isActive();return s.default.createElement(n.CSSTransition,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:r,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},s.default.createElement("ul",{ref:this.submenuRef,className:e},i))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),u}();y(L,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var x=function(i){p(u,e.Component);var o=E(u);function u(e){var t;return a(this,u),(t=o.call(this,e)).state={visible:!1,reshow:!1,resetMenu:!1},t.onMenuClick=t.onMenuClick.bind(d(t)),t.onLeafClick=t.onLeafClick.bind(d(t)),t.onMenuMouseEnter=t.onMenuMouseEnter.bind(d(t)),t.onEnter=t.onEnter.bind(d(t)),t.onEntered=t.onEntered.bind(d(t)),t.onExit=t.onExit.bind(d(t)),t.onExited=t.onExited.bind(d(t)),t.menuRef=s.default.createRef(),t}return m(u,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&t.ZIndexUtils.set("menu",this.menuRef.current,l.default.autoZIndex,this.props.baseZIndex||l.default.zIndex.menu),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){t.ZIndexUtils.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var n=e.pageX+1,i=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:t.DomHandler.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:t.DomHandler.getHiddenElementOuterHeight(this.menuRef.current),u=t.DomHandler.getViewport();n+r-document.body.scrollLeft>u.width&&(n-=r),i+o-document.body.scrollTop>u.height&&(i-=o),n<document.body.scrollLeft&&(n=document.body.scrollLeft),i<document.body.scrollTop&&(i=document.body.scrollTop),this.menuRef.current.style.left=n+"px",this.menuRef.current.style.top=i+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(n){e.state.visible&&!t.DomHandler.isAndroid()&&e.hide(n)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&(t.reshow!==this.state.reshow||e.model!==this.props.model)){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),t.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var e=t.classNames("p-contextmenu p-component",this.props.className);return s.default.createElement(n.CSSTransition,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},s.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},s.default.createElement(L,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var e=this.renderContextMenu();return s.default.createElement(r.Portal,{element:e,appendTo:this.props.appendTo})}}]),u}();y(x,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),exports.ContextMenu=x;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils"),n=require("primereact/csstransition"),i=require("primereact/ripple"),r=require("primereact/portal"),o=require("primereact/api");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=u(e),l=u(o);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function h(e){return h="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},h(e)}function v(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=k();return function(){var n,i=b(e);if(t){var r=b(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return v(this,n)}}function k(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var L=function(r){p(u,e.Component);var o=E(u);function u(e){var t;return a(this,u),(t=o.call(this,e)).state={activeItem:null},t.onEnter=t.onEnter.bind(f(t)),t.submenuRef=s.default.createRef(),t}return m(u,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,n=t.DomHandler.getOffset(this.submenuRef.current.parentElement),i=t.DomHandler.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:t.DomHandler.getHiddenElementOuterWidth(this.submenuRef.current),o=t.DomHandler.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(n.left,10)+o+r>i.width-t.DomHandler.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(e){return s.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(e){return e.items?s.default.createElement(u,{model:e.items,resetMenu:e!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(e,n){var r=this,o=this.state.activeItem===e,u=t.classNames("p-menuitem",{"p-menuitem-active":o},e.className),l=t.classNames("p-menuitem-link",{"p-disabled":e.disabled}),a=t.classNames("p-menuitem-icon",e.icon),c="p-submenu-icon pi pi-angle-right",m=e.icon&&s.default.createElement("span",{className:a}),f=e.label&&s.default.createElement("span",{className:"p-menuitem-text"},e.label),d=e.items&&s.default.createElement("span",{className:c}),p=this.renderSubmenu(e),h=s.default.createElement("a",{href:e.url||"#",className:l,target:e.target,onClick:function(t){return r.onItemClick(t,e,n)},role:"menuitem","aria-haspopup":null!=e.items,"aria-disabled":e.disabled},m,f,d,s.default.createElement(i.Ripple,null));e.template&&(h=t.ObjectUtils.getJSXElement(e.template,e,{onClick:function(t){return r.onItemClick(t,e,n)},className:l,labelClassName:"p-menuitem-text",iconClassName:a,submenuIconClassName:c,element:h,props:this.props,active:o}));return s.default.createElement("li",{key:e.label+"_"+n,role:"none",className:u,style:e.style,onMouseEnter:function(t){return r.onItemMouseEnter(t,e)}},h,p)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var e=t.classNames({"p-submenu-list":!this.props.root}),i=this.renderMenu(),r=this.isActive();return s.default.createElement(n.CSSTransition,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:r,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},s.default.createElement("ul",{ref:this.submenuRef,className:e},i))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),u}();y(L,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var x=function(i){p(u,e.Component);var o=E(u);function u(e){var t;return a(this,u),(t=o.call(this,e)).state={visible:!1,reshow:!1,resetMenu:!1},t.onMenuClick=t.onMenuClick.bind(f(t)),t.onLeafClick=t.onLeafClick.bind(f(t)),t.onMenuMouseEnter=t.onMenuMouseEnter.bind(f(t)),t.onEnter=t.onEnter.bind(f(t)),t.onEntered=t.onEntered.bind(f(t)),t.onExit=t.onExit.bind(f(t)),t.onExited=t.onExited.bind(f(t)),t.menuRef=s.default.createRef(),t}return m(u,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&t.ZIndexUtils.set("menu",this.menuRef.current,l.default.autoZIndex,this.props.baseZIndex||l.default.zIndex.menu),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){t.ZIndexUtils.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var n=e.pageX+1,i=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:t.DomHandler.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:t.DomHandler.getHiddenElementOuterHeight(this.menuRef.current),u=t.DomHandler.getViewport();n+r-document.body.scrollLeft>u.width&&(n-=r),i+o-document.body.scrollTop>u.height&&(i-=o),n<document.body.scrollLeft&&(n=document.body.scrollLeft),i<document.body.scrollTop&&(i=document.body.scrollTop),this.menuRef.current.style.left=n+"px",this.menuRef.current.style.top=i+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(n){e.state.visible&&!t.DomHandler.isTouchDevice()&&e.hide(n)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&(t.reshow!==this.state.reshow||e.model!==this.props.model)){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),t.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var e=t.classNames("p-contextmenu p-component",this.props.className);return s.default.createElement(n.CSSTransition,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},s.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},s.default.createElement(L,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var e=this.renderContextMenu();return s.default.createElement(r.Portal,{element:e,appendTo:this.props.appendTo})}}]),u}();y(x,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),exports.ContextMenu=x;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MenuItem } from '../menuitem';
|
|
3
|
+
import { CSSTransitionProps } from '../csstransition';
|
|
3
4
|
|
|
4
5
|
type ContextMenuAppendToType = 'self' | HTMLElement | undefined | null;
|
|
5
6
|
|
|
@@ -12,7 +13,7 @@ export interface ContextMenuProps {
|
|
|
12
13
|
autoZIndex?: boolean;
|
|
13
14
|
baseZIndex?: number;
|
|
14
15
|
appendTo?: ContextMenuAppendToType;
|
|
15
|
-
transitionOptions?:
|
|
16
|
+
transitionOptions?: CSSTransitionProps;
|
|
16
17
|
onShow?(e: React.SyntheticEvent): void;
|
|
17
18
|
onHide?(e: React.SyntheticEvent): void;
|
|
18
19
|
}
|
|
@@ -24,6 +24,9 @@ function _defineProperties(target, props) {
|
|
|
24
24
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
25
25
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
26
26
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
27
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
28
|
+
writable: false
|
|
29
|
+
});
|
|
27
30
|
return Constructor;
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -56,23 +59,20 @@ function _inherits(subClass, superClass) {
|
|
|
56
59
|
configurable: true
|
|
57
60
|
}
|
|
58
61
|
});
|
|
62
|
+
Object.defineProperty(subClass, "prototype", {
|
|
63
|
+
writable: false
|
|
64
|
+
});
|
|
59
65
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
function _typeof(obj) {
|
|
63
69
|
"@babel/helpers - typeof";
|
|
64
70
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
_typeof = function _typeof(obj) {
|
|
71
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return _typeof(obj);
|
|
71
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
72
|
+
return typeof obj;
|
|
73
|
+
} : function (obj) {
|
|
74
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
75
|
+
}, _typeof(obj);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -311,7 +311,7 @@ var ContextMenuSub = /*#__PURE__*/function (_Component) {
|
|
|
311
311
|
return /*#__PURE__*/React.createElement(CSSTransition, {
|
|
312
312
|
nodeRef: this.submenuRef,
|
|
313
313
|
classNames: "p-contextmenusub",
|
|
314
|
-
in: isActive,
|
|
314
|
+
"in": isActive,
|
|
315
315
|
timeout: {
|
|
316
316
|
enter: 0,
|
|
317
317
|
exit: 0
|
|
@@ -557,7 +557,7 @@ var ContextMenu = /*#__PURE__*/function (_Component2) {
|
|
|
557
557
|
|
|
558
558
|
if (!this.documentResizeListener) {
|
|
559
559
|
this.documentResizeListener = function (event) {
|
|
560
|
-
if (_this9.state.visible && !DomHandler.
|
|
560
|
+
if (_this9.state.visible && !DomHandler.isTouchDevice()) {
|
|
561
561
|
_this9.hide(event);
|
|
562
562
|
}
|
|
563
563
|
};
|
|
@@ -627,7 +627,7 @@ var ContextMenu = /*#__PURE__*/function (_Component2) {
|
|
|
627
627
|
return /*#__PURE__*/React.createElement(CSSTransition, {
|
|
628
628
|
nodeRef: this.menuRef,
|
|
629
629
|
classNames: "p-contextmenu",
|
|
630
|
-
in: this.state.visible,
|
|
630
|
+
"in": this.state.visible,
|
|
631
631
|
timeout: {
|
|
632
632
|
enter: 250,
|
|
633
633
|
exit: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{Component as t}from"react";import{DomHandler as n,classNames as i,ObjectUtils as r,ZIndexUtils as o}from"primereact/utils";import{CSSTransition as s}from"primereact/csstransition";import{Ripple as u}from"primereact/ripple";import{Portal as c}from"primereact/portal";import l from"primereact/api";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function f(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),e}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function b(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e){var t=L();return function(){var n,i=y(e);if(t){var r=y(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return b(this,n)}}function L(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var R=function(o){h(l,t);var c=k(l);function l(t){var n;return a(this,l),(n=c.call(this,t)).state={activeItem:null},n.onEnter=n.onEnter.bind(p(n)),n.submenuRef=e.createRef(),n}return f(l,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,t=n.getOffset(this.submenuRef.current.parentElement),i=n.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:n.getHiddenElementOuterWidth(this.submenuRef.current),o=n.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(t.left,10)+o+r>i.width-n.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(t){return e.createElement("li",{key:"separator_"+t,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(t){return t.items?e.createElement(l,{model:t.items,resetMenu:t!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(t,n){var o=this,s=this.state.activeItem===t,c=i("p-menuitem",{"p-menuitem-active":s},t.className),l=i("p-menuitem-link",{"p-disabled":t.disabled}),a=i("p-menuitem-icon",t.icon),m="p-submenu-icon pi pi-angle-right",f=t.icon&&e.createElement("span",{className:a}),p=t.label&&e.createElement("span",{className:"p-menuitem-text"},t.label),d=t.items&&e.createElement("span",{className:m}),h=this.renderSubmenu(t),v=e.createElement("a",{href:t.url||"#",className:l,target:t.target,onClick:function(e){return o.onItemClick(e,t,n)},role:"menuitem","aria-haspopup":null!=t.items,"aria-disabled":t.disabled},f,p,d,e.createElement(u,null));t.template&&(v=r.getJSXElement(t.template,t,{onClick:function(e){return o.onItemClick(e,t,n)},className:l,labelClassName:"p-menuitem-text",iconClassName:a,submenuIconClassName:m,element:v,props:this.props,active:s}));return e.createElement("li",{key:t.label+"_"+n,role:"none",className:c,style:t.style,onMouseEnter:function(e){return o.onItemMouseEnter(e,t)}},v,h)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var t=i({"p-submenu-list":!this.props.root}),n=this.renderMenu(),r=this.isActive();return e.createElement(s,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:r,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},e.createElement("ul",{ref:this.submenuRef,className:t},n))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),l}();E(R,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var x=function(r){h(m,t);var u=k(m);function m(t){var n;return a(this,m),(n=u.call(this,t)).state={visible:!1,reshow:!1,resetMenu:!1},n.onMenuClick=n.onMenuClick.bind(p(n)),n.onLeafClick=n.onLeafClick.bind(p(n)),n.onMenuMouseEnter=n.onMenuMouseEnter.bind(p(n)),n.onEnter=n.onEnter.bind(p(n)),n.onEntered=n.onEntered.bind(p(n)),n.onExit=n.onExit.bind(p(n)),n.onExited=n.onExited.bind(p(n)),n.menuRef=e.createRef(),n}return f(m,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&o.set("menu",this.menuRef.current,l.autoZIndex,this.props.baseZIndex||l.zIndex.menu),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){o.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var t=e.pageX+1,i=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:n.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:n.getHiddenElementOuterHeight(this.menuRef.current),s=n.getViewport();t+r-document.body.scrollLeft>s.width&&(t-=r),i+o-document.body.scrollTop>s.height&&(i-=o),t<document.body.scrollLeft&&(t=document.body.scrollLeft),i<document.body.scrollTop&&(i=document.body.scrollTop),this.menuRef.current.style.left=t+"px",this.menuRef.current.style.top=i+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!n.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&(t.reshow!==this.state.reshow||e.model!==this.props.model)){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),o.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var t=i("p-contextmenu p-component",this.props.className);return e.createElement(s,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},e.createElement("div",{ref:this.menuRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},e.createElement(R,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var t=this.renderContextMenu();return e.createElement(c,{element:t,appendTo:this.props.appendTo})}}]),m}();E(x,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null});export{x as ContextMenu};
|
|
1
|
+
import e,{Component as t}from"react";import{DomHandler as n,classNames as i,ObjectUtils as r,ZIndexUtils as o}from"primereact/utils";import{CSSTransition as s}from"primereact/csstransition";import{Ripple as u}from"primereact/ripple";import{Portal as c}from"primereact/portal";import l from"primereact/api";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function f(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function b(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e){var t=L();return function(){var n,i=y(e);if(t){var r=y(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return b(this,n)}}function L(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var R=function(o){h(l,t);var c=k(l);function l(t){var n;return a(this,l),(n=c.call(this,t)).state={activeItem:null},n.onEnter=n.onEnter.bind(p(n)),n.submenuRef=e.createRef(),n}return f(l,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,t=n.getOffset(this.submenuRef.current.parentElement),i=n.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:n.getHiddenElementOuterWidth(this.submenuRef.current),o=n.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(t.left,10)+o+r>i.width-n.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(t){return e.createElement("li",{key:"separator_"+t,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(t){return t.items?e.createElement(l,{model:t.items,resetMenu:t!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(t,n){var o=this,s=this.state.activeItem===t,c=i("p-menuitem",{"p-menuitem-active":s},t.className),l=i("p-menuitem-link",{"p-disabled":t.disabled}),a=i("p-menuitem-icon",t.icon),m="p-submenu-icon pi pi-angle-right",f=t.icon&&e.createElement("span",{className:a}),p=t.label&&e.createElement("span",{className:"p-menuitem-text"},t.label),d=t.items&&e.createElement("span",{className:m}),h=this.renderSubmenu(t),v=e.createElement("a",{href:t.url||"#",className:l,target:t.target,onClick:function(e){return o.onItemClick(e,t,n)},role:"menuitem","aria-haspopup":null!=t.items,"aria-disabled":t.disabled},f,p,d,e.createElement(u,null));t.template&&(v=r.getJSXElement(t.template,t,{onClick:function(e){return o.onItemClick(e,t,n)},className:l,labelClassName:"p-menuitem-text",iconClassName:a,submenuIconClassName:m,element:v,props:this.props,active:s}));return e.createElement("li",{key:t.label+"_"+n,role:"none",className:c,style:t.style,onMouseEnter:function(e){return o.onItemMouseEnter(e,t)}},v,h)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var t=i({"p-submenu-list":!this.props.root}),n=this.renderMenu(),r=this.isActive();return e.createElement(s,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:r,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},e.createElement("ul",{ref:this.submenuRef,className:t},n))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),l}();E(R,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var x=function(r){h(m,t);var u=k(m);function m(t){var n;return a(this,m),(n=u.call(this,t)).state={visible:!1,reshow:!1,resetMenu:!1},n.onMenuClick=n.onMenuClick.bind(p(n)),n.onLeafClick=n.onLeafClick.bind(p(n)),n.onMenuMouseEnter=n.onMenuMouseEnter.bind(p(n)),n.onEnter=n.onEnter.bind(p(n)),n.onEntered=n.onEntered.bind(p(n)),n.onExit=n.onExit.bind(p(n)),n.onExited=n.onExited.bind(p(n)),n.menuRef=e.createRef(),n}return f(m,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&o.set("menu",this.menuRef.current,l.autoZIndex,this.props.baseZIndex||l.zIndex.menu),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){o.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var t=e.pageX+1,i=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:n.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:n.getHiddenElementOuterHeight(this.menuRef.current),s=n.getViewport();t+r-document.body.scrollLeft>s.width&&(t-=r),i+o-document.body.scrollTop>s.height&&(i-=o),t<document.body.scrollLeft&&(t=document.body.scrollLeft),i<document.body.scrollTop&&(i=document.body.scrollTop),this.menuRef.current.style.left=t+"px",this.menuRef.current.style.top=i+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!n.isTouchDevice()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&(t.reshow!==this.state.reshow||e.model!==this.props.model)){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),o.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var t=i("p-contextmenu p-component",this.props.className);return e.createElement(s,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},e.createElement("div",{ref:this.menuRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},e.createElement(R,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var t=this.renderContextMenu();return e.createElement(c,{element:t,appendTo:this.props.appendTo})}}]),m}();E(x,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null});export{x as ContextMenu};
|