primereact 8.7.2 → 9.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.cjs.js +56 -57
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +168 -25
- 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 +31 -69
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +11 -3
- package/api/api.esm.js +31 -69
- package/api/api.esm.min.js +1 -1
- package/api/api.js +31 -69
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +100 -157
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +385 -80
- package/autocomplete/autocomplete.esm.js +100 -157
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +100 -157
- 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 +77 -14
- 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.d.ts +33 -1
- 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.d.ts +48 -8
- 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 +71 -8
- 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.d.ts +41 -3
- 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.d.ts +67 -15
- 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 +203 -668
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +585 -110
- package/calendar/calendar.esm.js +203 -668
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +203 -668
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +7 -21
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.d.ts +77 -7
- package/captcha/captcha.esm.js +7 -21
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +7 -21
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +0 -6
- package/card/card.d.ts +45 -7
- 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.d.ts +138 -22
- 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 +54 -133
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +177 -29
- package/cascadeselect/cascadeselect.esm.js +54 -133
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +54 -133
- 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.d.ts +88 -10
- 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 +31 -41
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +137 -33
- package/checkbox/checkbox.esm.js +32 -42
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +31 -41
- 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.d.ts +75 -7
- 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 +39 -79
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +188 -36
- package/chips/chips.esm.js +39 -79
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +39 -79
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +81 -144
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +150 -31
- package/colorpicker/colorpicker.esm.js +81 -144
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +81 -144
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.d.ts +736 -134
- package/columngroup/columngroup.d.ts +30 -1
- package/confirmdialog/confirmdialog.cjs.js +60 -60
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +142 -18
- 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 +78 -95
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +165 -22
- package/confirmpopup/confirmpopup.esm.js +78 -95
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +78 -95
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +79 -121
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +79 -11
- package/contextmenu/contextmenu.esm.js +79 -121
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +79 -121
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +1048 -2092
- 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.d.ts +31 -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.d.ts +102 -16
- 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 +345 -1092
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +1259 -226
- package/datatable/datatable.esm.js +345 -1092
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +345 -1092
- 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.d.ts +222 -43
- 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.d.ts +37 -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 +99 -191
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +282 -51
- package/dialog/dialog.esm.js +100 -192
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +99 -191
- package/dialog/dialog.min.css +1 -1
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +0 -2
- package/divider/divider.d.ts +47 -10
- 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.d.ts +68 -12
- 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 +98 -209
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +338 -83
- package/dropdown/dropdown.esm.js +99 -210
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +98 -209
- 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.d.ts +129 -12
- 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.d.ts +85 -7
- 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 +49 -128
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +425 -62
- package/fileupload/fileupload.esm.js +49 -128
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +49 -128
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +57 -166
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +198 -30
- package/galleria/galleria.esm.js +57 -166
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +57 -166
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +2 -23
- package/gmap/gmap.d.ts +91 -5
- package/gmap/gmap.esm.js +2 -23
- package/gmap/gmap.js +2 -23
- package/hooks/hooks.cjs.js +101 -131
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +114 -7
- package/hooks/hooks.esm.js +101 -131
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +101 -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 +91 -11
- 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.d.ts +101 -9
- 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 +22 -113
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +120 -28
- package/inputmask/inputmask.esm.js +23 -114
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +22 -113
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +93 -267
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +266 -58
- package/inputnumber/inputnumber.esm.js +94 -268
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +93 -267
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +30 -38
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.d.ts +118 -27
- package/inputswitch/inputswitch.esm.js +31 -39
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +30 -38
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +0 -11
- package/inputtext/inputtext.d.ts +58 -9
- 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 +53 -9
- 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/keyfilter/keyfilteroptions.d.ts +15 -0
- package/knob/knob.cjs.js +74 -106
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.d.ts +127 -20
- 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 +97 -125
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +270 -42
- package/listbox/listbox.esm.js +98 -126
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +97 -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.d.ts +50 -11
- 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 +85 -138
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +187 -33
- package/mention/mention.esm.js +85 -138
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +85 -138
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +41 -73
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +89 -12
- package/menu/menu.esm.js +41 -73
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +41 -73
- 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.d.ts +53 -8
- 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/menuitem/menuitem.d.ts +114 -19
- package/message/message.cjs.js +0 -7
- package/message/message.d.ts +50 -11
- 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.d.ts +91 -11
- 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 +148 -212
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +433 -81
- package/multiselect/multiselect.esm.js +149 -213
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +148 -212
- package/multiselect/multiselect.min.css +1 -1
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +61 -53
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +157 -22
- package/multistatecheckbox/multistatecheckbox.esm.js +62 -54
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +61 -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.d.ts +113 -16
- 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.d.ts +107 -16
- 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 +44 -80
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +89 -15
- package/overlaypanel/overlaypanel.esm.js +44 -80
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +44 -80
- package/overlaypanel/overlaypanel.min.css +1 -1
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/overlayservice/overlayservice.d.ts +52 -7
- package/package.json +2 -2
- package/paginator/paginator.cjs.js +46 -87
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.d.ts +409 -44
- 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.d.ts +142 -16
- 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.d.ts +46 -4
- 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 +61 -108
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +177 -37
- package/password/password.esm.js +61 -108
- package/password/password.esm.min.js +1 -1
- package/password/password.js +61 -108
- package/password/password.min.css +1 -1
- 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.d.ts +272 -46
- 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 +2541 -7484
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2541 -7484
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +2541 -7484
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +0 -7
- package/progressbar/progressbar.d.ts +60 -11
- package/progressbar/progressbar.esm.js +0 -7
- package/progressbar/progressbar.js +0 -7
- package/progressspinner/progressspinner.cjs.js +0 -2
- package/progressspinner/progressspinner.d.ts +47 -4
- package/progressspinner/progressspinner.esm.js +0 -2
- package/progressspinner/progressspinner.js +0 -2
- package/radiobutton/radiobutton.cjs.js +35 -41
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.d.ts +99 -29
- package/radiobutton/radiobutton.esm.js +35 -41
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +35 -41
- 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.d.ts +101 -24
- 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 +121 -64
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +5 -9
- package/resources/themes/arya-green/theme.css +4 -10
- package/resources/themes/arya-orange/theme.css +4 -9
- package/resources/themes/arya-purple/theme.css +4 -9
- package/resources/themes/bootstrap4-dark-blue/theme.css +4 -9
- package/resources/themes/bootstrap4-dark-purple/theme.css +4 -9
- package/resources/themes/bootstrap4-light-blue/theme.css +4 -9
- package/resources/themes/bootstrap4-light-purple/theme.css +4 -10
- package/resources/themes/fluent-light/theme.css +4 -10
- package/resources/themes/lara-dark-blue/theme.css +4 -9
- package/resources/themes/lara-dark-indigo/theme.css +4 -10
- package/resources/themes/lara-dark-purple/theme.css +4 -9
- package/resources/themes/lara-dark-teal/theme.css +4 -10
- package/resources/themes/lara-light-blue/theme.css +4 -9
- package/resources/themes/lara-light-indigo/theme.css +4 -9
- package/resources/themes/lara-light-purple/theme.css +4 -9
- package/resources/themes/lara-light-teal/theme.css +4 -9
- package/resources/themes/luna-amber/theme.css +5 -9
- package/resources/themes/luna-blue/theme.css +4 -9
- package/resources/themes/luna-green/theme.css +5 -9
- package/resources/themes/luna-pink/theme.css +4 -9
- package/resources/themes/md-dark-deeppurple/theme.css +4 -9
- package/resources/themes/md-dark-indigo/theme.css +5 -9
- package/resources/themes/md-light-deeppurple/theme.css +5 -9
- package/resources/themes/md-light-indigo/theme.css +5 -9
- package/resources/themes/mdc-dark-deeppurple/theme.css +5 -9
- package/resources/themes/mdc-dark-indigo/theme.css +4 -9
- package/resources/themes/mdc-light-deeppurple/theme.css +5 -9
- package/resources/themes/mdc-light-indigo/theme.css +4 -9
- package/resources/themes/mira/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/mira/theme.css +6237 -0
- package/resources/themes/nano/theme.css +6009 -0
- package/resources/themes/nova/theme.css +4 -9
- package/resources/themes/nova-accent/theme.css +5 -9
- package/resources/themes/nova-alt/theme.css +4 -9
- package/resources/themes/rhea/theme.css +5 -9
- package/resources/themes/saga-blue/theme.css +4 -9
- package/resources/themes/saga-green/theme.css +5 -9
- package/resources/themes/saga-orange/theme.css +5 -9
- package/resources/themes/saga-purple/theme.css +5 -9
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-dark/theme.css +6002 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-light/theme.css +6056 -0
- package/resources/themes/vela-blue/theme.css +4 -9
- package/resources/themes/vela-green/theme.css +4 -9
- package/resources/themes/vela-orange/theme.css +4 -9
- package/resources/themes/vela-purple/theme.css +5 -9
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-dark/theme.css +6164 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-light/theme.css +6164 -0
- package/ripple/ripple.cjs.js +0 -12
- package/ripple/ripple.d.ts +29 -1
- package/ripple/ripple.esm.js +0 -12
- package/ripple/ripple.js +0 -12
- package/row/row.cjs.js +0 -2
- package/row/row.d.ts +37 -3
- package/row/row.esm.js +0 -2
- package/row/row.js +0 -2
- package/scrollpanel/scrollpanel.cjs.js +2 -16
- package/scrollpanel/scrollpanel.d.ts +45 -1
- 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.d.ts +70 -10
- 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 +29 -53
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.d.ts +111 -32
- package/selectbutton/selectbutton.esm.js +30 -54
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +29 -53
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +34 -0
- package/sidebar/sidebar.cjs.js +65 -84
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +120 -22
- package/sidebar/sidebar.esm.js +65 -84
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +65 -84
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +0 -2
- package/skeleton/skeleton.d.ts +61 -11
- 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.d.ts +132 -18
- 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.d.ts +101 -18
- 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.d.ts +149 -20
- 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 +48 -81
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +131 -23
- package/splitbutton/splitbutton.esm.js +48 -81
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +48 -81
- 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.d.ts +98 -12
- 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.d.ts +67 -6
- 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.d.ts +77 -12
- 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.d.ts +62 -5
- 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 +84 -103
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +213 -27
- package/tabview/tabview.esm.js +84 -103
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +84 -103
- 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.d.ts +50 -6
- 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 +40 -63
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.d.ts +45 -3
- package/terminal/terminal.esm.js +41 -64
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +40 -63
- package/terminal/terminal.min.js +1 -1
- package/terminalservice/terminalservice.d.ts +42 -4
- package/tieredmenu/tieredmenu.cjs.js +68 -111
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +77 -12
- package/tieredmenu/tieredmenu.esm.js +68 -111
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +68 -111
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +33 -17
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.d.ts +62 -13
- package/timeline/timeline.esm.js +33 -17
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +33 -17
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +85 -100
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +134 -27
- package/toast/toast.esm.js +85 -100
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +85 -100
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +4 -8
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +122 -15
- package/togglebutton/togglebutton.esm.js +5 -9
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +4 -8
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +13 -9
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.d.ts +55 -5
- package/toolbar/toolbar.esm.js +13 -9
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +13 -9
- package/toolbar/toolbar.min.css +1 -1
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +111 -164
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +73 -9
- 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 +350 -31
- package/tree/tree.cjs.js +68 -223
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +435 -71
- 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 +62 -12
- package/treeselect/treeselect.cjs.js +124 -168
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +327 -77
- package/treeselect/treeselect.esm.js +125 -169
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +124 -168
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +143 -461
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +501 -112
- package/treetable/treetable.esm.js +143 -461
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +143 -461
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +32 -39
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.d.ts +72 -20
- package/tristatecheckbox/tristatecheckbox.esm.js +33 -40
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +32 -39
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/ts-helpers.d.ts +24 -0
- package/utils/utils.cjs.js +137 -339
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +8 -1
- package/utils/utils.esm.js +137 -339
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +137 -339
- 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.d.ts +351 -59
- 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 +173 -41
|
@@ -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,22 @@ 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
|
+
// #3913 onChange should be called before onValueChange
|
|
334
|
+
handleOnChange(event, currentValue, newValue);
|
|
335
|
+
// touch devices trigger the keyboard to display because of setSelectionRange
|
|
351
336
|
!utils.DomHandler.isTouchDevice() && updateInput(newValue, null, 'spin');
|
|
352
337
|
updateModel(event, newValue);
|
|
353
|
-
handleOnChange(event, currentValue, newValue);
|
|
354
338
|
}
|
|
355
339
|
};
|
|
356
|
-
|
|
357
|
-
var onUpButtonTouchStart = function onUpButtonTouchStart(event) {
|
|
358
|
-
if (!props.disabled && !props.readOnly) {
|
|
359
|
-
repeat(event, null, 1);
|
|
360
|
-
event.preventDefault();
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
|
|
364
340
|
var onUpButtonMouseDown = function onUpButtonMouseDown(event) {
|
|
365
341
|
if (!props.disabled && !props.readOnly) {
|
|
366
342
|
props.autoFocus && utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
@@ -368,52 +344,26 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
368
344
|
event.preventDefault();
|
|
369
345
|
}
|
|
370
346
|
};
|
|
371
|
-
|
|
372
|
-
var onUpButtonTouchEnd = function onUpButtonTouchEnd() {
|
|
373
|
-
if (!props.disabled && !props.readOnly) {
|
|
374
|
-
clearTimer();
|
|
375
|
-
event.preventDefault();
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
|
|
379
347
|
var onUpButtonMouseUp = function onUpButtonMouseUp() {
|
|
380
348
|
if (!props.disabled && !props.readOnly) {
|
|
381
349
|
clearTimer();
|
|
382
350
|
}
|
|
383
351
|
};
|
|
384
|
-
|
|
385
352
|
var onUpButtonMouseLeave = function onUpButtonMouseLeave() {
|
|
386
353
|
if (!props.disabled && !props.readOnly) {
|
|
387
354
|
clearTimer();
|
|
388
355
|
}
|
|
389
356
|
};
|
|
390
|
-
|
|
391
357
|
var onUpButtonKeyUp = function onUpButtonKeyUp() {
|
|
392
358
|
if (!props.disabled && !props.readOnly) {
|
|
393
359
|
clearTimer();
|
|
394
360
|
}
|
|
395
361
|
};
|
|
396
|
-
|
|
397
362
|
var onUpButtonKeyDown = function onUpButtonKeyDown(event) {
|
|
398
363
|
if (!props.disabled && !props.readOnly && (event.keyCode === 32 || event.keyCode === 13)) {
|
|
399
364
|
repeat(event, null, 1);
|
|
400
365
|
}
|
|
401
366
|
};
|
|
402
|
-
|
|
403
|
-
var onDownButtonTouchStart = function onDownButtonTouchStart(event) {
|
|
404
|
-
if (!props.disabled && !props.readOnly) {
|
|
405
|
-
repeat(event, null, -1);
|
|
406
|
-
event.preventDefault();
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
var onDownButtonTouchEnd = function onDownButtonTouchEnd() {
|
|
411
|
-
if (!props.disabled && !props.readOnly) {
|
|
412
|
-
clearTimer();
|
|
413
|
-
event.preventDefault();
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
|
|
417
367
|
var onDownButtonMouseDown = function onDownButtonMouseDown(event) {
|
|
418
368
|
if (!props.disabled && !props.readOnly) {
|
|
419
369
|
props.autoFocus && utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
@@ -421,94 +371,79 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
421
371
|
event.preventDefault();
|
|
422
372
|
}
|
|
423
373
|
};
|
|
424
|
-
|
|
425
374
|
var onDownButtonMouseUp = function onDownButtonMouseUp() {
|
|
426
375
|
if (!props.disabled && !props.readOnly) {
|
|
427
376
|
clearTimer();
|
|
428
377
|
}
|
|
429
378
|
};
|
|
430
|
-
|
|
431
379
|
var onDownButtonMouseLeave = function onDownButtonMouseLeave() {
|
|
432
380
|
if (!props.disabled && !props.readOnly) {
|
|
433
381
|
clearTimer();
|
|
434
382
|
}
|
|
435
383
|
};
|
|
436
|
-
|
|
437
384
|
var onDownButtonKeyUp = function onDownButtonKeyUp() {
|
|
438
385
|
if (!props.disabled && !props.readOnly) {
|
|
439
386
|
clearTimer();
|
|
440
387
|
}
|
|
441
388
|
};
|
|
442
|
-
|
|
443
389
|
var onDownButtonKeyDown = function onDownButtonKeyDown(event) {
|
|
444
390
|
if (!props.disabled && !props.readOnly && (event.keyCode === 32 || event.keyCode === 13)) {
|
|
445
391
|
repeat(event, null, -1);
|
|
446
392
|
}
|
|
447
393
|
};
|
|
448
|
-
|
|
449
394
|
var onInput = function onInput(event) {
|
|
450
395
|
if (props.disabled || props.readOnly) {
|
|
451
396
|
return;
|
|
452
397
|
}
|
|
453
|
-
|
|
454
398
|
if (isSpecialChar.current) {
|
|
455
399
|
event.target.value = lastValue.current;
|
|
456
400
|
}
|
|
457
|
-
|
|
458
401
|
isSpecialChar.current = false;
|
|
459
402
|
};
|
|
460
|
-
|
|
461
403
|
var onInputKeyDown = function onInputKeyDown(event) {
|
|
462
404
|
if (props.disabled || props.readOnly) {
|
|
463
405
|
return;
|
|
464
406
|
}
|
|
465
|
-
|
|
466
407
|
lastValue.current = event.target.value;
|
|
467
|
-
|
|
468
408
|
if (event.shiftKey || event.altKey) {
|
|
469
409
|
isSpecialChar.current = true;
|
|
470
410
|
return;
|
|
471
411
|
}
|
|
472
|
-
|
|
473
412
|
var selectionStart = event.target.selectionStart;
|
|
474
413
|
var selectionEnd = event.target.selectionEnd;
|
|
475
414
|
var inputValue = event.target.value;
|
|
476
415
|
var newValueStr = null;
|
|
477
|
-
|
|
478
416
|
if (event.altKey) {
|
|
479
417
|
event.preventDefault();
|
|
480
418
|
}
|
|
481
|
-
|
|
482
419
|
switch (event.which) {
|
|
483
420
|
//up
|
|
484
421
|
case 38:
|
|
485
422
|
spin(event, 1);
|
|
486
423
|
event.preventDefault();
|
|
487
424
|
break;
|
|
488
|
-
//down
|
|
489
425
|
|
|
426
|
+
//down
|
|
490
427
|
case 40:
|
|
491
428
|
spin(event, -1);
|
|
492
429
|
event.preventDefault();
|
|
493
430
|
break;
|
|
494
|
-
//left
|
|
495
431
|
|
|
432
|
+
//left
|
|
496
433
|
case 37:
|
|
497
434
|
if (!isNumeralChar(inputValue.charAt(selectionStart - 1))) {
|
|
498
435
|
event.preventDefault();
|
|
499
436
|
}
|
|
500
|
-
|
|
501
437
|
break;
|
|
502
|
-
//right
|
|
503
438
|
|
|
439
|
+
//right
|
|
504
440
|
case 39:
|
|
505
441
|
if (!isNumeralChar(inputValue.charAt(selectionStart))) {
|
|
506
442
|
event.preventDefault();
|
|
507
443
|
}
|
|
508
|
-
|
|
509
444
|
break;
|
|
510
|
-
//enter and tab
|
|
511
445
|
|
|
446
|
+
//enter and tab
|
|
512
447
|
case 13:
|
|
513
448
|
case 9:
|
|
514
449
|
newValueStr = validateValue(parseValue(inputValue));
|
|
@@ -516,27 +451,22 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
516
451
|
inputRef.current.setAttribute('aria-valuenow', newValueStr);
|
|
517
452
|
updateModel(event, newValueStr);
|
|
518
453
|
break;
|
|
519
|
-
//backspace
|
|
520
454
|
|
|
455
|
+
//backspace
|
|
521
456
|
case 8:
|
|
522
457
|
event.preventDefault();
|
|
523
|
-
|
|
524
458
|
if (selectionStart === selectionEnd) {
|
|
525
459
|
var deleteChar = inputValue.charAt(selectionStart - 1);
|
|
526
|
-
|
|
527
460
|
var _getDecimalCharIndexe = getDecimalCharIndexes(inputValue),
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
461
|
+
decimalCharIndex = _getDecimalCharIndexe.decimalCharIndex,
|
|
462
|
+
decimalCharIndexWithoutPrefix = _getDecimalCharIndexe.decimalCharIndexWithoutPrefix;
|
|
531
463
|
if (isNumeralChar(deleteChar)) {
|
|
532
464
|
var decimalLength = getDecimalLength(inputValue);
|
|
533
|
-
|
|
534
465
|
if (_group.current.test(deleteChar)) {
|
|
535
466
|
_group.current.lastIndex = 0;
|
|
536
467
|
newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1);
|
|
537
468
|
} else if (_decimal.current.test(deleteChar)) {
|
|
538
469
|
_decimal.current.lastIndex = 0;
|
|
539
|
-
|
|
540
470
|
if (decimalLength) {
|
|
541
471
|
inputRef.current.setSelectionRange(selectionStart - 1, selectionStart - 1);
|
|
542
472
|
} else {
|
|
@@ -552,35 +482,28 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
552
482
|
newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
|
|
553
483
|
}
|
|
554
484
|
}
|
|
555
|
-
|
|
556
485
|
updateValue(event, newValueStr, null, 'delete-single');
|
|
557
486
|
} else {
|
|
558
487
|
newValueStr = deleteRange(inputValue, selectionStart, selectionEnd);
|
|
559
488
|
updateValue(event, newValueStr, null, 'delete-range');
|
|
560
489
|
}
|
|
561
|
-
|
|
562
490
|
break;
|
|
563
|
-
// del
|
|
564
491
|
|
|
492
|
+
// del
|
|
565
493
|
case 46:
|
|
566
494
|
event.preventDefault();
|
|
567
|
-
|
|
568
495
|
if (selectionStart === selectionEnd) {
|
|
569
496
|
var _deleteChar = inputValue.charAt(selectionStart);
|
|
570
|
-
|
|
571
497
|
var _getDecimalCharIndexe2 = getDecimalCharIndexes(inputValue),
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
498
|
+
_decimalCharIndex = _getDecimalCharIndexe2.decimalCharIndex,
|
|
499
|
+
_decimalCharIndexWithoutPrefix = _getDecimalCharIndexe2.decimalCharIndexWithoutPrefix;
|
|
575
500
|
if (isNumeralChar(_deleteChar)) {
|
|
576
501
|
var _decimalLength = getDecimalLength(inputValue);
|
|
577
|
-
|
|
578
502
|
if (_group.current.test(_deleteChar)) {
|
|
579
503
|
_group.current.lastIndex = 0;
|
|
580
504
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2);
|
|
581
505
|
} else if (_decimal.current.test(_deleteChar)) {
|
|
582
506
|
_decimal.current.lastIndex = 0;
|
|
583
|
-
|
|
584
507
|
if (_decimalLength) {
|
|
585
508
|
inputRef.current.setSelectionRange(selectionStart + 1, selectionStart + 1);
|
|
586
509
|
} else {
|
|
@@ -588,7 +511,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
588
511
|
}
|
|
589
512
|
} else if (_decimalCharIndex > 0 && selectionStart > _decimalCharIndex) {
|
|
590
513
|
var _insertedText = isDecimalMode() && (props.minFractionDigits || 0) < _decimalLength ? '' : '0';
|
|
591
|
-
|
|
592
514
|
newValueStr = inputValue.slice(0, selectionStart) + _insertedText + inputValue.slice(selectionStart + 1);
|
|
593
515
|
} else if (_decimalCharIndexWithoutPrefix === 1) {
|
|
594
516
|
newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1);
|
|
@@ -597,39 +519,29 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
597
519
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
|
|
598
520
|
}
|
|
599
521
|
}
|
|
600
|
-
|
|
601
522
|
updateValue(event, newValueStr, null, 'delete-back-single');
|
|
602
523
|
} else {
|
|
603
524
|
newValueStr = deleteRange(inputValue, selectionStart, selectionEnd);
|
|
604
525
|
updateValue(event, newValueStr, null, 'delete-range');
|
|
605
526
|
}
|
|
606
|
-
|
|
607
527
|
break;
|
|
608
528
|
}
|
|
609
|
-
|
|
610
529
|
if (props.onKeyDown) {
|
|
611
530
|
props.onKeyDown(event);
|
|
612
531
|
}
|
|
613
532
|
};
|
|
614
|
-
|
|
615
533
|
var onInputKeyPress = function onInputKeyPress(event) {
|
|
616
534
|
if (props.disabled || props.readOnly) {
|
|
617
535
|
return;
|
|
618
536
|
}
|
|
619
|
-
|
|
620
537
|
var code = event.which || event.keyCode;
|
|
621
|
-
|
|
622
538
|
if (code !== 13) {
|
|
623
539
|
// to submit a form
|
|
624
540
|
event.preventDefault();
|
|
625
541
|
}
|
|
626
|
-
|
|
627
542
|
var _char = String.fromCharCode(code);
|
|
628
|
-
|
|
629
543
|
var _isDecimalSign = isDecimalSign(_char);
|
|
630
|
-
|
|
631
544
|
var _isMinusSign = isMinusSign(_char);
|
|
632
|
-
|
|
633
545
|
if (48 <= code && code <= 57 || _isMinusSign || _isDecimalSign) {
|
|
634
546
|
insert(event, _char, {
|
|
635
547
|
isDecimalSign: _isDecimalSign,
|
|
@@ -637,51 +549,39 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
637
549
|
});
|
|
638
550
|
}
|
|
639
551
|
};
|
|
640
|
-
|
|
641
552
|
var onPaste = function onPaste(event) {
|
|
642
553
|
event.preventDefault();
|
|
643
|
-
|
|
644
554
|
if (props.disabled || props.readOnly) {
|
|
645
555
|
return;
|
|
646
556
|
}
|
|
647
|
-
|
|
648
557
|
var data = (event.clipboardData || window['clipboardData']).getData('Text');
|
|
649
|
-
|
|
650
558
|
if (data) {
|
|
651
559
|
var filteredData = parseValue(data);
|
|
652
|
-
|
|
653
560
|
if (filteredData != null) {
|
|
654
561
|
insert(event, filteredData.toString());
|
|
655
562
|
}
|
|
656
563
|
}
|
|
657
564
|
};
|
|
658
|
-
|
|
659
565
|
var allowMinusSign = function allowMinusSign() {
|
|
660
566
|
return props.min === null || props.min < 0;
|
|
661
567
|
};
|
|
662
|
-
|
|
663
568
|
var isMinusSign = function isMinusSign(_char2) {
|
|
664
569
|
if (_minusSign.current.test(_char2) || _char2 === '-') {
|
|
665
570
|
_minusSign.current.lastIndex = 0;
|
|
666
571
|
return true;
|
|
667
572
|
}
|
|
668
|
-
|
|
669
573
|
return false;
|
|
670
574
|
};
|
|
671
|
-
|
|
672
575
|
var isDecimalSign = function isDecimalSign(_char3) {
|
|
673
576
|
if (_decimal.current.test(_char3)) {
|
|
674
577
|
_decimal.current.lastIndex = 0;
|
|
675
578
|
return true;
|
|
676
579
|
}
|
|
677
|
-
|
|
678
580
|
return false;
|
|
679
581
|
};
|
|
680
|
-
|
|
681
582
|
var isDecimalMode = function isDecimalMode() {
|
|
682
583
|
return props.mode === 'decimal';
|
|
683
584
|
};
|
|
684
|
-
|
|
685
585
|
var getDecimalCharIndexes = function getDecimalCharIndexes(val) {
|
|
686
586
|
var decimalCharIndex = val.search(_decimal.current);
|
|
687
587
|
_decimal.current.lastIndex = 0;
|
|
@@ -693,7 +593,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
693
593
|
decimalCharIndexWithoutPrefix: decimalCharIndexWithoutPrefix
|
|
694
594
|
};
|
|
695
595
|
};
|
|
696
|
-
|
|
697
596
|
var getCharIndexes = function getCharIndexes(val) {
|
|
698
597
|
var decimalCharIndex = val.search(_decimal.current);
|
|
699
598
|
_decimal.current.lastIndex = 0;
|
|
@@ -710,7 +609,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
710
609
|
currencyCharIndex: currencyCharIndex
|
|
711
610
|
};
|
|
712
611
|
};
|
|
713
|
-
|
|
714
612
|
var insert = function insert(event, text) {
|
|
715
613
|
var sign = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
716
614
|
isDecimalSign: false,
|
|
@@ -718,31 +616,24 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
718
616
|
};
|
|
719
617
|
var minusCharIndexOnText = text.search(_minusSign.current);
|
|
720
618
|
_minusSign.current.lastIndex = 0;
|
|
721
|
-
|
|
722
619
|
if (!allowMinusSign() && minusCharIndexOnText !== -1) {
|
|
723
620
|
return;
|
|
724
621
|
}
|
|
725
|
-
|
|
726
622
|
var selectionStart = inputRef.current.selectionStart;
|
|
727
623
|
var selectionEnd = inputRef.current.selectionEnd;
|
|
728
624
|
var inputValue = inputRef.current.value.trim();
|
|
729
|
-
|
|
730
625
|
var _getCharIndexes = getCharIndexes(inputValue),
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
626
|
+
decimalCharIndex = _getCharIndexes.decimalCharIndex,
|
|
627
|
+
minusCharIndex = _getCharIndexes.minusCharIndex,
|
|
628
|
+
suffixCharIndex = _getCharIndexes.suffixCharIndex,
|
|
629
|
+
currencyCharIndex = _getCharIndexes.currencyCharIndex;
|
|
736
630
|
var newValueStr;
|
|
737
|
-
|
|
738
631
|
if (sign.isMinusSign) {
|
|
739
632
|
if (selectionStart === 0) {
|
|
740
633
|
newValueStr = inputValue;
|
|
741
|
-
|
|
742
634
|
if (minusCharIndex === -1 || selectionEnd !== 0) {
|
|
743
635
|
newValueStr = insertText(inputValue, text, 0, selectionEnd);
|
|
744
636
|
}
|
|
745
|
-
|
|
746
637
|
updateValue(event, newValueStr, text, 'insert');
|
|
747
638
|
}
|
|
748
639
|
} else if (sign.isDecimalSign) {
|
|
@@ -758,7 +649,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
758
649
|
} else {
|
|
759
650
|
var maxFractionDigits = numberFormat.current.resolvedOptions().maximumFractionDigits;
|
|
760
651
|
var operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert';
|
|
761
|
-
|
|
762
652
|
if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
763
653
|
if (selectionStart + text.length - (decimalCharIndex + 1) <= maxFractionDigits) {
|
|
764
654
|
var charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length;
|
|
@@ -771,10 +661,8 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
771
661
|
}
|
|
772
662
|
}
|
|
773
663
|
};
|
|
774
|
-
|
|
775
664
|
var insertText = function insertText(value, text, start, end) {
|
|
776
665
|
var textSplit = text === '.' ? text : text.split('.');
|
|
777
|
-
|
|
778
666
|
if (textSplit.length === 2) {
|
|
779
667
|
var decimalCharIndex = value.slice(start, end).search(_decimal.current);
|
|
780
668
|
_decimal.current.lastIndex = 0;
|
|
@@ -782,42 +670,38 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
782
670
|
} else if (end - start === value.length) {
|
|
783
671
|
return formatValue(text);
|
|
784
672
|
} else if (start === 0) {
|
|
785
|
-
|
|
673
|
+
var suffix = utils.ObjectUtils.isLetter(value[end]) ? end - 1 : end;
|
|
674
|
+
return text + value.slice(suffix);
|
|
786
675
|
} else if (end === value.length) {
|
|
787
676
|
return value.slice(0, start) + text;
|
|
788
677
|
} else {
|
|
789
678
|
return value.slice(0, start) + text + value.slice(end);
|
|
790
679
|
}
|
|
791
680
|
};
|
|
792
|
-
|
|
793
681
|
var deleteRange = function deleteRange(value, start, end) {
|
|
794
682
|
var newValueStr;
|
|
795
683
|
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
684
|
return newValueStr;
|
|
797
685
|
};
|
|
798
|
-
|
|
799
686
|
var initCursor = function initCursor() {
|
|
800
687
|
var selectionStart = inputRef.current.selectionStart;
|
|
801
688
|
var inputValue = inputRef.current.value;
|
|
802
689
|
var valueLength = inputValue.length;
|
|
803
|
-
var index = null;
|
|
690
|
+
var index = null;
|
|
804
691
|
|
|
692
|
+
// remove prefix
|
|
805
693
|
var prefixLength = (prefixChar.current || '').length;
|
|
806
694
|
inputValue = inputValue.replace(_prefix.current, '');
|
|
807
695
|
selectionStart = selectionStart - prefixLength;
|
|
808
|
-
|
|
809
696
|
var _char4 = inputValue.charAt(selectionStart);
|
|
810
|
-
|
|
811
697
|
if (isNumeralChar(_char4)) {
|
|
812
698
|
return selectionStart + prefixLength;
|
|
813
|
-
}
|
|
814
|
-
|
|
699
|
+
}
|
|
815
700
|
|
|
701
|
+
//left
|
|
816
702
|
var i = selectionStart - 1;
|
|
817
|
-
|
|
818
703
|
while (i >= 0) {
|
|
819
704
|
_char4 = inputValue.charAt(i);
|
|
820
|
-
|
|
821
705
|
if (isNumeralChar(_char4)) {
|
|
822
706
|
index = i + prefixLength;
|
|
823
707
|
break;
|
|
@@ -825,15 +709,12 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
825
709
|
i--;
|
|
826
710
|
}
|
|
827
711
|
}
|
|
828
|
-
|
|
829
712
|
if (index !== null) {
|
|
830
713
|
inputRef.current.setSelectionRange(index + 1, index + 1);
|
|
831
714
|
} else {
|
|
832
715
|
i = selectionStart;
|
|
833
|
-
|
|
834
716
|
while (i < valueLength) {
|
|
835
717
|
_char4 = inputValue.charAt(i);
|
|
836
|
-
|
|
837
718
|
if (isNumeralChar(_char4)) {
|
|
838
719
|
index = i + prefixLength;
|
|
839
720
|
break;
|
|
@@ -841,19 +722,15 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
841
722
|
i++;
|
|
842
723
|
}
|
|
843
724
|
}
|
|
844
|
-
|
|
845
725
|
if (index !== null) {
|
|
846
726
|
inputRef.current.setSelectionRange(index, index);
|
|
847
727
|
}
|
|
848
728
|
}
|
|
849
|
-
|
|
850
729
|
return index || 0;
|
|
851
730
|
};
|
|
852
|
-
|
|
853
731
|
var onInputClick = function onInputClick() {
|
|
854
732
|
initCursor();
|
|
855
733
|
};
|
|
856
|
-
|
|
857
734
|
var isNumeralChar = function isNumeralChar(_char5) {
|
|
858
735
|
if (_char5.length === 1 && (_numeral.current.test(_char5) || _decimal.current.test(_char5) || _group.current.test(_char5) || _minusSign.current.test(_char5))) {
|
|
859
736
|
resetRegex();
|
|
@@ -862,29 +739,24 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
862
739
|
return false;
|
|
863
740
|
}
|
|
864
741
|
};
|
|
865
|
-
|
|
866
742
|
var resetRegex = function resetRegex() {
|
|
867
743
|
_numeral.current.lastIndex = 0;
|
|
868
744
|
_decimal.current.lastIndex = 0;
|
|
869
745
|
_group.current.lastIndex = 0;
|
|
870
746
|
_minusSign.current.lastIndex = 0;
|
|
871
747
|
};
|
|
872
|
-
|
|
873
748
|
var updateValue = function updateValue(event, valueStr, insertedValueStr, operation) {
|
|
874
749
|
var currentValue = inputRef.current.value;
|
|
875
750
|
var newValue = null;
|
|
876
|
-
|
|
877
751
|
if (valueStr != null) {
|
|
878
752
|
newValue = evaluateEmpty(parseValue(valueStr));
|
|
879
753
|
updateInput(newValue, insertedValueStr, operation, valueStr);
|
|
880
754
|
handleOnChange(event, currentValue, newValue);
|
|
881
755
|
}
|
|
882
756
|
};
|
|
883
|
-
|
|
884
757
|
var evaluateEmpty = function evaluateEmpty(newValue) {
|
|
885
758
|
return !newValue && !props.allowEmpty ? props.min || 0 : newValue;
|
|
886
759
|
};
|
|
887
|
-
|
|
888
760
|
var handleOnChange = function handleOnChange(event, currentValue, newValue) {
|
|
889
761
|
if (props.onChange && isValueChanged(currentValue, newValue)) {
|
|
890
762
|
props.onChange({
|
|
@@ -893,55 +765,43 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
893
765
|
});
|
|
894
766
|
}
|
|
895
767
|
};
|
|
896
|
-
|
|
897
768
|
var isValueChanged = function isValueChanged(currentValue, newValue) {
|
|
898
769
|
if (newValue === null && currentValue !== null) {
|
|
899
770
|
return true;
|
|
900
771
|
}
|
|
901
|
-
|
|
902
772
|
if (newValue != null) {
|
|
903
773
|
var parsedCurrentValue = typeof currentValue === 'string' ? parseValue(currentValue) : currentValue;
|
|
904
774
|
return newValue !== parsedCurrentValue;
|
|
905
775
|
}
|
|
906
|
-
|
|
907
776
|
return false;
|
|
908
777
|
};
|
|
909
|
-
|
|
910
778
|
var validateValue = function validateValue(value) {
|
|
911
779
|
if (value === '-') {
|
|
912
780
|
return null;
|
|
913
781
|
}
|
|
914
|
-
|
|
915
782
|
return validateValueByLimit(value);
|
|
916
783
|
};
|
|
917
|
-
|
|
918
784
|
var validateValueByLimit = function validateValueByLimit(value) {
|
|
919
785
|
if (utils.ObjectUtils.isEmpty(value)) {
|
|
920
786
|
return null;
|
|
921
787
|
}
|
|
922
|
-
|
|
923
788
|
if (props.min !== null && value < props.min) {
|
|
924
789
|
return props.min;
|
|
925
790
|
}
|
|
926
|
-
|
|
927
791
|
if (props.max !== null && value > props.max) {
|
|
928
792
|
return props.max;
|
|
929
793
|
}
|
|
930
|
-
|
|
931
794
|
return value;
|
|
932
795
|
};
|
|
933
|
-
|
|
934
796
|
var updateInput = function updateInput(value, insertedValueStr, operation, valueStr) {
|
|
935
797
|
insertedValueStr = insertedValueStr || '';
|
|
936
798
|
var inputEl = inputRef.current;
|
|
937
799
|
var inputValue = inputEl.value;
|
|
938
800
|
var newValue = formatValue(value);
|
|
939
801
|
var currentLength = inputValue.length;
|
|
940
|
-
|
|
941
802
|
if (newValue !== valueStr) {
|
|
942
803
|
newValue = concatValues(newValue, valueStr);
|
|
943
804
|
}
|
|
944
|
-
|
|
945
805
|
if (currentLength === 0) {
|
|
946
806
|
inputEl.value = newValue;
|
|
947
807
|
inputEl.setSelectionRange(0, 0);
|
|
@@ -951,14 +811,11 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
951
811
|
} else {
|
|
952
812
|
var selectionStart = inputEl.selectionStart;
|
|
953
813
|
var _selectionEnd = inputEl.selectionEnd;
|
|
954
|
-
|
|
955
814
|
if (props.maxLength && props.maxLength < newValue.length) {
|
|
956
815
|
return;
|
|
957
816
|
}
|
|
958
|
-
|
|
959
817
|
inputEl.value = newValue;
|
|
960
818
|
var newLength = newValue.length;
|
|
961
|
-
|
|
962
819
|
if (operation === 'range-insert') {
|
|
963
820
|
var startValue = parseValue((inputValue || '').slice(0, selectionStart));
|
|
964
821
|
var startValueStr = startValue !== null ? startValue.toString() : '';
|
|
@@ -976,73 +833,56 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
976
833
|
var prevChar = inputValue.charAt(_selectionEnd - 1);
|
|
977
834
|
var nextChar = inputValue.charAt(_selectionEnd);
|
|
978
835
|
var diff = currentLength - newLength;
|
|
979
|
-
|
|
980
836
|
var isGroupChar = _group.current.test(nextChar);
|
|
981
|
-
|
|
982
837
|
if (isGroupChar && diff === 1) {
|
|
983
838
|
_selectionEnd += 1;
|
|
984
839
|
} else if (!isGroupChar && isNumeralChar(prevChar)) {
|
|
985
840
|
_selectionEnd += -1 * diff + 1;
|
|
986
841
|
}
|
|
987
|
-
|
|
988
842
|
_group.current.lastIndex = 0;
|
|
989
843
|
inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
990
844
|
} else if (inputValue === '-' && operation === 'insert') {
|
|
991
845
|
inputEl.setSelectionRange(0, 0);
|
|
992
|
-
|
|
993
846
|
var _index2 = initCursor();
|
|
994
|
-
|
|
995
847
|
var _selectionEnd2 = _index2 + insertedValueStr.length + 1;
|
|
996
|
-
|
|
997
848
|
inputEl.setSelectionRange(_selectionEnd2, _selectionEnd2);
|
|
998
849
|
} else {
|
|
999
850
|
_selectionEnd = _selectionEnd + (newLength - currentLength);
|
|
1000
851
|
inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
1001
852
|
}
|
|
1002
853
|
}
|
|
1003
|
-
|
|
1004
854
|
inputEl.setAttribute('aria-valuenow', value);
|
|
1005
855
|
};
|
|
1006
|
-
|
|
1007
856
|
var updateInputValue = function updateInputValue(newValue) {
|
|
1008
857
|
newValue = evaluateEmpty(newValue);
|
|
1009
858
|
var inputEl = inputRef.current;
|
|
1010
859
|
var value = inputEl.value;
|
|
1011
|
-
|
|
1012
860
|
var _formattedValue = formattedValue(newValue);
|
|
1013
|
-
|
|
1014
861
|
if (value !== _formattedValue) {
|
|
1015
862
|
inputEl.value = _formattedValue;
|
|
1016
863
|
inputEl.setAttribute('aria-valuenow', newValue);
|
|
1017
864
|
}
|
|
1018
865
|
};
|
|
1019
|
-
|
|
1020
866
|
var formattedValue = function formattedValue(val) {
|
|
1021
867
|
return formatValue(evaluateEmpty(val));
|
|
1022
868
|
};
|
|
1023
|
-
|
|
1024
869
|
var concatValues = function concatValues(val1, val2) {
|
|
1025
870
|
if (val1 && val2) {
|
|
1026
871
|
var decimalCharIndex = val2.search(_decimal.current);
|
|
1027
872
|
_decimal.current.lastIndex = 0;
|
|
1028
873
|
return decimalCharIndex !== -1 ? val1.split(_decimal.current)[0] + val2.slice(decimalCharIndex) : val1;
|
|
1029
874
|
}
|
|
1030
|
-
|
|
1031
875
|
return val1;
|
|
1032
876
|
};
|
|
1033
|
-
|
|
1034
877
|
var getDecimalLength = function getDecimalLength(value) {
|
|
1035
878
|
if (value) {
|
|
1036
879
|
var valueSplit = value.split(_decimal.current);
|
|
1037
|
-
|
|
1038
880
|
if (valueSplit.length === 2) {
|
|
1039
881
|
return valueSplit[1].replace(_suffix.current, '').trim().replace(/\s/g, '').replace(_currency.current, '').length;
|
|
1040
882
|
}
|
|
1041
883
|
}
|
|
1042
|
-
|
|
1043
884
|
return 0;
|
|
1044
885
|
};
|
|
1045
|
-
|
|
1046
886
|
var updateModel = function updateModel(event, value) {
|
|
1047
887
|
if (props.onValueChange) {
|
|
1048
888
|
props.onValueChange({
|
|
@@ -1058,50 +898,48 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1058
898
|
});
|
|
1059
899
|
}
|
|
1060
900
|
};
|
|
1061
|
-
|
|
1062
901
|
var onInputFocus = function onInputFocus(event) {
|
|
1063
902
|
setFocusedState(true);
|
|
1064
903
|
props.onFocus && props.onFocus(event);
|
|
904
|
+
if ((props.suffix || props.currency || props.prefix) && inputRef.current) {
|
|
905
|
+
// GitHub #1866 Cursor must be placed before/after symbol or arrow keys don't work
|
|
906
|
+
var selectionEnd = initCursor();
|
|
907
|
+
inputRef.current.setSelectionRange(selectionEnd, selectionEnd);
|
|
908
|
+
}
|
|
1065
909
|
};
|
|
1066
|
-
|
|
1067
910
|
var onInputBlur = function onInputBlur(event) {
|
|
1068
911
|
setFocusedState(false);
|
|
1069
|
-
|
|
1070
912
|
if (inputRef.current) {
|
|
1071
913
|
var currentValue = inputRef.current.value;
|
|
1072
|
-
|
|
1073
914
|
if (isValueChanged(currentValue, props.value)) {
|
|
1074
915
|
var newValue = validateValue(parseValue(currentValue));
|
|
1075
916
|
updateInputValue(newValue);
|
|
1076
917
|
updateModel(event, newValue);
|
|
1077
918
|
}
|
|
1078
919
|
}
|
|
1079
|
-
|
|
1080
920
|
props.onBlur && props.onBlur(event);
|
|
1081
921
|
};
|
|
1082
|
-
|
|
1083
922
|
var clearTimer = function clearTimer() {
|
|
1084
923
|
if (timer.current) {
|
|
1085
924
|
clearInterval(timer.current);
|
|
1086
925
|
}
|
|
1087
926
|
};
|
|
1088
|
-
|
|
1089
927
|
var changeValue = function changeValue() {
|
|
1090
928
|
updateInputValue(validateValueByLimit(props.value));
|
|
1091
929
|
var newValue = validateValue(props.value);
|
|
1092
|
-
|
|
1093
930
|
if (props.value !== null && props.value !== newValue) {
|
|
1094
931
|
updateModel(null, newValue);
|
|
1095
932
|
}
|
|
1096
933
|
};
|
|
1097
|
-
|
|
1098
934
|
var getFormatter = function getFormatter() {
|
|
1099
935
|
return numberFormat.current;
|
|
1100
936
|
};
|
|
1101
|
-
|
|
1102
937
|
React__namespace.useImperativeHandle(ref, function () {
|
|
1103
938
|
return {
|
|
1104
939
|
props: props,
|
|
940
|
+
focus: function focus() {
|
|
941
|
+
return utils.DomHandler.focus(inputRef.current);
|
|
942
|
+
},
|
|
1105
943
|
getFormatter: getFormatter,
|
|
1106
944
|
getElement: function getElement() {
|
|
1107
945
|
return elementRef.current;
|
|
@@ -1117,7 +955,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1117
955
|
hooks.useMountEffect(function () {
|
|
1118
956
|
constructParser();
|
|
1119
957
|
var newValue = validateValue(props.value);
|
|
1120
|
-
|
|
1121
958
|
if (props.value !== null && props.value !== newValue) {
|
|
1122
959
|
updateModel(null, newValue);
|
|
1123
960
|
}
|
|
@@ -1129,7 +966,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1129
966
|
hooks.useUpdateEffect(function () {
|
|
1130
967
|
changeValue();
|
|
1131
968
|
}, [props.value]);
|
|
1132
|
-
|
|
1133
969
|
var createInputElement = function createInputElement() {
|
|
1134
970
|
var className = utils.classNames('p-inputnumber-input', props.inputClassName);
|
|
1135
971
|
var valueToRender = formattedValue(props.value);
|
|
@@ -1166,7 +1002,6 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1166
1002
|
"aria-valuenow": props.value
|
|
1167
1003
|
}, ariaProps, dataProps));
|
|
1168
1004
|
};
|
|
1169
|
-
|
|
1170
1005
|
var createUpButton = function createUpButton() {
|
|
1171
1006
|
var className = utils.classNames('p-inputnumber-button p-inputnumber-button-up p-button p-button-icon-only p-component', {
|
|
1172
1007
|
'p-disabled': props.disabled
|
|
@@ -1175,20 +1010,17 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1175
1010
|
return /*#__PURE__*/React__namespace.createElement("button", {
|
|
1176
1011
|
type: "button",
|
|
1177
1012
|
className: className,
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1013
|
+
onPointerLeave: onUpButtonMouseLeave,
|
|
1014
|
+
onPointerDown: onUpButtonMouseDown,
|
|
1015
|
+
onPointerUp: onUpButtonMouseUp,
|
|
1181
1016
|
onKeyDown: onUpButtonKeyDown,
|
|
1182
1017
|
onKeyUp: onUpButtonKeyUp,
|
|
1183
|
-
onTouchStart: onUpButtonTouchStart,
|
|
1184
|
-
onTouchEnd: onUpButtonTouchEnd,
|
|
1185
1018
|
disabled: props.disabled,
|
|
1186
1019
|
tabIndex: -1
|
|
1187
1020
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
1188
1021
|
className: icon
|
|
1189
1022
|
}), /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null));
|
|
1190
1023
|
};
|
|
1191
|
-
|
|
1192
1024
|
var createDownButton = function createDownButton() {
|
|
1193
1025
|
var className = utils.classNames('p-inputnumber-button p-inputnumber-button-down p-button p-button-icon-only p-component', {
|
|
1194
1026
|
'p-disabled': props.disabled
|
|
@@ -1197,33 +1029,27 @@ var InputNumber = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namesp
|
|
|
1197
1029
|
return /*#__PURE__*/React__namespace.createElement("button", {
|
|
1198
1030
|
type: "button",
|
|
1199
1031
|
className: className,
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1032
|
+
onPointerLeave: onDownButtonMouseLeave,
|
|
1033
|
+
onPointerDown: onDownButtonMouseDown,
|
|
1034
|
+
onPointerUp: onDownButtonMouseUp,
|
|
1203
1035
|
onKeyDown: onDownButtonKeyDown,
|
|
1204
1036
|
onKeyUp: onDownButtonKeyUp,
|
|
1205
|
-
onTouchStart: onDownButtonTouchStart,
|
|
1206
|
-
onTouchEnd: onDownButtonTouchEnd,
|
|
1207
1037
|
disabled: props.disabled,
|
|
1208
1038
|
tabIndex: -1
|
|
1209
1039
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
1210
1040
|
className: icon
|
|
1211
1041
|
}), /*#__PURE__*/React__namespace.createElement(ripple.Ripple, null));
|
|
1212
1042
|
};
|
|
1213
|
-
|
|
1214
1043
|
var createButtonGroup = function createButtonGroup() {
|
|
1215
1044
|
var upButton = props.showButtons && createUpButton();
|
|
1216
1045
|
var downButton = props.showButtons && createDownButton();
|
|
1217
|
-
|
|
1218
1046
|
if (stacked) {
|
|
1219
1047
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
1220
1048
|
className: "p-inputnumber-button-group"
|
|
1221
1049
|
}, upButton, downButton);
|
|
1222
1050
|
}
|
|
1223
|
-
|
|
1224
1051
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, upButton, downButton);
|
|
1225
1052
|
};
|
|
1226
|
-
|
|
1227
1053
|
var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
|
|
1228
1054
|
var otherProps = utils.ObjectUtils.findDiffKeys(props, InputNumber.defaultProps);
|
|
1229
1055
|
var dataProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.DATA_PROPS);
|