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