@angular/cdk 10.1.1 → 10.2.0

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.
Files changed (223) hide show
  1. package/a11y/index.metadata.json +1 -1
  2. package/a11y/key-manager/list-key-manager.d.ts +4 -3
  3. package/bundles/cdk-a11y.umd.js +440 -384
  4. package/bundles/cdk-a11y.umd.js.map +1 -1
  5. package/bundles/cdk-a11y.umd.min.js +34 -10
  6. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  7. package/bundles/cdk-accordion.umd.js +40 -40
  8. package/bundles/cdk-accordion.umd.js.map +1 -1
  9. package/bundles/cdk-accordion.umd.min.js +10 -2
  10. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  11. package/bundles/cdk-bidi.umd.js +25 -25
  12. package/bundles/cdk-bidi.umd.js.map +1 -1
  13. package/bundles/cdk-bidi.umd.min.js +5 -4
  14. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  15. package/bundles/cdk-clipboard.umd.js +37 -36
  16. package/bundles/cdk-clipboard.umd.js.map +1 -1
  17. package/bundles/cdk-clipboard.umd.min.js +10 -2
  18. package/bundles/cdk-clipboard.umd.min.js.map +1 -1
  19. package/bundles/cdk-coercion.umd.js.map +1 -1
  20. package/bundles/cdk-collections.umd.js +498 -238
  21. package/bundles/cdk-collections.umd.js.map +1 -1
  22. package/bundles/cdk-collections.umd.min.js +6 -4
  23. package/bundles/cdk-collections.umd.min.js.map +1 -1
  24. package/bundles/cdk-drag-drop.umd.js +508 -448
  25. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  26. package/bundles/cdk-drag-drop.umd.min.js +64 -8
  27. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  28. package/bundles/cdk-keycodes.umd.js.map +1 -1
  29. package/bundles/cdk-layout.umd.js +30 -26
  30. package/bundles/cdk-layout.umd.js.map +1 -1
  31. package/bundles/cdk-layout.umd.min.js +7 -6
  32. package/bundles/cdk-layout.umd.min.js.map +1 -1
  33. package/bundles/cdk-observers.umd.js +34 -34
  34. package/bundles/cdk-observers.umd.js.map +1 -1
  35. package/bundles/cdk-observers.umd.min.js +2 -2
  36. package/bundles/cdk-observers.umd.min.js.map +1 -1
  37. package/bundles/cdk-overlay.umd.js +492 -435
  38. package/bundles/cdk-overlay.umd.js.map +1 -1
  39. package/bundles/cdk-overlay.umd.min.js +51 -11
  40. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  41. package/bundles/cdk-platform.umd.js +38 -11
  42. package/bundles/cdk-platform.umd.js.map +1 -1
  43. package/bundles/cdk-platform.umd.min.js +5 -12
  44. package/bundles/cdk-platform.umd.min.js.map +1 -1
  45. package/bundles/cdk-portal.umd.js +385 -322
  46. package/bundles/cdk-portal.umd.js.map +1 -1
  47. package/bundles/cdk-portal.umd.min.js +3 -12
  48. package/bundles/cdk-portal.umd.min.js.map +1 -1
  49. package/bundles/cdk-scrolling.umd.js +503 -490
  50. package/bundles/cdk-scrolling.umd.js.map +1 -1
  51. package/bundles/cdk-scrolling.umd.min.js +20 -34
  52. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  53. package/bundles/cdk-stepper.umd.js +135 -136
  54. package/bundles/cdk-stepper.umd.js.map +1 -1
  55. package/bundles/cdk-stepper.umd.min.js +11 -2
  56. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  57. package/bundles/cdk-table.umd.js +923 -653
  58. package/bundles/cdk-table.umd.js.map +1 -1
  59. package/bundles/cdk-table.umd.min.js +7 -22
  60. package/bundles/cdk-table.umd.min.js.map +1 -1
  61. package/bundles/cdk-testing-protractor.umd.js +310 -245
  62. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  63. package/bundles/cdk-testing-protractor.umd.min.js +2 -9
  64. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  65. package/bundles/cdk-testing-testbed.umd.js +341 -292
  66. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  67. package/bundles/cdk-testing-testbed.umd.min.js +6 -29
  68. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  69. package/bundles/cdk-testing.umd.js +342 -270
  70. package/bundles/cdk-testing.umd.js.map +1 -1
  71. package/bundles/cdk-testing.umd.min.js +3 -17
  72. package/bundles/cdk-testing.umd.min.js.map +1 -1
  73. package/bundles/cdk-text-field.umd.js +53 -53
  74. package/bundles/cdk-text-field.umd.js.map +1 -1
  75. package/bundles/cdk-text-field.umd.min.js +10 -2
  76. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  77. package/bundles/cdk-tree.umd.js +481 -417
  78. package/bundles/cdk-tree.umd.js.map +1 -1
  79. package/bundles/cdk-tree.umd.min.js +28 -3
  80. package/bundles/cdk-tree.umd.min.js.map +1 -1
  81. package/bundles/cdk.umd.js +1 -1
  82. package/bundles/cdk.umd.js.map +1 -1
  83. package/bundles/cdk.umd.min.js +1 -1
  84. package/bundles/cdk.umd.min.js.map +1 -1
  85. package/collections/dispose-view-repeater-strategy.d.ts +22 -0
  86. package/collections/index.metadata.json +1 -1
  87. package/collections/public-api.d.ts +3 -0
  88. package/collections/recycle-view-repeater-strategy.d.ts +56 -0
  89. package/collections/view-repeater.d.ts +94 -0
  90. package/drag-drop/index.d.ts +1 -2
  91. package/drag-drop/index.metadata.json +1 -1
  92. package/drag-drop/public-api.d.ts +2 -1
  93. package/esm2015/a11y/aria-describer/aria-describer.js +3 -3
  94. package/esm2015/a11y/focus-monitor/focus-monitor.js +3 -3
  95. package/esm2015/a11y/focus-trap/focus-trap.js +5 -4
  96. package/esm2015/a11y/key-manager/list-key-manager.js +8 -6
  97. package/esm2015/clipboard/pending-copy.js +7 -6
  98. package/esm2015/collections/collection-viewer.js +1 -0
  99. package/esm2015/collections/dispose-view-repeater-strategy.js +48 -0
  100. package/esm2015/collections/public-api.js +4 -1
  101. package/esm2015/collections/recycle-view-repeater-strategy.js +128 -0
  102. package/esm2015/collections/selection-model.js +2 -2
  103. package/esm2015/collections/tree-adapter.js +1 -0
  104. package/esm2015/collections/view-repeater.js +16 -0
  105. package/esm2015/drag-drop/clone-node.js +9 -1
  106. package/esm2015/drag-drop/directives/drag-handle.js +1 -3
  107. package/esm2015/drag-drop/directives/drag.js +7 -5
  108. package/esm2015/drag-drop/directives/drop-list.js +3 -3
  109. package/esm2015/drag-drop/drag-events.js +1 -0
  110. package/esm2015/drag-drop/drag-ref.js +2 -2
  111. package/esm2015/drag-drop/index.js +1 -3
  112. package/esm2015/drag-drop/public-api.js +3 -2
  113. package/esm2015/layout/breakpoints-observer.js +9 -9
  114. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +11 -9
  115. package/esm2015/overlay/overlay-config.js +1 -5
  116. package/esm2015/overlay/overlay-directives.js +18 -2
  117. package/esm2015/overlay/overlay-ref.js +6 -8
  118. package/esm2015/overlay/overlay-reference.js +1 -0
  119. package/esm2015/overlay/overlay.js +4 -4
  120. package/esm2015/overlay/position/connected-position-strategy.js +2 -9
  121. package/esm2015/overlay/position/flexible-connected-position-strategy.js +19 -16
  122. package/esm2015/overlay/position/position-strategy.js +1 -0
  123. package/esm2015/overlay/scroll/close-scroll-strategy.js +2 -2
  124. package/esm2015/overlay/scroll/reposition-scroll-strategy.js +2 -2
  125. package/esm2015/platform/features/scrolling.js +29 -2
  126. package/esm2015/portal/dom-portal-outlet.js +7 -4
  127. package/esm2015/portal/portal-directives.js +3 -3
  128. package/esm2015/portal/portal-injector.js +3 -1
  129. package/esm2015/portal/portal.js +25 -19
  130. package/esm2015/scrolling/fixed-size-virtual-scroll.js +2 -2
  131. package/esm2015/scrolling/scrolling-module.js +4 -1
  132. package/esm2015/scrolling/virtual-for-of.js +67 -92
  133. package/esm2015/scrolling/virtual-scroll-repeater.js +1 -0
  134. package/esm2015/scrolling/virtual-scroll-viewport.js +5 -5
  135. package/esm2015/stepper/stepper.js +19 -17
  136. package/esm2015/table/cell.js +34 -14
  137. package/esm2015/table/coalesced-style-scheduler.js +87 -0
  138. package/esm2015/table/public-api.js +2 -1
  139. package/esm2015/table/sticky-styler.js +79 -45
  140. package/esm2015/table/table-module.js +4 -2
  141. package/esm2015/table/table.js +70 -44
  142. package/esm2015/table/text-column.js +9 -5
  143. package/esm2015/testing/element-dimensions.js +1 -0
  144. package/esm2015/testing/protractor/protractor-element.js +6 -3
  145. package/esm2015/testing/public-api.js +2 -1
  146. package/esm2015/testing/test-element.js +1 -1
  147. package/esm2015/testing/testbed/task-state-zone-interceptor.js +2 -2
  148. package/esm2015/testing/testbed/unit-test-element.js +26 -21
  149. package/esm2015/testing/text-filtering.js +23 -0
  150. package/esm2015/text-field/autofill.js +3 -3
  151. package/esm2015/tree/control/tree-control.js +1 -0
  152. package/esm2015/tree/nested-node.js +2 -2
  153. package/esm2015/tree/padding.js +34 -20
  154. package/esm2015/tree/tree.js +14 -27
  155. package/esm2015/version.js +1 -1
  156. package/fesm2015/a11y.js +15 -12
  157. package/fesm2015/a11y.js.map +1 -1
  158. package/fesm2015/cdk.js +1 -1
  159. package/fesm2015/cdk.js.map +1 -1
  160. package/fesm2015/clipboard.js +6 -5
  161. package/fesm2015/clipboard.js.map +1 -1
  162. package/fesm2015/collections.js +194 -3
  163. package/fesm2015/collections.js.map +1 -1
  164. package/fesm2015/drag-drop.js +32 -23
  165. package/fesm2015/drag-drop.js.map +1 -1
  166. package/fesm2015/layout.js +8 -8
  167. package/fesm2015/layout.js.map +1 -1
  168. package/fesm2015/overlay.js +55 -48
  169. package/fesm2015/overlay.js.map +1 -1
  170. package/fesm2015/platform.js +28 -1
  171. package/fesm2015/platform.js.map +1 -1
  172. package/fesm2015/portal.js +34 -23
  173. package/fesm2015/portal.js.map +1 -1
  174. package/fesm2015/scrolling.js +72 -95
  175. package/fesm2015/scrolling.js.map +1 -1
  176. package/fesm2015/stepper.js +19 -17
  177. package/fesm2015/stepper.js.map +1 -1
  178. package/fesm2015/table.js +274 -105
  179. package/fesm2015/table.js.map +1 -1
  180. package/fesm2015/testing/protractor.js +5 -2
  181. package/fesm2015/testing/protractor.js.map +1 -1
  182. package/fesm2015/testing/testbed.js +26 -21
  183. package/fesm2015/testing/testbed.js.map +1 -1
  184. package/fesm2015/testing.js +24 -1
  185. package/fesm2015/testing.js.map +1 -1
  186. package/fesm2015/text-field.js +2 -2
  187. package/fesm2015/text-field.js.map +1 -1
  188. package/fesm2015/tree.js +46 -45
  189. package/fesm2015/tree.js.map +1 -1
  190. package/layout/breakpoints-observer.d.ts +3 -3
  191. package/overlay/index.metadata.json +1 -1
  192. package/overlay/overlay-config.d.ts +0 -4
  193. package/overlay/overlay-directives.d.ts +1 -0
  194. package/overlay/position/connected-position-strategy.d.ts +1 -3
  195. package/package.json +1 -1
  196. package/platform/index.metadata.json +1 -1
  197. package/portal/index.metadata.json +1 -1
  198. package/portal/portal-injector.d.ts +2 -0
  199. package/schematics/index.js +1 -1
  200. package/schematics/ng-add/index.js +1 -1
  201. package/schematics/ng-update/data/index.js +1 -1
  202. package/schematics/ng-update/public-api.js +1 -1
  203. package/schematics/update-tool/public-api.js +1 -1
  204. package/schematics/utils/index.js +1 -1
  205. package/scrolling/index.metadata.json +1 -1
  206. package/scrolling/scrolling-module.d.ts +3 -0
  207. package/scrolling/virtual-for-of.d.ts +11 -19
  208. package/stepper/index.metadata.json +1 -1
  209. package/stepper/stepper.d.ts +7 -10
  210. package/table/cell.d.ts +21 -1
  211. package/table/coalesced-style-scheduler.d.ts +41 -0
  212. package/table/index.metadata.json +1 -1
  213. package/table/public-api.d.ts +1 -0
  214. package/table/sticky-styler.d.ts +7 -1
  215. package/table/table.d.ts +14 -8
  216. package/testing/protractor/protractor-element.d.ts +2 -2
  217. package/testing/public-api.d.ts +1 -0
  218. package/testing/test-element.d.ts +9 -2
  219. package/testing/testbed/unit-test-element.d.ts +9 -2
  220. package/testing/text-filtering.d.ts +13 -0
  221. package/tree/index.metadata.json +1 -1
  222. package/tree/padding.d.ts +14 -0
  223. package/tree/tree.d.ts +2 -4
@@ -29,11 +29,12 @@
29
29
  this._document = _document;
30
30
  var textarea = this._textarea = this._document.createElement('textarea');
31
31
  var styles = textarea.style;
32
- // Hide the element for display and accessibility. Set an
33
- // absolute position so the page layout isn't affected.
34
- styles.opacity = '0';
35
- styles.position = 'absolute';
36
- styles.left = styles.top = '-999em';
32
+ // Hide the element for display and accessibility. Set a fixed position so the page layout
33
+ // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
34
+ // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
35
+ styles.position = 'fixed';
36
+ styles.top = styles.opacity = '0';
37
+ styles.left = '-999em';
37
38
  textarea.setAttribute('aria-hidden', 'true');
38
39
  textarea.value = text;
39
40
  this._document.body.appendChild(textarea);
@@ -110,15 +111,15 @@
110
111
  Clipboard.prototype.beginCopy = function (text) {
111
112
  return new PendingCopy(text, this._document);
112
113
  };
113
- Clipboard.ɵprov = i0.ɵɵdefineInjectable({ factory: function Clipboard_Factory() { return new Clipboard(i0.ɵɵinject(i1.DOCUMENT)); }, token: Clipboard, providedIn: "root" });
114
- Clipboard.decorators = [
115
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
116
- ];
117
- Clipboard.ctorParameters = function () { return [
118
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }
119
- ]; };
120
114
  return Clipboard;
121
115
  }());
116
+ Clipboard.ɵprov = i0.ɵɵdefineInjectable({ factory: function Clipboard_Factory() { return new Clipboard(i0.ɵɵinject(i1.DOCUMENT)); }, token: Clipboard, providedIn: "root" });
117
+ Clipboard.decorators = [
118
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
119
+ ];
120
+ Clipboard.ctorParameters = function () { return [
121
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }
122
+ ]; };
122
123
 
123
124
  /**
124
125
  * @license
@@ -190,26 +191,26 @@
190
191
  this._pending.clear();
191
192
  this._destroyed = true;
192
193
  };
193
- CdkCopyToClipboard.decorators = [
194
- { type: i0.Directive, args: [{
195
- selector: '[cdkCopyToClipboard]',
196
- host: {
197
- '(click)': 'copy()',
198
- }
199
- },] }
200
- ];
201
- CdkCopyToClipboard.ctorParameters = function () { return [
202
- { type: Clipboard },
203
- { type: i0.NgZone },
204
- { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [CKD_COPY_TO_CLIPBOARD_CONFIG,] }] }
205
- ]; };
206
- CdkCopyToClipboard.propDecorators = {
207
- text: [{ type: i0.Input, args: ['cdkCopyToClipboard',] }],
208
- attempts: [{ type: i0.Input, args: ['cdkCopyToClipboardAttempts',] }],
209
- copied: [{ type: i0.Output, args: ['cdkCopyToClipboardCopied',] }]
210
- };
211
194
  return CdkCopyToClipboard;
212
195
  }());
196
+ CdkCopyToClipboard.decorators = [
197
+ { type: i0.Directive, args: [{
198
+ selector: '[cdkCopyToClipboard]',
199
+ host: {
200
+ '(click)': 'copy()',
201
+ }
202
+ },] }
203
+ ];
204
+ CdkCopyToClipboard.ctorParameters = function () { return [
205
+ { type: Clipboard },
206
+ { type: i0.NgZone },
207
+ { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [CKD_COPY_TO_CLIPBOARD_CONFIG,] }] }
208
+ ]; };
209
+ CdkCopyToClipboard.propDecorators = {
210
+ text: [{ type: i0.Input, args: ['cdkCopyToClipboard',] }],
211
+ attempts: [{ type: i0.Input, args: ['cdkCopyToClipboardAttempts',] }],
212
+ copied: [{ type: i0.Output, args: ['cdkCopyToClipboardCopied',] }]
213
+ };
213
214
 
214
215
  /**
215
216
  * @license
@@ -221,14 +222,14 @@
221
222
  var ClipboardModule = /** @class */ (function () {
222
223
  function ClipboardModule() {
223
224
  }
224
- ClipboardModule.decorators = [
225
- { type: i0.NgModule, args: [{
226
- declarations: [CdkCopyToClipboard],
227
- exports: [CdkCopyToClipboard],
228
- },] }
229
- ];
230
225
  return ClipboardModule;
231
226
  }());
227
+ ClipboardModule.decorators = [
228
+ { type: i0.NgModule, args: [{
229
+ declarations: [CdkCopyToClipboard],
230
+ exports: [CdkCopyToClipboard],
231
+ },] }
232
+ ];
232
233
 
233
234
  /**
234
235
  * @license
@@ -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 an\n // absolute position so the page layout isn't affected.\n styles.opacity = '0';\n styles.position = 'absolute';\n styles.left = styles.top = '-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;;;YAI9B,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;YACrB,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC;YAC7B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,GAAG,QAAQ,CAAC;YACpC,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;gBAC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/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,IAA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O,CAAC,OAAO,EAAE,CAAC;wBAClB,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;qBAC9B;iBACF,CAAC;gBACF,SAAO,EAAE,CAAC;aACX;iBAAM;gBACL,IAAI,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;;;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;;;;;;;;;;;;;;;;"}
@@ -5,7 +5,14 @@
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 n=function(){function t(t,e){this._document=e;var o=this._textarea=this._document.createElement("textarea"),n=o.style;n.opacity="0",n.position="absolute",n.left=n.top="-999em",o.setAttribute("aria-hidden","true"),o.value=t,this._document.body.appendChild(o)}return t.prototype.copy=function(){var t=this._textarea,e=!1;try{if(t){var o=this._document.activeElement;t.select(),t.setSelectionRange(0,t.value.length),e=this._document.execCommand("copy"),o&&o.focus()}}catch(t){}return e},t.prototype.destroy=function(){var t=this._textarea;t&&(t.parentNode&&t.parentNode.removeChild(t),this._textarea=void 0)},t}(),r=function(){function t(t){this._document=t}return t.prototype.copy=function(t){var e=this.beginCopy(t),o=e.copy();return e.destroy(),o},t.prototype.beginCopy=function(t){return new n(t,this._document)},t.ɵprov=o.ɵɵdefineInjectable({factory:function n(){return new t(o.ɵɵinject(e.DOCUMENT))},token:t,providedIn:"root"}),t.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[e.DOCUMENT]}]}]},t}(),i=new o.InjectionToken("CKD_COPY_TO_CLIPBOARD_CONFIG"),c=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.decorators=[{type:o.Directive,args:[{selector:"[cdkCopyToClipboard]",host:{"(click)":"copy()"}}]}],t.ctorParameters=function(){return[{type:r},{type:o.NgZone},{type:void 0,decorators:[{type:o.Optional},{type:o.Inject,args:[i]}]}]},t.propDecorators={text:[{type:o.Input,args:["cdkCopyToClipboard"]}],attempts:[{type:o.Input,args:["cdkCopyToClipboardAttempts"]}],copied:[{type:o.Output,args:["cdkCopyToClipboardCopied"]}]},t}(),p=function(){function t(){}return t.decorators=[{type:o.NgModule,args:[{declarations:[c],exports:[c]}]}],t}();
8
+ */var n=function(){function t(t,e){this._document=e;var o=this._textarea=this._document.createElement("textarea"),n=o.style;n.position="fixed",n.top=n.opacity="0",n.left="-999em",o.setAttribute("aria-hidden","true"),o.value=t,this._document.body.appendChild(o)}return t.prototype.copy=function(){var t=this._textarea,e=!1;try{if(t){var o=this._document.activeElement;t.select(),t.setSelectionRange(0,t.value.length),e=this._document.execCommand("copy"),o&&o.focus()}}catch(t){}return e},t.prototype.destroy=function(){var t=this._textarea;t&&(t.parentNode&&t.parentNode.removeChild(t),this._textarea=void 0)},t}(),r=function(){function t(t){this._document=t}return t.prototype.copy=function(t){var e=this.beginCopy(t),o=e.copy();return e.destroy(),o},t.prototype.beginCopy=function(t){return new n(t,this._document)},t}();
9
+ /**
10
+ * @license
11
+ * Copyright Google LLC All Rights Reserved.
12
+ *
13
+ * Use of this source code is governed by an MIT-style license that can be
14
+ * found in the LICENSE file at https://angular.io/license
15
+ */r.ɵprov=o.ɵɵdefineInjectable({factory:function t(){return new r(o.ɵɵinject(e.DOCUMENT))},token:r,providedIn:"root"}),r.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],r.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[e.DOCUMENT]}]}]};
9
16
  /**
10
17
  * @license
11
18
  * Copyright Google LLC All Rights Reserved.
@@ -13,6 +20,7 @@
13
20
  * Use of this source code is governed by an MIT-style license that can be
14
21
  * found in the LICENSE file at https://angular.io/license
15
22
  */
23
+ var i,c=new o.InjectionToken("CKD_COPY_TO_CLIPBOARD_CONFIG"),p=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}();p.decorators=[{type:o.Directive,args:[{selector:"[cdkCopyToClipboard]",host:{"(click)":"copy()"}}]}],p.ctorParameters=function(){return[{type:r},{type:o.NgZone},{type:void 0,decorators:[{type:o.Optional},{type:o.Inject,args:[c]}]}]},p.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:[p],exports:[p]}]}],
16
24
  /**
17
25
  * @license
18
26
  * Copyright Google LLC All Rights Reserved.
@@ -20,4 +28,4 @@
20
28
  * Use of this source code is governed by an MIT-style license that can be
21
29
  * found in the LICENSE file at https://angular.io/license
22
30
  */
23
- t.CKD_COPY_TO_CLIPBOARD_CONFIG=i,t.CdkCopyToClipboard=c,t.Clipboard=r,t.ClipboardModule=p,t.PendingCopy=n,Object.defineProperty(t,"__esModule",{value:!0})}));
31
+ t.CKD_COPY_TO_CLIPBOARD_CONFIG=c,t.CdkCopyToClipboard=p,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","opacity","position","left","top","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","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","ClipboardModule","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,MAGtBD,EAAOE,QAAU,IACjBF,EAAOG,SAAW,WAClBH,EAAOI,KAAOJ,EAAOK,IAAM,SAC3BR,EAASS,aAAa,cAAe,QACrCT,EAASU,MAA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F,UAAY,CAAEpC,KAAM5C,EAAGgD,OAAQF,KAAM,CAACG,QAErFE,EAAmB8B,eAAiB,CAChC/E,KAAM,CAAC,CAAE0C,KAAM5C,EAAGkF,MAAOpC,KAAM,CAAC,wBAChCS,SAAU,CAAC,CAAEX,KAAM5C,EAAGkF,MAAOpC,KAAM,CAAC,gCACpCU,OAAQ,CAAC,CAAEZ,KAAM5C,EAAGmF,OAAQrC,KAAM,CAAC,+BAEhCK,EA3E4B,GAqFnCiC,EAAiC,WACjC,SAASA,KAQT,OANAA,EAAgBzC,WAAa,CACzB,CAAEC,KAAM5C,EAAGqF,SAAUvC,KAAM,CAAC,CAChBwC,aAAc,CAACnC,GACfhE,QAAS,CAACgE,OAGnBiC,EATyB;;;;;;;;;;;;;;;AAwBpCjG,EAAQ8D,6BAA+BA,EACvC9D,EAAQgE,mBAAqBA,EAC7BhE,EAAQ6C,UAAYA,EACpB7C,EAAQiG,gBAAkBA,EAC1BjG,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 an\n // absolute position so the page layout isn't affected.\n styles.opacity = '0';\n styles.position = 'absolute';\n styles.left = styles.top = '-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 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 return Clipboard;\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 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 return CdkCopyToClipboard;\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 ClipboardModule.decorators = [\n { type: i0.NgModule, args: [{\n declarations: [CdkCopyToClipboard],\n exports: [CdkCopyToClipboard],\n },] }\n ];\n return ClipboardModule;\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","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,I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,QACd7E,KAAKoE,YAAa,GAEfd,EAzD4B,GA2DvCA,EAAmBT,WAAa,CAC5B,CAAEC,KAAM5C,EAAG4E,UAAW9B,KAAM,CAAC,CACjB+B,SAAU,uBACVC,KAAM,CACFC,UAAW,cAI/B3B,EAAmBL,eAAiB,WAAc,MAAO,CACrD,CAAEH,KAAMZ,GACR,CAAEY,KAAM5C,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 +1 @@
1
- {"version":3,"file":"cdk-coercion.umd.js","sources":["../../../../../../src/cdk/coercion/boolean-property.ts","../../../../../../src/cdk/coercion/number-property.ts","../../../../../../src/cdk/coercion/array.ts","../../../../../../src/cdk/coercion/css-pixel-value.ts","../../../../../../src/cdk/coercion/element.ts","../../../../../../src/cdk/coercion/public-api.ts","../../../../../../src/cdk/coercion/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 * Type describing the allowed values for a boolean input.\n * @docs-private\n */\nexport type BooleanInput = string | boolean | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\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 * Type describing the allowed values for a number input\n * @docs-private\n */\nexport type NumberInput = string | number | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a number. */\nexport function coerceNumberProperty(value: any): number;\nexport function coerceNumberProperty<D>(value: any, fallback: D): number | D;\nexport function coerceNumberProperty(value: any, fallbackValue = 0) {\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n}\n\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nexport function _isNumberValue(value: any): boolean {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\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/** Wraps the provided value in an array, unless the provided value is an array. */\nexport function coerceArray<T>(value: T | T[]): T[];\nexport function coerceArray<T>(value: T | readonly T[]): readonly T[];\nexport function coerceArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\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/** Coerces a value to a CSS pixel value. */\nexport function coerceCssPixelValue(value: any): string {\n if (value == null) {\n return '';\n }\n\n return typeof value === 'string' ? value : `${value}px`;\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 {ElementRef} from '@angular/core';\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nexport function coerceElement<T>(elementOrRef: ElementRef<T> | T): T {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\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 './boolean-property';\nexport * from './number-property';\nexport * from './array';\nexport * from './css-pixel-value';\nexport * from './element';\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":["ElementRef"],"mappings":";;;;;;IAAA;;;;;;;IAcA;AACA,aAAgB,qBAAqB,CAAC,KAAU;QAC9C,OAAO,KAAK,IAAI,IAAI,IAAI,KAAG,KAAO,KAAK,OAAO,CAAC;IACjD,CAAC;;ICjBD;;;;;;;AAiBA,aAAgB,oBAAoB,CAAC,KAAU,EAAE,aAAiB;QAAjB,8BAAA,EAAA,iBAAiB;QAChE,OAAO,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC;IAC/D,CAAC;IAED;;;;AAIA,aAAgB,cAAc,CAAC,KAAU;;;;QAIvC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;;IC9BD;;;;;;;AAWA,aAAgB,WAAW,CAAI,KAAc;QAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;;ICbD;;;;;;;IAQA;AACA,aAAgB,mBAAmB,CAAC,KAAU;QAC5C,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,EAAE,CAAC;SACX;QAED,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAM,KAAK,OAAI,CAAC;IAC1D,CAAC;;ICfD;;;;;;;AAQA,IAEA;;;;AAIA,aAAgB,aAAa,CAAI,YAA+B;QAC9D,OAAO,YAAY,YAAYA,eAAU,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;IACxF,CAAC;;IChBD;;;;;;OAMG;;ICNH;;;;;;OAMG;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"cdk-coercion.umd.js","sources":["../../../../../src/cdk/coercion/boolean-property.ts","../../../../../src/cdk/coercion/number-property.ts","../../../../../src/cdk/coercion/array.ts","../../../../../src/cdk/coercion/css-pixel-value.ts","../../../../../src/cdk/coercion/element.ts","../../../../../src/cdk/coercion/public-api.ts","../../../../../src/cdk/coercion/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 * Type describing the allowed values for a boolean input.\n * @docs-private\n */\nexport type BooleanInput = string | boolean | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\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 * Type describing the allowed values for a number input\n * @docs-private\n */\nexport type NumberInput = string | number | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a number. */\nexport function coerceNumberProperty(value: any): number;\nexport function coerceNumberProperty<D>(value: any, fallback: D): number | D;\nexport function coerceNumberProperty(value: any, fallbackValue = 0) {\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n}\n\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nexport function _isNumberValue(value: any): boolean {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\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/** Wraps the provided value in an array, unless the provided value is an array. */\nexport function coerceArray<T>(value: T | T[]): T[];\nexport function coerceArray<T>(value: T | readonly T[]): readonly T[];\nexport function coerceArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\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/** Coerces a value to a CSS pixel value. */\nexport function coerceCssPixelValue(value: any): string {\n if (value == null) {\n return '';\n }\n\n return typeof value === 'string' ? value : `${value}px`;\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 {ElementRef} from '@angular/core';\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nexport function coerceElement<T>(elementOrRef: ElementRef<T> | T): T {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\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 './boolean-property';\nexport * from './number-property';\nexport * from './array';\nexport * from './css-pixel-value';\nexport * from './element';\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":["ElementRef"],"mappings":";;;;;;IAAA;;;;;;;IAcA;AACA,aAAgB,qBAAqB,CAAC,KAAU;QAC9C,OAAO,KAAK,IAAI,IAAI,IAAI,KAAG,KAAO,KAAK,OAAO,CAAC;IACjD,CAAC;;ICjBD;;;;;;;AAiBA,aAAgB,oBAAoB,CAAC,KAAU,EAAE,aAAiB;QAAjB,8BAAA,EAAA,iBAAiB;QAChE,OAAO,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC;IAC/D,CAAC;IAED;;;;AAIA,aAAgB,cAAc,CAAC,KAAU;;;;QAIvC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;;IC9BD;;;;;;;AAWA,aAAgB,WAAW,CAAI,KAAc;QAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;;ICbD;;;;;;;IAQA;AACA,aAAgB,mBAAmB,CAAC,KAAU;QAC5C,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,EAAE,CAAC;SACX;QAED,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAM,KAAK,OAAI,CAAC;IAC1D,CAAC;;ICfD;;;;;;;AAQA,IAEA;;;;AAIA,aAAgB,aAAa,CAAI,YAA+B;QAC9D,OAAO,YAAY,YAAYA,eAAU,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;IACxF,CAAC;;IChBD;;;;;;OAMG;;ICNH;;;;;;OAMG;;;;;;;;;;;;;;;;;"}