@syncfusion/ej2-vue-base 31.1.17 → 31.2.5

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.
@@ -1,568 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- /**
3
- * Vue Component Base
4
- */
5
- import * as Vue from 'vue';
6
- import { isNullOrUndefined, extend, getValue, setProxyToRaw } from '@syncfusion/ej2-base';
7
-
8
- /**
9
- * Clone the Vue compiler instance.
10
- *
11
- * @param {any} obj - representes the Vue compiler.
12
- * @returns {any} cloned object of Vue compiler.
13
- */
14
- function _interopRequireWildcard(obj: any): any { if (obj && obj.__esModule) { return obj; } else { const newObj: any = {}; if (obj != null) { for (const key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[`${key}`] = obj[`${key}`]; } } } newObj.default = obj; return newObj; } }
15
-
16
- const curVue: any = _interopRequireWildcard(Vue);
17
- export const isExecute: boolean = (parseInt(curVue['version'], 10) > 2) ? false : true;
18
- export const aVue: any = !isExecute ? curVue : (curVue['default']['default'] ? curVue['default']['default'] : curVue['default']);
19
- export const gh: any = curVue['h'];
20
-
21
- export const vueDefineComponent: Function = (options: Object): any => { return !isExecute ? aVue['defineComponent'](options) : aVue['extend'](options); };
22
-
23
- type ComponentBaseType = {
24
- getInjectedServices(): Object[];
25
- updated(): void;
26
- bindProperties(): void;
27
- assignValueToWrapper(option: Object, silent?: boolean): void;
28
- fetchChildPropValues(childOption: Object): void;
29
- getDirectiveValues(tagDirectives: any, tagMapper: {
30
- [key: string]: Object;
31
- }, tagNameMapper: Object): Object;
32
- getMultiLevelDirValue(tagDirectories: any, tagKey: string | Object, tagNameMapper: Object): Object;
33
- getVNodeValue(tagDirective: any, tagKey: string | Object, tagNameMapper: Object): Object;
34
- /**
35
- * convert kebab case directive props to camel case
36
- */
37
- getCamelCaseProps(props: Object): Object;
38
- dataBind(): void;
39
- }
40
-
41
- export const ComponentBase: ComponentBaseType = vueDefineComponent({
42
- name: 'ComponentBase',
43
- data(): Object {
44
- return {
45
- tagMapper: {} as any,
46
- tagNameMapper: {} as any,
47
- hasInjectedModules: false as boolean,
48
- hasChildDirective: false as boolean,
49
- childDirObjects: '' as string,
50
- propKeys: {} as any,
51
- isDecorator: false as boolean
52
- };
53
- },
54
- created(): void {
55
- if (this.ej2Instance) {
56
- this.ej2Instances = this.isVue3 ? aVue.toRaw(this.ej2Instance) : this.ej2Instance;
57
- }
58
- if (!this.propKeys) {
59
- return;
60
- }
61
- for (const prop of this.propKeys) {
62
- this.ej2Instances.addEventListener(prop, (args: object) => {
63
- this.$emit(prop, args);
64
- });
65
- }
66
- const injectables: any = getValue('$root.$options.provide', this);
67
- let vueInjectables: any = getValue('$parent.$options.provide', this);
68
- vueInjectables = !isNullOrUndefined(vueInjectables) ? vueInjectables : getValue('$.parent.provides', this);
69
- if (this.hasInjectedModules && !isExecute) {
70
- let prevModule: Object[] = [];
71
- if (injectables && injectables.managed) {
72
- this.isDecorator = true;
73
- prevModule = this.getInjectedServices() || [];
74
- } else if (injectables) {
75
- prevModule = injectables[this.ej2Instances.getModuleName()] || [];
76
- } else if (vueInjectables) {
77
- prevModule = this.getInjectedServices() || [];
78
- }
79
- const curModule: Object[] = this.ej2Instances.getInjectedModules() || [];
80
- for (const mod of curModule) {
81
- if (prevModule.indexOf(mod) === -1) {
82
- prevModule.push(mod);
83
- }
84
- }
85
- this.ej2Instances.injectedModules = prevModule;
86
- }
87
- },
88
- mounted(): void {
89
- const cusEle: any = this.$el ? this.$el.querySelectorAll('div.e-directive') : null;
90
- if (!isExecute && cusEle) {
91
- for (let i: number = 0; i < cusEle.length; i++) {
92
- const cusElement: HTMLElement = cusEle[parseInt(i.toString(), 10)];
93
- if (cusElement.parentElement) { cusElement.parentElement.removeChild(cusElement); }
94
- }
95
- }
96
- this.ej2Instances.isVue = true;
97
- this.ej2Instances.isVue3 = this.isVue3;
98
- this.ej2Instances.vueInstance = this;
99
- if (this.isVue3) {
100
- this.ej2Instances.ej2Instances = this.ej2Instances;
101
- this.ej2Instances.referModels = this.models;
102
- this.setModelValue();
103
- }
104
- this.ej2Instances.appendTo(this.$el);
105
- },
106
- updated(): void {
107
- this.updated();
108
- },
109
- beforeDestroy(): void {
110
- this.destroyComponent();
111
- },
112
- beforeUnmount(): void {
113
- this.destroyComponent();
114
- },
115
- methods: {
116
- setModelValue(): void {
117
- if (!isNullOrUndefined(this.modelValue) || !isNullOrUndefined(this.$attrs.modelValue)) {
118
- const key: string[] = this.models.toString().match(/checked|value/) || [];
119
- const propKey: string = key[0];
120
- if (!isNullOrUndefined(propKey)) {
121
- this.ej2Instances[`${propKey}`] = !isNullOrUndefined(this.modelValue) ? this.modelValue : this.$attrs.modelValue;
122
- }
123
- }
124
- },
125
- updated(): void {
126
- if (this.isVue3) {
127
- this.setModelValue();
128
- }
129
- if (this.hasChildDirective) {
130
- const childKey: Object = {};
131
- this.fetchChildPropValues(childKey);
132
- const curChildDir: string = JSON.stringify(childKey);
133
- if (this.childDirObjects !== curChildDir) {
134
- this.childDirObjects = curChildDir;
135
- this.assignValueToWrapper(childKey, false);
136
- }
137
- }
138
- },
139
- getInjectedServices(): Object[] {
140
- let ret: Object[] = []; let provide: any;
141
- if (this.$root && this.isDecorator) {
142
- provide = getValue('$root.$options.provide', this);
143
- } else if (this.$vnode) {
144
- provide = getValue('$vnode.context.$options.provide', this);
145
- } else if (this.$parent) {
146
- provide = getValue('$parent.$options.provide', this);
147
- }
148
- if (isNullOrUndefined(provide) && !isNullOrUndefined(this.$)) {
149
- provide = getValue('$.parent.provides', this);
150
- }
151
- if (provide) {
152
- let injectables: any = provide;
153
- if (typeof provide === 'function') {
154
- if (provide.managed) {
155
- const pKey: Object = provide.managed;
156
- const pValue: string[] = Object.keys(pKey);
157
- let key: string[];
158
- if (this.$root && this.isDecorator) {
159
- key = Object.keys(this.$root);
160
- } else if (this.$vnode) {
161
- key = Object.keys(this.$vnode.context);
162
- } else if (this.$parent) {
163
- key = Object.keys(this.$parent);
164
- }
165
- for (let i: number = 0; i < pValue.length; i++) {
166
- for (let j: number = 0; j < key.length; j++) {
167
- if ((key[parseInt(j.toString(), 10)].indexOf(pValue[parseInt(i.toString(), 10)])) !== -1) {
168
- if (this.$root && this.isDecorator) {
169
- pKey[pValue[parseInt(j.toString(), 10)]] = this.$root[key[parseInt(i.toString(), 10)]];
170
- } else if (this.$vnode) {
171
- pKey[pValue[parseInt(i.toString(), 10)]] = this.$vnode.context[key[parseInt(j.toString(), 10)]];
172
- } else if (this.$parent) {
173
- pKey[pValue[parseInt(i.toString(), 10)]] = this.$parent[key[parseInt(j.toString(), 10)]];
174
- }
175
- injectables = pKey;
176
- }
177
- }
178
- }
179
- }
180
- else if (this.$vnode) {
181
- injectables = this.$vnode.context.$options.provide();
182
- } else if (this.$parent) {
183
- injectables = this.$parent.$options.provide();
184
- }
185
- }
186
- ret = injectables[this.ej2Instances.getModuleName()] || [];
187
- }
188
- this.isDecorator = false;
189
- return ret;
190
- },
191
- destroyComponent(): void {
192
- this.ej2Instances.destroy();
193
- (this.$el as any).style.visibility = 'hidden';
194
- this.clearTemplate();
195
- },
196
- destroyPortals(element?: any): void {
197
- if (element) {
198
- const destroy: any = getValue('__vue__.$destroy', element);
199
- if (destroy) {
200
- element.__vue__.$destroy();
201
- } else if (!isExecute && element._vnode) {
202
- try { aVue.render(null, element); }
203
- catch (e) { /* Handle error */ }
204
- }
205
- if (element.innerHTML) {
206
- element.innerHTML = '';
207
- }
208
- }
209
- },
210
- bindProperties(): void {
211
- const options: Object = {};
212
- for (const prop of this.propKeys) {
213
- if (!isNullOrUndefined(this[`${prop}`])) {
214
- options[`${prop}`] = this[`${prop}`];
215
- }
216
- else if (this[0] && !isNullOrUndefined(this[0][0]) && !isNullOrUndefined(this[0][0][`${prop}`])) {
217
- options[`${prop}`] = this[0][0][`${prop}`];
218
- }
219
- }
220
- if (this.hasChildDirective) {
221
- this.fetchChildPropValues(options);
222
- }
223
- if (this.hasInjectedModules) {
224
-
225
- const prevModule: Object[] = this.getInjectedServices() || [];
226
- const curModule: Object[] = this.ej2Instances.getInjectedModules() || [];
227
- for (const mod of curModule) {
228
- if (prevModule.indexOf(mod) === -1) {
229
- prevModule.push(mod);
230
- }
231
- }
232
- this.ej2Instances.injectedModules = prevModule;
233
- }
234
- this.assignValueToWrapper(options);
235
- },
236
- assignValueToWrapper(option: Object, silent?: boolean): void {
237
- this.ej2Instances.setProperties(extend({}, {}, option, true), isNullOrUndefined(silent as any) ? true : silent);
238
- },
239
- fetchChildPropValues(childOption: Object): void {
240
- let dirProps: Object = {};
241
- if (!this.isVue3) {
242
- dirProps = this.getDirectiveValues(this.$slots.default, this.tagMapper || {}, this.tagNameMapper || {});
243
- } else {
244
- let propRef: any;
245
- if (this[0] && this[0][1].slots.default) {
246
- propRef = this[0][1].slots.default();
247
- }
248
- else if (this && this.$ && this.$.slots && this.$.slots.default) {
249
- propRef = this.$.slots.default();
250
- }
251
- if (propRef) {
252
- for (let i: number = 0; i < propRef.length; i++) {
253
- if (propRef[parseInt(i.toString(), 10)].type.methods || propRef[parseInt(i.toString(), 10)].type === 'e-seriescollection') {
254
- const key: string = propRef[parseInt(i.toString(), 10)].type === 'e-seriescollection' ? 'series-collection' :
255
- propRef[parseInt(i.toString(), 10)].type.methods.getTag().replace('e-', '');
256
- const ref: any = this.resolveArrayDirectives(propRef[parseInt(i.toString(), 10)].children, key);
257
- const spKeys: any = key.split('-');
258
- const controlName: string = this.ej2Instances.getModuleName().toLowerCase();
259
- let keyRef: string = (spKeys.length > 1 && controlName.indexOf(spKeys[0]) > -1) ? spKeys[1] : spKeys[0];
260
- keyRef = keyRef.replace(controlName, '');
261
- keyRef = this.tagNameMapper['e-' + key] ? this.tagNameMapper['e-' + key].replace('e-', '') : keyRef;
262
- if (controlName === 'splitter' && keyRef === 'panes') {
263
- keyRef = 'paneSettings';
264
- } else if (controlName === 'bulletchart' && keyRef === 'range') {
265
- keyRef = 'ranges';
266
- } else if (controlName === 'schedule' && keyRef === 'header') {
267
- keyRef = 'headerRows';
268
- }
269
- dirProps[`${keyRef}`] = ref[`${key}`];
270
- }
271
- }
272
- } else {
273
- return;
274
- }
275
- }
276
- if (!this.childDirObjects) {
277
- this.childDirObjects = JSON.stringify(dirProps);
278
- }
279
- for (const dirProp of Object.keys(dirProps)) {
280
- childOption[`${dirProp}`] = dirProps[`${dirProp}`];
281
- }
282
- },
283
- resolveArrayDirectives(slots: any, tagName: any): any {
284
- let slot: any = [];
285
- let innerDirValues: any;
286
- slot = slots.default ? slots.default() : slots;
287
- slot = slot.flatMap((item: any) => Array.isArray(item.children) ? item.children : item);
288
- const items: any = {};
289
- items[`${tagName}`] = [];
290
- for (const childSlot of slot) {
291
- let tempObj: any = {};
292
- const tagRef: any = childSlot.type.methods ? childSlot.type.methods.getTag() : tagName;
293
- if (childSlot.children) {
294
- let key: string;
295
- innerDirValues = this.resolveComplexDirs(childSlot.children, this.tagMapper['e-' + tagName], tagRef);
296
- if (innerDirValues.length) {
297
- tempObj = innerDirValues;
298
- } else {
299
- for (let i: number = 0; i < Object.keys(innerDirValues).length; i++) {
300
- key = Object.keys(innerDirValues)[parseInt(i.toString(), 10)];
301
- tempObj[`${key}`] = innerDirValues[`${key}`];
302
- }
303
- }
304
- }
305
- if (childSlot.props) {
306
- Object.keys(childSlot.props).forEach((key: string) => {
307
- const propName: string = key.replace(/-[a-z]/g, (e: any) => { return e[1].toUpperCase(); });
308
- if (propName) {
309
- tempObj[`${propName}`] = childSlot.props[`${key}`];
310
- }
311
- });
312
- }
313
- if (((/[s]\b/).test(tagRef) && innerDirValues) && (!(/[s]\b/).test(tagName) || innerDirValues.length)) {
314
- if (Array.isArray(tempObj)) { tempObj.forEach((item: any) => { items[`${tagName}`].push(item); }); } else { items[`${tagName}`].push(tempObj); }
315
- }
316
- else if (tempObj && Object.keys(tempObj).length !== 0) {
317
- items[`${tagName}`].push(tempObj);
318
- }
319
- }
320
- return items;
321
- },
322
- resolveComplexDirs(slots: any, tagObject: any, tagName: string): any {
323
- let slot: any = [];
324
- let innerDirValues: any;
325
- slot = slots.default ? slots.default() : slots;
326
- let items: any = {};
327
- for (const childSlot of slot) {
328
- let tagRef: any;
329
- let tag: any;
330
- if (tagObject[`${tagName}`]) {
331
- tagRef = Object.keys(tagObject[`${tagName}`]);
332
- tag = tagRef.find(
333
- (key: any) =>
334
- tagObject[`${tagName}`][`${key}`] ===
335
- childSlot.type.methods.getTag().replace(/[s]\b/, '')
336
- );
337
- tag = tag ? tag : childSlot.type.methods.getTag();
338
- tag = (this.tagNameMapper[`${tag}`] ? this.tagNameMapper[`${tag}`] : tag).replace('e-', '');
339
- if (this.ej2Instances.getModuleName().toLowerCase() === 'diagram' && tag.indexOf('annotations') !== -1) {
340
- tag = 'annotations';
341
- }
342
- }
343
- if (childSlot.children) {
344
- innerDirValues = this.resolveComplexInnerDirs(childSlot.children, tagObject[`${tagName}`], childSlot.type.methods.getTag());
345
- if (!items[`${tag}`]) {
346
- items[`${tag}`] = [];
347
- }
348
- if (innerDirValues.length > 1) {
349
- items[`${tag}`] = innerDirValues;
350
- } else {
351
- items[`${tag}`].push(innerDirValues);
352
- }
353
- }
354
- if (childSlot.props) {
355
- childSlot.props = this.getCamelCaseProps(childSlot.props);
356
- }
357
- if (slot.length > 1) {
358
- items = Object.keys(items).length === 0 && !items.length ? [] : items;
359
- if (childSlot.props) { items.push(childSlot.props); }
360
- }
361
- else {
362
- items = childSlot.props ? (<any>Object).assign(items, childSlot.props) : items;
363
- }
364
- }
365
- return items;
366
- },
367
- resolveComplexInnerDirs(slots: any, tagObject: any, tagName: string): any {
368
- let slot: any = [];
369
- slot = slots.default ? slots.default() : slots;
370
- let items: any = slot.length > 1 ? [] : {};
371
- for (const childSlot of slot) {
372
- let innerDirValues: any = null;
373
- let tag: string = childSlot.type.methods.getTag();
374
- tag = (this.tagNameMapper[`${tag}`] ? this.tagNameMapper[`${tag}`] : tag).replace('e-', '');
375
- if (childSlot.children) {
376
- innerDirValues = this.resolveMultilevelComplexInnerDirs(childSlot.children, tagObject[`${tagName}`], childSlot.type.methods.getTag());
377
- if ((/[s]\b/).test(tag) || slot.length > 1) {
378
- if ((/[s]\b/).test(tag)) {
379
- items[`${tag}`] = !items[`${tag}`] ? [] : items[`${tag}`];
380
- if (innerDirValues.length) {
381
- items[`${tag}`] = innerDirValues;
382
- } else { items[`${tag}`].push(innerDirValues); }
383
- } else if (innerDirValues && !childSlot.props) {
384
- items.push(innerDirValues);
385
- }
386
- } else {
387
- items = innerDirValues ? innerDirValues : items;
388
- }
389
- }
390
- if (childSlot.props) {
391
- childSlot.props = this.getCamelCaseProps(childSlot.props);
392
- }
393
- if (slot.length > 1 && childSlot.props) {
394
- if (innerDirValues) {
395
- innerDirValues = childSlot.props ? (<any>Object).assign(innerDirValues, childSlot.props) : innerDirValues;
396
- items.push(innerDirValues);
397
- }
398
- else if (items.length >= 0) {
399
- items.push(childSlot.props);
400
- } else {
401
- items = childSlot.props ? (<any>Object).assign(items, childSlot.props) : items;
402
- }
403
- } else {
404
- items = childSlot.props ? (<any>Object).assign(items, childSlot.props) : items;
405
- }
406
- }
407
- return items;
408
- },
409
- resolveMultilevelComplexInnerDirs(slots: any, tagObject: any, tagName: string): any {
410
- let slot: any = [];
411
- slot = slots.default ? slots.default() : slots;
412
- let items: any = slot.length > 1 ? [] : {};
413
- for (const childSlot of slot) {
414
- let innerDirValues: any = null;
415
- let tag: string = childSlot.type.methods.getTag();
416
- tag = (this.tagNameMapper[`${tag}`] ? this.tagNameMapper[`${tag}`] : tag).replace('e-', '');
417
- if (childSlot.children) {
418
- innerDirValues = this.resolveComplexInnerDirs(childSlot.children, tagObject[`${tagName}`], childSlot.type.methods.getTag());
419
- }
420
- if (childSlot.props) {
421
- childSlot.props = this.getCamelCaseProps(childSlot.props);
422
- }
423
- if ((/[s]\b/).test(tag)) {
424
- items[`${tag}`] = !items[`${tag}`] ? [] : items[`${tag}`];
425
- if (innerDirValues.length) {
426
- items[`${tag}`] = innerDirValues;
427
- } else { items[`${tag}`].push(innerDirValues); }
428
- if (childSlot.props) { items[`${tag}`].push(childSlot.props); }
429
- } else {
430
- items = innerDirValues;
431
- items = childSlot.props ? (<any>Object).assign(items, childSlot.props) : items;
432
- }
433
- }
434
- return items;
435
- },
436
- getDirectiveValues(tagDirectives: any, tagMapper: { [key: string]: Object }, tagNameMapper: Object): Object {
437
- const keyTags: string[] = Object.keys(tagMapper);
438
- const dir: Object = {};
439
- if (tagDirectives) {
440
- for (const tagDirective of tagDirectives) {
441
- const tagCompOption: any = tagDirective.componentOptions;
442
- if (tagCompOption && tagCompOption.children && this.getTagName(tagCompOption) ||
443
- (tagDirective.tag === 'e-seriescollection' && tagDirective.children)) {
444
- let dirTag: string = tagCompOption ? this.getTagName(tagCompOption) : tagDirective.tag;
445
- dirTag = (dirTag === 'e-seriescollection') ? 'e-seriesCollection' : dirTag;
446
- if (keyTags.indexOf(dirTag) !== -1) {
447
- const tagName: string = tagNameMapper[`${dirTag}`] ? tagNameMapper[`${dirTag}`] : dirTag;
448
- dir[tagName.replace('e-', '')] = [];
449
- const children: any = tagCompOption ? tagCompOption.children : tagDirective.children;
450
- for (const tagDirChild of children) {
451
- const retObj: Object = this.getVNodeValue(tagDirChild, tagMapper[`${dirTag}`], tagNameMapper);
452
- if (Object.keys(retObj).length !== 0) {
453
- dir[tagName.replace('e-', '')].push(retObj);
454
- }
455
- }
456
- }
457
- }
458
- }
459
- }
460
- return dir;
461
- },
462
- getMultiLevelDirValue(tagDirectories: any, tagKey: string | Object, tagNameMapper: Object): Object {
463
- const mulObj: Object = {};
464
- for (const tagDir of tagDirectories) {
465
- let key: string;
466
- let children: any;
467
- if (tagDir.componentOptions) {
468
- key = this.getTagName(tagDir.componentOptions);
469
- if (tagDir.componentOptions.children) {
470
- children = tagDir.componentOptions.children;
471
- }
472
- } else if ((tagDir.tag === 'e-markersettings' || tagDir.tag === 'e-markersetting') && tagDir.children) {
473
- key = (tagDir.tag === 'e-markersettings') ? 'e-markerSettings' : 'e-markerSetting';
474
- children = tagDir.children;
475
- }
476
- if (key) {
477
- const tagName: string = tagNameMapper[`${key}`] ? tagNameMapper[`${key}`] : key;
478
- mulObj[tagName.replace('e-', '')] = [];
479
- if (children) {
480
- for (const tagDirChild of children) {
481
- const mulLevObj: Object = this.getVNodeValue(tagDirChild, tagKey[`${key}`], tagNameMapper);
482
- if (Object.keys(mulLevObj).length !== 0) {
483
- mulObj[tagName.replace('e-', '')].push(mulLevObj);
484
- }
485
- }
486
- }
487
- }
488
- }
489
- return mulObj;
490
- },
491
- getVNodeValue(tagDirective: any, tagKey: string | Object, tagNameMapper: Object): Object {
492
- let ret: Object = {};
493
- if (tagDirective.componentOptions || ((tagDirective.tag === 'e-markersettings' || tagDirective.tag === 'e-markersetting') && tagDirective.context)) {
494
- let dirTag: string;
495
- if (tagDirective.componentOptions) {
496
- dirTag = this.getTagName(tagDirective.componentOptions);
497
- } else {
498
- dirTag = (tagDirective.tag === 'e-markersettings') ? 'e-markerSettings' : 'e-markerSetting';
499
- }
500
- const tagData: any = tagDirective.data;
501
- if (typeof tagKey === 'string' && dirTag === tagKey && tagData) {
502
- ret = tagData.attrs ? this.getCamelCaseProps(tagData.attrs) : this.getCamelCaseProps(tagData);
503
- } else if (typeof tagKey === 'object') {
504
- if (tagDirective.componentOptions.children && (Object.keys(tagKey).indexOf(dirTag) !== -1)) {
505
- ret = this.getMultiLevelDirValue(tagDirective.componentOptions.children, tagKey[`${dirTag}`], tagNameMapper);
506
- } else if (tagDirective.children && (Object.keys(tagKey).indexOf(dirTag) !== -1) && (dirTag === 'e-markersettings' || dirTag === 'e-markersetting')) {
507
- ret = this.getMultiLevelDirValue(tagDirective.children, tagKey[`${dirTag}`], tagNameMapper);
508
- }
509
- if (tagData && tagData.attrs) {
510
- ret = extend(ret, this.getCamelCaseProps(tagData.attrs));
511
- }
512
- }
513
- }
514
- return ret;
515
- },
516
- /**
517
- * convert kebab case directive props to camel case.
518
- *
519
- * @param {Object} props - Objects in kebab case directive props.
520
- * @returns {Object} Object converted into camel case directive props.
521
- */
522
- getCamelCaseProps(props: Object): Object {
523
- const retProps: Object = {};
524
- for (const prop of Object.keys(props)) {
525
- retProps[prop.replace(/-[a-z]/g, (e: any) => { return e[1].toUpperCase(); })] = props[`${prop}`];
526
- }
527
- return retProps;
528
- },
529
- dataBind(): void {
530
- this.ej2Instances.dataBind();
531
- },
532
- setProperties(arg: Object, muteOnChange?: boolean): void {
533
- return this.ej2Instances.setProperties(arg, muteOnChange);
534
- },
535
- getTagName(options: any): string | undefined {
536
- let tag: any = options.tag;
537
- const optCtor: any = options.Ctor;
538
- if (!tag && optCtor && optCtor.extendOptions && optCtor.extendOptions.methods && optCtor.extendOptions.methods.getTag) {
539
- tag = options.Ctor.extendOptions.methods.getTag();
540
- }
541
- return tag;
542
- }
543
- }
544
- });
545
-
546
- /**
547
- * Collect public property values for the Vue component.
548
- *
549
- * @param {any} options - represents props object.
550
- * @returns {any} array of props object and `watchobject` respectively.
551
- */
552
- export function getProps(options: any = {}): any {
553
- if (options.props) {
554
- for (const prop of options.props) {
555
- (options.newprops || (options.newprops = {}))[`${prop}`] = {};
556
- (options.watch || (options.watch = {}))[`${prop}`] = function (newVal: Object): void { // watch it
557
- this.ej2Instances[`${prop}`] = newVal;
558
- if (this.dataBind && (options.name !== 'DateRangePickerComponent')) {
559
- this.dataBind();
560
- }
561
- };
562
- }
563
- }
564
- return [options.newprops, options.watch];
565
- }
566
-
567
- if (!isExecute) { setProxyToRaw(aVue.toRaw); }
568
-
@@ -1,6 +0,0 @@
1
- /**
2
- * index for component base
3
- */
4
- export * from './component-base';
5
- export * from './template';
6
- export * from './vue-types';
package/dist/ts/index.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * index for component base
3
- */
4
- export * from './component-base';
5
- export * from './template';
6
- export * from './vue-types';
@@ -1,8 +0,0 @@
1
- /**
2
- * Compiler function that convert the template property to DOM element.
3
- *
4
- * @param {any} templateElement - represents value of the template property from the component.
5
- * @param {Object} helper - represents helper object to utilize on template compilation.
6
- * @returns {NodeList} template element that append to the component.
7
- */
8
- export declare function compile(templateElement: any, helper?: Object): (data: Object | JSON, component?: any, propName?: any, element?: any, root?: any) => Object;