primereact 6.5.0 → 7.0.0-rc.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/accordion/accordion.cjs.js +2 -0
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +2 -0
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +2 -0
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +308 -10
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +61 -1
- package/api/api.esm.js +305 -11
- package/api/api.esm.min.js +1 -1
- package/api/api.js +308 -12
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +3 -1
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +3 -1
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +3 -1
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +2 -0
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +2 -0
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +2 -0
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +2 -0
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +2 -0
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +2 -0
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +2 -0
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +2 -0
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +2 -0
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +9 -15
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +9 -15
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +9 -15
- package/blockui/blockui.min.css +1 -1
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +2 -0
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +2 -0
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +2 -0
- package/breadcrumb/breadcrumb.min.css +1 -1
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +2 -0
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +2 -0
- package/button/button.esm.min.js +1 -1
- package/button/button.js +2 -0
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +85 -67
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +85 -67
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +85 -67
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +2 -0
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.js +2 -0
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +2 -0
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +2 -0
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +2 -0
- package/card/card.esm.min.js +1 -1
- package/card/card.js +2 -0
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +2 -0
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +3 -1
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +2 -0
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +2 -0
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +2 -0
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +2 -0
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +2 -0
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +2 -0
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +2 -0
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +19 -9
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +3 -1
- package/checkbox/checkbox.esm.js +19 -9
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +19 -9
- package/checkbox/checkbox.min.css +1 -1
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +2 -0
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.esm.js +2 -0
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +2 -0
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +2 -0
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -0
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -0
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +2 -0
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +2 -0
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +2 -0
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.js +34 -9
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +146 -13
- package/column/column.esm.js +34 -9
- package/column/column.esm.min.js +1 -1
- package/column/column.js +34 -9
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.js +2 -0
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.js +2 -0
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +2 -0
- package/columngroup/columngroup.min.js +1 -1
- package/common/common.min.css +1 -1
- package/confirmdialog/confirmdialog.cjs.js +2 -0
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +2 -0
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +2 -0
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +2 -0
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +2 -0
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +2 -0
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +2 -0
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +3 -1
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +2 -0
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.cjs.js +351 -669
- package/core/core.cjs.min.js +1 -1
- package/core/core.esm.js +347 -665
- package/core/core.esm.min.js +1 -1
- package/core/core.js +352 -671
- package/core/core.min.js +1 -1
- package/csstransition/csstransition.cjs.js +2 -0
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.esm.js +2 -0
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +2 -0
- package/csstransition/csstransition.min.js +1 -1
- package/datascroller/datascroller.cjs.js +8 -1
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +8 -1
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +8 -1
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +4803 -3320
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +97 -28
- package/datatable/datatable.esm.js +4803 -3321
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +4801 -3322
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +4 -2
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +4 -2
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +4 -2
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +2 -0
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +2 -0
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +2 -0
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +12 -1
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +12 -1
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +12 -1
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +2 -0
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +2 -0
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +2 -0
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +5 -1
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +5 -1
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +5 -1
- package/dock/dock.min.css +1 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +15 -11
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +17 -13
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +15 -11
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +2 -0
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +2 -0
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +2 -0
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +2 -0
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +2 -0
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +2 -0
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +2 -0
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +2 -0
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +2 -0
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +2 -0
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +2 -0
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +2 -0
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +25 -5
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +25 -5
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +25 -5
- package/galleria/galleria.min.css +1 -1
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +2 -0
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.js +2 -0
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +2 -0
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +397 -0
- package/image/image.cjs.min.js +1 -0
- package/image/image.d.ts +18 -0
- package/image/image.esm.js +389 -0
- package/image/image.esm.min.js +1 -0
- package/image/image.js +400 -0
- package/image/image.min.css +1 -0
- package/image/image.min.js +1 -0
- package/image/package.json +6 -0
- package/inplace/inplace.cjs.js +2 -0
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +2 -0
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +2 -0
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +2 -0
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +2 -0
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +2 -0
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +177 -62
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +1 -0
- package/inputnumber/inputnumber.esm.js +177 -62
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +177 -62
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +16 -6
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.d.ts +3 -1
- package/inputswitch/inputswitch.esm.js +16 -6
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +16 -6
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +2 -0
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +2 -0
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +2 -0
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +2 -0
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.esm.js +2 -0
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +2 -0
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/knob/knob.cjs.js +2 -0
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +2 -0
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +2 -0
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +6 -3
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +7 -4
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +7 -5
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +2 -0
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +2 -0
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +2 -0
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +2 -0
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +2 -0
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +2 -0
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +2 -0
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +1 -1
- package/menu/menu.esm.js +2 -0
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +2 -0
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +2 -0
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +2 -0
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +2 -0
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +2 -0
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +2 -0
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -0
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +2 -0
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +2 -0
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +2 -0
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +22 -12
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +3 -1
- package/multiselect/multiselect.esm.js +24 -14
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +22 -12
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +2 -0
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +2 -0
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +2 -0
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +2 -0
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +2 -0
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +2 -0
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +2 -0
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +2 -0
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +2 -0
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +10 -1
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +10 -1
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +10 -1
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +120 -30
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.d.ts +13 -0
- package/paginator/paginator.esm.js +120 -30
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +121 -32
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +2 -0
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +2 -0
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +2 -0
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +2 -0
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +3 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +2 -0
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +2 -0
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +2 -0
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -0
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +2 -0
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +2 -0
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +2 -0
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +6 -2
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +6 -2
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +6 -2
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +12344 -9903
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +12340 -9903
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +12344 -9903
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +2 -0
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +2 -0
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +2 -0
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +2 -0
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +2 -0
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +2 -0
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +2 -0
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -0
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +2 -0
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +2 -0
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +2 -0
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +2 -0
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +340 -84
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +4600 -3838
- package/resources/themes/arya-green/theme.css +4600 -3838
- package/resources/themes/arya-orange/theme.css +4600 -3838
- package/resources/themes/arya-purple/theme.css +4600 -3838
- package/resources/themes/bootstrap4-dark-blue/theme.css +4601 -3837
- package/resources/themes/bootstrap4-dark-purple/theme.css +4601 -3837
- package/resources/themes/bootstrap4-light-blue/theme.css +4579 -3815
- package/resources/themes/bootstrap4-light-purple/theme.css +4579 -3815
- package/resources/themes/fluent-light/theme.css +4690 -3897
- package/resources/themes/luna-amber/theme.css +4555 -3807
- package/resources/themes/luna-blue/theme.css +4551 -3803
- package/resources/themes/luna-green/theme.css +4551 -3803
- package/resources/themes/luna-pink/theme.css +4555 -3807
- package/resources/themes/md-dark-deeppurple/theme.css +5580 -4689
- package/resources/themes/md-dark-indigo/theme.css +5578 -4687
- package/resources/themes/md-light-deeppurple/theme.css +5569 -4678
- package/resources/themes/md-light-indigo/theme.css +5569 -4678
- package/resources/themes/mdc-dark-deeppurple/theme.css +5575 -4684
- package/resources/themes/mdc-dark-indigo/theme.css +5583 -4692
- package/resources/themes/mdc-light-deeppurple/theme.css +5579 -4688
- package/resources/themes/mdc-light-indigo/theme.css +5579 -4688
- package/resources/themes/nova/theme.css +4554 -3802
- package/resources/themes/nova-accent/theme.css +4571 -3818
- package/resources/themes/nova-alt/theme.css +4560 -3806
- package/resources/themes/rhea/theme.css +4562 -3813
- package/resources/themes/saga-blue/theme.css +4608 -3847
- package/resources/themes/saga-green/theme.css +4608 -3847
- package/resources/themes/saga-orange/theme.css +4608 -3847
- package/resources/themes/saga-purple/theme.css +4607 -3846
- package/resources/themes/tailwind-light/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Light.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/tailwind-light/theme.css +5722 -0
- package/resources/themes/vela-blue/theme.css +4602 -3840
- package/resources/themes/vela-green/theme.css +4602 -3840
- package/resources/themes/vela-orange/theme.css +4602 -3840
- package/resources/themes/vela-purple/theme.css +4602 -3840
- package/ripple/ripple.cjs.js +2 -0
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +2 -0
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +2 -0
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +2 -0
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.js +2 -0
- package/row/row.esm.min.js +1 -1
- package/row/row.js +2 -0
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +2 -0
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +2 -0
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +2 -0
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +2 -0
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.esm.js +2 -0
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +2 -0
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +2 -0
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +2 -0
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +2 -0
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/sidebar.cjs.js +23 -27
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +23 -27
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +23 -27
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +2 -0
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +2 -0
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +2 -0
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +2 -0
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +2 -0
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +2 -0
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +14 -7
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +14 -7
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +14 -7
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +2 -0
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +2 -0
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +2 -0
- package/speeddial/speeddial.min.css +1 -1
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +2 -0
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +2 -0
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +2 -0
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +2 -0
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +2 -0
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +2 -0
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +2 -0
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +2 -0
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +2 -0
- package/steps/steps.min.js +1 -1
- package/styleclass/package.json +6 -0
- package/styleclass/styleclass.cjs.js +355 -0
- package/styleclass/styleclass.cjs.min.js +1 -0
- package/styleclass/styleclass.d.ts +18 -0
- package/styleclass/styleclass.esm.js +351 -0
- package/styleclass/styleclass.esm.min.js +1 -0
- package/styleclass/styleclass.js +358 -0
- package/styleclass/styleclass.min.js +1 -0
- package/tabmenu/tabmenu.cjs.js +2 -0
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +2 -0
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +2 -0
- package/tabmenu/tabmenu.min.css +1 -1
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +135 -18
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +1 -0
- package/tabview/tabview.esm.js +135 -18
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +135 -18
- package/tabview/tabview.min.css +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +2 -0
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.esm.js +2 -0
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +2 -0
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +2 -0
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +2 -0
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +2 -0
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +2 -0
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +1 -1
- package/tieredmenu/tieredmenu.esm.js +2 -0
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +2 -0
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +2 -0
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +2 -0
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +2 -0
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +9 -2
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +4 -0
- package/toast/toast.esm.js +9 -2
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +9 -2
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +2 -0
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +2 -0
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -0
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +2 -0
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +2 -0
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +2 -0
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +2 -0
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +2 -0
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +2 -0
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tree/tree.cjs.js +2 -0
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +2 -0
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +2 -0
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +1 -1
- package/treeselect/treeselect.cjs.js +2 -0
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +2 -0
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +2 -0
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +22 -8
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +23 -9
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +23 -10
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +2 -0
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +2 -0
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +2 -0
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +404 -496
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +20 -26
- package/utils/utils.esm.js +405 -496
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +404 -496
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +277 -160
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.d.ts +21 -9
- package/virtualscroller/virtualscroller.esm.js +277 -160
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +277 -160
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +168 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{Component as t}from"react";import{classNames as o,Ripple as n,ObjectUtils as r,DomHandler as i}from"primereact/core";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 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})(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})(e)}function v(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?p(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(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}).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 S(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 k(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 T(){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 S(e)||b(e)||k(e)||T()}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(r){h(u,t);var i,s,a=(i=u,s=C(),function(){var e,t=d(i);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(n,null))}}]),u}();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}}g(R,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var I=function(n){h(f,t);var s,a,u=(s=f,a=w(),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=E(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 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?i.hasClass(t,"p-picklist-item")?t:this.findNextItem(t):null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?i.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,n){return e.createElement(R,{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,m({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 L=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=E(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=E(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=E(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=E(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,n=o("p-picklist-buttons",this.props.className);return e.createElement("div",{className:n},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 N=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(t&&t.length){for(var o=E(this.props.target),n=E(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(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 t=this.props.targetSelection;if(t&&t.length){for(var o=E(this.props.target),n=E(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(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 t=!this.props.sourceSelection.length,n=!this.props.targetSelection.length,r=!this.props.source.length,i=!this.props.target.length,l=o("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return e.createElement("div",{className:l},e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),e.createElement(s,{disabled:r,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:i,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(n){h(u,t);var r,s,a=(r=u,s=O(),function(){var e,t=d(r);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)).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(u,[{key:"getSourceSelection",value:function(){return this.props.onSourceSelectionChange?this.props.sourceSelection:this.state.sourceSelection}},{key:"getTargetSelection",value:function(){return this.props.onTargetSelectionChange?this.props.targetSelection:this.state.targetSelection}},{key:"onSourceReorder",value:function(e){this.handleChange(e,e.value,this.props.target),this.reorderedListElement=this.sourceListElement,this.reorderDirection=e.direction}},{key:"onTargetReorder",value:function(e){this.handleChange(e,this.props.source,e.value),this.reorderedListElement=this.targetListElement,this.reorderDirection=e.direction}},{key:"handleScrollPosition",value:function(e,t){if(e){var o=i.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,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,o=e.getElementsByClassName("p-highlight");i.scrollInView(e,-1===t?o[0]:o[o.length-1])}},{key:"onSelectionChange",value:function(e,t,o){o?o(e):this.setState(g({},t,e.value)),this.state.sourceSelection&&this.state.sourceSelection.length&&"targetSelection"===t?this.setState({sourceSelection:[]}):this.state.targetSelection&&this.state.targetSelection.length&&"sourceSelection"===t&&this.setState({targetSelection:[]})}},{key:"componentDidUpdate",value:function(){this.reorderedListElement&&(this.handleScrollPosition(this.reorderedListElement,this.reorderDirection),this.reorderedListElement=null,this.reorderDirection=null)}},{key:"render",value:function(){var t=this,n=o("p-picklist p-component",this.props.className),r=this.getSourceSelection(),i=this.getTargetSelection();return e.createElement("div",{id:this.props.id,className:n,style:this.props.style},this.props.showSourceControls&&e.createElement(L,{list:this.props.source,selection:r,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:r,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(N,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:r,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(L,{list:this.props.target,selection:i,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),u}();g(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,Ripple as n,ObjectUtils as r,DomHandler as i}from"primereact/core";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 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})(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})(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)})(e)}function g(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}).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 S(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 k(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 T(){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 S(e)||b(e)||k(e)||T()}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 i,s,a=(i=u,s=C(),function(){var e,t=d(i);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(n,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}}g(w,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var I=function(n){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=E(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 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?i.hasClass(t,"p-picklist-item")?t:this.findNextItem(t):null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?i.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,n){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,m({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 D=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=E(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=E(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=E(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=E(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,n=o("p-picklist-buttons",this.props.className);return e.createElement("div",{className:n},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 L(){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=L(),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(t&&t.length){for(var o=E(this.props.target),n=E(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(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 t=this.props.targetSelection;if(t&&t.length){for(var o=E(this.props.target),n=E(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(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 t=!this.props.sourceSelection.length,n=!this.props.targetSelection.length,r=!this.props.source.length,i=!this.props.target.length,l=o("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return e.createElement("div",{className:l},e.createElement(s,{disabled:t,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),e.createElement(s,{disabled:r,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:i,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(n){h(u,t);var r,s,a=(r=u,s=O(),function(){var e,t=d(r);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)).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(u,[{key:"getSourceSelection",value:function(){return this.props.onSourceSelectionChange?this.props.sourceSelection:this.state.sourceSelection}},{key:"getTargetSelection",value:function(){return this.props.onTargetSelectionChange?this.props.targetSelection:this.state.targetSelection}},{key:"onSourceReorder",value:function(e){this.handleChange(e,e.value,this.props.target),this.reorderedListElement=this.sourceListElement,this.reorderDirection=e.direction}},{key:"onTargetReorder",value:function(e){this.handleChange(e,this.props.source,e.value),this.reorderedListElement=this.targetListElement,this.reorderDirection=e.direction}},{key:"handleScrollPosition",value:function(e,t){if(e){var o=i.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,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,o=e.getElementsByClassName("p-highlight");i.scrollInView(e,-1===t?o[0]:o[o.length-1])}},{key:"onSelectionChange",value:function(e,t,o){o?o(e):this.setState(g({},t,e.value)),this.state.sourceSelection&&this.state.sourceSelection.length&&"targetSelection"===t?this.setState({sourceSelection:[]}):this.state.targetSelection&&this.state.targetSelection.length&&"sourceSelection"===t&&this.setState({targetSelection:[]})}},{key:"componentDidUpdate",value:function(){this.reorderedListElement&&(this.handleScrollPosition(this.reorderedListElement,this.reorderDirection),this.reorderedListElement=null,this.reorderDirection=null)}},{key:"render",value:function(){var t=this,n=o("p-picklist p-component",this.props.className),r=this.getSourceSelection(),i=this.getTargetSelection();return e.createElement("div",{id:this.props.id,className:n,style:this.props.style},this.props.showSourceControls&&e.createElement(D,{list:this.props.source,selection:r,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:r,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(N,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:r,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(D,{list:this.props.target,selection:i,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),u}();g(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
|
@@ -79,6 +79,8 @@ this.primereact.picklist = (function (exports, React, core, button) {
|
|
|
79
79
|
function _possibleConstructorReturn(self, call) {
|
|
80
80
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
81
81
|
return call;
|
|
82
|
+
} else if (call !== void 0) {
|
|
83
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
return _assertThisInitialized(self);
|
package/picklist/picklist.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.picklist=function(e,t,n,o){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);function s(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 o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(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})(e)}function f(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?c(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function y(e){if(Array.isArray(e))return g(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 g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function 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 T(e){return y(e)||b(e)||S(e)||k()}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 E=function(e){u(l,e);var t,o,r=(t=l,o=C(),function(){var e,n=d(t);if(o){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function l(e){var t;return s(this,l),(t=r.call(this,e)).onClick=t.onClick.bind(c(t)),t.onKeyDown=t.onKeyDown.bind(c(t)),t}return a(l,[{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=n.classNames("p-picklist-item",{"p-highlight":this.props.selected},this.props.className);return i.default.createElement("li",{className:t,onClick:this.onClick,onKeyDown:this.onKeyDown,tabIndex:this.props.tabIndex,role:"option","aria-selected":this.props.selected},e,i.default.createElement(n.Ripple,null))}}]),l}(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}}v(E,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var w=function(e){u(l,e);var t,o,r=(t=l,o=R(),function(){var e,n=d(t);if(o){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function l(e){var t;return s(this,l),(t=r.call(this,e)).onItemClick=t.onItemClick.bind(c(t)),t.onItemKeyDown=t.onItemKeyDown.bind(c(t)),t}return a(l,[{key:"onItemClick",value:function(e){var t=e.originalEvent,o=e.value,r=T(this.props.selection),i=n.ObjectUtils.findIndexInList(o,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(o))}else s?r.splice(i,1):r.push(o);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 n=this.findNextItem(t);n&&n.focus(),e.originalEvent.preventDefault();break;case 38:var o=this.findPrevItem(t);o&&o.focus(),e.originalEvent.preventDefault();break;case 13:this.onItemClick(e),e.originalEvent.preventDefault()}}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?n.DomHandler.hasClass(t,"p-picklist-item")?t:this.findNextItem(t):null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?n.DomHandler.hasClass(t,"p-picklist-item")?t:this.findPrevItem(t):null}},{key:"isSelected",value:function(e){return-1!==n.ObjectUtils.findIndexInList(e,this.props.selection,this.props.dataKey)}},{key:"render",value:function(){var e=this,t=null,o=null,r=n.classNames("p-picklist-list-wrapper",this.props.className),s=n.classNames("p-picklist-list",this.props.listClassName);return this.props.header&&(t=i.default.createElement("div",{className:"p-picklist-header"},n.ObjectUtils.getJSXElement(this.props.header,this.props))),this.props.list&&(o=this.props.list.map((function(t,n){return i.default.createElement(E,{key:JSON.stringify(t),value:t,template:e.props.itemTemplate,selected:e.isSelected(t),onClick:e.onItemClick,onKeyDown:e.onItemKeyDown,tabIndex:e.props.tabIndex})}))),i.default.createElement("div",{ref:this.props.forwardRef,className:r},t,i.default.createElement("ul",{className:s,style:this.props.style,role:"listbox","aria-multiselectable":!0},o))}}]),l}(t.Component),I=i.default.forwardRef((function(e,t){return i.default.createElement(w,m({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 O=function(e){u(p,e);var t,r,l=(t=p,r=K(),function(){var e,n=d(t);if(r){var o=d(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f(this,e)});function p(e){var t;return s(this,p),(t=l.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(p,[{key:"moveUp",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),r=0;r<t.length;r++){var i=n.ObjectUtils.findIndexInList(t[r],o,this.props.dataKey);if(0===i)break;var s=o[i-1];o[i-1]=o[i],o[i]=s}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"up"})}}},{key:"moveTop",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),r=0;r<t.length;r++){var i=n.ObjectUtils.findIndexInList(t[r],o,this.props.dataKey);if(0===i)break;var s=o.splice(i,1)[0];o.unshift(s)}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"top"})}}},{key:"moveDown",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),r=t.length-1;r>=0;r--){var i=n.ObjectUtils.findIndexInList(t[r],o,this.props.dataKey);if(i===o.length-1)break;var s=o[i+1];o[i+1]=o[i],o[i]=s}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"down"}),this.movedDown=!0}}},{key:"moveBottom",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),r=t.length-1;r>=0;r--){var i=n.ObjectUtils.findIndexInList(t[r],o,this.props.dataKey);if(i===o.length-1)break;var s=o.splice(i,1)[0];o.push(s)}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"bottom"})}}},{key:"render",value:function(){var e=!this.props.selection.length,t=n.classNames("p-picklist-buttons",this.props.className);return i.default.createElement("div",{className:t},i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-up",onClick:this.moveUp}),i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-up",onClick:this.moveTop}),i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-down",onClick:this.moveDown}),i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-down",onClick:this.moveBottom}))}}]),p}(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){u(p,e);var t,r,l=(t=p,r=N(),function(){var e,n=d(t);if(r){var o=d(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f(this,e)});function p(e){var t;return s(this,p),(t=l.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(p,[{key:"moveRight",value:function(e){var t=this.props.sourceSelection;if(t&&t.length){for(var o=T(this.props.target),r=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===n.ObjectUtils.findIndexInList(s,o,this.props.dataKey)&&o.push(r.splice(n.ObjectUtils.findIndexInList(s,r,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:r,target:o,direction:"toTarget"})}}},{key:"moveAllRight",value:function(e){if(this.props.source){var t=[].concat(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(t&&t.length){for(var o=T(this.props.target),r=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===n.ObjectUtils.findIndexInList(s,r,this.props.dataKey)&&r.push(o.splice(n.ObjectUtils.findIndexInList(s,o,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:r,target:o,direction:"toSource"})}}},{key:"moveAllLeft",value:function(e){if(this.props.source){var t=[].concat(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=!this.props.sourceSelection.length,t=!this.props.targetSelection.length,r=!this.props.source.length,s=!this.props.target.length,l=n.classNames("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return i.default.createElement("div",{className:l},i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),i.default.createElement(o.Button,{disabled:r,type:"button",icon:"pi pi-angle-double-right",onClick:this.moveAllRight}),i.default.createElement(o.Button,{disabled:t,type:"button",icon:"pi pi-angle-left",onClick:this.moveLeft}),i.default.createElement(o.Button,{disabled:s,type:"button",icon:"pi pi-angle-double-left",onClick:this.moveAllLeft}))}}]),p}(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){u(l,e);var t,o,r=(t=l,o=D(),function(){var e,n=d(t);if(o){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function l(e){var t;return s(this,l),(t=r.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(l,[{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.DomHandler.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,n){this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,source:t,target:n})}},{key:"onTransfer",value:function(e){var t=e.originalEvent,n=e.source,o=e.target;switch(e.direction){case"toTarget":this.props.onMoveToTarget&&this.props.onMoveToTarget({originalEvent:t,value:this.getSourceSelection()});break;case"allToTarget":this.props.onMoveAllToTarget&&this.props.onMoveAllToTarget({originalEvent:t,value:this.props.source});break;case"toSource":this.props.onMoveToSource&&this.props.onMoveToSource({originalEvent:t,value:this.getTargetSelection()});break;case"allToSource":this.props.onMoveAllToSource&&this.props.onMoveAllToSource({originalEvent:t,value:this.props.target})}this.onSelectionChange({originalEvent:t,value:[]},"sourceSelection",this.props.onSourceSelectionChange),this.onSelectionChange({originalEvent:t,value:[]},"targetSelection",this.props.onTargetSelectionChange),this.handleChange(e,n,o)}},{key:"scrollInView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=e.getElementsByClassName("p-highlight");n.DomHandler.scrollInView(e,-1===t?o[0]:o[o.length-1])}},{key:"onSelectionChange",value:function(e,t,n){n?n(e):this.setState(v({},t,e.value)),this.state.sourceSelection&&this.state.sourceSelection.length&&"targetSelection"===t?this.setState({sourceSelection:[]}):this.state.targetSelection&&this.state.targetSelection.length&&"sourceSelection"===t&&this.setState({targetSelection:[]})}},{key:"componentDidUpdate",value:function(){this.reorderedListElement&&(this.handleScrollPosition(this.reorderedListElement,this.reorderDirection),this.reorderedListElement=null,this.reorderDirection=null)}},{key:"render",value:function(){var e=this,t=n.classNames("p-picklist p-component",this.props.className),o=this.getSourceSelection(),r=this.getTargetSelection();return i.default.createElement("div",{id:this.props.id,className:t,style:this.props.style},this.props.showSourceControls&&i.default.createElement(O,{list:this.props.source,selection:o,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:o,onSelectionChange:function(t){return e.onSelectionChange(t,"sourceSelection",e.props.onSourceSelectionChange)},itemTemplate:this.props.itemTemplate,header:this.props.sourceHeader,style:this.props.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:this.props.metaKeySelection,tabIndex:this.props.tabIndex,dataKey:this.props.dataKey}),i.default.createElement(x,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:o,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(O,{list:this.props.target,selection:r,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),l}(t.Component);return v(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.core,primereact.button);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.picklist=function(e,t,n,o){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);function s(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 o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(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})(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)})(e)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function y(e){if(Array.isArray(e))return g(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 g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function 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 T(e){return y(e)||b(e)||S(e)||k()}function E(){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(e){u(l,e);var t,o,r=(t=l,o=E(),function(){var e,n=d(t);if(o){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function l(e){var t;return s(this,l),(t=r.call(this,e)).onClick=t.onClick.bind(c(t)),t.onKeyDown=t.onKeyDown.bind(c(t)),t}return a(l,[{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=n.classNames("p-picklist-item",{"p-highlight":this.props.selected},this.props.className);return i.default.createElement("li",{className:t,onClick:this.onClick,onKeyDown:this.onKeyDown,tabIndex:this.props.tabIndex,role:"option","aria-selected":this.props.selected},e,i.default.createElement(n.Ripple,null))}}]),l}(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}}v(C,"defaultProps",{value:null,className:null,template:null,selected:!1,tabIndex:null,onClick:null,onKeyDown:null});var w=function(e){u(l,e);var t,o,r=(t=l,o=R(),function(){var e,n=d(t);if(o){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function l(e){var t;return s(this,l),(t=r.call(this,e)).onItemClick=t.onItemClick.bind(c(t)),t.onItemKeyDown=t.onItemKeyDown.bind(c(t)),t}return a(l,[{key:"onItemClick",value:function(e){var t=e.originalEvent,o=e.value,r=T(this.props.selection),i=n.ObjectUtils.findIndexInList(o,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(o))}else s?r.splice(i,1):r.push(o);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 n=this.findNextItem(t);n&&n.focus(),e.originalEvent.preventDefault();break;case 38:var o=this.findPrevItem(t);o&&o.focus(),e.originalEvent.preventDefault();break;case 13:this.onItemClick(e),e.originalEvent.preventDefault()}}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?n.DomHandler.hasClass(t,"p-picklist-item")?t:this.findNextItem(t):null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?n.DomHandler.hasClass(t,"p-picklist-item")?t:this.findPrevItem(t):null}},{key:"isSelected",value:function(e){return-1!==n.ObjectUtils.findIndexInList(e,this.props.selection,this.props.dataKey)}},{key:"render",value:function(){var e=this,t=null,o=null,r=n.classNames("p-picklist-list-wrapper",this.props.className),s=n.classNames("p-picklist-list",this.props.listClassName);return this.props.header&&(t=i.default.createElement("div",{className:"p-picklist-header"},n.ObjectUtils.getJSXElement(this.props.header,this.props))),this.props.list&&(o=this.props.list.map((function(t,n){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},t,i.default.createElement("ul",{className:s,style:this.props.style,role:"listbox","aria-multiselectable":!0},o))}}]),l}(t.Component),I=i.default.forwardRef((function(e,t){return i.default.createElement(w,m({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 O=function(e){u(p,e);var t,r,l=(t=p,r=K(),function(){var e,n=d(t);if(r){var o=d(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f(this,e)});function p(e){var t;return s(this,p),(t=l.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(p,[{key:"moveUp",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),r=0;r<t.length;r++){var i=n.ObjectUtils.findIndexInList(t[r],o,this.props.dataKey);if(0===i)break;var s=o[i-1];o[i-1]=o[i],o[i]=s}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"up"})}}},{key:"moveTop",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),r=0;r<t.length;r++){var i=n.ObjectUtils.findIndexInList(t[r],o,this.props.dataKey);if(0===i)break;var s=o.splice(i,1)[0];o.unshift(s)}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"top"})}}},{key:"moveDown",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),r=t.length-1;r>=0;r--){var i=n.ObjectUtils.findIndexInList(t[r],o,this.props.dataKey);if(i===o.length-1)break;var s=o[i+1];o[i+1]=o[i],o[i]=s}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"down"}),this.movedDown=!0}}},{key:"moveBottom",value:function(e){var t=this.props.selection;if(t&&t.length){for(var o=T(this.props.list),r=t.length-1;r>=0;r--){var i=n.ObjectUtils.findIndexInList(t[r],o,this.props.dataKey);if(i===o.length-1)break;var s=o.splice(i,1)[0];o.push(s)}this.props.onReorder&&this.props.onReorder({originalEvent:e,value:o,direction:"bottom"})}}},{key:"render",value:function(){var e=!this.props.selection.length,t=n.classNames("p-picklist-buttons",this.props.className);return i.default.createElement("div",{className:t},i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-up",onClick:this.moveUp}),i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-up",onClick:this.moveTop}),i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-down",onClick:this.moveDown}),i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-double-down",onClick:this.moveBottom}))}}]),p}(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){u(p,e);var t,r,l=(t=p,r=N(),function(){var e,n=d(t);if(r){var o=d(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f(this,e)});function p(e){var t;return s(this,p),(t=l.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(p,[{key:"moveRight",value:function(e){var t=this.props.sourceSelection;if(t&&t.length){for(var o=T(this.props.target),r=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===n.ObjectUtils.findIndexInList(s,o,this.props.dataKey)&&o.push(r.splice(n.ObjectUtils.findIndexInList(s,r,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:r,target:o,direction:"toTarget"})}}},{key:"moveAllRight",value:function(e){if(this.props.source){var t=[].concat(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(t&&t.length){for(var o=T(this.props.target),r=T(this.props.source),i=0;i<t.length;i++){var s=t[i];-1===n.ObjectUtils.findIndexInList(s,r,this.props.dataKey)&&r.push(o.splice(n.ObjectUtils.findIndexInList(s,o,this.props.dataKey),1)[0])}this.props.onTransfer&&this.props.onTransfer({originalEvent:e,source:r,target:o,direction:"toSource"})}}},{key:"moveAllLeft",value:function(e){if(this.props.source){var t=[].concat(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=!this.props.sourceSelection.length,t=!this.props.targetSelection.length,r=!this.props.source.length,s=!this.props.target.length,l=n.classNames("p-picklist-buttons p-picklist-transfer-buttons",this.props.className);return i.default.createElement("div",{className:l},i.default.createElement(o.Button,{disabled:e,type:"button",icon:"pi pi-angle-right",onClick:this.moveRight}),i.default.createElement(o.Button,{disabled:r,type:"button",icon:"pi pi-angle-double-right",onClick:this.moveAllRight}),i.default.createElement(o.Button,{disabled:t,type:"button",icon:"pi pi-angle-left",onClick:this.moveLeft}),i.default.createElement(o.Button,{disabled:s,type:"button",icon:"pi pi-angle-double-left",onClick:this.moveAllLeft}))}}]),p}(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){u(l,e);var t,o,r=(t=l,o=D(),function(){var e,n=d(t);if(o){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function l(e){var t;return s(this,l),(t=r.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(l,[{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.DomHandler.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,n){this.props.onChange&&this.props.onChange({originalEvent:e.originalEvent,source:t,target:n})}},{key:"onTransfer",value:function(e){var t=e.originalEvent,n=e.source,o=e.target;switch(e.direction){case"toTarget":this.props.onMoveToTarget&&this.props.onMoveToTarget({originalEvent:t,value:this.getSourceSelection()});break;case"allToTarget":this.props.onMoveAllToTarget&&this.props.onMoveAllToTarget({originalEvent:t,value:this.props.source});break;case"toSource":this.props.onMoveToSource&&this.props.onMoveToSource({originalEvent:t,value:this.getTargetSelection()});break;case"allToSource":this.props.onMoveAllToSource&&this.props.onMoveAllToSource({originalEvent:t,value:this.props.target})}this.onSelectionChange({originalEvent:t,value:[]},"sourceSelection",this.props.onSourceSelectionChange),this.onSelectionChange({originalEvent:t,value:[]},"targetSelection",this.props.onTargetSelectionChange),this.handleChange(e,n,o)}},{key:"scrollInView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=e.getElementsByClassName("p-highlight");n.DomHandler.scrollInView(e,-1===t?o[0]:o[o.length-1])}},{key:"onSelectionChange",value:function(e,t,n){n?n(e):this.setState(v({},t,e.value)),this.state.sourceSelection&&this.state.sourceSelection.length&&"targetSelection"===t?this.setState({sourceSelection:[]}):this.state.targetSelection&&this.state.targetSelection.length&&"sourceSelection"===t&&this.setState({targetSelection:[]})}},{key:"componentDidUpdate",value:function(){this.reorderedListElement&&(this.handleScrollPosition(this.reorderedListElement,this.reorderDirection),this.reorderedListElement=null,this.reorderDirection=null)}},{key:"render",value:function(){var e=this,t=n.classNames("p-picklist p-component",this.props.className),o=this.getSourceSelection(),r=this.getTargetSelection();return i.default.createElement("div",{id:this.props.id,className:t,style:this.props.style},this.props.showSourceControls&&i.default.createElement(O,{list:this.props.source,selection:o,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:o,onSelectionChange:function(t){return e.onSelectionChange(t,"sourceSelection",e.props.onSourceSelectionChange)},itemTemplate:this.props.itemTemplate,header:this.props.sourceHeader,style:this.props.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:this.props.metaKeySelection,tabIndex:this.props.tabIndex,dataKey:this.props.dataKey}),i.default.createElement(x,{onTransfer:this.onTransfer,source:this.props.source,target:this.props.target,sourceSelection:o,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(O,{list:this.props.target,selection:r,onReorder:this.onTargetReorder,className:"p-picklist-target-controls",dataKey:this.props.dataKey}))}}]),l}(t.Component);return v(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.core,primereact.button);
|
package/portal/portal.cjs.js
CHANGED
|
@@ -84,6 +84,8 @@ function _assertThisInitialized(self) {
|
|
|
84
84
|
function _possibleConstructorReturn(self, call) {
|
|
85
85
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
86
86
|
return call;
|
|
87
|
+
} else if (call !== void 0) {
|
|
88
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
return _assertThisInitialized(self);
|
|
@@ -153,9 +155,11 @@ var Portal = /*#__PURE__*/function (_Component) {
|
|
|
153
155
|
}, {
|
|
154
156
|
key: "render",
|
|
155
157
|
value: function render() {
|
|
156
|
-
|
|
158
|
+
var element = this.props.element || this.props.children;
|
|
159
|
+
|
|
160
|
+
if (element && this.state.mounted) {
|
|
157
161
|
var appendTo = this.props.appendTo || PrimeReact__default['default'].appendTo || document.body;
|
|
158
|
-
return appendTo === 'self' ?
|
|
162
|
+
return appendTo === 'self' ? element : /*#__PURE__*/ReactDOM__default['default'].createPortal(element, appendTo);
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
return null;
|
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 r=o(t),u=o(n);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function
|
|
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 r=o(t),u=o(n);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(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&&f(e,t)}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t){if(t&&("object"===a(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 y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var b,m,h,v=function(t){l(m,e.Component);var n,o,f,a,p,b=(n=m,o=d(),function(){var e,t=y(n);if(o){var r=y(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return s(this,e)});function m(e){var t;return i(this,m),(t=b.call(this,e)).state={mounted:e.visible},t}return f=m,(a=[{key:"hasDOM",value:function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"componentDidMount",value:function(){this.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||u.default.appendTo||document.body;return"self"===t?e:r.default.createPortal(e,t)}return null}}])&&c(f.prototype,a),p&&c(f,p),m}();h={element:null,appendTo:null,visible:!1,onMounted:null,onUnmounted:null},(m="defaultProps")in(b=v)?Object.defineProperty(b,m,{value:h,enumerable:!0,configurable:!0,writable:!0}):b[m]=h,exports.Portal=v;
|
package/portal/portal.esm.js
CHANGED
|
@@ -75,6 +75,8 @@ function _assertThisInitialized(self) {
|
|
|
75
75
|
function _possibleConstructorReturn(self, call) {
|
|
76
76
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
77
77
|
return call;
|
|
78
|
+
} else if (call !== void 0) {
|
|
79
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
return _assertThisInitialized(self);
|
|
@@ -144,9 +146,11 @@ var Portal = /*#__PURE__*/function (_Component) {
|
|
|
144
146
|
}, {
|
|
145
147
|
key: "render",
|
|
146
148
|
value: function render() {
|
|
147
|
-
|
|
149
|
+
var element = this.props.element || this.props.children;
|
|
150
|
+
|
|
151
|
+
if (element && this.state.mounted) {
|
|
148
152
|
var appendTo = this.props.appendTo || PrimeReact.appendTo || document.body;
|
|
149
|
-
return appendTo === 'self' ?
|
|
153
|
+
return appendTo === 'self' ? element : /*#__PURE__*/ReactDOM.createPortal(element, appendTo);
|
|
150
154
|
}
|
|
151
155
|
|
|
152
156
|
return null;
|
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 o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(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}}),e&&u(t,e)}function c(t){return(c="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})(t)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){
|
|
1
|
+
import{Component as t}from"react";import e from"react-dom";import n from"primereact/api";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(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}}),e&&u(t,e)}function c(t){return(c="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})(t)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return f(t)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var s,y,d,m=function(u){i(b,t);var c,f,s,y,d,m=(c=b,f=p(),function(){var t,e=a(c);if(f){var n=a(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return l(this,t)});function b(t){var e;return o(this,b),(e=m.call(this,t)).state={mounted:t.visible},e}return s=b,(y=[{key:"hasDOM",value:function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"componentDidMount",value:function(){this.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}}])&&r(s.prototype,y),d&&r(s,d),b}();d={element:null,appendTo:null,visible:!1,onMounted:null,onUnmounted:null},(y="defaultProps")in(s=m)?Object.defineProperty(s,y,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[y]=d;export{m as Portal};
|
package/portal/portal.js
CHANGED
|
@@ -80,6 +80,8 @@ this.primereact.portal = (function (exports, react, ReactDOM, PrimeReact) {
|
|
|
80
80
|
function _possibleConstructorReturn(self, call) {
|
|
81
81
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
82
82
|
return call;
|
|
83
|
+
} else if (call !== void 0) {
|
|
84
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
return _assertThisInitialized(self);
|
|
@@ -149,9 +151,11 @@ this.primereact.portal = (function (exports, react, ReactDOM, PrimeReact) {
|
|
|
149
151
|
}, {
|
|
150
152
|
key: "render",
|
|
151
153
|
value: function render() {
|
|
152
|
-
|
|
154
|
+
var element = this.props.element || this.props.children;
|
|
155
|
+
|
|
156
|
+
if (element && this.state.mounted) {
|
|
153
157
|
var appendTo = this.props.appendTo || PrimeReact__default['default'].appendTo || document.body;
|
|
154
|
-
return appendTo === 'self' ?
|
|
158
|
+
return appendTo === 'self' ? element : /*#__PURE__*/ReactDOM__default['default'].createPortal(element, appendTo);
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
return null;
|
package/portal/portal.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.portal=function(t,e,n,o){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=r(n),i=r(o);function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.portal=function(t,e,n,o){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=r(n),i=r(o);function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(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 l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(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}}),e&&l(t,e)}function p(t){return(p="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})(t)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(){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 b,h,v,w=function(t){a(s,t);var e,n,o,r,l,p=(e=s,n=m(),function(){var t,o=d(e);if(n){var r=d(this).constructor;t=Reflect.construct(o,arguments,r)}else t=o.apply(this,arguments);return y(this,t)});function s(t){var e;return c(this,s),(e=p.call(this,t)).state={mounted:t.visible},e}return o=s,(r=[{key:"hasDOM",value:function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"componentDidMount",value:function(){this.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 e=this.props.appendTo||i.default.appendTo||document.body;return"self"===e?t:u.default.createPortal(t,e)}return null}}])&&f(o.prototype,r),l&&f(o,l),s}(e.Component);return v={element:null,appendTo:null,visible:!1,onMounted:null,onUnmounted:null},(h="defaultProps")in(b=w)?Object.defineProperty(b,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):b[h]=v,t.Portal=w,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,ReactDOM,primereact.api);
|