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/knob/knob.d.ts
CHANGED
|
@@ -1,31 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Knob is a form component to define number inputs with a dial.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/knob/)
|
|
6
|
+
*
|
|
7
|
+
* @module knob
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
|
|
3
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Custom change event.
|
|
14
|
+
* @see {@link KnobProps.onChange}
|
|
15
|
+
* @event
|
|
16
|
+
*/
|
|
17
|
+
interface KnobChangeEvent {
|
|
18
|
+
/**
|
|
19
|
+
* New value
|
|
20
|
+
*/
|
|
4
21
|
value: number;
|
|
5
22
|
}
|
|
6
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Defines valid properties in Knob component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
26
|
+
* @group Properties
|
|
27
|
+
*/
|
|
7
28
|
export interface KnobProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange' | 'ref'> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Unique identifier of the element.
|
|
31
|
+
*/
|
|
32
|
+
id?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Inline style of the element.
|
|
35
|
+
*/
|
|
36
|
+
style?: React.CSSProperties | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Style class of the element.
|
|
39
|
+
*/
|
|
40
|
+
className?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Value of the component.
|
|
43
|
+
*/
|
|
44
|
+
value?: number | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Size of the component in pixels.
|
|
47
|
+
* @defaultValue 100
|
|
48
|
+
*/
|
|
49
|
+
size?: number | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* When present, it specifies that the component should be disabled.
|
|
52
|
+
* @defaultValue false
|
|
53
|
+
*/
|
|
54
|
+
disabled?: boolean | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* When present, it specifies that the component value cannot be edited.
|
|
57
|
+
* @defaultValue false
|
|
58
|
+
*/
|
|
59
|
+
readOnly?: boolean | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the show the value inside the knob.
|
|
62
|
+
* @defaultValue true
|
|
63
|
+
*/
|
|
64
|
+
showValue?: boolean | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Step factor to increment/decrement the value.
|
|
67
|
+
* @defaultValue 1
|
|
68
|
+
*/
|
|
69
|
+
step?: number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Mininum boundary value.
|
|
72
|
+
* @defaultValue 0
|
|
73
|
+
*/
|
|
74
|
+
min?: number | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Maximum boundary value.
|
|
77
|
+
* @defaultValue 100
|
|
78
|
+
*/
|
|
79
|
+
max?: number | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Width of the knob stroke.
|
|
82
|
+
* @defaultValue 14
|
|
83
|
+
*/
|
|
84
|
+
strokeWidth?: number | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Name of the input element.
|
|
87
|
+
*/
|
|
88
|
+
name?: string | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Background of the value.
|
|
91
|
+
* @defaultValue var(--primary-color, Black)
|
|
92
|
+
*/
|
|
93
|
+
valueColor?: string | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Background color of the range.
|
|
96
|
+
* @defaultValue var(--surface-border, LightGray)
|
|
97
|
+
*/
|
|
98
|
+
rangeColor?: string | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Color of the value text.
|
|
101
|
+
* @defaultValue var(--text-color-secondary, Black)
|
|
102
|
+
*/
|
|
103
|
+
textColor?: string | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Template string of the value.
|
|
106
|
+
* @defaultValue {value}
|
|
107
|
+
*/
|
|
108
|
+
valueTemplate?: string | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Callback to invoke on value change.
|
|
111
|
+
* @param {KnobChangeEvent} event - Custom change event
|
|
112
|
+
*/
|
|
113
|
+
onChange?(event: KnobChangeEvent): void;
|
|
114
|
+
/**
|
|
115
|
+
* Used to get the child elements of the component.
|
|
116
|
+
* @readonly
|
|
117
|
+
*/
|
|
118
|
+
children?: React.ReactNode | undefined;
|
|
27
119
|
}
|
|
28
120
|
|
|
121
|
+
/**
|
|
122
|
+
* **PrimeReact - Knob**
|
|
123
|
+
*
|
|
124
|
+
* _Knob is a form component to define number inputs with a dial._
|
|
125
|
+
*
|
|
126
|
+
* [Live Demo](https://www.primefaces.org/primereact/knob/)
|
|
127
|
+
* --- ---
|
|
128
|
+
* 
|
|
129
|
+
*
|
|
130
|
+
* @group Component
|
|
131
|
+
*/
|
|
29
132
|
export declare class Knob extends React.Component<KnobProps, any> {
|
|
133
|
+
/**
|
|
134
|
+
* Used to get container element.
|
|
135
|
+
* @return {HTMLDivElement} Container element
|
|
136
|
+
*/
|
|
30
137
|
public getElement(): HTMLDivElement;
|
|
31
138
|
}
|
package/listbox/listbox.cjs.js
CHANGED
|
@@ -510,6 +510,9 @@ var ListBox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.
|
|
|
510
510
|
React__namespace.useImperativeHandle(ref, function () {
|
|
511
511
|
return {
|
|
512
512
|
props: props,
|
|
513
|
+
focus: function focus() {
|
|
514
|
+
return utils.DomHandler.focusFirstElement(elementRef.current);
|
|
515
|
+
},
|
|
513
516
|
getElement: function getElement() {
|
|
514
517
|
return elementRef.current;
|
|
515
518
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),r=require("primereact/hooks"),n=require("primereact/tooltip"),l=require("primereact/utils"),i=require("primereact/virtualscroller"),o=require("primereact/inputtext"),a=require("primereact/ripple");function u(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 c=u(e);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}function p(e){return p="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},p(e)}function f(e,t){if("object"!==p(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){var t=f(e,"string");return"symbol"===p(t)?t:String(t)}function d(e,t,r){return(t=m(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(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 v(e){if(Array.isArray(e))return b(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e,t){if(e){if("string"==typeof e)return b(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)?b(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 O(e){return v(e)||y(e)||g(e)||h()}function j(e){if(Array.isArray(e))return e}function E(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,l,i,o,a=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw l}}return a}}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.")}var x=c.memo((function(e){var t={filter:function(e){return r(e)},reset:function(){return e.resetFilter()}},r=function(t){e.onFilter&&e.onFilter({originalEvent:t,value:t.target.value})},n=function(){var n=c.createElement("div",{className:"p-listbox-filter-container"},c.createElement(o.InputText,s({type:"text",value:e.filter,onChange:r,className:"p-listbox-filter",disabled:e.disabled,placeholder:e.filterPlaceholder},e.filterInputProps)),c.createElement("span",{className:"p-listbox-filter-icon pi pi-search"}));e.filterTemplate&&(n=l.ObjectUtils.getJSXElement(e.filterTemplate,{className:"p-listbox-filter-container",element:n,filterOptions:t,filterInputChange:r,filterIconClassName:"p-dropdown-filter-icon pi pi-search",props:e}));return c.createElement("div",{className:"p-listbox-header"},n)}();return c.createElement(c.Fragment,null,n)}));x.displayName="ListBoxHeader";var D=c.memo((function(e){var t=function(t){e.onClick&&e.onClick({originalEvent:t,option:e.option}),t.preventDefault()},r=function e(t){var r=t.nextElementSibling;return r?l.DomHandler.hasClass(r,"p-disabled")||l.DomHandler.hasClass(r,"p-listbox-item-group")?e(r):r:null},n=function e(t){var r=t.previousElementSibling;return r?l.DomHandler.hasClass(r,"p-disabled")||l.DomHandler.hasClass(r,"p-listbox-item-group")?e(r):r:null},i=l.classNames("p-listbox-item",{"p-highlight":e.selected,"p-disabled":e.disabled},e.option.className),o=e.template?l.ObjectUtils.getJSXElement(e.template,e.option):e.label;return c.createElement("li",{className:i,style:e.style,onClick:t,onTouchEnd:function(t){e.onTouchEnd&&e.onTouchEnd({originalEvent:t,option:e.option})},onKeyDown:function(e){var l=e.currentTarget;switch(e.which){case 40:var i=r(l);i&&i.focus(),e.preventDefault();break;case 38:var o=n(l);o&&o.focus(),e.preventDefault();break;case 13:t(e),e.preventDefault()}},tabIndex:"-1","aria-label":e.label,key:e.label,role:"option","aria-selected":e.selected,"aria-disabled":e.disabled},o,c.createElement(a.Ripple,null))}));function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function N(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=T(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,l=function(){};return{s:l,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function T(e,t){if(e){if("string"==typeof e)return C(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)?C(e,t):void 0}}function C(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}D.displayName="ListBoxItem";var F=c.memo(c.forwardRef((function(e,o){var a,u,p=c.useState(""),f=(u=2,j(a=p)||E(a,u)||g(a,u)||S()),m=f[0],d=f[1],b=c.useRef(null),v=c.useRef(null),y=c.useRef(!1),h=(e.onFilterValueChange?e.filterValue:m)||"",P=h&&h.trim().length>0,T=function(t){var r=t.option;e.disabled||H(r)||(e.multiple?L(t.originalEvent,r):I(t.originalEvent,r),y.current=!1)},C=function(){e.disabled||(y.current=!0)},I=function(t,r){var n=G(r),l=!1,i=null;!y.current&&e.metaKeySelection?n?(t.metaKey||t.ctrlKey)&&(i=null,l=!0):(i=B(r),l=!0):(i=n?null:B(r),l=!0);l&&M(t,i)},L=function(t,r){var n=G(r),l=!1,i=null;if(!y&&e.metaKeySelection){var o=t.metaKey||t.ctrlKey;n?(i=o?K(r):[B(r)],l=!0):(i=[].concat(O(i=o&&e.value||[]),[B(r)]),l=!0)}else i=n?K(r):[].concat(O(e.value||[]),[B(r)]),l=!0;l&&e.onChange({originalEvent:t,value:i,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:i}})},U=function(t){v.current&&v.current.scrollToIndex(0);var r=t.value;e.onFilterValueChange?e.onFilterValueChange({originalEvent:t.originalEvent,value:r}):d(r)},A=function(){d(""),e.onFilter&&e.onFilter({filter:""})},M=function(t,r){e.onChange&&e.onChange({originalEvent:t,value:r,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:r}})},K=function(t){return e.value.filter((function(r){return!l.ObjectUtils.equals(r,B(t),e.dataKey)}))},k=function(){if(null!=e.value&&Z){if(!e.optionGroupLabel)return V(e.value,Z);for(var t=0;t<Z.length;t++){var r=V(e.value,X(Z[t]));if(-1!==r)return{group:t,option:r}}}return-1},q=function(){return e.optionValue?null:e.dataKey},V=function(e,t){var r=q();return t.findIndex((function(t){return l.ObjectUtils.equals(e,B(t),r)}))},G=function(t){var r=B(t),n=q();return e.multiple&&e.value?e.value.some((function(e){return l.ObjectUtils.equals(e,r,n)})):l.ObjectUtils.equals(e.value,r,n)},_=function(t){return e.optionLabel?l.ObjectUtils.resolveFieldData(t,e.optionLabel):t&&void 0!==t.label?t.label:t},B=function(t){return e.optionValue?l.ObjectUtils.resolveFieldData(t,e.optionValue):t&&void 0!==t.value?t.value:t},R=function(t){return e.dataKey?l.ObjectUtils.resolveFieldData(t,e.dataKey):_(t)},H=function(t){return e.optionDisabled?l.ObjectUtils.isFunction(e.optionDisabled)?e.optionDisabled(t):l.ObjectUtils.resolveFieldData(t,e.optionDisabled):!(!t||void 0===t.disabled)&&t.disabled},z=function(t){return l.ObjectUtils.resolveFieldData(t,e.optionGroupLabel)},J=function(t){return l.ObjectUtils.resolveFieldData(t,e.optionGroupLabel)},X=function(t){return l.ObjectUtils.resolveFieldData(t,e.optionGroupChildren)},$=function(){if(v.current){var e=k();-1!==e&&setTimeout((function(){return v.current.scrollToIndex(e)}),0)}};c.useImperativeHandle(o,(function(){return{props:e,getElement:function(){return b.current},getVirtualScroller:function(){return v.current}}})),r.useMountEffect((function(){$()}));var Y=function(t,r){return X(t).map((function(t,n){var l=_(t),i=n+"_"+R(t),o=H(t),a=o?null:e.tabIndex||0;return c.createElement(D,{key:i,label:l,option:t,style:r,template:e.itemTemplate,selected:G(t),onClick:T,onTouchEnd:C,tabIndex:a,disabled:o})}))},Q=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={height:n.props?n.props.itemSize:void 0};if(e.optionGroupLabel){var o=e.optionGroupTemplate?l.ObjectUtils.getJSXElement(e.optionGroupTemplate,t,r):J(t),a=Y(t,i),u=r+"_"+z(t);return c.createElement(c.Fragment,{key:u},c.createElement("li",{className:"p-listbox-item-group",style:i,role:"group"},o),a)}var s=_(t),p=r+"_"+R(t),f=H(t),m=f?null:e.tabIndex||0;return c.createElement(D,{key:p,label:s,option:t,style:i,template:e.itemTemplate,selected:G(t),onClick:T,onTouchEnd:C,tabIndex:m,disabled:f})},W=function(r,n){var i=l.ObjectUtils.getJSXElement(r,e)||t.localeOption(n?"emptyFilterMessage":"emptyMessage");return c.createElement("li",{className:"p-listbox-empty-message"},i)},Z=function(){if(P){var r=h.trim().toLocaleLowerCase(e.filterLocale),n=e.filterBy?e.filterBy.split(","):[e.optionLabel||"label"];if(e.optionGroupLabel){var l,i=[],o=N(e.options);try{for(o.s();!(l=o.n()).done;){var a=l.value,u=t.FilterService.filter(X(a),n,r,e.filterMatchMode,e.filterLocale);u&&u.length&&i.push(w(w({},a),{items:u}))}}catch(e){o.e(e)}finally{o.f()}return i}return t.FilterService.filter(e.options,n,r,e.filterMatchMode,e.filterLocale)}return e.options}(),ee=l.ObjectUtils.isNotEmpty(e.tooltip),te=l.ObjectUtils.findDiffKeys(e,F.defaultProps),re=l.ObjectUtils.reduceKeys(te,l.DomHandler.ARIA_PROPS),ne=l.classNames("p-listbox p-component",{"p-disabled":e.disabled},e.className),le=l.classNames("p-listbox-list-wrapper",e.listClassName),ie=function(){if(e.virtualScrollerOptions){var t=w(w({},e.virtualScrollerOptions),{items:Z,onLazyLoad:function(t){return e.virtualScrollerOptions.onLazyLoad(w(w({},t),{filter:Z}))},itemTemplate:function(e,t){return e&&Q(e,t.index,t)},contentTemplate:function(t){var r=l.classNames("p-listbox-list",t.className);return c.createElement("ul",s({ref:t.contentRef,className:r,role:"listbox","aria-multiselectable":e.multiple},re),t.children)}});return c.createElement(i.VirtualScroller,s({ref:v},t))}var r=l.ObjectUtils.isNotEmpty(Z)?Z.map(Q):P?W(e.emptyFilterMessage,!0):W(e.emptyMessage);return c.createElement("ul",s({className:"p-listbox-list",role:"listbox","aria-multiselectable":e.multiple},re),r)}(),oe=e.filter?c.createElement(x,{filter:h,onFilter:U,resetFilter:A,filterTemplate:e.filterTemplate,disabled:e.disabled,filterPlaceholder:e.filterPlaceholder,filterInputProps:e.filterInputProps}):null;return c.createElement(c.Fragment,null,c.createElement("div",s({ref:b,id:e.id,className:ne,style:e.style},te),oe,c.createElement("div",{className:le,style:e.listStyle},ie)),ee&&c.createElement(n.Tooltip,s({target:b,content:e.tooltip},e.tooltipOptions)))})));F.displayName="ListBox",F.defaultProps={__TYPE:"ListBox",className:null,dataKey:null,disabled:null,emptyFilterMessage:null,emptyMessage:null,filter:!1,filterBy:null,filterInputProps:null,filterLocale:void 0,filterMatchMode:"contains",filterPlaceholder:null,filterTemplate:null,filterValue:null,id:null,itemTemplate:null,listClassName:null,listStyle:null,metaKeySelection:!1,multiple:!1,onChange:null,onFilterValueChange:null,optionDisabled:null,optionGroupChildren:null,optionGroupLabel:null,optionGroupTemplate:null,optionLabel:null,optionValue:null,options:null,style:null,tabIndex:0,tooltip:null,tooltipOptions:null,value:null,virtualScrollerOptions:null},exports.ListBox=F;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),r=require("primereact/hooks"),n=require("primereact/tooltip"),l=require("primereact/utils"),i=require("primereact/virtualscroller"),o=require("primereact/inputtext"),a=require("primereact/ripple");function u(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 c=u(e);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}function p(e){return p="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},p(e)}function f(e,t){if("object"!==p(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){var t=f(e,"string");return"symbol"===p(t)?t:String(t)}function d(e,t,r){return(t=m(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(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 v(e){if(Array.isArray(e))return b(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e,t){if(e){if("string"==typeof e)return b(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)?b(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 O(e){return v(e)||y(e)||g(e)||h()}function E(e){if(Array.isArray(e))return e}function j(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,l,i,o,a=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw l}}return a}}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.")}var x=c.memo((function(e){var t={filter:function(e){return r(e)},reset:function(){return e.resetFilter()}},r=function(t){e.onFilter&&e.onFilter({originalEvent:t,value:t.target.value})},n=function(){var n=c.createElement("div",{className:"p-listbox-filter-container"},c.createElement(o.InputText,s({type:"text",value:e.filter,onChange:r,className:"p-listbox-filter",disabled:e.disabled,placeholder:e.filterPlaceholder},e.filterInputProps)),c.createElement("span",{className:"p-listbox-filter-icon pi pi-search"}));e.filterTemplate&&(n=l.ObjectUtils.getJSXElement(e.filterTemplate,{className:"p-listbox-filter-container",element:n,filterOptions:t,filterInputChange:r,filterIconClassName:"p-dropdown-filter-icon pi pi-search",props:e}));return c.createElement("div",{className:"p-listbox-header"},n)}();return c.createElement(c.Fragment,null,n)}));x.displayName="ListBoxHeader";var D=c.memo((function(e){var t=function(t){e.onClick&&e.onClick({originalEvent:t,option:e.option}),t.preventDefault()},r=function e(t){var r=t.nextElementSibling;return r?l.DomHandler.hasClass(r,"p-disabled")||l.DomHandler.hasClass(r,"p-listbox-item-group")?e(r):r:null},n=function e(t){var r=t.previousElementSibling;return r?l.DomHandler.hasClass(r,"p-disabled")||l.DomHandler.hasClass(r,"p-listbox-item-group")?e(r):r:null},i=l.classNames("p-listbox-item",{"p-highlight":e.selected,"p-disabled":e.disabled},e.option.className),o=e.template?l.ObjectUtils.getJSXElement(e.template,e.option):e.label;return c.createElement("li",{className:i,style:e.style,onClick:t,onTouchEnd:function(t){e.onTouchEnd&&e.onTouchEnd({originalEvent:t,option:e.option})},onKeyDown:function(e){var l=e.currentTarget;switch(e.which){case 40:var i=r(l);i&&i.focus(),e.preventDefault();break;case 38:var o=n(l);o&&o.focus(),e.preventDefault();break;case 13:t(e),e.preventDefault()}},tabIndex:"-1","aria-label":e.label,key:e.label,role:"option","aria-selected":e.selected,"aria-disabled":e.disabled},o,c.createElement(a.Ripple,null))}));function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function N(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=T(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,l=function(){};return{s:l,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function T(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 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}D.displayName="ListBoxItem";var C=c.memo(c.forwardRef((function(e,o){var a,u,p=c.useState(""),f=(u=2,E(a=p)||j(a,u)||g(a,u)||S()),m=f[0],d=f[1],b=c.useRef(null),v=c.useRef(null),y=c.useRef(!1),h=(e.onFilterValueChange?e.filterValue:m)||"",P=h&&h.trim().length>0,T=function(t){var r=t.option;e.disabled||R(r)||(e.multiple?L(t.originalEvent,r):I(t.originalEvent,r),y.current=!1)},F=function(){e.disabled||(y.current=!0)},I=function(t,r){var n=G(r),l=!1,i=null;!y.current&&e.metaKeySelection?n?(t.metaKey||t.ctrlKey)&&(i=null,l=!0):(i=B(r),l=!0):(i=n?null:B(r),l=!0);l&&M(t,i)},L=function(t,r){var n=G(r),l=!1,i=null;if(!y&&e.metaKeySelection){var o=t.metaKey||t.ctrlKey;n?(i=o?K(r):[B(r)],l=!0):(i=[].concat(O(i=o&&e.value||[]),[B(r)]),l=!0)}else i=n?K(r):[].concat(O(e.value||[]),[B(r)]),l=!0;l&&e.onChange({originalEvent:t,value:i,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:i}})},U=function(t){v.current&&v.current.scrollToIndex(0);var r=t.value;e.onFilterValueChange?e.onFilterValueChange({originalEvent:t.originalEvent,value:r}):d(r)},A=function(){d(""),e.onFilter&&e.onFilter({filter:""})},M=function(t,r){e.onChange&&e.onChange({originalEvent:t,value:r,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:r}})},K=function(t){return e.value.filter((function(r){return!l.ObjectUtils.equals(r,B(t),e.dataKey)}))},k=function(){if(null!=e.value&&Z){if(!e.optionGroupLabel)return V(e.value,Z);for(var t=0;t<Z.length;t++){var r=V(e.value,X(Z[t]));if(-1!==r)return{group:t,option:r}}}return-1},q=function(){return e.optionValue?null:e.dataKey},V=function(e,t){var r=q();return t.findIndex((function(t){return l.ObjectUtils.equals(e,B(t),r)}))},G=function(t){var r=B(t),n=q();return e.multiple&&e.value?e.value.some((function(e){return l.ObjectUtils.equals(e,r,n)})):l.ObjectUtils.equals(e.value,r,n)},_=function(t){return e.optionLabel?l.ObjectUtils.resolveFieldData(t,e.optionLabel):t&&void 0!==t.label?t.label:t},B=function(t){return e.optionValue?l.ObjectUtils.resolveFieldData(t,e.optionValue):t&&void 0!==t.value?t.value:t},H=function(t){return e.dataKey?l.ObjectUtils.resolveFieldData(t,e.dataKey):_(t)},R=function(t){return e.optionDisabled?l.ObjectUtils.isFunction(e.optionDisabled)?e.optionDisabled(t):l.ObjectUtils.resolveFieldData(t,e.optionDisabled):!(!t||void 0===t.disabled)&&t.disabled},z=function(t){return l.ObjectUtils.resolveFieldData(t,e.optionGroupLabel)},J=function(t){return l.ObjectUtils.resolveFieldData(t,e.optionGroupLabel)},X=function(t){return l.ObjectUtils.resolveFieldData(t,e.optionGroupChildren)},$=function(){if(v.current){var e=k();-1!==e&&setTimeout((function(){return v.current.scrollToIndex(e)}),0)}};c.useImperativeHandle(o,(function(){return{props:e,focus:function(){return l.DomHandler.focusFirstElement(b.current)},getElement:function(){return b.current},getVirtualScroller:function(){return v.current}}})),r.useMountEffect((function(){$()}));var Y=function(t,r){return X(t).map((function(t,n){var l=_(t),i=n+"_"+H(t),o=R(t),a=o?null:e.tabIndex||0;return c.createElement(D,{key:i,label:l,option:t,style:r,template:e.itemTemplate,selected:G(t),onClick:T,onTouchEnd:F,tabIndex:a,disabled:o})}))},Q=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={height:n.props?n.props.itemSize:void 0};if(e.optionGroupLabel){var o=e.optionGroupTemplate?l.ObjectUtils.getJSXElement(e.optionGroupTemplate,t,r):J(t),a=Y(t,i),u=r+"_"+z(t);return c.createElement(c.Fragment,{key:u},c.createElement("li",{className:"p-listbox-item-group",style:i,role:"group"},o),a)}var s=_(t),p=r+"_"+H(t),f=R(t),m=f?null:e.tabIndex||0;return c.createElement(D,{key:p,label:s,option:t,style:i,template:e.itemTemplate,selected:G(t),onClick:T,onTouchEnd:F,tabIndex:m,disabled:f})},W=function(r,n){var i=l.ObjectUtils.getJSXElement(r,e)||t.localeOption(n?"emptyFilterMessage":"emptyMessage");return c.createElement("li",{className:"p-listbox-empty-message"},i)},Z=function(){if(P){var r=h.trim().toLocaleLowerCase(e.filterLocale),n=e.filterBy?e.filterBy.split(","):[e.optionLabel||"label"];if(e.optionGroupLabel){var l,i=[],o=N(e.options);try{for(o.s();!(l=o.n()).done;){var a=l.value,u=t.FilterService.filter(X(a),n,r,e.filterMatchMode,e.filterLocale);u&&u.length&&i.push(w(w({},a),{items:u}))}}catch(e){o.e(e)}finally{o.f()}return i}return t.FilterService.filter(e.options,n,r,e.filterMatchMode,e.filterLocale)}return e.options}(),ee=l.ObjectUtils.isNotEmpty(e.tooltip),te=l.ObjectUtils.findDiffKeys(e,C.defaultProps),re=l.ObjectUtils.reduceKeys(te,l.DomHandler.ARIA_PROPS),ne=l.classNames("p-listbox p-component",{"p-disabled":e.disabled},e.className),le=l.classNames("p-listbox-list-wrapper",e.listClassName),ie=function(){if(e.virtualScrollerOptions){var t=w(w({},e.virtualScrollerOptions),{items:Z,onLazyLoad:function(t){return e.virtualScrollerOptions.onLazyLoad(w(w({},t),{filter:Z}))},itemTemplate:function(e,t){return e&&Q(e,t.index,t)},contentTemplate:function(t){var r=l.classNames("p-listbox-list",t.className);return c.createElement("ul",s({ref:t.contentRef,className:r,role:"listbox","aria-multiselectable":e.multiple},re),t.children)}});return c.createElement(i.VirtualScroller,s({ref:v},t))}var r=l.ObjectUtils.isNotEmpty(Z)?Z.map(Q):P?W(e.emptyFilterMessage,!0):W(e.emptyMessage);return c.createElement("ul",s({className:"p-listbox-list",role:"listbox","aria-multiselectable":e.multiple},re),r)}(),oe=e.filter?c.createElement(x,{filter:h,onFilter:U,resetFilter:A,filterTemplate:e.filterTemplate,disabled:e.disabled,filterPlaceholder:e.filterPlaceholder,filterInputProps:e.filterInputProps}):null;return c.createElement(c.Fragment,null,c.createElement("div",s({ref:b,id:e.id,className:ne,style:e.style},te),oe,c.createElement("div",{className:le,style:e.listStyle},ie)),ee&&c.createElement(n.Tooltip,s({target:b,content:e.tooltip},e.tooltipOptions)))})));C.displayName="ListBox",C.defaultProps={__TYPE:"ListBox",className:null,dataKey:null,disabled:null,emptyFilterMessage:null,emptyMessage:null,filter:!1,filterBy:null,filterInputProps:null,filterLocale:void 0,filterMatchMode:"contains",filterPlaceholder:null,filterTemplate:null,filterValue:null,id:null,itemTemplate:null,listClassName:null,listStyle:null,metaKeySelection:!1,multiple:!1,onChange:null,onFilterValueChange:null,optionDisabled:null,optionGroupChildren:null,optionGroupLabel:null,optionGroupTemplate:null,optionLabel:null,optionValue:null,options:null,style:null,tabIndex:0,tooltip:null,tooltipOptions:null,value:null,virtualScrollerOptions:null},exports.ListBox=C;
|
package/listbox/listbox.d.ts
CHANGED
|
@@ -1,93 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* ListBox is used to select one or more values from a list of items.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/listbox/)
|
|
6
|
+
*
|
|
7
|
+
* @module listbox
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
import { SelectItemOptionsType } from '../selectitem/selectitem';
|
|
3
|
-
import TooltipOptions from '../tooltip/tooltipoptions';
|
|
12
|
+
import { TooltipOptions } from '../tooltip/tooltipoptions';
|
|
4
13
|
import { VirtualScroller, VirtualScrollerProps } from '../virtualscroller';
|
|
5
14
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type ListBoxFilterTemplateType = React.ReactNode | ((options: ListBoxFilterTemplateOptions) => React.ReactNode);
|
|
11
|
-
|
|
12
|
-
type ListBoxEmptyMessageType = React.ReactNode | ((props: ListBoxProps) => React.ReactNode);
|
|
13
|
-
|
|
14
|
-
type ListBoxEmptyFilterMessageType = React.ReactNode | ((props: ListBoxProps) => React.ReactNode);
|
|
15
|
-
|
|
16
|
-
type ListBoxOptionDisabledType = string | ((option: any) => boolean);
|
|
17
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Custom change target options.
|
|
17
|
+
* @group Misc
|
|
18
|
+
*/
|
|
18
19
|
interface ListBoxChangeTargetOptions {
|
|
20
|
+
/**
|
|
21
|
+
* The name of the target.
|
|
22
|
+
*/
|
|
19
23
|
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* Unique identifier of the element.
|
|
26
|
+
*/
|
|
20
27
|
id: string;
|
|
28
|
+
/**
|
|
29
|
+
* New value of the element.
|
|
30
|
+
*/
|
|
21
31
|
value: any;
|
|
22
32
|
}
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Custom change event.
|
|
36
|
+
* @see {@link ListBoxProps.onChange}
|
|
37
|
+
* @event
|
|
38
|
+
*/
|
|
39
|
+
interface ListBoxChangeEvent {
|
|
40
|
+
/**
|
|
41
|
+
* Browser event.
|
|
42
|
+
*/
|
|
25
43
|
originalEvent: React.SyntheticEvent;
|
|
44
|
+
/**
|
|
45
|
+
* Single value or an array of values depending on the selection mode
|
|
46
|
+
*/
|
|
26
47
|
value: any;
|
|
48
|
+
/**
|
|
49
|
+
* Stops the event from propagating.
|
|
50
|
+
*/
|
|
27
51
|
stopPropagation(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Prevents the default action of the event.
|
|
54
|
+
*/
|
|
28
55
|
preventDefault(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Target element.
|
|
58
|
+
*/
|
|
29
59
|
target: ListBoxChangeTargetOptions;
|
|
30
60
|
}
|
|
31
61
|
|
|
32
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Custom filter value change event.
|
|
64
|
+
* @see {@link ListBoxProps.onFilterValueChange}
|
|
65
|
+
* @event
|
|
66
|
+
*/
|
|
67
|
+
interface ListBoxFilterValueChangeEvent {
|
|
68
|
+
/**
|
|
69
|
+
* Browser event.
|
|
70
|
+
*/
|
|
33
71
|
originalEvent: React.SyntheticEvent;
|
|
72
|
+
/**
|
|
73
|
+
* The filtered value
|
|
74
|
+
*/
|
|
34
75
|
value: any;
|
|
35
76
|
}
|
|
36
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Custom filter template options.
|
|
80
|
+
* @group Misc
|
|
81
|
+
*/
|
|
37
82
|
interface ListBoxFilterTemplateOptions {
|
|
83
|
+
/**
|
|
84
|
+
* Style class of the filter.
|
|
85
|
+
*/
|
|
38
86
|
className: string;
|
|
87
|
+
/**
|
|
88
|
+
* Whether the option is disabled or not
|
|
89
|
+
*/
|
|
39
90
|
disabled?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The filter element.
|
|
93
|
+
*/
|
|
40
94
|
element: HTMLDivElement;
|
|
95
|
+
/**
|
|
96
|
+
* The filter.
|
|
97
|
+
*/
|
|
41
98
|
filter?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Style class of the filter icon.
|
|
101
|
+
*/
|
|
42
102
|
filterIconClassName: string;
|
|
103
|
+
/**
|
|
104
|
+
* Browser change event for the filter input element.
|
|
105
|
+
*/
|
|
43
106
|
filterInputChange?: React.ChangeEvent<HTMLInputElement>;
|
|
107
|
+
/**
|
|
108
|
+
* The props of the filter input element.
|
|
109
|
+
*/
|
|
44
110
|
filterInputProps?: any;
|
|
111
|
+
/**
|
|
112
|
+
* The filter input options.
|
|
113
|
+
*/
|
|
45
114
|
filterOptions?: ListBoxFilterOptions;
|
|
115
|
+
/**
|
|
116
|
+
* The placeholder of the filter element.
|
|
117
|
+
*/
|
|
46
118
|
filterPlaceholder?: string;
|
|
47
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Custom filter template.
|
|
121
|
+
*/
|
|
122
|
+
filterTemplate?: React.ReactNode | ((options: ListBoxFilterTemplateOptions) => React.ReactNode);
|
|
48
123
|
}
|
|
49
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Custom filter options.
|
|
127
|
+
* @group Misc
|
|
128
|
+
*/
|
|
50
129
|
interface ListBoxFilterOptions {
|
|
130
|
+
/**
|
|
131
|
+
* Used to filter options
|
|
132
|
+
* @param { React.ChangeEvent<HTMLInputElement>} event - Browser event.
|
|
133
|
+
*/
|
|
51
134
|
filter?: (event?: React.ChangeEvent<HTMLInputElement>) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Used to reset the filtered options
|
|
137
|
+
*/
|
|
52
138
|
reset?: () => void;
|
|
53
139
|
}
|
|
54
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Defines valid properties in ListBox component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
143
|
+
* @group Properties
|
|
144
|
+
*/
|
|
55
145
|
export interface ListBoxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange' | 'ref'> {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
|
148
|
+
*/
|
|
149
|
+
ariaLabelledBy?: string | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Used to get the child elements of the component.
|
|
152
|
+
* @readonly
|
|
153
|
+
*/
|
|
154
|
+
children?: React.ReactNode | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* A property to uniquely match the value in options for better performance.
|
|
157
|
+
* @defaultValue false
|
|
158
|
+
*/
|
|
159
|
+
dataKey?: string | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* When specified, disables the component.
|
|
162
|
+
* @defaultValue false
|
|
163
|
+
*/
|
|
164
|
+
disabled?: boolean | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Text to display when there is no data.
|
|
167
|
+
*/
|
|
168
|
+
emptyMessage?: React.ReactNode | ((props: ListBoxProps) => React.ReactNode);
|
|
169
|
+
/**
|
|
170
|
+
* Template to display when filtering does not return any results.
|
|
171
|
+
*/
|
|
172
|
+
emptyFilterMessage?: React.ReactNode | ((props: ListBoxProps) => React.ReactNode);
|
|
173
|
+
/**
|
|
174
|
+
* When specified, displays a filter input at header.
|
|
175
|
+
* @defaultValue false
|
|
176
|
+
*/
|
|
177
|
+
filter?: boolean | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* When filtering is enabled, filterBy decides which field or fields (comma separated) to search against.
|
|
180
|
+
* @defaultValue label
|
|
181
|
+
*/
|
|
182
|
+
filterBy?: string | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Props for the filter input, any prop is passed implicity to the filter input element.
|
|
185
|
+
* @defaultValue undefined
|
|
186
|
+
*/
|
|
187
|
+
filterInputProps?: any | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Locale to use in filtering. The default locale is the host environment's current locale.
|
|
190
|
+
* @defaultValue undefined
|
|
191
|
+
*/
|
|
192
|
+
filterLocale?: string | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Defines how the items are filtered, valid values are "contains" (default), "startsWith", "endsWith", "equals" and "notEquals".
|
|
195
|
+
* @defaultValue contains
|
|
196
|
+
*/
|
|
197
|
+
filterMatchMode?: string | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Placeholder text to show when filter input is empty.
|
|
200
|
+
*/
|
|
201
|
+
filterPlaceholder?: string | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Custom template for the filter element.
|
|
204
|
+
*/
|
|
205
|
+
filterTemplate?: React.ReactNode | ((options: ListBoxFilterTemplateOptions) => React.ReactNode);
|
|
206
|
+
/**
|
|
207
|
+
* When specified, filter displays with this value.
|
|
208
|
+
*/
|
|
209
|
+
filterValue?: string | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* Custom template for the items.
|
|
212
|
+
*/
|
|
213
|
+
itemTemplate?: React.ReactNode | ((option: any) => React.ReactNode);
|
|
214
|
+
/**
|
|
215
|
+
* Inline style class of inner list element.
|
|
216
|
+
*/
|
|
217
|
+
listClassName?: string | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* Inline style of inner list element.
|
|
220
|
+
*/
|
|
221
|
+
listStyle?: React.CSSProperties | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Defines how multiple items can be selected, when true metaKey needs to be pressed to select or unselect an item and when set to false selection of each item can be toggled individually. On touch enabled devices, metaKeySelection is turned off automatically.
|
|
224
|
+
* @defaultValue true
|
|
225
|
+
*/
|
|
226
|
+
metaKeySelection?: boolean | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* When specified, allows selecting multiple values.
|
|
229
|
+
* @defaultValue false
|
|
230
|
+
*/
|
|
231
|
+
multiple?: boolean | undefined;
|
|
232
|
+
/**
|
|
233
|
+
* Property name or getter function to use as the disabled flag of an option, defaults to false when not defined.
|
|
234
|
+
*/
|
|
235
|
+
optionDisabled?: string | ((option: any) => boolean) | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Property name or getter function that refers to the children options of option group.
|
|
238
|
+
*/
|
|
239
|
+
optionGroupChildren?: string | undefined;
|
|
240
|
+
/**
|
|
241
|
+
* Property name or getter function to use as the label of an option group.
|
|
242
|
+
*/
|
|
243
|
+
optionGroupLabel?: string | undefined;
|
|
244
|
+
/**
|
|
245
|
+
* Template of an option group item.
|
|
246
|
+
*/
|
|
247
|
+
optionGroupTemplate?: React.ReactNode | ((option: any, index: number) => React.ReactNode);
|
|
248
|
+
/**
|
|
249
|
+
* Name of the label field of an option when an arbitrary objects instead of SelectItems are used as options.
|
|
250
|
+
*/
|
|
251
|
+
optionLabel?: string | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* Name of the value field of an option when arbitrary objects are used as options instead of SelectItems.
|
|
254
|
+
*/
|
|
255
|
+
optionValue?: string | undefined;
|
|
256
|
+
/**
|
|
257
|
+
* An array of objects to display as the available options.
|
|
258
|
+
*/
|
|
259
|
+
options?: SelectItemOptionsType | undefined;
|
|
260
|
+
/**
|
|
261
|
+
* Content of the tooltip.
|
|
262
|
+
*/
|
|
263
|
+
tooltip?: string | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* Configuration of the tooltip, refer to the tooltip documentation for more information.
|
|
266
|
+
*/
|
|
267
|
+
tooltipOptions?: TooltipOptions | undefined;
|
|
268
|
+
/**
|
|
269
|
+
* Selected value to display.
|
|
270
|
+
*/
|
|
271
|
+
value?: any | undefined;
|
|
272
|
+
/**
|
|
273
|
+
* Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it.
|
|
274
|
+
* @type {VirtualScrollerProps}
|
|
275
|
+
*/
|
|
276
|
+
virtualScrollerOptions?: VirtualScrollerProps | undefined;
|
|
277
|
+
/**
|
|
278
|
+
* Callback to invoke when value of listbox changes.
|
|
279
|
+
* @param {ListBoxChangeEvent} event - Custom change event.
|
|
280
|
+
*/
|
|
281
|
+
onChange?(event: ListBoxChangeEvent): void;
|
|
282
|
+
/**
|
|
283
|
+
* Callback to invoke when filter value changes.
|
|
284
|
+
* @param {ListBoxFilterValueChangeEvent} event - Custom filter value change event.
|
|
285
|
+
*/
|
|
286
|
+
onFilterValueChange?(event: ListBoxFilterValueChangeEvent): void;
|
|
88
287
|
}
|
|
89
288
|
|
|
289
|
+
/**
|
|
290
|
+
* **PrimeReact - ListBox**
|
|
291
|
+
*
|
|
292
|
+
* _ListBox is used to select one or more values from a list of items._
|
|
293
|
+
*
|
|
294
|
+
* [Live Demo](https://www.primefaces.org/primereact/listbox/)
|
|
295
|
+
* --- ---
|
|
296
|
+
* 
|
|
297
|
+
*
|
|
298
|
+
* @group Component
|
|
299
|
+
*/
|
|
90
300
|
export declare class ListBox extends React.Component<ListBoxProps, any> {
|
|
301
|
+
/**
|
|
302
|
+
* Used to focus the component.
|
|
303
|
+
*/
|
|
304
|
+
public focus(): void;
|
|
305
|
+
/**
|
|
306
|
+
* Used to get container element.
|
|
307
|
+
* @return {HTMLSpanElement} Container element
|
|
308
|
+
*/
|
|
91
309
|
public getElement(): HTMLDivElement;
|
|
310
|
+
/**
|
|
311
|
+
* Used to get the virtual scroller instance.
|
|
312
|
+
* @return {VirtualScroller} Virtual Scroller instance
|
|
313
|
+
*/
|
|
92
314
|
public getVirtualScroller(): VirtualScroller;
|
|
93
315
|
}
|
package/listbox/listbox.esm.js
CHANGED
|
@@ -486,6 +486,9 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (p
|
|
|
486
486
|
React.useImperativeHandle(ref, function () {
|
|
487
487
|
return {
|
|
488
488
|
props: props,
|
|
489
|
+
focus: function focus() {
|
|
490
|
+
return DomHandler.focusFirstElement(elementRef.current);
|
|
491
|
+
},
|
|
489
492
|
getElement: function getElement() {
|
|
490
493
|
return elementRef.current;
|
|
491
494
|
},
|