primereact 10.5.1 → 10.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/api.cjs.js +94 -92
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +229 -11
- package/api/api.esm.js +94 -92
- package/api/api.esm.min.js +1 -1
- package/api/api.js +94 -92
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +89 -45
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +6 -1
- package/autocomplete/autocomplete.esm.js +89 -45
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +89 -45
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/blockui.cjs.js +13 -13
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +13 -13
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +13 -13
- package/blockui/blockui.min.js +1 -1
- package/calendar/calendar.cjs.js +30 -11
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +9 -0
- package/calendar/calendar.esm.js +30 -11
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +30 -11
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +17 -15
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +4 -2
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +17 -15
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +28 -14
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +5 -0
- package/cascadeselect/cascadeselect.esm.js +28 -14
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +28 -14
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/checkbox.cjs.js +70 -153
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +10 -34
- package/checkbox/checkbox.esm.js +70 -153
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +70 -153
- package/checkbox/checkbox.min.js +1 -1
- package/chips/chips.cjs.js +23 -9
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +6 -1
- package/chips/chips.esm.js +23 -9
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +23 -9
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +3 -2
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +2 -1
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +3 -2
- package/colorpicker/colorpicker.min.js +1 -1
- package/componentbase/componentbase.cjs.js +4 -6
- package/componentbase/componentbase.cjs.min.js +1 -1
- package/componentbase/componentbase.esm.js +5 -7
- package/componentbase/componentbase.esm.min.js +1 -1
- package/componentbase/componentbase.js +4 -6
- package/componentbase/componentbase.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +1 -0
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +1 -0
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +1 -0
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +5 -5
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +5 -5
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +5 -5
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/core/core.js +639 -603
- package/core/core.min.js +13 -13
- package/datatable/datatable.cjs.js +128 -110
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +1 -1
- package/datatable/datatable.esm.js +128 -110
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +128 -110
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +16 -13
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +4 -1
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +17 -15
- package/dataview/dataview.min.js +1 -1
- package/dialog/dialog.cjs.js +6 -6
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +6 -6
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +6 -6
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +98 -29
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +41 -0
- package/dropdown/dropdown.esm.js +98 -29
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +98 -31
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +125 -54
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +125 -54
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +125 -54
- package/editor/editor.min.js +1 -1
- package/galleria/galleria.cjs.js +22 -19
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +4 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +23 -20
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +115 -72
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +116 -73
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +115 -72
- package/hooks/hooks.min.js +1 -1
- package/image/image.cjs.js +11 -9
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +11 -9
- package/image/image.esm.min.js +1 -1
- package/image/image.js +11 -9
- package/image/image.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +20 -36
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +5 -5
- package/inputnumber/inputnumber.esm.js +20 -36
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +20 -36
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +18 -93
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.d.ts +9 -20
- package/inputswitch/inputswitch.esm.js +18 -93
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +18 -93
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +5 -3
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +5 -0
- package/inputtext/inputtext.esm.js +5 -3
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +5 -3
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +3 -1
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +5 -0
- package/inputtextarea/inputtextarea.esm.js +3 -1
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +3 -1
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -10
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +15 -0
- package/listbox/listbox.esm.js +15 -11
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +14 -10
- package/listbox/listbox.min.js +1 -1
- package/mention/mention.cjs.js +3 -1
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.esm.js +3 -1
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +3 -1
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +3 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +3 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +3 -2
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +1 -1
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +1 -1
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +2 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +1 -1
- package/message/message.esm.js +2 -8
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -8
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +1 -1
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +1 -1
- package/messages/messages.esm.js +1 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +1 -1
- package/messages/messages.min.js +1 -1
- package/metergroup/metergroup.cjs.js +237 -0
- package/metergroup/metergroup.cjs.min.js +1 -0
- package/metergroup/metergroup.d.ts +183 -0
- package/metergroup/metergroup.esm.js +233 -0
- package/metergroup/metergroup.esm.min.js +1 -0
- package/metergroup/metergroup.js +236 -0
- package/metergroup/metergroup.min.js +1 -0
- package/multiselect/multiselect.cjs.js +94 -123
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +25 -1
- package/multiselect/multiselect.esm.js +94 -123
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +94 -123
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +1 -1
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +35 -11
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +5 -0
- package/orderlist/orderlist.esm.js +35 -11
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +35 -11
- package/orderlist/orderlist.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +3 -2
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +3 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +3 -2
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +125 -108
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.d.ts +88 -0
- package/paginator/paginator.esm.js +125 -108
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +125 -108
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +13 -5
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +13 -5
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +13 -5
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/index.d.ts +12 -0
- package/passthrough/tailwind/index.cjs.js +268 -172
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +268 -172
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +268 -172
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +70 -39
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +5 -0
- package/password/password.esm.js +72 -41
- package/password/password.esm.min.js +1 -1
- package/password/password.js +70 -39
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +126 -101
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.d.ts +5 -0
- package/picklist/picklist.esm.js +126 -101
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +126 -101
- package/picklist/picklist.min.js +1 -1
- package/primereact.all.cjs.js +1774 -1431
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1775 -1431
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1774 -1431
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +67 -142
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.d.ts +17 -35
- package/radiobutton/radiobutton.esm.js +68 -143
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +67 -142
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +344 -67
- package/resources/themes/arya-green/theme.css +344 -67
- package/resources/themes/arya-orange/theme.css +344 -67
- package/resources/themes/bootstrap4-dark-blue/theme.css +389 -64
- package/resources/themes/bootstrap4-light-blue/theme.css +389 -64
- package/resources/themes/fluent-light/theme.css +341 -64
- package/resources/themes/lara-dark-amber/theme.css +470 -67
- package/resources/themes/lara-dark-blue/theme.css +470 -67
- package/resources/themes/lara-dark-cyan/theme.css +470 -67
- package/resources/themes/lara-dark-green/theme.css +470 -67
- package/resources/themes/lara-dark-indigo/theme.css +470 -67
- package/resources/themes/lara-dark-pink/theme.css +470 -67
- package/resources/themes/lara-dark-teal/theme.css +470 -67
- package/resources/themes/lara-light-amber/theme.css +470 -67
- package/resources/themes/lara-light-blue/theme.css +470 -67
- package/resources/themes/lara-light-cyan/theme.css +470 -67
- package/resources/themes/lara-light-green/theme.css +470 -67
- package/resources/themes/lara-light-indigo/theme.css +470 -67
- package/resources/themes/lara-light-pink/theme.css +470 -67
- package/resources/themes/lara-light-teal/theme.css +470 -67
- package/resources/themes/luna-amber/theme.css +344 -67
- package/resources/themes/luna-blue/theme.css +344 -67
- package/resources/themes/luna-green/theme.css +344 -67
- package/resources/themes/luna-pink/theme.css +344 -67
- package/resources/themes/md-dark-deeppurple/theme.css +995 -289
- package/resources/themes/md-dark-indigo/theme.css +684 -232
- package/resources/themes/md-light-deeppurple/theme.css +868 -162
- package/resources/themes/md-light-indigo/theme.css +566 -101
- package/resources/themes/mdc-dark-deeppurple/theme.css +995 -289
- package/resources/themes/mdc-dark-indigo/theme.css +697 -232
- package/resources/themes/mdc-light-deeppurple/theme.css +868 -162
- package/resources/themes/mdc-light-indigo/theme.css +566 -101
- package/resources/themes/mira/theme.css +344 -67
- package/resources/themes/nano/theme.css +344 -67
- package/resources/themes/nova/theme.css +344 -67
- package/resources/themes/nova-accent/theme.css +344 -67
- package/resources/themes/nova-alt/theme.css +344 -67
- package/resources/themes/rhea/theme.css +343 -66
- package/resources/themes/saga-blue/theme.css +344 -67
- package/resources/themes/saga-green/theme.css +344 -67
- package/resources/themes/saga-orange/theme.css +344 -67
- package/resources/themes/soho-dark/theme.css +413 -88
- package/resources/themes/soho-light/theme.css +392 -67
- package/resources/themes/tailwind-light/theme.css +344 -67
- package/resources/themes/vela-blue/theme.css +344 -67
- package/resources/themes/vela-green/theme.css +344 -67
- package/resources/themes/vela-orange/theme.css +344 -67
- package/resources/themes/viva-dark/theme.css +392 -67
- package/resources/themes/viva-light/theme.css +392 -67
- package/selectbutton/selectbutton.cjs.js +12 -4
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.d.ts +5 -0
- package/selectbutton/selectbutton.esm.js +12 -4
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +13 -5
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/sidebar.cjs.js +4 -3
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +4 -4
- package/sidebar/sidebar.esm.js +4 -3
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +4 -3
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +3 -2
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.esm.js +3 -2
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +3 -2
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +18 -2
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +18 -2
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +18 -2
- package/slider/slider.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +2 -2
- package/splitter/splitter.cjs.js +7 -7
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.d.ts +5 -5
- package/splitter/splitter.esm.js +7 -7
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +7 -7
- package/splitter/splitter.min.js +1 -1
- package/styleclass/styleclass.cjs.js +21 -1
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.d.ts +10 -0
- package/styleclass/styleclass.esm.js +21 -1
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +22 -2
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +1 -1
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +1 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +1 -1
- package/tabmenu/tabmenu.min.js +1 -1
- package/toast/toast.cjs.js +93 -92
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +1 -1
- package/toast/toast.esm.js +93 -92
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +93 -92
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +54 -92
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +24 -0
- package/togglebutton/togglebutton.esm.js +53 -91
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +54 -92
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.d.ts +3 -3
- package/tooltip/tooltipoptions.d.ts +5 -0
- package/tree/tree.cjs.js +20 -8
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +20 -8
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +20 -8
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +2 -0
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +5 -0
- package/treeselect/treeselect.esm.js +2 -0
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +2 -0
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +17 -14
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +17 -14
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +17 -14
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +33 -90
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.d.ts +12 -13
- package/tristatecheckbox/tristatecheckbox.esm.js +34 -91
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +33 -90
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +64 -72
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +11 -2
- package/utils/utils.esm.js +65 -72
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +64 -72
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +17 -15
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +14 -12
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +17 -15
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +455 -39
package/utils/utils.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.utils=function(e,t){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=n(t);function i(e){if(Array.isArray(e))return e}function o(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],u=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}function a(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 l(e,t){if(e){if("string"==typeof e)return a(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)?a(e,t):void 0}}function u(){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 s(e,t){return i(e)||o(e,t)||l(e,t)||u()}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 f(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t){for(var r=[],i=0;i<t.length;i++){var o=t[i];if(o){var a=c(o);if("string"===a||"number"===a)r.push(o);else if("object"===a){var l=Array.isArray(o)?o:Object.entries(o).map((function(e){var t=s(e,2);return t[1]?t[0]:null}));r=l.length?r.concat(l.filter((function(e){return!!e}))):r}}}return r.join(" ").trim()}}function d(e){if(Array.isArray(e))return a(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function v(){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 p(e){return d(e)||y(e)||l(e)||v()}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){var t=h(e,"string");return"symbol"===c(t)?t:String(t)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,m(r.key),r)}}function w(e,t,n){return t&&b(e.prototype,t),n&&b(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function k(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=O(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function O(e,t){if(e){if("string"==typeof e)return C(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)?C(e,t):void 0}}function C(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}var x=function(){function e(){g(this,e)}return w(e,null,[{key:"innerWidth",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)}return 0}},{key:"width",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),t}return 0}},{key:"getBrowserLanguage",value:function(){return navigator.userLanguage||navigator.languages&&navigator.languages.length&&navigator.languages[0]||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"en"}},{key:"getWindowScrollTop",value:function(){var e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}},{key:"getWindowScrollLeft",value:function(){var e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}},{key:"getOuterWidth",value:function(e,t){if(e){var n=e.getBoundingClientRect().width||e.offsetWidth;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}},{key:"getOuterHeight",value:function(e,t){if(e){var n=e.getBoundingClientRect().height||e.offsetHeight;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}},{key:"getClientHeight",value:function(e,t){if(e){var n=e.clientHeight;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}},{key:"getClientWidth",value:function(e,t){if(e){var n=e.clientWidth;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}},{key:"getViewport",value:function(){var e=window,t=document,n=t.documentElement,r=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||r.clientWidth,height:e.innerHeight||n.clientHeight||r.clientHeight}}},{key:"getOffset",value:function(e){if(e){var t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}},{key:"index",value:function(e){if(e)for(var t=e.parentNode.childNodes,n=0,r=0;r<t.length;r++){if(t[r]===e)return n;1===t[r].nodeType&&n++}return-1}},{key:"addMultipleClasses",value:function(e,t){if(e&&t)if(e.classList)for(var n=t.split(" "),r=0;r<n.length;r++)e.classList.add(n[r]);else for(var i=t.split(" "),o=0;o<i.length;o++)e.className+=" "+i[o]}},{key:"removeMultipleClasses",value:function(e,t){if(e&&t)if(e.classList)for(var n=t.split(" "),r=0;r<n.length;r++)e.classList.remove(n[r]);else for(var i=t.split(" "),o=0;o<i.length;o++)e.className=e.className.replace(new RegExp("(^|\\b)"+i[o].split(" ").join("|")+"(\\b|$)","gi")," ")}},{key:"addClass",value:function(e,t){e&&t&&(e.classList?e.classList.add(t):e.className+=" "+t)}},{key:"removeClass",value:function(e,t){e&&t&&(e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))}},{key:"hasClass",value:function(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}},{key:"addStyles",value:function(e){e&&Object.entries(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).forEach((function(t){var n=s(t,2);return e.style[n[0]]=n[1]}))}},{key:"find",value:function(e,t){return e?Array.from(e.querySelectorAll(t)):[]}},{key:"findSingle",value:function(e,t){return e?e.querySelector(t):null}},{key:"setAttributes",value:function(e){var t=this;if(e){var n=function t(n,r){var i,o,a=null!=e&&null!==(i=e.$attrs)&&void 0!==i&&i[n]?[null==e||null===(o=e.$attrs)||void 0===o?void 0:o[n]]:[];return[r].flat().reduce((function(e,r){if(null!=r){var i=c(r);if("string"===i||"number"===i)e.push(r);else if("object"===i){var o=Array.isArray(r)?t(n,r):Object.entries(r).map((function(e){var t=s(e,2),r=t[0],i=t[1];return"style"!==n||!i&&0!==i?i?r:void 0:"".concat(r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),":").concat(i)}));e=o.length?e.concat(o.filter((function(e){return!!e}))):e}}return e}),a)};Object.entries(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).forEach((function(r){var i=s(r,2),o=i[0],a=i[1];if(null!=a){var l=o.match(/^on(.+)/);l?e.addEventListener(l[1].toLowerCase(),a):"p-bind"===o?t.setAttributes(e,a):(a="class"===o?p(new Set(n("class",a))).join(" ").trim():"style"===o?n("style",a).join(";").trim():a,(e.$attrs=e.$attrs||{})&&(e.$attrs[o]=a),e.setAttribute(o,a))}}))}}},{key:"getAttribute",value:function(e,t){if(e){var n=e.getAttribute(t);return isNaN(n)?"true"===n||"false"===n?"true"===n:n:+n}}},{key:"isAttributeEquals",value:function(e,t,n){return!!e&&this.getAttribute(e,t)===n}},{key:"isAttributeNotEquals",value:function(e,t,n){return!this.isAttributeEquals(e,t,n)}},{key:"getHeight",value:function(e){if(e){var t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)}return 0}},{key:"getWidth",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth)}return 0}},{key:"alignOverlay",value:function(t,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t&&n&&("self"===r?this.relativePosition(t,n):(i&&(t.style.minWidth=e.getOuterWidth(n)+"px"),this.absolutePosition(t,n)))}},{key:"absolutePosition",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left";if(e&&t){var r,i,o=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),a=o.height,l=o.width,u=t.offsetHeight,s=t.offsetWidth,c=t.getBoundingClientRect(),f=this.getWindowScrollTop(),d=this.getWindowScrollLeft(),y=this.getViewport();c.top+u+a>y.height?((r=c.top+f-a)<0&&(r=f),e.style.transformOrigin="bottom"):(r=u+c.top+f,e.style.transformOrigin="top");var v=c.left,p="left"===n?0:l-s;i=v+s+l>y.width?Math.max(0,v+d+s-l):v-p+d,e.style.top=r+"px",e.style.left=i+"px"}}},{key:"relativePosition",value:function(e,t){if(e&&t){var n,r,i=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),o=t.offsetHeight,a=t.getBoundingClientRect(),l=this.getViewport();a.top+o+i.height>l.height?(a.top+(n=-1*i.height)<0&&(n=-1*a.top),e.style.transformOrigin="bottom"):(n=o,e.style.transformOrigin="top"),r=i.width>l.width?-1*a.left:a.left+i.width>l.width?-1*(a.left+i.width-l.width):0,e.style.top=n+"px",e.style.left=r+"px"}}},{key:"flipfitCollision",value:function(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left top",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left bottom",a=arguments.length>4?arguments[4]:void 0;if(t&&n){var l=n.getBoundingClientRect(),u=this.getViewport(),s=i.split(" "),c=o.split(" "),f=function(e,t){return t?+e.substring(e.search(/(\+|-)/g))||0:e.substring(0,e.search(/(\+|-)/g))||e},d={my:{x:f(s[0]),y:f(s[1]||s[0]),offsetX:f(s[0],!0),offsetY:f(s[1]||s[0],!0)},at:{x:f(c[0]),y:f(c[1]||c[0]),offsetX:f(c[0],!0),offsetY:f(c[1]||c[0],!0)}},y={left:function(){return d.my.offsetX+d.at.offsetX+l.left+("left"===d.my.x?0:-1*("center"===d.my.x?r.getOuterWidth(t)/2:r.getOuterWidth(t)))},top:function(){return d.my.offsetY+d.at.offsetY+l.top+("top"===d.my.y?0:-1*("center"===d.my.y?r.getOuterHeight(t)/2:r.getOuterHeight(t)))}},v={count:{x:0,y:0},left:function(){var n=y.left(),r=e.getWindowScrollLeft();t.style.left=n+r+"px",2===this.count.x?(t.style.left=r+"px",this.count.x=0):n<0&&(this.count.x++,d.my.x="left",d.at.x="right",d.my.offsetX*=-1,d.at.offsetX*=-1,this.right())},right:function(){var r=y.left()+e.getOuterWidth(n),i=e.getWindowScrollLeft();t.style.left=r+i+"px",2===this.count.x?(t.style.left=u.width-e.getOuterWidth(t)+i+"px",this.count.x=0):r+e.getOuterWidth(t)>u.width&&(this.count.x++,d.my.x="right",d.at.x="left",d.my.offsetX*=-1,d.at.offsetX*=-1,this.left())},top:function(){var n=y.top(),r=e.getWindowScrollTop();t.style.top=n+r+"px",2===this.count.y?(t.style.left=r+"px",this.count.y=0):n<0&&(this.count.y++,d.my.y="top",d.at.y="bottom",d.my.offsetY*=-1,d.at.offsetY*=-1,this.bottom())},bottom:function(){var r=y.top()+e.getOuterHeight(n),i=e.getWindowScrollTop();t.style.top=r+i+"px",2===this.count.y?(t.style.left=u.height-e.getOuterHeight(t)+i+"px",this.count.y=0):r+e.getOuterHeight(n)>u.height&&(this.count.y++,d.my.y="bottom",d.at.y="top",d.my.offsetY*=-1,d.at.offsetY*=-1,this.top())},center:function(r){if("y"===r){var i=y.top()+e.getOuterHeight(n)/2;t.style.top=i+e.getWindowScrollTop()+"px",i<0?this.bottom():i+e.getOuterHeight(n)>u.height&&this.top()}else{var o=y.left()+e.getOuterWidth(n)/2;t.style.left=o+e.getWindowScrollLeft()+"px",o<0?this.left():o+e.getOuterWidth(t)>u.width&&this.right()}}};v[d.at.x]("x"),v[d.at.y]("y"),this.isFunction(a)&&a(d)}}},{key:"findCollisionPosition",value:function(e){if(e){var t="left"===e?"right":"left";return"top"===e||"bottom"===e?{axis:"y",my:"center ".concat("top"===e?"bottom":"top"),at:"center ".concat(e)}:{axis:"x",my:"".concat(t," center"),at:"".concat(e," center")}}}},{key:"getParents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null===e.parentNode?t:this.getParents(e.parentNode,t.concat([e.parentNode]))}},{key:"getScrollableParents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];if(e){var r,i=this.getParents(e),o=/(auto|scroll)/,a=function(e){var t=e?getComputedStyle(e):null;return t&&(o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflowX"))||o.test(t.getPropertyValue("overflowY")))},l=function(e){n.push(t&&("BODY"===e.nodeName||"HTML"===e.nodeName||9===e.nodeType)?window:e)},u=E(i);try{for(u.s();!(r=u.n()).done;){var s=r.value,c=1===s.nodeType&&s.dataset.scrollselectors;if(c){var f,d=E(c.split(","));try{for(d.s();!(f=d.n()).done;){var y=this.findSingle(s,f.value);y&&a(y)&&l(y)}}catch(e){d.e(e)}finally{d.f()}}1===s.nodeType&&a(s)&&l(s)}}catch(e){u.e(e)}finally{u.f()}}return n.some((function(e){return e===document.body||e===window}))||n.push(window),n}},{key:"getHiddenElementOuterHeight",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetHeight;return e.style.display="none",e.style.visibility="visible",t}return 0}},{key:"getHiddenElementOuterWidth",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetWidth;return e.style.display="none",e.style.visibility="visible",t}return 0}},{key:"getHiddenElementDimensions",value:function(e){var t={};return e&&(e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible"),t}},{key:"fadeIn",value:function(e,t){if(e){e.style.opacity=0;var n=+new Date,r=0;!function i(){r=+e.style.opacity+((new Date).getTime()-n)/t,e.style.opacity=r,n=+new Date,+r<1&&(window.requestAnimationFrame&&requestAnimationFrame(i)||setTimeout(i,16))}()}}},{key:"fadeOut",value:function(e,t){if(e)var n=1,r=50/t,i=setInterval((function(){(n-=r)<=0&&(n=0,clearInterval(i)),e.style.opacity=n}),50)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isChrome",value:function(){return/(chrome)/i.test(navigator.userAgent)}},{key:"isClient",value:function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"appendChild",value:function(e,t){if(this.isElement(t))t.appendChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot append "+t+" to "+e);t.el.nativeElement.appendChild(e)}}},{key:"removeChild",value:function(e,t){if(this.isElement(t))t.removeChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot remove "+e+" from "+t);t.el.nativeElement.removeChild(e)}}},{key:"isElement",value:function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":c(HTMLElement))?e instanceof HTMLElement:e&&"object"===c(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}},{key:"scrollInView",value:function(e,t){var n=getComputedStyle(e).getPropertyValue("borderTopWidth"),r=n?parseFloat(n):0,i=getComputedStyle(e).getPropertyValue("paddingTop"),o=i?parseFloat(i):0,a=e.getBoundingClientRect(),l=t.getBoundingClientRect().top+document.body.scrollTop-(a.top+document.body.scrollTop)-r-o,u=e.scrollTop,s=e.clientHeight,c=this.getOuterHeight(t);l<0?e.scrollTop=u+l:l+c>s&&(e.scrollTop=u+l-s+c)}},{key:"clearSelection",value:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}},{key:"calculateScrollbarWidth",value:function(e){if(e){var t=getComputedStyle(e);return e.offsetWidth-e.clientWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.borderRightWidth)}if(null!=this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var n=document.createElement("div");n.className="p-scrollbar-measure",document.body.appendChild(n);var r=n.offsetWidth-n.clientWidth;return document.body.removeChild(n),this.calculatedScrollbarWidth=r,r}},{key:"calculateBodyScrollbarWidth",value:function(){return window.innerWidth-document.documentElement.offsetWidth}},{key:"getBrowser",value:function(){if(!this.browser){var e=this.resolveUserAgent();this.browser={},e.browser&&(this.browser[e.browser]=!0,this.browser.version=e.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ ]([\w.]+)/.exec(e)||/(webkit)[ ]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}}},{key:"blockBodyScroll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p-overflow-hidden";!!!document.body.style.getPropertyValue("--scrollbar-width")&&document.body.style.setProperty("--scrollbar-width",this.calculateBodyScrollbarWidth()+"px"),this.addClass(document.body,e)}},{key:"unblockBodyScroll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p-overflow-hidden";document.body.style.removeProperty("--scrollbar-width"),this.removeClass(document.body,e)}},{key:"isVisible",value:function(e){return e&&(0!==e.clientHeight||0!==e.getClientRects().length||"none"!==getComputedStyle(e).display)}},{key:"isExist",value:function(e){return!(null==e||!e.nodeName||!e.parentNode)}},{key:"getFocusableElements",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=[],o=E(e.find(t,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(r,',\n [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r)));try{for(o.s();!(n=o.n()).done;){var a=n.value;"none"!==getComputedStyle(a).display&&"hidden"!==getComputedStyle(a).visibility&&i.push(a)}}catch(e){o.e(e)}finally{o.f()}return i}},{key:"getFirstFocusableElement",value:function(t,n){var r=e.getFocusableElements(t,n);return r.length>0?r[0]:null}},{key:"getLastFocusableElement",value:function(t,n){var r=e.getFocusableElements(t,n);return r.length>0?r[r.length-1]:null}},{key:"focus",value:function(e,t){e&&document.activeElement!==e&&e.focus({preventScroll:void 0===t||!t})}},{key:"focusFirstElement",value:function(t,n){if(t){var r=e.getFirstFocusableElement(t);return r&&e.focus(r,n),r}}},{key:"getCursorOffset",value:function(e,t,n,r){if(e){var i=getComputedStyle(e),o=document.createElement("div");o.style.position="absolute",o.style.top="0px",o.style.left="0px",o.style.visibility="hidden",o.style.pointerEvents="none",o.style.overflow=i.overflow,o.style.width=i.width,o.style.height=i.height,o.style.padding=i.padding,o.style.border=i.border,o.style.overflowWrap=i.overflowWrap,o.style.whiteSpace=i.whiteSpace,o.style.lineHeight=i.lineHeight,o.innerHTML=t.replace(/\r\n|\r|\n/g,"<br />");var a=document.createElement("span");a.textContent=r,o.appendChild(a);var l=document.createTextNode(n);o.appendChild(l),document.body.appendChild(o);var u=a.offsetLeft,s=a.offsetTop,c=a.clientHeight;return document.body.removeChild(o),{left:Math.abs(u-e.scrollLeft),top:Math.abs(s-e.scrollTop)+c}}return{top:"auto",left:"auto"}}},{key:"invokeElementMethod",value:function(e,t,n){e[t].apply(e,n)}},{key:"isClickable",value:function(e){var t=e.nodeName,n=e.parentElement&&e.parentElement.nodeName;return"INPUT"===t||"TEXTAREA"===t||"BUTTON"===t||"A"===t||"INPUT"===n||"TEXTAREA"===n||"BUTTON"===n||"A"===n||this.hasClass(e,"p-button")||this.hasClass(e.parentElement,"p-button")||this.hasClass(e.parentElement,"p-checkbox")||this.hasClass(e.parentElement,"p-radiobutton")}},{key:"applyStyle",value:function(e,t){if("string"==typeof t)e.style.cssText=this.style;else for(var n in this.style)e.style[n]=t[n]}},{key:"exportCSV",value:function(t,n){var r=new Blob([t],{type:"application/csv;charset=utf-8;"});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,n+".csv"):e.saveAs({name:n+".csv",src:URL.createObjectURL(r)})||(t="data:text/csv;charset=utf-8,"+t,window.open(encodeURI(t)))}},{key:"saveAs",value:function(e){if(e){var t=document.createElement("a");if(void 0!==t.download){var n=e.name;return t.setAttribute("href",e.src),t.setAttribute("download",n),t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}}return!1}},{key:"createInlineStyle",value:function(t,n){var r=document.createElement("style");return e.addNonce(r,t),n||(n=document.head),n.appendChild(r),r}},{key:"removeInlineStyle",value:function(e){if(this.isExist(e)){try{e.parentNode.removeChild(e)}catch(e){}e=null}return e}},{key:"addNonce",value:function(e,t){try{t||(t=process.env.REACT_APP_CSS_NONCE)}catch(e){}t&&e.setAttribute("nonce",t)}},{key:"getTargetElement",value:function(e){if(!e)return null;if("document"===e)return document;if("window"===e)return window;if("object"===c(e)&&e.hasOwnProperty("current"))return this.isExist(e.current)?e.current:null;var t,n=(t=e)&&t.constructor&&t.call&&t.apply?e():e;return n&&9===n.nodeType||this.isExist(n)?n:null}},{key:"getAttributeNames",value:function(e){var t,n,r;for(n=[],r=e.attributes,t=0;t<r.length;++t)n.push(r[t].nodeName);return n.sort(),n}},{key:"isEqualElement",value:function(t,n){var r,i,o,a,l;if(r=e.getAttributeNames(t),i=e.getAttributeNames(n),r.join(",")!==i.join(","))return!1;for(var u=0;u<r.length;++u)if("style"===(o=r[u]))for(var s=t.style,c=n.style,f=/^\d+$/,d=0,y=Object.keys(s);d<y.length;d++){var v=y[d];if(!f.test(v)&&s[v]!==c[v])return!1}else if(t.getAttribute(o)!==n.getAttribute(o))return!1;for(a=t.firstChild,l=n.firstChild;a&&l;a=a.nextSibling,l=l.nextSibling){if(a.nodeType!==l.nodeType)return!1;if(1===a.nodeType){if(!e.isEqualElement(a,l))return!1}else if(a.nodeValue!==l.nodeValue)return!1}return!a&&!l}}]),e}();function S(){return S=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},S.apply(this,arguments)}function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=A(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function A(e,t){if(e){if("string"==typeof e)return P(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)?P(e,t):void 0}}function P(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}k(x,"DATA_PROPS",["data-"]),k(x,"ARIA_PROPS",["aria","focus-target"]);var T=function(){function e(){g(this,e)}return w(e,null,[{key:"equals",value:function(e,t,n){return n&&e&&"object"===c(e)&&t&&"object"===c(t)?this.deepEquals(this.resolveFieldData(e,n),this.resolveFieldData(t,n)):this.deepEquals(e,t)}},{key:"deepEquals",value:function(e,t){if(e===t)return!0;if(e&&t&&"object"==c(e)&&"object"==c(t)){var n,r,i,o=Array.isArray(e),a=Array.isArray(t);if(o&&a){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!this.deepEquals(e[n],t[n]))return!1;return!0}if(o!==a)return!1;var l=e instanceof Date,u=t instanceof Date;if(l!==u)return!1;if(l&&u)return e.getTime()===t.getTime();var s=e instanceof RegExp,f=t instanceof RegExp;if(s!==f)return!1;if(s&&f)return e.toString()===t.toString();var d=Object.keys(e);if((r=d.length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,d[n]))return!1;for(n=r;0!=n--;)if(!this.deepEquals(e[i=d[n]],t[i]))return!1;return!0}return e!=e&&t!=t}},{key:"resolveFieldData",value:function(e,t){if(!e||!t)return null;try{var n=e[t];if(this.isNotEmpty(n))return n}catch(e){}if(Object.keys(e).length){if(this.isFunction(t))return t(e);if(this.isNotEmpty(e[t]))return e[t];if(-1===t.indexOf("."))return e[t];for(var r=t.split("."),i=e,o=0,a=r.length;o<a;++o){if(null==i)return null;i=i[r[o]]}return i}return null}},{key:"findDiffKeys",value:function(e,t){return e&&t?Object.keys(e).filter((function(e){return!t.hasOwnProperty(e)})).reduce((function(t,n){return t[n]=e[n],t}),{}):{}}},{key:"reduceKeys",value:function(e,t){var n={};return e&&t&&0!==t.length?(Object.keys(e).filter((function(e){return t.some((function(t){return e.startsWith(t)}))})).forEach((function(t){n[t]=e[t],delete e[t]})),n):n}},{key:"reorderArray",value:function(e,t,n){e&&t!==n&&(n>=e.length&&(n%=e.length,t%=e.length),e.splice(n,0,e.splice(t,1)[0]))}},{key:"findIndexInList",value:function(e,t,n){var r=this;return t?t.findIndex(n?function(t){return r.equals(t,e,n)}:function(t){return t===e}):-1}},{key:"getJSXElement",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.isFunction(e)?e.apply(void 0,n):e}},{key:"getItemValue",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.isFunction(e)?e.apply(void 0,n):e}},{key:"getProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e?e[t]:void 0;return void 0===n?(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})[t]:n}},{key:"getPropCaseInsensitive",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.toFlatCase(t);for(var i in e)if(e.hasOwnProperty(i)&&this.toFlatCase(i)===r)return e[i];for(var o in n)if(n.hasOwnProperty(o)&&this.toFlatCase(o)===r)return n[o]}},{key:"getMergedProps",value:function(e,t){return Object.assign({},t,e)}},{key:"getDiffProps",value:function(e,t){return this.findDiffKeys(e,t)}},{key:"getPropValue",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.isFunction(e)?e.apply(void 0,n):e}},{key:"getComponentProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.isNotEmpty(e)?this.getProp(e.props,t,n):void 0}},{key:"getComponentProps",value:function(e,t){return this.isNotEmpty(e)?this.getMergedProps(e.props,t):void 0}},{key:"getComponentDiffProps",value:function(e,t){return this.isNotEmpty(e)?this.getDiffProps(e.props,t):void 0}},{key:"isValidChild",value:function(e,t,n){if(e){var r,i=this.getComponentProp(e,"__TYPE")||(e.type?e.type.displayName:void 0);!i&&null!=e&&null!==(r=e.type)&&void 0!==r&&null!==(r=r._payload)&&void 0!==r&&r.value&&(i=e.type._payload.value.find((function(e){return e===t})));var o=i===t;try{0}catch(e){}return o}return!1}},{key:"getRefElement",value:function(e){return e?"object"===c(e)&&e.hasOwnProperty("current")?e.current:e:null}},{key:"combinedRefs",value:function(e,t){e&&t&&("function"==typeof t?t(e.current):t.current=e.current)}},{key:"removeAccents",value:function(e){return e&&e.search(/[\xC0-\xFF]/g)>-1&&(e=e.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),e}},{key:"toFlatCase",value:function(e){return this.isNotEmpty(e)&&this.isString(e)?e.replace(/(-|_)/g,"").toLowerCase():e}},{key:"toCapitalCase",value:function(e){return this.isNotEmpty(e)&&this.isString(e)?e[0].toUpperCase()+e.slice(1):e}},{key:"trim",value:function(e){return this.isNotEmpty(e)&&this.isString(e)?e.trim():e}},{key:"isEmpty",value:function(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"===c(e)&&0===Object.keys(e).length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"isObject",value:function(e){return null!==e&&e instanceof Object&&e.constructor===Object}},{key:"isDate",value:function(e){return null!==e&&e instanceof Date&&e.constructor===Date}},{key:"isArray",value:function(e){return null!==e&&Array.isArray(e)}},{key:"isString",value:function(e){return null!==e&&"string"==typeof e}},{key:"isPrintableCharacter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.isNotEmpty(e)&&1===e.length&&e.match(/\S| /)}},{key:"isLetter",value:function(e){return/^[a-zA-Z\u00C0-\u017F]$/.test(e)}},{key:"findLast",value:function(e,t){var n;if(this.isNotEmpty(e))try{n=e.findLast(t)}catch(r){n=p(e).reverse().find(t)}return n}},{key:"findLastIndex",value:function(e,t){var n=-1;if(this.isNotEmpty(e))try{n=e.findLastIndex(t)}catch(r){n=e.lastIndexOf(p(e).reverse().find(t))}return n}},{key:"sort",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=this.compare(e,t,arguments.length>3?arguments[3]:void 0,n),o=n;return(this.isEmpty(e)||this.isEmpty(t))&&(o=1===r?n:r),o*i}},{key:"compare",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=this.isEmpty(e),o=this.isEmpty(t);return i&&o?0:i?r:o?-r:"string"==typeof e&&"string"==typeof t?n(e,t):e<t?-1:e>t?1:0}},{key:"localeComparator",value:function(e){return new Intl.Collator(e,{numeric:!0}).compare}},{key:"findChildrenByKey",value:function(e,t){var n,r=j(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.key===t)return i.children||[];if(i.children){var o=this.findChildrenByKey(i.children,t);if(o.length>0)return o}}}catch(e){r.e(e)}finally{r.f()}return[]}},{key:"mutateFieldData",value:function(e,t,n){if("object"===c(e)&&"string"==typeof t)for(var r=t.split("."),i=e,o=0,a=r.length;o<a;++o){if(o+1-a==0){i[r[o]]=n;break}i[r[o]]||(i[r[o]]={}),i=i[r[o]]}}}]),e}();function F(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var L=function(){function e(){g(this,e)}return w(e,null,[{key:"getJSXIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null;if(null!==e){var o=c(e),a=f(t.className,"string"===o&&e);if(i=r.createElement("span",S({},t,{className:a})),"string"!==o){var l=N({iconProps:t,element:i},n);return T.getJSXElement(e,l)}}return i}}]),e}();function W(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 D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(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 I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var H=0;var B,M,U,V,_=(B=[],M=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,r=V(e,t,n),i=r.value+(r.key===e?0:n)+1;return B.push({key:e,value:i}),i},U=function(e,t){return V(e,t).value},V=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return p(B).reverse().find((function(n){return!!t||n.key===e}))||{key:e,value:n}},{get:function(e){return e&&parseInt(e.style.zIndex,10)||0},set:function(e,t,n,r){t&&(t.style.zIndex=String(M(e,n,r)))},clear:function(e){var t;e&&(t=_.get(e),B=B.filter((function(e){return e.value!==t})),e.style.zIndex="")},getCurrent:function(e,t){return U(e,t)}});return e.DomHandler=x,e.EventBus=function(){var e=new Map;return{on:function(t,n){var r=e.get(t);r?r.push(n):r=[n],e.set(t,r)},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){var r=e.get(t);r&&r.slice().forEach((function(e){return e(n)}))}}},e.IconUtils=L,e.ObjectUtils=T,e.UniqueComponentId=function(){return H++,"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pr_id_").concat(H)},e.ZIndexUtils=_,e._mergeProps=function(e){if(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).classNameMergeFunction;return e.reduce((function(e,n){var r=function(){var r,o=n[i];if("style"===i)e.style=I(I({},e.style),n.style);else if("className"===i){var a="";a=t&&t instanceof Function?t(e.className,n.className):[e.className,n.className].join(" ").trim(),e.className=null==a||""===a?void 0:a}else if((r=o)&&r.constructor&&r.call&&r.apply){var l=e[i];e[i]=l?function(){l.apply(void 0,arguments),o.apply(void 0,arguments)}:o}else e[i]=o};for(var i in n)r();return e}),{})}},e.classNames=f,e.mask=function(e,t){var n,r,i,o,a,l,u,s,c,f,d,y;t=D(D({},{mask:null,slotChar:"_",autoClear:!0,unmask:!1,readOnly:!1,onComplete:null,onChange:null,onFocus:null,onBlur:null}),t);var v=function(t,n){var r,i,o;if(e.offsetParent&&e===document.activeElement)return"number"!=typeof t?(e.setSelectionRange?(i=e.selectionStart,o=e.selectionEnd):document.selection&&document.selection.createRange&&(o=(i=0-(r=document.selection.createRange()).duplicate().moveStart("character",-1e5))+r.text.length),{begin:i,end:o}):(i=t,o="number"==typeof n?n:i,void(e.setSelectionRange?e.setSelectionRange(i,o):e.createTextRange&&((r=e.createTextRange()).collapse(!0),r.moveEnd("character",o),r.moveStart("character",i),r.select())))},p=function(){for(var e=o;e<=u;e++)if(n[e]&&d[e]===g(e))return!1;return!0},g=function(e){return t.slotChar.charAt(e<t.slotChar.length?e:0)},h=function(){return t.unmask?L():e&&e.value},m=function(e){for(;++e<i&&!n[e];);return e},b=function(e){for(;--e>=0&&!n[e];);return e},w=function(e,t){var r,a;if(!(e<0)){for(r=e,a=m(t);r<i;r++)if(n[r]){if(!(a<i&&n[r].test(d[a])))break;d[r]=d[a],d[a]=g(a),a=m(a)}A(),v(Math.max(o,e))}},k=function(e){var t,r,o,a;for(t=e,r=g(e);t<i;t++)if(n[t]){if(o=m(t),a=d[t],d[t]=r,!(o<i&&n[o].test(a)))break;r=a}},E=function(r){var a=e.value,l=v();if(s&&s.length&&s.length>a.length){for(P(!0);l.begin>0&&!n[l.begin-1];)l.begin--;if(0===l.begin)for(;l.begin<o&&!n[l.begin];)l.begin++;v(l.begin,l.begin)}else{for(P(!0);l.begin<i&&!n[l.begin];)l.begin++;v(l.begin,l.begin)}t.onComplete&&p()&&t.onComplete({originalEvent:r,value:h()})},O=function(n){if(P(),t.onBlur&&t.onBlur(n),W(n),e.value!==c){var r=document.createEvent("HTMLEvents");r.initEvent("change",!0,!1),e.dispatchEvent(r)}},C=function(n){if(!t.readOnly){var r,i,o,a=n.which||n.keyCode;s=e.value,8===a||46===a||x.isIOS()&&127===a?((o=(r=v()).end)-(i=r.begin)==0&&(i=46!==a?b(i):o=m(i-1),o=46===a?m(o):o),j(i,o),w(i,o-1),W(n),n.preventDefault()):13===a?(O(n),W(n)):27===a&&(e.value=c,v(0,P()),W(n),n.preventDefault())}},S=function(e){if(!t.readOnly){var r,o,a,l,s=e.which||e.keyCode,c=v();if(!(e.ctrlKey||e.altKey||e.metaKey||s<32)){if(s&&13!==s){if(c.end-c.begin!=0&&(j(c.begin,c.end),w(c.begin,c.end-1)),(r=m(c.begin-1))<i&&(o=String.fromCharCode(s),n[r].test(o))){if(k(r),d[r]=o,A(),a=m(r),x.isAndroid()){setTimeout((function(){v(a)}),0)}else v(a);c.begin<=u&&(l=p())}e.preventDefault()}W(e),t.onComplete&&l&&t.onComplete({originalEvent:e,value:h()})}}},j=function(e,t){var r;for(r=e;r<t&&r<i;r++)n[r]&&(d[r]=g(r))},A=function(){e.value=d.join("")},P=function(a){var l,u,s,c=e.value,f=-1;for(l=0,s=0;l<i;l++)if(n[l]){for(d[l]=g(l);s++<c.length;)if(u=c.charAt(s-1),n[l].test(u)){d[l]=u,f=l;break}if(s>c.length){j(l+1,i);break}}else d[l]===c.charAt(s)&&s++,l<r&&(f=l);return a?A():f+1<r?t.autoClear||d.join("")===y?(e.value&&(e.value=""),j(0,i)):A():(A(),e.value=e.value.substring(0,f+1)),r?l:o},T=function(n){var r;t.readOnly||(clearTimeout(f),c=e.value,r=P(),f=setTimeout((function(){e===document.activeElement&&(A(),r===t.mask.replace("?","").length?v(0,r):v(r))}),100),t.onFocus&&t.onFocus(n))},F=function(e){l?E(e):N(e)},N=function(e){if(!t.readOnly){var n=P(!0);v(n),W(e),t.onComplete&&p()&&t.onComplete({originalEvent:e,value:h()})}},L=function(){for(var e=[],t=0;t<d.length;t++){var r=d[t];n[t]&&r!==g(t)&&e.push(r)}return e.join("")},W=function(e){if(t.onChange){var n=h();t.onChange({originalEvent:e,value:y!==n?n:"",stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{value:y!==n?n:""}})}},R=function(){e.addEventListener("focus",T),e.addEventListener("blur",O),e.addEventListener("keydown",C),e.addEventListener("keypress",S),e.addEventListener("input",F),e.addEventListener("paste",N)},I=function(){n=[],r=t.mask.length,i=t.mask.length,o=null,a={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},l=x.isChrome()&&x.isAndroid();for(var e=t.mask.split(""),s=0;s<e.length;s++){var c=e[s];"?"===c?(i--,r=s):a[c]?(n.push(new RegExp(a[c])),null===o&&(o=n.length-1),s<r&&(u=n.length-1)):n.push(null)}d=[];for(var f=0;f<e.length;f++){var v=e[f];"?"!==v&&d.push(a[v]?g(f):v)}y=d.join("")};return e&&t.mask&&(I(),R()),{init:I,bindEvents:R,unbindEvents:function(){e.removeEventListener("focus",T),e.removeEventListener("blur",O),e.removeEventListener("keydown",C),e.removeEventListener("keypress",S),e.removeEventListener("input",F),e.removeEventListener("paste",N)},updateModel:W,getValue:h}},e.mergeProps=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t){return t.reduce((function(e,t){var n=function(){var n,i=t[r];if("style"===r)e.style=I(I({},e.style),t.style);else if("className"===r)e.className=[e.className,t.className].join(" ").trim();else if((n=i)&&n.constructor&&n.call&&n.apply){var o=e[r];e[r]=o?function(){o.apply(void 0,arguments),i.apply(void 0,arguments)}:i}else e[r]=i};for(var r in t)n();return e}),{})}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.utils=function(e,t){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=n(t);function i(e){if(Array.isArray(e))return e}function o(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],u=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}function a(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 l(e,t){if(e){if("string"==typeof e)return a(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)?a(e,t):void 0}}function u(){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 s(e,t){return i(e)||o(e,t)||l(e,t)||u()}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 f(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t){for(var r=[],i=0;i<t.length;i++){var o=t[i];if(o){var a=c(o);if("string"===a||"number"===a)r.push(o);else if("object"===a){var l=Array.isArray(o)?o:Object.entries(o).map((function(e){var t=s(e,2);return t[1]?t[0]:null}));r=l.length?r.concat(l.filter((function(e){return!!e}))):r}}}return r.join(" ").trim()}}function d(e){if(Array.isArray(e))return a(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function v(){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 p(e){return d(e)||y(e)||l(e)||v()}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){var t=h(e,"string");return"symbol"===c(t)?t:String(t)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,m(r.key),r)}}function w(e,t,n){return t&&b(e.prototype,t),n&&b(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function k(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=O(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function O(e,t){if(e){if("string"==typeof e)return C(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)?C(e,t):void 0}}function C(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}var x=function(){function e(){g(this,e)}return w(e,null,[{key:"innerWidth",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)}return 0}},{key:"width",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),t}return 0}},{key:"getBrowserLanguage",value:function(){return navigator.userLanguage||navigator.languages&&navigator.languages.length&&navigator.languages[0]||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"en"}},{key:"getWindowScrollTop",value:function(){var e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}},{key:"getWindowScrollLeft",value:function(){var e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}},{key:"getOuterWidth",value:function(e,t){if(e){var n=e.getBoundingClientRect().width||e.offsetWidth;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}},{key:"getOuterHeight",value:function(e,t){if(e){var n=e.getBoundingClientRect().height||e.offsetHeight;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}},{key:"getClientHeight",value:function(e,t){if(e){var n=e.clientHeight;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}},{key:"getClientWidth",value:function(e,t){if(e){var n=e.clientWidth;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}},{key:"getViewport",value:function(){var e=window,t=document,n=t.documentElement,r=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||r.clientWidth,height:e.innerHeight||n.clientHeight||r.clientHeight}}},{key:"getOffset",value:function(e){if(e){var t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}},{key:"index",value:function(e){if(e)for(var t=e.parentNode.childNodes,n=0,r=0;r<t.length;r++){if(t[r]===e)return n;1===t[r].nodeType&&n++}return-1}},{key:"addMultipleClasses",value:function(e,t){if(e&&t)if(e.classList)for(var n=t.split(" "),r=0;r<n.length;r++)e.classList.add(n[r]);else for(var i=t.split(" "),o=0;o<i.length;o++)e.className+=" "+i[o]}},{key:"removeMultipleClasses",value:function(e,t){if(e&&t)if(e.classList)for(var n=t.split(" "),r=0;r<n.length;r++)e.classList.remove(n[r]);else for(var i=t.split(" "),o=0;o<i.length;o++)e.className=e.className.replace(new RegExp("(^|\\b)"+i[o].split(" ").join("|")+"(\\b|$)","gi")," ")}},{key:"addClass",value:function(e,t){e&&t&&(e.classList?e.classList.add(t):e.className+=" "+t)}},{key:"removeClass",value:function(e,t){e&&t&&(e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))}},{key:"hasClass",value:function(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}},{key:"addStyles",value:function(e){e&&Object.entries(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).forEach((function(t){var n=s(t,2);return e.style[n[0]]=n[1]}))}},{key:"find",value:function(e,t){return e?Array.from(e.querySelectorAll(t)):[]}},{key:"findSingle",value:function(e,t){return e?e.querySelector(t):null}},{key:"setAttributes",value:function(e){var t=this;if(e){var n=function t(n,r){var i,o,a=null!=e&&null!==(i=e.$attrs)&&void 0!==i&&i[n]?[null==e||null===(o=e.$attrs)||void 0===o?void 0:o[n]]:[];return[r].flat().reduce((function(e,r){if(null!=r){var i=c(r);if("string"===i||"number"===i)e.push(r);else if("object"===i){var o=Array.isArray(r)?t(n,r):Object.entries(r).map((function(e){var t=s(e,2),r=t[0],i=t[1];return"style"!==n||!i&&0!==i?i?r:void 0:"".concat(r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),":").concat(i)}));e=o.length?e.concat(o.filter((function(e){return!!e}))):e}}return e}),a)};Object.entries(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).forEach((function(r){var i=s(r,2),o=i[0],a=i[1];if(null!=a){var l=o.match(/^on(.+)/);l?e.addEventListener(l[1].toLowerCase(),a):"p-bind"===o?t.setAttributes(e,a):(a="class"===o?p(new Set(n("class",a))).join(" ").trim():"style"===o?n("style",a).join(";").trim():a,(e.$attrs=e.$attrs||{})&&(e.$attrs[o]=a),e.setAttribute(o,a))}}))}}},{key:"getAttribute",value:function(e,t){if(e){var n=e.getAttribute(t);return isNaN(n)?"true"===n||"false"===n?"true"===n:n:+n}}},{key:"isAttributeEquals",value:function(e,t,n){return!!e&&this.getAttribute(e,t)===n}},{key:"isAttributeNotEquals",value:function(e,t,n){return!this.isAttributeEquals(e,t,n)}},{key:"getHeight",value:function(e){if(e){var t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)}return 0}},{key:"getWidth",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth)}return 0}},{key:"alignOverlay",value:function(t,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t&&n&&("self"===r?this.relativePosition(t,n):(i&&(t.style.minWidth=e.getOuterWidth(n)+"px"),this.absolutePosition(t,n)))}},{key:"absolutePosition",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left";if(e&&t){var r,i,o=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),a=o.height,l=o.width,u=t.offsetHeight,s=t.offsetWidth,c=t.getBoundingClientRect(),f=this.getWindowScrollTop(),d=this.getWindowScrollLeft(),y=this.getViewport();c.top+u+a>y.height?((r=c.top+f-a)<0&&(r=f),e.style.transformOrigin="bottom"):(r=u+c.top+f,e.style.transformOrigin="top");var v=c.left,p="left"===n?0:l-s;i=v+s+l>y.width?Math.max(0,v+d+s-l):v-p+d,e.style.top=r+"px",e.style.left=i+"px"}}},{key:"relativePosition",value:function(e,t){if(e&&t){var n,r,i=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),o=t.offsetHeight,a=t.getBoundingClientRect(),l=this.getViewport();a.top+o+i.height>l.height?(a.top+(n=-1*i.height)<0&&(n=-1*a.top),e.style.transformOrigin="bottom"):(n=o,e.style.transformOrigin="top"),r=i.width>l.width?-1*a.left:a.left+i.width>l.width?-1*(a.left+i.width-l.width):0,e.style.top=n+"px",e.style.left=r+"px"}}},{key:"flipfitCollision",value:function(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left top",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left bottom",a=arguments.length>4?arguments[4]:void 0;if(t&&n){var l=n.getBoundingClientRect(),u=this.getViewport(),s=i.split(" "),c=o.split(" "),f=function(e,t){return t?+e.substring(e.search(/(\+|-)/g))||0:e.substring(0,e.search(/(\+|-)/g))||e},d={my:{x:f(s[0]),y:f(s[1]||s[0]),offsetX:f(s[0],!0),offsetY:f(s[1]||s[0],!0)},at:{x:f(c[0]),y:f(c[1]||c[0]),offsetX:f(c[0],!0),offsetY:f(c[1]||c[0],!0)}},y={left:function(){return d.my.offsetX+d.at.offsetX+l.left+("left"===d.my.x?0:-1*("center"===d.my.x?r.getOuterWidth(t)/2:r.getOuterWidth(t)))},top:function(){return d.my.offsetY+d.at.offsetY+l.top+("top"===d.my.y?0:-1*("center"===d.my.y?r.getOuterHeight(t)/2:r.getOuterHeight(t)))}},v={count:{x:0,y:0},left:function(){var n=y.left(),r=e.getWindowScrollLeft();t.style.left=n+r+"px",2===this.count.x?(t.style.left=r+"px",this.count.x=0):n<0&&(this.count.x++,d.my.x="left",d.at.x="right",d.my.offsetX*=-1,d.at.offsetX*=-1,this.right())},right:function(){var r=y.left()+e.getOuterWidth(n),i=e.getWindowScrollLeft();t.style.left=r+i+"px",2===this.count.x?(t.style.left=u.width-e.getOuterWidth(t)+i+"px",this.count.x=0):r+e.getOuterWidth(t)>u.width&&(this.count.x++,d.my.x="right",d.at.x="left",d.my.offsetX*=-1,d.at.offsetX*=-1,this.left())},top:function(){var n=y.top(),r=e.getWindowScrollTop();t.style.top=n+r+"px",2===this.count.y?(t.style.left=r+"px",this.count.y=0):n<0&&(this.count.y++,d.my.y="top",d.at.y="bottom",d.my.offsetY*=-1,d.at.offsetY*=-1,this.bottom())},bottom:function(){var r=y.top()+e.getOuterHeight(n),i=e.getWindowScrollTop();t.style.top=r+i+"px",2===this.count.y?(t.style.left=u.height-e.getOuterHeight(t)+i+"px",this.count.y=0):r+e.getOuterHeight(n)>u.height&&(this.count.y++,d.my.y="bottom",d.at.y="top",d.my.offsetY*=-1,d.at.offsetY*=-1,this.top())},center:function(r){if("y"===r){var i=y.top()+e.getOuterHeight(n)/2;t.style.top=i+e.getWindowScrollTop()+"px",i<0?this.bottom():i+e.getOuterHeight(n)>u.height&&this.top()}else{var o=y.left()+e.getOuterWidth(n)/2;t.style.left=o+e.getWindowScrollLeft()+"px",o<0?this.left():o+e.getOuterWidth(t)>u.width&&this.right()}}};v[d.at.x]("x"),v[d.at.y]("y"),this.isFunction(a)&&a(d)}}},{key:"findCollisionPosition",value:function(e){if(e){var t="left"===e?"right":"left";return"top"===e||"bottom"===e?{axis:"y",my:"center ".concat("top"===e?"bottom":"top"),at:"center ".concat(e)}:{axis:"x",my:"".concat(t," center"),at:"".concat(e," center")}}}},{key:"getParents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null===e.parentNode?t:this.getParents(e.parentNode,t.concat([e.parentNode]))}},{key:"getScrollableParents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];if(e){var r,i=this.getParents(e),o=/(auto|scroll)/,a=function(e){var t=e?getComputedStyle(e):null;return t&&(o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflow-x"))||o.test(t.getPropertyValue("overflow-y")))},l=function(e){n.push(t&&("BODY"===e.nodeName||"HTML"===e.nodeName||9===e.nodeType)?window:e)},u=E(i);try{for(u.s();!(r=u.n()).done;){var s=r.value,c=1===s.nodeType&&s.dataset.scrollselectors;if(c){var f,d=E(c.split(","));try{for(d.s();!(f=d.n()).done;){var y=this.findSingle(s,f.value);y&&a(y)&&l(y)}}catch(e){d.e(e)}finally{d.f()}}1===s.nodeType&&a(s)&&l(s)}}catch(e){u.e(e)}finally{u.f()}}return n.some((function(e){return e===document.body||e===window}))||n.push(window),n}},{key:"getHiddenElementOuterHeight",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetHeight;return e.style.display="none",e.style.visibility="visible",t}return 0}},{key:"getHiddenElementOuterWidth",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetWidth;return e.style.display="none",e.style.visibility="visible",t}return 0}},{key:"getHiddenElementDimensions",value:function(e){var t={};return e&&(e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible"),t}},{key:"fadeIn",value:function(e,t){if(e){e.style.opacity=0;var n=+new Date,r=0;!function i(){r=+e.style.opacity+((new Date).getTime()-n)/t,e.style.opacity=r,n=+new Date,+r<1&&(window.requestAnimationFrame&&requestAnimationFrame(i)||setTimeout(i,16))}()}}},{key:"fadeOut",value:function(e,t){if(e)var n=1,r=50/t,i=setInterval((function(){(n-=r)<=0&&(n=0,clearInterval(i)),e.style.opacity=n}),50)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isChrome",value:function(){return/(chrome)/i.test(navigator.userAgent)}},{key:"isClient",value:function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"appendChild",value:function(e,t){if(this.isElement(t))t.appendChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot append "+t+" to "+e);t.el.nativeElement.appendChild(e)}}},{key:"removeChild",value:function(e,t){if(this.isElement(t))t.removeChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot remove "+e+" from "+t);t.el.nativeElement.removeChild(e)}}},{key:"isElement",value:function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":c(HTMLElement))?e instanceof HTMLElement:e&&"object"===c(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}},{key:"scrollInView",value:function(e,t){var n=getComputedStyle(e).getPropertyValue("border-top-width"),r=n?parseFloat(n):0,i=getComputedStyle(e).getPropertyValue("padding-top"),o=i?parseFloat(i):0,a=e.getBoundingClientRect(),l=t.getBoundingClientRect().top+document.body.scrollTop-(a.top+document.body.scrollTop)-r-o,u=e.scrollTop,s=e.clientHeight,c=this.getOuterHeight(t);l<0?e.scrollTop=u+l:l+c>s&&(e.scrollTop=u+l-s+c)}},{key:"clearSelection",value:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}},{key:"calculateScrollbarWidth",value:function(e){if(e){var t=getComputedStyle(e);return e.offsetWidth-e.clientWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.borderRightWidth)}if(null!=this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var n=document.createElement("div");n.className="p-scrollbar-measure",document.body.appendChild(n);var r=n.offsetWidth-n.clientWidth;return document.body.removeChild(n),this.calculatedScrollbarWidth=r,r}},{key:"calculateBodyScrollbarWidth",value:function(){return window.innerWidth-document.documentElement.offsetWidth}},{key:"getBrowser",value:function(){if(!this.browser){var e=this.resolveUserAgent();this.browser={},e.browser&&(this.browser[e.browser]=!0,this.browser.version=e.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ ]([\w.]+)/.exec(e)||/(webkit)[ ]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}}},{key:"blockBodyScroll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p-overflow-hidden";!!!document.body.style.getPropertyValue("--scrollbar-width")&&document.body.style.setProperty("--scrollbar-width",this.calculateBodyScrollbarWidth()+"px"),this.addClass(document.body,e)}},{key:"unblockBodyScroll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p-overflow-hidden";document.body.style.removeProperty("--scrollbar-width"),this.removeClass(document.body,e)}},{key:"isVisible",value:function(e){return e&&(0!==e.clientHeight||0!==e.getClientRects().length||"none"!==getComputedStyle(e).display)}},{key:"isExist",value:function(e){return!(null==e||!e.nodeName||!e.parentNode)}},{key:"getFocusableElements",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=[],o=E(e.find(t,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(r,',\n [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r)));try{for(o.s();!(n=o.n()).done;){var a=n.value;"none"!==getComputedStyle(a).display&&"hidden"!==getComputedStyle(a).visibility&&i.push(a)}}catch(e){o.e(e)}finally{o.f()}return i}},{key:"getFirstFocusableElement",value:function(t,n){var r=e.getFocusableElements(t,n);return r.length>0?r[0]:null}},{key:"getLastFocusableElement",value:function(t,n){var r=e.getFocusableElements(t,n);return r.length>0?r[r.length-1]:null}},{key:"focus",value:function(e,t){e&&document.activeElement!==e&&e.focus({preventScroll:void 0===t||!t})}},{key:"focusFirstElement",value:function(t,n){if(t){var r=e.getFirstFocusableElement(t);return r&&e.focus(r,n),r}}},{key:"getCursorOffset",value:function(e,t,n,r){if(e){var i=getComputedStyle(e),o=document.createElement("div");o.style.position="absolute",o.style.top="0px",o.style.left="0px",o.style.visibility="hidden",o.style.pointerEvents="none",o.style.overflow=i.overflow,o.style.width=i.width,o.style.height=i.height,o.style.padding=i.padding,o.style.border=i.border,o.style.overflowWrap=i.overflowWrap,o.style.whiteSpace=i.whiteSpace,o.style.lineHeight=i.lineHeight,o.innerHTML=t.replace(/\r\n|\r|\n/g,"<br />");var a=document.createElement("span");a.textContent=r,o.appendChild(a);var l=document.createTextNode(n);o.appendChild(l),document.body.appendChild(o);var u=a.offsetLeft,s=a.offsetTop,c=a.clientHeight;return document.body.removeChild(o),{left:Math.abs(u-e.scrollLeft),top:Math.abs(s-e.scrollTop)+c}}return{top:"auto",left:"auto"}}},{key:"invokeElementMethod",value:function(e,t,n){e[t].apply(e,n)}},{key:"isClickable",value:function(e){var t=e.nodeName,n=e.parentElement&&e.parentElement.nodeName;return"INPUT"===t||"TEXTAREA"===t||"BUTTON"===t||"A"===t||"INPUT"===n||"TEXTAREA"===n||"BUTTON"===n||"A"===n||this.hasClass(e,"p-button")||this.hasClass(e.parentElement,"p-button")||this.hasClass(e.parentElement,"p-checkbox")||this.hasClass(e.parentElement,"p-radiobutton")}},{key:"applyStyle",value:function(e,t){if("string"==typeof t)e.style.cssText=this.style;else for(var n in this.style)e.style[n]=t[n]}},{key:"exportCSV",value:function(t,n){var r=new Blob([t],{type:"application/csv;charset=utf-8;"});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,n+".csv"):e.saveAs({name:n+".csv",src:URL.createObjectURL(r)})||(t="data:text/csv;charset=utf-8,"+t,window.open(encodeURI(t)))}},{key:"saveAs",value:function(e){if(e){var t=document.createElement("a");if(void 0!==t.download){var n=e.name;return t.setAttribute("href",e.src),t.setAttribute("download",n),t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}}return!1}},{key:"createInlineStyle",value:function(t,n){var r=document.createElement("style");return e.addNonce(r,t),n||(n=document.head),n.appendChild(r),r}},{key:"removeInlineStyle",value:function(e){if(this.isExist(e)){try{e.parentNode.removeChild(e)}catch(e){}e=null}return e}},{key:"addNonce",value:function(e,t){try{t||(t=process.env.REACT_APP_CSS_NONCE)}catch(e){}t&&e.setAttribute("nonce",t)}},{key:"getTargetElement",value:function(e){if(!e)return null;if("document"===e)return document;if("window"===e)return window;if("object"===c(e)&&e.hasOwnProperty("current"))return this.isExist(e.current)?e.current:null;var t,n=(t=e)&&t.constructor&&t.call&&t.apply?e():e;return n&&9===n.nodeType||this.isExist(n)?n:null}},{key:"getAttributeNames",value:function(e){var t,n,r;for(n=[],r=e.attributes,t=0;t<r.length;++t)n.push(r[t].nodeName);return n.sort(),n}},{key:"isEqualElement",value:function(t,n){var r,i,o,a,l;if(r=e.getAttributeNames(t),i=e.getAttributeNames(n),r.join(",")!==i.join(","))return!1;for(var u=0;u<r.length;++u)if("style"===(o=r[u]))for(var s=t.style,c=n.style,f=/^\d+$/,d=0,y=Object.keys(s);d<y.length;d++){var v=y[d];if(!f.test(v)&&s[v]!==c[v])return!1}else if(t.getAttribute(o)!==n.getAttribute(o))return!1;for(a=t.firstChild,l=n.firstChild;a&&l;a=a.nextSibling,l=l.nextSibling){if(a.nodeType!==l.nodeType)return!1;if(1===a.nodeType){if(!e.isEqualElement(a,l))return!1}else if(a.nodeValue!==l.nodeValue)return!1}return!a&&!l}},{key:"hasCSSAnimation",value:function(e){if(e){var t=getComputedStyle(e);return parseFloat(t.getPropertyValue("animation-duration")||"0")>0}return!1}},{key:"hasCSSTransition",value:function(e){if(e){var t=getComputedStyle(e);return parseFloat(t.getPropertyValue("transition-duration")||"0")>0}return!1}}]),e}();function S(){return S=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},S.apply(this,arguments)}function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=A(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function A(e,t){if(e){if("string"==typeof e)return P(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)?P(e,t):void 0}}function P(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}k(x,"DATA_PROPS",["data-"]),k(x,"ARIA_PROPS",["aria","focus-target"]);var F=function(){function e(){g(this,e)}return w(e,null,[{key:"equals",value:function(e,t,n){return n&&e&&"object"===c(e)&&t&&"object"===c(t)?this.deepEquals(this.resolveFieldData(e,n),this.resolveFieldData(t,n)):this.deepEquals(e,t)}},{key:"deepEquals",value:function(e,t){if(e===t)return!0;if(e&&t&&"object"==c(e)&&"object"==c(t)){var n,r,i,o=Array.isArray(e),a=Array.isArray(t);if(o&&a){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!this.deepEquals(e[n],t[n]))return!1;return!0}if(o!==a)return!1;var l=e instanceof Date,u=t instanceof Date;if(l!==u)return!1;if(l&&u)return e.getTime()===t.getTime();var s=e instanceof RegExp,f=t instanceof RegExp;if(s!==f)return!1;if(s&&f)return e.toString()===t.toString();var d=Object.keys(e);if((r=d.length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,d[n]))return!1;for(n=r;0!=n--;)if(!this.deepEquals(e[i=d[n]],t[i]))return!1;return!0}return e!=e&&t!=t}},{key:"resolveFieldData",value:function(e,t){if(!e||!t)return null;try{var n=e[t];if(this.isNotEmpty(n))return n}catch(e){}if(Object.keys(e).length){if(this.isFunction(t))return t(e);if(this.isNotEmpty(e[t]))return e[t];if(-1===t.indexOf("."))return e[t];for(var r=t.split("."),i=e,o=0,a=r.length;o<a;++o){if(null==i)return null;i=i[r[o]]}return i}return null}},{key:"findDiffKeys",value:function(e,t){return e&&t?Object.keys(e).filter((function(e){return!t.hasOwnProperty(e)})).reduce((function(t,n){return t[n]=e[n],t}),{}):{}}},{key:"reduceKeys",value:function(e,t){var n={};return e&&t&&0!==t.length?(Object.keys(e).filter((function(e){return t.some((function(t){return e.startsWith(t)}))})).forEach((function(t){n[t]=e[t],delete e[t]})),n):n}},{key:"reorderArray",value:function(e,t,n){e&&t!==n&&(n>=e.length&&(n%=e.length,t%=e.length),e.splice(n,0,e.splice(t,1)[0]))}},{key:"findIndexInList",value:function(e,t,n){var r=this;return t?t.findIndex(n?function(t){return r.equals(t,e,n)}:function(t){return t===e}):-1}},{key:"getJSXElement",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.isFunction(e)?e.apply(void 0,n):e}},{key:"getItemValue",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.isFunction(e)?e.apply(void 0,n):e}},{key:"getProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e?e[t]:void 0;return void 0===n?(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})[t]:n}},{key:"getPropCaseInsensitive",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.toFlatCase(t);for(var i in e)if(e.hasOwnProperty(i)&&this.toFlatCase(i)===r)return e[i];for(var o in n)if(n.hasOwnProperty(o)&&this.toFlatCase(o)===r)return n[o]}},{key:"getMergedProps",value:function(e,t){return Object.assign({},t,e)}},{key:"getDiffProps",value:function(e,t){return this.findDiffKeys(e,t)}},{key:"getPropValue",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.isFunction(e)?e.apply(void 0,n):e}},{key:"getComponentProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.isNotEmpty(e)?this.getProp(e.props,t,n):void 0}},{key:"getComponentProps",value:function(e,t){return this.isNotEmpty(e)?this.getMergedProps(e.props,t):void 0}},{key:"getComponentDiffProps",value:function(e,t){return this.isNotEmpty(e)?this.getDiffProps(e.props,t):void 0}},{key:"isValidChild",value:function(e,t,n){if(e){var r,i=this.getComponentProp(e,"__TYPE")||(e.type?e.type.displayName:void 0);!i&&null!=e&&null!==(r=e.type)&&void 0!==r&&null!==(r=r._payload)&&void 0!==r&&r.value&&(i=e.type._payload.value.find((function(e){return e===t})));var o=i===t;try{0}catch(e){}return o}return!1}},{key:"getRefElement",value:function(e){return e?"object"===c(e)&&e.hasOwnProperty("current")?e.current:e:null}},{key:"combinedRefs",value:function(e,t){e&&t&&("function"==typeof t?t(e.current):t.current=e.current)}},{key:"removeAccents",value:function(e){return e&&e.search(/[\xC0-\xFF]/g)>-1&&(e=e.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),e}},{key:"toFlatCase",value:function(e){return this.isNotEmpty(e)&&this.isString(e)?e.replace(/(-|_)/g,"").toLowerCase():e}},{key:"toCapitalCase",value:function(e){return this.isNotEmpty(e)&&this.isString(e)?e[0].toUpperCase()+e.slice(1):e}},{key:"trim",value:function(e){return this.isNotEmpty(e)&&this.isString(e)?e.trim():e}},{key:"isEmpty",value:function(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"===c(e)&&0===Object.keys(e).length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"isObject",value:function(e){return null!==e&&e instanceof Object&&e.constructor===Object}},{key:"isDate",value:function(e){return null!==e&&e instanceof Date&&e.constructor===Date}},{key:"isArray",value:function(e){return null!==e&&Array.isArray(e)}},{key:"isString",value:function(e){return null!==e&&"string"==typeof e}},{key:"isPrintableCharacter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.isNotEmpty(e)&&1===e.length&&e.match(/\S| /)}},{key:"isLetter",value:function(e){return/^[a-zA-Z\u00C0-\u017F]$/.test(e)}},{key:"findLast",value:function(e,t){var n;if(this.isNotEmpty(e))try{n=e.findLast(t)}catch(r){n=p(e).reverse().find(t)}return n}},{key:"findLastIndex",value:function(e,t){var n=-1;if(this.isNotEmpty(e))try{n=e.findLastIndex(t)}catch(r){n=e.lastIndexOf(p(e).reverse().find(t))}return n}},{key:"sort",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=this.compare(e,t,arguments.length>3?arguments[3]:void 0,n),o=n;return(this.isEmpty(e)||this.isEmpty(t))&&(o=1===r?n:r),o*i}},{key:"compare",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=this.isEmpty(e),o=this.isEmpty(t);return i&&o?0:i?r:o?-r:"string"==typeof e&&"string"==typeof t?n(e,t):e<t?-1:e>t?1:0}},{key:"localeComparator",value:function(e){return new Intl.Collator(e,{numeric:!0}).compare}},{key:"findChildrenByKey",value:function(e,t){var n,r=j(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.key===t)return i.children||[];if(i.children){var o=this.findChildrenByKey(i.children,t);if(o.length>0)return o}}}catch(e){r.e(e)}finally{r.f()}return[]}},{key:"mutateFieldData",value:function(e,t,n){if("object"===c(e)&&"string"==typeof t)for(var r=t.split("."),i=e,o=0,a=r.length;o<a;++o){if(o+1-a==0){i[r[o]]=n;break}i[r[o]]||(i[r[o]]={}),i=i[r[o]]}}}]),e}();function T(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 L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=function(){function e(){g(this,e)}return w(e,null,[{key:"getJSXIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null;if(null!==e){var o=c(e),a=f(t.className,"string"===o&&e);if(i=r.createElement("span",S({},t,{className:a})),"string"!==o){var l=L({iconProps:t,element:i},n);return F.getJSXElement(e,l)}}return i}}]),e}();function W(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 D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(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 I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var H=0;var B,M,V,U,q=(B=[],M=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,r=U(e,t,n),i=r.value+(r.key===e?0:n)+1;return B.push({key:e,value:i}),i},V=function(e,t){return U(e,t).value},U=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return p(B).reverse().find((function(n){return!!t||n.key===e}))||{key:e,value:n}},{get:function(e){return e&&parseInt(e.style.zIndex,10)||0},set:function(e,t,n,r){t&&(t.style.zIndex=String(M(e,n,r)))},clear:function(e){var t;e&&(t=q.get(e),B=B.filter((function(e){return e.value!==t})),e.style.zIndex="")},getCurrent:function(e,t){return V(e,t)}});return e.DomHandler=x,e.EventBus=function(){var e=new Map;return{on:function(t,n){var r=e.get(t);r?r.push(n):r=[n],e.set(t,r)},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){var r=e.get(t);r&&r.slice().forEach((function(e){return e(n)}))}}},e.IconUtils=N,e.ObjectUtils=F,e.UniqueComponentId=function(){return H++,"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pr_id_").concat(H)},e.ZIndexUtils=q,e.classNames=f,e.mask=function(e,t){var n,r,i,o,a,l,u,s,c,f,d,y;t=D(D({},{mask:null,slotChar:"_",autoClear:!0,unmask:!1,readOnly:!1,onComplete:null,onChange:null,onFocus:null,onBlur:null}),t);var v=function(t,n){var r,i,o;if(e.offsetParent&&e===document.activeElement)return"number"!=typeof t?(e.setSelectionRange?(i=e.selectionStart,o=e.selectionEnd):document.selection&&document.selection.createRange&&(o=(i=0-(r=document.selection.createRange()).duplicate().moveStart("character",-1e5))+r.text.length),{begin:i,end:o}):(i=t,o="number"==typeof n?n:i,void(e.setSelectionRange?e.setSelectionRange(i,o):e.createTextRange&&((r=e.createTextRange()).collapse(!0),r.moveEnd("character",o),r.moveStart("character",i),r.select())))},p=function(){for(var e=o;e<=u;e++)if(n[e]&&d[e]===g(e))return!1;return!0},g=function(e){return t.slotChar.charAt(e<t.slotChar.length?e:0)},h=function(){return t.unmask?N():e&&e.value},m=function(e){for(;++e<i&&!n[e];);return e},b=function(e){for(;--e>=0&&!n[e];);return e},w=function(e,t){var r,a;if(!(e<0)){for(r=e,a=m(t);r<i;r++)if(n[r]){if(!(a<i&&n[r].test(d[a])))break;d[r]=d[a],d[a]=g(a),a=m(a)}A(),v(Math.max(o,e))}},k=function(e){var t,r,o,a;for(t=e,r=g(e);t<i;t++)if(n[t]){if(o=m(t),a=d[t],d[t]=r,!(o<i&&n[o].test(a)))break;r=a}},E=function(r){var a=e.value,l=v();if(s&&s.length&&s.length>a.length){for(P(!0);l.begin>0&&!n[l.begin-1];)l.begin--;if(0===l.begin)for(;l.begin<o&&!n[l.begin];)l.begin++;v(l.begin,l.begin)}else{for(P(!0);l.begin<i&&!n[l.begin];)l.begin++;v(l.begin,l.begin)}t.onComplete&&p()&&t.onComplete({originalEvent:r,value:h()})},O=function(n){if(P(),t.onBlur&&t.onBlur(n),W(n),e.value!==c){var r=document.createEvent("HTMLEvents");r.initEvent("change",!0,!1),e.dispatchEvent(r)}},C=function(n){if(!t.readOnly){var r,i,o,a=n.which||n.keyCode;s=e.value,8===a||46===a||x.isIOS()&&127===a?((o=(r=v()).end)-(i=r.begin)==0&&(i=46!==a?b(i):o=m(i-1),o=46===a?m(o):o),j(i,o),w(i,o-1),W(n),n.preventDefault()):13===a?(O(n),W(n)):27===a&&(e.value=c,v(0,P()),W(n),n.preventDefault())}},S=function(e){if(!t.readOnly){var r,o,a,l,s=e.which||e.keyCode,c=v();if(!(e.ctrlKey||e.altKey||e.metaKey||s<32)){if(s&&13!==s){if(c.end-c.begin!=0&&(j(c.begin,c.end),w(c.begin,c.end-1)),(r=m(c.begin-1))<i&&(o=String.fromCharCode(s),n[r].test(o))){if(k(r),d[r]=o,A(),a=m(r),x.isAndroid()){setTimeout((function(){v(a)}),0)}else v(a);c.begin<=u&&(l=p())}e.preventDefault()}W(e),t.onComplete&&l&&t.onComplete({originalEvent:e,value:h()})}}},j=function(e,t){var r;for(r=e;r<t&&r<i;r++)n[r]&&(d[r]=g(r))},A=function(){e.value=d.join("")},P=function(a){var l,u,s,c=e.value,f=-1;for(l=0,s=0;l<i;l++)if(n[l]){for(d[l]=g(l);s++<c.length;)if(u=c.charAt(s-1),n[l].test(u)){d[l]=u,f=l;break}if(s>c.length){j(l+1,i);break}}else d[l]===c.charAt(s)&&s++,l<r&&(f=l);return a?A():f+1<r?t.autoClear||d.join("")===y?(e.value&&(e.value=""),j(0,i)):A():(A(),e.value=e.value.substring(0,f+1)),r?l:o},F=function(n){var r;t.readOnly||(clearTimeout(f),c=e.value,r=P(),f=setTimeout((function(){e===document.activeElement&&(A(),r===t.mask.replace("?","").length?v(0,r):v(r))}),100),t.onFocus&&t.onFocus(n))},T=function(e){l?E(e):L(e)},L=function(e){if(!t.readOnly){var n=P(!0);v(n),W(e),t.onComplete&&p()&&t.onComplete({originalEvent:e,value:h()})}},N=function(){for(var e=[],t=0;t<d.length;t++){var r=d[t];n[t]&&r!==g(t)&&e.push(r)}return e.join("")},W=function(e){if(t.onChange){var n=h();t.onChange({originalEvent:e,value:y!==n?n:"",stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{value:y!==n?n:""}})}},R=function(){e.addEventListener("focus",F),e.addEventListener("blur",O),e.addEventListener("keydown",C),e.addEventListener("keypress",S),e.addEventListener("input",T),e.addEventListener("paste",L)},I=function(){n=[],r=t.mask.length,i=t.mask.length,o=null,a={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},l=x.isChrome()&&x.isAndroid();for(var e=t.mask.split(""),s=0;s<e.length;s++){var c=e[s];"?"===c?(i--,r=s):a[c]?(n.push(new RegExp(a[c])),null===o&&(o=n.length-1),s<r&&(u=n.length-1)):n.push(null)}d=[];for(var f=0;f<e.length;f++){var v=e[f];"?"!==v&&d.push(a[v]?g(f):v)}y=d.join("")};return e&&t.mask&&(I(),R()),{init:I,bindEvents:R,unbindEvents:function(){e.removeEventListener("focus",F),e.removeEventListener("blur",O),e.removeEventListener("keydown",C),e.removeEventListener("keypress",S),e.removeEventListener("input",T),e.removeEventListener("paste",L)},updateModel:W,getValue:h}},e.mergeProps=function(e){if(e){var t=function(e){return"function"==typeof e},n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).classNameMergeFunction,r=t(n);return e.reduce((function(e,i){if(!i)return e;var o=function(){var o=i[a];if("style"===a)e.style=I(I({},e.style),i.style);else if("className"===a){var l="";l=r?n(e.className,i.className):[e.className,i.className].join(" ").trim(),e.className=l||void 0}else if(t(o)){var u=e[a];e[a]=u?function(){u.apply(void 0,arguments),o.apply(void 0,arguments)}:o}else e[a]=o};for(var a in i)o();return e}),{})}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React);
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var api = require('primereact/api');
|
|
7
8
|
var hooks = require('primereact/hooks');
|
|
9
|
+
var spinner = require('primereact/icons/spinner');
|
|
8
10
|
var utils = require('primereact/utils');
|
|
9
11
|
var componentbase = require('primereact/componentbase');
|
|
10
|
-
var spinner = require('primereact/icons/spinner');
|
|
11
|
-
var api = require('primereact/api');
|
|
12
12
|
|
|
13
13
|
function _interopNamespace(e) {
|
|
14
14
|
if (e && e.__esModule) return e;
|
|
@@ -187,6 +187,7 @@ var VirtualScrollerBase = componentbase.ComponentBase.extend({
|
|
|
187
187
|
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; }
|
|
188
188
|
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; }
|
|
189
189
|
var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
190
|
+
var mergeProps = hooks.useMergeProps();
|
|
190
191
|
var context = React__namespace.useContext(api.PrimeReactContext);
|
|
191
192
|
var props = VirtualScrollerBase.getProps(inProps, context);
|
|
192
193
|
var prevProps = hooks.usePrevious(inProps) || {};
|
|
@@ -487,7 +488,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
487
488
|
rows: 0,
|
|
488
489
|
cols: firstState.cols
|
|
489
490
|
} : 0 : firstState,
|
|
490
|
-
last: Math.min(props.step ? props.step : last, props.items.length)
|
|
491
|
+
last: Math.min(props.step ? props.step : last, (props.items || []).length)
|
|
491
492
|
};
|
|
492
493
|
props.onLazyLoad && props.onLazyLoad(lazyLoadState.current);
|
|
493
494
|
});
|
|
@@ -518,9 +519,10 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
518
519
|
}
|
|
519
520
|
};
|
|
520
521
|
var getLast = function getLast() {
|
|
522
|
+
var _ref2;
|
|
521
523
|
var last = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
522
524
|
var isCols = arguments.length > 1 ? arguments[1] : undefined;
|
|
523
|
-
return props.items ? Math.min(isCols ? (props.columns || props.items[0]).length : props.items.length, last) : 0;
|
|
525
|
+
return props.items ? Math.min(isCols ? ((_ref2 = props.columns || props.items[0]) === null || _ref2 === void 0 ? void 0 : _ref2.length) || 0 : (props.items || []).length, last) : 0;
|
|
524
526
|
};
|
|
525
527
|
var getContentPosition = function getContentPosition() {
|
|
526
528
|
if (_contentRef.current) {
|
|
@@ -695,8 +697,8 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
695
697
|
props.onScrollIndexChange && props.onScrollIndexChange(newState);
|
|
696
698
|
if (props.lazy && isPageChanged(first)) {
|
|
697
699
|
var newLazyLoadState = {
|
|
698
|
-
first: props.step ? Math.min(getPageByFirst(first) * props.step, props.items.length - props.step) : first,
|
|
699
|
-
last: Math.min(props.step ? (getPageByFirst(first) + 1) * props.step : last, props.items.length)
|
|
700
|
+
first: props.step ? Math.min(getPageByFirst(first) * props.step, (props.items || []).length - props.step) : first,
|
|
701
|
+
last: Math.min(props.step ? (getPageByFirst(first) + 1) * props.step : last, (props.items || []).length)
|
|
700
702
|
};
|
|
701
703
|
var isLazyStateChanged = !lazyLoadState.current || lazyLoadState.current.first !== newLazyLoadState.first || lazyLoadState.current.last !== newLazyLoadState.last;
|
|
702
704
|
isLazyStateChanged && props.onLazyLoad && props.onLazyLoad(newLazyLoadState);
|
|
@@ -735,9 +737,9 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
735
737
|
}
|
|
736
738
|
resizeTimeout.current = setTimeout(function () {
|
|
737
739
|
if (elementRef.current) {
|
|
738
|
-
var
|
|
739
|
-
width =
|
|
740
|
-
height =
|
|
740
|
+
var _ref3 = [utils.DomHandler.getWidth(elementRef.current), utils.DomHandler.getHeight(elementRef.current)],
|
|
741
|
+
width = _ref3[0],
|
|
742
|
+
height = _ref3[1];
|
|
741
743
|
var isDiffWidth = width !== defaultWidth.current,
|
|
742
744
|
isDiffHeight = height !== defaultHeight.current;
|
|
743
745
|
var reinit = both ? isDiffWidth || isDiffHeight : horizontal ? isDiffWidth : vertical ? isDiffHeight : false;
|
|
@@ -765,7 +767,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
765
767
|
};
|
|
766
768
|
};
|
|
767
769
|
var loaderOptions = function loaderOptions(index, extOptions) {
|
|
768
|
-
var count = loaderArrState.length;
|
|
770
|
+
var count = loaderArrState.length || 0;
|
|
769
771
|
return _objectSpread({
|
|
770
772
|
index: index,
|
|
771
773
|
count: count,
|
|
@@ -857,7 +859,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
857
859
|
};
|
|
858
860
|
var createLoader = function createLoader() {
|
|
859
861
|
var iconClassName = 'p-virtualscroller-loading-icon';
|
|
860
|
-
var loadingIconProps =
|
|
862
|
+
var loadingIconProps = mergeProps({
|
|
861
863
|
className: iconClassName
|
|
862
864
|
}, ptm('loadingIcon'));
|
|
863
865
|
var icon = props.loadingIcon || /*#__PURE__*/React__namespace.createElement(spinner.SpinnerIcon, _extends({}, loadingIconProps, {
|
|
@@ -885,7 +887,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
885
887
|
};
|
|
886
888
|
content = utils.ObjectUtils.getJSXElement(props.loaderIconTemplate, defaultContentOptions);
|
|
887
889
|
}
|
|
888
|
-
var loaderProps =
|
|
890
|
+
var loaderProps = mergeProps({
|
|
889
891
|
className: className
|
|
890
892
|
}, ptm('loader'));
|
|
891
893
|
return /*#__PURE__*/React__namespace.createElement("div", loaderProps, content);
|
|
@@ -894,7 +896,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
894
896
|
};
|
|
895
897
|
var createSpacer = function createSpacer() {
|
|
896
898
|
if (props.showSpacer) {
|
|
897
|
-
var spacerProps =
|
|
899
|
+
var spacerProps = mergeProps({
|
|
898
900
|
ref: _spacerRef,
|
|
899
901
|
style: spacerStyle.current,
|
|
900
902
|
className: 'p-virtualscroller-spacer'
|
|
@@ -919,7 +921,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
919
921
|
var className = utils.classNames('p-virtualscroller-content', {
|
|
920
922
|
'p-virtualscroller-loading': loadingState
|
|
921
923
|
});
|
|
922
|
-
var contentProps =
|
|
924
|
+
var contentProps = mergeProps({
|
|
923
925
|
ref: _contentRef,
|
|
924
926
|
style: contentStyle.current,
|
|
925
927
|
className: className
|
|
@@ -978,7 +980,7 @@ var VirtualScroller = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__na
|
|
|
978
980
|
var loader = createLoader();
|
|
979
981
|
var _content = createContent();
|
|
980
982
|
var spacer = createSpacer();
|
|
981
|
-
var rootProps =
|
|
983
|
+
var rootProps = mergeProps({
|
|
982
984
|
ref: elementRef,
|
|
983
985
|
className: className,
|
|
984
986
|
tabIndex: props.tabIndex,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/hooks"),r=require("primereact/utils"),n=require("primereact/componentbase"),o=require("primereact/icons/spinner"),l=require("primereact/api");function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=i(e);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}function a(e){return a="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},a(e)}function u(e,t){if("object"!==a(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function f(e){var t=u(e,"string");return"symbol"===a(t)?t:String(t)}function m(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){if(Array.isArray(e))return e}function d(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,l,i,s=[],c=!0,a=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=l.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(a)throw o}}return s}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function h(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,t){return p(e)||d(e,t)||h(e,t)||v()}var w=n.ComponentBase.extend({defaultProps:{__TYPE:"VirtualScroller",__parentMetadata:null,id:null,style:null,className:null,tabIndex:0,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",step:0,numToleratedItems:null,delay:0,resizeDelay:10,appendOnly:!1,inline:!1,lazy:!1,disabled:!1,loaderDisabled:!1,loadingIcon:null,columns:null,loading:void 0,autoSize:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,loaderIconTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null,children:void 0},css:{styles:"\n.p-virtualscroller {\n position: relative;\n overflow: auto;\n contain: strict;\n transform: translateZ(0);\n will-change: scroll-position;\n outline: 0 none;\n}\n\n.p-virtualscroller-content {\n position: absolute;\n top: 0;\n left: 0;\n /*contain: content;*/\n min-height: 100%;\n min-width: 100%;\n will-change: transform;\n}\n\n.p-virtualscroller-spacer {\n position: absolute;\n top: 0;\n left: 0;\n height: 1px;\n width: 1px;\n transform-origin: 0 0;\n pointer-events: none;\n}\n\n.p-virtualscroller-loader {\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.p-virtualscroller-loader.p-component-overlay {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-virtualscroller-loading-icon {\n font-size: 2rem;\n}\n\n.p-virtualscroller-horizontal > .p-virtualscroller-content {\n display: flex;\n}\n\n/* Inline */\n.p-virtualscroller-inline .p-virtualscroller-content {\n position: static;\n}\n"}});function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=s.memo(s.forwardRef((function(e,n){var i=s.useContext(l.PrimeReactContext),a=w.getProps(e,i),u=t.usePrevious(e)||{},f="vertical"===a.orientation,p="horizontal"===a.orientation,d="both"===a.orientation,g=y(s.useState(d?{rows:0,cols:0}:0),2),h=g[0],v=g[1],b=y(s.useState(d?{rows:0,cols:0}:0),2),z=b[0],O=b[1],I=y(s.useState(0),2),T=I[0],j=I[1],x=y(s.useState(d?{rows:0,cols:0}:0),2),E=x[0],R=x[1],P=y(s.useState(a.numToleratedItems),2),H=P[0],D=P[1],L=y(s.useState(a.loading||!1),2),M=L[0],U=L[1],N=y(s.useState([]),2),W=N[0],C=N[1],F=w.setMetaData({props:a,state:{first:h,last:z,page:T,numItemsInViewport:E,numToleratedItems:H,loading:M,loaderArr:W}}).ptm;t.useStyle(w.css.styles,{name:"virtualscroller"});var A=s.useRef(null),V=s.useRef(null),_=s.useRef(null),k=s.useRef(null),q=s.useRef(d?{top:0,left:0}:0),J=s.useRef(null),X=s.useRef(null),B=s.useRef({}),Y=s.useRef({}),Z=s.useRef(null),$=s.useRef(null),G=s.useRef(null),K=s.useRef(null),Q=s.useRef(!1),ee=s.useRef(null),te=y(t.useResizeListener({listener:function(e){return be()},when:!a.disabled}),1)[0],re=y(t.useEventListener({target:"window",type:"orientationchange",listener:function(e){return be()},when:!a.disabled}),1)[0],ne=function(){return A},oe=function(e){return Math.floor((e+4*H)/(a.step||1))},le=function(e){return!a.step||T!==oe(e)},ie=function(e){q.current=d?{top:0,left:0}:0,A.current&&A.current.scrollTo(e)},se=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",r=ue().numToleratedItems,n=pe(),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<=(arguments.length>1?arguments[1]:void 0)?0:e},l=function(e,t,r){return e*t+r},i=function(){return ie({left:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,top:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,behavior:t})},s=d?{rows:0,cols:0}:0,c=!1;d?(i(l((s={rows:o(e[0],r[0]),cols:o(e[1],r[1])}).cols,a.itemSize[1],n.left),l(s.rows,a.itemSize[0],n.top)),c=h.rows!==s.rows||h.cols!==s.cols):(s=o(e,r),p?i(l(s,a.itemSize,n.left),0):i(0,l(s,a.itemSize,n.top)),c=h!==s),Q.current=c,v(s)},ce=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(t){var n=ae(),o=n.first,l=n.viewport,i=function(){return ie({left:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,top:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,behavior:r})},s="to-end"===t;if("to-start"===t){if(d)l.first.rows-o.rows>e[0]?i(l.first.cols*a.itemSize[1],(l.first.rows-1)*a.itemSize[0]):l.first.cols-o.cols>e[1]&&i((l.first.cols-1)*a.itemSize[1],l.first.rows*a.itemSize[0]);else if(l.first-o>e){var c=(l.first-1)*a.itemSize;p?i(c,0):i(0,c)}}else if(s)if(d)l.last.rows-o.rows<=e[0]+1?i(l.first.cols*a.itemSize[1],(l.first.rows+1)*a.itemSize[0]):l.last.cols-o.cols<=e[1]+1&&i((l.first.cols+1)*a.itemSize[1],l.first.rows*a.itemSize[0]);else if(l.last-o<=e+1){var u=(l.first+1)*a.itemSize;p?i(u,0):i(0,u)}}else se(e,r)},ae=function(){var e=function(e,t){return Math.floor(e/(t||e))},t=h,r=0;if(A.current){var n=A.current,o=n.scrollTop,l=n.scrollLeft;if(d)r={rows:(t={rows:e(o,a.itemSize[0]),cols:e(l,a.itemSize[1])}).rows+E.rows,cols:t.cols+E.cols};else r=(t=e(p?l:o,a.itemSize))+E}return{first:h,last:z,viewport:{first:t,last:r}}},ue=function(){var e=pe(),t=A.current?A.current.offsetWidth-e.left:0,r=A.current?A.current.offsetHeight-e.top:0,n=function(e,t){return Math.ceil(e/(t||e))},o=function(e){return Math.ceil(e/2)},l=d?{rows:n(r,a.itemSize[0]),cols:n(t,a.itemSize[1])}:n(p?t:r,a.itemSize);return{numItemsInViewport:l,numToleratedItems:H||(d?[o(l.rows),o(l.cols)]:o(l))}},fe=function(e){a.autoSize&&!e&&Promise.resolve().then((function(){if(V.current){V.current.style.minHeight=V.current.style.minWidth="auto",V.current.style.position="relative",A.current.style.contain="none";var e=[r.DomHandler.getWidth(A.current),r.DomHandler.getHeight(A.current)],t=e[0],n=e[1];(d||p)&&(A.current.style.width=(t<Z.current?t:a.scrollWidth||Z.current)+"px"),(d||f)&&(A.current.style.height=(n<$.current?n:a.scrollHeight||$.current)+"px"),V.current.style.minHeight=V.current.style.minWidth="",V.current.style.position="",A.current.style.contain=""}}))},me=function(){return a.items?Math.min((arguments.length>1?arguments[1]:void 0)?(a.columns||a.items[0]).length:a.items.length,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0):0},pe=function(){if(V.current){var e=getComputedStyle(V.current),t=parseFloat(e.paddingLeft)+Math.max(parseFloat(e.left)||0,0),r=parseFloat(e.paddingRight)+Math.max(parseFloat(e.right)||0,0),n=parseFloat(e.paddingTop)+Math.max(parseFloat(e.top)||0,0),o=parseFloat(e.paddingBottom)+Math.max(parseFloat(e.bottom)||0,0);return{left:t,right:r,top:n,bottom:o,x:t+r,y:n+o}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}},de=function(){if(A.current){var e=A.current.parentElement,t=a.scrollWidth||"".concat(A.current.offsetWidth||e.offsetWidth,"px"),r=a.scrollHeight||"".concat(A.current.offsetHeight||e.offsetHeight,"px"),n=function(e,t){return A.current.style[e]=t};d||p?(n("height",r),n("width",t)):n("height",r)}},ge=function(){var e=a.items;if(e){var t=pe(),r=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Y.current=S(S({},Y.current),m({},"".concat(e),(t||[]).length*r+n+"px"))};d?(r("height",e,a.itemSize[0],t.y),r("width",a.columns||e[1],a.itemSize[1],t.x)):p?r("width",a.columns||e,a.itemSize,t.x):r("height",e,a.itemSize,t.y)}},he=function(e){if(V.current&&!a.appendOnly){var t=e?e.first:h,r=function(e,t){return e*t},n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k.current&&(k.current.style.top="-".concat(t,"px")),B.current=S(S({},B.current),{transform:"translate3d(".concat(e,"px, ").concat(t,"px, 0)")})};if(d)n(r(t.cols,a.itemSize[1]),r(t.rows,a.itemSize[0]));else{var o=r(t,a.itemSize);p?n(o,0):n(0,o)}}},ve=function(e){var t=e.target,r=pe(),n=function(e,t){return e?e>t?e-t:e:0},o=function(e,t){return Math.floor(e/(t||e))},l=function(e,t,r,n,o,l){return e<=o?o:l?r-n-o:t+o-1},i=function(e,t,r,n,o,l,i){return e<=l?0:Math.max(0,i?e<t?r:e-l:e>t?r:e-2*l)},s=function(e,t,r,n,o,l){var i=t+n+2*o;return e>=o&&(i+=o+1),me(i,l)},c=n(t.scrollTop,r.top),u=n(t.scrollLeft,r.left),f=d?{rows:0,cols:0}:0,m=z,g=!1,v=q.current;if(d){var y=q.current.top<=c,w=q.current.left<=u;if(!a.appendOnly||a.appendOnly&&(y||w)){var b={rows:o(c,a.itemSize[0]),cols:o(u,a.itemSize[1])},S={rows:l(b.rows,h.rows,z.rows,E.rows,H[0],y),cols:l(b.cols,h.cols,z.cols,E.cols,H[1],w)};f={rows:i(b.rows,S.rows,h.rows,0,0,H[0],y),cols:i(b.cols,S.cols,h.cols,0,0,H[1],w)},m={rows:s(b.rows,f.rows,0,E.rows,H[0]),cols:s(b.cols,f.cols,0,E.cols,H[1],!0)},g=f.rows!==h.rows||m.rows!==z.rows||f.cols!==h.cols||m.cols!==z.cols||Q.current,v={top:c,left:u}}}else{var O=p?u:c,I=q.current<=O;if(!a.appendOnly||a.appendOnly&&I){var T=o(O,a.itemSize);m=s(T,f=i(T,l(T,h,z,E,H,I),h,0,0,H,I),0,E,H),g=f!==h||m!==z||Q.current,v=O}}return{first:f,last:m,isRangeChanged:g,scrollPos:v}},ye=function(e){var t=ve(e),r=t.first,n=t.last,o=t.scrollPos;if(t.isRangeChanged){var l={first:r,last:n};if(he(l),v(r),O(n),q.current=o,a.onScrollIndexChange&&a.onScrollIndexChange(l),a.lazy&&le(r)){var i={first:a.step?Math.min(oe(r)*a.step,a.items.length-a.step):r,last:Math.min(a.step?(oe(r)+1)*a.step:n,a.items.length)};(!ee.current||ee.current.first!==i.first||ee.current.last!==i.last)&&a.onLazyLoad&&a.onLazyLoad(i),ee.current=i}}},we=function(e){if(a.onScroll&&a.onScroll(e),a.delay){if(J.current&&clearTimeout(J.current),le(h)){if(!M&&a.showLoader)(ve(e).isRangeChanged||!!a.step&&le(h))&&U(!0);J.current=setTimeout((function(){ye(e),!M||!a.showLoader||a.lazy&&void 0!==a.loading||(U(!1),j(oe(h)))}),a.delay)}}else ye(e)},be=function(){X.current&&clearTimeout(X.current),X.current=setTimeout((function(){if(A.current){var e=[r.DomHandler.getWidth(A.current),r.DomHandler.getHeight(A.current)],t=e[0],n=e[1],o=t!==Z.current,l=n!==$.current;(d?o||l:p?o:!!f&&l)&&(D(a.numToleratedItems),Z.current=t,$.current=n,G.current=r.DomHandler.getWidth(V.current),K.current=r.DomHandler.getHeight(V.current))}}),a.resizeDelay)},Se=function(e){var t=(a.items||[]).length,r=d?h.rows+e:h+e;return{index:r,count:t,first:0===r,last:r===t-1,even:r%2==0,odd:r%2!=0,props:a}},ze=function(e,t){var r=W.length;return S({index:e,count:r,first:0===e,last:e===r-1,even:e%2==0,odd:e%2!=0,props:a},t)},Oe=function(){var e=a.items;return e&&!M?d?e.slice(a.appendOnly?0:h.rows,z.rows).map((function(e){return a.columns?e:e.slice(a.appendOnly?0:h.cols,z.cols)})):p&&a.columns?e:e.slice(a.appendOnly?0:h,z):[]},Ie=function(){var e,t,r,n,o;a.disabled||(de(),e=ue(),t=e.numItemsInViewport,r=e.numToleratedItems,n=function(e,t,r){return me(e+t+(e<r?2:3)*r,arguments.length>3&&void 0!==arguments[3]&&arguments[3])},o=d?{rows:n(h.rows,t.rows,r[0]),cols:n(h.cols,t.cols,r[1],!0)}:n(h,t,r),R(t),D(r),O(o),a.showLoader&&C(d?Array.from({length:t.rows}).map((function(){return Array.from({length:t.cols})})):Array.from({length:t})),a.lazy&&Promise.resolve().then((function(){ee.current={first:a.step?d?{rows:0,cols:h.cols}:0:h,last:Math.min(a.step?a.step:o,a.items.length)},a.onLazyLoad&&a.onLazyLoad(ee.current)})),ge())};t.useMountEffect((function(){A.current&&r.DomHandler.isVisible(A.current)&&(V.current=V.current||V.current||r.DomHandler.findSingle(A.current,".p-virtualscroller-content"),Ie(),te(),re(),Z.current=r.DomHandler.getWidth(A.current),$.current=r.DomHandler.getHeight(A.current),G.current=r.DomHandler.getWidth(V.current),K.current=r.DomHandler.getHeight(V.current))})),t.useUpdateEffect((function(){Ie()}),[a.itemSize,a.scrollHeight,a.scrollWidth]),t.useUpdateEffect((function(){a.numToleratedItems!==H&&D(a.numToleratedItems)}),[a.numToleratedItems]),t.useUpdateEffect((function(){a.numToleratedItems===H&&Ie()}),[H]),t.useUpdateEffect((function(){u.items&&u.items.length===(a.items||[]).length||Ie();var e=M;a.lazy&&u.loading!==a.loading&&a.loading!==M&&(U(a.loading),e=a.loading),fe(e)})),t.useUpdateEffect((function(){q.current=d?{top:0,left:0}:0}),[a.orientation]),s.useImperativeHandle(n,(function(){return{props:a,getElementRef:ne,scrollTo:ie,scrollToIndex:se,scrollInView:ce,getRenderedRange:ae}}));var Te=function(e){var t=ze(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),n=r.ObjectUtils.getJSXElement(a.loadingTemplate,t);return s.createElement(s.Fragment,{key:e},n)},je=function(e,t){var n=Se(t),o=r.ObjectUtils.getJSXElement(a.itemTemplate,e,n);return s.createElement(s.Fragment,{key:n.index},o)};if(a.disabled){var xe=r.ObjectUtils.getJSXElement(a.contentTemplate,{items:a.items,rows:a.items,columns:a.columns});return s.createElement(s.Fragment,null,a.children,xe)}var Ee=r.classNames("p-virtualscroller",{"p-virtualscroller-inline":a.inline,"p-virtualscroller-both p-both-scroll":d,"p-virtualscroller-horizontal p-horizontal-scroll":p},a.className),Re=function(){var e="p-virtualscroller-loading-icon",t=r.mergeProps({className:e},F("loadingIcon")),n=a.loadingIcon||s.createElement(o.SpinnerIcon,c({},t,{spin:!0})),l=r.IconUtils.getJSXIcon(n,S({},t),{props:a});if(!a.loaderDisabled&&a.showLoader&&M){var i=r.classNames("p-virtualscroller-loader",{"p-component-overlay":!a.loadingTemplate}),u=l;a.loadingTemplate?u=W.map((function(e,t){return Te(t,d&&{numCols:E.cols})})):a.loaderIconTemplate&&(u=r.ObjectUtils.getJSXElement(a.loaderIconTemplate,{iconClassName:e,element:u,props:a}));var f=r.mergeProps({className:i},F("loader"));return s.createElement("div",f,u)}return null}(),Pe=function(){var e=Oe().map(je),t=r.classNames("p-virtualscroller-content",{"p-virtualscroller-loading":M}),n=r.mergeProps({ref:V,style:B.current,className:t},F("content")),o=s.createElement("div",n,e);if(a.contentTemplate){var l={style:B.current,className:t,spacerStyle:Y.current,contentRef:function(e){return V.current=r.ObjectUtils.getRefElement(e)},spacerRef:function(e){return _.current=r.ObjectUtils.getRefElement(e)},stickyRef:function(e){return k.current=r.ObjectUtils.getRefElement(e)},items:Oe(),getItemOptions:function(e){return Se(e)},children:e,element:o,props:a,loading:M,getLoaderOptions:function(e,t){return ze(e,t)},loadingTemplate:a.loadingTemplate,itemSize:a.itemSize,rows:M?a.loaderDisabled?W:[]:Oe(),columns:a.columns&&d||p?M&&a.loaderDisabled?d?W[0]:W:a.columns.slice(d?h.cols:h,d?z.cols:z):a.columns,vertical:f,horizontal:p,both:d};return r.ObjectUtils.getJSXElement(a.contentTemplate,l)}return o}(),He=function(){if(a.showSpacer){var e=r.mergeProps({ref:_,style:Y.current,className:"p-virtualscroller-spacer"},F("spacer"));return s.createElement("div",e)}return null}(),De=r.mergeProps({ref:A,className:Ee,tabIndex:a.tabIndex,style:a.style,onScroll:function(e){return we(e)}},w.getOtherProps(a),F("root"));return s.createElement("div",De,Pe,He,Re)})));z.displayName="VirtualScroller",exports.VirtualScroller=z;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),r=require("primereact/hooks"),n=require("primereact/icons/spinner"),o=require("primereact/utils"),l=require("primereact/componentbase");function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=i(e);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}function a(e){return a="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},a(e)}function u(e,t){if("object"!==a(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function f(e){var t=u(e,"string");return"symbol"===a(t)?t:String(t)}function m(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){if(Array.isArray(e))return e}function d(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,l,i,s=[],c=!0,a=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=l.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(a)throw o}}return s}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function h(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,t){return p(e)||d(e,t)||h(e,t)||v()}var w=l.ComponentBase.extend({defaultProps:{__TYPE:"VirtualScroller",__parentMetadata:null,id:null,style:null,className:null,tabIndex:0,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",step:0,numToleratedItems:null,delay:0,resizeDelay:10,appendOnly:!1,inline:!1,lazy:!1,disabled:!1,loaderDisabled:!1,loadingIcon:null,columns:null,loading:void 0,autoSize:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,loaderIconTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null,children:void 0},css:{styles:"\n.p-virtualscroller {\n position: relative;\n overflow: auto;\n contain: strict;\n transform: translateZ(0);\n will-change: scroll-position;\n outline: 0 none;\n}\n\n.p-virtualscroller-content {\n position: absolute;\n top: 0;\n left: 0;\n /*contain: content;*/\n min-height: 100%;\n min-width: 100%;\n will-change: transform;\n}\n\n.p-virtualscroller-spacer {\n position: absolute;\n top: 0;\n left: 0;\n height: 1px;\n width: 1px;\n transform-origin: 0 0;\n pointer-events: none;\n}\n\n.p-virtualscroller-loader {\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.p-virtualscroller-loader.p-component-overlay {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-virtualscroller-loading-icon {\n font-size: 2rem;\n}\n\n.p-virtualscroller-horizontal > .p-virtualscroller-content {\n display: flex;\n}\n\n/* Inline */\n.p-virtualscroller-inline .p-virtualscroller-content {\n position: static;\n}\n"}});function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=s.memo(s.forwardRef((function(e,l){var i=r.useMergeProps(),a=s.useContext(t.PrimeReactContext),u=w.getProps(e,a),f=r.usePrevious(e)||{},p="vertical"===u.orientation,d="horizontal"===u.orientation,g="both"===u.orientation,h=y(s.useState(g?{rows:0,cols:0}:0),2),v=h[0],b=h[1],z=y(s.useState(g?{rows:0,cols:0}:0),2),O=z[0],I=z[1],T=y(s.useState(0),2),j=T[0],x=T[1],E=y(s.useState(g?{rows:0,cols:0}:0),2),R=E[0],H=E[1],P=y(s.useState(u.numToleratedItems),2),D=P[0],L=P[1],M=y(s.useState(u.loading||!1),2),U=M[0],N=M[1],W=y(s.useState([]),2),C=W[0],F=W[1],A=w.setMetaData({props:u,state:{first:v,last:O,page:j,numItemsInViewport:R,numToleratedItems:D,loading:U,loaderArr:C}}).ptm;r.useStyle(w.css.styles,{name:"virtualscroller"});var V=s.useRef(null),_=s.useRef(null),k=s.useRef(null),q=s.useRef(null),J=s.useRef(g?{top:0,left:0}:0),X=s.useRef(null),B=s.useRef(null),Y=s.useRef({}),Z=s.useRef({}),$=s.useRef(null),G=s.useRef(null),K=s.useRef(null),Q=s.useRef(null),ee=s.useRef(!1),te=s.useRef(null),re=y(r.useResizeListener({listener:function(e){return Se()},when:!u.disabled}),1)[0],ne=y(r.useEventListener({target:"window",type:"orientationchange",listener:function(e){return Se()},when:!u.disabled}),1)[0],oe=function(){return V},le=function(e){return Math.floor((e+4*D)/(u.step||1))},ie=function(e){return!u.step||j!==le(e)},se=function(e){J.current=g?{top:0,left:0}:0,V.current&&V.current.scrollTo(e)},ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",r=fe().numToleratedItems,n=de(),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<=(arguments.length>1?arguments[1]:void 0)?0:e},l=function(e,t,r){return e*t+r},i=function(){return se({left:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,top:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,behavior:t})},s=g?{rows:0,cols:0}:0,c=!1;g?(i(l((s={rows:o(e[0],r[0]),cols:o(e[1],r[1])}).cols,u.itemSize[1],n.left),l(s.rows,u.itemSize[0],n.top)),c=v.rows!==s.rows||v.cols!==s.cols):(s=o(e,r),d?i(l(s,u.itemSize,n.left),0):i(0,l(s,u.itemSize,n.top)),c=v!==s),ee.current=c,b(s)},ae=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(t){var n=ue(),o=n.first,l=n.viewport,i=function(){return se({left:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,top:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,behavior:r})},s="to-end"===t;if("to-start"===t){if(g)l.first.rows-o.rows>e[0]?i(l.first.cols*u.itemSize[1],(l.first.rows-1)*u.itemSize[0]):l.first.cols-o.cols>e[1]&&i((l.first.cols-1)*u.itemSize[1],l.first.rows*u.itemSize[0]);else if(l.first-o>e){var c=(l.first-1)*u.itemSize;d?i(c,0):i(0,c)}}else if(s)if(g)l.last.rows-o.rows<=e[0]+1?i(l.first.cols*u.itemSize[1],(l.first.rows+1)*u.itemSize[0]):l.last.cols-o.cols<=e[1]+1&&i((l.first.cols+1)*u.itemSize[1],l.first.rows*u.itemSize[0]);else if(l.last-o<=e+1){var a=(l.first+1)*u.itemSize;d?i(a,0):i(0,a)}}else ce(e,r)},ue=function(){var e=function(e,t){return Math.floor(e/(t||e))},t=v,r=0;if(V.current){var n=V.current,o=n.scrollTop,l=n.scrollLeft;if(g)r={rows:(t={rows:e(o,u.itemSize[0]),cols:e(l,u.itemSize[1])}).rows+R.rows,cols:t.cols+R.cols};else r=(t=e(d?l:o,u.itemSize))+R}return{first:v,last:O,viewport:{first:t,last:r}}},fe=function(){var e=de(),t=V.current?V.current.offsetWidth-e.left:0,r=V.current?V.current.offsetHeight-e.top:0,n=function(e,t){return Math.ceil(e/(t||e))},o=function(e){return Math.ceil(e/2)},l=g?{rows:n(r,u.itemSize[0]),cols:n(t,u.itemSize[1])}:n(d?t:r,u.itemSize);return{numItemsInViewport:l,numToleratedItems:D||(g?[o(l.rows),o(l.cols)]:o(l))}},me=function(e){u.autoSize&&!e&&Promise.resolve().then((function(){if(_.current){_.current.style.minHeight=_.current.style.minWidth="auto",_.current.style.position="relative",V.current.style.contain="none";var e=[o.DomHandler.getWidth(V.current),o.DomHandler.getHeight(V.current)],t=e[0],r=e[1];(g||d)&&(V.current.style.width=(t<$.current?t:u.scrollWidth||$.current)+"px"),(g||p)&&(V.current.style.height=(r<G.current?r:u.scrollHeight||G.current)+"px"),_.current.style.minHeight=_.current.style.minWidth="",_.current.style.position="",V.current.style.contain=""}}))},pe=function(){var e;return u.items?Math.min((arguments.length>1?arguments[1]:void 0)?(null===(e=u.columns||u.items[0])||void 0===e?void 0:e.length)||0:(u.items||[]).length,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0):0},de=function(){if(_.current){var e=getComputedStyle(_.current),t=parseFloat(e.paddingLeft)+Math.max(parseFloat(e.left)||0,0),r=parseFloat(e.paddingRight)+Math.max(parseFloat(e.right)||0,0),n=parseFloat(e.paddingTop)+Math.max(parseFloat(e.top)||0,0),o=parseFloat(e.paddingBottom)+Math.max(parseFloat(e.bottom)||0,0);return{left:t,right:r,top:n,bottom:o,x:t+r,y:n+o}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}},ge=function(){if(V.current){var e=V.current.parentElement,t=u.scrollWidth||"".concat(V.current.offsetWidth||e.offsetWidth,"px"),r=u.scrollHeight||"".concat(V.current.offsetHeight||e.offsetHeight,"px"),n=function(e,t){return V.current.style[e]=t};g||d?(n("height",r),n("width",t)):n("height",r)}},he=function(){var e=u.items;if(e){var t=de(),r=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Z.current=S(S({},Z.current),m({},"".concat(e),(t||[]).length*r+n+"px"))};g?(r("height",e,u.itemSize[0],t.y),r("width",u.columns||e[1],u.itemSize[1],t.x)):d?r("width",u.columns||e,u.itemSize,t.x):r("height",e,u.itemSize,t.y)}},ve=function(e){if(_.current&&!u.appendOnly){var t=e?e.first:v,r=function(e,t){return e*t},n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;q.current&&(q.current.style.top="-".concat(t,"px")),Y.current=S(S({},Y.current),{transform:"translate3d(".concat(e,"px, ").concat(t,"px, 0)")})};if(g)n(r(t.cols,u.itemSize[1]),r(t.rows,u.itemSize[0]));else{var o=r(t,u.itemSize);d?n(o,0):n(0,o)}}},ye=function(e){var t=e.target,r=de(),n=function(e,t){return e?e>t?e-t:e:0},o=function(e,t){return Math.floor(e/(t||e))},l=function(e,t,r,n,o,l){return e<=o?o:l?r-n-o:t+o-1},i=function(e,t,r,n,o,l,i){return e<=l?0:Math.max(0,i?e<t?r:e-l:e>t?r:e-2*l)},s=function(e,t,r,n,o,l){var i=t+n+2*o;return e>=o&&(i+=o+1),pe(i,l)},c=n(t.scrollTop,r.top),a=n(t.scrollLeft,r.left),f=g?{rows:0,cols:0}:0,m=O,p=!1,h=J.current;if(g){var y=J.current.top<=c,w=J.current.left<=a;if(!u.appendOnly||u.appendOnly&&(y||w)){var b={rows:o(c,u.itemSize[0]),cols:o(a,u.itemSize[1])},S={rows:l(b.rows,v.rows,O.rows,R.rows,D[0],y),cols:l(b.cols,v.cols,O.cols,R.cols,D[1],w)};f={rows:i(b.rows,S.rows,v.rows,0,0,D[0],y),cols:i(b.cols,S.cols,v.cols,0,0,D[1],w)},m={rows:s(b.rows,f.rows,0,R.rows,D[0]),cols:s(b.cols,f.cols,0,R.cols,D[1],!0)},p=f.rows!==v.rows||m.rows!==O.rows||f.cols!==v.cols||m.cols!==O.cols||ee.current,h={top:c,left:a}}}else{var z=d?a:c,I=J.current<=z;if(!u.appendOnly||u.appendOnly&&I){var T=o(z,u.itemSize);m=s(T,f=i(T,l(T,v,O,R,D,I),v,0,0,D,I),0,R,D),p=f!==v||m!==O||ee.current,h=z}}return{first:f,last:m,isRangeChanged:p,scrollPos:h}},we=function(e){var t=ye(e),r=t.first,n=t.last,o=t.scrollPos;if(t.isRangeChanged){var l={first:r,last:n};if(ve(l),b(r),I(n),J.current=o,u.onScrollIndexChange&&u.onScrollIndexChange(l),u.lazy&&ie(r)){var i={first:u.step?Math.min(le(r)*u.step,(u.items||[]).length-u.step):r,last:Math.min(u.step?(le(r)+1)*u.step:n,(u.items||[]).length)};(!te.current||te.current.first!==i.first||te.current.last!==i.last)&&u.onLazyLoad&&u.onLazyLoad(i),te.current=i}}},be=function(e){if(u.onScroll&&u.onScroll(e),u.delay){if(X.current&&clearTimeout(X.current),ie(v)){if(!U&&u.showLoader)(ye(e).isRangeChanged||!!u.step&&ie(v))&&N(!0);X.current=setTimeout((function(){we(e),!U||!u.showLoader||u.lazy&&void 0!==u.loading||(N(!1),x(le(v)))}),u.delay)}}else we(e)},Se=function(){B.current&&clearTimeout(B.current),B.current=setTimeout((function(){if(V.current){var e=[o.DomHandler.getWidth(V.current),o.DomHandler.getHeight(V.current)],t=e[0],r=e[1],n=t!==$.current,l=r!==G.current;(g?n||l:d?n:!!p&&l)&&(L(u.numToleratedItems),$.current=t,G.current=r,K.current=o.DomHandler.getWidth(_.current),Q.current=o.DomHandler.getHeight(_.current))}}),u.resizeDelay)},ze=function(e){var t=(u.items||[]).length,r=g?v.rows+e:v+e;return{index:r,count:t,first:0===r,last:r===t-1,even:r%2==0,odd:r%2!=0,props:u}},Oe=function(e,t){var r=C.length||0;return S({index:e,count:r,first:0===e,last:e===r-1,even:e%2==0,odd:e%2!=0,props:u},t)},Ie=function(){var e=u.items;return e&&!U?g?e.slice(u.appendOnly?0:v.rows,O.rows).map((function(e){return u.columns?e:e.slice(u.appendOnly?0:v.cols,O.cols)})):d&&u.columns?e:e.slice(u.appendOnly?0:v,O):[]},Te=function(){var e,t,r,n,o;u.disabled||(ge(),e=fe(),t=e.numItemsInViewport,r=e.numToleratedItems,n=function(e,t,r){return pe(e+t+(e<r?2:3)*r,arguments.length>3&&void 0!==arguments[3]&&arguments[3])},o=g?{rows:n(v.rows,t.rows,r[0]),cols:n(v.cols,t.cols,r[1],!0)}:n(v,t,r),H(t),L(r),I(o),u.showLoader&&F(g?Array.from({length:t.rows}).map((function(){return Array.from({length:t.cols})})):Array.from({length:t})),u.lazy&&Promise.resolve().then((function(){te.current={first:u.step?g?{rows:0,cols:v.cols}:0:v,last:Math.min(u.step?u.step:o,(u.items||[]).length)},u.onLazyLoad&&u.onLazyLoad(te.current)})),he())};r.useMountEffect((function(){V.current&&o.DomHandler.isVisible(V.current)&&(_.current=_.current||_.current||o.DomHandler.findSingle(V.current,".p-virtualscroller-content"),Te(),re(),ne(),$.current=o.DomHandler.getWidth(V.current),G.current=o.DomHandler.getHeight(V.current),K.current=o.DomHandler.getWidth(_.current),Q.current=o.DomHandler.getHeight(_.current))})),r.useUpdateEffect((function(){Te()}),[u.itemSize,u.scrollHeight,u.scrollWidth]),r.useUpdateEffect((function(){u.numToleratedItems!==D&&L(u.numToleratedItems)}),[u.numToleratedItems]),r.useUpdateEffect((function(){u.numToleratedItems===D&&Te()}),[D]),r.useUpdateEffect((function(){f.items&&f.items.length===(u.items||[]).length||Te();var e=U;u.lazy&&f.loading!==u.loading&&u.loading!==U&&(N(u.loading),e=u.loading),me(e)})),r.useUpdateEffect((function(){J.current=g?{top:0,left:0}:0}),[u.orientation]),s.useImperativeHandle(l,(function(){return{props:u,getElementRef:oe,scrollTo:se,scrollToIndex:ce,scrollInView:ae,getRenderedRange:ue}}));var je=function(e){var t=Oe(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),r=o.ObjectUtils.getJSXElement(u.loadingTemplate,t);return s.createElement(s.Fragment,{key:e},r)},xe=function(e,t){var r=ze(t),n=o.ObjectUtils.getJSXElement(u.itemTemplate,e,r);return s.createElement(s.Fragment,{key:r.index},n)};if(u.disabled){var Ee=o.ObjectUtils.getJSXElement(u.contentTemplate,{items:u.items,rows:u.items,columns:u.columns});return s.createElement(s.Fragment,null,u.children,Ee)}var Re=o.classNames("p-virtualscroller",{"p-virtualscroller-inline":u.inline,"p-virtualscroller-both p-both-scroll":g,"p-virtualscroller-horizontal p-horizontal-scroll":d},u.className),He=function(){var e="p-virtualscroller-loading-icon",t=i({className:e},A("loadingIcon")),r=u.loadingIcon||s.createElement(n.SpinnerIcon,c({},t,{spin:!0})),l=o.IconUtils.getJSXIcon(r,S({},t),{props:u});if(!u.loaderDisabled&&u.showLoader&&U){var a=o.classNames("p-virtualscroller-loader",{"p-component-overlay":!u.loadingTemplate}),f=l;u.loadingTemplate?f=C.map((function(e,t){return je(t,g&&{numCols:R.cols})})):u.loaderIconTemplate&&(f=o.ObjectUtils.getJSXElement(u.loaderIconTemplate,{iconClassName:e,element:f,props:u}));var m=i({className:a},A("loader"));return s.createElement("div",m,f)}return null}(),Pe=function(){var e=Ie().map(xe),t=o.classNames("p-virtualscroller-content",{"p-virtualscroller-loading":U}),r=i({ref:_,style:Y.current,className:t},A("content")),n=s.createElement("div",r,e);if(u.contentTemplate){var l={style:Y.current,className:t,spacerStyle:Z.current,contentRef:function(e){return _.current=o.ObjectUtils.getRefElement(e)},spacerRef:function(e){return k.current=o.ObjectUtils.getRefElement(e)},stickyRef:function(e){return q.current=o.ObjectUtils.getRefElement(e)},items:Ie(),getItemOptions:function(e){return ze(e)},children:e,element:n,props:u,loading:U,getLoaderOptions:function(e,t){return Oe(e,t)},loadingTemplate:u.loadingTemplate,itemSize:u.itemSize,rows:U?u.loaderDisabled?C:[]:Ie(),columns:u.columns&&g||d?U&&u.loaderDisabled?g?C[0]:C:u.columns.slice(g?v.cols:v,g?O.cols:O):u.columns,vertical:p,horizontal:d,both:g};return o.ObjectUtils.getJSXElement(u.contentTemplate,l)}return n}(),De=function(){if(u.showSpacer){var e=i({ref:k,style:Z.current,className:"p-virtualscroller-spacer"},A("spacer"));return s.createElement("div",e)}return null}(),Le=i({ref:V,className:Re,tabIndex:u.tabIndex,style:u.style,onScroll:function(e){return be(e)}},w.getOtherProps(u),A("root"));return s.createElement("div",Le,Pe,De,He)})));z.displayName="VirtualScroller",exports.VirtualScroller=z;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { usePrevious, useStyle, useResizeListener, useEventListener, useMountEffect, useUpdateEffect } from 'primereact/hooks';
|
|
4
|
-
import { DomHandler, ObjectUtils, classNames, mergeProps, IconUtils } from 'primereact/utils';
|
|
5
|
-
import { ComponentBase } from 'primereact/componentbase';
|
|
6
|
-
import { SpinnerIcon } from 'primereact/icons/spinner';
|
|
7
3
|
import { PrimeReactContext } from 'primereact/api';
|
|
4
|
+
import { useMergeProps, usePrevious, useStyle, useResizeListener, useEventListener, useMountEffect, useUpdateEffect } from 'primereact/hooks';
|
|
5
|
+
import { SpinnerIcon } from 'primereact/icons/spinner';
|
|
6
|
+
import { DomHandler, ObjectUtils, classNames, IconUtils } from 'primereact/utils';
|
|
7
|
+
import { ComponentBase } from 'primereact/componentbase';
|
|
8
8
|
|
|
9
9
|
function _extends() {
|
|
10
10
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -163,6 +163,7 @@ var VirtualScrollerBase = ComponentBase.extend({
|
|
|
163
163
|
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; }
|
|
164
164
|
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; }
|
|
165
165
|
var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
166
|
+
var mergeProps = useMergeProps();
|
|
166
167
|
var context = React.useContext(PrimeReactContext);
|
|
167
168
|
var props = VirtualScrollerBase.getProps(inProps, context);
|
|
168
169
|
var prevProps = usePrevious(inProps) || {};
|
|
@@ -463,7 +464,7 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
463
464
|
rows: 0,
|
|
464
465
|
cols: firstState.cols
|
|
465
466
|
} : 0 : firstState,
|
|
466
|
-
last: Math.min(props.step ? props.step : last, props.items.length)
|
|
467
|
+
last: Math.min(props.step ? props.step : last, (props.items || []).length)
|
|
467
468
|
};
|
|
468
469
|
props.onLazyLoad && props.onLazyLoad(lazyLoadState.current);
|
|
469
470
|
});
|
|
@@ -494,9 +495,10 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
494
495
|
}
|
|
495
496
|
};
|
|
496
497
|
var getLast = function getLast() {
|
|
498
|
+
var _ref2;
|
|
497
499
|
var last = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
498
500
|
var isCols = arguments.length > 1 ? arguments[1] : undefined;
|
|
499
|
-
return props.items ? Math.min(isCols ? (props.columns || props.items[0]).length : props.items.length, last) : 0;
|
|
501
|
+
return props.items ? Math.min(isCols ? ((_ref2 = props.columns || props.items[0]) === null || _ref2 === void 0 ? void 0 : _ref2.length) || 0 : (props.items || []).length, last) : 0;
|
|
500
502
|
};
|
|
501
503
|
var getContentPosition = function getContentPosition() {
|
|
502
504
|
if (_contentRef.current) {
|
|
@@ -671,8 +673,8 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
671
673
|
props.onScrollIndexChange && props.onScrollIndexChange(newState);
|
|
672
674
|
if (props.lazy && isPageChanged(first)) {
|
|
673
675
|
var newLazyLoadState = {
|
|
674
|
-
first: props.step ? Math.min(getPageByFirst(first) * props.step, props.items.length - props.step) : first,
|
|
675
|
-
last: Math.min(props.step ? (getPageByFirst(first) + 1) * props.step : last, props.items.length)
|
|
676
|
+
first: props.step ? Math.min(getPageByFirst(first) * props.step, (props.items || []).length - props.step) : first,
|
|
677
|
+
last: Math.min(props.step ? (getPageByFirst(first) + 1) * props.step : last, (props.items || []).length)
|
|
676
678
|
};
|
|
677
679
|
var isLazyStateChanged = !lazyLoadState.current || lazyLoadState.current.first !== newLazyLoadState.first || lazyLoadState.current.last !== newLazyLoadState.last;
|
|
678
680
|
isLazyStateChanged && props.onLazyLoad && props.onLazyLoad(newLazyLoadState);
|
|
@@ -711,9 +713,9 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
711
713
|
}
|
|
712
714
|
resizeTimeout.current = setTimeout(function () {
|
|
713
715
|
if (elementRef.current) {
|
|
714
|
-
var
|
|
715
|
-
width =
|
|
716
|
-
height =
|
|
716
|
+
var _ref3 = [DomHandler.getWidth(elementRef.current), DomHandler.getHeight(elementRef.current)],
|
|
717
|
+
width = _ref3[0],
|
|
718
|
+
height = _ref3[1];
|
|
717
719
|
var isDiffWidth = width !== defaultWidth.current,
|
|
718
720
|
isDiffHeight = height !== defaultHeight.current;
|
|
719
721
|
var reinit = both ? isDiffWidth || isDiffHeight : horizontal ? isDiffWidth : vertical ? isDiffHeight : false;
|
|
@@ -741,7 +743,7 @@ var VirtualScroller = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
|
|
|
741
743
|
};
|
|
742
744
|
};
|
|
743
745
|
var loaderOptions = function loaderOptions(index, extOptions) {
|
|
744
|
-
var count = loaderArrState.length;
|
|
746
|
+
var count = loaderArrState.length || 0;
|
|
745
747
|
return _objectSpread({
|
|
746
748
|
index: index,
|
|
747
749
|
count: count,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{usePrevious as t,useStyle as r,useResizeListener as n,useEventListener as o,useMountEffect as l,useUpdateEffect as i}from"primereact/hooks";import{DomHandler as s,ObjectUtils as c,classNames as a,mergeProps as u,IconUtils as f}from"primereact/utils";import{ComponentBase as m}from"primereact/componentbase";import{SpinnerIcon as p}from"primereact/icons/spinner";import{PrimeReactContext as d}from"primereact/api";function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(this,arguments)}function g(e){return g="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},g(e)}function v(e,t){if("object"!==g(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function y(e){var t=v(e,"string");return"symbol"===g(t)?t:String(t)}function w(e,t,r){return(t=y(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e){if(Array.isArray(e))return e}function b(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,l,i,s=[],c=!0,a=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=l.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(a)throw o}}return s}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function T(e,t){if(e){if("string"==typeof e)return z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?z(e,t):void 0}}function I(){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 S(e)||b(e,t)||T(e,t)||I()}var x=m.extend({defaultProps:{__TYPE:"VirtualScroller",__parentMetadata:null,id:null,style:null,className:null,tabIndex:0,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",step:0,numToleratedItems:null,delay:0,resizeDelay:10,appendOnly:!1,inline:!1,lazy:!1,disabled:!1,loaderDisabled:!1,loadingIcon:null,columns:null,loading:void 0,autoSize:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,loaderIconTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null,children:void 0},css:{styles:"\n.p-virtualscroller {\n position: relative;\n overflow: auto;\n contain: strict;\n transform: translateZ(0);\n will-change: scroll-position;\n outline: 0 none;\n}\n\n.p-virtualscroller-content {\n position: absolute;\n top: 0;\n left: 0;\n /*contain: content;*/\n min-height: 100%;\n min-width: 100%;\n will-change: transform;\n}\n\n.p-virtualscroller-spacer {\n position: absolute;\n top: 0;\n left: 0;\n height: 1px;\n width: 1px;\n transform-origin: 0 0;\n pointer-events: none;\n}\n\n.p-virtualscroller-loader {\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.p-virtualscroller-loader.p-component-overlay {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-virtualscroller-loading-icon {\n font-size: 2rem;\n}\n\n.p-virtualscroller-horizontal > .p-virtualscroller-content {\n display: flex;\n}\n\n/* Inline */\n.p-virtualscroller-inline .p-virtualscroller-content {\n position: static;\n}\n"}});function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E=e.memo(e.forwardRef((function(m,g){var v=e.useContext(d),y=x.getProps(m,v),S=t(m)||{},b="vertical"===y.orientation,z="horizontal"===y.orientation,T="both"===y.orientation,I=O(e.useState(T?{rows:0,cols:0}:0),2),R=I[0],E=I[1],P=O(e.useState(T?{rows:0,cols:0}:0),2),L=P[0],M=P[1],H=O(e.useState(0),2),W=H[0],C=H[1],D=O(e.useState(T?{rows:0,cols:0}:0),2),F=D[0],N=D[1],A=O(e.useState(y.numToleratedItems),2),V=A[0],k=A[1],J=O(e.useState(y.loading||!1),2),X=J[0],_=J[1],B=O(e.useState([]),2),U=B[0],Y=B[1],Z=x.setMetaData({props:y,state:{first:R,last:L,page:W,numItemsInViewport:F,numToleratedItems:V,loading:X,loaderArr:U}}).ptm;r(x.css.styles,{name:"virtualscroller"});var $=e.useRef(null),q=e.useRef(null),G=e.useRef(null),K=e.useRef(null),Q=e.useRef(T?{top:0,left:0}:0),ee=e.useRef(null),te=e.useRef(null),re=e.useRef({}),ne=e.useRef({}),oe=e.useRef(null),le=e.useRef(null),ie=e.useRef(null),se=e.useRef(null),ce=e.useRef(!1),ae=e.useRef(null),ue=O(n({listener:function(e){return Ee()},when:!y.disabled}),1)[0],fe=O(o({target:"window",type:"orientationchange",listener:function(e){return Ee()},when:!y.disabled}),1)[0],me=function(){return $},pe=function(e){return Math.floor((e+4*V)/(y.step||1))},de=function(e){return!y.step||W!==pe(e)},he=function(e){Q.current=T?{top:0,left:0}:0,$.current&&$.current.scrollTo(e)},ge=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",r=we().numToleratedItems,n=ze(),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<=(arguments.length>1?arguments[1]:void 0)?0:e},l=function(e,t,r){return e*t+r},i=function(){return he({left:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,top:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,behavior:t})},s=T?{rows:0,cols:0}:0,c=!1;T?(i(l((s={rows:o(e[0],r[0]),cols:o(e[1],r[1])}).cols,y.itemSize[1],n.left),l(s.rows,y.itemSize[0],n.top)),c=R.rows!==s.rows||R.cols!==s.cols):(s=o(e,r),z?i(l(s,y.itemSize,n.left),0):i(0,l(s,y.itemSize,n.top)),c=R!==s),ce.current=c,E(s)},ve=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(t){var n=ye(),o=n.first,l=n.viewport,i=function(){return he({left:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,top:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,behavior:r})},s="to-end"===t;if("to-start"===t){if(T)l.first.rows-o.rows>e[0]?i(l.first.cols*y.itemSize[1],(l.first.rows-1)*y.itemSize[0]):l.first.cols-o.cols>e[1]&&i((l.first.cols-1)*y.itemSize[1],l.first.rows*y.itemSize[0]);else if(l.first-o>e){var c=(l.first-1)*y.itemSize;z?i(c,0):i(0,c)}}else if(s)if(T)l.last.rows-o.rows<=e[0]+1?i(l.first.cols*y.itemSize[1],(l.first.rows+1)*y.itemSize[0]):l.last.cols-o.cols<=e[1]+1&&i((l.first.cols+1)*y.itemSize[1],l.first.rows*y.itemSize[0]);else if(l.last-o<=e+1){var a=(l.first+1)*y.itemSize;z?i(a,0):i(0,a)}}else ge(e,r)},ye=function(){var e=function(e,t){return Math.floor(e/(t||e))},t=R,r=0;if($.current){var n=$.current,o=n.scrollTop,l=n.scrollLeft;if(T)r={rows:(t={rows:e(o,y.itemSize[0]),cols:e(l,y.itemSize[1])}).rows+F.rows,cols:t.cols+F.cols};else r=(t=e(z?l:o,y.itemSize))+F}return{first:R,last:L,viewport:{first:t,last:r}}},we=function(){var e=ze(),t=$.current?$.current.offsetWidth-e.left:0,r=$.current?$.current.offsetHeight-e.top:0,n=function(e,t){return Math.ceil(e/(t||e))},o=function(e){return Math.ceil(e/2)},l=T?{rows:n(r,y.itemSize[0]),cols:n(t,y.itemSize[1])}:n(z?t:r,y.itemSize);return{numItemsInViewport:l,numToleratedItems:V||(T?[o(l.rows),o(l.cols)]:o(l))}},Se=function(e){y.autoSize&&!e&&Promise.resolve().then((function(){if(q.current){q.current.style.minHeight=q.current.style.minWidth="auto",q.current.style.position="relative",$.current.style.contain="none";var e=[s.getWidth($.current),s.getHeight($.current)],t=e[0],r=e[1];(T||z)&&($.current.style.width=(t<oe.current?t:y.scrollWidth||oe.current)+"px"),(T||b)&&($.current.style.height=(r<le.current?r:y.scrollHeight||le.current)+"px"),q.current.style.minHeight=q.current.style.minWidth="",q.current.style.position="",$.current.style.contain=""}}))},be=function(){return y.items?Math.min((arguments.length>1?arguments[1]:void 0)?(y.columns||y.items[0]).length:y.items.length,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0):0},ze=function(){if(q.current){var e=getComputedStyle(q.current),t=parseFloat(e.paddingLeft)+Math.max(parseFloat(e.left)||0,0),r=parseFloat(e.paddingRight)+Math.max(parseFloat(e.right)||0,0),n=parseFloat(e.paddingTop)+Math.max(parseFloat(e.top)||0,0),o=parseFloat(e.paddingBottom)+Math.max(parseFloat(e.bottom)||0,0);return{left:t,right:r,top:n,bottom:o,x:t+r,y:n+o}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}},Te=function(){if($.current){var e=$.current.parentElement,t=y.scrollWidth||"".concat($.current.offsetWidth||e.offsetWidth,"px"),r=y.scrollHeight||"".concat($.current.offsetHeight||e.offsetHeight,"px"),n=function(e,t){return $.current.style[e]=t};T||z?(n("height",r),n("width",t)):n("height",r)}},Ie=function(){var e=y.items;if(e){var t=ze(),r=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return ne.current=j(j({},ne.current),w({},"".concat(e),(t||[]).length*r+n+"px"))};T?(r("height",e,y.itemSize[0],t.y),r("width",y.columns||e[1],y.itemSize[1],t.x)):z?r("width",y.columns||e,y.itemSize,t.x):r("height",e,y.itemSize,t.y)}},Oe=function(e){if(q.current&&!y.appendOnly){var t=e?e.first:R,r=function(e,t){return e*t},n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;K.current&&(K.current.style.top="-".concat(t,"px")),re.current=j(j({},re.current),{transform:"translate3d(".concat(e,"px, ").concat(t,"px, 0)")})};if(T)n(r(t.cols,y.itemSize[1]),r(t.rows,y.itemSize[0]));else{var o=r(t,y.itemSize);z?n(o,0):n(0,o)}}},xe=function(e){var t=e.target,r=ze(),n=function(e,t){return e?e>t?e-t:e:0},o=function(e,t){return Math.floor(e/(t||e))},l=function(e,t,r,n,o,l){return e<=o?o:l?r-n-o:t+o-1},i=function(e,t,r,n,o,l,i){return e<=l?0:Math.max(0,i?e<t?r:e-l:e>t?r:e-2*l)},s=function(e,t,r,n,o,l){var i=t+n+2*o;return e>=o&&(i+=o+1),be(i,l)},c=n(t.scrollTop,r.top),a=n(t.scrollLeft,r.left),u=T?{rows:0,cols:0}:0,f=L,m=!1,p=Q.current;if(T){var d=Q.current.top<=c,h=Q.current.left<=a;if(!y.appendOnly||y.appendOnly&&(d||h)){var g={rows:o(c,y.itemSize[0]),cols:o(a,y.itemSize[1])},v={rows:l(g.rows,R.rows,L.rows,F.rows,V[0],d),cols:l(g.cols,R.cols,L.cols,F.cols,V[1],h)};u={rows:i(g.rows,v.rows,R.rows,0,0,V[0],d),cols:i(g.cols,v.cols,R.cols,0,0,V[1],h)},f={rows:s(g.rows,u.rows,0,F.rows,V[0]),cols:s(g.cols,u.cols,0,F.cols,V[1],!0)},m=u.rows!==R.rows||f.rows!==L.rows||u.cols!==R.cols||f.cols!==L.cols||ce.current,p={top:c,left:a}}}else{var w=z?a:c,S=Q.current<=w;if(!y.appendOnly||y.appendOnly&&S){var b=o(w,y.itemSize);f=s(b,u=i(b,l(b,R,L,F,V,S),R,0,0,V,S),0,F,V),m=u!==R||f!==L||ce.current,p=w}}return{first:u,last:f,isRangeChanged:m,scrollPos:p}},Re=function(e){var t=xe(e),r=t.first,n=t.last,o=t.scrollPos;if(t.isRangeChanged){var l={first:r,last:n};if(Oe(l),E(r),M(n),Q.current=o,y.onScrollIndexChange&&y.onScrollIndexChange(l),y.lazy&&de(r)){var i={first:y.step?Math.min(pe(r)*y.step,y.items.length-y.step):r,last:Math.min(y.step?(pe(r)+1)*y.step:n,y.items.length)};(!ae.current||ae.current.first!==i.first||ae.current.last!==i.last)&&y.onLazyLoad&&y.onLazyLoad(i),ae.current=i}}},je=function(e){if(y.onScroll&&y.onScroll(e),y.delay){if(ee.current&&clearTimeout(ee.current),de(R)){if(!X&&y.showLoader)(xe(e).isRangeChanged||!!y.step&&de(R))&&_(!0);ee.current=setTimeout((function(){Re(e),!X||!y.showLoader||y.lazy&&void 0!==y.loading||(_(!1),C(pe(R)))}),y.delay)}}else Re(e)},Ee=function(){te.current&&clearTimeout(te.current),te.current=setTimeout((function(){if($.current){var e=[s.getWidth($.current),s.getHeight($.current)],t=e[0],r=e[1],n=t!==oe.current,o=r!==le.current;(T?n||o:z?n:!!b&&o)&&(k(y.numToleratedItems),oe.current=t,le.current=r,ie.current=s.getWidth(q.current),se.current=s.getHeight(q.current))}}),y.resizeDelay)},Pe=function(e){var t=(y.items||[]).length,r=T?R.rows+e:R+e;return{index:r,count:t,first:0===r,last:r===t-1,even:r%2==0,odd:r%2!=0,props:y}},Le=function(e,t){var r=U.length;return j({index:e,count:r,first:0===e,last:e===r-1,even:e%2==0,odd:e%2!=0,props:y},t)},Me=function(){var e=y.items;return e&&!X?T?e.slice(y.appendOnly?0:R.rows,L.rows).map((function(e){return y.columns?e:e.slice(y.appendOnly?0:R.cols,L.cols)})):z&&y.columns?e:e.slice(y.appendOnly?0:R,L):[]},He=function(){var e,t,r,n,o;y.disabled||(Te(),e=we(),t=e.numItemsInViewport,r=e.numToleratedItems,n=function(e,t,r){return be(e+t+(e<r?2:3)*r,arguments.length>3&&void 0!==arguments[3]&&arguments[3])},o=T?{rows:n(R.rows,t.rows,r[0]),cols:n(R.cols,t.cols,r[1],!0)}:n(R,t,r),N(t),k(r),M(o),y.showLoader&&Y(T?Array.from({length:t.rows}).map((function(){return Array.from({length:t.cols})})):Array.from({length:t})),y.lazy&&Promise.resolve().then((function(){ae.current={first:y.step?T?{rows:0,cols:R.cols}:0:R,last:Math.min(y.step?y.step:o,y.items.length)},y.onLazyLoad&&y.onLazyLoad(ae.current)})),Ie())};l((function(){$.current&&s.isVisible($.current)&&(q.current=q.current||q.current||s.findSingle($.current,".p-virtualscroller-content"),He(),ue(),fe(),oe.current=s.getWidth($.current),le.current=s.getHeight($.current),ie.current=s.getWidth(q.current),se.current=s.getHeight(q.current))})),i((function(){He()}),[y.itemSize,y.scrollHeight,y.scrollWidth]),i((function(){y.numToleratedItems!==V&&k(y.numToleratedItems)}),[y.numToleratedItems]),i((function(){y.numToleratedItems===V&&He()}),[V]),i((function(){S.items&&S.items.length===(y.items||[]).length||He();var e=X;y.lazy&&S.loading!==y.loading&&y.loading!==X&&(_(y.loading),e=y.loading),Se(e)})),i((function(){Q.current=T?{top:0,left:0}:0}),[y.orientation]),e.useImperativeHandle(g,(function(){return{props:y,getElementRef:me,scrollTo:he,scrollToIndex:ge,scrollInView:ve,getRenderedRange:ye}}));var We=function(t){var r=Le(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),n=c.getJSXElement(y.loadingTemplate,r);return e.createElement(e.Fragment,{key:t},n)},Ce=function(t,r){var n=Pe(r),o=c.getJSXElement(y.itemTemplate,t,n);return e.createElement(e.Fragment,{key:n.index},o)};if(y.disabled){var De=c.getJSXElement(y.contentTemplate,{items:y.items,rows:y.items,columns:y.columns});return e.createElement(e.Fragment,null,y.children,De)}var Fe=a("p-virtualscroller",{"p-virtualscroller-inline":y.inline,"p-virtualscroller-both p-both-scroll":T,"p-virtualscroller-horizontal p-horizontal-scroll":z},y.className),Ne=function(){var t="p-virtualscroller-loading-icon",r=u({className:t},Z("loadingIcon")),n=y.loadingIcon||e.createElement(p,h({},r,{spin:!0})),o=f.getJSXIcon(n,j({},r),{props:y});if(!y.loaderDisabled&&y.showLoader&&X){var l=a("p-virtualscroller-loader",{"p-component-overlay":!y.loadingTemplate}),i=o;y.loadingTemplate?i=U.map((function(e,t){return We(t,T&&{numCols:F.cols})})):y.loaderIconTemplate&&(i=c.getJSXElement(y.loaderIconTemplate,{iconClassName:t,element:i,props:y}));var s=u({className:l},Z("loader"));return e.createElement("div",s,i)}return null}(),Ae=function(){var t=Me().map(Ce),r=a("p-virtualscroller-content",{"p-virtualscroller-loading":X}),n=u({ref:q,style:re.current,className:r},Z("content")),o=e.createElement("div",n,t);if(y.contentTemplate){var l={style:re.current,className:r,spacerStyle:ne.current,contentRef:function(e){return q.current=c.getRefElement(e)},spacerRef:function(e){return G.current=c.getRefElement(e)},stickyRef:function(e){return K.current=c.getRefElement(e)},items:Me(),getItemOptions:function(e){return Pe(e)},children:t,element:o,props:y,loading:X,getLoaderOptions:function(e,t){return Le(e,t)},loadingTemplate:y.loadingTemplate,itemSize:y.itemSize,rows:X?y.loaderDisabled?U:[]:Me(),columns:y.columns&&T||z?X&&y.loaderDisabled?T?U[0]:U:y.columns.slice(T?R.cols:R,T?L.cols:L):y.columns,vertical:b,horizontal:z,both:T};return c.getJSXElement(y.contentTemplate,l)}return o}(),Ve=function(){if(y.showSpacer){var t=u({ref:G,style:ne.current,className:"p-virtualscroller-spacer"},Z("spacer"));return e.createElement("div",t)}return null}(),ke=u({ref:$,className:Fe,tabIndex:y.tabIndex,style:y.style,onScroll:function(e){return je(e)}},x.getOtherProps(y),Z("root"));return e.createElement("div",ke,Ae,Ve,Ne)})));E.displayName="VirtualScroller";export{E as VirtualScroller};
|
|
1
|
+
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{useMergeProps as r,usePrevious as n,useStyle as o,useResizeListener as l,useEventListener as i,useMountEffect as s,useUpdateEffect as c}from"primereact/hooks";import{SpinnerIcon as a}from"primereact/icons/spinner";import{DomHandler as u,ObjectUtils as f,classNames as m,IconUtils as p}from"primereact/utils";import{ComponentBase as d}from"primereact/componentbase";function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(this,arguments)}function g(e){return g="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},g(e)}function v(e,t){if("object"!==g(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function y(e){var t=v(e,"string");return"symbol"===g(t)?t:String(t)}function w(e,t,r){return(t=y(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e){if(Array.isArray(e))return e}function b(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,l,i,s=[],c=!0,a=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=l.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(a)throw o}}return s}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function T(e,t){if(e){if("string"==typeof e)return z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?z(e,t):void 0}}function I(){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 S(e)||b(e,t)||T(e,t)||I()}var x=d.extend({defaultProps:{__TYPE:"VirtualScroller",__parentMetadata:null,id:null,style:null,className:null,tabIndex:0,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",step:0,numToleratedItems:null,delay:0,resizeDelay:10,appendOnly:!1,inline:!1,lazy:!1,disabled:!1,loaderDisabled:!1,loadingIcon:null,columns:null,loading:void 0,autoSize:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,loaderIconTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null,children:void 0},css:{styles:"\n.p-virtualscroller {\n position: relative;\n overflow: auto;\n contain: strict;\n transform: translateZ(0);\n will-change: scroll-position;\n outline: 0 none;\n}\n\n.p-virtualscroller-content {\n position: absolute;\n top: 0;\n left: 0;\n /*contain: content;*/\n min-height: 100%;\n min-width: 100%;\n will-change: transform;\n}\n\n.p-virtualscroller-spacer {\n position: absolute;\n top: 0;\n left: 0;\n height: 1px;\n width: 1px;\n transform-origin: 0 0;\n pointer-events: none;\n}\n\n.p-virtualscroller-loader {\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.p-virtualscroller-loader.p-component-overlay {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-virtualscroller-loading-icon {\n font-size: 2rem;\n}\n\n.p-virtualscroller-horizontal > .p-virtualscroller-content {\n display: flex;\n}\n\n/* Inline */\n.p-virtualscroller-inline .p-virtualscroller-content {\n position: static;\n}\n"}});function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E=e.memo(e.forwardRef((function(d,g){var v=r(),y=e.useContext(t),S=x.getProps(d,y),b=n(d)||{},z="vertical"===S.orientation,T="horizontal"===S.orientation,I="both"===S.orientation,R=O(e.useState(I?{rows:0,cols:0}:0),2),E=R[0],P=R[1],L=O(e.useState(I?{rows:0,cols:0}:0),2),M=L[0],H=L[1],W=O(e.useState(0),2),C=W[0],D=W[1],F=O(e.useState(I?{rows:0,cols:0}:0),2),N=F[0],A=F[1],V=O(e.useState(S.numToleratedItems),2),k=V[0],J=V[1],X=O(e.useState(S.loading||!1),2),_=X[0],B=X[1],U=O(e.useState([]),2),Y=U[0],Z=U[1],$=x.setMetaData({props:S,state:{first:E,last:M,page:C,numItemsInViewport:N,numToleratedItems:k,loading:_,loaderArr:Y}}).ptm;o(x.css.styles,{name:"virtualscroller"});var q=e.useRef(null),G=e.useRef(null),K=e.useRef(null),Q=e.useRef(null),ee=e.useRef(I?{top:0,left:0}:0),te=e.useRef(null),re=e.useRef(null),ne=e.useRef({}),oe=e.useRef({}),le=e.useRef(null),ie=e.useRef(null),se=e.useRef(null),ce=e.useRef(null),ae=e.useRef(!1),ue=e.useRef(null),fe=O(l({listener:function(e){return Pe()},when:!S.disabled}),1)[0],me=O(i({target:"window",type:"orientationchange",listener:function(e){return Pe()},when:!S.disabled}),1)[0],pe=function(){return q},de=function(e){return Math.floor((e+4*k)/(S.step||1))},he=function(e){return!S.step||C!==de(e)},ge=function(e){ee.current=I?{top:0,left:0}:0,q.current&&q.current.scrollTo(e)},ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",r=Se().numToleratedItems,n=Te(),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<=(arguments.length>1?arguments[1]:void 0)?0:e},l=function(e,t,r){return e*t+r},i=function(){return ge({left:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,top:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,behavior:t})},s=I?{rows:0,cols:0}:0,c=!1;I?(i(l((s={rows:o(e[0],r[0]),cols:o(e[1],r[1])}).cols,S.itemSize[1],n.left),l(s.rows,S.itemSize[0],n.top)),c=E.rows!==s.rows||E.cols!==s.cols):(s=o(e,r),T?i(l(s,S.itemSize,n.left),0):i(0,l(s,S.itemSize,n.top)),c=E!==s),ae.current=c,P(s)},ye=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(t){var n=we(),o=n.first,l=n.viewport,i=function(){return ge({left:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,top:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,behavior:r})},s="to-end"===t;if("to-start"===t){if(I)l.first.rows-o.rows>e[0]?i(l.first.cols*S.itemSize[1],(l.first.rows-1)*S.itemSize[0]):l.first.cols-o.cols>e[1]&&i((l.first.cols-1)*S.itemSize[1],l.first.rows*S.itemSize[0]);else if(l.first-o>e){var c=(l.first-1)*S.itemSize;T?i(c,0):i(0,c)}}else if(s)if(I)l.last.rows-o.rows<=e[0]+1?i(l.first.cols*S.itemSize[1],(l.first.rows+1)*S.itemSize[0]):l.last.cols-o.cols<=e[1]+1&&i((l.first.cols+1)*S.itemSize[1],l.first.rows*S.itemSize[0]);else if(l.last-o<=e+1){var a=(l.first+1)*S.itemSize;T?i(a,0):i(0,a)}}else ve(e,r)},we=function(){var e=function(e,t){return Math.floor(e/(t||e))},t=E,r=0;if(q.current){var n=q.current,o=n.scrollTop,l=n.scrollLeft;if(I)r={rows:(t={rows:e(o,S.itemSize[0]),cols:e(l,S.itemSize[1])}).rows+N.rows,cols:t.cols+N.cols};else r=(t=e(T?l:o,S.itemSize))+N}return{first:E,last:M,viewport:{first:t,last:r}}},Se=function(){var e=Te(),t=q.current?q.current.offsetWidth-e.left:0,r=q.current?q.current.offsetHeight-e.top:0,n=function(e,t){return Math.ceil(e/(t||e))},o=function(e){return Math.ceil(e/2)},l=I?{rows:n(r,S.itemSize[0]),cols:n(t,S.itemSize[1])}:n(T?t:r,S.itemSize);return{numItemsInViewport:l,numToleratedItems:k||(I?[o(l.rows),o(l.cols)]:o(l))}},be=function(e){S.autoSize&&!e&&Promise.resolve().then((function(){if(G.current){G.current.style.minHeight=G.current.style.minWidth="auto",G.current.style.position="relative",q.current.style.contain="none";var e=[u.getWidth(q.current),u.getHeight(q.current)],t=e[0],r=e[1];(I||T)&&(q.current.style.width=(t<le.current?t:S.scrollWidth||le.current)+"px"),(I||z)&&(q.current.style.height=(r<ie.current?r:S.scrollHeight||ie.current)+"px"),G.current.style.minHeight=G.current.style.minWidth="",G.current.style.position="",q.current.style.contain=""}}))},ze=function(){var e;return S.items?Math.min((arguments.length>1?arguments[1]:void 0)?(null===(e=S.columns||S.items[0])||void 0===e?void 0:e.length)||0:(S.items||[]).length,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0):0},Te=function(){if(G.current){var e=getComputedStyle(G.current),t=parseFloat(e.paddingLeft)+Math.max(parseFloat(e.left)||0,0),r=parseFloat(e.paddingRight)+Math.max(parseFloat(e.right)||0,0),n=parseFloat(e.paddingTop)+Math.max(parseFloat(e.top)||0,0),o=parseFloat(e.paddingBottom)+Math.max(parseFloat(e.bottom)||0,0);return{left:t,right:r,top:n,bottom:o,x:t+r,y:n+o}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}},Ie=function(){if(q.current){var e=q.current.parentElement,t=S.scrollWidth||"".concat(q.current.offsetWidth||e.offsetWidth,"px"),r=S.scrollHeight||"".concat(q.current.offsetHeight||e.offsetHeight,"px"),n=function(e,t){return q.current.style[e]=t};I||T?(n("height",r),n("width",t)):n("height",r)}},Oe=function(){var e=S.items;if(e){var t=Te(),r=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return oe.current=j(j({},oe.current),w({},"".concat(e),(t||[]).length*r+n+"px"))};I?(r("height",e,S.itemSize[0],t.y),r("width",S.columns||e[1],S.itemSize[1],t.x)):T?r("width",S.columns||e,S.itemSize,t.x):r("height",e,S.itemSize,t.y)}},xe=function(e){if(G.current&&!S.appendOnly){var t=e?e.first:E,r=function(e,t){return e*t},n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Q.current&&(Q.current.style.top="-".concat(t,"px")),ne.current=j(j({},ne.current),{transform:"translate3d(".concat(e,"px, ").concat(t,"px, 0)")})};if(I)n(r(t.cols,S.itemSize[1]),r(t.rows,S.itemSize[0]));else{var o=r(t,S.itemSize);T?n(o,0):n(0,o)}}},Re=function(e){var t=e.target,r=Te(),n=function(e,t){return e?e>t?e-t:e:0},o=function(e,t){return Math.floor(e/(t||e))},l=function(e,t,r,n,o,l){return e<=o?o:l?r-n-o:t+o-1},i=function(e,t,r,n,o,l,i){return e<=l?0:Math.max(0,i?e<t?r:e-l:e>t?r:e-2*l)},s=function(e,t,r,n,o,l){var i=t+n+2*o;return e>=o&&(i+=o+1),ze(i,l)},c=n(t.scrollTop,r.top),a=n(t.scrollLeft,r.left),u=I?{rows:0,cols:0}:0,f=M,m=!1,p=ee.current;if(I){var d=ee.current.top<=c,h=ee.current.left<=a;if(!S.appendOnly||S.appendOnly&&(d||h)){var g={rows:o(c,S.itemSize[0]),cols:o(a,S.itemSize[1])},v={rows:l(g.rows,E.rows,M.rows,N.rows,k[0],d),cols:l(g.cols,E.cols,M.cols,N.cols,k[1],h)};u={rows:i(g.rows,v.rows,E.rows,0,0,k[0],d),cols:i(g.cols,v.cols,E.cols,0,0,k[1],h)},f={rows:s(g.rows,u.rows,0,N.rows,k[0]),cols:s(g.cols,u.cols,0,N.cols,k[1],!0)},m=u.rows!==E.rows||f.rows!==M.rows||u.cols!==E.cols||f.cols!==M.cols||ae.current,p={top:c,left:a}}}else{var y=T?a:c,w=ee.current<=y;if(!S.appendOnly||S.appendOnly&&w){var b=o(y,S.itemSize);f=s(b,u=i(b,l(b,E,M,N,k,w),E,0,0,k,w),0,N,k),m=u!==E||f!==M||ae.current,p=y}}return{first:u,last:f,isRangeChanged:m,scrollPos:p}},je=function(e){var t=Re(e),r=t.first,n=t.last,o=t.scrollPos;if(t.isRangeChanged){var l={first:r,last:n};if(xe(l),P(r),H(n),ee.current=o,S.onScrollIndexChange&&S.onScrollIndexChange(l),S.lazy&&he(r)){var i={first:S.step?Math.min(de(r)*S.step,(S.items||[]).length-S.step):r,last:Math.min(S.step?(de(r)+1)*S.step:n,(S.items||[]).length)};(!ue.current||ue.current.first!==i.first||ue.current.last!==i.last)&&S.onLazyLoad&&S.onLazyLoad(i),ue.current=i}}},Ee=function(e){if(S.onScroll&&S.onScroll(e),S.delay){if(te.current&&clearTimeout(te.current),he(E)){if(!_&&S.showLoader)(Re(e).isRangeChanged||!!S.step&&he(E))&&B(!0);te.current=setTimeout((function(){je(e),!_||!S.showLoader||S.lazy&&void 0!==S.loading||(B(!1),D(de(E)))}),S.delay)}}else je(e)},Pe=function(){re.current&&clearTimeout(re.current),re.current=setTimeout((function(){if(q.current){var e=[u.getWidth(q.current),u.getHeight(q.current)],t=e[0],r=e[1],n=t!==le.current,o=r!==ie.current;(I?n||o:T?n:!!z&&o)&&(J(S.numToleratedItems),le.current=t,ie.current=r,se.current=u.getWidth(G.current),ce.current=u.getHeight(G.current))}}),S.resizeDelay)},Le=function(e){var t=(S.items||[]).length,r=I?E.rows+e:E+e;return{index:r,count:t,first:0===r,last:r===t-1,even:r%2==0,odd:r%2!=0,props:S}},Me=function(e,t){var r=Y.length||0;return j({index:e,count:r,first:0===e,last:e===r-1,even:e%2==0,odd:e%2!=0,props:S},t)},He=function(){var e=S.items;return e&&!_?I?e.slice(S.appendOnly?0:E.rows,M.rows).map((function(e){return S.columns?e:e.slice(S.appendOnly?0:E.cols,M.cols)})):T&&S.columns?e:e.slice(S.appendOnly?0:E,M):[]},We=function(){var e,t,r,n,o;S.disabled||(Ie(),e=Se(),t=e.numItemsInViewport,r=e.numToleratedItems,n=function(e,t,r){return ze(e+t+(e<r?2:3)*r,arguments.length>3&&void 0!==arguments[3]&&arguments[3])},o=I?{rows:n(E.rows,t.rows,r[0]),cols:n(E.cols,t.cols,r[1],!0)}:n(E,t,r),A(t),J(r),H(o),S.showLoader&&Z(I?Array.from({length:t.rows}).map((function(){return Array.from({length:t.cols})})):Array.from({length:t})),S.lazy&&Promise.resolve().then((function(){ue.current={first:S.step?I?{rows:0,cols:E.cols}:0:E,last:Math.min(S.step?S.step:o,(S.items||[]).length)},S.onLazyLoad&&S.onLazyLoad(ue.current)})),Oe())};s((function(){q.current&&u.isVisible(q.current)&&(G.current=G.current||G.current||u.findSingle(q.current,".p-virtualscroller-content"),We(),fe(),me(),le.current=u.getWidth(q.current),ie.current=u.getHeight(q.current),se.current=u.getWidth(G.current),ce.current=u.getHeight(G.current))})),c((function(){We()}),[S.itemSize,S.scrollHeight,S.scrollWidth]),c((function(){S.numToleratedItems!==k&&J(S.numToleratedItems)}),[S.numToleratedItems]),c((function(){S.numToleratedItems===k&&We()}),[k]),c((function(){b.items&&b.items.length===(S.items||[]).length||We();var e=_;S.lazy&&b.loading!==S.loading&&S.loading!==_&&(B(S.loading),e=S.loading),be(e)})),c((function(){ee.current=I?{top:0,left:0}:0}),[S.orientation]),e.useImperativeHandle(g,(function(){return{props:S,getElementRef:pe,scrollTo:ge,scrollToIndex:ve,scrollInView:ye,getRenderedRange:we}}));var Ce=function(t){var r=Me(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),n=f.getJSXElement(S.loadingTemplate,r);return e.createElement(e.Fragment,{key:t},n)},De=function(t,r){var n=Le(r),o=f.getJSXElement(S.itemTemplate,t,n);return e.createElement(e.Fragment,{key:n.index},o)};if(S.disabled){var Fe=f.getJSXElement(S.contentTemplate,{items:S.items,rows:S.items,columns:S.columns});return e.createElement(e.Fragment,null,S.children,Fe)}var Ne=m("p-virtualscroller",{"p-virtualscroller-inline":S.inline,"p-virtualscroller-both p-both-scroll":I,"p-virtualscroller-horizontal p-horizontal-scroll":T},S.className),Ae=function(){var t="p-virtualscroller-loading-icon",r=v({className:t},$("loadingIcon")),n=S.loadingIcon||e.createElement(a,h({},r,{spin:!0})),o=p.getJSXIcon(n,j({},r),{props:S});if(!S.loaderDisabled&&S.showLoader&&_){var l=m("p-virtualscroller-loader",{"p-component-overlay":!S.loadingTemplate}),i=o;S.loadingTemplate?i=Y.map((function(e,t){return Ce(t,I&&{numCols:N.cols})})):S.loaderIconTemplate&&(i=f.getJSXElement(S.loaderIconTemplate,{iconClassName:t,element:i,props:S}));var s=v({className:l},$("loader"));return e.createElement("div",s,i)}return null}(),Ve=function(){var t=He().map(De),r=m("p-virtualscroller-content",{"p-virtualscroller-loading":_}),n=v({ref:G,style:ne.current,className:r},$("content")),o=e.createElement("div",n,t);if(S.contentTemplate){var l={style:ne.current,className:r,spacerStyle:oe.current,contentRef:function(e){return G.current=f.getRefElement(e)},spacerRef:function(e){return K.current=f.getRefElement(e)},stickyRef:function(e){return Q.current=f.getRefElement(e)},items:He(),getItemOptions:function(e){return Le(e)},children:t,element:o,props:S,loading:_,getLoaderOptions:function(e,t){return Me(e,t)},loadingTemplate:S.loadingTemplate,itemSize:S.itemSize,rows:_?S.loaderDisabled?Y:[]:He(),columns:S.columns&&I||T?_&&S.loaderDisabled?I?Y[0]:Y:S.columns.slice(I?E.cols:E,I?M.cols:M):S.columns,vertical:z,horizontal:T,both:I};return f.getJSXElement(S.contentTemplate,l)}return o}(),ke=function(){if(S.showSpacer){var t=v({ref:K,style:oe.current,className:"p-virtualscroller-spacer"},$("spacer"));return e.createElement("div",t)}return null}(),Je=v({ref:q,className:Ne,tabIndex:S.tabIndex,style:S.style,onScroll:function(e){return Ee(e)}},x.getOtherProps(S),$("root"));return e.createElement("div",Je,Ve,ke,Ae)})));E.displayName="VirtualScroller";export{E as VirtualScroller};
|