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

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