Skip to content

Commit

Permalink
feat(kit): Push add setting the number of lines of text (#6682)
Browse files Browse the repository at this point in the history
Co-authored-by: taiga-family-bot <[email protected]>
  • Loading branch information
vladimirpotekhin and taiga-family-bot authored Feb 5, 2024
1 parent 43a79c4 commit df5e07d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class ExampleTuiPushComponent {

heading = '';
type = '';
lines = 2;

readonly timestampVars = ['', 'A moment ago', 123456789];
timestamp = this.timestampVars[0];
Expand Down
8 changes: 8 additions & 0 deletions projects/demo/src/modules/components/push/push.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<tui-doc-demo>
<tui-push
[heading]="heading"
[lines]="lines"
[timestamp]="timestamp"
[type]="type"
(close)="documentationPropertyClose.emitEvent($event)"
Expand Down Expand Up @@ -69,6 +70,13 @@
>
Heading of the push
</ng-template>
<ng-template
documentationPropertyName="lines"
documentationPropertyType="number"
[(documentationPropertyValue)]="lines"
>
A number of visible lines
</ng-template>
<ng-template
documentationPropertyName="type"
documentationPropertyType="string"
Expand Down
6 changes: 6 additions & 0 deletions projects/kit/components/push/push.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import {Observable} from 'rxjs';
templateUrl: './push.template.html',
styleUrls: ['./push.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
'[style.--t-lines]': 'lines',
},
})
export class TuiPushComponent {
@Input()
Expand All @@ -23,6 +26,9 @@ export class TuiPushComponent {
@Input()
type = '';

@Input()
lines = 2;

@Input()
timestamp: number | string = '';

Expand Down
2 changes: 1 addition & 1 deletion projects/kit/components/push/push.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

/* autoprefixer: ignore next */
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
-webkit-line-clamp: var(--t-lines);
word-break: break-word;
overflow: hidden;
}
Expand Down

0 comments on commit df5e07d

Please sign in to comment.