primereact 10.8.3 → 10.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.cjs.js +8 -8
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +8 -8
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +8 -8
- package/accordion/accordion.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +9 -9
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +9 -9
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +9 -9
- package/autocomplete/autocomplete.min.js +1 -1
- package/badge/badge.cjs.js +1 -1
- package/badge/badge.esm.js +1 -1
- package/badge/badge.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.js +1 -1
- package/button/button.cjs.js +2 -2
- package/button/button.esm.js +2 -2
- package/button/button.js +2 -2
- package/buttongroup/buttongroup.cjs.js +1 -1
- package/buttongroup/buttongroup.esm.js +1 -1
- package/buttongroup/buttongroup.js +1 -1
- package/calendar/calendar.cjs.js +10 -8
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +11 -9
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +10 -8
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +1 -1
- package/carousel/carousel.esm.js +1 -1
- package/carousel/carousel.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +10 -10
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +10 -10
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +10 -10
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +1 -1
- package/chart/chart.esm.js +1 -1
- package/chart/chart.js +1 -1
- package/checkbox/checkbox.cjs.js +1 -1
- package/checkbox/checkbox.esm.js +1 -1
- package/checkbox/checkbox.js +1 -1
- package/chip/chip.cjs.js +3 -3
- package/chip/chip.esm.js +3 -3
- package/chip/chip.js +3 -3
- package/chips/chips.cjs.js +1 -1
- package/chips/chips.esm.js +1 -1
- package/chips/chips.js +1 -1
- package/colorpicker/colorpicker.cjs.js +1 -1
- package/colorpicker/colorpicker.esm.js +1 -1
- package/colorpicker/colorpicker.js +1 -1
- package/componentbase/componentbase.cjs.js +14 -14
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +14 -14
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +14 -14
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +1 -1
- package/confirmdialog/confirmdialog.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +4 -5
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +4 -5
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +4 -5
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +5 -2
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +5 -2
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +5 -2
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +140 -136
- package/core/core.min.js +9 -9
- package/csstransition/csstransition.cjs.js +1 -0
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.esm.js +1 -0
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +1 -0
- package/csstransition/csstransition.min.js +1 -1
- package/datascroller/datascroller.cjs.js +1 -1
- package/datascroller/datascroller.esm.js +1 -1
- package/datascroller/datascroller.js +1 -1
- package/datatable/datatable.cjs.js +41 -38
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +41 -38
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +41 -38
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +1 -1
- package/dataview/dataview.esm.js +1 -1
- package/dataview/dataview.js +1 -1
- package/dialog/dialog.cjs.js +3 -3
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +4 -4
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +3 -3
- package/dialog/dialog.min.js +1 -1
- package/dock/dock.cjs.js +1 -1
- package/dock/dock.esm.js +1 -1
- package/dock/dock.js +1 -1
- package/dropdown/dropdown.cjs.js +9 -11
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +9 -11
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +9 -11
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +1 -1
- package/editor/editor.esm.js +1 -1
- package/editor/editor.js +1 -1
- package/fileupload/fileupload.cjs.js +2 -2
- package/fileupload/fileupload.esm.js +2 -2
- package/fileupload/fileupload.js +2 -2
- package/floatlabel/floatlabel.cjs.js +1 -1
- package/floatlabel/floatlabel.esm.js +1 -1
- package/floatlabel/floatlabel.js +1 -1
- package/focustrap/focustrap.cjs.js +1 -1
- package/focustrap/focustrap.esm.js +1 -1
- package/focustrap/focustrap.js +1 -1
- package/galleria/galleria.cjs.js +3 -3
- package/galleria/galleria.esm.js +3 -3
- package/galleria/galleria.js +3 -3
- package/hooks/hooks.cjs.js +0 -3
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +0 -3
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +0 -3
- package/hooks/hooks.min.js +1 -1
- package/iconfield/iconfield.cjs.js +1 -1
- package/iconfield/iconfield.esm.js +1 -1
- package/iconfield/iconfield.js +1 -1
- package/icons/angledoubledown/index.cjs.js +1 -1
- package/icons/angledoubledown/index.esm.js +1 -1
- package/icons/angledoubledown/index.js +1 -1
- package/icons/angledoubleleft/index.cjs.js +1 -1
- package/icons/angledoubleleft/index.esm.js +1 -1
- package/icons/angledoubleleft/index.js +1 -1
- package/icons/angledoubleright/index.cjs.js +1 -1
- package/icons/angledoubleright/index.esm.js +1 -1
- package/icons/angledoubleright/index.js +1 -1
- package/icons/angledoubleup/index.cjs.js +1 -1
- package/icons/angledoubleup/index.esm.js +1 -1
- package/icons/angledoubleup/index.js +1 -1
- package/icons/angledown/index.cjs.js +1 -1
- package/icons/angledown/index.esm.js +1 -1
- package/icons/angledown/index.js +1 -1
- package/icons/angleleft/index.cjs.js +1 -1
- package/icons/angleleft/index.esm.js +1 -1
- package/icons/angleleft/index.js +1 -1
- package/icons/angleright/index.cjs.js +1 -1
- package/icons/angleright/index.esm.js +1 -1
- package/icons/angleright/index.js +1 -1
- package/icons/angleup/index.cjs.js +1 -1
- package/icons/angleup/index.esm.js +1 -1
- package/icons/angleup/index.js +1 -1
- package/icons/arrowdown/index.cjs.js +1 -1
- package/icons/arrowdown/index.esm.js +1 -1
- package/icons/arrowdown/index.js +1 -1
- package/icons/arrowup/index.cjs.js +1 -1
- package/icons/arrowup/index.esm.js +1 -1
- package/icons/arrowup/index.js +1 -1
- package/icons/ban/index.cjs.js +1 -1
- package/icons/ban/index.esm.js +1 -1
- package/icons/ban/index.js +1 -1
- package/icons/bars/index.cjs.js +1 -1
- package/icons/bars/index.esm.js +1 -1
- package/icons/bars/index.js +1 -1
- package/icons/blank/index.cjs.js +1 -1
- package/icons/blank/index.esm.js +1 -1
- package/icons/blank/index.js +1 -1
- package/icons/calendar/index.cjs.js +1 -1
- package/icons/calendar/index.esm.js +1 -1
- package/icons/calendar/index.js +1 -1
- package/icons/check/index.cjs.js +1 -1
- package/icons/check/index.esm.js +1 -1
- package/icons/check/index.js +1 -1
- package/icons/chevrondown/index.cjs.js +1 -1
- package/icons/chevrondown/index.esm.js +1 -1
- package/icons/chevrondown/index.js +1 -1
- package/icons/chevronleft/index.cjs.js +1 -1
- package/icons/chevronleft/index.esm.js +1 -1
- package/icons/chevronleft/index.js +1 -1
- package/icons/chevronright/index.cjs.js +1 -1
- package/icons/chevronright/index.esm.js +1 -1
- package/icons/chevronright/index.js +1 -1
- package/icons/chevronup/index.cjs.js +1 -1
- package/icons/chevronup/index.esm.js +1 -1
- package/icons/chevronup/index.js +1 -1
- package/icons/download/index.cjs.js +1 -1
- package/icons/download/index.esm.js +1 -1
- package/icons/download/index.js +1 -1
- package/icons/exclamationtriangle/index.cjs.js +1 -1
- package/icons/exclamationtriangle/index.esm.js +1 -1
- package/icons/exclamationtriangle/index.js +1 -1
- package/icons/eye/index.cjs.js +1 -1
- package/icons/eye/index.esm.js +1 -1
- package/icons/eye/index.js +1 -1
- package/icons/eyeslash/index.cjs.js +1 -1
- package/icons/eyeslash/index.esm.js +1 -1
- package/icons/eyeslash/index.js +1 -1
- package/icons/filter/index.cjs.js +1 -1
- package/icons/filter/index.esm.js +1 -1
- package/icons/filter/index.js +1 -1
- package/icons/filterslash/index.cjs.js +1 -1
- package/icons/filterslash/index.esm.js +1 -1
- package/icons/filterslash/index.js +1 -1
- package/icons/infocircle/index.cjs.js +1 -1
- package/icons/infocircle/index.esm.js +1 -1
- package/icons/infocircle/index.js +1 -1
- package/icons/minus/index.cjs.js +1 -1
- package/icons/minus/index.esm.js +1 -1
- package/icons/minus/index.js +1 -1
- package/icons/pencil/index.cjs.js +1 -1
- package/icons/pencil/index.esm.js +1 -1
- package/icons/pencil/index.js +1 -1
- package/icons/plus/index.cjs.js +1 -1
- package/icons/plus/index.esm.js +1 -1
- package/icons/plus/index.js +1 -1
- package/icons/refresh/index.cjs.js +1 -1
- package/icons/refresh/index.esm.js +1 -1
- package/icons/refresh/index.js +1 -1
- package/icons/search/index.cjs.js +1 -1
- package/icons/search/index.esm.js +1 -1
- package/icons/search/index.js +1 -1
- package/icons/searchminus/index.cjs.js +1 -1
- package/icons/searchminus/index.esm.js +1 -1
- package/icons/searchminus/index.js +1 -1
- package/icons/searchplus/index.cjs.js +1 -1
- package/icons/searchplus/index.esm.js +1 -1
- package/icons/searchplus/index.js +1 -1
- package/icons/sortalt/index.cjs.js +1 -1
- package/icons/sortalt/index.esm.js +1 -1
- package/icons/sortalt/index.js +1 -1
- package/icons/sortamountdown/index.cjs.js +1 -1
- package/icons/sortamountdown/index.esm.js +1 -1
- package/icons/sortamountdown/index.js +1 -1
- package/icons/sortamountupalt/index.cjs.js +1 -1
- package/icons/sortamountupalt/index.esm.js +1 -1
- package/icons/sortamountupalt/index.js +1 -1
- package/icons/spinner/index.cjs.js +1 -1
- package/icons/spinner/index.esm.js +1 -1
- package/icons/spinner/index.js +1 -1
- package/icons/star/index.cjs.js +1 -1
- package/icons/star/index.esm.js +1 -1
- package/icons/star/index.js +1 -1
- package/icons/starfill/index.cjs.js +1 -1
- package/icons/starfill/index.esm.js +1 -1
- package/icons/starfill/index.js +1 -1
- package/icons/thlarge/index.cjs.js +1 -1
- package/icons/thlarge/index.esm.js +1 -1
- package/icons/thlarge/index.js +1 -1
- package/icons/times/index.cjs.js +1 -1
- package/icons/times/index.esm.js +1 -1
- package/icons/times/index.js +1 -1
- package/icons/timescircle/index.cjs.js +1 -1
- package/icons/timescircle/index.esm.js +1 -1
- package/icons/timescircle/index.js +1 -1
- package/icons/trash/index.cjs.js +1 -1
- package/icons/trash/index.esm.js +1 -1
- package/icons/trash/index.js +1 -1
- package/icons/undo/index.cjs.js +1 -1
- package/icons/undo/index.esm.js +1 -1
- package/icons/undo/index.js +1 -1
- package/icons/upload/index.cjs.js +1 -1
- package/icons/upload/index.esm.js +1 -1
- package/icons/upload/index.js +1 -1
- package/icons/windowmaximize/index.cjs.js +1 -1
- package/icons/windowmaximize/index.esm.js +1 -1
- package/icons/windowmaximize/index.js +1 -1
- package/icons/windowminimize/index.cjs.js +1 -1
- package/icons/windowminimize/index.esm.js +1 -1
- package/icons/windowminimize/index.js +1 -1
- package/image/image.cjs.js +2 -2
- package/image/image.esm.js +2 -2
- package/image/image.js +2 -2
- package/inputicon/inputicon.cjs.js +1 -1
- package/inputicon/inputicon.esm.js +1 -1
- package/inputicon/inputicon.js +1 -1
- package/inputmask/inputmask.cjs.js +2 -1
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +2 -1
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +2 -1
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +13 -11
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +13 -11
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +13 -11
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputotp/inputotp.cjs.js +10 -10
- package/inputotp/inputotp.cjs.min.js +1 -1
- package/inputotp/inputotp.esm.js +10 -10
- package/inputotp/inputotp.esm.min.js +1 -1
- package/inputotp/inputotp.js +10 -10
- package/inputotp/inputotp.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +1 -1
- package/inputswitch/inputswitch.esm.js +1 -1
- package/inputswitch/inputswitch.js +1 -1
- package/inputtext/inputtext.cjs.js +1 -1
- package/inputtext/inputtext.d.ts +1 -0
- package/inputtext/inputtext.esm.js +1 -1
- package/inputtext/inputtext.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +1 -1
- package/inputtextarea/inputtextarea.esm.js +1 -1
- package/inputtextarea/inputtextarea.js +1 -1
- package/knob/knob.cjs.js +1 -1
- package/knob/knob.esm.js +1 -1
- package/knob/knob.js +1 -1
- package/listbox/listbox.cjs.js +2 -2
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +2 -2
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +2 -2
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +5 -5
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +5 -5
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +5 -5
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +2 -2
- package/mention/mention.d.ts +8 -0
- package/mention/mention.esm.js +2 -2
- package/mention/mention.js +2 -2
- package/menu/menu.cjs.js +4 -4
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +14 -0
- package/menu/menu.esm.js +4 -4
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +4 -4
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +8 -5
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +8 -5
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +8 -5
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +1 -1
- package/message/message.esm.js +1 -1
- package/message/message.js +1 -1
- package/messages/messages.cjs.js +2 -2
- package/messages/messages.esm.js +2 -2
- package/messages/messages.js +2 -2
- package/multiselect/multiselect.cjs.js +11 -8
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +11 -8
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +11 -8
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +2 -2
- package/multistatecheckbox/multistatecheckbox.esm.js +2 -2
- package/multistatecheckbox/multistatecheckbox.js +2 -2
- package/orderlist/orderlist.cjs.js +3 -3
- package/orderlist/orderlist.esm.js +3 -3
- package/orderlist/orderlist.js +3 -3
- package/organizationchart/organizationchart.cjs.js +1 -1
- package/organizationchart/organizationchart.esm.js +1 -1
- package/organizationchart/organizationchart.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +1 -1
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +1 -1
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +1 -1
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +1 -1
- package/paginator/paginator.esm.js +1 -1
- package/paginator/paginator.js +1 -1
- package/panelmenu/panelmenu.cjs.js +22 -19
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +22 -19
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +22 -19
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +346 -319
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +346 -319
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +346 -319
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +10 -4
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +10 -4
- package/password/password.esm.min.js +1 -1
- package/password/password.js +10 -4
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +2 -2
- package/picklist/picklist.esm.js +2 -2
- package/picklist/picklist.js +2 -2
- package/primereact.all.cjs.js +594 -539
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +594 -539
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +594 -539
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +1 -1
- package/progressbar/progressbar.esm.js +1 -1
- package/progressbar/progressbar.js +1 -1
- package/progressspinner/progressspinner.cjs.js +1 -1
- package/progressspinner/progressspinner.esm.js +1 -1
- package/progressspinner/progressspinner.js +1 -1
- package/radiobutton/radiobutton.cjs.js +1 -1
- package/radiobutton/radiobutton.esm.js +1 -1
- package/radiobutton/radiobutton.js +1 -1
- package/rating/rating.cjs.js +1 -1
- package/rating/rating.esm.js +1 -1
- package/rating/rating.js +1 -1
- package/resources/themes/arya-blue/theme.css +16 -29
- package/resources/themes/arya-green/theme.css +16 -29
- package/resources/themes/arya-orange/theme.css +16 -29
- package/resources/themes/arya-purple/theme.css +16 -29
- package/resources/themes/bootstrap4-dark-blue/theme.css +16 -29
- package/resources/themes/bootstrap4-dark-purple/theme.css +16 -29
- package/resources/themes/bootstrap4-light-blue/theme.css +16 -29
- package/resources/themes/bootstrap4-light-purple/theme.css +16 -29
- package/resources/themes/fluent-light/theme.css +16 -29
- package/resources/themes/lara-dark-amber/theme.css +16 -27
- package/resources/themes/lara-dark-blue/theme.css +16 -27
- package/resources/themes/lara-dark-cyan/theme.css +16 -27
- package/resources/themes/lara-dark-green/theme.css +16 -27
- package/resources/themes/lara-dark-indigo/theme.css +16 -27
- package/resources/themes/lara-dark-pink/theme.css +16 -27
- package/resources/themes/lara-dark-purple/theme.css +16 -27
- package/resources/themes/lara-dark-teal/theme.css +16 -27
- package/resources/themes/lara-light-amber/theme.css +16 -27
- package/resources/themes/lara-light-blue/theme.css +16 -27
- package/resources/themes/lara-light-cyan/theme.css +16 -27
- package/resources/themes/lara-light-green/theme.css +16 -27
- package/resources/themes/lara-light-indigo/theme.css +16 -27
- package/resources/themes/lara-light-pink/theme.css +16 -27
- package/resources/themes/lara-light-purple/theme.css +16 -27
- package/resources/themes/lara-light-teal/theme.css +16 -27
- package/resources/themes/luna-amber/theme.css +16 -29
- package/resources/themes/luna-blue/theme.css +16 -29
- package/resources/themes/luna-green/theme.css +16 -29
- package/resources/themes/luna-pink/theme.css +16 -29
- package/resources/themes/md-dark-deeppurple/theme.css +16 -28
- package/resources/themes/md-dark-indigo/theme.css +16 -28
- package/resources/themes/md-light-deeppurple/theme.css +16 -28
- package/resources/themes/md-light-indigo/theme.css +301 -313
- package/resources/themes/mdc-dark-deeppurple/theme.css +16 -28
- package/resources/themes/mdc-dark-indigo/theme.css +16 -28
- package/resources/themes/mdc-light-deeppurple/theme.css +16 -28
- package/resources/themes/mdc-light-indigo/theme.css +301 -313
- package/resources/themes/mira/theme.css +16 -27
- package/resources/themes/nano/theme.css +16 -29
- package/resources/themes/nova/theme.css +16 -29
- package/resources/themes/nova-accent/theme.css +16 -29
- package/resources/themes/nova-alt/theme.css +16 -29
- package/resources/themes/rhea/theme.css +16 -29
- package/resources/themes/saga-blue/theme.css +16 -29
- package/resources/themes/saga-green/theme.css +16 -29
- package/resources/themes/saga-orange/theme.css +16 -29
- package/resources/themes/saga-purple/theme.css +16 -29
- package/resources/themes/soho-dark/theme.css +15 -26
- package/resources/themes/soho-light/theme.css +15 -26
- package/resources/themes/tailwind-light/theme.css +16 -27
- package/resources/themes/vela-blue/theme.css +16 -29
- package/resources/themes/vela-green/theme.css +16 -29
- package/resources/themes/vela-orange/theme.css +16 -29
- package/resources/themes/vela-purple/theme.css +16 -29
- package/resources/themes/viva-dark/theme.css +15 -26
- package/resources/themes/viva-light/theme.css +15 -26
- package/ripple/ripple.cjs.js +1 -1
- package/ripple/ripple.esm.js +1 -1
- package/ripple/ripple.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +14 -6
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +14 -6
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +14 -6
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +1 -1
- package/scrolltop/scrolltop.esm.js +1 -1
- package/scrolltop/scrolltop.js +1 -1
- package/selectbutton/selectbutton.cjs.js +1 -1
- package/selectbutton/selectbutton.esm.js +1 -1
- package/selectbutton/selectbutton.js +1 -1
- package/sidebar/sidebar.d.ts +2 -1
- package/skeleton/skeleton.cjs.js +1 -1
- package/skeleton/skeleton.esm.js +1 -1
- package/skeleton/skeleton.js +1 -1
- package/slidemenu/slidemenu.cjs.js +4 -1
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +4 -1
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +4 -1
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +1 -1
- package/slider/slider.esm.js +1 -1
- package/slider/slider.js +1 -1
- package/speeddial/speeddial.cjs.js +1 -1
- package/speeddial/speeddial.esm.js +1 -1
- package/speeddial/speeddial.js +1 -1
- package/splitbutton/splitbutton.cjs.js +23 -14
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +23 -14
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +23 -14
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +5 -5
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +5 -5
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +5 -5
- package/splitter/splitter.min.js +1 -1
- package/stepper/stepper.cjs.js +4 -4
- package/stepper/stepper.esm.js +4 -4
- package/stepper/stepper.js +4 -4
- package/stepperpanel/stepperpanel.cjs.js +1 -1
- package/stepperpanel/stepperpanel.esm.js +1 -1
- package/stepperpanel/stepperpanel.js +1 -1
- package/steps/steps.cjs.js +5 -10
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +5 -10
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +5 -10
- package/steps/steps.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +7 -7
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +7 -7
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +7 -7
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +8 -8
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +8 -8
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +8 -8
- package/tabview/tabview.min.js +1 -1
- package/terminal/terminal.cjs.js +1 -1
- package/terminal/terminal.esm.js +1 -1
- package/terminal/terminal.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +16 -10
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +16 -10
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +16 -10
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +1 -1
- package/timeline/timeline.esm.js +1 -1
- package/timeline/timeline.js +1 -1
- package/toast/toast.cjs.js +2 -2
- package/toast/toast.esm.js +2 -2
- package/toast/toast.js +2 -2
- package/togglebutton/togglebutton.cjs.js +1 -1
- package/togglebutton/togglebutton.esm.js +1 -1
- package/togglebutton/togglebutton.js +1 -1
- package/toolbar/toolbar.cjs.js +1 -1
- package/toolbar/toolbar.esm.js +1 -1
- package/toolbar/toolbar.js +1 -1
- package/tooltip/tooltip.cjs.js +8 -2
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +8 -2
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +8 -2
- package/tooltip/tooltip.min.js +1 -1
- package/tree/tree.cjs.js +26 -26
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +26 -26
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +26 -26
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +9 -9
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +9 -9
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +9 -9
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +37 -35
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +1 -1
- package/treetable/treetable.esm.js +37 -35
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +37 -35
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +79 -13
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +80 -13
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +79 -13
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +11 -11
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +1 -1
- package/utils/utils.esm.js +11 -11
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +11 -11
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +1 -1
- package/virtualscroller/virtualscroller.js +1 -1
- package/web-types.json +1 -1
package/toolbar/toolbar.js
CHANGED
|
@@ -46,7 +46,7 @@ this.primereact.toolbar = (function (exports, React, api, componentbase, hooks,
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
var Toolbar = /*#__PURE__*/React__namespace.memo(
|
|
49
|
+
var Toolbar = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
50
50
|
var mergeProps = hooks.useMergeProps();
|
|
51
51
|
var context = React__namespace.useContext(api.PrimeReactContext);
|
|
52
52
|
var props = ToolbarBase.getProps(inProps, context);
|
package/tooltip/tooltip.cjs.js
CHANGED
|
@@ -223,7 +223,7 @@ var TooltipBase = componentbase.ComponentBase.extend({
|
|
|
223
223
|
|
|
224
224
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
225
225
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
226
|
-
var Tooltip = /*#__PURE__*/React__namespace.memo(
|
|
226
|
+
var Tooltip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
227
227
|
var mergeProps = hooks.useMergeProps();
|
|
228
228
|
var context = React__namespace.useContext(PrimeReact.PrimeReactContext);
|
|
229
229
|
var props = TooltipBase.getProps(inProps, context);
|
|
@@ -239,6 +239,10 @@ var Tooltip = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
239
239
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
240
240
|
classNameState = _React$useState6[0],
|
|
241
241
|
setClassNameState = _React$useState6[1];
|
|
242
|
+
var _React$useState7 = React__namespace.useState(false),
|
|
243
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
244
|
+
multipleFocusEvents = _React$useState8[0],
|
|
245
|
+
setMultipleFocusEvents = _React$useState8[1];
|
|
242
246
|
var metaData = {
|
|
243
247
|
props: props,
|
|
244
248
|
state: {
|
|
@@ -331,7 +335,7 @@ var Tooltip = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
331
335
|
}
|
|
332
336
|
if (event === 'both') {
|
|
333
337
|
showEvents = ['focus', 'mouseenter'];
|
|
334
|
-
hideEvents = ['blur'
|
|
338
|
+
hideEvents = multipleFocusEvents ? ['blur'] : ['mouseleave', 'blur'];
|
|
335
339
|
}
|
|
336
340
|
}
|
|
337
341
|
return {
|
|
@@ -391,6 +395,7 @@ var Tooltip = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
391
395
|
});
|
|
392
396
|
};
|
|
393
397
|
var show = function show(e) {
|
|
398
|
+
if (e.type && e.type === 'focus') setMultipleFocusEvents(true);
|
|
394
399
|
currentTargetRef.current = e.currentTarget;
|
|
395
400
|
var disabled = isDisabled(currentTargetRef.current);
|
|
396
401
|
var empty = isContentEmpty(isShowOnDisabled(currentTargetRef.current) && disabled ? currentTargetRef.current.firstChild : currentTargetRef.current);
|
|
@@ -418,6 +423,7 @@ var Tooltip = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
418
423
|
}
|
|
419
424
|
};
|
|
420
425
|
var hide = function hide(e) {
|
|
426
|
+
if (e && e.type === 'blur') setMultipleFocusEvents(false);
|
|
421
427
|
clearTimeouts();
|
|
422
428
|
if (visibleState) {
|
|
423
429
|
var success = sendCallback(props.onBeforeHide, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("primereact/api"),r=require("primereact/componentbase"),n=require("primereact/hooks"),o=require("primereact/portal"),i=require("primereact/utils");function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function l(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var u=l(t),c=a(e);function s(){return s=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s.apply(this,arguments)}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function f(t,e){if("object"!==p(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function d(t){var e=f(t,"string");return"symbol"===p(e)?e:String(e)}function m(t,e,r){return(e=d(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function v(t){if(Array.isArray(t))return h(t)}function y(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function b(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t){if(Array.isArray(t))return t}function E(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){return w(t)||E(t,e)||b(t,e)||O()}var S=r.ComponentBase.extend({defaultProps:{__TYPE:"Tooltip",appendTo:null,at:null,autoHide:!0,autoZIndex:!0,baseZIndex:0,className:null,closeOnEscape:!1,content:null,disabled:!1,event:null,hideDelay:0,hideEvent:"mouseleave",id:null,mouseTrack:!1,mouseTrackLeft:5,mouseTrackTop:5,my:null,onBeforeHide:null,onBeforeShow:null,onHide:null,onShow:null,position:"right",showDelay:0,showEvent:"mouseenter",showOnDisabled:!1,style:null,target:null,updateDelay:0,children:void 0},css:{classes:{root:function(t){var e=t.classNameState;return i.classNames("p-tooltip p-component",m({},"p-tooltip-".concat(t.positionState),!0),e)},arrow:"p-tooltip-arrow",text:"p-tooltip-text"},styles:"\n@layer primereact {\n .p-tooltip {\n position: absolute;\n padding: .25em .5rem;\n /* #3687: Tooltip prevent scrollbar flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-tooltip.p-tooltip-right,\n .p-tooltip.p-tooltip-left {\n padding: 0 .25rem;\n }\n \n .p-tooltip.p-tooltip-top,\n .p-tooltip.p-tooltip-bottom {\n padding:.25em 0;\n }\n \n .p-tooltip .p-tooltip-text {\n white-space: pre-line;\n word-break: break-word;\n }\n \n .p-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n \n .p-tooltip-right .p-tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -.25rem;\n border-width: .25em .25em .25em 0;\n }\n \n .p-tooltip-left .p-tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -.25rem;\n border-width: .25em 0 .25em .25rem;\n }\n \n .p-tooltip.p-tooltip-top {\n padding: .25em 0;\n }\n \n .p-tooltip-top .p-tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: .25em .25em 0;\n }\n \n .p-tooltip-bottom .p-tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: 0 .25em .25rem;\n }\n\n .p-tooltip-target-wrapper {\n display: inline-flex;\n }\n}\n",inlineStyles:{arrow:function(t){var e=t.context;return{top:e.bottom?"0":e.right||e.left||!e.right&&!e.left&&!e.top&&!e.bottom?"50%":null,bottom:e.top?"0":null,left:!e.right&&(e.right||e.left||e.top||e.bottom)?e.top||e.bottom?"50%":null:"0",right:e.left?"0":null}}}}});function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function j(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var D=u.memo(u.forwardRef((function(t,a){var l=n.useMergeProps(),p=u.useContext(e.PrimeReactContext),f=S.getProps(t,p),d=x(u.useState(!1),2),m=d[0],h=d[1],w=x(u.useState(f.position||"right"),2),E=w[0],O=w[1],T=x(u.useState(""),2),D=T[0],H=T[1],P={props:f,state:{visible:m,position:E,className:D},context:{right:"right"===E,left:"left"===E,top:"top"===E,bottom:"bottom"===E}},I=S.setMetaData(P),k=I.ptm,N=I.cx,C=I.sx;r.useHandleStyle(S.css.styles,I.isUnstyled,{name:"tooltip"}),n.useGlobalOnEscapeKey({callback:function(){it()},when:f.closeOnEscape,priority:[n.ESC_KEY_HANDLING_PRIORITIES.TOOLTIP,0]});var A=u.useRef(null),L=u.useRef(null),R=u.useRef(null),U=u.useRef(null),M=u.useRef(!0),Z=u.useRef({}),_=u.useRef(null),W=x(n.useResizeListener({listener:function(t){!i.DomHandler.isTouchDevice()&&it(t)}}),2),q=W[0],B=W[1],z=x(n.useOverlayScrollListener({target:R.current,listener:function(t){it(t)},when:m}),2),F=z[0],Y=z[1],G=function(t){return J(t,"mousetrack")||f.mouseTrack},K=function(t){return"true"===J(t,"disabled")||Q(t,"disabled")||f.disabled},X=function(t){return J(t,"showondisabled")||f.showOnDisabled},$=function(){return J(R.current,"autohide")||f.autoHide},J=function(t,e){return Q(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null},Q=function(t,e){return t&&t.hasAttribute(e)},V=function(t){var e=[J(t,"showevent")||f.showEvent],r=[J(t,"hideevent")||f.hideEvent];if(G(t))e=["mousemove"],r=["mouseleave"];else{var n=J(t,"event")||f.event;"focus"===n&&(e=["focus"],r=["blur"]),"both"===n&&(e=["focus","mouseenter"],r=["blur","mouseleave"])}return{showEvents:e,hideEvents:r}},tt=function(t){return J(t,"position")||E},et=function(t){return{top:J(t,"mousetracktop")||f.mouseTrackTop,left:J(t,"mousetrackleft")||f.mouseTrackLeft}},rt=function(t,e){if(L.current){var r=J(t,"tooltip")||f.content;r?(L.current.innerHTML="",L.current.appendChild(document.createTextNode(r)),e()):f.children&&e()}},nt=function(t){rt(R.current,(function(){var e=_.current,r=e.pageX,n=e.pageY;f.autoZIndex&&!i.ZIndexUtils.get(A.current)&&i.ZIndexUtils.set("tooltip",A.current,p&&p.autoZIndex||c.default.autoZIndex,f.baseZIndex||p&&p.zIndex.tooltip||c.default.zIndex.tooltip),A.current.style.left="",A.current.style.top="",$()&&(A.current.style.pointerEvents="none");var o=G(R.current)||"mouse"===t;(o&&!U.current||o)&&(U.current={width:i.DomHandler.getOuterWidth(A.current),height:i.DomHandler.getOuterHeight(A.current)}),at(R.current,{x:r,y:n},t)}))},ot=function(t){R.current=t.currentTarget;var e,r=K(R.current);(e=X(R.current)&&r?R.current.firstChild:R.current,!(f.content||J(e,"tooltip")||f.children))||r||(_.current=t,m?pt("updateDelay",nt):ft(f.onBeforeShow,{originalEvent:t,target:R.current})&&pt("showDelay",(function(){h(!0),ft(f.onShow,{originalEvent:t,target:R.current})})))},it=function(t){(dt(),m)&&(ft(f.onBeforeHide,{originalEvent:t,target:R.current})&&pt("hideDelay",(function(){($()||!1!==M.current)&&(i.ZIndexUtils.clear(A.current),i.DomHandler.removeClass(A.current,"p-tooltip-active"),h(!1),ft(f.onHide,{originalEvent:t,target:R.current}))})))},at=function(t,e,r){var n=0,o=0,a=r||E;if((G(t)||"mouse"==a)&&e){var l={width:i.DomHandler.getOuterWidth(A.current),height:i.DomHandler.getOuterHeight(A.current)};n=e.x,o=e.y;var u=et(t),c=u.top,s=u.left;switch(a){case"left":n-=l.width+s,o-=l.height/2-c;break;case"right":case"mouse":n+=s,o-=l.height/2-c;break;case"top":n-=l.width/2-s,o-=l.height+c;break;case"bottom":n-=l.width/2-s,o+=c}n<=0||U.current.width>l.width?(A.current.style.left="0px",A.current.style.right=window.innerWidth-l.width-n+"px"):(A.current.style.right="",A.current.style.left=n+"px"),A.current.style.top=o+"px",i.DomHandler.addClass(A.current,"p-tooltip-active")}else{var p=i.DomHandler.findCollisionPosition(a),d=J(t,"my")||f.my||p.my,m=J(t,"at")||f.at||p.at;A.current.style.padding="0px",i.DomHandler.flipfitCollision(A.current,t,d,m,(function(t){var e=t.at,r=e.x,n=f.at?"center"!==r&&r!==t.my.x?r:e.y:t.at["".concat(p.axis)];A.current.style.padding="",O(n),lt(n),i.DomHandler.addClass(A.current,"p-tooltip-active")}))}},lt=function(t){if(A.current){var e=getComputedStyle(A.current);"left"===t?A.current.style.left=parseFloat(e.left)-2*parseFloat(e.paddingLeft)+"px":"top"===t&&(A.current.style.top=parseFloat(e.top)-2*parseFloat(e.paddingTop)+"px")}},ut=function(t){$()||(M.current=!0,it(t))},ct=function(t){if(t){var e=V(t),r=e.showEvents,n=e.hideEvents,o=mt(t);r.forEach((function(t){return null==o?void 0:o.addEventListener(t,ot)})),n.forEach((function(t){return null==o?void 0:o.addEventListener(t,it)}))}},st=function(t){if(t){var e=V(t),r=e.showEvents,n=e.hideEvents,o=mt(t);r.forEach((function(t){return null==o?void 0:o.removeEventListener(t,ot)})),n.forEach((function(t){return null==o?void 0:o.removeEventListener(t,it)}))}},pt=function(t,e){dt();var r=J(R.current,t.toLowerCase())||f[t];r?Z.current["".concat(t)]=setTimeout((function(){return e()}),r):e()},ft=function(t){if(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.apply(void 0,r);return void 0===o&&(o=!0),o}return!0},dt=function(){Object.values(Z.current).forEach((function(t){return clearTimeout(t)}))},mt=function(t){if(t){if(X(t)){if(!t.hasWrapper){var e=document.createElement("div");return"INPUT"===t.nodeName?i.DomHandler.addMultipleClasses(e,"p-tooltip-target-wrapper p-inputwrapper"):i.DomHandler.addClass(e,"p-tooltip-target-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t),t.hasWrapper=!0,e}return t.parentElement}var r;return t.hasWrapper&&((r=t.parentElement).replaceWith.apply(r,v(n=t.parentElement.childNodes)||y(n)||b(n)||g()),delete t.hasWrapper),t}var n;return null},ht=function(t){yt(t),vt(t)},vt=function(t){bt(t||f.target,ct)},yt=function(t){bt(t||f.target,st)},bt=function(t,e){if(t=i.ObjectUtils.getRefElement(t))if(i.DomHandler.isElement(t))e(t);else{var r=function(t){i.DomHandler.find(document,t).forEach((function(t){e(t)}))};t instanceof Array?t.forEach((function(t){r(t)})):r(t)}};n.useMountEffect((function(){m&&R.current&&K(R.current)&&it()})),n.useUpdateEffect((function(){return vt(),function(){yt()}}),[ot,it,f.target]),n.useUpdateEffect((function(){if(m){var t=tt(R.current),e=J(R.current,"classname");O(t),H(e),nt(t),q(),F()}else O(f.position||"right"),H(""),R.current=null,U.current=null,M.current=!0;return function(){B(),Y()}}),[m]),n.useUpdateEffect((function(){var t=tt(R.current);m&&"mouse"!==t&&pt("updateDelay",(function(){rt(R.current,(function(){at(R.current)}))}))}),[f.content]),n.useUnmountEffect((function(){it(),i.ZIndexUtils.clear(A.current)})),u.useImperativeHandle(a,(function(){return{props:f,updateTargetEvents:ht,loadTargetEvents:vt,unloadTargetEvents:yt,show:ot,hide:it,getElement:function(){return A.current},getTarget:function(){return R.current}}}));var gt,wt,Et,Ot,xt;if(m){var St=(gt=R.current,wt=!(f.content||J(gt,"tooltip")),Et=l({id:f.id,className:i.classNames(f.className,N("root",{positionState:E,classNameState:D})),style:f.style,role:"tooltip","aria-hidden":m,onMouseEnter:function(t){$()||(M.current=!1)},onMouseLeave:function(t){return ut(t)}},S.getOtherProps(f),k("root")),Ot=l({className:N("arrow"),style:C("arrow",j({},P))},k("arrow")),xt=l({className:N("text")},k("text")),u.createElement("div",s({ref:A},Et),u.createElement("div",Ot),u.createElement("div",s({ref:L},xt),wt&&f.children)));return u.createElement(o.Portal,{element:St,appendTo:f.appendTo,visible:!0})}return null})));D.displayName="Tooltip",exports.Tooltip=D;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("primereact/api"),r=require("primereact/componentbase"),n=require("primereact/hooks"),o=require("primereact/portal"),i=require("primereact/utils");function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function u(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var l=u(t),c=a(e);function s(){return s=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s.apply(this,arguments)}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function f(t,e){if("object"!==p(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function d(t){var e=f(t,"string");return"symbol"===p(e)?e:String(e)}function m(t,e,r){return(e=d(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function v(t){if(Array.isArray(t))return h(t)}function y(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function b(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t){if(Array.isArray(t))return t}function E(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){return w(t)||E(t,e)||b(t,e)||O()}var S=r.ComponentBase.extend({defaultProps:{__TYPE:"Tooltip",appendTo:null,at:null,autoHide:!0,autoZIndex:!0,baseZIndex:0,className:null,closeOnEscape:!1,content:null,disabled:!1,event:null,hideDelay:0,hideEvent:"mouseleave",id:null,mouseTrack:!1,mouseTrackLeft:5,mouseTrackTop:5,my:null,onBeforeHide:null,onBeforeShow:null,onHide:null,onShow:null,position:"right",showDelay:0,showEvent:"mouseenter",showOnDisabled:!1,style:null,target:null,updateDelay:0,children:void 0},css:{classes:{root:function(t){var e=t.classNameState;return i.classNames("p-tooltip p-component",m({},"p-tooltip-".concat(t.positionState),!0),e)},arrow:"p-tooltip-arrow",text:"p-tooltip-text"},styles:"\n@layer primereact {\n .p-tooltip {\n position: absolute;\n padding: .25em .5rem;\n /* #3687: Tooltip prevent scrollbar flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-tooltip.p-tooltip-right,\n .p-tooltip.p-tooltip-left {\n padding: 0 .25rem;\n }\n \n .p-tooltip.p-tooltip-top,\n .p-tooltip.p-tooltip-bottom {\n padding:.25em 0;\n }\n \n .p-tooltip .p-tooltip-text {\n white-space: pre-line;\n word-break: break-word;\n }\n \n .p-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n \n .p-tooltip-right .p-tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -.25rem;\n border-width: .25em .25em .25em 0;\n }\n \n .p-tooltip-left .p-tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -.25rem;\n border-width: .25em 0 .25em .25rem;\n }\n \n .p-tooltip.p-tooltip-top {\n padding: .25em 0;\n }\n \n .p-tooltip-top .p-tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: .25em .25em 0;\n }\n \n .p-tooltip-bottom .p-tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: 0 .25em .25rem;\n }\n\n .p-tooltip-target-wrapper {\n display: inline-flex;\n }\n}\n",inlineStyles:{arrow:function(t){var e=t.context;return{top:e.bottom?"0":e.right||e.left||!e.right&&!e.left&&!e.top&&!e.bottom?"50%":null,bottom:e.top?"0":null,left:!e.right&&(e.right||e.left||e.top||e.bottom)?e.top||e.bottom?"50%":null:"0",right:e.left?"0":null}}}}});function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function j(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var D=l.memo(l.forwardRef((function(t,a){var u=n.useMergeProps(),p=l.useContext(e.PrimeReactContext),f=S.getProps(t,p),d=x(l.useState(!1),2),m=d[0],h=d[1],w=x(l.useState(f.position||"right"),2),E=w[0],O=w[1],T=x(l.useState(""),2),D=T[0],H=T[1],P=x(l.useState(!1),2),I=P[0],k=P[1],N={props:f,state:{visible:m,position:E,className:D},context:{right:"right"===E,left:"left"===E,top:"top"===E,bottom:"bottom"===E}},C=S.setMetaData(N),A=C.ptm,L=C.cx,R=C.sx;r.useHandleStyle(S.css.styles,C.isUnstyled,{name:"tooltip"}),n.useGlobalOnEscapeKey({callback:function(){lt()},when:f.closeOnEscape,priority:[n.ESC_KEY_HANDLING_PRIORITIES.TOOLTIP,0]});var U=l.useRef(null),M=l.useRef(null),Z=l.useRef(null),_=l.useRef(null),W=l.useRef(!0),q=l.useRef({}),B=l.useRef(null),z=x(n.useResizeListener({listener:function(t){!i.DomHandler.isTouchDevice()&<(t)}}),2),F=z[0],Y=z[1],G=x(n.useOverlayScrollListener({target:Z.current,listener:function(t){lt(t)},when:m}),2),K=G[0],X=G[1],$=function(t){return tt(t,"mousetrack")||f.mouseTrack},J=function(t){return"true"===tt(t,"disabled")||et(t,"disabled")||f.disabled},Q=function(t){return tt(t,"showondisabled")||f.showOnDisabled},V=function(){return tt(Z.current,"autohide")||f.autoHide},tt=function(t,e){return et(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null},et=function(t,e){return t&&t.hasAttribute(e)},rt=function(t){var e=[tt(t,"showevent")||f.showEvent],r=[tt(t,"hideevent")||f.hideEvent];if($(t))e=["mousemove"],r=["mouseleave"];else{var n=tt(t,"event")||f.event;"focus"===n&&(e=["focus"],r=["blur"]),"both"===n&&(e=["focus","mouseenter"],r=I?["blur"]:["mouseleave","blur"])}return{showEvents:e,hideEvents:r}},nt=function(t){return tt(t,"position")||E},ot=function(t){return{top:tt(t,"mousetracktop")||f.mouseTrackTop,left:tt(t,"mousetrackleft")||f.mouseTrackLeft}},it=function(t,e){if(M.current){var r=tt(t,"tooltip")||f.content;r?(M.current.innerHTML="",M.current.appendChild(document.createTextNode(r)),e()):f.children&&e()}},at=function(t){it(Z.current,(function(){var e=B.current,r=e.pageX,n=e.pageY;f.autoZIndex&&!i.ZIndexUtils.get(U.current)&&i.ZIndexUtils.set("tooltip",U.current,p&&p.autoZIndex||c.default.autoZIndex,f.baseZIndex||p&&p.zIndex.tooltip||c.default.zIndex.tooltip),U.current.style.left="",U.current.style.top="",V()&&(U.current.style.pointerEvents="none");var o=$(Z.current)||"mouse"===t;(o&&!_.current||o)&&(_.current={width:i.DomHandler.getOuterWidth(U.current),height:i.DomHandler.getOuterHeight(U.current)}),ct(Z.current,{x:r,y:n},t)}))},ut=function(t){t.type&&"focus"===t.type&&k(!0),Z.current=t.currentTarget;var e,r=J(Z.current);(e=Q(Z.current)&&r?Z.current.firstChild:Z.current,!(f.content||tt(e,"tooltip")||f.children))||r||(B.current=t,m?mt("updateDelay",at):ht(f.onBeforeShow,{originalEvent:t,target:Z.current})&&mt("showDelay",(function(){h(!0),ht(f.onShow,{originalEvent:t,target:Z.current})})))},lt=function(t){(t&&"blur"===t.type&&k(!1),vt(),m)&&(ht(f.onBeforeHide,{originalEvent:t,target:Z.current})&&mt("hideDelay",(function(){(V()||!1!==W.current)&&(i.ZIndexUtils.clear(U.current),i.DomHandler.removeClass(U.current,"p-tooltip-active"),h(!1),ht(f.onHide,{originalEvent:t,target:Z.current}))})))},ct=function(t,e,r){var n=0,o=0,a=r||E;if(($(t)||"mouse"==a)&&e){var u={width:i.DomHandler.getOuterWidth(U.current),height:i.DomHandler.getOuterHeight(U.current)};n=e.x,o=e.y;var l=ot(t),c=l.top,s=l.left;switch(a){case"left":n-=u.width+s,o-=u.height/2-c;break;case"right":case"mouse":n+=s,o-=u.height/2-c;break;case"top":n-=u.width/2-s,o-=u.height+c;break;case"bottom":n-=u.width/2-s,o+=c}n<=0||_.current.width>u.width?(U.current.style.left="0px",U.current.style.right=window.innerWidth-u.width-n+"px"):(U.current.style.right="",U.current.style.left=n+"px"),U.current.style.top=o+"px",i.DomHandler.addClass(U.current,"p-tooltip-active")}else{var p=i.DomHandler.findCollisionPosition(a),d=tt(t,"my")||f.my||p.my,m=tt(t,"at")||f.at||p.at;U.current.style.padding="0px",i.DomHandler.flipfitCollision(U.current,t,d,m,(function(t){var e=t.at,r=e.x,n=f.at?"center"!==r&&r!==t.my.x?r:e.y:t.at["".concat(p.axis)];U.current.style.padding="",O(n),st(n),i.DomHandler.addClass(U.current,"p-tooltip-active")}))}},st=function(t){if(U.current){var e=getComputedStyle(U.current);"left"===t?U.current.style.left=parseFloat(e.left)-2*parseFloat(e.paddingLeft)+"px":"top"===t&&(U.current.style.top=parseFloat(e.top)-2*parseFloat(e.paddingTop)+"px")}},pt=function(t){V()||(W.current=!0,lt(t))},ft=function(t){if(t){var e=rt(t),r=e.showEvents,n=e.hideEvents,o=yt(t);r.forEach((function(t){return null==o?void 0:o.addEventListener(t,ut)})),n.forEach((function(t){return null==o?void 0:o.addEventListener(t,lt)}))}},dt=function(t){if(t){var e=rt(t),r=e.showEvents,n=e.hideEvents,o=yt(t);r.forEach((function(t){return null==o?void 0:o.removeEventListener(t,ut)})),n.forEach((function(t){return null==o?void 0:o.removeEventListener(t,lt)}))}},mt=function(t,e){vt();var r=tt(Z.current,t.toLowerCase())||f[t];r?q.current["".concat(t)]=setTimeout((function(){return e()}),r):e()},ht=function(t){if(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.apply(void 0,r);return void 0===o&&(o=!0),o}return!0},vt=function(){Object.values(q.current).forEach((function(t){return clearTimeout(t)}))},yt=function(t){if(t){if(Q(t)){if(!t.hasWrapper){var e=document.createElement("div");return"INPUT"===t.nodeName?i.DomHandler.addMultipleClasses(e,"p-tooltip-target-wrapper p-inputwrapper"):i.DomHandler.addClass(e,"p-tooltip-target-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t),t.hasWrapper=!0,e}return t.parentElement}var r;return t.hasWrapper&&((r=t.parentElement).replaceWith.apply(r,v(n=t.parentElement.childNodes)||y(n)||b(n)||g()),delete t.hasWrapper),t}var n;return null},bt=function(t){wt(t),gt(t)},gt=function(t){Et(t||f.target,ft)},wt=function(t){Et(t||f.target,dt)},Et=function(t,e){if(t=i.ObjectUtils.getRefElement(t))if(i.DomHandler.isElement(t))e(t);else{var r=function(t){i.DomHandler.find(document,t).forEach((function(t){e(t)}))};t instanceof Array?t.forEach((function(t){r(t)})):r(t)}};n.useMountEffect((function(){m&&Z.current&&J(Z.current)&<()})),n.useUpdateEffect((function(){return gt(),function(){wt()}}),[ut,lt,f.target]),n.useUpdateEffect((function(){if(m){var t=nt(Z.current),e=tt(Z.current,"classname");O(t),H(e),at(t),F(),K()}else O(f.position||"right"),H(""),Z.current=null,_.current=null,W.current=!0;return function(){Y(),X()}}),[m]),n.useUpdateEffect((function(){var t=nt(Z.current);m&&"mouse"!==t&&mt("updateDelay",(function(){it(Z.current,(function(){ct(Z.current)}))}))}),[f.content]),n.useUnmountEffect((function(){lt(),i.ZIndexUtils.clear(U.current)})),l.useImperativeHandle(a,(function(){return{props:f,updateTargetEvents:bt,loadTargetEvents:gt,unloadTargetEvents:wt,show:ut,hide:lt,getElement:function(){return U.current},getTarget:function(){return Z.current}}}));var Ot,xt,St,Tt,jt;if(m){var Dt=(Ot=Z.current,xt=!(f.content||tt(Ot,"tooltip")),St=u({id:f.id,className:i.classNames(f.className,L("root",{positionState:E,classNameState:D})),style:f.style,role:"tooltip","aria-hidden":m,onMouseEnter:function(t){V()||(W.current=!1)},onMouseLeave:function(t){return pt(t)}},S.getOtherProps(f),A("root")),Tt=u({className:L("arrow"),style:R("arrow",j({},N))},A("arrow")),jt=u({className:L("text")},A("text")),l.createElement("div",s({ref:U},St),l.createElement("div",Tt),l.createElement("div",s({ref:M},jt),xt&&f.children)));return l.createElement(o.Portal,{element:Dt,appendTo:f.appendTo,visible:!0})}return null})));D.displayName="Tooltip",exports.Tooltip=D;
|
package/tooltip/tooltip.esm.js
CHANGED
|
@@ -196,7 +196,7 @@ var TooltipBase = ComponentBase.extend({
|
|
|
196
196
|
|
|
197
197
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
198
198
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
199
|
-
var Tooltip = /*#__PURE__*/React.memo(
|
|
199
|
+
var Tooltip = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
200
200
|
var mergeProps = useMergeProps();
|
|
201
201
|
var context = React.useContext(PrimeReactContext);
|
|
202
202
|
var props = TooltipBase.getProps(inProps, context);
|
|
@@ -212,6 +212,10 @@ var Tooltip = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
212
212
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
213
213
|
classNameState = _React$useState6[0],
|
|
214
214
|
setClassNameState = _React$useState6[1];
|
|
215
|
+
var _React$useState7 = React.useState(false),
|
|
216
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
217
|
+
multipleFocusEvents = _React$useState8[0],
|
|
218
|
+
setMultipleFocusEvents = _React$useState8[1];
|
|
215
219
|
var metaData = {
|
|
216
220
|
props: props,
|
|
217
221
|
state: {
|
|
@@ -304,7 +308,7 @@ var Tooltip = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
304
308
|
}
|
|
305
309
|
if (event === 'both') {
|
|
306
310
|
showEvents = ['focus', 'mouseenter'];
|
|
307
|
-
hideEvents = ['blur'
|
|
311
|
+
hideEvents = multipleFocusEvents ? ['blur'] : ['mouseleave', 'blur'];
|
|
308
312
|
}
|
|
309
313
|
}
|
|
310
314
|
return {
|
|
@@ -364,6 +368,7 @@ var Tooltip = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
364
368
|
});
|
|
365
369
|
};
|
|
366
370
|
var show = function show(e) {
|
|
371
|
+
if (e.type && e.type === 'focus') setMultipleFocusEvents(true);
|
|
367
372
|
currentTargetRef.current = e.currentTarget;
|
|
368
373
|
var disabled = isDisabled(currentTargetRef.current);
|
|
369
374
|
var empty = isContentEmpty(isShowOnDisabled(currentTargetRef.current) && disabled ? currentTargetRef.current.firstChild : currentTargetRef.current);
|
|
@@ -391,6 +396,7 @@ var Tooltip = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
391
396
|
}
|
|
392
397
|
};
|
|
393
398
|
var hide = function hide(e) {
|
|
399
|
+
if (e && e.type === 'blur') setMultipleFocusEvents(false);
|
|
394
400
|
clearTimeouts();
|
|
395
401
|
if (visibleState) {
|
|
396
402
|
var success = sendCallback(props.onBeforeHide, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"react";import e,{PrimeReactContext as r}from"primereact/api";import{ComponentBase as n,useHandleStyle as o}from"primereact/componentbase";import{useMergeProps as i,useGlobalOnEscapeKey as a,ESC_KEY_HANDLING_PRIORITIES as u,useResizeListener as l,useOverlayScrollListener as c,useMountEffect as p,useUpdateEffect as s,useUnmountEffect as f}from"primereact/hooks";import{Portal as d}from"primereact/portal";import{classNames as m,DomHandler as h,ZIndexUtils as v,ObjectUtils as y}from"primereact/utils";function b(){return b=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},b.apply(this,arguments)}function g(t){return g="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},g(t)}function w(t,e){if("object"!==g(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function E(t){var e=w(t,"string");return"symbol"===g(e)?e:String(e)}function O(t,e,r){return(e=E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function T(t){if(Array.isArray(t))return x(t)}function S(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function j(t,e){if(t){if("string"==typeof t)return x(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function P(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(t){if(Array.isArray(t))return t}function I(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}function D(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(t,e){return k(t)||I(t,e)||j(t,e)||D()}var C=n.extend({defaultProps:{__TYPE:"Tooltip",appendTo:null,at:null,autoHide:!0,autoZIndex:!0,baseZIndex:0,className:null,closeOnEscape:!1,content:null,disabled:!1,event:null,hideDelay:0,hideEvent:"mouseleave",id:null,mouseTrack:!1,mouseTrackLeft:5,mouseTrackTop:5,my:null,onBeforeHide:null,onBeforeShow:null,onHide:null,onShow:null,position:"right",showDelay:0,showEvent:"mouseenter",showOnDisabled:!1,style:null,target:null,updateDelay:0,children:void 0},css:{classes:{root:function(t){var e=t.classNameState;return m("p-tooltip p-component",O({},"p-tooltip-".concat(t.positionState),!0),e)},arrow:"p-tooltip-arrow",text:"p-tooltip-text"},styles:"\n@layer primereact {\n .p-tooltip {\n position: absolute;\n padding: .25em .5rem;\n /* #3687: Tooltip prevent scrollbar flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-tooltip.p-tooltip-right,\n .p-tooltip.p-tooltip-left {\n padding: 0 .25rem;\n }\n \n .p-tooltip.p-tooltip-top,\n .p-tooltip.p-tooltip-bottom {\n padding:.25em 0;\n }\n \n .p-tooltip .p-tooltip-text {\n white-space: pre-line;\n word-break: break-word;\n }\n \n .p-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n \n .p-tooltip-right .p-tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -.25rem;\n border-width: .25em .25em .25em 0;\n }\n \n .p-tooltip-left .p-tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -.25rem;\n border-width: .25em 0 .25em .25rem;\n }\n \n .p-tooltip.p-tooltip-top {\n padding: .25em 0;\n }\n \n .p-tooltip-top .p-tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: .25em .25em 0;\n }\n \n .p-tooltip-bottom .p-tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: 0 .25em .25rem;\n }\n\n .p-tooltip-target-wrapper {\n display: inline-flex;\n }\n}\n",inlineStyles:{arrow:function(t){var e=t.context;return{top:e.bottom?"0":e.right||e.left||!e.right&&!e.left&&!e.top&&!e.bottom?"50%":null,bottom:e.top?"0":null,left:!e.right&&(e.right||e.left||e.top||e.bottom)?e.top||e.bottom?"50%":null:"0",right:e.left?"0":null}}}}});function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var H=t.memo(t.forwardRef((function(n,g){var w=i(),E=t.useContext(r),O=C.getProps(n,E),x=N(t.useState(!1),2),k=x[0],I=x[1],D=N(t.useState(O.position||"right"),2),A=D[0],H=D[1],R=N(t.useState(""),2),W=R[0],M=R[1],Z={props:O,state:{visible:k,position:A,className:W},context:{right:"right"===A,left:"left"===A,top:"top"===A,bottom:"bottom"===A}},B=C.setMetaData(Z),F=B.ptm,U=B.cx,z=B.sx;o(C.css.styles,B.isUnstyled,{name:"tooltip"}),a({callback:function(){ht()},when:O.closeOnEscape,priority:[u.TOOLTIP,0]});var Y=t.useRef(null),_=t.useRef(null),X=t.useRef(null),$=t.useRef(null),q=t.useRef(!0),G=t.useRef({}),J=t.useRef(null),K=N(l({listener:function(t){!h.isTouchDevice()&&ht(t)}}),2),Q=K[0],V=K[1],tt=N(c({target:X.current,listener:function(t){ht(t)},when:k}),2),et=tt[0],rt=tt[1],nt=function(t){return ut(t,"mousetrack")||O.mouseTrack},ot=function(t){return"true"===ut(t,"disabled")||lt(t,"disabled")||O.disabled},it=function(t){return ut(t,"showondisabled")||O.showOnDisabled},at=function(){return ut(X.current,"autohide")||O.autoHide},ut=function(t,e){return lt(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null},lt=function(t,e){return t&&t.hasAttribute(e)},ct=function(t){var e=[ut(t,"showevent")||O.showEvent],r=[ut(t,"hideevent")||O.hideEvent];if(nt(t))e=["mousemove"],r=["mouseleave"];else{var n=ut(t,"event")||O.event;"focus"===n&&(e=["focus"],r=["blur"]),"both"===n&&(e=["focus","mouseenter"],r=["blur","mouseleave"])}return{showEvents:e,hideEvents:r}},pt=function(t){return ut(t,"position")||A},st=function(t){return{top:ut(t,"mousetracktop")||O.mouseTrackTop,left:ut(t,"mousetrackleft")||O.mouseTrackLeft}},ft=function(t,e){if(_.current){var r=ut(t,"tooltip")||O.content;r?(_.current.innerHTML="",_.current.appendChild(document.createTextNode(r)),e()):O.children&&e()}},dt=function(t){ft(X.current,(function(){var r=J.current,n=r.pageX,o=r.pageY;O.autoZIndex&&!v.get(Y.current)&&v.set("tooltip",Y.current,E&&E.autoZIndex||e.autoZIndex,O.baseZIndex||E&&E.zIndex.tooltip||e.zIndex.tooltip),Y.current.style.left="",Y.current.style.top="",at()&&(Y.current.style.pointerEvents="none");var i=nt(X.current)||"mouse"===t;(i&&!$.current||i)&&($.current={width:h.getOuterWidth(Y.current),height:h.getOuterHeight(Y.current)}),vt(X.current,{x:n,y:o},t)}))},mt=function(t){X.current=t.currentTarget;var e,r=ot(X.current);(e=it(X.current)&&r?X.current.firstChild:X.current,!(O.content||ut(e,"tooltip")||O.children))||r||(J.current=t,k?Et("updateDelay",dt):Ot(O.onBeforeShow,{originalEvent:t,target:X.current})&&Et("showDelay",(function(){I(!0),Ot(O.onShow,{originalEvent:t,target:X.current})})))},ht=function(t){(xt(),k)&&(Ot(O.onBeforeHide,{originalEvent:t,target:X.current})&&Et("hideDelay",(function(){(at()||!1!==q.current)&&(v.clear(Y.current),h.removeClass(Y.current,"p-tooltip-active"),I(!1),Ot(O.onHide,{originalEvent:t,target:X.current}))})))},vt=function(t,e,r){var n=0,o=0,i=r||A;if((nt(t)||"mouse"==i)&&e){var a={width:h.getOuterWidth(Y.current),height:h.getOuterHeight(Y.current)};n=e.x,o=e.y;var u=st(t),l=u.top,c=u.left;switch(i){case"left":n-=a.width+c,o-=a.height/2-l;break;case"right":case"mouse":n+=c,o-=a.height/2-l;break;case"top":n-=a.width/2-c,o-=a.height+l;break;case"bottom":n-=a.width/2-c,o+=l}n<=0||$.current.width>a.width?(Y.current.style.left="0px",Y.current.style.right=window.innerWidth-a.width-n+"px"):(Y.current.style.right="",Y.current.style.left=n+"px"),Y.current.style.top=o+"px",h.addClass(Y.current,"p-tooltip-active")}else{var p=h.findCollisionPosition(i),s=ut(t,"my")||O.my||p.my,f=ut(t,"at")||O.at||p.at;Y.current.style.padding="0px",h.flipfitCollision(Y.current,t,s,f,(function(t){var e=t.at,r=e.x,n=O.at?"center"!==r&&r!==t.my.x?r:e.y:t.at["".concat(p.axis)];Y.current.style.padding="",H(n),yt(n),h.addClass(Y.current,"p-tooltip-active")}))}},yt=function(t){if(Y.current){var e=getComputedStyle(Y.current);"left"===t?Y.current.style.left=parseFloat(e.left)-2*parseFloat(e.paddingLeft)+"px":"top"===t&&(Y.current.style.top=parseFloat(e.top)-2*parseFloat(e.paddingTop)+"px")}},bt=function(t){at()||(q.current=!0,ht(t))},gt=function(t){if(t){var e=ct(t),r=e.showEvents,n=e.hideEvents,o=Tt(t);r.forEach((function(t){return null==o?void 0:o.addEventListener(t,mt)})),n.forEach((function(t){return null==o?void 0:o.addEventListener(t,ht)}))}},wt=function(t){if(t){var e=ct(t),r=e.showEvents,n=e.hideEvents,o=Tt(t);r.forEach((function(t){return null==o?void 0:o.removeEventListener(t,mt)})),n.forEach((function(t){return null==o?void 0:o.removeEventListener(t,ht)}))}},Et=function(t,e){xt();var r=ut(X.current,t.toLowerCase())||O[t];r?G.current["".concat(t)]=setTimeout((function(){return e()}),r):e()},Ot=function(t){if(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.apply(void 0,r);return void 0===o&&(o=!0),o}return!0},xt=function(){Object.values(G.current).forEach((function(t){return clearTimeout(t)}))},Tt=function(t){if(t){if(it(t)){if(!t.hasWrapper){var e=document.createElement("div");return"INPUT"===t.nodeName?h.addMultipleClasses(e,"p-tooltip-target-wrapper p-inputwrapper"):h.addClass(e,"p-tooltip-target-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t),t.hasWrapper=!0,e}return t.parentElement}var r;return t.hasWrapper&&((r=t.parentElement).replaceWith.apply(r,T(n=t.parentElement.childNodes)||S(n)||j(n)||P()),delete t.hasWrapper),t}var n;return null},St=function(t){Pt(t),jt(t)},jt=function(t){kt(t||O.target,gt)},Pt=function(t){kt(t||O.target,wt)},kt=function(t,e){if(t=y.getRefElement(t))if(h.isElement(t))e(t);else{var r=function(t){h.find(document,t).forEach((function(t){e(t)}))};t instanceof Array?t.forEach((function(t){r(t)})):r(t)}};p((function(){k&&X.current&&ot(X.current)&&ht()})),s((function(){return jt(),function(){Pt()}}),[mt,ht,O.target]),s((function(){if(k){var t=pt(X.current),e=ut(X.current,"classname");H(t),M(e),dt(t),Q(),et()}else H(O.position||"right"),M(""),X.current=null,$.current=null,q.current=!0;return function(){V(),rt()}}),[k]),s((function(){var t=pt(X.current);k&&"mouse"!==t&&Et("updateDelay",(function(){ft(X.current,(function(){vt(X.current)}))}))}),[O.content]),f((function(){ht(),v.clear(Y.current)})),t.useImperativeHandle(g,(function(){return{props:O,updateTargetEvents:St,loadTargetEvents:jt,unloadTargetEvents:Pt,show:mt,hide:ht,getElement:function(){return Y.current},getTarget:function(){return X.current}}}));var It,Dt,Nt,Ct,At;if(k){var Lt=(It=X.current,Dt=!(O.content||ut(It,"tooltip")),Nt=w({id:O.id,className:m(O.className,U("root",{positionState:A,classNameState:W})),style:O.style,role:"tooltip","aria-hidden":k,onMouseEnter:function(t){at()||(q.current=!1)},onMouseLeave:function(t){return bt(t)}},C.getOtherProps(O),F("root")),Ct=w({className:U("arrow"),style:z("arrow",L({},Z))},F("arrow")),At=w({className:U("text")},F("text")),t.createElement("div",b({ref:Y},Nt),t.createElement("div",Ct),t.createElement("div",b({ref:_},At),Dt&&O.children)));return t.createElement(d,{element:Lt,appendTo:O.appendTo,visible:!0})}return null})));H.displayName="Tooltip";export{H as Tooltip};
|
|
1
|
+
import*as t from"react";import e,{PrimeReactContext as r}from"primereact/api";import{ComponentBase as n,useHandleStyle as o}from"primereact/componentbase";import{useMergeProps as i,useGlobalOnEscapeKey as a,ESC_KEY_HANDLING_PRIORITIES as u,useResizeListener as l,useOverlayScrollListener as c,useMountEffect as p,useUpdateEffect as s,useUnmountEffect as f}from"primereact/hooks";import{Portal as d}from"primereact/portal";import{classNames as m,DomHandler as h,ZIndexUtils as v,ObjectUtils as y}from"primereact/utils";function b(){return b=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},b.apply(this,arguments)}function g(t){return g="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},g(t)}function w(t,e){if("object"!==g(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function E(t){var e=w(t,"string");return"symbol"===g(e)?e:String(e)}function O(t,e,r){return(e=E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function S(t){if(Array.isArray(t))return x(t)}function T(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function j(t,e){if(t){if("string"==typeof t)return x(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function P(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(t){if(Array.isArray(t))return t}function I(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}function D(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(t,e){return k(t)||I(t,e)||j(t,e)||D()}var C=n.extend({defaultProps:{__TYPE:"Tooltip",appendTo:null,at:null,autoHide:!0,autoZIndex:!0,baseZIndex:0,className:null,closeOnEscape:!1,content:null,disabled:!1,event:null,hideDelay:0,hideEvent:"mouseleave",id:null,mouseTrack:!1,mouseTrackLeft:5,mouseTrackTop:5,my:null,onBeforeHide:null,onBeforeShow:null,onHide:null,onShow:null,position:"right",showDelay:0,showEvent:"mouseenter",showOnDisabled:!1,style:null,target:null,updateDelay:0,children:void 0},css:{classes:{root:function(t){var e=t.classNameState;return m("p-tooltip p-component",O({},"p-tooltip-".concat(t.positionState),!0),e)},arrow:"p-tooltip-arrow",text:"p-tooltip-text"},styles:"\n@layer primereact {\n .p-tooltip {\n position: absolute;\n padding: .25em .5rem;\n /* #3687: Tooltip prevent scrollbar flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-tooltip.p-tooltip-right,\n .p-tooltip.p-tooltip-left {\n padding: 0 .25rem;\n }\n \n .p-tooltip.p-tooltip-top,\n .p-tooltip.p-tooltip-bottom {\n padding:.25em 0;\n }\n \n .p-tooltip .p-tooltip-text {\n white-space: pre-line;\n word-break: break-word;\n }\n \n .p-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n \n .p-tooltip-right .p-tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -.25rem;\n border-width: .25em .25em .25em 0;\n }\n \n .p-tooltip-left .p-tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -.25rem;\n border-width: .25em 0 .25em .25rem;\n }\n \n .p-tooltip.p-tooltip-top {\n padding: .25em 0;\n }\n \n .p-tooltip-top .p-tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: .25em .25em 0;\n }\n \n .p-tooltip-bottom .p-tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: 0 .25em .25rem;\n }\n\n .p-tooltip-target-wrapper {\n display: inline-flex;\n }\n}\n",inlineStyles:{arrow:function(t){var e=t.context;return{top:e.bottom?"0":e.right||e.left||!e.right&&!e.left&&!e.top&&!e.bottom?"50%":null,bottom:e.top?"0":null,left:!e.right&&(e.right||e.left||e.top||e.bottom)?e.top||e.bottom?"50%":null:"0",right:e.left?"0":null}}}}});function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var H=t.memo(t.forwardRef((function(n,g){var w=i(),E=t.useContext(r),O=C.getProps(n,E),x=N(t.useState(!1),2),k=x[0],I=x[1],D=N(t.useState(O.position||"right"),2),A=D[0],H=D[1],R=N(t.useState(""),2),W=R[0],M=R[1],Z=N(t.useState(!1),2),B=Z[0],F=Z[1],U={props:O,state:{visible:k,position:A,className:W},context:{right:"right"===A,left:"left"===A,top:"top"===A,bottom:"bottom"===A}},z=C.setMetaData(U),Y=z.ptm,_=z.cx,X=z.sx;o(C.css.styles,z.isUnstyled,{name:"tooltip"}),a({callback:function(){bt()},when:O.closeOnEscape,priority:[u.TOOLTIP,0]});var $=t.useRef(null),q=t.useRef(null),G=t.useRef(null),J=t.useRef(null),K=t.useRef(!0),Q=t.useRef({}),V=t.useRef(null),tt=N(l({listener:function(t){!h.isTouchDevice()&&bt(t)}}),2),et=tt[0],rt=tt[1],nt=N(c({target:G.current,listener:function(t){bt(t)},when:k}),2),ot=nt[0],it=nt[1],at=function(t){return pt(t,"mousetrack")||O.mouseTrack},ut=function(t){return"true"===pt(t,"disabled")||st(t,"disabled")||O.disabled},lt=function(t){return pt(t,"showondisabled")||O.showOnDisabled},ct=function(){return pt(G.current,"autohide")||O.autoHide},pt=function(t,e){return st(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null},st=function(t,e){return t&&t.hasAttribute(e)},ft=function(t){var e=[pt(t,"showevent")||O.showEvent],r=[pt(t,"hideevent")||O.hideEvent];if(at(t))e=["mousemove"],r=["mouseleave"];else{var n=pt(t,"event")||O.event;"focus"===n&&(e=["focus"],r=["blur"]),"both"===n&&(e=["focus","mouseenter"],r=B?["blur"]:["mouseleave","blur"])}return{showEvents:e,hideEvents:r}},dt=function(t){return pt(t,"position")||A},mt=function(t){return{top:pt(t,"mousetracktop")||O.mouseTrackTop,left:pt(t,"mousetrackleft")||O.mouseTrackLeft}},ht=function(t,e){if(q.current){var r=pt(t,"tooltip")||O.content;r?(q.current.innerHTML="",q.current.appendChild(document.createTextNode(r)),e()):O.children&&e()}},vt=function(t){ht(G.current,(function(){var r=V.current,n=r.pageX,o=r.pageY;O.autoZIndex&&!v.get($.current)&&v.set("tooltip",$.current,E&&E.autoZIndex||e.autoZIndex,O.baseZIndex||E&&E.zIndex.tooltip||e.zIndex.tooltip),$.current.style.left="",$.current.style.top="",ct()&&($.current.style.pointerEvents="none");var i=at(G.current)||"mouse"===t;(i&&!J.current||i)&&(J.current={width:h.getOuterWidth($.current),height:h.getOuterHeight($.current)}),gt(G.current,{x:n,y:o},t)}))},yt=function(t){t.type&&"focus"===t.type&&F(!0),G.current=t.currentTarget;var e,r=ut(G.current);(e=lt(G.current)&&r?G.current.firstChild:G.current,!(O.content||pt(e,"tooltip")||O.children))||r||(V.current=t,k?St("updateDelay",vt):Tt(O.onBeforeShow,{originalEvent:t,target:G.current})&&St("showDelay",(function(){I(!0),Tt(O.onShow,{originalEvent:t,target:G.current})})))},bt=function(t){(t&&"blur"===t.type&&F(!1),jt(),k)&&(Tt(O.onBeforeHide,{originalEvent:t,target:G.current})&&St("hideDelay",(function(){(ct()||!1!==K.current)&&(v.clear($.current),h.removeClass($.current,"p-tooltip-active"),I(!1),Tt(O.onHide,{originalEvent:t,target:G.current}))})))},gt=function(t,e,r){var n=0,o=0,i=r||A;if((at(t)||"mouse"==i)&&e){var a={width:h.getOuterWidth($.current),height:h.getOuterHeight($.current)};n=e.x,o=e.y;var u=mt(t),l=u.top,c=u.left;switch(i){case"left":n-=a.width+c,o-=a.height/2-l;break;case"right":case"mouse":n+=c,o-=a.height/2-l;break;case"top":n-=a.width/2-c,o-=a.height+l;break;case"bottom":n-=a.width/2-c,o+=l}n<=0||J.current.width>a.width?($.current.style.left="0px",$.current.style.right=window.innerWidth-a.width-n+"px"):($.current.style.right="",$.current.style.left=n+"px"),$.current.style.top=o+"px",h.addClass($.current,"p-tooltip-active")}else{var p=h.findCollisionPosition(i),s=pt(t,"my")||O.my||p.my,f=pt(t,"at")||O.at||p.at;$.current.style.padding="0px",h.flipfitCollision($.current,t,s,f,(function(t){var e=t.at,r=e.x,n=O.at?"center"!==r&&r!==t.my.x?r:e.y:t.at["".concat(p.axis)];$.current.style.padding="",H(n),wt(n),h.addClass($.current,"p-tooltip-active")}))}},wt=function(t){if($.current){var e=getComputedStyle($.current);"left"===t?$.current.style.left=parseFloat(e.left)-2*parseFloat(e.paddingLeft)+"px":"top"===t&&($.current.style.top=parseFloat(e.top)-2*parseFloat(e.paddingTop)+"px")}},Et=function(t){ct()||(K.current=!0,bt(t))},Ot=function(t){if(t){var e=ft(t),r=e.showEvents,n=e.hideEvents,o=Pt(t);r.forEach((function(t){return null==o?void 0:o.addEventListener(t,yt)})),n.forEach((function(t){return null==o?void 0:o.addEventListener(t,bt)}))}},xt=function(t){if(t){var e=ft(t),r=e.showEvents,n=e.hideEvents,o=Pt(t);r.forEach((function(t){return null==o?void 0:o.removeEventListener(t,yt)})),n.forEach((function(t){return null==o?void 0:o.removeEventListener(t,bt)}))}},St=function(t,e){jt();var r=pt(G.current,t.toLowerCase())||O[t];r?Q.current["".concat(t)]=setTimeout((function(){return e()}),r):e()},Tt=function(t){if(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.apply(void 0,r);return void 0===o&&(o=!0),o}return!0},jt=function(){Object.values(Q.current).forEach((function(t){return clearTimeout(t)}))},Pt=function(t){if(t){if(lt(t)){if(!t.hasWrapper){var e=document.createElement("div");return"INPUT"===t.nodeName?h.addMultipleClasses(e,"p-tooltip-target-wrapper p-inputwrapper"):h.addClass(e,"p-tooltip-target-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t),t.hasWrapper=!0,e}return t.parentElement}var r;return t.hasWrapper&&((r=t.parentElement).replaceWith.apply(r,S(n=t.parentElement.childNodes)||T(n)||j(n)||P()),delete t.hasWrapper),t}var n;return null},kt=function(t){Dt(t),It(t)},It=function(t){Nt(t||O.target,Ot)},Dt=function(t){Nt(t||O.target,xt)},Nt=function(t,e){if(t=y.getRefElement(t))if(h.isElement(t))e(t);else{var r=function(t){h.find(document,t).forEach((function(t){e(t)}))};t instanceof Array?t.forEach((function(t){r(t)})):r(t)}};p((function(){k&&G.current&&ut(G.current)&&bt()})),s((function(){return It(),function(){Dt()}}),[yt,bt,O.target]),s((function(){if(k){var t=dt(G.current),e=pt(G.current,"classname");H(t),M(e),vt(t),et(),ot()}else H(O.position||"right"),M(""),G.current=null,J.current=null,K.current=!0;return function(){rt(),it()}}),[k]),s((function(){var t=dt(G.current);k&&"mouse"!==t&&St("updateDelay",(function(){ht(G.current,(function(){gt(G.current)}))}))}),[O.content]),f((function(){bt(),v.clear($.current)})),t.useImperativeHandle(g,(function(){return{props:O,updateTargetEvents:kt,loadTargetEvents:It,unloadTargetEvents:Dt,show:yt,hide:bt,getElement:function(){return $.current},getTarget:function(){return G.current}}}));var Ct,At,Lt,Ht,Rt;if(k){var Wt=(Ct=G.current,At=!(O.content||pt(Ct,"tooltip")),Lt=w({id:O.id,className:m(O.className,_("root",{positionState:A,classNameState:W})),style:O.style,role:"tooltip","aria-hidden":k,onMouseEnter:function(t){ct()||(K.current=!1)},onMouseLeave:function(t){return Et(t)}},C.getOtherProps(O),Y("root")),Ht=w({className:_("arrow"),style:X("arrow",L({},U))},Y("arrow")),Rt=w({className:_("text")},Y("text")),t.createElement("div",b({ref:$},Lt),t.createElement("div",Ht),t.createElement("div",b({ref:q},Rt),At&&O.children)));return t.createElement(d,{element:Wt,appendTo:O.appendTo,visible:!0})}return null})));H.displayName="Tooltip";export{H as Tooltip};
|
package/tooltip/tooltip.js
CHANGED
|
@@ -215,7 +215,7 @@ this.primereact.tooltip = (function (exports, React, PrimeReact, componentbase,
|
|
|
215
215
|
|
|
216
216
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
217
217
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
218
|
-
var Tooltip = /*#__PURE__*/React__namespace.memo(
|
|
218
|
+
var Tooltip = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
219
219
|
var mergeProps = hooks.useMergeProps();
|
|
220
220
|
var context = React__namespace.useContext(PrimeReact.PrimeReactContext);
|
|
221
221
|
var props = TooltipBase.getProps(inProps, context);
|
|
@@ -231,6 +231,10 @@ this.primereact.tooltip = (function (exports, React, PrimeReact, componentbase,
|
|
|
231
231
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
232
232
|
classNameState = _React$useState6[0],
|
|
233
233
|
setClassNameState = _React$useState6[1];
|
|
234
|
+
var _React$useState7 = React__namespace.useState(false),
|
|
235
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
236
|
+
multipleFocusEvents = _React$useState8[0],
|
|
237
|
+
setMultipleFocusEvents = _React$useState8[1];
|
|
234
238
|
var metaData = {
|
|
235
239
|
props: props,
|
|
236
240
|
state: {
|
|
@@ -323,7 +327,7 @@ this.primereact.tooltip = (function (exports, React, PrimeReact, componentbase,
|
|
|
323
327
|
}
|
|
324
328
|
if (event === 'both') {
|
|
325
329
|
showEvents = ['focus', 'mouseenter'];
|
|
326
|
-
hideEvents = ['blur'
|
|
330
|
+
hideEvents = multipleFocusEvents ? ['blur'] : ['mouseleave', 'blur'];
|
|
327
331
|
}
|
|
328
332
|
}
|
|
329
333
|
return {
|
|
@@ -383,6 +387,7 @@ this.primereact.tooltip = (function (exports, React, PrimeReact, componentbase,
|
|
|
383
387
|
});
|
|
384
388
|
};
|
|
385
389
|
var show = function show(e) {
|
|
390
|
+
if (e.type && e.type === 'focus') setMultipleFocusEvents(true);
|
|
386
391
|
currentTargetRef.current = e.currentTarget;
|
|
387
392
|
var disabled = isDisabled(currentTargetRef.current);
|
|
388
393
|
var empty = isContentEmpty(isShowOnDisabled(currentTargetRef.current) && disabled ? currentTargetRef.current.firstChild : currentTargetRef.current);
|
|
@@ -410,6 +415,7 @@ this.primereact.tooltip = (function (exports, React, PrimeReact, componentbase,
|
|
|
410
415
|
}
|
|
411
416
|
};
|
|
412
417
|
var hide = function hide(e) {
|
|
418
|
+
if (e && e.type === 'blur') setMultipleFocusEvents(false);
|
|
413
419
|
clearTimeouts();
|
|
414
420
|
if (visibleState) {
|
|
415
421
|
var success = sendCallback(props.onBeforeHide, {
|
package/tooltip/tooltip.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.tooltip=function(t,e,r,n,o,i,a){"use strict";function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function u(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var c=u(e),s=l(r);function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}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 d(t,e){if("object"!==f(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function m(t){var e=d(t,"string");return"symbol"===f(e)?e:String(e)}function h(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function y(t){if(Array.isArray(t))return v(t)}function b(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function g(t,e){if(t){if("string"==typeof t)return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(t){if(Array.isArray(t))return t}function O(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(t,e){return E(t)||O(t,e)||g(t,e)||x()}var T=n.ComponentBase.extend({defaultProps:{__TYPE:"Tooltip",appendTo:null,at:null,autoHide:!0,autoZIndex:!0,baseZIndex:0,className:null,closeOnEscape:!1,content:null,disabled:!1,event:null,hideDelay:0,hideEvent:"mouseleave",id:null,mouseTrack:!1,mouseTrackLeft:5,mouseTrackTop:5,my:null,onBeforeHide:null,onBeforeShow:null,onHide:null,onShow:null,position:"right",showDelay:0,showEvent:"mouseenter",showOnDisabled:!1,style:null,target:null,updateDelay:0,children:void 0},css:{classes:{root:function(t){var e=t.classNameState;return a.classNames("p-tooltip p-component",h({},"p-tooltip-".concat(t.positionState),!0),e)},arrow:"p-tooltip-arrow",text:"p-tooltip-text"},styles:"\n@layer primereact {\n .p-tooltip {\n position: absolute;\n padding: .25em .5rem;\n /* #3687: Tooltip prevent scrollbar flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-tooltip.p-tooltip-right,\n .p-tooltip.p-tooltip-left {\n padding: 0 .25rem;\n }\n \n .p-tooltip.p-tooltip-top,\n .p-tooltip.p-tooltip-bottom {\n padding:.25em 0;\n }\n \n .p-tooltip .p-tooltip-text {\n white-space: pre-line;\n word-break: break-word;\n }\n \n .p-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n \n .p-tooltip-right .p-tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -.25rem;\n border-width: .25em .25em .25em 0;\n }\n \n .p-tooltip-left .p-tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -.25rem;\n border-width: .25em 0 .25em .25rem;\n }\n \n .p-tooltip.p-tooltip-top {\n padding: .25em 0;\n }\n \n .p-tooltip-top .p-tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: .25em .25em 0;\n }\n \n .p-tooltip-bottom .p-tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: 0 .25em .25rem;\n }\n\n .p-tooltip-target-wrapper {\n display: inline-flex;\n }\n}\n",inlineStyles:{arrow:function(t){var e=t.context;return{top:e.bottom?"0":e.right||e.left||!e.right&&!e.left&&!e.top&&!e.bottom?"50%":null,bottom:e.top?"0":null,left:!e.right&&(e.right||e.left||e.top||e.bottom)?e.top||e.bottom?"50%":null:"0",right:e.left?"0":null}}}}});function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var H=c.memo(c.forwardRef((function(t,e){var l=o.useMergeProps(),u=c.useContext(r.PrimeReactContext),f=T.getProps(t,u),d=S(c.useState(!1),2),m=d[0],h=d[1],v=S(c.useState(f.position||"right"),2),E=v[0],O=v[1],x=S(c.useState(""),2),j=x[0],H=x[1],P={props:f,state:{visible:m,position:E,className:j},context:{right:"right"===E,left:"left"===E,top:"top"===E,bottom:"bottom"===E}},I=T.setMetaData(P),k=I.ptm,N=I.cx,C=I.sx;n.useHandleStyle(T.css.styles,I.isUnstyled,{name:"tooltip"}),o.useGlobalOnEscapeKey({callback:function(){it()},when:f.closeOnEscape,priority:[o.ESC_KEY_HANDLING_PRIORITIES.TOOLTIP,0]});var A=c.useRef(null),L=c.useRef(null),R=c.useRef(null),U=c.useRef(null),M=c.useRef(!0),Z=c.useRef({}),_=c.useRef(null),W=S(o.useResizeListener({listener:function(t){!a.DomHandler.isTouchDevice()&&it(t)}}),2),B=W[0],z=W[1],F=S(o.useOverlayScrollListener({target:R.current,listener:function(t){it(t)},when:m}),2),Y=F[0],G=F[1],K=function(t){return J(t,"mousetrack")||f.mouseTrack},X=function(t){return"true"===J(t,"disabled")||Q(t,"disabled")||f.disabled},$=function(t){return J(t,"showondisabled")||f.showOnDisabled},q=function(){return J(R.current,"autohide")||f.autoHide},J=function(t,e){return Q(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null},Q=function(t,e){return t&&t.hasAttribute(e)},V=function(t){var e=[J(t,"showevent")||f.showEvent],r=[J(t,"hideevent")||f.hideEvent];if(K(t))e=["mousemove"],r=["mouseleave"];else{var n=J(t,"event")||f.event;"focus"===n&&(e=["focus"],r=["blur"]),"both"===n&&(e=["focus","mouseenter"],r=["blur","mouseleave"])}return{showEvents:e,hideEvents:r}},tt=function(t){return J(t,"position")||E},et=function(t){return{top:J(t,"mousetracktop")||f.mouseTrackTop,left:J(t,"mousetrackleft")||f.mouseTrackLeft}},rt=function(t,e){if(L.current){var r=J(t,"tooltip")||f.content;r?(L.current.innerHTML="",L.current.appendChild(document.createTextNode(r)),e()):f.children&&e()}},nt=function(t){rt(R.current,(function(){var e=_.current,r=e.pageX,n=e.pageY;f.autoZIndex&&!a.ZIndexUtils.get(A.current)&&a.ZIndexUtils.set("tooltip",A.current,u&&u.autoZIndex||s.default.autoZIndex,f.baseZIndex||u&&u.zIndex.tooltip||s.default.zIndex.tooltip),A.current.style.left="",A.current.style.top="",q()&&(A.current.style.pointerEvents="none");var o=K(R.current)||"mouse"===t;(o&&!U.current||o)&&(U.current={width:a.DomHandler.getOuterWidth(A.current),height:a.DomHandler.getOuterHeight(A.current)}),at(R.current,{x:r,y:n},t)}))},ot=function(t){R.current=t.currentTarget;var e,r=X(R.current);(e=$(R.current)&&r?R.current.firstChild:R.current,!(f.content||J(e,"tooltip")||f.children))||r||(_.current=t,m?pt("updateDelay",nt):ft(f.onBeforeShow,{originalEvent:t,target:R.current})&&pt("showDelay",(function(){h(!0),ft(f.onShow,{originalEvent:t,target:R.current})})))},it=function(t){(dt(),m)&&(ft(f.onBeforeHide,{originalEvent:t,target:R.current})&&pt("hideDelay",(function(){(q()||!1!==M.current)&&(a.ZIndexUtils.clear(A.current),a.DomHandler.removeClass(A.current,"p-tooltip-active"),h(!1),ft(f.onHide,{originalEvent:t,target:R.current}))})))},at=function(t,e,r){var n=0,o=0,i=r||E;if((K(t)||"mouse"==i)&&e){var l={width:a.DomHandler.getOuterWidth(A.current),height:a.DomHandler.getOuterHeight(A.current)};n=e.x,o=e.y;var u=et(t),c=u.top,s=u.left;switch(i){case"left":n-=l.width+s,o-=l.height/2-c;break;case"right":case"mouse":n+=s,o-=l.height/2-c;break;case"top":n-=l.width/2-s,o-=l.height+c;break;case"bottom":n-=l.width/2-s,o+=c}n<=0||U.current.width>l.width?(A.current.style.left="0px",A.current.style.right=window.innerWidth-l.width-n+"px"):(A.current.style.right="",A.current.style.left=n+"px"),A.current.style.top=o+"px",a.DomHandler.addClass(A.current,"p-tooltip-active")}else{var p=a.DomHandler.findCollisionPosition(i),d=J(t,"my")||f.my||p.my,m=J(t,"at")||f.at||p.at;A.current.style.padding="0px",a.DomHandler.flipfitCollision(A.current,t,d,m,(function(t){var e=t.at,r=e.x,n=f.at?"center"!==r&&r!==t.my.x?r:e.y:t.at["".concat(p.axis)];A.current.style.padding="",O(n),lt(n),a.DomHandler.addClass(A.current,"p-tooltip-active")}))}},lt=function(t){if(A.current){var e=getComputedStyle(A.current);"left"===t?A.current.style.left=parseFloat(e.left)-2*parseFloat(e.paddingLeft)+"px":"top"===t&&(A.current.style.top=parseFloat(e.top)-2*parseFloat(e.paddingTop)+"px")}},ut=function(t){q()||(M.current=!0,it(t))},ct=function(t){if(t){var e=V(t),r=e.showEvents,n=e.hideEvents,o=mt(t);r.forEach((function(t){return null==o?void 0:o.addEventListener(t,ot)})),n.forEach((function(t){return null==o?void 0:o.addEventListener(t,it)}))}},st=function(t){if(t){var e=V(t),r=e.showEvents,n=e.hideEvents,o=mt(t);r.forEach((function(t){return null==o?void 0:o.removeEventListener(t,ot)})),n.forEach((function(t){return null==o?void 0:o.removeEventListener(t,it)}))}},pt=function(t,e){dt();var r=J(R.current,t.toLowerCase())||f[t];r?Z.current["".concat(t)]=setTimeout((function(){return e()}),r):e()},ft=function(t){if(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.apply(void 0,r);return void 0===o&&(o=!0),o}return!0},dt=function(){Object.values(Z.current).forEach((function(t){return clearTimeout(t)}))},mt=function(t){if(t){if($(t)){if(!t.hasWrapper){var e=document.createElement("div");return"INPUT"===t.nodeName?a.DomHandler.addMultipleClasses(e,"p-tooltip-target-wrapper p-inputwrapper"):a.DomHandler.addClass(e,"p-tooltip-target-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t),t.hasWrapper=!0,e}return t.parentElement}var r;return t.hasWrapper&&((r=t.parentElement).replaceWith.apply(r,y(n=t.parentElement.childNodes)||b(n)||g(n)||w()),delete t.hasWrapper),t}var n;return null},ht=function(t){yt(t),vt(t)},vt=function(t){bt(t||f.target,ct)},yt=function(t){bt(t||f.target,st)},bt=function(t,e){if(t=a.ObjectUtils.getRefElement(t))if(a.DomHandler.isElement(t))e(t);else{var r=function(t){a.DomHandler.find(document,t).forEach((function(t){e(t)}))};t instanceof Array?t.forEach((function(t){r(t)})):r(t)}};o.useMountEffect((function(){m&&R.current&&X(R.current)&&it()})),o.useUpdateEffect((function(){return vt(),function(){yt()}}),[ot,it,f.target]),o.useUpdateEffect((function(){if(m){var t=tt(R.current),e=J(R.current,"classname");O(t),H(e),nt(t),B(),Y()}else O(f.position||"right"),H(""),R.current=null,U.current=null,M.current=!0;return function(){z(),G()}}),[m]),o.useUpdateEffect((function(){var t=tt(R.current);m&&"mouse"!==t&&pt("updateDelay",(function(){rt(R.current,(function(){at(R.current)}))}))}),[f.content]),o.useUnmountEffect((function(){it(),a.ZIndexUtils.clear(A.current)})),c.useImperativeHandle(e,(function(){return{props:f,updateTargetEvents:ht,loadTargetEvents:vt,unloadTargetEvents:yt,show:ot,hide:it,getElement:function(){return A.current},getTarget:function(){return R.current}}}));var gt,wt,Et,Ot,xt;if(m){var St=(gt=R.current,wt=!(f.content||J(gt,"tooltip")),Et=l({id:f.id,className:a.classNames(f.className,N("root",{positionState:E,classNameState:j})),style:f.style,role:"tooltip","aria-hidden":m,onMouseEnter:function(t){q()||(M.current=!1)},onMouseLeave:function(t){return ut(t)}},T.getOtherProps(f),k("root")),Ot=l({className:N("arrow"),style:C("arrow",D({},P))},k("arrow")),xt=l({className:N("text")},k("text")),c.createElement("div",p({ref:A},Et),c.createElement("div",Ot),c.createElement("div",p({ref:L},xt),wt&&f.children)));return c.createElement(i.Portal,{element:St,appendTo:f.appendTo,visible:!0})}return null})));return H.displayName="Tooltip",t.Tooltip=H,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.api,primereact.componentbase,primereact.hooks,primereact.portal,primereact.utils);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.tooltip=function(t,e,r,n,o,i,a){"use strict";function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function u(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var c=u(e),s=l(r);function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}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 d(t,e){if("object"!==f(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function m(t){var e=d(t,"string");return"symbol"===f(e)?e:String(e)}function h(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function y(t){if(Array.isArray(t))return v(t)}function b(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function g(t,e){if(t){if("string"==typeof t)return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(t){if(Array.isArray(t))return t}function O(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(t,e){return E(t)||O(t,e)||g(t,e)||x()}var T=n.ComponentBase.extend({defaultProps:{__TYPE:"Tooltip",appendTo:null,at:null,autoHide:!0,autoZIndex:!0,baseZIndex:0,className:null,closeOnEscape:!1,content:null,disabled:!1,event:null,hideDelay:0,hideEvent:"mouseleave",id:null,mouseTrack:!1,mouseTrackLeft:5,mouseTrackTop:5,my:null,onBeforeHide:null,onBeforeShow:null,onHide:null,onShow:null,position:"right",showDelay:0,showEvent:"mouseenter",showOnDisabled:!1,style:null,target:null,updateDelay:0,children:void 0},css:{classes:{root:function(t){var e=t.classNameState;return a.classNames("p-tooltip p-component",h({},"p-tooltip-".concat(t.positionState),!0),e)},arrow:"p-tooltip-arrow",text:"p-tooltip-text"},styles:"\n@layer primereact {\n .p-tooltip {\n position: absolute;\n padding: .25em .5rem;\n /* #3687: Tooltip prevent scrollbar flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-tooltip.p-tooltip-right,\n .p-tooltip.p-tooltip-left {\n padding: 0 .25rem;\n }\n \n .p-tooltip.p-tooltip-top,\n .p-tooltip.p-tooltip-bottom {\n padding:.25em 0;\n }\n \n .p-tooltip .p-tooltip-text {\n white-space: pre-line;\n word-break: break-word;\n }\n \n .p-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n \n .p-tooltip-right .p-tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -.25rem;\n border-width: .25em .25em .25em 0;\n }\n \n .p-tooltip-left .p-tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -.25rem;\n border-width: .25em 0 .25em .25rem;\n }\n \n .p-tooltip.p-tooltip-top {\n padding: .25em 0;\n }\n \n .p-tooltip-top .p-tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: .25em .25em 0;\n }\n \n .p-tooltip-bottom .p-tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: 0 .25em .25rem;\n }\n\n .p-tooltip-target-wrapper {\n display: inline-flex;\n }\n}\n",inlineStyles:{arrow:function(t){var e=t.context;return{top:e.bottom?"0":e.right||e.left||!e.right&&!e.left&&!e.top&&!e.bottom?"50%":null,bottom:e.top?"0":null,left:!e.right&&(e.right||e.left||e.top||e.bottom)?e.top||e.bottom?"50%":null:"0",right:e.left?"0":null}}}}});function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var H=c.memo(c.forwardRef((function(t,e){var l=o.useMergeProps(),u=c.useContext(r.PrimeReactContext),f=T.getProps(t,u),d=S(c.useState(!1),2),m=d[0],h=d[1],v=S(c.useState(f.position||"right"),2),E=v[0],O=v[1],x=S(c.useState(""),2),j=x[0],H=x[1],P=S(c.useState(!1),2),I=P[0],k=P[1],N={props:f,state:{visible:m,position:E,className:j},context:{right:"right"===E,left:"left"===E,top:"top"===E,bottom:"bottom"===E}},C=T.setMetaData(N),A=C.ptm,L=C.cx,R=C.sx;n.useHandleStyle(T.css.styles,C.isUnstyled,{name:"tooltip"}),o.useGlobalOnEscapeKey({callback:function(){ut()},when:f.closeOnEscape,priority:[o.ESC_KEY_HANDLING_PRIORITIES.TOOLTIP,0]});var U=c.useRef(null),M=c.useRef(null),Z=c.useRef(null),_=c.useRef(null),W=c.useRef(!0),B=c.useRef({}),z=c.useRef(null),F=S(o.useResizeListener({listener:function(t){!a.DomHandler.isTouchDevice()&&ut(t)}}),2),Y=F[0],G=F[1],K=S(o.useOverlayScrollListener({target:Z.current,listener:function(t){ut(t)},when:m}),2),X=K[0],$=K[1],q=function(t){return tt(t,"mousetrack")||f.mouseTrack},J=function(t){return"true"===tt(t,"disabled")||et(t,"disabled")||f.disabled},Q=function(t){return tt(t,"showondisabled")||f.showOnDisabled},V=function(){return tt(Z.current,"autohide")||f.autoHide},tt=function(t,e){return et(t,"data-pr-".concat(e))?t.getAttribute("data-pr-".concat(e)):null},et=function(t,e){return t&&t.hasAttribute(e)},rt=function(t){var e=[tt(t,"showevent")||f.showEvent],r=[tt(t,"hideevent")||f.hideEvent];if(q(t))e=["mousemove"],r=["mouseleave"];else{var n=tt(t,"event")||f.event;"focus"===n&&(e=["focus"],r=["blur"]),"both"===n&&(e=["focus","mouseenter"],r=I?["blur"]:["mouseleave","blur"])}return{showEvents:e,hideEvents:r}},nt=function(t){return tt(t,"position")||E},ot=function(t){return{top:tt(t,"mousetracktop")||f.mouseTrackTop,left:tt(t,"mousetrackleft")||f.mouseTrackLeft}},it=function(t,e){if(M.current){var r=tt(t,"tooltip")||f.content;r?(M.current.innerHTML="",M.current.appendChild(document.createTextNode(r)),e()):f.children&&e()}},at=function(t){it(Z.current,(function(){var e=z.current,r=e.pageX,n=e.pageY;f.autoZIndex&&!a.ZIndexUtils.get(U.current)&&a.ZIndexUtils.set("tooltip",U.current,u&&u.autoZIndex||s.default.autoZIndex,f.baseZIndex||u&&u.zIndex.tooltip||s.default.zIndex.tooltip),U.current.style.left="",U.current.style.top="",V()&&(U.current.style.pointerEvents="none");var o=q(Z.current)||"mouse"===t;(o&&!_.current||o)&&(_.current={width:a.DomHandler.getOuterWidth(U.current),height:a.DomHandler.getOuterHeight(U.current)}),ct(Z.current,{x:r,y:n},t)}))},lt=function(t){t.type&&"focus"===t.type&&k(!0),Z.current=t.currentTarget;var e,r=J(Z.current);(e=Q(Z.current)&&r?Z.current.firstChild:Z.current,!(f.content||tt(e,"tooltip")||f.children))||r||(z.current=t,m?mt("updateDelay",at):ht(f.onBeforeShow,{originalEvent:t,target:Z.current})&&mt("showDelay",(function(){h(!0),ht(f.onShow,{originalEvent:t,target:Z.current})})))},ut=function(t){(t&&"blur"===t.type&&k(!1),vt(),m)&&(ht(f.onBeforeHide,{originalEvent:t,target:Z.current})&&mt("hideDelay",(function(){(V()||!1!==W.current)&&(a.ZIndexUtils.clear(U.current),a.DomHandler.removeClass(U.current,"p-tooltip-active"),h(!1),ht(f.onHide,{originalEvent:t,target:Z.current}))})))},ct=function(t,e,r){var n=0,o=0,i=r||E;if((q(t)||"mouse"==i)&&e){var l={width:a.DomHandler.getOuterWidth(U.current),height:a.DomHandler.getOuterHeight(U.current)};n=e.x,o=e.y;var u=ot(t),c=u.top,s=u.left;switch(i){case"left":n-=l.width+s,o-=l.height/2-c;break;case"right":case"mouse":n+=s,o-=l.height/2-c;break;case"top":n-=l.width/2-s,o-=l.height+c;break;case"bottom":n-=l.width/2-s,o+=c}n<=0||_.current.width>l.width?(U.current.style.left="0px",U.current.style.right=window.innerWidth-l.width-n+"px"):(U.current.style.right="",U.current.style.left=n+"px"),U.current.style.top=o+"px",a.DomHandler.addClass(U.current,"p-tooltip-active")}else{var p=a.DomHandler.findCollisionPosition(i),d=tt(t,"my")||f.my||p.my,m=tt(t,"at")||f.at||p.at;U.current.style.padding="0px",a.DomHandler.flipfitCollision(U.current,t,d,m,(function(t){var e=t.at,r=e.x,n=f.at?"center"!==r&&r!==t.my.x?r:e.y:t.at["".concat(p.axis)];U.current.style.padding="",O(n),st(n),a.DomHandler.addClass(U.current,"p-tooltip-active")}))}},st=function(t){if(U.current){var e=getComputedStyle(U.current);"left"===t?U.current.style.left=parseFloat(e.left)-2*parseFloat(e.paddingLeft)+"px":"top"===t&&(U.current.style.top=parseFloat(e.top)-2*parseFloat(e.paddingTop)+"px")}},pt=function(t){V()||(W.current=!0,ut(t))},ft=function(t){if(t){var e=rt(t),r=e.showEvents,n=e.hideEvents,o=yt(t);r.forEach((function(t){return null==o?void 0:o.addEventListener(t,lt)})),n.forEach((function(t){return null==o?void 0:o.addEventListener(t,ut)}))}},dt=function(t){if(t){var e=rt(t),r=e.showEvents,n=e.hideEvents,o=yt(t);r.forEach((function(t){return null==o?void 0:o.removeEventListener(t,lt)})),n.forEach((function(t){return null==o?void 0:o.removeEventListener(t,ut)}))}},mt=function(t,e){vt();var r=tt(Z.current,t.toLowerCase())||f[t];r?B.current["".concat(t)]=setTimeout((function(){return e()}),r):e()},ht=function(t){if(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.apply(void 0,r);return void 0===o&&(o=!0),o}return!0},vt=function(){Object.values(B.current).forEach((function(t){return clearTimeout(t)}))},yt=function(t){if(t){if(Q(t)){if(!t.hasWrapper){var e=document.createElement("div");return"INPUT"===t.nodeName?a.DomHandler.addMultipleClasses(e,"p-tooltip-target-wrapper p-inputwrapper"):a.DomHandler.addClass(e,"p-tooltip-target-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t),t.hasWrapper=!0,e}return t.parentElement}var r;return t.hasWrapper&&((r=t.parentElement).replaceWith.apply(r,y(n=t.parentElement.childNodes)||b(n)||g(n)||w()),delete t.hasWrapper),t}var n;return null},bt=function(t){wt(t),gt(t)},gt=function(t){Et(t||f.target,ft)},wt=function(t){Et(t||f.target,dt)},Et=function(t,e){if(t=a.ObjectUtils.getRefElement(t))if(a.DomHandler.isElement(t))e(t);else{var r=function(t){a.DomHandler.find(document,t).forEach((function(t){e(t)}))};t instanceof Array?t.forEach((function(t){r(t)})):r(t)}};o.useMountEffect((function(){m&&Z.current&&J(Z.current)&&ut()})),o.useUpdateEffect((function(){return gt(),function(){wt()}}),[lt,ut,f.target]),o.useUpdateEffect((function(){if(m){var t=nt(Z.current),e=tt(Z.current,"classname");O(t),H(e),at(t),Y(),X()}else O(f.position||"right"),H(""),Z.current=null,_.current=null,W.current=!0;return function(){G(),$()}}),[m]),o.useUpdateEffect((function(){var t=nt(Z.current);m&&"mouse"!==t&&mt("updateDelay",(function(){it(Z.current,(function(){ct(Z.current)}))}))}),[f.content]),o.useUnmountEffect((function(){ut(),a.ZIndexUtils.clear(U.current)})),c.useImperativeHandle(e,(function(){return{props:f,updateTargetEvents:bt,loadTargetEvents:gt,unloadTargetEvents:wt,show:lt,hide:ut,getElement:function(){return U.current},getTarget:function(){return Z.current}}}));var Ot,xt,St,Tt,jt;if(m){var Dt=(Ot=Z.current,xt=!(f.content||tt(Ot,"tooltip")),St=l({id:f.id,className:a.classNames(f.className,L("root",{positionState:E,classNameState:j})),style:f.style,role:"tooltip","aria-hidden":m,onMouseEnter:function(t){V()||(W.current=!1)},onMouseLeave:function(t){return pt(t)}},T.getOtherProps(f),A("root")),Tt=l({className:L("arrow"),style:R("arrow",D({},N))},A("arrow")),jt=l({className:L("text")},A("text")),c.createElement("div",p({ref:U},St),c.createElement("div",Tt),c.createElement("div",p({ref:M},jt),xt&&f.children)));return c.createElement(i.Portal,{element:Dt,appendTo:f.appendTo,visible:!0})}return null})));return H.displayName="Tooltip",t.Tooltip=H,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.api,primereact.componentbase,primereact.hooks,primereact.portal,primereact.utils);
|
package/tree/tree.cjs.js
CHANGED
|
@@ -338,7 +338,7 @@ var CheckboxBase = componentbase.ComponentBase.extend({
|
|
|
338
338
|
|
|
339
339
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
340
340
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
341
|
-
var Checkbox = /*#__PURE__*/React__namespace.memo(
|
|
341
|
+
var Checkbox = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
342
342
|
var mergeProps = hooks.useMergeProps();
|
|
343
343
|
var context = React__namespace.useContext(api.PrimeReactContext);
|
|
344
344
|
var props = CheckboxBase.getProps(inProps, context);
|
|
@@ -593,17 +593,17 @@ var UITreeNode = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
593
593
|
}
|
|
594
594
|
return null;
|
|
595
595
|
};
|
|
596
|
-
var
|
|
596
|
+
var _findNextSiblingOfAncestor = function findNextSiblingOfAncestor(nodeElement) {
|
|
597
597
|
var parentNodeElement = getParentNodeElement(nodeElement);
|
|
598
|
-
return parentNodeElement ? findNextNonDroppointSibling(parentNodeElement) ||
|
|
598
|
+
return parentNodeElement ? findNextNonDroppointSibling(parentNodeElement) || _findNextSiblingOfAncestor(parentNodeElement) : null;
|
|
599
599
|
};
|
|
600
|
-
var
|
|
600
|
+
var _findLastVisibleDescendant = function findLastVisibleDescendant(nodeElement) {
|
|
601
601
|
var childrenListElement = nodeElement.children[1];
|
|
602
602
|
if (childrenListElement) {
|
|
603
603
|
//skip droppoint
|
|
604
604
|
var offset = props.dragdropScope ? 2 : 1;
|
|
605
605
|
var lastChildElement = childrenListElement.children[childrenListElement.children.length - offset];
|
|
606
|
-
return
|
|
606
|
+
return _findLastVisibleDescendant(lastChildElement);
|
|
607
607
|
}
|
|
608
608
|
return nodeElement;
|
|
609
609
|
};
|
|
@@ -632,7 +632,7 @@ var UITreeNode = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
632
632
|
selectionKeys = props.selectionKeys ? _objectSpread$1({}, props.selectionKeys) : {};
|
|
633
633
|
if (checked) {
|
|
634
634
|
if (props.propagateSelectionDown) {
|
|
635
|
-
|
|
635
|
+
_propagateDown(props.node, false, selectionKeys);
|
|
636
636
|
} else {
|
|
637
637
|
delete selectionKeys[props.node.key];
|
|
638
638
|
}
|
|
@@ -651,7 +651,7 @@ var UITreeNode = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
651
651
|
}
|
|
652
652
|
} else {
|
|
653
653
|
if (props.propagateSelectionDown) {
|
|
654
|
-
|
|
654
|
+
_propagateDown(props.node, true, selectionKeys);
|
|
655
655
|
} else {
|
|
656
656
|
selectionKeys[props.node.key] = {
|
|
657
657
|
checked: true
|
|
@@ -816,7 +816,7 @@ var UITreeNode = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
816
816
|
} else if (nextElement) {
|
|
817
817
|
focusRowChange(nodeElement, nextElement);
|
|
818
818
|
} else {
|
|
819
|
-
var nextSiblingAncestor =
|
|
819
|
+
var nextSiblingAncestor = _findNextSiblingOfAncestor(nodeElement);
|
|
820
820
|
if (nextSiblingAncestor) {
|
|
821
821
|
focusRowChange(nodeElement, nextSiblingAncestor);
|
|
822
822
|
}
|
|
@@ -841,7 +841,7 @@ var UITreeNode = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
841
841
|
var nodeElement = event.target;
|
|
842
842
|
var previous = getPreviousElement(nodeElement);
|
|
843
843
|
if (previous) {
|
|
844
|
-
focusRowChange(nodeElement, previous,
|
|
844
|
+
focusRowChange(nodeElement, previous, _findLastVisibleDescendant(previous));
|
|
845
845
|
} else {
|
|
846
846
|
var parentNodeElement = getParentNodeElement(nodeElement);
|
|
847
847
|
if (parentNodeElement) {
|
|
@@ -866,7 +866,7 @@ var UITreeNode = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
866
866
|
togglerElement.click();
|
|
867
867
|
return false;
|
|
868
868
|
}
|
|
869
|
-
var target =
|
|
869
|
+
var target = _findBeforeClickableNode(event.currentTarget);
|
|
870
870
|
if (target) {
|
|
871
871
|
focusRowChange(event.currentTarget, target);
|
|
872
872
|
}
|
|
@@ -912,14 +912,14 @@ var UITreeNode = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
912
912
|
currentFocusedRow.tabIndex = '0';
|
|
913
913
|
focusNode(lastVisibleDescendant || currentFocusedRow);
|
|
914
914
|
};
|
|
915
|
-
var
|
|
915
|
+
var _findBeforeClickableNode = function findBeforeClickableNode(node) {
|
|
916
916
|
var parentListElement = node.closest('ul').closest('li');
|
|
917
917
|
if (parentListElement) {
|
|
918
918
|
var prevNodeButton = utils.DomHandler.findSingle(parentListElement, 'button');
|
|
919
919
|
if (prevNodeButton && prevNodeButton.style.visibility !== 'hidden') {
|
|
920
920
|
return parentListElement;
|
|
921
921
|
}
|
|
922
|
-
return
|
|
922
|
+
return _findBeforeClickableNode(node.previousElementSibling);
|
|
923
923
|
}
|
|
924
924
|
return null;
|
|
925
925
|
};
|
|
@@ -971,7 +971,7 @@ var UITreeNode = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
971
971
|
props.onPropagateUp(event);
|
|
972
972
|
}
|
|
973
973
|
};
|
|
974
|
-
var
|
|
974
|
+
var _propagateDown = function propagateDown(node, check, selectionKeys) {
|
|
975
975
|
if (check) {
|
|
976
976
|
selectionKeys[node.key] = {
|
|
977
977
|
checked: true,
|
|
@@ -982,7 +982,7 @@ var UITreeNode = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
982
982
|
}
|
|
983
983
|
if (node.children && node.children.length) {
|
|
984
984
|
for (var i = 0; i < node.children.length; i++) {
|
|
985
|
-
|
|
985
|
+
_propagateDown(node.children[i], check, selectionKeys);
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
};
|
|
@@ -1319,7 +1319,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
1319
1319
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
1320
1320
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
1321
1321
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
1322
|
-
var Tree = /*#__PURE__*/React__namespace.memo(
|
|
1322
|
+
var Tree = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
1323
1323
|
var mergeProps = hooks.useMergeProps();
|
|
1324
1324
|
var context = React__namespace.useContext(api.PrimeReactContext);
|
|
1325
1325
|
var props = TreeBase.getProps(inProps, context);
|
|
@@ -1412,16 +1412,16 @@ var Tree = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
1412
1412
|
* Deep copy a value. If the value has a data property, it will be shallow copied.
|
|
1413
1413
|
* Values that are not plain objects or arrays are returned as-is.
|
|
1414
1414
|
*/
|
|
1415
|
-
var
|
|
1415
|
+
var _cloneValue = function cloneValue(value) {
|
|
1416
1416
|
if (Array.isArray(value)) {
|
|
1417
|
-
return value.map(
|
|
1417
|
+
return value.map(_cloneValue);
|
|
1418
1418
|
} else if (!!value && Object.getPrototypeOf(value) === Object.prototype) {
|
|
1419
1419
|
var result = {};
|
|
1420
1420
|
|
|
1421
1421
|
// Leave data property alone and clone children
|
|
1422
1422
|
for (var key in value) {
|
|
1423
1423
|
if (key !== 'data') {
|
|
1424
|
-
result[key] =
|
|
1424
|
+
result[key] = _cloneValue(value[key]);
|
|
1425
1425
|
} else {
|
|
1426
1426
|
result[key] = value[key];
|
|
1427
1427
|
}
|
|
@@ -1433,12 +1433,12 @@ var Tree = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
1433
1433
|
var onDrop = function onDrop(event) {
|
|
1434
1434
|
var _dragState$current;
|
|
1435
1435
|
if (validateDropNode((_dragState$current = dragState.current) === null || _dragState$current === void 0 ? void 0 : _dragState$current.path, event.path)) {
|
|
1436
|
-
var value =
|
|
1436
|
+
var value = _cloneValue(props.value);
|
|
1437
1437
|
var dragPaths = dragState.current.path.split('-');
|
|
1438
1438
|
dragPaths.pop();
|
|
1439
|
-
var dragNodeParent =
|
|
1439
|
+
var dragNodeParent = _findNode(value, dragPaths);
|
|
1440
1440
|
var dragNode = dragNodeParent ? dragNodeParent.children[dragState.current.index] : value[dragState.current.index];
|
|
1441
|
-
var dropNode =
|
|
1441
|
+
var dropNode = _findNode(value, event.path.split('-'));
|
|
1442
1442
|
if (dropNode.children) {
|
|
1443
1443
|
dropNode.children.push(dragNode);
|
|
1444
1444
|
} else {
|
|
@@ -1462,13 +1462,13 @@ var Tree = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
1462
1462
|
};
|
|
1463
1463
|
var onDropPoint = function onDropPoint(event) {
|
|
1464
1464
|
if (validateDropPoint(event)) {
|
|
1465
|
-
var value =
|
|
1465
|
+
var value = _cloneValue(props.value);
|
|
1466
1466
|
var dragPaths = dragState.current.path.split('-');
|
|
1467
1467
|
dragPaths.pop();
|
|
1468
1468
|
var dropPaths = event.path.split('-');
|
|
1469
1469
|
dropPaths.pop();
|
|
1470
|
-
var dragNodeParent =
|
|
1471
|
-
var dropNodeParent =
|
|
1470
|
+
var dragNodeParent = _findNode(value, dragPaths);
|
|
1471
|
+
var dropNodeParent = _findNode(value, dropPaths);
|
|
1472
1472
|
var dragNode = dragNodeParent ? dragNodeParent.children[dragState.current.index] : value[dragState.current.index];
|
|
1473
1473
|
var siblings = areSiblings(dragState.current.path, event.path);
|
|
1474
1474
|
if (dragNodeParent) {
|
|
@@ -1544,7 +1544,7 @@ var Tree = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
1544
1544
|
}
|
|
1545
1545
|
return path1.substring(0, path1.lastIndexOf('-')) === path2.substring(0, path2.lastIndexOf('-'));
|
|
1546
1546
|
};
|
|
1547
|
-
var
|
|
1547
|
+
var _findNode = function findNode(value, path) {
|
|
1548
1548
|
if (path.length === 0) {
|
|
1549
1549
|
return null;
|
|
1550
1550
|
}
|
|
@@ -1554,7 +1554,7 @@ var Tree = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
1554
1554
|
return nextSearchRoot;
|
|
1555
1555
|
}
|
|
1556
1556
|
path.shift();
|
|
1557
|
-
return
|
|
1557
|
+
return _findNode(nextSearchRoot, path);
|
|
1558
1558
|
};
|
|
1559
1559
|
var isNodeLeaf = function isNodeLeaf(node) {
|
|
1560
1560
|
return node.leaf === false ? false : !(node.children && node.children.length);
|