Merge branch 'master' into v4

pull/5507/head
mertsincan 2024-01-05 12:45:40 +00:00
commit 2fed78692c
10 changed files with 37 additions and 7 deletions

View File

@ -21,7 +21,7 @@
<template v-if="!$slots.message">
<slot name="icon">
<component v-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" />
<span v-else-if="confirmation.icon" :class="cx('icon')" v-bind="ptm('icon')" />
<span v-else-if="confirmation.icon" :class="[confirmation.icon, cx('icon')]" v-bind="ptm('icon')" />
</slot>
<span :class="cx('message')" v-bind="ptm('message')">{{ message }}</span>
</template>

View File

@ -2,7 +2,7 @@ import BaseStyle from 'primevue/base/style';
const classes = {
root: 'p-confirm-dialog',
icon: ({ instance }) => ['p-confirm-dialog-icon', instance.confirmation ? instance.confirmation.icon : null],
icon: 'p-confirm-dialog-icon',
message: 'p-confirm-dialog-message',
rejectButton: ({ instance }) => ['p-confirm-dialog-reject', instance.confirmation && !instance.confirmation.rejectClass ? 'p-button-text' : null],
acceptButton: 'p-confirm-dialog-accept'

View File

@ -8,7 +8,7 @@
<div :class="cx('content')" v-bind="ptm('content')">
<slot name="icon">
<component v-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" />
<span v-else-if="confirmation.icon" :class="cx('icon')" v-bind="ptm('icon')" />
<span v-else-if="confirmation.icon" :class="[confirmation.icon, cx('icon')]" v-bind="ptm('icon')" />
</slot>
<span :class="cx('message')" v-bind="ptm('message')">{{ confirmation.message }}</span>
</div>

View File

@ -83,7 +83,7 @@ const classes = {
}
],
content: 'p-confirm-popup-content',
icon: ({ instance }) => ['p-confirm-popup-icon', instance.confirmation ? instance.confirmation.icon : null],
icon: 'p-confirm-popup-icon',
message: 'p-confirm-popup-message',
footer: 'p-confirm-popup-footer',
rejectButton: ({ instance }) => ['p-confirm-popup-reject', instance.confirmation && !instance.confirmation.rejectClass ? 'p-button-sm p-button-text' : null],

View File

@ -956,6 +956,10 @@ export default {
input.value = this.formatValue(newValue);
input.setAttribute('aria-valuenow', newValue);
this.updateModel(event, newValue);
if (!this.disabled && !this.readonly && this.highlightOnFocus) {
DomHandler.clearSelection();
}
},
clearTimer() {
if (this.timer) {

View File

@ -2,7 +2,7 @@
<Portal>
<div v-if="containerVisible" :ref="maskRef" @mousedown="onMaskClick" :class="cx('mask')" :style="sx('mask', true, { position })" v-bind="ptm('mask')">
<transition name="p-sidebar" @enter="onEnter" @after-enter="onAfterEnter" @before-leave="onBeforeLeave" @leave="onLeave" @after-leave="onAfterLeave" appear v-bind="ptm('transition')">
<div v-if="visible" :ref="containerRef" v-focustrap :class="cx('root')" role="complementary" :aria-modal="modal" @keydown="onKeydown" v-bind="{ ...$attrs, ...ptm('root') }">
<div v-if="visible" :ref="containerRef" v-focustrap :class="cx('root')" role="complementary" :aria-modal="modal" v-bind="{ ...$attrs, ...ptm('root') }">
<slot v-if="$slots.container" name="container" :onClose="hide" :closeCallback="hide"></slot>
<template v-else>
<div :ref="headerContainerRef" :class="cx('header')" v-bind="ptm('header')">
@ -49,6 +49,7 @@ export default {
headerContainer: null,
closeButton: null,
outsideClickListener: null,
documentKeydownListener: null,
updated() {
if (this.visible) {
this.containerVisible = this.visible;
@ -71,6 +72,7 @@ export default {
onEnter() {
this.$emit('show');
this.focus();
this.bindDocumentKeyDownListener();
if (this.autoZIndex) {
ZIndexUtils.set('modal', this.mask, this.baseZIndex || this.$primevue.config.zIndex.modal);
@ -92,6 +94,7 @@ export default {
ZIndexUtils.clear(this.mask);
}
this.unbindDocumentKeyDownListener();
this.containerVisible = false;
this.disableDocumentSettings();
this.$emit('after-hide');
@ -154,6 +157,18 @@ export default {
closeButtonRef(el) {
this.closeButton = el;
},
bindDocumentKeyDownListener() {
if (!this.documentKeydownListener) {
this.documentKeydownListener = this.onKeydown;
document.addEventListener('keydown', this.documentKeydownListener);
}
},
unbindDocumentKeyDownListener() {
if (this.documentKeydownListener) {
document.removeEventListener('keydown', this.documentKeydownListener);
this.documentKeydownListener = null;
}
},
bindOutsideClickListener() {
if (!this.outsideClickListener) {
this.outsideClickListener = (event) => {

View File

@ -30,6 +30,7 @@ const css = `
height: 0;
border-color: transparent;
border-style: solid;
scale: 2;
}
.p-tooltip-right .p-tooltip-arrow {

View File

@ -8608,6 +8608,14 @@
"default": "",
"description": "Used to pass attributes to the body's DOM element."
},
{
"name": "caption",
"optional": true,
"readonly": false,
"type": "CardPassThroughOptionType",
"default": "",
"description": "Used to pass attributes to the caption's DOM element."
},
{
"name": "title",
"optional": true,

View File

@ -27,7 +27,7 @@ export default {
code1: {
basic: `
<script>
import 'primevue/resources/themes/lara-light-green/theme.csss'
import 'primevue/resources/themes/lara-light-green/theme.css'
<\/script>
`
},

View File

@ -21,7 +21,9 @@ export default defineNuxtConfig({
'nuxt-primevue'
],
primevue: {
unstyled: true
options: {
unstyled: true
}
}
})
`