@angular/cdk 18.1.0-next.1 → 18.1.0-next.3
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/dialog/index.d.ts +2 -0
- package/drag-drop/index.d.ts +33 -6
- package/esm2022/a11y/a11y-module.mjs +5 -5
- package/esm2022/a11y/aria-describer/aria-describer.mjs +4 -4
- package/esm2022/a11y/focus-monitor/focus-monitor.mjs +7 -7
- package/esm2022/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
- package/esm2022/a11y/focus-trap/focus-trap-manager.mjs +4 -4
- package/esm2022/a11y/focus-trap/focus-trap.mjs +7 -7
- package/esm2022/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +4 -4
- package/esm2022/a11y/input-modality/input-modality-detector.mjs +4 -4
- package/esm2022/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
- package/esm2022/a11y/live-announcer/live-announcer.mjs +7 -7
- package/esm2022/accordion/accordion-item.mjs +4 -4
- package/esm2022/accordion/accordion-module.mjs +5 -5
- package/esm2022/accordion/accordion.mjs +4 -4
- package/esm2022/bidi/bidi-module.mjs +5 -5
- package/esm2022/bidi/dir.mjs +4 -4
- package/esm2022/bidi/directionality.mjs +4 -4
- package/esm2022/clipboard/clipboard-module.mjs +5 -5
- package/esm2022/clipboard/clipboard.mjs +4 -4
- package/esm2022/clipboard/copy-to-clipboard.mjs +4 -4
- package/esm2022/collections/unique-selection-dispatcher.mjs +4 -4
- package/esm2022/dialog/dialog-container.mjs +38 -33
- package/esm2022/dialog/dialog-module.mjs +5 -5
- package/esm2022/dialog/dialog.mjs +4 -4
- package/esm2022/drag-drop/directives/config.mjs +1 -1
- package/esm2022/drag-drop/directives/drag-handle.mjs +4 -4
- package/esm2022/drag-drop/directives/drag-placeholder.mjs +4 -4
- package/esm2022/drag-drop/directives/drag-preview.mjs +4 -4
- package/esm2022/drag-drop/directives/drag.mjs +4 -4
- package/esm2022/drag-drop/directives/drop-list-group.mjs +4 -4
- package/esm2022/drag-drop/directives/drop-list.mjs +14 -4
- package/esm2022/drag-drop/drag-drop-module.mjs +5 -5
- package/esm2022/drag-drop/drag-drop-registry.mjs +7 -7
- package/esm2022/drag-drop/drag-drop.mjs +4 -4
- package/esm2022/drag-drop/drag-ref.mjs +3 -2
- package/esm2022/drag-drop/drop-list-ref.mjs +73 -18
- package/esm2022/drag-drop/sorting/drop-list-sort-strategy.mjs +1 -1
- package/esm2022/drag-drop/sorting/mixed-sort-strategy.mjs +246 -0
- package/esm2022/drag-drop/sorting/single-axis-sort-strategy.mjs +7 -6
- package/esm2022/layout/breakpoints-observer.mjs +4 -4
- package/esm2022/layout/layout-module.mjs +5 -5
- package/esm2022/layout/media-matcher.mjs +4 -4
- package/esm2022/listbox/listbox-module.mjs +5 -5
- package/esm2022/listbox/listbox.mjs +7 -7
- package/esm2022/menu/context-menu-trigger.mjs +7 -7
- package/esm2022/menu/menu-aim.mjs +7 -7
- package/esm2022/menu/menu-bar.mjs +4 -4
- package/esm2022/menu/menu-base.mjs +4 -4
- package/esm2022/menu/menu-group.mjs +4 -4
- package/esm2022/menu/menu-item-checkbox.mjs +4 -4
- package/esm2022/menu/menu-item-radio.mjs +4 -4
- package/esm2022/menu/menu-item-selectable.mjs +4 -4
- package/esm2022/menu/menu-item.mjs +4 -4
- package/esm2022/menu/menu-module.mjs +5 -5
- package/esm2022/menu/menu-stack.mjs +4 -4
- package/esm2022/menu/menu-trigger-base.mjs +4 -4
- package/esm2022/menu/menu-trigger.mjs +4 -4
- package/esm2022/menu/menu.mjs +4 -4
- package/esm2022/observers/observe-content.mjs +14 -14
- package/esm2022/observers/private/shared-resize-observer.mjs +4 -4
- package/esm2022/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
- package/esm2022/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +4 -4
- package/esm2022/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +19 -6
- package/esm2022/overlay/fullscreen-overlay-container.mjs +4 -4
- package/esm2022/overlay/overlay-container.mjs +4 -4
- package/esm2022/overlay/overlay-directives.mjs +7 -7
- package/esm2022/overlay/overlay-module.mjs +5 -5
- package/esm2022/overlay/overlay.mjs +4 -4
- package/esm2022/overlay/position/overlay-position-builder.mjs +4 -4
- package/esm2022/overlay/scroll/scroll-strategy-options.mjs +4 -4
- package/esm2022/platform/platform-module.mjs +5 -5
- package/esm2022/platform/platform.mjs +4 -4
- package/esm2022/portal/portal-directives.mjs +17 -17
- package/esm2022/scrolling/fixed-size-virtual-scroll.mjs +4 -4
- package/esm2022/scrolling/scroll-dispatcher.mjs +4 -4
- package/esm2022/scrolling/scrollable.mjs +4 -4
- package/esm2022/scrolling/scrolling-module.mjs +9 -9
- package/esm2022/scrolling/viewport-ruler.mjs +4 -4
- package/esm2022/scrolling/virtual-for-of.mjs +4 -4
- package/esm2022/scrolling/virtual-scroll-viewport.mjs +4 -4
- package/esm2022/scrolling/virtual-scrollable-element.mjs +4 -4
- package/esm2022/scrolling/virtual-scrollable-window.mjs +4 -4
- package/esm2022/scrolling/virtual-scrollable.mjs +4 -4
- package/esm2022/stepper/step-header.mjs +4 -4
- package/esm2022/stepper/step-label.mjs +4 -4
- package/esm2022/stepper/stepper-button.mjs +7 -7
- package/esm2022/stepper/stepper-module.mjs +5 -5
- package/esm2022/stepper/stepper.mjs +7 -7
- package/esm2022/table/cell.mjs +22 -22
- package/esm2022/table/coalesced-style-scheduler.mjs +4 -4
- package/esm2022/table/row.mjs +28 -28
- package/esm2022/table/table-module.mjs +5 -5
- package/esm2022/table/table.mjs +19 -19
- package/esm2022/table/text-column.mjs +4 -4
- package/esm2022/text-field/autofill.mjs +7 -7
- package/esm2022/text-field/autosize.mjs +4 -4
- package/esm2022/text-field/text-field-module.mjs +5 -5
- package/esm2022/tree/nested-node.mjs +4 -4
- package/esm2022/tree/node.mjs +4 -4
- package/esm2022/tree/outlet.mjs +4 -4
- package/esm2022/tree/padding.mjs +4 -4
- package/esm2022/tree/toggle.mjs +4 -4
- package/esm2022/tree/tree-module.mjs +5 -5
- package/esm2022/tree/tree.mjs +7 -7
- package/esm2022/version.mjs +1 -1
- package/fesm2022/a11y.mjs +40 -40
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +10 -10
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/bidi.mjs +10 -10
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +10 -10
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/collections.mjs +3 -3
- package/fesm2022/collections.mjs.map +1 -1
- package/fesm2022/dialog.mjs +44 -39
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +357 -53
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/layout.mjs +10 -10
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/listbox.mjs +10 -10
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +49 -49
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers/private.mjs +3 -3
- package/fesm2022/observers/private.mjs.map +1 -1
- package/fesm2022/observers.mjs +13 -13
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay.mjs +49 -36
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs +7 -7
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs +16 -16
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +35 -35
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs +22 -22
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +76 -76
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/text-field.mjs +13 -13
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs +25 -25
- package/fesm2022/tree.mjs.map +1 -1
- package/layout/index.d.ts +1 -1
- package/menu/index.d.ts +1 -1
- package/overlay/index.d.ts +2 -2
- package/package.json +1 -1
- package/schematics/ng-add/index.js +3 -3
- package/schematics/ng-add/index.mjs +3 -3
- package/schematics/ng-add/package-config.js +3 -4
- package/schematics/ng-add/package-config.mjs +3 -4
- package/schematics/ng-generate/drag-drop/index.js +2 -2
- package/schematics/ng-generate/drag-drop/index.mjs +2 -2
- package/schematics/ng-update/devkit-migration-rule.js +4 -4
- package/schematics/ng-update/devkit-migration-rule.mjs +4 -4
- package/schematics/ng-update/find-stylesheets.js +2 -3
- package/schematics/ng-update/find-stylesheets.mjs +2 -3
- package/schematics/ng-update/html-parsing/angular.js +5 -6
- package/schematics/ng-update/html-parsing/angular.mjs +5 -6
- package/schematics/ng-update/html-parsing/elements.js +5 -6
- package/schematics/ng-update/html-parsing/elements.mjs +5 -6
- package/schematics/ng-update/index.js +2 -3
- package/schematics/ng-update/index.mjs +2 -3
- package/schematics/ng-update/typescript/base-types.js +2 -3
- package/schematics/ng-update/typescript/base-types.mjs +2 -3
- package/schematics/ng-update/typescript/imports.js +6 -7
- package/schematics/ng-update/typescript/imports.mjs +6 -7
- package/schematics/ng-update/typescript/literal.js +3 -4
- package/schematics/ng-update/typescript/literal.mjs +3 -4
- package/schematics/ng-update/typescript/module-specifiers.js +4 -4
- package/schematics/ng-update/typescript/module-specifiers.mjs +4 -4
- package/schematics/ng-update/upgrade-data.js +3 -3
- package/schematics/ng-update/upgrade-data.mjs +3 -3
- package/schematics/update-tool/target-version.js +3 -3
- package/schematics/update-tool/target-version.mjs +3 -3
- package/schematics/update-tool/utils/decorators.js +3 -4
- package/schematics/update-tool/utils/decorators.mjs +3 -4
- package/schematics/update-tool/utils/diagnostics.js +2 -3
- package/schematics/update-tool/utils/diagnostics.mjs +2 -3
- package/schematics/update-tool/utils/functions.js +2 -3
- package/schematics/update-tool/utils/functions.mjs +2 -3
- package/schematics/update-tool/utils/imports.js +2 -3
- package/schematics/update-tool/utils/imports.mjs +2 -3
- package/schematics/update-tool/utils/line-mappings.js +3 -4
- package/schematics/update-tool/utils/line-mappings.mjs +3 -4
- package/schematics/update-tool/utils/parse-tsconfig.js +3 -3
- package/schematics/update-tool/utils/parse-tsconfig.mjs +3 -3
- package/schematics/update-tool/utils/property-name.js +3 -4
- package/schematics/update-tool/utils/property-name.mjs +3 -4
- package/schematics/update-tool/utils/virtual-host.js +4 -4
- package/schematics/update-tool/utils/virtual-host.mjs +4 -4
- package/schematics/update-tool/version-changes.js +3 -4
- package/schematics/update-tool/version-changes.mjs +3 -4
- package/schematics/utils/ast/ng-module-imports.js +2 -3
- package/schematics/utils/ast/ng-module-imports.mjs +2 -3
- package/schematics/utils/ast.js +5 -6
- package/schematics/utils/ast.mjs +5 -6
- package/schematics/utils/build-component.js +2 -3
- package/schematics/utils/build-component.mjs +2 -3
- package/schematics/utils/get-project.js +2 -3
- package/schematics/utils/get-project.mjs +2 -3
- package/schematics/utils/html-manipulation.js +4 -5
- package/schematics/utils/html-manipulation.mjs +4 -5
- package/schematics/utils/parse5-element.js +2 -3
- package/schematics/utils/parse5-element.mjs +2 -3
- package/schematics/utils/project-index-file.js +2 -3
- package/schematics/utils/project-index-file.mjs +2 -3
- package/schematics/utils/project-main-file.js +2 -3
- package/schematics/utils/project-main-file.mjs +2 -3
- package/schematics/utils/project-style-file.js +2 -3
- package/schematics/utils/project-style-file.mjs +2 -3
- package/schematics/utils/project-targets.js +4 -5
- package/schematics/utils/project-targets.mjs +4 -5
- package/schematics/utils/project-tsconfig-paths.js +3 -4
- package/schematics/utils/project-tsconfig-paths.mjs +3 -4
- package/schematics/utils/schematic-options.js +3 -4
- package/schematics/utils/schematic-options.mjs +3 -4
- package/table/index.d.ts +8 -8
- package/tree/index.d.ts +2 -2
package/fesm2022/drag-drop.mjs
CHANGED
|
@@ -921,7 +921,8 @@ class DragRef {
|
|
|
921
921
|
const element = this._rootElement;
|
|
922
922
|
const parent = element.parentNode;
|
|
923
923
|
const placeholder = (this._placeholder = this._createPlaceholderElement());
|
|
924
|
-
const anchor = (this._anchor =
|
|
924
|
+
const anchor = (this._anchor =
|
|
925
|
+
this._anchor || this._document.createComment(ngDevMode ? 'cdk-drag-anchor' : ''));
|
|
925
926
|
// Insert an anchor node so that we can restore the element's position in the DOM.
|
|
926
927
|
parent.insertBefore(anchor, element);
|
|
927
928
|
// There's no risk of transforms stacking when inside a drop container so
|
|
@@ -1549,8 +1550,7 @@ function clamp(value, max) {
|
|
|
1549
1550
|
* @docs-private
|
|
1550
1551
|
*/
|
|
1551
1552
|
class SingleAxisSortStrategy {
|
|
1552
|
-
constructor(
|
|
1553
|
-
this._element = _element;
|
|
1553
|
+
constructor(_dragDropRegistry) {
|
|
1554
1554
|
this._dragDropRegistry = _dragDropRegistry;
|
|
1555
1555
|
/** Cache of the dimensions of all the items inside the container. */
|
|
1556
1556
|
this._itemPositions = [];
|
|
@@ -1679,7 +1679,7 @@ class SingleAxisSortStrategy {
|
|
|
1679
1679
|
activeDraggables.splice(newIndex, 0, item);
|
|
1680
1680
|
}
|
|
1681
1681
|
else {
|
|
1682
|
-
|
|
1682
|
+
this._element.appendChild(placeholder);
|
|
1683
1683
|
activeDraggables.push(item);
|
|
1684
1684
|
}
|
|
1685
1685
|
// The transform needs to be cleared so it doesn't throw off the measurements.
|
|
@@ -1701,7 +1701,7 @@ class SingleAxisSortStrategy {
|
|
|
1701
1701
|
/** Resets the strategy to its initial state before dragging was started. */
|
|
1702
1702
|
reset() {
|
|
1703
1703
|
// TODO(crisbeto): may have to wait for the animations to finish.
|
|
1704
|
-
this._activeDraggables
|
|
1704
|
+
this._activeDraggables?.forEach(item => {
|
|
1705
1705
|
const rootElement = item.getRootElement();
|
|
1706
1706
|
if (rootElement) {
|
|
1707
1707
|
const initialTransform = this._itemPositions.find(p => p.drag === item)?.initialTransform;
|
|
@@ -1750,6 +1750,9 @@ class SingleAxisSortStrategy {
|
|
|
1750
1750
|
}
|
|
1751
1751
|
});
|
|
1752
1752
|
}
|
|
1753
|
+
withElementContainer(container) {
|
|
1754
|
+
this._element = container;
|
|
1755
|
+
}
|
|
1753
1756
|
/** Refreshes the position cache of the items and sibling containers. */
|
|
1754
1757
|
_cacheItemPositions() {
|
|
1755
1758
|
const isHorizontal = this.orientation === 'horizontal';
|
|
@@ -1873,6 +1876,243 @@ class SingleAxisSortStrategy {
|
|
|
1873
1876
|
}
|
|
1874
1877
|
}
|
|
1875
1878
|
|
|
1879
|
+
/**
|
|
1880
|
+
* Strategy that only supports sorting on a list that might wrap.
|
|
1881
|
+
* Items are reordered by moving their DOM nodes around.
|
|
1882
|
+
* @docs-private
|
|
1883
|
+
*/
|
|
1884
|
+
class MixedSortStrategy {
|
|
1885
|
+
constructor(_document, _dragDropRegistry) {
|
|
1886
|
+
this._document = _document;
|
|
1887
|
+
this._dragDropRegistry = _dragDropRegistry;
|
|
1888
|
+
/**
|
|
1889
|
+
* Keeps track of the item that was last swapped with the dragged item, as well as what direction
|
|
1890
|
+
* the pointer was moving in when the swap occurred and whether the user's pointer continued to
|
|
1891
|
+
* overlap with the swapped item after the swapping occurred.
|
|
1892
|
+
*/
|
|
1893
|
+
this._previousSwap = {
|
|
1894
|
+
drag: null,
|
|
1895
|
+
deltaX: 0,
|
|
1896
|
+
deltaY: 0,
|
|
1897
|
+
overlaps: false,
|
|
1898
|
+
};
|
|
1899
|
+
/**
|
|
1900
|
+
* Keeps track of the relationship between a node and its next sibling. This information
|
|
1901
|
+
* is used to restore the DOM to the order it was in before dragging started.
|
|
1902
|
+
*/
|
|
1903
|
+
this._relatedNodes = [];
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* To be called when the drag sequence starts.
|
|
1907
|
+
* @param items Items that are currently in the list.
|
|
1908
|
+
*/
|
|
1909
|
+
start(items) {
|
|
1910
|
+
const childNodes = this._element.childNodes;
|
|
1911
|
+
this._relatedNodes = [];
|
|
1912
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
1913
|
+
const node = childNodes[i];
|
|
1914
|
+
this._relatedNodes.push([node, node.nextSibling]);
|
|
1915
|
+
}
|
|
1916
|
+
this.withItems(items);
|
|
1917
|
+
}
|
|
1918
|
+
/**
|
|
1919
|
+
* To be called when an item is being sorted.
|
|
1920
|
+
* @param item Item to be sorted.
|
|
1921
|
+
* @param pointerX Position of the item along the X axis.
|
|
1922
|
+
* @param pointerY Position of the item along the Y axis.
|
|
1923
|
+
* @param pointerDelta Direction in which the pointer is moving along each axis.
|
|
1924
|
+
*/
|
|
1925
|
+
sort(item, pointerX, pointerY, pointerDelta) {
|
|
1926
|
+
const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY);
|
|
1927
|
+
const previousSwap = this._previousSwap;
|
|
1928
|
+
if (newIndex === -1 || this._activeItems[newIndex] === item) {
|
|
1929
|
+
return null;
|
|
1930
|
+
}
|
|
1931
|
+
const toSwapWith = this._activeItems[newIndex];
|
|
1932
|
+
// Prevent too many swaps over the same item.
|
|
1933
|
+
if (previousSwap.drag === toSwapWith &&
|
|
1934
|
+
previousSwap.overlaps &&
|
|
1935
|
+
previousSwap.deltaX === pointerDelta.x &&
|
|
1936
|
+
previousSwap.deltaY === pointerDelta.y) {
|
|
1937
|
+
return null;
|
|
1938
|
+
}
|
|
1939
|
+
const previousIndex = this.getItemIndex(item);
|
|
1940
|
+
const current = item.getPlaceholderElement();
|
|
1941
|
+
const overlapElement = toSwapWith.getRootElement();
|
|
1942
|
+
if (newIndex > previousIndex) {
|
|
1943
|
+
overlapElement.after(current);
|
|
1944
|
+
}
|
|
1945
|
+
else {
|
|
1946
|
+
overlapElement.before(current);
|
|
1947
|
+
}
|
|
1948
|
+
moveItemInArray(this._activeItems, previousIndex, newIndex);
|
|
1949
|
+
const newOverlapElement = this._getRootNode().elementFromPoint(pointerX, pointerY);
|
|
1950
|
+
// Note: it's tempting to save the entire `pointerDelta` object here, however that'll
|
|
1951
|
+
// break this functionality, because the same object is passed for all `sort` calls.
|
|
1952
|
+
previousSwap.deltaX = pointerDelta.x;
|
|
1953
|
+
previousSwap.deltaY = pointerDelta.y;
|
|
1954
|
+
previousSwap.drag = toSwapWith;
|
|
1955
|
+
previousSwap.overlaps =
|
|
1956
|
+
overlapElement === newOverlapElement || overlapElement.contains(newOverlapElement);
|
|
1957
|
+
return {
|
|
1958
|
+
previousIndex,
|
|
1959
|
+
currentIndex: newIndex,
|
|
1960
|
+
};
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
* Called when an item is being moved into the container.
|
|
1964
|
+
* @param item Item that was moved into the container.
|
|
1965
|
+
* @param pointerX Position of the item along the X axis.
|
|
1966
|
+
* @param pointerY Position of the item along the Y axis.
|
|
1967
|
+
* @param index Index at which the item entered. If omitted, the container will try to figure it
|
|
1968
|
+
* out automatically.
|
|
1969
|
+
*/
|
|
1970
|
+
enter(item, pointerX, pointerY, index) {
|
|
1971
|
+
let enterIndex = index == null || index < 0
|
|
1972
|
+
? this._getItemIndexFromPointerPosition(item, pointerX, pointerY)
|
|
1973
|
+
: index;
|
|
1974
|
+
// In some cases (e.g. when the container has padding) we might not be able to figure
|
|
1975
|
+
// out which item to insert the dragged item next to, because the pointer didn't overlap
|
|
1976
|
+
// with anything. In that case we find the item that's closest to the pointer.
|
|
1977
|
+
if (enterIndex === -1) {
|
|
1978
|
+
enterIndex = this._getClosestItemIndexToPointer(item, pointerX, pointerY);
|
|
1979
|
+
}
|
|
1980
|
+
const targetItem = this._activeItems[enterIndex];
|
|
1981
|
+
const currentIndex = this._activeItems.indexOf(item);
|
|
1982
|
+
if (currentIndex > -1) {
|
|
1983
|
+
this._activeItems.splice(currentIndex, 1);
|
|
1984
|
+
}
|
|
1985
|
+
if (targetItem && !this._dragDropRegistry.isDragging(targetItem)) {
|
|
1986
|
+
this._activeItems.splice(enterIndex, 0, item);
|
|
1987
|
+
targetItem.getRootElement().before(item.getPlaceholderElement());
|
|
1988
|
+
}
|
|
1989
|
+
else {
|
|
1990
|
+
this._activeItems.push(item);
|
|
1991
|
+
this._element.appendChild(item.getPlaceholderElement());
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
/** Sets the items that are currently part of the list. */
|
|
1995
|
+
withItems(items) {
|
|
1996
|
+
this._activeItems = items.slice();
|
|
1997
|
+
}
|
|
1998
|
+
/** Assigns a sort predicate to the strategy. */
|
|
1999
|
+
withSortPredicate(predicate) {
|
|
2000
|
+
this._sortPredicate = predicate;
|
|
2001
|
+
}
|
|
2002
|
+
/** Resets the strategy to its initial state before dragging was started. */
|
|
2003
|
+
reset() {
|
|
2004
|
+
const root = this._element;
|
|
2005
|
+
const previousSwap = this._previousSwap;
|
|
2006
|
+
// Moving elements around in the DOM can break things like the `@for` loop, because it
|
|
2007
|
+
// uses comment nodes to know where to insert elements. To avoid such issues, we restore
|
|
2008
|
+
// the DOM nodes in the list to their original order when the list is reset.
|
|
2009
|
+
// Note that this could be simpler if we just saved all the nodes, cleared the root
|
|
2010
|
+
// and then appended them in the original order. We don't do it, because it can break
|
|
2011
|
+
// down depending on when the snapshot was taken. E.g. we may end up snapshotting the
|
|
2012
|
+
// placeholder element which is removed after dragging.
|
|
2013
|
+
for (let i = this._relatedNodes.length - 1; i > -1; i--) {
|
|
2014
|
+
const [node, nextSibling] = this._relatedNodes[i];
|
|
2015
|
+
if (node.parentNode === root && node.nextSibling !== nextSibling) {
|
|
2016
|
+
if (nextSibling === null) {
|
|
2017
|
+
root.appendChild(node);
|
|
2018
|
+
}
|
|
2019
|
+
else if (nextSibling.parentNode === root) {
|
|
2020
|
+
root.insertBefore(node, nextSibling);
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
this._relatedNodes = [];
|
|
2025
|
+
this._activeItems = [];
|
|
2026
|
+
previousSwap.drag = null;
|
|
2027
|
+
previousSwap.deltaX = previousSwap.deltaY = 0;
|
|
2028
|
+
previousSwap.overlaps = false;
|
|
2029
|
+
}
|
|
2030
|
+
/**
|
|
2031
|
+
* Gets a snapshot of items currently in the list.
|
|
2032
|
+
* Can include items that we dragged in from another list.
|
|
2033
|
+
*/
|
|
2034
|
+
getActiveItemsSnapshot() {
|
|
2035
|
+
return this._activeItems;
|
|
2036
|
+
}
|
|
2037
|
+
/** Gets the index of a specific item. */
|
|
2038
|
+
getItemIndex(item) {
|
|
2039
|
+
return this._activeItems.indexOf(item);
|
|
2040
|
+
}
|
|
2041
|
+
/** Used to notify the strategy that the scroll position has changed. */
|
|
2042
|
+
updateOnScroll() {
|
|
2043
|
+
this._activeItems.forEach(item => {
|
|
2044
|
+
if (this._dragDropRegistry.isDragging(item)) {
|
|
2045
|
+
// We need to re-sort the item manually, because the pointer move
|
|
2046
|
+
// events won't be dispatched while the user is scrolling.
|
|
2047
|
+
item._sortFromLastPointerPosition();
|
|
2048
|
+
}
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
withElementContainer(container) {
|
|
2052
|
+
if (container !== this._element) {
|
|
2053
|
+
this._element = container;
|
|
2054
|
+
this._rootNode = undefined;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
/**
|
|
2058
|
+
* Gets the index of an item in the drop container, based on the position of the user's pointer.
|
|
2059
|
+
* @param item Item that is being sorted.
|
|
2060
|
+
* @param pointerX Position of the user's pointer along the X axis.
|
|
2061
|
+
* @param pointerY Position of the user's pointer along the Y axis.
|
|
2062
|
+
* @param delta Direction in which the user is moving their pointer.
|
|
2063
|
+
*/
|
|
2064
|
+
_getItemIndexFromPointerPosition(item, pointerX, pointerY) {
|
|
2065
|
+
const elementAtPoint = this._getRootNode().elementFromPoint(Math.floor(pointerX), Math.floor(pointerY));
|
|
2066
|
+
const index = elementAtPoint
|
|
2067
|
+
? this._activeItems.findIndex(item => {
|
|
2068
|
+
const root = item.getRootElement();
|
|
2069
|
+
return elementAtPoint === root || root.contains(elementAtPoint);
|
|
2070
|
+
})
|
|
2071
|
+
: -1;
|
|
2072
|
+
return index === -1 || !this._sortPredicate(index, item) ? -1 : index;
|
|
2073
|
+
}
|
|
2074
|
+
/** Lazily resolves the list's root node. */
|
|
2075
|
+
_getRootNode() {
|
|
2076
|
+
// Resolve the root node lazily to ensure that the drop list is in its final place in the DOM.
|
|
2077
|
+
if (!this._rootNode) {
|
|
2078
|
+
this._rootNode = _getShadowRoot(this._element) || this._document;
|
|
2079
|
+
}
|
|
2080
|
+
return this._rootNode;
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Finds the index of the item that's closest to the item being dragged.
|
|
2084
|
+
* @param item Item being dragged.
|
|
2085
|
+
* @param pointerX Position of the user's pointer along the X axis.
|
|
2086
|
+
* @param pointerY Position of the user's pointer along the Y axis.
|
|
2087
|
+
*/
|
|
2088
|
+
_getClosestItemIndexToPointer(item, pointerX, pointerY) {
|
|
2089
|
+
if (this._activeItems.length === 0) {
|
|
2090
|
+
return -1;
|
|
2091
|
+
}
|
|
2092
|
+
if (this._activeItems.length === 1) {
|
|
2093
|
+
return 0;
|
|
2094
|
+
}
|
|
2095
|
+
let minDistance = Infinity;
|
|
2096
|
+
let minIndex = -1;
|
|
2097
|
+
// Find the Euclidean distance (https://en.wikipedia.org/wiki/Euclidean_distance) between each
|
|
2098
|
+
// item and the pointer, and return the smallest one. Note that this is a bit flawed in that DOM
|
|
2099
|
+
// nodes are rectangles, not points, so we use the top/left coordinates. It should be enough
|
|
2100
|
+
// for our purposes.
|
|
2101
|
+
for (let i = 0; i < this._activeItems.length; i++) {
|
|
2102
|
+
const current = this._activeItems[i];
|
|
2103
|
+
if (current !== item) {
|
|
2104
|
+
const { x, y } = current.getRootElement().getBoundingClientRect();
|
|
2105
|
+
const distance = Math.hypot(pointerX - x, pointerY - y);
|
|
2106
|
+
if (distance < minDistance) {
|
|
2107
|
+
minDistance = distance;
|
|
2108
|
+
minIndex = i;
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
return minIndex;
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
|
|
1876
2116
|
/**
|
|
1877
2117
|
* Proximity, as a ratio to width/height, at which a
|
|
1878
2118
|
* dragged item will affect the drop container.
|
|
@@ -1960,6 +2200,10 @@ class DropListRef {
|
|
|
1960
2200
|
this._stopScrollTimers = new Subject();
|
|
1961
2201
|
/** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */
|
|
1962
2202
|
this._cachedShadowRoot = null;
|
|
2203
|
+
/** Elements that can be scrolled while the user is dragging. */
|
|
2204
|
+
this._scrollableElements = [];
|
|
2205
|
+
/** Direction of the list's layout. */
|
|
2206
|
+
this._direction = 'ltr';
|
|
1963
2207
|
/** Starts the interval that'll auto-scroll the element. */
|
|
1964
2208
|
this._startScrollInterval = () => {
|
|
1965
2209
|
this._stopScrolling();
|
|
@@ -1982,13 +2226,11 @@ class DropListRef {
|
|
|
1982
2226
|
}
|
|
1983
2227
|
});
|
|
1984
2228
|
};
|
|
1985
|
-
this.element = coerceElement(element);
|
|
2229
|
+
const coercedElement = (this.element = coerceElement(element));
|
|
1986
2230
|
this._document = _document;
|
|
1987
|
-
this.
|
|
2231
|
+
this.withOrientation('vertical').withElementContainer(coercedElement);
|
|
1988
2232
|
_dragDropRegistry.registerDropContainer(this);
|
|
1989
2233
|
this._parentPositions = new ParentPositionTracker(_document);
|
|
1990
|
-
this._sortStrategy = new SingleAxisSortStrategy(this.element, _dragDropRegistry);
|
|
1991
|
-
this._sortStrategy.withSortPredicate((index, item) => this.sortPredicate(index, item, this));
|
|
1992
2234
|
}
|
|
1993
2235
|
/** Removes the drop list functionality from the DOM element. */
|
|
1994
2236
|
dispose() {
|
|
@@ -2097,7 +2339,10 @@ class DropListRef {
|
|
|
2097
2339
|
}
|
|
2098
2340
|
/** Sets the layout direction of the drop list. */
|
|
2099
2341
|
withDirection(direction) {
|
|
2100
|
-
this.
|
|
2342
|
+
this._direction = direction;
|
|
2343
|
+
if (this._sortStrategy instanceof SingleAxisSortStrategy) {
|
|
2344
|
+
this._sortStrategy.direction = direction;
|
|
2345
|
+
}
|
|
2101
2346
|
return this;
|
|
2102
2347
|
}
|
|
2103
2348
|
/**
|
|
@@ -2114,9 +2359,17 @@ class DropListRef {
|
|
|
2114
2359
|
* @param orientation New orientation for the container.
|
|
2115
2360
|
*/
|
|
2116
2361
|
withOrientation(orientation) {
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2362
|
+
if (orientation === 'mixed') {
|
|
2363
|
+
this._sortStrategy = new MixedSortStrategy(this._document, this._dragDropRegistry);
|
|
2364
|
+
}
|
|
2365
|
+
else {
|
|
2366
|
+
const strategy = new SingleAxisSortStrategy(this._dragDropRegistry);
|
|
2367
|
+
strategy.direction = this._direction;
|
|
2368
|
+
strategy.orientation = orientation;
|
|
2369
|
+
this._sortStrategy = strategy;
|
|
2370
|
+
}
|
|
2371
|
+
this._sortStrategy.withElementContainer(this._container);
|
|
2372
|
+
this._sortStrategy.withSortPredicate((index, item) => this.sortPredicate(index, item, this));
|
|
2120
2373
|
return this;
|
|
2121
2374
|
}
|
|
2122
2375
|
/**
|
|
@@ -2124,13 +2377,46 @@ class DropListRef {
|
|
|
2124
2377
|
* @param elements Elements that can be scrolled.
|
|
2125
2378
|
*/
|
|
2126
2379
|
withScrollableParents(elements) {
|
|
2127
|
-
const element =
|
|
2380
|
+
const element = this._container;
|
|
2128
2381
|
// We always allow the current element to be scrollable
|
|
2129
2382
|
// so we need to ensure that it's in the array.
|
|
2130
2383
|
this._scrollableElements =
|
|
2131
2384
|
elements.indexOf(element) === -1 ? [element, ...elements] : elements.slice();
|
|
2132
2385
|
return this;
|
|
2133
2386
|
}
|
|
2387
|
+
/**
|
|
2388
|
+
* Configures the drop list so that a different element is used as the container for the
|
|
2389
|
+
* dragged items. This is useful for the cases when one might not have control over the
|
|
2390
|
+
* full DOM that sets up the dragging.
|
|
2391
|
+
* Note that the alternate container needs to be a descendant of the drop list.
|
|
2392
|
+
* @param container New element container to be assigned.
|
|
2393
|
+
*/
|
|
2394
|
+
withElementContainer(container) {
|
|
2395
|
+
if (container === this._container) {
|
|
2396
|
+
return this;
|
|
2397
|
+
}
|
|
2398
|
+
const element = coerceElement(this.element);
|
|
2399
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
2400
|
+
container !== element &&
|
|
2401
|
+
!element.contains(container)) {
|
|
2402
|
+
throw new Error('Invalid DOM structure for drop list. Alternate container element must be a descendant of the drop list.');
|
|
2403
|
+
}
|
|
2404
|
+
const oldContainerIndex = this._scrollableElements.indexOf(this._container);
|
|
2405
|
+
const newContainerIndex = this._scrollableElements.indexOf(container);
|
|
2406
|
+
if (oldContainerIndex > -1) {
|
|
2407
|
+
this._scrollableElements.splice(oldContainerIndex, 1);
|
|
2408
|
+
}
|
|
2409
|
+
if (newContainerIndex > -1) {
|
|
2410
|
+
this._scrollableElements.splice(newContainerIndex, 1);
|
|
2411
|
+
}
|
|
2412
|
+
if (this._sortStrategy) {
|
|
2413
|
+
this._sortStrategy.withElementContainer(container);
|
|
2414
|
+
}
|
|
2415
|
+
this._cachedShadowRoot = null;
|
|
2416
|
+
this._scrollableElements.unshift(container);
|
|
2417
|
+
this._container = container;
|
|
2418
|
+
return this;
|
|
2419
|
+
}
|
|
2134
2420
|
/** Gets the scrollable parents that are registered with this drop container. */
|
|
2135
2421
|
getScrollableParents() {
|
|
2136
2422
|
return this._scrollableElements;
|
|
@@ -2196,7 +2482,7 @@ class DropListRef {
|
|
|
2196
2482
|
return;
|
|
2197
2483
|
}
|
|
2198
2484
|
if (isPointerNearDomRect(position.clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {
|
|
2199
|
-
[verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(element, position.clientRect, this.
|
|
2485
|
+
[verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(element, position.clientRect, this._direction, pointerX, pointerY);
|
|
2200
2486
|
if (verticalScrollDirection || horizontalScrollDirection) {
|
|
2201
2487
|
scrollNode = element;
|
|
2202
2488
|
}
|
|
@@ -2238,9 +2524,19 @@ class DropListRef {
|
|
|
2238
2524
|
}
|
|
2239
2525
|
/** Starts the dragging sequence within the list. */
|
|
2240
2526
|
_draggingStarted() {
|
|
2241
|
-
const styles =
|
|
2527
|
+
const styles = this._container.style;
|
|
2242
2528
|
this.beforeStarted.next();
|
|
2243
2529
|
this._isDragging = true;
|
|
2530
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
2531
|
+
// Prevent the check from running on apps not using an alternate container. Ideally we
|
|
2532
|
+
// would always run it, but introducing it at this stage would be a breaking change.
|
|
2533
|
+
this._container !== coerceElement(this.element)) {
|
|
2534
|
+
for (const drag of this._draggables) {
|
|
2535
|
+
if (!drag.isDragging() && drag.getVisibleElement().parentNode !== this._container) {
|
|
2536
|
+
throw new Error('Invalid DOM structure for drop list. All items must be placed directly inside of the element container.');
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2244
2540
|
// We need to disable scroll snapping while the user is dragging, because it breaks automatic
|
|
2245
2541
|
// scrolling. The browser seems to round the value based on the snapping points which means
|
|
2246
2542
|
// that we can't increment/decrement the scroll position.
|
|
@@ -2253,16 +2549,15 @@ class DropListRef {
|
|
|
2253
2549
|
}
|
|
2254
2550
|
/** Caches the positions of the configured scrollable parents. */
|
|
2255
2551
|
_cacheParentPositions() {
|
|
2256
|
-
const element = coerceElement(this.element);
|
|
2257
2552
|
this._parentPositions.cache(this._scrollableElements);
|
|
2258
2553
|
// The list element is always in the `scrollableElements`
|
|
2259
2554
|
// so we can take advantage of the cached `DOMRect`.
|
|
2260
|
-
this._domRect = this._parentPositions.positions.get(
|
|
2555
|
+
this._domRect = this._parentPositions.positions.get(this._container).clientRect;
|
|
2261
2556
|
}
|
|
2262
2557
|
/** Resets the container to its initial state. */
|
|
2263
2558
|
_reset() {
|
|
2264
2559
|
this._isDragging = false;
|
|
2265
|
-
const styles =
|
|
2560
|
+
const styles = this._container.style;
|
|
2266
2561
|
styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap;
|
|
2267
2562
|
this._siblings.forEach(sibling => sibling._stopReceiving(this));
|
|
2268
2563
|
this._sortStrategy.reset();
|
|
@@ -2306,14 +2601,13 @@ class DropListRef {
|
|
|
2306
2601
|
if (!elementFromPoint) {
|
|
2307
2602
|
return false;
|
|
2308
2603
|
}
|
|
2309
|
-
const nativeElement = coerceElement(this.element);
|
|
2310
2604
|
// The `DOMRect`, that we're using to find the container over which the user is
|
|
2311
2605
|
// hovering, doesn't give us any information on whether the element has been scrolled
|
|
2312
2606
|
// out of the view or whether it's overlapping with other containers. This means that
|
|
2313
2607
|
// we could end up transferring the item into a container that's invisible or is positioned
|
|
2314
2608
|
// below another one. We use the result from `elementFromPoint` to get the top-most element
|
|
2315
2609
|
// at the pointer position and to find whether it's one of the intersecting drop containers.
|
|
2316
|
-
return elementFromPoint ===
|
|
2610
|
+
return elementFromPoint === this._container || this._container.contains(elementFromPoint);
|
|
2317
2611
|
}
|
|
2318
2612
|
/**
|
|
2319
2613
|
* Called by one of the connected drop lists when a dragging sequence has started.
|
|
@@ -2375,7 +2669,7 @@ class DropListRef {
|
|
|
2375
2669
|
*/
|
|
2376
2670
|
_getShadowRoot() {
|
|
2377
2671
|
if (!this._cachedShadowRoot) {
|
|
2378
|
-
const shadowRoot = _getShadowRoot(
|
|
2672
|
+
const shadowRoot = _getShadowRoot(this._container);
|
|
2379
2673
|
this._cachedShadowRoot = (shadowRoot || this._document);
|
|
2380
2674
|
}
|
|
2381
2675
|
return this._cachedShadowRoot;
|
|
@@ -2488,10 +2782,10 @@ const activeApps = new Set();
|
|
|
2488
2782
|
* @docs-private
|
|
2489
2783
|
*/
|
|
2490
2784
|
class _ResetsLoader {
|
|
2491
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
2492
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.
|
|
2785
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: _ResetsLoader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2786
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0-next.1", type: _ResetsLoader, isStandalone: true, selector: "ng-component", host: { attributes: { "cdk-drag-resets-container": "" } }, ngImport: i0, template: '', isInline: true, styles: ["@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit}}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2493
2787
|
}
|
|
2494
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
2788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: _ResetsLoader, decorators: [{
|
|
2495
2789
|
type: Component,
|
|
2496
2790
|
args: [{ standalone: true, encapsulation: ViewEncapsulation.None, template: '', changeDetection: ChangeDetectionStrategy.OnPush, host: { 'cdk-drag-resets-container': '' }, styles: ["@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit}}"] }]
|
|
2497
2791
|
}] });
|
|
@@ -2721,10 +3015,10 @@ class DragDropRegistry {
|
|
|
2721
3015
|
});
|
|
2722
3016
|
}
|
|
2723
3017
|
}
|
|
2724
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
2725
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.
|
|
3018
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDropRegistry, deps: [{ token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3019
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDropRegistry, providedIn: 'root' }); }
|
|
2726
3020
|
}
|
|
2727
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
3021
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDropRegistry, decorators: [{
|
|
2728
3022
|
type: Injectable,
|
|
2729
3023
|
args: [{ providedIn: 'root' }]
|
|
2730
3024
|
}], ctorParameters: () => [{ type: i0.NgZone }, { type: undefined, decorators: [{
|
|
@@ -2762,10 +3056,10 @@ class DragDrop {
|
|
|
2762
3056
|
createDropList(element) {
|
|
2763
3057
|
return new DropListRef(element, this._dragDropRegistry, this._document, this._ngZone, this._viewportRuler);
|
|
2764
3058
|
}
|
|
2765
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
2766
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.
|
|
3059
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDrop, deps: [{ token: DOCUMENT }, { token: i0.NgZone }, { token: i1.ViewportRuler }, { token: DragDropRegistry }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3060
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDrop, providedIn: 'root' }); }
|
|
2767
3061
|
}
|
|
2768
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
3062
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDrop, decorators: [{
|
|
2769
3063
|
type: Injectable,
|
|
2770
3064
|
args: [{ providedIn: 'root' }]
|
|
2771
3065
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
@@ -2823,10 +3117,10 @@ class CdkDragHandle {
|
|
|
2823
3117
|
this._parentDrag?._removeHandle(this);
|
|
2824
3118
|
this._stateChanges.complete();
|
|
2825
3119
|
}
|
|
2826
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
2827
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.
|
|
3120
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDragHandle, deps: [{ token: i0.ElementRef }, { token: CDK_DRAG_PARENT, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3121
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.0-next.1", type: CdkDragHandle, isStandalone: true, selector: "[cdkDragHandle]", inputs: { disabled: ["cdkDragHandleDisabled", "disabled", booleanAttribute] }, host: { classAttribute: "cdk-drag-handle" }, providers: [{ provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle }], ngImport: i0 }); }
|
|
2828
3122
|
}
|
|
2829
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
3123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDragHandle, decorators: [{
|
|
2830
3124
|
type: Directive,
|
|
2831
3125
|
args: [{
|
|
2832
3126
|
selector: '[cdkDragHandle]',
|
|
@@ -3239,10 +3533,10 @@ class CdkDrag {
|
|
|
3239
3533
|
handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);
|
|
3240
3534
|
});
|
|
3241
3535
|
}
|
|
3242
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
3243
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.
|
|
3536
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", 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: i1$1.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 }); }
|
|
3537
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.0-next.1", type: CdkDrag, isStandalone: true, selector: "[cdkDrag]", inputs: { data: ["cdkDragData", "data"], lockAxis: ["cdkDragLockAxis", "lockAxis"], rootElementSelector: ["cdkDragRootElement", "rootElementSelector"], boundaryElement: ["cdkDragBoundary", "boundaryElement"], dragStartDelay: ["cdkDragStartDelay", "dragStartDelay"], freeDragPosition: ["cdkDragFreeDragPosition", "freeDragPosition"], disabled: ["cdkDragDisabled", "disabled", booleanAttribute], 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 }], exportAs: ["cdkDrag"], usesOnChanges: true, ngImport: i0 }); }
|
|
3244
3538
|
}
|
|
3245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
3539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDrag, decorators: [{
|
|
3246
3540
|
type: Directive,
|
|
3247
3541
|
args: [{
|
|
3248
3542
|
selector: '[cdkDrag]',
|
|
@@ -3361,10 +3655,10 @@ class CdkDropListGroup {
|
|
|
3361
3655
|
ngOnDestroy() {
|
|
3362
3656
|
this._items.clear();
|
|
3363
3657
|
}
|
|
3364
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
3365
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.
|
|
3658
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDropListGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3659
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.0-next.1", type: CdkDropListGroup, isStandalone: true, selector: "[cdkDropListGroup]", inputs: { disabled: ["cdkDropListGroupDisabled", "disabled", booleanAttribute] }, providers: [{ provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup }], exportAs: ["cdkDropListGroup"], ngImport: i0 }); }
|
|
3366
3660
|
}
|
|
3367
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
3661
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDropListGroup, decorators: [{
|
|
3368
3662
|
type: Directive,
|
|
3369
3663
|
args: [{
|
|
3370
3664
|
selector: '[cdkDropListGroup]',
|
|
@@ -3539,6 +3833,13 @@ class CdkDropList {
|
|
|
3539
3833
|
// shouldn't be able to change without the drop list being destroyed.
|
|
3540
3834
|
this._scrollableParentsResolved = true;
|
|
3541
3835
|
}
|
|
3836
|
+
if (this.elementContainerSelector) {
|
|
3837
|
+
const container = this.element.nativeElement.querySelector(this.elementContainerSelector);
|
|
3838
|
+
if (!container && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
3839
|
+
throw new Error(`CdkDropList could not find an element container matching the selector "${this.elementContainerSelector}"`);
|
|
3840
|
+
}
|
|
3841
|
+
ref.withElementContainer(container);
|
|
3842
|
+
}
|
|
3542
3843
|
ref.disabled = this.disabled;
|
|
3543
3844
|
ref.lockAxis = this.lockAxis;
|
|
3544
3845
|
ref.sortingDisabled = this.sortingDisabled;
|
|
@@ -3610,14 +3911,14 @@ class CdkDropList {
|
|
|
3610
3911
|
_syncItemsWithRef() {
|
|
3611
3912
|
this._dropListRef.withItems(this.getSortedItems().map(item => item._dragRef));
|
|
3612
3913
|
}
|
|
3613
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
3614
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.
|
|
3914
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDropList, deps: [{ token: i0.ElementRef }, { token: DragDrop }, { token: i0.ChangeDetectorRef }, { token: i1.ScrollDispatcher }, { token: i1$1.Directionality, optional: true }, { token: CDK_DROP_LIST_GROUP, optional: true, skipSelf: true }, { token: CDK_DRAG_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3915
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.0-next.1", type: CdkDropList, isStandalone: true, selector: "[cdkDropList], cdk-drop-list", inputs: { connectedTo: ["cdkDropListConnectedTo", "connectedTo"], data: ["cdkDropListData", "data"], orientation: ["cdkDropListOrientation", "orientation"], id: "id", lockAxis: ["cdkDropListLockAxis", "lockAxis"], disabled: ["cdkDropListDisabled", "disabled", booleanAttribute], sortingDisabled: ["cdkDropListSortingDisabled", "sortingDisabled", booleanAttribute], enterPredicate: ["cdkDropListEnterPredicate", "enterPredicate"], sortPredicate: ["cdkDropListSortPredicate", "sortPredicate"], autoScrollDisabled: ["cdkDropListAutoScrollDisabled", "autoScrollDisabled", booleanAttribute], autoScrollStep: ["cdkDropListAutoScrollStep", "autoScrollStep"], elementContainerSelector: ["cdkDropListElementContainer", "elementContainerSelector"] }, 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: [
|
|
3615
3916
|
// Prevent child drop lists from picking up the same group as their parent.
|
|
3616
3917
|
{ provide: CDK_DROP_LIST_GROUP, useValue: undefined },
|
|
3617
3918
|
{ provide: CDK_DROP_LIST, useExisting: CdkDropList },
|
|
3618
3919
|
], exportAs: ["cdkDropList"], ngImport: i0 }); }
|
|
3619
3920
|
}
|
|
3620
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
3921
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDropList, decorators: [{
|
|
3621
3922
|
type: Directive,
|
|
3622
3923
|
args: [{
|
|
3623
3924
|
selector: '[cdkDropList], cdk-drop-list',
|
|
@@ -3682,6 +3983,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
|
|
|
3682
3983
|
}], autoScrollStep: [{
|
|
3683
3984
|
type: Input,
|
|
3684
3985
|
args: ['cdkDropListAutoScrollStep']
|
|
3986
|
+
}], elementContainerSelector: [{
|
|
3987
|
+
type: Input,
|
|
3988
|
+
args: ['cdkDropListElementContainer']
|
|
3685
3989
|
}], dropped: [{
|
|
3686
3990
|
type: Output,
|
|
3687
3991
|
args: ['cdkDropListDropped']
|
|
@@ -3717,10 +4021,10 @@ class CdkDragPreview {
|
|
|
3717
4021
|
ngOnDestroy() {
|
|
3718
4022
|
this._drag?._resetPreviewTemplate(this);
|
|
3719
4023
|
}
|
|
3720
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
3721
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.
|
|
4024
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDragPreview, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4025
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.0-next.1", type: CdkDragPreview, isStandalone: true, selector: "ng-template[cdkDragPreview]", inputs: { data: "data", matchSize: ["matchSize", "matchSize", booleanAttribute] }, providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }], ngImport: i0 }); }
|
|
3722
4026
|
}
|
|
3723
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
4027
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDragPreview, decorators: [{
|
|
3724
4028
|
type: Directive,
|
|
3725
4029
|
args: [{
|
|
3726
4030
|
selector: 'ng-template[cdkDragPreview]',
|
|
@@ -3753,10 +4057,10 @@ class CdkDragPlaceholder {
|
|
|
3753
4057
|
ngOnDestroy() {
|
|
3754
4058
|
this._drag?._resetPlaceholderTemplate(this);
|
|
3755
4059
|
}
|
|
3756
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
3757
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.
|
|
4060
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDragPlaceholder, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4061
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0-next.1", type: CdkDragPlaceholder, isStandalone: true, selector: "ng-template[cdkDragPlaceholder]", inputs: { data: "data" }, providers: [{ provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder }], ngImport: i0 }); }
|
|
3758
4062
|
}
|
|
3759
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
4063
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: CdkDragPlaceholder, decorators: [{
|
|
3760
4064
|
type: Directive,
|
|
3761
4065
|
args: [{
|
|
3762
4066
|
selector: 'ng-template[cdkDragPlaceholder]',
|
|
@@ -3776,8 +4080,8 @@ const DRAG_DROP_DIRECTIVES = [
|
|
|
3776
4080
|
CdkDragPlaceholder,
|
|
3777
4081
|
];
|
|
3778
4082
|
class DragDropModule {
|
|
3779
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.
|
|
3780
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.
|
|
4083
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDropModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4084
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDropModule, imports: [CdkDropList,
|
|
3781
4085
|
CdkDropListGroup,
|
|
3782
4086
|
CdkDrag,
|
|
3783
4087
|
CdkDragHandle,
|
|
@@ -3788,9 +4092,9 @@ class DragDropModule {
|
|
|
3788
4092
|
CdkDragHandle,
|
|
3789
4093
|
CdkDragPreview,
|
|
3790
4094
|
CdkDragPlaceholder] }); }
|
|
3791
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.
|
|
4095
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDropModule, providers: [DragDrop], imports: [CdkScrollableModule] }); }
|
|
3792
4096
|
}
|
|
3793
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.
|
|
4097
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.1", ngImport: i0, type: DragDropModule, decorators: [{
|
|
3794
4098
|
type: NgModule,
|
|
3795
4099
|
args: [{
|
|
3796
4100
|
imports: DRAG_DROP_DIRECTIVES,
|