/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { Directive, InjectionToken, Input, TemplateRef } from '@angular/core'; /** * Injection token that can be used to reference instances of `CdkDragPreview`. It serves as * alternative token to the actual `CdkDragPreview` class which could cause unnecessary * retention of the class and its directive metadata. */ export const CDK_DRAG_PREVIEW = new InjectionToken('CdkDragPreview'); /** * Element that will be used as a template for the preview * of a CdkDrag when it is being dragged. */ export class CdkDragPreview { constructor(templateRef) { this.templateRef = templateRef; this._matchSize = false; } /** Whether the preview should preserve the same size as the item that is being dragged. */ get matchSize() { return this._matchSize; } set matchSize(value) { this._matchSize = coerceBooleanProperty(value); } } CdkDragPreview.decorators = [ { type: Directive, args: [{ selector: 'ng-template[cdkDragPreview]', providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }], },] } ]; CdkDragPreview.ctorParameters = () => [ { type: TemplateRef } ]; CdkDragPreview.propDecorators = { data: [{ type: Input }], matchSize: [{ type: Input }] }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJhZy1wcmV2aWV3LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2Nkay9kcmFnLWRyb3AvZGlyZWN0aXZlcy9kcmFnLXByZXZpZXcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFlLHFCQUFxQixFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFDMUUsT0FBTyxFQUFDLFNBQVMsRUFBRSxjQUFjLEVBQUUsS0FBSyxFQUFFLFdBQVcsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUU1RTs7OztHQUlHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsSUFBSSx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