-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat: move clipboard module into cdk #17272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ CDK_ENTRYPOINTS = [ | |
"a11y", | ||
"accordion", | ||
"bidi", | ||
"clipboard", | ||
"coercion", | ||
"collections", | ||
"drag-drop", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load("//tools:defaults.bzl", "ng_module") | ||
|
||
ng_module( | ||
name = "clipboard", | ||
srcs = glob(["**/*.ts"]), | ||
assets = glob([ | ||
"**/*.html", | ||
"**/*.css", | ||
]), | ||
module_name = "@angular/material-examples/cdk/clipboard", | ||
deps = [ | ||
"//src/cdk/clipboard", | ||
"@npm//@angular/forms", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "source-files", | ||
srcs = glob([ | ||
"*/*.html", | ||
"*/*.css", | ||
"*/*.ts", | ||
]), | ||
) |
4 changes: 4 additions & 0 deletions
4
...material-examples/cdk/clipboard/cdk-clipboard-overview/cdk-clipboard-overview-example.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
textarea { | ||
display: block; | ||
margin: 4px 0 8px; | ||
} |
3 changes: 3 additions & 0 deletions
3
...aterial-examples/cdk/clipboard/cdk-clipboard-overview/cdk-clipboard-overview-example.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<label for="clipboard-example-textarea">Text to be copied</label> | ||
<textarea id="clipboard-example-textarea" cols="30" rows="10" [(ngModel)]="value"></textarea> | ||
<button [cdkCopyToClipboard]="value">Copy to clipboard</button> |
21 changes: 21 additions & 0 deletions
21
src/material-examples/cdk/clipboard/cdk-clipboard-overview/cdk-clipboard-overview-example.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
/** | ||
* @title Clipboard overview | ||
*/ | ||
@Component({ | ||
selector: 'cdk-clipboard-overview-example', | ||
templateUrl: 'cdk-clipboard-overview-example.html', | ||
styleUrls: ['cdk-clipboard-overview-example.css'], | ||
}) | ||
export class CdkClipboardOverviewExample { | ||
value = `Did you ever hear the tragedy of Darth Plagueis The Wise? I thought not. It's not ` + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A surprise for sure, but a welcome one. |
||
`a story the Jedi would tell you. It's a Sith legend. Darth Plagueis was a Dark Lord ` + | ||
`of the Sith, so powerful and so wise he could use the Force to influence the ` + | ||
`midichlorians to create life… He had such a knowledge of the dark side that he could ` + | ||
`even keep the ones he cared about from dying. The dark side of the Force is a pathway ` + | ||
`to many abilities some consider to be unnatural. He became so powerful… the only ` + | ||
`thing he was afraid of was losing his power, which eventually, of course, he did. ` + | ||
`Unfortunately, he taught his apprentice everything he knew, then his apprentice ` + | ||
`killed him in his sleep. Ironic. He could save others from death, but not himself.`; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {FormsModule} from '@angular/forms'; | ||
import {ClipboardModule} from '@angular/cdk/clipboard'; | ||
import {CdkClipboardOverviewExample} from './cdk-clipboard-overview/cdk-clipboard-overview-example'; | ||
|
||
export {CdkClipboardOverviewExample}; | ||
|
||
const EXAMPLES = [CdkClipboardOverviewExample]; | ||
|
||
@NgModule({ | ||
imports: [ClipboardModule, FormsModule], | ||
declarations: EXAMPLES, | ||
exports: EXAMPLES, | ||
}) | ||
export class CdkClipboardExamplesModule { | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export declare class CdkCopyToClipboard { | ||
copied: EventEmitter<boolean>; | ||
text: string; | ||
constructor(_clipboard: Clipboard); | ||
copy(): void; | ||
} | ||
|
||
export declare class Clipboard { | ||
constructor(document: any); | ||
beginCopy(text: string): PendingCopy; | ||
copy(text: string): boolean; | ||
} | ||
|
||
export declare class ClipboardModule { | ||
} | ||
|
||
export declare class PendingCopy { | ||
constructor(text: string, _document: Document); | ||
copy(): boolean; | ||
destroy(): void; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.