Skip to content

Commit

Permalink
feat(p-data-table): add disableCopy option to DataTableField (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
sulmoJ authored Oct 12, 2022
1 parent 2ec9274 commit e60d365
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/data-display/tables/data-table/PDataTable.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ interface DataTableFieldType {
label?: string;
sortable?: boolean;
sortKey?: string;
disableCopy?: boolean;
width?: string;
textAlign?: DataTableCellTextAlign;
children?: DataTableFieldType[];
Expand All @@ -105,6 +106,7 @@ interface DataTableFieldType {
|label|Display name for the column(field) head.|
|sortable|Whether to sortable the table by the column or not. If it's not given, it follows the `sortable` props.|
|sortKey|If you give the value to this property, the value of `sortBy` passed to the `changeSort` and `update:sortBy` events is replaced with this value when sorting based on the corresponding column. default is the column `name`.|
|disableCopy|Use it when you want to disable copy functions in some columns.|
|width|If you want to fix the cell width, give the value.|
|textAlign|If you want to align text in the cell, give the value. <Description markdown={`${Object.values(DATA_TABLE_CELL_TEXT_ALIGN).map(d => `\`${d}\``).join(', ')} are available.`}/> |
|children|If you want to make a header cell span over multiple columns, give child fields to this property.|
Expand Down
2 changes: 1 addition & 1 deletion src/data-display/tables/data-table/PDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
>
{{ field.label ? field.label : field.name }}
</slot>
<p-copy-button v-if="colCopy && isLeafField(field)"
<p-copy-button v-if="colCopy && !field.disableCopy && isLeafField(field)"
copy-manually
@copy="onClickColCopy(field)"
/>
Expand Down
1 change: 1 addition & 0 deletions src/data-display/tables/data-table/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface DataTableFieldType {
label?: string;
sortable?: boolean;
sortKey?: string;
disableCopy?: boolean;
width?: string;
textAlign?: DataTableCellTextAlign;
children?: DataTableFieldType[];
Expand Down

0 comments on commit e60d365

Please sign in to comment.