primereact 8.7.2 → 8.7.3
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 +56 -57
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +56 -57
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +56 -57
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +30 -68
- package/api/api.cjs.min.js +1 -1
- package/api/api.esm.js +30 -68
- package/api/api.esm.min.js +1 -1
- package/api/api.js +30 -68
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +82 -154
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +82 -154
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +82 -154
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +86 -14
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +5 -4
- package/avatar/avatar.esm.js +86 -14
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +86 -14
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +0 -2
- package/avatargroup/avatargroup.esm.js +0 -2
- package/avatargroup/avatargroup.js +0 -2
- package/badge/badge.cjs.js +27 -3
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +27 -3
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +27 -3
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +40 -54
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.d.ts +5 -3
- package/blockui/blockui.esm.js +40 -54
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +40 -54
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +6 -29
- package/breadcrumb/breadcrumb.esm.js +6 -29
- package/breadcrumb/breadcrumb.js +6 -29
- package/button/button.cjs.js +29 -11
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +29 -11
- package/button/button.esm.min.js +1 -1
- package/button/button.js +29 -11
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +186 -664
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +6 -4
- package/calendar/calendar.esm.js +186 -664
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +186 -664
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +0 -15
- package/captcha/captcha.esm.js +0 -15
- package/captcha/captcha.js +0 -15
- package/card/card.cjs.js +0 -6
- package/card/card.esm.js +0 -6
- package/card/card.js +0 -6
- package/carousel/carousel.cjs.js +42 -130
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +42 -130
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +42 -130
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +47 -132
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +47 -132
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +47 -132
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +6 -7
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +6 -7
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +6 -7
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +26 -40
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +26 -40
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +26 -40
- package/checkbox/checkbox.min.css +1 -1
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +26 -41
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.esm.js +26 -41
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +26 -41
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +29 -72
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +29 -72
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +29 -72
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +75 -143
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +8 -6
- package/colorpicker/colorpicker.esm.js +75 -143
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +75 -143
- package/colorpicker/colorpicker.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +60 -60
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +60 -60
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +60 -60
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +74 -94
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +74 -94
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +74 -94
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +75 -120
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +75 -120
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +75 -120
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +970 -2021
- package/core/core.min.js +15 -15
- package/csstransition/csstransition.cjs.js +27 -13
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.esm.js +27 -13
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +27 -13
- package/csstransition/csstransition.min.js +1 -1
- package/datascroller/datascroller.cjs.js +32 -64
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +32 -64
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +32 -64
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +318 -1077
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +6 -1
- package/datatable/datatable.esm.js +318 -1077
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +318 -1077
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +56 -68
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +56 -68
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +56 -68
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +37 -46
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +37 -46
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +37 -46
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +89 -175
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +89 -175
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +89 -175
- package/dialog/dialog.min.css +1 -1
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +0 -2
- package/divider/divider.esm.js +0 -2
- package/divider/divider.js +0 -2
- package/dock/dock.cjs.js +31 -53
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +31 -53
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +31 -53
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +72 -199
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +39 -38
- package/dropdown/dropdown.esm.js +72 -199
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +72 -199
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +31 -22
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +31 -22
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +31 -22
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +29 -51
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +29 -51
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +29 -51
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +45 -128
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +45 -128
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +45 -128
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +54 -165
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +54 -165
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +54 -165
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +2 -23
- package/gmap/gmap.esm.js +2 -23
- package/gmap/gmap.js +2 -23
- package/hooks/hooks.cjs.js +102 -131
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +102 -131
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +102 -131
- package/hooks/hooks.min.js +1 -1
- package/image/image.cjs.js +41 -67
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +1 -1
- package/image/image.esm.js +41 -67
- package/image/image.esm.min.js +1 -1
- package/image/image.js +41 -67
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +26 -45
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +26 -45
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +26 -45
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +16 -108
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +16 -108
- package/inputmask/inputmask.js +16 -108
- package/inputnumber/inputnumber.cjs.js +82 -234
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +1 -1
- package/inputnumber/inputnumber.esm.js +82 -234
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +82 -234
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +26 -37
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +26 -37
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +26 -37
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +0 -11
- package/inputtext/inputtext.d.ts +1 -3
- package/inputtext/inputtext.esm.js +0 -11
- package/inputtext/inputtext.js +0 -11
- package/inputtextarea/inputtextarea.cjs.js +0 -20
- package/inputtextarea/inputtextarea.d.ts +1 -3
- package/inputtextarea/inputtextarea.esm.js +0 -20
- package/inputtextarea/inputtextarea.js +0 -20
- package/keyfilter/keyfilter.cjs.js +4 -15
- package/keyfilter/keyfilter.esm.js +4 -15
- package/keyfilter/keyfilter.js +4 -15
- package/knob/knob.cjs.js +74 -106
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +74 -106
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +74 -106
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +94 -125
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +6 -0
- package/listbox/listbox.esm.js +95 -126
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +94 -125
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +36 -99
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +36 -99
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +36 -99
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +82 -138
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +1 -1
- package/mention/mention.esm.js +82 -138
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +82 -138
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +38 -72
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +38 -72
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +38 -72
- package/menu/menu.min.css +1 -1
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +49 -99
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +49 -99
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +49 -99
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +0 -7
- package/message/message.esm.js +0 -7
- package/message/message.js +0 -7
- package/messages/messages.cjs.js +39 -67
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +39 -67
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +39 -67
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +137 -210
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +46 -41
- package/multiselect/multiselect.esm.js +137 -210
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +137 -210
- package/multiselect/multiselect.min.css +1 -1
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +58 -53
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +58 -53
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +58 -53
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +38 -103
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +38 -103
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +38 -103
- package/orderlist/orderlist.min.css +1 -1
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +26 -52
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +26 -52
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +26 -52
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +40 -79
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +40 -79
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +40 -79
- package/overlaypanel/overlaypanel.min.css +1 -1
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +46 -87
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +46 -87
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +46 -87
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +29 -50
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +29 -50
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +29 -50
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +35 -81
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +35 -81
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +35 -81
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +54 -107
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +1 -1
- package/password/password.esm.js +54 -107
- package/password/password.esm.min.js +1 -1
- package/password/password.js +54 -107
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +48 -159
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +48 -159
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +48 -159
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +26 -31
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +26 -31
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +26 -31
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +2246 -7336
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2246 -7336
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +2246 -7336
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +0 -7
- package/progressbar/progressbar.esm.js +0 -7
- package/progressbar/progressbar.js +0 -7
- package/progressspinner/progressspinner.cjs.js +0 -2
- package/progressspinner/progressspinner.esm.js +0 -2
- package/progressspinner/progressspinner.js +0 -2
- package/radiobutton/radiobutton.cjs.js +30 -40
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +30 -40
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +30 -40
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +27 -14
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +27 -14
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +27 -14
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +47 -1
- package/resources/primereact.min.css +1 -1
- package/ripple/ripple.cjs.js +0 -12
- package/ripple/ripple.esm.js +0 -12
- package/ripple/ripple.js +0 -12
- package/row/row.cjs.js +0 -2
- package/row/row.esm.js +0 -2
- package/row/row.js +0 -2
- package/scrollpanel/scrollpanel.cjs.js +2 -16
- package/scrollpanel/scrollpanel.esm.js +2 -16
- package/scrollpanel/scrollpanel.js +2 -16
- package/scrolltop/scrolltop.cjs.js +44 -57
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.esm.js +44 -57
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +44 -57
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +26 -53
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +26 -53
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +26 -53
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/sidebar.cjs.js +52 -83
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +52 -83
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +52 -83
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +0 -2
- package/skeleton/skeleton.esm.js +0 -2
- package/skeleton/skeleton.js +0 -2
- package/slidemenu/slidemenu.cjs.js +73 -87
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +73 -87
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +73 -87
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +61 -96
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +61 -96
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +61 -96
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +70 -89
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +70 -89
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +70 -89
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +46 -80
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +46 -80
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +46 -80
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +72 -85
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +72 -85
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +72 -85
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +0 -14
- package/steps/steps.esm.js +0 -14
- package/steps/steps.js +0 -14
- package/styleclass/styleclass.cjs.js +75 -111
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +75 -111
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +75 -111
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +33 -54
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +33 -54
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +33 -54
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +83 -102
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +83 -102
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +83 -102
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +27 -4
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.esm.js +27 -4
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +27 -4
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +37 -63
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +37 -63
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +37 -63
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +65 -110
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +65 -110
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +65 -110
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +27 -7
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +27 -7
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +27 -7
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +81 -99
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +81 -99
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +81 -99
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +0 -7
- package/togglebutton/togglebutton.esm.js +0 -7
- package/togglebutton/togglebutton.js +0 -7
- package/toolbar/toolbar.cjs.js +0 -2
- package/toolbar/toolbar.esm.js +0 -2
- package/toolbar/toolbar.js +0 -2
- package/tooltip/tooltip.cjs.js +111 -164
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +111 -164
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +111 -164
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +13 -13
- package/tree/tree.cjs.js +68 -223
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +68 -223
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +68 -223
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +1 -0
- package/treeselect/treeselect.cjs.js +117 -167
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +30 -29
- package/treeselect/treeselect.esm.js +117 -167
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +117 -167
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +140 -460
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +140 -460
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +140 -460
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +29 -39
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +29 -39
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +29 -39
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +110 -328
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +110 -328
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +110 -328
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +108 -204
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +108 -204
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +108 -204
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +152 -38
|
@@ -33,20 +33,45 @@ function _extends() {
|
|
|
33
33
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
34
34
|
for (var i = 1; i < arguments.length; i++) {
|
|
35
35
|
var source = arguments[i];
|
|
36
|
-
|
|
37
36
|
for (var key in source) {
|
|
38
37
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
39
38
|
target[key] = source[key];
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
|
|
44
42
|
return target;
|
|
45
43
|
};
|
|
46
44
|
return _extends.apply(this, arguments);
|
|
47
45
|
}
|
|
48
46
|
|
|
47
|
+
function _typeof(obj) {
|
|
48
|
+
"@babel/helpers - typeof";
|
|
49
|
+
|
|
50
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
51
|
+
return typeof obj;
|
|
52
|
+
} : function (obj) {
|
|
53
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
54
|
+
}, _typeof(obj);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function _toPrimitive(input, hint) {
|
|
58
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
59
|
+
var prim = input[Symbol.toPrimitive];
|
|
60
|
+
if (prim !== undefined) {
|
|
61
|
+
var res = prim.call(input, hint || "default");
|
|
62
|
+
if (_typeof(res) !== "object") return res;
|
|
63
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
64
|
+
}
|
|
65
|
+
return (hint === "string" ? String : Number)(input);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _toPropertyKey(arg) {
|
|
69
|
+
var key = _toPrimitive(arg, "string");
|
|
70
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
71
|
+
}
|
|
72
|
+
|
|
49
73
|
function _defineProperty(obj, key, value) {
|
|
74
|
+
key = _toPropertyKey(key);
|
|
50
75
|
if (key in obj) {
|
|
51
76
|
Object.defineProperty(obj, key, {
|
|
52
77
|
value: value,
|
|
@@ -57,17 +82,14 @@ function _defineProperty(obj, key, value) {
|
|
|
57
82
|
} else {
|
|
58
83
|
obj[key] = value;
|
|
59
84
|
}
|
|
60
|
-
|
|
61
85
|
return obj;
|
|
62
86
|
}
|
|
63
87
|
|
|
64
88
|
function _arrayLikeToArray(arr, len) {
|
|
65
89
|
if (len == null || len > arr.length) len = arr.length;
|
|
66
|
-
|
|
67
90
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
68
91
|
arr2[i] = arr[i];
|
|
69
92
|
}
|
|
70
|
-
|
|
71
93
|
return arr2;
|
|
72
94
|
}
|
|
73
95
|
|
|
@@ -101,33 +123,33 @@ function _arrayWithHoles(arr) {
|
|
|
101
123
|
}
|
|
102
124
|
|
|
103
125
|
function _iterableToArrayLimit(arr, i) {
|
|
104
|
-
var _i =
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
try {
|
|
114
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
115
|
-
_arr.push(_s.value);
|
|
116
|
-
|
|
117
|
-
if (i && _arr.length === i) break;
|
|
118
|
-
}
|
|
119
|
-
} catch (err) {
|
|
120
|
-
_d = true;
|
|
121
|
-
_e = err;
|
|
122
|
-
} finally {
|
|
126
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
127
|
+
if (null != _i) {
|
|
128
|
+
var _s,
|
|
129
|
+
_e,
|
|
130
|
+
_x,
|
|
131
|
+
_r,
|
|
132
|
+
_arr = [],
|
|
133
|
+
_n = !0,
|
|
134
|
+
_d = !1;
|
|
123
135
|
try {
|
|
124
|
-
if (
|
|
136
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
137
|
+
if (Object(_i) !== _i) return;
|
|
138
|
+
_n = !1;
|
|
139
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
|
|
140
|
+
;
|
|
141
|
+
}
|
|
142
|
+
} catch (err) {
|
|
143
|
+
_d = !0, _e = err;
|
|
125
144
|
} finally {
|
|
126
|
-
|
|
145
|
+
try {
|
|
146
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
147
|
+
} finally {
|
|
148
|
+
if (_d) throw _e;
|
|
149
|
+
}
|
|
127
150
|
}
|
|
151
|
+
return _arr;
|
|
128
152
|
}
|
|
129
|
-
|
|
130
|
-
return _arr;
|
|
131
153
|
}
|
|
132
154
|
|
|
133
155
|
function _nonIterableRest() {
|
|
@@ -139,14 +161,12 @@ function _slicedToArray(arr, i) {
|
|
|
139
161
|
}
|
|
140
162
|
|
|
141
163
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
142
|
-
|
|
143
164
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
144
165
|
var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
145
166
|
var _React$useState = React__namespace.useState(false),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
167
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
168
|
+
focusedState = _React$useState2[0],
|
|
169
|
+
setFocusedState = _React$useState2[1];
|
|
150
170
|
var elementRef = React__namespace.useRef(null);
|
|
151
171
|
var inputRef = React__namespace.useRef(null);
|
|
152
172
|
var timer = React__namespace.useRef(null);
|
|
@@ -156,28 +176,18 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
156
176
|
var prefixChar = React__namespace.useRef(null);
|
|
157
177
|
var suffixChar = React__namespace.useRef(null);
|
|
158
178
|
var isSpecialChar = React__namespace.useRef(null);
|
|
159
|
-
|
|
160
179
|
var _numeral = React__namespace.useRef(null);
|
|
161
|
-
|
|
162
180
|
var _group = React__namespace.useRef(null);
|
|
163
|
-
|
|
164
181
|
var _minusSign = React__namespace.useRef(null);
|
|
165
|
-
|
|
166
182
|
var _currency = React__namespace.useRef(null);
|
|
167
|
-
|
|
168
183
|
var _decimal = React__namespace.useRef(null);
|
|
169
|
-
|
|
170
184
|
var _suffix = React__namespace.useRef(null);
|
|
171
|
-
|
|
172
185
|
var _prefix = React__namespace.useRef(null);
|
|
173
|
-
|
|
174
186
|
var _index = React__namespace.useRef(null);
|
|
175
|
-
|
|
176
187
|
var stacked = props.showButtons && props.buttonLayout === 'stacked';
|
|
177
188
|
var horizontal = props.showButtons && props.buttonLayout === 'horizontal';
|
|
178
189
|
var vertical = props.showButtons && props.buttonLayout === 'vertical';
|
|
179
190
|
var inputMode = props.inputMode || (props.mode === 'decimal' && !props.minFractionDigits ? 'numeric' : 'decimal');
|
|
180
|
-
|
|
181
191
|
var getOptions = function getOptions() {
|
|
182
192
|
return {
|
|
183
193
|
localeMatcher: props.localeMatcher,
|
|
@@ -189,14 +199,11 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
189
199
|
maximumFractionDigits: props.maxFractionDigits
|
|
190
200
|
};
|
|
191
201
|
};
|
|
192
|
-
|
|
193
202
|
var constructParser = function constructParser() {
|
|
194
203
|
numberFormat.current = new Intl.NumberFormat(props.locale, getOptions());
|
|
195
|
-
|
|
196
204
|
var numerals = _toConsumableArray(new Intl.NumberFormat(props.locale, {
|
|
197
205
|
useGrouping: false
|
|
198
206
|
}).format(9876543210)).reverse();
|
|
199
|
-
|
|
200
207
|
var index = new Map(numerals.map(function (d, i) {
|
|
201
208
|
return [d, i];
|
|
202
209
|
}));
|
|
@@ -207,23 +214,19 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
207
214
|
_decimal.current = getDecimalExpression();
|
|
208
215
|
_suffix.current = getSuffixExpression();
|
|
209
216
|
_prefix.current = getPrefixExpression();
|
|
210
|
-
|
|
211
217
|
_index.current = function (d) {
|
|
212
218
|
return index.get(d);
|
|
213
219
|
};
|
|
214
220
|
};
|
|
215
|
-
|
|
216
221
|
var escapeRegExp = function escapeRegExp(text) {
|
|
217
222
|
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
218
223
|
};
|
|
219
|
-
|
|
220
224
|
var getDecimalExpression = function getDecimalExpression() {
|
|
221
225
|
var formatter = new Intl.NumberFormat(props.locale, _objectSpread(_objectSpread({}, getOptions()), {}, {
|
|
222
226
|
useGrouping: false
|
|
223
227
|
}));
|
|
224
228
|
return new RegExp("[".concat(formatter.format(1.1).replace(_currency.current, '').trim().replace(_numeral.current, ''), "]"), 'g');
|
|
225
229
|
};
|
|
226
|
-
|
|
227
230
|
var getGroupingExpression = function getGroupingExpression() {
|
|
228
231
|
var formatter = new Intl.NumberFormat(props.locale, {
|
|
229
232
|
useGrouping: true
|
|
@@ -231,14 +234,12 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
231
234
|
groupChar.current = formatter.format(1000000).trim().replace(_numeral.current, '').charAt(0);
|
|
232
235
|
return new RegExp("[".concat(groupChar.current, "]"), 'g');
|
|
233
236
|
};
|
|
234
|
-
|
|
235
237
|
var getMinusSignExpression = function getMinusSignExpression() {
|
|
236
238
|
var formatter = new Intl.NumberFormat(props.locale, {
|
|
237
239
|
useGrouping: false
|
|
238
240
|
});
|
|
239
241
|
return new RegExp("[".concat(formatter.format(-1).trim().replace(_numeral.current, ''), "]"), 'g');
|
|
240
242
|
};
|
|
241
|
-
|
|
242
243
|
var getCurrencyExpression = function getCurrencyExpression() {
|
|
243
244
|
if (props.currency) {
|
|
244
245
|
var formatter = new Intl.NumberFormat(props.locale, {
|
|
@@ -250,10 +251,8 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
250
251
|
});
|
|
251
252
|
return new RegExp("[".concat(formatter.format(1).replace(/\s/g, '').replace(_numeral.current, '').replace(_group.current, ''), "]"), 'g');
|
|
252
253
|
}
|
|
253
|
-
|
|
254
254
|
return new RegExp("[]", 'g');
|
|
255
255
|
};
|
|
256
|
-
|
|
257
256
|
var getPrefixExpression = function getPrefixExpression() {
|
|
258
257
|
if (props.prefix) {
|
|
259
258
|
prefixChar.current = props.prefix;
|
|
@@ -265,10 +264,8 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
265
264
|
});
|
|
266
265
|
prefixChar.current = formatter.format(1).split('1')[0];
|
|
267
266
|
}
|
|
268
|
-
|
|
269
267
|
return new RegExp("".concat(escapeRegExp(prefixChar.current || '')), 'g');
|
|
270
268
|
};
|
|
271
|
-
|
|
272
269
|
var getSuffixExpression = function getSuffixExpression() {
|
|
273
270
|
if (props.suffix) {
|
|
274
271
|
suffixChar.current = props.suffix;
|
|
@@ -282,52 +279,40 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
282
279
|
});
|
|
283
280
|
suffixChar.current = formatter.format(1).split('1')[1];
|
|
284
281
|
}
|
|
285
|
-
|
|
286
282
|
return new RegExp("".concat(escapeRegExp(suffixChar.current || '')), 'g');
|
|
287
283
|
};
|
|
288
|
-
|
|
289
284
|
var formatValue = function formatValue(value) {
|
|
290
285
|
if (value != null) {
|
|
291
286
|
if (value === '-') {
|
|
292
287
|
// Minus sign
|
|
293
288
|
return value;
|
|
294
289
|
}
|
|
295
|
-
|
|
296
290
|
if (props.format) {
|
|
297
291
|
var formatter = new Intl.NumberFormat(props.locale, getOptions());
|
|
298
|
-
|
|
299
292
|
var _formattedValue = formatter.format(value);
|
|
300
|
-
|
|
301
293
|
if (props.prefix) {
|
|
302
294
|
_formattedValue = props.prefix + _formattedValue;
|
|
303
295
|
}
|
|
304
|
-
|
|
305
296
|
if (props.suffix) {
|
|
306
297
|
_formattedValue = _formattedValue + props.suffix;
|
|
307
298
|
}
|
|
308
|
-
|
|
309
299
|
return _formattedValue;
|
|
310
300
|
}
|
|
311
|
-
|
|
312
301
|
return value.toString();
|
|
313
302
|
}
|
|
314
|
-
|
|
315
303
|
return '';
|
|
316
304
|
};
|
|
317
|
-
|
|
318
305
|
var parseValue = function parseValue(text) {
|
|
319
306
|
var filteredText = text.replace(_suffix.current, '').replace(_prefix.current, '').trim().replace(/\s/g, '').replace(_currency.current, '').replace(_group.current, '').replace(_minusSign.current, '-').replace(_decimal.current, '.').replace(_numeral.current, _index.current);
|
|
320
|
-
|
|
321
307
|
if (filteredText) {
|
|
322
|
-
if (filteredText === '-')
|
|
308
|
+
if (filteredText === '-')
|
|
309
|
+
// Minus sign
|
|
323
310
|
return filteredText;
|
|
324
311
|
var parsedValue = +filteredText;
|
|
325
312
|
return isNaN(parsedValue) ? null : parsedValue;
|
|
326
313
|
}
|
|
327
|
-
|
|
328
314
|
return null;
|
|
329
315
|
};
|
|
330
|
-
|
|
331
316
|
var repeat = function repeat(event, interval, dir) {
|
|
332
317
|
var i = interval || 500;
|
|
333
318
|
clearTimer();
|
|
@@ -336,31 +321,27 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
336
321
|
}, i);
|
|
337
322
|
spin(event, dir);
|
|
338
323
|
};
|
|
339
|
-
|
|
340
324
|
var spin = function spin(event, dir) {
|
|
341
325
|
if (inputRef.current) {
|
|
342
326
|
var step = props.step * dir;
|
|
343
327
|
var currentValue = parseValue(inputRef.current.value) || 0;
|
|
344
328
|
var newValue = validateValue(currentValue + step);
|
|
345
|
-
|
|
346
329
|
if (props.maxLength && props.maxLength < formatValue(newValue).length) {
|
|
347
330
|
return;
|
|
348
|
-
}
|
|
349
|
-
|
|
331
|
+
}
|
|
350
332
|
|
|
333
|
+
// touch devices trigger the keyboard to display because of setSelectionRange
|
|
351
334
|
!utils.DomHandler.isTouchDevice() && updateInput(newValue, null, 'spin');
|
|
352
335
|
updateModel(event, newValue);
|
|
353
336
|
handleOnChange(event, currentValue, newValue);
|
|
354
337
|
}
|
|
355
338
|
};
|
|
356
|
-
|
|
357
339
|
var onUpButtonTouchStart = function onUpButtonTouchStart(event) {
|
|
358
340
|
if (!props.disabled && !props.readOnly) {
|
|
359
341
|
repeat(event, null, 1);
|
|
360
342
|
event.preventDefault();
|
|
361
343
|
}
|
|
362
344
|
};
|
|
363
|
-
|
|
364
345
|
var onUpButtonMouseDown = function onUpButtonMouseDown(event) {
|
|
365
346
|
if (!props.disabled && !props.readOnly) {
|
|
366
347
|
props.autoFocus && utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
@@ -368,52 +349,42 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
368
349
|
event.preventDefault();
|
|
369
350
|
}
|
|
370
351
|
};
|
|
371
|
-
|
|
372
352
|
var onUpButtonTouchEnd = function onUpButtonTouchEnd() {
|
|
373
353
|
if (!props.disabled && !props.readOnly) {
|
|
374
354
|
clearTimer();
|
|
375
|
-
event.preventDefault();
|
|
376
355
|
}
|
|
377
356
|
};
|
|
378
|
-
|
|
379
357
|
var onUpButtonMouseUp = function onUpButtonMouseUp() {
|
|
380
358
|
if (!props.disabled && !props.readOnly) {
|
|
381
359
|
clearTimer();
|
|
382
360
|
}
|
|
383
361
|
};
|
|
384
|
-
|
|
385
362
|
var onUpButtonMouseLeave = function onUpButtonMouseLeave() {
|
|
386
363
|
if (!props.disabled && !props.readOnly) {
|
|
387
364
|
clearTimer();
|
|
388
365
|
}
|
|
389
366
|
};
|
|
390
|
-
|
|
391
367
|
var onUpButtonKeyUp = function onUpButtonKeyUp() {
|
|
392
368
|
if (!props.disabled && !props.readOnly) {
|
|
393
369
|
clearTimer();
|
|
394
370
|
}
|
|
395
371
|
};
|
|
396
|
-
|
|
397
372
|
var onUpButtonKeyDown = function onUpButtonKeyDown(event) {
|
|
398
373
|
if (!props.disabled && !props.readOnly && (event.keyCode === 32 || event.keyCode === 13)) {
|
|
399
374
|
repeat(event, null, 1);
|
|
400
375
|
}
|
|
401
376
|
};
|
|
402
|
-
|
|
403
377
|
var onDownButtonTouchStart = function onDownButtonTouchStart(event) {
|
|
404
378
|
if (!props.disabled && !props.readOnly) {
|
|
405
379
|
repeat(event, null, -1);
|
|
406
380
|
event.preventDefault();
|
|
407
381
|
}
|
|
408
382
|
};
|
|
409
|
-
|
|
410
383
|
var onDownButtonTouchEnd = function onDownButtonTouchEnd() {
|
|
411
384
|
if (!props.disabled && !props.readOnly) {
|
|
412
385
|
clearTimer();
|
|
413
|
-
event.preventDefault();
|
|
414
386
|
}
|
|
415
387
|
};
|
|
416
|
-
|
|
417
388
|
var onDownButtonMouseDown = function onDownButtonMouseDown(event) {
|
|
418
389
|
if (!props.disabled && !props.readOnly) {
|
|
419
390
|
props.autoFocus && utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
@@ -421,94 +392,79 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
421
392
|
event.preventDefault();
|
|
422
393
|
}
|
|
423
394
|
};
|
|
424
|
-
|
|
425
395
|
var onDownButtonMouseUp = function onDownButtonMouseUp() {
|
|
426
396
|
if (!props.disabled && !props.readOnly) {
|
|
427
397
|
clearTimer();
|
|
428
398
|
}
|
|
429
399
|
};
|
|
430
|
-
|
|
431
400
|
var onDownButtonMouseLeave = function onDownButtonMouseLeave() {
|
|
432
401
|
if (!props.disabled && !props.readOnly) {
|
|
433
402
|
clearTimer();
|
|
434
403
|
}
|
|
435
404
|
};
|
|
436
|
-
|
|
437
405
|
var onDownButtonKeyUp = function onDownButtonKeyUp() {
|
|
438
406
|
if (!props.disabled && !props.readOnly) {
|
|
439
407
|
clearTimer();
|
|
440
408
|
}
|
|
441
409
|
};
|
|
442
|
-
|
|
443
410
|
var onDownButtonKeyDown = function onDownButtonKeyDown(event) {
|
|
444
411
|
if (!props.disabled && !props.readOnly && (event.keyCode === 32 || event.keyCode === 13)) {
|
|
445
412
|
repeat(event, null, -1);
|
|
446
413
|
}
|
|
447
414
|
};
|
|
448
|
-
|
|
449
415
|
var onInput = function onInput(event) {
|
|
450
416
|
if (props.disabled || props.readOnly) {
|
|
451
417
|
return;
|
|
452
418
|
}
|
|
453
|
-
|
|
454
419
|
if (isSpecialChar.current) {
|
|
455
420
|
event.target.value = lastValue.current;
|
|
456
421
|
}
|
|
457
|
-
|
|
458
422
|
isSpecialChar.current = false;
|
|
459
423
|
};
|
|
460
|
-
|
|
461
424
|
var onInputKeyDown = function onInputKeyDown(event) {
|
|
462
425
|
if (props.disabled || props.readOnly) {
|
|
463
426
|
return;
|
|
464
427
|
}
|
|
465
|
-
|
|
466
428
|
lastValue.current = event.target.value;
|
|
467
|
-
|
|
468
429
|
if (event.shiftKey || event.altKey) {
|
|
469
430
|
isSpecialChar.current = true;
|
|
470
431
|
return;
|
|
471
432
|
}
|
|
472
|
-
|
|
473
433
|
var selectionStart = event.target.selectionStart;
|
|
474
434
|
var selectionEnd = event.target.selectionEnd;
|
|
475
435
|
var inputValue = event.target.value;
|
|
476
436
|
var newValueStr = null;
|
|
477
|
-
|
|
478
437
|
if (event.altKey) {
|
|
479
438
|
event.preventDefault();
|
|
480
439
|
}
|
|
481
|
-
|
|
482
440
|
switch (event.which) {
|
|
483
441
|
//up
|
|
484
442
|
case 38:
|
|
485
443
|
spin(event, 1);
|
|
486
444
|
event.preventDefault();
|
|
487
445
|
break;
|
|
488
|
-
//down
|
|
489
446
|
|
|
447
|
+
//down
|
|
490
448
|
case 40:
|
|
491
449
|
spin(event, -1);
|
|
492
450
|
event.preventDefault();
|
|
493
451
|
break;
|
|
494
|
-
//left
|
|
495
452
|
|
|
453
|
+
//left
|
|
496
454
|
case 37:
|
|
497
455
|
if (!isNumeralChar(inputValue.charAt(selectionStart - 1))) {
|
|
498
456
|
event.preventDefault();
|
|
499
457
|
}
|
|
500
|
-
|
|
501
458
|
break;
|
|
502
|
-
//right
|
|
503
459
|
|
|
460
|
+
//right
|
|
504
461
|
case 39:
|
|
505
462
|
if (!isNumeralChar(inputValue.charAt(selectionStart))) {
|
|
506
463
|
event.preventDefault();
|
|
507
464
|
}
|
|
508
|
-
|
|
509
465
|
break;
|
|
510
|
-
//enter and tab
|
|
511
466
|
|
|
467
|
+
//enter and tab
|
|
512
468
|
case 13:
|
|
513
469
|
case 9:
|
|
514
470
|
newValueStr = validateValue(parseValue(inputValue));
|
|
@@ -516,27 +472,22 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
516
472
|
inputRef.current.setAttribute('aria-valuenow', newValueStr);
|
|
517
473
|
updateModel(event, newValueStr);
|
|
518
474
|
break;
|
|
519
|
-
//backspace
|
|
520
475
|
|
|
476
|
+
//backspace
|
|
521
477
|
case 8:
|
|
522
478
|
event.preventDefault();
|
|
523
|
-
|
|
524
479
|
if (selectionStart === selectionEnd) {
|
|
525
480
|
var deleteChar = inputValue.charAt(selectionStart - 1);
|
|
526
|
-
|
|
527
481
|
var _getDecimalCharIndexe = getDecimalCharIndexes(inputValue),
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
482
|
+
decimalCharIndex = _getDecimalCharIndexe.decimalCharIndex,
|
|
483
|
+
decimalCharIndexWithoutPrefix = _getDecimalCharIndexe.decimalCharIndexWithoutPrefix;
|
|
531
484
|
if (isNumeralChar(deleteChar)) {
|
|
532
485
|
var decimalLength = getDecimalLength(inputValue);
|
|
533
|
-
|
|
534
486
|
if (_group.current.test(deleteChar)) {
|
|
535
487
|
_group.current.lastIndex = 0;
|
|
536
488
|
newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1);
|
|
537
489
|
} else if (_decimal.current.test(deleteChar)) {
|
|
538
490
|
_decimal.current.lastIndex = 0;
|
|
539
|
-
|
|
540
491
|
if (decimalLength) {
|
|
541
492
|
inputRef.current.setSelectionRange(selectionStart - 1, selectionStart - 1);
|
|
542
493
|
} else {
|
|
@@ -552,35 +503,28 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
552
503
|
newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
|
|
553
504
|
}
|
|
554
505
|
}
|
|
555
|
-
|
|
556
506
|
updateValue(event, newValueStr, null, 'delete-single');
|
|
557
507
|
} else {
|
|
558
508
|
newValueStr = deleteRange(inputValue, selectionStart, selectionEnd);
|
|
559
509
|
updateValue(event, newValueStr, null, 'delete-range');
|
|
560
510
|
}
|
|
561
|
-
|
|
562
511
|
break;
|
|
563
|
-
// del
|
|
564
512
|
|
|
513
|
+
// del
|
|
565
514
|
case 46:
|
|
566
515
|
event.preventDefault();
|
|
567
|
-
|
|
568
516
|
if (selectionStart === selectionEnd) {
|
|
569
517
|
var _deleteChar = inputValue.charAt(selectionStart);
|
|
570
|
-
|
|
571
518
|
var _getDecimalCharIndexe2 = getDecimalCharIndexes(inputValue),
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
519
|
+
_decimalCharIndex = _getDecimalCharIndexe2.decimalCharIndex,
|
|
520
|
+
_decimalCharIndexWithoutPrefix = _getDecimalCharIndexe2.decimalCharIndexWithoutPrefix;
|
|
575
521
|
if (isNumeralChar(_deleteChar)) {
|
|
576
522
|
var _decimalLength = getDecimalLength(inputValue);
|
|
577
|
-
|
|
578
523
|
if (_group.current.test(_deleteChar)) {
|
|
579
524
|
_group.current.lastIndex = 0;
|
|
580
525
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2);
|
|
581
526
|
} else if (_decimal.current.test(_deleteChar)) {
|
|
582
527
|
_decimal.current.lastIndex = 0;
|
|
583
|
-
|
|
584
528
|
if (_decimalLength) {
|
|
585
529
|
inputRef.current.setSelectionRange(selectionStart + 1, selectionStart + 1);
|
|
586
530
|
} else {
|
|
@@ -588,7 +532,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
588
532
|
}
|
|
589
533
|
} else if (_decimalCharIndex > 0 && selectionStart > _decimalCharIndex) {
|
|
590
534
|
var _insertedText = isDecimalMode() && (props.minFractionDigits || 0) < _decimalLength ? '' : '0';
|
|
591
|
-
|
|
592
535
|
newValueStr = inputValue.slice(0, selectionStart) + _insertedText + inputValue.slice(selectionStart + 1);
|
|
593
536
|
} else if (_decimalCharIndexWithoutPrefix === 1) {
|
|
594
537
|
newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1);
|
|
@@ -597,39 +540,29 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
597
540
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
|
|
598
541
|
}
|
|
599
542
|
}
|
|
600
|
-
|
|
601
543
|
updateValue(event, newValueStr, null, 'delete-back-single');
|
|
602
544
|
} else {
|
|
603
545
|
newValueStr = deleteRange(inputValue, selectionStart, selectionEnd);
|
|
604
546
|
updateValue(event, newValueStr, null, 'delete-range');
|
|
605
547
|
}
|
|
606
|
-
|
|
607
548
|
break;
|
|
608
549
|
}
|
|
609
|
-
|
|
610
550
|
if (props.onKeyDown) {
|
|
611
551
|
props.onKeyDown(event);
|
|
612
552
|
}
|
|
613
553
|
};
|
|
614
|
-
|
|
615
554
|
var onInputKeyPress = function onInputKeyPress(event) {
|
|
616
555
|
if (props.disabled || props.readOnly) {
|
|
617
556
|
return;
|
|
618
557
|
}
|
|
619
|
-
|
|
620
558
|
var code = event.which || event.keyCode;
|
|
621
|
-
|
|
622
559
|
if (code !== 13) {
|
|
623
560
|
// to submit a form
|
|
624
561
|
event.preventDefault();
|
|
625
562
|
}
|
|
626
|
-
|
|
627
563
|
var _char = String.fromCharCode(code);
|
|
628
|
-
|
|
629
564
|
var _isDecimalSign = isDecimalSign(_char);
|
|
630
|
-
|
|
631
565
|
var _isMinusSign = isMinusSign(_char);
|
|
632
|
-
|
|
633
566
|
if (48 <= code && code <= 57 || _isMinusSign || _isDecimalSign) {
|
|
634
567
|
insert(event, _char, {
|
|
635
568
|
isDecimalSign: _isDecimalSign,
|
|
@@ -637,51 +570,39 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
637
570
|
});
|
|
638
571
|
}
|
|
639
572
|
};
|
|
640
|
-
|
|
641
573
|
var onPaste = function onPaste(event) {
|
|
642
574
|
event.preventDefault();
|
|
643
|
-
|
|
644
575
|
if (props.disabled || props.readOnly) {
|
|
645
576
|
return;
|
|
646
577
|
}
|
|
647
|
-
|
|
648
578
|
var data = (event.clipboardData || window['clipboardData']).getData('Text');
|
|
649
|
-
|
|
650
579
|
if (data) {
|
|
651
580
|
var filteredData = parseValue(data);
|
|
652
|
-
|
|
653
581
|
if (filteredData != null) {
|
|
654
582
|
insert(event, filteredData.toString());
|
|
655
583
|
}
|
|
656
584
|
}
|
|
657
585
|
};
|
|
658
|
-
|
|
659
586
|
var allowMinusSign = function allowMinusSign() {
|
|
660
587
|
return props.min === null || props.min < 0;
|
|
661
588
|
};
|
|
662
|
-
|
|
663
589
|
var isMinusSign = function isMinusSign(_char2) {
|
|
664
590
|
if (_minusSign.current.test(_char2) || _char2 === '-') {
|
|
665
591
|
_minusSign.current.lastIndex = 0;
|
|
666
592
|
return true;
|
|
667
593
|
}
|
|
668
|
-
|
|
669
594
|
return false;
|
|
670
595
|
};
|
|
671
|
-
|
|
672
596
|
var isDecimalSign = function isDecimalSign(_char3) {
|
|
673
597
|
if (_decimal.current.test(_char3)) {
|
|
674
598
|
_decimal.current.lastIndex = 0;
|
|
675
599
|
return true;
|
|
676
600
|
}
|
|
677
|
-
|
|
678
601
|
return false;
|
|
679
602
|
};
|
|
680
|
-
|
|
681
603
|
var isDecimalMode = function isDecimalMode() {
|
|
682
604
|
return props.mode === 'decimal';
|
|
683
605
|
};
|
|
684
|
-
|
|
685
606
|
var getDecimalCharIndexes = function getDecimalCharIndexes(val) {
|
|
686
607
|
var decimalCharIndex = val.search(_decimal.current);
|
|
687
608
|
_decimal.current.lastIndex = 0;
|
|
@@ -693,7 +614,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
693
614
|
decimalCharIndexWithoutPrefix: decimalCharIndexWithoutPrefix
|
|
694
615
|
};
|
|
695
616
|
};
|
|
696
|
-
|
|
697
617
|
var getCharIndexes = function getCharIndexes(val) {
|
|
698
618
|
var decimalCharIndex = val.search(_decimal.current);
|
|
699
619
|
_decimal.current.lastIndex = 0;
|
|
@@ -710,7 +630,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
710
630
|
currencyCharIndex: currencyCharIndex
|
|
711
631
|
};
|
|
712
632
|
};
|
|
713
|
-
|
|
714
633
|
var insert = function insert(event, text) {
|
|
715
634
|
var sign = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
716
635
|
isDecimalSign: false,
|
|
@@ -718,31 +637,24 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
718
637
|
};
|
|
719
638
|
var minusCharIndexOnText = text.search(_minusSign.current);
|
|
720
639
|
_minusSign.current.lastIndex = 0;
|
|
721
|
-
|
|
722
640
|
if (!allowMinusSign() && minusCharIndexOnText !== -1) {
|
|
723
641
|
return;
|
|
724
642
|
}
|
|
725
|
-
|
|
726
643
|
var selectionStart = inputRef.current.selectionStart;
|
|
727
644
|
var selectionEnd = inputRef.current.selectionEnd;
|
|
728
645
|
var inputValue = inputRef.current.value.trim();
|
|
729
|
-
|
|
730
646
|
var _getCharIndexes = getCharIndexes(inputValue),
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
647
|
+
decimalCharIndex = _getCharIndexes.decimalCharIndex,
|
|
648
|
+
minusCharIndex = _getCharIndexes.minusCharIndex,
|
|
649
|
+
suffixCharIndex = _getCharIndexes.suffixCharIndex,
|
|
650
|
+
currencyCharIndex = _getCharIndexes.currencyCharIndex;
|
|
736
651
|
var newValueStr;
|
|
737
|
-
|
|
738
652
|
if (sign.isMinusSign) {
|
|
739
653
|
if (selectionStart === 0) {
|
|
740
654
|
newValueStr = inputValue;
|
|
741
|
-
|
|
742
655
|
if (minusCharIndex === -1 || selectionEnd !== 0) {
|
|
743
656
|
newValueStr = insertText(inputValue, text, 0, selectionEnd);
|
|
744
657
|
}
|
|
745
|
-
|
|
746
658
|
updateValue(event, newValueStr, text, 'insert');
|
|
747
659
|
}
|
|
748
660
|
} else if (sign.isDecimalSign) {
|
|
@@ -758,7 +670,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
758
670
|
} else {
|
|
759
671
|
var maxFractionDigits = numberFormat.current.resolvedOptions().maximumFractionDigits;
|
|
760
672
|
var operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert';
|
|
761
|
-
|
|
762
673
|
if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
763
674
|
if (selectionStart + text.length - (decimalCharIndex + 1) <= maxFractionDigits) {
|
|
764
675
|
var charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length;
|
|
@@ -771,10 +682,8 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
771
682
|
}
|
|
772
683
|
}
|
|
773
684
|
};
|
|
774
|
-
|
|
775
685
|
var insertText = function insertText(value, text, start, end) {
|
|
776
686
|
var textSplit = text === '.' ? text : text.split('.');
|
|
777
|
-
|
|
778
687
|
if (textSplit.length === 2) {
|
|
779
688
|
var decimalCharIndex = value.slice(start, end).search(_decimal.current);
|
|
780
689
|
_decimal.current.lastIndex = 0;
|
|
@@ -782,42 +691,38 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
782
691
|
} else if (end - start === value.length) {
|
|
783
692
|
return formatValue(text);
|
|
784
693
|
} else if (start === 0) {
|
|
785
|
-
|
|
694
|
+
var suffix = utils.ObjectUtils.isLetter(value[end]) ? end - 1 : end;
|
|
695
|
+
return text + value.slice(suffix);
|
|
786
696
|
} else if (end === value.length) {
|
|
787
697
|
return value.slice(0, start) + text;
|
|
788
698
|
} else {
|
|
789
699
|
return value.slice(0, start) + text + value.slice(end);
|
|
790
700
|
}
|
|
791
701
|
};
|
|
792
|
-
|
|
793
702
|
var deleteRange = function deleteRange(value, start, end) {
|
|
794
703
|
var newValueStr;
|
|
795
704
|
if (end - start === value.length) newValueStr = '';else if (start === 0) newValueStr = value.slice(end);else if (end === value.length) newValueStr = value.slice(0, start);else newValueStr = value.slice(0, start) + value.slice(end);
|
|
796
705
|
return newValueStr;
|
|
797
706
|
};
|
|
798
|
-
|
|
799
707
|
var initCursor = function initCursor() {
|
|
800
708
|
var selectionStart = inputRef.current.selectionStart;
|
|
801
709
|
var inputValue = inputRef.current.value;
|
|
802
710
|
var valueLength = inputValue.length;
|
|
803
|
-
var index = null;
|
|
711
|
+
var index = null;
|
|
804
712
|
|
|
713
|
+
// remove prefix
|
|
805
714
|
var prefixLength = (prefixChar.current || '').length;
|
|
806
715
|
inputValue = inputValue.replace(_prefix.current, '');
|
|
807
716
|
selectionStart = selectionStart - prefixLength;
|
|
808
|
-
|
|
809
717
|
var _char4 = inputValue.charAt(selectionStart);
|
|
810
|
-
|
|
811
718
|
if (isNumeralChar(_char4)) {
|
|
812
719
|
return selectionStart + prefixLength;
|
|
813
|
-
}
|
|
814
|
-
|
|
720
|
+
}
|
|
815
721
|
|
|
722
|
+
//left
|
|
816
723
|
var i = selectionStart - 1;
|
|
817
|
-
|
|
818
724
|
while (i >= 0) {
|
|
819
725
|
_char4 = inputValue.charAt(i);
|
|
820
|
-
|
|
821
726
|
if (isNumeralChar(_char4)) {
|
|
822
727
|
index = i + prefixLength;
|
|
823
728
|
break;
|
|
@@ -825,15 +730,12 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
825
730
|
i--;
|
|
826
731
|
}
|
|
827
732
|
}
|
|
828
|
-
|
|
829
733
|
if (index !== null) {
|
|
830
734
|
inputRef.current.setSelectionRange(index + 1, index + 1);
|
|
831
735
|
} else {
|
|
832
736
|
i = selectionStart;
|
|
833
|
-
|
|
834
737
|
while (i < valueLength) {
|
|
835
738
|
_char4 = inputValue.charAt(i);
|
|
836
|
-
|
|
837
739
|
if (isNumeralChar(_char4)) {
|
|
838
740
|
index = i + prefixLength;
|
|
839
741
|
break;
|
|
@@ -841,19 +743,15 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
841
743
|
i++;
|
|
842
744
|
}
|
|
843
745
|
}
|
|
844
|
-
|
|
845
746
|
if (index !== null) {
|
|
846
747
|
inputRef.current.setSelectionRange(index, index);
|
|
847
748
|
}
|
|
848
749
|
}
|
|
849
|
-
|
|
850
750
|
return index || 0;
|
|
851
751
|
};
|
|
852
|
-
|
|
853
752
|
var onInputClick = function onInputClick() {
|
|
854
753
|
initCursor();
|
|
855
754
|
};
|
|
856
|
-
|
|
857
755
|
var isNumeralChar = function isNumeralChar(_char5) {
|
|
858
756
|
if (_char5.length === 1 && (_numeral.current.test(_char5) || _decimal.current.test(_char5) || _group.current.test(_char5) || _minusSign.current.test(_char5))) {
|
|
859
757
|
resetRegex();
|
|
@@ -862,29 +760,24 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
862
760
|
return false;
|
|
863
761
|
}
|
|
864
762
|
};
|
|
865
|
-
|
|
866
763
|
var resetRegex = function resetRegex() {
|
|
867
764
|
_numeral.current.lastIndex = 0;
|
|
868
765
|
_decimal.current.lastIndex = 0;
|
|
869
766
|
_group.current.lastIndex = 0;
|
|
870
767
|
_minusSign.current.lastIndex = 0;
|
|
871
768
|
};
|
|
872
|
-
|
|
873
769
|
var updateValue = function updateValue(event, valueStr, insertedValueStr, operation) {
|
|
874
770
|
var currentValue = inputRef.current.value;
|
|
875
771
|
var newValue = null;
|
|
876
|
-
|
|
877
772
|
if (valueStr != null) {
|
|
878
773
|
newValue = evaluateEmpty(parseValue(valueStr));
|
|
879
774
|
updateInput(newValue, insertedValueStr, operation, valueStr);
|
|
880
775
|
handleOnChange(event, currentValue, newValue);
|
|
881
776
|
}
|
|
882
777
|
};
|
|
883
|
-
|
|
884
778
|
var evaluateEmpty = function evaluateEmpty(newValue) {
|
|
885
779
|
return !newValue && !props.allowEmpty ? props.min || 0 : newValue;
|
|
886
780
|
};
|
|
887
|
-
|
|
888
781
|
var handleOnChange = function handleOnChange(event, currentValue, newValue) {
|
|
889
782
|
if (props.onChange && isValueChanged(currentValue, newValue)) {
|
|
890
783
|
props.onChange({
|
|
@@ -893,55 +786,43 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
893
786
|
});
|
|
894
787
|
}
|
|
895
788
|
};
|
|
896
|
-
|
|
897
789
|
var isValueChanged = function isValueChanged(currentValue, newValue) {
|
|
898
790
|
if (newValue === null && currentValue !== null) {
|
|
899
791
|
return true;
|
|
900
792
|
}
|
|
901
|
-
|
|
902
793
|
if (newValue != null) {
|
|
903
794
|
var parsedCurrentValue = typeof currentValue === 'string' ? parseValue(currentValue) : currentValue;
|
|
904
795
|
return newValue !== parsedCurrentValue;
|
|
905
796
|
}
|
|
906
|
-
|
|
907
797
|
return false;
|
|
908
798
|
};
|
|
909
|
-
|
|
910
799
|
var validateValue = function validateValue(value) {
|
|
911
800
|
if (value === '-') {
|
|
912
801
|
return null;
|
|
913
802
|
}
|
|
914
|
-
|
|
915
803
|
return validateValueByLimit(value);
|
|
916
804
|
};
|
|
917
|
-
|
|
918
805
|
var validateValueByLimit = function validateValueByLimit(value) {
|
|
919
806
|
if (utils.ObjectUtils.isEmpty(value)) {
|
|
920
807
|
return null;
|
|
921
808
|
}
|
|
922
|
-
|
|
923
809
|
if (props.min !== null && value < props.min) {
|
|
924
810
|
return props.min;
|
|
925
811
|
}
|
|
926
|
-
|
|
927
812
|
if (props.max !== null && value > props.max) {
|
|
928
813
|
return props.max;
|
|
929
814
|
}
|
|
930
|
-
|
|
931
815
|
return value;
|
|
932
816
|
};
|
|
933
|
-
|
|
934
817
|
var updateInput = function updateInput(value, insertedValueStr, operation, valueStr) {
|
|
935
818
|
insertedValueStr = insertedValueStr || '';
|
|
936
819
|
var inputEl = inputRef.current;
|
|
937
820
|
var inputValue = inputEl.value;
|
|
938
821
|
var newValue = formatValue(value);
|
|
939
822
|
var currentLength = inputValue.length;
|
|
940
|
-
|
|
941
823
|
if (newValue !== valueStr) {
|
|
942
824
|
newValue = concatValues(newValue, valueStr);
|
|
943
825
|
}
|
|
944
|
-
|
|
945
826
|
if (currentLength === 0) {
|
|
946
827
|
inputEl.value = newValue;
|
|
947
828
|
inputEl.setSelectionRange(0, 0);
|
|
@@ -951,14 +832,11 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
951
832
|
} else {
|
|
952
833
|
var selectionStart = inputEl.selectionStart;
|
|
953
834
|
var _selectionEnd = inputEl.selectionEnd;
|
|
954
|
-
|
|
955
835
|
if (props.maxLength && props.maxLength < newValue.length) {
|
|
956
836
|
return;
|
|
957
837
|
}
|
|
958
|
-
|
|
959
838
|
inputEl.value = newValue;
|
|
960
839
|
var newLength = newValue.length;
|
|
961
|
-
|
|
962
840
|
if (operation === 'range-insert') {
|
|
963
841
|
var startValue = parseValue((inputValue || '').slice(0, selectionStart));
|
|
964
842
|
var startValueStr = startValue !== null ? startValue.toString() : '';
|
|
@@ -976,73 +854,56 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
976
854
|
var prevChar = inputValue.charAt(_selectionEnd - 1);
|
|
977
855
|
var nextChar = inputValue.charAt(_selectionEnd);
|
|
978
856
|
var diff = currentLength - newLength;
|
|
979
|
-
|
|
980
857
|
var isGroupChar = _group.current.test(nextChar);
|
|
981
|
-
|
|
982
858
|
if (isGroupChar && diff === 1) {
|
|
983
859
|
_selectionEnd += 1;
|
|
984
860
|
} else if (!isGroupChar && isNumeralChar(prevChar)) {
|
|
985
861
|
_selectionEnd += -1 * diff + 1;
|
|
986
862
|
}
|
|
987
|
-
|
|
988
863
|
_group.current.lastIndex = 0;
|
|
989
864
|
inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
990
865
|
} else if (inputValue === '-' && operation === 'insert') {
|
|
991
866
|
inputEl.setSelectionRange(0, 0);
|
|
992
|
-
|
|
993
867
|
var _index2 = initCursor();
|
|
994
|
-
|
|
995
868
|
var _selectionEnd2 = _index2 + insertedValueStr.length + 1;
|
|
996
|
-
|
|
997
869
|
inputEl.setSelectionRange(_selectionEnd2, _selectionEnd2);
|
|
998
870
|
} else {
|
|
999
871
|
_selectionEnd = _selectionEnd + (newLength - currentLength);
|
|
1000
872
|
inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
1001
873
|
}
|
|
1002
874
|
}
|
|
1003
|
-
|
|
1004
875
|
inputEl.setAttribute('aria-valuenow', value);
|
|
1005
876
|
};
|
|
1006
|
-
|
|
1007
877
|
var updateInputValue = function updateInputValue(newValue) {
|
|
1008
878
|
newValue = evaluateEmpty(newValue);
|
|
1009
879
|
var inputEl = inputRef.current;
|
|
1010
880
|
var value = inputEl.value;
|
|
1011
|
-
|
|
1012
881
|
var _formattedValue = formattedValue(newValue);
|
|
1013
|
-
|
|
1014
882
|
if (value !== _formattedValue) {
|
|
1015
883
|
inputEl.value = _formattedValue;
|
|
1016
884
|
inputEl.setAttribute('aria-valuenow', newValue);
|
|
1017
885
|
}
|
|
1018
886
|
};
|
|
1019
|
-
|
|
1020
887
|
var formattedValue = function formattedValue(val) {
|
|
1021
888
|
return formatValue(evaluateEmpty(val));
|
|
1022
889
|
};
|
|
1023
|
-
|
|
1024
890
|
var concatValues = function concatValues(val1, val2) {
|
|
1025
891
|
if (val1 && val2) {
|
|
1026
892
|
var decimalCharIndex = val2.search(_decimal.current);
|
|
1027
893
|
_decimal.current.lastIndex = 0;
|
|
1028
894
|
return decimalCharIndex !== -1 ? val1.split(_decimal.current)[0] + val2.slice(decimalCharIndex) : val1;
|
|
1029
895
|
}
|
|
1030
|
-
|
|
1031
896
|
return val1;
|
|
1032
897
|
};
|
|
1033
|
-
|
|
1034
898
|
var getDecimalLength = function getDecimalLength(value) {
|
|
1035
899
|
if (value) {
|
|
1036
900
|
var valueSplit = value.split(_decimal.current);
|
|
1037
|
-
|
|
1038
901
|
if (valueSplit.length === 2) {
|
|
1039
902
|
return valueSplit[1].replace(_suffix.current, '').trim().replace(/\s/g, '').replace(_currency.current, '').length;
|
|
1040
903
|
}
|
|
1041
904
|
}
|
|
1042
|
-
|
|
1043
905
|
return 0;
|
|
1044
906
|
};
|
|
1045
|
-
|
|
1046
907
|
var updateModel = function updateModel(event, value) {
|
|
1047
908
|
if (props.onValueChange) {
|
|
1048
909
|
props.onValueChange({
|
|
@@ -1058,47 +919,42 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1058
919
|
});
|
|
1059
920
|
}
|
|
1060
921
|
};
|
|
1061
|
-
|
|
1062
922
|
var onInputFocus = function onInputFocus(event) {
|
|
1063
923
|
setFocusedState(true);
|
|
1064
924
|
props.onFocus && props.onFocus(event);
|
|
925
|
+
if ((props.suffix || props.currency || props.prefix) && inputRef.current) {
|
|
926
|
+
// GitHub #1866 Cursor must be placed before/after symbol or arrow keys don't work
|
|
927
|
+
var selectionEnd = initCursor();
|
|
928
|
+
inputRef.current.setSelectionRange(selectionEnd, selectionEnd);
|
|
929
|
+
}
|
|
1065
930
|
};
|
|
1066
|
-
|
|
1067
931
|
var onInputBlur = function onInputBlur(event) {
|
|
1068
932
|
setFocusedState(false);
|
|
1069
|
-
|
|
1070
933
|
if (inputRef.current) {
|
|
1071
934
|
var currentValue = inputRef.current.value;
|
|
1072
|
-
|
|
1073
935
|
if (isValueChanged(currentValue, props.value)) {
|
|
1074
936
|
var newValue = validateValue(parseValue(currentValue));
|
|
1075
937
|
updateInputValue(newValue);
|
|
1076
938
|
updateModel(event, newValue);
|
|
1077
939
|
}
|
|
1078
940
|
}
|
|
1079
|
-
|
|
1080
941
|
props.onBlur && props.onBlur(event);
|
|
1081
942
|
};
|
|
1082
|
-
|
|
1083
943
|
var clearTimer = function clearTimer() {
|
|
1084
944
|
if (timer.current) {
|
|
1085
945
|
clearInterval(timer.current);
|
|
1086
946
|
}
|
|
1087
947
|
};
|
|
1088
|
-
|
|
1089
948
|
var changeValue = function changeValue() {
|
|
1090
949
|
updateInputValue(validateValueByLimit(props.value));
|
|
1091
950
|
var newValue = validateValue(props.value);
|
|
1092
|
-
|
|
1093
951
|
if (props.value !== null && props.value !== newValue) {
|
|
1094
952
|
updateModel(null, newValue);
|
|
1095
953
|
}
|
|
1096
954
|
};
|
|
1097
|
-
|
|
1098
955
|
var getFormatter = function getFormatter() {
|
|
1099
956
|
return numberFormat.current;
|
|
1100
957
|
};
|
|
1101
|
-
|
|
1102
958
|
React__namespace.useImperativeHandle(ref, function () {
|
|
1103
959
|
return {
|
|
1104
960
|
props: props,
|
|
@@ -1117,7 +973,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1117
973
|
hooks.useMountEffect(function () {
|
|
1118
974
|
constructParser();
|
|
1119
975
|
var newValue = validateValue(props.value);
|
|
1120
|
-
|
|
1121
976
|
if (props.value !== null && props.value !== newValue) {
|
|
1122
977
|
updateModel(null, newValue);
|
|
1123
978
|
}
|
|
@@ -1129,7 +984,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1129
984
|
hooks.useUpdateEffect(function () {
|
|
1130
985
|
changeValue();
|
|
1131
986
|
}, [props.value]);
|
|
1132
|
-
|
|
1133
987
|
var createInputElement = function createInputElement() {
|
|
1134
988
|
var className = utils.classNames('p-inputnumber-input', props.inputClassName);
|
|
1135
989
|
var valueToRender = formattedValue(props.value);
|
|
@@ -1166,7 +1020,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1166
1020
|
"aria-valuenow": props.value
|
|
1167
1021
|
}, ariaProps, dataProps));
|
|
1168
1022
|
};
|
|
1169
|
-
|
|
1170
1023
|
var createUpButton = function createUpButton() {
|
|
1171
1024
|
var className = utils.classNames('p-inputnumber-button p-inputnumber-button-up p-button p-button-icon-only p-component', {
|
|
1172
1025
|
'p-disabled': props.disabled
|
|
@@ -1188,7 +1041,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1188
1041
|
className: icon
|
|
1189
1042
|
}), /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null));
|
|
1190
1043
|
};
|
|
1191
|
-
|
|
1192
1044
|
var createDownButton = function createDownButton() {
|
|
1193
1045
|
var className = utils.classNames('p-inputnumber-button p-inputnumber-button-down p-button p-button-icon-only p-component', {
|
|
1194
1046
|
'p-disabled': props.disabled
|
|
@@ -1210,20 +1062,16 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1210
1062
|
className: icon
|
|
1211
1063
|
}), /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null));
|
|
1212
1064
|
};
|
|
1213
|
-
|
|
1214
1065
|
var createButtonGroup = function createButtonGroup() {
|
|
1215
1066
|
var upButton = props.showButtons && createUpButton();
|
|
1216
1067
|
var downButton = props.showButtons && createDownButton();
|
|
1217
|
-
|
|
1218
1068
|
if (stacked) {
|
|
1219
1069
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
1220
1070
|
className: "p-inputnumber-button-group"
|
|
1221
1071
|
}, upButton, downButton);
|
|
1222
1072
|
}
|
|
1223
|
-
|
|
1224
1073
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, upButton, downButton);
|
|
1225
1074
|
};
|
|
1226
|
-
|
|
1227
1075
|
var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
|
|
1228
1076
|
var otherProps = utils.ObjectUtils.findDiffKeys(props, InputNumber.defaultProps);
|
|
1229
1077
|
var dataProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.DATA_PROPS);
|