@angular/cdk 11.2.1 → 11.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_overlay.scss +3 -1
- package/a11y/_a11y.import.scss +1 -0
- package/bundles/cdk-clipboard.umd.js +7 -1
- package/bundles/cdk-clipboard.umd.js.map +1 -1
- package/bundles/cdk-clipboard.umd.min.js +2 -2
- package/bundles/cdk-clipboard.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/clipboard/copy-to-clipboard.d.ts +5 -0
- package/clipboard/index.metadata.json +1 -1
- package/esm2015/clipboard/copy-to-clipboard.js +7 -2
- package/esm2015/version.js +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/clipboard.js +7 -2
- package/fesm2015/clipboard.js.map +1 -1
- package/overlay/_overlay.import.scss +1 -0
- package/overlay/_overlay.scss +3 -1
- package/overlay-prebuilt.css +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/text-field/_text-field.import.scss +1 -0
package/_overlay.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '../a11y/a11y';
|
|
2
|
+
|
|
1
3
|
// We want overlays to always appear over user content, so set a baseline
|
|
2
4
|
// very high z-index for the overlay container, which is where we create the new
|
|
3
5
|
// stacking context for all overlays.
|
|
@@ -84,7 +86,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
|
|
|
84
86
|
// to making it opaque using `opacity`. Note that we can't use the `cdk-high-contrast`
|
|
85
87
|
// mixin, because we can't normalize the import path to the _a11y.scss both for the
|
|
86
88
|
// source and when this file is distributed. See #10908.
|
|
87
|
-
@
|
|
89
|
+
@include cdk-high-contrast(active, off) {
|
|
88
90
|
opacity: 0.6;
|
|
89
91
|
}
|
|
90
92
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@forward 'a11y';
|
|
@@ -129,7 +129,12 @@
|
|
|
129
129
|
* found in the LICENSE file at https://angular.io/license
|
|
130
130
|
*/
|
|
131
131
|
/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */
|
|
132
|
-
var
|
|
132
|
+
var CDK_COPY_TO_CLIPBOARD_CONFIG = new i0.InjectionToken('CDK_COPY_TO_CLIPBOARD_CONFIG');
|
|
133
|
+
/**
|
|
134
|
+
* @deprecated Use `CDK_COPY_TO_CLIPBOARD_CONFIG` instead.
|
|
135
|
+
* @breaking-change 13.0.0
|
|
136
|
+
*/
|
|
137
|
+
var CKD_COPY_TO_CLIPBOARD_CONFIG = CDK_COPY_TO_CLIPBOARD_CONFIG;
|
|
133
138
|
/**
|
|
134
139
|
* Provides behavior for a button that when clicked copies content into user's
|
|
135
140
|
* clipboard.
|
|
@@ -243,6 +248,7 @@
|
|
|
243
248
|
* Generated bundle index. Do not edit.
|
|
244
249
|
*/
|
|
245
250
|
|
|
251
|
+
exports.CDK_COPY_TO_CLIPBOARD_CONFIG = CDK_COPY_TO_CLIPBOARD_CONFIG;
|
|
246
252
|
exports.CKD_COPY_TO_CLIPBOARD_CONFIG = CKD_COPY_TO_CLIPBOARD_CONFIG;
|
|
247
253
|
exports.CdkCopyToClipboard = CdkCopyToClipboard;
|
|
248
254
|
exports.Clipboard = Clipboard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-clipboard.umd.js","sources":["../../../../../src/cdk/clipboard/pending-copy.ts","../../../../../src/cdk/clipboard/clipboard.ts","../../../../../src/cdk/clipboard/copy-to-clipboard.ts","../../../../../src/cdk/clipboard/clipboard-module.ts","../../../../../src/cdk/clipboard/public-api.ts","../../../../../src/cdk/clipboard/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A pending copy-to-clipboard operation.\n *\n * The implementation of copying text to the clipboard modifies the DOM and\n * forces a relayout. This relayout can take too long if the string is large,\n * causing the execCommand('copy') to happen too long after the user clicked.\n * This results in the browser refusing to copy. This object lets the\n * relayout happen in a separate tick from copying by providing a copy function\n * that can be called later.\n *\n * Destroy must be called when no longer in use, regardless of whether `copy` is\n * called.\n */\nexport class PendingCopy {\n private _textarea: HTMLTextAreaElement|undefined;\n\n constructor(text: string, private readonly _document: Document) {\n const textarea = this._textarea = this._document.createElement('textarea');\n const styles = textarea.style;\n\n // Hide the element for display and accessibility. Set a fixed position so the page layout\n // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea\n // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.\n styles.position = 'fixed';\n styles.top = styles.opacity = '0';\n styles.left = '-999em';\n textarea.setAttribute('aria-hidden', 'true');\n textarea.value = text;\n this._document.body.appendChild(textarea);\n }\n\n /** Finishes copying the text. */\n copy(): boolean {\n const textarea = this._textarea;\n let successful = false;\n\n try { // Older browsers could throw if copy is not supported.\n if (textarea) {\n const currentFocus = this._document.activeElement as HTMLOrSVGElement | null;\n\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n\n if (currentFocus) {\n currentFocus.focus();\n }\n }\n } catch {\n // Discard error.\n // Initial setting of {@code successful} will represent failure here.\n }\n\n return successful;\n }\n\n /** Cleans up DOM changes used to perform the copy operation. */\n destroy() {\n const textarea = this._textarea;\n\n if (textarea) {\n if (textarea.parentNode) {\n textarea.parentNode.removeChild(textarea);\n }\n\n this._textarea = undefined;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {PendingCopy} from './pending-copy';\n\n\n/**\n * A service for copying text to the clipboard.\n */\n@Injectable({providedIn: 'root'})\nexport class Clipboard {\n private readonly _document: Document;\n\n constructor(@Inject(DOCUMENT) document: any) {\n this._document = document;\n }\n\n /**\n * Copies the provided text into the user's clipboard.\n *\n * @param text The string to copy.\n * @returns Whether the operation was successful.\n */\n copy(text: string): boolean {\n const pendingCopy = this.beginCopy(text);\n const successful = pendingCopy.copy();\n pendingCopy.destroy();\n\n return successful;\n }\n\n /**\n * Prepares a string to be copied later. This is useful for large strings\n * which take too long to successfully render and be copied in the same tick.\n *\n * The caller must call `destroy` on the returned `PendingCopy`.\n *\n * @param text The string to copy.\n * @returns the pending copy operation.\n */\n beginCopy(text: string): PendingCopy {\n return new PendingCopy(text, this._document);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n EventEmitter,\n Input,\n Output,\n NgZone,\n InjectionToken,\n Inject,\n Optional,\n OnDestroy,\n} from '@angular/core';\nimport {Clipboard} from './clipboard';\nimport {PendingCopy} from './pending-copy';\n\n/** Object that can be used to configure the default options for `CdkCopyToClipboard`. */\nexport interface CdkCopyToClipboardConfig {\n /** Default number of attempts to make when copying text to the clipboard. */\n attempts?: number;\n}\n\n/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */\nexport const CKD_COPY_TO_CLIPBOARD_CONFIG =\n new InjectionToken<CdkCopyToClipboardConfig>('CKD_COPY_TO_CLIPBOARD_CONFIG');\n\n/**\n * Provides behavior for a button that when clicked copies content into user's\n * clipboard.\n */\n@Directive({\n selector: '[cdkCopyToClipboard]',\n host: {\n '(click)': 'copy()',\n }\n})\nexport class CdkCopyToClipboard implements OnDestroy {\n /** Content to be copied. */\n @Input('cdkCopyToClipboard') text: string = '';\n\n /**\n * How many times to attempt to copy the text. This may be necessary for longer text, because\n * the browser needs time to fill an intermediate textarea element and copy the content.\n */\n @Input('cdkCopyToClipboardAttempts') attempts: number = 1;\n\n /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n */\n @Output('cdkCopyToClipboardCopied') copied = new EventEmitter<boolean>();\n\n /** Copies that are currently being attempted. */\n private _pending = new Set<PendingCopy>();\n\n /** Whether the directive has been destroyed. */\n private _destroyed: boolean;\n\n /** Timeout for the current copy attempt. */\n private _currentTimeout: any;\n\n constructor(\n private _clipboard: Clipboard,\n private _ngZone: NgZone,\n @Optional() @Inject(CKD_COPY_TO_CLIPBOARD_CONFIG) config?: CdkCopyToClipboardConfig) {\n\n if (config && config.attempts != null) {\n this.attempts = config.attempts;\n }\n }\n\n /** Copies the current text to the clipboard. */\n copy(attempts: number = this.attempts): void {\n if (attempts > 1) {\n let remainingAttempts = attempts;\n const pending = this._clipboard.beginCopy(this.text);\n this._pending.add(pending);\n\n const attempt = () => {\n const successful = pending.copy();\n if (!successful && --remainingAttempts && !this._destroyed) {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));\n } else {\n this._currentTimeout = null;\n this._pending.delete(pending);\n pending.destroy();\n this.copied.emit(successful);\n }\n };\n attempt();\n } else {\n this.copied.emit(this._clipboard.copy(this.text));\n }\n }\n\n ngOnDestroy() {\n if (this._currentTimeout) {\n clearTimeout(this._currentTimeout);\n }\n\n this._pending.forEach(copy => copy.destroy());\n this._pending.clear();\n this._destroyed = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\n\nimport {CdkCopyToClipboard} from './copy-to-clipboard';\n\n@NgModule({\n declarations: [CdkCopyToClipboard],\n exports: [CdkCopyToClipboard],\n})\nexport class ClipboardModule {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './clipboard';\nexport * from './clipboard-module';\nexport * from './copy-to-clipboard';\nexport * from './pending-copy';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Injectable","Inject","DOCUMENT","InjectionToken","EventEmitter","Directive","NgZone","Optional","Input","Output","NgModule"],"mappings":";;;;;;IAAA;;;;;;;IAQA;;;;;;;;;;;;;AAaA;QAGE,qBAAY,IAAY,EAAmB,SAAmB;YAAnB,cAAS,GAAT,SAAS,CAAU;YAC5D,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC3E,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;;;;YAK9B,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC1B,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;YAClC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;YACvB,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YAC7C,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;SAC3C;;QAGD,0BAAI,GAAJ;YACE,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,IAAI,UAAU,GAAG,KAAK,CAAC;YAEvB,IAAI;gBACF,IAAI,QAAQ,EAAE;oBACZ,IAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,aAAwC,CAAC;oBAE7E,QAAQ,CAAC,MAAM,EAAE,CAAC;oBAClB,QAAQ,CAAC,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACrD,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;oBAEhD,IAA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AC,CAAC;aACnD;SACF;QAED,wCAAW,GAAX;YACE,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACpC;YAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,OAAO,EAAE,GAAA,CAAC,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SACxB;;;;gBA1EFC,YAAS,SAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,IAAI,EAAE;wBACJ,SAAS,EAAE,QAAQ;qBACpB;iBACF;;;gBAtBO,SAAS;gBANfC,SAAM;gDAyDHC,WAAQ,YAAIN,SAAM,SAAC,4BAA4B;;;uBA1BjDO,QAAK,SAAC,oBAAoB;2BAM1BA,QAAK,SAAC,4BAA4B;yBAMlCC,SAAM,SAAC,0BAA0B;;;ICxDpC;;;;;;;AAQA;QAQA;;;;;gBAJCC,WAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B;;;ICfD;;;;;;OAMG;;ICNH;;OAEG;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"cdk-clipboard.umd.js","sources":["../../../../../src/cdk/clipboard/pending-copy.ts","../../../../../src/cdk/clipboard/clipboard.ts","../../../../../src/cdk/clipboard/copy-to-clipboard.ts","../../../../../src/cdk/clipboard/clipboard-module.ts","../../../../../src/cdk/clipboard/public-api.ts","../../../../../src/cdk/clipboard/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A pending copy-to-clipboard operation.\n *\n * The implementation of copying text to the clipboard modifies the DOM and\n * forces a relayout. This relayout can take too long if the string is large,\n * causing the execCommand('copy') to happen too long after the user clicked.\n * This results in the browser refusing to copy. This object lets the\n * relayout happen in a separate tick from copying by providing a copy function\n * that can be called later.\n *\n * Destroy must be called when no longer in use, regardless of whether `copy` is\n * called.\n */\nexport class PendingCopy {\n private _textarea: HTMLTextAreaElement|undefined;\n\n constructor(text: string, private readonly _document: Document) {\n const textarea = this._textarea = this._document.createElement('textarea');\n const styles = textarea.style;\n\n // Hide the element for display and accessibility. Set a fixed position so the page layout\n // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea\n // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.\n styles.position = 'fixed';\n styles.top = styles.opacity = '0';\n styles.left = '-999em';\n textarea.setAttribute('aria-hidden', 'true');\n textarea.value = text;\n this._document.body.appendChild(textarea);\n }\n\n /** Finishes copying the text. */\n copy(): boolean {\n const textarea = this._textarea;\n let successful = false;\n\n try { // Older browsers could throw if copy is not supported.\n if (textarea) {\n const currentFocus = this._document.activeElement as HTMLOrSVGElement | null;\n\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n\n if (currentFocus) {\n currentFocus.focus();\n }\n }\n } catch {\n // Discard error.\n // Initial setting of {@code successful} will represent failure here.\n }\n\n return successful;\n }\n\n /** Cleans up DOM changes used to perform the copy operation. */\n destroy() {\n const textarea = this._textarea;\n\n if (textarea) {\n if (textarea.parentNode) {\n textarea.parentNode.removeChild(textarea);\n }\n\n this._textarea = undefined;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {PendingCopy} from './pending-copy';\n\n\n/**\n * A service for copying text to the clipboard.\n */\n@Injectable({providedIn: 'root'})\nexport class Clipboard {\n private readonly _document: Document;\n\n constructor(@Inject(DOCUMENT) document: any) {\n this._document = document;\n }\n\n /**\n * Copies the provided text into the user's clipboard.\n *\n * @param text The string to copy.\n * @returns Whether the operation was successful.\n */\n copy(text: string): boolean {\n const pendingCopy = this.beginCopy(text);\n const successful = pendingCopy.copy();\n pendingCopy.destroy();\n\n return successful;\n }\n\n /**\n * Prepares a string to be copied later. This is useful for large strings\n * which take too long to successfully render and be copied in the same tick.\n *\n * The caller must call `destroy` on the returned `PendingCopy`.\n *\n * @param text The string to copy.\n * @returns the pending copy operation.\n */\n beginCopy(text: string): PendingCopy {\n return new PendingCopy(text, this._document);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n EventEmitter,\n Input,\n Output,\n NgZone,\n InjectionToken,\n Inject,\n Optional,\n OnDestroy,\n} from '@angular/core';\nimport {Clipboard} from './clipboard';\nimport {PendingCopy} from './pending-copy';\n\n/** Object that can be used to configure the default options for `CdkCopyToClipboard`. */\nexport interface CdkCopyToClipboardConfig {\n /** Default number of attempts to make when copying text to the clipboard. */\n attempts?: number;\n}\n\n/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */\nexport const CDK_COPY_TO_CLIPBOARD_CONFIG =\n new InjectionToken<CdkCopyToClipboardConfig>('CDK_COPY_TO_CLIPBOARD_CONFIG');\n\n/**\n * @deprecated Use `CDK_COPY_TO_CLIPBOARD_CONFIG` instead.\n * @breaking-change 13.0.0\n */\nexport const CKD_COPY_TO_CLIPBOARD_CONFIG = CDK_COPY_TO_CLIPBOARD_CONFIG;\n\n/**\n * Provides behavior for a button that when clicked copies content into user's\n * clipboard.\n */\n@Directive({\n selector: '[cdkCopyToClipboard]',\n host: {\n '(click)': 'copy()',\n }\n})\nexport class CdkCopyToClipboard implements OnDestroy {\n /** Content to be copied. */\n @Input('cdkCopyToClipboard') text: string = '';\n\n /**\n * How many times to attempt to copy the text. This may be necessary for longer text, because\n * the browser needs time to fill an intermediate textarea element and copy the content.\n */\n @Input('cdkCopyToClipboardAttempts') attempts: number = 1;\n\n /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n */\n @Output('cdkCopyToClipboardCopied') copied = new EventEmitter<boolean>();\n\n /** Copies that are currently being attempted. */\n private _pending = new Set<PendingCopy>();\n\n /** Whether the directive has been destroyed. */\n private _destroyed: boolean;\n\n /** Timeout for the current copy attempt. */\n private _currentTimeout: any;\n\n constructor(\n private _clipboard: Clipboard,\n private _ngZone: NgZone,\n @Optional() @Inject(CKD_COPY_TO_CLIPBOARD_CONFIG) config?: CdkCopyToClipboardConfig) {\n\n if (config && config.attempts != null) {\n this.attempts = config.attempts;\n }\n }\n\n /** Copies the current text to the clipboard. */\n copy(attempts: number = this.attempts): void {\n if (attempts > 1) {\n let remainingAttempts = attempts;\n const pending = this._clipboard.beginCopy(this.text);\n this._pending.add(pending);\n\n const attempt = () => {\n const successful = pending.copy();\n if (!successful && --remainingAttempts && !this._destroyed) {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));\n } else {\n this._currentTimeout = null;\n this._pending.delete(pending);\n pending.destroy();\n this.copied.emit(successful);\n }\n };\n attempt();\n } else {\n this.copied.emit(this._clipboard.copy(this.text));\n }\n }\n\n ngOnDestroy() {\n if (this._currentTimeout) {\n clearTimeout(this._currentTimeout);\n }\n\n this._pending.forEach(copy => copy.destroy());\n this._pending.clear();\n this._destroyed = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\n\nimport {CdkCopyToClipboard} from './copy-to-clipboard';\n\n@NgModule({\n declarations: [CdkCopyToClipboard],\n exports: [CdkCopyToClipboard],\n})\nexport class ClipboardModule {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './clipboard';\nexport * from './clipboard-module';\nexport * from './copy-to-clipboard';\nexport * from './pending-copy';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Injectable","Inject","DOCUMENT","InjectionToken","EventEmitter","Directive","NgZone","Optional","Input","Output","NgModule"],"mappings":";;;;;;IAAA;;;;;;;IAQA;;;;;;;;;;;;;AAaA;QAGE,qBAAY,IAAY,EAAmB,SAAmB;YAAnB,cAAS,GAAT,SAAS,CAAU;YAC5D,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC3E,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;;;;YAK9B,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC1B,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;YAClC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;YACvB,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YAC7C,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;SAC3C;;QAGD,0BAAI,GAAJ;YACE,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,IAAI,UAAU,GAAG,KAAK,CAAC;YAEvB,IAAI;gBACF,IAAI,QAAQ,EAAE;oBACZ,IAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,aAAwC,CAAC;oBAE7E,QAAQ,CAAC,MAAM,EAAE,CAAC;oBAClB,QAAQ,CAAC,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACrD,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,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,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;aACnD;SACF;QAED,wCAAW,GAAX;YACE,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACpC;YAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,OAAO,EAAE,GAAA,CAAC,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SACxB;;;;gBA1EFC,YAAS,SAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,IAAI,EAAE;wBACJ,SAAS,EAAE,QAAQ;qBACpB;iBACF;;;gBA5BO,SAAS;gBANfC,SAAM;gDA+DHC,WAAQ,YAAIN,SAAM,SAAC,4BAA4B;;;uBA1BjDO,QAAK,SAAC,oBAAoB;2BAM1BA,QAAK,SAAC,4BAA4B;yBAMlCC,SAAM,SAAC,0BAA0B;;;IC9DpC;;;;;;;AAQA;QAQA;;;;;gBAJCC,WAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B;;;ICfD;;;;;;OAMG;;ICNH;;OAEG;;;;;;;;;;;;;;;;;"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* Use of this source code is governed by an MIT-style license that can be
|
|
21
21
|
* found in the LICENSE file at https://angular.io/license
|
|
22
22
|
*/
|
|
23
|
-
var i,c=new o.InjectionToken("
|
|
23
|
+
var i,c=new o.InjectionToken("CDK_COPY_TO_CLIPBOARD_CONFIG"),p=c,a=function(){function t(t,e,n){this._clipboard=t,this._ngZone=e,this.text="",this.attempts=1,this.copied=new o.EventEmitter,this._pending=new Set,n&&null!=n.attempts&&(this.attempts=n.attempts)}return t.prototype.copy=function(t){var e=this;if(void 0===t&&(t=this.attempts),t>1){var o=t,n=this._clipboard.beginCopy(this.text);this._pending.add(n);var r=function(){var t=n.copy();t||!--o||e._destroyed?(e._currentTimeout=null,e._pending.delete(n),n.destroy(),e.copied.emit(t)):e._currentTimeout=e._ngZone.runOutsideAngular((function(){return setTimeout(r,1)}))};r()}else this.copied.emit(this._clipboard.copy(this.text))},t.prototype.ngOnDestroy=function(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach((function(t){return t.destroy()})),this._pending.clear(),this._destroyed=!0},t}();a.decorators=[{type:o.Directive,args:[{selector:"[cdkCopyToClipboard]",host:{"(click)":"copy()"}}]}],a.ctorParameters=function(){return[{type:r},{type:o.NgZone},{type:void 0,decorators:[{type:o.Optional},{type:o.Inject,args:[p]}]}]},a.propDecorators={text:[{type:o.Input,args:["cdkCopyToClipboard"]}],attempts:[{type:o.Input,args:["cdkCopyToClipboardAttempts"]}],copied:[{type:o.Output,args:["cdkCopyToClipboardCopied"]}]},(i=function i(){}).decorators=[{type:o.NgModule,args:[{declarations:[a],exports:[a]}]}],
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -28,4 +28,4 @@ var i,c=new o.InjectionToken("CKD_COPY_TO_CLIPBOARD_CONFIG"),p=function(){functi
|
|
|
28
28
|
* Use of this source code is governed by an MIT-style license that can be
|
|
29
29
|
* found in the LICENSE file at https://angular.io/license
|
|
30
30
|
*/
|
|
31
|
-
t.
|
|
31
|
+
t.CDK_COPY_TO_CLIPBOARD_CONFIG=c,t.CKD_COPY_TO_CLIPBOARD_CONFIG=p,t.CdkCopyToClipboard=a,t.Clipboard=r,t.ClipboardModule=i,t.PendingCopy=n,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/cdk/cdk-clipboard.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","clipboard","common","core","this","i1","i0","PendingCopy","text","_document","textarea","_textarea","createElement","styles","style","position","top","opacity","left","setAttribute","value","body","appendChild","prototype","copy","successful","currentFocus","activeElement","select","setSelectionRange","length","execCommand","focus","_a","destroy","parentNode","removeChild","undefined","Clipboard","document","pendingCopy","beginCopy","ɵprov","ɵɵdefineInjectable","Clipboard_Factory","ɵɵinject","DOCUMENT","token","providedIn","decorators","type","Injectable","args","ctorParameters","Inject","ClipboardModule","CKD_COPY_TO_CLIPBOARD_CONFIG","InjectionToken","CdkCopyToClipboard","_clipboard","_ngZone","config","attempts","copied","EventEmitter","_pending","Set","_this","remainingAttempts_1","pending_1","add","attempt_1","_destroyed","_currentTimeout","delete","emit","runOutsideAngular","setTimeout","ngOnDestroy","clearTimeout","forEach","clear","Directive","selector","host","(click)","NgZone","Optional","propDecorators","Input","Output","NgModule","declarations","Object","defineProperty"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,mBAAoBA,QAAQ,kBAClG,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,yBAA0B,CAAC,UAAW,kBAAmB,iBAAkBJ,GACrGA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC,UAAY,IAAKV,EAAOQ,GAAGG,OAAQX,EAAOQ,GAAGI,MAHpK,CAIEC,MAAM,SAAWX,EAASY,EAAIC,GAAM;;;;;;;OAsBlC,IAAIC,EAA6B,WAC7B,SAASA,EAAYC,EAAMC,GACvBL,KAAKK,UAAYA,EACjB,IAAIC,EAAWN,KAAKO,UAAYP,KAAKK,UAAUG,cAAc,YACzDC,EAASH,EAASI,MAItBD,EAAOE,SAAW,QAClBF,EAAOG,IAAMH,EAAOI,QAAU,IAC9BJ,EAAOK,KAAO,SACdR,EAASS,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AM5C,EAAGgF,QACX,CAAEpC,UAAMb,EAAWY,WAAY,CAAC,CAAEC,KAAM5C,EAAGiF,UAAY,CAAErC,KAAM5C,EAAGgD,OAAQF,KAAM,CAACI,QAErFE,EAAmB8B,eAAiB,CAChChF,KAAM,CAAC,CAAE0C,KAAM5C,EAAGmF,MAAOrC,KAAM,CAAC,wBAChCU,SAAU,CAAC,CAAEZ,KAAM5C,EAAGmF,MAAOrC,KAAM,CAAC,gCACpCW,OAAQ,CAAC,CAAEb,KAAM5C,EAAGoF,OAAQtC,KAAM,CAAC,gCAUnCG,EACA,SAASA,OAIGN,WAAa,CACzB,CAAEC,KAAM5C,EAAGqF,SAAUvC,KAAM,CAAC,CAChBwC,aAAc,CAAClC,GACfjE,QAAS,CAACiE;;;;;;;;AAgB1BjE,EAAQ+D,6BAA+BA,EACvC/D,EAAQiE,mBAAqBA,EAC7BjE,EAAQ6C,UAAYA,EACpB7C,EAAQ8D,gBAAkBA,EAC1B9D,EAAQc,YAAcA,EAEtBsF,OAAOC,eAAerG,EAAS,aAAc,CAAE2B,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/clipboard', ['exports', '@angular/common', '@angular/core'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.clipboard = {}), global.ng.common, global.ng.core));\n}(this, (function (exports, i1, i0) { 'use strict';\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * A pending copy-to-clipboard operation.\n *\n * The implementation of copying text to the clipboard modifies the DOM and\n * forces a relayout. This relayout can take too long if the string is large,\n * causing the execCommand('copy') to happen too long after the user clicked.\n * This results in the browser refusing to copy. This object lets the\n * relayout happen in a separate tick from copying by providing a copy function\n * that can be called later.\n *\n * Destroy must be called when no longer in use, regardless of whether `copy` is\n * called.\n */\n var PendingCopy = /** @class */ (function () {\n function PendingCopy(text, _document) {\n this._document = _document;\n var textarea = this._textarea = this._document.createElement('textarea');\n var styles = textarea.style;\n // Hide the element for display and accessibility. Set a fixed position so the page layout\n // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea\n // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.\n styles.position = 'fixed';\n styles.top = styles.opacity = '0';\n styles.left = '-999em';\n textarea.setAttribute('aria-hidden', 'true');\n textarea.value = text;\n this._document.body.appendChild(textarea);\n }\n /** Finishes copying the text. */\n PendingCopy.prototype.copy = function () {\n var textarea = this._textarea;\n var successful = false;\n try { // Older browsers could throw if copy is not supported.\n if (textarea) {\n var currentFocus = this._document.activeElement;\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n if (currentFocus) {\n currentFocus.focus();\n }\n }\n }\n catch (_a) {\n // Discard error.\n // Initial setting of {@code successful} will represent failure here.\n }\n return successful;\n };\n /** Cleans up DOM changes used to perform the copy operation. */\n PendingCopy.prototype.destroy = function () {\n var textarea = this._textarea;\n if (textarea) {\n if (textarea.parentNode) {\n textarea.parentNode.removeChild(textarea);\n }\n this._textarea = undefined;\n }\n };\n return PendingCopy;\n }());\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * A service for copying text to the clipboard.\n */\n var Clipboard = /** @class */ (function () {\n function Clipboard(document) {\n this._document = document;\n }\n /**\n * Copies the provided text into the user's clipboard.\n *\n * @param text The string to copy.\n * @returns Whether the operation was successful.\n */\n Clipboard.prototype.copy = function (text) {\n var pendingCopy = this.beginCopy(text);\n var successful = pendingCopy.copy();\n pendingCopy.destroy();\n return successful;\n };\n /**\n * Prepares a string to be copied later. This is useful for large strings\n * which take too long to successfully render and be copied in the same tick.\n *\n * The caller must call `destroy` on the returned `PendingCopy`.\n *\n * @param text The string to copy.\n * @returns the pending copy operation.\n */\n Clipboard.prototype.beginCopy = function (text) {\n return new PendingCopy(text, this._document);\n };\n return Clipboard;\n }());\n Clipboard.ɵprov = i0.ɵɵdefineInjectable({ factory: function Clipboard_Factory() { return new Clipboard(i0.ɵɵinject(i1.DOCUMENT)); }, token: Clipboard, providedIn: \"root\" });\n Clipboard.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n Clipboard.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }\n ]; };\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */\n var CKD_COPY_TO_CLIPBOARD_CONFIG = new i0.InjectionToken('CKD_COPY_TO_CLIPBOARD_CONFIG');\n /**\n * Provides behavior for a button that when clicked copies content into user's\n * clipboard.\n */\n var CdkCopyToClipboard = /** @class */ (function () {\n function CdkCopyToClipboard(_clipboard, _ngZone, config) {\n this._clipboard = _clipboard;\n this._ngZone = _ngZone;\n /** Content to be copied. */\n this.text = '';\n /**\n * How many times to attempt to copy the text. This may be necessary for longer text, because\n * the browser needs time to fill an intermediate textarea element and copy the content.\n */\n this.attempts = 1;\n /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n */\n this.copied = new i0.EventEmitter();\n /** Copies that are currently being attempted. */\n this._pending = new Set();\n if (config && config.attempts != null) {\n this.attempts = config.attempts;\n }\n }\n /** Copies the current text to the clipboard. */\n CdkCopyToClipboard.prototype.copy = function (attempts) {\n var _this = this;\n if (attempts === void 0) { attempts = this.attempts; }\n if (attempts > 1) {\n var remainingAttempts_1 = attempts;\n var pending_1 = this._clipboard.beginCopy(this.text);\n this._pending.add(pending_1);\n var attempt_1 = function () {\n var successful = pending_1.copy();\n if (!successful && --remainingAttempts_1 && !_this._destroyed) {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n _this._currentTimeout = _this._ngZone.runOutsideAngular(function () { return setTimeout(attempt_1, 1); });\n }\n else {\n _this._currentTimeout = null;\n _this._pending.delete(pending_1);\n pending_1.destroy();\n _this.copied.emit(successful);\n }\n };\n attempt_1();\n }\n else {\n this.copied.emit(this._clipboard.copy(this.text));\n }\n };\n CdkCopyToClipboard.prototype.ngOnDestroy = function () {\n if (this._currentTimeout) {\n clearTimeout(this._currentTimeout);\n }\n this._pending.forEach(function (copy) { return copy.destroy(); });\n this._pending.clear();\n this._destroyed = true;\n };\n return CdkCopyToClipboard;\n }());\n CdkCopyToClipboard.decorators = [\n { type: i0.Directive, args: [{\n selector: '[cdkCopyToClipboard]',\n host: {\n '(click)': 'copy()',\n }\n },] }\n ];\n CdkCopyToClipboard.ctorParameters = function () { return [\n { type: Clipboard },\n { type: i0.NgZone },\n { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [CKD_COPY_TO_CLIPBOARD_CONFIG,] }] }\n ]; };\n CdkCopyToClipboard.propDecorators = {\n text: [{ type: i0.Input, args: ['cdkCopyToClipboard',] }],\n attempts: [{ type: i0.Input, args: ['cdkCopyToClipboardAttempts',] }],\n copied: [{ type: i0.Output, args: ['cdkCopyToClipboardCopied',] }]\n };\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n var ClipboardModule = /** @class */ (function () {\n function ClipboardModule() {\n }\n return ClipboardModule;\n }());\n ClipboardModule.decorators = [\n { type: i0.NgModule, args: [{\n declarations: [CdkCopyToClipboard],\n exports: [CdkCopyToClipboard],\n },] }\n ];\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.CKD_COPY_TO_CLIPBOARD_CONFIG = CKD_COPY_TO_CLIPBOARD_CONFIG;\n exports.CdkCopyToClipboard = CdkCopyToClipboard;\n exports.Clipboard = Clipboard;\n exports.ClipboardModule = ClipboardModule;\n exports.PendingCopy = PendingCopy;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-clipboard.umd.js.map\n"]}
|
|
1
|
+
{"version":3,"sources":["src/cdk/cdk-clipboard.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","clipboard","common","core","this","i1","i0","PendingCopy","text","_document","textarea","_textarea","createElement","styles","style","position","top","opacity","left","setAttribute","value","body","appendChild","prototype","copy","successful","currentFocus","activeElement","select","setSelectionRange","length","execCommand","focus","_a","destroy","parentNode","removeChild","undefined","Clipboard","document","pendingCopy","beginCopy","ɵprov","ɵɵdefineInjectable","Clipboard_Factory","ɵɵinject","DOCUMENT","token","providedIn","decorators","type","Injectable","args","ctorParameters","Inject","ClipboardModule","CDK_COPY_TO_CLIPBOARD_CONFIG","InjectionToken","CKD_COPY_TO_CLIPBOARD_CONFIG","CdkCopyToClipboard","_clipboard","_ngZone","config","attempts","copied","EventEmitter","_pending","Set","_this","remainingAttempts_1","pending_1","add","attempt_1","_destroyed","_currentTimeout","delete","emit","runOutsideAngular","setTimeout","ngOnDestroy","clearTimeout","forEach","clear","Directive","selector","host","(click)","NgZone","Optional","propDecorators","Input","Output","NgModule","declarations","Object","defineProperty"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,mBAAoBA,QAAQ,kBAClG,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,yBAA0B,CAAC,UAAW,kBAAmB,iBAAkBJ,GACrGA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC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YAAc,WACnC3E,KAAKsE,iBACLM,aAAa5E,KAAKsE,iBAEtBtE,KAAK8D,SAASe,SAAQ,SAAUzD,GAAQ,OAAOA,EAAKU,aACpD9B,KAAK8D,SAASgB,QACd9E,KAAKqE,YAAa,GAEfd,EAzD4B,GA2DvCA,EAAmBV,WAAa,CAC5B,CAAEC,KAAM5C,EAAG6E,UAAW/B,KAAM,CAAC,CACjBgC,SAAU,uBACVC,KAAM,CACFC,UAAW,cAI/B3B,EAAmBN,eAAiB,WAAc,MAAO,CACrD,CAAEH,KAAMZ,GACR,CAAEY,KAAM5C,EAAGiF,QACX,CAAErC,UAAMb,EAAWY,WAAY,CAAC,CAAEC,KAAM5C,EAAGkF,UAAY,CAAEtC,KAAM5C,EAAGgD,OAAQF,KAAM,CAACM,QAErFC,EAAmB8B,eAAiB,CAChCjF,KAAM,CAAC,CAAE0C,KAAM5C,EAAGoF,MAAOtC,KAAM,CAAC,wBAChCW,SAAU,CAAC,CAAEb,KAAM5C,EAAGoF,MAAOtC,KAAM,CAAC,gCACpCY,OAAQ,CAAC,CAAEd,KAAM5C,EAAGqF,OAAQvC,KAAM,CAAC,gCAUnCG,EACA,SAASA,OAIGN,WAAa,CACzB,CAAEC,KAAM5C,EAAGsF,SAAUxC,KAAM,CAAC,CAChByC,aAAc,CAAClC,GACflE,QAAS,CAACkE;;;;;;;;AAgB1BlE,EAAQ+D,6BAA+BA,EACvC/D,EAAQiE,6BAA+BA,EACvCjE,EAAQkE,mBAAqBA,EAC7BlE,EAAQ6C,UAAYA,EACpB7C,EAAQ8D,gBAAkBA,EAC1B9D,EAAQc,YAAcA,EAEtBuF,OAAOC,eAAetG,EAAS,aAAc,CAAE2B,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/clipboard', ['exports', '@angular/common', '@angular/core'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.clipboard = {}), global.ng.common, global.ng.core));\n}(this, (function (exports, i1, i0) { 'use strict';\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * A pending copy-to-clipboard operation.\n *\n * The implementation of copying text to the clipboard modifies the DOM and\n * forces a relayout. This relayout can take too long if the string is large,\n * causing the execCommand('copy') to happen too long after the user clicked.\n * This results in the browser refusing to copy. This object lets the\n * relayout happen in a separate tick from copying by providing a copy function\n * that can be called later.\n *\n * Destroy must be called when no longer in use, regardless of whether `copy` is\n * called.\n */\n var PendingCopy = /** @class */ (function () {\n function PendingCopy(text, _document) {\n this._document = _document;\n var textarea = this._textarea = this._document.createElement('textarea');\n var styles = textarea.style;\n // Hide the element for display and accessibility. Set a fixed position so the page layout\n // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea\n // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.\n styles.position = 'fixed';\n styles.top = styles.opacity = '0';\n styles.left = '-999em';\n textarea.setAttribute('aria-hidden', 'true');\n textarea.value = text;\n this._document.body.appendChild(textarea);\n }\n /** Finishes copying the text. */\n PendingCopy.prototype.copy = function () {\n var textarea = this._textarea;\n var successful = false;\n try { // Older browsers could throw if copy is not supported.\n if (textarea) {\n var currentFocus = this._document.activeElement;\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n if (currentFocus) {\n currentFocus.focus();\n }\n }\n }\n catch (_a) {\n // Discard error.\n // Initial setting of {@code successful} will represent failure here.\n }\n return successful;\n };\n /** Cleans up DOM changes used to perform the copy operation. */\n PendingCopy.prototype.destroy = function () {\n var textarea = this._textarea;\n if (textarea) {\n if (textarea.parentNode) {\n textarea.parentNode.removeChild(textarea);\n }\n this._textarea = undefined;\n }\n };\n return PendingCopy;\n }());\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * A service for copying text to the clipboard.\n */\n var Clipboard = /** @class */ (function () {\n function Clipboard(document) {\n this._document = document;\n }\n /**\n * Copies the provided text into the user's clipboard.\n *\n * @param text The string to copy.\n * @returns Whether the operation was successful.\n */\n Clipboard.prototype.copy = function (text) {\n var pendingCopy = this.beginCopy(text);\n var successful = pendingCopy.copy();\n pendingCopy.destroy();\n return successful;\n };\n /**\n * Prepares a string to be copied later. This is useful for large strings\n * which take too long to successfully render and be copied in the same tick.\n *\n * The caller must call `destroy` on the returned `PendingCopy`.\n *\n * @param text The string to copy.\n * @returns the pending copy operation.\n */\n Clipboard.prototype.beginCopy = function (text) {\n return new PendingCopy(text, this._document);\n };\n return Clipboard;\n }());\n Clipboard.ɵprov = i0.ɵɵdefineInjectable({ factory: function Clipboard_Factory() { return new Clipboard(i0.ɵɵinject(i1.DOCUMENT)); }, token: Clipboard, providedIn: \"root\" });\n Clipboard.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n Clipboard.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }\n ]; };\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */\n var CDK_COPY_TO_CLIPBOARD_CONFIG = new i0.InjectionToken('CDK_COPY_TO_CLIPBOARD_CONFIG');\n /**\n * @deprecated Use `CDK_COPY_TO_CLIPBOARD_CONFIG` instead.\n * @breaking-change 13.0.0\n */\n var CKD_COPY_TO_CLIPBOARD_CONFIG = CDK_COPY_TO_CLIPBOARD_CONFIG;\n /**\n * Provides behavior for a button that when clicked copies content into user's\n * clipboard.\n */\n var CdkCopyToClipboard = /** @class */ (function () {\n function CdkCopyToClipboard(_clipboard, _ngZone, config) {\n this._clipboard = _clipboard;\n this._ngZone = _ngZone;\n /** Content to be copied. */\n this.text = '';\n /**\n * How many times to attempt to copy the text. This may be necessary for longer text, because\n * the browser needs time to fill an intermediate textarea element and copy the content.\n */\n this.attempts = 1;\n /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n */\n this.copied = new i0.EventEmitter();\n /** Copies that are currently being attempted. */\n this._pending = new Set();\n if (config && config.attempts != null) {\n this.attempts = config.attempts;\n }\n }\n /** Copies the current text to the clipboard. */\n CdkCopyToClipboard.prototype.copy = function (attempts) {\n var _this = this;\n if (attempts === void 0) { attempts = this.attempts; }\n if (attempts > 1) {\n var remainingAttempts_1 = attempts;\n var pending_1 = this._clipboard.beginCopy(this.text);\n this._pending.add(pending_1);\n var attempt_1 = function () {\n var successful = pending_1.copy();\n if (!successful && --remainingAttempts_1 && !_this._destroyed) {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n _this._currentTimeout = _this._ngZone.runOutsideAngular(function () { return setTimeout(attempt_1, 1); });\n }\n else {\n _this._currentTimeout = null;\n _this._pending.delete(pending_1);\n pending_1.destroy();\n _this.copied.emit(successful);\n }\n };\n attempt_1();\n }\n else {\n this.copied.emit(this._clipboard.copy(this.text));\n }\n };\n CdkCopyToClipboard.prototype.ngOnDestroy = function () {\n if (this._currentTimeout) {\n clearTimeout(this._currentTimeout);\n }\n this._pending.forEach(function (copy) { return copy.destroy(); });\n this._pending.clear();\n this._destroyed = true;\n };\n return CdkCopyToClipboard;\n }());\n CdkCopyToClipboard.decorators = [\n { type: i0.Directive, args: [{\n selector: '[cdkCopyToClipboard]',\n host: {\n '(click)': 'copy()',\n }\n },] }\n ];\n CdkCopyToClipboard.ctorParameters = function () { return [\n { type: Clipboard },\n { type: i0.NgZone },\n { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [CKD_COPY_TO_CLIPBOARD_CONFIG,] }] }\n ]; };\n CdkCopyToClipboard.propDecorators = {\n text: [{ type: i0.Input, args: ['cdkCopyToClipboard',] }],\n attempts: [{ type: i0.Input, args: ['cdkCopyToClipboardAttempts',] }],\n copied: [{ type: i0.Output, args: ['cdkCopyToClipboardCopied',] }]\n };\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n var ClipboardModule = /** @class */ (function () {\n function ClipboardModule() {\n }\n return ClipboardModule;\n }());\n ClipboardModule.decorators = [\n { type: i0.NgModule, args: [{\n declarations: [CdkCopyToClipboard],\n exports: [CdkCopyToClipboard],\n },] }\n ];\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.CDK_COPY_TO_CLIPBOARD_CONFIG = CDK_COPY_TO_CLIPBOARD_CONFIG;\n exports.CKD_COPY_TO_CLIPBOARD_CONFIG = CKD_COPY_TO_CLIPBOARD_CONFIG;\n exports.CdkCopyToClipboard = CdkCopyToClipboard;\n exports.Clipboard = Clipboard;\n exports.ClipboardModule = ClipboardModule;\n exports.PendingCopy = PendingCopy;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-clipboard.umd.js.map\n"]}
|
package/bundles/cdk.umd.js
CHANGED
package/bundles/cdk.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk.umd.js","sources":["../../../../../src/cdk/version.ts","../../../../../src/cdk/public-api.ts","../../../../../src/cdk/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('11.2.
|
|
1
|
+
{"version":3,"file":"cdk.umd.js","sources":["../../../../../src/cdk/version.ts","../../../../../src/cdk/public-api.ts","../../../../../src/cdk/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('11.2.2');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './version';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":["Version"],"mappings":";;;;;;CAAA;;;;;;;AAQA,CAEA;AACA,KAAa,OAAO,GAAG,IAAIA,YAAO,CAAC,mBAAmB,CAAC;;CCXvD;;;;;;IAMG;;CCNH;;;;;;IAMG;;;;;;;;;;;;"}
|
package/bundles/cdk.umd.min.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/var o=new n.Version("11.2.
|
|
8
|
+
*/var o=new n.Version("11.2.2");
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/cdk/cdk.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","core","this","VERSION","Version","Object","defineProperty","value"],"mappings":"CAAC,SAAUA,EAAQC,GACC,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,kBACtE,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,eAAgB,CAAC,UAAW,iBAAkBJ,GACxEA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAM,IAAKT,EAAOQ,GAAGE,MAHhG,CAIEC,MAAM,SAAWT,EAASQ,GAAQ;;;;;;;IAUnC,IAAIE,EAAU,IAAIF,EAAKG,QAAQ;;;;;;;;;;;;;;IAkB/BX,EAAQU,QAAUA,EAElBE,OAAOC,eAAeb,EAAS,aAAc,CAAEc,OAAO","sourcesContent":["(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :\n\ttypeof define === 'function' && define.amd ? define('@angular/cdk', ['exports', '@angular/core'], factory) :\n\t(global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = {}), global.ng.core));\n}(this, (function (exports, core) { 'use strict';\n\n\t/**\n\t * @license\n\t * Copyright Google LLC All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t/** Current version of the Angular Component Development Kit. */\n\tvar VERSION = new core.Version('11.2.
|
|
1
|
+
{"version":3,"sources":["src/cdk/cdk.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","core","this","VERSION","Version","Object","defineProperty","value"],"mappings":"CAAC,SAAUA,EAAQC,GACC,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,kBACtE,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,eAAgB,CAAC,UAAW,iBAAkBJ,GACxEA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAM,IAAKT,EAAOQ,GAAGE,MAHhG,CAIEC,MAAM,SAAWT,EAASQ,GAAQ;;;;;;;IAUnC,IAAIE,EAAU,IAAIF,EAAKG,QAAQ;;;;;;;;;;;;;;IAkB/BX,EAAQU,QAAUA,EAElBE,OAAOC,eAAeb,EAAS,aAAc,CAAEc,OAAO","sourcesContent":["(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :\n\ttypeof define === 'function' && define.amd ? define('@angular/cdk', ['exports', '@angular/core'], factory) :\n\t(global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = {}), global.ng.core));\n}(this, (function (exports, core) { 'use strict';\n\n\t/**\n\t * @license\n\t * Copyright Google LLC All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t/** Current version of the Angular Component Development Kit. */\n\tvar VERSION = new core.Version('11.2.2');\n\n\t/**\n\t * @license\n\t * Copyright Google LLC All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\n\t/**\n\t * @license\n\t * Copyright Google LLC All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\n\texports.VERSION = VERSION;\n\n\tObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk.umd.js.map\n"]}
|
|
@@ -13,6 +13,11 @@ export interface CdkCopyToClipboardConfig {
|
|
|
13
13
|
attempts?: number;
|
|
14
14
|
}
|
|
15
15
|
/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */
|
|
16
|
+
export declare const CDK_COPY_TO_CLIPBOARD_CONFIG: InjectionToken<CdkCopyToClipboardConfig>;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `CDK_COPY_TO_CLIPBOARD_CONFIG` instead.
|
|
19
|
+
* @breaking-change 13.0.0
|
|
20
|
+
*/
|
|
16
21
|
export declare const CKD_COPY_TO_CLIPBOARD_CONFIG: InjectionToken<CdkCopyToClipboardConfig>;
|
|
17
22
|
/**
|
|
18
23
|
* Provides behavior for a button that when clicked copies content into user's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"Clipboard":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":20,"character":15},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":20,"character":22}]}]],"parameters":[{"__symbolic":"reference","name":"any"}]}],"copy":[{"__symbolic":"method"}],"beginCopy":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"ClipboardModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":12,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"CdkCopyToClipboard"}],"exports":[{"__symbolic":"reference","name":"CdkCopyToClipboard"}]}]}],"members":{}},"CdkCopyToClipboardConfig":{"__symbolic":"interface"},"
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"Clipboard":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":20,"character":15},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":20,"character":22}]}]],"parameters":[{"__symbolic":"reference","name":"any"}]}],"copy":[{"__symbolic":"method"}],"beginCopy":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"ClipboardModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":12,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"CdkCopyToClipboard"}],"exports":[{"__symbolic":"reference","name":"CdkCopyToClipboard"}]}]}],"members":{}},"CdkCopyToClipboardConfig":{"__symbolic":"interface"},"CDK_COPY_TO_CLIPBOARD_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":30,"character":8},"arguments":["CDK_COPY_TO_CLIPBOARD_CONFIG"]},"CKD_COPY_TO_CLIPBOARD_CONFIG":{"__symbolic":"reference","name":"CDK_COPY_TO_CLIPBOARD_CONFIG"},"CdkCopyToClipboard":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":42,"character":1},"arguments":[{"selector":"[cdkCopyToClipboard]","host":{"(click)":"copy()","$quoted$":["(click)"]}}]}],"members":{"text":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":3},"arguments":["cdkCopyToClipboard"]}]}],"attempts":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":56,"character":3},"arguments":["cdkCopyToClipboardAttempts"]}]}],"copied":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":62,"character":3},"arguments":["cdkCopyToClipboardCopied"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":76,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":76,"character":17},"arguments":[{"__symbolic":"reference","name":"CKD_COPY_TO_CLIPBOARD_CONFIG"}]}]],"parameters":[{"__symbolic":"reference","name":"Clipboard"},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":75,"character":21},{"__symbolic":"reference","name":"any"}]}],"copy":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"PendingCopy":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":24,"character":56,"context":{"typeName":"Document"},"module":"./pending-copy"}]}],"copy":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}]}}},"origins":{"Clipboard":"./clipboard","ClipboardModule":"./clipboard-module","CdkCopyToClipboardConfig":"./copy-to-clipboard","CDK_COPY_TO_CLIPBOARD_CONFIG":"./copy-to-clipboard","CKD_COPY_TO_CLIPBOARD_CONFIG":"./copy-to-clipboard","CdkCopyToClipboard":"./copy-to-clipboard","PendingCopy":"./pending-copy"},"importAs":"@angular/cdk/clipboard"}
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
import { Directive, EventEmitter, Input, Output, NgZone, InjectionToken, Inject, Optional, } from '@angular/core';
|
|
9
9
|
import { Clipboard } from './clipboard';
|
|
10
10
|
/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */
|
|
11
|
-
export const
|
|
11
|
+
export const CDK_COPY_TO_CLIPBOARD_CONFIG = new InjectionToken('CDK_COPY_TO_CLIPBOARD_CONFIG');
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `CDK_COPY_TO_CLIPBOARD_CONFIG` instead.
|
|
14
|
+
* @breaking-change 13.0.0
|
|
15
|
+
*/
|
|
16
|
+
export const CKD_COPY_TO_CLIPBOARD_CONFIG = CDK_COPY_TO_CLIPBOARD_CONFIG;
|
|
12
17
|
/**
|
|
13
18
|
* Provides behavior for a button that when clicked copies content into user's
|
|
14
19
|
* clipboard.
|
|
@@ -87,4 +92,4 @@ CdkCopyToClipboard.propDecorators = {
|
|
|
87
92
|
attempts: [{ type: Input, args: ['cdkCopyToClipboardAttempts',] }],
|
|
88
93
|
copied: [{ type: Output, args: ['cdkCopyToClipboardCopied',] }]
|
|
89
94
|
};
|
|
90
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
95
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29weS10by1jbGlwYm9hcmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi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xuICAgIH1cblxuICAgIHRoaXMuX3BlbmRpbmcuZm9yRWFjaChjb3B5ID0+IGNvcHkuZGVzdHJveSgpKTtcbiAgICB0aGlzLl9wZW5kaW5nLmNsZWFyKCk7XG4gICAgdGhpcy5fZGVzdHJveWVkID0gdHJ1ZTtcbiAgfVxufVxuIl19
|
package/esm2015/version.js
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Version } from '@angular/core';
|
|
9
9
|
/** Current version of the Angular Component Development Kit. */
|
|
10
|
-
export const VERSION = new Version('11.2.
|
|
10
|
+
export const VERSION = new Version('11.2.2');
|
|
11
11
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jZGsvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRXRDLGdFQUFnRTtBQUNoRSxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsSUFBSSxPQUFPLENBQUMsbUJBQW1CLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgTExDIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4gKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiAqL1xuXG5pbXBvcnQge1ZlcnNpb259IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG4vKiogQ3VycmVudCB2ZXJzaW9uIG9mIHRoZSBBbmd1bGFyIENvbXBvbmVudCBEZXZlbG9wbWVudCBLaXQuICovXG5leHBvcnQgY29uc3QgVkVSU0lPTiA9IG5ldyBWZXJzaW9uKCcwLjAuMC1QTEFDRUhPTERFUicpO1xuIl19
|
package/fesm2015/cdk.js
CHANGED
|
@@ -8,7 +8,7 @@ import { Version } from '@angular/core';
|
|
|
8
8
|
* found in the LICENSE file at https://angular.io/license
|
|
9
9
|
*/
|
|
10
10
|
/** Current version of the Angular Component Development Kit. */
|
|
11
|
-
const VERSION = new Version('11.2.
|
|
11
|
+
const VERSION = new Version('11.2.2');
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
package/fesm2015/cdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk.js","sources":["../../../../../../src/cdk/version.ts","../../../../../../src/cdk/public-api.ts","../../../../../../src/cdk/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('11.2.
|
|
1
|
+
{"version":3,"file":"cdk.js","sources":["../../../../../../src/cdk/version.ts","../../../../../../src/cdk/public-api.ts","../../../../../../src/cdk/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('11.2.2');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './version';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;AAQA,AAEA;AACA,MAAa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC;;ACXvD;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
|
package/fesm2015/clipboard.js
CHANGED
|
@@ -124,7 +124,12 @@ Clipboard.ctorParameters = () => [
|
|
|
124
124
|
* found in the LICENSE file at https://angular.io/license
|
|
125
125
|
*/
|
|
126
126
|
/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */
|
|
127
|
-
const
|
|
127
|
+
const CDK_COPY_TO_CLIPBOARD_CONFIG = new InjectionToken('CDK_COPY_TO_CLIPBOARD_CONFIG');
|
|
128
|
+
/**
|
|
129
|
+
* @deprecated Use `CDK_COPY_TO_CLIPBOARD_CONFIG` instead.
|
|
130
|
+
* @breaking-change 13.0.0
|
|
131
|
+
*/
|
|
132
|
+
const CKD_COPY_TO_CLIPBOARD_CONFIG = CDK_COPY_TO_CLIPBOARD_CONFIG;
|
|
128
133
|
/**
|
|
129
134
|
* Provides behavior for a button that when clicked copies content into user's
|
|
130
135
|
* clipboard.
|
|
@@ -232,5 +237,5 @@ ClipboardModule.decorators = [
|
|
|
232
237
|
* Generated bundle index. Do not edit.
|
|
233
238
|
*/
|
|
234
239
|
|
|
235
|
-
export { CKD_COPY_TO_CLIPBOARD_CONFIG, CdkCopyToClipboard, Clipboard, ClipboardModule, PendingCopy };
|
|
240
|
+
export { CDK_COPY_TO_CLIPBOARD_CONFIG, CKD_COPY_TO_CLIPBOARD_CONFIG, CdkCopyToClipboard, Clipboard, ClipboardModule, PendingCopy };
|
|
236
241
|
//# sourceMappingURL=clipboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.js","sources":["../../../../../../src/cdk/clipboard/pending-copy.ts","../../../../../../src/cdk/clipboard/clipboard.ts","../../../../../../src/cdk/clipboard/copy-to-clipboard.ts","../../../../../../src/cdk/clipboard/clipboard-module.ts","../../../../../../src/cdk/clipboard/public-api.ts","../../../../../../src/cdk/clipboard/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A pending copy-to-clipboard operation.\n *\n * The implementation of copying text to the clipboard modifies the DOM and\n * forces a relayout. This relayout can take too long if the string is large,\n * causing the execCommand('copy') to happen too long after the user clicked.\n * This results in the browser refusing to copy. This object lets the\n * relayout happen in a separate tick from copying by providing a copy function\n * that can be called later.\n *\n * Destroy must be called when no longer in use, regardless of whether `copy` is\n * called.\n */\nexport class PendingCopy {\n private _textarea: HTMLTextAreaElement|undefined;\n\n constructor(text: string, private readonly _document: Document) {\n const textarea = this._textarea = this._document.createElement('textarea');\n const styles = textarea.style;\n\n // Hide the element for display and accessibility. Set a fixed position so the page layout\n // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea\n // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.\n styles.position = 'fixed';\n styles.top = styles.opacity = '0';\n styles.left = '-999em';\n textarea.setAttribute('aria-hidden', 'true');\n textarea.value = text;\n this._document.body.appendChild(textarea);\n }\n\n /** Finishes copying the text. */\n copy(): boolean {\n const textarea = this._textarea;\n let successful = false;\n\n try { // Older browsers could throw if copy is not supported.\n if (textarea) {\n const currentFocus = this._document.activeElement as HTMLOrSVGElement | null;\n\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n\n if (currentFocus) {\n currentFocus.focus();\n }\n }\n } catch {\n // Discard error.\n // Initial setting of {@code successful} will represent failure here.\n }\n\n return successful;\n }\n\n /** Cleans up DOM changes used to perform the copy operation. */\n destroy() {\n const textarea = this._textarea;\n\n if (textarea) {\n if (textarea.parentNode) {\n textarea.parentNode.removeChild(textarea);\n }\n\n this._textarea = undefined;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {PendingCopy} from './pending-copy';\n\n\n/**\n * A service for copying text to the clipboard.\n */\n@Injectable({providedIn: 'root'})\nexport class Clipboard {\n private readonly _document: Document;\n\n constructor(@Inject(DOCUMENT) document: any) {\n this._document = document;\n }\n\n /**\n * Copies the provided text into the user's clipboard.\n *\n * @param text The string to copy.\n * @returns Whether the operation was successful.\n */\n copy(text: string): boolean {\n const pendingCopy = this.beginCopy(text);\n const successful = pendingCopy.copy();\n pendingCopy.destroy();\n\n return successful;\n }\n\n /**\n * Prepares a string to be copied later. This is useful for large strings\n * which take too long to successfully render and be copied in the same tick.\n *\n * The caller must call `destroy` on the returned `PendingCopy`.\n *\n * @param text The string to copy.\n * @returns the pending copy operation.\n */\n beginCopy(text: string): PendingCopy {\n return new PendingCopy(text, this._document);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n EventEmitter,\n Input,\n Output,\n NgZone,\n InjectionToken,\n Inject,\n Optional,\n OnDestroy,\n} from '@angular/core';\nimport {Clipboard} from './clipboard';\nimport {PendingCopy} from './pending-copy';\n\n/** Object that can be used to configure the default options for `CdkCopyToClipboard`. */\nexport interface CdkCopyToClipboardConfig {\n /** Default number of attempts to make when copying text to the clipboard. */\n attempts?: number;\n}\n\n/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */\nexport const CKD_COPY_TO_CLIPBOARD_CONFIG =\n new InjectionToken<CdkCopyToClipboardConfig>('CKD_COPY_TO_CLIPBOARD_CONFIG');\n\n/**\n * Provides behavior for a button that when clicked copies content into user's\n * clipboard.\n */\n@Directive({\n selector: '[cdkCopyToClipboard]',\n host: {\n '(click)': 'copy()',\n }\n})\nexport class CdkCopyToClipboard implements OnDestroy {\n /** Content to be copied. */\n @Input('cdkCopyToClipboard') text: string = '';\n\n /**\n * How many times to attempt to copy the text. This may be necessary for longer text, because\n * the browser needs time to fill an intermediate textarea element and copy the content.\n */\n @Input('cdkCopyToClipboardAttempts') attempts: number = 1;\n\n /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n */\n @Output('cdkCopyToClipboardCopied') copied = new EventEmitter<boolean>();\n\n /** Copies that are currently being attempted. */\n private _pending = new Set<PendingCopy>();\n\n /** Whether the directive has been destroyed. */\n private _destroyed: boolean;\n\n /** Timeout for the current copy attempt. */\n private _currentTimeout: any;\n\n constructor(\n private _clipboard: Clipboard,\n private _ngZone: NgZone,\n @Optional() @Inject(CKD_COPY_TO_CLIPBOARD_CONFIG) config?: CdkCopyToClipboardConfig) {\n\n if (config && config.attempts != null) {\n this.attempts = config.attempts;\n }\n }\n\n /** Copies the current text to the clipboard. */\n copy(attempts: number = this.attempts): void {\n if (attempts > 1) {\n let remainingAttempts = attempts;\n const pending = this._clipboard.beginCopy(this.text);\n this._pending.add(pending);\n\n const attempt = () => {\n const successful = pending.copy();\n if (!successful && --remainingAttempts && !this._destroyed) {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));\n } else {\n this._currentTimeout = null;\n this._pending.delete(pending);\n pending.destroy();\n this.copied.emit(successful);\n }\n };\n attempt();\n } else {\n this.copied.emit(this._clipboard.copy(this.text));\n }\n }\n\n ngOnDestroy() {\n if (this._currentTimeout) {\n clearTimeout(this._currentTimeout);\n }\n\n this._pending.forEach(copy => copy.destroy());\n this._pending.clear();\n this._destroyed = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\n\nimport {CdkCopyToClipboard} from './copy-to-clipboard';\n\n@NgModule({\n declarations: [CdkCopyToClipboard],\n exports: [CdkCopyToClipboard],\n})\nexport class ClipboardModule {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './clipboard';\nexport * from './clipboard-module';\nexport * from './copy-to-clipboard';\nexport * from './pending-copy';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,WAAW;IAGtB,YAAY,IAAY,EAAmB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;;;;QAK9B,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC1B,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;QAClC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;QACvB,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC7C,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;KAC3C;;IAGD,IAAI;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,UAAU,GAAG,KAAK,CAAC;QAEvB,IAAI;YACF,IAAI,QAAQ,EAAE;gBACZ,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,aAAwC,CAAC;gBAE7E,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAClB,QAAQ,CAAC,iBAAiB,CAAC,CAA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AC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SACnD;KACF;IAED,WAAW;QACT,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;SACpC;QAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;KACxB;;;YA1EF,SAAS,SAAC;gBACT,QAAQ,EAAE,sBAAsB;gBAChC,IAAI,EAAE;oBACJ,SAAS,EAAE,QAAQ;iBACpB;aACF;;;YAtBO,SAAS;YANf,MAAM;4CAyDH,QAAQ,YAAI,MAAM,SAAC,4BAA4B;;;mBA1BjD,KAAK,SAAC,oBAAoB;uBAM1B,KAAK,SAAC,4BAA4B;qBAMlC,MAAM,SAAC,0BAA0B;;;ACxDpC;;;;;;;AAQA,MAQa,eAAe;;;YAJ3B,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;gBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;aAC9B;;;ACfD;;;;;;GAMG;;ACNH;;GAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"clipboard.js","sources":["../../../../../../src/cdk/clipboard/pending-copy.ts","../../../../../../src/cdk/clipboard/clipboard.ts","../../../../../../src/cdk/clipboard/copy-to-clipboard.ts","../../../../../../src/cdk/clipboard/clipboard-module.ts","../../../../../../src/cdk/clipboard/public-api.ts","../../../../../../src/cdk/clipboard/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A pending copy-to-clipboard operation.\n *\n * The implementation of copying text to the clipboard modifies the DOM and\n * forces a relayout. This relayout can take too long if the string is large,\n * causing the execCommand('copy') to happen too long after the user clicked.\n * This results in the browser refusing to copy. This object lets the\n * relayout happen in a separate tick from copying by providing a copy function\n * that can be called later.\n *\n * Destroy must be called when no longer in use, regardless of whether `copy` is\n * called.\n */\nexport class PendingCopy {\n private _textarea: HTMLTextAreaElement|undefined;\n\n constructor(text: string, private readonly _document: Document) {\n const textarea = this._textarea = this._document.createElement('textarea');\n const styles = textarea.style;\n\n // Hide the element for display and accessibility. Set a fixed position so the page layout\n // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea\n // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.\n styles.position = 'fixed';\n styles.top = styles.opacity = '0';\n styles.left = '-999em';\n textarea.setAttribute('aria-hidden', 'true');\n textarea.value = text;\n this._document.body.appendChild(textarea);\n }\n\n /** Finishes copying the text. */\n copy(): boolean {\n const textarea = this._textarea;\n let successful = false;\n\n try { // Older browsers could throw if copy is not supported.\n if (textarea) {\n const currentFocus = this._document.activeElement as HTMLOrSVGElement | null;\n\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n\n if (currentFocus) {\n currentFocus.focus();\n }\n }\n } catch {\n // Discard error.\n // Initial setting of {@code successful} will represent failure here.\n }\n\n return successful;\n }\n\n /** Cleans up DOM changes used to perform the copy operation. */\n destroy() {\n const textarea = this._textarea;\n\n if (textarea) {\n if (textarea.parentNode) {\n textarea.parentNode.removeChild(textarea);\n }\n\n this._textarea = undefined;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {PendingCopy} from './pending-copy';\n\n\n/**\n * A service for copying text to the clipboard.\n */\n@Injectable({providedIn: 'root'})\nexport class Clipboard {\n private readonly _document: Document;\n\n constructor(@Inject(DOCUMENT) document: any) {\n this._document = document;\n }\n\n /**\n * Copies the provided text into the user's clipboard.\n *\n * @param text The string to copy.\n * @returns Whether the operation was successful.\n */\n copy(text: string): boolean {\n const pendingCopy = this.beginCopy(text);\n const successful = pendingCopy.copy();\n pendingCopy.destroy();\n\n return successful;\n }\n\n /**\n * Prepares a string to be copied later. This is useful for large strings\n * which take too long to successfully render and be copied in the same tick.\n *\n * The caller must call `destroy` on the returned `PendingCopy`.\n *\n * @param text The string to copy.\n * @returns the pending copy operation.\n */\n beginCopy(text: string): PendingCopy {\n return new PendingCopy(text, this._document);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n EventEmitter,\n Input,\n Output,\n NgZone,\n InjectionToken,\n Inject,\n Optional,\n OnDestroy,\n} from '@angular/core';\nimport {Clipboard} from './clipboard';\nimport {PendingCopy} from './pending-copy';\n\n/** Object that can be used to configure the default options for `CdkCopyToClipboard`. */\nexport interface CdkCopyToClipboardConfig {\n /** Default number of attempts to make when copying text to the clipboard. */\n attempts?: number;\n}\n\n/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */\nexport const CDK_COPY_TO_CLIPBOARD_CONFIG =\n new InjectionToken<CdkCopyToClipboardConfig>('CDK_COPY_TO_CLIPBOARD_CONFIG');\n\n/**\n * @deprecated Use `CDK_COPY_TO_CLIPBOARD_CONFIG` instead.\n * @breaking-change 13.0.0\n */\nexport const CKD_COPY_TO_CLIPBOARD_CONFIG = CDK_COPY_TO_CLIPBOARD_CONFIG;\n\n/**\n * Provides behavior for a button that when clicked copies content into user's\n * clipboard.\n */\n@Directive({\n selector: '[cdkCopyToClipboard]',\n host: {\n '(click)': 'copy()',\n }\n})\nexport class CdkCopyToClipboard implements OnDestroy {\n /** Content to be copied. */\n @Input('cdkCopyToClipboard') text: string = '';\n\n /**\n * How many times to attempt to copy the text. This may be necessary for longer text, because\n * the browser needs time to fill an intermediate textarea element and copy the content.\n */\n @Input('cdkCopyToClipboardAttempts') attempts: number = 1;\n\n /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n */\n @Output('cdkCopyToClipboardCopied') copied = new EventEmitter<boolean>();\n\n /** Copies that are currently being attempted. */\n private _pending = new Set<PendingCopy>();\n\n /** Whether the directive has been destroyed. */\n private _destroyed: boolean;\n\n /** Timeout for the current copy attempt. */\n private _currentTimeout: any;\n\n constructor(\n private _clipboard: Clipboard,\n private _ngZone: NgZone,\n @Optional() @Inject(CKD_COPY_TO_CLIPBOARD_CONFIG) config?: CdkCopyToClipboardConfig) {\n\n if (config && config.attempts != null) {\n this.attempts = config.attempts;\n }\n }\n\n /** Copies the current text to the clipboard. */\n copy(attempts: number = this.attempts): void {\n if (attempts > 1) {\n let remainingAttempts = attempts;\n const pending = this._clipboard.beginCopy(this.text);\n this._pending.add(pending);\n\n const attempt = () => {\n const successful = pending.copy();\n if (!successful && --remainingAttempts && !this._destroyed) {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));\n } else {\n this._currentTimeout = null;\n this._pending.delete(pending);\n pending.destroy();\n this.copied.emit(successful);\n }\n };\n attempt();\n } else {\n this.copied.emit(this._clipboard.copy(this.text));\n }\n }\n\n ngOnDestroy() {\n if (this._currentTimeout) {\n clearTimeout(this._currentTimeout);\n }\n\n this._pending.forEach(copy => copy.destroy());\n this._pending.clear();\n this._destroyed = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\n\nimport {CdkCopyToClipboard} from './copy-to-clipboard';\n\n@NgModule({\n declarations: [CdkCopyToClipboard],\n exports: [CdkCopyToClipboard],\n})\nexport class ClipboardModule {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './clipboard';\nexport * from './clipboard-module';\nexport * from './copy-to-clipboard';\nexport * from './pending-copy';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,WAAW;IAGtB,YAAY,IAAY,EAAmB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;;;;QAK9B,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC1B,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;QAClC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;QACvB,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC7C,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;KAC3C;;IAGD,IAAI;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,UAAU,GAAG,KAAK,CAAC;QAEvB,IAAI;YACF,IAAI,QAAQ,EAAE;gBACZ,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,aAAwC,CAAC;gBAE7E,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAClB,QAAQ,CAAC,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACrD,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAEhD,IAAI,YAAY,EAAE;oBAChB,YAAY,CAAC,KAAK,E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,CAAC,eAAe,CAAC,CAAC;SACpC;QAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;KACxB;;;YA1EF,SAAS,SAAC;gBACT,QAAQ,EAAE,sBAAsB;gBAChC,IAAI,EAAE;oBACJ,SAAS,EAAE,QAAQ;iBACpB;aACF;;;YA5BO,SAAS;YANf,MAAM;4CA+DH,QAAQ,YAAI,MAAM,SAAC,4BAA4B;;;mBA1BjD,KAAK,SAAC,oBAAoB;uBAM1B,KAAK,SAAC,4BAA4B;qBAMlC,MAAM,SAAC,0BAA0B;;;AC9DpC;;;;;;;AAQA,MAQa,eAAe;;;YAJ3B,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;gBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;aAC9B;;;ACfD;;;;;;GAMG;;ACNH;;GAEG;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@forward 'overlay';
|
package/overlay/_overlay.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '../a11y/a11y';
|
|
2
|
+
|
|
1
3
|
// We want overlays to always appear over user content, so set a baseline
|
|
2
4
|
// very high z-index for the overlay container, which is where we create the new
|
|
3
5
|
// stacking context for all overlays.
|
|
@@ -84,7 +86,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
|
|
|
84
86
|
// to making it opaque using `opacity`. Note that we can't use the `cdk-high-contrast`
|
|
85
87
|
// mixin, because we can't normalize the import path to the _a11y.scss both for the
|
|
86
88
|
// source and when this file is distributed. See #10908.
|
|
87
|
-
@
|
|
89
|
+
@include cdk-high-contrast(active, off) {
|
|
88
90
|
opacity: 0.6;
|
|
89
91
|
}
|
|
90
92
|
}
|
package/overlay-prebuilt.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed;z-index:1000}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute;z-index:1000}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;z-index:1000;display:flex;max-width:100%;max-height:100%}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1000;pointer-events:auto;-webkit-tap-highlight-color:transparent;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);opacity:0}.cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:1}
|
|
1
|
+
.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed;z-index:1000}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute;z-index:1000}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;z-index:1000;display:flex;max-width:100%;max-height:100%}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1000;pointer-events:auto;-webkit-tap-highlight-color:transparent;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);opacity:0}.cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:1}.cdk-high-contrast-active .cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:.6}.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}.cdk-overlay-transparent-backdrop,.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing{opacity:0}.cdk-overlay-connected-position-bounding-box{position:absolute;z-index:1000;display:flex;flex-direction:column;min-width:1px;min-height:1px}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ function default_1() {
|
|
|
28
28
|
// In order to align the CDK version with other Angular dependencies that are setup by
|
|
29
29
|
// `@schematics/angular`, we use tilde instead of caret. This is default for Angular
|
|
30
30
|
// dependencies in new CLI projects.
|
|
31
|
-
package_config_1.addPackageToPackageJson(host, '@angular/cdk', `~11.2.1`);
|
|
31
|
+
package_config_1.addPackageToPackageJson(host, '@angular/cdk', `~11.2.1-sha-5b30c4cfc`);
|
|
32
32
|
// Add a task to run the package manager. This is necessary because we updated the
|
|
33
33
|
// workspace "package.json" file and we want lock files to reflect the new version range.
|
|
34
34
|
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@forward 'text-field';
|