primereact 10.6.2 → 10.6.4
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 +14 -16
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +4 -0
- package/accordion/accordion.esm.js +14 -16
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +14 -16
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +109 -38
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +5 -0
- package/api/api.esm.js +109 -38
- package/api/api.esm.min.js +1 -1
- package/api/api.js +109 -38
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +22 -14
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +5 -0
- package/autocomplete/autocomplete.esm.js +22 -14
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +22 -14
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/blockui.cjs.js +3 -6
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +3 -6
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +3 -6
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +3 -6
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +3 -6
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +3 -6
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/buttongroup/buttongroup.cjs.js +6 -1
- package/buttongroup/buttongroup.cjs.min.js +1 -1
- package/buttongroup/buttongroup.d.ts +1 -1
- package/buttongroup/buttongroup.esm.js +7 -2
- package/buttongroup/buttongroup.esm.min.js +1 -1
- package/buttongroup/buttongroup.js +6 -1
- package/buttongroup/buttongroup.min.js +1 -1
- package/calendar/calendar.cjs.js +52 -25
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +5 -0
- package/calendar/calendar.esm.js +52 -25
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +52 -25
- package/calendar/calendar.min.js +1 -1
- package/card/card.cjs.js +2 -5
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +3 -6
- package/card/card.esm.min.js +1 -1
- package/card/card.js +2 -5
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +6 -2
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +7 -3
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +6 -2
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +14 -16
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +5 -0
- package/cascadeselect/cascadeselect.esm.js +14 -16
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +14 -16
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +4 -7
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +4 -7
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +4 -7
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +6 -3
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +11 -1
- package/checkbox/checkbox.esm.js +6 -3
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +6 -3
- package/checkbox/checkbox.min.js +1 -1
- package/chips/chips.cjs.js +17 -15
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +5 -0
- package/chips/chips.esm.js +17 -15
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +17 -15
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +2 -2
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +2 -2
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +2 -2
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.d.ts +1 -1
- package/componentbase/componentbase.cjs.js +1 -1
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +1 -1
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +1 -1
- package/componentbase/componentbase.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +2 -2
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +2 -2
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +2 -2
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/core/core.js +453 -234
- package/core/core.min.js +11 -11
- package/datatable/datatable.cjs.js +32 -12
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +27 -27
- package/datatable/datatable.esm.js +32 -12
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +32 -12
- package/datatable/datatable.min.js +1 -1
- package/dialog/dialog.cjs.js +146 -95
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +147 -96
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +147 -96
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +80 -60
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +23 -18
- package/dropdown/dropdown.esm.js +80 -60
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +80 -60
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +2 -2
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +2 -2
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +2 -2
- package/editor/editor.min.js +1 -1
- package/fileupload/fileupload.cjs.js +7 -4
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +4 -0
- package/fileupload/fileupload.esm.js +7 -4
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +7 -4
- package/fileupload/fileupload.min.js +1 -1
- package/floatlabel/floatlabel.cjs.js +6 -1
- package/floatlabel/floatlabel.cjs.min.js +1 -1
- package/floatlabel/floatlabel.d.ts +5 -0
- package/floatlabel/floatlabel.esm.js +7 -2
- package/floatlabel/floatlabel.esm.min.js +1 -1
- package/floatlabel/floatlabel.js +6 -1
- package/floatlabel/floatlabel.min.js +1 -1
- package/galleria/galleria.cjs.js +9 -3
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +10 -4
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +9 -3
- package/galleria/galleria.min.js +1 -1
- package/iconfield/iconfield.cjs.js +4 -4
- package/iconfield/iconfield.cjs.min.js +1 -1
- package/iconfield/iconfield.esm.js +4 -4
- package/iconfield/iconfield.esm.min.js +1 -1
- package/iconfield/iconfield.js +4 -4
- package/iconfield/iconfield.min.js +1 -1
- package/iconfield/package.json +7 -0
- package/image/image.cjs.js +2 -2
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +2 -2
- package/image/image.esm.min.js +1 -1
- package/image/image.js +2 -2
- package/image/image.min.js +1 -1
- package/inputicon/package.json +7 -0
- package/inputmask/inputmask.cjs.js +21 -1
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +11 -1
- package/inputmask/inputmask.esm.js +22 -2
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +21 -1
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +79 -24
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +5 -0
- package/inputnumber/inputnumber.esm.js +79 -24
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +79 -24
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputotp/inputotp.cjs.js +348 -0
- package/inputotp/inputotp.cjs.min.js +1 -0
- package/inputotp/inputotp.d.ts +177 -0
- package/inputotp/inputotp.esm.js +340 -0
- package/inputotp/inputotp.esm.min.js +1 -0
- package/inputotp/inputotp.js +346 -0
- package/inputotp/inputotp.min.js +1 -0
- package/inputotp/package.json +7 -0
- package/inputtext/inputtext.cjs.js +9 -5
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +5 -0
- package/inputtext/inputtext.esm.js +9 -5
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +9 -5
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +8 -4
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +5 -0
- package/inputtextarea/inputtextarea.esm.js +8 -4
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +8 -4
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +3 -1
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +3 -1
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +3 -1
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +2 -2
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +2 -2
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +2 -2
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +2 -6
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +2 -6
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +2 -6
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +10 -6
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +10 -6
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +10 -6
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +13 -9
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +13 -9
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +13 -9
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +23 -5
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +19 -0
- package/menu/menu.esm.js +23 -5
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +23 -5
- package/menu/menu.min.js +1 -1
- package/messages/messages.cjs.js +1 -1
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +1 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +1 -1
- package/messages/messages.min.js +1 -1
- package/metergroup/metergroup.cjs.js +33 -12
- package/metergroup/metergroup.cjs.min.js +1 -1
- package/metergroup/metergroup.esm.js +6 -5
- package/metergroup/metergroup.esm.min.js +1 -1
- package/metergroup/metergroup.js +32 -11
- package/metergroup/metergroup.min.js +1 -1
- package/metergroup/package.json +7 -0
- package/multiselect/multiselect.cjs.js +45 -11
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +22 -17
- package/multiselect/multiselect.esm.js +45 -11
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +45 -11
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +6 -3
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +6 -3
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +6 -3
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +8 -5
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +5 -0
- package/overlaypanel/overlaypanel.esm.js +8 -5
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +8 -5
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +6 -0
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +6 -0
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +6 -0
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +13 -17
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +13 -17
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +13 -17
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +148 -174
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +148 -174
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +148 -174
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +109 -18
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +10 -5
- package/password/password.esm.js +109 -18
- package/password/password.esm.min.js +1 -1
- package/password/password.js +110 -19
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +6 -0
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +6 -0
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +6 -0
- package/picklist/picklist.min.js +1 -1
- package/primereact.all.cjs.js +1471 -1140
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1471 -1140
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1471 -1140
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +8 -3
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.d.ts +5 -0
- package/radiobutton/radiobutton.esm.js +8 -3
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +8 -3
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +2 -2
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +2 -2
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +2 -2
- package/rating/rating.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +51 -43
- package/resources/themes/arya-green/theme.css +51 -43
- package/resources/themes/arya-orange/theme.css +51 -43
- package/resources/themes/bootstrap4-dark-blue/theme.css +51 -43
- package/resources/themes/bootstrap4-dark-purple/theme.css +9 -0
- package/resources/themes/bootstrap4-light-blue/theme.css +51 -43
- package/resources/themes/bootstrap4-light-purple/theme.css +9 -0
- package/resources/themes/fluent-light/theme.css +51 -43
- package/resources/themes/lara-dark-amber/theme.css +51 -43
- package/resources/themes/lara-dark-blue/theme.css +51 -43
- package/resources/themes/lara-dark-cyan/theme.css +51 -43
- package/resources/themes/lara-dark-green/theme.css +51 -43
- package/resources/themes/lara-dark-indigo/theme.css +51 -43
- package/resources/themes/lara-dark-pink/theme.css +51 -43
- package/resources/themes/lara-dark-purple/theme.css +1124 -227
- package/resources/themes/lara-dark-teal/theme.css +51 -43
- package/resources/themes/lara-light-amber/theme.css +51 -43
- package/resources/themes/lara-light-blue/theme.css +51 -43
- package/resources/themes/lara-light-cyan/theme.css +51 -43
- package/resources/themes/lara-light-green/theme.css +51 -43
- package/resources/themes/lara-light-indigo/theme.css +51 -43
- package/resources/themes/lara-light-pink/theme.css +51 -43
- package/resources/themes/lara-light-purple/theme.css +1122 -229
- package/resources/themes/lara-light-teal/theme.css +51 -43
- package/resources/themes/luna-amber/theme.css +51 -43
- package/resources/themes/luna-blue/theme.css +51 -43
- package/resources/themes/luna-green/theme.css +51 -43
- package/resources/themes/luna-pink/theme.css +51 -43
- package/resources/themes/md-dark-deeppurple/theme.css +9 -0
- package/resources/themes/md-dark-indigo/theme.css +193 -185
- package/resources/themes/md-light-deeppurple/theme.css +9 -0
- package/resources/themes/md-light-indigo/theme.css +51 -43
- package/resources/themes/mdc-dark-deeppurple/theme.css +9 -0
- package/resources/themes/mdc-dark-indigo/theme.css +193 -185
- package/resources/themes/mdc-light-deeppurple/theme.css +9 -0
- package/resources/themes/mdc-light-indigo/theme.css +51 -43
- package/resources/themes/mira/theme.css +51 -43
- package/resources/themes/nano/theme.css +51 -43
- package/resources/themes/nova/theme.css +51 -43
- package/resources/themes/nova-accent/theme.css +51 -43
- package/resources/themes/nova-alt/theme.css +51 -43
- package/resources/themes/rhea/theme.css +51 -43
- package/resources/themes/saga-blue/theme.css +51 -43
- package/resources/themes/saga-green/theme.css +51 -43
- package/resources/themes/saga-orange/theme.css +51 -43
- package/resources/themes/soho-dark/theme.css +76 -68
- package/resources/themes/soho-light/theme.css +51 -43
- package/resources/themes/tailwind-light/theme.css +52 -44
- package/resources/themes/vela-blue/theme.css +51 -43
- package/resources/themes/vela-green/theme.css +51 -43
- package/resources/themes/vela-orange/theme.css +51 -43
- package/resources/themes/viva-dark/theme.css +51 -43
- package/resources/themes/viva-light/theme.css +51 -43
- package/ripple/ripple.d.ts +32 -0
- package/scrollpanel/scrollpanel.cjs.js +2 -5
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +3 -6
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +2 -5
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +2 -2
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +2 -2
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +2 -2
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/sidebar.cjs.js +5 -5
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +5 -5
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +5 -5
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +2 -2
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +2 -2
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +2 -2
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +3 -3
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +3 -3
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +3 -3
- package/slider/slider.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +2 -2
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +2 -2
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +2 -2
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +6 -1
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +6 -1
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +6 -1
- package/splitter/splitter.min.js +1 -1
- package/stepper/stepper.cjs.js +14 -4
- package/stepper/stepper.cjs.min.js +1 -1
- package/stepper/stepper.d.ts +13 -1
- package/stepper/stepper.esm.js +14 -4
- package/stepper/stepper.esm.min.js +1 -1
- package/stepper/stepper.js +14 -4
- package/stepper/stepper.min.js +1 -1
- package/stepperpanel/stepperpanel.cjs.js +4 -2
- package/stepperpanel/stepperpanel.cjs.min.js +1 -1
- package/stepperpanel/stepperpanel.d.ts +2 -2
- package/stepperpanel/stepperpanel.esm.js +4 -2
- package/stepperpanel/stepperpanel.esm.min.js +1 -1
- package/stepperpanel/stepperpanel.js +4 -2
- package/stepperpanel/stepperpanel.min.js +1 -1
- package/steps/steps.cjs.js +2 -2
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +2 -2
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +2 -2
- package/steps/steps.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +2 -5
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +2 -5
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +2 -5
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +3 -3
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +4 -0
- package/tabview/tabview.esm.js +3 -3
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +3 -3
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +2 -2
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +2 -2
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +2 -2
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/toast.cjs.js +7 -1
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +7 -1
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +7 -1
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +3 -3
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +3 -3
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +3 -3
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +2 -5
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +3 -6
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +2 -5
- package/toolbar/toolbar.min.js +1 -1
- package/tree/tree.cjs.js +12 -5
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +12 -5
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +12 -5
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +19 -5
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +5 -0
- package/treeselect/treeselect.esm.js +19 -5
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +19 -5
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +14 -3
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +14 -3
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +14 -3
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +8 -4
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.d.ts +5 -0
- package/tristatecheckbox/tristatecheckbox.esm.js +8 -4
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +8 -4
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/virtualscroller/virtualscroller.d.ts +3 -3
- package/web-types.json +362 -15
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useRef, useContext, useState } from 'react';
|
|
3
|
+
import { PrimeReactContext, ariaLabel } from 'primereact/api';
|
|
4
|
+
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
5
|
+
import { useMergeProps } from 'primereact/hooks';
|
|
6
|
+
import { InputText } from 'primereact/inputtext';
|
|
7
|
+
import { ObjectUtils } from 'primereact/utils';
|
|
8
|
+
|
|
9
|
+
function _extends() {
|
|
10
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
11
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
12
|
+
var source = arguments[i];
|
|
13
|
+
for (var key in source) {
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
15
|
+
target[key] = source[key];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return target;
|
|
20
|
+
};
|
|
21
|
+
return _extends.apply(this, arguments);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function _arrayLikeToArray(arr, len) {
|
|
25
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
26
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
27
|
+
return arr2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function _arrayWithoutHoles(arr) {
|
|
31
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _iterableToArray(iter) {
|
|
35
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
39
|
+
if (!o) return;
|
|
40
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
41
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
42
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
43
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
44
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function _nonIterableSpread() {
|
|
48
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function _toConsumableArray(arr) {
|
|
52
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function _arrayWithHoles(arr) {
|
|
56
|
+
if (Array.isArray(arr)) return arr;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function _iterableToArrayLimit(r, l) {
|
|
60
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
61
|
+
if (null != t) {
|
|
62
|
+
var e,
|
|
63
|
+
n,
|
|
64
|
+
i,
|
|
65
|
+
u,
|
|
66
|
+
a = [],
|
|
67
|
+
f = !0,
|
|
68
|
+
o = !1;
|
|
69
|
+
try {
|
|
70
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
71
|
+
if (Object(t) !== t) return;
|
|
72
|
+
f = !1;
|
|
73
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
74
|
+
} catch (r) {
|
|
75
|
+
o = !0, n = r;
|
|
76
|
+
} finally {
|
|
77
|
+
try {
|
|
78
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
79
|
+
} finally {
|
|
80
|
+
if (o) throw n;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return a;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function _nonIterableRest() {
|
|
88
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function _slicedToArray(arr, i) {
|
|
92
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function _typeof(o) {
|
|
96
|
+
"@babel/helpers - typeof";
|
|
97
|
+
|
|
98
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
99
|
+
return typeof o;
|
|
100
|
+
} : function (o) {
|
|
101
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
102
|
+
}, _typeof(o);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function _toPrimitive(input, hint) {
|
|
106
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
107
|
+
var prim = input[Symbol.toPrimitive];
|
|
108
|
+
if (prim !== undefined) {
|
|
109
|
+
var res = prim.call(input, hint || "default");
|
|
110
|
+
if (_typeof(res) !== "object") return res;
|
|
111
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
112
|
+
}
|
|
113
|
+
return (hint === "string" ? String : Number)(input);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function _toPropertyKey(arg) {
|
|
117
|
+
var key = _toPrimitive(arg, "string");
|
|
118
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function _defineProperty(obj, key, value) {
|
|
122
|
+
key = _toPropertyKey(key);
|
|
123
|
+
if (key in obj) {
|
|
124
|
+
Object.defineProperty(obj, key, {
|
|
125
|
+
value: value,
|
|
126
|
+
enumerable: true,
|
|
127
|
+
configurable: true,
|
|
128
|
+
writable: true
|
|
129
|
+
});
|
|
130
|
+
} else {
|
|
131
|
+
obj[key] = value;
|
|
132
|
+
}
|
|
133
|
+
return obj;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
var classes = {
|
|
137
|
+
root: 'p-inputotp p-component',
|
|
138
|
+
input: 'p-inputotp-input'
|
|
139
|
+
};
|
|
140
|
+
var InputOtpBase = ComponentBase.extend({
|
|
141
|
+
defaultProps: {
|
|
142
|
+
__TYPE: 'InputOtp',
|
|
143
|
+
__parentMetadata: null,
|
|
144
|
+
className: null,
|
|
145
|
+
modelValue: false,
|
|
146
|
+
invalid: false,
|
|
147
|
+
disabled: false,
|
|
148
|
+
readOnly: false,
|
|
149
|
+
variant: null,
|
|
150
|
+
tabIndex: null,
|
|
151
|
+
length: 4,
|
|
152
|
+
mask: false,
|
|
153
|
+
integerOnly: false
|
|
154
|
+
},
|
|
155
|
+
css: {
|
|
156
|
+
classes: classes
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
161
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
162
|
+
var InputOtp = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
163
|
+
var _props$value, _props$value$split;
|
|
164
|
+
var elementRef = useRef(ref);
|
|
165
|
+
var mergeProps = useMergeProps();
|
|
166
|
+
var context = useContext(PrimeReactContext);
|
|
167
|
+
var props = InputOtpBase.getProps(inProps, context);
|
|
168
|
+
var _InputOtpBase$setMeta = InputOtpBase.setMetaData(_objectSpread(_objectSpread({
|
|
169
|
+
props: props
|
|
170
|
+
}, props.__parentMetadata), {}, {
|
|
171
|
+
context: {
|
|
172
|
+
disabled: props.disabled
|
|
173
|
+
}
|
|
174
|
+
})),
|
|
175
|
+
ptm = _InputOtpBase$setMeta.ptm,
|
|
176
|
+
cx = _InputOtpBase$setMeta.cx,
|
|
177
|
+
isUnstyled = _InputOtpBase$setMeta.isUnstyled;
|
|
178
|
+
useHandleStyle(InputOtpBase.css.styles, isUnstyled, {
|
|
179
|
+
name: 'inputotp'
|
|
180
|
+
});
|
|
181
|
+
var defaultValue = props.value ? (_props$value = props.value) === null || _props$value === void 0 || (_props$value = _props$value.toString()) === null || _props$value === void 0 || (_props$value$split = _props$value.split) === null || _props$value$split === void 0 ? void 0 : _props$value$split.call(_props$value, '') : new Array(props.length);
|
|
182
|
+
var _useState = useState(defaultValue),
|
|
183
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
184
|
+
tokens = _useState2[0],
|
|
185
|
+
setTokens = _useState2[1];
|
|
186
|
+
var findNextInput = function findNextInput(element) {
|
|
187
|
+
var nextInput = element.nextElementSibling;
|
|
188
|
+
if (!nextInput) return;
|
|
189
|
+
return nextInput.nodeName === 'INPUT' ? nextInput : findNextInput(nextInput);
|
|
190
|
+
};
|
|
191
|
+
var findPrevInput = function findPrevInput(element) {
|
|
192
|
+
var prevInput = element.previousElementSibling;
|
|
193
|
+
if (!prevInput) return;
|
|
194
|
+
return prevInput.nodeName === 'INPUT' ? prevInput : findPrevInput(prevInput);
|
|
195
|
+
};
|
|
196
|
+
var moveToNextInput = function moveToNextInput(event) {
|
|
197
|
+
var nextInput = findNextInput(event.target);
|
|
198
|
+
if (nextInput) {
|
|
199
|
+
nextInput.focus();
|
|
200
|
+
nextInput.select();
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
var moveToPrevInput = function moveToPrevInput(event) {
|
|
204
|
+
var prevInput = findPrevInput(event.target);
|
|
205
|
+
if (prevInput) {
|
|
206
|
+
prevInput.focus();
|
|
207
|
+
prevInput.select();
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
var onChange = function onChange(event, value) {
|
|
211
|
+
var _props$onChange;
|
|
212
|
+
props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, {
|
|
213
|
+
originalEvent: event,
|
|
214
|
+
value: value.join('')
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
var updateTokens = function updateTokens(event, index) {
|
|
218
|
+
var inputValue = event.target.value;
|
|
219
|
+
var newTokens = _toConsumableArray(tokens);
|
|
220
|
+
newTokens[index] = inputValue;
|
|
221
|
+
newTokens = newTokens.join('');
|
|
222
|
+
newTokens = newTokens ? newTokens.split('') : new Array(props.length);
|
|
223
|
+
setTokens(newTokens);
|
|
224
|
+
onChange(event, newTokens);
|
|
225
|
+
};
|
|
226
|
+
var _onInput = function onInput(event, index) {
|
|
227
|
+
updateTokens(event, index);
|
|
228
|
+
if (event.nativeEvent.inputType === 'deleteContentBackward') {
|
|
229
|
+
moveToPrevInput(event);
|
|
230
|
+
} else if (event.nativeEvent.inputType === 'insertText' || event.nativeEvent.inputType === 'deleteContentForward') {
|
|
231
|
+
moveToNextInput(event);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var onPaste = function onPaste(event) {
|
|
235
|
+
var paste = event.clipboardData.getData('text');
|
|
236
|
+
if (paste.length) {
|
|
237
|
+
var pastedCode = paste.substring(0, props.length + 1);
|
|
238
|
+
if (!props.integerOnly || !isNaN(pastedCode)) {
|
|
239
|
+
var newTokens = pastedCode.split('');
|
|
240
|
+
setTokens(newTokens);
|
|
241
|
+
onChange(event, newTokens);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
var onFocus = function onFocus(event) {
|
|
246
|
+
var _props$focus;
|
|
247
|
+
event.target.select();
|
|
248
|
+
props === null || props === void 0 || (_props$focus = props.focus) === null || _props$focus === void 0 || _props$focus.call(props, event);
|
|
249
|
+
};
|
|
250
|
+
var onBlur = function onBlur(event) {
|
|
251
|
+
var _props$blur;
|
|
252
|
+
props === null || props === void 0 || (_props$blur = props.blur) === null || _props$blur === void 0 || _props$blur.call(props, event);
|
|
253
|
+
};
|
|
254
|
+
var onKeydown = function onKeydown(event) {
|
|
255
|
+
switch (event.code) {
|
|
256
|
+
case 'ArrowLeft':
|
|
257
|
+
{
|
|
258
|
+
moveToPrevInput(event);
|
|
259
|
+
event.preventDefault();
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
case 'ArrowRight':
|
|
263
|
+
{
|
|
264
|
+
moveToNextInput(event);
|
|
265
|
+
event.preventDefault();
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
case 'Backspace':
|
|
269
|
+
{
|
|
270
|
+
var _event$target;
|
|
271
|
+
if (((_event$target = event.target) === null || _event$target === void 0 || (_event$target = _event$target.value) === null || _event$target === void 0 ? void 0 : _event$target.length) === 0) {
|
|
272
|
+
moveToPrevInput(event);
|
|
273
|
+
event.preventDefault();
|
|
274
|
+
}
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
case 'ArrowUp':
|
|
278
|
+
case 'ArrowDown':
|
|
279
|
+
{
|
|
280
|
+
event.preventDefault();
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
default:
|
|
284
|
+
{
|
|
285
|
+
// Prevent non-numeric characters from being entered if integerOnly is true or if the length of the input is greater than the specified length
|
|
286
|
+
if (props !== null && props !== void 0 && props.integerOnly && !((event.code.startsWith('Digit') || event.code.startsWith('Numpad')) && Number(event.key) >= 0 && Number(event.key) <= 9) || tokens.join('').length >= props.length && event.code !== 'Delete') {
|
|
287
|
+
event.preventDefault();
|
|
288
|
+
}
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
var createInputElements = function createInputElements(remainingInputs) {
|
|
294
|
+
if (remainingInputs <= 0) {
|
|
295
|
+
return [];
|
|
296
|
+
}
|
|
297
|
+
var inputElementIndex = props.length - remainingInputs;
|
|
298
|
+
var inputElementEvents = {
|
|
299
|
+
onInput: function onInput(event) {
|
|
300
|
+
return _onInput(event, inputElementIndex);
|
|
301
|
+
},
|
|
302
|
+
onKeyDown: onKeydown,
|
|
303
|
+
onFocus: onFocus,
|
|
304
|
+
onBlur: onBlur,
|
|
305
|
+
onPaste: onPaste
|
|
306
|
+
};
|
|
307
|
+
var inputElementProps = mergeProps({
|
|
308
|
+
id: inputElementIndex,
|
|
309
|
+
key: inputElementIndex,
|
|
310
|
+
value: tokens[inputElementIndex] || '',
|
|
311
|
+
inputMode: props !== null && props !== void 0 && props.integerOnly ? 'numeric' : 'text',
|
|
312
|
+
type: props !== null && props !== void 0 && props.mask ? 'password' : 'text',
|
|
313
|
+
variant: props === null || props === void 0 ? void 0 : props.variant,
|
|
314
|
+
readOnly: props === null || props === void 0 ? void 0 : props.readOnly,
|
|
315
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabled,
|
|
316
|
+
invalid: props === null || props === void 0 ? void 0 : props.invalid,
|
|
317
|
+
tabIndex: props === null || props === void 0 ? void 0 : props.tabIndex,
|
|
318
|
+
unstyled: props === null || props === void 0 ? void 0 : props.unstyled,
|
|
319
|
+
'aria-label': ariaLabel('otpLabel', {
|
|
320
|
+
0: inputElementIndex + 1
|
|
321
|
+
}),
|
|
322
|
+
className: cx('input')
|
|
323
|
+
}, ptm('input'));
|
|
324
|
+
var inputElement = props !== null && props !== void 0 && props.inputTemplate ? ObjectUtils.getJSXElement(props === null || props === void 0 ? void 0 : props.inputTemplate, {
|
|
325
|
+
events: inputElementEvents,
|
|
326
|
+
props: inputElementProps
|
|
327
|
+
}) : /*#__PURE__*/React.createElement(InputText, _extends({}, inputElementProps, inputElementEvents));
|
|
328
|
+
var inputElements = [inputElement].concat(_toConsumableArray(createInputElements(remainingInputs - 1)));
|
|
329
|
+
return inputElements;
|
|
330
|
+
};
|
|
331
|
+
var rootElementProps = mergeProps({
|
|
332
|
+
className: cx('root'),
|
|
333
|
+
ref: elementRef,
|
|
334
|
+
style: props === null || props === void 0 ? void 0 : props.style
|
|
335
|
+
}, ptm('root'));
|
|
336
|
+
return /*#__PURE__*/React.createElement("div", rootElementProps, createInputElements(props.length));
|
|
337
|
+
}));
|
|
338
|
+
InputOtp.displayName = 'InputOtp';
|
|
339
|
+
|
|
340
|
+
export { InputOtp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t,{useRef as e,useContext as n,useState as r}from"react";import{PrimeReactContext as o,ariaLabel as l}from"primereact/api";import{ComponentBase as a,useHandleStyle as i}from"primereact/componentbase";import{useMergeProps as u}from"primereact/hooks";import{InputText as c}from"primereact/inputtext";import{ObjectUtils as p}from"primereact/utils";function s(){return s=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s.apply(this,arguments)}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function v(t){if(Array.isArray(t))return f(t)}function d(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function y(t,e){if(t){if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(t){return v(t)||d(t)||y(t)||m()}function g(t){if(Array.isArray(t))return t}function h(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=l.call(n)).done)&&(i.push(r.value),i.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function j(t,e){if("object"!==w(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function S(t){var e=j(t,"string");return"symbol"===w(e)?e:String(e)}var P=a.extend({defaultProps:{__TYPE:"InputOtp",__parentMetadata:null,className:null,modelValue:!1,invalid:!1,disabled:!1,readOnly:!1,variant:null,tabIndex:null,length:4,mask:!1,integerOnly:!1},css:{classes:{root:"p-inputotp p-component",input:"p-inputotp-input"}}});function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?D(Object(n),!0).forEach((function(e){var r,o,l;r=t,l=n[e],(o=S(o=e))in r?Object.defineProperty(r,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[o]=l})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var E=t.memo(t.forwardRef((function(a,f){var v,d,m=e(f),w=u(),j=n(o),S=P.getProps(a,j),D=P.setMetaData(A(A({props:S},S.__parentMetadata),{},{context:{disabled:S.disabled}})),E=D.ptm,x=D.cx;i(P.css.styles,D.isUnstyled,{name:"inputotp"});var N,k,I=S.value?null===(v=S.value)||void 0===v||null===(v=v.toString())||void 0===v||null===(d=v.split)||void 0===d?void 0:d.call(v,""):new Array(S.length),T=r(I),_=(k=2,g(N=T)||h(N,k)||y(N,k)||O()),M=_[0],U=_[1],C=function t(e){var n=e.nextElementSibling;if(n)return"INPUT"===n.nodeName?n:t(n)},B=function t(e){var n=e.previousElementSibling;if(n)return"INPUT"===n.nodeName?n:t(n)},F=function(t){var e=C(t.target);e&&(e.focus(),e.select())},L=function(t){var e=B(t.target);e&&(e.focus(),e.select())},R=function(t,e){var n;null==S||null===(n=S.onChange)||void 0===n||n.call(S,{originalEvent:t,value:e.join("")})},W=function(t,e){var n=t.target.value,r=b(M);r[e]=n,r=(r=r.join(""))?r.split(""):new Array(S.length),U(r),R(t,r)},J=function(t,e){W(t,e),"deleteContentBackward"===t.nativeEvent.inputType?L(t):"insertText"!==t.nativeEvent.inputType&&"deleteContentForward"!==t.nativeEvent.inputType||F(t)},K=function(t){var e=t.clipboardData.getData("text");if(e.length){var n=e.substring(0,S.length+1);if(!S.integerOnly||!isNaN(n)){var r=n.split("");U(r),R(t,r)}}},V=function(t){var e;t.target.select(),null==S||null===(e=S.focus)||void 0===e||e.call(S,t)},X=function(t){var e;null==S||null===(e=S.blur)||void 0===e||e.call(S,t)},Y=function(t){switch(t.code){case"ArrowLeft":L(t),t.preventDefault();break;case"ArrowRight":F(t),t.preventDefault();break;case"Backspace":var e;0===(null===(e=t.target)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.length)&&(L(t),t.preventDefault());break;case"ArrowUp":case"ArrowDown":t.preventDefault();break;default:(null!=S&&S.integerOnly&&!((t.code.startsWith("Digit")||t.code.startsWith("Numpad"))&&Number(t.key)>=0&&Number(t.key)<=9)||M.join("").length>=S.length&&"Delete"!==t.code)&&t.preventDefault()}},$=w({className:x("root"),ref:m,style:null==S?void 0:S.style},E("root"));return t.createElement("div",$,function e(n){if(n<=0)return[];var r=S.length-n,o={onInput:function(t){return J(t,r)},onKeyDown:Y,onFocus:V,onBlur:X,onPaste:K},a=w({id:r,key:r,value:M[r]||"",inputMode:null!=S&&S.integerOnly?"numeric":"text",type:null!=S&&S.mask?"password":"text",variant:null==S?void 0:S.variant,readOnly:null==S?void 0:S.readOnly,disabled:null==S?void 0:S.disabled,invalid:null==S?void 0:S.invalid,tabIndex:null==S?void 0:S.tabIndex,unstyled:null==S?void 0:S.unstyled,"aria-label":l("otpLabel",{0:r+1}),className:x("input")},E("input"));return[null!=S&&S.inputTemplate?p.getJSXElement(null==S?void 0:S.inputTemplate,{events:o,props:a}):t.createElement(c,s({},a,o))].concat(b(e(n-1)))}(S.length))})));E.displayName="InputOtp";export{E as InputOtp};
|