primereact 7.0.0-rc.1 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -10
- package/accordion/accordion.cjs.js +40 -27
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +7 -3
- package/accordion/accordion.esm.js +27 -14
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +40 -28
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +82 -46
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +95 -61
- package/api/api.esm.js +69 -33
- package/api/api.esm.min.js +1 -1
- package/api/api.js +83 -47
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +79 -71
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +11 -4
- package/autocomplete/autocomplete.esm.js +16 -8
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +75 -72
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +10 -9
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +2 -1
- package/avatar/avatar.esm.js +5 -4
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +11 -10
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +3 -3
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +1 -1
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +4 -4
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +3 -3
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +1 -1
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +4 -4
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +27 -16
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +17 -7
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +26 -17
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +16 -16
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +17 -17
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +42 -53
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +4 -11
- package/button/button.esm.js +31 -42
- package/button/button.esm.min.js +1 -1
- package/button/button.js +41 -54
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +193 -154
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +7 -2
- package/calendar/calendar.esm.js +68 -29
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +189 -155
- package/calendar/calendar.min.css +1 -1
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +1 -1
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +2 -2
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +13 -13
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +1 -1
- package/card/card.esm.min.js +1 -1
- package/card/card.js +14 -14
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +45 -45
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +10 -10
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +45 -46
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +51 -47
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +7 -3
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +48 -48
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +6 -8
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +1 -1
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +5 -5
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +20 -15
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +2 -1
- package/checkbox/checkbox.esm.js +13 -8
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +20 -16
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +16 -14
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +3 -4
- package/chip/chip.esm.js +11 -9
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +17 -15
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +46 -20
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +10 -0
- package/chips/chips.esm.js +37 -11
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +46 -21
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +35 -31
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +20 -6
- package/colorpicker/colorpicker.esm.js +7 -3
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +32 -32
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +24 -2
- package/column/column.esm.min.js +1 -1
- package/column/column.js +1 -1
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +1 -1
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +22 -20
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +4 -3
- package/confirmdialog/confirmdialog.esm.js +6 -4
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +22 -21
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +46 -41
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +6 -4
- package/confirmpopup/confirmpopup.esm.js +12 -8
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +43 -41
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +68 -63
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +35 -31
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +65 -64
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +11228 -846
- package/core/core.min.js +40 -1
- package/csstransition/csstransition.cjs.js +49 -19
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.d.ts +8 -0
- package/csstransition/csstransition.esm.js +48 -19
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +49 -21
- package/csstransition/csstransition.min.js +1 -1
- package/csstransition/package.json +2 -1
- package/datascroller/datascroller.cjs.js +12 -11
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +4 -3
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +12 -12
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +600 -519
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +30 -14
- package/datatable/datatable.esm.js +321 -240
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +597 -520
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +32 -29
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +6 -3
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +31 -30
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +1 -1
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +2 -2
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +60 -59
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +3 -1
- package/dialog/dialog.esm.js +13 -13
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +57 -60
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +4 -4
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +1 -1
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +5 -5
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +51 -17
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +13 -0
- package/dock/dock.esm.js +39 -5
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +51 -18
- package/dock/dock.min.css +1 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +99 -77
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +37 -15
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +95 -78
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +44 -42
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +8 -4
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +43 -39
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +17 -15
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fieldset/fieldset.esm.js +3 -1
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +16 -16
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +63 -56
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +2 -1
- package/fileupload/fileupload.esm.js +24 -17
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +63 -57
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +6 -8
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +1 -1
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +5 -5
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +71 -67
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +7 -4
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +68 -68
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +1 -1
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +2 -2
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +31 -27
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +5 -5
- package/image/image.esm.js +5 -2
- package/image/image.esm.min.js +1 -1
- package/image/image.js +29 -28
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +8 -8
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +1 -1
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +9 -9
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +11 -10
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +4 -3
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +11 -11
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +58 -34
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +41 -17
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +57 -35
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +15 -12
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +8 -5
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +15 -13
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +12 -10
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +1 -1
- package/inputtext/inputtext.esm.js +3 -1
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +11 -11
- package/inputtext/inputtext.min.css +1 -1
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +10 -9
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +1 -1
- package/inputtextarea/inputtextarea.esm.js +2 -1
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +10 -10
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +5 -5
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +1 -1
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +6 -6
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +7 -7
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +1 -1
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +8 -8
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +38 -36
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +3 -1
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +37 -37
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +36 -35
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +2 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +36 -36
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +53 -46
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -1
- package/mention/mention.esm.js +9 -3
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +48 -47
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +33 -28
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +4 -1
- package/menu/menu.esm.js +7 -3
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +30 -29
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +38 -35
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +4 -2
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +37 -36
- package/menubar/menubar.min.css +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +9 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +3 -1
- package/message/message.esm.js +3 -2
- package/message/message.esm.min.js +1 -1
- package/message/message.js +10 -9
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +19 -17
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +2 -1
- package/messages/messages.esm.js +3 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +18 -18
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +128 -116
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -2
- package/multiselect/multiselect.esm.js +44 -32
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +124 -117
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +14 -13
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +14 -14
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +35 -34
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +2 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +35 -35
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +26 -26
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +1 -1
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +27 -27
- package/organizationchart/organizationchart.min.css +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +33 -30
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +3 -2
- package/overlaypanel/overlaypanel.esm.js +11 -9
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +29 -31
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/overlayservice/overlayservice.cjs.js +2 -2
- package/overlayservice/overlayservice.cjs.min.js +1 -1
- package/overlayservice/overlayservice.esm.js +1 -1
- package/overlayservice/overlayservice.esm.min.js +1 -1
- package/overlayservice/overlayservice.js +3 -3
- package/overlayservice/overlayservice.min.js +1 -1
- package/package.json +11 -4
- package/paginator/paginator.cjs.js +48 -47
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +2 -1
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +48 -48
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +21 -18
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +6 -3
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +20 -19
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +40 -39
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/panelmenu/panelmenu.esm.js +2 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +40 -40
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +33 -29
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +3 -2
- package/password/password.esm.js +7 -3
- package/password/password.esm.min.js +1 -1
- package/password/password.js +30 -30
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +58 -54
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +14 -10
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +58 -55
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +4 -8
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +2 -6
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +5 -10
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +3168 -2524
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1939 -1294
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +3167 -2521
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +9 -9
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +1 -1
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +10 -10
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +5 -5
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +1 -1
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +6 -6
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +10 -9
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -1
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +10 -10
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +10 -9
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +4 -3
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +10 -10
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +484 -431
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +38 -18
- package/resources/themes/arya-green/theme.css +38 -18
- package/resources/themes/arya-orange/theme.css +38 -18
- package/resources/themes/arya-purple/theme.css +38 -18
- package/resources/themes/bootstrap4-dark-blue/theme.css +42 -22
- package/resources/themes/bootstrap4-dark-purple/theme.css +42 -22
- package/resources/themes/bootstrap4-light-blue/theme.css +42 -22
- package/resources/themes/bootstrap4-light-purple/theme.css +42 -22
- package/resources/themes/fluent-light/theme.css +38 -18
- 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-blue/theme.css +5675 -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-indigo/theme.css +5675 -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-purple/theme.css +5675 -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-dark-teal/theme.css +5675 -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-blue/theme.css +5675 -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-indigo/theme.css +5675 -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-purple/theme.css +5675 -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/resources/themes/lara-light-teal/theme.css +5675 -0
- package/resources/themes/luna-amber/theme.css +42 -22
- package/resources/themes/luna-blue/theme.css +42 -22
- package/resources/themes/luna-green/theme.css +42 -22
- package/resources/themes/luna-pink/theme.css +42 -22
- package/resources/themes/md-dark-deeppurple/theme.css +227 -47
- package/resources/themes/md-dark-indigo/theme.css +227 -47
- package/resources/themes/md-light-deeppurple/theme.css +227 -47
- package/resources/themes/md-light-indigo/theme.css +227 -47
- package/resources/themes/mdc-dark-deeppurple/theme.css +227 -47
- package/resources/themes/mdc-dark-indigo/theme.css +227 -47
- package/resources/themes/mdc-light-deeppurple/theme.css +227 -47
- package/resources/themes/mdc-light-indigo/theme.css +227 -47
- package/resources/themes/nova/theme.css +42 -22
- package/resources/themes/nova-accent/theme.css +42 -22
- package/resources/themes/nova-alt/theme.css +42 -22
- package/resources/themes/rhea/theme.css +42 -22
- package/resources/themes/saga-blue/theme.css +38 -18
- package/resources/themes/saga-green/theme.css +38 -18
- package/resources/themes/saga-orange/theme.css +38 -18
- package/resources/themes/saga-purple/theme.css +38 -18
- package/resources/themes/tailwind-light/theme.css +42 -22
- package/resources/themes/vela-blue/theme.css +38 -18
- package/resources/themes/vela-green/theme.css +38 -18
- package/resources/themes/vela-orange/theme.css +38 -18
- package/resources/themes/vela-purple/theme.css +38 -18
- package/ripple/ripple.cjs.js +11 -11
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +3 -3
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +12 -12
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +1 -1
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.min.js +1 -1
- package/row/row.js +2 -2
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +19 -19
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +1 -1
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +20 -20
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +18 -13
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +4 -2
- package/scrolltop/scrolltop.esm.js +9 -5
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +16 -14
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +17 -15
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +3 -1
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +16 -16
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +3 -1
- package/sidebar/sidebar.cjs.js +142 -116
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +4 -1
- package/sidebar/sidebar.esm.js +133 -108
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +139 -117
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +3 -3
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +1 -1
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +4 -4
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +37 -32
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +7 -3
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +34 -33
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +29 -19
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +21 -11
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +30 -20
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +20 -19
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +3 -2
- package/speeddial/speeddial.esm.js +2 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +20 -20
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +43 -35
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +8 -6
- package/splitbutton/splitbutton.esm.js +13 -5
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +40 -36
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +19 -19
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +2 -2
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +20 -20
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +10 -10
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +1 -1
- 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 +17 -17
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +1 -1
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +18 -18
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +16 -15
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +2 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +16 -16
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +195 -57
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +12 -1
- package/tabview/tabview.esm.js +165 -27
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +195 -58
- package/tabview/tabview.min.css +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +9 -8
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +2 -1
- package/tag/tag.esm.js +5 -4
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +10 -9
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +12 -12
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +1 -1
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +13 -13
- package/terminal/terminal.min.js +1 -1
- package/terminalservice/terminalservice.cjs.js +2 -2
- package/terminalservice/terminalservice.cjs.min.js +1 -1
- package/terminalservice/terminalservice.esm.js +1 -1
- package/terminalservice/terminalservice.esm.min.js +1 -1
- package/terminalservice/terminalservice.js +3 -3
- package/terminalservice/terminalservice.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +42 -36
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +8 -3
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +38 -37
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +12 -12
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +1 -1
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +13 -13
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +46 -40
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +2 -1
- package/toast/toast.esm.js +20 -15
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +44 -41
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +14 -9
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +3 -2
- package/togglebutton/togglebutton.esm.js +8 -3
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +13 -10
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +7 -7
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +1 -1
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +8 -8
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +65 -36
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +36 -8
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +64 -37
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +2 -0
- package/tree/tree.cjs.js +52 -51
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +14 -3
- package/tree/tree.esm.js +2 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +52 -52
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +3 -1
- package/treeselect/treeselect.cjs.js +50 -46
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +11 -3
- package/treeselect/treeselect.esm.js +10 -6
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +47 -47
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +1363 -312
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +10 -3
- package/treetable/treetable.esm.js +1267 -216
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +1362 -313
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +11 -10
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +2 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +11 -11
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +154 -33
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +17 -0
- package/utils/utils.esm.js +153 -33
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +155 -34
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +44 -34
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +29 -19
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +45 -35
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +2 -2
- package/core/core.cjs.js +0 -2987
- package/core/core.cjs.min.js +0 -1
- package/core/core.esm.js +0 -2963
- package/core/core.esm.min.js +0 -1
- package/core/package.json +0 -5
- package/util.d.ts +0 -1
package/tooltip/tooltip.cjs.js
CHANGED
|
@@ -4,12 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var ReactDOM = require('react-dom');
|
|
7
|
-
var
|
|
7
|
+
var utils = require('primereact/utils');
|
|
8
|
+
var portal = require('primereact/portal');
|
|
9
|
+
var PrimeReact = require('primereact/api');
|
|
8
10
|
|
|
9
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
12
|
|
|
11
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
14
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
15
|
+
var PrimeReact__default = /*#__PURE__*/_interopDefaultLegacy(PrimeReact);
|
|
13
16
|
|
|
14
17
|
function _classCallCheck(instance, Constructor) {
|
|
15
18
|
if (!(instance instanceof Constructor)) {
|
|
@@ -123,19 +126,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
123
126
|
function tip(props) {
|
|
124
127
|
var appendTo = props.appendTo || document.body;
|
|
125
128
|
var tooltipWrapper = document.createDocumentFragment();
|
|
126
|
-
|
|
129
|
+
utils.DomHandler.appendChild(tooltipWrapper, appendTo);
|
|
127
130
|
props = _objectSpread(_objectSpread({}, props), props.options);
|
|
128
|
-
var tooltipEl = /*#__PURE__*/React__default[
|
|
129
|
-
ReactDOM__default[
|
|
131
|
+
var tooltipEl = /*#__PURE__*/React__default["default"].createElement(Tooltip, props);
|
|
132
|
+
ReactDOM__default["default"].render(tooltipEl, tooltipWrapper);
|
|
130
133
|
|
|
131
134
|
var updateTooltip = function updateTooltip(newProps) {
|
|
132
135
|
props = _objectSpread(_objectSpread({}, props), newProps);
|
|
133
|
-
ReactDOM__default[
|
|
136
|
+
ReactDOM__default["default"].render( /*#__PURE__*/React__default["default"].cloneElement(tooltipEl, props), tooltipWrapper);
|
|
134
137
|
};
|
|
135
138
|
|
|
136
139
|
return {
|
|
137
140
|
destroy: function destroy() {
|
|
138
|
-
ReactDOM__default[
|
|
141
|
+
ReactDOM__default["default"].unmountComponentAtNode(tooltipWrapper);
|
|
139
142
|
},
|
|
140
143
|
updateContent: function updateContent(newContent) {
|
|
141
144
|
console.warn("The 'updateContent' method has been deprecated on Tooltip. Use update(newProps) method.");
|
|
@@ -190,6 +193,11 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
190
193
|
value: function isDisabled(target) {
|
|
191
194
|
return this.getTargetOption(target, 'disabled') === 'true' || this.hasTargetOption(target, 'disabled') || this.props.disabled;
|
|
192
195
|
}
|
|
196
|
+
}, {
|
|
197
|
+
key: "isShowOnDisabled",
|
|
198
|
+
value: function isShowOnDisabled(target) {
|
|
199
|
+
return this.getTargetOption(target, 'showondisabled') || this.props.showOnDisabled;
|
|
200
|
+
}
|
|
193
201
|
}, {
|
|
194
202
|
key: "isAutoHide",
|
|
195
203
|
value: function isAutoHide() {
|
|
@@ -269,15 +277,17 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
269
277
|
var _this2 = this;
|
|
270
278
|
|
|
271
279
|
this.currentTarget = e.currentTarget;
|
|
280
|
+
var disabled = this.isDisabled(this.currentTarget);
|
|
281
|
+
var empty = this.isContentEmpty(this.isShowOnDisabled(this.currentTarget) && disabled ? this.currentTarget.firstChild : this.currentTarget);
|
|
272
282
|
|
|
273
|
-
if (
|
|
283
|
+
if (empty || disabled) {
|
|
274
284
|
return;
|
|
275
285
|
}
|
|
276
286
|
|
|
277
287
|
var updateTooltipState = function updateTooltipState() {
|
|
278
288
|
_this2.updateText(_this2.currentTarget, function () {
|
|
279
|
-
if (_this2.props.autoZIndex && !
|
|
280
|
-
|
|
289
|
+
if (_this2.props.autoZIndex && !utils.ZIndexUtils.get(_this2.containerEl)) {
|
|
290
|
+
utils.ZIndexUtils.set('tooltip', _this2.containerEl, PrimeReact__default["default"].autoZIndex, _this2.props.baseZIndex || PrimeReact__default["default"].zIndex['tooltip']);
|
|
281
291
|
}
|
|
282
292
|
|
|
283
293
|
_this2.containerEl.style.left = '';
|
|
@@ -285,8 +295,8 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
285
295
|
|
|
286
296
|
if (_this2.isMouseTrack(_this2.currentTarget) && !_this2.containerSize) {
|
|
287
297
|
_this2.containerSize = {
|
|
288
|
-
width:
|
|
289
|
-
height:
|
|
298
|
+
width: utils.DomHandler.getOuterWidth(_this2.containerEl),
|
|
299
|
+
height: utils.DomHandler.getOuterHeight(_this2.containerEl)
|
|
290
300
|
};
|
|
291
301
|
}
|
|
292
302
|
|
|
@@ -321,7 +331,7 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
321
331
|
|
|
322
332
|
_this2.bindScrollListener();
|
|
323
333
|
|
|
324
|
-
|
|
334
|
+
utils.DomHandler.addClass(_this2.currentTarget, _this2.getTargetOption(_this2.currentTarget, 'classname'));
|
|
325
335
|
});
|
|
326
336
|
}
|
|
327
337
|
}
|
|
@@ -333,14 +343,14 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
333
343
|
this.clearTimeouts();
|
|
334
344
|
|
|
335
345
|
if (this.state.visible) {
|
|
336
|
-
|
|
346
|
+
utils.DomHandler.removeClass(this.currentTarget, this.getTargetOption(this.currentTarget, 'classname'));
|
|
337
347
|
this.sendCallback(this.props.onBeforeHide, {
|
|
338
348
|
originalEvent: e,
|
|
339
349
|
target: this.currentTarget
|
|
340
350
|
});
|
|
341
351
|
this.applyDelay('hideDelay', function () {
|
|
342
|
-
|
|
343
|
-
|
|
352
|
+
utils.ZIndexUtils.clear(_this3.containerEl);
|
|
353
|
+
utils.DomHandler.removeClass(_this3.containerEl, 'p-tooltip-active');
|
|
344
354
|
|
|
345
355
|
if (!_this3.isAutoHide() && _this3.allowHide === false) {
|
|
346
356
|
return;
|
|
@@ -351,7 +361,7 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
351
361
|
position: _this3.props.position
|
|
352
362
|
}, function () {
|
|
353
363
|
if (_this3.tooltipTextEl) {
|
|
354
|
-
ReactDOM__default[
|
|
364
|
+
ReactDOM__default["default"].unmountComponentAtNode(_this3.tooltipTextEl);
|
|
355
365
|
}
|
|
356
366
|
|
|
357
367
|
_this3.unbindDocumentResizeListener();
|
|
@@ -381,8 +391,8 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
381
391
|
|
|
382
392
|
if (this.isMouseTrack(target) && coordinate) {
|
|
383
393
|
var containerSize = {
|
|
384
|
-
width:
|
|
385
|
-
height:
|
|
394
|
+
width: utils.DomHandler.getOuterWidth(this.containerEl),
|
|
395
|
+
height: utils.DomHandler.getOuterHeight(this.containerEl)
|
|
386
396
|
};
|
|
387
397
|
left = coordinate.x;
|
|
388
398
|
top = coordinate.y;
|
|
@@ -422,13 +432,13 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
422
432
|
}
|
|
423
433
|
|
|
424
434
|
this.containerEl.style.top = top + 'px';
|
|
425
|
-
|
|
435
|
+
utils.DomHandler.addClass(this.containerEl, 'p-tooltip-active');
|
|
426
436
|
} else {
|
|
427
|
-
var pos =
|
|
437
|
+
var pos = utils.DomHandler.findCollisionPosition(this.state.position);
|
|
428
438
|
var my = this.getTargetOption(target, 'my') || this.props.my || pos.my;
|
|
429
439
|
var at = this.getTargetOption(target, 'at') || this.props.at || pos.at;
|
|
430
440
|
this.containerEl.style.padding = '0px';
|
|
431
|
-
|
|
441
|
+
utils.DomHandler.flipfitCollision(this.containerEl, target, my, at, function (currentPosition) {
|
|
432
442
|
var _currentPosition$at = currentPosition.at,
|
|
433
443
|
atX = _currentPosition$at.x,
|
|
434
444
|
atY = _currentPosition$at.y;
|
|
@@ -441,7 +451,7 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
441
451
|
}, function () {
|
|
442
452
|
_this4.updateContainerPosition();
|
|
443
453
|
|
|
444
|
-
|
|
454
|
+
utils.DomHandler.addClass(_this4.containerEl, 'p-tooltip-active');
|
|
445
455
|
});
|
|
446
456
|
});
|
|
447
457
|
}
|
|
@@ -475,7 +485,7 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
475
485
|
var _this5 = this;
|
|
476
486
|
|
|
477
487
|
this.documentResizeListener = function (e) {
|
|
478
|
-
if (!
|
|
488
|
+
if (!utils.DomHandler.isTouchDevice()) {
|
|
479
489
|
_this5.hide(e);
|
|
480
490
|
}
|
|
481
491
|
};
|
|
@@ -496,7 +506,7 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
496
506
|
var _this6 = this;
|
|
497
507
|
|
|
498
508
|
if (!this.scrollHandler) {
|
|
499
|
-
this.scrollHandler = new
|
|
509
|
+
this.scrollHandler = new utils.ConnectedOverlayScrollHandler(this.currentTarget, function (e) {
|
|
500
510
|
if (_this6.state.visible) {
|
|
501
511
|
_this6.hide(e);
|
|
502
512
|
}
|
|
@@ -520,8 +530,9 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
520
530
|
showEvent = _this$getEvents.showEvent,
|
|
521
531
|
hideEvent = _this$getEvents.hideEvent;
|
|
522
532
|
|
|
523
|
-
|
|
524
|
-
|
|
533
|
+
var currentTarget = this.getTarget(target);
|
|
534
|
+
currentTarget.addEventListener(showEvent, this.show);
|
|
535
|
+
currentTarget.addEventListener(hideEvent, this.hide);
|
|
525
536
|
}
|
|
526
537
|
}
|
|
527
538
|
}, {
|
|
@@ -532,8 +543,9 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
532
543
|
showEvent = _this$getEvents2.showEvent,
|
|
533
544
|
hideEvent = _this$getEvents2.hideEvent;
|
|
534
545
|
|
|
535
|
-
|
|
536
|
-
|
|
546
|
+
var currentTarget = this.getTarget(target);
|
|
547
|
+
currentTarget.removeEventListener(showEvent, this.show);
|
|
548
|
+
currentTarget.removeEventListener(hideEvent, this.hide);
|
|
537
549
|
}
|
|
538
550
|
}
|
|
539
551
|
}, {
|
|
@@ -568,6 +580,22 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
568
580
|
clearTimeout(this.updateDelayTimeout);
|
|
569
581
|
clearTimeout(this.hideDelayTimeout);
|
|
570
582
|
}
|
|
583
|
+
}, {
|
|
584
|
+
key: "getTarget",
|
|
585
|
+
value: function getTarget(target) {
|
|
586
|
+
if (target) {
|
|
587
|
+
if (this.isShowOnDisabled(target)) {
|
|
588
|
+
var wrapper = document.createElement('span');
|
|
589
|
+
target.parentNode.insertBefore(wrapper, target);
|
|
590
|
+
wrapper.appendChild(target);
|
|
591
|
+
return wrapper;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
return target;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
return null;
|
|
598
|
+
}
|
|
571
599
|
}, {
|
|
572
600
|
key: "updateTargetEvents",
|
|
573
601
|
value: function updateTargetEvents(target) {
|
|
@@ -590,11 +618,11 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
590
618
|
var _this7 = this;
|
|
591
619
|
|
|
592
620
|
if (target) {
|
|
593
|
-
if (
|
|
621
|
+
if (utils.DomHandler.isElement(target)) {
|
|
594
622
|
this[operation](target);
|
|
595
623
|
} else {
|
|
596
624
|
var setEvent = function setEvent(target) {
|
|
597
|
-
var element =
|
|
625
|
+
var element = utils.DomHandler.find(document, target);
|
|
598
626
|
element.forEach(function (el) {
|
|
599
627
|
_this7[operation](el);
|
|
600
628
|
});
|
|
@@ -653,16 +681,16 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
653
681
|
this.scrollHandler = null;
|
|
654
682
|
}
|
|
655
683
|
|
|
656
|
-
|
|
684
|
+
utils.ZIndexUtils.clear(this.containerEl);
|
|
657
685
|
}
|
|
658
686
|
}, {
|
|
659
687
|
key: "renderElement",
|
|
660
688
|
value: function renderElement() {
|
|
661
689
|
var _this9 = this;
|
|
662
690
|
|
|
663
|
-
var tooltipClassName =
|
|
691
|
+
var tooltipClassName = utils.classNames('p-tooltip p-component', _defineProperty({}, "p-tooltip-".concat(this.state.position), true), this.props.className);
|
|
664
692
|
var isTargetContentEmpty = this.isTargetContentEmpty(this.currentTarget);
|
|
665
|
-
return /*#__PURE__*/React__default[
|
|
693
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
666
694
|
id: this.props.id,
|
|
667
695
|
ref: function ref(el) {
|
|
668
696
|
return _this9.containerEl = el;
|
|
@@ -673,9 +701,9 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
673
701
|
"aria-hidden": this.state.visible,
|
|
674
702
|
onMouseEnter: this.onMouseEnter,
|
|
675
703
|
onMouseLeave: this.onMouseLeave
|
|
676
|
-
}, /*#__PURE__*/React__default[
|
|
704
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
677
705
|
className: "p-tooltip-arrow"
|
|
678
|
-
}), /*#__PURE__*/React__default[
|
|
706
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
679
707
|
ref: function ref(el) {
|
|
680
708
|
return _this9.tooltipTextEl = el;
|
|
681
709
|
},
|
|
@@ -687,7 +715,7 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
687
715
|
value: function render() {
|
|
688
716
|
if (this.state.visible) {
|
|
689
717
|
var element = this.renderElement();
|
|
690
|
-
return /*#__PURE__*/React__default[
|
|
718
|
+
return /*#__PURE__*/React__default["default"].createElement(portal.Portal, {
|
|
691
719
|
element: element,
|
|
692
720
|
appendTo: this.props.appendTo,
|
|
693
721
|
visible: true
|
|
@@ -724,6 +752,7 @@ _defineProperty(Tooltip, "defaultProps", {
|
|
|
724
752
|
updateDelay: 0,
|
|
725
753
|
hideDelay: 0,
|
|
726
754
|
autoHide: true,
|
|
755
|
+
showOnDisabled: false,
|
|
727
756
|
onBeforeShow: null,
|
|
728
757
|
onBeforeHide: null,
|
|
729
758
|
onShow: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("react-dom"),n=require("primereact/core");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=i(t),r=i(e);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(){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(t){return!1}}function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var m=function(e){c(T,t.Component);var i,u,p,g,y,m=(i=T,u=v(),function(){var t,e=d(i);if(u){var n=d(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return h(this,t)});function T(t){var e;return s(this,T),(e=m.call(this,t)).state={visible:!1,position:e.props.position},e.show=e.show.bind(l(e)),e.hide=e.hide.bind(l(e)),e.onMouseEnter=e.onMouseEnter.bind(l(e)),e.onMouseLeave=e.onMouseLeave.bind(l(e)),e}return p=T,(g=[{key:"isTargetContentEmpty",value:function(t){return!(this.props.content||this.getTargetOption(t,"tooltip"))}},{key:"isContentEmpty",value:function(t){return!(this.props.content||this.getTargetOption(t,"tooltip")||this.props.children)}},{key:"isMouseTrack",value:function(t){return this.getTargetOption(t,"mousetrack")||this.props.mouseTrack}},{key:"isDisabled",value:function(t){return"true"===this.getTargetOption(t,"disabled")||this.hasTargetOption(t,"disabled")||this.props.disabled}},{key:"isAutoHide",value:function(){return this.getTargetOption(this.currentTarget,"autohide")||this.props.autoHide}},{key:"getTargetOption",value:function(t,e){return this.hasTargetOption(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null}},{key:"hasTargetOption",value:function(t,e){return t&&t.hasAttribute(e)}},{key:"getEvents",value:function(t){var e=this.getTargetOption(t,"showevent")||this.props.showEvent,n=this.getTargetOption(t,"hideevent")||this.props.hideEvent;return this.isMouseTrack(t)?(e="mousemove",n="mouseleave"):"focus"===(this.getTargetOption(t,"event")||this.props.event)&&(e="focus",n="blur"),{showEvent:e,hideEvent:n}}},{key:"getPosition",value:function(t){return this.getTargetOption(t,"position")||this.state.position}},{key:"getMouseTrackPosition",value:function(t){return{top:this.getTargetOption(t,"mousetracktop")||this.props.mouseTrackTop,left:this.getTargetOption(t,"mousetrackleft")||this.props.mouseTrackLeft}}},{key:"updateText",value:function(t,e){if(this.tooltipTextEl){var n=this.getTargetOption(t,"tooltip")||this.props.content;n?(this.tooltipTextEl.innerHTML="",this.tooltipTextEl.appendChild(document.createTextNode(n)),e()):this.props.children&&e()}}},{key:"show",value:function(t){var e=this;if(this.currentTarget=t.currentTarget,!this.isContentEmpty(this.currentTarget)&&!this.isDisabled(this.currentTarget)){var i=function(){e.updateText(e.currentTarget,(function(){e.props.autoZIndex&&!n.ZIndexUtils.get(e.containerEl)&&n.ZIndexUtils.set("tooltip",e.containerEl,e.props.baseZIndex),e.containerEl.style.left="",e.containerEl.style.top="",e.isMouseTrack(e.currentTarget)&&!e.containerSize&&(e.containerSize={width:n.DomHandler.getOuterWidth(e.containerEl),height:n.DomHandler.getOuterHeight(e.containerEl)}),e.align(e.currentTarget,{x:t.pageX,y:t.pageY})}))};this.state.visible?this.applyDelay("updateDelay",i):(this.sendCallback(this.props.onBeforeShow,{originalEvent:t,target:this.currentTarget}),this.applyDelay("showDelay",(function(){e.setState({visible:!0,position:e.getPosition(e.currentTarget)},(function(){i(),e.sendCallback(e.props.onShow,{originalEvent:t,target:e.currentTarget})})),e.bindDocumentResizeListener(),e.bindScrollListener(),n.DomHandler.addClass(e.currentTarget,e.getTargetOption(e.currentTarget,"classname"))})))}}},{key:"hide",value:function(t){var e=this;this.clearTimeouts(),this.state.visible&&(n.DomHandler.removeClass(this.currentTarget,this.getTargetOption(this.currentTarget,"classname")),this.sendCallback(this.props.onBeforeHide,{originalEvent:t,target:this.currentTarget}),this.applyDelay("hideDelay",(function(){n.ZIndexUtils.clear(e.containerEl),n.DomHandler.removeClass(e.containerEl,"p-tooltip-active"),(e.isAutoHide()||!1!==e.allowHide)&&e.setState({visible:!1,position:e.props.position},(function(){e.tooltipTextEl&&r.default.unmountComponentAtNode(e.tooltipTextEl),e.unbindDocumentResizeListener(),e.unbindScrollListener(),e.currentTarget=null,e.scrollHandler=null,e.containerSize=null,e.allowHide=!0,e.sendCallback(e.props.onHide,{originalEvent:t,target:e.currentTarget})}))})))}},{key:"align",value:function(t,e){var i=this,o=0,r=0;if(this.isMouseTrack(t)&&e){var s={width:n.DomHandler.getOuterWidth(this.containerEl),height:n.DomHandler.getOuterHeight(this.containerEl)};o=e.x,r=e.y;var a=this.getMouseTrackPosition(t),l=a.top,u=a.left;switch(this.state.position){case"left":o-=s.width+u,r-=s.height/2-l;break;case"right":o+=u,r-=s.height/2-l;break;case"top":o-=s.width/2-u,r-=s.height+l;break;case"bottom":o-=s.width/2-u,r+=l}o<=0||this.containerSize.width>s.width?(this.containerEl.style.left="0px",this.containerEl.style.right=window.innerWidth-s.width-o+"px"):(this.containerEl.style.right="",this.containerEl.style.left=o+"px"),this.containerEl.style.top=r+"px",n.DomHandler.addClass(this.containerEl,"p-tooltip-active")}else{var c=n.DomHandler.findCollisionPosition(this.state.position),p=this.getTargetOption(t,"my")||this.props.my||c.my,h=this.getTargetOption(t,"at")||this.props.at||c.at;this.containerEl.style.padding="0px",n.DomHandler.flipfitCollision(this.containerEl,t,p,h,(function(t){var e=t.at,o=e.x,r=i.props.at?"center"!==o&&o!==t.my.x?o:e.y:t.at["".concat(c.axis)];i.containerEl.style.padding="",i.setState({position:r},(function(){i.updateContainerPosition(),n.DomHandler.addClass(i.containerEl,"p-tooltip-active")}))}))}}},{key:"updateContainerPosition",value:function(){if(this.containerEl){var t=getComputedStyle(this.containerEl);"left"===this.state.position?this.containerEl.style.left=parseFloat(t.left)-2*parseFloat(t.paddingLeft)+"px":"top"===this.state.position&&(this.containerEl.style.top=parseFloat(t.top)-2*parseFloat(t.paddingTop)+"px")}}},{key:"onMouseEnter",value:function(){this.isAutoHide()||(this.allowHide=!1)}},{key:"onMouseLeave",value:function(t){this.isAutoHide()||(this.allowHide=!0,this.hide(t))}},{key:"bindDocumentResizeListener",value:function(){var t=this;this.documentResizeListener=function(e){n.DomHandler.isAndroid()||t.hide(e)},window.addEventListener("resize",this.documentResizeListener)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var t=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.currentTarget,(function(e){t.state.visible&&t.hide(e)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindTargetEvent",value:function(t){if(t){var e=this.getEvents(t),n=e.hideEvent;t.addEventListener(e.showEvent,this.show),t.addEventListener(n,this.hide)}}},{key:"unbindTargetEvent",value:function(t){if(t){var e=this.getEvents(t),n=e.hideEvent;t.removeEventListener(e.showEvent,this.show),t.removeEventListener(n,this.hide)}}},{key:"applyDelay",value:function(t,e){this.clearTimeouts();var n=this.getTargetOption(this.currentTarget,t.toLowerCase())||this.props[t];n?this["".concat(t,"Timeout")]=setTimeout((function(){return e()}),n):e()}},{key:"sendCallback",value:function(t){if(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t.apply(void 0,n)}}},{key:"clearTimeouts",value:function(){clearTimeout(this.showDelayTimeout),clearTimeout(this.updateDelayTimeout),clearTimeout(this.hideDelayTimeout)}},{key:"updateTargetEvents",value:function(t){this.unloadTargetEvents(t),this.loadTargetEvents(t)}},{key:"loadTargetEvents",value:function(t){this.setTargetEventOperations(t||this.props.target,"bindTargetEvent")}},{key:"unloadTargetEvents",value:function(t){this.setTargetEventOperations(t||this.props.target,"unbindTargetEvent")}},{key:"setTargetEventOperations",value:function(t,e){var i=this;if(t)if(n.DomHandler.isElement(t))this[e](t);else{var o=function(t){n.DomHandler.find(document,t).forEach((function(t){i[e](t)}))};t instanceof Array?t.forEach((function(t){o(t)})):o(t)}}},{key:"componentDidMount",value:function(){this.props.target&&this.loadTargetEvents()}},{key:"componentDidUpdate",value:function(t,e){var n=this;t.target!==this.props.target&&(this.unloadTargetEvents(t.target),this.loadTargetEvents()),this.state.visible&&(t.content!==this.props.content&&this.applyDelay("updateDelay",(function(){n.updateText(n.currentTarget,(function(){n.align(n.currentTarget)}))})),this.currentTarget&&this.isDisabled(this.currentTarget)&&this.hide())}},{key:"componentWillUnmount",value:function(){this.clearTimeouts(),this.unbindDocumentResizeListener(),this.unloadTargetEvents(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.containerEl)}},{key:"renderElement",value:function(){var t=this,e=n.classNames("p-tooltip p-component",f({},"p-tooltip-".concat(this.state.position),!0),this.props.className),i=this.isTargetContentEmpty(this.currentTarget);return o.default.createElement("div",{id:this.props.id,ref:function(e){return t.containerEl=e},className:e,style:this.props.style,role:"tooltip","aria-hidden":this.state.visible,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},o.default.createElement("div",{className:"p-tooltip-arrow"}),o.default.createElement("div",{ref:function(e){return t.tooltipTextEl=e},className:"p-tooltip-text"},i&&this.props.children))}},{key:"render",value:function(){if(this.state.visible){var t=this.renderElement();return o.default.createElement(n.Portal,{element:t,appendTo:this.props.appendTo,visible:!0})}return null}}])&&a(p.prototype,g),y&&a(p,y),T}();f(m,"defaultProps",{id:null,target:null,content:null,disabled:!1,className:null,style:null,appendTo:null,position:"right",my:null,at:null,event:null,showEvent:"mouseenter",hideEvent:"mouseleave",autoZIndex:!0,baseZIndex:0,mouseTrack:!1,mouseTrackTop:5,mouseTrackLeft:5,showDelay:0,updateDelay:0,hideDelay:0,autoHide:!0,onBeforeShow:null,onBeforeHide:null,onShow:null,onHide:null}),exports.Tooltip=m,exports.tip=function(t){var e=t.appendTo||document.body,i=document.createDocumentFragment();n.DomHandler.appendChild(i,e),t=y(y({},t),t.options);var s=o.default.createElement(m,t);r.default.render(s,i);var a=function(e){t=y(y({},t),e),r.default.render(o.default.cloneElement(s,t),i)};return{destroy:function(){r.default.unmountComponentAtNode(i)},updateContent:function(t){console.warn("The 'updateContent' method has been deprecated on Tooltip. Use update(newProps) method."),a({content:t})},update:function(t){a(t)}}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("react-dom"),n=require("primereact/utils"),i=require("primereact/portal"),o=require("primereact/api");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=r(t),a=r(e),l=r(o);function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function v(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return p(t)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(){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(t){return!1}}function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var E=function(e){d(E,t.Component);var o,r,h,f,T,b=(o=E,r=m(),function(){var t,e=g(o);if(r){var n=g(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return v(this,t)});function E(t){var e;return u(this,E),(e=b.call(this,t)).state={visible:!1,position:e.props.position},e.show=e.show.bind(p(e)),e.hide=e.hide.bind(p(e)),e.onMouseEnter=e.onMouseEnter.bind(p(e)),e.onMouseLeave=e.onMouseLeave.bind(p(e)),e}return h=E,f=[{key:"isTargetContentEmpty",value:function(t){return!(this.props.content||this.getTargetOption(t,"tooltip"))}},{key:"isContentEmpty",value:function(t){return!(this.props.content||this.getTargetOption(t,"tooltip")||this.props.children)}},{key:"isMouseTrack",value:function(t){return this.getTargetOption(t,"mousetrack")||this.props.mouseTrack}},{key:"isDisabled",value:function(t){return"true"===this.getTargetOption(t,"disabled")||this.hasTargetOption(t,"disabled")||this.props.disabled}},{key:"isShowOnDisabled",value:function(t){return this.getTargetOption(t,"showondisabled")||this.props.showOnDisabled}},{key:"isAutoHide",value:function(){return this.getTargetOption(this.currentTarget,"autohide")||this.props.autoHide}},{key:"getTargetOption",value:function(t,e){return this.hasTargetOption(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null}},{key:"hasTargetOption",value:function(t,e){return t&&t.hasAttribute(e)}},{key:"getEvents",value:function(t){var e=this.getTargetOption(t,"showevent")||this.props.showEvent,n=this.getTargetOption(t,"hideevent")||this.props.hideEvent;return this.isMouseTrack(t)?(e="mousemove",n="mouseleave"):"focus"===(this.getTargetOption(t,"event")||this.props.event)&&(e="focus",n="blur"),{showEvent:e,hideEvent:n}}},{key:"getPosition",value:function(t){return this.getTargetOption(t,"position")||this.state.position}},{key:"getMouseTrackPosition",value:function(t){return{top:this.getTargetOption(t,"mousetracktop")||this.props.mouseTrackTop,left:this.getTargetOption(t,"mousetrackleft")||this.props.mouseTrackLeft}}},{key:"updateText",value:function(t,e){if(this.tooltipTextEl){var n=this.getTargetOption(t,"tooltip")||this.props.content;n?(this.tooltipTextEl.innerHTML="",this.tooltipTextEl.appendChild(document.createTextNode(n)),e()):this.props.children&&e()}}},{key:"show",value:function(t){var e=this;this.currentTarget=t.currentTarget;var i=this.isDisabled(this.currentTarget);if(!this.isContentEmpty(this.isShowOnDisabled(this.currentTarget)&&i?this.currentTarget.firstChild:this.currentTarget)&&!i){var o=function(){e.updateText(e.currentTarget,(function(){e.props.autoZIndex&&!n.ZIndexUtils.get(e.containerEl)&&n.ZIndexUtils.set("tooltip",e.containerEl,l.default.autoZIndex,e.props.baseZIndex||l.default.zIndex.tooltip),e.containerEl.style.left="",e.containerEl.style.top="",e.isMouseTrack(e.currentTarget)&&!e.containerSize&&(e.containerSize={width:n.DomHandler.getOuterWidth(e.containerEl),height:n.DomHandler.getOuterHeight(e.containerEl)}),e.align(e.currentTarget,{x:t.pageX,y:t.pageY})}))};this.state.visible?this.applyDelay("updateDelay",o):(this.sendCallback(this.props.onBeforeShow,{originalEvent:t,target:this.currentTarget}),this.applyDelay("showDelay",(function(){e.setState({visible:!0,position:e.getPosition(e.currentTarget)},(function(){o(),e.sendCallback(e.props.onShow,{originalEvent:t,target:e.currentTarget})})),e.bindDocumentResizeListener(),e.bindScrollListener(),n.DomHandler.addClass(e.currentTarget,e.getTargetOption(e.currentTarget,"classname"))})))}}},{key:"hide",value:function(t){var e=this;this.clearTimeouts(),this.state.visible&&(n.DomHandler.removeClass(this.currentTarget,this.getTargetOption(this.currentTarget,"classname")),this.sendCallback(this.props.onBeforeHide,{originalEvent:t,target:this.currentTarget}),this.applyDelay("hideDelay",(function(){n.ZIndexUtils.clear(e.containerEl),n.DomHandler.removeClass(e.containerEl,"p-tooltip-active"),(e.isAutoHide()||!1!==e.allowHide)&&e.setState({visible:!1,position:e.props.position},(function(){e.tooltipTextEl&&a.default.unmountComponentAtNode(e.tooltipTextEl),e.unbindDocumentResizeListener(),e.unbindScrollListener(),e.currentTarget=null,e.scrollHandler=null,e.containerSize=null,e.allowHide=!0,e.sendCallback(e.props.onHide,{originalEvent:t,target:e.currentTarget})}))})))}},{key:"align",value:function(t,e){var i=this,o=0,r=0;if(this.isMouseTrack(t)&&e){var s={width:n.DomHandler.getOuterWidth(this.containerEl),height:n.DomHandler.getOuterHeight(this.containerEl)};o=e.x,r=e.y;var a=this.getMouseTrackPosition(t),l=a.top,u=a.left;switch(this.state.position){case"left":o-=s.width+u,r-=s.height/2-l;break;case"right":o+=u,r-=s.height/2-l;break;case"top":o-=s.width/2-u,r-=s.height+l;break;case"bottom":o-=s.width/2-u,r+=l}o<=0||this.containerSize.width>s.width?(this.containerEl.style.left="0px",this.containerEl.style.right=window.innerWidth-s.width-o+"px"):(this.containerEl.style.right="",this.containerEl.style.left=o+"px"),this.containerEl.style.top=r+"px",n.DomHandler.addClass(this.containerEl,"p-tooltip-active")}else{var c=n.DomHandler.findCollisionPosition(this.state.position),p=this.getTargetOption(t,"my")||this.props.my||c.my,h=this.getTargetOption(t,"at")||this.props.at||c.at;this.containerEl.style.padding="0px",n.DomHandler.flipfitCollision(this.containerEl,t,p,h,(function(t){var e=t.at,o=e.x,r=i.props.at?"center"!==o&&o!==t.my.x?o:e.y:t.at["".concat(c.axis)];i.containerEl.style.padding="",i.setState({position:r},(function(){i.updateContainerPosition(),n.DomHandler.addClass(i.containerEl,"p-tooltip-active")}))}))}}},{key:"updateContainerPosition",value:function(){if(this.containerEl){var t=getComputedStyle(this.containerEl);"left"===this.state.position?this.containerEl.style.left=parseFloat(t.left)-2*parseFloat(t.paddingLeft)+"px":"top"===this.state.position&&(this.containerEl.style.top=parseFloat(t.top)-2*parseFloat(t.paddingTop)+"px")}}},{key:"onMouseEnter",value:function(){this.isAutoHide()||(this.allowHide=!1)}},{key:"onMouseLeave",value:function(t){this.isAutoHide()||(this.allowHide=!0,this.hide(t))}},{key:"bindDocumentResizeListener",value:function(){var t=this;this.documentResizeListener=function(e){n.DomHandler.isTouchDevice()||t.hide(e)},window.addEventListener("resize",this.documentResizeListener)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var t=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.currentTarget,(function(e){t.state.visible&&t.hide(e)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindTargetEvent",value:function(t){if(t){var e=this.getEvents(t),n=e.showEvent,i=e.hideEvent,o=this.getTarget(t);o.addEventListener(n,this.show),o.addEventListener(i,this.hide)}}},{key:"unbindTargetEvent",value:function(t){if(t){var e=this.getEvents(t),n=e.showEvent,i=e.hideEvent,o=this.getTarget(t);o.removeEventListener(n,this.show),o.removeEventListener(i,this.hide)}}},{key:"applyDelay",value:function(t,e){this.clearTimeouts();var n=this.getTargetOption(this.currentTarget,t.toLowerCase())||this.props[t];n?this["".concat(t,"Timeout")]=setTimeout((function(){return e()}),n):e()}},{key:"sendCallback",value:function(t){if(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t.apply(void 0,n)}}},{key:"clearTimeouts",value:function(){clearTimeout(this.showDelayTimeout),clearTimeout(this.updateDelayTimeout),clearTimeout(this.hideDelayTimeout)}},{key:"getTarget",value:function(t){if(t){if(this.isShowOnDisabled(t)){var e=document.createElement("span");return t.parentNode.insertBefore(e,t),e.appendChild(t),e}return t}return null}},{key:"updateTargetEvents",value:function(t){this.unloadTargetEvents(t),this.loadTargetEvents(t)}},{key:"loadTargetEvents",value:function(t){this.setTargetEventOperations(t||this.props.target,"bindTargetEvent")}},{key:"unloadTargetEvents",value:function(t){this.setTargetEventOperations(t||this.props.target,"unbindTargetEvent")}},{key:"setTargetEventOperations",value:function(t,e){var i=this;if(t)if(n.DomHandler.isElement(t))this[e](t);else{var o=function(t){n.DomHandler.find(document,t).forEach((function(t){i[e](t)}))};t instanceof Array?t.forEach((function(t){o(t)})):o(t)}}},{key:"componentDidMount",value:function(){this.props.target&&this.loadTargetEvents()}},{key:"componentDidUpdate",value:function(t,e){var n=this;t.target!==this.props.target&&(this.unloadTargetEvents(t.target),this.loadTargetEvents()),this.state.visible&&(t.content!==this.props.content&&this.applyDelay("updateDelay",(function(){n.updateText(n.currentTarget,(function(){n.align(n.currentTarget)}))})),this.currentTarget&&this.isDisabled(this.currentTarget)&&this.hide())}},{key:"componentWillUnmount",value:function(){this.clearTimeouts(),this.unbindDocumentResizeListener(),this.unloadTargetEvents(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.containerEl)}},{key:"renderElement",value:function(){var t=this,e=n.classNames("p-tooltip p-component",y({},"p-tooltip-".concat(this.state.position),!0),this.props.className),i=this.isTargetContentEmpty(this.currentTarget);return s.default.createElement("div",{id:this.props.id,ref:function(e){return t.containerEl=e},className:e,style:this.props.style,role:"tooltip","aria-hidden":this.state.visible,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},s.default.createElement("div",{className:"p-tooltip-arrow"}),s.default.createElement("div",{ref:function(e){return t.tooltipTextEl=e},className:"p-tooltip-text"},i&&this.props.children))}},{key:"render",value:function(){if(this.state.visible){var t=this.renderElement();return s.default.createElement(i.Portal,{element:t,appendTo:this.props.appendTo,visible:!0})}return null}}],f&&c(h.prototype,f),T&&c(h,T),E}();y(E,"defaultProps",{id:null,target:null,content:null,disabled:!1,className:null,style:null,appendTo:null,position:"right",my:null,at:null,event:null,showEvent:"mouseenter",hideEvent:"mouseleave",autoZIndex:!0,baseZIndex:0,mouseTrack:!1,mouseTrackTop:5,mouseTrackLeft:5,showDelay:0,updateDelay:0,hideDelay:0,autoHide:!0,showOnDisabled:!1,onBeforeShow:null,onBeforeHide:null,onShow:null,onHide:null}),exports.Tooltip=E,exports.tip=function(t){var e=t.appendTo||document.body,i=document.createDocumentFragment();n.DomHandler.appendChild(i,e),t=b(b({},t),t.options);var o=s.default.createElement(E,t);a.default.render(o,i);var r=function(e){t=b(b({},t),e),a.default.render(s.default.cloneElement(o,t),i)};return{destroy:function(){a.default.unmountComponentAtNode(i)},updateContent:function(t){console.warn("The 'updateContent' method has been deprecated on Tooltip. Use update(newProps) method."),r({content:t})},update:function(t){r(t)}}};
|
package/tooltip/tooltip.d.ts
CHANGED
package/tooltip/tooltip.esm.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
-
import { DomHandler, ZIndexUtils, ConnectedOverlayScrollHandler, classNames
|
|
3
|
+
import { DomHandler, ZIndexUtils, ConnectedOverlayScrollHandler, classNames } from 'primereact/utils';
|
|
4
|
+
import { Portal } from 'primereact/portal';
|
|
5
|
+
import PrimeReact from 'primereact/api';
|
|
4
6
|
|
|
5
7
|
function _classCallCheck(instance, Constructor) {
|
|
6
8
|
if (!(instance instanceof Constructor)) {
|
|
@@ -181,6 +183,11 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
181
183
|
value: function isDisabled(target) {
|
|
182
184
|
return this.getTargetOption(target, 'disabled') === 'true' || this.hasTargetOption(target, 'disabled') || this.props.disabled;
|
|
183
185
|
}
|
|
186
|
+
}, {
|
|
187
|
+
key: "isShowOnDisabled",
|
|
188
|
+
value: function isShowOnDisabled(target) {
|
|
189
|
+
return this.getTargetOption(target, 'showondisabled') || this.props.showOnDisabled;
|
|
190
|
+
}
|
|
184
191
|
}, {
|
|
185
192
|
key: "isAutoHide",
|
|
186
193
|
value: function isAutoHide() {
|
|
@@ -260,15 +267,17 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
260
267
|
var _this2 = this;
|
|
261
268
|
|
|
262
269
|
this.currentTarget = e.currentTarget;
|
|
270
|
+
var disabled = this.isDisabled(this.currentTarget);
|
|
271
|
+
var empty = this.isContentEmpty(this.isShowOnDisabled(this.currentTarget) && disabled ? this.currentTarget.firstChild : this.currentTarget);
|
|
263
272
|
|
|
264
|
-
if (
|
|
273
|
+
if (empty || disabled) {
|
|
265
274
|
return;
|
|
266
275
|
}
|
|
267
276
|
|
|
268
277
|
var updateTooltipState = function updateTooltipState() {
|
|
269
278
|
_this2.updateText(_this2.currentTarget, function () {
|
|
270
279
|
if (_this2.props.autoZIndex && !ZIndexUtils.get(_this2.containerEl)) {
|
|
271
|
-
ZIndexUtils.set('tooltip', _this2.containerEl, _this2.props.baseZIndex);
|
|
280
|
+
ZIndexUtils.set('tooltip', _this2.containerEl, PrimeReact.autoZIndex, _this2.props.baseZIndex || PrimeReact.zIndex['tooltip']);
|
|
272
281
|
}
|
|
273
282
|
|
|
274
283
|
_this2.containerEl.style.left = '';
|
|
@@ -466,7 +475,7 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
466
475
|
var _this5 = this;
|
|
467
476
|
|
|
468
477
|
this.documentResizeListener = function (e) {
|
|
469
|
-
if (!DomHandler.
|
|
478
|
+
if (!DomHandler.isTouchDevice()) {
|
|
470
479
|
_this5.hide(e);
|
|
471
480
|
}
|
|
472
481
|
};
|
|
@@ -511,8 +520,9 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
511
520
|
showEvent = _this$getEvents.showEvent,
|
|
512
521
|
hideEvent = _this$getEvents.hideEvent;
|
|
513
522
|
|
|
514
|
-
|
|
515
|
-
|
|
523
|
+
var currentTarget = this.getTarget(target);
|
|
524
|
+
currentTarget.addEventListener(showEvent, this.show);
|
|
525
|
+
currentTarget.addEventListener(hideEvent, this.hide);
|
|
516
526
|
}
|
|
517
527
|
}
|
|
518
528
|
}, {
|
|
@@ -523,8 +533,9 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
523
533
|
showEvent = _this$getEvents2.showEvent,
|
|
524
534
|
hideEvent = _this$getEvents2.hideEvent;
|
|
525
535
|
|
|
526
|
-
|
|
527
|
-
|
|
536
|
+
var currentTarget = this.getTarget(target);
|
|
537
|
+
currentTarget.removeEventListener(showEvent, this.show);
|
|
538
|
+
currentTarget.removeEventListener(hideEvent, this.hide);
|
|
528
539
|
}
|
|
529
540
|
}
|
|
530
541
|
}, {
|
|
@@ -559,6 +570,22 @@ var Tooltip = /*#__PURE__*/function (_Component) {
|
|
|
559
570
|
clearTimeout(this.updateDelayTimeout);
|
|
560
571
|
clearTimeout(this.hideDelayTimeout);
|
|
561
572
|
}
|
|
573
|
+
}, {
|
|
574
|
+
key: "getTarget",
|
|
575
|
+
value: function getTarget(target) {
|
|
576
|
+
if (target) {
|
|
577
|
+
if (this.isShowOnDisabled(target)) {
|
|
578
|
+
var wrapper = document.createElement('span');
|
|
579
|
+
target.parentNode.insertBefore(wrapper, target);
|
|
580
|
+
wrapper.appendChild(target);
|
|
581
|
+
return wrapper;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
return target;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
return null;
|
|
588
|
+
}
|
|
562
589
|
}, {
|
|
563
590
|
key: "updateTargetEvents",
|
|
564
591
|
value: function updateTargetEvents(target) {
|
|
@@ -715,6 +742,7 @@ _defineProperty(Tooltip, "defaultProps", {
|
|
|
715
742
|
updateDelay: 0,
|
|
716
743
|
hideDelay: 0,
|
|
717
744
|
autoHide: true,
|
|
745
|
+
showOnDisabled: false,
|
|
718
746
|
onBeforeShow: null,
|
|
719
747
|
onBeforeHide: null,
|
|
720
748
|
onShow: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{Component as e}from"react";import n from"react-dom";import{DomHandler as i,ZIndexUtils as o,ConnectedOverlayScrollHandler as r,classNames as s,Portal as a}from"primereact/core";function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){if(e&&("object"===d(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return c(t)}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(){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(t){return!1}}function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(e){var o=e.appendTo||document.body,r=document.createDocumentFragment();i.appendChild(r,o),e=m(m({},e),e.options);var s=t.createElement(b,e);n.render(s,r);var a=function(i){e=m(m({},e),i),n.render(t.cloneElement(s,e),r)};return{destroy:function(){n.unmountComponentAtNode(r)},updateContent:function(t){console.warn("The 'updateContent' method has been deprecated on Tooltip. Use update(newProps) method."),a({content:t})},update:function(t){a(t)}}}var b=function(p){h(w,e);var d,T,m,E,b,k=(d=w,T=y(),function(){var t,e=v(d);if(T){var n=v(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return f(this,t)});function w(t){var e;return l(this,w),(e=k.call(this,t)).state={visible:!1,position:e.props.position},e.show=e.show.bind(c(e)),e.hide=e.hide.bind(c(e)),e.onMouseEnter=e.onMouseEnter.bind(c(e)),e.onMouseLeave=e.onMouseLeave.bind(c(e)),e}return m=w,(E=[{key:"isTargetContentEmpty",value:function(t){return!(this.props.content||this.getTargetOption(t,"tooltip"))}},{key:"isContentEmpty",value:function(t){return!(this.props.content||this.getTargetOption(t,"tooltip")||this.props.children)}},{key:"isMouseTrack",value:function(t){return this.getTargetOption(t,"mousetrack")||this.props.mouseTrack}},{key:"isDisabled",value:function(t){return"true"===this.getTargetOption(t,"disabled")||this.hasTargetOption(t,"disabled")||this.props.disabled}},{key:"isAutoHide",value:function(){return this.getTargetOption(this.currentTarget,"autohide")||this.props.autoHide}},{key:"getTargetOption",value:function(t,e){return this.hasTargetOption(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null}},{key:"hasTargetOption",value:function(t,e){return t&&t.hasAttribute(e)}},{key:"getEvents",value:function(t){var e=this.getTargetOption(t,"showevent")||this.props.showEvent,n=this.getTargetOption(t,"hideevent")||this.props.hideEvent;return this.isMouseTrack(t)?(e="mousemove",n="mouseleave"):"focus"===(this.getTargetOption(t,"event")||this.props.event)&&(e="focus",n="blur"),{showEvent:e,hideEvent:n}}},{key:"getPosition",value:function(t){return this.getTargetOption(t,"position")||this.state.position}},{key:"getMouseTrackPosition",value:function(t){return{top:this.getTargetOption(t,"mousetracktop")||this.props.mouseTrackTop,left:this.getTargetOption(t,"mousetrackleft")||this.props.mouseTrackLeft}}},{key:"updateText",value:function(t,e){if(this.tooltipTextEl){var n=this.getTargetOption(t,"tooltip")||this.props.content;n?(this.tooltipTextEl.innerHTML="",this.tooltipTextEl.appendChild(document.createTextNode(n)),e()):this.props.children&&e()}}},{key:"show",value:function(t){var e=this;if(this.currentTarget=t.currentTarget,!this.isContentEmpty(this.currentTarget)&&!this.isDisabled(this.currentTarget)){var n=function(){e.updateText(e.currentTarget,(function(){e.props.autoZIndex&&!o.get(e.containerEl)&&o.set("tooltip",e.containerEl,e.props.baseZIndex),e.containerEl.style.left="",e.containerEl.style.top="",e.isMouseTrack(e.currentTarget)&&!e.containerSize&&(e.containerSize={width:i.getOuterWidth(e.containerEl),height:i.getOuterHeight(e.containerEl)}),e.align(e.currentTarget,{x:t.pageX,y:t.pageY})}))};this.state.visible?this.applyDelay("updateDelay",n):(this.sendCallback(this.props.onBeforeShow,{originalEvent:t,target:this.currentTarget}),this.applyDelay("showDelay",(function(){e.setState({visible:!0,position:e.getPosition(e.currentTarget)},(function(){n(),e.sendCallback(e.props.onShow,{originalEvent:t,target:e.currentTarget})})),e.bindDocumentResizeListener(),e.bindScrollListener(),i.addClass(e.currentTarget,e.getTargetOption(e.currentTarget,"classname"))})))}}},{key:"hide",value:function(t){var e=this;this.clearTimeouts(),this.state.visible&&(i.removeClass(this.currentTarget,this.getTargetOption(this.currentTarget,"classname")),this.sendCallback(this.props.onBeforeHide,{originalEvent:t,target:this.currentTarget}),this.applyDelay("hideDelay",(function(){o.clear(e.containerEl),i.removeClass(e.containerEl,"p-tooltip-active"),(e.isAutoHide()||!1!==e.allowHide)&&e.setState({visible:!1,position:e.props.position},(function(){e.tooltipTextEl&&n.unmountComponentAtNode(e.tooltipTextEl),e.unbindDocumentResizeListener(),e.unbindScrollListener(),e.currentTarget=null,e.scrollHandler=null,e.containerSize=null,e.allowHide=!0,e.sendCallback(e.props.onHide,{originalEvent:t,target:e.currentTarget})}))})))}},{key:"align",value:function(t,e){var n=this,o=0,r=0;if(this.isMouseTrack(t)&&e){var s={width:i.getOuterWidth(this.containerEl),height:i.getOuterHeight(this.containerEl)};o=e.x,r=e.y;var a=this.getMouseTrackPosition(t),l=a.top,u=a.left;switch(this.state.position){case"left":o-=s.width+u,r-=s.height/2-l;break;case"right":o+=u,r-=s.height/2-l;break;case"top":o-=s.width/2-u,r-=s.height+l;break;case"bottom":o-=s.width/2-u,r+=l}o<=0||this.containerSize.width>s.width?(this.containerEl.style.left="0px",this.containerEl.style.right=window.innerWidth-s.width-o+"px"):(this.containerEl.style.right="",this.containerEl.style.left=o+"px"),this.containerEl.style.top=r+"px",i.addClass(this.containerEl,"p-tooltip-active")}else{var c=i.findCollisionPosition(this.state.position),p=this.getTargetOption(t,"my")||this.props.my||c.my,h=this.getTargetOption(t,"at")||this.props.at||c.at;this.containerEl.style.padding="0px",i.flipfitCollision(this.containerEl,t,p,h,(function(t){var e=t.at,o=e.x,r=n.props.at?"center"!==o&&o!==t.my.x?o:e.y:t.at["".concat(c.axis)];n.containerEl.style.padding="",n.setState({position:r},(function(){n.updateContainerPosition(),i.addClass(n.containerEl,"p-tooltip-active")}))}))}}},{key:"updateContainerPosition",value:function(){if(this.containerEl){var t=getComputedStyle(this.containerEl);"left"===this.state.position?this.containerEl.style.left=parseFloat(t.left)-2*parseFloat(t.paddingLeft)+"px":"top"===this.state.position&&(this.containerEl.style.top=parseFloat(t.top)-2*parseFloat(t.paddingTop)+"px")}}},{key:"onMouseEnter",value:function(){this.isAutoHide()||(this.allowHide=!1)}},{key:"onMouseLeave",value:function(t){this.isAutoHide()||(this.allowHide=!0,this.hide(t))}},{key:"bindDocumentResizeListener",value:function(){var t=this;this.documentResizeListener=function(e){i.isAndroid()||t.hide(e)},window.addEventListener("resize",this.documentResizeListener)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var t=this;this.scrollHandler||(this.scrollHandler=new r(this.currentTarget,(function(e){t.state.visible&&t.hide(e)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindTargetEvent",value:function(t){if(t){var e=this.getEvents(t),n=e.hideEvent;t.addEventListener(e.showEvent,this.show),t.addEventListener(n,this.hide)}}},{key:"unbindTargetEvent",value:function(t){if(t){var e=this.getEvents(t),n=e.hideEvent;t.removeEventListener(e.showEvent,this.show),t.removeEventListener(n,this.hide)}}},{key:"applyDelay",value:function(t,e){this.clearTimeouts();var n=this.getTargetOption(this.currentTarget,t.toLowerCase())||this.props[t];n?this["".concat(t,"Timeout")]=setTimeout((function(){return e()}),n):e()}},{key:"sendCallback",value:function(t){if(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t.apply(void 0,n)}}},{key:"clearTimeouts",value:function(){clearTimeout(this.showDelayTimeout),clearTimeout(this.updateDelayTimeout),clearTimeout(this.hideDelayTimeout)}},{key:"updateTargetEvents",value:function(t){this.unloadTargetEvents(t),this.loadTargetEvents(t)}},{key:"loadTargetEvents",value:function(t){this.setTargetEventOperations(t||this.props.target,"bindTargetEvent")}},{key:"unloadTargetEvents",value:function(t){this.setTargetEventOperations(t||this.props.target,"unbindTargetEvent")}},{key:"setTargetEventOperations",value:function(t,e){var n=this;if(t)if(i.isElement(t))this[e](t);else{var o=function(t){i.find(document,t).forEach((function(t){n[e](t)}))};t instanceof Array?t.forEach((function(t){o(t)})):o(t)}}},{key:"componentDidMount",value:function(){this.props.target&&this.loadTargetEvents()}},{key:"componentDidUpdate",value:function(t,e){var n=this;t.target!==this.props.target&&(this.unloadTargetEvents(t.target),this.loadTargetEvents()),this.state.visible&&(t.content!==this.props.content&&this.applyDelay("updateDelay",(function(){n.updateText(n.currentTarget,(function(){n.align(n.currentTarget)}))})),this.currentTarget&&this.isDisabled(this.currentTarget)&&this.hide())}},{key:"componentWillUnmount",value:function(){this.clearTimeouts(),this.unbindDocumentResizeListener(),this.unloadTargetEvents(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),o.clear(this.containerEl)}},{key:"renderElement",value:function(){var e=this,n=s("p-tooltip p-component",g({},"p-tooltip-".concat(this.state.position),!0),this.props.className),i=this.isTargetContentEmpty(this.currentTarget);return t.createElement("div",{id:this.props.id,ref:function(t){return e.containerEl=t},className:n,style:this.props.style,role:"tooltip","aria-hidden":this.state.visible,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},t.createElement("div",{className:"p-tooltip-arrow"}),t.createElement("div",{ref:function(t){return e.tooltipTextEl=t},className:"p-tooltip-text"},i&&this.props.children))}},{key:"render",value:function(){if(this.state.visible){var e=this.renderElement();return t.createElement(a,{element:e,appendTo:this.props.appendTo,visible:!0})}return null}}])&&u(m.prototype,E),b&&u(m,b),w}();g(b,"defaultProps",{id:null,target:null,content:null,disabled:!1,className:null,style:null,appendTo:null,position:"right",my:null,at:null,event:null,showEvent:"mouseenter",hideEvent:"mouseleave",autoZIndex:!0,baseZIndex:0,mouseTrack:!1,mouseTrackTop:5,mouseTrackLeft:5,showDelay:0,updateDelay:0,hideDelay:0,autoHide:!0,onBeforeShow:null,onBeforeHide:null,onShow:null,onHide:null});export{b as Tooltip,E as tip};
|
|
1
|
+
import t,{Component as e}from"react";import n from"react-dom";import{DomHandler as i,ZIndexUtils as o,ConnectedOverlayScrollHandler as r,classNames as s}from"primereact/utils";import{Portal as a}from"primereact/portal";import l from"primereact/api";function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function v(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return p(t)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(){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(t){return!1}}function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(e){var o=e.appendTo||document.body,r=document.createDocumentFragment();i.appendChild(r,o),e=b(b({},e),e.options);var s=t.createElement(w,e);n.render(s,r);var a=function(i){e=b(b({},e),i),n.render(t.cloneElement(s,e),r)};return{destroy:function(){n.unmountComponentAtNode(r)},updateContent:function(t){console.warn("The 'updateContent' method has been deprecated on Tooltip. Use update(newProps) method."),a({content:t})},update:function(t){a(t)}}}var w=function(h){d(k,e);var f,T,b,E,w,O=(f=k,T=m(),function(){var t,e=g(f);if(T){var n=g(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return v(this,t)});function k(t){var e;return u(this,k),(e=O.call(this,t)).state={visible:!1,position:e.props.position},e.show=e.show.bind(p(e)),e.hide=e.hide.bind(p(e)),e.onMouseEnter=e.onMouseEnter.bind(p(e)),e.onMouseLeave=e.onMouseLeave.bind(p(e)),e}return b=k,E=[{key:"isTargetContentEmpty",value:function(t){return!(this.props.content||this.getTargetOption(t,"tooltip"))}},{key:"isContentEmpty",value:function(t){return!(this.props.content||this.getTargetOption(t,"tooltip")||this.props.children)}},{key:"isMouseTrack",value:function(t){return this.getTargetOption(t,"mousetrack")||this.props.mouseTrack}},{key:"isDisabled",value:function(t){return"true"===this.getTargetOption(t,"disabled")||this.hasTargetOption(t,"disabled")||this.props.disabled}},{key:"isShowOnDisabled",value:function(t){return this.getTargetOption(t,"showondisabled")||this.props.showOnDisabled}},{key:"isAutoHide",value:function(){return this.getTargetOption(this.currentTarget,"autohide")||this.props.autoHide}},{key:"getTargetOption",value:function(t,e){return this.hasTargetOption(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null}},{key:"hasTargetOption",value:function(t,e){return t&&t.hasAttribute(e)}},{key:"getEvents",value:function(t){var e=this.getTargetOption(t,"showevent")||this.props.showEvent,n=this.getTargetOption(t,"hideevent")||this.props.hideEvent;return this.isMouseTrack(t)?(e="mousemove",n="mouseleave"):"focus"===(this.getTargetOption(t,"event")||this.props.event)&&(e="focus",n="blur"),{showEvent:e,hideEvent:n}}},{key:"getPosition",value:function(t){return this.getTargetOption(t,"position")||this.state.position}},{key:"getMouseTrackPosition",value:function(t){return{top:this.getTargetOption(t,"mousetracktop")||this.props.mouseTrackTop,left:this.getTargetOption(t,"mousetrackleft")||this.props.mouseTrackLeft}}},{key:"updateText",value:function(t,e){if(this.tooltipTextEl){var n=this.getTargetOption(t,"tooltip")||this.props.content;n?(this.tooltipTextEl.innerHTML="",this.tooltipTextEl.appendChild(document.createTextNode(n)),e()):this.props.children&&e()}}},{key:"show",value:function(t){var e=this;this.currentTarget=t.currentTarget;var n=this.isDisabled(this.currentTarget);if(!this.isContentEmpty(this.isShowOnDisabled(this.currentTarget)&&n?this.currentTarget.firstChild:this.currentTarget)&&!n){var r=function(){e.updateText(e.currentTarget,(function(){e.props.autoZIndex&&!o.get(e.containerEl)&&o.set("tooltip",e.containerEl,l.autoZIndex,e.props.baseZIndex||l.zIndex.tooltip),e.containerEl.style.left="",e.containerEl.style.top="",e.isMouseTrack(e.currentTarget)&&!e.containerSize&&(e.containerSize={width:i.getOuterWidth(e.containerEl),height:i.getOuterHeight(e.containerEl)}),e.align(e.currentTarget,{x:t.pageX,y:t.pageY})}))};this.state.visible?this.applyDelay("updateDelay",r):(this.sendCallback(this.props.onBeforeShow,{originalEvent:t,target:this.currentTarget}),this.applyDelay("showDelay",(function(){e.setState({visible:!0,position:e.getPosition(e.currentTarget)},(function(){r(),e.sendCallback(e.props.onShow,{originalEvent:t,target:e.currentTarget})})),e.bindDocumentResizeListener(),e.bindScrollListener(),i.addClass(e.currentTarget,e.getTargetOption(e.currentTarget,"classname"))})))}}},{key:"hide",value:function(t){var e=this;this.clearTimeouts(),this.state.visible&&(i.removeClass(this.currentTarget,this.getTargetOption(this.currentTarget,"classname")),this.sendCallback(this.props.onBeforeHide,{originalEvent:t,target:this.currentTarget}),this.applyDelay("hideDelay",(function(){o.clear(e.containerEl),i.removeClass(e.containerEl,"p-tooltip-active"),(e.isAutoHide()||!1!==e.allowHide)&&e.setState({visible:!1,position:e.props.position},(function(){e.tooltipTextEl&&n.unmountComponentAtNode(e.tooltipTextEl),e.unbindDocumentResizeListener(),e.unbindScrollListener(),e.currentTarget=null,e.scrollHandler=null,e.containerSize=null,e.allowHide=!0,e.sendCallback(e.props.onHide,{originalEvent:t,target:e.currentTarget})}))})))}},{key:"align",value:function(t,e){var n=this,o=0,r=0;if(this.isMouseTrack(t)&&e){var s={width:i.getOuterWidth(this.containerEl),height:i.getOuterHeight(this.containerEl)};o=e.x,r=e.y;var a=this.getMouseTrackPosition(t),l=a.top,u=a.left;switch(this.state.position){case"left":o-=s.width+u,r-=s.height/2-l;break;case"right":o+=u,r-=s.height/2-l;break;case"top":o-=s.width/2-u,r-=s.height+l;break;case"bottom":o-=s.width/2-u,r+=l}o<=0||this.containerSize.width>s.width?(this.containerEl.style.left="0px",this.containerEl.style.right=window.innerWidth-s.width-o+"px"):(this.containerEl.style.right="",this.containerEl.style.left=o+"px"),this.containerEl.style.top=r+"px",i.addClass(this.containerEl,"p-tooltip-active")}else{var c=i.findCollisionPosition(this.state.position),p=this.getTargetOption(t,"my")||this.props.my||c.my,h=this.getTargetOption(t,"at")||this.props.at||c.at;this.containerEl.style.padding="0px",i.flipfitCollision(this.containerEl,t,p,h,(function(t){var e=t.at,o=e.x,r=n.props.at?"center"!==o&&o!==t.my.x?o:e.y:t.at["".concat(c.axis)];n.containerEl.style.padding="",n.setState({position:r},(function(){n.updateContainerPosition(),i.addClass(n.containerEl,"p-tooltip-active")}))}))}}},{key:"updateContainerPosition",value:function(){if(this.containerEl){var t=getComputedStyle(this.containerEl);"left"===this.state.position?this.containerEl.style.left=parseFloat(t.left)-2*parseFloat(t.paddingLeft)+"px":"top"===this.state.position&&(this.containerEl.style.top=parseFloat(t.top)-2*parseFloat(t.paddingTop)+"px")}}},{key:"onMouseEnter",value:function(){this.isAutoHide()||(this.allowHide=!1)}},{key:"onMouseLeave",value:function(t){this.isAutoHide()||(this.allowHide=!0,this.hide(t))}},{key:"bindDocumentResizeListener",value:function(){var t=this;this.documentResizeListener=function(e){i.isTouchDevice()||t.hide(e)},window.addEventListener("resize",this.documentResizeListener)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var t=this;this.scrollHandler||(this.scrollHandler=new r(this.currentTarget,(function(e){t.state.visible&&t.hide(e)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindTargetEvent",value:function(t){if(t){var e=this.getEvents(t),n=e.showEvent,i=e.hideEvent,o=this.getTarget(t);o.addEventListener(n,this.show),o.addEventListener(i,this.hide)}}},{key:"unbindTargetEvent",value:function(t){if(t){var e=this.getEvents(t),n=e.showEvent,i=e.hideEvent,o=this.getTarget(t);o.removeEventListener(n,this.show),o.removeEventListener(i,this.hide)}}},{key:"applyDelay",value:function(t,e){this.clearTimeouts();var n=this.getTargetOption(this.currentTarget,t.toLowerCase())||this.props[t];n?this["".concat(t,"Timeout")]=setTimeout((function(){return e()}),n):e()}},{key:"sendCallback",value:function(t){if(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t.apply(void 0,n)}}},{key:"clearTimeouts",value:function(){clearTimeout(this.showDelayTimeout),clearTimeout(this.updateDelayTimeout),clearTimeout(this.hideDelayTimeout)}},{key:"getTarget",value:function(t){if(t){if(this.isShowOnDisabled(t)){var e=document.createElement("span");return t.parentNode.insertBefore(e,t),e.appendChild(t),e}return t}return null}},{key:"updateTargetEvents",value:function(t){this.unloadTargetEvents(t),this.loadTargetEvents(t)}},{key:"loadTargetEvents",value:function(t){this.setTargetEventOperations(t||this.props.target,"bindTargetEvent")}},{key:"unloadTargetEvents",value:function(t){this.setTargetEventOperations(t||this.props.target,"unbindTargetEvent")}},{key:"setTargetEventOperations",value:function(t,e){var n=this;if(t)if(i.isElement(t))this[e](t);else{var o=function(t){i.find(document,t).forEach((function(t){n[e](t)}))};t instanceof Array?t.forEach((function(t){o(t)})):o(t)}}},{key:"componentDidMount",value:function(){this.props.target&&this.loadTargetEvents()}},{key:"componentDidUpdate",value:function(t,e){var n=this;t.target!==this.props.target&&(this.unloadTargetEvents(t.target),this.loadTargetEvents()),this.state.visible&&(t.content!==this.props.content&&this.applyDelay("updateDelay",(function(){n.updateText(n.currentTarget,(function(){n.align(n.currentTarget)}))})),this.currentTarget&&this.isDisabled(this.currentTarget)&&this.hide())}},{key:"componentWillUnmount",value:function(){this.clearTimeouts(),this.unbindDocumentResizeListener(),this.unloadTargetEvents(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),o.clear(this.containerEl)}},{key:"renderElement",value:function(){var e=this,n=s("p-tooltip p-component",y({},"p-tooltip-".concat(this.state.position),!0),this.props.className),i=this.isTargetContentEmpty(this.currentTarget);return t.createElement("div",{id:this.props.id,ref:function(t){return e.containerEl=t},className:n,style:this.props.style,role:"tooltip","aria-hidden":this.state.visible,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},t.createElement("div",{className:"p-tooltip-arrow"}),t.createElement("div",{ref:function(t){return e.tooltipTextEl=t},className:"p-tooltip-text"},i&&this.props.children))}},{key:"render",value:function(){if(this.state.visible){var e=this.renderElement();return t.createElement(a,{element:e,appendTo:this.props.appendTo,visible:!0})}return null}}],E&&c(b.prototype,E),w&&c(b,w),k}();y(w,"defaultProps",{id:null,target:null,content:null,disabled:!1,className:null,style:null,appendTo:null,position:"right",my:null,at:null,event:null,showEvent:"mouseenter",hideEvent:"mouseleave",autoZIndex:!0,baseZIndex:0,mouseTrack:!1,mouseTrackTop:5,mouseTrackLeft:5,showDelay:0,updateDelay:0,hideDelay:0,autoHide:!0,showOnDisabled:!1,onBeforeShow:null,onBeforeHide:null,onShow:null,onHide:null});export{w as Tooltip,E as tip};
|