From ec15e9471813ed5fd674f4a7d6f5601d07a45817 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Mon, 1 Mar 2021 23:54:17 +0300 Subject: [PATCH] Fixed #1028, Fixed #993 --- src/components/autocomplete/AutoComplete.vue | 70 ++--- src/components/calendar/Calendar.vue | 264 ++++++++---------- .../cascadeselect/CascadeSelect.vue | 49 +--- src/components/colorpicker/ColorPicker.vue | 30 +- src/components/confirmpopup/ConfirmPopup.vue | 35 +-- src/components/contextmenu/ContextMenu.vue | 33 +-- src/components/dialog/Dialog.vue | 49 ++-- src/components/dropdown/Dropdown.vue | 96 +++---- src/components/galleria/Galleria.vue | 15 +- src/components/menu/Menu.vue | 63 ++--- src/components/multiselect/MultiSelect.vue | 129 ++++----- src/components/overlaypanel/OverlayPanel.vue | 41 +-- src/components/password/Password.vue | 55 ++-- src/components/sidebar/Sidebar.vue | 21 +- src/components/splitbutton/SplitButton.vue | 4 +- src/components/tieredmenu/TieredMenu.vue | 34 +-- src/components/toast/Toast.vue | 13 +- src/views/autocomplete/AutoCompleteDoc.vue | 4 +- src/views/calendar/CalendarDoc.vue | 4 +- src/views/cascadeselect/CascadeSelectDoc.vue | 4 +- src/views/contextmenu/ContextMenuDoc.vue | 4 +- src/views/dropdown/DropdownDoc.vue | 4 +- src/views/menu/MenuDoc.vue | 4 +- src/views/multiselect/MultiSelectDoc.vue | 4 +- src/views/overlaypanel/OverlayPanelDoc.vue | 4 +- src/views/password/PasswordDoc.vue | 4 +- src/views/splitbutton/SplitButtonDoc.vue | 4 +- src/views/tieredmenu/TieredMenuDoc.vue | 4 +- 28 files changed, 434 insertions(+), 611 deletions(-) diff --git a/src/components/autocomplete/AutoComplete.vue b/src/components/autocomplete/AutoComplete.vue index b0e130bb8..1ee63b1e1 100755 --- a/src/components/autocomplete/AutoComplete.vue +++ b/src/components/autocomplete/AutoComplete.vue @@ -14,29 +14,31 @@ - {{formattedCurrentHour}} - - -
- {{timeSeparator}} -
-
- - {{formattedCurrentMinute}} - -
-
- {{timeSeparator}} -
-
- - {{formattedCurrentSecond}} - -
-
- {{timeSeparator}} -
-
- - {{pm ? 'PM' : 'AM'}} - +
+ +
+
-
- - -
- - - + + @@ -288,7 +290,7 @@ export default { }, appendTo: { type: String, - default: null + default: 'body' }, inputClass: null, inputStyle: null, @@ -333,7 +335,6 @@ export default { this.destroyMask(); } - this.restoreAppend(); this.unbindOutsideClickListener(); this.unbindResizeListener(); @@ -526,7 +527,6 @@ export default { if (this.autoZIndex) { this.overlay.style.zIndex = String(this.baseZIndex + DomHandler.generateZIndex()); } - this.appendContainer(); this.alignOverlay(); this.$emit('show'); }, @@ -687,10 +687,8 @@ export default { this.enableModality(); } else if (this.overlay) { - if (this.appendTo) - DomHandler.absolutePosition(this.overlay, this.$el); - else - DomHandler.relativePosition(this.overlay, this.$el); + this.overlay.style.minWidth = DomHandler.getOuterWidth(this.$el) + 'px'; + DomHandler.absolutePosition(this.overlay, this.$el); } }, onButtonClick() { @@ -1922,22 +1920,6 @@ export default { this.updateModel(event.target.value); } }, - appendContainer() { - if (this.appendTo) { - if (this.appendTo === 'body') - document.body.appendChild(this.overlay); - else - document.getElementById(this.appendTo).appendChild(this.overlay); - } - }, - restoreAppend() { - if (this.overlay && this.appendTo) { - if (this.appendTo === 'body') - document.body.removeChild(this.overlay); - else - document.getElementById(this.appendTo).removeChild(this.overlay); - } - }, onFocus() { if (this.showOnFocus && this.isEnabled()) { this.overlayVisible = true; diff --git a/src/components/cascadeselect/CascadeSelect.vue b/src/components/cascadeselect/CascadeSelect.vue index 706b7d39f..593460fad 100644 --- a/src/components/cascadeselect/CascadeSelect.vue +++ b/src/components/cascadeselect/CascadeSelect.vue @@ -12,16 +12,18 @@
- -
-
- + + +
+
+ +
-
- + +
@@ -56,7 +58,7 @@ export default { ariaLabelledBy: null, appendTo: { type: String, - default: null + default: 'body' } }, outsideClickListener: null, @@ -64,7 +66,6 @@ export default { resizeListener: null, overlay: null, beforeUnmount() { - this.restoreAppend(); this.unbindOutsideClickListener(); this.unbindResizeListener(); @@ -165,7 +166,6 @@ export default { }, onOverlayEnter() { this.overlay.style.zIndex = String(DomHandler.generateZIndex()); - this.appendContainer(); this.alignOverlay(); this.bindOutsideClickListener(); this.bindScrollListener(); @@ -181,12 +181,8 @@ export default { this.dirty = false; }, alignOverlay() { - if (this.appendTo) { - DomHandler.absolutePosition(this.overlay, this.$el); - this.overlay.style.minWidth = DomHandler.getOuterWidth(this.$el) + 'px'; - } else { - DomHandler.relativePosition(this.overlay, this.$el); - } + DomHandler.absolutePosition(this.overlay, this.$el); + this.overlay.style.minWidth = DomHandler.getOuterWidth(this.$el) + 'px'; }, bindOutsideClickListener() { if (!this.outsideClickListener) { @@ -239,22 +235,6 @@ export default { overlayRef(el) { this.overlay = el; }, - appendContainer() { - if (this.appendTo) { - if (this.appendTo === 'body') - document.body.appendChild(this.overlay); - else - document.getElementById(this.appendTo).appendChild(this.overlay); - } - }, - restoreAppend() { - if (this.overlay && this.appendTo) { - if (this.appendTo === 'body') - document.body.removeChild(this.overlay); - else - document.getElementById(this.appendTo).removeChild(this.overlay); - } - }, onKeyDown(event) { switch(event.key) { case 'Down': @@ -374,6 +354,7 @@ export default { margin: 0; padding: 0; list-style-type: none; + min-width: 100%; } .p-fluid .p-cascadeselect { diff --git a/src/components/colorpicker/ColorPicker.vue b/src/components/colorpicker/ColorPicker.vue index fc8f74ab1..91c1c6251 100755 --- a/src/components/colorpicker/ColorPicker.vue +++ b/src/components/colorpicker/ColorPicker.vue @@ -2,22 +2,24 @@
- -
-
-
-
-
+ + +
+
+
+
+
+
+
+
+
-
-
-
-
- + +
@@ -349,7 +351,7 @@ export default { this.clearRefs(); }, alignOverlay() { - DomHandler.relativePosition(this.picker, this.$refs.input); + DomHandler.absolutePosition(this.picker, this.$refs.input); }, onInputClick() { if (this.disabled) { diff --git a/src/components/confirmpopup/ConfirmPopup.vue b/src/components/confirmpopup/ConfirmPopup.vue index 1d61769cb..2336eb6c6 100644 --- a/src/components/confirmpopup/ConfirmPopup.vue +++ b/src/components/confirmpopup/ConfirmPopup.vue @@ -1,16 +1,18 @@