UNPKG

ngx-moveable

Version:

An Angular Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.

434 lines (426 loc) 14.2 kB
import { Injectable, ɵɵdefineInjectable, EventEmitter, Component, Input, Output, NgModule } from '@angular/core'; import Moveable, { METHODS, EVENTS, PROPERTIES } from 'moveable'; import { __decorate, __metadata } from 'tslib'; import { withMethods } from 'framework-utils'; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class NgxMoveableService { constructor() { } } NgxMoveableService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ NgxMoveableService.ctorParameters = () => []; /** @nocollapse */ NgxMoveableService.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgxMoveableService_Factory() { return new NgxMoveableService(); }, token: NgxMoveableService, providedIn: "root" }); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class NgxMoveableInterface { } __decorate([ withMethods(METHODS, { dragStart: 'ngDragStart' }), __metadata("design:type", Moveable) ], NgxMoveableInterface.prototype, "moveable", void 0); if (false) { /** * @type {?} * @protected */ NgxMoveableInterface.prototype.moveable; } // WARNING: interface has both a type and a value, skipping emit /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ // @dynamic class NgxMoveableComponent extends NgxMoveableInterface { constructor() { super(); EVENTS.forEach((/** * @param {?} name * @return {?} */ name => { this[name] = new EventEmitter(); })); } /** * @return {?} */ ngOnInit() { /** @type {?} */ const options = {}; /** @type {?} */ const events = {}; PROPERTIES.forEach((/** * @param {?} name * @return {?} */ name => { ((/** @type {?} */ (options)))[name] = this[name]; })); EVENTS.forEach((/** * @param {?} name * @return {?} */ name => { events[name] = (/** * @param {?} e * @return {?} */ e => { this[name].emit(e); }); })); this.moveable = new Moveable(this.container || document.body, options); this.moveable.on(events); } /** * @param {?} changes * @return {?} */ ngOnChanges(changes) { /** @type {?} */ const moveable = this.moveable; if (!moveable) { return; } for (const name in changes) { const { previousValue, currentValue } = changes[name]; if (previousValue === currentValue) { continue; } moveable[name] = currentValue; } } /** * @return {?} */ ngOnDestroy() { this.moveable.destroy(); } } NgxMoveableComponent.decorators = [ { type: Component, args: [{ selector: 'ngx-moveable', template: '' }] } ]; /** @nocollapse */ NgxMoveableComponent.ctorParameters = () => []; NgxMoveableComponent.propDecorators = { draggable: [{ type: Input }], resizable: [{ type: Input }], scalable: [{ type: Input }], rotatable: [{ type: Input }], warpable: [{ type: Input }], pinchable: [{ type: Input }], snappable: [{ type: Input }], origin: [{ type: Input }], target: [{ type: Input }], container: [{ type: Input }], throttleDrag: [{ type: Input }], throttleDragRotate: [{ type: Input }], throttleResize: [{ type: Input }], throttleScale: [{ type: Input }], throttleRotate: [{ type: Input }], keepRatio: [{ type: Input }], edge: [{ type: Input }], pinchThreshold: [{ type: Input }], snapCenter: [{ type: Input }], snapVertical: [{ type: Input }], snapElement: [{ type: Input }], snapHorizontal: [{ type: Input }], snapThreshold: [{ type: Input }], horizontalGuidelines: [{ type: Input }], verticalGuidelines: [{ type: Input }], elementGuidelines: [{ type: Input }], bounds: [{ type: Input }], dragArea: [{ type: Input }], rotationPosition: [{ type: Input }], baseDirection: [{ type: Input }], defaultGroupRotate: [{ type: Input }], ables: [{ type: Input }], className: [{ type: Input }], renderDirections: [{ type: Input }], scrollable: [{ type: Input }], scrollContainer: [{ type: Input }], scrollThreshold: [{ type: Input }], getScrollPosition: [{ type: Input }], rootContainer: [{ type: Input }], zoom: [{ type: Input }], transformOrigin: [{ type: Input }], snapDigit: [{ type: Input }], isDisplaySnapDigit: [{ type: Input }], innerBounds: [{ type: Input }], triggerAblesSimultaneously: [{ type: Input }], snapGap: [{ type: Input }], pinchOutside: [{ type: Input }], padding: [{ type: Input }], snapDistFormat: [{ type: Input }], dragTarget: [{ type: Input }], dragStart: [{ type: Output }], drag: [{ type: Output }], dragEnd: [{ type: Output }], dragGroupStart: [{ type: Output }], dragGroup: [{ type: Output }], dragGroupEnd: [{ type: Output }], resizeStart: [{ type: Output }], resize: [{ type: Output }], resizeEnd: [{ type: Output }], resizeGroupStart: [{ type: Output }], resizeGroup: [{ type: Output }], resizeGroupEnd: [{ type: Output }], scaleStart: [{ type: Output }], scale: [{ type: Output }], scaleEnd: [{ type: Output }], scaleGroupStart: [{ type: Output }], scaleGroup: [{ type: Output }], scaleGroupEnd: [{ type: Output }], rotateStart: [{ type: Output }], rotate: [{ type: Output }], rotateEnd: [{ type: Output }], rotateGroupStart: [{ type: Output }], rotateGroup: [{ type: Output }], rotateGroupEnd: [{ type: Output }], warpStart: [{ type: Output }], warp: [{ type: Output }], warpEnd: [{ type: Output }], pinchStart: [{ type: Output }], pinch: [{ type: Output }], pinchEnd: [{ type: Output }], pinchGroupStart: [{ type: Output }], pinchGroup: [{ type: Output }], pinchGroupEnd: [{ type: Output }], click: [{ type: Output }], clickGroup: [{ type: Output }], renderStart: [{ type: Output }], render: [{ type: Output }], renderEnd: [{ type: Output }], renderGroupStart: [{ type: Output }], renderGroup: [{ type: Output }], renderGroupEnd: [{ type: Output }], scroll: [{ type: Output }], scrollGroup: [{ type: Output }], snap: [{ type: Output }] }; if (false) { /** @type {?} */ NgxMoveableComponent.prototype.draggable; /** @type {?} */ NgxMoveableComponent.prototype.resizable; /** @type {?} */ NgxMoveableComponent.prototype.scalable; /** @type {?} */ NgxMoveableComponent.prototype.rotatable; /** @type {?} */ NgxMoveableComponent.prototype.warpable; /** @type {?} */ NgxMoveableComponent.prototype.pinchable; /** @type {?} */ NgxMoveableComponent.prototype.snappable; /** @type {?} */ NgxMoveableComponent.prototype.origin; /** @type {?} */ NgxMoveableComponent.prototype.target; /** @type {?} */ NgxMoveableComponent.prototype.container; /** @type {?} */ NgxMoveableComponent.prototype.throttleDrag; /** @type {?} */ NgxMoveableComponent.prototype.throttleDragRotate; /** @type {?} */ NgxMoveableComponent.prototype.throttleResize; /** @type {?} */ NgxMoveableComponent.prototype.throttleScale; /** @type {?} */ NgxMoveableComponent.prototype.throttleRotate; /** @type {?} */ NgxMoveableComponent.prototype.keepRatio; /** @type {?} */ NgxMoveableComponent.prototype.edge; /** @type {?} */ NgxMoveableComponent.prototype.pinchThreshold; /** @type {?} */ NgxMoveableComponent.prototype.snapCenter; /** @type {?} */ NgxMoveableComponent.prototype.snapVertical; /** @type {?} */ NgxMoveableComponent.prototype.snapElement; /** @type {?} */ NgxMoveableComponent.prototype.snapHorizontal; /** @type {?} */ NgxMoveableComponent.prototype.snapThreshold; /** @type {?} */ NgxMoveableComponent.prototype.horizontalGuidelines; /** @type {?} */ NgxMoveableComponent.prototype.verticalGuidelines; /** @type {?} */ NgxMoveableComponent.prototype.elementGuidelines; /** @type {?} */ NgxMoveableComponent.prototype.bounds; /** @type {?} */ NgxMoveableComponent.prototype.dragArea; /** @type {?} */ NgxMoveableComponent.prototype.rotationPosition; /** @type {?} */ NgxMoveableComponent.prototype.baseDirection; /** @type {?} */ NgxMoveableComponent.prototype.defaultGroupRotate; /** @type {?} */ NgxMoveableComponent.prototype.ables; /** @type {?} */ NgxMoveableComponent.prototype.className; /** @type {?} */ NgxMoveableComponent.prototype.renderDirections; /** @type {?} */ NgxMoveableComponent.prototype.scrollable; /** @type {?} */ NgxMoveableComponent.prototype.scrollContainer; /** @type {?} */ NgxMoveableComponent.prototype.scrollThreshold; /** @type {?} */ NgxMoveableComponent.prototype.getScrollPosition; /** @type {?} */ NgxMoveableComponent.prototype.rootContainer; /** @type {?} */ NgxMoveableComponent.prototype.zoom; /** @type {?} */ NgxMoveableComponent.prototype.transformOrigin; /** @type {?} */ NgxMoveableComponent.prototype.snapDigit; /** @type {?} */ NgxMoveableComponent.prototype.isDisplaySnapDigit; /** @type {?} */ NgxMoveableComponent.prototype.innerBounds; /** @type {?} */ NgxMoveableComponent.prototype.triggerAblesSimultaneously; /** @type {?} */ NgxMoveableComponent.prototype.snapGap; /** @type {?} */ NgxMoveableComponent.prototype.pinchOutside; /** @type {?} */ NgxMoveableComponent.prototype.padding; /** @type {?} */ NgxMoveableComponent.prototype.snapDistFormat; /** @type {?} */ NgxMoveableComponent.prototype.dragTarget; /** @type {?} */ NgxMoveableComponent.prototype.dragStart; /** @type {?} */ NgxMoveableComponent.prototype.drag; /** @type {?} */ NgxMoveableComponent.prototype.dragEnd; /** @type {?} */ NgxMoveableComponent.prototype.dragGroupStart; /** @type {?} */ NgxMoveableComponent.prototype.dragGroup; /** @type {?} */ NgxMoveableComponent.prototype.dragGroupEnd; /** @type {?} */ NgxMoveableComponent.prototype.resizeStart; /** @type {?} */ NgxMoveableComponent.prototype.resize; /** @type {?} */ NgxMoveableComponent.prototype.resizeEnd; /** @type {?} */ NgxMoveableComponent.prototype.resizeGroupStart; /** @type {?} */ NgxMoveableComponent.prototype.resizeGroup; /** @type {?} */ NgxMoveableComponent.prototype.resizeGroupEnd; /** @type {?} */ NgxMoveableComponent.prototype.scaleStart; /** @type {?} */ NgxMoveableComponent.prototype.scale; /** @type {?} */ NgxMoveableComponent.prototype.scaleEnd; /** @type {?} */ NgxMoveableComponent.prototype.scaleGroupStart; /** @type {?} */ NgxMoveableComponent.prototype.scaleGroup; /** @type {?} */ NgxMoveableComponent.prototype.scaleGroupEnd; /** @type {?} */ NgxMoveableComponent.prototype.rotateStart; /** @type {?} */ NgxMoveableComponent.prototype.rotate; /** @type {?} */ NgxMoveableComponent.prototype.rotateEnd; /** @type {?} */ NgxMoveableComponent.prototype.rotateGroupStart; /** @type {?} */ NgxMoveableComponent.prototype.rotateGroup; /** @type {?} */ NgxMoveableComponent.prototype.rotateGroupEnd; /** @type {?} */ NgxMoveableComponent.prototype.warpStart; /** @type {?} */ NgxMoveableComponent.prototype.warp; /** @type {?} */ NgxMoveableComponent.prototype.warpEnd; /** @type {?} */ NgxMoveableComponent.prototype.pinchStart; /** @type {?} */ NgxMoveableComponent.prototype.pinch; /** @type {?} */ NgxMoveableComponent.prototype.pinchEnd; /** @type {?} */ NgxMoveableComponent.prototype.pinchGroupStart; /** @type {?} */ NgxMoveableComponent.prototype.pinchGroup; /** @type {?} */ NgxMoveableComponent.prototype.pinchGroupEnd; /** @type {?} */ NgxMoveableComponent.prototype.click; /** @type {?} */ NgxMoveableComponent.prototype.clickGroup; /** @type {?} */ NgxMoveableComponent.prototype.renderStart; /** @type {?} */ NgxMoveableComponent.prototype.render; /** @type {?} */ NgxMoveableComponent.prototype.renderEnd; /** @type {?} */ NgxMoveableComponent.prototype.renderGroupStart; /** @type {?} */ NgxMoveableComponent.prototype.renderGroup; /** @type {?} */ NgxMoveableComponent.prototype.renderGroupEnd; /** @type {?} */ NgxMoveableComponent.prototype.scroll; /** @type {?} */ NgxMoveableComponent.prototype.scrollGroup; /** @type {?} */ NgxMoveableComponent.prototype.snap; } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class NgxMoveableModule { } NgxMoveableModule.decorators = [ { type: NgModule, args: [{ declarations: [NgxMoveableComponent], imports: [], exports: [NgxMoveableComponent], },] } ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { NgxMoveableComponent, NgxMoveableModule, NgxMoveableService, NgxMoveableInterface as ɵa }; //# sourceMappingURL=ngx-moveable.js.map