primereact 10.0.0 → 10.0.2
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 +1 -1
- package/accordion/accordion.esm.js +0 -1
- package/api/api.esm.js +0 -1
- package/autocomplete/autocomplete.esm.js +8 -7
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/avatar/avatar.esm.js +0 -1
- package/avatargroup/avatargroup.esm.js +0 -1
- package/badge/badge.esm.js +0 -1
- package/blockui/blockui.esm.js +3 -1
- package/blockui/blockui.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +0 -1
- package/button/button.esm.js +0 -1
- package/calendar/calendar.esm.js +2 -1
- package/calendar/calendar.esm.min.js +1 -1
- package/card/card.esm.js +0 -1
- package/carousel/carousel.esm.js +7 -8
- package/carousel/carousel.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +0 -1
- package/chart/chart.esm.js +0 -1
- package/checkbox/checkbox.esm.js +0 -1
- package/chip/chip.esm.js +0 -1
- package/chips/chips.esm.js +0 -1
- package/colorpicker/colorpicker.esm.js +0 -1
- package/column/column.esm.js +0 -1
- package/columngroup/columngroup.esm.js +0 -1
- package/componentbase/componentbase.cjs.js +12 -7
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +23 -13
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +12 -7
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +0 -1
- package/confirmpopup/confirmpopup.esm.js +0 -1
- package/contextmenu/contextmenu.esm.js +0 -1
- package/core/core.js +12 -7
- package/core/core.min.js +1 -1
- package/csstransition/csstransition.esm.js +0 -1
- package/datascroller/datascroller.esm.js +0 -1
- package/datatable/datatable.esm.js +0 -1
- package/dataview/dataview.esm.js +0 -1
- package/deferredcontent/deferredcontent.esm.js +0 -1
- package/dialog/dialog.esm.js +2 -1
- package/dialog/dialog.esm.min.js +1 -1
- package/divider/divider.esm.js +0 -1
- package/dock/dock.esm.js +0 -1
- package/dropdown/dropdown.esm.js +0 -1
- package/editor/editor.esm.js +0 -1
- package/fieldset/fieldset.esm.js +0 -1
- package/fileupload/fileupload.esm.js +0 -1
- package/galleria/galleria.esm.js +11 -7
- package/galleria/galleria.esm.min.js +1 -1
- package/hooks/hooks.esm.js +0 -6
- package/iconbase/iconbase.esm.js +0 -1
- package/icons/angledoubledown/index.esm.js +0 -1
- package/icons/angledoubleleft/index.esm.js +0 -1
- package/icons/angledoubleright/index.esm.js +0 -1
- package/icons/angledoubleup/index.esm.js +0 -1
- package/icons/angledown/index.esm.js +0 -1
- package/icons/angleleft/index.esm.js +0 -1
- package/icons/angleright/index.esm.js +0 -1
- package/icons/angleup/index.esm.js +0 -1
- package/icons/arrowdown/index.esm.js +0 -1
- package/icons/arrowup/index.esm.js +0 -1
- package/icons/ban/index.esm.js +0 -1
- package/icons/bars/index.esm.js +0 -1
- package/icons/calendar/index.esm.js +0 -1
- package/icons/check/index.esm.js +0 -1
- package/icons/chevrondown/index.esm.js +0 -1
- package/icons/chevronleft/index.esm.js +0 -1
- package/icons/chevronright/index.esm.js +0 -1
- package/icons/chevronup/index.esm.js +0 -1
- package/icons/download/index.esm.js +0 -1
- package/icons/exclamationtriangle/index.esm.js +0 -1
- package/icons/eye/index.esm.js +0 -1
- package/icons/eyeslash/index.esm.js +0 -1
- package/icons/filter/index.esm.js +0 -1
- package/icons/filterslash/index.esm.js +0 -1
- package/icons/infocircle/index.esm.js +0 -1
- package/icons/minus/index.esm.js +0 -1
- package/icons/pencil/index.esm.js +0 -1
- package/icons/plus/index.esm.js +0 -1
- package/icons/refresh/index.esm.js +0 -1
- package/icons/search/index.esm.js +0 -1
- package/icons/searchminus/index.esm.js +0 -1
- package/icons/searchplus/index.esm.js +0 -1
- package/icons/sortalt/index.esm.js +0 -1
- package/icons/sortamountdown/index.esm.js +0 -1
- package/icons/sortamountupalt/index.esm.js +0 -1
- package/icons/spinner/index.esm.js +0 -1
- package/icons/star/index.esm.js +0 -1
- package/icons/starfill/index.esm.js +0 -1
- package/icons/thlarge/index.esm.js +0 -1
- package/icons/times/index.esm.js +0 -1
- package/icons/timescircle/index.esm.js +0 -1
- package/icons/trash/index.esm.js +0 -1
- package/icons/undo/index.esm.js +0 -1
- package/icons/upload/index.esm.js +0 -1
- package/icons/windowmaximize/index.esm.js +0 -1
- package/icons/windowminimize/index.esm.js +0 -1
- package/image/image.esm.js +2 -1
- package/image/image.esm.min.js +1 -1
- package/inplace/inplace.esm.js +0 -1
- package/inputmask/inputmask.esm.js +0 -1
- package/inputnumber/inputnumber.esm.js +0 -1
- package/inputswitch/inputswitch.esm.js +0 -1
- package/inputtext/inputtext.esm.js +0 -1
- package/inputtextarea/inputtextarea.esm.js +0 -1
- package/keyfilter/keyfilter.esm.js +0 -1
- package/knob/knob.esm.js +0 -1
- package/listbox/listbox.esm.js +0 -1
- package/megamenu/megamenu.esm.js +0 -1
- package/mention/mention.esm.js +0 -1
- package/menu/menu.esm.js +0 -1
- package/menubar/menubar.esm.js +0 -1
- package/message/message.esm.js +0 -1
- package/messages/messages.esm.js +1 -2
- package/messages/messages.esm.min.js +1 -1
- package/multiselect/multiselect.esm.js +0 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +0 -1
- package/orderlist/orderlist.esm.js +9 -5
- package/orderlist/orderlist.esm.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +0 -1
- package/overlaypanel/overlaypanel.esm.js +0 -1
- package/overlayservice/overlayservice.esm.js +0 -1
- package/package.json +2 -2
- package/paginator/paginator.esm.js +0 -1
- package/panel/panel.esm.js +0 -1
- package/panelmenu/panelmenu.esm.js +0 -1
- package/passthrough/index.esm.js +0 -1
- package/passthrough/tailwind/index.cjs.js +2 -4
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +149 -148
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +2 -4
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.esm.js +0 -1
- package/picklist/picklist.esm.js +0 -1
- package/portal/portal.esm.js +0 -1
- package/primereact.all.cjs.js +12 -7
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +70 -42
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +12 -7
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.esm.js +0 -1
- package/progressspinner/progressspinner.esm.js +0 -1
- package/radiobutton/radiobutton.esm.js +0 -1
- package/rating/rating.esm.js +0 -1
- package/ripple/ripple.esm.js +0 -1
- package/row/row.esm.js +0 -1
- package/scrollpanel/scrollpanel.esm.js +0 -1
- package/scrolltop/scrolltop.esm.js +0 -1
- package/selectbutton/selectbutton.esm.js +0 -1
- package/sidebar/sidebar.esm.js +2 -1
- package/sidebar/sidebar.esm.min.js +1 -1
- package/skeleton/skeleton.esm.js +0 -1
- package/slidemenu/slidemenu.esm.js +0 -1
- package/slider/slider.esm.js +0 -1
- package/speeddial/speeddial.esm.js +0 -1
- package/splitbutton/splitbutton.esm.js +0 -1
- package/splitter/splitter.esm.js +0 -1
- package/steps/steps.esm.js +0 -1
- package/styleclass/styleclass.esm.js +0 -1
- package/tabmenu/tabmenu.esm.js +0 -1
- package/tabview/tabview.esm.js +0 -1
- package/tag/tag.esm.js +0 -1
- package/terminal/terminal.esm.js +0 -1
- package/terminalservice/terminalservice.esm.js +0 -1
- package/tieredmenu/tieredmenu.esm.js +0 -1
- package/timeline/timeline.esm.js +0 -1
- package/toast/toast.esm.js +0 -1
- package/togglebutton/togglebutton.esm.js +0 -1
- package/toolbar/toolbar.esm.js +0 -1
- package/tooltip/tooltip.esm.js +0 -1
- package/tree/tree.esm.js +0 -1
- package/treeselect/treeselect.esm.js +0 -1
- package/treetable/treetable.esm.js +0 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +0 -1
- package/utils/utils.esm.js +0 -1
- package/virtualscroller/virtualscroller.esm.js +0 -1
- package/web-types.json +1 -1
- package/accordion/accordion.esm.min.mjs +0 -1
- package/accordion/accordion.esm.mjs +0 -420
- package/api/api.esm.min.mjs +0 -1
- package/api/api.esm.mjs +0 -943
- package/autocomplete/autocomplete.esm.min.mjs +0 -1
- package/autocomplete/autocomplete.esm.mjs +0 -1128
- package/avatar/avatar.esm.min.mjs +0 -1
- package/avatar/avatar.esm.mjs +0 -244
- package/avatargroup/avatargroup.esm.min.mjs +0 -1
- package/avatargroup/avatargroup.esm.mjs +0 -54
- package/badge/badge.esm.min.mjs +0 -1
- package/badge/badge.esm.mjs +0 -109
- package/blockui/blockui.esm.min.mjs +0 -1
- package/blockui/blockui.esm.mjs +0 -267
- package/breadcrumb/breadcrumb.esm.min.mjs +0 -1
- package/breadcrumb/breadcrumb.esm.mjs +0 -350
- package/button/button.esm.min.mjs +0 -1
- package/button/button.esm.mjs +0 -294
- package/calendar/calendar.esm.min.mjs +0 -1
- package/calendar/calendar.esm.mjs +0 -3474
- package/card/card.esm.min.mjs +0 -1
- package/card/card.esm.mjs +0 -97
- package/carousel/carousel.esm.min.mjs +0 -1
- package/carousel/carousel.esm.mjs +0 -800
- package/cascadeselect/cascadeselect.esm.min.mjs +0 -1
- package/cascadeselect/cascadeselect.esm.mjs +0 -818
- package/chart/chart.esm.min.mjs +0 -1
- package/chart/chart.esm.mjs +0 -154
- package/checkbox/checkbox.esm.min.mjs +0 -1
- package/checkbox/checkbox.esm.mjs +0 -356
- package/chip/chip.esm.min.mjs +0 -1
- package/chip/chip.esm.mjs +0 -247
- package/chips/chips.esm.min.mjs +0 -1
- package/chips/chips.esm.mjs +0 -500
- package/colorpicker/colorpicker.esm.min.mjs +0 -1
- package/colorpicker/colorpicker.esm.mjs +0 -787
- package/column/column.esm.min.mjs +0 -1
- package/column/column.esm.mjs +0 -7
- package/columngroup/columngroup.esm.min.mjs +0 -1
- package/columngroup/columngroup.esm.mjs +0 -5
- package/componentbase/componentbase.esm.min.mjs +0 -1
- package/componentbase/componentbase.esm.mjs +0 -328
- package/confirmdialog/confirmdialog.esm.min.mjs +0 -1
- package/confirmdialog/confirmdialog.esm.mjs +0 -375
- package/confirmpopup/confirmpopup.esm.min.mjs +0 -1
- package/confirmpopup/confirmpopup.esm.mjs +0 -609
- package/contextmenu/contextmenu.esm.min.mjs +0 -1
- package/contextmenu/contextmenu.esm.mjs +0 -663
- package/csstransition/csstransition.esm.min.mjs +0 -1
- package/csstransition/csstransition.esm.mjs +0 -137
- package/datascroller/datascroller.esm.min.mjs +0 -1
- package/datascroller/datascroller.esm.mjs +0 -319
- package/datatable/datatable.esm.min.mjs +0 -1
- package/datatable/datatable.esm.mjs +0 -6635
- package/dataview/dataview.esm.min.mjs +0 -1
- package/dataview/dataview.esm.mjs +0 -505
- package/deferredcontent/deferredcontent.esm.min.mjs +0 -1
- package/deferredcontent/deferredcontent.esm.mjs +0 -132
- package/dialog/dialog.esm.min.mjs +0 -1
- package/dialog/dialog.esm.mjs +0 -984
- package/divider/divider.esm.min.mjs +0 -1
- package/divider/divider.esm.mjs +0 -78
- package/dock/dock.esm.min.mjs +0 -1
- package/dock/dock.esm.mjs +0 -347
- package/dropdown/dropdown.esm.min.mjs +0 -1
- package/dropdown/dropdown.esm.mjs +0 -1379
- package/editor/editor.esm.min.mjs +0 -1
- package/editor/editor.esm.mjs +0 -337
- package/fieldset/fieldset.esm.min.mjs +0 -1
- package/fieldset/fieldset.esm.mjs +0 -269
- package/fileupload/fileupload.esm.min.mjs +0 -1
- package/fileupload/fileupload.esm.mjs +0 -1004
- package/galleria/galleria.esm.min.mjs +0 -1
- package/galleria/galleria.esm.mjs +0 -1094
- package/hooks/hooks.esm.min.mjs +0 -1
- package/hooks/hooks.esm.mjs +0 -1036
- package/iconbase/iconbase.esm.min.mjs +0 -1
- package/iconbase/iconbase.esm.mjs +0 -32
- package/icons/angledoubledown/index.esm.min.mjs +0 -1
- package/icons/angledoubledown/index.esm.mjs +0 -38
- package/icons/angledoubleleft/index.esm.min.mjs +0 -1
- package/icons/angledoubleleft/index.esm.mjs +0 -38
- package/icons/angledoubleright/index.esm.min.mjs +0 -1
- package/icons/angledoubleright/index.esm.mjs +0 -38
- package/icons/angledoubleup/index.esm.min.mjs +0 -1
- package/icons/angledoubleup/index.esm.mjs +0 -38
- package/icons/angledown/index.esm.min.mjs +0 -1
- package/icons/angledown/index.esm.mjs +0 -36
- package/icons/angleleft/index.esm.min.mjs +0 -1
- package/icons/angleleft/index.esm.mjs +0 -36
- package/icons/angleright/index.esm.min.mjs +0 -1
- package/icons/angleright/index.esm.mjs +0 -36
- package/icons/angleup/index.esm.min.mjs +0 -1
- package/icons/angleup/index.esm.mjs +0 -36
- package/icons/arrowdown/index.esm.min.mjs +0 -1
- package/icons/arrowdown/index.esm.mjs +0 -660
- package/icons/arrowup/index.esm.min.mjs +0 -1
- package/icons/arrowup/index.esm.mjs +0 -660
- package/icons/ban/index.esm.min.mjs +0 -1
- package/icons/ban/index.esm.mjs +0 -658
- package/icons/bars/index.esm.min.mjs +0 -1
- package/icons/bars/index.esm.mjs +0 -38
- package/icons/calendar/index.esm.min.mjs +0 -1
- package/icons/calendar/index.esm.mjs +0 -36
- package/icons/check/index.esm.min.mjs +0 -1
- package/icons/check/index.esm.mjs +0 -36
- package/icons/chevrondown/index.esm.min.mjs +0 -1
- package/icons/chevrondown/index.esm.mjs +0 -36
- package/icons/chevronleft/index.esm.min.mjs +0 -1
- package/icons/chevronleft/index.esm.mjs +0 -36
- package/icons/chevronright/index.esm.min.mjs +0 -1
- package/icons/chevronright/index.esm.mjs +0 -36
- package/icons/chevronup/index.esm.min.mjs +0 -1
- package/icons/chevronup/index.esm.mjs +0 -36
- package/icons/download/index.esm.min.mjs +0 -1
- package/icons/download/index.esm.mjs +0 -660
- package/icons/exclamationtriangle/index.esm.min.mjs +0 -1
- package/icons/exclamationtriangle/index.esm.mjs +0 -664
- package/icons/eye/index.esm.min.mjs +0 -1
- package/icons/eye/index.esm.mjs +0 -38
- package/icons/eyeslash/index.esm.min.mjs +0 -1
- package/icons/eyeslash/index.esm.mjs +0 -660
- package/icons/filter/index.esm.min.mjs +0 -1
- package/icons/filter/index.esm.mjs +0 -658
- package/icons/filterslash/index.esm.min.mjs +0 -1
- package/icons/filterslash/index.esm.mjs +0 -660
- package/icons/infocircle/index.esm.min.mjs +0 -1
- package/icons/infocircle/index.esm.mjs +0 -660
- package/icons/minus/index.esm.min.mjs +0 -1
- package/icons/minus/index.esm.mjs +0 -36
- package/icons/pencil/index.esm.min.mjs +0 -1
- package/icons/pencil/index.esm.mjs +0 -658
- package/icons/plus/index.esm.min.mjs +0 -1
- package/icons/plus/index.esm.mjs +0 -658
- package/icons/refresh/index.esm.min.mjs +0 -1
- package/icons/refresh/index.esm.mjs +0 -660
- package/icons/search/index.esm.min.mjs +0 -1
- package/icons/search/index.esm.mjs +0 -660
- package/icons/searchminus/index.esm.min.mjs +0 -1
- package/icons/searchminus/index.esm.mjs +0 -660
- package/icons/searchplus/index.esm.min.mjs +0 -1
- package/icons/searchplus/index.esm.mjs +0 -660
- package/icons/sortalt/index.esm.min.mjs +0 -1
- package/icons/sortalt/index.esm.mjs +0 -667
- package/icons/sortamountdown/index.esm.min.mjs +0 -1
- package/icons/sortamountdown/index.esm.mjs +0 -673
- package/icons/sortamountupalt/index.esm.min.mjs +0 -1
- package/icons/sortamountupalt/index.esm.mjs +0 -673
- package/icons/spinner/index.esm.min.mjs +0 -1
- package/icons/spinner/index.esm.mjs +0 -658
- package/icons/star/index.esm.min.mjs +0 -1
- package/icons/star/index.esm.mjs +0 -658
- package/icons/starfill/index.esm.min.mjs +0 -1
- package/icons/starfill/index.esm.mjs +0 -658
- package/icons/thlarge/index.esm.min.mjs +0 -1
- package/icons/thlarge/index.esm.mjs +0 -660
- package/icons/times/index.esm.min.mjs +0 -1
- package/icons/times/index.esm.mjs +0 -36
- package/icons/timescircle/index.esm.min.mjs +0 -1
- package/icons/timescircle/index.esm.mjs +0 -660
- package/icons/trash/index.esm.min.mjs +0 -1
- package/icons/trash/index.esm.mjs +0 -660
- package/icons/undo/index.esm.min.mjs +0 -1
- package/icons/undo/index.esm.mjs +0 -660
- package/icons/upload/index.esm.min.mjs +0 -1
- package/icons/upload/index.esm.mjs +0 -660
- package/icons/windowmaximize/index.esm.min.mjs +0 -1
- package/icons/windowmaximize/index.esm.mjs +0 -660
- package/icons/windowminimize/index.esm.min.mjs +0 -1
- package/icons/windowminimize/index.esm.mjs +0 -660
- package/image/image.esm.min.mjs +0 -1
- package/image/image.esm.mjs +0 -1163
- package/inplace/inplace.esm.min.mjs +0 -1
- package/inplace/inplace.esm.mjs +0 -242
- package/inputmask/inputmask.esm.min.mjs +0 -1
- package/inputmask/inputmask.esm.mjs +0 -559
- package/inputnumber/inputnumber.esm.min.mjs +0 -1
- package/inputnumber/inputnumber.esm.mjs +0 -1208
- package/inputswitch/inputswitch.esm.min.mjs +0 -1
- package/inputswitch/inputswitch.esm.mjs +0 -290
- package/inputtext/inputtext.esm.min.mjs +0 -1
- package/inputtext/inputtext.esm.mjs +0 -170
- package/inputtextarea/inputtextarea.esm.min.mjs +0 -1
- package/inputtextarea/inputtextarea.esm.mjs +0 -219
- package/keyfilter/keyfilter.esm.min.mjs +0 -1
- package/keyfilter/keyfilter.esm.mjs +0 -107
- package/knob/knob.esm.min.mjs +0 -1
- package/knob/knob.esm.mjs +0 -317
- package/listbox/listbox.esm.min.mjs +0 -1
- package/listbox/listbox.esm.mjs +0 -809
- package/megamenu/megamenu.esm.min.mjs +0 -1
- package/megamenu/megamenu.esm.mjs +0 -715
- package/mention/mention.esm.min.mjs +0 -1
- package/mention/mention.esm.mjs +0 -770
- package/menu/menu.esm.min.mjs +0 -1
- package/menu/menu.esm.mjs +0 -484
- package/menubar/menubar.esm.min.mjs +0 -1
- package/menubar/menubar.esm.mjs +0 -583
- package/message/message.esm.min.mjs +0 -1
- package/message/message.esm.mjs +0 -168
- package/messages/messages.esm.min.mjs +0 -1
- package/messages/messages.esm.mjs +0 -438
- package/multiselect/multiselect.esm.min.mjs +0 -1
- package/multiselect/multiselect.esm.mjs +0 -1723
- package/multistatecheckbox/multistatecheckbox.esm.min.mjs +0 -1
- package/multistatecheckbox/multistatecheckbox.esm.mjs +0 -351
- package/orderlist/orderlist.esm.min.mjs +0 -1
- package/orderlist/orderlist.esm.mjs +0 -820
- package/organizationchart/organizationchart.esm.min.mjs +0 -1
- package/organizationchart/organizationchart.esm.mjs +0 -479
- package/overlaypanel/overlaypanel.esm.min.mjs +0 -1
- package/overlaypanel/overlaypanel.esm.mjs +0 -515
- package/overlayservice/overlayservice.esm.min.mjs +0 -1
- package/overlayservice/overlayservice.esm.mjs +0 -6
- package/paginator/paginator.esm.min.mjs +0 -1
- package/paginator/paginator.esm.mjs +0 -932
- package/panel/panel.esm.min.mjs +0 -1
- package/panel/panel.esm.mjs +0 -315
- package/panelmenu/panelmenu.esm.min.mjs +0 -1
- package/panelmenu/panelmenu.esm.mjs +0 -644
- package/passthrough/index.esm.min.mjs +0 -1
- package/passthrough/index.esm.mjs +0 -70
- package/passthrough/tailwind/index.esm.min.mjs +0 -1
- package/passthrough/tailwind/index.esm.mjs +0 -3513
- package/password/password.esm.min.mjs +0 -1
- package/password/password.esm.mjs +0 -566
- package/picklist/picklist.esm.min.mjs +0 -1
- package/picklist/picklist.esm.mjs +0 -1118
- package/portal/portal.esm.min.mjs +0 -1
- package/portal/portal.esm.mjs +0 -109
- package/primereact.all.esm.min.mjs +0 -1
- package/primereact.all.esm.mjs +0 -51669
- package/progressbar/progressbar.esm.min.mjs +0 -1
- package/progressbar/progressbar.esm.mjs +0 -189
- package/progressspinner/progressspinner.esm.min.mjs +0 -1
- package/progressspinner/progressspinner.esm.mjs +0 -87
- package/radiobutton/radiobutton.esm.min.mjs +0 -1
- package/radiobutton/radiobutton.esm.mjs +0 -328
- package/rating/rating.esm.min.mjs +0 -1
- package/rating/rating.esm.mjs +0 -272
- package/ripple/ripple.esm.min.mjs +0 -1
- package/ripple/ripple.esm.mjs +0 -99
- package/row/row.esm.min.mjs +0 -1
- package/row/row.esm.mjs +0 -35
- package/scrollpanel/scrollpanel.esm.min.mjs +0 -1
- package/scrollpanel/scrollpanel.esm.mjs +0 -209
- package/scrolltop/scrolltop.esm.min.mjs +0 -1
- package/scrolltop/scrolltop.esm.mjs +0 -268
- package/selectbutton/selectbutton.esm.min.mjs +0 -1
- package/selectbutton/selectbutton.esm.mjs +0 -326
- package/sidebar/sidebar.esm.min.mjs +0 -1
- package/sidebar/sidebar.esm.mjs +0 -544
- package/skeleton/skeleton.esm.min.mjs +0 -1
- package/skeleton/skeleton.esm.mjs +0 -124
- package/slidemenu/slidemenu.esm.min.mjs +0 -1
- package/slidemenu/slidemenu.esm.mjs +0 -688
- package/slider/slider.esm.min.mjs +0 -1
- package/slider/slider.esm.mjs +0 -477
- package/speeddial/speeddial.esm.min.mjs +0 -1
- package/speeddial/speeddial.esm.mjs +0 -520
- package/splitbutton/splitbutton.esm.min.mjs +0 -1
- package/splitbutton/splitbutton.esm.mjs +0 -544
- package/splitter/splitter.esm.min.mjs +0 -1
- package/splitter/splitter.esm.mjs +0 -465
- package/steps/steps.esm.min.mjs +0 -1
- package/steps/steps.esm.mjs +0 -293
- package/styleclass/styleclass.esm.min.mjs +0 -1
- package/styleclass/styleclass.esm.mjs +0 -268
- package/tabmenu/tabmenu.esm.min.mjs +0 -1
- package/tabmenu/tabmenu.esm.mjs +0 -331
- package/tabview/tabview.esm.min.mjs +0 -1
- package/tabview/tabview.esm.mjs +0 -677
- package/tag/tag.esm.min.mjs +0 -1
- package/tag/tag.esm.mjs +0 -116
- package/terminal/terminal.esm.min.mjs +0 -1
- package/terminal/terminal.esm.mjs +0 -279
- package/terminalservice/terminalservice.esm.min.mjs +0 -1
- package/terminalservice/terminalservice.esm.mjs +0 -6
- package/tieredmenu/tieredmenu.esm.min.mjs +0 -1
- package/tieredmenu/tieredmenu.esm.mjs +0 -698
- package/timeline/timeline.esm.min.mjs +0 -1
- package/timeline/timeline.esm.mjs +0 -163
- package/toast/toast.esm.min.mjs +0 -1
- package/toast/toast.esm.mjs +0 -738
- package/togglebutton/togglebutton.esm.min.mjs +0 -1
- package/togglebutton/togglebutton.esm.mjs +0 -216
- package/toolbar/toolbar.esm.min.mjs +0 -1
- package/toolbar/toolbar.esm.mjs +0 -78
- package/tooltip/tooltip.esm.min.mjs +0 -1
- package/tooltip/tooltip.esm.mjs +0 -695
- package/tree/tree.esm.min.mjs +0 -1
- package/tree/tree.esm.mjs +0 -1402
- package/treeselect/treeselect.esm.min.mjs +0 -1
- package/treeselect/treeselect.esm.mjs +0 -929
- package/treetable/treetable.esm.min.mjs +0 -1
- package/treetable/treetable.esm.mjs +0 -3093
- package/tristatecheckbox/tristatecheckbox.esm.min.mjs +0 -1
- package/tristatecheckbox/tristatecheckbox.esm.mjs +0 -291
- package/utils/utils.esm.min.mjs +0 -1
- package/utils/utils.esm.mjs +0 -2382
- package/virtualscroller/virtualscroller.esm.min.mjs +0 -1
- package/virtualscroller/virtualscroller.esm.mjs +0 -971
|
@@ -1,1379 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import PrimeReact, { PrimeReactContext, localeOption, FilterService } from 'primereact/api';
|
|
4
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
5
|
-
import { useOverlayListener, useMountEffect, useUpdateEffect, useUnmountEffect } from 'primereact/hooks';
|
|
6
|
-
import { ChevronDownIcon } from 'primereact/icons/chevrondown';
|
|
7
|
-
import { TimesIcon } from 'primereact/icons/times';
|
|
8
|
-
import { OverlayService } from 'primereact/overlayservice';
|
|
9
|
-
import { Tooltip } from 'primereact/tooltip';
|
|
10
|
-
import { classNames, ObjectUtils, mergeProps, DomHandler, IconUtils, ZIndexUtils } from 'primereact/utils';
|
|
11
|
-
import { CSSTransition } from 'primereact/csstransition';
|
|
12
|
-
import { SearchIcon } from 'primereact/icons/search';
|
|
13
|
-
import { Portal } from 'primereact/portal';
|
|
14
|
-
import { VirtualScroller } from 'primereact/virtualscroller';
|
|
15
|
-
import { Ripple } from 'primereact/ripple';
|
|
16
|
-
|
|
17
|
-
function _extends() {
|
|
18
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
19
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
20
|
-
var source = arguments[i];
|
|
21
|
-
for (var key in source) {
|
|
22
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
|
-
target[key] = source[key];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
};
|
|
29
|
-
return _extends.apply(this, arguments);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function _typeof(o) {
|
|
33
|
-
"@babel/helpers - typeof";
|
|
34
|
-
|
|
35
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
36
|
-
return typeof o;
|
|
37
|
-
} : function (o) {
|
|
38
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
39
|
-
}, _typeof(o);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _toPrimitive(input, hint) {
|
|
43
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
44
|
-
var prim = input[Symbol.toPrimitive];
|
|
45
|
-
if (prim !== undefined) {
|
|
46
|
-
var res = prim.call(input, hint || "default");
|
|
47
|
-
if (_typeof(res) !== "object") return res;
|
|
48
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
49
|
-
}
|
|
50
|
-
return (hint === "string" ? String : Number)(input);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function _toPropertyKey(arg) {
|
|
54
|
-
var key = _toPrimitive(arg, "string");
|
|
55
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _defineProperty(obj, key, value) {
|
|
59
|
-
key = _toPropertyKey(key);
|
|
60
|
-
if (key in obj) {
|
|
61
|
-
Object.defineProperty(obj, key, {
|
|
62
|
-
value: value,
|
|
63
|
-
enumerable: true,
|
|
64
|
-
configurable: true,
|
|
65
|
-
writable: true
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
obj[key] = value;
|
|
69
|
-
}
|
|
70
|
-
return obj;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _arrayWithHoles(arr) {
|
|
74
|
-
if (Array.isArray(arr)) return arr;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function _iterableToArrayLimit(r, l) {
|
|
78
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
79
|
-
if (null != t) {
|
|
80
|
-
var e,
|
|
81
|
-
n,
|
|
82
|
-
i,
|
|
83
|
-
u,
|
|
84
|
-
a = [],
|
|
85
|
-
f = !0,
|
|
86
|
-
o = !1;
|
|
87
|
-
try {
|
|
88
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
89
|
-
if (Object(t) !== t) return;
|
|
90
|
-
f = !1;
|
|
91
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
92
|
-
} catch (r) {
|
|
93
|
-
o = !0, n = r;
|
|
94
|
-
} finally {
|
|
95
|
-
try {
|
|
96
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
97
|
-
} finally {
|
|
98
|
-
if (o) throw n;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return a;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function _arrayLikeToArray$1(arr, len) {
|
|
106
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
107
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
108
|
-
return arr2;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function _unsupportedIterableToArray$1(o, minLen) {
|
|
112
|
-
if (!o) return;
|
|
113
|
-
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
|
114
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
115
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
116
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
117
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function _nonIterableRest() {
|
|
121
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function _slicedToArray(arr, i) {
|
|
125
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
var classes = {
|
|
129
|
-
root: function root(_ref) {
|
|
130
|
-
var props = _ref.props,
|
|
131
|
-
focusedState = _ref.focusedState,
|
|
132
|
-
overlayVisibleState = _ref.overlayVisibleState;
|
|
133
|
-
return classNames('p-dropdown p-component p-inputwrapper', {
|
|
134
|
-
'p-disabled': props.disabled,
|
|
135
|
-
'p-focus': focusedState,
|
|
136
|
-
'p-dropdown-clearable': props.showClear && !props.disabled,
|
|
137
|
-
'p-inputwrapper-filled': ObjectUtils.isNotEmpty(props.value),
|
|
138
|
-
'p-inputwrapper-focus': focusedState || overlayVisibleState
|
|
139
|
-
});
|
|
140
|
-
},
|
|
141
|
-
input: function input(_ref2) {
|
|
142
|
-
var props = _ref2.props,
|
|
143
|
-
label = _ref2.label;
|
|
144
|
-
return props.editable ? 'p-dropdown-label p-inputtext' : classNames('p-dropdown-label p-inputtext', {
|
|
145
|
-
'p-placeholder': label === null && props.placeholder,
|
|
146
|
-
'p-dropdown-label-empty': label === null && !props.placeholder
|
|
147
|
-
});
|
|
148
|
-
},
|
|
149
|
-
trigger: 'p-dropdown-trigger',
|
|
150
|
-
emptyMessage: 'p-dropdown-empty-message',
|
|
151
|
-
itemGroup: 'p-dropdown-item-group',
|
|
152
|
-
dropdownIcon: 'p-dropdown-trigger-icon p-clickable',
|
|
153
|
-
clearIcon: 'p-dropdown-clear-icon p-clickable',
|
|
154
|
-
filterIcon: 'p-dropdown-filter-icon',
|
|
155
|
-
filterContainer: function filterContainer(_ref3) {
|
|
156
|
-
var clearIcon = _ref3.clearIcon;
|
|
157
|
-
return classNames('p-dropdown-filter-container', {
|
|
158
|
-
'p-dropdown-clearable-filter': !!clearIcon
|
|
159
|
-
});
|
|
160
|
-
},
|
|
161
|
-
filterInput: 'p-dropdown-filter p-inputtext p-component',
|
|
162
|
-
list: function list(_ref4) {
|
|
163
|
-
var virtualScrollerOptions = _ref4.virtualScrollerOptions;
|
|
164
|
-
return virtualScrollerOptions ? 'p-dropdown-items' : 'p-dropdown-items';
|
|
165
|
-
},
|
|
166
|
-
panel: function panel(_ref5) {
|
|
167
|
-
var context = _ref5.context;
|
|
168
|
-
return classNames('p-dropdown-panel p-component', {
|
|
169
|
-
'p-input-filled': context && context.inputStyle === 'filled' || PrimeReact.inputStyle === 'filled',
|
|
170
|
-
'p-ripple-disabled': context && context.ripple === false || PrimeReact.ripple === false
|
|
171
|
-
});
|
|
172
|
-
},
|
|
173
|
-
item: function item(_ref6) {
|
|
174
|
-
var selected = _ref6.selected,
|
|
175
|
-
disabled = _ref6.disabled,
|
|
176
|
-
label = _ref6.label;
|
|
177
|
-
return classNames('p-dropdown-item', {
|
|
178
|
-
'p-highlight': selected,
|
|
179
|
-
'p-disabled': disabled,
|
|
180
|
-
'p-dropdown-item-empty': !label || label.length === 0
|
|
181
|
-
});
|
|
182
|
-
},
|
|
183
|
-
wrapper: 'p-dropdown-items-wrapper',
|
|
184
|
-
header: 'p-dropdown-header',
|
|
185
|
-
footer: 'p-dropdown-footer',
|
|
186
|
-
transition: 'p-connected-overlay'
|
|
187
|
-
};
|
|
188
|
-
var styles = "\n@layer primereact {\n .p-dropdown {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n }\n \n .p-dropdown-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n \n .p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n \n .p-dropdown-label-empty {\n overflow: hidden;\n visibility: hidden;\n }\n \n input.p-dropdown-label {\n cursor: default;\n }\n \n .p-dropdown .p-dropdown-panel {\n min-width: 100%;\n }\n \n .p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n }\n \n .p-dropdown-items-wrapper {\n overflow: auto;\n }\n \n .p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n }\n \n .p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n \n .p-dropdown-filter {\n width: 100%;\n }\n \n .p-dropdown-filter-container {\n position: relative;\n }\n \n .p-dropdown-clear-icon,\n .p-dropdown-filter-icon,\n .p-dropdown-filter-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-fluid .p-dropdown {\n display: flex;\n }\n \n .p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n }\n}\n";
|
|
189
|
-
var inlineStyles = {
|
|
190
|
-
wrapper: function wrapper(_ref7) {
|
|
191
|
-
var props = _ref7.props;
|
|
192
|
-
return {
|
|
193
|
-
maxHeight: props.scrollHeight || 'auto'
|
|
194
|
-
};
|
|
195
|
-
},
|
|
196
|
-
panel: function panel(_ref8) {
|
|
197
|
-
var props = _ref8.props;
|
|
198
|
-
props.panelStyle;
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
var DropdownBase = ComponentBase.extend({
|
|
202
|
-
defaultProps: {
|
|
203
|
-
__TYPE: 'Dropdown',
|
|
204
|
-
__parentMetadata: null,
|
|
205
|
-
appendTo: null,
|
|
206
|
-
ariaLabel: null,
|
|
207
|
-
ariaLabelledBy: null,
|
|
208
|
-
autoFocus: false,
|
|
209
|
-
children: undefined,
|
|
210
|
-
className: null,
|
|
211
|
-
clearIcon: null,
|
|
212
|
-
dataKey: null,
|
|
213
|
-
disabled: false,
|
|
214
|
-
dropdownIcon: null,
|
|
215
|
-
editable: false,
|
|
216
|
-
emptyFilterMessage: null,
|
|
217
|
-
emptyMessage: null,
|
|
218
|
-
filter: false,
|
|
219
|
-
filterBy: null,
|
|
220
|
-
filterClearIcon: null,
|
|
221
|
-
filterIcon: null,
|
|
222
|
-
filterInputAutoFocus: true,
|
|
223
|
-
filterLocale: undefined,
|
|
224
|
-
filterMatchMode: 'contains',
|
|
225
|
-
filterPlaceholder: null,
|
|
226
|
-
filterTemplate: null,
|
|
227
|
-
focusInputRef: null,
|
|
228
|
-
id: null,
|
|
229
|
-
inputId: null,
|
|
230
|
-
inputRef: null,
|
|
231
|
-
itemTemplate: null,
|
|
232
|
-
maxLength: null,
|
|
233
|
-
name: null,
|
|
234
|
-
onBlur: null,
|
|
235
|
-
onChange: null,
|
|
236
|
-
onContextMenu: null,
|
|
237
|
-
onFilter: null,
|
|
238
|
-
onFocus: null,
|
|
239
|
-
onHide: null,
|
|
240
|
-
onMouseDown: null,
|
|
241
|
-
onShow: null,
|
|
242
|
-
optionDisabled: null,
|
|
243
|
-
optionGroupChildren: 'items',
|
|
244
|
-
optionGroupLabel: null,
|
|
245
|
-
optionGroupTemplate: null,
|
|
246
|
-
optionLabel: null,
|
|
247
|
-
optionValue: null,
|
|
248
|
-
options: null,
|
|
249
|
-
panelClassName: null,
|
|
250
|
-
panelFooterTemplate: null,
|
|
251
|
-
panelStyle: null,
|
|
252
|
-
placeholder: null,
|
|
253
|
-
required: false,
|
|
254
|
-
resetFilterOnHide: false,
|
|
255
|
-
scrollHeight: '200px',
|
|
256
|
-
showClear: false,
|
|
257
|
-
showFilterClear: false,
|
|
258
|
-
showOnFocus: false,
|
|
259
|
-
style: null,
|
|
260
|
-
tabIndex: null,
|
|
261
|
-
tooltip: null,
|
|
262
|
-
tooltipOptions: null,
|
|
263
|
-
transitionOptions: null,
|
|
264
|
-
value: null,
|
|
265
|
-
valueTemplate: null,
|
|
266
|
-
virtualScrollerOptions: null
|
|
267
|
-
},
|
|
268
|
-
css: {
|
|
269
|
-
classes: classes,
|
|
270
|
-
styles: styles,
|
|
271
|
-
inlineStyles: inlineStyles
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
|
|
275
|
-
var DropdownItem = /*#__PURE__*/React.memo(function (props) {
|
|
276
|
-
var ptm = props.ptm,
|
|
277
|
-
cx = props.cx,
|
|
278
|
-
selected = props.selected,
|
|
279
|
-
disabled = props.disabled,
|
|
280
|
-
option = props.option,
|
|
281
|
-
label = props.label;
|
|
282
|
-
var getPTOptions = function getPTOptions(key) {
|
|
283
|
-
return ptm(key, {
|
|
284
|
-
context: {
|
|
285
|
-
selected: selected,
|
|
286
|
-
disabled: disabled
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
};
|
|
290
|
-
var _onClick = function onClick(event) {
|
|
291
|
-
if (props.onClick) {
|
|
292
|
-
props.onClick({
|
|
293
|
-
originalEvent: event,
|
|
294
|
-
option: option
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
var content = props.template ? ObjectUtils.getJSXElement(props.template, props.option) : props.label;
|
|
299
|
-
var itemProps = mergeProps({
|
|
300
|
-
role: 'option',
|
|
301
|
-
key: props.label,
|
|
302
|
-
className: classNames(option.className, cx('item')),
|
|
303
|
-
style: props.style,
|
|
304
|
-
onClick: function onClick(e) {
|
|
305
|
-
return _onClick(e);
|
|
306
|
-
},
|
|
307
|
-
'aria-label': label,
|
|
308
|
-
'aria-selected': selected,
|
|
309
|
-
'data-p-highlight': selected,
|
|
310
|
-
'data-p-disabled': disabled
|
|
311
|
-
}, getPTOptions('item'));
|
|
312
|
-
return /*#__PURE__*/React.createElement("li", itemProps, content, /*#__PURE__*/React.createElement(Ripple, null));
|
|
313
|
-
});
|
|
314
|
-
DropdownItem.displayName = 'DropdownItem';
|
|
315
|
-
|
|
316
|
-
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
317
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
318
|
-
var DropdownPanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
319
|
-
var ptm = props.ptm,
|
|
320
|
-
cx = props.cx,
|
|
321
|
-
sx = props.sx;
|
|
322
|
-
var context = React.useContext(PrimeReactContext);
|
|
323
|
-
React.useRef(null);
|
|
324
|
-
var filterInputRef = React.useRef(null);
|
|
325
|
-
var isEmptyFilter = !(props.visibleOptions && props.visibleOptions.length) && props.hasFilter;
|
|
326
|
-
var filterOptions = {
|
|
327
|
-
filter: function filter(e) {
|
|
328
|
-
return onFilterInputChange(e);
|
|
329
|
-
},
|
|
330
|
-
reset: function reset() {
|
|
331
|
-
return props.resetFilter();
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
var getPTOptions = function getPTOptions(key, options) {
|
|
335
|
-
return ptm(key, _objectSpread$1({
|
|
336
|
-
hostName: props.hostName
|
|
337
|
-
}, options));
|
|
338
|
-
};
|
|
339
|
-
var onEnter = function onEnter() {
|
|
340
|
-
props.onEnter(function () {
|
|
341
|
-
if (props.virtualScrollerRef.current) {
|
|
342
|
-
var selectedIndex = props.getSelectedOptionIndex();
|
|
343
|
-
if (selectedIndex !== -1) {
|
|
344
|
-
setTimeout(function () {
|
|
345
|
-
return props.virtualScrollerRef.current.scrollToIndex(selectedIndex);
|
|
346
|
-
}, 0);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
};
|
|
351
|
-
var onEntered = function onEntered() {
|
|
352
|
-
props.onEntered(function () {
|
|
353
|
-
if (props.filter && props.filterInputAutoFocus) {
|
|
354
|
-
DomHandler.focus(filterInputRef.current, false);
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
};
|
|
358
|
-
var onFilterInputChange = function onFilterInputChange(event) {
|
|
359
|
-
props.virtualScrollerRef.current && props.virtualScrollerRef.current.scrollToIndex(0);
|
|
360
|
-
props.onFilterInputChange && props.onFilterInputChange(event);
|
|
361
|
-
};
|
|
362
|
-
var createFooter = function createFooter() {
|
|
363
|
-
if (props.panelFooterTemplate) {
|
|
364
|
-
var content = ObjectUtils.getJSXElement(props.panelFooterTemplate, props, props.onOverlayHide);
|
|
365
|
-
var footerProps = mergeProps({
|
|
366
|
-
className: cx('footer')
|
|
367
|
-
}, getPTOptions('footer'));
|
|
368
|
-
return /*#__PURE__*/React.createElement("div", footerProps, content);
|
|
369
|
-
}
|
|
370
|
-
return null;
|
|
371
|
-
};
|
|
372
|
-
var createGroupChildren = function createGroupChildren(optionGroup, style) {
|
|
373
|
-
var groupChildren = props.getOptionGroupChildren(optionGroup);
|
|
374
|
-
return groupChildren.map(function (option, j) {
|
|
375
|
-
var optionLabel = props.getOptionLabel(option);
|
|
376
|
-
var optionKey = j + '_' + props.getOptionRenderKey(option);
|
|
377
|
-
var disabled = props.isOptionDisabled(option);
|
|
378
|
-
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
379
|
-
key: optionKey,
|
|
380
|
-
label: optionLabel,
|
|
381
|
-
option: option,
|
|
382
|
-
style: style,
|
|
383
|
-
template: props.itemTemplate,
|
|
384
|
-
selected: props.isSelected(option),
|
|
385
|
-
disabled: disabled,
|
|
386
|
-
onClick: props.onOptionClick,
|
|
387
|
-
ptm: ptm,
|
|
388
|
-
cx: cx
|
|
389
|
-
});
|
|
390
|
-
});
|
|
391
|
-
};
|
|
392
|
-
var createEmptyMessage = function createEmptyMessage(emptyMessage, isFilter) {
|
|
393
|
-
var message = ObjectUtils.getJSXElement(emptyMessage, props) || localeOption(isFilter ? 'emptyFilterMessage' : 'emptyMessage');
|
|
394
|
-
var emptyMessageProps = mergeProps({
|
|
395
|
-
className: cx('emptyMessage')
|
|
396
|
-
}, getPTOptions('emptyMessage'));
|
|
397
|
-
return /*#__PURE__*/React.createElement("li", emptyMessageProps, message);
|
|
398
|
-
};
|
|
399
|
-
var createItem = function createItem(option, index) {
|
|
400
|
-
var scrollerOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
401
|
-
var style = {
|
|
402
|
-
height: scrollerOptions.props ? scrollerOptions.props.itemSize : undefined
|
|
403
|
-
};
|
|
404
|
-
style = _objectSpread$1(_objectSpread$1({}, style), option.style);
|
|
405
|
-
if (props.optionGroupLabel) {
|
|
406
|
-
var groupContent = props.optionGroupTemplate ? ObjectUtils.getJSXElement(props.optionGroupTemplate, option, index) : props.getOptionGroupLabel(option);
|
|
407
|
-
var groupChildrenContent = createGroupChildren(option, style);
|
|
408
|
-
var key = index + '_' + props.getOptionGroupRenderKey(option);
|
|
409
|
-
var itemGroupProps = mergeProps({
|
|
410
|
-
className: cx('itemGroup'),
|
|
411
|
-
style: style
|
|
412
|
-
}, getPTOptions('itemGroup'));
|
|
413
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
414
|
-
key: key
|
|
415
|
-
}, /*#__PURE__*/React.createElement("li", itemGroupProps, groupContent), groupChildrenContent);
|
|
416
|
-
} else {
|
|
417
|
-
var optionLabel = props.getOptionLabel(option);
|
|
418
|
-
var optionKey = index + '_' + props.getOptionRenderKey(option);
|
|
419
|
-
var disabled = props.isOptionDisabled(option);
|
|
420
|
-
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
421
|
-
key: optionKey,
|
|
422
|
-
label: optionLabel,
|
|
423
|
-
option: option,
|
|
424
|
-
style: style,
|
|
425
|
-
template: props.itemTemplate,
|
|
426
|
-
selected: props.isSelected(option),
|
|
427
|
-
disabled: disabled,
|
|
428
|
-
onClick: props.onOptionClick,
|
|
429
|
-
ptm: ptm,
|
|
430
|
-
cx: cx
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
var createItems = function createItems() {
|
|
435
|
-
if (ObjectUtils.isNotEmpty(props.visibleOptions)) {
|
|
436
|
-
return props.visibleOptions.map(createItem);
|
|
437
|
-
} else if (props.hasFilter) {
|
|
438
|
-
return createEmptyMessage(props.emptyFilterMessage, true);
|
|
439
|
-
}
|
|
440
|
-
return createEmptyMessage(props.emptyMessage);
|
|
441
|
-
};
|
|
442
|
-
var createFilterClearIcon = function createFilterClearIcon() {
|
|
443
|
-
if (props.showFilterClear && props.filterValue) {
|
|
444
|
-
var ariaLabel = localeOption('clear');
|
|
445
|
-
var clearIconProps = mergeProps({
|
|
446
|
-
className: cx('clearIcon'),
|
|
447
|
-
'aria-label': ariaLabel,
|
|
448
|
-
onClick: function onClick() {
|
|
449
|
-
return props.onFilterClearIconClick(function () {
|
|
450
|
-
return DomHandler.focus(filterInputRef.current);
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
}, getPTOptions('clearIcon'));
|
|
454
|
-
var icon = props.filterClearIcon || /*#__PURE__*/React.createElement(TimesIcon, clearIconProps);
|
|
455
|
-
var filterClearIcon = IconUtils.getJSXIcon(icon, _objectSpread$1({}, clearIconProps), {
|
|
456
|
-
props: props
|
|
457
|
-
});
|
|
458
|
-
return filterClearIcon;
|
|
459
|
-
}
|
|
460
|
-
return null;
|
|
461
|
-
};
|
|
462
|
-
var createFilter = function createFilter() {
|
|
463
|
-
if (props.filter) {
|
|
464
|
-
var clearIcon = createFilterClearIcon();
|
|
465
|
-
var filterIconProps = mergeProps({
|
|
466
|
-
className: cx('filterIcon')
|
|
467
|
-
}, getPTOptions('filterIcon'));
|
|
468
|
-
var icon = props.filterIcon || /*#__PURE__*/React.createElement(SearchIcon, filterIconProps);
|
|
469
|
-
var filterIcon = IconUtils.getJSXIcon(icon, _objectSpread$1({}, filterIconProps), {
|
|
470
|
-
props: props
|
|
471
|
-
});
|
|
472
|
-
var filterContainerProps = mergeProps({
|
|
473
|
-
className: cx('filterContainer', {
|
|
474
|
-
clearIcon: clearIcon
|
|
475
|
-
})
|
|
476
|
-
}, getPTOptions('filterContainer'));
|
|
477
|
-
var filterInputProps = mergeProps({
|
|
478
|
-
ref: filterInputRef,
|
|
479
|
-
type: 'text',
|
|
480
|
-
autoComplete: 'off',
|
|
481
|
-
className: cx('filterInput'),
|
|
482
|
-
placeholder: props.filterPlaceholder,
|
|
483
|
-
onKeyDown: props.onFilterInputKeyDown,
|
|
484
|
-
onChange: function onChange(e) {
|
|
485
|
-
return onFilterInputChange(e);
|
|
486
|
-
},
|
|
487
|
-
value: props.filterValue
|
|
488
|
-
}, getPTOptions('filterInput'));
|
|
489
|
-
var content = /*#__PURE__*/React.createElement("div", filterContainerProps, /*#__PURE__*/React.createElement("input", filterInputProps), clearIcon, filterIcon);
|
|
490
|
-
if (props.filterTemplate) {
|
|
491
|
-
var defaultContentOptions = {
|
|
492
|
-
className: classNames('p-dropdown-filter-container', {
|
|
493
|
-
'p-dropdown-clearable-filter': !!clearIcon
|
|
494
|
-
}),
|
|
495
|
-
element: content,
|
|
496
|
-
filterOptions: filterOptions,
|
|
497
|
-
filterInputKeyDown: props.onFilterInputKeyDown,
|
|
498
|
-
filterInputChange: onFilterInputChange,
|
|
499
|
-
filterIconClassName: 'p-dropdown-filter-icon',
|
|
500
|
-
clearIcon: clearIcon,
|
|
501
|
-
props: props
|
|
502
|
-
};
|
|
503
|
-
content = ObjectUtils.getJSXElement(props.filterTemplate, defaultContentOptions);
|
|
504
|
-
}
|
|
505
|
-
var headerProps = mergeProps({
|
|
506
|
-
className: cx('header')
|
|
507
|
-
}, getPTOptions('header'));
|
|
508
|
-
return /*#__PURE__*/React.createElement("div", headerProps, content);
|
|
509
|
-
}
|
|
510
|
-
return null;
|
|
511
|
-
};
|
|
512
|
-
var createContent = function createContent() {
|
|
513
|
-
if (props.virtualScrollerOptions) {
|
|
514
|
-
var virtualScrollerProps = _objectSpread$1(_objectSpread$1({}, props.virtualScrollerOptions), {
|
|
515
|
-
style: _objectSpread$1(_objectSpread$1({}, props.virtualScrollerOptions.style), {
|
|
516
|
-
height: props.scrollHeight
|
|
517
|
-
}),
|
|
518
|
-
className: classNames('p-dropdown-items-wrapper', props.virtualScrollerOptions.className),
|
|
519
|
-
items: props.visibleOptions,
|
|
520
|
-
autoSize: true,
|
|
521
|
-
onLazyLoad: function onLazyLoad(event) {
|
|
522
|
-
return props.virtualScrollerOptions.onLazyLoad(_objectSpread$1(_objectSpread$1({}, event), {
|
|
523
|
-
filter: props.filterValue
|
|
524
|
-
}));
|
|
525
|
-
},
|
|
526
|
-
itemTemplate: function itemTemplate(item, options) {
|
|
527
|
-
return item && createItem(item, options.index, options);
|
|
528
|
-
},
|
|
529
|
-
contentTemplate: function contentTemplate(options) {
|
|
530
|
-
var emptyMessage = props.hasFilter ? props.emptyFilterMessage : props.emptyMessage;
|
|
531
|
-
var content = isEmptyFilter ? createEmptyMessage(emptyMessage) : options.children;
|
|
532
|
-
var listProps = mergeProps({
|
|
533
|
-
ref: options.contentRef,
|
|
534
|
-
style: options.style,
|
|
535
|
-
className: classNames(options.className, cx('list', {
|
|
536
|
-
virtualScrollerProps: props.virtualScrollerOptions
|
|
537
|
-
})),
|
|
538
|
-
role: 'listbox'
|
|
539
|
-
}, getPTOptions('list'));
|
|
540
|
-
return /*#__PURE__*/React.createElement("ul", listProps, content);
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
return /*#__PURE__*/React.createElement(VirtualScroller, _extends({
|
|
544
|
-
ref: props.virtualScrollerRef
|
|
545
|
-
}, virtualScrollerProps, {
|
|
546
|
-
pt: ptm('virtualScroller')
|
|
547
|
-
}));
|
|
548
|
-
} else {
|
|
549
|
-
var items = createItems();
|
|
550
|
-
var wrapperProps = mergeProps({
|
|
551
|
-
className: cx('wrapper'),
|
|
552
|
-
style: sx('wrapper')
|
|
553
|
-
}, getPTOptions('wrapper'));
|
|
554
|
-
var listProps = mergeProps({
|
|
555
|
-
className: cx('list'),
|
|
556
|
-
role: 'listbox'
|
|
557
|
-
}, getPTOptions('list'));
|
|
558
|
-
return /*#__PURE__*/React.createElement("div", wrapperProps, /*#__PURE__*/React.createElement("ul", listProps, items));
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
var createElement = function createElement() {
|
|
562
|
-
var filter = createFilter();
|
|
563
|
-
var content = createContent();
|
|
564
|
-
var footer = createFooter();
|
|
565
|
-
var panelProps = mergeProps({
|
|
566
|
-
className: classNames(props.panelClassName, cx('panel', {
|
|
567
|
-
context: context
|
|
568
|
-
})),
|
|
569
|
-
style: sx('panel'),
|
|
570
|
-
onClick: props.onClick
|
|
571
|
-
}, getPTOptions('panel'));
|
|
572
|
-
var transitionProps = mergeProps({
|
|
573
|
-
classNames: cx('transition'),
|
|
574
|
-
"in": props["in"],
|
|
575
|
-
timeout: {
|
|
576
|
-
enter: 120,
|
|
577
|
-
exit: 100
|
|
578
|
-
},
|
|
579
|
-
options: props.transitionOptions,
|
|
580
|
-
unmountOnExit: true,
|
|
581
|
-
onEnter: onEnter,
|
|
582
|
-
onEntered: onEntered,
|
|
583
|
-
onExit: props.onExit,
|
|
584
|
-
onExited: props.onExited
|
|
585
|
-
}, getPTOptions('transition'));
|
|
586
|
-
return /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
587
|
-
nodeRef: ref
|
|
588
|
-
}, transitionProps), /*#__PURE__*/React.createElement("div", _extends({
|
|
589
|
-
ref: ref
|
|
590
|
-
}, panelProps), filter, content, footer));
|
|
591
|
-
};
|
|
592
|
-
var element = createElement();
|
|
593
|
-
return /*#__PURE__*/React.createElement(Portal, {
|
|
594
|
-
element: element,
|
|
595
|
-
appendTo: props.appendTo
|
|
596
|
-
});
|
|
597
|
-
}));
|
|
598
|
-
DropdownPanel.displayName = 'DropdownPanel';
|
|
599
|
-
|
|
600
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
601
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
602
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
603
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
604
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
605
|
-
var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
606
|
-
var context = React.useContext(PrimeReactContext);
|
|
607
|
-
var props = DropdownBase.getProps(inProps, context);
|
|
608
|
-
var _React$useState = React.useState(''),
|
|
609
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
610
|
-
filterState = _React$useState2[0],
|
|
611
|
-
setFilterState = _React$useState2[1];
|
|
612
|
-
var _React$useState3 = React.useState(false),
|
|
613
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
614
|
-
focusedState = _React$useState4[0],
|
|
615
|
-
setFocusedState = _React$useState4[1];
|
|
616
|
-
var _React$useState5 = React.useState(false),
|
|
617
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
618
|
-
overlayVisibleState = _React$useState6[0],
|
|
619
|
-
setOverlayVisibleState = _React$useState6[1];
|
|
620
|
-
var elementRef = React.useRef(null);
|
|
621
|
-
var overlayRef = React.useRef(null);
|
|
622
|
-
var inputRef = React.useRef(props.inputRef);
|
|
623
|
-
var focusInputRef = React.useRef(props.focusInputRef);
|
|
624
|
-
var virtualScrollerRef = React.useRef(null);
|
|
625
|
-
var searchTimeout = React.useRef(null);
|
|
626
|
-
var searchValue = React.useRef(null);
|
|
627
|
-
var currentSearchChar = React.useRef(null);
|
|
628
|
-
var isLazy = props.virtualScrollerOptions && props.virtualScrollerOptions.lazy;
|
|
629
|
-
var hasFilter = ObjectUtils.isNotEmpty(filterState);
|
|
630
|
-
var appendTo = props.appendTo || context && context.appendTo || PrimeReact.appendTo;
|
|
631
|
-
var _DropdownBase$setMeta = DropdownBase.setMetaData(_objectSpread(_objectSpread({
|
|
632
|
-
props: props
|
|
633
|
-
}, props.__parentMetadata), {}, {
|
|
634
|
-
state: {
|
|
635
|
-
filter: filterState,
|
|
636
|
-
focused: focusedState,
|
|
637
|
-
overlayVisible: overlayVisibleState
|
|
638
|
-
}
|
|
639
|
-
})),
|
|
640
|
-
ptm = _DropdownBase$setMeta.ptm,
|
|
641
|
-
cx = _DropdownBase$setMeta.cx,
|
|
642
|
-
sx = _DropdownBase$setMeta.sx,
|
|
643
|
-
isUnstyled = _DropdownBase$setMeta.isUnstyled;
|
|
644
|
-
useHandleStyle(DropdownBase.css.styles, isUnstyled, {
|
|
645
|
-
name: 'dropdown'
|
|
646
|
-
});
|
|
647
|
-
var _useOverlayListener = useOverlayListener({
|
|
648
|
-
target: elementRef,
|
|
649
|
-
overlay: overlayRef,
|
|
650
|
-
listener: function listener(event, _ref) {
|
|
651
|
-
var type = _ref.type,
|
|
652
|
-
valid = _ref.valid;
|
|
653
|
-
if (valid) {
|
|
654
|
-
type === 'outside' ? !isClearClicked(event) && hide() : hide();
|
|
655
|
-
}
|
|
656
|
-
},
|
|
657
|
-
when: overlayVisibleState
|
|
658
|
-
}),
|
|
659
|
-
_useOverlayListener2 = _slicedToArray(_useOverlayListener, 2),
|
|
660
|
-
bindOverlayListener = _useOverlayListener2[0],
|
|
661
|
-
unbindOverlayListener = _useOverlayListener2[1];
|
|
662
|
-
var getVisibleOptions = function getVisibleOptions() {
|
|
663
|
-
if (hasFilter && !isLazy) {
|
|
664
|
-
var filterValue = filterState.trim().toLocaleLowerCase(props.filterLocale);
|
|
665
|
-
var searchFields = props.filterBy ? props.filterBy.split(',') : [props.optionLabel || 'label'];
|
|
666
|
-
if (props.optionGroupLabel) {
|
|
667
|
-
var filteredGroups = [];
|
|
668
|
-
var _iterator = _createForOfIteratorHelper(props.options),
|
|
669
|
-
_step;
|
|
670
|
-
try {
|
|
671
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
672
|
-
var optgroup = _step.value;
|
|
673
|
-
var filteredSubOptions = FilterService.filter(getOptionGroupChildren(optgroup), searchFields, filterValue, props.filterMatchMode, props.filterLocale);
|
|
674
|
-
if (filteredSubOptions && filteredSubOptions.length) {
|
|
675
|
-
filteredGroups.push(_objectSpread(_objectSpread({}, optgroup), _defineProperty({}, "".concat(props.optionGroupChildren), filteredSubOptions)));
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
} catch (err) {
|
|
679
|
-
_iterator.e(err);
|
|
680
|
-
} finally {
|
|
681
|
-
_iterator.f();
|
|
682
|
-
}
|
|
683
|
-
return filteredGroups;
|
|
684
|
-
} else {
|
|
685
|
-
return FilterService.filter(props.options, searchFields, filterValue, props.filterMatchMode, props.filterLocale);
|
|
686
|
-
}
|
|
687
|
-
} else {
|
|
688
|
-
return props.options;
|
|
689
|
-
}
|
|
690
|
-
};
|
|
691
|
-
var isClearClicked = function isClearClicked(event) {
|
|
692
|
-
return DomHandler.hasClass(event.target, 'p-dropdown-clear-icon') || DomHandler.hasClass(event.target, 'p-dropdown-filter-clear-icon');
|
|
693
|
-
};
|
|
694
|
-
var _onClick = function onClick(event) {
|
|
695
|
-
if (props.disabled) {
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
props.onClick && props.onClick(event);
|
|
699
|
-
|
|
700
|
-
// do not continue if the user defined click wants to prevent it
|
|
701
|
-
if (event.defaultPrevented) {
|
|
702
|
-
return;
|
|
703
|
-
}
|
|
704
|
-
if (DomHandler.hasClass(event.target, 'p-dropdown-clear-icon') || event.target.tagName === 'INPUT') {
|
|
705
|
-
return;
|
|
706
|
-
} else if (!overlayRef.current || !(overlayRef.current && overlayRef.current.contains(event.target))) {
|
|
707
|
-
DomHandler.focus(focusInputRef.current);
|
|
708
|
-
overlayVisibleState ? hide() : show();
|
|
709
|
-
}
|
|
710
|
-
};
|
|
711
|
-
var onInputFocus = function onInputFocus(event) {
|
|
712
|
-
if (props.showOnFocus && !overlayVisibleState) {
|
|
713
|
-
show();
|
|
714
|
-
}
|
|
715
|
-
setFocusedState(true);
|
|
716
|
-
props.onFocus && props.onFocus(event);
|
|
717
|
-
};
|
|
718
|
-
var onInputBlur = function onInputBlur(event) {
|
|
719
|
-
setFocusedState(false);
|
|
720
|
-
if (props.onBlur) {
|
|
721
|
-
setTimeout(function () {
|
|
722
|
-
var currentValue = inputRef.current ? inputRef.current.value : undefined;
|
|
723
|
-
props.onBlur({
|
|
724
|
-
originalEvent: event.originalEvent,
|
|
725
|
-
value: currentValue,
|
|
726
|
-
stopPropagation: function stopPropagation() {
|
|
727
|
-
event.originalEvent.stopPropagation();
|
|
728
|
-
},
|
|
729
|
-
preventDefault: function preventDefault() {
|
|
730
|
-
event.originalEvent.preventDefault();
|
|
731
|
-
},
|
|
732
|
-
target: {
|
|
733
|
-
name: props.name,
|
|
734
|
-
id: props.id,
|
|
735
|
-
value: currentValue
|
|
736
|
-
}
|
|
737
|
-
});
|
|
738
|
-
}, 200);
|
|
739
|
-
}
|
|
740
|
-
};
|
|
741
|
-
var onPanelClick = function onPanelClick(event) {
|
|
742
|
-
OverlayService.emit('overlay-click', {
|
|
743
|
-
originalEvent: event,
|
|
744
|
-
target: elementRef.current
|
|
745
|
-
});
|
|
746
|
-
};
|
|
747
|
-
var onInputKeyDown = function onInputKeyDown(event) {
|
|
748
|
-
switch (event.which) {
|
|
749
|
-
//down
|
|
750
|
-
case 40:
|
|
751
|
-
onDownKey(event);
|
|
752
|
-
break;
|
|
753
|
-
|
|
754
|
-
//up
|
|
755
|
-
case 38:
|
|
756
|
-
onUpKey(event);
|
|
757
|
-
break;
|
|
758
|
-
|
|
759
|
-
//space and enter
|
|
760
|
-
case 32:
|
|
761
|
-
case 13:
|
|
762
|
-
overlayVisibleState ? hide() : show();
|
|
763
|
-
event.preventDefault();
|
|
764
|
-
break;
|
|
765
|
-
|
|
766
|
-
//escape and tab
|
|
767
|
-
case 27:
|
|
768
|
-
case 9:
|
|
769
|
-
hide();
|
|
770
|
-
break;
|
|
771
|
-
default:
|
|
772
|
-
search(event);
|
|
773
|
-
break;
|
|
774
|
-
}
|
|
775
|
-
};
|
|
776
|
-
var onFilterInputKeyDown = function onFilterInputKeyDown(event) {
|
|
777
|
-
switch (event.which) {
|
|
778
|
-
//down
|
|
779
|
-
case 40:
|
|
780
|
-
onDownKey(event);
|
|
781
|
-
break;
|
|
782
|
-
|
|
783
|
-
//up
|
|
784
|
-
case 38:
|
|
785
|
-
onUpKey(event);
|
|
786
|
-
break;
|
|
787
|
-
|
|
788
|
-
//enter and escape
|
|
789
|
-
case 13:
|
|
790
|
-
case 27:
|
|
791
|
-
hide();
|
|
792
|
-
event.preventDefault();
|
|
793
|
-
break;
|
|
794
|
-
}
|
|
795
|
-
};
|
|
796
|
-
var onUpKey = function onUpKey(event) {
|
|
797
|
-
if (visibleOptions) {
|
|
798
|
-
var prevOption = findPrevOption(getSelectedOptionIndex());
|
|
799
|
-
if (prevOption) {
|
|
800
|
-
selectItem({
|
|
801
|
-
originalEvent: event,
|
|
802
|
-
option: prevOption
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
event.preventDefault();
|
|
807
|
-
};
|
|
808
|
-
var onDownKey = function onDownKey(event) {
|
|
809
|
-
if (visibleOptions) {
|
|
810
|
-
if (!overlayVisibleState && event.altKey) {
|
|
811
|
-
show();
|
|
812
|
-
} else {
|
|
813
|
-
var nextOption = findNextOption(getSelectedOptionIndex());
|
|
814
|
-
if (nextOption) {
|
|
815
|
-
selectItem({
|
|
816
|
-
originalEvent: event,
|
|
817
|
-
option: nextOption
|
|
818
|
-
});
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
event.preventDefault();
|
|
823
|
-
};
|
|
824
|
-
var findNextOption = function findNextOption(index) {
|
|
825
|
-
if (props.optionGroupLabel) {
|
|
826
|
-
var groupIndex = index === -1 ? 0 : index.group;
|
|
827
|
-
var optionIndex = index === -1 ? -1 : index.option;
|
|
828
|
-
var option = findNextOptionInList(getOptionGroupChildren(visibleOptions[groupIndex]), optionIndex);
|
|
829
|
-
if (option) return option;else if (groupIndex + 1 !== visibleOptions.length) return findNextOption({
|
|
830
|
-
group: groupIndex + 1,
|
|
831
|
-
option: -1
|
|
832
|
-
});else return null;
|
|
833
|
-
}
|
|
834
|
-
return findNextOptionInList(visibleOptions, index);
|
|
835
|
-
};
|
|
836
|
-
var findNextOptionInList = function findNextOptionInList(list, index) {
|
|
837
|
-
var i = index + 1;
|
|
838
|
-
if (i === list.length) {
|
|
839
|
-
return null;
|
|
840
|
-
}
|
|
841
|
-
var option = list[i];
|
|
842
|
-
return isOptionDisabled(option) ? findNextOptionInList(i) : option;
|
|
843
|
-
};
|
|
844
|
-
var findPrevOption = function findPrevOption(index) {
|
|
845
|
-
if (index === -1) {
|
|
846
|
-
return null;
|
|
847
|
-
}
|
|
848
|
-
if (props.optionGroupLabel) {
|
|
849
|
-
var groupIndex = index.group;
|
|
850
|
-
var optionIndex = index.option;
|
|
851
|
-
var option = findPrevOptionInList(getOptionGroupChildren(visibleOptions[groupIndex]), optionIndex);
|
|
852
|
-
if (option) return option;else if (groupIndex > 0) return findPrevOption({
|
|
853
|
-
group: groupIndex - 1,
|
|
854
|
-
option: getOptionGroupChildren(visibleOptions[groupIndex - 1]).length
|
|
855
|
-
});else return null;
|
|
856
|
-
}
|
|
857
|
-
return findPrevOptionInList(visibleOptions, index);
|
|
858
|
-
};
|
|
859
|
-
var findPrevOptionInList = function findPrevOptionInList(list, index) {
|
|
860
|
-
var i = index - 1;
|
|
861
|
-
if (i < 0) {
|
|
862
|
-
return null;
|
|
863
|
-
}
|
|
864
|
-
var option = list[i];
|
|
865
|
-
return isOptionDisabled(option) ? findPrevOption(i) : option;
|
|
866
|
-
};
|
|
867
|
-
var search = function search(event) {
|
|
868
|
-
if (searchTimeout.current) {
|
|
869
|
-
clearTimeout(searchTimeout.current);
|
|
870
|
-
}
|
|
871
|
-
var _char = event.key;
|
|
872
|
-
if (_char === 'Shift' || _char === 'Control' || _char === 'Alt') {
|
|
873
|
-
return;
|
|
874
|
-
}
|
|
875
|
-
if (currentSearchChar.current === _char) searchValue.current = _char;else searchValue.current = searchValue.current ? searchValue.current + _char : _char;
|
|
876
|
-
currentSearchChar.current = _char;
|
|
877
|
-
if (searchValue.current) {
|
|
878
|
-
var searchIndex = getSelectedOptionIndex();
|
|
879
|
-
var newOption = props.optionGroupLabel ? searchOptionInGroup(searchIndex) : searchOption(searchIndex + 1);
|
|
880
|
-
if (newOption) {
|
|
881
|
-
selectItem({
|
|
882
|
-
originalEvent: event,
|
|
883
|
-
option: newOption
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
searchTimeout.current = setTimeout(function () {
|
|
888
|
-
searchValue.current = null;
|
|
889
|
-
}, 250);
|
|
890
|
-
};
|
|
891
|
-
var searchOption = function searchOption(index) {
|
|
892
|
-
if (searchValue.current) {
|
|
893
|
-
return searchOptionInRange(index, visibleOptions.length) || searchOptionInRange(0, index);
|
|
894
|
-
}
|
|
895
|
-
return null;
|
|
896
|
-
};
|
|
897
|
-
var searchOptionInRange = function searchOptionInRange(start, end) {
|
|
898
|
-
for (var i = start; i < end; i++) {
|
|
899
|
-
var opt = visibleOptions[i];
|
|
900
|
-
if (matchesSearchValue(opt)) {
|
|
901
|
-
return opt;
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
return null;
|
|
905
|
-
};
|
|
906
|
-
var searchOptionInGroup = function searchOptionInGroup(index) {
|
|
907
|
-
var searchIndex = index === -1 ? {
|
|
908
|
-
group: 0,
|
|
909
|
-
option: -1
|
|
910
|
-
} : index;
|
|
911
|
-
for (var i = searchIndex.group; i < visibleOptions.length; i++) {
|
|
912
|
-
var groupOptions = getOptionGroupChildren(visibleOptions[i]);
|
|
913
|
-
for (var j = searchIndex.group === i ? searchIndex.option + 1 : 0; j < groupOptions.length; j++) {
|
|
914
|
-
if (matchesSearchValue(groupOptions[j])) {
|
|
915
|
-
return groupOptions[j];
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
for (var _i = 0; _i <= searchIndex.group; _i++) {
|
|
920
|
-
var _groupOptions = getOptionGroupChildren(visibleOptions[_i]);
|
|
921
|
-
for (var _j = 0; _j < (searchIndex.group === _i ? searchIndex.option : _groupOptions.length); _j++) {
|
|
922
|
-
if (matchesSearchValue(_groupOptions[_j])) {
|
|
923
|
-
return _groupOptions[_j];
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
return null;
|
|
928
|
-
};
|
|
929
|
-
var matchesSearchValue = function matchesSearchValue(option) {
|
|
930
|
-
var label = getOptionLabel(option);
|
|
931
|
-
if (!label) {
|
|
932
|
-
return false;
|
|
933
|
-
}
|
|
934
|
-
label = label.toLocaleLowerCase(props.filterLocale);
|
|
935
|
-
return label.startsWith(searchValue.current.toLocaleLowerCase(props.filterLocale));
|
|
936
|
-
};
|
|
937
|
-
var onEditableInputChange = function onEditableInputChange(event) {
|
|
938
|
-
if (props.onChange) {
|
|
939
|
-
props.onChange({
|
|
940
|
-
originalEvent: event.originalEvent,
|
|
941
|
-
value: event.target.value,
|
|
942
|
-
stopPropagation: function stopPropagation() {
|
|
943
|
-
event.originalEvent.stopPropagation();
|
|
944
|
-
},
|
|
945
|
-
preventDefault: function preventDefault() {
|
|
946
|
-
event.originalEvent.preventDefault();
|
|
947
|
-
},
|
|
948
|
-
target: {
|
|
949
|
-
name: props.name,
|
|
950
|
-
id: props.id,
|
|
951
|
-
value: event.target.value
|
|
952
|
-
}
|
|
953
|
-
});
|
|
954
|
-
}
|
|
955
|
-
};
|
|
956
|
-
var onEditableInputFocus = function onEditableInputFocus(event) {
|
|
957
|
-
setFocusedState(true);
|
|
958
|
-
hide();
|
|
959
|
-
props.onFocus && props.onFocus(event);
|
|
960
|
-
};
|
|
961
|
-
var onOptionClick = function onOptionClick(event) {
|
|
962
|
-
var option = event.option;
|
|
963
|
-
if (!option.disabled) {
|
|
964
|
-
selectItem(event);
|
|
965
|
-
DomHandler.focus(focusInputRef.current);
|
|
966
|
-
}
|
|
967
|
-
hide();
|
|
968
|
-
};
|
|
969
|
-
var onFilterInputChange = function onFilterInputChange(event) {
|
|
970
|
-
var filter = event.target.value;
|
|
971
|
-
setFilterState(filter);
|
|
972
|
-
if (props.onFilter) {
|
|
973
|
-
props.onFilter({
|
|
974
|
-
originalEvent: event,
|
|
975
|
-
filter: filter
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
};
|
|
979
|
-
var onFilterClearIconClick = function onFilterClearIconClick(callback) {
|
|
980
|
-
resetFilter(callback);
|
|
981
|
-
};
|
|
982
|
-
var resetFilter = function resetFilter(callback) {
|
|
983
|
-
setFilterState('');
|
|
984
|
-
props.onFilter && props.onFilter({
|
|
985
|
-
filter: ''
|
|
986
|
-
});
|
|
987
|
-
callback && callback();
|
|
988
|
-
};
|
|
989
|
-
var clear = function clear(event) {
|
|
990
|
-
if (props.onChange) {
|
|
991
|
-
props.onChange({
|
|
992
|
-
originalEvent: event,
|
|
993
|
-
value: undefined,
|
|
994
|
-
stopPropagation: function stopPropagation() {
|
|
995
|
-
event.stopPropagation();
|
|
996
|
-
},
|
|
997
|
-
preventDefault: function preventDefault() {
|
|
998
|
-
event.preventDefault();
|
|
999
|
-
},
|
|
1000
|
-
target: {
|
|
1001
|
-
name: props.name,
|
|
1002
|
-
id: props.id,
|
|
1003
|
-
value: undefined
|
|
1004
|
-
}
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
updateEditableLabel();
|
|
1008
|
-
};
|
|
1009
|
-
var selectItem = function selectItem(event) {
|
|
1010
|
-
if (selectedOption !== event.option) {
|
|
1011
|
-
updateEditableLabel(event.option);
|
|
1012
|
-
var optionValue = getOptionValue(event.option);
|
|
1013
|
-
if (props.onChange) {
|
|
1014
|
-
props.onChange({
|
|
1015
|
-
originalEvent: event.originalEvent,
|
|
1016
|
-
value: optionValue,
|
|
1017
|
-
stopPropagation: function stopPropagation() {
|
|
1018
|
-
event.originalEvent.stopPropagation();
|
|
1019
|
-
},
|
|
1020
|
-
preventDefault: function preventDefault() {
|
|
1021
|
-
event.originalEvent.preventDefault();
|
|
1022
|
-
},
|
|
1023
|
-
target: {
|
|
1024
|
-
name: props.name,
|
|
1025
|
-
id: props.id,
|
|
1026
|
-
value: optionValue
|
|
1027
|
-
}
|
|
1028
|
-
});
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
};
|
|
1032
|
-
var getSelectedOptionIndex = function getSelectedOptionIndex(options) {
|
|
1033
|
-
options = options || visibleOptions;
|
|
1034
|
-
if (props.value != null && options) {
|
|
1035
|
-
if (props.optionGroupLabel) {
|
|
1036
|
-
for (var i = 0; i < options.length; i++) {
|
|
1037
|
-
var selectedOptionIndex = findOptionIndexInList(props.value, getOptionGroupChildren(options[i]));
|
|
1038
|
-
if (selectedOptionIndex !== -1) {
|
|
1039
|
-
return {
|
|
1040
|
-
group: i,
|
|
1041
|
-
option: selectedOptionIndex
|
|
1042
|
-
};
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
} else {
|
|
1046
|
-
return findOptionIndexInList(props.value, options);
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
return -1;
|
|
1050
|
-
};
|
|
1051
|
-
var equalityKey = function equalityKey() {
|
|
1052
|
-
return props.optionValue ? null : props.dataKey;
|
|
1053
|
-
};
|
|
1054
|
-
var findOptionIndexInList = function findOptionIndexInList(value, list) {
|
|
1055
|
-
var key = equalityKey();
|
|
1056
|
-
return list.findIndex(function (item) {
|
|
1057
|
-
return ObjectUtils.equals(value, getOptionValue(item), key);
|
|
1058
|
-
});
|
|
1059
|
-
};
|
|
1060
|
-
var isSelected = function isSelected(option) {
|
|
1061
|
-
return ObjectUtils.equals(props.value, getOptionValue(option), equalityKey());
|
|
1062
|
-
};
|
|
1063
|
-
var show = function show() {
|
|
1064
|
-
setOverlayVisibleState(true);
|
|
1065
|
-
};
|
|
1066
|
-
var hide = function hide() {
|
|
1067
|
-
setOverlayVisibleState(false);
|
|
1068
|
-
};
|
|
1069
|
-
var onOverlayEnter = function onOverlayEnter(callback) {
|
|
1070
|
-
ZIndexUtils.set('overlay', overlayRef.current, context && context.autoZIndex || PrimeReact.autoZIndex, context && context.zIndex['overlay'] || PrimeReact.zIndex['overlay']);
|
|
1071
|
-
DomHandler.addStyles(overlayRef.current, {
|
|
1072
|
-
position: 'absolute',
|
|
1073
|
-
top: '0',
|
|
1074
|
-
left: '0'
|
|
1075
|
-
});
|
|
1076
|
-
alignOverlay();
|
|
1077
|
-
callback && callback();
|
|
1078
|
-
};
|
|
1079
|
-
var onOverlayEntered = function onOverlayEntered(callback) {
|
|
1080
|
-
callback && callback();
|
|
1081
|
-
bindOverlayListener();
|
|
1082
|
-
props.onShow && props.onShow();
|
|
1083
|
-
};
|
|
1084
|
-
var onOverlayExit = function onOverlayExit() {
|
|
1085
|
-
unbindOverlayListener();
|
|
1086
|
-
};
|
|
1087
|
-
var onOverlayExited = function onOverlayExited() {
|
|
1088
|
-
if (props.filter && props.resetFilterOnHide) {
|
|
1089
|
-
resetFilter();
|
|
1090
|
-
}
|
|
1091
|
-
ZIndexUtils.clear(overlayRef.current);
|
|
1092
|
-
props.onHide && props.onHide();
|
|
1093
|
-
};
|
|
1094
|
-
var alignOverlay = function alignOverlay() {
|
|
1095
|
-
DomHandler.alignOverlay(overlayRef.current, inputRef.current.parentElement, props.appendTo || context && context.appendTo || PrimeReact.appendTo);
|
|
1096
|
-
};
|
|
1097
|
-
var scrollInView = function scrollInView() {
|
|
1098
|
-
var highlightItem = DomHandler.findSingle(overlayRef.current, 'li.p-highlight');
|
|
1099
|
-
if (highlightItem && highlightItem.scrollIntoView) {
|
|
1100
|
-
highlightItem.scrollIntoView({
|
|
1101
|
-
block: 'nearest',
|
|
1102
|
-
inline: 'nearest'
|
|
1103
|
-
});
|
|
1104
|
-
}
|
|
1105
|
-
};
|
|
1106
|
-
var updateEditableLabel = function updateEditableLabel(option) {
|
|
1107
|
-
if (inputRef.current) {
|
|
1108
|
-
inputRef.current.value = option ? getOptionLabel(option) : props.value || '';
|
|
1109
|
-
}
|
|
1110
|
-
};
|
|
1111
|
-
var getOptionLabel = function getOptionLabel(option) {
|
|
1112
|
-
return props.optionLabel ? ObjectUtils.resolveFieldData(option, props.optionLabel) : option && option['label'] !== undefined ? option['label'] : option;
|
|
1113
|
-
};
|
|
1114
|
-
var getOptionValue = function getOptionValue(option) {
|
|
1115
|
-
return props.optionValue ? ObjectUtils.resolveFieldData(option, props.optionValue) : option && option['value'] !== undefined ? option['value'] : option;
|
|
1116
|
-
};
|
|
1117
|
-
var getOptionRenderKey = function getOptionRenderKey(option) {
|
|
1118
|
-
return props.dataKey ? ObjectUtils.resolveFieldData(option, props.dataKey) : getOptionLabel(option);
|
|
1119
|
-
};
|
|
1120
|
-
var isOptionDisabled = function isOptionDisabled(option) {
|
|
1121
|
-
if (props.optionDisabled) {
|
|
1122
|
-
return ObjectUtils.isFunction(props.optionDisabled) ? props.optionDisabled(option) : ObjectUtils.resolveFieldData(option, props.optionDisabled);
|
|
1123
|
-
}
|
|
1124
|
-
return option && option['disabled'] !== undefined ? option['disabled'] : false;
|
|
1125
|
-
};
|
|
1126
|
-
var getOptionGroupRenderKey = function getOptionGroupRenderKey(optionGroup) {
|
|
1127
|
-
return ObjectUtils.resolveFieldData(optionGroup, props.optionGroupLabel);
|
|
1128
|
-
};
|
|
1129
|
-
var getOptionGroupLabel = function getOptionGroupLabel(optionGroup) {
|
|
1130
|
-
return ObjectUtils.resolveFieldData(optionGroup, props.optionGroupLabel);
|
|
1131
|
-
};
|
|
1132
|
-
var getOptionGroupChildren = function getOptionGroupChildren(optionGroup) {
|
|
1133
|
-
return ObjectUtils.resolveFieldData(optionGroup, props.optionGroupChildren);
|
|
1134
|
-
};
|
|
1135
|
-
var updateInputField = function updateInputField() {
|
|
1136
|
-
if (props.editable && inputRef.current) {
|
|
1137
|
-
var label = selectedOption ? getOptionLabel(selectedOption) : null;
|
|
1138
|
-
var value = label || props.value || '';
|
|
1139
|
-
inputRef.current.value = value;
|
|
1140
|
-
}
|
|
1141
|
-
};
|
|
1142
|
-
var getSelectedOption = function getSelectedOption() {
|
|
1143
|
-
var index = getSelectedOptionIndex(props.options);
|
|
1144
|
-
return index !== -1 ? props.optionGroupLabel ? getOptionGroupChildren(props.options[index.group])[index.option] : props.options[index] : null;
|
|
1145
|
-
};
|
|
1146
|
-
React.useImperativeHandle(ref, function () {
|
|
1147
|
-
return {
|
|
1148
|
-
props: props,
|
|
1149
|
-
show: show,
|
|
1150
|
-
hide: hide,
|
|
1151
|
-
clear: clear,
|
|
1152
|
-
focus: function focus() {
|
|
1153
|
-
return DomHandler.focus(focusInputRef.current);
|
|
1154
|
-
},
|
|
1155
|
-
getElement: function getElement() {
|
|
1156
|
-
return elementRef.current;
|
|
1157
|
-
},
|
|
1158
|
-
getOverlay: function getOverlay() {
|
|
1159
|
-
return overlayRef.current;
|
|
1160
|
-
},
|
|
1161
|
-
getInput: function getInput() {
|
|
1162
|
-
return inputRef.current;
|
|
1163
|
-
},
|
|
1164
|
-
getFocusInput: function getFocusInput() {
|
|
1165
|
-
return focusInputRef.current;
|
|
1166
|
-
},
|
|
1167
|
-
getVirtualScroller: function getVirtualScroller() {
|
|
1168
|
-
return virtualScrollerRef.current;
|
|
1169
|
-
}
|
|
1170
|
-
};
|
|
1171
|
-
});
|
|
1172
|
-
React.useEffect(function () {
|
|
1173
|
-
ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
1174
|
-
ObjectUtils.combinedRefs(focusInputRef, props.focusInputRef);
|
|
1175
|
-
}, [inputRef, props.inputRef, focusInputRef, props.focusInputRef]);
|
|
1176
|
-
useMountEffect(function () {
|
|
1177
|
-
if (props.autoFocus) {
|
|
1178
|
-
DomHandler.focus(focusInputRef.current, props.autoFocus);
|
|
1179
|
-
}
|
|
1180
|
-
});
|
|
1181
|
-
useUpdateEffect(function () {
|
|
1182
|
-
if (overlayVisibleState && props.value) {
|
|
1183
|
-
scrollInView();
|
|
1184
|
-
}
|
|
1185
|
-
}, [overlayVisibleState, props.value]);
|
|
1186
|
-
useUpdateEffect(function () {
|
|
1187
|
-
if (overlayVisibleState && filterState && props.filter) {
|
|
1188
|
-
alignOverlay();
|
|
1189
|
-
}
|
|
1190
|
-
}, [overlayVisibleState, filterState, props.filter]);
|
|
1191
|
-
useUpdateEffect(function () {
|
|
1192
|
-
if (filterState && (!props.options || props.options.length === 0)) {
|
|
1193
|
-
setFilterState('');
|
|
1194
|
-
}
|
|
1195
|
-
updateInputField();
|
|
1196
|
-
if (inputRef.current) {
|
|
1197
|
-
inputRef.current.selectedIndex = 1;
|
|
1198
|
-
}
|
|
1199
|
-
});
|
|
1200
|
-
useUnmountEffect(function () {
|
|
1201
|
-
ZIndexUtils.clear(overlayRef.current);
|
|
1202
|
-
});
|
|
1203
|
-
var createHiddenSelect = function createHiddenSelect() {
|
|
1204
|
-
var option = {
|
|
1205
|
-
value: '',
|
|
1206
|
-
label: props.placeholder
|
|
1207
|
-
};
|
|
1208
|
-
if (selectedOption) {
|
|
1209
|
-
var optionValue = getOptionValue(selectedOption);
|
|
1210
|
-
option = {
|
|
1211
|
-
value: _typeof(optionValue) === 'object' ? props.options.findIndex(function (o) {
|
|
1212
|
-
return o === optionValue;
|
|
1213
|
-
}) : optionValue,
|
|
1214
|
-
label: getOptionLabel(selectedOption)
|
|
1215
|
-
};
|
|
1216
|
-
}
|
|
1217
|
-
var hiddenSelectedMessageProps = mergeProps({
|
|
1218
|
-
className: 'p-hidden-accessible p-dropdown-hidden-select'
|
|
1219
|
-
}, ptm('hiddenSelectedMessage'));
|
|
1220
|
-
var selectProps = mergeProps({
|
|
1221
|
-
ref: inputRef,
|
|
1222
|
-
required: props.required,
|
|
1223
|
-
defaultValue: option.value,
|
|
1224
|
-
name: props.name,
|
|
1225
|
-
tabIndex: -1,
|
|
1226
|
-
'aria-hidden': 'true'
|
|
1227
|
-
}, ptm('select'));
|
|
1228
|
-
var optionProps = mergeProps({
|
|
1229
|
-
value: option.value
|
|
1230
|
-
}, ptm('option'));
|
|
1231
|
-
return /*#__PURE__*/React.createElement("div", hiddenSelectedMessageProps, /*#__PURE__*/React.createElement("select", selectProps, /*#__PURE__*/React.createElement("option", optionProps, option.label)));
|
|
1232
|
-
};
|
|
1233
|
-
var createKeyboardHelper = function createKeyboardHelper() {
|
|
1234
|
-
var hiddenSelectedMessageProps = mergeProps({
|
|
1235
|
-
className: 'p-hidden-accessible'
|
|
1236
|
-
}, ptm('hiddenSelectedMessage'));
|
|
1237
|
-
var inputProps = mergeProps(_objectSpread({
|
|
1238
|
-
ref: focusInputRef,
|
|
1239
|
-
id: props.inputId,
|
|
1240
|
-
type: 'text',
|
|
1241
|
-
readOnly: true,
|
|
1242
|
-
'aria-haspopup': 'listbox',
|
|
1243
|
-
onFocus: onInputFocus,
|
|
1244
|
-
onBlur: onInputBlur,
|
|
1245
|
-
onKeyDown: onInputKeyDown,
|
|
1246
|
-
disabled: props.disabled,
|
|
1247
|
-
tabIndex: props.tabIndex
|
|
1248
|
-
}, ariaProps), ptm('input'));
|
|
1249
|
-
return /*#__PURE__*/React.createElement("div", hiddenSelectedMessageProps, /*#__PURE__*/React.createElement("input", inputProps));
|
|
1250
|
-
};
|
|
1251
|
-
var createLabel = function createLabel() {
|
|
1252
|
-
var label = ObjectUtils.isNotEmpty(selectedOption) ? getOptionLabel(selectedOption) : null;
|
|
1253
|
-
if (props.editable) {
|
|
1254
|
-
var value = label || props.value || '';
|
|
1255
|
-
var inputProps = mergeProps(_objectSpread({
|
|
1256
|
-
ref: inputRef,
|
|
1257
|
-
type: 'text',
|
|
1258
|
-
defaultValue: value,
|
|
1259
|
-
className: cx('input', {
|
|
1260
|
-
label: label
|
|
1261
|
-
}),
|
|
1262
|
-
disabled: props.disabled,
|
|
1263
|
-
placeholder: props.placeholder,
|
|
1264
|
-
maxLength: props.maxLength,
|
|
1265
|
-
onInput: onEditableInputChange,
|
|
1266
|
-
onFocus: onEditableInputFocus,
|
|
1267
|
-
onBlur: onInputBlur,
|
|
1268
|
-
'aria-haspopup': 'listbox'
|
|
1269
|
-
}, ariaProps), ptm('input'));
|
|
1270
|
-
return /*#__PURE__*/React.createElement("input", inputProps);
|
|
1271
|
-
} else {
|
|
1272
|
-
var content = props.valueTemplate ? ObjectUtils.getJSXElement(props.valueTemplate, selectedOption, props) : label || props.placeholder || 'empty';
|
|
1273
|
-
var _inputProps = mergeProps({
|
|
1274
|
-
ref: inputRef,
|
|
1275
|
-
className: cx('input', {
|
|
1276
|
-
label: label
|
|
1277
|
-
})
|
|
1278
|
-
}, ptm('input'));
|
|
1279
|
-
return /*#__PURE__*/React.createElement("span", _inputProps, content);
|
|
1280
|
-
}
|
|
1281
|
-
};
|
|
1282
|
-
var createClearIcon = function createClearIcon() {
|
|
1283
|
-
if (props.value != null && props.showClear && !props.disabled) {
|
|
1284
|
-
var clearIconProps = mergeProps({
|
|
1285
|
-
className: cx('clearIcon'),
|
|
1286
|
-
onPointerUp: clear
|
|
1287
|
-
}, ptm('clearIcon'));
|
|
1288
|
-
var icon = props.clearIcon || /*#__PURE__*/React.createElement(TimesIcon, clearIconProps);
|
|
1289
|
-
return IconUtils.getJSXIcon(icon, _objectSpread({}, clearIconProps), {
|
|
1290
|
-
props: props
|
|
1291
|
-
});
|
|
1292
|
-
}
|
|
1293
|
-
return null;
|
|
1294
|
-
};
|
|
1295
|
-
var createDropdownIcon = function createDropdownIcon() {
|
|
1296
|
-
var dropdownIconProps = mergeProps({
|
|
1297
|
-
className: cx('dropdownIcon')
|
|
1298
|
-
}, ptm('dropdownIcon'));
|
|
1299
|
-
var icon = props.dropdownIcon || /*#__PURE__*/React.createElement(ChevronDownIcon, dropdownIconProps);
|
|
1300
|
-
var dropdownIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, dropdownIconProps), {
|
|
1301
|
-
props: props
|
|
1302
|
-
});
|
|
1303
|
-
var ariaLabel = props.placeholder || props.ariaLabel;
|
|
1304
|
-
var triggerProps = mergeProps({
|
|
1305
|
-
className: cx('trigger'),
|
|
1306
|
-
role: 'button',
|
|
1307
|
-
'aria-haspopup': 'listbox',
|
|
1308
|
-
'aria-expanded': overlayVisibleState,
|
|
1309
|
-
'aria-label': ariaLabel
|
|
1310
|
-
}, ptm('trigger'));
|
|
1311
|
-
return /*#__PURE__*/React.createElement("div", triggerProps, dropdownIcon);
|
|
1312
|
-
};
|
|
1313
|
-
var visibleOptions = getVisibleOptions();
|
|
1314
|
-
var selectedOption = getSelectedOption();
|
|
1315
|
-
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
|
|
1316
|
-
var otherProps = DropdownBase.getOtherProps(props);
|
|
1317
|
-
var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
|
|
1318
|
-
var hiddenSelect = createHiddenSelect();
|
|
1319
|
-
var keyboardHelper = createKeyboardHelper();
|
|
1320
|
-
var labelElement = createLabel();
|
|
1321
|
-
var dropdownIcon = createDropdownIcon();
|
|
1322
|
-
var clearIcon = createClearIcon();
|
|
1323
|
-
var rootProps = mergeProps({
|
|
1324
|
-
id: props.id,
|
|
1325
|
-
ref: elementRef,
|
|
1326
|
-
className: classNames(props.className, cx('root', {
|
|
1327
|
-
focusedState: focusedState,
|
|
1328
|
-
overlayVisibleState: overlayVisibleState
|
|
1329
|
-
})),
|
|
1330
|
-
style: props.style,
|
|
1331
|
-
onClick: function onClick(e) {
|
|
1332
|
-
return _onClick(e);
|
|
1333
|
-
},
|
|
1334
|
-
onMouseDown: props.onMouseDown,
|
|
1335
|
-
onContextMenu: props.onContextMenu,
|
|
1336
|
-
'data-p-disabled': props.disabled,
|
|
1337
|
-
'data-p-focus': focusedState
|
|
1338
|
-
}, otherProps, ptm('root'));
|
|
1339
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", rootProps, keyboardHelper, hiddenSelect, labelElement, clearIcon, dropdownIcon, /*#__PURE__*/React.createElement(DropdownPanel, _extends({
|
|
1340
|
-
hostName: "Dropdown",
|
|
1341
|
-
ref: overlayRef,
|
|
1342
|
-
visibleOptions: visibleOptions,
|
|
1343
|
-
virtualScrollerRef: virtualScrollerRef
|
|
1344
|
-
}, props, {
|
|
1345
|
-
appendTo: appendTo,
|
|
1346
|
-
onClick: onPanelClick,
|
|
1347
|
-
onOptionClick: onOptionClick,
|
|
1348
|
-
filterValue: filterState,
|
|
1349
|
-
hasFilter: hasFilter,
|
|
1350
|
-
onFilterClearIconClick: onFilterClearIconClick,
|
|
1351
|
-
resetFilter: resetFilter,
|
|
1352
|
-
onFilterInputKeyDown: onFilterInputKeyDown,
|
|
1353
|
-
onFilterInputChange: onFilterInputChange,
|
|
1354
|
-
getOptionLabel: getOptionLabel,
|
|
1355
|
-
getOptionRenderKey: getOptionRenderKey,
|
|
1356
|
-
isOptionDisabled: isOptionDisabled,
|
|
1357
|
-
getOptionGroupChildren: getOptionGroupChildren,
|
|
1358
|
-
getOptionGroupLabel: getOptionGroupLabel,
|
|
1359
|
-
getOptionGroupRenderKey: getOptionGroupRenderKey,
|
|
1360
|
-
isSelected: isSelected,
|
|
1361
|
-
getSelectedOptionIndex: getSelectedOptionIndex,
|
|
1362
|
-
"in": overlayVisibleState,
|
|
1363
|
-
onEnter: onOverlayEnter,
|
|
1364
|
-
onEntered: onOverlayEntered,
|
|
1365
|
-
onExit: onOverlayExit,
|
|
1366
|
-
onExited: onOverlayExited,
|
|
1367
|
-
ptm: ptm,
|
|
1368
|
-
cx: cx,
|
|
1369
|
-
sx: sx
|
|
1370
|
-
}))), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
1371
|
-
target: elementRef,
|
|
1372
|
-
content: props.tooltip
|
|
1373
|
-
}, props.tooltipOptions, {
|
|
1374
|
-
pt: ptm('tooltip')
|
|
1375
|
-
})));
|
|
1376
|
-
}));
|
|
1377
|
-
Dropdown.displayName = 'Dropdown';
|
|
1378
|
-
|
|
1379
|
-
export { Dropdown };
|