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