diff --git a/components/accordion/Accordion.d.ts b/components/accordion/Accordion.d.ts index f70354ce2..640efc584 100755 --- a/components/accordion/Accordion.d.ts +++ b/components/accordion/Accordion.d.ts @@ -16,7 +16,12 @@ export interface AccordionTabOpenEvent { /** * @extends {AccordionTabOpenEvent} */ -export interface AccordionTabCloseEvent extends AccordionTabOpenEvent { } +export interface AccordionTabCloseEvent extends AccordionTabOpenEvent {} + +/** + * @extends AccordionTabOpenEvent + */ +export interface AccordionClickEvent extends AccordionTabOpenEvent {} export interface AccordionProps { /** @@ -39,6 +44,14 @@ export interface AccordionProps { * Icon of an expanded tab. */ collapseIcon?: string | undefined; + /** + * Index of the element in tabbing order. + */ + tabindex?: number | undefined; + /** + * When enabled, the focused tab is activated. + */ + selectOnFocus?: boolean | undefined; } export interface AccordionSlots { @@ -64,13 +77,18 @@ export declare type AccordionEmits = { * @param {AccordionTabCloseEvent} event - Custom tab close event. */ 'tab-close': (event: AccordionTabCloseEvent) => void; -} + /** + * Callback to invoke when an active tab is clicked. + * @param {AccordionClickEvent} event - Custom tab click event. + */ + 'tab-click': (event: AccordionClickEvent) => void; +}; -declare class Accordion extends ClassComponent { } +declare class Accordion extends ClassComponent {} declare module '@vue/runtime-core' { interface GlobalComponents { - Accordion: GlobalComponentConstructor + Accordion: GlobalComponentConstructor; } } @@ -84,7 +102,7 @@ declare module '@vue/runtime-core' { * * Demos: * - * - [Accordion](https://www.primefaces.org/primevue/showcase/#/accordion) + * - [Accordion](https://www.primefaces.org/primevue/accordion) * */ export default Accordion; diff --git a/components/accordion/Accordion.spec.js b/components/accordion/Accordion.spec.js index cc5ecac18..398f41fbe 100644 --- a/components/accordion/Accordion.spec.js +++ b/components/accordion/Accordion.spec.js @@ -4,7 +4,7 @@ import AccordionTab from '@/components/accordiontab/AccordionTab.vue'; describe('Accordion.vue', () => { let wrapper; - + beforeEach(() => { wrapper = mount(Accordion, { global: { @@ -39,7 +39,7 @@ describe('Accordion.vue', () => { expect(wrapper.findAll('.p-accordion-tab').length).toBe(3); }); - it('should activeIndex change', async() => { + it('should activeIndex change', async () => { await wrapper.setProps({ activeIndex: 1 }); const allTabs = wrapper.findAll('.p-accordion-tab'); @@ -47,4 +47,4 @@ describe('Accordion.vue', () => { expect(allTabs[0].classes()).not.toContain('p-accordion-tab-active'); expect(allTabs[1].classes()).toContain('p-accordion-tab-active'); }); -}); \ No newline at end of file +}); diff --git a/components/accordion/Accordion.vue b/components/accordion/Accordion.vue index 19f6d97a1..9d96e3d72 100755 --- a/components/accordion/Accordion.vue +++ b/components/accordion/Accordion.vue @@ -1,17 +1,35 @@ diff --git a/components/cascadeselect/CascadeSelect.d.ts b/components/cascadeselect/CascadeSelect.d.ts index 0219e76ca..fcff2b67f 100644 --- a/components/cascadeselect/CascadeSelect.d.ts +++ b/components/cascadeselect/CascadeSelect.d.ts @@ -25,7 +25,7 @@ export interface CascadeSelectChangeEvent { /** * @extends CascadeSelectChangeEvent */ -export interface CascadeSelectGroupChangeEvent extends CascadeSelectChangeEvent { } +export interface CascadeSelectGroupChangeEvent extends CascadeSelectChangeEvent {} export interface CascadeSelectProps { /** @@ -121,6 +121,11 @@ export interface CascadeSelectProps { * Default value is true. */ autoOptionFocus?: boolean | undefined; + /** + * When enabled, the focused option is selected/opened. + * Default value is false. + */ + selectOnFocus?: boolean | undefined; /** * Locale to use in searching. The default locale is the host environment's current locale. */ @@ -205,22 +210,22 @@ export declare type CascadeSelectEmits = { * Callback to invoke on value change. * @param { CascadeSelectChangeEvent } event - Custom change event. */ - 'change': (event: CascadeSelectChangeEvent) => void; + change: (event: CascadeSelectChangeEvent) => void; /** * Callback to invoke when the component receives focus. * @param {Event} event - Browser event. */ - 'focus': (event: Event) => void; + focus: (event: Event) => void; /** * Callback to invoke when the component loses focus. * @param {Event} event - Browser event. */ - 'blur': (event: Event) => void; + blur: (event: Event) => void; /** * Callback to invoke on click. * @param { Event } event - Browser event. */ - 'click': (event: Event) => void; + click: (event: Event) => void; /** * Callback to invoke when a group changes. * @param { CascadeSelectGroupChangeEvent } event - Custom change event. @@ -237,18 +242,18 @@ export declare type CascadeSelectEmits = { /** * Callback to invoke when the overlay is shown. */ - 'show': () => void; + show: () => void; /** * Callback to invoke when the overlay is hidden. */ - 'hide': () => void; -} + hide: () => void; +}; -declare class CascadeSelect extends ClassComponent { } +declare class CascadeSelect extends ClassComponent {} declare module '@vue/runtime-core' { interface GlobalComponents { - CascadeSelect: GlobalComponentConstructor + CascadeSelect: GlobalComponentConstructor; } } @@ -258,7 +263,7 @@ declare module '@vue/runtime-core' { * * Demos: * - * - [CascadeSelect](https://www.primefaces.org/primevue/showcase/#/cascadeselect) + * - [CascadeSelect](https://www.primefaces.org/primevue/cascadeselect) * */ export default CascadeSelect; diff --git a/components/cascadeselect/CascadeSelect.spec.js b/components/cascadeselect/CascadeSelect.spec.js index 8c01a9915..d9ce8060a 100644 --- a/components/cascadeselect/CascadeSelect.spec.js +++ b/components/cascadeselect/CascadeSelect.spec.js @@ -23,40 +23,38 @@ describe('CascadeSelect.vue', () => { { name: 'New South Wales', cities: [ - {cname: 'Sydney', code: 'A-SY'}, - {cname: 'Newcastle', code: 'A-NE'}, - {cname: 'Wollongong', code: 'A-WO'} + { cname: 'Sydney', code: 'A-SY' }, + { cname: 'Newcastle', code: 'A-NE' }, + { cname: 'Wollongong', code: 'A-WO' } ] }, { name: 'Queensland', cities: [ - {cname: 'Brisbane', code: 'A-BR'}, - {cname: 'Townsville', code: 'A-TO'} + { cname: 'Brisbane', code: 'A-BR' }, + { cname: 'Townsville', code: 'A-TO' } ] - }, - + } ] }, { - name: 'Canada', + name: 'Canada', code: 'CA', states: [ { name: 'Quebec', cities: [ - {cname: 'Montreal', code: 'C-MO'}, - {cname: 'Quebec City', code: 'C-QU'} + { cname: 'Montreal', code: 'C-MO' }, + { cname: 'Quebec City', code: 'C-QU' } ] }, { name: 'Ontario', cities: [ - {cname: 'Ottawa', code: 'C-OT'}, - {cname: 'Toronto', code: 'C-TO'} + { cname: 'Ottawa', code: 'C-OT' }, + { cname: 'Toronto', code: 'C-TO' } ] - }, - + } ] }, { @@ -66,26 +64,26 @@ describe('CascadeSelect.vue', () => { { name: 'California', cities: [ - {cname: 'Los Angeles', code: 'US-LA'}, - {cname: 'San Diego', code: 'US-SD'}, - {cname: 'San Francisco', code: 'US-SF'} + { cname: 'Los Angeles', code: 'US-LA' }, + { cname: 'San Diego', code: 'US-SD' }, + { cname: 'San Francisco', code: 'US-SF' } ] }, { name: 'Florida', cities: [ - {cname: 'Jacksonville', code: 'US-JA'}, - {cname: 'Miami', code: 'US-MI'}, - {cname: 'Tampa', code: 'US-TA'}, - {cname: 'Orlando', code: 'US-OR'} + { cname: 'Jacksonville', code: 'US-JA' }, + { cname: 'Miami', code: 'US-MI' }, + { cname: 'Tampa', code: 'US-TA' }, + { cname: 'Orlando', code: 'US-OR' } ] }, { name: 'Texas', cities: [ - {cname: 'Austin', code: 'US-AU'}, - {cname: 'Dallas', code: 'US-DA'}, - {cname: 'Houston', code: 'US-HO'} + { cname: 'Austin', code: 'US-AU' }, + { cname: 'Dallas', code: 'US-DA' }, + { cname: 'Houston', code: 'US-HO' } ] } ] @@ -98,11 +96,11 @@ describe('CascadeSelect.vue', () => { }); }); - it('should exist', async() => { + it('should exist', async () => { expect(wrapper.find('.p-cascadeselect.p-component').exists()).toBe(true); }); - it('should show list and sublist', async() => { + it('should show list and sublist', async () => { expect(wrapper.find('.p-cascadeselect.p-component').exists()).toBe(true); await wrapper.trigger('click'); @@ -112,6 +110,7 @@ describe('CascadeSelect.vue', () => { expect(wrapper.findAll('.p-cascadeselect-item-text')[0].text()).toBe('Australia'); const firstGroup = wrapper.findAll('.p-cascadeselect-item-content')[0]; + await firstGroup.trigger('click'); expect(wrapper.find('.p-cascadeselect-panel.p-cascadeselect-sublist').exists()).toBe(true); @@ -121,4 +120,4 @@ describe('CascadeSelect.vue', () => { expect(sublist.findAll('.p-cascadeselect-item.p-cascadeselect-item-group').length).toBe(2); expect(sublist.findAll('.p-cascadeselect-item-text')[0].text()).toBe('New South Wales'); }); -}); \ No newline at end of file +}); diff --git a/components/cascadeselect/CascadeSelect.vue b/components/cascadeselect/CascadeSelect.vue index 3f0d021bd..a742cb28d 100644 --- a/components/cascadeselect/CascadeSelect.vue +++ b/components/cascadeselect/CascadeSelect.vue @@ -1,13 +1,32 @@ diff --git a/components/column/Column.d.ts b/components/column/Column.d.ts index 371a4d0f2..26bc8e1de 100755 --- a/components/column/Column.d.ts +++ b/components/column/Column.d.ts @@ -464,14 +464,13 @@ export interface ColumnSlots { }) => VNode[]; } -export declare type ColumnEmits = { -} +export declare type ColumnEmits = {}; -declare class Column extends ClassComponent { } +declare class Column extends ClassComponent {} declare module '@vue/runtime-core' { interface GlobalComponents { - Column: GlobalComponentConstructor + Column: GlobalComponentConstructor; } } @@ -481,8 +480,8 @@ declare module '@vue/runtime-core' { * * Demos: * - * - [DataTable](https://www.primefaces.org/primevue/showcase/#/datatable) - * - [TreeTable](https://www.primefaces.org/primevue/showcase/#/treetable) + * - [DataTable](https://www.primefaces.org/primevue/datatable) + * - [TreeTable](https://www.primefaces.org/primevue/treetable) * */ export default Column; diff --git a/components/column/Column.vue b/components/column/Column.vue index c2be3e2ae..f0c23e217 100755 --- a/components/column/Column.vue +++ b/components/column/Column.vue @@ -182,5 +182,5 @@ export default { render() { return null; } -} +}; diff --git a/components/columngroup/ColumnGroup.d.ts b/components/columngroup/ColumnGroup.d.ts index fd0b09684..bbac19e42 100755 --- a/components/columngroup/ColumnGroup.d.ts +++ b/components/columngroup/ColumnGroup.d.ts @@ -9,17 +9,15 @@ export interface ColumnGroupProps { type?: ColumnGroupType; } -export interface ColumnGroupSlots { -} +export interface ColumnGroupSlots {} -export declare type ColumnGroupEmits = { -} +export declare type ColumnGroupEmits = {}; -declare class ColumnGroup extends ClassComponent { } +declare class ColumnGroup extends ClassComponent {} declare module '@vue/runtime-core' { interface GlobalComponents { - ColumnGroup: GlobalComponentConstructor + ColumnGroup: GlobalComponentConstructor; } } @@ -29,7 +27,7 @@ declare module '@vue/runtime-core' { * * Demos: * - * - [ColumnGroup](https://www.primefaces.org/primevue/showcase/#/datatable/colgroup) + * - [ColumnGroup](https://www.primefaces.org/primevue/datatable/colgroup) * */ export default ColumnGroup; diff --git a/components/columngroup/ColumnGroup.vue b/components/columngroup/ColumnGroup.vue index 679c41fba..3a92bfc8b 100755 --- a/components/columngroup/ColumnGroup.vue +++ b/components/columngroup/ColumnGroup.vue @@ -10,5 +10,5 @@ export default { render() { return null; } -} +}; diff --git a/components/config/PrimeVue.d.ts b/components/config/PrimeVue.d.ts index 231e87da4..4d5feff2c 100644 --- a/components/config/PrimeVue.d.ts +++ b/components/config/PrimeVue.d.ts @@ -24,6 +24,8 @@ interface PrimeVueLocaleAriaOptions { selectAll?: string; unselectAll?: string; close?: string; + previous?: string; + next?: string; } interface PrimeVueLocaleOptions { @@ -101,7 +103,7 @@ declare module 'vue/types/vue' { interface Vue { $primevue: { config: PrimeVueConfiguration; - } + }; } } @@ -109,6 +111,6 @@ declare module '@vue/runtime-core' { interface ComponentCustomProperties { $primevue: { config: PrimeVueConfiguration; - } + }; } } diff --git a/components/config/PrimeVue.js b/components/config/PrimeVue.js index aaaeec1a5..75f060a4a 100644 --- a/components/config/PrimeVue.js +++ b/components/config/PrimeVue.js @@ -1,5 +1,5 @@ -import {reactive,inject} from 'vue'; -import {FilterMatchMode} from 'primevue/api'; +import { reactive, inject } from 'vue'; +import { FilterMatchMode } from 'primevue/api'; const defaultOptions = { ripple: false, @@ -31,11 +31,11 @@ const defaultOptions = { choose: 'Choose', upload: 'Upload', cancel: 'Cancel', - dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], - monthNames: ["January","February","March","April","May","June","July","August","September","October","November","December"], - monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + dayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], chooseYear: 'Choose Year', chooseMonth: 'Choose Month', chooseDate: 'Choose Date', @@ -75,32 +75,15 @@ const defaultOptions = { stars: '{star} stars', selectAll: 'All items selected', unselectAll: 'All items unselected', - close: 'Close' + close: 'Close', + previous: 'Previous', + next: 'Next' } }, filterMatchModeOptions: { - text: [ - FilterMatchMode.STARTS_WITH, - FilterMatchMode.CONTAINS, - FilterMatchMode.NOT_CONTAINS, - FilterMatchMode.ENDS_WITH, - FilterMatchMode.EQUALS, - FilterMatchMode.NOT_EQUALS - ], - numeric: [ - FilterMatchMode.EQUALS, - FilterMatchMode.NOT_EQUALS, - FilterMatchMode.LESS_THAN, - FilterMatchMode.LESS_THAN_OR_EQUAL_TO, - FilterMatchMode.GREATER_THAN, - FilterMatchMode.GREATER_THAN_OR_EQUAL_TO - ], - date: [ - FilterMatchMode.DATE_IS, - FilterMatchMode.DATE_IS_NOT, - FilterMatchMode.DATE_BEFORE, - FilterMatchMode.DATE_AFTER - ] + text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS], + numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO], + date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER] }, zIndex: { modal: 1100, @@ -114,6 +97,7 @@ const PrimeVueSymbol = Symbol(); export function usePrimeVue() { const PrimeVue = inject(PrimeVueSymbol); + if (!PrimeVue) { throw new Error('PrimeVue is not installed!'); } @@ -123,10 +107,11 @@ export function usePrimeVue() { export default { install: (app, options) => { - let configOptions = options ? {...defaultOptions, ...options} : {...defaultOptions}; + let configOptions = options ? { ...defaultOptions, ...options } : { ...defaultOptions }; const PrimeVue = { config: reactive(configOptions) }; + app.config.globalProperties.$primevue = PrimeVue; app.provide(PrimeVueSymbol, PrimeVue); } diff --git a/components/confirmationeventbus/ConfirmationEventBus.js b/components/confirmationeventbus/ConfirmationEventBus.js index 844a1b111..602940783 100644 --- a/components/confirmationeventbus/ConfirmationEventBus.js +++ b/components/confirmationeventbus/ConfirmationEventBus.js @@ -1,3 +1,3 @@ -import {EventBus} from 'primevue/utils'; +import { EventBus } from 'primevue/utils'; -export default EventBus(); \ No newline at end of file +export default EventBus(); diff --git a/components/confirmationoptions/ConfirmationOptions.d.ts b/components/confirmationoptions/ConfirmationOptions.d.ts index 0d5b867f9..74a377ea0 100644 --- a/components/confirmationoptions/ConfirmationOptions.d.ts +++ b/components/confirmationoptions/ConfirmationOptions.d.ts @@ -39,6 +39,10 @@ export interface ConfirmationOptions { * Callback to execute when action is rejected. */ reject?: () => void; + /** + * Callback to execute when dialog is hidden. + */ + onHide?: () => void; /** * Label of the accept button. Defaults to PrimeVue Locale configuration. */ diff --git a/components/confirmationservice/ConfirmationService.js b/components/confirmationservice/ConfirmationService.js index 7f314435c..8ff807434 100644 --- a/components/confirmationservice/ConfirmationService.js +++ b/components/confirmationservice/ConfirmationService.js @@ -1,5 +1,5 @@ import ConfirmationEventBus from 'primevue/confirmationeventbus'; -import {PrimeVueConfirmSymbol} from 'primevue/useconfirm'; +import { PrimeVueConfirmSymbol } from 'primevue/useconfirm'; export default { install: (app) => { @@ -11,7 +11,8 @@ export default { ConfirmationEventBus.emit('close'); } }; + app.config.globalProperties.$confirm = ConfirmationService; app.provide(PrimeVueConfirmSymbol, ConfirmationService); } -}; \ No newline at end of file +}; diff --git a/components/confirmdialog/ConfirmDialog.d.ts b/components/confirmdialog/ConfirmDialog.d.ts index f2131a330..9c75d59d3 100644 --- a/components/confirmdialog/ConfirmDialog.d.ts +++ b/components/confirmdialog/ConfirmDialog.d.ts @@ -38,19 +38,16 @@ export interface ConfirmDialogSlots { * Custom message template. * @param {Object} scope - message slot's params. */ - message: (scope: { - message: ConfirmationOptions; - }) => VNode[]; + message: (scope: { message: ConfirmationOptions }) => VNode[]; } -export declare type ConfirmDialogEmits = { -} +export declare type ConfirmDialogEmits = {}; -declare class ConfirmDialog extends ClassComponent { } +declare class ConfirmDialog extends ClassComponent {} declare module '@vue/runtime-core' { interface GlobalComponents { - ConfirmDialog: GlobalComponentConstructor + ConfirmDialog: GlobalComponentConstructor; } } @@ -65,7 +62,7 @@ declare module '@vue/runtime-core' { * * Demos: * - * - [ConfirmDialog](https://www.primefaces.org/primevue/showcase/#/confirmdialog) + * - [ConfirmDialog](https://www.primefaces.org/primevue/confirmdialog) * */ export default ConfirmDialog; diff --git a/components/confirmdialog/ConfirmDialog.spec.js b/components/confirmdialog/ConfirmDialog.spec.js index a516f2cbe..dffc230a7 100644 --- a/components/confirmdialog/ConfirmDialog.spec.js +++ b/components/confirmdialog/ConfirmDialog.spec.js @@ -1,16 +1,16 @@ -import { mount } from '@vue/test-utils'; import PrimeVue from '@/components/config/PrimeVue'; +import { mount } from '@vue/test-utils'; import ConfirmDialog from './ConfirmDialog.vue'; describe('ConfirmDialog', () => { - it('should exist', async() => { + it('should exist', async () => { const wrapper = mount(ConfirmDialog, { global: { plugins: [PrimeVue], stubs: { teleport: true, transition: false - }, + } }, data() { return { @@ -19,22 +19,22 @@ describe('ConfirmDialog', () => { header: 'Confirmation', icon: 'pi pi-exclamation-triangle' } - } + }; } }); await wrapper.setData({ visible: true }); - + expect(wrapper.find('.p-dialog-mask .p-dialog.p-component').exists()).toBe(true); expect(wrapper.find('.p-dialog-title').text()).toBe('Confirmation'); expect(wrapper.find('.p-confirm-dialog-message').text()).toBe('Are you sure you want to proceed?'); await wrapper.vm.reject(); - expect(wrapper.find('.p-dialog-mask .p-dialog.p-component').exists()).toBe(false); + expect(wrapper.find('.p-dialog-mask .p-dialog.p-component').exists()).toBe(true); }); - it('should dialog trigger the accept function', async() => { + it('should dialog trigger the accept function', async () => { const wrapper = mount(ConfirmDialog, { global: { plugins: [PrimeVue], @@ -50,29 +50,30 @@ describe('ConfirmDialog', () => { header: 'Confirmation', icon: 'pi pi-exclamation-triangle', accept: () => { - console.log('accept') + // eslint-disable-next-line no-console + console.log('accept'); }, reject: () => { + // eslint-disable-next-line no-console console.log('reject'); - } } - } + }; } }); - + const acceptTriggered = jest.spyOn(wrapper.componentVM.confirmation, 'accept'); - + await wrapper.setData({ visible: true }); - + const CDAcceptBtn = wrapper.find('.p-confirm-dialog-accept'); await CDAcceptBtn.trigger('click'); - + expect(acceptTriggered).toBeCalled(); }); - it('should dialog trigger the reject function', async() => { + it('should dialog trigger the reject function', async () => { const wrapper = mount(ConfirmDialog, { global: { plugins: [PrimeVue], @@ -88,29 +89,30 @@ describe('ConfirmDialog', () => { header: 'Confirmation', icon: 'pi pi-exclamation-triangle', accept: () => { - console.log('accept') + // eslint-disable-next-line no-console + console.log('accept'); }, reject: () => { + // eslint-disable-next-line no-console console.log('reject'); - } } - } + }; } }); - + const rejectTriggered = jest.spyOn(wrapper.componentVM.confirmation, 'reject'); await wrapper.setData({ visible: true }); const CDRejectBtn = wrapper.find('.p-confirm-dialog-reject'); - + await CDRejectBtn.trigger('click'); - + expect(rejectTriggered).toBeCalled(); }); - it('should dialog close button work', async() => { + it('should dialog close button work', async () => { const wrapper = mount(ConfirmDialog, { global: { plugins: [PrimeVue], @@ -126,17 +128,17 @@ describe('ConfirmDialog', () => { header: 'Confirmation', icon: 'pi pi-exclamation-triangle' } - } + }; } }); await wrapper.setData({ visible: true }); - + const dialogCloseBtn = wrapper.find('.p-dialog-header-close'); await dialogCloseBtn.trigger('click'); - expect(wrapper.find('.p-dialog-mask .p-dialog.p-component').exists()).toBe(false); + expect(wrapper.find('.p-dialog-mask .p-dialog.p-component').exists()).toBe(true); }); it('should position work', async () => { @@ -157,7 +159,7 @@ describe('ConfirmDialog', () => { icon: 'pi pi-info-circle', position: 'bottom' } - } + }; } }); @@ -165,4 +167,4 @@ describe('ConfirmDialog', () => { expect(wrapper.find('.p-dialog-mask.p-dialog-bottom').exists()).toBe(true); }); -}); \ No newline at end of file +}); diff --git a/components/confirmdialog/ConfirmDialog.vue b/components/confirmdialog/ConfirmDialog.vue index 5dee6d61b..2efc92b79 100644 --- a/components/confirmdialog/ConfirmDialog.vue +++ b/components/confirmdialog/ConfirmDialog.vue @@ -1,22 +1,21 @@ diff --git a/components/confirmpopup/ConfirmPopup.d.ts b/components/confirmpopup/ConfirmPopup.d.ts index a304c8712..9dab5f0b2 100644 --- a/components/confirmpopup/ConfirmPopup.d.ts +++ b/components/confirmpopup/ConfirmPopup.d.ts @@ -14,19 +14,16 @@ export interface ConfirmPopupSlots { * Custom message template. * @param {Object} scope - message slot's params. */ - message: (scope: { - message: ConfirmationOptions; - }) => VNode[]; + message: (scope: { message: ConfirmationOptions }) => VNode[]; } -export declare type ConfirmPopupEmits = { -} +export declare type ConfirmPopupEmits = {}; -declare class ConfirmPopup extends ClassComponent { } +declare class ConfirmPopup extends ClassComponent {} declare module '@vue/runtime-core' { interface GlobalComponents { - ConfirmPopup: GlobalComponentConstructor + ConfirmPopup: GlobalComponentConstructor; } } @@ -41,7 +38,7 @@ declare module '@vue/runtime-core' { * * Demos: * - * - [ConfirmPopup](https://www.primefaces.org/primevue/showcase/#/confirmpopup) + * - [ConfirmPopup](https://www.primefaces.org/primevue/confirmpopup) * */ export default ConfirmPopup; diff --git a/components/confirmpopup/ConfirmPopup.vue b/components/confirmpopup/ConfirmPopup.vue index cd363cdb4..b73559c92 100644 --- a/components/confirmpopup/ConfirmPopup.vue +++ b/components/confirmpopup/ConfirmPopup.vue @@ -1,16 +1,16 @@