primereact 10.4.0 → 10.5.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/api/api.d.ts +2 -2
- package/autocomplete/autocomplete.cjs.js +2 -3
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +2 -3
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +2 -3
- package/autocomplete/autocomplete.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +4 -3
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +4 -3
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +4 -3
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +2 -3
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +2 -3
- package/button/button.esm.min.js +1 -1
- package/button/button.js +2 -3
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +12 -4
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +12 -4
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +12 -4
- package/calendar/calendar.min.js +1 -1
- package/checkbox/checkbox.cjs.js +4 -3
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +4 -3
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +4 -3
- package/checkbox/checkbox.min.js +1 -1
- package/chips/chips.cjs.js +111 -23
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +111 -23
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +111 -23
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +2 -3
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +2 -3
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +2 -3
- package/colorpicker/colorpicker.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +6 -2
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +6 -2
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +7 -3
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +4 -3
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +4 -3
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +4 -3
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +2459 -19563
- package/core/core.min.js +34 -34
- package/datatable/datatable.cjs.js +6 -5
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +10 -2
- package/datatable/datatable.esm.js +6 -5
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +6 -5
- package/datatable/datatable.min.js +1 -1
- package/dropdown/dropdown.cjs.js +329 -156
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +329 -156
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +329 -156
- package/dropdown/dropdown.min.js +1 -1
- package/icons/arrowdown/index.cjs.js +2 -642
- package/icons/arrowdown/index.cjs.min.js +1 -1
- package/icons/arrowdown/index.esm.js +2 -642
- package/icons/arrowdown/index.esm.min.js +1 -1
- package/icons/arrowdown/index.js +2 -642
- package/icons/arrowdown/index.min.js +1 -1
- package/icons/arrowup/index.cjs.js +2 -642
- package/icons/arrowup/index.cjs.min.js +1 -1
- package/icons/arrowup/index.esm.js +2 -642
- package/icons/arrowup/index.esm.min.js +1 -1
- package/icons/arrowup/index.js +2 -642
- package/icons/arrowup/index.min.js +1 -1
- package/icons/ban/index.cjs.js +2 -642
- package/icons/ban/index.cjs.min.js +1 -1
- package/icons/ban/index.esm.js +2 -642
- package/icons/ban/index.esm.min.js +1 -1
- package/icons/ban/index.js +2 -642
- package/icons/ban/index.min.js +1 -1
- package/icons/blank/index.cjs.js +62 -0
- package/icons/blank/index.cjs.min.js +1 -0
- package/icons/blank/index.d.ts +19 -0
- package/icons/blank/index.esm.js +38 -0
- package/icons/blank/index.esm.min.js +1 -0
- package/icons/blank/index.js +65 -0
- package/icons/blank/index.min.js +1 -0
- package/icons/blank/package.json +7 -0
- package/icons/download/index.cjs.js +2 -642
- package/icons/download/index.cjs.min.js +1 -1
- package/icons/download/index.esm.js +2 -642
- package/icons/download/index.esm.min.js +1 -1
- package/icons/download/index.js +2 -642
- package/icons/download/index.min.js +1 -1
- package/icons/exclamationtriangle/index.cjs.js +2 -642
- package/icons/exclamationtriangle/index.cjs.min.js +1 -1
- package/icons/exclamationtriangle/index.esm.js +2 -642
- package/icons/exclamationtriangle/index.esm.min.js +1 -1
- package/icons/exclamationtriangle/index.js +2 -642
- package/icons/exclamationtriangle/index.min.js +1 -1
- package/icons/eyeslash/index.cjs.js +2 -642
- package/icons/eyeslash/index.cjs.min.js +1 -1
- package/icons/eyeslash/index.esm.js +2 -642
- package/icons/eyeslash/index.esm.min.js +1 -1
- package/icons/eyeslash/index.js +2 -642
- package/icons/eyeslash/index.min.js +1 -1
- package/icons/filter/index.cjs.js +2 -642
- package/icons/filter/index.cjs.min.js +1 -1
- package/icons/filter/index.esm.js +2 -642
- package/icons/filter/index.esm.min.js +1 -1
- package/icons/filter/index.js +2 -642
- package/icons/filter/index.min.js +1 -1
- package/icons/filterslash/index.cjs.js +2 -642
- package/icons/filterslash/index.cjs.min.js +1 -1
- package/icons/filterslash/index.esm.js +2 -642
- package/icons/filterslash/index.esm.min.js +1 -1
- package/icons/filterslash/index.js +2 -642
- package/icons/filterslash/index.min.js +1 -1
- package/icons/infocircle/index.cjs.js +2 -642
- package/icons/infocircle/index.cjs.min.js +1 -1
- package/icons/infocircle/index.esm.js +2 -642
- package/icons/infocircle/index.esm.min.js +1 -1
- package/icons/infocircle/index.js +2 -642
- package/icons/infocircle/index.min.js +1 -1
- package/icons/pencil/index.cjs.js +2 -642
- package/icons/pencil/index.cjs.min.js +1 -1
- package/icons/pencil/index.esm.js +2 -642
- package/icons/pencil/index.esm.min.js +1 -1
- package/icons/pencil/index.js +2 -642
- package/icons/pencil/index.min.js +1 -1
- package/icons/plus/index.cjs.js +2 -642
- package/icons/plus/index.cjs.min.js +1 -1
- package/icons/plus/index.esm.js +2 -642
- package/icons/plus/index.esm.min.js +1 -1
- package/icons/plus/index.js +2 -642
- package/icons/plus/index.min.js +1 -1
- package/icons/refresh/index.cjs.js +2 -642
- package/icons/refresh/index.cjs.min.js +1 -1
- package/icons/refresh/index.esm.js +2 -642
- package/icons/refresh/index.esm.min.js +1 -1
- package/icons/refresh/index.js +2 -642
- package/icons/refresh/index.min.js +1 -1
- package/icons/search/index.cjs.js +2 -642
- package/icons/search/index.cjs.min.js +1 -1
- package/icons/search/index.esm.js +2 -642
- package/icons/search/index.esm.min.js +1 -1
- package/icons/search/index.js +2 -642
- package/icons/search/index.min.js +1 -1
- package/icons/searchminus/index.cjs.js +2 -642
- package/icons/searchminus/index.cjs.min.js +1 -1
- package/icons/searchminus/index.esm.js +2 -642
- package/icons/searchminus/index.esm.min.js +1 -1
- package/icons/searchminus/index.js +2 -642
- package/icons/searchminus/index.min.js +1 -1
- package/icons/searchplus/index.cjs.js +2 -642
- package/icons/searchplus/index.cjs.min.js +1 -1
- package/icons/searchplus/index.esm.js +2 -642
- package/icons/searchplus/index.esm.min.js +1 -1
- package/icons/searchplus/index.js +2 -642
- package/icons/searchplus/index.min.js +1 -1
- package/icons/sortalt/index.cjs.js +2 -642
- package/icons/sortalt/index.cjs.min.js +1 -1
- package/icons/sortalt/index.esm.js +2 -642
- package/icons/sortalt/index.esm.min.js +1 -1
- package/icons/sortalt/index.js +2 -642
- package/icons/sortalt/index.min.js +1 -1
- package/icons/sortamountdown/index.cjs.js +2 -642
- package/icons/sortamountdown/index.cjs.min.js +1 -1
- package/icons/sortamountdown/index.esm.js +2 -642
- package/icons/sortamountdown/index.esm.min.js +1 -1
- package/icons/sortamountdown/index.js +2 -642
- package/icons/sortamountdown/index.min.js +1 -1
- package/icons/sortamountupalt/index.cjs.js +2 -642
- package/icons/sortamountupalt/index.cjs.min.js +1 -1
- package/icons/sortamountupalt/index.esm.js +2 -642
- package/icons/sortamountupalt/index.esm.min.js +1 -1
- package/icons/sortamountupalt/index.js +2 -642
- package/icons/sortamountupalt/index.min.js +1 -1
- package/icons/spinner/index.cjs.js +2 -642
- package/icons/spinner/index.cjs.min.js +1 -1
- package/icons/spinner/index.esm.js +2 -642
- package/icons/spinner/index.esm.min.js +1 -1
- package/icons/spinner/index.js +2 -642
- package/icons/spinner/index.min.js +1 -1
- package/icons/star/index.cjs.js +2 -642
- package/icons/star/index.cjs.min.js +1 -1
- package/icons/star/index.esm.js +2 -642
- package/icons/star/index.esm.min.js +1 -1
- package/icons/star/index.js +2 -642
- package/icons/star/index.min.js +1 -1
- package/icons/starfill/index.cjs.js +2 -642
- package/icons/starfill/index.cjs.min.js +1 -1
- package/icons/starfill/index.esm.js +2 -642
- package/icons/starfill/index.esm.min.js +1 -1
- package/icons/starfill/index.js +2 -642
- package/icons/starfill/index.min.js +1 -1
- package/icons/thlarge/index.cjs.js +2 -642
- package/icons/thlarge/index.cjs.min.js +1 -1
- package/icons/thlarge/index.esm.js +2 -642
- package/icons/thlarge/index.esm.min.js +1 -1
- package/icons/thlarge/index.js +2 -642
- package/icons/thlarge/index.min.js +1 -1
- package/icons/timescircle/index.cjs.js +2 -642
- package/icons/timescircle/index.cjs.min.js +1 -1
- package/icons/timescircle/index.esm.js +2 -642
- package/icons/timescircle/index.esm.min.js +1 -1
- package/icons/timescircle/index.js +2 -642
- package/icons/timescircle/index.min.js +1 -1
- package/icons/trash/index.cjs.js +2 -642
- package/icons/trash/index.cjs.min.js +1 -1
- package/icons/trash/index.esm.js +2 -642
- package/icons/trash/index.esm.min.js +1 -1
- package/icons/trash/index.js +2 -642
- package/icons/trash/index.min.js +1 -1
- package/icons/undo/index.cjs.js +2 -642
- package/icons/undo/index.cjs.min.js +1 -1
- package/icons/undo/index.esm.js +2 -642
- package/icons/undo/index.esm.min.js +1 -1
- package/icons/undo/index.js +2 -642
- package/icons/undo/index.min.js +1 -1
- package/icons/upload/index.cjs.js +2 -642
- package/icons/upload/index.cjs.min.js +1 -1
- package/icons/upload/index.esm.js +2 -642
- package/icons/upload/index.esm.min.js +1 -1
- package/icons/upload/index.js +2 -642
- package/icons/upload/index.min.js +1 -1
- package/icons/windowmaximize/index.cjs.js +2 -642
- package/icons/windowmaximize/index.cjs.min.js +1 -1
- package/icons/windowmaximize/index.esm.js +2 -642
- package/icons/windowmaximize/index.esm.min.js +1 -1
- package/icons/windowmaximize/index.js +2 -642
- package/icons/windowmaximize/index.min.js +1 -1
- package/icons/windowminimize/index.cjs.js +2 -642
- package/icons/windowminimize/index.cjs.min.js +1 -1
- package/icons/windowminimize/index.esm.js +2 -642
- package/icons/windowminimize/index.esm.min.js +1 -1
- package/icons/windowminimize/index.js +2 -642
- package/icons/windowminimize/index.min.js +1 -1
- package/image/image.cjs.js +7 -566
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +9 -568
- package/image/image.esm.min.js +1 -1
- package/image/image.js +7 -566
- package/image/image.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +23 -20
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +23 -20
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +23 -20
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +5 -4
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +5 -4
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +5 -4
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +2 -3
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +2 -3
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +2 -3
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +2 -3
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.esm.js +2 -3
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +2 -3
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/knob/knob.cjs.js +62 -0
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +62 -0
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +62 -0
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +364 -95
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +365 -96
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +364 -95
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +3 -3
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +3 -3
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +3 -3
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +2 -3
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +2 -3
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +2 -3
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +4 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +4 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +5 -4
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +18 -14
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +18 -14
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +18 -14
- package/menubar/menubar.min.js +1 -1
- package/multiselect/multiselect.cjs.js +412 -116
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +412 -116
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +412 -116
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +2 -3
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +2 -3
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +2 -3
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +251 -251
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +258 -258
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +251 -251
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +8 -10
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +18 -0
- package/panelmenu/panelmenu.esm.js +8 -10
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +9 -12
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +14 -3
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +14 -3
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +14 -3
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +18 -6
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +18 -6
- package/password/password.esm.min.js +1 -1
- package/password/password.js +18 -6
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +1 -1
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +1 -1
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +1 -1
- package/picklist/picklist.min.js +1 -1
- package/primereact.all.cjs.js +1734 -1194
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1734 -1194
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1734 -1194
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +2 -3
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -3
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +2 -3
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +105 -7
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +105 -7
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +105 -7
- package/rating/rating.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +328 -67
- package/resources/themes/arya-green/theme.css +328 -67
- package/resources/themes/arya-orange/theme.css +328 -67
- package/resources/themes/arya-purple/theme.css +26 -6
- package/resources/themes/bootstrap4-dark-blue/theme.css +328 -67
- package/resources/themes/bootstrap4-dark-purple/theme.css +26 -6
- package/resources/themes/bootstrap4-light-blue/theme.css +328 -67
- package/resources/themes/bootstrap4-light-purple/theme.css +26 -6
- package/resources/themes/fluent-light/theme.css +327 -66
- package/resources/themes/lara-dark-amber/theme.css +328 -67
- package/resources/themes/lara-dark-blue/theme.css +328 -67
- package/resources/themes/lara-dark-cyan/theme.css +328 -67
- package/resources/themes/lara-dark-green/theme.css +328 -67
- package/resources/themes/lara-dark-indigo/theme.css +328 -67
- package/resources/themes/lara-dark-pink/theme.css +328 -67
- package/resources/themes/lara-dark-purple/theme.css +26 -6
- package/resources/themes/lara-dark-teal/theme.css +328 -67
- package/resources/themes/lara-light-amber/theme.css +328 -67
- package/resources/themes/lara-light-blue/theme.css +328 -67
- package/resources/themes/lara-light-cyan/theme.css +328 -67
- package/resources/themes/lara-light-green/theme.css +328 -67
- package/resources/themes/lara-light-indigo/theme.css +328 -67
- package/resources/themes/lara-light-pink/theme.css +328 -67
- package/resources/themes/lara-light-purple/theme.css +26 -6
- package/resources/themes/lara-light-teal/theme.css +328 -67
- package/resources/themes/luna-amber/theme.css +328 -67
- package/resources/themes/luna-blue/theme.css +328 -67
- package/resources/themes/luna-green/theme.css +328 -67
- package/resources/themes/luna-pink/theme.css +328 -67
- package/resources/themes/md-dark-deeppurple/theme.css +158 -138
- package/resources/themes/md-dark-indigo/theme.css +454 -193
- package/resources/themes/md-light-deeppurple/theme.css +26 -6
- package/resources/themes/md-light-indigo/theme.css +328 -67
- package/resources/themes/mdc-dark-deeppurple/theme.css +158 -138
- package/resources/themes/mdc-dark-indigo/theme.css +454 -193
- package/resources/themes/mdc-light-deeppurple/theme.css +26 -6
- package/resources/themes/mdc-light-indigo/theme.css +328 -67
- package/resources/themes/mira/theme.css +328 -67
- package/resources/themes/nano/theme.css +328 -67
- package/resources/themes/nova/theme.css +328 -67
- package/resources/themes/nova-accent/theme.css +328 -67
- package/resources/themes/nova-alt/theme.css +328 -67
- package/resources/themes/rhea/theme.css +328 -67
- package/resources/themes/saga-blue/theme.css +328 -67
- package/resources/themes/saga-green/theme.css +328 -67
- package/resources/themes/saga-orange/theme.css +328 -67
- package/resources/themes/saga-purple/theme.css +26 -6
- package/resources/themes/soho-dark/theme.css +353 -92
- package/resources/themes/soho-light/theme.css +328 -67
- package/resources/themes/tailwind-light/theme.css +329 -71
- package/resources/themes/vela-blue/theme.css +328 -67
- package/resources/themes/vela-green/theme.css +328 -67
- package/resources/themes/vela-orange/theme.css +328 -67
- package/resources/themes/vela-purple/theme.css +26 -6
- package/resources/themes/viva-dark/theme.css +328 -67
- package/resources/themes/viva-light/theme.css +328 -67
- package/selectbutton/selectbutton.cjs.js +98 -53
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +98 -53
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +98 -53
- package/selectbutton/selectbutton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +4 -3
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +4 -3
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +4 -3
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +25 -4
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +25 -4
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +25 -4
- package/slider/slider.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +9 -12
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +9 -12
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +9 -12
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +25 -29
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +25 -29
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +25 -29
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +4 -3
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +4 -3
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +4 -3
- package/steps/steps.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +4 -3
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +4 -3
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +4 -3
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +6 -5
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +39 -34
- package/tabview/tabview.esm.js +6 -5
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +6 -5
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +6 -8
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +6 -8
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +6 -8
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +17 -17
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +16 -16
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +17 -17
- package/togglebutton/togglebutton.min.js +1 -1
- package/tree/tree.cjs.js +32 -31
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +5 -0
- package/tree/tree.esm.js +32 -31
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +32 -31
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +3 -4
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +3 -4
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +3 -4
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +1 -1
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +1 -1
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +1 -1
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +6 -6
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +6 -6
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +6 -6
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/web-types.json +65 -1
|
@@ -77,6 +77,46 @@ function _toConsumableArray(arr) {
|
|
|
77
77
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
function _arrayWithHoles(arr) {
|
|
81
|
+
if (Array.isArray(arr)) return arr;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function _iterableToArrayLimit(r, l) {
|
|
85
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
86
|
+
if (null != t) {
|
|
87
|
+
var e,
|
|
88
|
+
n,
|
|
89
|
+
i,
|
|
90
|
+
u,
|
|
91
|
+
a = [],
|
|
92
|
+
f = !0,
|
|
93
|
+
o = !1;
|
|
94
|
+
try {
|
|
95
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
96
|
+
if (Object(t) !== t) return;
|
|
97
|
+
f = !1;
|
|
98
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
99
|
+
} catch (r) {
|
|
100
|
+
o = !0, n = r;
|
|
101
|
+
} finally {
|
|
102
|
+
try {
|
|
103
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
104
|
+
} finally {
|
|
105
|
+
if (o) throw n;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return a;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function _nonIterableRest() {
|
|
113
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function _slicedToArray(arr, i) {
|
|
117
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
118
|
+
}
|
|
119
|
+
|
|
80
120
|
var classes = {
|
|
81
121
|
root: function root(_ref) {
|
|
82
122
|
var props = _ref.props;
|
|
@@ -121,46 +161,6 @@ var SelectButtonBase = componentbase.ComponentBase.extend({
|
|
|
121
161
|
}
|
|
122
162
|
});
|
|
123
163
|
|
|
124
|
-
function _arrayWithHoles(arr) {
|
|
125
|
-
if (Array.isArray(arr)) return arr;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function _iterableToArrayLimit(r, l) {
|
|
129
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
130
|
-
if (null != t) {
|
|
131
|
-
var e,
|
|
132
|
-
n,
|
|
133
|
-
i,
|
|
134
|
-
u,
|
|
135
|
-
a = [],
|
|
136
|
-
f = !0,
|
|
137
|
-
o = !1;
|
|
138
|
-
try {
|
|
139
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
140
|
-
if (Object(t) !== t) return;
|
|
141
|
-
f = !1;
|
|
142
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
143
|
-
} catch (r) {
|
|
144
|
-
o = !0, n = r;
|
|
145
|
-
} finally {
|
|
146
|
-
try {
|
|
147
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
148
|
-
} finally {
|
|
149
|
-
if (o) throw n;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return a;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function _nonIterableRest() {
|
|
157
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function _slicedToArray(arr, i) {
|
|
161
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
162
|
-
}
|
|
163
|
-
|
|
164
164
|
var SelectButtonItem = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
165
165
|
var _React$useState = React__namespace.useState(false),
|
|
166
166
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -179,7 +179,8 @@ var SelectButtonItem = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
|
-
var
|
|
182
|
+
var _onClick = function onClick(event, index) {
|
|
183
|
+
props.setFocusedIndex(index);
|
|
183
184
|
if (props.onClick) {
|
|
184
185
|
props.onClick({
|
|
185
186
|
originalEvent: event,
|
|
@@ -193,13 +194,46 @@ var SelectButtonItem = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
193
194
|
var onBlur = function onBlur() {
|
|
194
195
|
setFocusedState(false);
|
|
195
196
|
};
|
|
196
|
-
var
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
var _onKeyDown = function onKeyDown(event, index) {
|
|
198
|
+
switch (event.code) {
|
|
199
|
+
case 'Space':
|
|
200
|
+
{
|
|
201
|
+
_onClick(event, index);
|
|
202
|
+
event.preventDefault();
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
case 'ArrowDown':
|
|
206
|
+
case 'ArrowRight':
|
|
207
|
+
{
|
|
208
|
+
changeTabIndexes(event, 'next');
|
|
209
|
+
event.preventDefault();
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
case 'ArrowUp':
|
|
213
|
+
case 'ArrowLeft':
|
|
214
|
+
{
|
|
215
|
+
changeTabIndexes(event, 'prev');
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
201
219
|
}
|
|
202
220
|
};
|
|
221
|
+
var changeTabIndexes = function changeTabIndexes(event, direction) {
|
|
222
|
+
var firstTabableChild, index;
|
|
223
|
+
for (var i = 0; i <= props.elementRef.current.children.length - 1; i++) {
|
|
224
|
+
if (props.elementRef.current.children[i].getAttribute('tabindex') === '0') firstTabableChild = {
|
|
225
|
+
elem: props.elementRef.current.children[i],
|
|
226
|
+
index: i
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (direction === 'prev') {
|
|
230
|
+
if (firstTabableChild.index === 0) index = props.elementRef.current.children.length - 1;else index = firstTabableChild.index - 1;
|
|
231
|
+
} else {
|
|
232
|
+
if (firstTabableChild.index === props.elementRef.current.children.length - 1) index = 0;else index = firstTabableChild.index + 1;
|
|
233
|
+
}
|
|
234
|
+
props.setFocusedIndex(index);
|
|
235
|
+
props.elementRef.current.children[index].focus();
|
|
236
|
+
};
|
|
203
237
|
var createContent = function createContent() {
|
|
204
238
|
var labelProps = mergeProps({
|
|
205
239
|
className: cx('label')
|
|
@@ -215,9 +249,14 @@ var SelectButtonItem = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
215
249
|
role: 'button',
|
|
216
250
|
'aria-label': props.label,
|
|
217
251
|
'aria-pressed': props.selected,
|
|
218
|
-
onClick: onClick
|
|
219
|
-
|
|
252
|
+
onClick: function onClick(event) {
|
|
253
|
+
return _onClick(event, props.index);
|
|
254
|
+
},
|
|
255
|
+
onKeyDown: function onKeyDown(event) {
|
|
256
|
+
return _onKeyDown(event, props.index);
|
|
257
|
+
},
|
|
220
258
|
tabIndex: props.tabIndex,
|
|
259
|
+
'aria-disabled': props.disabled,
|
|
221
260
|
onFocus: onFocus,
|
|
222
261
|
onBlur: onBlur
|
|
223
262
|
}, getPTOptions('button'));
|
|
@@ -229,6 +268,10 @@ var SelectButton = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__names
|
|
|
229
268
|
var mergeProps = hooks.useMergeProps();
|
|
230
269
|
var context = React__namespace.useContext(api.PrimeReactContext);
|
|
231
270
|
var props = SelectButtonBase.getProps(inProps, context);
|
|
271
|
+
var _React$useState = React__namespace.useState(0),
|
|
272
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
273
|
+
focusedIndex = _React$useState2[0],
|
|
274
|
+
setFocusedIndex = _React$useState2[1];
|
|
232
275
|
var elementRef = React__namespace.useRef(null);
|
|
233
276
|
var _SelectButtonBase$set = SelectButtonBase.setMetaData({
|
|
234
277
|
props: props
|
|
@@ -301,7 +344,7 @@ var SelectButton = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__names
|
|
|
301
344
|
return props.options.map(function (option, index) {
|
|
302
345
|
var isDisabled = props.disabled || isOptionDisabled(option);
|
|
303
346
|
var optionLabel = getOptionLabel(option);
|
|
304
|
-
var tabIndex =
|
|
347
|
+
var tabIndex = props.disabled || index !== focusedIndex ? '-1' : '0';
|
|
305
348
|
var selected = isSelected(option);
|
|
306
349
|
var key = optionLabel + '_' + index;
|
|
307
350
|
return /*#__PURE__*/React__namespace.createElement(SelectButtonItem, {
|
|
@@ -310,13 +353,16 @@ var SelectButton = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__names
|
|
|
310
353
|
label: optionLabel,
|
|
311
354
|
className: option.className,
|
|
312
355
|
option: option,
|
|
356
|
+
setFocusedIndex: setFocusedIndex,
|
|
313
357
|
onClick: onOptionClick,
|
|
314
358
|
template: props.itemTemplate,
|
|
315
359
|
selected: selected,
|
|
316
360
|
tabIndex: tabIndex,
|
|
361
|
+
index: index,
|
|
317
362
|
disabled: isDisabled,
|
|
318
363
|
ptm: ptm,
|
|
319
|
-
cx: cx
|
|
364
|
+
cx: cx,
|
|
365
|
+
elementRef: elementRef
|
|
320
366
|
});
|
|
321
367
|
});
|
|
322
368
|
}
|
|
@@ -344,10 +390,9 @@ var SelectButton = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__names
|
|
|
344
390
|
}, SelectButtonBase.getOtherProps(props), ptm('root'));
|
|
345
391
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("div", rootProps, items), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
|
|
346
392
|
target: elementRef,
|
|
347
|
-
content: props.tooltip
|
|
348
|
-
}, props.tooltipOptions, {
|
|
393
|
+
content: props.tooltip,
|
|
349
394
|
pt: ptm('tooltip')
|
|
350
|
-
})));
|
|
395
|
+
}, props.tooltipOptions)));
|
|
351
396
|
}));
|
|
352
397
|
SelectButton.displayName = 'SelectButton';
|
|
353
398
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/hooks"),r=require("primereact/tooltip"),l=require("primereact/utils"),o=require("primereact/componentbase"),a=require("primereact/ripple");function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=i(e);function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/hooks"),r=require("primereact/tooltip"),l=require("primereact/utils"),o=require("primereact/componentbase"),a=require("primereact/ripple");function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=i(e);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e){if(Array.isArray(e))return s(e)}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function f(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):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(e){return p(e)||d(e)||f(e)||m()}function v(e){if(Array.isArray(e))return e}function y(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,o,a,i=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(i.push(r.value),i.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw l}}return i}}function g(){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 h(e,t){return v(e)||y(e,t)||f(e,t)||g()}var x=o.ComponentBase.extend({defaultProps:{__TYPE:"SelectButton",id:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,tabIndex:null,multiple:!1,unselectable:!0,allowEmpty:!0,disabled:!1,style:null,className:null,dataKey:null,tooltip:null,tooltipOptions:null,itemTemplate:null,onChange:null,children:void 0},css:{classes:{root:function(e){return l.classNames("p-selectbutton p-buttonset p-component",e.props.className)},button:function(e){var t=e.itemProps;return l.classNames("p-button p-component",{"p-highlight":t.selected,"p-disabled":t.disabled,"p-focus":e.focusedState})},label:"p-button-label p-c"}}}),O=u.memo((function(e){var t,r=h(u.useState(!1),2),o=r[0],i=r[1],c=n.useMergeProps(),s=e.ptm,p=e.cx,d=function(t){return s(t,{hostName:e.hostName,context:{selected:e.selected,disabled:e.disabled,option:e.option}})},f=function(t,n){e.setFocusedIndex(n),e.onClick&&e.onClick({originalEvent:t,option:e.option})},m=function(e,t){switch(e.code){case"Space":f(e,t),e.preventDefault();break;case"ArrowDown":case"ArrowRight":b(e,"next"),e.preventDefault();break;case"ArrowUp":case"ArrowLeft":b(e,"prev"),e.preventDefault()}},b=function(t,n){for(var r,l,o=0;o<=e.elementRef.current.children.length-1;o++)"0"===e.elementRef.current.children[o].getAttribute("tabindex")&&(r={elem:e.elementRef.current.children[o],index:o});e.setFocusedIndex(l="prev"===n?0===r.index?e.elementRef.current.children.length-1:r.index-1:r.index===e.elementRef.current.children.length-1?0:r.index+1),e.elementRef.current.children[l].focus()},v=(t=c({className:p("label")},d("label")),e.template?l.ObjectUtils.getJSXElement(e.template,e.option):u.createElement("span",t,e.label)),y=c({className:l.classNames(e.className,p("button",{itemProps:e,focusedState:o})),role:"button","aria-label":e.label,"aria-pressed":e.selected,onClick:function(t){return f(t,e.index)},onKeyDown:function(t){return m(t,e.index)},tabIndex:e.tabIndex,"aria-disabled":e.disabled,onFocus:function(){i(!0)},onBlur:function(){i(!1)}},d("button"));return u.createElement("div",y,v,!e.disabled&&u.createElement(a.Ripple,null))}));O.displayName="SelectButtonItem";var j=u.memo(u.forwardRef((function(e,o){var a=n.useMergeProps(),i=u.useContext(t.PrimeReactContext),s=x.getProps(e,i),p=h(u.useState(0),2),d=p[0],f=p[1],m=u.useRef(null),v=x.setMetaData({props:s}),y=v.ptm,g=v.cx,j=function(e){if(!s.disabled&&!w(e.option)){var t=D(e.option);if(!t||s.unselectable&&s.allowEmpty){var n,r=S(e.option);if(s.multiple){var o=s.value?b(s.value):[];n=t?o.filter((function(e){return!l.ObjectUtils.equals(e,r,s.dataKey)})):[].concat(b(o),[r])}else n=t?null:r;s.onChange&&s.onChange({originalEvent:e.originalEvent,value:n,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:s.name,id:s.id,value:n}})}}},E=function(e){return s.optionLabel?l.ObjectUtils.resolveFieldData(e,s.optionLabel):e&&void 0!==e.label?e.label:e},S=function(e){return s.optionValue?l.ObjectUtils.resolveFieldData(e,s.optionValue):e&&void 0!==e.value?e.value:e},w=function(e){return s.optionDisabled?l.ObjectUtils.isFunction(s.optionDisabled)?s.optionDisabled(e):l.ObjectUtils.resolveFieldData(e,s.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled},D=function(e){var t=S(e);return s.multiple?!(!s.value||!s.value.length)&&s.value.some((function(e){return l.ObjectUtils.equals(e,t,s.dataKey)})):l.ObjectUtils.equals(s.value,t,s.dataKey)};u.useImperativeHandle(o,(function(){return{props:s,focus:function(){return l.DomHandler.focusFirstElement(m.current)},getElement:function(){return m.current}}}));var N=l.ObjectUtils.isNotEmpty(s.tooltip),P=s.options&&s.options.length?s.options.map((function(e,t){var n=s.disabled||w(e),r=E(e),l=s.disabled||t!==d?"-1":"0",o=D(e);return u.createElement(O,{hostName:"SelectButton",key:r+"_"+t,label:r,className:e.className,option:e,setFocusedIndex:f,onClick:j,template:s.itemTemplate,selected:o,tabIndex:l,index:t,disabled:n,ptm:y,cx:g,elementRef:m})})):null,A=a({ref:m,id:s.id,className:g("root"),style:s.style,role:"group"},x.getOtherProps(s),y("root"));return u.createElement(u.Fragment,null,u.createElement("div",A,P),N&&u.createElement(r.Tooltip,c({target:m,content:s.tooltip,pt:y("tooltip")},s.tooltipOptions)))})));j.displayName="SelectButton",exports.SelectButton=j;
|
|
@@ -53,6 +53,46 @@ function _toConsumableArray(arr) {
|
|
|
53
53
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
function _arrayWithHoles(arr) {
|
|
57
|
+
if (Array.isArray(arr)) return arr;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function _iterableToArrayLimit(r, l) {
|
|
61
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
62
|
+
if (null != t) {
|
|
63
|
+
var e,
|
|
64
|
+
n,
|
|
65
|
+
i,
|
|
66
|
+
u,
|
|
67
|
+
a = [],
|
|
68
|
+
f = !0,
|
|
69
|
+
o = !1;
|
|
70
|
+
try {
|
|
71
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
72
|
+
if (Object(t) !== t) return;
|
|
73
|
+
f = !1;
|
|
74
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
75
|
+
} catch (r) {
|
|
76
|
+
o = !0, n = r;
|
|
77
|
+
} finally {
|
|
78
|
+
try {
|
|
79
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
80
|
+
} finally {
|
|
81
|
+
if (o) throw n;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return a;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _nonIterableRest() {
|
|
89
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function _slicedToArray(arr, i) {
|
|
93
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
94
|
+
}
|
|
95
|
+
|
|
56
96
|
var classes = {
|
|
57
97
|
root: function root(_ref) {
|
|
58
98
|
var props = _ref.props;
|
|
@@ -97,46 +137,6 @@ var SelectButtonBase = ComponentBase.extend({
|
|
|
97
137
|
}
|
|
98
138
|
});
|
|
99
139
|
|
|
100
|
-
function _arrayWithHoles(arr) {
|
|
101
|
-
if (Array.isArray(arr)) return arr;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _iterableToArrayLimit(r, l) {
|
|
105
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
106
|
-
if (null != t) {
|
|
107
|
-
var e,
|
|
108
|
-
n,
|
|
109
|
-
i,
|
|
110
|
-
u,
|
|
111
|
-
a = [],
|
|
112
|
-
f = !0,
|
|
113
|
-
o = !1;
|
|
114
|
-
try {
|
|
115
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
116
|
-
if (Object(t) !== t) return;
|
|
117
|
-
f = !1;
|
|
118
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
119
|
-
} catch (r) {
|
|
120
|
-
o = !0, n = r;
|
|
121
|
-
} finally {
|
|
122
|
-
try {
|
|
123
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
124
|
-
} finally {
|
|
125
|
-
if (o) throw n;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return a;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function _nonIterableRest() {
|
|
133
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function _slicedToArray(arr, i) {
|
|
137
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
138
|
-
}
|
|
139
|
-
|
|
140
140
|
var SelectButtonItem = /*#__PURE__*/React.memo(function (props) {
|
|
141
141
|
var _React$useState = React.useState(false),
|
|
142
142
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -155,7 +155,8 @@ var SelectButtonItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
};
|
|
158
|
-
var
|
|
158
|
+
var _onClick = function onClick(event, index) {
|
|
159
|
+
props.setFocusedIndex(index);
|
|
159
160
|
if (props.onClick) {
|
|
160
161
|
props.onClick({
|
|
161
162
|
originalEvent: event,
|
|
@@ -169,13 +170,46 @@ var SelectButtonItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
169
170
|
var onBlur = function onBlur() {
|
|
170
171
|
setFocusedState(false);
|
|
171
172
|
};
|
|
172
|
-
var
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
var _onKeyDown = function onKeyDown(event, index) {
|
|
174
|
+
switch (event.code) {
|
|
175
|
+
case 'Space':
|
|
176
|
+
{
|
|
177
|
+
_onClick(event, index);
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
case 'ArrowDown':
|
|
182
|
+
case 'ArrowRight':
|
|
183
|
+
{
|
|
184
|
+
changeTabIndexes(event, 'next');
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
case 'ArrowUp':
|
|
189
|
+
case 'ArrowLeft':
|
|
190
|
+
{
|
|
191
|
+
changeTabIndexes(event, 'prev');
|
|
192
|
+
event.preventDefault();
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
177
195
|
}
|
|
178
196
|
};
|
|
197
|
+
var changeTabIndexes = function changeTabIndexes(event, direction) {
|
|
198
|
+
var firstTabableChild, index;
|
|
199
|
+
for (var i = 0; i <= props.elementRef.current.children.length - 1; i++) {
|
|
200
|
+
if (props.elementRef.current.children[i].getAttribute('tabindex') === '0') firstTabableChild = {
|
|
201
|
+
elem: props.elementRef.current.children[i],
|
|
202
|
+
index: i
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
if (direction === 'prev') {
|
|
206
|
+
if (firstTabableChild.index === 0) index = props.elementRef.current.children.length - 1;else index = firstTabableChild.index - 1;
|
|
207
|
+
} else {
|
|
208
|
+
if (firstTabableChild.index === props.elementRef.current.children.length - 1) index = 0;else index = firstTabableChild.index + 1;
|
|
209
|
+
}
|
|
210
|
+
props.setFocusedIndex(index);
|
|
211
|
+
props.elementRef.current.children[index].focus();
|
|
212
|
+
};
|
|
179
213
|
var createContent = function createContent() {
|
|
180
214
|
var labelProps = mergeProps({
|
|
181
215
|
className: cx('label')
|
|
@@ -191,9 +225,14 @@ var SelectButtonItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
191
225
|
role: 'button',
|
|
192
226
|
'aria-label': props.label,
|
|
193
227
|
'aria-pressed': props.selected,
|
|
194
|
-
onClick: onClick
|
|
195
|
-
|
|
228
|
+
onClick: function onClick(event) {
|
|
229
|
+
return _onClick(event, props.index);
|
|
230
|
+
},
|
|
231
|
+
onKeyDown: function onKeyDown(event) {
|
|
232
|
+
return _onKeyDown(event, props.index);
|
|
233
|
+
},
|
|
196
234
|
tabIndex: props.tabIndex,
|
|
235
|
+
'aria-disabled': props.disabled,
|
|
197
236
|
onFocus: onFocus,
|
|
198
237
|
onBlur: onBlur
|
|
199
238
|
}, getPTOptions('button'));
|
|
@@ -205,6 +244,10 @@ var SelectButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
205
244
|
var mergeProps = useMergeProps();
|
|
206
245
|
var context = React.useContext(PrimeReactContext);
|
|
207
246
|
var props = SelectButtonBase.getProps(inProps, context);
|
|
247
|
+
var _React$useState = React.useState(0),
|
|
248
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
249
|
+
focusedIndex = _React$useState2[0],
|
|
250
|
+
setFocusedIndex = _React$useState2[1];
|
|
208
251
|
var elementRef = React.useRef(null);
|
|
209
252
|
var _SelectButtonBase$set = SelectButtonBase.setMetaData({
|
|
210
253
|
props: props
|
|
@@ -277,7 +320,7 @@ var SelectButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
277
320
|
return props.options.map(function (option, index) {
|
|
278
321
|
var isDisabled = props.disabled || isOptionDisabled(option);
|
|
279
322
|
var optionLabel = getOptionLabel(option);
|
|
280
|
-
var tabIndex =
|
|
323
|
+
var tabIndex = props.disabled || index !== focusedIndex ? '-1' : '0';
|
|
281
324
|
var selected = isSelected(option);
|
|
282
325
|
var key = optionLabel + '_' + index;
|
|
283
326
|
return /*#__PURE__*/React.createElement(SelectButtonItem, {
|
|
@@ -286,13 +329,16 @@ var SelectButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
286
329
|
label: optionLabel,
|
|
287
330
|
className: option.className,
|
|
288
331
|
option: option,
|
|
332
|
+
setFocusedIndex: setFocusedIndex,
|
|
289
333
|
onClick: onOptionClick,
|
|
290
334
|
template: props.itemTemplate,
|
|
291
335
|
selected: selected,
|
|
292
336
|
tabIndex: tabIndex,
|
|
337
|
+
index: index,
|
|
293
338
|
disabled: isDisabled,
|
|
294
339
|
ptm: ptm,
|
|
295
|
-
cx: cx
|
|
340
|
+
cx: cx,
|
|
341
|
+
elementRef: elementRef
|
|
296
342
|
});
|
|
297
343
|
});
|
|
298
344
|
}
|
|
@@ -320,10 +366,9 @@ var SelectButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
320
366
|
}, SelectButtonBase.getOtherProps(props), ptm('root'));
|
|
321
367
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", rootProps, items), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
322
368
|
target: elementRef,
|
|
323
|
-
content: props.tooltip
|
|
324
|
-
}, props.tooltipOptions, {
|
|
369
|
+
content: props.tooltip,
|
|
325
370
|
pt: ptm('tooltip')
|
|
326
|
-
})));
|
|
371
|
+
}, props.tooltipOptions)));
|
|
327
372
|
}));
|
|
328
373
|
SelectButton.displayName = 'SelectButton';
|
|
329
374
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{useMergeProps as n}from"primereact/hooks";import{Tooltip as
|
|
1
|
+
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{useMergeProps as n}from"primereact/hooks";import{Tooltip as r}from"primereact/tooltip";import{classNames as o,ObjectUtils as l,DomHandler as a}from"primereact/utils";import{ComponentBase as i}from"primereact/componentbase";import{Ripple as u}from"primereact/ripple";function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e){if(Array.isArray(e))return s(e)}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function f(){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(e){return p(e)||d(e)||m(e)||f()}function v(e){if(Array.isArray(e))return e}function y(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=l.call(n)).done)&&(i.push(r.value),i.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}}function h(){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 g(e,t){return v(e)||y(e,t)||m(e,t)||h()}var x=i.extend({defaultProps:{__TYPE:"SelectButton",id:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,tabIndex:null,multiple:!1,unselectable:!0,allowEmpty:!0,disabled:!1,style:null,className:null,dataKey:null,tooltip:null,tooltipOptions:null,itemTemplate:null,onChange:null,children:void 0},css:{classes:{root:function(e){return o("p-selectbutton p-buttonset p-component",e.props.className)},button:function(e){var t=e.itemProps;return o("p-button p-component",{"p-highlight":t.selected,"p-disabled":t.disabled,"p-focus":e.focusedState})},label:"p-button-label p-c"}}}),E=e.memo((function(t){var r,a=g(e.useState(!1),2),i=a[0],c=a[1],s=n(),p=t.ptm,d=t.cx,m=function(e){return p(e,{hostName:t.hostName,context:{selected:t.selected,disabled:t.disabled,option:t.option}})},f=function(e,n){t.setFocusedIndex(n),t.onClick&&t.onClick({originalEvent:e,option:t.option})},b=function(e,t){switch(e.code){case"Space":f(e,t),e.preventDefault();break;case"ArrowDown":case"ArrowRight":v(e,"next"),e.preventDefault();break;case"ArrowUp":case"ArrowLeft":v(e,"prev"),e.preventDefault()}},v=function(e,n){for(var r,o,l=0;l<=t.elementRef.current.children.length-1;l++)"0"===t.elementRef.current.children[l].getAttribute("tabindex")&&(r={elem:t.elementRef.current.children[l],index:l});t.setFocusedIndex(o="prev"===n?0===r.index?t.elementRef.current.children.length-1:r.index-1:r.index===t.elementRef.current.children.length-1?0:r.index+1),t.elementRef.current.children[o].focus()},y=(r=s({className:d("label")},m("label")),t.template?l.getJSXElement(t.template,t.option):e.createElement("span",r,t.label)),h=s({className:o(t.className,d("button",{itemProps:t,focusedState:i})),role:"button","aria-label":t.label,"aria-pressed":t.selected,onClick:function(e){return f(e,t.index)},onKeyDown:function(e){return b(e,t.index)},tabIndex:t.tabIndex,"aria-disabled":t.disabled,onFocus:function(){c(!0)},onBlur:function(){c(!1)}},m("button"));return e.createElement("div",h,y,!t.disabled&&e.createElement(u,null))}));E.displayName="SelectButtonItem";var S=e.memo(e.forwardRef((function(o,i){var u=n(),s=e.useContext(t),p=x.getProps(o,s),d=g(e.useState(0),2),m=d[0],f=d[1],v=e.useRef(null),y=x.setMetaData({props:p}),h=y.ptm,S=y.cx,w=function(e){if(!p.disabled&&!I(e.option)){var t=N(e.option);if(!t||p.unselectable&&p.allowEmpty){var n,r=A(e.option);if(p.multiple){var o=p.value?b(p.value):[];n=t?o.filter((function(e){return!l.equals(e,r,p.dataKey)})):[].concat(b(o),[r])}else n=t?null:r;p.onChange&&p.onChange({originalEvent:e.originalEvent,value:n,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:p.name,id:p.id,value:n}})}}},D=function(e){return p.optionLabel?l.resolveFieldData(e,p.optionLabel):e&&void 0!==e.label?e.label:e},A=function(e){return p.optionValue?l.resolveFieldData(e,p.optionValue):e&&void 0!==e.value?e.value:e},I=function(e){return p.optionDisabled?l.isFunction(p.optionDisabled)?p.optionDisabled(e):l.resolveFieldData(e,p.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled},N=function(e){var t=A(e);return p.multiple?!(!p.value||!p.value.length)&&p.value.some((function(e){return l.equals(e,t,p.dataKey)})):l.equals(p.value,t,p.dataKey)};e.useImperativeHandle(i,(function(){return{props:p,focus:function(){return a.focusFirstElement(v.current)},getElement:function(){return v.current}}}));var O=l.isNotEmpty(p.tooltip),F=p.options&&p.options.length?p.options.map((function(t,n){var r=p.disabled||I(t),o=D(t),l=p.disabled||n!==m?"-1":"0",a=N(t);return e.createElement(E,{hostName:"SelectButton",key:o+"_"+n,label:o,className:t.className,option:t,setFocusedIndex:f,onClick:w,template:p.itemTemplate,selected:a,tabIndex:l,index:n,disabled:r,ptm:h,cx:S,elementRef:v})})):null,R=u({ref:v,id:p.id,className:S("root"),style:p.style,role:"group"},x.getOtherProps(p),h("root"));return e.createElement(e.Fragment,null,e.createElement("div",R,F),O&&e.createElement(r,c({target:v,content:p.tooltip,pt:h("tooltip")},p.tooltipOptions)))})));S.displayName="SelectButton";export{S as SelectButton};
|