@angular/cdk 9.1.1 → 9.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.
- package/a11y/focus-monitor/focus-monitor.d.ts +36 -2
- package/a11y/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +241 -19
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +25 -10
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-clipboard.umd.js +1 -1
- package/bundles/cdk-clipboard.umd.js.map +1 -1
- package/bundles/cdk-clipboard.umd.min.js +1 -1
- package/bundles/cdk-clipboard.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +0 -1
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-coercion.umd.min.js.map +1 -1
- package/bundles/cdk-collections.umd.js +203 -6
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +17 -10
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +217 -23
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +25 -10
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +210 -12
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +27 -12
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +11 -0
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +6 -6
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +211 -14
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js +19 -4
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +242 -14
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +14 -6
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +278 -50
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +29 -7
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.js +254 -49
- package/bundles/cdk-testing-protractor.umd.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js +16 -9
- package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.js +257 -54
- package/bundles/cdk-testing-testbed.umd.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.min.js +23 -8
- package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +243 -46
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +20 -5
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +21 -6
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +3 -3
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +212 -15
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +17 -3
- package/bundles/cdk-tree.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/coercion/array.d.ts +1 -0
- package/esm2015/a11y/focus-monitor/focus-monitor.js +93 -12
- package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
- package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
- package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
- package/esm2015/a11y/public-api.js +2 -2
- package/esm2015/bidi/directionality.js +1 -1
- package/esm2015/clipboard/pending-copy.js +3 -3
- package/esm2015/coercion/array.js +1 -2
- package/esm2015/drag-drop/drag-drop.js +1 -1
- package/esm2015/drag-drop/drag-ref.js +7 -5
- package/esm2015/drag-drop/drop-list-ref.js +11 -19
- package/esm2015/layout/breakpoints-observer.js +1 -1
- package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -2
- package/esm2015/overlay/position/overlay-position-builder.js +1 -1
- package/esm2015/platform/features/shadow-dom.js +16 -1
- package/esm2015/platform/public-api.js +2 -2
- package/esm2015/scrolling/scroll-dispatcher.js +38 -5
- package/esm2015/scrolling/viewport-ruler.js +44 -5
- package/esm2015/table/cell.js +18 -8
- package/esm2015/table/public-api.js +3 -2
- package/esm2015/table/row.js +24 -8
- package/esm2015/table/table.js +26 -12
- package/esm2015/table/text-column.js +3 -26
- package/esm2015/table/tokens.js +44 -0
- package/esm2015/testing/protractor/protractor-element.js +4 -2
- package/esm2015/testing/protractor/protractor-harness-environment.js +13 -8
- package/esm2015/testing/testbed/testbed-harness-environment.js +16 -10
- package/esm2015/text-field/autosize.js +38 -4
- package/esm2015/version.js +1 -1
- package/esm5/a11y/focus-monitor/focus-monitor.js +39 -13
- package/esm5/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
- package/esm5/a11y/focus-trap/focus-trap.js +1 -1
- package/esm5/a11y/live-announcer/live-announcer.js +1 -1
- package/esm5/bidi/directionality.js +1 -1
- package/esm5/clipboard/pending-copy.js +2 -2
- package/esm5/coercion/array.js +1 -2
- package/esm5/drag-drop/drag-drop.js +1 -1
- package/esm5/drag-drop/drag-ref.js +7 -5
- package/esm5/drag-drop/drop-list-ref.js +9 -14
- package/esm5/layout/breakpoints-observer.js +1 -1
- package/esm5/overlay/position/flexible-connected-position-strategy.js +3 -2
- package/esm5/overlay/position/overlay-position-builder.js +1 -1
- package/esm5/platform/features/shadow-dom.js +11 -1
- package/esm5/scrolling/scroll-dispatcher.js +21 -5
- package/esm5/scrolling/viewport-ruler.js +24 -5
- package/esm5/table/cell.js +13 -8
- package/esm5/table/public-api.js +2 -1
- package/esm5/table/row.js +21 -11
- package/esm5/table/table.js +16 -11
- package/esm5/table/text-column.js +3 -4
- package/esm5/table/tokens.js +16 -0
- package/esm5/testing/protractor/protractor-element.js +4 -2
- package/esm5/testing/protractor/protractor-harness-environment.js +17 -11
- package/esm5/testing/testbed/testbed-harness-environment.js +17 -11
- package/esm5/text-field/autosize.js +20 -4
- package/esm5/version.js +1 -1
- package/fesm2015/a11y.js +89 -11
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/clipboard.js +2 -2
- package/fesm2015/clipboard.js.map +1 -1
- package/fesm2015/coercion.js +0 -1
- package/fesm2015/coercion.js.map +1 -1
- package/fesm2015/drag-drop.js +16 -22
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/overlay.js +2 -1
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +16 -1
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/scrolling.js +76 -7
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/table.js +98 -49
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/testing/protractor.js +16 -9
- package/fesm2015/testing/protractor.js.map +1 -1
- package/fesm2015/testing/testbed.js +15 -9
- package/fesm2015/testing/testbed.js.map +1 -1
- package/fesm2015/text-field.js +37 -3
- package/fesm2015/text-field.js.map +1 -1
- package/fesm5/a11y.js +36 -12
- package/fesm5/a11y.js.map +1 -1
- package/fesm5/cdk.js +1 -1
- package/fesm5/cdk.js.map +1 -1
- package/fesm5/clipboard.js +1 -1
- package/fesm5/clipboard.js.map +1 -1
- package/fesm5/coercion.js +0 -1
- package/fesm5/coercion.js.map +1 -1
- package/fesm5/drag-drop.js +14 -17
- package/fesm5/drag-drop.js.map +1 -1
- package/fesm5/overlay.js +2 -1
- package/fesm5/overlay.js.map +1 -1
- package/fesm5/platform.js +11 -1
- package/fesm5/platform.js.map +1 -1
- package/fesm5/scrolling.js +39 -7
- package/fesm5/scrolling.js.map +1 -1
- package/fesm5/table.js +59 -29
- package/fesm5/table.js.map +1 -1
- package/fesm5/testing/protractor.js +20 -12
- package/fesm5/testing/protractor.js.map +1 -1
- package/fesm5/testing/testbed.js +16 -10
- package/fesm5/testing/testbed.js.map +1 -1
- package/fesm5/text-field.js +19 -3
- package/fesm5/text-field.js.map +1 -1
- package/package.json +1 -1
- package/platform/features/shadow-dom.d.ts +2 -0
- package/platform/index.metadata.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/upgrade-rules/class-names-rule.js +3 -1
- package/schematics/utils/ast/ng-module-imports.js +3 -2
- package/scrolling/index.metadata.json +1 -1
- package/scrolling/scroll-dispatcher.d.ts +9 -1
- package/scrolling/viewport-ruler.d.ts +9 -1
- package/table/cell.d.ts +2 -0
- package/table/index.metadata.json +1 -1
- package/table/public-api.d.ts +1 -0
- package/table/row.d.ts +6 -3
- package/table/table.d.ts +2 -0
- package/table/text-column.d.ts +2 -13
- package/table/tokens.d.ts +25 -0
- package/testing/protractor/protractor-harness-environment.d.ts +10 -3
- package/testing/testbed/testbed-harness-environment.d.ts +12 -4
- package/text-field/autosize.d.ts +9 -1
- package/text-field/index.metadata.json +1 -1
package/fesm5/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
|
-
var VERSION = new Version('9.
|
|
11
|
+
var VERSION = new Version('9.2.0');
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
package/fesm5/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('9.
|
|
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('9.2.0');\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,IAAa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC;;ACXvD;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
|
package/fesm5/clipboard.js
CHANGED
|
@@ -45,7 +45,7 @@ var PendingCopy = /** @class */ (function () {
|
|
|
45
45
|
textarea.select();
|
|
46
46
|
textarea.setSelectionRange(0, textarea.value.length);
|
|
47
47
|
successful = this._document.execCommand('copy');
|
|
48
|
-
if (currentFocus
|
|
48
|
+
if (currentFocus) {
|
|
49
49
|
currentFocus.focus();
|
|
50
50
|
}
|
|
51
51
|
}
|
package/fesm5/clipboard.js.map
CHANGED
|
@@ -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 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;\n\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n\n if (currentFocus && currentFocus instanceof HTMLElement) {\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 /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n * @deprecated Use `cdkCopyToClipboardCopied` instead.\n * @breaking-change 10.0.0\n */\n @Output('copied') _deprecatedCopied = this.copied;\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 /**\n * @deprecated _ngZone parameter to become required.\n * @breaking-change 10.0.0\n */\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 // @breaking-change 10.0.0 Remove null check for `_ngZone`.\n if (this._ngZone) {\n this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));\n } else {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n this._currentTimeout = setTimeout(attempt, 1);\n }\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;IAGE,qBAAY,IAAY,EAAmB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;QAC5D,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC3E,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;;;QAI9B,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;QACrB,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC;QAC7B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,GAAG,QAAQ,CAAC;QACpC,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,0BAAI,GAAJ;QACE,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,UAAU,GAAG,KAAK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,SAAC;oBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B;;IAED,sBAAC;CALD;;ACZA;;;;;;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 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 /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n * @deprecated Use `cdkCopyToClipboardCopied` instead.\n * @breaking-change 10.0.0\n */\n @Output('copied') _deprecatedCopied = this.copied;\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 /**\n * @deprecated _ngZone parameter to become required.\n * @breaking-change 10.0.0\n */\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 // @breaking-change 10.0.0 Remove null check for `_ngZone`.\n if (this._ngZone) {\n this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));\n } else {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n this._currentTimeout = setTimeout(attempt, 1);\n }\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;IAGE,qBAAY,IAAY,EAAmB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;QAC5D,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC3E,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;;;QAI9B,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;QACrB,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC;QAC7B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,GAAG,QAAQ,CAAC;QACpC,QAA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AtBO,SAAS;gBANf,MAAM;gDAqEH,QAAQ,YAAI,MAAM,SAAC,4BAA4B;;;uBAtCjD,KAAK,SAAC,oBAAoB;2BAM1B,KAAK,SAAC,4BAA4B;yBAMlC,MAAM,SAAC,0BAA0B;oCAQjC,MAAM,SAAC,QAAQ;;IAgElB,yBAAC;CA5FD;;ACpCA;;;;;;;AAQA;IAIA;KAKC;;gBALA,QAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B;;IAED,sBAAC;CALD;;ACZA;;;;;;GAMG;;ACNH;;GAEG;;;;"}
|
package/fesm5/coercion.js
CHANGED
|
@@ -41,7 +41,6 @@ function _isNumberValue(value) {
|
|
|
41
41
|
* Use of this source code is governed by an MIT-style license that can be
|
|
42
42
|
* found in the LICENSE file at https://angular.io/license
|
|
43
43
|
*/
|
|
44
|
-
/** Wraps the provided value in an array, unless the provided value is an array. */
|
|
45
44
|
function coerceArray(value) {
|
|
46
45
|
return Array.isArray(value) ? value : [value];
|
|
47
46
|
}
|
package/fesm5/coercion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coercion.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[] {\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":[],"mappings":";;AAAA;;;;;;;;AAeA,SAAgB,qBAAqB,CAAC,KAAU;IAC9C,OAAO,KAAK,IAAI,IAAI,IAAI,KAAG,KAAO,KAAK,OAAO,CAAC;CAChD;;ACjBD;;;;;;;AAiBA,SAAgB,oBAAoB,CAAC,KAAU,EAAE,aAAiB;IAAjB,8BAAA,EAAA,iBAAiB;IAChE,OAAO,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC;CAC9D;;;;;AAMD,SAAgB,cAAc,CAAC,KAAU;;;;IAIvC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;CAClE;;AC9BD
|
|
1
|
+
{"version":3,"file":"coercion.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":[],"mappings":";;AAAA;;;;;;;;AAeA,SAAgB,qBAAqB,CAAC,KAAU;IAC9C,OAAO,KAAK,IAAI,IAAI,IAAI,KAAG,KAAO,KAAK,OAAO,CAAC;CAChD;;ACjBD;;;;;;;AAiBA,SAAgB,oBAAoB,CAAC,KAAU,EAAE,aAAiB;IAAjB,8BAAA,EAAA,iBAAiB;IAChE,OAAO,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC;CAC9D;;;;;AAMD,SAAgB,cAAc,CAAC,KAAU;;;;IAIvC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;CAClE;;AC9BD;;;;;;;AAWA,SAAgB,WAAW,CAAI,KAAc;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;CAC/C;;ACbD;;;;;;;;AASA,SAAgB,mBAAmB,CAAC,KAAU;IAC5C,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,EAAE,CAAC;KACX;IAED,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAM,KAAK,OAAI,CAAC;CACzD;;ACfD;;;;;;;AAQA,AAEA;;;;AAIA,SAAgB,aAAa,CAAI,YAA+B;IAC9D,OAAO,YAAY,YAAY,UAAU,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;CACvF;;AChBD;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
|
package/fesm5/drag-drop.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injectable, NgZone, Inject, ɵɵdefineInjectable, ɵɵinject, InjectionToken, Directive, ElementRef, Optional, Input, TemplateRef, EventEmitter, isDevMode, SkipSelf, ViewContainerRef, ChangeDetectorRef, ContentChildren, ContentChild, Output, NgModule } from '@angular/core';
|
|
2
2
|
import { DOCUMENT } from '@angular/common';
|
|
3
3
|
import { ViewportRuler, ScrollDispatcher } from '@angular/cdk/scrolling';
|
|
4
|
-
import { normalizePassiveListenerOptions,
|
|
4
|
+
import { normalizePassiveListenerOptions, _getShadowRoot } from '@angular/cdk/platform';
|
|
5
5
|
import { coerceBooleanProperty, coerceElement, coerceNumberProperty, coerceArray } from '@angular/cdk/coercion';
|
|
6
6
|
import { Subject, Subscription, interval, animationFrameScheduler, Observable, merge } from 'rxjs';
|
|
7
7
|
import { startWith, takeUntil, map, take, tap, switchMap } from 'rxjs/operators';
|
|
@@ -665,10 +665,10 @@ var DragRef = /** @class */ (function () {
|
|
|
665
665
|
_this._dropContainer.exit(_this);
|
|
666
666
|
// Notify the new container that the item has entered.
|
|
667
667
|
_this._dropContainer = newContainer;
|
|
668
|
-
_this._dropContainer.enter(_this, x, y,
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
668
|
+
_this._dropContainer.enter(_this, x, y, newContainer === _this._initialContainer &&
|
|
669
|
+
// If we're re-entering the initial container and sorting is disabled,
|
|
670
|
+
// put item the into its starting index to begin with.
|
|
671
|
+
newContainer.sortingDisabled ? _this._initialIndex : undefined);
|
|
672
672
|
_this.entered.next({
|
|
673
673
|
item: _this,
|
|
674
674
|
container: newContainer,
|
|
@@ -692,6 +692,7 @@ var DragRef = /** @class */ (function () {
|
|
|
692
692
|
var preview;
|
|
693
693
|
if (previewTemplate) {
|
|
694
694
|
var viewRef = previewConfig.viewContainer.createEmbeddedView(previewTemplate, previewConfig.context);
|
|
695
|
+
viewRef.detectChanges();
|
|
695
696
|
preview = getRootNode(viewRef, this._document);
|
|
696
697
|
this._previewRef = viewRef;
|
|
697
698
|
if (previewConfig.matchSize) {
|
|
@@ -778,6 +779,7 @@ var DragRef = /** @class */ (function () {
|
|
|
778
779
|
var placeholder;
|
|
779
780
|
if (placeholderTemplate) {
|
|
780
781
|
this._placeholderRef = placeholderConfig.viewContainer.createEmbeddedView(placeholderTemplate, placeholderConfig.context);
|
|
782
|
+
this._placeholderRef.detectChanges();
|
|
781
783
|
placeholder = getRootNode(this._placeholderRef, this._document);
|
|
782
784
|
}
|
|
783
785
|
else {
|
|
@@ -1692,13 +1694,17 @@ var DropListRef = /** @class */ (function () {
|
|
|
1692
1694
|
*/
|
|
1693
1695
|
DropListRef.prototype._updateAfterScroll = function (scrolledParent, newTop, newLeft) {
|
|
1694
1696
|
var _this = this;
|
|
1697
|
+
// Used when figuring out whether an element is inside the scroll parent. If the scrolled
|
|
1698
|
+
// parent is the `document`, we use the `documentElement`, because IE doesn't support `contains`
|
|
1699
|
+
// on the `document`.
|
|
1700
|
+
var scrolledParentNode = scrolledParent === this._document ? scrolledParent.documentElement : scrolledParent;
|
|
1695
1701
|
var scrollPosition = this._parentPositions.get(scrolledParent).scrollPosition;
|
|
1696
1702
|
var topDifference = scrollPosition.top - newTop;
|
|
1697
1703
|
var leftDifference = scrollPosition.left - newLeft;
|
|
1698
1704
|
// Go through and update the cached positions of the scroll
|
|
1699
1705
|
// parents that are inside the element that was scrolled.
|
|
1700
1706
|
this._parentPositions.forEach(function (position, node) {
|
|
1701
|
-
if (position.clientRect && scrolledParent !== node &&
|
|
1707
|
+
if (position.clientRect && scrolledParent !== node && scrolledParentNode.contains(node)) {
|
|
1702
1708
|
adjustClientRect(position.clientRect, topDifference, leftDifference);
|
|
1703
1709
|
}
|
|
1704
1710
|
});
|
|
@@ -1823,7 +1829,8 @@ var DropListRef = /** @class */ (function () {
|
|
|
1823
1829
|
*/
|
|
1824
1830
|
DropListRef.prototype._getShadowRoot = function () {
|
|
1825
1831
|
if (!this._cachedShadowRoot) {
|
|
1826
|
-
|
|
1832
|
+
var shadowRoot = _getShadowRoot(coerceElement(this.element));
|
|
1833
|
+
this._cachedShadowRoot = shadowRoot || this._document;
|
|
1827
1834
|
}
|
|
1828
1835
|
return this._cachedShadowRoot;
|
|
1829
1836
|
};
|
|
@@ -1995,16 +2002,6 @@ function getElementScrollDirections(element, clientRect, pointerX, pointerY) {
|
|
|
1995
2002
|
}
|
|
1996
2003
|
return [verticalScrollDirection, horizontalScrollDirection];
|
|
1997
2004
|
}
|
|
1998
|
-
/** Gets the shadow root of an element, if any. */
|
|
1999
|
-
function getShadowRoot(element) {
|
|
2000
|
-
if (_supportsShadowDom()) {
|
|
2001
|
-
var rootNode = element.getRootNode ? element.getRootNode() : null;
|
|
2002
|
-
if (rootNode instanceof ShadowRoot) {
|
|
2003
|
-
return rootNode;
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
return null;
|
|
2007
|
-
}
|
|
2008
2005
|
|
|
2009
2006
|
/**
|
|
2010
2007
|
* @license
|