@syncfusion/ej2-vue-inputs 20.4.54 → 21.1.37

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 (80) hide show
  1. package/CHANGELOG.md +3 -32
  2. package/README.md +184 -112
  3. package/dist/ej2-vue-inputs.umd.min.js +2 -2
  4. package/dist/ej2-vue-inputs.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-vue-inputs.es2015.js +933 -1148
  6. package/dist/es6/ej2-vue-inputs.es2015.js.map +1 -1
  7. package/dist/es6/ej2-vue-inputs.es5.js +1033 -1300
  8. package/dist/es6/ej2-vue-inputs.es5.js.map +1 -1
  9. package/dist/global/ej2-vue-inputs.min.js +2 -2
  10. package/package.json +11 -10
  11. package/src/color-picker/colorpicker.component.d.ts +3 -28
  12. package/src/color-picker/colorpicker.component.js +128 -159
  13. package/src/maskedtextbox/maskedtextbox.component.d.ts +3 -28
  14. package/src/maskedtextbox/maskedtextbox.component.js +128 -159
  15. package/src/numerictextbox/numerictextbox.component.d.ts +3 -30
  16. package/src/numerictextbox/numerictextbox.component.js +134 -165
  17. package/src/rating/rating.component.d.ts +3 -26
  18. package/src/rating/rating.component.js +122 -153
  19. package/src/signature/signature.component.d.ts +3 -34
  20. package/src/signature/signature.component.js +119 -148
  21. package/src/slider/slider.component.d.ts +3 -27
  22. package/src/slider/slider.component.js +125 -156
  23. package/src/textbox/textbox.component.d.ts +3 -30
  24. package/src/textbox/textbox.component.js +134 -165
  25. package/src/uploader/files.directive.d.ts +2 -12
  26. package/src/uploader/files.directive.js +22 -71
  27. package/src/uploader/uploader.component.d.ts +3 -34
  28. package/src/uploader/uploader.component.js +119 -148
  29. package/styles/bootstrap-dark.css +14 -0
  30. package/styles/bootstrap.css +14 -0
  31. package/styles/bootstrap4.css +14 -0
  32. package/styles/bootstrap5-dark.css +18 -4
  33. package/styles/bootstrap5.css +18 -4
  34. package/styles/color-picker/bootstrap-dark.css +6 -0
  35. package/styles/color-picker/bootstrap.css +6 -0
  36. package/styles/color-picker/bootstrap4.css +6 -0
  37. package/styles/color-picker/bootstrap5-dark.css +6 -0
  38. package/styles/color-picker/bootstrap5.css +6 -0
  39. package/styles/color-picker/fabric-dark.css +6 -0
  40. package/styles/color-picker/fabric.css +6 -0
  41. package/styles/color-picker/fluent-dark.css +6 -0
  42. package/styles/color-picker/fluent.css +6 -0
  43. package/styles/color-picker/highcontrast-light.css +6 -0
  44. package/styles/color-picker/highcontrast.css +6 -0
  45. package/styles/color-picker/material-dark.css +6 -0
  46. package/styles/color-picker/material.css +6 -0
  47. package/styles/color-picker/tailwind-dark.css +6 -0
  48. package/styles/color-picker/tailwind.css +6 -0
  49. package/styles/fabric-dark.css +14 -0
  50. package/styles/fabric.css +14 -0
  51. package/styles/fluent-dark.css +14 -0
  52. package/styles/fluent.css +14 -0
  53. package/styles/highcontrast-light.css +14 -0
  54. package/styles/highcontrast.css +14 -0
  55. package/styles/input/material-dark.css +1 -1
  56. package/styles/input/material.css +1 -1
  57. package/styles/material-dark.css +15 -5
  58. package/styles/material.css +15 -1
  59. package/styles/rating/bootstrap-dark.css +8 -0
  60. package/styles/rating/bootstrap.css +8 -0
  61. package/styles/rating/bootstrap4.css +8 -0
  62. package/styles/rating/bootstrap5-dark.css +8 -0
  63. package/styles/rating/bootstrap5.css +8 -0
  64. package/styles/rating/fabric-dark.css +8 -0
  65. package/styles/rating/fabric.css +8 -0
  66. package/styles/rating/fluent-dark.css +8 -0
  67. package/styles/rating/fluent.css +8 -0
  68. package/styles/rating/highcontrast-light.css +8 -0
  69. package/styles/rating/highcontrast.css +8 -0
  70. package/styles/rating/material-dark.css +8 -0
  71. package/styles/rating/material.css +8 -0
  72. package/styles/rating/tailwind-dark.css +9 -1
  73. package/styles/rating/tailwind.css +9 -1
  74. package/styles/tailwind-dark.css +16 -2
  75. package/styles/tailwind.css +16 -2
  76. package/styles/uploader/bootstrap5-dark.css +4 -4
  77. package/styles/uploader/bootstrap5.css +4 -4
  78. package/styles/uploader/material-dark.css +0 -4
  79. package/styles/uploader/tailwind-dark.css +1 -1
  80. package/styles/uploader/tailwind.css +1 -1
@@ -1,33 +1,11 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- };
20
- import { isUndefined } from '@syncfusion/ej2-base';
21
- import { ComponentBase, EJComponentDecorator, getProps, gh, isExecute } from '@syncfusion/ej2-vue-base';
1
+ import { ComponentBase, gh, getProps, isExecute, vueDefineComponent } from '@syncfusion/ej2-vue-base';
22
2
  import { isNullOrUndefined, getValue } from '@syncfusion/ej2-base';
3
+ import { isUndefined } from '@syncfusion/ej2-base';
23
4
  import { Rating } from '@syncfusion/ej2-inputs';
24
- import { Options } from 'vue-class-component';
25
5
  export var properties = ['isLazyUpdate', 'plugins', 'allowReset', 'cssClass', 'disabled', 'emptyTemplate', 'enableAnimation', 'enablePersistence', 'enableRtl', 'enableSingleSelection', 'fullTemplate', 'itemsCount', 'labelPosition', 'labelTemplate', 'locale', 'min', 'precision', 'readOnly', 'showLabel', 'showTooltip', 'tooltipTemplate', 'value', 'visible', 'beforeItemRender', 'created', 'onItemHover', 'valueChanged'];
26
6
  export var modelProps = ['value'];
27
7
  export var testProp = getProps({ props: properties });
28
- export var props = testProp[0];
29
- export var watch = testProp[1];
30
- export var emitProbs = Object.keys(watch);
8
+ export var props = testProp[0], watch = testProp[1], emitProbs = Object.keys(watch);
31
9
  emitProbs.push('modelchanged', 'update:modelValue');
32
10
  for (var _i = 0, modelProps_1 = modelProps; _i < modelProps_1.length; _i++) {
33
11
  var props_1 = modelProps_1[_i];
@@ -39,149 +17,140 @@ for (var _i = 0, modelProps_1 = modelProps; _i < modelProps_1.length; _i++) {
39
17
  * <ejs-rating v-bind:value='value'></ejs-rating>
40
18
  * ```
41
19
  */
42
- var RatingComponent = /** @class */ (function (_super) {
43
- __extends(RatingComponent, _super);
44
- function RatingComponent() {
45
- var _this = _super.call(this, arguments) || this;
46
- _this.propKeys = properties;
47
- _this.models = modelProps;
48
- _this.hasChildDirective = false;
49
- _this.hasInjectedModules = false;
50
- _this.tagMapper = {};
51
- _this.tagNameMapper = {};
52
- _this.isVue3 = !isExecute;
53
- _this.ej2Instances = new Rating({});
54
- _this.ej2Instances._trigger = _this.ej2Instances.trigger;
55
- _this.ej2Instances.trigger = _this.trigger;
56
- _this.bindProperties();
57
- _this.ej2Instances._setProperties = _this.ej2Instances.setProperties;
58
- _this.ej2Instances.setProperties = _this.setProperties;
59
- _this.ej2Instances.clearTemplate = _this.clearTemplate;
60
- _this.updated = _this.updated;
61
- return _this;
62
- }
63
- RatingComponent.prototype.clearTemplate = function (templateNames) {
64
- if (!templateNames) {
65
- templateNames = Object.keys(this.templateCollection || {});
20
+ export var RatingComponent = vueDefineComponent({
21
+ name: 'RatingComponent',
22
+ mixins: [ComponentBase],
23
+ props: props,
24
+ watch: watch,
25
+ emits: emitProbs,
26
+ model: { event: 'modelchanged' },
27
+ provide: function () { return { custom: this.custom }; },
28
+ data: function () {
29
+ return {
30
+ ej2Instances: new Rating({}),
31
+ propKeys: properties,
32
+ models: modelProps,
33
+ hasChildDirective: false,
34
+ hasInjectedModules: false,
35
+ tagMapper: {},
36
+ tagNameMapper: {},
37
+ isVue3: !isExecute,
38
+ templateCollection: {},
39
+ };
40
+ },
41
+ created: function () {
42
+ this.ej2Instances._trigger = this.ej2Instances.trigger;
43
+ this.ej2Instances.trigger = this.trigger;
44
+ this.bindProperties();
45
+ this.ej2Instances._setProperties = this.ej2Instances.setProperties;
46
+ this.ej2Instances.setProperties = this.setProperties;
47
+ this.ej2Instances.clearTemplate = this.clearTemplate;
48
+ this.updated = this.updated;
49
+ },
50
+ render: function (createElement) {
51
+ var h = !isExecute ? gh : createElement;
52
+ var slots = null;
53
+ if (!isNullOrUndefined(this.$slots.default)) {
54
+ slots = !isExecute ? this.$slots.default() : this.$slots.default;
66
55
  }
67
- if (templateNames.length && this.templateCollection) {
68
- for (var _i = 0, templateNames_1 = templateNames; _i < templateNames_1.length; _i++) {
69
- var tempName = templateNames_1[_i];
70
- var elementCollection = this.templateCollection[tempName];
71
- if (elementCollection && elementCollection.length) {
72
- for (var _a = 0, elementCollection_1 = elementCollection; _a < elementCollection_1.length; _a++) {
73
- var ele = elementCollection_1[_a];
74
- var destroy = getValue('__vue__.$destroy', ele);
75
- if (destroy) {
76
- ele.__vue__.$destroy();
77
- }
78
- if (ele.innerHTML) {
79
- ele.innerHTML = '';
56
+ return h('input', slots);
57
+ },
58
+ methods: {
59
+ clearTemplate: function (templateNames) {
60
+ if (!templateNames) {
61
+ templateNames = Object.keys(this.templateCollection || {});
62
+ }
63
+ if (templateNames.length && this.templateCollection) {
64
+ for (var _i = 0, templateNames_1 = templateNames; _i < templateNames_1.length; _i++) {
65
+ var tempName = templateNames_1[_i];
66
+ var elementCollection = this.templateCollection[tempName];
67
+ if (elementCollection && elementCollection.length) {
68
+ for (var _a = 0, elementCollection_1 = elementCollection; _a < elementCollection_1.length; _a++) {
69
+ var ele = elementCollection_1[_a];
70
+ var destroy = getValue('__vue__.$destroy', ele);
71
+ if (destroy) {
72
+ ele.__vue__.$destroy();
73
+ }
74
+ if (ele.innerHTML) {
75
+ ele.innerHTML = '';
76
+ }
80
77
  }
78
+ delete this.templateCollection[tempName];
81
79
  }
82
- delete this.templateCollection[tempName];
83
80
  }
84
81
  }
85
- }
86
- };
87
- RatingComponent.prototype.setProperties = function (prop, muteOnChange) {
88
- var _this = this;
89
- if (this.isVue3) {
90
- this.models = !this.models ? this.ej2Instances.referModels : this.models;
91
- }
92
- if (this.ej2Instances && this.ej2Instances._setProperties) {
93
- this.ej2Instances._setProperties(prop, muteOnChange);
94
- }
95
- if (prop && this.models && this.models.length) {
96
- Object.keys(prop).map(function (key) {
97
- _this.models.map(function (model) {
98
- if ((key === model) && !(/datasource/i.test(key))) {
99
- if (_this.isVue3) {
100
- _this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
82
+ },
83
+ setProperties: function (prop, muteOnChange) {
84
+ var _this = this;
85
+ if (this.isVue3) {
86
+ this.models = !this.models ? this.ej2Instances.referModels : this.models;
87
+ }
88
+ if (this.ej2Instances && this.ej2Instances._setProperties) {
89
+ this.ej2Instances._setProperties(prop, muteOnChange);
90
+ }
91
+ if (prop && this.models && this.models.length) {
92
+ Object.keys(prop).map(function (key) {
93
+ _this.models.map(function (model) {
94
+ if ((key === model) && !(/datasource/i.test(key))) {
95
+ if (_this.isVue3) {
96
+ _this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
97
+ }
98
+ else {
99
+ _this.$emit('update:' + key, prop[key]);
100
+ _this.$emit('modelchanged', prop[key]);
101
+ }
101
102
  }
102
- else {
103
- _this.$emit('update:' + key, prop[key]);
104
- _this.$emit('modelchanged', prop[key]);
103
+ });
104
+ });
105
+ }
106
+ },
107
+ trigger: function (eventName, eventProp, successHandler) {
108
+ if (!isExecute) {
109
+ this.models = !this.models ? this.ej2Instances.referModels : this.models;
110
+ }
111
+ if ((eventName === 'change' || eventName === 'input') && this.models && (this.models.length !== 0)) {
112
+ var key = this.models.toString().match(/checked|value/) || [];
113
+ var propKey = key[0];
114
+ if (eventProp && key && !isUndefined(eventProp[propKey])) {
115
+ if (!isExecute) {
116
+ this.ej2Instances.vueInstance.$emit('update:' + propKey, eventProp[propKey]);
117
+ this.ej2Instances.vueInstance.$emit('modelchanged', eventProp[propKey]);
118
+ this.ej2Instances.vueInstance.$emit('update:modelValue', eventProp[propKey]);
119
+ }
120
+ else {
121
+ if (eventName === 'change' || (this.$props && !this.$props.isLazyUpdate)) {
122
+ this.$emit('update:' + propKey, eventProp[propKey]);
123
+ this.$emit('modelchanged', eventProp[propKey]);
105
124
  }
106
125
  }
107
- });
108
- });
109
- }
110
- };
111
- RatingComponent.prototype.trigger = function (eventName, eventProp, successHandler) {
112
- if (!isExecute) {
113
- this.models = !this.models ? this.ej2Instances.referModels : this.models;
114
- }
115
- if ((eventName === 'change' || eventName === 'input') && this.models && (this.models.length !== 0)) {
116
- var key = this.models.toString().match(/checked|value/) || [];
117
- var propKey = key[0];
118
- if (eventProp && key && !isUndefined(eventProp[propKey])) {
119
- if (!isExecute) {
120
- this.ej2Instances.vueInstance.$emit('update:' + propKey, eventProp[propKey]);
121
- this.ej2Instances.vueInstance.$emit('modelchanged', eventProp[propKey]);
122
- this.ej2Instances.vueInstance.$emit('update:modelValue', eventProp[propKey]);
123
126
  }
124
- else {
125
- if (eventName === 'change' || (this.$props && !this.$props.isLazyUpdate)) {
127
+ }
128
+ else if ((eventName === 'actionBegin' && eventProp.requestType === 'dateNavigate') && this.models && (this.models.length !== 0)) {
129
+ var key = this.models.toString().match(/currentView|selectedDate/) || [];
130
+ var propKey = key[0];
131
+ if (eventProp && key && !isUndefined(eventProp[propKey])) {
132
+ if (!isExecute) {
133
+ this.ej2Instances.vueInstance.$emit('update:' + propKey, eventProp[propKey]);
134
+ this.ej2Instances.vueInstance.$emit('modelchanged', eventProp[propKey]);
135
+ }
136
+ else {
126
137
  this.$emit('update:' + propKey, eventProp[propKey]);
127
138
  this.$emit('modelchanged', eventProp[propKey]);
128
139
  }
129
140
  }
130
141
  }
131
- }
132
- else if ((eventName === 'actionBegin' && eventProp.requestType === 'dateNavigate') && this.models && (this.models.length !== 0)) {
133
- var key = this.models.toString().match(/currentView|selectedDate/) || [];
134
- var propKey = key[0];
135
- if (eventProp && key && !isUndefined(eventProp[propKey])) {
136
- if (!isExecute) {
137
- this.ej2Instances.vueInstance.$emit('update:' + propKey, eventProp[propKey]);
138
- this.ej2Instances.vueInstance.$emit('modelchanged', eventProp[propKey]);
139
- }
140
- else {
141
- this.$emit('update:' + propKey, eventProp[propKey]);
142
- this.$emit('modelchanged', eventProp[propKey]);
143
- }
142
+ if ((this.ej2Instances && this.ej2Instances._trigger)) {
143
+ this.ej2Instances._trigger(eventName, eventProp, successHandler);
144
144
  }
145
- }
146
- if ((this.ej2Instances && this.ej2Instances._trigger)) {
147
- this.ej2Instances._trigger(eventName, eventProp, successHandler);
148
- }
149
- };
150
- RatingComponent.prototype.render = function (createElement) {
151
- var h = !isExecute ? gh : createElement;
152
- var slots = null;
153
- if (!isNullOrUndefined(this.$slots.default)) {
154
- slots = !isExecute ? this.$slots.default() : this.$slots.default;
155
- }
156
- return h('input', slots);
157
- };
158
- RatingComponent.prototype.custom = function () {
159
- this.updated();
160
- };
161
- RatingComponent.prototype.reset = function () {
162
- return this.ej2Instances.reset();
163
- };
164
- RatingComponent = __decorate([
165
- EJComponentDecorator({
166
- props: properties,
167
- model: {
168
- event: 'modelchanged'
169
- }
170
- }, isExecute)
171
- ,Options({
172
- props: props,
173
- watch: watch,
174
- emits: emitProbs,
175
- provide: function provide() {
176
- return {
177
- custom: this.custom
178
- };
179
- }
180
- })
181
- ], RatingComponent);
182
- return RatingComponent;
183
- }(ComponentBase));
184
- export { RatingComponent };
145
+ },
146
+ custom: function () {
147
+ this.updated();
148
+ },
149
+ reset: function () {
150
+ return this.ej2Instances.reset();
151
+ },
152
+ }
153
+ });
185
154
  export var RatingPlugin = {
186
155
  name: 'ejs-rating',
187
156
  install: function (Vue) {
@@ -1,46 +1,15 @@
1
- import { ComponentBase } from '@syncfusion/ej2-vue-base';
2
1
  export declare const properties: string[];
3
2
  export declare const modelProps: string[];
4
3
  export declare const testProp: any;
5
- export declare const props: any;
6
- export declare const watch: any;
7
- export declare const emitProbs: any;
4
+ export declare const props: any, watch: any, emitProbs: any;
8
5
  /**
9
6
  * Represents the Essential JS 2 VueJS Signature Component
10
7
  * ```html
11
8
  * <ejs-signature></ejs-signature>
12
9
  * ```
13
10
  */
14
- export declare class SignatureComponent extends ComponentBase {
15
- ej2Instances: any;
16
- propKeys: string[];
17
- models: string[];
18
- hasChildDirective: boolean;
19
- protected hasInjectedModules: boolean;
20
- tagMapper: {
21
- [key: string]: Object;
22
- };
23
- tagNameMapper: Object;
24
- isVue3: boolean;
25
- templateCollection: any;
26
- constructor();
27
- clearTemplate(templateNames?: string[]): any;
28
- setProperties(prop: any, muteOnChange: boolean): void;
29
- render(createElement: any): any;
30
- custom(): void;
31
- canRedo(): boolean;
32
- canUndo(): boolean;
33
- clear(): void;
34
- draw(text: string, fontFamily?: string, fontSize?: number): void;
35
- getBlob(url: string): Object;
36
- initialize(): void;
37
- isEmpty(): boolean;
38
- load(signature: string, width?: number, height?: number): void;
39
- redo(): void;
40
- save(type?: Object, fileName?: string): void;
41
- saveAsBlob(): Object;
42
- undo(): void;
43
- }
11
+ export declare let SignatureComponent: any;
12
+ export declare type SignatureComponent = InstanceType<typeof SignatureComponent>;
44
13
  export declare const SignaturePlugin: {
45
14
  name: string;
46
15
  install(Vue: any): void;
@@ -1,32 +1,10 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- };
20
- import { ComponentBase, EJComponentDecorator, getProps, gh, isExecute } from '@syncfusion/ej2-vue-base';
1
+ import { ComponentBase, gh, getProps, isExecute, vueDefineComponent } from '@syncfusion/ej2-vue-base';
21
2
  import { isNullOrUndefined, getValue } from '@syncfusion/ej2-base';
22
3
  import { Signature } from '@syncfusion/ej2-inputs';
23
- import { Options } from 'vue-class-component';
24
4
  export var properties = ['isLazyUpdate', 'plugins', 'backgroundColor', 'backgroundImage', 'disabled', 'enablePersistence', 'enableRtl', 'isReadOnly', 'locale', 'maxStrokeWidth', 'minStrokeWidth', 'saveWithBackground', 'strokeColor', 'velocity', 'beforeSave', 'change', 'created'];
25
5
  export var modelProps = [];
26
6
  export var testProp = getProps({ props: properties });
27
- export var props = testProp[0];
28
- export var watch = testProp[1];
29
- export var emitProbs = Object.keys(watch);
7
+ export var props = testProp[0], watch = testProp[1], emitProbs = Object.keys(watch);
30
8
  emitProbs.push('modelchanged', 'update:modelValue');
31
9
  for (var _i = 0, modelProps_1 = modelProps; _i < modelProps_1.length; _i++) {
32
10
  var props_1 = modelProps_1[_i];
@@ -38,138 +16,131 @@ for (var _i = 0, modelProps_1 = modelProps; _i < modelProps_1.length; _i++) {
38
16
  * <ejs-signature></ejs-signature>
39
17
  * ```
40
18
  */
41
- var SignatureComponent = /** @class */ (function (_super) {
42
- __extends(SignatureComponent, _super);
43
- function SignatureComponent() {
44
- var _this = _super.call(this, arguments) || this;
45
- _this.propKeys = properties;
46
- _this.models = modelProps;
47
- _this.hasChildDirective = false;
48
- _this.hasInjectedModules = false;
49
- _this.tagMapper = {};
50
- _this.tagNameMapper = {};
51
- _this.isVue3 = !isExecute;
52
- _this.ej2Instances = new Signature({});
53
- _this.bindProperties();
54
- _this.ej2Instances._setProperties = _this.ej2Instances.setProperties;
55
- _this.ej2Instances.setProperties = _this.setProperties;
56
- _this.ej2Instances.clearTemplate = _this.clearTemplate;
57
- _this.updated = _this.updated;
58
- return _this;
59
- }
60
- SignatureComponent.prototype.clearTemplate = function (templateNames) {
61
- if (!templateNames) {
62
- templateNames = Object.keys(this.templateCollection || {});
19
+ export var SignatureComponent = vueDefineComponent({
20
+ name: 'SignatureComponent',
21
+ mixins: [ComponentBase],
22
+ props: props,
23
+ watch: watch,
24
+ emits: emitProbs,
25
+ provide: function () { return { custom: this.custom }; },
26
+ data: function () {
27
+ return {
28
+ ej2Instances: new Signature({}),
29
+ propKeys: properties,
30
+ models: modelProps,
31
+ hasChildDirective: false,
32
+ hasInjectedModules: false,
33
+ tagMapper: {},
34
+ tagNameMapper: {},
35
+ isVue3: !isExecute,
36
+ templateCollection: {},
37
+ };
38
+ },
39
+ created: function () {
40
+ this.bindProperties();
41
+ this.ej2Instances._setProperties = this.ej2Instances.setProperties;
42
+ this.ej2Instances.setProperties = this.setProperties;
43
+ this.ej2Instances.clearTemplate = this.clearTemplate;
44
+ this.updated = this.updated;
45
+ },
46
+ render: function (createElement) {
47
+ var h = !isExecute ? gh : createElement;
48
+ var slots = null;
49
+ if (!isNullOrUndefined(this.$slots.default)) {
50
+ slots = !isExecute ? this.$slots.default() : this.$slots.default;
63
51
  }
64
- if (templateNames.length && this.templateCollection) {
65
- for (var _i = 0, templateNames_1 = templateNames; _i < templateNames_1.length; _i++) {
66
- var tempName = templateNames_1[_i];
67
- var elementCollection = this.templateCollection[tempName];
68
- if (elementCollection && elementCollection.length) {
69
- for (var _a = 0, elementCollection_1 = elementCollection; _a < elementCollection_1.length; _a++) {
70
- var ele = elementCollection_1[_a];
71
- var destroy = getValue('__vue__.$destroy', ele);
72
- if (destroy) {
73
- ele.__vue__.$destroy();
74
- }
75
- if (ele.innerHTML) {
76
- ele.innerHTML = '';
52
+ return h('canvas', slots);
53
+ },
54
+ methods: {
55
+ clearTemplate: function (templateNames) {
56
+ if (!templateNames) {
57
+ templateNames = Object.keys(this.templateCollection || {});
58
+ }
59
+ if (templateNames.length && this.templateCollection) {
60
+ for (var _i = 0, templateNames_1 = templateNames; _i < templateNames_1.length; _i++) {
61
+ var tempName = templateNames_1[_i];
62
+ var elementCollection = this.templateCollection[tempName];
63
+ if (elementCollection && elementCollection.length) {
64
+ for (var _a = 0, elementCollection_1 = elementCollection; _a < elementCollection_1.length; _a++) {
65
+ var ele = elementCollection_1[_a];
66
+ var destroy = getValue('__vue__.$destroy', ele);
67
+ if (destroy) {
68
+ ele.__vue__.$destroy();
69
+ }
70
+ if (ele.innerHTML) {
71
+ ele.innerHTML = '';
72
+ }
77
73
  }
74
+ delete this.templateCollection[tempName];
78
75
  }
79
- delete this.templateCollection[tempName];
80
76
  }
81
77
  }
82
- }
83
- };
84
- SignatureComponent.prototype.setProperties = function (prop, muteOnChange) {
85
- var _this = this;
86
- if (this.isVue3) {
87
- this.models = !this.models ? this.ej2Instances.referModels : this.models;
88
- }
89
- if (this.ej2Instances && this.ej2Instances._setProperties) {
90
- this.ej2Instances._setProperties(prop, muteOnChange);
91
- }
92
- if (prop && this.models && this.models.length) {
93
- Object.keys(prop).map(function (key) {
94
- _this.models.map(function (model) {
95
- if ((key === model) && !(/datasource/i.test(key))) {
96
- if (_this.isVue3) {
97
- _this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
98
- }
99
- else {
100
- _this.$emit('update:' + key, prop[key]);
101
- _this.$emit('modelchanged', prop[key]);
78
+ },
79
+ setProperties: function (prop, muteOnChange) {
80
+ var _this = this;
81
+ if (this.isVue3) {
82
+ this.models = !this.models ? this.ej2Instances.referModels : this.models;
83
+ }
84
+ if (this.ej2Instances && this.ej2Instances._setProperties) {
85
+ this.ej2Instances._setProperties(prop, muteOnChange);
86
+ }
87
+ if (prop && this.models && this.models.length) {
88
+ Object.keys(prop).map(function (key) {
89
+ _this.models.map(function (model) {
90
+ if ((key === model) && !(/datasource/i.test(key))) {
91
+ if (_this.isVue3) {
92
+ _this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
93
+ }
94
+ else {
95
+ _this.$emit('update:' + key, prop[key]);
96
+ _this.$emit('modelchanged', prop[key]);
97
+ }
102
98
  }
103
- }
99
+ });
104
100
  });
105
- });
106
- }
107
- };
108
- SignatureComponent.prototype.render = function (createElement) {
109
- var h = !isExecute ? gh : createElement;
110
- var slots = null;
111
- if (!isNullOrUndefined(this.$slots.default)) {
112
- slots = !isExecute ? this.$slots.default() : this.$slots.default;
113
- }
114
- return h('canvas', slots);
115
- };
116
- SignatureComponent.prototype.custom = function () {
117
- this.updated();
118
- };
119
- SignatureComponent.prototype.canRedo = function () {
120
- return this.ej2Instances.canRedo();
121
- };
122
- SignatureComponent.prototype.canUndo = function () {
123
- return this.ej2Instances.canUndo();
124
- };
125
- SignatureComponent.prototype.clear = function () {
126
- return this.ej2Instances.clear();
127
- };
128
- SignatureComponent.prototype.draw = function (text, fontFamily, fontSize) {
129
- return this.ej2Instances.draw(text, fontFamily, fontSize);
130
- };
131
- SignatureComponent.prototype.getBlob = function (url) {
132
- return this.ej2Instances.getBlob(url);
133
- };
134
- SignatureComponent.prototype.initialize = function () {
135
- return this.ej2Instances.initialize();
136
- };
137
- SignatureComponent.prototype.isEmpty = function () {
138
- return this.ej2Instances.isEmpty();
139
- };
140
- SignatureComponent.prototype.load = function (signature, width, height) {
141
- return this.ej2Instances.load(signature, width, height);
142
- };
143
- SignatureComponent.prototype.redo = function () {
144
- return this.ej2Instances.redo();
145
- };
146
- SignatureComponent.prototype.save = function (type, fileName) {
147
- return this.ej2Instances.save(type, fileName);
148
- };
149
- SignatureComponent.prototype.saveAsBlob = function () {
150
- return this.ej2Instances.saveAsBlob();
151
- };
152
- SignatureComponent.prototype.undo = function () {
153
- return this.ej2Instances.undo();
154
- };
155
- SignatureComponent = __decorate([
156
- EJComponentDecorator({
157
- props: properties
158
- }, isExecute)
159
- ,Options({
160
- props: props,
161
- watch: watch,
162
- emits: emitProbs,
163
- provide: function provide() {
164
- return {
165
- custom: this.custom
166
- };
167
101
  }
168
- })
169
- ], SignatureComponent);
170
- return SignatureComponent;
171
- }(ComponentBase));
172
- export { SignatureComponent };
102
+ },
103
+ custom: function () {
104
+ this.updated();
105
+ },
106
+ canRedo: function () {
107
+ return this.ej2Instances.canRedo();
108
+ },
109
+ canUndo: function () {
110
+ return this.ej2Instances.canUndo();
111
+ },
112
+ clear: function () {
113
+ return this.ej2Instances.clear();
114
+ },
115
+ draw: function (text, fontFamily, fontSize) {
116
+ return this.ej2Instances.draw(text, fontFamily, fontSize);
117
+ },
118
+ getBlob: function (url) {
119
+ return this.ej2Instances.getBlob(url);
120
+ },
121
+ initialize: function () {
122
+ return this.ej2Instances.initialize();
123
+ },
124
+ isEmpty: function () {
125
+ return this.ej2Instances.isEmpty();
126
+ },
127
+ load: function (signature, width, height) {
128
+ return this.ej2Instances.load(signature, width, height);
129
+ },
130
+ redo: function () {
131
+ return this.ej2Instances.redo();
132
+ },
133
+ save: function (type, fileName) {
134
+ return this.ej2Instances.save(type, fileName);
135
+ },
136
+ saveAsBlob: function () {
137
+ return this.ej2Instances.saveAsBlob();
138
+ },
139
+ undo: function () {
140
+ return this.ej2Instances.undo();
141
+ },
142
+ }
143
+ });
173
144
  export var SignaturePlugin = {
174
145
  name: 'ejs-signature',
175
146
  install: function (Vue) {