@progress/kendo-vue-inputs 3.7.4-dev.202212020747 → 3.7.4-dev.202212300853

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.
Files changed (126) hide show
  1. package/README.md +1 -1
  2. package/dist/cdn/js/kendo-vue-inputs.js +1 -1
  3. package/dist/es/colors/ColorContrastLabels.js +26 -10
  4. package/dist/es/colors/ColorGradient.js +14 -4
  5. package/dist/es/colors/ColorPicker.js +23 -7
  6. package/dist/es/colors/FlatColorPicker.js +51 -21
  7. package/dist/es/input/Input.d.ts +9 -0
  8. package/dist/es/input/Input.js +33 -11
  9. package/dist/es/main.d.ts +2 -0
  10. package/dist/es/main.js +2 -0
  11. package/dist/es/maskedtextbox/MaskedTextBox.js +30 -9
  12. package/dist/es/messages/main.d.ts +40 -0
  13. package/dist/es/messages/main.js +41 -2
  14. package/dist/es/numerictextbox/NumericTextBox.js +29 -12
  15. package/dist/es/package-metadata.js +1 -1
  16. package/dist/es/range-slider/RangeSlider.js +9 -3
  17. package/dist/es/signature/Signature.d.ts +39 -0
  18. package/dist/es/signature/Signature.js +626 -0
  19. package/dist/es/signature/SignatureCanvas.d.ts +39 -0
  20. package/dist/es/signature/SignatureCanvas.js +282 -0
  21. package/dist/es/signature/interfaces/SignatureBlurEvent.d.ts +5 -0
  22. package/dist/es/signature/interfaces/SignatureBlurEvent.js +1 -0
  23. package/dist/es/signature/interfaces/SignatureCanvasProps.d.ts +14 -0
  24. package/dist/es/signature/interfaces/SignatureCanvasProps.js +1 -0
  25. package/dist/es/signature/interfaces/SignatureChangeEvent.d.ts +9 -0
  26. package/dist/es/signature/interfaces/SignatureChangeEvent.js +1 -0
  27. package/dist/es/signature/interfaces/SignatureCloseEvent.d.ts +5 -0
  28. package/dist/es/signature/interfaces/SignatureCloseEvent.js +1 -0
  29. package/dist/es/signature/interfaces/SignatureFocusEvent.d.ts +5 -0
  30. package/dist/es/signature/interfaces/SignatureFocusEvent.js +1 -0
  31. package/dist/es/signature/interfaces/SignatureHandle.d.ts +42 -0
  32. package/dist/es/signature/interfaces/SignatureHandle.js +1 -0
  33. package/dist/es/signature/interfaces/SignatureOpenEvent.d.ts +5 -0
  34. package/dist/es/signature/interfaces/SignatureOpenEvent.js +1 -0
  35. package/dist/es/signature/interfaces/SignatureProps.d.ts +192 -0
  36. package/dist/es/signature/interfaces/SignatureProps.js +1 -0
  37. package/dist/es/signature/interfaces/index.d.ts +7 -0
  38. package/dist/es/signature/interfaces/index.js +1 -0
  39. package/dist/es/signature/utils/index.d.ts +4 -0
  40. package/dist/es/signature/utils/index.js +10 -0
  41. package/dist/es/slider/Slider.js +37 -25
  42. package/dist/es/switch/Switch.js +7 -7
  43. package/dist/es/textarea/TextArea.js +24 -9
  44. package/dist/esm/colors/ColorContrastLabels.js +26 -10
  45. package/dist/esm/colors/ColorGradient.js +14 -4
  46. package/dist/esm/colors/ColorPicker.js +23 -7
  47. package/dist/esm/colors/FlatColorPicker.js +51 -21
  48. package/dist/esm/input/Input.d.ts +9 -0
  49. package/dist/esm/input/Input.js +33 -11
  50. package/dist/esm/main.d.ts +2 -0
  51. package/dist/esm/main.js +2 -0
  52. package/dist/esm/maskedtextbox/MaskedTextBox.js +30 -9
  53. package/dist/esm/messages/main.d.ts +40 -0
  54. package/dist/esm/messages/main.js +41 -2
  55. package/dist/esm/numerictextbox/NumericTextBox.js +29 -12
  56. package/dist/esm/package-metadata.js +1 -1
  57. package/dist/esm/range-slider/RangeSlider.js +9 -3
  58. package/dist/esm/signature/Signature.d.ts +39 -0
  59. package/dist/esm/signature/Signature.js +626 -0
  60. package/dist/esm/signature/SignatureCanvas.d.ts +39 -0
  61. package/dist/esm/signature/SignatureCanvas.js +282 -0
  62. package/dist/esm/signature/interfaces/SignatureBlurEvent.d.ts +5 -0
  63. package/dist/esm/signature/interfaces/SignatureBlurEvent.js +1 -0
  64. package/dist/esm/signature/interfaces/SignatureCanvasProps.d.ts +14 -0
  65. package/dist/esm/signature/interfaces/SignatureCanvasProps.js +1 -0
  66. package/dist/esm/signature/interfaces/SignatureChangeEvent.d.ts +9 -0
  67. package/dist/esm/signature/interfaces/SignatureChangeEvent.js +1 -0
  68. package/dist/esm/signature/interfaces/SignatureCloseEvent.d.ts +5 -0
  69. package/dist/esm/signature/interfaces/SignatureCloseEvent.js +1 -0
  70. package/dist/esm/signature/interfaces/SignatureFocusEvent.d.ts +5 -0
  71. package/dist/esm/signature/interfaces/SignatureFocusEvent.js +1 -0
  72. package/dist/esm/signature/interfaces/SignatureHandle.d.ts +42 -0
  73. package/dist/esm/signature/interfaces/SignatureHandle.js +1 -0
  74. package/dist/esm/signature/interfaces/SignatureOpenEvent.d.ts +5 -0
  75. package/dist/esm/signature/interfaces/SignatureOpenEvent.js +1 -0
  76. package/dist/esm/signature/interfaces/SignatureProps.d.ts +192 -0
  77. package/dist/esm/signature/interfaces/SignatureProps.js +1 -0
  78. package/dist/esm/signature/interfaces/index.d.ts +7 -0
  79. package/dist/esm/signature/interfaces/index.js +1 -0
  80. package/dist/esm/signature/utils/index.d.ts +4 -0
  81. package/dist/esm/signature/utils/index.js +10 -0
  82. package/dist/esm/slider/Slider.js +37 -25
  83. package/dist/esm/switch/Switch.js +7 -7
  84. package/dist/esm/textarea/TextArea.js +24 -9
  85. package/dist/npm/colors/ColorContrastLabels.js +26 -10
  86. package/dist/npm/colors/ColorGradient.js +13 -3
  87. package/dist/npm/colors/ColorPicker.js +23 -7
  88. package/dist/npm/colors/FlatColorPicker.js +50 -20
  89. package/dist/npm/input/Input.d.ts +9 -0
  90. package/dist/npm/input/Input.js +32 -10
  91. package/dist/npm/main.d.ts +2 -0
  92. package/dist/npm/main.js +2 -0
  93. package/dist/npm/maskedtextbox/MaskedTextBox.js +29 -8
  94. package/dist/npm/messages/main.d.ts +40 -0
  95. package/dist/npm/messages/main.js +42 -3
  96. package/dist/npm/numerictextbox/NumericTextBox.js +28 -11
  97. package/dist/npm/package-metadata.js +1 -1
  98. package/dist/npm/range-slider/RangeSlider.js +9 -3
  99. package/dist/npm/signature/Signature.d.ts +39 -0
  100. package/dist/npm/signature/Signature.js +633 -0
  101. package/dist/npm/signature/SignatureCanvas.d.ts +39 -0
  102. package/dist/npm/signature/SignatureCanvas.js +289 -0
  103. package/dist/npm/signature/interfaces/SignatureBlurEvent.d.ts +5 -0
  104. package/dist/npm/signature/interfaces/SignatureBlurEvent.js +5 -0
  105. package/dist/npm/signature/interfaces/SignatureCanvasProps.d.ts +14 -0
  106. package/dist/npm/signature/interfaces/SignatureCanvasProps.js +5 -0
  107. package/dist/npm/signature/interfaces/SignatureChangeEvent.d.ts +9 -0
  108. package/dist/npm/signature/interfaces/SignatureChangeEvent.js +5 -0
  109. package/dist/npm/signature/interfaces/SignatureCloseEvent.d.ts +5 -0
  110. package/dist/npm/signature/interfaces/SignatureCloseEvent.js +5 -0
  111. package/dist/npm/signature/interfaces/SignatureFocusEvent.d.ts +5 -0
  112. package/dist/npm/signature/interfaces/SignatureFocusEvent.js +5 -0
  113. package/dist/npm/signature/interfaces/SignatureHandle.d.ts +42 -0
  114. package/dist/npm/signature/interfaces/SignatureHandle.js +5 -0
  115. package/dist/npm/signature/interfaces/SignatureOpenEvent.d.ts +5 -0
  116. package/dist/npm/signature/interfaces/SignatureOpenEvent.js +5 -0
  117. package/dist/npm/signature/interfaces/SignatureProps.d.ts +192 -0
  118. package/dist/npm/signature/interfaces/SignatureProps.js +5 -0
  119. package/dist/npm/signature/interfaces/index.d.ts +7 -0
  120. package/dist/npm/signature/interfaces/index.js +2 -0
  121. package/dist/npm/signature/utils/index.d.ts +4 -0
  122. package/dist/npm/signature/utils/index.js +14 -0
  123. package/dist/npm/slider/Slider.js +36 -24
  124. package/dist/npm/switch/Switch.js +7 -7
  125. package/dist/npm/textarea/TextArea.js +23 -8
  126. package/package.json +15 -11
@@ -0,0 +1,626 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) {
6
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
7
+ }
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) {
15
+ return value instanceof P ? value : new P(function (resolve) {
16
+ resolve(value);
17
+ });
18
+ }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) {
21
+ try {
22
+ step(generator.next(value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function rejected(value) {
28
+ try {
29
+ step(generator["throw"](value));
30
+ } catch (e) {
31
+ reject(e);
32
+ }
33
+ }
34
+ function step(result) {
35
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
36
+ }
37
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
38
+ });
39
+ };
40
+ var __generator = this && this.__generator || function (thisArg, body) {
41
+ var _ = {
42
+ label: 0,
43
+ sent: function sent() {
44
+ if (t[0] & 1) throw t[1];
45
+ return t[1];
46
+ },
47
+ trys: [],
48
+ ops: []
49
+ },
50
+ f,
51
+ y,
52
+ t,
53
+ g;
54
+ return g = {
55
+ next: verb(0),
56
+ "throw": verb(1),
57
+ "return": verb(2)
58
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
59
+ return this;
60
+ }), g;
61
+ function verb(n) {
62
+ return function (v) {
63
+ return step([n, v]);
64
+ };
65
+ }
66
+ function step(op) {
67
+ if (f) throw new TypeError("Generator is already executing.");
68
+ while (_) {
69
+ try {
70
+ 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;
71
+ if (y = 0, t) op = [op[0] & 2, t.value];
72
+ switch (op[0]) {
73
+ case 0:
74
+ case 1:
75
+ t = op;
76
+ break;
77
+ case 4:
78
+ _.label++;
79
+ return {
80
+ value: op[1],
81
+ done: false
82
+ };
83
+ case 5:
84
+ _.label++;
85
+ y = op[1];
86
+ op = [0];
87
+ continue;
88
+ case 7:
89
+ op = _.ops.pop();
90
+ _.trys.pop();
91
+ continue;
92
+ default:
93
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
94
+ _ = 0;
95
+ continue;
96
+ }
97
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
98
+ _.label = op[1];
99
+ break;
100
+ }
101
+ if (op[0] === 6 && _.label < t[1]) {
102
+ _.label = t[1];
103
+ t = op;
104
+ break;
105
+ }
106
+ if (t && _.label < t[2]) {
107
+ _.label = t[2];
108
+ _.ops.push(op);
109
+ break;
110
+ }
111
+ if (t[2]) _.ops.pop();
112
+ _.trys.pop();
113
+ continue;
114
+ }
115
+ op = body.call(thisArg, _);
116
+ } catch (e) {
117
+ op = [6, e];
118
+ y = 0;
119
+ } finally {
120
+ f = t = 0;
121
+ }
122
+ }
123
+ if (op[0] & 5) throw op[1];
124
+ return {
125
+ value: op[0] ? op[1] : void 0,
126
+ done: true
127
+ };
128
+ }
129
+ };
130
+ // @ts-ignore
131
+ import * as Vue from 'vue';
132
+ var allVue = Vue;
133
+ var gh = allVue.h;
134
+ var isV3 = allVue.version && allVue.version[0] === '3';
135
+ var ref = allVue.ref;
136
+ import { Button } from '@progress/kendo-vue-buttons';
137
+ import { kendoThemeMaps, setRef, getRef, validatePackage } from '@progress/kendo-vue-common';
138
+ import { Dialog } from '@progress/kendo-vue-dialogs';
139
+ import { provideLocalizationService } from '@progress/kendo-vue-intl';
140
+ import { messages, signatureClear, signatureMaximize, signatureMinimize } from '../messages/main';
141
+ import { packageMetadata } from '../package-metadata';
142
+ import { SignatureCanvas } from './SignatureCanvas';
143
+ import { hasParent } from './utils';
144
+ var DEFAULT_WIDTH = 250;
145
+ var DEFAULT_HEIGHT = 84;
146
+ var DEFAULT_POPUP_SCALE = 3;
147
+ var DEFAULT_EXPORT_SCALE = 2;
148
+ var DEFAULT_COLOR = '#000000';
149
+ var DEFAULT_BACKGROUND_COLOR = '#ffffff';
150
+ /**
151
+ * @hidden
152
+ */
153
+ var SignatureVue2 = {
154
+ name: 'KendoSignature',
155
+ model: {
156
+ event: 'changemodel'
157
+ },
158
+ // @ts-ignore
159
+ emits: {
160
+ change: null,
161
+ focus: null,
162
+ blur: null,
163
+ open: null,
164
+ close: null,
165
+ 'changemodel': null,
166
+ 'update:modelValue': null
167
+ },
168
+ inject: {
169
+ kendoLocalizationService: {
170
+ default: null
171
+ }
172
+ },
173
+ props: {
174
+ strokeWidth: {
175
+ type: Number,
176
+ default: 1
177
+ },
178
+ smooth: Boolean,
179
+ popupScale: {
180
+ type: Number,
181
+ default: DEFAULT_POPUP_SCALE
182
+ },
183
+ exportScale: {
184
+ type: Number,
185
+ default: DEFAULT_EXPORT_SCALE
186
+ },
187
+ modelValue: String,
188
+ value: String,
189
+ tabIndex: Number,
190
+ dir: String,
191
+ ariaDescribedBy: String,
192
+ ariaLabelledBy: String,
193
+ ariaLabel: String,
194
+ hideLine: Boolean,
195
+ open: {
196
+ type: Boolean,
197
+ default: undefined
198
+ },
199
+ readOnly: Boolean,
200
+ disabled: Boolean,
201
+ validationMessage: String,
202
+ maximizable: {
203
+ type: Boolean,
204
+ default: true
205
+ },
206
+ color: String,
207
+ backgroundColor: String,
208
+ validityStyles: {
209
+ type: Boolean,
210
+ default: true
211
+ },
212
+ required: {
213
+ type: Boolean,
214
+ default: false
215
+ },
216
+ size: {
217
+ type: String,
218
+ default: 'medium',
219
+ validator: function validator(value) {
220
+ return [null, 'small', 'medium', 'large'].includes(value);
221
+ }
222
+ },
223
+ rounded: {
224
+ type: String,
225
+ default: 'medium',
226
+ validator: function validator(value) {
227
+ return [null, 'small', 'medium', 'large'].includes(value);
228
+ }
229
+ },
230
+ fillMode: {
231
+ type: String,
232
+ default: 'solid',
233
+ validator: function validator(value) {
234
+ return [null, 'solid', 'flat', 'outline'].includes(value);
235
+ }
236
+ }
237
+ },
238
+ created: function created() {
239
+ validatePackage(packageMetadata);
240
+ },
241
+ computed: {
242
+ wrapperClass: function wrapperClass() {
243
+ return __assign(__assign({}, this.openWrapperClass), {
244
+ 'k-signature-maximized': false
245
+ });
246
+ },
247
+ openWrapperClass: function openWrapperClass() {
248
+ var _a;
249
+ var isValid =
250
+ // !this.validityStylesGetter() ||
251
+ this.validityGetter().valid;
252
+ return _a = {
253
+ 'k-input': true,
254
+ 'k-signature': true,
255
+ 'k-signature-maximized': true
256
+ }, _a["k-signature-".concat(kendoThemeMaps.sizeMap[this.$props.size] || this.$props.size)] = this.$props.size, _a["k-input-".concat(this.$props.fillMode)] = this.$props.fillMode, _a["k-rounded-".concat(kendoThemeMaps.roundedMap[this.$props.rounded] || this.$props.rounded)] = this.$props.rounded, _a['k-invalid'] = !isValid, _a['k-required'] = this.$props.required, _a['k-disabled'] = this.$props.disabled, _a['k-focus'] = this.focused, _a;
257
+ },
258
+ computedValue: function computedValue() {
259
+ return this.value !== undefined ? this.value : this.$props.modelValue !== undefined ? this.$props.modelValue : this.currentValue;
260
+ },
261
+ computedOpen: function computedOpen() {
262
+ return this.open !== undefined ? this.open : this.currentOpen;
263
+ },
264
+ computedColor: function computedColor() {
265
+ var defaultColor = DEFAULT_COLOR;
266
+ if (!this.$props.color && typeof document !== 'undefined' && this.$el) {
267
+ defaultColor = getComputedStyle(this.$el).color;
268
+ }
269
+ return this.$props.color || defaultColor;
270
+ },
271
+ computedBgColor: function computedBgColor() {
272
+ var defaultBackgroundColor = DEFAULT_BACKGROUND_COLOR;
273
+ if (!this.$props.backgroundColor && typeof document !== 'undefined' && this.$el) {
274
+ defaultBackgroundColor = getComputedStyle(this.$el).backgroundColor;
275
+ }
276
+ return this.$props.backgroundColor || defaultBackgroundColor;
277
+ }
278
+ },
279
+ data: function data() {
280
+ return {
281
+ focused: false,
282
+ isDrawing: false,
283
+ currentValue: undefined,
284
+ popupValue: undefined,
285
+ currentOpen: false
286
+ };
287
+ },
288
+ mounted: function mounted() {
289
+ this.canvas = getRef(this, 'canvas');
290
+ this.minimizeButton = getRef(this, 'minimizeButton');
291
+ this.maximizeButton = getRef(this, 'maximizeButton');
292
+ this.dialog = getRef(this, 'dialog');
293
+ this.popupWidth = this.popupSize().width;
294
+ this.popupHeight = this.popupSize().height;
295
+ },
296
+ // @ts-ignore
297
+ setup: !isV3 ? undefined : function () {
298
+ var v3 = !!isV3;
299
+ var inputRef = ref(null);
300
+ return {
301
+ v3: v3,
302
+ inputRef: inputRef
303
+ };
304
+ },
305
+ render: function render(createElement) {
306
+ var _this = this;
307
+ var h = gh || createElement;
308
+ var ls = provideLocalizationService(this);
309
+ var showMaximize = !(this.computedOpen || this.isDrawing || !this.$props.maximizable || this.$props.disabled);
310
+ var showMinimize = this.computedOpen && !this.isDrawing;
311
+ var isEmpty = !this.computedValue;
312
+ var showClear = !(isEmpty || this.isDrawing || this.$props.readOnly || this.$props.disabled);
313
+ var maximizeTitle = ls.toLanguageString(signatureMaximize, messages[signatureMaximize]);
314
+ var minimizeTitle = ls.toLanguageString(signatureMinimize, messages[signatureMinimize]);
315
+ var clearTitle = ls.toLanguageString(signatureClear, messages[signatureClear]);
316
+ var renderCanvas = function renderCanvas(refName) {
317
+ return h(SignatureCanvas, {
318
+ ref: setRef(this, refName),
319
+ value: this.computedValue,
320
+ attrs: this.v3 ? undefined : {
321
+ value: this.computedValue,
322
+ tabIndex: this.tabIndex,
323
+ disabled: this.disabled,
324
+ color: this.computedColor,
325
+ backgroundColor: this.computedBgColor,
326
+ strokeWidth: this.strokeWidth,
327
+ smooth: this.smooth,
328
+ popupScale: refName === 'openCanvas' ? this.$props.popupScale : 1,
329
+ scale: refName === 'openCanvas' ? 1 / this.popupScale * this.exportScale : this.exportScale,
330
+ elementSize: this.elementSize
331
+ },
332
+ tabIndex: this.tabIndex,
333
+ disabled: this.disabled,
334
+ color: this.computedColor,
335
+ backgroundColor: this.computedBgColor,
336
+ strokeWidth: this.strokeWidth,
337
+ smooth: this.smooth,
338
+ popupScale: refName === 'openCanvas' ? this.$props.popupScale : 1,
339
+ scale: refName === 'openCanvas' ? 1 / this.popupScale * this.exportScale : this.exportScale,
340
+ onChange: this.onValueChange,
341
+ on: this.v3 ? undefined : {
342
+ "change": this.onValueChange
343
+ },
344
+ elementSize: this.elementSize
345
+ });
346
+ };
347
+ var canvasDiv = renderCanvas.call(this, 'canvas');
348
+ var actions = h("div", {
349
+ "class": 'k-signature-actions k-signature-actions-top'
350
+ }, [showMaximize &&
351
+ // @ts-ignore
352
+ h(Button, {
353
+ "class": 'k-signature-action k-signature-maximize',
354
+ ref: setRef(this, 'maximizeButton'),
355
+ icon: 'hyperlink-open',
356
+ attrs: this.v3 ? undefined : {
357
+ icon: 'hyperlink-open',
358
+ shape: null,
359
+ fillMode: 'flat',
360
+ size: this.$props.size,
361
+ "aria-label": maximizeTitle,
362
+ title: maximizeTitle
363
+ },
364
+ shape: null,
365
+ fillMode: 'flat',
366
+ size: this.$props.size,
367
+ onClick: this.onMaximizeClick,
368
+ on: this.v3 ? undefined : {
369
+ "click": this.onMaximizeClick
370
+ },
371
+ "aria-label": maximizeTitle,
372
+ title: maximizeTitle
373
+ }), showMinimize &&
374
+ // @ts-ignore
375
+ h(Button, {
376
+ "class": 'k-signature-action k-signature-minimize k-rotate-180',
377
+ ref: setRef(this, 'minimizeButton'),
378
+ icon: 'hyperlink-open',
379
+ attrs: this.v3 ? undefined : {
380
+ icon: 'hyperlink-open',
381
+ shape: null,
382
+ fillMode: 'flat',
383
+ size: this.$props.size,
384
+ "aria-label": minimizeTitle,
385
+ title: minimizeTitle
386
+ },
387
+ shape: null,
388
+ fillMode: 'flat',
389
+ size: this.$props.size,
390
+ onClick: this.onMinimizeClick,
391
+ on: this.v3 ? undefined : {
392
+ "click": this.onMinimizeClick
393
+ },
394
+ "aria-label": minimizeTitle,
395
+ title: minimizeTitle
396
+ })]);
397
+ var hideLine = !this.$props.hideLine && h("div", {
398
+ "class": 'k-signature-line',
399
+ style: {
400
+ zIndex: 2,
401
+ pointerEvents: 'none'
402
+ }
403
+ });
404
+ var bottomActions = h("div", {
405
+ "class": 'k-signature-actions k-signature-actions-bottom'
406
+ }, [showClear &&
407
+ // @ts-ignore
408
+ h(Button, {
409
+ "class": 'k-signature-action k-signature-clear',
410
+ icon: 'close',
411
+ attrs: this.v3 ? undefined : {
412
+ icon: 'close',
413
+ shape: null,
414
+ fillMode: 'flat',
415
+ size: this.$props.size,
416
+ "aria-label": clearTitle,
417
+ title: clearTitle
418
+ },
419
+ shape: null,
420
+ fillMode: 'flat',
421
+ size: this.$props.size,
422
+ onClick: this.onClear,
423
+ on: this.v3 ? undefined : {
424
+ "click": this.onClear
425
+ },
426
+ "aria-label": clearTitle,
427
+ title: clearTitle
428
+ })]);
429
+ return h("div", {
430
+ dir: this.$props.dir,
431
+ attrs: this.v3 ? undefined : {
432
+ dir: this.$props.dir
433
+ },
434
+ "class": this.wrapperClass,
435
+ onFocus: this.onFocus,
436
+ on: this.v3 ? undefined : {
437
+ "focus": this.onFocus,
438
+ "blur": this.onBlur
439
+ },
440
+ onBlur: this.onBlur
441
+ }, [canvasDiv, actions, hideLine, bottomActions, this.computedOpen &&
442
+ // @ts-ignore function children
443
+ h(Dialog, {
444
+ ref: setRef(this, 'dialog'),
445
+ onOverlayclick: this.onOverlayClick,
446
+ on: this.v3 ? undefined : {
447
+ "overlayclick": this.onOverlayClick
448
+ }
449
+ }, this.v3 ? function () {
450
+ return [h("div", {
451
+ style: {
452
+ width: _this.popupWidth + 'px',
453
+ height: _this.popupHeight + 'px'
454
+ },
455
+ dir: _this.$props.dir,
456
+ attrs: _this.v3 ? undefined : {
457
+ dir: _this.$props.dir
458
+ },
459
+ "class": _this.openWrapperClass,
460
+ onFocus: _this.onFocus,
461
+ on: _this.v3 ? undefined : {
462
+ "focus": _this.onFocus,
463
+ "blur": _this.onBlur
464
+ },
465
+ onBlur: _this.onBlur
466
+ }, [renderCanvas.call(_this, 'openCanvas'), actions, hideLine, bottomActions])];
467
+ } : [h("div", {
468
+ style: {
469
+ width: _this.popupWidth + 'px',
470
+ height: _this.popupHeight + 'px'
471
+ },
472
+ dir: _this.$props.dir,
473
+ attrs: _this.v3 ? undefined : {
474
+ dir: _this.$props.dir
475
+ },
476
+ "class": _this.openWrapperClass,
477
+ onFocus: _this.onFocus,
478
+ on: _this.v3 ? undefined : {
479
+ "focus": _this.onFocus,
480
+ "blur": _this.onBlur
481
+ },
482
+ onBlur: _this.onBlur
483
+ }, [renderCanvas.call(_this, 'openCanvas'), actions, hideLine, bottomActions])])]);
484
+ },
485
+ methods: {
486
+ onOverlayClick: function onOverlayClick() {
487
+ this.currentOpen = false;
488
+ },
489
+ onValueChange: function onValueChange(nextValue) {
490
+ this.currentValue = nextValue;
491
+ this.$emit('changemodel', nextValue);
492
+ this.$emit('update:modelValue', nextValue);
493
+ this.$emit('change', {
494
+ value: nextValue
495
+ });
496
+ },
497
+ onDialogChange: function onDialogChange(e) {
498
+ this.onValueChange(e.value);
499
+ },
500
+ reset: function reset() {
501
+ this.onValueChange();
502
+ },
503
+ onDialogClose: function onDialogClose(event) {
504
+ var _a;
505
+ this.onMinimizeClick(event);
506
+ (_a = this.maximizeButton || this.canvas.$el) === null || _a === void 0 ? void 0 : _a.focus();
507
+ },
508
+ exportImage: function exportImage(exportSize) {
509
+ var _a;
510
+ return __awaiter(this, void 0, void 0, function () {
511
+ var width, height;
512
+ return __generator(this, function (_b) {
513
+ switch (_b.label) {
514
+ case 0:
515
+ width = exportSize.width, height = exportSize.height;
516
+ return [4 /*yield*/, (_a = this.canvas.instance) === null || _a === void 0 ? void 0 : _a.exportImage({
517
+ width: width * this.exportScale,
518
+ height: height * this.exportScale
519
+ })];
520
+ case 1:
521
+ return [2 /*return*/, _b.sent()];
522
+ }
523
+ });
524
+ });
525
+ },
526
+ validityGetter: function validityGetter() {
527
+ var customError = this.$props.validationMessage !== undefined;
528
+ var currentValue = this.computedValue; // valueGetter();
529
+ var valueMissing = !currentValue;
530
+ var valid = this.$props.valid !== undefined ? this.$props.valid :
531
+ // !requiredGetter() ||
532
+ !valueMissing;
533
+ return {
534
+ customError: customError,
535
+ valid: valid,
536
+ valueMissing: valueMissing
537
+ };
538
+ },
539
+ focusElement: function focusElement() {
540
+ this.canvas.$el.focus();
541
+ },
542
+ getImperativeHandle: function getImperativeHandle() {
543
+ var options = {
544
+ element: this.$el,
545
+ focus: this.focusElement()
546
+ };
547
+ // Object.defineProperty(options, 'name', { get: nameGetter });
548
+ // Object.defineProperty(options, 'value', { get: this.computedValue }); //valueGetter
549
+ // Object.defineProperty(options, 'validity', { get: validityGetter });
550
+ // Object.defineProperty(options, 'validityStyles', { get: validityStylesGetter });
551
+ // Object.defineProperty(options, 'required', { get: requiredGetter });
552
+ // Object.defineProperty(options, 'props', { get: propsGetter });
553
+ // Object.defineProperty(options, 'color', { get: colorGetter });
554
+ // Object.defineProperty(options, 'backgroundColor', { get: backgroundColorGetter });
555
+ return options;
556
+ },
557
+ onFocus: function onFocus(event) {
558
+ if (this.focused || this.computedOpen) {
559
+ return;
560
+ }
561
+ this.focused(true);
562
+ this.$emit('focus', __assign({
563
+ event: event
564
+ }, this.getImperativeHandle()));
565
+ },
566
+ onBlur: function onBlur(event) {
567
+ var insideWrapper = hasParent(event.relatedTarget, this.$el);
568
+ if (insideWrapper) {
569
+ return;
570
+ }
571
+ this.focused = false;
572
+ this.$emit('blur', __assign({
573
+ event: event
574
+ }, this.getImperativeHandle()));
575
+ },
576
+ onMaximizeClick: function onMaximizeClick(event) {
577
+ return __awaiter(this, void 0, void 0, function () {
578
+ var _a;
579
+ return __generator(this, function (_b) {
580
+ switch (_b.label) {
581
+ case 0:
582
+ _a = this;
583
+ return [4 /*yield*/, this.exportImage(this.popupSize())];
584
+ case 1:
585
+ _a.currentValue = _b.sent();
586
+ this.currentOpen = true;
587
+ this.$emit('open', __assign({
588
+ event: event
589
+ }, this.getImperativeHandle()));
590
+ return [2 /*return*/];
591
+ }
592
+ });
593
+ });
594
+ },
595
+
596
+ onMinimizeClick: function onMinimizeClick(event) {
597
+ this.currentOpen = false;
598
+ this.$emit('close', __assign({
599
+ event: event
600
+ }, this.getImperativeHandle()));
601
+ },
602
+ onClear: function onClear() {
603
+ this.reset();
604
+ this.focusElement();
605
+ },
606
+ elementSize: function elementSize() {
607
+ var width = this.$props.width || this.$el && this.$el.offsetWidth || DEFAULT_WIDTH;
608
+ var height = this.$props.height || this.$el && this.$el.offsetHeight || DEFAULT_HEIGHT;
609
+ return {
610
+ width: width,
611
+ height: height
612
+ };
613
+ },
614
+ popupSize: function popupSize() {
615
+ var _a = this.elementSize(),
616
+ width = _a.width,
617
+ height = _a.height;
618
+ return {
619
+ width: width * this.popupScale,
620
+ height: height * this.popupScale
621
+ };
622
+ }
623
+ }
624
+ };
625
+ var Signature = SignatureVue2;
626
+ export { Signature, SignatureVue2 };
@@ -0,0 +1,39 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
2
+ declare type DefaultData<V> = object | ((this: V) => {});
3
+ declare type DefaultMethods<V> = {
4
+ [key: string]: (this: V, ...args: any[]) => any;
5
+ };
6
+ import { SignaturePad } from '@progress/kendo-inputs-common';
7
+ import { SignatureCanvasProps } from './interfaces/SignatureCanvasProps';
8
+ /**
9
+ * @hidden
10
+ */
11
+ export interface SignatureCanvasData {
12
+ }
13
+ export interface SignatureCanvasState {
14
+ v3: boolean;
15
+ instance: SignaturePad;
16
+ }
17
+ /**
18
+ * @hidden
19
+ */
20
+ export interface SignatureCanvasMethods {
21
+ [key: string]: any;
22
+ }
23
+ /**
24
+ * @hidden
25
+ */
26
+ export interface SignatureCanvasComputed {
27
+ [key: string]: any;
28
+ }
29
+ /**
30
+ * @hidden
31
+ */
32
+ export interface SignatureCanvasAll extends Vue2type, SignatureCanvasMethods, SignatureCanvasComputed, SignatureCanvasState, SignatureCanvasData {
33
+ }
34
+ /**
35
+ * @hidden
36
+ */
37
+ declare let SignatureCanvasVue2: ComponentOptions<SignatureCanvasAll, DefaultData<SignatureCanvasData>, DefaultMethods<SignatureCanvasAll>, SignatureCanvasComputed, RecordPropsDefinition<SignatureCanvasProps>>;
38
+ declare const SignatureCanvas: DefineComponent<SignatureCanvasProps, any, SignatureCanvasData, SignatureCanvasComputed, SignatureCanvasMethods, {}, {}, {}, string, SignatureCanvasProps, SignatureCanvasProps, {}>;
39
+ export { SignatureCanvas, SignatureCanvasVue2 };