Refactor #5257
parent
bcb1b6eb8d
commit
9a82025215
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<div v-for="(item, index) of value" :key="getKey(item, index)" :class="cx('event')" v-bind="getPTOptions('event', index)">
|
<div v-for="(item, index) of value" :key="getKey(item, index)" :class="cx('event')" v-bind="getPTOptions('event', index)">
|
||||||
<div :class="cx('opposite', { index })" v-bind="getPTOptions('opposite', index)">
|
<div :class="cx('opposite', { index })" v-bind="getPTOptions('opposite', index)">
|
||||||
<slot name="opposite" :item="item" :index="index"></slot>
|
<slot name="opposite" :item="item" :index="index"></slot>
|
||||||
|
@ -26,6 +26,7 @@ import BaseTimeline from './BaseTimeline.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Timeline',
|
name: 'Timeline',
|
||||||
extends: BaseTimeline,
|
extends: BaseTimeline,
|
||||||
|
inheritAttrs: false,
|
||||||
methods: {
|
methods: {
|
||||||
getKey(item, index) {
|
getKey(item, index) {
|
||||||
return this.dataKey ? ObjectUtils.resolveFieldData(item, this.dataKey) : index;
|
return this.dataKey ? ObjectUtils.resolveFieldData(item, this.dataKey) : index;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<Portal>
|
<Portal>
|
||||||
<div ref="container" :class="cx('root')" :style="sx('root', true, { position })" v-bind="{ ...$attrs, ...ptm('root') }">
|
<div ref="container" :class="cx('root')" :style="sx('root', true, { position })" v-bind="ptmi('root')">
|
||||||
<transition-group name="p-toast-message" tag="div" @enter="onEnter" @leave="onLeave" v-bind="{ ...ptm('message'), ...ptm('transition') }">
|
<transition-group name="p-toast-message" tag="div" @enter="onEnter" @leave="onLeave" v-bind="{ ...ptm('message'), ...ptm('transition') }">
|
||||||
<ToastMessage
|
<ToastMessage
|
||||||
v-for="msg of messages"
|
v-for="msg of messages"
|
||||||
|
|
|
@ -35,10 +35,13 @@ import BaseToggleButton from './BaseToggleButton.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'ToggleButton',
|
name: 'ToggleButton',
|
||||||
extends: BaseToggleButton,
|
extends: BaseToggleButton,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
||||||
methods: {
|
methods: {
|
||||||
getPTOptions(key) {
|
getPTOptions(key) {
|
||||||
return this.ptm(key, {
|
const _ptm = key === 'root' ? this.ptmi : this.ptm;
|
||||||
|
|
||||||
|
return _ptm(key, {
|
||||||
context: {
|
context: {
|
||||||
active: this.active,
|
active: this.active,
|
||||||
disabled: this.disabled
|
disabled: this.disabled
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" role="toolbar" :aria-labelledby="ariaLabelledby" v-bind="ptm('root')">
|
<div :class="cx('root')" role="toolbar" :aria-labelledby="ariaLabelledby" v-bind="ptmi('root')">
|
||||||
<div :class="cx('start')" v-bind="ptm('start')">
|
<div :class="cx('start')" v-bind="ptm('start')">
|
||||||
<slot name="start"></slot>
|
<slot name="start"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,6 +17,7 @@ import BaseToolbar from './BaseToolbar.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Toolbar',
|
name: 'Toolbar',
|
||||||
extends: BaseToolbar
|
extends: BaseToolbar,
|
||||||
|
inheritAttrs: false
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<template v-if="loading && loadingMode === 'mask'">
|
<template v-if="loading && loadingMode === 'mask'">
|
||||||
<div :class="cx('loadingOverlay')" v-bind="ptm('loadingOverlay')">
|
<div :class="cx('loadingOverlay')" v-bind="ptm('loadingOverlay')">
|
||||||
<slot name="loadingicon" :class="cx('loadingIcon')">
|
<slot name="loadingicon" :class="cx('loadingIcon')">
|
||||||
|
@ -48,6 +48,7 @@ import TreeNode from './TreeNode.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Tree',
|
name: 'Tree',
|
||||||
extends: BaseTree,
|
extends: BaseTree,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['node-expand', 'node-collapse', 'update:expandedKeys', 'update:selectionKeys', 'node-select', 'node-unselect', 'filter'],
|
emits: ['node-expand', 'node-collapse', 'update:expandedKeys', 'update:selectionKeys', 'node-select', 'node-unselect', 'filter'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="container" :class="cx('root')" :style="sx('root')" @click="onClick" v-bind="ptm('root')">
|
<div ref="container" :class="cx('root')" :style="sx('root')" @click="onClick" v-bind="ptmi('root')">
|
||||||
<div class="p-hidden-accessible" v-bind="ptm('hiddenInputWrapper')" :data-p-hidden-accessible="true">
|
<div class="p-hidden-accessible" v-bind="ptm('hiddenInputWrapper')" :data-p-hidden-accessible="true">
|
||||||
<input
|
<input
|
||||||
ref="focusInput"
|
ref="focusInput"
|
||||||
|
@ -117,6 +117,7 @@ import BaseTreeSelect from './BaseTreeSelect.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'TreeSelect',
|
name: 'TreeSelect',
|
||||||
extends: BaseTreeSelect,
|
extends: BaseTreeSelect,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'before-show', 'before-hide', 'change', 'show', 'hide', 'node-select', 'node-unselect', 'node-expand', 'node-collapse', 'focus', 'blur'],
|
emits: ['update:modelValue', 'before-show', 'before-hide', 'change', 'show', 'hide', 'node-select', 'node-unselect', 'node-expand', 'node-collapse', 'focus', 'blur'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" data-scrollselectors=".p-treetable-scrollable-body" role="table" v-bind="ptm('root')">
|
<div :class="cx('root')" data-scrollselectors=".p-treetable-scrollable-body" role="table" v-bind="ptmi('root')">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<div v-if="loading && loadingMode === 'mask'" :class="cx('loadingWrapper')" v-bind="ptm('loadingWrapper')">
|
<div v-if="loading && loadingMode === 'mask'" :class="cx('loadingWrapper')" v-bind="ptm('loadingWrapper')">
|
||||||
<div :class="cx('loadingOverlay')" v-bind="ptm('loadingOverlay')">
|
<div :class="cx('loadingOverlay')" v-bind="ptm('loadingOverlay')">
|
||||||
|
@ -180,6 +180,7 @@ import TreeTableRow from './TreeTableRow.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'TreeTable',
|
name: 'TreeTable',
|
||||||
extends: BaseTreeTable,
|
extends: BaseTreeTable,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: [
|
emits: [
|
||||||
'node-expand',
|
'node-expand',
|
||||||
'node-collapse',
|
'node-collapse',
|
||||||
|
|
|
@ -38,10 +38,13 @@ import BaseTriStateCheckbox from './BaseTriStateCheckbox.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'TriStateCheckbox',
|
name: 'TriStateCheckbox',
|
||||||
extends: BaseTriStateCheckbox,
|
extends: BaseTriStateCheckbox,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
||||||
methods: {
|
methods: {
|
||||||
getPTOptions(key) {
|
getPTOptions(key) {
|
||||||
return this.ptm(key, {
|
const _ptm = key === 'root' ? this.ptmi : this.ptm;
|
||||||
|
|
||||||
|
return _ptm(key, {
|
||||||
context: {
|
context: {
|
||||||
active: this.active,
|
active: this.active,
|
||||||
disabled: this.disabled
|
disabled: this.disabled
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<template v-if="!disabled">
|
<template v-if="!disabled">
|
||||||
<div :ref="elementRef" :class="containerClass" :tabindex="tabindex" :style="style" @scroll="onScroll" v-bind="ptm('root')">
|
<div :ref="elementRef" :class="containerClass" :tabindex="tabindex" :style="style" @scroll="onScroll" v-bind="ptmi('root')">
|
||||||
<slot
|
<slot
|
||||||
name="content"
|
name="content"
|
||||||
:styleClass="contentClass"
|
:styleClass="contentClass"
|
||||||
|
@ -51,14 +51,17 @@ import BaseVirtualScroller from './BaseVirtualScroller.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'VirtualScroller',
|
name: 'VirtualScroller',
|
||||||
extends: BaseVirtualScroller,
|
extends: BaseVirtualScroller,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:numToleratedItems', 'scroll', 'scroll-index-change', 'lazy-load'],
|
emits: ['update:numToleratedItems', 'scroll', 'scroll-index-change', 'lazy-load'],
|
||||||
data() {
|
data() {
|
||||||
|
const both = this.isBoth();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
first: this.isBoth() ? { rows: 0, cols: 0 } : 0,
|
first: both ? { rows: 0, cols: 0 } : 0,
|
||||||
last: this.isBoth() ? { rows: 0, cols: 0 } : 0,
|
last: both ? { rows: 0, cols: 0 } : 0,
|
||||||
page: this.isBoth() ? { rows: 0, cols: 0 } : 0,
|
page: both ? { rows: 0, cols: 0 } : 0,
|
||||||
numItemsInViewport: this.isBoth() ? { rows: 0, cols: 0 } : 0,
|
numItemsInViewport: both ? { rows: 0, cols: 0 } : 0,
|
||||||
lastScrollPos: this.isBoth() ? { top: 0, left: 0 } : 0,
|
lastScrollPos: both ? { top: 0, left: 0 } : 0,
|
||||||
d_numToleratedItems: this.numToleratedItems,
|
d_numToleratedItems: this.numToleratedItems,
|
||||||
d_loading: this.loading,
|
d_loading: this.loading,
|
||||||
loaderArr: [],
|
loaderArr: [],
|
||||||
|
|
Loading…
Reference in New Issue