primereact 8.4.0 → 8.6.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 +2 -4
- package/accordion/accordion.cjs.js +14 -7
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +2 -2
- package/accordion/accordion.esm.js +14 -7
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +15 -9
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +302 -286
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +9 -3
- package/api/api.esm.js +302 -287
- package/api/api.esm.min.js +1 -1
- package/api/api.js +670 -654
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +68 -64
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +45 -43
- package/autocomplete/autocomplete.esm.js +69 -65
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +68 -64
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +1 -2
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +1 -1
- package/avatar/avatar.esm.js +1 -2
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +1 -2
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +1 -2
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.d.ts +1 -1
- package/avatargroup/avatargroup.esm.js +1 -2
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +1 -2
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +1 -2
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.d.ts +1 -1
- package/badge/badge.esm.js +1 -2
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +1 -2
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +1 -2
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +1 -2
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +1 -2
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +13 -2
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.d.ts +1 -1
- package/breadcrumb/breadcrumb.esm.js +13 -2
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +13 -2
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +8 -4
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +3 -2
- package/button/button.esm.js +8 -4
- package/button/button.esm.min.js +1 -1
- package/button/button.js +8 -4
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +134 -138
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +60 -63
- package/calendar/calendar.esm.js +135 -139
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +135 -139
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +8 -9
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.js +8 -9
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +8 -9
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +1 -2
- package/card/card.cjs.min.js +1 -1
- package/card/card.d.ts +1 -1
- package/card/card.esm.js +1 -2
- package/card/card.esm.min.js +1 -1
- package/card/card.js +1 -2
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +62 -44
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.d.ts +3 -1
- package/carousel/carousel.esm.js +62 -44
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +62 -44
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +8 -8
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -2
- package/cascadeselect/cascadeselect.esm.js +8 -8
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +8 -8
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +1 -2
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +1 -2
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +1 -2
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +17 -10
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +1 -1
- package/checkbox/checkbox.esm.js +18 -11
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +17 -10
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +1 -2
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +1 -1
- package/chip/chip.esm.js +1 -2
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +1 -2
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +7 -7
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +3 -3
- package/chips/chips.esm.js +8 -8
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +7 -7
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +3 -4
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +1 -1
- package/colorpicker/colorpicker.esm.js +3 -4
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +3 -4
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.d.ts +11 -6
- package/columngroup/columngroup.d.ts +1 -1
- package/confirmdialog/confirmdialog.cjs.js +7 -4
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +8 -5
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +7 -4
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +10 -5
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +11 -6
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +10 -5
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +5 -2
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +5 -2
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +5 -2
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +1055 -982
- package/core/core.min.js +15 -15
- package/csstransition/csstransition.d.ts +2 -2
- package/datascroller/datascroller.cjs.js +2 -3
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +2 -3
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +2 -3
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +78 -34
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +106 -104
- package/datatable/datatable.esm.js +79 -35
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +78 -34
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +1 -2
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.d.ts +2 -2
- package/dataview/dataview.esm.js +1 -2
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +1 -2
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +1 -2
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.d.ts +1 -1
- package/deferredcontent/deferredcontent.esm.js +1 -2
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +1 -2
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +54 -44
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +55 -45
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +54 -44
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +1 -2
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.d.ts +1 -1
- package/divider/divider.esm.js +1 -2
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +1 -2
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +5 -2
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +1 -1
- package/dock/dock.esm.js +5 -2
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +5 -2
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +67 -71
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +1 -1
- package/dropdown/dropdown.esm.js +67 -71
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +67 -71
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +4 -5
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -1
- package/editor/editor.esm.js +4 -5
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +4 -5
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +1 -2
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +1 -1
- package/fieldset/fieldset.esm.js +1 -2
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +1 -2
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +14 -9
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +7 -6
- package/fileupload/fileupload.esm.js +14 -9
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +14 -9
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +8 -7
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +8 -7
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +8 -7
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +1 -2
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.d.ts +2 -2
- package/gmap/gmap.esm.js +1 -2
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +1 -2
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +3 -3
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +1 -1
- package/image/image.esm.js +4 -4
- package/image/image.esm.min.js +1 -1
- package/image/image.js +3 -3
- package/image/image.min.js +1 -1
- package/index.d.ts +105 -0
- package/inplace/inplace.cjs.js +4 -3
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.d.ts +1 -1
- package/inplace/inplace.esm.js +4 -3
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +5 -5
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +4 -5
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +4 -5
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +4 -5
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +40 -40
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +41 -41
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +40 -40
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +16 -19
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.d.ts +1 -1
- package/inputswitch/inputswitch.esm.js +17 -20
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +16 -19
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +1 -2
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +3 -6
- package/inputtext/inputtext.esm.js +1 -2
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +1 -2
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +1 -2
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +1 -4
- package/inputtextarea/inputtextarea.esm.js +1 -2
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +1 -2
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +3 -56
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +3 -56
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +5 -56
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +2 -3
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.d.ts +2 -2
- package/knob/knob.esm.js +2 -3
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +2 -3
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +8 -14
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +0 -1
- package/listbox/listbox.esm.js +8 -14
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +8 -14
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +5 -2
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.d.ts +1 -2
- package/megamenu/megamenu.esm.js +5 -2
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +5 -2
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +16 -21
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +16 -21
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +16 -21
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +5 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +5 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +5 -2
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +10 -2
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.d.ts +1 -1
- package/menubar/menubar.esm.js +10 -2
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +10 -2
- package/menubar/menubar.min.js +1 -1
- package/menuitem/menuitem.d.ts +1 -0
- package/message/message.cjs.js +18 -10
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +3 -1
- package/message/message.esm.js +19 -11
- package/message/message.esm.min.js +1 -1
- package/message/message.js +18 -10
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +52 -14
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +3 -0
- package/messages/messages.esm.js +53 -15
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +53 -16
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +66 -56
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +1 -1
- package/multiselect/multiselect.esm.js +67 -57
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +66 -56
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +7 -11
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +8 -12
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +8 -12
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +1 -2
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +1 -1
- package/orderlist/orderlist.esm.js +1 -2
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +1 -2
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +1 -2
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.d.ts +2 -2
- package/organizationchart/organizationchart.esm.js +1 -2
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +1 -2
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +6 -5
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +7 -6
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +6 -5
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +9 -5
- package/paginator/paginator.cjs.js +11 -15
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.d.ts +2 -2
- package/paginator/paginator.esm.js +12 -16
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +11 -15
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +1 -2
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +1 -1
- package/panel/panel.esm.js +1 -2
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +1 -2
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +9 -2
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +1 -1
- package/panelmenu/panelmenu.esm.js +9 -2
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +9 -2
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +2 -3
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +7 -5
- package/password/password.esm.js +2 -3
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -3
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +1 -2
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.d.ts +1 -1
- package/picklist/picklist.esm.js +1 -2
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +1 -2
- package/picklist/picklist.min.js +1 -1
- package/primereact.all.cjs.js +1689 -1383
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1688 -1382
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1689 -1383
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +1 -2
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.d.ts +1 -1
- package/progressbar/progressbar.esm.js +1 -2
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +1 -2
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +1 -2
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.d.ts +1 -1
- package/progressspinner/progressspinner.esm.js +1 -2
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +1 -2
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +17 -11
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +18 -12
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +17 -11
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +57 -17
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.d.ts +9 -2
- package/rating/rating.esm.js +58 -18
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +57 -17
- package/rating/rating.min.css +1 -1
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +694 -686
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +18 -11
- package/resources/themes/arya-green/theme.css +19 -10
- package/resources/themes/arya-orange/theme.css +18 -10
- package/resources/themes/arya-purple/theme.css +18 -10
- package/resources/themes/bootstrap4-dark-blue/theme.css +19 -11
- package/resources/themes/bootstrap4-dark-purple/theme.css +19 -11
- package/resources/themes/bootstrap4-light-blue/theme.css +19 -11
- package/resources/themes/bootstrap4-light-purple/theme.css +20 -11
- package/resources/themes/fluent-light/theme.css +19 -10
- package/resources/themes/lara-dark-blue/theme.css +18 -10
- package/resources/themes/lara-dark-indigo/theme.css +19 -10
- package/resources/themes/lara-dark-purple/theme.css +18 -10
- package/resources/themes/lara-dark-teal/theme.css +19 -10
- package/resources/themes/lara-light-blue/theme.css +18 -10
- package/resources/themes/lara-light-indigo/theme.css +18 -10
- package/resources/themes/lara-light-purple/theme.css +18 -10
- package/resources/themes/lara-light-teal/theme.css +18 -10
- package/resources/themes/luna-amber/theme.css +19 -12
- package/resources/themes/luna-blue/theme.css +19 -11
- package/resources/themes/luna-green/theme.css +19 -12
- package/resources/themes/luna-pink/theme.css +19 -11
- package/resources/themes/md-dark-deeppurple/theme.css +26 -18
- package/resources/themes/md-dark-indigo/theme.css +26 -19
- package/resources/themes/md-light-deeppurple/theme.css +26 -19
- package/resources/themes/md-light-indigo/theme.css +26 -19
- package/resources/themes/mdc-dark-deeppurple/theme.css +26 -19
- package/resources/themes/mdc-dark-indigo/theme.css +26 -18
- package/resources/themes/mdc-light-deeppurple/theme.css +26 -19
- package/resources/themes/mdc-light-indigo/theme.css +26 -18
- package/resources/themes/nova/theme.css +19 -11
- package/resources/themes/nova-accent/theme.css +18 -11
- package/resources/themes/nova-alt/theme.css +19 -11
- package/resources/themes/rhea/theme.css +18 -11
- package/resources/themes/saga-blue/theme.css +18 -10
- package/resources/themes/saga-green/theme.css +18 -11
- package/resources/themes/saga-orange/theme.css +18 -11
- package/resources/themes/saga-purple/theme.css +18 -11
- package/resources/themes/tailwind-light/theme.css +18 -10
- package/resources/themes/vela-blue/theme.css +18 -10
- package/resources/themes/vela-green/theme.css +18 -10
- package/resources/themes/vela-orange/theme.css +18 -10
- package/resources/themes/vela-purple/theme.css +18 -11
- package/ripple/ripple.d.ts +1 -1
- package/row/row.cjs.js +1 -2
- package/row/row.cjs.min.js +1 -1
- package/row/row.d.ts +1 -1
- package/row/row.esm.js +1 -2
- package/row/row.esm.min.js +1 -1
- package/row/row.js +1 -2
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +5 -6
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.d.ts +1 -1
- package/scrollpanel/scrollpanel.esm.js +5 -6
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +5 -6
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +1 -2
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +1 -1
- package/scrolltop/scrolltop.esm.js +1 -2
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +1 -2
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +1 -2
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.d.ts +1 -1
- package/selectbutton/selectbutton.esm.js +1 -2
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +1 -2
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +1 -1
- package/sidebar/sidebar.cjs.js +6 -5
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +1 -1
- package/sidebar/sidebar.esm.js +7 -6
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +6 -5
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +1 -2
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.d.ts +1 -1
- package/skeleton/skeleton.esm.js +1 -2
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +1 -2
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +5 -2
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +5 -2
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +5 -2
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +5 -9
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.d.ts +2 -2
- package/slider/slider.esm.js +6 -10
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +5 -9
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +8 -3
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +8 -3
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +8 -3
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +9 -2
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +2 -1
- package/splitbutton/splitbutton.esm.js +9 -2
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +9 -2
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +1 -2
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.d.ts +2 -2
- package/splitter/splitter.esm.js +1 -2
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +1 -2
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +5 -2
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +5 -2
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +5 -2
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.d.ts +1 -1
- package/tabmenu/tabmenu.cjs.js +7 -3
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.d.ts +1 -1
- package/tabmenu/tabmenu.esm.js +7 -3
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +7 -3
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +43 -23
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +6 -4
- package/tabview/tabview.esm.js +43 -23
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +44 -25
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +1 -2
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +1 -1
- package/tag/tag.esm.js +1 -2
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +1 -2
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +1 -2
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +1 -2
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +1 -2
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +7 -3
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +7 -3
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +7 -3
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +1 -2
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.d.ts +1 -1
- package/timeline/timeline.esm.js +1 -2
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +1 -2
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +266 -47
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +265 -46
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +266 -47
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +1 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +1 -1
- package/togglebutton/togglebutton.esm.js +1 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +1 -2
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +1 -2
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.d.ts +1 -1
- package/toolbar/toolbar.esm.js +1 -2
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +1 -2
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +30 -18
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +30 -18
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +30 -18
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +1 -1
- package/tree/tree.cjs.js +11 -9
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +1 -1
- package/tree/tree.esm.js +11 -9
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +12 -11
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +21 -15
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +13 -3
- package/treeselect/treeselect.esm.js +21 -15
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +21 -15
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +21 -20
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +1 -1
- package/treetable/treetable.esm.js +22 -21
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +21 -20
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +7 -11
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.d.ts +2 -2
- package/tristatecheckbox/tristatecheckbox.esm.js +8 -12
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +8 -12
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +111 -63
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +13 -10
- package/utils/utils.esm.js +111 -63
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +111 -63
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +3 -4
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +3 -4
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +3 -4
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +188 -36
- package/fullcalendar/fullcalendar.cjs.js +0 -132
- package/fullcalendar/fullcalendar.cjs.min.js +0 -1
- package/fullcalendar/fullcalendar.d.ts +0 -14
- package/fullcalendar/fullcalendar.esm.js +0 -108
- package/fullcalendar/fullcalendar.esm.min.js +0 -1
- package/fullcalendar/fullcalendar.js +0 -134
- package/fullcalendar/fullcalendar.min.js +0 -1
- package/fullcalendar/package.json +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),r=require("primereact/hooks"),n=require("primereact/utils"),l=require("primereact/button"),i=require("primereact/ripple");function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var o=a(e);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}function s(e){if(Array.isArray(e))return e}function u(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,l,i=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){o=!0,l=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw l}}return i}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){return s(e)||u(e,t)||f(e,t)||m()}function g(e){if(Array.isArray(e))return p(e)}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(e){return g(e)||v(e)||f(e)||y()}var h=o.memo((function(e){var t=!e.selection||!e.selection.length,r=n.classNames("p-picklist-buttons",e.className);return o.createElement("div",{className:r},o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-up",onClick:function(t){var r=e.selection;if(r&&r.length){for(var l=b(e.list),i=0;i<r.length;i++){var a=n.ObjectUtils.findIndexInList(r[i],l,e.dataKey);if(0===a)break;var o=l[a-1];l[a-1]=l[a],l[a]=o}e.onReorder&&e.onReorder({originalEvent:t,value:l,direction:"up"})}}}),o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-double-up",onClick:function(t){var r=e.selection;if(r&&r.length){for(var l=b(e.list),i=0;i<r.length;i++){var a=n.ObjectUtils.findIndexInList(r[i],l,e.dataKey);if(0===a)break;var o=l.splice(a,1)[0];l.unshift(o)}e.onReorder&&e.onReorder({originalEvent:t,value:l,direction:"top"})}}}),o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-down",onClick:function(t){var r=e.selection;if(r&&r.length){for(var l=b(e.list),i=r.length-1;i>=0;i--){var a=n.ObjectUtils.findIndexInList(r[i],l,e.dataKey);if(a===l.length-1)break;var o=l[a+1];l[a+1]=l[a],l[a]=o}e.onReorder&&e.onReorder({originalEvent:t,value:l,direction:"down"})}}}),o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-double-down",onClick:function(t){var r=e.selection;if(r&&r.length){for(var l=b(e.list),i=r.length-1;i>=0;i--){var a=n.ObjectUtils.findIndexInList(r[i],l,e.dataKey);if(a===l.length-1)break;var o=l.splice(a,1)[0];l.push(o)}e.onReorder&&e.onReorder({originalEvent:t,value:l,direction:"bottom"})}}}))}));h.displayName="PickListControls";var S=o.memo((function(e){var t=e.template?e.template(e.value):e.value,r=n.classNames("p-picklist-item",{"p-highlight":e.selected},e.className);return o.createElement("li",{className:r,onClick:function(t){e.onClick&&e.onClick({originalEvent:t,value:e.value})},onKeyDown:function(t){e.onKeyDown&&e.onKeyDown({originalEvent:t,value:e.value})},tabIndex:e.tabIndex,role:"option","aria-selected":e.selected},t,o.createElement(i.Ripple,null))}));S.displayName="PickListItem";var E=o.memo(o.forwardRef((function(e,t){var r=o.useRef(null),l=function(t){var r=t.originalEvent,l=t.value,i=b(e.selection),a=n.ObjectUtils.findIndexInList(l,i,e.dataKey),o=-1!==a;if(e.metaKeySelection){var c=r.metaKey||r.ctrlKey;o&&c?i.splice(a,1):(c||(i.length=0),i.push(l))}else o?i.splice(a,1):i.push(l);e.onSelectionChange&&e.onSelectionChange({event:r,value:i})},i=function(e){var t=e.originalEvent,r=t.currentTarget;switch(t.which){case 40:var n=a(r);n&&n.focus(),t.preventDefault();break;case 38:var i=c(r);i&&i.focus(),t.preventDefault();break;case 13:l(e),t.preventDefault()}},a=function e(t){var r=t.nextElementSibling;return r?n.DomHandler.hasClass(r,"p-picklist-item")?r:e(r):null},c=function e(t){var r=t.previousElementSibling;return r?n.DomHandler.hasClass(r,"p-picklist-item")?r:e(r):null},s=function(t){return-1!==n.ObjectUtils.findIndexInList(t,e.selection,e.dataKey)},u=function(t){e.onFilter&&e.onFilter({originalEvent:t,value:t.target.value,type:e.type})},p=function(e){13===e.which&&e.preventDefault()};o.useImperativeHandle(t,(function(){return{listElementRef:r}}));var f=n.classNames("p-picklist-list-wrapper",e.className),m=e.header?o.createElement("div",{className:"p-picklist-header"},n.ObjectUtils.getJSXElement(e.header,e)):null,d=function(){if(e.showFilter){var t=o.createElement("div",{className:"p-picklist-filter"},o.createElement("input",{type:"text",value:e.filterValue,onChange:u,onKeyDown:p,placeholder:e.placeholder,className:"p-picklist-filter-input p-inputtext p-component"}),o.createElement("span",{className:"p-picklist-filter-icon pi pi-search"}));if(e.filterTemplate)t=n.ObjectUtils.getJSXElement(e.filterTemplate,{className:"p-picklist-filter",inputProps:{className:"p-picklist-filter-input p-inputtext p-component",onChange:u,onKeyDown:p},iconClassName:"p-picklist-filter-icon pi pi-search",element:t,props:e});return o.createElement("div",{className:"p-picklist-filter-container"},t)}return null}(),g=function(){var t=e.list?e.list.map((function(t){var r=JSON.stringify(t),n=s(t);return o.createElement(S,{key:r,value:t,template:e.itemTemplate,selected:n,onClick:l,onKeyDown:i,tabIndex:e.tabIndex})})):null,r=n.classNames("p-picklist-list",e.listClassName);return o.createElement("ul",{className:r,style:e.style,role:"listbox","aria-multiselectable":!0},t)}();return o.createElement("div",{ref:r,className:f},m,d,g)})));E.displayName="PickListSubList";var T=o.memo((function(e){var t=n.ObjectUtils.isEmpty(e.sourceSelection)||n.ObjectUtils.isEmpty(e.visibleSourceList),r=n.ObjectUtils.isEmpty(e.targetSelection)||n.ObjectUtils.isEmpty(e.visibleTargetList),i=n.ObjectUtils.isEmpty(e.visibleSourceList),a=n.ObjectUtils.isEmpty(e.visibleTargetList),c=n.classNames("p-picklist-buttons p-picklist-transfer-buttons",e.className);return o.createElement("div",{className:c},o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-right",onClick:function(t){var r=e.sourceSelection;if(n.ObjectUtils.isNotEmpty(r)){for(var l=b(e.target),i=b(e.source),a=0;a<r.length;a++){var o=r[a];-1===n.ObjectUtils.findIndexInList(o,l,e.dataKey)&&l.push(i.splice(n.ObjectUtils.findIndexInList(o,i,e.dataKey),1)[0])}e.onTransfer&&e.onTransfer({originalEvent:t,source:i,target:l,direction:"toTarget"})}}}),o.createElement(l.Button,{disabled:i,type:"button",icon:"pi pi-angle-double-right",onClick:function(t){if(e.source){var r=[].concat(b(e.target),b(e.visibleSourceList)),n=e.source.filter((function(t){return!e.visibleSourceList.some((function(e){return e===t}))}));e.onTransfer&&e.onTransfer({originalEvent:t,source:n,target:r,direction:"allToTarget"})}}}),o.createElement(l.Button,{disabled:r,type:"button",icon:"pi pi-angle-left",onClick:function(t){var r=e.targetSelection;if(n.ObjectUtils.isNotEmpty(r)){for(var l=b(e.target),i=b(e.source),a=0;a<r.length;a++){var o=r[a];-1===n.ObjectUtils.findIndexInList(o,i,e.dataKey)&&i.push(l.splice(n.ObjectUtils.findIndexInList(o,l,e.dataKey),1)[0])}e.onTransfer&&e.onTransfer({originalEvent:t,source:i,target:l,direction:"toSource"})}}}),o.createElement(l.Button,{disabled:a,type:"button",icon:"pi pi-angle-double-left",onClick:function(t){if(e.source){var r=[].concat(b(e.source),b(e.visibleTargetList)),n=e.target.filter((function(t){return!e.visibleTargetList.some((function(e){return e===t}))}));e.onTransfer&&e.onTransfer({originalEvent:t,source:r,target:n,direction:"allToSource"})}}}))}));T.displayName="PickListTransferControls";var k=o.memo(o.forwardRef((function(e,l){var i=d(o.useState([]),2),a=i[0],s=i[1],u=d(o.useState([]),2),p=u[0],f=u[1],m=d(o.useState(""),2),g=m[0],v=m[1],y=d(o.useState(""),2),b=y[0],S=y[1],C=o.useRef(null),N=o.useRef(null),I=o.useRef(null),w=o.useRef(null),O=o.useRef(null),j=e.sourceSelection?e.sourceSelection:a,K=e.targetSelection?e.targetSelection:p,L=e.onSourceFilterChange?e.sourceFilterValue:g,F=e.onTargetFilterChange?e.targetFilterValue:b,U=n.ObjectUtils.isNotEmpty(e.filterBy),x=U&&e.showSourceFilter,R=U&&e.showTargetFilter,M=function(e,t){if(e){var r=n.DomHandler.findSingle(e,".p-picklist-list");switch(t){case"up":D(r,-1);break;case"top":r.scrollTop=0;break;case"down":D(r,1);break;case"bottom":setTimeout((function(){return r.scrollTop=r.scrollHeight}),100)}}},P=function(t,r,n){e.onChange&&e.onChange({originalEvent:t.originalEvent,source:r,target:n})},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=e.getElementsByClassName("p-highlight");n.ObjectUtils.isNotEmpty(r)&&n.DomHandler.scrollInView(e,-1===t?r[0]:r[r.length-1])},A=function(e,t,r){"sourceSelection"===t?s(e.value):f(e.value),r&&r(e),n.ObjectUtils.isNotEmpty(j)&&"targetSelection"===t?s([]):n.ObjectUtils.isNotEmpty(K)&&"sourceSelection"===t&&f([])},B=function(t){var r=t.originalEvent,n=t.value,l=d("source"===t.type?[v,e.onSourceFilterChange]:[S,e.onTargetFilterChange],2),i=l[0],a=l[1];a?a({originalEvent:r,value:n}):i(n)},H=function(e,t){var r=d("source"===t?[L,V]:[F,q],2),l=r[0],i=r[1];return U&&n.ObjectUtils.isNotEmpty(l)?i(l):e},V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=t.trim().toLocaleLowerCase(e.filterLocale);return _(e.source,r)},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=t.trim().toLocaleLowerCase(e.filterLocale);return _(e.target,r)},_=function(r,n){var l=U?e.filterBy.split(","):[];return t.FilterService.filter(r,l,n,e.filterMatchMode,e.filterLocale)};o.useImperativeHandle(l,(function(){return{props:e,getElement:function(){return C.current}}})),r.useUpdateEffect((function(){w.current&&(M(w.current,O.current),w.current=null,O.current=null)}));var J=n.ObjectUtils.findDiffKeys(e,k.defaultProps),X=n.classNames("p-picklist p-component",e.className),z=e.sourceItemTemplate?e.sourceItemTemplate:e.itemTemplate,Y=e.targetItemTemplate?e.targetItemTemplate:e.itemTemplate,$=H(e.source,"source"),G=H(e.target,"target");return o.createElement("div",c({id:e.id,ref:C,className:X,style:e.style},J),e.showSourceControls&&o.createElement(h,{list:e.source,selection:j,onReorder:function(t){P(t,t.value,e.target),w.current=N.current.listElementRef.current,O.current=t.direction},className:"p-picklist-source-controls",dataKey:e.dataKey}),o.createElement(E,{ref:N,type:"source",list:$,selection:j,onSelectionChange:function(t){return A(t,"sourceSelection",e.onSourceSelectionChange)},itemTemplate:z,header:e.sourceHeader,style:e.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:e.metaKeySelection,tabIndex:e.tabIndex,dataKey:e.dataKey,filterValue:L,onFilter:B,showFilter:x,placeholder:e.sourceFilterPlaceholder,template:e.sourceFilterTemplate}),o.createElement(T,{onTransfer:function(t){var r=t.originalEvent,n=t.source,l=t.target,i=[];switch(t.direction){case"toTarget":i=j,e.onMoveToTarget&&e.onMoveToTarget({originalEvent:r,value:i});break;case"allToTarget":i=e.source,e.onMoveAllToTarget&&e.onMoveAllToTarget({originalEvent:r,value:i});break;case"toSource":i=K,e.onMoveToSource&&e.onMoveToSource({originalEvent:r,value:i});break;case"allToSource":i=e.target,e.onMoveAllToSource&&e.onMoveAllToSource({originalEvent:r,value:i})}A({originalEvent:r,value:i},"sourceSelection",e.onSourceSelectionChange),A({originalEvent:r,value:i},"targetSelection",e.onTargetSelectionChange),P(t,n,l)},source:e.source,visibleSourceList:$,target:e.target,visibleTargetList:G,sourceSelection:j,targetSelection:K,dataKey:e.dataKey}),o.createElement(E,{ref:I,type:"target",list:G,selection:K,onSelectionChange:function(t){return A(t,"targetSelection",e.onTargetSelectionChange)},itemTemplate:Y,header:e.targetHeader,style:e.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:e.metaKeySelection,tabIndex:e.tabIndex,dataKey:e.dataKey,filterValue:F,onFilter:B,showFilter:R,placeholder:e.targetFilterPlaceholder,template:e.targetFilterTemplate}),e.showTargetControls&&o.createElement(h,{list:e.target,selection:K,onReorder:function(t){P(t,e.source,t.value),w.current=I.current.listElementRef.current,O.current=t.direction},className:"p-picklist-target-controls",dataKey:e.dataKey}))})));k.displayName="PickList",k.defaultProps={__TYPE:"PickList",id:null,source:null,target:null,sourceHeader:null,targetHeader:null,style:null,className:null,sourceStyle:null,targetStyle:null,sourceSelection:null,targetSelection:null,showSourceControls:!0,showTargetControls:!0,metaKeySelection:!0,filterBy:null,filterMatchMode:"contains",filterLocale:void 0,sourceFilterValue:null,targetFilterValue:null,showSourceFilter:!0,showTargetFilter:!0,sourceFilterPlaceholder:null,targetFilterPlaceholder:null,sourceFilterTemplate:null,targetFilterTemplate:null,tabIndex:0,dataKey:null,itemTemplate:null,sourceItemTemplate:null,targetItemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null,onSourceFilterChange:null,onTargetFilterChange:null},exports.PickList=k;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/hooks"),r=require("primereact/utils"),l=require("primereact/button"),i=require("primereact/ripple");function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=a(e);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function s(e){if(Array.isArray(e))return e}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,i=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){o=!0,l=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw l}}return i}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){return s(e)||u(e,t)||f(e,t)||m()}function g(e){if(Array.isArray(e))return p(e)}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(e){return g(e)||v(e)||f(e)||y()}var h=o.memo((function(e){var t=!e.selection||!e.selection.length,n=r.classNames("p-picklist-buttons",e.className);return o.createElement("div",{className:n},o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-up",onClick:function(t){var n=e.selection;if(n&&n.length){for(var l=b(e.list),i=0;i<n.length;i++){var a=r.ObjectUtils.findIndexInList(n[i],l,e.dataKey);if(0===a)break;var o=l[a-1];l[a-1]=l[a],l[a]=o}e.onReorder&&e.onReorder({originalEvent:t,value:l,direction:"up"})}}}),o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-double-up",onClick:function(t){var n=e.selection;if(n&&n.length){for(var l=b(e.list),i=0;i<n.length;i++){var a=r.ObjectUtils.findIndexInList(n[i],l,e.dataKey);if(0===a)break;var o=l.splice(a,1)[0];l.unshift(o)}e.onReorder&&e.onReorder({originalEvent:t,value:l,direction:"top"})}}}),o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-down",onClick:function(t){var n=e.selection;if(n&&n.length){for(var l=b(e.list),i=n.length-1;i>=0;i--){var a=r.ObjectUtils.findIndexInList(n[i],l,e.dataKey);if(a===l.length-1)break;var o=l[a+1];l[a+1]=l[a],l[a]=o}e.onReorder&&e.onReorder({originalEvent:t,value:l,direction:"down"})}}}),o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-double-down",onClick:function(t){var n=e.selection;if(n&&n.length){for(var l=b(e.list),i=n.length-1;i>=0;i--){var a=r.ObjectUtils.findIndexInList(n[i],l,e.dataKey);if(a===l.length-1)break;var o=l.splice(a,1)[0];l.push(o)}e.onReorder&&e.onReorder({originalEvent:t,value:l,direction:"bottom"})}}}))}));h.displayName="PickListControls";var S=o.memo((function(e){var t=e.template?e.template(e.value):e.value,n=r.classNames("p-picklist-item",{"p-highlight":e.selected},e.className);return o.createElement("li",{className:n,onClick:function(t){e.onClick&&e.onClick({originalEvent:t,value:e.value})},onKeyDown:function(t){e.onKeyDown&&e.onKeyDown({originalEvent:t,value:e.value})},tabIndex:e.tabIndex,role:"option","aria-selected":e.selected},t,o.createElement(i.Ripple,null))}));S.displayName="PickListItem";var E=o.memo(o.forwardRef((function(e,t){var n=o.useRef(null),l=function(t){var n=t.originalEvent,l=t.value,i=b(e.selection),a=r.ObjectUtils.findIndexInList(l,i,e.dataKey),o=-1!==a;if(e.metaKeySelection){var c=n.metaKey||n.ctrlKey;o&&c?i.splice(a,1):(c||(i.length=0),i.push(l))}else o?i.splice(a,1):i.push(l);e.onSelectionChange&&e.onSelectionChange({event:n,value:i})},i=function(e){var t=e.originalEvent,n=t.currentTarget;switch(t.which){case 40:var r=a(n);r&&r.focus(),t.preventDefault();break;case 38:var i=c(n);i&&i.focus(),t.preventDefault();break;case 13:l(e),t.preventDefault()}},a=function e(t){var n=t.nextElementSibling;return n?r.DomHandler.hasClass(n,"p-picklist-item")?n:e(n):null},c=function e(t){var n=t.previousElementSibling;return n?r.DomHandler.hasClass(n,"p-picklist-item")?n:e(n):null},s=function(t){return-1!==r.ObjectUtils.findIndexInList(t,e.selection,e.dataKey)},u=function(t){e.onFilter&&e.onFilter({originalEvent:t,value:t.target.value,type:e.type})},p=function(e){13===e.which&&e.preventDefault()};o.useImperativeHandle(t,(function(){return{listElementRef:n}}));var f=r.classNames("p-picklist-list-wrapper",e.className),m=e.header?o.createElement("div",{className:"p-picklist-header"},r.ObjectUtils.getJSXElement(e.header,e)):null,d=function(){if(e.showFilter){var t=o.createElement("div",{className:"p-picklist-filter"},o.createElement("input",{type:"text",value:e.filterValue,onChange:u,onKeyDown:p,placeholder:e.placeholder,className:"p-picklist-filter-input p-inputtext p-component"}),o.createElement("span",{className:"p-picklist-filter-icon pi pi-search"}));if(e.filterTemplate)t=r.ObjectUtils.getJSXElement(e.filterTemplate,{className:"p-picklist-filter",inputProps:{className:"p-picklist-filter-input p-inputtext p-component",onChange:u,onKeyDown:p},iconClassName:"p-picklist-filter-icon pi pi-search",element:t,props:e});return o.createElement("div",{className:"p-picklist-filter-container"},t)}return null}(),g=function(){var t=e.list?e.list.map((function(t){var n=JSON.stringify(t),r=s(t);return o.createElement(S,{key:n,value:t,template:e.itemTemplate,selected:r,onClick:l,onKeyDown:i,tabIndex:e.tabIndex})})):null,n=r.classNames("p-picklist-list",e.listClassName);return o.createElement("ul",{className:n,style:e.style,role:"listbox","aria-multiselectable":!0},t)}();return o.createElement("div",{ref:n,className:f},m,d,g)})));E.displayName="PickListSubList";var T=o.memo((function(e){var t=r.ObjectUtils.isEmpty(e.sourceSelection)||r.ObjectUtils.isEmpty(e.visibleSourceList),n=r.ObjectUtils.isEmpty(e.targetSelection)||r.ObjectUtils.isEmpty(e.visibleTargetList),i=r.ObjectUtils.isEmpty(e.visibleSourceList),a=r.ObjectUtils.isEmpty(e.visibleTargetList),c=r.classNames("p-picklist-buttons p-picklist-transfer-buttons",e.className);return o.createElement("div",{className:c},o.createElement(l.Button,{disabled:t,type:"button",icon:"pi pi-angle-right",onClick:function(t){var n=e.sourceSelection;if(r.ObjectUtils.isNotEmpty(n)){for(var l=b(e.target),i=b(e.source),a=0;a<n.length;a++){var o=n[a];-1===r.ObjectUtils.findIndexInList(o,l,e.dataKey)&&l.push(i.splice(r.ObjectUtils.findIndexInList(o,i,e.dataKey),1)[0])}e.onTransfer&&e.onTransfer({originalEvent:t,source:i,target:l,direction:"toTarget"})}}}),o.createElement(l.Button,{disabled:i,type:"button",icon:"pi pi-angle-double-right",onClick:function(t){if(e.source){var n=[].concat(b(e.target),b(e.visibleSourceList)),r=e.source.filter((function(t){return!e.visibleSourceList.some((function(e){return e===t}))}));e.onTransfer&&e.onTransfer({originalEvent:t,source:r,target:n,direction:"allToTarget"})}}}),o.createElement(l.Button,{disabled:n,type:"button",icon:"pi pi-angle-left",onClick:function(t){var n=e.targetSelection;if(r.ObjectUtils.isNotEmpty(n)){for(var l=b(e.target),i=b(e.source),a=0;a<n.length;a++){var o=n[a];-1===r.ObjectUtils.findIndexInList(o,i,e.dataKey)&&i.push(l.splice(r.ObjectUtils.findIndexInList(o,l,e.dataKey),1)[0])}e.onTransfer&&e.onTransfer({originalEvent:t,source:i,target:l,direction:"toSource"})}}}),o.createElement(l.Button,{disabled:a,type:"button",icon:"pi pi-angle-double-left",onClick:function(t){if(e.source){var n=[].concat(b(e.source),b(e.visibleTargetList)),r=e.target.filter((function(t){return!e.visibleTargetList.some((function(e){return e===t}))}));e.onTransfer&&e.onTransfer({originalEvent:t,source:n,target:r,direction:"allToSource"})}}}))}));T.displayName="PickListTransferControls";var k=o.memo(o.forwardRef((function(e,l){var i=d(o.useState([]),2),a=i[0],s=i[1],u=d(o.useState([]),2),p=u[0],f=u[1],m=d(o.useState(""),2),g=m[0],v=m[1],y=d(o.useState(""),2),b=y[0],S=y[1],C=o.useRef(null),N=o.useRef(null),I=o.useRef(null),w=o.useRef(null),O=o.useRef(null),j=e.sourceSelection?e.sourceSelection:a,K=e.targetSelection?e.targetSelection:p,L=e.onSourceFilterChange?e.sourceFilterValue:g,F=e.onTargetFilterChange?e.targetFilterValue:b,U=r.ObjectUtils.isNotEmpty(e.filterBy),x=U&&e.showSourceFilter,R=U&&e.showTargetFilter,M=function(e,t){if(e){var n=r.DomHandler.findSingle(e,".p-picklist-list");switch(t){case"up":D(n,-1);break;case"top":n.scrollTop=0;break;case"down":D(n,1);break;case"bottom":setTimeout((function(){return n.scrollTop=n.scrollHeight}),100)}}},P=function(t,n,r){e.onChange&&e.onChange({originalEvent:t.originalEvent,source:n,target:r})},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getElementsByClassName("p-highlight");r.ObjectUtils.isNotEmpty(n)&&r.DomHandler.scrollInView(e,-1===t?n[0]:n[n.length-1])},A=function(e,t,n){"sourceSelection"===t?s(e.value):f(e.value),n&&n(e),r.ObjectUtils.isNotEmpty(j)&&"targetSelection"===t?s([]):r.ObjectUtils.isNotEmpty(K)&&"sourceSelection"===t&&f([])},B=function(t){var n=t.originalEvent,r=t.value,l=d("source"===t.type?[v,e.onSourceFilterChange]:[S,e.onTargetFilterChange],2),i=l[0],a=l[1];a?a({originalEvent:n,value:r}):i(r)},H=function(e,t){var n=d("source"===t?[L,V]:[F,q],2),l=n[0],i=n[1];return U&&r.ObjectUtils.isNotEmpty(l)?i(l):e},V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.trim().toLocaleLowerCase(e.filterLocale);return _(e.source,n)},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.trim().toLocaleLowerCase(e.filterLocale);return _(e.target,n)},_=function(n,r){var l=U?e.filterBy.split(","):[];return t.FilterService.filter(n,l,r,e.filterMatchMode,e.filterLocale)};o.useImperativeHandle(l,(function(){return{props:e,getElement:function(){return C.current}}})),n.useUpdateEffect((function(){w.current&&(M(w.current,O.current),w.current=null,O.current=null)}));var J=r.ObjectUtils.findDiffKeys(e,k.defaultProps),X=r.classNames("p-picklist p-component",e.className),z=e.sourceItemTemplate?e.sourceItemTemplate:e.itemTemplate,Y=e.targetItemTemplate?e.targetItemTemplate:e.itemTemplate,$=H(e.source,"source"),G=H(e.target,"target");return o.createElement("div",c({id:e.id,ref:C,className:X,style:e.style},J),e.showSourceControls&&o.createElement(h,{list:e.source,selection:j,onReorder:function(t){P(t,t.value,e.target),w.current=N.current.listElementRef.current,O.current=t.direction},className:"p-picklist-source-controls",dataKey:e.dataKey}),o.createElement(E,{ref:N,type:"source",list:$,selection:j,onSelectionChange:function(t){return A(t,"sourceSelection",e.onSourceSelectionChange)},itemTemplate:z,header:e.sourceHeader,style:e.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:e.metaKeySelection,tabIndex:e.tabIndex,dataKey:e.dataKey,filterValue:L,onFilter:B,showFilter:x,placeholder:e.sourceFilterPlaceholder,template:e.sourceFilterTemplate}),o.createElement(T,{onTransfer:function(t){var n=t.originalEvent,r=t.source,l=t.target,i=[];switch(t.direction){case"toTarget":i=j,e.onMoveToTarget&&e.onMoveToTarget({originalEvent:n,value:i});break;case"allToTarget":i=e.source,e.onMoveAllToTarget&&e.onMoveAllToTarget({originalEvent:n,value:i});break;case"toSource":i=K,e.onMoveToSource&&e.onMoveToSource({originalEvent:n,value:i});break;case"allToSource":i=e.target,e.onMoveAllToSource&&e.onMoveAllToSource({originalEvent:n,value:i})}A({originalEvent:n,value:i},"sourceSelection",e.onSourceSelectionChange),A({originalEvent:n,value:i},"targetSelection",e.onTargetSelectionChange),P(t,r,l)},source:e.source,visibleSourceList:$,target:e.target,visibleTargetList:G,sourceSelection:j,targetSelection:K,dataKey:e.dataKey}),o.createElement(E,{ref:I,type:"target",list:G,selection:K,onSelectionChange:function(t){return A(t,"targetSelection",e.onTargetSelectionChange)},itemTemplate:Y,header:e.targetHeader,style:e.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:e.metaKeySelection,tabIndex:e.tabIndex,dataKey:e.dataKey,filterValue:F,onFilter:B,showFilter:R,placeholder:e.targetFilterPlaceholder,template:e.targetFilterTemplate}),e.showTargetControls&&o.createElement(h,{list:e.target,selection:K,onReorder:function(t){P(t,e.source,t.value),w.current=I.current.listElementRef.current,O.current=t.direction},className:"p-picklist-target-controls",dataKey:e.dataKey}))})));k.displayName="PickList",k.defaultProps={__TYPE:"PickList",id:null,source:null,target:null,sourceHeader:null,targetHeader:null,style:null,className:null,sourceStyle:null,targetStyle:null,sourceSelection:null,targetSelection:null,showSourceControls:!0,showTargetControls:!0,metaKeySelection:!0,filterBy:null,filterMatchMode:"contains",filterLocale:void 0,sourceFilterValue:null,targetFilterValue:null,showSourceFilter:!0,showTargetFilter:!0,sourceFilterPlaceholder:null,targetFilterPlaceholder:null,sourceFilterTemplate:null,targetFilterTemplate:null,tabIndex:0,dataKey:null,itemTemplate:null,sourceItemTemplate:null,targetItemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null,onSourceFilterChange:null,onTargetFilterChange:null},exports.PickList=k;
|
package/picklist/picklist.d.ts
CHANGED
|
@@ -72,6 +72,6 @@ export interface PickListProps {
|
|
|
72
72
|
children?: React.ReactNode;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
export declare class PickList extends React.Component<PickListProps, any> {
|
|
75
|
+
export declare class PickList extends React.Component<PickListProps, any> {
|
|
76
76
|
public getElement(): HTMLDivElement;
|
|
77
77
|
}
|
package/picklist/picklist.esm.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Button } from 'primereact/button';
|
|
|
6
6
|
import { Ripple } from 'primereact/ripple';
|
|
7
7
|
|
|
8
8
|
function _extends() {
|
|
9
|
-
_extends = Object.assign
|
|
9
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
10
10
|
for (var i = 1; i < arguments.length; i++) {
|
|
11
11
|
var source = arguments[i];
|
|
12
12
|
|
|
@@ -19,7 +19,6 @@ function _extends() {
|
|
|
19
19
|
|
|
20
20
|
return target;
|
|
21
21
|
};
|
|
22
|
-
|
|
23
22
|
return _extends.apply(this, arguments);
|
|
24
23
|
}
|
|
25
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{FilterService as t}from"primereact/api";import{useUpdateEffect as n}from"primereact/hooks";import{classNames as r,ObjectUtils as l,DomHandler as i}from"primereact/utils";import{Button as a}from"primereact/button";import{Ripple as o}from"primereact/ripple";function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function s(e){if(Array.isArray(e))return e}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,i=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){o=!0,l=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw l}}return i}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e,t){return s(e)||u(e,t)||f(e,t)||m()}function d(e){if(Array.isArray(e))return p(e)}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){return d(e)||v(e)||f(e)||y()}var S=e.memo((function(t){var n=!t.selection||!t.selection.length,i=r("p-picklist-buttons",t.className);return e.createElement("div",{className:i},e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-up",onClick:function(e){var n=t.selection;if(n&&n.length){for(var r=h(t.list),i=0;i<n.length;i++){var a=l.findIndexInList(n[i],r,t.dataKey);if(0===a)break;var o=r[a-1];r[a-1]=r[a],r[a]=o}t.onReorder&&t.onReorder({originalEvent:e,value:r,direction:"up"})}}}),e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-double-up",onClick:function(e){var n=t.selection;if(n&&n.length){for(var r=h(t.list),i=0;i<n.length;i++){var a=l.findIndexInList(n[i],r,t.dataKey);if(0===a)break;var o=r.splice(a,1)[0];r.unshift(o)}t.onReorder&&t.onReorder({originalEvent:e,value:r,direction:"top"})}}}),e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-down",onClick:function(e){var n=t.selection;if(n&&n.length){for(var r=h(t.list),i=n.length-1;i>=0;i--){var a=l.findIndexInList(n[i],r,t.dataKey);if(a===r.length-1)break;var o=r[a+1];r[a+1]=r[a],r[a]=o}t.onReorder&&t.onReorder({originalEvent:e,value:r,direction:"down"})}}}),e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-double-down",onClick:function(e){var n=t.selection;if(n&&n.length){for(var r=h(t.list),i=n.length-1;i>=0;i--){var a=l.findIndexInList(n[i],r,t.dataKey);if(a===r.length-1)break;var o=r.splice(a,1)[0];r.push(o)}t.onReorder&&t.onReorder({originalEvent:e,value:r,direction:"bottom"})}}}))}));S.displayName="PickListControls";var b=e.memo((function(t){var n=t.template?t.template(t.value):t.value,l=r("p-picklist-item",{"p-highlight":t.selected},t.className);return e.createElement("li",{className:l,onClick:function(e){t.onClick&&t.onClick({originalEvent:e,value:t.value})},onKeyDown:function(e){t.onKeyDown&&t.onKeyDown({originalEvent:e,value:t.value})},tabIndex:t.tabIndex,role:"option","aria-selected":t.selected},n,e.createElement(o,null))}));b.displayName="PickListItem";var T=e.memo(e.forwardRef((function(t,n){var a=e.useRef(null),o=function(e){var n=e.originalEvent,r=e.value,i=h(t.selection),a=l.findIndexInList(r,i,t.dataKey),o=-1!==a;if(t.metaKeySelection){var c=n.metaKey||n.ctrlKey;o&&c?i.splice(a,1):(c||(i.length=0),i.push(r))}else o?i.splice(a,1):i.push(r);t.onSelectionChange&&t.onSelectionChange({event:n,value:i})},c=function(e){var t=e.originalEvent,n=t.currentTarget;switch(t.which){case 40:var r=s(n);r&&r.focus(),t.preventDefault();break;case 38:var l=u(n);l&&l.focus(),t.preventDefault();break;case 13:o(e),t.preventDefault()}},s=function e(t){var n=t.nextElementSibling;return n?i.hasClass(n,"p-picklist-item")?n:e(n):null},u=function e(t){var n=t.previousElementSibling;return n?i.hasClass(n,"p-picklist-item")?n:e(n):null},p=function(e){return-1!==l.findIndexInList(e,t.selection,t.dataKey)},f=function(e){t.onFilter&&t.onFilter({originalEvent:e,value:e.target.value,type:t.type})},m=function(e){13===e.which&&e.preventDefault()};e.useImperativeHandle(n,(function(){return{listElementRef:a}}));var g=r("p-picklist-list-wrapper",t.className),d=t.header?e.createElement("div",{className:"p-picklist-header"},l.getJSXElement(t.header,t)):null,v=function(){if(t.showFilter){var n=e.createElement("div",{className:"p-picklist-filter"},e.createElement("input",{type:"text",value:t.filterValue,onChange:f,onKeyDown:m,placeholder:t.placeholder,className:"p-picklist-filter-input p-inputtext p-component"}),e.createElement("span",{className:"p-picklist-filter-icon pi pi-search"}));if(t.filterTemplate)n=l.getJSXElement(t.filterTemplate,{className:"p-picklist-filter",inputProps:{className:"p-picklist-filter-input p-inputtext p-component",onChange:f,onKeyDown:m},iconClassName:"p-picklist-filter-icon pi pi-search",element:n,props:t});return e.createElement("div",{className:"p-picklist-filter-container"},n)}return null}(),y=function(){var n=t.list?t.list.map((function(n){var r=JSON.stringify(n),l=p(n);return e.createElement(b,{key:r,value:n,template:t.itemTemplate,selected:l,onClick:o,onKeyDown:c,tabIndex:t.tabIndex})})):null,l=r("p-picklist-list",t.listClassName);return e.createElement("ul",{className:l,style:t.style,role:"listbox","aria-multiselectable":!0},n)}();return e.createElement("div",{ref:a,className:g},d,v,y)})));T.displayName="PickListSubList";var E=e.memo((function(t){var n=l.isEmpty(t.sourceSelection)||l.isEmpty(t.visibleSourceList),i=l.isEmpty(t.targetSelection)||l.isEmpty(t.visibleTargetList),o=l.isEmpty(t.visibleSourceList),c=l.isEmpty(t.visibleTargetList),s=r("p-picklist-buttons p-picklist-transfer-buttons",t.className);return e.createElement("div",{className:s},e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-right",onClick:function(e){var n=t.sourceSelection;if(l.isNotEmpty(n)){for(var r=h(t.target),i=h(t.source),a=0;a<n.length;a++){var o=n[a];-1===l.findIndexInList(o,r,t.dataKey)&&r.push(i.splice(l.findIndexInList(o,i,t.dataKey),1)[0])}t.onTransfer&&t.onTransfer({originalEvent:e,source:i,target:r,direction:"toTarget"})}}}),e.createElement(a,{disabled:o,type:"button",icon:"pi pi-angle-double-right",onClick:function(e){if(t.source){var n=[].concat(h(t.target),h(t.visibleSourceList)),r=t.source.filter((function(e){return!t.visibleSourceList.some((function(t){return t===e}))}));t.onTransfer&&t.onTransfer({originalEvent:e,source:r,target:n,direction:"allToTarget"})}}}),e.createElement(a,{disabled:i,type:"button",icon:"pi pi-angle-left",onClick:function(e){var n=t.targetSelection;if(l.isNotEmpty(n)){for(var r=h(t.target),i=h(t.source),a=0;a<n.length;a++){var o=n[a];-1===l.findIndexInList(o,i,t.dataKey)&&i.push(r.splice(l.findIndexInList(o,r,t.dataKey),1)[0])}t.onTransfer&&t.onTransfer({originalEvent:e,source:i,target:r,direction:"toSource"})}}}),e.createElement(a,{disabled:c,type:"button",icon:"pi pi-angle-double-left",onClick:function(e){if(t.source){var n=[].concat(h(t.source),h(t.visibleTargetList)),r=t.target.filter((function(e){return!t.visibleTargetList.some((function(t){return t===e}))}));t.onTransfer&&t.onTransfer({originalEvent:e,source:n,target:r,direction:"allToSource"})}}}))}));E.displayName="PickListTransferControls";var k=e.memo(e.forwardRef((function(a,o){var s=g(e.useState([]),2),u=s[0],p=s[1],f=g(e.useState([]),2),m=f[0],d=f[1],v=g(e.useState(""),2),y=v[0],h=v[1],b=g(e.useState(""),2),C=b[0],I=b[1],w=e.useRef(null),N=e.useRef(null),K=e.useRef(null),L=e.useRef(null),F=e.useRef(null),x=a.sourceSelection?a.sourceSelection:u,R=a.targetSelection?a.targetSelection:m,M=a.onSourceFilterChange?a.sourceFilterValue:y,A=a.onTargetFilterChange?a.targetFilterValue:C,P=l.isNotEmpty(a.filterBy),D=P&&a.showSourceFilter,V=P&&a.showTargetFilter,H=function(e,t){if(e){var n=i.findSingle(e,".p-picklist-list");switch(t){case"up":O(n,-1);break;case"top":n.scrollTop=0;break;case"down":O(n,1);break;case"bottom":setTimeout((function(){return n.scrollTop=n.scrollHeight}),100)}}},j=function(e,t,n){a.onChange&&a.onChange({originalEvent:e.originalEvent,source:t,target:n})},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getElementsByClassName("p-highlight");l.isNotEmpty(n)&&i.scrollInView(e,-1===t?n[0]:n[n.length-1])},B=function(e,t,n){"sourceSelection"===t?p(e.value):d(e.value),n&&n(e),l.isNotEmpty(x)&&"targetSelection"===t?p([]):l.isNotEmpty(R)&&"sourceSelection"===t&&d([])},J=function(e){var t=e.originalEvent,n=e.value,r=g("source"===e.type?[h,a.onSourceFilterChange]:[I,a.onTargetFilterChange],2),l=r[0],i=r[1];i?i({originalEvent:t,value:n}):l(n)},X=function(e,t){var n=g("source"===t?[M,_]:[A,U],2),r=n[0],i=n[1];return P&&l.isNotEmpty(r)?i(r):e},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.trim().toLocaleLowerCase(a.filterLocale);return Y(a.source,t)},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.trim().toLocaleLowerCase(a.filterLocale);return Y(a.target,t)},Y=function(e,n){var r=P?a.filterBy.split(","):[];return t.filter(e,r,n,a.filterMatchMode,a.filterLocale)};e.useImperativeHandle(o,(function(){return{props:a,getElement:function(){return w.current}}})),n((function(){L.current&&(H(L.current,F.current),L.current=null,F.current=null)}));var $=l.findDiffKeys(a,k.defaultProps),q=r("p-picklist p-component",a.className),z=a.sourceItemTemplate?a.sourceItemTemplate:a.itemTemplate,G=a.targetItemTemplate?a.targetItemTemplate:a.itemTemplate,Q=X(a.source,"source"),W=X(a.target,"target");return e.createElement("div",c({id:a.id,ref:w,className:q,style:a.style},$),a.showSourceControls&&e.createElement(S,{list:a.source,selection:x,onReorder:function(e){j(e,e.value,a.target),L.current=N.current.listElementRef.current,F.current=e.direction},className:"p-picklist-source-controls",dataKey:a.dataKey}),e.createElement(T,{ref:N,type:"source",list:Q,selection:x,onSelectionChange:function(e){return B(e,"sourceSelection",a.onSourceSelectionChange)},itemTemplate:z,header:a.sourceHeader,style:a.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:a.metaKeySelection,tabIndex:a.tabIndex,dataKey:a.dataKey,filterValue:M,onFilter:J,showFilter:D,placeholder:a.sourceFilterPlaceholder,template:a.sourceFilterTemplate}),e.createElement(E,{onTransfer:function(e){var t=e.originalEvent,n=e.source,r=e.target,l=[];switch(e.direction){case"toTarget":l=x,a.onMoveToTarget&&a.onMoveToTarget({originalEvent:t,value:l});break;case"allToTarget":l=a.source,a.onMoveAllToTarget&&a.onMoveAllToTarget({originalEvent:t,value:l});break;case"toSource":l=R,a.onMoveToSource&&a.onMoveToSource({originalEvent:t,value:l});break;case"allToSource":l=a.target,a.onMoveAllToSource&&a.onMoveAllToSource({originalEvent:t,value:l})}B({originalEvent:t,value:l},"sourceSelection",a.onSourceSelectionChange),B({originalEvent:t,value:l},"targetSelection",a.onTargetSelectionChange),j(e,n,r)},source:a.source,visibleSourceList:Q,target:a.target,visibleTargetList:W,sourceSelection:x,targetSelection:R,dataKey:a.dataKey}),e.createElement(T,{ref:K,type:"target",list:W,selection:R,onSelectionChange:function(e){return B(e,"targetSelection",a.onTargetSelectionChange)},itemTemplate:G,header:a.targetHeader,style:a.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:a.metaKeySelection,tabIndex:a.tabIndex,dataKey:a.dataKey,filterValue:A,onFilter:J,showFilter:V,placeholder:a.targetFilterPlaceholder,template:a.targetFilterTemplate}),a.showTargetControls&&e.createElement(S,{list:a.target,selection:R,onReorder:function(e){j(e,a.source,e.value),L.current=K.current.listElementRef.current,F.current=e.direction},className:"p-picklist-target-controls",dataKey:a.dataKey}))})));k.displayName="PickList",k.defaultProps={__TYPE:"PickList",id:null,source:null,target:null,sourceHeader:null,targetHeader:null,style:null,className:null,sourceStyle:null,targetStyle:null,sourceSelection:null,targetSelection:null,showSourceControls:!0,showTargetControls:!0,metaKeySelection:!0,filterBy:null,filterMatchMode:"contains",filterLocale:void 0,sourceFilterValue:null,targetFilterValue:null,showSourceFilter:!0,showTargetFilter:!0,sourceFilterPlaceholder:null,targetFilterPlaceholder:null,sourceFilterTemplate:null,targetFilterTemplate:null,tabIndex:0,dataKey:null,itemTemplate:null,sourceItemTemplate:null,targetItemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null,onSourceFilterChange:null,onTargetFilterChange:null};export{k as PickList};
|
|
1
|
+
import*as e from"react";import{FilterService as t}from"primereact/api";import{useUpdateEffect as n}from"primereact/hooks";import{classNames as r,ObjectUtils as l,DomHandler as i}from"primereact/utils";import{Button as a}from"primereact/button";import{Ripple as o}from"primereact/ripple";function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function s(e){if(Array.isArray(e))return e}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,i=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){o=!0,l=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw l}}return i}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e,t){return s(e)||u(e,t)||f(e,t)||m()}function d(e){if(Array.isArray(e))return p(e)}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){return d(e)||v(e)||f(e)||y()}var S=e.memo((function(t){var n=!t.selection||!t.selection.length,i=r("p-picklist-buttons",t.className);return e.createElement("div",{className:i},e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-up",onClick:function(e){var n=t.selection;if(n&&n.length){for(var r=h(t.list),i=0;i<n.length;i++){var a=l.findIndexInList(n[i],r,t.dataKey);if(0===a)break;var o=r[a-1];r[a-1]=r[a],r[a]=o}t.onReorder&&t.onReorder({originalEvent:e,value:r,direction:"up"})}}}),e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-double-up",onClick:function(e){var n=t.selection;if(n&&n.length){for(var r=h(t.list),i=0;i<n.length;i++){var a=l.findIndexInList(n[i],r,t.dataKey);if(0===a)break;var o=r.splice(a,1)[0];r.unshift(o)}t.onReorder&&t.onReorder({originalEvent:e,value:r,direction:"top"})}}}),e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-down",onClick:function(e){var n=t.selection;if(n&&n.length){for(var r=h(t.list),i=n.length-1;i>=0;i--){var a=l.findIndexInList(n[i],r,t.dataKey);if(a===r.length-1)break;var o=r[a+1];r[a+1]=r[a],r[a]=o}t.onReorder&&t.onReorder({originalEvent:e,value:r,direction:"down"})}}}),e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-double-down",onClick:function(e){var n=t.selection;if(n&&n.length){for(var r=h(t.list),i=n.length-1;i>=0;i--){var a=l.findIndexInList(n[i],r,t.dataKey);if(a===r.length-1)break;var o=r.splice(a,1)[0];r.push(o)}t.onReorder&&t.onReorder({originalEvent:e,value:r,direction:"bottom"})}}}))}));S.displayName="PickListControls";var b=e.memo((function(t){var n=t.template?t.template(t.value):t.value,l=r("p-picklist-item",{"p-highlight":t.selected},t.className);return e.createElement("li",{className:l,onClick:function(e){t.onClick&&t.onClick({originalEvent:e,value:t.value})},onKeyDown:function(e){t.onKeyDown&&t.onKeyDown({originalEvent:e,value:t.value})},tabIndex:t.tabIndex,role:"option","aria-selected":t.selected},n,e.createElement(o,null))}));b.displayName="PickListItem";var T=e.memo(e.forwardRef((function(t,n){var a=e.useRef(null),o=function(e){var n=e.originalEvent,r=e.value,i=h(t.selection),a=l.findIndexInList(r,i,t.dataKey),o=-1!==a;if(t.metaKeySelection){var c=n.metaKey||n.ctrlKey;o&&c?i.splice(a,1):(c||(i.length=0),i.push(r))}else o?i.splice(a,1):i.push(r);t.onSelectionChange&&t.onSelectionChange({event:n,value:i})},c=function(e){var t=e.originalEvent,n=t.currentTarget;switch(t.which){case 40:var r=s(n);r&&r.focus(),t.preventDefault();break;case 38:var l=u(n);l&&l.focus(),t.preventDefault();break;case 13:o(e),t.preventDefault()}},s=function e(t){var n=t.nextElementSibling;return n?i.hasClass(n,"p-picklist-item")?n:e(n):null},u=function e(t){var n=t.previousElementSibling;return n?i.hasClass(n,"p-picklist-item")?n:e(n):null},p=function(e){return-1!==l.findIndexInList(e,t.selection,t.dataKey)},f=function(e){t.onFilter&&t.onFilter({originalEvent:e,value:e.target.value,type:t.type})},m=function(e){13===e.which&&e.preventDefault()};e.useImperativeHandle(n,(function(){return{listElementRef:a}}));var g=r("p-picklist-list-wrapper",t.className),d=t.header?e.createElement("div",{className:"p-picklist-header"},l.getJSXElement(t.header,t)):null,v=function(){if(t.showFilter){var n=e.createElement("div",{className:"p-picklist-filter"},e.createElement("input",{type:"text",value:t.filterValue,onChange:f,onKeyDown:m,placeholder:t.placeholder,className:"p-picklist-filter-input p-inputtext p-component"}),e.createElement("span",{className:"p-picklist-filter-icon pi pi-search"}));if(t.filterTemplate)n=l.getJSXElement(t.filterTemplate,{className:"p-picklist-filter",inputProps:{className:"p-picklist-filter-input p-inputtext p-component",onChange:f,onKeyDown:m},iconClassName:"p-picklist-filter-icon pi pi-search",element:n,props:t});return e.createElement("div",{className:"p-picklist-filter-container"},n)}return null}(),y=function(){var n=t.list?t.list.map((function(n){var r=JSON.stringify(n),l=p(n);return e.createElement(b,{key:r,value:n,template:t.itemTemplate,selected:l,onClick:o,onKeyDown:c,tabIndex:t.tabIndex})})):null,l=r("p-picklist-list",t.listClassName);return e.createElement("ul",{className:l,style:t.style,role:"listbox","aria-multiselectable":!0},n)}();return e.createElement("div",{ref:a,className:g},d,v,y)})));T.displayName="PickListSubList";var E=e.memo((function(t){var n=l.isEmpty(t.sourceSelection)||l.isEmpty(t.visibleSourceList),i=l.isEmpty(t.targetSelection)||l.isEmpty(t.visibleTargetList),o=l.isEmpty(t.visibleSourceList),c=l.isEmpty(t.visibleTargetList),s=r("p-picklist-buttons p-picklist-transfer-buttons",t.className);return e.createElement("div",{className:s},e.createElement(a,{disabled:n,type:"button",icon:"pi pi-angle-right",onClick:function(e){var n=t.sourceSelection;if(l.isNotEmpty(n)){for(var r=h(t.target),i=h(t.source),a=0;a<n.length;a++){var o=n[a];-1===l.findIndexInList(o,r,t.dataKey)&&r.push(i.splice(l.findIndexInList(o,i,t.dataKey),1)[0])}t.onTransfer&&t.onTransfer({originalEvent:e,source:i,target:r,direction:"toTarget"})}}}),e.createElement(a,{disabled:o,type:"button",icon:"pi pi-angle-double-right",onClick:function(e){if(t.source){var n=[].concat(h(t.target),h(t.visibleSourceList)),r=t.source.filter((function(e){return!t.visibleSourceList.some((function(t){return t===e}))}));t.onTransfer&&t.onTransfer({originalEvent:e,source:r,target:n,direction:"allToTarget"})}}}),e.createElement(a,{disabled:i,type:"button",icon:"pi pi-angle-left",onClick:function(e){var n=t.targetSelection;if(l.isNotEmpty(n)){for(var r=h(t.target),i=h(t.source),a=0;a<n.length;a++){var o=n[a];-1===l.findIndexInList(o,i,t.dataKey)&&i.push(r.splice(l.findIndexInList(o,r,t.dataKey),1)[0])}t.onTransfer&&t.onTransfer({originalEvent:e,source:i,target:r,direction:"toSource"})}}}),e.createElement(a,{disabled:c,type:"button",icon:"pi pi-angle-double-left",onClick:function(e){if(t.source){var n=[].concat(h(t.source),h(t.visibleTargetList)),r=t.target.filter((function(e){return!t.visibleTargetList.some((function(t){return t===e}))}));t.onTransfer&&t.onTransfer({originalEvent:e,source:n,target:r,direction:"allToSource"})}}}))}));E.displayName="PickListTransferControls";var k=e.memo(e.forwardRef((function(a,o){var s=g(e.useState([]),2),u=s[0],p=s[1],f=g(e.useState([]),2),m=f[0],d=f[1],v=g(e.useState(""),2),y=v[0],h=v[1],b=g(e.useState(""),2),C=b[0],I=b[1],w=e.useRef(null),N=e.useRef(null),K=e.useRef(null),L=e.useRef(null),F=e.useRef(null),x=a.sourceSelection?a.sourceSelection:u,R=a.targetSelection?a.targetSelection:m,M=a.onSourceFilterChange?a.sourceFilterValue:y,A=a.onTargetFilterChange?a.targetFilterValue:C,P=l.isNotEmpty(a.filterBy),D=P&&a.showSourceFilter,V=P&&a.showTargetFilter,j=function(e,t){if(e){var n=i.findSingle(e,".p-picklist-list");switch(t){case"up":O(n,-1);break;case"top":n.scrollTop=0;break;case"down":O(n,1);break;case"bottom":setTimeout((function(){return n.scrollTop=n.scrollHeight}),100)}}},H=function(e,t,n){a.onChange&&a.onChange({originalEvent:e.originalEvent,source:t,target:n})},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getElementsByClassName("p-highlight");l.isNotEmpty(n)&&i.scrollInView(e,-1===t?n[0]:n[n.length-1])},B=function(e,t,n){"sourceSelection"===t?p(e.value):d(e.value),n&&n(e),l.isNotEmpty(x)&&"targetSelection"===t?p([]):l.isNotEmpty(R)&&"sourceSelection"===t&&d([])},J=function(e){var t=e.originalEvent,n=e.value,r=g("source"===e.type?[h,a.onSourceFilterChange]:[I,a.onTargetFilterChange],2),l=r[0],i=r[1];i?i({originalEvent:t,value:n}):l(n)},X=function(e,t){var n=g("source"===t?[M,_]:[A,U],2),r=n[0],i=n[1];return P&&l.isNotEmpty(r)?i(r):e},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.trim().toLocaleLowerCase(a.filterLocale);return Y(a.source,t)},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.trim().toLocaleLowerCase(a.filterLocale);return Y(a.target,t)},Y=function(e,n){var r=P?a.filterBy.split(","):[];return t.filter(e,r,n,a.filterMatchMode,a.filterLocale)};e.useImperativeHandle(o,(function(){return{props:a,getElement:function(){return w.current}}})),n((function(){L.current&&(j(L.current,F.current),L.current=null,F.current=null)}));var $=l.findDiffKeys(a,k.defaultProps),q=r("p-picklist p-component",a.className),z=a.sourceItemTemplate?a.sourceItemTemplate:a.itemTemplate,G=a.targetItemTemplate?a.targetItemTemplate:a.itemTemplate,Q=X(a.source,"source"),W=X(a.target,"target");return e.createElement("div",c({id:a.id,ref:w,className:q,style:a.style},$),a.showSourceControls&&e.createElement(S,{list:a.source,selection:x,onReorder:function(e){H(e,e.value,a.target),L.current=N.current.listElementRef.current,F.current=e.direction},className:"p-picklist-source-controls",dataKey:a.dataKey}),e.createElement(T,{ref:N,type:"source",list:Q,selection:x,onSelectionChange:function(e){return B(e,"sourceSelection",a.onSourceSelectionChange)},itemTemplate:z,header:a.sourceHeader,style:a.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:a.metaKeySelection,tabIndex:a.tabIndex,dataKey:a.dataKey,filterValue:M,onFilter:J,showFilter:D,placeholder:a.sourceFilterPlaceholder,template:a.sourceFilterTemplate}),e.createElement(E,{onTransfer:function(e){var t=e.originalEvent,n=e.source,r=e.target,l=[];switch(e.direction){case"toTarget":l=x,a.onMoveToTarget&&a.onMoveToTarget({originalEvent:t,value:l});break;case"allToTarget":l=a.source,a.onMoveAllToTarget&&a.onMoveAllToTarget({originalEvent:t,value:l});break;case"toSource":l=R,a.onMoveToSource&&a.onMoveToSource({originalEvent:t,value:l});break;case"allToSource":l=a.target,a.onMoveAllToSource&&a.onMoveAllToSource({originalEvent:t,value:l})}B({originalEvent:t,value:l},"sourceSelection",a.onSourceSelectionChange),B({originalEvent:t,value:l},"targetSelection",a.onTargetSelectionChange),H(e,n,r)},source:a.source,visibleSourceList:Q,target:a.target,visibleTargetList:W,sourceSelection:x,targetSelection:R,dataKey:a.dataKey}),e.createElement(T,{ref:K,type:"target",list:W,selection:R,onSelectionChange:function(e){return B(e,"targetSelection",a.onTargetSelectionChange)},itemTemplate:G,header:a.targetHeader,style:a.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:a.metaKeySelection,tabIndex:a.tabIndex,dataKey:a.dataKey,filterValue:A,onFilter:J,showFilter:V,placeholder:a.targetFilterPlaceholder,template:a.targetFilterTemplate}),a.showTargetControls&&e.createElement(S,{list:a.target,selection:R,onReorder:function(e){H(e,a.source,e.value),L.current=K.current.listElementRef.current,F.current=e.direction},className:"p-picklist-target-controls",dataKey:a.dataKey}))})));k.displayName="PickList",k.defaultProps={__TYPE:"PickList",id:null,source:null,target:null,sourceHeader:null,targetHeader:null,style:null,className:null,sourceStyle:null,targetStyle:null,sourceSelection:null,targetSelection:null,showSourceControls:!0,showTargetControls:!0,metaKeySelection:!0,filterBy:null,filterMatchMode:"contains",filterLocale:void 0,sourceFilterValue:null,targetFilterValue:null,showSourceFilter:!0,showTargetFilter:!0,sourceFilterPlaceholder:null,targetFilterPlaceholder:null,sourceFilterTemplate:null,targetFilterTemplate:null,tabIndex:0,dataKey:null,itemTemplate:null,sourceItemTemplate:null,targetItemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null,onSourceFilterChange:null,onTargetFilterChange:null};export{k as PickList};
|
package/picklist/picklist.js
CHANGED
|
@@ -23,7 +23,7 @@ this.primereact.picklist = (function (exports, React, api, hooks, utils, button,
|
|
|
23
23
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
24
24
|
|
|
25
25
|
function _extends() {
|
|
26
|
-
_extends = Object.assign
|
|
26
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
27
27
|
for (var i = 1; i < arguments.length; i++) {
|
|
28
28
|
var source = arguments[i];
|
|
29
29
|
|
|
@@ -36,7 +36,6 @@ this.primereact.picklist = (function (exports, React, api, hooks, utils, button,
|
|
|
36
36
|
|
|
37
37
|
return target;
|
|
38
38
|
};
|
|
39
|
-
|
|
40
39
|
return _extends.apply(this, arguments);
|
|
41
40
|
}
|
|
42
41
|
|
package/picklist/picklist.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.picklist=function(e,t,n,r,l,i,a){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=o(t);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function p(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,i=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){o=!0,l=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw l}}return i}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e,t){return u(e)||p(e,t)||m(e,t)||d()}function v(e){if(Array.isArray(e))return f(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function b(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){return v(e)||y(e)||m(e)||b()}var S=c.memo((function(e){var t=!e.selection||!e.selection.length,n=l.classNames("p-picklist-buttons",e.className);return c.createElement("div",{className:n},c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-up",onClick:function(t){var n=e.selection;if(n&&n.length){for(var r=h(e.list),i=0;i<n.length;i++){var a=l.ObjectUtils.findIndexInList(n[i],r,e.dataKey);if(0===a)break;var o=r[a-1];r[a-1]=r[a],r[a]=o}e.onReorder&&e.onReorder({originalEvent:t,value:r,direction:"up"})}}}),c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-double-up",onClick:function(t){var n=e.selection;if(n&&n.length){for(var r=h(e.list),i=0;i<n.length;i++){var a=l.ObjectUtils.findIndexInList(n[i],r,e.dataKey);if(0===a)break;var o=r.splice(a,1)[0];r.unshift(o)}e.onReorder&&e.onReorder({originalEvent:t,value:r,direction:"top"})}}}),c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-down",onClick:function(t){var n=e.selection;if(n&&n.length){for(var r=h(e.list),i=n.length-1;i>=0;i--){var a=l.ObjectUtils.findIndexInList(n[i],r,e.dataKey);if(a===r.length-1)break;var o=r[a+1];r[a+1]=r[a],r[a]=o}e.onReorder&&e.onReorder({originalEvent:t,value:r,direction:"down"})}}}),c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-double-down",onClick:function(t){var n=e.selection;if(n&&n.length){for(var r=h(e.list),i=n.length-1;i>=0;i--){var a=l.ObjectUtils.findIndexInList(n[i],r,e.dataKey);if(a===r.length-1)break;var o=r.splice(a,1)[0];r.push(o)}e.onReorder&&e.onReorder({originalEvent:t,value:r,direction:"bottom"})}}}))}));S.displayName="PickListControls";var E=c.memo((function(e){var t=e.template?e.template(e.value):e.value,n=l.classNames("p-picklist-item",{"p-highlight":e.selected},e.className);return c.createElement("li",{className:n,onClick:function(t){e.onClick&&e.onClick({originalEvent:t,value:e.value})},onKeyDown:function(t){e.onKeyDown&&e.onKeyDown({originalEvent:t,value:e.value})},tabIndex:e.tabIndex,role:"option","aria-selected":e.selected},t,c.createElement(a.Ripple,null))}));E.displayName="PickListItem";var T=c.memo(c.forwardRef((function(e,t){var n=c.useRef(null),r=function(t){var n=t.originalEvent,r=t.value,i=h(e.selection),a=l.ObjectUtils.findIndexInList(r,i,e.dataKey),o=-1!==a;if(e.metaKeySelection){var c=n.metaKey||n.ctrlKey;o&&c?i.splice(a,1):(c||(i.length=0),i.push(r))}else o?i.splice(a,1):i.push(r);e.onSelectionChange&&e.onSelectionChange({event:n,value:i})},i=function(e){var t=e.originalEvent,n=t.currentTarget;switch(t.which){case 40:var l=a(n);l&&l.focus(),t.preventDefault();break;case 38:var i=o(n);i&&i.focus(),t.preventDefault();break;case 13:r(e),t.preventDefault()}},a=function e(t){var n=t.nextElementSibling;return n?l.DomHandler.hasClass(n,"p-picklist-item")?n:e(n):null},o=function e(t){var n=t.previousElementSibling;return n?l.DomHandler.hasClass(n,"p-picklist-item")?n:e(n):null},s=function(t){return-1!==l.ObjectUtils.findIndexInList(t,e.selection,e.dataKey)},u=function(t){e.onFilter&&e.onFilter({originalEvent:t,value:t.target.value,type:e.type})},p=function(e){13===e.which&&e.preventDefault()};c.useImperativeHandle(t,(function(){return{listElementRef:n}}));var f=l.classNames("p-picklist-list-wrapper",e.className),m=e.header?c.createElement("div",{className:"p-picklist-header"},l.ObjectUtils.getJSXElement(e.header,e)):null,d=function(){if(e.showFilter){var t=c.createElement("div",{className:"p-picklist-filter"},c.createElement("input",{type:"text",value:e.filterValue,onChange:u,onKeyDown:p,placeholder:e.placeholder,className:"p-picklist-filter-input p-inputtext p-component"}),c.createElement("span",{className:"p-picklist-filter-icon pi pi-search"}));if(e.filterTemplate)t=l.ObjectUtils.getJSXElement(e.filterTemplate,{className:"p-picklist-filter",inputProps:{className:"p-picklist-filter-input p-inputtext p-component",onChange:u,onKeyDown:p},iconClassName:"p-picklist-filter-icon pi pi-search",element:t,props:e});return c.createElement("div",{className:"p-picklist-filter-container"},t)}return null}(),g=function(){var t=e.list?e.list.map((function(t){var n=JSON.stringify(t),l=s(t);return c.createElement(E,{key:n,value:t,template:e.itemTemplate,selected:l,onClick:r,onKeyDown:i,tabIndex:e.tabIndex})})):null,n=l.classNames("p-picklist-list",e.listClassName);return c.createElement("ul",{className:n,style:e.style,role:"listbox","aria-multiselectable":!0},t)}();return c.createElement("div",{ref:n,className:f},m,d,g)})));T.displayName="PickListSubList";var k=c.memo((function(e){var t=l.ObjectUtils.isEmpty(e.sourceSelection)||l.ObjectUtils.isEmpty(e.visibleSourceList),n=l.ObjectUtils.isEmpty(e.targetSelection)||l.ObjectUtils.isEmpty(e.visibleTargetList),r=l.ObjectUtils.isEmpty(e.visibleSourceList),a=l.ObjectUtils.isEmpty(e.visibleTargetList),o=l.classNames("p-picklist-buttons p-picklist-transfer-buttons",e.className);return c.createElement("div",{className:o},c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-right",onClick:function(t){var n=e.sourceSelection;if(l.ObjectUtils.isNotEmpty(n)){for(var r=h(e.target),i=h(e.source),a=0;a<n.length;a++){var o=n[a];-1===l.ObjectUtils.findIndexInList(o,r,e.dataKey)&&r.push(i.splice(l.ObjectUtils.findIndexInList(o,i,e.dataKey),1)[0])}e.onTransfer&&e.onTransfer({originalEvent:t,source:i,target:r,direction:"toTarget"})}}}),c.createElement(i.Button,{disabled:r,type:"button",icon:"pi pi-angle-double-right",onClick:function(t){if(e.source){var n=[].concat(h(e.target),h(e.visibleSourceList)),r=e.source.filter((function(t){return!e.visibleSourceList.some((function(e){return e===t}))}));e.onTransfer&&e.onTransfer({originalEvent:t,source:r,target:n,direction:"allToTarget"})}}}),c.createElement(i.Button,{disabled:n,type:"button",icon:"pi pi-angle-left",onClick:function(t){var n=e.targetSelection;if(l.ObjectUtils.isNotEmpty(n)){for(var r=h(e.target),i=h(e.source),a=0;a<n.length;a++){var o=n[a];-1===l.ObjectUtils.findIndexInList(o,i,e.dataKey)&&i.push(r.splice(l.ObjectUtils.findIndexInList(o,r,e.dataKey),1)[0])}e.onTransfer&&e.onTransfer({originalEvent:t,source:i,target:r,direction:"toSource"})}}}),c.createElement(i.Button,{disabled:a,type:"button",icon:"pi pi-angle-double-left",onClick:function(t){if(e.source){var n=[].concat(h(e.source),h(e.visibleTargetList)),r=e.target.filter((function(t){return!e.visibleTargetList.some((function(e){return e===t}))}));e.onTransfer&&e.onTransfer({originalEvent:t,source:n,target:r,direction:"allToSource"})}}}))}));k.displayName="PickListTransferControls";var C=c.memo(c.forwardRef((function(e,t){var i=g(c.useState([]),2),a=i[0],o=i[1],u=g(c.useState([]),2),p=u[0],f=u[1],m=g(c.useState(""),2),d=m[0],v=m[1],y=g(c.useState(""),2),b=y[0],h=y[1],E=c.useRef(null),N=c.useRef(null),I=c.useRef(null),w=c.useRef(null),O=c.useRef(null),j=e.sourceSelection?e.sourceSelection:a,K=e.targetSelection?e.targetSelection:p,L=e.onSourceFilterChange?e.sourceFilterValue:d,F=e.onTargetFilterChange?e.targetFilterValue:b,U=l.ObjectUtils.isNotEmpty(e.filterBy),x=U&&e.showSourceFilter,R=U&&e.showTargetFilter,M=function(e,t){if(e){var n=l.DomHandler.findSingle(e,".p-picklist-list");switch(t){case"up":D(n,-1);break;case"top":n.scrollTop=0;break;case"down":D(n,1);break;case"bottom":setTimeout((function(){return n.scrollTop=n.scrollHeight}),100)}}},P=function(t,n,r){e.onChange&&e.onChange({originalEvent:t.originalEvent,source:n,target:r})},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getElementsByClassName("p-highlight");l.ObjectUtils.isNotEmpty(n)&&l.DomHandler.scrollInView(e,-1===t?n[0]:n[n.length-1])},A=function(e,t,n){"sourceSelection"===t?o(e.value):f(e.value),n&&n(e),l.ObjectUtils.isNotEmpty(j)&&"targetSelection"===t?o([]):l.ObjectUtils.isNotEmpty(K)&&"sourceSelection"===t&&f([])},B=function(t){var n=t.originalEvent,r=t.value,l=g("source"===t.type?[v,e.onSourceFilterChange]:[h,e.onTargetFilterChange],2),i=l[0],a=l[1];a?a({originalEvent:n,value:r}):i(r)},H=function(e,t){var n=g("source"===t?[L,V]:[F,_],2),r=n[0],i=n[1];return U&&l.ObjectUtils.isNotEmpty(r)?i(r):e},V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.trim().toLocaleLowerCase(e.filterLocale);return J(e.source,n)},_=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.trim().toLocaleLowerCase(e.filterLocale);return J(e.target,n)},J=function(t,r){var l=U?e.filterBy.split(","):[];return n.FilterService.filter(t,l,r,e.filterMatchMode,e.filterLocale)};c.useImperativeHandle(t,(function(){return{props:e,getElement:function(){return E.current}}})),r.useUpdateEffect((function(){w.current&&(M(w.current,O.current),w.current=null,O.current=null)}));var X=l.ObjectUtils.findDiffKeys(e,C.defaultProps),z=l.classNames("p-picklist p-component",e.className),Y=e.sourceItemTemplate?e.sourceItemTemplate:e.itemTemplate,$=e.targetItemTemplate?e.targetItemTemplate:e.itemTemplate,q=H(e.source,"source"),G=H(e.target,"target");return c.createElement("div",s({id:e.id,ref:E,className:z,style:e.style},X),e.showSourceControls&&c.createElement(S,{list:e.source,selection:j,onReorder:function(t){P(t,t.value,e.target),w.current=N.current.listElementRef.current,O.current=t.direction},className:"p-picklist-source-controls",dataKey:e.dataKey}),c.createElement(T,{ref:N,type:"source",list:q,selection:j,onSelectionChange:function(t){return A(t,"sourceSelection",e.onSourceSelectionChange)},itemTemplate:Y,header:e.sourceHeader,style:e.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:e.metaKeySelection,tabIndex:e.tabIndex,dataKey:e.dataKey,filterValue:L,onFilter:B,showFilter:x,placeholder:e.sourceFilterPlaceholder,template:e.sourceFilterTemplate}),c.createElement(k,{onTransfer:function(t){var n=t.originalEvent,r=t.source,l=t.target,i=[];switch(t.direction){case"toTarget":i=j,e.onMoveToTarget&&e.onMoveToTarget({originalEvent:n,value:i});break;case"allToTarget":i=e.source,e.onMoveAllToTarget&&e.onMoveAllToTarget({originalEvent:n,value:i});break;case"toSource":i=K,e.onMoveToSource&&e.onMoveToSource({originalEvent:n,value:i});break;case"allToSource":i=e.target,e.onMoveAllToSource&&e.onMoveAllToSource({originalEvent:n,value:i})}A({originalEvent:n,value:i},"sourceSelection",e.onSourceSelectionChange),A({originalEvent:n,value:i},"targetSelection",e.onTargetSelectionChange),P(t,r,l)},source:e.source,visibleSourceList:q,target:e.target,visibleTargetList:G,sourceSelection:j,targetSelection:K,dataKey:e.dataKey}),c.createElement(T,{ref:I,type:"target",list:G,selection:K,onSelectionChange:function(t){return A(t,"targetSelection",e.onTargetSelectionChange)},itemTemplate:$,header:e.targetHeader,style:e.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:e.metaKeySelection,tabIndex:e.tabIndex,dataKey:e.dataKey,filterValue:F,onFilter:B,showFilter:R,placeholder:e.targetFilterPlaceholder,template:e.targetFilterTemplate}),e.showTargetControls&&c.createElement(S,{list:e.target,selection:K,onReorder:function(t){P(t,e.source,t.value),w.current=I.current.listElementRef.current,O.current=t.direction},className:"p-picklist-target-controls",dataKey:e.dataKey}))})));return C.displayName="PickList",C.defaultProps={__TYPE:"PickList",id:null,source:null,target:null,sourceHeader:null,targetHeader:null,style:null,className:null,sourceStyle:null,targetStyle:null,sourceSelection:null,targetSelection:null,showSourceControls:!0,showTargetControls:!0,metaKeySelection:!0,filterBy:null,filterMatchMode:"contains",filterLocale:void 0,sourceFilterValue:null,targetFilterValue:null,showSourceFilter:!0,showTargetFilter:!0,sourceFilterPlaceholder:null,targetFilterPlaceholder:null,sourceFilterTemplate:null,targetFilterTemplate:null,tabIndex:0,dataKey:null,itemTemplate:null,sourceItemTemplate:null,targetItemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null,onSourceFilterChange:null,onTargetFilterChange:null},e.PickList=C,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.hooks,primereact.utils,primereact.button,primereact.ripple);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.picklist=function(e,t,n,r,l,i,a){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=o(t);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function p(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,i=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){o=!0,l=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw l}}return i}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e,t){return u(e)||p(e,t)||m(e,t)||d()}function v(e){if(Array.isArray(e))return f(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function b(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){return v(e)||y(e)||m(e)||b()}var S=c.memo((function(e){var t=!e.selection||!e.selection.length,n=l.classNames("p-picklist-buttons",e.className);return c.createElement("div",{className:n},c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-up",onClick:function(t){var n=e.selection;if(n&&n.length){for(var r=h(e.list),i=0;i<n.length;i++){var a=l.ObjectUtils.findIndexInList(n[i],r,e.dataKey);if(0===a)break;var o=r[a-1];r[a-1]=r[a],r[a]=o}e.onReorder&&e.onReorder({originalEvent:t,value:r,direction:"up"})}}}),c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-double-up",onClick:function(t){var n=e.selection;if(n&&n.length){for(var r=h(e.list),i=0;i<n.length;i++){var a=l.ObjectUtils.findIndexInList(n[i],r,e.dataKey);if(0===a)break;var o=r.splice(a,1)[0];r.unshift(o)}e.onReorder&&e.onReorder({originalEvent:t,value:r,direction:"top"})}}}),c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-down",onClick:function(t){var n=e.selection;if(n&&n.length){for(var r=h(e.list),i=n.length-1;i>=0;i--){var a=l.ObjectUtils.findIndexInList(n[i],r,e.dataKey);if(a===r.length-1)break;var o=r[a+1];r[a+1]=r[a],r[a]=o}e.onReorder&&e.onReorder({originalEvent:t,value:r,direction:"down"})}}}),c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-double-down",onClick:function(t){var n=e.selection;if(n&&n.length){for(var r=h(e.list),i=n.length-1;i>=0;i--){var a=l.ObjectUtils.findIndexInList(n[i],r,e.dataKey);if(a===r.length-1)break;var o=r.splice(a,1)[0];r.push(o)}e.onReorder&&e.onReorder({originalEvent:t,value:r,direction:"bottom"})}}}))}));S.displayName="PickListControls";var E=c.memo((function(e){var t=e.template?e.template(e.value):e.value,n=l.classNames("p-picklist-item",{"p-highlight":e.selected},e.className);return c.createElement("li",{className:n,onClick:function(t){e.onClick&&e.onClick({originalEvent:t,value:e.value})},onKeyDown:function(t){e.onKeyDown&&e.onKeyDown({originalEvent:t,value:e.value})},tabIndex:e.tabIndex,role:"option","aria-selected":e.selected},t,c.createElement(a.Ripple,null))}));E.displayName="PickListItem";var T=c.memo(c.forwardRef((function(e,t){var n=c.useRef(null),r=function(t){var n=t.originalEvent,r=t.value,i=h(e.selection),a=l.ObjectUtils.findIndexInList(r,i,e.dataKey),o=-1!==a;if(e.metaKeySelection){var c=n.metaKey||n.ctrlKey;o&&c?i.splice(a,1):(c||(i.length=0),i.push(r))}else o?i.splice(a,1):i.push(r);e.onSelectionChange&&e.onSelectionChange({event:n,value:i})},i=function(e){var t=e.originalEvent,n=t.currentTarget;switch(t.which){case 40:var l=a(n);l&&l.focus(),t.preventDefault();break;case 38:var i=o(n);i&&i.focus(),t.preventDefault();break;case 13:r(e),t.preventDefault()}},a=function e(t){var n=t.nextElementSibling;return n?l.DomHandler.hasClass(n,"p-picklist-item")?n:e(n):null},o=function e(t){var n=t.previousElementSibling;return n?l.DomHandler.hasClass(n,"p-picklist-item")?n:e(n):null},s=function(t){return-1!==l.ObjectUtils.findIndexInList(t,e.selection,e.dataKey)},u=function(t){e.onFilter&&e.onFilter({originalEvent:t,value:t.target.value,type:e.type})},p=function(e){13===e.which&&e.preventDefault()};c.useImperativeHandle(t,(function(){return{listElementRef:n}}));var f=l.classNames("p-picklist-list-wrapper",e.className),m=e.header?c.createElement("div",{className:"p-picklist-header"},l.ObjectUtils.getJSXElement(e.header,e)):null,d=function(){if(e.showFilter){var t=c.createElement("div",{className:"p-picklist-filter"},c.createElement("input",{type:"text",value:e.filterValue,onChange:u,onKeyDown:p,placeholder:e.placeholder,className:"p-picklist-filter-input p-inputtext p-component"}),c.createElement("span",{className:"p-picklist-filter-icon pi pi-search"}));if(e.filterTemplate)t=l.ObjectUtils.getJSXElement(e.filterTemplate,{className:"p-picklist-filter",inputProps:{className:"p-picklist-filter-input p-inputtext p-component",onChange:u,onKeyDown:p},iconClassName:"p-picklist-filter-icon pi pi-search",element:t,props:e});return c.createElement("div",{className:"p-picklist-filter-container"},t)}return null}(),g=function(){var t=e.list?e.list.map((function(t){var n=JSON.stringify(t),l=s(t);return c.createElement(E,{key:n,value:t,template:e.itemTemplate,selected:l,onClick:r,onKeyDown:i,tabIndex:e.tabIndex})})):null,n=l.classNames("p-picklist-list",e.listClassName);return c.createElement("ul",{className:n,style:e.style,role:"listbox","aria-multiselectable":!0},t)}();return c.createElement("div",{ref:n,className:f},m,d,g)})));T.displayName="PickListSubList";var k=c.memo((function(e){var t=l.ObjectUtils.isEmpty(e.sourceSelection)||l.ObjectUtils.isEmpty(e.visibleSourceList),n=l.ObjectUtils.isEmpty(e.targetSelection)||l.ObjectUtils.isEmpty(e.visibleTargetList),r=l.ObjectUtils.isEmpty(e.visibleSourceList),a=l.ObjectUtils.isEmpty(e.visibleTargetList),o=l.classNames("p-picklist-buttons p-picklist-transfer-buttons",e.className);return c.createElement("div",{className:o},c.createElement(i.Button,{disabled:t,type:"button",icon:"pi pi-angle-right",onClick:function(t){var n=e.sourceSelection;if(l.ObjectUtils.isNotEmpty(n)){for(var r=h(e.target),i=h(e.source),a=0;a<n.length;a++){var o=n[a];-1===l.ObjectUtils.findIndexInList(o,r,e.dataKey)&&r.push(i.splice(l.ObjectUtils.findIndexInList(o,i,e.dataKey),1)[0])}e.onTransfer&&e.onTransfer({originalEvent:t,source:i,target:r,direction:"toTarget"})}}}),c.createElement(i.Button,{disabled:r,type:"button",icon:"pi pi-angle-double-right",onClick:function(t){if(e.source){var n=[].concat(h(e.target),h(e.visibleSourceList)),r=e.source.filter((function(t){return!e.visibleSourceList.some((function(e){return e===t}))}));e.onTransfer&&e.onTransfer({originalEvent:t,source:r,target:n,direction:"allToTarget"})}}}),c.createElement(i.Button,{disabled:n,type:"button",icon:"pi pi-angle-left",onClick:function(t){var n=e.targetSelection;if(l.ObjectUtils.isNotEmpty(n)){for(var r=h(e.target),i=h(e.source),a=0;a<n.length;a++){var o=n[a];-1===l.ObjectUtils.findIndexInList(o,i,e.dataKey)&&i.push(r.splice(l.ObjectUtils.findIndexInList(o,r,e.dataKey),1)[0])}e.onTransfer&&e.onTransfer({originalEvent:t,source:i,target:r,direction:"toSource"})}}}),c.createElement(i.Button,{disabled:a,type:"button",icon:"pi pi-angle-double-left",onClick:function(t){if(e.source){var n=[].concat(h(e.source),h(e.visibleTargetList)),r=e.target.filter((function(t){return!e.visibleTargetList.some((function(e){return e===t}))}));e.onTransfer&&e.onTransfer({originalEvent:t,source:n,target:r,direction:"allToSource"})}}}))}));k.displayName="PickListTransferControls";var C=c.memo(c.forwardRef((function(e,t){var i=g(c.useState([]),2),a=i[0],o=i[1],u=g(c.useState([]),2),p=u[0],f=u[1],m=g(c.useState(""),2),d=m[0],v=m[1],y=g(c.useState(""),2),b=y[0],h=y[1],E=c.useRef(null),N=c.useRef(null),I=c.useRef(null),w=c.useRef(null),O=c.useRef(null),j=e.sourceSelection?e.sourceSelection:a,K=e.targetSelection?e.targetSelection:p,L=e.onSourceFilterChange?e.sourceFilterValue:d,F=e.onTargetFilterChange?e.targetFilterValue:b,U=l.ObjectUtils.isNotEmpty(e.filterBy),x=U&&e.showSourceFilter,R=U&&e.showTargetFilter,M=function(e,t){if(e){var n=l.DomHandler.findSingle(e,".p-picklist-list");switch(t){case"up":D(n,-1);break;case"top":n.scrollTop=0;break;case"down":D(n,1);break;case"bottom":setTimeout((function(){return n.scrollTop=n.scrollHeight}),100)}}},P=function(t,n,r){e.onChange&&e.onChange({originalEvent:t.originalEvent,source:n,target:r})},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getElementsByClassName("p-highlight");l.ObjectUtils.isNotEmpty(n)&&l.DomHandler.scrollInView(e,-1===t?n[0]:n[n.length-1])},A=function(e,t,n){"sourceSelection"===t?o(e.value):f(e.value),n&&n(e),l.ObjectUtils.isNotEmpty(j)&&"targetSelection"===t?o([]):l.ObjectUtils.isNotEmpty(K)&&"sourceSelection"===t&&f([])},B=function(t){var n=t.originalEvent,r=t.value,l=g("source"===t.type?[v,e.onSourceFilterChange]:[h,e.onTargetFilterChange],2),i=l[0],a=l[1];a?a({originalEvent:n,value:r}):i(r)},H=function(e,t){var n=g("source"===t?[L,V]:[F,_],2),r=n[0],i=n[1];return U&&l.ObjectUtils.isNotEmpty(r)?i(r):e},V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.trim().toLocaleLowerCase(e.filterLocale);return J(e.source,n)},_=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.trim().toLocaleLowerCase(e.filterLocale);return J(e.target,n)},J=function(t,r){var l=U?e.filterBy.split(","):[];return n.FilterService.filter(t,l,r,e.filterMatchMode,e.filterLocale)};c.useImperativeHandle(t,(function(){return{props:e,getElement:function(){return E.current}}})),r.useUpdateEffect((function(){w.current&&(M(w.current,O.current),w.current=null,O.current=null)}));var X=l.ObjectUtils.findDiffKeys(e,C.defaultProps),z=l.classNames("p-picklist p-component",e.className),Y=e.sourceItemTemplate?e.sourceItemTemplate:e.itemTemplate,$=e.targetItemTemplate?e.targetItemTemplate:e.itemTemplate,q=H(e.source,"source"),G=H(e.target,"target");return c.createElement("div",s({id:e.id,ref:E,className:z,style:e.style},X),e.showSourceControls&&c.createElement(S,{list:e.source,selection:j,onReorder:function(t){P(t,t.value,e.target),w.current=N.current.listElementRef.current,O.current=t.direction},className:"p-picklist-source-controls",dataKey:e.dataKey}),c.createElement(T,{ref:N,type:"source",list:q,selection:j,onSelectionChange:function(t){return A(t,"sourceSelection",e.onSourceSelectionChange)},itemTemplate:Y,header:e.sourceHeader,style:e.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:e.metaKeySelection,tabIndex:e.tabIndex,dataKey:e.dataKey,filterValue:L,onFilter:B,showFilter:x,placeholder:e.sourceFilterPlaceholder,template:e.sourceFilterTemplate}),c.createElement(k,{onTransfer:function(t){var n=t.originalEvent,r=t.source,l=t.target,i=[];switch(t.direction){case"toTarget":i=j,e.onMoveToTarget&&e.onMoveToTarget({originalEvent:n,value:i});break;case"allToTarget":i=e.source,e.onMoveAllToTarget&&e.onMoveAllToTarget({originalEvent:n,value:i});break;case"toSource":i=K,e.onMoveToSource&&e.onMoveToSource({originalEvent:n,value:i});break;case"allToSource":i=e.target,e.onMoveAllToSource&&e.onMoveAllToSource({originalEvent:n,value:i})}A({originalEvent:n,value:i},"sourceSelection",e.onSourceSelectionChange),A({originalEvent:n,value:i},"targetSelection",e.onTargetSelectionChange),P(t,r,l)},source:e.source,visibleSourceList:q,target:e.target,visibleTargetList:G,sourceSelection:j,targetSelection:K,dataKey:e.dataKey}),c.createElement(T,{ref:I,type:"target",list:G,selection:K,onSelectionChange:function(t){return A(t,"targetSelection",e.onTargetSelectionChange)},itemTemplate:$,header:e.targetHeader,style:e.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:e.metaKeySelection,tabIndex:e.tabIndex,dataKey:e.dataKey,filterValue:F,onFilter:B,showFilter:R,placeholder:e.targetFilterPlaceholder,template:e.targetFilterTemplate}),e.showTargetControls&&c.createElement(S,{list:e.target,selection:K,onReorder:function(t){P(t,e.source,t.value),w.current=I.current.listElementRef.current,O.current=t.direction},className:"p-picklist-target-controls",dataKey:e.dataKey}))})));return C.displayName="PickList",C.defaultProps={__TYPE:"PickList",id:null,source:null,target:null,sourceHeader:null,targetHeader:null,style:null,className:null,sourceStyle:null,targetStyle:null,sourceSelection:null,targetSelection:null,showSourceControls:!0,showTargetControls:!0,metaKeySelection:!0,filterBy:null,filterMatchMode:"contains",filterLocale:void 0,sourceFilterValue:null,targetFilterValue:null,showSourceFilter:!0,showTargetFilter:!0,sourceFilterPlaceholder:null,targetFilterPlaceholder:null,sourceFilterTemplate:null,targetFilterTemplate:null,tabIndex:0,dataKey:null,itemTemplate:null,sourceItemTemplate:null,targetItemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null,onSourceFilterChange:null,onTargetFilterChange:null},e.PickList=C,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.hooks,primereact.utils,primereact.button,primereact.ripple);
|