angular2-signaturepad
Advanced tools
Comparing version 1.0.2 to 1.0.3
83
index.js
@@ -11,5 +11,5 @@ 'use strict'; | ||
}; | ||
const core_1 = require('@angular/core'); | ||
let SignaturePad = class SignaturePad { | ||
constructor(elementRef) { | ||
var core_1 = require('@angular/core'); | ||
var SignaturePad = (function () { | ||
function SignaturePad(elementRef) { | ||
// no op | ||
@@ -20,6 +20,6 @@ this.elementRef = elementRef; | ||
} | ||
ngAfterContentInit() { | ||
let sp = require('signature_pad'); | ||
let canvas = this.elementRef.nativeElement.querySelector('canvas'); | ||
let canvasHeightKey = 'canvasHeight'; | ||
SignaturePad.prototype.ngAfterContentInit = function () { | ||
var sp = require('signature_pad'); | ||
var canvas = this.elementRef.nativeElement.querySelector('canvas'); | ||
var canvasHeightKey = 'canvasHeight'; | ||
if (this.options['canvasHeight']) { | ||
@@ -33,29 +33,29 @@ canvas.height = this.options['canvasHeight']; | ||
this.signaturePad.onEnd = this.onEnd.bind(this); | ||
} | ||
}; | ||
// Returns signature image as data URL (see https://mdn.io/todataurl for the list of possible paramters) | ||
toDataURL() { | ||
SignaturePad.prototype.toDataURL = function () { | ||
return this.signaturePad.toDataURL(); // save image as PNG | ||
} | ||
}; | ||
// Draws signature image from data URL | ||
fromDataURL(dataURL) { | ||
SignaturePad.prototype.fromDataURL = function (dataURL) { | ||
this.signaturePad.fromDataURL(dataURL); | ||
} | ||
}; | ||
// Clears the canvas | ||
clear() { | ||
SignaturePad.prototype.clear = function () { | ||
this.signaturePad.clear(); | ||
} | ||
}; | ||
// Returns true if canvas is empty, otherwise returns false | ||
isEmpty() { | ||
SignaturePad.prototype.isEmpty = function () { | ||
return this.signaturePad.isEmpty(); | ||
} | ||
}; | ||
// Unbinds all event handlers | ||
off() { | ||
SignaturePad.prototype.off = function () { | ||
this.signaturePad.off(); | ||
} | ||
}; | ||
// Rebinds all event handlers | ||
on() { | ||
SignaturePad.prototype.on = function () { | ||
this.signaturePad.on(); | ||
} | ||
}; | ||
// set an option on the signaturePad - e.g. set('minWidth', 50); | ||
set(option, value) { | ||
SignaturePad.prototype.set = function (option, value) { | ||
switch (option) { | ||
@@ -71,25 +71,26 @@ case 'canvasHeight': | ||
} | ||
} | ||
}; | ||
// notify subscribers on signature end | ||
onEnd() { | ||
SignaturePad.prototype.onEnd = function () { | ||
this.onEndEvent.emit(true); | ||
} | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Object) | ||
], SignaturePad.prototype, "options", void 0); | ||
__decorate([ | ||
core_1.Output(), | ||
__metadata('design:type', core_1.EventEmitter) | ||
], SignaturePad.prototype, "onEndEvent", void 0); | ||
SignaturePad = __decorate([ | ||
core_1.Component({ | ||
inputs: ['options'], | ||
template: '<canvas></canvas>', | ||
selector: 'signature-pad', | ||
}), | ||
__metadata('design:paramtypes', [core_1.ElementRef]) | ||
], SignaturePad); | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Object) | ||
], SignaturePad.prototype, "options", void 0); | ||
__decorate([ | ||
core_1.Output(), | ||
__metadata('design:type', core_1.EventEmitter) | ||
], SignaturePad.prototype, "onEndEvent", void 0); | ||
SignaturePad = __decorate([ | ||
core_1.Component({ | ||
inputs: ['options'], | ||
template: '<canvas></canvas>', | ||
selector: 'signature-pad', | ||
}), | ||
__metadata('design:paramtypes', [core_1.ElementRef]) | ||
], SignaturePad); | ||
return SignaturePad; | ||
}()); | ||
exports.SignaturePad = SignaturePad; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "angular2-signaturepad", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Angular2 Component wrapper for szimek / signature_pad", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,3 @@ { | ||
"module": "commonjs", | ||
"target": "ES6", | ||
"target": "ES5", | ||
"emitDecoratorMetadata": true, | ||
@@ -13,3 +13,4 @@ "experimentalDecorators": true, | ||
"files": [ | ||
"index.ts" | ||
"index.ts", | ||
"typings/browser.d.ts" | ||
], | ||
@@ -19,2 +20,3 @@ "exclude": [ | ||
] | ||
} | ||
} | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
62054
14
1397