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
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("primereact/csstransition"),t=require("primereact/hooks"),r=require("primereact/utils"),l=require("primereact/icons/chevronright"),a=require("primereact/icons/chevrondown");function i(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var o=i(e);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},u.apply(this,arguments)}function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function c(e){if(Array.isArray(e))return s(e)}function m(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(e,n){if(e){if("string"==typeof e)return s(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s(e,n):void 0}}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e){return c(e)||m(e)||p(e)||d()}function b(e){if(Array.isArray(e))return e}function v(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,l,a,i,o=[],u=!0,s=!1;try{if(a=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;u=!1}else for(;!(u=(r=a.call(t)).done)&&(o.push(r.value),o.length!==n);u=!0);}catch(e){s=!0,l=e}finally{try{if(!u&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(s)throw l}}return o}}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,n){return b(e)||v(e,n)||p(e,n)||g()}var N={defaultProps:{__TYPE:"Panel",id:null,model:null,style:null,submenuIcon:null,className:null,multiple:!1,transitionOptions:null,children:void 0},getProps:function(e){return r.ObjectUtils.getMergedProps(e,N.defaultProps)},getOtherProps:function(e){return r.ObjectUtils.getDiffProps(e,N.defaultProps)}},h=o.memo((function(e){var i=y(o.useState(null),2),u=i[0],s=i[1],c=function(){if(e.model){if(e.multiple)return e.model.filter((function(e){return e.expanded}));var n=null;return e.model.forEach((function(e){e.expanded&&(n?e.expanded=!1:n=e)})),n}return null},m=function(n,t){if(t.disabled)n.preventDefault();else{t.url||n.preventDefault(),t.command&&t.command({originalEvent:n,item:t});var r=u;p(t)?(t.expanded=!1,s(e.multiple?r.filter((function(e){return e!==t})):null)):(!e.multiple&&r&&(r.expanded=!1),t.expanded=!0,s(e.multiple?[].concat(f(r||[]),[t]):t))}},p=function(n){return u&&(e.multiple?u.indexOf(n)>-1:u===n)};t.useMountEffect((function(){s(c())}));var d=function(e){return o.createElement("li",{key:"separator_"+e,className:"p-menu-separator"})},b=function(t,l){var a=r.classNames("p-toggleable-content",{"p-toggleable-content-collapsed":!l}),i=o.createRef();return t.items?o.createElement(n.CSSTransition,{nodeRef:i,classNames:"p-toggleable-content",timeout:{enter:1e3,exit:450},in:l,unmountOnExit:!0},o.createElement("div",{ref:i,className:a},o.createElement(h,{menuProps:e.menuProps,model:t.items,multiple:e.multiple,submenuIcon:e.submenuIcon}))):null},v=function(n,t){if(!1===n.visible)return null;var i=n.label+"_"+t,u=p(n),s=r.classNames("p-menuitem",n.className),c=r.classNames("p-menuitem-link",{"p-disabled":n.disabled}),d=r.classNames("p-menuitem-icon",n.icon),f=r.IconUtils.getJSXIcon(n.icon,{className:"p-menuitem-icon"},{props:e.menuProps}),v=n.label&&o.createElement("span",{className:"p-menuitem-text"},n.label),g="p-panelmenu-icon",y=n.items&&r.IconUtils.getJSXIcon(u?e.submenuIcon||o.createElement(a.ChevronDownIcon,{className:g}):e.submenuIcon||o.createElement(l.ChevronRightIcon,{className:g})),N=b(n,u),h=o.createElement("a",{href:n.url||"#",className:c,target:n.target,onClick:function(e){return m(e,n)},role:"menuitem","aria-disabled":n.disabled},y,f,v);n.template&&(h=r.ObjectUtils.getJSXElement(n.template,n,{onClick:function(e){return m(e,n)},className:c,labelClassName:"p-menuitem-text",iconClassName:d,submenuIconClassName:g,element:h,props:e,leaf:!n.items,active:u}));return o.createElement("li",{key:i,id:n.id,className:s,style:n.style,role:"none"},h,N)},g=function(e,n){return e.separator?d(n):v(e,n)},N=r.classNames("p-submenu-list",e.className),E=e.model?e.model.map(g):null;return o.createElement("ul",{className:N,role:"tree"},E)}));h.displayName="PanelMenuSub";var E=o.memo(o.forwardRef((function(e,i){var s=N.getProps(e),c=y(o.useState(s.id),2),m=c[0],p=c[1],d=y(o.useState(null),2),b=d[0],v=d[1],g=y(o.useState(!1),2),E=g[0],I=g[1],O=o.useRef(null),x=m+"_header",S=m+"_content",P=function(){if(s.model){if(s.multiple)return s.model.filter((function(e){return e.expanded}));var e=null;return s.model.forEach((function(n){n.expanded&&(e?n.expanded=!1:e=n)})),e}return null},j=function(e,n){if(n.disabled)e.preventDefault();else{n.url||e.preventDefault(),n.command&&n.command({originalEvent:e,item:n});var t=b;C(n)?(n.expanded=!1,v(s.multiple?t.filter((function(e){return e!==n})):null)):(!s.multiple&&t&&(t.expanded=!1),n.expanded=!0,v(s.multiple?[].concat(f(t||[]),[n]):n))}},C=function(e){return b&&(s.multiple?b.indexOf(e)>-1:b===e)};o.useImperativeHandle(i,(function(){return{props:s,getElement:function(){return O.current}}})),t.useMountEffect((function(){m||p(r.UniqueComponentId()),v(P())})),t.useUpdateEffect((function(){I(!0),v(P())}),[s.model]);var k=function(){I(!1)},w=function(e,t){if(!1===e.visible)return null;var i=e.label+"_"+t,u=C(e),c=r.classNames("p-panelmenu-panel",e.className),m=r.classNames("p-component p-panelmenu-header",{"p-highlight":u,"p-disabled":e.disabled}),p=r.classNames("p-menuitem-icon",e.icon),d=r.IconUtils.getJSXIcon(e.icon,{className:"p-menuitem-icon"},{props:s}),f="p-panelmenu-icon",b=e.items&&r.IconUtils.getJSXIcon(u?s.submenuIcon||o.createElement(a.ChevronDownIcon,{className:f}):s.submenuIcon||o.createElement(l.ChevronRightIcon,{className:f})),v=e.label&&o.createElement("span",{className:"p-menuitem-text"},e.label),g=r.classNames("p-toggleable-content",{"p-toggleable-content-collapsed":!u}),y=o.createRef(),N=o.createElement("a",{href:e.url||"#",className:"p-panelmenu-header-link",onClick:function(n){return j(n,e)},"aria-expanded":u,id:x,"aria-controls":S,"aria-disabled":e.disabled},b,d,v);e.template&&(N=r.ObjectUtils.getJSXElement(e.template,e,{onClick:function(n){return j(n,e)},className:"p-panelmenu-header-link",labelClassName:"p-menuitem-text",submenuIconClassName:f,iconClassName:p,element:N,props:s,leaf:!e.items,active:u}));return o.createElement("div",{key:i,className:c,style:e.style},o.createElement("div",{className:m,style:e.style},N),o.createElement(n.CSSTransition,{nodeRef:y,classNames:"p-toggleable-content",timeout:{enter:1e3,exit:450},onEnter:k,disabled:E,in:u,unmountOnExit:!0,options:s.transitionOptions},o.createElement("div",{ref:y,className:g,role:"region",id:S,"aria-labelledby":x},o.createElement("div",{className:"p-panelmenu-content"},o.createElement(h,{menuProps:s,model:e.items,className:"p-panelmenu-root-submenu",multiple:s.multiple,submenuIcon:s.submenuIcon})))))},U=N.getOtherProps(s),_=r.classNames("p-panelmenu p-component",s.className),A=s.model?s.model.map(w):null;return o.createElement("div",u({id:s.id,ref:O,className:_,style:s.style},U),A)})));E.displayName="PanelMenu",exports.PanelMenu=E;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/csstransition"),n=require("primereact/hooks"),r=require("primereact/icons/chevrondown"),l=require("primereact/icons/chevronright"),a=require("primereact/utils"),o=require("primereact/componentbase");function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=i(e);function c(e){return c="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},c(e)}function s(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){var t=s(e,"string");return"symbol"===c(t)?t:String(t)}function p(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(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 d(e){if(Array.isArray(e))return f(e)}function b(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e){return d(e)||b(e)||y(e)||g()}function O(e){if(Array.isArray(e))return e}function h(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,a,o,i=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(i.push(r.value),i.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw l}}return i}}function P(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(e,t){return O(e)||h(e,t)||y(e,t)||P()}var E=o.ComponentBase.extend({defaultProps:{__TYPE:"Panel",id:null,model:null,style:null,submenuIcon:null,className:null,multiple:!1,transitionOptions:null,children:void 0}});function j(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 S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var I=u.memo((function(e){var o=N(u.useState(null),2),i=o[0],c=o[1],s=function(t,n){return e.ptm(n,{context:{active:f(t)}})},m=function(){if(e.model){if(e.multiple)return e.model.filter((function(e){return e.expanded}));var t=null;return e.model.forEach((function(e){e.expanded&&(t?e.expanded=!1:t=e)})),t}return null},p=function(t,n){if(n.disabled)t.preventDefault();else{n.url||t.preventDefault(),n.command&&n.command({originalEvent:t,item:n});var r=i;f(n)?(n.expanded=!1,c(e.multiple?r.filter((function(e){return e!==n})):null)):(!e.multiple&&r&&(r.expanded=!1),n.expanded=!0,c(e.multiple?[].concat(v(r||[]),[n]):n))}},f=function(t){return i&&(e.multiple?i.indexOf(t)>-1:i===t)};n.useMountEffect((function(){c(m())}));var d=function(t){var n=a.mergeProps({key:"separator_"+t,className:"p-menu-separator"},e.ptm("separator"));return u.createElement("li",n)},b=function(n,r){var l=a.classNames("p-toggleable-content",{"p-toggleable-content-collapsed":!r}),o=u.createRef(),i=a.mergeProps({ref:o,className:l},e.ptm("toggleableContent"));return n.items?u.createElement(t.CSSTransition,{nodeRef:o,classNames:"p-toggleable-content",timeout:{enter:1e3,exit:450},in:r,unmountOnExit:!0},u.createElement("div",i,u.createElement(I,{menuProps:e.menuProps,model:n.items,multiple:e.multiple,submenuIcon:e.submenuIcon,ptm:e.ptm}))):null},y=function(t,n){if(!1===t.visible)return null;var o=t.label+"_"+n,i=f(t),c=a.classNames("p-menuitem",t.className),m=a.classNames("p-menuitem-link",{"p-disabled":t.disabled}),d=a.classNames("p-menuitem-icon",t.icon),y=a.mergeProps({className:d},s(t,"icon")),g=a.IconUtils.getJSXIcon(t.icon,S({},y),{props:e.menuProps}),v=a.mergeProps({className:"p-menuitem-text"},s(t,"label")),O=t.label&&u.createElement("span",v,t.label),h="p-panelmenu-icon",P=a.mergeProps({className:h},s(t,"submenuicon")),N=t.items&&a.IconUtils.getJSXIcon(i?e.submenuIcon||u.createElement(r.ChevronDownIcon,P):e.submenuIcon||u.createElement(l.ChevronRightIcon,P)),E=b(t,i),j=a.mergeProps({href:t.url||"#",className:m,target:t.target,onClick:function(e){return p(e,t)},role:"menuitem","aria-disabled":t.disabled},s(t,"action")),I=u.createElement("a",j,N,g,O);t.template&&(I=a.ObjectUtils.getJSXElement(t.template,t,{onClick:function(e){return p(e,t)},className:m,labelClassName:"p-menuitem-text",iconClassName:d,submenuIconClassName:h,element:I,props:e,leaf:!t.items,active:i}));var x=a.mergeProps({key:o,id:t.id,className:c,style:t.style,role:"none"},s(t,"menuitem"));return u.createElement("li",x,I,E)},g=function(e,t){return e.separator?d(t):y(e,t)},O=a.classNames("p-submenu-list",e.className),h=e.model?e.model.map(g):null,P=a.mergeProps({className:O,role:"tree"},e.ptm("menu"));return u.createElement("ul",P,h)}));function x(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 w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}I.displayName="PanelMenuSub";var C=u.memo(u.forwardRef((function(e,o){var i=E.getProps(e),c=N(u.useState(i.id),2),s=c[0],m=c[1],p=N(u.useState(null),2),f=p[0],d=p[1],b=N(u.useState(!1),2),y=b[0],g=b[1],O=u.useRef(null),h=s+"_header",P=s+"_content",j=E.setMetaData({props:i,state:{id:s,activeItem:f,animationDisabled:y}}).ptm,S=function(){if(i.model){if(i.multiple)return i.model.filter((function(e){return e.expanded}));var e=null;return i.model.forEach((function(t){t.expanded&&(e?t.expanded=!1:e=t)})),e}return null},x=function(e,t){if(t.disabled)e.preventDefault();else{t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t});var n=f;C(t)?(t.expanded=!1,d(i.multiple?n.filter((function(e){return e!==t})):null)):(!i.multiple&&n&&(n.expanded=!1),t.expanded=!0,d(i.multiple?[].concat(v(n||[]),[t]):t))}},C=function(e){return f&&(i.multiple?f.indexOf(e)>-1:f===e)},D=function(e,t){return j(t,{context:{active:C(e)}})};u.useImperativeHandle(o,(function(){return{props:i,getElement:function(){return O.current}}})),n.useMountEffect((function(){s||m(a.UniqueComponentId()),d(S())})),n.useUpdateEffect((function(){g(!0),d(S())}),[i.model]);var k=function(){g(!1)},_=function(e,n){if(!1===e.visible)return null;var o=e.label+"_"+n,c=C(e),s=a.classNames("p-panelmenu-panel",e.className),m=a.classNames("p-component p-panelmenu-header",{"p-highlight":c,"p-disabled":e.disabled}),p=a.classNames("p-menuitem-icon",e.icon),f=a.mergeProps({className:p},D(e,"headerIcon")),d=a.IconUtils.getJSXIcon(e.icon,w({},f),{props:i}),b="p-panelmenu-icon",g=a.mergeProps({className:b},D(e,"headerSubmenuIcon")),v=e.items&&a.IconUtils.getJSXIcon(c?i.submenuIcon||u.createElement(r.ChevronDownIcon,g):i.submenuIcon||u.createElement(l.ChevronRightIcon,g)),O=a.mergeProps({className:"p-menuitem-text"},D(e,"headerLabel")),N=e.label&&u.createElement("span",O,e.label),E=a.classNames("p-toggleable-content",{"p-toggleable-content-collapsed":!c}),S=u.createRef(),_=a.mergeProps({href:e.url||"#",className:"p-panelmenu-header-link",onClick:function(t){return x(t,e)},"aria-expanded":c,id:h,"aria-controls":P,"aria-disabled":e.disabled},D(e,"headerAction")),A=u.createElement("a",_,v,d,N);e.template&&(A=a.ObjectUtils.getJSXElement(e.template,e,{onClick:function(t){return x(t,e)},className:"p-panelmenu-header-link",labelClassName:"p-menuitem-text",submenuIconClassName:b,iconClassName:p,element:A,props:i,leaf:!e.items,active:c}));var M=a.mergeProps({key:o,className:s,style:e.style},D(e,"panel")),U=a.mergeProps({className:m,style:e.style},D(e,"header")),q=a.mergeProps({className:"p-panelmenu-content"},D(e,"menuContent")),R=a.mergeProps({ref:S,className:E,role:"region",id:P,"aria-labelledby":h},D(e,"headerToggleableContent"));return u.createElement("div",M,u.createElement("div",U,A),u.createElement(t.CSSTransition,{nodeRef:S,classNames:"p-toggleable-content",timeout:{enter:1e3,exit:450},onEnter:k,disabled:y,in:c,unmountOnExit:!0,options:i.transitionOptions},u.createElement("div",R,u.createElement("div",q,u.createElement(I,{menuProps:i,model:e.items,className:"p-panelmenu-root-submenu",multiple:i.multiple,submenuIcon:i.submenuIcon,ptm:j})))))},A=a.classNames("p-panelmenu p-component",i.className),M=i.model?i.model.map(_):null,U=a.mergeProps({id:i.id,ref:O,className:A,style:i.style},E.getOtherProps(i),j("root"));return u.createElement("div",U,M)})));C.displayName="PanelMenu",exports.PanelMenu=C;
|
package/panelmenu/panelmenu.d.ts
CHANGED
|
@@ -10,13 +10,130 @@
|
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
import { CSSTransitionProps } from '../csstransition';
|
|
12
12
|
import { MenuItem } from '../menuitem';
|
|
13
|
-
import { IconType } from '../utils/utils';
|
|
13
|
+
import { IconType, PassThroughType } from '../utils/utils';
|
|
14
|
+
|
|
15
|
+
export declare type PanelMenuPassThroughType<T> = PassThroughType<T, PanelMenuPassThroughMethodOptions>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Custom passthrough(pt) option method.
|
|
19
|
+
*/
|
|
20
|
+
export interface PanelMenuPassThroughMethodOptions {
|
|
21
|
+
props: PanelMenuProps;
|
|
22
|
+
state: PanelMenuState;
|
|
23
|
+
context: PanelMenuContext;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Custom passthrough(pt) options.
|
|
28
|
+
* @see {@link PanelMenuProps.pt}
|
|
29
|
+
*/
|
|
30
|
+
export interface PanelMenuPassThroughOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Uses to pass attributes to the root's DOM element.
|
|
33
|
+
*/
|
|
34
|
+
root?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
35
|
+
/**
|
|
36
|
+
* Uses to pass attributes to the panel's DOM element.
|
|
37
|
+
*/
|
|
38
|
+
panel?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
39
|
+
/**
|
|
40
|
+
* Uses to pass attributes to the header's DOM element.
|
|
41
|
+
*/
|
|
42
|
+
header?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
43
|
+
/**
|
|
44
|
+
* Uses to pass attributes to the header action's DOM element.
|
|
45
|
+
*/
|
|
46
|
+
headerAction?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLAnchorElement>>;
|
|
47
|
+
/**
|
|
48
|
+
* Uses to pass attributes to the submenuIcon's DOM element.
|
|
49
|
+
*/
|
|
50
|
+
submenuIcon?: PanelMenuPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
|
|
51
|
+
/**
|
|
52
|
+
* Uses to pass attributes to the header icon's DOM element.
|
|
53
|
+
*/
|
|
54
|
+
headerIcon?: PanelMenuPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* Uses to pass attributes to the header submenu icon's DOM element.
|
|
57
|
+
*/
|
|
58
|
+
headerSubmenuIcon?: PanelMenuPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
|
|
59
|
+
/**
|
|
60
|
+
* Uses to pass attributes to the header label's DOM element.
|
|
61
|
+
*/
|
|
62
|
+
headerLabel?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLSpanElement>>;
|
|
63
|
+
/**
|
|
64
|
+
* Uses to pass attributes to the toggleable content's DOM element.
|
|
65
|
+
*/
|
|
66
|
+
toggleableContent?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
67
|
+
/**
|
|
68
|
+
* Uses to pass attributes to the header toggleable content's DOM element.
|
|
69
|
+
*/
|
|
70
|
+
headerToggleableContent?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
71
|
+
/**
|
|
72
|
+
* Uses to pass attributes to the menu content's DOM element.
|
|
73
|
+
*/
|
|
74
|
+
menuContent?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
75
|
+
/**
|
|
76
|
+
* Uses to pass attributes to the list's DOM element.
|
|
77
|
+
*/
|
|
78
|
+
menu?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLUListElement>>;
|
|
79
|
+
/**
|
|
80
|
+
* Uses to pass attributes to the list item's DOM element.
|
|
81
|
+
*/
|
|
82
|
+
menuitem?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLLIElement>>;
|
|
83
|
+
/**
|
|
84
|
+
* Uses to pass attributes to the action's DOM element.
|
|
85
|
+
*/
|
|
86
|
+
action?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLAnchorElement>>;
|
|
87
|
+
/**
|
|
88
|
+
* Uses to pass attributes to the icon's DOM element.
|
|
89
|
+
*/
|
|
90
|
+
icon?: PanelMenuPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
|
|
91
|
+
/**
|
|
92
|
+
* Uses to pass attributes to the label's DOM element.
|
|
93
|
+
*/
|
|
94
|
+
label?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLSpanElement>>;
|
|
95
|
+
/**
|
|
96
|
+
* Uses to pass attributes to the separator's DOM element.
|
|
97
|
+
*/
|
|
98
|
+
separator?: PanelMenuPassThroughType<React.HTMLAttributes<HTMLLIElement>>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Defines current inline state in PanelMenu component.
|
|
103
|
+
*/
|
|
104
|
+
export interface PanelMenuState {
|
|
105
|
+
/**
|
|
106
|
+
* Current id state as a string.
|
|
107
|
+
*/
|
|
108
|
+
id: string;
|
|
109
|
+
/**
|
|
110
|
+
* Active item path.
|
|
111
|
+
* @type {MenuItem}
|
|
112
|
+
*/
|
|
113
|
+
activeItem: MenuItem[];
|
|
114
|
+
/**
|
|
115
|
+
* Whether the menu is visible or not.
|
|
116
|
+
* @defaultValue false
|
|
117
|
+
*/
|
|
118
|
+
animationDisabled: boolean;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Defines current options in PanelMenu component.
|
|
123
|
+
*/
|
|
124
|
+
export interface PanelMenuContext {
|
|
125
|
+
/**
|
|
126
|
+
* Current active state of menuitem as a boolean.
|
|
127
|
+
* @defaultValue false
|
|
128
|
+
*/
|
|
129
|
+
active: boolean;
|
|
130
|
+
}
|
|
14
131
|
|
|
15
132
|
/**
|
|
16
133
|
* Defines valid properties in PanelMenu component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
17
134
|
* @group Properties
|
|
18
135
|
*/
|
|
19
|
-
export interface PanelMenuProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
|
|
136
|
+
export interface PanelMenuProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref' | 'pt'> {
|
|
20
137
|
/**
|
|
21
138
|
* An array of menuitems.
|
|
22
139
|
*/
|
|
@@ -39,6 +156,11 @@ export interface PanelMenuProps extends Omit<React.DetailedHTMLProps<React.HTMLA
|
|
|
39
156
|
* @readonly
|
|
40
157
|
*/
|
|
41
158
|
children?: React.ReactNode | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Uses to pass attributes to DOM elements inside the component.
|
|
161
|
+
* @type {PanelMenuPassThroughOptions}
|
|
162
|
+
*/
|
|
163
|
+
pt?: PanelMenuPassThroughOptions;
|
|
42
164
|
}
|
|
43
165
|
|
|
44
166
|
/**
|
|
@@ -1,23 +1,50 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { CSSTransition } from 'primereact/csstransition';
|
|
3
3
|
import { useMountEffect, useUpdateEffect } from 'primereact/hooks';
|
|
4
|
-
import { ObjectUtils, classNames, IconUtils, UniqueComponentId } from 'primereact/utils';
|
|
5
|
-
import { ChevronRightIcon } from 'primereact/icons/chevronright';
|
|
6
4
|
import { ChevronDownIcon } from 'primereact/icons/chevrondown';
|
|
5
|
+
import { ChevronRightIcon } from 'primereact/icons/chevronright';
|
|
6
|
+
import { classNames, mergeProps, IconUtils, ObjectUtils, UniqueComponentId } from 'primereact/utils';
|
|
7
|
+
import { ComponentBase } from 'primereact/componentbase';
|
|
7
8
|
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
function _typeof(obj) {
|
|
10
|
+
"@babel/helpers - typeof";
|
|
11
|
+
|
|
12
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
13
|
+
return typeof obj;
|
|
14
|
+
} : function (obj) {
|
|
15
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
16
|
+
}, _typeof(obj);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _toPrimitive(input, hint) {
|
|
20
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
21
|
+
var prim = input[Symbol.toPrimitive];
|
|
22
|
+
if (prim !== undefined) {
|
|
23
|
+
var res = prim.call(input, hint || "default");
|
|
24
|
+
if (_typeof(res) !== "object") return res;
|
|
25
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
26
|
+
}
|
|
27
|
+
return (hint === "string" ? String : Number)(input);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function _toPropertyKey(arg) {
|
|
31
|
+
var key = _toPrimitive(arg, "string");
|
|
32
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _defineProperty(obj, key, value) {
|
|
36
|
+
key = _toPropertyKey(key);
|
|
37
|
+
if (key in obj) {
|
|
38
|
+
Object.defineProperty(obj, key, {
|
|
39
|
+
value: value,
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true
|
|
43
|
+
});
|
|
44
|
+
} else {
|
|
45
|
+
obj[key] = value;
|
|
46
|
+
}
|
|
47
|
+
return obj;
|
|
21
48
|
}
|
|
22
49
|
|
|
23
50
|
function _arrayLikeToArray(arr, len) {
|
|
@@ -91,7 +118,7 @@ function _slicedToArray(arr, i) {
|
|
|
91
118
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
92
119
|
}
|
|
93
120
|
|
|
94
|
-
var PanelMenuBase = {
|
|
121
|
+
var PanelMenuBase = ComponentBase.extend({
|
|
95
122
|
defaultProps: {
|
|
96
123
|
__TYPE: 'Panel',
|
|
97
124
|
id: null,
|
|
@@ -102,20 +129,23 @@ var PanelMenuBase = {
|
|
|
102
129
|
multiple: false,
|
|
103
130
|
transitionOptions: null,
|
|
104
131
|
children: undefined
|
|
105
|
-
},
|
|
106
|
-
getProps: function getProps(props) {
|
|
107
|
-
return ObjectUtils.getMergedProps(props, PanelMenuBase.defaultProps);
|
|
108
|
-
},
|
|
109
|
-
getOtherProps: function getOtherProps(props) {
|
|
110
|
-
return ObjectUtils.getDiffProps(props, PanelMenuBase.defaultProps);
|
|
111
132
|
}
|
|
112
|
-
};
|
|
133
|
+
});
|
|
113
134
|
|
|
135
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
136
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
114
137
|
var PanelMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
115
138
|
var _React$useState = React.useState(null),
|
|
116
139
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
117
140
|
activeItemState = _React$useState2[0],
|
|
118
141
|
setActiveItemState = _React$useState2[1];
|
|
142
|
+
var getPTOptions = function getPTOptions(item, key) {
|
|
143
|
+
return props.ptm(key, {
|
|
144
|
+
context: {
|
|
145
|
+
active: isItemActive(item)
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
};
|
|
119
149
|
var findActiveItem = function findActiveItem() {
|
|
120
150
|
if (props.model) {
|
|
121
151
|
if (props.multiple) {
|
|
@@ -171,16 +201,21 @@ var PanelMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
171
201
|
});
|
|
172
202
|
var createSeparator = function createSeparator(index) {
|
|
173
203
|
var key = 'separator_' + index;
|
|
174
|
-
|
|
204
|
+
var separatorProps = mergeProps({
|
|
175
205
|
key: key,
|
|
176
|
-
className:
|
|
177
|
-
});
|
|
206
|
+
className: 'p-menu-separator'
|
|
207
|
+
}, props.ptm('separator'));
|
|
208
|
+
return /*#__PURE__*/React.createElement("li", separatorProps);
|
|
178
209
|
};
|
|
179
210
|
var createSubmenu = function createSubmenu(item, active) {
|
|
180
211
|
var className = classNames('p-toggleable-content', {
|
|
181
212
|
'p-toggleable-content-collapsed': !active
|
|
182
213
|
});
|
|
183
214
|
var submenuRef = /*#__PURE__*/React.createRef();
|
|
215
|
+
var toggleableContentProps = mergeProps({
|
|
216
|
+
ref: submenuRef,
|
|
217
|
+
className: className
|
|
218
|
+
}, props.ptm('toggleableContent'));
|
|
184
219
|
if (item.items) {
|
|
185
220
|
return /*#__PURE__*/React.createElement(CSSTransition, {
|
|
186
221
|
nodeRef: submenuRef,
|
|
@@ -191,14 +226,12 @@ var PanelMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
191
226
|
},
|
|
192
227
|
"in": active,
|
|
193
228
|
unmountOnExit: true
|
|
194
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
195
|
-
ref: submenuRef,
|
|
196
|
-
className: className
|
|
197
|
-
}, /*#__PURE__*/React.createElement(PanelMenuSub, {
|
|
229
|
+
}, /*#__PURE__*/React.createElement("div", toggleableContentProps, /*#__PURE__*/React.createElement(PanelMenuSub, {
|
|
198
230
|
menuProps: props.menuProps,
|
|
199
231
|
model: item.items,
|
|
200
232
|
multiple: props.multiple,
|
|
201
|
-
submenuIcon: props.submenuIcon
|
|
233
|
+
submenuIcon: props.submenuIcon,
|
|
234
|
+
ptm: props.ptm
|
|
202
235
|
})));
|
|
203
236
|
}
|
|
204
237
|
return null;
|
|
@@ -214,31 +247,33 @@ var PanelMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
214
247
|
'p-disabled': item.disabled
|
|
215
248
|
});
|
|
216
249
|
var iconClassName = classNames('p-menuitem-icon', item.icon);
|
|
217
|
-
var
|
|
218
|
-
className:
|
|
219
|
-
},
|
|
250
|
+
var iconProps = mergeProps({
|
|
251
|
+
className: iconClassName
|
|
252
|
+
}, getPTOptions(item, 'icon'));
|
|
253
|
+
var icon = IconUtils.getJSXIcon(item.icon, _objectSpread$1({}, iconProps), {
|
|
220
254
|
props: props.menuProps
|
|
221
255
|
});
|
|
222
|
-
var
|
|
223
|
-
className:
|
|
224
|
-
}, item
|
|
256
|
+
var labelProps = mergeProps({
|
|
257
|
+
className: 'p-menuitem-text'
|
|
258
|
+
}, getPTOptions(item, 'label'));
|
|
259
|
+
var label = item.label && /*#__PURE__*/React.createElement("span", labelProps, item.label);
|
|
225
260
|
var submenuIconClassName = 'p-panelmenu-icon';
|
|
226
|
-
var
|
|
227
|
-
className: submenuIconClassName
|
|
228
|
-
}) : props.submenuIcon || /*#__PURE__*/React.createElement(ChevronRightIcon, {
|
|
261
|
+
var submenuIconProps = mergeProps({
|
|
229
262
|
className: submenuIconClassName
|
|
230
|
-
}));
|
|
263
|
+
}, getPTOptions(item, 'submenuicon'));
|
|
264
|
+
var submenuIcon = item.items && IconUtils.getJSXIcon(active ? props.submenuIcon || /*#__PURE__*/React.createElement(ChevronDownIcon, submenuIconProps) : props.submenuIcon || /*#__PURE__*/React.createElement(ChevronRightIcon, submenuIconProps));
|
|
231
265
|
var submenu = createSubmenu(item, active);
|
|
232
|
-
var
|
|
266
|
+
var actionProps = mergeProps({
|
|
233
267
|
href: item.url || '#',
|
|
234
268
|
className: linkClassName,
|
|
235
269
|
target: item.target,
|
|
236
270
|
onClick: function onClick(event) {
|
|
237
271
|
return onItemClick(event, item);
|
|
238
272
|
},
|
|
239
|
-
role:
|
|
240
|
-
|
|
241
|
-
},
|
|
273
|
+
role: 'menuitem',
|
|
274
|
+
'aria-disabled': item.disabled
|
|
275
|
+
}, getPTOptions(item, 'action'));
|
|
276
|
+
var content = /*#__PURE__*/React.createElement("a", actionProps, submenuIcon, icon, label);
|
|
242
277
|
if (item.template) {
|
|
243
278
|
var defaultContentOptions = {
|
|
244
279
|
onClick: function onClick(event) {
|
|
@@ -255,13 +290,14 @@ var PanelMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
255
290
|
};
|
|
256
291
|
content = ObjectUtils.getJSXElement(item.template, item, defaultContentOptions);
|
|
257
292
|
}
|
|
258
|
-
|
|
293
|
+
var menuitemProps = mergeProps({
|
|
259
294
|
key: key,
|
|
260
295
|
id: item.id,
|
|
261
296
|
className: className,
|
|
262
297
|
style: item.style,
|
|
263
|
-
role:
|
|
264
|
-
},
|
|
298
|
+
role: 'none'
|
|
299
|
+
}, getPTOptions(item, 'menuitem'));
|
|
300
|
+
return /*#__PURE__*/React.createElement("li", menuitemProps, content, submenu);
|
|
265
301
|
};
|
|
266
302
|
var createItem = function createItem(item, index) {
|
|
267
303
|
return item.separator ? createSeparator(index) : createMenuItem(item, index);
|
|
@@ -271,13 +307,16 @@ var PanelMenuSub = /*#__PURE__*/React.memo(function (props) {
|
|
|
271
307
|
};
|
|
272
308
|
var className = classNames('p-submenu-list', props.className);
|
|
273
309
|
var menu = createMenu();
|
|
274
|
-
|
|
310
|
+
var menuProps = mergeProps({
|
|
275
311
|
className: className,
|
|
276
|
-
role:
|
|
277
|
-
}, menu);
|
|
312
|
+
role: 'tree'
|
|
313
|
+
}, props.ptm('menu'));
|
|
314
|
+
return /*#__PURE__*/React.createElement("ul", menuProps, menu);
|
|
278
315
|
});
|
|
279
316
|
PanelMenuSub.displayName = 'PanelMenuSub';
|
|
280
317
|
|
|
318
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
319
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
281
320
|
var PanelMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
282
321
|
var props = PanelMenuBase.getProps(inProps);
|
|
283
322
|
var _React$useState = React.useState(props.id),
|
|
@@ -295,6 +334,15 @@ var PanelMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
295
334
|
var elementRef = React.useRef(null);
|
|
296
335
|
var headerId = idState + '_header';
|
|
297
336
|
var contentId = idState + '_content';
|
|
337
|
+
var _PanelMenuBase$setMet = PanelMenuBase.setMetaData({
|
|
338
|
+
props: props,
|
|
339
|
+
state: {
|
|
340
|
+
id: idState,
|
|
341
|
+
activeItem: activeItemState,
|
|
342
|
+
animationDisabled: animationDisabled
|
|
343
|
+
}
|
|
344
|
+
}),
|
|
345
|
+
ptm = _PanelMenuBase$setMet.ptm;
|
|
298
346
|
var findActiveItem = function findActiveItem() {
|
|
299
347
|
if (props.model) {
|
|
300
348
|
if (props.multiple) {
|
|
@@ -345,6 +393,13 @@ var PanelMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
345
393
|
var isItemActive = function isItemActive(item) {
|
|
346
394
|
return activeItemState && (props.multiple ? activeItemState.indexOf(item) > -1 : activeItemState === item);
|
|
347
395
|
};
|
|
396
|
+
var getPTOptions = function getPTOptions(item, key) {
|
|
397
|
+
return ptm(key, {
|
|
398
|
+
context: {
|
|
399
|
+
active: isItemActive(item)
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
};
|
|
348
403
|
React.useImperativeHandle(ref, function () {
|
|
349
404
|
return {
|
|
350
405
|
props: props,
|
|
@@ -378,35 +433,37 @@ var PanelMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
378
433
|
'p-disabled': item.disabled
|
|
379
434
|
});
|
|
380
435
|
var iconClassName = classNames('p-menuitem-icon', item.icon);
|
|
381
|
-
var
|
|
382
|
-
className:
|
|
383
|
-
},
|
|
436
|
+
var headerIconProps = mergeProps({
|
|
437
|
+
className: iconClassName
|
|
438
|
+
}, getPTOptions(item, 'headerIcon'));
|
|
439
|
+
var icon = IconUtils.getJSXIcon(item.icon, _objectSpread({}, headerIconProps), {
|
|
384
440
|
props: props
|
|
385
441
|
});
|
|
386
442
|
var submenuIconClassName = 'p-panelmenu-icon';
|
|
387
|
-
var
|
|
388
|
-
className: submenuIconClassName
|
|
389
|
-
}) : props.submenuIcon || /*#__PURE__*/React.createElement(ChevronRightIcon, {
|
|
443
|
+
var headerSubmenuIconProps = mergeProps({
|
|
390
444
|
className: submenuIconClassName
|
|
391
|
-
}));
|
|
392
|
-
var
|
|
393
|
-
|
|
394
|
-
|
|
445
|
+
}, getPTOptions(item, 'headerSubmenuIcon'));
|
|
446
|
+
var submenuIcon = item.items && IconUtils.getJSXIcon(active ? props.submenuIcon || /*#__PURE__*/React.createElement(ChevronDownIcon, headerSubmenuIconProps) : props.submenuIcon || /*#__PURE__*/React.createElement(ChevronRightIcon, headerSubmenuIconProps));
|
|
447
|
+
var headerLabelProps = mergeProps({
|
|
448
|
+
className: 'p-menuitem-text'
|
|
449
|
+
}, getPTOptions(item, 'headerLabel'));
|
|
450
|
+
var label = item.label && /*#__PURE__*/React.createElement("span", headerLabelProps, item.label);
|
|
395
451
|
var contentWrapperClassName = classNames('p-toggleable-content', {
|
|
396
452
|
'p-toggleable-content-collapsed': !active
|
|
397
453
|
});
|
|
398
454
|
var menuContentRef = /*#__PURE__*/React.createRef();
|
|
399
|
-
var
|
|
455
|
+
var headerActionProps = mergeProps({
|
|
400
456
|
href: item.url || '#',
|
|
401
|
-
className:
|
|
457
|
+
className: 'p-panelmenu-header-link',
|
|
402
458
|
onClick: function onClick(e) {
|
|
403
459
|
return onItemClick(e, item);
|
|
404
460
|
},
|
|
405
|
-
|
|
461
|
+
'aria-expanded': active,
|
|
406
462
|
id: headerId,
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
},
|
|
463
|
+
'aria-controls': contentId,
|
|
464
|
+
'aria-disabled': item.disabled
|
|
465
|
+
}, getPTOptions(item, 'headerAction'));
|
|
466
|
+
var content = /*#__PURE__*/React.createElement("a", headerActionProps, submenuIcon, icon, label);
|
|
410
467
|
if (item.template) {
|
|
411
468
|
var defaultContentOptions = {
|
|
412
469
|
onClick: function onClick(event) {
|
|
@@ -423,14 +480,26 @@ var PanelMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
423
480
|
};
|
|
424
481
|
content = ObjectUtils.getJSXElement(item.template, item, defaultContentOptions);
|
|
425
482
|
}
|
|
426
|
-
|
|
483
|
+
var panelProps = mergeProps({
|
|
427
484
|
key: key,
|
|
428
485
|
className: className,
|
|
429
486
|
style: item.style
|
|
430
|
-
},
|
|
487
|
+
}, getPTOptions(item, 'panel'));
|
|
488
|
+
var headerProps = mergeProps({
|
|
431
489
|
className: headerClassName,
|
|
432
490
|
style: item.style
|
|
433
|
-
},
|
|
491
|
+
}, getPTOptions(item, 'header'));
|
|
492
|
+
var menuContentProps = mergeProps({
|
|
493
|
+
className: 'p-panelmenu-content'
|
|
494
|
+
}, getPTOptions(item, 'menuContent'));
|
|
495
|
+
var headerToggleableContentProps = mergeProps({
|
|
496
|
+
ref: menuContentRef,
|
|
497
|
+
className: contentWrapperClassName,
|
|
498
|
+
role: 'region',
|
|
499
|
+
id: contentId,
|
|
500
|
+
'aria-labelledby': headerId
|
|
501
|
+
}, getPTOptions(item, 'headerToggleableContent'));
|
|
502
|
+
return /*#__PURE__*/React.createElement("div", panelProps, /*#__PURE__*/React.createElement("div", headerProps, content), /*#__PURE__*/React.createElement(CSSTransition, {
|
|
434
503
|
nodeRef: menuContentRef,
|
|
435
504
|
classNames: "p-toggleable-content",
|
|
436
505
|
timeout: {
|
|
@@ -442,34 +511,27 @@ var PanelMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
442
511
|
"in": active,
|
|
443
512
|
unmountOnExit: true,
|
|
444
513
|
options: props.transitionOptions
|
|
445
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
446
|
-
ref: menuContentRef,
|
|
447
|
-
className: contentWrapperClassName,
|
|
448
|
-
role: "region",
|
|
449
|
-
id: contentId,
|
|
450
|
-
"aria-labelledby": headerId
|
|
451
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
452
|
-
className: "p-panelmenu-content"
|
|
453
|
-
}, /*#__PURE__*/React.createElement(PanelMenuSub, {
|
|
514
|
+
}, /*#__PURE__*/React.createElement("div", headerToggleableContentProps, /*#__PURE__*/React.createElement("div", menuContentProps, /*#__PURE__*/React.createElement(PanelMenuSub, {
|
|
454
515
|
menuProps: props,
|
|
455
516
|
model: item.items,
|
|
456
517
|
className: "p-panelmenu-root-submenu",
|
|
457
518
|
multiple: props.multiple,
|
|
458
|
-
submenuIcon: props.submenuIcon
|
|
519
|
+
submenuIcon: props.submenuIcon,
|
|
520
|
+
ptm: ptm
|
|
459
521
|
})))));
|
|
460
522
|
};
|
|
461
523
|
var createPanels = function createPanels() {
|
|
462
524
|
return props.model ? props.model.map(createPanel) : null;
|
|
463
525
|
};
|
|
464
|
-
var otherProps = PanelMenuBase.getOtherProps(props);
|
|
465
526
|
var className = classNames('p-panelmenu p-component', props.className);
|
|
466
527
|
var panels = createPanels();
|
|
467
|
-
|
|
528
|
+
var rootProps = mergeProps({
|
|
468
529
|
id: props.id,
|
|
469
530
|
ref: elementRef,
|
|
470
531
|
className: className,
|
|
471
532
|
style: props.style
|
|
472
|
-
},
|
|
533
|
+
}, PanelMenuBase.getOtherProps(props), ptm('root'));
|
|
534
|
+
return /*#__PURE__*/React.createElement("div", rootProps, panels);
|
|
473
535
|
}));
|
|
474
536
|
PanelMenu.displayName = 'PanelMenu';
|
|
475
537
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{CSSTransition as
|
|
1
|
+
import*as e from"react";import{CSSTransition as t}from"primereact/csstransition";import{useMountEffect as n,useUpdateEffect as r}from"primereact/hooks";import{ChevronDownIcon as l}from"primereact/icons/chevrondown";import{ChevronRightIcon as a}from"primereact/icons/chevronright";import{classNames as o,mergeProps as i,IconUtils as u,ObjectUtils as c,UniqueComponentId as m}from"primereact/utils";import{ComponentBase as s}from"primereact/componentbase";function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function d(e){var t=f(e,"string");return"symbol"===p(t)?t:String(t)}function b(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(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 v(e){if(Array.isArray(e))return y(e)}function g(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function O(e,t){if(e){if("string"==typeof e)return y(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)?y(e,t):void 0}}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e){return v(e)||g(e)||O(e)||h()}function N(e){if(Array.isArray(e))return e}function S(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,a,o,i=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(i.push(r.value),i.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw l}}return i}}function j(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(e,t){return N(e)||S(e,t)||O(e,t)||j()}var x=s.extend({defaultProps:{__TYPE:"Panel",id:null,model:null,style:null,submenuIcon:null,className:null,multiple:!1,transitionOptions:null,children:void 0}});function I(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 w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var C=e.memo((function(r){var m=P(e.useState(null),2),s=m[0],p=m[1],f=function(e,t){return r.ptm(t,{context:{active:y(e)}})},d=function(){if(r.model){if(r.multiple)return r.model.filter((function(e){return e.expanded}));var e=null;return r.model.forEach((function(t){t.expanded&&(e?t.expanded=!1:e=t)})),e}return null},b=function(e,t){if(t.disabled)e.preventDefault();else{t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t});var n=s;y(t)?(t.expanded=!1,p(r.multiple?n.filter((function(e){return e!==t})):null)):(!r.multiple&&n&&(n.expanded=!1),t.expanded=!0,p(r.multiple?[].concat(E(n||[]),[t]):t))}},y=function(e){return s&&(r.multiple?s.indexOf(e)>-1:s===e)};n((function(){p(d())}));var v=function(t){var n=i({key:"separator_"+t,className:"p-menu-separator"},r.ptm("separator"));return e.createElement("li",n)},g=function(n,l){var a=o("p-toggleable-content",{"p-toggleable-content-collapsed":!l}),u=e.createRef(),c=i({ref:u,className:a},r.ptm("toggleableContent"));return n.items?e.createElement(t,{nodeRef:u,classNames:"p-toggleable-content",timeout:{enter:1e3,exit:450},in:l,unmountOnExit:!0},e.createElement("div",c,e.createElement(C,{menuProps:r.menuProps,model:n.items,multiple:r.multiple,submenuIcon:r.submenuIcon,ptm:r.ptm}))):null},O=function(t,n){if(!1===t.visible)return null;var m=t.label+"_"+n,s=y(t),p=o("p-menuitem",t.className),d=o("p-menuitem-link",{"p-disabled":t.disabled}),v=o("p-menuitem-icon",t.icon),O=i({className:v},f(t,"icon")),h=u.getJSXIcon(t.icon,w({},O),{props:r.menuProps}),E=i({className:"p-menuitem-text"},f(t,"label")),N=t.label&&e.createElement("span",E,t.label),S="p-panelmenu-icon",j=i({className:S},f(t,"submenuicon")),P=t.items&&u.getJSXIcon(s?r.submenuIcon||e.createElement(l,j):r.submenuIcon||e.createElement(a,j)),x=g(t,s),I=i({href:t.url||"#",className:d,target:t.target,onClick:function(e){return b(e,t)},role:"menuitem","aria-disabled":t.disabled},f(t,"action")),C=e.createElement("a",I,P,h,N);t.template&&(C=c.getJSXElement(t.template,t,{onClick:function(e){return b(e,t)},className:d,labelClassName:"p-menuitem-text",iconClassName:v,submenuIconClassName:S,element:C,props:r,leaf:!t.items,active:s}));var D=i({key:m,id:t.id,className:p,style:t.style,role:"none"},f(t,"menuitem"));return e.createElement("li",D,C,x)},h=function(e,t){return e.separator?v(t):O(e,t)},N=o("p-submenu-list",r.className),S=r.model?r.model.map(h):null,j=i({className:N,role:"tree"},r.ptm("menu"));return e.createElement("ul",j,S)}));function D(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 k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}C.displayName="PanelMenuSub";var A=e.memo(e.forwardRef((function(s,p){var f=x.getProps(s),d=P(e.useState(f.id),2),b=d[0],y=d[1],v=P(e.useState(null),2),g=v[0],O=v[1],h=P(e.useState(!1),2),N=h[0],S=h[1],j=e.useRef(null),I=b+"_header",w=b+"_content",D=x.setMetaData({props:f,state:{id:b,activeItem:g,animationDisabled:N}}).ptm,A=function(){if(f.model){if(f.multiple)return f.model.filter((function(e){return e.expanded}));var e=null;return f.model.forEach((function(t){t.expanded&&(e?t.expanded=!1:e=t)})),e}return null},_=function(e,t){if(t.disabled)e.preventDefault();else{t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t});var n=g;J(t)?(t.expanded=!1,O(f.multiple?n.filter((function(e){return e!==t})):null)):(!f.multiple&&n&&(n.expanded=!1),t.expanded=!0,O(f.multiple?[].concat(E(n||[]),[t]):t))}},J=function(e){return g&&(f.multiple?g.indexOf(e)>-1:g===e)},R=function(e,t){return D(t,{context:{active:J(e)}})};e.useImperativeHandle(p,(function(){return{props:f,getElement:function(){return j.current}}})),n((function(){b||y(m()),O(A())})),r((function(){S(!0),O(A())}),[f.model]);var X=function(){S(!1)},T=function(n,r){if(!1===n.visible)return null;var m=n.label+"_"+r,s=J(n),p=o("p-panelmenu-panel",n.className),d=o("p-component p-panelmenu-header",{"p-highlight":s,"p-disabled":n.disabled}),b=o("p-menuitem-icon",n.icon),y=i({className:b},R(n,"headerIcon")),v=u.getJSXIcon(n.icon,k({},y),{props:f}),g="p-panelmenu-icon",O=i({className:g},R(n,"headerSubmenuIcon")),h=n.items&&u.getJSXIcon(s?f.submenuIcon||e.createElement(l,O):f.submenuIcon||e.createElement(a,O)),E=i({className:"p-menuitem-text"},R(n,"headerLabel")),S=n.label&&e.createElement("span",E,n.label),j=o("p-toggleable-content",{"p-toggleable-content-collapsed":!s}),P=e.createRef(),x=i({href:n.url||"#",className:"p-panelmenu-header-link",onClick:function(e){return _(e,n)},"aria-expanded":s,id:I,"aria-controls":w,"aria-disabled":n.disabled},R(n,"headerAction")),A=e.createElement("a",x,h,v,S);n.template&&(A=c.getJSXElement(n.template,n,{onClick:function(e){return _(e,n)},className:"p-panelmenu-header-link",labelClassName:"p-menuitem-text",submenuIconClassName:g,iconClassName:b,element:A,props:f,leaf:!n.items,active:s}));var T=i({key:m,className:p,style:n.style},R(n,"panel")),M=i({className:d,style:n.style},R(n,"header")),H=i({className:"p-panelmenu-content"},R(n,"menuContent")),L=i({ref:P,className:j,role:"region",id:w,"aria-labelledby":I},R(n,"headerToggleableContent"));return e.createElement("div",T,e.createElement("div",M,A),e.createElement(t,{nodeRef:P,classNames:"p-toggleable-content",timeout:{enter:1e3,exit:450},onEnter:X,disabled:N,in:s,unmountOnExit:!0,options:f.transitionOptions},e.createElement("div",L,e.createElement("div",H,e.createElement(C,{menuProps:f,model:n.items,className:"p-panelmenu-root-submenu",multiple:f.multiple,submenuIcon:f.submenuIcon,ptm:D})))))},M=o("p-panelmenu p-component",f.className),H=f.model?f.model.map(T):null,L=i({id:f.id,ref:j,className:M,style:f.style},x.getOtherProps(f),D("root"));return e.createElement("div",L,H)})));A.displayName="PanelMenu";export{A as PanelMenu};
|