From e97f0eb05b33d97b6972e0d3ea5e41fda9ecabb8 Mon Sep 17 00:00:00 2001 From: Rodrigo Sanchez Date: Mon, 18 Mar 2024 14:28:01 +1100 Subject: [PATCH 01/18] added carousel changes --- api-generator/components/carousel.js | 6 +- components/lib/carousel/Carousel.vue | 162 ++++++++++++++------------- 2 files changed, 92 insertions(+), 76 deletions(-) diff --git a/api-generator/components/carousel.js b/api-generator/components/carousel.js index 7cb397595..18024cec2 100644 --- a/api-generator/components/carousel.js +++ b/api-generator/components/carousel.js @@ -121,7 +121,11 @@ const CarouselSlots = [ { name: 'nexticon', description: 'Custom next icon template.' - } + }, + { + name: 'empty', + description: 'Custom content when there is no data to display.' + }, ]; module.exports = { diff --git a/components/lib/carousel/Carousel.vue b/components/lib/carousel/Carousel.vue index 4a0019af4..8e09c7be0 100755 --- a/components/lib/carousel/Carousel.vue +++ b/components/lib/carousel/Carousel.vue @@ -4,90 +4,94 @@
-
- + +
+
@@ -231,7 +235,9 @@ export default { this.d_oldNumVisible = this.d_numVisible; this.d_oldValue = this.value; - this.$refs.itemsContainer.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100 / this.d_numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / this.d_numVisible)}%, 0, 0)`; + if(!this.empty) { + this.$refs.itemsContainer.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100 / this.d_numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / this.d_numVisible)}%, 0, 0)`; + } } if (isCircular) { @@ -604,6 +610,12 @@ export default { } }, computed: { + empty() { + return !this.value || this.value.length === 0; + }, + emptyMessageText() { + return this.$primevue.config?.locale?.emptyMessage || ''; + }, totalIndicators() { return this.value ? Math.max(Math.ceil((this.value.length - this.d_numVisible) / this.d_numScroll) + 1, 0) : 0; }, From b907613e053d31ba27785e7b17fd6e1c544d2d9a Mon Sep 17 00:00:00 2001 From: Rodrigo Sanchez Date: Tue, 19 Mar 2024 19:56:08 +1100 Subject: [PATCH 02/18] Update Carousel.vue removed unused emptyMessage computed --- components/lib/carousel/Carousel.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/components/lib/carousel/Carousel.vue b/components/lib/carousel/Carousel.vue index 8e09c7be0..858be2e50 100755 --- a/components/lib/carousel/Carousel.vue +++ b/components/lib/carousel/Carousel.vue @@ -613,9 +613,6 @@ export default { empty() { return !this.value || this.value.length === 0; }, - emptyMessageText() { - return this.$primevue.config?.locale?.emptyMessage || ''; - }, totalIndicators() { return this.value ? Math.max(Math.ceil((this.value.length - this.d_numVisible) / this.d_numScroll) + 1, 0) : 0; }, From 3a5a5e0b7ff3d6a42a9bd11b2cea7706edef721e Mon Sep 17 00:00:00 2001 From: Rodrigo Sanchez Date: Mon, 25 Mar 2024 21:29:40 +1100 Subject: [PATCH 03/18] Reverted missing empty slot --- components/lib/carousel/Carousel.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/carousel/Carousel.vue b/components/lib/carousel/Carousel.vue index 858be2e50..314dab9a8 100755 --- a/components/lib/carousel/Carousel.vue +++ b/components/lib/carousel/Carousel.vue @@ -90,8 +90,8 @@ -
-
+ +
From 3a134dd5618ef3ef78074b0d201d816d7d59363a Mon Sep 17 00:00:00 2001 From: i7slegend Date: Wed, 27 Mar 2024 05:37:32 +0300 Subject: [PATCH 04/18] Fix #5412 - Twice render if attribute id not defined --- components/lib/accordion/Accordion.vue | 10 +++++----- components/lib/autocomplete/AutoComplete.vue | 8 +++++--- components/lib/calendar/Calendar.vue | 8 +++++--- components/lib/cascadeselect/CascadeSelect.vue | 8 +++++--- components/lib/chips/Chips.vue | 12 ++++++------ components/lib/contextmenu/ContextMenu.vue | 9 +++++---- components/lib/datatable/ColumnFilter.vue | 11 ++++++----- components/lib/dialog/Dialog.vue | 11 ++++++----- components/lib/dock/DockSub.vue | 12 ++++++------ components/lib/dropdown/Dropdown.vue | 8 +++++--- components/lib/fieldset/Fieldset.vue | 10 +++++----- components/lib/galleria/GalleriaContent.vue | 12 ++++++------ components/lib/listbox/Listbox.vue | 8 +++++--- components/lib/megamenu/MegaMenu.vue | 8 +++++--- components/lib/menu/Menu.vue | 11 ++++++----- components/lib/menubar/Menubar.vue | 8 +++++--- components/lib/multiselect/MultiSelect.vue | 8 +++++--- components/lib/orderlist/OrderList.vue | 11 ++++++----- components/lib/panel/Panel.vue | 10 +++++----- components/lib/panelmenu/PanelMenu.vue | 12 ++++++------ components/lib/password/Password.vue | 10 ++++++---- components/lib/picklist/PickList.vue | 9 +++++---- components/lib/rating/Rating.vue | 12 ++++++------ components/lib/scrollpanel/ScrollPanel.vue | 11 ++++++----- components/lib/speeddial/SpeedDial.vue | 9 +++++---- components/lib/splitbutton/SplitButton.vue | 11 ++++++----- components/lib/stepper/Stepper.vue | 10 +++++----- components/lib/tabview/TabView.vue | 8 +++++--- components/lib/tieredmenu/TieredMenu.vue | 10 +++++----- components/lib/treeselect/TreeSelect.vue | 8 +++++--- 30 files changed, 162 insertions(+), 131 deletions(-) diff --git a/components/lib/accordion/Accordion.vue b/components/lib/accordion/Accordion.vue index e9fb3fa53..ba1110637 100755 --- a/components/lib/accordion/Accordion.vue +++ b/components/lib/accordion/Accordion.vue @@ -73,16 +73,16 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, activeIndex(newValue) { this.d_activeIndex = newValue; } }, - mounted() { - this.id = this.id || UniqueComponentId(); - }, methods: { isAccordionTab(child) { return child.type.name === 'AccordionTab'; diff --git a/components/lib/autocomplete/AutoComplete.vue b/components/lib/autocomplete/AutoComplete.vue index 0f79b35af..f42065e71 100755 --- a/components/lib/autocomplete/AutoComplete.vue +++ b/components/lib/autocomplete/AutoComplete.vue @@ -201,8 +201,11 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, suggestions() { if (this.searching) { @@ -215,7 +218,6 @@ export default { } }, mounted() { - this.id = this.id || UniqueComponentId(); this.autoUpdateModel(); }, updated() { diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index d63588b2e..1d992af5c 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -560,8 +560,11 @@ export default { }; }, watch: { - id: function (newValue) { - this.d_id = newValue || UniqueComponentId(); + id: { + immediate: true, + handler: function (newValue) { + this.d_id = newValue || UniqueComponentId(); + }, }, modelValue(newValue) { this.updateCurrentMetaData(); @@ -611,7 +614,6 @@ export default { this.updateCurrentMetaData(); }, mounted() { - this.d_id = this.d_id || UniqueComponentId(); this.createResponsiveStyle(); this.bindMatchMediaListener(); diff --git a/components/lib/cascadeselect/CascadeSelect.vue b/components/lib/cascadeselect/CascadeSelect.vue index 07762eaf3..445edccbf 100644 --- a/components/lib/cascadeselect/CascadeSelect.vue +++ b/components/lib/cascadeselect/CascadeSelect.vue @@ -110,15 +110,17 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, options() { this.autoUpdateModel(); } }, mounted() { - this.id = this.id || UniqueComponentId(); this.autoUpdateModel(); }, beforeUnmount() { diff --git a/components/lib/chips/Chips.vue b/components/lib/chips/Chips.vue index f3ab1305f..0ad9c6c8a 100755 --- a/components/lib/chips/Chips.vue +++ b/components/lib/chips/Chips.vue @@ -76,12 +76,12 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - } - }, - mounted() { - this.id = this.id || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, methods: { onWrapperClick() { diff --git a/components/lib/contextmenu/ContextMenu.vue b/components/lib/contextmenu/ContextMenu.vue index f159f8f69..14c6a5134 100755 --- a/components/lib/contextmenu/ContextMenu.vue +++ b/components/lib/contextmenu/ContextMenu.vue @@ -64,8 +64,11 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, activeItemPath(newPath) { if (ObjectUtils.isNotEmpty(newPath)) { @@ -78,8 +81,6 @@ export default { } }, mounted() { - this.id = this.id || UniqueComponentId(); - if (this.global) { this.bindDocumentContextMenuListener(); } diff --git a/components/lib/datatable/ColumnFilter.vue b/components/lib/datatable/ColumnFilter.vue index 3dc30d850..bd80740f3 100644 --- a/components/lib/datatable/ColumnFilter.vue +++ b/components/lib/datatable/ColumnFilter.vue @@ -286,9 +286,12 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - } + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, overlay: null, selfClick: false, @@ -305,8 +308,6 @@ export default { } }, mounted() { - this.id = this.id || UniqueComponentId(); - if (this.filters && this.filters[this.field]) { let fieldFilters = this.filters[this.field]; diff --git a/components/lib/dialog/Dialog.vue b/components/lib/dialog/Dialog.vue index 762db37f9..ac3ce1b9c 100755 --- a/components/lib/dialog/Dialog.vue +++ b/components/lib/dialog/Dialog.vue @@ -88,9 +88,12 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - } + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, documentKeydownListener: null, container: null, @@ -124,8 +127,6 @@ export default { this.mask = null; }, mounted() { - this.id = this.id || UniqueComponentId(); - if (this.breakpoints) { this.createStyle(); } diff --git a/components/lib/dock/DockSub.vue b/components/lib/dock/DockSub.vue index ad1732f39..7994913f5 100644 --- a/components/lib/dock/DockSub.vue +++ b/components/lib/dock/DockSub.vue @@ -106,12 +106,12 @@ export default { }; }, watch: { - menuId(newValue) { - this.id = newValue || UniqueComponentId(); - } - }, - mounted() { - this.id = this.id || UniqueComponentId(); + menuId: { + immediate: true, + handler(newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, methods: { getItemId(index) { diff --git a/components/lib/dropdown/Dropdown.vue b/components/lib/dropdown/Dropdown.vue index d85de8e33..0683bcfeb 100755 --- a/components/lib/dropdown/Dropdown.vue +++ b/components/lib/dropdown/Dropdown.vue @@ -218,8 +218,11 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, modelValue() { this.isModelValueChanged = true; @@ -229,7 +232,6 @@ export default { } }, mounted() { - this.id = this.id || UniqueComponentId(); this.autoUpdateModel(); this.bindLabelClickListener(); }, diff --git a/components/lib/fieldset/Fieldset.vue b/components/lib/fieldset/Fieldset.vue index 95fb7c7ec..f7f7a837c 100755 --- a/components/lib/fieldset/Fieldset.vue +++ b/components/lib/fieldset/Fieldset.vue @@ -54,16 +54,16 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, collapsed(newValue) { this.d_collapsed = newValue; } }, - mounted() { - this.id = this.id || UniqueComponentId(); - }, methods: { toggle(event) { this.d_collapsed = !this.d_collapsed; diff --git a/components/lib/galleria/GalleriaContent.vue b/components/lib/galleria/GalleriaContent.vue index 6ab095b66..e84f146f9 100755 --- a/components/lib/galleria/GalleriaContent.vue +++ b/components/lib/galleria/GalleriaContent.vue @@ -76,15 +76,18 @@ export default { emits: ['activeitem-change', 'mask-hide'], data() { return { - id: this.$attrs.id || UniqueComponentId(), + id: this.$attrs.id, activeIndex: this.$attrs.activeIndex, numVisible: this.$attrs.numVisible, slideShowActive: false }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, '$attrs.value': function (newVal) { if (newVal && newVal.length < this.numVisible) { @@ -101,9 +104,6 @@ export default { newVal ? this.startSlideShow() : this.stopSlideShow(); } }, - mounted() { - this.id = this.id || UniqueComponentId(); - }, updated() { this.$emit('activeitem-change', this.activeIndex); }, diff --git a/components/lib/listbox/Listbox.vue b/components/lib/listbox/Listbox.vue index 97b62dc2a..70fad9bb8 100755 --- a/components/lib/listbox/Listbox.vue +++ b/components/lib/listbox/Listbox.vue @@ -149,15 +149,17 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, options() { this.autoUpdateModel(); } }, mounted() { - this.id = this.id || UniqueComponentId(); this.autoUpdateModel(); }, methods: { diff --git a/components/lib/megamenu/MegaMenu.vue b/components/lib/megamenu/MegaMenu.vue index 6f934efa9..5160b9100 100755 --- a/components/lib/megamenu/MegaMenu.vue +++ b/components/lib/megamenu/MegaMenu.vue @@ -86,8 +86,11 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, activeItem(newItem) { if (ObjectUtils.isNotEmpty(newItem)) { @@ -100,7 +103,6 @@ export default { } }, mounted() { - this.id = this.id || UniqueComponentId(); this.bindMatchMediaListener(); }, beforeUnmount() { diff --git a/components/lib/menu/Menu.vue b/components/lib/menu/Menu.vue index 87f8b928e..523232cd3 100644 --- a/components/lib/menu/Menu.vue +++ b/components/lib/menu/Menu.vue @@ -72,9 +72,12 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - } + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, target: null, outsideClickListener: null, @@ -83,8 +86,6 @@ export default { container: null, list: null, mounted() { - this.id = this.id || UniqueComponentId(); - if (!this.popup) { this.bindResizeListener(); this.bindOutsideClickListener(); diff --git a/components/lib/menubar/Menubar.vue b/components/lib/menubar/Menubar.vue index 67e845a25..9ce93231e 100755 --- a/components/lib/menubar/Menubar.vue +++ b/components/lib/menubar/Menubar.vue @@ -79,8 +79,11 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, activeItemPath(newPath) { if (ObjectUtils.isNotEmpty(newPath)) { @@ -96,7 +99,6 @@ export default { container: null, menubar: null, mounted() { - this.id = this.id || UniqueComponentId(); this.bindMatchMediaListener(); }, beforeUnmount() { diff --git a/components/lib/multiselect/MultiSelect.vue b/components/lib/multiselect/MultiSelect.vue index 3037866cb..2c79ba1ef 100755 --- a/components/lib/multiselect/MultiSelect.vue +++ b/components/lib/multiselect/MultiSelect.vue @@ -238,15 +238,17 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, options() { this.autoUpdateModel(); } }, mounted() { - this.id = this.id || UniqueComponentId(); this.autoUpdateModel(); }, beforeUnmount() { diff --git a/components/lib/orderlist/OrderList.vue b/components/lib/orderlist/OrderList.vue index bb45e4b60..a8b1db652 100755 --- a/components/lib/orderlist/OrderList.vue +++ b/components/lib/orderlist/OrderList.vue @@ -105,9 +105,12 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - } + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, beforeUnmount() { this.destroyStyle(); @@ -119,8 +122,6 @@ export default { } }, mounted() { - this.id = this.id || UniqueComponentId(); - if (this.responsive) { this.createStyle(); } diff --git a/components/lib/panel/Panel.vue b/components/lib/panel/Panel.vue index 1e831fc09..517daa8ad 100755 --- a/components/lib/panel/Panel.vue +++ b/components/lib/panel/Panel.vue @@ -58,16 +58,16 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, collapsed(newValue) { this.d_collapsed = newValue; } }, - mounted() { - this.id = this.id || UniqueComponentId(); - }, methods: { toggle(event) { this.d_collapsed = !this.d_collapsed; diff --git a/components/lib/panelmenu/PanelMenu.vue b/components/lib/panelmenu/PanelMenu.vue index 950969a10..ae3fec72c 100644 --- a/components/lib/panelmenu/PanelMenu.vue +++ b/components/lib/panelmenu/PanelMenu.vue @@ -73,12 +73,12 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - } - }, - mounted() { - this.id = this.id || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, methods: { getItemProp(item, name) { diff --git a/components/lib/password/Password.vue b/components/lib/password/Password.vue index 7645e6bdc..ca048c7cb 100755 --- a/components/lib/password/Password.vue +++ b/components/lib/password/Password.vue @@ -77,9 +77,12 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - } + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, mediumCheckRegExp: null, strongCheckRegExp: null, @@ -87,7 +90,6 @@ export default { scrollHandler: null, overlay: null, mounted() { - this.id = this.id || UniqueComponentId(); this.infoText = this.promptText; this.mediumCheckRegExp = new RegExp(this.mediumRegex); this.strongCheckRegExp = new RegExp(this.strongRegex); diff --git a/components/lib/picklist/PickList.vue b/components/lib/picklist/PickList.vue index 3bcd65978..d37d1c687 100755 --- a/components/lib/picklist/PickList.vue +++ b/components/lib/picklist/PickList.vue @@ -221,8 +221,11 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, selection(newValue) { this.d_selection = newValue; @@ -244,8 +247,6 @@ export default { this.destroyMedia(); }, mounted() { - this.id = this.id || UniqueComponentId(); - if (this.responsive) { this.createStyle(); this.initMedia(); diff --git a/components/lib/rating/Rating.vue b/components/lib/rating/Rating.vue index 9d53191de..4c0dd0864 100755 --- a/components/lib/rating/Rating.vue +++ b/components/lib/rating/Rating.vue @@ -68,12 +68,12 @@ export default { }; }, watch: { - '$attrs.name': function (newValue) { - this.name = newValue || UniqueComponentId(); - } - }, - mounted() { - this.name = this.name || UniqueComponentId(); + '$attrs.name': { + immediate: true, + handler: function (newValue) { + this.name = newValue || UniqueComponentId(); + }, + }, }, methods: { getPTOptions(key, value) { diff --git a/components/lib/scrollpanel/ScrollPanel.vue b/components/lib/scrollpanel/ScrollPanel.vue index 99f315991..5d4bcd186 100644 --- a/components/lib/scrollpanel/ScrollPanel.vue +++ b/components/lib/scrollpanel/ScrollPanel.vue @@ -69,13 +69,14 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - } + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, mounted() { - this.id = this.id || UniqueComponentId(); - if (this.$el.offsetParent) { this.initialize(); } diff --git a/components/lib/speeddial/SpeedDial.vue b/components/lib/speeddial/SpeedDial.vue index 20f82334f..958b2c5ed 100644 --- a/components/lib/speeddial/SpeedDial.vue +++ b/components/lib/speeddial/SpeedDial.vue @@ -78,16 +78,17 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, visible(newValue) { this.d_visible = newValue; } }, mounted() { - this.id = this.id || UniqueComponentId(); - if (this.type !== 'linear') { const button = DomHandler.findSingle(this.container, '[data-pc-name="button"]'); const firstItem = DomHandler.findSingle(this.list, '[data-pc-section="menuitem"]'); diff --git a/components/lib/splitbutton/SplitButton.vue b/components/lib/splitbutton/SplitButton.vue index 1efd3c116..4850630dd 100755 --- a/components/lib/splitbutton/SplitButton.vue +++ b/components/lib/splitbutton/SplitButton.vue @@ -78,13 +78,14 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - } + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, + }, }, mounted() { - this.id = this.id || UniqueComponentId(); - this.$watch('$refs.menu.visible', (newValue) => { this.isExpanded = newValue; }); diff --git a/components/lib/stepper/Stepper.vue b/components/lib/stepper/Stepper.vue index 0c8d211b8..05a52b9a3 100644 --- a/components/lib/stepper/Stepper.vue +++ b/components/lib/stepper/Stepper.vue @@ -156,16 +156,16 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, activeStep(newValue) { this.d_activeStep = newValue; } }, - mounted() { - this.id = this.id || UniqueComponentId(); - }, methods: { isStep(child) { return child.type.name === 'StepperPanel'; diff --git a/components/lib/tabview/TabView.vue b/components/lib/tabview/TabView.vue index 5528c38b9..472c0c6f9 100755 --- a/components/lib/tabview/TabView.vue +++ b/components/lib/tabview/TabView.vue @@ -113,8 +113,11 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, activeIndex(newValue) { this.d_activeIndex = newValue; @@ -123,7 +126,6 @@ export default { } }, mounted() { - this.id = this.id || UniqueComponentId(); this.updateInkBar(); this.scrollable && this.updateButtonState(); }, diff --git a/components/lib/tieredmenu/TieredMenu.vue b/components/lib/tieredmenu/TieredMenu.vue index ea172a540..52efa4d67 100755 --- a/components/lib/tieredmenu/TieredMenu.vue +++ b/components/lib/tieredmenu/TieredMenu.vue @@ -71,8 +71,11 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, activeItemPath(newPath) { if (!this.popup) { @@ -86,9 +89,6 @@ export default { } } }, - mounted() { - this.id = this.id || UniqueComponentId(); - }, beforeUnmount() { this.unbindOutsideClickListener(); this.unbindResizeListener(); diff --git a/components/lib/treeselect/TreeSelect.vue b/components/lib/treeselect/TreeSelect.vue index 26f63e9ea..86528f1cf 100644 --- a/components/lib/treeselect/TreeSelect.vue +++ b/components/lib/treeselect/TreeSelect.vue @@ -128,8 +128,11 @@ export default { }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); + '$attrs.id': { + immediate: true, + handler: function (newValue) { + this.id = newValue || UniqueComponentId(); + }, }, modelValue: { handler: function () { @@ -166,7 +169,6 @@ export default { } }, mounted() { - this.id = this.id || UniqueComponentId(); this.updateTreeState(); }, methods: { From 85a9455c8487a8a98d853871471c36cf45c019c5 Mon Sep 17 00:00:00 2001 From: i7slegend Date: Thu, 28 Mar 2024 02:27:46 +0300 Subject: [PATCH 05/18] PR checker #5412 - prettier warns --- components/lib/accordion/Accordion.vue | 2 +- components/lib/autocomplete/AutoComplete.vue | 2 +- components/lib/calendar/Calendar.vue | 2 +- components/lib/cascadeselect/CascadeSelect.vue | 2 +- components/lib/chips/Chips.vue | 4 ++-- components/lib/contextmenu/ContextMenu.vue | 2 +- components/lib/datatable/ColumnFilter.vue | 4 ++-- components/lib/dialog/Dialog.vue | 4 ++-- components/lib/dock/DockSub.vue | 4 ++-- components/lib/dropdown/Dropdown.vue | 2 +- components/lib/fieldset/Fieldset.vue | 2 +- components/lib/galleria/GalleriaContent.vue | 2 +- components/lib/listbox/Listbox.vue | 2 +- components/lib/megamenu/MegaMenu.vue | 2 +- components/lib/menu/Menu.vue | 4 ++-- components/lib/menubar/Menubar.vue | 2 +- components/lib/multiselect/MultiSelect.vue | 2 +- components/lib/orderlist/OrderList.vue | 4 ++-- components/lib/panel/Panel.vue | 2 +- components/lib/panelmenu/PanelMenu.vue | 4 ++-- components/lib/password/Password.vue | 4 ++-- components/lib/picklist/PickList.vue | 2 +- components/lib/rating/Rating.vue | 4 ++-- components/lib/scrollpanel/ScrollPanel.vue | 4 ++-- components/lib/speeddial/SpeedDial.vue | 2 +- components/lib/splitbutton/SplitButton.vue | 4 ++-- components/lib/stepper/Stepper.vue | 2 +- components/lib/tabview/TabView.vue | 2 +- components/lib/tieredmenu/TieredMenu.vue | 2 +- components/lib/treeselect/TreeSelect.vue | 2 +- 30 files changed, 41 insertions(+), 41 deletions(-) diff --git a/components/lib/accordion/Accordion.vue b/components/lib/accordion/Accordion.vue index ba1110637..534e9b37f 100755 --- a/components/lib/accordion/Accordion.vue +++ b/components/lib/accordion/Accordion.vue @@ -77,7 +77,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, activeIndex(newValue) { this.d_activeIndex = newValue; diff --git a/components/lib/autocomplete/AutoComplete.vue b/components/lib/autocomplete/AutoComplete.vue index f42065e71..ee5b848a7 100755 --- a/components/lib/autocomplete/AutoComplete.vue +++ b/components/lib/autocomplete/AutoComplete.vue @@ -205,7 +205,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, suggestions() { if (this.searching) { diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index 1d992af5c..82dabdba3 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -564,7 +564,7 @@ export default { immediate: true, handler: function (newValue) { this.d_id = newValue || UniqueComponentId(); - }, + } }, modelValue(newValue) { this.updateCurrentMetaData(); diff --git a/components/lib/cascadeselect/CascadeSelect.vue b/components/lib/cascadeselect/CascadeSelect.vue index 445edccbf..f154895d8 100644 --- a/components/lib/cascadeselect/CascadeSelect.vue +++ b/components/lib/cascadeselect/CascadeSelect.vue @@ -114,7 +114,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, options() { this.autoUpdateModel(); diff --git a/components/lib/chips/Chips.vue b/components/lib/chips/Chips.vue index 0ad9c6c8a..ddce4478e 100755 --- a/components/lib/chips/Chips.vue +++ b/components/lib/chips/Chips.vue @@ -80,8 +80,8 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, methods: { onWrapperClick() { diff --git a/components/lib/contextmenu/ContextMenu.vue b/components/lib/contextmenu/ContextMenu.vue index 14c6a5134..4df1fa50b 100755 --- a/components/lib/contextmenu/ContextMenu.vue +++ b/components/lib/contextmenu/ContextMenu.vue @@ -68,7 +68,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, activeItemPath(newPath) { if (ObjectUtils.isNotEmpty(newPath)) { diff --git a/components/lib/datatable/ColumnFilter.vue b/components/lib/datatable/ColumnFilter.vue index bd80740f3..6f7d23b8e 100644 --- a/components/lib/datatable/ColumnFilter.vue +++ b/components/lib/datatable/ColumnFilter.vue @@ -290,8 +290,8 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, overlay: null, selfClick: false, diff --git a/components/lib/dialog/Dialog.vue b/components/lib/dialog/Dialog.vue index ac3ce1b9c..708044f70 100755 --- a/components/lib/dialog/Dialog.vue +++ b/components/lib/dialog/Dialog.vue @@ -92,8 +92,8 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, documentKeydownListener: null, container: null, diff --git a/components/lib/dock/DockSub.vue b/components/lib/dock/DockSub.vue index 7994913f5..2b4cb368e 100644 --- a/components/lib/dock/DockSub.vue +++ b/components/lib/dock/DockSub.vue @@ -110,8 +110,8 @@ export default { immediate: true, handler(newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, methods: { getItemId(index) { diff --git a/components/lib/dropdown/Dropdown.vue b/components/lib/dropdown/Dropdown.vue index 0683bcfeb..5fa60d4a7 100755 --- a/components/lib/dropdown/Dropdown.vue +++ b/components/lib/dropdown/Dropdown.vue @@ -222,7 +222,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, modelValue() { this.isModelValueChanged = true; diff --git a/components/lib/fieldset/Fieldset.vue b/components/lib/fieldset/Fieldset.vue index f7f7a837c..22ecc2303 100755 --- a/components/lib/fieldset/Fieldset.vue +++ b/components/lib/fieldset/Fieldset.vue @@ -58,7 +58,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, collapsed(newValue) { this.d_collapsed = newValue; diff --git a/components/lib/galleria/GalleriaContent.vue b/components/lib/galleria/GalleriaContent.vue index e84f146f9..de8e91df0 100755 --- a/components/lib/galleria/GalleriaContent.vue +++ b/components/lib/galleria/GalleriaContent.vue @@ -87,7 +87,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, '$attrs.value': function (newVal) { if (newVal && newVal.length < this.numVisible) { diff --git a/components/lib/listbox/Listbox.vue b/components/lib/listbox/Listbox.vue index 70fad9bb8..0134c3f49 100755 --- a/components/lib/listbox/Listbox.vue +++ b/components/lib/listbox/Listbox.vue @@ -153,7 +153,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, options() { this.autoUpdateModel(); diff --git a/components/lib/megamenu/MegaMenu.vue b/components/lib/megamenu/MegaMenu.vue index 5160b9100..ec6c54811 100755 --- a/components/lib/megamenu/MegaMenu.vue +++ b/components/lib/megamenu/MegaMenu.vue @@ -90,7 +90,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, activeItem(newItem) { if (ObjectUtils.isNotEmpty(newItem)) { diff --git a/components/lib/menu/Menu.vue b/components/lib/menu/Menu.vue index 523232cd3..ece3fa078 100644 --- a/components/lib/menu/Menu.vue +++ b/components/lib/menu/Menu.vue @@ -76,8 +76,8 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, target: null, outsideClickListener: null, diff --git a/components/lib/menubar/Menubar.vue b/components/lib/menubar/Menubar.vue index 9ce93231e..5c33ead79 100755 --- a/components/lib/menubar/Menubar.vue +++ b/components/lib/menubar/Menubar.vue @@ -83,7 +83,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, activeItemPath(newPath) { if (ObjectUtils.isNotEmpty(newPath)) { diff --git a/components/lib/multiselect/MultiSelect.vue b/components/lib/multiselect/MultiSelect.vue index 2c79ba1ef..4885f9017 100755 --- a/components/lib/multiselect/MultiSelect.vue +++ b/components/lib/multiselect/MultiSelect.vue @@ -242,7 +242,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, options() { this.autoUpdateModel(); diff --git a/components/lib/orderlist/OrderList.vue b/components/lib/orderlist/OrderList.vue index a8b1db652..4e649f94e 100755 --- a/components/lib/orderlist/OrderList.vue +++ b/components/lib/orderlist/OrderList.vue @@ -109,8 +109,8 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, beforeUnmount() { this.destroyStyle(); diff --git a/components/lib/panel/Panel.vue b/components/lib/panel/Panel.vue index 517daa8ad..91aaff1ba 100755 --- a/components/lib/panel/Panel.vue +++ b/components/lib/panel/Panel.vue @@ -62,7 +62,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, collapsed(newValue) { this.d_collapsed = newValue; diff --git a/components/lib/panelmenu/PanelMenu.vue b/components/lib/panelmenu/PanelMenu.vue index ae3fec72c..03f7573df 100644 --- a/components/lib/panelmenu/PanelMenu.vue +++ b/components/lib/panelmenu/PanelMenu.vue @@ -77,8 +77,8 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, methods: { getItemProp(item, name) { diff --git a/components/lib/password/Password.vue b/components/lib/password/Password.vue index ca048c7cb..c0fd068dd 100755 --- a/components/lib/password/Password.vue +++ b/components/lib/password/Password.vue @@ -81,8 +81,8 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, mediumCheckRegExp: null, strongCheckRegExp: null, diff --git a/components/lib/picklist/PickList.vue b/components/lib/picklist/PickList.vue index d37d1c687..85df8dee2 100755 --- a/components/lib/picklist/PickList.vue +++ b/components/lib/picklist/PickList.vue @@ -225,7 +225,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, selection(newValue) { this.d_selection = newValue; diff --git a/components/lib/rating/Rating.vue b/components/lib/rating/Rating.vue index 4c0dd0864..485fb0bc0 100755 --- a/components/lib/rating/Rating.vue +++ b/components/lib/rating/Rating.vue @@ -72,8 +72,8 @@ export default { immediate: true, handler: function (newValue) { this.name = newValue || UniqueComponentId(); - }, - }, + } + } }, methods: { getPTOptions(key, value) { diff --git a/components/lib/scrollpanel/ScrollPanel.vue b/components/lib/scrollpanel/ScrollPanel.vue index 5d4bcd186..1adef1ee6 100644 --- a/components/lib/scrollpanel/ScrollPanel.vue +++ b/components/lib/scrollpanel/ScrollPanel.vue @@ -73,8 +73,8 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, mounted() { if (this.$el.offsetParent) { diff --git a/components/lib/speeddial/SpeedDial.vue b/components/lib/speeddial/SpeedDial.vue index 958b2c5ed..79b8107a1 100644 --- a/components/lib/speeddial/SpeedDial.vue +++ b/components/lib/speeddial/SpeedDial.vue @@ -82,7 +82,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, visible(newValue) { this.d_visible = newValue; diff --git a/components/lib/splitbutton/SplitButton.vue b/components/lib/splitbutton/SplitButton.vue index 4850630dd..fcd0a1c4c 100755 --- a/components/lib/splitbutton/SplitButton.vue +++ b/components/lib/splitbutton/SplitButton.vue @@ -82,8 +82,8 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, - }, + } + } }, mounted() { this.$watch('$refs.menu.visible', (newValue) => { diff --git a/components/lib/stepper/Stepper.vue b/components/lib/stepper/Stepper.vue index 05a52b9a3..4f9c97901 100644 --- a/components/lib/stepper/Stepper.vue +++ b/components/lib/stepper/Stepper.vue @@ -160,7 +160,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, activeStep(newValue) { this.d_activeStep = newValue; diff --git a/components/lib/tabview/TabView.vue b/components/lib/tabview/TabView.vue index 472c0c6f9..39ea5b461 100755 --- a/components/lib/tabview/TabView.vue +++ b/components/lib/tabview/TabView.vue @@ -117,7 +117,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, activeIndex(newValue) { this.d_activeIndex = newValue; diff --git a/components/lib/tieredmenu/TieredMenu.vue b/components/lib/tieredmenu/TieredMenu.vue index 52efa4d67..0f004f366 100755 --- a/components/lib/tieredmenu/TieredMenu.vue +++ b/components/lib/tieredmenu/TieredMenu.vue @@ -75,7 +75,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, activeItemPath(newPath) { if (!this.popup) { diff --git a/components/lib/treeselect/TreeSelect.vue b/components/lib/treeselect/TreeSelect.vue index 86528f1cf..ffe72d09e 100644 --- a/components/lib/treeselect/TreeSelect.vue +++ b/components/lib/treeselect/TreeSelect.vue @@ -132,7 +132,7 @@ export default { immediate: true, handler: function (newValue) { this.id = newValue || UniqueComponentId(); - }, + } }, modelValue: { handler: function () { From e9a77efa59dd1799160a5b0f12fd63799a668429 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Tue, 2 Apr 2024 13:48:54 +0300 Subject: [PATCH 06/18] Add links to v4 beta --- assets/data/news.json | 6 +++--- doc/theming/ArchitectureDoc.vue | 4 +++- layouts/AppTopBar.vue | 9 +++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/assets/data/news.json b/assets/data/news.json index f15aeaad0..3961408ed 100644 --- a/assets/data/news.json +++ b/assets/data/news.json @@ -1,8 +1,8 @@ { - "id": 52, - "content": "Tailwind Presets for Unstyled PrimeVue", + "id": 55, + "content": "🎉 v4.0.0-beta.1 is out with the new Styled Mode", "linkText": "Learn More", - "linkHref": "http://tailwind.primevue.org", + "linkHref": "http://v4.primevue.org", "backgroundStyle": "background-color:var(--primary-color)", "textStyle": "color:var(--primary-color-text);font-weight:500", "linkStyle": "color:var(--primary-color-text);font-weight:700;text-decoration: underline;" diff --git a/doc/theming/ArchitectureDoc.vue b/doc/theming/ArchitectureDoc.vue index 08b3ff4d7..33922f48b 100644 --- a/doc/theming/ArchitectureDoc.vue +++ b/doc/theming/ArchitectureDoc.vue @@ -1,6 +1,8 @@