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/steps/steps.d.ts
CHANGED
|
@@ -1,20 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Steps also known as Stepper, is an indicator for the steps in a workflow. Layout of steps component is optimized for responsive design.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/steps/)
|
|
6
|
+
*
|
|
7
|
+
* @module steps
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
import { MenuItem } from '../menuitem';
|
|
3
12
|
|
|
4
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Custom select event
|
|
15
|
+
* @see {@link StepsProps.onSelect}
|
|
16
|
+
* @event
|
|
17
|
+
*/
|
|
18
|
+
interface StepsSelectEvent {
|
|
19
|
+
/**
|
|
20
|
+
* Browser event
|
|
21
|
+
*/
|
|
5
22
|
originalEvent: React.SyntheticEvent;
|
|
23
|
+
/**
|
|
24
|
+
* Selected item instance
|
|
25
|
+
*/
|
|
6
26
|
item: MenuItem;
|
|
27
|
+
/**
|
|
28
|
+
* Index of selected item instance
|
|
29
|
+
*/
|
|
7
30
|
index: number;
|
|
8
31
|
}
|
|
9
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Defines valid properties in Steps component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
35
|
+
* @group Properties
|
|
36
|
+
*/
|
|
10
37
|
export interface StepsProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onSelect' | 'ref'> {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
38
|
+
/**
|
|
39
|
+
* An array of menuitems.
|
|
40
|
+
*/
|
|
41
|
+
model: MenuItem[] | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Index of the active item.
|
|
44
|
+
* @defaultValue 0
|
|
45
|
+
*/
|
|
46
|
+
activeIndex?: number | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the items are clickable or not.
|
|
49
|
+
* @defaultValue true
|
|
50
|
+
*/
|
|
51
|
+
readOnly?: boolean | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Callback to invoke when the new step is selected.
|
|
54
|
+
* @param {StepsSelectEvent} event - Custom select event
|
|
55
|
+
*/
|
|
56
|
+
onSelect?(event: StepsSelectEvent): void;
|
|
57
|
+
/**
|
|
58
|
+
* Used to get the child elements of the component.
|
|
59
|
+
* @readonly
|
|
60
|
+
*/
|
|
61
|
+
children?: React.ReactNode | undefined;
|
|
16
62
|
}
|
|
17
63
|
|
|
64
|
+
/**
|
|
65
|
+
* **PrimeReact - Steps**
|
|
66
|
+
*
|
|
67
|
+
* _Steps also known as Stepper, is an indicator for the steps in a workflow. Layout of steps component is optimized for responsive design._
|
|
68
|
+
*
|
|
69
|
+
* [Live Demo](https://www.primefaces.org/primereact/steps/)
|
|
70
|
+
* --- ---
|
|
71
|
+
* 
|
|
72
|
+
*
|
|
73
|
+
* @group Component
|
|
74
|
+
*/
|
|
18
75
|
export declare class Steps extends React.Component<StepsProps, any> {
|
|
76
|
+
/**
|
|
77
|
+
* Used to get container element.
|
|
78
|
+
* @return {HTMLDivElement} Container element
|
|
79
|
+
*/
|
|
19
80
|
public getElement(): HTMLDivElement;
|
|
20
81
|
}
|
|
@@ -1,22 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* StyleClass manages css classes declaratively to during enter/leave animations or just to toggle classes on an element.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/styleclass)
|
|
6
|
+
*
|
|
7
|
+
* @module styleclass
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
|
|
3
|
-
|
|
4
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Defines valid properties in StyleClass component.
|
|
14
|
+
* @group Properties
|
|
15
|
+
*/
|
|
5
16
|
export interface StyleClassProps {
|
|
17
|
+
/**
|
|
18
|
+
* A React reference to DOM element that need to specify. Required.
|
|
19
|
+
*/
|
|
6
20
|
nodeRef: React.MutableRefObject<React.ReactNode>;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Selector to define the target element.
|
|
23
|
+
*/
|
|
24
|
+
selector?: '@next' | '@prev' | '@parent' | '@grandparent' | string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Style class to add when item begins to get displayed.
|
|
27
|
+
*/
|
|
28
|
+
enterClassName?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Style class to add during enter animation.
|
|
31
|
+
*/
|
|
32
|
+
enterActiveClassName?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Style class to add when item begins to get displayed.
|
|
35
|
+
*/
|
|
36
|
+
enterToClassName?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Style class to add when item begins to get hidden.
|
|
39
|
+
*/
|
|
40
|
+
leaveClassName?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Style class to add during leave animation.
|
|
43
|
+
*/
|
|
44
|
+
leaveActiveClassName?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Style class to add when leave animation is completed.
|
|
47
|
+
*/
|
|
48
|
+
leaveToClassName?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to trigger leave animation when outside of the element is clicked.
|
|
51
|
+
* @defaultValue false
|
|
52
|
+
*/
|
|
53
|
+
hideOnOutsideClick?: boolean | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Adds or removes a class when no enter-leave animation is required.
|
|
56
|
+
*/
|
|
57
|
+
toggleClassName?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Used to get the child elements of the component.
|
|
60
|
+
* @readonly
|
|
61
|
+
*/
|
|
62
|
+
children?: React.ReactNode | undefined;
|
|
17
63
|
}
|
|
18
64
|
|
|
65
|
+
/**
|
|
66
|
+
* **PrimeReact - StyleClass**
|
|
67
|
+
*
|
|
68
|
+
* _StyleClass manages css classes declaratively to during enter/leave animations or just to toggle classes on an element._
|
|
69
|
+
*
|
|
70
|
+
* [Live Demo](https://www.primefaces.org/primereact/styleclass/)
|
|
71
|
+
* --- ---
|
|
72
|
+
* 
|
|
73
|
+
*
|
|
74
|
+
* @group Component
|
|
75
|
+
*/
|
|
19
76
|
export declare class StyleClass extends React.Component<StyleClassProps, any> {
|
|
77
|
+
/**
|
|
78
|
+
* Used to get container element.
|
|
79
|
+
* @return {HTMLElement} Container element
|
|
80
|
+
*/
|
|
20
81
|
public getElement(): HTMLElement;
|
|
82
|
+
/**
|
|
83
|
+
* Used to get target element.
|
|
84
|
+
* @return {HTMLElement} Container element
|
|
85
|
+
*/
|
|
21
86
|
public getTarget(): HTMLElement;
|
|
22
87
|
}
|
package/tabmenu/tabmenu.d.ts
CHANGED
|
@@ -1,19 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* TabMenu is a navigation/command component that displays items as tab headers.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/tabmenu/)
|
|
6
|
+
*
|
|
7
|
+
* @module tabmenu
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
import { MenuItem } from '../menuitem';
|
|
3
12
|
|
|
4
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Custom tab change event.
|
|
15
|
+
* @see {@link TabMenuProps.onTabChange}
|
|
16
|
+
* @event
|
|
17
|
+
*/
|
|
18
|
+
interface TabMenuTabChangeEvent {
|
|
19
|
+
/**
|
|
20
|
+
* Browser event
|
|
21
|
+
*/
|
|
5
22
|
originalEvent: React.SyntheticEvent;
|
|
23
|
+
/**
|
|
24
|
+
* Selected menuitem
|
|
25
|
+
*/
|
|
6
26
|
value: MenuItem;
|
|
27
|
+
/**
|
|
28
|
+
* Index of the selected tab
|
|
29
|
+
*/
|
|
7
30
|
index: number;
|
|
8
31
|
}
|
|
9
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Defines valid properties in TabMenu component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
35
|
+
* @group Properties
|
|
36
|
+
*/
|
|
10
37
|
export interface TabMenuProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
38
|
+
/**
|
|
39
|
+
* An array of menuitems.
|
|
40
|
+
*/
|
|
41
|
+
model?: MenuItem[] | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Active index of menuitem.
|
|
44
|
+
* @defaultValue 0
|
|
45
|
+
*/
|
|
46
|
+
activeIndex?: number | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Callback to invoke when active tab changes.
|
|
49
|
+
* @param {TabMenuTabChangeEvent} event - Custom tab change event.
|
|
50
|
+
*/
|
|
51
|
+
onTabChange?(event: TabMenuTabChangeEvent): void;
|
|
52
|
+
/**
|
|
53
|
+
* Used to get the child elements of the component.
|
|
54
|
+
* @readonly
|
|
55
|
+
*/
|
|
56
|
+
children?: React.ReactNode | undefined;
|
|
15
57
|
}
|
|
16
58
|
|
|
59
|
+
/**
|
|
60
|
+
* **PrimeReact - TabMenu**
|
|
61
|
+
*
|
|
62
|
+
* _TabMenu is a navigation/command component that displays items as tab headers._
|
|
63
|
+
*
|
|
64
|
+
* [Live Demo](https://www.primefaces.org/primereact/tabmenu/)
|
|
65
|
+
* --- ---
|
|
66
|
+
* 
|
|
67
|
+
*
|
|
68
|
+
* @group Component
|
|
69
|
+
*/
|
|
17
70
|
export declare class TabMenu extends React.Component<TabMenuProps, any> {
|
|
71
|
+
/**
|
|
72
|
+
* Used to get container element.
|
|
73
|
+
* @return {HTMLDivElement} Container element
|
|
74
|
+
*/
|
|
18
75
|
public getElement(): HTMLDivElement;
|
|
19
76
|
}
|
package/tabview/tabview.cjs.js
CHANGED
|
@@ -256,7 +256,7 @@ var TabView = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
|
256
256
|
updateScrollBar(index);
|
|
257
257
|
};
|
|
258
258
|
var _onKeyDown = function onKeyDown(event, tab, index) {
|
|
259
|
-
if (event.
|
|
259
|
+
if (event.key === 'Enter') {
|
|
260
260
|
onTabHeaderClick(event, tab, index);
|
|
261
261
|
}
|
|
262
262
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/hooks"),r=require("primereact/ripple"),a=require("primereact/utils");function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=l(e);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function s(e){var t=u(e,"string");return"symbol"===c(t)?t:String(t)}function f(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(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 b(e){if(Array.isArray(e))return p(e)}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function v(){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 y(e){if(Array.isArray(e))return e}function h(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,i,o=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(e){u=!0,a=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return o}}function g(){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 w(e,t){return y(e)||h(e,t)||m(e,t)||g()}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=function(){},C=i.forwardRef((function(e,l){var c=w(i.useState(e.id),2),u=c[0],s=c[1],f=w(i.useState(!0),2),p=f[0],y=f[1],h=w(i.useState(!1),2),g=h[0],E=h[1],j=w(i.useState([]),2),S=j[0],T=j[1],P=w(i.useState(e.activeIndex),2),x=P[0],I=P[1],_=i.useRef(null),D=i.useRef(null),k=i.useRef(null),A=i.useRef(null),R=i.useRef(null),L=i.useRef(null),H=i.useRef({}),U=e.onTabChange?e.activeIndex:x,W=function(e){return e===U},q=function(e,t){return e&&"TabPanel"===e.props.__TYPE&&S.every((function(e){return e!==t}))},B=function(t,n){var r;(t.preventDefault(),e.onBeforeTabClose&&!1===e.onBeforeTabClose({originalEvent:t,index:n}))||(T([].concat(b(r=S)||d(r)||m(r)||v(),[n])),e.onTabClose&&e.onTabClose({originalEvent:t,index:n}))},V=function(t,n,r){if(t&&t.preventDefault(),!n.props.disabled){if(e.onBeforeTabChange&&!1===e.onBeforeTabChange({originalEvent:t,index:r}))return;e.onTabChange?e.onTabChange({originalEvent:t,index:r}):I(r)}M(r)},K=function(e,t,n){"Enter"===e.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/hooks"),r=require("primereact/ripple"),a=require("primereact/utils");function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=l(e);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function s(e){var t=u(e,"string");return"symbol"===c(t)?t:String(t)}function f(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(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 b(e){if(Array.isArray(e))return p(e)}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function v(){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 y(e){if(Array.isArray(e))return e}function h(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,i,o=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(e){u=!0,a=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return o}}function g(){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 w(e,t){return y(e)||h(e,t)||m(e,t)||g()}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=function(){},C=i.forwardRef((function(e,l){var c=w(i.useState(e.id),2),u=c[0],s=c[1],f=w(i.useState(!0),2),p=f[0],y=f[1],h=w(i.useState(!1),2),g=h[0],E=h[1],j=w(i.useState([]),2),S=j[0],T=j[1],P=w(i.useState(e.activeIndex),2),x=P[0],I=P[1],_=i.useRef(null),D=i.useRef(null),k=i.useRef(null),A=i.useRef(null),R=i.useRef(null),L=i.useRef(null),H=i.useRef({}),U=e.onTabChange?e.activeIndex:x,W=function(e){return e===U},q=function(e,t){return e&&"TabPanel"===e.props.__TYPE&&S.every((function(e){return e!==t}))},B=function(t,n){var r;(t.preventDefault(),e.onBeforeTabClose&&!1===e.onBeforeTabClose({originalEvent:t,index:n}))||(T([].concat(b(r=S)||d(r)||m(r)||v(),[n])),e.onTabClose&&e.onTabClose({originalEvent:t,index:n}))},V=function(t,n,r){if(t&&t.preventDefault(),!n.props.disabled){if(e.onBeforeTabChange&&!1===e.onBeforeTabChange({originalEvent:t,index:r}))return;e.onTabChange?e.onTabChange({originalEvent:t,index:r}):I(r)}M(r)},K=function(e,t,n){"Enter"===e.key&&V(e,t,n)},M=function(e){var t=H.current["tab_".concat(e)];t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest"})},Y=function(t){var n,r,l,i;e.scrollable&&(r=(n=D.current).scrollLeft,l=n.scrollWidth,i=a.DomHandler.getWidth(D.current),y(0===r),E(r===l-i)),t.preventDefault()},z=function(){return[R.current,L.current].reduce((function(e,t){return t?e+a.DomHandler.getWidth(t):e}),0)},J=function(){var e=a.DomHandler.getWidth(D.current)-z(),t=D.current.scrollLeft-e;D.current.scrollLeft=t<=0?0:t},X=function(){var e=a.DomHandler.getWidth(D.current)-z(),t=D.current.scrollLeft+e,n=D.current.scrollWidth-e;D.current.scrollLeft=t>=n?n:t},$=function(){y(!0),E(!1),T([]),e.onTabChange?e.onTabChange({index:U}):I(e.activeIndex)};i.useEffect((function(){var e;e=H.current["tab_".concat(U)],A.current.style.width=a.DomHandler.getWidth(e)+"px",A.current.style.left=a.DomHandler.getOffset(e).left-a.DomHandler.getOffset(k.current).left+"px"})),n.useMountEffect((function(){u||s(a.UniqueComponentId())})),n.useUpdateEffect((function(){if(a.ObjectUtils.isNotEmpty(S)){var t=(n=S[S.length-1],(r=i.Children.map(e.children,(function(e,t){if(q(e,t))return{tab:e,index:t}}))).find((function(e){return!e.tab.props.disabled&&e.index>=n}))||r.reverse().find((function(e){return!e.tab.props.disabled&&n>e.index})));t&&V(null,t.tab,t.index)}var n,r}),[S]),n.useUpdateEffect((function(){M(e.activeIndex)}),[e.activeIndex]),i.useImperativeHandle(l,(function(){return{props:e,reset:$,getElement:function(){return _.current}}}));var F,G=function(t,n){var l=W(n),o=t.props,c=o.headerClassName,s=o.style,f=o.className,p=o.disabled,b=o.leftIcon,d=o.rightIcon,m=o.header,v=o.headerTemplate,y=o.closable,h=O(O({},o.headerStyle||{}),s||{}),g=a.classNames("p-unselectable-text",{"p-tabview-selected p-highlight":l,"p-disabled":p},c,f),w=u+"_header_"+n,E=u+"_content_"+n,N=p?null:0,C=b&&i.createElement("i",{className:b}),j=i.createElement("span",{className:"p-tabview-title"},m),S=d&&i.createElement("i",{className:d}),T=i.createElement("a",{role:"tab",className:"p-tabview-nav-link",onClick:function(e){return V(e,t,n)},id:w,onKeyDown:function(e){return K(e,t,n)},"aria-controls":E,"aria-selected":l,tabIndex:N},C,j,S,y&&i.createElement("i",{className:"p-tabview-close pi pi-times",onClick:function(e){return B(e,n)}}),i.createElement(r.Ripple,null));v&&(T=a.ObjectUtils.getJSXElement(v,{className:"p-tabview-nav-link",titleClassName:"p-tabview-title",onClick:function(e){return V(e,t,n)},onKeyDown:function(e){return K(e,t,n)},leftIconElement:C,titleElement:j,rightIconElement:S,element:T,props:e,index:n,selected:l,ariaControls:E}));return i.createElement("li",{ref:function(e){return H.current["tab_".concat(n)]=e},className:g,style:h,role:"presentation"},T)},Q=a.ObjectUtils.findDiffKeys(e,C.defaultProps),Z=a.classNames("p-tabview p-component",{"p-tabview-scrollable":e.scrollable},e.className),ee=(F=i.Children.map(e.children,(function(e,t){if(q(e,t))return G(e,t)})),i.createElement("div",{ref:D,id:u,className:"p-tabview-nav-content",style:e.style,onScroll:Y},i.createElement("ul",{ref:k,className:"p-tabview-nav",role:"tablist"},F,i.createElement("li",{ref:A,className:"p-tabview-ink-bar"})))),te=function(){var t=a.classNames("p-tabview-panels",e.panelContainerClassName),n=i.Children.map(e.children,(function(t,n){if(q(t,n)&&(!e.renderActiveOnly||W(n))){var r=W(n),l=O(O({},t.props.contentStyle||{}),t.props.style||{}),c=a.classNames(t.props.contentClassName,t.props.className,"p-tabview-panel",{"p-hidden":!r}),s=u+"_content_"+n,f=u+"_header_"+n,p=a.ObjectUtils.findDiffKeys(t.props,N.defaultProps);return i.createElement("div",o({},p,{id:s,"aria-labelledby":f,"aria-hidden":!r,className:c,style:l,role:"tabpanel"}),e.renderActiveOnly?r&&t.props.children:t.props.children)}}));return i.createElement("div",{className:t,style:e.panelContainerStyle},n)}(),ne=e.scrollable&&!p?i.createElement("button",{ref:R,className:"p-tabview-nav-prev p-tabview-nav-btn p-link",onClick:J,type:"button","aria-label":t.ariaLabel("previousPageLabel")},i.createElement("span",{className:"pi pi-chevron-left"}),i.createElement(r.Ripple,null)):null,re=function(){if(e.scrollable&&!g)return i.createElement("button",{ref:L,className:"p-tabview-nav-next p-tabview-nav-btn p-link",onClick:X,type:"button","aria-label":t.ariaLabel("nextPageLabel")},i.createElement("span",{className:"pi pi-chevron-right","aria-hidden":"true"}),i.createElement(r.Ripple,null))}();return i.createElement("div",o({ref:_,className:Z},Q),i.createElement("div",{className:"p-tabview-nav-container"},ne,ee,re),te)}));N.displayName="TabPanel",N.defaultProps={__TYPE:"TabPanel",className:null,closable:!1,contentClassName:null,contentStyle:null,disabled:!1,header:null,headerClassName:null,headerStyle:null,headerTemplate:null,leftIcon:null,rightIcon:null,style:null},C.displayName="TabView",C.defaultProps={__TYPE:"TabView",id:null,activeIndex:0,className:null,onBeforeTabChange:null,onBeforeTabClose:null,onTabChange:null,onTabClose:null,panelContainerClassName:null,panelContainerStyle:null,renderActiveOnly:!0,scrollable:!1,style:null},exports.TabPanel=N,exports.TabView=C;
|
package/tabview/tabview.d.ts
CHANGED
|
@@ -1,65 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* TabView is a container component to group content with tabs.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/tabview/)
|
|
6
|
+
*
|
|
7
|
+
* Helper Components:
|
|
8
|
+
*
|
|
9
|
+
* - {@link TabPanel}
|
|
10
|
+
*
|
|
11
|
+
* @module tabview
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
1
14
|
import * as React from 'react';
|
|
2
15
|
|
|
3
|
-
|
|
4
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Custom Tabpanel header template options
|
|
18
|
+
* @group Misc
|
|
19
|
+
*/
|
|
5
20
|
interface TabPanelHeaderTemplateOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Style class of the header element.
|
|
23
|
+
*/
|
|
6
24
|
className: string;
|
|
25
|
+
/**
|
|
26
|
+
* Style class of the header title element.
|
|
27
|
+
*/
|
|
7
28
|
titleClassName: string;
|
|
29
|
+
/**
|
|
30
|
+
* Callback to invoke on click.
|
|
31
|
+
* @param {React.MouseEvent<HTMLElement>} event - Browser event.
|
|
32
|
+
*/
|
|
8
33
|
onClick(event: React.MouseEvent<HTMLElement>): void;
|
|
34
|
+
/**
|
|
35
|
+
* Callback to invoke when the key pressed.
|
|
36
|
+
* @param {React.KeyboardEvent<HTMLElement>} event - Browser event.
|
|
37
|
+
*/
|
|
9
38
|
onKeyDown(event: React.KeyboardEvent<HTMLElement>): void;
|
|
39
|
+
/**
|
|
40
|
+
* Left icon of the tab header.
|
|
41
|
+
*/
|
|
10
42
|
leftIconElement: JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* The title element of the tab header.
|
|
45
|
+
*/
|
|
11
46
|
titleElement: JSX.Element;
|
|
47
|
+
/**
|
|
48
|
+
* Right icon of the tab header.
|
|
49
|
+
*/
|
|
12
50
|
rightIconElement: JSX.Element;
|
|
51
|
+
/**
|
|
52
|
+
* The JSX element of the tab header.
|
|
53
|
+
*/
|
|
13
54
|
element: JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* The props of the tab panel component.
|
|
57
|
+
*/
|
|
14
58
|
props: TabPanelProps;
|
|
59
|
+
/**
|
|
60
|
+
* The index of the tab header.
|
|
61
|
+
*/
|
|
15
62
|
index: number;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the tab header is selected or not.
|
|
65
|
+
*/
|
|
16
66
|
selected: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The aria-controls attribute of the tab header.
|
|
69
|
+
*/
|
|
17
70
|
ariaControls: string;
|
|
18
71
|
}
|
|
19
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Defines valid properties in TabPanel component.
|
|
75
|
+
* @group Properties
|
|
76
|
+
*/
|
|
20
77
|
export interface TabPanelProps {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Orientation of tab headers.
|
|
80
|
+
*/
|
|
81
|
+
header?: React.ReactNode | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Header template of the tab to customize more.
|
|
84
|
+
*/
|
|
85
|
+
headerTemplate?: React.ReactNode | ((options: TabPanelHeaderTemplateOptions) => React.ReactNode);
|
|
86
|
+
/**
|
|
87
|
+
* Icons can be placed at left of a header.
|
|
88
|
+
*/
|
|
89
|
+
leftIcon?: string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Icons can be placed at right of a header.
|
|
92
|
+
*/
|
|
93
|
+
rightIcon?: string | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Whether the tab is disabled.
|
|
96
|
+
* @defaultValue false
|
|
97
|
+
*/
|
|
98
|
+
disabled?: boolean | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Defines if tab can be removed.
|
|
101
|
+
* @defaultValue false
|
|
102
|
+
*/
|
|
103
|
+
closable?: boolean | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Inline style of the tab header and content.
|
|
106
|
+
*/
|
|
107
|
+
style?: React.CSSProperties | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Style class of the tab header and content.
|
|
110
|
+
*/
|
|
111
|
+
className?: string | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Inline style of the tab header.
|
|
114
|
+
*/
|
|
115
|
+
headerStyle?: React.CSSProperties | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Style class of the tab header.
|
|
118
|
+
*/
|
|
119
|
+
headerClassName?: string | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Inline style of the tab content.
|
|
122
|
+
*/
|
|
123
|
+
contentStyle?: React.CSSProperties | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Style class of the tab content.
|
|
126
|
+
*/
|
|
127
|
+
contentClassName?: string | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Used to get the child elements of the component.
|
|
130
|
+
* @readonly
|
|
131
|
+
*/
|
|
132
|
+
children?: React.ReactNode | undefined;
|
|
34
133
|
}
|
|
35
134
|
|
|
135
|
+
/**
|
|
136
|
+
* TabPanel is a helper component for TabView.
|
|
137
|
+
* @group Component
|
|
138
|
+
*/
|
|
36
139
|
export declare class TabPanel extends React.Component<TabPanelProps, any> {}
|
|
37
140
|
|
|
38
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Custom change event.
|
|
143
|
+
* @see {@link TabViewProps.onTabChange}
|
|
144
|
+
* @event
|
|
145
|
+
*/
|
|
146
|
+
interface TabViewTabChangeEvent {
|
|
147
|
+
/**
|
|
148
|
+
* Browser event
|
|
149
|
+
*/
|
|
39
150
|
originalEvent: React.SyntheticEvent;
|
|
151
|
+
/**
|
|
152
|
+
* Index of the selected tab
|
|
153
|
+
*/
|
|
40
154
|
index: number;
|
|
41
155
|
}
|
|
42
156
|
|
|
43
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Custom close event.
|
|
159
|
+
* @see {@link TabViewProps.onTabClose}
|
|
160
|
+
* @event
|
|
161
|
+
*/
|
|
162
|
+
interface TabViewTabCloseEvent {
|
|
163
|
+
/**
|
|
164
|
+
* Browser event
|
|
165
|
+
*/
|
|
44
166
|
originalEvent: React.SyntheticEvent;
|
|
167
|
+
/**
|
|
168
|
+
* Index of the selected tab
|
|
169
|
+
*/
|
|
45
170
|
index: number;
|
|
46
171
|
}
|
|
47
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Defines valid properties in TabView component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
175
|
+
* @group Properties
|
|
176
|
+
*/
|
|
48
177
|
export interface TabViewProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Active index of the TabView.
|
|
180
|
+
* @defaultValue 0
|
|
181
|
+
*/
|
|
182
|
+
activeIndex?: number | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Used to get the child elements of the component.
|
|
185
|
+
* @readonly
|
|
186
|
+
*/
|
|
187
|
+
children?: React.ReactNode | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Style class of the panels container of the tabview.
|
|
190
|
+
*/
|
|
191
|
+
panelContainerClassName?: string | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* Inline style of the panels container of the tabview.
|
|
194
|
+
*/
|
|
195
|
+
panelContainerStyle?: React.CSSProperties | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* Whether to render the contents of the selected tab or all tabs.
|
|
198
|
+
* @defaultValue true
|
|
199
|
+
*/
|
|
200
|
+
renderActiveOnly?: boolean | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* When enabled displays buttons at each side of the tab headers to scroll the tab list.
|
|
203
|
+
* @defaultValue false
|
|
204
|
+
*/
|
|
205
|
+
scrollable?: boolean | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Callback to invoke before an active tab is changed. Return false to prevent tab from changing.
|
|
208
|
+
* @param {TabViewTabChangeEvent} event - Custom tab change event.
|
|
209
|
+
*/
|
|
210
|
+
onBeforeTabChange?(event: TabViewTabChangeEvent): void;
|
|
211
|
+
/**
|
|
212
|
+
* Callback to invoke before an active tab is close. Return false to prevent tab from closing.
|
|
213
|
+
* @param {TabViewTabCloseEvent} event - Custom tab close event.
|
|
214
|
+
*/
|
|
215
|
+
onBeforeTabClose?(event: TabViewTabCloseEvent): void;
|
|
216
|
+
/**
|
|
217
|
+
* Callback to invoke when an active tab is changed.
|
|
218
|
+
* @param {TabViewTabChangeEvent} event - Custom tab change event.
|
|
219
|
+
*/
|
|
220
|
+
onTabChange?(event: TabViewTabChangeEvent): void;
|
|
221
|
+
/**
|
|
222
|
+
* Callback to invoke when an active tab is closed.
|
|
223
|
+
* @param {TabViewTabCloseEvent} event - Custom tab close event.
|
|
224
|
+
*/
|
|
225
|
+
onTabClose?(event: TabViewTabCloseEvent): void;
|
|
59
226
|
}
|
|
60
227
|
|
|
228
|
+
/**
|
|
229
|
+
* **PrimeReact - TabPanel**
|
|
230
|
+
*
|
|
231
|
+
* _TabView is a container component to group content with tabs._
|
|
232
|
+
*
|
|
233
|
+
* [Live Demo](https://www.primefaces.org/primereact/tabview/)
|
|
234
|
+
* --- ---
|
|
235
|
+
* 
|
|
236
|
+
*
|
|
237
|
+
* @group Component
|
|
238
|
+
*
|
|
239
|
+
*/
|
|
61
240
|
// tslint:disable-next-line:max-classes-per-file
|
|
62
241
|
export declare class TabView extends React.Component<TabViewProps, any> {
|
|
242
|
+
/**
|
|
243
|
+
* Resets all states.
|
|
244
|
+
*/
|
|
63
245
|
public reset(): void;
|
|
246
|
+
/**
|
|
247
|
+
* Used to get container element.
|
|
248
|
+
* @return {HTMLDivElement} Container element
|
|
249
|
+
*/
|
|
64
250
|
public getElement(): HTMLDivElement;
|
|
65
251
|
}
|
package/tabview/tabview.esm.js
CHANGED
|
@@ -232,7 +232,7 @@ var TabView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
232
232
|
updateScrollBar(index);
|
|
233
233
|
};
|
|
234
234
|
var _onKeyDown = function onKeyDown(event, tab, index) {
|
|
235
|
-
if (event.
|
|
235
|
+
if (event.key === 'Enter') {
|
|
236
236
|
onTabHeaderClick(event, tab, index);
|
|
237
237
|
}
|
|
238
238
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{ariaLabel as t}from"primereact/api";import{useMountEffect as n,useUpdateEffect as r}from"primereact/hooks";import{Ripple as a}from"primereact/ripple";import{UniqueComponentId as l,ObjectUtils as o,classNames as i,DomHandler as c}from"primereact/utils";function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function p(e){var t=f(e,"string");return"symbol"===s(t)?t:String(t)}function b(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(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 d(e){if(Array.isArray(e))return m(e)}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(e,t){if(e){if("string"==typeof e)return m(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)?m(e,t):void 0}}function h(){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 g(e){if(Array.isArray(e))return e}function w(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,o,i=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){u=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return i}}function E(){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 C(e,t){return g(e)||w(e,t)||y(e,t)||E()}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var S=function(){},T=e.forwardRef((function(s,f){var p=C(e.useState(s.id),2),b=p[0],m=p[1],g=C(e.useState(!0),2),w=g[0],E=g[1],N=C(e.useState(!1),2),x=N[0],P=N[1],j=C(e.useState([]),2),I=j[0],_=j[1],k=C(e.useState(s.activeIndex),2),A=k[0],D=k[1],R=e.useRef(null),L=e.useRef(null),W=e.useRef(null),B=e.useRef(null),K=e.useRef(null),V=e.useRef(null),Y=e.useRef({}),H=s.onTabChange?s.activeIndex:A,J=function(e){return e===H},M=function(e,t){return e&&"TabPanel"===e.props.__TYPE&&I.every((function(e){return e!==t}))},U=function(e,t){var n;(e.preventDefault(),s.onBeforeTabClose&&!1===s.onBeforeTabClose({originalEvent:e,index:t}))||(_([].concat(d(n=I)||v(n)||y(n)||h(),[t])),s.onTabClose&&s.onTabClose({originalEvent:e,index:t}))},X=function(e,t,n){if(e&&e.preventDefault(),!t.props.disabled){if(s.onBeforeTabChange&&!1===s.onBeforeTabChange({originalEvent:e,index:n}))return;s.onTabChange?s.onTabChange({originalEvent:e,index:n}):D(n)}q(n)},$=function(e,t,n){"Enter"===e.
|
|
1
|
+
import*as e from"react";import{ariaLabel as t}from"primereact/api";import{useMountEffect as n,useUpdateEffect as r}from"primereact/hooks";import{Ripple as a}from"primereact/ripple";import{UniqueComponentId as l,ObjectUtils as o,classNames as i,DomHandler as c}from"primereact/utils";function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function p(e){var t=f(e,"string");return"symbol"===s(t)?t:String(t)}function b(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(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 d(e){if(Array.isArray(e))return m(e)}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(e,t){if(e){if("string"==typeof e)return m(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)?m(e,t):void 0}}function h(){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 g(e){if(Array.isArray(e))return e}function w(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,o,i=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){u=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return i}}function E(){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 C(e,t){return g(e)||w(e,t)||y(e,t)||E()}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var S=function(){},T=e.forwardRef((function(s,f){var p=C(e.useState(s.id),2),b=p[0],m=p[1],g=C(e.useState(!0),2),w=g[0],E=g[1],N=C(e.useState(!1),2),x=N[0],P=N[1],j=C(e.useState([]),2),I=j[0],_=j[1],k=C(e.useState(s.activeIndex),2),A=k[0],D=k[1],R=e.useRef(null),L=e.useRef(null),W=e.useRef(null),B=e.useRef(null),K=e.useRef(null),V=e.useRef(null),Y=e.useRef({}),H=s.onTabChange?s.activeIndex:A,J=function(e){return e===H},M=function(e,t){return e&&"TabPanel"===e.props.__TYPE&&I.every((function(e){return e!==t}))},U=function(e,t){var n;(e.preventDefault(),s.onBeforeTabClose&&!1===s.onBeforeTabClose({originalEvent:e,index:t}))||(_([].concat(d(n=I)||v(n)||y(n)||h(),[t])),s.onTabClose&&s.onTabClose({originalEvent:e,index:t}))},X=function(e,t,n){if(e&&e.preventDefault(),!t.props.disabled){if(s.onBeforeTabChange&&!1===s.onBeforeTabChange({originalEvent:e,index:n}))return;s.onTabChange?s.onTabChange({originalEvent:e,index:n}):D(n)}q(n)},$=function(e,t,n){"Enter"===e.key&&X(e,t,n)},q=function(e){var t=Y.current["tab_".concat(e)];t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest"})},z=function(e){var t,n,r,a;s.scrollable&&(n=(t=L.current).scrollLeft,r=t.scrollWidth,a=c.getWidth(L.current),E(0===n),P(n===r-a)),e.preventDefault()},F=function(){return[K.current,V.current].reduce((function(e,t){return t?e+c.getWidth(t):e}),0)},G=function(){var e=c.getWidth(L.current)-F(),t=L.current.scrollLeft-e;L.current.scrollLeft=t<=0?0:t},Q=function(){var e=c.getWidth(L.current)-F(),t=L.current.scrollLeft+e,n=L.current.scrollWidth-e;L.current.scrollLeft=t>=n?n:t},Z=function(){E(!0),P(!1),_([]),s.onTabChange?s.onTabChange({index:H}):D(s.activeIndex)};e.useEffect((function(){var e;e=Y.current["tab_".concat(H)],B.current.style.width=c.getWidth(e)+"px",B.current.style.left=c.getOffset(e).left-c.getOffset(W.current).left+"px"})),n((function(){b||m(l())})),r((function(){if(o.isNotEmpty(I)){var t=(n=I[I.length-1],(r=e.Children.map(s.children,(function(e,t){if(M(e,t))return{tab:e,index:t}}))).find((function(e){return!e.tab.props.disabled&&e.index>=n}))||r.reverse().find((function(e){return!e.tab.props.disabled&&n>e.index})));t&&X(null,t.tab,t.index)}var n,r}),[I]),r((function(){q(s.activeIndex)}),[s.activeIndex]),e.useImperativeHandle(f,(function(){return{props:s,reset:Z,getElement:function(){return R.current}}}));var ee,te=function(t,n){var r=J(n),l=t.props,c=l.headerClassName,u=l.style,f=l.className,p=l.disabled,m=l.leftIcon,d=l.rightIcon,v=l.header,y=l.headerTemplate,h=l.closable,g=O(O({},l.headerStyle||{}),u||{}),w=i("p-unselectable-text",{"p-tabview-selected p-highlight":r,"p-disabled":p},c,f),E=b+"_header_"+n,C=b+"_content_"+n,N=p?null:0,S=m&&e.createElement("i",{className:m}),T=e.createElement("span",{className:"p-tabview-title"},v),x=d&&e.createElement("i",{className:d}),P=e.createElement("a",{role:"tab",className:"p-tabview-nav-link",onClick:function(e){return X(e,t,n)},id:E,onKeyDown:function(e){return $(e,t,n)},"aria-controls":C,"aria-selected":r,tabIndex:N},S,T,x,h&&e.createElement("i",{className:"p-tabview-close pi pi-times",onClick:function(e){return U(e,n)}}),e.createElement(a,null));y&&(P=o.getJSXElement(y,{className:"p-tabview-nav-link",titleClassName:"p-tabview-title",onClick:function(e){return X(e,t,n)},onKeyDown:function(e){return $(e,t,n)},leftIconElement:S,titleElement:T,rightIconElement:x,element:P,props:s,index:n,selected:r,ariaControls:C}));return e.createElement("li",{ref:function(e){return Y.current["tab_".concat(n)]=e},className:w,style:g,role:"presentation"},P)},ne=o.findDiffKeys(s,T.defaultProps),re=i("p-tabview p-component",{"p-tabview-scrollable":s.scrollable},s.className),ae=(ee=e.Children.map(s.children,(function(e,t){if(M(e,t))return te(e,t)})),e.createElement("div",{ref:L,id:b,className:"p-tabview-nav-content",style:s.style,onScroll:z},e.createElement("ul",{ref:W,className:"p-tabview-nav",role:"tablist"},ee,e.createElement("li",{ref:B,className:"p-tabview-ink-bar"})))),le=function(){var t=i("p-tabview-panels",s.panelContainerClassName),n=e.Children.map(s.children,(function(t,n){if(M(t,n)&&(!s.renderActiveOnly||J(n))){var r=J(n),a=O(O({},t.props.contentStyle||{}),t.props.style||{}),l=i(t.props.contentClassName,t.props.className,"p-tabview-panel",{"p-hidden":!r}),c=b+"_content_"+n,f=b+"_header_"+n,p=o.findDiffKeys(t.props,S.defaultProps);return e.createElement("div",u({},p,{id:c,"aria-labelledby":f,"aria-hidden":!r,className:l,style:a,role:"tabpanel"}),s.renderActiveOnly?r&&t.props.children:t.props.children)}}));return e.createElement("div",{className:t,style:s.panelContainerStyle},n)}(),oe=s.scrollable&&!w?e.createElement("button",{ref:K,className:"p-tabview-nav-prev p-tabview-nav-btn p-link",onClick:G,type:"button","aria-label":t("previousPageLabel")},e.createElement("span",{className:"pi pi-chevron-left"}),e.createElement(a,null)):null,ie=function(){if(s.scrollable&&!x)return e.createElement("button",{ref:V,className:"p-tabview-nav-next p-tabview-nav-btn p-link",onClick:Q,type:"button","aria-label":t("nextPageLabel")},e.createElement("span",{className:"pi pi-chevron-right","aria-hidden":"true"}),e.createElement(a,null))}();return e.createElement("div",u({ref:R,className:re},ne),e.createElement("div",{className:"p-tabview-nav-container"},oe,ae,ie),le)}));S.displayName="TabPanel",S.defaultProps={__TYPE:"TabPanel",className:null,closable:!1,contentClassName:null,contentStyle:null,disabled:!1,header:null,headerClassName:null,headerStyle:null,headerTemplate:null,leftIcon:null,rightIcon:null,style:null},T.displayName="TabView",T.defaultProps={__TYPE:"TabView",id:null,activeIndex:0,className:null,onBeforeTabChange:null,onBeforeTabClose:null,onTabChange:null,onTabClose:null,panelContainerClassName:null,panelContainerStyle:null,renderActiveOnly:!0,scrollable:!1,style:null};export{S as TabPanel,T as TabView};
|
package/tabview/tabview.js
CHANGED
|
@@ -250,7 +250,7 @@ this.primereact.tabview = (function (exports, React, api, hooks, ripple, utils)
|
|
|
250
250
|
updateScrollBar(index);
|
|
251
251
|
};
|
|
252
252
|
var _onKeyDown = function onKeyDown(event, tab, index) {
|
|
253
|
-
if (event.
|
|
253
|
+
if (event.key === 'Enter') {
|
|
254
254
|
onTabHeaderClick(event, tab, index);
|
|
255
255
|
}
|
|
256
256
|
};
|