primereact 7.0.1 → 7.2.1
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 +1 -1
- package/accordion/accordion.cjs.js +27 -21
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +5 -2
- package/accordion/accordion.esm.js +27 -21
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +27 -21
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +29 -6
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +31 -30
- package/api/api.esm.js +29 -6
- package/api/api.esm.min.js +1 -1
- package/api/api.js +29 -6
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +22 -22
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +9 -4
- package/autocomplete/autocomplete.esm.js +22 -22
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +22 -22
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +11 -11
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +1 -1
- package/avatar/avatar.esm.js +11 -11
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +11 -11
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +11 -11
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +11 -11
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +11 -11
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +11 -11
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +11 -11
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +11 -11
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +23 -16
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +23 -16
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +23 -16
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +11 -11
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +11 -11
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +11 -11
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +13 -13
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +1 -1
- package/button/button.esm.js +13 -13
- package/button/button.esm.min.js +1 -1
- package/button/button.js +13 -13
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +39 -20
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +3 -2
- package/calendar/calendar.esm.js +39 -20
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +39 -20
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +11 -11
- 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 +11 -11
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +11 -11
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +11 -11
- package/card/card.esm.min.js +1 -1
- package/card/card.js +11 -11
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +235 -27
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +234 -27
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +236 -29
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +15 -15
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +15 -15
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +15 -15
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +13 -13
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +13 -13
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +13 -13
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +13 -13
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +1 -1
- package/checkbox/checkbox.esm.js +13 -13
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +13 -13
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +11 -11
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +1 -1
- package/chip/chip.esm.js +11 -11
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +11 -11
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +13 -13
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +13 -13
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +13 -13
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +16 -16
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +19 -5
- package/colorpicker/colorpicker.esm.js +16 -16
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +16 -16
- 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 +5 -1
- package/column/column.esm.js +31 -12
- package/column/column.esm.min.js +1 -1
- package/column/column.js +31 -12
- 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 +28 -12
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +13 -13
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +1 -1
- package/confirmdialog/confirmdialog.esm.js +13 -13
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +13 -13
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +16 -16
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +3 -2
- package/confirmpopup/confirmpopup.esm.js +16 -16
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +16 -16
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +14 -14
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +14 -14
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +14 -14
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +521 -323
- package/core/core.min.js +18 -18
- 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 +11 -11
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +11 -11
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +11 -11
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +518 -346
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +34 -11
- package/datatable/datatable.esm.js +520 -348
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +518 -346
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +12 -16
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +12 -16
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +12 -16
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +11 -11
- 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 +11 -11
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +20 -22
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +2 -1
- package/dialog/dialog.esm.js +20 -22
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +20 -22
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +11 -11
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +11 -11
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +11 -11
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +11 -11
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +11 -11
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +11 -11
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +36 -26
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +36 -26
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +36 -26
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +21 -17
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +21 -17
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +21 -17
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +14 -14
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fieldset/fieldset.esm.js +14 -14
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +14 -14
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +16 -13
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +3 -1
- package/fileupload/fileupload.esm.js +16 -13
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +16 -13
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +11 -11
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +11 -11
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +11 -11
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +228 -22
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +228 -22
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +229 -23
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +12 -12
- 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 +12 -12
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +39 -18
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +1 -0
- package/image/image.esm.js +40 -19
- package/image/image.esm.min.js +1 -1
- package/image/image.js +39 -18
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +11 -11
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +11 -11
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +11 -11
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +15 -15
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +15 -15
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +15 -15
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +47 -35
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +47 -35
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +47 -35
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +13 -13
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +13 -13
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +13 -13
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +13 -13
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +13 -13
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +13 -13
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +13 -13
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.esm.js +13 -13
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +13 -13
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +4 -1
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +4 -1
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +4 -1
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +12 -12
- 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 +12 -12
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -14
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +14 -14
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +14 -14
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +11 -11
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +11 -11
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +11 -11
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +17 -17
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -1
- package/mention/mention.esm.js +17 -17
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +17 -17
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +13 -13
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +2 -1
- package/menu/menu.esm.js +13 -13
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +13 -13
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +11 -11
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +11 -11
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +11 -11
- package/menubar/menubar.min.css +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +11 -11
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +11 -11
- package/message/message.esm.min.js +1 -1
- package/message/message.js +11 -11
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +11 -11
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +2 -1
- package/messages/messages.esm.js +11 -11
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +11 -11
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +23 -23
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +3 -2
- package/multiselect/multiselect.esm.js +23 -23
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +23 -23
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +13 -13
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +13 -13
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +13 -13
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +11 -11
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +11 -11
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +11 -11
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +11 -11
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +11 -11
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +11 -11
- package/organizationchart/organizationchart.min.css +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +15 -19
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +2 -1
- package/overlaypanel/overlaypanel.esm.js +15 -19
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +15 -19
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +3 -2
- package/paginator/paginator.cjs.js +13 -13
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +13 -13
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +13 -13
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +17 -16
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +18 -17
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +17 -16
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +13 -13
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/panelmenu/panelmenu.esm.js +13 -13
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +13 -13
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +15 -15
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +2 -1
- package/password/password.esm.js +15 -15
- package/password/password.esm.min.js +1 -1
- package/password/password.js +15 -15
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +11 -11
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +11 -11
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +11 -11
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +15 -18
- 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 +16 -20
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +1531 -1073
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1531 -1073
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1531 -1073
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +11 -11
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +11 -11
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +11 -11
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +11 -11
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +11 -11
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +11 -11
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +13 -13
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +13 -13
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +13 -13
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +13 -13
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +13 -13
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +13 -13
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +129 -99
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +314 -26
- package/resources/themes/arya-green/theme.css +314 -26
- package/resources/themes/arya-orange/theme.css +314 -26
- package/resources/themes/arya-purple/theme.css +314 -26
- package/resources/themes/bootstrap4-dark-blue/theme.css +291 -10
- package/resources/themes/bootstrap4-dark-purple/theme.css +291 -10
- package/resources/themes/bootstrap4-light-blue/theme.css +288 -7
- package/resources/themes/bootstrap4-light-purple/theme.css +288 -7
- package/resources/themes/fluent-light/theme.css +312 -24
- package/resources/themes/lara-dark-blue/theme.css +665 -412
- package/resources/themes/lara-dark-indigo/theme.css +665 -412
- package/resources/themes/lara-dark-purple/theme.css +665 -412
- package/resources/themes/lara-dark-teal/theme.css +665 -412
- package/resources/themes/lara-light-blue/theme.css +319 -66
- package/resources/themes/lara-light-indigo/theme.css +319 -66
- package/resources/themes/lara-light-purple/theme.css +319 -66
- package/resources/themes/lara-light-teal/theme.css +319 -66
- package/resources/themes/luna-amber/theme.css +305 -24
- package/resources/themes/luna-blue/theme.css +305 -24
- package/resources/themes/luna-green/theme.css +305 -24
- package/resources/themes/luna-pink/theme.css +305 -24
- package/resources/themes/md-dark-deeppurple/theme.css +370 -8
- package/resources/themes/md-dark-indigo/theme.css +370 -8
- package/resources/themes/md-light-deeppurple/theme.css +368 -6
- package/resources/themes/md-light-indigo/theme.css +368 -6
- package/resources/themes/mdc-dark-deeppurple/theme.css +370 -8
- package/resources/themes/mdc-dark-indigo/theme.css +370 -8
- package/resources/themes/mdc-light-deeppurple/theme.css +368 -6
- package/resources/themes/mdc-light-indigo/theme.css +368 -6
- package/resources/themes/nova/theme.css +305 -24
- package/resources/themes/nova-accent/theme.css +305 -24
- package/resources/themes/nova-alt/theme.css +305 -24
- package/resources/themes/rhea/theme.css +305 -24
- package/resources/themes/saga-blue/theme.css +295 -7
- package/resources/themes/saga-green/theme.css +295 -7
- package/resources/themes/saga-orange/theme.css +295 -7
- package/resources/themes/saga-purple/theme.css +295 -7
- package/resources/themes/tailwind-light/theme.css +315 -27
- package/resources/themes/vela-blue/theme.css +314 -26
- package/resources/themes/vela-green/theme.css +314 -26
- package/resources/themes/vela-orange/theme.css +314 -26
- package/resources/themes/vela-purple/theme.css +314 -26
- package/ripple/ripple.cjs.js +11 -11
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +11 -11
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +11 -11
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +11 -11
- 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 +11 -11
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +11 -11
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +11 -11
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +11 -11
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +12 -12
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +3 -2
- package/scrolltop/scrolltop.esm.js +12 -12
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +12 -12
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +14 -14
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +14 -14
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +14 -14
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +1 -1
- package/sidebar/sidebar.cjs.js +14 -13
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +2 -1
- package/sidebar/sidebar.esm.js +14 -13
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +14 -13
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +11 -11
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +11 -11
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +11 -11
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +13 -13
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +13 -13
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +13 -13
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +11 -11
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +11 -11
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +11 -11
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +13 -13
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +1 -1
- package/speeddial/speeddial.esm.js +13 -13
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +13 -13
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +22 -18
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +9 -3
- package/splitbutton/splitbutton.esm.js +22 -18
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +22 -18
- package/splitbutton/splitbutton.min.css +1 -1
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +12 -12
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +12 -12
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +12 -12
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +11 -11
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +11 -11
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +11 -11
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +11 -11
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +11 -11
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +11 -11
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +12 -12
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +12 -12
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +12 -12
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +57 -33
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +8 -0
- package/tabview/tabview.esm.js +57 -33
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +57 -33
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +11 -11
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +1 -1
- package/tag/tag.esm.js +11 -11
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +11 -11
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +11 -11
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +11 -11
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +11 -11
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +13 -13
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +13 -13
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +13 -13
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +11 -11
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +11 -11
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +11 -11
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +26 -15
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +5 -1
- package/toast/toast.esm.js +26 -15
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +27 -17
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +13 -13
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +1 -1
- package/togglebutton/togglebutton.esm.js +13 -13
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +13 -13
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +11 -11
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +11 -11
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +11 -11
- package/toolbar/toolbar.min.css +1 -1
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +45 -19
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +45 -19
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +45 -19
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +2 -0
- package/tree/tree.cjs.js +19 -18
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +8 -4
- package/tree/tree.esm.js +19 -18
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +19 -18
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +2 -1
- package/treeselect/treeselect.cjs.js +20 -20
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +2 -1
- package/treeselect/treeselect.esm.js +20 -20
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +20 -20
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +101 -40
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +2 -1
- package/treetable/treetable.esm.js +97 -37
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +101 -40
- package/treetable/treetable.min.css +1 -1
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +13 -13
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +13 -13
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +13 -13
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +98 -23
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +3 -0
- package/utils/utils.esm.js +98 -23
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +98 -23
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +62 -36
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +62 -36
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +62 -36
- package/virtualscroller/virtualscroller.min.css +1 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +59 -10
- 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-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-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-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-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-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-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-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/util.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
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),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}}),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 R(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}v(C,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var w=function(o){u(p,e.Component);var n,r,l=(n=p,r=R(),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(w,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 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 j=function(o){u(h,e.Component);var r,l,p=(r=h,l=N(),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(j,{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;
|
|
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
|
@@ -22,6 +22,9 @@ function _defineProperties(target, props) {
|
|
|
22
22
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
23
23
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
24
24
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
25
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
26
|
+
writable: false
|
|
27
|
+
});
|
|
25
28
|
return Constructor;
|
|
26
29
|
}
|
|
27
30
|
|
|
@@ -54,23 +57,20 @@ function _inherits(subClass, superClass) {
|
|
|
54
57
|
configurable: true
|
|
55
58
|
}
|
|
56
59
|
});
|
|
60
|
+
Object.defineProperty(subClass, "prototype", {
|
|
61
|
+
writable: false
|
|
62
|
+
});
|
|
57
63
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
function _typeof(obj) {
|
|
61
67
|
"@babel/helpers - typeof";
|
|
62
68
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
_typeof = function _typeof(obj) {
|
|
69
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
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);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{Component as t}from"react";import{classNames as o,ObjectUtils as r,DomHandler as n}from"primereact/utils";import{Ripple as i}from"primereact/ripple";import{Button as s}from"primereact/button";function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,o){return t&&a(e.prototype,t),o&&a(e,o),e}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(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&&u(e,t)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function m(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},y.apply(this,arguments)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function b(e){if(Array.isArray(e))return g(e)}function S(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function E(){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 T(e){return b(e)||S(e)||k(e)||E()}function C(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var w=function(r){h(u,t);var n,s,a=(n=u,s=C(),function(){var e,t=d(n);if(s){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function u(e){var t;return l(this,u),(t=a.call(this,e)).onClick=t.onClick.bind(p(t)),t.onKeyDown=t.onKeyDown.bind(p(t)),t}return c(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 t=this.props.template?this.props.template(this.props.value):this.props.value,r=o("p-picklist-item",{"p-highlight":this.props.selected},this.props.className);return e.createElement("li",{className:r,onClick:this.onClick,onKeyDown:this.onKeyDown,tabIndex:this.props.tabIndex,role:"option","aria-selected":this.props.selected},t,e.createElement(i,null))}}]),u}();function R(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}m(w,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var I=function(i){h(f,t);var s,a,u=(s=f,a=R(),function(){var e,t=d(s);if(a){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function f(e){var t;return l(this,f),(t=u.call(this,e)).onItemClick=t.onItemClick.bind(p(t)),t.onItemKeyDown=t.onItemKeyDown.bind(p(t)),t}return c(f,[{key:"onItemClick",value:function(e){var t=e.originalEvent,o=e.value,n=T(this.props.selection),i=r.findIndexInList(o,n,this.props.dataKey),s=-1!==i;if(this.props.metaKeySelection){var l=t.metaKey||t.ctrlKey;s&&l?n.splice(i,1):(l||(n.length=0),n.push(o))}else s?n.splice(i,1):n.push(o);this.props.onSelectionChange&&this.props.onSelectionChange({event:t,value:n})}},{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 r=this.findPrevItem(t);r&&r.focus(),e.originalEvent.preventDefault();break;case 13:this.onItemClick(e),e.originalEvent.preventDefault()}}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?n.hasClass(t,"p-picklist-item")?t:this.findNextItem(t):null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?n.hasClass(t,"p-picklist-item")?t:this.findPrevItem(t):null}},{key:"isSelected",value:function(e){return-1!==r.findIndexInList(e,this.props.selection,this.props.dataKey)}},{key:"render",value:function(){var t=this,n=null,i=null,s=o("p-picklist-list-wrapper",this.props.className),l=o("p-picklist-list",this.props.listClassName);return this.props.header&&(n=e.createElement("div",{className:"p-picklist-header"},r.getJSXElement(this.props.header,this.props))),this.props.list&&(i=this.props.list.map((function(o,r){return e.createElement(w,{key:JSON.stringify(o),value:o,template:t.props.itemTemplate,selected:t.isSelected(o),onClick:t.onItemClick,onKeyDown:t.onItemKeyDown,tabIndex:t.props.tabIndex})}))),e.createElement("div",{ref:this.props.forwardRef,className:s},n,e.createElement("ul",{className:l,style:this.props.style,role:"listbox","aria-multiselectable":!0},i))}}]),f}(),K=e.forwardRef((function(t,o){return e.createElement(I,y({forwardRef:o},t))}));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 N=function(n){h(f,t);var i,a,u=(i=f,a=x(),function(){var e,t=d(i);if(a){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function f(e){var t;return l(this,f),(t=u.call(this,e)).moveUp=t.moveUp.bind(p(t)),t.moveTop=t.moveTop.bind(p(t)),t.moveDown=t.moveDown.bind(p(t)),t.moveBottom=t.moveBottom.bind(p(t)),t}return c(f,[{key:"moveUp",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),n=0;n<t.length;n++){var i=r.findIndexInList(t[n],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 t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),n=0;n<t.length;n++){var i=r.findIndexInList(t[n],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 t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),n=t.length-1;n>=0;n--){var i=r.findIndexInList(t[n],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 t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),n=t.length-1;n>=0;n--){var i=r.findIndexInList(t[n],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 t=!this.props.selection.length,r=o("p-picklist-buttons",this.props.className);return e.createElement("div",{className:r},e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-up",onClick:this.moveUp}),e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-double-up",onClick:this.moveTop}),e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-down",onClick:this.moveDown}),e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-double-down",onClick:this.moveBottom}))}}]),f}();function D(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var L=function(n){h(f,t);var i,a,u=(i=f,a=D(),function(){var e,t=d(i);if(a){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function f(e){var t;return l(this,f),(t=u.call(this,e)).moveRight=t.moveRight.bind(p(t)),t.moveAllRight=t.moveAllRight.bind(p(t)),t.moveLeft=t.moveLeft.bind(p(t)),t.moveAllLeft=t.moveAllLeft.bind(p(t)),t}return c(f,[{key:"moveRight",value:function(e){var t=this.props.sourceSelection;if(r.isNotEmpty(t)){for(var o=T(this.props.target),n=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===r.findIndexInList(s,o,this.props.dataKey)&&o.push(n.splice(r.findIndexInList(s,n,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:n,target:o,direction:"toTarget"})}}},{key:"moveAllRight",value:function(e){if(this.props.source){var t=[].concat(T(this.props.target),T(this.props.source));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:[],target:t,direction:"allToTarget"})}}},{key:"moveLeft",value:function(e){var t=this.props.targetSelection;if(r.isNotEmpty(t)){for(var o=T(this.props.target),n=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===r.findIndexInList(s,n,this.props.dataKey)&&n.push(o.splice(r.findIndexInList(s,o,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:n,target:o,direction:"toSource"})}}},{key:"moveAllLeft",value:function(e){if(this.props.source){var t=[].concat(T(this.props.source),T(this.props.target));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:t,target:[],direction:"allToSource"})}}},{key:"render",value:function(){var t=r.isEmpty(this.props.sourceSelection),n=r.isEmpty(this.props.targetSelection),i=r.isEmpty(this.props.source),l=r.isEmpty(this.props.target),a=o("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return e.createElement("div",{className:a},e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),e.createElement(s,{disabled:i,type:"button",icon:"pi pi-angle-double-right",onClick:this.moveAllRight}),e.createElement(s,{disabled:n,type:"button",icon:"pi pi-angle-left",onClick:this.moveLeft}),e.createElement(s,{disabled:l,type:"button",icon:"pi pi-angle-double-left",onClick:this.moveAllLeft}))}}]),f}();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 A=function(i){h(f,t);var s,a,u=(s=f,a=O(),function(){var e,t=d(s);if(a){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function f(e){var t;return l(this,f),(t=u.call(this,e)).state={},t.props.onSourceSelectionChange||(t.state.sourceSelection=[]),t.props.onTargetSelectionChange||(t.state.targetSelection=[]),t.onSourceReorder=t.onSourceReorder.bind(p(t)),t.onTargetReorder=t.onTargetReorder.bind(p(t)),t.onTransfer=t.onTransfer.bind(p(t)),t}return c(f,[{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,t){if(e){var o=n.findSingle(e,".p-picklist-list");switch(t){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,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,r=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,r)}},{key:"scrollInView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=e.getElementsByClassName("p-highlight");r.isNotEmpty(o)&&n.scrollInView(e,-1===t?o[0]:o[o.length-1])}},{key:"onSelectionChange",value:function(e,t,o){o?o(e):this.setState(m({},t,e.value)),r.isNotEmpty(this.state.sourceSelection)&&"targetSelection"===t?this.setState({sourceSelection:[]}):r.isNotEmpty(this.state.targetSelection)&&"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 t=this,r=o("p-picklist p-component",this.props.className),n=this.getSourceSelection(),i=this.getTargetSelection();return e.createElement("div",{id:this.props.id,className:r,style:this.props.style},this.props.showSourceControls&&e.createElement(N,{list:this.props.source,selection:n,onReorder:this.onSourceReorder,className:"p-picklist-source-controls",dataKey:this.props.dataKey}),e.createElement(K,{ref:function(e){return t.sourceListElement=e},list:this.props.source,selection:n,onSelectionChange:function(e){return t.onSelectionChange(e,"sourceSelection",t.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}),e.createElement(L,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:n,targetSelection:i,dataKey:this.props.dataKey}),e.createElement(K,{ref:function(e){return t.targetListElement=e},list:this.props.target,selection:i,onSelectionChange:function(e){return t.onSelectionChange(e,"targetSelection",t.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&&e.createElement(N,{list:this.props.target,selection:i,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),f}();m(A,"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});export{A as PickList};
|
|
1
|
+
import e,{Component as t}from"react";import{classNames as o,ObjectUtils as r,DomHandler as n}from"primereact/utils";import{Ripple as i}from"primereact/ripple";import{Button as s}from"primereact/button";function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,o){return t&&a(e.prototype,t),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(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&&u(e,t)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function m(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},y.apply(this,arguments)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function b(e){if(Array.isArray(e))return g(e)}function S(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function E(){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 T(e){return b(e)||S(e)||k(e)||E()}function C(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var w=function(r){h(u,t);var n,s,a=(n=u,s=C(),function(){var e,t=d(n);if(s){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function u(e){var t;return l(this,u),(t=a.call(this,e)).onClick=t.onClick.bind(p(t)),t.onKeyDown=t.onKeyDown.bind(p(t)),t}return c(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 t=this.props.template?this.props.template(this.props.value):this.props.value,r=o("p-picklist-item",{"p-highlight":this.props.selected},this.props.className);return e.createElement("li",{className:r,onClick:this.onClick,onKeyDown:this.onKeyDown,tabIndex:this.props.tabIndex,role:"option","aria-selected":this.props.selected},t,e.createElement(i,null))}}]),u}();function R(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}m(w,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var I=function(i){h(f,t);var s,a,u=(s=f,a=R(),function(){var e,t=d(s);if(a){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function f(e){var t;return l(this,f),(t=u.call(this,e)).onItemClick=t.onItemClick.bind(p(t)),t.onItemKeyDown=t.onItemKeyDown.bind(p(t)),t}return c(f,[{key:"onItemClick",value:function(e){var t=e.originalEvent,o=e.value,n=T(this.props.selection),i=r.findIndexInList(o,n,this.props.dataKey),s=-1!==i;if(this.props.metaKeySelection){var l=t.metaKey||t.ctrlKey;s&&l?n.splice(i,1):(l||(n.length=0),n.push(o))}else s?n.splice(i,1):n.push(o);this.props.onSelectionChange&&this.props.onSelectionChange({event:t,value:n})}},{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 r=this.findPrevItem(t);r&&r.focus(),e.originalEvent.preventDefault();break;case 13:this.onItemClick(e),e.originalEvent.preventDefault()}}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?n.hasClass(t,"p-picklist-item")?t:this.findNextItem(t):null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?n.hasClass(t,"p-picklist-item")?t:this.findPrevItem(t):null}},{key:"isSelected",value:function(e){return-1!==r.findIndexInList(e,this.props.selection,this.props.dataKey)}},{key:"render",value:function(){var t=this,n=null,i=null,s=o("p-picklist-list-wrapper",this.props.className),l=o("p-picklist-list",this.props.listClassName);return this.props.header&&(n=e.createElement("div",{className:"p-picklist-header"},r.getJSXElement(this.props.header,this.props))),this.props.list&&(i=this.props.list.map((function(o,r){return e.createElement(w,{key:JSON.stringify(o),value:o,template:t.props.itemTemplate,selected:t.isSelected(o),onClick:t.onItemClick,onKeyDown:t.onItemKeyDown,tabIndex:t.props.tabIndex})}))),e.createElement("div",{ref:this.props.forwardRef,className:s},n,e.createElement("ul",{className:l,style:this.props.style,role:"listbox","aria-multiselectable":!0},i))}}]),f}(),K=e.forwardRef((function(t,o){return e.createElement(I,y({forwardRef:o},t))}));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 N=function(n){h(f,t);var i,a,u=(i=f,a=x(),function(){var e,t=d(i);if(a){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function f(e){var t;return l(this,f),(t=u.call(this,e)).moveUp=t.moveUp.bind(p(t)),t.moveTop=t.moveTop.bind(p(t)),t.moveDown=t.moveDown.bind(p(t)),t.moveBottom=t.moveBottom.bind(p(t)),t}return c(f,[{key:"moveUp",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),n=0;n<t.length;n++){var i=r.findIndexInList(t[n],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 t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),n=0;n<t.length;n++){var i=r.findIndexInList(t[n],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 t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),n=t.length-1;n>=0;n--){var i=r.findIndexInList(t[n],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 t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),n=t.length-1;n>=0;n--){var i=r.findIndexInList(t[n],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 t=!this.props.selection.length,r=o("p-picklist-buttons",this.props.className);return e.createElement("div",{className:r},e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-up",onClick:this.moveUp}),e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-double-up",onClick:this.moveTop}),e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-down",onClick:this.moveDown}),e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-double-down",onClick:this.moveBottom}))}}]),f}();function D(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var L=function(n){h(f,t);var i,a,u=(i=f,a=D(),function(){var e,t=d(i);if(a){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function f(e){var t;return l(this,f),(t=u.call(this,e)).moveRight=t.moveRight.bind(p(t)),t.moveAllRight=t.moveAllRight.bind(p(t)),t.moveLeft=t.moveLeft.bind(p(t)),t.moveAllLeft=t.moveAllLeft.bind(p(t)),t}return c(f,[{key:"moveRight",value:function(e){var t=this.props.sourceSelection;if(r.isNotEmpty(t)){for(var o=T(this.props.target),n=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===r.findIndexInList(s,o,this.props.dataKey)&&o.push(n.splice(r.findIndexInList(s,n,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:n,target:o,direction:"toTarget"})}}},{key:"moveAllRight",value:function(e){if(this.props.source){var t=[].concat(T(this.props.target),T(this.props.source));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:[],target:t,direction:"allToTarget"})}}},{key:"moveLeft",value:function(e){var t=this.props.targetSelection;if(r.isNotEmpty(t)){for(var o=T(this.props.target),n=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===r.findIndexInList(s,n,this.props.dataKey)&&n.push(o.splice(r.findIndexInList(s,o,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:n,target:o,direction:"toSource"})}}},{key:"moveAllLeft",value:function(e){if(this.props.source){var t=[].concat(T(this.props.source),T(this.props.target));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:t,target:[],direction:"allToSource"})}}},{key:"render",value:function(){var t=r.isEmpty(this.props.sourceSelection),n=r.isEmpty(this.props.targetSelection),i=r.isEmpty(this.props.source),l=r.isEmpty(this.props.target),a=o("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return e.createElement("div",{className:a},e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),e.createElement(s,{disabled:i,type:"button",icon:"pi pi-angle-double-right",onClick:this.moveAllRight}),e.createElement(s,{disabled:n,type:"button",icon:"pi pi-angle-left",onClick:this.moveLeft}),e.createElement(s,{disabled:l,type:"button",icon:"pi pi-angle-double-left",onClick:this.moveAllLeft}))}}]),f}();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 A=function(i){h(f,t);var s,a,u=(s=f,a=O(),function(){var e,t=d(s);if(a){var o=d(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v(this,e)});function f(e){var t;return l(this,f),(t=u.call(this,e)).state={},t.props.onSourceSelectionChange||(t.state.sourceSelection=[]),t.props.onTargetSelectionChange||(t.state.targetSelection=[]),t.onSourceReorder=t.onSourceReorder.bind(p(t)),t.onTargetReorder=t.onTargetReorder.bind(p(t)),t.onTransfer=t.onTransfer.bind(p(t)),t}return c(f,[{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,t){if(e){var o=n.findSingle(e,".p-picklist-list");switch(t){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,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,r=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,r)}},{key:"scrollInView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=e.getElementsByClassName("p-highlight");r.isNotEmpty(o)&&n.scrollInView(e,-1===t?o[0]:o[o.length-1])}},{key:"onSelectionChange",value:function(e,t,o){o?o(e):this.setState(m({},t,e.value)),r.isNotEmpty(this.state.sourceSelection)&&"targetSelection"===t?this.setState({sourceSelection:[]}):r.isNotEmpty(this.state.targetSelection)&&"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 t=this,r=o("p-picklist p-component",this.props.className),n=this.getSourceSelection(),i=this.getTargetSelection();return e.createElement("div",{id:this.props.id,className:r,style:this.props.style},this.props.showSourceControls&&e.createElement(N,{list:this.props.source,selection:n,onReorder:this.onSourceReorder,className:"p-picklist-source-controls",dataKey:this.props.dataKey}),e.createElement(K,{ref:function(e){return t.sourceListElement=e},list:this.props.source,selection:n,onSelectionChange:function(e){return t.onSelectionChange(e,"sourceSelection",t.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}),e.createElement(L,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:n,targetSelection:i,dataKey:this.props.dataKey}),e.createElement(K,{ref:function(e){return t.targetListElement=e},list:this.props.target,selection:i,onSelectionChange:function(e){return t.onSelectionChange(e,"targetSelection",t.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&&e.createElement(N,{list:this.props.target,selection:i,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),f}();m(A,"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});export{A as PickList};
|
package/picklist/picklist.js
CHANGED
|
@@ -25,6 +25,9 @@ this.primereact.picklist = (function (exports, React, utils, ripple, button) {
|
|
|
25
25
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
26
26
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
27
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
29
|
+
writable: false
|
|
30
|
+
});
|
|
28
31
|
return Constructor;
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -57,23 +60,20 @@ this.primereact.picklist = (function (exports, React, utils, ripple, button) {
|
|
|
57
60
|
configurable: true
|
|
58
61
|
}
|
|
59
62
|
});
|
|
63
|
+
Object.defineProperty(subClass, "prototype", {
|
|
64
|
+
writable: false
|
|
65
|
+
});
|
|
60
66
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
function _typeof(obj) {
|
|
64
70
|
"@babel/helpers - typeof";
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
_typeof = function _typeof(obj) {
|
|
72
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return _typeof(obj);
|
|
72
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
73
|
+
return typeof obj;
|
|
74
|
+
} : function (obj) {
|
|
75
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
76
|
+
}, _typeof(obj);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
function _possibleConstructorReturn(self, call) {
|
package/picklist/picklist.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.picklist=function(e,t,o,n,r){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(t);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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 c(e,t,o){return t&&a(e.prototype,t),o&&a(e,o),e}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(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&&u(e,t)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(){return y=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},y.apply(this,arguments)}function g(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 b(e){if(Array.isArray(e))return g(e)}function S(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function E(){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 T(e){return b(e)||S(e)||k(e)||E()}function C(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var R=function(e){h(a,e);var t,r,i=(t=a,r=C(),function(){var e,o=v(t);if(r){var n=v(this).constructor;e=Reflect.construct(o,arguments,n)}else e=o.apply(this,arguments);return d(this,e)});function a(e){var t;return l(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(p(t)),t.onKeyDown=t.onKeyDown.bind(p(t)),t}return c(a,[{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,t=o.classNames("p-picklist-item",{"p-highlight":this.props.selected},this.props.className);return s.default.createElement("li",{className:t,onClick:this.onClick,onKeyDown:this.onKeyDown,tabIndex:this.props.tabIndex,role:"option","aria-selected":this.props.selected},e,s.default.createElement(n.Ripple,null))}}]),a}(t.Component);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}}m(R,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var I=function(e){h(i,e);var t,n,r=(t=i,n=w(),function(){var e,o=v(t);if(n){var r=v(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return d(this,e)});function i(e){var t;return l(this,i),(t=r.call(this,e)).onItemClick=t.onItemClick.bind(p(t)),t.onItemKeyDown=t.onItemKeyDown.bind(p(t)),t}return c(i,[{key:"onItemClick",value:function(e){var t=e.originalEvent,n=e.value,r=T(this.props.selection),i=o.ObjectUtils.findIndexInList(n,r,this.props.dataKey),s=-1!==i;if(this.props.metaKeySelection){var l=t.metaKey||t.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:t,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 t=e.nextElementSibling;return t?o.DomHandler.hasClass(t,"p-picklist-item")?t:this.findNextItem(t):null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?o.DomHandler.hasClass(t,"p-picklist-item")?t:this.findPrevItem(t):null}},{key:"isSelected",value:function(e){return-1!==o.ObjectUtils.findIndexInList(e,this.props.selection,this.props.dataKey)}},{key:"render",value:function(){var e=this,t=null,n=null,r=o.classNames("p-picklist-list-wrapper",this.props.className),i=o.classNames("p-picklist-list",this.props.listClassName);return this.props.header&&(t=s.default.createElement("div",{className:"p-picklist-header"},o.ObjectUtils.getJSXElement(this.props.header,this.props))),this.props.list&&(n=this.props.list.map((function(t,o){return s.default.createElement(R,{key:JSON.stringify(t),value:t,template:e.props.itemTemplate,selected:e.isSelected(t),onClick:e.onItemClick,onKeyDown:e.onItemKeyDown,tabIndex:e.props.tabIndex})}))),s.default.createElement("div",{ref:this.props.forwardRef,className:r},t,s.default.createElement("ul",{className:i,style:this.props.style,role:"listbox","aria-multiselectable":!0},n))}}]),i}(t.Component),O=s.default.forwardRef((function(e,t){return s.default.createElement(I,y({forwardRef:t},e))}));function K(){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(e){h(a,e);var t,n,i=(t=a,n=K(),function(){var e,o=v(t);if(n){var r=v(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return d(this,e)});function a(e){var t;return l(this,a),(t=i.call(this,e)).moveUp=t.moveUp.bind(p(t)),t.moveTop=t.moveTop.bind(p(t)),t.moveDown=t.moveDown.bind(p(t)),t.moveBottom=t.moveBottom.bind(p(t)),t}return c(a,[{key:"moveUp",value:function(e){var t=this.props.selection;if(t&&t.length){for(var n=T(this.props.list),r=0;r<t.length;r++){var i=o.ObjectUtils.findIndexInList(t[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 t=this.props.selection;if(t&&t.length){for(var n=T(this.props.list),r=0;r<t.length;r++){var i=o.ObjectUtils.findIndexInList(t[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 t=this.props.selection;if(t&&t.length){for(var n=T(this.props.list),r=t.length-1;r>=0;r--){var i=o.ObjectUtils.findIndexInList(t[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 t=this.props.selection;if(t&&t.length){for(var n=T(this.props.list),r=t.length-1;r>=0;r--){var i=o.ObjectUtils.findIndexInList(t[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,t=o.classNames("p-picklist-buttons",this.props.className);return s.default.createElement("div",{className:t},s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-up",onClick:this.moveUp}),s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-up",onClick:this.moveTop}),s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-down",onClick:this.moveDown}),s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-down",onClick:this.moveBottom}))}}]),a}(t.Component);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 x=function(e){h(a,e);var t,n,i=(t=a,n=j(),function(){var e,o=v(t);if(n){var r=v(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return d(this,e)});function a(e){var t;return l(this,a),(t=i.call(this,e)).moveRight=t.moveRight.bind(p(t)),t.moveAllRight=t.moveAllRight.bind(p(t)),t.moveLeft=t.moveLeft.bind(p(t)),t.moveAllLeft=t.moveAllLeft.bind(p(t)),t}return c(a,[{key:"moveRight",value:function(e){var t=this.props.sourceSelection;if(o.ObjectUtils.isNotEmpty(t)){for(var n=T(this.props.target),r=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===o.ObjectUtils.findIndexInList(s,n,this.props.dataKey)&&n.push(r.splice(o.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(T(this.props.target),T(this.props.source));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:[],target:t,direction:"allToTarget"})}}},{key:"moveLeft",value:function(e){var t=this.props.targetSelection;if(o.ObjectUtils.isNotEmpty(t)){for(var n=T(this.props.target),r=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===o.ObjectUtils.findIndexInList(s,r,this.props.dataKey)&&r.push(n.splice(o.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(T(this.props.source),T(this.props.target));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:t,target:[],direction:"allToSource"})}}},{key:"render",value:function(){var e=o.ObjectUtils.isEmpty(this.props.sourceSelection),t=o.ObjectUtils.isEmpty(this.props.targetSelection),n=o.ObjectUtils.isEmpty(this.props.source),i=o.ObjectUtils.isEmpty(this.props.target),l=o.classNames("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return s.default.createElement("div",{className:l},s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),s.default.createElement(r.Button,{disabled:n,type:"button",icon:"pi pi-angle-double-right",onClick:this.moveAllRight}),s.default.createElement(r.Button,{disabled:t,type:"button",icon:"pi pi-angle-left",onClick:this.moveLeft}),s.default.createElement(r.Button,{disabled:i,type:"button",icon:"pi pi-angle-double-left",onClick:this.moveAllLeft}))}}]),a}(t.Component);function D(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var L=function(e){h(i,e);var t,n,r=(t=i,n=D(),function(){var e,o=v(t);if(n){var r=v(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return d(this,e)});function i(e){var t;return l(this,i),(t=r.call(this,e)).state={},t.props.onSourceSelectionChange||(t.state.sourceSelection=[]),t.props.onTargetSelectionChange||(t.state.targetSelection=[]),t.onSourceReorder=t.onSourceReorder.bind(p(t)),t.onTargetReorder=t.onTargetReorder.bind(p(t)),t.onTransfer=t.onTransfer.bind(p(t)),t}return c(i,[{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,t){if(e){var n=o.DomHandler.findSingle(e,".p-picklist-list");switch(t){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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getElementsByClassName("p-highlight");o.ObjectUtils.isNotEmpty(n)&&o.DomHandler.scrollInView(e,-1===t?n[0]:n[n.length-1])}},{key:"onSelectionChange",value:function(e,t,n){n?n(e):this.setState(m({},t,e.value)),o.ObjectUtils.isNotEmpty(this.state.sourceSelection)&&"targetSelection"===t?this.setState({sourceSelection:[]}):o.ObjectUtils.isNotEmpty(this.state.targetSelection)&&"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,t=o.classNames("p-picklist p-component",this.props.className),n=this.getSourceSelection(),r=this.getTargetSelection();return s.default.createElement("div",{id:this.props.id,className:t,style:this.props.style},this.props.showSourceControls&&s.default.createElement(N,{list:this.props.source,selection:n,onReorder:this.onSourceReorder,className:"p-picklist-source-controls",dataKey:this.props.dataKey}),s.default.createElement(O,{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}),s.default.createElement(x,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:n,targetSelection:r,dataKey:this.props.dataKey}),s.default.createElement(O,{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&&s.default.createElement(N,{list:this.props.target,selection:r,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),i}(t.Component);return m(L,"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}),e.PickList=L,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.ripple,primereact.button);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.picklist=function(e,t,o,n,r){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(t);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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 c(e,t,o){return t&&a(e.prototype,t),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(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&&u(e,t)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(){return y=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},y.apply(this,arguments)}function g(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 b(e){if(Array.isArray(e))return g(e)}function S(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function E(){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 T(e){return b(e)||S(e)||k(e)||E()}function C(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var w=function(e){h(a,e);var t,r,i=(t=a,r=C(),function(){var e,o=v(t);if(r){var n=v(this).constructor;e=Reflect.construct(o,arguments,n)}else e=o.apply(this,arguments);return d(this,e)});function a(e){var t;return l(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(p(t)),t.onKeyDown=t.onKeyDown.bind(p(t)),t}return c(a,[{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,t=o.classNames("p-picklist-item",{"p-highlight":this.props.selected},this.props.className);return s.default.createElement("li",{className:t,onClick:this.onClick,onKeyDown:this.onKeyDown,tabIndex:this.props.tabIndex,role:"option","aria-selected":this.props.selected},e,s.default.createElement(n.Ripple,null))}}]),a}(t.Component);function R(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}m(w,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var I=function(e){h(i,e);var t,n,r=(t=i,n=R(),function(){var e,o=v(t);if(n){var r=v(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return d(this,e)});function i(e){var t;return l(this,i),(t=r.call(this,e)).onItemClick=t.onItemClick.bind(p(t)),t.onItemKeyDown=t.onItemKeyDown.bind(p(t)),t}return c(i,[{key:"onItemClick",value:function(e){var t=e.originalEvent,n=e.value,r=T(this.props.selection),i=o.ObjectUtils.findIndexInList(n,r,this.props.dataKey),s=-1!==i;if(this.props.metaKeySelection){var l=t.metaKey||t.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:t,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 t=e.nextElementSibling;return t?o.DomHandler.hasClass(t,"p-picklist-item")?t:this.findNextItem(t):null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?o.DomHandler.hasClass(t,"p-picklist-item")?t:this.findPrevItem(t):null}},{key:"isSelected",value:function(e){return-1!==o.ObjectUtils.findIndexInList(e,this.props.selection,this.props.dataKey)}},{key:"render",value:function(){var e=this,t=null,n=null,r=o.classNames("p-picklist-list-wrapper",this.props.className),i=o.classNames("p-picklist-list",this.props.listClassName);return this.props.header&&(t=s.default.createElement("div",{className:"p-picklist-header"},o.ObjectUtils.getJSXElement(this.props.header,this.props))),this.props.list&&(n=this.props.list.map((function(t,o){return s.default.createElement(w,{key:JSON.stringify(t),value:t,template:e.props.itemTemplate,selected:e.isSelected(t),onClick:e.onItemClick,onKeyDown:e.onItemKeyDown,tabIndex:e.props.tabIndex})}))),s.default.createElement("div",{ref:this.props.forwardRef,className:r},t,s.default.createElement("ul",{className:i,style:this.props.style,role:"listbox","aria-multiselectable":!0},n))}}]),i}(t.Component),O=s.default.forwardRef((function(e,t){return s.default.createElement(I,y({forwardRef:t},e))}));function K(){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 j=function(e){h(a,e);var t,n,i=(t=a,n=K(),function(){var e,o=v(t);if(n){var r=v(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return d(this,e)});function a(e){var t;return l(this,a),(t=i.call(this,e)).moveUp=t.moveUp.bind(p(t)),t.moveTop=t.moveTop.bind(p(t)),t.moveDown=t.moveDown.bind(p(t)),t.moveBottom=t.moveBottom.bind(p(t)),t}return c(a,[{key:"moveUp",value:function(e){var t=this.props.selection;if(t&&t.length){for(var n=T(this.props.list),r=0;r<t.length;r++){var i=o.ObjectUtils.findIndexInList(t[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 t=this.props.selection;if(t&&t.length){for(var n=T(this.props.list),r=0;r<t.length;r++){var i=o.ObjectUtils.findIndexInList(t[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 t=this.props.selection;if(t&&t.length){for(var n=T(this.props.list),r=t.length-1;r>=0;r--){var i=o.ObjectUtils.findIndexInList(t[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 t=this.props.selection;if(t&&t.length){for(var n=T(this.props.list),r=t.length-1;r>=0;r--){var i=o.ObjectUtils.findIndexInList(t[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,t=o.classNames("p-picklist-buttons",this.props.className);return s.default.createElement("div",{className:t},s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-up",onClick:this.moveUp}),s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-up",onClick:this.moveTop}),s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-down",onClick:this.moveDown}),s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-down",onClick:this.moveBottom}))}}]),a}(t.Component);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 x=function(e){h(a,e);var t,n,i=(t=a,n=N(),function(){var e,o=v(t);if(n){var r=v(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return d(this,e)});function a(e){var t;return l(this,a),(t=i.call(this,e)).moveRight=t.moveRight.bind(p(t)),t.moveAllRight=t.moveAllRight.bind(p(t)),t.moveLeft=t.moveLeft.bind(p(t)),t.moveAllLeft=t.moveAllLeft.bind(p(t)),t}return c(a,[{key:"moveRight",value:function(e){var t=this.props.sourceSelection;if(o.ObjectUtils.isNotEmpty(t)){for(var n=T(this.props.target),r=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===o.ObjectUtils.findIndexInList(s,n,this.props.dataKey)&&n.push(r.splice(o.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(T(this.props.target),T(this.props.source));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:[],target:t,direction:"allToTarget"})}}},{key:"moveLeft",value:function(e){var t=this.props.targetSelection;if(o.ObjectUtils.isNotEmpty(t)){for(var n=T(this.props.target),r=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===o.ObjectUtils.findIndexInList(s,r,this.props.dataKey)&&r.push(n.splice(o.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(T(this.props.source),T(this.props.target));this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:t,target:[],direction:"allToSource"})}}},{key:"render",value:function(){var e=o.ObjectUtils.isEmpty(this.props.sourceSelection),t=o.ObjectUtils.isEmpty(this.props.targetSelection),n=o.ObjectUtils.isEmpty(this.props.source),i=o.ObjectUtils.isEmpty(this.props.target),l=o.classNames("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return s.default.createElement("div",{className:l},s.default.createElement(r.Button,{disabled:e,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),s.default.createElement(r.Button,{disabled:n,type:"button",icon:"pi pi-angle-double-right",onClick:this.moveAllRight}),s.default.createElement(r.Button,{disabled:t,type:"button",icon:"pi pi-angle-left",onClick:this.moveLeft}),s.default.createElement(r.Button,{disabled:i,type:"button",icon:"pi pi-angle-double-left",onClick:this.moveAllLeft}))}}]),a}(t.Component);function D(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var L=function(e){h(i,e);var t,n,r=(t=i,n=D(),function(){var e,o=v(t);if(n){var r=v(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return d(this,e)});function i(e){var t;return l(this,i),(t=r.call(this,e)).state={},t.props.onSourceSelectionChange||(t.state.sourceSelection=[]),t.props.onTargetSelectionChange||(t.state.targetSelection=[]),t.onSourceReorder=t.onSourceReorder.bind(p(t)),t.onTargetReorder=t.onTargetReorder.bind(p(t)),t.onTransfer=t.onTransfer.bind(p(t)),t}return c(i,[{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,t){if(e){var n=o.DomHandler.findSingle(e,".p-picklist-list");switch(t){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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getElementsByClassName("p-highlight");o.ObjectUtils.isNotEmpty(n)&&o.DomHandler.scrollInView(e,-1===t?n[0]:n[n.length-1])}},{key:"onSelectionChange",value:function(e,t,n){n?n(e):this.setState(m({},t,e.value)),o.ObjectUtils.isNotEmpty(this.state.sourceSelection)&&"targetSelection"===t?this.setState({sourceSelection:[]}):o.ObjectUtils.isNotEmpty(this.state.targetSelection)&&"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,t=o.classNames("p-picklist p-component",this.props.className),n=this.getSourceSelection(),r=this.getTargetSelection();return s.default.createElement("div",{id:this.props.id,className:t,style:this.props.style},this.props.showSourceControls&&s.default.createElement(j,{list:this.props.source,selection:n,onReorder:this.onSourceReorder,className:"p-picklist-source-controls",dataKey:this.props.dataKey}),s.default.createElement(O,{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}),s.default.createElement(x,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:n,targetSelection:r,dataKey:this.props.dataKey}),s.default.createElement(O,{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&&s.default.createElement(j,{list:this.props.target,selection:r,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),i}(t.Component);return m(L,"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}),e.PickList=L,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.ripple,primereact.button);
|
package/portal/portal.cjs.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var ReactDOM = require('react-dom');
|
|
7
7
|
var PrimeReact = require('primereact/api');
|
|
8
|
+
var utils = require('primereact/utils');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
11
|
|
|
@@ -30,6 +31,9 @@ function _defineProperties(target, props) {
|
|
|
30
31
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
31
32
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
32
33
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
34
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
35
|
+
writable: false
|
|
36
|
+
});
|
|
33
37
|
return Constructor;
|
|
34
38
|
}
|
|
35
39
|
|
|
@@ -54,23 +58,20 @@ function _inherits(subClass, superClass) {
|
|
|
54
58
|
configurable: true
|
|
55
59
|
}
|
|
56
60
|
});
|
|
61
|
+
Object.defineProperty(subClass, "prototype", {
|
|
62
|
+
writable: false
|
|
63
|
+
});
|
|
57
64
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
function _typeof(obj) {
|
|
61
68
|
"@babel/helpers - typeof";
|
|
62
69
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
_typeof = function _typeof(obj) {
|
|
69
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return _typeof(obj);
|
|
70
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
71
|
+
return typeof obj;
|
|
72
|
+
} : function (obj) {
|
|
73
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
74
|
+
}, _typeof(obj);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
function _assertThisInitialized(self) {
|
|
@@ -127,21 +128,17 @@ var Portal = /*#__PURE__*/function (_Component) {
|
|
|
127
128
|
_classCallCheck(this, Portal);
|
|
128
129
|
|
|
129
130
|
_this = _super.call(this, props);
|
|
131
|
+
var mounted = props.visible && utils.DomHandler.hasDOM();
|
|
130
132
|
_this.state = {
|
|
131
|
-
mounted:
|
|
133
|
+
mounted: mounted
|
|
132
134
|
};
|
|
133
135
|
return _this;
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
_createClass(Portal, [{
|
|
137
|
-
key: "hasDOM",
|
|
138
|
-
value: function hasDOM() {
|
|
139
|
-
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
140
|
-
}
|
|
141
|
-
}, {
|
|
142
139
|
key: "componentDidMount",
|
|
143
140
|
value: function componentDidMount() {
|
|
144
|
-
if (
|
|
141
|
+
if (utils.DomHandler.hasDOM() && !this.state.mounted) {
|
|
145
142
|
this.setState({
|
|
146
143
|
mounted: true
|
|
147
144
|
}, this.props.onMounted);
|
package/portal/portal.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-dom"),n=require("primereact/api");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-dom"),n=require("primereact/api"),r=require("primereact/utils");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(t),i=o(n);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function f(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&&a(e,t)}function p(e){return p="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},p(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var m,h,v,O=function(t){f(h,e.Component);var n,o,a,p,s,m=(n=h,o=b(),function(){var e,t=d(n);if(o){var r=d(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return y(this,e)});function h(e){var t;c(this,h),t=m.call(this,e);var n=e.visible&&r.DomHandler.hasDOM();return t.state={mounted:n},t}return a=h,(p=[{key:"componentDidMount",value:function(){r.DomHandler.hasDOM()&&!this.state.mounted&&this.setState({mounted:!0},this.props.onMounted)}},{key:"componentWillUnmount",value:function(){this.props.onUnmounted&&this.props.onUnmounted()}},{key:"render",value:function(){var e=this.props.element||this.props.children;if(e&&this.state.mounted){var t=this.props.appendTo||i.default.appendTo||document.body;return"self"===t?e:u.default.createPortal(e,t)}return null}}])&&l(a.prototype,p),s&&l(a,s),Object.defineProperty(a,"prototype",{writable:!1}),h}();v={element:null,appendTo:null,visible:!1,onMounted:null,onUnmounted:null},(h="defaultProps")in(m=O)?Object.defineProperty(m,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):m[h]=v,exports.Portal=O;
|
package/portal/portal.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import PrimeReact from 'primereact/api';
|
|
4
|
+
import { DomHandler } from 'primereact/utils';
|
|
4
5
|
|
|
5
6
|
function _classCallCheck(instance, Constructor) {
|
|
6
7
|
if (!(instance instanceof 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
|
|
|
@@ -45,23 +49,20 @@ function _inherits(subClass, superClass) {
|
|
|
45
49
|
configurable: true
|
|
46
50
|
}
|
|
47
51
|
});
|
|
52
|
+
Object.defineProperty(subClass, "prototype", {
|
|
53
|
+
writable: false
|
|
54
|
+
});
|
|
48
55
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
function _typeof(obj) {
|
|
52
59
|
"@babel/helpers - typeof";
|
|
53
60
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
_typeof = function _typeof(obj) {
|
|
60
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return _typeof(obj);
|
|
61
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
62
|
+
return typeof obj;
|
|
63
|
+
} : function (obj) {
|
|
64
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
65
|
+
}, _typeof(obj);
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
function _assertThisInitialized(self) {
|
|
@@ -118,21 +119,17 @@ var Portal = /*#__PURE__*/function (_Component) {
|
|
|
118
119
|
_classCallCheck(this, Portal);
|
|
119
120
|
|
|
120
121
|
_this = _super.call(this, props);
|
|
122
|
+
var mounted = props.visible && DomHandler.hasDOM();
|
|
121
123
|
_this.state = {
|
|
122
|
-
mounted:
|
|
124
|
+
mounted: mounted
|
|
123
125
|
};
|
|
124
126
|
return _this;
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
_createClass(Portal, [{
|
|
128
|
-
key: "hasDOM",
|
|
129
|
-
value: function hasDOM() {
|
|
130
|
-
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
131
|
-
}
|
|
132
|
-
}, {
|
|
133
130
|
key: "componentDidMount",
|
|
134
131
|
value: function componentDidMount() {
|
|
135
|
-
if (
|
|
132
|
+
if (DomHandler.hasDOM() && !this.state.mounted) {
|
|
136
133
|
this.setState({
|
|
137
134
|
mounted: true
|
|
138
135
|
}, this.props.onMounted);
|
package/portal/portal.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Component as t}from"react";import e from"react-dom";import n from"primereact/api";function
|
|
1
|
+
import{Component as t}from"react";import e from"react-dom";import n from"primereact/api";import{DomHandler as o}from"primereact/utils";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var y,m,b,d=function(i){c(h,t);var f,l,y,m,b,d=(f=h,l=s(),function(){var t,e=a(f);if(l){var n=a(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return p(this,t)});function h(t){var e;r(this,h),e=d.call(this,t);var n=t.visible&&o.hasDOM();return e.state={mounted:n},e}return y=h,(m=[{key:"componentDidMount",value:function(){o.hasDOM()&&!this.state.mounted&&this.setState({mounted:!0},this.props.onMounted)}},{key:"componentWillUnmount",value:function(){this.props.onUnmounted&&this.props.onUnmounted()}},{key:"render",value:function(){var t=this.props.element||this.props.children;if(t&&this.state.mounted){var o=this.props.appendTo||n.appendTo||document.body;return"self"===o?t:e.createPortal(t,o)}return null}}])&&u(y.prototype,m),b&&u(y,b),Object.defineProperty(y,"prototype",{writable:!1}),h}();b={element:null,appendTo:null,visible:!1,onMounted:null,onUnmounted:null},(m="defaultProps")in(y=d)?Object.defineProperty(y,m,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[m]=b;export{d as Portal};
|