ngx-moveable
Version:
An Angular Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.
456 lines (448 loc) • 15.6 kB
JavaScript
import { Injectable, ɵɵdefineInjectable, EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
import { __decorate, __metadata, __extends } from 'tslib';
import Moveable, { METHODS, EVENTS, PROPERTIES } from 'moveable';
import { withMethods } from 'framework-utils';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgxMoveableService = /** @class */ (function () {
function NgxMoveableService() {
}
NgxMoveableService.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NgxMoveableService.ctorParameters = function () { return []; };
/** @nocollapse */ NgxMoveableService.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgxMoveableService_Factory() { return new NgxMoveableService(); }, token: NgxMoveableService, providedIn: "root" });
return NgxMoveableService;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgxMoveableInterface = /** @class */ (function () {
function NgxMoveableInterface() {
}
__decorate([
withMethods(METHODS, { dragStart: 'ngDragStart' }),
__metadata("design:type", Moveable)
], NgxMoveableInterface.prototype, "moveable", void 0);
return NgxMoveableInterface;
}());
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
var NgxMoveableComponent = /** @class */ (function (_super) {
__extends(NgxMoveableComponent, _super);
function NgxMoveableComponent() {
var _this = _super.call(this) || this;
EVENTS.forEach((/**
* @param {?} name
* @return {?}
*/
function (name) {
_this[name] = new EventEmitter();
}));
return _this;
}
/**
* @return {?}
*/
NgxMoveableComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
/** @type {?} */
var options = {};
/** @type {?} */
var events = {};
PROPERTIES.forEach((/**
* @param {?} name
* @return {?}
*/
function (name) {
((/** @type {?} */ (options)))[name] = _this[name];
}));
EVENTS.forEach((/**
* @param {?} name
* @return {?}
*/
function (name) {
events[name] = (/**
* @param {?} e
* @return {?}
*/
function (e) {
_this[name].emit(e);
});
}));
this.moveable = new Moveable(this.container || document.body, options);
this.moveable.on(events);
};
/**
* @param {?} changes
* @return {?}
*/
NgxMoveableComponent.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
/** @type {?} */
var moveable = this.moveable;
if (!moveable) {
return;
}
for (var name_1 in changes) {
var _a = changes[name_1], previousValue = _a.previousValue, currentValue = _a.currentValue;
if (previousValue === currentValue) {
continue;
}
moveable[name_1] = currentValue;
}
};
/**
* @return {?}
*/
NgxMoveableComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.moveable.destroy();
};
NgxMoveableComponent.decorators = [
{ type: Component, args: [{
selector: 'ngx-moveable',
template: ''
}] }
];
/** @nocollapse */
NgxMoveableComponent.ctorParameters = function () { return []; };
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 }]
};
return NgxMoveableComponent;
}(NgxMoveableInterface));
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
*/
var NgxMoveableModule = /** @class */ (function () {
function NgxMoveableModule() {
}
NgxMoveableModule.decorators = [
{ type: NgModule, args: [{
declarations: [NgxMoveableComponent],
imports: [],
exports: [NgxMoveableComponent],
},] }
];
return NgxMoveableModule;
}());
/**
* @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