primereact 9.3.1 → 9.5.0
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/README.md +18 -31
- package/accordion/accordion.cjs.js +88 -90
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +90 -1
- package/accordion/accordion.esm.js +89 -91
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +89 -92
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +1 -0
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +7 -6
- package/api/api.esm.js +1 -0
- package/api/api.esm.min.js +1 -1
- package/api/api.js +1 -0
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +33 -11
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +4 -0
- package/autocomplete/autocomplete.esm.js +33 -11
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +32 -10
- package/autocomplete/autocomplete.min.css +1 -1
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +71 -22
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +37 -1
- package/avatar/avatar.esm.js +72 -23
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +72 -24
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +26 -42
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.d.ts +24 -0
- package/avatargroup/avatargroup.esm.js +13 -29
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +52 -69
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +12 -28
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.d.ts +26 -0
- package/badge/badge.esm.js +13 -29
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +13 -30
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +12 -28
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.d.ts +38 -0
- package/blockui/blockui.esm.js +13 -29
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +13 -30
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +87 -49
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.d.ts +53 -1
- package/breadcrumb/breadcrumb.esm.js +88 -50
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +88 -51
- package/breadcrumb/breadcrumb.min.css +1 -1
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +49 -42
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +42 -1
- package/button/button.esm.js +50 -43
- package/button/button.esm.min.js +1 -1
- package/button/button.js +49 -43
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +37 -23
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +5 -2
- package/calendar/calendar.esm.js +37 -23
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +34 -20
- package/calendar/calendar.min.js +1 -1
- package/card/card.cjs.js +52 -63
- package/card/card.cjs.min.js +1 -1
- package/card/card.d.ts +56 -0
- package/card/card.esm.js +39 -50
- package/card/card.esm.min.js +1 -1
- package/card/card.js +86 -98
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +151 -110
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.d.ts +113 -1
- package/carousel/carousel.esm.js +151 -110
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +148 -108
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +27 -23
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +5 -0
- package/cascadeselect/cascadeselect.esm.js +27 -23
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +28 -24
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +31 -42
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.d.ts +35 -0
- package/chart/chart.esm.js +18 -29
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +140 -152
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +40 -19
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +19 -1
- package/checkbox/checkbox.esm.js +41 -20
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +41 -20
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +45 -42
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +53 -1
- package/chip/chip.esm.js +46 -43
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +46 -44
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +37 -22
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +5 -0
- package/chips/chips.esm.js +37 -22
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +37 -23
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +11 -4
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +13 -0
- package/colorpicker/colorpicker.esm.js +11 -4
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +11 -4
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.d.ts +6 -2
- package/componentbase/componentbase.cjs.js +105 -0
- package/componentbase/componentbase.cjs.min.js +1 -0
- package/componentbase/componentbase.esm.js +101 -0
- package/componentbase/componentbase.esm.min.js +1 -0
- package/componentbase/componentbase.js +109 -0
- package/componentbase/componentbase.min.js +1 -0
- package/componentbase/package.json +6 -0
- package/confirmdialog/confirmdialog.cjs.js +44 -27
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +90 -2
- package/confirmdialog/confirmdialog.esm.js +45 -28
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +45 -29
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +53 -50
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +70 -1
- package/confirmpopup/confirmpopup.esm.js +54 -51
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +54 -52
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +111 -61
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +92 -1
- package/contextmenu/contextmenu.esm.js +112 -62
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +112 -63
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +16510 -5273
- package/core/core.min.js +41 -39
- package/datatable/datatable.cjs.js +253 -210
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +20 -7
- package/datatable/datatable.esm.js +253 -210
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +246 -203
- package/datatable/datatable.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +13 -26
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.d.ts +38 -0
- package/deferredcontent/deferredcontent.esm.js +14 -27
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +14 -28
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +83 -83
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +85 -3
- package/dialog/dialog.esm.js +83 -83
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +81 -82
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +35 -51
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.d.ts +30 -0
- package/divider/divider.esm.js +22 -38
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +66 -83
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +82 -45
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +66 -0
- package/dock/dock.esm.js +83 -46
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +83 -47
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +46 -20
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +6 -1
- package/dropdown/dropdown.esm.js +46 -20
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +45 -19
- package/dropdown/dropdown.min.js +1 -1
- package/fieldset/fieldset.cjs.js +55 -54
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +77 -1
- package/fieldset/fieldset.esm.js +56 -55
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +56 -56
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +181 -151
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +150 -1
- package/fileupload/fileupload.esm.js +182 -152
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +182 -153
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +136 -118
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +156 -2
- package/galleria/galleria.esm.js +137 -119
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +135 -118
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +20 -3
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +17 -3
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +21 -5
- package/hooks/hooks.min.js +1 -1
- package/icons/arrowdown/index.cjs.js +410 -2
- package/icons/arrowdown/index.cjs.min.js +1 -1
- package/icons/arrowdown/index.esm.js +410 -2
- package/icons/arrowdown/index.esm.min.js +1 -1
- package/icons/arrowdown/index.js +410 -2
- package/icons/arrowdown/index.min.js +1 -1
- package/icons/arrowup/index.cjs.js +410 -2
- package/icons/arrowup/index.cjs.min.js +1 -1
- package/icons/arrowup/index.esm.js +410 -2
- package/icons/arrowup/index.esm.min.js +1 -1
- package/icons/arrowup/index.js +410 -2
- package/icons/arrowup/index.min.js +1 -1
- package/icons/ban/index.cjs.js +410 -2
- package/icons/ban/index.cjs.min.js +1 -1
- package/icons/ban/index.esm.js +410 -2
- package/icons/ban/index.esm.min.js +1 -1
- package/icons/ban/index.js +410 -2
- package/icons/ban/index.min.js +1 -1
- package/icons/download/index.cjs.js +410 -2
- package/icons/download/index.cjs.min.js +1 -1
- package/icons/download/index.esm.js +410 -2
- package/icons/download/index.esm.min.js +1 -1
- package/icons/download/index.js +410 -2
- package/icons/download/index.min.js +1 -1
- package/icons/exclamationtriangle/index.cjs.js +410 -2
- package/icons/exclamationtriangle/index.cjs.min.js +1 -1
- package/icons/exclamationtriangle/index.esm.js +410 -2
- package/icons/exclamationtriangle/index.esm.min.js +1 -1
- package/icons/exclamationtriangle/index.js +410 -2
- package/icons/exclamationtriangle/index.min.js +1 -1
- package/icons/eyeslash/index.cjs.js +410 -2
- package/icons/eyeslash/index.cjs.min.js +1 -1
- package/icons/eyeslash/index.esm.js +410 -2
- package/icons/eyeslash/index.esm.min.js +1 -1
- package/icons/eyeslash/index.js +410 -2
- package/icons/eyeslash/index.min.js +1 -1
- package/icons/filter/index.cjs.js +410 -2
- package/icons/filter/index.cjs.min.js +1 -1
- package/icons/filter/index.esm.js +410 -2
- package/icons/filter/index.esm.min.js +1 -1
- package/icons/filter/index.js +410 -2
- package/icons/filter/index.min.js +1 -1
- package/icons/filterslash/index.cjs.js +410 -2
- package/icons/filterslash/index.cjs.min.js +1 -1
- package/icons/filterslash/index.esm.js +410 -2
- package/icons/filterslash/index.esm.min.js +1 -1
- package/icons/filterslash/index.js +410 -2
- package/icons/filterslash/index.min.js +1 -1
- package/icons/infocircle/index.cjs.js +410 -2
- package/icons/infocircle/index.cjs.min.js +1 -1
- package/icons/infocircle/index.esm.js +410 -2
- package/icons/infocircle/index.esm.min.js +1 -1
- package/icons/infocircle/index.js +410 -2
- package/icons/infocircle/index.min.js +1 -1
- package/icons/pencil/index.cjs.js +410 -2
- package/icons/pencil/index.cjs.min.js +1 -1
- package/icons/pencil/index.esm.js +410 -2
- package/icons/pencil/index.esm.min.js +1 -1
- package/icons/pencil/index.js +410 -2
- package/icons/pencil/index.min.js +1 -1
- package/icons/plus/index.cjs.js +410 -2
- package/icons/plus/index.cjs.min.js +1 -1
- package/icons/plus/index.esm.js +410 -2
- package/icons/plus/index.esm.min.js +1 -1
- package/icons/plus/index.js +410 -2
- package/icons/plus/index.min.js +1 -1
- package/icons/refresh/index.cjs.js +410 -2
- package/icons/refresh/index.cjs.min.js +1 -1
- package/icons/refresh/index.esm.js +410 -2
- package/icons/refresh/index.esm.min.js +1 -1
- package/icons/refresh/index.js +410 -2
- package/icons/refresh/index.min.js +1 -1
- package/icons/search/index.cjs.js +410 -2
- package/icons/search/index.cjs.min.js +1 -1
- package/icons/search/index.esm.js +410 -2
- package/icons/search/index.esm.min.js +1 -1
- package/icons/search/index.js +410 -2
- package/icons/search/index.min.js +1 -1
- package/icons/searchminus/index.cjs.js +410 -2
- package/icons/searchminus/index.cjs.min.js +1 -1
- package/icons/searchminus/index.esm.js +410 -2
- package/icons/searchminus/index.esm.min.js +1 -1
- package/icons/searchminus/index.js +410 -2
- package/icons/searchminus/index.min.js +1 -1
- package/icons/searchplus/index.cjs.js +410 -2
- package/icons/searchplus/index.cjs.min.js +1 -1
- package/icons/searchplus/index.esm.js +410 -2
- package/icons/searchplus/index.esm.min.js +1 -1
- package/icons/searchplus/index.js +410 -2
- package/icons/searchplus/index.min.js +1 -1
- package/icons/sortalt/index.cjs.js +410 -2
- package/icons/sortalt/index.cjs.min.js +1 -1
- package/icons/sortalt/index.esm.js +410 -2
- package/icons/sortalt/index.esm.min.js +1 -1
- package/icons/sortalt/index.js +410 -2
- package/icons/sortalt/index.min.js +1 -1
- package/icons/sortamountdown/index.cjs.js +410 -2
- package/icons/sortamountdown/index.cjs.min.js +1 -1
- package/icons/sortamountdown/index.esm.js +410 -2
- package/icons/sortamountdown/index.esm.min.js +1 -1
- package/icons/sortamountdown/index.js +410 -2
- package/icons/sortamountdown/index.min.js +1 -1
- package/icons/sortamountupalt/index.cjs.js +410 -2
- package/icons/sortamountupalt/index.cjs.min.js +1 -1
- package/icons/sortamountupalt/index.esm.js +410 -2
- package/icons/sortamountupalt/index.esm.min.js +1 -1
- package/icons/sortamountupalt/index.js +410 -2
- package/icons/sortamountupalt/index.min.js +1 -1
- package/icons/spinner/index.cjs.js +410 -2
- package/icons/spinner/index.cjs.min.js +1 -1
- package/icons/spinner/index.esm.js +410 -2
- package/icons/spinner/index.esm.min.js +1 -1
- package/icons/spinner/index.js +410 -2
- package/icons/spinner/index.min.js +1 -1
- package/icons/star/index.cjs.js +410 -2
- package/icons/star/index.cjs.min.js +1 -1
- package/icons/star/index.esm.js +410 -2
- package/icons/star/index.esm.min.js +1 -1
- package/icons/star/index.js +410 -2
- package/icons/star/index.min.js +1 -1
- package/icons/starfill/index.cjs.js +410 -2
- package/icons/starfill/index.cjs.min.js +1 -1
- package/icons/starfill/index.esm.js +410 -2
- package/icons/starfill/index.esm.min.js +1 -1
- package/icons/starfill/index.js +410 -2
- package/icons/starfill/index.min.js +1 -1
- package/icons/thlarge/index.cjs.js +410 -2
- package/icons/thlarge/index.cjs.min.js +1 -1
- package/icons/thlarge/index.esm.js +410 -2
- package/icons/thlarge/index.esm.min.js +1 -1
- package/icons/thlarge/index.js +410 -2
- package/icons/thlarge/index.min.js +1 -1
- package/icons/timescircle/index.cjs.js +410 -2
- package/icons/timescircle/index.cjs.min.js +1 -1
- package/icons/timescircle/index.esm.js +410 -2
- package/icons/timescircle/index.esm.min.js +1 -1
- package/icons/timescircle/index.js +410 -2
- package/icons/timescircle/index.min.js +1 -1
- package/icons/trash/index.cjs.js +410 -2
- package/icons/trash/index.cjs.min.js +1 -1
- package/icons/trash/index.esm.js +410 -2
- package/icons/trash/index.esm.min.js +1 -1
- package/icons/trash/index.js +410 -2
- package/icons/trash/index.min.js +1 -1
- package/icons/undo/index.cjs.js +410 -2
- package/icons/undo/index.cjs.min.js +1 -1
- package/icons/undo/index.esm.js +410 -2
- package/icons/undo/index.esm.min.js +1 -1
- package/icons/undo/index.js +410 -2
- package/icons/undo/index.min.js +1 -1
- package/icons/upload/index.cjs.js +410 -2
- package/icons/upload/index.cjs.min.js +1 -1
- package/icons/upload/index.esm.js +410 -2
- package/icons/upload/index.esm.min.js +1 -1
- package/icons/upload/index.js +410 -2
- package/icons/upload/index.min.js +1 -1
- package/icons/windowmaximize/index.cjs.js +410 -2
- package/icons/windowmaximize/index.cjs.min.js +1 -1
- package/icons/windowmaximize/index.esm.js +410 -2
- package/icons/windowmaximize/index.esm.min.js +1 -1
- package/icons/windowmaximize/index.js +410 -2
- package/icons/windowmaximize/index.min.js +1 -1
- package/icons/windowminimize/index.cjs.js +410 -2
- package/icons/windowminimize/index.cjs.min.js +1 -1
- package/icons/windowminimize/index.esm.js +410 -2
- package/icons/windowminimize/index.esm.min.js +1 -1
- package/icons/windowminimize/index.js +410 -2
- package/icons/windowminimize/index.min.js +1 -1
- package/image/image.cjs.js +506 -103
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +130 -3
- package/image/image.esm.js +507 -104
- package/image/image.esm.min.js +1 -1
- package/image/image.js +503 -101
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +33 -51
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.d.ts +51 -1
- package/inplace/inplace.esm.js +33 -51
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +33 -52
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +24 -18
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +24 -18
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +24 -18
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +8 -6
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +8 -6
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +8 -6
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +13 -2
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.d.ts +5 -0
- package/inputswitch/inputswitch.esm.js +13 -2
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +14 -4
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +7 -8
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +7 -8
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +7 -8
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +3 -4
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.esm.js +3 -4
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +3 -4
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/listbox/listbox.cjs.js +12 -4
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +12 -4
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +12 -4
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +147 -96
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.d.ts +142 -2
- package/megamenu/megamenu.esm.js +147 -96
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +145 -95
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +3 -4
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +3 -4
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +3 -4
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +94 -55
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +71 -0
- package/menu/menu.esm.js +95 -56
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +95 -57
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +118 -110
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.d.ts +94 -1
- package/menubar/menubar.esm.js +119 -111
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +119 -112
- package/menubar/menubar.min.js +1 -1
- package/menuitem/menuitem.d.ts +0 -2
- package/message/message.cjs.js +66 -46
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +35 -2
- package/message/message.esm.js +67 -47
- package/message/message.esm.min.js +1 -1
- package/message/message.js +67 -48
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +78 -74
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +51 -2
- package/messages/messages.esm.js +78 -74
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +78 -75
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +74 -47
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +9 -0
- package/multiselect/multiselect.esm.js +75 -48
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +73 -46
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +21 -13
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +5 -0
- package/multistatecheckbox/multistatecheckbox.esm.js +21 -13
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +21 -13
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/organizationchart/organizationchart.d.ts +18 -2
- package/overlaypanel/overlaypanel.cjs.js +40 -46
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +45 -1
- package/overlaypanel/overlaypanel.esm.js +41 -47
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +41 -48
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.d.ts +3 -3
- package/panel/panel.cjs.js +78 -63
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +100 -1
- package/panel/panel.esm.js +79 -64
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +79 -65
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +145 -83
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +124 -2
- package/panelmenu/panelmenu.esm.js +145 -83
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +144 -83
- package/panelmenu/panelmenu.min.js +1 -1
- package/primereact.all.cjs.js +4240 -3058
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +4240 -3059
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +4240 -3058
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +45 -57
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.d.ts +38 -0
- package/progressbar/progressbar.esm.js +32 -44
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +105 -118
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +37 -51
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.d.ts +34 -0
- package/progressspinner/progressspinner.esm.js +24 -38
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +75 -90
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +42 -20
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.d.ts +19 -1
- package/radiobutton/radiobutton.esm.js +42 -20
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +43 -22
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +15 -7
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +15 -7
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +14 -6
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +195 -187
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +16 -7
- package/resources/themes/arya-green/theme.css +16 -7
- package/resources/themes/arya-orange/theme.css +16 -7
- package/resources/themes/arya-purple/theme.css +16 -7
- package/resources/themes/bootstrap4-dark-blue/theme.css +16 -7
- package/resources/themes/bootstrap4-dark-purple/theme.css +16 -7
- package/resources/themes/bootstrap4-light-blue/theme.css +16 -7
- package/resources/themes/bootstrap4-light-purple/theme.css +16 -7
- package/resources/themes/fluent-light/theme.css +16 -7
- package/resources/themes/lara-dark-blue/theme.css +16 -7
- package/resources/themes/lara-dark-indigo/theme.css +16 -7
- package/resources/themes/lara-dark-purple/theme.css +16 -7
- package/resources/themes/lara-dark-teal/theme.css +16 -7
- package/resources/themes/lara-light-blue/theme.css +16 -7
- package/resources/themes/lara-light-indigo/theme.css +16 -7
- package/resources/themes/lara-light-purple/theme.css +16 -7
- package/resources/themes/lara-light-teal/theme.css +16 -7
- package/resources/themes/luna-amber/theme.css +16 -7
- package/resources/themes/luna-blue/theme.css +16 -7
- package/resources/themes/luna-green/theme.css +16 -7
- package/resources/themes/luna-pink/theme.css +16 -7
- package/resources/themes/md-dark-deeppurple/theme.css +16 -7
- package/resources/themes/md-dark-indigo/theme.css +16 -7
- package/resources/themes/md-light-deeppurple/theme.css +16 -7
- package/resources/themes/md-light-indigo/theme.css +16 -7
- package/resources/themes/mdc-dark-deeppurple/theme.css +16 -7
- package/resources/themes/mdc-dark-indigo/theme.css +16 -7
- package/resources/themes/mdc-light-deeppurple/theme.css +16 -7
- package/resources/themes/mdc-light-indigo/theme.css +16 -7
- package/resources/themes/mira/theme.css +16 -7
- package/resources/themes/nano/theme.css +16 -7
- package/resources/themes/nova/theme.css +16 -7
- package/resources/themes/nova-accent/theme.css +16 -7
- package/resources/themes/nova-alt/theme.css +16 -7
- package/resources/themes/rhea/theme.css +16 -7
- package/resources/themes/saga-blue/theme.css +16 -7
- package/resources/themes/saga-green/theme.css +16 -7
- package/resources/themes/saga-orange/theme.css +16 -7
- package/resources/themes/saga-purple/theme.css +16 -7
- package/resources/themes/soho-dark/theme.css +16 -7
- package/resources/themes/soho-light/theme.css +16 -7
- package/resources/themes/tailwind-light/theme.css +16 -7
- package/resources/themes/vela-blue/theme.css +16 -7
- package/resources/themes/vela-green/theme.css +16 -7
- package/resources/themes/vela-orange/theme.css +16 -7
- package/resources/themes/vela-purple/theme.css +16 -7
- package/resources/themes/viva-dark/theme.css +16 -7
- package/resources/themes/viva-light/theme.css +16 -7
- package/scrollpanel/scrollpanel.cjs.js +39 -52
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.d.ts +42 -0
- package/scrollpanel/scrollpanel.esm.js +26 -39
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +193 -207
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +64 -36
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +42 -1
- package/scrolltop/scrolltop.esm.js +65 -37
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +65 -38
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +6 -2
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +6 -2
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +6 -2
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/sidebar.cjs.js +88 -52
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +58 -1
- package/sidebar/sidebar.esm.js +89 -53
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +89 -54
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +26 -42
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.d.ts +26 -0
- package/skeleton/skeleton.esm.js +13 -29
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +70 -87
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +121 -111
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +98 -1
- package/slidemenu/slidemenu.esm.js +122 -112
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +122 -113
- package/slidemenu/slidemenu.min.js +1 -1
- package/speeddial/speeddial.cjs.js +63 -56
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +64 -1
- package/speeddial/speeddial.esm.js +64 -57
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +62 -56
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +50 -40
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +59 -1
- package/splitbutton/splitbutton.esm.js +51 -41
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +50 -41
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +68 -70
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.d.ts +60 -0
- package/splitter/splitter.esm.js +69 -71
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +69 -72
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +78 -45
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.d.ts +50 -0
- package/steps/steps.esm.js +79 -46
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +79 -47
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +9 -7
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +9 -7
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +9 -7
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +83 -47
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.d.ts +62 -0
- package/tabmenu/tabmenu.esm.js +84 -48
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +84 -49
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +142 -122
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +132 -1
- package/tabview/tabview.esm.js +143 -123
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +143 -124
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +18 -30
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +34 -1
- package/tag/tag.esm.js +19 -31
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +19 -32
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +49 -52
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.d.ts +73 -0
- package/terminal/terminal.esm.js +50 -53
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +50 -54
- package/terminal/terminal.min.js +1 -1
- package/terminalservice/terminalservice.d.ts +1 -1
- package/tieredmenu/tieredmenu.cjs.js +104 -59
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +83 -2
- package/tieredmenu/tieredmenu.esm.js +105 -60
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +105 -61
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.d.ts +1 -1
- package/toast/toast.cjs.js +85 -81
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +124 -2
- package/toast/toast.esm.js +86 -82
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +83 -80
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +12 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +12 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +13 -4
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +35 -49
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.d.ts +44 -0
- package/toolbar/toolbar.esm.js +22 -36
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +72 -87
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +31 -37
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +55 -0
- package/tooltip/tooltip.esm.js +32 -38
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +32 -39
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +5 -0
- package/tree/tree.d.ts +1 -1
- package/treenode/treenode.d.ts +5 -1
- package/treeselect/treeselect.cjs.js +12 -5
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +6 -1
- package/treeselect/treeselect.esm.js +12 -5
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +11 -4
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +10 -3
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +1 -1
- package/treetable/treetable.esm.js +10 -3
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +10 -3
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +22 -11
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.d.ts +5 -0
- package/tristatecheckbox/tristatecheckbox.esm.js +22 -11
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +21 -11
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +735 -676
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +5 -1
- package/utils/utils.esm.js +732 -677
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +736 -678
- package/utils/utils.min.js +1 -1
- package/web-types.json +13 -1
package/chart/chart.esm.js
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useUnmountEffect } from 'primereact/hooks';
|
|
3
|
-
import {
|
|
3
|
+
import { classNames, mergeProps } from 'primereact/utils';
|
|
4
|
+
import { ComponentBase } from 'primereact/componentbase';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
7
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
-
var source = arguments[i];
|
|
9
|
-
for (var key in source) {
|
|
10
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11
|
-
target[key] = source[key];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return target;
|
|
16
|
-
};
|
|
17
|
-
return _extends.apply(this, arguments);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var ChartBase = {
|
|
6
|
+
var ChartBase = ComponentBase.extend({
|
|
21
7
|
defaultProps: {
|
|
22
8
|
__TYPE: 'Chart',
|
|
23
9
|
id: null,
|
|
@@ -30,14 +16,8 @@ var ChartBase = {
|
|
|
30
16
|
style: null,
|
|
31
17
|
className: null,
|
|
32
18
|
children: undefined
|
|
33
|
-
},
|
|
34
|
-
getProps: function getProps(props) {
|
|
35
|
-
return ObjectUtils.getMergedProps(props, ChartBase.defaultProps);
|
|
36
|
-
},
|
|
37
|
-
getOtherProps: function getOtherProps(props) {
|
|
38
|
-
return ObjectUtils.getDiffProps(props, ChartBase.defaultProps);
|
|
39
19
|
}
|
|
40
|
-
};
|
|
20
|
+
});
|
|
41
21
|
|
|
42
22
|
// GitHub #3059 wrapper if loaded by script tag
|
|
43
23
|
var ChartJS = function () {
|
|
@@ -49,6 +29,10 @@ var ChartJS = function () {
|
|
|
49
29
|
}();
|
|
50
30
|
var PrimeReactChart = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
51
31
|
var props = ChartBase.getProps(inProps);
|
|
32
|
+
var _ChartBase$setMetaDat = ChartBase.setMetaData({
|
|
33
|
+
props: props
|
|
34
|
+
}),
|
|
35
|
+
ptm = _ChartBase$setMetaDat.ptm;
|
|
52
36
|
var elementRef = React.useRef(null);
|
|
53
37
|
var chartRef = React.useRef(null);
|
|
54
38
|
var canvasRef = React.useRef(null);
|
|
@@ -119,22 +103,27 @@ var PrimeReactChart = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
119
103
|
useUnmountEffect(function () {
|
|
120
104
|
destroyChart();
|
|
121
105
|
});
|
|
122
|
-
var otherProps = ChartBase.getOtherProps(props);
|
|
123
106
|
var className = classNames('p-chart', props.className);
|
|
124
107
|
var style = Object.assign({
|
|
125
108
|
width: props.width,
|
|
126
109
|
height: props.height
|
|
127
110
|
}, props.style);
|
|
128
|
-
|
|
111
|
+
var title = props.options && props.options.plugins && props.options.plugins.title && props.options.plugins.title.text;
|
|
112
|
+
var ariaLabel = props.ariaLabel || title;
|
|
113
|
+
var rootProps = mergeProps({
|
|
129
114
|
id: props.id,
|
|
130
115
|
ref: elementRef,
|
|
131
116
|
style: style,
|
|
132
117
|
className: className
|
|
133
|
-
},
|
|
118
|
+
}, ChartBase.getOtherProps(props), ptm('root'));
|
|
119
|
+
var canvasProps = mergeProps({
|
|
134
120
|
ref: canvasRef,
|
|
135
121
|
width: props.width,
|
|
136
|
-
height: props.height
|
|
137
|
-
|
|
122
|
+
height: props.height,
|
|
123
|
+
role: 'img',
|
|
124
|
+
'aria-label': ariaLabel
|
|
125
|
+
}, ptm('canvas'));
|
|
126
|
+
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement("canvas", canvasProps));
|
|
138
127
|
}), function (prevProps, nextProps) {
|
|
139
128
|
return prevProps.data === nextProps.data && prevProps.options === nextProps.options && prevProps.type === nextProps.type;
|
|
140
129
|
});
|
package/chart/chart.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"react";import{useUnmountEffect as e}from"primereact/hooks";import{
|
|
1
|
+
import*as t from"react";import{useUnmountEffect as e}from"primereact/hooks";import{classNames as r,mergeProps as n}from"primereact/utils";import{ComponentBase as u}from"primereact/componentbase";var a=u.extend({defaultProps:{__TYPE:"Chart",id:null,type:null,data:null,options:null,plugins:null,width:null,height:null,style:null,className:null,children:void 0}}),i=function(){try{return Chart}catch(t){return null}}(),o=t.memo(t.forwardRef((function(u,o){var l=a.getProps(u),c=a.setMetaData({props:l}).ptm,s=t.useRef(null),p=t.useRef(null),f=t.useRef(null),h=function(){d();var t={type:l.type,data:l.data,options:l.options,plugins:l.plugins};i?p.current=new i(f.current,t):import("chart.js/auto").then((function(e){d(),f.current&&e&&(p.current=e.default?new e.default(f.current,t):new e(f.current,t))}))},d=function(){p.current&&(p.current.destroy(),p.current=null)};t.useImperativeHandle(o,(function(){return{props:l,getCanvas:function(){return f.current},getChart:function(){return p.current},getBase64Image:function(){return p.current.toBase64Image()},getElement:function(){return s.current},generateLegend:function(){return p.current&&p.current.generateLegend()},refresh:function(){return p.current&&p.current.update()}}})),t.useEffect((function(){h()})),e((function(){d()}));var m=r("p-chart",l.className),g=Object.assign({width:l.width,height:l.height},l.style),y=l.ariaLabel||l.options&&l.options.plugins&&l.options.plugins.title&&l.options.plugins.title.text,v=n({id:l.id,ref:s,style:g,className:m},a.getOtherProps(l),c("root")),w=n({ref:f,width:l.width,height:l.height,role:"img","aria-label":y},c("canvas"));return t.createElement("div",v,t.createElement("canvas",w))})),(function(t,e){return t.data===e.data&&t.options===e.options&&t.type===e.type}));o.displayName="Chart";export{o as Chart};
|
package/chart/chart.js
CHANGED
|
@@ -1,169 +1,157 @@
|
|
|
1
1
|
this.primereact = this.primereact || {};
|
|
2
|
-
this.primereact.chart = (function (exports, React, hooks, utils) {
|
|
3
|
-
|
|
2
|
+
this.primereact.chart = (function (exports, React, hooks, utils, componentbase) {
|
|
3
|
+
'use strict';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
function _interopNamespace(e) {
|
|
6
|
+
if (e && e.__esModule) return e;
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
16
18
|
}
|
|
17
|
-
|
|
19
|
+
n["default"] = e;
|
|
20
|
+
return Object.freeze(n);
|
|
18
21
|
}
|
|
19
|
-
n["default"] = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
var ChartBase = componentbase.ComponentBase.extend({
|
|
26
|
+
defaultProps: {
|
|
27
|
+
__TYPE: 'Chart',
|
|
28
|
+
id: null,
|
|
29
|
+
type: null,
|
|
30
|
+
data: null,
|
|
31
|
+
options: null,
|
|
32
|
+
plugins: null,
|
|
33
|
+
width: null,
|
|
34
|
+
height: null,
|
|
35
|
+
style: null,
|
|
36
|
+
className: null,
|
|
37
|
+
children: undefined
|
|
34
38
|
}
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
return _extends.apply(this, arguments);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
var ChartBase = {
|
|
41
|
-
defaultProps: {
|
|
42
|
-
__TYPE: 'Chart',
|
|
43
|
-
id: null,
|
|
44
|
-
type: null,
|
|
45
|
-
data: null,
|
|
46
|
-
options: null,
|
|
47
|
-
plugins: null,
|
|
48
|
-
width: null,
|
|
49
|
-
height: null,
|
|
50
|
-
style: null,
|
|
51
|
-
className: null,
|
|
52
|
-
children: undefined
|
|
53
|
-
},
|
|
54
|
-
getProps: function getProps(props) {
|
|
55
|
-
return utils.ObjectUtils.getMergedProps(props, ChartBase.defaultProps);
|
|
56
|
-
},
|
|
57
|
-
getOtherProps: function getOtherProps(props) {
|
|
58
|
-
return utils.ObjectUtils.getDiffProps(props, ChartBase.defaultProps);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
39
|
+
});
|
|
61
40
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
41
|
+
// GitHub #3059 wrapper if loaded by script tag
|
|
42
|
+
var ChartJS = function () {
|
|
43
|
+
try {
|
|
44
|
+
return Chart;
|
|
45
|
+
} catch (_unused) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}();
|
|
49
|
+
var PrimeReactChart = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
50
|
+
var props = ChartBase.getProps(inProps);
|
|
51
|
+
var _ChartBase$setMetaDat = ChartBase.setMetaData({
|
|
52
|
+
props: props
|
|
53
|
+
}),
|
|
54
|
+
ptm = _ChartBase$setMetaDat.ptm;
|
|
55
|
+
var elementRef = React__namespace.useRef(null);
|
|
56
|
+
var chartRef = React__namespace.useRef(null);
|
|
57
|
+
var canvasRef = React__namespace.useRef(null);
|
|
58
|
+
var initChart = function initChart() {
|
|
59
|
+
destroyChart();
|
|
60
|
+
var configuration = {
|
|
61
|
+
type: props.type,
|
|
62
|
+
data: props.data,
|
|
63
|
+
options: props.options,
|
|
64
|
+
plugins: props.plugins
|
|
65
|
+
};
|
|
66
|
+
if (ChartJS) {
|
|
67
|
+
// GitHub #3059 loaded by script only
|
|
68
|
+
chartRef.current = new ChartJS(canvasRef.current, configuration);
|
|
69
|
+
} else {
|
|
70
|
+
import('chart.js/auto').then(function (module) {
|
|
71
|
+
destroyChart();
|
|
89
72
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
if (module) {
|
|
96
|
-
if (module["default"]) {
|
|
97
|
-
// WebPack
|
|
98
|
-
chartRef.current = new module["default"](canvasRef.current, configuration);
|
|
99
|
-
} else {
|
|
100
|
-
// ParcelJS
|
|
101
|
-
chartRef.current = new module(canvasRef.current, configuration);
|
|
73
|
+
// In case that the Chart component has been unmounted during asynchronous loading of ChartJS,
|
|
74
|
+
// the canvasRef will not be available anymore, and no Chart should be created.
|
|
75
|
+
if (!canvasRef.current) {
|
|
76
|
+
return;
|
|
102
77
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
React__namespace.useImperativeHandle(ref, function () {
|
|
114
|
-
return {
|
|
115
|
-
props: props,
|
|
116
|
-
getCanvas: function getCanvas() {
|
|
117
|
-
return canvasRef.current;
|
|
118
|
-
},
|
|
119
|
-
getChart: function getChart() {
|
|
120
|
-
return chartRef.current;
|
|
121
|
-
},
|
|
122
|
-
getBase64Image: function getBase64Image() {
|
|
123
|
-
return chartRef.current.toBase64Image();
|
|
124
|
-
},
|
|
125
|
-
getElement: function getElement() {
|
|
126
|
-
return elementRef.current;
|
|
127
|
-
},
|
|
128
|
-
generateLegend: function generateLegend() {
|
|
129
|
-
return chartRef.current && chartRef.current.generateLegend();
|
|
130
|
-
},
|
|
131
|
-
refresh: function refresh() {
|
|
132
|
-
return chartRef.current && chartRef.current.update();
|
|
78
|
+
if (module) {
|
|
79
|
+
if (module["default"]) {
|
|
80
|
+
// WebPack
|
|
81
|
+
chartRef.current = new module["default"](canvasRef.current, configuration);
|
|
82
|
+
} else {
|
|
83
|
+
// ParcelJS
|
|
84
|
+
chartRef.current = new module(canvasRef.current, configuration);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
133
88
|
}
|
|
134
89
|
};
|
|
90
|
+
var destroyChart = function destroyChart() {
|
|
91
|
+
if (chartRef.current) {
|
|
92
|
+
chartRef.current.destroy();
|
|
93
|
+
chartRef.current = null;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
React__namespace.useImperativeHandle(ref, function () {
|
|
97
|
+
return {
|
|
98
|
+
props: props,
|
|
99
|
+
getCanvas: function getCanvas() {
|
|
100
|
+
return canvasRef.current;
|
|
101
|
+
},
|
|
102
|
+
getChart: function getChart() {
|
|
103
|
+
return chartRef.current;
|
|
104
|
+
},
|
|
105
|
+
getBase64Image: function getBase64Image() {
|
|
106
|
+
return chartRef.current.toBase64Image();
|
|
107
|
+
},
|
|
108
|
+
getElement: function getElement() {
|
|
109
|
+
return elementRef.current;
|
|
110
|
+
},
|
|
111
|
+
generateLegend: function generateLegend() {
|
|
112
|
+
return chartRef.current && chartRef.current.generateLegend();
|
|
113
|
+
},
|
|
114
|
+
refresh: function refresh() {
|
|
115
|
+
return chartRef.current && chartRef.current.update();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
React__namespace.useEffect(function () {
|
|
120
|
+
initChart();
|
|
121
|
+
});
|
|
122
|
+
hooks.useUnmountEffect(function () {
|
|
123
|
+
destroyChart();
|
|
124
|
+
});
|
|
125
|
+
var className = utils.classNames('p-chart', props.className);
|
|
126
|
+
var style = Object.assign({
|
|
127
|
+
width: props.width,
|
|
128
|
+
height: props.height
|
|
129
|
+
}, props.style);
|
|
130
|
+
var title = props.options && props.options.plugins && props.options.plugins.title && props.options.plugins.title.text;
|
|
131
|
+
var ariaLabel = props.ariaLabel || title;
|
|
132
|
+
var rootProps = utils.mergeProps({
|
|
133
|
+
id: props.id,
|
|
134
|
+
ref: elementRef,
|
|
135
|
+
style: style,
|
|
136
|
+
className: className
|
|
137
|
+
}, ChartBase.getOtherProps(props), ptm('root'));
|
|
138
|
+
var canvasProps = utils.mergeProps({
|
|
139
|
+
ref: canvasRef,
|
|
140
|
+
width: props.width,
|
|
141
|
+
height: props.height,
|
|
142
|
+
role: 'img',
|
|
143
|
+
'aria-label': ariaLabel
|
|
144
|
+
}, ptm('canvas'));
|
|
145
|
+
return /*#__PURE__*/React__namespace.createElement("div", rootProps, /*#__PURE__*/React__namespace.createElement("canvas", canvasProps));
|
|
146
|
+
}), function (prevProps, nextProps) {
|
|
147
|
+
return prevProps.data === nextProps.data && prevProps.options === nextProps.options && prevProps.type === nextProps.type;
|
|
135
148
|
});
|
|
136
|
-
|
|
137
|
-
initChart();
|
|
138
|
-
});
|
|
139
|
-
hooks.useUnmountEffect(function () {
|
|
140
|
-
destroyChart();
|
|
141
|
-
});
|
|
142
|
-
var otherProps = ChartBase.getOtherProps(props);
|
|
143
|
-
var className = utils.classNames('p-chart', props.className);
|
|
144
|
-
var style = Object.assign({
|
|
145
|
-
width: props.width,
|
|
146
|
-
height: props.height
|
|
147
|
-
}, props.style);
|
|
148
|
-
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
149
|
-
id: props.id,
|
|
150
|
-
ref: elementRef,
|
|
151
|
-
style: style,
|
|
152
|
-
className: className
|
|
153
|
-
}, otherProps), /*#__PURE__*/React__namespace.createElement("canvas", {
|
|
154
|
-
ref: canvasRef,
|
|
155
|
-
width: props.width,
|
|
156
|
-
height: props.height
|
|
157
|
-
}));
|
|
158
|
-
}), function (prevProps, nextProps) {
|
|
159
|
-
return prevProps.data === nextProps.data && prevProps.options === nextProps.options && prevProps.type === nextProps.type;
|
|
160
|
-
});
|
|
161
|
-
PrimeReactChart.displayName = 'Chart';
|
|
149
|
+
PrimeReactChart.displayName = 'Chart';
|
|
162
150
|
|
|
163
|
-
|
|
151
|
+
exports.Chart = PrimeReactChart;
|
|
164
152
|
|
|
165
|
-
|
|
153
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
166
154
|
|
|
167
|
-
|
|
155
|
+
return exports;
|
|
168
156
|
|
|
169
|
-
})({}, React, primereact.hooks, primereact.utils);
|
|
157
|
+
})({}, React, primereact.hooks, primereact.utils, primereact.componentbase);
|
package/chart/chart.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.chart=function(e,t,r,n){"use strict";function
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.chart=function(e,t,r,n,u){"use strict";function a(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 i=a(t),c=u.ComponentBase.extend({defaultProps:{__TYPE:"Chart",id:null,type:null,data:null,options:null,plugins:null,width:null,height:null,style:null,className:null,children:void 0}}),o=function(){try{return Chart}catch(e){return null}}(),l=i.memo(i.forwardRef((function(e,t){var u=c.getProps(e),a=c.setMetaData({props:u}).ptm,l=i.useRef(null),s=i.useRef(null),p=i.useRef(null),f=function(){d();var e={type:u.type,data:u.data,options:u.options,plugins:u.plugins};o?s.current=new o(p.current,e):import("chart.js/auto").then((function(t){d(),p.current&&t&&(s.current=t.default?new t.default(p.current,e):new t(p.current,e))}))},d=function(){s.current&&(s.current.destroy(),s.current=null)};i.useImperativeHandle(t,(function(){return{props:u,getCanvas:function(){return p.current},getChart:function(){return s.current},getBase64Image:function(){return s.current.toBase64Image()},getElement:function(){return l.current},generateLegend:function(){return s.current&&s.current.generateLegend()},refresh:function(){return s.current&&s.current.update()}}})),i.useEffect((function(){f()})),r.useUnmountEffect((function(){d()}));var h=n.classNames("p-chart",u.className),g=Object.assign({width:u.width,height:u.height},u.style),m=u.ariaLabel||u.options&&u.options.plugins&&u.options.plugins.title&&u.options.plugins.title.text,y=n.mergeProps({id:u.id,ref:l,style:g,className:h},c.getOtherProps(u),a("root")),v=n.mergeProps({ref:p,width:u.width,height:u.height,role:"img","aria-label":m},a("canvas"));return i.createElement("div",y,i.createElement("canvas",v))})),(function(e,t){return e.data===t.data&&e.options===t.options&&e.type===t.type}));return l.displayName="Chart",e.Chart=l,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.hooks,primereact.utils,primereact.componentbase);
|
package/checkbox/checkbox.cjs.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var hooks = require('primereact/hooks');
|
|
7
|
+
var check = require('primereact/icons/check');
|
|
7
8
|
var tooltip = require('primereact/tooltip');
|
|
8
9
|
var utils = require('primereact/utils');
|
|
9
|
-
var check = require('primereact/icons/check');
|
|
10
10
|
|
|
11
11
|
function _interopNamespace(e) {
|
|
12
12
|
if (e && e.__esModule) return e;
|
|
@@ -101,26 +101,28 @@ function _slicedToArray(arr, i) {
|
|
|
101
101
|
var CheckboxBase = {
|
|
102
102
|
defaultProps: {
|
|
103
103
|
__TYPE: 'Checkbox',
|
|
104
|
-
|
|
105
|
-
inputRef: null,
|
|
106
|
-
inputId: null,
|
|
107
|
-
value: null,
|
|
108
|
-
name: null,
|
|
104
|
+
autoFocus: false,
|
|
109
105
|
checked: false,
|
|
110
|
-
trueValue: true,
|
|
111
|
-
falseValue: false,
|
|
112
|
-
style: null,
|
|
113
106
|
className: null,
|
|
114
107
|
disabled: false,
|
|
115
|
-
|
|
108
|
+
falseValue: false,
|
|
109
|
+
icon: null,
|
|
110
|
+
id: null,
|
|
111
|
+
inputId: null,
|
|
112
|
+
inputRef: null,
|
|
113
|
+
name: null,
|
|
114
|
+
onChange: null,
|
|
115
|
+
onClick: null,
|
|
116
|
+
onContextMenu: null,
|
|
117
|
+
onMouseDown: null,
|
|
116
118
|
readOnly: false,
|
|
119
|
+
required: false,
|
|
120
|
+
style: null,
|
|
117
121
|
tabIndex: null,
|
|
118
|
-
icon: null,
|
|
119
122
|
tooltip: null,
|
|
120
123
|
tooltipOptions: null,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
onContextMenu: null,
|
|
124
|
+
trueValue: true,
|
|
125
|
+
value: null,
|
|
124
126
|
children: undefined
|
|
125
127
|
},
|
|
126
128
|
getProps: function getProps(props) {
|
|
@@ -140,19 +142,26 @@ var Checkbox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
140
142
|
var elementRef = React__namespace.useRef(null);
|
|
141
143
|
var inputRef = React__namespace.useRef(props.inputRef);
|
|
142
144
|
var onClick = function onClick(event) {
|
|
143
|
-
if (
|
|
145
|
+
if (props.disabled || props.readOnly) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (props.onChange || props.onClick) {
|
|
144
149
|
var _checked = isChecked();
|
|
145
150
|
var checkboxClicked = event.target instanceof HTMLDivElement || event.target instanceof HTMLSpanElement || event.target instanceof Object;
|
|
146
151
|
var isInputToggled = event.target === inputRef.current;
|
|
147
152
|
var isCheckboxToggled = checkboxClicked && event.target.checked !== _checked;
|
|
148
153
|
if (isInputToggled || isCheckboxToggled) {
|
|
149
154
|
var value = _checked ? props.falseValue : props.trueValue;
|
|
150
|
-
|
|
155
|
+
var eventData = {
|
|
151
156
|
originalEvent: event,
|
|
152
157
|
value: props.value,
|
|
153
158
|
checked: value,
|
|
154
|
-
stopPropagation: function stopPropagation() {
|
|
155
|
-
|
|
159
|
+
stopPropagation: function stopPropagation() {
|
|
160
|
+
event.stopPropagation();
|
|
161
|
+
},
|
|
162
|
+
preventDefault: function preventDefault() {
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
},
|
|
156
165
|
target: {
|
|
157
166
|
type: 'checkbox',
|
|
158
167
|
name: props.name,
|
|
@@ -160,7 +169,14 @@ var Checkbox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
160
169
|
value: props.value,
|
|
161
170
|
checked: value
|
|
162
171
|
}
|
|
163
|
-
}
|
|
172
|
+
};
|
|
173
|
+
props.onClick && props.onClick(eventData);
|
|
174
|
+
|
|
175
|
+
// do not continue if the user defined click wants to prevent
|
|
176
|
+
if (event.defaultPrevented) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
props.onChange && props.onChange(eventData);
|
|
164
180
|
}
|
|
165
181
|
utils.DomHandler.focus(inputRef.current);
|
|
166
182
|
event.preventDefault();
|
|
@@ -201,6 +217,11 @@ var Checkbox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
201
217
|
hooks.useUpdateEffect(function () {
|
|
202
218
|
inputRef.current.checked = isChecked();
|
|
203
219
|
}, [props.checked, props.trueValue]);
|
|
220
|
+
hooks.useMountEffect(function () {
|
|
221
|
+
if (props.autoFocus) {
|
|
222
|
+
utils.DomHandler.focus(inputRef.current, props.autoFocus);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
204
225
|
var checked = isChecked();
|
|
205
226
|
var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
|
|
206
227
|
var otherProps = CheckboxBase.getOtherProps(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/hooks"),n=require("primereact/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/hooks"),n=require("primereact/icons/check"),r=require("primereact/tooltip"),o=require("primereact/utils");function c(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var l=c(e);function u(){return u=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},u.apply(this,arguments)}function a(e){if(Array.isArray(e))return e}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c,l,u=[],a=!0,i=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=c.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(i)throw o}}return u}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p={defaultProps:{__TYPE:"Checkbox",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,icon:null,id:null,inputId:null,inputRef:null,name:null,onChange:null,onClick:null,onContextMenu:null,onMouseDown:null,readOnly:!1,required:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,value:null,children:void 0},getProps:function(e){return o.ObjectUtils.getMergedProps(e,p.defaultProps)},getOtherProps:function(e){return o.ObjectUtils.getDiffProps(e,p.defaultProps)}},b=l.memo(l.forwardRef((function(e,c){var s,b,m=p.getProps(e),h=l.useState(!1),g=(b=2,a(s=h)||i(s,b)||f(s,b)||d()),y=g[0],v=g[1],k=l.useRef(null),O=l.useRef(m.inputRef),x=function(e){if(!m.disabled&&!m.readOnly&&(m.onChange||m.onClick)){var t=j(),n=e.target instanceof HTMLDivElement||e.target instanceof HTMLSpanElement||e.target instanceof Object;if(e.target===O.current||n&&e.target.checked!==t){var r=t?m.falseValue:m.trueValue,c={originalEvent:e,value:m.value,checked:r,stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{type:"checkbox",name:m.name,id:m.id,value:m.value,checked:r}};if(m.onClick&&m.onClick(c),e.defaultPrevented)return;m.onChange&&m.onChange(c)}o.DomHandler.focus(O.current),e.preventDefault()}},j=function(){return m.checked===m.trueValue};l.useImperativeHandle(c,(function(){return{props:m,focus:function(){return o.DomHandler.focus(O.current)},getElement:function(){return k.current},getInput:function(){return O.current}}})),l.useEffect((function(){o.ObjectUtils.combinedRefs(O,m.inputRef)}),[O,m.inputRef]),t.useUpdateEffect((function(){O.current.checked=j()}),[m.checked,m.trueValue]),t.useMountEffect((function(){m.autoFocus&&o.DomHandler.focus(O.current,m.autoFocus)}));var P=j(),C=o.ObjectUtils.isNotEmpty(m.tooltip),E=p.getOtherProps(m),D=o.ObjectUtils.reduceKeys(E,o.DomHandler.ARIA_PROPS),I=o.classNames("p-checkbox p-component",{"p-checkbox-checked":P,"p-checkbox-disabled":m.disabled,"p-checkbox-focused":y},m.className),M=o.classNames("p-checkbox-box",{"p-highlight":P,"p-disabled":m.disabled,"p-focus":y}),w="p-checkbox-icon p-c",N=o.IconUtils.getJSXIcon(P?m.icon||l.createElement(n.CheckIcon,{className:w}):null,{className:w},{props:m,checked:P});return l.createElement(l.Fragment,null,l.createElement("div",u({ref:k,id:m.id,className:I,style:m.style},E,{onClick:x,onContextMenu:m.onContextMenu,onMouseDown:m.onMouseDown}),l.createElement("div",{className:"p-hidden-accessible"},l.createElement("input",u({ref:O,type:"checkbox",id:m.inputId,name:m.name,tabIndex:m.tabIndex,defaultChecked:P,onFocus:function(){v(!0)},onBlur:function(){v(!1)},onKeyDown:function(e){"Space"!==e.code&&" "!==e.key||x(e)},disabled:m.disabled,readOnly:m.readOnly,required:m.required},D))),l.createElement("div",{className:M},N)),C&&l.createElement(r.Tooltip,u({target:k,content:m.tooltip},m.tooltipOptions)))})));b.displayName="Checkbox",exports.Checkbox=b;
|
package/checkbox/checkbox.d.ts
CHANGED
|
@@ -20,15 +20,28 @@ import { IconType } from '../utils';
|
|
|
20
20
|
*/
|
|
21
21
|
interface CheckboxChangeEvent extends FormEvent {}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Custom click event.
|
|
25
|
+
* @see {@link CheckboxProps.onClick}
|
|
26
|
+
* @extends {FormEvent}
|
|
27
|
+
* @event
|
|
28
|
+
*/
|
|
29
|
+
interface CheckboxClickEvent extends FormEvent {}
|
|
30
|
+
|
|
23
31
|
/**
|
|
24
32
|
* Defines valid properties in Checkbox component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
25
33
|
* @group Properties
|
|
26
34
|
*/
|
|
27
|
-
export interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange' | 'ref'> {
|
|
35
|
+
export interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange' | 'onClick' | 'ref'> {
|
|
28
36
|
/**
|
|
29
37
|
* Unique identifier of the element.
|
|
30
38
|
*/
|
|
31
39
|
id?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* When present, it specifies that the component should automatically get focus on load.
|
|
42
|
+
* @defaultValue false
|
|
43
|
+
*/
|
|
44
|
+
autoFocus?: boolean | undefined;
|
|
32
45
|
/**
|
|
33
46
|
* Reference of the input element.
|
|
34
47
|
*/
|
|
@@ -106,6 +119,11 @@ export interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputH
|
|
|
106
119
|
* @param {CheckboxChangeEvent} event - Custom change event
|
|
107
120
|
*/
|
|
108
121
|
onChange?(event: CheckboxChangeEvent): void;
|
|
122
|
+
/**
|
|
123
|
+
* Callback to invoke on value change. Mark the event with preventDefault to prevent the option from changing.
|
|
124
|
+
* @param {CheckboxClickEvent} event - Custom click event
|
|
125
|
+
*/
|
|
126
|
+
onClick?(event: CheckboxClickEvent): void;
|
|
109
127
|
/**
|
|
110
128
|
* Callback to invoke to when a mouse button is pressed.
|
|
111
129
|
* @param {React.MouseEvent<HTMLElement>} event - Browser event
|