primereact 8.7.1 → 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 +88 -156
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +1 -0
- package/autocomplete/autocomplete.esm.js +88 -156
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +88 -156
- 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 +205 -667
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +6 -4
- package/calendar/calendar.esm.js +205 -667
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +205 -667
- 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/column/column.d.ts +1 -0
- 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 +986 -2025
- package/core/core.min.js +18 -18
- 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 +89 -230
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +2 -1
- package/inputnumber/inputnumber.esm.js +89 -230
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +89 -230
- 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 +4 -15
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +3 -3
- package/inputtext/inputtext.esm.js +4 -15
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +4 -15
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +24 -18
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +4 -2
- package/inputtextarea/inputtextarea.esm.js +24 -18
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +25 -20
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +6 -16
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +6 -16
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +6 -16
- package/keyfilter/keyfilter.min.js +1 -1
- 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 +106 -136
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +1 -1
- package/mention/mention.esm.js +106 -136
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +107 -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 +2325 -7353
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2325 -7353
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +2325 -7353
- 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 -13
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +0 -13
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +0 -13
- package/ripple/ripple.min.js +1 -1
- 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 +76 -117
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +76 -117
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +76 -117
- 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 +113 -167
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +113 -167
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +113 -167
- 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 +143 -462
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +143 -462
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +143 -462
- 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 +112 -328
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +1 -1
- package/utils/utils.esm.js +112 -328
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +112 -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 +166 -40
|
@@ -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,26 +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
|
-
var newValue = validateValue(currentValue + step);
|
|
328
|
+
var newValue = validateValue(currentValue + step);
|
|
329
|
+
if (props.maxLength && props.maxLength < formatValue(newValue).length) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
345
332
|
|
|
333
|
+
// touch devices trigger the keyboard to display because of setSelectionRange
|
|
346
334
|
!utils.DomHandler.isTouchDevice() && updateInput(newValue, null, 'spin');
|
|
347
335
|
updateModel(event, newValue);
|
|
348
336
|
handleOnChange(event, currentValue, newValue);
|
|
349
337
|
}
|
|
350
338
|
};
|
|
351
|
-
|
|
352
339
|
var onUpButtonTouchStart = function onUpButtonTouchStart(event) {
|
|
353
340
|
if (!props.disabled && !props.readOnly) {
|
|
354
341
|
repeat(event, null, 1);
|
|
355
342
|
event.preventDefault();
|
|
356
343
|
}
|
|
357
344
|
};
|
|
358
|
-
|
|
359
345
|
var onUpButtonMouseDown = function onUpButtonMouseDown(event) {
|
|
360
346
|
if (!props.disabled && !props.readOnly) {
|
|
361
347
|
props.autoFocus && utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
@@ -363,52 +349,42 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
363
349
|
event.preventDefault();
|
|
364
350
|
}
|
|
365
351
|
};
|
|
366
|
-
|
|
367
352
|
var onUpButtonTouchEnd = function onUpButtonTouchEnd() {
|
|
368
353
|
if (!props.disabled && !props.readOnly) {
|
|
369
354
|
clearTimer();
|
|
370
|
-
event.preventDefault();
|
|
371
355
|
}
|
|
372
356
|
};
|
|
373
|
-
|
|
374
357
|
var onUpButtonMouseUp = function onUpButtonMouseUp() {
|
|
375
358
|
if (!props.disabled && !props.readOnly) {
|
|
376
359
|
clearTimer();
|
|
377
360
|
}
|
|
378
361
|
};
|
|
379
|
-
|
|
380
362
|
var onUpButtonMouseLeave = function onUpButtonMouseLeave() {
|
|
381
363
|
if (!props.disabled && !props.readOnly) {
|
|
382
364
|
clearTimer();
|
|
383
365
|
}
|
|
384
366
|
};
|
|
385
|
-
|
|
386
367
|
var onUpButtonKeyUp = function onUpButtonKeyUp() {
|
|
387
368
|
if (!props.disabled && !props.readOnly) {
|
|
388
369
|
clearTimer();
|
|
389
370
|
}
|
|
390
371
|
};
|
|
391
|
-
|
|
392
372
|
var onUpButtonKeyDown = function onUpButtonKeyDown(event) {
|
|
393
373
|
if (!props.disabled && !props.readOnly && (event.keyCode === 32 || event.keyCode === 13)) {
|
|
394
374
|
repeat(event, null, 1);
|
|
395
375
|
}
|
|
396
376
|
};
|
|
397
|
-
|
|
398
377
|
var onDownButtonTouchStart = function onDownButtonTouchStart(event) {
|
|
399
378
|
if (!props.disabled && !props.readOnly) {
|
|
400
379
|
repeat(event, null, -1);
|
|
401
380
|
event.preventDefault();
|
|
402
381
|
}
|
|
403
382
|
};
|
|
404
|
-
|
|
405
383
|
var onDownButtonTouchEnd = function onDownButtonTouchEnd() {
|
|
406
384
|
if (!props.disabled && !props.readOnly) {
|
|
407
385
|
clearTimer();
|
|
408
|
-
event.preventDefault();
|
|
409
386
|
}
|
|
410
387
|
};
|
|
411
|
-
|
|
412
388
|
var onDownButtonMouseDown = function onDownButtonMouseDown(event) {
|
|
413
389
|
if (!props.disabled && !props.readOnly) {
|
|
414
390
|
props.autoFocus && utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
@@ -416,94 +392,79 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
416
392
|
event.preventDefault();
|
|
417
393
|
}
|
|
418
394
|
};
|
|
419
|
-
|
|
420
395
|
var onDownButtonMouseUp = function onDownButtonMouseUp() {
|
|
421
396
|
if (!props.disabled && !props.readOnly) {
|
|
422
397
|
clearTimer();
|
|
423
398
|
}
|
|
424
399
|
};
|
|
425
|
-
|
|
426
400
|
var onDownButtonMouseLeave = function onDownButtonMouseLeave() {
|
|
427
401
|
if (!props.disabled && !props.readOnly) {
|
|
428
402
|
clearTimer();
|
|
429
403
|
}
|
|
430
404
|
};
|
|
431
|
-
|
|
432
405
|
var onDownButtonKeyUp = function onDownButtonKeyUp() {
|
|
433
406
|
if (!props.disabled && !props.readOnly) {
|
|
434
407
|
clearTimer();
|
|
435
408
|
}
|
|
436
409
|
};
|
|
437
|
-
|
|
438
410
|
var onDownButtonKeyDown = function onDownButtonKeyDown(event) {
|
|
439
411
|
if (!props.disabled && !props.readOnly && (event.keyCode === 32 || event.keyCode === 13)) {
|
|
440
412
|
repeat(event, null, -1);
|
|
441
413
|
}
|
|
442
414
|
};
|
|
443
|
-
|
|
444
415
|
var onInput = function onInput(event) {
|
|
445
416
|
if (props.disabled || props.readOnly) {
|
|
446
417
|
return;
|
|
447
418
|
}
|
|
448
|
-
|
|
449
419
|
if (isSpecialChar.current) {
|
|
450
420
|
event.target.value = lastValue.current;
|
|
451
421
|
}
|
|
452
|
-
|
|
453
422
|
isSpecialChar.current = false;
|
|
454
423
|
};
|
|
455
|
-
|
|
456
424
|
var onInputKeyDown = function onInputKeyDown(event) {
|
|
457
425
|
if (props.disabled || props.readOnly) {
|
|
458
426
|
return;
|
|
459
427
|
}
|
|
460
|
-
|
|
461
428
|
lastValue.current = event.target.value;
|
|
462
|
-
|
|
463
429
|
if (event.shiftKey || event.altKey) {
|
|
464
430
|
isSpecialChar.current = true;
|
|
465
431
|
return;
|
|
466
432
|
}
|
|
467
|
-
|
|
468
433
|
var selectionStart = event.target.selectionStart;
|
|
469
434
|
var selectionEnd = event.target.selectionEnd;
|
|
470
435
|
var inputValue = event.target.value;
|
|
471
436
|
var newValueStr = null;
|
|
472
|
-
|
|
473
437
|
if (event.altKey) {
|
|
474
438
|
event.preventDefault();
|
|
475
439
|
}
|
|
476
|
-
|
|
477
440
|
switch (event.which) {
|
|
478
441
|
//up
|
|
479
442
|
case 38:
|
|
480
443
|
spin(event, 1);
|
|
481
444
|
event.preventDefault();
|
|
482
445
|
break;
|
|
483
|
-
//down
|
|
484
446
|
|
|
447
|
+
//down
|
|
485
448
|
case 40:
|
|
486
449
|
spin(event, -1);
|
|
487
450
|
event.preventDefault();
|
|
488
451
|
break;
|
|
489
|
-
//left
|
|
490
452
|
|
|
453
|
+
//left
|
|
491
454
|
case 37:
|
|
492
455
|
if (!isNumeralChar(inputValue.charAt(selectionStart - 1))) {
|
|
493
456
|
event.preventDefault();
|
|
494
457
|
}
|
|
495
|
-
|
|
496
458
|
break;
|
|
497
|
-
//right
|
|
498
459
|
|
|
460
|
+
//right
|
|
499
461
|
case 39:
|
|
500
462
|
if (!isNumeralChar(inputValue.charAt(selectionStart))) {
|
|
501
463
|
event.preventDefault();
|
|
502
464
|
}
|
|
503
|
-
|
|
504
465
|
break;
|
|
505
|
-
//enter and tab
|
|
506
466
|
|
|
467
|
+
//enter and tab
|
|
507
468
|
case 13:
|
|
508
469
|
case 9:
|
|
509
470
|
newValueStr = validateValue(parseValue(inputValue));
|
|
@@ -511,27 +472,22 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
511
472
|
inputRef.current.setAttribute('aria-valuenow', newValueStr);
|
|
512
473
|
updateModel(event, newValueStr);
|
|
513
474
|
break;
|
|
514
|
-
//backspace
|
|
515
475
|
|
|
476
|
+
//backspace
|
|
516
477
|
case 8:
|
|
517
478
|
event.preventDefault();
|
|
518
|
-
|
|
519
479
|
if (selectionStart === selectionEnd) {
|
|
520
480
|
var deleteChar = inputValue.charAt(selectionStart - 1);
|
|
521
|
-
|
|
522
481
|
var _getDecimalCharIndexe = getDecimalCharIndexes(inputValue),
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
482
|
+
decimalCharIndex = _getDecimalCharIndexe.decimalCharIndex,
|
|
483
|
+
decimalCharIndexWithoutPrefix = _getDecimalCharIndexe.decimalCharIndexWithoutPrefix;
|
|
526
484
|
if (isNumeralChar(deleteChar)) {
|
|
527
485
|
var decimalLength = getDecimalLength(inputValue);
|
|
528
|
-
|
|
529
486
|
if (_group.current.test(deleteChar)) {
|
|
530
487
|
_group.current.lastIndex = 0;
|
|
531
488
|
newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1);
|
|
532
489
|
} else if (_decimal.current.test(deleteChar)) {
|
|
533
490
|
_decimal.current.lastIndex = 0;
|
|
534
|
-
|
|
535
491
|
if (decimalLength) {
|
|
536
492
|
inputRef.current.setSelectionRange(selectionStart - 1, selectionStart - 1);
|
|
537
493
|
} else {
|
|
@@ -547,35 +503,28 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
547
503
|
newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
|
|
548
504
|
}
|
|
549
505
|
}
|
|
550
|
-
|
|
551
506
|
updateValue(event, newValueStr, null, 'delete-single');
|
|
552
507
|
} else {
|
|
553
508
|
newValueStr = deleteRange(inputValue, selectionStart, selectionEnd);
|
|
554
509
|
updateValue(event, newValueStr, null, 'delete-range');
|
|
555
510
|
}
|
|
556
|
-
|
|
557
511
|
break;
|
|
558
|
-
// del
|
|
559
512
|
|
|
513
|
+
// del
|
|
560
514
|
case 46:
|
|
561
515
|
event.preventDefault();
|
|
562
|
-
|
|
563
516
|
if (selectionStart === selectionEnd) {
|
|
564
517
|
var _deleteChar = inputValue.charAt(selectionStart);
|
|
565
|
-
|
|
566
518
|
var _getDecimalCharIndexe2 = getDecimalCharIndexes(inputValue),
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
519
|
+
_decimalCharIndex = _getDecimalCharIndexe2.decimalCharIndex,
|
|
520
|
+
_decimalCharIndexWithoutPrefix = _getDecimalCharIndexe2.decimalCharIndexWithoutPrefix;
|
|
570
521
|
if (isNumeralChar(_deleteChar)) {
|
|
571
522
|
var _decimalLength = getDecimalLength(inputValue);
|
|
572
|
-
|
|
573
523
|
if (_group.current.test(_deleteChar)) {
|
|
574
524
|
_group.current.lastIndex = 0;
|
|
575
525
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2);
|
|
576
526
|
} else if (_decimal.current.test(_deleteChar)) {
|
|
577
527
|
_decimal.current.lastIndex = 0;
|
|
578
|
-
|
|
579
528
|
if (_decimalLength) {
|
|
580
529
|
inputRef.current.setSelectionRange(selectionStart + 1, selectionStart + 1);
|
|
581
530
|
} else {
|
|
@@ -583,7 +532,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
583
532
|
}
|
|
584
533
|
} else if (_decimalCharIndex > 0 && selectionStart > _decimalCharIndex) {
|
|
585
534
|
var _insertedText = isDecimalMode() && (props.minFractionDigits || 0) < _decimalLength ? '' : '0';
|
|
586
|
-
|
|
587
535
|
newValueStr = inputValue.slice(0, selectionStart) + _insertedText + inputValue.slice(selectionStart + 1);
|
|
588
536
|
} else if (_decimalCharIndexWithoutPrefix === 1) {
|
|
589
537
|
newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1);
|
|
@@ -592,39 +540,29 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
592
540
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
|
|
593
541
|
}
|
|
594
542
|
}
|
|
595
|
-
|
|
596
543
|
updateValue(event, newValueStr, null, 'delete-back-single');
|
|
597
544
|
} else {
|
|
598
545
|
newValueStr = deleteRange(inputValue, selectionStart, selectionEnd);
|
|
599
546
|
updateValue(event, newValueStr, null, 'delete-range');
|
|
600
547
|
}
|
|
601
|
-
|
|
602
548
|
break;
|
|
603
549
|
}
|
|
604
|
-
|
|
605
550
|
if (props.onKeyDown) {
|
|
606
551
|
props.onKeyDown(event);
|
|
607
552
|
}
|
|
608
553
|
};
|
|
609
|
-
|
|
610
554
|
var onInputKeyPress = function onInputKeyPress(event) {
|
|
611
555
|
if (props.disabled || props.readOnly) {
|
|
612
556
|
return;
|
|
613
557
|
}
|
|
614
|
-
|
|
615
558
|
var code = event.which || event.keyCode;
|
|
616
|
-
|
|
617
559
|
if (code !== 13) {
|
|
618
560
|
// to submit a form
|
|
619
561
|
event.preventDefault();
|
|
620
562
|
}
|
|
621
|
-
|
|
622
563
|
var _char = String.fromCharCode(code);
|
|
623
|
-
|
|
624
564
|
var _isDecimalSign = isDecimalSign(_char);
|
|
625
|
-
|
|
626
565
|
var _isMinusSign = isMinusSign(_char);
|
|
627
|
-
|
|
628
566
|
if (48 <= code && code <= 57 || _isMinusSign || _isDecimalSign) {
|
|
629
567
|
insert(event, _char, {
|
|
630
568
|
isDecimalSign: _isDecimalSign,
|
|
@@ -632,51 +570,39 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
632
570
|
});
|
|
633
571
|
}
|
|
634
572
|
};
|
|
635
|
-
|
|
636
573
|
var onPaste = function onPaste(event) {
|
|
637
574
|
event.preventDefault();
|
|
638
|
-
|
|
639
575
|
if (props.disabled || props.readOnly) {
|
|
640
576
|
return;
|
|
641
577
|
}
|
|
642
|
-
|
|
643
578
|
var data = (event.clipboardData || window['clipboardData']).getData('Text');
|
|
644
|
-
|
|
645
579
|
if (data) {
|
|
646
580
|
var filteredData = parseValue(data);
|
|
647
|
-
|
|
648
581
|
if (filteredData != null) {
|
|
649
582
|
insert(event, filteredData.toString());
|
|
650
583
|
}
|
|
651
584
|
}
|
|
652
585
|
};
|
|
653
|
-
|
|
654
586
|
var allowMinusSign = function allowMinusSign() {
|
|
655
587
|
return props.min === null || props.min < 0;
|
|
656
588
|
};
|
|
657
|
-
|
|
658
589
|
var isMinusSign = function isMinusSign(_char2) {
|
|
659
590
|
if (_minusSign.current.test(_char2) || _char2 === '-') {
|
|
660
591
|
_minusSign.current.lastIndex = 0;
|
|
661
592
|
return true;
|
|
662
593
|
}
|
|
663
|
-
|
|
664
594
|
return false;
|
|
665
595
|
};
|
|
666
|
-
|
|
667
596
|
var isDecimalSign = function isDecimalSign(_char3) {
|
|
668
597
|
if (_decimal.current.test(_char3)) {
|
|
669
598
|
_decimal.current.lastIndex = 0;
|
|
670
599
|
return true;
|
|
671
600
|
}
|
|
672
|
-
|
|
673
601
|
return false;
|
|
674
602
|
};
|
|
675
|
-
|
|
676
603
|
var isDecimalMode = function isDecimalMode() {
|
|
677
604
|
return props.mode === 'decimal';
|
|
678
605
|
};
|
|
679
|
-
|
|
680
606
|
var getDecimalCharIndexes = function getDecimalCharIndexes(val) {
|
|
681
607
|
var decimalCharIndex = val.search(_decimal.current);
|
|
682
608
|
_decimal.current.lastIndex = 0;
|
|
@@ -688,7 +614,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
688
614
|
decimalCharIndexWithoutPrefix: decimalCharIndexWithoutPrefix
|
|
689
615
|
};
|
|
690
616
|
};
|
|
691
|
-
|
|
692
617
|
var getCharIndexes = function getCharIndexes(val) {
|
|
693
618
|
var decimalCharIndex = val.search(_decimal.current);
|
|
694
619
|
_decimal.current.lastIndex = 0;
|
|
@@ -705,7 +630,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
705
630
|
currencyCharIndex: currencyCharIndex
|
|
706
631
|
};
|
|
707
632
|
};
|
|
708
|
-
|
|
709
633
|
var insert = function insert(event, text) {
|
|
710
634
|
var sign = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
711
635
|
isDecimalSign: false,
|
|
@@ -713,31 +637,24 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
713
637
|
};
|
|
714
638
|
var minusCharIndexOnText = text.search(_minusSign.current);
|
|
715
639
|
_minusSign.current.lastIndex = 0;
|
|
716
|
-
|
|
717
640
|
if (!allowMinusSign() && minusCharIndexOnText !== -1) {
|
|
718
641
|
return;
|
|
719
642
|
}
|
|
720
|
-
|
|
721
643
|
var selectionStart = inputRef.current.selectionStart;
|
|
722
644
|
var selectionEnd = inputRef.current.selectionEnd;
|
|
723
645
|
var inputValue = inputRef.current.value.trim();
|
|
724
|
-
|
|
725
646
|
var _getCharIndexes = getCharIndexes(inputValue),
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
647
|
+
decimalCharIndex = _getCharIndexes.decimalCharIndex,
|
|
648
|
+
minusCharIndex = _getCharIndexes.minusCharIndex,
|
|
649
|
+
suffixCharIndex = _getCharIndexes.suffixCharIndex,
|
|
650
|
+
currencyCharIndex = _getCharIndexes.currencyCharIndex;
|
|
731
651
|
var newValueStr;
|
|
732
|
-
|
|
733
652
|
if (sign.isMinusSign) {
|
|
734
653
|
if (selectionStart === 0) {
|
|
735
654
|
newValueStr = inputValue;
|
|
736
|
-
|
|
737
655
|
if (minusCharIndex === -1 || selectionEnd !== 0) {
|
|
738
656
|
newValueStr = insertText(inputValue, text, 0, selectionEnd);
|
|
739
657
|
}
|
|
740
|
-
|
|
741
658
|
updateValue(event, newValueStr, text, 'insert');
|
|
742
659
|
}
|
|
743
660
|
} else if (sign.isDecimalSign) {
|
|
@@ -753,7 +670,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
753
670
|
} else {
|
|
754
671
|
var maxFractionDigits = numberFormat.current.resolvedOptions().maximumFractionDigits;
|
|
755
672
|
var operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert';
|
|
756
|
-
|
|
757
673
|
if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
758
674
|
if (selectionStart + text.length - (decimalCharIndex + 1) <= maxFractionDigits) {
|
|
759
675
|
var charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length;
|
|
@@ -766,10 +682,8 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
766
682
|
}
|
|
767
683
|
}
|
|
768
684
|
};
|
|
769
|
-
|
|
770
685
|
var insertText = function insertText(value, text, start, end) {
|
|
771
686
|
var textSplit = text === '.' ? text : text.split('.');
|
|
772
|
-
|
|
773
687
|
if (textSplit.length === 2) {
|
|
774
688
|
var decimalCharIndex = value.slice(start, end).search(_decimal.current);
|
|
775
689
|
_decimal.current.lastIndex = 0;
|
|
@@ -777,42 +691,38 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
777
691
|
} else if (end - start === value.length) {
|
|
778
692
|
return formatValue(text);
|
|
779
693
|
} else if (start === 0) {
|
|
780
|
-
|
|
694
|
+
var suffix = utils.ObjectUtils.isLetter(value[end]) ? end - 1 : end;
|
|
695
|
+
return text + value.slice(suffix);
|
|
781
696
|
} else if (end === value.length) {
|
|
782
697
|
return value.slice(0, start) + text;
|
|
783
698
|
} else {
|
|
784
699
|
return value.slice(0, start) + text + value.slice(end);
|
|
785
700
|
}
|
|
786
701
|
};
|
|
787
|
-
|
|
788
702
|
var deleteRange = function deleteRange(value, start, end) {
|
|
789
703
|
var newValueStr;
|
|
790
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);
|
|
791
705
|
return newValueStr;
|
|
792
706
|
};
|
|
793
|
-
|
|
794
707
|
var initCursor = function initCursor() {
|
|
795
708
|
var selectionStart = inputRef.current.selectionStart;
|
|
796
709
|
var inputValue = inputRef.current.value;
|
|
797
710
|
var valueLength = inputValue.length;
|
|
798
|
-
var index = null;
|
|
711
|
+
var index = null;
|
|
799
712
|
|
|
713
|
+
// remove prefix
|
|
800
714
|
var prefixLength = (prefixChar.current || '').length;
|
|
801
715
|
inputValue = inputValue.replace(_prefix.current, '');
|
|
802
716
|
selectionStart = selectionStart - prefixLength;
|
|
803
|
-
|
|
804
717
|
var _char4 = inputValue.charAt(selectionStart);
|
|
805
|
-
|
|
806
718
|
if (isNumeralChar(_char4)) {
|
|
807
719
|
return selectionStart + prefixLength;
|
|
808
|
-
}
|
|
809
|
-
|
|
720
|
+
}
|
|
810
721
|
|
|
722
|
+
//left
|
|
811
723
|
var i = selectionStart - 1;
|
|
812
|
-
|
|
813
724
|
while (i >= 0) {
|
|
814
725
|
_char4 = inputValue.charAt(i);
|
|
815
|
-
|
|
816
726
|
if (isNumeralChar(_char4)) {
|
|
817
727
|
index = i + prefixLength;
|
|
818
728
|
break;
|
|
@@ -820,15 +730,12 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
820
730
|
i--;
|
|
821
731
|
}
|
|
822
732
|
}
|
|
823
|
-
|
|
824
733
|
if (index !== null) {
|
|
825
734
|
inputRef.current.setSelectionRange(index + 1, index + 1);
|
|
826
735
|
} else {
|
|
827
736
|
i = selectionStart;
|
|
828
|
-
|
|
829
737
|
while (i < valueLength) {
|
|
830
738
|
_char4 = inputValue.charAt(i);
|
|
831
|
-
|
|
832
739
|
if (isNumeralChar(_char4)) {
|
|
833
740
|
index = i + prefixLength;
|
|
834
741
|
break;
|
|
@@ -836,19 +743,15 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
836
743
|
i++;
|
|
837
744
|
}
|
|
838
745
|
}
|
|
839
|
-
|
|
840
746
|
if (index !== null) {
|
|
841
747
|
inputRef.current.setSelectionRange(index, index);
|
|
842
748
|
}
|
|
843
749
|
}
|
|
844
|
-
|
|
845
750
|
return index || 0;
|
|
846
751
|
};
|
|
847
|
-
|
|
848
752
|
var onInputClick = function onInputClick() {
|
|
849
753
|
initCursor();
|
|
850
754
|
};
|
|
851
|
-
|
|
852
755
|
var isNumeralChar = function isNumeralChar(_char5) {
|
|
853
756
|
if (_char5.length === 1 && (_numeral.current.test(_char5) || _decimal.current.test(_char5) || _group.current.test(_char5) || _minusSign.current.test(_char5))) {
|
|
854
757
|
resetRegex();
|
|
@@ -857,29 +760,24 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
857
760
|
return false;
|
|
858
761
|
}
|
|
859
762
|
};
|
|
860
|
-
|
|
861
763
|
var resetRegex = function resetRegex() {
|
|
862
764
|
_numeral.current.lastIndex = 0;
|
|
863
765
|
_decimal.current.lastIndex = 0;
|
|
864
766
|
_group.current.lastIndex = 0;
|
|
865
767
|
_minusSign.current.lastIndex = 0;
|
|
866
768
|
};
|
|
867
|
-
|
|
868
769
|
var updateValue = function updateValue(event, valueStr, insertedValueStr, operation) {
|
|
869
770
|
var currentValue = inputRef.current.value;
|
|
870
771
|
var newValue = null;
|
|
871
|
-
|
|
872
772
|
if (valueStr != null) {
|
|
873
773
|
newValue = evaluateEmpty(parseValue(valueStr));
|
|
874
774
|
updateInput(newValue, insertedValueStr, operation, valueStr);
|
|
875
775
|
handleOnChange(event, currentValue, newValue);
|
|
876
776
|
}
|
|
877
777
|
};
|
|
878
|
-
|
|
879
778
|
var evaluateEmpty = function evaluateEmpty(newValue) {
|
|
880
779
|
return !newValue && !props.allowEmpty ? props.min || 0 : newValue;
|
|
881
780
|
};
|
|
882
|
-
|
|
883
781
|
var handleOnChange = function handleOnChange(event, currentValue, newValue) {
|
|
884
782
|
if (props.onChange && isValueChanged(currentValue, newValue)) {
|
|
885
783
|
props.onChange({
|
|
@@ -888,55 +786,43 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
888
786
|
});
|
|
889
787
|
}
|
|
890
788
|
};
|
|
891
|
-
|
|
892
789
|
var isValueChanged = function isValueChanged(currentValue, newValue) {
|
|
893
790
|
if (newValue === null && currentValue !== null) {
|
|
894
791
|
return true;
|
|
895
792
|
}
|
|
896
|
-
|
|
897
793
|
if (newValue != null) {
|
|
898
794
|
var parsedCurrentValue = typeof currentValue === 'string' ? parseValue(currentValue) : currentValue;
|
|
899
795
|
return newValue !== parsedCurrentValue;
|
|
900
796
|
}
|
|
901
|
-
|
|
902
797
|
return false;
|
|
903
798
|
};
|
|
904
|
-
|
|
905
799
|
var validateValue = function validateValue(value) {
|
|
906
800
|
if (value === '-') {
|
|
907
801
|
return null;
|
|
908
802
|
}
|
|
909
|
-
|
|
910
803
|
return validateValueByLimit(value);
|
|
911
804
|
};
|
|
912
|
-
|
|
913
805
|
var validateValueByLimit = function validateValueByLimit(value) {
|
|
914
806
|
if (utils.ObjectUtils.isEmpty(value)) {
|
|
915
807
|
return null;
|
|
916
808
|
}
|
|
917
|
-
|
|
918
809
|
if (props.min !== null && value < props.min) {
|
|
919
810
|
return props.min;
|
|
920
811
|
}
|
|
921
|
-
|
|
922
812
|
if (props.max !== null && value > props.max) {
|
|
923
813
|
return props.max;
|
|
924
814
|
}
|
|
925
|
-
|
|
926
815
|
return value;
|
|
927
816
|
};
|
|
928
|
-
|
|
929
817
|
var updateInput = function updateInput(value, insertedValueStr, operation, valueStr) {
|
|
930
818
|
insertedValueStr = insertedValueStr || '';
|
|
931
819
|
var inputEl = inputRef.current;
|
|
932
820
|
var inputValue = inputEl.value;
|
|
933
821
|
var newValue = formatValue(value);
|
|
934
822
|
var currentLength = inputValue.length;
|
|
935
|
-
|
|
936
823
|
if (newValue !== valueStr) {
|
|
937
824
|
newValue = concatValues(newValue, valueStr);
|
|
938
825
|
}
|
|
939
|
-
|
|
940
826
|
if (currentLength === 0) {
|
|
941
827
|
inputEl.value = newValue;
|
|
942
828
|
inputEl.setSelectionRange(0, 0);
|
|
@@ -946,9 +832,11 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
946
832
|
} else {
|
|
947
833
|
var selectionStart = inputEl.selectionStart;
|
|
948
834
|
var _selectionEnd = inputEl.selectionEnd;
|
|
835
|
+
if (props.maxLength && props.maxLength < newValue.length) {
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
949
838
|
inputEl.value = newValue;
|
|
950
839
|
var newLength = newValue.length;
|
|
951
|
-
|
|
952
840
|
if (operation === 'range-insert') {
|
|
953
841
|
var startValue = parseValue((inputValue || '').slice(0, selectionStart));
|
|
954
842
|
var startValueStr = startValue !== null ? startValue.toString() : '';
|
|
@@ -966,73 +854,56 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
966
854
|
var prevChar = inputValue.charAt(_selectionEnd - 1);
|
|
967
855
|
var nextChar = inputValue.charAt(_selectionEnd);
|
|
968
856
|
var diff = currentLength - newLength;
|
|
969
|
-
|
|
970
857
|
var isGroupChar = _group.current.test(nextChar);
|
|
971
|
-
|
|
972
858
|
if (isGroupChar && diff === 1) {
|
|
973
859
|
_selectionEnd += 1;
|
|
974
860
|
} else if (!isGroupChar && isNumeralChar(prevChar)) {
|
|
975
861
|
_selectionEnd += -1 * diff + 1;
|
|
976
862
|
}
|
|
977
|
-
|
|
978
863
|
_group.current.lastIndex = 0;
|
|
979
864
|
inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
980
865
|
} else if (inputValue === '-' && operation === 'insert') {
|
|
981
866
|
inputEl.setSelectionRange(0, 0);
|
|
982
|
-
|
|
983
867
|
var _index2 = initCursor();
|
|
984
|
-
|
|
985
868
|
var _selectionEnd2 = _index2 + insertedValueStr.length + 1;
|
|
986
|
-
|
|
987
869
|
inputEl.setSelectionRange(_selectionEnd2, _selectionEnd2);
|
|
988
870
|
} else {
|
|
989
871
|
_selectionEnd = _selectionEnd + (newLength - currentLength);
|
|
990
872
|
inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
991
873
|
}
|
|
992
874
|
}
|
|
993
|
-
|
|
994
875
|
inputEl.setAttribute('aria-valuenow', value);
|
|
995
876
|
};
|
|
996
|
-
|
|
997
877
|
var updateInputValue = function updateInputValue(newValue) {
|
|
998
878
|
newValue = evaluateEmpty(newValue);
|
|
999
879
|
var inputEl = inputRef.current;
|
|
1000
880
|
var value = inputEl.value;
|
|
1001
|
-
|
|
1002
881
|
var _formattedValue = formattedValue(newValue);
|
|
1003
|
-
|
|
1004
882
|
if (value !== _formattedValue) {
|
|
1005
883
|
inputEl.value = _formattedValue;
|
|
1006
884
|
inputEl.setAttribute('aria-valuenow', newValue);
|
|
1007
885
|
}
|
|
1008
886
|
};
|
|
1009
|
-
|
|
1010
887
|
var formattedValue = function formattedValue(val) {
|
|
1011
888
|
return formatValue(evaluateEmpty(val));
|
|
1012
889
|
};
|
|
1013
|
-
|
|
1014
890
|
var concatValues = function concatValues(val1, val2) {
|
|
1015
891
|
if (val1 && val2) {
|
|
1016
892
|
var decimalCharIndex = val2.search(_decimal.current);
|
|
1017
893
|
_decimal.current.lastIndex = 0;
|
|
1018
894
|
return decimalCharIndex !== -1 ? val1.split(_decimal.current)[0] + val2.slice(decimalCharIndex) : val1;
|
|
1019
895
|
}
|
|
1020
|
-
|
|
1021
896
|
return val1;
|
|
1022
897
|
};
|
|
1023
|
-
|
|
1024
898
|
var getDecimalLength = function getDecimalLength(value) {
|
|
1025
899
|
if (value) {
|
|
1026
900
|
var valueSplit = value.split(_decimal.current);
|
|
1027
|
-
|
|
1028
901
|
if (valueSplit.length === 2) {
|
|
1029
902
|
return valueSplit[1].replace(_suffix.current, '').trim().replace(/\s/g, '').replace(_currency.current, '').length;
|
|
1030
903
|
}
|
|
1031
904
|
}
|
|
1032
|
-
|
|
1033
905
|
return 0;
|
|
1034
906
|
};
|
|
1035
|
-
|
|
1036
907
|
var updateModel = function updateModel(event, value) {
|
|
1037
908
|
if (props.onValueChange) {
|
|
1038
909
|
props.onValueChange({
|
|
@@ -1048,47 +919,42 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1048
919
|
});
|
|
1049
920
|
}
|
|
1050
921
|
};
|
|
1051
|
-
|
|
1052
922
|
var onInputFocus = function onInputFocus(event) {
|
|
1053
923
|
setFocusedState(true);
|
|
1054
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
|
+
}
|
|
1055
930
|
};
|
|
1056
|
-
|
|
1057
931
|
var onInputBlur = function onInputBlur(event) {
|
|
1058
932
|
setFocusedState(false);
|
|
1059
|
-
|
|
1060
933
|
if (inputRef.current) {
|
|
1061
934
|
var currentValue = inputRef.current.value;
|
|
1062
|
-
|
|
1063
935
|
if (isValueChanged(currentValue, props.value)) {
|
|
1064
936
|
var newValue = validateValue(parseValue(currentValue));
|
|
1065
937
|
updateInputValue(newValue);
|
|
1066
938
|
updateModel(event, newValue);
|
|
1067
939
|
}
|
|
1068
940
|
}
|
|
1069
|
-
|
|
1070
941
|
props.onBlur && props.onBlur(event);
|
|
1071
942
|
};
|
|
1072
|
-
|
|
1073
943
|
var clearTimer = function clearTimer() {
|
|
1074
944
|
if (timer.current) {
|
|
1075
945
|
clearInterval(timer.current);
|
|
1076
946
|
}
|
|
1077
947
|
};
|
|
1078
|
-
|
|
1079
948
|
var changeValue = function changeValue() {
|
|
1080
949
|
updateInputValue(validateValueByLimit(props.value));
|
|
1081
950
|
var newValue = validateValue(props.value);
|
|
1082
|
-
|
|
1083
951
|
if (props.value !== null && props.value !== newValue) {
|
|
1084
952
|
updateModel(null, newValue);
|
|
1085
953
|
}
|
|
1086
954
|
};
|
|
1087
|
-
|
|
1088
955
|
var getFormatter = function getFormatter() {
|
|
1089
956
|
return numberFormat.current;
|
|
1090
957
|
};
|
|
1091
|
-
|
|
1092
958
|
React__namespace.useImperativeHandle(ref, function () {
|
|
1093
959
|
return {
|
|
1094
960
|
props: props,
|
|
@@ -1107,7 +973,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1107
973
|
hooks.useMountEffect(function () {
|
|
1108
974
|
constructParser();
|
|
1109
975
|
var newValue = validateValue(props.value);
|
|
1110
|
-
|
|
1111
976
|
if (props.value !== null && props.value !== newValue) {
|
|
1112
977
|
updateModel(null, newValue);
|
|
1113
978
|
}
|
|
@@ -1119,7 +984,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1119
984
|
hooks.useUpdateEffect(function () {
|
|
1120
985
|
changeValue();
|
|
1121
986
|
}, [props.value]);
|
|
1122
|
-
|
|
1123
987
|
var createInputElement = function createInputElement() {
|
|
1124
988
|
var className = utils.classNames('p-inputnumber-input', props.inputClassName);
|
|
1125
989
|
var valueToRender = formattedValue(props.value);
|
|
@@ -1156,7 +1020,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1156
1020
|
"aria-valuenow": props.value
|
|
1157
1021
|
}, ariaProps, dataProps));
|
|
1158
1022
|
};
|
|
1159
|
-
|
|
1160
1023
|
var createUpButton = function createUpButton() {
|
|
1161
1024
|
var className = utils.classNames('p-inputnumber-button p-inputnumber-button-up p-button p-button-icon-only p-component', {
|
|
1162
1025
|
'p-disabled': props.disabled
|
|
@@ -1178,7 +1041,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1178
1041
|
className: icon
|
|
1179
1042
|
}), /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null));
|
|
1180
1043
|
};
|
|
1181
|
-
|
|
1182
1044
|
var createDownButton = function createDownButton() {
|
|
1183
1045
|
var className = utils.classNames('p-inputnumber-button p-inputnumber-button-down p-button p-button-icon-only p-component', {
|
|
1184
1046
|
'p-disabled': props.disabled
|
|
@@ -1200,20 +1062,16 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1200
1062
|
className: icon
|
|
1201
1063
|
}), /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null));
|
|
1202
1064
|
};
|
|
1203
|
-
|
|
1204
1065
|
var createButtonGroup = function createButtonGroup() {
|
|
1205
1066
|
var upButton = props.showButtons && createUpButton();
|
|
1206
1067
|
var downButton = props.showButtons && createDownButton();
|
|
1207
|
-
|
|
1208
1068
|
if (stacked) {
|
|
1209
1069
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
1210
1070
|
className: "p-inputnumber-button-group"
|
|
1211
1071
|
}, upButton, downButton);
|
|
1212
1072
|
}
|
|
1213
|
-
|
|
1214
1073
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, upButton, downButton);
|
|
1215
1074
|
};
|
|
1216
|
-
|
|
1217
1075
|
var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
|
|
1218
1076
|
var otherProps = utils.ObjectUtils.findDiffKeys(props, InputNumber.defaultProps);
|
|
1219
1077
|
var dataProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.DATA_PROPS);
|
|
@@ -1263,6 +1121,7 @@ InputNumber.defaultProps = {
|
|
|
1263
1121
|
localeMatcher: undefined,
|
|
1264
1122
|
max: null,
|
|
1265
1123
|
maxFractionDigits: undefined,
|
|
1124
|
+
maxLength: null,
|
|
1266
1125
|
min: null,
|
|
1267
1126
|
minFractionDigits: undefined,
|
|
1268
1127
|
mode: 'decimal',
|