@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/fesm2015/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;
|
|
@@ -758,7 +771,7 @@ class DragRef {
|
|
|
758
771
|
if (!this._hasStartedDragging) {
|
|
759
772
|
return;
|
|
760
773
|
}
|
|
761
|
-
this.released.next({ source: this });
|
|
774
|
+
this.released.next({ source: this, event });
|
|
762
775
|
if (this._dropContainer) {
|
|
763
776
|
// Stop scrolling immediately, instead of waiting for the animation to finish.
|
|
764
777
|
this._dropContainer._stopScrolling();
|
|
@@ -780,6 +793,7 @@ class DragRef {
|
|
|
780
793
|
source: this,
|
|
781
794
|
distance: this._getDragDistance(pointerPosition),
|
|
782
795
|
dropPoint: pointerPosition,
|
|
796
|
+
event,
|
|
783
797
|
});
|
|
784
798
|
});
|
|
785
799
|
this._cleanupCachedDimensions();
|
|
@@ -814,13 +828,13 @@ class DragRef {
|
|
|
814
828
|
toggleVisibility(element, false, dragImportantProperties);
|
|
815
829
|
this._document.body.appendChild(parent.replaceChild(placeholder, element));
|
|
816
830
|
this._getPreviewInsertionPoint(parent, shadowRoot).appendChild(this._preview);
|
|
817
|
-
this.started.next({ source: this }); // Emit before notifying the container.
|
|
831
|
+
this.started.next({ source: this, event }); // Emit before notifying the container.
|
|
818
832
|
dropContainer.start();
|
|
819
833
|
this._initialContainer = dropContainer;
|
|
820
834
|
this._initialIndex = dropContainer.getItemIndex(this);
|
|
821
835
|
}
|
|
822
836
|
else {
|
|
823
|
-
this.started.next({ source: this });
|
|
837
|
+
this.started.next({ source: this, event });
|
|
824
838
|
this._initialContainer = this._initialIndex = undefined;
|
|
825
839
|
}
|
|
826
840
|
// Important to run after we've called `start` on the parent container
|
|
@@ -917,7 +931,7 @@ class DragRef {
|
|
|
917
931
|
const pointerPosition = this._getPointerPositionOnPage(event);
|
|
918
932
|
const distance = this._getDragDistance(pointerPosition);
|
|
919
933
|
const isPointerOverContainer = container._isOverContainer(pointerPosition.x, pointerPosition.y);
|
|
920
|
-
this.ended.next({ source: this, distance, dropPoint: pointerPosition });
|
|
934
|
+
this.ended.next({ source: this, distance, dropPoint: pointerPosition, event });
|
|
921
935
|
this.dropped.next({
|
|
922
936
|
item: this,
|
|
923
937
|
currentIndex,
|
|
@@ -927,6 +941,7 @@ class DragRef {
|
|
|
927
941
|
isPointerOverContainer,
|
|
928
942
|
distance,
|
|
929
943
|
dropPoint: pointerPosition,
|
|
944
|
+
event,
|
|
930
945
|
});
|
|
931
946
|
container.drop(this, currentIndex, this._initialIndex, this._initialContainer, isPointerOverContainer, distance, pointerPosition);
|
|
932
947
|
this._dropContainer = this._initialContainer;
|
|
@@ -1085,6 +1100,9 @@ class DragRef {
|
|
|
1085
1100
|
else {
|
|
1086
1101
|
placeholder = deepCloneNode(this._rootElement);
|
|
1087
1102
|
}
|
|
1103
|
+
// Stop pointer events on the preview so the user can't
|
|
1104
|
+
// interact with it while the preview is animating.
|
|
1105
|
+
placeholder.style.pointerEvents = 'none';
|
|
1088
1106
|
placeholder.classList.add('cdk-drag-placeholder');
|
|
1089
1107
|
return placeholder;
|
|
1090
1108
|
}
|
|
@@ -1147,11 +1165,11 @@ class DragRef {
|
|
|
1147
1165
|
if (this._boundaryRect) {
|
|
1148
1166
|
const { x: pickupX, y: pickupY } = this._pickupPositionInElement;
|
|
1149
1167
|
const boundaryRect = this._boundaryRect;
|
|
1150
|
-
const
|
|
1168
|
+
const { width: previewWidth, height: previewHeight } = this._getPreviewRect();
|
|
1151
1169
|
const minY = boundaryRect.top + pickupY;
|
|
1152
|
-
const maxY = boundaryRect.bottom - (
|
|
1170
|
+
const maxY = boundaryRect.bottom - (previewHeight - pickupY);
|
|
1153
1171
|
const minX = boundaryRect.left + pickupX;
|
|
1154
|
-
const maxX = boundaryRect.right - (
|
|
1172
|
+
const maxX = boundaryRect.right - (previewWidth - pickupX);
|
|
1155
1173
|
x = clamp$1(x, minX, maxX);
|
|
1156
1174
|
y = clamp$1(y, minY, maxY);
|
|
1157
1175
|
}
|
|
@@ -1194,6 +1212,7 @@ class DragRef {
|
|
|
1194
1212
|
_removeRootElementListeners(element) {
|
|
1195
1213
|
element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);
|
|
1196
1214
|
element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);
|
|
1215
|
+
element.removeEventListener('dragstart', this._nativeDragStart, activeEventListenerOptions);
|
|
1197
1216
|
}
|
|
1198
1217
|
/**
|
|
1199
1218
|
* Applies a `transform` to the root element, taking into account any existing transforms on it.
|
|
@@ -1331,10 +1350,9 @@ class DragRef {
|
|
|
1331
1350
|
}
|
|
1332
1351
|
/** Gets the scroll position of the viewport. */
|
|
1333
1352
|
_getViewportScrollPosition() {
|
|
1334
|
-
|
|
1335
|
-
return
|
|
1336
|
-
|
|
1337
|
-
: this._viewportRuler.getViewportScrollPosition();
|
|
1353
|
+
var _a;
|
|
1354
|
+
return (((_a = this._parentPositions.positions.get(this._document)) === null || _a === void 0 ? void 0 : _a.scrollPosition) ||
|
|
1355
|
+
this._parentPositions.getViewportScrollPosition());
|
|
1338
1356
|
}
|
|
1339
1357
|
/**
|
|
1340
1358
|
* Lazily resolves and returns the shadow root of the element. We do this in a function, rather
|
|
@@ -1368,6 +1386,21 @@ class DragRef {
|
|
|
1368
1386
|
}
|
|
1369
1387
|
return coerceElement(previewContainer);
|
|
1370
1388
|
}
|
|
1389
|
+
/** Lazily resolves and returns the dimensions of the preview. */
|
|
1390
|
+
_getPreviewRect() {
|
|
1391
|
+
// Cache the preview element rect if we haven't cached it already or if
|
|
1392
|
+
// we cached it too early before the element dimensions were computed.
|
|
1393
|
+
if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {
|
|
1394
|
+
this._previewRect = (this._preview || this._rootElement).getBoundingClientRect();
|
|
1395
|
+
}
|
|
1396
|
+
return this._previewRect;
|
|
1397
|
+
}
|
|
1398
|
+
/** Gets a handle that is the target of an event. */
|
|
1399
|
+
_getTargetHandle(event) {
|
|
1400
|
+
return this._handles.find(handle => {
|
|
1401
|
+
return event.target && (event.target === handle || handle.contains(event.target));
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1371
1404
|
}
|
|
1372
1405
|
/**
|
|
1373
1406
|
* Gets a 3d `transform` that can be applied to an element.
|
|
@@ -1588,7 +1621,7 @@ class DropListRef {
|
|
|
1588
1621
|
this._document = _document;
|
|
1589
1622
|
this.withScrollableParents([this.element]);
|
|
1590
1623
|
_dragDropRegistry.registerDropContainer(this);
|
|
1591
|
-
this._parentPositions = new ParentPositionTracker(_document
|
|
1624
|
+
this._parentPositions = new ParentPositionTracker(_document);
|
|
1592
1625
|
}
|
|
1593
1626
|
/** Removes the drop list functionality from the DOM element. */
|
|
1594
1627
|
dispose() {
|
|
@@ -1698,8 +1731,11 @@ class DropListRef {
|
|
|
1698
1731
|
* @param isPointerOverContainer Whether the user's pointer was over the
|
|
1699
1732
|
* container when the item was dropped.
|
|
1700
1733
|
* @param distance Distance the user has dragged since the start of the dragging sequence.
|
|
1734
|
+
* @param event Event that triggered the dropping sequence.
|
|
1735
|
+
*
|
|
1736
|
+
* @breaking-change 15.0.0 `previousIndex` and `event` parameters to become required.
|
|
1701
1737
|
*/
|
|
1702
|
-
drop(item, currentIndex, previousIndex, previousContainer, isPointerOverContainer, distance, dropPoint) {
|
|
1738
|
+
drop(item, currentIndex, previousIndex, previousContainer, isPointerOverContainer, distance, dropPoint, event = {}) {
|
|
1703
1739
|
this._reset();
|
|
1704
1740
|
this.dropped.next({
|
|
1705
1741
|
item,
|
|
@@ -1710,6 +1746,7 @@ class DropListRef {
|
|
|
1710
1746
|
isPointerOverContainer,
|
|
1711
1747
|
distance,
|
|
1712
1748
|
dropPoint,
|
|
1749
|
+
event,
|
|
1713
1750
|
});
|
|
1714
1751
|
}
|
|
1715
1752
|
/**
|
|
@@ -2515,9 +2552,9 @@ class DragDropRegistry {
|
|
|
2515
2552
|
this._globalListeners.clear();
|
|
2516
2553
|
}
|
|
2517
2554
|
}
|
|
2518
|
-
DragDropRegistry.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2519
|
-
DragDropRegistry.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2520
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2555
|
+
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 });
|
|
2556
|
+
DragDropRegistry.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropRegistry, providedIn: 'root' });
|
|
2557
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropRegistry, decorators: [{
|
|
2521
2558
|
type: Injectable,
|
|
2522
2559
|
args: [{ providedIn: 'root' }]
|
|
2523
2560
|
}], ctorParameters: function () {
|
|
@@ -2565,9 +2602,9 @@ class DragDrop {
|
|
|
2565
2602
|
return new DropListRef(element, this._dragDropRegistry, this._document, this._ngZone, this._viewportRuler);
|
|
2566
2603
|
}
|
|
2567
2604
|
}
|
|
2568
|
-
DragDrop.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2569
|
-
DragDrop.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2570
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2605
|
+
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 });
|
|
2606
|
+
DragDrop.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDrop, providedIn: 'root' });
|
|
2607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDrop, decorators: [{
|
|
2571
2608
|
type: Injectable,
|
|
2572
2609
|
args: [{ providedIn: 'root' }]
|
|
2573
2610
|
}], ctorParameters: function () {
|
|
@@ -2628,9 +2665,9 @@ class CdkDropListGroup {
|
|
|
2628
2665
|
this._items.clear();
|
|
2629
2666
|
}
|
|
2630
2667
|
}
|
|
2631
|
-
CdkDropListGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2632
|
-
CdkDropListGroup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2633
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2668
|
+
CdkDropListGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDropListGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2669
|
+
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 });
|
|
2670
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDropListGroup, decorators: [{
|
|
2634
2671
|
type: Directive,
|
|
2635
2672
|
args: [{
|
|
2636
2673
|
selector: '[cdkDropListGroup]',
|
|
@@ -2884,16 +2921,17 @@ class CdkDropList {
|
|
|
2884
2921
|
item: event.item.data,
|
|
2885
2922
|
});
|
|
2886
2923
|
});
|
|
2887
|
-
ref.dropped.subscribe(
|
|
2924
|
+
ref.dropped.subscribe(dropEvent => {
|
|
2888
2925
|
this.dropped.emit({
|
|
2889
|
-
previousIndex:
|
|
2890
|
-
currentIndex:
|
|
2891
|
-
previousContainer:
|
|
2892
|
-
container:
|
|
2893
|
-
item:
|
|
2894
|
-
isPointerOverContainer:
|
|
2895
|
-
distance:
|
|
2896
|
-
dropPoint:
|
|
2926
|
+
previousIndex: dropEvent.previousIndex,
|
|
2927
|
+
currentIndex: dropEvent.currentIndex,
|
|
2928
|
+
previousContainer: dropEvent.previousContainer.data,
|
|
2929
|
+
container: dropEvent.container.data,
|
|
2930
|
+
item: dropEvent.item.data,
|
|
2931
|
+
isPointerOverContainer: dropEvent.isPointerOverContainer,
|
|
2932
|
+
distance: dropEvent.distance,
|
|
2933
|
+
dropPoint: dropEvent.dropPoint,
|
|
2934
|
+
event: dropEvent.event,
|
|
2897
2935
|
});
|
|
2898
2936
|
// Mark for check since all of these events run outside of change
|
|
2899
2937
|
// detection and we're not guaranteed for something else to have triggered it.
|
|
@@ -2918,13 +2956,13 @@ class CdkDropList {
|
|
|
2918
2956
|
}
|
|
2919
2957
|
/** Keeps track of the drop lists that are currently on the page. */
|
|
2920
2958
|
CdkDropList._dropLists = [];
|
|
2921
|
-
CdkDropList.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2922
|
-
CdkDropList.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2959
|
+
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 });
|
|
2960
|
+
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: [
|
|
2923
2961
|
// Prevent child drop lists from picking up the same group as their parent.
|
|
2924
2962
|
{ provide: CDK_DROP_LIST_GROUP, useValue: undefined },
|
|
2925
2963
|
{ provide: CDK_DROP_LIST, useExisting: CdkDropList },
|
|
2926
2964
|
], exportAs: ["cdkDropList"], ngImport: i0 });
|
|
2927
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2965
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDropList, decorators: [{
|
|
2928
2966
|
type: Directive,
|
|
2929
2967
|
args: [{
|
|
2930
2968
|
selector: '[cdkDropList], cdk-drop-list',
|
|
@@ -3041,9 +3079,9 @@ class CdkDragHandle {
|
|
|
3041
3079
|
this._stateChanges.complete();
|
|
3042
3080
|
}
|
|
3043
3081
|
}
|
|
3044
|
-
CdkDragHandle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3045
|
-
CdkDragHandle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
3046
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3082
|
+
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 });
|
|
3083
|
+
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 });
|
|
3084
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDragHandle, decorators: [{
|
|
3047
3085
|
type: Directive,
|
|
3048
3086
|
args: [{
|
|
3049
3087
|
selector: '[cdkDragHandle]',
|
|
@@ -3088,9 +3126,9 @@ class CdkDragPlaceholder {
|
|
|
3088
3126
|
this.templateRef = templateRef;
|
|
3089
3127
|
}
|
|
3090
3128
|
}
|
|
3091
|
-
CdkDragPlaceholder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3092
|
-
CdkDragPlaceholder.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
3093
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3129
|
+
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 });
|
|
3130
|
+
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 });
|
|
3131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDragPlaceholder, decorators: [{
|
|
3094
3132
|
type: Directive,
|
|
3095
3133
|
args: [{
|
|
3096
3134
|
selector: 'ng-template[cdkDragPlaceholder]',
|
|
@@ -3130,9 +3168,9 @@ class CdkDragPreview {
|
|
|
3130
3168
|
this._matchSize = coerceBooleanProperty(value);
|
|
3131
3169
|
}
|
|
3132
3170
|
}
|
|
3133
|
-
CdkDragPreview.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3134
|
-
CdkDragPreview.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
3135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3171
|
+
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 });
|
|
3172
|
+
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 });
|
|
3173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDragPreview, decorators: [{
|
|
3136
3174
|
type: Directive,
|
|
3137
3175
|
args: [{
|
|
3138
3176
|
selector: 'ng-template[cdkDragPreview]',
|
|
@@ -3254,6 +3292,13 @@ class CdkDrag {
|
|
|
3254
3292
|
getFreeDragPosition() {
|
|
3255
3293
|
return this._dragRef.getFreeDragPosition();
|
|
3256
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
|
+
}
|
|
3257
3302
|
ngAfterViewInit() {
|
|
3258
3303
|
// Normally this isn't in the zone, but it can cause major performance regressions for apps
|
|
3259
3304
|
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
@@ -3390,48 +3435,50 @@ class CdkDrag {
|
|
|
3390
3435
|
}
|
|
3391
3436
|
/** Handles the events from the underlying `DragRef`. */
|
|
3392
3437
|
_handleEvents(ref) {
|
|
3393
|
-
ref.started.subscribe(
|
|
3394
|
-
this.started.emit({ source: this });
|
|
3438
|
+
ref.started.subscribe(startEvent => {
|
|
3439
|
+
this.started.emit({ source: this, event: startEvent.event });
|
|
3395
3440
|
// Since all of these events run outside of change detection,
|
|
3396
3441
|
// we need to ensure that everything is marked correctly.
|
|
3397
3442
|
this._changeDetectorRef.markForCheck();
|
|
3398
3443
|
});
|
|
3399
|
-
ref.released.subscribe(
|
|
3400
|
-
this.released.emit({ source: this });
|
|
3444
|
+
ref.released.subscribe(releaseEvent => {
|
|
3445
|
+
this.released.emit({ source: this, event: releaseEvent.event });
|
|
3401
3446
|
});
|
|
3402
|
-
ref.ended.subscribe(
|
|
3447
|
+
ref.ended.subscribe(endEvent => {
|
|
3403
3448
|
this.ended.emit({
|
|
3404
3449
|
source: this,
|
|
3405
|
-
distance:
|
|
3406
|
-
dropPoint:
|
|
3450
|
+
distance: endEvent.distance,
|
|
3451
|
+
dropPoint: endEvent.dropPoint,
|
|
3452
|
+
event: endEvent.event,
|
|
3407
3453
|
});
|
|
3408
3454
|
// Since all of these events run outside of change detection,
|
|
3409
3455
|
// we need to ensure that everything is marked correctly.
|
|
3410
3456
|
this._changeDetectorRef.markForCheck();
|
|
3411
3457
|
});
|
|
3412
|
-
ref.entered.subscribe(
|
|
3458
|
+
ref.entered.subscribe(enterEvent => {
|
|
3413
3459
|
this.entered.emit({
|
|
3414
|
-
container:
|
|
3460
|
+
container: enterEvent.container.data,
|
|
3415
3461
|
item: this,
|
|
3416
|
-
currentIndex:
|
|
3462
|
+
currentIndex: enterEvent.currentIndex,
|
|
3417
3463
|
});
|
|
3418
3464
|
});
|
|
3419
|
-
ref.exited.subscribe(
|
|
3465
|
+
ref.exited.subscribe(exitEvent => {
|
|
3420
3466
|
this.exited.emit({
|
|
3421
|
-
container:
|
|
3467
|
+
container: exitEvent.container.data,
|
|
3422
3468
|
item: this,
|
|
3423
3469
|
});
|
|
3424
3470
|
});
|
|
3425
|
-
ref.dropped.subscribe(
|
|
3471
|
+
ref.dropped.subscribe(dropEvent => {
|
|
3426
3472
|
this.dropped.emit({
|
|
3427
|
-
previousIndex:
|
|
3428
|
-
currentIndex:
|
|
3429
|
-
previousContainer:
|
|
3430
|
-
container:
|
|
3431
|
-
isPointerOverContainer:
|
|
3473
|
+
previousIndex: dropEvent.previousIndex,
|
|
3474
|
+
currentIndex: dropEvent.currentIndex,
|
|
3475
|
+
previousContainer: dropEvent.previousContainer.data,
|
|
3476
|
+
container: dropEvent.container.data,
|
|
3477
|
+
isPointerOverContainer: dropEvent.isPointerOverContainer,
|
|
3432
3478
|
item: this,
|
|
3433
|
-
distance:
|
|
3434
|
-
dropPoint:
|
|
3479
|
+
distance: dropEvent.distance,
|
|
3480
|
+
dropPoint: dropEvent.dropPoint,
|
|
3481
|
+
event: dropEvent.event,
|
|
3435
3482
|
});
|
|
3436
3483
|
});
|
|
3437
3484
|
}
|
|
@@ -3492,9 +3539,9 @@ class CdkDrag {
|
|
|
3492
3539
|
}
|
|
3493
3540
|
}
|
|
3494
3541
|
CdkDrag._dragInstances = [];
|
|
3495
|
-
CdkDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3496
|
-
CdkDrag.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
3497
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3542
|
+
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 });
|
|
3543
|
+
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 });
|
|
3544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: CdkDrag, decorators: [{
|
|
3498
3545
|
type: Directive,
|
|
3499
3546
|
args: [{
|
|
3500
3547
|
selector: '[cdkDrag]',
|
|
@@ -3610,8 +3657,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
3610
3657
|
*/
|
|
3611
3658
|
class DragDropModule {
|
|
3612
3659
|
}
|
|
3613
|
-
DragDropModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3614
|
-
DragDropModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
3660
|
+
DragDropModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3661
|
+
DragDropModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropModule, declarations: [CdkDropList,
|
|
3615
3662
|
CdkDropListGroup,
|
|
3616
3663
|
CdkDrag,
|
|
3617
3664
|
CdkDragHandle,
|
|
@@ -3623,8 +3670,8 @@ DragDropModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
|
|
|
3623
3670
|
CdkDragHandle,
|
|
3624
3671
|
CdkDragPreview,
|
|
3625
3672
|
CdkDragPlaceholder] });
|
|
3626
|
-
DragDropModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
3627
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3673
|
+
DragDropModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropModule, providers: [DragDrop], imports: [CdkScrollableModule] });
|
|
3674
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14", ngImport: i0, type: DragDropModule, decorators: [{
|
|
3628
3675
|
type: NgModule,
|
|
3629
3676
|
args: [{
|
|
3630
3677
|
declarations: [
|