primereact 6.5.0 → 7.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.cjs.js +2 -0
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +2 -0
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +2 -0
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +308 -10
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +61 -1
- package/api/api.esm.js +305 -11
- package/api/api.esm.min.js +1 -1
- package/api/api.js +308 -12
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +3 -1
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +3 -1
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +3 -1
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +2 -0
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +2 -0
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +2 -0
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +2 -0
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +2 -0
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +2 -0
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +2 -0
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +2 -0
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +2 -0
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +9 -15
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +9 -15
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +9 -15
- package/blockui/blockui.min.css +1 -1
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +2 -0
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +2 -0
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +2 -0
- package/breadcrumb/breadcrumb.min.css +1 -1
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +2 -0
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +2 -0
- package/button/button.esm.min.js +1 -1
- package/button/button.js +2 -0
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +85 -67
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +85 -67
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +85 -67
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +2 -0
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.js +2 -0
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +2 -0
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +2 -0
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +2 -0
- package/card/card.esm.min.js +1 -1
- package/card/card.js +2 -0
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +2 -0
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +3 -1
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +2 -0
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +2 -0
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +2 -0
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +2 -0
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +2 -0
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +2 -0
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +2 -0
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +19 -9
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +3 -1
- package/checkbox/checkbox.esm.js +19 -9
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +19 -9
- package/checkbox/checkbox.min.css +1 -1
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +2 -0
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.esm.js +2 -0
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +2 -0
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +2 -0
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -0
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -0
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +2 -0
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +2 -0
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +2 -0
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.js +34 -9
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +146 -13
- package/column/column.esm.js +34 -9
- package/column/column.esm.min.js +1 -1
- package/column/column.js +34 -9
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.js +2 -0
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.js +2 -0
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +2 -0
- package/columngroup/columngroup.min.js +1 -1
- package/common/common.min.css +1 -1
- package/confirmdialog/confirmdialog.cjs.js +2 -0
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +2 -0
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +2 -0
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +2 -0
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +2 -0
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +2 -0
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +2 -0
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +3 -1
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +2 -0
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.cjs.js +351 -669
- package/core/core.cjs.min.js +1 -1
- package/core/core.esm.js +347 -665
- package/core/core.esm.min.js +1 -1
- package/core/core.js +352 -671
- package/core/core.min.js +1 -1
- package/csstransition/csstransition.cjs.js +2 -0
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.esm.js +2 -0
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +2 -0
- package/csstransition/csstransition.min.js +1 -1
- package/datascroller/datascroller.cjs.js +8 -1
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +8 -1
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +8 -1
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +4803 -3320
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +97 -28
- package/datatable/datatable.esm.js +4803 -3321
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +4801 -3322
- package/datatable/datatable.min.css +1 -1
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +4 -2
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +4 -2
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +4 -2
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +2 -0
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +2 -0
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +2 -0
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +12 -1
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +12 -1
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +12 -1
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +2 -0
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +2 -0
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +2 -0
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +5 -1
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +5 -1
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +5 -1
- package/dock/dock.min.css +1 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +15 -11
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +17 -13
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +15 -11
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +2 -0
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +2 -0
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +2 -0
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +2 -0
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +2 -0
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +2 -0
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +2 -0
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +2 -0
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +2 -0
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +2 -0
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +2 -0
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +2 -0
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +25 -5
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +25 -5
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +25 -5
- package/galleria/galleria.min.css +1 -1
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +2 -0
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.js +2 -0
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +2 -0
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +397 -0
- package/image/image.cjs.min.js +1 -0
- package/image/image.d.ts +18 -0
- package/image/image.esm.js +389 -0
- package/image/image.esm.min.js +1 -0
- package/image/image.js +400 -0
- package/image/image.min.css +1 -0
- package/image/image.min.js +1 -0
- package/image/package.json +6 -0
- package/inplace/inplace.cjs.js +2 -0
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +2 -0
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +2 -0
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +2 -0
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +2 -0
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +2 -0
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +177 -62
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +1 -0
- package/inputnumber/inputnumber.esm.js +177 -62
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +177 -62
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +16 -6
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.d.ts +3 -1
- package/inputswitch/inputswitch.esm.js +16 -6
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +16 -6
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +2 -0
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +2 -0
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +2 -0
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +2 -0
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.esm.js +2 -0
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +2 -0
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/knob/knob.cjs.js +2 -0
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +2 -0
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +2 -0
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +6 -3
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +7 -4
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +7 -5
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +2 -0
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +2 -0
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +2 -0
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +2 -0
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +2 -0
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +2 -0
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +2 -0
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +1 -1
- package/menu/menu.esm.js +2 -0
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +2 -0
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +2 -0
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +2 -0
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +2 -0
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +2 -0
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +2 -0
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -0
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +2 -0
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +2 -0
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +2 -0
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +22 -12
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +3 -1
- package/multiselect/multiselect.esm.js +24 -14
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +22 -12
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +2 -0
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +2 -0
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +2 -0
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +2 -0
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +2 -0
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +2 -0
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +2 -0
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +2 -0
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +2 -0
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +10 -1
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +10 -1
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +10 -1
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +120 -30
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.d.ts +13 -0
- package/paginator/paginator.esm.js +120 -30
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +121 -32
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +2 -0
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +2 -0
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +2 -0
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +2 -0
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +3 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +2 -0
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +2 -0
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +2 -0
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -0
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +2 -0
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +2 -0
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +2 -0
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +6 -2
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +6 -2
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +6 -2
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +12344 -9903
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +12340 -9903
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +12344 -9903
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +2 -0
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +2 -0
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +2 -0
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +2 -0
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +2 -0
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +2 -0
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +2 -0
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -0
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +2 -0
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +2 -0
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +2 -0
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +2 -0
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +340 -84
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +4600 -3838
- package/resources/themes/arya-green/theme.css +4600 -3838
- package/resources/themes/arya-orange/theme.css +4600 -3838
- package/resources/themes/arya-purple/theme.css +4600 -3838
- package/resources/themes/bootstrap4-dark-blue/theme.css +4601 -3837
- package/resources/themes/bootstrap4-dark-purple/theme.css +4601 -3837
- package/resources/themes/bootstrap4-light-blue/theme.css +4579 -3815
- package/resources/themes/bootstrap4-light-purple/theme.css +4579 -3815
- package/resources/themes/fluent-light/theme.css +4690 -3897
- package/resources/themes/luna-amber/theme.css +4555 -3807
- package/resources/themes/luna-blue/theme.css +4551 -3803
- package/resources/themes/luna-green/theme.css +4551 -3803
- package/resources/themes/luna-pink/theme.css +4555 -3807
- package/resources/themes/md-dark-deeppurple/theme.css +5580 -4689
- package/resources/themes/md-dark-indigo/theme.css +5578 -4687
- package/resources/themes/md-light-deeppurple/theme.css +5569 -4678
- package/resources/themes/md-light-indigo/theme.css +5569 -4678
- package/resources/themes/mdc-dark-deeppurple/theme.css +5575 -4684
- package/resources/themes/mdc-dark-indigo/theme.css +5583 -4692
- package/resources/themes/mdc-light-deeppurple/theme.css +5579 -4688
- package/resources/themes/mdc-light-indigo/theme.css +5579 -4688
- package/resources/themes/nova/theme.css +4554 -3802
- package/resources/themes/nova-accent/theme.css +4571 -3818
- package/resources/themes/nova-alt/theme.css +4560 -3806
- package/resources/themes/rhea/theme.css +4562 -3813
- package/resources/themes/saga-blue/theme.css +4608 -3847
- package/resources/themes/saga-green/theme.css +4608 -3847
- package/resources/themes/saga-orange/theme.css +4608 -3847
- package/resources/themes/saga-purple/theme.css +4607 -3846
- package/resources/themes/tailwind-light/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Light.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/tailwind-light/theme.css +5722 -0
- package/resources/themes/vela-blue/theme.css +4602 -3840
- package/resources/themes/vela-green/theme.css +4602 -3840
- package/resources/themes/vela-orange/theme.css +4602 -3840
- package/resources/themes/vela-purple/theme.css +4602 -3840
- package/ripple/ripple.cjs.js +2 -0
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +2 -0
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +2 -0
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +2 -0
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.js +2 -0
- package/row/row.esm.min.js +1 -1
- package/row/row.js +2 -0
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +2 -0
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +2 -0
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +2 -0
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +2 -0
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.esm.js +2 -0
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +2 -0
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +2 -0
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +2 -0
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +2 -0
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/sidebar.cjs.js +23 -27
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +23 -27
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +23 -27
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +2 -0
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +2 -0
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +2 -0
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +2 -0
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +2 -0
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +2 -0
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +14 -7
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +14 -7
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +14 -7
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +2 -0
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +2 -0
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +2 -0
- package/speeddial/speeddial.min.css +1 -1
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +2 -0
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +2 -0
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +2 -0
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +2 -0
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +2 -0
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +2 -0
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +2 -0
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +2 -0
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +2 -0
- package/steps/steps.min.js +1 -1
- package/styleclass/package.json +6 -0
- package/styleclass/styleclass.cjs.js +355 -0
- package/styleclass/styleclass.cjs.min.js +1 -0
- package/styleclass/styleclass.d.ts +18 -0
- package/styleclass/styleclass.esm.js +351 -0
- package/styleclass/styleclass.esm.min.js +1 -0
- package/styleclass/styleclass.js +358 -0
- package/styleclass/styleclass.min.js +1 -0
- package/tabmenu/tabmenu.cjs.js +2 -0
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +2 -0
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +2 -0
- package/tabmenu/tabmenu.min.css +1 -1
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +135 -18
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +1 -0
- package/tabview/tabview.esm.js +135 -18
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +135 -18
- package/tabview/tabview.min.css +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +2 -0
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.esm.js +2 -0
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +2 -0
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +2 -0
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +2 -0
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +2 -0
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +2 -0
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +1 -1
- package/tieredmenu/tieredmenu.esm.js +2 -0
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +2 -0
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +2 -0
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +2 -0
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +2 -0
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +9 -2
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +4 -0
- package/toast/toast.esm.js +9 -2
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +9 -2
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +2 -0
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +2 -0
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -0
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +2 -0
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +2 -0
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +2 -0
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +2 -0
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +2 -0
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +2 -0
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tree/tree.cjs.js +2 -0
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +2 -0
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +2 -0
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +1 -1
- package/treeselect/treeselect.cjs.js +2 -0
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +2 -0
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +2 -0
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +22 -8
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +23 -9
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +23 -10
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +2 -0
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +2 -0
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +2 -0
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +404 -496
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +20 -26
- package/utils/utils.esm.js +405 -496
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +404 -496
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +277 -160
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.d.ts +21 -9
- package/virtualscroller/virtualscroller.esm.js +277 -160
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +277 -160
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +168 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{createRef as t,Component as n}from"react";import{InputText as i}from"primereact/inputtext";import{tip as s,classNames as r,Ripple as o}from"primereact/core";function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function a(e){if(Array.isArray(e))return u(e)}function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(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})(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?d(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var I=function(u){y(S,n);var m,v,w,x,I,B=(m=S,v=k(),function(){var e,t=b(m);if(v){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function S(e){var n;return h(this,S),(n=B.call(this,e)).state={focused:!1},n.constructParser(),n.onInput=n.onInput.bind(d(n)),n.onInputKeyDown=n.onInputKeyDown.bind(d(n)),n.onInputKeyPress=n.onInputKeyPress.bind(d(n)),n.onInputClick=n.onInputClick.bind(d(n)),n.onInputBlur=n.onInputBlur.bind(d(n)),n.onInputFocus=n.onInputFocus.bind(d(n)),n.onPaste=n.onPaste.bind(d(n)),n.onUpButtonMouseLeave=n.onUpButtonMouseLeave.bind(d(n)),n.onUpButtonMouseDown=n.onUpButtonMouseDown.bind(d(n)),n.onUpButtonMouseUp=n.onUpButtonMouseUp.bind(d(n)),n.onUpButtonKeyDown=n.onUpButtonKeyDown.bind(d(n)),n.onUpButtonKeyUp=n.onUpButtonKeyUp.bind(d(n)),n.onDownButtonMouseLeave=n.onDownButtonMouseLeave.bind(d(n)),n.onDownButtonMouseDown=n.onDownButtonMouseDown.bind(d(n)),n.onDownButtonMouseUp=n.onDownButtonMouseUp.bind(d(n)),n.onDownButtonKeyDown=n.onDownButtonKeyDown.bind(d(n)),n.onDownButtonKeyUp=n.onDownButtonKeyUp.bind(d(n)),n.inputRef=t(n.props.inputRef),n}return w=S,(x=[{key:"getOptions",value:function(){return{localeMatcher:this.props.localeMatcher,style:this.props.mode,currency:this.props.currency,currencyDisplay:this.props.currencyDisplay,useGrouping:this.props.useGrouping,minimumFractionDigits:this.props.minFractionDigits,maximumFractionDigits:this.props.maxFractionDigits}}},{key:"constructParser",value:function(){this.numberFormat=new Intl.NumberFormat(this.props.locale,this.getOptions());var e,t=(e=new Intl.NumberFormat(this.props.locale,{useGrouping:!1}).format(9876543210),a(e)||l(e)||p(e)||c()).reverse(),n=new Map(t.map((function(e,t){return[e,t]})));this._numeral=new RegExp("[".concat(t.join(""),"]"),"g"),this._decimal=this.getDecimalExpression(),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=function(e){return n.get(e)}}},{key:"escapeRegExp",value:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},{key:"getDecimalExpression",value:function(){var e=new Intl.NumberFormat(this.props.locale,{useGrouping:!1});return new RegExp("[".concat(e.format(1.1).trim().replace(this._numeral,""),"]"),"g")}},{key:"getGroupingExpression",value:function(){var e=new Intl.NumberFormat(this.props.locale,{useGrouping:!0});return this.groupChar=e.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp("[".concat(this.groupChar,"]"),"g")}},{key:"getMinusSignExpression",value:function(){var e=new Intl.NumberFormat(this.props.locale,{useGrouping:!1});return new RegExp("[".concat(e.format(-1).trim().replace(this._numeral,""),"]"),"g")}},{key:"getCurrencyExpression",value:function(){if(this.props.currency){var e=new Intl.NumberFormat(this.props.locale,{style:"currency",currency:this.props.currency,currencyDisplay:this.props.currencyDisplay});return new RegExp("[".concat(e.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._decimal,"").replace(this._group,""),"]"),"g")}return new RegExp("[]","g")}},{key:"getPrefixExpression",value:function(){if(this.props.prefix)this.prefixChar=this.props.prefix;else{var e=new Intl.NumberFormat(this.props.locale,{style:this.props.mode,currency:this.props.currency,currencyDisplay:this.props.currencyDisplay});this.prefixChar=e.format(1).split("1")[0]}return new RegExp("".concat(this.escapeRegExp(this.prefixChar||"")),"g")}},{key:"getSuffixExpression",value:function(){if(this.props.suffix)this.suffixChar=this.props.suffix;else{var e=new Intl.NumberFormat(this.props.locale,{style:this.props.mode,currency:this.props.currency,currencyDisplay:this.props.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=e.format(1).split("1")[1]}return new RegExp("".concat(this.escapeRegExp(this.suffixChar||"")),"g")}},{key:"formatValue",value:function(e){if(null!=e){if("-"===e)return e;if(this.props.format){var t=new Intl.NumberFormat(this.props.locale,this.getOptions()).format(e);return this.props.prefix&&(t=this.props.prefix+t),this.props.suffix&&(t+=this.props.suffix),t}return e.toString()}return""}},{key:"parseValue",value:function(e){var t=e.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(t){if("-"===t)return t;var n=+t;return isNaN(n)?null:n}return null}},{key:"repeat",value:function(e,t,n){var i=this,s=t||500;this.clearTimer(),this.timer=setTimeout((function(){i.repeat(e,40,n)}),s),this.spin(e,n)}},{key:"spin",value:function(e,t){var n=this.props.step*t,i=this.parseValue(this.inputRef.current.value)||0,s=this.validateValue(i+n);this.updateInput(s,null,"spin"),this.updateModel(e,s),this.handleOnChange(e,i,s)}},{key:"onUpButtonMouseDown",value:function(e){this.props.disabled||(this.inputRef.current.focus(),this.repeat(e,null,1),e.preventDefault())}},{key:"onUpButtonMouseUp",value:function(){this.props.disabled||this.clearTimer()}},{key:"onUpButtonMouseLeave",value:function(){this.props.disabled||this.clearTimer()}},{key:"onUpButtonKeyUp",value:function(){this.props.disabled||this.clearTimer()}},{key:"onUpButtonKeyDown",value:function(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,1)}},{key:"onDownButtonMouseDown",value:function(e,t){this.props.disabled||(this.inputRef.current.focus(),this.repeat(e,null,-1),e.preventDefault())}},{key:"onDownButtonMouseUp",value:function(){this.props.disabled||this.clearTimer()}},{key:"onDownButtonMouseLeave",value:function(){this.props.disabled||this.clearTimer()}},{key:"onDownButtonKeyUp",value:function(){this.props.disabled||this.clearTimer()}},{key:"onDownButtonKeyDown",value:function(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,-1)}},{key:"onInput",value:function(e){this.isSpecialChar&&(e.target.value=this.lastValue),this.isSpecialChar=!1}},{key:"onInputKeyDown",value:function(e){if(this.lastValue=e.target.value,e.shiftKey||e.altKey)this.isSpecialChar=!0;else{var t=e.target.selectionStart,n=e.target.selectionEnd,i=e.target.value,s=null;switch(e.altKey&&e.preventDefault(),e.which){case 38:this.spin(e,1),e.preventDefault();break;case 40:this.spin(e,-1),e.preventDefault();break;case 37:var r=i.charAt(t-1);this.isNumeralChar(r)||e.preventDefault();break;case 39:var o=i.charAt(t);this.isNumeralChar(o)||e.preventDefault();break;case 13:s=this.validateValue(this.parseValue(i)),this.inputRef.current.value=this.formatValue(s),this.inputRef.current.setAttribute("aria-valuenow",s),this.updateModel(e,s);break;case 8:if(e.preventDefault(),t===n){var u=i.charAt(t-1),a=i.search(this._decimal);this._decimal.lastIndex=0,this.isNumeralChar(u)&&(this._group.test(u)?(this._group.lastIndex=0,s=i.slice(0,t-2)+i.slice(t-1)):this._decimal.test(u)?(this._decimal.lastIndex=0,this.inputRef.current.setSelectionRange(t-1,t-1)):a>0&&t>a?s=i.slice(0,t-1)+"0"+i.slice(t):a>0&&1===a?(s=i.slice(0,t-1)+"0"+i.slice(t),s=this.parseValue(s)>0?s:""):s=i.slice(0,t-1)+i.slice(t)),this.updateValue(e,s,null,"delete-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range");break;case 46:if(e.preventDefault(),t===n){var l=i.charAt(t),p=i.search(this._decimal);this._decimal.lastIndex=0,this.isNumeralChar(l)&&(this._group.test(l)?(this._group.lastIndex=0,s=i.slice(0,t)+i.slice(t+2)):this._decimal.test(l)?(this._decimal.lastIndex=0,this.inputRef.current.setSelectionRange(t+1,t+1)):p>0&&t>p?s=i.slice(0,t)+"0"+i.slice(t+1):p>0&&1===p?(s=i.slice(0,t)+"0"+i.slice(t+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,t)+i.slice(t+1)),this.updateValue(e,s,null,"delete-back-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range")}this.props.onKeyDown&&this.props.onKeyDown(e)}}},{key:"onInputKeyPress",value:function(e){e.preventDefault();var t=e.which||e.keyCode,n=String.fromCharCode(t),i=this.isDecimalSign(n),s=this.isMinusSign(n);(48<=t&&t<=57||s||i)&&this.insert(e,n,{isDecimalSign:i,isMinusSign:s})}},{key:"onPaste",value:function(e){e.preventDefault();var t=(e.clipboardData||window.clipboardData).getData("Text");if(t){var n=this.parseValue(t);null!=n&&this.insert(e,n.toString())}}},{key:"allowMinusSign",value:function(){return null===this.props.min||this.props.min<0}},{key:"isMinusSign",value:function(e){return!!this._minusSign.test(e)&&(this._minusSign.lastIndex=0,!0)}},{key:"isDecimalSign",value:function(e){return!!this._decimal.test(e)&&(this._decimal.lastIndex=0,!0)}},{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isDecimalSign:!1,isMinusSign:!1},i=t.search(this._minusSign);if(this._minusSign.lastIndex=0,this.allowMinusSign()||-1===i){var s=this.inputRef.current.selectionStart,r=this.inputRef.current.selectionEnd,o=this.inputRef.current.value.trim(),u=o.search(this._decimal);this._decimal.lastIndex=0;var a,l=o.search(this._minusSign);if(this._minusSign.lastIndex=0,n.isMinusSign)0===s&&(a=o,-1!==l&&0===r||(a=this.insertText(o,t,0,r)),this.updateValue(e,a,t,"insert"));else if(n.isDecimalSign)u>0&&s===u?this.updateValue(e,o,t,"insert"):u>s&&u<r&&(a=this.insertText(o,t,s,r),this.updateValue(e,a,t,"insert"));else{var p=this.numberFormat.resolvedOptions().maximumFractionDigits,c=s!==r?"range-insert":"insert";u>0&&s>u?s+t.length-(u+1)<=p&&(a=o.slice(0,s)+t+o.slice(s+t.length),this.updateValue(e,a,t,c)):(a=this.insertText(o,t,s,r),this.updateValue(e,a,t,c))}}}},{key:"insertText",value:function(e,t,n,i){if(2===t.split(".").length){var s=e.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?e.slice(0,n)+this.formatValue(t)+e.slice(i):e||this.formatValue(t)}return i-n===e.length?this.formatValue(t):0===n?t+e.slice(i):i===e.length?e.slice(0,n)+t:e.slice(0,n)+t+e.slice(i)}},{key:"deleteRange",value:function(e,t,n){return n-t===e.length?"":0===t?e.slice(n):n===e.length?e.slice(0,t):e.slice(0,t)+e.slice(n)}},{key:"initCursor",value:function(){var e=this.inputRef.current.selectionStart,t=this.inputRef.current.value,n=t.length,i=null,s=t.charAt(e);if(!this.isNumeralChar(s)){for(var r=e-1;r>=0;){if(s=t.charAt(r),this.isNumeralChar(s)){i=r;break}r--}if(null!==i)this.inputRef.current.setSelectionRange(i+1,i+1);else{for(r=e+1;r<n;){if(s=t.charAt(r),this.isNumeralChar(s)){i=r;break}r++}null!==i&&this.inputRef.current.setSelectionRange(i,i)}}}},{key:"onInputClick",value:function(){this.initCursor()}},{key:"isNumeralChar",value:function(e){return!(1!==e.length||!(this._numeral.test(e)||this._decimal.test(e)||this._group.test(e)||this._minusSign.test(e))||(this.resetRegex(),0))}},{key:"resetRegex",value:function(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0}},{key:"updateValue",value:function(e,t,n,i){var s=this.inputRef.current.value,r=null;null!=t&&(r=this.parseValue(t),this.updateInput(r,n,i)),this.handleOnChange(e,s,r)}},{key:"handleOnChange",value:function(e,t,n){this.props.onChange&&this.isValueChanged(t,n)&&this.props.onChange({originalEvent:e,value:n})}},{key:"isValueChanged",value:function(e,t){return null===t&&null!==e||null!=t&&t!==("string"==typeof e?this.parseValue(e):e)}},{key:"validateValue",value:function(e){return null!==this.props.min&&e<this.props.min?this.props.min:null!==this.props.max&&e>this.props.max?this.props.max:"-"===e?null:e}},{key:"updateInput",value:function(e,t,n){t=t||"";var i=this.inputRef.current,s=i.value,r=this.formatValue(e),o=s.length;if(0===o){i.value=r,i.setSelectionRange(0,0),this.initCursor();var u=(this.prefixChar||"").length+t.length;i.setSelectionRange(u,u)}else{var a=i.selectionStart,l=i.selectionEnd;i.value=r;var p=r.length;if("range-insert"===n){var c=this.parseValue((s||"").slice(0,a)),h=(null!==c?c.toString():"").split("").join("(".concat(this.groupChar,")?")),f=new RegExp(h,"g");f.test(r);var d=t.split("").join("(".concat(this.groupChar,")?")),m=new RegExp(d,"g");m.test(r.slice(f.lastIndex)),i.setSelectionRange(l=f.lastIndex+m.lastIndex,l)}else if(p===o)"insert"===n||"delete-back-single"===n?i.setSelectionRange(l+1,l+1):"delete-single"===n?i.setSelectionRange(l-1,l-1):"delete-range"!==n&&"spin"!==n||i.setSelectionRange(l,l);else if("delete-back-single"===n){var y=s.charAt(l-1),v=s.charAt(l),g=o-p,b=this._group.test(v);b&&1===g?l+=1:!b&&this.isNumeralChar(y)&&(l+=-1*g+1),this._group.lastIndex=0,i.setSelectionRange(l,l)}else"-"===s&&"insert"===n?i.setSelectionRange(l+1,l+1):i.setSelectionRange(l+=p-o,l)}i.setAttribute("aria-valuenow",e)}},{key:"updateInputValue",value:function(e){var t=this.inputRef.current,n=t.value,i=this.formatValue(e);n!==i&&(t.value=i,t.setAttribute("aria-valuenow",e))}},{key:"updateModel",value:function(e,t){this.props.onValueChange&&this.props.onValueChange({originalEvent:e,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:t}})}},{key:"onInputFocus",value:function(e){var t=this;e.persist(),this.setState({focused:!0},(function(){t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onInputBlur",value:function(e){var t=this;e.persist(),this.setState({focused:!1},(function(){var n=t.inputRef.current.value;if(t.isValueChanged(n,t.props.value)){var i=t.validateValue(t.parseValue(n));t.updateInputValue(i),t.updateModel(e,i)}t.props.onBlur&&t.props.onBlur(e)}))}},{key:"clearTimer",value:function(){this.timer&&clearInterval(this.timer)}},{key:"isStacked",value:function(){return this.props.showButtons&&"stacked"===this.props.buttonLayout}},{key:"isHorizontal",value:function(){return this.props.showButtons&&"horizontal"===this.props.buttonLayout}},{key:"isVertical",value:function(){return this.props.showButtons&&"vertical"===this.props.buttonLayout}},{key:"getInputMode",value:function(){return this.props.inputMode||("decimal"!==this.props.mode||this.props.minFractionDigits?"decimal":"numeric")}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.props.tooltip&&this.renderTooltip();var e=this.validateValue(this.props.value);this.props.value!==e&&this.updateModel(null,e)}},{key:"componentDidUpdate",value:function(e){e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(D({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip());var t=this.isOptionChanged(e);if(t&&this.constructParser(),e.value!==this.props.value||t){var n=this.validateValue(this.props.value);this.updateInputValue(n),this.props.value!==n&&this.updateModel(null,n)}}},{key:"isOptionChanged",value:function(e){var t=this;return["locale","localeMatcher","mode","currency","currencyDisplay","useGrouping","minFractionDigits","maxFractionDigits","suffix","prefix"].some((function(n){return e[n]!==t.props[n]}))}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=s({target:this.element,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"renderInputElement",value:function(){var t=r("p-inputnumber-input",this.props.inputClassName),n=this.formatValue(this.props.value);return e.createElement(i,{ref:this.inputRef,id:this.props.inputId,style:this.props.inputStyle,role:"spinbutton",className:t,defaultValue:n,type:this.props.type,size:this.props.size,tabIndex:this.props.tabIndex,inputMode:this.getInputMode(),maxLength:this.props.maxlength,disabled:this.props.disabled,required:this.props.required,pattern:this.props.pattern,placeholder:this.props.placeholder,readOnly:this.props.readOnly,name:this.props.name,autoFocus:this.props.autoFocus,onKeyDown:this.onInputKeyDown,onKeyPress:this.onInputKeyPress,onInput:this.onInput,onClick:this.onInputClick,onBlur:this.onInputBlur,onFocus:this.onInputFocus,onPaste:this.onPaste,min:this.props.min,max:this.props.max,"aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":this.props.value,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderUpButton",value:function(){var t=r("p-inputnumber-button p-inputnumber-button-up p-button p-button-icon-only p-component",{"p-disabled":this.props.disabled},this.props.incrementButtonClassName),n=r("p-button-icon",this.props.incrementButtonIcon);return e.createElement("button",{type:"button",className:t,onMouseLeave:this.onUpButtonMouseLeave,onMouseDown:this.onUpButtonMouseDown,onMouseUp:this.onUpButtonMouseUp,onKeyDown:this.onUpButtonKeyDown,onKeyUp:this.onUpButtonKeyUp,disabled:this.props.disabled,tabIndex:-1},e.createElement("span",{className:n}),e.createElement(o,null))}},{key:"renderDownButton",value:function(){var t=r("p-inputnumber-button p-inputnumber-button-down p-button p-button-icon-only p-component",{"p-disabled":this.props.disabled},this.props.decrementButtonClassName),n=r("p-button-icon",this.props.decrementButtonIcon);return e.createElement("button",{type:"button",className:t,onMouseLeave:this.onDownButtonMouseLeave,onMouseDown:this.onDownButtonMouseDown,onMouseUp:this.onDownButtonMouseUp,onKeyDown:this.onDownButtonKeyDown,onKeyUp:this.onDownButtonKeyUp,disabled:this.props.disabled,tabIndex:-1},e.createElement("span",{className:n}),e.createElement(o,null))}},{key:"renderButtonGroup",value:function(){var t=this.props.showButtons&&this.renderUpButton(),n=this.props.showButtons&&this.renderDownButton();return this.isStacked()?e.createElement("span",{className:"p-inputnumber-button-group"},t,n):e.createElement(e.Fragment,null,t,n)}},{key:"render",value:function(){var t=this,n=r("p-inputnumber p-component",this.props.className,{"p-inputwrapper-filled":null!=this.props.value&&this.props.value.toString().length>0,"p-inputwrapper-focus":this.state.focused,"p-inputnumber-buttons-stacked":this.isStacked(),"p-inputnumber-buttons-horizontal":this.isHorizontal(),"p-inputnumber-buttons-vertical":this.isVertical()}),i=this.renderInputElement(),s=this.renderButtonGroup();return e.createElement("span",{ref:function(e){return t.element=e},id:this.props.id,className:n,style:this.props.style},i,s)}}])&&f(w.prototype,x),I&&f(w,I),S}();w(I,"defaultProps",{value:null,inputRef:null,format:!0,showButtons:!1,buttonLayout:"stacked",incrementButtonClassName:null,decrementButtonClassName:null,incrementButtonIcon:"pi pi-angle-up",decrementButtonIcon:"pi pi-angle-down",locale:void 0,localeMatcher:void 0,mode:"decimal",suffix:null,prefix:null,currency:void 0,currencyDisplay:void 0,useGrouping:!0,minFractionDigits:void 0,maxFractionDigits:void 0,id:null,name:null,type:"text",step:1,min:null,max:null,disabled:!1,required:!1,tabIndex:null,pattern:null,inputMode:null,placeholder:null,readOnly:!1,size:null,style:null,className:null,inputId:null,autoFocus:!1,inputStyle:null,inputClassName:null,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onValueChange:null,onChange:null,onBlur:null,onFocus:null,onKeyDown:null});export{I as InputNumber};
|
|
1
|
+
import e,{createRef as t,Component as n}from"react";import{InputText as i}from"primereact/inputtext";import{tip as r,classNames as s,Ripple as o}from"primereact/core";function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function a(e){if(Array.isArray(e))return u(e)}function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(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})(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function I(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var k=function(u){y(_,n);var m,v,x,w,k,C=(m=_,v=I(),function(){var e,t=b(m);if(v){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function _(e){var n;return h(this,_),(n=C.call(this,e)).state={focused:!1},n.constructParser(),n.onInput=n.onInput.bind(d(n)),n.onInputKeyDown=n.onInputKeyDown.bind(d(n)),n.onInputKeyPress=n.onInputKeyPress.bind(d(n)),n.onInputClick=n.onInputClick.bind(d(n)),n.onInputBlur=n.onInputBlur.bind(d(n)),n.onInputFocus=n.onInputFocus.bind(d(n)),n.onPaste=n.onPaste.bind(d(n)),n.onUpButtonMouseLeave=n.onUpButtonMouseLeave.bind(d(n)),n.onUpButtonMouseDown=n.onUpButtonMouseDown.bind(d(n)),n.onUpButtonMouseUp=n.onUpButtonMouseUp.bind(d(n)),n.onUpButtonKeyDown=n.onUpButtonKeyDown.bind(d(n)),n.onUpButtonKeyUp=n.onUpButtonKeyUp.bind(d(n)),n.onDownButtonMouseLeave=n.onDownButtonMouseLeave.bind(d(n)),n.onDownButtonMouseDown=n.onDownButtonMouseDown.bind(d(n)),n.onDownButtonMouseUp=n.onDownButtonMouseUp.bind(d(n)),n.onDownButtonKeyDown=n.onDownButtonKeyDown.bind(d(n)),n.onDownButtonKeyUp=n.onDownButtonKeyUp.bind(d(n)),n.inputRef=t(n.props.inputRef),n}return x=_,(w=[{key:"getOptions",value:function(){return{localeMatcher:this.props.localeMatcher,style:this.props.mode,currency:this.props.currency,currencyDisplay:this.props.currencyDisplay,useGrouping:this.props.useGrouping,minimumFractionDigits:this.props.minFractionDigits,maximumFractionDigits:this.props.maxFractionDigits}}},{key:"constructParser",value:function(){this.numberFormat=new Intl.NumberFormat(this.props.locale,this.getOptions());var e,t=(e=new Intl.NumberFormat(this.props.locale,{useGrouping:!1}).format(9876543210),a(e)||l(e)||p(e)||c()).reverse(),n=new Map(t.map((function(e,t){return[e,t]})));this._numeral=new RegExp("[".concat(t.join(""),"]"),"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=function(e){return n.get(e)}}},{key:"escapeRegExp",value:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},{key:"getDecimalExpression",value:function(){var e=new Intl.NumberFormat(this.props.locale,D(D({},this.getOptions()),{},{useGrouping:!1}));return new RegExp("[".concat(e.format(1.1).replace(this._currency,"").trim().replace(this._numeral,""),"]"),"g")}},{key:"getGroupingExpression",value:function(){var e=new Intl.NumberFormat(this.props.locale,{useGrouping:!0});return this.groupChar=e.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp("[".concat(this.groupChar,"]"),"g")}},{key:"getMinusSignExpression",value:function(){var e=new Intl.NumberFormat(this.props.locale,{useGrouping:!1});return new RegExp("[".concat(e.format(-1).trim().replace(this._numeral,""),"]"),"g")}},{key:"getCurrencyExpression",value:function(){if(this.props.currency){var e=new Intl.NumberFormat(this.props.locale,{style:"currency",currency:this.props.currency,currencyDisplay:this.props.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp("[".concat(e.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,""),"]"),"g")}return new RegExp("[]","g")}},{key:"getPrefixExpression",value:function(){if(this.props.prefix)this.prefixChar=this.props.prefix;else{var e=new Intl.NumberFormat(this.props.locale,{style:this.props.mode,currency:this.props.currency,currencyDisplay:this.props.currencyDisplay});this.prefixChar=e.format(1).split("1")[0]}return new RegExp("".concat(this.escapeRegExp(this.prefixChar||"")),"g")}},{key:"getSuffixExpression",value:function(){if(this.props.suffix)this.suffixChar=this.props.suffix;else{var e=new Intl.NumberFormat(this.props.locale,{style:this.props.mode,currency:this.props.currency,currencyDisplay:this.props.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=e.format(1).split("1")[1]}return new RegExp("".concat(this.escapeRegExp(this.suffixChar||"")),"g")}},{key:"formatValue",value:function(e){if(null!=e){if("-"===e)return e;if(this.props.format){var t=new Intl.NumberFormat(this.props.locale,this.getOptions()).format(e);return this.props.prefix&&(t=this.props.prefix+t),this.props.suffix&&(t+=this.props.suffix),t}return e.toString()}return""}},{key:"parseValue",value:function(e){var t=e.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(t){if("-"===t)return t;var n=+t;return isNaN(n)?null:n}return null}},{key:"repeat",value:function(e,t,n){var i=this,r=t||500;this.clearTimer(),this.timer=setTimeout((function(){i.repeat(e,40,n)}),r),this.spin(e,n)}},{key:"spin",value:function(e,t){if(this.inputRef&&this.inputRef.current){var n=this.props.step*t,i=this.parseValue(this.inputRef.current.value)||0,r=this.validateValue(i+n);this.updateInput(r,null,"spin"),this.updateModel(e,r),this.handleOnChange(e,i,r)}}},{key:"onUpButtonMouseDown",value:function(e){this.props.disabled||(this.inputRef.current.focus(),this.repeat(e,null,1),e.preventDefault())}},{key:"onUpButtonMouseUp",value:function(){this.props.disabled||this.clearTimer()}},{key:"onUpButtonMouseLeave",value:function(){this.props.disabled||this.clearTimer()}},{key:"onUpButtonKeyUp",value:function(){this.props.disabled||this.clearTimer()}},{key:"onUpButtonKeyDown",value:function(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,1)}},{key:"onDownButtonMouseDown",value:function(e){this.props.disabled||(this.inputRef.current.focus(),this.repeat(e,null,-1),e.preventDefault())}},{key:"onDownButtonMouseUp",value:function(){this.props.disabled||this.clearTimer()}},{key:"onDownButtonMouseLeave",value:function(){this.props.disabled||this.clearTimer()}},{key:"onDownButtonKeyUp",value:function(){this.props.disabled||this.clearTimer()}},{key:"onDownButtonKeyDown",value:function(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,-1)}},{key:"onInput",value:function(e){this.isSpecialChar&&(e.target.value=this.lastValue),this.isSpecialChar=!1}},{key:"onInputKeyDown",value:function(e){if(this.lastValue=e.target.value,e.shiftKey||e.altKey)this.isSpecialChar=!0;else{var t=e.target.selectionStart,n=e.target.selectionEnd,i=e.target.value,r=null;switch(e.altKey&&e.preventDefault(),e.which){case 38:this.spin(e,1),e.preventDefault();break;case 40:this.spin(e,-1),e.preventDefault();break;case 37:this.isNumeralChar(i.charAt(t-1))||e.preventDefault();break;case 39:this.isNumeralChar(i.charAt(t))||e.preventDefault();break;case 13:r=this.validateValue(this.parseValue(i)),this.inputRef.current.value=this.formatValue(r),this.inputRef.current.setAttribute("aria-valuenow",r),this.updateModel(e,r);break;case 8:if(e.preventDefault(),t===n){var s=i.charAt(t-1),o=this.getDecimalCharIndexes(i),u=o.decimalCharIndex,a=o.decimalCharIndexWithoutPrefix;if(this.isNumeralChar(s)){var l=this.getDecimalLength(i);if(this._group.test(s))this._group.lastIndex=0,r=i.slice(0,t-2)+i.slice(t-1);else if(this._decimal.test(s))this._decimal.lastIndex=0,l?this.inputRef.current.setSelectionRange(t-1,t-1):r=i.slice(0,t-1)+i.slice(t);else if(u>0&&t>u){var p=this.isDecimalMode()&&(this.props.minFractionDigits||0)<l?"":"0";r=i.slice(0,t-1)+p+i.slice(t)}else 1===a?(r=i.slice(0,t-1)+"0"+i.slice(t),r=this.parseValue(r)>0?r:""):r=i.slice(0,t-1)+i.slice(t)}this.updateValue(e,r,null,"delete-single")}else r=this.deleteRange(i,t,n),this.updateValue(e,r,null,"delete-range");break;case 46:if(e.preventDefault(),t===n){var c=i.charAt(t),h=this.getDecimalCharIndexes(i),f=h.decimalCharIndex,d=h.decimalCharIndexWithoutPrefix;if(this.isNumeralChar(c)){var m=this.getDecimalLength(i);if(this._group.test(c))this._group.lastIndex=0,r=i.slice(0,t)+i.slice(t+2);else if(this._decimal.test(c))this._decimal.lastIndex=0,m?this.$refs.input.$el.setSelectionRange(t+1,t+1):r=i.slice(0,t)+i.slice(t+1);else if(f>0&&t>f){var y=this.isDecimalMode()&&(this.props.minFractionDigits||0)<m?"":"0";r=i.slice(0,t)+y+i.slice(t+1)}else 1===d?(r=i.slice(0,t)+"0"+i.slice(t+1),r=this.parseValue(r)>0?r:""):r=i.slice(0,t)+i.slice(t+1)}this.updateValue(e,r,null,"delete-back-single")}else r=this.deleteRange(i,t,n),this.updateValue(e,r,null,"delete-range")}this.props.onKeyDown&&this.props.onKeyDown(e)}}},{key:"onInputKeyPress",value:function(e){e.preventDefault();var t=e.which||e.keyCode,n=String.fromCharCode(t),i=this.isDecimalSign(n),r=this.isMinusSign(n);(48<=t&&t<=57||r||i)&&this.insert(e,n,{isDecimalSign:i,isMinusSign:r})}},{key:"onPaste",value:function(e){e.preventDefault();var t=(e.clipboardData||window.clipboardData).getData("Text");if(t){var n=this.parseValue(t);null!=n&&this.insert(e,n.toString())}}},{key:"allowMinusSign",value:function(){return null===this.props.min||this.props.min<0}},{key:"isMinusSign",value:function(e){return!(!this._minusSign.test(e)&&"-"!==e||(this._minusSign.lastIndex=0,0))}},{key:"isDecimalSign",value:function(e){return!!this._decimal.test(e)&&(this._decimal.lastIndex=0,!0)}},{key:"isDecimalMode",value:function(){return"decimal"===this.props.mode}},{key:"getDecimalCharIndexes",value:function(e){var t=e.search(this._decimal);this._decimal.lastIndex=0;var n=e.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:t,decimalCharIndexWithoutPrefix:n}}},{key:"getCharIndexes",value:function(e){var t=e.search(this._decimal);this._decimal.lastIndex=0;var n=e.search(this._minusSign);this._minusSign.lastIndex=0;var i=e.search(this._suffix);this._suffix.lastIndex=0;var r=e.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:t,minusCharIndex:n,suffixCharIndex:i,currencyCharIndex:r}}},{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isDecimalSign:!1,isMinusSign:!1},i=t.search(this._minusSign);if(this._minusSign.lastIndex=0,this.allowMinusSign()||-1===i){var r,s=this.inputRef.current.selectionStart,o=this.inputRef.current.selectionEnd,u=this.inputRef.current.value.trim(),a=this.getCharIndexes(u),l=a.decimalCharIndex,p=a.minusCharIndex,c=a.suffixCharIndex,h=a.currencyCharIndex;if(n.isMinusSign)0===s&&(r=u,-1!==p&&0===o||(r=this.insertText(u,t,0,o)),this.updateValue(e,r,t,"insert"));else if(n.isDecimalSign)l>0&&s===l?this.updateValue(e,u,t,"insert"):(l>s&&l<o||-1===l&&this.props.maxFractionDigits)&&(r=this.insertText(u,t,s,o),this.updateValue(e,r,t,"insert"));else{var f=this.numberFormat.resolvedOptions().maximumFractionDigits,d=s!==o?"range-insert":"insert";if(l>0&&s>l){if(s+t.length-(l+1)<=f){var m=h>=s?h-1:c>=s?c:u.length;r=u.slice(0,s)+t+u.slice(s+t.length,m)+u.slice(m),this.updateValue(e,r,t,d)}}else r=this.insertText(u,t,s,o),this.updateValue(e,r,t,d)}}}},{key:"insertText",value:function(e,t,n,i){if(2===("."===t?t:t.split(".")).length){var r=e.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,r>0?e.slice(0,n)+this.formatValue(t)+e.slice(i):e||this.formatValue(t)}return i-n===e.length?this.formatValue(t):0===n?t+e.slice(i):i===e.length?e.slice(0,n)+t:e.slice(0,n)+t+e.slice(i)}},{key:"deleteRange",value:function(e,t,n){return n-t===e.length?"":0===t?e.slice(n):n===e.length?e.slice(0,t):e.slice(0,t)+e.slice(n)}},{key:"initCursor",value:function(){var e=this.inputRef.current.selectionStart,t=this.inputRef.current.value,n=t.length,i=null,r=(this.prefixChar||"").length,s=(t=t.replace(this._prefix,"")).charAt(e-=r);if(this.isNumeralChar(s))return e+r;for(var o=e-1;o>=0;){if(s=t.charAt(o),this.isNumeralChar(s)){i=o+r;break}o--}if(null!==i)this.inputRef.current.setSelectionRange(i+1,i+1);else{for(o=e;o<n;){if(s=t.charAt(o),this.isNumeralChar(s)){i=o+r;break}o++}null!==i&&this.inputRef.current.setSelectionRange(i,i)}return i||0}},{key:"onInputClick",value:function(){this.initCursor()}},{key:"isNumeralChar",value:function(e){return!(1!==e.length||!(this._numeral.test(e)||this._decimal.test(e)||this._group.test(e)||this._minusSign.test(e))||(this.resetRegex(),0))}},{key:"resetRegex",value:function(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0}},{key:"updateValue",value:function(e,t,n,i){var r=this.inputRef.current.value,s=null;null!=t&&(s=this.parseValue(t),this.updateInput(s=s||this.props.allowEmpty?s:0,n,i,t),this.handleOnChange(e,r,s))}},{key:"handleOnChange",value:function(e,t,n){this.props.onChange&&this.isValueChanged(t,n)&&this.props.onChange({originalEvent:e,value:n})}},{key:"isValueChanged",value:function(e,t){return null===t&&null!==e||null!=t&&t!==("string"==typeof e?this.parseValue(e):e)}},{key:"validateValue",value:function(e){return"-"===e||null==e?null:null!==this.props.min&&e<this.props.min?this.props.min:null!==this.props.max&&e>this.props.max?this.props.max:e}},{key:"updateInput",value:function(e,t,n,i){t=t||"";var r=this.inputRef.current,s=r.value,o=this.formatValue(e),u=s.length;if(o!==i&&(o=this.concatValues(o,i)),0===u){r.value=o,r.setSelectionRange(0,0);var a=this.initCursor()+t.length;r.setSelectionRange(a,a)}else{var l=r.selectionStart,p=r.selectionEnd;r.value=o;var c=o.length;if("range-insert"===n){var h=this.parseValue((s||"").slice(0,l)),f=(null!==h?h.toString():"").split("").join("(".concat(this.groupChar,")?")),d=new RegExp(f,"g");d.test(o);var m=t.split("").join("(".concat(this.groupChar,")?")),y=new RegExp(m,"g");y.test(o.slice(d.lastIndex)),r.setSelectionRange(p=d.lastIndex+y.lastIndex,p)}else if(c===u)"insert"===n||"delete-back-single"===n?r.setSelectionRange(p+1,p+1):"delete-single"===n?r.setSelectionRange(p-1,p-1):"delete-range"!==n&&"spin"!==n||r.setSelectionRange(p,p);else if("delete-back-single"===n){var v=s.charAt(p-1),g=s.charAt(p),b=u-c,x=this._group.test(g);x&&1===b?p+=1:!x&&this.isNumeralChar(v)&&(p+=-1*b+1),this._group.lastIndex=0,r.setSelectionRange(p,p)}else if("-"===s&&"insert"===n){r.setSelectionRange(0,0);var w=this.initCursor()+t.length+1;r.setSelectionRange(w,w)}else r.setSelectionRange(p+=c-u,p)}r.setAttribute("aria-valuenow",e)}},{key:"updateInputValue",value:function(e){var t=this.inputRef.current,n=t.value,i=this.formattedValue(e=e||this.props.allowEmpty?e:0);n!==i&&(t.value=i,t.setAttribute("aria-valuenow",e))}},{key:"formattedValue",value:function(e){return this.formatValue(e||this.props.allowEmpty?e:0)}},{key:"concatValues",value:function(e,t){if(e&&t){var n=t.search(this._decimal);return this._decimal.lastIndex=0,-1!==n?e.split(this._decimal)[0]+t.slice(n):e}return e}},{key:"getDecimalLength",value:function(e){if(e){var t=e.split(this._decimal);if(2===t.length)return t[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0}},{key:"updateModel",value:function(e,t){this.props.onValueChange&&this.props.onValueChange({originalEvent:e,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:t}})}},{key:"onInputFocus",value:function(e){var t=this;e.persist(),this.setState({focused:!0},(function(){t.props.onFocus&&t.props.onFocus(e)}))}},{key:"onInputBlur",value:function(e){var t=this;e.persist(),this.setState({focused:!1},(function(){var n=t.inputRef.current.value;if(t.isValueChanged(n,t.props.value)){var i=t.validateValue(t.parseValue(n));t.updateInputValue(i),t.updateModel(e,i)}t.props.onBlur&&t.props.onBlur(e)}))}},{key:"clearTimer",value:function(){this.timer&&clearInterval(this.timer)}},{key:"isStacked",value:function(){return this.props.showButtons&&"stacked"===this.props.buttonLayout}},{key:"isHorizontal",value:function(){return this.props.showButtons&&"horizontal"===this.props.buttonLayout}},{key:"isVertical",value:function(){return this.props.showButtons&&"vertical"===this.props.buttonLayout}},{key:"getInputMode",value:function(){return this.props.inputMode||("decimal"!==this.props.mode||this.props.minFractionDigits?"decimal":"numeric")}},{key:"getFormatter",value:function(){return this.numberFormat}},{key:"updateInputRef",value:function(){var e=this.props.inputRef;e&&("function"==typeof e?e(this.inputRef.current):e.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.props.tooltip&&this.renderTooltip();var e=this.validateValue(this.props.value);null!==this.props.value&&this.props.value!==e&&this.updateModel(null,e)}},{key:"componentDidUpdate",value:function(e){e.tooltip===this.props.tooltip&&e.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(D({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip());var t=this.isOptionChanged(e);if(t&&this.constructParser(),e.value!==this.props.value||t){var n=this.validateValue(this.props.value);this.updateInputValue(n),null!==this.props.value&&this.props.value!==n&&this.updateModel(null,n)}}},{key:"isOptionChanged",value:function(e){var t=this;return["locale","localeMatcher","mode","currency","currencyDisplay","useGrouping","minFractionDigits","maxFractionDigits","suffix","prefix"].some((function(n){return e[n]!==t.props[n]}))}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=r({target:this.element,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"renderInputElement",value:function(){var t=s("p-inputnumber-input",this.props.inputClassName),n=this.formattedValue(this.props.value);return e.createElement(i,{ref:this.inputRef,id:this.props.inputId,style:this.props.inputStyle,role:"spinbutton",className:t,defaultValue:n,type:this.props.type,size:this.props.size,tabIndex:this.props.tabIndex,inputMode:this.getInputMode(),maxLength:this.props.maxlength,disabled:this.props.disabled,required:this.props.required,pattern:this.props.pattern,placeholder:this.props.placeholder,readOnly:this.props.readOnly,name:this.props.name,autoFocus:this.props.autoFocus,onKeyDown:this.onInputKeyDown,onKeyPress:this.onInputKeyPress,onInput:this.onInput,onClick:this.onInputClick,onBlur:this.onInputBlur,onFocus:this.onInputFocus,onPaste:this.onPaste,min:this.props.min,max:this.props.max,"aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":this.props.value,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderUpButton",value:function(){var t=s("p-inputnumber-button p-inputnumber-button-up p-button p-button-icon-only p-component",{"p-disabled":this.props.disabled},this.props.incrementButtonClassName),n=s("p-button-icon",this.props.incrementButtonIcon);return e.createElement("button",{type:"button",className:t,onMouseLeave:this.onUpButtonMouseLeave,onMouseDown:this.onUpButtonMouseDown,onMouseUp:this.onUpButtonMouseUp,onKeyDown:this.onUpButtonKeyDown,onKeyUp:this.onUpButtonKeyUp,disabled:this.props.disabled,tabIndex:-1},e.createElement("span",{className:n}),e.createElement(o,null))}},{key:"renderDownButton",value:function(){var t=s("p-inputnumber-button p-inputnumber-button-down p-button p-button-icon-only p-component",{"p-disabled":this.props.disabled},this.props.decrementButtonClassName),n=s("p-button-icon",this.props.decrementButtonIcon);return e.createElement("button",{type:"button",className:t,onMouseLeave:this.onDownButtonMouseLeave,onMouseDown:this.onDownButtonMouseDown,onMouseUp:this.onDownButtonMouseUp,onKeyDown:this.onDownButtonKeyDown,onKeyUp:this.onDownButtonKeyUp,disabled:this.props.disabled,tabIndex:-1},e.createElement("span",{className:n}),e.createElement(o,null))}},{key:"renderButtonGroup",value:function(){var t=this.props.showButtons&&this.renderUpButton(),n=this.props.showButtons&&this.renderDownButton();return this.isStacked()?e.createElement("span",{className:"p-inputnumber-button-group"},t,n):e.createElement(e.Fragment,null,t,n)}},{key:"render",value:function(){var t=this,n=s("p-inputnumber p-component p-inputwrapper",this.props.className,{"p-inputwrapper-filled":null!=this.props.value&&this.props.value.toString().length>0,"p-inputwrapper-focus":this.state.focused,"p-inputnumber-buttons-stacked":this.isStacked(),"p-inputnumber-buttons-horizontal":this.isHorizontal(),"p-inputnumber-buttons-vertical":this.isVertical()}),i=this.renderInputElement(),r=this.renderButtonGroup();return e.createElement("span",{ref:function(e){return t.element=e},id:this.props.id,className:n,style:this.props.style},i,r)}}])&&f(x.prototype,w),k&&f(x,k),_}();x(k,"defaultProps",{value:null,inputRef:null,format:!0,showButtons:!1,buttonLayout:"stacked",incrementButtonClassName:null,decrementButtonClassName:null,incrementButtonIcon:"pi pi-angle-up",decrementButtonIcon:"pi pi-angle-down",locale:void 0,localeMatcher:void 0,mode:"decimal",suffix:null,prefix:null,currency:void 0,currencyDisplay:void 0,useGrouping:!0,minFractionDigits:void 0,maxFractionDigits:void 0,id:null,name:null,type:"text",allowEmpty:!0,step:1,min:null,max:null,disabled:!1,required:!1,tabIndex:null,pattern:null,inputMode:null,placeholder:null,readOnly:!1,size:null,style:null,className:null,inputId:null,autoFocus:!1,inputStyle:null,inputClassName:null,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onValueChange:null,onChange:null,onBlur:null,onFocus:null,onKeyDown:null});export{k as InputNumber};
|
|
@@ -114,6 +114,8 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
114
114
|
function _possibleConstructorReturn(self, call) {
|
|
115
115
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
116
116
|
return call;
|
|
117
|
+
} else if (call !== void 0) {
|
|
118
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
return _assertThisInitialized(self);
|
|
@@ -212,10 +214,10 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
212
214
|
return [d, i];
|
|
213
215
|
}));
|
|
214
216
|
this._numeral = new RegExp("[".concat(numerals.join(''), "]"), 'g');
|
|
215
|
-
this._decimal = this.getDecimalExpression();
|
|
216
217
|
this._group = this.getGroupingExpression();
|
|
217
218
|
this._minusSign = this.getMinusSignExpression();
|
|
218
219
|
this._currency = this.getCurrencyExpression();
|
|
220
|
+
this._decimal = this.getDecimalExpression();
|
|
219
221
|
this._suffix = this.getSuffixExpression();
|
|
220
222
|
this._prefix = this.getPrefixExpression();
|
|
221
223
|
|
|
@@ -231,10 +233,10 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
231
233
|
}, {
|
|
232
234
|
key: "getDecimalExpression",
|
|
233
235
|
value: function getDecimalExpression() {
|
|
234
|
-
var formatter = new Intl.NumberFormat(this.props.locale, {
|
|
236
|
+
var formatter = new Intl.NumberFormat(this.props.locale, _objectSpread(_objectSpread({}, this.getOptions()), {}, {
|
|
235
237
|
useGrouping: false
|
|
236
|
-
});
|
|
237
|
-
return new RegExp("[".concat(formatter.format(1.1).trim().replace(this._numeral, ''), "]"), 'g');
|
|
238
|
+
}));
|
|
239
|
+
return new RegExp("[".concat(formatter.format(1.1).replace(this._currency, '').trim().replace(this._numeral, ''), "]"), 'g');
|
|
238
240
|
}
|
|
239
241
|
}, {
|
|
240
242
|
key: "getGroupingExpression",
|
|
@@ -260,12 +262,14 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
260
262
|
var formatter = new Intl.NumberFormat(this.props.locale, {
|
|
261
263
|
style: 'currency',
|
|
262
264
|
currency: this.props.currency,
|
|
263
|
-
currencyDisplay: this.props.currencyDisplay
|
|
265
|
+
currencyDisplay: this.props.currencyDisplay,
|
|
266
|
+
minimumFractionDigits: 0,
|
|
267
|
+
maximumFractionDigits: 0
|
|
264
268
|
});
|
|
265
|
-
return new RegExp("[".concat(formatter.format(1).replace(/\s/g, '').replace(this._numeral, '').replace(this.
|
|
266
|
-
} else {
|
|
267
|
-
return new RegExp("[]", 'g');
|
|
269
|
+
return new RegExp("[".concat(formatter.format(1).replace(/\s/g, '').replace(this._numeral, '').replace(this._group, ''), "]"), 'g');
|
|
268
270
|
}
|
|
271
|
+
|
|
272
|
+
return new RegExp("[]", 'g');
|
|
269
273
|
}
|
|
270
274
|
}, {
|
|
271
275
|
key: "getPrefixExpression",
|
|
@@ -359,12 +363,14 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
359
363
|
}, {
|
|
360
364
|
key: "spin",
|
|
361
365
|
value: function spin(event, dir) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
366
|
+
if (this.inputRef && this.inputRef.current) {
|
|
367
|
+
var step = this.props.step * dir;
|
|
368
|
+
var currentValue = this.parseValue(this.inputRef.current.value) || 0;
|
|
369
|
+
var newValue = this.validateValue(currentValue + step);
|
|
370
|
+
this.updateInput(newValue, null, 'spin');
|
|
371
|
+
this.updateModel(event, newValue);
|
|
372
|
+
this.handleOnChange(event, currentValue, newValue);
|
|
373
|
+
}
|
|
368
374
|
}
|
|
369
375
|
}, {
|
|
370
376
|
key: "onUpButtonMouseDown",
|
|
@@ -405,7 +411,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
405
411
|
}
|
|
406
412
|
}, {
|
|
407
413
|
key: "onDownButtonMouseDown",
|
|
408
|
-
value: function onDownButtonMouseDown(event
|
|
414
|
+
value: function onDownButtonMouseDown(event) {
|
|
409
415
|
if (!this.props.disabled) {
|
|
410
416
|
this.inputRef.current.focus();
|
|
411
417
|
this.repeat(event, null, -1);
|
|
@@ -483,9 +489,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
483
489
|
//left
|
|
484
490
|
|
|
485
491
|
case 37:
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
if (!this.isNumeralChar(prevChar)) {
|
|
492
|
+
if (!this.isNumeralChar(inputValue.charAt(selectionStart - 1))) {
|
|
489
493
|
event.preventDefault();
|
|
490
494
|
}
|
|
491
495
|
|
|
@@ -493,9 +497,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
493
497
|
//right
|
|
494
498
|
|
|
495
499
|
case 39:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
if (!this.isNumeralChar(currentChar)) {
|
|
500
|
+
if (!this.isNumeralChar(inputValue.charAt(selectionStart))) {
|
|
499
501
|
event.preventDefault();
|
|
500
502
|
}
|
|
501
503
|
|
|
@@ -515,19 +517,29 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
515
517
|
|
|
516
518
|
if (selectionStart === selectionEnd) {
|
|
517
519
|
var deleteChar = inputValue.charAt(selectionStart - 1);
|
|
518
|
-
|
|
519
|
-
|
|
520
|
+
|
|
521
|
+
var _this$getDecimalCharI = this.getDecimalCharIndexes(inputValue),
|
|
522
|
+
decimalCharIndex = _this$getDecimalCharI.decimalCharIndex,
|
|
523
|
+
decimalCharIndexWithoutPrefix = _this$getDecimalCharI.decimalCharIndexWithoutPrefix;
|
|
520
524
|
|
|
521
525
|
if (this.isNumeralChar(deleteChar)) {
|
|
526
|
+
var decimalLength = this.getDecimalLength(inputValue);
|
|
527
|
+
|
|
522
528
|
if (this._group.test(deleteChar)) {
|
|
523
529
|
this._group.lastIndex = 0;
|
|
524
530
|
newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1);
|
|
525
531
|
} else if (this._decimal.test(deleteChar)) {
|
|
526
532
|
this._decimal.lastIndex = 0;
|
|
527
|
-
|
|
533
|
+
|
|
534
|
+
if (decimalLength) {
|
|
535
|
+
this.inputRef.current.setSelectionRange(selectionStart - 1, selectionStart - 1);
|
|
536
|
+
} else {
|
|
537
|
+
newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
|
|
538
|
+
}
|
|
528
539
|
} else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
529
|
-
|
|
530
|
-
|
|
540
|
+
var insertedText = this.isDecimalMode() && (this.props.minFractionDigits || 0) < decimalLength ? '' : '0';
|
|
541
|
+
newValueStr = inputValue.slice(0, selectionStart - 1) + insertedText + inputValue.slice(selectionStart);
|
|
542
|
+
} else if (decimalCharIndexWithoutPrefix === 1) {
|
|
531
543
|
newValueStr = inputValue.slice(0, selectionStart - 1) + '0' + inputValue.slice(selectionStart);
|
|
532
544
|
newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : '';
|
|
533
545
|
} else {
|
|
@@ -550,20 +562,29 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
550
562
|
if (selectionStart === selectionEnd) {
|
|
551
563
|
var _deleteChar = inputValue.charAt(selectionStart);
|
|
552
564
|
|
|
553
|
-
var
|
|
554
|
-
|
|
555
|
-
|
|
565
|
+
var _this$getDecimalCharI2 = this.getDecimalCharIndexes(inputValue),
|
|
566
|
+
_decimalCharIndex = _this$getDecimalCharI2.decimalCharIndex,
|
|
567
|
+
_decimalCharIndexWithoutPrefix = _this$getDecimalCharI2.decimalCharIndexWithoutPrefix;
|
|
556
568
|
|
|
557
569
|
if (this.isNumeralChar(_deleteChar)) {
|
|
570
|
+
var _decimalLength = this.getDecimalLength(inputValue);
|
|
571
|
+
|
|
558
572
|
if (this._group.test(_deleteChar)) {
|
|
559
573
|
this._group.lastIndex = 0;
|
|
560
574
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2);
|
|
561
575
|
} else if (this._decimal.test(_deleteChar)) {
|
|
562
576
|
this._decimal.lastIndex = 0;
|
|
563
|
-
|
|
577
|
+
|
|
578
|
+
if (_decimalLength) {
|
|
579
|
+
this.$refs.input.$el.setSelectionRange(selectionStart + 1, selectionStart + 1);
|
|
580
|
+
} else {
|
|
581
|
+
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
|
|
582
|
+
}
|
|
564
583
|
} else if (_decimalCharIndex > 0 && selectionStart > _decimalCharIndex) {
|
|
565
|
-
|
|
566
|
-
|
|
584
|
+
var _insertedText = this.isDecimalMode() && (this.props.minFractionDigits || 0) < _decimalLength ? '' : '0';
|
|
585
|
+
|
|
586
|
+
newValueStr = inputValue.slice(0, selectionStart) + _insertedText + inputValue.slice(selectionStart + 1);
|
|
587
|
+
} else if (_decimalCharIndexWithoutPrefix === 1) {
|
|
567
588
|
newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1);
|
|
568
589
|
newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : '';
|
|
569
590
|
} else {
|
|
@@ -622,7 +643,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
622
643
|
}, {
|
|
623
644
|
key: "isMinusSign",
|
|
624
645
|
value: function isMinusSign(char) {
|
|
625
|
-
if (this._minusSign.test(char)) {
|
|
646
|
+
if (this._minusSign.test(char) || char === '-') {
|
|
626
647
|
this._minusSign.lastIndex = 0;
|
|
627
648
|
return true;
|
|
628
649
|
}
|
|
@@ -639,6 +660,42 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
639
660
|
|
|
640
661
|
return false;
|
|
641
662
|
}
|
|
663
|
+
}, {
|
|
664
|
+
key: "isDecimalMode",
|
|
665
|
+
value: function isDecimalMode() {
|
|
666
|
+
return this.props.mode === 'decimal';
|
|
667
|
+
}
|
|
668
|
+
}, {
|
|
669
|
+
key: "getDecimalCharIndexes",
|
|
670
|
+
value: function getDecimalCharIndexes(val) {
|
|
671
|
+
var decimalCharIndex = val.search(this._decimal);
|
|
672
|
+
this._decimal.lastIndex = 0;
|
|
673
|
+
var filteredVal = val.replace(this._prefix, '').trim().replace(/\s/g, '').replace(this._currency, '');
|
|
674
|
+
var decimalCharIndexWithoutPrefix = filteredVal.search(this._decimal);
|
|
675
|
+
this._decimal.lastIndex = 0;
|
|
676
|
+
return {
|
|
677
|
+
decimalCharIndex: decimalCharIndex,
|
|
678
|
+
decimalCharIndexWithoutPrefix: decimalCharIndexWithoutPrefix
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
}, {
|
|
682
|
+
key: "getCharIndexes",
|
|
683
|
+
value: function getCharIndexes(val) {
|
|
684
|
+
var decimalCharIndex = val.search(this._decimal);
|
|
685
|
+
this._decimal.lastIndex = 0;
|
|
686
|
+
var minusCharIndex = val.search(this._minusSign);
|
|
687
|
+
this._minusSign.lastIndex = 0;
|
|
688
|
+
var suffixCharIndex = val.search(this._suffix);
|
|
689
|
+
this._suffix.lastIndex = 0;
|
|
690
|
+
var currencyCharIndex = val.search(this._currency);
|
|
691
|
+
this._currency.lastIndex = 0;
|
|
692
|
+
return {
|
|
693
|
+
decimalCharIndex: decimalCharIndex,
|
|
694
|
+
minusCharIndex: minusCharIndex,
|
|
695
|
+
suffixCharIndex: suffixCharIndex,
|
|
696
|
+
currencyCharIndex: currencyCharIndex
|
|
697
|
+
};
|
|
698
|
+
}
|
|
642
699
|
}, {
|
|
643
700
|
key: "insert",
|
|
644
701
|
value: function insert(event, text) {
|
|
@@ -656,10 +713,13 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
656
713
|
var selectionStart = this.inputRef.current.selectionStart;
|
|
657
714
|
var selectionEnd = this.inputRef.current.selectionEnd;
|
|
658
715
|
var inputValue = this.inputRef.current.value.trim();
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
716
|
+
|
|
717
|
+
var _this$getCharIndexes = this.getCharIndexes(inputValue),
|
|
718
|
+
decimalCharIndex = _this$getCharIndexes.decimalCharIndex,
|
|
719
|
+
minusCharIndex = _this$getCharIndexes.minusCharIndex,
|
|
720
|
+
suffixCharIndex = _this$getCharIndexes.suffixCharIndex,
|
|
721
|
+
currencyCharIndex = _this$getCharIndexes.currencyCharIndex;
|
|
722
|
+
|
|
663
723
|
var newValueStr;
|
|
664
724
|
|
|
665
725
|
if (sign.isMinusSign) {
|
|
@@ -678,6 +738,9 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
678
738
|
} else if (decimalCharIndex > selectionStart && decimalCharIndex < selectionEnd) {
|
|
679
739
|
newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);
|
|
680
740
|
this.updateValue(event, newValueStr, text, 'insert');
|
|
741
|
+
} else if (decimalCharIndex === -1 && this.props.maxFractionDigits) {
|
|
742
|
+
newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);
|
|
743
|
+
this.updateValue(event, newValueStr, text, 'insert');
|
|
681
744
|
}
|
|
682
745
|
} else {
|
|
683
746
|
var maxFractionDigits = this.numberFormat.resolvedOptions().maximumFractionDigits;
|
|
@@ -685,7 +748,8 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
685
748
|
|
|
686
749
|
if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
687
750
|
if (selectionStart + text.length - (decimalCharIndex + 1) <= maxFractionDigits) {
|
|
688
|
-
|
|
751
|
+
var charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length;
|
|
752
|
+
newValueStr = inputValue.slice(0, selectionStart) + text + inputValue.slice(selectionStart + text.length, charIndex) + inputValue.slice(charIndex);
|
|
689
753
|
this.updateValue(event, newValueStr, text, operation);
|
|
690
754
|
}
|
|
691
755
|
} else {
|
|
@@ -697,7 +761,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
697
761
|
}, {
|
|
698
762
|
key: "insertText",
|
|
699
763
|
value: function insertText(value, text, start, end) {
|
|
700
|
-
var textSplit = text.split('.');
|
|
764
|
+
var textSplit = text === '.' ? text : text.split('.');
|
|
701
765
|
|
|
702
766
|
if (textSplit.length === 2) {
|
|
703
767
|
var decimalCharIndex = value.slice(start, end).search(this._decimal);
|
|
@@ -726,11 +790,15 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
726
790
|
var selectionStart = this.inputRef.current.selectionStart;
|
|
727
791
|
var inputValue = this.inputRef.current.value;
|
|
728
792
|
var valueLength = inputValue.length;
|
|
729
|
-
var index = null;
|
|
793
|
+
var index = null; // remove prefix
|
|
794
|
+
|
|
795
|
+
var prefixLength = (this.prefixChar || '').length;
|
|
796
|
+
inputValue = inputValue.replace(this._prefix, '');
|
|
797
|
+
selectionStart = selectionStart - prefixLength;
|
|
730
798
|
var char = inputValue.charAt(selectionStart);
|
|
731
799
|
|
|
732
800
|
if (this.isNumeralChar(char)) {
|
|
733
|
-
return;
|
|
801
|
+
return selectionStart + prefixLength;
|
|
734
802
|
} //left
|
|
735
803
|
|
|
736
804
|
|
|
@@ -740,7 +808,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
740
808
|
char = inputValue.charAt(i);
|
|
741
809
|
|
|
742
810
|
if (this.isNumeralChar(char)) {
|
|
743
|
-
index = i;
|
|
811
|
+
index = i + prefixLength;
|
|
744
812
|
break;
|
|
745
813
|
} else {
|
|
746
814
|
i--;
|
|
@@ -750,13 +818,13 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
750
818
|
if (index !== null) {
|
|
751
819
|
this.inputRef.current.setSelectionRange(index + 1, index + 1);
|
|
752
820
|
} else {
|
|
753
|
-
i = selectionStart
|
|
821
|
+
i = selectionStart;
|
|
754
822
|
|
|
755
823
|
while (i < valueLength) {
|
|
756
824
|
char = inputValue.charAt(i);
|
|
757
825
|
|
|
758
826
|
if (this.isNumeralChar(char)) {
|
|
759
|
-
index = i;
|
|
827
|
+
index = i + prefixLength;
|
|
760
828
|
break;
|
|
761
829
|
} else {
|
|
762
830
|
i++;
|
|
@@ -767,6 +835,8 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
767
835
|
this.inputRef.current.setSelectionRange(index, index);
|
|
768
836
|
}
|
|
769
837
|
}
|
|
838
|
+
|
|
839
|
+
return index || 0;
|
|
770
840
|
}
|
|
771
841
|
}, {
|
|
772
842
|
key: "onInputClick",
|
|
@@ -799,10 +869,10 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
799
869
|
|
|
800
870
|
if (valueStr != null) {
|
|
801
871
|
newValue = this.parseValue(valueStr);
|
|
802
|
-
this.
|
|
872
|
+
newValue = !newValue && !this.props.allowEmpty ? 0 : newValue;
|
|
873
|
+
this.updateInput(newValue, insertedValueStr, operation, valueStr);
|
|
874
|
+
this.handleOnChange(event, currentValue, newValue);
|
|
803
875
|
}
|
|
804
|
-
|
|
805
|
-
this.handleOnChange(event, currentValue, newValue);
|
|
806
876
|
}
|
|
807
877
|
}, {
|
|
808
878
|
key: "handleOnChange",
|
|
@@ -831,6 +901,10 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
831
901
|
}, {
|
|
832
902
|
key: "validateValue",
|
|
833
903
|
value: function validateValue(value) {
|
|
904
|
+
if (value === '-' || value == null) {
|
|
905
|
+
return null;
|
|
906
|
+
}
|
|
907
|
+
|
|
834
908
|
if (this.props.min !== null && value < this.props.min) {
|
|
835
909
|
return this.props.min;
|
|
836
910
|
}
|
|
@@ -839,28 +913,26 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
839
913
|
return this.props.max;
|
|
840
914
|
}
|
|
841
915
|
|
|
842
|
-
if (value === '-') {
|
|
843
|
-
// Minus sign
|
|
844
|
-
return null;
|
|
845
|
-
}
|
|
846
|
-
|
|
847
916
|
return value;
|
|
848
917
|
}
|
|
849
918
|
}, {
|
|
850
919
|
key: "updateInput",
|
|
851
|
-
value: function updateInput(value, insertedValueStr, operation) {
|
|
920
|
+
value: function updateInput(value, insertedValueStr, operation, valueStr) {
|
|
852
921
|
insertedValueStr = insertedValueStr || '';
|
|
853
922
|
var inputEl = this.inputRef.current;
|
|
854
923
|
var inputValue = inputEl.value;
|
|
855
924
|
var newValue = this.formatValue(value);
|
|
856
925
|
var currentLength = inputValue.length;
|
|
857
926
|
|
|
927
|
+
if (newValue !== valueStr) {
|
|
928
|
+
newValue = this.concatValues(newValue, valueStr);
|
|
929
|
+
}
|
|
930
|
+
|
|
858
931
|
if (currentLength === 0) {
|
|
859
932
|
inputEl.value = newValue;
|
|
860
933
|
inputEl.setSelectionRange(0, 0);
|
|
861
|
-
this.initCursor();
|
|
862
|
-
var
|
|
863
|
-
var selectionEnd = prefixLength + insertedValueStr.length;
|
|
934
|
+
var index = this.initCursor();
|
|
935
|
+
var selectionEnd = index + insertedValueStr.length;
|
|
864
936
|
inputEl.setSelectionRange(selectionEnd, selectionEnd);
|
|
865
937
|
} else {
|
|
866
938
|
var selectionStart = inputEl.selectionStart;
|
|
@@ -897,7 +969,13 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
897
969
|
this._group.lastIndex = 0;
|
|
898
970
|
inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
899
971
|
} else if (inputValue === '-' && operation === 'insert') {
|
|
900
|
-
inputEl.setSelectionRange(
|
|
972
|
+
inputEl.setSelectionRange(0, 0);
|
|
973
|
+
|
|
974
|
+
var _index = this.initCursor();
|
|
975
|
+
|
|
976
|
+
var _selectionEnd2 = _index + insertedValueStr.length + 1;
|
|
977
|
+
|
|
978
|
+
inputEl.setSelectionRange(_selectionEnd2, _selectionEnd2);
|
|
901
979
|
} else {
|
|
902
980
|
_selectionEnd = _selectionEnd + (newLength - currentLength);
|
|
903
981
|
inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
@@ -909,15 +987,46 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
909
987
|
}, {
|
|
910
988
|
key: "updateInputValue",
|
|
911
989
|
value: function updateInputValue(newValue) {
|
|
990
|
+
newValue = !newValue && !this.props.allowEmpty ? 0 : newValue;
|
|
912
991
|
var inputEl = this.inputRef.current;
|
|
913
992
|
var value = inputEl.value;
|
|
914
|
-
var formattedValue = this.
|
|
993
|
+
var formattedValue = this.formattedValue(newValue);
|
|
915
994
|
|
|
916
995
|
if (value !== formattedValue) {
|
|
917
996
|
inputEl.value = formattedValue;
|
|
918
997
|
inputEl.setAttribute('aria-valuenow', newValue);
|
|
919
998
|
}
|
|
920
999
|
}
|
|
1000
|
+
}, {
|
|
1001
|
+
key: "formattedValue",
|
|
1002
|
+
value: function formattedValue(val) {
|
|
1003
|
+
var newVal = !val && !this.props.allowEmpty ? 0 : val;
|
|
1004
|
+
return this.formatValue(newVal);
|
|
1005
|
+
}
|
|
1006
|
+
}, {
|
|
1007
|
+
key: "concatValues",
|
|
1008
|
+
value: function concatValues(val1, val2) {
|
|
1009
|
+
if (val1 && val2) {
|
|
1010
|
+
var decimalCharIndex = val2.search(this._decimal);
|
|
1011
|
+
this._decimal.lastIndex = 0;
|
|
1012
|
+
return decimalCharIndex !== -1 ? val1.split(this._decimal)[0] + val2.slice(decimalCharIndex) : val1;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
return val1;
|
|
1016
|
+
}
|
|
1017
|
+
}, {
|
|
1018
|
+
key: "getDecimalLength",
|
|
1019
|
+
value: function getDecimalLength(value) {
|
|
1020
|
+
if (value) {
|
|
1021
|
+
var valueSplit = value.split(this._decimal);
|
|
1022
|
+
|
|
1023
|
+
if (valueSplit.length === 2) {
|
|
1024
|
+
return valueSplit[1].replace(this._suffix, '').trim().replace(/\s/g, '').replace(this._currency, '').length;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
return 0;
|
|
1029
|
+
}
|
|
921
1030
|
}, {
|
|
922
1031
|
key: "updateModel",
|
|
923
1032
|
value: function updateModel(event, value) {
|
|
@@ -1000,6 +1109,11 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
1000
1109
|
value: function getInputMode() {
|
|
1001
1110
|
return this.props.inputMode || (this.props.mode === 'decimal' && !this.props.minFractionDigits ? 'numeric' : 'decimal');
|
|
1002
1111
|
}
|
|
1112
|
+
}, {
|
|
1113
|
+
key: "getFormatter",
|
|
1114
|
+
value: function getFormatter() {
|
|
1115
|
+
return this.numberFormat;
|
|
1116
|
+
}
|
|
1003
1117
|
}, {
|
|
1004
1118
|
key: "updateInputRef",
|
|
1005
1119
|
value: function updateInputRef() {
|
|
@@ -1024,7 +1138,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
1024
1138
|
|
|
1025
1139
|
var newValue = this.validateValue(this.props.value);
|
|
1026
1140
|
|
|
1027
|
-
if (this.props.value !== newValue) {
|
|
1141
|
+
if (this.props.value !== null && this.props.value !== newValue) {
|
|
1028
1142
|
this.updateModel(null, newValue);
|
|
1029
1143
|
}
|
|
1030
1144
|
}
|
|
@@ -1047,7 +1161,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
1047
1161
|
var newValue = this.validateValue(this.props.value);
|
|
1048
1162
|
this.updateInputValue(newValue);
|
|
1049
1163
|
|
|
1050
|
-
if (this.props.value !== newValue) {
|
|
1164
|
+
if (this.props.value !== null && this.props.value !== newValue) {
|
|
1051
1165
|
this.updateModel(null, newValue);
|
|
1052
1166
|
}
|
|
1053
1167
|
}
|
|
@@ -1083,7 +1197,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
1083
1197
|
key: "renderInputElement",
|
|
1084
1198
|
value: function renderInputElement() {
|
|
1085
1199
|
var className = core.classNames('p-inputnumber-input', this.props.inputClassName);
|
|
1086
|
-
var valueToRender = this.
|
|
1200
|
+
var valueToRender = this.formattedValue(this.props.value);
|
|
1087
1201
|
return /*#__PURE__*/React__default['default'].createElement(inputtext.InputText, {
|
|
1088
1202
|
ref: this.inputRef,
|
|
1089
1203
|
id: this.props.inputId,
|
|
@@ -1179,7 +1293,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
1179
1293
|
value: function render() {
|
|
1180
1294
|
var _this6 = this;
|
|
1181
1295
|
|
|
1182
|
-
var className = core.classNames('p-inputnumber p-component', this.props.className, {
|
|
1296
|
+
var className = core.classNames('p-inputnumber p-component p-inputwrapper', this.props.className, {
|
|
1183
1297
|
'p-inputwrapper-filled': this.props.value != null && this.props.value.toString().length > 0,
|
|
1184
1298
|
'p-inputwrapper-focus': this.state.focused,
|
|
1185
1299
|
'p-inputnumber-buttons-stacked': this.isStacked(),
|
|
@@ -1225,6 +1339,7 @@ this.primereact.inputnumber = (function (exports, React, inputtext, core) {
|
|
|
1225
1339
|
id: null,
|
|
1226
1340
|
name: null,
|
|
1227
1341
|
type: 'text',
|
|
1342
|
+
allowEmpty: true,
|
|
1228
1343
|
step: 1,
|
|
1229
1344
|
min: null,
|
|
1230
1345
|
max: null,
|