primereact 7.0.0-rc.2 → 7.2.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/LICENSE.md +1 -1
- package/README.md +35 -10
- package/accordion/accordion.cjs.js +55 -42
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +7 -3
- package/accordion/accordion.esm.js +42 -29
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +55 -43
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +109 -52
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +96 -61
- package/api/api.esm.js +96 -39
- package/api/api.esm.min.js +1 -1
- package/api/api.js +110 -53
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +97 -89
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +11 -4
- package/autocomplete/autocomplete.esm.js +34 -26
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +93 -90
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +21 -20
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +2 -1
- package/avatar/avatar.esm.js +16 -15
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +22 -21
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +14 -14
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +12 -12
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +15 -15
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +14 -14
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +12 -12
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +15 -15
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +38 -27
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +28 -18
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +37 -28
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +27 -27
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +12 -12
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +28 -28
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +44 -55
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +4 -11
- package/button/button.esm.js +33 -44
- package/button/button.esm.min.js +1 -1
- package/button/button.js +43 -56
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +209 -170
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +7 -2
- package/calendar/calendar.esm.js +84 -45
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +205 -171
- package/calendar/calendar.min.css +1 -1
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +12 -12
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.js +11 -11
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +13 -13
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +24 -24
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +12 -12
- package/card/card.esm.min.js +1 -1
- package/card/card.js +25 -25
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +60 -58
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +24 -23
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +59 -59
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +65 -61
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +21 -17
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +62 -62
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +19 -21
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +14 -14
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +18 -18
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +33 -28
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +2 -1
- package/checkbox/checkbox.esm.js +26 -21
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +33 -29
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +27 -25
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +3 -4
- package/chip/chip.esm.js +22 -20
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +28 -26
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +59 -33
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +10 -0
- package/chips/chips.esm.js +50 -24
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +59 -34
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +50 -46
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +20 -6
- package/colorpicker/colorpicker.esm.js +22 -18
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +47 -47
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.js +31 -12
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +28 -2
- package/column/column.esm.js +31 -12
- package/column/column.esm.min.js +1 -1
- package/column/column.js +32 -13
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.js +28 -12
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.js +28 -12
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +29 -13
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +35 -33
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +4 -3
- package/confirmdialog/confirmdialog.esm.js +19 -17
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +35 -34
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +60 -55
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +6 -4
- package/confirmpopup/confirmpopup.esm.js +26 -22
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +57 -55
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +81 -76
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +48 -44
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +78 -77
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +11284 -852
- package/core/core.min.js +40 -1
- package/csstransition/csstransition.cjs.js +62 -32
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.d.ts +8 -0
- package/csstransition/csstransition.esm.js +61 -32
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +62 -34
- package/csstransition/csstransition.min.js +1 -1
- package/csstransition/package.json +2 -1
- package/datascroller/datascroller.cjs.js +23 -22
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +15 -14
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +23 -23
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +838 -632
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +38 -14
- package/datatable/datatable.esm.js +575 -369
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +835 -633
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +43 -40
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +17 -14
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +42 -41
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +12 -12
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +11 -11
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +13 -13
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +78 -73
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +3 -1
- package/dialog/dialog.esm.js +31 -27
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +75 -74
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +15 -15
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +12 -12
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +16 -16
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +62 -28
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +13 -0
- package/dock/dock.esm.js +50 -16
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +62 -29
- package/dock/dock.min.css +1 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +120 -98
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +58 -36
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +116 -99
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +58 -56
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +22 -18
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +57 -53
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +31 -29
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fieldset/fieldset.esm.js +17 -15
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +30 -30
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +79 -69
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +4 -1
- package/fileupload/fileupload.esm.js +40 -30
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +79 -70
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +17 -19
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +12 -12
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +16 -16
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +85 -81
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +21 -18
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +82 -82
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +13 -13
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.js +12 -12
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +14 -14
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +69 -44
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +6 -5
- package/image/image.esm.js +44 -20
- package/image/image.esm.min.js +1 -1
- package/image/image.js +67 -45
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +19 -19
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +12 -12
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +20 -20
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +24 -23
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +17 -16
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +24 -24
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +90 -63
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +73 -46
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +89 -64
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +28 -25
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +21 -18
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +28 -26
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +25 -23
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +1 -1
- package/inputtext/inputtext.esm.js +16 -14
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +24 -24
- package/inputtext/inputtext.min.css +1 -1
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +23 -22
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +1 -1
- package/inputtextarea/inputtextarea.esm.js +15 -14
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +23 -23
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +9 -6
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +5 -2
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +10 -7
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +18 -18
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +12 -12
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +19 -19
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +52 -50
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +17 -15
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +51 -51
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +47 -46
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +13 -12
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +47 -47
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +69 -62
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -1
- package/mention/mention.esm.js +25 -19
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +64 -63
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +45 -40
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +4 -1
- package/menu/menu.esm.js +19 -15
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +42 -41
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +49 -46
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +15 -13
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +48 -47
- package/menubar/menubar.min.css +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +20 -19
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +3 -1
- package/message/message.esm.js +14 -13
- package/message/message.esm.min.js +1 -1
- package/message/message.js +21 -20
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +30 -28
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +2 -1
- package/messages/messages.esm.js +14 -12
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +29 -29
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +148 -136
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -2
- package/multiselect/multiselect.esm.js +64 -52
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +144 -137
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +27 -26
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +15 -14
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +27 -27
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +46 -45
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +13 -12
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +46 -46
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +37 -37
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +12 -12
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +38 -38
- package/organizationchart/organizationchart.min.css +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +45 -42
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +3 -2
- package/overlaypanel/overlaypanel.esm.js +23 -21
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +41 -43
- 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 +61 -60
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +15 -14
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +61 -61
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +35 -32
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +20 -17
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +34 -33
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +53 -52
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/panelmenu/panelmenu.esm.js +15 -14
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +53 -53
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +47 -43
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +3 -2
- package/password/password.esm.js +21 -17
- package/password/password.esm.min.js +1 -1
- package/password/password.js +44 -44
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +69 -65
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +25 -21
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +69 -66
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +17 -20
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +15 -18
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +18 -22
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +3793 -2921
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2567 -1694
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +3792 -2918
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +20 -20
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +12 -12
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +21 -21
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +16 -16
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +12 -12
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +17 -17
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +23 -22
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +15 -14
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +23 -23
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +23 -22
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +17 -16
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +23 -23
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +216 -140
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +94 -42
- package/resources/themes/arya-green/theme.css +94 -42
- package/resources/themes/arya-orange/theme.css +94 -42
- package/resources/themes/arya-purple/theme.css +94 -42
- package/resources/themes/bootstrap4-dark-blue/theme.css +75 -30
- package/resources/themes/bootstrap4-dark-purple/theme.css +75 -30
- package/resources/themes/bootstrap4-light-blue/theme.css +74 -29
- package/resources/themes/bootstrap4-light-purple/theme.css +74 -29
- package/resources/themes/fluent-light/theme.css +94 -42
- 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 +5707 -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 +5707 -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 +5707 -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 +5707 -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 +5707 -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 +5707 -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 +5707 -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 +5707 -0
- package/resources/themes/luna-amber/theme.css +91 -46
- package/resources/themes/luna-blue/theme.css +91 -46
- package/resources/themes/luna-green/theme.css +91 -46
- package/resources/themes/luna-pink/theme.css +91 -46
- package/resources/themes/md-dark-deeppurple/theme.css +265 -53
- package/resources/themes/md-dark-indigo/theme.css +265 -53
- package/resources/themes/md-light-deeppurple/theme.css +265 -53
- package/resources/themes/md-light-indigo/theme.css +265 -53
- package/resources/themes/mdc-dark-deeppurple/theme.css +265 -53
- package/resources/themes/mdc-dark-indigo/theme.css +265 -53
- package/resources/themes/mdc-light-deeppurple/theme.css +265 -53
- package/resources/themes/mdc-light-indigo/theme.css +265 -53
- package/resources/themes/nova/theme.css +91 -46
- package/resources/themes/nova-accent/theme.css +91 -46
- package/resources/themes/nova-alt/theme.css +91 -46
- package/resources/themes/rhea/theme.css +91 -46
- package/resources/themes/saga-blue/theme.css +77 -25
- package/resources/themes/saga-green/theme.css +77 -25
- package/resources/themes/saga-orange/theme.css +77 -25
- package/resources/themes/saga-purple/theme.css +77 -25
- package/resources/themes/tailwind-light/theme.css +101 -49
- package/resources/themes/vela-blue/theme.css +94 -42
- package/resources/themes/vela-green/theme.css +94 -42
- package/resources/themes/vela-orange/theme.css +94 -42
- package/resources/themes/vela-purple/theme.css +94 -42
- package/ripple/ripple.cjs.js +22 -22
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +14 -14
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +23 -23
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +12 -12
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.js +11 -11
- package/row/row.esm.min.js +1 -1
- package/row/row.js +13 -13
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +30 -30
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +12 -12
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +31 -31
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +30 -25
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +4 -2
- package/scrolltop/scrolltop.esm.js +21 -17
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +28 -26
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +31 -29
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +17 -15
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +30 -30
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +3 -1
- package/sidebar/sidebar.cjs.js +154 -127
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +4 -1
- package/sidebar/sidebar.esm.js +145 -119
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +151 -128
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +14 -14
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +12 -12
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +15 -15
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +49 -44
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +19 -15
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +46 -45
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +40 -30
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +32 -22
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +41 -31
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +33 -32
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +3 -2
- package/speeddial/speeddial.esm.js +15 -14
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +33 -33
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +58 -50
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +8 -6
- package/splitbutton/splitbutton.esm.js +28 -20
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +55 -51
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +31 -31
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +14 -14
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +32 -32
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +21 -21
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +12 -12
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +22 -22
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +28 -28
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +12 -12
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +29 -29
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +27 -26
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +13 -12
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +27 -27
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +224 -79
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +12 -1
- package/tabview/tabview.esm.js +194 -49
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +224 -80
- package/tabview/tabview.min.css +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +20 -19
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +2 -1
- package/tag/tag.esm.js +16 -15
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +21 -20
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +23 -23
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +12 -12
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +24 -24
- 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 +54 -48
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +20 -15
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +50 -49
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +23 -23
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +12 -12
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +24 -24
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +72 -55
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +5 -1
- package/toast/toast.esm.js +46 -30
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +69 -56
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +27 -22
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +3 -2
- package/togglebutton/togglebutton.esm.js +21 -16
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +26 -23
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +18 -18
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +12 -12
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +19 -19
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +78 -49
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +49 -21
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +77 -50
- 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 +69 -68
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +14 -3
- package/tree/tree.esm.js +19 -18
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +69 -69
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +4 -1
- package/treeselect/treeselect.cjs.js +66 -62
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +11 -3
- package/treeselect/treeselect.esm.js +26 -22
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +63 -63
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +1393 -330
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +11 -3
- package/treetable/treetable.esm.js +1303 -240
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +1392 -331
- package/treetable/treetable.min.css +1 -1
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +24 -23
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +15 -14
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +24 -24
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +174 -51
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +18 -0
- package/utils/utils.esm.js +173 -51
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +175 -52
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +79 -53
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +64 -38
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +80 -54
- package/virtualscroller/virtualscroller.min.css +1 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +45 -8
- 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.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)) {
|
|
@@ -21,6 +23,9 @@ function _defineProperties(target, props) {
|
|
|
21
23
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
22
24
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
23
25
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
26
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
27
|
+
writable: false
|
|
28
|
+
});
|
|
24
29
|
return Constructor;
|
|
25
30
|
}
|
|
26
31
|
|
|
@@ -53,23 +58,20 @@ function _inherits(subClass, superClass) {
|
|
|
53
58
|
configurable: true
|
|
54
59
|
}
|
|
55
60
|
});
|
|
61
|
+
Object.defineProperty(subClass, "prototype", {
|
|
62
|
+
writable: false
|
|
63
|
+
});
|
|
56
64
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
function _typeof(obj) {
|
|
60
68
|
"@babel/helpers - typeof";
|
|
61
69
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
_typeof = function _typeof(obj) {
|
|
68
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return _typeof(obj);
|
|
70
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
71
|
+
return typeof obj;
|
|
72
|
+
} : function (obj) {
|
|
73
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
74
|
+
}, _typeof(obj);
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -108,9 +110,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
108
110
|
|
|
109
111
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
110
112
|
|
|
111
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
113
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
112
114
|
|
|
113
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
115
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
114
116
|
function tip(props) {
|
|
115
117
|
var appendTo = props.appendTo || document.body;
|
|
116
118
|
var tooltipWrapper = document.createDocumentFragment();
|
|
@@ -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}}),Object.defineProperty(t,"prototype",{writable:!1}),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),Object.defineProperty(b,"prototype",{writable:!1}),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};
|
package/tooltip/tooltip.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
this.primereact = this.primereact || {};
|
|
2
|
-
this.primereact.tooltip = (function (exports, React, ReactDOM,
|
|
2
|
+
this.primereact.tooltip = (function (exports, React, ReactDOM, utils, portal, PrimeReact) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
6
|
|
|
7
7
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
8
8
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
9
|
+
var PrimeReact__default = /*#__PURE__*/_interopDefaultLegacy(PrimeReact);
|
|
9
10
|
|
|
10
11
|
function _classCallCheck(instance, Constructor) {
|
|
11
12
|
if (!(instance instanceof Constructor)) {
|
|
@@ -26,6 +27,9 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
26
27
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
27
28
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
28
29
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
30
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
31
|
+
writable: false
|
|
32
|
+
});
|
|
29
33
|
return Constructor;
|
|
30
34
|
}
|
|
31
35
|
|
|
@@ -58,23 +62,20 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
58
62
|
configurable: true
|
|
59
63
|
}
|
|
60
64
|
});
|
|
65
|
+
Object.defineProperty(subClass, "prototype", {
|
|
66
|
+
writable: false
|
|
67
|
+
});
|
|
61
68
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
function _typeof(obj) {
|
|
65
72
|
"@babel/helpers - typeof";
|
|
66
73
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
_typeof = function _typeof(obj) {
|
|
73
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return _typeof(obj);
|
|
74
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
75
|
+
return typeof obj;
|
|
76
|
+
} : function (obj) {
|
|
77
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
78
|
+
}, _typeof(obj);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -113,25 +114,25 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
113
114
|
|
|
114
115
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
115
116
|
|
|
116
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
117
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
117
118
|
|
|
118
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
119
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
119
120
|
function tip(props) {
|
|
120
121
|
var appendTo = props.appendTo || document.body;
|
|
121
122
|
var tooltipWrapper = document.createDocumentFragment();
|
|
122
|
-
|
|
123
|
+
utils.DomHandler.appendChild(tooltipWrapper, appendTo);
|
|
123
124
|
props = _objectSpread(_objectSpread({}, props), props.options);
|
|
124
|
-
var tooltipEl = /*#__PURE__*/React__default[
|
|
125
|
-
ReactDOM__default[
|
|
125
|
+
var tooltipEl = /*#__PURE__*/React__default["default"].createElement(Tooltip, props);
|
|
126
|
+
ReactDOM__default["default"].render(tooltipEl, tooltipWrapper);
|
|
126
127
|
|
|
127
128
|
var updateTooltip = function updateTooltip(newProps) {
|
|
128
129
|
props = _objectSpread(_objectSpread({}, props), newProps);
|
|
129
|
-
ReactDOM__default[
|
|
130
|
+
ReactDOM__default["default"].render( /*#__PURE__*/React__default["default"].cloneElement(tooltipEl, props), tooltipWrapper);
|
|
130
131
|
};
|
|
131
132
|
|
|
132
133
|
return {
|
|
133
134
|
destroy: function destroy() {
|
|
134
|
-
ReactDOM__default[
|
|
135
|
+
ReactDOM__default["default"].unmountComponentAtNode(tooltipWrapper);
|
|
135
136
|
},
|
|
136
137
|
updateContent: function updateContent(newContent) {
|
|
137
138
|
console.warn("The 'updateContent' method has been deprecated on Tooltip. Use update(newProps) method.");
|
|
@@ -186,6 +187,11 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
186
187
|
value: function isDisabled(target) {
|
|
187
188
|
return this.getTargetOption(target, 'disabled') === 'true' || this.hasTargetOption(target, 'disabled') || this.props.disabled;
|
|
188
189
|
}
|
|
190
|
+
}, {
|
|
191
|
+
key: "isShowOnDisabled",
|
|
192
|
+
value: function isShowOnDisabled(target) {
|
|
193
|
+
return this.getTargetOption(target, 'showondisabled') || this.props.showOnDisabled;
|
|
194
|
+
}
|
|
189
195
|
}, {
|
|
190
196
|
key: "isAutoHide",
|
|
191
197
|
value: function isAutoHide() {
|
|
@@ -265,15 +271,17 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
265
271
|
var _this2 = this;
|
|
266
272
|
|
|
267
273
|
this.currentTarget = e.currentTarget;
|
|
274
|
+
var disabled = this.isDisabled(this.currentTarget);
|
|
275
|
+
var empty = this.isContentEmpty(this.isShowOnDisabled(this.currentTarget) && disabled ? this.currentTarget.firstChild : this.currentTarget);
|
|
268
276
|
|
|
269
|
-
if (
|
|
277
|
+
if (empty || disabled) {
|
|
270
278
|
return;
|
|
271
279
|
}
|
|
272
280
|
|
|
273
281
|
var updateTooltipState = function updateTooltipState() {
|
|
274
282
|
_this2.updateText(_this2.currentTarget, function () {
|
|
275
|
-
if (_this2.props.autoZIndex && !
|
|
276
|
-
|
|
283
|
+
if (_this2.props.autoZIndex && !utils.ZIndexUtils.get(_this2.containerEl)) {
|
|
284
|
+
utils.ZIndexUtils.set('tooltip', _this2.containerEl, PrimeReact__default["default"].autoZIndex, _this2.props.baseZIndex || PrimeReact__default["default"].zIndex['tooltip']);
|
|
277
285
|
}
|
|
278
286
|
|
|
279
287
|
_this2.containerEl.style.left = '';
|
|
@@ -281,8 +289,8 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
281
289
|
|
|
282
290
|
if (_this2.isMouseTrack(_this2.currentTarget) && !_this2.containerSize) {
|
|
283
291
|
_this2.containerSize = {
|
|
284
|
-
width:
|
|
285
|
-
height:
|
|
292
|
+
width: utils.DomHandler.getOuterWidth(_this2.containerEl),
|
|
293
|
+
height: utils.DomHandler.getOuterHeight(_this2.containerEl)
|
|
286
294
|
};
|
|
287
295
|
}
|
|
288
296
|
|
|
@@ -317,7 +325,7 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
317
325
|
|
|
318
326
|
_this2.bindScrollListener();
|
|
319
327
|
|
|
320
|
-
|
|
328
|
+
utils.DomHandler.addClass(_this2.currentTarget, _this2.getTargetOption(_this2.currentTarget, 'classname'));
|
|
321
329
|
});
|
|
322
330
|
}
|
|
323
331
|
}
|
|
@@ -329,14 +337,14 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
329
337
|
this.clearTimeouts();
|
|
330
338
|
|
|
331
339
|
if (this.state.visible) {
|
|
332
|
-
|
|
340
|
+
utils.DomHandler.removeClass(this.currentTarget, this.getTargetOption(this.currentTarget, 'classname'));
|
|
333
341
|
this.sendCallback(this.props.onBeforeHide, {
|
|
334
342
|
originalEvent: e,
|
|
335
343
|
target: this.currentTarget
|
|
336
344
|
});
|
|
337
345
|
this.applyDelay('hideDelay', function () {
|
|
338
|
-
|
|
339
|
-
|
|
346
|
+
utils.ZIndexUtils.clear(_this3.containerEl);
|
|
347
|
+
utils.DomHandler.removeClass(_this3.containerEl, 'p-tooltip-active');
|
|
340
348
|
|
|
341
349
|
if (!_this3.isAutoHide() && _this3.allowHide === false) {
|
|
342
350
|
return;
|
|
@@ -347,7 +355,7 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
347
355
|
position: _this3.props.position
|
|
348
356
|
}, function () {
|
|
349
357
|
if (_this3.tooltipTextEl) {
|
|
350
|
-
ReactDOM__default[
|
|
358
|
+
ReactDOM__default["default"].unmountComponentAtNode(_this3.tooltipTextEl);
|
|
351
359
|
}
|
|
352
360
|
|
|
353
361
|
_this3.unbindDocumentResizeListener();
|
|
@@ -377,8 +385,8 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
377
385
|
|
|
378
386
|
if (this.isMouseTrack(target) && coordinate) {
|
|
379
387
|
var containerSize = {
|
|
380
|
-
width:
|
|
381
|
-
height:
|
|
388
|
+
width: utils.DomHandler.getOuterWidth(this.containerEl),
|
|
389
|
+
height: utils.DomHandler.getOuterHeight(this.containerEl)
|
|
382
390
|
};
|
|
383
391
|
left = coordinate.x;
|
|
384
392
|
top = coordinate.y;
|
|
@@ -418,13 +426,13 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
418
426
|
}
|
|
419
427
|
|
|
420
428
|
this.containerEl.style.top = top + 'px';
|
|
421
|
-
|
|
429
|
+
utils.DomHandler.addClass(this.containerEl, 'p-tooltip-active');
|
|
422
430
|
} else {
|
|
423
|
-
var pos =
|
|
431
|
+
var pos = utils.DomHandler.findCollisionPosition(this.state.position);
|
|
424
432
|
var my = this.getTargetOption(target, 'my') || this.props.my || pos.my;
|
|
425
433
|
var at = this.getTargetOption(target, 'at') || this.props.at || pos.at;
|
|
426
434
|
this.containerEl.style.padding = '0px';
|
|
427
|
-
|
|
435
|
+
utils.DomHandler.flipfitCollision(this.containerEl, target, my, at, function (currentPosition) {
|
|
428
436
|
var _currentPosition$at = currentPosition.at,
|
|
429
437
|
atX = _currentPosition$at.x,
|
|
430
438
|
atY = _currentPosition$at.y;
|
|
@@ -437,7 +445,7 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
437
445
|
}, function () {
|
|
438
446
|
_this4.updateContainerPosition();
|
|
439
447
|
|
|
440
|
-
|
|
448
|
+
utils.DomHandler.addClass(_this4.containerEl, 'p-tooltip-active');
|
|
441
449
|
});
|
|
442
450
|
});
|
|
443
451
|
}
|
|
@@ -471,7 +479,7 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
471
479
|
var _this5 = this;
|
|
472
480
|
|
|
473
481
|
this.documentResizeListener = function (e) {
|
|
474
|
-
if (!
|
|
482
|
+
if (!utils.DomHandler.isTouchDevice()) {
|
|
475
483
|
_this5.hide(e);
|
|
476
484
|
}
|
|
477
485
|
};
|
|
@@ -492,7 +500,7 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
492
500
|
var _this6 = this;
|
|
493
501
|
|
|
494
502
|
if (!this.scrollHandler) {
|
|
495
|
-
this.scrollHandler = new
|
|
503
|
+
this.scrollHandler = new utils.ConnectedOverlayScrollHandler(this.currentTarget, function (e) {
|
|
496
504
|
if (_this6.state.visible) {
|
|
497
505
|
_this6.hide(e);
|
|
498
506
|
}
|
|
@@ -516,8 +524,9 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
516
524
|
showEvent = _this$getEvents.showEvent,
|
|
517
525
|
hideEvent = _this$getEvents.hideEvent;
|
|
518
526
|
|
|
519
|
-
|
|
520
|
-
|
|
527
|
+
var currentTarget = this.getTarget(target);
|
|
528
|
+
currentTarget.addEventListener(showEvent, this.show);
|
|
529
|
+
currentTarget.addEventListener(hideEvent, this.hide);
|
|
521
530
|
}
|
|
522
531
|
}
|
|
523
532
|
}, {
|
|
@@ -528,8 +537,9 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
528
537
|
showEvent = _this$getEvents2.showEvent,
|
|
529
538
|
hideEvent = _this$getEvents2.hideEvent;
|
|
530
539
|
|
|
531
|
-
|
|
532
|
-
|
|
540
|
+
var currentTarget = this.getTarget(target);
|
|
541
|
+
currentTarget.removeEventListener(showEvent, this.show);
|
|
542
|
+
currentTarget.removeEventListener(hideEvent, this.hide);
|
|
533
543
|
}
|
|
534
544
|
}
|
|
535
545
|
}, {
|
|
@@ -564,6 +574,22 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
564
574
|
clearTimeout(this.updateDelayTimeout);
|
|
565
575
|
clearTimeout(this.hideDelayTimeout);
|
|
566
576
|
}
|
|
577
|
+
}, {
|
|
578
|
+
key: "getTarget",
|
|
579
|
+
value: function getTarget(target) {
|
|
580
|
+
if (target) {
|
|
581
|
+
if (this.isShowOnDisabled(target)) {
|
|
582
|
+
var wrapper = document.createElement('span');
|
|
583
|
+
target.parentNode.insertBefore(wrapper, target);
|
|
584
|
+
wrapper.appendChild(target);
|
|
585
|
+
return wrapper;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return target;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
return null;
|
|
592
|
+
}
|
|
567
593
|
}, {
|
|
568
594
|
key: "updateTargetEvents",
|
|
569
595
|
value: function updateTargetEvents(target) {
|
|
@@ -586,11 +612,11 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
586
612
|
var _this7 = this;
|
|
587
613
|
|
|
588
614
|
if (target) {
|
|
589
|
-
if (
|
|
615
|
+
if (utils.DomHandler.isElement(target)) {
|
|
590
616
|
this[operation](target);
|
|
591
617
|
} else {
|
|
592
618
|
var setEvent = function setEvent(target) {
|
|
593
|
-
var element =
|
|
619
|
+
var element = utils.DomHandler.find(document, target);
|
|
594
620
|
element.forEach(function (el) {
|
|
595
621
|
_this7[operation](el);
|
|
596
622
|
});
|
|
@@ -649,16 +675,16 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
649
675
|
this.scrollHandler = null;
|
|
650
676
|
}
|
|
651
677
|
|
|
652
|
-
|
|
678
|
+
utils.ZIndexUtils.clear(this.containerEl);
|
|
653
679
|
}
|
|
654
680
|
}, {
|
|
655
681
|
key: "renderElement",
|
|
656
682
|
value: function renderElement() {
|
|
657
683
|
var _this9 = this;
|
|
658
684
|
|
|
659
|
-
var tooltipClassName =
|
|
685
|
+
var tooltipClassName = utils.classNames('p-tooltip p-component', _defineProperty({}, "p-tooltip-".concat(this.state.position), true), this.props.className);
|
|
660
686
|
var isTargetContentEmpty = this.isTargetContentEmpty(this.currentTarget);
|
|
661
|
-
return /*#__PURE__*/React__default[
|
|
687
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
662
688
|
id: this.props.id,
|
|
663
689
|
ref: function ref(el) {
|
|
664
690
|
return _this9.containerEl = el;
|
|
@@ -669,9 +695,9 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
669
695
|
"aria-hidden": this.state.visible,
|
|
670
696
|
onMouseEnter: this.onMouseEnter,
|
|
671
697
|
onMouseLeave: this.onMouseLeave
|
|
672
|
-
}, /*#__PURE__*/React__default[
|
|
698
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
673
699
|
className: "p-tooltip-arrow"
|
|
674
|
-
}), /*#__PURE__*/React__default[
|
|
700
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
675
701
|
ref: function ref(el) {
|
|
676
702
|
return _this9.tooltipTextEl = el;
|
|
677
703
|
},
|
|
@@ -683,7 +709,7 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
683
709
|
value: function render() {
|
|
684
710
|
if (this.state.visible) {
|
|
685
711
|
var element = this.renderElement();
|
|
686
|
-
return /*#__PURE__*/React__default[
|
|
712
|
+
return /*#__PURE__*/React__default["default"].createElement(portal.Portal, {
|
|
687
713
|
element: element,
|
|
688
714
|
appendTo: this.props.appendTo,
|
|
689
715
|
visible: true
|
|
@@ -720,6 +746,7 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
720
746
|
updateDelay: 0,
|
|
721
747
|
hideDelay: 0,
|
|
722
748
|
autoHide: true,
|
|
749
|
+
showOnDisabled: false,
|
|
723
750
|
onBeforeShow: null,
|
|
724
751
|
onBeforeHide: null,
|
|
725
752
|
onShow: null,
|
|
@@ -733,4 +760,4 @@ this.primereact.tooltip = (function (exports, React, ReactDOM, core) {
|
|
|
733
760
|
|
|
734
761
|
return exports;
|
|
735
762
|
|
|
736
|
-
}({}, React, ReactDOM, primereact.
|
|
763
|
+
})({}, React, ReactDOM, primereact.utils, primereact.portal, primereact.api);
|
package/tooltip/tooltip.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.p-tooltip{position:absolute;padding:.25em .5rem
|
|
1
|
+
.p-tooltip{position:absolute;padding:.25em .5rem}.p-tooltip.p-tooltip-right,.p-tooltip.p-tooltip-left{padding:0 .25rem}.p-tooltip.p-tooltip-top,.p-tooltip.p-tooltip-bottom{padding:.25em 0}.p-tooltip .p-tooltip-text{white-space:pre-line;word-break:break-word}.p-tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.p-tooltip-right .p-tooltip-arrow{top:50%;left:0;margin-top:-.25rem;border-width:.25em .25em .25em 0}.p-tooltip-left .p-tooltip-arrow{top:50%;right:0;margin-top:-.25rem;border-width:.25em 0 .25em .25rem}.p-tooltip.p-tooltip-top{padding:.25em 0}.p-tooltip-top .p-tooltip-arrow{bottom:0;left:50%;margin-left:-.25rem;border-width:.25em .25em 0}.p-tooltip-bottom .p-tooltip-arrow{top:0;left:50%;margin-left:-.25rem;border-width:0 .25em .25rem}
|
package/tooltip/tooltip.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.tooltip=function(t,e,n,i){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=o(e),s=o(n);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(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 u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(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&&c(t,e)}function h(t){return(h="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 d(t,e){if(e&&("object"===h(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return u(t)}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g(){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 y(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?y(Object(n),!0).forEach((function(e){v(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var T=function(t){p(m,t);var e,n,o,c,h,y=(e=m,n=g(),function(){var t,i=f(e);if(n){var o=f(this).constructor;t=Reflect.construct(i,arguments,o)}else t=i.apply(this,arguments);return d(this,t)});function m(t){var e;return a(this,m),(e=y.call(this,t)).state={visible:!1,position:e.props.position},e.show=e.show.bind(u(e)),e.hide=e.hide.bind(u(e)),e.onMouseEnter=e.onMouseEnter.bind(u(e)),e.onMouseLeave=e.onMouseLeave.bind(u(e)),e}return o=m,(c=[{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&&!i.ZIndexUtils.get(e.containerEl)&&i.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:i.DomHandler.getOuterWidth(e.containerEl),height:i.DomHandler.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.DomHandler.addClass(e.currentTarget,e.getTargetOption(e.currentTarget,"classname"))})))}}},{key:"hide",value:function(t){var e=this;this.clearTimeouts(),this.state.visible&&(i.DomHandler.removeClass(this.currentTarget,this.getTargetOption(this.currentTarget,"classname")),this.sendCallback(this.props.onBeforeHide,{originalEvent:t,target:this.currentTarget}),this.applyDelay("hideDelay",(function(){i.ZIndexUtils.clear(e.containerEl),i.DomHandler.removeClass(e.containerEl,"p-tooltip-active"),(e.isAutoHide()||!1!==e.allowHide)&&e.setState({visible:!1,position:e.props.position},(function(){e.tooltipTextEl&&s.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 n=this,o=0,r=0;if(this.isMouseTrack(t)&&e){var s={width:i.DomHandler.getOuterWidth(this.containerEl),height:i.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",i.DomHandler.addClass(this.containerEl,"p-tooltip-active")}else{var c=i.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",i.DomHandler.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.DomHandler.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.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 i.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 n=this;if(t)if(i.DomHandler.isElement(t))this[e](t);else{var o=function(t){i.DomHandler.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),i.ZIndexUtils.clear(this.containerEl)}},{key:"renderElement",value:function(){var t=this,e=i.classNames("p-tooltip p-component",v({},"p-tooltip-".concat(this.state.position),!0),this.props.className),n=this.isTargetContentEmpty(this.currentTarget);return r.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},r.default.createElement("div",{className:"p-tooltip-arrow"}),r.default.createElement("div",{ref:function(e){return t.tooltipTextEl=e},className:"p-tooltip-text"},n&&this.props.children))}},{key:"render",value:function(){if(this.state.visible){var t=this.renderElement();return r.default.createElement(i.Portal,{element:t,appendTo:this.props.appendTo,visible:!0})}return null}}])&&l(o.prototype,c),h&&l(o,h),m}(e.Component);return v(T,"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}),t.Tooltip=T,t.tip=function(t){var e=t.appendTo||document.body,n=document.createDocumentFragment();i.DomHandler.appendChild(n,e),t=m(m({},t),t.options);var o=r.default.createElement(T,t);s.default.render(o,n);var a=function(e){t=m(m({},t),e),s.default.render(r.default.cloneElement(o,t),n)};return{destroy:function(){s.default.unmountComponentAtNode(n)},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)}}},Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,ReactDOM,primereact.core);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.tooltip=function(t,e,n,i,o,r){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=s(e),l=s(n),u=s(r);function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(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 h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t,e){return d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},d(t,e)}function f(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function v(t){return v="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},v(t)}function g(t,e){if(e&&("object"===v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T(){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 b(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 E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){m(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var w=function(t){f(b,t);var e,n,r,s,d,v=(e=b,n=T(),function(){var t,i=y(e);if(n){var o=y(this).constructor;t=Reflect.construct(i,arguments,o)}else t=i.apply(this,arguments);return g(this,t)});function b(t){var e;return c(this,b),(e=v.call(this,t)).state={visible:!1,position:e.props.position},e.show=e.show.bind(h(e)),e.hide=e.hide.bind(h(e)),e.onMouseEnter=e.onMouseEnter.bind(h(e)),e.onMouseLeave=e.onMouseLeave.bind(h(e)),e}return r=b,s=[{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 o=function(){e.updateText(e.currentTarget,(function(){e.props.autoZIndex&&!i.ZIndexUtils.get(e.containerEl)&&i.ZIndexUtils.set("tooltip",e.containerEl,u.default.autoZIndex,e.props.baseZIndex||u.default.zIndex.tooltip),e.containerEl.style.left="",e.containerEl.style.top="",e.isMouseTrack(e.currentTarget)&&!e.containerSize&&(e.containerSize={width:i.DomHandler.getOuterWidth(e.containerEl),height:i.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(),i.DomHandler.addClass(e.currentTarget,e.getTargetOption(e.currentTarget,"classname"))})))}}},{key:"hide",value:function(t){var e=this;this.clearTimeouts(),this.state.visible&&(i.DomHandler.removeClass(this.currentTarget,this.getTargetOption(this.currentTarget,"classname")),this.sendCallback(this.props.onBeforeHide,{originalEvent:t,target:this.currentTarget}),this.applyDelay("hideDelay",(function(){i.ZIndexUtils.clear(e.containerEl),i.DomHandler.removeClass(e.containerEl,"p-tooltip-active"),(e.isAutoHide()||!1!==e.allowHide)&&e.setState({visible:!1,position:e.props.position},(function(){e.tooltipTextEl&&l.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 n=this,o=0,r=0;if(this.isMouseTrack(t)&&e){var s={width:i.DomHandler.getOuterWidth(this.containerEl),height:i.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",i.DomHandler.addClass(this.containerEl,"p-tooltip-active")}else{var c=i.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",i.DomHandler.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.DomHandler.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.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 i.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 n=this;if(t)if(i.DomHandler.isElement(t))this[e](t);else{var o=function(t){i.DomHandler.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),i.ZIndexUtils.clear(this.containerEl)}},{key:"renderElement",value:function(){var t=this,e=i.classNames("p-tooltip p-component",m({},"p-tooltip-".concat(this.state.position),!0),this.props.className),n=this.isTargetContentEmpty(this.currentTarget);return a.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},a.default.createElement("div",{className:"p-tooltip-arrow"}),a.default.createElement("div",{ref:function(e){return t.tooltipTextEl=e},className:"p-tooltip-text"},n&&this.props.children))}},{key:"render",value:function(){if(this.state.visible){var t=this.renderElement();return a.default.createElement(o.Portal,{element:t,appendTo:this.props.appendTo,visible:!0})}return null}}],s&&p(r.prototype,s),d&&p(r,d),Object.defineProperty(r,"prototype",{writable:!1}),b}(e.Component);return m(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}),t.Tooltip=w,t.tip=function(t){var e=t.appendTo||document.body,n=document.createDocumentFragment();i.DomHandler.appendChild(n,e),t=E(E({},t),t.options);var o=a.default.createElement(w,t);l.default.render(o,n);var r=function(e){t=E(E({},t),e),l.default.render(a.default.cloneElement(o,t),n)};return{destroy:function(){l.default.unmountComponentAtNode(n)},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)}}},Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,ReactDOM,primereact.utils,primereact.portal,primereact.api);
|