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
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e);function r(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(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function a(e,t){return(a=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&&a(e,t)}function c(e){return(c="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,t){
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e);function r(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(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function a(e,t){return(a=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&&a(e,t)}function c(e){return(c="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,t){if(t&&("object"===c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return r(e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){var t=h();return function(){var n,i=d(e);if(t){var r=d(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return p(this,n)}}function h(){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 v=function(n){u(o,e.Component);var r=f(o);function o(e){var t;return s(this,o),(t=r.call(this,e)).state={activeItem:null},t}return l(o,[{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(e){return i.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(e){return e.items?i.default.createElement(o,{model:e.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:e===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(e,n){var r=this,s=this.state.activeItem===e,o=t.classNames("p-menuitem",{"p-menuitem-active":s,"p-disabled":e.disabled},e.className),l=t.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-fw pi-angle-right",u=e.icon&&i.default.createElement("span",{className:l}),c=e.label&&i.default.createElement("span",{className:"p-menuitem-text"},e.label),p=e.items&&i.default.createElement("span",{className:a}),d=this.renderSubmenu(e),m=i.default.createElement("a",{href:e.url||"#",className:"p-menuitem-link",target:e.target,onClick:function(t){return r.onItemClick(t,e,n)},"aria-disabled":e.disabled},u,c,p);e.template&&(m=t.ObjectUtils.getJSXElement(e.template,e,{onClick:function(t){return r.onItemClick(t,e,n)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:m,props:this.props,active:s}));return i.default.createElement("li",{key:e.label+"_"+n,className:o,style:e.style},m,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var e=t.classNames({"p-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),n={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},r=this.renderItems();return i.default.createElement("ul",{className:e,style:n},r)}}]),o}();m(v,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward:null});var b=function(n){u(a,e.Component);var o=f(a);function a(e){var t;return s(this,a),(t=o.call(this,e)).state={level:0,visible:!1},t.navigateBack=t.navigateBack.bind(r(t)),t.navigateForward=t.navigateForward.bind(r(t)),t.onEnter=t.onEnter.bind(r(t)),t.onEntered=t.onEntered.bind(r(t)),t.onExit=t.onExit.bind(r(t)),t.onExited=t.onExited.bind(r(t)),t.onPanelClick=t.onPanelClick.bind(r(t)),t.menuRef=i.default.createRef(),t}return l(a,[{key:"onPanelClick",value:function(e){this.props.popup&&t.OverlayService.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var e=this,n=t.classNames("p-slidemenu-backward",{"p-hidden":0===this.state.level});return i.default.createElement("div",{ref:function(t){return e.backward=t},className:n,onClick:this.navigateBack},i.default.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),i.default.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&t.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),t.DomHandler.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){t.ZIndexUtils.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(n){e.state.visible&&!t.DomHandler.isAndroid()&&e.hide(n)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new t.ConnectedOverlayScrollHandler(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),t.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var e=this,n=t.classNames("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),r=this.renderBackward();return i.default.createElement(t.CSSTransition,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},i.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:n,style:this.props.style,onClick:this.onPanelClick},i.default.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},i.default.createElement("div",{className:"p-slidemenu-content",ref:function(t){return e.slideMenuContent=t}},i.default.createElement(v,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),r)))}},{key:"render",value:function(){var e=this.renderElement();return this.props.popup?i.default.createElement(t.Portal,{element:e,appendTo:this.props.appendTo}):e}}]),a}();m(b,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),exports.SlideMenu=b,exports.SlideMenuSub=v;
|
|
@@ -74,6 +74,8 @@ function _typeof(obj) {
|
|
|
74
74
|
function _possibleConstructorReturn(self, call) {
|
|
75
75
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
76
76
|
return call;
|
|
77
|
+
} else if (call !== void 0) {
|
|
78
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
return _assertThisInitialized(self);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{Component as t}from"react";import{classNames as n,ObjectUtils as i,OverlayService as r,ZIndexUtils as
|
|
1
|
+
import e,{Component as t}from"react";import{classNames as n,ObjectUtils as i,OverlayService as r,ZIndexUtils as o,DomHandler as s,ConnectedOverlayScrollHandler as l,CSSTransition as a,Portal as u}from"primereact/core";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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function v(e){return(v="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 b(e,t){if(t&&("object"===v(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 y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=w();return function(){var n,i=y(e);if(t){var r=y(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return b(this,n)}}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}}var g=function(r){f(s,t);var o=E(s);function s(e){var t;return p(this,s),(t=o.call(this,e)).state={activeItem:null},t}return m(s,[{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(t){return e.createElement("li",{key:"separator_"+t,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(t){return t.items?e.createElement(s,{model:t.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:t===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(t,r){var o=this,s=this.state.activeItem===t,l=n("p-menuitem",{"p-menuitem-active":s,"p-disabled":t.disabled},t.className),a=n("p-menuitem-icon",t.icon),u="p-submenu-icon pi pi-fw pi-angle-right",c=t.icon&&e.createElement("span",{className:a}),p=t.label&&e.createElement("span",{className:"p-menuitem-text"},t.label),d=t.items&&e.createElement("span",{className:u}),m=this.renderSubmenu(t),h=e.createElement("a",{href:t.url||"#",className:"p-menuitem-link",target:t.target,onClick:function(e){return o.onItemClick(e,t,r)},"aria-disabled":t.disabled},c,p,d);t.template&&(h=i.getJSXElement(t.template,t,{onClick:function(e){return o.onItemClick(e,t,r)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:a,submenuIconClassName:u,element:h,props:this.props,active:s}));return e.createElement("li",{key:t.label+"_"+r,className:l,style:t.style},h,m)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var t=n({"p-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),i={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},r=this.renderItems();return e.createElement("ul",{className:t,style:i},r)}}]),s}();k(g,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward:null});var L=function(i){f(h,t);var d=E(h);function h(t){var n;return p(this,h),(n=d.call(this,t)).state={level:0,visible:!1},n.navigateBack=n.navigateBack.bind(c(n)),n.navigateForward=n.navigateForward.bind(c(n)),n.onEnter=n.onEnter.bind(c(n)),n.onEntered=n.onEntered.bind(c(n)),n.onExit=n.onExit.bind(c(n)),n.onExited=n.onExited.bind(c(n)),n.onPanelClick=n.onPanelClick.bind(c(n)),n.menuRef=e.createRef(),n}return m(h,[{key:"onPanelClick",value:function(e){this.props.popup&&r.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var t=this,i=n("p-slidemenu-backward",{"p-hidden":0===this.state.level});return e.createElement("div",{ref:function(e){return t.backward=e},className:i,onClick:this.navigateBack},e.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),e.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&o.set("menu",this.menuRef.current,this.props.baseZIndex),s.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){o.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!s.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new l(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),o.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var t=this,i=n("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),r=this.renderBackward();return e.createElement(a,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},e.createElement("div",{ref:this.menuRef,id:this.props.id,className:i,style:this.props.style,onClick:this.onPanelClick},e.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},e.createElement("div",{className:"p-slidemenu-content",ref:function(e){return t.slideMenuContent=e}},e.createElement(g,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),r)))}},{key:"render",value:function(){var t=this.renderElement();return this.props.popup?e.createElement(u,{element:t,appendTo:this.props.appendTo}):t}}]),h}();k(L,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null});export{L as SlideMenu,g as SlideMenuSub};
|
package/slidemenu/slidemenu.js
CHANGED
|
@@ -79,6 +79,8 @@ this.primereact.slidemenu = (function (exports, React, core) {
|
|
|
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);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.slidemenu=function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=i(t);function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(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 i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(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 p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?s(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){var t=v();return function(){var n,i=m(e);if(t){var r=m(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return d(this,n)}}function v(){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=function(e){c(i,e);var t=f(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={activeItem:null},n}return a(i,[{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(e){return r.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(e){return e.items?r.default.createElement(i,{model:e.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:e===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(e,t){var i=this,s=this.state.activeItem===e,o=n.classNames("p-menuitem",{"p-menuitem-active":s,"p-disabled":e.disabled},e.className),l=n.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-fw pi-angle-right",u=e.icon&&r.default.createElement("span",{className:l}),c=e.label&&r.default.createElement("span",{className:"p-menuitem-text"},e.label),p=e.items&&r.default.createElement("span",{className:a}),d=this.renderSubmenu(e),m=r.default.createElement("a",{href:e.url||"#",className:"p-menuitem-link",target:e.target,onClick:function(n){return i.onItemClick(n,e,t)},"aria-disabled":e.disabled},u,c,p);e.template&&(m=n.ObjectUtils.getJSXElement(e.template,e,{onClick:function(n){return i.onItemClick(n,e,t)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:m,props:this.props,active:s}));return r.default.createElement("li",{key:e.label+"_"+t,className:o,style:e.style},m,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var e=n.classNames({"p-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),t={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},i=this.renderItems();return r.default.createElement("ul",{className:e,style:t},i)}}]),i}(t.Component);h(b,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward:null});var y=function(e){c(i,e);var t=f(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={level:0,visible:!1},n.navigateBack=n.navigateBack.bind(s(n)),n.navigateForward=n.navigateForward.bind(s(n)),n.onEnter=n.onEnter.bind(s(n)),n.onEntered=n.onEntered.bind(s(n)),n.onExit=n.onExit.bind(s(n)),n.onExited=n.onExited.bind(s(n)),n.onPanelClick=n.onPanelClick.bind(s(n)),n.menuRef=r.default.createRef(),n}return a(i,[{key:"onPanelClick",value:function(e){this.props.popup&&n.OverlayService.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var e=this,t=n.classNames("p-slidemenu-backward",{"p-hidden":0===this.state.level});return r.default.createElement("div",{ref:function(t){return e.backward=t},className:t,onClick:this.navigateBack},r.default.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),r.default.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&n.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),n.DomHandler.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!n.DomHandler.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var e=this,t=n.classNames("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),i=this.renderBackward();return r.default.createElement(n.CSSTransition,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},r.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onPanelClick},r.default.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},r.default.createElement("div",{className:"p-slidemenu-content",ref:function(t){return e.slideMenuContent=t}},r.default.createElement(b,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),i)))}},{key:"render",value:function(){var e=this.renderElement();return this.props.popup?r.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo}):e}}]),i}(t.Component);return h(y,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),e.SlideMenu=y,e.SlideMenuSub=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.slidemenu=function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=i(t);function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(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 i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(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 p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){var t=v();return function(){var n,i=m(e);if(t){var r=m(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return d(this,n)}}function v(){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=function(e){c(i,e);var t=h(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={activeItem:null},n}return a(i,[{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(e){return r.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(e){return e.items?r.default.createElement(i,{model:e.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:e===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(e,t){var i=this,s=this.state.activeItem===e,o=n.classNames("p-menuitem",{"p-menuitem-active":s,"p-disabled":e.disabled},e.className),l=n.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-fw pi-angle-right",u=e.icon&&r.default.createElement("span",{className:l}),c=e.label&&r.default.createElement("span",{className:"p-menuitem-text"},e.label),p=e.items&&r.default.createElement("span",{className:a}),d=this.renderSubmenu(e),m=r.default.createElement("a",{href:e.url||"#",className:"p-menuitem-link",target:e.target,onClick:function(n){return i.onItemClick(n,e,t)},"aria-disabled":e.disabled},u,c,p);e.template&&(m=n.ObjectUtils.getJSXElement(e.template,e,{onClick:function(n){return i.onItemClick(n,e,t)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:m,props:this.props,active:s}));return r.default.createElement("li",{key:e.label+"_"+t,className:o,style:e.style},m,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var e=n.classNames({"p-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),t={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},i=this.renderItems();return r.default.createElement("ul",{className:e,style:t},i)}}]),i}(t.Component);f(b,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward:null});var y=function(e){c(i,e);var t=h(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={level:0,visible:!1},n.navigateBack=n.navigateBack.bind(s(n)),n.navigateForward=n.navigateForward.bind(s(n)),n.onEnter=n.onEnter.bind(s(n)),n.onEntered=n.onEntered.bind(s(n)),n.onExit=n.onExit.bind(s(n)),n.onExited=n.onExited.bind(s(n)),n.onPanelClick=n.onPanelClick.bind(s(n)),n.menuRef=r.default.createRef(),n}return a(i,[{key:"onPanelClick",value:function(e){this.props.popup&&n.OverlayService.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var e=this,t=n.classNames("p-slidemenu-backward",{"p-hidden":0===this.state.level});return r.default.createElement("div",{ref:function(t){return e.backward=t},className:t,onClick:this.navigateBack},r.default.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),r.default.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&n.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),n.DomHandler.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!n.DomHandler.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var e=this,t=n.classNames("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),i=this.renderBackward();return r.default.createElement(n.CSSTransition,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},r.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onPanelClick},r.default.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},r.default.createElement("div",{className:"p-slidemenu-content",ref:function(t){return e.slideMenuContent=t}},r.default.createElement(b,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),i)))}},{key:"render",value:function(){var e=this.renderElement();return this.props.popup?r.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo}):e}}]),i}(t.Component);return f(y,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),e.SlideMenu=y,e.SlideMenuSub=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);
|
package/slider/slider.cjs.js
CHANGED
|
@@ -117,6 +117,8 @@ function _typeof(obj) {
|
|
|
117
117
|
function _possibleConstructorReturn(self, call) {
|
|
118
118
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
119
119
|
return call;
|
|
120
|
+
} else if (call !== void 0) {
|
|
121
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
return _assertThisInitialized(self);
|
|
@@ -165,9 +167,14 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
_createClass(Slider, [{
|
|
170
|
+
key: "value",
|
|
171
|
+
get: function get() {
|
|
172
|
+
return this.props.range ? this.props.value || [0, 100] : this.props.value || 0;
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
168
175
|
key: "spin",
|
|
169
176
|
value: function spin(event, dir) {
|
|
170
|
-
var value =
|
|
177
|
+
var value = this.props.range ? this.value[this.handleIndex] : this.value;
|
|
171
178
|
var step = (this.props.step || 1) * dir;
|
|
172
179
|
this.updateValue(event, value + step);
|
|
173
180
|
event.preventDefault();
|
|
@@ -322,7 +329,7 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
322
329
|
var newValue = (this.props.max - this.props.min) * (handleValue / 100) + this.props.min;
|
|
323
330
|
|
|
324
331
|
if (this.props.step) {
|
|
325
|
-
var oldValue = this.props.range ? this.
|
|
332
|
+
var oldValue = this.props.range ? this.value[this.handleIndex] : this.value;
|
|
326
333
|
var diff = newValue - oldValue;
|
|
327
334
|
if (diff < 0) newValue = oldValue + Math.ceil(newValue / this.props.step - oldValue / this.props.step) * this.props.step;else if (diff > 0) newValue = oldValue + Math.floor(newValue / this.props.step - oldValue / this.props.step) * this.props.step;
|
|
328
335
|
} else {
|
|
@@ -338,12 +345,12 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
338
345
|
|
|
339
346
|
if (this.props.range) {
|
|
340
347
|
if (this.handleIndex === 0) {
|
|
341
|
-
if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.
|
|
348
|
+
if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.value[1]) newValue = this.value[1];
|
|
342
349
|
} else {
|
|
343
|
-
if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.
|
|
350
|
+
if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.value[0]) newValue = this.value[0];
|
|
344
351
|
}
|
|
345
352
|
|
|
346
|
-
var newValues = _toConsumableArray(this.
|
|
353
|
+
var newValues = _toConsumableArray(this.value);
|
|
347
354
|
|
|
348
355
|
newValues[this.handleIndex] = newValue;
|
|
349
356
|
|
|
@@ -407,7 +414,7 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
407
414
|
}, {
|
|
408
415
|
key: "renderRangeSlider",
|
|
409
416
|
value: function renderRangeSlider() {
|
|
410
|
-
var values = this.
|
|
417
|
+
var values = this.value;
|
|
411
418
|
var horizontal = this.props.orientation === 'horizontal';
|
|
412
419
|
var handleValueStart = (values[0] < this.props.min ? 0 : values[0] - this.props.min) * 100 / (this.props.max - this.props.min);
|
|
413
420
|
var handleValueEnd = (values[1] > this.props.max ? 100 : values[1] - this.props.min) * 100 / (this.props.max - this.props.min);
|
|
@@ -428,7 +435,7 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
428
435
|
}, {
|
|
429
436
|
key: "renderSingleSlider",
|
|
430
437
|
value: function renderSingleSlider() {
|
|
431
|
-
var value = this.
|
|
438
|
+
var value = this.value;
|
|
432
439
|
var handleValue;
|
|
433
440
|
if (value < this.props.min) handleValue = 0;else if (value > this.props.max) handleValue = 100;else handleValue = (value - this.props.min) * 100 / (this.props.max - this.props.min);
|
|
434
441
|
var rangeStyle = this.props.orientation === 'horizontal' ? {
|
package/slider/slider.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if(Array.isArray(e))return i(e)}function o(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}function l(){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 u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if(Array.isArray(e))return i(e)}function o(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}function l(){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 u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(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&&d(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 g(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 m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(){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 y,b,L,E=function(n){c(E,e.Component);var i,d,f,y,b,L=(i=E,d=v(),function(){var e,t=m(i);if(d){var n=m(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function E(e){var t;return u(this,E),(t=L.call(this,e)).onBarClick=t.onBarClick.bind(p(t)),t.onKeyDown=t.onKeyDown.bind(p(t)),t.handleIndex=0,t}return f=E,(y=[{key:"value",get:function(){return this.props.range?this.props.value||[0,100]:this.props.value||0}},{key:"spin",value:function(e,t){this.updateValue(e,(this.props.range?this.value[this.handleIndex]:this.value)+(this.props.step||1)*t),e.preventDefault()}},{key:"onDragStart",value:function(e,t){this.props.disabled||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.handleIndex=t)}},{key:"onMouseDown",value:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)}},{key:"onTouchStart",value:function(e,t){this.bindTouchListeners(),this.onDragStart(e,t)}},{key:"onKeyDown",value:function(e,t){if(!this.props.disabled){this.handleIndex=t;var n=e.key;"ArrowRight"===n||"ArrowUp"===n?this.spin(e,1):"ArrowLeft"!==n&&"ArrowDown"!==n||this.spin(e,-1)}}},{key:"onBarClick",value:function(e){this.props.disabled||(this.sliderHandleClick||(this.updateDomData(),this.setValue(e)),this.sliderHandleClick=!1)}},{key:"onDrag",value:function(e){this.dragging&&(this.setValue(e),e.preventDefault())}},{key:"onDragEnd",value:function(e){this.dragging&&(this.dragging=!1,this.props.onSlideEnd&&this.props.onSlideEnd({originalEvent:e,value:this.props.value}),this.unbindDragListeners(),this.unbindTouchListeners())}},{key:"bindDragListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))}},{key:"unbindDragListeners",value:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},{key:"bindTouchListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("touchmove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("touchend",this.dragEndListener))}},{key:"unbindTouchListeners",value:function(){this.dragListener&&(document.removeEventListener("touchmove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("touchend",this.dragEndListener),this.dragEndListener=null)}},{key:"updateDomData",value:function(){var e=this.el.getBoundingClientRect();this.initX=e.left+t.DomHandler.getWindowScrollLeft(),this.initY=e.top+t.DomHandler.getWindowScrollTop(),this.barWidth=this.el.offsetWidth,this.barHeight=this.el.offsetHeight}},{key:"setValue",value:function(e){var t=("horizontal"===this.props.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.props.max-this.props.min)+this.props.min;if(this.props.step){var n=this.props.range?this.value[this.handleIndex]:this.value,r=t-n;r<0?t=n+Math.ceil(t/this.props.step-n/this.props.step)*this.props.step:r>0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?r<this.props.min?r=this.props.min:r>this.value[1]&&(r=this.value[1]):r>this.props.max?r=this.props.max:r<this.value[0]&&(r=this.value[0]);var i=s(n=this.value)||o(n)||a(n)||l();i[this.handleIndex]=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})}else r<this.props.min?r=this.props.min:r>this.props.max&&(r=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:r})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(e,n,i){var s=this,o=t.classNames("p-slider-handle",{"p-slider-handle-start":0===i,"p-slider-handle-end":1===i,"p-slider-handle-active":this.handleIndex===i});return r.default.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,i)},onTouchStart:function(e){return s.onTouchStart(e,i)},onKeyDown:function(e){return s.onKeyDown(e,i)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==e&&e+"%",bottom:n&&n+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":e||n,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var e=this.value,t="horizontal"===this.props.orientation,n=100*(e[0]<this.props.min?0:e[0]-this.props.min)/(this.props.max-this.props.min),i=100*(e[1]>this.props.max?100:e[1]-this.props.min)/(this.props.max-this.props.min),s=t?this.renderHandle(n,null,0):this.renderHandle(null,n,0),o=t?this.renderHandle(i,null,1):this.renderHandle(null,i,1);return r.default.createElement(r.default.Fragment,null,r.default.createElement("span",{className:"p-slider-range",style:t?{left:n+"%",width:i-n+"%"}:{bottom:n+"%",height:i-n+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var e,t=this.value;e=t<this.props.min?0:t>this.props.max?100:100*(t-this.props.min)/(this.props.max-this.props.min);var n="horizontal"===this.props.orientation?{width:e+"%"}:{height:e+"%"},i="horizontal"===this.props.orientation?this.renderHandle(e,null,null):this.renderHandle(null,e,null);return r.default.createElement(r.default.Fragment,null,r.default.createElement("span",{className:"p-slider-range",style:n}),i)}},{key:"render",value:function(){var e=this,n=t.classNames("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),i=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return r.default.createElement("div",{id:this.props.id,ref:function(t){return e.el=t},style:this.props.style,className:n,onClick:this.onBarClick},i)}}])&&h(f.prototype,y),b&&h(f,b),E}();L={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(b="defaultProps")in(y=E)?Object.defineProperty(y,b,{value:L,enumerable:!0,configurable:!0,writable:!0}):y[b]=L,exports.Slider=E;
|
package/slider/slider.esm.js
CHANGED
|
@@ -109,6 +109,8 @@ function _typeof(obj) {
|
|
|
109
109
|
function _possibleConstructorReturn(self, call) {
|
|
110
110
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
111
111
|
return call;
|
|
112
|
+
} else if (call !== void 0) {
|
|
113
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
return _assertThisInitialized(self);
|
|
@@ -157,9 +159,14 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
_createClass(Slider, [{
|
|
162
|
+
key: "value",
|
|
163
|
+
get: function get() {
|
|
164
|
+
return this.props.range ? this.props.value || [0, 100] : this.props.value || 0;
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
160
167
|
key: "spin",
|
|
161
168
|
value: function spin(event, dir) {
|
|
162
|
-
var value =
|
|
169
|
+
var value = this.props.range ? this.value[this.handleIndex] : this.value;
|
|
163
170
|
var step = (this.props.step || 1) * dir;
|
|
164
171
|
this.updateValue(event, value + step);
|
|
165
172
|
event.preventDefault();
|
|
@@ -314,7 +321,7 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
314
321
|
var newValue = (this.props.max - this.props.min) * (handleValue / 100) + this.props.min;
|
|
315
322
|
|
|
316
323
|
if (this.props.step) {
|
|
317
|
-
var oldValue = this.props.range ? this.
|
|
324
|
+
var oldValue = this.props.range ? this.value[this.handleIndex] : this.value;
|
|
318
325
|
var diff = newValue - oldValue;
|
|
319
326
|
if (diff < 0) newValue = oldValue + Math.ceil(newValue / this.props.step - oldValue / this.props.step) * this.props.step;else if (diff > 0) newValue = oldValue + Math.floor(newValue / this.props.step - oldValue / this.props.step) * this.props.step;
|
|
320
327
|
} else {
|
|
@@ -330,12 +337,12 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
330
337
|
|
|
331
338
|
if (this.props.range) {
|
|
332
339
|
if (this.handleIndex === 0) {
|
|
333
|
-
if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.
|
|
340
|
+
if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.value[1]) newValue = this.value[1];
|
|
334
341
|
} else {
|
|
335
|
-
if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.
|
|
342
|
+
if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.value[0]) newValue = this.value[0];
|
|
336
343
|
}
|
|
337
344
|
|
|
338
|
-
var newValues = _toConsumableArray(this.
|
|
345
|
+
var newValues = _toConsumableArray(this.value);
|
|
339
346
|
|
|
340
347
|
newValues[this.handleIndex] = newValue;
|
|
341
348
|
|
|
@@ -399,7 +406,7 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
399
406
|
}, {
|
|
400
407
|
key: "renderRangeSlider",
|
|
401
408
|
value: function renderRangeSlider() {
|
|
402
|
-
var values = this.
|
|
409
|
+
var values = this.value;
|
|
403
410
|
var horizontal = this.props.orientation === 'horizontal';
|
|
404
411
|
var handleValueStart = (values[0] < this.props.min ? 0 : values[0] - this.props.min) * 100 / (this.props.max - this.props.min);
|
|
405
412
|
var handleValueEnd = (values[1] > this.props.max ? 100 : values[1] - this.props.min) * 100 / (this.props.max - this.props.min);
|
|
@@ -420,7 +427,7 @@ var Slider = /*#__PURE__*/function (_Component) {
|
|
|
420
427
|
}, {
|
|
421
428
|
key: "renderSingleSlider",
|
|
422
429
|
value: function renderSingleSlider() {
|
|
423
|
-
var value = this.
|
|
430
|
+
var value = this.value;
|
|
424
431
|
var handleValue;
|
|
425
432
|
if (value < this.props.min) handleValue = 0;else if (value > this.props.max) handleValue = 100;else handleValue = (value - this.props.min) * 100 / (this.props.max - this.props.min);
|
|
426
433
|
var rangeStyle = this.props.orientation === 'horizontal' ? {
|
package/slider/slider.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{Component as t}from"react";import{DomHandler as n,classNames as r}from"primereact/core";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if(Array.isArray(e))return i(e)}function o(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}function l(){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
|
|
1
|
+
import e,{Component as t}from"react";import{DomHandler as n,classNames as r}from"primereact/core";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if(Array.isArray(e))return i(e)}function o(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}function l(){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 u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(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&&d(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 g(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 m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(){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 y,b,L,E=function(i){c(w,t);var d,f,y,b,L,E=(d=w,f=v(),function(){var e,t=m(d);if(f){var n=m(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function w(e){var t;return u(this,w),(t=E.call(this,e)).onBarClick=t.onBarClick.bind(p(t)),t.onKeyDown=t.onKeyDown.bind(p(t)),t.handleIndex=0,t}return y=w,(b=[{key:"value",get:function(){return this.props.range?this.props.value||[0,100]:this.props.value||0}},{key:"spin",value:function(e,t){this.updateValue(e,(this.props.range?this.value[this.handleIndex]:this.value)+(this.props.step||1)*t),e.preventDefault()}},{key:"onDragStart",value:function(e,t){this.props.disabled||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.handleIndex=t)}},{key:"onMouseDown",value:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)}},{key:"onTouchStart",value:function(e,t){this.bindTouchListeners(),this.onDragStart(e,t)}},{key:"onKeyDown",value:function(e,t){if(!this.props.disabled){this.handleIndex=t;var n=e.key;"ArrowRight"===n||"ArrowUp"===n?this.spin(e,1):"ArrowLeft"!==n&&"ArrowDown"!==n||this.spin(e,-1)}}},{key:"onBarClick",value:function(e){this.props.disabled||(this.sliderHandleClick||(this.updateDomData(),this.setValue(e)),this.sliderHandleClick=!1)}},{key:"onDrag",value:function(e){this.dragging&&(this.setValue(e),e.preventDefault())}},{key:"onDragEnd",value:function(e){this.dragging&&(this.dragging=!1,this.props.onSlideEnd&&this.props.onSlideEnd({originalEvent:e,value:this.props.value}),this.unbindDragListeners(),this.unbindTouchListeners())}},{key:"bindDragListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))}},{key:"unbindDragListeners",value:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},{key:"bindTouchListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("touchmove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("touchend",this.dragEndListener))}},{key:"unbindTouchListeners",value:function(){this.dragListener&&(document.removeEventListener("touchmove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("touchend",this.dragEndListener),this.dragEndListener=null)}},{key:"updateDomData",value:function(){var e=this.el.getBoundingClientRect();this.initX=e.left+n.getWindowScrollLeft(),this.initY=e.top+n.getWindowScrollTop(),this.barWidth=this.el.offsetWidth,this.barHeight=this.el.offsetHeight}},{key:"setValue",value:function(e){var t=("horizontal"===this.props.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.props.max-this.props.min)+this.props.min;if(this.props.step){var n=this.props.range?this.value[this.handleIndex]:this.value,r=t-n;r<0?t=n+Math.ceil(t/this.props.step-n/this.props.step)*this.props.step:r>0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?r<this.props.min?r=this.props.min:r>this.value[1]&&(r=this.value[1]):r>this.props.max?r=this.props.max:r<this.value[0]&&(r=this.value[0]);var i=s(n=this.value)||o(n)||a(n)||l();i[this.handleIndex]=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})}else r<this.props.min?r=this.props.min:r>this.props.max&&(r=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:r})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(t,n,i){var s=this,o=r("p-slider-handle",{"p-slider-handle-start":0===i,"p-slider-handle-end":1===i,"p-slider-handle-active":this.handleIndex===i});return e.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,i)},onTouchStart:function(e){return s.onTouchStart(e,i)},onKeyDown:function(e){return s.onKeyDown(e,i)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==t&&t+"%",bottom:n&&n+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":t||n,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var t=this.value,n="horizontal"===this.props.orientation,r=100*(t[0]<this.props.min?0:t[0]-this.props.min)/(this.props.max-this.props.min),i=100*(t[1]>this.props.max?100:t[1]-this.props.min)/(this.props.max-this.props.min),s=n?this.renderHandle(r,null,0):this.renderHandle(null,r,0),o=n?this.renderHandle(i,null,1):this.renderHandle(null,i,1);return e.createElement(e.Fragment,null,e.createElement("span",{className:"p-slider-range",style:n?{left:r+"%",width:i-r+"%"}:{bottom:r+"%",height:i-r+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var t,n=this.value;t=n<this.props.min?0:n>this.props.max?100:100*(n-this.props.min)/(this.props.max-this.props.min);var r="horizontal"===this.props.orientation?{width:t+"%"}:{height:t+"%"},i="horizontal"===this.props.orientation?this.renderHandle(t,null,null):this.renderHandle(null,t,null);return e.createElement(e.Fragment,null,e.createElement("span",{className:"p-slider-range",style:r}),i)}},{key:"render",value:function(){var t=this,n=r("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),i=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return e.createElement("div",{id:this.props.id,ref:function(e){return t.el=e},style:this.props.style,className:n,onClick:this.onBarClick},i)}}])&&h(y.prototype,b),L&&h(y,L),w}();L={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(b="defaultProps")in(y=E)?Object.defineProperty(y,b,{value:L,enumerable:!0,configurable:!0,writable:!0}):y[b]=L;export{E as Slider};
|
package/slider/slider.js
CHANGED
|
@@ -114,6 +114,8 @@ this.primereact.slider = (function (exports, React, core) {
|
|
|
114
114
|
function _possibleConstructorReturn(self, call) {
|
|
115
115
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
116
116
|
return call;
|
|
117
|
+
} else if (call !== void 0) {
|
|
118
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
return _assertThisInitialized(self);
|
|
@@ -162,9 +164,14 @@ this.primereact.slider = (function (exports, React, core) {
|
|
|
162
164
|
}
|
|
163
165
|
|
|
164
166
|
_createClass(Slider, [{
|
|
167
|
+
key: "value",
|
|
168
|
+
get: function get() {
|
|
169
|
+
return this.props.range ? this.props.value || [0, 100] : this.props.value || 0;
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
165
172
|
key: "spin",
|
|
166
173
|
value: function spin(event, dir) {
|
|
167
|
-
var value =
|
|
174
|
+
var value = this.props.range ? this.value[this.handleIndex] : this.value;
|
|
168
175
|
var step = (this.props.step || 1) * dir;
|
|
169
176
|
this.updateValue(event, value + step);
|
|
170
177
|
event.preventDefault();
|
|
@@ -319,7 +326,7 @@ this.primereact.slider = (function (exports, React, core) {
|
|
|
319
326
|
var newValue = (this.props.max - this.props.min) * (handleValue / 100) + this.props.min;
|
|
320
327
|
|
|
321
328
|
if (this.props.step) {
|
|
322
|
-
var oldValue = this.props.range ? this.
|
|
329
|
+
var oldValue = this.props.range ? this.value[this.handleIndex] : this.value;
|
|
323
330
|
var diff = newValue - oldValue;
|
|
324
331
|
if (diff < 0) newValue = oldValue + Math.ceil(newValue / this.props.step - oldValue / this.props.step) * this.props.step;else if (diff > 0) newValue = oldValue + Math.floor(newValue / this.props.step - oldValue / this.props.step) * this.props.step;
|
|
325
332
|
} else {
|
|
@@ -335,12 +342,12 @@ this.primereact.slider = (function (exports, React, core) {
|
|
|
335
342
|
|
|
336
343
|
if (this.props.range) {
|
|
337
344
|
if (this.handleIndex === 0) {
|
|
338
|
-
if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.
|
|
345
|
+
if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.value[1]) newValue = this.value[1];
|
|
339
346
|
} else {
|
|
340
|
-
if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.
|
|
347
|
+
if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.value[0]) newValue = this.value[0];
|
|
341
348
|
}
|
|
342
349
|
|
|
343
|
-
var newValues = _toConsumableArray(this.
|
|
350
|
+
var newValues = _toConsumableArray(this.value);
|
|
344
351
|
|
|
345
352
|
newValues[this.handleIndex] = newValue;
|
|
346
353
|
|
|
@@ -404,7 +411,7 @@ this.primereact.slider = (function (exports, React, core) {
|
|
|
404
411
|
}, {
|
|
405
412
|
key: "renderRangeSlider",
|
|
406
413
|
value: function renderRangeSlider() {
|
|
407
|
-
var values = this.
|
|
414
|
+
var values = this.value;
|
|
408
415
|
var horizontal = this.props.orientation === 'horizontal';
|
|
409
416
|
var handleValueStart = (values[0] < this.props.min ? 0 : values[0] - this.props.min) * 100 / (this.props.max - this.props.min);
|
|
410
417
|
var handleValueEnd = (values[1] > this.props.max ? 100 : values[1] - this.props.min) * 100 / (this.props.max - this.props.min);
|
|
@@ -425,7 +432,7 @@ this.primereact.slider = (function (exports, React, core) {
|
|
|
425
432
|
}, {
|
|
426
433
|
key: "renderSingleSlider",
|
|
427
434
|
value: function renderSingleSlider() {
|
|
428
|
-
var value = this.
|
|
435
|
+
var value = this.value;
|
|
429
436
|
var handleValue;
|
|
430
437
|
if (value < this.props.min) handleValue = 0;else if (value > this.props.max) handleValue = 100;else handleValue = (value - this.props.min) * 100 / (this.props.max - this.props.min);
|
|
431
438
|
var rangeStyle = this.props.orientation === 'horizontal' ? {
|
package/slider/slider.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.slider=function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e){if(Array.isArray(e))return s(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function u(){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
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.slider=function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e){if(Array.isArray(e))return s(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function m(e){return(m="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 g(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(){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,L,E,D=function(e){f(L,e);var t,r,s,c,m,b=(t=L,r=y(),function(){var e,n=v(t);if(r){var i=v(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return g(this,e)});function L(e){var t;return h(this,L),(t=b.call(this,e)).onBarClick=t.onBarClick.bind(d(t)),t.onKeyDown=t.onKeyDown.bind(d(t)),t.handleIndex=0,t}return s=L,(c=[{key:"value",get:function(){return this.props.range?this.props.value||[0,100]:this.props.value||0}},{key:"spin",value:function(e,t){this.updateValue(e,(this.props.range?this.value[this.handleIndex]:this.value)+(this.props.step||1)*t),e.preventDefault()}},{key:"onDragStart",value:function(e,t){this.props.disabled||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.handleIndex=t)}},{key:"onMouseDown",value:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)}},{key:"onTouchStart",value:function(e,t){this.bindTouchListeners(),this.onDragStart(e,t)}},{key:"onKeyDown",value:function(e,t){if(!this.props.disabled){this.handleIndex=t;var n=e.key;"ArrowRight"===n||"ArrowUp"===n?this.spin(e,1):"ArrowLeft"!==n&&"ArrowDown"!==n||this.spin(e,-1)}}},{key:"onBarClick",value:function(e){this.props.disabled||(this.sliderHandleClick||(this.updateDomData(),this.setValue(e)),this.sliderHandleClick=!1)}},{key:"onDrag",value:function(e){this.dragging&&(this.setValue(e),e.preventDefault())}},{key:"onDragEnd",value:function(e){this.dragging&&(this.dragging=!1,this.props.onSlideEnd&&this.props.onSlideEnd({originalEvent:e,value:this.props.value}),this.unbindDragListeners(),this.unbindTouchListeners())}},{key:"bindDragListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))}},{key:"unbindDragListeners",value:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},{key:"bindTouchListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("touchmove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("touchend",this.dragEndListener))}},{key:"unbindTouchListeners",value:function(){this.dragListener&&(document.removeEventListener("touchmove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("touchend",this.dragEndListener),this.dragEndListener=null)}},{key:"updateDomData",value:function(){var e=this.el.getBoundingClientRect();this.initX=e.left+n.DomHandler.getWindowScrollLeft(),this.initY=e.top+n.DomHandler.getWindowScrollTop(),this.barWidth=this.el.offsetWidth,this.barHeight=this.el.offsetHeight}},{key:"setValue",value:function(e){var t=("horizontal"===this.props.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.props.max-this.props.min)+this.props.min;if(this.props.step){var n=this.props.range?this.value[this.handleIndex]:this.value,r=t-n;r<0?t=n+Math.ceil(t/this.props.step-n/this.props.step)*this.props.step:r>0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?r<this.props.min?r=this.props.min:r>this.value[1]&&(r=this.value[1]):r>this.props.max?r=this.props.max:r<this.value[0]&&(r=this.value[0]);var i=o(n=this.value)||a(n)||l(n)||u();i[this.handleIndex]=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})}else r<this.props.min?r=this.props.min:r>this.props.max&&(r=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:r})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(e,t,r){var s=this,o=n.classNames("p-slider-handle",{"p-slider-handle-start":0===r,"p-slider-handle-end":1===r,"p-slider-handle-active":this.handleIndex===r});return i.default.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,r)},onTouchStart:function(e){return s.onTouchStart(e,r)},onKeyDown:function(e){return s.onKeyDown(e,r)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==e&&e+"%",bottom:t&&t+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":e||t,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var e=this.value,t="horizontal"===this.props.orientation,n=100*(e[0]<this.props.min?0:e[0]-this.props.min)/(this.props.max-this.props.min),r=100*(e[1]>this.props.max?100:e[1]-this.props.min)/(this.props.max-this.props.min),s=t?this.renderHandle(n,null,0):this.renderHandle(null,n,0),o=t?this.renderHandle(r,null,1):this.renderHandle(null,r,1);return i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{className:"p-slider-range",style:t?{left:n+"%",width:r-n+"%"}:{bottom:n+"%",height:r-n+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var e,t=this.value;e=t<this.props.min?0:t>this.props.max?100:100*(t-this.props.min)/(this.props.max-this.props.min);var n="horizontal"===this.props.orientation?{width:e+"%"}:{height:e+"%"},r="horizontal"===this.props.orientation?this.renderHandle(e,null,null):this.renderHandle(null,e,null);return i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{className:"p-slider-range",style:n}),r)}},{key:"render",value:function(){var e=this,t=n.classNames("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),r=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return i.default.createElement("div",{id:this.props.id,ref:function(t){return e.el=t},style:this.props.style,className:t,onClick:this.onBarClick},r)}}])&&p(s.prototype,c),m&&p(s,m),L}(t.Component);return E={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(L="defaultProps")in(b=D)?Object.defineProperty(b,L,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[L]=E,e.Slider=D,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);
|
|
@@ -83,6 +83,8 @@ function _typeof(obj) {
|
|
|
83
83
|
function _possibleConstructorReturn(self, call) {
|
|
84
84
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
85
85
|
return call;
|
|
86
|
+
} else if (call !== void 0) {
|
|
87
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
return _assertThisInitialized(self);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/button"),i=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(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&&a(e,t)}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/button"),i=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(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&&a(e,t)}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function m(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?h(Object(i),!0).forEach((function(t){d(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function y(){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=function(n){c(C,e.Component);var a,u,h,b,v,k=(a=C,u=y(),function(){var e,t=f(a);if(u){var i=f(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return p(this,e)});function C(e){var t;return s(this,C),(t=k.call(this,e)).state={visible:!1},t.onClick=t.onClick.bind(l(t)),t.onItemClick=t.onItemClick.bind(l(t)),t}return h=C,(b=[{key:"isVisible",value:function(){return this.props.onVisibleChange?this.props.visible:this.state.visible}},{key:"show",value:function(){this.props.onVisibleChange?this.props.onVisibleChange(!0):this.setState({visible:!0}),this.props.onShow&&this.props.onShow()}},{key:"hide",value:function(){this.props.onVisibleChange?this.props.onVisibleChange(!1):this.setState({visible:!1}),this.props.onHide&&this.props.onHide()}},{key:"onClick",value:function(e){this.isVisible()?this.hide():this.show(),this.props.onClick&&this.props.onClick(e),this.isItemClicked=!0}},{key:"onItemClick",value:function(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isVisible()&&e.isOutsideClicked(t)&&e.hide(),e.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)}},{key:"calculateTransitionDelay",value:function(e){var t=this.props.model.length;return(this.isVisible()?e:t-e-1)*this.props.transitionDelay}},{key:"calculatePointStyle",value:function(e){var t=this.props.type;if("linear"!==t){var i=this.props.model.length,n=this.props.radius||20*i;if("circle"===t){var r=2*Math.PI/i;return{left:"calc(".concat(n*Math.cos(r*e),"px + var(--item-diff-x, 0px))"),top:"calc(".concat(n*Math.sin(r*e),"px + var(--item-diff-y, 0px))")}}if("semi-circle"===t){var s=this.props.direction,o=Math.PI/(i-1),l="calc(".concat(n*Math.cos(o*e),"px + var(--item-diff-x, 0px))"),a="calc(".concat(n*Math.sin(o*e),"px + var(--item-diff-y, 0px))");if("up"===s)return{left:l,bottom:a};if("down"===s)return{left:l,top:a};if("left"===s)return{right:a,top:l};if("right"===s)return{left:a,top:l}}else if("quarter-circle"===t){var c=this.props.direction,u=Math.PI/(2*(i-1)),p="calc(".concat(n*Math.cos(u*e),"px + var(--item-diff-x, 0px))"),f="calc(".concat(n*Math.sin(u*e),"px + var(--item-diff-y, 0px))");if("up-left"===c)return{right:p,bottom:f};if("up-right"===c)return{left:p,bottom:f};if("down-left"===c)return{right:f,top:p};if("down-right"===c)return{left:f,top:p}}}return{}}},{key:"getItemStyle",value:function(e){var t=this.calculateTransitionDelay(e),i=this.calculatePointStyle(e);return m({transitionDelay:"".concat(t,"ms")},i)}},{key:"componentDidMount",value:function(){if("linear"!==this.props.type){var e=i.DomHandler.findSingle(this.container,".p-speeddial-button"),t=i.DomHandler.findSingle(this.list,".p-speeddial-item");if(e&&t){var n=Math.abs(e.offsetWidth-t.offsetWidth),r=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x","".concat(n/2,"px")),this.list.style.setProperty("--item-diff-y","".concat(r/2,"px"))}}this.props.hideOnClickOutside&&this.bindDocumentClickListener()}},{key:"componentWillUnmount",value:function(){this.props.hideOnClickOutside&&this.unbindDocumentClickListener()}},{key:"renderItem",value:function(e,t){var n=this,s=this.getItemStyle(t),o=e.icon,l=e.label,a=e.template,c=e.url,u=e.target,p=i.classNames("p-speeddial-action",{"p-disabled":e.disabled}),f=i.classNames("p-speeddial-action-icon",o),d=r.default.createElement("a",{href:c||"#",role:"menuitem",className:p,target:u,"data-pr-tooltip":l,onClick:function(t){return n.onItemClick(t,e)}},o&&r.default.createElement("span",{className:f}),r.default.createElement(i.Ripple,null));if(a){var h={onClick:function(t){return n.onItemClick(t,e)},className:p,iconClassName:f,element:d,props:this.props,visible:this.isVisible()};d=i.ObjectUtils.getJSXElement(a,e,h)}return r.default.createElement("li",{key:t,className:"p-speeddial-item",style:s,role:"none"},d)}},{key:"renderItems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,i){return e.renderItem(t,i)})):null}},{key:"renderList",value:function(){var e=this,t=this.renderItems();return r.default.createElement("ul",{ref:function(t){return e.list=t},className:"p-speeddial-list",role:"menu"},t)}},{key:"renderButton",value:function(){var e,n=this,s=this.isVisible(),o=i.classNames("p-speeddial-button p-button-rounded",{"p-speeddial-rotate":this.props.rotateAnimation&&!this.props.hideIcon},this.props.buttonClassName),l=i.classNames((d(e={},"".concat(this.props.showIcon),!s&&!!this.props.showIcon||!this.props.hideIcon),d(e,"".concat(this.props.hideIcon),s&&!!this.props.hideIcon),e)),a=r.default.createElement(t.Button,{type:"button",style:this.props.buttonStyle,className:o,icon:l,onClick:this.onClick,disabled:this.props.disabled});return this.props.buttonTemplate?i.ObjectUtils.getJSXElement(this.props.buttonTemplate,{onClick:function(e){return n.onClick(e)},className:o,iconClassName:l,element:a,props:this.props,visible:s}):a}},{key:"renderMask",value:function(){if(this.props.mask){var e=this.isVisible(),t=i.classNames("p-speeddial-mask",{"p-speeddial-mask-visible":e},this.props.maskClassName);return r.default.createElement("div",{className:t,style:this.props.maskStyle})}return null}},{key:"render",value:function(){var e,t=this,n=i.classNames("p-speeddial p-component p-speeddial-".concat(this.props.type),(d(e={},"p-speeddial-direction-".concat(this.props.direction),"circle"!==this.props.type),d(e,"p-speeddial-opened",this.isVisible()),d(e,"p-disabled",this.props.disabled),e),this.props.className),s=this.renderButton(),o=this.renderList(),l=this.renderMask();return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{ref:function(e){return t.container=e},id:this.props.id,className:n,style:this.props.style},s,o),l)}}])&&o(h.prototype,b),v&&o(h,v),C}();d(b,"defaultProps",{id:null,model:null,visible:!1,style:null,className:null,direction:"up",transitionDelay:30,type:"linear",radius:0,mask:!1,disabled:!1,hideOnClickOutside:!0,buttonStyle:null,buttonClassName:null,buttonTemplate:null,maskStyle:null,maskClassName:null,showIcon:"pi pi-plus",hideIcon:null,rotateAnimation:!0,onVisibleChange:null,onClick:null,onShow:null,onHide:null}),exports.SpeedDial=b;
|