* Sets the draggable items that are a part of this list. * @param items Items that are a part of this list.
(items: DragRef[])
| 331 | * @param items Items that are a part of this list. |
| 332 | */ |
| 333 | withItems(items: DragRef[]): this { |
| 334 | const previousItems = this._draggables; |
| 335 | this._draggables = items; |
| 336 | items.forEach(item => item._withDropContainer(this)); |
| 337 | |
| 338 | if (this.isDragging()) { |
| 339 | const draggedItems = previousItems.filter(item => item.isDragging()); |
| 340 | |
| 341 | // If all of the items being dragged were removed |
| 342 | // from the list, abort the current drag sequence. |
| 343 | if (draggedItems.every(item => items.indexOf(item) === -1)) { |
| 344 | this._reset(); |
| 345 | } else { |
| 346 | this._sortStrategy.withItems(this._draggables); |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | return this; |
| 351 | } |
| 352 | |
| 353 | /** Sets the layout direction of the drop list. */ |
| 354 | withDirection(direction: Direction): this { |
nothing calls this directly
no test coverage detected