primereact 9.3.1 → 9.4.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/autocomplete/autocomplete.cjs.js +9 -5
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +9 -5
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +8 -4
- 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/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 +29 -22
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +29 -22
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +26 -19
- 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 +16 -28
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +16 -28
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +14 -26
- package/carousel/carousel.min.js +1 -1
- package/chart/chart.cjs.js +5 -1
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.d.ts +5 -0
- package/chart/chart.esm.js +5 -1
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +5 -1
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +22 -7
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +14 -1
- package/checkbox/checkbox.esm.js +22 -7
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +23 -8
- 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 +13 -5
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +13 -5
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +14 -6
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +7 -4
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +8 -0
- package/colorpicker/colorpicker.esm.js +7 -4
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +7 -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/core/core.js +1159 -966
- package/core/core.min.js +13 -11
- package/datatable/datatable.cjs.js +72 -35
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +20 -7
- package/datatable/datatable.esm.js +72 -35
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +65 -28
- 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/dropdown/dropdown.cjs.js +45 -19
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +6 -1
- package/dropdown/dropdown.esm.js +45 -19
- 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 +13 -14
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +14 -15
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +14 -16
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +5 -0
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +5 -0
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +5 -0
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +15 -2
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +15 -2
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +15 -2
- package/hooks/hooks.min.js +1 -1
- package/image/image.cjs.js +41 -32
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +41 -32
- package/image/image.esm.min.js +1 -1
- package/image/image.js +39 -30
- 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 +6 -2
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +6 -2
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +6 -2
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +8 -4
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +8 -4
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +8 -4
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +6 -2
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +6 -2
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +6 -2
- 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/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/menuitem/menuitem.d.ts +0 -2
- package/messages/messages.cjs.js +15 -12
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.esm.js +15 -12
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +15 -12
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +46 -22
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +4 -0
- package/multiselect/multiselect.esm.js +46 -22
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +45 -21
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +6 -2
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +6 -2
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +6 -2
- 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/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/primereact.all.cjs.js +2222 -1712
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2222 -1713
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +2222 -1712
- 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 +29 -14
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.d.ts +14 -1
- package/radiobutton/radiobutton.esm.js +29 -14
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +29 -14
- 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 +72 -72
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +3 -0
- package/resources/themes/arya-green/theme.css +3 -0
- package/resources/themes/arya-orange/theme.css +3 -0
- package/resources/themes/arya-purple/theme.css +3 -0
- package/resources/themes/bootstrap4-dark-blue/theme.css +3 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +3 -0
- package/resources/themes/bootstrap4-light-blue/theme.css +3 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +3 -0
- package/resources/themes/fluent-light/theme.css +3 -0
- package/resources/themes/lara-dark-blue/theme.css +3 -0
- package/resources/themes/lara-dark-indigo/theme.css +3 -0
- package/resources/themes/lara-dark-purple/theme.css +3 -0
- package/resources/themes/lara-dark-teal/theme.css +3 -0
- package/resources/themes/lara-light-blue/theme.css +3 -0
- package/resources/themes/lara-light-indigo/theme.css +3 -0
- package/resources/themes/lara-light-purple/theme.css +3 -0
- package/resources/themes/lara-light-teal/theme.css +3 -0
- package/resources/themes/luna-amber/theme.css +3 -0
- package/resources/themes/luna-blue/theme.css +3 -0
- package/resources/themes/luna-green/theme.css +3 -0
- package/resources/themes/luna-pink/theme.css +3 -0
- package/resources/themes/md-dark-deeppurple/theme.css +3 -0
- package/resources/themes/md-dark-indigo/theme.css +3 -0
- package/resources/themes/md-light-deeppurple/theme.css +3 -0
- package/resources/themes/md-light-indigo/theme.css +3 -0
- package/resources/themes/mdc-dark-deeppurple/theme.css +3 -0
- package/resources/themes/mdc-dark-indigo/theme.css +3 -0
- package/resources/themes/mdc-light-deeppurple/theme.css +3 -0
- package/resources/themes/mdc-light-indigo/theme.css +3 -0
- package/resources/themes/mira/theme.css +3 -0
- package/resources/themes/nano/theme.css +3 -0
- package/resources/themes/nova/theme.css +3 -0
- package/resources/themes/nova-accent/theme.css +3 -0
- package/resources/themes/nova-alt/theme.css +3 -0
- package/resources/themes/rhea/theme.css +3 -0
- package/resources/themes/saga-blue/theme.css +3 -0
- package/resources/themes/saga-green/theme.css +3 -0
- package/resources/themes/saga-orange/theme.css +3 -0
- package/resources/themes/saga-purple/theme.css +3 -0
- package/resources/themes/soho-dark/theme.css +3 -0
- package/resources/themes/soho-light/theme.css +3 -0
- package/resources/themes/tailwind-light/theme.css +3 -0
- package/resources/themes/vela-blue/theme.css +3 -0
- package/resources/themes/vela-green/theme.css +3 -0
- package/resources/themes/vela-orange/theme.css +3 -0
- package/resources/themes/vela-purple/theme.css +3 -0
- package/resources/themes/viva-dark/theme.css +3 -0
- package/resources/themes/viva-light/theme.css +3 -0
- 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/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/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/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/timeline/timeline.d.ts +1 -1
- package/toast/toast.cjs.js +13 -10
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +4 -0
- package/toast/toast.esm.js +13 -10
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +13 -10
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +6 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +6 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +6 -2
- 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 +9 -5
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +1 -1
- package/treeselect/treeselect.esm.js +9 -5
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +8 -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 +8 -4
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +8 -4
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +8 -4
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +710 -672
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +4 -0
- package/utils/utils.esm.js +710 -673
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +710 -672
- package/utils/utils.min.js +1 -1
- package/web-types.json +13 -1
package/tabview/tabview.d.ts
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
14
|
import * as React from 'react';
|
|
15
|
-
import { IconType } from '../utils/utils';
|
|
15
|
+
import { IconType, PassThroughType } from '../utils/utils';
|
|
16
|
+
|
|
17
|
+
export declare type TabViewPassThroughType<T> = PassThroughType<T, TabViewPassThroughMethodOptions>;
|
|
18
|
+
export declare type TabPanelPassThroughType<T> = PassThroughType<T, TabPanelPassThroughMethodOptions>;
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
21
|
* Custom Tabpanel header template options
|
|
@@ -70,6 +73,41 @@ interface TabPanelHeaderTemplateOptions {
|
|
|
70
73
|
ariaControls: string;
|
|
71
74
|
}
|
|
72
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Custom passthrough(pt) option method.
|
|
78
|
+
*/
|
|
79
|
+
export interface TabPanelPassThroughMethodOptions {
|
|
80
|
+
props: TabPanelProps;
|
|
81
|
+
parent: TabViewPassThroughMethodOptions;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Custom passthrough(pt) options.
|
|
86
|
+
* @see {@link TabPanelProps.pt}
|
|
87
|
+
*/
|
|
88
|
+
export interface TabPanelPassThroughOptions {
|
|
89
|
+
/**
|
|
90
|
+
* Uses to pass attributes to the root's DOM element.
|
|
91
|
+
*/
|
|
92
|
+
root?: TabPanelPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
93
|
+
/**
|
|
94
|
+
* Uses to pass attributes to the header's DOM element.
|
|
95
|
+
*/
|
|
96
|
+
header?: TabPanelPassThroughType<React.HTMLAttributes<HTMLLIElement>>;
|
|
97
|
+
/**
|
|
98
|
+
* Uses to pass attributes to the header action's DOM element.
|
|
99
|
+
*/
|
|
100
|
+
headerAction?: TabPanelPassThroughType<React.HTMLAttributes<HTMLAnchorElement>>;
|
|
101
|
+
/**
|
|
102
|
+
* Uses to pass attributes to the title's DOM element.
|
|
103
|
+
*/
|
|
104
|
+
headerTitle?: TabPanelPassThroughType<React.HTMLAttributes<HTMLSpanElement>>;
|
|
105
|
+
/**
|
|
106
|
+
* Uses to pass attributes to the list's DOM element.
|
|
107
|
+
*/
|
|
108
|
+
content?: TabPanelPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
109
|
+
}
|
|
110
|
+
|
|
73
111
|
/**
|
|
74
112
|
* Defines valid properties in TabPanel component.
|
|
75
113
|
* @group Properties
|
|
@@ -142,6 +180,11 @@ export interface TabPanelProps {
|
|
|
142
180
|
* @readonly
|
|
143
181
|
*/
|
|
144
182
|
children?: React.ReactNode | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Uses to pass attributes to DOM elements inside the component.
|
|
185
|
+
* @type {TabPanelPassThroughOptions}
|
|
186
|
+
*/
|
|
187
|
+
pt?: TabPanelPassThroughOptions;
|
|
145
188
|
}
|
|
146
189
|
|
|
147
190
|
/**
|
|
@@ -182,6 +225,89 @@ interface TabViewTabCloseEvent {
|
|
|
182
225
|
index: number;
|
|
183
226
|
}
|
|
184
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Custom passthrough(pt) option method.
|
|
230
|
+
*/
|
|
231
|
+
export interface TabViewPassThroughMethodOptions {
|
|
232
|
+
props: TabViewProps;
|
|
233
|
+
state: TabViewState;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Defines current inline state in TabView component.
|
|
238
|
+
*/
|
|
239
|
+
export interface TabViewState {
|
|
240
|
+
/**
|
|
241
|
+
* Current active index state.
|
|
242
|
+
*/
|
|
243
|
+
activeIndex: number;
|
|
244
|
+
/**
|
|
245
|
+
* Unique id for the TabView component.
|
|
246
|
+
*/
|
|
247
|
+
id: string;
|
|
248
|
+
/**
|
|
249
|
+
* Current state of hidden tab.
|
|
250
|
+
*/
|
|
251
|
+
hiddenTabsState: number[];
|
|
252
|
+
/**
|
|
253
|
+
* Current state of previous button.
|
|
254
|
+
* @defaultValue true
|
|
255
|
+
*/
|
|
256
|
+
isPrevButtonDisabled: boolean;
|
|
257
|
+
/**
|
|
258
|
+
* Current state of the next button.
|
|
259
|
+
* @defaultValue false
|
|
260
|
+
*/
|
|
261
|
+
isNextButtonDisabled: boolean;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Custom passthrough(pt) options.
|
|
266
|
+
* @see {@link TabViewProps.pt}
|
|
267
|
+
*/
|
|
268
|
+
export interface TabViewPassThroughOptions {
|
|
269
|
+
/**
|
|
270
|
+
* Uses to pass attributes to the root's DOM element.
|
|
271
|
+
*/
|
|
272
|
+
root?: TabViewPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
273
|
+
/**
|
|
274
|
+
* Uses to pass attributes to the nav container's DOM element.
|
|
275
|
+
*/
|
|
276
|
+
navContainer?: TabViewPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
277
|
+
/**
|
|
278
|
+
* Uses to pass attributes to the nav content's DOM element.
|
|
279
|
+
*/
|
|
280
|
+
navContent?: TabViewPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
281
|
+
/**
|
|
282
|
+
* Uses to pass attributes to the list's DOM element.
|
|
283
|
+
*/
|
|
284
|
+
nav?: TabViewPassThroughType<React.HTMLAttributes<HTMLUListElement>>;
|
|
285
|
+
/**
|
|
286
|
+
* Uses to pass attributes to the inkbar's DOM element.
|
|
287
|
+
*/
|
|
288
|
+
inkbar?: TabViewPassThroughType<React.HTMLAttributes<HTMLLIElement>>;
|
|
289
|
+
/**
|
|
290
|
+
* Uses to pass attributes to the previous button's DOM element.
|
|
291
|
+
*/
|
|
292
|
+
previousButton?: TabViewPassThroughType<React.HTMLAttributes<HTMLButtonElement>>;
|
|
293
|
+
/**
|
|
294
|
+
* Uses to pass attributes to the previous button icon's DOM element.
|
|
295
|
+
*/
|
|
296
|
+
previousIcon?: TabViewPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
|
|
297
|
+
/**
|
|
298
|
+
* Uses to pass attributes to the next button's DOM element.
|
|
299
|
+
*/
|
|
300
|
+
nextButton?: TabViewPassThroughType<React.HTMLAttributes<HTMLButtonElement>>;
|
|
301
|
+
/**
|
|
302
|
+
* Uses to pass attributes to the next button icon's DOM element.
|
|
303
|
+
*/
|
|
304
|
+
nextIcon?: TabViewPassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
|
|
305
|
+
/**
|
|
306
|
+
* Uses to pass attributes to the panel's DOM element.
|
|
307
|
+
*/
|
|
308
|
+
panelContainer?: TabViewPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
|
|
309
|
+
}
|
|
310
|
+
|
|
185
311
|
/**
|
|
186
312
|
* Defines valid properties in TabView component. In addition to these, all properties of HTMLDivElement can be used in this component.
|
|
187
313
|
* @group Properties
|
|
@@ -215,6 +341,11 @@ export interface TabViewProps extends Omit<React.DetailedHTMLProps<React.HTMLAtt
|
|
|
215
341
|
* @defaultValue false
|
|
216
342
|
*/
|
|
217
343
|
scrollable?: boolean | undefined;
|
|
344
|
+
/**
|
|
345
|
+
* Uses to pass attributes to DOM elements inside the component.
|
|
346
|
+
* @type {TabViewPassThroughOptions}
|
|
347
|
+
*/
|
|
348
|
+
pt?: TabViewPassThroughOptions;
|
|
218
349
|
/**
|
|
219
350
|
* Callback to invoke before an active tab is changed. Return false to prevent tab from changing.
|
|
220
351
|
* @param {TabViewTabChangeEvent} event - Custom tab change event.
|
package/tabview/tabview.esm.js
CHANGED
|
@@ -2,24 +2,41 @@ import * as React from 'react';
|
|
|
2
2
|
import { ariaLabel } from 'primereact/api';
|
|
3
3
|
import { useMountEffect, useUpdateEffect } from 'primereact/hooks';
|
|
4
4
|
import { Ripple } from 'primereact/ripple';
|
|
5
|
-
import { ObjectUtils, UniqueComponentId, classNames, DomHandler, IconUtils } from 'primereact/utils';
|
|
5
|
+
import { ObjectUtils, UniqueComponentId, classNames, mergeProps, DomHandler, IconUtils } from 'primereact/utils';
|
|
6
|
+
import { ComponentBase } from 'primereact/componentbase';
|
|
6
7
|
import { ChevronRightIcon } from 'primereact/icons/chevronright';
|
|
7
8
|
import { ChevronLeftIcon } from 'primereact/icons/chevronleft';
|
|
8
9
|
import { TimesIcon } from 'primereact/icons/times';
|
|
9
10
|
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
function _arrayLikeToArray(arr, len) {
|
|
12
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
13
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
14
|
+
return arr2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _arrayWithoutHoles(arr) {
|
|
18
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _iterableToArray(iter) {
|
|
22
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
26
|
+
if (!o) return;
|
|
27
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
28
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
29
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
30
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
31
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _nonIterableSpread() {
|
|
35
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _toConsumableArray(arr) {
|
|
39
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
23
40
|
}
|
|
24
41
|
|
|
25
42
|
function _typeof(obj) {
|
|
@@ -63,37 +80,6 @@ function _defineProperty(obj, key, value) {
|
|
|
63
80
|
return obj;
|
|
64
81
|
}
|
|
65
82
|
|
|
66
|
-
function _arrayLikeToArray(arr, len) {
|
|
67
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
68
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
69
|
-
return arr2;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _arrayWithoutHoles(arr) {
|
|
73
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function _iterableToArray(iter) {
|
|
77
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
81
|
-
if (!o) return;
|
|
82
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
83
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
84
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
85
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
86
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function _nonIterableSpread() {
|
|
90
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function _toConsumableArray(arr) {
|
|
94
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
83
|
function _arrayWithHoles(arr) {
|
|
98
84
|
if (Array.isArray(arr)) return arr;
|
|
99
85
|
}
|
|
@@ -134,7 +120,7 @@ function _slicedToArray(arr, i) {
|
|
|
134
120
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
135
121
|
}
|
|
136
122
|
|
|
137
|
-
var TabViewBase = {
|
|
123
|
+
var TabViewBase = ComponentBase.extend({
|
|
138
124
|
defaultProps: {
|
|
139
125
|
__TYPE: 'TabView',
|
|
140
126
|
id: null,
|
|
@@ -150,15 +136,9 @@ var TabViewBase = {
|
|
|
150
136
|
scrollable: false,
|
|
151
137
|
style: null,
|
|
152
138
|
children: undefined
|
|
153
|
-
},
|
|
154
|
-
getProps: function getProps(props) {
|
|
155
|
-
return ObjectUtils.getMergedProps(props, TabViewBase.defaultProps);
|
|
156
|
-
},
|
|
157
|
-
getOtherProps: function getOtherProps(props) {
|
|
158
|
-
return ObjectUtils.getDiffProps(props, TabViewBase.defaultProps);
|
|
159
139
|
}
|
|
160
|
-
};
|
|
161
|
-
var TabPanelBase = {
|
|
140
|
+
});
|
|
141
|
+
var TabPanelBase = ComponentBase.extend({
|
|
162
142
|
defaultProps: {
|
|
163
143
|
__TYPE: 'TabPanel',
|
|
164
144
|
className: null,
|
|
@@ -187,7 +167,7 @@ var TabPanelBase = {
|
|
|
187
167
|
getCOtherProps: function getCOtherProps(tab) {
|
|
188
168
|
return ObjectUtils.getComponentDiffProps(tab, TabPanelBase.defaultProps);
|
|
189
169
|
}
|
|
190
|
-
};
|
|
170
|
+
});
|
|
191
171
|
|
|
192
172
|
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; }
|
|
193
173
|
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; }
|
|
@@ -222,6 +202,25 @@ var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
222
202
|
var nextBtnRef = React.useRef(null);
|
|
223
203
|
var tabsRef = React.useRef({});
|
|
224
204
|
var activeIndex = props.onTabChange ? props.activeIndex : activeIndexState;
|
|
205
|
+
var metaData = {
|
|
206
|
+
props: props,
|
|
207
|
+
state: {
|
|
208
|
+
id: idState,
|
|
209
|
+
isPrevButtonDisabled: backwardIsDisabledState,
|
|
210
|
+
isNextButtonDisabled: forwardIsDisabledState,
|
|
211
|
+
hiddenTabsState: hiddenTabsState,
|
|
212
|
+
activeIndex: activeIndexState
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
var _TabViewBase$setMetaD = TabViewBase.setMetaData(_objectSpread({}, metaData)),
|
|
216
|
+
ptm = _TabViewBase$setMetaD.ptm,
|
|
217
|
+
ptmo = _TabViewBase$setMetaD.ptmo;
|
|
218
|
+
var getTabPT = function getTabPT(tab, key) {
|
|
219
|
+
return ptmo(getTabProp(tab, 'pt'), key, {
|
|
220
|
+
props: tab.props,
|
|
221
|
+
parent: metaData
|
|
222
|
+
});
|
|
223
|
+
};
|
|
225
224
|
var isSelected = function isSelected(index) {
|
|
226
225
|
return index === activeIndex;
|
|
227
226
|
};
|
|
@@ -391,15 +390,16 @@ var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
391
390
|
var headerId = idState + '_header_' + index;
|
|
392
391
|
var ariaControls = idState + '_content_' + index;
|
|
393
392
|
var tabIndex = disabled ? null : 0;
|
|
394
|
-
var leftIconElement = leftIcon &&
|
|
393
|
+
var leftIconElement = leftIcon && IconUtils.getJSXIcon(leftIcon, undefined, {
|
|
395
394
|
props: props
|
|
396
|
-
})
|
|
397
|
-
var
|
|
398
|
-
className:
|
|
399
|
-
},
|
|
400
|
-
var
|
|
395
|
+
});
|
|
396
|
+
var headerTitleProps = mergeProps({
|
|
397
|
+
className: 'p-tabview-title'
|
|
398
|
+
}, getTabPT(tab, 'headertitle'));
|
|
399
|
+
var titleElement = /*#__PURE__*/React.createElement("span", headerTitleProps, header);
|
|
400
|
+
var rightIconElement = rightIcon && IconUtils.getJSXIcon(rightIcon, undefined, {
|
|
401
401
|
props: props
|
|
402
|
-
})
|
|
402
|
+
});
|
|
403
403
|
var iconClassName = 'p-tabview-close';
|
|
404
404
|
var icon = closeIcon || /*#__PURE__*/React.createElement(TimesIcon, {
|
|
405
405
|
className: iconClassName,
|
|
@@ -408,27 +408,31 @@ var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
408
408
|
}
|
|
409
409
|
});
|
|
410
410
|
var closableIconElement = closable ? IconUtils.getJSXIcon(icon, {
|
|
411
|
-
className: iconClassName
|
|
411
|
+
className: iconClassName,
|
|
412
|
+
onClick: function onClick(e) {
|
|
413
|
+
return onTabHeaderClose(e, index);
|
|
414
|
+
}
|
|
412
415
|
}, {
|
|
413
416
|
props: props
|
|
414
417
|
}) : null;
|
|
415
|
-
var
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
418
|
+
var headerActionProps = mergeProps({
|
|
419
|
+
id: headerId,
|
|
420
|
+
role: 'tab',
|
|
421
|
+
className: 'p-tabview-nav-link',
|
|
422
|
+
tabIndex: tabIndex,
|
|
423
|
+
'aria-controls': ariaControls,
|
|
424
|
+
'aria-selected': selected,
|
|
421
425
|
onClick: function onClick(e) {
|
|
422
426
|
return onTabHeaderClick(e, tab, index);
|
|
423
427
|
},
|
|
424
|
-
id: headerId,
|
|
425
428
|
onKeyDown: function onKeyDown(e) {
|
|
426
429
|
return _onKeyDown(e, tab, index);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
}
|
|
431
|
+
}, getTabPT(tab, 'headeraction'));
|
|
432
|
+
var content =
|
|
433
|
+
/*#__PURE__*/
|
|
434
|
+
// eslint-disable /
|
|
435
|
+
React.createElement("a", headerActionProps, leftIconElement, titleElement, rightIconElement, closableIconElement, /*#__PURE__*/React.createElement(Ripple, null))
|
|
432
436
|
// eslint-enable /
|
|
433
437
|
;
|
|
434
438
|
|
|
@@ -453,14 +457,15 @@ var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
453
457
|
};
|
|
454
458
|
content = ObjectUtils.getJSXElement(headerTemplate, defaultContentOptions);
|
|
455
459
|
}
|
|
456
|
-
|
|
460
|
+
var headerProps = mergeProps({
|
|
457
461
|
ref: function ref(el) {
|
|
458
462
|
return tabsRef.current["tab_".concat(index)] = el;
|
|
459
463
|
},
|
|
460
464
|
className: className,
|
|
461
465
|
style: style,
|
|
462
|
-
role:
|
|
463
|
-
},
|
|
466
|
+
role: 'presentation'
|
|
467
|
+
}, getTabPT(tab, 'root'), getTabPT(tab, 'header'));
|
|
468
|
+
return /*#__PURE__*/React.createElement("li", headerProps, content);
|
|
464
469
|
};
|
|
465
470
|
var createTabHeaders = function createTabHeaders() {
|
|
466
471
|
return React.Children.map(props.children, function (tab, index) {
|
|
@@ -471,23 +476,30 @@ var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
471
476
|
};
|
|
472
477
|
var createNavigator = function createNavigator() {
|
|
473
478
|
var headers = createTabHeaders();
|
|
474
|
-
|
|
475
|
-
ref: contentRef,
|
|
479
|
+
var navContentProps = mergeProps({
|
|
476
480
|
id: idState,
|
|
477
|
-
|
|
481
|
+
ref: contentRef,
|
|
482
|
+
className: 'p-tabview-nav-content',
|
|
478
483
|
style: props.style,
|
|
479
484
|
onScroll: onScroll
|
|
480
|
-
},
|
|
485
|
+
}, ptm('navcontent'));
|
|
486
|
+
var navProps = mergeProps({
|
|
481
487
|
ref: navRef,
|
|
482
|
-
className:
|
|
483
|
-
role:
|
|
484
|
-
},
|
|
488
|
+
className: 'p-tabview-nav',
|
|
489
|
+
role: 'tablist'
|
|
490
|
+
}, ptm('nav'));
|
|
491
|
+
var inkbarProps = mergeProps({
|
|
485
492
|
ref: inkbarRef,
|
|
486
|
-
className:
|
|
487
|
-
}))
|
|
493
|
+
className: 'p-tabview-ink-bar'
|
|
494
|
+
}, ptm('inkbar'));
|
|
495
|
+
return /*#__PURE__*/React.createElement("div", navContentProps, /*#__PURE__*/React.createElement("ul", navProps, headers, /*#__PURE__*/React.createElement("li", inkbarProps)));
|
|
488
496
|
};
|
|
489
497
|
var createContent = function createContent() {
|
|
490
498
|
var className = classNames('p-tabview-panels', props.panelContainerClassName);
|
|
499
|
+
var panelContainerProps = mergeProps({
|
|
500
|
+
className: className,
|
|
501
|
+
style: props.panelContainerStyle
|
|
502
|
+
}, ptm('panelcontainer'));
|
|
491
503
|
var contents = React.Children.map(props.children, function (tab, index) {
|
|
492
504
|
if (shouldUseTab(tab, index) && (!props.renderActiveOnly || isSelected(index))) {
|
|
493
505
|
var selected = isSelected(index);
|
|
@@ -497,69 +509,77 @@ var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
497
509
|
});
|
|
498
510
|
var contentId = idState + '_content_' + index;
|
|
499
511
|
var ariaLabelledBy = idState + '_header_' + index;
|
|
500
|
-
var
|
|
501
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, _otherProps, {
|
|
512
|
+
var contentProps = mergeProps({
|
|
502
513
|
id: contentId,
|
|
503
|
-
"aria-labelledby": ariaLabelledBy,
|
|
504
|
-
"aria-hidden": !selected,
|
|
505
514
|
className: _className2,
|
|
506
515
|
style: style,
|
|
507
|
-
role:
|
|
508
|
-
|
|
516
|
+
role: 'tabpanel',
|
|
517
|
+
'aria-labelledby': ariaLabelledBy,
|
|
518
|
+
'aria-hidden': !selected
|
|
519
|
+
}, TabPanelBase.getCOtherProps(tab), getTabPT(tab, 'root'), getTabPT(tab, 'content'));
|
|
520
|
+
return /*#__PURE__*/React.createElement("div", contentProps, !props.renderActiveOnly ? getTabProp(tab, 'children') : selected && getTabProp(tab, 'children'));
|
|
509
521
|
}
|
|
510
522
|
});
|
|
511
|
-
return /*#__PURE__*/React.createElement("div",
|
|
512
|
-
className: className,
|
|
513
|
-
style: props.panelContainerStyle
|
|
514
|
-
}, contents);
|
|
523
|
+
return /*#__PURE__*/React.createElement("div", panelContainerProps, contents);
|
|
515
524
|
};
|
|
516
525
|
var createPrevButton = function createPrevButton() {
|
|
517
|
-
var
|
|
518
|
-
var
|
|
526
|
+
var prevIconProps = mergeProps(ptm('previcon'));
|
|
527
|
+
var icon = props.prevButton || /*#__PURE__*/React.createElement(ChevronLeftIcon, prevIconProps);
|
|
528
|
+
var leftIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, prevIconProps), {
|
|
519
529
|
props: props
|
|
520
530
|
});
|
|
531
|
+
var prevButtonProps = mergeProps({
|
|
532
|
+
ref: prevBtnRef,
|
|
533
|
+
type: 'button',
|
|
534
|
+
className: 'p-tabview-nav-prev p-tabview-nav-btn p-link',
|
|
535
|
+
'aria-label': ariaLabel('previousPageLabel'),
|
|
536
|
+
onClick: function onClick(e) {
|
|
537
|
+
return navBackward();
|
|
538
|
+
}
|
|
539
|
+
}, ptm('prevbutton'));
|
|
521
540
|
if (props.scrollable && !backwardIsDisabledState) {
|
|
522
|
-
return /*#__PURE__*/React.createElement("button",
|
|
523
|
-
ref: prevBtnRef,
|
|
524
|
-
className: "p-tabview-nav-prev p-tabview-nav-btn p-link",
|
|
525
|
-
onClick: navBackward,
|
|
526
|
-
type: "button",
|
|
527
|
-
"aria-label": ariaLabel('previousPageLabel')
|
|
528
|
-
}, leftIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
541
|
+
return /*#__PURE__*/React.createElement("button", prevButtonProps, leftIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
529
542
|
}
|
|
530
543
|
return null;
|
|
531
544
|
};
|
|
532
545
|
var createNextButton = function createNextButton() {
|
|
533
|
-
var
|
|
534
|
-
var rightIcon = IconUtils.getJSXIcon(icon, {
|
|
546
|
+
var nextIconProps = mergeProps({
|
|
535
547
|
'aria-hidden': 'true'
|
|
536
|
-
},
|
|
548
|
+
}, ptm('nexticon'));
|
|
549
|
+
var icon = props.nextButton || /*#__PURE__*/React.createElement(ChevronRightIcon, nextIconProps);
|
|
550
|
+
var rightIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, nextIconProps), {
|
|
537
551
|
props: props
|
|
538
552
|
});
|
|
553
|
+
var nextButtonProps = mergeProps({
|
|
554
|
+
ref: nextBtnRef,
|
|
555
|
+
type: 'button',
|
|
556
|
+
className: 'p-tabview-nav-next p-tabview-nav-btn p-link',
|
|
557
|
+
'aria-label': ariaLabel('nextPageLabel'),
|
|
558
|
+
onClick: function onClick(e) {
|
|
559
|
+
return navForward();
|
|
560
|
+
}
|
|
561
|
+
}, ptm('nextbutton'));
|
|
539
562
|
if (props.scrollable && !forwardIsDisabledState) {
|
|
540
|
-
return /*#__PURE__*/React.createElement("button",
|
|
541
|
-
ref: nextBtnRef,
|
|
542
|
-
className: "p-tabview-nav-next p-tabview-nav-btn p-link",
|
|
543
|
-
onClick: navForward,
|
|
544
|
-
type: "button",
|
|
545
|
-
"aria-label": ariaLabel('nextPageLabel')
|
|
546
|
-
}, rightIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
563
|
+
return /*#__PURE__*/React.createElement("button", nextButtonProps, rightIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
547
564
|
}
|
|
548
565
|
};
|
|
549
|
-
var otherProps = TabViewBase.getOtherProps(props);
|
|
550
566
|
var className = classNames('p-tabview p-component', {
|
|
551
567
|
'p-tabview-scrollable': props.scrollable
|
|
552
568
|
}, props.className);
|
|
569
|
+
var rootProps = mergeProps({
|
|
570
|
+
id: idState,
|
|
571
|
+
ref: elementRef,
|
|
572
|
+
style: props.style,
|
|
573
|
+
className: className
|
|
574
|
+
}, TabViewBase.getOtherProps(props), ptm('root'));
|
|
575
|
+
var navContainerProps = mergeProps({
|
|
576
|
+
className: 'p-tabview-nav-container'
|
|
577
|
+
}, ptm('navcontainer'));
|
|
553
578
|
var navigator = createNavigator();
|
|
554
579
|
var content = createContent();
|
|
555
580
|
var prevButton = createPrevButton();
|
|
556
581
|
var nextButton = createNextButton();
|
|
557
|
-
return /*#__PURE__*/React.createElement("div",
|
|
558
|
-
ref: elementRef,
|
|
559
|
-
className: className
|
|
560
|
-
}, otherProps), /*#__PURE__*/React.createElement("div", {
|
|
561
|
-
className: "p-tabview-nav-container"
|
|
562
|
-
}, prevButton, navigator, nextButton), content);
|
|
582
|
+
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement("div", navContainerProps, prevButton, navigator, nextButton), content);
|
|
563
583
|
});
|
|
564
584
|
TabPanel.displayName = 'TabPanel';
|
|
565
585
|
TabView.displayName = 'TabView';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{ariaLabel as t}from"primereact/api";import{useMountEffect as n,useUpdateEffect as r}from"primereact/hooks";import{Ripple as l}from"primereact/ripple";import{ObjectUtils as a,UniqueComponentId as o,classNames as i,DomHandler as c,IconUtils as u}from"primereact/utils";import{ChevronRightIcon as s}from"primereact/icons/chevronright";import{ChevronLeftIcon as f}from"primereact/icons/chevronleft";import{TimesIcon as p}from"primereact/icons/times";function b(){return b=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},b.apply(this,arguments)}function m(e){return m="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},m(e)}function d(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function v(e){var t=d(e,"string");return"symbol"===m(t)?t:String(t)}function y(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(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 g(e){if(Array.isArray(e))return h(e)}function C(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function w(e,t){if(e){if("string"==typeof e)return h(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)?h(e,t):void 0}}function P(){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){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=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){u=!0,l=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw l}}return i}}function O(){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 E(e)||S(e,t)||w(e,t)||O()}var I={defaultProps:{__TYPE:"TabView",id:null,activeIndex:0,className:null,onBeforeTabChange:null,onBeforeTabClose:null,onTabChange:null,onTabClose:null,panelContainerClassName:null,panelContainerStyle:null,renderActiveOnly:!0,scrollable:!1,style:null,children:void 0},getProps:function(e){return a.getMergedProps(e,I.defaultProps)},getOtherProps:function(e){return a.getDiffProps(e,I.defaultProps)}},T={defaultProps:{__TYPE:"TabPanel",className:null,closable:!1,contentClassName:null,contentStyle:null,disabled:!1,header:null,headerClassName:null,headerStyle:null,headerTemplate:null,leftIcon:null,rightIcon:null,prevButton:null,nextButton:null,closeIcon:null,style:null,children:void 0},getCProp:function(e,t){return a.getComponentProp(e,t,T.defaultProps)},getCProps:function(e){return a.getComponentProps(e,T.defaultProps)},getCOtherProps:function(e){return a.getComponentDiffProps(e,T.defaultProps)}};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 j(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){y(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}var _=function(){},k=e.forwardRef((function(m,d){var v=I.getProps(m),y=N(e.useState(v.id),2),h=y[0],E=y[1],S=N(e.useState(!0),2),O=S[0],x=S[1],_=N(e.useState(!1),2),k=_[0],A=_[1],D=N(e.useState([]),2),B=D[0],R=D[1],L=N(e.useState(v.activeIndex),2),W=L[0],J=L[1],X=e.useRef(null),V=e.useRef(null),F=e.useRef(null),K=e.useRef(null),M=e.useRef(null),Y=e.useRef(null),H=e.useRef({}),U=v.onTabChange?v.activeIndex:W,$=function(e){return e===U},q=function(e,t){return T.getCProp(e,t)},z=function(e,t){return e&&a.isValidChild(e,"TabPanel")&&B.every((function(e){return e!==t}))},G=function(e,t){var n;(e.preventDefault(),v.onBeforeTabClose&&!1===v.onBeforeTabClose({originalEvent:e,index:t}))||(R([].concat(g(n=B)||C(n)||w(n)||P(),[t])),v.onTabClose&&v.onTabClose({originalEvent:e,index:t}))},Q=function(e,t,n){if(e&&e.preventDefault(),!q(t,"disabled")){if(v.onBeforeTabChange&&!1===v.onBeforeTabChange({originalEvent:e,index:n}))return;v.onTabChange?v.onTabChange({originalEvent:e,index:n}):J(n)}ee(n)},Z=function(e,t,n){"Enter"===e.key&&Q(e,t,n)},ee=function(e){var t=H.current["tab_".concat(e)];t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest"})},te=function(e){var t,n,r,l;v.scrollable&&(n=(t=V.current).scrollLeft,r=t.scrollWidth,l=c.getWidth(V.current),x(0===n),A(n===r-l)),e.preventDefault()},ne=function(){return[M.current,Y.current].reduce((function(e,t){return t?e+c.getWidth(t):e}),0)},re=function(){var e=c.getWidth(V.current)-ne(),t=V.current.scrollLeft-e;V.current.scrollLeft=t<=0?0:t},le=function(){var e=c.getWidth(V.current)-ne(),t=V.current.scrollLeft+e,n=V.current.scrollWidth-e;V.current.scrollLeft=t>=n?n:t},ae=function(){x(!0),A(!1),R([]),v.onTabChange?v.onTabChange({index:U}):J(v.activeIndex)};e.useEffect((function(){var e;e=H.current["tab_".concat(U)],K.current.style.width=c.getWidth(e)+"px",K.current.style.left=c.getOffset(e).left-c.getOffset(F.current).left+"px"})),n((function(){h||E(o())})),r((function(){if(a.isNotEmpty(B)){var t=(n=B[B.length-1],(r=e.Children.map(v.children,(function(e,t){if(z(e,t))return{tab:e,index:t}}))).find((function(e){var t=e.index;return!q(e.tab,"disabled")&&t>=n}))||r.reverse().find((function(e){var t=e.index;return!q(e.tab,"disabled")&&n>t})));t&&Q(null,t.tab,t.index)}var n,r}),[B]),r((function(){ee(v.activeIndex)}),[v.activeIndex]),e.useImperativeHandle(d,(function(){return{props:v,reset:ae,getElement:function(){return X.current}}}));var oe,ie,ce=function(t,n){var r=$(n),o=T.getCProps(t),c=o.headerClassName,s=o.style,f=o.className,b=o.disabled,m=o.leftIcon,d=o.rightIcon,y=o.header,g=o.headerTemplate,C=o.closable,w=o.closeIcon,P=j(j({},o.headerStyle||{}),s||{}),E=i("p-unselectable-text",{"p-tabview-selected p-highlight":r,"p-disabled":b},c,f),S=h+"_header_"+n,O=h+"_content_"+n,N=b?null:0,I=m&&e.createElement(e.Fragment,null,u.getJSXIcon(m,{props:v})),x=e.createElement("span",{className:"p-tabview-title"},y),_=d&&e.createElement(e.Fragment,null,u.getJSXIcon(d,{props:v})),k="p-tabview-close",A=C?u.getJSXIcon(w||e.createElement(p,{className:k,onClick:function(e){return G(e,n)}}),{className:k},{props:v}):null,D=e.createElement("a",{role:"tab",className:"p-tabview-nav-link",onClick:function(e){return Q(e,t,n)},id:S,onKeyDown:function(e){return Z(e,t,n)},"aria-controls":O,"aria-selected":r,tabIndex:N},I,x,_,A,e.createElement(l,null));g&&(D=a.getJSXElement(g,{className:"p-tabview-nav-link",titleClassName:"p-tabview-title",onClick:function(e){return Q(e,t,n)},onKeyDown:function(e){return Z(e,t,n)},leftIconElement:I,titleElement:x,rightIconElement:_,element:D,props:v,index:n,selected:r,ariaControls:O}));return e.createElement("li",{ref:function(e){return H.current["tab_".concat(n)]=e},className:E,style:P,role:"presentation"},D)},ue=I.getOtherProps(v),se=i("p-tabview p-component",{"p-tabview-scrollable":v.scrollable},v.className),fe=(oe=e.Children.map(v.children,(function(e,t){if(z(e,t))return ce(e,t)})),e.createElement("div",{ref:V,id:h,className:"p-tabview-nav-content",style:v.style,onScroll:te},e.createElement("ul",{ref:F,className:"p-tabview-nav",role:"tablist"},oe,e.createElement("li",{ref:K,className:"p-tabview-ink-bar"})))),pe=function(){var t=i("p-tabview-panels",v.panelContainerClassName),n=e.Children.map(v.children,(function(t,n){if(z(t,n)&&(!v.renderActiveOnly||$(n))){var r=$(n),l=j(j({},q(t,"contentStyle")||{}),q(t,"style")||{}),a=i(q(t,"contentClassName"),q(t,"className"),"p-tabview-panel",{"p-hidden":!r}),o=h+"_content_"+n,c=h+"_header_"+n,u=T.getCOtherProps(t);return e.createElement("div",b({},u,{id:o,"aria-labelledby":c,"aria-hidden":!r,className:a,style:l,role:"tabpanel"}),v.renderActiveOnly?r&&q(t,"children"):q(t,"children"))}}));return e.createElement("div",{className:t,style:v.panelContainerStyle},n)}(),be=(ie=u.getJSXIcon(v.prevButton||e.createElement(f,null),void 0,{props:v}),v.scrollable&&!O?e.createElement("button",{ref:M,className:"p-tabview-nav-prev p-tabview-nav-btn p-link",onClick:re,type:"button","aria-label":t("previousPageLabel")},ie,e.createElement(l,null)):null),me=function(){var n=u.getJSXIcon(v.prevButton||e.createElement(s,null),{"aria-hidden":"true"},{props:v});if(v.scrollable&&!k)return e.createElement("button",{ref:Y,className:"p-tabview-nav-next p-tabview-nav-btn p-link",onClick:le,type:"button","aria-label":t("nextPageLabel")},n,e.createElement(l,null))}();return e.createElement("div",b({ref:X,className:se},ue),e.createElement("div",{className:"p-tabview-nav-container"},be,fe,me),pe)}));_.displayName="TabPanel",k.displayName="TabView";export{_ as TabPanel,k as TabView};
|
|
1
|
+
import*as e from"react";import{ariaLabel as t}from"primereact/api";import{useMountEffect as n,useUpdateEffect as r}from"primereact/hooks";import{Ripple as a}from"primereact/ripple";import{ObjectUtils as l,UniqueComponentId as o,classNames as i,mergeProps as c,DomHandler as u,IconUtils as s}from"primereact/utils";import{ComponentBase as f}from"primereact/componentbase";import{ChevronRightIcon as p}from"primereact/icons/chevronright";import{ChevronLeftIcon as b}from"primereact/icons/chevronleft";import{TimesIcon as d}from"primereact/icons/times";function m(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 m(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e,t){if(e){if("string"==typeof e)return m(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)?m(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 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 w(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 E(e){var t=w(e,"string");return"symbol"===C(t)?t:String(t)}function S(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){if(Array.isArray(e))return e}function x(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,o,i=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){u=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return i}}function N(){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 O(e,t){return P(e)||x(e,t)||h(e,t)||N()}var I=f.extend({defaultProps:{__TYPE:"TabView",id:null,activeIndex:0,className:null,onBeforeTabChange:null,onBeforeTabClose:null,onTabChange:null,onTabClose:null,panelContainerClassName:null,panelContainerStyle:null,renderActiveOnly:!0,scrollable:!1,style:null,children:void 0}}),T=f.extend({defaultProps:{__TYPE:"TabPanel",className:null,closable:!1,contentClassName:null,contentStyle:null,disabled:!1,header:null,headerClassName:null,headerStyle:null,headerTemplate:null,leftIcon:null,rightIcon:null,prevButton:null,nextButton:null,closeIcon:null,style:null,children:void 0},getCProp:function(e,t){return l.getComponentProp(e,t,T.defaultProps)},getCProps:function(e){return l.getComponentProps(e,T.defaultProps)},getCOtherProps:function(e){return l.getComponentDiffProps(e,T.defaultProps)}});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 k(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){S(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 _=function(){},D=e.forwardRef((function(f,m){var C=I.getProps(f),w=O(e.useState(C.id),2),E=w[0],S=w[1],P=O(e.useState(!0),2),x=P[0],N=P[1],j=O(e.useState(!1),2),_=j[0],D=j[1],A=O(e.useState([]),2),B=A[0],R=A[1],L=O(e.useState(C.activeIndex),2),W=L[0],J=L[1],X=e.useRef(null),V=e.useRef(null),K=e.useRef(null),M=e.useRef(null),Y=e.useRef(null),H=e.useRef(null),U=e.useRef({}),$=C.onTabChange?C.activeIndex:W,q={props:C,state:{id:E,isPrevButtonDisabled:x,isNextButtonDisabled:_,hiddenTabsState:B,activeIndex:W}},z=I.setMetaData(k({},q)),F=z.ptm,G=z.ptmo,Q=function(e,t){return G(ee(e,"pt"),t,{props:e.props,parent:q})},Z=function(e){return e===$},ee=function(e,t){return T.getCProp(e,t)},te=function(e,t){return e&&l.isValidChild(e,"TabPanel")&&B.every((function(e){return e!==t}))},ne=function(e,t){var n;(e.preventDefault(),C.onBeforeTabClose&&!1===C.onBeforeTabClose({originalEvent:e,index:t}))||(R([].concat(v(n=B)||y(n)||h(n)||g(),[t])),C.onTabClose&&C.onTabClose({originalEvent:e,index:t}))},re=function(e,t,n){if(e&&e.preventDefault(),!ee(t,"disabled")){if(C.onBeforeTabChange&&!1===C.onBeforeTabChange({originalEvent:e,index:n}))return;C.onTabChange?C.onTabChange({originalEvent:e,index:n}):J(n)}le(n)},ae=function(e,t,n){"Enter"===e.key&&re(e,t,n)},le=function(e){var t=U.current["tab_".concat(e)];t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest"})},oe=function(e){var t,n,r,a;C.scrollable&&(n=(t=V.current).scrollLeft,r=t.scrollWidth,a=u.getWidth(V.current),N(0===n),D(n===r-a)),e.preventDefault()},ie=function(){return[Y.current,H.current].reduce((function(e,t){return t?e+u.getWidth(t):e}),0)},ce=function(){N(!0),D(!1),R([]),C.onTabChange?C.onTabChange({index:$}):J(C.activeIndex)};e.useEffect((function(){var e;e=U.current["tab_".concat($)],M.current.style.width=u.getWidth(e)+"px",M.current.style.left=u.getOffset(e).left-u.getOffset(K.current).left+"px"})),n((function(){E||S(o())})),r((function(){if(l.isNotEmpty(B)){var t=(n=B[B.length-1],(r=e.Children.map(C.children,(function(e,t){if(te(e,t))return{tab:e,index:t}}))).find((function(e){var t=e.index;return!ee(e.tab,"disabled")&&t>=n}))||r.reverse().find((function(e){var t=e.index;return!ee(e.tab,"disabled")&&n>t})));t&&re(null,t.tab,t.index)}var n,r}),[B]),r((function(){le(C.activeIndex)}),[C.activeIndex]),e.useImperativeHandle(m,(function(){return{props:C,reset:ce,getElement:function(){return X.current}}}));var ue,se,fe,pe,be,de,me,ve=function(t,n){var r=Z(n),o=T.getCProps(t),u=o.headerClassName,f=o.style,p=o.className,b=o.disabled,m=o.leftIcon,v=o.rightIcon,y=o.header,h=o.headerTemplate,g=o.closable,w=o.closeIcon,S=k(k({},o.headerStyle||{}),f||{}),P=i("p-unselectable-text",{"p-tabview-selected p-highlight":r,"p-disabled":b},u,p),x=E+"_header_"+n,N=E+"_content_"+n,O=b?null:0,I=m&&s.getJSXIcon(m,void 0,{props:C}),j=c({className:"p-tabview-title"},Q(t,"headertitle")),_=e.createElement("span",j,y),D=v&&s.getJSXIcon(v,void 0,{props:C}),A="p-tabview-close",B=g?s.getJSXIcon(w||e.createElement(d,{className:A,onClick:function(e){return ne(e,n)}}),{className:A,onClick:function(e){return ne(e,n)}},{props:C}):null,R=c({id:x,role:"tab",className:"p-tabview-nav-link",tabIndex:O,"aria-controls":N,"aria-selected":r,onClick:function(e){return re(e,t,n)},onKeyDown:function(e){return ae(e,t,n)}},Q(t,"headeraction")),L=e.createElement("a",R,I,_,D,B,e.createElement(a,null));h&&(L=l.getJSXElement(h,{className:"p-tabview-nav-link",titleClassName:"p-tabview-title",onClick:function(e){return re(e,t,n)},onKeyDown:function(e){return ae(e,t,n)},leftIconElement:I,titleElement:_,rightIconElement:D,element:L,props:C,index:n,selected:r,ariaControls:N}));var W=c({ref:function(e){return U.current["tab_".concat(n)]=e},className:P,style:S,role:"presentation"},Q(t,"root"),Q(t,"header"));return e.createElement("li",W,L)},ye=i("p-tabview p-component",{"p-tabview-scrollable":C.scrollable},C.className),he=c({id:E,ref:X,style:C.style,className:ye},I.getOtherProps(C),F("root")),ge=c({className:"p-tabview-nav-container"},F("navcontainer")),Ce=(ue=e.Children.map(C.children,(function(e,t){if(te(e,t))return ve(e,t)})),se=c({id:E,ref:V,className:"p-tabview-nav-content",style:C.style,onScroll:oe},F("navcontent")),fe=c({ref:K,className:"p-tabview-nav",role:"tablist"},F("nav")),pe=c({ref:M,className:"p-tabview-ink-bar"},F("inkbar")),e.createElement("div",se,e.createElement("ul",fe,ue,e.createElement("li",pe)))),we=function(){var t=i("p-tabview-panels",C.panelContainerClassName),n=c({className:t,style:C.panelContainerStyle},F("panelcontainer")),r=e.Children.map(C.children,(function(t,n){if(te(t,n)&&(!C.renderActiveOnly||Z(n))){var r=Z(n),a=k(k({},ee(t,"contentStyle")||{}),ee(t,"style")||{}),l=i(ee(t,"contentClassName"),ee(t,"className"),"p-tabview-panel",{"p-hidden":!r}),o=c({id:E+"_content_"+n,className:l,style:a,role:"tabpanel","aria-labelledby":E+"_header_"+n,"aria-hidden":!r},T.getCOtherProps(t),Q(t,"root"),Q(t,"content"));return e.createElement("div",o,C.renderActiveOnly?r&&ee(t,"children"):ee(t,"children"))}}));return e.createElement("div",n,r)}(),Ee=(be=c(F("previcon")),de=s.getJSXIcon(C.prevButton||e.createElement(b,be),k({},be),{props:C}),me=c({ref:Y,type:"button",className:"p-tabview-nav-prev p-tabview-nav-btn p-link","aria-label":t("previousPageLabel"),onClick:function(e){return t=u.getWidth(V.current)-ie(),void(V.current.scrollLeft=(n=V.current.scrollLeft-t)<=0?0:n);var t,n}},F("prevbutton")),C.scrollable&&!x?e.createElement("button",me,de,e.createElement(a,null)):null),Se=function(){var n=c({"aria-hidden":"true"},F("nexticon")),r=s.getJSXIcon(C.nextButton||e.createElement(p,n),k({},n),{props:C}),l=c({ref:H,type:"button",className:"p-tabview-nav-next p-tabview-nav-btn p-link","aria-label":t("nextPageLabel"),onClick:function(e){return t=u.getWidth(V.current)-ie(),void(V.current.scrollLeft=(n=V.current.scrollLeft+t)>=(r=V.current.scrollWidth-t)?r:n);var t,n,r}},F("nextbutton"));if(C.scrollable&&!_)return e.createElement("button",l,r,e.createElement(a,null))}();return e.createElement("div",he,e.createElement("div",ge,Ee,Ce,Se),we)}));_.displayName="TabPanel",D.displayName="TabView";export{_ as TabPanel,D as TabView};
|