ColorPicker: overlay pt naming updates

pull/6275/head^2
tugcekucukoglu 2024-10-01 13:05:21 +03:00
parent 86457f21f9
commit 5432887c99
3 changed files with 11 additions and 5 deletions

View File

@ -46,7 +46,8 @@ export default {
type: String,
default: null
},
panelClass: null
panelClass: null,
overlayClass: null
},
style: ColorPickerStyle,
provide() {

View File

@ -77,7 +77,7 @@ export interface ColorPickerPassThroughOptions {
/**
* Used to pass attributes to the panel's DOM element.
*/
panel?: ColorPickerPassThroughOptionType;
overlay?: ColorPickerPassThroughOptionType;
/**
* Used to pass attributes to the content's DOM element.
*/
@ -179,8 +179,13 @@ export interface ColorPickerProps {
inputId?: string | undefined;
/**
* Style class of the overlay panel.
* @deprecated since v4.0. Use 'overlayClass' prop instead.
*/
panelClass?: any;
/**
* Style class of the overlay panel.
*/
overlayClass?: any;
/**
* A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are 'body' for document body and 'self' for the element itself.
* @defaultValue body

View File

@ -3,7 +3,7 @@
<input v-if="!inline" ref="input" :id="inputId" type="text" :class="cx('preview')" readonly="readonly" :tabindex="tabindex" :disabled="disabled" @click="onInputClick" @keydown="onInputKeydown" v-bind="ptm('preview')" />
<Portal :appendTo="appendTo" :disabled="inline">
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave" v-bind="ptm('transition')">
<div v-if="inline ? true : overlayVisible" :ref="pickerRef" :class="[cx('panel'), panelClass]" @click="onOverlayClick" v-bind="ptm('panel')">
<div v-if="inline ? true : overlayVisible" :ref="pickerRef" :class="[cx('panel'), panelClass, overlayClass]" @click="onOverlayClick" v-bind="{ ...ptm('panel'), ...ptm('overlay') }">
<div :class="cx('content')" v-bind="ptm('content')">
<div :ref="colorSelectorRef" :class="cx('colorSelector')" @mousedown="onColorMousedown($event)" @touchstart="onColorDragStart($event)" @touchmove="onDrag($event)" @touchend="onDragEnd()" v-bind="ptm('colorSelector')">
<div :class="cx('colorBackground')" v-bind="ptm('colorBackground')">
@ -21,9 +21,9 @@
</template>
<script>
import { ConnectedOverlayScrollHandler } from '@primevue/core/utils';
import { relativePosition, absolutePosition, addClass, removeClass, isTouchDevice } from '@primeuix/utils/dom';
import { absolutePosition, addClass, isTouchDevice, relativePosition, removeClass } from '@primeuix/utils/dom';
import { ZIndex } from '@primeuix/utils/zindex';
import { ConnectedOverlayScrollHandler } from '@primevue/core/utils';
import OverlayEventBus from 'primevue/overlayeventbus';
import Portal from 'primevue/portal';
import BaseColorPicker from './BaseColorPicker.vue';