parent
b3f19c01e6
commit
63663f3a50
|
@ -470,7 +470,7 @@ export default {
|
||||||
self,
|
self,
|
||||||
globalPT,
|
globalPT,
|
||||||
key !== 'transition' && {
|
key !== 'transition' && {
|
||||||
...(key === 'root' && { [`${datasetPrefix}name`]: ObjectUtils.toFlatCase(this.$.type.name) }),
|
...(key === 'root' && this.$.type.name === this.$options.hostName && { [`${datasetPrefix}name`]: ObjectUtils.toFlatCase(this.$.type.name) }),
|
||||||
[`${datasetPrefix}section`]: ObjectUtils.toFlatCase(key)
|
[`${datasetPrefix}section`]: ObjectUtils.toFlatCase(key)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
role="row"
|
role="row"
|
||||||
v-bind="ptm('rowGroupHeader')"
|
v-bind="ptm('rowGroupHeader')"
|
||||||
>
|
>
|
||||||
<td :colspan="columnsLength - 1" v-bind="ptm('rowGroupHeaderCell')">
|
<td :colspan="columnsLength - 1" v-bind="{ ...getColumnPT('root'), ...getColumnPT('bodyCell') }" data-pc-section="bodycell">
|
||||||
<button v-if="expandableRowGroups" :class="cx('rowGroupToggler')" @click="onRowGroupToggle($event, rowData)" type="button" v-bind="ptm('rowGroupToggler')">
|
<button v-if="expandableRowGroups" :class="cx('rowGroupToggler')" @click="onRowGroupToggle($event, rowData)" type="button" v-bind="ptm('rowGroupToggler')">
|
||||||
<component v-if="templates['rowgrouptogglericon']" :is="templates['rowgrouptogglericon']" :expanded="isRowGroupExpanded(rowData)" />
|
<component v-if="templates['rowgrouptogglericon']" :is="templates['rowgrouptogglericon']" :expanded="isRowGroupExpanded(rowData)" />
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
role="row"
|
role="row"
|
||||||
v-bind="ptm('rowExpansion')"
|
v-bind="ptm('rowExpansion')"
|
||||||
>
|
>
|
||||||
<td :colspan="columnsLength" v-bind="ptm('rowExpansionCell')">
|
<td :colspan="columnsLength" v-bind="{ ...getColumnPT('root'), ...getColumnPT('bodyCell') }">
|
||||||
<component :is="templates['expansion']" :data="rowData" :index="getRowIndex(index)" />
|
<component :is="templates['expansion']" :data="rowData" :index="getRowIndex(index)" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -102,14 +102,14 @@
|
||||||
role="row"
|
role="row"
|
||||||
v-bind="ptm('rowGroupFooter')"
|
v-bind="ptm('rowGroupFooter')"
|
||||||
>
|
>
|
||||||
<td :colspan="columnsLength - 1" v-bind="ptm('rowGroupFooterCell')">
|
<td :colspan="columnsLength - 1" v-bind="{ ...getColumnPT('root'), ...getColumnPT('footerCell') }" data-pc-section="footercell">
|
||||||
<component :is="templates['groupfooter']" :data="rowData" :index="getRowIndex(index)" />
|
<component :is="templates['groupfooter']" :data="rowData" :index="getRowIndex(index)" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<tr v-else :class="cx('emptyMessage')" role="row" v-bind="ptm('emptyMessage')">
|
<tr v-else :class="cx('emptyMessage')" role="row" v-bind="ptm('emptyMessage')">
|
||||||
<td :colspan="columnsLength" v-bind="ptm('emptyMessageCell')">
|
<td :colspan="columnsLength" v-bind="{ ...getColumnPT('root'), ...getColumnPT('bodyCell') }">
|
||||||
<component v-if="templates.empty" :is="templates.empty" />
|
<component v-if="templates.empty" :is="templates.empty" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -121,6 +121,7 @@ import BaseComponent from 'primevue/basecomponent';
|
||||||
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 { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils';
|
import { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils';
|
||||||
|
import { mergeProps } from 'vue';
|
||||||
import BodyCell from './BodyCell.vue';
|
import BodyCell from './BodyCell.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -306,6 +307,16 @@ export default {
|
||||||
columnProp(col, prop) {
|
columnProp(col, prop) {
|
||||||
return ObjectUtils.getVNodeProp(col, prop);
|
return ObjectUtils.getVNodeProp(col, prop);
|
||||||
},
|
},
|
||||||
|
getColumnPT(key) {
|
||||||
|
const columnMetaData = {
|
||||||
|
parent: {
|
||||||
|
props: this.$props,
|
||||||
|
state: this.$data
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return mergeProps(this.ptm(`column.${key}`, { column: columnMetaData }), this.ptm(`column.${key}`, columnMetaData), this.ptmo(this.getColumnProp({}), key, columnMetaData));
|
||||||
|
},
|
||||||
getColumnProp(column) {
|
getColumnProp(column) {
|
||||||
return column.props && column.props.pt ? column.props.pt : undefined; //@todo
|
return column.props && column.props.pt ? column.props.pt : undefined; //@todo
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,15 +8,14 @@
|
||||||
<Column field="name" header="Name"></Column>
|
<Column field="name" header="Name"></Column>
|
||||||
<Column field="category" header="Category"></Column>
|
<Column field="category" header="Category"></Column>
|
||||||
<Column field="quantity" header="Quantity"></Column>
|
<Column field="quantity" header="Quantity"></Column>
|
||||||
<template #empty>
|
|
||||||
<p>Empty DataTable</p>
|
|
||||||
</template>
|
|
||||||
</DataTable>
|
</DataTable>
|
||||||
</div>
|
</div>
|
||||||
<DocSectionCode :code="code" :service="['ProductService']" />
|
<DocSectionCode :code="code" :service="['ProductService']" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { ProductService } from '@/service/ProductService';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -94,7 +93,7 @@ const products = ref();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// ProductService.getProductsMini().then((data) => (this.products = data));
|
ProductService.getProductsMini().then((data) => (this.products = data));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -39,7 +39,7 @@ const CustomTailwind = usePassThrough(
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
mergeSections: true,
|
mergeSections: true,
|
||||||
mergeProps: false
|
useMergeProps: false
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue