@progress/kendo-vue-inputs 3.7.4-dev.202301131104 → 3.7.4-dev.202301161618
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/NOTICE.txt +11 -11
- package/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/RadioButton.js +4 -1
- package/dist/es/radiobutton/RadioGroup.js +2 -0
- package/dist/es/radiobutton/interfaces/RadioButtonProps.d.ts +5 -0
- package/dist/es/signature/Signature.js +106 -54
- package/dist/es/signature/SignatureBottomActions.d.ts +3 -0
- package/dist/es/signature/SignatureBottomActions.js +3 -0
- package/dist/es/signature/SignatureCanvas.js +28 -164
- package/dist/es/signature/SignatureDialog.d.ts +3 -0
- package/dist/es/signature/SignatureDialog.js +34 -9
- package/dist/es/signature/SignatureLine.d.ts +3 -0
- package/dist/es/signature/SignatureLine.js +3 -0
- package/dist/es/signature/interfaces/SignatureCanvasProps.d.ts +1 -0
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/radiobutton/RadioButton.js +4 -1
- package/dist/esm/radiobutton/RadioGroup.js +2 -0
- package/dist/esm/radiobutton/interfaces/RadioButtonProps.d.ts +5 -0
- package/dist/esm/signature/Signature.js +106 -54
- package/dist/esm/signature/SignatureBottomActions.d.ts +3 -0
- package/dist/esm/signature/SignatureBottomActions.js +3 -0
- package/dist/esm/signature/SignatureCanvas.js +28 -164
- package/dist/esm/signature/SignatureDialog.d.ts +3 -0
- package/dist/esm/signature/SignatureDialog.js +34 -9
- package/dist/esm/signature/SignatureLine.d.ts +3 -0
- package/dist/esm/signature/SignatureLine.js +3 -0
- package/dist/esm/signature/interfaces/SignatureCanvasProps.d.ts +1 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/RadioButton.js +4 -1
- package/dist/npm/radiobutton/RadioGroup.js +2 -0
- package/dist/npm/radiobutton/interfaces/RadioButtonProps.d.ts +5 -0
- package/dist/npm/signature/Signature.js +106 -54
- package/dist/npm/signature/SignatureBottomActions.d.ts +3 -0
- package/dist/npm/signature/SignatureBottomActions.js +3 -0
- package/dist/npm/signature/SignatureCanvas.js +28 -164
- package/dist/npm/signature/SignatureDialog.d.ts +3 -0
- package/dist/npm/signature/SignatureDialog.js +33 -8
- package/dist/npm/signature/SignatureLine.d.ts +3 -0
- package/dist/npm/signature/SignatureLine.js +3 -0
- package/dist/npm/signature/interfaces/SignatureCanvasProps.d.ts +1 -0
- package/package.json +13 -13
|
@@ -194,6 +194,7 @@ var SignatureVue2 = {
|
|
|
194
194
|
default: DEFAULT_EXPORT_SCALE
|
|
195
195
|
},
|
|
196
196
|
modelValue: String,
|
|
197
|
+
name: String,
|
|
197
198
|
value: String,
|
|
198
199
|
tabIndex: Number,
|
|
199
200
|
dir: String,
|
|
@@ -222,6 +223,10 @@ var SignatureVue2 = {
|
|
|
222
223
|
type: Boolean,
|
|
223
224
|
default: false
|
|
224
225
|
},
|
|
226
|
+
valid: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
default: undefined
|
|
229
|
+
},
|
|
225
230
|
size: {
|
|
226
231
|
type: String,
|
|
227
232
|
default: 'medium',
|
|
@@ -255,9 +260,7 @@ var SignatureVue2 = {
|
|
|
255
260
|
},
|
|
256
261
|
openWrapperClass: function openWrapperClass() {
|
|
257
262
|
var _a;
|
|
258
|
-
var isValid =
|
|
259
|
-
// !this.validityStylesGetter() ||
|
|
260
|
-
this.validityGetter().valid;
|
|
263
|
+
var isValid = !this.validityStyles || this.validityGetter().valid;
|
|
261
264
|
return _a = {
|
|
262
265
|
'k-input': true,
|
|
263
266
|
'k-signature': true,
|
|
@@ -285,6 +288,16 @@ var SignatureVue2 = {
|
|
|
285
288
|
return this.$props.backgroundColor || defaultBackgroundColor;
|
|
286
289
|
}
|
|
287
290
|
},
|
|
291
|
+
watch: {
|
|
292
|
+
computedValue: function computedValue(newValue) {
|
|
293
|
+
if (newValue !== this.currentValue) {
|
|
294
|
+
this.loadImage(newValue);
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
computedOpen: function computedOpen() {
|
|
298
|
+
this.loadImage(this.computedValue);
|
|
299
|
+
}
|
|
300
|
+
},
|
|
288
301
|
data: function data() {
|
|
289
302
|
return {
|
|
290
303
|
focused: false,
|
|
@@ -295,12 +308,10 @@ var SignatureVue2 = {
|
|
|
295
308
|
};
|
|
296
309
|
},
|
|
297
310
|
mounted: function mounted() {
|
|
298
|
-
this.
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
this.
|
|
302
|
-
this.popupWidth = this.popupSize().width;
|
|
303
|
-
this.popupHeight = this.popupSize().height;
|
|
311
|
+
this.setRefs();
|
|
312
|
+
},
|
|
313
|
+
updated: function updated() {
|
|
314
|
+
this.setRefs();
|
|
304
315
|
},
|
|
305
316
|
// @ts-ignore
|
|
306
317
|
setup: !isV3 ? undefined : function () {
|
|
@@ -376,8 +387,9 @@ var SignatureVue2 = {
|
|
|
376
387
|
onBlur: this.onBlur
|
|
377
388
|
}, [h(SignatureCanvas_1.SignatureCanvas, {
|
|
378
389
|
ref: (0, kendo_vue_common_1.setRef)(this, 'canvas'),
|
|
379
|
-
|
|
390
|
+
name: this.name,
|
|
380
391
|
attrs: this.v3 ? undefined : {
|
|
392
|
+
name: this.name,
|
|
381
393
|
value: this.computedValue,
|
|
382
394
|
tabIndex: this.tabIndex,
|
|
383
395
|
disabled: this.disabled,
|
|
@@ -390,6 +402,7 @@ var SignatureVue2 = {
|
|
|
390
402
|
scale: this.exportScale,
|
|
391
403
|
elementSize: this.elementSize
|
|
392
404
|
},
|
|
405
|
+
value: this.computedValue,
|
|
393
406
|
tabIndex: this.tabIndex,
|
|
394
407
|
disabled: this.disabled,
|
|
395
408
|
readOnly: this.readOnly,
|
|
@@ -401,10 +414,15 @@ var SignatureVue2 = {
|
|
|
401
414
|
scale: this.exportScale,
|
|
402
415
|
onChange: this.onValueChange,
|
|
403
416
|
on: this.v3 ? undefined : {
|
|
404
|
-
"change": this.onValueChange
|
|
417
|
+
"change": this.onValueChange,
|
|
418
|
+
"draw": this.onDraw,
|
|
419
|
+
"drawend": this.onDrawEnd
|
|
405
420
|
},
|
|
406
|
-
elementSize: this.elementSize
|
|
421
|
+
elementSize: this.elementSize,
|
|
422
|
+
onDraw: this.onDraw,
|
|
423
|
+
onDrawend: this.onDrawEnd
|
|
407
424
|
}), actions, hideLine, bottomActions, this.computedOpen && h(SignatureDialog_1.SignatureDialog, {
|
|
425
|
+
ref: (0, kendo_vue_common_1.setRef)(this, 'dialog'),
|
|
408
426
|
openWrapperClass: this.openWrapperClass,
|
|
409
427
|
attrs: this.v3 ? undefined : {
|
|
410
428
|
openWrapperClass: this.openWrapperClass,
|
|
@@ -433,7 +451,9 @@ var SignatureVue2 = {
|
|
|
433
451
|
"overlayclick": this.onOverlayClick,
|
|
434
452
|
"focus": this.onFocus,
|
|
435
453
|
"blur": this.onBlur,
|
|
436
|
-
"change": this.onValueChange
|
|
454
|
+
"change": this.onValueChange,
|
|
455
|
+
"draw": this.onDraw,
|
|
456
|
+
"drawend": this.onDrawEnd
|
|
437
457
|
},
|
|
438
458
|
onClear: this.onClear,
|
|
439
459
|
onOverlayclick: this.onOverlayClick,
|
|
@@ -450,10 +470,20 @@ var SignatureVue2 = {
|
|
|
450
470
|
popupScale: this.$props.popupScale,
|
|
451
471
|
scale: 1 / this.popupScale * this.exportScale,
|
|
452
472
|
onChange: this.onValueChange,
|
|
453
|
-
elementSize: this.elementSize
|
|
473
|
+
elementSize: this.elementSize,
|
|
474
|
+
onDraw: this.onDraw,
|
|
475
|
+
onDrawend: this.onDrawEnd
|
|
454
476
|
})]);
|
|
455
477
|
},
|
|
456
478
|
methods: {
|
|
479
|
+
setRefs: function setRefs() {
|
|
480
|
+
this.canvas = (0, kendo_vue_common_1.getRef)(this, 'canvas');
|
|
481
|
+
this.minimizeButton = (0, kendo_vue_common_1.getRef)(this, 'minimizeButton');
|
|
482
|
+
this.maximizeButton = (0, kendo_vue_common_1.getRef)(this, 'maximizeButton');
|
|
483
|
+
this.dialog = (0, kendo_vue_common_1.getRef)(this, 'dialog');
|
|
484
|
+
this.popupWidth = this.popupSize().width;
|
|
485
|
+
this.popupHeight = this.popupSize().height;
|
|
486
|
+
},
|
|
457
487
|
onOverlayClick: function onOverlayClick() {
|
|
458
488
|
this.currentOpen = false;
|
|
459
489
|
},
|
|
@@ -469,8 +499,25 @@ var SignatureVue2 = {
|
|
|
469
499
|
this.onValueChange(e.value);
|
|
470
500
|
},
|
|
471
501
|
reset: function reset() {
|
|
502
|
+
this.clear();
|
|
472
503
|
this.onValueChange();
|
|
473
504
|
},
|
|
505
|
+
clear: function clear() {
|
|
506
|
+
if (this.canvas) {
|
|
507
|
+
this.canvas.clear();
|
|
508
|
+
}
|
|
509
|
+
if (this.dialog && this.dialog.openCanvas) {
|
|
510
|
+
this.dialog.openCanvas.clear();
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
loadImage: function loadImage(value) {
|
|
514
|
+
if (this.canvas) {
|
|
515
|
+
this.canvas.loadImage(value);
|
|
516
|
+
}
|
|
517
|
+
if (this.dialog && this.dialog.openCanvas) {
|
|
518
|
+
this.dialog.openCanvas.loadImage(value);
|
|
519
|
+
}
|
|
520
|
+
},
|
|
474
521
|
onDialogClose: function onDialogClose(event) {
|
|
475
522
|
var _a;
|
|
476
523
|
this.onMinimizeClick(event);
|
|
@@ -478,29 +525,18 @@ var SignatureVue2 = {
|
|
|
478
525
|
},
|
|
479
526
|
exportImage: function exportImage(exportSize) {
|
|
480
527
|
var _a;
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
width = exportSize.width, height = exportSize.height;
|
|
487
|
-
return [4 /*yield*/, (_a = this.canvas.instance) === null || _a === void 0 ? void 0 : _a.exportImage({
|
|
488
|
-
width: width * this.exportScale,
|
|
489
|
-
height: height * this.exportScale
|
|
490
|
-
})];
|
|
491
|
-
case 1:
|
|
492
|
-
return [2 /*return*/, _b.sent()];
|
|
493
|
-
}
|
|
494
|
-
});
|
|
528
|
+
var width = exportSize.width,
|
|
529
|
+
height = exportSize.height;
|
|
530
|
+
return (_a = this.canvas.instance) === null || _a === void 0 ? void 0 : _a.exportImage({
|
|
531
|
+
width: width * this.exportScale,
|
|
532
|
+
height: height * this.exportScale
|
|
495
533
|
});
|
|
496
534
|
},
|
|
497
535
|
validityGetter: function validityGetter() {
|
|
498
536
|
var customError = this.$props.validationMessage !== undefined;
|
|
499
|
-
var currentValue = this.computedValue;
|
|
537
|
+
var currentValue = this.computedValue;
|
|
500
538
|
var valueMissing = !currentValue;
|
|
501
|
-
var valid = this.$props.valid !== undefined ? this.$props.valid :
|
|
502
|
-
// !requiredGetter() ||
|
|
503
|
-
!valueMissing;
|
|
539
|
+
var valid = this.$props.valid !== undefined ? this.$props.valid : !this.required || !valueMissing;
|
|
504
540
|
return {
|
|
505
541
|
customError: customError,
|
|
506
542
|
valid: valid,
|
|
@@ -515,14 +551,27 @@ var SignatureVue2 = {
|
|
|
515
551
|
element: this.$el,
|
|
516
552
|
focus: this.focusElement()
|
|
517
553
|
};
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
554
|
+
Object.defineProperty(options, 'name', {
|
|
555
|
+
get: this.name
|
|
556
|
+
});
|
|
557
|
+
Object.defineProperty(options, 'value', {
|
|
558
|
+
get: this.computedValue
|
|
559
|
+
});
|
|
560
|
+
Object.defineProperty(options, 'validity', {
|
|
561
|
+
get: this.validityGetter()
|
|
562
|
+
});
|
|
563
|
+
Object.defineProperty(options, 'validityStyles', {
|
|
564
|
+
get: this.validityStyles
|
|
565
|
+
});
|
|
566
|
+
Object.defineProperty(options, 'required', {
|
|
567
|
+
get: this.required
|
|
568
|
+
});
|
|
569
|
+
Object.defineProperty(options, 'color', {
|
|
570
|
+
get: this.computedColor
|
|
571
|
+
});
|
|
572
|
+
Object.defineProperty(options, 'backgroundColor', {
|
|
573
|
+
get: this.computedBgColor
|
|
574
|
+
});
|
|
526
575
|
return options;
|
|
527
576
|
},
|
|
528
577
|
onFocus: function onFocus(event) {
|
|
@@ -546,20 +595,17 @@ var SignatureVue2 = {
|
|
|
546
595
|
},
|
|
547
596
|
onMaximizeClick: function onMaximizeClick(event) {
|
|
548
597
|
return __awaiter(this, void 0, void 0, function () {
|
|
549
|
-
var
|
|
550
|
-
return __generator(this, function (
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}, this.getImperativeHandle()));
|
|
561
|
-
return [2 /*return*/];
|
|
562
|
-
}
|
|
598
|
+
var that;
|
|
599
|
+
return __generator(this, function (_a) {
|
|
600
|
+
that = this;
|
|
601
|
+
this.exportImage(this.popupSize()).then(function (newValue) {
|
|
602
|
+
that.currentValue = newValue;
|
|
603
|
+
});
|
|
604
|
+
this.currentOpen = true;
|
|
605
|
+
this.$emit('open', __assign({
|
|
606
|
+
event: event
|
|
607
|
+
}, this.getImperativeHandle()));
|
|
608
|
+
return [2 /*return*/];
|
|
563
609
|
});
|
|
564
610
|
});
|
|
565
611
|
},
|
|
@@ -590,6 +636,12 @@ var SignatureVue2 = {
|
|
|
590
636
|
width: width * this.popupScale,
|
|
591
637
|
height: height * this.popupScale
|
|
592
638
|
};
|
|
639
|
+
},
|
|
640
|
+
onDraw: function onDraw() {
|
|
641
|
+
this.isDrawing = true;
|
|
642
|
+
},
|
|
643
|
+
onDrawEnd: function onDrawEnd() {
|
|
644
|
+
this.isDrawing = false;
|
|
593
645
|
}
|
|
594
646
|
}
|
|
595
647
|
};
|
|
@@ -38,5 +38,8 @@ export interface SignatureBottomActionsAll extends Vue2type, SignatureBottomActi
|
|
|
38
38
|
* @hidden
|
|
39
39
|
*/
|
|
40
40
|
declare let SignatureBottomActionsVue2: ComponentOptions<SignatureBottomActionsAll, DefaultData<SignatureBottomActionsData>, DefaultMethods<SignatureBottomActionsAll>, SignatureBottomActionsComputed, RecordPropsDefinition<SignatureBottomActionsProps>>;
|
|
41
|
+
/**
|
|
42
|
+
* @hidden
|
|
43
|
+
*/
|
|
41
44
|
declare const SignatureBottomActions: DefineComponent<{}, any, SignatureBottomActionsData, SignatureBottomActionsComputed, SignatureBottomActionsMethods, {}, {}, {}, string, {}, {}, {}>;
|
|
42
45
|
export { SignatureBottomActions, SignatureBottomActionsVue2 };
|
|
@@ -1,122 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) {
|
|
5
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
6
|
-
resolve(value);
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
-
function fulfilled(value) {
|
|
11
|
-
try {
|
|
12
|
-
step(generator.next(value));
|
|
13
|
-
} catch (e) {
|
|
14
|
-
reject(e);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function rejected(value) {
|
|
18
|
-
try {
|
|
19
|
-
step(generator["throw"](value));
|
|
20
|
-
} catch (e) {
|
|
21
|
-
reject(e);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function step(result) {
|
|
25
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
26
|
-
}
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
31
|
-
var _ = {
|
|
32
|
-
label: 0,
|
|
33
|
-
sent: function sent() {
|
|
34
|
-
if (t[0] & 1) throw t[1];
|
|
35
|
-
return t[1];
|
|
36
|
-
},
|
|
37
|
-
trys: [],
|
|
38
|
-
ops: []
|
|
39
|
-
},
|
|
40
|
-
f,
|
|
41
|
-
y,
|
|
42
|
-
t,
|
|
43
|
-
g;
|
|
44
|
-
return g = {
|
|
45
|
-
next: verb(0),
|
|
46
|
-
"throw": verb(1),
|
|
47
|
-
"return": verb(2)
|
|
48
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
49
|
-
return this;
|
|
50
|
-
}), g;
|
|
51
|
-
function verb(n) {
|
|
52
|
-
return function (v) {
|
|
53
|
-
return step([n, v]);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function step(op) {
|
|
57
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
58
|
-
while (_) {
|
|
59
|
-
try {
|
|
60
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
61
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
62
|
-
switch (op[0]) {
|
|
63
|
-
case 0:
|
|
64
|
-
case 1:
|
|
65
|
-
t = op;
|
|
66
|
-
break;
|
|
67
|
-
case 4:
|
|
68
|
-
_.label++;
|
|
69
|
-
return {
|
|
70
|
-
value: op[1],
|
|
71
|
-
done: false
|
|
72
|
-
};
|
|
73
|
-
case 5:
|
|
74
|
-
_.label++;
|
|
75
|
-
y = op[1];
|
|
76
|
-
op = [0];
|
|
77
|
-
continue;
|
|
78
|
-
case 7:
|
|
79
|
-
op = _.ops.pop();
|
|
80
|
-
_.trys.pop();
|
|
81
|
-
continue;
|
|
82
|
-
default:
|
|
83
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
84
|
-
_ = 0;
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
88
|
-
_.label = op[1];
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
92
|
-
_.label = t[1];
|
|
93
|
-
t = op;
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
if (t && _.label < t[2]) {
|
|
97
|
-
_.label = t[2];
|
|
98
|
-
_.ops.push(op);
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
if (t[2]) _.ops.pop();
|
|
102
|
-
_.trys.pop();
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
op = body.call(thisArg, _);
|
|
106
|
-
} catch (e) {
|
|
107
|
-
op = [6, e];
|
|
108
|
-
y = 0;
|
|
109
|
-
} finally {
|
|
110
|
-
f = t = 0;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (op[0] & 5) throw op[1];
|
|
114
|
-
return {
|
|
115
|
-
value: op[0] ? op[1] : void 0,
|
|
116
|
-
done: true
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
3
|
Object.defineProperty(exports, "__esModule", {
|
|
121
4
|
value: true
|
|
122
5
|
});
|
|
@@ -139,12 +22,11 @@ var setOptions = function setOptions() {
|
|
|
139
22
|
*/
|
|
140
23
|
var SignatureCanvasVue2 = {
|
|
141
24
|
name: 'KendoSignatureCanvas',
|
|
142
|
-
model: {
|
|
143
|
-
event: 'changemodel'
|
|
144
|
-
},
|
|
145
25
|
// @ts-ignore
|
|
146
26
|
emits: {
|
|
147
|
-
change: null
|
|
27
|
+
change: null,
|
|
28
|
+
draw: null,
|
|
29
|
+
drawend: null
|
|
148
30
|
},
|
|
149
31
|
inject: {
|
|
150
32
|
kendoIntlService: {
|
|
@@ -155,6 +37,7 @@ var SignatureCanvasVue2 = {
|
|
|
155
37
|
strokeWidth: Number,
|
|
156
38
|
popupScale: Number,
|
|
157
39
|
scale: Number,
|
|
40
|
+
name: String,
|
|
158
41
|
value: String,
|
|
159
42
|
tabIndex: Number,
|
|
160
43
|
disabled: Boolean,
|
|
@@ -165,15 +48,6 @@ var SignatureCanvasVue2 = {
|
|
|
165
48
|
smooth: Boolean
|
|
166
49
|
},
|
|
167
50
|
watch: {
|
|
168
|
-
value: function value(newLocale) {
|
|
169
|
-
if (this.instance) {
|
|
170
|
-
if (newLocale) {
|
|
171
|
-
this.instance.loadImage(newLocale);
|
|
172
|
-
} else {
|
|
173
|
-
this.instance.clear();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
51
|
color: setOptions,
|
|
178
52
|
backgroundColor: setOptions,
|
|
179
53
|
smooth: setOptions,
|
|
@@ -181,7 +55,6 @@ var SignatureCanvasVue2 = {
|
|
|
181
55
|
readOnly: setOptions
|
|
182
56
|
},
|
|
183
57
|
mounted: function mounted() {
|
|
184
|
-
var _this = this;
|
|
185
58
|
this.canvas = this.$el;
|
|
186
59
|
var pad = new kendo_inputs_common_1.SignaturePad(this.canvas, this.getOptions());
|
|
187
60
|
if (this.value) {
|
|
@@ -190,12 +63,8 @@ var SignatureCanvasVue2 = {
|
|
|
190
63
|
this.instance = pad;
|
|
191
64
|
this.instance.setOptions({
|
|
192
65
|
onChange: this.onValueChange,
|
|
193
|
-
onDraw:
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
onDrawEnd: function onDrawEnd() {
|
|
197
|
-
return _this.isDrawing = false;
|
|
198
|
-
}
|
|
66
|
+
onDraw: this.onDraw,
|
|
67
|
+
onDrawEnd: this.onDrawEnd
|
|
199
68
|
});
|
|
200
69
|
},
|
|
201
70
|
destroyed: !!isV3 ? undefined : function () {
|
|
@@ -225,6 +94,7 @@ var SignatureCanvasVue2 = {
|
|
|
225
94
|
tabIndex: (0, kendo_vue_common_1.getTabIndex)(this.$props.tabIndex, this.$props.disabled),
|
|
226
95
|
role: "img",
|
|
227
96
|
id: this.$props.id,
|
|
97
|
+
name: this.$props.name,
|
|
228
98
|
"aria-label": this.$props.ariaLabel,
|
|
229
99
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
230
100
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
@@ -232,6 +102,7 @@ var SignatureCanvasVue2 = {
|
|
|
232
102
|
},
|
|
233
103
|
role: "img",
|
|
234
104
|
id: this.$props.id,
|
|
105
|
+
name: this.$props.name,
|
|
235
106
|
"aria-label": this.$props.ariaLabel,
|
|
236
107
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
237
108
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
@@ -240,21 +111,23 @@ var SignatureCanvasVue2 = {
|
|
|
240
111
|
},
|
|
241
112
|
methods: {
|
|
242
113
|
onValueChange: function onValueChange() {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
switch (_a.label) {
|
|
247
|
-
case 0:
|
|
248
|
-
return [4 /*yield*/, this.exportImage(this.elementSize())];
|
|
249
|
-
case 1:
|
|
250
|
-
nextValue = _a.sent();
|
|
251
|
-
this.$emit('change', nextValue);
|
|
252
|
-
return [2 /*return*/];
|
|
253
|
-
}
|
|
254
|
-
});
|
|
114
|
+
var that = this;
|
|
115
|
+
this.exportImage(this.elementSize()).then(function (nextValue) {
|
|
116
|
+
that.$emit('change', nextValue);
|
|
255
117
|
});
|
|
256
118
|
},
|
|
257
|
-
|
|
119
|
+
onDraw: function onDraw() {
|
|
120
|
+
this.$emit('draw');
|
|
121
|
+
},
|
|
122
|
+
onDrawEnd: function onDrawEnd() {
|
|
123
|
+
this.$emit('drawend');
|
|
124
|
+
},
|
|
125
|
+
loadImage: function loadImage(newLocale) {
|
|
126
|
+
this.instance.loadImage(newLocale);
|
|
127
|
+
},
|
|
128
|
+
clear: function clear() {
|
|
129
|
+
this.instance.clear();
|
|
130
|
+
},
|
|
258
131
|
getOptions: function getOptions() {
|
|
259
132
|
return {
|
|
260
133
|
scale: this.popupScale,
|
|
@@ -267,20 +140,11 @@ var SignatureCanvasVue2 = {
|
|
|
267
140
|
},
|
|
268
141
|
exportImage: function exportImage(exportSize) {
|
|
269
142
|
var _a;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
width = exportSize.width, height = exportSize.height;
|
|
276
|
-
return [4 /*yield*/, (_a = this.instance) === null || _a === void 0 ? void 0 : _a.exportImage({
|
|
277
|
-
width: width * this.scale,
|
|
278
|
-
height: height * this.scale
|
|
279
|
-
})];
|
|
280
|
-
case 1:
|
|
281
|
-
return [2 /*return*/, _b.sent()];
|
|
282
|
-
}
|
|
283
|
-
});
|
|
143
|
+
var width = exportSize.width,
|
|
144
|
+
height = exportSize.height;
|
|
145
|
+
return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.exportImage({
|
|
146
|
+
width: width * this.scale,
|
|
147
|
+
height: height * this.scale
|
|
284
148
|
});
|
|
285
149
|
}
|
|
286
150
|
}
|
|
@@ -4,6 +4,9 @@ declare type DefaultMethods<V> = {
|
|
|
4
4
|
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
5
|
};
|
|
6
6
|
import { SignatureCanvasProps } from './interfaces/SignatureCanvasProps';
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
7
10
|
export interface SignatureDialogProps extends SignatureCanvasProps {
|
|
8
11
|
openWrapperClass?: object;
|
|
9
12
|
size?: string;
|
|
@@ -30,7 +30,9 @@ var SignatureDialogVue2 = {
|
|
|
30
30
|
close: null,
|
|
31
31
|
focus: null,
|
|
32
32
|
blur: null,
|
|
33
|
-
overlayclick: null
|
|
33
|
+
overlayclick: null,
|
|
34
|
+
draw: null,
|
|
35
|
+
drawend: null
|
|
34
36
|
},
|
|
35
37
|
props: {
|
|
36
38
|
openWrapperClass: Object,
|
|
@@ -56,6 +58,14 @@ var SignatureDialogVue2 = {
|
|
|
56
58
|
default: null
|
|
57
59
|
}
|
|
58
60
|
},
|
|
61
|
+
data: function data() {
|
|
62
|
+
return {
|
|
63
|
+
isDrawing: false
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
mounted: function mounted() {
|
|
67
|
+
this.openCanvas = (0, kendo_vue_common_1.getRef)(this, 'openCanvas');
|
|
68
|
+
},
|
|
59
69
|
// @ts-ignore
|
|
60
70
|
setup: !isV3 ? undefined : function () {
|
|
61
71
|
var v3 = !!isV3;
|
|
@@ -63,7 +73,6 @@ var SignatureDialogVue2 = {
|
|
|
63
73
|
v3: v3
|
|
64
74
|
};
|
|
65
75
|
},
|
|
66
|
-
// @ts-ignore
|
|
67
76
|
render: function render(createElement) {
|
|
68
77
|
var _this = this;
|
|
69
78
|
var h = gh || createElement;
|
|
@@ -154,12 +163,16 @@ var SignatureDialogVue2 = {
|
|
|
154
163
|
scale: scale,
|
|
155
164
|
onChange: _this.onValueChange,
|
|
156
165
|
on: _this.v3 ? undefined : {
|
|
157
|
-
"change": _this.onValueChange
|
|
166
|
+
"change": _this.onValueChange,
|
|
167
|
+
"draw": _this.onDraw,
|
|
168
|
+
"drawend": _this.onDrawEnd
|
|
158
169
|
},
|
|
159
|
-
elementSize: elementSize
|
|
170
|
+
elementSize: elementSize,
|
|
171
|
+
onDraw: _this.onDraw,
|
|
172
|
+
onDrawend: _this.onDrawEnd
|
|
160
173
|
}), h("div", {
|
|
161
174
|
"class": 'k-signature-actions k-signature-actions-top'
|
|
162
|
-
}, [
|
|
175
|
+
}, [!_this.isDrawing &&
|
|
163
176
|
// @ts-ignore
|
|
164
177
|
h(kendo_vue_buttons_1.Button, {
|
|
165
178
|
"class": 'k-signature-action k-signature-minimize k-rotate-180',
|
|
@@ -228,12 +241,16 @@ var SignatureDialogVue2 = {
|
|
|
228
241
|
scale: scale,
|
|
229
242
|
onChange: _this.onValueChange,
|
|
230
243
|
on: _this.v3 ? undefined : {
|
|
231
|
-
"change": _this.onValueChange
|
|
244
|
+
"change": _this.onValueChange,
|
|
245
|
+
"draw": _this.onDraw,
|
|
246
|
+
"drawend": _this.onDrawEnd
|
|
232
247
|
},
|
|
233
|
-
elementSize: elementSize
|
|
248
|
+
elementSize: elementSize,
|
|
249
|
+
onDraw: _this.onDraw,
|
|
250
|
+
onDrawend: _this.onDrawEnd
|
|
234
251
|
}), h("div", {
|
|
235
252
|
"class": 'k-signature-actions k-signature-actions-top'
|
|
236
|
-
}, [h(kendo_vue_buttons_1.Button, {
|
|
253
|
+
}, [!_this.isDrawing && h(kendo_vue_buttons_1.Button, {
|
|
237
254
|
"class": 'k-signature-action k-signature-minimize k-rotate-180',
|
|
238
255
|
ref: (0, kendo_vue_common_1.setRef)(_this, 'minimizeButton'),
|
|
239
256
|
icon: 'hyperlink-open',
|
|
@@ -260,6 +277,14 @@ var SignatureDialogVue2 = {
|
|
|
260
277
|
return dialog;
|
|
261
278
|
},
|
|
262
279
|
methods: {
|
|
280
|
+
onDraw: function onDraw() {
|
|
281
|
+
this.isDrawing = true;
|
|
282
|
+
this.$emit('draw');
|
|
283
|
+
},
|
|
284
|
+
onDrawEnd: function onDrawEnd() {
|
|
285
|
+
this.isDrawing = false;
|
|
286
|
+
this.$emit('drawend');
|
|
287
|
+
},
|
|
263
288
|
onValueChange: function onValueChange(nextValue) {
|
|
264
289
|
this.$emit('change', nextValue);
|
|
265
290
|
},
|
|
@@ -35,5 +35,8 @@ export interface SignatureLineAll extends Vue2type, SignatureLineMethods, Signat
|
|
|
35
35
|
* @hidden
|
|
36
36
|
*/
|
|
37
37
|
declare let SignatureLineVue2: ComponentOptions<SignatureLineAll, DefaultData<SignatureLineData>, DefaultMethods<SignatureLineAll>, SignatureLineComputed, RecordPropsDefinition<{}>>;
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
38
41
|
declare const SignatureLine: DefineComponent<{}, any, SignatureLineData, SignatureLineComputed, SignatureLineMethods, {}, {}, {}, string, {}, {}, {}>;
|
|
39
42
|
export { SignatureLine, SignatureLineVue2 };
|