primereact 10.0.0 → 10.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/accordion/accordion.esm.js +0 -1
- package/api/api.esm.js +0 -1
- package/autocomplete/autocomplete.esm.js +8 -7
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/avatar/avatar.esm.js +0 -1
- package/avatargroup/avatargroup.esm.js +0 -1
- package/badge/badge.esm.js +0 -1
- package/blockui/blockui.esm.js +3 -1
- package/blockui/blockui.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +0 -1
- package/button/button.esm.js +0 -1
- package/calendar/calendar.esm.js +2 -1
- package/calendar/calendar.esm.min.js +1 -1
- package/card/card.esm.js +0 -1
- package/carousel/carousel.esm.js +7 -8
- package/carousel/carousel.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +0 -1
- package/chart/chart.esm.js +0 -1
- package/checkbox/checkbox.esm.js +0 -1
- package/chip/chip.esm.js +0 -1
- package/chips/chips.esm.js +0 -1
- package/colorpicker/colorpicker.esm.js +0 -1
- package/column/column.esm.js +0 -1
- package/columngroup/columngroup.esm.js +0 -1
- package/componentbase/componentbase.cjs.js +12 -7
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +23 -13
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +12 -7
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +0 -1
- package/confirmpopup/confirmpopup.esm.js +0 -1
- package/contextmenu/contextmenu.esm.js +0 -1
- package/core/core.js +12 -7
- package/core/core.min.js +1 -1
- package/csstransition/csstransition.esm.js +0 -1
- package/datascroller/datascroller.esm.js +0 -1
- package/datatable/datatable.esm.js +0 -1
- package/dataview/dataview.esm.js +0 -1
- package/deferredcontent/deferredcontent.esm.js +0 -1
- package/dialog/dialog.esm.js +2 -1
- package/dialog/dialog.esm.min.js +1 -1
- package/divider/divider.esm.js +0 -1
- package/dock/dock.esm.js +0 -1
- package/dropdown/dropdown.esm.js +0 -1
- package/editor/editor.esm.js +0 -1
- package/fieldset/fieldset.esm.js +0 -1
- package/fileupload/fileupload.esm.js +0 -1
- package/galleria/galleria.esm.js +11 -7
- package/galleria/galleria.esm.min.js +1 -1
- package/hooks/hooks.esm.js +0 -6
- package/iconbase/iconbase.esm.js +0 -1
- package/icons/angledoubledown/index.esm.js +0 -1
- package/icons/angledoubleleft/index.esm.js +0 -1
- package/icons/angledoubleright/index.esm.js +0 -1
- package/icons/angledoubleup/index.esm.js +0 -1
- package/icons/angledown/index.esm.js +0 -1
- package/icons/angleleft/index.esm.js +0 -1
- package/icons/angleright/index.esm.js +0 -1
- package/icons/angleup/index.esm.js +0 -1
- package/icons/arrowdown/index.esm.js +0 -1
- package/icons/arrowup/index.esm.js +0 -1
- package/icons/ban/index.esm.js +0 -1
- package/icons/bars/index.esm.js +0 -1
- package/icons/calendar/index.esm.js +0 -1
- package/icons/check/index.esm.js +0 -1
- package/icons/chevrondown/index.esm.js +0 -1
- package/icons/chevronleft/index.esm.js +0 -1
- package/icons/chevronright/index.esm.js +0 -1
- package/icons/chevronup/index.esm.js +0 -1
- package/icons/download/index.esm.js +0 -1
- package/icons/exclamationtriangle/index.esm.js +0 -1
- package/icons/eye/index.esm.js +0 -1
- package/icons/eyeslash/index.esm.js +0 -1
- package/icons/filter/index.esm.js +0 -1
- package/icons/filterslash/index.esm.js +0 -1
- package/icons/infocircle/index.esm.js +0 -1
- package/icons/minus/index.esm.js +0 -1
- package/icons/pencil/index.esm.js +0 -1
- package/icons/plus/index.esm.js +0 -1
- package/icons/refresh/index.esm.js +0 -1
- package/icons/search/index.esm.js +0 -1
- package/icons/searchminus/index.esm.js +0 -1
- package/icons/searchplus/index.esm.js +0 -1
- package/icons/sortalt/index.esm.js +0 -1
- package/icons/sortamountdown/index.esm.js +0 -1
- package/icons/sortamountupalt/index.esm.js +0 -1
- package/icons/spinner/index.esm.js +0 -1
- package/icons/star/index.esm.js +0 -1
- package/icons/starfill/index.esm.js +0 -1
- package/icons/thlarge/index.esm.js +0 -1
- package/icons/times/index.esm.js +0 -1
- package/icons/timescircle/index.esm.js +0 -1
- package/icons/trash/index.esm.js +0 -1
- package/icons/undo/index.esm.js +0 -1
- package/icons/upload/index.esm.js +0 -1
- package/icons/windowmaximize/index.esm.js +0 -1
- package/icons/windowminimize/index.esm.js +0 -1
- package/image/image.esm.js +2 -1
- package/image/image.esm.min.js +1 -1
- package/inplace/inplace.esm.js +0 -1
- package/inputmask/inputmask.esm.js +0 -1
- package/inputnumber/inputnumber.esm.js +0 -1
- package/inputswitch/inputswitch.esm.js +0 -1
- package/inputtext/inputtext.esm.js +0 -1
- package/inputtextarea/inputtextarea.esm.js +0 -1
- package/keyfilter/keyfilter.esm.js +0 -1
- package/knob/knob.esm.js +0 -1
- package/listbox/listbox.esm.js +0 -1
- package/megamenu/megamenu.esm.js +0 -1
- package/mention/mention.esm.js +0 -1
- package/menu/menu.esm.js +0 -1
- package/menubar/menubar.esm.js +0 -1
- package/message/message.esm.js +0 -1
- package/messages/messages.esm.js +1 -2
- package/messages/messages.esm.min.js +1 -1
- package/multiselect/multiselect.esm.js +0 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +0 -1
- package/orderlist/orderlist.esm.js +9 -5
- package/orderlist/orderlist.esm.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +0 -1
- package/overlaypanel/overlaypanel.esm.js +0 -1
- package/overlayservice/overlayservice.esm.js +0 -1
- package/package.json +2 -2
- package/paginator/paginator.esm.js +0 -1
- package/panel/panel.esm.js +0 -1
- package/panelmenu/panelmenu.esm.js +0 -1
- package/passthrough/index.esm.js +0 -1
- package/passthrough/tailwind/index.cjs.js +2 -4
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +149 -148
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +2 -4
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.esm.js +0 -1
- package/picklist/picklist.esm.js +0 -1
- package/portal/portal.esm.js +0 -1
- package/primereact.all.cjs.js +12 -7
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +70 -42
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +12 -7
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.esm.js +0 -1
- package/progressspinner/progressspinner.esm.js +0 -1
- package/radiobutton/radiobutton.esm.js +0 -1
- package/rating/rating.esm.js +0 -1
- package/ripple/ripple.esm.js +0 -1
- package/row/row.esm.js +0 -1
- package/scrollpanel/scrollpanel.esm.js +0 -1
- package/scrolltop/scrolltop.esm.js +0 -1
- package/selectbutton/selectbutton.esm.js +0 -1
- package/sidebar/sidebar.esm.js +2 -1
- package/sidebar/sidebar.esm.min.js +1 -1
- package/skeleton/skeleton.esm.js +0 -1
- package/slidemenu/slidemenu.esm.js +0 -1
- package/slider/slider.esm.js +0 -1
- package/speeddial/speeddial.esm.js +0 -1
- package/splitbutton/splitbutton.esm.js +0 -1
- package/splitter/splitter.esm.js +0 -1
- package/steps/steps.esm.js +0 -1
- package/styleclass/styleclass.esm.js +0 -1
- package/tabmenu/tabmenu.esm.js +0 -1
- package/tabview/tabview.esm.js +0 -1
- package/tag/tag.esm.js +0 -1
- package/terminal/terminal.esm.js +0 -1
- package/terminalservice/terminalservice.esm.js +0 -1
- package/tieredmenu/tieredmenu.esm.js +0 -1
- package/timeline/timeline.esm.js +0 -1
- package/toast/toast.esm.js +0 -1
- package/togglebutton/togglebutton.esm.js +0 -1
- package/toolbar/toolbar.esm.js +0 -1
- package/tooltip/tooltip.esm.js +0 -1
- package/tree/tree.esm.js +0 -1
- package/treeselect/treeselect.esm.js +0 -1
- package/treetable/treetable.esm.js +0 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +0 -1
- package/utils/utils.esm.js +0 -1
- package/virtualscroller/virtualscroller.esm.js +0 -1
- package/web-types.json +1 -1
- package/accordion/accordion.esm.min.mjs +0 -1
- package/accordion/accordion.esm.mjs +0 -420
- package/api/api.esm.min.mjs +0 -1
- package/api/api.esm.mjs +0 -943
- package/autocomplete/autocomplete.esm.min.mjs +0 -1
- package/autocomplete/autocomplete.esm.mjs +0 -1128
- package/avatar/avatar.esm.min.mjs +0 -1
- package/avatar/avatar.esm.mjs +0 -244
- package/avatargroup/avatargroup.esm.min.mjs +0 -1
- package/avatargroup/avatargroup.esm.mjs +0 -54
- package/badge/badge.esm.min.mjs +0 -1
- package/badge/badge.esm.mjs +0 -109
- package/blockui/blockui.esm.min.mjs +0 -1
- package/blockui/blockui.esm.mjs +0 -267
- package/breadcrumb/breadcrumb.esm.min.mjs +0 -1
- package/breadcrumb/breadcrumb.esm.mjs +0 -350
- package/button/button.esm.min.mjs +0 -1
- package/button/button.esm.mjs +0 -294
- package/calendar/calendar.esm.min.mjs +0 -1
- package/calendar/calendar.esm.mjs +0 -3474
- package/card/card.esm.min.mjs +0 -1
- package/card/card.esm.mjs +0 -97
- package/carousel/carousel.esm.min.mjs +0 -1
- package/carousel/carousel.esm.mjs +0 -800
- package/cascadeselect/cascadeselect.esm.min.mjs +0 -1
- package/cascadeselect/cascadeselect.esm.mjs +0 -818
- package/chart/chart.esm.min.mjs +0 -1
- package/chart/chart.esm.mjs +0 -154
- package/checkbox/checkbox.esm.min.mjs +0 -1
- package/checkbox/checkbox.esm.mjs +0 -356
- package/chip/chip.esm.min.mjs +0 -1
- package/chip/chip.esm.mjs +0 -247
- package/chips/chips.esm.min.mjs +0 -1
- package/chips/chips.esm.mjs +0 -500
- package/colorpicker/colorpicker.esm.min.mjs +0 -1
- package/colorpicker/colorpicker.esm.mjs +0 -787
- package/column/column.esm.min.mjs +0 -1
- package/column/column.esm.mjs +0 -7
- package/columngroup/columngroup.esm.min.mjs +0 -1
- package/columngroup/columngroup.esm.mjs +0 -5
- package/componentbase/componentbase.esm.min.mjs +0 -1
- package/componentbase/componentbase.esm.mjs +0 -328
- package/confirmdialog/confirmdialog.esm.min.mjs +0 -1
- package/confirmdialog/confirmdialog.esm.mjs +0 -375
- package/confirmpopup/confirmpopup.esm.min.mjs +0 -1
- package/confirmpopup/confirmpopup.esm.mjs +0 -609
- package/contextmenu/contextmenu.esm.min.mjs +0 -1
- package/contextmenu/contextmenu.esm.mjs +0 -663
- package/csstransition/csstransition.esm.min.mjs +0 -1
- package/csstransition/csstransition.esm.mjs +0 -137
- package/datascroller/datascroller.esm.min.mjs +0 -1
- package/datascroller/datascroller.esm.mjs +0 -319
- package/datatable/datatable.esm.min.mjs +0 -1
- package/datatable/datatable.esm.mjs +0 -6635
- package/dataview/dataview.esm.min.mjs +0 -1
- package/dataview/dataview.esm.mjs +0 -505
- package/deferredcontent/deferredcontent.esm.min.mjs +0 -1
- package/deferredcontent/deferredcontent.esm.mjs +0 -132
- package/dialog/dialog.esm.min.mjs +0 -1
- package/dialog/dialog.esm.mjs +0 -984
- package/divider/divider.esm.min.mjs +0 -1
- package/divider/divider.esm.mjs +0 -78
- package/dock/dock.esm.min.mjs +0 -1
- package/dock/dock.esm.mjs +0 -347
- package/dropdown/dropdown.esm.min.mjs +0 -1
- package/dropdown/dropdown.esm.mjs +0 -1379
- package/editor/editor.esm.min.mjs +0 -1
- package/editor/editor.esm.mjs +0 -337
- package/fieldset/fieldset.esm.min.mjs +0 -1
- package/fieldset/fieldset.esm.mjs +0 -269
- package/fileupload/fileupload.esm.min.mjs +0 -1
- package/fileupload/fileupload.esm.mjs +0 -1004
- package/galleria/galleria.esm.min.mjs +0 -1
- package/galleria/galleria.esm.mjs +0 -1094
- package/hooks/hooks.esm.min.mjs +0 -1
- package/hooks/hooks.esm.mjs +0 -1036
- package/iconbase/iconbase.esm.min.mjs +0 -1
- package/iconbase/iconbase.esm.mjs +0 -32
- package/icons/angledoubledown/index.esm.min.mjs +0 -1
- package/icons/angledoubledown/index.esm.mjs +0 -38
- package/icons/angledoubleleft/index.esm.min.mjs +0 -1
- package/icons/angledoubleleft/index.esm.mjs +0 -38
- package/icons/angledoubleright/index.esm.min.mjs +0 -1
- package/icons/angledoubleright/index.esm.mjs +0 -38
- package/icons/angledoubleup/index.esm.min.mjs +0 -1
- package/icons/angledoubleup/index.esm.mjs +0 -38
- package/icons/angledown/index.esm.min.mjs +0 -1
- package/icons/angledown/index.esm.mjs +0 -36
- package/icons/angleleft/index.esm.min.mjs +0 -1
- package/icons/angleleft/index.esm.mjs +0 -36
- package/icons/angleright/index.esm.min.mjs +0 -1
- package/icons/angleright/index.esm.mjs +0 -36
- package/icons/angleup/index.esm.min.mjs +0 -1
- package/icons/angleup/index.esm.mjs +0 -36
- package/icons/arrowdown/index.esm.min.mjs +0 -1
- package/icons/arrowdown/index.esm.mjs +0 -660
- package/icons/arrowup/index.esm.min.mjs +0 -1
- package/icons/arrowup/index.esm.mjs +0 -660
- package/icons/ban/index.esm.min.mjs +0 -1
- package/icons/ban/index.esm.mjs +0 -658
- package/icons/bars/index.esm.min.mjs +0 -1
- package/icons/bars/index.esm.mjs +0 -38
- package/icons/calendar/index.esm.min.mjs +0 -1
- package/icons/calendar/index.esm.mjs +0 -36
- package/icons/check/index.esm.min.mjs +0 -1
- package/icons/check/index.esm.mjs +0 -36
- package/icons/chevrondown/index.esm.min.mjs +0 -1
- package/icons/chevrondown/index.esm.mjs +0 -36
- package/icons/chevronleft/index.esm.min.mjs +0 -1
- package/icons/chevronleft/index.esm.mjs +0 -36
- package/icons/chevronright/index.esm.min.mjs +0 -1
- package/icons/chevronright/index.esm.mjs +0 -36
- package/icons/chevronup/index.esm.min.mjs +0 -1
- package/icons/chevronup/index.esm.mjs +0 -36
- package/icons/download/index.esm.min.mjs +0 -1
- package/icons/download/index.esm.mjs +0 -660
- package/icons/exclamationtriangle/index.esm.min.mjs +0 -1
- package/icons/exclamationtriangle/index.esm.mjs +0 -664
- package/icons/eye/index.esm.min.mjs +0 -1
- package/icons/eye/index.esm.mjs +0 -38
- package/icons/eyeslash/index.esm.min.mjs +0 -1
- package/icons/eyeslash/index.esm.mjs +0 -660
- package/icons/filter/index.esm.min.mjs +0 -1
- package/icons/filter/index.esm.mjs +0 -658
- package/icons/filterslash/index.esm.min.mjs +0 -1
- package/icons/filterslash/index.esm.mjs +0 -660
- package/icons/infocircle/index.esm.min.mjs +0 -1
- package/icons/infocircle/index.esm.mjs +0 -660
- package/icons/minus/index.esm.min.mjs +0 -1
- package/icons/minus/index.esm.mjs +0 -36
- package/icons/pencil/index.esm.min.mjs +0 -1
- package/icons/pencil/index.esm.mjs +0 -658
- package/icons/plus/index.esm.min.mjs +0 -1
- package/icons/plus/index.esm.mjs +0 -658
- package/icons/refresh/index.esm.min.mjs +0 -1
- package/icons/refresh/index.esm.mjs +0 -660
- package/icons/search/index.esm.min.mjs +0 -1
- package/icons/search/index.esm.mjs +0 -660
- package/icons/searchminus/index.esm.min.mjs +0 -1
- package/icons/searchminus/index.esm.mjs +0 -660
- package/icons/searchplus/index.esm.min.mjs +0 -1
- package/icons/searchplus/index.esm.mjs +0 -660
- package/icons/sortalt/index.esm.min.mjs +0 -1
- package/icons/sortalt/index.esm.mjs +0 -667
- package/icons/sortamountdown/index.esm.min.mjs +0 -1
- package/icons/sortamountdown/index.esm.mjs +0 -673
- package/icons/sortamountupalt/index.esm.min.mjs +0 -1
- package/icons/sortamountupalt/index.esm.mjs +0 -673
- package/icons/spinner/index.esm.min.mjs +0 -1
- package/icons/spinner/index.esm.mjs +0 -658
- package/icons/star/index.esm.min.mjs +0 -1
- package/icons/star/index.esm.mjs +0 -658
- package/icons/starfill/index.esm.min.mjs +0 -1
- package/icons/starfill/index.esm.mjs +0 -658
- package/icons/thlarge/index.esm.min.mjs +0 -1
- package/icons/thlarge/index.esm.mjs +0 -660
- package/icons/times/index.esm.min.mjs +0 -1
- package/icons/times/index.esm.mjs +0 -36
- package/icons/timescircle/index.esm.min.mjs +0 -1
- package/icons/timescircle/index.esm.mjs +0 -660
- package/icons/trash/index.esm.min.mjs +0 -1
- package/icons/trash/index.esm.mjs +0 -660
- package/icons/undo/index.esm.min.mjs +0 -1
- package/icons/undo/index.esm.mjs +0 -660
- package/icons/upload/index.esm.min.mjs +0 -1
- package/icons/upload/index.esm.mjs +0 -660
- package/icons/windowmaximize/index.esm.min.mjs +0 -1
- package/icons/windowmaximize/index.esm.mjs +0 -660
- package/icons/windowminimize/index.esm.min.mjs +0 -1
- package/icons/windowminimize/index.esm.mjs +0 -660
- package/image/image.esm.min.mjs +0 -1
- package/image/image.esm.mjs +0 -1163
- package/inplace/inplace.esm.min.mjs +0 -1
- package/inplace/inplace.esm.mjs +0 -242
- package/inputmask/inputmask.esm.min.mjs +0 -1
- package/inputmask/inputmask.esm.mjs +0 -559
- package/inputnumber/inputnumber.esm.min.mjs +0 -1
- package/inputnumber/inputnumber.esm.mjs +0 -1208
- package/inputswitch/inputswitch.esm.min.mjs +0 -1
- package/inputswitch/inputswitch.esm.mjs +0 -290
- package/inputtext/inputtext.esm.min.mjs +0 -1
- package/inputtext/inputtext.esm.mjs +0 -170
- package/inputtextarea/inputtextarea.esm.min.mjs +0 -1
- package/inputtextarea/inputtextarea.esm.mjs +0 -219
- package/keyfilter/keyfilter.esm.min.mjs +0 -1
- package/keyfilter/keyfilter.esm.mjs +0 -107
- package/knob/knob.esm.min.mjs +0 -1
- package/knob/knob.esm.mjs +0 -317
- package/listbox/listbox.esm.min.mjs +0 -1
- package/listbox/listbox.esm.mjs +0 -809
- package/megamenu/megamenu.esm.min.mjs +0 -1
- package/megamenu/megamenu.esm.mjs +0 -715
- package/mention/mention.esm.min.mjs +0 -1
- package/mention/mention.esm.mjs +0 -770
- package/menu/menu.esm.min.mjs +0 -1
- package/menu/menu.esm.mjs +0 -484
- package/menubar/menubar.esm.min.mjs +0 -1
- package/menubar/menubar.esm.mjs +0 -583
- package/message/message.esm.min.mjs +0 -1
- package/message/message.esm.mjs +0 -168
- package/messages/messages.esm.min.mjs +0 -1
- package/messages/messages.esm.mjs +0 -438
- package/multiselect/multiselect.esm.min.mjs +0 -1
- package/multiselect/multiselect.esm.mjs +0 -1723
- package/multistatecheckbox/multistatecheckbox.esm.min.mjs +0 -1
- package/multistatecheckbox/multistatecheckbox.esm.mjs +0 -351
- package/orderlist/orderlist.esm.min.mjs +0 -1
- package/orderlist/orderlist.esm.mjs +0 -820
- package/organizationchart/organizationchart.esm.min.mjs +0 -1
- package/organizationchart/organizationchart.esm.mjs +0 -479
- package/overlaypanel/overlaypanel.esm.min.mjs +0 -1
- package/overlaypanel/overlaypanel.esm.mjs +0 -515
- package/overlayservice/overlayservice.esm.min.mjs +0 -1
- package/overlayservice/overlayservice.esm.mjs +0 -6
- package/paginator/paginator.esm.min.mjs +0 -1
- package/paginator/paginator.esm.mjs +0 -932
- package/panel/panel.esm.min.mjs +0 -1
- package/panel/panel.esm.mjs +0 -315
- package/panelmenu/panelmenu.esm.min.mjs +0 -1
- package/panelmenu/panelmenu.esm.mjs +0 -644
- package/passthrough/index.esm.min.mjs +0 -1
- package/passthrough/index.esm.mjs +0 -70
- package/passthrough/tailwind/index.esm.min.mjs +0 -1
- package/passthrough/tailwind/index.esm.mjs +0 -3513
- package/password/password.esm.min.mjs +0 -1
- package/password/password.esm.mjs +0 -566
- package/picklist/picklist.esm.min.mjs +0 -1
- package/picklist/picklist.esm.mjs +0 -1118
- package/portal/portal.esm.min.mjs +0 -1
- package/portal/portal.esm.mjs +0 -109
- package/primereact.all.esm.min.mjs +0 -1
- package/primereact.all.esm.mjs +0 -51669
- package/progressbar/progressbar.esm.min.mjs +0 -1
- package/progressbar/progressbar.esm.mjs +0 -189
- package/progressspinner/progressspinner.esm.min.mjs +0 -1
- package/progressspinner/progressspinner.esm.mjs +0 -87
- package/radiobutton/radiobutton.esm.min.mjs +0 -1
- package/radiobutton/radiobutton.esm.mjs +0 -328
- package/rating/rating.esm.min.mjs +0 -1
- package/rating/rating.esm.mjs +0 -272
- package/ripple/ripple.esm.min.mjs +0 -1
- package/ripple/ripple.esm.mjs +0 -99
- package/row/row.esm.min.mjs +0 -1
- package/row/row.esm.mjs +0 -35
- package/scrollpanel/scrollpanel.esm.min.mjs +0 -1
- package/scrollpanel/scrollpanel.esm.mjs +0 -209
- package/scrolltop/scrolltop.esm.min.mjs +0 -1
- package/scrolltop/scrolltop.esm.mjs +0 -268
- package/selectbutton/selectbutton.esm.min.mjs +0 -1
- package/selectbutton/selectbutton.esm.mjs +0 -326
- package/sidebar/sidebar.esm.min.mjs +0 -1
- package/sidebar/sidebar.esm.mjs +0 -544
- package/skeleton/skeleton.esm.min.mjs +0 -1
- package/skeleton/skeleton.esm.mjs +0 -124
- package/slidemenu/slidemenu.esm.min.mjs +0 -1
- package/slidemenu/slidemenu.esm.mjs +0 -688
- package/slider/slider.esm.min.mjs +0 -1
- package/slider/slider.esm.mjs +0 -477
- package/speeddial/speeddial.esm.min.mjs +0 -1
- package/speeddial/speeddial.esm.mjs +0 -520
- package/splitbutton/splitbutton.esm.min.mjs +0 -1
- package/splitbutton/splitbutton.esm.mjs +0 -544
- package/splitter/splitter.esm.min.mjs +0 -1
- package/splitter/splitter.esm.mjs +0 -465
- package/steps/steps.esm.min.mjs +0 -1
- package/steps/steps.esm.mjs +0 -293
- package/styleclass/styleclass.esm.min.mjs +0 -1
- package/styleclass/styleclass.esm.mjs +0 -268
- package/tabmenu/tabmenu.esm.min.mjs +0 -1
- package/tabmenu/tabmenu.esm.mjs +0 -331
- package/tabview/tabview.esm.min.mjs +0 -1
- package/tabview/tabview.esm.mjs +0 -677
- package/tag/tag.esm.min.mjs +0 -1
- package/tag/tag.esm.mjs +0 -116
- package/terminal/terminal.esm.min.mjs +0 -1
- package/terminal/terminal.esm.mjs +0 -279
- package/terminalservice/terminalservice.esm.min.mjs +0 -1
- package/terminalservice/terminalservice.esm.mjs +0 -6
- package/tieredmenu/tieredmenu.esm.min.mjs +0 -1
- package/tieredmenu/tieredmenu.esm.mjs +0 -698
- package/timeline/timeline.esm.min.mjs +0 -1
- package/timeline/timeline.esm.mjs +0 -163
- package/toast/toast.esm.min.mjs +0 -1
- package/toast/toast.esm.mjs +0 -738
- package/togglebutton/togglebutton.esm.min.mjs +0 -1
- package/togglebutton/togglebutton.esm.mjs +0 -216
- package/toolbar/toolbar.esm.min.mjs +0 -1
- package/toolbar/toolbar.esm.mjs +0 -78
- package/tooltip/tooltip.esm.min.mjs +0 -1
- package/tooltip/tooltip.esm.mjs +0 -695
- package/tree/tree.esm.min.mjs +0 -1
- package/tree/tree.esm.mjs +0 -1402
- package/treeselect/treeselect.esm.min.mjs +0 -1
- package/treeselect/treeselect.esm.mjs +0 -929
- package/treetable/treetable.esm.min.mjs +0 -1
- package/treetable/treetable.esm.mjs +0 -3093
- package/tristatecheckbox/tristatecheckbox.esm.min.mjs +0 -1
- package/tristatecheckbox/tristatecheckbox.esm.mjs +0 -291
- package/utils/utils.esm.min.mjs +0 -1
- package/utils/utils.esm.mjs +0 -2382
- package/virtualscroller/virtualscroller.esm.min.mjs +0 -1
- package/virtualscroller/virtualscroller.esm.mjs +0 -971
|
@@ -1,1004 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { PrimeReactContext, localeOption } from 'primereact/api';
|
|
4
|
-
import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
|
|
5
|
-
import { classNames, ObjectUtils, mergeProps, IconUtils, DomHandler } from 'primereact/utils';
|
|
6
|
-
import { Button } from 'primereact/button';
|
|
7
|
-
import { PlusIcon } from 'primereact/icons/plus';
|
|
8
|
-
import { TimesIcon } from 'primereact/icons/times';
|
|
9
|
-
import { UploadIcon } from 'primereact/icons/upload';
|
|
10
|
-
import { Messages } from 'primereact/messages';
|
|
11
|
-
import { ProgressBar } from 'primereact/progressbar';
|
|
12
|
-
import { Ripple } from 'primereact/ripple';
|
|
13
|
-
|
|
14
|
-
function _typeof(o) {
|
|
15
|
-
"@babel/helpers - typeof";
|
|
16
|
-
|
|
17
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
18
|
-
return typeof o;
|
|
19
|
-
} : function (o) {
|
|
20
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
21
|
-
}, _typeof(o);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function _toPrimitive(input, hint) {
|
|
25
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
26
|
-
var prim = input[Symbol.toPrimitive];
|
|
27
|
-
if (prim !== undefined) {
|
|
28
|
-
var res = prim.call(input, hint || "default");
|
|
29
|
-
if (_typeof(res) !== "object") return res;
|
|
30
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
31
|
-
}
|
|
32
|
-
return (hint === "string" ? String : Number)(input);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function _toPropertyKey(arg) {
|
|
36
|
-
var key = _toPrimitive(arg, "string");
|
|
37
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function _defineProperty(obj, key, value) {
|
|
41
|
-
key = _toPropertyKey(key);
|
|
42
|
-
if (key in obj) {
|
|
43
|
-
Object.defineProperty(obj, key, {
|
|
44
|
-
value: value,
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true,
|
|
47
|
-
writable: true
|
|
48
|
-
});
|
|
49
|
-
} else {
|
|
50
|
-
obj[key] = value;
|
|
51
|
-
}
|
|
52
|
-
return obj;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function _extends() {
|
|
56
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
57
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
58
|
-
var source = arguments[i];
|
|
59
|
-
for (var key in source) {
|
|
60
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
61
|
-
target[key] = source[key];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return target;
|
|
66
|
-
};
|
|
67
|
-
return _extends.apply(this, arguments);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function _arrayLikeToArray$1(arr, len) {
|
|
71
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
72
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
73
|
-
return arr2;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function _arrayWithoutHoles(arr) {
|
|
77
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function _iterableToArray(iter) {
|
|
81
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _unsupportedIterableToArray$1(o, minLen) {
|
|
85
|
-
if (!o) return;
|
|
86
|
-
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
|
87
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
88
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
89
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
90
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function _nonIterableSpread() {
|
|
94
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function _toConsumableArray(arr) {
|
|
98
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function _readOnlyError(name) {
|
|
102
|
-
throw new TypeError("\"" + name + "\" is read-only");
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function _arrayWithHoles(arr) {
|
|
106
|
-
if (Array.isArray(arr)) return arr;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function _iterableToArrayLimit(r, l) {
|
|
110
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
111
|
-
if (null != t) {
|
|
112
|
-
var e,
|
|
113
|
-
n,
|
|
114
|
-
i,
|
|
115
|
-
u,
|
|
116
|
-
a = [],
|
|
117
|
-
f = !0,
|
|
118
|
-
o = !1;
|
|
119
|
-
try {
|
|
120
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
121
|
-
if (Object(t) !== t) return;
|
|
122
|
-
f = !1;
|
|
123
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
124
|
-
} catch (r) {
|
|
125
|
-
o = !0, n = r;
|
|
126
|
-
} finally {
|
|
127
|
-
try {
|
|
128
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
129
|
-
} finally {
|
|
130
|
-
if (o) throw n;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return a;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function _nonIterableRest() {
|
|
138
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function _slicedToArray(arr, i) {
|
|
142
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
var classes$1 = {
|
|
146
|
-
root: function root(_ref) {
|
|
147
|
-
var props = _ref.props;
|
|
148
|
-
return classNames('p-badge p-component', _defineProperty({
|
|
149
|
-
'p-badge-no-gutter': ObjectUtils.isNotEmpty(props.value) && String(props.value).length === 1,
|
|
150
|
-
'p-badge-dot': ObjectUtils.isEmpty(props.value),
|
|
151
|
-
'p-badge-lg': props.size === 'large',
|
|
152
|
-
'p-badge-xl': props.size === 'xlarge'
|
|
153
|
-
}, "p-badge-".concat(props.severity), props.severity !== null));
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
var styles$1 = "\n@layer primereact {\n .p-badge {\n display: inline-block;\n border-radius: 10px;\n text-align: center;\n padding: 0 .5rem;\n }\n \n .p-overlay-badge {\n position: relative;\n }\n \n .p-overlay-badge .p-badge {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%,-50%);\n transform-origin: 100% 0;\n margin: 0;\n }\n \n .p-badge-dot {\n width: .5rem;\n min-width: .5rem;\n height: .5rem;\n border-radius: 50%;\n padding: 0;\n }\n \n .p-badge-no-gutter {\n padding: 0;\n border-radius: 50%;\n }\n}\n";
|
|
157
|
-
var BadgeBase = ComponentBase.extend({
|
|
158
|
-
defaultProps: {
|
|
159
|
-
__TYPE: 'Badge',
|
|
160
|
-
__parentMetadata: null,
|
|
161
|
-
value: null,
|
|
162
|
-
severity: null,
|
|
163
|
-
size: null,
|
|
164
|
-
style: null,
|
|
165
|
-
className: null,
|
|
166
|
-
children: undefined
|
|
167
|
-
},
|
|
168
|
-
css: {
|
|
169
|
-
classes: classes$1,
|
|
170
|
-
styles: styles$1
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
175
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
176
|
-
var Badge = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
177
|
-
var context = React.useContext(PrimeReactContext);
|
|
178
|
-
var props = BadgeBase.getProps(inProps, context);
|
|
179
|
-
var _BadgeBase$setMetaDat = BadgeBase.setMetaData(_objectSpread$1({
|
|
180
|
-
props: props
|
|
181
|
-
}, props.__parentMetadata)),
|
|
182
|
-
ptm = _BadgeBase$setMetaDat.ptm,
|
|
183
|
-
cx = _BadgeBase$setMetaDat.cx,
|
|
184
|
-
isUnstyled = _BadgeBase$setMetaDat.isUnstyled;
|
|
185
|
-
useHandleStyle(BadgeBase.css.styles, isUnstyled, {
|
|
186
|
-
name: 'badge'
|
|
187
|
-
});
|
|
188
|
-
var elementRef = React.useRef(null);
|
|
189
|
-
React.useImperativeHandle(ref, function () {
|
|
190
|
-
return {
|
|
191
|
-
props: props,
|
|
192
|
-
getElement: function getElement() {
|
|
193
|
-
return elementRef.current;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
});
|
|
197
|
-
var rootProps = mergeProps({
|
|
198
|
-
ref: elementRef,
|
|
199
|
-
style: props.style,
|
|
200
|
-
className: classNames(props.className, cx('root'))
|
|
201
|
-
}, BadgeBase.getOtherProps(props), ptm('root'));
|
|
202
|
-
return /*#__PURE__*/React.createElement("span", rootProps, props.value);
|
|
203
|
-
}));
|
|
204
|
-
Badge.displayName = 'Badge';
|
|
205
|
-
|
|
206
|
-
var classes = {
|
|
207
|
-
root: function root(_ref) {
|
|
208
|
-
var props = _ref.props;
|
|
209
|
-
return classNames("p-fileupload p-fileupload-".concat(props.mode, " p-component"));
|
|
210
|
-
},
|
|
211
|
-
buttonbar: 'p-fileupload-buttonbar',
|
|
212
|
-
content: 'p-fileupload-content',
|
|
213
|
-
chooseButton: function chooseButton(_ref2) {
|
|
214
|
-
var iconOnly = _ref2.iconOnly,
|
|
215
|
-
disabled = _ref2.disabled,
|
|
216
|
-
focusedState = _ref2.focusedState;
|
|
217
|
-
return classNames('p-button p-fileupload-choose p-component', {
|
|
218
|
-
'p-disabled': disabled,
|
|
219
|
-
'p-focus': focusedState,
|
|
220
|
-
'p-button-icon-only': iconOnly
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
|
-
label: 'p-button-label p-clickable',
|
|
224
|
-
file: 'p-fileupload-row',
|
|
225
|
-
fileName: 'p-fileupload-filename',
|
|
226
|
-
thumbnail: 'p-fileupload-file-thumbnail',
|
|
227
|
-
chooseButtonLabel: 'p-button-label p-clickable',
|
|
228
|
-
basicButton: function basicButton(_ref3) {
|
|
229
|
-
var disabled = _ref3.disabled,
|
|
230
|
-
focusedState = _ref3.focusedState,
|
|
231
|
-
hasFiles = _ref3.hasFiles;
|
|
232
|
-
return classNames('p-button p-component p-fileupload-choose', {
|
|
233
|
-
'p-fileupload-choose-selected': hasFiles,
|
|
234
|
-
'p-disabled': disabled,
|
|
235
|
-
'p-focus': focusedState
|
|
236
|
-
});
|
|
237
|
-
},
|
|
238
|
-
chooseIcon: function chooseIcon(_ref4) {
|
|
239
|
-
var props = _ref4.props,
|
|
240
|
-
iconOnly = _ref4.iconOnly;
|
|
241
|
-
return props.mode === 'basic' ? classNames('p-button-icon', {
|
|
242
|
-
'p-button-icon-left': !iconOnly
|
|
243
|
-
}) : classNames('p-button-icon p-clickable', {
|
|
244
|
-
'p-button-icon-left': !iconOnly
|
|
245
|
-
});
|
|
246
|
-
},
|
|
247
|
-
uploadIcon: function uploadIcon(_ref5) {
|
|
248
|
-
var iconOnly = _ref5.iconOnly;
|
|
249
|
-
return classNames('p-button-icon p-c', {
|
|
250
|
-
'p-button-icon-left': !iconOnly
|
|
251
|
-
});
|
|
252
|
-
},
|
|
253
|
-
cancelIcon: function cancelIcon(_ref6) {
|
|
254
|
-
var iconOnly = _ref6.iconOnly;
|
|
255
|
-
return classNames('p-button-icon p-c', {
|
|
256
|
-
'p-button-icon-left': !iconOnly
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
var styles = "\n@layer primereact {\n .p-fileupload-content {\n position: relative;\n }\n \n .p-fileupload-row {\n display: flex;\n align-items: center;\n }\n \n .p-fileupload-row > div {\n flex: 1 1 auto;\n width: 25%;\n }\n \n .p-fileupload-row > div:last-child {\n text-align: right;\n }\n \n .p-fileupload-content > .p-progressbar {\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n }\n \n .p-button.p-fileupload-choose {\n position: relative;\n overflow: hidden;\n }\n \n .p-fileupload-buttonbar {\n display: flex;\n flex-wrap: wrap;\n }\n \n .p-button.p-fileupload-choose input[type='file'] {\n display: none;\n }\n \n .p-fileupload-choose.p-fileupload-choose-selected input[type='file'] {\n display: none;\n }\n \n .p-fileupload-filename {\n word-break: break-all;\n }\n \n .p-fileupload-file-thumbnail {\n flex-shrink: 0;\n }\n \n .p-fileupload-file-badge {\n margin: 0.5rem;\n }\n \n .p-fluid .p-fileupload .p-button {\n width: auto;\n }\n}\n";
|
|
261
|
-
var FileUploadBase = ComponentBase.extend({
|
|
262
|
-
defaultProps: {
|
|
263
|
-
__TYPE: 'FileUpload',
|
|
264
|
-
id: null,
|
|
265
|
-
name: null,
|
|
266
|
-
url: null,
|
|
267
|
-
mode: 'advanced',
|
|
268
|
-
multiple: false,
|
|
269
|
-
accept: null,
|
|
270
|
-
removeIcon: null,
|
|
271
|
-
disabled: false,
|
|
272
|
-
auto: false,
|
|
273
|
-
maxFileSize: null,
|
|
274
|
-
invalidFileSizeMessageSummary: '{0}: Invalid file size, ',
|
|
275
|
-
invalidFileSizeMessageDetail: 'maximum upload size is {0}.',
|
|
276
|
-
style: null,
|
|
277
|
-
className: null,
|
|
278
|
-
withCredentials: false,
|
|
279
|
-
previewWidth: 50,
|
|
280
|
-
chooseLabel: null,
|
|
281
|
-
uploadLabel: null,
|
|
282
|
-
cancelLabel: null,
|
|
283
|
-
chooseOptions: {
|
|
284
|
-
label: null,
|
|
285
|
-
icon: null,
|
|
286
|
-
iconOnly: false,
|
|
287
|
-
className: null,
|
|
288
|
-
style: null
|
|
289
|
-
},
|
|
290
|
-
uploadOptions: {
|
|
291
|
-
label: null,
|
|
292
|
-
icon: null,
|
|
293
|
-
iconOnly: false,
|
|
294
|
-
className: null,
|
|
295
|
-
style: null
|
|
296
|
-
},
|
|
297
|
-
cancelOptions: {
|
|
298
|
-
label: null,
|
|
299
|
-
icon: null,
|
|
300
|
-
iconOnly: false,
|
|
301
|
-
className: null,
|
|
302
|
-
style: null
|
|
303
|
-
},
|
|
304
|
-
customUpload: false,
|
|
305
|
-
headerClassName: null,
|
|
306
|
-
headerStyle: null,
|
|
307
|
-
contentClassName: null,
|
|
308
|
-
contentStyle: null,
|
|
309
|
-
headerTemplate: null,
|
|
310
|
-
itemTemplate: null,
|
|
311
|
-
emptyTemplate: null,
|
|
312
|
-
progressBarTemplate: null,
|
|
313
|
-
onBeforeUpload: null,
|
|
314
|
-
onBeforeSend: null,
|
|
315
|
-
onBeforeDrop: null,
|
|
316
|
-
onBeforeSelect: null,
|
|
317
|
-
onUpload: null,
|
|
318
|
-
onError: null,
|
|
319
|
-
onClear: null,
|
|
320
|
-
onSelect: null,
|
|
321
|
-
onProgress: null,
|
|
322
|
-
onValidationFail: null,
|
|
323
|
-
uploadHandler: null,
|
|
324
|
-
onRemove: null,
|
|
325
|
-
children: undefined
|
|
326
|
-
},
|
|
327
|
-
css: {
|
|
328
|
-
classes: classes,
|
|
329
|
-
styles: styles
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
334
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
335
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
336
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
337
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
338
|
-
var FileUpload = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
339
|
-
var context = React.useContext(PrimeReactContext);
|
|
340
|
-
var props = FileUploadBase.getProps(inProps, context);
|
|
341
|
-
var _React$useState = React.useState([]),
|
|
342
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
343
|
-
uploadedFilesState = _React$useState2[0],
|
|
344
|
-
setUploadedFilesState = _React$useState2[1];
|
|
345
|
-
var _React$useState3 = React.useState([]),
|
|
346
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
347
|
-
filesState = _React$useState4[0],
|
|
348
|
-
setFilesState = _React$useState4[1];
|
|
349
|
-
var _React$useState5 = React.useState(0),
|
|
350
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
351
|
-
progressState = _React$useState6[0],
|
|
352
|
-
setProgressState = _React$useState6[1];
|
|
353
|
-
var _React$useState7 = React.useState(false),
|
|
354
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
355
|
-
focusedState = _React$useState8[0],
|
|
356
|
-
setFocusedState = _React$useState8[1];
|
|
357
|
-
var _React$useState9 = React.useState(false),
|
|
358
|
-
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
359
|
-
uploadingState = _React$useState10[0],
|
|
360
|
-
setUploadingState = _React$useState10[1];
|
|
361
|
-
var metaData = {
|
|
362
|
-
props: props,
|
|
363
|
-
state: {
|
|
364
|
-
progress: progressState,
|
|
365
|
-
uploading: uploadingState,
|
|
366
|
-
uploadedFiles: uploadedFilesState,
|
|
367
|
-
files: filesState,
|
|
368
|
-
focused: focusedState
|
|
369
|
-
}
|
|
370
|
-
};
|
|
371
|
-
var _FileUploadBase$setMe = FileUploadBase.setMetaData(metaData),
|
|
372
|
-
ptm = _FileUploadBase$setMe.ptm,
|
|
373
|
-
cx = _FileUploadBase$setMe.cx,
|
|
374
|
-
isUnstyled = _FileUploadBase$setMe.isUnstyled;
|
|
375
|
-
useHandleStyle(FileUploadBase.css.styles, isUnstyled, {
|
|
376
|
-
name: 'fileupload'
|
|
377
|
-
});
|
|
378
|
-
var fileInputRef = React.useRef(null);
|
|
379
|
-
var messagesRef = React.useRef(null);
|
|
380
|
-
var contentRef = React.useRef(null);
|
|
381
|
-
var uploadedFileCount = React.useRef(0);
|
|
382
|
-
var hasFiles = ObjectUtils.isNotEmpty(filesState);
|
|
383
|
-
var hasUploadedFiles = ObjectUtils.isNotEmpty(uploadedFilesState);
|
|
384
|
-
var disabled = props.disabled || uploadingState;
|
|
385
|
-
var chooseButtonLabel = props.chooseLabel || props.chooseOptions.label || localeOption('choose');
|
|
386
|
-
var uploadButtonLabel = props.uploadLabel || props.uploadOptions.label || localeOption('upload');
|
|
387
|
-
var cancelButtonLabel = props.cancelLabel || props.cancelOptions.label || localeOption('cancel');
|
|
388
|
-
var chooseDisabled = disabled || props.fileLimit && props.fileLimit <= filesState.length + uploadedFileCount;
|
|
389
|
-
var uploadDisabled = disabled || !hasFiles;
|
|
390
|
-
var cancelDisabled = disabled || !hasFiles;
|
|
391
|
-
var isImage = function isImage(file) {
|
|
392
|
-
return /^image\//.test(file.type);
|
|
393
|
-
};
|
|
394
|
-
var remove = function remove(event, index) {
|
|
395
|
-
clearInput();
|
|
396
|
-
var currentFiles = _toConsumableArray(filesState);
|
|
397
|
-
var removedFile = filesState[index];
|
|
398
|
-
currentFiles.splice(index, 1);
|
|
399
|
-
setFilesState(currentFiles);
|
|
400
|
-
if (props.onRemove) {
|
|
401
|
-
props.onRemove({
|
|
402
|
-
originalEvent: event,
|
|
403
|
-
file: removedFile
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
var removeUploadedFiles = function removeUploadedFiles(event, index) {
|
|
408
|
-
clearInput();
|
|
409
|
-
var currentUploadedFiles = _toConsumableArray(uploadedFilesState);
|
|
410
|
-
var removedFile = filesState[index];
|
|
411
|
-
currentUploadedFiles.splice(index, 1);
|
|
412
|
-
setUploadedFilesState(currentUploadedFiles);
|
|
413
|
-
if (props.onRemove) {
|
|
414
|
-
props.onRemove({
|
|
415
|
-
originalEvent: event,
|
|
416
|
-
file: removedFile
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
var clearInput = function clearInput() {
|
|
421
|
-
if (fileInputRef.current) {
|
|
422
|
-
fileInputRef.current.value = '';
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
var formatSize = function formatSize(bytes) {
|
|
426
|
-
var k = 1024;
|
|
427
|
-
var dm = 3;
|
|
428
|
-
var sizes = localeOption('fileSizeTypes');
|
|
429
|
-
if (bytes === 0) {
|
|
430
|
-
return "0 ".concat(sizes[0]);
|
|
431
|
-
}
|
|
432
|
-
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
433
|
-
var formattedSize = parseFloat((bytes / Math.pow(k, i)).toFixed(dm));
|
|
434
|
-
return "".concat(formattedSize, " ").concat(sizes[i]);
|
|
435
|
-
};
|
|
436
|
-
var onFileSelect = function onFileSelect(event) {
|
|
437
|
-
// give caller a chance to stop the selection
|
|
438
|
-
if (props.onBeforeSelect && props.onBeforeSelect({
|
|
439
|
-
originalEvent: event,
|
|
440
|
-
files: filesState
|
|
441
|
-
}) === false) {
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
var currentFiles = [];
|
|
445
|
-
if (props.multiple) {
|
|
446
|
-
currentFiles = filesState ? _toConsumableArray(filesState) : [];
|
|
447
|
-
}
|
|
448
|
-
var selectedFiles = event.dataTransfer ? event.dataTransfer.files : event.target.files;
|
|
449
|
-
for (var i = 0; i < selectedFiles.length; i++) {
|
|
450
|
-
var file = selectedFiles[i];
|
|
451
|
-
if (!isFileSelected(file) && validate(file)) {
|
|
452
|
-
if (isImage(file)) {
|
|
453
|
-
file.objectURL = window.URL.createObjectURL(file);
|
|
454
|
-
}
|
|
455
|
-
currentFiles.push(file);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
setFilesState(currentFiles);
|
|
459
|
-
if (ObjectUtils.isNotEmpty(currentFiles) && props.auto) {
|
|
460
|
-
upload(currentFiles);
|
|
461
|
-
}
|
|
462
|
-
if (props.onSelect) {
|
|
463
|
-
props.onSelect({
|
|
464
|
-
originalEvent: event,
|
|
465
|
-
files: currentFiles
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
clearInput();
|
|
469
|
-
if (props.mode === 'basic' && currentFiles.length > 0) {
|
|
470
|
-
fileInputRef.current.style.display = 'none';
|
|
471
|
-
}
|
|
472
|
-
};
|
|
473
|
-
var isFileSelected = function isFileSelected(file) {
|
|
474
|
-
return filesState.some(function (f) {
|
|
475
|
-
return f.name + f.type + f.size === file.name + file.type + file.size;
|
|
476
|
-
});
|
|
477
|
-
};
|
|
478
|
-
var validate = function validate(file) {
|
|
479
|
-
if (props.maxFileSize && file.size > props.maxFileSize) {
|
|
480
|
-
var message = {
|
|
481
|
-
severity: 'error',
|
|
482
|
-
summary: props.invalidFileSizeMessageSummary.replace('{0}', file.name),
|
|
483
|
-
detail: props.invalidFileSizeMessageDetail.replace('{0}', formatSize(props.maxFileSize)),
|
|
484
|
-
sticky: true
|
|
485
|
-
};
|
|
486
|
-
if (props.mode === 'advanced') {
|
|
487
|
-
messagesRef.current.show(message);
|
|
488
|
-
}
|
|
489
|
-
props.onValidationFail && props.onValidationFail(file);
|
|
490
|
-
return false;
|
|
491
|
-
}
|
|
492
|
-
return true;
|
|
493
|
-
};
|
|
494
|
-
var upload = function upload(files) {
|
|
495
|
-
files = files || filesState;
|
|
496
|
-
if (files && files.nativeEvent) {
|
|
497
|
-
files = filesState;
|
|
498
|
-
}
|
|
499
|
-
if (props.customUpload) {
|
|
500
|
-
if (props.fileLimit) {
|
|
501
|
-
uploadedFileCount + files.length, _readOnlyError("uploadedFileCount");
|
|
502
|
-
}
|
|
503
|
-
if (props.uploadHandler) {
|
|
504
|
-
props.uploadHandler({
|
|
505
|
-
files: files,
|
|
506
|
-
options: {
|
|
507
|
-
clear: clear,
|
|
508
|
-
props: props
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
} else {
|
|
513
|
-
setUploadingState(true);
|
|
514
|
-
var xhr = new XMLHttpRequest();
|
|
515
|
-
var formData = new FormData();
|
|
516
|
-
if (props.onBeforeUpload) {
|
|
517
|
-
props.onBeforeUpload({
|
|
518
|
-
xhr: xhr,
|
|
519
|
-
formData: formData
|
|
520
|
-
});
|
|
521
|
-
}
|
|
522
|
-
var _iterator = _createForOfIteratorHelper(files),
|
|
523
|
-
_step;
|
|
524
|
-
try {
|
|
525
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
526
|
-
var file = _step.value;
|
|
527
|
-
formData.append(props.name, file, file.name);
|
|
528
|
-
}
|
|
529
|
-
} catch (err) {
|
|
530
|
-
_iterator.e(err);
|
|
531
|
-
} finally {
|
|
532
|
-
_iterator.f();
|
|
533
|
-
}
|
|
534
|
-
xhr.upload.addEventListener('progress', function (event) {
|
|
535
|
-
if (event.lengthComputable) {
|
|
536
|
-
var progress = Math.round(event.loaded * 100 / event.total);
|
|
537
|
-
setProgressState(progress);
|
|
538
|
-
if (props.onProgress) {
|
|
539
|
-
props.onProgress({
|
|
540
|
-
originalEvent: event,
|
|
541
|
-
progress: progress
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
});
|
|
546
|
-
xhr.onreadystatechange = function () {
|
|
547
|
-
if (xhr.readyState === 4) {
|
|
548
|
-
setProgressState(0);
|
|
549
|
-
setUploadingState(false);
|
|
550
|
-
if (xhr.status >= 200 && xhr.status < 300) {
|
|
551
|
-
if (props.fileLimit) {
|
|
552
|
-
uploadedFileCount + files.length, _readOnlyError("uploadedFileCount");
|
|
553
|
-
}
|
|
554
|
-
if (props.onUpload) {
|
|
555
|
-
props.onUpload({
|
|
556
|
-
xhr: xhr,
|
|
557
|
-
files: files
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
} else {
|
|
561
|
-
if (props.onError) {
|
|
562
|
-
props.onError({
|
|
563
|
-
xhr: xhr,
|
|
564
|
-
files: files
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
setUploadedFilesState(function (prevUploadedFiles) {
|
|
569
|
-
return [].concat(_toConsumableArray(prevUploadedFiles), _toConsumableArray(files));
|
|
570
|
-
});
|
|
571
|
-
clear();
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
xhr.open('POST', props.url, true);
|
|
575
|
-
if (props.onBeforeSend) {
|
|
576
|
-
props.onBeforeSend({
|
|
577
|
-
xhr: xhr,
|
|
578
|
-
formData: formData
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
xhr.withCredentials = props.withCredentials;
|
|
582
|
-
xhr.send(formData);
|
|
583
|
-
}
|
|
584
|
-
};
|
|
585
|
-
var clear = function clear() {
|
|
586
|
-
setFilesState([]);
|
|
587
|
-
setUploadedFilesState([]);
|
|
588
|
-
setUploadingState(false);
|
|
589
|
-
props.onClear && props.onClear();
|
|
590
|
-
clearInput();
|
|
591
|
-
};
|
|
592
|
-
var choose = function choose() {
|
|
593
|
-
fileInputRef.current.click();
|
|
594
|
-
};
|
|
595
|
-
var onFocus = function onFocus() {
|
|
596
|
-
setFocusedState(true);
|
|
597
|
-
};
|
|
598
|
-
var onBlur = function onBlur() {
|
|
599
|
-
setFocusedState(false);
|
|
600
|
-
};
|
|
601
|
-
var _onKeyDown = function onKeyDown(event) {
|
|
602
|
-
if (event.which === 13) {
|
|
603
|
-
// enter
|
|
604
|
-
choose();
|
|
605
|
-
}
|
|
606
|
-
};
|
|
607
|
-
var _onDragEnter = function onDragEnter(event) {
|
|
608
|
-
if (!disabled) {
|
|
609
|
-
event.dataTransfer.dropEffect = 'copy';
|
|
610
|
-
event.stopPropagation();
|
|
611
|
-
event.preventDefault();
|
|
612
|
-
}
|
|
613
|
-
};
|
|
614
|
-
var _onDragOver = function onDragOver(event) {
|
|
615
|
-
if (!disabled) {
|
|
616
|
-
event.dataTransfer.dropEffect = 'copy';
|
|
617
|
-
!isUnstyled() && DomHandler.addClass(contentRef.current, 'p-fileupload-highlight');
|
|
618
|
-
contentRef.current.setAttribute('data-p-highlight', true);
|
|
619
|
-
event.stopPropagation();
|
|
620
|
-
event.preventDefault();
|
|
621
|
-
}
|
|
622
|
-
};
|
|
623
|
-
var _onDragLeave = function onDragLeave(event) {
|
|
624
|
-
if (!disabled) {
|
|
625
|
-
event.dataTransfer.dropEffect = 'copy';
|
|
626
|
-
!isUnstyled() && DomHandler.removeClass(contentRef.current, 'p-fileupload-highlight');
|
|
627
|
-
contentRef.current.setAttribute('data-p-highlight', false);
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
var _onDrop = function onDrop(event) {
|
|
631
|
-
if (props.disabled) {
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
634
|
-
!isUnstyled() && DomHandler.removeClass(contentRef.current, 'p-fileupload-highlight');
|
|
635
|
-
contentRef.current.setAttribute('data-p-highlight', false);
|
|
636
|
-
event.stopPropagation();
|
|
637
|
-
event.preventDefault();
|
|
638
|
-
|
|
639
|
-
// give caller a chance to stop the drop
|
|
640
|
-
if (props.onBeforeDrop && props.onBeforeDrop(event) === false) {
|
|
641
|
-
return;
|
|
642
|
-
}
|
|
643
|
-
var files = event.dataTransfer ? event.dataTransfer.files : event.target.files;
|
|
644
|
-
var allowDrop = props.multiple || ObjectUtils.isEmpty(filesState) && files && files.length === 1;
|
|
645
|
-
allowDrop && onFileSelect(event);
|
|
646
|
-
};
|
|
647
|
-
var onSimpleUploaderClick = function onSimpleUploaderClick() {
|
|
648
|
-
!disabled && hasFiles ? upload() : fileInputRef.current.click();
|
|
649
|
-
};
|
|
650
|
-
React.useImperativeHandle(ref, function () {
|
|
651
|
-
return {
|
|
652
|
-
props: props,
|
|
653
|
-
upload: upload,
|
|
654
|
-
clear: clear,
|
|
655
|
-
formatSize: formatSize,
|
|
656
|
-
onFileSelect: onFileSelect,
|
|
657
|
-
getInput: function getInput() {
|
|
658
|
-
return fileInputRef.current;
|
|
659
|
-
},
|
|
660
|
-
getContent: function getContent() {
|
|
661
|
-
return contentRef.current;
|
|
662
|
-
},
|
|
663
|
-
getFiles: function getFiles() {
|
|
664
|
-
return filesState;
|
|
665
|
-
},
|
|
666
|
-
setFiles: function setFiles(files) {
|
|
667
|
-
return setFilesState(files || []);
|
|
668
|
-
},
|
|
669
|
-
getUploadedFiles: function getUploadedFiles() {
|
|
670
|
-
return uploadedFilesState;
|
|
671
|
-
},
|
|
672
|
-
setUploadedFiles: function setUploadedFiles(files) {
|
|
673
|
-
return setUploadedFilesState(files || []);
|
|
674
|
-
}
|
|
675
|
-
};
|
|
676
|
-
});
|
|
677
|
-
var createChooseButton = function createChooseButton() {
|
|
678
|
-
var _props$chooseOptions = props.chooseOptions,
|
|
679
|
-
className = _props$chooseOptions.className,
|
|
680
|
-
style = _props$chooseOptions.style,
|
|
681
|
-
_icon = _props$chooseOptions.icon,
|
|
682
|
-
iconOnly = _props$chooseOptions.iconOnly;
|
|
683
|
-
var chooseButtonLabelProps = mergeProps({
|
|
684
|
-
className: cx('chooseButtonLabel')
|
|
685
|
-
}, ptm('chooseButtonLabel'));
|
|
686
|
-
var label = iconOnly ? /*#__PURE__*/React.createElement("span", _extends({}, chooseButtonLabelProps, {
|
|
687
|
-
dangerouslySetInnerHTML: {
|
|
688
|
-
__html: ' '
|
|
689
|
-
}
|
|
690
|
-
})) : /*#__PURE__*/React.createElement("span", chooseButtonLabelProps, chooseButtonLabel);
|
|
691
|
-
var inputProps = mergeProps({
|
|
692
|
-
ref: fileInputRef,
|
|
693
|
-
type: 'file',
|
|
694
|
-
onChange: function onChange(e) {
|
|
695
|
-
return onFileSelect(e);
|
|
696
|
-
},
|
|
697
|
-
multiple: props.multiple,
|
|
698
|
-
accept: props.accept,
|
|
699
|
-
disabled: chooseDisabled
|
|
700
|
-
}, ptm('input'));
|
|
701
|
-
var input = /*#__PURE__*/React.createElement("input", inputProps);
|
|
702
|
-
var chooseIconProps = mergeProps({
|
|
703
|
-
className: cx('chooseIcon', {
|
|
704
|
-
iconOnly: iconOnly
|
|
705
|
-
})
|
|
706
|
-
}, ptm('chooseIcon'));
|
|
707
|
-
var icon = _icon || /*#__PURE__*/React.createElement(PlusIcon, chooseIconProps);
|
|
708
|
-
var chooseIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, chooseIconProps), {
|
|
709
|
-
props: props
|
|
710
|
-
});
|
|
711
|
-
var chooseButtonProps = mergeProps({
|
|
712
|
-
className: classNames(className, cx('chooseButton', {
|
|
713
|
-
iconOnly: iconOnly,
|
|
714
|
-
disabled: disabled,
|
|
715
|
-
className: className,
|
|
716
|
-
focusedState: focusedState
|
|
717
|
-
})),
|
|
718
|
-
style: style,
|
|
719
|
-
onClick: choose,
|
|
720
|
-
onKeyDown: function onKeyDown(e) {
|
|
721
|
-
return _onKeyDown(e);
|
|
722
|
-
},
|
|
723
|
-
onFocus: onFocus,
|
|
724
|
-
onBlur: onBlur,
|
|
725
|
-
tabIndex: 0,
|
|
726
|
-
'data-p-disabled': disabled,
|
|
727
|
-
'data-p-focus': focusedState
|
|
728
|
-
}, ptm('chooseButton'));
|
|
729
|
-
return /*#__PURE__*/React.createElement("span", chooseButtonProps, input, chooseIcon, label, /*#__PURE__*/React.createElement(Ripple, null));
|
|
730
|
-
};
|
|
731
|
-
var onRemoveClick = function onRemoveClick(e, badgeOptions, index) {
|
|
732
|
-
if (badgeOptions.severity === 'warning') remove(e, index);else removeUploadedFiles(e, index);
|
|
733
|
-
};
|
|
734
|
-
var createFile = function createFile(file, index, badgeOptions) {
|
|
735
|
-
var key = file.name + file.type + file.size;
|
|
736
|
-
var thumbnailProps = mergeProps({
|
|
737
|
-
role: 'presentation',
|
|
738
|
-
className: cx('thumbnail'),
|
|
739
|
-
src: file.objectURL,
|
|
740
|
-
width: props.previewWidth
|
|
741
|
-
}, ptm('thumbnail'));
|
|
742
|
-
var preview = isImage(file) ? /*#__PURE__*/React.createElement("img", _extends({}, thumbnailProps, {
|
|
743
|
-
alt: file.name
|
|
744
|
-
})) : null;
|
|
745
|
-
var detailsProps = mergeProps(ptm('details'));
|
|
746
|
-
var fileSizeProps = mergeProps(ptm('fileSize'));
|
|
747
|
-
var fileNameProps = mergeProps({
|
|
748
|
-
className: cx('fileName')
|
|
749
|
-
}, ptm('fileName'));
|
|
750
|
-
var actionsProps = mergeProps(ptm('actions'));
|
|
751
|
-
var fileName = /*#__PURE__*/React.createElement("div", fileNameProps, file.name);
|
|
752
|
-
var size = /*#__PURE__*/React.createElement("div", fileSizeProps, formatSize(file.size));
|
|
753
|
-
var contentBody = /*#__PURE__*/React.createElement("div", detailsProps, /*#__PURE__*/React.createElement("div", fileNameProps, " ", file.name), /*#__PURE__*/React.createElement("span", fileSizeProps, formatSize(file.size)), /*#__PURE__*/React.createElement(Badge, {
|
|
754
|
-
className: "p-fileupload-file-badge",
|
|
755
|
-
value: badgeOptions.value,
|
|
756
|
-
severity: badgeOptions.severity,
|
|
757
|
-
pt: ptm('badge'),
|
|
758
|
-
__parentMetadata: {
|
|
759
|
-
parent: metaData
|
|
760
|
-
}
|
|
761
|
-
}));
|
|
762
|
-
var removeButton = /*#__PURE__*/React.createElement("div", actionsProps, /*#__PURE__*/React.createElement(Button, {
|
|
763
|
-
type: "button",
|
|
764
|
-
icon: props.removeIcon || /*#__PURE__*/React.createElement(TimesIcon, null),
|
|
765
|
-
text: true,
|
|
766
|
-
rounded: true,
|
|
767
|
-
severity: "danger",
|
|
768
|
-
onClick: function onClick(e) {
|
|
769
|
-
return onRemoveClick(e, badgeOptions, index);
|
|
770
|
-
},
|
|
771
|
-
disabled: disabled,
|
|
772
|
-
pt: ptm('removeButton'),
|
|
773
|
-
__parentMetadata: {
|
|
774
|
-
parent: metaData
|
|
775
|
-
}
|
|
776
|
-
}));
|
|
777
|
-
var content = /*#__PURE__*/React.createElement(React.Fragment, null, preview, contentBody, removeButton);
|
|
778
|
-
if (props.itemTemplate) {
|
|
779
|
-
var defaultContentOptions = {
|
|
780
|
-
onRemove: function onRemove(event) {
|
|
781
|
-
return remove(event, index);
|
|
782
|
-
},
|
|
783
|
-
previewElement: preview,
|
|
784
|
-
fileNameElement: fileName,
|
|
785
|
-
sizeElement: size,
|
|
786
|
-
removeElement: removeButton,
|
|
787
|
-
formatSize: formatSize(file.size),
|
|
788
|
-
element: content,
|
|
789
|
-
index: index,
|
|
790
|
-
props: props
|
|
791
|
-
};
|
|
792
|
-
content = ObjectUtils.getJSXElement(props.itemTemplate, file, defaultContentOptions);
|
|
793
|
-
}
|
|
794
|
-
var fileProps = mergeProps({
|
|
795
|
-
key: key,
|
|
796
|
-
className: cx('file')
|
|
797
|
-
}, ptm('file'));
|
|
798
|
-
return /*#__PURE__*/React.createElement("div", fileProps, content);
|
|
799
|
-
};
|
|
800
|
-
var createFiles = function createFiles() {
|
|
801
|
-
var badgeOptions = {
|
|
802
|
-
severity: 'warning',
|
|
803
|
-
value: 'Pending'
|
|
804
|
-
};
|
|
805
|
-
var content = filesState.map(function (file, index) {
|
|
806
|
-
return createFile(file, index, badgeOptions);
|
|
807
|
-
});
|
|
808
|
-
return /*#__PURE__*/React.createElement("div", null, content);
|
|
809
|
-
};
|
|
810
|
-
var createUploadedFiles = function createUploadedFiles() {
|
|
811
|
-
var badgeOptions = {
|
|
812
|
-
severity: 'success',
|
|
813
|
-
value: 'Completed'
|
|
814
|
-
};
|
|
815
|
-
var content = uploadedFilesState && uploadedFilesState.map(function (file, index) {
|
|
816
|
-
return createFile(file, index, badgeOptions);
|
|
817
|
-
});
|
|
818
|
-
return /*#__PURE__*/React.createElement("div", null, content);
|
|
819
|
-
};
|
|
820
|
-
var createEmptyContent = function createEmptyContent() {
|
|
821
|
-
return props.emptyTemplate && !hasFiles && !hasUploadedFiles ? ObjectUtils.getJSXElement(props.emptyTemplate, props) : null;
|
|
822
|
-
};
|
|
823
|
-
var createProgressBarContent = function createProgressBarContent() {
|
|
824
|
-
if (props.progressBarTemplate) {
|
|
825
|
-
return ObjectUtils.getJSXElement(props.progressBarTemplate, props);
|
|
826
|
-
}
|
|
827
|
-
return /*#__PURE__*/React.createElement(ProgressBar, {
|
|
828
|
-
value: progressState,
|
|
829
|
-
showValue: false,
|
|
830
|
-
pt: ptm('progressbar'),
|
|
831
|
-
__parentMetadata: {
|
|
832
|
-
parent: metaData
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
};
|
|
836
|
-
var createAdvanced = function createAdvanced() {
|
|
837
|
-
var chooseButton = createChooseButton();
|
|
838
|
-
var emptyContent = createEmptyContent();
|
|
839
|
-
var uploadButton, cancelButton, filesList, uplaodedFilesList, progressBar;
|
|
840
|
-
if (!props.auto) {
|
|
841
|
-
var uploadOptions = props.uploadOptions;
|
|
842
|
-
var cancelOptions = props.cancelOptions;
|
|
843
|
-
var uploadLabel = !uploadOptions.iconOnly ? uploadButtonLabel : '';
|
|
844
|
-
var cancelLabel = !cancelOptions.iconOnly ? cancelButtonLabel : '';
|
|
845
|
-
var uploadIconProps = mergeProps({
|
|
846
|
-
className: cx('uploadIcon', {
|
|
847
|
-
iconOnly: uploadOptions.iconOnly
|
|
848
|
-
})
|
|
849
|
-
}, ptm('uploadIcon'));
|
|
850
|
-
var uploadIcon = IconUtils.getJSXIcon(uploadOptions.icon || /*#__PURE__*/React.createElement(UploadIcon, uploadIconProps), _objectSpread({}, uploadIconProps), {
|
|
851
|
-
props: props
|
|
852
|
-
});
|
|
853
|
-
var cancelIconProps = mergeProps({
|
|
854
|
-
className: cx('cancelIcon', {
|
|
855
|
-
iconOnly: cancelOptions.iconOnly
|
|
856
|
-
})
|
|
857
|
-
}, ptm('cancelIcon'));
|
|
858
|
-
var cancelIcon = IconUtils.getJSXIcon(cancelOptions.icon || /*#__PURE__*/React.createElement(TimesIcon, cancelIconProps), _objectSpread({}, cancelIconProps), {
|
|
859
|
-
props: props
|
|
860
|
-
});
|
|
861
|
-
uploadButton = /*#__PURE__*/React.createElement(Button, {
|
|
862
|
-
type: "button",
|
|
863
|
-
label: uploadLabel,
|
|
864
|
-
icon: uploadIcon,
|
|
865
|
-
onClick: upload,
|
|
866
|
-
disabled: uploadDisabled,
|
|
867
|
-
style: uploadOptions.style,
|
|
868
|
-
className: uploadOptions.className,
|
|
869
|
-
pt: ptm('uploadButton'),
|
|
870
|
-
__parentMetadata: {
|
|
871
|
-
parent: metaData
|
|
872
|
-
}
|
|
873
|
-
});
|
|
874
|
-
cancelButton = /*#__PURE__*/React.createElement(Button, {
|
|
875
|
-
type: "button",
|
|
876
|
-
label: cancelLabel,
|
|
877
|
-
icon: cancelIcon,
|
|
878
|
-
onClick: clear,
|
|
879
|
-
disabled: cancelDisabled,
|
|
880
|
-
style: cancelOptions.style,
|
|
881
|
-
className: cancelOptions.className,
|
|
882
|
-
pt: ptm('cancelButton'),
|
|
883
|
-
__parentMetadata: {
|
|
884
|
-
parent: metaData
|
|
885
|
-
}
|
|
886
|
-
});
|
|
887
|
-
}
|
|
888
|
-
if (hasFiles) {
|
|
889
|
-
filesList = createFiles();
|
|
890
|
-
progressBar = createProgressBarContent();
|
|
891
|
-
}
|
|
892
|
-
if (hasUploadedFiles) {
|
|
893
|
-
uplaodedFilesList = createUploadedFiles();
|
|
894
|
-
}
|
|
895
|
-
var buttonbarProps = mergeProps({
|
|
896
|
-
className: classNames(props.headerClassName, cx('buttonbar')),
|
|
897
|
-
style: props.headerStyle
|
|
898
|
-
}, ptm('buttonbar'));
|
|
899
|
-
var header = /*#__PURE__*/React.createElement("div", buttonbarProps, chooseButton, uploadButton, cancelButton);
|
|
900
|
-
if (props.headerTemplate) {
|
|
901
|
-
var defaultContentOptions = {
|
|
902
|
-
className: classNames('p-fileupload-buttonbar', props.headerClassName),
|
|
903
|
-
chooseButton: chooseButton,
|
|
904
|
-
uploadButton: uploadButton,
|
|
905
|
-
cancelButton: cancelButton,
|
|
906
|
-
element: header,
|
|
907
|
-
props: props
|
|
908
|
-
};
|
|
909
|
-
header = ObjectUtils.getJSXElement(props.headerTemplate, defaultContentOptions);
|
|
910
|
-
}
|
|
911
|
-
var rootProps = mergeProps({
|
|
912
|
-
id: props.id,
|
|
913
|
-
className: cx('root'),
|
|
914
|
-
style: props.style
|
|
915
|
-
}, FileUploadBase.getOtherProps(props), ptm('root'));
|
|
916
|
-
var contentProps = mergeProps({
|
|
917
|
-
ref: contentRef,
|
|
918
|
-
className: classNames(props.contentClassName, cx('content')),
|
|
919
|
-
style: props.contentStyle,
|
|
920
|
-
onDragEnter: function onDragEnter(e) {
|
|
921
|
-
return _onDragEnter(e);
|
|
922
|
-
},
|
|
923
|
-
onDragOver: function onDragOver(e) {
|
|
924
|
-
return _onDragOver(e);
|
|
925
|
-
},
|
|
926
|
-
onDragLeave: function onDragLeave(e) {
|
|
927
|
-
return _onDragLeave(e);
|
|
928
|
-
},
|
|
929
|
-
onDrop: function onDrop(e) {
|
|
930
|
-
return _onDrop(e);
|
|
931
|
-
},
|
|
932
|
-
'data-p-highlight': false
|
|
933
|
-
}, ptm('content'));
|
|
934
|
-
return /*#__PURE__*/React.createElement("div", rootProps, header, /*#__PURE__*/React.createElement("div", contentProps, progressBar, /*#__PURE__*/React.createElement(Messages, {
|
|
935
|
-
ref: messagesRef,
|
|
936
|
-
__parentMetadata: {
|
|
937
|
-
parent: metaData
|
|
938
|
-
}
|
|
939
|
-
}), hasFiles ? filesList : null, hasUploadedFiles ? uplaodedFilesList : null, emptyContent));
|
|
940
|
-
};
|
|
941
|
-
var createBasic = function createBasic() {
|
|
942
|
-
var chooseOptions = props.chooseOptions;
|
|
943
|
-
var labelProps = mergeProps({
|
|
944
|
-
className: cx('label')
|
|
945
|
-
}, ptm('label'));
|
|
946
|
-
var chooseLabel = chooseOptions.iconOnly ? /*#__PURE__*/React.createElement("span", _extends({}, labelProps, {
|
|
947
|
-
dangerouslySetInnerHTML: {
|
|
948
|
-
__html: ' '
|
|
949
|
-
}
|
|
950
|
-
})) : /*#__PURE__*/React.createElement("span", labelProps, chooseButtonLabel);
|
|
951
|
-
var label = props.auto ? chooseLabel : /*#__PURE__*/React.createElement("span", labelProps, hasFiles ? filesState[0].name : chooseLabel);
|
|
952
|
-
var chooseIconProps = mergeProps({
|
|
953
|
-
className: cx('chooseIcon', {
|
|
954
|
-
iconOnly: chooseOptions.iconOnly
|
|
955
|
-
})
|
|
956
|
-
}, ptm('chooseIcon'));
|
|
957
|
-
var icon = chooseOptions.icon ? chooseOptions.icon : !chooseOptions.icon && (!hasFiles || props.auto) ? /*#__PURE__*/React.createElement(PlusIcon, chooseIconProps) : !chooseOptions.icon && hasFiles && !props.auto && /*#__PURE__*/React.createElement(UploadIcon, chooseIconProps);
|
|
958
|
-
var chooseIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, chooseIconProps), {
|
|
959
|
-
props: props,
|
|
960
|
-
hasFiles: hasFiles
|
|
961
|
-
});
|
|
962
|
-
var inputProps = mergeProps({
|
|
963
|
-
ref: fileInputRef,
|
|
964
|
-
type: 'file',
|
|
965
|
-
onChange: function onChange(e) {
|
|
966
|
-
return onFileSelect(e);
|
|
967
|
-
},
|
|
968
|
-
multiple: props.multiple,
|
|
969
|
-
accept: props.accept,
|
|
970
|
-
disabled: disabled
|
|
971
|
-
}, ptm('input'));
|
|
972
|
-
var input = !hasFiles && /*#__PURE__*/React.createElement("input", inputProps);
|
|
973
|
-
var rootProps = mergeProps({
|
|
974
|
-
className: classNames(props.className, cx('root')),
|
|
975
|
-
style: props.style
|
|
976
|
-
}, FileUploadBase.getOtherProps(props), ptm('root'));
|
|
977
|
-
var basicButtonProps = mergeProps({
|
|
978
|
-
className: classNames(chooseOptions.className, cx('basicButton', {
|
|
979
|
-
hasFiles: hasFiles,
|
|
980
|
-
disabled: disabled,
|
|
981
|
-
focusedState: focusedState
|
|
982
|
-
})),
|
|
983
|
-
style: chooseOptions.style,
|
|
984
|
-
tabIndex: 0,
|
|
985
|
-
onClick: onSimpleUploaderClick,
|
|
986
|
-
onKeyDown: function onKeyDown(e) {
|
|
987
|
-
return _onKeyDown(e);
|
|
988
|
-
},
|
|
989
|
-
onFocus: onFocus,
|
|
990
|
-
onBlur: onBlur
|
|
991
|
-
}, FileUploadBase.getOtherProps(props), ptm('basicButton'));
|
|
992
|
-
return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement(Messages, {
|
|
993
|
-
ref: messagesRef,
|
|
994
|
-
pt: ptm('message'),
|
|
995
|
-
__parentMetadata: {
|
|
996
|
-
parent: metaData
|
|
997
|
-
}
|
|
998
|
-
}), /*#__PURE__*/React.createElement("span", basicButtonProps, chooseIcon, label, input, /*#__PURE__*/React.createElement(Ripple, null)));
|
|
999
|
-
};
|
|
1000
|
-
if (props.mode === 'advanced') return createAdvanced();else if (props.mode === 'basic') return createBasic();
|
|
1001
|
-
}));
|
|
1002
|
-
FileUpload.displayName = 'FileUpload';
|
|
1003
|
-
|
|
1004
|
-
export { FileUpload };
|