@progress/kendo-vue-inputs 3.7.4-dev.202301131104 → 3.7.4-dev.202301151601
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/cdn/js/kendo-vue-inputs.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- 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/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/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
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-inputs',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1673797599,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -188,6 +188,7 @@ var SignatureVue2 = {
|
|
|
188
188
|
default: DEFAULT_EXPORT_SCALE
|
|
189
189
|
},
|
|
190
190
|
modelValue: String,
|
|
191
|
+
name: String,
|
|
191
192
|
value: String,
|
|
192
193
|
tabIndex: Number,
|
|
193
194
|
dir: String,
|
|
@@ -216,6 +217,10 @@ var SignatureVue2 = {
|
|
|
216
217
|
type: Boolean,
|
|
217
218
|
default: false
|
|
218
219
|
},
|
|
220
|
+
valid: {
|
|
221
|
+
type: Boolean,
|
|
222
|
+
default: undefined
|
|
223
|
+
},
|
|
219
224
|
size: {
|
|
220
225
|
type: String,
|
|
221
226
|
default: 'medium',
|
|
@@ -249,9 +254,7 @@ var SignatureVue2 = {
|
|
|
249
254
|
},
|
|
250
255
|
openWrapperClass: function openWrapperClass() {
|
|
251
256
|
var _a;
|
|
252
|
-
var isValid =
|
|
253
|
-
// !this.validityStylesGetter() ||
|
|
254
|
-
this.validityGetter().valid;
|
|
257
|
+
var isValid = !this.validityStyles || this.validityGetter().valid;
|
|
255
258
|
return _a = {
|
|
256
259
|
'k-input': true,
|
|
257
260
|
'k-signature': true,
|
|
@@ -279,6 +282,16 @@ var SignatureVue2 = {
|
|
|
279
282
|
return this.$props.backgroundColor || defaultBackgroundColor;
|
|
280
283
|
}
|
|
281
284
|
},
|
|
285
|
+
watch: {
|
|
286
|
+
computedValue: function computedValue(newValue) {
|
|
287
|
+
if (newValue !== this.currentValue) {
|
|
288
|
+
this.loadImage(newValue);
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
computedOpen: function computedOpen() {
|
|
292
|
+
this.loadImage(this.computedValue);
|
|
293
|
+
}
|
|
294
|
+
},
|
|
282
295
|
data: function data() {
|
|
283
296
|
return {
|
|
284
297
|
focused: false,
|
|
@@ -289,12 +302,10 @@ var SignatureVue2 = {
|
|
|
289
302
|
};
|
|
290
303
|
},
|
|
291
304
|
mounted: function mounted() {
|
|
292
|
-
this.
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
this.
|
|
296
|
-
this.popupWidth = this.popupSize().width;
|
|
297
|
-
this.popupHeight = this.popupSize().height;
|
|
305
|
+
this.setRefs();
|
|
306
|
+
},
|
|
307
|
+
updated: function updated() {
|
|
308
|
+
this.setRefs();
|
|
298
309
|
},
|
|
299
310
|
// @ts-ignore
|
|
300
311
|
setup: !isV3 ? undefined : function () {
|
|
@@ -370,8 +381,9 @@ var SignatureVue2 = {
|
|
|
370
381
|
onBlur: this.onBlur
|
|
371
382
|
}, [h(SignatureCanvas, {
|
|
372
383
|
ref: setRef(this, 'canvas'),
|
|
373
|
-
|
|
384
|
+
name: this.name,
|
|
374
385
|
attrs: this.v3 ? undefined : {
|
|
386
|
+
name: this.name,
|
|
375
387
|
value: this.computedValue,
|
|
376
388
|
tabIndex: this.tabIndex,
|
|
377
389
|
disabled: this.disabled,
|
|
@@ -384,6 +396,7 @@ var SignatureVue2 = {
|
|
|
384
396
|
scale: this.exportScale,
|
|
385
397
|
elementSize: this.elementSize
|
|
386
398
|
},
|
|
399
|
+
value: this.computedValue,
|
|
387
400
|
tabIndex: this.tabIndex,
|
|
388
401
|
disabled: this.disabled,
|
|
389
402
|
readOnly: this.readOnly,
|
|
@@ -395,10 +408,15 @@ var SignatureVue2 = {
|
|
|
395
408
|
scale: this.exportScale,
|
|
396
409
|
onChange: this.onValueChange,
|
|
397
410
|
on: this.v3 ? undefined : {
|
|
398
|
-
"change": this.onValueChange
|
|
411
|
+
"change": this.onValueChange,
|
|
412
|
+
"draw": this.onDraw,
|
|
413
|
+
"drawend": this.onDrawEnd
|
|
399
414
|
},
|
|
400
|
-
elementSize: this.elementSize
|
|
415
|
+
elementSize: this.elementSize,
|
|
416
|
+
onDraw: this.onDraw,
|
|
417
|
+
onDrawend: this.onDrawEnd
|
|
401
418
|
}), actions, hideLine, bottomActions, this.computedOpen && h(SignatureDialog, {
|
|
419
|
+
ref: setRef(this, 'dialog'),
|
|
402
420
|
openWrapperClass: this.openWrapperClass,
|
|
403
421
|
attrs: this.v3 ? undefined : {
|
|
404
422
|
openWrapperClass: this.openWrapperClass,
|
|
@@ -427,7 +445,9 @@ var SignatureVue2 = {
|
|
|
427
445
|
"overlayclick": this.onOverlayClick,
|
|
428
446
|
"focus": this.onFocus,
|
|
429
447
|
"blur": this.onBlur,
|
|
430
|
-
"change": this.onValueChange
|
|
448
|
+
"change": this.onValueChange,
|
|
449
|
+
"draw": this.onDraw,
|
|
450
|
+
"drawend": this.onDrawEnd
|
|
431
451
|
},
|
|
432
452
|
onClear: this.onClear,
|
|
433
453
|
onOverlayclick: this.onOverlayClick,
|
|
@@ -444,10 +464,20 @@ var SignatureVue2 = {
|
|
|
444
464
|
popupScale: this.$props.popupScale,
|
|
445
465
|
scale: 1 / this.popupScale * this.exportScale,
|
|
446
466
|
onChange: this.onValueChange,
|
|
447
|
-
elementSize: this.elementSize
|
|
467
|
+
elementSize: this.elementSize,
|
|
468
|
+
onDraw: this.onDraw,
|
|
469
|
+
onDrawend: this.onDrawEnd
|
|
448
470
|
})]);
|
|
449
471
|
},
|
|
450
472
|
methods: {
|
|
473
|
+
setRefs: function setRefs() {
|
|
474
|
+
this.canvas = getRef(this, 'canvas');
|
|
475
|
+
this.minimizeButton = getRef(this, 'minimizeButton');
|
|
476
|
+
this.maximizeButton = getRef(this, 'maximizeButton');
|
|
477
|
+
this.dialog = getRef(this, 'dialog');
|
|
478
|
+
this.popupWidth = this.popupSize().width;
|
|
479
|
+
this.popupHeight = this.popupSize().height;
|
|
480
|
+
},
|
|
451
481
|
onOverlayClick: function onOverlayClick() {
|
|
452
482
|
this.currentOpen = false;
|
|
453
483
|
},
|
|
@@ -463,8 +493,25 @@ var SignatureVue2 = {
|
|
|
463
493
|
this.onValueChange(e.value);
|
|
464
494
|
},
|
|
465
495
|
reset: function reset() {
|
|
496
|
+
this.clear();
|
|
466
497
|
this.onValueChange();
|
|
467
498
|
},
|
|
499
|
+
clear: function clear() {
|
|
500
|
+
if (this.canvas) {
|
|
501
|
+
this.canvas.clear();
|
|
502
|
+
}
|
|
503
|
+
if (this.dialog && this.dialog.openCanvas) {
|
|
504
|
+
this.dialog.openCanvas.clear();
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
loadImage: function loadImage(value) {
|
|
508
|
+
if (this.canvas) {
|
|
509
|
+
this.canvas.loadImage(value);
|
|
510
|
+
}
|
|
511
|
+
if (this.dialog && this.dialog.openCanvas) {
|
|
512
|
+
this.dialog.openCanvas.loadImage(value);
|
|
513
|
+
}
|
|
514
|
+
},
|
|
468
515
|
onDialogClose: function onDialogClose(event) {
|
|
469
516
|
var _a;
|
|
470
517
|
this.onMinimizeClick(event);
|
|
@@ -472,29 +519,18 @@ var SignatureVue2 = {
|
|
|
472
519
|
},
|
|
473
520
|
exportImage: function exportImage(exportSize) {
|
|
474
521
|
var _a;
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
width = exportSize.width, height = exportSize.height;
|
|
481
|
-
return [4 /*yield*/, (_a = this.canvas.instance) === null || _a === void 0 ? void 0 : _a.exportImage({
|
|
482
|
-
width: width * this.exportScale,
|
|
483
|
-
height: height * this.exportScale
|
|
484
|
-
})];
|
|
485
|
-
case 1:
|
|
486
|
-
return [2 /*return*/, _b.sent()];
|
|
487
|
-
}
|
|
488
|
-
});
|
|
522
|
+
var width = exportSize.width,
|
|
523
|
+
height = exportSize.height;
|
|
524
|
+
return (_a = this.canvas.instance) === null || _a === void 0 ? void 0 : _a.exportImage({
|
|
525
|
+
width: width * this.exportScale,
|
|
526
|
+
height: height * this.exportScale
|
|
489
527
|
});
|
|
490
528
|
},
|
|
491
529
|
validityGetter: function validityGetter() {
|
|
492
530
|
var customError = this.$props.validationMessage !== undefined;
|
|
493
|
-
var currentValue = this.computedValue;
|
|
531
|
+
var currentValue = this.computedValue;
|
|
494
532
|
var valueMissing = !currentValue;
|
|
495
|
-
var valid = this.$props.valid !== undefined ? this.$props.valid :
|
|
496
|
-
// !requiredGetter() ||
|
|
497
|
-
!valueMissing;
|
|
533
|
+
var valid = this.$props.valid !== undefined ? this.$props.valid : !this.required || !valueMissing;
|
|
498
534
|
return {
|
|
499
535
|
customError: customError,
|
|
500
536
|
valid: valid,
|
|
@@ -509,14 +545,27 @@ var SignatureVue2 = {
|
|
|
509
545
|
element: this.$el,
|
|
510
546
|
focus: this.focusElement()
|
|
511
547
|
};
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
548
|
+
Object.defineProperty(options, 'name', {
|
|
549
|
+
get: this.name
|
|
550
|
+
});
|
|
551
|
+
Object.defineProperty(options, 'value', {
|
|
552
|
+
get: this.computedValue
|
|
553
|
+
});
|
|
554
|
+
Object.defineProperty(options, 'validity', {
|
|
555
|
+
get: this.validityGetter()
|
|
556
|
+
});
|
|
557
|
+
Object.defineProperty(options, 'validityStyles', {
|
|
558
|
+
get: this.validityStyles
|
|
559
|
+
});
|
|
560
|
+
Object.defineProperty(options, 'required', {
|
|
561
|
+
get: this.required
|
|
562
|
+
});
|
|
563
|
+
Object.defineProperty(options, 'color', {
|
|
564
|
+
get: this.computedColor
|
|
565
|
+
});
|
|
566
|
+
Object.defineProperty(options, 'backgroundColor', {
|
|
567
|
+
get: this.computedBgColor
|
|
568
|
+
});
|
|
520
569
|
return options;
|
|
521
570
|
},
|
|
522
571
|
onFocus: function onFocus(event) {
|
|
@@ -540,20 +589,17 @@ var SignatureVue2 = {
|
|
|
540
589
|
},
|
|
541
590
|
onMaximizeClick: function onMaximizeClick(event) {
|
|
542
591
|
return __awaiter(this, void 0, void 0, function () {
|
|
543
|
-
var
|
|
544
|
-
return __generator(this, function (
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}, this.getImperativeHandle()));
|
|
555
|
-
return [2 /*return*/];
|
|
556
|
-
}
|
|
592
|
+
var that;
|
|
593
|
+
return __generator(this, function (_a) {
|
|
594
|
+
that = this;
|
|
595
|
+
this.exportImage(this.popupSize()).then(function (newValue) {
|
|
596
|
+
that.currentValue = newValue;
|
|
597
|
+
});
|
|
598
|
+
this.currentOpen = true;
|
|
599
|
+
this.$emit('open', __assign({
|
|
600
|
+
event: event
|
|
601
|
+
}, this.getImperativeHandle()));
|
|
602
|
+
return [2 /*return*/];
|
|
557
603
|
});
|
|
558
604
|
});
|
|
559
605
|
},
|
|
@@ -584,6 +630,12 @@ var SignatureVue2 = {
|
|
|
584
630
|
width: width * this.popupScale,
|
|
585
631
|
height: height * this.popupScale
|
|
586
632
|
};
|
|
633
|
+
},
|
|
634
|
+
onDraw: function onDraw() {
|
|
635
|
+
this.isDrawing = true;
|
|
636
|
+
},
|
|
637
|
+
onDrawEnd: function onDrawEnd() {
|
|
638
|
+
this.isDrawing = false;
|
|
587
639
|
}
|
|
588
640
|
}
|
|
589
641
|
};
|
|
@@ -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,120 +1,3 @@
|
|
|
1
|
-
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) {
|
|
3
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
4
|
-
resolve(value);
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
-
function fulfilled(value) {
|
|
9
|
-
try {
|
|
10
|
-
step(generator.next(value));
|
|
11
|
-
} catch (e) {
|
|
12
|
-
reject(e);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function rejected(value) {
|
|
16
|
-
try {
|
|
17
|
-
step(generator["throw"](value));
|
|
18
|
-
} catch (e) {
|
|
19
|
-
reject(e);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function step(result) {
|
|
23
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
24
|
-
}
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
var __generator = this && this.__generator || function (thisArg, body) {
|
|
29
|
-
var _ = {
|
|
30
|
-
label: 0,
|
|
31
|
-
sent: function sent() {
|
|
32
|
-
if (t[0] & 1) throw t[1];
|
|
33
|
-
return t[1];
|
|
34
|
-
},
|
|
35
|
-
trys: [],
|
|
36
|
-
ops: []
|
|
37
|
-
},
|
|
38
|
-
f,
|
|
39
|
-
y,
|
|
40
|
-
t,
|
|
41
|
-
g;
|
|
42
|
-
return g = {
|
|
43
|
-
next: verb(0),
|
|
44
|
-
"throw": verb(1),
|
|
45
|
-
"return": verb(2)
|
|
46
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
47
|
-
return this;
|
|
48
|
-
}), g;
|
|
49
|
-
function verb(n) {
|
|
50
|
-
return function (v) {
|
|
51
|
-
return step([n, v]);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function step(op) {
|
|
55
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (_) {
|
|
57
|
-
try {
|
|
58
|
-
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;
|
|
59
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
60
|
-
switch (op[0]) {
|
|
61
|
-
case 0:
|
|
62
|
-
case 1:
|
|
63
|
-
t = op;
|
|
64
|
-
break;
|
|
65
|
-
case 4:
|
|
66
|
-
_.label++;
|
|
67
|
-
return {
|
|
68
|
-
value: op[1],
|
|
69
|
-
done: false
|
|
70
|
-
};
|
|
71
|
-
case 5:
|
|
72
|
-
_.label++;
|
|
73
|
-
y = op[1];
|
|
74
|
-
op = [0];
|
|
75
|
-
continue;
|
|
76
|
-
case 7:
|
|
77
|
-
op = _.ops.pop();
|
|
78
|
-
_.trys.pop();
|
|
79
|
-
continue;
|
|
80
|
-
default:
|
|
81
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
82
|
-
_ = 0;
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
86
|
-
_.label = op[1];
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
90
|
-
_.label = t[1];
|
|
91
|
-
t = op;
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
if (t && _.label < t[2]) {
|
|
95
|
-
_.label = t[2];
|
|
96
|
-
_.ops.push(op);
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
if (t[2]) _.ops.pop();
|
|
100
|
-
_.trys.pop();
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
op = body.call(thisArg, _);
|
|
104
|
-
} catch (e) {
|
|
105
|
-
op = [6, e];
|
|
106
|
-
y = 0;
|
|
107
|
-
} finally {
|
|
108
|
-
f = t = 0;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (op[0] & 5) throw op[1];
|
|
112
|
-
return {
|
|
113
|
-
value: op[0] ? op[1] : void 0,
|
|
114
|
-
done: true
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
1
|
// @ts-ignore
|
|
119
2
|
import * as Vue from 'vue';
|
|
120
3
|
var allVue = Vue;
|
|
@@ -133,12 +16,11 @@ var setOptions = function setOptions() {
|
|
|
133
16
|
*/
|
|
134
17
|
var SignatureCanvasVue2 = {
|
|
135
18
|
name: 'KendoSignatureCanvas',
|
|
136
|
-
model: {
|
|
137
|
-
event: 'changemodel'
|
|
138
|
-
},
|
|
139
19
|
// @ts-ignore
|
|
140
20
|
emits: {
|
|
141
|
-
change: null
|
|
21
|
+
change: null,
|
|
22
|
+
draw: null,
|
|
23
|
+
drawend: null
|
|
142
24
|
},
|
|
143
25
|
inject: {
|
|
144
26
|
kendoIntlService: {
|
|
@@ -149,6 +31,7 @@ var SignatureCanvasVue2 = {
|
|
|
149
31
|
strokeWidth: Number,
|
|
150
32
|
popupScale: Number,
|
|
151
33
|
scale: Number,
|
|
34
|
+
name: String,
|
|
152
35
|
value: String,
|
|
153
36
|
tabIndex: Number,
|
|
154
37
|
disabled: Boolean,
|
|
@@ -159,15 +42,6 @@ var SignatureCanvasVue2 = {
|
|
|
159
42
|
smooth: Boolean
|
|
160
43
|
},
|
|
161
44
|
watch: {
|
|
162
|
-
value: function value(newLocale) {
|
|
163
|
-
if (this.instance) {
|
|
164
|
-
if (newLocale) {
|
|
165
|
-
this.instance.loadImage(newLocale);
|
|
166
|
-
} else {
|
|
167
|
-
this.instance.clear();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
45
|
color: setOptions,
|
|
172
46
|
backgroundColor: setOptions,
|
|
173
47
|
smooth: setOptions,
|
|
@@ -175,7 +49,6 @@ var SignatureCanvasVue2 = {
|
|
|
175
49
|
readOnly: setOptions
|
|
176
50
|
},
|
|
177
51
|
mounted: function mounted() {
|
|
178
|
-
var _this = this;
|
|
179
52
|
this.canvas = this.$el;
|
|
180
53
|
var pad = new SignaturePad(this.canvas, this.getOptions());
|
|
181
54
|
if (this.value) {
|
|
@@ -184,12 +57,8 @@ var SignatureCanvasVue2 = {
|
|
|
184
57
|
this.instance = pad;
|
|
185
58
|
this.instance.setOptions({
|
|
186
59
|
onChange: this.onValueChange,
|
|
187
|
-
onDraw:
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
-
onDrawEnd: function onDrawEnd() {
|
|
191
|
-
return _this.isDrawing = false;
|
|
192
|
-
}
|
|
60
|
+
onDraw: this.onDraw,
|
|
61
|
+
onDrawEnd: this.onDrawEnd
|
|
193
62
|
});
|
|
194
63
|
},
|
|
195
64
|
destroyed: !!isV3 ? undefined : function () {
|
|
@@ -219,6 +88,7 @@ var SignatureCanvasVue2 = {
|
|
|
219
88
|
tabIndex: getTabIndex(this.$props.tabIndex, this.$props.disabled),
|
|
220
89
|
role: "img",
|
|
221
90
|
id: this.$props.id,
|
|
91
|
+
name: this.$props.name,
|
|
222
92
|
"aria-label": this.$props.ariaLabel,
|
|
223
93
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
224
94
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
@@ -226,6 +96,7 @@ var SignatureCanvasVue2 = {
|
|
|
226
96
|
},
|
|
227
97
|
role: "img",
|
|
228
98
|
id: this.$props.id,
|
|
99
|
+
name: this.$props.name,
|
|
229
100
|
"aria-label": this.$props.ariaLabel,
|
|
230
101
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
231
102
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
@@ -234,21 +105,23 @@ var SignatureCanvasVue2 = {
|
|
|
234
105
|
},
|
|
235
106
|
methods: {
|
|
236
107
|
onValueChange: function onValueChange() {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
switch (_a.label) {
|
|
241
|
-
case 0:
|
|
242
|
-
return [4 /*yield*/, this.exportImage(this.elementSize())];
|
|
243
|
-
case 1:
|
|
244
|
-
nextValue = _a.sent();
|
|
245
|
-
this.$emit('change', nextValue);
|
|
246
|
-
return [2 /*return*/];
|
|
247
|
-
}
|
|
248
|
-
});
|
|
108
|
+
var that = this;
|
|
109
|
+
this.exportImage(this.elementSize()).then(function (nextValue) {
|
|
110
|
+
that.$emit('change', nextValue);
|
|
249
111
|
});
|
|
250
112
|
},
|
|
251
|
-
|
|
113
|
+
onDraw: function onDraw() {
|
|
114
|
+
this.$emit('draw');
|
|
115
|
+
},
|
|
116
|
+
onDrawEnd: function onDrawEnd() {
|
|
117
|
+
this.$emit('drawend');
|
|
118
|
+
},
|
|
119
|
+
loadImage: function loadImage(newLocale) {
|
|
120
|
+
this.instance.loadImage(newLocale);
|
|
121
|
+
},
|
|
122
|
+
clear: function clear() {
|
|
123
|
+
this.instance.clear();
|
|
124
|
+
},
|
|
252
125
|
getOptions: function getOptions() {
|
|
253
126
|
return {
|
|
254
127
|
scale: this.popupScale,
|
|
@@ -261,20 +134,11 @@ var SignatureCanvasVue2 = {
|
|
|
261
134
|
},
|
|
262
135
|
exportImage: function exportImage(exportSize) {
|
|
263
136
|
var _a;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
width = exportSize.width, height = exportSize.height;
|
|
270
|
-
return [4 /*yield*/, (_a = this.instance) === null || _a === void 0 ? void 0 : _a.exportImage({
|
|
271
|
-
width: width * this.scale,
|
|
272
|
-
height: height * this.scale
|
|
273
|
-
})];
|
|
274
|
-
case 1:
|
|
275
|
-
return [2 /*return*/, _b.sent()];
|
|
276
|
-
}
|
|
277
|
-
});
|
|
137
|
+
var width = exportSize.width,
|
|
138
|
+
height = exportSize.height;
|
|
139
|
+
return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.exportImage({
|
|
140
|
+
width: width * this.scale,
|
|
141
|
+
height: height * this.scale
|
|
278
142
|
});
|
|
279
143
|
}
|
|
280
144
|
}
|
|
@@ -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;
|
|
@@ -8,7 +8,7 @@ import { SignatureBottomActions } from './SignatureBottomActions.js';
|
|
|
8
8
|
import { SignatureLine } from './SignatureLine.js';
|
|
9
9
|
import { Button } from '@progress/kendo-vue-buttons';
|
|
10
10
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
11
|
-
import { setRef } from '@progress/kendo-vue-common';
|
|
11
|
+
import { getRef, setRef } from '@progress/kendo-vue-common';
|
|
12
12
|
import { hyperlinkOpenIcon } from '@progress/kendo-svg-icons';
|
|
13
13
|
import { SignatureCanvas } from './SignatureCanvas.js';
|
|
14
14
|
import { messages, signatureClear, signatureMinimize } from '../messages/main.js';
|
|
@@ -24,7 +24,9 @@ var SignatureDialogVue2 = {
|
|
|
24
24
|
close: null,
|
|
25
25
|
focus: null,
|
|
26
26
|
blur: null,
|
|
27
|
-
overlayclick: null
|
|
27
|
+
overlayclick: null,
|
|
28
|
+
draw: null,
|
|
29
|
+
drawend: null
|
|
28
30
|
},
|
|
29
31
|
props: {
|
|
30
32
|
openWrapperClass: Object,
|
|
@@ -50,6 +52,14 @@ var SignatureDialogVue2 = {
|
|
|
50
52
|
default: null
|
|
51
53
|
}
|
|
52
54
|
},
|
|
55
|
+
data: function data() {
|
|
56
|
+
return {
|
|
57
|
+
isDrawing: false
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
mounted: function mounted() {
|
|
61
|
+
this.openCanvas = getRef(this, 'openCanvas');
|
|
62
|
+
},
|
|
53
63
|
// @ts-ignore
|
|
54
64
|
setup: !isV3 ? undefined : function () {
|
|
55
65
|
var v3 = !!isV3;
|
|
@@ -57,7 +67,6 @@ var SignatureDialogVue2 = {
|
|
|
57
67
|
v3: v3
|
|
58
68
|
};
|
|
59
69
|
},
|
|
60
|
-
// @ts-ignore
|
|
61
70
|
render: function render(createElement) {
|
|
62
71
|
var _this = this;
|
|
63
72
|
var h = gh || createElement;
|
|
@@ -148,12 +157,16 @@ var SignatureDialogVue2 = {
|
|
|
148
157
|
scale: scale,
|
|
149
158
|
onChange: _this.onValueChange,
|
|
150
159
|
on: _this.v3 ? undefined : {
|
|
151
|
-
"change": _this.onValueChange
|
|
160
|
+
"change": _this.onValueChange,
|
|
161
|
+
"draw": _this.onDraw,
|
|
162
|
+
"drawend": _this.onDrawEnd
|
|
152
163
|
},
|
|
153
|
-
elementSize: elementSize
|
|
164
|
+
elementSize: elementSize,
|
|
165
|
+
onDraw: _this.onDraw,
|
|
166
|
+
onDrawend: _this.onDrawEnd
|
|
154
167
|
}), h("div", {
|
|
155
168
|
"class": 'k-signature-actions k-signature-actions-top'
|
|
156
|
-
}, [
|
|
169
|
+
}, [!_this.isDrawing &&
|
|
157
170
|
// @ts-ignore
|
|
158
171
|
h(Button, {
|
|
159
172
|
"class": 'k-signature-action k-signature-minimize k-rotate-180',
|
|
@@ -222,12 +235,16 @@ var SignatureDialogVue2 = {
|
|
|
222
235
|
scale: scale,
|
|
223
236
|
onChange: _this.onValueChange,
|
|
224
237
|
on: _this.v3 ? undefined : {
|
|
225
|
-
"change": _this.onValueChange
|
|
238
|
+
"change": _this.onValueChange,
|
|
239
|
+
"draw": _this.onDraw,
|
|
240
|
+
"drawend": _this.onDrawEnd
|
|
226
241
|
},
|
|
227
|
-
elementSize: elementSize
|
|
242
|
+
elementSize: elementSize,
|
|
243
|
+
onDraw: _this.onDraw,
|
|
244
|
+
onDrawend: _this.onDrawEnd
|
|
228
245
|
}), h("div", {
|
|
229
246
|
"class": 'k-signature-actions k-signature-actions-top'
|
|
230
|
-
}, [h(Button, {
|
|
247
|
+
}, [!_this.isDrawing && h(Button, {
|
|
231
248
|
"class": 'k-signature-action k-signature-minimize k-rotate-180',
|
|
232
249
|
ref: setRef(_this, 'minimizeButton'),
|
|
233
250
|
icon: 'hyperlink-open',
|
|
@@ -254,6 +271,14 @@ var SignatureDialogVue2 = {
|
|
|
254
271
|
return dialog;
|
|
255
272
|
},
|
|
256
273
|
methods: {
|
|
274
|
+
onDraw: function onDraw() {
|
|
275
|
+
this.isDrawing = true;
|
|
276
|
+
this.$emit('draw');
|
|
277
|
+
},
|
|
278
|
+
onDrawEnd: function onDrawEnd() {
|
|
279
|
+
this.isDrawing = false;
|
|
280
|
+
this.$emit('drawend');
|
|
281
|
+
},
|
|
257
282
|
onValueChange: function onValueChange(nextValue) {
|
|
258
283
|
this.$emit('change', nextValue);
|
|
259
284
|
},
|
|
@@ -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 };
|