primereact 7.0.0-rc.2 → 7.2.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/LICENSE.md +1 -1
- package/README.md +35 -10
- package/accordion/accordion.cjs.js +55 -42
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +7 -3
- package/accordion/accordion.esm.js +42 -29
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +55 -43
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +109 -52
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +96 -61
- package/api/api.esm.js +96 -39
- package/api/api.esm.min.js +1 -1
- package/api/api.js +110 -53
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +97 -89
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +11 -4
- package/autocomplete/autocomplete.esm.js +34 -26
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +93 -90
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +21 -20
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +2 -1
- package/avatar/avatar.esm.js +16 -15
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +22 -21
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +14 -14
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +12 -12
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +15 -15
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +14 -14
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +12 -12
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +15 -15
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +38 -27
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +28 -18
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +37 -28
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +27 -27
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +12 -12
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +28 -28
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +44 -55
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +4 -11
- package/button/button.esm.js +33 -44
- package/button/button.esm.min.js +1 -1
- package/button/button.js +43 -56
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +209 -170
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +7 -2
- package/calendar/calendar.esm.js +84 -45
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +205 -171
- package/calendar/calendar.min.css +1 -1
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +12 -12
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.js +11 -11
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +13 -13
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +24 -24
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +12 -12
- package/card/card.esm.min.js +1 -1
- package/card/card.js +25 -25
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +60 -58
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +24 -23
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +59 -59
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +65 -61
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +21 -17
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +62 -62
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +19 -21
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +14 -14
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +18 -18
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +33 -28
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +2 -1
- package/checkbox/checkbox.esm.js +26 -21
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +33 -29
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +27 -25
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +3 -4
- package/chip/chip.esm.js +22 -20
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +28 -26
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +59 -33
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +10 -0
- package/chips/chips.esm.js +50 -24
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +59 -34
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +50 -46
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +20 -6
- package/colorpicker/colorpicker.esm.js +22 -18
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +47 -47
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.js +31 -12
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +28 -2
- package/column/column.esm.js +31 -12
- package/column/column.esm.min.js +1 -1
- package/column/column.js +32 -13
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.js +28 -12
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.js +28 -12
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +29 -13
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +35 -33
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +4 -3
- package/confirmdialog/confirmdialog.esm.js +19 -17
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +35 -34
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +60 -55
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +6 -4
- package/confirmpopup/confirmpopup.esm.js +26 -22
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +57 -55
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +81 -76
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +48 -44
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +78 -77
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +11284 -852
- package/core/core.min.js +40 -1
- package/csstransition/csstransition.cjs.js +62 -32
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.d.ts +8 -0
- package/csstransition/csstransition.esm.js +61 -32
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +62 -34
- package/csstransition/csstransition.min.js +1 -1
- package/csstransition/package.json +2 -1
- package/datascroller/datascroller.cjs.js +23 -22
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +15 -14
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +23 -23
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +838 -632
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +38 -14
- package/datatable/datatable.esm.js +575 -369
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +835 -633
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +43 -40
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +17 -14
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +42 -41
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +12 -12
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +11 -11
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +13 -13
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +78 -73
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +3 -1
- package/dialog/dialog.esm.js +31 -27
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +75 -74
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +15 -15
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +12 -12
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +16 -16
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +62 -28
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +13 -0
- package/dock/dock.esm.js +50 -16
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +62 -29
- package/dock/dock.min.css +1 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +120 -98
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +58 -36
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +116 -99
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +58 -56
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +22 -18
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +57 -53
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +31 -29
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fieldset/fieldset.esm.js +17 -15
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +30 -30
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +79 -69
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +4 -1
- package/fileupload/fileupload.esm.js +40 -30
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +79 -70
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +17 -19
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +12 -12
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +16 -16
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +85 -81
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +21 -18
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +82 -82
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +13 -13
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.js +12 -12
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +14 -14
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +69 -44
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +6 -5
- package/image/image.esm.js +44 -20
- package/image/image.esm.min.js +1 -1
- package/image/image.js +67 -45
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +19 -19
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +12 -12
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +20 -20
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +24 -23
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +17 -16
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +24 -24
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +90 -63
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +73 -46
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +89 -64
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +28 -25
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +21 -18
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +28 -26
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +25 -23
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +1 -1
- package/inputtext/inputtext.esm.js +16 -14
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +24 -24
- package/inputtext/inputtext.min.css +1 -1
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +23 -22
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +1 -1
- package/inputtextarea/inputtextarea.esm.js +15 -14
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +23 -23
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +9 -6
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +5 -2
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +10 -7
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +18 -18
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +12 -12
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +19 -19
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +52 -50
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +17 -15
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +51 -51
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +47 -46
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +13 -12
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +47 -47
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +69 -62
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -1
- package/mention/mention.esm.js +25 -19
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +64 -63
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +45 -40
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +4 -1
- package/menu/menu.esm.js +19 -15
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +42 -41
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +49 -46
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +15 -13
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +48 -47
- package/menubar/menubar.min.css +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +20 -19
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +3 -1
- package/message/message.esm.js +14 -13
- package/message/message.esm.min.js +1 -1
- package/message/message.js +21 -20
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +30 -28
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +2 -1
- package/messages/messages.esm.js +14 -12
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +29 -29
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +148 -136
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -2
- package/multiselect/multiselect.esm.js +64 -52
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +144 -137
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +27 -26
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +15 -14
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +27 -27
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +46 -45
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +13 -12
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +46 -46
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +37 -37
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +12 -12
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +38 -38
- package/organizationchart/organizationchart.min.css +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +45 -42
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +3 -2
- package/overlaypanel/overlaypanel.esm.js +23 -21
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +41 -43
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/overlayservice/overlayservice.cjs.js +2 -2
- package/overlayservice/overlayservice.cjs.min.js +1 -1
- package/overlayservice/overlayservice.esm.js +1 -1
- package/overlayservice/overlayservice.esm.min.js +1 -1
- package/overlayservice/overlayservice.js +3 -3
- package/overlayservice/overlayservice.min.js +1 -1
- package/package.json +11 -4
- package/paginator/paginator.cjs.js +61 -60
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +15 -14
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +61 -61
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +35 -32
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +20 -17
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +34 -33
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +53 -52
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/panelmenu/panelmenu.esm.js +15 -14
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +53 -53
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +47 -43
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +3 -2
- package/password/password.esm.js +21 -17
- package/password/password.esm.min.js +1 -1
- package/password/password.js +44 -44
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +69 -65
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +25 -21
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +69 -66
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +17 -20
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +15 -18
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +18 -22
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +3793 -2921
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2567 -1694
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +3792 -2918
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +20 -20
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +12 -12
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +21 -21
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +16 -16
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +12 -12
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +17 -17
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +23 -22
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +15 -14
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +23 -23
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +23 -22
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +17 -16
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +23 -23
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +216 -140
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +94 -42
- package/resources/themes/arya-green/theme.css +94 -42
- package/resources/themes/arya-orange/theme.css +94 -42
- package/resources/themes/arya-purple/theme.css +94 -42
- package/resources/themes/bootstrap4-dark-blue/theme.css +75 -30
- package/resources/themes/bootstrap4-dark-purple/theme.css +75 -30
- package/resources/themes/bootstrap4-light-blue/theme.css +74 -29
- package/resources/themes/bootstrap4-light-purple/theme.css +74 -29
- package/resources/themes/fluent-light/theme.css +94 -42
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/theme.css +5707 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/theme.css +5707 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/theme.css +5707 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/theme.css +5707 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/theme.css +5707 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/theme.css +5707 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/theme.css +5707 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/theme.css +5707 -0
- package/resources/themes/luna-amber/theme.css +91 -46
- package/resources/themes/luna-blue/theme.css +91 -46
- package/resources/themes/luna-green/theme.css +91 -46
- package/resources/themes/luna-pink/theme.css +91 -46
- package/resources/themes/md-dark-deeppurple/theme.css +265 -53
- package/resources/themes/md-dark-indigo/theme.css +265 -53
- package/resources/themes/md-light-deeppurple/theme.css +265 -53
- package/resources/themes/md-light-indigo/theme.css +265 -53
- package/resources/themes/mdc-dark-deeppurple/theme.css +265 -53
- package/resources/themes/mdc-dark-indigo/theme.css +265 -53
- package/resources/themes/mdc-light-deeppurple/theme.css +265 -53
- package/resources/themes/mdc-light-indigo/theme.css +265 -53
- package/resources/themes/nova/theme.css +91 -46
- package/resources/themes/nova-accent/theme.css +91 -46
- package/resources/themes/nova-alt/theme.css +91 -46
- package/resources/themes/rhea/theme.css +91 -46
- package/resources/themes/saga-blue/theme.css +77 -25
- package/resources/themes/saga-green/theme.css +77 -25
- package/resources/themes/saga-orange/theme.css +77 -25
- package/resources/themes/saga-purple/theme.css +77 -25
- package/resources/themes/tailwind-light/theme.css +101 -49
- package/resources/themes/vela-blue/theme.css +94 -42
- package/resources/themes/vela-green/theme.css +94 -42
- package/resources/themes/vela-orange/theme.css +94 -42
- package/resources/themes/vela-purple/theme.css +94 -42
- package/ripple/ripple.cjs.js +22 -22
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +14 -14
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +23 -23
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +12 -12
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.js +11 -11
- package/row/row.esm.min.js +1 -1
- package/row/row.js +13 -13
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +30 -30
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +12 -12
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +31 -31
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +30 -25
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +4 -2
- package/scrolltop/scrolltop.esm.js +21 -17
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +28 -26
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +31 -29
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +17 -15
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +30 -30
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +3 -1
- package/sidebar/sidebar.cjs.js +154 -127
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +4 -1
- package/sidebar/sidebar.esm.js +145 -119
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +151 -128
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +14 -14
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +12 -12
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +15 -15
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +49 -44
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +19 -15
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +46 -45
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +40 -30
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +32 -22
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +41 -31
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +33 -32
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +3 -2
- package/speeddial/speeddial.esm.js +15 -14
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +33 -33
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +58 -50
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +8 -6
- package/splitbutton/splitbutton.esm.js +28 -20
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +55 -51
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +31 -31
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +14 -14
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +32 -32
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +21 -21
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +12 -12
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +22 -22
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +28 -28
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +12 -12
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +29 -29
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +27 -26
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +13 -12
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +27 -27
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +224 -79
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +12 -1
- package/tabview/tabview.esm.js +194 -49
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +224 -80
- package/tabview/tabview.min.css +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +20 -19
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +2 -1
- package/tag/tag.esm.js +16 -15
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +21 -20
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +23 -23
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +12 -12
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +24 -24
- package/terminal/terminal.min.js +1 -1
- package/terminalservice/terminalservice.cjs.js +2 -2
- package/terminalservice/terminalservice.cjs.min.js +1 -1
- package/terminalservice/terminalservice.esm.js +1 -1
- package/terminalservice/terminalservice.esm.min.js +1 -1
- package/terminalservice/terminalservice.js +3 -3
- package/terminalservice/terminalservice.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +54 -48
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +20 -15
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +50 -49
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +23 -23
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +12 -12
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +24 -24
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +72 -55
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +5 -1
- package/toast/toast.esm.js +46 -30
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +69 -56
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +27 -22
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +3 -2
- package/togglebutton/togglebutton.esm.js +21 -16
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +26 -23
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +18 -18
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +12 -12
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +19 -19
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +78 -49
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +49 -21
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +77 -50
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +2 -0
- package/tree/tree.cjs.js +69 -68
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +14 -3
- package/tree/tree.esm.js +19 -18
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +69 -69
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +4 -1
- package/treeselect/treeselect.cjs.js +66 -62
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +11 -3
- package/treeselect/treeselect.esm.js +26 -22
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +63 -63
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +1393 -330
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +11 -3
- package/treetable/treetable.esm.js +1303 -240
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +1392 -331
- package/treetable/treetable.min.css +1 -1
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +24 -23
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +15 -14
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +24 -24
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +174 -51
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +18 -0
- package/utils/utils.esm.js +173 -51
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +175 -52
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +79 -53
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +64 -38
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +80 -54
- package/virtualscroller/virtualscroller.min.css +1 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +45 -8
- package/core/core.cjs.js +0 -2987
- package/core/core.cjs.min.js +0 -1
- package/core/core.esm.js +0 -2963
- package/core/core.esm.min.js +0 -1
- package/core/package.json +0 -5
- package/util.d.ts +0 -1
package/picklist/picklist.cjs.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var utils = require('primereact/utils');
|
|
7
|
+
var ripple = require('primereact/ripple');
|
|
7
8
|
var button = require('primereact/button');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -29,6 +30,9 @@ function _defineProperties(target, props) {
|
|
|
29
30
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
30
31
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
31
32
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
33
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
34
|
+
writable: false
|
|
35
|
+
});
|
|
32
36
|
return Constructor;
|
|
33
37
|
}
|
|
34
38
|
|
|
@@ -61,23 +65,20 @@ function _inherits(subClass, superClass) {
|
|
|
61
65
|
configurable: true
|
|
62
66
|
}
|
|
63
67
|
});
|
|
68
|
+
Object.defineProperty(subClass, "prototype", {
|
|
69
|
+
writable: false
|
|
70
|
+
});
|
|
64
71
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
function _typeof(obj) {
|
|
68
75
|
"@babel/helpers - typeof";
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
_typeof = function _typeof(obj) {
|
|
76
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return _typeof(obj);
|
|
77
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
78
|
+
return typeof obj;
|
|
79
|
+
} : function (obj) {
|
|
80
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
81
|
+
}, _typeof(obj);
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -208,17 +209,17 @@ var PickListItem = /*#__PURE__*/function (_Component) {
|
|
|
208
209
|
key: "render",
|
|
209
210
|
value: function render() {
|
|
210
211
|
var content = this.props.template ? this.props.template(this.props.value) : this.props.value;
|
|
211
|
-
var className =
|
|
212
|
+
var className = utils.classNames('p-picklist-item', {
|
|
212
213
|
'p-highlight': this.props.selected
|
|
213
214
|
}, this.props.className);
|
|
214
|
-
return /*#__PURE__*/React__default[
|
|
215
|
+
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
215
216
|
className: className,
|
|
216
217
|
onClick: this.onClick,
|
|
217
218
|
onKeyDown: this.onKeyDown,
|
|
218
219
|
tabIndex: this.props.tabIndex,
|
|
219
220
|
role: "option",
|
|
220
221
|
"aria-selected": this.props.selected
|
|
221
|
-
}, content, /*#__PURE__*/React__default[
|
|
222
|
+
}, content, /*#__PURE__*/React__default["default"].createElement(ripple.Ripple, null));
|
|
222
223
|
}
|
|
223
224
|
}]);
|
|
224
225
|
|
|
@@ -263,7 +264,7 @@ var PickListSubListComponent = /*#__PURE__*/function (_Component) {
|
|
|
263
264
|
|
|
264
265
|
var selection = _toConsumableArray(this.props.selection);
|
|
265
266
|
|
|
266
|
-
var index =
|
|
267
|
+
var index = utils.ObjectUtils.findIndexInList(item, selection, this.props.dataKey);
|
|
267
268
|
var selected = index !== -1;
|
|
268
269
|
var metaSelection = this.props.metaKeySelection;
|
|
269
270
|
|
|
@@ -329,18 +330,18 @@ var PickListSubListComponent = /*#__PURE__*/function (_Component) {
|
|
|
329
330
|
key: "findNextItem",
|
|
330
331
|
value: function findNextItem(item) {
|
|
331
332
|
var nextItem = item.nextElementSibling;
|
|
332
|
-
if (nextItem) return !
|
|
333
|
+
if (nextItem) return !utils.DomHandler.hasClass(nextItem, 'p-picklist-item') ? this.findNextItem(nextItem) : nextItem;else return null;
|
|
333
334
|
}
|
|
334
335
|
}, {
|
|
335
336
|
key: "findPrevItem",
|
|
336
337
|
value: function findPrevItem(item) {
|
|
337
338
|
var prevItem = item.previousElementSibling;
|
|
338
|
-
if (prevItem) return !
|
|
339
|
+
if (prevItem) return !utils.DomHandler.hasClass(prevItem, 'p-picklist-item') ? this.findPrevItem(prevItem) : prevItem;else return null;
|
|
339
340
|
}
|
|
340
341
|
}, {
|
|
341
342
|
key: "isSelected",
|
|
342
343
|
value: function isSelected(item) {
|
|
343
|
-
return
|
|
344
|
+
return utils.ObjectUtils.findIndexInList(item, this.props.selection, this.props.dataKey) !== -1;
|
|
344
345
|
}
|
|
345
346
|
}, {
|
|
346
347
|
key: "render",
|
|
@@ -349,18 +350,18 @@ var PickListSubListComponent = /*#__PURE__*/function (_Component) {
|
|
|
349
350
|
|
|
350
351
|
var header = null;
|
|
351
352
|
var items = null;
|
|
352
|
-
var wrapperClassName =
|
|
353
|
-
var listClassName =
|
|
353
|
+
var wrapperClassName = utils.classNames('p-picklist-list-wrapper', this.props.className);
|
|
354
|
+
var listClassName = utils.classNames('p-picklist-list', this.props.listClassName);
|
|
354
355
|
|
|
355
356
|
if (this.props.header) {
|
|
356
|
-
header = /*#__PURE__*/React__default[
|
|
357
|
+
header = /*#__PURE__*/React__default["default"].createElement("div", {
|
|
357
358
|
className: "p-picklist-header"
|
|
358
|
-
},
|
|
359
|
+
}, utils.ObjectUtils.getJSXElement(this.props.header, this.props));
|
|
359
360
|
}
|
|
360
361
|
|
|
361
362
|
if (this.props.list) {
|
|
362
363
|
items = this.props.list.map(function (item, i) {
|
|
363
|
-
return /*#__PURE__*/React__default[
|
|
364
|
+
return /*#__PURE__*/React__default["default"].createElement(PickListItem, {
|
|
364
365
|
key: JSON.stringify(item),
|
|
365
366
|
value: item,
|
|
366
367
|
template: _this2.props.itemTemplate,
|
|
@@ -372,10 +373,10 @@ var PickListSubListComponent = /*#__PURE__*/function (_Component) {
|
|
|
372
373
|
});
|
|
373
374
|
}
|
|
374
375
|
|
|
375
|
-
return /*#__PURE__*/React__default[
|
|
376
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
376
377
|
ref: this.props.forwardRef,
|
|
377
378
|
className: wrapperClassName
|
|
378
|
-
}, header, /*#__PURE__*/React__default[
|
|
379
|
+
}, header, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
379
380
|
className: listClassName,
|
|
380
381
|
style: this.props.style,
|
|
381
382
|
role: "listbox",
|
|
@@ -387,8 +388,8 @@ var PickListSubListComponent = /*#__PURE__*/function (_Component) {
|
|
|
387
388
|
return PickListSubListComponent;
|
|
388
389
|
}(React.Component);
|
|
389
390
|
|
|
390
|
-
var PickListSubList = /*#__PURE__*/React__default[
|
|
391
|
-
return /*#__PURE__*/React__default[
|
|
391
|
+
var PickListSubList = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
392
|
+
return /*#__PURE__*/React__default["default"].createElement(PickListSubListComponent, _extends({
|
|
392
393
|
forwardRef: ref
|
|
393
394
|
}, props));
|
|
394
395
|
});
|
|
@@ -424,7 +425,7 @@ var PickListControls = /*#__PURE__*/function (_Component) {
|
|
|
424
425
|
|
|
425
426
|
for (var i = 0; i < selectedItems.length; i++) {
|
|
426
427
|
var selectedItem = selectedItems[i];
|
|
427
|
-
var selectedItemIndex =
|
|
428
|
+
var selectedItemIndex = utils.ObjectUtils.findIndexInList(selectedItem, list, this.props.dataKey);
|
|
428
429
|
|
|
429
430
|
if (selectedItemIndex !== 0) {
|
|
430
431
|
var movedItem = list[selectedItemIndex];
|
|
@@ -455,7 +456,7 @@ var PickListControls = /*#__PURE__*/function (_Component) {
|
|
|
455
456
|
|
|
456
457
|
for (var i = 0; i < selectedItems.length; i++) {
|
|
457
458
|
var selectedItem = selectedItems[i];
|
|
458
|
-
var selectedItemIndex =
|
|
459
|
+
var selectedItemIndex = utils.ObjectUtils.findIndexInList(selectedItem, list, this.props.dataKey);
|
|
459
460
|
|
|
460
461
|
if (selectedItemIndex !== 0) {
|
|
461
462
|
var movedItem = list.splice(selectedItemIndex, 1)[0];
|
|
@@ -484,7 +485,7 @@ var PickListControls = /*#__PURE__*/function (_Component) {
|
|
|
484
485
|
|
|
485
486
|
for (var i = selectedItems.length - 1; i >= 0; i--) {
|
|
486
487
|
var selectedItem = selectedItems[i];
|
|
487
|
-
var selectedItemIndex =
|
|
488
|
+
var selectedItemIndex = utils.ObjectUtils.findIndexInList(selectedItem, list, this.props.dataKey);
|
|
488
489
|
|
|
489
490
|
if (selectedItemIndex !== list.length - 1) {
|
|
490
491
|
var movedItem = list[selectedItemIndex];
|
|
@@ -517,7 +518,7 @@ var PickListControls = /*#__PURE__*/function (_Component) {
|
|
|
517
518
|
|
|
518
519
|
for (var i = selectedItems.length - 1; i >= 0; i--) {
|
|
519
520
|
var selectedItem = selectedItems[i];
|
|
520
|
-
var selectedItemIndex =
|
|
521
|
+
var selectedItemIndex = utils.ObjectUtils.findIndexInList(selectedItem, list, this.props.dataKey);
|
|
521
522
|
|
|
522
523
|
if (selectedItemIndex !== list.length - 1) {
|
|
523
524
|
var movedItem = list.splice(selectedItemIndex, 1)[0];
|
|
@@ -540,25 +541,25 @@ var PickListControls = /*#__PURE__*/function (_Component) {
|
|
|
540
541
|
key: "render",
|
|
541
542
|
value: function render() {
|
|
542
543
|
var moveDisabled = !this.props.selection.length;
|
|
543
|
-
var className =
|
|
544
|
-
return /*#__PURE__*/React__default[
|
|
544
|
+
var className = utils.classNames('p-picklist-buttons', this.props.className);
|
|
545
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
545
546
|
className: className
|
|
546
|
-
}, /*#__PURE__*/React__default[
|
|
547
|
+
}, /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
547
548
|
disabled: moveDisabled,
|
|
548
549
|
type: "button",
|
|
549
550
|
icon: "pi pi-angle-up",
|
|
550
551
|
onClick: this.moveUp
|
|
551
|
-
}), /*#__PURE__*/React__default[
|
|
552
|
+
}), /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
552
553
|
disabled: moveDisabled,
|
|
553
554
|
type: "button",
|
|
554
555
|
icon: "pi pi-angle-double-up",
|
|
555
556
|
onClick: this.moveTop
|
|
556
|
-
}), /*#__PURE__*/React__default[
|
|
557
|
+
}), /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
557
558
|
disabled: moveDisabled,
|
|
558
559
|
type: "button",
|
|
559
560
|
icon: "pi pi-angle-down",
|
|
560
561
|
onClick: this.moveDown
|
|
561
|
-
}), /*#__PURE__*/React__default[
|
|
562
|
+
}), /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
562
563
|
disabled: moveDisabled,
|
|
563
564
|
type: "button",
|
|
564
565
|
icon: "pi pi-angle-double-down",
|
|
@@ -596,7 +597,7 @@ var PickListTransferControls = /*#__PURE__*/function (_Component) {
|
|
|
596
597
|
value: function moveRight(event) {
|
|
597
598
|
var selection = this.props.sourceSelection;
|
|
598
599
|
|
|
599
|
-
if (selection
|
|
600
|
+
if (utils.ObjectUtils.isNotEmpty(selection)) {
|
|
600
601
|
var targetList = _toConsumableArray(this.props.target);
|
|
601
602
|
|
|
602
603
|
var sourceList = _toConsumableArray(this.props.source);
|
|
@@ -604,8 +605,8 @@ var PickListTransferControls = /*#__PURE__*/function (_Component) {
|
|
|
604
605
|
for (var i = 0; i < selection.length; i++) {
|
|
605
606
|
var selectedItem = selection[i];
|
|
606
607
|
|
|
607
|
-
if (
|
|
608
|
-
targetList.push(sourceList.splice(
|
|
608
|
+
if (utils.ObjectUtils.findIndexInList(selectedItem, targetList, this.props.dataKey) === -1) {
|
|
609
|
+
targetList.push(sourceList.splice(utils.ObjectUtils.findIndexInList(selectedItem, sourceList, this.props.dataKey), 1)[0]);
|
|
609
610
|
}
|
|
610
611
|
}
|
|
611
612
|
|
|
@@ -641,7 +642,7 @@ var PickListTransferControls = /*#__PURE__*/function (_Component) {
|
|
|
641
642
|
value: function moveLeft(event) {
|
|
642
643
|
var selection = this.props.targetSelection;
|
|
643
644
|
|
|
644
|
-
if (selection
|
|
645
|
+
if (utils.ObjectUtils.isNotEmpty(selection)) {
|
|
645
646
|
var targetList = _toConsumableArray(this.props.target);
|
|
646
647
|
|
|
647
648
|
var sourceList = _toConsumableArray(this.props.source);
|
|
@@ -649,8 +650,8 @@ var PickListTransferControls = /*#__PURE__*/function (_Component) {
|
|
|
649
650
|
for (var i = 0; i < selection.length; i++) {
|
|
650
651
|
var selectedItem = selection[i];
|
|
651
652
|
|
|
652
|
-
if (
|
|
653
|
-
sourceList.push(targetList.splice(
|
|
653
|
+
if (utils.ObjectUtils.findIndexInList(selectedItem, sourceList, this.props.dataKey) === -1) {
|
|
654
|
+
sourceList.push(targetList.splice(utils.ObjectUtils.findIndexInList(selectedItem, targetList, this.props.dataKey), 1)[0]);
|
|
654
655
|
}
|
|
655
656
|
}
|
|
656
657
|
|
|
@@ -684,29 +685,29 @@ var PickListTransferControls = /*#__PURE__*/function (_Component) {
|
|
|
684
685
|
}, {
|
|
685
686
|
key: "render",
|
|
686
687
|
value: function render() {
|
|
687
|
-
var moveRightDisabled =
|
|
688
|
-
var moveLeftDisabled =
|
|
689
|
-
var moveAllRightDisabled =
|
|
690
|
-
var moveAllLeftDisabled =
|
|
691
|
-
var className =
|
|
692
|
-
return /*#__PURE__*/React__default[
|
|
688
|
+
var moveRightDisabled = utils.ObjectUtils.isEmpty(this.props.sourceSelection);
|
|
689
|
+
var moveLeftDisabled = utils.ObjectUtils.isEmpty(this.props.targetSelection);
|
|
690
|
+
var moveAllRightDisabled = utils.ObjectUtils.isEmpty(this.props.source);
|
|
691
|
+
var moveAllLeftDisabled = utils.ObjectUtils.isEmpty(this.props.target);
|
|
692
|
+
var className = utils.classNames('p-picklist-buttons p-picklist-transfer-buttons', this.props.className);
|
|
693
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
693
694
|
className: className
|
|
694
|
-
}, /*#__PURE__*/React__default[
|
|
695
|
+
}, /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
695
696
|
disabled: moveRightDisabled,
|
|
696
697
|
type: "button",
|
|
697
698
|
icon: "pi pi-angle-right",
|
|
698
699
|
onClick: this.moveRight
|
|
699
|
-
}), /*#__PURE__*/React__default[
|
|
700
|
+
}), /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
700
701
|
disabled: moveAllRightDisabled,
|
|
701
702
|
type: "button",
|
|
702
703
|
icon: "pi pi-angle-double-right",
|
|
703
704
|
onClick: this.moveAllRight
|
|
704
|
-
}), /*#__PURE__*/React__default[
|
|
705
|
+
}), /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
705
706
|
disabled: moveLeftDisabled,
|
|
706
707
|
type: "button",
|
|
707
708
|
icon: "pi pi-angle-left",
|
|
708
709
|
onClick: this.moveLeft
|
|
709
|
-
}), /*#__PURE__*/React__default[
|
|
710
|
+
}), /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
710
711
|
disabled: moveAllLeftDisabled,
|
|
711
712
|
type: "button",
|
|
712
713
|
icon: "pi pi-angle-double-left",
|
|
@@ -776,7 +777,7 @@ var PickList = /*#__PURE__*/function (_Component) {
|
|
|
776
777
|
key: "handleScrollPosition",
|
|
777
778
|
value: function handleScrollPosition(listElement, direction) {
|
|
778
779
|
if (listElement) {
|
|
779
|
-
var listContainer =
|
|
780
|
+
var listContainer = utils.DomHandler.findSingle(listElement, '.p-picklist-list');
|
|
780
781
|
|
|
781
782
|
switch (direction) {
|
|
782
783
|
case 'up':
|
|
@@ -873,7 +874,10 @@ var PickList = /*#__PURE__*/function (_Component) {
|
|
|
873
874
|
value: function scrollInView(listContainer) {
|
|
874
875
|
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
875
876
|
var selectedItems = listContainer.getElementsByClassName('p-highlight');
|
|
876
|
-
|
|
877
|
+
|
|
878
|
+
if (utils.ObjectUtils.isNotEmpty(selectedItems)) {
|
|
879
|
+
utils.DomHandler.scrollInView(listContainer, direction === -1 ? selectedItems[0] : selectedItems[selectedItems.length - 1]);
|
|
880
|
+
}
|
|
877
881
|
}
|
|
878
882
|
}, {
|
|
879
883
|
key: "onSelectionChange",
|
|
@@ -884,11 +888,11 @@ var PickList = /*#__PURE__*/function (_Component) {
|
|
|
884
888
|
this.setState(_defineProperty({}, stateKey, e.value));
|
|
885
889
|
}
|
|
886
890
|
|
|
887
|
-
if (
|
|
891
|
+
if (utils.ObjectUtils.isNotEmpty(this.state.sourceSelection) && stateKey === 'targetSelection') {
|
|
888
892
|
this.setState({
|
|
889
893
|
sourceSelection: []
|
|
890
894
|
});
|
|
891
|
-
} else if (
|
|
895
|
+
} else if (utils.ObjectUtils.isNotEmpty(this.state.targetSelection) && stateKey === 'sourceSelection') {
|
|
892
896
|
this.setState({
|
|
893
897
|
targetSelection: []
|
|
894
898
|
});
|
|
@@ -908,20 +912,20 @@ var PickList = /*#__PURE__*/function (_Component) {
|
|
|
908
912
|
value: function render() {
|
|
909
913
|
var _this2 = this;
|
|
910
914
|
|
|
911
|
-
var className =
|
|
915
|
+
var className = utils.classNames('p-picklist p-component', this.props.className);
|
|
912
916
|
var sourceSelection = this.getSourceSelection();
|
|
913
917
|
var targetSelection = this.getTargetSelection();
|
|
914
|
-
return /*#__PURE__*/React__default[
|
|
918
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
915
919
|
id: this.props.id,
|
|
916
920
|
className: className,
|
|
917
921
|
style: this.props.style
|
|
918
|
-
}, this.props.showSourceControls && /*#__PURE__*/React__default[
|
|
922
|
+
}, this.props.showSourceControls && /*#__PURE__*/React__default["default"].createElement(PickListControls, {
|
|
919
923
|
list: this.props.source,
|
|
920
924
|
selection: sourceSelection,
|
|
921
925
|
onReorder: this.onSourceReorder,
|
|
922
926
|
className: "p-picklist-source-controls",
|
|
923
927
|
dataKey: this.props.dataKey
|
|
924
|
-
}), /*#__PURE__*/React__default[
|
|
928
|
+
}), /*#__PURE__*/React__default["default"].createElement(PickListSubList, {
|
|
925
929
|
ref: function ref(el) {
|
|
926
930
|
return _this2.sourceListElement = el;
|
|
927
931
|
},
|
|
@@ -938,14 +942,14 @@ var PickList = /*#__PURE__*/function (_Component) {
|
|
|
938
942
|
metaKeySelection: this.props.metaKeySelection,
|
|
939
943
|
tabIndex: this.props.tabIndex,
|
|
940
944
|
dataKey: this.props.dataKey
|
|
941
|
-
}), /*#__PURE__*/React__default[
|
|
945
|
+
}), /*#__PURE__*/React__default["default"].createElement(PickListTransferControls, {
|
|
942
946
|
onTransfer: this.onTransfer,
|
|
943
947
|
source: this.props.source,
|
|
944
948
|
target: this.props.target,
|
|
945
949
|
sourceSelection: sourceSelection,
|
|
946
950
|
targetSelection: targetSelection,
|
|
947
951
|
dataKey: this.props.dataKey
|
|
948
|
-
}), /*#__PURE__*/React__default[
|
|
952
|
+
}), /*#__PURE__*/React__default["default"].createElement(PickListSubList, {
|
|
949
953
|
ref: function ref(el) {
|
|
950
954
|
return _this2.targetListElement = el;
|
|
951
955
|
},
|
|
@@ -962,7 +966,7 @@ var PickList = /*#__PURE__*/function (_Component) {
|
|
|
962
966
|
metaKeySelection: this.props.metaKeySelection,
|
|
963
967
|
tabIndex: this.props.tabIndex,
|
|
964
968
|
dataKey: this.props.dataKey
|
|
965
|
-
}), this.props.showTargetControls && /*#__PURE__*/React__default[
|
|
969
|
+
}), this.props.showTargetControls && /*#__PURE__*/React__default["default"].createElement(PickListControls, {
|
|
966
970
|
list: this.props.target,
|
|
967
971
|
selection: targetSelection,
|
|
968
972
|
onReorder: this.onTargetReorder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/core"),n=require("primereact/button");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(e);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return a(e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function m(e){if(Array.isArray(e))return g(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function b(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function S(){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 k(e){return m(e)||y(e)||b(e)||S()}function T(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var E=function(n){p(u,e.Component);var o,s,c=(o=u,s=T(),function(){var e,t=f(o);if(s){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h(this,e)});function u(e){var t;return i(this,u),(t=c.call(this,e)).onClick=t.onClick.bind(a(t)),t.onKeyDown=t.onKeyDown.bind(a(t)),t}return l(u,[{key:"onClick",value:function(e){this.props.onClick&&this.props.onClick({originalEvent:e,value:this.props.value})}},{key:"onKeyDown",value:function(e){this.props.onKeyDown&&this.props.onKeyDown({originalEvent:e,value:this.props.value})}},{key:"render",value:function(){var e=this.props.template?this.props.template(this.props.value):this.props.value,n=t.classNames("p-picklist-item",{"p-highlight":this.props.selected},this.props.className);return r.default.createElement("li",{className:n,onClick:this.onClick,onKeyDown:this.onKeyDown,tabIndex:this.props.tabIndex,role:"option","aria-selected":this.props.selected},e,r.default.createElement(t.Ripple,null))}}]),u}();function C(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}d(E,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var R=function(n){p(u,e.Component);var o,s,c=(o=u,s=C(),function(){var e,t=f(o);if(s){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h(this,e)});function u(e){var t;return i(this,u),(t=c.call(this,e)).onItemClick=t.onItemClick.bind(a(t)),t.onItemKeyDown=t.onItemKeyDown.bind(a(t)),t}return l(u,[{key:"onItemClick",value:function(e){var n=e.originalEvent,o=e.value,r=k(this.props.selection),i=t.ObjectUtils.findIndexInList(o,r,this.props.dataKey),s=-1!==i;if(this.props.metaKeySelection){var l=n.metaKey||n.ctrlKey;s&&l?r.splice(i,1):(l||(r.length=0),r.push(o))}else s?r.splice(i,1):r.push(o);this.props.onSelectionChange&&this.props.onSelectionChange({event:n,value:r})}},{key:"onItemKeyDown",value:function(e){var t=e.originalEvent.currentTarget;switch(e.originalEvent.which){case 40:var n=this.findNextItem(t);n&&n.focus(),e.originalEvent.preventDefault();break;case 38:var o=this.findPrevItem(t);o&&o.focus(),e.originalEvent.preventDefault();break;case 13:this.onItemClick(e),e.originalEvent.preventDefault()}}},{key:"findNextItem",value:function(e){var n=e.nextElementSibling;return n?t.DomHandler.hasClass(n,"p-picklist-item")?n:this.findNextItem(n):null}},{key:"findPrevItem",value:function(e){var n=e.previousElementSibling;return n?t.DomHandler.hasClass(n,"p-picklist-item")?n:this.findPrevItem(n):null}},{key:"isSelected",value:function(e){return-1!==t.ObjectUtils.findIndexInList(e,this.props.selection,this.props.dataKey)}},{key:"render",value:function(){var e=this,n=null,o=null,i=t.classNames("p-picklist-list-wrapper",this.props.className),s=t.classNames("p-picklist-list",this.props.listClassName);return this.props.header&&(n=r.default.createElement("div",{className:"p-picklist-header"},t.ObjectUtils.getJSXElement(this.props.header,this.props))),this.props.list&&(o=this.props.list.map((function(t,n){return r.default.createElement(E,{key:JSON.stringify(t),value:t,template:e.props.itemTemplate,selected:e.isSelected(t),onClick:e.onItemClick,onKeyDown:e.onItemKeyDown,tabIndex:e.props.tabIndex})}))),r.default.createElement("div",{ref:this.props.forwardRef,className:i},n,r.default.createElement("ul",{className:s,style:this.props.style,role:"listbox","aria-multiselectable":!0},o))}}]),u}(),w=r.default.forwardRef((function(e,t){return r.default.createElement(R,v({forwardRef:t},e))}));function I(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var K=function(o){p(d,e.Component);var s,c,u=(s=d,c=I(),function(){var e,t=f(s);if(c){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h(this,e)});function d(e){var t;return i(this,d),(t=u.call(this,e)).moveUp=t.moveUp.bind(a(t)),t.moveTop=t.moveTop.bind(a(t)),t.moveDown=t.moveDown.bind(a(t)),t.moveBottom=t.moveBottom.bind(a(t)),t}return l(d,[{key:"moveUp",value:function(e){var n=this.props.selection;if(n&&n.length){for(var o=k(this.props.list),r=0;r<n.length;r++){var i=t.ObjectUtils.findIndexInList(n[r],o,this.props.dataKey);if(0===i)break;var s=o[i-1];o[i-1]=o[i],o[i]=s}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"up"})}}},{key:"moveTop",value:function(e){var n=this.props.selection;if(n&&n.length){for(var o=k(this.props.list),r=0;r<n.length;r++){var i=t.ObjectUtils.findIndexInList(n[r],o,this.props.dataKey);if(0===i)break;var s=o.splice(i,1)[0];o.unshift(s)}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"top"})}}},{key:"moveDown",value:function(e){var n=this.props.selection;if(n&&n.length){for(var o=k(this.props.list),r=n.length-1;r>=0;r--){var i=t.ObjectUtils.findIndexInList(n[r],o,this.props.dataKey);if(i===o.length-1)break;var s=o[i+1];o[i+1]=o[i],o[i]=s}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"down"}),this.movedDown=!0}}},{key:"moveBottom",value:function(e){var n=this.props.selection;if(n&&n.length){for(var o=k(this.props.list),r=n.length-1;r>=0;r--){var i=t.ObjectUtils.findIndexInList(n[r],o,this.props.dataKey);if(i===o.length-1)break;var s=o.splice(i,1)[0];o.push(s)}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"bottom"})}}},{key:"render",value:function(){var e=!this.props.selection.length,o=t.classNames("p-picklist-buttons",this.props.className);return r.default.createElement("div",{className:o},r.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-up",onClick:this.moveUp}),r.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-up",onClick:this.moveTop}),r.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-down",onClick:this.moveDown}),r.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-down",onClick:this.moveBottom}))}}]),d}();function O(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var x=function(o){p(d,e.Component);var s,c,u=(s=d,c=O(),function(){var e,t=f(s);if(c){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h(this,e)});function d(e){var t;return i(this,d),(t=u.call(this,e)).moveRight=t.moveRight.bind(a(t)),t.moveAllRight=t.moveAllRight.bind(a(t)),t.moveLeft=t.moveLeft.bind(a(t)),t.moveAllLeft=t.moveAllLeft.bind(a(t)),t}return l(d,[{key:"moveRight",value:function(e){var n=this.props.sourceSelection;if(n&&n.length){for(var o=k(this.props.target),r=k(this.props.source),i=0;i<n.length;i++){var s=n[i];-1===t.ObjectUtils.findIndexInList(s,o,this.props.dataKey)&&o.push(r.splice(t.ObjectUtils.findIndexInList(s,r,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:r,target:o,direction:"toTarget"})}}},{key:"moveAllRight",value:function(e){if(this.props.source){var t=[].concat(k(this.props.target),k(this.props.source));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:[],target:t,direction:"allToTarget"})}}},{key:"moveLeft",value:function(e){var n=this.props.targetSelection;if(n&&n.length){for(var o=k(this.props.target),r=k(this.props.source),i=0;i<n.length;i++){var s=n[i];-1===t.ObjectUtils.findIndexInList(s,r,this.props.dataKey)&&r.push(o.splice(t.ObjectUtils.findIndexInList(s,o,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:r,target:o,direction:"toSource"})}}},{key:"moveAllLeft",value:function(e){if(this.props.source){var t=[].concat(k(this.props.source),k(this.props.target));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:t,target:[],direction:"allToSource"})}}},{key:"render",value:function(){var e=!this.props.sourceSelection.length,o=!this.props.targetSelection.length,i=!this.props.source.length,s=!this.props.target.length,l=t.classNames("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return r.default.createElement("div",{className:l},r.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),r.default.createElement(n.Button,{disabled:i,type:"button",icon:"pi pi-angle-double-right",onClick:this.moveAllRight}),r.default.createElement(n.Button,{disabled:o,type:"button",icon:"pi pi-angle-left",onClick:this.moveLeft}),r.default.createElement(n.Button,{disabled:s,type:"button",icon:"pi pi-angle-double-left",onClick:this.moveAllLeft}))}}]),d}();function N(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var D=function(n){p(u,e.Component);var o,s,c=(o=u,s=N(),function(){var e,t=f(o);if(s){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h(this,e)});function u(e){var t;return i(this,u),(t=c.call(this,e)).state={},t.props.onSourceSelectionChange||(t.state.sourceSelection=[]),t.props.onTargetSelectionChange||(t.state.targetSelection=[]),t.onSourceReorder=t.onSourceReorder.bind(a(t)),t.onTargetReorder=t.onTargetReorder.bind(a(t)),t.onTransfer=t.onTransfer.bind(a(t)),t}return l(u,[{key:"getSourceSelection",value:function(){return this.props.onSourceSelectionChange?this.props.sourceSelection:this.state.sourceSelection}},{key:"getTargetSelection",value:function(){return this.props.onTargetSelectionChange?this.props.targetSelection:this.state.targetSelection}},{key:"onSourceReorder",value:function(e){this.handleChange(e,e.value,this.props.target),this.reorderedListElement=this.sourceListElement,this.reorderDirection=e.direction}},{key:"onTargetReorder",value:function(e){this.handleChange(e,this.props.source,e.value),this.reorderedListElement=this.targetListElement,this.reorderDirection=e.direction}},{key:"handleScrollPosition",value:function(e,n){if(e){var o=t.DomHandler.findSingle(e,".p-picklist-list");switch(n){case"up":this.scrollInView(o,-1);break;case"top":o.scrollTop=0;break;case"down":this.scrollInView(o,1);break;case"bottom":o.scrollTop=o.scrollHeight}}}},{key:"handleChange",value:function(e,t,n){this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,source:t,target:n})}},{key:"onTransfer",value:function(e){var t=e.originalEvent,n=e.source,o=e.target;switch(e.direction){case"toTarget":this.props.onMoveToTarget&&this.props.onMoveToTarget({originalEvent:t,value:this.getSourceSelection()});break;case"allToTarget":this.props.onMoveAllToTarget&&this.props.onMoveAllToTarget({originalEvent:t,value:this.props.source});break;case"toSource":this.props.onMoveToSource&&this.props.onMoveToSource({originalEvent:t,value:this.getTargetSelection()});break;case"allToSource":this.props.onMoveAllToSource&&this.props.onMoveAllToSource({originalEvent:t,value:this.props.target})}this.onSelectionChange({originalEvent:t,value:[]},"sourceSelection",this.props.onSourceSelectionChange),this.onSelectionChange({originalEvent:t,value:[]},"targetSelection",this.props.onTargetSelectionChange),this.handleChange(e,n,o)}},{key:"scrollInView",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=e.getElementsByClassName("p-highlight");t.DomHandler.scrollInView(e,-1===n?o[0]:o[o.length-1])}},{key:"onSelectionChange",value:function(e,t,n){n?n(e):this.setState(d({},t,e.value)),this.state.sourceSelection&&this.state.sourceSelection.length&&"targetSelection"===t?this.setState({sourceSelection:[]}):this.state.targetSelection&&this.state.targetSelection.length&&"sourceSelection"===t&&this.setState({targetSelection:[]})}},{key:"componentDidUpdate",value:function(){this.reorderedListElement&&(this.handleScrollPosition(this.reorderedListElement,this.reorderDirection),this.reorderedListElement=null,this.reorderDirection=null)}},{key:"render",value:function(){var e=this,n=t.classNames("p-picklist p-component",this.props.className),o=this.getSourceSelection(),i=this.getTargetSelection();return r.default.createElement("div",{id:this.props.id,className:n,style:this.props.style},this.props.showSourceControls&&r.default.createElement(K,{list:this.props.source,selection:o,onReorder:this.onSourceReorder,className:"p-picklist-source-controls",dataKey:this.props.dataKey}),r.default.createElement(w,{ref:function(t){return e.sourceListElement=t},list:this.props.source,selection:o,onSelectionChange:function(t){return e.onSelectionChange(t,"sourceSelection",e.props.onSourceSelectionChange)},itemTemplate:this.props.itemTemplate,header:this.props.sourceHeader,style:this.props.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:this.props.metaKeySelection,tabIndex:this.props.tabIndex,dataKey:this.props.dataKey}),r.default.createElement(x,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:o,targetSelection:i,dataKey:this.props.dataKey}),r.default.createElement(w,{ref:function(t){return e.targetListElement=t},list:this.props.target,selection:i,onSelectionChange:function(t){return e.onSelectionChange(t,"targetSelection",e.props.onTargetSelectionChange)},itemTemplate:this.props.itemTemplate,header:this.props.targetHeader,style:this.props.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:this.props.metaKeySelection,tabIndex:this.props.tabIndex,dataKey:this.props.dataKey}),this.props.showTargetControls&&r.default.createElement(K,{list:this.props.target,selection:i,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),u}();d(D,"defaultProps",{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,tabIndex:0,dataKey:null,itemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null}),exports.PickList=D;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils"),o=require("primereact/ripple"),n=require("primereact/button");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(e);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t,o){return t&&l(e.prototype,t),o&&l(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function f(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function v(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},m.apply(this,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function g(e){if(Array.isArray(e))return y(e)}function b(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function S(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}function k(){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 E(e){return g(e)||b(e)||S(e)||k()}function T(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var C=function(n){u(h,e.Component);var r,l,p=(r=h,l=T(),function(){var e,t=d(r);if(l){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return f(this,e)});function h(e){var t;return s(this,h),(t=p.call(this,e)).onClick=t.onClick.bind(c(t)),t.onKeyDown=t.onKeyDown.bind(c(t)),t}return a(h,[{key:"onClick",value:function(e){this.props.onClick&&this.props.onClick({originalEvent:e,value:this.props.value})}},{key:"onKeyDown",value:function(e){this.props.onKeyDown&&this.props.onKeyDown({originalEvent:e,value:this.props.value})}},{key:"render",value:function(){var e=this.props.template?this.props.template(this.props.value):this.props.value,n=t.classNames("p-picklist-item",{"p-highlight":this.props.selected},this.props.className);return i.default.createElement("li",{className:n,onClick:this.onClick,onKeyDown:this.onKeyDown,tabIndex:this.props.tabIndex,role:"option","aria-selected":this.props.selected},e,i.default.createElement(o.Ripple,null))}}]),h}();function w(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}v(C,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var R=function(o){u(p,e.Component);var n,r,l=(n=p,r=w(),function(){var e,t=d(n);if(r){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return f(this,e)});function p(e){var t;return s(this,p),(t=l.call(this,e)).onItemClick=t.onItemClick.bind(c(t)),t.onItemKeyDown=t.onItemKeyDown.bind(c(t)),t}return a(p,[{key:"onItemClick",value:function(e){var o=e.originalEvent,n=e.value,r=E(this.props.selection),i=t.ObjectUtils.findIndexInList(n,r,this.props.dataKey),s=-1!==i;if(this.props.metaKeySelection){var l=o.metaKey||o.ctrlKey;s&&l?r.splice(i,1):(l||(r.length=0),r.push(n))}else s?r.splice(i,1):r.push(n);this.props.onSelectionChange&&this.props.onSelectionChange({event:o,value:r})}},{key:"onItemKeyDown",value:function(e){var t=e.originalEvent.currentTarget;switch(e.originalEvent.which){case 40:var o=this.findNextItem(t);o&&o.focus(),e.originalEvent.preventDefault();break;case 38:var n=this.findPrevItem(t);n&&n.focus(),e.originalEvent.preventDefault();break;case 13:this.onItemClick(e),e.originalEvent.preventDefault()}}},{key:"findNextItem",value:function(e){var o=e.nextElementSibling;return o?t.DomHandler.hasClass(o,"p-picklist-item")?o:this.findNextItem(o):null}},{key:"findPrevItem",value:function(e){var o=e.previousElementSibling;return o?t.DomHandler.hasClass(o,"p-picklist-item")?o:this.findPrevItem(o):null}},{key:"isSelected",value:function(e){return-1!==t.ObjectUtils.findIndexInList(e,this.props.selection,this.props.dataKey)}},{key:"render",value:function(){var e=this,o=null,n=null,r=t.classNames("p-picklist-list-wrapper",this.props.className),s=t.classNames("p-picklist-list",this.props.listClassName);return this.props.header&&(o=i.default.createElement("div",{className:"p-picklist-header"},t.ObjectUtils.getJSXElement(this.props.header,this.props))),this.props.list&&(n=this.props.list.map((function(t,o){return i.default.createElement(C,{key:JSON.stringify(t),value:t,template:e.props.itemTemplate,selected:e.isSelected(t),onClick:e.onItemClick,onKeyDown:e.onItemKeyDown,tabIndex:e.props.tabIndex})}))),i.default.createElement("div",{ref:this.props.forwardRef,className:r},o,i.default.createElement("ul",{className:s,style:this.props.style,role:"listbox","aria-multiselectable":!0},n))}}]),p}(),I=i.default.forwardRef((function(e,t){return i.default.createElement(R,m({forwardRef:t},e))}));function O(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var K=function(o){u(h,e.Component);var r,l,p=(r=h,l=O(),function(){var e,t=d(r);if(l){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return f(this,e)});function h(e){var t;return s(this,h),(t=p.call(this,e)).moveUp=t.moveUp.bind(c(t)),t.moveTop=t.moveTop.bind(c(t)),t.moveDown=t.moveDown.bind(c(t)),t.moveBottom=t.moveBottom.bind(c(t)),t}return a(h,[{key:"moveUp",value:function(e){var o=this.props.selection;if(o&&o.length){for(var n=E(this.props.list),r=0;r<o.length;r++){var i=t.ObjectUtils.findIndexInList(o[r],n,this.props.dataKey);if(0===i)break;var s=n[i-1];n[i-1]=n[i],n[i]=s}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:n,direction:"up"})}}},{key:"moveTop",value:function(e){var o=this.props.selection;if(o&&o.length){for(var n=E(this.props.list),r=0;r<o.length;r++){var i=t.ObjectUtils.findIndexInList(o[r],n,this.props.dataKey);if(0===i)break;var s=n.splice(i,1)[0];n.unshift(s)}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:n,direction:"top"})}}},{key:"moveDown",value:function(e){var o=this.props.selection;if(o&&o.length){for(var n=E(this.props.list),r=o.length-1;r>=0;r--){var i=t.ObjectUtils.findIndexInList(o[r],n,this.props.dataKey);if(i===n.length-1)break;var s=n[i+1];n[i+1]=n[i],n[i]=s}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:n,direction:"down"}),this.movedDown=!0}}},{key:"moveBottom",value:function(e){var o=this.props.selection;if(o&&o.length){for(var n=E(this.props.list),r=o.length-1;r>=0;r--){var i=t.ObjectUtils.findIndexInList(o[r],n,this.props.dataKey);if(i===n.length-1)break;var s=n.splice(i,1)[0];n.push(s)}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:n,direction:"bottom"})}}},{key:"render",value:function(){var e=!this.props.selection.length,o=t.classNames("p-picklist-buttons",this.props.className);return i.default.createElement("div",{className:o},i.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-up",onClick:this.moveUp}),i.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-up",onClick:this.moveTop}),i.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-down",onClick:this.moveDown}),i.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-down",onClick:this.moveBottom}))}}]),h}();function j(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var N=function(o){u(h,e.Component);var r,l,p=(r=h,l=j(),function(){var e,t=d(r);if(l){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return f(this,e)});function h(e){var t;return s(this,h),(t=p.call(this,e)).moveRight=t.moveRight.bind(c(t)),t.moveAllRight=t.moveAllRight.bind(c(t)),t.moveLeft=t.moveLeft.bind(c(t)),t.moveAllLeft=t.moveAllLeft.bind(c(t)),t}return a(h,[{key:"moveRight",value:function(e){var o=this.props.sourceSelection;if(t.ObjectUtils.isNotEmpty(o)){for(var n=E(this.props.target),r=E(this.props.source),i=0;i<o.length;i++){var s=o[i];-1===t.ObjectUtils.findIndexInList(s,n,this.props.dataKey)&&n.push(r.splice(t.ObjectUtils.findIndexInList(s,r,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:r,target:n,direction:"toTarget"})}}},{key:"moveAllRight",value:function(e){if(this.props.source){var t=[].concat(E(this.props.target),E(this.props.source));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:[],target:t,direction:"allToTarget"})}}},{key:"moveLeft",value:function(e){var o=this.props.targetSelection;if(t.ObjectUtils.isNotEmpty(o)){for(var n=E(this.props.target),r=E(this.props.source),i=0;i<o.length;i++){var s=o[i];-1===t.ObjectUtils.findIndexInList(s,r,this.props.dataKey)&&r.push(n.splice(t.ObjectUtils.findIndexInList(s,n,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:r,target:n,direction:"toSource"})}}},{key:"moveAllLeft",value:function(e){if(this.props.source){var t=[].concat(E(this.props.source),E(this.props.target));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:t,target:[],direction:"allToSource"})}}},{key:"render",value:function(){var e=t.ObjectUtils.isEmpty(this.props.sourceSelection),o=t.ObjectUtils.isEmpty(this.props.targetSelection),r=t.ObjectUtils.isEmpty(this.props.source),s=t.ObjectUtils.isEmpty(this.props.target),l=t.classNames("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return i.default.createElement("div",{className:l},i.default.createElement(n.Button,{disabled:e,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),i.default.createElement(n.Button,{disabled:r,type:"button",icon:"pi pi-angle-double-right",onClick:this.moveAllRight}),i.default.createElement(n.Button,{disabled:o,type:"button",icon:"pi pi-angle-left",onClick:this.moveLeft}),i.default.createElement(n.Button,{disabled:s,type:"button",icon:"pi pi-angle-double-left",onClick:this.moveAllLeft}))}}]),h}();function x(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var D=function(o){u(p,e.Component);var n,r,l=(n=p,r=x(),function(){var e,t=d(n);if(r){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return f(this,e)});function p(e){var t;return s(this,p),(t=l.call(this,e)).state={},t.props.onSourceSelectionChange||(t.state.sourceSelection=[]),t.props.onTargetSelectionChange||(t.state.targetSelection=[]),t.onSourceReorder=t.onSourceReorder.bind(c(t)),t.onTargetReorder=t.onTargetReorder.bind(c(t)),t.onTransfer=t.onTransfer.bind(c(t)),t}return a(p,[{key:"getSourceSelection",value:function(){return this.props.onSourceSelectionChange?this.props.sourceSelection:this.state.sourceSelection}},{key:"getTargetSelection",value:function(){return this.props.onTargetSelectionChange?this.props.targetSelection:this.state.targetSelection}},{key:"onSourceReorder",value:function(e){this.handleChange(e,e.value,this.props.target),this.reorderedListElement=this.sourceListElement,this.reorderDirection=e.direction}},{key:"onTargetReorder",value:function(e){this.handleChange(e,this.props.source,e.value),this.reorderedListElement=this.targetListElement,this.reorderDirection=e.direction}},{key:"handleScrollPosition",value:function(e,o){if(e){var n=t.DomHandler.findSingle(e,".p-picklist-list");switch(o){case"up":this.scrollInView(n,-1);break;case"top":n.scrollTop=0;break;case"down":this.scrollInView(n,1);break;case"bottom":n.scrollTop=n.scrollHeight}}}},{key:"handleChange",value:function(e,t,o){this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,source:t,target:o})}},{key:"onTransfer",value:function(e){var t=e.originalEvent,o=e.source,n=e.target;switch(e.direction){case"toTarget":this.props.onMoveToTarget&&this.props.onMoveToTarget({originalEvent:t,value:this.getSourceSelection()});break;case"allToTarget":this.props.onMoveAllToTarget&&this.props.onMoveAllToTarget({originalEvent:t,value:this.props.source});break;case"toSource":this.props.onMoveToSource&&this.props.onMoveToSource({originalEvent:t,value:this.getTargetSelection()});break;case"allToSource":this.props.onMoveAllToSource&&this.props.onMoveAllToSource({originalEvent:t,value:this.props.target})}this.onSelectionChange({originalEvent:t,value:[]},"sourceSelection",this.props.onSourceSelectionChange),this.onSelectionChange({originalEvent:t,value:[]},"targetSelection",this.props.onTargetSelectionChange),this.handleChange(e,o,n)}},{key:"scrollInView",value:function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getElementsByClassName("p-highlight");t.ObjectUtils.isNotEmpty(n)&&t.DomHandler.scrollInView(e,-1===o?n[0]:n[n.length-1])}},{key:"onSelectionChange",value:function(e,o,n){n?n(e):this.setState(v({},o,e.value)),t.ObjectUtils.isNotEmpty(this.state.sourceSelection)&&"targetSelection"===o?this.setState({sourceSelection:[]}):t.ObjectUtils.isNotEmpty(this.state.targetSelection)&&"sourceSelection"===o&&this.setState({targetSelection:[]})}},{key:"componentDidUpdate",value:function(){this.reorderedListElement&&(this.handleScrollPosition(this.reorderedListElement,this.reorderDirection),this.reorderedListElement=null,this.reorderDirection=null)}},{key:"render",value:function(){var e=this,o=t.classNames("p-picklist p-component",this.props.className),n=this.getSourceSelection(),r=this.getTargetSelection();return i.default.createElement("div",{id:this.props.id,className:o,style:this.props.style},this.props.showSourceControls&&i.default.createElement(K,{list:this.props.source,selection:n,onReorder:this.onSourceReorder,className:"p-picklist-source-controls",dataKey:this.props.dataKey}),i.default.createElement(I,{ref:function(t){return e.sourceListElement=t},list:this.props.source,selection:n,onSelectionChange:function(t){return e.onSelectionChange(t,"sourceSelection",e.props.onSourceSelectionChange)},itemTemplate:this.props.itemTemplate,header:this.props.sourceHeader,style:this.props.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:this.props.metaKeySelection,tabIndex:this.props.tabIndex,dataKey:this.props.dataKey}),i.default.createElement(N,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:n,targetSelection:r,dataKey:this.props.dataKey}),i.default.createElement(I,{ref:function(t){return e.targetListElement=t},list:this.props.target,selection:r,onSelectionChange:function(t){return e.onSelectionChange(t,"targetSelection",e.props.onTargetSelectionChange)},itemTemplate:this.props.itemTemplate,header:this.props.targetHeader,style:this.props.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:this.props.metaKeySelection,tabIndex:this.props.tabIndex,dataKey:this.props.dataKey}),this.props.showTargetControls&&i.default.createElement(K,{list:this.props.target,selection:r,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),p}();v(D,"defaultProps",{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,tabIndex:0,dataKey:null,itemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null}),exports.PickList=D;
|
package/picklist/picklist.esm.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { classNames,
|
|
2
|
+
import { classNames, ObjectUtils, DomHandler } from 'primereact/utils';
|
|
3
|
+
import { Ripple } from 'primereact/ripple';
|
|
3
4
|
import { Button } from 'primereact/button';
|
|
4
5
|
|
|
5
6
|
function _classCallCheck(instance, Constructor) {
|
|
@@ -21,6 +22,9 @@ function _defineProperties(target, props) {
|
|
|
21
22
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
22
23
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
23
24
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
25
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
26
|
+
writable: false
|
|
27
|
+
});
|
|
24
28
|
return Constructor;
|
|
25
29
|
}
|
|
26
30
|
|
|
@@ -53,23 +57,20 @@ function _inherits(subClass, superClass) {
|
|
|
53
57
|
configurable: true
|
|
54
58
|
}
|
|
55
59
|
});
|
|
60
|
+
Object.defineProperty(subClass, "prototype", {
|
|
61
|
+
writable: false
|
|
62
|
+
});
|
|
56
63
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
function _typeof(obj) {
|
|
60
67
|
"@babel/helpers - typeof";
|
|
61
68
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
_typeof = function _typeof(obj) {
|
|
68
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return _typeof(obj);
|
|
69
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
70
|
+
return typeof obj;
|
|
71
|
+
} : function (obj) {
|
|
72
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
73
|
+
}, _typeof(obj);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -588,7 +589,7 @@ var PickListTransferControls = /*#__PURE__*/function (_Component) {
|
|
|
588
589
|
value: function moveRight(event) {
|
|
589
590
|
var selection = this.props.sourceSelection;
|
|
590
591
|
|
|
591
|
-
if (selection
|
|
592
|
+
if (ObjectUtils.isNotEmpty(selection)) {
|
|
592
593
|
var targetList = _toConsumableArray(this.props.target);
|
|
593
594
|
|
|
594
595
|
var sourceList = _toConsumableArray(this.props.source);
|
|
@@ -633,7 +634,7 @@ var PickListTransferControls = /*#__PURE__*/function (_Component) {
|
|
|
633
634
|
value: function moveLeft(event) {
|
|
634
635
|
var selection = this.props.targetSelection;
|
|
635
636
|
|
|
636
|
-
if (selection
|
|
637
|
+
if (ObjectUtils.isNotEmpty(selection)) {
|
|
637
638
|
var targetList = _toConsumableArray(this.props.target);
|
|
638
639
|
|
|
639
640
|
var sourceList = _toConsumableArray(this.props.source);
|
|
@@ -676,10 +677,10 @@ var PickListTransferControls = /*#__PURE__*/function (_Component) {
|
|
|
676
677
|
}, {
|
|
677
678
|
key: "render",
|
|
678
679
|
value: function render() {
|
|
679
|
-
var moveRightDisabled =
|
|
680
|
-
var moveLeftDisabled =
|
|
681
|
-
var moveAllRightDisabled =
|
|
682
|
-
var moveAllLeftDisabled =
|
|
680
|
+
var moveRightDisabled = ObjectUtils.isEmpty(this.props.sourceSelection);
|
|
681
|
+
var moveLeftDisabled = ObjectUtils.isEmpty(this.props.targetSelection);
|
|
682
|
+
var moveAllRightDisabled = ObjectUtils.isEmpty(this.props.source);
|
|
683
|
+
var moveAllLeftDisabled = ObjectUtils.isEmpty(this.props.target);
|
|
683
684
|
var className = classNames('p-picklist-buttons p-picklist-transfer-buttons', this.props.className);
|
|
684
685
|
return /*#__PURE__*/React.createElement("div", {
|
|
685
686
|
className: className
|
|
@@ -865,7 +866,10 @@ var PickList = /*#__PURE__*/function (_Component) {
|
|
|
865
866
|
value: function scrollInView(listContainer) {
|
|
866
867
|
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
867
868
|
var selectedItems = listContainer.getElementsByClassName('p-highlight');
|
|
868
|
-
|
|
869
|
+
|
|
870
|
+
if (ObjectUtils.isNotEmpty(selectedItems)) {
|
|
871
|
+
DomHandler.scrollInView(listContainer, direction === -1 ? selectedItems[0] : selectedItems[selectedItems.length - 1]);
|
|
872
|
+
}
|
|
869
873
|
}
|
|
870
874
|
}, {
|
|
871
875
|
key: "onSelectionChange",
|
|
@@ -876,11 +880,11 @@ var PickList = /*#__PURE__*/function (_Component) {
|
|
|
876
880
|
this.setState(_defineProperty({}, stateKey, e.value));
|
|
877
881
|
}
|
|
878
882
|
|
|
879
|
-
if (
|
|
883
|
+
if (ObjectUtils.isNotEmpty(this.state.sourceSelection) && stateKey === 'targetSelection') {
|
|
880
884
|
this.setState({
|
|
881
885
|
sourceSelection: []
|
|
882
886
|
});
|
|
883
|
-
} else if (
|
|
887
|
+
} else if (ObjectUtils.isNotEmpty(this.state.targetSelection) && stateKey === 'sourceSelection') {
|
|
884
888
|
this.setState({
|
|
885
889
|
targetSelection: []
|
|
886
890
|
});
|