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
|
@@ -226,10 +226,9 @@ this.primereact.inputtextarea = (function (exports, React, api, componentbase, h
|
|
|
226
226
|
}, InputTextareaBase.getOtherProps(props), ptm('root'));
|
|
227
227
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("textarea", rootProps), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
|
|
228
228
|
target: elementRef,
|
|
229
|
-
content: props.tooltip
|
|
230
|
-
}, props.tooltipOptions, {
|
|
229
|
+
content: props.tooltip,
|
|
231
230
|
pt: ptm('tooltip')
|
|
232
|
-
})));
|
|
231
|
+
}, props.tooltipOptions)));
|
|
233
232
|
}));
|
|
234
233
|
InputTextarea.displayName = 'InputTextarea';
|
|
235
234
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.inputtextarea=function(e,t,r,n,o,i,l,a){"use strict";function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=u(t);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(e,t){if("object"!==p(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function y(e){var t=f(e,"string");return"symbol"===p(t)?t:String(t)}var m=n.ComponentBase.extend({defaultProps:{__TYPE:"InputTextarea",__parentMetadata:null,autoResize:!1,keyfilter:null,onBlur:null,onFocus:null,onBeforeInput:null,onInput:null,onKeyDown:null,onKeyUp:null,onPaste:null,tooltip:null,tooltipOptions:null,validateOnly:!1,children:void 0},css:{classes:{root:function(e){var t=e.props;return a.classNames("p-inputtextarea p-inputtext p-component",{"p-disabled":t.disabled,"p-filled":e.isFilled,"p-inputtextarea-resizable":t.autoResize},t.className)}},styles:"\n@layer primereact {\n .p-inputtextarea-resizable {\n overflow: hidden;\n resize: none;\n }\n \n .p-fluid .p-inputtextarea {\n width: 100%;\n }\n}\n"}});function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){var n,o,i;n=e,i=r[t],(o=y(o=t))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=s.memo(s.forwardRef((function(e,t){var u=o.useMergeProps(),p=s.useContext(r.PrimeReactContext),f=m.getProps(e,p),y=s.useRef(t),b=s.useRef(0),v=m.setMetaData(d(d({props:f},f.__parentMetadata),{},{context:{disabled:f.disabled}})),O=v.ptm,g=v.cx;n.useHandleStyle(m.css.styles,v.isUnstyled,{name:"inputtextarea"});var h=function(e){var t=y.current;t&&a.DomHandler.isVisible(t)&&(b.current||(b.current=t.scrollHeight,t.style.overflow="hidden"),(b.current!==t.scrollHeight||e)&&(t.style.height="",t.style.height=t.scrollHeight+"px",parseFloat(t.style.height)>=parseFloat(t.style.maxHeight)?(t.style.overflowY="scroll",t.style.height=t.style.maxHeight):t.style.overflow="hidden",b.current=t.scrollHeight))};s.useEffect((function(){a.ObjectUtils.combinedRefs(y,t)}),[y,t]),s.useEffect((function(){f.autoResize&&h(!0)}),[f.autoResize]);var j=s.useMemo((function(){return a.ObjectUtils.isNotEmpty(f.value)||a.ObjectUtils.isNotEmpty(f.defaultValue)}),[f.value,f.defaultValue]),P=a.ObjectUtils.isNotEmpty(f.tooltip),w=u({ref:y,className:g("root",{isFilled:j}),onFocus:function(e){f.autoResize&&h(),f.onFocus&&f.onFocus(e)},onBlur:function(e){f.autoResize&&h(),f.onBlur&&f.onBlur(e)},onKeyUp:function(e){f.autoResize&&h(),f.onKeyUp&&f.onKeyUp(e)},onKeyDown:function(e){f.onKeyDown&&f.onKeyDown(e),f.keyfilter&&i.KeyFilter.onKeyPress(e,f.keyfilter,f.validateOnly)},onBeforeInput:function(e){f.onBeforeInput&&f.onBeforeInput(e),f.keyfilter&&i.KeyFilter.onBeforeInput(e,f.keyfilter,f.validateOnly)},onInput:function(e){var t=e.target;f.autoResize&&h(a.ObjectUtils.isEmpty(t.value)),f.onInput&&f.onInput(e),a.ObjectUtils.isNotEmpty(t.value)?a.DomHandler.addClass(t,"p-filled"):a.DomHandler.removeClass(t,"p-filled")},onPaste:function(e){f.onPaste&&f.onPaste(e),f.keyfilter&&i.KeyFilter.onPaste(e,f.keyfilter,f.validateOnly)}},m.getOtherProps(f),O("root"));return s.createElement(s.Fragment,null,s.createElement("textarea",w),P&&s.createElement(l.Tooltip,c({target:y,content:f.tooltip
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.inputtextarea=function(e,t,r,n,o,i,l,a){"use strict";function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=u(t);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(e,t){if("object"!==p(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function y(e){var t=f(e,"string");return"symbol"===p(t)?t:String(t)}var m=n.ComponentBase.extend({defaultProps:{__TYPE:"InputTextarea",__parentMetadata:null,autoResize:!1,keyfilter:null,onBlur:null,onFocus:null,onBeforeInput:null,onInput:null,onKeyDown:null,onKeyUp:null,onPaste:null,tooltip:null,tooltipOptions:null,validateOnly:!1,children:void 0},css:{classes:{root:function(e){var t=e.props;return a.classNames("p-inputtextarea p-inputtext p-component",{"p-disabled":t.disabled,"p-filled":e.isFilled,"p-inputtextarea-resizable":t.autoResize},t.className)}},styles:"\n@layer primereact {\n .p-inputtextarea-resizable {\n overflow: hidden;\n resize: none;\n }\n \n .p-fluid .p-inputtextarea {\n width: 100%;\n }\n}\n"}});function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){var n,o,i;n=e,i=r[t],(o=y(o=t))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=s.memo(s.forwardRef((function(e,t){var u=o.useMergeProps(),p=s.useContext(r.PrimeReactContext),f=m.getProps(e,p),y=s.useRef(t),b=s.useRef(0),v=m.setMetaData(d(d({props:f},f.__parentMetadata),{},{context:{disabled:f.disabled}})),O=v.ptm,g=v.cx;n.useHandleStyle(m.css.styles,v.isUnstyled,{name:"inputtextarea"});var h=function(e){var t=y.current;t&&a.DomHandler.isVisible(t)&&(b.current||(b.current=t.scrollHeight,t.style.overflow="hidden"),(b.current!==t.scrollHeight||e)&&(t.style.height="",t.style.height=t.scrollHeight+"px",parseFloat(t.style.height)>=parseFloat(t.style.maxHeight)?(t.style.overflowY="scroll",t.style.height=t.style.maxHeight):t.style.overflow="hidden",b.current=t.scrollHeight))};s.useEffect((function(){a.ObjectUtils.combinedRefs(y,t)}),[y,t]),s.useEffect((function(){f.autoResize&&h(!0)}),[f.autoResize]);var j=s.useMemo((function(){return a.ObjectUtils.isNotEmpty(f.value)||a.ObjectUtils.isNotEmpty(f.defaultValue)}),[f.value,f.defaultValue]),P=a.ObjectUtils.isNotEmpty(f.tooltip),w=u({ref:y,className:g("root",{isFilled:j}),onFocus:function(e){f.autoResize&&h(),f.onFocus&&f.onFocus(e)},onBlur:function(e){f.autoResize&&h(),f.onBlur&&f.onBlur(e)},onKeyUp:function(e){f.autoResize&&h(),f.onKeyUp&&f.onKeyUp(e)},onKeyDown:function(e){f.onKeyDown&&f.onKeyDown(e),f.keyfilter&&i.KeyFilter.onKeyPress(e,f.keyfilter,f.validateOnly)},onBeforeInput:function(e){f.onBeforeInput&&f.onBeforeInput(e),f.keyfilter&&i.KeyFilter.onBeforeInput(e,f.keyfilter,f.validateOnly)},onInput:function(e){var t=e.target;f.autoResize&&h(a.ObjectUtils.isEmpty(t.value)),f.onInput&&f.onInput(e),a.ObjectUtils.isNotEmpty(t.value)?a.DomHandler.addClass(t,"p-filled"):a.DomHandler.removeClass(t,"p-filled")},onPaste:function(e){f.onPaste&&f.onPaste(e),f.keyfilter&&i.KeyFilter.onPaste(e,f.keyfilter,f.validateOnly)}},m.getOtherProps(f),O("root"));return s.createElement(s.Fragment,null,s.createElement("textarea",w),P&&s.createElement(l.Tooltip,c({target:y,content:f.tooltip,pt:O("tooltip")},f.tooltipOptions)))})));return v.displayName="InputTextarea",e.InputTextarea=v,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.hooks,primereact.keyfilter,primereact.tooltip,primereact.utils);
|
package/knob/knob.cjs.js
CHANGED
|
@@ -95,6 +95,7 @@ var KnobBase = componentbase.ComponentBase.extend({
|
|
|
95
95
|
disabled: false,
|
|
96
96
|
readOnly: false,
|
|
97
97
|
showValue: true,
|
|
98
|
+
tabIndex: 0,
|
|
98
99
|
step: 1,
|
|
99
100
|
min: 0,
|
|
100
101
|
max: 100,
|
|
@@ -258,6 +259,15 @@ var Knob = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
258
259
|
});
|
|
259
260
|
}
|
|
260
261
|
};
|
|
262
|
+
var updateModelValue = function updateModelValue(newValue) {
|
|
263
|
+
var currentValue;
|
|
264
|
+
if (newValue > props.max) currentValue = props.max;else if (newValue < props.min) currentValue = props.min;else currentValue = newValue;
|
|
265
|
+
if (props.onChange) {
|
|
266
|
+
props.onChange({
|
|
267
|
+
value: currentValue
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
};
|
|
261
271
|
var _onClick = function onClick(event) {
|
|
262
272
|
if (!props.disabled && !props.readOnly) {
|
|
263
273
|
updateValue(event.nativeEvent.offsetX, event.nativeEvent.offsetY);
|
|
@@ -280,6 +290,48 @@ var Knob = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
280
290
|
unbindWindowTouchMoveListener();
|
|
281
291
|
unbindWindowTouchEndListener();
|
|
282
292
|
};
|
|
293
|
+
var _onKeyDown = function onKeyDown(event) {
|
|
294
|
+
if (!props.disabled && !props.readonly) {
|
|
295
|
+
switch (event.code) {
|
|
296
|
+
case 'ArrowRight':
|
|
297
|
+
case 'ArrowUp':
|
|
298
|
+
event.preventDefault();
|
|
299
|
+
updateModelValue(props.value + 1);
|
|
300
|
+
break;
|
|
301
|
+
case 'ArrowLeft':
|
|
302
|
+
case 'ArrowDown':
|
|
303
|
+
{
|
|
304
|
+
event.preventDefault();
|
|
305
|
+
updateModelValue(props.value - 1);
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
case 'Home':
|
|
309
|
+
{
|
|
310
|
+
event.preventDefault();
|
|
311
|
+
updateModelValue(props.min);
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
case 'End':
|
|
315
|
+
{
|
|
316
|
+
event.preventDefault();
|
|
317
|
+
updateModelValue(props.max);
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
case 'PageUp':
|
|
321
|
+
{
|
|
322
|
+
event.preventDefault();
|
|
323
|
+
updateModelValue(props.value + 10);
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
case 'PageDown':
|
|
327
|
+
{
|
|
328
|
+
event.preventDefault();
|
|
329
|
+
updateModelValue(props.value - 10);
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
};
|
|
283
335
|
React__namespace.useImperativeHandle(ref, function () {
|
|
284
336
|
return {
|
|
285
337
|
props: props,
|
|
@@ -307,6 +359,13 @@ var Knob = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
307
359
|
viewBox: '0 0 100 100',
|
|
308
360
|
width: props.size,
|
|
309
361
|
height: props.size,
|
|
362
|
+
'aria-valuemin': props.min,
|
|
363
|
+
'aria-valuemax': props.max,
|
|
364
|
+
'aria-valuenow': props.value,
|
|
365
|
+
'aria-labelledby': props.ariaLabelledby,
|
|
366
|
+
'aria-label': props.ariaLabel,
|
|
367
|
+
role: 'slider',
|
|
368
|
+
tabIndex: props.readonly || props.disabled ? -1 : props.tabIndex,
|
|
310
369
|
onClick: function onClick(e) {
|
|
311
370
|
return _onClick(e);
|
|
312
371
|
},
|
|
@@ -321,6 +380,9 @@ var Knob = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.for
|
|
|
321
380
|
},
|
|
322
381
|
onTouchEnd: function onTouchEnd(e) {
|
|
323
382
|
return _onTouchEnd();
|
|
383
|
+
},
|
|
384
|
+
onKeyDown: function onKeyDown(e) {
|
|
385
|
+
return _onKeyDown(e);
|
|
324
386
|
}
|
|
325
387
|
}, ptm('svg'));
|
|
326
388
|
var rangeProps = mergeProps({
|
package/knob/knob.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/componentbase"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/componentbase"),a=require("primereact/hooks"),r=require("primereact/utils");function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var l=o(e);function i(e){if(Array.isArray(e))return e}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,l,i=[],u=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(a=o.call(n)).done)&&(i.push(a.value),i.length!==t);u=!0);}catch(e){s=!0,r=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(s)throw r}}return i}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function c(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 destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){return i(e)||u(e,t)||c(e,t)||f()}var m=n.ComponentBase.extend({defaultProps:{__TYPE:"Knob",id:null,style:null,className:null,value:null,size:100,disabled:!1,readOnly:!1,showValue:!0,tabIndex:0,step:1,min:0,max:100,strokeWidth:14,name:null,valueColor:"var(--primary-color, Black)",rangeColor:"var(--surface-border, LightGray)",textColor:"var(--text-color-secondary, Black)",valueTemplate:"{value}",onChange:null,children:void 0},css:{classes:{range:"p-knob-range",value:"p-knob-value",label:"p-knob-text",root:function(e){var t=e.props;return r.classNames("p-knob p-component",{"p-disabled":t.disabled},t.className)}},styles:"\n @keyframes dash-frame {\n 100% {\n stroke-dashoffset: 0;\n }\n }\n @layer primereact {\n .p-knob-range {\n fill: none;\n transition: stroke .1s ease-in;\n }\n .p-knob-value {\n animation-name: dash-frame;\n animation-fill-mode: forwards;\n fill: none;\n }\n .p-knob-text {\n font-size: 1.3rem;\n text-align: center;\n }\n }\n "}}),v=40,p=4*Math.PI/3,h=-Math.PI/3,b=l.memo(l.forwardRef((function(e,r){var o=a.useMergeProps(),i=l.useContext(t.PrimeReactContext),u=m.getProps(e,i),s=m.setMetaData({props:u}),c=s.ptm,f=s.cx;n.useHandleStyle(m.css.styles,s.isUnstyled,{name:"knob"});var b=l.useRef(null),y=!u.disabled&&!u.readOnly,g=d(a.useEventListener({target:"window",type:"mousemove",listener:function(e){T(e.offsetX,e.offsetY),e.preventDefault()},when:y}),2),w=g[0],x=g[1],k=d(a.useEventListener({target:"window",type:"mouseup",listener:function(e){x(),C(),e.preventDefault()},when:y}),2),M=k[0],C=k[1],E=d(a.useEventListener({target:"window",type:"touchmove",listener:function(e){if(1===e.touches.length){var t=b.current.getBoundingClientRect(),n=e.targetTouches.item(0);T(n.clientX-t.left,n.clientY-t.top),e.preventDefault()}},when:y}),2),D=E[0],P=E[1],O=d(a.useEventListener({target:"window",type:"touchend",listener:function(){P(),I()},when:y}),2),A=O[0],I=O[1],j=function(e,t,n,a,r){return(e-t)*(r-a)/(n-t)+a},L=function(){return j(u.min>0&&u.max>0?u.min:0,u.min,u.max,p,h)},N=function(){return j(u.value,u.min,u.max,p,h)},S="M ".concat(50+Math.cos(p)*v," ").concat(50-Math.sin(p)*v," A ").concat(v," ").concat(v," 0 1 1 ").concat(50+Math.cos(h)*v," ").concat(50-Math.sin(h)*v),z="M ".concat(50+Math.cos(L())*v," ").concat(50-Math.sin(L())*v," A ").concat(v," ").concat(v," 0 ").concat(Math.abs(L()-N())<Math.PI?0:1," ").concat(N()>L()?0:1," ").concat(50+Math.cos(N())*v," ").concat(50-Math.sin(N())*v),T=function(e,t){var n=Math.atan2(u.size/2-t,e-u.size/2),a=-Math.PI/2-Math.PI/6;_(n,a)},_=function(e,t){var n;if(e>h)n=j(e,p,h,u.min,u.max);else{if(!(e<t))return;n=j(e+2*Math.PI,p,h,u.min,u.max)}u.onChange&&u.onChange({value:Math.round((n-u.min)/u.step)*u.step+u.min})},q=function(e){var t;t=e>u.max?u.max:e<u.min?u.min:e,u.onChange&&u.onChange({value:t})},B=function(e){if(!u.disabled&&!u.readonly)switch(e.code){case"ArrowRight":case"ArrowUp":e.preventDefault(),q(u.value+1);break;case"ArrowLeft":case"ArrowDown":e.preventDefault(),q(u.value-1);break;case"Home":e.preventDefault(),q(u.min);break;case"End":e.preventDefault(),q(u.max);break;case"PageUp":e.preventDefault(),q(u.value+10);break;case"PageDown":e.preventDefault(),q(u.value-10)}};l.useImperativeHandle(r,(function(){return{props:u,getElement:function(){return b.current}}}));var R=o({x:50,y:57,textAnchor:"middle",fill:u.textColor,className:f("label"),name:u.name},c("label")),U=u.showValue&&l.createElement("text",R,u.valueTemplate.replace("{value}",u.value.toString())),W=o({ref:b,id:u.id,className:f("root"),style:u.style},c("root")),K=o({viewBox:"0 0 100 100",width:u.size,height:u.size,"aria-valuemin":u.min,"aria-valuemax":u.max,"aria-valuenow":u.value,"aria-labelledby":u.ariaLabelledby,"aria-label":u.ariaLabel,role:"slider",tabIndex:u.readonly||u.disabled?-1:u.tabIndex,onClick:function(e){return t=e,void(u.disabled||u.readOnly||T(t.nativeEvent.offsetX,t.nativeEvent.offsetY));var t},onMouseDown:function(e){return t=e,w(),M(),void t.preventDefault();var t},onMouseUp:function(e){return x(),void C()},onTouchStart:function(e){return D(),void A()},onTouchEnd:function(e){return P(),void I()},onKeyDown:function(e){return B(e)}},c("svg")),Y=o({d:S,strokeWidth:u.strokeWidth,stroke:u.rangeColor,className:f("range")},c("range")),H=o({d:z,strokeWidth:u.strokeWidth,stroke:u.valueColor,className:f("value")},c("value"));return l.createElement("div",W,l.createElement("svg",K,l.createElement("path",Y),l.createElement("path",H),U))})));b.displayName="Knob",exports.Knob=b;
|
package/knob/knob.esm.js
CHANGED
|
@@ -71,6 +71,7 @@ var KnobBase = ComponentBase.extend({
|
|
|
71
71
|
disabled: false,
|
|
72
72
|
readOnly: false,
|
|
73
73
|
showValue: true,
|
|
74
|
+
tabIndex: 0,
|
|
74
75
|
step: 1,
|
|
75
76
|
min: 0,
|
|
76
77
|
max: 100,
|
|
@@ -234,6 +235,15 @@ var Knob = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
234
235
|
});
|
|
235
236
|
}
|
|
236
237
|
};
|
|
238
|
+
var updateModelValue = function updateModelValue(newValue) {
|
|
239
|
+
var currentValue;
|
|
240
|
+
if (newValue > props.max) currentValue = props.max;else if (newValue < props.min) currentValue = props.min;else currentValue = newValue;
|
|
241
|
+
if (props.onChange) {
|
|
242
|
+
props.onChange({
|
|
243
|
+
value: currentValue
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
};
|
|
237
247
|
var _onClick = function onClick(event) {
|
|
238
248
|
if (!props.disabled && !props.readOnly) {
|
|
239
249
|
updateValue(event.nativeEvent.offsetX, event.nativeEvent.offsetY);
|
|
@@ -256,6 +266,48 @@ var Knob = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
256
266
|
unbindWindowTouchMoveListener();
|
|
257
267
|
unbindWindowTouchEndListener();
|
|
258
268
|
};
|
|
269
|
+
var _onKeyDown = function onKeyDown(event) {
|
|
270
|
+
if (!props.disabled && !props.readonly) {
|
|
271
|
+
switch (event.code) {
|
|
272
|
+
case 'ArrowRight':
|
|
273
|
+
case 'ArrowUp':
|
|
274
|
+
event.preventDefault();
|
|
275
|
+
updateModelValue(props.value + 1);
|
|
276
|
+
break;
|
|
277
|
+
case 'ArrowLeft':
|
|
278
|
+
case 'ArrowDown':
|
|
279
|
+
{
|
|
280
|
+
event.preventDefault();
|
|
281
|
+
updateModelValue(props.value - 1);
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
case 'Home':
|
|
285
|
+
{
|
|
286
|
+
event.preventDefault();
|
|
287
|
+
updateModelValue(props.min);
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
case 'End':
|
|
291
|
+
{
|
|
292
|
+
event.preventDefault();
|
|
293
|
+
updateModelValue(props.max);
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
case 'PageUp':
|
|
297
|
+
{
|
|
298
|
+
event.preventDefault();
|
|
299
|
+
updateModelValue(props.value + 10);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
case 'PageDown':
|
|
303
|
+
{
|
|
304
|
+
event.preventDefault();
|
|
305
|
+
updateModelValue(props.value - 10);
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
};
|
|
259
311
|
React.useImperativeHandle(ref, function () {
|
|
260
312
|
return {
|
|
261
313
|
props: props,
|
|
@@ -283,6 +335,13 @@ var Knob = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
283
335
|
viewBox: '0 0 100 100',
|
|
284
336
|
width: props.size,
|
|
285
337
|
height: props.size,
|
|
338
|
+
'aria-valuemin': props.min,
|
|
339
|
+
'aria-valuemax': props.max,
|
|
340
|
+
'aria-valuenow': props.value,
|
|
341
|
+
'aria-labelledby': props.ariaLabelledby,
|
|
342
|
+
'aria-label': props.ariaLabel,
|
|
343
|
+
role: 'slider',
|
|
344
|
+
tabIndex: props.readonly || props.disabled ? -1 : props.tabIndex,
|
|
286
345
|
onClick: function onClick(e) {
|
|
287
346
|
return _onClick(e);
|
|
288
347
|
},
|
|
@@ -297,6 +356,9 @@ var Knob = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
297
356
|
},
|
|
298
357
|
onTouchEnd: function onTouchEnd(e) {
|
|
299
358
|
return _onTouchEnd();
|
|
359
|
+
},
|
|
360
|
+
onKeyDown: function onKeyDown(e) {
|
|
361
|
+
return _onKeyDown(e);
|
|
300
362
|
}
|
|
301
363
|
}, ptm('svg'));
|
|
302
364
|
var rangeProps = mergeProps({
|
package/knob/knob.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{ComponentBase as n,useHandleStyle as
|
|
1
|
+
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{ComponentBase as n,useHandleStyle as a}from"primereact/componentbase";import{useMergeProps as r,useEventListener as o}from"primereact/hooks";import{classNames as l}from"primereact/utils";function i(e){if(Array.isArray(e))return e}function c(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,l,i=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=o.call(n)).done)&&(i.push(a.value),i.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(s)throw r}}return i}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function u(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 destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){return i(e)||c(e,t)||u(e,t)||m()}var d=n.extend({defaultProps:{__TYPE:"Knob",id:null,style:null,className:null,value:null,size:100,disabled:!1,readOnly:!1,showValue:!0,tabIndex:0,step:1,min:0,max:100,strokeWidth:14,name:null,valueColor:"var(--primary-color, Black)",rangeColor:"var(--surface-border, LightGray)",textColor:"var(--text-color-secondary, Black)",valueTemplate:"{value}",onChange:null,children:void 0},css:{classes:{range:"p-knob-range",value:"p-knob-value",label:"p-knob-text",root:function(e){var t=e.props;return l("p-knob p-component",{"p-disabled":t.disabled},t.className)}},styles:"\n @keyframes dash-frame {\n 100% {\n stroke-dashoffset: 0;\n }\n }\n @layer primereact {\n .p-knob-range {\n fill: none;\n transition: stroke .1s ease-in;\n }\n .p-knob-value {\n animation-name: dash-frame;\n animation-fill-mode: forwards;\n fill: none;\n }\n .p-knob-text {\n font-size: 1.3rem;\n text-align: center;\n }\n }\n "}}),v=40,p=4*Math.PI/3,h=-Math.PI/3,b=e.memo(e.forwardRef((function(n,l){var i=r(),c=e.useContext(t),s=d.getProps(n,c),u=d.setMetaData({props:s}),m=u.ptm,b=u.cx;a(d.css.styles,u.isUnstyled,{name:"knob"});var y=e.useRef(null),g=!s.disabled&&!s.readOnly,w=f(o({target:"window",type:"mousemove",listener:function(e){W(e.offsetX,e.offsetY),e.preventDefault()},when:g}),2),x=w[0],k=w[1],M=f(o({target:"window",type:"mouseup",listener:function(e){k(),D(),e.preventDefault()},when:g}),2),C=M[0],D=M[1],A=f(o({target:"window",type:"touchmove",listener:function(e){if(1===e.touches.length){var t=y.current.getBoundingClientRect(),n=e.targetTouches.item(0);W(n.clientX-t.left,n.clientY-t.top),e.preventDefault()}},when:g}),2),I=A[0],E=A[1],P=f(o({target:"window",type:"touchend",listener:function(){E(),O()},when:g}),2),N=P[0],O=P[1],S=function(e,t,n,a,r){return(e-t)*(r-a)/(n-t)+a},T=function(){return S(s.min>0&&s.max>0?s.min:0,s.min,s.max,p,h)},z=function(){return S(s.value,s.min,s.max,p,h)},j="M ".concat(50+Math.cos(p)*v," ").concat(50-Math.sin(p)*v," A ").concat(v," ").concat(v," 0 1 1 ").concat(50+Math.cos(h)*v," ").concat(50-Math.sin(h)*v),U="M ".concat(50+Math.cos(T())*v," ").concat(50-Math.sin(T())*v," A ").concat(v," ").concat(v," 0 ").concat(Math.abs(T()-z())<Math.PI?0:1," ").concat(z()>T()?0:1," ").concat(50+Math.cos(z())*v," ").concat(50-Math.sin(z())*v),W=function(e,t){var n=Math.atan2(s.size/2-t,e-s.size/2),a=-Math.PI/2-Math.PI/6;B(n,a)},B=function(e,t){var n;if(e>h)n=S(e,p,h,s.min,s.max);else{if(!(e<t))return;n=S(e+2*Math.PI,p,h,s.min,s.max)}s.onChange&&s.onChange({value:Math.round((n-s.min)/s.step)*s.step+s.min})},L=function(e){var t;t=e>s.max?s.max:e<s.min?s.min:e,s.onChange&&s.onChange({value:t})},R=function(e){if(!s.disabled&&!s.readonly)switch(e.code){case"ArrowRight":case"ArrowUp":e.preventDefault(),L(s.value+1);break;case"ArrowLeft":case"ArrowDown":e.preventDefault(),L(s.value-1);break;case"Home":e.preventDefault(),L(s.min);break;case"End":e.preventDefault(),L(s.max);break;case"PageUp":e.preventDefault(),L(s.value+10);break;case"PageDown":e.preventDefault(),L(s.value-10)}};e.useImperativeHandle(l,(function(){return{props:s,getElement:function(){return y.current}}}));var Y=i({x:50,y:57,textAnchor:"middle",fill:s.textColor,className:b("label"),name:s.name},m("label")),K=s.showValue&&e.createElement("text",Y,s.valueTemplate.replace("{value}",s.value.toString())),X=i({ref:y,id:s.id,className:b("root"),style:s.style},m("root")),H=i({viewBox:"0 0 100 100",width:s.size,height:s.size,"aria-valuemin":s.min,"aria-valuemax":s.max,"aria-valuenow":s.value,"aria-labelledby":s.ariaLabelledby,"aria-label":s.ariaLabel,role:"slider",tabIndex:s.readonly||s.disabled?-1:s.tabIndex,onClick:function(e){return t=e,void(s.disabled||s.readOnly||W(t.nativeEvent.offsetX,t.nativeEvent.offsetY));var t},onMouseDown:function(e){return t=e,x(),C(),void t.preventDefault();var t},onMouseUp:function(e){return k(),void D()},onTouchStart:function(e){return I(),void N()},onTouchEnd:function(e){return E(),void O()},onKeyDown:function(e){return R(e)}},m("svg")),V=i({d:j,strokeWidth:s.strokeWidth,stroke:s.rangeColor,className:b("range")},m("range")),_=i({d:U,strokeWidth:s.strokeWidth,stroke:s.valueColor,className:b("value")},m("value"));return e.createElement("div",X,e.createElement("svg",H,e.createElement("path",V),e.createElement("path",_),K))})));b.displayName="Knob";export{b as Knob};
|
package/knob/knob.js
CHANGED
|
@@ -88,6 +88,7 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
88
88
|
disabled: false,
|
|
89
89
|
readOnly: false,
|
|
90
90
|
showValue: true,
|
|
91
|
+
tabIndex: 0,
|
|
91
92
|
step: 1,
|
|
92
93
|
min: 0,
|
|
93
94
|
max: 100,
|
|
@@ -251,6 +252,15 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
251
252
|
});
|
|
252
253
|
}
|
|
253
254
|
};
|
|
255
|
+
var updateModelValue = function updateModelValue(newValue) {
|
|
256
|
+
var currentValue;
|
|
257
|
+
if (newValue > props.max) currentValue = props.max;else if (newValue < props.min) currentValue = props.min;else currentValue = newValue;
|
|
258
|
+
if (props.onChange) {
|
|
259
|
+
props.onChange({
|
|
260
|
+
value: currentValue
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
};
|
|
254
264
|
var _onClick = function onClick(event) {
|
|
255
265
|
if (!props.disabled && !props.readOnly) {
|
|
256
266
|
updateValue(event.nativeEvent.offsetX, event.nativeEvent.offsetY);
|
|
@@ -273,6 +283,48 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
273
283
|
unbindWindowTouchMoveListener();
|
|
274
284
|
unbindWindowTouchEndListener();
|
|
275
285
|
};
|
|
286
|
+
var _onKeyDown = function onKeyDown(event) {
|
|
287
|
+
if (!props.disabled && !props.readonly) {
|
|
288
|
+
switch (event.code) {
|
|
289
|
+
case 'ArrowRight':
|
|
290
|
+
case 'ArrowUp':
|
|
291
|
+
event.preventDefault();
|
|
292
|
+
updateModelValue(props.value + 1);
|
|
293
|
+
break;
|
|
294
|
+
case 'ArrowLeft':
|
|
295
|
+
case 'ArrowDown':
|
|
296
|
+
{
|
|
297
|
+
event.preventDefault();
|
|
298
|
+
updateModelValue(props.value - 1);
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
case 'Home':
|
|
302
|
+
{
|
|
303
|
+
event.preventDefault();
|
|
304
|
+
updateModelValue(props.min);
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
case 'End':
|
|
308
|
+
{
|
|
309
|
+
event.preventDefault();
|
|
310
|
+
updateModelValue(props.max);
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
case 'PageUp':
|
|
314
|
+
{
|
|
315
|
+
event.preventDefault();
|
|
316
|
+
updateModelValue(props.value + 10);
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
case 'PageDown':
|
|
320
|
+
{
|
|
321
|
+
event.preventDefault();
|
|
322
|
+
updateModelValue(props.value - 10);
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
276
328
|
React__namespace.useImperativeHandle(ref, function () {
|
|
277
329
|
return {
|
|
278
330
|
props: props,
|
|
@@ -300,6 +352,13 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
300
352
|
viewBox: '0 0 100 100',
|
|
301
353
|
width: props.size,
|
|
302
354
|
height: props.size,
|
|
355
|
+
'aria-valuemin': props.min,
|
|
356
|
+
'aria-valuemax': props.max,
|
|
357
|
+
'aria-valuenow': props.value,
|
|
358
|
+
'aria-labelledby': props.ariaLabelledby,
|
|
359
|
+
'aria-label': props.ariaLabel,
|
|
360
|
+
role: 'slider',
|
|
361
|
+
tabIndex: props.readonly || props.disabled ? -1 : props.tabIndex,
|
|
303
362
|
onClick: function onClick(e) {
|
|
304
363
|
return _onClick(e);
|
|
305
364
|
},
|
|
@@ -314,6 +373,9 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
314
373
|
},
|
|
315
374
|
onTouchEnd: function onTouchEnd(e) {
|
|
316
375
|
return _onTouchEnd();
|
|
376
|
+
},
|
|
377
|
+
onKeyDown: function onKeyDown(e) {
|
|
378
|
+
return _onKeyDown(e);
|
|
317
379
|
}
|
|
318
380
|
}, ptm('svg'));
|
|
319
381
|
var rangeProps = mergeProps({
|
package/knob/knob.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.knob=function(e,t,n,r,
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.knob=function(e,t,n,a,r,o){"use strict";function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=l(t);function s(e){if(Array.isArray(e))return e}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,l,i=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(a=o.call(n)).done)&&(i.push(a.value),i.length!==t);s=!0);}catch(e){u=!0,r=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw r}}return i}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function f(e,t){if(e){if("string"==typeof e)return c(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)?c(e,t):void 0}}function m(){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 d(e,t){return s(e)||u(e,t)||f(e,t)||m()}var v=a.ComponentBase.extend({defaultProps:{__TYPE:"Knob",id:null,style:null,className:null,value:null,size:100,disabled:!1,readOnly:!1,showValue:!0,tabIndex:0,step:1,min:0,max:100,strokeWidth:14,name:null,valueColor:"var(--primary-color, Black)",rangeColor:"var(--surface-border, LightGray)",textColor:"var(--text-color-secondary, Black)",valueTemplate:"{value}",onChange:null,children:void 0},css:{classes:{range:"p-knob-range",value:"p-knob-value",label:"p-knob-text",root:function(e){var t=e.props;return o.classNames("p-knob p-component",{"p-disabled":t.disabled},t.className)}},styles:"\n @keyframes dash-frame {\n 100% {\n stroke-dashoffset: 0;\n }\n }\n @layer primereact {\n .p-knob-range {\n fill: none;\n transition: stroke .1s ease-in;\n }\n .p-knob-value {\n animation-name: dash-frame;\n animation-fill-mode: forwards;\n fill: none;\n }\n .p-knob-text {\n font-size: 1.3rem;\n text-align: center;\n }\n }\n "}}),p=40,h=4*Math.PI/3,b=-Math.PI/3,y=i.memo(i.forwardRef((function(e,t){var o=r.useMergeProps(),l=i.useContext(n.PrimeReactContext),s=v.getProps(e,l),u=v.setMetaData({props:s}),c=u.ptm,f=u.cx;a.useHandleStyle(v.css.styles,u.isUnstyled,{name:"knob"});var m=i.useRef(null),y=!s.disabled&&!s.readOnly,g=d(r.useEventListener({target:"window",type:"mousemove",listener:function(e){T(e.offsetX,e.offsetY),e.preventDefault()},when:y}),2),w=g[0],k=g[1],x=d(r.useEventListener({target:"window",type:"mouseup",listener:function(e){k(),C(),e.preventDefault()},when:y}),2),M=x[0],C=x[1],E=d(r.useEventListener({target:"window",type:"touchmove",listener:function(e){if(1===e.touches.length){var t=m.current.getBoundingClientRect(),n=e.targetTouches.item(0);T(n.clientX-t.left,n.clientY-t.top),e.preventDefault()}},when:y}),2),D=E[0],P=E[1],O=d(r.useEventListener({target:"window",type:"touchend",listener:function(){P(),I()},when:y}),2),A=O[0],I=O[1],j=function(e,t,n,a,r){return(e-t)*(r-a)/(n-t)+a},L=function(){return j(s.min>0&&s.max>0?s.min:0,s.min,s.max,h,b)},N=function(){return j(s.value,s.min,s.max,h,b)},S="M ".concat(50+Math.cos(h)*p," ").concat(50-Math.sin(h)*p," A ").concat(p," ").concat(p," 0 1 1 ").concat(50+Math.cos(b)*p," ").concat(50-Math.sin(b)*p),z="M ".concat(50+Math.cos(L())*p," ").concat(50-Math.sin(L())*p," A ").concat(p," ").concat(p," 0 ").concat(Math.abs(L()-N())<Math.PI?0:1," ").concat(N()>L()?0:1," ").concat(50+Math.cos(N())*p," ").concat(50-Math.sin(N())*p),T=function(e,t){var n=Math.atan2(s.size/2-t,e-s.size/2),a=-Math.PI/2-Math.PI/6;R(n,a)},R=function(e,t){var n;if(e>b)n=j(e,h,b,s.min,s.max);else{if(!(e<t))return;n=j(e+2*Math.PI,h,b,s.min,s.max)}s.onChange&&s.onChange({value:Math.round((n-s.min)/s.step)*s.step+s.min})},_=function(e){var t;t=e>s.max?s.max:e<s.min?s.min:e,s.onChange&&s.onChange({value:t})},B=function(e){if(!s.disabled&&!s.readonly)switch(e.code){case"ArrowRight":case"ArrowUp":e.preventDefault(),_(s.value+1);break;case"ArrowLeft":case"ArrowDown":e.preventDefault(),_(s.value-1);break;case"Home":e.preventDefault(),_(s.min);break;case"End":e.preventDefault(),_(s.max);break;case"PageUp":e.preventDefault(),_(s.value+10);break;case"PageDown":e.preventDefault(),_(s.value-10)}};i.useImperativeHandle(t,(function(){return{props:s,getElement:function(){return m.current}}}));var U=o({x:50,y:57,textAnchor:"middle",fill:s.textColor,className:f("label"),name:s.name},c("label")),W=s.showValue&&i.createElement("text",U,s.valueTemplate.replace("{value}",s.value.toString())),K=o({ref:m,id:s.id,className:f("root"),style:s.style},c("root")),Y=o({viewBox:"0 0 100 100",width:s.size,height:s.size,"aria-valuemin":s.min,"aria-valuemax":s.max,"aria-valuenow":s.value,"aria-labelledby":s.ariaLabelledby,"aria-label":s.ariaLabel,role:"slider",tabIndex:s.readonly||s.disabled?-1:s.tabIndex,onClick:function(e){return t=e,void(s.disabled||s.readOnly||T(t.nativeEvent.offsetX,t.nativeEvent.offsetY));var t},onMouseDown:function(e){return t=e,w(),M(),void t.preventDefault();var t},onMouseUp:function(e){return k(),void C()},onTouchStart:function(e){return D(),void A()},onTouchEnd:function(e){return P(),void I()},onKeyDown:function(e){return B(e)}},c("svg")),H=o({d:S,strokeWidth:s.strokeWidth,stroke:s.rangeColor,className:f("range")},c("range")),X=o({d:z,strokeWidth:s.strokeWidth,stroke:s.valueColor,className:f("value")},c("value"));return i.createElement("div",K,i.createElement("svg",Y,i.createElement("path",H),i.createElement("path",X),W))})));return y.displayName="Knob",e.Knob=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.hooks,primereact.utils);
|