idmission-web-sdk 2.2.141 → 2.2.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk2.cjs.development.js +7 -4
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +7 -4
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +265 -247
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +5 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('tus-js-client'), require('react-dom'), require('prop-types')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'tus-js-client', 'react-dom', 'prop-types'], factory) :
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.tusJsClient, global.ReactDOM, global.PropTypes));
|
|
5
|
-
})(this, (function (exports, React, ReactDOM, platform, styled, tusJsClient, reactDom,
|
|
5
|
+
})(this, (function (exports, React, ReactDOM, platform, styled, tusJsClient, reactDom, require$$0) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
var n = Object.create(null);
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
-
var webSdkVersion = '2.2.
|
|
214
|
+
var webSdkVersion = '2.2.143';
|
|
215
215
|
|
|
216
216
|
function getPlatform() {
|
|
217
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -529,6 +529,31 @@
|
|
|
529
529
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
+
function getAugmentedNamespace(n) {
|
|
533
|
+
if (n.__esModule) return n;
|
|
534
|
+
var f = n.default;
|
|
535
|
+
if (typeof f == "function") {
|
|
536
|
+
var a = function a () {
|
|
537
|
+
if (this instanceof a) {
|
|
538
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
539
|
+
}
|
|
540
|
+
return f.apply(this, arguments);
|
|
541
|
+
};
|
|
542
|
+
a.prototype = f.prototype;
|
|
543
|
+
} else a = {};
|
|
544
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
545
|
+
Object.keys(n).forEach(function (k) {
|
|
546
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
547
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
548
|
+
enumerable: true,
|
|
549
|
+
get: function () {
|
|
550
|
+
return n[k];
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
return a;
|
|
555
|
+
}
|
|
556
|
+
|
|
532
557
|
function warn$1() {
|
|
533
558
|
if (console && console.warn) {
|
|
534
559
|
var _console;
|
|
@@ -2890,12 +2915,15 @@
|
|
|
2890
2915
|
fingerprint = _c.sent();
|
|
2891
2916
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
2892
2917
|
var documentId;
|
|
2918
|
+
var headers = {
|
|
2919
|
+
'X-Session-Id': sessionId
|
|
2920
|
+
};
|
|
2921
|
+
if (metadata === null || metadata === void 0 ? void 0 : metadata.jobid) headers['X-Job-Id'] = metadata.jobid;
|
|
2922
|
+
if (metadata === null || metadata === void 0 ? void 0 : metadata.taskid) headers['X-Task-Id'] = metadata.taskid;
|
|
2893
2923
|
var upload = createUpload(blob, {
|
|
2894
2924
|
endpoint: endpoint,
|
|
2895
2925
|
retryDelays: [0, 1000, 1000, 1000, 3000, 5000, 10000, 20000],
|
|
2896
|
-
headers:
|
|
2897
|
-
'X-Session-Id': sessionId
|
|
2898
|
-
},
|
|
2926
|
+
headers: headers,
|
|
2899
2927
|
metadata: _assign({
|
|
2900
2928
|
filetype: blob.type,
|
|
2901
2929
|
contentType: blob.type,
|
|
@@ -10410,7 +10438,7 @@
|
|
|
10410
10438
|
});
|
|
10411
10439
|
}
|
|
10412
10440
|
|
|
10413
|
-
var _excluded
|
|
10441
|
+
var _excluded = ["enabled", "anonymousActionType", "store"],
|
|
10414
10442
|
_excluded2 = ["connection"];
|
|
10415
10443
|
var trackedConnections = /* @__PURE__ */new Map();
|
|
10416
10444
|
var getTrackedConnectionState = function getTrackedConnectionState(name) {
|
|
@@ -10455,7 +10483,7 @@
|
|
|
10455
10483
|
enabled = _devtoolsOptions.enabled,
|
|
10456
10484
|
anonymousActionType = _devtoolsOptions.anonymousActionType,
|
|
10457
10485
|
store = _devtoolsOptions.store,
|
|
10458
|
-
options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded
|
|
10486
|
+
options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded);
|
|
10459
10487
|
var extensionConnector;
|
|
10460
10488
|
try {
|
|
10461
10489
|
extensionConnector = (enabled != null ? enabled : (undefined ? undefined.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
@@ -21799,49 +21827,7 @@
|
|
|
21799
21827
|
});
|
|
21800
21828
|
};
|
|
21801
21829
|
|
|
21802
|
-
|
|
21803
|
-
if (null == e) return {};
|
|
21804
|
-
var o,
|
|
21805
|
-
r,
|
|
21806
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
21807
|
-
if (Object.getOwnPropertySymbols) {
|
|
21808
|
-
var s = Object.getOwnPropertySymbols(e);
|
|
21809
|
-
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
21810
|
-
}
|
|
21811
|
-
return i;
|
|
21812
|
-
}
|
|
21813
|
-
|
|
21814
|
-
function _inherits(t, e) {
|
|
21815
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
21816
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
21817
|
-
constructor: {
|
|
21818
|
-
value: t,
|
|
21819
|
-
writable: !0,
|
|
21820
|
-
configurable: !0
|
|
21821
|
-
}
|
|
21822
|
-
}), Object.defineProperty(t, "prototype", {
|
|
21823
|
-
writable: !1
|
|
21824
|
-
}), e && _setPrototypeOf(t, e);
|
|
21825
|
-
}
|
|
21826
|
-
|
|
21827
|
-
function _possibleConstructorReturn(t, e) {
|
|
21828
|
-
if (e && ("object" == _typeof$1(e) || "function" == typeof e)) return e;
|
|
21829
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
21830
|
-
return _assertThisInitialized(t);
|
|
21831
|
-
}
|
|
21832
|
-
|
|
21833
|
-
function _createSuper(t) {
|
|
21834
|
-
var r = _isNativeReflectConstruct();
|
|
21835
|
-
return function () {
|
|
21836
|
-
var e,
|
|
21837
|
-
o = _getPrototypeOf(t);
|
|
21838
|
-
if (r) {
|
|
21839
|
-
var s = _getPrototypeOf(this).constructor;
|
|
21840
|
-
e = Reflect.construct(o, arguments, s);
|
|
21841
|
-
} else e = o.apply(this, arguments);
|
|
21842
|
-
return _possibleConstructorReturn(this, e);
|
|
21843
|
-
};
|
|
21844
|
-
}
|
|
21830
|
+
var build$1 = {exports: {}};
|
|
21845
21831
|
|
|
21846
21832
|
/*!
|
|
21847
21833
|
* Signature Pad v2.3.2
|
|
@@ -22359,223 +22345,255 @@
|
|
|
22359
22345
|
return this._data;
|
|
22360
22346
|
};
|
|
22361
22347
|
|
|
22348
|
+
var signature_pad = /*#__PURE__*/Object.freeze({
|
|
22349
|
+
__proto__: null,
|
|
22350
|
+
default: SignaturePad$1
|
|
22351
|
+
});
|
|
22352
|
+
|
|
22353
|
+
var require$$2 = /*@__PURE__*/getAugmentedNamespace(signature_pad);
|
|
22354
|
+
|
|
22362
22355
|
var build = {exports: {}};
|
|
22363
22356
|
|
|
22357
|
+
var hasRequiredBuild;
|
|
22358
|
+
function requireBuild() {
|
|
22359
|
+
if (hasRequiredBuild) return build.exports;
|
|
22360
|
+
hasRequiredBuild = 1;
|
|
22361
|
+
(function (module, exports) {
|
|
22362
|
+
!function (e, t) {
|
|
22363
|
+
module.exports = t() ;
|
|
22364
|
+
}(commonjsGlobal, function () {
|
|
22365
|
+
return function (e) {
|
|
22366
|
+
function t(n) {
|
|
22367
|
+
if (r[n]) return r[n].exports;
|
|
22368
|
+
var o = r[n] = {
|
|
22369
|
+
exports: {},
|
|
22370
|
+
id: n,
|
|
22371
|
+
loaded: !1
|
|
22372
|
+
};
|
|
22373
|
+
return e[n].call(o.exports, o, o.exports, t), o.loaded = !0, o.exports;
|
|
22374
|
+
}
|
|
22375
|
+
var r = {};
|
|
22376
|
+
return t.m = e, t.c = r, t.p = "", t(0);
|
|
22377
|
+
}([function (e, t) {
|
|
22378
|
+
|
|
22379
|
+
function r(e) {
|
|
22380
|
+
var t = e.getContext("2d"),
|
|
22381
|
+
r = e.width,
|
|
22382
|
+
n = e.height,
|
|
22383
|
+
o = t.getImageData(0, 0, r, n).data,
|
|
22384
|
+
f = a(!0, r, n, o),
|
|
22385
|
+
i = a(!1, r, n, o),
|
|
22386
|
+
c = u(!0, r, n, o),
|
|
22387
|
+
d = u(!1, r, n, o),
|
|
22388
|
+
p = d - c + 1,
|
|
22389
|
+
l = i - f + 1,
|
|
22390
|
+
s = t.getImageData(c, f, p, l);
|
|
22391
|
+
return e.width = p, e.height = l, t.clearRect(0, 0, p, l), t.putImageData(s, 0, 0), e;
|
|
22392
|
+
}
|
|
22393
|
+
function n(e, t, r, n) {
|
|
22394
|
+
return {
|
|
22395
|
+
red: n[4 * (r * t + e)],
|
|
22396
|
+
green: n[4 * (r * t + e) + 1],
|
|
22397
|
+
blue: n[4 * (r * t + e) + 2],
|
|
22398
|
+
alpha: n[4 * (r * t + e) + 3]
|
|
22399
|
+
};
|
|
22400
|
+
}
|
|
22401
|
+
function o(e, t, r, o) {
|
|
22402
|
+
return n(e, t, r, o).alpha;
|
|
22403
|
+
}
|
|
22404
|
+
function a(e, t, r, n) {
|
|
22405
|
+
for (var a = e ? 1 : -1, u = e ? 0 : r - 1, f = u; e ? f < r : f > -1; f += a) for (var i = 0; i < t; i++) if (o(i, f, t, n)) return f;
|
|
22406
|
+
return null;
|
|
22407
|
+
}
|
|
22408
|
+
function u(e, t, r, n) {
|
|
22409
|
+
for (var a = e ? 1 : -1, u = e ? 0 : t - 1, f = u; e ? f < t : f > -1; f += a) for (var i = 0; i < r; i++) if (o(f, i, t, n)) return f;
|
|
22410
|
+
return null;
|
|
22411
|
+
}
|
|
22412
|
+
Object.defineProperty(t, "__esModule", {
|
|
22413
|
+
value: !0
|
|
22414
|
+
}), t["default"] = r;
|
|
22415
|
+
}]);
|
|
22416
|
+
});
|
|
22417
|
+
})(build);
|
|
22418
|
+
return build.exports;
|
|
22419
|
+
}
|
|
22420
|
+
|
|
22364
22421
|
(function (module, exports) {
|
|
22365
22422
|
!function (e, t) {
|
|
22366
|
-
module.exports = t() ;
|
|
22367
|
-
}(commonjsGlobal, function () {
|
|
22423
|
+
module.exports = t(require$$0, React, require$$2, requireBuild()) ;
|
|
22424
|
+
}(commonjsGlobal, function (e, t, n, r) {
|
|
22368
22425
|
return function (e) {
|
|
22369
|
-
function t(
|
|
22370
|
-
if (r
|
|
22371
|
-
var
|
|
22426
|
+
function t(r) {
|
|
22427
|
+
if (n[r]) return n[r].exports;
|
|
22428
|
+
var a = n[r] = {
|
|
22372
22429
|
exports: {},
|
|
22373
|
-
id:
|
|
22430
|
+
id: r,
|
|
22374
22431
|
loaded: !1
|
|
22375
22432
|
};
|
|
22376
|
-
return e[
|
|
22433
|
+
return e[r].call(a.exports, a, a.exports, t), a.loaded = !0, a.exports;
|
|
22377
22434
|
}
|
|
22378
|
-
var
|
|
22379
|
-
return t.m = e, t.c =
|
|
22380
|
-
}([function (e, t) {
|
|
22435
|
+
var n = {};
|
|
22436
|
+
return t.m = e, t.c = n, t.p = "", t(0);
|
|
22437
|
+
}([function (e, t, n) {
|
|
22381
22438
|
|
|
22382
22439
|
function r(e) {
|
|
22383
|
-
|
|
22384
|
-
|
|
22385
|
-
n = e.height,
|
|
22386
|
-
o = t.getImageData(0, 0, r, n).data,
|
|
22387
|
-
f = a(!0, r, n, o),
|
|
22388
|
-
i = a(!1, r, n, o),
|
|
22389
|
-
c = u(!0, r, n, o),
|
|
22390
|
-
d = u(!1, r, n, o),
|
|
22391
|
-
p = d - c + 1,
|
|
22392
|
-
l = i - f + 1,
|
|
22393
|
-
s = t.getImageData(c, f, p, l);
|
|
22394
|
-
return e.width = p, e.height = l, t.clearRect(0, 0, p, l), t.putImageData(s, 0, 0), e;
|
|
22395
|
-
}
|
|
22396
|
-
function n(e, t, r, n) {
|
|
22397
|
-
return {
|
|
22398
|
-
red: n[4 * (r * t + e)],
|
|
22399
|
-
green: n[4 * (r * t + e) + 1],
|
|
22400
|
-
blue: n[4 * (r * t + e) + 2],
|
|
22401
|
-
alpha: n[4 * (r * t + e) + 3]
|
|
22440
|
+
return e && e.__esModule ? e : {
|
|
22441
|
+
"default": e
|
|
22402
22442
|
};
|
|
22403
22443
|
}
|
|
22404
|
-
function
|
|
22405
|
-
|
|
22444
|
+
function a(e, t) {
|
|
22445
|
+
var n = {};
|
|
22446
|
+
for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
|
|
22447
|
+
return n;
|
|
22406
22448
|
}
|
|
22407
|
-
function
|
|
22408
|
-
|
|
22409
|
-
return null;
|
|
22449
|
+
function o(e, t) {
|
|
22450
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
22410
22451
|
}
|
|
22411
|
-
function
|
|
22412
|
-
|
|
22413
|
-
return
|
|
22452
|
+
function i(e, t) {
|
|
22453
|
+
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
22454
|
+
return !t || "object" != typeof t && "function" != typeof t ? e : t;
|
|
22455
|
+
}
|
|
22456
|
+
function u(e, t) {
|
|
22457
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
22458
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
22459
|
+
constructor: {
|
|
22460
|
+
value: e,
|
|
22461
|
+
enumerable: !1,
|
|
22462
|
+
writable: !0,
|
|
22463
|
+
configurable: !0
|
|
22464
|
+
}
|
|
22465
|
+
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
|
|
22414
22466
|
}
|
|
22415
22467
|
Object.defineProperty(t, "__esModule", {
|
|
22416
22468
|
value: !0
|
|
22417
|
-
})
|
|
22469
|
+
});
|
|
22470
|
+
var s = Object.assign || function (e) {
|
|
22471
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
22472
|
+
var n = arguments[t];
|
|
22473
|
+
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
22474
|
+
}
|
|
22475
|
+
return e;
|
|
22476
|
+
},
|
|
22477
|
+
c = function () {
|
|
22478
|
+
function e(e, t) {
|
|
22479
|
+
for (var n = 0; n < t.length; n++) {
|
|
22480
|
+
var r = t[n];
|
|
22481
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
|
|
22482
|
+
}
|
|
22483
|
+
}
|
|
22484
|
+
return function (t, n, r) {
|
|
22485
|
+
return n && e(t.prototype, n), r && e(t, r), t;
|
|
22486
|
+
};
|
|
22487
|
+
}(),
|
|
22488
|
+
f = n(1),
|
|
22489
|
+
p = r(f),
|
|
22490
|
+
l = n(2),
|
|
22491
|
+
d = r(l),
|
|
22492
|
+
v = n(3),
|
|
22493
|
+
h = r(v),
|
|
22494
|
+
_ = n(4),
|
|
22495
|
+
g = r(_),
|
|
22496
|
+
m = function (e) {
|
|
22497
|
+
function t() {
|
|
22498
|
+
var e, n, r, u;
|
|
22499
|
+
o(this, t);
|
|
22500
|
+
for (var s = arguments.length, c = Array(s), f = 0; f < s; f++) c[f] = arguments[f];
|
|
22501
|
+
return n = r = i(this, (e = t.__proto__ || Object.getPrototypeOf(t)).call.apply(e, [this].concat(c))), r._sigPad = null, r._excludeOurProps = function () {
|
|
22502
|
+
var e = r.props,
|
|
22503
|
+
t = (e.canvasProps, e.clearOnResize, a(e, ["canvasProps", "clearOnResize"]));
|
|
22504
|
+
return t;
|
|
22505
|
+
}, r.getCanvas = function () {
|
|
22506
|
+
return r._canvas;
|
|
22507
|
+
}, r.getTrimmedCanvas = function () {
|
|
22508
|
+
var e = document.createElement("canvas");
|
|
22509
|
+
return e.width = r._canvas.width, e.height = r._canvas.height, e.getContext("2d").drawImage(r._canvas, 0, 0), (0, g["default"])(e);
|
|
22510
|
+
}, r.getSignaturePad = function () {
|
|
22511
|
+
return r._sigPad;
|
|
22512
|
+
}, r._checkClearOnResize = function () {
|
|
22513
|
+
r.props.clearOnResize && r._resizeCanvas();
|
|
22514
|
+
}, r._resizeCanvas = function () {
|
|
22515
|
+
var e = r.props.canvasProps || {},
|
|
22516
|
+
t = e.width,
|
|
22517
|
+
n = e.height;
|
|
22518
|
+
if (!t || !n) {
|
|
22519
|
+
var a = r._canvas,
|
|
22520
|
+
o = Math.max(window.devicePixelRatio || 1, 1);
|
|
22521
|
+
t || (a.width = a.offsetWidth * o), n || (a.height = a.offsetHeight * o), a.getContext("2d").scale(o, o), r.clear();
|
|
22522
|
+
}
|
|
22523
|
+
}, r.on = function () {
|
|
22524
|
+
return window.addEventListener("resize", r._checkClearOnResize), r._sigPad.on();
|
|
22525
|
+
}, r.off = function () {
|
|
22526
|
+
return window.removeEventListener("resize", r._checkClearOnResize), r._sigPad.off();
|
|
22527
|
+
}, r.clear = function () {
|
|
22528
|
+
return r._sigPad.clear();
|
|
22529
|
+
}, r.isEmpty = function () {
|
|
22530
|
+
return r._sigPad.isEmpty();
|
|
22531
|
+
}, r.fromDataURL = function (e, t) {
|
|
22532
|
+
return r._sigPad.fromDataURL(e, t);
|
|
22533
|
+
}, r.toDataURL = function (e, t) {
|
|
22534
|
+
return r._sigPad.toDataURL(e, t);
|
|
22535
|
+
}, r.fromData = function (e) {
|
|
22536
|
+
return r._sigPad.fromData(e);
|
|
22537
|
+
}, r.toData = function () {
|
|
22538
|
+
return r._sigPad.toData();
|
|
22539
|
+
}, u = n, i(r, u);
|
|
22540
|
+
}
|
|
22541
|
+
return u(t, e), c(t, [{
|
|
22542
|
+
key: "componentDidMount",
|
|
22543
|
+
value: function value() {
|
|
22544
|
+
this._sigPad = new h["default"](this._canvas, this._excludeOurProps()), this._resizeCanvas(), this.on();
|
|
22545
|
+
}
|
|
22546
|
+
}, {
|
|
22547
|
+
key: "componentWillUnmount",
|
|
22548
|
+
value: function value() {
|
|
22549
|
+
this.off();
|
|
22550
|
+
}
|
|
22551
|
+
}, {
|
|
22552
|
+
key: "componentDidUpdate",
|
|
22553
|
+
value: function value() {
|
|
22554
|
+
Object.assign(this._sigPad, this._excludeOurProps());
|
|
22555
|
+
}
|
|
22556
|
+
}, {
|
|
22557
|
+
key: "render",
|
|
22558
|
+
value: function value() {
|
|
22559
|
+
var e = this,
|
|
22560
|
+
t = this.props.canvasProps;
|
|
22561
|
+
return d["default"].createElement("canvas", s({
|
|
22562
|
+
ref: function ref(t) {
|
|
22563
|
+
e._canvas = t;
|
|
22564
|
+
}
|
|
22565
|
+
}, t));
|
|
22566
|
+
}
|
|
22567
|
+
}]), t;
|
|
22568
|
+
}(l.Component);
|
|
22569
|
+
m.propTypes = {
|
|
22570
|
+
velocityFilterWeight: p["default"].number,
|
|
22571
|
+
minWidth: p["default"].number,
|
|
22572
|
+
maxWidth: p["default"].number,
|
|
22573
|
+
minDistance: p["default"].number,
|
|
22574
|
+
dotSize: p["default"].oneOfType([p["default"].number, p["default"].func]),
|
|
22575
|
+
penColor: p["default"].string,
|
|
22576
|
+
throttle: p["default"].number,
|
|
22577
|
+
onEnd: p["default"].func,
|
|
22578
|
+
onBegin: p["default"].func,
|
|
22579
|
+
canvasProps: p["default"].object,
|
|
22580
|
+
clearOnResize: p["default"].bool
|
|
22581
|
+
}, m.defaultProps = {
|
|
22582
|
+
clearOnResize: !0
|
|
22583
|
+
}, t["default"] = m;
|
|
22584
|
+
}, function (t, n) {
|
|
22585
|
+
t.exports = e;
|
|
22586
|
+
}, function (e, n) {
|
|
22587
|
+
e.exports = t;
|
|
22588
|
+
}, function (e, t) {
|
|
22589
|
+
e.exports = n;
|
|
22590
|
+
}, function (e, t) {
|
|
22591
|
+
e.exports = r;
|
|
22418
22592
|
}]);
|
|
22419
22593
|
});
|
|
22420
|
-
})(build);
|
|
22421
|
-
var buildExports = build.exports;
|
|
22422
|
-
var
|
|
22423
|
-
|
|
22424
|
-
var _excluded = ["canvasProps", "clearOnResize"];
|
|
22425
|
-
var SignatureCanvas = /*#__PURE__*/function (_Component) {
|
|
22426
|
-
_inherits(SignatureCanvas, _Component);
|
|
22427
|
-
var _super = _createSuper(SignatureCanvas);
|
|
22428
|
-
function SignatureCanvas() {
|
|
22429
|
-
var _this;
|
|
22430
|
-
_classCallCheck(this, SignatureCanvas);
|
|
22431
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22432
|
-
args[_key] = arguments[_key];
|
|
22433
|
-
}
|
|
22434
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
22435
|
-
_this.staticThis = _this.constructor;
|
|
22436
|
-
_this._sigPad = null;
|
|
22437
|
-
_this._canvas = null;
|
|
22438
|
-
_this.setRef = function (ref) {
|
|
22439
|
-
_this._canvas = ref;
|
|
22440
|
-
// if component is unmounted, set internal references to null
|
|
22441
|
-
if (_this._canvas === null) {
|
|
22442
|
-
_this._sigPad = null;
|
|
22443
|
-
}
|
|
22444
|
-
};
|
|
22445
|
-
_this._excludeOurProps = function () {
|
|
22446
|
-
var _this$props = _this.props;
|
|
22447
|
-
_this$props.canvasProps;
|
|
22448
|
-
_this$props.clearOnResize;
|
|
22449
|
-
var sigPadProps = _objectWithoutProperties(_this$props, _excluded);
|
|
22450
|
-
return sigPadProps;
|
|
22451
|
-
};
|
|
22452
|
-
_this.componentDidMount = function () {
|
|
22453
|
-
var canvas = _this.getCanvas();
|
|
22454
|
-
_this._sigPad = new SignaturePad$1(canvas, _this._excludeOurProps());
|
|
22455
|
-
_this._resizeCanvas();
|
|
22456
|
-
_this.on();
|
|
22457
|
-
};
|
|
22458
|
-
_this.componentWillUnmount = function () {
|
|
22459
|
-
_this.off();
|
|
22460
|
-
};
|
|
22461
|
-
_this.componentDidUpdate = function () {
|
|
22462
|
-
Object.assign(_this._sigPad, _this._excludeOurProps());
|
|
22463
|
-
};
|
|
22464
|
-
_this.getCanvas = function () {
|
|
22465
|
-
if (_this._canvas === null) {
|
|
22466
|
-
throw _this.staticThis.refNullError;
|
|
22467
|
-
}
|
|
22468
|
-
return _this._canvas;
|
|
22469
|
-
};
|
|
22470
|
-
_this.getTrimmedCanvas = function () {
|
|
22471
|
-
// copy the canvas
|
|
22472
|
-
var canvas = _this.getCanvas();
|
|
22473
|
-
var copy = document.createElement('canvas');
|
|
22474
|
-
copy.width = canvas.width;
|
|
22475
|
-
copy.height = canvas.height;
|
|
22476
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22477
|
-
copy.getContext('2d').drawImage(canvas, 0, 0);
|
|
22478
|
-
// then trim it
|
|
22479
|
-
return trimCanvas(copy);
|
|
22480
|
-
};
|
|
22481
|
-
_this.getSignaturePad = function () {
|
|
22482
|
-
if (_this._sigPad === null) {
|
|
22483
|
-
throw _this.staticThis.refNullError;
|
|
22484
|
-
}
|
|
22485
|
-
return _this._sigPad;
|
|
22486
|
-
};
|
|
22487
|
-
_this._checkClearOnResize = function () {
|
|
22488
|
-
if (!_this.props.clearOnResize) {
|
|
22489
|
-
// eslint-disable-line @typescript-eslint/strict-boolean-expressions -- this is backward compatible with the previous behavior, where null was treated as falsey
|
|
22490
|
-
return;
|
|
22491
|
-
}
|
|
22492
|
-
_this._resizeCanvas();
|
|
22493
|
-
};
|
|
22494
|
-
_this._resizeCanvas = function () {
|
|
22495
|
-
var _this$props$canvasPro, _window$devicePixelRa;
|
|
22496
|
-
var canvasProps = (_this$props$canvasPro = _this.props.canvasProps) !== null && _this$props$canvasPro !== void 0 ? _this$props$canvasPro : {};
|
|
22497
|
-
var width = canvasProps.width,
|
|
22498
|
-
height = canvasProps.height;
|
|
22499
|
-
// don't resize if the canvas has fixed width and height
|
|
22500
|
-
if (typeof width !== 'undefined' && typeof height !== 'undefined') {
|
|
22501
|
-
return;
|
|
22502
|
-
}
|
|
22503
|
-
var canvas = _this.getCanvas();
|
|
22504
|
-
/* When zoomed out to less than 100%, for some very strange reason,
|
|
22505
|
-
some browsers report devicePixelRatio as less than 1
|
|
22506
|
-
and only part of the canvas is cleared then. */
|
|
22507
|
-
var ratio = Math.max((_window$devicePixelRa = window.devicePixelRatio) !== null && _window$devicePixelRa !== void 0 ? _window$devicePixelRa : 1, 1);
|
|
22508
|
-
if (typeof width === 'undefined') {
|
|
22509
|
-
canvas.width = canvas.offsetWidth * ratio;
|
|
22510
|
-
}
|
|
22511
|
-
if (typeof height === 'undefined') {
|
|
22512
|
-
canvas.height = canvas.offsetHeight * ratio;
|
|
22513
|
-
}
|
|
22514
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22515
|
-
canvas.getContext('2d').scale(ratio, ratio);
|
|
22516
|
-
_this.clear();
|
|
22517
|
-
};
|
|
22518
|
-
_this.render = function () {
|
|
22519
|
-
var canvasProps = _this.props.canvasProps;
|
|
22520
|
-
return /*#__PURE__*/React.createElement("canvas", _extends({
|
|
22521
|
-
ref: _this.setRef
|
|
22522
|
-
}, canvasProps));
|
|
22523
|
-
};
|
|
22524
|
-
_this.on = function () {
|
|
22525
|
-
window.addEventListener('resize', _this._checkClearOnResize);
|
|
22526
|
-
return _this.getSignaturePad().on();
|
|
22527
|
-
};
|
|
22528
|
-
_this.off = function () {
|
|
22529
|
-
window.removeEventListener('resize', _this._checkClearOnResize);
|
|
22530
|
-
return _this.getSignaturePad().off();
|
|
22531
|
-
};
|
|
22532
|
-
_this.clear = function () {
|
|
22533
|
-
return _this.getSignaturePad().clear();
|
|
22534
|
-
};
|
|
22535
|
-
_this.isEmpty = function () {
|
|
22536
|
-
return _this.getSignaturePad().isEmpty();
|
|
22537
|
-
};
|
|
22538
|
-
_this.fromDataURL = function (dataURL, options) {
|
|
22539
|
-
return _this.getSignaturePad().fromDataURL(dataURL, options);
|
|
22540
|
-
};
|
|
22541
|
-
_this.toDataURL = function (type, encoderOptions) {
|
|
22542
|
-
return _this.getSignaturePad().toDataURL(type, encoderOptions);
|
|
22543
|
-
};
|
|
22544
|
-
_this.fromData = function (pointGroups) {
|
|
22545
|
-
return _this.getSignaturePad().fromData(pointGroups);
|
|
22546
|
-
};
|
|
22547
|
-
_this.toData = function () {
|
|
22548
|
-
return _this.getSignaturePad().toData();
|
|
22549
|
-
};
|
|
22550
|
-
return _this;
|
|
22551
|
-
} // shortcut reference (https://stackoverflow.com/a/29244254/3431180)
|
|
22552
|
-
// propagate prop updates to SignaturePad
|
|
22553
|
-
// return the canvas ref for operations like toDataURL
|
|
22554
|
-
// return a trimmed copy of the canvas
|
|
22555
|
-
// return the internal SignaturePad reference
|
|
22556
|
-
// all wrapper functions below render
|
|
22557
|
-
//
|
|
22558
|
-
return _createClass(SignatureCanvas);
|
|
22559
|
-
}(React.Component);
|
|
22560
|
-
SignatureCanvas.propTypes = {
|
|
22561
|
-
// signature_pad's props
|
|
22562
|
-
velocityFilterWeight: PropTypes.number,
|
|
22563
|
-
minWidth: PropTypes.number,
|
|
22564
|
-
maxWidth: PropTypes.number,
|
|
22565
|
-
minDistance: PropTypes.number,
|
|
22566
|
-
dotSize: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
|
|
22567
|
-
penColor: PropTypes.string,
|
|
22568
|
-
throttle: PropTypes.number,
|
|
22569
|
-
onEnd: PropTypes.func,
|
|
22570
|
-
onBegin: PropTypes.func,
|
|
22571
|
-
// props specific to the React wrapper
|
|
22572
|
-
canvasProps: PropTypes.object,
|
|
22573
|
-
clearOnResize: PropTypes.bool
|
|
22574
|
-
};
|
|
22575
|
-
SignatureCanvas.defaultProps = {
|
|
22576
|
-
clearOnResize: true
|
|
22577
|
-
};
|
|
22578
|
-
SignatureCanvas.refNullError = new Error('react-signature-canvas is currently ' + 'mounting or unmounting: React refs are null during this phase.');
|
|
22594
|
+
})(build$1);
|
|
22595
|
+
var buildExports = build$1.exports;
|
|
22596
|
+
var SignatureCanvas = /*@__PURE__*/getDefaultExportFromCjs(buildExports);
|
|
22579
22597
|
|
|
22580
22598
|
function signatureDataToIdmissionFormat(signatureCanvas, imageUrl) {
|
|
22581
22599
|
imageUrl || (imageUrl = signatureCanvas.toDataURL());
|