@angular/cdk/drag-drop#DragRef TypeScript Examples

The following examples show how to use @angular/cdk/drag-drop#DragRef. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: modal-drag.service.ts    From ng-ant-admin with MIT License 6 votes vote down vote up
/**
   * 创建拖拽手柄
   * @param wrapCls 类名
   * @param nzModalType 对话框类型
   */
  createDragHandler<T = NzSafeAny>(wrapCls: string, nzModalType?: ModalTypes): DragRef<T> {
    const wrapElement = document.querySelector<HTMLDivElement>(`.${wrapCls}`)!;
    const rootElement = wrapElement.querySelector<HTMLDivElement>(`.ant-modal-content`)!;
    const handle =
      nzModalType === 'confirm'
        ? rootElement.querySelector<HTMLDivElement>('.ant-modal-body')!
        : rootElement.querySelector<HTMLDivElement>('.ant-modal-header')!;
    this.fixedWrapElementStyle(wrapElement);
    this.setMaxZIndex(rootElement, wrapElement);
    return this.dragDrop.createDrag(handle).withHandles([handle]).withRootElement(rootElement);
  }
Example #2
Source File: bar-drag.ts    From ngx-gantt with MIT License 5 votes vote down vote up
private barDragRef: DragRef;
Example #3
Source File: bar-drag.ts    From ngx-gantt with MIT License 5 votes vote down vote up
private dragRefs: DragRef[] = [];