primereact 10.5.1 → 10.5.2
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.cjs.js +94 -92
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +229 -11
- package/api/api.esm.js +94 -92
- package/api/api.esm.min.js +1 -1
- package/api/api.js +94 -92
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +89 -45
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +6 -1
- package/autocomplete/autocomplete.esm.js +89 -45
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +89 -45
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/blockui.cjs.js +13 -13
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +13 -13
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +13 -13
- package/blockui/blockui.min.js +1 -1
- package/calendar/calendar.cjs.js +30 -11
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +9 -0
- package/calendar/calendar.esm.js +30 -11
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +30 -11
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +17 -15
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +4 -2
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +17 -15
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +28 -14
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +5 -0
- package/cascadeselect/cascadeselect.esm.js +28 -14
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +28 -14
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/checkbox.cjs.js +70 -153
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +10 -34
- package/checkbox/checkbox.esm.js +70 -153
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +70 -153
- package/checkbox/checkbox.min.js +1 -1
- package/chips/chips.cjs.js +23 -9
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +6 -1
- package/chips/chips.esm.js +23 -9
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +23 -9
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +3 -2
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +2 -1
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +3 -2
- package/colorpicker/colorpicker.min.js +1 -1
- package/componentbase/componentbase.cjs.js +4 -6
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +5 -7
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +4 -6
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +1 -0
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +1 -0
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +1 -0
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +5 -5
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +5 -5
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +5 -5
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/core/core.js +639 -603
- package/core/core.min.js +13 -13
- package/datatable/datatable.cjs.js +128 -110
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +1 -1
- package/datatable/datatable.esm.js +128 -110
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +128 -110
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +16 -13
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +4 -1
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +17 -15
- package/dataview/dataview.min.js +1 -1
- package/dialog/dialog.cjs.js +6 -6
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +6 -6
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +6 -6
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +98 -29
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +41 -0
- package/dropdown/dropdown.esm.js +98 -29
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +98 -31
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +125 -54
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +125 -54
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +125 -54
- package/editor/editor.min.js +1 -1
- package/galleria/galleria.cjs.js +22 -19
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +4 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +23 -20
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +115 -72
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +116 -73
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +115 -72
- package/hooks/hooks.min.js +1 -1
- package/image/image.cjs.js +11 -9
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +11 -9
- package/image/image.esm.min.js +1 -1
- package/image/image.js +11 -9
- package/image/image.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +20 -36
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +5 -5
- package/inputnumber/inputnumber.esm.js +20 -36
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +20 -36
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +18 -93
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.d.ts +9 -20
- package/inputswitch/inputswitch.esm.js +18 -93
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +18 -93
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +5 -3
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +5 -0
- package/inputtext/inputtext.esm.js +5 -3
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +5 -3
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +3 -1
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +5 -0
- package/inputtextarea/inputtextarea.esm.js +3 -1
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +3 -1
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -10
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +15 -0
- package/listbox/listbox.esm.js +15 -11
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +14 -10
- package/listbox/listbox.min.js +1 -1
- package/mention/mention.cjs.js +3 -1
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +3 -1
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +3 -1
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +3 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +3 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +3 -2
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +1 -1
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +1 -1
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +2 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +1 -1
- package/message/message.esm.js +2 -8
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -8
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +1 -1
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +1 -1
- package/messages/messages.esm.js +1 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +1 -1
- package/messages/messages.min.js +1 -1
- package/metergroup/metergroup.cjs.js +237 -0
- package/metergroup/metergroup.cjs.min.js +1 -0
- package/metergroup/metergroup.d.ts +183 -0
- package/metergroup/metergroup.esm.js +233 -0
- package/metergroup/metergroup.esm.min.js +1 -0
- package/metergroup/metergroup.js +236 -0
- package/metergroup/metergroup.min.js +1 -0
- package/multiselect/multiselect.cjs.js +94 -123
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +25 -1
- package/multiselect/multiselect.esm.js +94 -123
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +94 -123
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +1 -1
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +35 -11
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +5 -0
- package/orderlist/orderlist.esm.js +35 -11
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +35 -11
- package/orderlist/orderlist.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +3 -2
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +3 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +3 -2
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +125 -108
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.d.ts +88 -0
- package/paginator/paginator.esm.js +125 -108
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +125 -108
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +13 -5
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +13 -5
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +13 -5
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/index.d.ts +12 -0
- package/passthrough/tailwind/index.cjs.js +268 -172
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +268 -172
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +268 -172
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +70 -39
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +5 -0
- package/password/password.esm.js +72 -41
- package/password/password.esm.min.js +1 -1
- package/password/password.js +70 -39
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +126 -101
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.d.ts +5 -0
- package/picklist/picklist.esm.js +126 -101
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +126 -101
- package/picklist/picklist.min.js +1 -1
- package/primereact.all.cjs.js +1774 -1431
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1775 -1431
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1774 -1431
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +67 -142
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.d.ts +17 -35
- package/radiobutton/radiobutton.esm.js +68 -143
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +67 -142
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +344 -67
- package/resources/themes/arya-green/theme.css +344 -67
- package/resources/themes/arya-orange/theme.css +344 -67
- package/resources/themes/bootstrap4-dark-blue/theme.css +389 -64
- package/resources/themes/bootstrap4-light-blue/theme.css +389 -64
- package/resources/themes/fluent-light/theme.css +341 -64
- package/resources/themes/lara-dark-amber/theme.css +470 -67
- package/resources/themes/lara-dark-blue/theme.css +470 -67
- package/resources/themes/lara-dark-cyan/theme.css +470 -67
- package/resources/themes/lara-dark-green/theme.css +470 -67
- package/resources/themes/lara-dark-indigo/theme.css +470 -67
- package/resources/themes/lara-dark-pink/theme.css +470 -67
- package/resources/themes/lara-dark-teal/theme.css +470 -67
- package/resources/themes/lara-light-amber/theme.css +470 -67
- package/resources/themes/lara-light-blue/theme.css +470 -67
- package/resources/themes/lara-light-cyan/theme.css +470 -67
- package/resources/themes/lara-light-green/theme.css +470 -67
- package/resources/themes/lara-light-indigo/theme.css +470 -67
- package/resources/themes/lara-light-pink/theme.css +470 -67
- package/resources/themes/lara-light-teal/theme.css +470 -67
- package/resources/themes/luna-amber/theme.css +344 -67
- package/resources/themes/luna-blue/theme.css +344 -67
- package/resources/themes/luna-green/theme.css +344 -67
- package/resources/themes/luna-pink/theme.css +344 -67
- package/resources/themes/md-dark-deeppurple/theme.css +995 -289
- package/resources/themes/md-dark-indigo/theme.css +684 -232
- package/resources/themes/md-light-deeppurple/theme.css +868 -162
- package/resources/themes/md-light-indigo/theme.css +566 -101
- package/resources/themes/mdc-dark-deeppurple/theme.css +995 -289
- package/resources/themes/mdc-dark-indigo/theme.css +697 -232
- package/resources/themes/mdc-light-deeppurple/theme.css +868 -162
- package/resources/themes/mdc-light-indigo/theme.css +566 -101
- package/resources/themes/mira/theme.css +344 -67
- package/resources/themes/nano/theme.css +344 -67
- package/resources/themes/nova/theme.css +344 -67
- package/resources/themes/nova-accent/theme.css +344 -67
- package/resources/themes/nova-alt/theme.css +344 -67
- package/resources/themes/rhea/theme.css +343 -66
- package/resources/themes/saga-blue/theme.css +344 -67
- package/resources/themes/saga-green/theme.css +344 -67
- package/resources/themes/saga-orange/theme.css +344 -67
- package/resources/themes/soho-dark/theme.css +413 -88
- package/resources/themes/soho-light/theme.css +392 -67
- package/resources/themes/tailwind-light/theme.css +344 -67
- package/resources/themes/vela-blue/theme.css +344 -67
- package/resources/themes/vela-green/theme.css +344 -67
- package/resources/themes/vela-orange/theme.css +344 -67
- package/resources/themes/viva-dark/theme.css +392 -67
- package/resources/themes/viva-light/theme.css +392 -67
- package/selectbutton/selectbutton.cjs.js +12 -4
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.d.ts +5 -0
- package/selectbutton/selectbutton.esm.js +12 -4
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +13 -5
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/sidebar.cjs.js +4 -3
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +4 -4
- package/sidebar/sidebar.esm.js +4 -3
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +4 -3
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +3 -2
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +3 -2
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +3 -2
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +18 -2
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +18 -2
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +18 -2
- package/slider/slider.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +2 -2
- package/splitter/splitter.cjs.js +7 -7
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.d.ts +5 -5
- package/splitter/splitter.esm.js +7 -7
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +7 -7
- package/splitter/splitter.min.js +1 -1
- package/styleclass/styleclass.cjs.js +21 -1
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.d.ts +10 -0
- package/styleclass/styleclass.esm.js +21 -1
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +22 -2
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +1 -1
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +1 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +1 -1
- package/tabmenu/tabmenu.min.js +1 -1
- package/toast/toast.cjs.js +93 -92
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +1 -1
- package/toast/toast.esm.js +93 -92
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +93 -92
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +54 -92
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +24 -0
- package/togglebutton/togglebutton.esm.js +53 -91
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +54 -92
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.d.ts +3 -3
- package/tooltip/tooltipoptions.d.ts +5 -0
- package/tree/tree.cjs.js +20 -8
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +20 -8
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +20 -8
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +2 -0
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +5 -0
- package/treeselect/treeselect.esm.js +2 -0
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +2 -0
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +17 -14
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +17 -14
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +17 -14
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +33 -90
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.d.ts +12 -13
- package/tristatecheckbox/tristatecheckbox.esm.js +34 -91
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +33 -90
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +64 -72
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +11 -2
- package/utils/utils.esm.js +65 -72
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +64 -72
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +17 -15
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +14 -12
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +17 -15
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +455 -39
|
@@ -4,7 +4,7 @@ import { PrimeReactContext } from 'primereact/api';
|
|
|
4
4
|
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
5
5
|
import { useMergeProps, useMountEffect } from 'primereact/hooks';
|
|
6
6
|
import { Tooltip } from 'primereact/tooltip';
|
|
7
|
-
import { classNames,
|
|
7
|
+
import { classNames, DomHandler, ObjectUtils } from 'primereact/utils';
|
|
8
8
|
|
|
9
9
|
function _extends() {
|
|
10
10
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -62,83 +62,19 @@ function _defineProperty(obj, key, value) {
|
|
|
62
62
|
return obj;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function _arrayWithHoles(arr) {
|
|
66
|
-
if (Array.isArray(arr)) return arr;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _iterableToArrayLimit(r, l) {
|
|
70
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
71
|
-
if (null != t) {
|
|
72
|
-
var e,
|
|
73
|
-
n,
|
|
74
|
-
i,
|
|
75
|
-
u,
|
|
76
|
-
a = [],
|
|
77
|
-
f = !0,
|
|
78
|
-
o = !1;
|
|
79
|
-
try {
|
|
80
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
81
|
-
if (Object(t) !== t) return;
|
|
82
|
-
f = !1;
|
|
83
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
84
|
-
} catch (r) {
|
|
85
|
-
o = !0, n = r;
|
|
86
|
-
} finally {
|
|
87
|
-
try {
|
|
88
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
89
|
-
} finally {
|
|
90
|
-
if (o) throw n;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return a;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function _arrayLikeToArray(arr, len) {
|
|
98
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
99
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
100
|
-
return arr2;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
104
|
-
if (!o) return;
|
|
105
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
106
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
107
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
108
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
109
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
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
|
-
|
|
120
65
|
var classes = {
|
|
121
66
|
root: function root(_ref) {
|
|
122
|
-
var props = _ref.props
|
|
123
|
-
focusedState = _ref.focusedState;
|
|
67
|
+
var props = _ref.props;
|
|
124
68
|
return classNames('p-radiobutton p-component', {
|
|
125
|
-
'p-radiobutton-checked': props.checked,
|
|
126
|
-
'p-radiobutton-disabled': props.disabled,
|
|
127
|
-
'p-radiobutton-focused': focusedState
|
|
128
|
-
});
|
|
129
|
-
},
|
|
130
|
-
input: function input(_ref2) {
|
|
131
|
-
var props = _ref2.props,
|
|
132
|
-
focusedState = _ref2.focusedState;
|
|
133
|
-
return classNames('p-radiobutton-box', {
|
|
134
69
|
'p-highlight': props.checked,
|
|
135
70
|
'p-disabled': props.disabled,
|
|
136
|
-
'p-
|
|
71
|
+
'p-invalid': props.invalid
|
|
137
72
|
});
|
|
138
73
|
},
|
|
74
|
+
box: 'p-radiobutton-box',
|
|
75
|
+
input: 'p-radiobutton-input',
|
|
139
76
|
icon: 'p-radiobutton-icon'
|
|
140
77
|
};
|
|
141
|
-
var styles = "\n@layer primereact {\n .p-radiobutton {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n vertical-align: bottom;\n }\n \n .p-radiobutton-box {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .p-radiobutton-icon {\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n transform: translateZ(0) scale(.1);\n border-radius: 50%;\n visibility: hidden;\n }\n \n .p-radiobutton-box.p-highlight .p-radiobutton-icon {\n transform: translateZ(0) scale(1.0, 1.0);\n visibility: visible;\n }\n}\n";
|
|
142
78
|
var RadioButtonBase = ComponentBase.extend({
|
|
143
79
|
defaultProps: {
|
|
144
80
|
__TYPE: 'RadioButton',
|
|
@@ -149,6 +85,7 @@ var RadioButtonBase = ComponentBase.extend({
|
|
|
149
85
|
id: null,
|
|
150
86
|
inputId: null,
|
|
151
87
|
inputRef: null,
|
|
88
|
+
invalid: false,
|
|
152
89
|
name: null,
|
|
153
90
|
onChange: null,
|
|
154
91
|
onClick: null,
|
|
@@ -161,8 +98,7 @@ var RadioButtonBase = ComponentBase.extend({
|
|
|
161
98
|
children: undefined
|
|
162
99
|
},
|
|
163
100
|
css: {
|
|
164
|
-
classes: classes
|
|
165
|
-
styles: styles
|
|
101
|
+
classes: classes
|
|
166
102
|
}
|
|
167
103
|
});
|
|
168
104
|
|
|
@@ -172,33 +108,26 @@ var RadioButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
172
108
|
var mergeProps = useMergeProps();
|
|
173
109
|
var context = React.useContext(PrimeReactContext);
|
|
174
110
|
var props = RadioButtonBase.getProps(inProps, context);
|
|
175
|
-
var _React$useState = React.useState(false),
|
|
176
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
177
|
-
focusedState = _React$useState2[0],
|
|
178
|
-
setFocusedState = _React$useState2[1];
|
|
179
111
|
var elementRef = React.useRef(null);
|
|
180
112
|
var inputRef = React.useRef(props.inputRef);
|
|
181
113
|
var _RadioButtonBase$setM = RadioButtonBase.setMetaData({
|
|
182
|
-
props: props
|
|
183
|
-
state: {
|
|
184
|
-
focused: focusedState
|
|
185
|
-
}
|
|
114
|
+
props: props
|
|
186
115
|
}),
|
|
187
116
|
ptm = _RadioButtonBase$setM.ptm,
|
|
188
117
|
cx = _RadioButtonBase$setM.cx,
|
|
189
118
|
isUnstyled = _RadioButtonBase$setM.isUnstyled;
|
|
190
119
|
useHandleStyle(RadioButtonBase.css.styles, isUnstyled, {
|
|
191
|
-
name: 'radiobutton'
|
|
192
|
-
styled: true
|
|
120
|
+
name: 'radiobutton'
|
|
193
121
|
});
|
|
194
122
|
var select = function select(event) {
|
|
195
|
-
|
|
123
|
+
onChange(event);
|
|
196
124
|
};
|
|
197
|
-
var
|
|
198
|
-
if (props.disabled) {
|
|
125
|
+
var onChange = function onChange(event) {
|
|
126
|
+
if (props.disabled || props.readonly) {
|
|
199
127
|
return;
|
|
200
128
|
}
|
|
201
|
-
if (props.onChange
|
|
129
|
+
if (props.onChange) {
|
|
130
|
+
var _props$onChange;
|
|
202
131
|
var checked = props.checked;
|
|
203
132
|
var radioClicked = event.target instanceof HTMLDivElement;
|
|
204
133
|
var inputClicked = event.target === inputRef.current;
|
|
@@ -223,47 +152,30 @@ var RadioButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
223
152
|
checked: value
|
|
224
153
|
}
|
|
225
154
|
};
|
|
226
|
-
props
|
|
155
|
+
props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, eventData);
|
|
227
156
|
|
|
228
157
|
// do not continue if the user defined click wants to prevent
|
|
229
158
|
if (event.defaultPrevented) {
|
|
230
159
|
return;
|
|
231
160
|
}
|
|
232
161
|
if (isInputToggled || isRadioToggled) {
|
|
233
|
-
|
|
162
|
+
var _props$onChange2;
|
|
163
|
+
props === null || props === void 0 || (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, eventData);
|
|
234
164
|
if (isRadioToggled) {
|
|
235
165
|
inputRef.current.checked = value;
|
|
236
166
|
}
|
|
237
167
|
}
|
|
238
168
|
DomHandler.focus(inputRef.current);
|
|
239
|
-
event.preventDefault();
|
|
240
169
|
}
|
|
241
170
|
};
|
|
242
|
-
var onFocus = function onFocus() {
|
|
243
|
-
|
|
171
|
+
var onFocus = function onFocus(event) {
|
|
172
|
+
var _props$onFocus;
|
|
173
|
+
props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
244
174
|
};
|
|
245
|
-
var onBlur = function onBlur() {
|
|
246
|
-
|
|
175
|
+
var onBlur = function onBlur(event) {
|
|
176
|
+
var _props$onBlur;
|
|
177
|
+
props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, event);
|
|
247
178
|
};
|
|
248
|
-
var onKeyDown = function onKeyDown(event) {
|
|
249
|
-
if (event.code === 'Space' || event.key === ' ') {
|
|
250
|
-
// event.key is for Android support
|
|
251
|
-
onClick(event);
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
React.useEffect(function () {
|
|
255
|
-
if (inputRef.current) {
|
|
256
|
-
inputRef.current.checked = props.checked;
|
|
257
|
-
}
|
|
258
|
-
}, [props.checked]);
|
|
259
|
-
React.useEffect(function () {
|
|
260
|
-
ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
261
|
-
}, [inputRef, props.inputRef]);
|
|
262
|
-
useMountEffect(function () {
|
|
263
|
-
if (props.autoFocus) {
|
|
264
|
-
DomHandler.focus(inputRef.current, props.autoFocus);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
179
|
React.useImperativeHandle(ref, function () {
|
|
268
180
|
return {
|
|
269
181
|
props: props,
|
|
@@ -279,46 +191,59 @@ var RadioButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
279
191
|
}
|
|
280
192
|
};
|
|
281
193
|
});
|
|
194
|
+
React.useEffect(function () {
|
|
195
|
+
if (inputRef.current) {
|
|
196
|
+
inputRef.current.checked = props.checked;
|
|
197
|
+
}
|
|
198
|
+
}, [props.checked]);
|
|
199
|
+
React.useEffect(function () {
|
|
200
|
+
ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
201
|
+
}, [inputRef, props.inputRef]);
|
|
202
|
+
useMountEffect(function () {
|
|
203
|
+
if (props.autoFocus) {
|
|
204
|
+
DomHandler.focus(inputRef.current, props.autoFocus);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
282
207
|
var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
|
|
283
208
|
var otherProps = RadioButtonBase.getOtherProps(props);
|
|
284
|
-
var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
|
|
285
209
|
var rootProps = mergeProps({
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
})),
|
|
210
|
+
id: props.id,
|
|
211
|
+
className: classNames(props.className, cx('root')),
|
|
289
212
|
style: props.style,
|
|
290
|
-
onClick: onClick,
|
|
291
213
|
'data-p-checked': props.checked
|
|
292
214
|
}, RadioButtonBase.getOtherProps(props), ptm('root'));
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
215
|
+
var createInputElement = function createInputElement() {
|
|
216
|
+
var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
|
|
217
|
+
var inputProps = mergeProps(_objectSpread({
|
|
218
|
+
id: props.inputId,
|
|
219
|
+
type: 'radio',
|
|
220
|
+
name: props.name,
|
|
221
|
+
defaultChecked: props.checked,
|
|
222
|
+
onFocus: onFocus,
|
|
223
|
+
onBlur: onBlur,
|
|
224
|
+
onChange: onChange,
|
|
225
|
+
disabled: props.disabled,
|
|
226
|
+
readonly: props.readonly,
|
|
227
|
+
required: props.required,
|
|
228
|
+
tabIndex: props.tabIndex,
|
|
229
|
+
className: cx('input')
|
|
230
|
+
}, ariaProps), ptm('input'));
|
|
231
|
+
return /*#__PURE__*/React.createElement("input", _extends({
|
|
232
|
+
ref: inputRef
|
|
233
|
+
}, inputProps));
|
|
234
|
+
};
|
|
235
|
+
var createBoxElement = function createBoxElement() {
|
|
236
|
+
var boxProps = mergeProps({
|
|
237
|
+
className: cx('box')
|
|
238
|
+
}, ptm('box'));
|
|
239
|
+
var iconProps = mergeProps({
|
|
240
|
+
className: cx('icon')
|
|
241
|
+
}, ptm('icon'));
|
|
242
|
+
return /*#__PURE__*/React.createElement("div", boxProps, /*#__PURE__*/React.createElement("div", iconProps));
|
|
243
|
+
};
|
|
315
244
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
316
|
-
id: props.id,
|
|
317
245
|
ref: elementRef
|
|
318
|
-
}, rootProps),
|
|
319
|
-
id: props.inputId,
|
|
320
|
-
ref: inputRef
|
|
321
|
-
}, hiddenInputProps))), /*#__PURE__*/React.createElement("div", inputProps, /*#__PURE__*/React.createElement("div", iconProps))), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
246
|
+
}, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
322
247
|
target: elementRef,
|
|
323
248
|
content: props.tooltip,
|
|
324
249
|
pt: ptm('tooltip')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{ComponentBase as n,useHandleStyle as r}from"primereact/componentbase";import{useMergeProps as o,useMountEffect as i}from"primereact/hooks";import{Tooltip as
|
|
1
|
+
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{ComponentBase as n,useHandleStyle as r}from"primereact/componentbase";import{useMergeProps as o,useMountEffect as i}from"primereact/hooks";import{Tooltip as u}from"primereact/tooltip";import{classNames as c,DomHandler as a,ObjectUtils as l}from"primereact/utils";function p(){return p=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},p.apply(this,arguments)}function s(e){return s="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},s(e)}function d(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function f(e){var t=d(e,"string");return"symbol"===s(t)?t:String(t)}var m=n.extend({defaultProps:{__TYPE:"RadioButton",autoFocus:!1,checked:!1,className:null,disabled:!1,id:null,inputId:null,inputRef:null,invalid:!1,name:null,onChange:null,onClick:null,required:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,value:null,children:void 0},css:{classes:{root:function(e){var t=e.props;return c("p-radiobutton p-component",{"p-highlight":t.checked,"p-disabled":t.disabled,"p-invalid":t.invalid})},box:"p-radiobutton-box",input:"p-radiobutton-input",icon:"p-radiobutton-icon"}}});function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){var r,o,i;r=e,i=n[t],(o=f(o=t))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=e.memo(e.forwardRef((function(n,s){var d=o(),f=e.useContext(t),b=m.getProps(n,f),y=e.useRef(null),g=e.useRef(b.inputRef),h=m.setMetaData({props:b}),O=h.ptm,P=h.cx;r(m.css.styles,h.isUnstyled,{name:"radiobutton"});var k=function(e){j(e)},j=function(e){if(!b.disabled&&!b.readonly&&b.onChange){var t,n,r=b.checked,o=e.target instanceof HTMLDivElement,i=e.target===g.current&&e.target.checked!==r,u=o&&a.hasClass(y.current,"p-radiobutton-checked")===r&&!r,c=!r,l={originalEvent:e,value:b.value,checked:c,stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{type:"radio",name:b.name,id:b.id,value:b.value,checked:c}};if(null==b||null===(t=b.onChange)||void 0===t||t.call(b,l),e.defaultPrevented)return;if(i||u)null==b||null===(n=b.onChange)||void 0===n||n.call(b,l),u&&(g.current.checked=c);a.focus(g.current)}},E=function(e){var t;null==b||null===(t=b.onFocus)||void 0===t||t.call(b,e)},R=function(e){var t;null==b||null===(t=b.onBlur)||void 0===t||t.call(b,e)};e.useImperativeHandle(s,(function(){return{props:b,select:k,focus:function(){return a.focus(g.current)},getElement:function(){return y.current},getInput:function(){return g.current}}})),e.useEffect((function(){g.current&&(g.current.checked=b.checked)}),[b.checked]),e.useEffect((function(){l.combinedRefs(g,b.inputRef)}),[g,b.inputRef]),i((function(){b.autoFocus&&a.focus(g.current,b.autoFocus)}));var w,x,S,C,N=l.isNotEmpty(b.tooltip),D=m.getOtherProps(b),I=d({id:b.id,className:c(b.className,P("root")),style:b.style,"data-p-checked":b.checked},m.getOtherProps(b),O("root"));return e.createElement(e.Fragment,null,e.createElement("div",p({ref:y},I),(S=l.reduceKeys(D,a.ARIA_PROPS),C=d(v({id:b.inputId,type:"radio",name:b.name,defaultChecked:b.checked,onFocus:E,onBlur:R,onChange:j,disabled:b.disabled,readonly:b.readonly,required:b.required,tabIndex:b.tabIndex,className:P("input")},S),O("input")),e.createElement("input",p({ref:g},C))),(w=d({className:P("box")},O("box")),x=d({className:P("icon")},O("icon")),e.createElement("div",w,e.createElement("div",x)))),N&&e.createElement(u,p({target:y,content:b.tooltip,pt:O("tooltip")},b.tooltipOptions)))})));y.displayName="RadioButton";export{y as RadioButton};
|
|
@@ -78,83 +78,19 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
|
|
|
78
78
|
return obj;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
function _arrayWithHoles(arr) {
|
|
82
|
-
if (Array.isArray(arr)) return arr;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function _iterableToArrayLimit(r, l) {
|
|
86
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
87
|
-
if (null != t) {
|
|
88
|
-
var e,
|
|
89
|
-
n,
|
|
90
|
-
i,
|
|
91
|
-
u,
|
|
92
|
-
a = [],
|
|
93
|
-
f = !0,
|
|
94
|
-
o = !1;
|
|
95
|
-
try {
|
|
96
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
97
|
-
if (Object(t) !== t) return;
|
|
98
|
-
f = !1;
|
|
99
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
100
|
-
} catch (r) {
|
|
101
|
-
o = !0, n = r;
|
|
102
|
-
} finally {
|
|
103
|
-
try {
|
|
104
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
105
|
-
} finally {
|
|
106
|
-
if (o) throw n;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return a;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function _arrayLikeToArray(arr, len) {
|
|
114
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
115
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
116
|
-
return arr2;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
120
|
-
if (!o) return;
|
|
121
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
122
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
123
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
124
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
125
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function _nonIterableRest() {
|
|
129
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function _slicedToArray(arr, i) {
|
|
133
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
134
|
-
}
|
|
135
|
-
|
|
136
81
|
var classes = {
|
|
137
82
|
root: function root(_ref) {
|
|
138
|
-
var props = _ref.props
|
|
139
|
-
focusedState = _ref.focusedState;
|
|
83
|
+
var props = _ref.props;
|
|
140
84
|
return utils.classNames('p-radiobutton p-component', {
|
|
141
|
-
'p-radiobutton-checked': props.checked,
|
|
142
|
-
'p-radiobutton-disabled': props.disabled,
|
|
143
|
-
'p-radiobutton-focused': focusedState
|
|
144
|
-
});
|
|
145
|
-
},
|
|
146
|
-
input: function input(_ref2) {
|
|
147
|
-
var props = _ref2.props,
|
|
148
|
-
focusedState = _ref2.focusedState;
|
|
149
|
-
return utils.classNames('p-radiobutton-box', {
|
|
150
85
|
'p-highlight': props.checked,
|
|
151
86
|
'p-disabled': props.disabled,
|
|
152
|
-
'p-
|
|
87
|
+
'p-invalid': props.invalid
|
|
153
88
|
});
|
|
154
89
|
},
|
|
90
|
+
box: 'p-radiobutton-box',
|
|
91
|
+
input: 'p-radiobutton-input',
|
|
155
92
|
icon: 'p-radiobutton-icon'
|
|
156
93
|
};
|
|
157
|
-
var styles = "\n@layer primereact {\n .p-radiobutton {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n vertical-align: bottom;\n }\n \n .p-radiobutton-box {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .p-radiobutton-icon {\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n transform: translateZ(0) scale(.1);\n border-radius: 50%;\n visibility: hidden;\n }\n \n .p-radiobutton-box.p-highlight .p-radiobutton-icon {\n transform: translateZ(0) scale(1.0, 1.0);\n visibility: visible;\n }\n}\n";
|
|
158
94
|
var RadioButtonBase = componentbase.ComponentBase.extend({
|
|
159
95
|
defaultProps: {
|
|
160
96
|
__TYPE: 'RadioButton',
|
|
@@ -165,6 +101,7 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
|
|
|
165
101
|
id: null,
|
|
166
102
|
inputId: null,
|
|
167
103
|
inputRef: null,
|
|
104
|
+
invalid: false,
|
|
168
105
|
name: null,
|
|
169
106
|
onChange: null,
|
|
170
107
|
onClick: null,
|
|
@@ -177,8 +114,7 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
|
|
|
177
114
|
children: undefined
|
|
178
115
|
},
|
|
179
116
|
css: {
|
|
180
|
-
classes: classes
|
|
181
|
-
styles: styles
|
|
117
|
+
classes: classes
|
|
182
118
|
}
|
|
183
119
|
});
|
|
184
120
|
|
|
@@ -188,33 +124,26 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
|
|
|
188
124
|
var mergeProps = hooks.useMergeProps();
|
|
189
125
|
var context = React__namespace.useContext(api.PrimeReactContext);
|
|
190
126
|
var props = RadioButtonBase.getProps(inProps, context);
|
|
191
|
-
var _React$useState = React__namespace.useState(false),
|
|
192
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
193
|
-
focusedState = _React$useState2[0],
|
|
194
|
-
setFocusedState = _React$useState2[1];
|
|
195
127
|
var elementRef = React__namespace.useRef(null);
|
|
196
128
|
var inputRef = React__namespace.useRef(props.inputRef);
|
|
197
129
|
var _RadioButtonBase$setM = RadioButtonBase.setMetaData({
|
|
198
|
-
props: props
|
|
199
|
-
state: {
|
|
200
|
-
focused: focusedState
|
|
201
|
-
}
|
|
130
|
+
props: props
|
|
202
131
|
}),
|
|
203
132
|
ptm = _RadioButtonBase$setM.ptm,
|
|
204
133
|
cx = _RadioButtonBase$setM.cx,
|
|
205
134
|
isUnstyled = _RadioButtonBase$setM.isUnstyled;
|
|
206
135
|
componentbase.useHandleStyle(RadioButtonBase.css.styles, isUnstyled, {
|
|
207
|
-
name: 'radiobutton'
|
|
208
|
-
styled: true
|
|
136
|
+
name: 'radiobutton'
|
|
209
137
|
});
|
|
210
138
|
var select = function select(event) {
|
|
211
|
-
|
|
139
|
+
onChange(event);
|
|
212
140
|
};
|
|
213
|
-
var
|
|
214
|
-
if (props.disabled) {
|
|
141
|
+
var onChange = function onChange(event) {
|
|
142
|
+
if (props.disabled || props.readonly) {
|
|
215
143
|
return;
|
|
216
144
|
}
|
|
217
|
-
if (props.onChange
|
|
145
|
+
if (props.onChange) {
|
|
146
|
+
var _props$onChange;
|
|
218
147
|
var checked = props.checked;
|
|
219
148
|
var radioClicked = event.target instanceof HTMLDivElement;
|
|
220
149
|
var inputClicked = event.target === inputRef.current;
|
|
@@ -239,47 +168,30 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
|
|
|
239
168
|
checked: value
|
|
240
169
|
}
|
|
241
170
|
};
|
|
242
|
-
props
|
|
171
|
+
props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, eventData);
|
|
243
172
|
|
|
244
173
|
// do not continue if the user defined click wants to prevent
|
|
245
174
|
if (event.defaultPrevented) {
|
|
246
175
|
return;
|
|
247
176
|
}
|
|
248
177
|
if (isInputToggled || isRadioToggled) {
|
|
249
|
-
|
|
178
|
+
var _props$onChange2;
|
|
179
|
+
props === null || props === void 0 || (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, eventData);
|
|
250
180
|
if (isRadioToggled) {
|
|
251
181
|
inputRef.current.checked = value;
|
|
252
182
|
}
|
|
253
183
|
}
|
|
254
184
|
utils.DomHandler.focus(inputRef.current);
|
|
255
|
-
event.preventDefault();
|
|
256
185
|
}
|
|
257
186
|
};
|
|
258
|
-
var onFocus = function onFocus() {
|
|
259
|
-
|
|
187
|
+
var onFocus = function onFocus(event) {
|
|
188
|
+
var _props$onFocus;
|
|
189
|
+
props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
260
190
|
};
|
|
261
|
-
var onBlur = function onBlur() {
|
|
262
|
-
|
|
191
|
+
var onBlur = function onBlur(event) {
|
|
192
|
+
var _props$onBlur;
|
|
193
|
+
props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, event);
|
|
263
194
|
};
|
|
264
|
-
var onKeyDown = function onKeyDown(event) {
|
|
265
|
-
if (event.code === 'Space' || event.key === ' ') {
|
|
266
|
-
// event.key is for Android support
|
|
267
|
-
onClick(event);
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
React__namespace.useEffect(function () {
|
|
271
|
-
if (inputRef.current) {
|
|
272
|
-
inputRef.current.checked = props.checked;
|
|
273
|
-
}
|
|
274
|
-
}, [props.checked]);
|
|
275
|
-
React__namespace.useEffect(function () {
|
|
276
|
-
utils.ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
277
|
-
}, [inputRef, props.inputRef]);
|
|
278
|
-
hooks.useMountEffect(function () {
|
|
279
|
-
if (props.autoFocus) {
|
|
280
|
-
utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
195
|
React__namespace.useImperativeHandle(ref, function () {
|
|
284
196
|
return {
|
|
285
197
|
props: props,
|
|
@@ -295,46 +207,59 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
|
|
|
295
207
|
}
|
|
296
208
|
};
|
|
297
209
|
});
|
|
210
|
+
React__namespace.useEffect(function () {
|
|
211
|
+
if (inputRef.current) {
|
|
212
|
+
inputRef.current.checked = props.checked;
|
|
213
|
+
}
|
|
214
|
+
}, [props.checked]);
|
|
215
|
+
React__namespace.useEffect(function () {
|
|
216
|
+
utils.ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
217
|
+
}, [inputRef, props.inputRef]);
|
|
218
|
+
hooks.useMountEffect(function () {
|
|
219
|
+
if (props.autoFocus) {
|
|
220
|
+
utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
298
223
|
var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
|
|
299
224
|
var otherProps = RadioButtonBase.getOtherProps(props);
|
|
300
|
-
var ariaProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.ARIA_PROPS);
|
|
301
225
|
var rootProps = mergeProps({
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
})),
|
|
226
|
+
id: props.id,
|
|
227
|
+
className: utils.classNames(props.className, cx('root')),
|
|
305
228
|
style: props.style,
|
|
306
|
-
onClick: onClick,
|
|
307
229
|
'data-p-checked': props.checked
|
|
308
230
|
}, RadioButtonBase.getOtherProps(props), ptm('root'));
|
|
309
|
-
var
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
231
|
+
var createInputElement = function createInputElement() {
|
|
232
|
+
var ariaProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.ARIA_PROPS);
|
|
233
|
+
var inputProps = mergeProps(_objectSpread({
|
|
234
|
+
id: props.inputId,
|
|
235
|
+
type: 'radio',
|
|
236
|
+
name: props.name,
|
|
237
|
+
defaultChecked: props.checked,
|
|
238
|
+
onFocus: onFocus,
|
|
239
|
+
onBlur: onBlur,
|
|
240
|
+
onChange: onChange,
|
|
241
|
+
disabled: props.disabled,
|
|
242
|
+
readonly: props.readonly,
|
|
243
|
+
required: props.required,
|
|
244
|
+
tabIndex: props.tabIndex,
|
|
245
|
+
className: cx('input')
|
|
246
|
+
}, ariaProps), ptm('input'));
|
|
247
|
+
return /*#__PURE__*/React__namespace.createElement("input", _extends({
|
|
248
|
+
ref: inputRef
|
|
249
|
+
}, inputProps));
|
|
250
|
+
};
|
|
251
|
+
var createBoxElement = function createBoxElement() {
|
|
252
|
+
var boxProps = mergeProps({
|
|
253
|
+
className: cx('box')
|
|
254
|
+
}, ptm('box'));
|
|
255
|
+
var iconProps = mergeProps({
|
|
256
|
+
className: cx('icon')
|
|
257
|
+
}, ptm('icon'));
|
|
258
|
+
return /*#__PURE__*/React__namespace.createElement("div", boxProps, /*#__PURE__*/React__namespace.createElement("div", iconProps));
|
|
259
|
+
};
|
|
331
260
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
332
|
-
id: props.id,
|
|
333
261
|
ref: elementRef
|
|
334
|
-
}, rootProps),
|
|
335
|
-
id: props.inputId,
|
|
336
|
-
ref: inputRef
|
|
337
|
-
}, hiddenInputProps))), /*#__PURE__*/React__namespace.createElement("div", inputProps, /*#__PURE__*/React__namespace.createElement("div", iconProps))), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
|
|
262
|
+
}, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
|
|
338
263
|
target: elementRef,
|
|
339
264
|
content: props.tooltip,
|
|
340
265
|
pt: ptm('tooltip')
|