Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular2-signaturepad

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-signaturepad - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

typings.json

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc