Fixed #4929 - Add parent param to all pt method options

pull/4931/head
mertsincan 2023-12-05 11:06:32 +00:00
parent 1a4bba8107
commit eb00b8ee23
104 changed files with 399 additions and 158 deletions

View File

@ -31,6 +31,10 @@ export interface AccordionPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: AccordionState; state: AccordionState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -106,6 +106,7 @@ export default {
const tabMetaData = { const tabMetaData = {
props: tab.props || {}, props: tab.props || {},
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -8,7 +8,6 @@
* *
*/ */
import { AnchorHTMLAttributes, HTMLAttributes, TransitionProps, VNode } from 'vue'; import { AnchorHTMLAttributes, HTMLAttributes, TransitionProps, VNode } from 'vue';
import { AccordionPassThroughOptions } from '../accordion';
import { PassThroughOptions } from '../passthrough'; import { PassThroughOptions } from '../passthrough';
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
@ -29,9 +28,9 @@ export interface AccordionTabPassThroughMethodOptions {
*/ */
props: AccordionTabProps; props: AccordionTabProps;
/** /**
* Defines parent instance. * Defines parent options.
*/ */
parent: AccordionPassThroughOptions; parent: any;
/** /**
* Defines current options. * Defines current options.
*/ */

View File

@ -38,6 +38,10 @@ export interface AutoCompletePassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: AutoCompleteContext; context: AutoCompleteContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -7,7 +7,6 @@
* @module avatar * @module avatar
*/ */
import { VNode } from 'vue'; import { VNode } from 'vue';
import { AvatarGroupPassThroughOptions } from '../avatargroup';
import { ComponentHooks } from '../basecomponent'; import { ComponentHooks } from '../basecomponent';
import { PassThroughOptions } from '../passthrough'; import { PassThroughOptions } from '../passthrough';
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
@ -27,9 +26,9 @@ export interface AvatarPassThroughMethodOptions {
*/ */
props: AvatarProps; props: AvatarProps;
/** /**
* Defines parent instance. * Defines parent options.
*/ */
parent: AvatarGroupPassThroughOptions; parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -1,10 +1,10 @@
<template> <template>
<div :class="cx('root')" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="getPTOptions('root')" data-pc-name="avatar"> <div :class="cx('root')" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('root')" data-pc-name="avatar">
<slot> <slot>
<span v-if="label" :class="cx('label')" v-bind="getPTOptions('label')">{{ label }}</span> <span v-if="label" :class="cx('label')" v-bind="ptm('label')">{{ label }}</span>
<component v-else-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" /> <component v-else-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" />
<span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="getPTOptions('icon')" /> <span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="ptm('icon')" />
<img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" v-bind="getPTOptions('image')" /> <img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" v-bind="ptm('image')" />
</slot> </slot>
</div> </div>
</template> </template>
@ -19,13 +19,6 @@ export default {
methods: { methods: {
onError(event) { onError(event) {
this.$emit('error', event); this.$emit('error', event);
},
getPTOptions(key) {
return this.ptm(key, {
parent: {
instance: this.$parent
}
});
} }
} }
}; };

View File

@ -1,5 +1,5 @@
<template> <template>
<span :class="cx('root')" v-bind="getPTOptions('root')" data-pc-name="badge"> <span :class="cx('root')" v-bind="ptm('root')" data-pc-name="badge">
<slot>{{ value }}</slot> <slot>{{ value }}</slot>
</span> </span>
</template> </template>
@ -9,16 +9,6 @@ import BaseBadge from './BaseBadge.vue';
export default { export default {
name: 'Badge', name: 'Badge',
extends: BaseBadge, extends: BaseBadge
methods: {
getPTOptions(key) {
return this.ptm(key, {
parent: {
props: this.$parent?.$props,
state: this.$parent?.$data
}
});
}
}
}; };
</script> </script>

View File

@ -18,6 +18,10 @@ export declare type BadgeDirectivePassThroughOptionType = BadgeDirectivePassThro
*/ */
export interface BadgePassThroughMethodOptions { export interface BadgePassThroughMethodOptions {
context: BadgeContext; context: BadgeContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -202,7 +202,20 @@ export default {
return this.unstyled !== undefined ? this.unstyled : this.$config?.unstyled; return this.unstyled !== undefined ? this.unstyled : this.$config?.unstyled;
}, },
$params() { $params() {
return { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance }; const parentInstance = this.$parentInstance || this.$parent;
return {
instance: this,
props: this.$props,
state: this.$data,
parent: {
instance: parentInstance,
props: parentInstance?.$props,
state: parentInstance?.$data
},
/* @deprecated since v3.43.0. Use the `parent.instance` instead of the `parentInstance`.*/
parentInstance
};
}, },
$style() { $style() {
return { classes: undefined, inlineStyles: undefined, loadStyle: () => {}, loadCustomStyle: () => {}, ...(this._getHostInstance(this) || {}).$style, ...this.$options.style }; return { classes: undefined, inlineStyles: undefined, loadStyle: () => {}, loadCustomStyle: () => {}, ...(this._getHostInstance(this) || {}).$style, ...this.$options.style };

View File

@ -30,6 +30,10 @@ export interface BlockUIPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: BlockUIState; state: BlockUIState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -31,6 +31,10 @@ export interface BreadcrumbPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: BreadcrumbContext; context: BreadcrumbContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -26,10 +26,6 @@ export default {
methods: { methods: {
getPTOptions(key) { getPTOptions(key) {
return this.ptm(key, { return this.ptm(key, {
parent: {
props: this.$parent?.$props,
state: this.$parent?.$data
},
context: { context: {
disabled: this.disabled disabled: this.disabled
} }

View File

@ -37,6 +37,10 @@ export interface CalendarPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: CalendarContext; context: CalendarContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -34,6 +34,10 @@ export interface CarouselPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: CarouselContext; context: CarouselContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface CascadeSelectPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: CascadeSelectState; state: CascadeSelectState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -26,6 +26,10 @@ export interface ChartPassThroughMethodOptions {
* Defines valid properties. * Defines valid properties.
*/ */
props: ChartProps; props: ChartProps;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -34,6 +34,10 @@ export interface CheckboxPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: CheckboxContext; context: CheckboxContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -30,6 +30,10 @@ export interface ChipPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: ChipState; state: ChipState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -30,6 +30,10 @@ export interface ChipsPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: ChipsState; state: ChipsState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface ColorPickerPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: ColorPickerState; state: ColorPickerState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -33,9 +33,9 @@ export interface ColumnPassThroughMethodOptions {
*/ */
props: ColumnProps; props: ColumnProps;
/** /**
* Defines parent instance. * Defines parent options.
*/ */
parent: DataTablePassThroughOptions; parent: any;
/** /**
* Defines current options. * Defines current options.
*/ */

View File

@ -6,7 +6,6 @@
* @module columngroup * @module columngroup
*/ */
import { ComponentHooks } from '../basecomponent'; import { ComponentHooks } from '../basecomponent';
import { DataTablePassThroughOptions } from '../datatable';
import { PassThroughOptions } from '../passthrough'; import { PassThroughOptions } from '../passthrough';
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
@ -25,9 +24,9 @@ export interface ColumnGroupPassThroughMethodOptions {
*/ */
props: ColumnGroupProps; props: ColumnGroupProps;
/** /**
* Defines parent instance. * Defines parent options.
*/ */
parent: DataTablePassThroughOptions; parent: any;
/** /**
* Defines current options. * Defines current options.
*/ */

View File

@ -32,6 +32,10 @@ export interface ConfirmDialogPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: ConfirmDialogState; state: ConfirmDialogState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -34,6 +34,10 @@ export interface ConfirmPopupPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: ConfirmPopupState; state: ConfirmPopupState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -38,6 +38,10 @@ export interface ContextMenuPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: ContextMenuContext; context: ContextMenuContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -222,6 +222,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -330,6 +330,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -41,6 +41,10 @@ export interface DataTablePassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: DataTableContext; context: DataTableContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -47,6 +47,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -206,6 +206,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -50,6 +50,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -55,6 +55,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -40,6 +40,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -310,6 +310,7 @@ export default {
getColumnPT(key) { getColumnPT(key) {
const columnMetaData = { const columnMetaData = {
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
} }

View File

@ -43,6 +43,7 @@ export default {
const columnGroupMetaData = { const columnGroupMetaData = {
props: this.getColumnGroupProps(), props: this.getColumnGroupProps(),
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },
@ -61,6 +62,7 @@ export default {
const rowMetaData = { const rowMetaData = {
props: row.props, props: row.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -234,6 +234,7 @@ export default {
const columnGroupMetaData = { const columnGroupMetaData = {
props: this.getColumnGroupProps(), props: this.getColumnGroupProps(),
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },
@ -252,6 +253,7 @@ export default {
const rowMetaData = { const rowMetaData = {
props: row.props, props: row.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },
@ -269,6 +271,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: column.props, props: column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -31,6 +31,10 @@ export interface DataViewPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: DataViewState; state: DataViewState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -35,6 +35,10 @@ export interface DataViewLayoutOptionsPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: DataViewLayoutOptionsState; state: DataViewLayoutOptionsState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -30,6 +30,10 @@ export interface DeferredContentPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: DeferredContentState; state: DeferredContentState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -26,6 +26,10 @@ export interface DividerPassThroughMethodOptions {
* Defines valid properties. * Defines valid properties.
*/ */
props: DividerProps; props: DividerProps;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -35,6 +35,10 @@ export interface DockPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: DockContext; context: DockContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="container" :id="id" :class="cx('root')" @click="onContainerClick" v-bind="getPTOptions('root')" data-pc-name="dropdown"> <div ref="container" :id="id" :class="cx('root')" @click="onContainerClick" v-bind="ptm('root')" data-pc-name="dropdown">
<input <input
v-if="editable" v-if="editable"
ref="focusInput" ref="focusInput"
@ -23,7 +23,7 @@
@blur="onBlur" @blur="onBlur"
@keydown="onKeyDown" @keydown="onKeyDown"
@input="onEditableInput" @input="onEditableInput"
v-bind="{ ...inputProps, ...getPTOptions('input') }" v-bind="{ ...inputProps, ...ptm('input') }"
/> />
<span <span
v-else v-else
@ -43,25 +43,25 @@
@focus="onFocus" @focus="onFocus"
@blur="onBlur" @blur="onBlur"
@keydown="onKeyDown" @keydown="onKeyDown"
v-bind="{ ...inputProps, ...getPTOptions('input') }" v-bind="{ ...inputProps, ...ptm('input') }"
> >
<slot name="value" :value="modelValue" :placeholder="placeholder">{{ label === 'p-emptylabel' ? '&nbsp;' : label || 'empty' }}</slot> <slot name="value" :value="modelValue" :placeholder="placeholder">{{ label === 'p-emptylabel' ? '&nbsp;' : label || 'empty' }}</slot>
</span> </span>
<slot v-if="showClear && modelValue != null" name="clearicon" :class="cx('clearIcon')" :onClick="onClearClick" :clearCallback="onClearClick"> <slot v-if="showClear && modelValue != null" name="clearicon" :class="cx('clearIcon')" :onClick="onClearClick" :clearCallback="onClearClick">
<component :is="clearIcon ? 'i' : 'TimesIcon'" ref="clearIcon" :class="[cx('clearIcon'), clearIcon]" @click="onClearClick" v-bind="{ ...clearIconProps, ...getPTOptions('clearIcon') }" data-pc-section="clearicon" /> <component :is="clearIcon ? 'i' : 'TimesIcon'" ref="clearIcon" :class="[cx('clearIcon'), clearIcon]" @click="onClearClick" v-bind="{ ...clearIconProps, ...ptm('clearIcon') }" data-pc-section="clearicon" />
</slot> </slot>
<div :class="cx('trigger')" v-bind="getPTOptions('trigger')"> <div :class="cx('trigger')" v-bind="ptm('trigger')">
<slot v-if="loading" name="loadingicon" :class="cx('loadingIcon')"> <slot v-if="loading" name="loadingicon" :class="cx('loadingIcon')">
<span v-if="loadingIcon" :class="[cx('loadingIcon'), 'pi-spin', loadingIcon]" aria-hidden="true" v-bind="getPTOptions('loadingIcon')" /> <span v-if="loadingIcon" :class="[cx('loadingIcon'), 'pi-spin', loadingIcon]" aria-hidden="true" v-bind="ptm('loadingIcon')" />
<SpinnerIcon v-else :class="cx('loadingIcon')" spin aria-hidden="true" v-bind="getPTOptions('loadingIcon')" /> <SpinnerIcon v-else :class="cx('loadingIcon')" spin aria-hidden="true" v-bind="ptm('loadingIcon')" />
</slot> </slot>
<slot v-else name="dropdownicon" :class="cx('dropdownIcon')"> <slot v-else name="dropdownicon" :class="cx('dropdownIcon')">
<component :is="dropdownIcon ? 'span' : 'ChevronDownIcon'" :class="[cx('dropdownIcon'), dropdownIcon]" aria-hidden="true" v-bind="getPTOptions('dropdownIcon')" /> <component :is="dropdownIcon ? 'span' : 'ChevronDownIcon'" :class="[cx('dropdownIcon'), dropdownIcon]" aria-hidden="true" v-bind="ptm('dropdownIcon')" />
</slot> </slot>
</div> </div>
<Portal :appendTo="appendTo"> <Portal :appendTo="appendTo">
<transition name="p-connected-overlay" @enter="onOverlayEnter" @after-enter="onOverlayAfterEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave" v-bind="getPTOptions('transition')"> <transition name="p-connected-overlay" @enter="onOverlayEnter" @after-enter="onOverlayAfterEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave" v-bind="ptm('transition')">
<div v-if="overlayVisible" :ref="overlayRef" :class="[cx('panel'), panelClass]" :style="panelStyle" @click="onOverlayClick" @keydown="onOverlayKeyDown" v-bind="{ ...panelProps, ...getPTOptions('panel') }"> <div v-if="overlayVisible" :ref="overlayRef" :class="[cx('panel'), panelClass]" :style="panelStyle" @click="onOverlayClick" @keydown="onOverlayKeyDown" v-bind="{ ...panelProps, ...ptm('panel') }">
<span <span
ref="firstHiddenFocusableElementOnOverlay" ref="firstHiddenFocusableElementOnOverlay"
role="presentation" role="presentation"
@ -69,13 +69,13 @@
class="p-hidden-accessible p-hidden-focusable" class="p-hidden-accessible p-hidden-focusable"
:tabindex="0" :tabindex="0"
@focus="onFirstHiddenFocus" @focus="onFirstHiddenFocus"
v-bind="getPTOptions('hiddenFirstFocusableEl')" v-bind="ptm('hiddenFirstFocusableEl')"
:data-p-hidden-accessible="true" :data-p-hidden-accessible="true"
:data-p-hidden-focusable="true" :data-p-hidden-focusable="true"
></span> ></span>
<slot name="header" :value="modelValue" :options="visibleOptions"></slot> <slot name="header" :value="modelValue" :options="visibleOptions"></slot>
<div v-if="filter" :class="cx('header')" v-bind="getPTOptions('header')"> <div v-if="filter" :class="cx('header')" v-bind="ptm('header')">
<div :class="cx('filterContainer')" v-bind="getPTOptions('filterContainer')"> <div :class="cx('filterContainer')" v-bind="ptm('filterContainer')">
<input <input
ref="filterInput" ref="filterInput"
type="text" type="text"
@ -90,29 +90,22 @@
@keydown="onFilterKeyDown" @keydown="onFilterKeyDown"
@blur="onFilterBlur" @blur="onFilterBlur"
@input="onFilterChange" @input="onFilterChange"
v-bind="{ ...filterInputProps, ...getPTOptions('filterInput') }" v-bind="{ ...filterInputProps, ...ptm('filterInput') }"
/> />
<slot name="filtericon" :class="cx('filterIcon')"> <slot name="filtericon" :class="cx('filterIcon')">
<component :is="filterIcon ? 'span' : 'FilterIcon'" :class="[cx('filterIcon'), filterIcon]" v-bind="getPTOptions('filterIcon')" /> <component :is="filterIcon ? 'span' : 'FilterIcon'" :class="[cx('filterIcon'), filterIcon]" v-bind="ptm('filterIcon')" />
</slot> </slot>
</div> </div>
<span role="status" aria-live="polite" class="p-hidden-accessible" v-bind="getPTOptions('hiddenFilterResult')" :data-p-hidden-accessible="true"> <span role="status" aria-live="polite" class="p-hidden-accessible" v-bind="ptm('hiddenFilterResult')" :data-p-hidden-accessible="true">
{{ filterResultMessageText }} {{ filterResultMessageText }}
</span> </span>
</div> </div>
<div :class="cx('wrapper')" :style="{ 'max-height': virtualScrollerDisabled ? scrollHeight : '' }" v-bind="getPTOptions('wrapper')"> <div :class="cx('wrapper')" :style="{ 'max-height': virtualScrollerDisabled ? scrollHeight : '' }" v-bind="ptm('wrapper')">
<VirtualScroller :ref="virtualScrollerRef" v-bind="virtualScrollerOptions" :items="visibleOptions" :style="{ height: scrollHeight }" :tabindex="-1" :disabled="virtualScrollerDisabled" :pt="getPTOptions('virtualScroller')"> <VirtualScroller :ref="virtualScrollerRef" v-bind="virtualScrollerOptions" :items="visibleOptions" :style="{ height: scrollHeight }" :tabindex="-1" :disabled="virtualScrollerDisabled" :pt="ptm('virtualScroller')">
<template v-slot:content="{ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }"> <template v-slot:content="{ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }">
<ul :ref="(el) => listRef(el, contentRef)" :id="id + '_list'" :class="[cx('list'), styleClass]" :style="contentStyle" role="listbox" v-bind="getPTOptions('list')"> <ul :ref="(el) => listRef(el, contentRef)" :id="id + '_list'" :class="[cx('list'), styleClass]" :style="contentStyle" role="listbox" v-bind="ptm('list')">
<template v-for="(option, i) of items" :key="getOptionRenderKey(option, getOptionIndex(i, getItemOptions))"> <template v-for="(option, i) of items" :key="getOptionRenderKey(option, getOptionIndex(i, getItemOptions))">
<li <li v-if="isOptionGroup(option)" :id="id + '_' + getOptionIndex(i, getItemOptions)" :style="{ height: itemSize ? itemSize + 'px' : undefined }" :class="cx('itemGroup')" role="option" v-bind="ptm('itemGroup')">
v-if="isOptionGroup(option)"
:id="id + '_' + getOptionIndex(i, getItemOptions)"
:style="{ height: itemSize ? itemSize + 'px' : undefined }"
:class="cx('itemGroup')"
role="option"
v-bind="getPTOptions('itemGroup')"
>
<slot name="optiongroup" :option="option.optionGroup" :index="getOptionIndex(i, getItemOptions)">{{ getOptionGroupLabel(option.optionGroup) }}</slot> <slot name="optiongroup" :option="option.optionGroup" :index="getOptionIndex(i, getItemOptions)">{{ getOptionGroupLabel(option.optionGroup) }}</slot>
</li> </li>
<li <li
@ -137,10 +130,10 @@
<slot name="option" :option="option" :index="getOptionIndex(i, getItemOptions)">{{ getOptionLabel(option) }}</slot> <slot name="option" :option="option" :index="getOptionIndex(i, getItemOptions)">{{ getOptionLabel(option) }}</slot>
</li> </li>
</template> </template>
<li v-if="filterValue && (!items || (items && items.length === 0))" :class="cx('emptyMessage')" role="option" v-bind="getPTOptions('emptyMessage')" :data-p-hidden-accessible="true"> <li v-if="filterValue && (!items || (items && items.length === 0))" :class="cx('emptyMessage')" role="option" v-bind="ptm('emptyMessage')" :data-p-hidden-accessible="true">
<slot name="emptyfilter">{{ emptyFilterMessageText }}</slot> <slot name="emptyfilter">{{ emptyFilterMessageText }}</slot>
</li> </li>
<li v-else-if="!options || (options && options.length === 0)" :class="cx('emptyMessage')" role="option" v-bind="getPTOptions('emptyMessage')" :data-p-hidden-accessible="true"> <li v-else-if="!options || (options && options.length === 0)" :class="cx('emptyMessage')" role="option" v-bind="ptm('emptyMessage')" :data-p-hidden-accessible="true">
<slot name="empty">{{ emptyMessageText }}</slot> <slot name="empty">{{ emptyMessageText }}</slot>
</li> </li>
</ul> </ul>
@ -151,10 +144,10 @@
</VirtualScroller> </VirtualScroller>
</div> </div>
<slot name="footer" :value="modelValue" :options="visibleOptions"></slot> <slot name="footer" :value="modelValue" :options="visibleOptions"></slot>
<span v-if="!options || (options && options.length === 0)" role="status" aria-live="polite" class="p-hidden-accessible" v-bind="getPTOptions('hiddenEmptyMessage')" :data-p-hidden-accessible="true"> <span v-if="!options || (options && options.length === 0)" role="status" aria-live="polite" class="p-hidden-accessible" v-bind="ptm('hiddenEmptyMessage')" :data-p-hidden-accessible="true">
{{ emptyMessageText }} {{ emptyMessageText }}
</span> </span>
<span role="status" aria-live="polite" class="p-hidden-accessible" v-bind="getPTOptions('hiddenSelectedMessage')" :data-p-hidden-accessible="true"> <span role="status" aria-live="polite" class="p-hidden-accessible" v-bind="ptm('hiddenSelectedMessage')" :data-p-hidden-accessible="true">
{{ selectedMessageText }} {{ selectedMessageText }}
</span> </span>
<span <span
@ -164,7 +157,7 @@
class="p-hidden-accessible p-hidden-focusable" class="p-hidden-accessible p-hidden-focusable"
:tabindex="0" :tabindex="0"
@focus="onLastHiddenFocus" @focus="onLastHiddenFocus"
v-bind="getPTOptions('hiddenLastFocusableEl')" v-bind="ptm('hiddenLastFocusableEl')"
:data-p-hidden-accessible="true" :data-p-hidden-accessible="true"
:data-p-hidden-focusable="true" :data-p-hidden-focusable="true"
></span> ></span>
@ -260,20 +253,8 @@ export default {
getOptionRenderKey(option, index) { getOptionRenderKey(option, index) {
return (this.dataKey ? ObjectUtils.resolveFieldData(option, this.dataKey) : this.getOptionLabel(option)) + '_' + index; return (this.dataKey ? ObjectUtils.resolveFieldData(option, this.dataKey) : this.getOptionLabel(option)) + '_' + index;
}, },
getPTOptions(key) {
return this.ptm(key, {
parent: {
props: this.$parent?.$props,
state: this.$parent?.$data
}
});
},
getPTItemOptions(option, itemOptions, index, key) { getPTItemOptions(option, itemOptions, index, key) {
return this.ptm(key, { return this.ptm(key, {
parent: {
props: this.$parent?.$props,
state: this.$parent?.$data
},
context: { context: {
selected: this.isSelected(option), selected: this.isSelected(option),
focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions), focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions),

View File

@ -30,6 +30,10 @@ export interface EditorPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: EditorState; state: EditorState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface FieldsetPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: FieldsetState; state: FieldsetState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -33,6 +33,10 @@ export interface FileUploadPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: FileUploadState; state: FileUploadState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -36,6 +36,10 @@ export interface GalleriaPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: GalleriaContext; context: GalleriaContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface ImagePassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: ImageState; state: ImageState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -30,6 +30,10 @@ export interface InlineMessagePassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: InlineMessageState; state: InlineMessageState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface InplacePassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: InplaceState; state: InplaceState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -22,6 +22,10 @@ export interface InputGroupPassThroughMethodOptions {
* Defines instance. * Defines instance.
*/ */
instance: any; instance: any;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -22,6 +22,10 @@ export interface InputGroupAddonPassThroughMethodOptions {
* Defines instance. * Defines instance.
*/ */
instance: any; instance: any;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -29,6 +29,10 @@ export interface InputMaskPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: InputMaskContext; context: InputMaskContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -1,5 +1,5 @@
<template> <template>
<span :class="cx('root')" v-bind="getPTOptions('root')" data-pc-name="inputnumber"> <span :class="cx('root')" v-bind="ptm('root')" data-pc-name="inputnumber">
<INInputText <INInputText
ref="input" ref="input"
:id="inputId" :id="inputId"
@ -27,7 +27,7 @@
:unstyled="unstyled" :unstyled="unstyled"
data-pc-section="input" data-pc-section="input"
/> />
<span v-if="showButtons && buttonLayout === 'stacked'" :class="cx('buttonGroup')" v-bind="getPTOptions('buttonGroup')"> <span v-if="showButtons && buttonLayout === 'stacked'" :class="cx('buttonGroup')" v-bind="ptm('buttonGroup')">
<INButton <INButton
:class="[cx('incrementButton'), incrementButtonClass]" :class="[cx('incrementButton'), incrementButtonClass]"
v-on="upButtonListeners" v-on="upButtonListeners"
@ -173,14 +173,6 @@ export default {
this.constructParser(); this.constructParser();
}, },
methods: { methods: {
getPTOptions(key) {
return this.ptm(key, {
parent: {
props: this.$parent?.$props,
state: this.$parent?.$data
}
});
},
getOptions() { getOptions() {
return { return {
localeMatcher: this.localeMatcher, localeMatcher: this.localeMatcher,

View File

@ -30,6 +30,10 @@ export interface InputSwitchPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: InputSwitchState; state: InputSwitchState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -1,5 +1,5 @@
<template> <template>
<input :class="cx('root')" :value="modelValue" @input="onInput" v-bind="ptm('root', ptmParams)" data-pc-name="inputtext" /> <input :class="cx('root')" :value="modelValue" @input="onInput" v-bind="getPTOptions('root')" data-pc-name="inputtext" />
</template> </template>
<script> <script>
@ -18,17 +18,13 @@ export default {
filled() { filled() {
return this.modelValue != null && this.modelValue.toString().length > 0; return this.modelValue != null && this.modelValue.toString().length > 0;
}, },
ptmParams() { getPTOptions(key) {
return { return this.ptm(key, {
parent: {
props: this.$parent?.$props,
state: this.$parent?.$data
},
context: { context: {
filled: this.filled, filled: this.filled,
disabled: this.$attrs.disabled || this.$attrs.disabled === '' disabled: this.$attrs.disabled || this.$attrs.disabled === ''
} }
}; });
} }
} }
}; };

View File

@ -29,6 +29,10 @@ export interface KnobPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: KnobState; state: KnobState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -35,6 +35,10 @@ export interface ListboxPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: ListboxContext; context: ListboxContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -35,6 +35,10 @@ export interface MegaMenuPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: MegaMenuContext; context: MegaMenuContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -37,6 +37,10 @@ export interface MenuPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: MenuContext; context: MenuContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -35,6 +35,10 @@ export interface MenubarPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: MenubarContext; context: MenubarContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -1,18 +1,18 @@
<template> <template>
<transition name="p-message" appear v-bind="getPTOptions('transition')"> <transition name="p-message" appear v-bind="ptm('transition')">
<div v-show="visible" :class="cx('root')" role="alert" aria-live="assertive" aria-atomic="true" v-bind="getPTOptions('root')" data-pc-name="message"> <div v-show="visible" :class="cx('root')" role="alert" aria-live="assertive" aria-atomic="true" v-bind="ptm('root')" data-pc-name="message">
<slot v-if="$slots.container" name="container" :onClose="close" :closeCallback="close"></slot> <slot v-if="$slots.container" name="container" :onClose="close" :closeCallback="close"></slot>
<div v-else :class="cx('wrapper')" v-bind="getPTOptions('wrapper')"> <div v-else :class="cx('wrapper')" v-bind="ptm('wrapper')">
<slot name="messageicon" class="p-message-icon"> <slot name="messageicon" class="p-message-icon">
<component :is="icon ? 'span' : iconComponent" :class="[cx('icon'), icon]" v-bind="getPTOptions('icon')"></component> <component :is="icon ? 'span' : iconComponent" :class="[cx('icon'), icon]" v-bind="ptm('icon')"></component>
</slot> </slot>
<div class="p-message-text" :class="cx('text')" v-bind="getPTOptions('text')"> <div class="p-message-text" :class="cx('text')" v-bind="ptm('text')">
<slot></slot> <slot></slot>
</div> </div>
<button v-if="closable" v-ripple :class="cx('closeButton')" :aria-label="closeAriaLabel" type="button" @click="close($event)" v-bind="{ ...closeButtonProps, ...getPTOptions('button'), ...getPTOptions('closeButton') }"> <button v-if="closable" v-ripple :class="cx('closeButton')" :aria-label="closeAriaLabel" type="button" @click="close($event)" v-bind="{ ...closeButtonProps, ...ptm('button'), ...ptm('closeButton') }">
<slot name="closeicon"> <slot name="closeicon">
<i v-if="closeIcon" :class="[cx('closeIcon'), closeIcon]" v-bind="{ ...getPTOptions('buttonIcon'), ...getPTOptions('closeIcon') }" /> <i v-if="closeIcon" :class="[cx('closeIcon'), closeIcon]" v-bind="{ ...ptm('buttonIcon'), ...ptm('closeIcon') }" />
<TimesIcon v-else :class="[cx('closeIcon'), closeIcon]" v-bind="{ ...getPTOptions('buttonIcon'), ...getPTOptions('closeIcon') }" /> <TimesIcon v-else :class="[cx('closeIcon'), closeIcon]" v-bind="{ ...ptm('buttonIcon'), ...ptm('closeIcon') }" />
</slot> </slot>
</button> </button>
</div> </div>
@ -52,14 +52,6 @@ export default {
} }
}, },
methods: { methods: {
getPTOptions(key) {
return this.ptm(key, {
parent: {
props: this.$parent?.$props,
state: this.$parent?.$data
}
});
},
close(event) { close(event) {
this.visible = false; this.visible = false;
this.$emit('close', event); this.$emit('close', event);

View File

@ -37,6 +37,10 @@ export interface MultiSelectPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: MultiSelectContext; context: MultiSelectContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -37,6 +37,10 @@ export interface OrderListPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: OrderListContext; context: OrderListContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -34,6 +34,10 @@ export interface OrganizationChartPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: OrganizationChartContext; context: OrganizationChartContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface OverlayPanelPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: OverlayPanelState; state: OverlayPanelState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface PanelPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: PanelState; state: PanelState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -37,6 +37,10 @@ export interface PanelMenuPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: PanelMenuContext; context: PanelMenuContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -33,6 +33,10 @@ export interface PasswordPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: PasswordState; state: PasswordState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -37,6 +37,10 @@ export interface PickListPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: PickListContext; context: PickListContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -1,12 +1,12 @@
<template> <template>
<div role="progressbar" :class="cx('root')" aria-valuemin="0" :aria-valuenow="value" aria-valuemax="100" v-bind="getPTOptions('root')"> <div role="progressbar" :class="cx('root')" aria-valuemin="0" :aria-valuenow="value" aria-valuemax="100" v-bind="ptm('root')">
<div v-if="determinate" :class="cx('value')" :style="progressStyle" v-bind="getPTOptions('value')"> <div v-if="determinate" :class="cx('value')" :style="progressStyle" v-bind="ptm('value')">
<div v-if="value != null && value !== 0 && showValue" :class="cx('label')" v-bind="getPTOptions('label')"> <div v-if="value != null && value !== 0 && showValue" :class="cx('label')" v-bind="ptm('label')">
<slot>{{ value + '%' }}</slot> <slot>{{ value + '%' }}</slot>
</div> </div>
</div> </div>
<div v-if="indeterminate" :class="cx('container')" v-bind="getPTOptions('container')"> <div v-if="indeterminate" :class="cx('container')" v-bind="ptm('container')">
<div :class="cx('value')" v-bind="getPTOptions('value')"></div> <div :class="cx('value')" v-bind="ptm('value')"></div>
</div> </div>
</div> </div>
</template> </template>
@ -17,16 +17,6 @@ import BaseProgressBar from './BaseProgressBar.vue';
export default { export default {
name: 'ProgressBar', name: 'ProgressBar',
extends: BaseProgressBar, extends: BaseProgressBar,
methods: {
getPTOptions(key) {
return this.ptm(key, {
parent: {
props: this.$parent?.$props,
state: this.$parent?.$data
}
});
}
},
computed: { computed: {
progressStyle() { progressStyle() {
return { return {

View File

@ -25,6 +25,10 @@ export interface ProgressSpinnerPassThroughMethodOptions {
* Defines valid properties. * Defines valid properties.
*/ */
props: ProgressSpinnerProps; props: ProgressSpinnerProps;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -30,6 +30,10 @@ export interface RadioButtonPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: RadioButtonState; state: RadioButtonState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -34,6 +34,10 @@ export interface RatingPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: RatingContext; context: RatingContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -6,7 +6,6 @@
* @module row * @module row
*/ */
import { ComponentHooks } from '../basecomponent'; import { ComponentHooks } from '../basecomponent';
import { ColumnGroupPassThroughOptions } from '../columngroup';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type RowPassThroughOptionType = RowPassThroughAttributes | ((options: RowPassThroughMethodOptions) => RowPassThroughAttributes | string) | string | null | undefined; export declare type RowPassThroughOptionType = RowPassThroughAttributes | ((options: RowPassThroughMethodOptions) => RowPassThroughAttributes | string) | string | null | undefined;
@ -24,9 +23,9 @@ export interface RowPassThroughMethodOptions {
*/ */
props: RowProps; props: RowProps;
/** /**
* Defines parent instance. * Defines parent options.
*/ */
parent: ColumnGroupPassThroughOptions; parent: any;
/** /**
* Defines current options. * Defines current options.
*/ */

View File

@ -30,6 +30,10 @@ export interface ScrollPanelPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: ScrollPanelState; state: ScrollPanelState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface ScrollTopPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: ScrollTopState; state: ScrollTopState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -34,6 +34,10 @@ export interface SelectButtonPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: SelectButtonContext; context: SelectButtonContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface SidebarPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: SidebarState; state: SidebarState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -25,6 +25,10 @@ export interface SkeletonPassThroughMethodOptions {
* Defines valid properties. * Defines valid properties.
*/ */
props: SkeletonProps; props: SkeletonProps;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -25,6 +25,10 @@ export interface SliderPassThroughMethodOptions {
* Defines valid properties. * Defines valid properties.
*/ */
props: SliderProps; props: SliderProps;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -36,6 +36,10 @@ export interface SpeedDialPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: SpeedDialContext; context: SpeedDialContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -33,6 +33,10 @@ export interface SplitButtonPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: SplitButtonState; state: SplitButtonState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -34,6 +34,10 @@ export interface SplitterPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: SplitterContext; context: SplitterContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -30,6 +30,10 @@ export interface SplitterPanelPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: SplitterPanelContext; context: SplitterPanelContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -31,6 +31,10 @@ export interface StepsPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: StepsContext; context: StepsContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -35,6 +35,10 @@ export interface TabMenuPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: TabMenuContext; context: TabMenuContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -10,7 +10,6 @@
import { AnchorHTMLAttributes, HTMLAttributes, LiHTMLAttributes, VNode } from 'vue'; import { AnchorHTMLAttributes, HTMLAttributes, LiHTMLAttributes, VNode } from 'vue';
import { ComponentHooks } from '../basecomponent'; import { ComponentHooks } from '../basecomponent';
import { PassThroughOptions } from '../passthrough'; import { PassThroughOptions } from '../passthrough';
import { TabViewPassThroughOptions } from '../tabview';
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
export declare type TabPanelPassThroughOptionType = TabPanelPassThroughAttributes | ((options: TabPanelPassThroughMethodOptions) => TabPanelPassThroughAttributes | string) | string | null | undefined; export declare type TabPanelPassThroughOptionType = TabPanelPassThroughAttributes | ((options: TabPanelPassThroughMethodOptions) => TabPanelPassThroughAttributes | string) | string | null | undefined;
@ -27,14 +26,14 @@ export interface TabPanelPassThroughMethodOptions {
* Defines valid properties. * Defines valid properties.
*/ */
props: TabPanelProps; props: TabPanelProps;
/**
* Defines parent instance.
*/
parent: TabViewPassThroughOptions;
/** /**
* Defines current options. * Defines current options.
*/ */
context: TabPanelContext; context: TabPanelContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -154,6 +154,7 @@ export default {
const tabMetaData = { const tabMetaData = {
props: tab.props, props: tab.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -26,6 +26,10 @@ export interface TagPassThroughMethodOptions {
* Defines valid properties. * Defines valid properties.
*/ */
props: TagProps; props: TagProps;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -29,6 +29,10 @@ export interface TerminalPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: TerminalState; state: TerminalState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -30,6 +30,10 @@ export interface TextareaPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: TextareaContext; context: TextareaContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -29,6 +29,10 @@ export interface TimelinePassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: TimelineContext; context: TimelineContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -32,6 +32,10 @@ export interface ToastPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: ToastState; state: ToastState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -34,6 +34,10 @@ export interface ToggleButtonPassThroughMethodOptions {
* Defines current options. * Defines current options.
*/ */
context: ToggleButtonContext; context: ToggleButtonContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -26,6 +26,10 @@ export interface ToolbarPassThroughMethodOptions {
* Defines valid properties. * Defines valid properties.
*/ */
props: ToolbarProps; props: ToolbarProps;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -19,6 +19,10 @@ export declare type TooltipDirectivePassThroughOptionType = TooltipDirectivePass
*/ */
export interface TooltipPassThroughMethodOptions { export interface TooltipPassThroughMethodOptions {
context: TooltipContext; context: TooltipContext;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -1,21 +1,21 @@
<template> <template>
<div :class="cx('root')" v-bind="getPTOptions('root')" data-pc-name="tree"> <div :class="cx('root')" v-bind="ptm('root')" data-pc-name="tree">
<template v-if="loading && loadingMode === 'mask'"> <template v-if="loading && loadingMode === 'mask'">
<div :class="cx('loadingOverlay')" v-bind="getPTOptions('loadingOverlay')"> <div :class="cx('loadingOverlay')" v-bind="ptm('loadingOverlay')">
<slot name="loadingicon" :class="cx('loadingIcon')"> <slot name="loadingicon" :class="cx('loadingIcon')">
<i v-if="loadingIcon" :class="[cx('loadingIcon'), 'pi-spin', loadingIcon]" v-bind="getPTOptions('loadingIcon')" /> <i v-if="loadingIcon" :class="[cx('loadingIcon'), 'pi-spin', loadingIcon]" v-bind="ptm('loadingIcon')" />
<SpinnerIcon v-else spin :class="cx('loadingIcon')" v-bind="getPTOptions('loadingIcon')" /> <SpinnerIcon v-else spin :class="cx('loadingIcon')" v-bind="ptm('loadingIcon')" />
</slot> </slot>
</div> </div>
</template> </template>
<div v-if="filter" :class="cx('filterContainer')" v-bind="getPTOptions('filterContainer')"> <div v-if="filter" :class="cx('filterContainer')" v-bind="ptm('filterContainer')">
<input v-model="filterValue" type="text" autocomplete="off" :class="cx('input')" :placeholder="filterPlaceholder" @keydown="onFilterKeydown" v-bind="getPTOptions('input')" /> <input v-model="filterValue" type="text" autocomplete="off" :class="cx('input')" :placeholder="filterPlaceholder" @keydown="onFilterKeydown" v-bind="ptm('input')" />
<slot name="searchicon" :class="cx('searchIcon')"> <slot name="searchicon" :class="cx('searchIcon')">
<SearchIcon :class="cx('searchIcon')" v-bind="getPTOptions('searchIcon')" /> <SearchIcon :class="cx('searchIcon')" v-bind="ptm('searchIcon')" />
</slot> </slot>
</div> </div>
<div :class="cx('wrapper')" :style="{ maxHeight: scrollHeight }" v-bind="getPTOptions('wrapper')"> <div :class="cx('wrapper')" :style="{ maxHeight: scrollHeight }" v-bind="ptm('wrapper')">
<ul :class="cx('container')" role="tree" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="getPTOptions('container')"> <ul :class="cx('container')" role="tree" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('container')">
<TreeNode <TreeNode
v-for="(node, index) of valueToRender" v-for="(node, index) of valueToRender"
:key="node.key" :key="node.key"
@ -61,14 +61,6 @@ export default {
} }
}, },
methods: { methods: {
getPTOptions(key) {
return this.ptm(key, {
parent: {
props: this.$parent?.$props,
state: this.$parent?.$data
}
});
},
onNodeToggle(node) { onNodeToggle(node) {
const key = node.key; const key = node.key;

View File

@ -34,6 +34,10 @@ export interface TreeSelectPassThroughMethodOptions {
* Defines current inline state. * Defines current inline state.
*/ */
state: TreeSelectState; state: TreeSelectState;
/**
* Defines parent options.
*/
parent: any;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */

View File

@ -33,8 +33,8 @@ import CheckIcon from 'primevue/icons/check';
import ChevronDownIcon from 'primevue/icons/chevrondown'; import ChevronDownIcon from 'primevue/icons/chevrondown';
import ChevronRightIcon from 'primevue/icons/chevronright'; import ChevronRightIcon from 'primevue/icons/chevronright';
import MinusIcon from 'primevue/icons/minus'; import MinusIcon from 'primevue/icons/minus';
import Ripple from 'primevue/ripple';
import SpinnerIcon from 'primevue/icons/spinner'; import SpinnerIcon from 'primevue/icons/spinner';
import Ripple from 'primevue/ripple';
import { DomHandler, ObjectUtils } from 'primevue/utils'; import { DomHandler, ObjectUtils } from 'primevue/utils';
import { mergeProps } from 'vue'; import { mergeProps } from 'vue';
@ -120,6 +120,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },
@ -145,6 +146,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

View File

@ -47,6 +47,7 @@ export default {
const columnMetaData = { const columnMetaData = {
props: this.column.props, props: this.column.props,
parent: { parent: {
instance: this,
props: this.$props, props: this.$props,
state: this.$data state: this.$data
}, },

Some files were not shown because too many files have changed in this diff Show More