@syncfusion/ej2-vue-base 20.3.56 → 20.4.38
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.
- package/CHANGELOG.md +6 -4
- package/dist/ej2-vue-base.umd.min.js +9 -0
- package/dist/es6/ej2-vue-base.es2015.js +134 -80
- package/dist/es6/ej2-vue-base.es2015.js.map +1 -1
- package/dist/es6/ej2-vue-base.es5.js +136 -82
- package/dist/es6/ej2-vue-base.es5.js.map +1 -1
- package/dist/global/ej2-vue-base.min.js +2 -2
- package/dist/global/ej2-vue-base.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +6 -6
- package/postinstall.js +22 -5
- package/src/component-base.d.ts +1 -0
- package/src/component-base.js +105 -52
- package/src/component-decorator.js +14 -14
- package/src/template.js +17 -16
package/src/component-base.js
CHANGED
|
@@ -28,7 +28,7 @@ export function _interopRequireWildcard(obj) {
|
|
|
28
28
|
if (obj != null) {
|
|
29
29
|
for (var key in obj) {
|
|
30
30
|
if (Object.prototype.hasOwnProperty.call(obj, key))
|
|
31
|
-
newObj[key] = obj[key];
|
|
31
|
+
newObj["" + key] = obj["" + key];
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
newObj.default = obj;
|
|
@@ -72,6 +72,7 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
72
72
|
}
|
|
73
73
|
var injectables = getValue('$root.$options.provide', this);
|
|
74
74
|
var vueInjectables = getValue('$parent.$options.provide', this);
|
|
75
|
+
vueInjectables = !isNullOrUndefined(vueInjectables) ? vueInjectables : getValue('$.parent.provides', this);
|
|
75
76
|
if (this.hasInjectedModules && !isExecute) {
|
|
76
77
|
var prevModule = [];
|
|
77
78
|
if (injectables && injectables.managed) {
|
|
@@ -98,7 +99,7 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
98
99
|
var cusEle = this.$el ? this.$el.querySelectorAll("div.e-directive") : null;
|
|
99
100
|
if (!isExecute && cusEle) {
|
|
100
101
|
for (var i = 0; i < cusEle.length; i++) {
|
|
101
|
-
cusEle[i].parentElement && cusEle[i].parentElement.removeChild(cusEle[i]);
|
|
102
|
+
cusEle[parseInt(i.toString(), 10)].parentElement && cusEle[parseInt(i.toString(), 10)].parentElement.removeChild(cusEle[parseInt(i.toString(), 10)]);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
this.ej2Instances.isVue = true;
|
|
@@ -107,9 +108,19 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
107
108
|
if (this.isVue3) {
|
|
108
109
|
this.ej2Instances.ej2Instances = this.ej2Instances;
|
|
109
110
|
this.ej2Instances.referModels = this.models;
|
|
111
|
+
this.setModelValue();
|
|
110
112
|
}
|
|
111
113
|
this.ej2Instances.appendTo(this.$el);
|
|
112
114
|
};
|
|
115
|
+
ComponentBase.prototype.setModelValue = function () {
|
|
116
|
+
if (!isNullOrUndefined(this.modelValue) || !isNullOrUndefined(this.$attrs.modelValue)) {
|
|
117
|
+
var key = this.models.toString().match(/checked|value/) || [];
|
|
118
|
+
var propKey = key[0];
|
|
119
|
+
if (!isNullOrUndefined(propKey)) {
|
|
120
|
+
this.ej2Instances["" + propKey] = !isNullOrUndefined(this.modelValue) ? this.modelValue : this.$attrs.modelValue;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
113
124
|
ComponentBase.prototype.getInjectedServices = function () {
|
|
114
125
|
var ret = [];
|
|
115
126
|
var provide;
|
|
@@ -122,6 +133,9 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
122
133
|
else if (this.$parent) {
|
|
123
134
|
provide = getValue('$parent.$options.provide', this);
|
|
124
135
|
}
|
|
136
|
+
if (isNullOrUndefined(provide) && !isNullOrUndefined(this.$)) {
|
|
137
|
+
provide = getValue('$.parent.provides', this);
|
|
138
|
+
}
|
|
125
139
|
if (provide) {
|
|
126
140
|
// tslint:disable:no-any
|
|
127
141
|
var injectables = provide;
|
|
@@ -141,15 +155,15 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
141
155
|
}
|
|
142
156
|
for (var i = 0; i < provideValue.length; i++) {
|
|
143
157
|
for (var j = 0; j < key.length; j++) {
|
|
144
|
-
if ((key[j].indexOf(provideValue[i])) !== -1) {
|
|
158
|
+
if ((key[parseInt(j.toString(), 10)].indexOf(provideValue[parseInt(i.toString(), 10)])) !== -1) {
|
|
145
159
|
if (this.$root && this.isDecorator) {
|
|
146
|
-
provideKey[provideValue[j]] = this.$root[key[i]];
|
|
160
|
+
provideKey[provideValue[parseInt(j.toString(), 10)]] = this.$root[key[parseInt(i.toString(), 10)]];
|
|
147
161
|
}
|
|
148
162
|
else if (this.$vnode) {
|
|
149
|
-
provideKey[provideValue[i]] = this.$vnode.context[key[j]];
|
|
163
|
+
provideKey[provideValue[parseInt(i.toString(), 10)]] = this.$vnode.context[key[parseInt(j.toString(), 10)]];
|
|
150
164
|
}
|
|
151
165
|
else if (this.$parent) {
|
|
152
|
-
provideKey[provideValue[i]] = this.$parent[key[j]];
|
|
166
|
+
provideKey[provideValue[parseInt(i.toString(), 10)]] = this.$parent[key[parseInt(j.toString(), 10)]];
|
|
153
167
|
}
|
|
154
168
|
injectables = provideKey;
|
|
155
169
|
}
|
|
@@ -170,6 +184,9 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
170
184
|
return ret;
|
|
171
185
|
};
|
|
172
186
|
ComponentBase.prototype.updated = function () {
|
|
187
|
+
if (this.isVue3) {
|
|
188
|
+
this.setModelValue();
|
|
189
|
+
}
|
|
173
190
|
if (this.hasChildDirective) {
|
|
174
191
|
var childKey = {};
|
|
175
192
|
this.fetchChildPropValues(childKey);
|
|
@@ -190,8 +207,8 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
190
207
|
var options = {};
|
|
191
208
|
for (var _i = 0, _a = this.propKeys; _i < _a.length; _i++) {
|
|
192
209
|
var prop = _a[_i];
|
|
193
|
-
if ((!isNullOrUndefined(this[prop]) && !this.isVue3) || (this[0] && !isNullOrUndefined(this[0][0]) && !isNullOrUndefined(this[0][0][prop]))) {
|
|
194
|
-
options[prop] = !this.isVue3 ? this[prop] : this[0][0][prop];
|
|
210
|
+
if ((!isNullOrUndefined(this["" + prop]) && !this.isVue3) || (this[0] && !isNullOrUndefined(this[0][0]) && !isNullOrUndefined(this[0][0]["" + prop]))) {
|
|
211
|
+
options["" + prop] = !this.isVue3 ? this["" + prop] : this[0][0]["" + prop];
|
|
195
212
|
}
|
|
196
213
|
}
|
|
197
214
|
if (this.hasChildDirective) {
|
|
@@ -228,9 +245,10 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
228
245
|
}
|
|
229
246
|
if (propRef) {
|
|
230
247
|
for (var i = 0; i < propRef.length; i++) {
|
|
231
|
-
if (propRef[i].type.methods) {
|
|
232
|
-
var key = propRef[i
|
|
233
|
-
|
|
248
|
+
if (propRef[parseInt(i.toString(), 10)].type.methods || propRef[parseInt(i.toString(), 10)].type === 'e-seriescollection') {
|
|
249
|
+
var key = propRef[parseInt(i.toString(), 10)].type === 'e-seriescollection' ? 'series-collection' :
|
|
250
|
+
propRef[parseInt(i.toString(), 10)].type.methods.getTag().replace("e-", "");
|
|
251
|
+
var ref = this.resolveArrayDirectives(propRef[parseInt(i.toString(), 10)].children, key);
|
|
234
252
|
var splitKeys = key.split('-');
|
|
235
253
|
var controlName = this.ej2Instances.getModuleName().toLowerCase();
|
|
236
254
|
var keyRef = (splitKeys.length > 1 && controlName.indexOf(splitKeys[0]) > -1) ? splitKeys[1] : splitKeys[0];
|
|
@@ -244,7 +262,7 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
244
262
|
else if (controlName == "schedule" && keyRef == "header") {
|
|
245
263
|
keyRef = "headerRows";
|
|
246
264
|
}
|
|
247
|
-
dirProps[keyRef] = ref[key];
|
|
265
|
+
dirProps["" + keyRef] = ref["" + key];
|
|
248
266
|
}
|
|
249
267
|
}
|
|
250
268
|
}
|
|
@@ -257,7 +275,7 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
257
275
|
}
|
|
258
276
|
for (var _i = 0, _a = Object.keys(dirProps); _i < _a.length; _i++) {
|
|
259
277
|
var dirProp = _a[_i];
|
|
260
|
-
childOption[dirProp] = dirProps[dirProp];
|
|
278
|
+
childOption["" + dirProp] = dirProps["" + dirProp];
|
|
261
279
|
}
|
|
262
280
|
};
|
|
263
281
|
ComponentBase.prototype.resolveArrayDirectives = function (slots, tagName) {
|
|
@@ -265,7 +283,7 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
265
283
|
var innerDirValues;
|
|
266
284
|
slot = slots.default ? slots.default() : slots;
|
|
267
285
|
var items = {};
|
|
268
|
-
items[tagName] = [];
|
|
286
|
+
items["" + tagName] = [];
|
|
269
287
|
var _loop_2 = function (childSlot) {
|
|
270
288
|
var tempObj = {};
|
|
271
289
|
var tagRef = childSlot.type.methods ? childSlot.type.methods.getTag() : tagName;
|
|
@@ -277,22 +295,25 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
277
295
|
}
|
|
278
296
|
else {
|
|
279
297
|
for (var i = 0; i < Object.keys(innerDirValues).length; i++) {
|
|
280
|
-
key = Object.keys(innerDirValues)[i];
|
|
281
|
-
tempObj[key] = innerDirValues[key];
|
|
298
|
+
key = Object.keys(innerDirValues)[parseInt(i.toString(), 10)];
|
|
299
|
+
tempObj["" + key] = innerDirValues["" + key];
|
|
282
300
|
}
|
|
283
301
|
;
|
|
284
302
|
}
|
|
285
303
|
}
|
|
286
304
|
if (childSlot.props) {
|
|
287
305
|
Object.keys(childSlot.props).forEach(function (key) {
|
|
288
|
-
|
|
306
|
+
var propName = key.replace(/-[a-z]/g, function (e) { return e[1].toUpperCase(); });
|
|
307
|
+
if (propName) {
|
|
308
|
+
tempObj["" + propName] = childSlot.props["" + key];
|
|
309
|
+
}
|
|
289
310
|
});
|
|
290
311
|
}
|
|
291
312
|
if (((/[s]\b/).test(tagRef) && innerDirValues) && (!(/[s]\b/).test(tagName) || innerDirValues.length)) {
|
|
292
|
-
items[tagName] = tempObj;
|
|
313
|
+
items["" + tagName] = tempObj;
|
|
293
314
|
}
|
|
294
315
|
else if (tempObj && Object.keys(tempObj).length !== 0) {
|
|
295
|
-
items[tagName].push(tempObj);
|
|
316
|
+
items["" + tagName].push(tempObj);
|
|
296
317
|
}
|
|
297
318
|
};
|
|
298
319
|
var this_2 = this;
|
|
@@ -310,10 +331,10 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
310
331
|
var _loop_3 = function (childSlot) {
|
|
311
332
|
var tagRef = void 0;
|
|
312
333
|
var tag = void 0;
|
|
313
|
-
if (tagObject[tagName]) {
|
|
314
|
-
tagRef = Object.keys(tagObject[tagName]);
|
|
334
|
+
if (tagObject["" + tagName]) {
|
|
335
|
+
tagRef = Object.keys(tagObject["" + tagName]);
|
|
315
336
|
tag = tagRef.find(function (key) {
|
|
316
|
-
return tagObject[tagName][key] ===
|
|
337
|
+
return tagObject["" + tagName]["" + key] ===
|
|
317
338
|
childSlot.type.methods.getTag().replace(/[s]\b/, "");
|
|
318
339
|
});
|
|
319
340
|
tag = tag
|
|
@@ -324,17 +345,20 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
324
345
|
}
|
|
325
346
|
}
|
|
326
347
|
if (childSlot.children) {
|
|
327
|
-
innerDirValues = this_3.resolveComplexInnerDirs(childSlot.children, tagObject[tagName], childSlot.type.methods.getTag());
|
|
328
|
-
if (!items[tag]) {
|
|
329
|
-
items[tag] = [];
|
|
348
|
+
innerDirValues = this_3.resolveComplexInnerDirs(childSlot.children, tagObject["" + tagName], childSlot.type.methods.getTag());
|
|
349
|
+
if (!items["" + tag]) {
|
|
350
|
+
items["" + tag] = [];
|
|
330
351
|
}
|
|
331
352
|
if (innerDirValues.length > 1) {
|
|
332
|
-
items[tag] = innerDirValues;
|
|
353
|
+
items["" + tag] = innerDirValues;
|
|
333
354
|
}
|
|
334
355
|
else {
|
|
335
|
-
items[tag].push(innerDirValues);
|
|
356
|
+
items["" + tag].push(innerDirValues);
|
|
336
357
|
}
|
|
337
358
|
}
|
|
359
|
+
if (childSlot.props) {
|
|
360
|
+
childSlot.props = this_3.getCamelCaseProps(childSlot.props);
|
|
361
|
+
}
|
|
338
362
|
if (slot.length > 1) {
|
|
339
363
|
items = Object.keys(items).length == 0 && !items.length ? [] : items;
|
|
340
364
|
if (childSlot.props) {
|
|
@@ -361,15 +385,15 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
361
385
|
var childSlot = slot_3[_i];
|
|
362
386
|
var tag = childSlot.type.methods.getTag().replace("e-", "");
|
|
363
387
|
if (childSlot.children) {
|
|
364
|
-
innerDirValues = this.resolveMultilevelComplexInnerDirs(childSlot.children, tagObject[tagName], childSlot.type.methods.getTag());
|
|
388
|
+
innerDirValues = this.resolveMultilevelComplexInnerDirs(childSlot.children, tagObject["" + tagName], childSlot.type.methods.getTag());
|
|
365
389
|
if ((/[s]\b/).test(tag) || slot.length > 1) {
|
|
366
390
|
if ((/[s]\b/).test(tag)) {
|
|
367
|
-
items[tag] = !items[tag] ? [] : items[tag];
|
|
391
|
+
items["" + tag] = !items["" + tag] ? [] : items["" + tag];
|
|
368
392
|
if (innerDirValues.length) {
|
|
369
|
-
items[tag] = innerDirValues;
|
|
393
|
+
items["" + tag] = innerDirValues;
|
|
370
394
|
}
|
|
371
395
|
else {
|
|
372
|
-
items[tag].push(innerDirValues);
|
|
396
|
+
items["" + tag].push(innerDirValues);
|
|
373
397
|
}
|
|
374
398
|
}
|
|
375
399
|
else if (innerDirValues) {
|
|
@@ -380,6 +404,9 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
380
404
|
items = innerDirValues ? innerDirValues : items;
|
|
381
405
|
}
|
|
382
406
|
}
|
|
407
|
+
if (childSlot.props) {
|
|
408
|
+
childSlot.props = this.getCamelCaseProps(childSlot.props);
|
|
409
|
+
}
|
|
383
410
|
if (slot.length > 1 && childSlot.props) {
|
|
384
411
|
if (items.length >= 0) {
|
|
385
412
|
items.push(childSlot.props);
|
|
@@ -403,18 +430,21 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
403
430
|
var childSlot = slot_4[_i];
|
|
404
431
|
var tag = childSlot.type.methods.getTag().replace("e-", "");
|
|
405
432
|
if (childSlot.children) {
|
|
406
|
-
innerDirValues = this.resolveComplexInnerDirs(childSlot.children, tagObject[tagName], childSlot.type.methods.getTag());
|
|
433
|
+
innerDirValues = this.resolveComplexInnerDirs(childSlot.children, tagObject["" + tagName], childSlot.type.methods.getTag());
|
|
434
|
+
}
|
|
435
|
+
if (childSlot.props) {
|
|
436
|
+
childSlot.props = this.getCamelCaseProps(childSlot.props);
|
|
407
437
|
}
|
|
408
438
|
if ((/[s]\b/).test(tag)) {
|
|
409
|
-
items[tag] = !items[tag] ? [] : items[tag];
|
|
439
|
+
items["" + tag] = !items["" + tag] ? [] : items["" + tag];
|
|
410
440
|
if (innerDirValues.length) {
|
|
411
|
-
items[tag] = innerDirValues;
|
|
441
|
+
items["" + tag] = innerDirValues;
|
|
412
442
|
}
|
|
413
443
|
else {
|
|
414
|
-
items[tag].push(innerDirValues);
|
|
444
|
+
items["" + tag].push(innerDirValues);
|
|
415
445
|
}
|
|
416
446
|
if (childSlot.props) {
|
|
417
|
-
items[tag].push(childSlot.props);
|
|
447
|
+
items["" + tag].push(childSlot.props);
|
|
418
448
|
}
|
|
419
449
|
}
|
|
420
450
|
else {
|
|
@@ -430,14 +460,17 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
430
460
|
if (tagDirectives) {
|
|
431
461
|
for (var _i = 0, tagDirectives_1 = tagDirectives; _i < tagDirectives_1.length; _i++) {
|
|
432
462
|
var tagDirective = tagDirectives_1[_i];
|
|
433
|
-
if (tagDirective.componentOptions && tagDirective.componentOptions.children && tagDirective.componentOptions.tag
|
|
434
|
-
|
|
463
|
+
if (tagDirective.componentOptions && tagDirective.componentOptions.children && tagDirective.componentOptions.tag ||
|
|
464
|
+
(tagDirective.tag === 'e-seriescollection' && tagDirective.children)) {
|
|
465
|
+
var dirTag = tagDirective.componentOptions ? tagDirective.componentOptions.tag : tagDirective.tag;
|
|
466
|
+
dirTag = (dirTag === 'e-seriescollection') ? 'e-seriesCollection' : dirTag;
|
|
435
467
|
if (keyTags.indexOf(dirTag) !== -1) {
|
|
436
|
-
var tagName = tagNameMapper[dirTag] ? tagNameMapper[dirTag] : dirTag;
|
|
468
|
+
var tagName = tagNameMapper["" + dirTag] ? tagNameMapper["" + dirTag] : dirTag;
|
|
437
469
|
dir[tagName.replace('e-', '')] = [];
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
var
|
|
470
|
+
var children = tagDirective.componentOptions ? tagDirective.componentOptions.children : tagDirective.children;
|
|
471
|
+
for (var _a = 0, children_1 = children; _a < children_1.length; _a++) {
|
|
472
|
+
var tagDirChild = children_1[_a];
|
|
473
|
+
var retObj = this.getVNodeValue(tagDirChild, tagMapper["" + dirTag], tagNameMapper);
|
|
441
474
|
if (Object.keys(retObj).length !== 0) {
|
|
442
475
|
dir[tagName.replace('e-', '')].push(retObj);
|
|
443
476
|
}
|
|
@@ -452,14 +485,25 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
452
485
|
var mulObj = {};
|
|
453
486
|
for (var _i = 0, tagDirectories_1 = tagDirectories; _i < tagDirectories_1.length; _i++) {
|
|
454
487
|
var tagDir = tagDirectories_1[_i];
|
|
488
|
+
var key = void 0;
|
|
489
|
+
var children = void 0;
|
|
455
490
|
if (tagDir.componentOptions) {
|
|
456
|
-
|
|
457
|
-
|
|
491
|
+
key = tagDir.componentOptions.tag;
|
|
492
|
+
if (tagDir.componentOptions.children) {
|
|
493
|
+
children = tagDir.componentOptions.children;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
else if ((tagDir.tag === 'e-markersettings' || tagDir.tag === 'e-markersetting') && tagDir.children) {
|
|
497
|
+
key = (tagDir.tag === 'e-markersettings') ? 'e-markerSettings' : 'e-markerSetting';
|
|
498
|
+
children = tagDir.children;
|
|
499
|
+
}
|
|
500
|
+
if (key) {
|
|
501
|
+
var tagName = tagNameMapper["" + key] ? tagNameMapper["" + key] : key;
|
|
458
502
|
mulObj[tagName.replace('e-', '')] = [];
|
|
459
|
-
if (
|
|
460
|
-
for (var _a = 0,
|
|
461
|
-
var tagDirChild =
|
|
462
|
-
var mulLevObj = this.getVNodeValue(tagDirChild, tagKey[key], tagNameMapper);
|
|
503
|
+
if (children) {
|
|
504
|
+
for (var _a = 0, children_2 = children; _a < children_2.length; _a++) {
|
|
505
|
+
var tagDirChild = children_2[_a];
|
|
506
|
+
var mulLevObj = this.getVNodeValue(tagDirChild, tagKey["" + key], tagNameMapper);
|
|
463
507
|
if (Object.keys(mulLevObj).length !== 0) {
|
|
464
508
|
mulObj[tagName.replace('e-', '')].push(mulLevObj);
|
|
465
509
|
}
|
|
@@ -471,14 +515,23 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
471
515
|
};
|
|
472
516
|
ComponentBase.prototype.getVNodeValue = function (tagDirective, tagKey, tagNameMapper) {
|
|
473
517
|
var ret = {};
|
|
474
|
-
if (tagDirective.componentOptions) {
|
|
475
|
-
var dirTag =
|
|
518
|
+
if (tagDirective.componentOptions || ((tagDirective.tag === 'e-markersettings' || tagDirective.tag === 'e-markersetting') && tagDirective.context)) {
|
|
519
|
+
var dirTag = void 0;
|
|
520
|
+
if (tagDirective.componentOptions) {
|
|
521
|
+
dirTag = tagDirective.componentOptions.tag;
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
dirTag = (tagDirective.tag === 'e-markersettings') ? 'e-markerSettings' : 'e-markerSetting';
|
|
525
|
+
}
|
|
476
526
|
if (typeof tagKey === 'string' && dirTag === tagKey && tagDirective.data) {
|
|
477
527
|
ret = tagDirective.data.attrs ? this.getCamelCaseProps(tagDirective.data.attrs) : this.getCamelCaseProps(tagDirective.data);
|
|
478
528
|
}
|
|
479
529
|
else if (typeof tagKey === 'object') {
|
|
480
530
|
if (tagDirective.componentOptions.children && (Object.keys(tagKey).indexOf(dirTag) !== -1)) {
|
|
481
|
-
ret = this.getMultiLevelDirValue(tagDirective.componentOptions.children, tagKey[dirTag], tagNameMapper);
|
|
531
|
+
ret = this.getMultiLevelDirValue(tagDirective.componentOptions.children, tagKey["" + dirTag], tagNameMapper);
|
|
532
|
+
}
|
|
533
|
+
else if (tagDirective.children && (Object.keys(tagKey).indexOf(dirTag) !== -1) && (dirTag === 'e-markersettings' || dirTag === 'e-markersetting')) {
|
|
534
|
+
ret = this.getMultiLevelDirValue(tagDirective.children, tagKey["" + dirTag], tagNameMapper);
|
|
482
535
|
}
|
|
483
536
|
if (tagDirective.data && tagDirective.data.attrs) {
|
|
484
537
|
ret = extend(ret, this.getCamelCaseProps(tagDirective.data.attrs));
|
|
@@ -494,7 +547,7 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
494
547
|
var retProps = {};
|
|
495
548
|
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
|
496
549
|
var prop = _a[_i];
|
|
497
|
-
retProps[prop.replace(/-[a-z]/g, function (e) { return e[1].toUpperCase(); })] = props[prop];
|
|
550
|
+
retProps[prop.replace(/-[a-z]/g, function (e) { return e[1].toUpperCase(); })] = props["" + prop];
|
|
498
551
|
}
|
|
499
552
|
return retProps;
|
|
500
553
|
};
|
|
@@ -23,9 +23,9 @@ export function getProps(options) {
|
|
|
23
23
|
if (options === void 0) { options = {}; }
|
|
24
24
|
if (options.props) {
|
|
25
25
|
var _loop_1 = function (prop) {
|
|
26
|
-
(options.newprops || (options.newprops = {}))[prop] = {};
|
|
27
|
-
(options.watch || (options.watch = {}))[prop] = function (newVal) {
|
|
28
|
-
this.ej2Instances[prop] = newVal;
|
|
26
|
+
(options.newprops || (options.newprops = {}))["" + prop] = {};
|
|
27
|
+
(options.watch || (options.watch = {}))["" + prop] = function (newVal) {
|
|
28
|
+
this.ej2Instances["" + prop] = newVal;
|
|
29
29
|
if (this.dataBind && (options.name !== 'DateRangePickerComponent')) {
|
|
30
30
|
this.dataBind();
|
|
31
31
|
}
|
|
@@ -53,9 +53,9 @@ export function EJcomponentFactory(Component, options) {
|
|
|
53
53
|
var proto = Component.prototype;
|
|
54
54
|
if (options.props) {
|
|
55
55
|
var _loop_2 = function (prop) {
|
|
56
|
-
(options.props || (options.props = {}))[prop] = {};
|
|
57
|
-
(options.watch || (options.watch = {}))[prop] = function (newVal) {
|
|
58
|
-
this.ej2Instances[prop] = newVal;
|
|
56
|
+
(options.props || (options.props = {}))["" + prop] = {};
|
|
57
|
+
(options.watch || (options.watch = {}))["" + prop] = function (newVal) {
|
|
58
|
+
this.ej2Instances["" + prop] = newVal;
|
|
59
59
|
if (this.dataBind && (options.name !== 'DateRangePickerComponent')) {
|
|
60
60
|
this.dataBind();
|
|
61
61
|
}
|
|
@@ -72,17 +72,17 @@ export function EJcomponentFactory(Component, options) {
|
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
if ($internalHooks.indexOf(key) > -1) {
|
|
75
|
-
options[key] = proto[key];
|
|
75
|
+
options["" + key] = proto["" + key];
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
var descriptor = Object.getOwnPropertyDescriptor(proto, key);
|
|
79
79
|
if (typeof descriptor.value === 'function') {
|
|
80
80
|
// methods
|
|
81
|
-
(options.methods || (options.methods = {}))[key] = descriptor.value;
|
|
81
|
+
(options.methods || (options.methods = {}))["" + key] = descriptor.value;
|
|
82
82
|
}
|
|
83
83
|
else if (descriptor.get || descriptor.set) {
|
|
84
84
|
// computed properties
|
|
85
|
-
(options.computed || (options.computed = {}))[key] = {
|
|
85
|
+
(options.computed || (options.computed = {}))["" + key] = {
|
|
86
86
|
get: descriptor.get,
|
|
87
87
|
set: descriptor.set
|
|
88
88
|
};
|
|
@@ -90,7 +90,7 @@ export function EJcomponentFactory(Component, options) {
|
|
|
90
90
|
});
|
|
91
91
|
Object.getOwnPropertyNames(ComponentBase.prototype).forEach(function (key) {
|
|
92
92
|
if ($internalHooks.indexOf(key) > -1) {
|
|
93
|
-
options[key] = proto[key];
|
|
93
|
+
options["" + key] = proto["" + key];
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
});
|
|
@@ -127,8 +127,8 @@ function collectDataFromConstructor(vm, Component) {
|
|
|
127
127
|
keys.forEach(function (key) {
|
|
128
128
|
if (key.charAt(0) !== '_') {
|
|
129
129
|
Object.defineProperty(_this, key, {
|
|
130
|
-
get: function () { return vm[key]; },
|
|
131
|
-
set: function (value) { return vm[key] = value; }
|
|
130
|
+
get: function () { return vm["" + key]; },
|
|
131
|
+
set: function (value) { return vm["" + key] = value; }
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
});
|
|
@@ -136,8 +136,8 @@ function collectDataFromConstructor(vm, Component) {
|
|
|
136
136
|
var data = new Component();
|
|
137
137
|
var plainData = {};
|
|
138
138
|
Object.keys(data).forEach(function (key) {
|
|
139
|
-
if (data[key] !== undefined) {
|
|
140
|
-
plainData[key] = data[key];
|
|
139
|
+
if (data["" + key] !== undefined) {
|
|
140
|
+
plainData["" + key] = data["" + key];
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
return plainData;
|
package/src/template.js
CHANGED
|
@@ -22,12 +22,12 @@ export function compile(templateElement, helper) {
|
|
|
22
22
|
// Compilation for Vue 3 slot template
|
|
23
23
|
var app = allVue.createApp({
|
|
24
24
|
render: function () {
|
|
25
|
-
return vueSlot_1[templateElement]({ data: data });
|
|
25
|
+
return vueSlot_1["" + templateElement]({ data: data });
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
if (plugins) {
|
|
29
29
|
for (var i = 0; i < plugins.length; i++) {
|
|
30
|
-
app.use(plugins[i]);
|
|
30
|
+
app.use(plugins[parseInt(i.toString(), 10)]);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
app.mount((context.getModuleName() === 'grid') ? ("#" + pid) : ("#" + id));
|
|
@@ -60,7 +60,7 @@ export function compile(templateElement, helper) {
|
|
|
60
60
|
templateCompRef = object.template._context.components[templateElement.name];
|
|
61
61
|
if (!templateCompRef) {
|
|
62
62
|
var key = Object.keys(object.template._context.components)[0];
|
|
63
|
-
templateCompRef = object.template._context.components[key];
|
|
63
|
+
templateCompRef = object.template._context.components["" + key];
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
var tempRef_1;
|
|
@@ -72,7 +72,7 @@ export function compile(templateElement, helper) {
|
|
|
72
72
|
if (templateCompRef.components) {
|
|
73
73
|
var objkeys = Object.keys(templateCompRef.components) || [];
|
|
74
74
|
var _loop_1 = function (objstring) {
|
|
75
|
-
var intComponent = templateCompRef.components[objstring];
|
|
75
|
+
var intComponent = templateCompRef.components["" + objstring];
|
|
76
76
|
if (intComponent && intComponent.data) {
|
|
77
77
|
var tempRef2_1 = Object.assign(intComponent.data(), dataObj.data);
|
|
78
78
|
intComponent.data = function () { return tempRef2_1; };
|
|
@@ -88,7 +88,7 @@ export function compile(templateElement, helper) {
|
|
|
88
88
|
var app = allVue.createApp(templateCompRef);
|
|
89
89
|
if (plugins) {
|
|
90
90
|
for (var i = 0; i < plugins.length; i++) {
|
|
91
|
-
app.use(plugins[i]);
|
|
91
|
+
app.use(plugins[parseInt(i.toString(), 10)]);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
app.mount((context.getModuleName() === 'grid') ? ("#" + pid) : ("#" + id));
|
|
@@ -101,7 +101,7 @@ export function compile(templateElement, helper) {
|
|
|
101
101
|
// Compilation for Vue 2 slot template
|
|
102
102
|
var vueTemplate = new Vue({
|
|
103
103
|
render: function () {
|
|
104
|
-
return vueSlot_2[templateElement]({ data: data });
|
|
104
|
+
return vueSlot_2["" + templateElement]({ data: data });
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
vueTemplate.$mount("#" + id);
|
|
@@ -142,10 +142,10 @@ export function compile(templateElement, helper) {
|
|
|
142
142
|
templateInstance = context.vueInstance.templateCollection;
|
|
143
143
|
}
|
|
144
144
|
if (propName) {
|
|
145
|
-
if (!templateInstance[propName]) {
|
|
146
|
-
templateInstance[propName] = [];
|
|
145
|
+
if (!templateInstance["" + propName]) {
|
|
146
|
+
templateInstance["" + propName] = [];
|
|
147
147
|
}
|
|
148
|
-
templateInstance[propName].push(returnEle[0]);
|
|
148
|
+
templateInstance["" + propName].push(returnEle[0]);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
detach(ele);
|
|
@@ -171,24 +171,24 @@ function getVueChildSlot(vueInstance, templateElement) {
|
|
|
171
171
|
var scopedSlots = vueInstance.$scopedSlots;
|
|
172
172
|
var vSlots = vueInstance.scopedSlots;
|
|
173
173
|
var children = vueInstance.children;
|
|
174
|
-
if (scopedSlots && scopedSlots[templateElement]) {
|
|
174
|
+
if (scopedSlots && scopedSlots["" + templateElement]) {
|
|
175
175
|
return scopedSlots;
|
|
176
176
|
}
|
|
177
177
|
else if (slots && slots.default) {
|
|
178
178
|
var childSlots = slots.default;
|
|
179
179
|
for (var i = 0; i < childSlots.length; i++) {
|
|
180
|
-
var slot = getVueChildSlot(getSlot(childSlots[i]), templateElement);
|
|
180
|
+
var slot = getVueChildSlot(getSlot(childSlots[parseInt(i.toString(), 10)]), templateElement);
|
|
181
181
|
if (slot) {
|
|
182
182
|
return slot;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
else if (vSlots && vSlots[templateElement]) {
|
|
186
|
+
else if (vSlots && vSlots["" + templateElement]) {
|
|
187
187
|
return vSlots;
|
|
188
188
|
}
|
|
189
189
|
else if (children) {
|
|
190
190
|
for (var i = 0; i < children.length; i++) {
|
|
191
|
-
var slot = getVueChildSlot(getSlot(children[i]), templateElement);
|
|
191
|
+
var slot = getVueChildSlot(getSlot(children[parseInt(i.toString(), 10)]), templateElement);
|
|
192
192
|
if (slot) {
|
|
193
193
|
return slot;
|
|
194
194
|
}
|
|
@@ -197,7 +197,8 @@ function getVueChildSlot(vueInstance, templateElement) {
|
|
|
197
197
|
return undefined;
|
|
198
198
|
}
|
|
199
199
|
function getSlot(vnode) {
|
|
200
|
-
var slot = (vnode.componentOptions && vnode.componentOptions.children) ? vnode.componentOptions :
|
|
200
|
+
var slot = (vnode.componentOptions && vnode.componentOptions.children) ? vnode.componentOptions :
|
|
201
|
+
(!vnode.data && (vnode.tag === 'e-markersettings' || vnode.tag === 'e-markersetting')) ? vnode : vnode.data;
|
|
201
202
|
return vnode.componentInstance ? vnode.componentInstance : slot;
|
|
202
203
|
}
|
|
203
204
|
// Get the Vue3 slot template from the root or current Vue component.
|
|
@@ -209,13 +210,13 @@ function getCurrentVueSlot(vueInstance, templateElement, root) {
|
|
|
209
210
|
return getChildVueSlot(slots, templateElement);
|
|
210
211
|
}
|
|
211
212
|
function getChildVueSlot(slots, templateElement) {
|
|
212
|
-
if (slots && slots[templateElement]) {
|
|
213
|
+
if (slots && slots["" + templateElement]) {
|
|
213
214
|
return slots;
|
|
214
215
|
}
|
|
215
216
|
else if (slots && slots.default) {
|
|
216
217
|
var childSlots = slots.default();
|
|
217
218
|
for (var i = 0; i < childSlots.length; i++) {
|
|
218
|
-
var slot = getChildVueSlot(childSlots[i].children, templateElement);
|
|
219
|
+
var slot = getChildVueSlot(childSlots[parseInt(i.toString(), 10)].children, templateElement);
|
|
219
220
|
if (slot) {
|
|
220
221
|
return slot;
|
|
221
222
|
}
|