primevue 3.8.2 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/api/Api.d.ts +70 -36
- package/api/api.cjs.js +66 -32
- package/api/api.cjs.min.js +1 -1
- package/api/api.esm.js +66 -32
- package/api/api.esm.min.js +1 -1
- package/api/api.js +66 -32
- package/api/api.min.js +1 -1
- package/autocomplete/AutoComplete.vue +16 -9
- package/autocomplete/autocomplete.cjs.js +19 -11
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +19 -11
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +19 -11
- package/autocomplete/autocomplete.min.js +1 -1
- package/breadcrumb/BreadcrumbItem.vue +5 -2
- package/breadcrumb/breadcrumb.cjs.js +5 -2
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +5 -2
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +5 -2
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/calendar/Calendar.d.ts +6 -0
- package/calendar/Calendar.vue +362 -67
- package/calendar/calendar.cjs.js +459 -168
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +461 -170
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +459 -168
- package/calendar/calendar.min.js +1 -1
- package/carousel/Carousel.vue +2 -2
- package/carousel/carousel.cjs.js +6 -6
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +6 -6
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +6 -6
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +8 -4
- package/chart/Chart.vue +9 -2
- package/chart/chart.cjs.js +9 -2
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +9 -2
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +9 -2
- package/chart/chart.min.js +1 -1
- package/colorpicker/ColorPicker.d.ts +3 -0
- package/colorpicker/ColorPicker.vue +6 -1
- package/colorpicker/colorpicker.cjs.js +6 -1
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +6 -1
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +6 -1
- package/colorpicker/colorpicker.min.js +1 -1
- package/confirmdialog/ConfirmDialog.vue +8 -2
- package/confirmdialog/confirmdialog.cjs.js +11 -4
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +11 -4
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +11 -4
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.d.ts +7 -0
- package/confirmpopup/ConfirmPopup.vue +7 -4
- package/confirmpopup/confirmpopup.cjs.js +13 -5
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +14 -6
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +13 -5
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenuSub.vue +7 -4
- package/contextmenu/contextmenu.cjs.js +7 -4
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +7 -4
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +7 -4
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +132 -65
- package/core/core.min.js +14 -11
- package/datatable/BodyCell.vue +1 -0
- package/datatable/ColumnFilter.vue +17 -6
- package/datatable/DataTable.d.ts +5 -4
- package/datatable/DataTable.vue +34 -21
- package/datatable/TableBody.vue +5 -1
- package/datatable/TableFooter.vue +15 -1
- package/datatable/TableHeader.vue +15 -1
- package/datatable/datatable.cjs.js +175 -106
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +175 -106
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +175 -106
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +2 -2
- package/dataview/DataView.vue +8 -8
- package/dataview/dataview.cjs.js +12 -12
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +12 -12
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +12 -12
- package/dataview/dataview.min.js +1 -1
- package/dropdown/Dropdown.d.ts +10 -5
- package/inputnumber/InputNumber.vue +19 -3
- package/inputnumber/inputnumber.cjs.js +19 -3
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +19 -3
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +19 -3
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputtext/InputText.vue +1 -1
- package/inputtext/inputtext.cjs.js +2 -2
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +3 -3
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +2 -2
- package/inputtext/inputtext.min.js +1 -1
- package/listbox/Listbox.d.ts +10 -5
- package/megamenu/MegaMenu.vue +10 -7
- package/megamenu/megamenu.cjs.js +10 -7
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +10 -7
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +10 -7
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.vue +6 -3
- package/menu/Menuitem.vue +5 -2
- package/menu/menu.cjs.js +11 -5
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +11 -5
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +11 -5
- package/menu/menu.min.js +1 -1
- package/menubar/MenubarSub.vue +7 -4
- package/menubar/menubar.cjs.js +7 -4
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +7 -4
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +7 -4
- package/menubar/menubar.min.js +1 -1
- package/message/Message.d.ts +1 -0
- package/message/Message.vue +6 -2
- package/message/message.cjs.js +6 -2
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +6 -2
- package/message/message.esm.min.js +1 -1
- package/message/message.js +6 -2
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +10 -5
- package/orderlist/OrderList.d.ts +2 -0
- package/orderlist/OrderList.vue +2 -0
- package/orderlist/orderlist.cjs.js +3 -1
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +3 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +3 -1
- package/orderlist/orderlist.min.js +1 -1
- package/package.json +5 -1
- package/paginator/Paginator.vue +4 -4
- package/paginator/paginator.cjs.js +4 -4
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +4 -4
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +4 -4
- package/paginator/paginator.min.js +1 -1
- package/panel/Panel.d.ts +1 -0
- package/panel/Panel.vue +1 -1
- package/panelmenu/PanelMenu.vue +6 -3
- package/panelmenu/PanelMenuSub.vue +8 -5
- package/panelmenu/panelmenu.cjs.js +14 -8
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +14 -8
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +14 -8
- package/panelmenu/panelmenu.min.js +1 -1
- package/picklist/PickList.d.ts +8 -2
- package/picklist/PickList.vue +10 -4
- package/picklist/picklist.cjs.js +13 -7
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +13 -7
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +13 -7
- package/picklist/picklist.min.js +1 -1
- package/progressbar/ProgressBar.vue +13 -12
- package/progressbar/progressbar.cjs.js +13 -12
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +14 -13
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +13 -12
- package/progressbar/progressbar.min.js +1 -1
- package/rating/Rating.vue +1 -1
- package/rating/rating.cjs.js +1 -1
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +1 -1
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +1 -1
- package/rating/rating.min.js +1 -1
- package/resources/primevue.css +5 -0
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +56 -15
- package/resources/themes/arya-green/theme.css +56 -15
- package/resources/themes/arya-orange/theme.css +56 -15
- package/resources/themes/arya-purple/theme.css +56 -15
- package/resources/themes/bootstrap4-dark-blue/theme.css +53 -19
- package/resources/themes/bootstrap4-dark-purple/theme.css +53 -19
- package/resources/themes/bootstrap4-light-blue/theme.css +53 -19
- package/resources/themes/bootstrap4-light-purple/theme.css +53 -19
- package/resources/themes/fluent-light/theme.css +56 -15
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/theme.css +5414 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/theme.css +5414 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/theme.css +5414 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/theme.css +5414 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/theme.css +5414 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/theme.css +5414 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/theme.css +5414 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/theme.css +5414 -0
- package/resources/themes/luna-amber/theme.css +53 -19
- package/resources/themes/luna-blue/theme.css +53 -19
- package/resources/themes/luna-green/theme.css +53 -19
- package/resources/themes/luna-pink/theme.css +53 -19
- package/resources/themes/md-dark-deeppurple/theme.css +244 -47
- package/resources/themes/md-dark-indigo/theme.css +244 -47
- package/resources/themes/md-light-deeppurple/theme.css +244 -47
- package/resources/themes/md-light-indigo/theme.css +244 -47
- package/resources/themes/mdc-dark-deeppurple/theme.css +244 -47
- package/resources/themes/mdc-dark-indigo/theme.css +244 -47
- package/resources/themes/mdc-light-deeppurple/theme.css +244 -47
- package/resources/themes/mdc-light-indigo/theme.css +244 -47
- package/resources/themes/nova/theme.css +53 -19
- package/resources/themes/nova-accent/theme.css +53 -19
- package/resources/themes/nova-alt/theme.css +53 -19
- package/resources/themes/nova-vue/theme.css +53 -19
- package/resources/themes/rhea/theme.css +53 -19
- package/resources/themes/saga-blue/theme.css +56 -15
- package/resources/themes/saga-green/theme.css +56 -15
- package/resources/themes/saga-orange/theme.css +56 -15
- package/resources/themes/saga-purple/theme.css +56 -15
- package/resources/themes/tailwind-light/theme.css +67 -18
- package/resources/themes/vela-blue/theme.css +56 -15
- package/resources/themes/vela-green/theme.css +56 -15
- package/resources/themes/vela-orange/theme.css +56 -15
- package/resources/themes/vela-purple/theme.css +56 -15
- package/selectbutton/SelectButton.d.ts +8 -3
- package/selectbutton/SelectButton.vue +8 -2
- package/selectbutton/selectbutton.cjs.js +14 -9
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +14 -9
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +14 -9
- package/selectbutton/selectbutton.min.js +1 -1
- package/steps/Steps.vue +5 -2
- package/steps/steps.cjs.js +5 -2
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +5 -2
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +5 -2
- package/steps/steps.min.js +1 -1
- package/tabmenu/TabMenu.vue +6 -3
- package/tabmenu/tabmenu.cjs.js +6 -3
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +6 -3
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +6 -3
- package/tabmenu/tabmenu.min.js +1 -1
- package/terminalservice/TerminalService.d.ts +9 -6
- package/tieredmenu/TieredMenuSub.vue +7 -4
- package/tieredmenu/tieredmenu.cjs.js +7 -4
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +7 -4
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +7 -4
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/tree/TreeNode.vue +4 -1
- package/tree/tree.cjs.js +4 -1
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +4 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +4 -1
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.vue +9 -0
- package/treeselect/treeselect.cjs.js +9 -0
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +9 -0
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +9 -0
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/TreeTable.d.ts +2 -2
- package/treetable/TreeTable.vue +8 -8
- package/treetable/treetable.cjs.js +12 -12
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +12 -12
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +12 -12
- package/treetable/treetable.min.js +1 -1
- package/vetur-attributes.json +8 -0
- package/vetur-tags.json +3 -1
- package/web-types.json +143 -9
package/calendar/Calendar.vue
CHANGED
|
@@ -5,31 +5,34 @@
|
|
|
5
5
|
<CalendarButton v-if="showIcon" :icon="icon" tabindex="-1" class="p-datepicker-trigger" :disabled="$attrs.disabled" @click="onButtonClick" type="button" :aria-label="inputFieldValue"/>
|
|
6
6
|
<Teleport :to="appendTarget" :disabled="appendDisabled">
|
|
7
7
|
<transition name="p-connected-overlay" @enter="onOverlayEnter($event)" @after-enter="onOverlayEnterComplete" @after-leave="onOverlayAfterLeave" @leave="onOverlayLeave">
|
|
8
|
-
<div :ref="overlayRef" :class="panelStyleClass" v-if="inline ? true : overlayVisible" :role="inline ? null : 'dialog'" @click="onOverlayClick">
|
|
8
|
+
<div :ref="overlayRef" :class="panelStyleClass" v-if="inline ? true : overlayVisible" :role="inline ? null : 'dialog'" @click="onOverlayClick" @mouseup="onOverlayMouseUp">
|
|
9
9
|
<template v-if="!timeOnly">
|
|
10
10
|
<div class="p-datepicker-group-container">
|
|
11
11
|
<div class="p-datepicker-group" v-for="(month,groupIndex) of months" :key="month.month + month.year">
|
|
12
12
|
<div class="p-datepicker-header">
|
|
13
13
|
<slot name="header"></slot>
|
|
14
|
-
<button class="p-datepicker-prev p-link" v-
|
|
14
|
+
<button class="p-datepicker-prev p-link" v-show="groupIndex === 0" @click="onPrevButtonClick" type="button" @keydown="onContainerButtonKeydown" v-ripple :disabled="$attrs.disabled">
|
|
15
15
|
<span class="p-datepicker-prev-icon pi pi-chevron-left"></span>
|
|
16
16
|
</button>
|
|
17
17
|
<div class="p-datepicker-title">
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
<button type="button" @click="switchToMonthView" v-if="currentView === 'date'" class="p-datepicker-month p-link" :disabled="switchViewButtonDisabled">
|
|
19
|
+
{{getMonthName(month.month)}}
|
|
20
|
+
</button>
|
|
21
|
+
<button type="button" @click="switchToYearView" v-if="currentView !== 'year'" class="p-datepicker-year p-link" :disabled="switchViewButtonDisabled">
|
|
22
|
+
{{currentYear}}
|
|
23
|
+
</button>
|
|
24
|
+
<span class="p-datepicker-decade" v-if="currentView === 'year'">
|
|
25
|
+
<slot name="decade" :years="yearPickerValues">
|
|
26
|
+
{{yearPickerValues[0]}} - {{yearPickerValues[yearPickerValues.length - 1]}}
|
|
27
|
+
</slot>
|
|
28
|
+
</span>
|
|
26
29
|
</div>
|
|
27
|
-
<button class="p-datepicker-next p-link" v-
|
|
30
|
+
<button class="p-datepicker-next p-link" v-show="numberOfMonths === 1 ? true : (groupIndex === numberOfMonths - 1)"
|
|
28
31
|
@click="onNextButtonClick" type="button" @keydown="onContainerButtonKeydown" v-ripple :disabled="$attrs.disabled">
|
|
29
32
|
<span class="p-datepicker-next-icon pi pi-chevron-right"></span>
|
|
30
33
|
</button>
|
|
31
34
|
</div>
|
|
32
|
-
<div class="p-datepicker-calendar-container" v-if="
|
|
35
|
+
<div class="p-datepicker-calendar-container" v-if="currentView ==='date'">
|
|
33
36
|
<table class="p-datepicker-calendar">
|
|
34
37
|
<thead>
|
|
35
38
|
<tr>
|
|
@@ -61,22 +64,28 @@
|
|
|
61
64
|
</div>
|
|
62
65
|
</div>
|
|
63
66
|
</div>
|
|
64
|
-
<div class="p-monthpicker" v-if="
|
|
67
|
+
<div class="p-monthpicker" v-if="currentView === 'month'">
|
|
65
68
|
<span v-for="(m,i) of monthPickerValues" :key="m" @click="onMonthSelect($event, i)" @keydown="onMonthCellKeydown($event,i)"
|
|
66
69
|
class="p-monthpicker-month" :class="{'p-highlight': isMonthSelected(i)}" v-ripple>
|
|
67
70
|
{{m}}
|
|
68
71
|
</span>
|
|
69
72
|
</div>
|
|
73
|
+
<div class="p-yearpicker" v-if="currentView === 'year'">
|
|
74
|
+
<span v-for="y of yearPickerValues" :key="y" @click="onYearSelect($event, y)" @keydown="onYearCellKeydown($event,y)"
|
|
75
|
+
class="p-yearpicker-year" :class="{'p-highlight': isYearSelected(y)}" v-ripple>
|
|
76
|
+
{{y}}
|
|
77
|
+
</span>
|
|
78
|
+
</div>
|
|
70
79
|
</template>
|
|
71
80
|
<div class="p-timepicker" v-if="showTime||timeOnly">
|
|
72
81
|
<div class="p-hour-picker">
|
|
73
82
|
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 0, 1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple
|
|
74
|
-
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 0, 1)" @keyup.enter="onTimePickerElementMouseUp($event)" type="button">
|
|
83
|
+
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 0, 1)" @keydown.space="onTimePickerElementMouseDown($event, 0, 1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
|
|
75
84
|
<span class="pi pi-chevron-up"></span>
|
|
76
85
|
</button>
|
|
77
86
|
<span>{{formattedCurrentHour}}</span>
|
|
78
87
|
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 0, -1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple
|
|
79
|
-
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 0, -1)" @keyup.enter="onTimePickerElementMouseUp($event)" type="button">
|
|
88
|
+
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 0, -1)" @keydown.space="onTimePickerElementMouseDown($event, 0, -1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
|
|
80
89
|
<span class="pi pi-chevron-down"></span>
|
|
81
90
|
</button>
|
|
82
91
|
</div>
|
|
@@ -85,12 +94,12 @@
|
|
|
85
94
|
</div>
|
|
86
95
|
<div class="p-minute-picker">
|
|
87
96
|
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 1, 1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple :disabled="$attrs.disabled"
|
|
88
|
-
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 1, 1)" @keyup.enter="onTimePickerElementMouseUp($event)" type="button">
|
|
97
|
+
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 1, 1)" @keydown.space="onTimePickerElementMouseDown($event, 1, 1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
|
|
89
98
|
<span class="pi pi-chevron-up"></span>
|
|
90
99
|
</button>
|
|
91
100
|
<span>{{formattedCurrentMinute}}</span>
|
|
92
101
|
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 1, -1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple :disabled="$attrs.disabled"
|
|
93
|
-
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 1, -1)" @keyup.enter="onTimePickerElementMouseUp($event)" type="button">
|
|
102
|
+
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 1, -1)" @keydown.space="onTimePickerElementMouseDown($event, 1, -1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
|
|
94
103
|
<span class="pi pi-chevron-down"></span>
|
|
95
104
|
</button>
|
|
96
105
|
</div>
|
|
@@ -99,12 +108,12 @@
|
|
|
99
108
|
</div>
|
|
100
109
|
<div class="p-second-picker" v-if="showSeconds">
|
|
101
110
|
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 2, 1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple :disabled="$attrs.disabled"
|
|
102
|
-
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 2, 1)" @keyup.enter="onTimePickerElementMouseUp($event)" type="button">
|
|
111
|
+
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 2, 1)" @keydown.space="onTimePickerElementMouseDown($event, 2, 1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
|
|
103
112
|
<span class="pi pi-chevron-up"></span>
|
|
104
113
|
</button>
|
|
105
114
|
<span>{{formattedCurrentSecond}}</span>
|
|
106
115
|
<button class="p-link" @mousedown="onTimePickerElementMouseDown($event, 2, -1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple :disabled="$attrs.disabled"
|
|
107
|
-
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 2, -1)" @keyup.enter="onTimePickerElementMouseUp($event)" type="button">
|
|
116
|
+
@mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 2, -1)" @keydown.space="onTimePickerElementMouseDown($event, 2, -1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
|
|
108
117
|
<span class="pi pi-chevron-down"></span>
|
|
109
118
|
</button>
|
|
110
119
|
</div>
|
|
@@ -133,7 +142,7 @@
|
|
|
133
142
|
</template>
|
|
134
143
|
|
|
135
144
|
<script>
|
|
136
|
-
import {ConnectedOverlayScrollHandler,DomHandler,ZIndexUtils} from 'primevue/utils';
|
|
145
|
+
import {ConnectedOverlayScrollHandler,DomHandler,ZIndexUtils,UniqueComponentId} from 'primevue/utils';
|
|
137
146
|
import OverlayEventBus from 'primevue/overlayeventbus';
|
|
138
147
|
import InputText from 'primevue/inputtext';
|
|
139
148
|
import Button from 'primevue/button';
|
|
@@ -177,6 +186,7 @@ export default {
|
|
|
177
186
|
type: Number,
|
|
178
187
|
default: 1
|
|
179
188
|
},
|
|
189
|
+
responsiveOptions: Array,
|
|
180
190
|
view: {
|
|
181
191
|
type: String,
|
|
182
192
|
default: 'date'
|
|
@@ -299,6 +309,7 @@ export default {
|
|
|
299
309
|
style: null
|
|
300
310
|
},
|
|
301
311
|
navigationState: null,
|
|
312
|
+
timePickerChange: false,
|
|
302
313
|
scrollHandler: null,
|
|
303
314
|
outsideClickListener: null,
|
|
304
315
|
maskClickListener: null,
|
|
@@ -306,13 +317,22 @@ export default {
|
|
|
306
317
|
overlay: null,
|
|
307
318
|
mask: null,
|
|
308
319
|
timePickerTimer: null,
|
|
309
|
-
isKeydown: false,
|
|
310
320
|
created() {
|
|
311
321
|
this.updateCurrentMetaData();
|
|
312
322
|
},
|
|
313
323
|
mounted() {
|
|
314
|
-
|
|
315
|
-
|
|
324
|
+
this.createResponsiveStyle();
|
|
325
|
+
|
|
326
|
+
if (this.inline) {
|
|
327
|
+
this.overlay && this.overlay.setAttribute(this.attributeSelector, '');
|
|
328
|
+
|
|
329
|
+
if (!this.$attrs.disabled) {
|
|
330
|
+
this.initFocusableCell();
|
|
331
|
+
|
|
332
|
+
if (this.numberOfMonths === 1) {
|
|
333
|
+
this.overlay.style.width = DomHandler.getOuterWidth(this.$el) + 'px';
|
|
334
|
+
}
|
|
335
|
+
}
|
|
316
336
|
}
|
|
317
337
|
},
|
|
318
338
|
updated() {
|
|
@@ -333,8 +353,9 @@ export default {
|
|
|
333
353
|
}
|
|
334
354
|
|
|
335
355
|
if (this.mask) {
|
|
336
|
-
|
|
356
|
+
this.destroyMask();
|
|
337
357
|
}
|
|
358
|
+
this.destroyResponsiveStyleElement();
|
|
338
359
|
|
|
339
360
|
this.unbindOutsideClickListener();
|
|
340
361
|
this.unbindResizeListener();
|
|
@@ -358,7 +379,8 @@ export default {
|
|
|
358
379
|
currentSecond: null,
|
|
359
380
|
pm: null,
|
|
360
381
|
focused: false,
|
|
361
|
-
overlayVisible: false
|
|
382
|
+
overlayVisible: false,
|
|
383
|
+
currentView: this.view
|
|
362
384
|
}
|
|
363
385
|
},
|
|
364
386
|
watch: {
|
|
@@ -372,6 +394,14 @@ export default {
|
|
|
372
394
|
if (this.overlay) {
|
|
373
395
|
setTimeout(this.updateFocus, 0);
|
|
374
396
|
}
|
|
397
|
+
},
|
|
398
|
+
numberOfMonths() {
|
|
399
|
+
this.destroyResponsiveStyleElement();
|
|
400
|
+
this.createResponsiveStyle();
|
|
401
|
+
},
|
|
402
|
+
responsiveOptions() {
|
|
403
|
+
this.destroyResponsiveStyleElement();
|
|
404
|
+
this.createResponsiveStyle();
|
|
375
405
|
}
|
|
376
406
|
},
|
|
377
407
|
methods: {
|
|
@@ -413,6 +443,9 @@ export default {
|
|
|
413
443
|
isMonthSelected(month) {
|
|
414
444
|
return this.isComparable() ? (this.modelValue.getMonth() === month && this.modelValue.getFullYear() === this.currentYear) : false;
|
|
415
445
|
},
|
|
446
|
+
isYearSelected(year) {
|
|
447
|
+
return this.isComparable() ? (this.modelValue.getFullYear() === year) : false;
|
|
448
|
+
},
|
|
416
449
|
isDateEquals(value, dateMeta) {
|
|
417
450
|
if (value)
|
|
418
451
|
return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;
|
|
@@ -537,12 +570,15 @@ export default {
|
|
|
537
570
|
return validMin && validMax && validDate && validDay;
|
|
538
571
|
},
|
|
539
572
|
onOverlayEnter(el) {
|
|
573
|
+
el.setAttribute(this.attributeSelector, '');
|
|
574
|
+
|
|
540
575
|
if (this.autoZIndex) {
|
|
541
576
|
if (this.touchUI)
|
|
542
577
|
ZIndexUtils.set('modal', el, this.baseZIndex || this.$primevue.config.zIndex.modal);
|
|
543
578
|
else
|
|
544
579
|
ZIndexUtils.set('overlay', el, this.baseZIndex || this.$primevue.config.zIndex.overlay);
|
|
545
580
|
}
|
|
581
|
+
|
|
546
582
|
this.alignOverlay();
|
|
547
583
|
this.$emit('show');
|
|
548
584
|
},
|
|
@@ -557,6 +593,7 @@ export default {
|
|
|
557
593
|
}
|
|
558
594
|
},
|
|
559
595
|
onOverlayLeave() {
|
|
596
|
+
this.currentView = this.view;
|
|
560
597
|
this.unbindOutsideClickListener();
|
|
561
598
|
this.unbindScrollListener();
|
|
562
599
|
this.unbindResizeListener();
|
|
@@ -587,9 +624,12 @@ export default {
|
|
|
587
624
|
return;
|
|
588
625
|
}
|
|
589
626
|
|
|
590
|
-
if (this.
|
|
627
|
+
if (this.currentView === 'month') {
|
|
591
628
|
this.decrementYear();
|
|
592
629
|
}
|
|
630
|
+
else if (this.currentView === 'year') {
|
|
631
|
+
this.decrementDecade();
|
|
632
|
+
}
|
|
593
633
|
else {
|
|
594
634
|
if (this.currentMonth === 0) {
|
|
595
635
|
this.currentMonth = 11;
|
|
@@ -609,9 +649,12 @@ export default {
|
|
|
609
649
|
return;
|
|
610
650
|
}
|
|
611
651
|
|
|
612
|
-
if (this.
|
|
652
|
+
if (this.currentView === 'month') {
|
|
613
653
|
this.incrementYear();
|
|
614
654
|
}
|
|
655
|
+
else if (this.currentView === 'year') {
|
|
656
|
+
this.incrementDecade();
|
|
657
|
+
}
|
|
615
658
|
else {
|
|
616
659
|
if (this.currentMonth === 11) {
|
|
617
660
|
this.currentMonth = 0;
|
|
@@ -627,9 +670,25 @@ export default {
|
|
|
627
670
|
decrementYear() {
|
|
628
671
|
this.currentYear--;
|
|
629
672
|
},
|
|
673
|
+
decrementDecade() {
|
|
674
|
+
this.currentYear = this.currentYear - 10;
|
|
675
|
+
},
|
|
630
676
|
incrementYear() {
|
|
631
677
|
this.currentYear++;
|
|
632
678
|
},
|
|
679
|
+
incrementDecade() {
|
|
680
|
+
this.currentYear = this.currentYear + 10;
|
|
681
|
+
},
|
|
682
|
+
switchToMonthView(event) {
|
|
683
|
+
this.currentView = 'month';
|
|
684
|
+
setTimeout(this.updateFocus, 0);
|
|
685
|
+
event.preventDefault();
|
|
686
|
+
},
|
|
687
|
+
switchToYearView(event) {
|
|
688
|
+
this.currentView = 'year';
|
|
689
|
+
setTimeout(this.updateFocus, 0);
|
|
690
|
+
event.preventDefault();
|
|
691
|
+
},
|
|
633
692
|
isEnabled() {
|
|
634
693
|
return !this.$attrs.disabled && !this.$attrs.readonly;
|
|
635
694
|
},
|
|
@@ -714,7 +773,14 @@ export default {
|
|
|
714
773
|
DomHandler.relativePosition(this.overlay, this.$el);
|
|
715
774
|
}
|
|
716
775
|
else {
|
|
717
|
-
|
|
776
|
+
if (this.view === 'date') {
|
|
777
|
+
this.overlay.style.width = DomHandler.getOuterWidth(this.overlay) + 'px';
|
|
778
|
+
this.overlay.style.minWidth = DomHandler.getOuterWidth(this.$el) + 'px';
|
|
779
|
+
}
|
|
780
|
+
else {
|
|
781
|
+
this.overlay.style.width = DomHandler.getOuterWidth(this.$el) + 'px';
|
|
782
|
+
}
|
|
783
|
+
|
|
718
784
|
DomHandler.absolutePosition(this.overlay, this.$el);
|
|
719
785
|
}
|
|
720
786
|
}
|
|
@@ -1115,12 +1181,10 @@ export default {
|
|
|
1115
1181
|
}
|
|
1116
1182
|
return hours;
|
|
1117
1183
|
},
|
|
1118
|
-
|
|
1119
|
-
let value = this.modelValue;
|
|
1184
|
+
validateTime(hour, minute, second, pm) {
|
|
1185
|
+
let value = this.isComparable() ? this.modelValue : this.viewDate;
|
|
1120
1186
|
const convertedHour = this.convertTo24Hour(hour, pm);
|
|
1121
|
-
|
|
1122
|
-
return true;
|
|
1123
|
-
}
|
|
1187
|
+
|
|
1124
1188
|
if (this.isRangeSelection()) {
|
|
1125
1189
|
value = this.modelValue[1] || this.modelValue[0];
|
|
1126
1190
|
}
|
|
@@ -1166,7 +1230,6 @@ export default {
|
|
|
1166
1230
|
let newHour = this.currentHour + this.stepHour;
|
|
1167
1231
|
let newPM = this.pm;
|
|
1168
1232
|
|
|
1169
|
-
|
|
1170
1233
|
if (this.hourFormat == '24')
|
|
1171
1234
|
newHour = (newHour >= 24) ? (newHour - 24) : newHour;
|
|
1172
1235
|
else if (this.hourFormat == '12') {
|
|
@@ -1177,7 +1240,6 @@ export default {
|
|
|
1177
1240
|
newHour = (newHour >= 13) ? (newHour - 12) : newHour;
|
|
1178
1241
|
}
|
|
1179
1242
|
|
|
1180
|
-
|
|
1181
1243
|
if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) {
|
|
1182
1244
|
this.currentHour = newHour;
|
|
1183
1245
|
this.pm = newPM;
|
|
@@ -1237,7 +1299,8 @@ export default {
|
|
|
1237
1299
|
event.preventDefault();
|
|
1238
1300
|
},
|
|
1239
1301
|
updateModelTime() {
|
|
1240
|
-
|
|
1302
|
+
this.timePickerChange = true;
|
|
1303
|
+
let value = this.isComparable() ? this.modelValue : this.viewDate;
|
|
1241
1304
|
|
|
1242
1305
|
if (this.isRangeSelection()) {
|
|
1243
1306
|
value = this.modelValue[1] || this.modelValue[0];
|
|
@@ -1273,6 +1336,7 @@ export default {
|
|
|
1273
1336
|
|
|
1274
1337
|
this.updateModel(value);
|
|
1275
1338
|
this.$emit('date-select', value);
|
|
1339
|
+
setTimeout(() => this.timePickerChange = false, 0);
|
|
1276
1340
|
},
|
|
1277
1341
|
toggleAMPM(event) {
|
|
1278
1342
|
this.pm = !this.pm;
|
|
@@ -1285,7 +1349,28 @@ export default {
|
|
|
1285
1349
|
}
|
|
1286
1350
|
},
|
|
1287
1351
|
onMonthSelect(event, index) {
|
|
1288
|
-
this.
|
|
1352
|
+
if (this.view === 'month') {
|
|
1353
|
+
this.onDateSelect(event, {year: this.currentYear, month: index, day: 1, selectable: true});
|
|
1354
|
+
}
|
|
1355
|
+
else {
|
|
1356
|
+
this.currentMonth = index;
|
|
1357
|
+
this.currentView = 'date';
|
|
1358
|
+
this.$emit('month-change', {month: this.currentMonth + 1, year: this.currentYear});
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
setTimeout(this.updateFocus, 0);
|
|
1362
|
+
},
|
|
1363
|
+
onYearSelect(event, year) {
|
|
1364
|
+
if (this.view === 'year') {
|
|
1365
|
+
this.onDateSelect(event, {year: year, month: 0, day: 1, selectable: true});
|
|
1366
|
+
}
|
|
1367
|
+
else {
|
|
1368
|
+
this.currentYear = year;
|
|
1369
|
+
this.currentView = 'month';
|
|
1370
|
+
this.$emit('year-change', {month: this.currentMonth + 1, year: this.currentYear});
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
setTimeout(this.updateFocus, 0);
|
|
1289
1374
|
},
|
|
1290
1375
|
enableModality() {
|
|
1291
1376
|
if (!this.mask) {
|
|
@@ -1340,6 +1425,10 @@ export default {
|
|
|
1340
1425
|
}
|
|
1341
1426
|
},
|
|
1342
1427
|
isValidSelection(value) {
|
|
1428
|
+
if (value == null) {
|
|
1429
|
+
return true;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1343
1432
|
let isValid = true;
|
|
1344
1433
|
if (this.isSingleSelection()) {
|
|
1345
1434
|
if (!this.isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false)) {
|
|
@@ -1508,7 +1597,7 @@ export default {
|
|
|
1508
1597
|
iValue++;
|
|
1509
1598
|
};
|
|
1510
1599
|
|
|
1511
|
-
if (this.
|
|
1600
|
+
if (this.currentView === 'month') {
|
|
1512
1601
|
day = 1;
|
|
1513
1602
|
}
|
|
1514
1603
|
|
|
@@ -1703,7 +1792,9 @@ export default {
|
|
|
1703
1792
|
}
|
|
1704
1793
|
|
|
1705
1794
|
//enter
|
|
1706
|
-
|
|
1795
|
+
//space
|
|
1796
|
+
case 13:
|
|
1797
|
+
case 32: {
|
|
1707
1798
|
this.onDateSelect(event, date);
|
|
1708
1799
|
event.preventDefault();
|
|
1709
1800
|
break;
|
|
@@ -1737,7 +1828,7 @@ export default {
|
|
|
1737
1828
|
}
|
|
1738
1829
|
else {
|
|
1739
1830
|
let prevMonthContainer = this.overlay.children[groupIndex - 1];
|
|
1740
|
-
let cells = DomHandler.find(prevMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled)');
|
|
1831
|
+
let cells = DomHandler.find(prevMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
|
1741
1832
|
let focusCell = cells[cells.length - 1];
|
|
1742
1833
|
focusCell.tabIndex = '0';
|
|
1743
1834
|
focusCell.focus();
|
|
@@ -1750,7 +1841,7 @@ export default {
|
|
|
1750
1841
|
}
|
|
1751
1842
|
else {
|
|
1752
1843
|
let nextMonthContainer = this.overlay.children[groupIndex + 1];
|
|
1753
|
-
let focusCell = DomHandler.findSingle(nextMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled)');
|
|
1844
|
+
let focusCell = DomHandler.findSingle(nextMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
|
1754
1845
|
focusCell.tabIndex = '0';
|
|
1755
1846
|
focusCell.focus();
|
|
1756
1847
|
}
|
|
@@ -1783,6 +1874,10 @@ export default {
|
|
|
1783
1874
|
prevCell.tabIndex = '0';
|
|
1784
1875
|
prevCell.focus();
|
|
1785
1876
|
}
|
|
1877
|
+
else {
|
|
1878
|
+
this.navigationState = {backward: true};
|
|
1879
|
+
this.navBackward(event);
|
|
1880
|
+
}
|
|
1786
1881
|
event.preventDefault();
|
|
1787
1882
|
break;
|
|
1788
1883
|
}
|
|
@@ -1795,12 +1890,18 @@ export default {
|
|
|
1795
1890
|
nextCell.tabIndex = '0';
|
|
1796
1891
|
nextCell.focus();
|
|
1797
1892
|
}
|
|
1893
|
+
else {
|
|
1894
|
+
this.navigationState = {backward: false};
|
|
1895
|
+
this.navForward(event);
|
|
1896
|
+
}
|
|
1798
1897
|
event.preventDefault();
|
|
1799
1898
|
break;
|
|
1800
1899
|
}
|
|
1801
1900
|
|
|
1802
1901
|
//enter
|
|
1803
|
-
|
|
1902
|
+
//space
|
|
1903
|
+
case 13:
|
|
1904
|
+
case 32: {
|
|
1804
1905
|
this.onMonthSelect(event, index);
|
|
1805
1906
|
event.preventDefault();
|
|
1806
1907
|
break;
|
|
@@ -1824,8 +1925,87 @@ export default {
|
|
|
1824
1925
|
break;
|
|
1825
1926
|
}
|
|
1826
1927
|
},
|
|
1928
|
+
onYearCellKeydown(event, index) {
|
|
1929
|
+
const cell = event.currentTarget;
|
|
1930
|
+
|
|
1931
|
+
switch (event.which) {
|
|
1932
|
+
//arrows
|
|
1933
|
+
case 38:
|
|
1934
|
+
case 40: {
|
|
1935
|
+
cell.tabIndex = '-1';
|
|
1936
|
+
var cells = cell.parentElement.children;
|
|
1937
|
+
var cellIndex = DomHandler.index(cell);
|
|
1938
|
+
let nextCell = cells[event.which === 40 ? cellIndex + 2 : cellIndex - 2];
|
|
1939
|
+
if (nextCell) {
|
|
1940
|
+
nextCell.tabIndex = '0';
|
|
1941
|
+
nextCell.focus();
|
|
1942
|
+
}
|
|
1943
|
+
event.preventDefault();
|
|
1944
|
+
break;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
//left arrow
|
|
1948
|
+
case 37: {
|
|
1949
|
+
cell.tabIndex = '-1';
|
|
1950
|
+
let prevCell = cell.previousElementSibling;
|
|
1951
|
+
if (prevCell) {
|
|
1952
|
+
prevCell.tabIndex = '0';
|
|
1953
|
+
prevCell.focus();
|
|
1954
|
+
}
|
|
1955
|
+
else {
|
|
1956
|
+
this.navigationState = {backward: true};
|
|
1957
|
+
this.navBackward(event);
|
|
1958
|
+
}
|
|
1959
|
+
event.preventDefault();
|
|
1960
|
+
break;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
//right arrow
|
|
1964
|
+
case 39: {
|
|
1965
|
+
cell.tabIndex = '-1';
|
|
1966
|
+
let nextCell = cell.nextElementSibling;
|
|
1967
|
+
if (nextCell) {
|
|
1968
|
+
nextCell.tabIndex = '0';
|
|
1969
|
+
nextCell.focus();
|
|
1970
|
+
}
|
|
1971
|
+
else {
|
|
1972
|
+
this.navigationState = {backward: false};
|
|
1973
|
+
this.navForward(event);
|
|
1974
|
+
}
|
|
1975
|
+
event.preventDefault();
|
|
1976
|
+
break;
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
//enter
|
|
1980
|
+
//space
|
|
1981
|
+
case 13:
|
|
1982
|
+
case 32: {
|
|
1983
|
+
this.onYearSelect(event, index);
|
|
1984
|
+
event.preventDefault();
|
|
1985
|
+
break;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
//escape
|
|
1989
|
+
case 27: {
|
|
1990
|
+
this.overlayVisible = false;
|
|
1991
|
+
event.preventDefault();
|
|
1992
|
+
break;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
//tab
|
|
1996
|
+
case 9: {
|
|
1997
|
+
this.trapFocus(event);
|
|
1998
|
+
break;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
default:
|
|
2002
|
+
//no op
|
|
2003
|
+
break;
|
|
2004
|
+
}
|
|
2005
|
+
},
|
|
1827
2006
|
updateFocus() {
|
|
1828
2007
|
let cell;
|
|
2008
|
+
|
|
1829
2009
|
if (this.navigationState) {
|
|
1830
2010
|
if (this.navigationState.button) {
|
|
1831
2011
|
this.initFocusableCell();
|
|
@@ -1837,11 +2017,32 @@ export default {
|
|
|
1837
2017
|
}
|
|
1838
2018
|
else {
|
|
1839
2019
|
if (this.navigationState.backward) {
|
|
1840
|
-
let cells
|
|
1841
|
-
|
|
2020
|
+
let cells;
|
|
2021
|
+
|
|
2022
|
+
if (this.currentView === 'month') {
|
|
2023
|
+
cells = DomHandler.find(this.overlay, '.p-monthpicker .p-monthpicker-month:not(.p-disabled)');
|
|
2024
|
+
}
|
|
2025
|
+
else if (this.currentView === 'year') {
|
|
2026
|
+
cells = DomHandler.find(this.overlay, '.p-yearpicker .p-yearpicker-year:not(.p-disabled)');
|
|
2027
|
+
}
|
|
2028
|
+
else {
|
|
2029
|
+
cells = DomHandler.find(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
if (cells && cells.length > 0) {
|
|
2033
|
+
cell = cells[cells.length - 1];
|
|
2034
|
+
}
|
|
1842
2035
|
}
|
|
1843
2036
|
else {
|
|
1844
|
-
|
|
2037
|
+
if (this.currentView === 'month') {
|
|
2038
|
+
cell = DomHandler.findSingle(this.overlay, '.p-monthpicker .p-monthpicker-month:not(.p-disabled)');
|
|
2039
|
+
}
|
|
2040
|
+
else if (this.currentView === 'year') {
|
|
2041
|
+
cell = DomHandler.findSingle(this.overlay, '.p-yearpicker .p-yearpicker-year:not(.p-disabled)');
|
|
2042
|
+
}
|
|
2043
|
+
else {
|
|
2044
|
+
cell = DomHandler.findSingle(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
|
2045
|
+
}
|
|
1845
2046
|
}
|
|
1846
2047
|
|
|
1847
2048
|
if (cell) {
|
|
@@ -1859,25 +2060,35 @@ export default {
|
|
|
1859
2060
|
initFocusableCell() {
|
|
1860
2061
|
let cell;
|
|
1861
2062
|
|
|
1862
|
-
if (this.
|
|
2063
|
+
if (this.currentView === 'month') {
|
|
1863
2064
|
let cells = DomHandler.find(this.overlay, '.p-monthpicker .p-monthpicker-month');
|
|
1864
2065
|
let selectedCell= DomHandler.findSingle(this.overlay, '.p-monthpicker .p-monthpicker-month.p-highlight');
|
|
1865
2066
|
cells.forEach(cell => cell.tabIndex = -1);
|
|
1866
2067
|
cell = selectedCell || cells[0];
|
|
1867
2068
|
}
|
|
2069
|
+
else if (this.currentView === 'year') {
|
|
2070
|
+
let cells = DomHandler.find(this.overlay, '.p-yearpicker .p-yearpicker-year');
|
|
2071
|
+
let selectedCell= DomHandler.findSingle(this.overlay, '.p-yearpicker .p-yearpicker-year.p-highlight');
|
|
2072
|
+
cells.forEach(cell => cell.tabIndex = -1);
|
|
2073
|
+
cell = selectedCell || cells[0];
|
|
2074
|
+
}
|
|
1868
2075
|
else {
|
|
1869
2076
|
cell = DomHandler.findSingle(this.overlay, 'span.p-highlight');
|
|
1870
2077
|
if (!cell) {
|
|
1871
|
-
let todayCell = DomHandler.findSingle(this.overlay, 'td.p-datepicker-today span:not(.p-disabled)');
|
|
2078
|
+
let todayCell = DomHandler.findSingle(this.overlay, 'td.p-datepicker-today span:not(.p-disabled):not(.p-ink');
|
|
1872
2079
|
if (todayCell)
|
|
1873
2080
|
cell = todayCell;
|
|
1874
2081
|
else
|
|
1875
|
-
cell = DomHandler.findSingle(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled)');
|
|
2082
|
+
cell = DomHandler.findSingle(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink');
|
|
1876
2083
|
}
|
|
1877
2084
|
}
|
|
1878
2085
|
|
|
1879
2086
|
if (cell) {
|
|
1880
2087
|
cell.tabIndex = '0';
|
|
2088
|
+
|
|
2089
|
+
if ((!this.navigationState || !this.navigationState.button) && !this.timePickerChange) {
|
|
2090
|
+
cell.focus();
|
|
2091
|
+
}
|
|
1881
2092
|
}
|
|
1882
2093
|
},
|
|
1883
2094
|
trapFocus(event) {
|
|
@@ -1925,12 +2136,6 @@ export default {
|
|
|
1925
2136
|
}
|
|
1926
2137
|
},
|
|
1927
2138
|
onInput(event) {
|
|
1928
|
-
// IE 11 Workaround for input placeholder : https://github.com/primefaces/primeng/issues/2026
|
|
1929
|
-
if (!this.isKeydown) {
|
|
1930
|
-
return;
|
|
1931
|
-
}
|
|
1932
|
-
this.isKeydown = false;
|
|
1933
|
-
|
|
1934
2139
|
try {
|
|
1935
2140
|
this.selectionStart = this.$refs.input.$el.selectionStart;
|
|
1936
2141
|
this.selectionEnd = this.$refs.input.$el.selectionEnd;
|
|
@@ -1941,9 +2146,9 @@ export default {
|
|
|
1941
2146
|
}
|
|
1942
2147
|
}
|
|
1943
2148
|
catch(err) {
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
2149
|
+
if (this.keepInvalid) {
|
|
2150
|
+
this.updateModel(event.target.value);
|
|
2151
|
+
}
|
|
1947
2152
|
}
|
|
1948
2153
|
},
|
|
1949
2154
|
onFocus() {
|
|
@@ -1955,8 +2160,7 @@ export default {
|
|
|
1955
2160
|
onBlur() {
|
|
1956
2161
|
this.focused = false;
|
|
1957
2162
|
},
|
|
1958
|
-
onKeyDown(
|
|
1959
|
-
this.isKeydown = true;
|
|
2163
|
+
onKeyDown() {
|
|
1960
2164
|
if (event.keyCode === 40 && this.overlay) {
|
|
1961
2165
|
this.trapFocus(event);
|
|
1962
2166
|
}
|
|
@@ -1989,23 +2193,81 @@ export default {
|
|
|
1989
2193
|
target: this.$el
|
|
1990
2194
|
});
|
|
1991
2195
|
}
|
|
2196
|
+
},
|
|
2197
|
+
onOverlayMouseUp(event) {
|
|
2198
|
+
this.onOverlayClick(event);
|
|
2199
|
+
},
|
|
2200
|
+
createResponsiveStyle() {
|
|
2201
|
+
if (this.numberOfMonths > 1 && this.responsiveOptions) {
|
|
2202
|
+
if (!this.responsiveStyleElement) {
|
|
2203
|
+
this.responsiveStyleElement = document.createElement('style');
|
|
2204
|
+
this.responsiveStyleElement.type = 'text/css';
|
|
2205
|
+
document.body.appendChild(this.responsiveStyleElement);
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
let innerHTML = '';
|
|
2209
|
+
if (this.responsiveOptions) {
|
|
2210
|
+
let responsiveOptions = [...this.responsiveOptions]
|
|
2211
|
+
.filter(o => !!(o.breakpoint && o.numMonths))
|
|
2212
|
+
.sort((o1, o2) => -1 * o1.breakpoint.localeCompare(o2.breakpoint, undefined, { numeric: true }));
|
|
2213
|
+
|
|
2214
|
+
for (let i = 0; i < responsiveOptions.length; i++) {
|
|
2215
|
+
let { breakpoint, numMonths } = responsiveOptions[i];
|
|
2216
|
+
let styles = `
|
|
2217
|
+
.p-datepicker[${this.attributeSelector}] .p-datepicker-group:nth-child(${numMonths}) .p-datepicker-next {
|
|
2218
|
+
display: inline-flex !important;
|
|
2219
|
+
}
|
|
2220
|
+
`;
|
|
2221
|
+
|
|
2222
|
+
for (let j = numMonths; j < this.numberOfMonths; j++) {
|
|
2223
|
+
styles += `
|
|
2224
|
+
.p-datepicker[${this.attributeSelector}] .p-datepicker-group:nth-child(${j + 1}) {
|
|
2225
|
+
display: none !important;
|
|
2226
|
+
}
|
|
2227
|
+
`
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
innerHTML += `
|
|
2231
|
+
@media screen and (max-width: ${breakpoint}) {
|
|
2232
|
+
${styles}
|
|
2233
|
+
}
|
|
2234
|
+
`
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
this.responsiveStyleElement.innerHTML = innerHTML;
|
|
2239
|
+
}
|
|
2240
|
+
},
|
|
2241
|
+
destroyResponsiveStyleElement() {
|
|
2242
|
+
if (this.responsiveStyleElement) {
|
|
2243
|
+
this.responsiveStyleElement.remove();
|
|
2244
|
+
this.responsiveStyleElement = null;
|
|
2245
|
+
}
|
|
1992
2246
|
}
|
|
1993
2247
|
},
|
|
1994
2248
|
computed: {
|
|
1995
2249
|
viewDate() {
|
|
1996
2250
|
let propValue = this.modelValue;
|
|
1997
|
-
if (typeof propValue === 'string') {
|
|
1998
|
-
return new Date();
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
2251
|
if (propValue && Array.isArray(propValue)) {
|
|
2002
2252
|
propValue = propValue[0];
|
|
2003
2253
|
}
|
|
2004
2254
|
|
|
2005
|
-
|
|
2255
|
+
if (propValue && typeof propValue !== 'string') {
|
|
2256
|
+
return propValue;
|
|
2257
|
+
}
|
|
2258
|
+
else {
|
|
2259
|
+
let today = new Date();
|
|
2260
|
+
if (this.maxDate && this.maxDate < today) {
|
|
2261
|
+
return this.maxDate;
|
|
2262
|
+
}
|
|
2263
|
+
if (this.minDate && this.minDate > today) {
|
|
2264
|
+
return this.minDate;
|
|
2265
|
+
}
|
|
2266
|
+
return today;
|
|
2267
|
+
}
|
|
2006
2268
|
},
|
|
2007
2269
|
inputFieldValue() {
|
|
2008
|
-
return this.
|
|
2270
|
+
return this.formatValue(this.modelValue);
|
|
2009
2271
|
},
|
|
2010
2272
|
containerClass() {
|
|
2011
2273
|
return [
|
|
@@ -2024,7 +2286,8 @@ export default {
|
|
|
2024
2286
|
'p-disabled': this.$attrs.disabled,
|
|
2025
2287
|
'p-datepicker-timeonly': this.timeOnly,
|
|
2026
2288
|
'p-datepicker-multiple-month': this.numberOfMonths > 1,
|
|
2027
|
-
'p-datepicker-monthpicker': (this.
|
|
2289
|
+
'p-datepicker-monthpicker': (this.currentView === 'month'),
|
|
2290
|
+
'p-datepicker-yearpicker': (this.currentView === 'year'),
|
|
2028
2291
|
'p-datepicker-touch-ui': this.touchUI,
|
|
2029
2292
|
'p-input-filled': this.$primevue.config.inputStyle === 'filled',
|
|
2030
2293
|
'p-ripple-disabled': this.$primevue.config.ripple === false
|
|
@@ -2152,6 +2415,15 @@ export default {
|
|
|
2152
2415
|
|
|
2153
2416
|
return monthPickerValues;
|
|
2154
2417
|
},
|
|
2418
|
+
yearPickerValues() {
|
|
2419
|
+
let yearPickerValues = [];
|
|
2420
|
+
let base = this.currentYear - (this.currentYear % 10);
|
|
2421
|
+
for (let i = 0; i < 10; i++) {
|
|
2422
|
+
yearPickerValues.push(base + i);
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
return yearPickerValues;
|
|
2426
|
+
},
|
|
2155
2427
|
formattedCurrentHour() {
|
|
2156
2428
|
return this.currentHour < 10 ? '0' + this.currentHour : this.currentHour;
|
|
2157
2429
|
},
|
|
@@ -2178,6 +2450,12 @@ export default {
|
|
|
2178
2450
|
},
|
|
2179
2451
|
appendTarget() {
|
|
2180
2452
|
return this.appendDisabled ? null : this.appendTo;
|
|
2453
|
+
},
|
|
2454
|
+
attributeSelector() {
|
|
2455
|
+
return UniqueComponentId();
|
|
2456
|
+
},
|
|
2457
|
+
switchViewButtonDisabled() {
|
|
2458
|
+
return this.numberOfMonths > 1 || this.$attrs.disabled;
|
|
2181
2459
|
}
|
|
2182
2460
|
},
|
|
2183
2461
|
components: {
|
|
@@ -2194,6 +2472,7 @@ export default {
|
|
|
2194
2472
|
.p-calendar {
|
|
2195
2473
|
position: relative;
|
|
2196
2474
|
display: inline-flex;
|
|
2475
|
+
max-width: 100%;
|
|
2197
2476
|
}
|
|
2198
2477
|
|
|
2199
2478
|
.p-calendar .p-inputtext {
|
|
@@ -2233,8 +2512,9 @@ export default {
|
|
|
2233
2512
|
}
|
|
2234
2513
|
|
|
2235
2514
|
.p-datepicker-inline {
|
|
2236
|
-
display: inline-
|
|
2515
|
+
display: inline-block;
|
|
2237
2516
|
position: static;
|
|
2517
|
+
overflow-x: auto;
|
|
2238
2518
|
}
|
|
2239
2519
|
|
|
2240
2520
|
/* Header */
|
|
@@ -2263,6 +2543,10 @@ export default {
|
|
|
2263
2543
|
display: flex;
|
|
2264
2544
|
}
|
|
2265
2545
|
|
|
2546
|
+
.p-datepicker-multiple-month .p-datepicker-group-container .p-datepicker-group {
|
|
2547
|
+
flex: 1 1 auto;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2266
2550
|
/* DatePicker Table */
|
|
2267
2551
|
.p-datepicker table {
|
|
2268
2552
|
width: 100%;
|
|
@@ -2290,6 +2574,17 @@ export default {
|
|
|
2290
2574
|
position: relative;
|
|
2291
2575
|
}
|
|
2292
2576
|
|
|
2577
|
+
/* Year Picker */
|
|
2578
|
+
.p-yearpicker-year {
|
|
2579
|
+
width: 50%;
|
|
2580
|
+
display: inline-flex;
|
|
2581
|
+
align-items: center;
|
|
2582
|
+
justify-content: center;
|
|
2583
|
+
cursor: pointer;
|
|
2584
|
+
overflow: hidden;
|
|
2585
|
+
position: relative;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2293
2588
|
/* Button Bar */
|
|
2294
2589
|
.p-datepicker-buttonbar {
|
|
2295
2590
|
display: flex;
|