primevue 3.16.2 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +2 -1
- package/accordion/Accordion.d.ts +23 -5
- package/accordion/Accordion.vue +196 -79
- package/accordion/accordion.cjs.js +204 -98
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +202 -100
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +205 -100
- package/accordion/accordion.min.js +1 -1
- package/accordiontab/AccordionTab.d.ts +33 -5
- package/accordiontab/AccordionTab.vue +8 -1
- package/accordiontab/accordiontab.cjs.js +7 -0
- package/accordiontab/accordiontab.cjs.min.js +1 -1
- package/accordiontab/accordiontab.esm.js +7 -0
- package/accordiontab/accordiontab.esm.min.js +1 -1
- package/accordiontab/accordiontab.js +7 -0
- package/accordiontab/accordiontab.min.js +1 -1
- package/api/Api.d.ts +1 -1
- package/api/api.cjs.js +321 -313
- package/api/api.cjs.min.js +1 -1
- package/api/api.esm.js +321 -313
- package/api/api.esm.min.js +1 -1
- package/api/api.js +321 -313
- package/api/api.min.js +1 -1
- package/autocomplete/AutoComplete.d.ts +32 -17
- package/autocomplete/AutoComplete.vue +252 -131
- package/autocomplete/autocomplete.cjs.js +163 -118
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +161 -116
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +162 -117
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +4 -4
- package/avatar/Avatar.vue +15 -11
- package/avatar/avatar.cjs.js +11 -7
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +11 -7
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +11 -7
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/AvatarGroup.d.ts +6 -9
- package/avatargroup/AvatarGroup.vue +1 -1
- package/badge/Badge.d.ts +4 -5
- package/badge/Badge.vue +16 -13
- package/badge/badge.cjs.js +14 -11
- package/badge/badge.esm.js +14 -11
- package/badge/badge.js +14 -11
- package/badgedirective/badgedirective.cjs.js +8 -10
- package/badgedirective/badgedirective.esm.js +8 -10
- package/badgedirective/badgedirective.js +8 -10
- package/blockui/BlockUI.d.ts +6 -6
- package/blockui/BlockUI.vue +13 -15
- package/blockui/blockui.cjs.js +11 -13
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +11 -13
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +11 -13
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/Breadcrumb.d.ts +14 -7
- package/breadcrumb/Breadcrumb.vue +16 -7
- package/breadcrumb/BreadcrumbItem.vue +24 -15
- package/breadcrumb/breadcrumb.cjs.js +39 -25
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +39 -25
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +39 -25
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/Button.d.ts +10 -7
- package/button/Button.vue +28 -17
- package/button/button.cjs.js +25 -14
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +25 -14
- package/button/button.esm.min.js +1 -1
- package/button/button.js +25 -14
- package/button/button.min.js +1 -1
- package/calendar/Calendar.d.ts +14 -14
- package/calendar/Calendar.vue +856 -601
- package/calendar/calendar.cjs.js +714 -614
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +712 -612
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +713 -613
- package/calendar/calendar.min.js +1 -1
- package/card/Card.d.ts +5 -7
- package/card/Card.vue +5 -5
- package/carousel/Carousel.d.ts +29 -19
- package/carousel/Carousel.vue +537 -528
- package/carousel/carousel.cjs.js +496 -493
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +496 -493
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +645 -642
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +29 -14
- package/cascadeselect/CascadeSelect.vue +197 -102
- package/cascadeselect/CascadeSelectSub.vue +50 -15
- package/cascadeselect/cascadeselect.cjs.js +185 -111
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +184 -110
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +185 -111
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/Chart.d.ts +6 -7
- package/chart/Chart.vue +12 -12
- package/chart/chart.cjs.js +11 -11
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +11 -11
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +11 -11
- package/chart/chart.min.js +1 -1
- package/checkbox/Checkbox.d.ts +12 -12
- package/checkbox/Checkbox.vue +48 -20
- package/checkbox/checkbox.cjs.js +28 -17
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +28 -17
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +28 -17
- package/checkbox/checkbox.min.js +1 -1
- package/chip/Chip.d.ts +5 -5
- package/chip/Chip.vue +13 -11
- package/chip/chip.cjs.js +7 -4
- package/chip/chip.esm.js +7 -4
- package/chip/chip.js +7 -4
- package/chips/Chips.d.ts +9 -9
- package/chips/Chips.vue +89 -33
- package/chips/chips.cjs.js +48 -26
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +48 -26
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +48 -26
- package/chips/chips.min.js +1 -1
- package/colorpicker/ColorPicker.d.ts +11 -12
- package/colorpicker/ColorPicker.vue +146 -110
- package/colorpicker/colorpicker.cjs.js +113 -74
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +113 -74
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +113 -74
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/Column.d.ts +5 -6
- package/column/Column.vue +1 -1
- package/columngroup/ColumnGroup.d.ts +5 -7
- package/columngroup/ColumnGroup.vue +1 -1
- package/config/PrimeVue.d.ts +8 -3
- package/config/config.cjs.js +18 -30
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +18 -30
- package/config/config.esm.min.js +1 -1
- package/config/config.js +19 -31
- package/config/config.min.js +1 -1
- package/confirmationoptions/ConfirmationOptions.d.ts +4 -0
- package/confirmationservice/confirmationservice.cjs.js +1 -0
- package/confirmationservice/confirmationservice.esm.js +1 -0
- package/confirmationservice/confirmationservice.js +1 -0
- package/confirmdialog/ConfirmDialog.d.ts +11 -5
- package/confirmdialog/ConfirmDialog.vue +25 -15
- package/confirmdialog/confirmdialog.cjs.js +34 -16
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +34 -16
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +35 -17
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.d.ts +5 -8
- package/confirmpopup/ConfirmPopup.vue +44 -32
- package/confirmpopup/confirmpopup.cjs.js +24 -14
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +24 -14
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +24 -14
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenu.d.ts +43 -5
- package/contextmenu/ContextMenu.vue +449 -38
- package/contextmenu/ContextMenuSub.vue +134 -101
- package/contextmenu/contextmenu.cjs.js +639 -206
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +640 -207
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +640 -207
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +2984 -2116
- package/core/core.min.js +16 -16
- package/datatable/BodyCell.vue +93 -75
- package/datatable/ColumnFilter.vue +137 -86
- package/datatable/DataTable.d.ts +25 -26
- package/datatable/DataTable.vue +472 -298
- package/datatable/FooterCell.vue +20 -13
- package/datatable/HeaderCell.vue +108 -51
- package/datatable/HeaderCheckbox.vue +12 -5
- package/datatable/RowCheckbox.vue +14 -6
- package/datatable/RowRadioButton.vue +4 -4
- package/datatable/TableBody.vue +135 -83
- package/datatable/TableFooter.vue +17 -20
- package/datatable/TableHeader.vue +132 -52
- package/datatable/TableLoadingBody.vue +3 -3
- package/datatable/datatable.cjs.js +2674 -2537
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +2676 -2539
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +2676 -2539
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +8 -8
- package/dataview/DataView.vue +80 -66
- package/dataview/dataview.cjs.js +31 -35
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +31 -35
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +31 -35
- package/dataview/dataview.min.js +1 -1
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +5 -6
- package/dataviewlayoutoptions/DataViewLayoutOptions.vue +28 -34
- package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.js +19 -25
- package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.min.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.esm.js +19 -25
- package/dataviewlayoutoptions/dataviewlayoutoptions.esm.min.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.js +46 -52
- package/dataviewlayoutoptions/dataviewlayoutoptions.min.js +1 -1
- package/deferredcontent/DeferredContent.d.ts +6 -7
- package/deferredcontent/DeferredContent.vue +6 -9
- package/deferredcontent/deferredcontent.cjs.js +5 -8
- package/deferredcontent/deferredcontent.esm.js +5 -8
- package/deferredcontent/deferredcontent.js +5 -8
- package/dialog/Dialog.d.ts +10 -10
- package/dialog/Dialog.vue +64 -60
- package/dialog/dialog.cjs.js +50 -46
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +50 -46
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +50 -46
- package/dialog/dialog.min.js +1 -1
- package/divider/Divider.d.ts +4 -5
- package/divider/Divider.vue +15 -12
- package/divider/divider.cjs.js +17 -12
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +17 -12
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +17 -12
- package/divider/divider.min.js +1 -1
- package/dock/Dock.d.ts +36 -6
- package/dock/Dock.vue +21 -5
- package/dock/DockSub.vue +229 -55
- package/dock/dock.cjs.js +284 -106
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +284 -106
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +285 -108
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.d.ts +46 -17
- package/dropdown/Dropdown.vue +271 -129
- package/dropdown/dropdown.cjs.js +213 -132
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +212 -131
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +212 -131
- package/dropdown/dropdown.min.js +1 -1
- package/dynamicdialog/DynamicDialog.d.ts +4 -4
- package/dynamicdialog/DynamicDialog.vue +10 -10
- package/dynamicdialog/dynamicdialog.cjs.js +11 -9
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +11 -9
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +11 -9
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/editor/Editor.d.ts +20 -4
- package/editor/Editor.vue +506 -466
- package/editor/editor.cjs.js +99 -45
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +82 -42
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +83 -47
- package/editor/editor.min.js +1 -1
- package/fieldset/Fieldset.d.ts +9 -5
- package/fieldset/Fieldset.vue +28 -20
- package/fieldset/fieldset.cjs.js +31 -19
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +32 -20
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +31 -19
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/FileContent.vue +51 -0
- package/fileupload/FileUpload.d.ts +32 -12
- package/fileupload/FileUpload.vue +122 -102
- package/fileupload/fileupload.cjs.js +265 -160
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +265 -160
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +265 -160
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/FullCalendar.d.ts +5 -7
- package/fullcalendar/FullCalendar.vue +6 -6
- package/fullcalendar/fullcalendar.cjs.js +3 -2
- package/fullcalendar/fullcalendar.esm.js +3 -2
- package/fullcalendar/fullcalendar.js +3 -2
- package/galleria/Galleria.d.ts +4 -4
- package/galleria/Galleria.vue +39 -34
- package/galleria/GalleriaContent.vue +58 -31
- package/galleria/GalleriaItem.vue +44 -36
- package/galleria/GalleriaItemSlot.vue +2 -1
- package/galleria/GalleriaThumbnails.vue +108 -92
- package/galleria/galleria.cjs.js +181 -153
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +181 -153
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +181 -153
- package/galleria/galleria.min.js +1 -1
- package/image/Image.d.ts +4 -5
- package/image/Image.vue +19 -15
- package/image/image.cjs.js +11 -7
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +11 -7
- package/image/image.esm.min.js +1 -1
- package/image/image.js +11 -7
- package/image/image.min.js +1 -1
- package/inlinemessage/InlineMessage.d.ts +4 -5
- package/inlinemessage/InlineMessage.vue +12 -9
- package/inlinemessage/inlinemessage.cjs.js +12 -10
- package/inlinemessage/inlinemessage.cjs.min.js +1 -1
- package/inlinemessage/inlinemessage.esm.js +12 -10
- package/inlinemessage/inlinemessage.esm.min.js +1 -1
- package/inlinemessage/inlinemessage.js +12 -10
- package/inlinemessage/inlinemessage.min.js +1 -1
- package/inplace/Inplace.d.ts +6 -6
- package/inplace/Inplace.vue +11 -11
- package/inplace/inplace.cjs.js +9 -9
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +9 -9
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +9 -9
- package/inplace/inplace.min.js +1 -1
- package/inputmask/InputMask.d.ts +11 -12
- package/inputmask/InputMask.vue +119 -92
- package/inputmask/inputmask.cjs.js +116 -89
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +116 -89
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +116 -89
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +17 -17
- package/inputnumber/InputNumber.vue +247 -180
- package/inputnumber/inputnumber.cjs.js +219 -175
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +218 -174
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +219 -176
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +10 -10
- package/inputswitch/InputSwitch.vue +39 -11
- package/inputswitch/inputswitch.cjs.js +23 -9
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +23 -9
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +23 -9
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/InputText.d.ts +5 -6
- package/inputtext/InputText.vue +3 -3
- package/inputtext/inputtext.cjs.js +2 -2
- package/inputtext/inputtext.esm.js +2 -2
- package/inputtext/inputtext.js +2 -2
- package/knob/Knob.d.ts +10 -11
- package/knob/Knob.vue +47 -29
- package/knob/knob.cjs.js +27 -25
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +27 -25
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +27 -25
- package/knob/knob.min.js +1 -1
- package/listbox/Listbox.d.ts +22 -13
- package/listbox/Listbox.vue +149 -98
- package/listbox/listbox.cjs.js +121 -106
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +122 -107
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +121 -106
- package/listbox/listbox.min.js +1 -1
- package/megamenu/MegaMenu.d.ts +32 -6
- package/megamenu/MegaMenu.vue +510 -238
- package/megamenu/MegaMenuSub.vue +231 -0
- package/megamenu/megamenu.cjs.js +837 -391
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +839 -393
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +837 -391
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +28 -8
- package/menu/Menu.vue +204 -34
- package/menu/Menuitem.vue +48 -38
- package/menu/menu.cjs.js +325 -137
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +325 -137
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +325 -137
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +19 -8
- package/menubar/Menubar.vue +536 -26
- package/menubar/MenubarSub.vue +123 -239
- package/menubar/menubar.cjs.js +708 -335
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +710 -337
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +708 -335
- package/menubar/menubar.min.js +1 -1
- package/menuitem/MenuItem.d.ts +2 -2
- package/message/Message.d.ts +5 -5
- package/message/Message.vue +19 -14
- package/message/message.cjs.js +15 -10
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +15 -10
- package/message/message.esm.min.js +1 -1
- package/message/message.js +15 -10
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +46 -16
- package/multiselect/MultiSelect.vue +266 -156
- package/multiselect/multiselect.cjs.js +239 -167
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +238 -166
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +238 -166
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/OrderList.d.ts +5 -5
- package/orderlist/OrderList.vue +65 -60
- package/orderlist/orderlist.cjs.js +51 -53
- package/orderlist/orderlist.esm.js +51 -53
- package/orderlist/orderlist.js +51 -53
- package/organizationchart/OrganizationChart.d.ts +4 -4
- package/organizationchart/OrganizationChart.vue +13 -17
- package/organizationchart/OrganizationChartNode.vue +20 -12
- package/organizationchart/organizationchart.cjs.js +14 -16
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +14 -16
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +14 -16
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/OverlayPanel.d.ts +5 -5
- package/overlaypanel/OverlayPanel.vue +60 -50
- package/overlaypanel/overlaypanel.cjs.js +40 -32
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +40 -32
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +40 -32
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +3 -3
- package/paginator/CurrentPageReport.vue +47 -47
- package/paginator/FirstPageLink.vue +11 -8
- package/paginator/JumpToPageDropdown.vue +7 -6
- package/paginator/JumpToPageInput.vue +3 -3
- package/paginator/LastPageLink.vue +11 -8
- package/paginator/NextPageLink.vue +11 -8
- package/paginator/PageLinks.vue +3 -4
- package/paginator/Paginator.d.ts +7 -7
- package/paginator/Paginator.vue +144 -49
- package/paginator/PrevPageLink.vue +11 -8
- package/paginator/RowsPerPageDropdown.vue +7 -6
- package/paginator/paginator.cjs.js +373 -259
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +374 -260
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +651 -538
- package/paginator/paginator.min.js +1 -1
- package/panel/Panel.d.ts +9 -5
- package/panel/Panel.vue +29 -11
- package/panel/panel.cjs.js +24 -14
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +24 -14
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +24 -14
- package/panel/panel.min.js +1 -1
- package/panelmenu/PanelMenu.d.ts +37 -6
- package/panelmenu/PanelMenu.vue +202 -88
- package/panelmenu/PanelMenuList.vue +335 -0
- package/panelmenu/PanelMenuSub.vue +130 -80
- package/panelmenu/panelmenu.cjs.js +1385 -283
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +1382 -284
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +1385 -284
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/Password.d.ts +12 -7
- package/password/Password.vue +158 -80
- package/password/password.cjs.js +140 -78
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +139 -77
- package/password/password.esm.min.js +1 -1
- package/password/password.js +140 -78
- package/password/password.min.js +1 -1
- package/picklist/PickList.d.ts +9 -9
- package/picklist/PickList.vue +99 -78
- package/picklist/picklist.cjs.js +71 -66
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +71 -66
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +71 -66
- package/picklist/picklist.min.js +1 -1
- package/portal/Portal.d.ts +3 -3
- package/portal/Portal.vue +2 -2
- package/portal/portal.cjs.js +1 -1
- package/portal/portal.esm.js +1 -1
- package/portal/portal.js +1 -1
- package/progressbar/ProgressBar.d.ts +4 -5
- package/progressbar/ProgressBar.vue +63 -51
- package/progressbar/progressbar.cjs.js +2 -2
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +2 -2
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +2 -2
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/ProgressSpinner.d.ts +5 -7
- package/progressspinner/ProgressSpinner.vue +1 -1
- package/radiobutton/RadioButton.d.ts +9 -9
- package/radiobutton/RadioButton.vue +41 -13
- package/radiobutton/radiobutton.cjs.js +24 -10
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +24 -10
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +24 -10
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/Rating.d.ts +54 -5
- package/rating/Rating.vue +88 -62
- package/rating/rating.cjs.js +105 -84
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +106 -85
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +106 -86
- package/rating/rating.min.js +1 -1
- package/resources/primevue.css +21 -2
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +340 -282
- package/resources/themes/arya-green/theme.css +340 -282
- package/resources/themes/arya-orange/theme.css +340 -282
- package/resources/themes/arya-purple/theme.css +340 -282
- package/resources/themes/bootstrap4-dark-blue/theme.css +356 -298
- package/resources/themes/bootstrap4-dark-purple/theme.css +356 -298
- package/resources/themes/bootstrap4-light-blue/theme.css +369 -311
- package/resources/themes/bootstrap4-light-purple/theme.css +369 -311
- package/resources/themes/fluent-light/theme.css +350 -292
- package/resources/themes/lara-dark-blue/theme.css +343 -285
- package/resources/themes/lara-dark-indigo/theme.css +343 -285
- package/resources/themes/lara-dark-purple/theme.css +343 -285
- package/resources/themes/lara-dark-teal/theme.css +343 -285
- package/resources/themes/lara-light-blue/theme.css +367 -309
- package/resources/themes/lara-light-indigo/theme.css +367 -309
- package/resources/themes/lara-light-purple/theme.css +367 -309
- package/resources/themes/lara-light-teal/theme.css +367 -309
- package/resources/themes/luna-amber/theme.css +372 -314
- package/resources/themes/luna-blue/theme.css +372 -314
- package/resources/themes/luna-green/theme.css +372 -314
- package/resources/themes/luna-pink/theme.css +372 -314
- package/resources/themes/md-dark-deeppurple/theme.css +413 -318
- package/resources/themes/md-dark-indigo/theme.css +413 -318
- package/resources/themes/md-light-deeppurple/theme.css +413 -318
- package/resources/themes/md-light-indigo/theme.css +413 -318
- package/resources/themes/mdc-dark-deeppurple/theme.css +413 -318
- package/resources/themes/mdc-dark-indigo/theme.css +413 -318
- package/resources/themes/mdc-light-deeppurple/theme.css +413 -318
- package/resources/themes/mdc-light-indigo/theme.css +413 -318
- package/resources/themes/nova/theme.css +336 -278
- package/resources/themes/nova-accent/theme.css +335 -277
- package/resources/themes/nova-alt/theme.css +336 -278
- package/resources/themes/nova-vue/theme.css +336 -278
- package/resources/themes/rhea/theme.css +335 -277
- package/resources/themes/saga-blue/theme.css +347 -289
- package/resources/themes/saga-green/theme.css +347 -289
- package/resources/themes/saga-orange/theme.css +347 -289
- package/resources/themes/saga-purple/theme.css +347 -289
- package/resources/themes/tailwind-light/theme.css +359 -301
- package/resources/themes/vela-blue/theme.css +347 -289
- package/resources/themes/vela-green/theme.css +347 -289
- package/resources/themes/vela-orange/theme.css +347 -289
- package/resources/themes/vela-purple/theme.css +347 -289
- package/ripple/ripple.cjs.js +19 -1
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +19 -1
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +19 -1
- package/ripple/ripple.min.js +1 -1
- package/row/Row.d.ts +6 -9
- package/row/Row.vue +1 -1
- package/scrollpanel/ScrollPanel.d.ts +9 -5
- package/scrollpanel/ScrollPanel.vue +194 -56
- package/scrollpanel/scrollpanel.cjs.js +180 -56
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +181 -57
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +180 -56
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/ScrollTop.d.ts +5 -7
- package/scrolltop/ScrollTop.vue +18 -23
- package/scrolltop/scrolltop.cjs.js +14 -19
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.esm.js +14 -19
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +14 -19
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/SelectButton.d.ts +11 -11
- package/selectbutton/SelectButton.vue +50 -32
- package/selectbutton/selectbutton.cjs.js +30 -25
- package/selectbutton/selectbutton.esm.js +30 -25
- package/selectbutton/selectbutton.js +30 -25
- package/sidebar/Sidebar.d.ts +6 -6
- package/sidebar/Sidebar.vue +24 -14
- package/sidebar/sidebar.cjs.js +20 -10
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +20 -10
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +20 -10
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/Skeleton.d.ts +5 -7
- package/skeleton/Skeleton.vue +12 -11
- package/skeleton/skeleton.cjs.js +10 -9
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +10 -9
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +10 -9
- package/skeleton/skeleton.min.js +1 -1
- package/slider/Slider.d.ts +7 -8
- package/slider/Slider.vue +162 -141
- package/slider/slider.cjs.js +100 -127
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +100 -127
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +100 -127
- package/slider/slider.min.js +1 -1
- package/speeddial/SpeedDial.d.ts +8 -8
- package/speeddial/SpeedDial.vue +66 -46
- package/speeddial/speeddial.cjs.js +77 -62
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +77 -62
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +77 -62
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +6 -6
- package/splitbutton/SplitButton.vue +9 -11
- package/splitbutton/splitbutton.cjs.js +7 -7
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +7 -7
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +7 -7
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/Splitter.d.ts +10 -5
- package/splitter/Splitter.vue +158 -53
- package/splitter/splitter.cjs.js +156 -52
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +157 -53
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +156 -52
- package/splitter/splitter.min.js +1 -1
- package/splitterpanel/SplitterPanel.d.ts +4 -5
- package/splitterpanel/SplitterPanel.vue +3 -3
- package/splitterpanel/splitterpanel.cjs.js +2 -2
- package/splitterpanel/splitterpanel.esm.js +2 -2
- package/splitterpanel/splitterpanel.js +2 -2
- package/steps/Steps.d.ts +4 -5
- package/steps/Steps.vue +137 -30
- package/steps/steps.cjs.js +135 -36
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +136 -37
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +135 -36
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +20 -22
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +20 -22
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +20 -22
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/TabMenu.d.ts +13 -5
- package/tabmenu/TabMenu.vue +176 -36
- package/tabmenu/tabmenu.cjs.js +173 -42
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +173 -42
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +174 -43
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabpanel/TabPanel.d.ts +33 -6
- package/tabpanel/TabPanel.vue +8 -1
- package/tabpanel/tabpanel.cjs.js +7 -0
- package/tabpanel/tabpanel.cjs.min.js +1 -1
- package/tabpanel/tabpanel.esm.js +7 -0
- package/tabpanel/tabpanel.esm.min.js +1 -1
- package/tabpanel/tabpanel.js +7 -0
- package/tabpanel/tabpanel.min.js +1 -1
- package/tabview/TabView.d.ts +22 -6
- package/tabview/TabView.vue +280 -96
- package/tabview/tabview.cjs.js +295 -132
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +296 -133
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +296 -133
- package/tabview/tabview.min.js +1 -1
- package/tag/Tag.d.ts +4 -5
- package/tag/Tag.vue +13 -10
- package/tag/tag.cjs.js +10 -7
- package/tag/tag.esm.js +10 -7
- package/tag/tag.js +10 -7
- package/terminal/Terminal.d.ts +5 -7
- package/terminal/Terminal.vue +10 -10
- package/terminal/terminal.cjs.js +3 -3
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +3 -3
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +3 -3
- package/terminal/terminal.min.js +1 -1
- package/textarea/Textarea.d.ts +5 -6
- package/textarea/Textarea.vue +7 -7
- package/textarea/textarea.cjs.js +6 -6
- package/textarea/textarea.esm.js +6 -6
- package/textarea/textarea.js +6 -6
- package/tieredmenu/TieredMenu.d.ts +48 -6
- package/tieredmenu/TieredMenu.vue +500 -58
- package/tieredmenu/TieredMenuSub.vue +126 -208
- package/tieredmenu/tieredmenu.cjs.js +684 -338
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +685 -339
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +685 -339
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/Timeline.d.ts +4 -5
- package/timeline/Timeline.vue +6 -10
- package/timeline/timeline.cjs.js +3 -7
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +3 -7
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +3 -7
- package/timeline/timeline.min.js +1 -1
- package/toast/Toast.d.ts +10 -13
- package/toast/Toast.vue +40 -31
- package/toast/ToastMessage.vue +29 -20
- package/toast/toast.cjs.js +56 -38
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +55 -37
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +56 -38
- package/toast/toast.min.js +1 -1
- package/toastservice/toastservice.cjs.js +1 -0
- package/toastservice/toastservice.esm.js +1 -0
- package/toastservice/toastservice.js +1 -0
- package/togglebutton/ToggleButton.d.ts +10 -10
- package/togglebutton/ToggleButton.vue +82 -23
- package/togglebutton/togglebutton.cjs.js +66 -18
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +66 -18
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +66 -18
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/Toolbar.d.ts +8 -5
- package/toolbar/Toolbar.vue +9 -3
- package/toolbar/toolbar.cjs.js +14 -7
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +14 -7
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +14 -7
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +36 -24
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +37 -25
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +36 -24
- package/tooltip/tooltip.min.js +1 -1
- package/tree/Tree.d.ts +15 -7
- package/tree/Tree.vue +66 -56
- package/tree/TreeNode.vue +70 -66
- package/tree/tree.cjs.js +99 -102
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +99 -102
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +99 -102
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +9 -9
- package/treeselect/TreeSelect.vue +130 -72
- package/treeselect/treeselect.cjs.js +89 -59
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +89 -59
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +89 -59
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/BodyCell.vue +29 -19
- package/treetable/FooterCell.vue +19 -11
- package/treetable/HeaderCell.vue +44 -36
- package/treetable/TreeTable.d.ts +8 -8
- package/treetable/TreeTable.vue +229 -178
- package/treetable/TreeTableRow.vue +74 -58
- package/treetable/treetable.cjs.js +287 -253
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +287 -253
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +287 -253
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.d.ts +9 -9
- package/tristatecheckbox/TriStateCheckbox.vue +39 -18
- package/tristatecheckbox/tristatecheckbox.cjs.js +24 -15
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +24 -15
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +24 -15
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/ts-helpers.d.ts +16 -10
- package/useconfirm/UseConfirm.d.ts +1 -1
- package/useconfirm/useconfirm.cjs.js +2 -1
- package/useconfirm/useconfirm.esm.js +2 -1
- package/useconfirm/useconfirm.js +2 -1
- package/usedialog/UseDialog.d.ts +1 -1
- package/usedialog/usedialog.cjs.js +2 -1
- package/usedialog/usedialog.esm.js +2 -1
- package/usedialog/usedialog.js +2 -1
- package/usetoast/usetoast.cjs.js +2 -1
- package/usetoast/usetoast.esm.js +2 -1
- package/usetoast/usetoast.js +2 -1
- package/utils/Utils.d.ts +10 -5
- package/utils/utils.cjs.js +209 -156
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +209 -156
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +209 -156
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +335 -3
- package/vetur-tags.json +112 -19
- package/virtualscroller/VirtualScroller.d.ts +9 -9
- package/virtualscroller/VirtualScroller.vue +108 -96
- package/virtualscroller/virtualscroller.cjs.js +87 -89
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +87 -89
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +87 -89
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1183 -73
package/datatable/DataTable.vue
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="containerClass" data-scrollselectors=".p-datatable-wrapper">
|
|
3
3
|
<slot></slot>
|
|
4
|
-
<div class="p-datatable-loading-overlay p-component-overlay"
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
<div v-if="loading" class="p-datatable-loading-overlay p-component-overlay">
|
|
5
|
+
<slot v-if="$slots.loading" name="loading"></slot>
|
|
6
|
+
<i v-else :class="loadingIconClass"></i>
|
|
7
7
|
</div>
|
|
8
|
-
<div
|
|
8
|
+
<div v-if="$slots.header" class="p-datatable-header">
|
|
9
9
|
<slot name="header"></slot>
|
|
10
10
|
</div>
|
|
11
|
-
<DTPaginator
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
<DTPaginator
|
|
12
|
+
v-if="paginatorTop"
|
|
13
|
+
:rows="d_rows"
|
|
14
|
+
:first="d_first"
|
|
15
|
+
:totalRecords="totalRecordsLength"
|
|
16
|
+
:pageLinkSize="pageLinkSize"
|
|
17
|
+
:template="paginatorTemplate"
|
|
18
|
+
:rowsPerPageOptions="rowsPerPageOptions"
|
|
19
|
+
:currentPageReportTemplate="currentPageReportTemplate"
|
|
20
|
+
class="p-paginator-top"
|
|
21
|
+
@page="onPage($event)"
|
|
22
|
+
:alwaysShow="alwaysShowPaginator"
|
|
23
|
+
>
|
|
24
|
+
<template v-if="$slots.paginatorstart" #start>
|
|
14
25
|
<slot name="paginatorstart"></slot>
|
|
15
26
|
</template>
|
|
16
|
-
<template
|
|
27
|
+
<template v-if="$slots.paginatorend" #end>
|
|
17
28
|
<slot name="paginatorend"></slot>
|
|
18
29
|
</template>
|
|
19
30
|
</DTPaginator>
|
|
@@ -21,72 +32,229 @@
|
|
|
21
32
|
<DTVirtualScroller ref="virtualScroller" v-bind="virtualScrollerOptions" :items="processedData" :columns="columns" :style="{ height: scrollHeight }" :disabled="virtualScrollerDisabled" loaderDisabled :showSpacer="false">
|
|
22
33
|
<template #content="slotProps">
|
|
23
34
|
<table ref="table" role="table" :class="[tableClass, 'p-datatable-table']" :style="[tableStyle, slotProps.spacerStyle]">
|
|
24
|
-
<DTTableHeader
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
:
|
|
32
|
-
:
|
|
33
|
-
:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@
|
|
45
|
-
@
|
|
46
|
-
@
|
|
47
|
-
@
|
|
48
|
-
@
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
<DTTableHeader
|
|
36
|
+
:columnGroup="headerColumnGroup"
|
|
37
|
+
:columns="slotProps.columns"
|
|
38
|
+
:rowGroupMode="rowGroupMode"
|
|
39
|
+
:groupRowsBy="groupRowsBy"
|
|
40
|
+
:groupRowSortField="groupRowSortField"
|
|
41
|
+
:reorderableColumns="reorderableColumns"
|
|
42
|
+
:resizableColumns="resizableColumns"
|
|
43
|
+
:allRowsSelected="allRowsSelected"
|
|
44
|
+
:empty="empty"
|
|
45
|
+
:sortMode="sortMode"
|
|
46
|
+
:sortField="d_sortField"
|
|
47
|
+
:sortOrder="d_sortOrder"
|
|
48
|
+
:multiSortMeta="d_multiSortMeta"
|
|
49
|
+
:filters="d_filters"
|
|
50
|
+
:filtersStore="filters"
|
|
51
|
+
:filterDisplay="filterDisplay"
|
|
52
|
+
@column-click="onColumnHeaderClick($event)"
|
|
53
|
+
@column-mousedown="onColumnHeaderMouseDown($event)"
|
|
54
|
+
@filter-change="onFilterChange"
|
|
55
|
+
@filter-apply="onFilterApply"
|
|
56
|
+
@column-dragstart="onColumnHeaderDragStart($event)"
|
|
57
|
+
@column-dragover="onColumnHeaderDragOver($event)"
|
|
58
|
+
@column-dragleave="onColumnHeaderDragLeave($event)"
|
|
59
|
+
@column-drop="onColumnHeaderDrop($event)"
|
|
60
|
+
@column-resizestart="onColumnResizeStart($event)"
|
|
61
|
+
@checkbox-change="toggleRowsWithCheckbox($event)"
|
|
62
|
+
/>
|
|
63
|
+
<DTTableBody
|
|
64
|
+
v-if="frozenValue"
|
|
65
|
+
ref="frozenBodyRef"
|
|
66
|
+
:value="frozenValue"
|
|
67
|
+
:frozenRow="true"
|
|
68
|
+
class="p-datatable-frozen-tbody"
|
|
69
|
+
:columns="slotProps.columns"
|
|
70
|
+
:dataKey="dataKey"
|
|
71
|
+
:selection="selection"
|
|
72
|
+
:selectionKeys="d_selectionKeys"
|
|
73
|
+
:selectionMode="selectionMode"
|
|
74
|
+
:contextMenu="contextMenu"
|
|
75
|
+
:contextMenuSelection="contextMenuSelection"
|
|
76
|
+
:rowGroupMode="rowGroupMode"
|
|
77
|
+
:groupRowsBy="groupRowsBy"
|
|
78
|
+
:expandableRowGroups="expandableRowGroups"
|
|
79
|
+
:rowClass="rowClass"
|
|
80
|
+
:rowStyle="rowStyle"
|
|
81
|
+
:editMode="editMode"
|
|
82
|
+
:compareSelectionBy="compareSelectionBy"
|
|
83
|
+
:scrollable="scrollable"
|
|
84
|
+
:expandedRowIcon="expandedRowIcon"
|
|
85
|
+
:collapsedRowIcon="collapsedRowIcon"
|
|
86
|
+
:expandedRows="expandedRows"
|
|
87
|
+
:expandedRowKeys="d_expandedRowKeys"
|
|
88
|
+
:expandedRowGroups="expandedRowGroups"
|
|
89
|
+
:editingRows="editingRows"
|
|
90
|
+
:editingRowKeys="d_editingRowKeys"
|
|
91
|
+
:templates="$slots"
|
|
92
|
+
:responsiveLayout="responsiveLayout"
|
|
93
|
+
@rowgroup-toggle="toggleRowGroup"
|
|
94
|
+
@row-click="onRowClick($event)"
|
|
95
|
+
@row-dblclick="onRowDblClick($event)"
|
|
96
|
+
@row-rightclick="onRowRightClick($event)"
|
|
97
|
+
@row-touchend="onRowTouchEnd"
|
|
98
|
+
@row-keydown="onRowKeyDown"
|
|
99
|
+
@row-mousedown="onRowMouseDown"
|
|
100
|
+
@row-dragstart="onRowDragStart($event)"
|
|
101
|
+
@row-dragover="onRowDragOver($event)"
|
|
102
|
+
@row-dragleave="onRowDragLeave($event)"
|
|
103
|
+
@row-dragend="onRowDragEnd($event)"
|
|
104
|
+
@row-drop="onRowDrop($event)"
|
|
105
|
+
@row-toggle="toggleRow($event)"
|
|
106
|
+
@radio-change="toggleRowWithRadio($event)"
|
|
107
|
+
@checkbox-change="toggleRowWithCheckbox($event)"
|
|
108
|
+
@cell-edit-init="onCellEditInit($event)"
|
|
109
|
+
@cell-edit-complete="onCellEditComplete($event)"
|
|
110
|
+
@cell-edit-cancel="onCellEditCancel($event)"
|
|
111
|
+
@row-edit-init="onRowEditInit($event)"
|
|
112
|
+
@row-edit-save="onRowEditSave($event)"
|
|
113
|
+
@row-edit-cancel="onRowEditCancel($event)"
|
|
114
|
+
:editingMeta="d_editingMeta"
|
|
115
|
+
@editing-meta-change="onEditingMetaChange"
|
|
116
|
+
:isVirtualScrollerDisabled="true"
|
|
117
|
+
/>
|
|
118
|
+
<DTTableBody
|
|
119
|
+
ref="bodyRef"
|
|
120
|
+
:value="dataToRender(slotProps.rows)"
|
|
121
|
+
:class="slotProps.styleClass"
|
|
122
|
+
:columns="slotProps.columns"
|
|
123
|
+
:empty="empty"
|
|
124
|
+
:dataKey="dataKey"
|
|
125
|
+
:selection="selection"
|
|
126
|
+
:selectionKeys="d_selectionKeys"
|
|
127
|
+
:selectionMode="selectionMode"
|
|
128
|
+
:contextMenu="contextMenu"
|
|
129
|
+
:contextMenuSelection="contextMenuSelection"
|
|
130
|
+
:rowGroupMode="rowGroupMode"
|
|
131
|
+
:groupRowsBy="groupRowsBy"
|
|
132
|
+
:expandableRowGroups="expandableRowGroups"
|
|
133
|
+
:rowClass="rowClass"
|
|
134
|
+
:rowStyle="rowStyle"
|
|
135
|
+
:editMode="editMode"
|
|
136
|
+
:compareSelectionBy="compareSelectionBy"
|
|
137
|
+
:scrollable="scrollable"
|
|
138
|
+
:expandedRowIcon="expandedRowIcon"
|
|
139
|
+
:collapsedRowIcon="collapsedRowIcon"
|
|
140
|
+
:expandedRows="expandedRows"
|
|
141
|
+
:expandedRowKeys="d_expandedRowKeys"
|
|
142
|
+
:expandedRowGroups="expandedRowGroups"
|
|
143
|
+
:editingRows="editingRows"
|
|
144
|
+
:editingRowKeys="d_editingRowKeys"
|
|
145
|
+
:templates="$slots"
|
|
146
|
+
:responsiveLayout="responsiveLayout"
|
|
147
|
+
@rowgroup-toggle="toggleRowGroup"
|
|
148
|
+
@row-click="onRowClick($event)"
|
|
149
|
+
@row-dblclick="onRowDblClick($event)"
|
|
150
|
+
@row-rightclick="onRowRightClick($event)"
|
|
151
|
+
@row-touchend="onRowTouchEnd"
|
|
152
|
+
@row-keydown="onRowKeyDown"
|
|
153
|
+
@row-mousedown="onRowMouseDown"
|
|
154
|
+
@row-dragstart="onRowDragStart($event)"
|
|
155
|
+
@row-dragover="onRowDragOver($event)"
|
|
156
|
+
@row-dragleave="onRowDragLeave($event)"
|
|
157
|
+
@row-dragend="onRowDragEnd($event)"
|
|
158
|
+
@row-drop="onRowDrop($event)"
|
|
159
|
+
@row-toggle="toggleRow($event)"
|
|
160
|
+
@radio-change="toggleRowWithRadio($event)"
|
|
161
|
+
@checkbox-change="toggleRowWithCheckbox($event)"
|
|
162
|
+
@cell-edit-init="onCellEditInit($event)"
|
|
163
|
+
@cell-edit-complete="onCellEditComplete($event)"
|
|
164
|
+
@cell-edit-cancel="onCellEditCancel($event)"
|
|
165
|
+
@row-edit-init="onRowEditInit($event)"
|
|
166
|
+
@row-edit-save="onRowEditSave($event)"
|
|
167
|
+
@row-edit-cancel="onRowEditCancel($event)"
|
|
168
|
+
:editingMeta="d_editingMeta"
|
|
169
|
+
@editing-meta-change="onEditingMetaChange"
|
|
170
|
+
:virtualScrollerContentProps="slotProps"
|
|
171
|
+
:isVirtualScrollerDisabled="virtualScrollerDisabled"
|
|
172
|
+
/>
|
|
51
173
|
<DTTableFooter :columnGroup="footerColumnGroup" :columns="slotProps.columns" />
|
|
52
174
|
</table>
|
|
53
175
|
</template>
|
|
54
176
|
</DTVirtualScroller>
|
|
55
177
|
</div>
|
|
56
|
-
<DTPaginator
|
|
57
|
-
|
|
58
|
-
|
|
178
|
+
<DTPaginator
|
|
179
|
+
v-if="paginatorBottom"
|
|
180
|
+
:rows="d_rows"
|
|
181
|
+
:first="d_first"
|
|
182
|
+
:totalRecords="totalRecordsLength"
|
|
183
|
+
:pageLinkSize="pageLinkSize"
|
|
184
|
+
:template="paginatorTemplate"
|
|
185
|
+
:rowsPerPageOptions="rowsPerPageOptions"
|
|
186
|
+
:currentPageReportTemplate="currentPageReportTemplate"
|
|
187
|
+
class="p-paginator-bottom"
|
|
188
|
+
@page="onPage($event)"
|
|
189
|
+
:alwaysShow="alwaysShowPaginator"
|
|
190
|
+
>
|
|
191
|
+
<template v-if="$slots.paginatorstart" #start>
|
|
59
192
|
<slot name="paginatorstart"></slot>
|
|
60
193
|
</template>
|
|
61
|
-
<template
|
|
194
|
+
<template v-if="$slots.paginatorend" #end>
|
|
62
195
|
<slot name="paginatorend"></slot>
|
|
63
196
|
</template>
|
|
64
197
|
</DTPaginator>
|
|
65
|
-
<div
|
|
198
|
+
<div v-if="$slots.footer" class="p-datatable-footer">
|
|
66
199
|
<slot name="footer"></slot>
|
|
67
200
|
</div>
|
|
68
201
|
<div ref="resizeHelper" class="p-column-resizer-helper" style="display: none"></div>
|
|
69
|
-
<span ref="reorderIndicatorUp" class="pi pi-arrow-down p-datatable-reorder-indicator-up" style="position: absolute; display: none"
|
|
70
|
-
<span ref="reorderIndicatorDown" class="pi pi-arrow-up p-datatable-reorder-indicator-down" style="position: absolute; display: none"
|
|
202
|
+
<span v-if="reorderableColumns" ref="reorderIndicatorUp" class="pi pi-arrow-down p-datatable-reorder-indicator-up" style="position: absolute; display: none" />
|
|
203
|
+
<span v-if="reorderableColumns" ref="reorderIndicatorDown" class="pi pi-arrow-up p-datatable-reorder-indicator-down" style="position: absolute; display: none" />
|
|
71
204
|
</div>
|
|
72
205
|
</template>
|
|
73
206
|
|
|
74
207
|
<script>
|
|
75
|
-
import {
|
|
76
|
-
import {FilterMatchMode,FilterOperator,FilterService} from 'primevue/api';
|
|
208
|
+
import { FilterMatchMode, FilterOperator, FilterService } from 'primevue/api';
|
|
77
209
|
import Paginator from 'primevue/paginator';
|
|
210
|
+
import { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils';
|
|
78
211
|
import VirtualScroller from 'primevue/virtualscroller';
|
|
79
|
-
import TableHeader from './TableHeader.vue';
|
|
80
212
|
import TableBody from './TableBody.vue';
|
|
81
213
|
import TableFooter from './TableFooter.vue';
|
|
214
|
+
import TableHeader from './TableHeader.vue';
|
|
82
215
|
|
|
83
216
|
export default {
|
|
84
217
|
name: 'DataTable',
|
|
85
|
-
emits: [
|
|
86
|
-
'
|
|
87
|
-
'
|
|
88
|
-
'update:
|
|
89
|
-
'
|
|
218
|
+
emits: [
|
|
219
|
+
'value-change',
|
|
220
|
+
'update:first',
|
|
221
|
+
'update:rows',
|
|
222
|
+
'page',
|
|
223
|
+
'update:sortField',
|
|
224
|
+
'update:sortOrder',
|
|
225
|
+
'update:multiSortMeta',
|
|
226
|
+
'sort',
|
|
227
|
+
'filter',
|
|
228
|
+
'row-click',
|
|
229
|
+
'row-dblclick',
|
|
230
|
+
'update:selection',
|
|
231
|
+
'row-select',
|
|
232
|
+
'row-unselect',
|
|
233
|
+
'update:contextMenuSelection',
|
|
234
|
+
'row-contextmenu',
|
|
235
|
+
'row-unselect-all',
|
|
236
|
+
'row-select-all',
|
|
237
|
+
'select-all-change',
|
|
238
|
+
'column-resize-end',
|
|
239
|
+
'column-reorder',
|
|
240
|
+
'row-reorder',
|
|
241
|
+
'update:expandedRows',
|
|
242
|
+
'row-collapse',
|
|
243
|
+
'row-expand',
|
|
244
|
+
'update:expandedRowGroups',
|
|
245
|
+
'rowgroup-collapse',
|
|
246
|
+
'rowgroup-expand',
|
|
247
|
+
'update:filters',
|
|
248
|
+
'state-restore',
|
|
249
|
+
'state-save',
|
|
250
|
+
'cell-edit-init',
|
|
251
|
+
'cell-edit-complete',
|
|
252
|
+
'cell-edit-cancel',
|
|
253
|
+
'update:editingRows',
|
|
254
|
+
'row-edit-init',
|
|
255
|
+
'row-edit-save',
|
|
256
|
+
'row-edit-cancel'
|
|
257
|
+
],
|
|
90
258
|
props: {
|
|
91
259
|
value: {
|
|
92
260
|
type: Array,
|
|
@@ -121,7 +289,7 @@ export default {
|
|
|
121
289
|
default: true
|
|
122
290
|
},
|
|
123
291
|
paginatorTemplate: {
|
|
124
|
-
type: String,
|
|
292
|
+
type: [Object, String],
|
|
125
293
|
default: 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown'
|
|
126
294
|
},
|
|
127
295
|
pageLinkSize: {
|
|
@@ -189,7 +357,7 @@ export default {
|
|
|
189
357
|
default: undefined
|
|
190
358
|
},
|
|
191
359
|
selection: {
|
|
192
|
-
type: [Array,Object],
|
|
360
|
+
type: [Array, Object],
|
|
193
361
|
default: null
|
|
194
362
|
},
|
|
195
363
|
selectionMode: {
|
|
@@ -265,7 +433,7 @@ export default {
|
|
|
265
433
|
default: null
|
|
266
434
|
},
|
|
267
435
|
groupRowsBy: {
|
|
268
|
-
type: [Array,String],
|
|
436
|
+
type: [Array, String],
|
|
269
437
|
default: null
|
|
270
438
|
},
|
|
271
439
|
expandableRowGroups: {
|
|
@@ -306,7 +474,7 @@ export default {
|
|
|
306
474
|
},
|
|
307
475
|
scrollDirection: {
|
|
308
476
|
type: String,
|
|
309
|
-
default:
|
|
477
|
+
default: 'vertical'
|
|
310
478
|
},
|
|
311
479
|
virtualScrollerOptions: {
|
|
312
480
|
type: Object,
|
|
@@ -414,7 +582,7 @@ export default {
|
|
|
414
582
|
},
|
|
415
583
|
filters: {
|
|
416
584
|
deep: true,
|
|
417
|
-
handler: function(newValue) {
|
|
585
|
+
handler: function (newValue) {
|
|
418
586
|
this.d_filters = this.cloneFilters(newValue);
|
|
419
587
|
}
|
|
420
588
|
}
|
|
@@ -464,6 +632,7 @@ export default {
|
|
|
464
632
|
this.d_rows = event.rows;
|
|
465
633
|
|
|
466
634
|
let pageEvent = this.createLazyLoadEvent(event);
|
|
635
|
+
|
|
467
636
|
pageEvent.pageCount = event.pageCount;
|
|
468
637
|
pageEvent.page = event.page;
|
|
469
638
|
|
|
@@ -480,21 +649,24 @@ export default {
|
|
|
480
649
|
const targetNode = event.target;
|
|
481
650
|
const columnField = this.columnProp(column, 'sortField') || this.columnProp(column, 'field');
|
|
482
651
|
|
|
483
|
-
if (
|
|
484
|
-
|
|
652
|
+
if (
|
|
653
|
+
DomHandler.hasClass(targetNode, 'p-sortable-column') ||
|
|
654
|
+
DomHandler.hasClass(targetNode, 'p-column-title') ||
|
|
655
|
+
DomHandler.hasClass(targetNode, 'p-column-header-content') ||
|
|
656
|
+
DomHandler.hasClass(targetNode, 'p-sortable-column-icon') ||
|
|
657
|
+
DomHandler.hasClass(targetNode.parentElement, 'p-sortable-column-icon')
|
|
658
|
+
) {
|
|
485
659
|
DomHandler.clearSelection();
|
|
486
660
|
|
|
487
661
|
if (this.sortMode === 'single') {
|
|
488
662
|
if (this.d_sortField === columnField) {
|
|
489
|
-
if (this.removableSort &&
|
|
663
|
+
if (this.removableSort && this.d_sortOrder * -1 === this.defaultSortOrder) {
|
|
490
664
|
this.d_sortOrder = null;
|
|
491
665
|
this.d_sortField = null;
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
666
|
+
} else {
|
|
494
667
|
this.d_sortOrder = this.d_sortOrder * -1;
|
|
495
668
|
}
|
|
496
|
-
}
|
|
497
|
-
else {
|
|
669
|
+
} else {
|
|
498
670
|
this.d_sortOrder = this.defaultSortOrder;
|
|
499
671
|
this.d_sortField = columnField;
|
|
500
672
|
}
|
|
@@ -502,11 +674,11 @@ export default {
|
|
|
502
674
|
this.$emit('update:sortField', this.d_sortField);
|
|
503
675
|
this.$emit('update:sortOrder', this.d_sortOrder);
|
|
504
676
|
this.resetPage();
|
|
505
|
-
}
|
|
506
|
-
else if (this.sortMode === 'multiple') {
|
|
677
|
+
} else if (this.sortMode === 'multiple') {
|
|
507
678
|
let metaKey = event.metaKey || event.ctrlKey;
|
|
679
|
+
|
|
508
680
|
if (!metaKey) {
|
|
509
|
-
this.d_multiSortMeta =
|
|
681
|
+
this.d_multiSortMeta = this.d_multiSortMeta.filter((meta) => meta.field === columnField);
|
|
510
682
|
}
|
|
511
683
|
|
|
512
684
|
this.addMultiSortField(columnField);
|
|
@@ -523,8 +695,8 @@ export default {
|
|
|
523
695
|
|
|
524
696
|
if (this.groupRowsBy && this.groupRowsBy === this.sortField) {
|
|
525
697
|
this.d_multiSortMeta = [
|
|
526
|
-
{field: this.sortField, order: this.sortOrder || this.defaultSortOrder},
|
|
527
|
-
{field: this.d_sortField, order: this.d_sortOrder}
|
|
698
|
+
{ field: this.sortField, order: this.sortOrder || this.defaultSortOrder },
|
|
699
|
+
{ field: this.d_sortField, order: this.d_sortOrder }
|
|
528
700
|
];
|
|
529
701
|
|
|
530
702
|
return this.sortMultiple(value);
|
|
@@ -538,18 +710,13 @@ export default {
|
|
|
538
710
|
|
|
539
711
|
let result = null;
|
|
540
712
|
|
|
541
|
-
if (value1 == null && value2 != null)
|
|
542
|
-
|
|
543
|
-
else if (value1
|
|
544
|
-
|
|
545
|
-
else
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
result = value1.localeCompare(value2, undefined, { numeric: true });
|
|
549
|
-
else
|
|
550
|
-
result = (value1 < value2) ? -1 : (value1 > value2) ? 1 : 0;
|
|
551
|
-
|
|
552
|
-
return (this.d_sortOrder * result);
|
|
713
|
+
if (value1 == null && value2 != null) result = -1;
|
|
714
|
+
else if (value1 != null && value2 == null) result = 1;
|
|
715
|
+
else if (value1 == null && value2 == null) result = 0;
|
|
716
|
+
else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, undefined, { numeric: true });
|
|
717
|
+
else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
|
|
718
|
+
|
|
719
|
+
return this.d_sortOrder * result;
|
|
553
720
|
});
|
|
554
721
|
|
|
555
722
|
return data;
|
|
@@ -559,6 +726,7 @@ export default {
|
|
|
559
726
|
|
|
560
727
|
if (this.groupRowsBy && (this.d_groupRowsSortMeta || (this.d_multiSortMeta.length && this.groupRowsBy === this.d_multiSortMeta[0].field))) {
|
|
561
728
|
const firstSortMeta = this.d_multiSortMeta[0];
|
|
729
|
+
|
|
562
730
|
!this.d_groupRowsSortMeta && (this.d_groupRowsSortMeta = firstSortMeta);
|
|
563
731
|
|
|
564
732
|
if (firstSortMeta.field !== this.d_groupRowsSortMeta.field) {
|
|
@@ -580,31 +748,27 @@ export default {
|
|
|
580
748
|
let result = null;
|
|
581
749
|
|
|
582
750
|
if (typeof value1 === 'string' || value1 instanceof String) {
|
|
583
|
-
if (value1.localeCompare &&
|
|
584
|
-
return
|
|
751
|
+
if (value1.localeCompare && value1 !== value2) {
|
|
752
|
+
return this.d_multiSortMeta[index].order * value1.localeCompare(value2, undefined, { numeric: true });
|
|
585
753
|
}
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
result = (value1 < value2) ? -1 : 1;
|
|
754
|
+
} else {
|
|
755
|
+
result = value1 < value2 ? -1 : 1;
|
|
589
756
|
}
|
|
590
757
|
|
|
591
|
-
if (value1 === value2)
|
|
592
|
-
return
|
|
758
|
+
if (value1 === value2) {
|
|
759
|
+
return this.d_multiSortMeta.length - 1 > index ? this.multisortField(data1, data2, index + 1) : 0;
|
|
593
760
|
}
|
|
594
761
|
|
|
595
|
-
return
|
|
762
|
+
return this.d_multiSortMeta[index].order * result;
|
|
596
763
|
},
|
|
597
764
|
addMultiSortField(field) {
|
|
598
|
-
let index =
|
|
765
|
+
let index = this.d_multiSortMeta.findIndex((meta) => meta.field === field);
|
|
599
766
|
|
|
600
767
|
if (index >= 0) {
|
|
601
|
-
if (this.removableSort &&
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
}
|
|
606
|
-
else {
|
|
607
|
-
this.d_multiSortMeta.push({field: field, order: this.defaultSortOrder});
|
|
768
|
+
if (this.removableSort && this.d_multiSortMeta[index].order * -1 === this.defaultSortOrder) this.d_multiSortMeta.splice(index, 1);
|
|
769
|
+
else this.d_multiSortMeta[index] = { field: field, order: this.d_multiSortMeta[index].order * -1 };
|
|
770
|
+
} else {
|
|
771
|
+
this.d_multiSortMeta.push({ field: field, order: this.defaultSortOrder });
|
|
608
772
|
}
|
|
609
773
|
|
|
610
774
|
this.d_multiSortMeta = [...this.d_multiSortMeta];
|
|
@@ -617,8 +781,9 @@ export default {
|
|
|
617
781
|
this.clearEditingMetaData();
|
|
618
782
|
|
|
619
783
|
let globalFilterFieldsArray;
|
|
784
|
+
|
|
620
785
|
if (this.filters['global']) {
|
|
621
|
-
globalFilterFieldsArray = this.globalFilterFields|| this.columns.map(col => this.columnProp(col, 'filterField') || this.columnProp(col, 'field'));
|
|
786
|
+
globalFilterFieldsArray = this.globalFilterFields || this.columns.map((col) => this.columnProp(col, 'filterField') || this.columnProp(col, 'field'));
|
|
622
787
|
}
|
|
623
788
|
|
|
624
789
|
let filteredValue = [];
|
|
@@ -642,8 +807,7 @@ export default {
|
|
|
642
807
|
break;
|
|
643
808
|
}
|
|
644
809
|
}
|
|
645
|
-
}
|
|
646
|
-
else {
|
|
810
|
+
} else {
|
|
647
811
|
localMatch = this.executeLocalFilter(filterField, data[i], filterMeta);
|
|
648
812
|
}
|
|
649
813
|
|
|
@@ -654,8 +818,9 @@ export default {
|
|
|
654
818
|
}
|
|
655
819
|
|
|
656
820
|
if (this.filters['global'] && !globalMatch && globalFilterFieldsArray) {
|
|
657
|
-
for(let j = 0; j < globalFilterFieldsArray.length; j++) {
|
|
821
|
+
for (let j = 0; j < globalFilterFieldsArray.length; j++) {
|
|
658
822
|
let globalFilterField = globalFilterFieldsArray[j];
|
|
823
|
+
|
|
659
824
|
globalMatch = FilterService.filters[this.filters['global'].matchMode || FilterMatchMode.CONTAINS](ObjectUtils.resolveFieldData(data[i], globalFilterField), this.filters['global'].value, this.filterLocale);
|
|
660
825
|
|
|
661
826
|
if (globalMatch) {
|
|
@@ -665,10 +830,10 @@ export default {
|
|
|
665
830
|
}
|
|
666
831
|
|
|
667
832
|
let matches;
|
|
833
|
+
|
|
668
834
|
if (this.filters['global']) {
|
|
669
|
-
matches = localFiltered ?
|
|
670
|
-
}
|
|
671
|
-
else {
|
|
835
|
+
matches = localFiltered ? localFiltered && localMatch && globalMatch : globalMatch;
|
|
836
|
+
} else {
|
|
672
837
|
matches = localFiltered && localMatch;
|
|
673
838
|
}
|
|
674
839
|
|
|
@@ -682,6 +847,7 @@ export default {
|
|
|
682
847
|
}
|
|
683
848
|
|
|
684
849
|
let filterEvent = this.createLazyLoadEvent();
|
|
850
|
+
|
|
685
851
|
filterEvent.filteredValue = filteredValue;
|
|
686
852
|
this.$emit('filter', filterEvent);
|
|
687
853
|
this.$emit('value-change', filteredValue);
|
|
@@ -698,6 +864,7 @@ export default {
|
|
|
698
864
|
},
|
|
699
865
|
onRowClick(e) {
|
|
700
866
|
const event = e.originalEvent;
|
|
867
|
+
|
|
701
868
|
if (DomHandler.isClickable(event.target)) {
|
|
702
869
|
return;
|
|
703
870
|
}
|
|
@@ -712,10 +879,10 @@ export default {
|
|
|
712
879
|
DomHandler.clearSelection();
|
|
713
880
|
this.rangeRowIndex = rowIndex;
|
|
714
881
|
this.selectRange(event);
|
|
715
|
-
}
|
|
716
|
-
else {
|
|
882
|
+
} else {
|
|
717
883
|
const selected = this.isSelected(rowData);
|
|
718
884
|
const metaSelection = this.rowTouched ? false : this.metaKeySelection;
|
|
885
|
+
|
|
719
886
|
this.anchorRowIndex = rowIndex;
|
|
720
887
|
this.rangeRowIndex = rowIndex;
|
|
721
888
|
|
|
@@ -723,52 +890,49 @@ export default {
|
|
|
723
890
|
let metaKey = event.metaKey || event.ctrlKey;
|
|
724
891
|
|
|
725
892
|
if (selected && metaKey) {
|
|
726
|
-
if(this.isSingleSelectionMode()) {
|
|
893
|
+
if (this.isSingleSelectionMode()) {
|
|
727
894
|
this.$emit('update:selection', null);
|
|
728
|
-
}
|
|
729
|
-
else {
|
|
895
|
+
} else {
|
|
730
896
|
const selectionIndex = this.findIndexInSelection(rowData);
|
|
731
|
-
const _selection = this.selection.filter((val,i) => i != selectionIndex);
|
|
897
|
+
const _selection = this.selection.filter((val, i) => i != selectionIndex);
|
|
898
|
+
|
|
732
899
|
this.$emit('update:selection', _selection);
|
|
733
900
|
}
|
|
734
901
|
|
|
735
|
-
this.$emit('row-unselect', {originalEvent: event, data: rowData, index: rowIndex, type: 'row'});
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
if(this.isSingleSelectionMode()) {
|
|
902
|
+
this.$emit('row-unselect', { originalEvent: event, data: rowData, index: rowIndex, type: 'row' });
|
|
903
|
+
} else {
|
|
904
|
+
if (this.isSingleSelectionMode()) {
|
|
739
905
|
this.$emit('update:selection', rowData);
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
|
|
906
|
+
} else if (this.isMultipleSelectionMode()) {
|
|
907
|
+
let _selection = metaKey ? this.selection || [] : [];
|
|
908
|
+
|
|
743
909
|
_selection = [..._selection, rowData];
|
|
744
910
|
this.$emit('update:selection', _selection);
|
|
745
911
|
}
|
|
746
912
|
|
|
747
|
-
this.$emit('row-select', {originalEvent: event, data: rowData, index: rowIndex, type: 'row'});
|
|
913
|
+
this.$emit('row-select', { originalEvent: event, data: rowData, index: rowIndex, type: 'row' });
|
|
748
914
|
}
|
|
749
|
-
}
|
|
750
|
-
else {
|
|
915
|
+
} else {
|
|
751
916
|
if (this.selectionMode === 'single') {
|
|
752
917
|
if (selected) {
|
|
753
918
|
this.$emit('update:selection', null);
|
|
754
|
-
this.$emit('row-unselect', {originalEvent: event, data: rowData, index: rowIndex, type: 'row'});
|
|
755
|
-
}
|
|
756
|
-
else {
|
|
919
|
+
this.$emit('row-unselect', { originalEvent: event, data: rowData, index: rowIndex, type: 'row' });
|
|
920
|
+
} else {
|
|
757
921
|
this.$emit('update:selection', rowData);
|
|
758
|
-
this.$emit('row-select', {originalEvent: event, data: rowData, index: rowIndex, type: 'row'});
|
|
922
|
+
this.$emit('row-select', { originalEvent: event, data: rowData, index: rowIndex, type: 'row' });
|
|
759
923
|
}
|
|
760
|
-
}
|
|
761
|
-
else if (this.selectionMode === 'multiple') {
|
|
924
|
+
} else if (this.selectionMode === 'multiple') {
|
|
762
925
|
if (selected) {
|
|
763
926
|
const selectionIndex = this.findIndexInSelection(rowData);
|
|
764
927
|
const _selection = this.selection.filter((val, i) => i != selectionIndex);
|
|
928
|
+
|
|
765
929
|
this.$emit('update:selection', _selection);
|
|
766
|
-
this.$emit('row-unselect', {originalEvent: event, data: rowData, index: rowIndex, type: 'row'});
|
|
767
|
-
}
|
|
768
|
-
else {
|
|
930
|
+
this.$emit('row-unselect', { originalEvent: event, data: rowData, index: rowIndex, type: 'row' });
|
|
931
|
+
} else {
|
|
769
932
|
const _selection = this.selection ? [...this.selection, rowData] : [rowData];
|
|
933
|
+
|
|
770
934
|
this.$emit('update:selection', _selection);
|
|
771
|
-
this.$emit('row-select', {originalEvent: event, data: rowData, index: rowIndex, type: 'row'});
|
|
935
|
+
this.$emit('row-select', { originalEvent: event, data: rowData, index: rowIndex, type: 'row' });
|
|
772
936
|
}
|
|
773
937
|
}
|
|
774
938
|
}
|
|
@@ -779,6 +943,7 @@ export default {
|
|
|
779
943
|
},
|
|
780
944
|
onRowDblClick(e) {
|
|
781
945
|
const event = e.originalEvent;
|
|
946
|
+
|
|
782
947
|
if (DomHandler.isClickable(event.target)) {
|
|
783
948
|
return;
|
|
784
949
|
}
|
|
@@ -807,55 +972,53 @@ export default {
|
|
|
807
972
|
//down arrow
|
|
808
973
|
case 40:
|
|
809
974
|
var nextRow = this.findNextSelectableRow(row);
|
|
975
|
+
|
|
810
976
|
if (nextRow) {
|
|
811
977
|
nextRow.focus();
|
|
812
978
|
}
|
|
813
979
|
|
|
814
980
|
event.preventDefault();
|
|
815
|
-
|
|
981
|
+
break;
|
|
816
982
|
|
|
817
983
|
//up arrow
|
|
818
984
|
case 38:
|
|
819
985
|
var prevRow = this.findPrevSelectableRow(row);
|
|
986
|
+
|
|
820
987
|
if (prevRow) {
|
|
821
988
|
prevRow.focus();
|
|
822
989
|
}
|
|
823
990
|
|
|
824
991
|
event.preventDefault();
|
|
825
|
-
|
|
992
|
+
break;
|
|
826
993
|
|
|
827
994
|
//enter
|
|
828
995
|
case 13:
|
|
829
|
-
this.onRowClick({originalEvent: event, data: rowData, index: rowIndex});
|
|
830
|
-
|
|
996
|
+
this.onRowClick({ originalEvent: event, data: rowData, index: rowIndex });
|
|
997
|
+
break;
|
|
831
998
|
|
|
832
999
|
default:
|
|
833
1000
|
//no op
|
|
834
|
-
|
|
1001
|
+
break;
|
|
835
1002
|
}
|
|
836
1003
|
}
|
|
837
1004
|
},
|
|
838
1005
|
findNextSelectableRow(row) {
|
|
839
1006
|
let nextRow = row.nextElementSibling;
|
|
1007
|
+
|
|
840
1008
|
if (nextRow) {
|
|
841
|
-
if (DomHandler.hasClass(nextRow, 'p-selectable-row'))
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
return this.findNextSelectableRow(nextRow);
|
|
845
|
-
}
|
|
846
|
-
else {
|
|
1009
|
+
if (DomHandler.hasClass(nextRow, 'p-selectable-row')) return nextRow;
|
|
1010
|
+
else return this.findNextSelectableRow(nextRow);
|
|
1011
|
+
} else {
|
|
847
1012
|
return null;
|
|
848
1013
|
}
|
|
849
1014
|
},
|
|
850
1015
|
findPrevSelectableRow(row) {
|
|
851
1016
|
let prevRow = row.previousElementSibling;
|
|
1017
|
+
|
|
852
1018
|
if (prevRow) {
|
|
853
|
-
if (DomHandler.hasClass(prevRow, 'p-selectable-row'))
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
return this.findPrevSelectableRow(prevRow);
|
|
857
|
-
}
|
|
858
|
-
else {
|
|
1019
|
+
if (DomHandler.hasClass(prevRow, 'p-selectable-row')) return prevRow;
|
|
1020
|
+
else return this.findPrevSelectableRow(prevRow);
|
|
1021
|
+
} else {
|
|
859
1022
|
return null;
|
|
860
1023
|
}
|
|
861
1024
|
},
|
|
@@ -865,8 +1028,7 @@ export default {
|
|
|
865
1028
|
if (this.isSelected(rowData)) {
|
|
866
1029
|
this.$emit('update:selection', null);
|
|
867
1030
|
this.$emit('row-unselect', { originalEvent: event.originalEvent, data: rowData, index: event.index, type: 'radiobutton' });
|
|
868
|
-
}
|
|
869
|
-
else {
|
|
1031
|
+
} else {
|
|
870
1032
|
this.$emit('update:selection', rowData);
|
|
871
1033
|
this.$emit('row-select', { originalEvent: event.originalEvent, data: rowData, index: event.index, type: 'radiobutton' });
|
|
872
1034
|
}
|
|
@@ -877,11 +1039,12 @@ export default {
|
|
|
877
1039
|
if (this.isSelected(rowData)) {
|
|
878
1040
|
const selectionIndex = this.findIndexInSelection(rowData);
|
|
879
1041
|
const _selection = this.selection.filter((val, i) => i != selectionIndex);
|
|
1042
|
+
|
|
880
1043
|
this.$emit('update:selection', _selection);
|
|
881
1044
|
this.$emit('row-unselect', { originalEvent: event.originalEvent, data: rowData, index: event.index, type: 'checkbox' });
|
|
882
|
-
}
|
|
883
|
-
else {
|
|
1045
|
+
} else {
|
|
884
1046
|
let _selection = this.selection ? [...this.selection] : [];
|
|
1047
|
+
|
|
885
1048
|
_selection = [..._selection, rowData];
|
|
886
1049
|
this.$emit('update:selection', _selection);
|
|
887
1050
|
this.$emit('row-select', { originalEvent: event.originalEvent, data: rowData, index: event.index, type: 'checkbox' });
|
|
@@ -890,21 +1053,18 @@ export default {
|
|
|
890
1053
|
toggleRowsWithCheckbox(event) {
|
|
891
1054
|
if (this.selectAll !== null) {
|
|
892
1055
|
this.$emit('select-all-change', event);
|
|
893
|
-
}
|
|
894
|
-
else {
|
|
1056
|
+
} else {
|
|
895
1057
|
const { originalEvent, checked } = event;
|
|
896
1058
|
let _selection = [];
|
|
897
1059
|
|
|
898
1060
|
if (checked) {
|
|
899
1061
|
_selection = this.frozenValue ? [...this.frozenValue, ...this.processedData] : this.processedData;
|
|
900
|
-
this.$emit('row-select-all', {originalEvent, data: _selection});
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
this.$emit('row-unselect-all', {originalEvent});
|
|
1062
|
+
this.$emit('row-select-all', { originalEvent, data: _selection });
|
|
1063
|
+
} else {
|
|
1064
|
+
this.$emit('row-unselect-all', { originalEvent });
|
|
904
1065
|
}
|
|
905
1066
|
|
|
906
1067
|
this.$emit('update:selection', _selection);
|
|
907
|
-
|
|
908
1068
|
}
|
|
909
1069
|
},
|
|
910
1070
|
isSingleSelectionMode() {
|
|
@@ -917,12 +1077,9 @@ export default {
|
|
|
917
1077
|
if (rowData && this.selection) {
|
|
918
1078
|
if (this.dataKey) {
|
|
919
1079
|
return this.d_selectionKeys ? this.d_selectionKeys[ObjectUtils.resolveFieldData(rowData, this.dataKey)] !== undefined : false;
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
return this.findIndexInSelection(rowData) > -1;
|
|
924
|
-
else
|
|
925
|
-
return this.equals(rowData, this.selection);
|
|
1080
|
+
} else {
|
|
1081
|
+
if (this.selection instanceof Array) return this.findIndexInSelection(rowData) > -1;
|
|
1082
|
+
else return this.equals(rowData, this.selection);
|
|
926
1083
|
}
|
|
927
1084
|
}
|
|
928
1085
|
|
|
@@ -933,6 +1090,7 @@ export default {
|
|
|
933
1090
|
},
|
|
934
1091
|
findIndex(rowData, collection) {
|
|
935
1092
|
let index = -1;
|
|
1093
|
+
|
|
936
1094
|
if (collection && collection.length) {
|
|
937
1095
|
for (let i = 0; i < collection.length; i++) {
|
|
938
1096
|
if (this.equals(rowData, collection[i])) {
|
|
@@ -946,39 +1104,39 @@ export default {
|
|
|
946
1104
|
},
|
|
947
1105
|
updateSelectionKeys(selection) {
|
|
948
1106
|
this.d_selectionKeys = {};
|
|
1107
|
+
|
|
949
1108
|
if (Array.isArray(selection)) {
|
|
950
1109
|
for (let data of selection) {
|
|
951
1110
|
this.d_selectionKeys[String(ObjectUtils.resolveFieldData(data, this.dataKey))] = 1;
|
|
952
1111
|
}
|
|
953
|
-
}
|
|
954
|
-
else {
|
|
1112
|
+
} else {
|
|
955
1113
|
this.d_selectionKeys[String(ObjectUtils.resolveFieldData(selection, this.dataKey))] = 1;
|
|
956
1114
|
}
|
|
957
1115
|
},
|
|
958
1116
|
updateExpandedRowKeys(expandedRows) {
|
|
959
1117
|
if (expandedRows && expandedRows.length) {
|
|
960
1118
|
this.d_expandedRowKeys = {};
|
|
1119
|
+
|
|
961
1120
|
for (let data of expandedRows) {
|
|
962
1121
|
this.d_expandedRowKeys[String(ObjectUtils.resolveFieldData(data, this.dataKey))] = 1;
|
|
963
1122
|
}
|
|
964
|
-
}
|
|
965
|
-
else {
|
|
1123
|
+
} else {
|
|
966
1124
|
this.d_expandedRowKeys = null;
|
|
967
1125
|
}
|
|
968
1126
|
},
|
|
969
1127
|
updateEditingRowKeys(editingRows) {
|
|
970
1128
|
if (editingRows && editingRows.length) {
|
|
971
1129
|
this.d_editingRowKeys = {};
|
|
1130
|
+
|
|
972
1131
|
for (let data of editingRows) {
|
|
973
1132
|
this.d_editingRowKeys[String(ObjectUtils.resolveFieldData(data, this.dataKey))] = 1;
|
|
974
1133
|
}
|
|
975
|
-
}
|
|
976
|
-
else {
|
|
1134
|
+
} else {
|
|
977
1135
|
this.d_editingRowKeys = null;
|
|
978
1136
|
}
|
|
979
1137
|
},
|
|
980
1138
|
equals(data1, data2) {
|
|
981
|
-
return this.compareSelectionBy === 'equals' ?
|
|
1139
|
+
return this.compareSelectionBy === 'equals' ? data1 === data2 : ObjectUtils.equals(data1, data2, this.dataKey);
|
|
982
1140
|
},
|
|
983
1141
|
selectRange(event) {
|
|
984
1142
|
let rangeStart, rangeEnd;
|
|
@@ -986,12 +1144,10 @@ export default {
|
|
|
986
1144
|
if (this.rangeRowIndex > this.anchorRowIndex) {
|
|
987
1145
|
rangeStart = this.anchorRowIndex;
|
|
988
1146
|
rangeEnd = this.rangeRowIndex;
|
|
989
|
-
}
|
|
990
|
-
else if(this.rangeRowIndex < this.anchorRowIndex) {
|
|
1147
|
+
} else if (this.rangeRowIndex < this.anchorRowIndex) {
|
|
991
1148
|
rangeStart = this.rangeRowIndex;
|
|
992
1149
|
rangeEnd = this.anchorRowIndex;
|
|
993
|
-
}
|
|
994
|
-
else {
|
|
1150
|
+
} else {
|
|
995
1151
|
rangeStart = this.rangeRowIndex;
|
|
996
1152
|
rangeEnd = this.rangeRowIndex;
|
|
997
1153
|
}
|
|
@@ -1003,10 +1159,12 @@ export default {
|
|
|
1003
1159
|
|
|
1004
1160
|
const value = this.processedData;
|
|
1005
1161
|
let _selection = [];
|
|
1006
|
-
|
|
1162
|
+
|
|
1163
|
+
for (let i = rangeStart; i <= rangeEnd; i++) {
|
|
1007
1164
|
let rangeRowData = value[i];
|
|
1165
|
+
|
|
1008
1166
|
_selection.push(rangeRowData);
|
|
1009
|
-
this.$emit('row-select', {originalEvent: event, data: rangeRowData, type: 'row'});
|
|
1167
|
+
this.$emit('row-select', { originalEvent: event, data: rangeRowData, type: 'row' });
|
|
1010
1168
|
}
|
|
1011
1169
|
|
|
1012
1170
|
this.$emit('update:selection', _selection);
|
|
@@ -1017,22 +1175,19 @@ export default {
|
|
|
1017
1175
|
if (!data) {
|
|
1018
1176
|
data = this.processedData;
|
|
1019
1177
|
|
|
1020
|
-
if (options && options.selectionOnly)
|
|
1021
|
-
|
|
1022
|
-
else if (this.frozenValue)
|
|
1023
|
-
data = data ? [...this.frozenValue, ...data] : this.frozenValue;
|
|
1178
|
+
if (options && options.selectionOnly) data = this.selection || [];
|
|
1179
|
+
else if (this.frozenValue) data = data ? [...this.frozenValue, ...data] : this.frozenValue;
|
|
1024
1180
|
}
|
|
1025
1181
|
|
|
1026
1182
|
//headers
|
|
1027
1183
|
let headerInitiated = false;
|
|
1184
|
+
|
|
1028
1185
|
for (let i = 0; i < this.columns.length; i++) {
|
|
1029
1186
|
let column = this.columns[i];
|
|
1030
1187
|
|
|
1031
1188
|
if (this.columnProp(column, 'exportable') !== false && this.columnProp(column, 'field')) {
|
|
1032
|
-
if (headerInitiated)
|
|
1033
|
-
|
|
1034
|
-
else
|
|
1035
|
-
headerInitiated = true;
|
|
1189
|
+
if (headerInitiated) csv += this.csvSeparator;
|
|
1190
|
+
else headerInitiated = true;
|
|
1036
1191
|
|
|
1037
1192
|
csv += '"' + (this.columnProp(column, 'exportHeader') || this.columnProp(column, 'header') || this.columnProp(column, 'field')) + '"';
|
|
1038
1193
|
}
|
|
@@ -1040,16 +1195,16 @@ export default {
|
|
|
1040
1195
|
|
|
1041
1196
|
//body
|
|
1042
1197
|
if (data) {
|
|
1043
|
-
data.forEach(record => {
|
|
1198
|
+
data.forEach((record) => {
|
|
1044
1199
|
csv += '\n';
|
|
1045
1200
|
let rowInitiated = false;
|
|
1201
|
+
|
|
1046
1202
|
for (let i = 0; i < this.columns.length; i++) {
|
|
1047
1203
|
let column = this.columns[i];
|
|
1204
|
+
|
|
1048
1205
|
if (this.columnProp(column, 'exportable') !== false && this.columnProp(column, 'field')) {
|
|
1049
|
-
if (rowInitiated)
|
|
1050
|
-
|
|
1051
|
-
else
|
|
1052
|
-
rowInitiated = true;
|
|
1206
|
+
if (rowInitiated) csv += this.csvSeparator;
|
|
1207
|
+
else rowInitiated = true;
|
|
1053
1208
|
|
|
1054
1209
|
let cellData = ObjectUtils.resolveFieldData(record, this.columnProp(column, 'field'));
|
|
1055
1210
|
|
|
@@ -1059,12 +1214,8 @@ export default {
|
|
|
1059
1214
|
data: cellData,
|
|
1060
1215
|
field: this.columnProp(column, 'field')
|
|
1061
1216
|
});
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
cellData = String(cellData).replace(/"/g, '""');
|
|
1065
|
-
}
|
|
1066
|
-
else
|
|
1067
|
-
cellData = '';
|
|
1217
|
+
} else cellData = String(cellData).replace(/"/g, '""');
|
|
1218
|
+
} else cellData = '';
|
|
1068
1219
|
|
|
1069
1220
|
csv += '"' + cellData + '"';
|
|
1070
1221
|
}
|
|
@@ -1072,19 +1223,17 @@ export default {
|
|
|
1072
1223
|
});
|
|
1073
1224
|
}
|
|
1074
1225
|
|
|
1075
|
-
|
|
1076
1226
|
//footers
|
|
1077
1227
|
let footerInitiated = false;
|
|
1228
|
+
|
|
1078
1229
|
for (let i = 0; i < this.columns.length; i++) {
|
|
1079
1230
|
let column = this.columns[i];
|
|
1080
1231
|
|
|
1081
1232
|
if (i === 0) csv += '\n';
|
|
1082
1233
|
|
|
1083
1234
|
if (this.columnProp(column, 'exportable') !== false && this.columnProp(column, 'field')) {
|
|
1084
|
-
if (footerInitiated)
|
|
1085
|
-
|
|
1086
|
-
else
|
|
1087
|
-
footerInitiated = true;
|
|
1235
|
+
if (footerInitiated) csv += this.csvSeparator;
|
|
1236
|
+
else footerInitiated = true;
|
|
1088
1237
|
|
|
1089
1238
|
csv += '"' + (this.columnProp(column, 'exportFooter') || this.columnProp(column, 'footer') || this.columnProp(column, 'field')) + '"';
|
|
1090
1239
|
}
|
|
@@ -1098,18 +1247,20 @@ export default {
|
|
|
1098
1247
|
},
|
|
1099
1248
|
onColumnResizeStart(event) {
|
|
1100
1249
|
let containerLeft = DomHandler.getOffset(this.$el).left;
|
|
1250
|
+
|
|
1101
1251
|
this.resizeColumnElement = event.target.parentElement;
|
|
1102
1252
|
this.columnResizing = true;
|
|
1103
|
-
this.lastResizeHelperX =
|
|
1253
|
+
this.lastResizeHelperX = event.pageX - containerLeft + this.$el.scrollLeft;
|
|
1104
1254
|
|
|
1105
1255
|
this.bindColumnResizeEvents();
|
|
1106
1256
|
},
|
|
1107
1257
|
onColumnResize(event) {
|
|
1108
1258
|
let containerLeft = DomHandler.getOffset(this.$el).left;
|
|
1259
|
+
|
|
1109
1260
|
DomHandler.addClass(this.$el, 'p-unselectable-text');
|
|
1110
1261
|
this.$refs.resizeHelper.style.height = this.$el.offsetHeight + 'px';
|
|
1111
1262
|
this.$refs.resizeHelper.style.top = 0 + 'px';
|
|
1112
|
-
this.$refs.resizeHelper.style.left =
|
|
1263
|
+
this.$refs.resizeHelper.style.left = event.pageX - containerLeft + this.$el.scrollLeft + 'px';
|
|
1113
1264
|
|
|
1114
1265
|
this.$refs.resizeHelper.style.display = 'block';
|
|
1115
1266
|
},
|
|
@@ -1117,7 +1268,7 @@ export default {
|
|
|
1117
1268
|
let delta = this.$refs.resizeHelper.offsetLeft - this.lastResizeHelperX;
|
|
1118
1269
|
let columnWidth = this.resizeColumnElement.offsetWidth;
|
|
1119
1270
|
let newColumnWidth = columnWidth + delta;
|
|
1120
|
-
let minWidth = this.resizeColumnElement.style.minWidth||15;
|
|
1271
|
+
let minWidth = this.resizeColumnElement.style.minWidth || 15;
|
|
1121
1272
|
|
|
1122
1273
|
if (columnWidth + delta > parseInt(minWidth, 10)) {
|
|
1123
1274
|
if (this.columnResizeMode === 'fit') {
|
|
@@ -1127,12 +1278,12 @@ export default {
|
|
|
1127
1278
|
if (newColumnWidth > 15 && nextColumnWidth > 15) {
|
|
1128
1279
|
this.resizeTableCells(newColumnWidth, nextColumnWidth);
|
|
1129
1280
|
}
|
|
1130
|
-
}
|
|
1131
|
-
else if (this.columnResizeMode === 'expand') {
|
|
1281
|
+
} else if (this.columnResizeMode === 'expand') {
|
|
1132
1282
|
const tableWidth = this.$refs.table.offsetWidth + delta + 'px';
|
|
1283
|
+
|
|
1133
1284
|
const updateTableWidth = (el) => {
|
|
1134
1285
|
!!el && (el.style.width = el.style.minWidth = tableWidth);
|
|
1135
|
-
}
|
|
1286
|
+
};
|
|
1136
1287
|
|
|
1137
1288
|
updateTableWidth(this.$refs.table);
|
|
1138
1289
|
|
|
@@ -1167,22 +1318,25 @@ export default {
|
|
|
1167
1318
|
let colIndex = DomHandler.index(this.resizeColumnElement);
|
|
1168
1319
|
let widths = [];
|
|
1169
1320
|
let headers = DomHandler.find(this.$refs.table, '.p-datatable-thead > tr > th');
|
|
1170
|
-
|
|
1321
|
+
|
|
1322
|
+
headers.forEach((header) => widths.push(DomHandler.getOuterWidth(header)));
|
|
1171
1323
|
|
|
1172
1324
|
this.destroyStyleElement();
|
|
1173
1325
|
this.createStyleElement();
|
|
1174
1326
|
|
|
1175
1327
|
let innerHTML = '';
|
|
1328
|
+
|
|
1176
1329
|
widths.forEach((width, index) => {
|
|
1177
|
-
let colWidth = index === colIndex ? newColumnWidth :
|
|
1330
|
+
let colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width;
|
|
1178
1331
|
let style = this.scrollable ? `flex: 1 1 ${colWidth}px !important` : `width: ${colWidth}px !important`;
|
|
1332
|
+
|
|
1179
1333
|
innerHTML += `
|
|
1180
1334
|
.p-datatable[${this.attributeSelector}] .p-datatable-thead > tr > th:nth-child(${index + 1}),
|
|
1181
1335
|
.p-datatable[${this.attributeSelector}] .p-datatable-tbody > tr > td:nth-child(${index + 1}),
|
|
1182
1336
|
.p-datatable[${this.attributeSelector}] .p-datatable-tfoot > tr > td:nth-child(${index + 1}) {
|
|
1183
1337
|
${style}
|
|
1184
1338
|
}
|
|
1185
|
-
|
|
1339
|
+
`;
|
|
1186
1340
|
});
|
|
1187
1341
|
|
|
1188
1342
|
this.styleElement.innerHTML = innerHTML;
|
|
@@ -1190,7 +1344,7 @@ export default {
|
|
|
1190
1344
|
bindColumnResizeEvents() {
|
|
1191
1345
|
if (!this.documentColumnResizeListener) {
|
|
1192
1346
|
this.documentColumnResizeListener = document.addEventListener('mousemove', () => {
|
|
1193
|
-
if(this.columnResizing) {
|
|
1347
|
+
if (this.columnResizing) {
|
|
1194
1348
|
this.onColumnResize(event);
|
|
1195
1349
|
}
|
|
1196
1350
|
});
|
|
@@ -1198,13 +1352,12 @@ export default {
|
|
|
1198
1352
|
|
|
1199
1353
|
if (!this.documentColumnResizeEndListener) {
|
|
1200
1354
|
this.documentColumnResizeEndListener = document.addEventListener('mouseup', () => {
|
|
1201
|
-
if(this.columnResizing) {
|
|
1355
|
+
if (this.columnResizing) {
|
|
1202
1356
|
this.columnResizing = false;
|
|
1203
1357
|
this.onColumnResizeEnd();
|
|
1204
1358
|
}
|
|
1205
1359
|
});
|
|
1206
1360
|
}
|
|
1207
|
-
|
|
1208
1361
|
},
|
|
1209
1362
|
unbindColumnResizeEvents() {
|
|
1210
1363
|
if (this.documentColumnResizeListener) {
|
|
@@ -1222,15 +1375,14 @@ export default {
|
|
|
1222
1375
|
const column = e.column;
|
|
1223
1376
|
|
|
1224
1377
|
if (this.reorderableColumns && this.columnProp(column, 'reorderableColumn') !== false) {
|
|
1225
|
-
if (event.target.nodeName === 'INPUT' || event.target.nodeName === 'TEXTAREA' || DomHandler.hasClass(event.target, 'p-column-resizer'))
|
|
1226
|
-
|
|
1227
|
-
else
|
|
1228
|
-
event.currentTarget.draggable = true;
|
|
1378
|
+
if (event.target.nodeName === 'INPUT' || event.target.nodeName === 'TEXTAREA' || DomHandler.hasClass(event.target, 'p-column-resizer')) event.currentTarget.draggable = false;
|
|
1379
|
+
else event.currentTarget.draggable = true;
|
|
1229
1380
|
}
|
|
1230
1381
|
},
|
|
1231
1382
|
onColumnHeaderDragStart(event) {
|
|
1232
1383
|
if (this.columnResizing) {
|
|
1233
1384
|
event.preventDefault();
|
|
1385
|
+
|
|
1234
1386
|
return;
|
|
1235
1387
|
}
|
|
1236
1388
|
|
|
@@ -1242,26 +1394,26 @@ export default {
|
|
|
1242
1394
|
},
|
|
1243
1395
|
onColumnHeaderDragOver(event) {
|
|
1244
1396
|
let dropHeader = this.findParentHeader(event.target);
|
|
1245
|
-
|
|
1397
|
+
|
|
1398
|
+
if (this.reorderableColumns && this.draggedColumn && dropHeader) {
|
|
1246
1399
|
event.preventDefault();
|
|
1247
1400
|
let containerOffset = DomHandler.getOffset(this.$el);
|
|
1248
1401
|
let dropHeaderOffset = DomHandler.getOffset(dropHeader);
|
|
1249
1402
|
|
|
1250
1403
|
if (this.draggedColumn !== dropHeader) {
|
|
1251
|
-
let targetLeft =
|
|
1404
|
+
let targetLeft = dropHeaderOffset.left - containerOffset.left;
|
|
1252
1405
|
let columnCenter = dropHeaderOffset.left + dropHeader.offsetWidth / 2;
|
|
1253
1406
|
|
|
1254
1407
|
this.$refs.reorderIndicatorUp.style.top = dropHeaderOffset.top - containerOffset.top - (this.colReorderIconHeight - 1) + 'px';
|
|
1255
1408
|
this.$refs.reorderIndicatorDown.style.top = dropHeaderOffset.top - containerOffset.top + dropHeader.offsetHeight + 'px';
|
|
1256
1409
|
|
|
1257
|
-
if(event.pageX > columnCenter) {
|
|
1258
|
-
this.$refs.reorderIndicatorUp.style.left =
|
|
1259
|
-
this.$refs.reorderIndicatorDown.style.left =
|
|
1410
|
+
if (event.pageX > columnCenter) {
|
|
1411
|
+
this.$refs.reorderIndicatorUp.style.left = targetLeft + dropHeader.offsetWidth - Math.ceil(this.colReorderIconWidth / 2) + 'px';
|
|
1412
|
+
this.$refs.reorderIndicatorDown.style.left = targetLeft + dropHeader.offsetWidth - Math.ceil(this.colReorderIconWidth / 2) + 'px';
|
|
1260
1413
|
this.dropPosition = 1;
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
this.$refs.
|
|
1264
|
-
this.$refs.reorderIndicatorDown.style.left = (targetLeft - Math.ceil(this.colReorderIconWidth / 2))+ 'px';
|
|
1414
|
+
} else {
|
|
1415
|
+
this.$refs.reorderIndicatorUp.style.left = targetLeft - Math.ceil(this.colReorderIconWidth / 2) + 'px';
|
|
1416
|
+
this.$refs.reorderIndicatorDown.style.left = targetLeft - Math.ceil(this.colReorderIconWidth / 2) + 'px';
|
|
1265
1417
|
this.dropPosition = -1;
|
|
1266
1418
|
}
|
|
1267
1419
|
|
|
@@ -1271,7 +1423,7 @@ export default {
|
|
|
1271
1423
|
}
|
|
1272
1424
|
},
|
|
1273
1425
|
onColumnHeaderDragLeave(event) {
|
|
1274
|
-
if(this.reorderableColumns && this.draggedColumn) {
|
|
1426
|
+
if (this.reorderableColumns && this.draggedColumn) {
|
|
1275
1427
|
event.preventDefault();
|
|
1276
1428
|
this.$refs.reorderIndicatorUp.style.display = 'none';
|
|
1277
1429
|
this.$refs.reorderIndicatorDown.style.display = 'none';
|
|
@@ -1279,10 +1431,12 @@ export default {
|
|
|
1279
1431
|
},
|
|
1280
1432
|
onColumnHeaderDrop(event) {
|
|
1281
1433
|
event.preventDefault();
|
|
1434
|
+
|
|
1282
1435
|
if (this.draggedColumn) {
|
|
1283
1436
|
let dragIndex = DomHandler.index(this.draggedColumn);
|
|
1284
1437
|
let dropIndex = DomHandler.index(this.findParentHeader(event.target));
|
|
1285
|
-
let allowDrop =
|
|
1438
|
+
let allowDrop = dragIndex !== dropIndex;
|
|
1439
|
+
|
|
1286
1440
|
if (allowDrop && ((dropIndex - dragIndex === 1 && this.dropPosition === -1) || (dropIndex - dragIndex === -1 && this.dropPosition === 1))) {
|
|
1287
1441
|
allowDrop = false;
|
|
1288
1442
|
}
|
|
@@ -1306,15 +1460,16 @@ export default {
|
|
|
1306
1460
|
}
|
|
1307
1461
|
},
|
|
1308
1462
|
findParentHeader(element) {
|
|
1309
|
-
if(element.nodeName === 'TH') {
|
|
1463
|
+
if (element.nodeName === 'TH') {
|
|
1310
1464
|
return element;
|
|
1311
|
-
}
|
|
1312
|
-
else {
|
|
1465
|
+
} else {
|
|
1313
1466
|
let parent = element.parentElement;
|
|
1314
|
-
|
|
1467
|
+
|
|
1468
|
+
while (parent.nodeName !== 'TH') {
|
|
1315
1469
|
parent = parent.parentElement;
|
|
1316
1470
|
if (!parent) break;
|
|
1317
1471
|
}
|
|
1472
|
+
|
|
1318
1473
|
return parent;
|
|
1319
1474
|
}
|
|
1320
1475
|
},
|
|
@@ -1322,6 +1477,7 @@ export default {
|
|
|
1322
1477
|
if (columns && columns.length) {
|
|
1323
1478
|
for (let i = 0; i < columns.length; i++) {
|
|
1324
1479
|
let column = columns[i];
|
|
1480
|
+
|
|
1325
1481
|
if (this.columnProp(column, 'columnKey') === key || this.columnProp(column, 'field') === key) {
|
|
1326
1482
|
return column;
|
|
1327
1483
|
}
|
|
@@ -1331,17 +1487,16 @@ export default {
|
|
|
1331
1487
|
return null;
|
|
1332
1488
|
},
|
|
1333
1489
|
onRowMouseDown(event) {
|
|
1334
|
-
if (DomHandler.hasClass(event.target, 'p-datatable-reorderablerow-handle'))
|
|
1335
|
-
|
|
1336
|
-
else
|
|
1337
|
-
event.currentTarget.draggable = false;
|
|
1490
|
+
if (DomHandler.hasClass(event.target, 'p-datatable-reorderablerow-handle')) event.currentTarget.draggable = true;
|
|
1491
|
+
else event.currentTarget.draggable = false;
|
|
1338
1492
|
},
|
|
1339
1493
|
onRowDragStart(e) {
|
|
1340
1494
|
const event = e.originalEvent;
|
|
1341
1495
|
const index = e.index;
|
|
1496
|
+
|
|
1342
1497
|
this.rowDragging = true;
|
|
1343
1498
|
this.draggedRowIndex = index;
|
|
1344
|
-
event.dataTransfer.setData('text', 'b');
|
|
1499
|
+
event.dataTransfer.setData('text', 'b'); // For firefox
|
|
1345
1500
|
},
|
|
1346
1501
|
onRowDragOver(e) {
|
|
1347
1502
|
const event = e.originalEvent;
|
|
@@ -1358,16 +1513,11 @@ export default {
|
|
|
1358
1513
|
DomHandler.removeClass(rowElement, 'p-datatable-dragpoint-bottom');
|
|
1359
1514
|
|
|
1360
1515
|
this.droppedRowIndex = index;
|
|
1361
|
-
if (prevRowElement)
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
else {
|
|
1367
|
-
if (prevRowElement)
|
|
1368
|
-
DomHandler.removeClass(prevRowElement, 'p-datatable-dragpoint-bottom');
|
|
1369
|
-
else
|
|
1370
|
-
DomHandler.addClass(rowElement, 'p-datatable-dragpoint-top');
|
|
1516
|
+
if (prevRowElement) DomHandler.addClass(prevRowElement, 'p-datatable-dragpoint-bottom');
|
|
1517
|
+
else DomHandler.addClass(rowElement, 'p-datatable-dragpoint-top');
|
|
1518
|
+
} else {
|
|
1519
|
+
if (prevRowElement) DomHandler.removeClass(prevRowElement, 'p-datatable-dragpoint-bottom');
|
|
1520
|
+
else DomHandler.addClass(rowElement, 'p-datatable-dragpoint-top');
|
|
1371
1521
|
|
|
1372
1522
|
this.droppedRowIndex = index + 1;
|
|
1373
1523
|
DomHandler.addClass(rowElement, 'p-datatable-dragpoint-bottom');
|
|
@@ -1379,6 +1529,7 @@ export default {
|
|
|
1379
1529
|
onRowDragLeave(event) {
|
|
1380
1530
|
let rowElement = event.currentTarget;
|
|
1381
1531
|
let prevRowElement = rowElement.previousElementSibling;
|
|
1532
|
+
|
|
1382
1533
|
if (prevRowElement) {
|
|
1383
1534
|
DomHandler.removeClass(prevRowElement, 'p-datatable-dragpoint-bottom');
|
|
1384
1535
|
}
|
|
@@ -1394,8 +1545,9 @@ export default {
|
|
|
1394
1545
|
},
|
|
1395
1546
|
onRowDrop(event) {
|
|
1396
1547
|
if (this.droppedRowIndex != null) {
|
|
1397
|
-
let dropIndex =
|
|
1548
|
+
let dropIndex = this.draggedRowIndex > this.droppedRowIndex ? this.droppedRowIndex : this.droppedRowIndex === 0 ? 0 : this.droppedRowIndex - 1;
|
|
1398
1549
|
let processedData = [...this.processedData];
|
|
1550
|
+
|
|
1399
1551
|
ObjectUtils.reorderArray(processedData, this.draggedRowIndex, dropIndex);
|
|
1400
1552
|
|
|
1401
1553
|
this.$emit('row-reorder', {
|
|
@@ -1419,8 +1571,7 @@ export default {
|
|
|
1419
1571
|
|
|
1420
1572
|
if (this.dataKey) {
|
|
1421
1573
|
expanded = this.d_expandedRowKeys ? this.d_expandedRowKeys[ObjectUtils.resolveFieldData(rowData, this.dataKey)] !== undefined : false;
|
|
1422
|
-
}
|
|
1423
|
-
else {
|
|
1574
|
+
} else {
|
|
1424
1575
|
expandedRowIndex = this.findIndex(rowData, this.expandedRows);
|
|
1425
1576
|
expanded = expandedRowIndex > -1;
|
|
1426
1577
|
}
|
|
@@ -1429,11 +1580,11 @@ export default {
|
|
|
1429
1580
|
if (expandedRowIndex == null) {
|
|
1430
1581
|
expandedRowIndex = this.findIndex(rowData, this.expandedRows);
|
|
1431
1582
|
}
|
|
1583
|
+
|
|
1432
1584
|
_expandedRows.splice(expandedRowIndex, 1);
|
|
1433
1585
|
this.$emit('update:expandedRows', _expandedRows);
|
|
1434
1586
|
this.$emit('row-collapse', event);
|
|
1435
|
-
}
|
|
1436
|
-
else {
|
|
1587
|
+
} else {
|
|
1437
1588
|
_expandedRows.push(rowData);
|
|
1438
1589
|
this.$emit('update:expandedRows', _expandedRows);
|
|
1439
1590
|
this.$emit('row-expand', event);
|
|
@@ -1446,28 +1597,29 @@ export default {
|
|
|
1446
1597
|
let _expandedRowGroups = this.expandedRowGroups ? [...this.expandedRowGroups] : [];
|
|
1447
1598
|
|
|
1448
1599
|
if (this.isRowGroupExpanded(data)) {
|
|
1449
|
-
_expandedRowGroups = _expandedRowGroups.filter(group => group !== groupFieldValue);
|
|
1600
|
+
_expandedRowGroups = _expandedRowGroups.filter((group) => group !== groupFieldValue);
|
|
1450
1601
|
this.$emit('update:expandedRowGroups', _expandedRowGroups);
|
|
1451
|
-
this.$emit('rowgroup-collapse', {originalEvent: event, data: groupFieldValue});
|
|
1452
|
-
}
|
|
1453
|
-
else {
|
|
1602
|
+
this.$emit('rowgroup-collapse', { originalEvent: event, data: groupFieldValue });
|
|
1603
|
+
} else {
|
|
1454
1604
|
_expandedRowGroups.push(groupFieldValue);
|
|
1455
1605
|
this.$emit('update:expandedRowGroups', _expandedRowGroups);
|
|
1456
|
-
this.$emit('rowgroup-expand', {originalEvent: event, data: groupFieldValue});
|
|
1606
|
+
this.$emit('rowgroup-expand', { originalEvent: event, data: groupFieldValue });
|
|
1457
1607
|
}
|
|
1458
1608
|
},
|
|
1459
1609
|
isRowGroupExpanded(rowData) {
|
|
1460
1610
|
if (this.expandableRowGroups && this.expandedRowGroups) {
|
|
1461
1611
|
let groupFieldValue = ObjectUtils.resolveFieldData(rowData, this.groupRowsBy);
|
|
1612
|
+
|
|
1462
1613
|
return this.expandedRowGroups.indexOf(groupFieldValue) > -1;
|
|
1463
1614
|
}
|
|
1615
|
+
|
|
1464
1616
|
return false;
|
|
1465
1617
|
},
|
|
1466
1618
|
isStateful() {
|
|
1467
1619
|
return this.stateKey != null;
|
|
1468
1620
|
},
|
|
1469
1621
|
getStorage() {
|
|
1470
|
-
switch(this.stateStorage) {
|
|
1622
|
+
switch (this.stateStorage) {
|
|
1471
1623
|
case 'local':
|
|
1472
1624
|
return window.localStorage;
|
|
1473
1625
|
|
|
@@ -1532,13 +1684,14 @@ export default {
|
|
|
1532
1684
|
const storage = this.getStorage();
|
|
1533
1685
|
const stateString = storage.getItem(this.stateKey);
|
|
1534
1686
|
const dateFormat = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;
|
|
1535
|
-
|
|
1536
|
-
|
|
1687
|
+
|
|
1688
|
+
const reviver = function (key, value) {
|
|
1689
|
+
if (typeof value === 'string' && dateFormat.test(value)) {
|
|
1537
1690
|
return new Date(value);
|
|
1538
1691
|
}
|
|
1539
1692
|
|
|
1540
1693
|
return value;
|
|
1541
|
-
}
|
|
1694
|
+
};
|
|
1542
1695
|
|
|
1543
1696
|
if (stateString) {
|
|
1544
1697
|
let restoredState = JSON.parse(stateString, reviver);
|
|
@@ -1590,7 +1743,8 @@ export default {
|
|
|
1590
1743
|
saveColumnWidths(state) {
|
|
1591
1744
|
let widths = [];
|
|
1592
1745
|
let headers = DomHandler.find(this.$el, '.p-datatable-thead > tr > th');
|
|
1593
|
-
|
|
1746
|
+
|
|
1747
|
+
headers.forEach((header) => widths.push(DomHandler.getOuterWidth(header)));
|
|
1594
1748
|
state.columnWidths = widths.join(',');
|
|
1595
1749
|
|
|
1596
1750
|
if (this.columnResizeMode === 'expand') {
|
|
@@ -1611,15 +1765,17 @@ export default {
|
|
|
1611
1765
|
this.createStyleElement();
|
|
1612
1766
|
|
|
1613
1767
|
let innerHTML = '';
|
|
1768
|
+
|
|
1614
1769
|
widths.forEach((width, index) => {
|
|
1615
1770
|
let style = this.scrollable ? `flex: 1 1 ${width}px !important` : `width: ${width}px !important`;
|
|
1771
|
+
|
|
1616
1772
|
innerHTML += `
|
|
1617
1773
|
.p-datatable[${this.attributeSelector}] .p-datatable-thead > tr > th:nth-child(${index + 1}),
|
|
1618
1774
|
.p-datatable[${this.attributeSelector}] .p-datatable-tbody > tr > td:nth-child(${index + 1}),
|
|
1619
1775
|
.p-datatable[${this.attributeSelector}] .p-datatable-tfoot > tr > td:nth-child(${index + 1}) {
|
|
1620
1776
|
${style}
|
|
1621
1777
|
}
|
|
1622
|
-
|
|
1778
|
+
`;
|
|
1623
1779
|
});
|
|
1624
1780
|
|
|
1625
1781
|
this.styleElement.innerHTML = innerHTML;
|
|
@@ -1637,18 +1793,21 @@ export default {
|
|
|
1637
1793
|
},
|
|
1638
1794
|
onRowEditInit(event) {
|
|
1639
1795
|
let _editingRows = this.editingRows ? [...this.editingRows] : [];
|
|
1796
|
+
|
|
1640
1797
|
_editingRows.push(event.data);
|
|
1641
1798
|
this.$emit('update:editingRows', _editingRows);
|
|
1642
1799
|
this.$emit('row-edit-init', event);
|
|
1643
1800
|
},
|
|
1644
1801
|
onRowEditSave(event) {
|
|
1645
1802
|
let _editingRows = [...this.editingRows];
|
|
1803
|
+
|
|
1646
1804
|
_editingRows.splice(this.findIndex(event.data, _editingRows), 1);
|
|
1647
1805
|
this.$emit('update:editingRows', _editingRows);
|
|
1648
1806
|
this.$emit('row-edit-save', event);
|
|
1649
1807
|
},
|
|
1650
1808
|
onRowEditCancel(event) {
|
|
1651
1809
|
let _editingRows = [...this.editingRows];
|
|
1810
|
+
|
|
1652
1811
|
_editingRows.splice(this.findIndex(event.data, _editingRows), 1);
|
|
1653
1812
|
this.$emit('update:editingRows', _editingRows);
|
|
1654
1813
|
this.$emit('row-edit-cancel', event);
|
|
@@ -1661,10 +1820,10 @@ export default {
|
|
|
1661
1820
|
if (editing) {
|
|
1662
1821
|
!meta && (meta = editingMeta[index] = { data: { ...data }, fields: [] });
|
|
1663
1822
|
meta['fields'].push(field);
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
!fields.length ?
|
|
1823
|
+
} else if (meta) {
|
|
1824
|
+
const fields = meta['fields'].filter((f) => f !== field);
|
|
1825
|
+
|
|
1826
|
+
!fields.length ? delete editingMeta[index] : (meta['fields'] = fields);
|
|
1668
1827
|
}
|
|
1669
1828
|
|
|
1670
1829
|
this.d_editingMeta = editingMeta;
|
|
@@ -1705,9 +1864,17 @@ export default {
|
|
|
1705
1864
|
},
|
|
1706
1865
|
cloneFilters() {
|
|
1707
1866
|
let cloned = {};
|
|
1867
|
+
|
|
1708
1868
|
if (this.filters) {
|
|
1709
|
-
Object.entries(this.filters).forEach(([prop,value]) => {
|
|
1710
|
-
cloned[prop] = value.operator
|
|
1869
|
+
Object.entries(this.filters).forEach(([prop, value]) => {
|
|
1870
|
+
cloned[prop] = value.operator
|
|
1871
|
+
? {
|
|
1872
|
+
operator: value.operator,
|
|
1873
|
+
constraints: value.constraints.map((constraint) => {
|
|
1874
|
+
return { ...constraint };
|
|
1875
|
+
})
|
|
1876
|
+
}
|
|
1877
|
+
: { ...value };
|
|
1711
1878
|
});
|
|
1712
1879
|
}
|
|
1713
1880
|
|
|
@@ -1715,7 +1882,8 @@ export default {
|
|
|
1715
1882
|
},
|
|
1716
1883
|
updateReorderableColumns() {
|
|
1717
1884
|
let columnOrder = [];
|
|
1718
|
-
|
|
1885
|
+
|
|
1886
|
+
this.columns.forEach((col) => columnOrder.push(this.columnProp(col, 'columnKey') || this.columnProp(col, 'field')));
|
|
1719
1887
|
this.d_columnOrder = columnOrder;
|
|
1720
1888
|
},
|
|
1721
1889
|
createStyleElement() {
|
|
@@ -1724,10 +1892,10 @@ export default {
|
|
|
1724
1892
|
document.head.appendChild(this.styleElement);
|
|
1725
1893
|
},
|
|
1726
1894
|
createResponsiveStyle() {
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1895
|
+
if (!this.responsiveStyleElement) {
|
|
1896
|
+
this.responsiveStyleElement = document.createElement('style');
|
|
1897
|
+
this.responsiveStyleElement.type = 'text/css';
|
|
1898
|
+
document.head.appendChild(this.responsiveStyleElement);
|
|
1731
1899
|
|
|
1732
1900
|
let innerHTML = `
|
|
1733
1901
|
@media screen and (max-width: ${this.breakpoint}) {
|
|
@@ -1760,8 +1928,8 @@ export default {
|
|
|
1760
1928
|
`;
|
|
1761
1929
|
|
|
1762
1930
|
this.responsiveStyleElement.innerHTML = innerHTML;
|
|
1763
|
-
|
|
1764
|
-
|
|
1931
|
+
}
|
|
1932
|
+
},
|
|
1765
1933
|
destroyResponsiveStyle() {
|
|
1766
1934
|
if (this.responsiveStyleElement) {
|
|
1767
1935
|
document.head.removeChild(this.responsiveStyleElement);
|
|
@@ -1778,6 +1946,7 @@ export default {
|
|
|
1778
1946
|
if (!results) {
|
|
1779
1947
|
results = [];
|
|
1780
1948
|
}
|
|
1949
|
+
|
|
1781
1950
|
if (children && children.length) {
|
|
1782
1951
|
children.forEach((child) => {
|
|
1783
1952
|
if (child.children instanceof Array) {
|
|
@@ -1787,6 +1956,7 @@ export default {
|
|
|
1787
1956
|
}
|
|
1788
1957
|
});
|
|
1789
1958
|
}
|
|
1959
|
+
|
|
1790
1960
|
return results;
|
|
1791
1961
|
},
|
|
1792
1962
|
dataToRender(data) {
|
|
@@ -1794,6 +1964,7 @@ export default {
|
|
|
1794
1964
|
|
|
1795
1965
|
if (_data && this.paginator) {
|
|
1796
1966
|
const first = this.lazy ? 0 : this.d_first;
|
|
1967
|
+
|
|
1797
1968
|
return _data.slice(first, first + this.d_rows);
|
|
1798
1969
|
}
|
|
1799
1970
|
|
|
@@ -1806,8 +1977,9 @@ export default {
|
|
|
1806
1977
|
computed: {
|
|
1807
1978
|
containerClass() {
|
|
1808
1979
|
return [
|
|
1809
|
-
'p-datatable p-component',
|
|
1810
|
-
|
|
1980
|
+
'p-datatable p-component',
|
|
1981
|
+
{
|
|
1982
|
+
'p-datatable-hoverable-rows': this.rowHover || this.selectionMode,
|
|
1811
1983
|
'p-datatable-auto-layout': this.autoLayout,
|
|
1812
1984
|
'p-datatable-resizable': this.resizableColumns,
|
|
1813
1985
|
'p-datatable-resizable-fit': this.resizableColumns && this.columnResizeMode === 'fit',
|
|
@@ -1815,7 +1987,7 @@ export default {
|
|
|
1815
1987
|
'p-datatable-scrollable-vertical': this.scrollable && this.scrollDirection === 'vertical',
|
|
1816
1988
|
'p-datatable-scrollable-horizontal': this.scrollable && this.scrollDirection === 'horizontal',
|
|
1817
1989
|
'p-datatable-scrollable-both': this.scrollable && this.scrollDirection === 'both',
|
|
1818
|
-
'p-datatable-flex-scrollable':
|
|
1990
|
+
'p-datatable-flex-scrollable': this.scrollable && this.scrollHeight === 'flex',
|
|
1819
1991
|
'p-datatable-responsive-stack': this.responsiveLayout === 'stack',
|
|
1820
1992
|
'p-datatable-responsive-scroll': this.responsiveLayout === 'scroll',
|
|
1821
1993
|
'p-datatable-striped': this.stripedRows,
|
|
@@ -1836,8 +2008,10 @@ export default {
|
|
|
1836
2008
|
|
|
1837
2009
|
if (this.reorderableColumns && this.d_columnOrder) {
|
|
1838
2010
|
let orderedColumns = [];
|
|
2011
|
+
|
|
1839
2012
|
for (let columnKey of this.d_columnOrder) {
|
|
1840
2013
|
let column = this.findColumnByKey(cols, columnKey);
|
|
2014
|
+
|
|
1841
2015
|
if (column && !this.columnProp(column, 'hidden')) {
|
|
1842
2016
|
orderedColumns.push(column);
|
|
1843
2017
|
}
|
|
@@ -1850,6 +2024,7 @@ export default {
|
|
|
1850
2024
|
},
|
|
1851
2025
|
headerColumnGroup() {
|
|
1852
2026
|
const children = this.getChildren();
|
|
2027
|
+
|
|
1853
2028
|
if (children) {
|
|
1854
2029
|
for (let child of children) {
|
|
1855
2030
|
if (child.type.name === 'ColumnGroup' && this.columnProp(child, 'type') === 'header') {
|
|
@@ -1862,6 +2037,7 @@ export default {
|
|
|
1862
2037
|
},
|
|
1863
2038
|
footerColumnGroup() {
|
|
1864
2039
|
const children = this.getChildren();
|
|
2040
|
+
|
|
1865
2041
|
if (children) {
|
|
1866
2042
|
for (let child of children) {
|
|
1867
2043
|
if (child.type.name === 'ColumnGroup' && this.columnProp(child, 'type') === 'footer') {
|
|
@@ -1885,10 +2061,8 @@ export default {
|
|
|
1885
2061
|
}
|
|
1886
2062
|
|
|
1887
2063
|
if (this.sorted) {
|
|
1888
|
-
if(this.sortMode === 'single')
|
|
1889
|
-
|
|
1890
|
-
else if(this.sortMode === 'multiple')
|
|
1891
|
-
data = this.sortMultiple(data);
|
|
2064
|
+
if (this.sortMode === 'single') data = this.sortSingle(data);
|
|
2065
|
+
else if (this.sortMode === 'multiple') data = this.sortMultiple(data);
|
|
1892
2066
|
}
|
|
1893
2067
|
}
|
|
1894
2068
|
}
|
|
@@ -1898,15 +2072,16 @@ export default {
|
|
|
1898
2072
|
totalRecordsLength() {
|
|
1899
2073
|
if (this.lazy) {
|
|
1900
2074
|
return this.totalRecords;
|
|
1901
|
-
}
|
|
1902
|
-
else {
|
|
2075
|
+
} else {
|
|
1903
2076
|
const data = this.processedData;
|
|
2077
|
+
|
|
1904
2078
|
return data ? data.length : 0;
|
|
1905
2079
|
}
|
|
1906
2080
|
},
|
|
1907
2081
|
empty() {
|
|
1908
2082
|
const data = this.processedData;
|
|
1909
|
-
|
|
2083
|
+
|
|
2084
|
+
return !data || data.length === 0;
|
|
1910
2085
|
},
|
|
1911
2086
|
paginatorTop() {
|
|
1912
2087
|
return this.paginator && (this.paginatorPosition !== 'bottom' || this.paginatorPosition === 'both');
|
|
@@ -1923,30 +2098,30 @@ export default {
|
|
|
1923
2098
|
allRowsSelected() {
|
|
1924
2099
|
if (this.selectAll !== null) {
|
|
1925
2100
|
return this.selectAll;
|
|
1926
|
-
}
|
|
1927
|
-
else {
|
|
2101
|
+
} else {
|
|
1928
2102
|
const val = this.frozenValue ? [...this.frozenValue, ...this.processedData] : this.processedData;
|
|
1929
|
-
|
|
2103
|
+
|
|
2104
|
+
return ObjectUtils.isNotEmpty(val) && this.selection && Array.isArray(this.selection) && val.every((v) => this.selection.some((s) => this.equals(s, v)));
|
|
1930
2105
|
}
|
|
1931
2106
|
},
|
|
1932
2107
|
attributeSelector() {
|
|
1933
2108
|
return UniqueComponentId();
|
|
1934
2109
|
},
|
|
1935
2110
|
groupRowSortField() {
|
|
1936
|
-
return this.sortMode === 'single' ? this.sortField :
|
|
2111
|
+
return this.sortMode === 'single' ? this.sortField : this.d_groupRowsSortMeta ? this.d_groupRowsSortMeta.field : null;
|
|
1937
2112
|
},
|
|
1938
2113
|
virtualScrollerDisabled() {
|
|
1939
2114
|
return ObjectUtils.isEmpty(this.virtualScrollerOptions) || !this.scrollable;
|
|
1940
2115
|
}
|
|
1941
2116
|
},
|
|
1942
2117
|
components: {
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
2118
|
+
DTPaginator: Paginator,
|
|
2119
|
+
DTTableHeader: TableHeader,
|
|
2120
|
+
DTTableBody: TableBody,
|
|
2121
|
+
DTTableFooter: TableFooter,
|
|
2122
|
+
DTVirtualScroller: VirtualScroller
|
|
1948
2123
|
}
|
|
1949
|
-
}
|
|
2124
|
+
};
|
|
1950
2125
|
</script>
|
|
1951
2126
|
|
|
1952
2127
|
<style>
|
|
@@ -2047,8 +2222,7 @@ export default {
|
|
|
2047
2222
|
.p-datatable-scrollable-both .p-datatable-thead > tr > th,
|
|
2048
2223
|
.p-datatable-scrollable-both .p-datatable-tbody > tr > td,
|
|
2049
2224
|
.p-datatable-scrollable-both .p-datatable-tfoot > tr > td,
|
|
2050
|
-
.p-datatable-scrollable-horizontal .p-datatable-thead > tr > th
|
|
2051
|
-
.p-datatable-scrollable-horizontal .p-datatable-tbody > tr > td,
|
|
2225
|
+
.p-datatable-scrollable-horizontal .p-datatable-thead > tr > th .p-datatable-scrollable-horizontal .p-datatable-tbody > tr > td,
|
|
2052
2226
|
.p-datatable-scrollable-horizontal .p-datatable-tfoot > tr > td {
|
|
2053
2227
|
flex: 1 0 auto;
|
|
2054
2228
|
}
|
|
@@ -2120,10 +2294,10 @@ export default {
|
|
|
2120
2294
|
top: 0;
|
|
2121
2295
|
right: 0;
|
|
2122
2296
|
margin: 0;
|
|
2123
|
-
width: .5rem;
|
|
2297
|
+
width: 0.5rem;
|
|
2124
2298
|
height: 100%;
|
|
2125
2299
|
padding: 0px;
|
|
2126
|
-
cursor:col-resize;
|
|
2300
|
+
cursor: col-resize;
|
|
2127
2301
|
border: 1px solid transparent;
|
|
2128
2302
|
}
|
|
2129
2303
|
|