primereact 7.0.0-rc.1 → 7.1.0
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/README.md +35 -10
- package/accordion/accordion.cjs.js +40 -27
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +7 -3
- package/accordion/accordion.esm.js +27 -14
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +40 -28
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +82 -46
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +95 -61
- package/api/api.esm.js +69 -33
- package/api/api.esm.min.js +1 -1
- package/api/api.js +83 -47
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +79 -71
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +11 -4
- package/autocomplete/autocomplete.esm.js +16 -8
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +75 -72
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +10 -9
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +2 -1
- package/avatar/avatar.esm.js +5 -4
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +11 -10
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +3 -3
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +1 -1
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +4 -4
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +3 -3
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +1 -1
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +4 -4
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +27 -16
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +17 -7
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +26 -17
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +16 -16
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +17 -17
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +42 -53
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +4 -11
- package/button/button.esm.js +31 -42
- package/button/button.esm.min.js +1 -1
- package/button/button.js +41 -54
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +193 -154
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +7 -2
- package/calendar/calendar.esm.js +68 -29
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +189 -155
- package/calendar/calendar.min.css +1 -1
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +1 -1
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +2 -2
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +13 -13
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +1 -1
- package/card/card.esm.min.js +1 -1
- package/card/card.js +14 -14
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +45 -45
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +10 -10
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +45 -46
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +51 -47
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +7 -3
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +48 -48
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +6 -8
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +1 -1
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +5 -5
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +20 -15
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +2 -1
- package/checkbox/checkbox.esm.js +13 -8
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +20 -16
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +16 -14
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +3 -4
- package/chip/chip.esm.js +11 -9
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +17 -15
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +46 -20
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +10 -0
- package/chips/chips.esm.js +37 -11
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +46 -21
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +35 -31
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +20 -6
- package/colorpicker/colorpicker.esm.js +7 -3
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +32 -32
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +24 -2
- package/column/column.esm.min.js +1 -1
- package/column/column.js +1 -1
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +1 -1
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +22 -20
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +4 -3
- package/confirmdialog/confirmdialog.esm.js +6 -4
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +22 -21
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +46 -41
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +6 -4
- package/confirmpopup/confirmpopup.esm.js +12 -8
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +43 -41
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +68 -63
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +35 -31
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +65 -64
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +11228 -846
- package/core/core.min.js +40 -1
- package/csstransition/csstransition.cjs.js +49 -19
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.d.ts +8 -0
- package/csstransition/csstransition.esm.js +48 -19
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +49 -21
- package/csstransition/csstransition.min.js +1 -1
- package/csstransition/package.json +2 -1
- package/datascroller/datascroller.cjs.js +12 -11
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +4 -3
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +12 -12
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +600 -519
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +30 -14
- package/datatable/datatable.esm.js +321 -240
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +597 -520
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +32 -29
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +6 -3
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +31 -30
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +1 -1
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +2 -2
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +60 -59
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +3 -1
- package/dialog/dialog.esm.js +13 -13
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +57 -60
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +4 -4
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +1 -1
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +5 -5
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +51 -17
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +13 -0
- package/dock/dock.esm.js +39 -5
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +51 -18
- package/dock/dock.min.css +1 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +99 -77
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +37 -15
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +95 -78
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +44 -42
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +8 -4
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +43 -39
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +17 -15
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fieldset/fieldset.esm.js +3 -1
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +16 -16
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +63 -56
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +2 -1
- package/fileupload/fileupload.esm.js +24 -17
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +63 -57
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +6 -8
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +1 -1
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +5 -5
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +71 -67
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +7 -4
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +68 -68
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +1 -1
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +2 -2
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +31 -27
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +5 -5
- package/image/image.esm.js +5 -2
- package/image/image.esm.min.js +1 -1
- package/image/image.js +29 -28
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +8 -8
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +1 -1
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +9 -9
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +11 -10
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +4 -3
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +11 -11
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +58 -34
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +41 -17
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +57 -35
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +15 -12
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +8 -5
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +15 -13
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +12 -10
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +1 -1
- package/inputtext/inputtext.esm.js +3 -1
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +11 -11
- package/inputtext/inputtext.min.css +1 -1
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +10 -9
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +1 -1
- package/inputtextarea/inputtextarea.esm.js +2 -1
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +10 -10
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +5 -5
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +1 -1
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +6 -6
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +7 -7
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +1 -1
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +8 -8
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +38 -36
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +3 -1
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +37 -37
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +36 -35
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +2 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +36 -36
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +53 -46
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -1
- package/mention/mention.esm.js +9 -3
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +48 -47
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +33 -28
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +4 -1
- package/menu/menu.esm.js +7 -3
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +30 -29
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +38 -35
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +4 -2
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +37 -36
- package/menubar/menubar.min.css +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +9 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +3 -1
- package/message/message.esm.js +3 -2
- package/message/message.esm.min.js +1 -1
- package/message/message.js +10 -9
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +19 -17
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +2 -1
- package/messages/messages.esm.js +3 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +18 -18
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +128 -116
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -2
- package/multiselect/multiselect.esm.js +44 -32
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +124 -117
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +14 -13
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +14 -14
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +35 -34
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +2 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +35 -35
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +26 -26
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +1 -1
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +27 -27
- package/organizationchart/organizationchart.min.css +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +33 -30
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +3 -2
- package/overlaypanel/overlaypanel.esm.js +11 -9
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +29 -31
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/overlayservice/overlayservice.cjs.js +2 -2
- package/overlayservice/overlayservice.cjs.min.js +1 -1
- package/overlayservice/overlayservice.esm.js +1 -1
- package/overlayservice/overlayservice.esm.min.js +1 -1
- package/overlayservice/overlayservice.js +3 -3
- package/overlayservice/overlayservice.min.js +1 -1
- package/package.json +11 -4
- package/paginator/paginator.cjs.js +48 -47
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +2 -1
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +48 -48
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +21 -18
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +6 -3
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +20 -19
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +40 -39
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/panelmenu/panelmenu.esm.js +2 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +40 -40
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +33 -29
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +3 -2
- package/password/password.esm.js +7 -3
- package/password/password.esm.min.js +1 -1
- package/password/password.js +30 -30
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +58 -54
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +14 -10
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +58 -55
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +4 -8
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +2 -6
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +5 -10
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +3168 -2524
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1939 -1294
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +3167 -2521
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +9 -9
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +1 -1
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +10 -10
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +5 -5
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +1 -1
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +6 -6
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +10 -9
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -1
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +10 -10
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +10 -9
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +4 -3
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +10 -10
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +484 -431
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +38 -18
- package/resources/themes/arya-green/theme.css +38 -18
- package/resources/themes/arya-orange/theme.css +38 -18
- package/resources/themes/arya-purple/theme.css +38 -18
- package/resources/themes/bootstrap4-dark-blue/theme.css +42 -22
- package/resources/themes/bootstrap4-dark-purple/theme.css +42 -22
- package/resources/themes/bootstrap4-light-blue/theme.css +42 -22
- package/resources/themes/bootstrap4-light-purple/theme.css +42 -22
- package/resources/themes/fluent-light/theme.css +38 -18
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/theme.css +5675 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/theme.css +5675 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/theme.css +5675 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/theme.css +5675 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/theme.css +5675 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/theme.css +5675 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/theme.css +5675 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/theme.css +5675 -0
- package/resources/themes/luna-amber/theme.css +42 -22
- package/resources/themes/luna-blue/theme.css +42 -22
- package/resources/themes/luna-green/theme.css +42 -22
- package/resources/themes/luna-pink/theme.css +42 -22
- package/resources/themes/md-dark-deeppurple/theme.css +227 -47
- package/resources/themes/md-dark-indigo/theme.css +227 -47
- package/resources/themes/md-light-deeppurple/theme.css +227 -47
- package/resources/themes/md-light-indigo/theme.css +227 -47
- package/resources/themes/mdc-dark-deeppurple/theme.css +227 -47
- package/resources/themes/mdc-dark-indigo/theme.css +227 -47
- package/resources/themes/mdc-light-deeppurple/theme.css +227 -47
- package/resources/themes/mdc-light-indigo/theme.css +227 -47
- package/resources/themes/nova/theme.css +42 -22
- package/resources/themes/nova-accent/theme.css +42 -22
- package/resources/themes/nova-alt/theme.css +42 -22
- package/resources/themes/rhea/theme.css +42 -22
- package/resources/themes/saga-blue/theme.css +38 -18
- package/resources/themes/saga-green/theme.css +38 -18
- package/resources/themes/saga-orange/theme.css +38 -18
- package/resources/themes/saga-purple/theme.css +38 -18
- package/resources/themes/tailwind-light/theme.css +42 -22
- package/resources/themes/vela-blue/theme.css +38 -18
- package/resources/themes/vela-green/theme.css +38 -18
- package/resources/themes/vela-orange/theme.css +38 -18
- package/resources/themes/vela-purple/theme.css +38 -18
- package/ripple/ripple.cjs.js +11 -11
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +3 -3
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +12 -12
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +1 -1
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.min.js +1 -1
- package/row/row.js +2 -2
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +19 -19
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +1 -1
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +20 -20
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +18 -13
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +4 -2
- package/scrolltop/scrolltop.esm.js +9 -5
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +16 -14
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +17 -15
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +3 -1
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +16 -16
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +3 -1
- package/sidebar/sidebar.cjs.js +142 -116
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +4 -1
- package/sidebar/sidebar.esm.js +133 -108
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +139 -117
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +3 -3
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +1 -1
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +4 -4
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +37 -32
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +7 -3
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +34 -33
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +29 -19
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +21 -11
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +30 -20
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +20 -19
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +3 -2
- package/speeddial/speeddial.esm.js +2 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +20 -20
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +43 -35
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +8 -6
- package/splitbutton/splitbutton.esm.js +13 -5
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +40 -36
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +19 -19
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +2 -2
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +20 -20
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +10 -10
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +1 -1
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +11 -11
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +17 -17
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +1 -1
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +18 -18
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +16 -15
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +2 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +16 -16
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +195 -57
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +12 -1
- package/tabview/tabview.esm.js +165 -27
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +195 -58
- package/tabview/tabview.min.css +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +9 -8
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +2 -1
- package/tag/tag.esm.js +5 -4
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +10 -9
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +12 -12
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +1 -1
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +13 -13
- package/terminal/terminal.min.js +1 -1
- package/terminalservice/terminalservice.cjs.js +2 -2
- package/terminalservice/terminalservice.cjs.min.js +1 -1
- package/terminalservice/terminalservice.esm.js +1 -1
- package/terminalservice/terminalservice.esm.min.js +1 -1
- package/terminalservice/terminalservice.js +3 -3
- package/terminalservice/terminalservice.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +42 -36
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +8 -3
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +38 -37
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +12 -12
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +1 -1
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +13 -13
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +46 -40
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +2 -1
- package/toast/toast.esm.js +20 -15
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +44 -41
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +14 -9
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +3 -2
- package/togglebutton/togglebutton.esm.js +8 -3
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +13 -10
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +7 -7
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +1 -1
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +8 -8
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +65 -36
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +36 -8
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +64 -37
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +2 -0
- package/tree/tree.cjs.js +52 -51
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +14 -3
- package/tree/tree.esm.js +2 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +52 -52
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +3 -1
- package/treeselect/treeselect.cjs.js +50 -46
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +11 -3
- package/treeselect/treeselect.esm.js +10 -6
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +47 -47
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +1363 -312
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +10 -3
- package/treetable/treetable.esm.js +1267 -216
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +1362 -313
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +11 -10
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +2 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +11 -11
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +154 -33
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +17 -0
- package/utils/utils.esm.js +153 -33
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +155 -34
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +44 -34
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +29 -19
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +45 -35
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +2 -2
- package/core/core.cjs.js +0 -2987
- package/core/core.cjs.min.js +0 -1
- package/core/core.esm.js +0 -2963
- package/core/core.esm.min.js +0 -1
- package/core/package.json +0 -5
- package/util.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/core"),n=require("primereact/virtualscroller"),i=require("primereact/api");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e),l=r(i);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var m=function(n){d(s,e.Component);var i,r,l=(i=s,r=O(),function(){var e,t=y(i);if(r){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v(this,e)});function s(e){var t;return a(this,s),(t=l.call(this,e)).onClick=t.onClick.bind(c(t)),t}return u(s,[{key:"onClick",value:function(e){this.props.onClick&&this.props.onClick({originalEvent:e,option:this.props.option})}},{key:"render",value:function(){var e=t.classNames("p-dropdown-item",{"p-highlight":this.props.selected,"p-disabled":this.props.disabled,"p-dropdown-item-empty":!this.props.label||0===this.props.label.length},this.props.option.className),n=this.props.template?t.ObjectUtils.getJSXElement(this.props.template,this.props.option):this.props.label;return o.default.createElement("li",{className:e,onClick:this.onClick,"aria-label":this.props.label,key:this.props.label,role:"option","aria-selected":this.props.selected},n,o.default.createElement(t.Ripple,null))}}]),s}();function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function C(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}b(m,"defaultProps",{option:null,label:null,template:null,selected:!1,disabled:!1,onClick:null});var I=function(i){d(h,e.Component);var r,l,p=(r=h,l=C(),function(){var e,t=y(r);if(l){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v(this,e)});function h(e){var t;return a(this,h),(t=p.call(this,e)).onEnter=t.onEnter.bind(c(t)),t.onEntered=t.onEntered.bind(c(t)),t.onFilterInputChange=t.onFilterInputChange.bind(c(t)),t}return u(h,[{key:"onEnter",value:function(){var e=this;this.props.onEnter((function(){if(e.virtualScrollerRef){var t=e.props.getSelectedOptionIndex();-1!==t&&e.virtualScrollerRef.scrollToIndex(t)}}))}},{key:"onEntered",value:function(){var e=this;this.props.onEntered((function(){e.props.filter&&e.props.filterInputAutoFocus&&e.filterInput.focus()}))}},{key:"onFilterInputChange",value:function(e){this.virtualScrollerRef&&this.virtualScrollerRef.scrollToIndex(0),this.props.onFilterInputChange&&this.props.onFilterInputChange(e)}},{key:"isEmptyFilter",value:function(){return!(this.props.visibleOptions&&this.props.visibleOptions.length)&&this.props.hasFilter()}},{key:"renderGroupChildren",value:function(e){var t=this;return this.props.getOptionGroupChildren(e).map((function(e,n){var i=t.props.getOptionLabel(e),r=n+"_"+t.props.getOptionRenderKey(e),l=t.props.isOptionDisabled(e);return o.default.createElement(m,{key:r,label:i,option:e,template:t.props.itemTemplate,selected:t.props.isSelected(e),disabled:l,onClick:t.props.onOptionClick})}))}},{key:"renderEmptyMessage",value:function(e){var n=t.ObjectUtils.getJSXElement(e,this.props);return o.default.createElement("li",{className:"p-dropdown-empty-message"},n)}},{key:"renderItem",value:function(e,n){if(this.props.optionGroupLabel){var i=this.props.optionGroupTemplate?t.ObjectUtils.getJSXElement(this.props.optionGroupTemplate,e,n):this.props.getOptionGroupLabel(e),r=this.renderGroupChildren(e),l=n+"_"+this.props.getOptionGroupRenderKey(e);return o.default.createElement(o.default.Fragment,{key:l},o.default.createElement("li",{className:"p-dropdown-item-group"},i),r)}var s=this.props.getOptionLabel(e),a=n+"_"+this.props.getOptionRenderKey(e),p=this.props.isOptionDisabled(e);return o.default.createElement(m,{key:a,label:s,option:e,template:this.props.itemTemplate,selected:this.props.isSelected(e),disabled:p,onClick:this.props.onOptionClick})}},{key:"renderItems",value:function(){var e=this;return this.props.visibleOptions&&this.props.visibleOptions.length?this.props.visibleOptions.map((function(t,n){return e.renderItem(t,n)})):this.props.hasFilter()?this.renderEmptyMessage(this.props.emptyFilterMessage):this.renderEmptyMessage(this.props.emptyMessage)}},{key:"renderFilterClearIcon",value:function(){var e=this;return this.props.showFilterClear&&this.props.filterValue?o.default.createElement("i",{className:"p-dropdown-filter-clear-icon pi pi-times",onClick:function(){return e.props.onFilterClearIconClick((function(){return e.filterInput.focus()}))}}):null}},{key:"renderFilter",value:function(){var e=this;if(this.props.filter){var n=this.renderFilterClearIcon(),i=t.classNames("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!n});return o.default.createElement("div",{className:"p-dropdown-header"},o.default.createElement("div",{className:i},o.default.createElement("input",{ref:function(t){return e.filterInput=t},type:"text",autoComplete:"off",className:"p-dropdown-filter p-inputtext p-component",placeholder:this.props.filterPlaceholder,onKeyDown:this.props.onFilterInputKeyDown,onChange:this.onFilterInputChange,value:this.props.filterValue}),n,o.default.createElement("i",{className:"p-dropdown-filter-icon pi pi-search"})))}return null}},{key:"renderContent",value:function(){var e=this;if(this.props.virtualScrollerOptions){var i=k(k({},this.props.virtualScrollerOptions),{style:k(k({},this.props.virtualScrollerOptions.style),{height:this.props.scrollHeight}),className:t.classNames("p-dropdown-items-wrapper",this.props.virtualScrollerOptions.className),items:this.props.visibleOptions,onLazyLoad:function(t){return e.props.virtualScrollerOptions.onLazyLoad(k(k({},t),{filter:e.props.filterValue}))},itemTemplate:function(t,n){return t&&e.renderItem(t,n.index)},contentTemplate:function(n){var i=t.classNames("p-dropdown-items",n.className),r=e.isEmptyFilter()?e.renderEmptyMessage():n.children;return o.default.createElement("ul",{ref:n.contentRef,className:i,role:"listbox"},r)}});return o.default.createElement(n.VirtualScroller,s({ref:function(t){return e.virtualScrollerRef=t}},i))}var r=this.renderItems();return o.default.createElement("div",{className:"p-dropdown-items-wrapper",style:{maxHeight:this.props.scrollHeight||"auto"}},o.default.createElement("ul",{className:"p-dropdown-items",role:"listbox"},r))}},{key:"renderElement",value:function(){var e=t.classNames("p-dropdown-panel p-component",this.props.panelClassName),n=this.renderFilter(),i=this.renderContent();return o.default.createElement(t.CSSTransition,{nodeRef:this.props.forwardRef,classNames:"p-connected-overlay",in:this.props.in,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntering:this.props.onEntering,onEntered:this.onEntered,onExit:this.props.onExit,onExited:this.props.onExited},o.default.createElement("div",{ref:this.props.forwardRef,className:e,style:this.props.panelStyle,onClick:this.props.onClick},n,i))}},{key:"render",value:function(){var e=this.renderElement();return o.default.createElement(t.Portal,{element:e,appendTo:this.props.appendTo})}}]),h}(),E=o.default.forwardRef((function(e,t){return o.default.createElement(I,s({forwardRef:t},e))}));function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=F(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw o}}}}function F(e,t){if(e){if("string"==typeof e)return x(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)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function R(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var D=function(n){d(f,e.Component);var r,p,h=(r=f,p=R(),function(){var e,t=y(r);if(p){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v(this,e)});function f(t){var n;return a(this,f),(n=h.call(this,t)).state={filter:"",focused:!1,overlayVisible:!1},n.onClick=n.onClick.bind(c(n)),n.onInputFocus=n.onInputFocus.bind(c(n)),n.onInputBlur=n.onInputBlur.bind(c(n)),n.onInputKeyDown=n.onInputKeyDown.bind(c(n)),n.onEditableInputChange=n.onEditableInputChange.bind(c(n)),n.onEditableInputFocus=n.onEditableInputFocus.bind(c(n)),n.onOptionClick=n.onOptionClick.bind(c(n)),n.onFilterInputChange=n.onFilterInputChange.bind(c(n)),n.onFilterInputKeyDown=n.onFilterInputKeyDown.bind(c(n)),n.onFilterClearIconClick=n.onFilterClearIconClick.bind(c(n)),n.onPanelClick=n.onPanelClick.bind(c(n)),n.onOverlayEnter=n.onOverlayEnter.bind(c(n)),n.onOverlayEntered=n.onOverlayEntered.bind(c(n)),n.onOverlayExit=n.onOverlayExit.bind(c(n)),n.onOverlayExited=n.onOverlayExited.bind(c(n)),n.resetFilter=n.resetFilter.bind(c(n)),n.clear=n.clear.bind(c(n)),n.hasFilter=n.hasFilter.bind(c(n)),n.getOptionLabel=n.getOptionLabel.bind(c(n)),n.getOptionRenderKey=n.getOptionRenderKey.bind(c(n)),n.isOptionDisabled=n.isOptionDisabled.bind(c(n)),n.getOptionGroupChildren=n.getOptionGroupChildren.bind(c(n)),n.getOptionGroupLabel=n.getOptionGroupLabel.bind(c(n)),n.getOptionGroupRenderKey=n.getOptionGroupRenderKey.bind(c(n)),n.getSelectedOptionIndex=n.getSelectedOptionIndex.bind(c(n)),n.isSelected=n.isSelected.bind(c(n)),n.overlayRef=e.createRef(),n.inputRef=e.createRef(n.props.inputRef),n}return u(f,[{key:"onClick",value:function(e){this.props.disabled||t.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")||"INPUT"===e.target.tagName||this.overlayRef.current&&this.overlayRef.current&&this.overlayRef.current.contains(e.target)||(this.focusInput.focus(),this.state.overlayVisible?this.hideOverlay():this.showOverlay())}},{key:"onInputFocus",value:function(e){var t=this;e.persist(),this.props.showOnFocus&&!this.state.overlayVisible&&this.showOverlay(),this.setState({focused:!0},(function(){t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onInputBlur",value:function(e){var t=this;e.persist(),this.setState({focused:!1},(function(){t.props.onBlur&&t.props.onBlur(e)}))}},{key:"onPanelClick",value:function(e){t.OverlayService.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:this.onDownKey(e);break;case 38:this.onUpKey(e);break;case 32:this.state.overlayVisible?this.hideOverlay():this.showOverlay(),e.preventDefault();break;case 13:this.hideOverlay(),e.preventDefault();break;case 27:case 9:this.hideOverlay();break;default:this.search(e)}}},{key:"onFilterInputKeyDown",value:function(e){switch(e.which){case 40:this.onDownKey(e);break;case 38:this.onUpKey(e);break;case 13:case 27:this.hideOverlay(),e.preventDefault()}}},{key:"onUpKey",value:function(e){if(this.getVisibleOptions()){var t=this.findPrevOption(this.getSelectedOptionIndex());t&&this.selectItem({originalEvent:e,option:t})}e.preventDefault()}},{key:"onDownKey",value:function(e){if(this.getVisibleOptions())if(!this.state.overlayVisible&&e.altKey)this.showOverlay();else{var t=this.findNextOption(this.getSelectedOptionIndex());t&&this.selectItem({originalEvent:e,option:t})}e.preventDefault()}},{key:"findNextOption",value:function(e){var t=this.getVisibleOptions();if(this.props.optionGroupLabel){var n=-1===e?0:e.group,i=-1===e?-1:e.option,r=this.findNextOptionInList(this.getOptionGroupChildren(t[n]),i);return r||(n+1!==t.length?this.findNextOption({group:n+1,option:-1}):null)}return this.findNextOptionInList(t,e)}},{key:"findNextOptionInList",value:function(e,t){var n=t+1;if(n===e.length)return null;var i=e[n];return this.isOptionDisabled(i)?this.findNextOptionInList(n):i}},{key:"findPrevOption",value:function(e){if(-1===e)return null;var t=this.getVisibleOptions();if(this.props.optionGroupLabel){var n=e.group,i=e.option,r=this.findPrevOptionInList(this.getOptionGroupChildren(t[n]),i);return r||(n>0?this.findPrevOption({group:n-1,option:this.getOptionGroupChildren(t[n-1]).length}):null)}return this.findPrevOptionInList(t,e)}},{key:"findPrevOptionInList",value:function(e,t){var n=t-1;if(n<0)return null;var i=e[n];return this.isOptionDisabled(i)?this.findPrevOption(n):i}},{key:"search",value:function(e){var t=this;this.searchTimeout&&clearTimeout(this.searchTimeout);var n=e.key;if(this.previousSearchChar=this.currentSearchChar,this.currentSearchChar=n,this.searchValue=this.previousSearchChar===this.currentSearchChar?this.currentSearchChar:this.searchValue?this.searchValue+n:n,this.searchValue){var i=this.getSelectedOptionIndex(),r=this.props.optionGroupLabel?this.searchOptionInGroup(i):this.searchOption(++i);r&&(this.selectItem({originalEvent:e,option:r}),this.selectedOptionUpdated=!0)}this.searchTimeout=setTimeout((function(){t.searchValue=null}),250)}},{key:"searchOption",value:function(e){var t;if(this.searchValue){var n=this.getVisibleOptions();(t=this.searchOptionInRange(e,n.length))||(t=this.searchOptionInRange(0,e))}return t}},{key:"searchOptionInRange",value:function(e,t){for(var n=this.getVisibleOptions(),i=e;i<t;i++){var r=n[i];if(this.matchesSearchValue(r))return r}return null}},{key:"searchOptionInGroup",value:function(e){for(var t=-1===e?{group:0,option:-1}:e,n=this.getVisibleOptions(),i=t.group;i<n.length;i++)for(var r=this.getOptionGroupChildren(n[i]),o=t.group===i?t.option+1:0;o<r.length;o++)if(this.matchesSearchValue(r[o]))return r[o];for(var l=0;l<=t.group;l++)for(var s=this.getOptionGroupChildren(n[l]),a=0;a<(t.group===l?t.option:s.length);a++)if(this.matchesSearchValue(s[a]))return s[a];return null}},{key:"matchesSearchValue",value:function(e){return this.getOptionLabel(e).toLocaleLowerCase(this.props.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.props.filterLocale))}},{key:"onEditableInputChange",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,value:e.target.value,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:e.target.value}})}},{key:"onEditableInputFocus",value:function(e){var t=this;e.persist(),this.setState({focused:!0},(function(){t.hideOverlay(),t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onOptionClick",value:function(e){e.option.disabled||(this.selectItem(e),this.focusInput.focus()),this.hideOverlay()}},{key:"onFilterInputChange",value:function(e){var t=this,n=e.target.value;this.setState({filter:n},(function(){t.props.onFilter&&t.props.onFilter({originalEvent:e,filter:n})}))}},{key:"onFilterClearIconClick",value:function(e){this.resetFilter(e)}},{key:"resetFilter",value:function(e){var t=this;this.setState({filter:""},(function(){t.props.onFilter&&t.props.onFilter({filter:""}),e&&e()}))}},{key:"clear",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e,value:void 0,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:void 0}}),this.updateEditableLabel()}},{key:"selectItem",value:function(e){if(this.getSelectedOption()!==e.option){this.updateEditableLabel(e.option);var t=this.getOptionValue(e.option);this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:t}})}}},{key:"getSelectedOption",value:function(){var e=this.getSelectedOptionIndex(),t=this.getVisibleOptions();return-1!==e?this.props.optionGroupLabel?this.getOptionGroupChildren(t[e.group])[e.option]:t[e]:null}},{key:"getSelectedOptionIndex",value:function(){var e=this.getVisibleOptions();if(null!=this.props.value&&e){if(!this.props.optionGroupLabel)return this.findOptionIndexInList(this.props.value,e);for(var t=0;t<e.length;t++){var n=this.findOptionIndexInList(this.props.value,this.getOptionGroupChildren(e[t]));if(-1!==n)return{group:t,option:n}}}return-1}},{key:"findOptionIndexInList",value:function(e,n){for(var i=this.equalityKey(),r=0;r<n.length;r++)if(t.ObjectUtils.equals(e,this.getOptionValue(n[r]),i))return r;return-1}},{key:"isSelected",value:function(e){return t.ObjectUtils.equals(this.props.value,this.getOptionValue(e),this.equalityKey())}},{key:"equalityKey",value:function(){return this.props.optionValue?null:this.props.dataKey}},{key:"showOverlay",value:function(){this.setState({overlayVisible:!0})}},{key:"hideOverlay",value:function(){this.setState({overlayVisible:!1})}},{key:"onOverlayEnter",value:function(e){t.ZIndexUtils.set("overlay",this.overlayRef.current),this.alignOverlay(),e&&e()}},{key:"onOverlayEntered",value:function(e){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),e&&e(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onOverlayExited",value:function(){this.props.filter&&this.props.resetFilterOnHide&&this.resetFilter(),t.ZIndexUtils.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){t.DomHandler.alignOverlay(this.overlayRef.current,this.input.parentElement,this.props.appendTo||l.default.appendTo)}},{key:"scrollInView",value:function(){var e=t.DomHandler.findSingle(this.overlayRef.current,"li.p-highlight");e&&e.scrollIntoView({block:"nearest",inline:"start"})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hideOverlay()},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new t.ConnectedOverlayScrollHandler(this.container,(function(){e.state.overlayVisible&&e.hideOverlay()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.overlayVisible&&!t.DomHandler.isTouchDevice()&&e.hideOverlay()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.isClearClicked(e)||this.container.contains(e.target)||this.overlayRef&&this.overlayRef.current.contains(e.target))}},{key:"isClearClicked",value:function(e){return t.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")}},{key:"updateEditableLabel",value:function(e){this.input&&(this.input.value=e?this.getOptionLabel(e):this.props.value||"")}},{key:"hasFilter",value:function(){return this.state.filter&&this.state.filter.trim().length>0}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?t.ObjectUtils.resolveFieldData(e,this.props.optionLabel):e&&void 0!==e.label?e.label:e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?t.ObjectUtils.resolveFieldData(e,this.props.optionValue):e&&void 0!==e.value?e.value:e}},{key:"getOptionRenderKey",value:function(e){return this.props.dataKey?t.ObjectUtils.resolveFieldData(e,this.props.dataKey):this.getOptionLabel(e)}},{key:"isOptionDisabled",value:function(e){return this.props.optionDisabled?t.ObjectUtils.isFunction(this.props.optionDisabled)?this.props.optionDisabled(e):t.ObjectUtils.resolveFieldData(e,this.props.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled}},{key:"getOptionGroupRenderKey",value:function(e){return t.ObjectUtils.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupLabel",value:function(e){return t.ObjectUtils.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupChildren",value:function(e){return t.ObjectUtils.resolveFieldData(e,this.props.optionGroupChildren)}},{key:"checkValidity",value:function(){return this.inputRef.current.checkValidity()}},{key:"getVisibleOptions",value:function(){if(this.hasFilter()){var e=this.state.filter.trim().toLocaleLowerCase(this.props.filterLocale),t=this.props.filterBy?this.props.filterBy.split(","):[this.props.optionLabel||"label"];if(this.props.optionGroupLabel){var n,r=[],o=S(this.props.options);try{for(o.s();!(n=o.n()).done;){var l=n.value,s=i.FilterService.filter(this.getOptionGroupChildren(l),t,e,this.props.filterMatchMode,this.props.filterLocale);s&&s.length&&r.push(L(L({},l),{items:s}))}}catch(e){o.e(e)}finally{o.f()}return r}return i.FilterService.filter(this.props.options,t,e,this.props.filterMatchMode,this.props.filterLocale)}return this.props.options}},{key:"updateInputField",value:function(){if(this.props.editable&&this.input){var e=this.getSelectedOption(),t=e?this.getOptionLabel(e):null;this.input.value=t||this.props.value||""}}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.props.autoFocus&&this.focusInput&&this.focusInput.focus(),this.props.tooltip&&this.renderTooltip(),this.updateInputField(),this.inputRef.current.selectedIndex=1}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),t.ZIndexUtils.clear(this.overlayRef.current)}},{key:"componentDidUpdate",value:function(e){this.state.overlayVisible&&(this.props.filter&&this.alignOverlay(),e.value!==this.props.value&&this.scrollInView()),e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(L({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),!this.state.filter||this.props.options&&0!==this.props.options.length||this.setState({filter:""}),this.updateInputField(),this.inputRef.current.selectedIndex=1}},{key:"renderHiddenSelect",value:function(e){var t=o.default.createElement("option",{value:""},this.props.placeholder),n=e?o.default.createElement("option",{value:e.value},this.getOptionLabel(e)):null;return o.default.createElement("div",{className:"p-hidden-accessible p-dropdown-hidden-select"},o.default.createElement("select",{ref:this.inputRef,required:this.props.required,name:this.props.name,tabIndex:-1,"aria-hidden":"true"},t,n))}},{key:"renderTooltip",value:function(){this.tooltip=t.tip({target:this.container,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"renderKeyboardHelper",value:function(){var e=this;return o.default.createElement("div",{className:"p-hidden-accessible"},o.default.createElement("input",{ref:function(t){return e.focusInput=t},id:this.props.inputId,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:this.onInputFocus,onBlur:this.onInputBlur,onKeyDown:this.onInputKeyDown,disabled:this.props.disabled,tabIndex:this.props.tabIndex,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy}))}},{key:"renderLabel",value:function(e){var n=this,i=e?this.getOptionLabel(e):null;if(this.props.editable)return o.default.createElement("input",{ref:function(e){return n.input=e},type:"text",defaultValue:i||this.props.value||"",className:"p-dropdown-label p-inputtext",disabled:this.props.disabled,placeholder:this.props.placeholder,maxLength:this.props.maxLength,onInput:this.onEditableInputChange,onFocus:this.onEditableInputFocus,onBlur:this.onInputBlur,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-haspopup":"listbox"});var r=t.classNames("p-dropdown-label p-inputtext",{"p-placeholder":null===i&&this.props.placeholder,"p-dropdown-label-empty":null===i&&!this.props.placeholder}),l=this.props.valueTemplate?t.ObjectUtils.getJSXElement(this.props.valueTemplate,e,this.props):i||this.props.placeholder||"empty";return o.default.createElement("span",{ref:function(e){return n.input=e},className:r},l)}},{key:"renderClearIcon",value:function(){return null!=this.props.value&&this.props.showClear&&!this.props.disabled?o.default.createElement("i",{className:"p-dropdown-clear-icon pi pi-times",onClick:this.clear}):null}},{key:"renderDropdownIcon",value:function(){var e=this,n=t.classNames("p-dropdown-trigger-icon p-clickable",this.props.dropdownIcon);return o.default.createElement("div",{ref:function(t){return e.trigger=t},className:"p-dropdown-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":this.state.overlayVisible},o.default.createElement("span",{className:n}))}},{key:"render",value:function(){var e=this,n=t.classNames("p-dropdown p-component p-inputwrapper",this.props.className,{"p-disabled":this.props.disabled,"p-focus":this.state.focused,"p-dropdown-clearable":this.props.showClear&&!this.props.disabled,"p-inputwrapper-filled":this.props.value,"p-inputwrapper-focus":this.state.focused||this.state.overlayVisible}),i=this.getVisibleOptions(),r=this.getSelectedOption(),l=this.renderHiddenSelect(r),a=this.renderKeyboardHelper(),p=this.renderLabel(r),u=this.renderDropdownIcon(),c=this.renderClearIcon();return o.default.createElement("div",{id:this.props.id,ref:function(t){return e.container=t},className:n,style:this.props.style,onClick:this.onClick,onMouseDown:this.props.onMouseDown,onContextMenu:this.props.onContextMenu},a,l,p,c,u,o.default.createElement(E,s({ref:this.overlayRef,visibleOptions:i},this.props,{onClick:this.onPanelClick,onOptionClick:this.onOptionClick,filterValue:this.state.filter,hasFilter:this.hasFilter,onFilterClearIconClick:this.onFilterClearIconClick,onFilterInputKeyDown:this.onFilterInputKeyDown,onFilterInputChange:this.onFilterInputChange,getOptionLabel:this.getOptionLabel,getOptionRenderKey:this.getOptionRenderKey,isOptionDisabled:this.isOptionDisabled,getOptionGroupChildren:this.getOptionGroupChildren,getOptionGroupLabel:this.getOptionGroupLabel,getOptionGroupRenderKey:this.getOptionGroupRenderKey,isSelected:this.isSelected,getSelectedOptionIndex:this.getSelectedOptionIndex,in:this.state.overlayVisible,onEnter:this.onOverlayEnter,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited})))}}]),f}();b(D,"defaultProps",{id:null,inputRef:null,name:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,optionGroupTemplate:null,valueTemplate:null,itemTemplate:null,style:null,className:null,virtualScrollerOptions:null,scrollHeight:"200px",filter:!1,filterBy:null,filterMatchMode:"contains",filterPlaceholder:null,filterLocale:void 0,emptyMessage:"No records found",emptyFilterMessage:"No results found",editable:!1,placeholder:null,required:!1,disabled:!1,appendTo:null,tabIndex:null,autoFocus:!1,filterInputAutoFocus:!0,resetFilterOnHide:!1,showFilterClear:!1,panelClassName:null,panelStyle:null,dataKey:null,inputId:null,showClear:!1,maxLength:null,tooltip:null,tooltipOptions:null,ariaLabel:null,ariaLabelledBy:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",showOnFocus:!1,onChange:null,onFocus:null,onBlur:null,onMouseDown:null,onContextMenu:null,onShow:null,onHide:null,onFilter:null}),exports.Dropdown=D;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils"),n=require("primereact/ripple"),i=require("primereact/csstransition"),r=require("primereact/portal"),o=require("primereact/virtualscroller"),l=require("primereact/api"),s=require("primereact/tooltip"),a=require("primereact/overlayservice");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=p(e),c=p(l);function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},h.apply(this,arguments)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function O(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function g(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var E=function(i){O(s,e.Component);var r,o,l=(r=s,o=I(),function(){var e,t=k(r);if(o){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function s(e){var t;return d(this,s),(t=l.call(this,e)).onClick=t.onClick.bind(y(t)),t}return v(s,[{key:"onClick",value:function(e){this.props.onClick&&this.props.onClick({originalEvent:e,option:this.props.option})}},{key:"render",value:function(){var e=t.classNames("p-dropdown-item",{"p-highlight":this.props.selected,"p-disabled":this.props.disabled,"p-dropdown-item-empty":!this.props.label||0===this.props.label.length},this.props.option.className),i=this.props.template?t.ObjectUtils.getJSXElement(this.props.template,this.props.option):this.props.label;return u.default.createElement("li",{className:e,onClick:this.onClick,"aria-label":this.props.label,key:this.props.label,role:"option","aria-selected":this.props.selected},i,u.default.createElement(n.Ripple,null))}}]),s}();function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}C(E,"defaultProps",{option:null,label:null,template:null,selected:!1,disabled:!1,onClick:null});var F=function(n){O(c,e.Component);var s,a,p=(s=c,a=S(),function(){var e,t=k(s);if(a){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function c(e){var t;return d(this,c),(t=p.call(this,e)).onEnter=t.onEnter.bind(y(t)),t.onEntered=t.onEntered.bind(y(t)),t.onFilterInputChange=t.onFilterInputChange.bind(y(t)),t}return v(c,[{key:"onEnter",value:function(){var e=this;this.props.onEnter((function(){if(e.virtualScrollerRef){var t=e.props.getSelectedOptionIndex();-1!==t&&e.virtualScrollerRef.scrollToIndex(t)}}))}},{key:"onEntered",value:function(){var e=this;this.props.onEntered((function(){e.props.filter&&e.props.filterInputAutoFocus&&e.filterInput.focus()}))}},{key:"onFilterInputChange",value:function(e){this.virtualScrollerRef&&this.virtualScrollerRef.scrollToIndex(0),this.props.onFilterInputChange&&this.props.onFilterInputChange(e)}},{key:"isEmptyFilter",value:function(){return!(this.props.visibleOptions&&this.props.visibleOptions.length)&&this.props.hasFilter()}},{key:"renderGroupChildren",value:function(e){var t=this;return this.props.getOptionGroupChildren(e).map((function(e,n){var i=t.props.getOptionLabel(e),r=n+"_"+t.props.getOptionRenderKey(e),o=t.props.isOptionDisabled(e);return u.default.createElement(E,{key:r,label:i,option:e,template:t.props.itemTemplate,selected:t.props.isSelected(e),disabled:o,onClick:t.props.onOptionClick})}))}},{key:"renderEmptyMessage",value:function(e,n){var i=t.ObjectUtils.getJSXElement(e,this.props)||l.localeOption(n?"emptyFilterMessage":"emptyMessage");return u.default.createElement("li",{className:"p-dropdown-empty-message"},i)}},{key:"renderItem",value:function(e,n){if(this.props.optionGroupLabel){var i=this.props.optionGroupTemplate?t.ObjectUtils.getJSXElement(this.props.optionGroupTemplate,e,n):this.props.getOptionGroupLabel(e),r=this.renderGroupChildren(e),o=n+"_"+this.props.getOptionGroupRenderKey(e);return u.default.createElement(u.default.Fragment,{key:o},u.default.createElement("li",{className:"p-dropdown-item-group"},i),r)}var l=this.props.getOptionLabel(e),s=n+"_"+this.props.getOptionRenderKey(e),a=this.props.isOptionDisabled(e);return u.default.createElement(E,{key:s,label:l,option:e,template:this.props.itemTemplate,selected:this.props.isSelected(e),disabled:a,onClick:this.props.onOptionClick})}},{key:"renderItems",value:function(){var e=this;return this.props.visibleOptions&&this.props.visibleOptions.length?this.props.visibleOptions.map((function(t,n){return e.renderItem(t,n)})):this.props.hasFilter()?this.renderEmptyMessage(this.props.emptyFilterMessage,!0):this.renderEmptyMessage(this.props.emptyMessage)}},{key:"renderFilterClearIcon",value:function(){var e=this;return this.props.showFilterClear&&this.props.filterValue?u.default.createElement("i",{className:"p-dropdown-filter-clear-icon pi pi-times",onClick:function(){return e.props.onFilterClearIconClick((function(){return e.filterInput.focus()}))}}):null}},{key:"renderFilter",value:function(){var e=this;if(this.props.filter){var n=this.renderFilterClearIcon(),i=t.classNames("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!n});return u.default.createElement("div",{className:"p-dropdown-header"},u.default.createElement("div",{className:i},u.default.createElement("input",{ref:function(t){return e.filterInput=t},type:"text",autoComplete:"off",className:"p-dropdown-filter p-inputtext p-component",placeholder:this.props.filterPlaceholder,onKeyDown:this.props.onFilterInputKeyDown,onChange:this.onFilterInputChange,value:this.props.filterValue}),n,u.default.createElement("i",{className:"p-dropdown-filter-icon pi pi-search"})))}return null}},{key:"renderContent",value:function(){var e=this;if(this.props.virtualScrollerOptions){var n=L(L({},this.props.virtualScrollerOptions),{style:L(L({},this.props.virtualScrollerOptions.style),{height:this.props.scrollHeight}),className:t.classNames("p-dropdown-items-wrapper",this.props.virtualScrollerOptions.className),items:this.props.visibleOptions,onLazyLoad:function(t){return e.props.virtualScrollerOptions.onLazyLoad(L(L({},t),{filter:e.props.filterValue}))},itemTemplate:function(t,n){return t&&e.renderItem(t,n.index)},contentTemplate:function(n){var i=t.classNames("p-dropdown-items",n.className),r=e.isEmptyFilter()?e.renderEmptyMessage():n.children;return u.default.createElement("ul",{ref:n.contentRef,className:i,role:"listbox"},r)}});return u.default.createElement(o.VirtualScroller,h({ref:function(t){return e.virtualScrollerRef=t}},n))}var i=this.renderItems();return u.default.createElement("div",{className:"p-dropdown-items-wrapper",style:{maxHeight:this.props.scrollHeight||"auto"}},u.default.createElement("ul",{className:"p-dropdown-items",role:"listbox"},i))}},{key:"renderElement",value:function(){var e=t.classNames("p-dropdown-panel p-component",this.props.panelClassName),n=this.renderFilter(),r=this.renderContent();return u.default.createElement(i.CSSTransition,{nodeRef:this.props.forwardRef,classNames:"p-connected-overlay",in:this.props.in,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntering:this.props.onEntering,onEntered:this.onEntered,onExit:this.props.onExit,onExited:this.props.onExited},u.default.createElement("div",{ref:this.props.forwardRef,className:e,style:this.props.panelStyle,onClick:this.props.onClick},n,r))}},{key:"render",value:function(){var e=this.renderElement();return u.default.createElement(r.Portal,{element:e,appendTo:this.props.appendTo})}}]),c}(),R=u.default.forwardRef((function(e,t){return u.default.createElement(F,h({forwardRef:t},e))}));function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function V(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=j(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw o}}}}function j(e,t){if(e){if("string"==typeof e)return N(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)?N(e,t):void 0}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function P(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var G=function(n){O(p,e.Component);var i,r,o=(i=p,r=P(),function(){var e,t=k(i);if(r){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function p(t){var n;return d(this,p),(n=o.call(this,t)).state={filter:"",focused:!1,overlayVisible:!1},n.onClick=n.onClick.bind(y(n)),n.onInputFocus=n.onInputFocus.bind(y(n)),n.onInputBlur=n.onInputBlur.bind(y(n)),n.onInputKeyDown=n.onInputKeyDown.bind(y(n)),n.onEditableInputChange=n.onEditableInputChange.bind(y(n)),n.onEditableInputFocus=n.onEditableInputFocus.bind(y(n)),n.onOptionClick=n.onOptionClick.bind(y(n)),n.onFilterInputChange=n.onFilterInputChange.bind(y(n)),n.onFilterInputKeyDown=n.onFilterInputKeyDown.bind(y(n)),n.onFilterClearIconClick=n.onFilterClearIconClick.bind(y(n)),n.onPanelClick=n.onPanelClick.bind(y(n)),n.onOverlayEnter=n.onOverlayEnter.bind(y(n)),n.onOverlayEntered=n.onOverlayEntered.bind(y(n)),n.onOverlayExit=n.onOverlayExit.bind(y(n)),n.onOverlayExited=n.onOverlayExited.bind(y(n)),n.resetFilter=n.resetFilter.bind(y(n)),n.clear=n.clear.bind(y(n)),n.hasFilter=n.hasFilter.bind(y(n)),n.getOptionLabel=n.getOptionLabel.bind(y(n)),n.getOptionRenderKey=n.getOptionRenderKey.bind(y(n)),n.isOptionDisabled=n.isOptionDisabled.bind(y(n)),n.getOptionGroupChildren=n.getOptionGroupChildren.bind(y(n)),n.getOptionGroupLabel=n.getOptionGroupLabel.bind(y(n)),n.getOptionGroupRenderKey=n.getOptionGroupRenderKey.bind(y(n)),n.getSelectedOptionIndex=n.getSelectedOptionIndex.bind(y(n)),n.isSelected=n.isSelected.bind(y(n)),n.overlayRef=e.createRef(),n.inputRef=e.createRef(n.props.inputRef),n}return v(p,[{key:"onClick",value:function(e){this.props.disabled||t.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")||"INPUT"===e.target.tagName||this.overlayRef.current&&this.overlayRef.current&&this.overlayRef.current.contains(e.target)||(this.focusInput.focus(),this.state.overlayVisible?this.hideOverlay():this.showOverlay())}},{key:"onInputFocus",value:function(e){var t=this;e.persist(),this.props.showOnFocus&&!this.state.overlayVisible&&this.showOverlay(),this.setState({focused:!0},(function(){t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onInputBlur",value:function(e){var t=this;e.persist(),this.setState({focused:!1},(function(){t.props.onBlur&&t.props.onBlur(e)}))}},{key:"onPanelClick",value:function(e){a.OverlayService.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:this.onDownKey(e);break;case 38:this.onUpKey(e);break;case 32:this.state.overlayVisible?this.hideOverlay():this.showOverlay(),e.preventDefault();break;case 13:this.hideOverlay(),e.preventDefault();break;case 27:case 9:this.hideOverlay();break;default:this.search(e)}}},{key:"onFilterInputKeyDown",value:function(e){switch(e.which){case 40:this.onDownKey(e);break;case 38:this.onUpKey(e);break;case 13:case 27:this.hideOverlay(),e.preventDefault()}}},{key:"onUpKey",value:function(e){if(this.getVisibleOptions()){var t=this.findPrevOption(this.getSelectedOptionIndex());t&&this.selectItem({originalEvent:e,option:t})}e.preventDefault()}},{key:"onDownKey",value:function(e){if(this.getVisibleOptions())if(!this.state.overlayVisible&&e.altKey)this.showOverlay();else{var t=this.findNextOption(this.getSelectedOptionIndex());t&&this.selectItem({originalEvent:e,option:t})}e.preventDefault()}},{key:"findNextOption",value:function(e){var t=this.getVisibleOptions();if(this.props.optionGroupLabel){var n=-1===e?0:e.group,i=-1===e?-1:e.option,r=this.findNextOptionInList(this.getOptionGroupChildren(t[n]),i);return r||(n+1!==t.length?this.findNextOption({group:n+1,option:-1}):null)}return this.findNextOptionInList(t,e)}},{key:"findNextOptionInList",value:function(e,t){var n=t+1;if(n===e.length)return null;var i=e[n];return this.isOptionDisabled(i)?this.findNextOptionInList(n):i}},{key:"findPrevOption",value:function(e){if(-1===e)return null;var t=this.getVisibleOptions();if(this.props.optionGroupLabel){var n=e.group,i=e.option,r=this.findPrevOptionInList(this.getOptionGroupChildren(t[n]),i);return r||(n>0?this.findPrevOption({group:n-1,option:this.getOptionGroupChildren(t[n-1]).length}):null)}return this.findPrevOptionInList(t,e)}},{key:"findPrevOptionInList",value:function(e,t){var n=t-1;if(n<0)return null;var i=e[n];return this.isOptionDisabled(i)?this.findPrevOption(n):i}},{key:"search",value:function(e){var t=this;this.searchTimeout&&clearTimeout(this.searchTimeout);var n=e.key;if(this.previousSearchChar=this.currentSearchChar,this.currentSearchChar=n,this.searchValue=this.previousSearchChar===this.currentSearchChar?this.currentSearchChar:this.searchValue?this.searchValue+n:n,this.searchValue){var i=this.getSelectedOptionIndex(),r=this.props.optionGroupLabel?this.searchOptionInGroup(i):this.searchOption(++i);r&&(this.selectItem({originalEvent:e,option:r}),this.selectedOptionUpdated=!0)}this.searchTimeout=setTimeout((function(){t.searchValue=null}),250)}},{key:"searchOption",value:function(e){var t;if(this.searchValue){var n=this.getVisibleOptions();(t=this.searchOptionInRange(e,n.length))||(t=this.searchOptionInRange(0,e))}return t}},{key:"searchOptionInRange",value:function(e,t){for(var n=this.getVisibleOptions(),i=e;i<t;i++){var r=n[i];if(this.matchesSearchValue(r))return r}return null}},{key:"searchOptionInGroup",value:function(e){for(var t=-1===e?{group:0,option:-1}:e,n=this.getVisibleOptions(),i=t.group;i<n.length;i++)for(var r=this.getOptionGroupChildren(n[i]),o=t.group===i?t.option+1:0;o<r.length;o++)if(this.matchesSearchValue(r[o]))return r[o];for(var l=0;l<=t.group;l++)for(var s=this.getOptionGroupChildren(n[l]),a=0;a<(t.group===l?t.option:s.length);a++)if(this.matchesSearchValue(s[a]))return s[a];return null}},{key:"matchesSearchValue",value:function(e){return this.getOptionLabel(e).toLocaleLowerCase(this.props.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.props.filterLocale))}},{key:"onEditableInputChange",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,value:e.target.value,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:e.target.value}})}},{key:"onEditableInputFocus",value:function(e){var t=this;e.persist(),this.setState({focused:!0},(function(){t.hideOverlay(),t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onOptionClick",value:function(e){e.option.disabled||(this.selectItem(e),this.focusInput.focus()),this.hideOverlay()}},{key:"onFilterInputChange",value:function(e){var t=this,n=e.target.value;this.setState({filter:n},(function(){t.props.onFilter&&t.props.onFilter({originalEvent:e,filter:n})}))}},{key:"onFilterClearIconClick",value:function(e){this.resetFilter(e)}},{key:"resetFilter",value:function(e){var t=this;this.setState({filter:""},(function(){t.props.onFilter&&t.props.onFilter({filter:""}),e&&e()}))}},{key:"clear",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e,value:void 0,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:void 0}}),this.updateEditableLabel()}},{key:"selectItem",value:function(e){if(this.getSelectedOption()!==e.option){this.updateEditableLabel(e.option);var t=this.getOptionValue(e.option);this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:t}})}}},{key:"getSelectedOption",value:function(){var e=this.getSelectedOptionIndex(),t=this.getVisibleOptions();return-1!==e?this.props.optionGroupLabel?this.getOptionGroupChildren(t[e.group])[e.option]:t[e]:null}},{key:"getSelectedOptionIndex",value:function(){var e=this.getVisibleOptions();if(null!=this.props.value&&e){if(!this.props.optionGroupLabel)return this.findOptionIndexInList(this.props.value,e);for(var t=0;t<e.length;t++){var n=this.findOptionIndexInList(this.props.value,this.getOptionGroupChildren(e[t]));if(-1!==n)return{group:t,option:n}}}return-1}},{key:"findOptionIndexInList",value:function(e,n){for(var i=this.equalityKey(),r=0;r<n.length;r++)if(t.ObjectUtils.equals(e,this.getOptionValue(n[r]),i))return r;return-1}},{key:"isSelected",value:function(e){return t.ObjectUtils.equals(this.props.value,this.getOptionValue(e),this.equalityKey())}},{key:"equalityKey",value:function(){return this.props.optionValue?null:this.props.dataKey}},{key:"showOverlay",value:function(){this.setState({overlayVisible:!0})}},{key:"hideOverlay",value:function(){this.setState({overlayVisible:!1})}},{key:"onOverlayEnter",value:function(e){t.ZIndexUtils.set("overlay",this.overlayRef.current,c.default.autoZIndex,c.default.zIndex.overlay),this.alignOverlay(),e&&e()}},{key:"onOverlayEntered",value:function(e){e&&e(),this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onOverlayExited",value:function(){this.props.filter&&this.props.resetFilterOnHide&&this.resetFilter(),t.ZIndexUtils.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){t.DomHandler.alignOverlay(this.overlayRef.current,this.input.parentElement,this.props.appendTo||c.default.appendTo)}},{key:"scrollInView",value:function(){var e=t.DomHandler.findSingle(this.overlayRef.current,"li.p-highlight");e&&e.scrollIntoView({block:"nearest",inline:"start"})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hideOverlay()},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new t.ConnectedOverlayScrollHandler(this.container,(function(){e.state.overlayVisible&&e.hideOverlay()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.overlayVisible&&!t.DomHandler.isTouchDevice()&&e.hideOverlay()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.isClearClicked(e)||this.container.contains(e.target)||this.overlayRef&&this.overlayRef.current.contains(e.target))}},{key:"isClearClicked",value:function(e){return t.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")||t.DomHandler.hasClass(e.target,"p-dropdown-filter-clear-icon")}},{key:"updateEditableLabel",value:function(e){this.input&&(this.input.value=e?this.getOptionLabel(e):this.props.value||"")}},{key:"hasFilter",value:function(){return this.state.filter&&this.state.filter.trim().length>0}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?t.ObjectUtils.resolveFieldData(e,this.props.optionLabel):e&&void 0!==e.label?e.label:e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?t.ObjectUtils.resolveFieldData(e,this.props.optionValue):e&&void 0!==e.value?e.value:e}},{key:"getOptionRenderKey",value:function(e){return this.props.dataKey?t.ObjectUtils.resolveFieldData(e,this.props.dataKey):this.getOptionLabel(e)}},{key:"isOptionDisabled",value:function(e){return this.props.optionDisabled?t.ObjectUtils.isFunction(this.props.optionDisabled)?this.props.optionDisabled(e):t.ObjectUtils.resolveFieldData(e,this.props.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled}},{key:"getOptionGroupRenderKey",value:function(e){return t.ObjectUtils.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupLabel",value:function(e){return t.ObjectUtils.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupChildren",value:function(e){return t.ObjectUtils.resolveFieldData(e,this.props.optionGroupChildren)}},{key:"checkValidity",value:function(){return!!this.inputRef.current&&this.inputRef.current.checkValidity()}},{key:"isLazy",value:function(){return this.props.virtualScrollerOptions&&this.props.virtualScrollerOptions.lazy}},{key:"getVisibleOptions",value:function(){if(this.hasFilter()&&!this.isLazy()){var e=this.state.filter.trim().toLocaleLowerCase(this.props.filterLocale),t=this.props.filterBy?this.props.filterBy.split(","):[this.props.optionLabel||"label"];if(this.props.optionGroupLabel){var n,i=[],r=V(this.props.options);try{for(r.s();!(n=r.n()).done;){var o=n.value,s=l.FilterService.filter(this.getOptionGroupChildren(o),t,e,this.props.filterMatchMode,this.props.filterLocale);s&&s.length&&i.push(D(D({},o),{items:s}))}}catch(e){r.e(e)}finally{r.f()}return i}return l.FilterService.filter(this.props.options,t,e,this.props.filterMatchMode,this.props.filterLocale)}return this.props.options}},{key:"updateInputField",value:function(){if(this.props.editable&&this.input){var e=this.getSelectedOption(),t=e?this.getOptionLabel(e):null;this.input.value=t||this.props.value||""}}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.props.autoFocus&&this.focusInput&&this.focusInput.focus(),this.props.tooltip&&this.renderTooltip(),this.updateInputField(),this.inputRef.current&&(this.inputRef.current.selectedIndex=1)}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),t.ZIndexUtils.clear(this.overlayRef.current)}},{key:"componentDidUpdate",value:function(e){this.state.overlayVisible&&(this.props.filter&&this.alignOverlay(),e.value!==this.props.value&&this.scrollInView()),e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(D({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),!this.state.filter||this.props.options&&0!==this.props.options.length||this.setState({filter:""}),this.updateInputField(),this.inputRef.current&&(this.inputRef.current.selectedIndex=1)}},{key:"renderHiddenSelect",value:function(e){var t=u.default.createElement("option",{value:""},this.props.placeholder),n=e?u.default.createElement("option",{value:e.value},this.getOptionLabel(e)):null;return u.default.createElement("div",{className:"p-hidden-accessible p-dropdown-hidden-select"},u.default.createElement("select",{ref:this.inputRef,required:this.props.required,name:this.props.name,tabIndex:-1,"aria-hidden":"true"},t,n))}},{key:"renderTooltip",value:function(){this.tooltip=s.tip({target:this.container,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"renderKeyboardHelper",value:function(){var e=this;return u.default.createElement("div",{className:"p-hidden-accessible"},u.default.createElement("input",{ref:function(t){return e.focusInput=t},id:this.props.inputId,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:this.onInputFocus,onBlur:this.onInputBlur,onKeyDown:this.onInputKeyDown,disabled:this.props.disabled,tabIndex:this.props.tabIndex,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy}))}},{key:"renderLabel",value:function(e){var n=this,i=t.ObjectUtils.isNotEmpty(e)?this.getOptionLabel(e):null;if(this.props.editable)return u.default.createElement("input",{ref:function(e){return n.input=e},type:"text",defaultValue:i||this.props.value||"",className:"p-dropdown-label p-inputtext",disabled:this.props.disabled,placeholder:this.props.placeholder,maxLength:this.props.maxLength,onInput:this.onEditableInputChange,onFocus:this.onEditableInputFocus,onBlur:this.onInputBlur,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-haspopup":"listbox"});var r=t.classNames("p-dropdown-label p-inputtext",{"p-placeholder":null===i&&this.props.placeholder,"p-dropdown-label-empty":null===i&&!this.props.placeholder}),o=this.props.valueTemplate?t.ObjectUtils.getJSXElement(this.props.valueTemplate,e,this.props):i||this.props.placeholder||"empty";return u.default.createElement("span",{ref:function(e){return n.input=e},className:r},o)}},{key:"renderClearIcon",value:function(){return null!=this.props.value&&this.props.showClear&&!this.props.disabled?u.default.createElement("i",{className:"p-dropdown-clear-icon pi pi-times",onClick:this.clear}):null}},{key:"renderDropdownIcon",value:function(){var e=this,n=t.classNames("p-dropdown-trigger-icon p-clickable",this.props.dropdownIcon);return u.default.createElement("div",{ref:function(t){return e.trigger=t},className:"p-dropdown-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":this.state.overlayVisible},u.default.createElement("span",{className:n}))}},{key:"render",value:function(){var e=this,n=t.classNames("p-dropdown p-component p-inputwrapper",this.props.className,{"p-disabled":this.props.disabled,"p-focus":this.state.focused,"p-dropdown-clearable":this.props.showClear&&!this.props.disabled,"p-inputwrapper-filled":this.props.value,"p-inputwrapper-focus":this.state.focused||this.state.overlayVisible}),i=this.getVisibleOptions(),r=this.getSelectedOption(),o=this.props.appendTo||c.default.appendTo,l=this.renderHiddenSelect(r),s=this.renderKeyboardHelper(),a=this.renderLabel(r),p=this.renderDropdownIcon(),d=this.renderClearIcon();return u.default.createElement("div",{id:this.props.id,ref:function(t){return e.container=t},className:n,style:this.props.style,onClick:this.onClick,onMouseDown:this.props.onMouseDown,onContextMenu:this.props.onContextMenu},s,l,a,d,p,u.default.createElement(R,h({ref:this.overlayRef,visibleOptions:i},this.props,{appendTo:o,onClick:this.onPanelClick,onOptionClick:this.onOptionClick,filterValue:this.state.filter,hasFilter:this.hasFilter,onFilterClearIconClick:this.onFilterClearIconClick,onFilterInputKeyDown:this.onFilterInputKeyDown,onFilterInputChange:this.onFilterInputChange,getOptionLabel:this.getOptionLabel,getOptionRenderKey:this.getOptionRenderKey,isOptionDisabled:this.isOptionDisabled,getOptionGroupChildren:this.getOptionGroupChildren,getOptionGroupLabel:this.getOptionGroupLabel,getOptionGroupRenderKey:this.getOptionGroupRenderKey,isSelected:this.isSelected,getSelectedOptionIndex:this.getSelectedOptionIndex,in:this.state.overlayVisible,onEnter:this.onOverlayEnter,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited})))}}]),p}();C(G,"defaultProps",{id:null,inputRef:null,name:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,optionGroupTemplate:null,valueTemplate:null,itemTemplate:null,style:null,className:null,virtualScrollerOptions:null,scrollHeight:"200px",filter:!1,filterBy:null,filterMatchMode:"contains",filterPlaceholder:null,filterLocale:void 0,emptyMessage:null,emptyFilterMessage:null,editable:!1,placeholder:null,required:!1,disabled:!1,appendTo:null,tabIndex:null,autoFocus:!1,filterInputAutoFocus:!0,resetFilterOnHide:!1,showFilterClear:!1,panelClassName:null,panelStyle:null,dataKey:null,inputId:null,showClear:!1,maxLength:null,tooltip:null,tooltipOptions:null,ariaLabel:null,ariaLabelledBy:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",showOnFocus:!1,onChange:null,onFocus:null,onBlur:null,onMouseDown:null,onContextMenu:null,onShow:null,onHide:null,onFilter:null}),exports.Dropdown=G;
|
package/dropdown/dropdown.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import TooltipOptions from '../tooltip/tooltipoptions';
|
|
3
|
+
import { CSSTransitionProps } from '../csstransition';
|
|
3
4
|
import { VirtualScrollerProps } from '../virtualscroller';
|
|
4
5
|
|
|
5
6
|
type DropdownOptionGroupTemplateType = React.ReactNode | ((option: any, index: number) => React.ReactNode);
|
|
@@ -80,7 +81,7 @@ export interface DropdownProps {
|
|
|
80
81
|
tooltipOptions?: TooltipOptions;
|
|
81
82
|
ariaLabel?: string;
|
|
82
83
|
ariaLabelledBy?: string;
|
|
83
|
-
transitionOptions?:
|
|
84
|
+
transitionOptions?: CSSTransitionProps;
|
|
84
85
|
dropdownIcon?: string;
|
|
85
86
|
showOnFocus?: boolean;
|
|
86
87
|
onChange?(e: DropdownChangeParams): void;
|
package/dropdown/dropdown.esm.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import React, { Component, createRef } from 'react';
|
|
2
|
-
import { classNames, ObjectUtils,
|
|
2
|
+
import { classNames, ObjectUtils, DomHandler, ZIndexUtils, ConnectedOverlayScrollHandler } from 'primereact/utils';
|
|
3
|
+
import { Ripple } from 'primereact/ripple';
|
|
4
|
+
import { CSSTransition } from 'primereact/csstransition';
|
|
5
|
+
import { Portal } from 'primereact/portal';
|
|
3
6
|
import { VirtualScroller } from 'primereact/virtualscroller';
|
|
4
|
-
import PrimeReact, { FilterService } from 'primereact/api';
|
|
7
|
+
import PrimeReact, { localeOption, FilterService } from 'primereact/api';
|
|
8
|
+
import { tip } from 'primereact/tooltip';
|
|
9
|
+
import { OverlayService } from 'primereact/overlayservice';
|
|
5
10
|
|
|
6
11
|
function _extends() {
|
|
7
12
|
_extends = Object.assign || function (target) {
|
|
@@ -274,8 +279,8 @@ var DropdownPanelComponent = /*#__PURE__*/function (_Component) {
|
|
|
274
279
|
}
|
|
275
280
|
}, {
|
|
276
281
|
key: "renderEmptyMessage",
|
|
277
|
-
value: function renderEmptyMessage(emptyMessage) {
|
|
278
|
-
var message = ObjectUtils.getJSXElement(emptyMessage, this.props);
|
|
282
|
+
value: function renderEmptyMessage(emptyMessage, isFilter) {
|
|
283
|
+
var message = ObjectUtils.getJSXElement(emptyMessage, this.props) || localeOption(isFilter ? 'emptyFilterMessage' : 'emptyMessage');
|
|
279
284
|
return /*#__PURE__*/React.createElement("li", {
|
|
280
285
|
className: "p-dropdown-empty-message"
|
|
281
286
|
}, message);
|
|
@@ -317,7 +322,7 @@ var DropdownPanelComponent = /*#__PURE__*/function (_Component) {
|
|
|
317
322
|
return _this5.renderItem(option, index);
|
|
318
323
|
});
|
|
319
324
|
} else if (this.props.hasFilter()) {
|
|
320
|
-
return this.renderEmptyMessage(this.props.emptyFilterMessage);
|
|
325
|
+
return this.renderEmptyMessage(this.props.emptyFilterMessage, true);
|
|
321
326
|
}
|
|
322
327
|
|
|
323
328
|
return this.renderEmptyMessage(this.props.emptyMessage);
|
|
@@ -1045,17 +1050,17 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
1045
1050
|
}, {
|
|
1046
1051
|
key: "onOverlayEnter",
|
|
1047
1052
|
value: function onOverlayEnter(callback) {
|
|
1048
|
-
ZIndexUtils.set('overlay', this.overlayRef.current);
|
|
1053
|
+
ZIndexUtils.set('overlay', this.overlayRef.current, PrimeReact.autoZIndex, PrimeReact.zIndex['overlay']);
|
|
1049
1054
|
this.alignOverlay();
|
|
1050
1055
|
callback && callback();
|
|
1051
1056
|
}
|
|
1052
1057
|
}, {
|
|
1053
1058
|
key: "onOverlayEntered",
|
|
1054
1059
|
value: function onOverlayEntered(callback) {
|
|
1060
|
+
callback && callback();
|
|
1055
1061
|
this.bindDocumentClickListener();
|
|
1056
1062
|
this.bindScrollListener();
|
|
1057
1063
|
this.bindResizeListener();
|
|
1058
|
-
callback && callback();
|
|
1059
1064
|
this.props.onShow && this.props.onShow();
|
|
1060
1065
|
}
|
|
1061
1066
|
}, {
|
|
@@ -1168,7 +1173,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
1168
1173
|
}, {
|
|
1169
1174
|
key: "isClearClicked",
|
|
1170
1175
|
value: function isClearClicked(event) {
|
|
1171
|
-
return DomHandler.hasClass(event.target, 'p-dropdown-clear-icon');
|
|
1176
|
+
return DomHandler.hasClass(event.target, 'p-dropdown-clear-icon') || DomHandler.hasClass(event.target, 'p-dropdown-filter-clear-icon');
|
|
1172
1177
|
}
|
|
1173
1178
|
}, {
|
|
1174
1179
|
key: "updateEditableLabel",
|
|
@@ -1224,12 +1229,21 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
1224
1229
|
}, {
|
|
1225
1230
|
key: "checkValidity",
|
|
1226
1231
|
value: function checkValidity() {
|
|
1227
|
-
|
|
1232
|
+
if (this.inputRef.current) {
|
|
1233
|
+
return this.inputRef.current.checkValidity();
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
return false;
|
|
1237
|
+
}
|
|
1238
|
+
}, {
|
|
1239
|
+
key: "isLazy",
|
|
1240
|
+
value: function isLazy() {
|
|
1241
|
+
return this.props.virtualScrollerOptions && this.props.virtualScrollerOptions.lazy;
|
|
1228
1242
|
}
|
|
1229
1243
|
}, {
|
|
1230
1244
|
key: "getVisibleOptions",
|
|
1231
1245
|
value: function getVisibleOptions() {
|
|
1232
|
-
if (this.hasFilter()) {
|
|
1246
|
+
if (this.hasFilter() && !this.isLazy()) {
|
|
1233
1247
|
var filterValue = this.state.filter.trim().toLocaleLowerCase(this.props.filterLocale);
|
|
1234
1248
|
var searchFields = this.props.filterBy ? this.props.filterBy.split(',') : [this.props.optionLabel || 'label'];
|
|
1235
1249
|
|
|
@@ -1301,7 +1315,10 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
1301
1315
|
}
|
|
1302
1316
|
|
|
1303
1317
|
this.updateInputField();
|
|
1304
|
-
|
|
1318
|
+
|
|
1319
|
+
if (this.inputRef.current) {
|
|
1320
|
+
this.inputRef.current.selectedIndex = 1;
|
|
1321
|
+
}
|
|
1305
1322
|
}
|
|
1306
1323
|
}, {
|
|
1307
1324
|
key: "componentWillUnmount",
|
|
@@ -1352,7 +1369,10 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
1352
1369
|
}
|
|
1353
1370
|
|
|
1354
1371
|
this.updateInputField();
|
|
1355
|
-
|
|
1372
|
+
|
|
1373
|
+
if (this.inputRef.current) {
|
|
1374
|
+
this.inputRef.current.selectedIndex = 1;
|
|
1375
|
+
}
|
|
1356
1376
|
}
|
|
1357
1377
|
}, {
|
|
1358
1378
|
key: "renderHiddenSelect",
|
|
@@ -1411,7 +1431,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
1411
1431
|
value: function renderLabel(selectedOption) {
|
|
1412
1432
|
var _this12 = this;
|
|
1413
1433
|
|
|
1414
|
-
var label = selectedOption ? this.getOptionLabel(selectedOption) : null;
|
|
1434
|
+
var label = ObjectUtils.isNotEmpty(selectedOption) ? this.getOptionLabel(selectedOption) : null;
|
|
1415
1435
|
|
|
1416
1436
|
if (this.props.editable) {
|
|
1417
1437
|
var value = label || this.props.value || '';
|
|
@@ -1490,6 +1510,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
1490
1510
|
});
|
|
1491
1511
|
var visibleOptions = this.getVisibleOptions();
|
|
1492
1512
|
var selectedOption = this.getSelectedOption();
|
|
1513
|
+
var appendTo = this.props.appendTo || PrimeReact.appendTo;
|
|
1493
1514
|
var hiddenSelect = this.renderHiddenSelect(selectedOption);
|
|
1494
1515
|
var keyboardHelper = this.renderKeyboardHelper();
|
|
1495
1516
|
var labelElement = this.renderLabel(selectedOption);
|
|
@@ -1509,6 +1530,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
1509
1530
|
ref: this.overlayRef,
|
|
1510
1531
|
visibleOptions: visibleOptions
|
|
1511
1532
|
}, this.props, {
|
|
1533
|
+
appendTo: appendTo,
|
|
1512
1534
|
onClick: this.onPanelClick,
|
|
1513
1535
|
onOptionClick: this.onOptionClick,
|
|
1514
1536
|
filterValue: this.state.filter,
|
|
@@ -1559,8 +1581,8 @@ _defineProperty(Dropdown, "defaultProps", {
|
|
|
1559
1581
|
filterMatchMode: 'contains',
|
|
1560
1582
|
filterPlaceholder: null,
|
|
1561
1583
|
filterLocale: undefined,
|
|
1562
|
-
emptyMessage:
|
|
1563
|
-
emptyFilterMessage:
|
|
1584
|
+
emptyMessage: null,
|
|
1585
|
+
emptyFilterMessage: null,
|
|
1564
1586
|
editable: false,
|
|
1565
1587
|
placeholder: null,
|
|
1566
1588
|
required: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{Component as t,createRef as n}from"react";import{classNames as i,ObjectUtils as r,Ripple as o,CSSTransition as s,Portal as l,DomHandler as p,OverlayService as a,ZIndexUtils as u,ConnectedOverlayScrollHandler as c,tip as h}from"primereact/core";import{VirtualScroller as d}from"primereact/virtualscroller";import f,{FilterService as v}from"primereact/api";function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t,n){return t&&O(e.prototype,t),n&&O(e,n),e}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&k(e,t)}function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(t&&("object"===I(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var S=function(n){C(a,t);var s,l,p=(s=a,l=F(),function(){var e,t=w(s);if(l){var n=w(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return E(this,e)});function a(e){var t;return b(this,a),(t=p.call(this,e)).onClick=t.onClick.bind(g(t)),t}return m(a,[{key:"onClick",value:function(e){this.props.onClick&&this.props.onClick({originalEvent:e,option:this.props.option})}},{key:"render",value:function(){var t=i("p-dropdown-item",{"p-highlight":this.props.selected,"p-disabled":this.props.disabled,"p-dropdown-item-empty":!this.props.label||0===this.props.label.length},this.props.option.className),n=this.props.template?r.getJSXElement(this.props.template,this.props.option):this.props.label;return e.createElement("li",{className:t,onClick:this.onClick,"aria-label":this.props.label,key:this.props.label,role:"option","aria-selected":this.props.selected},n,e.createElement(o,null))}}]),a}();function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}L(S,"defaultProps",{option:null,label:null,template:null,selected:!1,disabled:!1,onClick:null});var V=function(n){C(u,t);var o,p,a=(o=u,p=D(),function(){var e,t=w(o);if(p){var n=w(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return E(this,e)});function u(e){var t;return b(this,u),(t=a.call(this,e)).onEnter=t.onEnter.bind(g(t)),t.onEntered=t.onEntered.bind(g(t)),t.onFilterInputChange=t.onFilterInputChange.bind(g(t)),t}return m(u,[{key:"onEnter",value:function(){var e=this;this.props.onEnter((function(){if(e.virtualScrollerRef){var t=e.props.getSelectedOptionIndex();-1!==t&&e.virtualScrollerRef.scrollToIndex(t)}}))}},{key:"onEntered",value:function(){var e=this;this.props.onEntered((function(){e.props.filter&&e.props.filterInputAutoFocus&&e.filterInput.focus()}))}},{key:"onFilterInputChange",value:function(e){this.virtualScrollerRef&&this.virtualScrollerRef.scrollToIndex(0),this.props.onFilterInputChange&&this.props.onFilterInputChange(e)}},{key:"isEmptyFilter",value:function(){return!(this.props.visibleOptions&&this.props.visibleOptions.length)&&this.props.hasFilter()}},{key:"renderGroupChildren",value:function(t){var n=this;return this.props.getOptionGroupChildren(t).map((function(t,i){var r=n.props.getOptionLabel(t),o=i+"_"+n.props.getOptionRenderKey(t),s=n.props.isOptionDisabled(t);return e.createElement(S,{key:o,label:r,option:t,template:n.props.itemTemplate,selected:n.props.isSelected(t),disabled:s,onClick:n.props.onOptionClick})}))}},{key:"renderEmptyMessage",value:function(t){var n=r.getJSXElement(t,this.props);return e.createElement("li",{className:"p-dropdown-empty-message"},n)}},{key:"renderItem",value:function(t,n){if(this.props.optionGroupLabel){var i=this.props.optionGroupTemplate?r.getJSXElement(this.props.optionGroupTemplate,t,n):this.props.getOptionGroupLabel(t),o=this.renderGroupChildren(t),s=n+"_"+this.props.getOptionGroupRenderKey(t);return e.createElement(e.Fragment,{key:s},e.createElement("li",{className:"p-dropdown-item-group"},i),o)}var l=this.props.getOptionLabel(t),p=n+"_"+this.props.getOptionRenderKey(t),a=this.props.isOptionDisabled(t);return e.createElement(S,{key:p,label:l,option:t,template:this.props.itemTemplate,selected:this.props.isSelected(t),disabled:a,onClick:this.props.onOptionClick})}},{key:"renderItems",value:function(){var e=this;return this.props.visibleOptions&&this.props.visibleOptions.length?this.props.visibleOptions.map((function(t,n){return e.renderItem(t,n)})):this.props.hasFilter()?this.renderEmptyMessage(this.props.emptyFilterMessage):this.renderEmptyMessage(this.props.emptyMessage)}},{key:"renderFilterClearIcon",value:function(){var t=this;return this.props.showFilterClear&&this.props.filterValue?e.createElement("i",{className:"p-dropdown-filter-clear-icon pi pi-times",onClick:function(){return t.props.onFilterClearIconClick((function(){return t.filterInput.focus()}))}}):null}},{key:"renderFilter",value:function(){var t=this;if(this.props.filter){var n=this.renderFilterClearIcon(),r=i("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!n});return e.createElement("div",{className:"p-dropdown-header"},e.createElement("div",{className:r},e.createElement("input",{ref:function(e){return t.filterInput=e},type:"text",autoComplete:"off",className:"p-dropdown-filter p-inputtext p-component",placeholder:this.props.filterPlaceholder,onKeyDown:this.props.onFilterInputKeyDown,onChange:this.onFilterInputChange,value:this.props.filterValue}),n,e.createElement("i",{className:"p-dropdown-filter-icon pi pi-search"})))}return null}},{key:"renderContent",value:function(){var t=this;if(this.props.virtualScrollerOptions){var n=x(x({},this.props.virtualScrollerOptions),{style:x(x({},this.props.virtualScrollerOptions.style),{height:this.props.scrollHeight}),className:i("p-dropdown-items-wrapper",this.props.virtualScrollerOptions.className),items:this.props.visibleOptions,onLazyLoad:function(e){return t.props.virtualScrollerOptions.onLazyLoad(x(x({},e),{filter:t.props.filterValue}))},itemTemplate:function(e,n){return e&&t.renderItem(e,n.index)},contentTemplate:function(n){var r=i("p-dropdown-items",n.className),o=t.isEmptyFilter()?t.renderEmptyMessage():n.children;return e.createElement("ul",{ref:n.contentRef,className:r,role:"listbox"},o)}});return e.createElement(d,y({ref:function(e){return t.virtualScrollerRef=e}},n))}var r=this.renderItems();return e.createElement("div",{className:"p-dropdown-items-wrapper",style:{maxHeight:this.props.scrollHeight||"auto"}},e.createElement("ul",{className:"p-dropdown-items",role:"listbox"},r))}},{key:"renderElement",value:function(){var t=i("p-dropdown-panel p-component",this.props.panelClassName),n=this.renderFilter(),r=this.renderContent();return e.createElement(s,{nodeRef:this.props.forwardRef,classNames:"p-connected-overlay",in:this.props.in,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntering:this.props.onEntering,onEntered:this.onEntered,onExit:this.props.onExit,onExited:this.props.onExited},e.createElement("div",{ref:this.props.forwardRef,className:t,style:this.props.panelStyle,onClick:this.props.onClick},n,r))}},{key:"render",value:function(){var t=this.renderElement();return e.createElement(l,{element:t,appendTo:this.props.appendTo})}}]),u}(),G=e.forwardRef((function(t,n){return e.createElement(V,y({forwardRef:n},t))}));function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function N(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=j(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}function j(e,t){if(e){if("string"==typeof e)return T(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)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function B(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var M=function(o){C(O,t);var s,l,d=(s=O,l=B(),function(){var e,t=w(s);if(l){var n=w(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return E(this,e)});function O(e){var t;return b(this,O),(t=d.call(this,e)).state={filter:"",focused:!1,overlayVisible:!1},t.onClick=t.onClick.bind(g(t)),t.onInputFocus=t.onInputFocus.bind(g(t)),t.onInputBlur=t.onInputBlur.bind(g(t)),t.onInputKeyDown=t.onInputKeyDown.bind(g(t)),t.onEditableInputChange=t.onEditableInputChange.bind(g(t)),t.onEditableInputFocus=t.onEditableInputFocus.bind(g(t)),t.onOptionClick=t.onOptionClick.bind(g(t)),t.onFilterInputChange=t.onFilterInputChange.bind(g(t)),t.onFilterInputKeyDown=t.onFilterInputKeyDown.bind(g(t)),t.onFilterClearIconClick=t.onFilterClearIconClick.bind(g(t)),t.onPanelClick=t.onPanelClick.bind(g(t)),t.onOverlayEnter=t.onOverlayEnter.bind(g(t)),t.onOverlayEntered=t.onOverlayEntered.bind(g(t)),t.onOverlayExit=t.onOverlayExit.bind(g(t)),t.onOverlayExited=t.onOverlayExited.bind(g(t)),t.resetFilter=t.resetFilter.bind(g(t)),t.clear=t.clear.bind(g(t)),t.hasFilter=t.hasFilter.bind(g(t)),t.getOptionLabel=t.getOptionLabel.bind(g(t)),t.getOptionRenderKey=t.getOptionRenderKey.bind(g(t)),t.isOptionDisabled=t.isOptionDisabled.bind(g(t)),t.getOptionGroupChildren=t.getOptionGroupChildren.bind(g(t)),t.getOptionGroupLabel=t.getOptionGroupLabel.bind(g(t)),t.getOptionGroupRenderKey=t.getOptionGroupRenderKey.bind(g(t)),t.getSelectedOptionIndex=t.getSelectedOptionIndex.bind(g(t)),t.isSelected=t.isSelected.bind(g(t)),t.overlayRef=n(),t.inputRef=n(t.props.inputRef),t}return m(O,[{key:"onClick",value:function(e){this.props.disabled||p.hasClass(e.target,"p-dropdown-clear-icon")||"INPUT"===e.target.tagName||this.overlayRef.current&&this.overlayRef.current&&this.overlayRef.current.contains(e.target)||(this.focusInput.focus(),this.state.overlayVisible?this.hideOverlay():this.showOverlay())}},{key:"onInputFocus",value:function(e){var t=this;e.persist(),this.props.showOnFocus&&!this.state.overlayVisible&&this.showOverlay(),this.setState({focused:!0},(function(){t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onInputBlur",value:function(e){var t=this;e.persist(),this.setState({focused:!1},(function(){t.props.onBlur&&t.props.onBlur(e)}))}},{key:"onPanelClick",value:function(e){a.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:this.onDownKey(e);break;case 38:this.onUpKey(e);break;case 32:this.state.overlayVisible?this.hideOverlay():this.showOverlay(),e.preventDefault();break;case 13:this.hideOverlay(),e.preventDefault();break;case 27:case 9:this.hideOverlay();break;default:this.search(e)}}},{key:"onFilterInputKeyDown",value:function(e){switch(e.which){case 40:this.onDownKey(e);break;case 38:this.onUpKey(e);break;case 13:case 27:this.hideOverlay(),e.preventDefault()}}},{key:"onUpKey",value:function(e){if(this.getVisibleOptions()){var t=this.findPrevOption(this.getSelectedOptionIndex());t&&this.selectItem({originalEvent:e,option:t})}e.preventDefault()}},{key:"onDownKey",value:function(e){if(this.getVisibleOptions())if(!this.state.overlayVisible&&e.altKey)this.showOverlay();else{var t=this.findNextOption(this.getSelectedOptionIndex());t&&this.selectItem({originalEvent:e,option:t})}e.preventDefault()}},{key:"findNextOption",value:function(e){var t=this.getVisibleOptions();if(this.props.optionGroupLabel){var n=-1===e?0:e.group,i=-1===e?-1:e.option,r=this.findNextOptionInList(this.getOptionGroupChildren(t[n]),i);return r||(n+1!==t.length?this.findNextOption({group:n+1,option:-1}):null)}return this.findNextOptionInList(t,e)}},{key:"findNextOptionInList",value:function(e,t){var n=t+1;if(n===e.length)return null;var i=e[n];return this.isOptionDisabled(i)?this.findNextOptionInList(n):i}},{key:"findPrevOption",value:function(e){if(-1===e)return null;var t=this.getVisibleOptions();if(this.props.optionGroupLabel){var n=e.group,i=e.option,r=this.findPrevOptionInList(this.getOptionGroupChildren(t[n]),i);return r||(n>0?this.findPrevOption({group:n-1,option:this.getOptionGroupChildren(t[n-1]).length}):null)}return this.findPrevOptionInList(t,e)}},{key:"findPrevOptionInList",value:function(e,t){var n=t-1;if(n<0)return null;var i=e[n];return this.isOptionDisabled(i)?this.findPrevOption(n):i}},{key:"search",value:function(e){var t=this;this.searchTimeout&&clearTimeout(this.searchTimeout);var n=e.key;if(this.previousSearchChar=this.currentSearchChar,this.currentSearchChar=n,this.searchValue=this.previousSearchChar===this.currentSearchChar?this.currentSearchChar:this.searchValue?this.searchValue+n:n,this.searchValue){var i=this.getSelectedOptionIndex(),r=this.props.optionGroupLabel?this.searchOptionInGroup(i):this.searchOption(++i);r&&(this.selectItem({originalEvent:e,option:r}),this.selectedOptionUpdated=!0)}this.searchTimeout=setTimeout((function(){t.searchValue=null}),250)}},{key:"searchOption",value:function(e){var t;if(this.searchValue){var n=this.getVisibleOptions();(t=this.searchOptionInRange(e,n.length))||(t=this.searchOptionInRange(0,e))}return t}},{key:"searchOptionInRange",value:function(e,t){for(var n=this.getVisibleOptions(),i=e;i<t;i++){var r=n[i];if(this.matchesSearchValue(r))return r}return null}},{key:"searchOptionInGroup",value:function(e){for(var t=-1===e?{group:0,option:-1}:e,n=this.getVisibleOptions(),i=t.group;i<n.length;i++)for(var r=this.getOptionGroupChildren(n[i]),o=t.group===i?t.option+1:0;o<r.length;o++)if(this.matchesSearchValue(r[o]))return r[o];for(var s=0;s<=t.group;s++)for(var l=this.getOptionGroupChildren(n[s]),p=0;p<(t.group===s?t.option:l.length);p++)if(this.matchesSearchValue(l[p]))return l[p];return null}},{key:"matchesSearchValue",value:function(e){return this.getOptionLabel(e).toLocaleLowerCase(this.props.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.props.filterLocale))}},{key:"onEditableInputChange",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,value:e.target.value,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:e.target.value}})}},{key:"onEditableInputFocus",value:function(e){var t=this;e.persist(),this.setState({focused:!0},(function(){t.hideOverlay(),t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onOptionClick",value:function(e){e.option.disabled||(this.selectItem(e),this.focusInput.focus()),this.hideOverlay()}},{key:"onFilterInputChange",value:function(e){var t=this,n=e.target.value;this.setState({filter:n},(function(){t.props.onFilter&&t.props.onFilter({originalEvent:e,filter:n})}))}},{key:"onFilterClearIconClick",value:function(e){this.resetFilter(e)}},{key:"resetFilter",value:function(e){var t=this;this.setState({filter:""},(function(){t.props.onFilter&&t.props.onFilter({filter:""}),e&&e()}))}},{key:"clear",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e,value:void 0,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:void 0}}),this.updateEditableLabel()}},{key:"selectItem",value:function(e){if(this.getSelectedOption()!==e.option){this.updateEditableLabel(e.option);var t=this.getOptionValue(e.option);this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:t}})}}},{key:"getSelectedOption",value:function(){var e=this.getSelectedOptionIndex(),t=this.getVisibleOptions();return-1!==e?this.props.optionGroupLabel?this.getOptionGroupChildren(t[e.group])[e.option]:t[e]:null}},{key:"getSelectedOptionIndex",value:function(){var e=this.getVisibleOptions();if(null!=this.props.value&&e){if(!this.props.optionGroupLabel)return this.findOptionIndexInList(this.props.value,e);for(var t=0;t<e.length;t++){var n=this.findOptionIndexInList(this.props.value,this.getOptionGroupChildren(e[t]));if(-1!==n)return{group:t,option:n}}}return-1}},{key:"findOptionIndexInList",value:function(e,t){for(var n=this.equalityKey(),i=0;i<t.length;i++)if(r.equals(e,this.getOptionValue(t[i]),n))return i;return-1}},{key:"isSelected",value:function(e){return r.equals(this.props.value,this.getOptionValue(e),this.equalityKey())}},{key:"equalityKey",value:function(){return this.props.optionValue?null:this.props.dataKey}},{key:"showOverlay",value:function(){this.setState({overlayVisible:!0})}},{key:"hideOverlay",value:function(){this.setState({overlayVisible:!1})}},{key:"onOverlayEnter",value:function(e){u.set("overlay",this.overlayRef.current),this.alignOverlay(),e&&e()}},{key:"onOverlayEntered",value:function(e){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),e&&e(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onOverlayExited",value:function(){this.props.filter&&this.props.resetFilterOnHide&&this.resetFilter(),u.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){p.alignOverlay(this.overlayRef.current,this.input.parentElement,this.props.appendTo||f.appendTo)}},{key:"scrollInView",value:function(){var e=p.findSingle(this.overlayRef.current,"li.p-highlight");e&&e.scrollIntoView({block:"nearest",inline:"start"})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hideOverlay()},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new c(this.container,(function(){e.state.overlayVisible&&e.hideOverlay()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.overlayVisible&&!p.isTouchDevice()&&e.hideOverlay()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.isClearClicked(e)||this.container.contains(e.target)||this.overlayRef&&this.overlayRef.current.contains(e.target))}},{key:"isClearClicked",value:function(e){return p.hasClass(e.target,"p-dropdown-clear-icon")}},{key:"updateEditableLabel",value:function(e){this.input&&(this.input.value=e?this.getOptionLabel(e):this.props.value||"")}},{key:"hasFilter",value:function(){return this.state.filter&&this.state.filter.trim().length>0}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?r.resolveFieldData(e,this.props.optionLabel):e&&void 0!==e.label?e.label:e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?r.resolveFieldData(e,this.props.optionValue):e&&void 0!==e.value?e.value:e}},{key:"getOptionRenderKey",value:function(e){return this.props.dataKey?r.resolveFieldData(e,this.props.dataKey):this.getOptionLabel(e)}},{key:"isOptionDisabled",value:function(e){return this.props.optionDisabled?r.isFunction(this.props.optionDisabled)?this.props.optionDisabled(e):r.resolveFieldData(e,this.props.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled}},{key:"getOptionGroupRenderKey",value:function(e){return r.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupLabel",value:function(e){return r.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupChildren",value:function(e){return r.resolveFieldData(e,this.props.optionGroupChildren)}},{key:"checkValidity",value:function(){return this.inputRef.current.checkValidity()}},{key:"getVisibleOptions",value:function(){if(this.hasFilter()){var e=this.state.filter.trim().toLocaleLowerCase(this.props.filterLocale),t=this.props.filterBy?this.props.filterBy.split(","):[this.props.optionLabel||"label"];if(this.props.optionGroupLabel){var n,i=[],r=N(this.props.options);try{for(r.s();!(n=r.n()).done;){var o=n.value,s=v.filter(this.getOptionGroupChildren(o),t,e,this.props.filterMatchMode,this.props.filterLocale);s&&s.length&&i.push(K(K({},o),{items:s}))}}catch(e){r.e(e)}finally{r.f()}return i}return v.filter(this.props.options,t,e,this.props.filterMatchMode,this.props.filterLocale)}return this.props.options}},{key:"updateInputField",value:function(){if(this.props.editable&&this.input){var e=this.getSelectedOption(),t=e?this.getOptionLabel(e):null;this.input.value=t||this.props.value||""}}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.props.autoFocus&&this.focusInput&&this.focusInput.focus(),this.props.tooltip&&this.renderTooltip(),this.updateInputField(),this.inputRef.current.selectedIndex=1}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),u.clear(this.overlayRef.current)}},{key:"componentDidUpdate",value:function(e){this.state.overlayVisible&&(this.props.filter&&this.alignOverlay(),e.value!==this.props.value&&this.scrollInView()),e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(K({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),!this.state.filter||this.props.options&&0!==this.props.options.length||this.setState({filter:""}),this.updateInputField(),this.inputRef.current.selectedIndex=1}},{key:"renderHiddenSelect",value:function(t){var n=e.createElement("option",{value:""},this.props.placeholder),i=t?e.createElement("option",{value:t.value},this.getOptionLabel(t)):null;return e.createElement("div",{className:"p-hidden-accessible p-dropdown-hidden-select"},e.createElement("select",{ref:this.inputRef,required:this.props.required,name:this.props.name,tabIndex:-1,"aria-hidden":"true"},n,i))}},{key:"renderTooltip",value:function(){this.tooltip=h({target:this.container,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"renderKeyboardHelper",value:function(){var t=this;return e.createElement("div",{className:"p-hidden-accessible"},e.createElement("input",{ref:function(e){return t.focusInput=e},id:this.props.inputId,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:this.onInputFocus,onBlur:this.onInputBlur,onKeyDown:this.onInputKeyDown,disabled:this.props.disabled,tabIndex:this.props.tabIndex,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy}))}},{key:"renderLabel",value:function(t){var n=this,o=t?this.getOptionLabel(t):null;if(this.props.editable)return e.createElement("input",{ref:function(e){return n.input=e},type:"text",defaultValue:o||this.props.value||"",className:"p-dropdown-label p-inputtext",disabled:this.props.disabled,placeholder:this.props.placeholder,maxLength:this.props.maxLength,onInput:this.onEditableInputChange,onFocus:this.onEditableInputFocus,onBlur:this.onInputBlur,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-haspopup":"listbox"});var s=i("p-dropdown-label p-inputtext",{"p-placeholder":null===o&&this.props.placeholder,"p-dropdown-label-empty":null===o&&!this.props.placeholder}),l=this.props.valueTemplate?r.getJSXElement(this.props.valueTemplate,t,this.props):o||this.props.placeholder||"empty";return e.createElement("span",{ref:function(e){return n.input=e},className:s},l)}},{key:"renderClearIcon",value:function(){return null!=this.props.value&&this.props.showClear&&!this.props.disabled?e.createElement("i",{className:"p-dropdown-clear-icon pi pi-times",onClick:this.clear}):null}},{key:"renderDropdownIcon",value:function(){var t=this,n=i("p-dropdown-trigger-icon p-clickable",this.props.dropdownIcon);return e.createElement("div",{ref:function(e){return t.trigger=e},className:"p-dropdown-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":this.state.overlayVisible},e.createElement("span",{className:n}))}},{key:"render",value:function(){var t=this,n=i("p-dropdown p-component p-inputwrapper",this.props.className,{"p-disabled":this.props.disabled,"p-focus":this.state.focused,"p-dropdown-clearable":this.props.showClear&&!this.props.disabled,"p-inputwrapper-filled":this.props.value,"p-inputwrapper-focus":this.state.focused||this.state.overlayVisible}),r=this.getVisibleOptions(),o=this.getSelectedOption(),s=this.renderHiddenSelect(o),l=this.renderKeyboardHelper(),p=this.renderLabel(o),a=this.renderDropdownIcon(),u=this.renderClearIcon();return e.createElement("div",{id:this.props.id,ref:function(e){return t.container=e},className:n,style:this.props.style,onClick:this.onClick,onMouseDown:this.props.onMouseDown,onContextMenu:this.props.onContextMenu},l,s,p,u,a,e.createElement(G,y({ref:this.overlayRef,visibleOptions:r},this.props,{onClick:this.onPanelClick,onOptionClick:this.onOptionClick,filterValue:this.state.filter,hasFilter:this.hasFilter,onFilterClearIconClick:this.onFilterClearIconClick,onFilterInputKeyDown:this.onFilterInputKeyDown,onFilterInputChange:this.onFilterInputChange,getOptionLabel:this.getOptionLabel,getOptionRenderKey:this.getOptionRenderKey,isOptionDisabled:this.isOptionDisabled,getOptionGroupChildren:this.getOptionGroupChildren,getOptionGroupLabel:this.getOptionGroupLabel,getOptionGroupRenderKey:this.getOptionGroupRenderKey,isSelected:this.isSelected,getSelectedOptionIndex:this.getSelectedOptionIndex,in:this.state.overlayVisible,onEnter:this.onOverlayEnter,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited})))}}]),O}();L(M,"defaultProps",{id:null,inputRef:null,name:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,optionGroupTemplate:null,valueTemplate:null,itemTemplate:null,style:null,className:null,virtualScrollerOptions:null,scrollHeight:"200px",filter:!1,filterBy:null,filterMatchMode:"contains",filterPlaceholder:null,filterLocale:void 0,emptyMessage:"No records found",emptyFilterMessage:"No results found",editable:!1,placeholder:null,required:!1,disabled:!1,appendTo:null,tabIndex:null,autoFocus:!1,filterInputAutoFocus:!0,resetFilterOnHide:!1,showFilterClear:!1,panelClassName:null,panelStyle:null,dataKey:null,inputId:null,showClear:!1,maxLength:null,tooltip:null,tooltipOptions:null,ariaLabel:null,ariaLabelledBy:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",showOnFocus:!1,onChange:null,onFocus:null,onBlur:null,onMouseDown:null,onContextMenu:null,onShow:null,onHide:null,onFilter:null});export{M as Dropdown};
|
|
1
|
+
import e,{Component as t,createRef as n}from"react";import{classNames as i,ObjectUtils as r,DomHandler as o,ZIndexUtils as s,ConnectedOverlayScrollHandler as l}from"primereact/utils";import{Ripple as p}from"primereact/ripple";import{CSSTransition as a}from"primereact/csstransition";import{Portal as u}from"primereact/portal";import{VirtualScroller as c}from"primereact/virtualscroller";import h,{localeOption as d,FilterService as f}from"primereact/api";import{tip as v}from"primereact/tooltip";import{OverlayService as y}from"primereact/overlayservice";function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},b.apply(this,arguments)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function g(e,t,n){return t&&O(e.prototype,t),n&&O(e,n),e}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e,t){return C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},C(e,t)}function I(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&C(e,t)}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function w(e,t){if(t&&("object"===E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return k(e)}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var R=function(n){I(a,t);var o,s,l=(o=a,s=S(),function(){var e,t=L(o);if(s){var n=L(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return w(this,e)});function a(e){var t;return m(this,a),(t=l.call(this,e)).onClick=t.onClick.bind(k(t)),t}return g(a,[{key:"onClick",value:function(e){this.props.onClick&&this.props.onClick({originalEvent:e,option:this.props.option})}},{key:"render",value:function(){var t=i("p-dropdown-item",{"p-highlight":this.props.selected,"p-disabled":this.props.disabled,"p-dropdown-item-empty":!this.props.label||0===this.props.label.length},this.props.option.className),n=this.props.template?r.getJSXElement(this.props.template,this.props.option):this.props.label;return e.createElement("li",{className:t,onClick:this.onClick,"aria-label":this.props.label,key:this.props.label,role:"option","aria-selected":this.props.selected},n,e.createElement(p,null))}}]),a}();function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function V(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}F(R,"defaultProps",{option:null,label:null,template:null,selected:!1,disabled:!1,onClick:null});var G=function(n){I(p,t);var o,s,l=(o=p,s=V(),function(){var e,t=L(o);if(s){var n=L(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return w(this,e)});function p(e){var t;return m(this,p),(t=l.call(this,e)).onEnter=t.onEnter.bind(k(t)),t.onEntered=t.onEntered.bind(k(t)),t.onFilterInputChange=t.onFilterInputChange.bind(k(t)),t}return g(p,[{key:"onEnter",value:function(){var e=this;this.props.onEnter((function(){if(e.virtualScrollerRef){var t=e.props.getSelectedOptionIndex();-1!==t&&e.virtualScrollerRef.scrollToIndex(t)}}))}},{key:"onEntered",value:function(){var e=this;this.props.onEntered((function(){e.props.filter&&e.props.filterInputAutoFocus&&e.filterInput.focus()}))}},{key:"onFilterInputChange",value:function(e){this.virtualScrollerRef&&this.virtualScrollerRef.scrollToIndex(0),this.props.onFilterInputChange&&this.props.onFilterInputChange(e)}},{key:"isEmptyFilter",value:function(){return!(this.props.visibleOptions&&this.props.visibleOptions.length)&&this.props.hasFilter()}},{key:"renderGroupChildren",value:function(t){var n=this;return this.props.getOptionGroupChildren(t).map((function(t,i){var r=n.props.getOptionLabel(t),o=i+"_"+n.props.getOptionRenderKey(t),s=n.props.isOptionDisabled(t);return e.createElement(R,{key:o,label:r,option:t,template:n.props.itemTemplate,selected:n.props.isSelected(t),disabled:s,onClick:n.props.onOptionClick})}))}},{key:"renderEmptyMessage",value:function(t,n){var i=r.getJSXElement(t,this.props)||d(n?"emptyFilterMessage":"emptyMessage");return e.createElement("li",{className:"p-dropdown-empty-message"},i)}},{key:"renderItem",value:function(t,n){if(this.props.optionGroupLabel){var i=this.props.optionGroupTemplate?r.getJSXElement(this.props.optionGroupTemplate,t,n):this.props.getOptionGroupLabel(t),o=this.renderGroupChildren(t),s=n+"_"+this.props.getOptionGroupRenderKey(t);return e.createElement(e.Fragment,{key:s},e.createElement("li",{className:"p-dropdown-item-group"},i),o)}var l=this.props.getOptionLabel(t),p=n+"_"+this.props.getOptionRenderKey(t),a=this.props.isOptionDisabled(t);return e.createElement(R,{key:p,label:l,option:t,template:this.props.itemTemplate,selected:this.props.isSelected(t),disabled:a,onClick:this.props.onOptionClick})}},{key:"renderItems",value:function(){var e=this;return this.props.visibleOptions&&this.props.visibleOptions.length?this.props.visibleOptions.map((function(t,n){return e.renderItem(t,n)})):this.props.hasFilter()?this.renderEmptyMessage(this.props.emptyFilterMessage,!0):this.renderEmptyMessage(this.props.emptyMessage)}},{key:"renderFilterClearIcon",value:function(){var t=this;return this.props.showFilterClear&&this.props.filterValue?e.createElement("i",{className:"p-dropdown-filter-clear-icon pi pi-times",onClick:function(){return t.props.onFilterClearIconClick((function(){return t.filterInput.focus()}))}}):null}},{key:"renderFilter",value:function(){var t=this;if(this.props.filter){var n=this.renderFilterClearIcon(),r=i("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!n});return e.createElement("div",{className:"p-dropdown-header"},e.createElement("div",{className:r},e.createElement("input",{ref:function(e){return t.filterInput=e},type:"text",autoComplete:"off",className:"p-dropdown-filter p-inputtext p-component",placeholder:this.props.filterPlaceholder,onKeyDown:this.props.onFilterInputKeyDown,onChange:this.onFilterInputChange,value:this.props.filterValue}),n,e.createElement("i",{className:"p-dropdown-filter-icon pi pi-search"})))}return null}},{key:"renderContent",value:function(){var t=this;if(this.props.virtualScrollerOptions){var n=D(D({},this.props.virtualScrollerOptions),{style:D(D({},this.props.virtualScrollerOptions.style),{height:this.props.scrollHeight}),className:i("p-dropdown-items-wrapper",this.props.virtualScrollerOptions.className),items:this.props.visibleOptions,onLazyLoad:function(e){return t.props.virtualScrollerOptions.onLazyLoad(D(D({},e),{filter:t.props.filterValue}))},itemTemplate:function(e,n){return e&&t.renderItem(e,n.index)},contentTemplate:function(n){var r=i("p-dropdown-items",n.className),o=t.isEmptyFilter()?t.renderEmptyMessage():n.children;return e.createElement("ul",{ref:n.contentRef,className:r,role:"listbox"},o)}});return e.createElement(c,b({ref:function(e){return t.virtualScrollerRef=e}},n))}var r=this.renderItems();return e.createElement("div",{className:"p-dropdown-items-wrapper",style:{maxHeight:this.props.scrollHeight||"auto"}},e.createElement("ul",{className:"p-dropdown-items",role:"listbox"},r))}},{key:"renderElement",value:function(){var t=i("p-dropdown-panel p-component",this.props.panelClassName),n=this.renderFilter(),r=this.renderContent();return e.createElement(a,{nodeRef:this.props.forwardRef,classNames:"p-connected-overlay",in:this.props.in,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntering:this.props.onEntering,onEntered:this.onEntered,onExit:this.props.onExit,onExited:this.props.onExited},e.createElement("div",{ref:this.props.forwardRef,className:t,style:this.props.panelStyle,onClick:this.props.onClick},n,r))}},{key:"render",value:function(){var t=this.renderElement();return e.createElement(u,{element:t,appendTo:this.props.appendTo})}}]),p}(),P=e.forwardRef((function(t,n){return e.createElement(G,b({forwardRef:n},t))}));function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=j(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}function j(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function B(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var H=function(p){I(d,t);var a,u,c=(a=d,u=B(),function(){var e,t=L(a);if(u){var n=L(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return w(this,e)});function d(e){var t;return m(this,d),(t=c.call(this,e)).state={filter:"",focused:!1,overlayVisible:!1},t.onClick=t.onClick.bind(k(t)),t.onInputFocus=t.onInputFocus.bind(k(t)),t.onInputBlur=t.onInputBlur.bind(k(t)),t.onInputKeyDown=t.onInputKeyDown.bind(k(t)),t.onEditableInputChange=t.onEditableInputChange.bind(k(t)),t.onEditableInputFocus=t.onEditableInputFocus.bind(k(t)),t.onOptionClick=t.onOptionClick.bind(k(t)),t.onFilterInputChange=t.onFilterInputChange.bind(k(t)),t.onFilterInputKeyDown=t.onFilterInputKeyDown.bind(k(t)),t.onFilterClearIconClick=t.onFilterClearIconClick.bind(k(t)),t.onPanelClick=t.onPanelClick.bind(k(t)),t.onOverlayEnter=t.onOverlayEnter.bind(k(t)),t.onOverlayEntered=t.onOverlayEntered.bind(k(t)),t.onOverlayExit=t.onOverlayExit.bind(k(t)),t.onOverlayExited=t.onOverlayExited.bind(k(t)),t.resetFilter=t.resetFilter.bind(k(t)),t.clear=t.clear.bind(k(t)),t.hasFilter=t.hasFilter.bind(k(t)),t.getOptionLabel=t.getOptionLabel.bind(k(t)),t.getOptionRenderKey=t.getOptionRenderKey.bind(k(t)),t.isOptionDisabled=t.isOptionDisabled.bind(k(t)),t.getOptionGroupChildren=t.getOptionGroupChildren.bind(k(t)),t.getOptionGroupLabel=t.getOptionGroupLabel.bind(k(t)),t.getOptionGroupRenderKey=t.getOptionGroupRenderKey.bind(k(t)),t.getSelectedOptionIndex=t.getSelectedOptionIndex.bind(k(t)),t.isSelected=t.isSelected.bind(k(t)),t.overlayRef=n(),t.inputRef=n(t.props.inputRef),t}return g(d,[{key:"onClick",value:function(e){this.props.disabled||o.hasClass(e.target,"p-dropdown-clear-icon")||"INPUT"===e.target.tagName||this.overlayRef.current&&this.overlayRef.current&&this.overlayRef.current.contains(e.target)||(this.focusInput.focus(),this.state.overlayVisible?this.hideOverlay():this.showOverlay())}},{key:"onInputFocus",value:function(e){var t=this;e.persist(),this.props.showOnFocus&&!this.state.overlayVisible&&this.showOverlay(),this.setState({focused:!0},(function(){t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onInputBlur",value:function(e){var t=this;e.persist(),this.setState({focused:!1},(function(){t.props.onBlur&&t.props.onBlur(e)}))}},{key:"onPanelClick",value:function(e){y.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:this.onDownKey(e);break;case 38:this.onUpKey(e);break;case 32:this.state.overlayVisible?this.hideOverlay():this.showOverlay(),e.preventDefault();break;case 13:this.hideOverlay(),e.preventDefault();break;case 27:case 9:this.hideOverlay();break;default:this.search(e)}}},{key:"onFilterInputKeyDown",value:function(e){switch(e.which){case 40:this.onDownKey(e);break;case 38:this.onUpKey(e);break;case 13:case 27:this.hideOverlay(),e.preventDefault()}}},{key:"onUpKey",value:function(e){if(this.getVisibleOptions()){var t=this.findPrevOption(this.getSelectedOptionIndex());t&&this.selectItem({originalEvent:e,option:t})}e.preventDefault()}},{key:"onDownKey",value:function(e){if(this.getVisibleOptions())if(!this.state.overlayVisible&&e.altKey)this.showOverlay();else{var t=this.findNextOption(this.getSelectedOptionIndex());t&&this.selectItem({originalEvent:e,option:t})}e.preventDefault()}},{key:"findNextOption",value:function(e){var t=this.getVisibleOptions();if(this.props.optionGroupLabel){var n=-1===e?0:e.group,i=-1===e?-1:e.option,r=this.findNextOptionInList(this.getOptionGroupChildren(t[n]),i);return r||(n+1!==t.length?this.findNextOption({group:n+1,option:-1}):null)}return this.findNextOptionInList(t,e)}},{key:"findNextOptionInList",value:function(e,t){var n=t+1;if(n===e.length)return null;var i=e[n];return this.isOptionDisabled(i)?this.findNextOptionInList(n):i}},{key:"findPrevOption",value:function(e){if(-1===e)return null;var t=this.getVisibleOptions();if(this.props.optionGroupLabel){var n=e.group,i=e.option,r=this.findPrevOptionInList(this.getOptionGroupChildren(t[n]),i);return r||(n>0?this.findPrevOption({group:n-1,option:this.getOptionGroupChildren(t[n-1]).length}):null)}return this.findPrevOptionInList(t,e)}},{key:"findPrevOptionInList",value:function(e,t){var n=t-1;if(n<0)return null;var i=e[n];return this.isOptionDisabled(i)?this.findPrevOption(n):i}},{key:"search",value:function(e){var t=this;this.searchTimeout&&clearTimeout(this.searchTimeout);var n=e.key;if(this.previousSearchChar=this.currentSearchChar,this.currentSearchChar=n,this.searchValue=this.previousSearchChar===this.currentSearchChar?this.currentSearchChar:this.searchValue?this.searchValue+n:n,this.searchValue){var i=this.getSelectedOptionIndex(),r=this.props.optionGroupLabel?this.searchOptionInGroup(i):this.searchOption(++i);r&&(this.selectItem({originalEvent:e,option:r}),this.selectedOptionUpdated=!0)}this.searchTimeout=setTimeout((function(){t.searchValue=null}),250)}},{key:"searchOption",value:function(e){var t;if(this.searchValue){var n=this.getVisibleOptions();(t=this.searchOptionInRange(e,n.length))||(t=this.searchOptionInRange(0,e))}return t}},{key:"searchOptionInRange",value:function(e,t){for(var n=this.getVisibleOptions(),i=e;i<t;i++){var r=n[i];if(this.matchesSearchValue(r))return r}return null}},{key:"searchOptionInGroup",value:function(e){for(var t=-1===e?{group:0,option:-1}:e,n=this.getVisibleOptions(),i=t.group;i<n.length;i++)for(var r=this.getOptionGroupChildren(n[i]),o=t.group===i?t.option+1:0;o<r.length;o++)if(this.matchesSearchValue(r[o]))return r[o];for(var s=0;s<=t.group;s++)for(var l=this.getOptionGroupChildren(n[s]),p=0;p<(t.group===s?t.option:l.length);p++)if(this.matchesSearchValue(l[p]))return l[p];return null}},{key:"matchesSearchValue",value:function(e){return this.getOptionLabel(e).toLocaleLowerCase(this.props.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.props.filterLocale))}},{key:"onEditableInputChange",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,value:e.target.value,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:e.target.value}})}},{key:"onEditableInputFocus",value:function(e){var t=this;e.persist(),this.setState({focused:!0},(function(){t.hideOverlay(),t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onOptionClick",value:function(e){e.option.disabled||(this.selectItem(e),this.focusInput.focus()),this.hideOverlay()}},{key:"onFilterInputChange",value:function(e){var t=this,n=e.target.value;this.setState({filter:n},(function(){t.props.onFilter&&t.props.onFilter({originalEvent:e,filter:n})}))}},{key:"onFilterClearIconClick",value:function(e){this.resetFilter(e)}},{key:"resetFilter",value:function(e){var t=this;this.setState({filter:""},(function(){t.props.onFilter&&t.props.onFilter({filter:""}),e&&e()}))}},{key:"clear",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e,value:void 0,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:void 0}}),this.updateEditableLabel()}},{key:"selectItem",value:function(e){if(this.getSelectedOption()!==e.option){this.updateEditableLabel(e.option);var t=this.getOptionValue(e.option);this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:t}})}}},{key:"getSelectedOption",value:function(){var e=this.getSelectedOptionIndex(),t=this.getVisibleOptions();return-1!==e?this.props.optionGroupLabel?this.getOptionGroupChildren(t[e.group])[e.option]:t[e]:null}},{key:"getSelectedOptionIndex",value:function(){var e=this.getVisibleOptions();if(null!=this.props.value&&e){if(!this.props.optionGroupLabel)return this.findOptionIndexInList(this.props.value,e);for(var t=0;t<e.length;t++){var n=this.findOptionIndexInList(this.props.value,this.getOptionGroupChildren(e[t]));if(-1!==n)return{group:t,option:n}}}return-1}},{key:"findOptionIndexInList",value:function(e,t){for(var n=this.equalityKey(),i=0;i<t.length;i++)if(r.equals(e,this.getOptionValue(t[i]),n))return i;return-1}},{key:"isSelected",value:function(e){return r.equals(this.props.value,this.getOptionValue(e),this.equalityKey())}},{key:"equalityKey",value:function(){return this.props.optionValue?null:this.props.dataKey}},{key:"showOverlay",value:function(){this.setState({overlayVisible:!0})}},{key:"hideOverlay",value:function(){this.setState({overlayVisible:!1})}},{key:"onOverlayEnter",value:function(e){s.set("overlay",this.overlayRef.current,h.autoZIndex,h.zIndex.overlay),this.alignOverlay(),e&&e()}},{key:"onOverlayEntered",value:function(e){e&&e(),this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onOverlayExited",value:function(){this.props.filter&&this.props.resetFilterOnHide&&this.resetFilter(),s.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){o.alignOverlay(this.overlayRef.current,this.input.parentElement,this.props.appendTo||h.appendTo)}},{key:"scrollInView",value:function(){var e=o.findSingle(this.overlayRef.current,"li.p-highlight");e&&e.scrollIntoView({block:"nearest",inline:"start"})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hideOverlay()},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new l(this.container,(function(){e.state.overlayVisible&&e.hideOverlay()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.overlayVisible&&!o.isTouchDevice()&&e.hideOverlay()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.isClearClicked(e)||this.container.contains(e.target)||this.overlayRef&&this.overlayRef.current.contains(e.target))}},{key:"isClearClicked",value:function(e){return o.hasClass(e.target,"p-dropdown-clear-icon")||o.hasClass(e.target,"p-dropdown-filter-clear-icon")}},{key:"updateEditableLabel",value:function(e){this.input&&(this.input.value=e?this.getOptionLabel(e):this.props.value||"")}},{key:"hasFilter",value:function(){return this.state.filter&&this.state.filter.trim().length>0}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?r.resolveFieldData(e,this.props.optionLabel):e&&void 0!==e.label?e.label:e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?r.resolveFieldData(e,this.props.optionValue):e&&void 0!==e.value?e.value:e}},{key:"getOptionRenderKey",value:function(e){return this.props.dataKey?r.resolveFieldData(e,this.props.dataKey):this.getOptionLabel(e)}},{key:"isOptionDisabled",value:function(e){return this.props.optionDisabled?r.isFunction(this.props.optionDisabled)?this.props.optionDisabled(e):r.resolveFieldData(e,this.props.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled}},{key:"getOptionGroupRenderKey",value:function(e){return r.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupLabel",value:function(e){return r.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupChildren",value:function(e){return r.resolveFieldData(e,this.props.optionGroupChildren)}},{key:"checkValidity",value:function(){return!!this.inputRef.current&&this.inputRef.current.checkValidity()}},{key:"isLazy",value:function(){return this.props.virtualScrollerOptions&&this.props.virtualScrollerOptions.lazy}},{key:"getVisibleOptions",value:function(){if(this.hasFilter()&&!this.isLazy()){var e=this.state.filter.trim().toLocaleLowerCase(this.props.filterLocale),t=this.props.filterBy?this.props.filterBy.split(","):[this.props.optionLabel||"label"];if(this.props.optionGroupLabel){var n,i=[],r=T(this.props.options);try{for(r.s();!(n=r.n()).done;){var o=n.value,s=f.filter(this.getOptionGroupChildren(o),t,e,this.props.filterMatchMode,this.props.filterLocale);s&&s.length&&i.push(N(N({},o),{items:s}))}}catch(e){r.e(e)}finally{r.f()}return i}return f.filter(this.props.options,t,e,this.props.filterMatchMode,this.props.filterLocale)}return this.props.options}},{key:"updateInputField",value:function(){if(this.props.editable&&this.input){var e=this.getSelectedOption(),t=e?this.getOptionLabel(e):null;this.input.value=t||this.props.value||""}}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.props.autoFocus&&this.focusInput&&this.focusInput.focus(),this.props.tooltip&&this.renderTooltip(),this.updateInputField(),this.inputRef.current&&(this.inputRef.current.selectedIndex=1)}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),s.clear(this.overlayRef.current)}},{key:"componentDidUpdate",value:function(e){this.state.overlayVisible&&(this.props.filter&&this.alignOverlay(),e.value!==this.props.value&&this.scrollInView()),e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(N({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),!this.state.filter||this.props.options&&0!==this.props.options.length||this.setState({filter:""}),this.updateInputField(),this.inputRef.current&&(this.inputRef.current.selectedIndex=1)}},{key:"renderHiddenSelect",value:function(t){var n=e.createElement("option",{value:""},this.props.placeholder),i=t?e.createElement("option",{value:t.value},this.getOptionLabel(t)):null;return e.createElement("div",{className:"p-hidden-accessible p-dropdown-hidden-select"},e.createElement("select",{ref:this.inputRef,required:this.props.required,name:this.props.name,tabIndex:-1,"aria-hidden":"true"},n,i))}},{key:"renderTooltip",value:function(){this.tooltip=v({target:this.container,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"renderKeyboardHelper",value:function(){var t=this;return e.createElement("div",{className:"p-hidden-accessible"},e.createElement("input",{ref:function(e){return t.focusInput=e},id:this.props.inputId,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:this.onInputFocus,onBlur:this.onInputBlur,onKeyDown:this.onInputKeyDown,disabled:this.props.disabled,tabIndex:this.props.tabIndex,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy}))}},{key:"renderLabel",value:function(t){var n=this,o=r.isNotEmpty(t)?this.getOptionLabel(t):null;if(this.props.editable)return e.createElement("input",{ref:function(e){return n.input=e},type:"text",defaultValue:o||this.props.value||"",className:"p-dropdown-label p-inputtext",disabled:this.props.disabled,placeholder:this.props.placeholder,maxLength:this.props.maxLength,onInput:this.onEditableInputChange,onFocus:this.onEditableInputFocus,onBlur:this.onInputBlur,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-haspopup":"listbox"});var s=i("p-dropdown-label p-inputtext",{"p-placeholder":null===o&&this.props.placeholder,"p-dropdown-label-empty":null===o&&!this.props.placeholder}),l=this.props.valueTemplate?r.getJSXElement(this.props.valueTemplate,t,this.props):o||this.props.placeholder||"empty";return e.createElement("span",{ref:function(e){return n.input=e},className:s},l)}},{key:"renderClearIcon",value:function(){return null!=this.props.value&&this.props.showClear&&!this.props.disabled?e.createElement("i",{className:"p-dropdown-clear-icon pi pi-times",onClick:this.clear}):null}},{key:"renderDropdownIcon",value:function(){var t=this,n=i("p-dropdown-trigger-icon p-clickable",this.props.dropdownIcon);return e.createElement("div",{ref:function(e){return t.trigger=e},className:"p-dropdown-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":this.state.overlayVisible},e.createElement("span",{className:n}))}},{key:"render",value:function(){var t=this,n=i("p-dropdown p-component p-inputwrapper",this.props.className,{"p-disabled":this.props.disabled,"p-focus":this.state.focused,"p-dropdown-clearable":this.props.showClear&&!this.props.disabled,"p-inputwrapper-filled":this.props.value,"p-inputwrapper-focus":this.state.focused||this.state.overlayVisible}),r=this.getVisibleOptions(),o=this.getSelectedOption(),s=this.props.appendTo||h.appendTo,l=this.renderHiddenSelect(o),p=this.renderKeyboardHelper(),a=this.renderLabel(o),u=this.renderDropdownIcon(),c=this.renderClearIcon();return e.createElement("div",{id:this.props.id,ref:function(e){return t.container=e},className:n,style:this.props.style,onClick:this.onClick,onMouseDown:this.props.onMouseDown,onContextMenu:this.props.onContextMenu},p,l,a,c,u,e.createElement(P,b({ref:this.overlayRef,visibleOptions:r},this.props,{appendTo:s,onClick:this.onPanelClick,onOptionClick:this.onOptionClick,filterValue:this.state.filter,hasFilter:this.hasFilter,onFilterClearIconClick:this.onFilterClearIconClick,onFilterInputKeyDown:this.onFilterInputKeyDown,onFilterInputChange:this.onFilterInputChange,getOptionLabel:this.getOptionLabel,getOptionRenderKey:this.getOptionRenderKey,isOptionDisabled:this.isOptionDisabled,getOptionGroupChildren:this.getOptionGroupChildren,getOptionGroupLabel:this.getOptionGroupLabel,getOptionGroupRenderKey:this.getOptionGroupRenderKey,isSelected:this.isSelected,getSelectedOptionIndex:this.getSelectedOptionIndex,in:this.state.overlayVisible,onEnter:this.onOverlayEnter,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited})))}}]),d}();F(H,"defaultProps",{id:null,inputRef:null,name:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,optionGroupTemplate:null,valueTemplate:null,itemTemplate:null,style:null,className:null,virtualScrollerOptions:null,scrollHeight:"200px",filter:!1,filterBy:null,filterMatchMode:"contains",filterPlaceholder:null,filterLocale:void 0,emptyMessage:null,emptyFilterMessage:null,editable:!1,placeholder:null,required:!1,disabled:!1,appendTo:null,tabIndex:null,autoFocus:!1,filterInputAutoFocus:!0,resetFilterOnHide:!1,showFilterClear:!1,panelClassName:null,panelStyle:null,dataKey:null,inputId:null,showClear:!1,maxLength:null,tooltip:null,tooltipOptions:null,ariaLabel:null,ariaLabelledBy:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",showOnFocus:!1,onChange:null,onFocus:null,onBlur:null,onMouseDown:null,onContextMenu:null,onShow:null,onHide:null,onFilter:null});export{H as Dropdown};
|