Fixed #5593 - Hydration defects

pull/5607/head
tugcekucukoglu 2024-04-16 12:35:02 +03:00
parent 8365a30f5b
commit 6615f31d8a
30 changed files with 120 additions and 151 deletions

View File

@ -73,16 +73,16 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
activeIndex(newValue) { activeIndex(newValue) {
this.d_activeIndex = newValue; this.d_activeIndex = newValue;
} }
}, },
mounted() {
this.id = this.id || UniqueComponentId();
},
methods: { methods: {
isAccordionTab(child) { isAccordionTab(child) {
return child.type.name === 'AccordionTab'; return child.type.name === 'AccordionTab';

View File

@ -201,11 +201,8 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
suggestions() { suggestions() {
if (this.searching) { if (this.searching) {
@ -218,6 +215,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.autoUpdateModel(); this.autoUpdateModel();
}, },
updated() { updated() {

View File

@ -560,11 +560,8 @@ export default {
}; };
}, },
watch: { watch: {
id: { id: function (newValue) {
immediate: true,
handler: function (newValue) {
this.d_id = newValue || UniqueComponentId(); this.d_id = newValue || UniqueComponentId();
}
}, },
modelValue(newValue) { modelValue(newValue) {
this.updateCurrentMetaData(); this.updateCurrentMetaData();
@ -614,6 +611,7 @@ export default {
this.updateCurrentMetaData(); this.updateCurrentMetaData();
}, },
mounted() { mounted() {
this.d_id = this.d_id || UniqueComponentId();
this.createResponsiveStyle(); this.createResponsiveStyle();
this.bindMatchMediaListener(); this.bindMatchMediaListener();

View File

@ -110,17 +110,15 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
options() { options() {
this.autoUpdateModel(); this.autoUpdateModel();
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.autoUpdateModel(); this.autoUpdateModel();
}, },
beforeUnmount() { beforeUnmount() {

View File

@ -76,12 +76,12 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
} },
mounted() {
this.id = this.id || UniqueComponentId();
}, },
methods: { methods: {
onWrapperClick() { onWrapperClick() {

View File

@ -64,11 +64,8 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
activeItemPath(newPath) { activeItemPath(newPath) {
if (ObjectUtils.isNotEmpty(newPath)) { if (ObjectUtils.isNotEmpty(newPath)) {
@ -81,6 +78,8 @@ export default {
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (this.global) { if (this.global) {
this.bindDocumentContextMenuListener(); this.bindDocumentContextMenuListener();
} }

View File

@ -286,12 +286,9 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
}
}, },
overlay: null, overlay: null,
selfClick: false, selfClick: false,
@ -308,6 +305,8 @@ export default {
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (this.filters && this.filters[this.field]) { if (this.filters && this.filters[this.field]) {
let fieldFilters = this.filters[this.field]; let fieldFilters = this.filters[this.field];

View File

@ -88,12 +88,9 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
}
}, },
documentKeydownListener: null, documentKeydownListener: null,
container: null, container: null,
@ -127,6 +124,8 @@ export default {
this.mask = null; this.mask = null;
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (this.breakpoints) { if (this.breakpoints) {
this.createStyle(); this.createStyle();
} }

View File

@ -106,12 +106,12 @@ export default {
}; };
}, },
watch: { watch: {
menuId: { menuId(newValue) {
immediate: true,
handler(newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
} },
mounted() {
this.id = this.id || UniqueComponentId();
}, },
methods: { methods: {
getItemId(index) { getItemId(index) {

View File

@ -218,11 +218,8 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
modelValue() { modelValue() {
this.isModelValueChanged = true; this.isModelValueChanged = true;
@ -232,6 +229,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.autoUpdateModel(); this.autoUpdateModel();
this.bindLabelClickListener(); this.bindLabelClickListener();
}, },

View File

@ -54,16 +54,16 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
collapsed(newValue) { collapsed(newValue) {
this.d_collapsed = newValue; this.d_collapsed = newValue;
} }
}, },
mounted() {
this.id = this.id || UniqueComponentId();
},
methods: { methods: {
toggle(event) { toggle(event) {
this.d_collapsed = !this.d_collapsed; this.d_collapsed = !this.d_collapsed;

View File

@ -76,18 +76,15 @@ export default {
emits: ['activeitem-change', 'mask-hide'], emits: ['activeitem-change', 'mask-hide'],
data() { data() {
return { return {
id: this.$attrs.id, id: this.$attrs.id || UniqueComponentId(),
activeIndex: this.$attrs.activeIndex, activeIndex: this.$attrs.activeIndex,
numVisible: this.$attrs.numVisible, numVisible: this.$attrs.numVisible,
slideShowActive: false slideShowActive: false
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
'$attrs.value': function (newVal) { '$attrs.value': function (newVal) {
if (newVal && newVal.length < this.numVisible) { if (newVal && newVal.length < this.numVisible) {
@ -104,6 +101,9 @@ export default {
newVal ? this.startSlideShow() : this.stopSlideShow(); newVal ? this.startSlideShow() : this.stopSlideShow();
} }
}, },
mounted() {
this.id = this.id || UniqueComponentId();
},
updated() { updated() {
this.$emit('activeitem-change', this.activeIndex); this.$emit('activeitem-change', this.activeIndex);
}, },

View File

@ -149,17 +149,15 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
options() { options() {
this.autoUpdateModel(); this.autoUpdateModel();
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.autoUpdateModel(); this.autoUpdateModel();
}, },
methods: { methods: {

View File

@ -86,11 +86,8 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
activeItem(newItem) { activeItem(newItem) {
if (ObjectUtils.isNotEmpty(newItem)) { if (ObjectUtils.isNotEmpty(newItem)) {
@ -103,6 +100,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.bindMatchMediaListener(); this.bindMatchMediaListener();
}, },
beforeUnmount() { beforeUnmount() {

View File

@ -72,12 +72,9 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
}
}, },
target: null, target: null,
outsideClickListener: null, outsideClickListener: null,
@ -86,6 +83,8 @@ export default {
container: null, container: null,
list: null, list: null,
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (!this.popup) { if (!this.popup) {
this.bindResizeListener(); this.bindResizeListener();
this.bindOutsideClickListener(); this.bindOutsideClickListener();

View File

@ -79,11 +79,8 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
activeItemPath(newPath) { activeItemPath(newPath) {
if (ObjectUtils.isNotEmpty(newPath)) { if (ObjectUtils.isNotEmpty(newPath)) {
@ -99,6 +96,7 @@ export default {
container: null, container: null,
menubar: null, menubar: null,
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.bindMatchMediaListener(); this.bindMatchMediaListener();
}, },
beforeUnmount() { beforeUnmount() {

View File

@ -238,17 +238,15 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
options() { options() {
this.autoUpdateModel(); this.autoUpdateModel();
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.autoUpdateModel(); this.autoUpdateModel();
}, },
beforeUnmount() { beforeUnmount() {

View File

@ -105,12 +105,9 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
}
}, },
beforeUnmount() { beforeUnmount() {
this.destroyStyle(); this.destroyStyle();
@ -122,6 +119,8 @@ export default {
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (this.responsive) { if (this.responsive) {
this.createStyle(); this.createStyle();
} }

View File

@ -58,16 +58,16 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
collapsed(newValue) { collapsed(newValue) {
this.d_collapsed = newValue; this.d_collapsed = newValue;
} }
}, },
mounted() {
this.id = this.id || UniqueComponentId();
},
methods: { methods: {
toggle(event) { toggle(event) {
this.d_collapsed = !this.d_collapsed; this.d_collapsed = !this.d_collapsed;

View File

@ -73,12 +73,12 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
} },
mounted() {
this.id = this.id || UniqueComponentId();
}, },
methods: { methods: {
getItemProp(item, name) { getItemProp(item, name) {

View File

@ -77,12 +77,9 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
}
}, },
mediumCheckRegExp: null, mediumCheckRegExp: null,
strongCheckRegExp: null, strongCheckRegExp: null,
@ -90,6 +87,7 @@ export default {
scrollHandler: null, scrollHandler: null,
overlay: null, overlay: null,
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.infoText = this.promptText; this.infoText = this.promptText;
this.mediumCheckRegExp = new RegExp(this.mediumRegex); this.mediumCheckRegExp = new RegExp(this.mediumRegex);
this.strongCheckRegExp = new RegExp(this.strongRegex); this.strongCheckRegExp = new RegExp(this.strongRegex);

View File

@ -221,11 +221,8 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
selection(newValue) { selection(newValue) {
this.d_selection = newValue; this.d_selection = newValue;
@ -247,6 +244,8 @@ export default {
this.destroyMedia(); this.destroyMedia();
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (this.responsive) { if (this.responsive) {
this.createStyle(); this.createStyle();
this.initMedia(); this.initMedia();

View File

@ -68,12 +68,12 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.name': { '$attrs.name': function (newValue) {
immediate: true,
handler: function (newValue) {
this.name = newValue || UniqueComponentId(); this.name = newValue || UniqueComponentId();
} }
} },
mounted() {
this.name = this.name || UniqueComponentId();
}, },
methods: { methods: {
getPTOptions(key, value) { getPTOptions(key, value) {

View File

@ -69,14 +69,13 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
}
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (this.$el.offsetParent) { if (this.$el.offsetParent) {
this.initialize(); this.initialize();
} }

View File

@ -78,17 +78,16 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
visible(newValue) { visible(newValue) {
this.d_visible = newValue; this.d_visible = newValue;
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (this.type !== 'linear') { if (this.type !== 'linear') {
const button = DomHandler.findSingle(this.container, '[data-pc-name="button"]'); const button = DomHandler.findSingle(this.container, '[data-pc-name="button"]');
const firstItem = DomHandler.findSingle(this.list, '[data-pc-section="menuitem"]'); const firstItem = DomHandler.findSingle(this.list, '[data-pc-section="menuitem"]');

View File

@ -78,14 +78,13 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
}
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.$watch('$refs.menu.visible', (newValue) => { this.$watch('$refs.menu.visible', (newValue) => {
this.isExpanded = newValue; this.isExpanded = newValue;
}); });

View File

@ -154,16 +154,16 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
activeStep(newValue) { activeStep(newValue) {
this.d_activeStep = newValue; this.d_activeStep = newValue;
} }
}, },
mounted() {
this.id = this.id || UniqueComponentId();
},
methods: { methods: {
isStep(child) { isStep(child) {
return child.type.name === 'StepperPanel'; return child.type.name === 'StepperPanel';

View File

@ -113,11 +113,8 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
activeIndex(newValue) { activeIndex(newValue) {
this.d_activeIndex = newValue; this.d_activeIndex = newValue;
@ -126,6 +123,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.updateInkBar(); this.updateInkBar();
this.scrollable && this.updateButtonState(); this.scrollable && this.updateButtonState();
}, },

View File

@ -71,11 +71,8 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
activeItemPath(newPath) { activeItemPath(newPath) {
if (!this.popup) { if (!this.popup) {
@ -89,6 +86,9 @@ export default {
} }
} }
}, },
mounted() {
this.id = this.id || UniqueComponentId();
},
beforeUnmount() { beforeUnmount() {
this.unbindOutsideClickListener(); this.unbindOutsideClickListener();
this.unbindResizeListener(); this.unbindResizeListener();

View File

@ -128,11 +128,8 @@ export default {
}; };
}, },
watch: { watch: {
'$attrs.id': { '$attrs.id': function (newValue) {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
}
}, },
modelValue: { modelValue: {
handler: function () { handler: function () {
@ -169,6 +166,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
this.updateTreeState(); this.updateTreeState();
}, },
methods: { methods: {