diff --git a/CHANGELOG.md b/CHANGELOG.md index 39d764930..685f6de4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/components/lib/column/Column.d.ts b/components/lib/column/Column.d.ts index 7c26663b4..b96c57476 100755 --- a/components/lib/column/Column.d.ts +++ b/components/lib/column/Column.d.ts @@ -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; } /** diff --git a/components/lib/treetable/BodyCell.vue b/components/lib/treetable/BodyCell.vue index d7eb23d5f..f23fe05f9 100644 --- a/components/lib/treetable/BodyCell.vue +++ b/components/lib/treetable/BodyCell.vue @@ -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') } }; diff --git a/components/lib/treetable/FooterCell.vue b/components/lib/treetable/FooterCell.vue index 8be494d6c..4d5bed7e7 100644 --- a/components/lib/treetable/FooterCell.vue +++ b/components/lib/treetable/FooterCell.vue @@ -51,7 +51,8 @@ export default { state: this.$data }, context: { - index: this.index + index: this.index, + frozen: this.columnProp('frozen') } }; diff --git a/components/lib/treetable/HeaderCell.vue b/components/lib/treetable/HeaderCell.vue index f3c50c41d..50c7d53d2 100644 --- a/components/lib/treetable/HeaderCell.vue +++ b/components/lib/treetable/HeaderCell.vue @@ -17,7 +17,7 @@ {{ columnProp('header') }} - + {{ getMultiSortMetaIndex() + 1 }} @@ -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 } }; diff --git a/components/lib/treetable/TreeTable.d.ts b/components/lib/treetable/TreeTable.d.ts index 1ad480491..cfe9c8ed0 100755 --- a/components/lib/treetable/TreeTable.d.ts +++ b/components/lib/treetable/TreeTable.d.ts @@ -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. */ diff --git a/components/lib/treetable/TreeTable.vue b/components/lib/treetable/TreeTable.vue index 117a60930..03182622c 100755 --- a/components/lib/treetable/TreeTable.vue +++ b/components/lib/treetable/TreeTable.vue @@ -65,9 +65,9 @@ > - + @@ -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; diff --git a/components/lib/treetable/TreeTableRow.vue b/components/lib/treetable/TreeTableRow.vue index 212177c49..55bed4dbd 100755 --- a/components/lib/treetable/TreeTableRow.vue +++ b/components/lib/treetable/TreeTableRow.vue @@ -14,7 +14,7 @@ @click="onClick" @keydown="onKeyDown" @touchend="onTouchEnd" - v-bind="ptm('row')" + v-bind="ptm('row', ptmOptions)" :data-p-highlight="selected" >