primereact 6.6.0 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -9
- package/accordion/accordion.cjs.js +32 -23
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +3 -2
- package/accordion/accordion.esm.js +17 -8
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +32 -24
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +374 -42
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +126 -32
- package/api/api.esm.js +371 -43
- package/api/api.esm.min.js +1 -1
- package/api/api.js +374 -44
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +79 -69
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +3 -1
- package/autocomplete/autocomplete.esm.js +15 -5
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +75 -70
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +12 -9
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +2 -1
- package/avatar/avatar.esm.js +7 -4
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +13 -10
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +5 -3
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +3 -1
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +6 -4
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +5 -3
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +3 -1
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +6 -4
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +19 -13
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +7 -2
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +18 -14
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +18 -16
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +3 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +19 -17
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +44 -53
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +4 -11
- package/button/button.esm.js +33 -42
- package/button/button.esm.min.js +1 -1
- package/button/button.js +43 -54
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +183 -153
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +5 -1
- package/calendar/calendar.esm.js +57 -27
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +179 -154
- package/calendar/calendar.min.css +1 -1
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +3 -1
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.js +2 -0
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +4 -2
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +15 -13
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +3 -1
- package/card/card.esm.min.js +1 -1
- package/card/card.js +16 -14
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +39 -36
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +4 -1
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +39 -37
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +53 -47
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +8 -2
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +50 -48
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +8 -8
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +3 -1
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +7 -5
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +22 -15
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +2 -1
- package/checkbox/checkbox.esm.js +15 -8
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +22 -16
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +18 -14
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +3 -4
- package/chip/chip.esm.js +13 -9
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +19 -15
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +48 -20
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +10 -0
- package/chips/chips.esm.js +39 -11
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +48 -21
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +37 -31
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +1 -1
- package/colorpicker/colorpicker.esm.js +8 -2
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +34 -32
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.js +34 -9
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +168 -13
- package/column/column.esm.js +34 -9
- package/column/column.esm.min.js +1 -1
- package/column/column.js +35 -10
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.js +2 -0
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.js +2 -0
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +3 -1
- package/columngroup/columngroup.min.js +1 -1
- package/common/common.min.css +1 -1
- package/confirmdialog/confirmdialog.cjs.js +24 -20
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +4 -3
- package/confirmdialog/confirmdialog.esm.js +8 -4
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +24 -21
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +47 -40
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +4 -3
- package/confirmpopup/confirmpopup.esm.js +12 -6
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +44 -40
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +70 -63
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +37 -31
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +67 -64
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +11745 -1573
- package/core/core.min.js +40 -1
- package/csstransition/csstransition.cjs.js +3 -1
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.esm.js +2 -0
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +4 -2
- package/csstransition/csstransition.min.js +1 -1
- package/datascroller/datascroller.cjs.js +14 -11
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +6 -3
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +14 -12
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +4784 -3277
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +100 -29
- package/datatable/datatable.esm.js +4859 -3353
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +4777 -3278
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +34 -29
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +8 -3
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +33 -30
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +3 -1
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +2 -0
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +4 -2
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +68 -51
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +1 -0
- package/dialog/dialog.esm.js +22 -6
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +65 -52
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +6 -4
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +3 -1
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +7 -5
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +53 -17
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +13 -0
- package/dock/dock.esm.js +41 -5
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +53 -18
- package/dock/dock.min.css +1 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +90 -76
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +28 -14
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +86 -77
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +40 -40
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +4 -2
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +39 -37
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +19 -15
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +5 -1
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +18 -16
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +65 -56
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +2 -1
- package/fileupload/fileupload.esm.js +26 -17
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +65 -57
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +8 -8
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +3 -1
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +7 -5
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +72 -65
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +8 -2
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +69 -66
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +3 -1
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.js +2 -0
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +4 -2
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +33 -27
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +5 -5
- package/image/image.esm.js +7 -2
- package/image/image.esm.min.js +1 -1
- package/image/image.js +31 -28
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +10 -8
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +3 -1
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +11 -9
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +11 -8
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +4 -1
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +11 -9
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +50 -29
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +33 -12
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +49 -30
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +17 -12
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +10 -5
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +17 -13
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +14 -10
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +1 -1
- package/inputtext/inputtext.esm.js +5 -1
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +13 -11
- package/inputtext/inputtext.min.css +1 -1
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +12 -9
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +1 -1
- package/inputtextarea/inputtextarea.esm.js +4 -1
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +12 -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 +9 -7
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +3 -1
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +10 -8
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +44 -39
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +9 -4
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +42 -40
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +38 -35
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +4 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +38 -36
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +55 -46
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +10 -2
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +50 -47
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +35 -28
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +2 -0
- package/menu/menu.esm.js +8 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +32 -29
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +40 -35
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +6 -2
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +39 -36
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +11 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +3 -1
- package/message/message.esm.js +5 -2
- package/message/message.esm.min.js +1 -1
- package/message/message.js +12 -9
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +21 -17
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +5 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +20 -18
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +132 -118
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +6 -2
- package/multiselect/multiselect.esm.js +47 -33
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +128 -119
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +16 -13
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +4 -1
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +16 -14
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +37 -34
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +4 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +37 -35
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +28 -26
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +3 -1
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +29 -27
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +33 -24
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +1 -1
- package/overlaypanel/overlaypanel.esm.js +10 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +29 -25
- 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 +10 -4
- package/paginator/paginator.cjs.js +51 -48
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +5 -2
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +51 -49
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +21 -17
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +5 -1
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +20 -18
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +42 -39
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +4 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +42 -40
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +35 -29
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +1 -1
- package/password/password.esm.js +8 -2
- package/password/password.esm.min.js +1 -1
- package/password/password.js +32 -30
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +60 -54
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +16 -10
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +60 -55
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +7 -3
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +6 -2
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +8 -4
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +8041 -5835
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +6905 -4701
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +8040 -5832
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +11 -9
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +3 -1
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +12 -10
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +7 -5
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +3 -1
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +8 -6
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +12 -9
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +4 -1
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +12 -10
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +12 -9
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +6 -3
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +12 -10
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +430 -238
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +158 -27
- package/resources/themes/arya-green/theme.css +158 -27
- package/resources/themes/arya-orange/theme.css +158 -27
- package/resources/themes/arya-purple/theme.css +158 -27
- package/resources/themes/bootstrap4-dark-blue/theme.css +162 -31
- package/resources/themes/bootstrap4-dark-purple/theme.css +162 -31
- package/resources/themes/bootstrap4-light-blue/theme.css +162 -31
- package/resources/themes/bootstrap4-light-purple/theme.css +162 -31
- package/resources/themes/fluent-light/theme.css +158 -27
- 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 +5671 -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 +5671 -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 +5671 -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 +5671 -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 +5671 -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 +5671 -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 +5671 -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 +5671 -0
- package/resources/themes/luna-amber/theme.css +162 -31
- package/resources/themes/luna-blue/theme.css +162 -31
- package/resources/themes/luna-green/theme.css +162 -31
- package/resources/themes/luna-pink/theme.css +162 -31
- package/resources/themes/md-dark-deeppurple/theme.css +347 -56
- package/resources/themes/md-dark-indigo/theme.css +347 -56
- package/resources/themes/md-light-deeppurple/theme.css +347 -56
- package/resources/themes/md-light-indigo/theme.css +347 -56
- package/resources/themes/mdc-dark-deeppurple/theme.css +347 -56
- package/resources/themes/mdc-dark-indigo/theme.css +347 -56
- package/resources/themes/mdc-light-deeppurple/theme.css +347 -56
- package/resources/themes/mdc-light-indigo/theme.css +347 -56
- package/resources/themes/nova/theme.css +162 -31
- package/resources/themes/nova-accent/theme.css +162 -31
- package/resources/themes/nova-alt/theme.css +162 -31
- package/resources/themes/rhea/theme.css +162 -31
- package/resources/themes/saga-blue/theme.css +158 -27
- package/resources/themes/saga-green/theme.css +158 -27
- package/resources/themes/saga-orange/theme.css +158 -27
- package/resources/themes/saga-purple/theme.css +158 -27
- package/resources/themes/tailwind-light/theme.css +162 -31
- package/resources/themes/vela-blue/theme.css +158 -27
- package/resources/themes/vela-green/theme.css +158 -27
- package/resources/themes/vela-orange/theme.css +158 -27
- package/resources/themes/vela-purple/theme.css +158 -27
- package/ripple/ripple.cjs.js +13 -11
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +5 -3
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +14 -12
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +3 -1
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.js +2 -0
- package/row/row.esm.min.js +1 -1
- package/row/row.js +4 -2
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +21 -19
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +3 -1
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +22 -20
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +20 -13
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +2 -1
- package/scrolltop/scrolltop.esm.js +11 -5
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +18 -14
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +19 -15
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +5 -1
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +18 -16
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +3 -1
- package/sidebar/sidebar.cjs.js +144 -116
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +2 -0
- package/sidebar/sidebar.esm.js +135 -108
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +141 -117
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +5 -3
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +3 -1
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +6 -4
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +39 -32
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +8 -2
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +36 -33
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +40 -23
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +32 -15
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +41 -24
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +22 -19
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +3 -2
- package/speeddial/speeddial.esm.js +4 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +22 -20
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +39 -33
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +4 -5
- package/splitbutton/splitbutton.esm.js +8 -2
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +36 -34
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +21 -19
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +4 -2
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +22 -20
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +12 -10
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +3 -1
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +13 -11
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +35 -39
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +20 -24
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +36 -40
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +18 -15
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +4 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +18 -16
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +177 -54
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +4 -1
- package/tabview/tabview.esm.js +146 -23
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +177 -55
- package/tabview/tabview.min.css +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +11 -8
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +2 -1
- package/tag/tag.esm.js +7 -4
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +12 -9
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +14 -12
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +3 -1
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +15 -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 +44 -36
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +9 -2
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +40 -37
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +14 -12
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +3 -1
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +15 -13
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +48 -40
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +22 -15
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +46 -41
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +16 -9
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +3 -2
- package/togglebutton/togglebutton.esm.js +10 -3
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +15 -10
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +9 -7
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +3 -1
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +10 -8
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +36 -31
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +6 -2
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +35 -32
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tree/tree.cjs.js +54 -51
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +9 -2
- package/tree/tree.esm.js +4 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +54 -52
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +3 -1
- package/treeselect/treeselect.cjs.js +52 -46
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +9 -2
- package/treeselect/treeselect.esm.js +11 -5
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +49 -47
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +1290 -272
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +9 -2
- package/treetable/treetable.esm.js +1213 -195
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +1288 -273
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +13 -10
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +4 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +13 -11
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +502 -525
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +29 -20
- package/utils/utils.esm.js +501 -524
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +503 -526
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +285 -168
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.d.ts +21 -9
- package/virtualscroller/virtualscroller.esm.js +278 -161
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +286 -169
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +17 -27
- package/core/core.cjs.js +0 -3080
- package/core/core.cjs.min.js +0 -1
- package/core/core.esm.js +0 -3055
- package/core/core.esm.min.js +0 -1
- package/core/package.json +0 -5
package/image/image.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.image=function(e,t,i){"use strict";function
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.image=function(e,t,i,n,a,o){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(t),l=r(o);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function d(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 p(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var b,k,g,E=function(e){f(k,e);var t,o,r,m,h,b=(t=k,o=y(),function(){var e,i=v(t);if(o){var n=v(this).constructor;e=Reflect.construct(i,arguments,n)}else e=i.apply(this,arguments);return d(this,e)});function k(e){var t;return c(this,k),(t=b.call(this,e)).state={maskVisible:!1,previewVisible:!1,rotate:0,scale:1},t.onImageClick=t.onImageClick.bind(p(t)),t.onMaskClick=t.onMaskClick.bind(p(t)),t.rotateRight=t.rotateRight.bind(p(t)),t.rotateLeft=t.rotateLeft.bind(p(t)),t.zoomIn=t.zoomIn.bind(p(t)),t.zoomOut=t.zoomOut.bind(p(t)),t.onEntering=t.onEntering.bind(p(t)),t.onEntered=t.onEntered.bind(p(t)),t.onPreviewImageClick=t.onPreviewImageClick.bind(p(t)),t.onExit=t.onExit.bind(p(t)),t.onExiting=t.onExiting.bind(p(t)),t.onExited=t.onExited.bind(p(t)),t.previewRef=s.default.createRef(),t}return r=k,(m=[{key:"onImageClick",value:function(){var e=this;this.props.preview&&(this.setState({maskVisible:!0}),setTimeout((function(){e.setState({previewVisible:!0})}),25))}},{key:"onPreviewImageClick",value:function(){this.previewClick=!0}},{key:"onMaskClick",value:function(){this.previewClick||(this.setState({previewVisible:!1}),this.setState({rotate:0}),this.setState({scale:1})),this.previewClick=!1}},{key:"rotateRight",value:function(){this.setState((function(e){return{rotate:e.rotate+90}})),this.previewClick=!0}},{key:"rotateLeft",value:function(){this.setState((function(e){return{rotate:e.rotate-90}})),this.previewClick=!0}},{key:"zoomIn",value:function(){this.setState((function(e){return{scale:e.scale+.1}})),this.previewClick=!0}},{key:"zoomOut",value:function(){this.setState((function(e){return{scale:e.scale-.1}})),this.previewClick=!0}},{key:"onEntering",value:function(){n.ZIndexUtils.set("modal",this.mask,l.default.autoZIndex,l.default.zIndex.modal)}},{key:"onEntered",value:function(){this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){n.DomHandler.addClass(this.mask,"p-component-overlay-leave")}},{key:"onExiting",value:function(){this.props.onHide&&this.props.onHide()}},{key:"onExited",value:function(e){n.ZIndexUtils.clear(e),this.setState({maskVisible:!1})}},{key:"componentWillUnmount",value:function(){this.mask&&n.ZIndexUtils.clear(this.container)}},{key:"renderElement",value:function(){var e=this,t={transform:"rotate("+this.state.rotate+"deg) scale("+this.state.scale+")"},n=this.state.scale<=.5||this.state.scale>=1.5;return s.default.createElement("div",{ref:function(t){return e.mask=t},className:"p-image-mask p-component-overlay p-component-overlay-enter",onClick:this.onMaskClick},s.default.createElement("div",{className:"p-image-toolbar"},s.default.createElement("button",{className:"p-image-action p-link",onClick:this.rotateRight,type:"button"},s.default.createElement("i",{className:"pi pi-refresh"})),s.default.createElement("button",{className:"p-image-action p-link",onClick:this.rotateLeft,type:"button"},s.default.createElement("i",{className:"pi pi-undo"})),s.default.createElement("button",{className:"p-image-action p-link",onClick:this.zoomOut,type:"button",disabled:n},s.default.createElement("i",{className:"pi pi-search-minus"})),s.default.createElement("button",{className:"p-image-action p-link",onClick:this.zoomIn,type:"button",disabled:n},s.default.createElement("i",{className:"pi pi-search-plus"})),s.default.createElement("button",{className:"p-image-action p-link",type:"button",onClick:this.hidePreview},s.default.createElement("i",{className:"pi pi-times"}))),s.default.createElement(i.CSSTransition,{nodeRef:this.previewRef,classNames:"p-image-preview",in:this.state.previewVisible,timeout:{enter:150,exit:150},unmountOnExit:!0,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited},s.default.createElement("div",{ref:this.previewRef},s.default.createElement("img",{src:this.props.src,className:"p-image-preview",style:t,onClick:this.onPreviewImageClick,alt:this.props.alt}))))}},{key:"render",value:function(){var e=this,t=n.classNames("p-image p-component",this.props.className,{"p-image-preview-container":this.props.preview}),i=this.renderElement(),o=this.props.template?n.ObjectUtils.getJSXElement(this.props.template,this.props):s.default.createElement("i",{className:"p-image-preview-icon pi pi-eye"}),r=this.props;return s.default.createElement("span",{ref:function(t){return e.container=t},className:t,style:this.props.style},s.default.createElement("img",{src:r.src,className:this.props.imageClassName,width:r.width,height:r.height,style:this.props.imageStyle,alt:r.alt}),this.props.preview&&s.default.createElement("div",{className:"p-image-preview-indicator",onClick:this.onImageClick},o),this.state.maskVisible&&s.default.createElement(a.Portal,{element:i,appendTo:document.body}))}}])&&u(r.prototype,m),h&&u(r,h),k}(t.Component);return g={preview:!1,className:null,style:null,imageStyle:null,imageClassName:null,template:null,src:null,alt:null,width:null,height:null},(k="defaultProps")in(b=E)?Object.defineProperty(b,k,{value:g,enumerable:!0,configurable:!0,writable:!0}):b[k]=g,e.Image=E,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.csstransition,primereact.utils,primereact.portal,primereact.api);
|
package/inplace/inplace.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
7
|
var button = require('primereact/button');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -98,6 +98,8 @@ function _typeof(obj) {
|
|
|
98
98
|
function _possibleConstructorReturn(self, call) {
|
|
99
99
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
100
100
|
return call;
|
|
101
|
+
} else if (call !== void 0) {
|
|
102
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
return _assertThisInitialized(self);
|
|
@@ -233,10 +235,10 @@ var Inplace = /*#__PURE__*/function (_Component3) {
|
|
|
233
235
|
}, {
|
|
234
236
|
key: "renderDisplay",
|
|
235
237
|
value: function renderDisplay(content) {
|
|
236
|
-
var className =
|
|
238
|
+
var className = utils.classNames('p-inplace-display', {
|
|
237
239
|
'p-disabled': this.props.disabled
|
|
238
240
|
});
|
|
239
|
-
return /*#__PURE__*/React__default[
|
|
241
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
240
242
|
className: className,
|
|
241
243
|
onClick: this.open,
|
|
242
244
|
onKeyDown: this.onDisplayKeyDown,
|
|
@@ -248,7 +250,7 @@ var Inplace = /*#__PURE__*/function (_Component3) {
|
|
|
248
250
|
key: "renderCloseButton",
|
|
249
251
|
value: function renderCloseButton() {
|
|
250
252
|
if (this.props.closable) {
|
|
251
|
-
return /*#__PURE__*/React__default[
|
|
253
|
+
return /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
252
254
|
type: "button",
|
|
253
255
|
className: "p-inplace-content-close",
|
|
254
256
|
icon: "pi pi-times",
|
|
@@ -262,7 +264,7 @@ var Inplace = /*#__PURE__*/function (_Component3) {
|
|
|
262
264
|
key: "renderContent",
|
|
263
265
|
value: function renderContent(content) {
|
|
264
266
|
var closeButton = this.renderCloseButton();
|
|
265
|
-
return /*#__PURE__*/React__default[
|
|
267
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
266
268
|
className: "p-inplace-content"
|
|
267
269
|
}, content, closeButton);
|
|
268
270
|
}
|
|
@@ -272,7 +274,7 @@ var Inplace = /*#__PURE__*/function (_Component3) {
|
|
|
272
274
|
var _this2 = this;
|
|
273
275
|
|
|
274
276
|
var active = this.isActive();
|
|
275
|
-
return React__default[
|
|
277
|
+
return React__default["default"].Children.map(this.props.children, function (child, i) {
|
|
276
278
|
if (active && child.type === InplaceContent) {
|
|
277
279
|
return _this2.renderContent(child);
|
|
278
280
|
} else if (!active && child.type === InplaceDisplay) {
|
|
@@ -283,10 +285,10 @@ var Inplace = /*#__PURE__*/function (_Component3) {
|
|
|
283
285
|
}, {
|
|
284
286
|
key: "render",
|
|
285
287
|
value: function render() {
|
|
286
|
-
var className =
|
|
288
|
+
var className = utils.classNames('p-inplace p-component', {
|
|
287
289
|
'p-inplace-closable': this.props.closable
|
|
288
290
|
}, this.props.className);
|
|
289
|
-
return /*#__PURE__*/React__default[
|
|
291
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
290
292
|
className: className
|
|
291
293
|
}, this.renderChildren());
|
|
292
294
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils"),n=require("primereact/button");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e);function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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&&s(e.prototype,t),n&&s(e,n),e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(e,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function d(e){var t=h();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var v,b,m,g=function(t){c(r,e.Component);var n=d(r);function r(){return l(this,r),n.apply(this,arguments)}return a(r,[{key:"render",value:function(){return this.props.children}}]),r}(),C=function(t){c(r,e.Component);var n=d(r);function r(){return l(this,r),n.apply(this,arguments)}return a(r,[{key:"render",value:function(){return this.props.children}}]),r}(),w=function(r){c(u,e.Component);var s=d(u);function u(e){var t;return l(this,u),(t=s.call(this,e)).props.onToggle||(t.state={active:!1}),t.open=t.open.bind(i(t)),t.close=t.close.bind(i(t)),t.onDisplayKeyDown=t.onDisplayKeyDown.bind(i(t)),t}return a(u,[{key:"open",value:function(e){this.props.disabled||(this.props.onOpen&&this.props.onOpen(e),this.props.onToggle?this.props.onToggle({originalEvent:e,value:!0}):this.setState({active:!0}))}},{key:"close",value:function(e){this.props.onClose&&this.props.onClose(e),this.props.onToggle?this.props.onToggle({originalEvent:e,value:!1}):this.setState({active:!1})}},{key:"onDisplayKeyDown",value:function(e){"Enter"===e.key&&(this.open(e),e.preventDefault())}},{key:"isActive",value:function(){return this.props.onToggle?this.props.active:this.state.active}},{key:"renderDisplay",value:function(e){var n=t.classNames("p-inplace-display",{"p-disabled":this.props.disabled});return o.default.createElement("div",{className:n,onClick:this.open,onKeyDown:this.onDisplayKeyDown,tabIndex:this.props.tabIndex,"aria-label":this.props.ariaLabel},e)}},{key:"renderCloseButton",value:function(){return this.props.closable?o.default.createElement(n.Button,{type:"button",className:"p-inplace-content-close",icon:"pi pi-times",onClick:this.close}):null}},{key:"renderContent",value:function(e){var t=this.renderCloseButton();return o.default.createElement("div",{className:"p-inplace-content"},e,t)}},{key:"renderChildren",value:function(){var e=this,t=this.isActive();return o.default.Children.map(this.props.children,(function(n,r){return t&&n.type===C?e.renderContent(n):t||n.type!==g?void 0:e.renderDisplay(n)}))}},{key:"render",value:function(){var e=t.classNames("p-inplace p-component",{"p-inplace-closable":this.props.closable},this.props.className);return o.default.createElement("div",{className:e},this.renderChildren())}}]),u}();m={style:null,className:null,active:!1,closable:!1,disabled:!1,tabIndex:0,ariaLabel:null,onOpen:null,onClose:null,onToggle:null},(b="defaultProps")in(v=w)?Object.defineProperty(v,b,{value:m,enumerable:!0,configurable:!0,writable:!0}):v[b]=m,exports.Inplace=w,exports.InplaceContent=C,exports.InplaceDisplay=g;
|
package/inplace/inplace.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { classNames } from 'primereact/
|
|
2
|
+
import { classNames } from 'primereact/utils';
|
|
3
3
|
import { Button } from 'primereact/button';
|
|
4
4
|
|
|
5
5
|
function _assertThisInitialized(self) {
|
|
@@ -90,6 +90,8 @@ function _typeof(obj) {
|
|
|
90
90
|
function _possibleConstructorReturn(self, call) {
|
|
91
91
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
92
92
|
return call;
|
|
93
|
+
} else if (call !== void 0) {
|
|
94
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
return _assertThisInitialized(self);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{Component as t}from"react";import{classNames as n}from"primereact/
|
|
1
|
+
import e,{Component as t}from"react";import{classNames as n}from"primereact/utils";import{Button as r}from"primereact/button";function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(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 s(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function p(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function y(e){var t=h();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var v,d,b,m=function(e){c(r,t);var n=y(r);function r(){return i(this,r),n.apply(this,arguments)}return s(r,[{key:"render",value:function(){return this.props.children}}]),r}(),g=function(e){c(r,t);var n=y(r);function r(){return i(this,r),n.apply(this,arguments)}return s(r,[{key:"render",value:function(){return this.props.children}}]),r}(),w=function(l){c(u,t);var a=y(u);function u(e){var t;return i(this,u),(t=a.call(this,e)).props.onToggle||(t.state={active:!1}),t.open=t.open.bind(o(t)),t.close=t.close.bind(o(t)),t.onDisplayKeyDown=t.onDisplayKeyDown.bind(o(t)),t}return s(u,[{key:"open",value:function(e){this.props.disabled||(this.props.onOpen&&this.props.onOpen(e),this.props.onToggle?this.props.onToggle({originalEvent:e,value:!0}):this.setState({active:!0}))}},{key:"close",value:function(e){this.props.onClose&&this.props.onClose(e),this.props.onToggle?this.props.onToggle({originalEvent:e,value:!1}):this.setState({active:!1})}},{key:"onDisplayKeyDown",value:function(e){"Enter"===e.key&&(this.open(e),e.preventDefault())}},{key:"isActive",value:function(){return this.props.onToggle?this.props.active:this.state.active}},{key:"renderDisplay",value:function(t){var r=n("p-inplace-display",{"p-disabled":this.props.disabled});return e.createElement("div",{className:r,onClick:this.open,onKeyDown:this.onDisplayKeyDown,tabIndex:this.props.tabIndex,"aria-label":this.props.ariaLabel},t)}},{key:"renderCloseButton",value:function(){return this.props.closable?e.createElement(r,{type:"button",className:"p-inplace-content-close",icon:"pi pi-times",onClick:this.close}):null}},{key:"renderContent",value:function(t){var n=this.renderCloseButton();return e.createElement("div",{className:"p-inplace-content"},t,n)}},{key:"renderChildren",value:function(){var t=this,n=this.isActive();return e.Children.map(this.props.children,(function(e,r){return n&&e.type===g?t.renderContent(e):n||e.type!==m?void 0:t.renderDisplay(e)}))}},{key:"render",value:function(){var t=n("p-inplace p-component",{"p-inplace-closable":this.props.closable},this.props.className);return e.createElement("div",{className:t},this.renderChildren())}}]),u}();b={style:null,className:null,active:!1,closable:!1,disabled:!1,tabIndex:0,ariaLabel:null,onOpen:null,onClose:null,onToggle:null},(d="defaultProps")in(v=w)?Object.defineProperty(v,d,{value:b,enumerable:!0,configurable:!0,writable:!0}):v[d]=b;export{w as Inplace,g as InplaceContent,m as InplaceDisplay};
|
package/inplace/inplace.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
this.primereact = this.primereact || {};
|
|
2
|
-
this.primereact.inplace = (function (exports, React,
|
|
2
|
+
this.primereact.inplace = (function (exports, React, utils, button) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -94,6 +94,8 @@ this.primereact.inplace = (function (exports, React, core, button) {
|
|
|
94
94
|
function _possibleConstructorReturn(self, call) {
|
|
95
95
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
96
96
|
return call;
|
|
97
|
+
} else if (call !== void 0) {
|
|
98
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
return _assertThisInitialized(self);
|
|
@@ -229,10 +231,10 @@ this.primereact.inplace = (function (exports, React, core, button) {
|
|
|
229
231
|
}, {
|
|
230
232
|
key: "renderDisplay",
|
|
231
233
|
value: function renderDisplay(content) {
|
|
232
|
-
var className =
|
|
234
|
+
var className = utils.classNames('p-inplace-display', {
|
|
233
235
|
'p-disabled': this.props.disabled
|
|
234
236
|
});
|
|
235
|
-
return /*#__PURE__*/React__default[
|
|
237
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
236
238
|
className: className,
|
|
237
239
|
onClick: this.open,
|
|
238
240
|
onKeyDown: this.onDisplayKeyDown,
|
|
@@ -244,7 +246,7 @@ this.primereact.inplace = (function (exports, React, core, button) {
|
|
|
244
246
|
key: "renderCloseButton",
|
|
245
247
|
value: function renderCloseButton() {
|
|
246
248
|
if (this.props.closable) {
|
|
247
|
-
return /*#__PURE__*/React__default[
|
|
249
|
+
return /*#__PURE__*/React__default["default"].createElement(button.Button, {
|
|
248
250
|
type: "button",
|
|
249
251
|
className: "p-inplace-content-close",
|
|
250
252
|
icon: "pi pi-times",
|
|
@@ -258,7 +260,7 @@ this.primereact.inplace = (function (exports, React, core, button) {
|
|
|
258
260
|
key: "renderContent",
|
|
259
261
|
value: function renderContent(content) {
|
|
260
262
|
var closeButton = this.renderCloseButton();
|
|
261
|
-
return /*#__PURE__*/React__default[
|
|
263
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
262
264
|
className: "p-inplace-content"
|
|
263
265
|
}, content, closeButton);
|
|
264
266
|
}
|
|
@@ -268,7 +270,7 @@ this.primereact.inplace = (function (exports, React, core, button) {
|
|
|
268
270
|
var _this2 = this;
|
|
269
271
|
|
|
270
272
|
var active = this.isActive();
|
|
271
|
-
return React__default[
|
|
273
|
+
return React__default["default"].Children.map(this.props.children, function (child, i) {
|
|
272
274
|
if (active && child.type === InplaceContent) {
|
|
273
275
|
return _this2.renderContent(child);
|
|
274
276
|
} else if (!active && child.type === InplaceDisplay) {
|
|
@@ -279,10 +281,10 @@ this.primereact.inplace = (function (exports, React, core, button) {
|
|
|
279
281
|
}, {
|
|
280
282
|
key: "render",
|
|
281
283
|
value: function render() {
|
|
282
|
-
var className =
|
|
284
|
+
var className = utils.classNames('p-inplace p-component', {
|
|
283
285
|
'p-inplace-closable': this.props.closable
|
|
284
286
|
}, this.props.className);
|
|
285
|
-
return /*#__PURE__*/React__default[
|
|
287
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
286
288
|
className: className
|
|
287
289
|
}, this.renderChildren());
|
|
288
290
|
}
|
|
@@ -312,4 +314,4 @@ this.primereact.inplace = (function (exports, React, core, button) {
|
|
|
312
314
|
|
|
313
315
|
return exports;
|
|
314
316
|
|
|
315
|
-
}({}, React, primereact.
|
|
317
|
+
})({}, React, primereact.utils, primereact.button);
|
package/inplace/inplace.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.inplace=function(e,t,n,
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.inplace=function(e,t,n,r){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(t);function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function y(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e){var t=v();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var b,m,g,C=function(e){p(n,e);var t=d(n);function n(){return a(this,n),t.apply(this,arguments)}return c(n,[{key:"render",value:function(){return this.props.children}}]),n}(t.Component),w=function(e){p(n,e);var t=d(n);function n(){return a(this,n),t.apply(this,arguments)}return c(n,[{key:"render",value:function(){return this.props.children}}]),n}(t.Component),O=function(e){p(o,e);var t=d(o);function o(e){var n;return a(this,o),(n=t.call(this,e)).props.onToggle||(n.state={active:!1}),n.open=n.open.bind(l(n)),n.close=n.close.bind(l(n)),n.onDisplayKeyDown=n.onDisplayKeyDown.bind(l(n)),n}return c(o,[{key:"open",value:function(e){this.props.disabled||(this.props.onOpen&&this.props.onOpen(e),this.props.onToggle?this.props.onToggle({originalEvent:e,value:!0}):this.setState({active:!0}))}},{key:"close",value:function(e){this.props.onClose&&this.props.onClose(e),this.props.onToggle?this.props.onToggle({originalEvent:e,value:!1}):this.setState({active:!1})}},{key:"onDisplayKeyDown",value:function(e){"Enter"===e.key&&(this.open(e),e.preventDefault())}},{key:"isActive",value:function(){return this.props.onToggle?this.props.active:this.state.active}},{key:"renderDisplay",value:function(e){var t=n.classNames("p-inplace-display",{"p-disabled":this.props.disabled});return i.default.createElement("div",{className:t,onClick:this.open,onKeyDown:this.onDisplayKeyDown,tabIndex:this.props.tabIndex,"aria-label":this.props.ariaLabel},e)}},{key:"renderCloseButton",value:function(){return this.props.closable?i.default.createElement(r.Button,{type:"button",className:"p-inplace-content-close",icon:"pi pi-times",onClick:this.close}):null}},{key:"renderContent",value:function(e){var t=this.renderCloseButton();return i.default.createElement("div",{className:"p-inplace-content"},e,t)}},{key:"renderChildren",value:function(){var e=this,t=this.isActive();return i.default.Children.map(this.props.children,(function(n,r){return t&&n.type===w?e.renderContent(n):t||n.type!==C?void 0:e.renderDisplay(n)}))}},{key:"render",value:function(){var e=n.classNames("p-inplace p-component",{"p-inplace-closable":this.props.closable},this.props.className);return i.default.createElement("div",{className:e},this.renderChildren())}}]),o}(t.Component);return g={style:null,className:null,active:!1,closable:!1,disabled:!1,tabIndex:0,ariaLabel:null,onOpen:null,onClose:null,onToggle:null},(m="defaultProps")in(b=O)?Object.defineProperty(b,m,{value:g,enumerable:!0,configurable:!0,writable:!0}):b[m]=g,e.Inplace=O,e.InplaceContent=w,e.InplaceDisplay=C,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.button);
|
|
@@ -3,8 +3,9 @@
|
|
|
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
7
|
var inputtext = require('primereact/inputtext');
|
|
8
|
+
var tooltip = require('primereact/tooltip');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
11
|
|
|
@@ -83,6 +84,8 @@ function _typeof(obj) {
|
|
|
83
84
|
function _possibleConstructorReturn(self, call) {
|
|
84
85
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
85
86
|
return call;
|
|
87
|
+
} else if (call !== void 0) {
|
|
88
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
86
89
|
}
|
|
87
90
|
|
|
88
91
|
return _assertThisInitialized(self);
|
|
@@ -329,7 +332,7 @@ var InputMask = /*#__PURE__*/function (_Component) {
|
|
|
329
332
|
pos,
|
|
330
333
|
begin,
|
|
331
334
|
end;
|
|
332
|
-
var iPhone = /iphone/i.test(
|
|
335
|
+
var iPhone = /iphone/i.test(utils.DomHandler.getUserAgent());
|
|
333
336
|
this.oldVal = this.inputRef.current.value; //backspace, delete, and escape get special treatment
|
|
334
337
|
|
|
335
338
|
if (k === 8 || k === 46 || iPhone && k === 127) {
|
|
@@ -394,7 +397,7 @@ var InputMask = /*#__PURE__*/function (_Component) {
|
|
|
394
397
|
this.writeBuffer();
|
|
395
398
|
next = this.seekNext(p);
|
|
396
399
|
|
|
397
|
-
if (/android/i.test(
|
|
400
|
+
if (/android/i.test(utils.DomHandler.getUserAgent())) {
|
|
398
401
|
//Path for CSP Violation on FireFox OS 1.1
|
|
399
402
|
var proxy = function proxy() {
|
|
400
403
|
_this2.caret(next);
|
|
@@ -592,7 +595,7 @@ var InputMask = /*#__PURE__*/function (_Component) {
|
|
|
592
595
|
}, {
|
|
593
596
|
key: "updateFilledState",
|
|
594
597
|
value: function updateFilledState() {
|
|
595
|
-
if (this.inputRef && this.inputRef.current && this.inputRef.current.value && this.inputRef.current.value.length > 0)
|
|
598
|
+
if (this.inputRef && this.inputRef.current && this.inputRef.current.value && this.inputRef.current.value.length > 0) utils.DomHandler.addClass(this.inputRef.current, 'p-filled');else utils.DomHandler.removeClass(this.inputRef.current, 'p-filled');
|
|
596
599
|
}
|
|
597
600
|
}, {
|
|
598
601
|
key: "updateValue",
|
|
@@ -640,7 +643,7 @@ var InputMask = /*#__PURE__*/function (_Component) {
|
|
|
640
643
|
'a': '[A-Za-z]',
|
|
641
644
|
'*': '[A-Za-z0-9]'
|
|
642
645
|
};
|
|
643
|
-
var ua =
|
|
646
|
+
var ua = utils.DomHandler.getUserAgent();
|
|
644
647
|
this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
|
|
645
648
|
var maskTokens = this.props.mask.split('');
|
|
646
649
|
|
|
@@ -732,7 +735,7 @@ var InputMask = /*#__PURE__*/function (_Component) {
|
|
|
732
735
|
}, {
|
|
733
736
|
key: "renderTooltip",
|
|
734
737
|
value: function renderTooltip() {
|
|
735
|
-
this.tooltip =
|
|
738
|
+
this.tooltip = tooltip.tip({
|
|
736
739
|
target: this.inputRef.current,
|
|
737
740
|
content: this.props.tooltip,
|
|
738
741
|
options: this.props.tooltipOptions
|
|
@@ -741,8 +744,8 @@ var InputMask = /*#__PURE__*/function (_Component) {
|
|
|
741
744
|
}, {
|
|
742
745
|
key: "render",
|
|
743
746
|
value: function render() {
|
|
744
|
-
var inputMaskClassName =
|
|
745
|
-
return /*#__PURE__*/React__default[
|
|
747
|
+
var inputMaskClassName = utils.classNames('p-inputmask', this.props.className);
|
|
748
|
+
return /*#__PURE__*/React__default["default"].createElement(inputtext.InputText, {
|
|
746
749
|
id: this.props.id,
|
|
747
750
|
ref: this.inputRef,
|
|
748
751
|
type: this.props.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("primereact/core"),i=require("primereact/inputtext");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=n(t);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){return!e||"object"!==h(e)&&"function"!=typeof e?u(t):e}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function d(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function v(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?d(Object(i),!0).forEach((function(e){c(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var b=function(n){l(m,t.Component);var a,h,c,d,b,g=(a=m,h=y(),function(){var t,e=f(a);if(h){var i=f(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return p(this,t)});function m(e){var i;return r(this,m),(i=g.call(this,e)).onFocus=i.onFocus.bind(u(i)),i.onBlur=i.onBlur.bind(u(i)),i.onKeyDown=i.onKeyDown.bind(u(i)),i.onKeyPress=i.onKeyPress.bind(u(i)),i.onInput=i.onInput.bind(u(i)),i.handleInputChange=i.handleInputChange.bind(u(i)),i.inputRef=t.createRef(i.props.inputRef),i}return c=m,(d=[{key:"caret",value:function(t,e){var i,n,s,r=this.inputRef&&this.inputRef.current;if(r&&r.offsetParent&&r===document.activeElement)return"number"!=typeof t?(r.setSelectionRange?(n=r.selectionStart,s=r.selectionEnd):document.selection&&document.selection.createRange&&(s=(n=0-(i=document.selection.createRange()).duplicate().moveStart("character",-1e5))+i.text.length),{begin:n,end:s}):(n=t,s="number"==typeof e?e:n,void(r.setSelectionRange?r.setSelectionRange(n,s):r.createTextRange&&((i=r.createTextRange()).collapse(!0),i.moveEnd("character",s),i.moveStart("character",n),i.select())))}},{key:"isCompleted",value:function(){for(var t=this.firstNonMaskPos;t<=this.lastRequiredNonMaskPos;t++)if(this.tests[t]&&this.buffer[t]===this.getPlaceholder(t))return!1;return!0}},{key:"getPlaceholder",value:function(t){return this.props.slotChar.charAt(t<this.props.slotChar.length?t:0)}},{key:"getValue",value:function(){return this.props.unmask?this.getUnmaskedValue():this.inputRef&&this.inputRef.current&&this.inputRef.current.value}},{key:"seekNext",value:function(t){for(;++t<this.len&&!this.tests[t];);return t}},{key:"seekPrev",value:function(t){for(;--t>=0&&!this.tests[t];);return t}},{key:"shiftL",value:function(t,e){var i,n;if(!(t<0)){for(i=t,n=this.seekNext(e);i<this.len;i++)if(this.tests[i]){if(!(n<this.len&&this.tests[i].test(this.buffer[n])))break;this.buffer[i]=this.buffer[n],this.buffer[n]=this.getPlaceholder(n),n=this.seekNext(n)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,t))}}},{key:"shiftR",value:function(t){var e,i,n,s;for(e=t,i=this.getPlaceholder(t);e<this.len;e++)if(this.tests[e]){if(n=this.seekNext(e),s=this.buffer[e],this.buffer[e]=i,!(n<this.len&&this.tests[n].test(s)))break;i=s}}},{key:"handleAndroidInput",value:function(t){var e=this.inputRef.current.value,i=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>e.length){for(this.checkVal(!0);i.begin>0&&!this.tests[i.begin-1];)i.begin--;if(0===i.begin)for(;i.begin<this.firstNonMaskPos&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}else{for(this.checkVal(!0);i.begin<this.len&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}},{key:"onBlur",value:function(t){if(this.focus=!1,this.checkVal(),this.updateModel(t),this.updateFilledState(),this.props.onBlur&&this.props.onBlur(t),this.inputRef.current.value!==this.focusText){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.inputRef.current.dispatchEvent(e)}}},{key:"onKeyDown",value:function(t){if(!this.props.readOnly){var i,n,s,r=t.which||t.keyCode,o=/iphone/i.test(e.DomHandler.getUserAgent());this.oldVal=this.inputRef.current.value,8===r||46===r||o&&127===r?((s=(i=this.caret()).end)-(n=i.begin)==0&&(n=46!==r?this.seekPrev(n):s=this.seekNext(n-1),s=46===r?this.seekNext(s):s),this.clearBuffer(n,s),this.shiftL(n,s-1),this.updateModel(t),t.preventDefault()):13===r?(this.onBlur(t),this.updateModel(t)):27===r&&(this.inputRef.current.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault())}}},{key:"onKeyPress",value:function(t){var i=this;if(!this.props.readOnly){var n,s,r,o,u=t.which||t.keyCode,a=this.caret();t.ctrlKey||t.altKey||t.metaKey||u<32||(u&&13!==u&&(a.end-a.begin!=0&&(this.clearBuffer(a.begin,a.end),this.shiftL(a.begin,a.end-1)),(n=this.seekNext(a.begin-1))<this.len&&(s=String.fromCharCode(u),this.tests[n].test(s))&&(this.shiftR(n),this.buffer[n]=s,this.writeBuffer(),r=this.seekNext(n),/android/i.test(e.DomHandler.getUserAgent())?setTimeout((function(){i.caret(r)}),0):this.caret(r),a.begin<=this.lastRequiredNonMaskPos&&(o=this.isCompleted())),t.preventDefault()),this.updateModel(t),this.props.onComplete&&o&&this.props.onComplete({originalEvent:t,value:this.getValue()}))}}},{key:"clearBuffer",value:function(t,e){var i;for(i=t;i<e&&i<this.len;i++)this.tests[i]&&(this.buffer[i]=this.getPlaceholder(i))}},{key:"writeBuffer",value:function(){this.inputRef.current.value=this.buffer.join("")}},{key:"checkVal",value:function(t){this.isValueChecked=!0;var e,i,n,s=this.inputRef.current.value,r=-1;for(e=0,n=0;e<this.len;e++)if(this.tests[e]){for(this.buffer[e]=this.getPlaceholder(e);n++<s.length;)if(i=s.charAt(n-1),this.tests[e].test(i)){this.buffer[e]=i,r=e;break}if(n>s.length){this.clearBuffer(e+1,this.len);break}}else this.buffer[e]===s.charAt(n)&&n++,e<this.partialPosition&&(r=e);return t?this.writeBuffer():r+1<this.partialPosition?this.props.autoClear||this.buffer.join("")===this.defaultBuffer?(this.inputRef.current.value&&(this.inputRef.current.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.inputRef.current.value=this.inputRef.current.value.substring(0,r+1)),this.partialPosition?e:this.firstNonMaskPos}},{key:"onFocus",value:function(t){var e,i=this;this.props.readOnly||(this.focus=!0,clearTimeout(this.caretTimeoutId),this.focusText=this.inputRef.current.value,e=this.checkVal(),this.caretTimeoutId=setTimeout((function(){i.inputRef.current===document.activeElement&&(i.writeBuffer(),e===i.props.mask.replace("?","").length?i.caret(0,e):i.caret(e),i.updateFilledState())}),10),this.props.onFocus&&this.props.onFocus(t))}},{key:"onInput",value:function(t){this.androidChrome?this.handleAndroidInput(t):this.handleInputChange(t)}},{key:"handleInputChange",value:function(t){if(!this.props.readOnly){var e=this.checkVal(!0);this.caret(e),this.updateModel(t),this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}}},{key:"getUnmaskedValue",value:function(){for(var t=[],e=0;e<this.buffer.length;e++){var i=this.buffer[e];this.tests[e]&&i!==this.getPlaceholder(e)&&t.push(i)}return t.join("")}},{key:"updateModel",value:function(t){if(this.props.onChange){var e=this.props.unmask?this.getUnmaskedValue():t&&t.target.value;this.props.onChange({originalEvent:t,value:this.defaultBuffer!==e?e:"",stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:this.defaultBuffer!==e?e:""}})}}},{key:"updateFilledState",value:function(){this.inputRef&&this.inputRef.current&&this.inputRef.current.value&&this.inputRef.current.value.length>0?e.DomHandler.addClass(this.inputRef.current,"p-filled"):e.DomHandler.removeClass(this.inputRef.current,"p-filled")}},{key:"updateValue",value:function(t){var e,i=this;return this.inputRef&&this.inputRef.current&&(null==this.props.value?this.inputRef.current.value="":(this.inputRef.current.value=this.props.value,e=this.checkVal(t),setTimeout((function(){if(i.inputRef&&i.inputRef.current)return i.writeBuffer(),i.checkVal(t)}),10)),this.focusText=this.inputRef.current.value),this.updateFilledState(),e}},{key:"isValueUpdated",value:function(){return this.props.unmask?this.props.value!==this.getUnmaskedValue():this.defaultBuffer!==this.inputRef.current.value&&this.inputRef.current.value!==this.props.value}},{key:"init",value:function(){if(this.props.mask){this.tests=[],this.partialPosition=this.props.mask.length,this.len=this.props.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};var t=e.DomHandler.getUserAgent();this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);for(var i=this.props.mask.split(""),n=0;n<i.length;n++){var s=i[n];"?"===s?(this.len--,this.partialPosition=n):this.defs[s]?(this.tests.push(new RegExp(this.defs[s])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1),n<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null)}this.buffer=[];for(var r=0;r<i.length;r++){var o=i[r];"?"!==o&&this.buffer.push(this.defs[o]?this.getPlaceholder(r):o)}this.defaultBuffer=this.buffer.join("")}}},{key:"updateInputRef",value:function(){var t=this.props.inputRef;t&&("function"==typeof t?t(this.inputRef.current):t.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.init(),this.updateValue(),this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(t){t.tooltip===this.props.tooltip&&t.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(v({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.isValueUpdated()&&this.updateValue(),t.mask!==this.props.mask&&(this.init(),this.caret(this.updateValue(!0)),this.updateModel())}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=e.tip({target:this.inputRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var t=e.classNames("p-inputmask",this.props.className);return s.default.createElement(i.InputText,{id:this.props.id,ref:this.inputRef,type:this.props.type,name:this.props.name,style:this.props.style,className:t,placeholder:this.props.placeholder,size:this.props.size,maxLength:this.props.maxlength,tabIndex:this.props.tabIndex,disabled:this.props.disabled,readOnly:this.props.readOnly,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onInput:this.onInput,onPaste:this.handleInputChange,required:this.props.required,"aria-labelledby":this.props.ariaLabelledBy})}}])&&o(c.prototype,d),b&&o(c,b),m}();c(b,"defaultProps",{id:null,inputRef:null,value:null,type:"text",mask:null,slotChar:"_",autoClear:!0,unmask:!1,style:null,className:null,placeholder:null,size:null,maxlength:null,tabIndex:null,disabled:!1,readOnly:!1,name:null,required:!1,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onComplete:null,onChange:null,onFocus:null,onBlur:null}),exports.InputMask=b;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("primereact/utils"),i=require("primereact/inputtext"),n=require("primereact/tooltip");function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=s(t);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function f(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return a(t)}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function d(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function v(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function y(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?v(Object(i),!0).forEach((function(e){d(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var g=function(s){h(k,t.Component);var l,p,d,v,g,m=(l=k,p=b(),function(){var t,e=c(l);if(p){var i=c(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function k(e){var i;return o(this,k),(i=m.call(this,e)).onFocus=i.onFocus.bind(a(i)),i.onBlur=i.onBlur.bind(a(i)),i.onKeyDown=i.onKeyDown.bind(a(i)),i.onKeyPress=i.onKeyPress.bind(a(i)),i.onInput=i.onInput.bind(a(i)),i.handleInputChange=i.handleInputChange.bind(a(i)),i.inputRef=t.createRef(i.props.inputRef),i}return d=k,(v=[{key:"caret",value:function(t,e){var i,n,s,r=this.inputRef&&this.inputRef.current;if(r&&r.offsetParent&&r===document.activeElement)return"number"!=typeof t?(r.setSelectionRange?(n=r.selectionStart,s=r.selectionEnd):document.selection&&document.selection.createRange&&(s=(n=0-(i=document.selection.createRange()).duplicate().moveStart("character",-1e5))+i.text.length),{begin:n,end:s}):(n=t,s="number"==typeof e?e:n,void(r.setSelectionRange?r.setSelectionRange(n,s):r.createTextRange&&((i=r.createTextRange()).collapse(!0),i.moveEnd("character",s),i.moveStart("character",n),i.select())))}},{key:"isCompleted",value:function(){for(var t=this.firstNonMaskPos;t<=this.lastRequiredNonMaskPos;t++)if(this.tests[t]&&this.buffer[t]===this.getPlaceholder(t))return!1;return!0}},{key:"getPlaceholder",value:function(t){return this.props.slotChar.charAt(t<this.props.slotChar.length?t:0)}},{key:"getValue",value:function(){return this.props.unmask?this.getUnmaskedValue():this.inputRef&&this.inputRef.current&&this.inputRef.current.value}},{key:"seekNext",value:function(t){for(;++t<this.len&&!this.tests[t];);return t}},{key:"seekPrev",value:function(t){for(;--t>=0&&!this.tests[t];);return t}},{key:"shiftL",value:function(t,e){var i,n;if(!(t<0)){for(i=t,n=this.seekNext(e);i<this.len;i++)if(this.tests[i]){if(!(n<this.len&&this.tests[i].test(this.buffer[n])))break;this.buffer[i]=this.buffer[n],this.buffer[n]=this.getPlaceholder(n),n=this.seekNext(n)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,t))}}},{key:"shiftR",value:function(t){var e,i,n,s;for(e=t,i=this.getPlaceholder(t);e<this.len;e++)if(this.tests[e]){if(n=this.seekNext(e),s=this.buffer[e],this.buffer[e]=i,!(n<this.len&&this.tests[n].test(s)))break;i=s}}},{key:"handleAndroidInput",value:function(t){var e=this.inputRef.current.value,i=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>e.length){for(this.checkVal(!0);i.begin>0&&!this.tests[i.begin-1];)i.begin--;if(0===i.begin)for(;i.begin<this.firstNonMaskPos&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}else{for(this.checkVal(!0);i.begin<this.len&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}},{key:"onBlur",value:function(t){if(this.focus=!1,this.checkVal(),this.updateModel(t),this.updateFilledState(),this.props.onBlur&&this.props.onBlur(t),this.inputRef.current.value!==this.focusText){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.inputRef.current.dispatchEvent(e)}}},{key:"onKeyDown",value:function(t){if(!this.props.readOnly){var i,n,s,r=t.which||t.keyCode,o=/iphone/i.test(e.DomHandler.getUserAgent());this.oldVal=this.inputRef.current.value,8===r||46===r||o&&127===r?((s=(i=this.caret()).end)-(n=i.begin)==0&&(n=46!==r?this.seekPrev(n):s=this.seekNext(n-1),s=46===r?this.seekNext(s):s),this.clearBuffer(n,s),this.shiftL(n,s-1),this.updateModel(t),t.preventDefault()):13===r?(this.onBlur(t),this.updateModel(t)):27===r&&(this.inputRef.current.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault())}}},{key:"onKeyPress",value:function(t){var i=this;if(!this.props.readOnly){var n,s,r,o,u=t.which||t.keyCode,a=this.caret();t.ctrlKey||t.altKey||t.metaKey||u<32||(u&&13!==u&&(a.end-a.begin!=0&&(this.clearBuffer(a.begin,a.end),this.shiftL(a.begin,a.end-1)),(n=this.seekNext(a.begin-1))<this.len&&(s=String.fromCharCode(u),this.tests[n].test(s))&&(this.shiftR(n),this.buffer[n]=s,this.writeBuffer(),r=this.seekNext(n),/android/i.test(e.DomHandler.getUserAgent())?setTimeout((function(){i.caret(r)}),0):this.caret(r),a.begin<=this.lastRequiredNonMaskPos&&(o=this.isCompleted())),t.preventDefault()),this.updateModel(t),this.props.onComplete&&o&&this.props.onComplete({originalEvent:t,value:this.getValue()}))}}},{key:"clearBuffer",value:function(t,e){var i;for(i=t;i<e&&i<this.len;i++)this.tests[i]&&(this.buffer[i]=this.getPlaceholder(i))}},{key:"writeBuffer",value:function(){this.inputRef.current.value=this.buffer.join("")}},{key:"checkVal",value:function(t){this.isValueChecked=!0;var e,i,n,s=this.inputRef.current.value,r=-1;for(e=0,n=0;e<this.len;e++)if(this.tests[e]){for(this.buffer[e]=this.getPlaceholder(e);n++<s.length;)if(i=s.charAt(n-1),this.tests[e].test(i)){this.buffer[e]=i,r=e;break}if(n>s.length){this.clearBuffer(e+1,this.len);break}}else this.buffer[e]===s.charAt(n)&&n++,e<this.partialPosition&&(r=e);return t?this.writeBuffer():r+1<this.partialPosition?this.props.autoClear||this.buffer.join("")===this.defaultBuffer?(this.inputRef.current.value&&(this.inputRef.current.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.inputRef.current.value=this.inputRef.current.value.substring(0,r+1)),this.partialPosition?e:this.firstNonMaskPos}},{key:"onFocus",value:function(t){var e,i=this;this.props.readOnly||(this.focus=!0,clearTimeout(this.caretTimeoutId),this.focusText=this.inputRef.current.value,e=this.checkVal(),this.caretTimeoutId=setTimeout((function(){i.inputRef.current===document.activeElement&&(i.writeBuffer(),e===i.props.mask.replace("?","").length?i.caret(0,e):i.caret(e),i.updateFilledState())}),10),this.props.onFocus&&this.props.onFocus(t))}},{key:"onInput",value:function(t){this.androidChrome?this.handleAndroidInput(t):this.handleInputChange(t)}},{key:"handleInputChange",value:function(t){if(!this.props.readOnly){var e=this.checkVal(!0);this.caret(e),this.updateModel(t),this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}}},{key:"getUnmaskedValue",value:function(){for(var t=[],e=0;e<this.buffer.length;e++){var i=this.buffer[e];this.tests[e]&&i!==this.getPlaceholder(e)&&t.push(i)}return t.join("")}},{key:"updateModel",value:function(t){if(this.props.onChange){var e=this.props.unmask?this.getUnmaskedValue():t&&t.target.value;this.props.onChange({originalEvent:t,value:this.defaultBuffer!==e?e:"",stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:this.defaultBuffer!==e?e:""}})}}},{key:"updateFilledState",value:function(){this.inputRef&&this.inputRef.current&&this.inputRef.current.value&&this.inputRef.current.value.length>0?e.DomHandler.addClass(this.inputRef.current,"p-filled"):e.DomHandler.removeClass(this.inputRef.current,"p-filled")}},{key:"updateValue",value:function(t){var e,i=this;return this.inputRef&&this.inputRef.current&&(null==this.props.value?this.inputRef.current.value="":(this.inputRef.current.value=this.props.value,e=this.checkVal(t),setTimeout((function(){if(i.inputRef&&i.inputRef.current)return i.writeBuffer(),i.checkVal(t)}),10)),this.focusText=this.inputRef.current.value),this.updateFilledState(),e}},{key:"isValueUpdated",value:function(){return this.props.unmask?this.props.value!==this.getUnmaskedValue():this.defaultBuffer!==this.inputRef.current.value&&this.inputRef.current.value!==this.props.value}},{key:"init",value:function(){if(this.props.mask){this.tests=[],this.partialPosition=this.props.mask.length,this.len=this.props.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};var t=e.DomHandler.getUserAgent();this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);for(var i=this.props.mask.split(""),n=0;n<i.length;n++){var s=i[n];"?"===s?(this.len--,this.partialPosition=n):this.defs[s]?(this.tests.push(new RegExp(this.defs[s])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1),n<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null)}this.buffer=[];for(var r=0;r<i.length;r++){var o=i[r];"?"!==o&&this.buffer.push(this.defs[o]?this.getPlaceholder(r):o)}this.defaultBuffer=this.buffer.join("")}}},{key:"updateInputRef",value:function(){var t=this.props.inputRef;t&&("function"==typeof t?t(this.inputRef.current):t.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.init(),this.updateValue(),this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(t){t.tooltip===this.props.tooltip&&t.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(y({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.isValueUpdated()&&this.updateValue(),t.mask!==this.props.mask&&(this.init(),this.caret(this.updateValue(!0)),this.updateModel())}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=n.tip({target:this.inputRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var t=e.classNames("p-inputmask",this.props.className);return r.default.createElement(i.InputText,{id:this.props.id,ref:this.inputRef,type:this.props.type,name:this.props.name,style:this.props.style,className:t,placeholder:this.props.placeholder,size:this.props.size,maxLength:this.props.maxlength,tabIndex:this.props.tabIndex,disabled:this.props.disabled,readOnly:this.props.readOnly,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onInput:this.onInput,onPaste:this.handleInputChange,required:this.props.required,"aria-labelledby":this.props.ariaLabelledBy})}}])&&u(d.prototype,v),g&&u(d,g),k}();d(g,"defaultProps",{id:null,inputRef:null,value:null,type:"text",mask:null,slotChar:"_",autoClear:!0,unmask:!1,style:null,className:null,placeholder:null,size:null,maxlength:null,tabIndex:null,disabled:!1,readOnly:!1,name:null,required:!1,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onComplete:null,onChange:null,onFocus:null,onBlur:null}),exports.InputMask=g;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { createRef, Component } from 'react';
|
|
2
|
-
import { DomHandler,
|
|
2
|
+
import { DomHandler, classNames } from 'primereact/utils';
|
|
3
3
|
import { InputText } from 'primereact/inputtext';
|
|
4
|
+
import { tip } from 'primereact/tooltip';
|
|
4
5
|
|
|
5
6
|
function _classCallCheck(instance, Constructor) {
|
|
6
7
|
if (!(instance instanceof Constructor)) {
|
|
@@ -75,6 +76,8 @@ function _typeof(obj) {
|
|
|
75
76
|
function _possibleConstructorReturn(self, call) {
|
|
76
77
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
77
78
|
return call;
|
|
79
|
+
} else if (call !== void 0) {
|
|
80
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
return _assertThisInitialized(self);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{createRef as e,Component as i}from"react";import{DomHandler as n,tip as s,classNames as r}from"primereact/core";import{InputText as o}from"primereact/inputtext";function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?l(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function y(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function b(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?y(Object(i),!0).forEach((function(e){v(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function g(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var m=function(h){p(P,i);var f,v,y,m,k,R=(f=P,v=g(),function(){var t,e=d(f);if(v){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return c(this,t)});function P(t){var i;return u(this,P),(i=R.call(this,t)).onFocus=i.onFocus.bind(l(i)),i.onBlur=i.onBlur.bind(l(i)),i.onKeyDown=i.onKeyDown.bind(l(i)),i.onKeyPress=i.onKeyPress.bind(l(i)),i.onInput=i.onInput.bind(l(i)),i.handleInputChange=i.handleInputChange.bind(l(i)),i.inputRef=e(i.props.inputRef),i}return y=P,(m=[{key:"caret",value:function(t,e){var i,n,s,r=this.inputRef&&this.inputRef.current;if(r&&r.offsetParent&&r===document.activeElement)return"number"!=typeof t?(r.setSelectionRange?(n=r.selectionStart,s=r.selectionEnd):document.selection&&document.selection.createRange&&(s=(n=0-(i=document.selection.createRange()).duplicate().moveStart("character",-1e5))+i.text.length),{begin:n,end:s}):(n=t,s="number"==typeof e?e:n,void(r.setSelectionRange?r.setSelectionRange(n,s):r.createTextRange&&((i=r.createTextRange()).collapse(!0),i.moveEnd("character",s),i.moveStart("character",n),i.select())))}},{key:"isCompleted",value:function(){for(var t=this.firstNonMaskPos;t<=this.lastRequiredNonMaskPos;t++)if(this.tests[t]&&this.buffer[t]===this.getPlaceholder(t))return!1;return!0}},{key:"getPlaceholder",value:function(t){return this.props.slotChar.charAt(t<this.props.slotChar.length?t:0)}},{key:"getValue",value:function(){return this.props.unmask?this.getUnmaskedValue():this.inputRef&&this.inputRef.current&&this.inputRef.current.value}},{key:"seekNext",value:function(t){for(;++t<this.len&&!this.tests[t];);return t}},{key:"seekPrev",value:function(t){for(;--t>=0&&!this.tests[t];);return t}},{key:"shiftL",value:function(t,e){var i,n;if(!(t<0)){for(i=t,n=this.seekNext(e);i<this.len;i++)if(this.tests[i]){if(!(n<this.len&&this.tests[i].test(this.buffer[n])))break;this.buffer[i]=this.buffer[n],this.buffer[n]=this.getPlaceholder(n),n=this.seekNext(n)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,t))}}},{key:"shiftR",value:function(t){var e,i,n,s;for(e=t,i=this.getPlaceholder(t);e<this.len;e++)if(this.tests[e]){if(n=this.seekNext(e),s=this.buffer[e],this.buffer[e]=i,!(n<this.len&&this.tests[n].test(s)))break;i=s}}},{key:"handleAndroidInput",value:function(t){var e=this.inputRef.current.value,i=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>e.length){for(this.checkVal(!0);i.begin>0&&!this.tests[i.begin-1];)i.begin--;if(0===i.begin)for(;i.begin<this.firstNonMaskPos&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}else{for(this.checkVal(!0);i.begin<this.len&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}},{key:"onBlur",value:function(t){if(this.focus=!1,this.checkVal(),this.updateModel(t),this.updateFilledState(),this.props.onBlur&&this.props.onBlur(t),this.inputRef.current.value!==this.focusText){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.inputRef.current.dispatchEvent(e)}}},{key:"onKeyDown",value:function(t){if(!this.props.readOnly){var e,i,s,r=t.which||t.keyCode,o=/iphone/i.test(n.getUserAgent());this.oldVal=this.inputRef.current.value,8===r||46===r||o&&127===r?((s=(e=this.caret()).end)-(i=e.begin)==0&&(i=46!==r?this.seekPrev(i):s=this.seekNext(i-1),s=46===r?this.seekNext(s):s),this.clearBuffer(i,s),this.shiftL(i,s-1),this.updateModel(t),t.preventDefault()):13===r?(this.onBlur(t),this.updateModel(t)):27===r&&(this.inputRef.current.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault())}}},{key:"onKeyPress",value:function(t){var e=this;if(!this.props.readOnly){var i,s,r,o,u=t.which||t.keyCode,a=this.caret();t.ctrlKey||t.altKey||t.metaKey||u<32||(u&&13!==u&&(a.end-a.begin!=0&&(this.clearBuffer(a.begin,a.end),this.shiftL(a.begin,a.end-1)),(i=this.seekNext(a.begin-1))<this.len&&(s=String.fromCharCode(u),this.tests[i].test(s))&&(this.shiftR(i),this.buffer[i]=s,this.writeBuffer(),r=this.seekNext(i),/android/i.test(n.getUserAgent())?setTimeout((function(){e.caret(r)}),0):this.caret(r),a.begin<=this.lastRequiredNonMaskPos&&(o=this.isCompleted())),t.preventDefault()),this.updateModel(t),this.props.onComplete&&o&&this.props.onComplete({originalEvent:t,value:this.getValue()}))}}},{key:"clearBuffer",value:function(t,e){var i;for(i=t;i<e&&i<this.len;i++)this.tests[i]&&(this.buffer[i]=this.getPlaceholder(i))}},{key:"writeBuffer",value:function(){this.inputRef.current.value=this.buffer.join("")}},{key:"checkVal",value:function(t){this.isValueChecked=!0;var e,i,n,s=this.inputRef.current.value,r=-1;for(e=0,n=0;e<this.len;e++)if(this.tests[e]){for(this.buffer[e]=this.getPlaceholder(e);n++<s.length;)if(i=s.charAt(n-1),this.tests[e].test(i)){this.buffer[e]=i,r=e;break}if(n>s.length){this.clearBuffer(e+1,this.len);break}}else this.buffer[e]===s.charAt(n)&&n++,e<this.partialPosition&&(r=e);return t?this.writeBuffer():r+1<this.partialPosition?this.props.autoClear||this.buffer.join("")===this.defaultBuffer?(this.inputRef.current.value&&(this.inputRef.current.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.inputRef.current.value=this.inputRef.current.value.substring(0,r+1)),this.partialPosition?e:this.firstNonMaskPos}},{key:"onFocus",value:function(t){var e,i=this;this.props.readOnly||(this.focus=!0,clearTimeout(this.caretTimeoutId),this.focusText=this.inputRef.current.value,e=this.checkVal(),this.caretTimeoutId=setTimeout((function(){i.inputRef.current===document.activeElement&&(i.writeBuffer(),e===i.props.mask.replace("?","").length?i.caret(0,e):i.caret(e),i.updateFilledState())}),10),this.props.onFocus&&this.props.onFocus(t))}},{key:"onInput",value:function(t){this.androidChrome?this.handleAndroidInput(t):this.handleInputChange(t)}},{key:"handleInputChange",value:function(t){if(!this.props.readOnly){var e=this.checkVal(!0);this.caret(e),this.updateModel(t),this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}}},{key:"getUnmaskedValue",value:function(){for(var t=[],e=0;e<this.buffer.length;e++){var i=this.buffer[e];this.tests[e]&&i!==this.getPlaceholder(e)&&t.push(i)}return t.join("")}},{key:"updateModel",value:function(t){if(this.props.onChange){var e=this.props.unmask?this.getUnmaskedValue():t&&t.target.value;this.props.onChange({originalEvent:t,value:this.defaultBuffer!==e?e:"",stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:this.defaultBuffer!==e?e:""}})}}},{key:"updateFilledState",value:function(){this.inputRef&&this.inputRef.current&&this.inputRef.current.value&&this.inputRef.current.value.length>0?n.addClass(this.inputRef.current,"p-filled"):n.removeClass(this.inputRef.current,"p-filled")}},{key:"updateValue",value:function(t){var e,i=this;return this.inputRef&&this.inputRef.current&&(null==this.props.value?this.inputRef.current.value="":(this.inputRef.current.value=this.props.value,e=this.checkVal(t),setTimeout((function(){if(i.inputRef&&i.inputRef.current)return i.writeBuffer(),i.checkVal(t)}),10)),this.focusText=this.inputRef.current.value),this.updateFilledState(),e}},{key:"isValueUpdated",value:function(){return this.props.unmask?this.props.value!==this.getUnmaskedValue():this.defaultBuffer!==this.inputRef.current.value&&this.inputRef.current.value!==this.props.value}},{key:"init",value:function(){if(this.props.mask){this.tests=[],this.partialPosition=this.props.mask.length,this.len=this.props.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};var t=n.getUserAgent();this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);for(var e=this.props.mask.split(""),i=0;i<e.length;i++){var s=e[i];"?"===s?(this.len--,this.partialPosition=i):this.defs[s]?(this.tests.push(new RegExp(this.defs[s])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1),i<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null)}this.buffer=[];for(var r=0;r<e.length;r++){var o=e[r];"?"!==o&&this.buffer.push(this.defs[o]?this.getPlaceholder(r):o)}this.defaultBuffer=this.buffer.join("")}}},{key:"updateInputRef",value:function(){var t=this.props.inputRef;t&&("function"==typeof t?t(this.inputRef.current):t.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.init(),this.updateValue(),this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(t){t.tooltip===this.props.tooltip&&t.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(b({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.isValueUpdated()&&this.updateValue(),t.mask!==this.props.mask&&(this.init(),this.caret(this.updateValue(!0)),this.updateModel())}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=s({target:this.inputRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var e=r("p-inputmask",this.props.className);return t.createElement(o,{id:this.props.id,ref:this.inputRef,type:this.props.type,name:this.props.name,style:this.props.style,className:e,placeholder:this.props.placeholder,size:this.props.size,maxLength:this.props.maxlength,tabIndex:this.props.tabIndex,disabled:this.props.disabled,readOnly:this.props.readOnly,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onInput:this.onInput,onPaste:this.handleInputChange,required:this.props.required,"aria-labelledby":this.props.ariaLabelledBy})}}])&&a(y.prototype,m),k&&a(y,k),P}();v(m,"defaultProps",{id:null,inputRef:null,value:null,type:"text",mask:null,slotChar:"_",autoClear:!0,unmask:!1,style:null,className:null,placeholder:null,size:null,maxlength:null,tabIndex:null,disabled:!1,readOnly:!1,name:null,required:!1,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onComplete:null,onChange:null,onFocus:null,onBlur:null});export{m as InputMask};
|
|
1
|
+
import t,{createRef as e,Component as i}from"react";import{DomHandler as n,classNames as s}from"primereact/utils";import{InputText as r}from"primereact/inputtext";import{tip as o}from"primereact/tooltip";function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function c(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function v(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function y(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function b(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?y(Object(i),!0).forEach((function(e){v(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function g(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var m=function(h){p(P,i);var f,v,y,m,k,R=(f=P,v=g(),function(){var t,e=d(f);if(v){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return c(this,t)});function P(t){var i;return u(this,P),(i=R.call(this,t)).onFocus=i.onFocus.bind(l(i)),i.onBlur=i.onBlur.bind(l(i)),i.onKeyDown=i.onKeyDown.bind(l(i)),i.onKeyPress=i.onKeyPress.bind(l(i)),i.onInput=i.onInput.bind(l(i)),i.handleInputChange=i.handleInputChange.bind(l(i)),i.inputRef=e(i.props.inputRef),i}return y=P,(m=[{key:"caret",value:function(t,e){var i,n,s,r=this.inputRef&&this.inputRef.current;if(r&&r.offsetParent&&r===document.activeElement)return"number"!=typeof t?(r.setSelectionRange?(n=r.selectionStart,s=r.selectionEnd):document.selection&&document.selection.createRange&&(s=(n=0-(i=document.selection.createRange()).duplicate().moveStart("character",-1e5))+i.text.length),{begin:n,end:s}):(n=t,s="number"==typeof e?e:n,void(r.setSelectionRange?r.setSelectionRange(n,s):r.createTextRange&&((i=r.createTextRange()).collapse(!0),i.moveEnd("character",s),i.moveStart("character",n),i.select())))}},{key:"isCompleted",value:function(){for(var t=this.firstNonMaskPos;t<=this.lastRequiredNonMaskPos;t++)if(this.tests[t]&&this.buffer[t]===this.getPlaceholder(t))return!1;return!0}},{key:"getPlaceholder",value:function(t){return this.props.slotChar.charAt(t<this.props.slotChar.length?t:0)}},{key:"getValue",value:function(){return this.props.unmask?this.getUnmaskedValue():this.inputRef&&this.inputRef.current&&this.inputRef.current.value}},{key:"seekNext",value:function(t){for(;++t<this.len&&!this.tests[t];);return t}},{key:"seekPrev",value:function(t){for(;--t>=0&&!this.tests[t];);return t}},{key:"shiftL",value:function(t,e){var i,n;if(!(t<0)){for(i=t,n=this.seekNext(e);i<this.len;i++)if(this.tests[i]){if(!(n<this.len&&this.tests[i].test(this.buffer[n])))break;this.buffer[i]=this.buffer[n],this.buffer[n]=this.getPlaceholder(n),n=this.seekNext(n)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,t))}}},{key:"shiftR",value:function(t){var e,i,n,s;for(e=t,i=this.getPlaceholder(t);e<this.len;e++)if(this.tests[e]){if(n=this.seekNext(e),s=this.buffer[e],this.buffer[e]=i,!(n<this.len&&this.tests[n].test(s)))break;i=s}}},{key:"handleAndroidInput",value:function(t){var e=this.inputRef.current.value,i=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>e.length){for(this.checkVal(!0);i.begin>0&&!this.tests[i.begin-1];)i.begin--;if(0===i.begin)for(;i.begin<this.firstNonMaskPos&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}else{for(this.checkVal(!0);i.begin<this.len&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}},{key:"onBlur",value:function(t){if(this.focus=!1,this.checkVal(),this.updateModel(t),this.updateFilledState(),this.props.onBlur&&this.props.onBlur(t),this.inputRef.current.value!==this.focusText){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.inputRef.current.dispatchEvent(e)}}},{key:"onKeyDown",value:function(t){if(!this.props.readOnly){var e,i,s,r=t.which||t.keyCode,o=/iphone/i.test(n.getUserAgent());this.oldVal=this.inputRef.current.value,8===r||46===r||o&&127===r?((s=(e=this.caret()).end)-(i=e.begin)==0&&(i=46!==r?this.seekPrev(i):s=this.seekNext(i-1),s=46===r?this.seekNext(s):s),this.clearBuffer(i,s),this.shiftL(i,s-1),this.updateModel(t),t.preventDefault()):13===r?(this.onBlur(t),this.updateModel(t)):27===r&&(this.inputRef.current.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault())}}},{key:"onKeyPress",value:function(t){var e=this;if(!this.props.readOnly){var i,s,r,o,u=t.which||t.keyCode,a=this.caret();t.ctrlKey||t.altKey||t.metaKey||u<32||(u&&13!==u&&(a.end-a.begin!=0&&(this.clearBuffer(a.begin,a.end),this.shiftL(a.begin,a.end-1)),(i=this.seekNext(a.begin-1))<this.len&&(s=String.fromCharCode(u),this.tests[i].test(s))&&(this.shiftR(i),this.buffer[i]=s,this.writeBuffer(),r=this.seekNext(i),/android/i.test(n.getUserAgent())?setTimeout((function(){e.caret(r)}),0):this.caret(r),a.begin<=this.lastRequiredNonMaskPos&&(o=this.isCompleted())),t.preventDefault()),this.updateModel(t),this.props.onComplete&&o&&this.props.onComplete({originalEvent:t,value:this.getValue()}))}}},{key:"clearBuffer",value:function(t,e){var i;for(i=t;i<e&&i<this.len;i++)this.tests[i]&&(this.buffer[i]=this.getPlaceholder(i))}},{key:"writeBuffer",value:function(){this.inputRef.current.value=this.buffer.join("")}},{key:"checkVal",value:function(t){this.isValueChecked=!0;var e,i,n,s=this.inputRef.current.value,r=-1;for(e=0,n=0;e<this.len;e++)if(this.tests[e]){for(this.buffer[e]=this.getPlaceholder(e);n++<s.length;)if(i=s.charAt(n-1),this.tests[e].test(i)){this.buffer[e]=i,r=e;break}if(n>s.length){this.clearBuffer(e+1,this.len);break}}else this.buffer[e]===s.charAt(n)&&n++,e<this.partialPosition&&(r=e);return t?this.writeBuffer():r+1<this.partialPosition?this.props.autoClear||this.buffer.join("")===this.defaultBuffer?(this.inputRef.current.value&&(this.inputRef.current.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.inputRef.current.value=this.inputRef.current.value.substring(0,r+1)),this.partialPosition?e:this.firstNonMaskPos}},{key:"onFocus",value:function(t){var e,i=this;this.props.readOnly||(this.focus=!0,clearTimeout(this.caretTimeoutId),this.focusText=this.inputRef.current.value,e=this.checkVal(),this.caretTimeoutId=setTimeout((function(){i.inputRef.current===document.activeElement&&(i.writeBuffer(),e===i.props.mask.replace("?","").length?i.caret(0,e):i.caret(e),i.updateFilledState())}),10),this.props.onFocus&&this.props.onFocus(t))}},{key:"onInput",value:function(t){this.androidChrome?this.handleAndroidInput(t):this.handleInputChange(t)}},{key:"handleInputChange",value:function(t){if(!this.props.readOnly){var e=this.checkVal(!0);this.caret(e),this.updateModel(t),this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}}},{key:"getUnmaskedValue",value:function(){for(var t=[],e=0;e<this.buffer.length;e++){var i=this.buffer[e];this.tests[e]&&i!==this.getPlaceholder(e)&&t.push(i)}return t.join("")}},{key:"updateModel",value:function(t){if(this.props.onChange){var e=this.props.unmask?this.getUnmaskedValue():t&&t.target.value;this.props.onChange({originalEvent:t,value:this.defaultBuffer!==e?e:"",stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:this.defaultBuffer!==e?e:""}})}}},{key:"updateFilledState",value:function(){this.inputRef&&this.inputRef.current&&this.inputRef.current.value&&this.inputRef.current.value.length>0?n.addClass(this.inputRef.current,"p-filled"):n.removeClass(this.inputRef.current,"p-filled")}},{key:"updateValue",value:function(t){var e,i=this;return this.inputRef&&this.inputRef.current&&(null==this.props.value?this.inputRef.current.value="":(this.inputRef.current.value=this.props.value,e=this.checkVal(t),setTimeout((function(){if(i.inputRef&&i.inputRef.current)return i.writeBuffer(),i.checkVal(t)}),10)),this.focusText=this.inputRef.current.value),this.updateFilledState(),e}},{key:"isValueUpdated",value:function(){return this.props.unmask?this.props.value!==this.getUnmaskedValue():this.defaultBuffer!==this.inputRef.current.value&&this.inputRef.current.value!==this.props.value}},{key:"init",value:function(){if(this.props.mask){this.tests=[],this.partialPosition=this.props.mask.length,this.len=this.props.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};var t=n.getUserAgent();this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);for(var e=this.props.mask.split(""),i=0;i<e.length;i++){var s=e[i];"?"===s?(this.len--,this.partialPosition=i):this.defs[s]?(this.tests.push(new RegExp(this.defs[s])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1),i<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null)}this.buffer=[];for(var r=0;r<e.length;r++){var o=e[r];"?"!==o&&this.buffer.push(this.defs[o]?this.getPlaceholder(r):o)}this.defaultBuffer=this.buffer.join("")}}},{key:"updateInputRef",value:function(){var t=this.props.inputRef;t&&("function"==typeof t?t(this.inputRef.current):t.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.init(),this.updateValue(),this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(t){t.tooltip===this.props.tooltip&&t.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(b({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.isValueUpdated()&&this.updateValue(),t.mask!==this.props.mask&&(this.init(),this.caret(this.updateValue(!0)),this.updateModel())}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=o({target:this.inputRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var e=s("p-inputmask",this.props.className);return t.createElement(r,{id:this.props.id,ref:this.inputRef,type:this.props.type,name:this.props.name,style:this.props.style,className:e,placeholder:this.props.placeholder,size:this.props.size,maxLength:this.props.maxlength,tabIndex:this.props.tabIndex,disabled:this.props.disabled,readOnly:this.props.readOnly,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onInput:this.onInput,onPaste:this.handleInputChange,required:this.props.required,"aria-labelledby":this.props.ariaLabelledBy})}}])&&a(y.prototype,m),k&&a(y,k),P}();v(m,"defaultProps",{id:null,inputRef:null,value:null,type:"text",mask:null,slotChar:"_",autoClear:!0,unmask:!1,style:null,className:null,placeholder:null,size:null,maxlength:null,tabIndex:null,disabled:!1,readOnly:!1,name:null,required:!1,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onComplete:null,onChange:null,onFocus:null,onBlur:null});export{m as InputMask};
|
package/inputmask/inputmask.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
this.primereact = this.primereact || {};
|
|
2
|
-
this.primereact.inputmask = (function (exports, React,
|
|
2
|
+
this.primereact.inputmask = (function (exports, React, utils, inputtext, tooltip) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -79,6 +79,8 @@ this.primereact.inputmask = (function (exports, React, core, inputtext) {
|
|
|
79
79
|
function _possibleConstructorReturn(self, call) {
|
|
80
80
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
81
81
|
return call;
|
|
82
|
+
} else if (call !== void 0) {
|
|
83
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
return _assertThisInitialized(self);
|
|
@@ -325,7 +327,7 @@ this.primereact.inputmask = (function (exports, React, core, inputtext) {
|
|
|
325
327
|
pos,
|
|
326
328
|
begin,
|
|
327
329
|
end;
|
|
328
|
-
var iPhone = /iphone/i.test(
|
|
330
|
+
var iPhone = /iphone/i.test(utils.DomHandler.getUserAgent());
|
|
329
331
|
this.oldVal = this.inputRef.current.value; //backspace, delete, and escape get special treatment
|
|
330
332
|
|
|
331
333
|
if (k === 8 || k === 46 || iPhone && k === 127) {
|
|
@@ -390,7 +392,7 @@ this.primereact.inputmask = (function (exports, React, core, inputtext) {
|
|
|
390
392
|
this.writeBuffer();
|
|
391
393
|
next = this.seekNext(p);
|
|
392
394
|
|
|
393
|
-
if (/android/i.test(
|
|
395
|
+
if (/android/i.test(utils.DomHandler.getUserAgent())) {
|
|
394
396
|
//Path for CSP Violation on FireFox OS 1.1
|
|
395
397
|
var proxy = function proxy() {
|
|
396
398
|
_this2.caret(next);
|
|
@@ -588,7 +590,7 @@ this.primereact.inputmask = (function (exports, React, core, inputtext) {
|
|
|
588
590
|
}, {
|
|
589
591
|
key: "updateFilledState",
|
|
590
592
|
value: function updateFilledState() {
|
|
591
|
-
if (this.inputRef && this.inputRef.current && this.inputRef.current.value && this.inputRef.current.value.length > 0)
|
|
593
|
+
if (this.inputRef && this.inputRef.current && this.inputRef.current.value && this.inputRef.current.value.length > 0) utils.DomHandler.addClass(this.inputRef.current, 'p-filled');else utils.DomHandler.removeClass(this.inputRef.current, 'p-filled');
|
|
592
594
|
}
|
|
593
595
|
}, {
|
|
594
596
|
key: "updateValue",
|
|
@@ -636,7 +638,7 @@ this.primereact.inputmask = (function (exports, React, core, inputtext) {
|
|
|
636
638
|
'a': '[A-Za-z]',
|
|
637
639
|
'*': '[A-Za-z0-9]'
|
|
638
640
|
};
|
|
639
|
-
var ua =
|
|
641
|
+
var ua = utils.DomHandler.getUserAgent();
|
|
640
642
|
this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
|
|
641
643
|
var maskTokens = this.props.mask.split('');
|
|
642
644
|
|
|
@@ -728,7 +730,7 @@ this.primereact.inputmask = (function (exports, React, core, inputtext) {
|
|
|
728
730
|
}, {
|
|
729
731
|
key: "renderTooltip",
|
|
730
732
|
value: function renderTooltip() {
|
|
731
|
-
this.tooltip =
|
|
733
|
+
this.tooltip = tooltip.tip({
|
|
732
734
|
target: this.inputRef.current,
|
|
733
735
|
content: this.props.tooltip,
|
|
734
736
|
options: this.props.tooltipOptions
|
|
@@ -737,8 +739,8 @@ this.primereact.inputmask = (function (exports, React, core, inputtext) {
|
|
|
737
739
|
}, {
|
|
738
740
|
key: "render",
|
|
739
741
|
value: function render() {
|
|
740
|
-
var inputMaskClassName =
|
|
741
|
-
return /*#__PURE__*/React__default[
|
|
742
|
+
var inputMaskClassName = utils.classNames('p-inputmask', this.props.className);
|
|
743
|
+
return /*#__PURE__*/React__default["default"].createElement(inputtext.InputText, {
|
|
742
744
|
id: this.props.id,
|
|
743
745
|
ref: this.inputRef,
|
|
744
746
|
type: this.props.type,
|
|
@@ -800,4 +802,4 @@ this.primereact.inputmask = (function (exports, React, core, inputtext) {
|
|
|
800
802
|
|
|
801
803
|
return exports;
|
|
802
804
|
|
|
803
|
-
}({}, React, primereact.
|
|
805
|
+
})({}, React, primereact.utils, primereact.inputtext, primereact.tooltip);
|