primereact 7.0.1 → 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +1 -1
- package/accordion/accordion.cjs.js +27 -21
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +5 -2
- package/accordion/accordion.esm.js +27 -21
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +27 -21
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +29 -6
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +31 -30
- package/api/api.esm.js +29 -6
- package/api/api.esm.min.js +1 -1
- package/api/api.js +29 -6
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +22 -22
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +9 -4
- package/autocomplete/autocomplete.esm.js +22 -22
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +22 -22
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +11 -11
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +1 -1
- package/avatar/avatar.esm.js +11 -11
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +11 -11
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +11 -11
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +11 -11
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +11 -11
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +11 -11
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +11 -11
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +11 -11
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +23 -16
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +23 -16
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +23 -16
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +11 -11
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +11 -11
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +11 -11
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +13 -13
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +1 -1
- package/button/button.esm.js +13 -13
- package/button/button.esm.min.js +1 -1
- package/button/button.js +13 -13
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +39 -20
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +3 -2
- package/calendar/calendar.esm.js +39 -20
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +39 -20
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +11 -11
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.js +11 -11
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +11 -11
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +11 -11
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +11 -11
- package/card/card.esm.min.js +1 -1
- package/card/card.js +11 -11
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +235 -27
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +234 -27
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +236 -29
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +15 -15
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +15 -15
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +15 -15
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +13 -13
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +13 -13
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +13 -13
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +13 -13
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +1 -1
- package/checkbox/checkbox.esm.js +13 -13
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +13 -13
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +11 -11
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +1 -1
- package/chip/chip.esm.js +11 -11
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +11 -11
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +13 -13
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +13 -13
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +13 -13
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +16 -16
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +19 -5
- package/colorpicker/colorpicker.esm.js +16 -16
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +16 -16
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.js +31 -12
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +5 -1
- package/column/column.esm.js +31 -12
- package/column/column.esm.min.js +1 -1
- package/column/column.js +31 -12
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.js +28 -12
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.js +28 -12
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +28 -12
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +13 -13
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +1 -1
- package/confirmdialog/confirmdialog.esm.js +13 -13
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +13 -13
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +16 -16
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +3 -2
- package/confirmpopup/confirmpopup.esm.js +16 -16
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +16 -16
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +14 -14
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +14 -14
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +14 -14
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +521 -323
- package/core/core.min.js +18 -18
- package/csstransition/csstransition.cjs.js +62 -32
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.d.ts +8 -0
- package/csstransition/csstransition.esm.js +61 -32
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +62 -34
- package/csstransition/csstransition.min.js +1 -1
- package/csstransition/package.json +2 -1
- package/datascroller/datascroller.cjs.js +11 -11
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +11 -11
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +11 -11
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +518 -346
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +34 -11
- package/datatable/datatable.esm.js +520 -348
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +518 -346
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +12 -16
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +12 -16
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +12 -16
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +11 -11
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +11 -11
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +11 -11
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +20 -22
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +2 -1
- package/dialog/dialog.esm.js +20 -22
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +20 -22
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +11 -11
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +11 -11
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +11 -11
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +11 -11
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +11 -11
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +11 -11
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +36 -26
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +36 -26
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +36 -26
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +21 -17
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +21 -17
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +21 -17
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +14 -14
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fieldset/fieldset.esm.js +14 -14
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +14 -14
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +16 -13
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +3 -1
- package/fileupload/fileupload.esm.js +16 -13
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +16 -13
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +11 -11
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +11 -11
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +11 -11
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +228 -22
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +228 -22
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +229 -23
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +12 -12
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.js +12 -12
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +12 -12
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +39 -18
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +1 -0
- package/image/image.esm.js +40 -19
- package/image/image.esm.min.js +1 -1
- package/image/image.js +39 -18
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +11 -11
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +11 -11
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +11 -11
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +15 -15
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +15 -15
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +15 -15
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +47 -35
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +47 -35
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +47 -35
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +13 -13
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +13 -13
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +13 -13
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +13 -13
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +13 -13
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +13 -13
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +13 -13
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.esm.js +13 -13
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +13 -13
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +4 -1
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +4 -1
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +4 -1
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +12 -12
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +12 -12
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +12 -12
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -14
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +14 -14
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +14 -14
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +11 -11
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +11 -11
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +11 -11
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +17 -17
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -1
- package/mention/mention.esm.js +17 -17
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +17 -17
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +13 -13
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +2 -1
- package/menu/menu.esm.js +13 -13
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +13 -13
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +11 -11
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +11 -11
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +11 -11
- package/menubar/menubar.min.css +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +11 -11
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +11 -11
- package/message/message.esm.min.js +1 -1
- package/message/message.js +11 -11
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +11 -11
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +2 -1
- package/messages/messages.esm.js +11 -11
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +11 -11
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +23 -23
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +3 -2
- package/multiselect/multiselect.esm.js +23 -23
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +23 -23
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +13 -13
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +13 -13
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +13 -13
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +11 -11
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +11 -11
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +11 -11
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +11 -11
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +11 -11
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +11 -11
- package/organizationchart/organizationchart.min.css +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +15 -19
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +2 -1
- package/overlaypanel/overlaypanel.esm.js +15 -19
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +15 -19
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +3 -2
- package/paginator/paginator.cjs.js +13 -13
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +13 -13
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +13 -13
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +17 -16
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +18 -17
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +17 -16
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +13 -13
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/panelmenu/panelmenu.esm.js +13 -13
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +13 -13
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +15 -15
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +2 -1
- package/password/password.esm.js +15 -15
- package/password/password.esm.min.js +1 -1
- package/password/password.js +15 -15
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +11 -11
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +11 -11
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +11 -11
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +15 -18
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +15 -18
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +16 -20
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +1531 -1073
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1531 -1073
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1531 -1073
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +11 -11
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +11 -11
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +11 -11
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +11 -11
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +11 -11
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +11 -11
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +13 -13
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +13 -13
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +13 -13
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +13 -13
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +13 -13
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +13 -13
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +129 -99
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +314 -26
- package/resources/themes/arya-green/theme.css +314 -26
- package/resources/themes/arya-orange/theme.css +314 -26
- package/resources/themes/arya-purple/theme.css +314 -26
- package/resources/themes/bootstrap4-dark-blue/theme.css +291 -10
- package/resources/themes/bootstrap4-dark-purple/theme.css +291 -10
- package/resources/themes/bootstrap4-light-blue/theme.css +288 -7
- package/resources/themes/bootstrap4-light-purple/theme.css +288 -7
- package/resources/themes/fluent-light/theme.css +312 -24
- package/resources/themes/lara-dark-blue/theme.css +665 -412
- package/resources/themes/lara-dark-indigo/theme.css +665 -412
- package/resources/themes/lara-dark-purple/theme.css +665 -412
- package/resources/themes/lara-dark-teal/theme.css +665 -412
- package/resources/themes/lara-light-blue/theme.css +319 -66
- package/resources/themes/lara-light-indigo/theme.css +319 -66
- package/resources/themes/lara-light-purple/theme.css +319 -66
- package/resources/themes/lara-light-teal/theme.css +319 -66
- package/resources/themes/luna-amber/theme.css +305 -24
- package/resources/themes/luna-blue/theme.css +305 -24
- package/resources/themes/luna-green/theme.css +305 -24
- package/resources/themes/luna-pink/theme.css +305 -24
- package/resources/themes/md-dark-deeppurple/theme.css +370 -8
- package/resources/themes/md-dark-indigo/theme.css +370 -8
- package/resources/themes/md-light-deeppurple/theme.css +368 -6
- package/resources/themes/md-light-indigo/theme.css +368 -6
- package/resources/themes/mdc-dark-deeppurple/theme.css +370 -8
- package/resources/themes/mdc-dark-indigo/theme.css +370 -8
- package/resources/themes/mdc-light-deeppurple/theme.css +368 -6
- package/resources/themes/mdc-light-indigo/theme.css +368 -6
- package/resources/themes/nova/theme.css +305 -24
- package/resources/themes/nova-accent/theme.css +305 -24
- package/resources/themes/nova-alt/theme.css +305 -24
- package/resources/themes/rhea/theme.css +305 -24
- package/resources/themes/saga-blue/theme.css +295 -7
- package/resources/themes/saga-green/theme.css +295 -7
- package/resources/themes/saga-orange/theme.css +295 -7
- package/resources/themes/saga-purple/theme.css +295 -7
- package/resources/themes/tailwind-light/theme.css +315 -27
- package/resources/themes/vela-blue/theme.css +314 -26
- package/resources/themes/vela-green/theme.css +314 -26
- package/resources/themes/vela-orange/theme.css +314 -26
- package/resources/themes/vela-purple/theme.css +314 -26
- package/ripple/ripple.cjs.js +11 -11
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +11 -11
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +11 -11
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +11 -11
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.js +11 -11
- package/row/row.esm.min.js +1 -1
- package/row/row.js +11 -11
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +11 -11
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +11 -11
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +11 -11
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +12 -12
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +3 -2
- package/scrolltop/scrolltop.esm.js +12 -12
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +12 -12
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +14 -14
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +14 -14
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +14 -14
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +1 -1
- package/sidebar/sidebar.cjs.js +14 -13
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +2 -1
- package/sidebar/sidebar.esm.js +14 -13
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +14 -13
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +11 -11
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +11 -11
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +11 -11
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +13 -13
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +13 -13
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +13 -13
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +11 -11
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +11 -11
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +11 -11
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +13 -13
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +1 -1
- package/speeddial/speeddial.esm.js +13 -13
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +13 -13
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +22 -18
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +9 -3
- package/splitbutton/splitbutton.esm.js +22 -18
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +22 -18
- package/splitbutton/splitbutton.min.css +1 -1
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +12 -12
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +12 -12
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +12 -12
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +11 -11
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +11 -11
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +11 -11
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +11 -11
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +11 -11
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +11 -11
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +12 -12
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +12 -12
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +12 -12
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +57 -33
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +8 -0
- package/tabview/tabview.esm.js +57 -33
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +57 -33
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +11 -11
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +1 -1
- package/tag/tag.esm.js +11 -11
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +11 -11
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +11 -11
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +11 -11
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +11 -11
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +13 -13
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +13 -13
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +13 -13
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +11 -11
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +11 -11
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +11 -11
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +26 -15
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +5 -1
- package/toast/toast.esm.js +26 -15
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +27 -17
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +13 -13
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +1 -1
- package/togglebutton/togglebutton.esm.js +13 -13
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +13 -13
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +11 -11
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +11 -11
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +11 -11
- package/toolbar/toolbar.min.css +1 -1
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +45 -19
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +45 -19
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +45 -19
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +2 -0
- package/tree/tree.cjs.js +19 -18
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +8 -4
- package/tree/tree.esm.js +19 -18
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +19 -18
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +2 -1
- package/treeselect/treeselect.cjs.js +20 -20
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +2 -1
- package/treeselect/treeselect.esm.js +20 -20
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +20 -20
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +101 -40
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +2 -1
- package/treetable/treetable.esm.js +97 -37
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +101 -40
- package/treetable/treetable.min.css +1 -1
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +13 -13
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +13 -13
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +13 -13
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +98 -23
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +3 -0
- package/utils/utils.esm.js +98 -23
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +98 -23
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +62 -36
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +62 -36
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +62 -36
- package/virtualscroller/virtualscroller.min.css +1 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +59 -10
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/util.d.ts +0 -1
|
@@ -25,6 +25,9 @@ function _defineProperties(target, props) {
|
|
|
25
25
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
26
26
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
27
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
29
|
+
writable: false
|
|
30
|
+
});
|
|
28
31
|
return Constructor;
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -57,23 +60,20 @@ function _inherits(subClass, superClass) {
|
|
|
57
60
|
configurable: true
|
|
58
61
|
}
|
|
59
62
|
});
|
|
63
|
+
Object.defineProperty(subClass, "prototype", {
|
|
64
|
+
writable: false
|
|
65
|
+
});
|
|
60
66
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
function _typeof(obj) {
|
|
64
70
|
"@babel/helpers - typeof";
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
_typeof = function _typeof(obj) {
|
|
72
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return _typeof(obj);
|
|
72
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
73
|
+
return typeof obj;
|
|
74
|
+
} : function (obj) {
|
|
75
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
76
|
+
}, _typeof(obj);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -108,7 +108,7 @@ function _defineProperty(obj, key, value) {
|
|
|
108
108
|
return obj;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it
|
|
111
|
+
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
112
112
|
|
|
113
113
|
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
|
114
114
|
|
|
@@ -442,7 +442,7 @@ _defineProperty(CascadeSelectSub, "defaultProps", {
|
|
|
442
442
|
onOptionGroupSelect: null
|
|
443
443
|
});
|
|
444
444
|
|
|
445
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it
|
|
445
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
446
446
|
|
|
447
447
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
448
448
|
|
|
@@ -764,7 +764,7 @@ var CascadeSelect = /*#__PURE__*/function (_Component) {
|
|
|
764
764
|
|
|
765
765
|
if (!this.resizeListener) {
|
|
766
766
|
this.resizeListener = function () {
|
|
767
|
-
if (_this5.state.overlayVisible && !DomHandler.
|
|
767
|
+
if (_this5.state.overlayVisible && !DomHandler.isTouchDevice()) {
|
|
768
768
|
_this5.hide();
|
|
769
769
|
}
|
|
770
770
|
};
|
|
@@ -882,7 +882,7 @@ var CascadeSelect = /*#__PURE__*/function (_Component) {
|
|
|
882
882
|
var overlay = /*#__PURE__*/React.createElement(CSSTransition, {
|
|
883
883
|
nodeRef: this.overlayRef,
|
|
884
884
|
classNames: "p-connected-overlay",
|
|
885
|
-
in: this.state.overlayVisible,
|
|
885
|
+
"in": this.state.overlayVisible,
|
|
886
886
|
timeout: {
|
|
887
887
|
enter: 120,
|
|
888
888
|
exit: 100
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{Component as t,createRef as n}from"react";import{DomHandler as i,ObjectUtils as o,classNames as r,ZIndexUtils as l,ConnectedOverlayScrollHandler as s}from"primereact/utils";import{CSSTransition as a}from"primereact/csstransition";import{Ripple as p}from"primereact/ripple";import{OverlayService as u}from"primereact/overlayservice";import{Portal as c}from"primereact/portal";import h from"primereact/api";function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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 v(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function m(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&&b(e,t)}function O(e){return O="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},O(e)}function k(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function S(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,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=w(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,r=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw r}}}}function w(e,t){if(e){if("string"==typeof e)return L(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)?L(e,t):void 0}}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function C(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var G=function(n){m(u,t);var l,s,a=(l=u,s=C(),function(){var e,t=g(l);if(s){var n=g(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return k(this,e)});function u(e){var t;return d(this,u),(t=a.call(this,e)).state={activeOption:null},t.onOptionSelect=t.onOptionSelect.bind(y(t)),t.onOptionGroupSelect=t.onOptionGroupSelect.bind(y(t)),t}return v(u,[{key:"componentDidMount",value:function(){if(this.props.selectionPath&&this.props.options&&!this.props.dirty){var e,t=E(this.props.options);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(this.props.selectionPath.includes(n)){this.setState({activeOption:n});break}}}catch(e){t.e(e)}finally{t.f()}}this.props.root||this.position()}},{key:"componentDidUpdate",value:function(e){e.parentActive!==this.props.parentActive&&this.setState({activeOption:null})}},{key:"position",value:function(){var e=this.element.parentElement,t=i.getOffset(e),n=i.getViewport(),o=this.element.offsetParent?this.element.offsetWidth:i.getHiddenElementOuterWidth(this.element),r=i.getOuterWidth(e.children[0]);parseInt(t.left,10)+r+o>n.width-i.calculateScrollbarWidth()&&(this.element.style.left="-100%")}},{key:"onOptionSelect",value:function(e){this.props.onOptionSelect&&this.props.onOptionSelect(e)}},{key:"onKeyDown",value:function(e,t){var n=e.currentTarget.parentElement;switch(e.key){case"Down":case"ArrowDown":var i=this.findNextItem(n);i&&i.children[0].focus();break;case"Up":case"ArrowUp":var o=this.findPrevItem(n);o&&o.children[0].focus();break;case"Right":case"ArrowRight":this.isOptionGroup(t)&&(this.state.activeOption===t?n.children[1].children[0].children[0].focus():this.setState({activeOption:t}));break;case"Left":case"ArrowLeft":this.setState({activeOption:null});var r=e.currentTarget.parentElement.parentElement.previousElementSibling;r&&r.focus();break;case"Enter":this.onOptionClick(e,t);break;case"Tab":case"Escape":this.props.onPanelHide&&(this.props.onPanelHide(),e.preventDefault())}e.preventDefault()}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?i.hasClass(t,"p-disabled")||!i.hasClass(t,"p-cascadeselect-item")?this.findNextItem(t):t:null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?i.hasClass(t,"p-disabled")||!i.hasClass(t,"p-cascadeselect-item")?this.findPrevItem(t):t:null}},{key:"onOptionClick",value:function(e,t){this.isOptionGroup(t)?(this.setState({activeOption:this.state.activeOption===t?null:t}),this.props.onOptionGroupSelect&&this.props.onOptionGroupSelect({originalEvent:e,value:t})):this.props.onOptionSelect&&this.props.onOptionSelect({originalEvent:e,value:this.getOptionValue(t)})}},{key:"onOptionGroupSelect",value:function(e){this.props.onOptionGroupSelect&&this.props.onOptionGroupSelect(e)}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?o.resolveFieldData(e,this.props.optionLabel):e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?o.resolveFieldData(e,this.props.optionValue):e}},{key:"getOptionGroupLabel",value:function(e){return this.props.optionGroupLabel?o.resolveFieldData(e,this.props.optionGroupLabel):null}},{key:"getOptionGroupChildren",value:function(e){return o.resolveFieldData(e,this.props.optionGroupChildren[this.props.level])}},{key:"isOptionGroup",value:function(e){return Object.prototype.hasOwnProperty.call(e,this.props.optionGroupChildren[this.props.level])}},{key:"getOptionLabelToRender",value:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)}},{key:"renderSubmenu",value:function(t){return this.isOptionGroup(t)&&this.state.activeOption===t?e.createElement(u,{options:this.getOptionGroupChildren(t),className:"p-cascadeselect-sublist",selectionPath:this.props.selectionPath,optionLabel:this.props.optionLabel,optionValue:this.props.optionValue,level:this.props.level+1,onOptionSelect:this.onOptionSelect,onOptionGroupSelect:this.onOptionGroupSelect,parentActive:this.state.activeOption===t,optionGroupLabel:this.props.optionGroupLabel,optionGroupChildren:this.props.optionGroupChildren,dirty:this.props.dirty,template:this.props.template,onPanelHide:this.props.onPanelHide}):null}},{key:"renderOption",value:function(t,n){var i=this,l=r("p-cascadeselect-item",{"p-cascadeselect-item-group":this.isOptionGroup(t),"p-cascadeselect-item-active p-highlight":this.state.activeOption===t},t.className),s=this.renderSubmenu(t),a=this.props.template?o.getJSXElement(this.props.template,this.getOptionValue(t)):e.createElement("span",{className:"p-cascadeselect-item-text"},this.getOptionLabelToRender(t)),u=this.isOptionGroup(t)&&e.createElement("span",{className:"p-cascadeselect-group-icon pi pi-angle-right"});return e.createElement("li",{key:this.getOptionLabelToRender(t)+"_"+n,className:l,style:t.style,role:"none"},e.createElement("div",{className:"p-cascadeselect-item-content",onClick:function(e){return i.onOptionClick(e,t)},tabIndex:0,onKeyDown:function(e){return i.onKeyDown(e,t)}},a,u,e.createElement(p,null)),s)}},{key:"renderMenu",value:function(){var e=this;return this.props.options?this.props.options.map((function(t,n){return e.renderOption(t,n)})):null}},{key:"render",value:function(){var t=this,n=r("p-cascadeselect-panel p-cascadeselect-items",this.props.className),i=this.renderMenu();return e.createElement("ul",{ref:function(e){return t.element=e},className:n,role:"listbox","aria-orientation":"horizontal"},i)}}]),u}();function R(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=I(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,r=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw r}}}}function I(e,t){if(e){if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function x(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}S(G,"defaultProps",{options:null,selectionPath:!1,className:null,optionLabel:null,optionValue:null,level:null,optionGroupLabel:null,optionGroupChildren:null,parentActive:null,dirty:null,root:null,template:null,onOptionSelect:null,onOptionGroupSelect:null});var V=function(p){m(S,t);var f,b,O=(f=S,b=x(),function(){var e,t=g(f);if(b){var n=g(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return k(this,e)});function S(e){var t;return d(this,S),(t=O.call(this,e)).state={focused:!1,overlayVisible:!1},t.dirty=!1,t.selectionPath=null,t.overlayRef=n(),t.inputRef=n(t.props.inputRef),t.hide=t.hide.bind(y(t)),t.onClick=t.onClick.bind(y(t)),t.onInputFocus=t.onInputFocus.bind(y(t)),t.onInputBlur=t.onInputBlur.bind(y(t)),t.onInputKeyDown=t.onInputKeyDown.bind(y(t)),t.onOverlayEnter=t.onOverlayEnter.bind(y(t)),t.onOverlayEntered=t.onOverlayEntered.bind(y(t)),t.onOverlayExit=t.onOverlayExit.bind(y(t)),t.onOverlayExited=t.onOverlayExited.bind(y(t)),t.onOptionSelect=t.onOptionSelect.bind(y(t)),t.onOptionGroupSelect=t.onOptionGroupSelect.bind(y(t)),t.onPanelClick=t.onPanelClick.bind(y(t)),t}return v(S,[{key:"onOptionSelect",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e,value:e.value}),this.updateSelectionPath(),this.hide(),this.inputRef.current.focus()}},{key:"onOptionGroupSelect",value:function(e){this.dirty=!0,this.props.onGroupChange&&this.props.onGroupChange(e)}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?o.resolveFieldData(e,this.props.optionLabel):e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?o.resolveFieldData(e,this.props.optionValue):e}},{key:"getOptionGroupChildren",value:function(e,t){return o.resolveFieldData(e,this.props.optionGroupChildren[t])}},{key:"isOptionGroup",value:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.props.optionGroupChildren[t])}},{key:"updateSelectionPath",value:function(){var e;if(null!=this.props.value&&this.props.options){var t,n=R(this.props.options);try{for(n.s();!(t=n.n()).done;){if(e=this.findModelOptionInGroup(t.value,0))break}}catch(e){n.e(e)}finally{n.f()}}this.selectionPath=e}},{key:"findModelOptionInGroup",value:function(e,t){if(this.isOptionGroup(e,t)){var n,i,r=R(this.getOptionGroupChildren(e,t));try{for(r.s();!(i=r.n()).done;){if(n=this.findModelOptionInGroup(i.value,t+1))return n.unshift(e),n}}catch(e){r.e(e)}finally{r.f()}}else if(o.equals(this.props.value,this.getOptionValue(e),this.props.dataKey))return[e];return null}},{key:"onClick",value:function(e){if(!this.props.disabled){var t=this.overlayRef?this.overlayRef.current:null;t&&t.contains(e.target)||(this.inputRef.current.focus(),this.state.overlayVisible?this.hide():this.show())}}},{key:"onInputFocus",value:function(){this.setState({focused:!0})}},{key:"onInputBlur",value:function(){this.setState({focused:!1})}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:this.state.overlayVisible?i.findSingle(this.overlayRef.current,".p-cascadeselect-item").children[0].focus():e.altKey&&this.props.options&&this.props.options.length&&this.show(),e.preventDefault();break;case 32:this.state.overlayVisible?this.hide():this.show(),e.preventDefault();break;case 9:this.hide()}}},{key:"onPanelClick",value:function(e){u.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"show",value:function(){this.props.onBeforeShow&&this.props.onBeforeShow(),this.setState({overlayVisible:!0})}},{key:"hide",value:function(){var e=this;this.props.onBeforeHide&&this.props.onBeforeHide(),this.setState({overlayVisible:!1},(function(){e.inputRef.current.focus()}))}},{key:"onOverlayEnter",value:function(){l.set("overlay",this.overlayRef.current,h.autoZIndex,h.zIndex.overlay),this.alignOverlay()}},{key:"onOverlayEntered",value:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.dirty=!1}},{key:"onOverlayExited",value:function(){l.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){i.alignOverlay(this.overlayRef.current,this.label.parentElement,this.props.appendTo||h.appendTo)}},{key:"bindOutsideClickListener",value:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))}},{key:"unbindOutsideClickListener",value:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new s(this.container,(function(){e.state.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.overlayVisible&&!i.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.overlayRef&&this.overlayRef.current.contains(e.target))}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.updateSelectionPath()}},{key:"componentWillUnmount",value:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),l.clear(this.overlayRef.current)}},{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.updateSelectionPath()}},{key:"renderKeyboardHelper",value:function(){var t=this.props.value?this.getOptionLabel(this.props.value):null;return e.createElement("div",{className:"p-hidden-accessible"},e.createElement("input",{ref:this.inputRef,type:"text",id:this.props.inputId,name:this.props.name,defaultValue:t,readOnly:!0,disabled:this.props.disabled,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onKeyDown:this.onInputKeyDown,tabIndex:this.props.tabIndex,"aria-haspopup":"listbox","aria-labelledby":this.props.ariaLabelledBy}))}},{key:"renderLabel",value:function(){var t=this,n=this.props.value?this.getOptionLabel(this.props.value):this.props.placeholder||"p-emptylabel",i=r("p-cascadeselect-label ",{"p-placeholder":n===this.props.placeholder,"p-cascadeselect-label-empty":!this.props.value&&"p-emptylabel"===n});return e.createElement("span",{ref:function(e){return t.label=e},className:i},n)}},{key:"renderDropdownIcon",value:function(){var t=r("p-cascadeselect-trigger-icon",this.props.dropdownIcon);return e.createElement("div",{className:"p-cascadeselect-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":this.state.overlayVisible},e.createElement("span",{className:t}))}},{key:"renderOverlay",value:function(){return e.createElement(c,{element:e.createElement(a,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.overlayVisible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onOverlayEnter,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited},e.createElement("div",{ref:this.overlayRef,className:"p-cascadeselect-panel p-component",onClick:this.onPanelClick},e.createElement("div",{className:"p-cascadeselect-items-wrapper"},e.createElement(G,{options:this.props.options,selectionPath:this.selectionPath,className:"p-cascadeselect-items",optionLabel:this.props.optionLabel,optionValue:this.props.optionValue,level:0,optionGroupLabel:this.props.optionGroupLabel,optionGroupChildren:this.props.optionGroupChildren,onOptionSelect:this.onOptionSelect,onOptionGroupSelect:this.onOptionGroupSelect,root:!0,template:this.props.itemTemplate,onPanelHide:this.hide})))),appendTo:this.props.appendTo})}},{key:"renderElement",value:function(){var t=this,n=r("p-cascadeselect p-component p-inputwrapper",this.props.className,{"p-disabled":this.props.disabled,"p-focus":this.state.focused,"p-inputwrapper-filled":this.props.value,"p-inputwrapper-focus":this.state.focused||this.state.overlayVisible}),i=this.renderKeyboardHelper(),o=this.renderLabel(),l=this.renderDropdownIcon(),s=this.renderOverlay();return e.createElement("div",{id:this.props.id,ref:function(e){return t.container=e},className:n,style:this.props.style,onClick:this.onClick},i,o,l,s)}},{key:"render",value:function(){return this.renderElement()}}]),S}();S(V,"defaultProps",{id:null,inputRef:null,style:null,className:null,value:null,name:null,options:null,optionLabel:null,optionValue:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:null,itemTemplate:null,disabled:!1,dataKey:null,inputId:null,tabIndex:null,ariaLabelledBy:null,appendTo:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",onChange:null,onGroupChange:null,onBeforeShow:null,onBeforeHide:null,onShow:null,onHide:null});export{V as CascadeSelect};
|
|
1
|
+
import e,{Component as t,createRef as n}from"react";import{DomHandler as i,ObjectUtils as o,classNames as r,ZIndexUtils as l,ConnectedOverlayScrollHandler as s}from"primereact/utils";import{CSSTransition as a}from"primereact/csstransition";import{Ripple as p}from"primereact/ripple";import{OverlayService as u}from"primereact/overlayservice";import{Portal as c}from"primereact/portal";import h from"primereact/api";function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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 v(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function O(e){return O="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},O(e)}function k(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=E(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,r=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw r}}}}function E(e,t){if(e){if("string"==typeof e)return L(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)?L(e,t):void 0}}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function C(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var G=function(n){m(u,t);var l,s,a=(l=u,s=C(),function(){var e,t=g(l);if(s){var n=g(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return k(this,e)});function u(e){var t;return d(this,u),(t=a.call(this,e)).state={activeOption:null},t.onOptionSelect=t.onOptionSelect.bind(y(t)),t.onOptionGroupSelect=t.onOptionGroupSelect.bind(y(t)),t}return v(u,[{key:"componentDidMount",value:function(){if(this.props.selectionPath&&this.props.options&&!this.props.dirty){var e,t=w(this.props.options);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(this.props.selectionPath.includes(n)){this.setState({activeOption:n});break}}}catch(e){t.e(e)}finally{t.f()}}this.props.root||this.position()}},{key:"componentDidUpdate",value:function(e){e.parentActive!==this.props.parentActive&&this.setState({activeOption:null})}},{key:"position",value:function(){var e=this.element.parentElement,t=i.getOffset(e),n=i.getViewport(),o=this.element.offsetParent?this.element.offsetWidth:i.getHiddenElementOuterWidth(this.element),r=i.getOuterWidth(e.children[0]);parseInt(t.left,10)+r+o>n.width-i.calculateScrollbarWidth()&&(this.element.style.left="-100%")}},{key:"onOptionSelect",value:function(e){this.props.onOptionSelect&&this.props.onOptionSelect(e)}},{key:"onKeyDown",value:function(e,t){var n=e.currentTarget.parentElement;switch(e.key){case"Down":case"ArrowDown":var i=this.findNextItem(n);i&&i.children[0].focus();break;case"Up":case"ArrowUp":var o=this.findPrevItem(n);o&&o.children[0].focus();break;case"Right":case"ArrowRight":this.isOptionGroup(t)&&(this.state.activeOption===t?n.children[1].children[0].children[0].focus():this.setState({activeOption:t}));break;case"Left":case"ArrowLeft":this.setState({activeOption:null});var r=e.currentTarget.parentElement.parentElement.previousElementSibling;r&&r.focus();break;case"Enter":this.onOptionClick(e,t);break;case"Tab":case"Escape":this.props.onPanelHide&&(this.props.onPanelHide(),e.preventDefault())}e.preventDefault()}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?i.hasClass(t,"p-disabled")||!i.hasClass(t,"p-cascadeselect-item")?this.findNextItem(t):t:null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?i.hasClass(t,"p-disabled")||!i.hasClass(t,"p-cascadeselect-item")?this.findPrevItem(t):t:null}},{key:"onOptionClick",value:function(e,t){this.isOptionGroup(t)?(this.setState({activeOption:this.state.activeOption===t?null:t}),this.props.onOptionGroupSelect&&this.props.onOptionGroupSelect({originalEvent:e,value:t})):this.props.onOptionSelect&&this.props.onOptionSelect({originalEvent:e,value:this.getOptionValue(t)})}},{key:"onOptionGroupSelect",value:function(e){this.props.onOptionGroupSelect&&this.props.onOptionGroupSelect(e)}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?o.resolveFieldData(e,this.props.optionLabel):e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?o.resolveFieldData(e,this.props.optionValue):e}},{key:"getOptionGroupLabel",value:function(e){return this.props.optionGroupLabel?o.resolveFieldData(e,this.props.optionGroupLabel):null}},{key:"getOptionGroupChildren",value:function(e){return o.resolveFieldData(e,this.props.optionGroupChildren[this.props.level])}},{key:"isOptionGroup",value:function(e){return Object.prototype.hasOwnProperty.call(e,this.props.optionGroupChildren[this.props.level])}},{key:"getOptionLabelToRender",value:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)}},{key:"renderSubmenu",value:function(t){return this.isOptionGroup(t)&&this.state.activeOption===t?e.createElement(u,{options:this.getOptionGroupChildren(t),className:"p-cascadeselect-sublist",selectionPath:this.props.selectionPath,optionLabel:this.props.optionLabel,optionValue:this.props.optionValue,level:this.props.level+1,onOptionSelect:this.onOptionSelect,onOptionGroupSelect:this.onOptionGroupSelect,parentActive:this.state.activeOption===t,optionGroupLabel:this.props.optionGroupLabel,optionGroupChildren:this.props.optionGroupChildren,dirty:this.props.dirty,template:this.props.template,onPanelHide:this.props.onPanelHide}):null}},{key:"renderOption",value:function(t,n){var i=this,l=r("p-cascadeselect-item",{"p-cascadeselect-item-group":this.isOptionGroup(t),"p-cascadeselect-item-active p-highlight":this.state.activeOption===t},t.className),s=this.renderSubmenu(t),a=this.props.template?o.getJSXElement(this.props.template,this.getOptionValue(t)):e.createElement("span",{className:"p-cascadeselect-item-text"},this.getOptionLabelToRender(t)),u=this.isOptionGroup(t)&&e.createElement("span",{className:"p-cascadeselect-group-icon pi pi-angle-right"});return e.createElement("li",{key:this.getOptionLabelToRender(t)+"_"+n,className:l,style:t.style,role:"none"},e.createElement("div",{className:"p-cascadeselect-item-content",onClick:function(e){return i.onOptionClick(e,t)},tabIndex:0,onKeyDown:function(e){return i.onKeyDown(e,t)}},a,u,e.createElement(p,null)),s)}},{key:"renderMenu",value:function(){var e=this;return this.props.options?this.props.options.map((function(t,n){return e.renderOption(t,n)})):null}},{key:"render",value:function(){var t=this,n=r("p-cascadeselect-panel p-cascadeselect-items",this.props.className),i=this.renderMenu();return e.createElement("ul",{ref:function(e){return t.element=e},className:n,role:"listbox","aria-orientation":"horizontal"},i)}}]),u}();function R(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=I(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,r=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw r}}}}function I(e,t){if(e){if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function x(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}S(G,"defaultProps",{options:null,selectionPath:!1,className:null,optionLabel:null,optionValue:null,level:null,optionGroupLabel:null,optionGroupChildren:null,parentActive:null,dirty:null,root:null,template:null,onOptionSelect:null,onOptionGroupSelect:null});var D=function(p){m(S,t);var f,b,O=(f=S,b=x(),function(){var e,t=g(f);if(b){var n=g(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return k(this,e)});function S(e){var t;return d(this,S),(t=O.call(this,e)).state={focused:!1,overlayVisible:!1},t.dirty=!1,t.selectionPath=null,t.overlayRef=n(),t.inputRef=n(t.props.inputRef),t.hide=t.hide.bind(y(t)),t.onClick=t.onClick.bind(y(t)),t.onInputFocus=t.onInputFocus.bind(y(t)),t.onInputBlur=t.onInputBlur.bind(y(t)),t.onInputKeyDown=t.onInputKeyDown.bind(y(t)),t.onOverlayEnter=t.onOverlayEnter.bind(y(t)),t.onOverlayEntered=t.onOverlayEntered.bind(y(t)),t.onOverlayExit=t.onOverlayExit.bind(y(t)),t.onOverlayExited=t.onOverlayExited.bind(y(t)),t.onOptionSelect=t.onOptionSelect.bind(y(t)),t.onOptionGroupSelect=t.onOptionGroupSelect.bind(y(t)),t.onPanelClick=t.onPanelClick.bind(y(t)),t}return v(S,[{key:"onOptionSelect",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e,value:e.value}),this.updateSelectionPath(),this.hide(),this.inputRef.current.focus()}},{key:"onOptionGroupSelect",value:function(e){this.dirty=!0,this.props.onGroupChange&&this.props.onGroupChange(e)}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?o.resolveFieldData(e,this.props.optionLabel):e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?o.resolveFieldData(e,this.props.optionValue):e}},{key:"getOptionGroupChildren",value:function(e,t){return o.resolveFieldData(e,this.props.optionGroupChildren[t])}},{key:"isOptionGroup",value:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.props.optionGroupChildren[t])}},{key:"updateSelectionPath",value:function(){var e;if(null!=this.props.value&&this.props.options){var t,n=R(this.props.options);try{for(n.s();!(t=n.n()).done;){if(e=this.findModelOptionInGroup(t.value,0))break}}catch(e){n.e(e)}finally{n.f()}}this.selectionPath=e}},{key:"findModelOptionInGroup",value:function(e,t){if(this.isOptionGroup(e,t)){var n,i,r=R(this.getOptionGroupChildren(e,t));try{for(r.s();!(i=r.n()).done;){if(n=this.findModelOptionInGroup(i.value,t+1))return n.unshift(e),n}}catch(e){r.e(e)}finally{r.f()}}else if(o.equals(this.props.value,this.getOptionValue(e),this.props.dataKey))return[e];return null}},{key:"onClick",value:function(e){if(!this.props.disabled){var t=this.overlayRef?this.overlayRef.current:null;t&&t.contains(e.target)||(this.inputRef.current.focus(),this.state.overlayVisible?this.hide():this.show())}}},{key:"onInputFocus",value:function(){this.setState({focused:!0})}},{key:"onInputBlur",value:function(){this.setState({focused:!1})}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:this.state.overlayVisible?i.findSingle(this.overlayRef.current,".p-cascadeselect-item").children[0].focus():e.altKey&&this.props.options&&this.props.options.length&&this.show(),e.preventDefault();break;case 32:this.state.overlayVisible?this.hide():this.show(),e.preventDefault();break;case 9:this.hide()}}},{key:"onPanelClick",value:function(e){u.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"show",value:function(){this.props.onBeforeShow&&this.props.onBeforeShow(),this.setState({overlayVisible:!0})}},{key:"hide",value:function(){var e=this;this.props.onBeforeHide&&this.props.onBeforeHide(),this.setState({overlayVisible:!1},(function(){e.inputRef.current.focus()}))}},{key:"onOverlayEnter",value:function(){l.set("overlay",this.overlayRef.current,h.autoZIndex,h.zIndex.overlay),this.alignOverlay()}},{key:"onOverlayEntered",value:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.dirty=!1}},{key:"onOverlayExited",value:function(){l.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){i.alignOverlay(this.overlayRef.current,this.label.parentElement,this.props.appendTo||h.appendTo)}},{key:"bindOutsideClickListener",value:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))}},{key:"unbindOutsideClickListener",value:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new s(this.container,(function(){e.state.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.overlayVisible&&!i.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.overlayRef&&this.overlayRef.current.contains(e.target))}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.updateSelectionPath()}},{key:"componentWillUnmount",value:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),l.clear(this.overlayRef.current)}},{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.updateSelectionPath()}},{key:"renderKeyboardHelper",value:function(){var t=this.props.value?this.getOptionLabel(this.props.value):null;return e.createElement("div",{className:"p-hidden-accessible"},e.createElement("input",{ref:this.inputRef,type:"text",id:this.props.inputId,name:this.props.name,defaultValue:t,readOnly:!0,disabled:this.props.disabled,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onKeyDown:this.onInputKeyDown,tabIndex:this.props.tabIndex,"aria-haspopup":"listbox","aria-labelledby":this.props.ariaLabelledBy}))}},{key:"renderLabel",value:function(){var t=this,n=this.props.value?this.getOptionLabel(this.props.value):this.props.placeholder||"p-emptylabel",i=r("p-cascadeselect-label ",{"p-placeholder":n===this.props.placeholder,"p-cascadeselect-label-empty":!this.props.value&&"p-emptylabel"===n});return e.createElement("span",{ref:function(e){return t.label=e},className:i},n)}},{key:"renderDropdownIcon",value:function(){var t=r("p-cascadeselect-trigger-icon",this.props.dropdownIcon);return e.createElement("div",{className:"p-cascadeselect-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":this.state.overlayVisible},e.createElement("span",{className:t}))}},{key:"renderOverlay",value:function(){return e.createElement(c,{element:e.createElement(a,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.overlayVisible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onOverlayEnter,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited},e.createElement("div",{ref:this.overlayRef,className:"p-cascadeselect-panel p-component",onClick:this.onPanelClick},e.createElement("div",{className:"p-cascadeselect-items-wrapper"},e.createElement(G,{options:this.props.options,selectionPath:this.selectionPath,className:"p-cascadeselect-items",optionLabel:this.props.optionLabel,optionValue:this.props.optionValue,level:0,optionGroupLabel:this.props.optionGroupLabel,optionGroupChildren:this.props.optionGroupChildren,onOptionSelect:this.onOptionSelect,onOptionGroupSelect:this.onOptionGroupSelect,root:!0,template:this.props.itemTemplate,onPanelHide:this.hide})))),appendTo:this.props.appendTo})}},{key:"renderElement",value:function(){var t=this,n=r("p-cascadeselect p-component p-inputwrapper",this.props.className,{"p-disabled":this.props.disabled,"p-focus":this.state.focused,"p-inputwrapper-filled":this.props.value,"p-inputwrapper-focus":this.state.focused||this.state.overlayVisible}),i=this.renderKeyboardHelper(),o=this.renderLabel(),l=this.renderDropdownIcon(),s=this.renderOverlay();return e.createElement("div",{id:this.props.id,ref:function(e){return t.container=e},className:n,style:this.props.style,onClick:this.onClick},i,o,l,s)}},{key:"render",value:function(){return this.renderElement()}}]),S}();S(D,"defaultProps",{id:null,inputRef:null,style:null,className:null,value:null,name:null,options:null,optionLabel:null,optionValue:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:null,itemTemplate:null,disabled:!1,dataKey:null,inputId:null,tabIndex:null,ariaLabelledBy:null,appendTo:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",onChange:null,onGroupChange:null,onBeforeShow:null,onBeforeHide:null,onShow:null,onHide:null});export{D as CascadeSelect};
|
|
@@ -26,6 +26,9 @@ this.primereact.cascadeselect = (function (exports, React, utils, csstransition,
|
|
|
26
26
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
27
27
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
28
28
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
29
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
30
|
+
writable: false
|
|
31
|
+
});
|
|
29
32
|
return Constructor;
|
|
30
33
|
}
|
|
31
34
|
|
|
@@ -58,23 +61,20 @@ this.primereact.cascadeselect = (function (exports, React, utils, csstransition,
|
|
|
58
61
|
configurable: true
|
|
59
62
|
}
|
|
60
63
|
});
|
|
64
|
+
Object.defineProperty(subClass, "prototype", {
|
|
65
|
+
writable: false
|
|
66
|
+
});
|
|
61
67
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
function _typeof(obj) {
|
|
65
71
|
"@babel/helpers - typeof";
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
_typeof = function _typeof(obj) {
|
|
73
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return _typeof(obj);
|
|
73
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
74
|
+
return typeof obj;
|
|
75
|
+
} : function (obj) {
|
|
76
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
77
|
+
}, _typeof(obj);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function _possibleConstructorReturn(self, call) {
|
|
@@ -109,7 +109,7 @@ this.primereact.cascadeselect = (function (exports, React, utils, csstransition,
|
|
|
109
109
|
return obj;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it
|
|
112
|
+
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
113
113
|
|
|
114
114
|
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
|
115
115
|
|
|
@@ -443,7 +443,7 @@ this.primereact.cascadeselect = (function (exports, React, utils, csstransition,
|
|
|
443
443
|
onOptionGroupSelect: null
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it
|
|
446
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
447
447
|
|
|
448
448
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
449
449
|
|
|
@@ -765,7 +765,7 @@ this.primereact.cascadeselect = (function (exports, React, utils, csstransition,
|
|
|
765
765
|
|
|
766
766
|
if (!this.resizeListener) {
|
|
767
767
|
this.resizeListener = function () {
|
|
768
|
-
if (_this5.state.overlayVisible && !utils.DomHandler.
|
|
768
|
+
if (_this5.state.overlayVisible && !utils.DomHandler.isTouchDevice()) {
|
|
769
769
|
_this5.hide();
|
|
770
770
|
}
|
|
771
771
|
};
|
|
@@ -883,7 +883,7 @@ this.primereact.cascadeselect = (function (exports, React, utils, csstransition,
|
|
|
883
883
|
var overlay = /*#__PURE__*/React__default["default"].createElement(csstransition.CSSTransition, {
|
|
884
884
|
nodeRef: this.overlayRef,
|
|
885
885
|
classNames: "p-connected-overlay",
|
|
886
|
-
in: this.state.overlayVisible,
|
|
886
|
+
"in": this.state.overlayVisible,
|
|
887
887
|
timeout: {
|
|
888
888
|
enter: 120,
|
|
889
889
|
exit: 100
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.cascadeselect=function(e,t,n,i,o,r,l,s){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=a(t),u=a(s);function c(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 i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function y(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&&v(e,t)}function b(e){return b="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},b(e)}function m(e,t){if(t&&("object"===b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},O(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 S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,r=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw r}}}}function g(e,t){if(e){if("string"==typeof e)return E(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)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}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 L=function(e){y(l,e);var t,i,r=(t=l,i=w(),function(){var e,n=O(t);if(i){var o=O(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return m(this,e)});function l(e){var t;return c(this,l),(t=r.call(this,e)).state={activeOption:null},t.onOptionSelect=t.onOptionSelect.bind(f(t)),t.onOptionGroupSelect=t.onOptionGroupSelect.bind(f(t)),t}return d(l,[{key:"componentDidMount",value:function(){if(this.props.selectionPath&&this.props.options&&!this.props.dirty){var e,t=S(this.props.options);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(this.props.selectionPath.includes(n)){this.setState({activeOption:n});break}}}catch(e){t.e(e)}finally{t.f()}}this.props.root||this.position()}},{key:"componentDidUpdate",value:function(e){e.parentActive!==this.props.parentActive&&this.setState({activeOption:null})}},{key:"position",value:function(){var e=this.element.parentElement,t=n.DomHandler.getOffset(e),i=n.DomHandler.getViewport(),o=this.element.offsetParent?this.element.offsetWidth:n.DomHandler.getHiddenElementOuterWidth(this.element),r=n.DomHandler.getOuterWidth(e.children[0]);parseInt(t.left,10)+r+o>i.width-n.DomHandler.calculateScrollbarWidth()&&(this.element.style.left="-100%")}},{key:"onOptionSelect",value:function(e){this.props.onOptionSelect&&this.props.onOptionSelect(e)}},{key:"onKeyDown",value:function(e,t){var n=e.currentTarget.parentElement;switch(e.key){case"Down":case"ArrowDown":var i=this.findNextItem(n);i&&i.children[0].focus();break;case"Up":case"ArrowUp":var o=this.findPrevItem(n);o&&o.children[0].focus();break;case"Right":case"ArrowRight":this.isOptionGroup(t)&&(this.state.activeOption===t?n.children[1].children[0].children[0].focus():this.setState({activeOption:t}));break;case"Left":case"ArrowLeft":this.setState({activeOption:null});var r=e.currentTarget.parentElement.parentElement.previousElementSibling;r&&r.focus();break;case"Enter":this.onOptionClick(e,t);break;case"Tab":case"Escape":this.props.onPanelHide&&(this.props.onPanelHide(),e.preventDefault())}e.preventDefault()}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?n.DomHandler.hasClass(t,"p-disabled")||!n.DomHandler.hasClass(t,"p-cascadeselect-item")?this.findNextItem(t):t:null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?n.DomHandler.hasClass(t,"p-disabled")||!n.DomHandler.hasClass(t,"p-cascadeselect-item")?this.findPrevItem(t):t:null}},{key:"onOptionClick",value:function(e,t){this.isOptionGroup(t)?(this.setState({activeOption:this.state.activeOption===t?null:t}),this.props.onOptionGroupSelect&&this.props.onOptionGroupSelect({originalEvent:e,value:t})):this.props.onOptionSelect&&this.props.onOptionSelect({originalEvent:e,value:this.getOptionValue(t)})}},{key:"onOptionGroupSelect",value:function(e){this.props.onOptionGroupSelect&&this.props.onOptionGroupSelect(e)}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?n.ObjectUtils.resolveFieldData(e,this.props.optionLabel):e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?n.ObjectUtils.resolveFieldData(e,this.props.optionValue):e}},{key:"getOptionGroupLabel",value:function(e){return this.props.optionGroupLabel?n.ObjectUtils.resolveFieldData(e,this.props.optionGroupLabel):null}},{key:"getOptionGroupChildren",value:function(e){return n.ObjectUtils.resolveFieldData(e,this.props.optionGroupChildren[this.props.level])}},{key:"isOptionGroup",value:function(e){return Object.prototype.hasOwnProperty.call(e,this.props.optionGroupChildren[this.props.level])}},{key:"getOptionLabelToRender",value:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)}},{key:"renderSubmenu",value:function(e){return this.isOptionGroup(e)&&this.state.activeOption===e?p.default.createElement(l,{options:this.getOptionGroupChildren(e),className:"p-cascadeselect-sublist",selectionPath:this.props.selectionPath,optionLabel:this.props.optionLabel,optionValue:this.props.optionValue,level:this.props.level+1,onOptionSelect:this.onOptionSelect,onOptionGroupSelect:this.onOptionGroupSelect,parentActive:this.state.activeOption===e,optionGroupLabel:this.props.optionGroupLabel,optionGroupChildren:this.props.optionGroupChildren,dirty:this.props.dirty,template:this.props.template,onPanelHide:this.props.onPanelHide}):null}},{key:"renderOption",value:function(e,t){var i=this,r=n.classNames("p-cascadeselect-item",{"p-cascadeselect-item-group":this.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":this.state.activeOption===e},e.className),l=this.renderSubmenu(e),s=this.props.template?n.ObjectUtils.getJSXElement(this.props.template,this.getOptionValue(e)):p.default.createElement("span",{className:"p-cascadeselect-item-text"},this.getOptionLabelToRender(e)),a=this.isOptionGroup(e)&&p.default.createElement("span",{className:"p-cascadeselect-group-icon pi pi-angle-right"});return p.default.createElement("li",{key:this.getOptionLabelToRender(e)+"_"+t,className:r,style:e.style,role:"none"},p.default.createElement("div",{className:"p-cascadeselect-item-content",onClick:function(t){return i.onOptionClick(t,e)},tabIndex:0,onKeyDown:function(t){return i.onKeyDown(t,e)}},s,a,p.default.createElement(o.Ripple,null)),l)}},{key:"renderMenu",value:function(){var e=this;return this.props.options?this.props.options.map((function(t,n){return e.renderOption(t,n)})):null}},{key:"render",value:function(){var e=this,t=n.classNames("p-cascadeselect-panel p-cascadeselect-items",this.props.className),i=this.renderMenu();return p.default.createElement("ul",{ref:function(t){return e.element=t},className:t,role:"listbox","aria-orientation":"horizontal"},i)}}]),l}(t.Component);function C(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=G(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,r=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw r}}}}function G(e,t){if(e){if("string"==typeof e)return R(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)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function I(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}k(L,"defaultProps",{options:null,selectionPath:!1,className:null,optionLabel:null,optionValue:null,level:null,optionGroupLabel:null,optionGroupChildren:null,parentActive:null,dirty:null,root:null,template:null,onOptionSelect:null,onOptionGroupSelect:null});var D=function(e){y(h,e);var o,s,a=(o=h,s=I(),function(){var e,t=O(o);if(s){var n=O(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function h(e){var n;return c(this,h),(n=a.call(this,e)).state={focused:!1,overlayVisible:!1},n.dirty=!1,n.selectionPath=null,n.overlayRef=t.createRef(),n.inputRef=t.createRef(n.props.inputRef),n.hide=n.hide.bind(f(n)),n.onClick=n.onClick.bind(f(n)),n.onInputFocus=n.onInputFocus.bind(f(n)),n.onInputBlur=n.onInputBlur.bind(f(n)),n.onInputKeyDown=n.onInputKeyDown.bind(f(n)),n.onOverlayEnter=n.onOverlayEnter.bind(f(n)),n.onOverlayEntered=n.onOverlayEntered.bind(f(n)),n.onOverlayExit=n.onOverlayExit.bind(f(n)),n.onOverlayExited=n.onOverlayExited.bind(f(n)),n.onOptionSelect=n.onOptionSelect.bind(f(n)),n.onOptionGroupSelect=n.onOptionGroupSelect.bind(f(n)),n.onPanelClick=n.onPanelClick.bind(f(n)),n}return d(h,[{key:"onOptionSelect",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e,value:e.value}),this.updateSelectionPath(),this.hide(),this.inputRef.current.focus()}},{key:"onOptionGroupSelect",value:function(e){this.dirty=!0,this.props.onGroupChange&&this.props.onGroupChange(e)}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?n.ObjectUtils.resolveFieldData(e,this.props.optionLabel):e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?n.ObjectUtils.resolveFieldData(e,this.props.optionValue):e}},{key:"getOptionGroupChildren",value:function(e,t){return n.ObjectUtils.resolveFieldData(e,this.props.optionGroupChildren[t])}},{key:"isOptionGroup",value:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.props.optionGroupChildren[t])}},{key:"updateSelectionPath",value:function(){var e;if(null!=this.props.value&&this.props.options){var t,n=C(this.props.options);try{for(n.s();!(t=n.n()).done;){if(e=this.findModelOptionInGroup(t.value,0))break}}catch(e){n.e(e)}finally{n.f()}}this.selectionPath=e}},{key:"findModelOptionInGroup",value:function(e,t){if(this.isOptionGroup(e,t)){var i,o,r=C(this.getOptionGroupChildren(e,t));try{for(r.s();!(o=r.n()).done;){if(i=this.findModelOptionInGroup(o.value,t+1))return i.unshift(e),i}}catch(e){r.e(e)}finally{r.f()}}else if(n.ObjectUtils.equals(this.props.value,this.getOptionValue(e),this.props.dataKey))return[e];return null}},{key:"onClick",value:function(e){if(!this.props.disabled){var t=this.overlayRef?this.overlayRef.current:null;t&&t.contains(e.target)||(this.inputRef.current.focus(),this.state.overlayVisible?this.hide():this.show())}}},{key:"onInputFocus",value:function(){this.setState({focused:!0})}},{key:"onInputBlur",value:function(){this.setState({focused:!1})}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:this.state.overlayVisible?n.DomHandler.findSingle(this.overlayRef.current,".p-cascadeselect-item").children[0].focus():e.altKey&&this.props.options&&this.props.options.length&&this.show(),e.preventDefault();break;case 32:this.state.overlayVisible?this.hide():this.show(),e.preventDefault();break;case 9:this.hide()}}},{key:"onPanelClick",value:function(e){r.OverlayService.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"show",value:function(){this.props.onBeforeShow&&this.props.onBeforeShow(),this.setState({overlayVisible:!0})}},{key:"hide",value:function(){var e=this;this.props.onBeforeHide&&this.props.onBeforeHide(),this.setState({overlayVisible:!1},(function(){e.inputRef.current.focus()}))}},{key:"onOverlayEnter",value:function(){n.ZIndexUtils.set("overlay",this.overlayRef.current,u.default.autoZIndex,u.default.zIndex.overlay),this.alignOverlay()}},{key:"onOverlayEntered",value:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.dirty=!1}},{key:"onOverlayExited",value:function(){n.ZIndexUtils.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){n.DomHandler.alignOverlay(this.overlayRef.current,this.label.parentElement,this.props.appendTo||u.default.appendTo)}},{key:"bindOutsideClickListener",value:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))}},{key:"unbindOutsideClickListener",value:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.container,(function(){e.state.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.overlayVisible&&!n.DomHandler.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.overlayRef&&this.overlayRef.current.contains(e.target))}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.updateSelectionPath()}},{key:"componentWillUnmount",value:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.updateSelectionPath()}},{key:"renderKeyboardHelper",value:function(){var e=this.props.value?this.getOptionLabel(this.props.value):null;return p.default.createElement("div",{className:"p-hidden-accessible"},p.default.createElement("input",{ref:this.inputRef,type:"text",id:this.props.inputId,name:this.props.name,defaultValue:e,readOnly:!0,disabled:this.props.disabled,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onKeyDown:this.onInputKeyDown,tabIndex:this.props.tabIndex,"aria-haspopup":"listbox","aria-labelledby":this.props.ariaLabelledBy}))}},{key:"renderLabel",value:function(){var e=this,t=this.props.value?this.getOptionLabel(this.props.value):this.props.placeholder||"p-emptylabel",i=n.classNames("p-cascadeselect-label ",{"p-placeholder":t===this.props.placeholder,"p-cascadeselect-label-empty":!this.props.value&&"p-emptylabel"===t});return p.default.createElement("span",{ref:function(t){return e.label=t},className:i},t)}},{key:"renderDropdownIcon",value:function(){var e=n.classNames("p-cascadeselect-trigger-icon",this.props.dropdownIcon);return p.default.createElement("div",{className:"p-cascadeselect-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":this.state.overlayVisible},p.default.createElement("span",{className:e}))}},{key:"renderOverlay",value:function(){return p.default.createElement(l.Portal,{element:p.default.createElement(i.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.overlayVisible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onOverlayEnter,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited},p.default.createElement("div",{ref:this.overlayRef,className:"p-cascadeselect-panel p-component",onClick:this.onPanelClick},p.default.createElement("div",{className:"p-cascadeselect-items-wrapper"},p.default.createElement(L,{options:this.props.options,selectionPath:this.selectionPath,className:"p-cascadeselect-items",optionLabel:this.props.optionLabel,optionValue:this.props.optionValue,level:0,optionGroupLabel:this.props.optionGroupLabel,optionGroupChildren:this.props.optionGroupChildren,onOptionSelect:this.onOptionSelect,onOptionGroupSelect:this.onOptionGroupSelect,root:!0,template:this.props.itemTemplate,onPanelHide:this.hide})))),appendTo:this.props.appendTo})}},{key:"renderElement",value:function(){var e=this,t=n.classNames("p-cascadeselect p-component p-inputwrapper",this.props.className,{"p-disabled":this.props.disabled,"p-focus":this.state.focused,"p-inputwrapper-filled":this.props.value,"p-inputwrapper-focus":this.state.focused||this.state.overlayVisible}),i=this.renderKeyboardHelper(),o=this.renderLabel(),r=this.renderDropdownIcon(),l=this.renderOverlay();return p.default.createElement("div",{id:this.props.id,ref:function(t){return e.container=t},className:t,style:this.props.style,onClick:this.onClick},i,o,r,l)}},{key:"render",value:function(){return this.renderElement()}}]),h}(t.Component);return k(D,"defaultProps",{id:null,inputRef:null,style:null,className:null,value:null,name:null,options:null,optionLabel:null,optionValue:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:null,itemTemplate:null,disabled:!1,dataKey:null,inputId:null,tabIndex:null,ariaLabelledBy:null,appendTo:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",onChange:null,onGroupChange:null,onBeforeShow:null,onBeforeHide:null,onShow:null,onHide:null}),e.CascadeSelect=D,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.csstransition,primereact.ripple,primereact.overlayservice,primereact.portal,primereact.api);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.cascadeselect=function(e,t,n,i,o,r,l,s){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=a(t),u=a(s);function c(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 i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function b(e){return b="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},b(e)}function m(e,t){if(t&&("object"===b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},O(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 S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,r=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw r}}}}function g(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function E(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var L=function(e){y(l,e);var t,i,r=(t=l,i=E(),function(){var e,n=O(t);if(i){var o=O(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return m(this,e)});function l(e){var t;return c(this,l),(t=r.call(this,e)).state={activeOption:null},t.onOptionSelect=t.onOptionSelect.bind(f(t)),t.onOptionGroupSelect=t.onOptionGroupSelect.bind(f(t)),t}return d(l,[{key:"componentDidMount",value:function(){if(this.props.selectionPath&&this.props.options&&!this.props.dirty){var e,t=S(this.props.options);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(this.props.selectionPath.includes(n)){this.setState({activeOption:n});break}}}catch(e){t.e(e)}finally{t.f()}}this.props.root||this.position()}},{key:"componentDidUpdate",value:function(e){e.parentActive!==this.props.parentActive&&this.setState({activeOption:null})}},{key:"position",value:function(){var e=this.element.parentElement,t=n.DomHandler.getOffset(e),i=n.DomHandler.getViewport(),o=this.element.offsetParent?this.element.offsetWidth:n.DomHandler.getHiddenElementOuterWidth(this.element),r=n.DomHandler.getOuterWidth(e.children[0]);parseInt(t.left,10)+r+o>i.width-n.DomHandler.calculateScrollbarWidth()&&(this.element.style.left="-100%")}},{key:"onOptionSelect",value:function(e){this.props.onOptionSelect&&this.props.onOptionSelect(e)}},{key:"onKeyDown",value:function(e,t){var n=e.currentTarget.parentElement;switch(e.key){case"Down":case"ArrowDown":var i=this.findNextItem(n);i&&i.children[0].focus();break;case"Up":case"ArrowUp":var o=this.findPrevItem(n);o&&o.children[0].focus();break;case"Right":case"ArrowRight":this.isOptionGroup(t)&&(this.state.activeOption===t?n.children[1].children[0].children[0].focus():this.setState({activeOption:t}));break;case"Left":case"ArrowLeft":this.setState({activeOption:null});var r=e.currentTarget.parentElement.parentElement.previousElementSibling;r&&r.focus();break;case"Enter":this.onOptionClick(e,t);break;case"Tab":case"Escape":this.props.onPanelHide&&(this.props.onPanelHide(),e.preventDefault())}e.preventDefault()}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?n.DomHandler.hasClass(t,"p-disabled")||!n.DomHandler.hasClass(t,"p-cascadeselect-item")?this.findNextItem(t):t:null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?n.DomHandler.hasClass(t,"p-disabled")||!n.DomHandler.hasClass(t,"p-cascadeselect-item")?this.findPrevItem(t):t:null}},{key:"onOptionClick",value:function(e,t){this.isOptionGroup(t)?(this.setState({activeOption:this.state.activeOption===t?null:t}),this.props.onOptionGroupSelect&&this.props.onOptionGroupSelect({originalEvent:e,value:t})):this.props.onOptionSelect&&this.props.onOptionSelect({originalEvent:e,value:this.getOptionValue(t)})}},{key:"onOptionGroupSelect",value:function(e){this.props.onOptionGroupSelect&&this.props.onOptionGroupSelect(e)}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?n.ObjectUtils.resolveFieldData(e,this.props.optionLabel):e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?n.ObjectUtils.resolveFieldData(e,this.props.optionValue):e}},{key:"getOptionGroupLabel",value:function(e){return this.props.optionGroupLabel?n.ObjectUtils.resolveFieldData(e,this.props.optionGroupLabel):null}},{key:"getOptionGroupChildren",value:function(e){return n.ObjectUtils.resolveFieldData(e,this.props.optionGroupChildren[this.props.level])}},{key:"isOptionGroup",value:function(e){return Object.prototype.hasOwnProperty.call(e,this.props.optionGroupChildren[this.props.level])}},{key:"getOptionLabelToRender",value:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)}},{key:"renderSubmenu",value:function(e){return this.isOptionGroup(e)&&this.state.activeOption===e?p.default.createElement(l,{options:this.getOptionGroupChildren(e),className:"p-cascadeselect-sublist",selectionPath:this.props.selectionPath,optionLabel:this.props.optionLabel,optionValue:this.props.optionValue,level:this.props.level+1,onOptionSelect:this.onOptionSelect,onOptionGroupSelect:this.onOptionGroupSelect,parentActive:this.state.activeOption===e,optionGroupLabel:this.props.optionGroupLabel,optionGroupChildren:this.props.optionGroupChildren,dirty:this.props.dirty,template:this.props.template,onPanelHide:this.props.onPanelHide}):null}},{key:"renderOption",value:function(e,t){var i=this,r=n.classNames("p-cascadeselect-item",{"p-cascadeselect-item-group":this.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":this.state.activeOption===e},e.className),l=this.renderSubmenu(e),s=this.props.template?n.ObjectUtils.getJSXElement(this.props.template,this.getOptionValue(e)):p.default.createElement("span",{className:"p-cascadeselect-item-text"},this.getOptionLabelToRender(e)),a=this.isOptionGroup(e)&&p.default.createElement("span",{className:"p-cascadeselect-group-icon pi pi-angle-right"});return p.default.createElement("li",{key:this.getOptionLabelToRender(e)+"_"+t,className:r,style:e.style,role:"none"},p.default.createElement("div",{className:"p-cascadeselect-item-content",onClick:function(t){return i.onOptionClick(t,e)},tabIndex:0,onKeyDown:function(t){return i.onKeyDown(t,e)}},s,a,p.default.createElement(o.Ripple,null)),l)}},{key:"renderMenu",value:function(){var e=this;return this.props.options?this.props.options.map((function(t,n){return e.renderOption(t,n)})):null}},{key:"render",value:function(){var e=this,t=n.classNames("p-cascadeselect-panel p-cascadeselect-items",this.props.className),i=this.renderMenu();return p.default.createElement("ul",{ref:function(t){return e.element=t},className:t,role:"listbox","aria-orientation":"horizontal"},i)}}]),l}(t.Component);function C(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=G(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,r=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw r}}}}function G(e,t){if(e){if("string"==typeof e)return R(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)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function I(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}k(L,"defaultProps",{options:null,selectionPath:!1,className:null,optionLabel:null,optionValue:null,level:null,optionGroupLabel:null,optionGroupChildren:null,parentActive:null,dirty:null,root:null,template:null,onOptionSelect:null,onOptionGroupSelect:null});var P=function(e){y(h,e);var o,s,a=(o=h,s=I(),function(){var e,t=O(o);if(s){var n=O(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function h(e){var n;return c(this,h),(n=a.call(this,e)).state={focused:!1,overlayVisible:!1},n.dirty=!1,n.selectionPath=null,n.overlayRef=t.createRef(),n.inputRef=t.createRef(n.props.inputRef),n.hide=n.hide.bind(f(n)),n.onClick=n.onClick.bind(f(n)),n.onInputFocus=n.onInputFocus.bind(f(n)),n.onInputBlur=n.onInputBlur.bind(f(n)),n.onInputKeyDown=n.onInputKeyDown.bind(f(n)),n.onOverlayEnter=n.onOverlayEnter.bind(f(n)),n.onOverlayEntered=n.onOverlayEntered.bind(f(n)),n.onOverlayExit=n.onOverlayExit.bind(f(n)),n.onOverlayExited=n.onOverlayExited.bind(f(n)),n.onOptionSelect=n.onOptionSelect.bind(f(n)),n.onOptionGroupSelect=n.onOptionGroupSelect.bind(f(n)),n.onPanelClick=n.onPanelClick.bind(f(n)),n}return d(h,[{key:"onOptionSelect",value:function(e){this.props.onChange&&this.props.onChange({originalEvent:e,value:e.value}),this.updateSelectionPath(),this.hide(),this.inputRef.current.focus()}},{key:"onOptionGroupSelect",value:function(e){this.dirty=!0,this.props.onGroupChange&&this.props.onGroupChange(e)}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?n.ObjectUtils.resolveFieldData(e,this.props.optionLabel):e}},{key:"getOptionValue",value:function(e){return this.props.optionValue?n.ObjectUtils.resolveFieldData(e,this.props.optionValue):e}},{key:"getOptionGroupChildren",value:function(e,t){return n.ObjectUtils.resolveFieldData(e,this.props.optionGroupChildren[t])}},{key:"isOptionGroup",value:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.props.optionGroupChildren[t])}},{key:"updateSelectionPath",value:function(){var e;if(null!=this.props.value&&this.props.options){var t,n=C(this.props.options);try{for(n.s();!(t=n.n()).done;){if(e=this.findModelOptionInGroup(t.value,0))break}}catch(e){n.e(e)}finally{n.f()}}this.selectionPath=e}},{key:"findModelOptionInGroup",value:function(e,t){if(this.isOptionGroup(e,t)){var i,o,r=C(this.getOptionGroupChildren(e,t));try{for(r.s();!(o=r.n()).done;){if(i=this.findModelOptionInGroup(o.value,t+1))return i.unshift(e),i}}catch(e){r.e(e)}finally{r.f()}}else if(n.ObjectUtils.equals(this.props.value,this.getOptionValue(e),this.props.dataKey))return[e];return null}},{key:"onClick",value:function(e){if(!this.props.disabled){var t=this.overlayRef?this.overlayRef.current:null;t&&t.contains(e.target)||(this.inputRef.current.focus(),this.state.overlayVisible?this.hide():this.show())}}},{key:"onInputFocus",value:function(){this.setState({focused:!0})}},{key:"onInputBlur",value:function(){this.setState({focused:!1})}},{key:"onInputKeyDown",value:function(e){switch(e.which){case 40:this.state.overlayVisible?n.DomHandler.findSingle(this.overlayRef.current,".p-cascadeselect-item").children[0].focus():e.altKey&&this.props.options&&this.props.options.length&&this.show(),e.preventDefault();break;case 32:this.state.overlayVisible?this.hide():this.show(),e.preventDefault();break;case 9:this.hide()}}},{key:"onPanelClick",value:function(e){r.OverlayService.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"show",value:function(){this.props.onBeforeShow&&this.props.onBeforeShow(),this.setState({overlayVisible:!0})}},{key:"hide",value:function(){var e=this;this.props.onBeforeHide&&this.props.onBeforeHide(),this.setState({overlayVisible:!1},(function(){e.inputRef.current.focus()}))}},{key:"onOverlayEnter",value:function(){n.ZIndexUtils.set("overlay",this.overlayRef.current,u.default.autoZIndex,u.default.zIndex.overlay),this.alignOverlay()}},{key:"onOverlayEntered",value:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.dirty=!1}},{key:"onOverlayExited",value:function(){n.ZIndexUtils.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){n.DomHandler.alignOverlay(this.overlayRef.current,this.label.parentElement,this.props.appendTo||u.default.appendTo)}},{key:"bindOutsideClickListener",value:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))}},{key:"unbindOutsideClickListener",value:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.container,(function(){e.state.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.overlayVisible&&!n.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.overlayRef&&this.overlayRef.current.contains(e.target))}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.updateSelectionPath()}},{key:"componentWillUnmount",value:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.updateSelectionPath()}},{key:"renderKeyboardHelper",value:function(){var e=this.props.value?this.getOptionLabel(this.props.value):null;return p.default.createElement("div",{className:"p-hidden-accessible"},p.default.createElement("input",{ref:this.inputRef,type:"text",id:this.props.inputId,name:this.props.name,defaultValue:e,readOnly:!0,disabled:this.props.disabled,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onKeyDown:this.onInputKeyDown,tabIndex:this.props.tabIndex,"aria-haspopup":"listbox","aria-labelledby":this.props.ariaLabelledBy}))}},{key:"renderLabel",value:function(){var e=this,t=this.props.value?this.getOptionLabel(this.props.value):this.props.placeholder||"p-emptylabel",i=n.classNames("p-cascadeselect-label ",{"p-placeholder":t===this.props.placeholder,"p-cascadeselect-label-empty":!this.props.value&&"p-emptylabel"===t});return p.default.createElement("span",{ref:function(t){return e.label=t},className:i},t)}},{key:"renderDropdownIcon",value:function(){var e=n.classNames("p-cascadeselect-trigger-icon",this.props.dropdownIcon);return p.default.createElement("div",{className:"p-cascadeselect-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":this.state.overlayVisible},p.default.createElement("span",{className:e}))}},{key:"renderOverlay",value:function(){return p.default.createElement(l.Portal,{element:p.default.createElement(i.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.overlayVisible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onOverlayEnter,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited},p.default.createElement("div",{ref:this.overlayRef,className:"p-cascadeselect-panel p-component",onClick:this.onPanelClick},p.default.createElement("div",{className:"p-cascadeselect-items-wrapper"},p.default.createElement(L,{options:this.props.options,selectionPath:this.selectionPath,className:"p-cascadeselect-items",optionLabel:this.props.optionLabel,optionValue:this.props.optionValue,level:0,optionGroupLabel:this.props.optionGroupLabel,optionGroupChildren:this.props.optionGroupChildren,onOptionSelect:this.onOptionSelect,onOptionGroupSelect:this.onOptionGroupSelect,root:!0,template:this.props.itemTemplate,onPanelHide:this.hide})))),appendTo:this.props.appendTo})}},{key:"renderElement",value:function(){var e=this,t=n.classNames("p-cascadeselect p-component p-inputwrapper",this.props.className,{"p-disabled":this.props.disabled,"p-focus":this.state.focused,"p-inputwrapper-filled":this.props.value,"p-inputwrapper-focus":this.state.focused||this.state.overlayVisible}),i=this.renderKeyboardHelper(),o=this.renderLabel(),r=this.renderDropdownIcon(),l=this.renderOverlay();return p.default.createElement("div",{id:this.props.id,ref:function(t){return e.container=t},className:t,style:this.props.style,onClick:this.onClick},i,o,r,l)}},{key:"render",value:function(){return this.renderElement()}}]),h}(t.Component);return k(P,"defaultProps",{id:null,inputRef:null,style:null,className:null,value:null,name:null,options:null,optionLabel:null,optionValue:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:null,itemTemplate:null,disabled:!1,dataKey:null,inputId:null,tabIndex:null,ariaLabelledBy:null,appendTo:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",onChange:null,onGroupChange:null,onBeforeShow:null,onBeforeHide:null,onShow:null,onHide:null}),e.CascadeSelect=P,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.csstransition,primereact.ripple,primereact.overlayservice,primereact.portal,primereact.api);
|
package/chart/chart.cjs.js
CHANGED
|
@@ -46,6 +46,9 @@ function _defineProperties(target, props) {
|
|
|
46
46
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
47
47
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
48
48
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
49
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
50
|
+
writable: false
|
|
51
|
+
});
|
|
49
52
|
return Constructor;
|
|
50
53
|
}
|
|
51
54
|
|
|
@@ -70,23 +73,20 @@ function _inherits(subClass, superClass) {
|
|
|
70
73
|
configurable: true
|
|
71
74
|
}
|
|
72
75
|
});
|
|
76
|
+
Object.defineProperty(subClass, "prototype", {
|
|
77
|
+
writable: false
|
|
78
|
+
});
|
|
73
79
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
function _typeof(obj) {
|
|
77
83
|
"@babel/helpers - typeof";
|
|
78
84
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
_typeof = function _typeof(obj) {
|
|
85
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return _typeof(obj);
|
|
85
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
86
|
+
return typeof obj;
|
|
87
|
+
} : function (obj) {
|
|
88
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
89
|
+
}, _typeof(obj);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function _assertThisInitialized(self) {
|
|
@@ -155,8 +155,8 @@ var Chart = /*#__PURE__*/function (_Component) {
|
|
|
155
155
|
_this.chart = null;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
if (module && module
|
|
159
|
-
_this.chart = new module
|
|
158
|
+
if (module && module["default"]) {
|
|
159
|
+
_this.chart = new module["default"](_this.canvas, {
|
|
160
160
|
type: _this.props.type,
|
|
161
161
|
data: _this.props.data,
|
|
162
162
|
options: _this.props.options,
|
package/chart/chart.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("primereact/utils");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function r(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o=n(t);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e){return a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},a(t,e)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("primereact/utils");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function r(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o=n(t);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e){return a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},a(t,e)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){if(e&&("object"===s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}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(t){return!1}}var y,d,b,v=function(n){c(v,t.Component);var a,s,l,y,d,b=(a=v,s=h(),function(){var t,e=f(a);if(s){var n=f(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return p(this,t)});function v(){return i(this,v),b.apply(this,arguments)}return l=v,(y=[{key:"initChart",value:function(){var t=this;Promise.resolve().then((function(){return r(require("chart.js/auto"))})).then((function(e){t.chart&&(t.chart.destroy(),t.chart=null),e&&e.default&&(t.chart=new e.default(t.canvas,{type:t.props.type,data:t.props.data,options:t.props.options,plugins:t.props.plugins}))}))}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getChart",value:function(){return this.chart}},{key:"getBase64Image",value:function(){return this.chart.toBase64Image()}},{key:"generateLegend",value:function(){this.chart&&this.chart.generateLegend()}},{key:"refresh",value:function(){this.chart&&this.chart.update()}},{key:"reinit",value:function(){this.initChart()}},{key:"shouldComponentUpdate",value:function(t){return t.data!==this.props.data||t.options!==this.props.options||t.type!==this.props.type}},{key:"componentDidMount",value:function(){this.initChart()}},{key:"componentDidUpdate",value:function(){this.reinit()}},{key:"componentWillUnmount",value:function(){this.chart&&(this.chart.destroy(),this.chart=null)}},{key:"render",value:function(){var t=this,n=e.classNames("p-chart",this.props.className),r=Object.assign({width:this.props.width,height:this.props.height},this.props.style);return o.default.createElement("div",{id:this.props.id,style:r,className:n},o.default.createElement("canvas",{ref:function(e){t.canvas=e},width:this.props.width,height:this.props.height}))}}])&&u(l.prototype,y),d&&u(l,d),Object.defineProperty(l,"prototype",{writable:!1}),v}();b={id:null,type:null,data:null,options:null,plugins:null,width:null,height:null,style:null,className:null},(d="defaultProps")in(y=v)?Object.defineProperty(y,d,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[d]=b,exports.Chart=v;
|
package/chart/chart.esm.js
CHANGED
|
@@ -20,6 +20,9 @@ function _defineProperties(target, props) {
|
|
|
20
20
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
21
21
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
22
22
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
23
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
24
|
+
writable: false
|
|
25
|
+
});
|
|
23
26
|
return Constructor;
|
|
24
27
|
}
|
|
25
28
|
|
|
@@ -44,23 +47,20 @@ function _inherits(subClass, superClass) {
|
|
|
44
47
|
configurable: true
|
|
45
48
|
}
|
|
46
49
|
});
|
|
50
|
+
Object.defineProperty(subClass, "prototype", {
|
|
51
|
+
writable: false
|
|
52
|
+
});
|
|
47
53
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
function _typeof(obj) {
|
|
51
57
|
"@babel/helpers - typeof";
|
|
52
58
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
_typeof = function _typeof(obj) {
|
|
59
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return _typeof(obj);
|
|
59
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
60
|
+
return typeof obj;
|
|
61
|
+
} : function (obj) {
|
|
62
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
63
|
+
}, _typeof(obj);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function _assertThisInitialized(self) {
|
|
@@ -129,8 +129,8 @@ var Chart = /*#__PURE__*/function (_Component) {
|
|
|
129
129
|
_this.chart = null;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
if (module && module
|
|
133
|
-
_this.chart = new module
|
|
132
|
+
if (module && module["default"]) {
|
|
133
|
+
_this.chart = new module["default"](_this.canvas, {
|
|
134
134
|
type: _this.props.type,
|
|
135
135
|
data: _this.props.data,
|
|
136
136
|
options: _this.props.options,
|
package/chart/chart.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{Component as e}from"react";import{classNames as n}from"primereact/utils";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return c(t)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var f,h,y,d=function(i){u(
|
|
1
|
+
import t,{Component as e}from"react";import{classNames as n}from"primereact/utils";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return c(t)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var f,h,y,d=function(i){u(b,e);var a,c,f,h,y,d=(a=b,c=p(),function(){var t,e=l(a);if(c){var n=l(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return s(this,t)});function b(){return r(this,b),d.apply(this,arguments)}return f=b,(h=[{key:"initChart",value:function(){var t=this;import("chart.js/auto").then((function(e){t.chart&&(t.chart.destroy(),t.chart=null),e&&e.default&&(t.chart=new e.default(t.canvas,{type:t.props.type,data:t.props.data,options:t.props.options,plugins:t.props.plugins}))}))}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getChart",value:function(){return this.chart}},{key:"getBase64Image",value:function(){return this.chart.toBase64Image()}},{key:"generateLegend",value:function(){this.chart&&this.chart.generateLegend()}},{key:"refresh",value:function(){this.chart&&this.chart.update()}},{key:"reinit",value:function(){this.initChart()}},{key:"shouldComponentUpdate",value:function(t){return t.data!==this.props.data||t.options!==this.props.options||t.type!==this.props.type}},{key:"componentDidMount",value:function(){this.initChart()}},{key:"componentDidUpdate",value:function(){this.reinit()}},{key:"componentWillUnmount",value:function(){this.chart&&(this.chart.destroy(),this.chart=null)}},{key:"render",value:function(){var e=this,r=n("p-chart",this.props.className),o=Object.assign({width:this.props.width,height:this.props.height},this.props.style);return t.createElement("div",{id:this.props.id,style:o,className:r},t.createElement("canvas",{ref:function(t){e.canvas=t},width:this.props.width,height:this.props.height}))}}])&&o(f.prototype,h),y&&o(f,y),Object.defineProperty(f,"prototype",{writable:!1}),b}();y={id:null,type:null,data:null,options:null,plugins:null,width:null,height:null,style:null,className:null},(h="defaultProps")in(f=d)?Object.defineProperty(f,h,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[h]=y;export{d as Chart};
|
package/chart/chart.js
CHANGED
|
@@ -25,6 +25,9 @@ this.primereact.chart = (function (exports, React, utils) {
|
|
|
25
25
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
26
26
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
27
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
29
|
+
writable: false
|
|
30
|
+
});
|
|
28
31
|
return Constructor;
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -49,23 +52,20 @@ this.primereact.chart = (function (exports, React, utils) {
|
|
|
49
52
|
configurable: true
|
|
50
53
|
}
|
|
51
54
|
});
|
|
55
|
+
Object.defineProperty(subClass, "prototype", {
|
|
56
|
+
writable: false
|
|
57
|
+
});
|
|
52
58
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
function _typeof(obj) {
|
|
56
62
|
"@babel/helpers - typeof";
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
_typeof = function _typeof(obj) {
|
|
64
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return _typeof(obj);
|
|
64
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
65
|
+
return typeof obj;
|
|
66
|
+
} : function (obj) {
|
|
67
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
68
|
+
}, _typeof(obj);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function _assertThisInitialized(self) {
|
|
@@ -134,8 +134,8 @@ this.primereact.chart = (function (exports, React, utils) {
|
|
|
134
134
|
_this.chart = null;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
if (module && module
|
|
138
|
-
_this.chart = new module
|
|
137
|
+
if (module && module["default"]) {
|
|
138
|
+
_this.chart = new module["default"](_this.canvas, {
|
|
139
139
|
type: _this.props.type,
|
|
140
140
|
data: _this.props.data,
|
|
141
141
|
options: _this.props.options,
|
package/chart/chart.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.chart=function(t,e,n){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=r(e);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.chart=function(t,e,n){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=r(e);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},u(t,e)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){if(e&&("object"===s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}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(t){return!1}}var y,d,b,v=function(t){c(d,t);var e,r,u,s,l,y=(e=d,r=h(),function(){var t,n=f(e);if(r){var o=f(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return p(this,t)});function d(){return i(this,d),y.apply(this,arguments)}return u=d,(s=[{key:"initChart",value:function(){var t=this;import("chart.js/auto").then((function(e){t.chart&&(t.chart.destroy(),t.chart=null),e&&e.default&&(t.chart=new e.default(t.canvas,{type:t.props.type,data:t.props.data,options:t.props.options,plugins:t.props.plugins}))}))}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getChart",value:function(){return this.chart}},{key:"getBase64Image",value:function(){return this.chart.toBase64Image()}},{key:"generateLegend",value:function(){this.chart&&this.chart.generateLegend()}},{key:"refresh",value:function(){this.chart&&this.chart.update()}},{key:"reinit",value:function(){this.initChart()}},{key:"shouldComponentUpdate",value:function(t){return t.data!==this.props.data||t.options!==this.props.options||t.type!==this.props.type}},{key:"componentDidMount",value:function(){this.initChart()}},{key:"componentDidUpdate",value:function(){this.reinit()}},{key:"componentWillUnmount",value:function(){this.chart&&(this.chart.destroy(),this.chart=null)}},{key:"render",value:function(){var t=this,e=n.classNames("p-chart",this.props.className),r=Object.assign({width:this.props.width,height:this.props.height},this.props.style);return o.default.createElement("div",{id:this.props.id,style:r,className:e},o.default.createElement("canvas",{ref:function(e){t.canvas=e},width:this.props.width,height:this.props.height}))}}])&&a(u.prototype,s),l&&a(u,l),Object.defineProperty(u,"prototype",{writable:!1}),d}(e.Component);return b={id:null,type:null,data:null,options:null,plugins:null,width:null,height:null,style:null,className:null},(d="defaultProps")in(y=v)?Object.defineProperty(y,d,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[d]=b,t.Chart=v,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.utils);
|