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/chart/chart.d.ts
CHANGED
|
@@ -1,23 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Chart components are based on Chart.js, an open source HTML5 based charting library.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/chart)
|
|
6
|
+
*
|
|
7
|
+
* @module chart
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Defines valid properties in Chart component.
|
|
14
|
+
* @group Properties
|
|
15
|
+
*/
|
|
3
16
|
export interface ChartProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Unique identifier of the element.
|
|
19
|
+
*/
|
|
20
|
+
id?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Type of the chart.
|
|
23
|
+
*/
|
|
24
|
+
type?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Data to display.
|
|
27
|
+
*/
|
|
28
|
+
data?: object | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Options to customize the chart.
|
|
31
|
+
*/
|
|
32
|
+
options?: object | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Used to custom plugins of the chart.
|
|
35
|
+
*/
|
|
36
|
+
plugins?: any[] | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Width of the chart in non-responsive mode.
|
|
39
|
+
*/
|
|
40
|
+
width?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Height of the chart in non-responsive mode.
|
|
43
|
+
*/
|
|
44
|
+
height?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Inline style of the element.
|
|
47
|
+
*/
|
|
48
|
+
style?: React.CSSProperties | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Style class of the element.
|
|
51
|
+
*/
|
|
52
|
+
className?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Used to get the child elements of the component.
|
|
55
|
+
* @readonly
|
|
56
|
+
*/
|
|
57
|
+
children?: React.ReactNode | undefined;
|
|
14
58
|
}
|
|
15
59
|
|
|
60
|
+
/**
|
|
61
|
+
* **PrimeReact - Chart**
|
|
62
|
+
*
|
|
63
|
+
* _Chart components are based on Chart.js, an open source HTML5 based charting library._
|
|
64
|
+
*
|
|
65
|
+
* [Live Demo](https://www.primefaces.org/primereact/chart/)
|
|
66
|
+
* --- ---
|
|
67
|
+
* 
|
|
68
|
+
*
|
|
69
|
+
* @group Component
|
|
70
|
+
*/
|
|
16
71
|
export declare class Chart extends React.Component<ChartProps, any> {
|
|
72
|
+
/**
|
|
73
|
+
* Used to get canvas element.
|
|
74
|
+
* @return {HTMLCanvasElement} Canvas element
|
|
75
|
+
*/
|
|
17
76
|
public getCanvas(): HTMLCanvasElement;
|
|
77
|
+
/**
|
|
78
|
+
* Used to get chart instance.
|
|
79
|
+
* @return {*} Chart instance
|
|
80
|
+
*/
|
|
18
81
|
public getChart(): any;
|
|
82
|
+
/**
|
|
83
|
+
* Used to get base64 image.
|
|
84
|
+
* @return {*} base64 image
|
|
85
|
+
*/
|
|
19
86
|
public getBase64Image(): any;
|
|
87
|
+
/**
|
|
88
|
+
* Used to generate legend.
|
|
89
|
+
* @return {string} Generated legend
|
|
90
|
+
*/
|
|
20
91
|
public generateLegend(): string;
|
|
92
|
+
/**
|
|
93
|
+
* Redraws the graph.
|
|
94
|
+
*/
|
|
21
95
|
public refresh(): void;
|
|
96
|
+
/**
|
|
97
|
+
* Used to get container element.
|
|
98
|
+
* @return {HTMLDivElement} Container element
|
|
99
|
+
*/
|
|
22
100
|
public getElement(): HTMLDivElement;
|
|
23
101
|
}
|
package/checkbox/checkbox.cjs.js
CHANGED
|
@@ -142,7 +142,8 @@ var Checkbox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
142
142
|
setFocusedState(false);
|
|
143
143
|
};
|
|
144
144
|
var onKeyDown = function onKeyDown(event) {
|
|
145
|
-
if (event.code === 'Space') {
|
|
145
|
+
if (event.code === 'Space' || event.key === ' ') {
|
|
146
|
+
// event.key is for Android support
|
|
146
147
|
onClick(event);
|
|
147
148
|
}
|
|
148
149
|
};
|
|
@@ -152,6 +153,9 @@ var Checkbox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
152
153
|
React__namespace.useImperativeHandle(ref, function () {
|
|
153
154
|
return {
|
|
154
155
|
props: props,
|
|
156
|
+
focus: function focus() {
|
|
157
|
+
return utils.DomHandler.focus(inputRef.current);
|
|
158
|
+
},
|
|
155
159
|
getElement: function getElement() {
|
|
156
160
|
return elementRef.current;
|
|
157
161
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/hooks"),n=require("primereact/tooltip"),r=require("primereact/utils");function o(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
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/hooks"),n=require("primereact/tooltip"),r=require("primereact/utils");function o(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 c=o(e);function l(){return l=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},l.apply(this,arguments)}function a(e){if(Array.isArray(e))return e}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c,l,a=[],u=!0,i=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=c.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){i=!0,o=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(i)throw o}}return a}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}function f(){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 d=c.memo(c.forwardRef((function(e,o){var i,p,b=c.useState(!1),m=(p=2,a(i=b)||u(i,p)||s(i,p)||f()),h=m[0],y=m[1],v=c.useRef(null),g=c.useRef(e.inputRef),k=function(t){if(!e.disabled&&!e.readOnly&&e.onChange){var n=O(),o=t.target instanceof HTMLDivElement||t.target instanceof HTMLSpanElement;if(t.target===g.current||o&&t.target.checked!==n){var c=n?e.falseValue:e.trueValue;e.onChange({originalEvent:t,value:e.value,checked:c,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:e.name,id:e.id,value:e.value,checked:c}})}r.DomHandler.focus(g.current),t.preventDefault()}},O=function(){return e.checked===e.trueValue};c.useImperativeHandle(o,(function(){return{props:e,focus:function(){return r.DomHandler.focus(g.current)},getElement:function(){return v.current},getInput:function(){return g.current}}})),c.useEffect((function(){r.ObjectUtils.combinedRefs(g,e.inputRef)}),[g,e.inputRef]),t.useUpdateEffect((function(){g.current.checked=O()}),[e.checked,e.trueValue]);var x=O(),j=r.ObjectUtils.isNotEmpty(e.tooltip),E=r.ObjectUtils.findDiffKeys(e,d.defaultProps),I=r.ObjectUtils.reduceKeys(E,r.DomHandler.ARIA_PROPS),C=r.classNames("p-checkbox p-component",{"p-checkbox-checked":x,"p-checkbox-disabled":e.disabled,"p-checkbox-focused":h},e.className),D=r.classNames("p-checkbox-box",{"p-highlight":x,"p-disabled":e.disabled,"p-focus":h}),w=r.IconUtils.getJSXIcon(x?e.icon:"",{className:"p-checkbox-icon p-c"},{props:e,checked:x});return c.createElement(c.Fragment,null,c.createElement("div",l({ref:v,id:e.id,className:C,style:e.style},E,{onClick:k,onContextMenu:e.onContextMenu,onMouseDown:e.onMouseDown}),c.createElement("div",{className:"p-hidden-accessible"},c.createElement("input",l({ref:g,type:"checkbox",id:e.inputId,name:e.name,tabIndex:e.tabIndex,defaultChecked:x,onFocus:function(){y(!0)},onBlur:function(){y(!1)},onKeyDown:function(e){"Space"!==e.code&&" "!==e.key||k(e)},disabled:e.disabled,readOnly:e.readOnly,required:e.required},I))),c.createElement("div",{className:D},w)),j&&c.createElement(n.Tooltip,l({target:v,content:e.tooltip},e.tooltipOptions)))})));d.displayName="Checkbox",d.defaultProps={__TYPE:"Checkbox",id:null,inputRef:null,inputId:null,value:null,name:null,checked:!1,trueValue:!0,falseValue:!1,style:null,className:null,disabled:!1,required:!1,readOnly:!1,tabIndex:null,icon:"pi pi-check",tooltip:null,tooltipOptions:null,onChange:null,onMouseDown:null,onContextMenu:null},exports.Checkbox=d;
|
package/checkbox/checkbox.d.ts
CHANGED
|
@@ -1,49 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Checkbox is an extension to standard checkbox element with skinning capabilities.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/checkbox/)
|
|
6
|
+
*
|
|
7
|
+
* @module checkbox
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
|
-
import TooltipOptions from '../tooltip/tooltipoptions';
|
|
11
|
+
import { TooltipOptions } from '../tooltip/tooltipoptions';
|
|
12
|
+
import { FormEvent } from '../ts-helpers';
|
|
3
13
|
import { IconType } from '../utils';
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface CheckboxChangeParams {
|
|
14
|
-
originalEvent: React.SyntheticEvent;
|
|
15
|
-
value: any;
|
|
16
|
-
checked: boolean;
|
|
17
|
-
stopPropagation(): void;
|
|
18
|
-
preventDefault(): void;
|
|
19
|
-
target: CheckboxChangeTargetOptions;
|
|
20
|
-
}
|
|
15
|
+
/**
|
|
16
|
+
* Custom change event.
|
|
17
|
+
* @see {@link CheckboxProps.onChange}
|
|
18
|
+
* @extends {FormEvent}
|
|
19
|
+
* @event
|
|
20
|
+
*/
|
|
21
|
+
interface CheckboxChangeEvent extends FormEvent {}
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Defines valid properties in Checkbox component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
25
|
+
* @group Properties
|
|
26
|
+
*/
|
|
22
27
|
export interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange' | 'ref'> {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Unique identifier of the element.
|
|
30
|
+
*/
|
|
31
|
+
id?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Reference of the input element.
|
|
34
|
+
*/
|
|
35
|
+
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Identifier of the input element.
|
|
38
|
+
*/
|
|
39
|
+
inputId?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Value of the component.
|
|
42
|
+
*/
|
|
26
43
|
value?: any;
|
|
27
|
-
|
|
28
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Name of the checkbox element .
|
|
46
|
+
*/
|
|
47
|
+
name?: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Specifies whether a checkbox should be checked or not.
|
|
50
|
+
* @defaultValue false
|
|
51
|
+
*/
|
|
52
|
+
checked?: boolean | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Value in checked state.
|
|
55
|
+
* @defaultValue true
|
|
56
|
+
*/
|
|
29
57
|
trueValue?: any;
|
|
58
|
+
/**
|
|
59
|
+
* Value in unchecked state.
|
|
60
|
+
* @defaultValue false
|
|
61
|
+
*/
|
|
30
62
|
falseValue?: any;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Inline style of the element.
|
|
65
|
+
*/
|
|
66
|
+
style?: React.CSSProperties | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Style class of the element.
|
|
69
|
+
*/
|
|
70
|
+
className?: string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* When present, it specifies that the element value cannot be altered.
|
|
73
|
+
* @defaultValue false
|
|
74
|
+
*/
|
|
75
|
+
disabled?: boolean | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* When present, it specifies that an input field must be filled out before submitting the form.
|
|
78
|
+
* @defaultValue false
|
|
79
|
+
*/
|
|
80
|
+
required?: boolean | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* When present, it specifies that the value cannot be changed.
|
|
83
|
+
* @defaultValue false
|
|
84
|
+
*/
|
|
85
|
+
readOnly?: boolean | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Index of the element in tabbing order.
|
|
88
|
+
* @defaultValue false
|
|
89
|
+
*/
|
|
90
|
+
tabIndex?: number | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Icon class of the checkbox icon.
|
|
93
|
+
* @defaultValue pi pi-check
|
|
94
|
+
*/
|
|
95
|
+
icon?: IconType<CheckboxProps> | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Content of the tooltip.
|
|
98
|
+
*/
|
|
99
|
+
tooltip?: string | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Configuration of the tooltip, refer to the tooltip documentation for more information.
|
|
102
|
+
* @type {TooltipOptions}
|
|
103
|
+
*/
|
|
104
|
+
tooltipOptions?: TooltipOptions | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Callback to invoke on value change
|
|
107
|
+
* @param {CheckboxChangeEvent} event - Custom change event
|
|
108
|
+
*/
|
|
109
|
+
onChange?(event: CheckboxChangeEvent): void;
|
|
110
|
+
/**
|
|
111
|
+
* Callback to invoke to when a mouse button is pressed.
|
|
112
|
+
* @param {React.MouseEvent<HTMLElement>} event - Browser event
|
|
113
|
+
*/
|
|
41
114
|
onMouseDown?(event: React.MouseEvent<HTMLElement>): void;
|
|
115
|
+
/**
|
|
116
|
+
* Callback to invoke on right-click.
|
|
117
|
+
* @param {React.MouseEvent<HTMLElement>} event - Browser event
|
|
118
|
+
*/
|
|
42
119
|
onContextMenu?(event: React.MouseEvent<HTMLElement>): void;
|
|
43
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Used to get the child elements of the component.
|
|
122
|
+
* @readonly
|
|
123
|
+
*/
|
|
124
|
+
children?: React.ReactNode | undefined;
|
|
44
125
|
}
|
|
45
126
|
|
|
127
|
+
/**
|
|
128
|
+
* **PrimeReact - Checkbox**
|
|
129
|
+
*
|
|
130
|
+
* _Checkbox is an extension to standard checkbox element with skinning capabilities._
|
|
131
|
+
*
|
|
132
|
+
* [Live Demo](https://www.primefaces.org/primereact/checkbox/)
|
|
133
|
+
* --- ---
|
|
134
|
+
* 
|
|
135
|
+
*
|
|
136
|
+
* @group Component
|
|
137
|
+
*/
|
|
46
138
|
export declare class Checkbox extends React.Component<CheckboxProps, any> {
|
|
139
|
+
/**
|
|
140
|
+
* Used to focus the component.
|
|
141
|
+
*/
|
|
142
|
+
public focus(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Used to get container element.
|
|
145
|
+
* @return {HTMLDivElement} Container element
|
|
146
|
+
*/
|
|
47
147
|
public getElement(): HTMLDivElement;
|
|
148
|
+
/**
|
|
149
|
+
* Used to get input element.
|
|
150
|
+
* @return {HTMLInputElement} Input element
|
|
151
|
+
*/
|
|
48
152
|
public getInput(): HTMLInputElement;
|
|
49
153
|
}
|
package/checkbox/checkbox.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useUpdateEffect } from 'primereact/hooks';
|
|
3
3
|
import { Tooltip } from 'primereact/tooltip';
|
|
4
|
-
import {
|
|
4
|
+
import { DomHandler, ObjectUtils, classNames, IconUtils } from 'primereact/utils';
|
|
5
5
|
|
|
6
6
|
function _extends() {
|
|
7
7
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -118,7 +118,8 @@ var Checkbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
118
118
|
setFocusedState(false);
|
|
119
119
|
};
|
|
120
120
|
var onKeyDown = function onKeyDown(event) {
|
|
121
|
-
if (event.code === 'Space') {
|
|
121
|
+
if (event.code === 'Space' || event.key === ' ') {
|
|
122
|
+
// event.key is for Android support
|
|
122
123
|
onClick(event);
|
|
123
124
|
}
|
|
124
125
|
};
|
|
@@ -128,6 +129,9 @@ var Checkbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
128
129
|
React.useImperativeHandle(ref, function () {
|
|
129
130
|
return {
|
|
130
131
|
props: props,
|
|
132
|
+
focus: function focus() {
|
|
133
|
+
return DomHandler.focus(inputRef.current);
|
|
134
|
+
},
|
|
131
135
|
getElement: function getElement() {
|
|
132
136
|
return elementRef.current;
|
|
133
137
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useUpdateEffect as t}from"primereact/hooks";import{Tooltip as n}from"primereact/tooltip";import{
|
|
1
|
+
import*as e from"react";import{useUpdateEffect as t}from"primereact/hooks";import{Tooltip as n}from"primereact/tooltip";import{DomHandler as r,ObjectUtils as o,classNames as a,IconUtils as l}from"primereact/utils";function c(){return c=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},c.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,l,c=[],u=!0,i=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){i=!0,o=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(i)throw o}}return c}}function s(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 f(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p=e.memo(e.forwardRef((function(s,m){var h,b,y=e.useState(!1),v=(b=2,u(h=y)||i(h,b)||f(h,b)||d()),g=v[0],k=v[1],x=e.useRef(null),O=e.useRef(s.inputRef),E=function(e){if(!s.disabled&&!s.readOnly&&s.onChange){var t=I(),n=e.target instanceof HTMLDivElement||e.target instanceof HTMLSpanElement;if(e.target===O.current||n&&e.target.checked!==t){var o=t?s.falseValue:s.trueValue;s.onChange({originalEvent:e,value:s.value,checked:o,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:s.name,id:s.id,value:s.value,checked:o}})}r.focus(O.current),e.preventDefault()}},I=function(){return s.checked===s.trueValue};e.useImperativeHandle(m,(function(){return{props:s,focus:function(){return r.focus(O.current)},getElement:function(){return x.current},getInput:function(){return O.current}}})),e.useEffect((function(){o.combinedRefs(O,s.inputRef)}),[O,s.inputRef]),t((function(){O.current.checked=I()}),[s.checked,s.trueValue]);var C=I(),w=o.isNotEmpty(s.tooltip),R=o.findDiffKeys(s,p.defaultProps),S=o.reduceKeys(R,r.ARIA_PROPS),M=a("p-checkbox p-component",{"p-checkbox-checked":C,"p-checkbox-disabled":s.disabled,"p-checkbox-focused":g},s.className),j=a("p-checkbox-box",{"p-highlight":C,"p-disabled":s.disabled,"p-focus":g}),A=l.getJSXIcon(C?s.icon:"",{className:"p-checkbox-icon p-c"},{props:s,checked:C});return e.createElement(e.Fragment,null,e.createElement("div",c({ref:x,id:s.id,className:M,style:s.style},R,{onClick:E,onContextMenu:s.onContextMenu,onMouseDown:s.onMouseDown}),e.createElement("div",{className:"p-hidden-accessible"},e.createElement("input",c({ref:O,type:"checkbox",id:s.inputId,name:s.name,tabIndex:s.tabIndex,defaultChecked:C,onFocus:function(){k(!0)},onBlur:function(){k(!1)},onKeyDown:function(e){"Space"!==e.code&&" "!==e.key||E(e)},disabled:s.disabled,readOnly:s.readOnly,required:s.required},S))),e.createElement("div",{className:j},A)),w&&e.createElement(n,c({target:x,content:s.tooltip},s.tooltipOptions)))})));p.displayName="Checkbox",p.defaultProps={__TYPE:"Checkbox",id:null,inputRef:null,inputId:null,value:null,name:null,checked:!1,trueValue:!0,falseValue:!1,style:null,className:null,disabled:!1,required:!1,readOnly:!1,tabIndex:null,icon:"pi pi-check",tooltip:null,tooltipOptions:null,onChange:null,onMouseDown:null,onContextMenu:null};export{p as Checkbox};
|
package/checkbox/checkbox.js
CHANGED
|
@@ -137,7 +137,8 @@ this.primereact.checkbox = (function (exports, React, hooks, tooltip, utils) {
|
|
|
137
137
|
setFocusedState(false);
|
|
138
138
|
};
|
|
139
139
|
var onKeyDown = function onKeyDown(event) {
|
|
140
|
-
if (event.code === 'Space') {
|
|
140
|
+
if (event.code === 'Space' || event.key === ' ') {
|
|
141
|
+
// event.key is for Android support
|
|
141
142
|
onClick(event);
|
|
142
143
|
}
|
|
143
144
|
};
|
|
@@ -147,6 +148,9 @@ this.primereact.checkbox = (function (exports, React, hooks, tooltip, utils) {
|
|
|
147
148
|
React__namespace.useImperativeHandle(ref, function () {
|
|
148
149
|
return {
|
|
149
150
|
props: props,
|
|
151
|
+
focus: function focus() {
|
|
152
|
+
return utils.DomHandler.focus(inputRef.current);
|
|
153
|
+
},
|
|
150
154
|
getElement: function getElement() {
|
|
151
155
|
return elementRef.current;
|
|
152
156
|
},
|
package/checkbox/checkbox.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.checkbox=function(e,t,n,r,c){"use strict";function o(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 a=o(t);function l(){return l=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},l.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,c,o,a,l=[],u=!0,i=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){i=!0,c=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(i)throw c}}return l}}function s(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 f(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p=a.memo(a.forwardRef((function(e,t){var o,s,b=a.useState(!1),m=(s=2,u(o=b)||i(o,s)||f(o,s)||d()),h=m[0],y=m[1],v=a.useRef(null),g=a.useRef(e.inputRef),k=function(t){if(!e.disabled&&!e.readOnly&&e.onChange){var n=O(),r=t.target instanceof HTMLDivElement||t.target instanceof HTMLSpanElement;if(t.target===g.current||r&&t.target.checked!==n){var o=n?e.falseValue:e.trueValue;e.onChange({originalEvent:t,value:e.value,checked:o,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:e.name,id:e.id,value:e.value,checked:o}})}c.DomHandler.focus(g.current),t.preventDefault()}},O=function(){return e.checked===e.trueValue};a.useImperativeHandle(t,(function(){return{props:e,getElement:function(){return v.current},getInput:function(){return g.current}}})),a.useEffect((function(){c.ObjectUtils.combinedRefs(g,e.inputRef)}),[g,e.inputRef]),n.useUpdateEffect((function(){g.current.checked=O()}),[e.checked,e.trueValue]);var x=O(),j=c.ObjectUtils.isNotEmpty(e.tooltip),E=c.ObjectUtils.findDiffKeys(e,p.defaultProps),I=c.ObjectUtils.reduceKeys(E,c.DomHandler.ARIA_PROPS),C=c.classNames("p-checkbox p-component",{"p-checkbox-checked":x,"p-checkbox-disabled":e.disabled,"p-checkbox-focused":h},e.className),
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.checkbox=function(e,t,n,r,c){"use strict";function o(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 a=o(t);function l(){return l=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},l.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,c,o,a,l=[],u=!0,i=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){i=!0,c=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(i)throw c}}return l}}function s(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 f(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p=a.memo(a.forwardRef((function(e,t){var o,s,b=a.useState(!1),m=(s=2,u(o=b)||i(o,s)||f(o,s)||d()),h=m[0],y=m[1],v=a.useRef(null),g=a.useRef(e.inputRef),k=function(t){if(!e.disabled&&!e.readOnly&&e.onChange){var n=O(),r=t.target instanceof HTMLDivElement||t.target instanceof HTMLSpanElement;if(t.target===g.current||r&&t.target.checked!==n){var o=n?e.falseValue:e.trueValue;e.onChange({originalEvent:t,value:e.value,checked:o,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:e.name,id:e.id,value:e.value,checked:o}})}c.DomHandler.focus(g.current),t.preventDefault()}},O=function(){return e.checked===e.trueValue};a.useImperativeHandle(t,(function(){return{props:e,focus:function(){return c.DomHandler.focus(g.current)},getElement:function(){return v.current},getInput:function(){return g.current}}})),a.useEffect((function(){c.ObjectUtils.combinedRefs(g,e.inputRef)}),[g,e.inputRef]),n.useUpdateEffect((function(){g.current.checked=O()}),[e.checked,e.trueValue]);var x=O(),j=c.ObjectUtils.isNotEmpty(e.tooltip),E=c.ObjectUtils.findDiffKeys(e,p.defaultProps),I=c.ObjectUtils.reduceKeys(E,c.DomHandler.ARIA_PROPS),C=c.classNames("p-checkbox p-component",{"p-checkbox-checked":x,"p-checkbox-disabled":e.disabled,"p-checkbox-focused":h},e.className),D=c.classNames("p-checkbox-box",{"p-highlight":x,"p-disabled":e.disabled,"p-focus":h}),w=c.IconUtils.getJSXIcon(x?e.icon:"",{className:"p-checkbox-icon p-c"},{props:e,checked:x});return a.createElement(a.Fragment,null,a.createElement("div",l({ref:v,id:e.id,className:C,style:e.style},E,{onClick:k,onContextMenu:e.onContextMenu,onMouseDown:e.onMouseDown}),a.createElement("div",{className:"p-hidden-accessible"},a.createElement("input",l({ref:g,type:"checkbox",id:e.inputId,name:e.name,tabIndex:e.tabIndex,defaultChecked:x,onFocus:function(){y(!0)},onBlur:function(){y(!1)},onKeyDown:function(e){"Space"!==e.code&&" "!==e.key||k(e)},disabled:e.disabled,readOnly:e.readOnly,required:e.required},I))),a.createElement("div",{className:D},w)),j&&a.createElement(r.Tooltip,l({target:v,content:e.tooltip},e.tooltipOptions)))})));return p.displayName="Checkbox",p.defaultProps={__TYPE:"Checkbox",id:null,inputRef:null,inputId:null,value:null,name:null,checked:!1,trueValue:!0,falseValue:!1,style:null,className:null,disabled:!1,required:!1,readOnly:!1,tabIndex:null,icon:"pi pi-check",tooltip:null,tooltipOptions:null,onChange:null,onMouseDown:null,onContextMenu:null},e.Checkbox=p,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.hooks,primereact.tooltip,primereact.utils);
|
package/chip/chip.d.ts
CHANGED
|
@@ -1,19 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Chip represents people using icons, labels and images.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primefaces.org/primereact/chip)
|
|
6
|
+
*
|
|
7
|
+
* @module chip
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
import { IconType, TemplateType } from '../utils';
|
|
3
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Defines valid properties in Chip component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
15
|
+
* @group Properties
|
|
16
|
+
*/
|
|
4
17
|
export interface ChipProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
|
|
18
|
+
/**
|
|
19
|
+
* Defines the text to display.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
5
22
|
label?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Defines the icon to display.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
icon?: IconType<ChipProps> | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Defines the image to display.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
image?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to display a remove icon.
|
|
35
|
+
* @defaultValue false
|
|
36
|
+
*/
|
|
37
|
+
removable?: boolean | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Icon of the remove element.
|
|
40
|
+
* @defaultValue pi pi-times-circle
|
|
41
|
+
*/
|
|
42
|
+
removeIcon?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Template of an item.
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
template?: TemplateType<ChipProps> | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* It specifies an alternate text for an image, if the image cannot be displayed.
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
imageAlt?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* This event is triggered if an error occurs while loading an image file.
|
|
55
|
+
* @param {React.SyntheticEvent} event - Browser event.
|
|
56
|
+
*/
|
|
12
57
|
onImageError?(event: React.SyntheticEvent): void;
|
|
58
|
+
/**
|
|
59
|
+
* Callback to invoke when a chip is removed.
|
|
60
|
+
* @param {React.MouseEvent} event - Browser event.
|
|
61
|
+
*/
|
|
13
62
|
onRemove?(event: React.MouseEvent<HTMLElement>): void;
|
|
14
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Used to get the child elements of the component.
|
|
65
|
+
* @readonly
|
|
66
|
+
*/
|
|
67
|
+
children?: React.ReactNode | undefined;
|
|
15
68
|
}
|
|
16
69
|
|
|
70
|
+
/**
|
|
71
|
+
* **PrimeReact - Chip**
|
|
72
|
+
*
|
|
73
|
+
* _Chip represents people using icons, labels and images._
|
|
74
|
+
*
|
|
75
|
+
* [Live Demo](https://www.primefaces.org/primereact/chip/)
|
|
76
|
+
* --- ---
|
|
77
|
+
* 
|
|
78
|
+
*
|
|
79
|
+
* @group Component
|
|
80
|
+
*/
|
|
17
81
|
export declare class Chip extends React.Component<ChipProps, any> {
|
|
82
|
+
/**
|
|
83
|
+
* Used to get container element.
|
|
84
|
+
* @return {HTMLDivElement} Container element
|
|
85
|
+
*/
|
|
18
86
|
public getElement(): HTMLDivElement;
|
|
19
87
|
}
|
package/chips/chips.cjs.js
CHANGED
|
@@ -184,16 +184,13 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
184
184
|
if (event.defaultPrevented) {
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
|
-
switch (event.
|
|
188
|
-
|
|
189
|
-
case 8:
|
|
187
|
+
switch (event.key) {
|
|
188
|
+
case 'Backspace':
|
|
190
189
|
if (inputRef.current.value.length === 0 && values.length > 0) {
|
|
191
190
|
removeItem(event, values.length - 1);
|
|
192
191
|
}
|
|
193
192
|
break;
|
|
194
|
-
|
|
195
|
-
//enter
|
|
196
|
-
case 13:
|
|
193
|
+
case 'Enter':
|
|
197
194
|
if (inputValue && inputValue.trim().length && (!props.max || props.max > values.length)) {
|
|
198
195
|
addItem(event, inputValue, true);
|
|
199
196
|
}
|
|
@@ -204,8 +201,11 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
204
201
|
}
|
|
205
202
|
if (isMaxedOut()) {
|
|
206
203
|
event.preventDefault();
|
|
207
|
-
} else if (props.separator === ','
|
|
208
|
-
|
|
204
|
+
} else if (props.separator === ',') {
|
|
205
|
+
// GitHub #3885 Android Opera gives strange code 229 for comma
|
|
206
|
+
if (event.key === props.separator || utils.DomHandler.isAndroid() && event.which === 229) {
|
|
207
|
+
addItem(event, inputValue, true);
|
|
208
|
+
}
|
|
209
209
|
}
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
@@ -276,6 +276,9 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
276
276
|
React__namespace.useImperativeHandle(ref, function () {
|
|
277
277
|
return {
|
|
278
278
|
props: props,
|
|
279
|
+
focus: function focus() {
|
|
280
|
+
return utils.DomHandler.focus(inputRef.current);
|
|
281
|
+
},
|
|
279
282
|
getElement: function getElement() {
|
|
280
283
|
return elementRef.current;
|
|
281
284
|
},
|
package/chips/chips.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/keyfilter"),n=require("primereact/tooltip"),r=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 a=l(e);function i(){return i=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},i.apply(this,arguments)}function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/keyfilter"),n=require("primereact/tooltip"),r=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 a=l(e);function i(){return i=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},i.apply(this,arguments)}function o(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 u(e){if(Array.isArray(e))return o(e)}function c(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){if(e){if("string"==typeof e)return o(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)?o(e,t):void 0}}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e){return u(e)||c(e)||s(e)||p()}function d(e){if(Array.isArray(e))return e}function m(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,a,i,o=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw l}}return o}}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var y=a.memo(a.forwardRef((function(e,l){var o,u,c=a.useState(!1),p=(u=2,d(o=c)||m(o,u)||s(o,u)||v()),b=p[0],h=p[1],g=a.useRef(null),O=a.useRef(null),w=a.useRef(e.inputRef),E=function(t,n){if(!e.disabled||!e.readOnly){var r=f(e.value),l=r.splice(n,1);S(l,n)&&(e.onRemove&&e.onRemove({originalEvent:t,value:l}),e.onChange&&e.onChange({originalEvent:t,value:r,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:r}}))}},j=function(t,n,r){if(n&&n.trim().length){var l=e.value?f(e.value):[];if(e.allowDuplicate||-1===l.indexOf(n)){var a=!0;e.onAdd&&(a=e.onAdd({originalEvent:t,value:n})),!1!==a&&l.push(n)}x(t,l,r)}},D=function(){r.DomHandler.focus(w.current)},k=function(n){var l=n.target.value,a=e.value||[];if(e.onKeyDown&&e.onKeyDown(n),!n.defaultPrevented)switch(n.key){case"Backspace":0===w.current.value.length&&a.length>0&&E(n,a.length-1);break;case"Enter":l&&l.trim().length&&(!e.max||e.max>a.length)&&j(n,l,!0);break;default:e.keyfilter&&t.KeyFilter.onKeyPress(n,e.keyfilter),R()?n.preventDefault():","===e.separator&&(n.key===e.separator||r.DomHandler.isAndroid()&&229===n.which)&&j(n,l,!0)}},x=function(t,n,r){e.onChange&&e.onChange({originalEvent:t,value:n,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:n}}),w.current.value="",r&&t.preventDefault()},P=function(n){if(e.separator){var r=(n.clipboardData||window.clipboardData).getData("Text");if(e.keyfilter&&t.KeyFilter.onPaste(n,e.keyfilter),r){var l=e.value||[],a=r.split(e.separator);a=a.filter((function(t){return(e.allowDuplicate||-1===l.indexOf(t))&&t.trim().length})),l=[].concat(f(l),f(a)),x(n,l,!0)}}},A=function(t){h(!0),e.onFocus&&e.onFocus(t)},N=function(t){if(e.addOnBlur){var n=t.target.value,r=e.value||[];n&&n.trim().length&&(!e.max||e.max>r.length)&&j(t,n,!0)}h(!1),e.onBlur&&e.onBlur(t)},R=function(){return e.max&&e.value&&e.max===e.value.length},C=w.current&&w.current.value,I=a.useMemo((function(){return r.ObjectUtils.isNotEmpty(e.value)||r.ObjectUtils.isNotEmpty(C)}),[e.value,C]),S=function(t,n){return r.ObjectUtils.getPropValue(e.removable,{value:t,index:n,props:e})};a.useImperativeHandle(l,(function(){return{props:e,focus:function(){return r.DomHandler.focus(w.current)},getElement:function(){return g.current},getInput:function(){return w.current}}})),a.useEffect((function(){r.ObjectUtils.combinedRefs(w,e.inputRef)}),[w,e.inputRef]);var K=function(t,n){return e.disabled||e.readOnly||!S(t,n)?null:a.createElement("span",{className:"p-chips-token-icon pi pi-times-circle",onClick:function(e){return E(e,n)}})},B=function(t,n){var r=e.itemTemplate?e.itemTemplate(t):t,l=a.createElement("span",{className:"p-chips-token-label"},r),i=K(t,n);return a.createElement("li",{key:n,className:"p-chips-token p-highlight"},l,i)},T=r.ObjectUtils.isNotEmpty(e.tooltip),U=r.ObjectUtils.findDiffKeys(e,y.defaultProps),F=r.ObjectUtils.reduceKeys(U,r.DomHandler.ARIA_PROPS),_=r.classNames("p-chips p-component p-inputwrapper",{"p-inputwrapper-filled":I,"p-inputwrapper-focus":b},e.className),H=function(){var t=r.classNames("p-inputtext p-chips-multiple-container",{"p-disabled":e.disabled,"p-focus":b}),n=e.value?e.value.map(B):null,l=a.createElement("li",{className:"p-chips-input-token"},a.createElement("input",i({ref:w,id:e.inputId,placeholder:e.placeholder,type:"text",name:e.name,disabled:e.disabled||R(),onKeyDown:k,onPaste:P,onFocus:A,onBlur:N,readOnly:e.readOnly},F)));return a.createElement("ul",{ref:O,className:t,onClick:D},n,l)}();return a.createElement(a.Fragment,null,a.createElement("div",i({ref:g,id:e.id,className:_,style:e.style},U),H),T&&a.createElement(n.Tooltip,i({target:w,content:e.tooltip},e.tooltipOptions)))})));y.displayName="Chips",y.defaultProps={__TYPE:"Chips",id:null,inputRef:null,inputId:null,name:null,placeholder:null,value:null,max:null,disabled:null,readOnly:!1,removable:!0,style:null,className:null,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,separator:null,allowDuplicate:!0,itemTemplate:null,keyfilter:null,addOnBlur:null,onAdd:null,onRemove:null,onChange:null,onFocus:null,onBlur:null,onKeyDown:null},exports.Chips=y;
|