From 18c37218482f2e83f36060358809e542fa19e632 Mon Sep 17 00:00:00 2001 From: Bahadir Sofuoglu Date: Wed, 14 Sep 2022 14:26:01 +0300 Subject: [PATCH] Components added. Build issues fixed --- components/accordion/Accordion.d.ts | 28 +- components/accordion/Accordion.spec.js | 6 +- components/accordion/Accordion.vue | 273 +++- components/accordiontab/AccordionTab.d.ts | 38 +- components/accordiontab/AccordionTab.spec.js | 2 +- components/accordiontab/AccordionTab.vue | 9 +- components/api/Api.d.ts | 2 +- components/api/Api.js | 2 +- components/api/FilterMatchMode.js | 36 +- components/api/FilterOperator.js | 4 +- components/api/FilterService.js | 114 +- components/api/PrimeIcons.js | 476 +++--- components/api/ToastSeverity.js | 2 +- components/autocomplete/AutoComplete.d.ts | 33 +- components/autocomplete/AutoComplete.spec.js | 20 +- components/autocomplete/AutoComplete.vue | 365 +++-- components/avatar/Avatar.d.ts | 8 +- components/avatar/Avatar.spec.js | 2 +- components/avatar/Avatar.vue | 26 +- components/avatargroup/AvatarGroup.d.ts | 15 +- components/avatargroup/AvatarGroup.spec.js | 2 +- components/avatargroup/AvatarGroup.vue | 2 +- components/badge/Badge.d.ts | 9 +- components/badge/Badge.spec.js | 2 +- components/badge/Badge.vue | 29 +- components/badgedirective/BadgeDirective.js | 22 +- .../badgedirective/BadgeDirective.spec.js | 4 +- components/blockui/BlockUI.d.ts | 12 +- components/blockui/BlockUI.spec.js | 4 +- components/blockui/BlockUI.vue | 28 +- components/breadcrumb/Breadcrumb.d.ts | 11 +- components/breadcrumb/Breadcrumb.spec.js | 14 +- components/breadcrumb/Breadcrumb.vue | 4 +- components/breadcrumb/BreadcrumbItem.vue | 33 +- components/button/Button.d.ts | 17 +- components/button/Button.spec.js | 33 +- components/button/Button.vue | 36 +- components/calendar/Calendar.d.ts | 22 +- components/calendar/Calendar.spec.js | 15 +- components/calendar/Calendar.vue | 1376 ++++++++++------- components/card/Card.d.ts | 12 +- components/card/Card.spec.js | 2 +- components/card/Card.vue | 10 +- components/carousel/Carousel.d.ts | 48 +- components/carousel/Carousel.spec.js | 90 +- components/carousel/Carousel.vue | 999 ++++++------ components/cascadeselect/CascadeSelect.d.ts | 27 +- .../cascadeselect/CascadeSelect.spec.js | 53 +- components/cascadeselect/CascadeSelect.vue | 284 ++-- components/cascadeselect/CascadeSelectSub.vue | 58 +- components/chart/Chart.d.ts | 13 +- components/chart/Chart.vue | 24 +- components/checkbox/Checkbox.d.ts | 21 +- components/checkbox/Checkbox.spec.js | 2 +- components/checkbox/Checkbox.vue | 68 +- components/chip/Chip.d.ts | 10 +- components/chip/Chip.spec.js | 8 +- components/chip/Chip.vue | 24 +- components/chips/Chips.d.ts | 14 +- components/chips/Chips.spec.js | 8 +- components/chips/Chips.vue | 122 +- components/colorpicker/ColorPicker.d.ts | 23 +- components/colorpicker/ColorPicker.spec.js | 12 +- components/colorpicker/ColorPicker.vue | 256 +-- components/column/Column.d.ts | 11 +- components/column/Column.vue | 2 +- components/columngroup/ColumnGroup.d.ts | 12 +- components/columngroup/ColumnGroup.vue | 2 +- components/config/PrimeVue.d.ts | 6 +- components/config/PrimeVue.js | 47 +- .../ConfirmationEventBus.js | 4 +- .../ConfirmationOptions.d.ts | 4 + .../ConfirmationService.js | 5 +- components/confirmdialog/ConfirmDialog.d.ts | 13 +- .../confirmdialog/ConfirmDialog.spec.js | 56 +- components/confirmdialog/ConfirmDialog.vue | 33 +- components/confirmpopup/ConfirmPopup.d.ts | 13 +- components/confirmpopup/ConfirmPopup.vue | 76 +- components/contextmenu/ContextMenu.d.ts | 9 +- components/contextmenu/ContextMenu.spec.js | 143 +- components/contextmenu/ContextMenu.vue | 42 +- components/contextmenu/ContextMenuSub.vue | 96 +- components/datatable/BodyCell.vue | 168 +- components/datatable/ColumnFilter.vue | 223 +-- components/datatable/DataTable.d.ts | 48 +- components/datatable/DataTable.spec.js | 340 ++-- components/datatable/DataTable.vue | 764 +++++---- components/datatable/FooterCell.vue | 33 +- components/datatable/HeaderCell.vue | 159 +- components/datatable/HeaderCheckbox.vue | 17 +- components/datatable/RowCheckbox.vue | 20 +- components/datatable/RowRadioButton.vue | 8 +- components/datatable/TableBody.vue | 218 ++- components/datatable/TableFooter.vue | 37 +- components/datatable/TableHeader.vue | 184 ++- components/datatable/TableLoadingBody.vue | 6 +- components/dataview/DataView.d.ts | 16 +- components/dataview/DataView.spec.js | 66 +- components/dataview/DataView.vue | 146 +- .../DataViewLayoutOptions.d.ts | 11 +- .../DataViewLayoutOptions.spec.js | 4 +- .../DataViewLayoutOptions.vue | 62 +- .../deferredcontent/DeferredContent.d.ts | 13 +- .../deferredcontent/DeferredContent.spec.js | 2 +- .../deferredcontent/DeferredContent.vue | 15 +- components/dialog/Dialog.d.ts | 20 +- components/dialog/Dialog.spec.js | 42 +- components/dialog/Dialog.vue | 124 +- components/dialogservice/DialogService.js | 4 +- components/divider/Divider.d.ts | 9 +- components/divider/Divider.spec.js | 6 +- components/divider/Divider.vue | 27 +- components/dock/Dock.d.ts | 11 +- components/dock/Dock.vue | 6 +- components/dock/DockSub.vue | 71 +- components/dropdown/Dropdown.d.ts | 38 +- components/dropdown/Dropdown.spec.js | 131 +- components/dropdown/Dropdown.vue | 380 +++-- components/dynamicdialog/DynamicDialog.d.ts | 8 +- components/dynamicdialog/DynamicDialog.vue | 20 +- components/editor/Editor.d.ts | 24 +- components/editor/Editor.vue | 980 ++++++------ components/fieldset/Fieldset.d.ts | 14 +- components/fieldset/Fieldset.spec.js | 4 +- components/fieldset/Fieldset.vue | 48 +- components/fileupload/FileUpload.d.ts | 22 +- components/fileupload/FileUpload.vue | 144 +- components/fullcalendar/FullCalendar.d.ts | 10 +- components/fullcalendar/FullCalendar.vue | 1 + components/galleria/Galleria.d.ts | 8 +- components/galleria/Galleria.spec.js | 33 +- components/galleria/Galleria.vue | 73 +- components/galleria/GalleriaContent.vue | 89 +- components/galleria/GalleriaItem.vue | 80 +- components/galleria/GalleriaItemSlot.vue | 3 +- components/galleria/GalleriaThumbnails.vue | 198 +-- components/image/Image.d.ts | 9 +- components/image/Image.spec.js | 8 +- components/image/Image.vue | 34 +- components/inlinemessage/InlineMessage.d.ts | 9 +- .../inlinemessage/InlineMessage.spec.js | 4 +- components/inlinemessage/InlineMessage.vue | 21 +- components/inplace/Inplace.d.ts | 12 +- components/inplace/Inplace.spec.js | 4 +- components/inplace/Inplace.vue | 22 +- components/inputmask/InputMask.d.ts | 23 +- components/inputmask/InputMask.spec.js | 8 +- components/inputmask/InputMask.vue | 211 +-- components/inputnumber/InputNumber.d.ts | 27 +- components/inputnumber/InputNumber.spec.js | 40 +- components/inputnumber/InputNumber.vue | 416 ++--- components/inputswitch/InputSwitch.d.ts | 17 +- components/inputswitch/InputSwitch.spec.js | 2 +- components/inputswitch/InputSwitch.vue | 50 +- components/inputtext/InputText.d.ts | 11 +- components/inputtext/InputText.spec.js | 3 +- components/inputtext/InputText.vue | 6 +- components/knob/Knob.d.ts | 21 +- components/knob/Knob.spec.js | 4 +- components/knob/Knob.vue | 76 +- components/listbox/Listbox.d.ts | 26 +- components/listbox/Listbox.spec.js | 27 +- components/listbox/Listbox.vue | 241 +-- components/megamenu/MegaMenu.d.ts | 11 +- components/megamenu/MegaMenu.spec.js | 18 +- components/megamenu/MegaMenu.vue | 202 +-- components/menu/Menu.d.ts | 13 +- components/menu/Menu.spec.js | 56 +- components/menu/Menu.vue | 52 +- components/menu/Menuitem.vue | 39 +- components/menubar/Menubar.d.ts | 11 +- components/menubar/Menubar.spec.js | 38 +- components/menubar/Menubar.vue | 29 +- components/menubar/MenubarSub.vue | 141 +- components/menuitem/MenuItem.d.ts | 4 +- components/message/Message.d.ts | 10 +- components/message/Message.spec.js | 2 +- components/message/Message.vue | 33 +- components/multiselect/MultiSelect.d.ts | 27 +- components/multiselect/MultiSelect.spec.js | 40 +- components/multiselect/MultiSelect.vue | 390 +++-- components/orderlist/OrderList.d.ts | 10 +- components/orderlist/OrderList.spec.js | 122 +- components/orderlist/OrderList.vue | 125 +- .../organizationchart/OrganizationChart.d.ts | 8 +- .../OrganizationChart.spec.js | 123 +- .../organizationchart/OrganizationChart.vue | 30 +- .../OrganizationChartNode.vue | 32 +- components/overlayeventbus/OverlayEventBus.js | 4 +- components/overlaypanel/OverlayPanel.d.ts | 10 +- components/overlaypanel/OverlayPanel.spec.js | 2 +- components/overlaypanel/OverlayPanel.vue | 110 +- components/paginator/CurrentPageReport.vue | 94 +- components/paginator/FirstPageLink.vue | 19 +- components/paginator/JumpToPageDropdown.vue | 13 +- components/paginator/JumpToPageInput.vue | 6 +- components/paginator/LastPageLink.vue | 19 +- components/paginator/NextPageLink.vue | 19 +- components/paginator/PageLinks.vue | 7 +- components/paginator/Paginator.d.ts | 10 +- components/paginator/Paginator.spec.js | 8 +- components/paginator/Paginator.vue | 78 +- components/paginator/PrevPageLink.vue | 19 +- components/paginator/RowsPerPageDropdown.vue | 13 +- components/panel/Panel.d.ts | 14 +- components/panel/Panel.spec.js | 4 +- components/panel/Panel.vue | 40 +- components/panelmenu/PanelMenu.d.ts | 10 +- components/panelmenu/PanelMenu.spec.js | 10 +- components/panelmenu/PanelMenu.vue | 84 +- components/panelmenu/PanelMenuSub.vue | 69 +- components/password/Password.d.ts | 13 +- components/password/Password.spec.js | 24 +- components/password/Password.vue | 238 ++- components/picklist/PickList.d.ts | 18 +- components/picklist/PickList.spec.js | 216 +-- components/picklist/PickList.vue | 177 ++- components/portal/Portal.d.ts | 6 +- components/portal/Portal.vue | 4 +- components/progressbar/ProgressBar.d.ts | 9 +- components/progressbar/ProgressBar.spec.js | 4 +- components/progressbar/ProgressBar.vue | 114 +- .../progressspinner/ProgressSpinner.d.ts | 12 +- .../progressspinner/ProgressSpinner.spec.js | 2 +- .../progressspinner/ProgressSpinner.vue | 2 +- components/radiobutton/RadioButton.d.ts | 15 +- components/radiobutton/RadioButton.spec.js | 4 +- components/radiobutton/RadioButton.vue | 54 +- components/rating/Rating.d.ts | 59 +- components/rating/Rating.spec.js | 35 +- components/rating/Rating.vue | 150 +- components/ripple/Ripple.js | 12 +- components/ripple/Ripple.spec.js | 6 +- components/row/Row.d.ts | 15 +- components/row/Row.vue | 2 +- components/scrollpanel/ScrollPanel.d.ts | 14 +- components/scrollpanel/ScrollPanel.spec.js | 2 +- components/scrollpanel/ScrollPanel.vue | 246 ++- components/scrolltop/ScrollTop.d.ts | 12 +- components/scrolltop/ScrollTop.spec.js | 4 +- components/scrolltop/ScrollTop.vue | 41 +- components/selectbutton/SelectButton.d.ts | 22 +- components/selectbutton/SelectButton.spec.js | 9 +- components/selectbutton/SelectButton.vue | 82 +- components/sidebar/Sidebar.d.ts | 12 +- components/sidebar/Sidebar.spec.js | 2 +- components/sidebar/Sidebar.vue | 38 +- components/skeleton/Skeleton.d.ts | 12 +- components/skeleton/Skeleton.spec.js | 2 +- components/skeleton/Skeleton.vue | 23 +- components/slider/Slider.d.ts | 15 +- components/slider/Slider.spec.js | 6 +- components/slider/Slider.vue | 303 ++-- components/speeddial/SpeedDial.d.ts | 16 +- components/speeddial/SpeedDial.spec.js | 6 +- components/speeddial/SpeedDial.vue | 93 +- components/splitbutton/SplitButton.d.ts | 12 +- components/splitbutton/SplitButton.spec.js | 9 +- components/splitbutton/SplitButton.vue | 20 +- components/splitter/Splitter.d.ts | 15 +- components/splitter/Splitter.spec.js | 7 +- components/splitter/Splitter.vue | 211 ++- components/splitterpanel/SplitterPanel.d.ts | 9 +- .../splitterpanel/SplitterPanel.spec.js | 2 +- components/splitterpanel/SplitterPanel.vue | 6 +- components/steps/Steps.d.ts | 9 +- components/steps/Steps.vue | 54 +- components/styleclass/StyleClass.js | 46 +- components/styleclass/StyleClass.spec.js | 6 +- components/tabmenu/TabMenu.d.ts | 8 +- components/tabmenu/TabMenu.vue | 79 +- components/tabpanel/TabPanel.d.ts | 39 +- components/tabpanel/TabPanel.vue | 9 +- components/tabview/TabView.d.ts | 28 +- components/tabview/TabView.spec.js | 12 +- components/tabview/TabView.vue | 386 +++-- components/tag/Tag.d.ts | 9 +- components/tag/Tag.spec.js | 62 +- components/tag/Tag.vue | 23 +- components/terminal/Terminal.d.ts | 12 +- components/terminal/Terminal.spec.js | 14 +- components/terminal/Terminal.vue | 20 +- components/terminalservice/TerminalService.js | 4 +- components/textarea/Textarea.d.ts | 11 +- components/textarea/Textarea.spec.js | 4 +- components/textarea/Textarea.vue | 14 +- components/tieredmenu/TieredMenu.d.ts | 9 +- components/tieredmenu/TieredMenu.vue | 38 +- components/tieredmenu/TieredMenuSub.vue | 113 +- components/timeline/Timeline.d.ts | 9 +- components/timeline/Timeline.spec.js | 18 +- components/timeline/Timeline.vue | 16 +- components/toast/Toast.d.ts | 23 +- components/toast/Toast.spec.js | 24 +- components/toast/Toast.vue | 65 +- components/toast/ToastMessage.vue | 43 +- components/toasteventbus/ToastEventBus.js | 4 +- components/toastservice/ToastService.js | 5 +- components/togglebutton/ToggleButton.d.ts | 17 +- components/togglebutton/ToggleButton.spec.js | 4 +- components/togglebutton/ToggleButton.vue | 60 +- components/toolbar/Toolbar.d.ts | 13 +- components/toolbar/Toolbar.vue | 12 +- components/tooltip/Tooltip.js | 62 +- components/tree/Tree.d.ts | 14 +- components/tree/Tree.vue | 122 +- components/tree/TreeNode.vue | 136 +- components/treeselect/TreeSelect.d.ts | 18 +- components/treeselect/TreeSelect.vue | 216 ++- components/treetable/BodyCell.vue | 48 +- components/treetable/FooterCell.vue | 30 +- components/treetable/HeaderCell.vue | 80 +- components/treetable/TreeTable.d.ts | 16 +- components/treetable/TreeTable.vue | 403 ++--- components/treetable/TreeTableRow.vue | 132 +- .../tristatecheckbox/TriStateCheckbox.d.ts | 15 +- .../tristatecheckbox/TriStateCheckbox.spec.js | 105 +- .../tristatecheckbox/TriStateCheckbox.vue | 57 +- components/ts-helpers.d.ts | 24 +- components/useconfirm/UseConfirm.d.ts | 2 +- components/useconfirm/UseConfirm.js | 5 +- components/usedialog/UseDialog.d.ts | 2 +- components/usedialog/UseDialog.js | 5 +- components/usetoast/UseToast.js | 5 +- .../utils/ConnectedOverlayScrollHandler.js | 2 +- components/utils/DomHandler.js | 173 ++- components/utils/EventBus.js | 45 +- components/utils/ObjectUtils.js | 125 +- components/utils/UniqueComponentId.js | 3 +- components/utils/Utils.d.ts | 12 +- components/utils/Utils.js | 2 +- components/utils/ZIndexUtils.js | 15 +- .../virtualscroller/VirtualScroller.d.ts | 18 +- .../virtualscroller/VirtualScroller.vue | 204 +-- package-lock.json | 23 +- package.json | 11 +- pages/editor/EditorDoc.vue | 318 ++++ pages/editor/index.vue | 52 + pages/fullcalendar/FullCalendarDoc.vue | 189 +++ pages/fullcalendar/index.vue | 62 + pages/validation/index.vue | 8 +- plugins/fullcalendar.client.js | 17 + plugins/primeVue.js | 8 +- service/NewsService.js | 10 +- 344 files changed, 12446 insertions(+), 8758 deletions(-) create mode 100755 pages/editor/EditorDoc.vue create mode 100755 pages/editor/index.vue create mode 100755 pages/fullcalendar/FullCalendarDoc.vue create mode 100755 pages/fullcalendar/index.vue create mode 100644 plugins/fullcalendar.client.js 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 @@