primereact 8.7.3 → 9.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.d.ts +168 -25
- package/api/api.cjs.js +1 -1
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +11 -3
- package/api/api.esm.js +1 -1
- package/api/api.esm.min.js +1 -1
- package/api/api.js +1 -1
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +18 -3
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +385 -80
- package/autocomplete/autocomplete.esm.js +18 -3
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +18 -3
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.d.ts +77 -15
- package/avatargroup/avatargroup.d.ts +33 -1
- package/badge/badge.d.ts +48 -8
- package/blockui/blockui.d.ts +71 -10
- package/breadcrumb/breadcrumb.d.ts +41 -3
- package/button/button.d.ts +67 -15
- package/calendar/calendar.cjs.js +18 -5
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +585 -112
- package/calendar/calendar.esm.js +18 -5
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +18 -5
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +7 -6
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.d.ts +77 -7
- package/captcha/captcha.esm.js +7 -6
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +7 -6
- package/captcha/captcha.min.js +1 -1
- package/card/card.d.ts +45 -7
- package/carousel/carousel.d.ts +138 -22
- package/cascadeselect/cascadeselect.cjs.js +7 -1
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +177 -29
- package/cascadeselect/cascadeselect.esm.js +7 -1
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +7 -1
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.d.ts +88 -10
- package/checkbox/checkbox.cjs.js +5 -1
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +137 -33
- package/checkbox/checkbox.esm.js +6 -2
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +5 -1
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.d.ts +75 -7
- package/chips/chips.cjs.js +11 -8
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +188 -36
- package/chips/chips.esm.js +11 -8
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +11 -8
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +6 -1
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +148 -31
- package/colorpicker/colorpicker.esm.js +6 -1
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +6 -1
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.d.ts +736 -134
- package/columngroup/columngroup.d.ts +30 -1
- package/confirmdialog/confirmdialog.d.ts +142 -18
- package/confirmpopup/confirmpopup.cjs.js +5 -2
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +165 -22
- package/confirmpopup/confirmpopup.esm.js +5 -2
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +5 -2
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +4 -1
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +79 -11
- package/contextmenu/contextmenu.esm.js +4 -1
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +4 -1
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +85 -78
- package/core/core.min.js +7 -7
- package/csstransition/csstransition.d.ts +31 -1
- package/datascroller/datascroller.d.ts +102 -16
- package/datatable/datatable.cjs.js +27 -15
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +1257 -229
- package/datatable/datatable.esm.js +27 -15
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +27 -15
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.d.ts +222 -43
- package/deferredcontent/deferredcontent.d.ts +37 -1
- package/dialog/dialog.cjs.js +13 -19
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +282 -51
- package/dialog/dialog.esm.js +14 -20
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +13 -19
- package/dialog/dialog.min.css +1 -1
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.d.ts +47 -10
- package/dock/dock.d.ts +68 -12
- package/dropdown/dropdown.cjs.js +27 -11
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +337 -83
- package/dropdown/dropdown.esm.js +28 -12
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +27 -11
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.d.ts +129 -12
- package/fieldset/fieldset.d.ts +85 -7
- package/fileupload/fileupload.cjs.js +4 -0
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +425 -62
- package/fileupload/fileupload.esm.js +4 -0
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +4 -0
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +3 -1
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +198 -30
- package/galleria/galleria.esm.js +3 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +3 -1
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.d.ts +91 -5
- package/hooks/hooks.cjs.js +1 -2
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +114 -7
- package/hooks/hooks.esm.js +1 -2
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +1 -2
- package/hooks/hooks.min.js +1 -1
- package/image/image.d.ts +91 -11
- package/inplace/inplace.d.ts +101 -9
- package/inputmask/inputmask.cjs.js +6 -5
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +119 -27
- package/inputmask/inputmask.esm.js +7 -6
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +6 -5
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +11 -33
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +265 -57
- package/inputnumber/inputnumber.esm.js +12 -34
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +11 -33
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +4 -1
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.d.ts +118 -27
- package/inputswitch/inputswitch.esm.js +5 -2
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +4 -1
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.d.ts +57 -6
- package/inputtextarea/inputtextarea.d.ts +52 -6
- package/keyfilter/keyfilteroptions.d.ts +15 -0
- package/knob/knob.d.ts +127 -20
- package/listbox/listbox.cjs.js +3 -0
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +270 -48
- package/listbox/listbox.esm.js +3 -0
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +3 -0
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.d.ts +50 -11
- package/mention/mention.cjs.js +3 -0
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +186 -32
- package/mention/mention.esm.js +3 -0
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +3 -0
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +3 -1
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +89 -12
- package/menu/menu.esm.js +3 -1
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +3 -1
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.d.ts +53 -8
- package/menuitem/menuitem.d.ts +114 -19
- package/message/message.d.ts +50 -11
- package/messages/messages.d.ts +91 -11
- package/multiselect/multiselect.cjs.js +11 -2
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +429 -82
- package/multiselect/multiselect.esm.js +12 -3
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +11 -2
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +3 -0
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +157 -22
- package/multistatecheckbox/multistatecheckbox.esm.js +4 -1
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +3 -0
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.d.ts +113 -16
- package/organizationchart/organizationchart.d.ts +107 -16
- package/overlaypanel/overlaypanel.cjs.js +4 -1
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +89 -15
- package/overlaypanel/overlaypanel.esm.js +4 -1
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +4 -1
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/overlayservice/overlayservice.d.ts +52 -7
- package/package.json +2 -2
- package/paginator/paginator.d.ts +409 -44
- package/panel/panel.d.ts +142 -16
- package/panelmenu/panelmenu.d.ts +46 -4
- package/password/password.cjs.js +7 -1
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +176 -36
- package/password/password.esm.js +7 -1
- package/password/password.esm.min.js +1 -1
- package/password/password.js +7 -1
- package/password/password.min.css +1 -1
- package/password/password.min.js +1 -1
- package/picklist/picklist.d.ts +272 -46
- package/primereact.all.cjs.js +305 -158
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +305 -158
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +305 -158
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.d.ts +60 -11
- package/progressspinner/progressspinner.d.ts +47 -4
- package/radiobutton/radiobutton.cjs.js +5 -1
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.d.ts +99 -29
- package/radiobutton/radiobutton.esm.js +5 -1
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +5 -1
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.d.ts +101 -24
- package/resources/primereact.css +74 -63
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +5 -9
- package/resources/themes/arya-green/theme.css +4 -10
- package/resources/themes/arya-orange/theme.css +4 -9
- package/resources/themes/arya-purple/theme.css +4 -9
- package/resources/themes/bootstrap4-dark-blue/theme.css +4 -9
- package/resources/themes/bootstrap4-dark-purple/theme.css +4 -9
- package/resources/themes/bootstrap4-light-blue/theme.css +4 -9
- package/resources/themes/bootstrap4-light-purple/theme.css +4 -10
- package/resources/themes/fluent-light/theme.css +4 -10
- package/resources/themes/lara-dark-blue/theme.css +4 -9
- package/resources/themes/lara-dark-indigo/theme.css +4 -10
- package/resources/themes/lara-dark-purple/theme.css +4 -9
- package/resources/themes/lara-dark-teal/theme.css +4 -10
- package/resources/themes/lara-light-blue/theme.css +4 -9
- package/resources/themes/lara-light-indigo/theme.css +4 -9
- package/resources/themes/lara-light-purple/theme.css +4 -9
- package/resources/themes/lara-light-teal/theme.css +4 -9
- package/resources/themes/luna-amber/theme.css +5 -9
- package/resources/themes/luna-blue/theme.css +4 -9
- package/resources/themes/luna-green/theme.css +5 -9
- package/resources/themes/luna-pink/theme.css +4 -9
- package/resources/themes/md-dark-deeppurple/theme.css +4 -9
- package/resources/themes/md-dark-indigo/theme.css +5 -9
- package/resources/themes/md-light-deeppurple/theme.css +5 -9
- package/resources/themes/md-light-indigo/theme.css +5 -9
- package/resources/themes/mdc-dark-deeppurple/theme.css +5 -9
- package/resources/themes/mdc-dark-indigo/theme.css +4 -9
- package/resources/themes/mdc-light-deeppurple/theme.css +5 -9
- package/resources/themes/mdc-light-indigo/theme.css +4 -9
- package/resources/themes/mira/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/mira/theme.css +6237 -0
- package/resources/themes/nano/theme.css +6009 -0
- package/resources/themes/nova/theme.css +4 -9
- package/resources/themes/nova-accent/theme.css +5 -9
- package/resources/themes/nova-alt/theme.css +4 -9
- package/resources/themes/rhea/theme.css +5 -9
- package/resources/themes/saga-blue/theme.css +4 -9
- package/resources/themes/saga-green/theme.css +5 -9
- package/resources/themes/saga-orange/theme.css +5 -9
- package/resources/themes/saga-purple/theme.css +5 -9
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-dark/theme.css +6002 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-light/theme.css +6056 -0
- package/resources/themes/vela-blue/theme.css +4 -9
- package/resources/themes/vela-green/theme.css +4 -9
- package/resources/themes/vela-orange/theme.css +4 -9
- package/resources/themes/vela-purple/theme.css +5 -9
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-dark/theme.css +6164 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-light/theme.css +6164 -0
- package/ripple/ripple.d.ts +29 -1
- package/row/row.d.ts +37 -3
- package/scrollpanel/scrollpanel.d.ts +45 -1
- package/scrolltop/scrolltop.d.ts +70 -10
- package/selectbutton/selectbutton.cjs.js +3 -0
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.d.ts +111 -32
- package/selectbutton/selectbutton.esm.js +4 -1
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +3 -0
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +34 -0
- package/sidebar/sidebar.cjs.js +13 -1
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +120 -22
- package/sidebar/sidebar.esm.js +13 -1
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +13 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.d.ts +61 -11
- package/slidemenu/slidemenu.d.ts +132 -18
- package/slider/slider.d.ts +101 -18
- package/speeddial/speeddial.d.ts +149 -20
- package/splitbutton/splitbutton.cjs.js +3 -2
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +131 -23
- package/splitbutton/splitbutton.esm.js +3 -2
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +3 -2
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.d.ts +98 -12
- package/steps/steps.d.ts +67 -6
- package/styleclass/styleclass.d.ts +77 -12
- package/tabmenu/tabmenu.d.ts +62 -5
- package/tabview/tabview.cjs.js +1 -1
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +213 -27
- package/tabview/tabview.esm.js +1 -1
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.d.ts +50 -6
- package/terminal/terminal.cjs.js +3 -0
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.d.ts +45 -3
- package/terminal/terminal.esm.js +4 -1
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +3 -0
- package/terminal/terminal.min.js +1 -1
- package/terminalservice/terminalservice.d.ts +42 -4
- package/tieredmenu/tieredmenu.cjs.js +3 -1
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +77 -12
- package/tieredmenu/tieredmenu.esm.js +3 -1
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +3 -1
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +6 -10
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.d.ts +62 -13
- package/timeline/timeline.esm.js +6 -10
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +6 -10
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +4 -1
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +134 -27
- package/toast/toast.esm.js +4 -1
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +4 -1
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +4 -1
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +122 -15
- package/togglebutton/togglebutton.esm.js +5 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +4 -1
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +13 -7
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.d.ts +55 -5
- package/toolbar/toolbar.esm.js +13 -7
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +13 -7
- package/toolbar/toolbar.min.css +1 -1
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.d.ts +73 -9
- package/tooltip/tooltipoptions.d.ts +350 -31
- package/tree/tree.d.ts +435 -71
- package/treenode/treenode.d.ts +62 -13
- package/treeselect/treeselect.cjs.js +7 -1
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +326 -77
- package/treeselect/treeselect.esm.js +8 -2
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +7 -1
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +3 -1
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +501 -112
- package/treetable/treetable.esm.js +3 -1
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +3 -1
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +3 -0
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.d.ts +72 -20
- package/tristatecheckbox/tristatecheckbox.esm.js +4 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +3 -0
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/ts-helpers.d.ts +24 -0
- package/utils/utils.cjs.js +27 -11
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +8 -1
- package/utils/utils.esm.js +27 -11
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +27 -11
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.d.ts +351 -59
- package/web-types.json +22 -4
package/gmap/gmap.d.ts
CHANGED
|
@@ -1,26 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* GMap component provides integration with Google Maps API. This sample demontrates various uses cases like binding, overlays and events. Click the map to add a new item.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/gmap/)
|
|
6
|
+
*
|
|
7
|
+
* @module gmap
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
|
|
3
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Custom click event.
|
|
14
|
+
* @see {@link GMapProps.onOverlayClick}
|
|
15
|
+
* @event
|
|
16
|
+
*/
|
|
17
|
+
interface GMapEvent {
|
|
18
|
+
/**
|
|
19
|
+
* Google Maps mouse event
|
|
20
|
+
*/
|
|
4
21
|
originalEvent: React.SyntheticEvent;
|
|
22
|
+
/**
|
|
23
|
+
* Clicked overlay
|
|
24
|
+
*/
|
|
5
25
|
overlay: any;
|
|
26
|
+
/**
|
|
27
|
+
* Map instance
|
|
28
|
+
*/
|
|
6
29
|
map: any;
|
|
7
30
|
}
|
|
8
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Defines valid properties in GMap component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
34
|
+
* @group Properties
|
|
35
|
+
*/
|
|
9
36
|
export interface GMapProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
|
|
10
|
-
|
|
11
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Google Maps API configuration object.
|
|
39
|
+
*/
|
|
40
|
+
options?: object | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* An array of overlays to display.
|
|
43
|
+
*/
|
|
44
|
+
overlays?: any[] | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Callback to invoke when the map is ready to be used.
|
|
47
|
+
* @param {*} map - Google Maps instance
|
|
48
|
+
*/
|
|
12
49
|
onMapReady?(map: any): void;
|
|
50
|
+
/**
|
|
51
|
+
* Callback to invoke when map is clicked except markers.
|
|
52
|
+
* @param {React.SyntheticEvent} event - Mouse event.
|
|
53
|
+
*/
|
|
13
54
|
onMapClick?(event: React.SyntheticEvent): void;
|
|
55
|
+
/**
|
|
56
|
+
* Callback to invoke when the map is ready to be used.
|
|
57
|
+
*/
|
|
14
58
|
onMapDragEnd?(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Callback to invoke when zoom level has changed.
|
|
61
|
+
*/
|
|
15
62
|
onZoomChanged?(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Callback to invoke when an overlay drag starts.
|
|
65
|
+
* @param {React.SyntheticEvent} event - Google Maps mouse event.
|
|
66
|
+
*/
|
|
16
67
|
onOverlayDragStart?(event: React.SyntheticEvent): void;
|
|
68
|
+
/**
|
|
69
|
+
* Callback to invoke when an overlay is being dragged.
|
|
70
|
+
* @param {React.SyntheticEvent} event - Google Maps mouse event.
|
|
71
|
+
*/
|
|
17
72
|
onOverlayDrag?(event: React.SyntheticEvent): void;
|
|
73
|
+
/**
|
|
74
|
+
* Callback to invoke when an overlay drag ends.
|
|
75
|
+
* @param {React.SyntheticEvent} event - Google Maps mouse event.
|
|
76
|
+
*/
|
|
18
77
|
onOverlayDragEnd?(event: React.SyntheticEvent): void;
|
|
19
|
-
|
|
20
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Callback to invoke when an overlay is clicked.
|
|
80
|
+
* @param {GMapEvent} event - Custom click event.
|
|
81
|
+
*/
|
|
82
|
+
onOverlayClick?(event: GMapEvent): void;
|
|
83
|
+
/**
|
|
84
|
+
* Used to get the child elements of the component.
|
|
85
|
+
* @readonly
|
|
86
|
+
*/
|
|
87
|
+
children?: React.ReactNode | undefined;
|
|
21
88
|
}
|
|
22
89
|
|
|
90
|
+
/**
|
|
91
|
+
* **PrimeReact - GMap**
|
|
92
|
+
*
|
|
93
|
+
* _GMap component provides integration with Google Maps API. This sample demontrates various uses cases like binding, overlays and events. Click the map to add a new item._
|
|
94
|
+
*
|
|
95
|
+
* [Live Demo](https://www.primefaces.org/primereact/gmap/)
|
|
96
|
+
* --- ---
|
|
97
|
+
* 
|
|
98
|
+
*
|
|
99
|
+
* @group Component
|
|
100
|
+
*/
|
|
23
101
|
export declare class GMap extends React.Component<GMapProps, any> {
|
|
102
|
+
/**
|
|
103
|
+
* Used to get map instance
|
|
104
|
+
* @return {*} Map instance
|
|
105
|
+
*/
|
|
24
106
|
public getMap(): any;
|
|
107
|
+
/**
|
|
108
|
+
* Used to get container element.
|
|
109
|
+
* @return {HTMLDivElement} Container element
|
|
110
|
+
*/
|
|
25
111
|
public getElement(): HTMLDivElement;
|
|
26
112
|
}
|
package/hooks/hooks.cjs.js
CHANGED
|
@@ -276,7 +276,7 @@ var useOverlayListener = function useOverlayListener(_ref) {
|
|
|
276
276
|
bindWindowResizeListener = _useResizeListener2[0],
|
|
277
277
|
unbindWindowResizeListener = _useResizeListener2[1];
|
|
278
278
|
var _useOverlayScrollList = useOverlayScrollListener({
|
|
279
|
-
target:
|
|
279
|
+
target: target,
|
|
280
280
|
listener: function listener(event) {
|
|
281
281
|
_listener && _listener(event, {
|
|
282
282
|
type: 'scroll',
|
|
@@ -311,7 +311,6 @@ var useOverlayListener = function useOverlayListener(_ref) {
|
|
|
311
311
|
}, [target, overlay, when]);
|
|
312
312
|
React__namespace.useEffect(function () {
|
|
313
313
|
unbind();
|
|
314
|
-
// when && bind();
|
|
315
314
|
}, [when]);
|
|
316
315
|
useUnmountEffect(function () {
|
|
317
316
|
unbind();
|
package/hooks/hooks.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils");function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),u=function(e){var t=n.useRef(void 0);return n.useEffect((function(){t.current=e})),t.current},o=function(e){return n.useEffect((function(){return e}),[])},c=function(e){var r=e.target,c=void 0===r?"document":r,i=e.type,l=e.listener,f=e.options,a=e.when,s=void 0===a||a,v=n.useRef(null),d=n.useRef(null),g=u(f),p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.ObjectUtils.isNotEmpty(e.target)&&(m(),(e.when||s)&&(v.current=t.DomHandler.getTargetElement(e.target))),!d.current&&v.current&&(d.current=function(e){return l&&l(e)},v.current.addEventListener(i,d.current,f))},m=function(){d.current&&(v.current.removeEventListener(i,d.current,f),d.current=null)};return n.useEffect((function(){s?v.current=t.DomHandler.getTargetElement(c):(m(),v.current=null)}),[c,s]),n.useEffect((function(){!d.current||d.current===l&&g===f||(m(),s&&p())}),[l,f]),o((function(){m()})),[p,m]};function i(e){if(Array.isArray(e))return e}function l(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,u,o,c,i=[],l=!0,f=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){f=!0,u=e}finally{try{if(!l&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(f)throw u}}return i}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e,t){return i(e)||l(e,t)||a(e,t)||s()}var d=function(e){var r=e.target,c=e.listener,i=e.options,l=e.when,f=void 0===l||l,a=n.useRef(null),s=n.useRef(null),v=n.useRef([]),d=u(i),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.ObjectUtils.isNotEmpty(e.target)&&(p(),(e.when||f)&&(a.current=t.DomHandler.getTargetElement(e.target))),!s.current&&a.current){var r=v.current=t.DomHandler.getScrollableParents(a.current);s.current=function(e){return c&&c(e)},r.forEach((function(e){return e.addEventListener("scroll",s.current,i)}))}},p=function(){s.current&&(v.current.forEach((function(e){return e.removeEventListener("scroll",s.current,i)})),s.current=null)};return n.useEffect((function(){f?a.current=t.DomHandler.getTargetElement(r):(p(),a.current=null)}),[r,f]),n.useEffect((function(){!s.current||s.current===c&&d===i||(p(),f&&g())}),[c,i]),o((function(){p()})),[g,p]},g=function(e){return c({target:"window",type:"resize",listener:e.listener})},p=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",u="undefined"!=typeof window,o=c({target:"window",type:"storage",listener:function(e){var n="local"===r?window.localStorage:window.sessionStorage;e.storageArea===n&&e.key===t&&g(e.newValue||void 0)}}),i=v(o,2),l=i[0],f=i[1],a=n.useState((function(){if(!u)return e;try{var n="local"===r?window.localStorage.getItem(t):window.sessionStorage.getItem(t);return n?JSON.parse(n):e}catch(t){return e}})),s=v(a,2),d=s[0],g=s[1],p=function(e){try{var n=e instanceof Function?e(d):e;if(g(n),u){var o=JSON.stringify(n);"local"===r?window.localStorage.setItem(t,o):window.sessionStorage.setItem(t,o)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(t))}};return n.useEffect((function(){return l(),function(){return f()}}),[]),[d,p]};exports.useEventListener=c,exports.useInterval=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=n.useRef(null),c=n.useRef(null),i=n.useCallback((function(){return clearInterval(u.current)}),[u.current]);return n.useEffect((function(){c.current=e})),n.useEffect((function(){if(r)return u.current=setInterval((function(){c.current()}),t),i;i()}),[t,r]),o((function(){i()})),[i]},exports.useLocalStorage=function(e,t){return p(e,t,"local")},exports.useMountEffect=function(e){return n.useEffect(e,[])},exports.useOverlayListener=function(e){var r=e.target,u=e.overlay,i=e.listener,l=e.when,f=void 0===l||l,a=n.useRef(null),s=n.useRef(null),p=v(c({type:"click",listener:function(e){i&&i(e,{type:"outside",valid:3!==e.which&&x(e)})}}),2),m=p[0],y=p[1],E=v(g({listener:function(e){i&&i(e,{type:"resize",valid:!t.DomHandler.isTouchDevice()})}}),2),w=E[0],h=E[1],b=v(d({target:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils");function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),u=function(e){var t=n.useRef(void 0);return n.useEffect((function(){t.current=e})),t.current},o=function(e){return n.useEffect((function(){return e}),[])},c=function(e){var r=e.target,c=void 0===r?"document":r,i=e.type,l=e.listener,f=e.options,a=e.when,s=void 0===a||a,v=n.useRef(null),d=n.useRef(null),g=u(f),p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.ObjectUtils.isNotEmpty(e.target)&&(m(),(e.when||s)&&(v.current=t.DomHandler.getTargetElement(e.target))),!d.current&&v.current&&(d.current=function(e){return l&&l(e)},v.current.addEventListener(i,d.current,f))},m=function(){d.current&&(v.current.removeEventListener(i,d.current,f),d.current=null)};return n.useEffect((function(){s?v.current=t.DomHandler.getTargetElement(c):(m(),v.current=null)}),[c,s]),n.useEffect((function(){!d.current||d.current===l&&g===f||(m(),s&&p())}),[l,f]),o((function(){m()})),[p,m]};function i(e){if(Array.isArray(e))return e}function l(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,u,o,c,i=[],l=!0,f=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){f=!0,u=e}finally{try{if(!l&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(f)throw u}}return i}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e,t){return i(e)||l(e,t)||a(e,t)||s()}var d=function(e){var r=e.target,c=e.listener,i=e.options,l=e.when,f=void 0===l||l,a=n.useRef(null),s=n.useRef(null),v=n.useRef([]),d=u(i),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.ObjectUtils.isNotEmpty(e.target)&&(p(),(e.when||f)&&(a.current=t.DomHandler.getTargetElement(e.target))),!s.current&&a.current){var r=v.current=t.DomHandler.getScrollableParents(a.current);s.current=function(e){return c&&c(e)},r.forEach((function(e){return e.addEventListener("scroll",s.current,i)}))}},p=function(){s.current&&(v.current.forEach((function(e){return e.removeEventListener("scroll",s.current,i)})),s.current=null)};return n.useEffect((function(){f?a.current=t.DomHandler.getTargetElement(r):(p(),a.current=null)}),[r,f]),n.useEffect((function(){!s.current||s.current===c&&d===i||(p(),f&&g())}),[c,i]),o((function(){p()})),[g,p]},g=function(e){return c({target:"window",type:"resize",listener:e.listener})},p=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",u="undefined"!=typeof window,o=c({target:"window",type:"storage",listener:function(e){var n="local"===r?window.localStorage:window.sessionStorage;e.storageArea===n&&e.key===t&&g(e.newValue||void 0)}}),i=v(o,2),l=i[0],f=i[1],a=n.useState((function(){if(!u)return e;try{var n="local"===r?window.localStorage.getItem(t):window.sessionStorage.getItem(t);return n?JSON.parse(n):e}catch(t){return e}})),s=v(a,2),d=s[0],g=s[1],p=function(e){try{var n=e instanceof Function?e(d):e;if(g(n),u){var o=JSON.stringify(n);"local"===r?window.localStorage.setItem(t,o):window.sessionStorage.setItem(t,o)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(t))}};return n.useEffect((function(){return l(),function(){return f()}}),[]),[d,p]};exports.useEventListener=c,exports.useInterval=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=n.useRef(null),c=n.useRef(null),i=n.useCallback((function(){return clearInterval(u.current)}),[u.current]);return n.useEffect((function(){c.current=e})),n.useEffect((function(){if(r)return u.current=setInterval((function(){c.current()}),t),i;i()}),[t,r]),o((function(){i()})),[i]},exports.useLocalStorage=function(e,t){return p(e,t,"local")},exports.useMountEffect=function(e){return n.useEffect(e,[])},exports.useOverlayListener=function(e){var r=e.target,u=e.overlay,i=e.listener,l=e.when,f=void 0===l||l,a=n.useRef(null),s=n.useRef(null),p=v(c({type:"click",listener:function(e){i&&i(e,{type:"outside",valid:3!==e.which&&x(e)})}}),2),m=p[0],y=p[1],E=v(g({listener:function(e){i&&i(e,{type:"resize",valid:!t.DomHandler.isTouchDevice()})}}),2),w=E[0],h=E[1],b=v(d({target:r,listener:function(e){i&&i(e,{type:"scroll",valid:!0})}}),2),S=b[0],O=b[1],x=function(e){return a.current&&!(a.current.isSameNode(e.target)||a.current.contains(e.target)||s.current&&s.current.contains(e.target))},R=function(){y(),h(),O()};return n.useEffect((function(){f?(a.current=t.DomHandler.getTargetElement(r),s.current=t.DomHandler.getTargetElement(u)):(R(),a.current=s.current=null)}),[r,u,f]),n.useEffect((function(){R()}),[f]),o((function(){R()})),[function(){m(),w(),S()},R]},exports.useOverlayScrollListener=d,exports.usePrevious=u,exports.useResizeListener=g,exports.useSessionStorage=function(e,t){return p(e,t,"session")},exports.useStorage=p,exports.useTimeout=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=n.useRef(null),c=n.useRef(null),i=n.useCallback((function(){return clearTimeout(u.current)}),[u.current]);return n.useEffect((function(){c.current=e})),n.useEffect((function(){if(r)return u.current=setTimeout((function(){c.current()}),t),i;i()}),[t,r]),o((function(){i()})),[i]},exports.useUnmountEffect=o,exports.useUpdateEffect=function(e,t){var r=n.useRef(!1);return n.useEffect((function(){if(r.current)return e&&e();r.current=!0}),t)};
|
package/hooks/hooks.d.ts
CHANGED
|
@@ -1,37 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* The module includes custom hook methods to create shorthands for users.
|
|
4
|
+
*
|
|
5
|
+
* @module hooks
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
1
8
|
import * as React from 'react';
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Custom event options.
|
|
12
|
+
* @group Misc
|
|
13
|
+
*/
|
|
6
14
|
interface EventOptions {
|
|
7
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The target element to listen to.
|
|
17
|
+
*/
|
|
18
|
+
target?: 'document' | 'window' | React.Ref<HTMLElement>;
|
|
19
|
+
/**
|
|
20
|
+
* The event type to listen to.
|
|
21
|
+
*/
|
|
8
22
|
type?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The event listener.
|
|
25
|
+
*/
|
|
9
26
|
listener?(event: Event): void;
|
|
27
|
+
/**
|
|
28
|
+
* The event options.
|
|
29
|
+
*/
|
|
10
30
|
options?: any;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to listen to the event or not.
|
|
33
|
+
*/
|
|
11
34
|
when?: boolean;
|
|
12
35
|
}
|
|
13
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Custom overlay event options.
|
|
39
|
+
* @group Misc
|
|
40
|
+
*/
|
|
14
41
|
interface OverlayEventOptions {
|
|
15
|
-
|
|
16
|
-
|
|
42
|
+
/**
|
|
43
|
+
* The target element to listen to.
|
|
44
|
+
*/
|
|
45
|
+
target?: 'document' | 'window' | React.Ref<HTMLElement> | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The overlay element to listen to.
|
|
48
|
+
*/
|
|
49
|
+
overlay?: 'document' | 'window' | React.Ref<HTMLElement> | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The event listener.
|
|
52
|
+
*/
|
|
17
53
|
listener?(event: Event, type?: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Whether to listen to the event or not.
|
|
56
|
+
*/
|
|
18
57
|
when?: boolean;
|
|
19
58
|
}
|
|
20
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Custom resize event options.
|
|
62
|
+
* @group Misc
|
|
63
|
+
*/
|
|
21
64
|
interface ResizeEventOptions {
|
|
65
|
+
/**
|
|
66
|
+
* The event listener.
|
|
67
|
+
* @param {Event} event - The browser event object.
|
|
68
|
+
*/
|
|
22
69
|
listener?(event: Event): void;
|
|
23
70
|
}
|
|
24
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Custom hook to get the previous value of a property.
|
|
74
|
+
* @param {*} value - The value to compare.
|
|
75
|
+
*/
|
|
25
76
|
export declare function usePrevious(value: any): any;
|
|
77
|
+
/**
|
|
78
|
+
* Custom hook to run a mount effect only once.
|
|
79
|
+
* @param {React.EffectCallback} effect - The effect to run.
|
|
80
|
+
*/
|
|
26
81
|
export declare function useMountEffect(effect: React.EffectCallback): void;
|
|
82
|
+
/**
|
|
83
|
+
* Custom hook to run an update effect.
|
|
84
|
+
* @param {React.EffectCallback} effect - The effect to run.
|
|
85
|
+
* @param {React.DependencyList} deps - The dependencies.
|
|
86
|
+
*/
|
|
27
87
|
export declare function useUpdateEffect(effect: React.EffectCallback, deps?: React.DependencyList): void;
|
|
88
|
+
/**
|
|
89
|
+
* Custom hook to run an unmount effect.
|
|
90
|
+
* @param {React.EffectCallback} effect - The effect to run.
|
|
91
|
+
*/
|
|
28
92
|
export declare function useUnmountEffect(effect: React.EffectCallback): void;
|
|
93
|
+
/**
|
|
94
|
+
* Custom hook to listen to an event.
|
|
95
|
+
* @param {EventOptions} options - The event options.
|
|
96
|
+
*/
|
|
29
97
|
export declare function useEventListener(options: EventOptions): any[];
|
|
98
|
+
/**
|
|
99
|
+
* Custom hook to listen to overlay event. It can be used when an overlay is desired to behave like the overlays in PrimeReact.
|
|
100
|
+
* @param {OverlayEventOptions} options - The event options.
|
|
101
|
+
*/
|
|
30
102
|
export declare function useOverlayListener(options: OverlayEventOptions): any[];
|
|
103
|
+
/**
|
|
104
|
+
* Custom hook to listen to overlay scroll. It can be used when an overlay is desired to behave like the overlays in PrimeReact.
|
|
105
|
+
* @param {EventOptions} options - The event options.
|
|
106
|
+
*/
|
|
31
107
|
export declare function useOverlayScrollListener(options: EventOptions): any[];
|
|
108
|
+
/**
|
|
109
|
+
* Custom hook to listen to a resize event.
|
|
110
|
+
* @param {ResizeEventOptions} options - The event options.
|
|
111
|
+
*/
|
|
32
112
|
export declare function useResizeListener(options: ResizeEventOptions): any[];
|
|
113
|
+
/**
|
|
114
|
+
* Custom hook to use an interval.
|
|
115
|
+
* @param {*} fn - The function that will be executed after the delay.
|
|
116
|
+
* @param {number} delay - Delay in milliseconds.
|
|
117
|
+
* @param {boolean} when - Whether to listen to the event or not.
|
|
118
|
+
*/
|
|
33
119
|
export declare function useInterval(fn: any, delay?: number, when?: boolean): any[];
|
|
120
|
+
/**
|
|
121
|
+
* Custom hook to use a timeout.
|
|
122
|
+
* @param {*} fn - The function that will be executed after the delay.
|
|
123
|
+
* @param {number} delay - Delay in milliseconds.
|
|
124
|
+
* @param {boolean} when - Whether to listen to the event or not.
|
|
125
|
+
*/
|
|
34
126
|
export declare function useTimeout(fn: any, delay?: number, when?: boolean): any[];
|
|
35
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Custom hook to use storage such as local and session storage.
|
|
129
|
+
* @param {*} initialValue - The initial value.
|
|
130
|
+
* @param {string} key - The key to store the value.
|
|
131
|
+
* @param {string} storage - The storage type. Valid values are 'local' and 'session'.
|
|
132
|
+
*/
|
|
133
|
+
export declare function useStorage<S, K extends string = string>(initialValue: S, key: K, storage?: 'local' | 'session'): [S, React.Dispatch<React.SetStateAction<S>>];
|
|
134
|
+
/**
|
|
135
|
+
* Custom hook to use local storage.
|
|
136
|
+
* @param {*} initialValue - The initial value.
|
|
137
|
+
* @param {string} key - The key to store the value in local storage.
|
|
138
|
+
*/
|
|
36
139
|
export declare function useLocalStorage<S, K extends string = string>(initialValue: S, key: K): [S, React.Dispatch<React.SetStateAction<S>>];
|
|
140
|
+
/**
|
|
141
|
+
* Custom hook to use session storage.
|
|
142
|
+
* @param {*} initialValue - The initial value.
|
|
143
|
+
* @param {string} key - The key to store the value in session storage. */
|
|
37
144
|
export declare function useSessionStorage<S, K extends string = string>(initialValue: S, key: K): [S, React.Dispatch<React.SetStateAction<S>>];
|
package/hooks/hooks.esm.js
CHANGED
|
@@ -252,7 +252,7 @@ var useOverlayListener = function useOverlayListener(_ref) {
|
|
|
252
252
|
bindWindowResizeListener = _useResizeListener2[0],
|
|
253
253
|
unbindWindowResizeListener = _useResizeListener2[1];
|
|
254
254
|
var _useOverlayScrollList = useOverlayScrollListener({
|
|
255
|
-
target:
|
|
255
|
+
target: target,
|
|
256
256
|
listener: function listener(event) {
|
|
257
257
|
_listener && _listener(event, {
|
|
258
258
|
type: 'scroll',
|
|
@@ -287,7 +287,6 @@ var useOverlayListener = function useOverlayListener(_ref) {
|
|
|
287
287
|
}, [target, overlay, when]);
|
|
288
288
|
React.useEffect(function () {
|
|
289
289
|
unbind();
|
|
290
|
-
// when && bind();
|
|
291
290
|
}, [when]);
|
|
292
291
|
useUnmountEffect(function () {
|
|
293
292
|
unbind();
|
package/hooks/hooks.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{DomHandler as t,ObjectUtils as n}from"primereact/utils";var r=function(t){var n=e.useRef(void 0);return e.useEffect((function(){n.current=t})),n.current},u=function(t){return e.useEffect(t,[])},c=function(t,n){var r=e.useRef(!1);return e.useEffect((function(){if(r.current)return t&&t();r.current=!0}),n)},o=function(t){return e.useEffect((function(){return t}),[])},i=function(u){var c=u.target,i=void 0===c?"document":c,f=u.type,l=u.listener,a=u.options,s=u.when,v=void 0===s||s,g=e.useRef(null),d=e.useRef(null),m=r(a),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.isNotEmpty(e.target)&&(w(),(e.when||v)&&(g.current=t.getTargetElement(e.target))),!d.current&&g.current&&(d.current=function(e){return l&&l(e)},g.current.addEventListener(f,d.current,a))},w=function(){d.current&&(g.current.removeEventListener(f,d.current,a),d.current=null)};return e.useEffect((function(){v?g.current=t.getTargetElement(i):(w(),g.current=null)}),[i,v]),e.useEffect((function(){!d.current||d.current===l&&m===a||(w(),v&&y())}),[l,a]),o((function(){w()})),[y,w]};function f(e){if(Array.isArray(e))return e}function l(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,c,o,i=[],f=!0,l=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=c.call(n)).done)&&(i.push(r.value),i.length!==t);f=!0);}catch(e){l=!0,u=e}finally{try{if(!f&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw u}}return i}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function v(){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 g(e,t){return f(e)||l(e,t)||s(e,t)||v()}var d=function(u){var c=u.target,i=u.listener,f=u.options,l=u.when,a=void 0===l||l,s=e.useRef(null),v=e.useRef(null),g=e.useRef([]),d=r(f),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.isNotEmpty(e.target)&&(y(),(e.when||a)&&(s.current=t.getTargetElement(e.target))),!v.current&&s.current){var r=g.current=t.getScrollableParents(s.current);v.current=function(e){return i&&i(e)},r.forEach((function(e){return e.addEventListener("scroll",v.current,f)}))}},y=function(){v.current&&(g.current.forEach((function(e){return e.removeEventListener("scroll",v.current,f)})),v.current=null)};return e.useEffect((function(){a?s.current=t.getTargetElement(c):(y(),s.current=null)}),[c,a]),e.useEffect((function(){!v.current||v.current===i&&d===f||(y(),a&&m())}),[i,f]),o((function(){y()})),[m,y]},m=function(e){return i({target:"window",type:"resize",listener:e.listener})},y=function(n){var r=n.target,u=n.overlay,c=n.listener,f=n.when,l=void 0===f||f,a=e.useRef(null),s=e.useRef(null),v=g(i({type:"click",listener:function(e){c&&c(e,{type:"outside",valid:3!==e.which&&T(e)})}}),2),y=v[0],w=v[1],E=g(m({listener:function(e){c&&c(e,{type:"resize",valid:!t.isTouchDevice()})}}),2),h=E[0],p=E[1],S=g(d({target:
|
|
1
|
+
import*as e from"react";import{DomHandler as t,ObjectUtils as n}from"primereact/utils";var r=function(t){var n=e.useRef(void 0);return e.useEffect((function(){n.current=t})),n.current},u=function(t){return e.useEffect(t,[])},c=function(t,n){var r=e.useRef(!1);return e.useEffect((function(){if(r.current)return t&&t();r.current=!0}),n)},o=function(t){return e.useEffect((function(){return t}),[])},i=function(u){var c=u.target,i=void 0===c?"document":c,f=u.type,l=u.listener,a=u.options,s=u.when,v=void 0===s||s,g=e.useRef(null),d=e.useRef(null),m=r(a),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.isNotEmpty(e.target)&&(w(),(e.when||v)&&(g.current=t.getTargetElement(e.target))),!d.current&&g.current&&(d.current=function(e){return l&&l(e)},g.current.addEventListener(f,d.current,a))},w=function(){d.current&&(g.current.removeEventListener(f,d.current,a),d.current=null)};return e.useEffect((function(){v?g.current=t.getTargetElement(i):(w(),g.current=null)}),[i,v]),e.useEffect((function(){!d.current||d.current===l&&m===a||(w(),v&&y())}),[l,a]),o((function(){w()})),[y,w]};function f(e){if(Array.isArray(e))return e}function l(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,c,o,i=[],f=!0,l=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=c.call(n)).done)&&(i.push(r.value),i.length!==t);f=!0);}catch(e){l=!0,u=e}finally{try{if(!f&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw u}}return i}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function v(){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 g(e,t){return f(e)||l(e,t)||s(e,t)||v()}var d=function(u){var c=u.target,i=u.listener,f=u.options,l=u.when,a=void 0===l||l,s=e.useRef(null),v=e.useRef(null),g=e.useRef([]),d=r(f),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.isNotEmpty(e.target)&&(y(),(e.when||a)&&(s.current=t.getTargetElement(e.target))),!v.current&&s.current){var r=g.current=t.getScrollableParents(s.current);v.current=function(e){return i&&i(e)},r.forEach((function(e){return e.addEventListener("scroll",v.current,f)}))}},y=function(){v.current&&(g.current.forEach((function(e){return e.removeEventListener("scroll",v.current,f)})),v.current=null)};return e.useEffect((function(){a?s.current=t.getTargetElement(c):(y(),s.current=null)}),[c,a]),e.useEffect((function(){!v.current||v.current===i&&d===f||(y(),a&&m())}),[i,f]),o((function(){y()})),[m,y]},m=function(e){return i({target:"window",type:"resize",listener:e.listener})},y=function(n){var r=n.target,u=n.overlay,c=n.listener,f=n.when,l=void 0===f||f,a=e.useRef(null),s=e.useRef(null),v=g(i({type:"click",listener:function(e){c&&c(e,{type:"outside",valid:3!==e.which&&T(e)})}}),2),y=v[0],w=v[1],E=g(m({listener:function(e){c&&c(e,{type:"resize",valid:!t.isTouchDevice()})}}),2),h=E[0],p=E[1],S=g(d({target:r,listener:function(e){c&&c(e,{type:"scroll",valid:!0})}}),2),b=S[0],R=S[1],T=function(e){return a.current&&!(a.current.isSameNode(e.target)||a.current.contains(e.target)||s.current&&s.current.contains(e.target))},I=function(){w(),p(),R()};return e.useEffect((function(){l?(a.current=t.getTargetElement(r),s.current=t.getTargetElement(u)):(I(),a.current=s.current=null)}),[r,u,l]),e.useEffect((function(){I()}),[l]),o((function(){I()})),[function(){y(),h(),b()},I]},w=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=e.useRef(null),c=e.useRef(null),i=e.useCallback((function(){return clearInterval(u.current)}),[u.current]);return e.useEffect((function(){c.current=t})),e.useEffect((function(){if(r)return u.current=setInterval((function(){c.current()}),n),i;i()}),[n,r]),o((function(){i()})),[i]},E=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",u="undefined"!=typeof window,c=i({target:"window",type:"storage",listener:function(e){var t="local"===r?window.localStorage:window.sessionStorage;e.storageArea===t&&e.key===n&&d(e.newValue||void 0)}}),o=g(c,2),f=o[0],l=o[1],a=e.useState((function(){if(!u)return t;try{var e="local"===r?window.localStorage.getItem(n):window.sessionStorage.getItem(n);return e?JSON.parse(e):t}catch(e){return t}})),s=g(a,2),v=s[0],d=s[1],m=function(e){try{var t=e instanceof Function?e(v):e;if(d(t),u){var c=JSON.stringify(t);"local"===r?window.localStorage.setItem(n,c):window.sessionStorage.setItem(n,c)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(n))}};return e.useEffect((function(){return f(),function(){return l()}}),[]),[v,m]},h=function(e,t){return E(e,t,"local")},p=function(e,t){return E(e,t,"session")},S=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=e.useRef(null),c=e.useRef(null),i=e.useCallback((function(){return clearTimeout(u.current)}),[u.current]);return e.useEffect((function(){c.current=t})),e.useEffect((function(){if(r)return u.current=setTimeout((function(){c.current()}),n),i;i()}),[n,r]),o((function(){i()})),[i]};export{i as useEventListener,w as useInterval,h as useLocalStorage,u as useMountEffect,y as useOverlayListener,d as useOverlayScrollListener,r as usePrevious,m as useResizeListener,p as useSessionStorage,E as useStorage,S as useTimeout,o as useUnmountEffect,c as useUpdateEffect};
|
package/hooks/hooks.js
CHANGED
|
@@ -273,7 +273,7 @@ this.primereact.hooks = (function (exports, React, utils) {
|
|
|
273
273
|
bindWindowResizeListener = _useResizeListener2[0],
|
|
274
274
|
unbindWindowResizeListener = _useResizeListener2[1];
|
|
275
275
|
var _useOverlayScrollList = useOverlayScrollListener({
|
|
276
|
-
target:
|
|
276
|
+
target: target,
|
|
277
277
|
listener: function listener(event) {
|
|
278
278
|
_listener && _listener(event, {
|
|
279
279
|
type: 'scroll',
|
|
@@ -308,7 +308,6 @@ this.primereact.hooks = (function (exports, React, utils) {
|
|
|
308
308
|
}, [target, overlay, when]);
|
|
309
309
|
React__namespace.useEffect(function () {
|
|
310
310
|
unbind();
|
|
311
|
-
// when && bind();
|
|
312
311
|
}, [when]);
|
|
313
312
|
useUnmountEffect(function () {
|
|
314
313
|
unbind();
|
package/hooks/hooks.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.hooks=function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var u=n(t),c=function(e){var t=u.useRef(void 0);return u.useEffect((function(){t.current=e})),t.current},o=function(e){return u.useEffect((function(){return e}),[])},i=function(e){var t=e.target,n=void 0===t?"document":t,i=e.type,l=e.listener,f=e.options,a=e.when,s=void 0===a||a,v=u.useRef(null),d=u.useRef(null),g=c(f),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.ObjectUtils.isNotEmpty(e.target)&&(y(),(e.when||s)&&(v.current=r.DomHandler.getTargetElement(e.target))),!d.current&&v.current&&(d.current=function(e){return l&&l(e)},v.current.addEventListener(i,d.current,f))},y=function(){d.current&&(v.current.removeEventListener(i,d.current,f),d.current=null)};return u.useEffect((function(){s?v.current=r.DomHandler.getTargetElement(n):(y(),v.current=null)}),[n,s]),u.useEffect((function(){!d.current||d.current===l&&g===f||(y(),s&&m())}),[l,f]),o((function(){y()})),[m,y]};function l(e){if(Array.isArray(e))return e}function f(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,u,c,o,i=[],l=!0,f=!1;try{if(c=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=c.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){f=!0,u=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw u}}return i}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function v(){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 d(e,t){return l(e)||f(e,t)||s(e,t)||v()}var g=function(e){var t=e.target,n=e.listener,i=e.options,l=e.when,f=void 0===l||l,a=u.useRef(null),s=u.useRef(null),v=u.useRef([]),d=c(i),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.ObjectUtils.isNotEmpty(e.target)&&(m(),(e.when||f)&&(a.current=r.DomHandler.getTargetElement(e.target))),!s.current&&a.current){var t=v.current=r.DomHandler.getScrollableParents(a.current);s.current=function(e){return n&&n(e)},t.forEach((function(e){return e.addEventListener("scroll",s.current,i)}))}},m=function(){s.current&&(v.current.forEach((function(e){return e.removeEventListener("scroll",s.current,i)})),s.current=null)};return u.useEffect((function(){f?a.current=r.DomHandler.getTargetElement(t):(m(),a.current=null)}),[t,f]),u.useEffect((function(){!s.current||s.current===n&&d===i||(m(),f&&g())}),[n,i]),o((function(){m()})),[g,m]},m=function(e){return i({target:"window",type:"resize",listener:e.listener})},y=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",n="undefined"!=typeof window,c=i({target:"window",type:"storage",listener:function(e){var n="local"===r?window.localStorage:window.sessionStorage;e.storageArea===n&&e.key===t&&g(e.newValue||void 0)}}),o=d(c,2),l=o[0],f=o[1],a=u.useState((function(){if(!n)return e;try{var u="local"===r?window.localStorage.getItem(t):window.sessionStorage.getItem(t);return u?JSON.parse(u):e}catch(t){return e}})),s=d(a,2),v=s[0],g=s[1],m=function(e){try{var u=e instanceof Function?e(v):e;if(g(u),n){var c=JSON.stringify(u);"local"===r?window.localStorage.setItem(t,c):window.sessionStorage.setItem(t,c)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(t))}};return u.useEffect((function(){return l(),function(){return f()}}),[]),[v,m]};return e.useEventListener=i,e.useInterval=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=u.useRef(null),c=u.useRef(null),i=u.useCallback((function(){return clearInterval(n.current)}),[n.current]);return u.useEffect((function(){c.current=e})),u.useEffect((function(){if(r)return n.current=setInterval((function(){c.current()}),t),i;i()}),[t,r]),o((function(){i()})),[i]},e.useLocalStorage=function(e,t){return y(e,t,"local")},e.useMountEffect=function(e){return u.useEffect(e,[])},e.useOverlayListener=function(e){var t=e.target,n=e.overlay,c=e.listener,l=e.when,f=void 0===l||l,a=u.useRef(null),s=u.useRef(null),v=d(i({type:"click",listener:function(e){c&&c(e,{type:"outside",valid:3!==e.which&&R(e)})}}),2),y=v[0],E=v[1],h=d(m({listener:function(e){c&&c(e,{type:"resize",valid:!r.DomHandler.isTouchDevice()})}}),2),w=h[0],p=h[1],b=d(g({target:
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.hooks=function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var u=n(t),c=function(e){var t=u.useRef(void 0);return u.useEffect((function(){t.current=e})),t.current},o=function(e){return u.useEffect((function(){return e}),[])},i=function(e){var t=e.target,n=void 0===t?"document":t,i=e.type,l=e.listener,f=e.options,a=e.when,s=void 0===a||a,v=u.useRef(null),d=u.useRef(null),g=c(f),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.ObjectUtils.isNotEmpty(e.target)&&(y(),(e.when||s)&&(v.current=r.DomHandler.getTargetElement(e.target))),!d.current&&v.current&&(d.current=function(e){return l&&l(e)},v.current.addEventListener(i,d.current,f))},y=function(){d.current&&(v.current.removeEventListener(i,d.current,f),d.current=null)};return u.useEffect((function(){s?v.current=r.DomHandler.getTargetElement(n):(y(),v.current=null)}),[n,s]),u.useEffect((function(){!d.current||d.current===l&&g===f||(y(),s&&m())}),[l,f]),o((function(){y()})),[m,y]};function l(e){if(Array.isArray(e))return e}function f(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,u,c,o,i=[],l=!0,f=!1;try{if(c=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=c.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){f=!0,u=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw u}}return i}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function v(){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 d(e,t){return l(e)||f(e,t)||s(e,t)||v()}var g=function(e){var t=e.target,n=e.listener,i=e.options,l=e.when,f=void 0===l||l,a=u.useRef(null),s=u.useRef(null),v=u.useRef([]),d=c(i),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.ObjectUtils.isNotEmpty(e.target)&&(m(),(e.when||f)&&(a.current=r.DomHandler.getTargetElement(e.target))),!s.current&&a.current){var t=v.current=r.DomHandler.getScrollableParents(a.current);s.current=function(e){return n&&n(e)},t.forEach((function(e){return e.addEventListener("scroll",s.current,i)}))}},m=function(){s.current&&(v.current.forEach((function(e){return e.removeEventListener("scroll",s.current,i)})),s.current=null)};return u.useEffect((function(){f?a.current=r.DomHandler.getTargetElement(t):(m(),a.current=null)}),[t,f]),u.useEffect((function(){!s.current||s.current===n&&d===i||(m(),f&&g())}),[n,i]),o((function(){m()})),[g,m]},m=function(e){return i({target:"window",type:"resize",listener:e.listener})},y=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",n="undefined"!=typeof window,c=i({target:"window",type:"storage",listener:function(e){var n="local"===r?window.localStorage:window.sessionStorage;e.storageArea===n&&e.key===t&&g(e.newValue||void 0)}}),o=d(c,2),l=o[0],f=o[1],a=u.useState((function(){if(!n)return e;try{var u="local"===r?window.localStorage.getItem(t):window.sessionStorage.getItem(t);return u?JSON.parse(u):e}catch(t){return e}})),s=d(a,2),v=s[0],g=s[1],m=function(e){try{var u=e instanceof Function?e(v):e;if(g(u),n){var c=JSON.stringify(u);"local"===r?window.localStorage.setItem(t,c):window.sessionStorage.setItem(t,c)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(t))}};return u.useEffect((function(){return l(),function(){return f()}}),[]),[v,m]};return e.useEventListener=i,e.useInterval=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=u.useRef(null),c=u.useRef(null),i=u.useCallback((function(){return clearInterval(n.current)}),[n.current]);return u.useEffect((function(){c.current=e})),u.useEffect((function(){if(r)return n.current=setInterval((function(){c.current()}),t),i;i()}),[t,r]),o((function(){i()})),[i]},e.useLocalStorage=function(e,t){return y(e,t,"local")},e.useMountEffect=function(e){return u.useEffect(e,[])},e.useOverlayListener=function(e){var t=e.target,n=e.overlay,c=e.listener,l=e.when,f=void 0===l||l,a=u.useRef(null),s=u.useRef(null),v=d(i({type:"click",listener:function(e){c&&c(e,{type:"outside",valid:3!==e.which&&R(e)})}}),2),y=v[0],E=v[1],h=d(m({listener:function(e){c&&c(e,{type:"resize",valid:!r.DomHandler.isTouchDevice()})}}),2),w=h[0],p=h[1],b=d(g({target:t,listener:function(e){c&&c(e,{type:"scroll",valid:!0})}}),2),S=b[0],O=b[1],R=function(e){return a.current&&!(a.current.isSameNode(e.target)||a.current.contains(e.target)||s.current&&s.current.contains(e.target))},j=function(){E(),p(),O()};return u.useEffect((function(){f?(a.current=r.DomHandler.getTargetElement(t),s.current=r.DomHandler.getTargetElement(n)):(j(),a.current=s.current=null)}),[t,n,f]),u.useEffect((function(){j()}),[f]),o((function(){j()})),[function(){y(),w(),S()},j]},e.useOverlayScrollListener=g,e.usePrevious=c,e.useResizeListener=m,e.useSessionStorage=function(e,t){return y(e,t,"session")},e.useStorage=y,e.useTimeout=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=u.useRef(null),c=u.useRef(null),i=u.useCallback((function(){return clearTimeout(n.current)}),[n.current]);return u.useEffect((function(){c.current=e})),u.useEffect((function(){if(r)return n.current=setTimeout((function(){c.current()}),t),i;i()}),[t,r]),o((function(){i()})),[i]},e.useUnmountEffect=o,e.useUpdateEffect=function(e,t){var r=u.useRef(!1);return u.useEffect((function(){if(r.current)return e&&e();r.current=!0}),t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils);
|
package/image/image.d.ts
CHANGED
|
@@ -1,24 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Displays a single image with preview and tranformation options.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/image/)
|
|
6
|
+
*
|
|
7
|
+
* @module image
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Defines valid properties in Image component. In addition to these, all properties of HTMLSpanElement can be used in this component.
|
|
14
|
+
* @group Properties
|
|
15
|
+
*/
|
|
3
16
|
export interface ImageProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, 'ref'> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Specifies an alternate text for an area, if the image cannot be displayed.
|
|
19
|
+
*/
|
|
20
|
+
alt?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Used to get the child elements of the component.
|
|
23
|
+
* @readonly
|
|
24
|
+
*/
|
|
25
|
+
children?: React.ReactNode | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Adds a download button to the preview control menu.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
downloadable?: boolean | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Height of the image element.
|
|
33
|
+
*/
|
|
34
|
+
height?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Style class of the image element.
|
|
37
|
+
*/
|
|
38
|
+
imageClassName?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Inline style of the image element.
|
|
41
|
+
*/
|
|
42
|
+
imageStyle?: React.CSSProperties | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Controls the preview functionality.
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
preview?: boolean | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Specifies the path to the image.
|
|
50
|
+
*/
|
|
51
|
+
src?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Changing the default icon when the image is hovered in preview mode.
|
|
54
|
+
*/
|
|
55
|
+
template?: any | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Width of the image element.
|
|
58
|
+
*/
|
|
59
|
+
width?: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Zoomed image that may be different than "src" image.
|
|
62
|
+
*/
|
|
63
|
+
zoomSrc?: string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Triggered when the preview overlay is hidden.
|
|
66
|
+
*/
|
|
15
67
|
onHide?(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Triggered when the preview overlay is shown.
|
|
70
|
+
*/
|
|
16
71
|
onShow?(): void;
|
|
17
72
|
}
|
|
18
73
|
|
|
74
|
+
/**
|
|
75
|
+
* **PrimeReact - Image**
|
|
76
|
+
*
|
|
77
|
+
* _Displays a single image with preview and tranformation options._
|
|
78
|
+
*
|
|
79
|
+
* [Live Demo](https://www.primefaces.org/primereact/image/)
|
|
80
|
+
* --- ---
|
|
81
|
+
* 
|
|
82
|
+
*
|
|
83
|
+
* @group Component
|
|
84
|
+
*/
|
|
19
85
|
export declare class Image extends React.Component<ImageProps, any> {
|
|
86
|
+
/**
|
|
87
|
+
* Used to show the overlay.
|
|
88
|
+
*/
|
|
20
89
|
public show(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Used to hide the overlay.
|
|
92
|
+
*/
|
|
21
93
|
public hide(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Used to get container element.
|
|
96
|
+
* @return {HTMLSpanElement} Container element
|
|
97
|
+
*/
|
|
22
98
|
public getElement(): HTMLSpanElement;
|
|
99
|
+
/**
|
|
100
|
+
* Used to get image element
|
|
101
|
+
* @return {HTMLImageElement} Image element
|
|
102
|
+
*/
|
|
23
103
|
public getImage(): HTMLImageElement;
|
|
24
104
|
}
|
package/inplace/inplace.d.ts
CHANGED
|
@@ -1,31 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/inplace)
|
|
6
|
+
*
|
|
7
|
+
* Helper Components:
|
|
8
|
+
*
|
|
9
|
+
* - {@link InplaceDisplay}
|
|
10
|
+
*
|
|
11
|
+
* - {@link InplaceContent}
|
|
12
|
+
*
|
|
13
|
+
* @module inplace
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
1
16
|
import * as React from 'react';
|
|
2
17
|
|
|
3
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Custom toggle event.
|
|
20
|
+
* @see {@link InplaceProps.onToggle}
|
|
21
|
+
* @event
|
|
22
|
+
*/
|
|
23
|
+
interface InplaceToggleEvent {
|
|
24
|
+
/**
|
|
25
|
+
* Browser event
|
|
26
|
+
*/
|
|
4
27
|
originalEvent: React.SyntheticEvent;
|
|
28
|
+
/**
|
|
29
|
+
* Current value
|
|
30
|
+
*/
|
|
5
31
|
value: boolean;
|
|
6
32
|
}
|
|
7
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Defines valid properties in Inplace component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
36
|
+
* @group Properties
|
|
37
|
+
*/
|
|
8
38
|
export interface InplaceProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Whether the content is displayed or not.
|
|
41
|
+
* @defaultValue false
|
|
42
|
+
*/
|
|
43
|
+
active?: boolean | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Displays a button to switch back to display mode.
|
|
46
|
+
* @defaultValue false
|
|
47
|
+
*/
|
|
48
|
+
closable?: boolean | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* When present, it specifies that the element should be disabled.
|
|
51
|
+
* @defaultValue false
|
|
52
|
+
*/
|
|
53
|
+
disabled?: boolean | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Used to define a string that labels the component.
|
|
56
|
+
*/
|
|
57
|
+
ariaLabel?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Callback to invoke when inplace is opened.
|
|
60
|
+
* @param {React.MouseEvent} event - Browser event.
|
|
61
|
+
*/
|
|
13
62
|
onOpen?(event: React.MouseEvent<HTMLElement>): void;
|
|
63
|
+
/**
|
|
64
|
+
* Callback to invoke when inplace is closed.
|
|
65
|
+
* @param {React.MouseEvent} event - Browser event.
|
|
66
|
+
*/
|
|
14
67
|
onClose?(event: React.MouseEvent<HTMLElement>): void;
|
|
15
|
-
|
|
16
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Callback to invoke when inplace is opened or closed.
|
|
70
|
+
* @param {InplaceToggleEvent} event - Custom toggle event.
|
|
71
|
+
*/
|
|
72
|
+
onToggle?(event: InplaceToggleEvent): void;
|
|
73
|
+
/**
|
|
74
|
+
* Used to get the child elements of the component.
|
|
75
|
+
* @readonly
|
|
76
|
+
*/
|
|
77
|
+
children?: React.ReactNode | undefined;
|
|
17
78
|
}
|
|
18
79
|
|
|
80
|
+
/**
|
|
81
|
+
* **PrimeReact - Inplace**
|
|
82
|
+
*
|
|
83
|
+
* _Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content._
|
|
84
|
+
*
|
|
85
|
+
* [Live Demo](https://www.primefaces.org/primereact/inplace/)
|
|
86
|
+
* --- ---
|
|
87
|
+
* 
|
|
88
|
+
*
|
|
89
|
+
* @group Component
|
|
90
|
+
*/
|
|
19
91
|
export declare class Inplace extends React.Component<InplaceProps, any> {
|
|
92
|
+
/**
|
|
93
|
+
* Used to get container element.
|
|
94
|
+
* @return {HTMLDivElement} Container element
|
|
95
|
+
*/
|
|
20
96
|
public getElement(): HTMLDivElement;
|
|
21
97
|
}
|
|
22
98
|
|
|
99
|
+
/**
|
|
100
|
+
* InplaceDisplay is a helper component for Inplace.
|
|
101
|
+
* @group Component
|
|
102
|
+
*/
|
|
23
103
|
// tslint:disable-next-line:max-classes-per-file
|
|
24
104
|
export declare class InplaceDisplay extends React.Component {
|
|
25
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Used to get the child elements of the component.
|
|
107
|
+
* @readonly
|
|
108
|
+
*/
|
|
109
|
+
children?: React.ReactNode | undefined;
|
|
26
110
|
}
|
|
27
111
|
|
|
112
|
+
/**
|
|
113
|
+
* InplaceContent is a helper component for Inplace.
|
|
114
|
+
* @group Component
|
|
115
|
+
*/
|
|
28
116
|
// tslint:disable-next-line:max-classes-per-file
|
|
29
117
|
export declare class InplaceContent extends React.Component {
|
|
30
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Used to get the child elements of the component.
|
|
120
|
+
* @readonly
|
|
121
|
+
*/
|
|
122
|
+
children?: React.ReactNode | undefined;
|
|
31
123
|
}
|