diff --git a/api-generator/components/dock.js b/api-generator/components/dock.js index 7fd3997a2..3920dba71 100644 --- a/api-generator/components/dock.js +++ b/api-generator/components/dock.js @@ -28,6 +28,12 @@ const DockProps = [ type: "boolean", default: "true", description: "Whether to apply 'router-link-active-exact' class if route exactly matches the item path." + }, + { + name: "tooltipOptions", + type: "object", + default: "null", + description: "Whether to display the tooltip on items. The modifiers of tooltip can be used like an object in it. Valid keys are 'event' and 'position'." } ]; @@ -45,4 +51,4 @@ module.exports = { props: DockProps, slots: DockSlots } -} \ No newline at end of file +} diff --git a/api-generator/components/image.js b/api-generator/components/image.js index 80c588b4e..b7643278f 100644 --- a/api-generator/components/image.js +++ b/api-generator/components/image.js @@ -22,7 +22,7 @@ const ImageSlots = [ { name: "indicator", description: "Custom content for the preview indicator" - }- + } ]; module.exports = { diff --git a/api-generator/components/speeddial.js b/api-generator/components/speeddial.js index ffa68dbdf..21b21112f 100644 --- a/api-generator/components/speeddial.js +++ b/api-generator/components/speeddial.js @@ -100,6 +100,12 @@ const SpeedDialProps = [ type: "any", default: "null", description: "Style class of the element." + }, + { + name: "tooltipOptions", + type: "object", + default: "null", + description: "Whether to display the tooltip on items. The modifiers of tooltip can be used like an object in it. Valid keys are 'event' and 'position'." } ]; @@ -144,4 +150,4 @@ module.exports = { events: SpeedDialEvents, slots: SpeedDialSlots } -} \ No newline at end of file +} diff --git a/api-generator/components/tabmenu.js b/api-generator/components/tabmenu.js index 8ac64f24a..de136a868 100644 --- a/api-generator/components/tabmenu.js +++ b/api-generator/components/tabmenu.js @@ -10,6 +10,31 @@ const TabMenuProps = [ type: "boolean", default: "true", description: "Defines if active route highlight should match the exact route path." + }, + { + name: "activeIndex", + type: "number", + default: "0", + description: "Active index of menuitem." + } +]; + +const TabMenuEvents = [ + { + name: "tab-change", + description: "Callback to invoke when an active tab is changed.", + arguments: [ + { + name: "event.originalEvent", + type: "object", + description: "Original event" + }, + { + name: "event.index", + type: "number", + description: "Index of the selected tab" + } + ] } ]; @@ -25,6 +50,7 @@ module.exports = { name: "TabMenu", description: "TabMenu is a navigation component that displays items as tab headers.", props: TabMenuProps, + events: TabMenuEvents, slots: TabMenuSlots } }; diff --git a/api-generator/components/virtualscroller.js b/api-generator/components/virtualscroller.js index e454f8b89..75afb734e 100644 --- a/api-generator/components/virtualscroller.js +++ b/api-generator/components/virtualscroller.js @@ -110,7 +110,7 @@ const VirtualScrollerSlots = [ { name: "content", description: "Custom content for the component" - } + }, { name: "loader", description: "Custom content for the loader items" diff --git a/src/components/datatable/BodyCell.vue b/src/components/datatable/BodyCell.vue index 408c702fa..38da1f558 100755 --- a/src/components/datatable/BodyCell.vue +++ b/src/components/datatable/BodyCell.vue @@ -312,7 +312,7 @@ export default { let right = 0; let next = this.$el.nextElementSibling; if (next) { - right = DomHandler.getOuterWidth(next) + parseFloat(next.style.left); + right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0); } this.styleObject.right = right + 'px'; } @@ -320,7 +320,7 @@ export default { let left = 0; let prev = this.$el.previousElementSibling; if (prev) { - left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left); + left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0); } this.styleObject.left = left + 'px'; } diff --git a/src/components/datatable/HeaderCell.vue b/src/components/datatable/HeaderCell.vue index c15c73f40..4233a6b77 100644 --- a/src/components/datatable/HeaderCell.vue +++ b/src/components/datatable/HeaderCell.vue @@ -156,7 +156,7 @@ export default { let right = 0; let next = this.$el.nextElementSibling; if (next) { - right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right); + right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0); } this.styleObject.right = right + 'px'; } @@ -164,7 +164,7 @@ export default { let left = 0; let prev = this.$el.previousElementSibling; if (prev) { - left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left); + left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0); } this.styleObject.left = left + 'px'; } diff --git a/src/components/dock/Dock.d.ts b/src/components/dock/Dock.d.ts index 908876ca6..9ea7619bd 100644 --- a/src/components/dock/Dock.d.ts +++ b/src/components/dock/Dock.d.ts @@ -6,6 +6,7 @@ interface DockProps { class?: string; style?: any; exact?: boolean; + tooltipOptions?: any; } declare class Dock { diff --git a/src/components/dock/Dock.vue b/src/components/dock/Dock.vue index eaf85871a..29a96a110 100644 --- a/src/components/dock/Dock.vue +++ b/src/components/dock/Dock.vue @@ -1,6 +1,6 @@ @@ -17,6 +17,7 @@ export default { model: null, class: null, style: null, + tooltipOptions: null, exact: { type: Boolean, default: true diff --git a/src/components/dock/DockSub.vue b/src/components/dock/DockSub.vue index 2067794b4..8fe03717f 100644 --- a/src/components/dock/DockSub.vue +++ b/src/components/dock/DockSub.vue @@ -5,7 +5,7 @@ \ No newline at end of file + diff --git a/src/views/speeddial/SpeedDialDemo.vue b/src/views/speeddial/SpeedDialDemo.vue index 884c343a7..6bb1a3aa7 100644 --- a/src/views/speeddial/SpeedDialDemo.vue +++ b/src/views/speeddial/SpeedDialDemo.vue @@ -15,7 +15,7 @@ - + @@ -37,9 +37,9 @@
Tooltip
- + - +
@@ -214,4 +214,4 @@ export default { bottom: 0; } } - \ No newline at end of file + diff --git a/src/views/speeddial/SpeedDialDoc.vue b/src/views/speeddial/SpeedDialDoc.vue index f19c1d4d1..b1cd40920 100644 --- a/src/views/speeddial/SpeedDialDoc.vue +++ b/src/views/speeddial/SpeedDialDoc.vue @@ -52,7 +52,7 @@ items: [ window.location.href = 'https://vuejs.org/' } } -] +]
MenuModel API
@@ -179,6 +179,12 @@ items: [ null Inline style of the element. + + tooltipOptions + object + null + Whether to display the tooltip on items. The modifiers of Tooltip can be used like an object in it. Valid keys are 'event' and 'position'. + @@ -291,7 +297,7 @@ export default { - + @@ -313,9 +319,9 @@ export default {
Tooltip
- + - +
@@ -502,7 +508,7 @@ export default { - + @@ -524,9 +530,9 @@ export default {
Tooltip
- + - +
@@ -701,4 +707,4 @@ export default { } } } - \ No newline at end of file + diff --git a/src/views/steps/SeatDemo.vue b/src/views/steps/SeatDemo.vue index 3d7573d7e..30e0cdb13 100755 --- a/src/views/steps/SeatDemo.vue +++ b/src/views/steps/SeatDemo.vue @@ -11,11 +11,11 @@
- +
- +
@@ -43,24 +43,24 @@ export default { {name: 'Second Class', code: 'B', factor: 2}, {name: 'Third Class', code: 'C', factor: 3} ], - vagons: [], - selectedVagon: '', + wagons: [], + selectedWagon: '', seats: [], selectedSeat: '' } }, methods: { - setVagons(event) { + setWagons(event) { if (this.selectedClass && event.value) { - this.vagons = []; + this.wagons = []; this.seats = []; for (let i = 1; i < 3 * event.value.factor; i++) { - this.vagons.push({vagon: i + event.value.code, type: event.value.name, factor: event.value.factor}); + this.wagons.push({wagon: i + event.value.code, type: event.value.name, factor: event.value.factor}); } } }, setSeats(event) { - if (this.selectedVagon && event.value) { + if (this.selectedWagon && event.value) { this.seats = []; for (let i = 1; i < 10 * event.value.factor; i++) { this.seats.push({seat: i, type: event.value.type}); @@ -68,11 +68,11 @@ export default { } }, nextPage() { - this.$emit('next-page', {formData: {class: this.selectedClass.name, vagon: this.selectedVagon.vagon, seat: this.selectedSeat.seat}, pageIndex: 1}); + this.$emit('next-page', {formData: {class: this.selectedClass.name, wagon: this.selectedWagon.wagon, seat: this.selectedSeat.seat}, pageIndex: 1}); }, prevPage() { this.$emit('prev-page', {pageIndex: 1}); } } } - \ No newline at end of file + diff --git a/src/views/tabmenu/TabMenuDemo.vue b/src/views/tabmenu/TabMenuDemo.vue index 46b1223ec..76032cfbf 100755 --- a/src/views/tabmenu/TabMenuDemo.vue +++ b/src/views/tabmenu/TabMenuDemo.vue @@ -10,9 +10,21 @@
+
Default
+ +
+
Programmatic
+
+
+ + +
@@ -25,12 +37,20 @@ import TabMenuDoc from './TabMenuDoc'; export default { data() { return { + active: 3, items: [ {label: 'Home', icon: 'pi pi-fw pi-home', to: '/tabmenu'}, {label: 'Calendar', icon: 'pi pi-fw pi-calendar', to: '/tabmenu/calendar'}, {label: 'Edit', icon: 'pi pi-fw pi-pencil', to: '/tabmenu/edit'}, {label: 'Documentation', icon: 'pi pi-fw pi-file', to: '/tabmenu/documentation'}, {label: 'Settings', icon: 'pi pi-fw pi-cog', to: '/tabmenu/settings'} + ], + items2: [ + {label: 'Home', icon: 'pi pi-fw pi-home'}, + {label: 'Calendar', icon: 'pi pi-fw pi-calendar'}, + {label: 'Edit', icon: 'pi pi-fw pi-pencil'}, + {label: 'Documentation', icon: 'pi pi-fw pi-file'}, + {label: 'Settings', icon: 'pi pi-fw pi-cog'} ] } }, diff --git a/src/views/tabmenu/TabMenuDoc.vue b/src/views/tabmenu/TabMenuDoc.vue index 6d7b3e5d1..7eaacae45 100755 --- a/src/views/tabmenu/TabMenuDoc.vue +++ b/src/views/tabmenu/TabMenuDoc.vue @@ -10,9 +10,32 @@ import TabMenu from 'primevue/tabmenu';

TabMenu uses the common MenuModel API to define the items, visit MenuModel API for details.

Getting Started
-

TabMenu is integrated with Vue Router and requires a collection of menuitems as its model.

+

TabMenu requires a collection of menuitems as its model.


 <TabMenu :model="items" />
+
+
+ +

+export default {
+	data() {
+		return {
+			items: [
+                {label: 'Home', icon: 'pi pi-fw pi-home'},
+                {label: 'Calendar', icon: 'pi pi-fw pi-calendar'},
+                {label: 'Edit', icon: 'pi pi-fw pi-pencil'},
+                {label: 'Documentation', icon: 'pi pi-fw pi-file'},
+                {label: 'Settings', icon: 'pi pi-fw pi-cog'}
+            ]
+		}
+	}
+}
+
+
+ +

TabMenu can be also integrated with Vue Router.

+

+<TabMenu :model="items" />
 <router-view />
 
 
@@ -32,10 +55,24 @@ export default { } } + + +
Active
+

Visibility of the content is specified with the activeIndex property that supports one or two-way binding.

+ +

+<TabMenu :model="items" :activeIndex="activeIndex" />
+
+
+ +

Two-way binding requires v-model.

+

+<TabMenu :model="items" v-model:activeIndex="activeIndex" />
+
 
Templating
-

TabMenu offers content customization with the item template that receives the menuitem instance from the model as a parameter.

+

TabMenu offers content customization with the item template that receives the menuitem instance from the model as a parameter.