primereact 8.7.2 → 8.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.cjs.js +56 -57
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +56 -57
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +56 -57
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +30 -68
- package/api/api.cjs.min.js +1 -1
- package/api/api.esm.js +30 -68
- package/api/api.esm.min.js +1 -1
- package/api/api.js +30 -68
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +82 -154
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +82 -154
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +82 -154
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +86 -14
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +5 -4
- package/avatar/avatar.esm.js +86 -14
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +86 -14
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +0 -2
- package/avatargroup/avatargroup.esm.js +0 -2
- package/avatargroup/avatargroup.js +0 -2
- package/badge/badge.cjs.js +27 -3
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +27 -3
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +27 -3
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +40 -54
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.d.ts +5 -3
- package/blockui/blockui.esm.js +40 -54
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +40 -54
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +6 -29
- package/breadcrumb/breadcrumb.esm.js +6 -29
- package/breadcrumb/breadcrumb.js +6 -29
- package/button/button.cjs.js +29 -11
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +29 -11
- package/button/button.esm.min.js +1 -1
- package/button/button.js +29 -11
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +186 -664
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +6 -4
- package/calendar/calendar.esm.js +186 -664
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +186 -664
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +0 -15
- package/captcha/captcha.esm.js +0 -15
- package/captcha/captcha.js +0 -15
- package/card/card.cjs.js +0 -6
- package/card/card.esm.js +0 -6
- package/card/card.js +0 -6
- package/carousel/carousel.cjs.js +42 -130
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +42 -130
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +42 -130
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +47 -132
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +47 -132
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +47 -132
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +6 -7
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +6 -7
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +6 -7
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +26 -40
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +26 -40
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +26 -40
- package/checkbox/checkbox.min.css +1 -1
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +26 -41
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.esm.js +26 -41
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +26 -41
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +29 -72
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +29 -72
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +29 -72
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +75 -143
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +8 -6
- package/colorpicker/colorpicker.esm.js +75 -143
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +75 -143
- package/colorpicker/colorpicker.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +60 -60
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +60 -60
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +60 -60
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +74 -94
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +74 -94
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +74 -94
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +75 -120
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +75 -120
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +75 -120
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +970 -2021
- package/core/core.min.js +15 -15
- package/csstransition/csstransition.cjs.js +27 -13
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.esm.js +27 -13
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +27 -13
- package/csstransition/csstransition.min.js +1 -1
- package/datascroller/datascroller.cjs.js +32 -64
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +32 -64
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +32 -64
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +318 -1077
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +6 -1
- package/datatable/datatable.esm.js +318 -1077
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +318 -1077
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +56 -68
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +56 -68
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +56 -68
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +37 -46
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +37 -46
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +37 -46
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +89 -175
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +89 -175
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +89 -175
- package/dialog/dialog.min.css +1 -1
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +0 -2
- package/divider/divider.esm.js +0 -2
- package/divider/divider.js +0 -2
- package/dock/dock.cjs.js +31 -53
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +31 -53
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +31 -53
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +72 -199
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +39 -38
- package/dropdown/dropdown.esm.js +72 -199
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +72 -199
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +31 -22
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +31 -22
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +31 -22
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +29 -51
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +29 -51
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +29 -51
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +45 -128
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +45 -128
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +45 -128
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +54 -165
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +54 -165
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +54 -165
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +2 -23
- package/gmap/gmap.esm.js +2 -23
- package/gmap/gmap.js +2 -23
- package/hooks/hooks.cjs.js +102 -131
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +102 -131
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +102 -131
- package/hooks/hooks.min.js +1 -1
- package/image/image.cjs.js +41 -67
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +1 -1
- package/image/image.esm.js +41 -67
- package/image/image.esm.min.js +1 -1
- package/image/image.js +41 -67
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +26 -45
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +26 -45
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +26 -45
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +16 -108
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +16 -108
- package/inputmask/inputmask.js +16 -108
- package/inputnumber/inputnumber.cjs.js +82 -234
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +1 -1
- package/inputnumber/inputnumber.esm.js +82 -234
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +82 -234
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +26 -37
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +26 -37
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +26 -37
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +0 -11
- package/inputtext/inputtext.d.ts +1 -3
- package/inputtext/inputtext.esm.js +0 -11
- package/inputtext/inputtext.js +0 -11
- package/inputtextarea/inputtextarea.cjs.js +0 -20
- package/inputtextarea/inputtextarea.d.ts +1 -3
- package/inputtextarea/inputtextarea.esm.js +0 -20
- package/inputtextarea/inputtextarea.js +0 -20
- package/keyfilter/keyfilter.cjs.js +4 -15
- package/keyfilter/keyfilter.esm.js +4 -15
- package/keyfilter/keyfilter.js +4 -15
- package/knob/knob.cjs.js +74 -106
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +74 -106
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +74 -106
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +94 -125
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +6 -0
- package/listbox/listbox.esm.js +95 -126
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +94 -125
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +36 -99
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +36 -99
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +36 -99
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +82 -138
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +1 -1
- package/mention/mention.esm.js +82 -138
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +82 -138
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +38 -72
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +38 -72
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +38 -72
- package/menu/menu.min.css +1 -1
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +49 -99
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +49 -99
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +49 -99
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +0 -7
- package/message/message.esm.js +0 -7
- package/message/message.js +0 -7
- package/messages/messages.cjs.js +39 -67
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +39 -67
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +39 -67
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +137 -210
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +46 -41
- package/multiselect/multiselect.esm.js +137 -210
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +137 -210
- package/multiselect/multiselect.min.css +1 -1
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +58 -53
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +58 -53
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +58 -53
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +38 -103
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +38 -103
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +38 -103
- package/orderlist/orderlist.min.css +1 -1
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +26 -52
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +26 -52
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +26 -52
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +40 -79
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +40 -79
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +40 -79
- package/overlaypanel/overlaypanel.min.css +1 -1
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +46 -87
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +46 -87
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +46 -87
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +29 -50
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +29 -50
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +29 -50
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +35 -81
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +35 -81
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +35 -81
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +54 -107
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +1 -1
- package/password/password.esm.js +54 -107
- package/password/password.esm.min.js +1 -1
- package/password/password.js +54 -107
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +48 -159
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +48 -159
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +48 -159
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +26 -31
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +26 -31
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +26 -31
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +2246 -7336
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2246 -7336
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +2246 -7336
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +0 -7
- package/progressbar/progressbar.esm.js +0 -7
- package/progressbar/progressbar.js +0 -7
- package/progressspinner/progressspinner.cjs.js +0 -2
- package/progressspinner/progressspinner.esm.js +0 -2
- package/progressspinner/progressspinner.js +0 -2
- package/radiobutton/radiobutton.cjs.js +30 -40
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +30 -40
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +30 -40
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +27 -14
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +27 -14
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +27 -14
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +47 -1
- package/resources/primereact.min.css +1 -1
- package/ripple/ripple.cjs.js +0 -12
- package/ripple/ripple.esm.js +0 -12
- package/ripple/ripple.js +0 -12
- package/row/row.cjs.js +0 -2
- package/row/row.esm.js +0 -2
- package/row/row.js +0 -2
- package/scrollpanel/scrollpanel.cjs.js +2 -16
- package/scrollpanel/scrollpanel.esm.js +2 -16
- package/scrollpanel/scrollpanel.js +2 -16
- package/scrolltop/scrolltop.cjs.js +44 -57
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.esm.js +44 -57
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +44 -57
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +26 -53
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +26 -53
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +26 -53
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/sidebar.cjs.js +52 -83
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +52 -83
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +52 -83
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +0 -2
- package/skeleton/skeleton.esm.js +0 -2
- package/skeleton/skeleton.js +0 -2
- package/slidemenu/slidemenu.cjs.js +73 -87
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +73 -87
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +73 -87
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +61 -96
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +61 -96
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +61 -96
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +70 -89
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +70 -89
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +70 -89
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +46 -80
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +46 -80
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +46 -80
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +72 -85
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +72 -85
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +72 -85
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +0 -14
- package/steps/steps.esm.js +0 -14
- package/steps/steps.js +0 -14
- package/styleclass/styleclass.cjs.js +75 -111
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +75 -111
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +75 -111
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +33 -54
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +33 -54
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +33 -54
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +83 -102
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +83 -102
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +83 -102
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +27 -4
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.esm.js +27 -4
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +27 -4
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +37 -63
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +37 -63
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +37 -63
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +65 -110
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +65 -110
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +65 -110
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +27 -7
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +27 -7
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +27 -7
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +81 -99
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +81 -99
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +81 -99
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +0 -7
- package/togglebutton/togglebutton.esm.js +0 -7
- package/togglebutton/togglebutton.js +0 -7
- package/toolbar/toolbar.cjs.js +0 -2
- package/toolbar/toolbar.esm.js +0 -2
- package/toolbar/toolbar.js +0 -2
- package/tooltip/tooltip.cjs.js +111 -164
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +111 -164
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +111 -164
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +13 -13
- package/tree/tree.cjs.js +68 -223
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +68 -223
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +68 -223
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +1 -0
- package/treeselect/treeselect.cjs.js +117 -167
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +30 -29
- package/treeselect/treeselect.esm.js +117 -167
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +117 -167
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +140 -460
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +140 -460
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +140 -460
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +29 -39
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +29 -39
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +29 -39
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +110 -328
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +110 -328
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +110 -328
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +108 -204
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +108 -204
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +108 -204
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +152 -38
package/chips/chips.cjs.js
CHANGED
|
@@ -31,14 +31,12 @@ function _extends() {
|
|
|
31
31
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
32
32
|
for (var i = 1; i < arguments.length; i++) {
|
|
33
33
|
var source = arguments[i];
|
|
34
|
-
|
|
35
34
|
for (var key in source) {
|
|
36
35
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
37
36
|
target[key] = source[key];
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
|
-
|
|
42
40
|
return target;
|
|
43
41
|
};
|
|
44
42
|
return _extends.apply(this, arguments);
|
|
@@ -46,11 +44,9 @@ function _extends() {
|
|
|
46
44
|
|
|
47
45
|
function _arrayLikeToArray(arr, len) {
|
|
48
46
|
if (len == null || len > arr.length) len = arr.length;
|
|
49
|
-
|
|
50
47
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
51
48
|
arr2[i] = arr[i];
|
|
52
49
|
}
|
|
53
|
-
|
|
54
50
|
return arr2;
|
|
55
51
|
}
|
|
56
52
|
|
|
@@ -84,33 +80,33 @@ function _arrayWithHoles(arr) {
|
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
function _iterableToArrayLimit(arr, i) {
|
|
87
|
-
var _i =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
98
|
-
_arr.push(_s.value);
|
|
99
|
-
|
|
100
|
-
if (i && _arr.length === i) break;
|
|
101
|
-
}
|
|
102
|
-
} catch (err) {
|
|
103
|
-
_d = true;
|
|
104
|
-
_e = err;
|
|
105
|
-
} finally {
|
|
83
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
84
|
+
if (null != _i) {
|
|
85
|
+
var _s,
|
|
86
|
+
_e,
|
|
87
|
+
_x,
|
|
88
|
+
_r,
|
|
89
|
+
_arr = [],
|
|
90
|
+
_n = !0,
|
|
91
|
+
_d = !1;
|
|
106
92
|
try {
|
|
107
|
-
if (
|
|
93
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
94
|
+
if (Object(_i) !== _i) return;
|
|
95
|
+
_n = !1;
|
|
96
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
|
|
97
|
+
;
|
|
98
|
+
}
|
|
99
|
+
} catch (err) {
|
|
100
|
+
_d = !0, _e = err;
|
|
108
101
|
} finally {
|
|
109
|
-
|
|
102
|
+
try {
|
|
103
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
104
|
+
} finally {
|
|
105
|
+
if (_d) throw _e;
|
|
106
|
+
}
|
|
110
107
|
}
|
|
108
|
+
return _arr;
|
|
111
109
|
}
|
|
112
|
-
|
|
113
|
-
return _arr;
|
|
114
110
|
}
|
|
115
111
|
|
|
116
112
|
function _nonIterableRest() {
|
|
@@ -123,34 +119,27 @@ function _slicedToArray(arr, i) {
|
|
|
123
119
|
|
|
124
120
|
var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
125
121
|
var _React$useState = React__namespace.useState(false),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
122
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
123
|
+
focusedState = _React$useState2[0],
|
|
124
|
+
setFocusedState = _React$useState2[1];
|
|
130
125
|
var elementRef = React__namespace.useRef(null);
|
|
131
126
|
var listRef = React__namespace.useRef(null);
|
|
132
127
|
var inputRef = React__namespace.useRef(props.inputRef);
|
|
133
|
-
|
|
134
128
|
var removeItem = function removeItem(event, index) {
|
|
135
129
|
if (props.disabled && props.readOnly) {
|
|
136
130
|
return;
|
|
137
131
|
}
|
|
138
|
-
|
|
139
132
|
var values = _toConsumableArray(props.value);
|
|
140
|
-
|
|
141
133
|
var removedItem = values.splice(index, 1);
|
|
142
|
-
|
|
143
134
|
if (!isRemovable(removedItem, index)) {
|
|
144
135
|
return;
|
|
145
136
|
}
|
|
146
|
-
|
|
147
137
|
if (props.onRemove) {
|
|
148
138
|
props.onRemove({
|
|
149
139
|
originalEvent: event,
|
|
150
140
|
value: removedItem
|
|
151
141
|
});
|
|
152
142
|
}
|
|
153
|
-
|
|
154
143
|
if (props.onChange) {
|
|
155
144
|
props.onChange({
|
|
156
145
|
originalEvent: event,
|
|
@@ -165,75 +154,62 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
165
154
|
});
|
|
166
155
|
}
|
|
167
156
|
};
|
|
168
|
-
|
|
169
157
|
var addItem = function addItem(event, item, preventDefault) {
|
|
170
158
|
if (item && item.trim().length) {
|
|
171
159
|
var values = props.value ? _toConsumableArray(props.value) : [];
|
|
172
|
-
|
|
173
160
|
if (props.allowDuplicate || values.indexOf(item) === -1) {
|
|
174
161
|
var allowAddition = true;
|
|
175
|
-
|
|
176
162
|
if (props.onAdd) {
|
|
177
163
|
allowAddition = props.onAdd({
|
|
178
164
|
originalEvent: event,
|
|
179
165
|
value: item
|
|
180
166
|
});
|
|
181
167
|
}
|
|
182
|
-
|
|
183
168
|
if (allowAddition !== false) {
|
|
184
169
|
values.push(item);
|
|
185
170
|
}
|
|
186
171
|
}
|
|
187
|
-
|
|
188
172
|
updateInput(event, values, preventDefault);
|
|
189
173
|
}
|
|
190
174
|
};
|
|
191
|
-
|
|
192
175
|
var onWrapperClick = function onWrapperClick() {
|
|
193
176
|
utils.DomHandler.focus(inputRef.current);
|
|
194
177
|
};
|
|
195
|
-
|
|
196
178
|
var onKeyDown = function onKeyDown(event) {
|
|
197
179
|
var inputValue = event.target.value;
|
|
198
180
|
var values = props.value || [];
|
|
199
|
-
props.onKeyDown && props.onKeyDown(event);
|
|
181
|
+
props.onKeyDown && props.onKeyDown(event);
|
|
200
182
|
|
|
183
|
+
// do not continue if the user defined keydown wants to prevent
|
|
201
184
|
if (event.defaultPrevented) {
|
|
202
185
|
return;
|
|
203
186
|
}
|
|
204
|
-
|
|
205
187
|
switch (event.which) {
|
|
206
188
|
//backspace
|
|
207
189
|
case 8:
|
|
208
190
|
if (inputRef.current.value.length === 0 && values.length > 0) {
|
|
209
191
|
removeItem(event, values.length - 1);
|
|
210
192
|
}
|
|
211
|
-
|
|
212
193
|
break;
|
|
213
|
-
//enter
|
|
214
194
|
|
|
195
|
+
//enter
|
|
215
196
|
case 13:
|
|
216
197
|
if (inputValue && inputValue.trim().length && (!props.max || props.max > values.length)) {
|
|
217
198
|
addItem(event, inputValue, true);
|
|
218
199
|
}
|
|
219
|
-
|
|
220
200
|
break;
|
|
221
|
-
|
|
222
201
|
default:
|
|
223
202
|
if (props.keyfilter) {
|
|
224
203
|
keyfilter.KeyFilter.onKeyPress(event, props.keyfilter);
|
|
225
204
|
}
|
|
226
|
-
|
|
227
205
|
if (isMaxedOut()) {
|
|
228
206
|
event.preventDefault();
|
|
229
207
|
} else if (props.separator === ',' && event.which === 188) {
|
|
230
208
|
addItem(event, inputValue, true);
|
|
231
209
|
}
|
|
232
|
-
|
|
233
210
|
break;
|
|
234
211
|
}
|
|
235
212
|
};
|
|
236
|
-
|
|
237
213
|
var updateInput = function updateInput(event, items, preventDefault) {
|
|
238
214
|
if (props.onChange) {
|
|
239
215
|
props.onChange({
|
|
@@ -248,19 +224,15 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
248
224
|
}
|
|
249
225
|
});
|
|
250
226
|
}
|
|
251
|
-
|
|
252
227
|
inputRef.current.value = '';
|
|
253
228
|
preventDefault && event.preventDefault();
|
|
254
229
|
};
|
|
255
|
-
|
|
256
230
|
var onPaste = function onPaste(event) {
|
|
257
231
|
if (props.separator) {
|
|
258
232
|
var pastedData = (event.clipboardData || window['clipboardData']).getData('Text');
|
|
259
|
-
|
|
260
233
|
if (props.keyfilter) {
|
|
261
234
|
keyfilter.KeyFilter.onPaste(event, props.keyfilter);
|
|
262
235
|
}
|
|
263
|
-
|
|
264
236
|
if (pastedData) {
|
|
265
237
|
var values = props.value || [];
|
|
266
238
|
var pastedValues = pastedData.split(props.separator);
|
|
@@ -272,35 +244,28 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
272
244
|
}
|
|
273
245
|
}
|
|
274
246
|
};
|
|
275
|
-
|
|
276
247
|
var onFocus = function onFocus(event) {
|
|
277
248
|
setFocusedState(true);
|
|
278
249
|
props.onFocus && props.onFocus(event);
|
|
279
250
|
};
|
|
280
|
-
|
|
281
251
|
var onBlur = function onBlur(event) {
|
|
282
252
|
if (props.addOnBlur) {
|
|
283
253
|
var inputValue = event.target.value;
|
|
284
254
|
var values = props.value || [];
|
|
285
|
-
|
|
286
255
|
if (inputValue && inputValue.trim().length && (!props.max || props.max > values.length)) {
|
|
287
256
|
addItem(event, inputValue, true);
|
|
288
257
|
}
|
|
289
258
|
}
|
|
290
|
-
|
|
291
259
|
setFocusedState(false);
|
|
292
260
|
props.onBlur && props.onBlur(event);
|
|
293
261
|
};
|
|
294
|
-
|
|
295
262
|
var isMaxedOut = function isMaxedOut() {
|
|
296
263
|
return props.max && props.value && props.max === props.value.length;
|
|
297
264
|
};
|
|
298
|
-
|
|
299
265
|
var currentValue = inputRef.current && inputRef.current.value;
|
|
300
266
|
var isFilled = React__namespace.useMemo(function () {
|
|
301
267
|
return utils.ObjectUtils.isNotEmpty(props.value) || utils.ObjectUtils.isNotEmpty(currentValue);
|
|
302
268
|
}, [props.value, currentValue]);
|
|
303
|
-
|
|
304
269
|
var isRemovable = function isRemovable(value, index) {
|
|
305
270
|
return utils.ObjectUtils.getPropValue(props.removable, {
|
|
306
271
|
value: value,
|
|
@@ -308,7 +273,6 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
308
273
|
props: props
|
|
309
274
|
});
|
|
310
275
|
};
|
|
311
|
-
|
|
312
276
|
React__namespace.useImperativeHandle(ref, function () {
|
|
313
277
|
return {
|
|
314
278
|
props: props,
|
|
@@ -323,7 +287,6 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
323
287
|
React__namespace.useEffect(function () {
|
|
324
288
|
utils.ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
325
289
|
}, [inputRef, props.inputRef]);
|
|
326
|
-
|
|
327
290
|
var createRemoveIcon = function createRemoveIcon(value, index) {
|
|
328
291
|
if (!props.disabled && !props.readOnly && isRemovable(value, index)) {
|
|
329
292
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
@@ -333,10 +296,8 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
333
296
|
}
|
|
334
297
|
});
|
|
335
298
|
}
|
|
336
|
-
|
|
337
299
|
return null;
|
|
338
300
|
};
|
|
339
|
-
|
|
340
301
|
var createItem = function createItem(value, index) {
|
|
341
302
|
var content = props.itemTemplate ? props.itemTemplate(value) : value;
|
|
342
303
|
var label = /*#__PURE__*/React__namespace.createElement("span", {
|
|
@@ -348,7 +309,6 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
348
309
|
className: "p-chips-token p-highlight"
|
|
349
310
|
}, label, icon);
|
|
350
311
|
};
|
|
351
|
-
|
|
352
312
|
var createInput = function createInput() {
|
|
353
313
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
354
314
|
className: "p-chips-input-token"
|
|
@@ -366,11 +326,9 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
366
326
|
readOnly: props.readOnly
|
|
367
327
|
}, ariaProps)));
|
|
368
328
|
};
|
|
369
|
-
|
|
370
329
|
var createItems = function createItems() {
|
|
371
330
|
return props.value ? props.value.map(createItem) : null;
|
|
372
331
|
};
|
|
373
|
-
|
|
374
332
|
var createList = function createList() {
|
|
375
333
|
var className = utils.classNames('p-inputtext p-chips-multiple-container', {
|
|
376
334
|
'p-disabled': props.disabled,
|
|
@@ -384,7 +342,6 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
384
342
|
onClick: onWrapperClick
|
|
385
343
|
}, items, input);
|
|
386
344
|
};
|
|
387
|
-
|
|
388
345
|
var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
|
|
389
346
|
var otherProps = utils.ObjectUtils.findDiffKeys(props, Chips.defaultProps);
|
|
390
347
|
var ariaProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.ARIA_PROPS);
|
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 u(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 o(e){if(Array.isArray(e))return u(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 u(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)?u(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 o(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,u=[],o=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;o=!1}else for(;!(o=(r=a.call(n)).done)&&(u.push(r.value),u.length!==t);o=!0);}catch(e){c=!0,l=e}finally{try{if(!o&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw l}}return u}}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 u,o,c=a.useState(!1),p=(o=2,d(u=c)||m(u,o)||s(u,o)||v()),b=p[0],h=p[1],g=a.useRef(null),O=a.useRef(null),w=a.useRef(e.inputRef),j=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}}))}},E=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 r=n.target.value,l=e.value||[];if(e.onKeyDown&&e.onKeyDown(n),!n.defaultPrevented)switch(n.which){case 8:0===w.current.value.length&&l.length>0&&j(n,l.length-1);break;case 13:r&&r.trim().length&&(!e.max||e.max>l.length)&&E(n,r,!0);break;default:e.keyfilter&&t.KeyFilter.onKeyPress(n,e.keyfilter),R()?n.preventDefault():","===e.separator&&188===n.which&&E(n,r,!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)&&E(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,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 j(e,n)}})},T=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)},U=r.ObjectUtils.isNotEmpty(e.tooltip),B=r.ObjectUtils.findDiffKeys(e,y.defaultProps),F=r.ObjectUtils.reduceKeys(B,r.DomHandler.ARIA_PROPS),_=r.classNames("p-chips p-component p-inputwrapper",{"p-inputwrapper-filled":I,"p-inputwrapper-focus":b},e.className),q=function(){var t=r.classNames("p-inputtext p-chips-multiple-container",{"p-disabled":e.disabled,"p-focus":b}),n=e.value?e.value.map(T):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},B),q),U&&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;
|
package/chips/chips.esm.js
CHANGED
|
@@ -7,14 +7,12 @@ function _extends() {
|
|
|
7
7
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
8
8
|
for (var i = 1; i < arguments.length; i++) {
|
|
9
9
|
var source = arguments[i];
|
|
10
|
-
|
|
11
10
|
for (var key in source) {
|
|
12
11
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
13
12
|
target[key] = source[key];
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
return target;
|
|
19
17
|
};
|
|
20
18
|
return _extends.apply(this, arguments);
|
|
@@ -22,11 +20,9 @@ function _extends() {
|
|
|
22
20
|
|
|
23
21
|
function _arrayLikeToArray(arr, len) {
|
|
24
22
|
if (len == null || len > arr.length) len = arr.length;
|
|
25
|
-
|
|
26
23
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
27
24
|
arr2[i] = arr[i];
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
return arr2;
|
|
31
27
|
}
|
|
32
28
|
|
|
@@ -60,33 +56,33 @@ function _arrayWithHoles(arr) {
|
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
function _iterableToArrayLimit(arr, i) {
|
|
63
|
-
var _i =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
try {
|
|
73
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
74
|
-
_arr.push(_s.value);
|
|
75
|
-
|
|
76
|
-
if (i && _arr.length === i) break;
|
|
77
|
-
}
|
|
78
|
-
} catch (err) {
|
|
79
|
-
_d = true;
|
|
80
|
-
_e = err;
|
|
81
|
-
} finally {
|
|
59
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
60
|
+
if (null != _i) {
|
|
61
|
+
var _s,
|
|
62
|
+
_e,
|
|
63
|
+
_x,
|
|
64
|
+
_r,
|
|
65
|
+
_arr = [],
|
|
66
|
+
_n = !0,
|
|
67
|
+
_d = !1;
|
|
82
68
|
try {
|
|
83
|
-
if (
|
|
69
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
70
|
+
if (Object(_i) !== _i) return;
|
|
71
|
+
_n = !1;
|
|
72
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
|
|
73
|
+
;
|
|
74
|
+
}
|
|
75
|
+
} catch (err) {
|
|
76
|
+
_d = !0, _e = err;
|
|
84
77
|
} finally {
|
|
85
|
-
|
|
78
|
+
try {
|
|
79
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
80
|
+
} finally {
|
|
81
|
+
if (_d) throw _e;
|
|
82
|
+
}
|
|
86
83
|
}
|
|
84
|
+
return _arr;
|
|
87
85
|
}
|
|
88
|
-
|
|
89
|
-
return _arr;
|
|
90
86
|
}
|
|
91
87
|
|
|
92
88
|
function _nonIterableRest() {
|
|
@@ -99,34 +95,27 @@ function _slicedToArray(arr, i) {
|
|
|
99
95
|
|
|
100
96
|
var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
101
97
|
var _React$useState = React.useState(false),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
99
|
+
focusedState = _React$useState2[0],
|
|
100
|
+
setFocusedState = _React$useState2[1];
|
|
106
101
|
var elementRef = React.useRef(null);
|
|
107
102
|
var listRef = React.useRef(null);
|
|
108
103
|
var inputRef = React.useRef(props.inputRef);
|
|
109
|
-
|
|
110
104
|
var removeItem = function removeItem(event, index) {
|
|
111
105
|
if (props.disabled && props.readOnly) {
|
|
112
106
|
return;
|
|
113
107
|
}
|
|
114
|
-
|
|
115
108
|
var values = _toConsumableArray(props.value);
|
|
116
|
-
|
|
117
109
|
var removedItem = values.splice(index, 1);
|
|
118
|
-
|
|
119
110
|
if (!isRemovable(removedItem, index)) {
|
|
120
111
|
return;
|
|
121
112
|
}
|
|
122
|
-
|
|
123
113
|
if (props.onRemove) {
|
|
124
114
|
props.onRemove({
|
|
125
115
|
originalEvent: event,
|
|
126
116
|
value: removedItem
|
|
127
117
|
});
|
|
128
118
|
}
|
|
129
|
-
|
|
130
119
|
if (props.onChange) {
|
|
131
120
|
props.onChange({
|
|
132
121
|
originalEvent: event,
|
|
@@ -141,75 +130,62 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (pro
|
|
|
141
130
|
});
|
|
142
131
|
}
|
|
143
132
|
};
|
|
144
|
-
|
|
145
133
|
var addItem = function addItem(event, item, preventDefault) {
|
|
146
134
|
if (item && item.trim().length) {
|
|
147
135
|
var values = props.value ? _toConsumableArray(props.value) : [];
|
|
148
|
-
|
|
149
136
|
if (props.allowDuplicate || values.indexOf(item) === -1) {
|
|
150
137
|
var allowAddition = true;
|
|
151
|
-
|
|
152
138
|
if (props.onAdd) {
|
|
153
139
|
allowAddition = props.onAdd({
|
|
154
140
|
originalEvent: event,
|
|
155
141
|
value: item
|
|
156
142
|
});
|
|
157
143
|
}
|
|
158
|
-
|
|
159
144
|
if (allowAddition !== false) {
|
|
160
145
|
values.push(item);
|
|
161
146
|
}
|
|
162
147
|
}
|
|
163
|
-
|
|
164
148
|
updateInput(event, values, preventDefault);
|
|
165
149
|
}
|
|
166
150
|
};
|
|
167
|
-
|
|
168
151
|
var onWrapperClick = function onWrapperClick() {
|
|
169
152
|
DomHandler.focus(inputRef.current);
|
|
170
153
|
};
|
|
171
|
-
|
|
172
154
|
var onKeyDown = function onKeyDown(event) {
|
|
173
155
|
var inputValue = event.target.value;
|
|
174
156
|
var values = props.value || [];
|
|
175
|
-
props.onKeyDown && props.onKeyDown(event);
|
|
157
|
+
props.onKeyDown && props.onKeyDown(event);
|
|
176
158
|
|
|
159
|
+
// do not continue if the user defined keydown wants to prevent
|
|
177
160
|
if (event.defaultPrevented) {
|
|
178
161
|
return;
|
|
179
162
|
}
|
|
180
|
-
|
|
181
163
|
switch (event.which) {
|
|
182
164
|
//backspace
|
|
183
165
|
case 8:
|
|
184
166
|
if (inputRef.current.value.length === 0 && values.length > 0) {
|
|
185
167
|
removeItem(event, values.length - 1);
|
|
186
168
|
}
|
|
187
|
-
|
|
188
169
|
break;
|
|
189
|
-
//enter
|
|
190
170
|
|
|
171
|
+
//enter
|
|
191
172
|
case 13:
|
|
192
173
|
if (inputValue && inputValue.trim().length && (!props.max || props.max > values.length)) {
|
|
193
174
|
addItem(event, inputValue, true);
|
|
194
175
|
}
|
|
195
|
-
|
|
196
176
|
break;
|
|
197
|
-
|
|
198
177
|
default:
|
|
199
178
|
if (props.keyfilter) {
|
|
200
179
|
KeyFilter.onKeyPress(event, props.keyfilter);
|
|
201
180
|
}
|
|
202
|
-
|
|
203
181
|
if (isMaxedOut()) {
|
|
204
182
|
event.preventDefault();
|
|
205
183
|
} else if (props.separator === ',' && event.which === 188) {
|
|
206
184
|
addItem(event, inputValue, true);
|
|
207
185
|
}
|
|
208
|
-
|
|
209
186
|
break;
|
|
210
187
|
}
|
|
211
188
|
};
|
|
212
|
-
|
|
213
189
|
var updateInput = function updateInput(event, items, preventDefault) {
|
|
214
190
|
if (props.onChange) {
|
|
215
191
|
props.onChange({
|
|
@@ -224,19 +200,15 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (pro
|
|
|
224
200
|
}
|
|
225
201
|
});
|
|
226
202
|
}
|
|
227
|
-
|
|
228
203
|
inputRef.current.value = '';
|
|
229
204
|
preventDefault && event.preventDefault();
|
|
230
205
|
};
|
|
231
|
-
|
|
232
206
|
var onPaste = function onPaste(event) {
|
|
233
207
|
if (props.separator) {
|
|
234
208
|
var pastedData = (event.clipboardData || window['clipboardData']).getData('Text');
|
|
235
|
-
|
|
236
209
|
if (props.keyfilter) {
|
|
237
210
|
KeyFilter.onPaste(event, props.keyfilter);
|
|
238
211
|
}
|
|
239
|
-
|
|
240
212
|
if (pastedData) {
|
|
241
213
|
var values = props.value || [];
|
|
242
214
|
var pastedValues = pastedData.split(props.separator);
|
|
@@ -248,35 +220,28 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (pro
|
|
|
248
220
|
}
|
|
249
221
|
}
|
|
250
222
|
};
|
|
251
|
-
|
|
252
223
|
var onFocus = function onFocus(event) {
|
|
253
224
|
setFocusedState(true);
|
|
254
225
|
props.onFocus && props.onFocus(event);
|
|
255
226
|
};
|
|
256
|
-
|
|
257
227
|
var onBlur = function onBlur(event) {
|
|
258
228
|
if (props.addOnBlur) {
|
|
259
229
|
var inputValue = event.target.value;
|
|
260
230
|
var values = props.value || [];
|
|
261
|
-
|
|
262
231
|
if (inputValue && inputValue.trim().length && (!props.max || props.max > values.length)) {
|
|
263
232
|
addItem(event, inputValue, true);
|
|
264
233
|
}
|
|
265
234
|
}
|
|
266
|
-
|
|
267
235
|
setFocusedState(false);
|
|
268
236
|
props.onBlur && props.onBlur(event);
|
|
269
237
|
};
|
|
270
|
-
|
|
271
238
|
var isMaxedOut = function isMaxedOut() {
|
|
272
239
|
return props.max && props.value && props.max === props.value.length;
|
|
273
240
|
};
|
|
274
|
-
|
|
275
241
|
var currentValue = inputRef.current && inputRef.current.value;
|
|
276
242
|
var isFilled = React.useMemo(function () {
|
|
277
243
|
return ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(currentValue);
|
|
278
244
|
}, [props.value, currentValue]);
|
|
279
|
-
|
|
280
245
|
var isRemovable = function isRemovable(value, index) {
|
|
281
246
|
return ObjectUtils.getPropValue(props.removable, {
|
|
282
247
|
value: value,
|
|
@@ -284,7 +249,6 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (pro
|
|
|
284
249
|
props: props
|
|
285
250
|
});
|
|
286
251
|
};
|
|
287
|
-
|
|
288
252
|
React.useImperativeHandle(ref, function () {
|
|
289
253
|
return {
|
|
290
254
|
props: props,
|
|
@@ -299,7 +263,6 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (pro
|
|
|
299
263
|
React.useEffect(function () {
|
|
300
264
|
ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
301
265
|
}, [inputRef, props.inputRef]);
|
|
302
|
-
|
|
303
266
|
var createRemoveIcon = function createRemoveIcon(value, index) {
|
|
304
267
|
if (!props.disabled && !props.readOnly && isRemovable(value, index)) {
|
|
305
268
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -309,10 +272,8 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (pro
|
|
|
309
272
|
}
|
|
310
273
|
});
|
|
311
274
|
}
|
|
312
|
-
|
|
313
275
|
return null;
|
|
314
276
|
};
|
|
315
|
-
|
|
316
277
|
var createItem = function createItem(value, index) {
|
|
317
278
|
var content = props.itemTemplate ? props.itemTemplate(value) : value;
|
|
318
279
|
var label = /*#__PURE__*/React.createElement("span", {
|
|
@@ -324,7 +285,6 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (pro
|
|
|
324
285
|
className: "p-chips-token p-highlight"
|
|
325
286
|
}, label, icon);
|
|
326
287
|
};
|
|
327
|
-
|
|
328
288
|
var createInput = function createInput() {
|
|
329
289
|
return /*#__PURE__*/React.createElement("li", {
|
|
330
290
|
className: "p-chips-input-token"
|
|
@@ -342,11 +302,9 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (pro
|
|
|
342
302
|
readOnly: props.readOnly
|
|
343
303
|
}, ariaProps)));
|
|
344
304
|
};
|
|
345
|
-
|
|
346
305
|
var createItems = function createItems() {
|
|
347
306
|
return props.value ? props.value.map(createItem) : null;
|
|
348
307
|
};
|
|
349
|
-
|
|
350
308
|
var createList = function createList() {
|
|
351
309
|
var className = classNames('p-inputtext p-chips-multiple-container', {
|
|
352
310
|
'p-disabled': props.disabled,
|
|
@@ -360,7 +318,6 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (pro
|
|
|
360
318
|
onClick: onWrapperClick
|
|
361
319
|
}, items, input);
|
|
362
320
|
};
|
|
363
|
-
|
|
364
321
|
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
|
|
365
322
|
var otherProps = ObjectUtils.findDiffKeys(props, Chips.defaultProps);
|
|
366
323
|
var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
|
package/chips/chips.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{KeyFilter as n}from"primereact/keyfilter";import{Tooltip as t}from"primereact/tooltip";import{ObjectUtils as r,DomHandler as l,classNames as a}from"primereact/utils";function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(this,arguments)}function i(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function u(e){if(Array.isArray(e))return i(e)}function c(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(e,n){if(e){if("string"==typeof e)return i(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,n):void 0}}function f(){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 s(e){return u(e)||c(e)||p(e)||f()}function m(e){if(Array.isArray(e))return e}function d(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,l,a=[],
|
|
1
|
+
import*as e from"react";import{KeyFilter as n}from"primereact/keyfilter";import{Tooltip as t}from"primereact/tooltip";import{ObjectUtils as r,DomHandler as l,classNames as a}from"primereact/utils";function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(this,arguments)}function i(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function u(e){if(Array.isArray(e))return i(e)}function c(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(e,n){if(e){if("string"==typeof e)return i(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,n):void 0}}function f(){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 s(e){return u(e)||c(e)||p(e)||f()}function m(e){if(Array.isArray(e))return e}function d(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,l,a,o,i=[],u=!0,c=!1;try{if(a=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;u=!1}else for(;!(u=(r=a.call(t)).done)&&(i.push(r.value),i.length!==n);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw l}}return i}}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=e.memo(e.forwardRef((function(i,u){var c,f,h=e.useState(!1),g=(f=2,m(c=h)||d(c,f)||p(c,f)||v()),b=g[0],w=g[1],E=e.useRef(null),O=e.useRef(null),k=e.useRef(i.inputRef),x=function(e,n){if(!i.disabled||!i.readOnly){var t=s(i.value),r=t.splice(n,1);K(r,n)&&(i.onRemove&&i.onRemove({originalEvent:e,value:r}),i.onChange&&i.onChange({originalEvent:e,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:i.name,id:i.id,value:t}}))}},D=function(e,n,t){if(n&&n.trim().length){var r=i.value?s(i.value):[];if(i.allowDuplicate||-1===r.indexOf(n)){var l=!0;i.onAdd&&(l=i.onAdd({originalEvent:e,value:n})),!1!==l&&r.push(n)}P(e,r,t)}},A=function(){l.focus(k.current)},R=function(e){var t=e.target.value,r=i.value||[];if(i.onKeyDown&&i.onKeyDown(e),!e.defaultPrevented)switch(e.which){case 8:0===k.current.value.length&&r.length>0&&x(e,r.length-1);break;case 13:t&&t.trim().length&&(!i.max||i.max>r.length)&&D(e,t,!0);break;default:i.keyfilter&&n.onKeyPress(e,i.keyfilter),S()?e.preventDefault():","===i.separator&&188===e.which&&D(e,t,!0)}},P=function(e,n,t){i.onChange&&i.onChange({originalEvent:e,value:n,stopPropagation:function(){},preventDefault:function(){},target:{name:i.name,id:i.id,value:n}}),k.current.value="",t&&e.preventDefault()},N=function(e){if(i.separator){var t=(e.clipboardData||window.clipboardData).getData("Text");if(i.keyfilter&&n.onPaste(e,i.keyfilter),t){var r=i.value||[],l=t.split(i.separator);l=l.filter((function(e){return(i.allowDuplicate||-1===r.indexOf(e))&&e.trim().length})),r=[].concat(s(r),s(l)),P(e,r,!0)}}},C=function(e){w(!0),i.onFocus&&i.onFocus(e)},I=function(e){if(i.addOnBlur){var n=e.target.value,t=i.value||[];n&&n.trim().length&&(!i.max||i.max>t.length)&&D(e,n,!0)}w(!1),i.onBlur&&i.onBlur(e)},S=function(){return i.max&&i.value&&i.max===i.value.length},j=k.current&&k.current.value,B=e.useMemo((function(){return r.isNotEmpty(i.value)||r.isNotEmpty(j)}),[i.value,j]),K=function(e,n){return r.getPropValue(i.removable,{value:e,index:n,props:i})};e.useImperativeHandle(u,(function(){return{props:i,getElement:function(){return E.current},getInput:function(){return k.current}}})),e.useEffect((function(){r.combinedRefs(k,i.inputRef)}),[k,i.inputRef]);var T=function(n,t){return i.disabled||i.readOnly||!K(n,t)?null:e.createElement("span",{className:"p-chips-token-icon pi pi-times-circle",onClick:function(e){return x(e,t)}})},F=function(n,t){var r=i.itemTemplate?i.itemTemplate(n):n,l=e.createElement("span",{className:"p-chips-token-label"},r),a=T(n,t);return e.createElement("li",{key:t,className:"p-chips-token p-highlight"},l,a)},_=r.isNotEmpty(i.tooltip),M=r.findDiffKeys(i,y.defaultProps),H=r.reduceKeys(M,l.ARIA_PROPS),L=a("p-chips p-component p-inputwrapper",{"p-inputwrapper-filled":B,"p-inputwrapper-focus":b},i.className),U=function(){var n=a("p-inputtext p-chips-multiple-container",{"p-disabled":i.disabled,"p-focus":b}),t=i.value?i.value.map(F):null,r=e.createElement("li",{className:"p-chips-input-token"},e.createElement("input",o({ref:k,id:i.inputId,placeholder:i.placeholder,type:"text",name:i.name,disabled:i.disabled||S(),onKeyDown:R,onPaste:N,onFocus:C,onBlur:I,readOnly:i.readOnly},H)));return e.createElement("ul",{ref:O,className:n,onClick:A},t,r)}();return e.createElement(e.Fragment,null,e.createElement("div",o({ref:E,id:i.id,className:L,style:i.style},M),U),_&&e.createElement(t,o({target:k,content:i.tooltip},i.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};export{y as Chips};
|