primereact 7.0.0-rc.1 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -10
- package/accordion/accordion.cjs.js +40 -27
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +7 -3
- package/accordion/accordion.esm.js +27 -14
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +40 -28
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +82 -46
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +95 -61
- package/api/api.esm.js +69 -33
- package/api/api.esm.min.js +1 -1
- package/api/api.js +83 -47
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +79 -71
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +11 -4
- package/autocomplete/autocomplete.esm.js +16 -8
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +75 -72
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +10 -9
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +2 -1
- package/avatar/avatar.esm.js +5 -4
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +11 -10
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +3 -3
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +1 -1
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +4 -4
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +3 -3
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +1 -1
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +4 -4
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +27 -16
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +17 -7
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +26 -17
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +16 -16
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +17 -17
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +42 -53
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +4 -11
- package/button/button.esm.js +31 -42
- package/button/button.esm.min.js +1 -1
- package/button/button.js +41 -54
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +193 -154
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +7 -2
- package/calendar/calendar.esm.js +68 -29
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +189 -155
- package/calendar/calendar.min.css +1 -1
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +1 -1
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +2 -2
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +13 -13
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +1 -1
- package/card/card.esm.min.js +1 -1
- package/card/card.js +14 -14
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +45 -45
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +10 -10
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +45 -46
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +51 -47
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +7 -3
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +48 -48
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +6 -8
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +1 -1
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +5 -5
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +20 -15
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +2 -1
- package/checkbox/checkbox.esm.js +13 -8
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +20 -16
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +16 -14
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +3 -4
- package/chip/chip.esm.js +11 -9
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +17 -15
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +46 -20
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +10 -0
- package/chips/chips.esm.js +37 -11
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +46 -21
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +35 -31
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +20 -6
- package/colorpicker/colorpicker.esm.js +7 -3
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +32 -32
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +24 -2
- package/column/column.esm.min.js +1 -1
- package/column/column.js +1 -1
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +1 -1
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +22 -20
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +4 -3
- package/confirmdialog/confirmdialog.esm.js +6 -4
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +22 -21
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +46 -41
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +6 -4
- package/confirmpopup/confirmpopup.esm.js +12 -8
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +43 -41
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +68 -63
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +35 -31
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +65 -64
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +11228 -846
- package/core/core.min.js +40 -1
- package/csstransition/csstransition.cjs.js +49 -19
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.d.ts +8 -0
- package/csstransition/csstransition.esm.js +48 -19
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +49 -21
- package/csstransition/csstransition.min.js +1 -1
- package/csstransition/package.json +2 -1
- package/datascroller/datascroller.cjs.js +12 -11
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +4 -3
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +12 -12
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +600 -519
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +30 -14
- package/datatable/datatable.esm.js +321 -240
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +597 -520
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +32 -29
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +6 -3
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +31 -30
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +1 -1
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +2 -2
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +60 -59
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +3 -1
- package/dialog/dialog.esm.js +13 -13
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +57 -60
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +4 -4
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +1 -1
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +5 -5
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +51 -17
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +13 -0
- package/dock/dock.esm.js +39 -5
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +51 -18
- package/dock/dock.min.css +1 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +99 -77
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +37 -15
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +95 -78
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +44 -42
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +8 -4
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +43 -39
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +17 -15
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fieldset/fieldset.esm.js +3 -1
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +16 -16
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +63 -56
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +2 -1
- package/fileupload/fileupload.esm.js +24 -17
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +63 -57
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +6 -8
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +1 -1
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +5 -5
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +71 -67
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +7 -4
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +68 -68
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +1 -1
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +2 -2
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +31 -27
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +5 -5
- package/image/image.esm.js +5 -2
- package/image/image.esm.min.js +1 -1
- package/image/image.js +29 -28
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +8 -8
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +1 -1
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +9 -9
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +11 -10
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +4 -3
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +11 -11
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +58 -34
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +41 -17
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +57 -35
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +15 -12
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +8 -5
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +15 -13
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +12 -10
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +1 -1
- package/inputtext/inputtext.esm.js +3 -1
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +11 -11
- package/inputtext/inputtext.min.css +1 -1
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +10 -9
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +1 -1
- package/inputtextarea/inputtextarea.esm.js +2 -1
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +10 -10
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +5 -5
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +1 -1
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +6 -6
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +7 -7
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +1 -1
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +8 -8
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +38 -36
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +3 -1
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +37 -37
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +36 -35
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +2 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +36 -36
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +53 -46
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -1
- package/mention/mention.esm.js +9 -3
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +48 -47
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +33 -28
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +4 -1
- package/menu/menu.esm.js +7 -3
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +30 -29
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +38 -35
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +4 -2
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +37 -36
- package/menubar/menubar.min.css +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +9 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +3 -1
- package/message/message.esm.js +3 -2
- package/message/message.esm.min.js +1 -1
- package/message/message.js +10 -9
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +19 -17
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +2 -1
- package/messages/messages.esm.js +3 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +18 -18
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +128 -116
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -2
- package/multiselect/multiselect.esm.js +44 -32
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +124 -117
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +14 -13
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +14 -14
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +35 -34
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +2 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +35 -35
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +26 -26
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +1 -1
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +27 -27
- package/organizationchart/organizationchart.min.css +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +33 -30
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +3 -2
- package/overlaypanel/overlaypanel.esm.js +11 -9
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +29 -31
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/overlayservice/overlayservice.cjs.js +2 -2
- package/overlayservice/overlayservice.cjs.min.js +1 -1
- package/overlayservice/overlayservice.esm.js +1 -1
- package/overlayservice/overlayservice.esm.min.js +1 -1
- package/overlayservice/overlayservice.js +3 -3
- package/overlayservice/overlayservice.min.js +1 -1
- package/package.json +11 -4
- package/paginator/paginator.cjs.js +48 -47
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +2 -1
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +48 -48
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +21 -18
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +6 -3
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +20 -19
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +40 -39
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/panelmenu/panelmenu.esm.js +2 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +40 -40
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +33 -29
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +3 -2
- package/password/password.esm.js +7 -3
- package/password/password.esm.min.js +1 -1
- package/password/password.js +30 -30
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +58 -54
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +14 -10
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +58 -55
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +4 -8
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +2 -6
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +5 -10
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +3168 -2524
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1939 -1294
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +3167 -2521
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +9 -9
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +1 -1
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +10 -10
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +5 -5
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +1 -1
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +6 -6
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +10 -9
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -1
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +10 -10
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +10 -9
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +4 -3
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +10 -10
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +484 -431
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +38 -18
- package/resources/themes/arya-green/theme.css +38 -18
- package/resources/themes/arya-orange/theme.css +38 -18
- package/resources/themes/arya-purple/theme.css +38 -18
- package/resources/themes/bootstrap4-dark-blue/theme.css +42 -22
- package/resources/themes/bootstrap4-dark-purple/theme.css +42 -22
- package/resources/themes/bootstrap4-light-blue/theme.css +42 -22
- package/resources/themes/bootstrap4-light-purple/theme.css +42 -22
- package/resources/themes/fluent-light/theme.css +38 -18
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/theme.css +5675 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/theme.css +5675 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/theme.css +5675 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/theme.css +5675 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/theme.css +5675 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/theme.css +5675 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/theme.css +5675 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/theme.css +5675 -0
- package/resources/themes/luna-amber/theme.css +42 -22
- package/resources/themes/luna-blue/theme.css +42 -22
- package/resources/themes/luna-green/theme.css +42 -22
- package/resources/themes/luna-pink/theme.css +42 -22
- package/resources/themes/md-dark-deeppurple/theme.css +227 -47
- package/resources/themes/md-dark-indigo/theme.css +227 -47
- package/resources/themes/md-light-deeppurple/theme.css +227 -47
- package/resources/themes/md-light-indigo/theme.css +227 -47
- package/resources/themes/mdc-dark-deeppurple/theme.css +227 -47
- package/resources/themes/mdc-dark-indigo/theme.css +227 -47
- package/resources/themes/mdc-light-deeppurple/theme.css +227 -47
- package/resources/themes/mdc-light-indigo/theme.css +227 -47
- package/resources/themes/nova/theme.css +42 -22
- package/resources/themes/nova-accent/theme.css +42 -22
- package/resources/themes/nova-alt/theme.css +42 -22
- package/resources/themes/rhea/theme.css +42 -22
- package/resources/themes/saga-blue/theme.css +38 -18
- package/resources/themes/saga-green/theme.css +38 -18
- package/resources/themes/saga-orange/theme.css +38 -18
- package/resources/themes/saga-purple/theme.css +38 -18
- package/resources/themes/tailwind-light/theme.css +42 -22
- package/resources/themes/vela-blue/theme.css +38 -18
- package/resources/themes/vela-green/theme.css +38 -18
- package/resources/themes/vela-orange/theme.css +38 -18
- package/resources/themes/vela-purple/theme.css +38 -18
- package/ripple/ripple.cjs.js +11 -11
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +3 -3
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +12 -12
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +1 -1
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.min.js +1 -1
- package/row/row.js +2 -2
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +19 -19
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +1 -1
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +20 -20
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +18 -13
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +4 -2
- package/scrolltop/scrolltop.esm.js +9 -5
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +16 -14
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +17 -15
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +3 -1
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +16 -16
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +3 -1
- package/sidebar/sidebar.cjs.js +142 -116
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +4 -1
- package/sidebar/sidebar.esm.js +133 -108
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +139 -117
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +3 -3
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +1 -1
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +4 -4
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +37 -32
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +7 -3
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +34 -33
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +29 -19
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +21 -11
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +30 -20
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +20 -19
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +3 -2
- package/speeddial/speeddial.esm.js +2 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +20 -20
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +43 -35
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +8 -6
- package/splitbutton/splitbutton.esm.js +13 -5
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +40 -36
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +19 -19
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +2 -2
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +20 -20
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +10 -10
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +1 -1
- 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 +17 -17
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +1 -1
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +18 -18
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +16 -15
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +2 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +16 -16
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +195 -57
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +12 -1
- package/tabview/tabview.esm.js +165 -27
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +195 -58
- package/tabview/tabview.min.css +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +9 -8
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +2 -1
- package/tag/tag.esm.js +5 -4
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +10 -9
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +12 -12
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +1 -1
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +13 -13
- package/terminal/terminal.min.js +1 -1
- package/terminalservice/terminalservice.cjs.js +2 -2
- package/terminalservice/terminalservice.cjs.min.js +1 -1
- package/terminalservice/terminalservice.esm.js +1 -1
- package/terminalservice/terminalservice.esm.min.js +1 -1
- package/terminalservice/terminalservice.js +3 -3
- package/terminalservice/terminalservice.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +42 -36
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +8 -3
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +38 -37
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +12 -12
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +1 -1
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +13 -13
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +46 -40
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +2 -1
- package/toast/toast.esm.js +20 -15
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +44 -41
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +14 -9
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +3 -2
- package/togglebutton/togglebutton.esm.js +8 -3
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +13 -10
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +7 -7
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +1 -1
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +8 -8
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +65 -36
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +36 -8
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +64 -37
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +2 -0
- package/tree/tree.cjs.js +52 -51
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +14 -3
- package/tree/tree.esm.js +2 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +52 -52
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +3 -1
- package/treeselect/treeselect.cjs.js +50 -46
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +11 -3
- package/treeselect/treeselect.esm.js +10 -6
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +47 -47
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +1363 -312
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +10 -3
- package/treetable/treetable.esm.js +1267 -216
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +1362 -313
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +11 -10
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +2 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +11 -11
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +154 -33
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +17 -0
- package/utils/utils.esm.js +153 -33
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +155 -34
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +44 -34
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +29 -19
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +45 -35
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +2 -2
- package/core/core.cjs.js +0 -2987
- package/core/core.cjs.min.js +0 -1
- package/core/core.esm.js +0 -2963
- package/core/core.esm.min.js +0 -1
- package/core/package.json +0 -5
- package/util.d.ts +0 -1
package/mention/mention.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
this.primereact = this.primereact || {};
|
|
2
|
-
this.primereact.mention = (function (exports, React,
|
|
2
|
+
this.primereact.mention = (function (exports, React, utils, ripple, overlayservice, csstransition, portal, tooltip, PrimeReact) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
6
|
|
|
7
7
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
8
|
+
var PrimeReact__default = /*#__PURE__*/_interopDefaultLegacy(PrimeReact);
|
|
8
9
|
|
|
9
10
|
function _extends() {
|
|
10
11
|
_extends = Object.assign || function (target) {
|
|
@@ -193,7 +194,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
193
194
|
this.resize();
|
|
194
195
|
}
|
|
195
196
|
|
|
196
|
-
if (e.target.value.length > 0)
|
|
197
|
+
if (e.target.value.length > 0) utils.DomHandler.addClass(e.target, 'p-filled');else utils.DomHandler.removeClass(e.target, 'p-filled');
|
|
197
198
|
|
|
198
199
|
if (this.props.onInput) {
|
|
199
200
|
this.props.onInput(e);
|
|
@@ -204,7 +205,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
204
205
|
value: function resize(initial) {
|
|
205
206
|
var inputEl = this.elementRef && this.elementRef.current;
|
|
206
207
|
|
|
207
|
-
if (inputEl &&
|
|
208
|
+
if (inputEl && utils.DomHandler.isVisible(inputEl)) {
|
|
208
209
|
if (!this.cachedScrollHeight) {
|
|
209
210
|
this.cachedScrollHeight = inputEl.scrollHeight;
|
|
210
211
|
inputEl.style.overflow = "hidden";
|
|
@@ -280,7 +281,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
280
281
|
}, {
|
|
281
282
|
key: "renderTooltip",
|
|
282
283
|
value: function renderTooltip() {
|
|
283
|
-
this.tooltip =
|
|
284
|
+
this.tooltip = tooltip.tip({
|
|
284
285
|
target: this.elementRef.current,
|
|
285
286
|
content: this.props.tooltip,
|
|
286
287
|
options: this.props.tooltipOptions
|
|
@@ -289,13 +290,13 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
289
290
|
}, {
|
|
290
291
|
key: "render",
|
|
291
292
|
value: function render() {
|
|
292
|
-
var className =
|
|
293
|
+
var className = utils.classNames('p-inputtextarea p-inputtext p-component', {
|
|
293
294
|
'p-disabled': this.props.disabled,
|
|
294
295
|
'p-filled': this.isFilled(),
|
|
295
296
|
'p-inputtextarea-resizable': this.props.autoResize
|
|
296
297
|
}, this.props.className);
|
|
297
|
-
var textareaProps =
|
|
298
|
-
return /*#__PURE__*/React__default[
|
|
298
|
+
var textareaProps = utils.ObjectUtils.findDiffKeys(this.props, InputTextareaComponent.defaultProps);
|
|
299
|
+
return /*#__PURE__*/React__default["default"].createElement("textarea", _extends({
|
|
299
300
|
ref: this.elementRef
|
|
300
301
|
}, textareaProps, {
|
|
301
302
|
className: className,
|
|
@@ -318,8 +319,8 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
318
319
|
forwardRef: null
|
|
319
320
|
});
|
|
320
321
|
|
|
321
|
-
var InputTextarea = /*#__PURE__*/React__default[
|
|
322
|
-
return /*#__PURE__*/React__default[
|
|
322
|
+
var InputTextarea = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
323
|
+
return /*#__PURE__*/React__default["default"].createElement(InputTextareaComponent, _extends({
|
|
323
324
|
forwardRef: ref
|
|
324
325
|
}, props));
|
|
325
326
|
});
|
|
@@ -384,14 +385,14 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
384
385
|
}, {
|
|
385
386
|
key: "onOverlayEnter",
|
|
386
387
|
value: function onOverlayEnter() {
|
|
387
|
-
|
|
388
|
+
utils.ZIndexUtils.set('overlay', this.overlayRef.current, PrimeReact__default["default"].autoZIndex, PrimeReact__default["default"].zIndex['overlay']);
|
|
388
389
|
this.alignOverlay();
|
|
389
390
|
}
|
|
390
391
|
}, {
|
|
391
392
|
key: "onOverlayEntering",
|
|
392
393
|
value: function onOverlayEntering() {
|
|
393
394
|
if (this.props.autoHighlight && this.props.suggestions && this.props.suggestions.length) {
|
|
394
|
-
|
|
395
|
+
utils.DomHandler.addClass(this.list.firstChild, 'p-highlight');
|
|
395
396
|
}
|
|
396
397
|
}
|
|
397
398
|
}, {
|
|
@@ -412,7 +413,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
412
413
|
}, {
|
|
413
414
|
key: "onOverlayExited",
|
|
414
415
|
value: function onOverlayExited() {
|
|
415
|
-
|
|
416
|
+
utils.ZIndexUtils.clear(this.overlayRef.current);
|
|
416
417
|
this.props.onHide && this.props.onHide();
|
|
417
418
|
}
|
|
418
419
|
}, {
|
|
@@ -422,7 +423,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
422
423
|
key = _this$state$trigger.key,
|
|
423
424
|
index = _this$state$trigger.index;
|
|
424
425
|
var value = this.inputRef.current.value;
|
|
425
|
-
var position =
|
|
426
|
+
var position = utils.DomHandler.getCursorOffset(this.inputRef.current, value.substring(0, index - 1), value.substring(index), key);
|
|
426
427
|
this.overlayRef.current.style.transformOrigin = 'top';
|
|
427
428
|
this.overlayRef.current.style.left = "calc(".concat(position.left, "px + 1rem)");
|
|
428
429
|
this.overlayRef.current.style.top = "calc(".concat(position.top, "px + 1.2rem)");
|
|
@@ -430,7 +431,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
430
431
|
}, {
|
|
431
432
|
key: "onPanelClick",
|
|
432
433
|
value: function onPanelClick(event) {
|
|
433
|
-
|
|
434
|
+
overlayservice.OverlayService.emit('overlay-click', {
|
|
434
435
|
originalEvent: event,
|
|
435
436
|
target: this.container
|
|
436
437
|
});
|
|
@@ -569,7 +570,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
569
570
|
var field = Array.isArray(this.props.field) ? this.props.field[this.props.trigger.findIndex(function (f) {
|
|
570
571
|
return f === _this3.state.trigger.key;
|
|
571
572
|
})] : this.props.field;
|
|
572
|
-
return field ?
|
|
573
|
+
return field ? utils.ObjectUtils.resolveFieldData(value, field) : value;
|
|
573
574
|
}
|
|
574
575
|
|
|
575
576
|
return '';
|
|
@@ -608,7 +609,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
608
609
|
key: "onInput",
|
|
609
610
|
value: function onInput(event) {
|
|
610
611
|
this.props.onInput && this.props.onInput(event);
|
|
611
|
-
if (event.target.value.length > 0)
|
|
612
|
+
if (event.target.value.length > 0) utils.DomHandler.addClass(this.container, 'p-inputwrapper-filled');else utils.DomHandler.removeClass(this.container, 'p-inputwrapper-filled');
|
|
612
613
|
}
|
|
613
614
|
}, {
|
|
614
615
|
key: "onKeyUp",
|
|
@@ -627,7 +628,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
627
628
|
key: "onKeyDown",
|
|
628
629
|
value: function onKeyDown(event) {
|
|
629
630
|
if (this.state.overlayVisible) {
|
|
630
|
-
var highlightItem =
|
|
631
|
+
var highlightItem = utils.DomHandler.findSingle(this.overlayRef.current, 'li.p-highlight');
|
|
631
632
|
|
|
632
633
|
switch (event.which) {
|
|
633
634
|
//down
|
|
@@ -636,15 +637,15 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
636
637
|
var nextElement = highlightItem.nextElementSibling;
|
|
637
638
|
|
|
638
639
|
if (nextElement) {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
640
|
+
utils.DomHandler.addClass(nextElement, 'p-highlight');
|
|
641
|
+
utils.DomHandler.removeClass(highlightItem, 'p-highlight');
|
|
642
|
+
utils.DomHandler.scrollInView(this.overlayRef.current, nextElement);
|
|
642
643
|
}
|
|
643
644
|
} else {
|
|
644
|
-
highlightItem =
|
|
645
|
+
highlightItem = utils.DomHandler.findSingle(this.overlayRef.current, 'li');
|
|
645
646
|
|
|
646
647
|
if (highlightItem) {
|
|
647
|
-
|
|
648
|
+
utils.DomHandler.addClass(highlightItem, 'p-highlight');
|
|
648
649
|
}
|
|
649
650
|
}
|
|
650
651
|
|
|
@@ -657,9 +658,9 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
657
658
|
var previousElement = highlightItem.previousElementSibling;
|
|
658
659
|
|
|
659
660
|
if (previousElement) {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
661
|
+
utils.DomHandler.addClass(previousElement, 'p-highlight');
|
|
662
|
+
utils.DomHandler.removeClass(highlightItem, 'p-highlight');
|
|
663
|
+
utils.DomHandler.scrollInView(this.overlayRef.current, previousElement);
|
|
663
664
|
}
|
|
664
665
|
}
|
|
665
666
|
|
|
@@ -682,7 +683,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
682
683
|
|
|
683
684
|
case 13:
|
|
684
685
|
if (highlightItem) {
|
|
685
|
-
this.selectItem(event, this.props.suggestions[
|
|
686
|
+
this.selectItem(event, this.props.suggestions[utils.DomHandler.index(highlightItem)]);
|
|
686
687
|
}
|
|
687
688
|
|
|
688
689
|
event.preventDefault();
|
|
@@ -730,7 +731,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
730
731
|
var _this7 = this;
|
|
731
732
|
|
|
732
733
|
if (!this.scrollHandler) {
|
|
733
|
-
this.scrollHandler = new
|
|
734
|
+
this.scrollHandler = new utils.ConnectedOverlayScrollHandler(this.container, function () {
|
|
734
735
|
if (_this7.state.overlayVisible) {
|
|
735
736
|
_this7.hideOverlay();
|
|
736
737
|
}
|
|
@@ -753,7 +754,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
753
754
|
|
|
754
755
|
if (!this.resizeListener) {
|
|
755
756
|
this.resizeListener = function () {
|
|
756
|
-
if (_this8.state.overlayVisible && !
|
|
757
|
+
if (_this8.state.overlayVisible && !utils.DomHandler.isTouchDevice()) {
|
|
757
758
|
_this8.hideOverlay();
|
|
758
759
|
}
|
|
759
760
|
};
|
|
@@ -812,8 +813,8 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
812
813
|
});
|
|
813
814
|
}
|
|
814
815
|
|
|
815
|
-
if (!this.isFilled() &&
|
|
816
|
-
|
|
816
|
+
if (!this.isFilled() && utils.DomHandler.hasClass(this.container, 'p-inputwrapper-filled')) {
|
|
817
|
+
utils.DomHandler.removeClass(this.container, 'p-inputwrapper-filled');
|
|
817
818
|
}
|
|
818
819
|
}
|
|
819
820
|
}, {
|
|
@@ -827,24 +828,24 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
827
828
|
this.scrollHandler = null;
|
|
828
829
|
}
|
|
829
830
|
|
|
830
|
-
|
|
831
|
+
utils.ZIndexUtils.clear(this.overlayRef.current);
|
|
831
832
|
}
|
|
832
833
|
}, {
|
|
833
834
|
key: "renderItem",
|
|
834
835
|
value: function renderItem(suggestion, index) {
|
|
835
836
|
var _this9 = this;
|
|
836
837
|
|
|
837
|
-
var content = this.props.itemTemplate ?
|
|
838
|
+
var content = this.props.itemTemplate ? utils.ObjectUtils.getJSXElement(this.props.itemTemplate, suggestion, {
|
|
838
839
|
trigger: this.state.trigger ? this.state.trigger.key : '',
|
|
839
840
|
index: index
|
|
840
841
|
}) : this.formatValue(suggestion);
|
|
841
|
-
return /*#__PURE__*/React__default[
|
|
842
|
+
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
842
843
|
key: index + '_item',
|
|
843
844
|
className: "p-mention-item",
|
|
844
845
|
onClick: function onClick(e) {
|
|
845
846
|
return _this9.onItemClick(e, suggestion);
|
|
846
847
|
}
|
|
847
|
-
}, content, /*#__PURE__*/React__default[
|
|
848
|
+
}, content, /*#__PURE__*/React__default["default"].createElement(ripple.Ripple, null));
|
|
848
849
|
}
|
|
849
850
|
}, {
|
|
850
851
|
key: "renderList",
|
|
@@ -855,7 +856,7 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
855
856
|
var items = this.props.suggestions.map(function (suggestion, index) {
|
|
856
857
|
return _this10.renderItem(suggestion, index);
|
|
857
858
|
});
|
|
858
|
-
return /*#__PURE__*/React__default[
|
|
859
|
+
return /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
859
860
|
ref: function ref(el) {
|
|
860
861
|
return _this10.list = el;
|
|
861
862
|
},
|
|
@@ -868,16 +869,16 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
868
869
|
}, {
|
|
869
870
|
key: "renderPanel",
|
|
870
871
|
value: function renderPanel() {
|
|
871
|
-
var panelClassName =
|
|
872
|
+
var panelClassName = utils.classNames('p-mention-panel p-component', this.props.panelClassName);
|
|
872
873
|
|
|
873
874
|
var panelStyle = _objectSpread({
|
|
874
875
|
maxHeight: this.props.scrollHeight
|
|
875
876
|
}, this.props.panelStyle);
|
|
876
877
|
|
|
877
|
-
var header =
|
|
878
|
-
var footer =
|
|
878
|
+
var header = utils.ObjectUtils.getJSXElement(this.props.headerTemplate, this.props);
|
|
879
|
+
var footer = utils.ObjectUtils.getJSXElement(this.props.footerTemplate, this.props);
|
|
879
880
|
var list = this.renderList();
|
|
880
|
-
var panel = /*#__PURE__*/React__default[
|
|
881
|
+
var panel = /*#__PURE__*/React__default["default"].createElement(csstransition.CSSTransition, {
|
|
881
882
|
nodeRef: this.overlayRef,
|
|
882
883
|
classNames: "p-connected-overlay",
|
|
883
884
|
in: this.state.overlayVisible,
|
|
@@ -892,13 +893,13 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
892
893
|
onEntered: this.onOverlayEntered,
|
|
893
894
|
onExit: this.onOverlayExit,
|
|
894
895
|
onExited: this.onOverlayExited
|
|
895
|
-
}, /*#__PURE__*/React__default[
|
|
896
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
896
897
|
ref: this.overlayRef,
|
|
897
898
|
className: panelClassName,
|
|
898
899
|
style: panelStyle,
|
|
899
900
|
onClick: this.onPanelClick
|
|
900
901
|
}, header, list, footer));
|
|
901
|
-
return /*#__PURE__*/React__default[
|
|
902
|
+
return /*#__PURE__*/React__default["default"].createElement(portal.Portal, {
|
|
902
903
|
element: panel,
|
|
903
904
|
appendTo: "self"
|
|
904
905
|
});
|
|
@@ -908,21 +909,21 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
908
909
|
value: function render() {
|
|
909
910
|
var _this11 = this;
|
|
910
911
|
|
|
911
|
-
var containerClassName =
|
|
912
|
+
var containerClassName = utils.classNames('p-mention p-component p-inputwrapper', {
|
|
912
913
|
'p-inputwrapper-filled': this.isFilled(),
|
|
913
914
|
'p-inputwrapper-focus': this.state.focused
|
|
914
915
|
}, this.props.className);
|
|
915
|
-
var inputClassName =
|
|
916
|
-
var inputProps =
|
|
916
|
+
var inputClassName = utils.classNames('p-mention-input', this.props.inputClassName);
|
|
917
|
+
var inputProps = utils.ObjectUtils.findDiffKeys(this.props, Mention.defaultProps);
|
|
917
918
|
var panel = this.renderPanel();
|
|
918
|
-
return /*#__PURE__*/React__default[
|
|
919
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
919
920
|
ref: function ref(el) {
|
|
920
921
|
return _this11.container = el;
|
|
921
922
|
},
|
|
922
923
|
id: this.props.id,
|
|
923
924
|
className: containerClassName,
|
|
924
925
|
style: this.props.style
|
|
925
|
-
}, /*#__PURE__*/React__default[
|
|
926
|
+
}, /*#__PURE__*/React__default["default"].createElement(InputTextarea, _extends({
|
|
926
927
|
ref: this.inputRef,
|
|
927
928
|
id: this.props.inputId
|
|
928
929
|
}, inputProps, {
|
|
@@ -977,4 +978,4 @@ this.primereact.mention = (function (exports, React, core) {
|
|
|
977
978
|
|
|
978
979
|
return exports;
|
|
979
980
|
|
|
980
|
-
}({}, React, primereact.
|
|
981
|
+
})({}, React, primereact.utils, primereact.ripple, primereact.overlayservice, primereact.csstransition, primereact.portal, primereact.tooltip, primereact.api);
|
package/mention/mention.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.mention=function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var b=function(e){c(h,e);var r,l,p=(r=h,l=m(),function(){var e,t=d(r);if(l){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function h(e){var n;return s(this,h),(n=p.call(this,e)).onFocus=n.onFocus.bind(u(n)),n.onBlur=n.onBlur.bind(u(n)),n.onKeyUp=n.onKeyUp.bind(u(n)),n.onInput=n.onInput.bind(u(n)),n.elementRef=t.createRef(n.props.forwardRef),n}return a(h,[{key:"onFocus",value:function(e){this.props.autoResize&&this.resize(),this.props.onFocus&&this.props.onFocus(e)}},{key:"onBlur",value:function(e){this.props.autoResize&&this.resize(),this.props.onBlur&&this.props.onBlur(e)}},{key:"onKeyUp",value:function(e){this.props.autoResize&&this.resize(),this.props.onKeyUp&&this.props.onKeyUp(e)}},{key:"onInput",value:function(e){this.props.autoResize&&this.resize(),e.target.value.length>0?n.DomHandler.addClass(e.target,"p-filled"):n.DomHandler.removeClass(e.target,"p-filled"),this.props.onInput&&this.props.onInput(e)}},{key:"resize",value:function(e){var t=this.elementRef&&this.elementRef.current;t&&n.DomHandler.isVisible(t)&&(this.cachedScrollHeight||(this.cachedScrollHeight=t.scrollHeight,t.style.overflow="hidden"),(this.cachedScrollHeight!==t.scrollHeight||e)&&(t.style.height="",t.style.height=t.scrollHeight+"px",parseFloat(t.style.height)>=parseFloat(t.style.maxHeight)?(t.style.overflowY="scroll",t.style.height=t.style.maxHeight):t.style.overflow="hidden",this.cachedScrollHeight=t.scrollHeight))}},{key:"isFilled",value:function(){return null!=this.props.value&&this.props.value.toString().length>0||null!=this.props.defaultValue&&this.props.defaultValue.toString().length>0||this.elementRef&&this.elementRef.current&&this.elementRef.current.value.toString().length>0}},{key:"updateForwardRef",value:function(){var e=this.props.forwardRef;e&&("function"==typeof e?e(this.elementRef.current):e.current=this.elementRef.current)}},{key:"componentDidMount",value:function(){this.updateForwardRef(),this.props.tooltip&&this.renderTooltip(),this.props.autoResize&&this.resize(!0)}},{key:"componentDidUpdate",value:function(e){e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(g({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.props.autoResize&&this.resize(!0)}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=n.tip({target:this.elementRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var e=n.classNames("p-inputtextarea p-inputtext p-component",{"p-disabled":this.props.disabled,"p-filled":this.isFilled(),"p-inputtextarea-resizable":this.props.autoResize},this.props.className),t=n.ObjectUtils.findDiffKeys(this.props,h.defaultProps);return i.default.createElement("textarea",o({ref:this.elementRef},t,{className:e,onFocus:this.onFocus,onBlur:this.onBlur,onKeyUp:this.onKeyUp,onInput:this.onInput}))}}]),h}(t.Component);y(b,"defaultProps",{autoResize:!1,tooltip:null,tooltipOptions:null,onInput:null,forwardRef:null});var O=i.default.forwardRef((function(e,t){return i.default.createElement(b,o({forwardRef:t},e))}));function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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 S=function(e){c(h,e);var r,l,p=(r=h,l=w(),function(){var e,t=d(r);if(l){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function h(e){var n;return s(this,h),(n=p.call(this,e)).state={overlayVisible:!1,focused:!1,searching:!1,trigger:null},n.onOverlayEnter=n.onOverlayEnter.bind(u(n)),n.onOverlayEntering=n.onOverlayEntering.bind(u(n)),n.onOverlayEntered=n.onOverlayEntered.bind(u(n)),n.onOverlayExit=n.onOverlayExit.bind(u(n)),n.onOverlayExited=n.onOverlayExited.bind(u(n)),n.onFocus=n.onFocus.bind(u(n)),n.onBlur=n.onBlur.bind(u(n)),n.onKeyDown=n.onKeyDown.bind(u(n)),n.onChange=n.onChange.bind(u(n)),n.onInput=n.onInput.bind(u(n)),n.onKeyUp=n.onKeyUp.bind(u(n)),n.onPanelClick=n.onPanelClick.bind(u(n)),n.overlayRef=t.createRef(),n.inputRef=t.createRef(n.props.inputRef),n}return a(h,[{key:"showOverlay",value:function(){this.setState({overlayVisible:!0})}},{key:"hideOverlay",value:function(){this.setState({overlayVisible:!1,searching:!1,trigger:null})}},{key:"onOverlayEnter",value:function(){n.ZIndexUtils.set("overlay",this.overlayRef.current),this.alignOverlay()}},{key:"onOverlayEntering",value:function(){this.props.autoHighlight&&this.props.suggestions&&this.props.suggestions.length&&n.DomHandler.addClass(this.list.firstChild,"p-highlight")}},{key:"onOverlayEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onOverlayExited",value:function(){n.ZIndexUtils.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){var e=this.state.trigger,t=e.key,r=e.index,i=this.inputRef.current.value,o=n.DomHandler.getCursorOffset(this.inputRef.current,i.substring(0,r-1),i.substring(r),t);this.overlayRef.current.style.transformOrigin="top",this.overlayRef.current.style.left="calc(".concat(o.left,"px + 1rem)"),this.overlayRef.current.style.top="calc(".concat(o.top,"px + 1.2rem)")}},{key:"onPanelClick",value:function(e){n.OverlayService.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"getTrigger",value:function(e,t,n){if(!this.state.trigger){var r=Array.isArray(this.props.trigger)?this.props.trigger.find((function(e){return e===t})):this.props.trigger===t?this.props.trigger:null;if(r)return{key:r,index:n};var i=e.substring(0,n).lastIndexOf(" "),o=this.getLatestTrigger(e,n);if(o.index>i)return o}return this.state.trigger}},{key:"getLatestTrigger",value:function(e,t){if(Array.isArray(this.props.trigger)){var n={};return this.props.trigger.forEach((function(r){var i=e.substring(0,t).lastIndexOf(r);-1!==i&&(i>n.index||!n.index)&&(n={key:r,index:-1!==i?i+1:-1})})),n}var r=e.substring(0,t).lastIndexOf(this.props.trigger);return{key:this.props.trigger,index:-1!==r?r+1:-1}}},{key:"onSearch",value:function(e){var t=this;this.timeout&&clearTimeout(this.timeout);var n=e.target,r=n.value,i=n.selectionStart,o=r.substring(i-1,i);if(" "!==o){var s=this.getTrigger(r,o,i);if(s&&s.index>-1){var l=r.substring(s.index,i);this.timeout=setTimeout((function(){t.search(e,l,s)}),this.props.delay)}}else this.hideOverlay()}},{key:"search",value:function(e,t,n){this.props.onSearch&&(this.setState({searching:!0,trigger:n}),this.props.onSearch({originalEvent:e,trigger:n.key,query:t}))}},{key:"selectItem",value:function(e,t){var n=this.inputRef.current.value,r=e.target.selectionStart,i=this.state.trigger,o=n.indexOf(" ",i.index),s=n.substring(i.index,o>-1?o:r),l=this.formatValue(t).replace(/\s+/g,"");if(s.trim()!==l){for(var a=0;a<l.length;){var u=l.charAt(a),p=s.charAt(a);if(u!==p&&" "!==p)break;a++}var c=n.substring(0,i.index),h=n.substring(i.index+a);this.inputRef.current.value="".concat(c).concat(l," ").concat(h),this.props.onChange&&this.props.onChange(e)}var f=i.index+l.length+1;this.inputRef.current.setSelectionRange(f,f),this.hideOverlay(),this.props.onSelect&&this.props.onSelect({originalEvent:e,suggestion:t})}},{key:"formatValue",value:function(e){var t=this;if(e){var r=Array.isArray(this.props.field)?this.props.field[this.props.trigger.findIndex((function(e){return e===t.state.trigger.key}))]:this.props.field;return r?n.ObjectUtils.resolveFieldData(e,r):e}return""}},{key:"onItemClick",value:function(e,t){this.inputRef.current.focus(),this.selectItem(e,t)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.setState({focused:!0},(function(){t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onBlur",value:function(e){var t=this;e.persist(),this.setState({focused:!1},(function(){t.props.onBlur&&t.props.onBlur(e)}))}},{key:"onInput",value:function(e){this.props.onInput&&this.props.onInput(e),e.target.value.length>0?n.DomHandler.addClass(this.container,"p-inputwrapper-filled"):n.DomHandler.removeClass(this.container,"p-inputwrapper-filled")}},{key:"onKeyUp",value:function(e){37!==e.which&&39!==e.which||this.onSearch(e)}},{key:"onChange",value:function(e){this.props.onChange&&this.props.onChange(e),this.onSearch(e)}},{key:"onKeyDown",value:function(e){if(this.state.overlayVisible){var t=n.DomHandler.findSingle(this.overlayRef.current,"li.p-highlight");switch(e.which){case 40:if(t){var r=t.nextElementSibling;r&&(n.DomHandler.addClass(r,"p-highlight"),n.DomHandler.removeClass(t,"p-highlight"),n.DomHandler.scrollInView(this.overlayRef.current,r))}else(t=n.DomHandler.findSingle(this.overlayRef.current,"li"))&&n.DomHandler.addClass(t,"p-highlight");e.preventDefault();break;case 38:if(t){var i=t.previousElementSibling;i&&(n.DomHandler.addClass(i,"p-highlight"),n.DomHandler.removeClass(t,"p-highlight"),n.DomHandler.scrollInView(this.overlayRef.current,i))}e.preventDefault();break;case 8:var o=e.target,s=o.selectionStart;o.value.substring(s-1,s)===this.state.trigger.key&&this.hideOverlay();break;case 13:t&&this.selectItem(e,this.props.suggestions[n.DomHandler.index(t)]),e.preventDefault();break;case 27:this.hideOverlay(),e.preventDefault()}}}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){3!==t.which&&e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hideOverlay()},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.container,(function(){e.state.overlayVisible&&e.hideOverlay()}))),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.hideOverlay()},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.overlayRef&&this.overlayRef.current&&!this.overlayRef.current.contains(e.target)}},{key:"isFilled",value:function(){return null!=this.props.value&&this.props.value.toString().length>0||null!=this.props.defaultValue&&this.props.defaultValue.toString().length>0||this.inputRef&&this.inputRef.current&&this.inputRef.current.value.toString().length>0}},{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()}},{key:"componentDidUpdate",value:function(e){e.suggestions!==this.props.suggestions&&this.state.searching&&(this.props.suggestions&&this.props.suggestions.length?this.showOverlay():this.hideOverlay(),this.state.overlayVisible&&this.alignOverlay(),this.setState({searching:!1})),!this.isFilled()&&n.DomHandler.hasClass(this.container,"p-inputwrapper-filled")&&n.DomHandler.removeClass(this.container,"p-inputwrapper-filled")}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderItem",value:function(e,t){var r=this,o=this.props.itemTemplate?n.ObjectUtils.getJSXElement(this.props.itemTemplate,e,{trigger:this.state.trigger?this.state.trigger.key:"",index:t}):this.formatValue(e);return i.default.createElement("li",{key:t+"_item",className:"p-mention-item",onClick:function(t){return r.onItemClick(t,e)}},o,i.default.createElement(n.Ripple,null))}},{key:"renderList",value:function(){var e=this;if(this.props.suggestions){var t=this.props.suggestions.map((function(t,n){return e.renderItem(t,n)}));return i.default.createElement("ul",{ref:function(t){return e.list=t},className:"p-mention-items"},t)}return null}},{key:"renderPanel",value:function(){var e=n.classNames("p-mention-panel p-component",this.props.panelClassName),t=R({maxHeight:this.props.scrollHeight},this.props.panelStyle),r=n.ObjectUtils.getJSXElement(this.props.headerTemplate,this.props),o=n.ObjectUtils.getJSXElement(this.props.footerTemplate,this.props),s=this.renderList();return i.default.createElement(n.Portal,{element:i.default.createElement(n.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,onEntering:this.onOverlayEntering,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited},i.default.createElement("div",{ref:this.overlayRef,className:e,style:t,onClick:this.onPanelClick},r,s,o)),appendTo:"self"})}},{key:"render",value:function(){var e=this,t=n.classNames("p-mention p-component p-inputwrapper",{"p-inputwrapper-filled":this.isFilled(),"p-inputwrapper-focus":this.state.focused},this.props.className),r=n.classNames("p-mention-input",this.props.inputClassName),s=n.ObjectUtils.findDiffKeys(this.props,h.defaultProps),l=this.renderPanel();return i.default.createElement("div",{ref:function(t){return e.container=t},id:this.props.id,className:t,style:this.props.style},i.default.createElement(O,o({ref:this.inputRef,id:this.props.inputId},s,{className:r,style:this.props.inputStyle,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onInput:this.onInput,onKeyUp:this.onKeyUp,onChange:this.onChange})),l)}}]),h}(t.Component);return y(S,"defaultProps",{id:null,inputId:null,inputRef:null,style:null,className:null,trigger:"@",suggestions:null,field:null,inputStyle:null,inputClassName:null,panelClassName:null,panelStyle:null,scrollHeight:"200px",autoHighlight:!0,delay:0,headerTemplate:null,footerTemplate:null,itemTemplate:null,transitionOptions:null,onChange:null,onInput:null,onSearch:null,onSelect:null,onFocus:null,onBlur:null,onShow:null,onHide:null}),e.Mention=S,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.mention=function(e,t,n,r,i,o,s,l,a){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=u(t),c=u(a);function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(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&&g(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 O(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 v(e)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function R(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=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var C=function(e){m(s,e);var r,i,o=(r=s,i=E(),function(){var e,t=k(r);if(i){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return O(this,e)});function s(e){var n;return f(this,s),(n=o.call(this,e)).onFocus=n.onFocus.bind(v(n)),n.onBlur=n.onBlur.bind(v(n)),n.onKeyUp=n.onKeyUp.bind(v(n)),n.onInput=n.onInput.bind(v(n)),n.elementRef=t.createRef(n.props.forwardRef),n}return y(s,[{key:"onFocus",value:function(e){this.props.autoResize&&this.resize(),this.props.onFocus&&this.props.onFocus(e)}},{key:"onBlur",value:function(e){this.props.autoResize&&this.resize(),this.props.onBlur&&this.props.onBlur(e)}},{key:"onKeyUp",value:function(e){this.props.autoResize&&this.resize(),this.props.onKeyUp&&this.props.onKeyUp(e)}},{key:"onInput",value:function(e){this.props.autoResize&&this.resize(),e.target.value.length>0?n.DomHandler.addClass(e.target,"p-filled"):n.DomHandler.removeClass(e.target,"p-filled"),this.props.onInput&&this.props.onInput(e)}},{key:"resize",value:function(e){var t=this.elementRef&&this.elementRef.current;t&&n.DomHandler.isVisible(t)&&(this.cachedScrollHeight||(this.cachedScrollHeight=t.scrollHeight,t.style.overflow="hidden"),(this.cachedScrollHeight!==t.scrollHeight||e)&&(t.style.height="",t.style.height=t.scrollHeight+"px",parseFloat(t.style.height)>=parseFloat(t.style.maxHeight)?(t.style.overflowY="scroll",t.style.height=t.style.maxHeight):t.style.overflow="hidden",this.cachedScrollHeight=t.scrollHeight))}},{key:"isFilled",value:function(){return null!=this.props.value&&this.props.value.toString().length>0||null!=this.props.defaultValue&&this.props.defaultValue.toString().length>0||this.elementRef&&this.elementRef.current&&this.elementRef.current.value.toString().length>0}},{key:"updateForwardRef",value:function(){var e=this.props.forwardRef;e&&("function"==typeof e?e(this.elementRef.current):e.current=this.elementRef.current)}},{key:"componentDidMount",value:function(){this.updateForwardRef(),this.props.tooltip&&this.renderTooltip(),this.props.autoResize&&this.resize(!0)}},{key:"componentDidUpdate",value:function(e){e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(S({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.props.autoResize&&this.resize(!0)}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=l.tip({target:this.elementRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var e=n.classNames("p-inputtextarea p-inputtext p-component",{"p-disabled":this.props.disabled,"p-filled":this.isFilled(),"p-inputtextarea-resizable":this.props.autoResize},this.props.className),t=n.ObjectUtils.findDiffKeys(this.props,s.defaultProps);return p.default.createElement("textarea",h({ref:this.elementRef},t,{className:e,onFocus:this.onFocus,onBlur:this.onBlur,onKeyUp:this.onKeyUp,onInput:this.onInput}))}}]),s}(t.Component);R(C,"defaultProps",{autoResize:!1,tooltip:null,tooltipOptions:null,onInput:null,forwardRef:null});var x=p.default.forwardRef((function(e,t){return p.default.createElement(C,h({forwardRef:t},e))}));function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function j(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var I=function(e){m(d,e);var l,a,u=(l=d,a=j(),function(){var e,t=k(l);if(a){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return O(this,e)});function d(e){var n;return f(this,d),(n=u.call(this,e)).state={overlayVisible:!1,focused:!1,searching:!1,trigger:null},n.onOverlayEnter=n.onOverlayEnter.bind(v(n)),n.onOverlayEntering=n.onOverlayEntering.bind(v(n)),n.onOverlayEntered=n.onOverlayEntered.bind(v(n)),n.onOverlayExit=n.onOverlayExit.bind(v(n)),n.onOverlayExited=n.onOverlayExited.bind(v(n)),n.onFocus=n.onFocus.bind(v(n)),n.onBlur=n.onBlur.bind(v(n)),n.onKeyDown=n.onKeyDown.bind(v(n)),n.onChange=n.onChange.bind(v(n)),n.onInput=n.onInput.bind(v(n)),n.onKeyUp=n.onKeyUp.bind(v(n)),n.onPanelClick=n.onPanelClick.bind(v(n)),n.overlayRef=t.createRef(),n.inputRef=t.createRef(n.props.inputRef),n}return y(d,[{key:"showOverlay",value:function(){this.setState({overlayVisible:!0})}},{key:"hideOverlay",value:function(){this.setState({overlayVisible:!1,searching:!1,trigger:null})}},{key:"onOverlayEnter",value:function(){n.ZIndexUtils.set("overlay",this.overlayRef.current,c.default.autoZIndex,c.default.zIndex.overlay),this.alignOverlay()}},{key:"onOverlayEntering",value:function(){this.props.autoHighlight&&this.props.suggestions&&this.props.suggestions.length&&n.DomHandler.addClass(this.list.firstChild,"p-highlight")}},{key:"onOverlayEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.props.onShow&&this.props.onShow()}},{key:"onOverlayExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onOverlayExited",value:function(){n.ZIndexUtils.clear(this.overlayRef.current),this.props.onHide&&this.props.onHide()}},{key:"alignOverlay",value:function(){var e=this.state.trigger,t=e.key,r=e.index,i=this.inputRef.current.value,o=n.DomHandler.getCursorOffset(this.inputRef.current,i.substring(0,r-1),i.substring(r),t);this.overlayRef.current.style.transformOrigin="top",this.overlayRef.current.style.left="calc(".concat(o.left,"px + 1rem)"),this.overlayRef.current.style.top="calc(".concat(o.top,"px + 1.2rem)")}},{key:"onPanelClick",value:function(e){i.OverlayService.emit("overlay-click",{originalEvent:e,target:this.container})}},{key:"getTrigger",value:function(e,t,n){if(!this.state.trigger){var r=Array.isArray(this.props.trigger)?this.props.trigger.find((function(e){return e===t})):this.props.trigger===t?this.props.trigger:null;if(r)return{key:r,index:n};var i=e.substring(0,n).lastIndexOf(" "),o=this.getLatestTrigger(e,n);if(o.index>i)return o}return this.state.trigger}},{key:"getLatestTrigger",value:function(e,t){if(Array.isArray(this.props.trigger)){var n={};return this.props.trigger.forEach((function(r){var i=e.substring(0,t).lastIndexOf(r);-1!==i&&(i>n.index||!n.index)&&(n={key:r,index:-1!==i?i+1:-1})})),n}var r=e.substring(0,t).lastIndexOf(this.props.trigger);return{key:this.props.trigger,index:-1!==r?r+1:-1}}},{key:"onSearch",value:function(e){var t=this;this.timeout&&clearTimeout(this.timeout);var n=e.target,r=n.value,i=n.selectionStart,o=r.substring(i-1,i);if(" "!==o){var s=this.getTrigger(r,o,i);if(s&&s.index>-1){var l=r.substring(s.index,i);this.timeout=setTimeout((function(){t.search(e,l,s)}),this.props.delay)}}else this.hideOverlay()}},{key:"search",value:function(e,t,n){this.props.onSearch&&(this.setState({searching:!0,trigger:n}),this.props.onSearch({originalEvent:e,trigger:n.key,query:t}))}},{key:"selectItem",value:function(e,t){var n=this.inputRef.current.value,r=e.target.selectionStart,i=this.state.trigger,o=n.indexOf(" ",i.index),s=n.substring(i.index,o>-1?o:r),l=this.formatValue(t).replace(/\s+/g,"");if(s.trim()!==l){for(var a=0;a<l.length;){var u=l.charAt(a),p=s.charAt(a);if(u!==p&&" "!==p)break;a++}var c=n.substring(0,i.index),h=n.substring(i.index+a);this.inputRef.current.value="".concat(c).concat(l," ").concat(h),this.props.onChange&&this.props.onChange(e)}var f=i.index+l.length+1;this.inputRef.current.setSelectionRange(f,f),this.hideOverlay(),this.props.onSelect&&this.props.onSelect({originalEvent:e,suggestion:t})}},{key:"formatValue",value:function(e){var t=this;if(e){var r=Array.isArray(this.props.field)?this.props.field[this.props.trigger.findIndex((function(e){return e===t.state.trigger.key}))]:this.props.field;return r?n.ObjectUtils.resolveFieldData(e,r):e}return""}},{key:"onItemClick",value:function(e,t){this.inputRef.current.focus(),this.selectItem(e,t)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.setState({focused:!0},(function(){t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onBlur",value:function(e){var t=this;e.persist(),this.setState({focused:!1},(function(){t.props.onBlur&&t.props.onBlur(e)}))}},{key:"onInput",value:function(e){this.props.onInput&&this.props.onInput(e),e.target.value.length>0?n.DomHandler.addClass(this.container,"p-inputwrapper-filled"):n.DomHandler.removeClass(this.container,"p-inputwrapper-filled")}},{key:"onKeyUp",value:function(e){37!==e.which&&39!==e.which||this.onSearch(e)}},{key:"onChange",value:function(e){this.props.onChange&&this.props.onChange(e),this.onSearch(e)}},{key:"onKeyDown",value:function(e){if(this.state.overlayVisible){var t=n.DomHandler.findSingle(this.overlayRef.current,"li.p-highlight");switch(e.which){case 40:if(t){var r=t.nextElementSibling;r&&(n.DomHandler.addClass(r,"p-highlight"),n.DomHandler.removeClass(t,"p-highlight"),n.DomHandler.scrollInView(this.overlayRef.current,r))}else(t=n.DomHandler.findSingle(this.overlayRef.current,"li"))&&n.DomHandler.addClass(t,"p-highlight");e.preventDefault();break;case 38:if(t){var i=t.previousElementSibling;i&&(n.DomHandler.addClass(i,"p-highlight"),n.DomHandler.removeClass(t,"p-highlight"),n.DomHandler.scrollInView(this.overlayRef.current,i))}e.preventDefault();break;case 8:var o=e.target,s=o.selectionStart;o.value.substring(s-1,s)===this.state.trigger.key&&this.hideOverlay();break;case 13:t&&this.selectItem(e,this.props.suggestions[n.DomHandler.index(t)]),e.preventDefault();break;case 27:this.hideOverlay(),e.preventDefault()}}}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){3!==t.which&&e.state.overlayVisible&&e.isOutsideClicked(t)&&e.hideOverlay()},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.container,(function(){e.state.overlayVisible&&e.hideOverlay()}))),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.hideOverlay()},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.overlayRef&&this.overlayRef.current&&!this.overlayRef.current.contains(e.target)}},{key:"isFilled",value:function(){return null!=this.props.value&&this.props.value.toString().length>0||null!=this.props.defaultValue&&this.props.defaultValue.toString().length>0||this.inputRef&&this.inputRef.current&&this.inputRef.current.value.toString().length>0}},{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()}},{key:"componentDidUpdate",value:function(e){e.suggestions!==this.props.suggestions&&this.state.searching&&(this.props.suggestions&&this.props.suggestions.length?this.showOverlay():this.hideOverlay(),this.state.overlayVisible&&this.alignOverlay(),this.setState({searching:!1})),!this.isFilled()&&n.DomHandler.hasClass(this.container,"p-inputwrapper-filled")&&n.DomHandler.removeClass(this.container,"p-inputwrapper-filled")}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderItem",value:function(e,t){var i=this,o=this.props.itemTemplate?n.ObjectUtils.getJSXElement(this.props.itemTemplate,e,{trigger:this.state.trigger?this.state.trigger.key:"",index:t}):this.formatValue(e);return p.default.createElement("li",{key:t+"_item",className:"p-mention-item",onClick:function(t){return i.onItemClick(t,e)}},o,p.default.createElement(r.Ripple,null))}},{key:"renderList",value:function(){var e=this;if(this.props.suggestions){var t=this.props.suggestions.map((function(t,n){return e.renderItem(t,n)}));return p.default.createElement("ul",{ref:function(t){return e.list=t},className:"p-mention-items"},t)}return null}},{key:"renderPanel",value:function(){var e=n.classNames("p-mention-panel p-component",this.props.panelClassName),t=H({maxHeight:this.props.scrollHeight},this.props.panelStyle),r=n.ObjectUtils.getJSXElement(this.props.headerTemplate,this.props),i=n.ObjectUtils.getJSXElement(this.props.footerTemplate,this.props),l=this.renderList();return p.default.createElement(s.Portal,{element:p.default.createElement(o.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,onEntering:this.onOverlayEntering,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited},p.default.createElement("div",{ref:this.overlayRef,className:e,style:t,onClick:this.onPanelClick},r,l,i)),appendTo:"self"})}},{key:"render",value:function(){var e=this,t=n.classNames("p-mention p-component p-inputwrapper",{"p-inputwrapper-filled":this.isFilled(),"p-inputwrapper-focus":this.state.focused},this.props.className),r=n.classNames("p-mention-input",this.props.inputClassName),i=n.ObjectUtils.findDiffKeys(this.props,d.defaultProps),o=this.renderPanel();return p.default.createElement("div",{ref:function(t){return e.container=t},id:this.props.id,className:t,style:this.props.style},p.default.createElement(x,h({ref:this.inputRef,id:this.props.inputId},i,{className:r,style:this.props.inputStyle,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onInput:this.onInput,onKeyUp:this.onKeyUp,onChange:this.onChange})),o)}}]),d}(t.Component);return R(I,"defaultProps",{id:null,inputId:null,inputRef:null,style:null,className:null,trigger:"@",suggestions:null,field:null,inputStyle:null,inputClassName:null,panelClassName:null,panelStyle:null,scrollHeight:"200px",autoHighlight:!0,delay:0,headerTemplate:null,footerTemplate:null,itemTemplate:null,transitionOptions:null,onChange:null,onInput:null,onSearch:null,onSelect:null,onFocus:null,onBlur:null,onShow:null,onHide:null}),e.Mention=I,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.ripple,primereact.overlayservice,primereact.csstransition,primereact.portal,primereact.tooltip,primereact.api);
|
package/menu/menu.cjs.js
CHANGED
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var utils = require('primereact/utils');
|
|
7
|
+
var csstransition = require('primereact/csstransition');
|
|
8
|
+
var overlayservice = require('primereact/overlayservice');
|
|
9
|
+
var portal = require('primereact/portal');
|
|
10
|
+
var PrimeReact = require('primereact/api');
|
|
7
11
|
|
|
8
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
13
|
|
|
10
14
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
var PrimeReact__default = /*#__PURE__*/_interopDefaultLegacy(PrimeReact);
|
|
11
16
|
|
|
12
17
|
function _classCallCheck(instance, Constructor) {
|
|
13
18
|
if (!(instance instanceof Constructor)) {
|
|
@@ -133,7 +138,7 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
133
138
|
_this.onExit = _this.onExit.bind(_assertThisInitialized(_this));
|
|
134
139
|
_this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
|
|
135
140
|
_this.onPanelClick = _this.onPanelClick.bind(_assertThisInitialized(_this));
|
|
136
|
-
_this.menuRef = /*#__PURE__*/React__default[
|
|
141
|
+
_this.menuRef = /*#__PURE__*/React__default["default"].createRef();
|
|
137
142
|
return _this;
|
|
138
143
|
}
|
|
139
144
|
|
|
@@ -141,7 +146,7 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
141
146
|
key: "onPanelClick",
|
|
142
147
|
value: function onPanelClick(event) {
|
|
143
148
|
if (this.props.popup) {
|
|
144
|
-
|
|
149
|
+
overlayservice.OverlayService.emit('overlay-click', {
|
|
145
150
|
originalEvent: event,
|
|
146
151
|
target: this.target
|
|
147
152
|
});
|
|
@@ -203,13 +208,13 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
203
208
|
key: "findNextItem",
|
|
204
209
|
value: function findNextItem(item) {
|
|
205
210
|
var nextItem = item.nextElementSibling;
|
|
206
|
-
if (nextItem) return
|
|
211
|
+
if (nextItem) return utils.DomHandler.hasClass(nextItem, 'p-disabled') || !utils.DomHandler.hasClass(nextItem, 'p-menuitem') ? this.findNextItem(nextItem) : nextItem;else return null;
|
|
207
212
|
}
|
|
208
213
|
}, {
|
|
209
214
|
key: "findPrevItem",
|
|
210
215
|
value: function findPrevItem(item) {
|
|
211
216
|
var prevItem = item.previousElementSibling;
|
|
212
|
-
if (prevItem) return
|
|
217
|
+
if (prevItem) return utils.DomHandler.hasClass(prevItem, 'p-disabled') || !utils.DomHandler.hasClass(prevItem, 'p-menuitem') ? this.findPrevItem(prevItem) : prevItem;else return null;
|
|
213
218
|
}
|
|
214
219
|
}, {
|
|
215
220
|
key: "toggle",
|
|
@@ -250,8 +255,8 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
250
255
|
}, {
|
|
251
256
|
key: "onEnter",
|
|
252
257
|
value: function onEnter() {
|
|
253
|
-
|
|
254
|
-
|
|
258
|
+
utils.ZIndexUtils.set('menu', this.menuRef.current, PrimeReact__default["default"].autoZIndex, this.props.baseZIndex || PrimeReact__default["default"].zIndex['menu']);
|
|
259
|
+
utils.DomHandler.absolutePosition(this.menuRef.current, this.target);
|
|
255
260
|
}
|
|
256
261
|
}, {
|
|
257
262
|
key: "onEntered",
|
|
@@ -269,7 +274,7 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
269
274
|
}, {
|
|
270
275
|
key: "onExited",
|
|
271
276
|
value: function onExited() {
|
|
272
|
-
|
|
277
|
+
utils.ZIndexUtils.clear(this.menuRef.current);
|
|
273
278
|
}
|
|
274
279
|
}, {
|
|
275
280
|
key: "bindDocumentListeners",
|
|
@@ -288,7 +293,7 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
288
293
|
|
|
289
294
|
if (!this.documentResizeListener) {
|
|
290
295
|
this.documentResizeListener = function (event) {
|
|
291
|
-
if (_this4.state.visible && !
|
|
296
|
+
if (_this4.state.visible && !utils.DomHandler.isTouchDevice()) {
|
|
292
297
|
_this4.hide(event);
|
|
293
298
|
}
|
|
294
299
|
};
|
|
@@ -315,7 +320,7 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
315
320
|
var _this5 = this;
|
|
316
321
|
|
|
317
322
|
if (!this.scrollHandler) {
|
|
318
|
-
this.scrollHandler = new
|
|
323
|
+
this.scrollHandler = new utils.ConnectedOverlayScrollHandler(this.target, function (event) {
|
|
319
324
|
if (_this5.state.visible) {
|
|
320
325
|
_this5.hide(event);
|
|
321
326
|
}
|
|
@@ -346,22 +351,22 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
346
351
|
this.scrollHandler = null;
|
|
347
352
|
}
|
|
348
353
|
|
|
349
|
-
|
|
354
|
+
utils.ZIndexUtils.clear(this.menuRef.current);
|
|
350
355
|
}
|
|
351
356
|
}, {
|
|
352
357
|
key: "renderSubmenu",
|
|
353
358
|
value: function renderSubmenu(submenu, index) {
|
|
354
359
|
var _this6 = this;
|
|
355
360
|
|
|
356
|
-
var className =
|
|
361
|
+
var className = utils.classNames('p-submenu-header', {
|
|
357
362
|
'p-disabled': submenu.disabled
|
|
358
363
|
}, submenu.className);
|
|
359
364
|
var items = submenu.items.map(function (item, index) {
|
|
360
365
|
return _this6.renderMenuitem(item, index);
|
|
361
366
|
});
|
|
362
|
-
return /*#__PURE__*/React__default[
|
|
367
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
363
368
|
key: submenu.label + '_' + index
|
|
364
|
-
}, /*#__PURE__*/React__default[
|
|
369
|
+
}, /*#__PURE__*/React__default["default"].createElement("li", {
|
|
365
370
|
className: className,
|
|
366
371
|
style: submenu.style,
|
|
367
372
|
role: "presentation",
|
|
@@ -371,7 +376,7 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
371
376
|
}, {
|
|
372
377
|
key: "renderSeparator",
|
|
373
378
|
value: function renderSeparator(index) {
|
|
374
|
-
return /*#__PURE__*/React__default[
|
|
379
|
+
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
375
380
|
key: 'separator_' + index,
|
|
376
381
|
className: "p-menu-separator",
|
|
377
382
|
role: "separator"
|
|
@@ -382,19 +387,19 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
382
387
|
value: function renderMenuitem(item, index) {
|
|
383
388
|
var _this7 = this;
|
|
384
389
|
|
|
385
|
-
var className =
|
|
386
|
-
var linkClassName =
|
|
390
|
+
var className = utils.classNames('p-menuitem', item.className);
|
|
391
|
+
var linkClassName = utils.classNames('p-menuitem-link', {
|
|
387
392
|
'p-disabled': item.disabled
|
|
388
393
|
});
|
|
389
|
-
var iconClassName =
|
|
390
|
-
var icon = item.icon && /*#__PURE__*/React__default[
|
|
394
|
+
var iconClassName = utils.classNames('p-menuitem-icon', item.icon);
|
|
395
|
+
var icon = item.icon && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
391
396
|
className: iconClassName
|
|
392
397
|
});
|
|
393
|
-
var label = item.label && /*#__PURE__*/React__default[
|
|
398
|
+
var label = item.label && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
394
399
|
className: "p-menuitem-text"
|
|
395
400
|
}, item.label);
|
|
396
401
|
var tabIndex = item.disabled ? null : 0;
|
|
397
|
-
var content = /*#__PURE__*/React__default[
|
|
402
|
+
var content = /*#__PURE__*/React__default["default"].createElement("a", {
|
|
398
403
|
href: item.url || '#',
|
|
399
404
|
className: linkClassName,
|
|
400
405
|
role: "menuitem",
|
|
@@ -424,10 +429,10 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
424
429
|
element: content,
|
|
425
430
|
props: this.props
|
|
426
431
|
};
|
|
427
|
-
content =
|
|
432
|
+
content = utils.ObjectUtils.getJSXElement(item.template, item, defaultContentOptions);
|
|
428
433
|
}
|
|
429
434
|
|
|
430
|
-
return /*#__PURE__*/React__default[
|
|
435
|
+
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
431
436
|
key: item.label + '_' + index,
|
|
432
437
|
className: className,
|
|
433
438
|
style: item.style,
|
|
@@ -456,11 +461,11 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
456
461
|
key: "renderElement",
|
|
457
462
|
value: function renderElement() {
|
|
458
463
|
if (this.props.model) {
|
|
459
|
-
var className =
|
|
464
|
+
var className = utils.classNames('p-menu p-component', this.props.className, {
|
|
460
465
|
'p-menu-overlay': this.props.popup
|
|
461
466
|
});
|
|
462
467
|
var menuitems = this.renderMenu();
|
|
463
|
-
return /*#__PURE__*/React__default[
|
|
468
|
+
return /*#__PURE__*/React__default["default"].createElement(csstransition.CSSTransition, {
|
|
464
469
|
nodeRef: this.menuRef,
|
|
465
470
|
classNames: "p-connected-overlay",
|
|
466
471
|
in: this.state.visible,
|
|
@@ -474,13 +479,13 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
474
479
|
onEntered: this.onEntered,
|
|
475
480
|
onExit: this.onExit,
|
|
476
481
|
onExited: this.onExited
|
|
477
|
-
}, /*#__PURE__*/React__default[
|
|
482
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
478
483
|
ref: this.menuRef,
|
|
479
484
|
id: this.props.id,
|
|
480
485
|
className: className,
|
|
481
486
|
style: this.props.style,
|
|
482
487
|
onClick: this.onPanelClick
|
|
483
|
-
}, /*#__PURE__*/React__default[
|
|
488
|
+
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
484
489
|
className: "p-menu-list p-reset",
|
|
485
490
|
role: "menu"
|
|
486
491
|
}, menuitems)));
|
|
@@ -492,7 +497,7 @@ var Menu = /*#__PURE__*/function (_Component) {
|
|
|
492
497
|
key: "render",
|
|
493
498
|
value: function render() {
|
|
494
499
|
var element = this.renderElement();
|
|
495
|
-
return this.props.popup ? /*#__PURE__*/React__default[
|
|
500
|
+
return this.props.popup ? /*#__PURE__*/React__default["default"].createElement(portal.Portal, {
|
|
496
501
|
element: element,
|
|
497
502
|
appendTo: this.props.appendTo
|
|
498
503
|
}) : element;
|