/** * @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'; import * as i0 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 { /** 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); } constructor(templateRef) { this.templateRef = templateRef; this._matchSize = false; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkDragPreview, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: CdkDragPreview, isStandalone: true, selector: "ng-template[cdkDragPreview]", inputs: { data: "data", matchSize: "matchSize" }, providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }], ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkDragPreview, decorators: [{ type: Directive, args: [{ selector: 'ng-template[cdkDragPreview]', standalone: true, providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }], }] }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { data: [{ type: Input }], matchSize: [{ type: Input }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJhZy1wcmV2aWV3LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi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