pull/4153/head
mertsincan 2023-07-17 10:39:37 +01:00
commit 3ef520a793
12 changed files with 1013 additions and 525 deletions

View File

@ -1,5 +1,23 @@
# Changelog
## [3.30.1](https://github.com/primefaces/primevue/tree/3.30.1) (2023-07-14)
**Implemented New Features and Enhancements:**
- Button: remove margin from default style [\#4139](https://github.com/primefaces/primevue/issues/4139)
- Improve `pt` options on components that use helper component [\#4136](https://github.com/primefaces/primevue/issues/4136)
- Pass Through Props: Syntactic improvement suggestion [\#4125](https://github.com/primefaces/primevue/issues/4125)
- PT context improvements [\#4124](https://github.com/primefaces/primevue/issues/4124)
**Fixed bugs:**
- TreeTable: Sorting does not work when clicking at the header title [\#4138](https://github.com/primefaces/primevue/issues/4138)
- Selection\(multiple and single\) not working in TreeTable [\#4133](https://github.com/primefaces/primevue/issues/4133)
- The types in PrimeVue config are not accessible [\#4122](https://github.com/primefaces/primevue/issues/4122)
- Browser CDN mode is not working as expected [\#4121](https://github.com/primefaces/primevue/issues/4121)
- TypeScript: changeTheme is not declared [\#4118](https://github.com/primefaces/primevue/issues/4118)
- Panel: Wrong prop type in `header` slot [\#4086](https://github.com/primefaces/primevue/issues/4086)
## [3.30.0](https://github.com/primefaces/primevue/tree/3.30.0) (2023-07-10)
[Full Changelog](https://github.com/primefaces/primevue/compare/3.29.2...HEAD)

View File

@ -594,6 +594,21 @@ export interface ColumnContext {
* @defaultValue false
*/
disabled: boolean;
/**
* Current sort state of the column as a boolean.
* @defaultValue false
*/
sorted: boolean;
/**
* Current frozen state of the column as a boolean.
* @defaultValue false
*/
frozen: boolean;
/**
* Current resizable state of the column as a boolean.
* @defaultValue false
*/
resizable: boolean;
}
/**

View File

@ -113,7 +113,10 @@ export default {
state: this.$data
},
context: {
index: this.index
index: this.index,
selectable: this.$parentInstance.rowHover || this.$parentInstance.rowSelectionMode,
selected: this.$parent.selected,
frozen: this.columnProp('frozen')
}
};

View File

@ -51,7 +51,8 @@ export default {
state: this.$data
},
context: {
index: this.index
index: this.index,
frozen: this.columnProp('frozen')
}
};

View File

@ -17,7 +17,7 @@
<component v-if="column.children && column.children.header" :is="column.children.header" :column="column" />
<span v-if="columnProp('header')" :class="cx('headerTitle')" v-bind="getColumnPT('headerTitle')">{{ columnProp('header') }}</span>
<span v-if="columnProp('sortable')" v-bind="getColumnPT('sort')">
<component :is="(column.children && column.children.sorticon) || sortableColumnIcon" :sorted="sortState.sorted" :sortOrder="sortState.sortOrder" data-pc-section="sorticon" :class="cx('sortIcon')" />
<component :is="(column.children && column.children.sorticon) || sortableColumnIcon" :sorted="sortState.sorted" :sortOrder="sortState.sortOrder" data-pc-section="sorticon" :class="cx('sortIcon')" v-bind="getColumnPT('sortIcon')" />
</span>
<span v-if="isMultiSorted()" :class="cx('sortBadge')" v-bind="getColumnPT('sortBadge')">{{ getMultiSortMetaIndex() + 1 }}</span>
</th>
@ -93,7 +93,10 @@ export default {
state: this.$data
},
context: {
index: this.index
index: this.index,
sorted: this.isColumnSorted(),
frozen: this.columnProp('frozen'),
resizable: this.resizableColumns
}
};

View File

@ -23,6 +23,7 @@ export interface TreeTablePassThroughMethodOptions {
instance: any;
props: TreeTableProps;
state: TreeTableState;
context: TreeTableContext;
}
/**
@ -213,14 +214,6 @@ export interface TreeTablePassThroughOptions {
* Uses to pass attributes to the header row's DOM element.
*/
headerRow?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the header filter row's DOM element.
*/
headerFilterRow?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the header filter cell's DOM element.
*/
headerFilterCell?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the tbody's DOM element.
*/
@ -330,6 +323,31 @@ export interface TreeTableState {
d_editing: boolean;
}
/**
* Defines current options in TreeTable component.
*/
export interface TreeTableContext {
/**
* Current index state of the item.
*/
index: number;
/**
* Current frozen state of the row as a boolean.
* @defaultValue false
*/
frozen: boolean;
/**
* Current selectable state of the row as a boolean.
* @defaultValue false
*/
selectable: boolean;
/**
* Current selected state of the row as a boolean.
* @defaultValue false
*/
selected: boolean;
}
/**
* Defines valid properties in TreeTable component.
*/

View File

@ -65,9 +65,9 @@
></TTHeaderCell>
</template>
</tr>
<tr v-if="hasColumnFilter()" v-bind="ptm('headerFilterRow')">
<tr v-if="hasColumnFilter()" v-bind="ptm('headerRow')">
<template v-for="(col, i) of columns" :key="columnProp(col, 'columnKey') || columnProp(col, 'field') || i">
<th v-if="!columnProp(col, 'hidden')" :class="getFilterColumnHeaderClass(col)" :style="[columnProp(col, 'style'), columnProp(col, 'filterHeaderStyle')]" v-bind="ptm('headerFilterCell')">
<th v-if="!columnProp(col, 'hidden')" :class="getFilterColumnHeaderClass(col)" :style="[columnProp(col, 'style'), columnProp(col, 'filterHeaderStyle')]" v-bind="ptm('headerCell', ptHeaderCellOptions(col))">
<component v-if="col.children && col.children.filter" :is="col.children.filter" :column="col" :index="i" />
</th>
</template>
@ -231,6 +231,13 @@ export default {
columnProp(col, prop) {
return ObjectUtils.getVNodeProp(col, prop);
},
ptHeaderCellOptions(column) {
return {
context: {
frozen: this.columnProp(column, 'frozen')
}
};
},
onNodeToggle(node) {
const key = node.key;

View File

@ -14,7 +14,7 @@
@click="onClick"
@keydown="onKeyDown"
@touchend="onTouchEnd"
v-bind="ptm('row')"
v-bind="ptm('row', ptmOptions)"
:data-p-highlight="selected"
>
<template v-for="(col, i) of columns" :key="columnProp(col, 'columnKey') || columnProp(col, 'field') || i">
@ -413,6 +413,14 @@ export default {
},
getAriaSelected() {
return this.selectionMode === 'single' || this.selectionMode === 'multiple' ? this.selected : null;
},
ptmOptions() {
return {
context: {
selectable: this.$parentInstance.rowHover || this.$parentInstance.rowSelectionMode,
selected: this.selected
}
};
}
},
components: {

View File

@ -11129,6 +11129,30 @@
"type": "boolean",
"default": "false",
"description": "Current disabled state of row as a boolean."
},
{
"name": "sorted",
"optional": false,
"readonly": false,
"type": "boolean",
"default": "false",
"description": "Current sort state of the column as a boolean."
},
{
"name": "frozen",
"optional": false,
"readonly": false,
"type": "boolean",
"default": "false",
"description": "Current frozen state of the column as a boolean."
},
{
"name": "resizable",
"optional": false,
"readonly": false,
"type": "boolean",
"default": "false",
"description": "Current resizable state of the column as a boolean."
}
],
"methods": []
@ -43164,6 +43188,13 @@
"readonly": false,
"type": "TreeTableState",
"default": ""
},
{
"name": "context",
"optional": false,
"readonly": false,
"type": "TreeTableContext",
"default": ""
}
],
"methods": []
@ -43600,22 +43631,6 @@
"default": "",
"description": "Uses to pass attributes to the header row's DOM element."
},
{
"name": "headerFilterRow",
"optional": true,
"readonly": false,
"type": "TreeTablePassThroughOptionType",
"default": "",
"description": "Uses to pass attributes to the header filter row's DOM element."
},
{
"name": "headerFilterCell",
"optional": true,
"readonly": false,
"type": "TreeTablePassThroughOptionType",
"default": "",
"description": "Uses to pass attributes to the header filter cell's DOM element."
},
{
"name": "tbody",
"optional": true,
@ -43823,6 +43838,45 @@
],
"methods": []
},
"TreeTableContext": {
"description": "Defines current options in TreeTable component.",
"relatedProp": "",
"props": [
{
"name": "index",
"optional": false,
"readonly": false,
"type": "number",
"default": "",
"description": "Current index state of the item."
},
{
"name": "frozen",
"optional": false,
"readonly": false,
"type": "boolean",
"default": "false",
"description": "Current frozen state of the row as a boolean."
},
{
"name": "selectable",
"optional": false,
"readonly": false,
"type": "boolean",
"default": "false",
"description": "Current selectable state of the row as a boolean."
},
{
"name": "selected",
"optional": false,
"readonly": false,
"type": "boolean",
"default": "false",
"description": "Current selected state of the row as a boolean."
}
],
"methods": []
},
"TreeTableProps": {
"description": "Defines valid properties in TreeTable component.",
"relatedProp": "",

View File

@ -1,6 +1,6 @@
{
"name": "primevue",
"version": "3.30.0",
"version": "3.31.0-SNAPSHOT",
"homepage": "https://primevue.org/",
"repository": {
"type": "git",

1345
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "primevue",
"version": "3.30.0",
"version": "3.31.0-SNAPSHOT",
"homepage": "https://primevue.org/",
"repository": {
"type": "git",