@angular/cdk 14.0.0-next.1 → 14.0.0-next.12
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/_index.scss +11 -0
- package/a11y/a11y-module.d.ts +2 -3
- package/a11y/focus-monitor/focus-monitor.d.ts +1 -1
- package/a11y/focus-trap/focus-trap.d.ts +1 -1
- package/a11y/live-announcer/live-announcer.d.ts +5 -1
- package/a11y-prebuilt.css +1 -1
- package/accordion/accordion-item.d.ts +1 -1
- package/accordion/accordion.d.ts +1 -1
- package/bidi/dir.d.ts +1 -1
- package/clipboard/copy-to-clipboard.d.ts +1 -1
- package/dialog/dialog-config.d.ts +115 -0
- package/dialog/dialog-container.d.ts +95 -0
- package/dialog/dialog-injectors.d.ts +24 -0
- package/dialog/dialog-module.d.ts +10 -0
- package/dialog/dialog-ref.d.ts +64 -0
- package/dialog/dialog.d.ts +103 -0
- package/dialog/dialog_public_index.d.ts +4 -0
- package/dialog/index.d.ts +8 -0
- package/dialog/package.json +9 -0
- package/dialog/public-api.d.ts +13 -0
- package/drag-drop/directives/drag-handle.d.ts +1 -1
- package/drag-drop/directives/drag-placeholder.d.ts +1 -1
- package/drag-drop/directives/drag-preview.d.ts +1 -1
- package/drag-drop/directives/drag.d.ts +8 -9
- package/drag-drop/directives/drop-list-group.d.ts +1 -1
- package/drag-drop/directives/drop-list.d.ts +1 -1
- package/drag-drop/drag-events.d.ts +8 -0
- package/drag-drop/drag-ref.d.ts +11 -1
- package/drag-drop/drop-list-ref.d.ts +5 -1
- package/drag-drop/parent-position-tracker.d.ts +11 -3
- package/esm2020/a11y/a11y-module.mjs +6 -7
- package/esm2020/a11y/aria-describer/aria-describer.mjs +4 -4
- package/esm2020/a11y/focus-monitor/focus-monitor.mjs +13 -11
- package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
- package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +4 -4
- package/esm2020/a11y/focus-trap/focus-trap.mjs +7 -7
- package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +7 -12
- package/esm2020/a11y/input-modality/input-modality-detector.mjs +4 -4
- package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
- package/esm2020/a11y/live-announcer/live-announcer.mjs +26 -18
- package/esm2020/accordion/accordion-item.mjs +4 -4
- package/esm2020/accordion/accordion-module.mjs +5 -5
- package/esm2020/accordion/accordion.mjs +4 -4
- package/esm2020/bidi/bidi-module.mjs +5 -5
- package/esm2020/bidi/dir.mjs +4 -4
- package/esm2020/bidi/directionality.mjs +4 -4
- package/esm2020/clipboard/clipboard-module.mjs +5 -5
- package/esm2020/clipboard/clipboard.mjs +4 -4
- package/esm2020/clipboard/copy-to-clipboard.mjs +4 -4
- package/esm2020/collections/unique-selection-dispatcher.mjs +4 -4
- package/esm2020/dialog/dialog-config.mjs +58 -0
- package/esm2020/dialog/dialog-container.mjs +265 -0
- package/esm2020/dialog/dialog-injectors.mjs +26 -0
- package/esm2020/dialog/dialog-module.mjs +42 -0
- package/esm2020/dialog/dialog-ref.mjs +76 -0
- package/esm2020/dialog/dialog.mjs +285 -0
- package/esm2020/dialog/dialog_public_index.mjs +5 -0
- package/esm2020/dialog/index.mjs +9 -0
- package/esm2020/dialog/public-api.mjs +14 -0
- package/esm2020/drag-drop/directives/drag-handle.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-placeholder.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-preview.mjs +4 -4
- package/esm2020/drag-drop/directives/drag.mjs +33 -24
- package/esm2020/drag-drop/directives/drop-list-group.mjs +4 -4
- package/esm2020/drag-drop/directives/drop-list.mjs +14 -13
- package/esm2020/drag-drop/drag-drop-module.mjs +5 -5
- package/esm2020/drag-drop/drag-drop-registry.mjs +4 -4
- package/esm2020/drag-drop/drag-drop.mjs +4 -4
- package/esm2020/drag-drop/drag-events.mjs +1 -1
- package/esm2020/drag-drop/drag-ref.mjs +48 -24
- package/esm2020/drag-drop/drop-list-ref.mjs +7 -3
- package/esm2020/drag-drop/parent-position-tracker.mjs +13 -5
- package/esm2020/layout/breakpoints-observer.mjs +4 -4
- package/esm2020/layout/layout-module.mjs +5 -5
- package/esm2020/layout/media-matcher.mjs +4 -4
- package/esm2020/menu/context-menu-trigger.mjs +227 -0
- package/esm2020/menu/index.mjs +9 -0
- package/esm2020/menu/menu-aim.mjs +204 -0
- package/esm2020/menu/menu-bar.mjs +159 -0
- package/esm2020/menu/menu-base.mjs +203 -0
- package/esm2020/menu/menu-errors.mjs +22 -0
- package/esm2020/menu/menu-group.mjs +30 -0
- package/esm2020/menu/menu-interface.mjs +11 -0
- package/esm2020/menu/menu-item-checkbox.mjs +48 -0
- package/esm2020/menu/menu-item-radio.mjs +114 -0
- package/esm2020/menu/menu-item-selectable.mjs +42 -0
- package/esm2020/menu/menu-item.mjs +289 -0
- package/esm2020/menu/menu-module.mjs +62 -0
- package/esm2020/menu/menu-stack.mjs +156 -0
- package/esm2020/menu/menu-trigger-base.mjs +114 -0
- package/esm2020/menu/menu-trigger.mjs +302 -0
- package/esm2020/menu/menu.mjs +168 -0
- package/esm2020/menu/menu_public_index.mjs +5 -0
- package/esm2020/menu/pointer-focus-tracker.mjs +51 -0
- package/esm2020/menu/public-api.mjs +24 -0
- package/esm2020/observers/observe-content.mjs +14 -14
- package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
- package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +26 -8
- package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +33 -12
- package/esm2020/overlay/fullscreen-overlay-container.mjs +4 -4
- package/esm2020/overlay/overlay-container.mjs +4 -4
- package/esm2020/overlay/overlay-directives.mjs +7 -7
- package/esm2020/overlay/overlay-module.mjs +5 -5
- package/esm2020/overlay/overlay-ref.mjs +27 -20
- package/esm2020/overlay/overlay.mjs +14 -8
- package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +13 -1
- package/esm2020/overlay/position/global-position-strategy.mjs +64 -30
- package/esm2020/overlay/position/overlay-position-builder.mjs +4 -4
- package/esm2020/overlay/public-api.mjs +2 -2
- package/esm2020/overlay/scroll/scroll-strategy-options.mjs +4 -4
- package/esm2020/platform/platform-module.mjs +5 -5
- package/esm2020/platform/platform.mjs +4 -4
- package/esm2020/portal/dom-portal-outlet.mjs +29 -5
- package/esm2020/portal/portal-directives.mjs +20 -18
- package/esm2020/portal/portal.mjs +12 -3
- package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +4 -4
- package/esm2020/scrolling/scroll-dispatcher.mjs +4 -4
- package/esm2020/scrolling/scrollable.mjs +4 -4
- package/esm2020/scrolling/scrolling-module.mjs +10 -11
- package/esm2020/scrolling/viewport-ruler.mjs +4 -4
- package/esm2020/scrolling/virtual-for-of.mjs +7 -5
- package/esm2020/scrolling/virtual-scroll-viewport.mjs +8 -6
- package/esm2020/stepper/step-header.mjs +4 -4
- package/esm2020/stepper/step-label.mjs +4 -4
- package/esm2020/stepper/stepper-button.mjs +7 -7
- package/esm2020/stepper/stepper-module.mjs +5 -5
- package/esm2020/stepper/stepper.mjs +9 -22
- package/esm2020/table/cell.mjs +22 -22
- package/esm2020/table/coalesced-style-scheduler.mjs +4 -4
- package/esm2020/table/row.mjs +28 -28
- package/esm2020/table/table-module.mjs +5 -5
- package/esm2020/table/table.mjs +21 -21
- package/esm2020/table/text-column.mjs +5 -5
- package/esm2020/testing/component-harness.mjs +7 -1
- package/esm2020/testing/harness-environment.mjs +12 -1
- package/esm2020/testing/public-api.mjs +2 -1
- package/esm2020/testing/selenium-webdriver/selenium-web-driver-element.mjs +8 -3
- package/esm2020/testing/test-element-errors.mjs +15 -0
- package/esm2020/testing/test-element.mjs +1 -1
- package/esm2020/testing/testbed/fake-events/type-in-element.mjs +13 -4
- package/esm2020/testing/testbed/unit-test-element.mjs +21 -5
- package/esm2020/text-field/autofill.mjs +7 -7
- package/esm2020/text-field/autosize.mjs +4 -4
- package/esm2020/text-field/text-field-module.mjs +5 -7
- package/esm2020/tree/nested-node.mjs +4 -4
- package/esm2020/tree/node.mjs +4 -4
- package/esm2020/tree/outlet.mjs +4 -4
- package/esm2020/tree/padding.mjs +4 -4
- package/esm2020/tree/toggle.mjs +4 -4
- package/esm2020/tree/tree-module.mjs +5 -5
- package/esm2020/tree/tree.mjs +7 -7
- package/esm2020/version.mjs +1 -1
- package/fesm2015/a11y.mjs +71 -66
- package/fesm2015/a11y.mjs.map +1 -1
- package/fesm2015/accordion.mjs +10 -10
- package/fesm2015/accordion.mjs.map +1 -1
- package/fesm2015/bidi.mjs +10 -10
- package/fesm2015/bidi.mjs.map +1 -1
- package/fesm2015/cdk.mjs +1 -1
- package/fesm2015/cdk.mjs.map +1 -1
- package/fesm2015/clipboard.mjs +10 -10
- package/fesm2015/clipboard.mjs.map +1 -1
- package/fesm2015/coercion.mjs.map +1 -1
- package/fesm2015/collections.mjs +3 -3
- package/fesm2015/collections.mjs.map +1 -1
- package/fesm2015/dialog.mjs +749 -0
- package/fesm2015/dialog.mjs.map +1 -0
- package/fesm2015/drag-drop.mjs +133 -86
- package/fesm2015/drag-drop.mjs.map +1 -1
- package/fesm2015/keycodes.mjs.map +1 -1
- package/fesm2015/layout.mjs +10 -10
- package/fesm2015/layout.mjs.map +1 -1
- package/fesm2015/menu.mjs +2131 -0
- package/fesm2015/menu.mjs.map +1 -0
- package/fesm2015/observers.mjs +13 -13
- package/fesm2015/observers.mjs.map +1 -1
- package/fesm2015/overlay.mjs +197 -99
- package/fesm2015/overlay.mjs.map +1 -1
- package/fesm2015/platform.mjs +7 -7
- package/fesm2015/platform.mjs.map +1 -1
- package/fesm2015/portal.mjs +58 -24
- package/fesm2015/portal.mjs.map +1 -1
- package/fesm2015/scrolling.mjs +35 -31
- package/fesm2015/scrolling.mjs.map +1 -1
- package/fesm2015/stepper.mjs +24 -37
- package/fesm2015/stepper.mjs.map +1 -1
- package/fesm2015/table.mjs +79 -79
- package/fesm2015/table.mjs.map +1 -1
- package/fesm2015/testing/selenium-webdriver.mjs +7 -2
- package/fesm2015/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2015/testing/testbed.mjs +32 -8
- package/fesm2015/testing/testbed.mjs.map +1 -1
- package/fesm2015/testing.mjs +39 -1
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/text-field.mjs +14 -15
- package/fesm2015/text-field.mjs.map +1 -1
- package/fesm2015/tree.mjs +25 -25
- package/fesm2015/tree.mjs.map +1 -1
- package/fesm2020/a11y.mjs +70 -65
- package/fesm2020/a11y.mjs.map +1 -1
- package/fesm2020/accordion.mjs +10 -10
- package/fesm2020/accordion.mjs.map +1 -1
- package/fesm2020/bidi.mjs +10 -10
- package/fesm2020/bidi.mjs.map +1 -1
- package/fesm2020/cdk.mjs +1 -1
- package/fesm2020/cdk.mjs.map +1 -1
- package/fesm2020/clipboard.mjs +10 -10
- package/fesm2020/clipboard.mjs.map +1 -1
- package/fesm2020/coercion.mjs.map +1 -1
- package/fesm2020/collections.mjs +3 -3
- package/fesm2020/collections.mjs.map +1 -1
- package/fesm2020/dialog.mjs +753 -0
- package/fesm2020/dialog.mjs.map +1 -0
- package/fesm2020/drag-drop.mjs +132 -86
- package/fesm2020/drag-drop.mjs.map +1 -1
- package/fesm2020/keycodes.mjs.map +1 -1
- package/fesm2020/layout.mjs +10 -10
- package/fesm2020/layout.mjs.map +1 -1
- package/fesm2020/menu.mjs +2104 -0
- package/fesm2020/menu.mjs.map +1 -0
- package/fesm2020/observers.mjs +13 -13
- package/fesm2020/observers.mjs.map +1 -1
- package/fesm2020/overlay.mjs +197 -99
- package/fesm2020/overlay.mjs.map +1 -1
- package/fesm2020/platform.mjs +7 -7
- package/fesm2020/platform.mjs.map +1 -1
- package/fesm2020/portal.mjs +58 -24
- package/fesm2020/portal.mjs.map +1 -1
- package/fesm2020/scrolling.mjs +35 -31
- package/fesm2020/scrolling.mjs.map +1 -1
- package/fesm2020/stepper.mjs +24 -37
- package/fesm2020/stepper.mjs.map +1 -1
- package/fesm2020/table.mjs +79 -79
- package/fesm2020/table.mjs.map +1 -1
- package/fesm2020/testing/selenium-webdriver.mjs +7 -2
- package/fesm2020/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2020/testing/testbed.mjs +32 -8
- package/fesm2020/testing/testbed.mjs.map +1 -1
- package/fesm2020/testing.mjs +33 -1
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/text-field.mjs +14 -15
- package/fesm2020/text-field.mjs.map +1 -1
- package/fesm2020/tree.mjs +25 -25
- package/fesm2020/tree.mjs.map +1 -1
- package/menu/context-menu-trigger.d.ts +98 -0
- package/menu/index.d.ts +8 -0
- package/menu/menu-aim.d.ts +107 -0
- package/menu/menu-bar.d.ts +52 -0
- package/menu/menu-base.d.ts +104 -0
- package/menu/menu-errors.d.ts +17 -0
- package/menu/menu-group.d.ts +8 -0
- package/menu/menu-interface.d.ts +25 -0
- package/menu/menu-item-checkbox.d.ts +18 -0
- package/menu/menu-item-radio.d.ts +59 -0
- package/menu/menu-item-selectable.d.ts +21 -0
- package/menu/menu-item.d.ts +140 -0
- package/menu/menu-module.d.ts +17 -0
- package/menu/menu-stack.d.ts +122 -0
- package/menu/menu-trigger-base.d.ts +77 -0
- package/menu/menu-trigger.d.ts +104 -0
- package/menu/menu.d.ts +60 -0
- package/menu/menu_public_index.d.ts +4 -0
- package/menu/package.json +9 -0
- package/menu/pointer-focus-tracker.d.ts +47 -0
- package/menu/public-api.d.ts +23 -0
- package/observers/observe-content.d.ts +1 -1
- package/overlay/_index.scss +11 -1
- package/overlay/dispatchers/overlay-keyboard-dispatcher.d.ts +7 -2
- package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +8 -2
- package/overlay/overlay-directives.d.ts +2 -2
- package/overlay/overlay-ref.d.ts +4 -1
- package/overlay/overlay.d.ts +3 -2
- package/overlay/position/flexible-connected-position-strategy.d.ts +2 -0
- package/overlay/position/global-position-strategy.d.ts +14 -3
- package/overlay/public-api.d.ts +1 -1
- package/overlay-prebuilt.css +1 -1
- package/package.json +19 -3
- package/portal/dom-portal-outlet.d.ts +17 -6
- package/portal/portal-directives.d.ts +4 -4
- package/portal/portal.d.ts +12 -2
- package/schematics/collection.json +2 -1
- package/schematics/index.js +6 -2
- package/schematics/index.mjs +6 -2
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/drag-drop/index.js +5 -14
- package/schematics/ng-generate/drag-drop/index.mjs +5 -14
- package/schematics/ng-generate/drag-drop/schema.json +1 -1
- package/schematics/ng-update/data/constructor-checks.js +7 -1
- package/schematics/ng-update/data/constructor-checks.mjs +7 -1
- package/schematics/ng-update/data/index.js +6 -2
- package/schematics/ng-update/data/index.mjs +6 -2
- package/schematics/ng-update/devkit-migration-rule.js +5 -14
- package/schematics/ng-update/devkit-migration-rule.mjs +5 -14
- package/schematics/ng-update/devkit-migration.js +1 -1
- package/schematics/ng-update/devkit-migration.mjs +1 -1
- package/schematics/ng-update/html-parsing/elements.js +2 -3
- package/schematics/ng-update/html-parsing/elements.mjs +2 -3
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +7 -2
- package/schematics/ng-update/index.mjs +7 -2
- package/schematics/ng-update/migrations/symbol-removal.js +2 -3
- package/schematics/ng-update/migrations/symbol-removal.mjs +2 -3
- package/schematics/ng-update/public-api.js +6 -2
- package/schematics/ng-update/public-api.mjs +6 -2
- package/schematics/tsconfig.json +2 -10
- package/schematics/update-tool/public-api.js +6 -2
- package/schematics/update-tool/public-api.mjs +6 -2
- package/schematics/update-tool/target-version.d.ts +2 -1
- package/schematics/update-tool/target-version.js +2 -1
- package/schematics/update-tool/target-version.mjs +2 -1
- package/schematics/utils/ast.js +11 -22
- package/schematics/utils/ast.mjs +11 -22
- package/schematics/utils/build-component.js +10 -15
- package/schematics/utils/build-component.mjs +10 -15
- package/schematics/utils/get-project.d.ts +1 -1
- package/schematics/utils/get-project.js +7 -2
- package/schematics/utils/get-project.mjs +7 -2
- package/schematics/utils/index.js +6 -2
- package/schematics/utils/index.mjs +6 -2
- package/schematics/utils/project-index-file.js +2 -2
- package/schematics/utils/project-index-file.mjs +2 -2
- package/schematics/utils/project-targets.js +3 -4
- package/schematics/utils/project-targets.mjs +3 -4
- package/schematics/utils/project-tsconfig-paths.js +16 -28
- package/schematics/utils/project-tsconfig-paths.mjs +16 -28
- package/scrolling/fixed-size-virtual-scroll.d.ts +1 -1
- package/scrolling/scrollable.d.ts +1 -1
- package/scrolling/scrolling-module.d.ts +1 -2
- package/scrolling/virtual-for-of.d.ts +1 -1
- package/scrolling/virtual-scroll-viewport.d.ts +1 -1
- package/stepper/step-header.d.ts +1 -1
- package/stepper/step-label.d.ts +1 -1
- package/stepper/stepper-button.d.ts +2 -2
- package/stepper/stepper.d.ts +5 -14
- package/table/cell.d.ts +7 -7
- package/table/row.d.ts +9 -9
- package/table/table.d.ts +8 -12
- package/table/text-column.d.ts +2 -2
- package/testing/component-harness.d.ts +18 -0
- package/testing/harness-environment.d.ts +2 -0
- package/testing/public-api.d.ts +1 -0
- package/testing/test-element-errors.d.ts +12 -0
- package/testing/test-element.d.ts +4 -2
- package/testing/testbed/fake-events/type-in-element.d.ts +2 -2
- package/testing/testbed/unit-test-element.d.ts +4 -1
- package/text-field/autofill.d.ts +1 -1
- package/text-field/autosize.d.ts +1 -1
- package/text-field/text-field-module.d.ts +1 -2
- package/text-field-prebuilt.css +1 -1
- package/tree/nested-node.d.ts +1 -1
- package/tree/node.d.ts +1 -1
- package/tree/outlet.d.ts +1 -1
- package/tree/padding.d.ts +1 -1
- package/tree/toggle.d.ts +1 -1
- package/tree/tree.d.ts +2 -2
package/fesm2020/drag-drop.mjs
CHANGED
|
@@ -188,9 +188,8 @@ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
|
188
188
|
*/
|
|
189
189
|
/** Keeps track of the scroll position and dimensions of the parents of an element. */
|
|
190
190
|
class ParentPositionTracker {
|
|
191
|
-
constructor(_document
|
|
191
|
+
constructor(_document) {
|
|
192
192
|
this._document = _document;
|
|
193
|
-
this._viewportRuler = _viewportRuler;
|
|
194
193
|
/** Cached positions of the scrollable parent elements. */
|
|
195
194
|
this.positions = new Map();
|
|
196
195
|
}
|
|
@@ -202,7 +201,7 @@ class ParentPositionTracker {
|
|
|
202
201
|
cache(elements) {
|
|
203
202
|
this.clear();
|
|
204
203
|
this.positions.set(this._document, {
|
|
205
|
-
scrollPosition: this.
|
|
204
|
+
scrollPosition: this.getViewportScrollPosition(),
|
|
206
205
|
});
|
|
207
206
|
elements.forEach(element => {
|
|
208
207
|
this.positions.set(element, {
|
|
@@ -222,7 +221,7 @@ class ParentPositionTracker {
|
|
|
222
221
|
let newTop;
|
|
223
222
|
let newLeft;
|
|
224
223
|
if (target === this._document) {
|
|
225
|
-
const viewportScrollPosition = this.
|
|
224
|
+
const viewportScrollPosition = this.getViewportScrollPosition();
|
|
226
225
|
newTop = viewportScrollPosition.top;
|
|
227
226
|
newLeft = viewportScrollPosition.left;
|
|
228
227
|
}
|
|
@@ -243,6 +242,15 @@ class ParentPositionTracker {
|
|
|
243
242
|
scrollPosition.left = newLeft;
|
|
244
243
|
return { top: topDifference, left: leftDifference };
|
|
245
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* Gets the scroll position of the viewport. Note that we use the scrollX and scrollY directly,
|
|
247
|
+
* instead of going through the `ViewportRuler`, because the first value the ruler looks at is
|
|
248
|
+
* the top/left offset of the `document.documentElement` which works for most cases, but breaks
|
|
249
|
+
* if the element is offset by something like the `BlockScrollStrategy`.
|
|
250
|
+
*/
|
|
251
|
+
getViewportScrollPosition() {
|
|
252
|
+
return { top: window.scrollY, left: window.scrollX };
|
|
253
|
+
}
|
|
246
254
|
}
|
|
247
255
|
|
|
248
256
|
/**
|
|
@@ -407,9 +415,7 @@ class DragRef {
|
|
|
407
415
|
this.beforeStarted.next();
|
|
408
416
|
// Delegate the event based on whether it started from a handle or the element itself.
|
|
409
417
|
if (this._handles.length) {
|
|
410
|
-
const targetHandle = this.
|
|
411
|
-
return event.target && (event.target === handle || handle.contains(event.target));
|
|
412
|
-
});
|
|
418
|
+
const targetHandle = this._getTargetHandle(event);
|
|
413
419
|
if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {
|
|
414
420
|
this._initializeDragSequence(targetHandle, event);
|
|
415
421
|
}
|
|
@@ -449,14 +455,6 @@ class DragRef {
|
|
|
449
455
|
}
|
|
450
456
|
return;
|
|
451
457
|
}
|
|
452
|
-
// We only need the preview dimensions if we have a boundary element.
|
|
453
|
-
if (this._boundaryElement) {
|
|
454
|
-
// Cache the preview element rect if we haven't cached it already or if
|
|
455
|
-
// we cached it too early before the element dimensions were computed.
|
|
456
|
-
if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {
|
|
457
|
-
this._previewRect = (this._preview || this._rootElement).getBoundingClientRect();
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
458
|
// We prevent the default action down here so that we know that dragging has started. This is
|
|
461
459
|
// important for touch devices where doing this too early can unnecessarily block scrolling,
|
|
462
460
|
// if there's a dragging delay.
|
|
@@ -495,8 +493,22 @@ class DragRef {
|
|
|
495
493
|
this._pointerUp = (event) => {
|
|
496
494
|
this._endDragSequence(event);
|
|
497
495
|
};
|
|
496
|
+
/** Handles a native `dragstart` event. */
|
|
497
|
+
this._nativeDragStart = (event) => {
|
|
498
|
+
if (this._handles.length) {
|
|
499
|
+
const targetHandle = this._getTargetHandle(event);
|
|
500
|
+
if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {
|
|
501
|
+
event.preventDefault();
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
else if (!this.disabled) {
|
|
505
|
+
// Usually this isn't necessary since the we prevent the default action in `pointerDown`,
|
|
506
|
+
// but some cases like dragging of links can slip through (see #24403).
|
|
507
|
+
event.preventDefault();
|
|
508
|
+
}
|
|
509
|
+
};
|
|
498
510
|
this.withRootElement(element).withParent(_config.parentDragRef || null);
|
|
499
|
-
this._parentPositions = new ParentPositionTracker(_document
|
|
511
|
+
this._parentPositions = new ParentPositionTracker(_document);
|
|
500
512
|
_dragDropRegistry.registerDragItem(this);
|
|
501
513
|
}
|
|
502
514
|
/** Whether starting to drag this element is disabled. */
|
|
@@ -577,6 +589,7 @@ class DragRef {
|
|
|
577
589
|
this._ngZone.runOutsideAngular(() => {
|
|
578
590
|
element.addEventListener('mousedown', this._pointerDown, activeEventListenerOptions);
|
|
579
591
|
element.addEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);
|
|
592
|
+
element.addEventListener('dragstart', this._nativeDragStart, activeEventListenerOptions);
|
|
580
593
|
});
|
|
581
594
|
this._initialTransform = undefined;
|
|
582
595
|
this._rootElement = element;
|
|
@@ -755,7 +768,7 @@ class DragRef {
|
|
|
755
768
|
if (!this._hasStartedDragging) {
|
|
756
769
|
return;
|
|
757
770
|
}
|
|
758
|
-
this.released.next({ source: this });
|
|
771
|
+
this.released.next({ source: this, event });
|
|
759
772
|
if (this._dropContainer) {
|
|
760
773
|
// Stop scrolling immediately, instead of waiting for the animation to finish.
|
|
761
774
|
this._dropContainer._stopScrolling();
|
|
@@ -777,6 +790,7 @@ class DragRef {
|
|
|
777
790
|
source: this,
|
|
778
791
|
distance: this._getDragDistance(pointerPosition),
|
|
779
792
|
dropPoint: pointerPosition,
|
|
793
|
+
event,
|
|
780
794
|
});
|
|
781
795
|
});
|
|
782
796
|
this._cleanupCachedDimensions();
|
|
@@ -811,13 +825,13 @@ class DragRef {
|
|
|
811
825
|
toggleVisibility(element, false, dragImportantProperties);
|
|
812
826
|
this._document.body.appendChild(parent.replaceChild(placeholder, element));
|
|
813
827
|
this._getPreviewInsertionPoint(parent, shadowRoot).appendChild(this._preview);
|
|
814
|
-
this.started.next({ source: this }); // Emit before notifying the container.
|
|
828
|
+
this.started.next({ source: this, event }); // Emit before notifying the container.
|
|
815
829
|
dropContainer.start();
|
|
816
830
|
this._initialContainer = dropContainer;
|
|
817
831
|
this._initialIndex = dropContainer.getItemIndex(this);
|
|
818
832
|
}
|
|
819
833
|
else {
|
|
820
|
-
this.started.next({ source: this });
|
|
834
|
+
this.started.next({ source: this, event });
|
|
821
835
|
this._initialContainer = this._initialIndex = undefined;
|
|
822
836
|
}
|
|
823
837
|
// Important to run after we've called `start` on the parent container
|
|
@@ -914,7 +928,7 @@ class DragRef {
|
|
|
914
928
|
const pointerPosition = this._getPointerPositionOnPage(event);
|
|
915
929
|
const distance = this._getDragDistance(pointerPosition);
|
|
916
930
|
const isPointerOverContainer = container._isOverContainer(pointerPosition.x, pointerPosition.y);
|
|
917
|
-
this.ended.next({ source: this, distance, dropPoint: pointerPosition });
|
|
931
|
+
this.ended.next({ source: this, distance, dropPoint: pointerPosition, event });
|
|
918
932
|
this.dropped.next({
|
|
919
933
|
item: this,
|
|
920
934
|
currentIndex,
|
|
@@ -924,6 +938,7 @@ class DragRef {
|
|
|
924
938
|
isPointerOverContainer,
|
|
925
939
|
distance,
|
|
926
940
|
dropPoint: pointerPosition,
|
|
941
|
+
event,
|
|
927
942
|
});
|
|
928
943
|
container.drop(this, currentIndex, this._initialIndex, this._initialContainer, isPointerOverContainer, distance, pointerPosition);
|
|
929
944
|
this._dropContainer = this._initialContainer;
|
|
@@ -1081,6 +1096,9 @@ class DragRef {
|
|
|
1081
1096
|
else {
|
|
1082
1097
|
placeholder = deepCloneNode(this._rootElement);
|
|
1083
1098
|
}
|
|
1099
|
+
// Stop pointer events on the preview so the user can't
|
|
1100
|
+
// interact with it while the preview is animating.
|
|
1101
|
+
placeholder.style.pointerEvents = 'none';
|
|
1084
1102
|
placeholder.classList.add('cdk-drag-placeholder');
|
|
1085
1103
|
return placeholder;
|
|
1086
1104
|
}
|
|
@@ -1143,11 +1161,11 @@ class DragRef {
|
|
|
1143
1161
|
if (this._boundaryRect) {
|
|
1144
1162
|
const { x: pickupX, y: pickupY } = this._pickupPositionInElement;
|
|
1145
1163
|
const boundaryRect = this._boundaryRect;
|
|
1146
|
-
const
|
|
1164
|
+
const { width: previewWidth, height: previewHeight } = this._getPreviewRect();
|
|
1147
1165
|
const minY = boundaryRect.top + pickupY;
|
|
1148
|
-
const maxY = boundaryRect.bottom - (
|
|
1166
|
+
const maxY = boundaryRect.bottom - (previewHeight - pickupY);
|
|
1149
1167
|
const minX = boundaryRect.left + pickupX;
|
|
1150
|
-
const maxX = boundaryRect.right - (
|
|
1168
|
+
const maxX = boundaryRect.right - (previewWidth - pickupX);
|
|
1151
1169
|
x = clamp$1(x, minX, maxX);
|
|
1152
1170
|
y = clamp$1(y, minY, maxY);
|
|
1153
1171
|
}
|
|
@@ -1190,6 +1208,7 @@ class DragRef {
|
|
|
1190
1208
|
_removeRootElementListeners(element) {
|
|
1191
1209
|
element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);
|
|
1192
1210
|
element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);
|
|
1211
|
+
element.removeEventListener('dragstart', this._nativeDragStart, activeEventListenerOptions);
|
|
1193
1212
|
}
|
|
1194
1213
|
/**
|
|
1195
1214
|
* Applies a `transform` to the root element, taking into account any existing transforms on it.
|
|
@@ -1326,10 +1345,8 @@ class DragRef {
|
|
|
1326
1345
|
}
|
|
1327
1346
|
/** Gets the scroll position of the viewport. */
|
|
1328
1347
|
_getViewportScrollPosition() {
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
? cachedPosition.scrollPosition
|
|
1332
|
-
: this._viewportRuler.getViewportScrollPosition();
|
|
1348
|
+
return (this._parentPositions.positions.get(this._document)?.scrollPosition ||
|
|
1349
|
+
this._parentPositions.getViewportScrollPosition());
|
|
1333
1350
|
}
|
|
1334
1351
|
/**
|
|
1335
1352
|
* Lazily resolves and returns the shadow root of the element. We do this in a function, rather
|
|
@@ -1363,6 +1380,21 @@ class DragRef {
|
|
|
1363
1380
|
}
|
|
1364
1381
|
return coerceElement(previewContainer);
|
|
1365
1382
|
}
|
|
1383
|
+
/** Lazily resolves and returns the dimensions of the preview. */
|
|
1384
|
+
_getPreviewRect() {
|
|
1385
|
+
// Cache the preview element rect if we haven't cached it already or if
|
|
1386
|
+
// we cached it too early before the element dimensions were computed.
|
|
1387
|
+
if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {
|
|
1388
|
+
this._previewRect = (this._preview || this._rootElement).getBoundingClientRect();
|
|
1389
|
+
}
|
|
1390
|
+
return this._previewRect;
|
|
1391
|
+
}
|
|
1392
|
+
/** Gets a handle that is the target of an event. */
|
|
1393
|
+
_getTargetHandle(event) {
|
|
1394
|
+
return this._handles.find(handle => {
|
|
1395
|
+
return event.target && (event.target === handle || handle.contains(event.target));
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1366
1398
|
}
|
|
1367
1399
|
/**
|
|
1368
1400
|
* Gets a 3d `transform` that can be applied to an element.
|
|
@@ -1583,7 +1615,7 @@ class DropListRef {
|
|
|
1583
1615
|
this._document = _document;
|
|
1584
1616
|
this.withScrollableParents([this.element]);
|
|
1585
1617
|
_dragDropRegistry.registerDropContainer(this);
|
|
1586
|
-
this._parentPositions = new ParentPositionTracker(_document
|
|
1618
|
+
this._parentPositions = new ParentPositionTracker(_document);
|
|
1587
1619
|
}
|
|
1588
1620
|
/** Removes the drop list functionality from the DOM element. */
|
|
1589
1621
|
dispose() {
|
|
@@ -1693,8 +1725,11 @@ class DropListRef {
|
|
|
1693
1725
|
* @param isPointerOverContainer Whether the user's pointer was over the
|
|
1694
1726
|
* container when the item was dropped.
|
|
1695
1727
|
* @param distance Distance the user has dragged since the start of the dragging sequence.
|
|
1728
|
+
* @param event Event that triggered the dropping sequence.
|
|
1729
|
+
*
|
|
1730
|
+
* @breaking-change 15.0.0 `previousIndex` and `event` parameters to become required.
|
|
1696
1731
|
*/
|
|
1697
|
-
drop(item, currentIndex, previousIndex, previousContainer, isPointerOverContainer, distance, dropPoint) {
|
|
1732
|
+
drop(item, currentIndex, previousIndex, previousContainer, isPointerOverContainer, distance, dropPoint, event = {}) {
|
|
1698
1733
|
this._reset();
|
|
1699
1734
|
this.dropped.next({
|
|
1700
1735
|
item,
|
|
@@ -1705,6 +1740,7 @@ class DropListRef {
|
|
|
1705
1740
|
isPointerOverContainer,
|
|
1706
1741
|
distance,
|
|
1707
1742
|
dropPoint,
|
|
1743
|
+
event,
|
|
1708
1744
|
});
|
|
1709
1745
|
}
|
|
1710
1746
|
/**
|
|
@@ -2509,9 +2545,9 @@ class DragDropRegistry {
|
|
|
2509
2545
|
this._globalListeners.clear();
|
|
2510
2546
|
}
|
|
2511
2547
|
}
|
|
2512
|
-
DragDropRegistry.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2513
|
-
DragDropRegistry.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2514
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2548
|
+
DragDropRegistry.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropRegistry, deps: [{ token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2549
|
+
DragDropRegistry.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropRegistry, providedIn: 'root' });
|
|
2550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropRegistry, decorators: [{
|
|
2515
2551
|
type: Injectable,
|
|
2516
2552
|
args: [{ providedIn: 'root' }]
|
|
2517
2553
|
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: undefined, decorators: [{
|
|
@@ -2557,9 +2593,9 @@ class DragDrop {
|
|
|
2557
2593
|
return new DropListRef(element, this._dragDropRegistry, this._document, this._ngZone, this._viewportRuler);
|
|
2558
2594
|
}
|
|
2559
2595
|
}
|
|
2560
|
-
DragDrop.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2561
|
-
DragDrop.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2562
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2596
|
+
DragDrop.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDrop, deps: [{ token: DOCUMENT }, { token: i0.NgZone }, { token: i1.ViewportRuler }, { token: DragDropRegistry }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2597
|
+
DragDrop.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDrop, providedIn: 'root' });
|
|
2598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDrop, decorators: [{
|
|
2563
2599
|
type: Injectable,
|
|
2564
2600
|
args: [{ providedIn: 'root' }]
|
|
2565
2601
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -2626,9 +2662,9 @@ class CdkDropListGroup {
|
|
|
2626
2662
|
this._items.clear();
|
|
2627
2663
|
}
|
|
2628
2664
|
}
|
|
2629
|
-
CdkDropListGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2630
|
-
CdkDropListGroup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2631
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2665
|
+
CdkDropListGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDropListGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2666
|
+
CdkDropListGroup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.14", type: CdkDropListGroup, selector: "[cdkDropListGroup]", inputs: { disabled: ["cdkDropListGroupDisabled", "disabled"] }, providers: [{ provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup }], exportAs: ["cdkDropListGroup"], ngImport: i0 });
|
|
2667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDropListGroup, decorators: [{
|
|
2632
2668
|
type: Directive,
|
|
2633
2669
|
args: [{
|
|
2634
2670
|
selector: '[cdkDropListGroup]',
|
|
@@ -2882,16 +2918,17 @@ class CdkDropList {
|
|
|
2882
2918
|
item: event.item.data,
|
|
2883
2919
|
});
|
|
2884
2920
|
});
|
|
2885
|
-
ref.dropped.subscribe(
|
|
2921
|
+
ref.dropped.subscribe(dropEvent => {
|
|
2886
2922
|
this.dropped.emit({
|
|
2887
|
-
previousIndex:
|
|
2888
|
-
currentIndex:
|
|
2889
|
-
previousContainer:
|
|
2890
|
-
container:
|
|
2891
|
-
item:
|
|
2892
|
-
isPointerOverContainer:
|
|
2893
|
-
distance:
|
|
2894
|
-
dropPoint:
|
|
2923
|
+
previousIndex: dropEvent.previousIndex,
|
|
2924
|
+
currentIndex: dropEvent.currentIndex,
|
|
2925
|
+
previousContainer: dropEvent.previousContainer.data,
|
|
2926
|
+
container: dropEvent.container.data,
|
|
2927
|
+
item: dropEvent.item.data,
|
|
2928
|
+
isPointerOverContainer: dropEvent.isPointerOverContainer,
|
|
2929
|
+
distance: dropEvent.distance,
|
|
2930
|
+
dropPoint: dropEvent.dropPoint,
|
|
2931
|
+
event: dropEvent.event,
|
|
2895
2932
|
});
|
|
2896
2933
|
// Mark for check since all of these events run outside of change
|
|
2897
2934
|
// detection and we're not guaranteed for something else to have triggered it.
|
|
@@ -2916,13 +2953,13 @@ class CdkDropList {
|
|
|
2916
2953
|
}
|
|
2917
2954
|
/** Keeps track of the drop lists that are currently on the page. */
|
|
2918
2955
|
CdkDropList._dropLists = [];
|
|
2919
|
-
CdkDropList.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2920
|
-
CdkDropList.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2956
|
+
CdkDropList.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDropList, deps: [{ token: i0.ElementRef }, { token: DragDrop }, { token: i0.ChangeDetectorRef }, { token: i1.ScrollDispatcher }, { token: i3.Directionality, optional: true }, { token: CDK_DROP_LIST_GROUP, optional: true, skipSelf: true }, { token: CDK_DRAG_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2957
|
+
CdkDropList.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.14", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: { connectedTo: ["cdkDropListConnectedTo", "connectedTo"], data: ["cdkDropListData", "data"], orientation: ["cdkDropListOrientation", "orientation"], id: "id", lockAxis: ["cdkDropListLockAxis", "lockAxis"], disabled: ["cdkDropListDisabled", "disabled"], sortingDisabled: ["cdkDropListSortingDisabled", "sortingDisabled"], enterPredicate: ["cdkDropListEnterPredicate", "enterPredicate"], sortPredicate: ["cdkDropListSortPredicate", "sortPredicate"], autoScrollDisabled: ["cdkDropListAutoScrollDisabled", "autoScrollDisabled"], autoScrollStep: ["cdkDropListAutoScrollStep", "autoScrollStep"] }, outputs: { dropped: "cdkDropListDropped", entered: "cdkDropListEntered", exited: "cdkDropListExited", sorted: "cdkDropListSorted" }, host: { properties: { "attr.id": "id", "class.cdk-drop-list-disabled": "disabled", "class.cdk-drop-list-dragging": "_dropListRef.isDragging()", "class.cdk-drop-list-receiving": "_dropListRef.isReceiving()" }, classAttribute: "cdk-drop-list" }, providers: [
|
|
2921
2958
|
// Prevent child drop lists from picking up the same group as their parent.
|
|
2922
2959
|
{ provide: CDK_DROP_LIST_GROUP, useValue: undefined },
|
|
2923
2960
|
{ provide: CDK_DROP_LIST, useExisting: CdkDropList },
|
|
2924
2961
|
], exportAs: ["cdkDropList"], ngImport: i0 });
|
|
2925
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2962
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDropList, decorators: [{
|
|
2926
2963
|
type: Directive,
|
|
2927
2964
|
args: [{
|
|
2928
2965
|
selector: '[cdkDropList], cdk-drop-list',
|
|
@@ -3037,9 +3074,9 @@ class CdkDragHandle {
|
|
|
3037
3074
|
this._stateChanges.complete();
|
|
3038
3075
|
}
|
|
3039
3076
|
}
|
|
3040
|
-
CdkDragHandle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3041
|
-
CdkDragHandle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
3042
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3077
|
+
CdkDragHandle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDragHandle, deps: [{ token: i0.ElementRef }, { token: CDK_DRAG_PARENT, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3078
|
+
CdkDragHandle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.14", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: { disabled: ["cdkDragHandleDisabled", "disabled"] }, host: { classAttribute: "cdk-drag-handle" }, providers: [{ provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle }], ngImport: i0 });
|
|
3079
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDragHandle, decorators: [{
|
|
3043
3080
|
type: Directive,
|
|
3044
3081
|
args: [{
|
|
3045
3082
|
selector: '[cdkDragHandle]',
|
|
@@ -3082,9 +3119,9 @@ class CdkDragPlaceholder {
|
|
|
3082
3119
|
this.templateRef = templateRef;
|
|
3083
3120
|
}
|
|
3084
3121
|
}
|
|
3085
|
-
CdkDragPlaceholder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3086
|
-
CdkDragPlaceholder.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
3087
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3122
|
+
CdkDragPlaceholder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDragPlaceholder, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3123
|
+
CdkDragPlaceholder.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.14", type: CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: { data: "data" }, providers: [{ provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder }], ngImport: i0 });
|
|
3124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDragPlaceholder, decorators: [{
|
|
3088
3125
|
type: Directive,
|
|
3089
3126
|
args: [{
|
|
3090
3127
|
selector: 'ng-template[cdkDragPlaceholder]',
|
|
@@ -3124,9 +3161,9 @@ class CdkDragPreview {
|
|
|
3124
3161
|
this._matchSize = coerceBooleanProperty(value);
|
|
3125
3162
|
}
|
|
3126
3163
|
}
|
|
3127
|
-
CdkDragPreview.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3128
|
-
CdkDragPreview.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
3129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3164
|
+
CdkDragPreview.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDragPreview, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3165
|
+
CdkDragPreview.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.14", type: CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: { data: "data", matchSize: "matchSize" }, providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }], ngImport: i0 });
|
|
3166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDragPreview, decorators: [{
|
|
3130
3167
|
type: Directive,
|
|
3131
3168
|
args: [{
|
|
3132
3169
|
selector: 'ng-template[cdkDragPreview]',
|
|
@@ -3255,6 +3292,13 @@ class CdkDrag {
|
|
|
3255
3292
|
getFreeDragPosition() {
|
|
3256
3293
|
return this._dragRef.getFreeDragPosition();
|
|
3257
3294
|
}
|
|
3295
|
+
/**
|
|
3296
|
+
* Sets the current position in pixels the draggable outside of a drop container.
|
|
3297
|
+
* @param value New position to be set.
|
|
3298
|
+
*/
|
|
3299
|
+
setFreeDragPosition(value) {
|
|
3300
|
+
this._dragRef.setFreeDragPosition(value);
|
|
3301
|
+
}
|
|
3258
3302
|
ngAfterViewInit() {
|
|
3259
3303
|
// Normally this isn't in the zone, but it can cause major performance regressions for apps
|
|
3260
3304
|
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
@@ -3389,48 +3433,50 @@ class CdkDrag {
|
|
|
3389
3433
|
}
|
|
3390
3434
|
/** Handles the events from the underlying `DragRef`. */
|
|
3391
3435
|
_handleEvents(ref) {
|
|
3392
|
-
ref.started.subscribe(
|
|
3393
|
-
this.started.emit({ source: this });
|
|
3436
|
+
ref.started.subscribe(startEvent => {
|
|
3437
|
+
this.started.emit({ source: this, event: startEvent.event });
|
|
3394
3438
|
// Since all of these events run outside of change detection,
|
|
3395
3439
|
// we need to ensure that everything is marked correctly.
|
|
3396
3440
|
this._changeDetectorRef.markForCheck();
|
|
3397
3441
|
});
|
|
3398
|
-
ref.released.subscribe(
|
|
3399
|
-
this.released.emit({ source: this });
|
|
3442
|
+
ref.released.subscribe(releaseEvent => {
|
|
3443
|
+
this.released.emit({ source: this, event: releaseEvent.event });
|
|
3400
3444
|
});
|
|
3401
|
-
ref.ended.subscribe(
|
|
3445
|
+
ref.ended.subscribe(endEvent => {
|
|
3402
3446
|
this.ended.emit({
|
|
3403
3447
|
source: this,
|
|
3404
|
-
distance:
|
|
3405
|
-
dropPoint:
|
|
3448
|
+
distance: endEvent.distance,
|
|
3449
|
+
dropPoint: endEvent.dropPoint,
|
|
3450
|
+
event: endEvent.event,
|
|
3406
3451
|
});
|
|
3407
3452
|
// Since all of these events run outside of change detection,
|
|
3408
3453
|
// we need to ensure that everything is marked correctly.
|
|
3409
3454
|
this._changeDetectorRef.markForCheck();
|
|
3410
3455
|
});
|
|
3411
|
-
ref.entered.subscribe(
|
|
3456
|
+
ref.entered.subscribe(enterEvent => {
|
|
3412
3457
|
this.entered.emit({
|
|
3413
|
-
container:
|
|
3458
|
+
container: enterEvent.container.data,
|
|
3414
3459
|
item: this,
|
|
3415
|
-
currentIndex:
|
|
3460
|
+
currentIndex: enterEvent.currentIndex,
|
|
3416
3461
|
});
|
|
3417
3462
|
});
|
|
3418
|
-
ref.exited.subscribe(
|
|
3463
|
+
ref.exited.subscribe(exitEvent => {
|
|
3419
3464
|
this.exited.emit({
|
|
3420
|
-
container:
|
|
3465
|
+
container: exitEvent.container.data,
|
|
3421
3466
|
item: this,
|
|
3422
3467
|
});
|
|
3423
3468
|
});
|
|
3424
|
-
ref.dropped.subscribe(
|
|
3469
|
+
ref.dropped.subscribe(dropEvent => {
|
|
3425
3470
|
this.dropped.emit({
|
|
3426
|
-
previousIndex:
|
|
3427
|
-
currentIndex:
|
|
3428
|
-
previousContainer:
|
|
3429
|
-
container:
|
|
3430
|
-
isPointerOverContainer:
|
|
3471
|
+
previousIndex: dropEvent.previousIndex,
|
|
3472
|
+
currentIndex: dropEvent.currentIndex,
|
|
3473
|
+
previousContainer: dropEvent.previousContainer.data,
|
|
3474
|
+
container: dropEvent.container.data,
|
|
3475
|
+
isPointerOverContainer: dropEvent.isPointerOverContainer,
|
|
3431
3476
|
item: this,
|
|
3432
|
-
distance:
|
|
3433
|
-
dropPoint:
|
|
3477
|
+
distance: dropEvent.distance,
|
|
3478
|
+
dropPoint: dropEvent.dropPoint,
|
|
3479
|
+
event: dropEvent.event,
|
|
3434
3480
|
});
|
|
3435
3481
|
});
|
|
3436
3482
|
}
|
|
@@ -3491,9 +3537,9 @@ class CdkDrag {
|
|
|
3491
3537
|
}
|
|
3492
3538
|
}
|
|
3493
3539
|
CdkDrag._dragInstances = [];
|
|
3494
|
-
CdkDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3495
|
-
CdkDrag.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
3496
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3540
|
+
CdkDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDrag, deps: [{ token: i0.ElementRef }, { token: CDK_DROP_LIST, optional: true, skipSelf: true }, { token: DOCUMENT }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: CDK_DRAG_CONFIG, optional: true }, { token: i3.Directionality, optional: true }, { token: DragDrop }, { token: i0.ChangeDetectorRef }, { token: CDK_DRAG_HANDLE, optional: true, self: true }, { token: CDK_DRAG_PARENT, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3541
|
+
CdkDrag.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.14", type: CdkDrag, selector: "[cdkDrag]", inputs: { data: ["cdkDragData", "data"], lockAxis: ["cdkDragLockAxis", "lockAxis"], rootElementSelector: ["cdkDragRootElement", "rootElementSelector"], boundaryElement: ["cdkDragBoundary", "boundaryElement"], dragStartDelay: ["cdkDragStartDelay", "dragStartDelay"], freeDragPosition: ["cdkDragFreeDragPosition", "freeDragPosition"], disabled: ["cdkDragDisabled", "disabled"], constrainPosition: ["cdkDragConstrainPosition", "constrainPosition"], previewClass: ["cdkDragPreviewClass", "previewClass"], previewContainer: ["cdkDragPreviewContainer", "previewContainer"] }, outputs: { started: "cdkDragStarted", released: "cdkDragReleased", ended: "cdkDragEnded", entered: "cdkDragEntered", exited: "cdkDragExited", dropped: "cdkDragDropped", moved: "cdkDragMoved" }, host: { properties: { "class.cdk-drag-disabled": "disabled", "class.cdk-drag-dragging": "_dragRef.isDragging()" }, classAttribute: "cdk-drag" }, providers: [{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }], queries: [{ propertyName: "_previewTemplate", first: true, predicate: CDK_DRAG_PREVIEW, descendants: true }, { propertyName: "_placeholderTemplate", first: true, predicate: CDK_DRAG_PLACEHOLDER, descendants: true }, { propertyName: "_handles", predicate: CDK_DRAG_HANDLE, descendants: true }], exportAs: ["cdkDrag"], usesOnChanges: true, ngImport: i0 });
|
|
3542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDrag, decorators: [{
|
|
3497
3543
|
type: Directive,
|
|
3498
3544
|
args: [{
|
|
3499
3545
|
selector: '[cdkDrag]',
|
|
@@ -3607,8 +3653,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
3607
3653
|
*/
|
|
3608
3654
|
class DragDropModule {
|
|
3609
3655
|
}
|
|
3610
|
-
DragDropModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3611
|
-
DragDropModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
3656
|
+
DragDropModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3657
|
+
DragDropModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropModule, declarations: [CdkDropList,
|
|
3612
3658
|
CdkDropListGroup,
|
|
3613
3659
|
CdkDrag,
|
|
3614
3660
|
CdkDragHandle,
|
|
@@ -3620,8 +3666,8 @@ DragDropModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
|
|
|
3620
3666
|
CdkDragHandle,
|
|
3621
3667
|
CdkDragPreview,
|
|
3622
3668
|
CdkDragPlaceholder] });
|
|
3623
|
-
DragDropModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
3624
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3669
|
+
DragDropModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropModule, providers: [DragDrop], imports: [CdkScrollableModule] });
|
|
3670
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropModule, decorators: [{
|
|
3625
3671
|
type: NgModule,
|
|
3626
3672
|
args: [{
|
|
3627
3673
|
declarations: [
|