Skip to content

Commit 7b77a2c

Browse files
committed
refactor: adding changes to copy to clipboard
1 parent a124263 commit 7b77a2c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

projects/assets-library/src/icons/icon-type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const enum IconType {
2828
Collapsed = 'svg:plus-square',
2929
Compare = 'svg:compare',
3030
CompareArrows = 'compare_arrows',
31+
ContentCopy = 'content_copy',
3132
CopyToClipboard = 'svg:copy-to-clipboard',
3233
Code = 'svg:code',
3334
Custom = 'svg:custom',

projects/components/src/copy-to-clipboard/copy-to-clipboard.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class CopyToClipboardComponent implements OnInit, OnDestroy {
5252
public size?: ButtonSize = ButtonSize.Small;
5353

5454
@Input()
55-
public icon?: IconType = IconType.CopyToClipboard;
55+
public icon?: IconType = IconType.ContentCopy;
5656

5757
@Input()
5858
public label?: string = 'Copy to Clipboard';
@@ -63,6 +63,9 @@ export class CopyToClipboardComponent implements OnInit, OnDestroy {
6363
@Input()
6464
public text?: string;
6565

66+
@Input()
67+
public tooltipDuration: number = 3000;
68+
6669
@Output()
6770
public readonly copiedChanges: EventEmitter<boolean> = new EventEmitter();
6871

@@ -133,7 +136,7 @@ export class CopyToClipboardComponent implements OnInit, OnDestroy {
133136
});
134137

135138
return of(popoverRef).pipe(
136-
delay(3000),
139+
delay(this.tooltipDuration ?? 0),
137140
finalize(() => popoverRef.close())
138141
);
139142
}

0 commit comments

Comments
 (0)